From 790c8124a913595818247279f50cfd2cfd892799 Mon Sep 17 00:00:00 2001 From: heyujie <516346543@qq.com> Date: 星期三, 30 六月 2021 14:25:36 +0800 Subject: [PATCH] gettasklist修改 --- src/components/subComponents/IPInput.vue | 1 src/pages/shuohuangMonitorAnalyze/components/taskManage.vue | 10 + src/pages/systemSettings/index/App.vue | 200 +++++++++++++++++++++++---------------- src/pages/systemSettings/views/NetSettings.vue | 66 +++++++++--- 4 files changed, 172 insertions(+), 105 deletions(-) diff --git a/src/components/subComponents/IPInput.vue b/src/components/subComponents/IPInput.vue index 4f59322..99f2198 100644 --- a/src/components/subComponents/IPInput.vue +++ b/src/components/subComponents/IPInput.vue @@ -86,6 +86,7 @@ }, watch: { ip(ip) { + this.syncIp(ip); } }, diff --git a/src/pages/shuohuangMonitorAnalyze/components/taskManage.vue b/src/pages/shuohuangMonitorAnalyze/components/taskManage.vue index e0130a2..415a061 100644 --- a/src/pages/shuohuangMonitorAnalyze/components/taskManage.vue +++ b/src/pages/shuohuangMonitorAnalyze/components/taskManage.vue @@ -190,7 +190,7 @@ <el-table-column prop="Title" label="鏈鸿溅鍙�"></el-table-column> <el-table-column label="瑙嗛鏁伴噺"> <template slot-scope="scope"> - <div>{{ scope.row.LKGList.length }}</div> + <div>{{ scope.row.VideoList.length }}</div> </template> </el-table-column> <el-table-column @@ -226,7 +226,7 @@ <template slot-scope="scope"> <div class="video-item" - v-for="video in scope.row.LKGList" + v-for="video in scope.row.VideoList" :key="video.ID" > {{ video.VideoName }} @@ -329,7 +329,7 @@ checkedCount > 0 && checkedCount < this.personList.length; }, cancelDistribute(row) { - let arr = row.LKGList.map(x => x.ID); + let arr = row.VideoList.map(x => x.ID); cancelMission({ LkgIDs: arr }).then((res) => { if (res.success) { this.$notify({ @@ -358,7 +358,7 @@ this.renderTaskTable(); }, taskTableSelection(val) { - let arr = val.map((item) => item.LKGList.map((x) => x.ID)); + let arr = val.map((item) => item.VideoList.map((x) => x.ID)); this.taskVideoChecked = arr; }, renderTaskTable() { @@ -530,6 +530,8 @@ .video-list { margin-top: 14px; text-align: left; + height: 420px; + overflow: auto; .el-checkbox-group { margin-bottom: 20px; .el-checkbox__label { diff --git a/src/pages/systemSettings/index/App.vue b/src/pages/systemSettings/index/App.vue index c477954..9f3e647 100644 --- a/src/pages/systemSettings/index/App.vue +++ b/src/pages/systemSettings/index/App.vue @@ -3,6 +3,7 @@ <div class="container-left"> <div class="left-card" + :class="activeIndex == index ? 'left-card-active' : ''" v-for="(item, index) in menuArr" :key="index" @click="openMenu(item, index)" @@ -32,7 +33,7 @@ <span class="user-name">{{ item.username }}</span> </div> </div> - <div class="add-account"> + <div class="add-account" > <span class="icon iconfont" @click="showAddAccount"></span> </div> </div> @@ -51,13 +52,21 @@ <div class="line"> <div class="name">NTP鏍℃椂</div> - <el-switch v-model="isNtp" active-color="rgba(61, 104, 225, 1)"> + <el-switch + v-model="isNtp" + @change="changeSwitch('isNtp')" + active-color="rgba(61, 104, 225, 1)" + > </el-switch> </div> <div class="line"> <div class="name">鎵嬪姩鏍″</div> - <el-switch v-model="isManual" active-color="rgba(61, 104, 225, 1)"> + <el-switch + v-model="isManual" + @change="changeSwitch('isManual')" + active-color="rgba(61, 104, 225, 1)" + > </el-switch> </div> </div> @@ -100,6 +109,7 @@ ></span > </div> + <div class="user-role">{{activeAccountItem.sysRoles.length?activeAccountItem.sysRoles[0].name:""}}</div> </div> </div> <div class="list-btn"> @@ -159,23 +169,30 @@ <el-switch v-model="item.selected" active-color="rgba(61, 104, 225, 1)" + @change="fatherChange(item)" > </el-switch> </div> <div v-if="item.children"> - <div class="line" style="margin-left:55px;" v-for="x in item.children" :key="x.id"> - <div class="name">{{ x.name }}</div> - <el-switch - v-model="x.selected" - active-color="rgba(61, 104, 225, 1)" - > - </el-switch> - </div> + <div + class="line" + style="margin-left: 55px" + v-for="x in item.children" + :key="x.id" + > + <div class="name">{{ x.name }}</div> + <el-switch + v-model="x.selected" + active-color="rgba(61, 104, 225, 1)" + @change="childrenChange(item)" + > + </el-switch> </div> + </div> </div> <div class="btns"> <div class="cancel" @click="cancelSet">鍙栨秷</div> - <div class="ok">淇濆瓨</div> + <div class="ok" @click="saveAuth">淇濆瓨</div> </div> </div> @@ -448,6 +465,7 @@ addUser, getUsers, updateUser, + updataUser, updatePassword, deleteUser, getUserMenus, @@ -617,15 +635,7 @@ clearInterval(this.browserTimer); }, mounted() { - // const s = document.getElementsByClassName("left-card")[0]; - // s.style.backgroundColor = "rgba(61, 104, 225, 1)"; - // s.style.color = "#fff"; - this.$nextTick(() => { - this.initClockConf(); - }); - this.fetchUserList(); - this.fetchSysMenus(); }, methods: { fetchUserList() { @@ -657,6 +667,7 @@ openAccount(item, i) { this.activeAccountItem = item; this.activeAccountIndex = i; + this.inAccountDetail = false; }, minusOne(typ) { this.isSyncBrowser = false; @@ -713,11 +724,20 @@ break; } }, + fatherChange(item) { + item.children.forEach((x) => { + x.selected = false; + }); + }, + childrenChange(item) { + let isAllSelected = item.children.every((x) => x.selected == true); + let isAllNotSelected = item.children.every((x) => x.selected == false); + if (isAllSelected) item.selected = true; + if (isAllNotSelected) item.selected = false; + }, getMaxDay() { const maxDay = new Date(+this.syncYrs, +this.syncMonth, 0).getDate(); - if (this.syncDay > maxDay) { - this.syncDay = maxDay; - } + if (this.syncDay > maxDay) this.syncDay = maxDay; }, plusOne(typ) { this.isSyncBrowser = false; @@ -762,7 +782,6 @@ if (num > maxDay) { num = 1; } - // this.syncDay = this.padZero(num); break; default: @@ -770,9 +789,8 @@ } }, submitClock() { - debugger; if (this.syncType === "1") { - if (this.ntpServer === "") { + if (this.ntpServer === ""||this.ntpServer === "...") { this.$notify({ type: "error", message: "NTP 鏈嶅姟鍣ㄥ湴鍧�涓嶈兘涓虹┖", @@ -792,14 +810,13 @@ } else { this.settime = `${this.syncYrs}-${this.syncMonth}-${this.syncDay} ${this.syncHour}:${this.syncMin}:${this.syncSec}`; } - let requestBody = { + saveClockInfo({ timeZone: this.timezone, ntp: this.syncType === "1", ntpServer: this.ntpServer, interval: this.timeInterval, newTime: this.settime, - }; - saveClockInfo(requestBody).then((rsp) => { + }).then((rsp) => { if (rsp && rsp.success) { this.$notify({ type: "success", @@ -809,19 +826,32 @@ this.initClockConf(); }); }, + flatGetArr(arr, res) { + for (const item of arr) { + if (item.selected) res.push(item.id); + if (item.children) this.flatGetArr(item.children, res); + } + }, + saveAuth() { + let arr = []; + this.flatGetArr(this.sysMenus, arr); + updataUser({ + id: this.activeAccountItem.id, + menuIds: arr, + }).then((res) => { + res.data; + }); + }, formatTime(number, format) { var formateArr = ["Y", "M", "D", "h", "m", "s"]; var returnArr = []; - var date = new Date(number * 1000); returnArr.push(date.getFullYear()); returnArr.push(this.formatNumber(date.getMonth() + 1)); returnArr.push(this.formatNumber(date.getDate())); - returnArr.push(this.formatNumber(date.getHours())); returnArr.push(this.formatNumber(date.getMinutes())); returnArr.push(this.formatNumber(date.getSeconds())); - this.weekday = "鏄熸湡" + "鏃ヤ竴浜屼笁鍥涗簲鍏�".charAt(date.getDay()); for (var i in returnArr) { format = format.replace(formateArr[i], returnArr[i]); @@ -832,7 +862,6 @@ n = +n; return n < 10 ? "0" + n : "" + n; }, - //鏁版嵁杞寲 formatNumber(n) { n = n.toString(); return n[1] ? n : "0" + n; @@ -850,6 +879,8 @@ this.timezone = rsp.data.time_zone; if (!ntpTest) { this.syncType = rsp.data.ntp ? "1" : "2"; + this.isNtp = rsp.data.ntp + this.isManual = !rsp.data.ntp } if (rsp.data.ntp) { this.ntpServer = rsp.data.ntp_server; @@ -858,22 +889,17 @@ this.timestamp = rsp.data.local_time; if (this.clockTimer === null) { this.runClock(); + if(this.isManual)this.parseTime() } } }); }, openMenu(item, i) { - const old = document.getElementsByClassName("left-card")[ - this.activeIndex - ]; - old.style.backgroundColor = "initial"; - old.style.color = "rgba(81, 81, 81, 1)"; - this.activePage = item.name; this.activeIndex = i; - const s = document.getElementsByClassName("left-card")[i]; - s.style.backgroundColor = "rgba(61, 104, 225, 1)"; - s.style.color = "#fff"; + if (this.activePage == "鏃ユ湡鏃堕棿") { + this.initClockConf(); + } }, showInput(typ) { this[`show${typ}Input`] = true; @@ -888,9 +914,9 @@ this[`show${typ}Input`] = false; this[`input${typ}`] = ""; }, - syncBrowser(val) { + syncBrowser(enable) { this.isSyncBrowser = val; - if (val == false) { + if (!enable) { clearInterval(this.browserTimer); } else { this.browserTimer = setInterval(() => { @@ -914,14 +940,7 @@ this.isChangePw = false; this.inAccountDetail = false; }, - fetchSysMenus() { - getSysMenus().then((rsp) => { - if (rsp && rsp.success) { - this.sysMenus = rsp.data; - console.log(this.sysMenus); - } - }); - }, + saveAddAccount(formName) { this.$refs[formName].validate((valid) => { if (valid) { @@ -992,7 +1011,6 @@ cancelButtonText: "鍙栨秷", }) .then(() => { - debugger; deleteUser({ ids: [this.activeAccountItem.id], }).then((res) => { @@ -1009,46 +1027,54 @@ }) .catch(() => {}); }, - openPermission() { - this.inAccountDetail = true; - this.isSetPermission = true; + fetchMenu() { getUserMenus({ userId: this.activeAccountItem.id, }).then((res) => { if (res && res.success) { - res.data.menus.forEach(e => { - - }); + this.sysMenus = res.data; } }); - - // getUserMenus({ userId: row.id }).then(rsp => { - // if (rsp && rsp.success) { - // this.userMenus = rsp.data.menus.map(menu => { - // return menu.id - // }) - // } - // }) }, - }, - watch: { - isManual(v) { - this.isNtp = !v; - v && (this.syncType = "2"); - if (v) { - [this.syncYrs, this.syncMonth, this.syncDay] = this.equipmentDate.split( - "-" - ); - [this.syncHour, this.syncMin, this.syncSec] = this.equipmentTime.split( - ":" - ); + openPermission() { + this.inAccountDetail = true; + this.isSetPermission = true; + this.fetchMenu(); + }, + parseTime(){ + debugger; + [this.syncYrs, this.syncMonth, this.syncDay] = this.equipmentDate.split("-"); + [this.syncHour, this.syncMin, this.syncSec] = this.equipmentTime.split(":"); + }, + changeSwitch(str) { + if (str == "isNtp") { + this.isManual = !this[str]; + } else { + this.isNtp = !this[str]; } - }, - isNtp(v) { - this.isManual = !v; - v && (this.syncType = "1"); + this.syncType = this.isNtp ? "1" : "2"; + if (this.isManual) this.parseTime() }, }, + computed: { + isShowAddAccount(){ + const info = JSON.parse(sessionStorage.getItem('userInfo')) + return true + } + }, + // watch: { + // isManual(v) { + // this.isNtp = !v; + // v && (this.syncType = "2"); + // if (v) { + + // } + // }, + // isNtp(v) { + // this.isManual = !v; + // v && (this.syncType = "1"); + // }, + // }, }; </script> <style lang="scss"> @@ -1083,6 +1109,10 @@ .card-text { font-size: 16px; } + } + .left-card-active { + background-color: rgba(61, 104, 225, 1); + color: #fff; } .left-card:hover { background-color: rgba(61, 104, 225, 1); @@ -1249,6 +1279,10 @@ cursor: pointer; } } + .user-role{ + margin: 5px 0 0 15px; + font-size: 14px; + } } } .list-btn { diff --git a/src/pages/systemSettings/views/NetSettings.vue b/src/pages/systemSettings/views/NetSettings.vue index 600cf6e..71fb93e 100644 --- a/src/pages/systemSettings/views/NetSettings.vue +++ b/src/pages/systemSettings/views/NetSettings.vue @@ -57,9 +57,9 @@ <div class="more-detail"> <span class="icon iconfont"></span> - <span + <span class="icon iconfont" - style="margin-left:10px;cursor:pointer;" + style="margin-left: 10px; cursor: pointer" @click="checkWifi(item)" ></span > @@ -233,12 +233,15 @@ <span class="icon iconfont"></span> <el-switch - v-model="value" + v-model="item.active" active-color="rgba(61, 104, 225, 1)" - @change="switchChange" + @change="switchNetCard" > </el-switch> </div> + + + </div> </div> <div @@ -389,6 +392,7 @@ }, ], value: "", + netCardValue: "", }; }, components: { @@ -403,6 +407,13 @@ beforeDestroy() {}, props: ["barName"], methods: { + // parseFlags(flags) { + // let arr = flags.split("|"); + // if (arr.length) { + // return arr[0] == "up"; + // } + // return false; + // }, getCurServer() { getDevInfo().then((res) => { this.ruleForm.deviceName = res.data.server_name; @@ -412,16 +423,32 @@ fetchWireList() { getWireList().then((res) => { if (res && res.success) { - this.wireArr = res.data; + this.wireArr = res.data + .filter((x) => x.wireless == false) + .map((itm) => { + let arr = itm.flags.split("|"); + let f = false; + if (arr.length) { + f = arr[0] == "up"; + } + return { + flags: itm.flags, + index: itm.index, + mtu:itm.mtu, + name: itm.name, + wireless: itm.wireless, + active:f + } + }); } }); }, cancelSaveWire() { this.inWireDetail = false; - this.wireForm.ip = ''; - this.wireForm.gateway = ''; - this.wireForm.dns = ''; - this.wireForm.subMask = ''; + this.wireForm.ip = ""; + this.wireForm.gateway = ""; + this.wireForm.dns = ""; + this.wireForm.subMask = ""; }, saveServerName() { setServerName({ @@ -475,16 +502,19 @@ this.activeWireItem = item; getNetWorkCardInfo({ ifname: item.name, - }).then((res) => { - if (res && res.success) { - this.wireForm.ip = res.data.ip; - this.wireForm.gateway = res.data.gateway; - this.wireForm.dns = res.data.dns; - this.wireForm.subMask = res.data.subMask; + }).then( + (res) => { + if (res && res.success) { + this.wireForm.ip = res.data.ip; + this.wireForm.gateway = res.data.gateway; + this.wireForm.dns = res.data.dns; + this.wireForm.subMask = res.data.subMask; + } + }, + (err) => { + this.$message.error("鏌ユ壘涓嶅埌鏁版嵁: " + err.msg); } - },(err) => { - this.$message.error("鏌ユ壘涓嶅埌鏁版嵁: "+err.msg) - }); + ); }, }, }; -- Gitblit v1.8.0