From d8944c4764c3fc4b7baf6b5c1586cf17c88b0bb1 Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@smartai.com> Date: 星期三, 23 三月 2022 22:38:20 +0800 Subject: [PATCH] 修改ztree复选框默认为父子联动 --- src/pages/settings/index/index.vue | 79 +++++++++++++++++++++------------------ 1 files changed, 42 insertions(+), 37 deletions(-) diff --git a/src/pages/settings/index/index.vue b/src/pages/settings/index/index.vue index 60b4f80..39e6106 100644 --- a/src/pages/settings/index/index.vue +++ b/src/pages/settings/index/index.vue @@ -216,35 +216,6 @@ <div class="permission" v-if="inAccountDetail && isSetPermission"> <div class="title">鏉冮檺绠$悊</div> - - <!-- <div class="line-wrap" v-for="item in sysMenus" :key="item.id"> - <div class="line"> - <div class="name">{{ item.name }}</div> - <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)" - @change="childrenChange(item)" - > - </el-switch> - </div> - </div> - </div> --> - <!-- --> <div class="tree-window"> <el-tree ref="treeMenus" @@ -605,6 +576,8 @@ style="width: 100%" ref="view_6" ></deviceInfo> + <Authorization v-if="activeIndex == 7" style="width: 100%" ref="view_7"> + </Authorization> </div> <div class="welcome-page" v-else ref="curPage" @mouseup="mouseDownIndex = ''"> <div @@ -677,6 +650,7 @@ import deviceInfo from "../views/deviceInfo"; import keyboardLanguage from "../views/keyboardLanguage"; import generalSettings from "../views/generalSettings"; +import Authorization from "../views/Authorization"; import { pad0, getUrlKey } from "@/api/utils"; export default { @@ -689,6 +663,7 @@ keyboardLanguage, generalSettings, deviceInfo, + Authorization, }, data() { var v2 = (rule, value, callback) => { @@ -829,6 +804,13 @@ blackIcon: "/images/settings/榛戣壊涓�绾con/璁惧淇℃伅.png", whiteIcon: "/images/settings/鐧借壊涓�绾con/璁惧淇℃伅.png", }, + { + name: "鎺堟潈绠$悊", + icon: "\ue7e9;", + imgUrl: "/images/settings/鎺堟潈绠$悊.png", + blackIcon: "/images/settings/榛戣壊涓�绾con/鎺堟潈绠$悊.png", + whiteIcon: "/images/settings/鐧借壊涓�绾con/鎺堟潈绠$悊.png", + }, ], accountArr: [], jpgArr: [], @@ -898,6 +880,7 @@ clearInterval(this.browserTimer); }, mounted() { + // 杩斿洖鎸夐挳鍥炶皟 window.addEventListener("message", (e) => { if (e.data.msg === "杩斿洖绯荤粺璁剧疆") { this.showWelcome = true; @@ -1479,20 +1462,21 @@ } }, parseTime() { - [this.syncYrs, this.syncMonth, this.syncDay] = this.equipmentDate.split( - "-" - ); - [this.syncHour, this.syncMin, this.syncSec] = this.equipmentTime.split( - ":" - ); + [this.syncYrs, this.syncMonth, this.syncDay] = + this.equipmentDate.split("-"); + [this.syncHour, this.syncMin, this.syncSec] = + this.equipmentTime.split(":"); }, }, computed: { activeUserRole() { - if (this.activeAccountItem.sysRoles&&this.activeAccountItem.sysRoles.length) { + if ( + this.activeAccountItem.sysRoles && + this.activeAccountItem.sysRoles.length + ) { return this.activeAccountItem.sysRoles[0].name; } - return "鏅�氱敤鎴�" + return "鏅�氱敤鎴�"; }, curUserRole() { const info = JSON.parse(sessionStorage.getItem("userInfo")); @@ -1527,6 +1511,27 @@ } }, }, + watch: { + showWelcome(newVal) { + if (newVal) { + // 闅愯棌杩斿洖鎸夋寜閽� + window.parent.postMessage( + { + msg: "hiddenBack", + }, + "*" + ); + } else { + //鏄剧ず杩斿洖鎸夐挳 + window.parent.postMessage( + { + msg: "showBack", + }, + "*" + ); + } + }, + }, }; </script> <style lang="scss"> -- Gitblit v1.8.0