From 509171ab4b3b4f2115512bdfb09a583024fb5c53 Mon Sep 17 00:00:00 2001 From: heyujie <516346543@qq.com> Date: 星期二, 14 九月 2021 18:39:20 +0800 Subject: [PATCH] all --- src/pages/settings/views/generalSettings.vue | 98 ++++++++++++++++++++++++++---------------------- 1 files changed, 53 insertions(+), 45 deletions(-) diff --git a/src/pages/settings/views/generalSettings.vue b/src/pages/settings/views/generalSettings.vue index ab8edcb..62220d2 100644 --- a/src/pages/settings/views/generalSettings.vue +++ b/src/pages/settings/views/generalSettings.vue @@ -9,12 +9,14 @@ v-for="(item, i) in menuArr" :key="i" > - <span class="iconfont" :style="`font-size:${item.size}px;`">{{ item.icon }}</span> + <span class="iconfont" :style="`font-size:${item.size}px;`">{{ + item.icon + }}</span> <span class="title">{{ item.name }}</span> </div> </div> <div class="general-right"> - <div class="lang" v-if="activePage == 0"> + <!-- <div class="lang" v-if="activePage == 0"> <div class="bar"> <span class="name">璁惧ID</span> <span class="desc">{{ deviceInfo.server_id }}</span> @@ -55,8 +57,8 @@ <span class="name">杩愯鏃堕棿</span> <span class="desc">{{ deviceInfo.runningTime }}</span> </div> - </div> - <div class="lang" v-if="activePage == 1"> + </div> --> + <div class="lang" v-if="activePage == 0"> <div class="min-dur"> <div class="title">鎶撴媿鍓嶅綍鍍忔椂闀�</div> <div class="entity"> @@ -66,7 +68,8 @@ v-model="fakeObj.min" id="cut_min_duration" :min="5 / 1.2" - :max="100" :step="5 / 1.2" + :max="100" + :step="5 / 1.2" @input="min_len = min_video_len" show-stops :show-tooltip="true" @@ -77,8 +80,10 @@ v-model="min_len" @change="fakeObj.min = +(min_len / 1.2)" controls-position="right" - :min="5" :step="5" - :max="120" step-strictly + :min="5" + :step="5" + :max="120" + step-strictly size="small" ></el-input-number > s @@ -94,7 +99,8 @@ id="cut_max_duration" :min="5 / 1.2" @input="max_len = max_video_len" - :max="100" :step="5 / 1.2" + :max="100" + :step="5 / 1.2" show-stops :format-tooltip="formatTooltip" :show-tooltip="true" @@ -104,7 +110,9 @@ v-model="max_len" @change="fakeObj.max = +(max_len / 1.2)" controls-position="right" - :min="5" :step="5" step-strictly + :min="5" + :step="5" + step-strictly :max="120" size="small" ></el-input-number @@ -114,7 +122,7 @@ <div class="save-btn" @click="submitAlarm">淇濆瓨</div> </div> - <div class="lang" v-if="activePage == 2"> + <div class="lang" v-if="activePage == 1"> <div class="title">浜嬩欢澹伴煶</div> <div class="bar-group"> <div @@ -150,21 +158,23 @@ </div> </div> </div> - <el-upload - class="upload-demo" - drag - action="https://jsonplaceholder.typicode.com/posts/" - :http-request="uploadSound" - v-if="showUpload" - :show-file-list="false" - > - <i class="el-icon-upload"></i> - <div class="el-upload__text"> - 浜嬩欢澹伴煶鏂囦欢鎷栧埌姝ゅ锛屾垨 - <em>鐐瑰嚮涓婁紶</em> - <br />浠呮敮鎸乵p3/wma绛夋牸寮� - </div> - </el-upload> + <div v-if="showUpload" @click.stop> + <el-upload + class="upload-demo" + drag + action="" + :http-request="uploadSound" + :show-file-list="false" + > + <i class="el-icon-upload"></i> + <div class="el-upload__text"> + 浜嬩欢澹伴煶鏂囦欢鎷栧埌姝ゅ锛屾垨 + <em>鐐瑰嚮涓婁紶</em> + <br />浠呮敮鎸乵p3/wma绛夋牸寮� + </div> + </el-upload> + </div> + <div class="add-group"> <div class="add-btn"> <span class="icon iconfont" @click.stop="showUpload = !showUpload" @@ -174,7 +184,7 @@ </div> </div> - <div class="self-setting" v-if="activePage == 3"> + <div class="self-setting" v-if="activePage == 2"> <div class="top-title">鍥炬爣涓婚</div> <div class="icon-bar" style="cursor: pointer" @click="selectIcons(0)"> @@ -240,7 +250,6 @@ <script> import { saveAlarmConfig, getDevInfo } from "@/api/system"; import { uploadSound, getSoundList, deleteSound } from "@/api/event"; -// import config from "../../../../package.json"; export default { data() { @@ -255,10 +264,10 @@ max: 0, }, menuArr: [ - { name: "璁惧淇℃伅", icon: "\ue933" ,size:18}, - { name: "浜嬩欢褰曞儚鏃堕暱", icon: "\ue6f3" ,size:20}, - { name: "浜嬩欢澹伴煶", icon: "\ue6e1" ,size:16}, - { name: "涓�у寲璁剧疆", icon: "\ue756" ,size:18}, + // { name: "璁惧淇℃伅", icon: "\ue933" ,size:18}, + { name: "浜嬩欢褰曞儚鏃堕暱", icon: "\ue6f3", size: 20 }, + { name: "浜嬩欢澹伴煶", icon: "\ue6e1", size: 16 }, + { name: "涓�у寲璁剧疆", icon: "\ue756", size: 18 }, ], soundList: [], activePage: 0, @@ -304,16 +313,16 @@ _this.curPlayingIndex = null; } }); - const url = localStorage.getItem("backgroundPic") + const url = localStorage.getItem("backgroundPic"); if (url) { - const arr = url.split("/") - this.activeBg= this.tableBGList.findIndex((x) => { - return x.url.includes(arr[arr.length-1]) - }) - }else{ - this.activeBg= 0 + const arr = url.split("/"); + this.activeBg = this.tableBGList.findIndex((x) => { + return x.url.includes(arr[arr.length - 1]); + }); + } else { + this.activeBg = 0; } - const e = this.$refs.curPage + const e = this.$refs.curPage; e.addEventListener("click", (e) => { if (this.showUpload) { this.showUpload = false; @@ -321,7 +330,7 @@ }); }, beforeDestroy() { - this.$refs.curPage.removeEventListener("click") + this.$refs.curPage.removeEventListener("click"); }, computed: { min_video_len() { @@ -400,13 +409,12 @@ return day + "澶� " + hour + "灏忔椂 " + minute + "鍒� " + second + "绉�"; }, uploadSound(params) { - debugger let param = new FormData(); param.append("file", params.file); uploadSound(param).then( (res) => { this.$message.success("涓婁紶鎴愬姛"); - this.showUpload = false + this.showUpload = false; this.getSounds(); }, (err) => { @@ -775,11 +783,11 @@ margin-right: 12px; cursor: pointer; // width: 120px; - height: 80px; + height: 80px; border: 2px solid transparent; img { - border-radius: 5px; - height: 100%; + border-radius: 5px; + height: 100%; } } .bg-img:hover { -- Gitblit v1.8.0