From feaf0a9778879ef211c5587a513ba4cbdabb52d0 Mon Sep 17 00:00:00 2001 From: ZZJ <10913410+zzj2100@user.noreply.gitee.com> Date: 星期四, 23 六月 2022 17:42:58 +0800 Subject: [PATCH] bug修复 --- public/images/appCenter/Group-11.png | 0 src/pages/ai/index/App.vue | 33 src/pages/ai/index/detail.vue | 3 src/pages/systemSettings/components/ClusterManagement.vue | 16 src/pages/datapush/index/RightEvent.vue | 536 +++++++++------ public/css/common.scss | 2 src/pages/library/components/personList.vue | 983 +++++++++++++++++++--------- src/pages/settings/views/generalSettings.vue | 351 +++++---- src/pages/datapush/index/LeftList.vue | 64 + src/pages/settings/views/NetSettings.vue | 9 public/images/appCenter/Group-112.png | 0 11 files changed, 1,257 insertions(+), 740 deletions(-) diff --git a/public/css/common.scss b/public/css/common.scss index cbcce41..70842e0 100644 --- a/public/css/common.scss +++ b/public/css/common.scss @@ -331,3 +331,5 @@ border-color: #3d68e1; background-color: #3d68e1; } + + diff --git a/public/images/appCenter/Group-11.png b/public/images/appCenter/Group-11.png new file mode 100644 index 0000000..25166fd --- /dev/null +++ b/public/images/appCenter/Group-11.png Binary files differ diff --git a/public/images/appCenter/Group-112.png b/public/images/appCenter/Group-112.png index 25166fd..bd72a28 100644 --- a/public/images/appCenter/Group-112.png +++ b/public/images/appCenter/Group-112.png Binary files differ diff --git a/src/pages/ai/index/App.vue b/src/pages/ai/index/App.vue index f6b37d5..9f98453 100644 --- a/src/pages/ai/index/App.vue +++ b/src/pages/ai/index/App.vue @@ -84,7 +84,12 @@ <img v-else :src="item.icon" alt /> </div> <div class="desc"> - <div class="desc-1">{{ item.sdk_name || item.name }}</div> + <el-tooltip + :content="item.sdk_name || item.name" + effect="light" + > + <div class="desc-1">{{ item.sdk_name || item.name }}</div> + </el-tooltip> <div class="desc-2">鐗堟湰 {{ item.version }}</div> </div> <div class="right-icon"> @@ -164,7 +169,12 @@ <img v-else :src="item.icon" alt /> </div> <div class="desc"> - <div class="desc-1">{{ item.sdk_name || item.name }}</div> + <el-tooltip + :content="item.sdk_name || item.name" + effect="light" + > + <div class="desc-1">{{ item.sdk_name || item.name }}</div> + </el-tooltip> <div class="desc-2">鐗堟湰 {{ item.version }}</div> </div> <div class="right-btn"> @@ -300,7 +310,12 @@ <img v-else :src="item.icon" alt /> </div> <div class="desc"> - <div class="desc-1">{{ item.sdk_name || item.name }}</div> + <el-tooltip + :content="item.sdk_name || item.name" + effect="light" + > + <div class="desc-1">{{ item.sdk_name || item.name }}</div> + </el-tooltip> <div class="desc-2">鐗堟湰 {{ item.version }}</div> </div> <div class="right-btn"> @@ -350,7 +365,7 @@ tip :sourceType="3" :isDrag="true" - :attrs="{accept:'.zip,.tar,.gz,.tar.gz'}" + :attrs="{ accept: '.zip,.tar,.gz,.tar.gz' }" tipWords="鐐瑰嚮涓婁紶" uploadPlaceholder="绠楁硶杞欢" url="/data/api-v/sdk/upload" @@ -986,6 +1001,7 @@ <style lang="scss"> .s-task-manage { width: 100% !important; + min-width: 754px !important; height: 100%; box-sizing: border-box; text-align: left; @@ -1562,5 +1578,14 @@ } } } + +@media screen and (max-width: 800px) { + .quick-path .left-items .quick-item:last-child { + display: none !important; + } + .quick-path .left-items .quick-item:nth-child(2) { + border: none !important; + } +} </style> diff --git a/src/pages/ai/index/detail.vue b/src/pages/ai/index/detail.vue index 3739998..49c80a7 100644 --- a/src/pages/ai/index/detail.vue +++ b/src/pages/ai/index/detail.vue @@ -158,7 +158,10 @@ /> </div> <div class="desc"> + <el-tooltip :content="item.name" effect="light"> + <div class="desc-1">{{ item.name }}</div> + </el-tooltip> <div class="desc-2">鐗堟湰 {{ item.productVersion || "2.0.0" }}</div> </div> <div class="right-btn"> diff --git a/src/pages/datapush/index/LeftList.vue b/src/pages/datapush/index/LeftList.vue index c4ee556..d0e15ec 100644 --- a/src/pages/datapush/index/LeftList.vue +++ b/src/pages/datapush/index/LeftList.vue @@ -1,26 +1,34 @@ <template> <div class="out-div"> <div class="flex-center left-list"> - <el-input placeholder="璇疯緭鍏ュ唴瀹�" v-model="eventName" size="mini" style="width: 280px"> + <el-input + @change="findAll" + placeholder="璇疯緭鍏ュ唴瀹�" + v-model="eventName" + size="mini" + style="width: 280px" + > <i slot="suffix" class="el-input__icon el-icon-search"></i> </el-input> - <div class="icon-btn" @click="add" style="margin-left:10px"> + <div class="icon-btn" @click="add" style="margin-left: 10px"> <i class="el-icon-circle-plus-outline"></i> <span> 鏂板</span> </div> </div> - <div class="max-height" style="overflow-y:auto;overflow-x:hidden"> + <div class="max-height" style="overflow-y: auto; overflow-x: hidden"> <el-row class="cursor-pointer" v-for="(item, index) in eventList" :key="item.id" @click.native="clickCategory(index, item)" - :class="{activeRow:categoryIndex==index}" + :class="{ activeRow: categoryIndex == index }" > <div class="event-name"> - <b>{{item.name}}</b> - <p style="margin-top:8px; color:#9e9e9e">{{item.time_start}} ~ {{item.time_end}}</p> + <b>{{ item.name }}</b> + <p style="margin-top: 8px; color: #9e9e9e"> + {{ item.time_start }} ~ {{ item.time_end }} + </p> </div> <div class="event-btn"> @@ -29,11 +37,11 @@ @change="enabled(item)" :inactive-value="false" :active-value="true" - style="margin-top:-5px" + style="margin-top: -5px" ></el-switch> <span class="iconfont iconshanchu iconStyle1" - style="color:#E74C3C" + style="color: #e74c3c" @click.stop="deleteBase(item)" ></span> </div> @@ -49,24 +57,24 @@ props: { listWidth: { default: "350px", - type: String + type: String, }, title: { default: "", - type: String + type: String, }, isSelected: { default: false, - type: Boolean + type: Boolean, }, type: { default: "", - type: String + type: String, }, activeId: { default: "", - type: String - } + type: String, + }, }, data() { return { @@ -76,7 +84,7 @@ // 褰撳墠鐐瑰嚮鐨勪簨浠跺璞� clickBase: {}, // 浜嬩欢鍚嶇О - eventName: "" + eventName: "", }; }, mounted() { @@ -86,12 +94,12 @@ async enabled(item) { let json = { id: item.id, - enable: item.enable + enable: item.enable, }; let res = await changeStatus(json); if (res && res.success) { // console.log(res, "鏇存柊鐘舵��"); - this.$emit("enabled", item) + this.$emit("enabled", item); } // this.$emit("getEvents", item); }, @@ -122,27 +130,27 @@ this.$confirm("纭畾瑕佸垹闄よ鏉℃帹閫佷换鍔″悧锛�", { center: true, cancelButtonClass: "comfirm-class-cancle", - confirmButtonClass: "comfirm-class-sure" + confirmButtonClass: "comfirm-class-sure", }).then(() => { let json = { type: "formData", - id: data.id + id: data.id, }; - deleteByid(json).then(res => { + deleteByid(json).then((res) => { if (res && res.success) { this.$emit("del-list"); this.$notify({ type: "success", - message: "鍒犻櫎鎴愬姛" - }) + message: "鍒犻櫎鎴愬姛", + }); } }); - }) + }); }, // 鏌ヨ浜嬩欢鍒楄〃 async findAll() { let json = { - name: this.eventName + name: this.eventName, }; let res = await findAll(json); if (res && res.success) { @@ -155,11 +163,9 @@ }); } this.eventList = res.data; - - } - } - } + }, + }, }; </script> <style lang="scss" scoped> @@ -193,7 +199,7 @@ padding-top: 20px; //height: 50em; .left-list { - min-width:340px; + min-width: 340px; position: absolute; left: 15px; top: 10px; diff --git a/src/pages/datapush/index/RightEvent.vue b/src/pages/datapush/index/RightEvent.vue index 4af9e34..75d386e 100644 --- a/src/pages/datapush/index/RightEvent.vue +++ b/src/pages/datapush/index/RightEvent.vue @@ -3,7 +3,12 @@ <div class="s-right-config"> <el-form> <el-form-item label="鍚嶇О"> - <el-input v-model="taskEditData.name" placeholder="璇疯緭鍏ュ悕绉�" size="small" style="width: 400px"></el-input> + <el-input + v-model="taskEditData.name" + placeholder="璇疯緭鍏ュ悕绉�" + size="small" + style="width: 400px" + ></el-input> </el-form-item> <el-form-item label="鏃堕棿"> @@ -24,7 +29,11 @@ <i class="el-icon-circle-plus-outline"></i> <span> 娣诲姞鎺ュ彛鍦板潃</span> </div> - <div v-for="(item, index) in urls" :key="item.hash" class="flex-box server-url"> + <div + v-for="(item, index) in urls" + :key="item.hash" + class="flex-box server-url" + > <div> <el-checkbox v-model="item.enable"></el-checkbox> <span class="ml20">{{ "URL " }}</span> @@ -36,13 +45,22 @@ ></el-input> </div> <div class="server-add"> - <i class="el-icon-remove-outline" @click="delUrl(index)" style="color: red; margin-right: 10px" /> + <i + class="el-icon-remove-outline" + @click="delUrl(index)" + style="color: red; margin-right: 10px" + /> <i class="el-icon-circle-plus-outline" @click="addUrl()"></i> </div> </div> <el-form-item label="鑱斿姩鏂瑰紡" style="margin-top: 20px; width: 100"> - <el-select v-model="taskEditData.lineWay" placeholder="璇烽�夋嫨" size="small"> + <el-select + v-model="taskEditData.lineWay" + placeholder="璇烽�夋嫨" + size="small" + > + <el-option label="璇烽�夋嫨" value=""></el-option> <el-option v-for="item in taskEditData.lineOptions" :key="item.value" @@ -53,8 +71,12 @@ </el-form-item> <el-form-item label="鏍囩"> - <el-radio v-model="taskEditData.radioValue" label="1">婊¤冻鍏ㄩ儴</el-radio> - <el-radio v-model="taskEditData.radioValue" label="2">婊¤冻浠绘剰涓�涓�</el-radio> + <el-radio v-model="taskEditData.radioValue" label="1" + >婊¤冻鍏ㄩ儴</el-radio + > + <el-radio v-model="taskEditData.radioValue" label="2" + >婊¤冻浠绘剰涓�涓�</el-radio + > </el-form-item> </el-form> </div> @@ -72,11 +94,20 @@ </div> </div> - <div v-for="(rule, index) in dataList" :key="index" style="margin-top: 10px"> + <div + v-for="(rule, index) in dataList" + :key="index" + style="margin-top: 10px" + > <el-row :gutter="20"> <!-- 涓婚 --> <el-col :span="4"> - <el-select v-model="rule.topic_type" placeholder="璇烽�夋嫨" @change="selectTopic(rule, true)" size="small"> + <el-select + v-model="rule.topic_type" + placeholder="璇烽�夋嫨" + @change="selectTopic(rule, true)" + size="small" + > <el-option v-for="item in rule.topicTypeOptions" :key="item.id" @@ -88,7 +119,12 @@ <!-- 杩囨护鍊� --> <el-col :span="4"> - <el-select v-model="rule.topic_arg" placeholder="璇烽�夋嫨" @change="selectArg(rule, true)" size="small"> + <el-select + v-model="rule.topic_arg" + placeholder="璇烽�夋嫨" + @change="selectArg(rule, true)" + size="small" + > <el-option v-for="item in rule.topicArgOptions" :key="item.id" @@ -100,7 +136,11 @@ <!-- 鎿嶄綔绗� --> <el-col :span="4"> - <el-select v-model="rule.operator" placeholder="璇烽�夋嫨" size="small"> + <el-select + v-model="rule.operator" + placeholder="璇烽�夋嫨" + size="small" + > <el-option label="==" value="="></el-option> </el-select> </el-col> @@ -125,7 +165,11 @@ <!-- 杩囨护鍊� --> <el-col :span="4"> <div v-if="rule.operator_type === 'custom'"> - <el-input v-model="rule.rule_value" placeholder="璇疯緭鍏ュ唴瀹�" size="small"></el-input> + <el-input + v-model="rule.rule_value" + placeholder="璇疯緭鍏ュ唴瀹�" + size="small" + ></el-input> </div> <div v-else> <el-select @@ -172,11 +216,21 @@ </div> <div class="config-item"> <b>鎺ㄩ�佸瓧娈�</b> - <el-button type="primary" size="mini" @click="openPushSetDialog">璁剧疆</el-button> + <el-button type="primary" size="mini" @click="openPushSetDialog" + >璁剧疆</el-button + > </div> <div class="save-btn"> - <el-button type="info" size="small" @click="onCancle" style="color: #222">鍙栨秷</el-button> - <el-button type="primary" @click="eventPushsSave" size="small">淇濆瓨</el-button> + <el-button + type="info" + size="small" + @click="onCancle" + style="color: #222" + >鍙栨秷</el-button + > + <el-button type="primary" @click="eventPushsSave" size="small" + >淇濆瓨</el-button + > </div> </div> <el-dialog @@ -189,19 +243,37 @@ <div slot="title" class="slot-title"> <p>璇烽�夋嫨鎯宠鎺ㄩ�佺殑瀛楁</p> <div class="right"> - <el-checkbox v-model="allFieldChecked" @change="allCheckChange"></el-checkbox> + <el-checkbox + v-model="allFieldChecked" + @change="allCheckChange" + ></el-checkbox> </div> </div> - <div class="check-area" v-for="configObj in tempPushSet" :key="configObj.id"> + <div + class="check-area" + v-for="configObj in tempPushSet" + :key="configObj.id" + > <div class="header"> <div class="title">{{ configObj.name }}</div> <div class="right"> - <el-checkbox v-model="configObj.checked" @change="toggleConfigCheck(configObj)">鍏ㄩ��</el-checkbox> + <el-checkbox + v-model="configObj.checked" + @change="toggleConfigCheck(configObj)" + >鍏ㄩ��</el-checkbox + > </div> </div> <div class="flex-box flex-wrap"> - <div class="param flex-box" v-for="param in configObj.children" :key="param.id"> - <el-checkbox v-model="param.checked" @change="checkChildren"></el-checkbox> + <div + class="param flex-box" + v-for="param in configObj.children" + :key="param.id" + > + <el-checkbox + v-model="param.checked" + @change="checkChildren" + ></el-checkbox> <span class="param-name">{{ param.name }}</span> <el-input v-model="param.alias" @@ -210,7 +282,7 @@ @input="varifyField(param)" :style="{ color: param.error ? 'red' : '', - borderColor: param.error ? 'red' : '' + borderColor: param.error ? 'red' : '', }" ></el-input> </div> @@ -218,7 +290,11 @@ </div> <div slot="footer" class="text-center"> <el-button size="small" @click="canclePushFieldSet">鍙栨秷</el-button> - <el-button size="small" type="primary" :disabled="disabledPushFieldSet" @click="submitPushFieldSet" + <el-button + size="small" + type="primary" + :disabled="disabledPushFieldSet" + @click="submitPushFieldSet" >淇濆瓨</el-button > </div> @@ -226,9 +302,9 @@ </div> </template> <script> -import { eventPushsSave, findByEventTopic, getPushSet } from "@/api/event" -import { findDictionaryByType, findDictionaryByID } from "@/api/dictionary" -import { getTaskList } from "@/api/search" +import { eventPushsSave, findByEventTopic, getPushSet } from "@/api/event"; +import { findDictionaryByType, findDictionaryByID } from "@/api/dictionary"; +import { getTaskList } from "@/api/search"; export default { name: "rightEvent", @@ -236,14 +312,14 @@ eventObject: { type: Object, default: () => { - return {} - } - } + return {}; + }, + }, }, computed: { urls() { - return this.taskEditData.urls - } + return this.taskEditData.urls; + }, }, data() { return { @@ -266,173 +342,187 @@ topicArgOptions: {}, operatorOptions: {}, operatorTypeOpionts: {}, - ruleValueOptions: [] + ruleValueOptions: [], }, pushFieldDialog: false, tempPushSet: [], pushFields: [], allFieldChecked: false, - disabledPushFieldSet: true - } + disabledPushFieldSet: true, + }; }, watch: { eventObject: { handler(newVal, oldVal) { - this.taskEditData.enable = this.eventObject.enable + this.taskEditData.enable = this.eventObject.enable; if (newVal !== oldVal) { if (this.taskEditData.id !== newVal.id) { - this.dataList = [] + this.dataList = []; - this.taskEditData.id = newVal.id - this.taskEditData.name = newVal.name - this.taskEditData.time = [this.eventObject.time_start, this.eventObject.time_end] - this.taskEditData.serverIp = newVal.ip_ports - this.taskEditData.urls = newVal.urls - this.taskEditData.lineWay = newVal.link_type - this.taskEditData.eventTxt = newVal.rule_text - this.taskEditData.radioValue = newVal.is_satisfy_all ? "1" : "2" + this.taskEditData.id = newVal.id; + this.taskEditData.name = newVal.name; + this.taskEditData.time = [ + this.eventObject.time_start, + this.eventObject.time_end, + ]; + this.taskEditData.serverIp = newVal.ip_ports; + this.taskEditData.urls = newVal.urls; + this.taskEditData.lineWay = newVal.link_type; + this.taskEditData.eventTxt = newVal.rule_text; + this.taskEditData.radioValue = newVal.is_satisfy_all ? "1" : "2"; if (!this.taskEditData.urls) { - this.$set(this.taskEditData, "urls", []) + this.$set(this.taskEditData, "urls", []); } //this.taskEditData.push_set = this.eventObject.push_set; if (!this.eventObject.push_set.length) { - this.$set(this.taskEditData, "push_set", this.pushFields) + this.$set(this.taskEditData, "push_set", this.pushFields); } else { - this.$set(this.taskEditData, "push_set", this.eventObject.push_set) + this.$set( + this.taskEditData, + "push_set", + this.eventObject.push_set + ); } if (newVal.rules) { newVal.rules.forEach((element) => { - let newRule = Object.assign(JSON.parse(JSON.stringify(this.baseRule)), element) - this.dataList.push(newRule) - this.selectTopic(newRule) - this.selectOperator(newRule) - }) + let newRule = Object.assign( + JSON.parse(JSON.stringify(this.baseRule)), + element + ); + this.dataList.push(newRule); + this.selectTopic(newRule); + this.selectOperator(newRule); + }); } } } }, - deep: true + deep: true, }, tempPushSet: { handler(n, o) { - let _this = this - let flag = false + let _this = this; + let flag = false; n.forEach((configObj) => { - let notChecked = configObj.children.find((param) => !param.checked) + let notChecked = configObj.children.find((param) => !param.checked); if (!notChecked) { - configObj.checked = true + configObj.checked = true; } else { - configObj.checked = false + configObj.checked = false; } - let someoneChecked = configObj.children.find((param) => param.checked) + let someoneChecked = configObj.children.find( + (param) => param.checked + ); if (someoneChecked) { - flag = true + flag = true; } - }) + }); if (flag) { - this.disabledPushFieldSet = false + this.disabledPushFieldSet = false; } else { - this.disabledPushFieldSet = true + this.disabledPushFieldSet = true; } }, - deep: true - } + deep: true, + }, }, created() { - this.reAdd() + this.reAdd(); }, mounted() { // 鍔犺浇瀛楀吀 - this.findByType() - this.getCameras() - this.getTasks() - this.getPushFields() + this.findByType(); + this.getCameras(); + this.getTasks(); + this.getPushFields(); }, methods: { openPushSetDialog() { - this.pushFieldDialog = true - this.tempPushSet = JSON.parse(JSON.stringify(this.taskEditData.push_set)) - this.checkFlag() + this.pushFieldDialog = true; + this.tempPushSet = JSON.parse(JSON.stringify(this.taskEditData.push_set)); + this.checkFlag(); }, checkFlag() { // debugger - let flag = true + let flag = true; this.tempPushSet.forEach((item) => { if (item.checked == false) { - flag = false + flag = false; } - }) - this.allFieldChecked = flag + }); + this.allFieldChecked = flag; }, checkChildren(val) { - console.log(val, 12121) + console.log(val, 12121); if (val == false) { - this.allFieldChecked = false + this.allFieldChecked = false; } else if (val == true && this.allFieldChecked == false) { this.$nextTick(() => { - this.checkFlag() - }) + this.checkFlag(); + }); } }, varifyField(param) { - var reg = /^[A-Za-z]+[0-9-_]?$/ + var reg = /^[A-Za-z]+[0-9-_]?$/; if (!reg.test(param.alias)) { - this.$message("璇疯緭鍏ュ悎娉曞瓧娈靛悕") - param.error = true + this.$message("璇疯緭鍏ュ悎娉曞瓧娈靛悕"); + param.error = true; } else { - param.error = false + param.error = false; } // this.pushFields.forEach(configObj => { // configObj.children.find(param => param.error) // }) }, canclePushFieldSet() { - this.pushFieldDialog = false + this.pushFieldDialog = false; }, allCheckChange(val) { - this.tempPushSet.forEach(function(item) { - item.checked = val - item.children.forEach(function(child) { - child.checked = val - }) - }) + this.tempPushSet.forEach(function (item) { + item.checked = val; + item.children.forEach(function (child) { + child.checked = val; + }); + }); }, submitPushFieldSet() { - let flag = false + let flag = false; //this.pushFields.forEach(configObj => { this.tempPushSet.forEach((configObj) => { - let errorOne = configObj.children.find((param) => param.checked && param.error) + let errorOne = configObj.children.find( + (param) => param.checked && param.error + ); if (errorOne) { this.$notify({ type: "error", - message: "璇峰皢閫変腑瀛楁杈撳叆鍚堟硶瀛楁鍚�" - }) - flag = true + message: "璇峰皢閫変腑瀛楁杈撳叆鍚堟硶瀛楁鍚�", + }); + flag = true; } - }) + }); if (flag) { //NO SUBMIT - return + return; } - this.taskEditData.push_set = this.tempPushSet - this.pushFieldDialog = false + this.taskEditData.push_set = this.tempPushSet; + this.pushFieldDialog = false; // 淇濆瓨瑙勫垯 - this.eventPushsSave() + this.eventPushsSave(); }, toggleConfigCheck(configObj) { configObj.children.forEach((child) => { - child.checked = configObj.checked - }) - this.checkFlag() + child.checked = configObj.checked; + }); + this.checkFlag(); }, getPushFields() { - let _this = this + let _this = this; getPushSet().then((res) => { - _this.pushFields = res.data - }) + _this.pushFields = res.data; + }); // this.pushFields = [ // { id: 'sxjxx', name: '鎽勫儚鏈轰俊鎭�', checked: false, alias: '', // children: [ @@ -448,75 +538,73 @@ addUrl() { this.taskEditData.urls.push({ checked: true, - hash: Math.random() - .toString(36) - .substr(2), - url: "" - }) + hash: Math.random().toString(36).substr(2), + url: "", + }); }, delUrl(index) { - this.$set(this.taskEditData.urls, index, this.baseRule) - this.taskEditData.urls.splice(index, 1) + this.$set(this.taskEditData.urls, index, this.baseRule); + this.taskEditData.urls.splice(index, 1); }, // 淇濆瓨 async eventPushsSave() { if (this.taskEditData.name.length < 1) { this.$notify({ type: "warning", - message: "璇峰~鍐欐帹閫佷换鍔″悕绉�" - }) - return + message: "璇峰~鍐欐帹閫佷换鍔″悕绉�", + }); + return; } // 鍒ゆ柇淇濆瓨鐨刬p鏄惁绗﹀悎鏍煎紡瑕佹眰 if (this.taskEditData.urls.length < 1) { this.$notify({ type: "warning", - message: "璇烽厤缃嚦灏戜竴鍙版帹閫佹湇鍔″櫒" - }) - return + message: "璇烽厤缃嚦灏戜竴鍙版帹閫佹湇鍔″櫒", + }); + return; } for (let i = 0; i < this.taskEditData.urls.length; i++) { if (this.taskEditData.urls[i].url.length < 1) { this.$notify({ type: "warning", - message: "鎺ュ彛URL鍦板潃涓嶅厑璁镐负绌�" - }) - return + message: "鎺ュ彛URL鍦板潃涓嶅厑璁镐负绌�", + }); + return; } } if (this.dataList.length < 1) { this.$notify({ type: "warning", - message: "璇峰湪浠诲姟閰嶇疆涓淮鎶よ鍒欙紒" - }) - return + message: "璇峰湪浠诲姟閰嶇疆涓淮鎶よ鍒欙紒", + }); + return; } // 鎷兼帴瀛楃涓� - let ruleDesc = [] + let ruleDesc = []; this.dataList.forEach((i) => { - let str = "" + let str = ""; if (i.topic_type) { - str += this.getNameByValue(i.topicTypeOptions, i.topic_type) + str += this.getNameByValue(i.topicTypeOptions, i.topic_type); } if (i.topic_arg) { - str += this.getNameByValue(i.topicArgOptions, i.topic_arg) + str += this.getNameByValue(i.topicArgOptions, i.topic_arg); } if (i.operator === "==") { - str += " = " + str += " = "; } if (i.rule_value === "all*all") { - str += "鍏ㄩ儴" + str += "鍏ㄩ儴"; } else if (i.rule_value === "null*null") { - str += "绌�" + str += "绌�"; } else { - str += i.rule_value + str += i.rule_value; } if (str.length > 0) { - ruleDesc.push(str) + ruleDesc.push(str); } - }) + }); // 澶勭悊瑙勫垯鍒楄〃鏁版嵁缁撴瀯 let ruleList = this.dataList.map((i) => { return { @@ -524,9 +612,9 @@ topic_arg: i.topic_arg, operator: i.operator, operator_type: i.operator_type, - rule_value: i.rule_value - } - }) + rule_value: i.rule_value, + }; + }); let json = { enable: this.taskEditData.enable, @@ -540,216 +628,224 @@ urls: this.taskEditData.urls, is_satisfy_all: this.taskEditData.radioValue === "1", link_type: this.taskEditData.lineWay, - push_set: this.taskEditData.push_set - } + push_set: this.taskEditData.push_set, + }; - let res = await eventPushsSave(json) + let res = await eventPushsSave(json); if (res && res.success) { - this.taskEditData.eventTxt = ruleDesc.join("<br/>") - this.$emit("updateList", res.data.id) + this.taskEditData.eventTxt = ruleDesc.join("<br/>"); + this.$emit("updateList", res.data.id); this.$notify({ type: "success", - message: "淇濆瓨鎴愬姛" - }) + message: "淇濆瓨鎴愬姛", + }); } }, // 鏌ユ壘瀛楀吀 async findByType() { - let res = await findDictionaryByType() + let res = await findDictionaryByType(); if (res && res.success) { - this.dictionary = Object.assign(this.dictionary, res.data) - this.baseRule.topicTypeOptions = this.dictionary.EVENTRULETOPIC - this.baseRule.operatorTypeOpionts = this.dictionary.EVENTTYPECOMPUTE + this.dictionary = Object.assign(this.dictionary, res.data); + this.baseRule.topicTypeOptions = this.dictionary.EVENTRULETOPIC; + this.baseRule.operatorTypeOpionts = this.dictionary.EVENTTYPECOMPUTE; this.dictionary["alarmLevel"] = this.dictionary.ALARMLEVEL.map((el) => { return { name: el.name, - value: el.name - } - }) + value: el.name, + }; + }); } }, async getCameras() { - let rsp = await findByEventTopic({ topic: "camera", type: "name" }) + let rsp = await findByEventTopic({ topic: "camera", type: "name" }); if (rsp && rsp.success) { - this.dictionary["camera"] = rsp.data + this.dictionary["camera"] = rsp.data; } - rsp = await findByEventTopic({ topic: "dbtable" }) + rsp = await findByEventTopic({ topic: "dbtable" }); if (rsp && rsp.success) { this.dictionary["dbtable"] = rsp.data.map((el) => { return { name: el.name, - value: el.name - } - }) + value: el.name, + }; + }); } }, async getTasks() { - this.dictionary["task"] = [] - let rsp = await getTaskList() + this.dictionary["task"] = []; + let rsp = await getTaskList(); if (rsp && rsp.success) { - let hash = {} + let hash = {}; rsp.data.forEach((task) => { if (!task.isDelete && !hash[task.name]) { this.dictionary["task"].push({ value: task.name, - name: task.name - }) - hash[task.name] = true + name: task.name, + }); + hash[task.name] = true; } - }) + }); } }, // 鏂板缓閰嶇疆 createSet() { - this.dataList.push(JSON.parse(JSON.stringify(this.baseRule))) + this.dataList.push(JSON.parse(JSON.stringify(this.baseRule))); }, cleanSet() { - this.dataList.splice(0, this.dataList.length) + this.dataList.splice(0, this.dataList.length); }, // 娣诲姞瀛愯鍒� addRule() { - this.dataList.push(JSON.parse(JSON.stringify(this.baseRule))) + this.dataList.push(JSON.parse(JSON.stringify(this.baseRule))); }, // 鍒犻櫎瀛愯鍒� delRule(index) { - this.dataList.splice(index, 1) + this.dataList.splice(index, 1); }, // 瑙勫垯涓笅鎷夋鐨勯�夋嫨鍥炶皟 selectTopic(rule, resetNext = false) { rule.topicTypeOptions.forEach((element) => { if (element.value === rule.topic_type) { - rule.topicArgOptions = element.children + rule.topicArgOptions = element.children; if (resetNext) { - rule.topic_arg = rule.topicArgOptions[0].value - this.selectArg(rule, resetNext) + rule.topic_arg = rule.topicArgOptions[0].value; + this.selectArg(rule, resetNext); } } - }) + }); }, selectArg(rule, resetNext = false) { - debugger + debugger; let argInfo = rule.topicArgOptions.filter((arg) => { - return arg.value === rule.topic_arg - }) + return arg.value === rule.topic_arg; + }); if (argInfo.length > 0) { - let desc = argInfo[0].description.split(",") + let desc = argInfo[0].description.split(","); if (desc.length > 0) { - rule.operatorTypeOpionts = this.dictionary.EVENTTYPECOMPUTE.filter((el) => { - return desc.indexOf(el.value) >= 0 - }) + rule.operatorTypeOpionts = this.dictionary.EVENTTYPECOMPUTE.filter( + (el) => { + return desc.indexOf(el.value) >= 0; + } + ); } } if (resetNext) { - rule.operator_type = rule.operatorTypeOpionts[rule.operatorTypeOpionts.length - 1].value - this.selectOperator(rule, resetNext) + rule.operator_type = + rule.operatorTypeOpionts[rule.operatorTypeOpionts.length - 1].value; + this.selectOperator(rule, resetNext); } }, selectOperator(rule, resetNext = false) { if (rule.operator_type === "option") { - rule.ruleValueOptions = this.dictionary[rule.topic_type] ? this.dictionary[rule.topic_type] : [] + rule.ruleValueOptions = this.dictionary[rule.topic_type] + ? this.dictionary[rule.topic_type] + : []; if (rule.rule_value != "") { - rule.rule_values = rule.rule_value.split(",") + rule.rule_values = rule.rule_value.split(","); } // 澶勭悊 鍏ㄩ儴/绌� for (let i = 0; i < rule.rule_values.length; i++) { if (rule.rule_values[i] === "all*all") { - rule.rule_values[i] = "鍏ㄩ儴" + rule.rule_values[i] = "鍏ㄩ儴"; } if (rule.rule_values[i] === "null*null") { - rule.rule_values[i] = "绌�" + rule.rule_values[i] = "绌�"; } } - console.log("-----------") - this.setOptionsDisable(rule) + console.log("-----------"); + this.setOptionsDisable(rule); } if (resetNext) { - rule.rule_value = "" - rule.rule_values = [] + rule.rule_value = ""; + rule.rule_values = []; } }, selectValue(rule, val) { if (rule.operator_type === "option") { - this.setOptionsDisable(rule) + this.setOptionsDisable(rule); if (val.indexOf("鍏ㄩ儴") >= 0) { - rule.rule_value = "all*all" - return + rule.rule_value = "all*all"; + return; } if (val.indexOf("绌�") >= 0) { - rule.rule_value = "null*null" - return + rule.rule_value = "null*null"; + return; } } - rule.rule_value = val.join(",") + rule.rule_value = val.join(","); }, setOptionsDisable(rule) { - let isAllSelect = rule.rule_values.indexOf("鍏ㄩ儴") >= 0 - let isNullSelect = rule.rule_values.indexOf("绌�") >= 0 - console.log(rule.rule_values) + let isAllSelect = rule.rule_values.indexOf("鍏ㄩ儴") >= 0; + let isNullSelect = rule.rule_values.indexOf("绌�") >= 0; + console.log(rule.rule_values); rule.ruleValueOptions.forEach((opt) => { if (!rule.rule_values.length) { - opt.disabled = false - return + opt.disabled = false; + return; } if (opt.name === "绌�") { - opt.disabled = !isNullSelect - return + opt.disabled = !isNullSelect; + return; } - opt.disabled = isAllSelect || isNullSelect - }) + opt.disabled = isAllSelect || isNullSelect; + }); }, // 鏍规嵁value杩斿洖瀵瑰簲鐨刵ame getNameByValue(arr, value) { let s = arr.find((item) => { - return item.value === value - }) + return item.value === value; + }); - return s.name + return s.name; }, // 娓呯┖閲嶆柊鏂板 reAdd() { this.taskEditData = { id: "", name: "", - time: [this.$moment().format("YYYY-MM-DD 00:00:00"), this.$moment().format("YYYY-MM-DD HH:mm:ss")], + time: [ + this.$moment().format("YYYY-MM-DD 00:00:00"), + this.$moment().format("YYYY-MM-DD HH:mm:ss"), + ], serverIp: [ { enable: true, server_ip: "", - port: 0 - } + port: 0, + }, ], urls: [], lineWay: "", lineOptions: [ { value: "001", - label: "IP骞挎挱" - } + label: "IP骞挎挱", + }, ], radioValue: "1", eventTxt: "", - push_set: this.pushFields - } - this.dataList = [] + push_set: this.pushFields, + }; + this.dataList = []; }, onCancle() { - this.$emit("onCancle") - } - } -} + this.$emit("onCancle"); + }, + }, +}; </script> <style lang="scss"> .s-event-push-right { diff --git a/src/pages/library/components/personList.vue b/src/pages/library/components/personList.vue index a091808..b865879 100644 --- a/src/pages/library/components/personList.vue +++ b/src/pages/library/components/personList.vue @@ -4,17 +4,23 @@ <div class="base-tip"> <div class="left-tips"> <span class="ku-name">{{ this.baseObject.tableName }}</span> - <span class="list" :class="this.baseObject.bwType === '1' ? 'black-list' : 'white-list'">{{ - this.baseObject.bwType === "1" ? "榛戝悕鍗�" : "鐧藉悕鍗�" - }}</span> + <span + class="list" + :class=" + this.baseObject.bwType === '1' ? 'black-list' : 'white-list' + " + >{{ this.baseObject.bwType === "1" ? "榛戝悕鍗�" : "鐧藉悕鍗�" }}</span + > <span class="ok-time" >鏈夋晥鏃堕棿锛歿{ this.baseObject.startTime }} -- - {{ this.baseObject.endTime ? this.baseObject.endTime : "姘镐箙鏈夋晥" }}</span + {{ + this.baseObject.endTime ? this.baseObject.endTime : "姘镐箙鏈夋晥" + }}</span > </div> <div class="right-btns"> - <span style="margin-right:2px">搴曞簱鐘舵�侊紙鐢熸晥/澶辨晥锛�</span> + <span style="margin-right: 2px">搴曞簱鐘舵�侊紙鐢熸晥/澶辨晥锛�</span> <el-switch :active-value="1" :width="52" @@ -38,7 +44,11 @@ </el-tooltip> <el-tooltip content="缂栬緫" placement="top" popper-class="atooltip"> - <span class="iconfont iconfont-wrap iconbianjiku-09" @click.stop="edit" v-if="isShow('library:set')"></span> + <span + class="iconfont iconfont-wrap iconbianjiku-09" + @click.stop="edit" + v-if="isShow('library:set')" + ></span> </el-tooltip> </div> </div> @@ -61,8 +71,14 @@ > <upload-icon slot="suffix"></upload-icon> </el-input> - <el-button size="small" type="primary" @click="handleSearch">鎼滅储</el-button> - <el-tooltip content="鎵归噺鍒犻櫎" placement="top" popper-class="atooltip"> + <el-button size="small" type="primary" @click="handleSearch" + >鎼滅储</el-button + > + <el-tooltip + content="鎵归噺鍒犻櫎" + placement="top" + popper-class="atooltip" + > <span class="iconfont iconfont-wrap iconpiliangshanchu-09" @click="askDelete('batch')" @@ -70,7 +86,11 @@ ></span> </el-tooltip> - <el-tooltip content="涓婁紶鐓х墖" placement="top" popper-class="atooltip"> + <el-tooltip + content="涓婁紶鐓х墖" + placement="top" + popper-class="atooltip" + > <UploadBtn limitTypes=".jpg,.png,.jpeg" limitSize @@ -103,7 +123,7 @@ background: '#fff', color: '#222222', padding: '2px 1px', - borderBottom: 'none' + borderBottom: 'none', }" > <el-table-column type="selection" width="40"></el-table-column> @@ -114,7 +134,9 @@ style="width: 84px; height: 84px; object-fit: contain" alt /> - <p class="text-center fb f16" v-show="haveScore(scope.row)">{{ scope.row.compareScore }}%</p> + <p class="text-center fb f16" v-show="haveScore(scope.row)"> + {{ scope.row.compareScore }}% + </p> </template> </el-table-column> <el-table-column label="鐢熸晥鐘舵��" min-width="70"> @@ -130,8 +152,19 @@ ></el-switch> </template> </el-table-column> - <el-table-column prop="personName" label="濮撳悕" min-width="70" show-overflow-tooltip sortable></el-table-column> - <el-table-column prop="sex" label="鎬у埆" min-width="60" sortable></el-table-column> + <el-table-column + prop="personName" + label="濮撳悕" + min-width="70" + show-overflow-tooltip + sortable + ></el-table-column> + <el-table-column + prop="sex" + label="鎬у埆" + min-width="60" + sortable + ></el-table-column> <el-table-column prop="idCard" label="韬唤璇佸彿" @@ -146,7 +179,11 @@ show-overflow-tooltip sortable ></el-table-column> - <el-table-column prop="monitorLevel" label="绛夌骇" min-width="50"></el-table-column> + <el-table-column + prop="monitorLevel" + label="绛夌骇" + min-width="50" + ></el-table-column> <el-table-column prop="createTime" label="鍏ュ簱鏃堕棿" @@ -157,7 +194,11 @@ <el-table-column label="鎿嶄綔" min-width="130"> <template slot-scope="scope"> <fTemplate authority="library:set"> - <el-tooltip content="缂栬緫" placement="top" popper-class="atooltip"> + <el-tooltip + content="缂栬緫" + placement="top" + popper-class="atooltip" + > <span class="iconfont iconbianjixinxi-09" style="font-size: 24px; cursor: pointer" @@ -165,26 +206,67 @@ ></span> </el-tooltip> </fTemplate> - <el-popover placement="top" trigger="click" popper-class="popper-caozuo"> - <el-tooltip content="鏌ユ壘姝や汉" placement="top" popper-class="atooltip"> - <span class="iconfont iconchazhaociren-09" @click="tosearch(scope.row)"></span> + <el-popover + placement="top" + trigger="click" + popper-class="popper-caozuo" + > + <el-tooltip + content="鏌ユ壘姝や汉" + placement="top" + popper-class="atooltip" + > + <span + class="iconfont iconchazhaociren-09" + @click="tosearch(scope.row)" + ></span> </el-tooltip> - <el-tooltip content="鏌ョ湅璇︽儏" placement="top" popper-class="atooltip"> - <span class="iconfont iconchakanxiangqing-09" @click="showDetail(scope.row)"></span> + <el-tooltip + content="鏌ョ湅璇︽儏" + placement="top" + popper-class="atooltip" + > + <span + class="iconfont iconchakanxiangqing-09" + @click="showDetail(scope.row)" + ></span> </el-tooltip> <fTemplate authority="library:set"> - <el-tooltip content="澶嶅埗" placement="top" popper-class="atooltip"> - <span class="iconfont iconfuzhi-09" title="澶嶅埗" @click="copyClick(scope.row)"></span> + <el-tooltip + content="澶嶅埗" + placement="top" + popper-class="atooltip" + > + <span + class="iconfont iconfuzhi-09" + title="澶嶅埗" + @click="copyClick(scope.row)" + ></span> </el-tooltip> </fTemplate> <fTemplate authority="library:set"> - <el-tooltip content="绉诲姩" placement="top" popper-class="atooltip"> - <span class="iconfont iconyidong-09" title="绉诲姩" @click="moveClick(scope.row)"></span> + <el-tooltip + content="绉诲姩" + placement="top" + popper-class="atooltip" + > + <span + class="iconfont iconyidong-09" + title="绉诲姩" + @click="moveClick(scope.row)" + ></span> </el-tooltip> </fTemplate> <fTemplate authority="library:set" class="del-wrap"> - <el-tooltip content="鍒犻櫎" placement="top" popper-class="atooltip"> - <span class="iconfont iconshanchu-09" @click="askDelete('single', scope.row.id)"></span> + <el-tooltip + content="鍒犻櫎" + placement="top" + popper-class="atooltip" + > + <span + class="iconfont iconshanchu-09" + @click="askDelete('single', scope.row.id)" + ></span> </el-tooltip> </fTemplate> <span @@ -207,7 +289,12 @@ :total="BaseManageData.total" ></el-pagination> </div> - <el-dialog title="鎶撴媿璇︽儏" :visible.sync="cameraDetailVisible" okText="纭畾" custom-class="zhuapai-dialog"> + <el-dialog + title="鎶撴媿璇︽儏" + :visible.sync="cameraDetailVisible" + okText="纭畾" + custom-class="zhuapai-dialog" + > <div class="member-info"> <label class> <img src="/images/library/涓汉淇℃伅.png" alt="" srcset="" /> @@ -255,9 +342,13 @@ ></el-date-picker> </div> - <el-button size="mini" type="primary" @click="postCameraData">鏌ヨ</el-button> + <el-button size="mini" type="primary" @click="postCameraData" + >鏌ヨ</el-button + > </div> - <p style="text-align: right; font-size: 14px; color: #5f5f5f">鍏眥{ faceDataCount }}鏉℃暟鎹�</p> + <p style="text-align: right; font-size: 14px; color: #5f5f5f"> + 鍏眥{ faceDataCount }}鏉℃暟鎹� + </p> <el-table :data="cameraDetailData" @@ -268,10 +359,15 @@ background: '#fff', color: '#222222', padding: '2px 1px', - borderBottom: 'none' + borderBottom: 'none', }" > - <el-table-column prop="faceImg" label="鎶撴媿瀹炴櫙" width="160" align="center"> + <el-table-column + prop="faceImg" + label="鎶撴媿瀹炴櫙" + width="160" + align="center" + > <template slot-scope="scope"> <div> <img @@ -288,10 +384,28 @@ </div> </template> </el-table-column> - <el-table-column prop="cameraName" label="鎽勫儚鏈哄悕绉�" width="100" align="center"></el-table-column> - <el-table-column prop="startTime" label="寮�濮嬫椂闂�" align="center"></el-table-column> - <el-table-column prop="endTime" label="缁撴潫鏃堕棿" align="center"></el-table-column> - <el-table-column prop="stayTime" label="鍋滅暀鏃堕暱" width="99" align="center"> + <el-table-column + prop="cameraName" + label="鎽勫儚鏈哄悕绉�" + width="100" + align="center" + ></el-table-column> + <el-table-column + prop="startTime" + label="寮�濮嬫椂闂�" + align="center" + ></el-table-column> + <el-table-column + prop="endTime" + label="缁撴潫鏃堕棿" + align="center" + ></el-table-column> + <el-table-column + prop="stayTime" + label="鍋滅暀鏃堕暱" + width="99" + align="center" + > <template slot-scope="scope"> <span>{{ scope.row.stayTime }} 绉�</span> </template> @@ -299,11 +413,21 @@ </el-table> <div class="bot-btn"> - <el-button size="mini" type="primary" @click="cameraDetailVisible = false">鍏抽棴</el-button> + <el-button + size="mini" + type="primary" + @click="cameraDetailVisible = false" + >鍏抽棴</el-button + > </div> </el-dialog> <el-drawer title="淇敼淇℃伅" :modal="false" :visible.sync="showInfoDrawer"> - <el-form ref="formForEdit" :model="inputPersonForm" label-width="100px" :rules="rules"> + <el-form + ref="formForEdit" + :model="inputPersonForm" + label-width="100px" + :rules="rules" + > <div class="flex-center mb10"> <el-upload class="avatar-uploader" @@ -315,7 +439,11 @@ :on-error="uploadError" > <div class="mask1"> - <div slot="trigger" class="flex-center" style="position: absolute; top: 70px"> + <div + slot="trigger" + class="flex-center" + style="position: absolute; top: 70px" + > <p style=" background: rgba(0, 0, 0, 0.35); @@ -346,27 +474,48 @@ <el-row> <el-col :span="20"> <el-form-item label="ID" style="width: 100%; margin-bottom: 20px"> - <el-input size="small" v-model="inputPersonForm.id" disabled placeholder="璇疯緭鍏�"></el-input> + <el-input + size="small" + v-model="inputPersonForm.id" + disabled + placeholder="璇疯緭鍏�" + ></el-input> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="20"> - <el-form-item label="鐓х墖鏍囪瘑" prop="picDesc" style="width: 100%; margin-bottom: 20px"> - <el-input size="small" v-model="inputPersonForm.picDesc" placeholder="璇疯緭鍏�"></el-input> + <el-form-item + label="鐓х墖鏍囪瘑" + prop="picDesc" + style="width: 100%; margin-bottom: 20px" + > + <el-input + size="small" + v-model="inputPersonForm.picDesc" + placeholder="璇疯緭鍏�" + ></el-input> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="20"> <el-form-item label="濮撳悕" style="width: 100%; margin-bottom: 20px"> - <el-input size="small" v-model="inputPersonForm.personName" placeholder="璇疯緭鍏�"></el-input> + <el-input + size="small" + v-model="inputPersonForm.personName" + placeholder="璇疯緭鍏�" + ></el-input> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="20"> - <el-form-item label="鎬у埆" prop="sex" style="width: 100%; margin-bottom: 20px; text-align: left"> + <el-form-item + label="鎬у埆" + prop="sex" + style="width: 100%; margin-bottom: 20px; text-align: left" + > <el-radio-group v-model="inputPersonForm.sex" class="mt10"> <el-radio label="鐢�"></el-radio> <el-radio label="濂�"></el-radio> @@ -376,22 +525,47 @@ </el-row> <el-row> <el-col :span="20"> - <el-form-item label="韬唤璇佸彿" prop="idCard" style="width: 100%; margin-bottom: 20px"> - <el-input size="small" v-model="inputPersonForm.idCard" placeholder="璇疯緭鍏�"></el-input> + <el-form-item + label="韬唤璇佸彿" + prop="idCard" + style="width: 100%; margin-bottom: 20px" + > + <el-input + size="small" + v-model="inputPersonForm.idCard" + placeholder="璇疯緭鍏�" + ></el-input> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="20"> - <el-form-item label="鎵嬫満鍙�" prop="phoneNum" style="width: 100%; margin-bottom: 20px"> - <el-input size="small" v-model="inputPersonForm.phoneNum" placeholder="璇疯緭鍏�"></el-input> + <el-form-item + label="鎵嬫満鍙�" + prop="phoneNum" + style="width: 100%; margin-bottom: 20px" + > + <el-input + size="small" + v-model="inputPersonForm.phoneNum" + placeholder="璇疯緭鍏�" + ></el-input> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="20"> - <el-form-item label="浜哄憳绛夌骇" prop="monitorLevel" style="width: 100%; margin-bottom: 20px"> - <el-select size="small" v-model="inputPersonForm.monitorLevel" placeholder="璇烽�夋嫨" style="width: 100%"> + <el-form-item + label="浜哄憳绛夌骇" + prop="monitorLevel" + style="width: 100%; margin-bottom: 20px" + > + <el-select + size="small" + v-model="inputPersonForm.monitorLevel" + placeholder="璇烽�夋嫨" + style="width: 100%" + > <el-option v-for="item in VideoPhotoData.dictionary.MONITORLEVEL" :key="item.value" @@ -404,33 +578,64 @@ </el-row> <el-row> <el-col :span="20"> - <el-form-item label="鍏ュ簱浣嶇疆" style="width: 100%; margin-bottom: 20px"> - <el-input size="small" v-model="inputPersonForm.fromServerId" disabled></el-input> + <el-form-item + label="鍏ュ簱浣嶇疆" + style="width: 100%; margin-bottom: 20px" + > + <el-input + size="small" + v-model="inputPersonForm.fromServerId" + disabled + ></el-input> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="20"> - <el-form-item label="鍏ュ簱鏃堕棿" style="width: 100%; margin-bottom: 20px"> - <el-input size="small" v-model="inputPersonForm.createTime" disabled></el-input> + <el-form-item + label="鍏ュ簱鏃堕棿" + style="width: 100%; margin-bottom: 20px" + > + <el-input + size="small" + v-model="inputPersonForm.createTime" + disabled + ></el-input> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="20"> <el-form-item label="鍏朵粬" style="width: 100%; margin-bottom: 20px"> - <el-input size="small" v-model="inputPersonForm.reserved" placeholder="璇疯緭鍏�"></el-input> + <el-input + size="small" + v-model="inputPersonForm.reserved" + placeholder="璇疯緭鍏�" + ></el-input> </el-form-item> </el-col> </el-row> </el-form> <div class="dialog-footer"> <!-- {{BaseManageData.personList[1].idCard}} --> - <el-button size="small" class="cancel-btn" @click="handleClose" type="info">鍙栨秷</el-button> - <el-button size="small" class="sure-btn" type="primary" @click="submit">纭畾</el-button> + <el-button + size="small" + class="cancel-btn" + @click="handleClose" + type="info" + >鍙栨秷</el-button + > + <el-button size="small" class="sure-btn" type="primary" @click="submit" + >纭畾</el-button + > </div> </el-drawer> - <el-dialog :visible.sync="dialogVisible" :close="getPersonList" :center="true" custom-class="suc-dialog"> + <el-dialog + :visible.sync="dialogVisible" + :close="getPersonList" + :center="true" + custom-class="suc-dialog" + > <div> <div class="suc-icon"> <i class="iconfont iconduigou3"></i> @@ -441,31 +646,53 @@ </div> <div class="flex-box mt10"> <span>涓婁紶澶辫触鐨勬暟閲忥細{{ uploadResult.failList.length }}</span> - <div class="ml20" v-for="(i, index) in uploadResult.failList" :key="index"> + <div + class="ml20" + v-for="(i, index) in uploadResult.failList" + :key="index" + > {{ i }} </div> </div> <div class="flex-box mt10"> - <span>鍖呭惈澶氬紶浜鸿劯鐨勫浘鐗囨暟閲忥細{{ uploadResult.multiFaceList.length }}</span> - <div class="ml20" v-for="(i, index) in uploadResult.multiFaceList" :key="index"> + <span + >鍖呭惈澶氬紶浜鸿劯鐨勫浘鐗囨暟閲忥細{{ + uploadResult.multiFaceList.length + }}</span + > + <div + class="ml20" + v-for="(i, index) in uploadResult.multiFaceList" + :key="index" + > {{ i }} </div> </div> <div class="flex-box mt10"> <span>涓嶅惈浜鸿劯鐨勫浘鐗囨暟閲忥細{{ uploadResult.noFaceList.length }}</span> - <div class="ml20" v-for="(i, index) in uploadResult.noFaceList" :key="index"> + <div + class="ml20" + v-for="(i, index) in uploadResult.noFaceList" + :key="index" + > {{ i }} </div> </div> </div> <span slot="footer" class="dialog-footer"> <el-button @click="dialogVisible = false">鍙� 娑�</el-button> - <el-button type="primary" @click="dialogVisible = false">纭� 瀹�</el-button> + <el-button type="primary" @click="dialogVisible = false" + >纭� 瀹�</el-button + > </span> </el-dialog> <!-- 纭鍒犻櫎瀵硅瘽妗� --> - <el-dialog :visible.sync="askDeleteShow" :center="true" custom-class="del-dialog"> + <el-dialog + :visible.sync="askDeleteShow" + :center="true" + custom-class="del-dialog" + > <div> <div class="suc-icon"> <i class="iconfont icongantanhao1"></i> @@ -477,27 +704,45 @@ </div> <span slot="footer" class="dialog-footer"> <el-button @click="askDeleteShow = false">鍙� 娑�</el-button> - <el-button type="primary" @click="handleDel" :loading="delBtnLoading">纭� 瀹�</el-button> + <el-button type="primary" @click="handleDel" :loading="delBtnLoading" + >纭� 瀹�</el-button + > </span> </el-dialog> - <el-dialog title="澶嶅埗鍒�" :visible.sync="copyVisiabled" okText="淇濆瓨" custom-class="copy-dialog" cancelText="鍙栨秷"> + <el-dialog + title="澶嶅埗鍒�" + :visible.sync="copyVisiabled" + okText="淇濆瓨" + custom-class="copy-dialog" + cancelText="鍙栨秷" + > <div class="addToBase1"> <div class="items" v-if="baseObject.bwType === '1'"> <div class="lable"> <p>榛戝悕鍗�</p> </div> <div class="baseList"> - <el-checkbox-group v-model="BaseManageData.selectBlacks" @change="blackAngWhite"> + <el-checkbox-group + v-model="BaseManageData.selectBlacks" + @change="blackAngWhite" + > <div class="base" v-for="(item, index) in BaseManageData.blackList" :key="index" - :class="BaseManageData.selectBlacks.includes(item.value) ? 'white-wrap' : ''" + :class=" + BaseManageData.selectBlacks.includes(item.value) + ? 'white-wrap' + : '' + " > - <el-checkbox :label="item.value" :title="item.title" :disabled="item.disabled">{{ - item.title - }}</el-checkbox> + <el-checkbox + :label="item.value" + :title="item.title" + :disabled="item.disabled" + >{{ item.title }}</el-checkbox + > </div> </el-checkbox-group> </div> @@ -507,16 +752,26 @@ <p>鐧藉悕鍗�</p> </div> <div class="baseList"> - <el-checkbox-group v-model="BaseManageData.selectWhites" @change="blackAngWhite"> + <el-checkbox-group + v-model="BaseManageData.selectWhites" + @change="blackAngWhite" + > <div class="base" - :class="BaseManageData.selectWhites.includes(item.value) ? 'white-wrap' : ''" + :class=" + BaseManageData.selectWhites.includes(item.value) + ? 'white-wrap' + : '' + " v-for="(item, index) in BaseManageData.whiteList" :key="index" > - <el-checkbox :label="item.value" :title="item.title" :disabled="item.disabled">{{ - item.title - }}</el-checkbox> + <el-checkbox + :label="item.value" + :title="item.title" + :disabled="item.disabled" + >{{ item.title }}</el-checkbox + > </div> </el-checkbox-group> </div> @@ -524,27 +779,46 @@ </div> <div slot="footer" class="dialog-footer"> <el-button size="small" @click="copyClose" type="info">鍙� 娑�</el-button> - <el-button size="small" type="primary" @click="copySubmit()">纭� 瀹�</el-button> + <el-button size="small" type="primary" @click="copySubmit()" + >纭� 瀹�</el-button + > </div> </el-dialog> - <el-dialog title="绉诲姩鑷�" :visible.sync="moveVisiabled" okText="淇濆瓨" custom-class="copy-dialog" cancelText="鍙栨秷"> + <el-dialog + title="绉诲姩鑷�" + :visible.sync="moveVisiabled" + okText="淇濆瓨" + custom-class="copy-dialog" + cancelText="鍙栨秷" + > <div class="addToBase1"> <div class="items"> <div class="lable"> <p>榛戝悕鍗�</p> </div> <div class="baseList"> - <el-checkbox-group v-model="BaseManageData.selectBlacks" @change="blackAngWhite" :max="1"> + <el-checkbox-group + v-model="BaseManageData.selectBlacks" + @change="blackAngWhite" + :max="1" + > <div class="base" v-for="(item, index) in BaseManageData.blackList" :key="index" - :class="BaseManageData.selectBlacks.includes(item.value) ? 'white-wrap' : ''" + :class=" + BaseManageData.selectBlacks.includes(item.value) + ? 'white-wrap' + : '' + " > - <el-checkbox :label="item.value" :title="item.title" :disabled="item.disabled">{{ - item.title - }}</el-checkbox> + <el-checkbox + :label="item.value" + :title="item.title" + :disabled="item.disabled" + >{{ item.title }}</el-checkbox + > </div> </el-checkbox-group> </div> @@ -554,16 +828,27 @@ <p>鐧藉悕鍗�</p> </div> <div class="baseList"> - <el-checkbox-group v-model="BaseManageData.selectWhites" @change="blackAngWhite" :max="1"> + <el-checkbox-group + v-model="BaseManageData.selectWhites" + @change="blackAngWhite" + :max="1" + > <div class="base" v-for="(item, index) in BaseManageData.whiteList" :key="index" - :class="BaseManageData.selectWhites.includes(item.value) ? 'white-wrap' : ''" + :class=" + BaseManageData.selectWhites.includes(item.value) + ? 'white-wrap' + : '' + " > - <el-checkbox :label="item.value" :title="item.title" :disabled="item.disabled">{{ - item.title - }}</el-checkbox> + <el-checkbox + :label="item.value" + :title="item.title" + :disabled="item.disabled" + >{{ item.title }}</el-checkbox + > </div> </el-checkbox-group> </div> @@ -571,7 +856,9 @@ </div> <div slot="footer" class="dialog-footer"> <el-button size="small" @click="moveClose" type="info">鍙� 娑�</el-button> - <el-button size="small" type="primary" @click="moveSubmit()">纭� 瀹�</el-button> + <el-button size="small" type="primary" @click="moveSubmit()" + >纭� 瀹�</el-button + > </div> </el-dialog> </div> @@ -582,27 +869,27 @@ deleteBasePersons, updateDbTableStatus, deleteDbPersonById, - deleteDBtablesById -} from "@/api/baseLibrary" -import { getCameraFaceData } from "@/api/es" -import { isIDCard } from "../../../scripts/validate" + deleteDBtablesById, +} from "@/api/baseLibrary"; +import { getCameraFaceData } from "@/api/es"; +import { isIDCard } from "../../../scripts/validate"; -import axios from "axios" -import UploadBtn from "./upload" -import fTemplate from "@/components/fTemplate" -import UploadIcon from "@/components/searching/UploadIcon.vue" +import axios from "axios"; +import UploadBtn from "./upload"; +import fTemplate from "@/components/fTemplate"; +import UploadIcon from "@/components/searching/UploadIcon.vue"; function isPhone(rule, value, callback) { if (!value) { - return callback() + return callback(); } else if (value.trim()) { - var pattern = /^1[345789]\d{9}$/ + var pattern = /^1[345789]\d{9}$/; if (pattern.test(value)) { - return callback() + return callback(); } - return callback(new Error("杈撳叆鐨勬墜鏈哄彿閿欒")) + return callback(new Error("杈撳叆鐨勬墜鏈哄彿閿欒")); } } -Date.prototype.Format = function(fmt) { +Date.prototype.Format = function (fmt) { var o = { "M+": this.getMonth() + 1, //鏈堜唤 "d+": this.getDate(), //鏃� @@ -610,59 +897,72 @@ "m+": this.getMinutes(), //鍒� "s+": this.getSeconds(), //绉� "q+": Math.floor((this.getMonth() + 3) / 3), //瀛e害 - S: this.getMilliseconds() //姣 - } - if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)) + S: this.getMilliseconds(), //姣 + }; + if (/(y+)/.test(fmt)) + fmt = fmt.replace( + RegExp.$1, + (this.getFullYear() + "").substr(4 - RegExp.$1.length) + ); for (var k in o) if (new RegExp("(" + k + ")").test(fmt)) - fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)) - return fmt -} + fmt = fmt.replace( + RegExp.$1, + RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length) + ); + return fmt; +}; export default { components: { UploadBtn, fTemplate, - UploadIcon + UploadIcon, }, props: { baseObject: { default: () => {}, - type: Object + type: Object, }, syncType: { - type: String - } + type: String, + }, }, computed: { isAdmin() { - if (sessionStorage.getItem("userInfo") && sessionStorage.getItem("userInfo") !== "") { - let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username - return loginName === "superadmin" || loginName === "basic" + if ( + sessionStorage.getItem("userInfo") && + sessionStorage.getItem("userInfo") !== "" + ) { + let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username; + return loginName === "superadmin" || loginName === "basic"; } - return false + return false; }, delText() { switch (this.delType) { case "base": - return ["鍒犻櫎搴曞簱", "纭畾鍒犻櫎璇ュ簳搴擄紵"] + return ["鍒犻櫎搴曞簱", "纭畾鍒犻櫎璇ュ簳搴擄紵"]; case "single": - return ["鍒犻櫎浜哄憳", "纭畾鍒犻櫎璇ュ簳搴撲汉鍛橈紵"] + return ["鍒犻櫎浜哄憳", "纭畾鍒犻櫎璇ュ簳搴撲汉鍛橈紵"]; case "batch": - return ["鎵归噺鍒犻櫎", "纭畾鍒犻櫎璇ュ簳搴撻�変腑浜哄憳锛�"] + return ["鎵归噺鍒犻櫎", "纭畾鍒犻櫎璇ュ簳搴撻�変腑浜哄憳锛�"]; default: - return ["", ""] + return ["", ""]; } - } + }, }, data() { return { - timeRange: [new Date(2020, 7, 25, 8), new Date(new Date().setHours(23, 59, 59))], + timeRange: [ + new Date(2020, 7, 25, 8), + new Date(new Date().setHours(23, 59, 59)), + ], memberInfo: { personName: "", sex: "", idCard: "", - reserved: "" + reserved: "", }, askDeleteShow: false, toDeleteId: "", @@ -670,7 +970,7 @@ startTime: new Date(2020, 7, 25, 8).Format("yyyy-MM-dd HH:mm:ss"), endTime: new Date().Format("yyyy-MM-dd HH:mm:ss"), thresholdTime: 10, - faceId: [] + faceId: [], }, cameraDetailData: [], cameraDetailVisible: false, @@ -690,11 +990,15 @@ selectedRowKeys: [], inputPersonForm: {}, rules: { - picDesc: [{ required: true, message: "璇疯緭鍏ョ収鐗囨爣璇�", trigger: "change" }], + picDesc: [ + { required: true, message: "璇疯緭鍏ョ収鐗囨爣璇�", trigger: "change" }, + ], sex: [{ required: true, message: "璇峰嬀閫夋�у埆", trigger: "change" }], idCard: [{ validator: isIDCard, trigger: "blur" }], phoneNum: [{ validator: isPhone, trigger: "blur" }], - monitorLevel: [{ required: true, message: "璇烽�夋嫨浜哄憳绛夌骇", trigger: "change" }] + monitorLevel: [ + { required: true, message: "璇烽�夋嫨浜哄憳绛夌骇", trigger: "change" }, + ], }, tableData: [], oldWidth: "", @@ -708,55 +1012,57 @@ failList: [], successList: [], multiFaceList: [], - noFaceList: [] + noFaceList: [], }, - delBtnLoading: false - } + delBtnLoading: false, + }; }, watch: { - "BaseManageData.selectBlacks": function(value) { - this.blackAngWhite() + "BaseManageData.selectBlacks": function (value) { + this.blackAngWhite(); }, - "BaseManageData.selectWhites": function(value) { - this.blackAngWhite() - } + "BaseManageData.selectWhites": function (value) { + this.blackAngWhite(); + }, }, methods: { postCameraData() { getCameraFaceData(this.reqCameraParams).then((res) => { if (res && res.rtnCode == 1) { - this.cameraDetailData = res.rtnData - this.faceDataCount = res.rtnData.length + this.cameraDetailData = res.rtnData; + this.faceDataCount = res.rtnData.length; } - }) + }); }, timeChange(val) { - this.reqCameraParams.startTime = val[0] - this.reqCameraParams.endTime = val[1] + this.reqCameraParams.startTime = val[0]; + this.reqCameraParams.endTime = val[1]; }, showDetail(row) { - this.cameraDetailData = [] - this.memberInfo.reserved = row.reserved - this.memberInfo.idCard = row.idCard - this.memberInfo.personName = row.personName - this.memberInfo.sex = row.sex - this.reqCameraParams.faceId = row.id - this.cameraDetailVisible = true + this.cameraDetailData = []; + this.memberInfo.reserved = row.reserved; + this.memberInfo.idCard = row.idCard; + this.memberInfo.personName = row.personName; + this.memberInfo.sex = row.sex; + this.reqCameraParams.faceId = row.id; + this.cameraDetailVisible = true; }, isShow(authority) { - return this.isAdmin || this.buttonAuthority.indexOf("," + authority + ",") > -1 + return ( + this.isAdmin || this.buttonAuthority.indexOf("," + authority + ",") > -1 + ); }, pickRow(row, column, event) { - this.$refs.multipleTable.toggleRowSelection(row) + this.$refs.multipleTable.toggleRowSelection(row); }, toggleSelection(rows) { if (rows) { rows.forEach((row) => { - this.$refs.multipleTable.toggleRowSelection(row) - }) + this.$refs.multipleTable.toggleRowSelection(row); + }); } else { - this.$refs.multipleTable.clearSelection() + this.$refs.multipleTable.clearSelection(); } }, askDelete(typ, id) { @@ -765,65 +1071,68 @@ this.$notify({ type: "warning", message: "璇烽�夋嫨瑕佸垹闄ょ殑浜哄憳", - duration: 1000000 - }) - return + duration: 1000000, + }); + return; } } - this.askDeleteShow = true - this.delType = typ - id && (this.toDeleteId = id) + this.askDeleteShow = true; + this.delType = typ; + id && (this.toDeleteId = id); }, getUploadResult(result) { - this.uploadResult = result.data - this.dialogVisible = true - this.getPersonList() + this.uploadResult = result.data; + this.dialogVisible = true; + this.getPersonList(); }, async setEnable(item) { let res = await updateDbTableStatus({ id: item.id, - enable: item.enable - }) + enable: item.enable, + }); if (res.success) { this.$notify({ type: "success", - message: "搴曞簱鎴愬姛鍙樻洿鐢熸晥鐘舵�侊紒" - }) + message: "搴曞簱鎴愬姛鍙樻洿鐢熸晥鐘舵�侊紒", + }); } else { this.$notify({ type: "error", - message: "搴曞簱鍙樻洿鐢熸晥鐘舵�佸け璐ワ紒" - }) + message: "搴曞簱鍙樻洿鐢熸晥鐘舵�佸け璐ワ紒", + }); } }, isDisabled(item) { - var flag = true + var flag = true; if (this.isShow("library:set")) { if (item.endTime == "") { - flag = false + flag = false; } else { - flag = !this.$moment(new Date()).isBetween(item.startTime, item.endTime) + flag = !this.$moment(new Date()).isBetween( + item.startTime, + item.endTime + ); } } - return flag + return flag; }, edit() { - this.$emit("changeShow", this.baseObject, this.syncType) + this.$emit("changeShow", this.baseObject, this.syncType); }, deleteThis() { - debugger + debugger; deleteDbPersonById({ id: this.toDeleteId }) .then((data) => { if (data.success) { this.$notify({ type: "success", - message: "璇ヤ汉鍛樺垹闄ゆ垚鍔燂紒" - }) + message: "璇ヤ汉鍛樺垹闄ゆ垚鍔燂紒", + }); } - this.getPersonList() + this.getPersonList(); }) - .catch((err) => {}) + .catch((err) => {}); }, deleteBase() { deleteDBtablesById({ id: this.baseObject.id }) @@ -831,90 +1140,91 @@ if (res.success) { this.$notify({ type: "success", - message: "搴曞簱鍒犻櫎鎴愬姛锛�" - }) + message: "搴曞簱鍒犻櫎鎴愬姛锛�", + }); } - this.$emit("onDelete") + this.$emit("onDelete"); }) .catch((err) => { this.$notify({ type: "error", - message: err - }) - }) + message: err, + }); + }); }, async deleteBatch() { - let ids = [] + let ids = []; this.selectedRowKeys.map((item, index) => { - ids.push(item.id) - }) - let res = await deleteBasePersons({ ids: ids }) + ids.push(item.id); + }); + let res = await deleteBasePersons({ ids: ids }); if (res.success) { this.$notify({ type: "success", - message: "鍒犻櫎鎴愬姛锛�" - }) - this.getPersonList() + message: "鍒犻櫎鎴愬姛锛�", + }); + this.getPersonList(); } else { this.$notify({ type: "error", - message: "鍒犻櫎澶辫触锛�" - }) + message: "鍒犻櫎澶辫触锛�", + }); } }, async getPersonList() { this.$nextTick(() => { if (this.baseObject.id && this.baseObject.id !== undefined) { - this.BaseManageData.tableId = this.baseObject.id - this.setLoadSearch(this.BaseManageData.queryPersonList()) + this.BaseManageData.tableId = this.baseObject.id; + this.setLoadSearch(this.BaseManageData.queryPersonList()); } - }) + }); }, changeDialog(data) { data.erFileList.map((item, index) => { this.$notify({ type: "error", - message: item.errorMsg.message - }) - }) + message: item.errorMsg.message, + customClass: "PersonListDialog", + }); + }); }, handleClose() { - this.showInfoDrawer = false + this.showInfoDrawer = false; }, handleSelectionChange(val) { - this.selectedRowKeys = val + this.selectedRowKeys = val; }, refrash(current, pageSize) { - this.current = current - this.BaseManageData.page = current - this.getPersonList() + this.current = current; + this.BaseManageData.page = current; + this.getPersonList(); }, handleSizeChange(val) { - this.BaseManageData.size = val - this.getPersonList() + this.BaseManageData.size = val; + this.getPersonList(); }, editRow(row) { - this.inputPersonForm = { ...row } - this.showInfoDrawer = true + this.inputPersonForm = { ...row }; + this.showInfoDrawer = true; }, async submit() { this.$refs["formForEdit"].validate(async (valid) => { if (valid) { - let { ...json } = this.inputPersonForm - delete json["compareScore"] - let res = await updateBasePerson(json) + let { ...json } = this.inputPersonForm; + delete json["compareScore"]; + let res = await updateBasePerson(json); if (res.success) { - this.getPersonList() - this.$notify.success("浜哄憳淇敼鎴愬姛锛�") - this.showInfoDrawer = false + this.getPersonList(); + this.$notify.success("浜哄憳淇敼鎴愬姛锛�"); + this.showInfoDrawer = false; } else { - this.$notify.error("浜哄憳淇敼澶辫触锛岃閲嶈瘯锛�") + this.$notify.error("浜哄憳淇敼澶辫触锛岃閲嶈瘯锛�"); } } else { - return false + return false; } - }) + }); }, async enable(item) { let res = await updateBasePerson({ @@ -927,44 +1237,44 @@ phoneNum: item.phoneNum, monitorLevel: item.monitorLevel, personPicUrl: item.personPicUrl, - reserved: item.reserved - }) + reserved: item.reserved, + }); if (res.success === true) { this.$notify({ type: "success", - message: "搴曞簱浜哄憳鎴愬姛鍙樻洿鐢熸晥鐘舵�侊紒" - }) + message: "搴曞簱浜哄憳鎴愬姛鍙樻洿鐢熸晥鐘舵�侊紒", + }); } else { this.$notify({ type: "error", - message: "搴曞簱浜哄憳鍙樻洿鐢熸晥鐘舵�佸け璐ワ紒" - }) + message: "搴曞簱浜哄憳鍙樻洿鐢熸晥鐘舵�佸け璐ワ紒", + }); } }, handleSearch() { - this.getPersonList() + this.getPersonList(); }, async handleDel() { - this.delBtnLoading = true + this.delBtnLoading = true; if (this.delType == "single") { - await this.deleteThis() + await this.deleteThis(); } else if (this.delType == "base") { - await this.deleteBase() + await this.deleteBase(); } else if (this.delType == "batch") { - await this.deleteBatch() + await this.deleteBatch(); } - this.delBtnLoading = false - this.askDeleteShow = false + this.delBtnLoading = false; + this.askDeleteShow = false; }, searchImg() { - this.$refs.uploadDrag && this.$refs.uploadDrag.uploadStart() + this.$refs.uploadDrag && this.$refs.uploadDrag.uploadStart(); }, haveScore(row) { if (row.compareScore && row.compareScore !== "") { - return true + return true; } else { - return false + return false; } }, async searchImgList(faceUrl, threshold) { @@ -975,199 +1285,214 @@ faceUrl: faceUrl, threshold: threshold, orderType: this.orderType, - orderName: this.orderName - } - let res = await getPersonByPhoto(json) - this.tableData = res.data.datalist - this.total = res.data.total - this.compare = true + orderName: this.orderName, + }; + let res = await getPersonByPhoto(json); + this.tableData = res.data.datalist; + this.total = res.data.total; + this.compare = true; }, updateThreshold() {}, async updateFace(param) { - const fd = new FormData() - fd.append("file", param.file) - fd.append("id", this.inputPersonForm.id) + const fd = new FormData(); + fd.append("file", param.file); + fd.append("id", this.inputPersonForm.id); let res = await axios({ method: "post", url: `/data/api-v/dbperson/updateFace`, headers: { Authorization: - sessionStorage.getItem("loginedInfo") && JSON.parse(sessionStorage.getItem("loginedInfo")).access_token + sessionStorage.getItem("loginedInfo") && + JSON.parse(sessionStorage.getItem("loginedInfo")).access_token, }, - data: fd - }) + data: fd, + }); if (res.data.success) { - this.inputPersonForm.persoasyncnPicUrl = res.data.data.personPicUrl - this.inputPersonForm.faceFeature = res.data.data.faceFeature + this.inputPersonForm.persoasyncnPicUrl = res.data.data.personPicUrl; + this.inputPersonForm.faceFeature = res.data.data.faceFeature; } }, uploadSuccess() {}, uploadError() {}, async init() { - await this.BaseManageData.querySyncTables() - await this.BaseManageData.queryLocalTables() + await this.BaseManageData.querySyncTables(); + await this.BaseManageData.queryLocalTables(); if (this.baseObject.id && this.baseObject.id !== undefined) { - } else if (this.BaseManageData.syncTables[0].id && this.BaseManageData.syncTables[0].id !== undefined) { - this.BaseManageData.tableId = this.BaseManageData.syncTables[0].id - this.BaseManageData.queryPersonList() + } else if ( + this.BaseManageData.syncTables[0].id && + this.BaseManageData.syncTables[0].id !== undefined + ) { + this.BaseManageData.tableId = this.BaseManageData.syncTables[0].id; + this.BaseManageData.queryPersonList(); } else { - this.BaseManageData.tableId = this.BaseManageData.localTables[0].id - this.BaseManageData.queryPersonList() + this.BaseManageData.tableId = this.BaseManageData.localTables[0].id; + this.BaseManageData.queryPersonList(); } }, blackAngWhite() { if (this.BaseManageData.selectBlacks.length > 0) { for (let i = 0; i < this.BaseManageData.whiteList.length; i++) { //this.VideoPhotoData.whiteList[i].disabled = true - this.$set(this.BaseManageData.whiteList[i], "disabled", true) + this.$set(this.BaseManageData.whiteList[i], "disabled", true); } } if (this.BaseManageData.selectBlacks.length == 0) { for (let i = 0; i < this.BaseManageData.whiteList.length; i++) { //this.VideoPhotoData.whiteList[i].disabled = false - this.$set(this.BaseManageData.whiteList[i], "disabled", false) + this.$set(this.BaseManageData.whiteList[i], "disabled", false); } } if (this.BaseManageData.selectWhites.length > 0) { for (let i = 0; i < this.BaseManageData.blackList.length; i++) { // this.VideoPhotoData.blackList[i].disabled = true - this.$set(this.BaseManageData.blackList[i], "disabled", true) + this.$set(this.BaseManageData.blackList[i], "disabled", true); } } if (this.BaseManageData.selectWhites.length == 0) { for (let i = 0; i < this.BaseManageData.blackList.length; i++) { //this.VideoPhotoData.blackList[i].disabled = false - this.$set(this.BaseManageData.blackList[i], "disabled", false) + this.$set(this.BaseManageData.blackList[i], "disabled", false); } } }, tosearch(item) { //let captureId = item.id == "" ? item.baseInfo[0].targetId : item.id - let captureId = item.id == "" ? item.personId : item.id - let imgUrl = item.personPicUrl ? item.personPicUrl : item.personPicUrl - let compType = 0 + let captureId = item.id == "" ? item.personId : item.id; + let imgUrl = item.personPicUrl ? item.personPicUrl : item.personPicUrl; + let compType = 0; let message = - "toSearch?showType=findByPic&targetId=" + captureId + "&picSmUrl=" + imgUrl + "&compType=" + compType + "toSearch?showType=findByPic&targetId=" + + captureId + + "&picSmUrl=" + + imgUrl + + "&compType=" + + compType; window.parent.postMessage( { - msg: message + msg: message, }, "*" - ) + ); }, copyClick(row) { - this.BaseManageData.personId = row.id - this.copyVisiabled = true + this.BaseManageData.personId = row.id; + this.copyVisiabled = true; }, moveClick(row) { - this.BaseManageData.personId = row.id - this.moveVisiabled = true + this.BaseManageData.personId = row.id; + this.moveVisiabled = true; }, copyClose() { - this.copyVisiabled = false - this.BaseManageData.personId = "" - this.BaseManageData.selectBlacks = [] - this.BaseManageData.selectWhites = [] + this.copyVisiabled = false; + this.BaseManageData.personId = ""; + this.BaseManageData.selectBlacks = []; + this.BaseManageData.selectWhites = []; }, moveClose() { - this.moveVisiabled = false - this.BaseManageData.personId = "" - this.BaseManageData.selectBlacks = [] - this.BaseManageData.selectWhites = [] + this.moveVisiabled = false; + this.BaseManageData.personId = ""; + this.BaseManageData.selectBlacks = []; + this.BaseManageData.selectWhites = []; }, copySubmit() { - if (this.BaseManageData.selectBlacks.length === 0 && this.BaseManageData.selectWhites.length === 0) { + if ( + this.BaseManageData.selectBlacks.length === 0 && + this.BaseManageData.selectWhites.length === 0 + ) { this.$notify({ title: "娉ㄦ剰", message: "璇烽�夋嫨瑕佸鍒跺埌鐨勫簱", - type: "warning" - }) - return + type: "warning", + }); + return; } - var resp = this.BaseManageData.copyTo() + var resp = this.BaseManageData.copyTo(); resp.then((data) => { if (data.success) { this.$notify({ title: "鎴愬姛", message: data.data, - type: "success" - }) + type: "success", + }); } else { this.$notify({ title: "澶辫触", message: data.data, - type: "error" - }) + type: "error", + }); } - }) - this.copyVisiabled = false - this.BaseManageData.personId = "" - this.BaseManageData.selectBlacks = [] - this.BaseManageData.selectWhites = [] + }); + this.copyVisiabled = false; + this.BaseManageData.personId = ""; + this.BaseManageData.selectBlacks = []; + this.BaseManageData.selectWhites = []; }, moveSubmit() { - if (this.BaseManageData.selectBlacks.length === 0 && this.BaseManageData.selectWhites.length === 0) { + if ( + this.BaseManageData.selectBlacks.length === 0 && + this.BaseManageData.selectWhites.length === 0 + ) { this.$notify({ title: "娉ㄦ剰", message: "璇烽�夋嫨瑕佺Щ鍔ㄥ埌鐨勫簱", - type: "warning" - }) - return + type: "warning", + }); + return; } - var resp = this.BaseManageData.moveTo() + var resp = this.BaseManageData.moveTo(); resp.then((data) => { if (data.success) { this.$notify({ title: "鎴愬姛", message: data.data, - type: "success" - }) + type: "success", + }); } else { this.$notify({ title: "澶辫触", message: data.data, - type: "error" - }) + type: "error", + }); } - this.moveVisiabled = false - this.BaseManageData.personId = "" - this.BaseManageData.selectBlacks = [] - this.BaseManageData.selectWhites = [] - this.BaseManageData.queryPersonList() - }) + this.moveVisiabled = false; + this.BaseManageData.personId = ""; + this.BaseManageData.selectBlacks = []; + this.BaseManageData.selectWhites = []; + this.BaseManageData.queryPersonList(); + }); }, setLoadSearch(fn) { - this.AuthData.setLoading("multipleTable", this) + this.AuthData.setLoading("multipleTable", this); fn.then((_) => { - this.AuthData.closeLoad() - }) - } + this.AuthData.closeLoad(); + }); + }, }, mounted() { - this.getPersonList() - this.VideoPhotoData.queryDictionary() - this.BaseManageData.queryTagList() - this.oldWidth = document.body.clientWidth - this.oldHeight = document.body.clientHeight - this.blackAngWhite() + this.getPersonList(); + this.VideoPhotoData.queryDictionary(); + this.BaseManageData.queryTagList(); + this.oldWidth = document.body.clientWidth; + this.oldHeight = document.body.clientHeight; + this.blackAngWhite(); window.onresize = () => { - let width = document.body.clientWidth - let height = document.body.clientHeight + let width = document.body.clientWidth; + let height = document.body.clientHeight; if (width !== this.oldWidth && width < 1750) { } this.$nextTick(() => { - this.$refs.multipleTable.doLayout() - }) - } + this.$refs.multipleTable.doLayout(); + }); + }; this.$nextTick(() => { - this.$refs.multipleTable.doLayout() - }) + this.$refs.multipleTable.doLayout(); + }); }, beforeDestroy() { - window.onresize = null - } -} + window.onresize = null; + }, +}; </script> <style lang="scss"> .activeRow { @@ -1414,7 +1739,8 @@ padding-top: 2px; left: 15px; } - .el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label:before { + .el-form-item.is-required:not(.is-no-asterisk) + > .el-form-item__label:before { color: #fe6d68; } .el-col-20 { @@ -1465,7 +1791,9 @@ display: none; } .el-table--border .el-table__cell, - .el-table__body-wrapper .el-table--border.is-scrolling-left ~ .el-table__fixed { + .el-table__body-wrapper + .el-table--border.is-scrolling-left + ~ .el-table__fixed { border-right: none; } td { @@ -1879,7 +2207,8 @@ margin-bottom: 10px; } .baseList { - height: 100%; overflow: auto; + height: 100%; + overflow: auto; .base { width: 152px; padding: 5px 5px 5px 10px; @@ -2072,4 +2401,8 @@ } } } + +.PersonListDialog { + width: 360px !important; +} </style> diff --git a/src/pages/settings/views/NetSettings.vue b/src/pages/settings/views/NetSettings.vue index 4a76ee3..a318da7 100644 --- a/src/pages/settings/views/NetSettings.vue +++ b/src/pages/settings/views/NetSettings.vue @@ -237,7 +237,7 @@ <div class="ad"> <i class="el-icon-circle-plus-outline" - @click="+ipv6Form.prefix++;" + @click="+ipv6Form.prefix++" ></i> </div> <div class="ad"> @@ -1096,14 +1096,17 @@ align-items: center; .el-switch__core { height: 14px; - background-color: var(--colorCard) !important; - border-color: var(--colorCard) !important; } .el-switch.is-checked .el-switch__core::after { left: 100%; margin-left: -12px; } + .el-switch.is-checked .el-switch__core { + background-color: var(--colorCard) !important; + border-color: var(--colorCard) !important; + } + .el-switch__core:after { content: ""; position: absolute; diff --git a/src/pages/settings/views/generalSettings.vue b/src/pages/settings/views/generalSettings.vue index db07d76..35190ce 100644 --- a/src/pages/settings/views/generalSettings.vue +++ b/src/pages/settings/views/generalSettings.vue @@ -9,7 +9,9 @@ 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> @@ -18,12 +20,12 @@ <div class="min-dur"> <div class="title">鎶撴媿鍓嶅綍鍍忔椂闀�</div> <div class="entity"> - <div class="sec">{{ min_video_len }}s</div> + <div class="sec">0s</div> <div class="block"> <el-slider v-model="fakeObj.min" id="cut_min_duration" - :min="5 / 1.2" + :min="0" :max="100" :step="5 / 1.2" @input="min_len = min_video_len" @@ -33,38 +35,28 @@ :format-tooltip="formatTooltip" ></el-slider> </div> + <div class="sec">120s</div> <el-input-number v-model="min_len" @change="fakeObj.min = +(min_len / 1.2)" - :min="5" + :min="0" :step="5" :max="120" step-strictly size="small" ></el-input-number - > s --> - - <el-input-number - v-model="min_len" - @change="fakeObj.min = +(min_len / 1.2)" - :min="5" - :step="5" - :max="120" - step-strictly - size="small" - ></el-input-number - > s + >s </div> </div> <div class="min-dur"> <div class="title">鎶撴媿鍚庡綍鍍忔椂闀�</div> <div class="entity"> - <div class="sec">{{ max_video_len }} s</div> + <div class="sec">0s</div> <div class="block"> <el-slider v-model="fakeObj.max" id="cut_max_duration" - :min="5 / 1.2" + :min="0" @input="max_len = max_video_len" :max="100" :step="5 / 1.2" @@ -73,10 +65,11 @@ :show-tooltip="true" ></el-slider> </div> + <div class="sec">120s</div> <el-input-number v-model="max_len" @change="fakeObj.max = +(max_len / 1.2)" - :min="5" + :min="0" :step="5" step-strictly :max="120" @@ -105,7 +98,12 @@ </div> <div class="sound-btns"> <span @click="togglePlay(item, i)"> - <span class="iconfont" v-if="!item.isPlay" style="cursor: pointer">{{ playSpan }}</span> + <span + class="iconfont" + v-if="!item.isPlay" + style="cursor: pointer" + >{{ playSpan }}</span + > <!-- <span class="iconfont" v-else style="cursor: pointer">{{ playSpan2 }}</span> --> @@ -129,13 +127,28 @@ ></i> <i v-else class="el-icon-video-pause"></i> --> </span> - <span class="icon iconfont del" style="cursor: pointer" @click="removeSound(item)">{{ delspan }}</span> + <span + class="icon iconfont del" + style="cursor: pointer" + @click="removeSound(item)" + >{{ delspan }}</span + > </div> </div> </div> <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> + <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> @@ -144,7 +157,9 @@ <div class="add-group"> <div class="add-btn"> - <span class="icon iconfont" @click.stop="showUpload = !showUpload"></span> + <span class="icon iconfont" @click.stop="showUpload = !showUpload" + ></span + > </div> </div> </div> @@ -152,7 +167,11 @@ <div class="self-setting" v-if="activePage == 2"> <div class="top-title">棰滆壊涓婚</div> <div class="color-bar"> - <div v-for="(item, index) in colorList" :key="index" style="border: none"> + <div + v-for="(item, index) in colorList" + :key="index" + style="border: none" + > <div class="color-option" v-if="universalColor != index" @@ -165,11 +184,14 @@ v-else :style="{ cursor: 'pointer', - border: `2px solid ${item.color}` + border: `2px solid ${item.color}`, }" @click="colorCard(item.color, index)" > - <div :style="{ backgroundColor: item.color }" class="color-option-content"></div> + <div + :style="{ backgroundColor: item.color }" + class="color-option-content" + ></div> </div> </div> </div> @@ -177,10 +199,18 @@ <div class="icon-bar" style="cursor: pointer" @click="selectIcons(0)"> <div class="bar-title"> <span class="title">闈㈡�ч鏍�</span> - <span class="icon iconfont" :class="activeIcons == 0 ? 'icon-active' : 'icon-normal'"></span> + <span + class="icon iconfont" + :class="activeIcons == 0 ? 'icon-active' : 'icon-normal'" + ></span + > </div> <div class="entity"> - <div class="entity-img" v-for="(item, i) in realIconList" :key="i"> + <div + class="entity-img" + v-for="(item, i) in realIconList" + :key="i" + > <img :src="item.url" alt="" /> </div> </div> @@ -188,10 +218,18 @@ <div class="icon-bar" style="cursor: pointer" @click="selectIcons(1)"> <div class="bar-title"> <span class="title">绠�绾﹂鏍�</span> - <span class="icon iconfont" :class="activeIcons == 1 ? 'icon-active' : 'icon-normal'"></span> + <span + class="icon iconfont" + :class="activeIcons == 1 ? 'icon-active' : 'icon-normal'" + ></span + > </div> <div class="entity"> - <div class="entity-img" v-for="(item, i) in flatIconList" :key="i"> + <div + class="entity-img" + v-for="(item, i) in flatIconList" + :key="i" + > <img :src="item.url" alt="" /> </div> </div> @@ -218,9 +256,9 @@ </template> <script> -import { saveAlarmConfig, getDevInfo } from "@/api/system" -import { uploadSound, getSoundList, deleteSound } from "@/api/event" -import { updateUser } from "@/api/user" +import { saveAlarmConfig, getDevInfo } from "@/api/system"; +import { uploadSound, getSoundList, deleteSound } from "@/api/event"; +import { updateUser } from "@/api/user"; export default { data() { return { @@ -235,12 +273,12 @@ max_len: 0, fakeObj: { min: 0, - max: 0 + max: 0, }, menuArr: [ { name: "浜嬩欢褰曞儚鏃堕暱", icon: "\ue74f", size: 20 }, { name: "浜嬩欢澹伴煶", icon: "\ueb5e", size: 16 }, - { name: "涓�у寲璁剧疆", icon: "\ue750", size: 18 } + { name: "涓�у寲璁剧疆", icon: "\ue750", size: 18 }, ], soundList: [], activePage: 0, @@ -256,7 +294,7 @@ webVersion: "", disks: "", memory: "", - activeBg: 0 + activeBg: 0, }, isPlay: false, realIconList: [ @@ -266,7 +304,7 @@ { url: "/images/settings/闈㈡�у浘鏍�/4瀹夊叏甯芥娴�.png" }, { url: "/images/settings/闈㈡�у浘鏍�/5濂旇窇.png" }, { url: "/images/settings/闈㈡�у浘鏍�/6杞﹁締妫�娴�.png" }, - { url: "/images/settings/闈㈡�у浘鏍�/7鎶界儫.png" } + { url: "/images/settings/闈㈡�у浘鏍�/7鎶界儫.png" }, ], flatIconList: [ { url: "/images/settings/绠�绾﹀浘鏍�/1浠板崸妫�娴�.png" }, @@ -275,12 +313,12 @@ { url: "/images/settings/绠�绾﹀浘鏍�/4瀹夊叏甯芥娴�.png" }, { url: "/images/settings/绠�绾﹀浘鏍�/5濂旇窇.png" }, { url: "/images/settings/绠�绾﹀浘鏍�/6杞﹁締妫�娴�.png" }, - { url: "/images/settings/绠�绾﹀浘鏍�/7鎶界儫.png" } + { url: "/images/settings/绠�绾﹀浘鏍�/7鎶界儫.png" }, ], tableBGList: [ { name: "background", url: "/images/desktop/background.png" }, { name: "message", url: "/images/desktop/message.png" }, - { name: "weather", url: "/images/desktop/weather.png" } + { name: "weather", url: "/images/desktop/weather.png" }, ], universalColor: "", colorList: [ @@ -292,227 +330,229 @@ { name: 6, color: "#61E2EB" }, { name: 7, color: "#4E94FF" }, { name: 8, color: "#8E8CD8" }, - { name: 9, color: "#4C4A48" } - ] - } + { name: 9, color: "#4C4A48" }, + ], + }; }, mounted() { - this.getDeviceInfo() - this.getSounds() - const url = this.curUser.backgroundpic - this.activeIcons = this.curUser.useIconType - 1 + this.getDeviceInfo(); + this.getSounds(); + const url = this.curUser.backgroundpic; + this.activeIcons = this.curUser.useIconType - 1; this.universalColor = this.colorList.findIndex((x) => { - return x.color == localStorage.getItem("--colorCard") - }) + return x.color == localStorage.getItem("--colorCard"); + }); if (url) { this.activeBg = this.tableBGList.findIndex((x) => { - return x.url == url - }) + return x.url == url; + }); } else { - this.activeBg = 0 + this.activeBg = 0; } - this.eventAudio.addEventListener("ended", this.endedHandle, false) - this.$refs.curPage.addEventListener("click", this.clickHandle, false) + this.eventAudio.addEventListener("ended", this.endedHandle, false); + this.$refs.curPage.addEventListener("click", this.clickHandle, false); }, beforeDestroy() { - this.eventAudio.removeEventListener("ended", this.endedHandle, false) - this.$refs.curPage.removeEventListener("click", this.clickHandle, false) + this.eventAudio.removeEventListener("ended", this.endedHandle, false); + this.$refs.curPage.removeEventListener("click", this.clickHandle, false); }, computed: { min_video_len() { - return Math.round(this.fakeObj.min * 1.2) + return Math.round(this.fakeObj.min * 1.2); }, max_video_len() { - return Math.round(this.fakeObj.max * 1.2) + return Math.round(this.fakeObj.max * 1.2); }, curUser() { - return JSON.parse(sessionStorage.getItem("userInfo")) - } + return JSON.parse(sessionStorage.getItem("userInfo")); + }, }, methods: { endedHandle() { - let _this = this + let _this = this; if (_this.curPlayingIndex !== null && _this.soundList.length) { - _this.soundList[_this.curPlayingIndex].isPlay = false - _this.curPlayingIndex = null + _this.soundList[_this.curPlayingIndex].isPlay = false; + _this.curPlayingIndex = null; } }, clickHandle() { - let _this = this + let _this = this; if (this.showUpload) { - this.showUpload = false + this.showUpload = false; } }, formatTooltip(v) { - return Math.round(v * 1.2) + return Math.round(v * 1.2); }, pickBg(item, i) { - this.activeBg = i - let message = "changeBackground?" + item.name - window.parent.postMessage({ msg: message }, "*") + this.activeBg = i; + let message = "changeBackground?" + item.name; + window.parent.postMessage({ msg: message }, "*"); updateUser({ id: this.curUser.id, - backgroundpic: item.url + backgroundpic: item.url, }).then((res) => { if (res.success) { - sessionStorage.setItem("userInfo", JSON.stringify(res.data)) - debugger - this.$message.success(res.msg) + sessionStorage.setItem("userInfo", JSON.stringify(res.data)); + debugger; + this.$message.success(res.msg); } - }) - this.$forceUpdate() + }); + this.$forceUpdate(); }, togglePlay(item, i) { if (this.curPlayingIndex !== null) { - this.eventAudio.pause() - this.soundList[this.curPlayingIndex].isPlay = false + this.eventAudio.pause(); + this.soundList[this.curPlayingIndex].isPlay = false; if (this.curPlayingIndex === i) { - this.curPlayingIndex = null - return + this.curPlayingIndex = null; + return; } } - this.curPlayingIndex = i - this.eventAudio.src = "http://" + item.path + this.curPlayingIndex = i; + this.eventAudio.src = "http://" + item.path; if (item.isPlay) { - this.eventAudio.pause() + this.eventAudio.pause(); } else { - this.eventAudio.play() + this.eventAudio.play(); } - item.isPlay = !item.isPlay + item.isPlay = !item.isPlay; }, getDeviceInfo() { getDevInfo().then((res) => { - let info = res.data.deviceInfo - let basic = res.data - this.deviceInfo.cpu = info.cpu[0].modelName - this.deviceInfo.runningTime = this.secondsFormat(info.host.uptime) - this.deviceInfo.server_id = basic.server_id - this.deviceInfo.deviceModel = basic.deviceModel - this.deviceInfo.deviceDesc = basic.deviceDesc - this.deviceInfo.masterVersion = basic.masterVersion - this.deviceInfo.channelCount = basic.channelCount - this.deviceInfo.webVersion = "V2.0.0" - this.deviceInfo.disks = "( " + info.disk + ") " - this.deviceInfo.memory = (info.mem.total / 1024 / 1024 / 1024).toFixed(2) + "GB" - this.fakeObj.min = basic.min_video_len / 1.2 - this.fakeObj.max = basic.max_video_len / 1.2 - }) + let info = res.data.deviceInfo; + let basic = res.data; + this.deviceInfo.cpu = info.cpu[0].modelName; + this.deviceInfo.runningTime = this.secondsFormat(info.host.uptime); + this.deviceInfo.server_id = basic.server_id; + this.deviceInfo.deviceModel = basic.deviceModel; + this.deviceInfo.deviceDesc = basic.deviceDesc; + this.deviceInfo.masterVersion = basic.masterVersion; + this.deviceInfo.channelCount = basic.channelCount; + this.deviceInfo.webVersion = "V2.0.0"; + this.deviceInfo.disks = "( " + info.disk + ") "; + this.deviceInfo.memory = + (info.mem.total / 1024 / 1024 / 1024).toFixed(2) + "GB"; + this.fakeObj.min = basic.min_video_len / 1.2; + this.fakeObj.max = basic.max_video_len / 1.2; + }); }, getSounds() { getSoundList().then((res) => { if (res.success) { - this.soundList = res.data + this.soundList = res.data; this.soundList.forEach((x) => { - this.$set(x, "isPlay", false) - }) + this.$set(x, "isPlay", false); + }); } - }) + }); }, secondsFormat(s) { - var day = (s / (24 * 3600)) | 0 - var hour = ((s - day * 24 * 3600) / 3600) | 0 - var minute = ((s - day * 24 * 3600 - hour * 3600) / 60) | 0 - var second = s - day * 24 * 3600 - hour * 3600 - minute * 60 - return day + "澶� " + hour + "灏忔椂 " + minute + "鍒� " + second + "绉�" + var day = (s / (24 * 3600)) | 0; + var hour = ((s - day * 24 * 3600) / 3600) | 0; + var minute = ((s - day * 24 * 3600 - hour * 3600) / 60) | 0; + var second = s - day * 24 * 3600 - hour * 3600 - minute * 60; + return day + "澶� " + hour + "灏忔椂 " + minute + "鍒� " + second + "绉�"; }, uploadSound(params) { - let param = new FormData() - param.append("file", params.file) + let param = new FormData(); + param.append("file", params.file); uploadSound(param).then( (res) => { - this.$message.success("涓婁紶鎴愬姛") - this.showUpload = false - this.getSounds() + this.$message.success("涓婁紶鎴愬姛"); + this.showUpload = false; + this.getSounds(); }, (err) => { - this.$message.error("澹伴煶涓婁紶澶辫触") + this.$message.error("澹伴煶涓婁紶澶辫触"); } - ) + ); }, openRight(i) { - this.activePage = i + this.activePage = i; }, selectIcons(i) { - this.activeIcons = i + this.activeIcons = i; updateUser({ id: this.curUser.id, - iconType: i + 1 + iconType: i + 1, }).then((res) => { if (res.success) { - window.parent.postMessage({ msg: "AppUpdate" }, "*") - sessionStorage.setItem("userInfo", JSON.stringify(res.data)) - debugger - this.$message.success(res.msg) + window.parent.postMessage({ msg: "AppUpdate" }, "*"); + sessionStorage.setItem("userInfo", JSON.stringify(res.data)); + debugger; + this.$message.success(res.msg); } - }) + }); }, removeSound(item) { - const h = this.$createElement + const h = this.$createElement; const icon = this.$msgbox({ title: "", message: h( "div", { - style: "display: flex; flex-direction: column; justify-content: center; align-items: center;" + style: + "display: flex; flex-direction: column; justify-content: center; align-items: center;", }, [ h("span", { class: "icon iconfont warn-icon" }, `${this.warnSpn}`), h("span", { class: "warn-title" }, "鍒犻櫎浜嬩欢澹伴煶 "), - h("span", { class: "warn-dec" }, "鎮ㄦ槸鍚︾‘璁ゅ垹闄や簨浠跺0闊�?") + h("span", { class: "warn-dec" }, "鎮ㄦ槸鍚︾‘璁ゅ垹闄や簨浠跺0闊�?"), ] ), showCancelButton: true, confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷" + cancelButtonText: "鍙栨秷", }).then(() => { deleteSound({ - id: item.id + id: item.id, }).then( (res) => { if (res.success) { - this.getSounds() + this.getSounds(); this.$message({ type: "success", - message: "鍒犻櫎鎴愬姛!" - }) - this.showUpload = false + message: "鍒犻櫎鎴愬姛!", + }); + this.showUpload = false; } }, (err) => { - this.$message.error(err.msg) + this.$message.error(err.msg); } - ) - }) + ); + }); }, clickSound(item, i) { this.$refs["soundBar"].forEach((x) => { - x.style = "border: 2px solid #FFF;" - }) - this.$refs["soundBar"][i].style = "border: 2px solid #4E94FF;" + x.style = "border: 2px solid #FFF;"; + }); + this.$refs["soundBar"][i].style = "border: 2px solid #4E94FF;"; }, submitAlarm() { 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: "淇濆瓨鎴愬姛" - }) + message: "淇濆瓨鎴愬姛", + }); } - }) + }); }, colorCard(color, index) { - this.universalColor = index - document.documentElement.style.setProperty("--colorCard", `${color}`) - localStorage.setItem("--colorCard", `${color}`) - window.parent.postMessage({ msg: "changeColor", color }, "*") - } - } -} + this.universalColor = index; + document.documentElement.style.setProperty("--colorCard", `${color}`); + localStorage.setItem("--colorCard", `${color}`); + window.parent.postMessage({ msg: "changeColor", color }, "*"); + }, + }, +}; </script> <style scoped lang="scss"> @@ -578,8 +618,11 @@ border-top: 4px solid #f2f2f7; padding: 6px 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) .el-form-item__label-wrap > .el-form-item__label:before { + .el-form-item.is-required:not(.is-no-asterisk) + > .el-form-item__label:before, + .el-form-item.is-required:not(.is-no-asterisk) + .el-form-item__label-wrap + > .el-form-item__label:before { display: none; } .el-select { @@ -725,13 +768,13 @@ .sec { min-width: 30px; line-height: 80px; - margin-right: 10px; + color: #333; font-size: 8px; } .block { flex: 1; - margin: 0 20px 0 6px; + margin: 0 0px 0 6px; } .el-input-number--small { width: 100px; diff --git a/src/pages/systemSettings/components/ClusterManagement.vue b/src/pages/systemSettings/components/ClusterManagement.vue index 9e3efcf..326a274 100644 --- a/src/pages/systemSettings/components/ClusterManagement.vue +++ b/src/pages/systemSettings/components/ClusterManagement.vue @@ -652,11 +652,7 @@ }) .then(async () => { let res = await leave(); - this.$notify({ - title: res.success ? "鎴愬姛" : "澶辫触", - message: res.msg, - type: res.success ? "success" : "error", - }); + if (res && res.success) { this.ruleForm.clustername = ""; this.ruleForm.clusterpwd = ""; @@ -665,6 +661,11 @@ this.activeName = "1"; this.members = []; this.innerNodes = []; + this.$notify({ + title: "鎴愬姛", + message: "閫�鍑烘垚鍔�", + type: "success", + }); } }) .catch(() => { @@ -675,6 +676,11 @@ this.activeName = "1"; this.members = []; this.innerNodes = []; + this.$notify({ + title: "澶辫触", + message: "閫�鍑哄け璐�", + type: "error", + }); }); }, joinNode(event, node) { -- Gitblit v1.8.0