From d7e24c64a3961040fdc7fec835c2efa5d2f106c0 Mon Sep 17 00:00:00 2001
From: ZZJ <zzjdsg2300@163.com>
Date: 星期日, 26 九月 2021 19:54:54 +0800
Subject: [PATCH] 弹层层级bug修复v2
---
src/pages/settings/views/generalSettings.vue | 406 +++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 279 insertions(+), 127 deletions(-)
diff --git a/src/pages/settings/views/generalSettings.vue b/src/pages/settings/views/generalSettings.vue
index dcb849c..b80b46c 100644
--- a/src/pages/settings/views/generalSettings.vue
+++ b/src/pages/settings/views/generalSettings.vue
@@ -1,6 +1,6 @@
<template>
- <div class="all">
- <div class="general-set">
+ <div class="all" ref="curPage">
+ <div class="general-seting">
<div class="general-center" ref="left">
<div
class="menu-item"
@@ -9,12 +9,14 @@
v-for="(item, i) in menuArr"
:key="i"
>
- <span class="iconfont">{{ 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,32 +57,33 @@
<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">
- <div class="sec">
- {{min_video_len }}s
- </div>
+ <div class="sec">{{ min_video_len }}s</div>
<div class="block">
<el-slider
v-model="fakeObj.min"
id="cut_min_duration"
:min="5 / 1.2"
:max="100"
- @input="min_len=min_video_len"
- :show-tooltip="false"
+ :step="5 / 1.2"
+ @input="min_len = min_video_len"
+ show-stops
+ :show-tooltip="true"
+ :format-tooltip="formatTooltip"
></el-slider>
- <!-- show-stops
- :step="5/1.2" -->
</div>
<el-input-number
v-model="min_len"
- @change="fakeObj.min=+((min_len/1.2))"
+ @change="fakeObj.min = +(min_len / 1.2)"
controls-position="right"
:min="5"
+ :step="5"
:max="120"
+ step-strictly
size="small"
></el-input-number
> s
@@ -89,22 +92,27 @@
<div class="min-dur">
<div class="title">鎶撴媿鍚庡綍鍍忔椂闀�</div>
<div class="entity">
- <div class="sec"> {{ max_video_len }} s</div>
+ <div class="sec">{{ max_video_len }} s</div>
<div class="block">
<el-slider
v-model="fakeObj.max"
id="cut_max_duration"
:min="5 / 1.2"
- @input="max_len=max_video_len"
+ @input="max_len = max_video_len"
:max="100"
- :show-tooltip="false"
+ :step="5 / 1.2"
+ show-stops
+ :format-tooltip="formatTooltip"
+ :show-tooltip="true"
></el-slider>
</div>
<el-input-number
v-model="max_len"
- @change="fakeObj.max=+((max_len/1.2))"
+ @change="fakeObj.max = +(max_len / 1.2)"
controls-position="right"
:min="5"
+ :step="5"
+ step-strictly
:max="120"
size="small"
></el-input-number
@@ -114,8 +122,8 @@
<div class="save-btn" @click="submitAlarm">淇濆瓨</div>
</div>
- <div class="lang" v-if="activePage == 2">
- <div class="title">浜嬩欢澹伴煶</div>
+ <div class="lang" v-if="activePage == 1">
+ <div class="bar title voice-title" style="border: 2px solid #fff;">浜嬩欢澹伴煶</div>
<div class="bar-group">
<div
class="bar"
@@ -125,56 +133,54 @@
ref="soundBar"
>
<div class="left-part">
- <span
- class="icon iconfont"
- style="margin-right: 12px; color: dodgerblue"
- ></span
- >
<span class="name">{{ item.name }}</span>
</div>
<div class="btns">
<span @click="togglePlay(item, i)">
+
+ <span class="iconfont" v-if="!item.isPlay" style="cursor: pointer;">{{playSpan}}</span>
+ <span class="iconfont" v-else style="cursor: pointer;">{{playSpan2}}</span>
+<!--
<i
v-if="!item.isPlay"
class="el-icon-video-play"
style=""
></i>
- <i v-else class="el-icon-video-pause"></i>
+ <i v-else class="el-icon-video-pause"></i> -->
</span>
<span
- class="icon iconfont"
- style="cursor: pointer; color: indianred"
+ class="icon iconfont del"
+ style="cursor: pointer;"
@click="removeSound(item)"
- ></span
+ >{{delspan}}</span
>
</div>
</div>
</div>
- <el-upload
- class="upload-demo"
- drag
- action="https://jsonplaceholder.typicode.com/posts/"
- :http-request="uploadSound"
- v-show="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"
+ >
+ <div class="info">璇峰皢澹伴煶浜嬩欢鏂囦欢鎷栨嫿鍒版澶勶紝鎴�<span class="info-click" >鐐瑰嚮涓婁紶</span></div>
+ <div class="des" v-if="showUpload" @click.stop>浠呮敮鎸乵p3銆亀av绛夋牸寮�</div>
+ </el-upload>
+ </div>
+
+
<div class="add-group">
<div class="add-btn">
- <span class="icon iconfont" @click="showUpload = !showUpload"
+ <span class="icon iconfont" @click.stop="showUpload = !showUpload"
></span
>
</div>
</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)">
@@ -192,6 +198,7 @@
class="entity-img"
v-for="(item, i) in realIconList"
:key="i"
+ @click="colorCard(item.color)"
>
<img :src="item.url" alt="" />
</div>
@@ -240,29 +247,28 @@
<script>
import { saveAlarmConfig, getDevInfo } from "@/api/system";
import { uploadSound, getSoundList, deleteSound } from "@/api/event";
-import config from "../../../../package.json";
export default {
data() {
return {
+ playSpan:"\ue6e8",
+ playSpan2:"\ue6e8",
+ delspan:"\ue6e8",
+ warnSpn:"\ue6e8",
curPlayingIndex: null,
showUpload: false,
activeIcons: 0,
- // alarmConf: {
- // min_video_len: 10,
- // max_video_len: 15,
- // },
- min_len:10,
- max_len:15,
- fakeObj:{
- min:10,
- max:15
+ min_len: 0,
+ max_len: 0,
+ fakeObj: {
+ min: 0,
+ max: 0,
},
menuArr: [
- { name: "璁惧淇℃伅", icon: "\ue933" },
- { name: "浜嬩欢褰曞儚鏃堕暱", icon: "\ue6f3" },
- { name: "浜嬩欢澹伴煶", icon: "\ue6e1" },
- { name: "涓�у寲璁剧疆", icon: "\ue756" },
+ // { name: "璁惧淇℃伅", icon: "\ue933" ,size:18},
+ { name: "浜嬩欢褰曞儚鏃堕暱", icon: "\ue6f3", size: 20 },
+ { name: "浜嬩欢澹伴煶", icon: "\ue6e1", size: 16 },
+ { name: "涓�у寲璁剧疆", icon: "\ue756", size: 18 },
],
soundList: [],
activePage: 0,
@@ -282,9 +288,9 @@
},
isPlay: false,
realIconList: [
- { url: "/images/settings/鏃ュ織绠$悊.png" },
- { url: "/images/settings/瀹炴椂鐩戞帶.png" },
- { url: "/images/settings/鏁版嵁鍙鍖�.png" },
+ { url: "/images/settings/鏃ュ織绠$悊.png",color:"green" },
+ { url: "/images/settings/瀹炴椂鐩戞帶.png",color:"yellow" },
+ { url: "/images/settings/鏁版嵁鍙鍖�.png",color:"pink" },
],
flatIconList: [
{ url: "/images/settings/鏁版嵁鎺ㄩ��.png" },
@@ -308,16 +314,37 @@
_this.curPlayingIndex = null;
}
});
+ 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 e = this.$refs.curPage;
+ e.addEventListener("click", (e) => {
+ if (this.showUpload) {
+ this.showUpload = false;
+ }
+ });
+ },
+ beforeDestroy() {
+ this.$refs.curPage.removeEventListener("click");
},
computed: {
- min_video_len(){
- return +((this.fakeObj.min* 1.2).toFixed(0))
+ min_video_len() {
+ return Math.round(this.fakeObj.min * 1.2);
},
- max_video_len(){
- return +((this.fakeObj.max* 1.2).toFixed(0))
+ max_video_len() {
+ return Math.round(this.fakeObj.max * 1.2);
},
},
methods: {
+ formatTooltip(v) {
+ return Math.round(v * 1.2);
+ },
pickBg(item, i) {
this.activeBg = i;
let message = "changeBackground?" + item.name;
@@ -357,13 +384,12 @@
this.deviceInfo.deviceDesc = basic.deviceDesc;
this.deviceInfo.masterVersion = basic.masterVersion;
this.deviceInfo.channelCount = basic.channelCount;
- this.deviceInfo.webVersion = "V" + config.version;
+ this.deviceInfo.webVersion = "V2.0.0";
this.deviceInfo.disks = "( " + info.disk + ") ";
this.deviceInfo.memory =
(info.mem.total / 1024 / 1024 / 1024).toFixed(2) + "GB";
- this.min_len = basic.min_video_len
- this.fakeObj.min = +((basic.min_video_len/1.2).toFixed(0));
- this.fakeObj.max = +((basic.max_video_len/1.2).toFixed(0));
+ this.fakeObj.min = basic.min_video_len / 1.2;
+ this.fakeObj.max = basic.max_video_len / 1.2;
});
},
getSounds() {
@@ -389,6 +415,7 @@
uploadSound(param).then(
(res) => {
this.$message.success("涓婁紶鎴愬姛");
+ this.showUpload = false;
this.getSounds();
},
(err) => {
@@ -403,11 +430,18 @@
this.activeIcons = i;
},
removeSound(item) {
- this.$confirm("鎮ㄦ槸鍚︾‘璁ゅ垹闄や簨浠跺0闊�", "鍒犻櫎浜嬩欢澹伴煶", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- }).then(() => {
+ const h = this.$createElement;
+ const icon =
+ this.$msgbox({
+ message: h('div', {style: 'display: flex; flex-direction: column; justify-content: center; align-items: center;'}, [
+ h('span',{class:'iconfont warn-icon'},`${this.warnSpn}`),
+ h('span', {class:'warn-title'}, '鍒犻櫎浜嬩欢澹伴煶 '),
+ h('span', {class:'warn-dec'}, '鎮ㄦ槸鍚︾‘璁ゅ垹闄や簨浠跺0闊�?')
+ ]),
+ showCancelButton: true,
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ }).then(() => {
deleteSound({
id: item.id,
}).then(
@@ -429,19 +463,18 @@
},
clickSound(item, i) {
this.$refs["soundBar"].forEach((x) => {
- x.style.backgroundColor = "rgba(248, 248, 248, 1)";
+ x.style = "border: 2px solid #FFF;";
});
- this.$refs["soundBar"][i].style.backgroundColor =
- "rgba(233, 233, 233, 1)";
+ this.$refs["soundBar"][i].style =
+ "border: 2px solid #4E94FF;";
},
submitAlarm() {
- debugger;
saveAlarmConfig({
min_video_len: this.min_video_len,
- max_video_len: this.max_video_len
+ max_video_len: this.max_video_len,
}).then((res) => {
if (res && res.success) {
- this.getDeviceInfo()
+ this.getDeviceInfo();
this.$notify({
type: "success",
message: "淇濆瓨鎴愬姛",
@@ -449,15 +482,21 @@
}
});
},
+ colorCard(color) {
+ document.documentElement.style.setProperty('--colorCard',`${color}`)
+ localStorage.setItem('--colorCard',`${color}`)
+ }
},
};
</script>
-<style lang="scss">
+
+<style scoped lang="scss">
+
.all {
width: 100%;
}
-.general-set {
+.general-seting {
height: 100%;
display: flex;
flex-direction: row;
@@ -466,39 +505,43 @@
box-sizing: border-box;
.general-center {
height: 100%;
- width: 280px;
+ width: 300px;
overflow: auto;
box-sizing: border-box;
flex-shrink: 0;
- padding: 10px;
- border-right: 5px solid #f8f8f8;
+ padding: 24px 10px;
+ border-right: 4px solid #F2F2F7;
+ background-color: #FBFAFF;
+
+
.menu-item {
- background-color: #f8f8f8;
- height: 50px;
- margin-bottom: 10px;
- border-radius: 10px;
- line-height: 50px;
+
+ height: 56px;
+ margin-bottom: 4px;
+ border-radius: 8px;
+ line-height: 56px;
box-sizing: border-box;
- font-size: 14px;
- padding: 0 20px;
+ font-size: 16px;
+ padding-left: 15px;
cursor: pointer;
display: flex;
.iconfont {
- margin-right: 12px;
+ margin: 0 17px;
+ font-size: 24px !important;
}
.title {
font-size: 16px;
+ font-weight: 700;
}
}
.menu-item-active {
- background-color: #3d68e1;
- color: white;
+ background-color: var(--colorCard) !important;
+ color: white !important;
}
- .menu-item:hover {
- background-color: #3d68e1;
- color: white;
- }
+ /* .menu-item:hover {
+ background-color: #F2F2F7;
+ } */
}
.general-right {
flex: 1;
@@ -506,7 +549,7 @@
overflow: auto;
box-sizing: border-box;
- padding: 20px 40px;
+ padding: 10px 18px 10px 10px;
.el-form-item.is-required:not(.is-no-asterisk)
> .el-form-item__label:before,
.el-form-item.is-required:not(.is-no-asterisk)
@@ -548,36 +591,35 @@
text-align: left;
margin-bottom: 5px;
}
+ .voice-title {
+ justify-content: center !important;
+ font-weight: 700 ;
+ }
.bar-group {
overflow: auto;
- height: 100%;
+ height: 520px;
}
.bar {
- height: 44px;
+ height: 48px;
background-color: #f8f8f8;
border-radius: 10px;
- line-height: 44px;
+ line-height: 48px;
box-sizing: border-box;
- padding: 0 30px 0 20px;
+ padding: 0 20px 0 20px;
+ font-weight: 700;
display: flex;
justify-content: space-between;
- margin-bottom: 10px;
- .left-part {
- .icon {
- color: rgba(191, 191, 191, 1);
- font-size: 16px;
- margin-right: 5px;
- }
- }
+ margin-bottom: 2px;
+ border: 2px solid #fff;
.name {
- font-size: 15px;
- }
+ font-size: 14px;
+ }
.btns {
- width: 50px;
+ width: 52px;
display: flex;
justify-content: space-between;
color: rgba(191, 191, 191, 1);
- .el-icon-video-pause {
+ /* .el-icon-video-pause {
cursor: pointer;
font-size: 23px;
vertical-align: middle;
@@ -588,6 +630,12 @@
font-size: 23px;
vertical-align: middle;
color: #409eff;
+ } */
+ span {
+ color: #333
+ }
+ .del:hover {
+ color:#FC4958;
}
}
.desc {
@@ -595,11 +643,11 @@
color: rgba(134, 134, 134, 1);
}
}
- .bar:hover {
- background-color: rgba(233, 233, 233, 1);
- }
+ /* .bar:hover {
+ border: 2px solid #4E94FF !important;
+ } */
.add-group {
- margin: 10px auto;
+ margin: 54px auto;
width: fit-content;
}
.upload-demo {
@@ -607,7 +655,6 @@
transition: all 0.5s;
position: absolute;
bottom: -40px;
-
left: calc(50% - 145px);
.el-upload-dragger {
width: 290px;
@@ -620,7 +667,7 @@
cursor: pointer;
width: fit-content;
.icon {
- font-size: 32px;
+ font-size: 40px;
color: rgba(61, 104, 225, 1);
}
}
@@ -757,12 +804,11 @@
.bg-img {
margin-right: 12px;
cursor: pointer;
- width: 120px;
+ // width: 120px;
+ height: 80px;
border: 2px solid transparent;
img {
- width: 120px;
border-radius: 5px;
-
height: 100%;
}
}
@@ -777,4 +823,110 @@
}
}
}
+.v-modal {
+ opacity:0.35 !important;
+ border-radius: 8px !important;
+}
+
+.el-message-box {
+position: absolute;
+width: 420px;
+height: 210px;
+left: 302px;
+top: 279px;
+
+background: #FFFFFF;
+border-radius: 8px;
+}
+
+.upload-demo {
+top: 452px;
+left: 2px !important;
+width: 452px;
+height: 150px;
+background: #FFFFFF;
+box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
+border-radius: 8px;
+
+::v-deep .el-upload-dragger {
+display: flex;
+justify-content: center;
+align-items: center;
+overflow: visible;
+width: 340px;
+height: 72px;
+margin-top:30px ;
+}
+
+
+.info {
+
+font-weight: bold;
+font-size: 14px;
+color: #828282;
+}
+
+.info-click {
+ color: #4E94FF;
+ text-decoration: underline;
+}
+
+}
+
+.des {
+ position: absolute;
+ top: 78px;
+ left: 109px;
+ z-index: 999;
+ color: #4F4F4F;
+ font-weight: bold;
+ font-size: 12px;
+}
+
+</style>
+
+<style lang="scss">
+.el-message-box {
+ .warn-icon {
+ color:rgba(254, 109, 104, 1) ;
+ font-size: 50px;
+ margin-top:26px ;
+ }
+ .warn-title {
+ font-weight: bold;
+ font-size: 16px;
+ margin: 5px;
+ }
+ .warn-dec {
+ font-weight: bold;
+ font-size: 14px;
+ color: #828282;
+ }
+ .el-message-box__btns {
+ display: flex;
+ justify-content: center;
+ margin-top: 10px;
+ button {
+ width: 175px;
+ height: 40px;
+ border-radius: 25px;
+ span {
+ font-size: 16px;
+ font-weight: 700;
+ }
+ }
+ button:first-child {
+ background-color: #E0E0E0;
+ span {
+ color: #333333;
+ }
+ }
+ button:last-child {
+ background-color: #4E94FF !important;
+ span {
+ color: #fff;
+ }
+ }
+ }
+}
</style>
--
Gitblit v1.8.0