From 2b99047683332624832c1dfcae596e957a710b7d Mon Sep 17 00:00:00 2001
From: ZZJ <10913410+zzj2100@user.noreply.gitee.com>
Date: 星期四, 28 七月 2022 10:20:49 +0800
Subject: [PATCH] bug修复
---
src/views/hashrate/CameraManage/CameraRules/components/TimeSlider.vue | 54 +++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 39 insertions(+), 15 deletions(-)
diff --git a/src/views/hashrate/CameraManage/CameraRules/components/TimeSlider.vue b/src/views/hashrate/CameraManage/CameraRules/components/TimeSlider.vue
index 166d1cc..c000dc0 100644
--- a/src/views/hashrate/CameraManage/CameraRules/components/TimeSlider.vue
+++ b/src/views/hashrate/CameraManage/CameraRules/components/TimeSlider.vue
@@ -59,7 +59,11 @@
:key="item.id"
:class="{ active: activeTabObj.id === item.id }"
>
- <div class="tab" @click="chooseTab(item)">
+ <div
+ class="tab"
+ @click="chooseTab(item)"
+ @dblclick="chooseEdit(item)"
+ >
{{ item.name }}
</div>
<div class="iconfont del" @click="handleTabsEdit(item.id, 'remove')">
@@ -177,6 +181,33 @@
};
});
},
+ chooseEdit(data) {
+ this.$prompt("璇疯緭鍏ユ柊鐨勬椂闂存鍚嶇О", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ })
+ .then(({ value }) => {
+ let repeat = false;
+ this.VideoManageData.TimeRules.forEach((item) => {
+ if (item.name === value) {
+ repeat = true;
+ }
+ });
+ console.log("aaa");
+ console.log(repeat);
+ if (repeat) {
+ this.$notify({
+ message: "鍚嶇О涓嶈兘閲嶅",
+ type: "warning",
+ });
+ return;
+ }
+
+ this.activeTabObj.name = value;
+ this.save();
+ })
+ .catch(() => {});
+ },
handleTabsEdit(tabId, action) {
let tabs = this.VideoManageData.TimeRules;
@@ -236,14 +267,11 @@
return;
}
- this.$confirm(
- "姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ヨ鍒�, 鎵�鍏宠仈鐨勪换鍔″皢浼氬け鏁堬紝鏄惁缁х画?",
- {
- center: true,
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- }
- )
+ this.$confirm("姝ゆ搷浣滃皢鍒犻櫎璇ヨ鍒�, 鎵�鍏宠仈鐨勪换鍔″皢浼氬け鏁堬紝鏄惁缁х画?", {
+ center: true,
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ })
.then(() => {
deleteTimeRule({ id: tabId }).then((rsp) => {
if (rsp && rsp.success) {
@@ -325,10 +353,6 @@
this.isAdding = false;
})
.catch(() => {
- this.$notify({
- type: "warning",
- message: rsp.msg,
- });
this.isAdding = false;
});
},
@@ -371,7 +395,7 @@
padding: 0 20px;
margin-top: 20px;
display: flex;
- justify-content: end;
+ justify-content: flex-end;
text-align: center;
line-height: 32px;
font-size: 14px;
@@ -468,7 +492,7 @@
.btns {
position: absolute;
display: flex;
- justify-content: end;
+ justify-content: flex-end;
align-items: center;
left: 0;
right: 0;
--
Gitblit v1.8.0