U 用户划分写权限 对应的执行操作根据权限做限制‘
| | |
| | | const self = new Vue() |
| | | |
| | | export default { |
| | | /** |
| | | * 权限组中查询用户 |
| | | * 参数permit_group_id |
| | | * @return {[type]} Promise |
| | | */ |
| | | getUsersByPermitgroup (data) { |
| | | return self.$axios({ |
| | | method: 'post' |
| | | ,url: 'User_permitgroup_usrAction!serchByCondition' |
| | | ,data: 'json=' + JSON.stringify(data) |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 查询所有的权限组 |
| | | * 无参 |
| | | * @return {[type]} [description] |
| | | */ |
| | | ,getAllRole () { |
| | | return self.$axios({ |
| | | method: 'get' |
| | | ,url: 'User_permitgroupAction!searchAll' |
| | | ,data: null |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 权限组中加用户 |
| | | * 参数 permit_group_id,uid permit_group_name,uname 集合 |
| | | * 传参json:[{uId:10020}] |
| | | */ |
| | | ,addPermitUser (data) { |
| | | addPermitUser (data) { |
| | | return self.$axios({ |
| | | method: 'post' |
| | | ,url: 'User_permitgroup_usrAction!add' |
| | | ,url: 'User_battgroup_baojigroup_usrAction!addPro' |
| | | ,data: 'json=' + JSON.stringify(data) |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 权限组中删除用户 |
| | | * 参数permit_group_id,uid permit_group_name,uname 集合 |
| | | * 传参json:[{uId:10020}] |
| | | */ |
| | | ,delPermitUser (data) { |
| | | return self.$axios({ |
| | | method: 'post' |
| | | ,url: 'User_permitgroup_usrAction!del' |
| | | ,url: 'User_battgroup_baojigroup_usrAction!delPro' |
| | | ,data: 'json=' + JSON.stringify(data) |
| | | }); |
| | | } |
| | |
| | | ,getAllUsers () { |
| | | return self.$axios({ |
| | | method: 'get' |
| | | ,url: 'User_infAction!searchAll' |
| | | ,url: 'User_infAction!serchUserByGroup' |
| | | ,data: null |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 添加权限组 |
| | | * 参数 permit_group_name权限组名 集合 |
| | | * @param {[type]} data [description] |
| | | */ |
| | | ,addPermitGroup (data) { |
| | | return self.$axios({ |
| | | method: 'post' |
| | | ,url: 'User_permitgroupAction!add' |
| | | ,data: 'json=' + JSON.stringify(data) |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 删除权限组 |
| | | * 参数permit_group_id,permit_group_name权限组名 集合 |
| | | * @return {[type]} [description] |
| | | */ |
| | | ,delPermitGroup (data) { |
| | | return self.$axios({ |
| | | method: 'post' |
| | | ,url: 'User_permitgroupAction!del' |
| | | ,data: 'json=' + JSON.stringify(data) |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 修改权限组 |
| | | * @param 参数permit_group_id,permit_group_name |
| | | * @return {[type]} [description] |
| | | */ |
| | | ,editPermitGroup (data) { |
| | | return self.$axios({ |
| | | method: 'post' |
| | | ,url: 'User_permitgroupAction!update' |
| | | ,data: 'json=' + JSON.stringify(data) |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 权限组中添加权限 |
| | | * 参数 permit_group_id,permit_group_name,permit_name,permit_id 集合 |
| | | */ |
| | | ,selectPermit (data) { |
| | | return self.$axios({ |
| | | method: 'post' |
| | | ,url: 'User_permitgroup_dataAction!add' |
| | | ,data: 'json=' + JSON.stringify(data) |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 权限组中移除权限 |
| | | * 参数 permit_group_id,permit_group_name,permit_name,permit_id 集合 |
| | | */ |
| | | ,unselectPermit (data) { |
| | | return self.$axios({ |
| | | method: 'post' |
| | | ,url: 'User_permitgroup_dataAction!del' |
| | | ,data: 'json=' + JSON.stringify(data) |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 根据权限组id查询权限组下的所有权限 |
| | | * 参数 permit_group_id, |
| | | * @return {[type]} [description] |
| | | */ |
| | | ,getPermitByGroupId (data) { |
| | | return self.$axios({ |
| | | method: 'post' |
| | | ,url: 'User_permitgroup_dataAction!serchByCondition' |
| | | ,data: 'json=' + JSON.stringify(data) |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 添加权限 |
| | | * 参数 permit_pid |
| | | * permit_name |
| | | * permit_pname |
| | | * permit_enable |
| | | * permit_sibie 集合 |
| | | */ |
| | | ,addPermit (data) { |
| | | return self.$axios({ |
| | | method: 'post' |
| | | ,url: 'User_permitAction!add' |
| | | ,data: 'json=' + JSON.stringify(data) |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 删除权限 |
| | | * 参数 permit_id 集合 |
| | | * @return {[type]} [description] |
| | | */ |
| | | ,delPermit (data) { |
| | | return self.$axios({ |
| | | method: 'post' |
| | | ,url: 'User_permitAction!del' |
| | | ,data: 'json=' + JSON.stringify(data) |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 查询所有的权限 |
| | | * 无参 |
| | | */ |
| | | ,getAllPermits () { |
| | | return self.$axios({ |
| | | method: 'get' |
| | | ,url: 'User_permitAction!searchAll' |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 查询用户 |
| | |
| | | .pr_o8em {padding-right: .8em;} |
| | | .pr_1em {padding-right: 1em;} |
| | | |
| | | .disabled, |
| | | [disabled] { |
| | | background: #ccc !important; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | */ |
| | |
| | | } |
| | | }, |
| | | mounted () { |
| | | // 如果用户没有权限 则去掉用户管理菜单 |
| | | if (!this.$root.authorization) { |
| | | let navs = this.navs.filter((v) => { |
| | | return v.txt != '用户管理'; |
| | | }); |
| | | this.navs = navs; |
| | | } |
| | | this.changeActive(); |
| | | this.$router.afterEach((to, from) => { |
| | | this.changeActive(); |
| | |
| | | Vue.prototype.$user = user; |
| | | Vue.prototype.$G = G; |
| | | Vue.prototype.$event = event; |
| | | // 未授权 |
| | | const mixin = { |
| | | data () { |
| | | return { |
| | | authorization: this.$store.state.login.unote > 0 |
| | | } |
| | | }, |
| | | methods: { |
| | | notAllow () { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: '该用户未授权' |
| | | }); |
| | | } |
| | | ,doNothing () {} |
| | | } |
| | | }; |
| | | // Vue.prototype.$api = api; |
| | | |
| | | // 注册自定义过滤器 |
| | |
| | | next({path:'/general/index'}); |
| | | return false; |
| | | } |
| | | // 如果没有写权限 就不让进入用户的相关页面 |
| | | if (common.getSession('unote') <= 0 && ('/user/info' == to.path || '/user/power' == to.path)) { |
| | | next({path:'/general/index'}); |
| | | return false; |
| | | } |
| | | } else { |
| | | if ('/login' != to.path) { |
| | | next({path:'/login'}); |
| | |
| | | setHtmlFontSize(); |
| | | |
| | | new Vue({ |
| | | mixins: [mixin], |
| | | router, |
| | | store, |
| | | render: h => h(App), |
| | |
| | | }, |
| | | component: (resolve)=>require(['@/views/waterCooling/alarmParam_subsidiary.vue'], resolve) |
| | | }, |
| | | { |
| | | path: '/chargepower/menu', |
| | | name: 'chargePowerMenu', |
| | | meta: { |
| | | crumb: '整流器模式选择' |
| | | }, |
| | | component: (resolve)=>require(['@/views/chargePower/menu.vue'], resolve) |
| | | }, |
| | | // { |
| | | // path: '/chargepower/menu', |
| | | // name: 'chargePowerMenu', |
| | | // meta: { |
| | | // crumb: '整流器模式选择' |
| | | // }, |
| | | // component: (resolve)=>require(['@/views/chargePower/menu.vue'], resolve) |
| | | // }, |
| | | // 4机组并联运行界面 |
| | | { |
| | | path: '/chargepower/parallel', |
| | |
| | | export default { |
| | | state() { |
| | | return { |
| | | username: sessionStorage.getItem("username")||"", |
| | | login: sessionStorage.getItem("login")||false, |
| | | username: sessionStorage.getItem("username") || "", |
| | | login: sessionStorage.getItem("login") || false, |
| | | unote: sessionStorage.getItem("unote") || 0, |
| | | } |
| | | }, |
| | | mutations:{ |
| | | setLogin: function(state, username) { |
| | | if(username && username.trim()) { |
| | | setLogin: function(state, user) { |
| | | if(user && user.name.trim()) { |
| | | // 设置session |
| | | sessionStorage.setItem("username", username); |
| | | sessionStorage.setItem("username", user.name); |
| | | sessionStorage.setItem("login", true); |
| | | sessionStorage.setItem('unote', user.unote); |
| | | |
| | | state.username = username; |
| | | state.username = user.name; |
| | | state.unote = user.unote; |
| | | state.login = true; |
| | | }else { |
| | | // 设置session |
| | | sessionStorage.setItem("username", ""); |
| | | sessionStorage.setItem("login", false); |
| | | sessionStorage.setItem('unote', 0); |
| | | |
| | | state.username = ""; |
| | | state.unote = 0; |
| | | state.login = false; |
| | | } |
| | | } |
| | | }, |
| | | actions: { |
| | | setLogin: function(context, username) { |
| | | context.commit('setLogin',username); |
| | | setLogin: function(context, user) { |
| | | context.commit('setLogin',user); |
| | | } |
| | | }, |
| | | getters: { |
| | |
| | | </div> |
| | | </div> |
| | | <div class="panel_btn_grp"> |
| | | <div class="btn exception" @click="cur_vol_setVisible = true">电压电流给定</div> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="remoteStart" data-confirmTxt="启动电源确认" :param="JSON.stringify([null])">启动电源</div> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="remoteStop" data-confirmTxt="停止电源确认" :param="JSON.stringify([null])">停止电源</div> |
| | | <div class="btn exception" :disabled="!$root.authorization" @click="$root.authorization ? cur_vol_setVisible = true : $root.notAllow()">电压电流给定</div> |
| | | <div class="btn" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" :disabled="!$root.authorization" data-fn="remoteStart" data-confirmTxt="启动电源确认" :param="JSON.stringify([null])">启动电源</div> |
| | | <div class="btn" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" :disabled="!$root.authorization" data-fn="remoteStop" data-confirmTxt="停止电源确认" :param="JSON.stringify([null])">停止电源</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="inner"> |
| | | <div class="panel-title"> |
| | | <div class="btn-grp"> |
| | | <div class="btn" @click="faultReset">{{group}}机组故障复位</div> |
| | | <div class="btn" :disabled="!$root.authorization" @click="$root.authorization ? faultReset() : $root.notAllow()">{{group}}机组故障复位</div> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | |
| | | </div> |
| | | <!-- 模式 --> |
| | | <div class="flex_2btn_grp vertical_middle"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setConsvol" data-confirmTxt="模式切换确认" :param="JSON.stringify([item])">{{item}}恒压模式</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setConsvol" data-confirmTxt="模式切换确认" :param="JSON.stringify([item])">{{item}}恒压模式</div> |
| | | <div class="center_con">{{model[item] ? '恒流' : '恒压'}}</div> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setConscurr" data-confirmTxt="模式切换确认" :param="JSON.stringify([item])">{{item}}恒流模式</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setConscurr" data-confirmTxt="模式切换确认" :param="JSON.stringify([item])">{{item}}恒流模式</div> |
| | | </div> |
| | | <!-- 串并模式 --> |
| | | <div class="flex_2btn_grp vertical_middle"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="constantvol" data-confirmTxt="模式切换确认" :param="JSON.stringify([item])">{{item}}机组切换为4并或2串2并模式</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="constantvol" data-confirmTxt="模式切换确认" :param="JSON.stringify([item])">{{item}}机组切换为4并或2串2并模式</div> |
| | | <div class="center_con">{{item}}机组当前为{{constantvolflag.A ? '4并或2串2并模式' : '4并或2串2并之外模式'}}</div> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="othermode" data-confirmTxt="模式切换确认" :param="JSON.stringify([item])">{{item}}机组切换为4并或2串2并之外模式</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="othermode" data-confirmTxt="模式切换确认" :param="JSON.stringify([item])">{{item}}机组切换为4并或2串2并之外模式</div> |
| | | </div> |
| | | <!-- 遥控 上位机 --> |
| | | <div class="flex_2btn_grp vertical_middle"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setRemoteControl" data-confirmTxt="控制切换确认" :param="JSON.stringify([item])">{{item}}机组切换到上位机控制</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setRemoteControl" data-confirmTxt="控制切换确认" :param="JSON.stringify([item])">{{item}}机组切换到上位机控制</div> |
| | | <div class="center_con">{{local_remote_control[item] ? '上位机控制' : '触摸屏控制'}}</div> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setLocalControl" data-confirmTxt="控制切换确认" :param="JSON.stringify([item])">{{item}}机组切换到就地控制</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setLocalControl" data-confirmTxt="控制切换确认" :param="JSON.stringify([item])">{{item}}机组切换到就地控制</div> |
| | | </div> |
| | | <div class="group_set"> |
| | | <div class="part_left"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="vertical_middle"> |
| | | <div class="btn" @click="showCurVolSettings(item)">{{item}}机组电流电压设定</div> |
| | | <div class="btn" :disabled="!$root.authorization" @click="$root.authorization ? showCurVolSettings(item) : $root.notAllow()">{{item}}机组电流电压设定</div> |
| | | </div> |
| | | </div> |
| | | <!-- 启动停止 --> |
| | | <div class="flex_2btn_grp vertical_middle"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="remoteStart" data-confirmTxt="启动确认" :param="JSON.stringify([item])">{{item}}机组启动</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="remoteStart" data-confirmTxt="启动确认" :param="JSON.stringify([item])">{{item}}机组启动</div> |
| | | <div class="center_con"> |
| | | <!-- <div class="indicator" :class="{'status_normal': !0, 'status_error': !1}"></div> --> |
| | | </div> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="remoteStop" data-confirmTxt="停止确认" :param="JSON.stringify([item])">{{item}}机组停止</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="remoteStop" data-confirmTxt="停止确认" :param="JSON.stringify([item])">{{item}}机组停止</div> |
| | | </div> |
| | | <!-- 套输出合分闸 --> |
| | | <div class="flex_2btn_grp vertical_middle"> |
| | |
| | | :cssHeight="rects[2].position.height" |
| | | :top="rects[2].position.top" :left="rects[2].position.left"> |
| | | <div class="posA_full panel_btn_grp"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="remoteStart" data-confirmTxt="启动电源确认" :param="JSON.stringify([null])">启动电源</div> |
| | | <div class="btn exception" @click="cur_vol_setVisible = true">电压电流给定</div> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="remoteStop" data-confirmTxt="停止电源确认" :param="JSON.stringify([null])">停止电源</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="remoteStart" data-confirmTxt="启动电源确认" :param="JSON.stringify([null])">启动电源</div> |
| | | <div class="btn exception" :disabled="!$root.authorization" @click="$root.authorization ? cur_vol_setVisible = true : $root.notAllow()">电压电流给定</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="remoteStop" data-confirmTxt="停止电源确认" :param="JSON.stringify([null])">停止电源</div> |
| | | </div> |
| | | </science-box> |
| | | <science-box |
| | |
| | | <div class="inner"> |
| | | <div class="panel-title"> |
| | | <div class="btn-grp"> |
| | | <div class="btn" @click="faultReset('A')">A机组故障复位</div> |
| | | <div class="btn" :disabled="!$root.authorization" @click="$root.authorization ? faultReset('A') : $root.notAllow()">A机组故障复位</div> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | |
| | | <div class="inner"> |
| | | <div class="panel-title"> |
| | | <div class="btn-grp"> |
| | | <div class="btn" @click="faultReset('B')">B机组故障复位</div> |
| | | <div class="btn" :disabled="!$root.authorization" @click="$root.authorization ? faultReset('B') : $root.notAllow()">B机组故障复位</div> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | |
| | | :cssHeight="rects[2].position.height" |
| | | :top="rects[2].position.top" :left="rects[2].position.left"> |
| | | <div class="posA_full panel_btn_grp"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="remoteStart" data-confirmTxt="启动电源确认" :param="JSON.stringify([null])">启动电源</div> |
| | | <div class="btn exception" @click="cur_vol_setVisible = true">电压电流给定</div> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="remoteStop" data-confirmTxt="停止电源确认" :param="JSON.stringify([null])">停止电源</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="remoteStart" data-confirmTxt="启动电源确认" :param="JSON.stringify([null])">启动电源</div> |
| | | <div class="btn exception" :disabled="!$root.authorization" @click="$root.authorization ? cur_vol_setVisible = true : $root.notAllow()">电压电流给定</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="remoteStop" data-confirmTxt="停止电源确认" :param="JSON.stringify([null])">停止电源</div> |
| | | </div> |
| | | </science-box> |
| | | <science-box |
| | |
| | | <div class="inner"> |
| | | <div class="panel-title"> |
| | | <div class="btn-grp"> |
| | | <div class="btn" @click="faultReset('A')">A机组故障复位</div> |
| | | <div class="btn" :disabled="!$root.authorization" @click="$root.authorization ? faultReset('A') : $root.notAllow()">A机组故障复位</div> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | |
| | | <div class="inner"> |
| | | <div class="panel-title"> |
| | | <div class="btn-grp"> |
| | | <div class="btn" @click="faultReset('B')">B机组故障复位</div> |
| | | <div class="btn" :disabled="!$root.authorization" @click="$root.authorization ? faultReset('B') : $root.notAllow()">B机组故障复位</div> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | |
| | | :cssHeight="rects[2].position.height" |
| | | :top="rects[2].position.top" :left="rects[2].position.left"> |
| | | <div class="posA_full panel_btn_grp"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="remoteStart" data-confirmTxt="启动电源确认" :param="JSON.stringify([null])">启动电源</div> |
| | | <div class="btn exception" @click="cur_vol_setVisible = true">电压电流给定</div> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="remoteStop" data-confirmTxt="停止电源确认" :param="JSON.stringify([null])">停止电源</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="remoteStart" data-confirmTxt="启动电源确认" :param="JSON.stringify([null])">启动电源</div> |
| | | <div class="btn exception" :disabled="!$root.authorization" @click="$root.authorization ? cur_vol_setVisible = true : $root.notAllow()">电压电流给定</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="remoteStop" data-confirmTxt="停止电源确认" :param="JSON.stringify([null])">停止电源</div> |
| | | </div> |
| | | </science-box> |
| | | <science-box |
| | |
| | | <div class="inner"> |
| | | <div class="panel-title"> |
| | | <div class="btn-grp"> |
| | | <div class="btn" @click="faultReset('A')">A机组故障复位</div> |
| | | <div class="btn" :disabled="!$root.authorization" @click="$root.authorization ? faultReset('A') : $root.notAllow()">A机组故障复位</div> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | |
| | | <div class="inner"> |
| | | <div class="panel-title"> |
| | | <div class="btn-grp"> |
| | | <div class="btn" @click="faultReset('B')">B机组故障复位</div> |
| | | <div class="btn" :disabled="!$root.authorization" @click="$root.authorization ? faultReset('B') : $root.notAllow()">B机组故障复位</div> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | |
| | | <!-- 按钮组 --> |
| | | <div class="item_btn_grp"> |
| | | <div class="vertical_middle"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="startLoad" data-confirmTxt="启动加减载确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']'])">启动加减载</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="startLoad" data-confirmTxt="启动加减载确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']'])">启动加减载</div> |
| | | </div> |
| | | <div class="vertical_middle"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="stopLoad" data-confirmTxt="停止加减载确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']'])">停止加减载</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="stopLoad" data-confirmTxt="停止加减载确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']'])">停止加减载</div> |
| | | </div> |
| | | <div class="vertical_middle"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="switchOff" data-confirmTxt="全部分闸确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']'])">全部分闸</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="switchOff" data-confirmTxt="全部分闸确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']'])">全部分闸</div> |
| | | </div> |
| | | </div> |
| | | <!-- 自动流程 --> |
| | |
| | | </div> |
| | | <div class="row"> |
| | | <div class="label vertical_middle">设定功率</div> |
| | | <div class="data editable txt_strong vertical_middle" title="点击修改" @click="setPower(item)">{{item.set_power}} kVA</div> |
| | | <div class="data editable txt_strong vertical_middle" title="点击修改" @click="$root.authorization ? setPower(item) : $root.notAllow()">{{item.set_power}} kVA</div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="label vertical_middle">间隔时间</div> |
| | | <div class="data editable txt_strong vertical_middle" title="点击修改" @click="setDelay(item)">{{item.interval_time}} (× 0.1s)</div> |
| | | <div class="data editable txt_strong vertical_middle" title="点击修改" @click="$root.authorization ? setDelay(item) : $root.notAllow()">{{item.interval_time}} (× 0.1s)</div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="label vertical_middle">已输出功率</div> |
| | |
| | | <div class="main"> |
| | | <!-- <div class="title vertical_middle">负载柜突加突卸画面</div> --> |
| | | <div class="header"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="allSuddenChange" data-confirmTxt="总突变加减载确认" :param="JSON.stringify([null])">总突变加减载</div> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="switchOffAll" data-confirmTxt="总全部分闸确认" :param="JSON.stringify([null])">总全部分闸</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="allSuddenChange" data-confirmTxt="总突变加减载确认" :param="JSON.stringify([null])">总突变加减载</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="switchOffAll" data-confirmTxt="总全部分闸确认" :param="JSON.stringify([null])">总全部分闸</div> |
| | | </div> |
| | | <div class="flex_contain"> |
| | | <div class="item border-angle" v-for="(item, itemIndex) in list" :key="itemIndex"> |
| | |
| | | <!-- 按钮组 --> |
| | | <div class="item_btn_grp"> |
| | | <div class="vertical_middle"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="suddenChange" data-confirmTxt="突变加减载确认" :param="JSON.stringify(['CONTEXT.list[' + itemIndex + ']'])">突变加减载</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="suddenChange" data-confirmTxt="突变加减载确认" :param="JSON.stringify(['CONTEXT.list[' + itemIndex + ']'])">突变加减载</div> |
| | | </div> |
| | | <div class="vertical_middle"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="switchOff" data-confirmTxt="全部分闸确认" :param="JSON.stringify(['CONTEXT.list[' + itemIndex + ']'])">全部分闸</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="switchOff" data-confirmTxt="全部分闸确认" :param="JSON.stringify(['CONTEXT.list[' + itemIndex + ']'])">全部分闸</div> |
| | | </div> |
| | | </div> |
| | | <!-- 数据 --> |
| | |
| | | </div> |
| | | <div class="row"> |
| | | <div class="label vertical_middle">设定功率</div> |
| | | <div class="data editable txt_strong vertical_middle" title="点击修改" @click="setPower(item)">{{item.set_power}} kVA</div> |
| | | <div class="data editable txt_strong vertical_middle" title="点击修改" @click="$root.authorization ? setPower(item) : $root.notAllow()">{{item.set_power}} kVA</div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="label vertical_middle">已输出功率</div> |
| | |
| | | <div class="btn_main"> |
| | | <div class="lay_label vertical_middle">{{item.dev_name}}</div> |
| | | <div class="lay_content vertical_middle"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="switchOff" data-confirmTxt="全部分闸确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']'])">全部分闸</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="switchOff" data-confirmTxt="全部分闸确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']'])">全部分闸</div> |
| | | <div class="btn btn_export" @click="exportData(item)">数据导出</div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="lay_content"> |
| | | <div class="vertical_middle"> |
| | | <div class="switch_yc" v-if="idx <= item.FZ_button_num"> |
| | | <label class="checkbox"> |
| | | <label @click="$root.authorization ? $root.doNothing() : $root.notAllow()" class="checkbox"> |
| | | <input type="checkbox" |
| | | :disabled="!$root.authorization" |
| | | @click="switch3DHandle(item, idx)" |
| | | v-model="item['FZ_b' + idx]" value="1" class="input" /> |
| | | <span class="handle"> |
| | |
| | | <!-- --> |
| | | <div class="info_detail">最近故障: <span>{{latelyAlarm || '暂无'}}</span></div> |
| | | <div class="btns-grp"> |
| | | <div class="btn w_8em" :class="{'disabled': !latelyAlarm}" @click="confirmAlarm">故障确认</div> |
| | | <div class="btn w_8em" :class="{'disabled': !latelyAlarm}" :disabled="!$root.authorization" @click="$root.authorization ? confirmAlarm() : $root.notAllow()">故障确认</div> |
| | | <div class="btn btn-alarm w_8em" @click="showAlarm">报警归档</div> |
| | | <div class="btn w_8em" @click="showData">数据归档</div> |
| | | </div> |
| | |
| | | <div class="border-angle item item-lg"> |
| | | <div class="item-inner"> |
| | | <div class="flex_2btn_grp vertical_middle"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setGroupPos" data-confirmTxt="模式切换确认" :param="JSON.stringify(['CONTEXT.item1', 1])">恒压模式</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setGroupPos" data-confirmTxt="模式切换确认" :param="JSON.stringify(['CONTEXT.item1', 1])">恒压模式</div> |
| | | <div class="center_con" v-if="item1.data.consvolcurrflag">恒流</div> |
| | | <div class="center_con" v-else>恒压</div> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setGroupPos" data-confirmTxt="模式切换确认" :param="JSON.stringify(['CONTEXT.item1', 2])">恒流模式</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setGroupPos" data-confirmTxt="模式切换确认" :param="JSON.stringify(['CONTEXT.item1', 2])">恒流模式</div> |
| | | </div> |
| | | <div class="flex_2btn_grp vertical_middle"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setGroupPos" data-confirmTxt="模式切换确认" :param="JSON.stringify(['CONTEXT.item1', 3])">并联模式</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setGroupPos" data-confirmTxt="模式切换确认" :param="JSON.stringify(['CONTEXT.item1', 3])">并联模式</div> |
| | | <div class="center_con" v-if="item1.state.conn_flag">串联</div> |
| | | <div class="center_con" v-else>并联</div> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setGroupPos" data-confirmTxt="模式切换确认" :param="JSON.stringify(['CONTEXT.item1', 4])">串联模式</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setGroupPos" data-confirmTxt="模式切换确认" :param="JSON.stringify(['CONTEXT.item1', 4])">串联模式</div> |
| | | </div> |
| | | <div class="group_set"> |
| | | <div class="part_left"> |
| | | <div class="text_row vertical_middle"> |
| | | <div class="inner"> |
| | | <span>设定电压</span><em class="edit-val" @click="showVolDialog"><div class="panel-number txt_strong">{{giveVal.vol | numAdd0(4)}}</div></em>V |
| | | <span>设定电压</span><em class="edit-val" @click="$root.authorization ? showVolDialog() : $root.notAllow()"><div class="panel-number txt_strong">{{giveVal.vol | numAdd0(4)}}</div></em>V |
| | | </div> |
| | | </div> |
| | | <div class="text_row vertical_middle"> |
| | | <div class="inner"> |
| | | <span>设定电流</span><em class="edit-val" @click="showCurrDialog"><div class="panel-number txt_strong">{{giveVal.curr | numAdd0(4)}}</div></em>A |
| | | <span>设定电流</span><em class="edit-val" @click="$root.authorization ? showCurrDialog() : $root.notAllow()"><div class="panel-number txt_strong">{{giveVal.curr | numAdd0(4)}}</div></em>A |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="vertical_middle"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="giveValService" data-confirmTxt="给定确认" :param="JSON.stringify([null])">给定确认</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="giveValService" data-confirmTxt="给定确认" :param="JSON.stringify([null])">给定确认</div> |
| | | </div> |
| | | </div> |
| | | <div class="flex_2btn_grp vertical_middle"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setGroupPos" data-confirmTxt="输出合闸确认" :param="JSON.stringify(['CONTEXT.item1', 7])">{{item1.name}}套输出合闸</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setGroupPos" data-confirmTxt="输出合闸确认" :param="JSON.stringify(['CONTEXT.item1', 7])">{{item1.name}}套输出合闸</div> |
| | | <div class="center_con"> |
| | | <div class="indicator" :class="{'status_normal': !item1.state.qs1_state, 'status_error': item1.state.qs1_state}"><span>{{k_name1}}</span></div> |
| | | <div class="indicator" :class="{'status_normal': !item1.state.qs2_state, 'status_error': item1.state.qs2_state}"><span>{{k_name2}}</span></div> |
| | | </div> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setGroupPos" data-confirmTxt="输出分闸确认" :param="JSON.stringify(['CONTEXT.item1', 9])">{{item1.name}}套输出分闸</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setGroupPos" data-confirmTxt="输出分闸确认" :param="JSON.stringify(['CONTEXT.item1', 9])">{{item1.name}}套输出分闸</div> |
| | | </div> |
| | | <div class="flex_2btn_grp vertical_middle"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setGroupPos" data-confirmTxt="输出合闸确认" :param="JSON.stringify(['CONTEXT.item1', 8])">{{item2.name}}套输出合闸</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setGroupPos" data-confirmTxt="输出合闸确认" :param="JSON.stringify(['CONTEXT.item1', 8])">{{item2.name}}套输出合闸</div> |
| | | <div class="center_con"> |
| | | <div class="indicator" :class="{'status_normal': !item2.state.qs1_state, 'status_error': item2.state.qs1_state}"><span>{{k_name3}}</span></div> |
| | | <div class="indicator" :class="{'status_normal': !item2.state.qs2_state, 'status_error': item2.state.qs2_state}"><span>{{k_name4}}</span></div> |
| | | </div> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setGroupPos" data-confirmTxt="输出分闸确认" :param="JSON.stringify(['CONTEXT.item1', 10])">{{item2.name}}套输出分闸</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setGroupPos" data-confirmTxt="输出分闸确认" :param="JSON.stringify(['CONTEXT.item1', 10])">{{item2.name}}套输出分闸</div> |
| | | </div> |
| | | <div class="flex_2btn_grp vertical_middle"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setGroupPos" data-confirmTxt="启动确认" :param="JSON.stringify(['CONTEXT.item1', 11])">{{groupname}}启动</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setGroupPos" data-confirmTxt="启动确认" :param="JSON.stringify(['CONTEXT.item1', 11])">{{groupname}}启动</div> |
| | | <div class="center_con"> |
| | | <div class="indicator" :class="{'status_normal': !item1.data.powerstartflag, 'status_error': item1.data.powerstartflag}"></div> |
| | | <div class="indicator" :class="{'status_normal': !item2.data.powerstartflag, 'status_error': item2.data.powerstartflag}"></div> |
| | | </div> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setGroupPos" data-confirmTxt="停止确认" :param="JSON.stringify(['CONTEXT.item1', 12])">{{groupname}}停止</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setGroupPos" data-confirmTxt="停止确认" :param="JSON.stringify(['CONTEXT.item1', 12])">{{groupname}}停止</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="border-angle panel panel-btns"> |
| | | <div class="panel-inner"> |
| | | <div class="btn_list"> |
| | | <div class="btn">故障复位</div> |
| | | <!-- <div class="btn">故障复位</div> --> |
| | | <div class="btn" @click="faultVisible = true">历史报警</div> |
| | | <div class="btn" @click="showGraph(groupname)">{{groupname}}历史曲线</div> |
| | | </div> |
| | |
| | | </div> |
| | | <!-- 模式 --> |
| | | <div class="flex_2btn_grp vertical_middle"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setPos" data-confirmTxt="切换模式确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']', 3])">{{item.idx}}恒压模式</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setPos" data-confirmTxt="切换模式确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']', 3])">{{item.idx}}恒压模式</div> |
| | | <div class="center_con" v-if="item.data.consvolcurrflag">恒流</div> |
| | | <div class="center_con" v-else>恒压</div> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setPos" data-confirmTxt="切换模式确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']', 4])">{{item.idx}}恒流模式</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setPos" data-confirmTxt="切换模式确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']', 4])">{{item.idx}}恒流模式</div> |
| | | </div> |
| | | <!-- A设定电压 --> |
| | | <div class="text_row vertical_middle"> |
| | | <div class="inner"> |
| | | <span>{{item.idx}}设定电压</span><em class="edit-val" @click="showVolDialog(item)"><div class="panel-number txt_strong">{{item.data.upsetvol | numAdd0(4)}}</div></em>V |
| | | <span>{{item.idx}}设定电压</span><em class="edit-val" @click="$root.authorization ? showVolDialog(item) : $root.notAllow()"><div class="panel-number txt_strong">{{item.data.upsetvol | numAdd0(4)}}</div></em>V |
| | | </div> |
| | | <!-- A设定电流 electricity--> |
| | | </div> |
| | | <div class="text_row vertical_middle"> |
| | | <div class="inner"> |
| | | <span>{{item.idx}}设定电流</span><em class="edit-val" @click="showCurrDialog(item)"><div class="panel-number txt_strong">{{item.data.upsetcurr | numAdd0(4)}}</div></em>A |
| | | <span>{{item.idx}}设定电流</span><em class="edit-val" @click="$root.authorization ? showCurrDialog(item) : $root.notAllow()"><div class="panel-number txt_strong">{{item.data.upsetcurr | numAdd0(4)}}</div></em>A |
| | | </div> |
| | | </div> |
| | | <!-- A套输出合分闸 --> |
| | | <div class="flex_2btn_grp vertical_middle"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setPos" data-confirmTxt="合闸确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']', 15])">{{item.idx}}套输出合闸</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setPos" data-confirmTxt="合闸确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']', 15])">{{item.idx}}套输出合闸</div> |
| | | <div class="center_con"> |
| | | <div class="indicator" :class="{'status_normal': !item.state.qs1_state, 'status_error': item.state.qs1_state}"><span>{{item.k_name1}}</span></div> |
| | | <div class="indicator" :class="{'status_normal': !item.state.qs2_state, 'status_error': item.state.qs2_state}"><span>{{item.k_name2}}</span></div> |
| | | </div> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setPos" data-confirmTxt="分闸确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']', 16])">{{item.idx}}套输出分闸</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setPos" data-confirmTxt="分闸确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']', 16])">{{item.idx}}套输出分闸</div> |
| | | </div> |
| | | <!-- A启动停止 --> |
| | | <div class="flex_2btn_grp vertical_middle"> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setPos" data-confirmTxt="启动确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']', 7])">{{item.idx}}启动</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setPos" data-confirmTxt="启动确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']', 7])">{{item.idx}}启动</div> |
| | | <div class="center_con"> |
| | | <div class="indicator" :class="{'status_normal': !item.data.powerstartflag, 'status_error': item.data.powerstartflag}"></div> |
| | | </div> |
| | | <div class="btn" v-btn-confirm="handleConfirm" data-fn="setPos" data-confirmTxt="停止确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']', 8])">{{item.idx}}停止</div> |
| | | <div class="btn" :disabled="!$root.authorization" v-btn-confirm="$root.authorization ? handleConfirm : $root.notAllow" data-fn="setPos" data-confirmTxt="停止确认" :param="JSON.stringify(['CONTEXT.list[' + index + ']', 8])">{{item.idx}}停止</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="border-angle panel panel-btns"> |
| | | <div class="panel-inner"> |
| | | <div class="btn_list"> |
| | | <div class=""> |
| | | <!-- <div class=""> |
| | | <div class="btn">故障复位</div> |
| | | </div> |
| | | </div> --> |
| | | <div class=""> |
| | | <div class="btn" @click="faultVisible = true">历史报警</div> |
| | | </div> |
| | |
| | | res = JSON.parse(res.data.result); |
| | | var data = []; |
| | | if(res.code == 1) { |
| | | data = res.data; |
| | | data = res.data.filter((v) => { |
| | | return v.UName != 'superuser'; |
| | | }); |
| | | } |
| | | // 设置用户名 |
| | | self.tableData = data; |
| | |
| | | var rs = JSON.parse(res.data.result); |
| | | if(rs.code == 1) { |
| | | self.msg = '登录成功'; |
| | | self.$store.dispatch('setLogin', userInfo.UName); |
| | | let user = { |
| | | name: userInfo.UName |
| | | ,unote: rs.data |
| | | } |
| | | self.$store.dispatch('setLogin', user); |
| | | self.$nextTick(function() { |
| | | self.$router.push({path: '/general/index'}); |
| | | }); |
| | |
| | | |
| | | }, |
| | | mounted () { |
| | | this.findRole(); |
| | | // 获取全部权限 |
| | | this.getAllPermits(); |
| | | this.getAllUsers(); |
| | | // this.getAllPermits(); |
| | | }, |
| | | methods: { |
| | | groupListClick (item) { |
| | | // console.log(item); |
| | | // 设置查询的值 |
| | | this.searchParams.group_id = item.permit_group_id; |
| | | this.searchParams.group_name = item.permit_group_name; |
| | | this.editRoleGroup.value = item.permit_group_name; |
| | | |
| | | // 查询所有的用户 |
| | | // this.getAllUsers(); |
| | | |
| | | // 查询当前权限组的用户 |
| | | this.searchUserList(item.permit_group_id); |
| | | |
| | | // 查询所有的权限 |
| | | // this.getAllPermits(); |
| | | |
| | | // 查询分配的权限 |
| | | this.getPermitByGroupId(item.permit_group_id); |
| | | } |
| | | ,renderFn (h, option) { |
| | | renderFn (h, option) { |
| | | // console.log('======option=======', option); |
| | | // console.log(h, '=====h===='); |
| | | return h('span', {domProps: {title: option.label}}, [option.label]); |
| | | } |
| | | // 查课所有角色类型 |
| | | ,findRole () { |
| | | var self = this; |
| | | this.$api.user.getAllRole().then(function (data) { |
| | | data = JSON.parse(data.data.result); |
| | | // console.log(data, '权限组'); |
| | | if (data.code == 1 && data.data.length) { |
| | | self.roleList = data.data |
| | | self.roleList.forEach(function (v, i, a) { |
| | | v.txt = v.permit_group_name; |
| | | v.key = v.permit_group_id; |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 获取当前权限组的所有权限 |
| | | ,getPermitByGroupId (id) { |
| | | // console.log(id, '当前权限组ID'); |
| | | this.$api.user.getPermitByGroupId({permit_group_id: id}).then((res) => { |
| | | var data = JSON.parse(res.data.result); |
| | | // console.log(data, '权限'); |
| | | var arr = []; |
| | | // TODO |
| | | if (data.code == 1 || !0) { |
| | | data = data.data || []; |
| | | // console.log(data); |
| | | // debugger; |
| | | this.Permits = data; |
| | | let list = JSON.parse(JSON.stringify(this.AllPermits)); |
| | | if (this.AllPermits.length) { |
| | | this.Permits.forEach((v, i, a) => { |
| | | let idx = this.$common.getIdxFromArr('permit_id', v.permit_id, list); |
| | | if (idx > -1) { |
| | | list.splice(idx, 1); |
| | | } |
| | | }); |
| | | let obj = this.$common.permitsToObj(data, true); |
| | | let result = this.$common.objFormat(obj); |
| | | this.authority.value = result.children; |
| | | |
| | | let _obj = this.$common.permitsToObj(list, true); |
| | | let _result = this.$common.objFormat(_obj); |
| | | this.authority.data = _result.children; |
| | | } else { |
| | | // console.log('还没有获取到全部权限'); |
| | | this.$api.user.getAllPermits().then((res) => { |
| | | let data = JSON.parse(res.data.result); |
| | | if (data.code == 1) { |
| | | this.AllPermits = data.data; |
| | | let list = JSON.parse(JSON.stringify(this.AllPermits)); |
| | | this.Permits.forEach((v, i, a) => { |
| | | let idx = this.$common.getIdxFromArr('permit_id', v.permit_id, list); |
| | | if (idx > -1) { |
| | | list.splice(idx, 1); |
| | | } |
| | | }); |
| | | let obj = this.$common.permitsToObj(data, true); |
| | | let result = this.$common.objFormat(obj); |
| | | this.authority.value = result.children; |
| | | |
| | | let _obj = this.$common.permitsToObj(list, true); |
| | | let _result = this.$common.objFormat(_obj); |
| | | this.authority.data = _result.children; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | // 查询所有用记户 |
| | | ,getAllUsers () { |
| | | var self = this; |
| | |
| | | var data = JSON.parse(res.data.result); |
| | | // console.log(data, '全部用户'); |
| | | var _data = []; |
| | | // 有权限的用户 |
| | | let value = []; |
| | | if (data.code == 1) { |
| | | _data = data.data; |
| | | _data.forEach(function(v, i, a) { |
| | | // _data = data.data; |
| | | data.data.forEach(function(v, i, a) { |
| | | v.key = v.UId; |
| | | v.label = v.UName; |
| | | self.userQuery[v.UId] = v.UName; |
| | | if (v.UName != 'superuser') { |
| | | _data.push(v); |
| | | |
| | | if (v.UNote > 0) { |
| | | value.push(v.UId); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | self.user.data = _data; |
| | | self.user.value = value; |
| | | }); |
| | | } |
| | | ,UserChange (list, type, values) { |
| | |
| | | // 向权限组 添加用户 |
| | | ,addUser (list) { |
| | | // console.log(list); |
| | | let data = list.map((v, i, a) => { |
| | | let data = list.map((v) => { |
| | | return { |
| | | permit_group_id: this.searchParams.group_id |
| | | ,permit_group_name: this.searchParams.group_name |
| | | ,uid: v |
| | | ,uname: this.userQuery[v] |
| | | uId: v |
| | | } |
| | | }); |
| | | // console.log(data); |
| | |
| | | if (data.code == 1) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: data.msg |
| | | message: '成功添加用户至权限组' |
| | | }); |
| | | } |
| | | }).catch(() => { |
| | |
| | | // 从权限组 移除用记 |
| | | ,removeUser (list) { |
| | | // console.log(list); |
| | | let data = list.map((v, i, a) => { |
| | | let data = list.map((v) => { |
| | | return { |
| | | permit_group_id: this.searchParams.group_id |
| | | ,permit_group_name: this.searchParams.group_name |
| | | ,uid: v |
| | | ,uname: this.userQuery[v] |
| | | uId: v |
| | | } |
| | | }); |
| | | // console.log(data); |
| | |
| | | if (data.code == 1) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: data.msg |
| | | message: '成功从权限组移除用户' |
| | | }); |
| | | } |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: '请求后台失败,请检查网络连接!' |
| | | }); |
| | | }); |
| | | } |
| | | // 获取当前权限组的所有用户 |
| | | ,searchUserList (id) { |
| | | // 请求后台查询 |
| | | var self = this; |
| | | // User_permitgroupAction!serchByPermit |
| | | this.$api.user.getUsersByPermitgroup({permit_group_id: id}).then(function (res) { |
| | | var data = JSON.parse(res.data.result); |
| | | // console.log(data, '组内用户'); |
| | | var _data = []; |
| | | var arr = []; |
| | | if (data.code == 1) { |
| | | _data = data.data; |
| | | _data.forEach(function(v, i, a) { |
| | | arr[i] = v.uid; |
| | | }); |
| | | } |
| | | // console.log(arr, '已分配用户'); |
| | | self.user.value = arr; |
| | | }); |
| | | } |
| | | // 如果勾选了 有子项的复选框 就取消 必要权限 的勾选 |
| | | ,permitNodeChange (val) { |
| | | if (val) { |
| | | this.addPermitForm.necessary = false; |
| | | this.addPermitForm.path = ''; |
| | | this.addPermitForm.pathDisabled = true; |
| | | } else { |
| | | this.addPermitForm.pathDisabled = false; |
| | | } |
| | | } |
| | | // 添加权限组 |
| | | ,addRoleGroupOK () { |
| | | var self = this; |
| | | var value = this.addRoleGroup.value; |
| | | var checkResult = this.checkPermitGroup(value); |
| | | |
| | | if (checkResult.code == 0) { |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: checkResult.message |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | var arr = [{permit_group_name: value}]; |
| | | this.$api.user.addPermitGroup(arr).then(res => { |
| | | res = JSON.parse(res.data.result); |
| | | // console.log(res); |
| | | if (res.code == 1) { |
| | | self.$message({ |
| | | type: 'success', |
| | | message: res.msg |
| | | }); |
| | | // 关闭弹窗 |
| | | self.addRoleGroup.show = false; |
| | | // 请求添加之后的数据 |
| | | self.findRole(); |
| | | } |
| | | }).catch( () => { |
| | | self.$message({ |
| | | type: 'error', |
| | | message: '请求后台失败,请检查网络连接!' |
| | | }); |
| | | }); |
| | | } |
| | | ,editRoleGroupOk () { |
| | | var self = this; |
| | | var value = this.editRoleGroup.value; |
| | | var checkResult = this.checkPermitGroup(value); |
| | | |
| | | if (checkResult.code == 0) { |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: checkResult.message |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | var arr = { |
| | | permit_group_name: value, |
| | | permit_group_id: this.searchParams.group_id |
| | | }; |
| | | this.$api.user.editPermitGroup(arr).then(res => { |
| | | res = JSON.parse(res.data.result); |
| | | // console.log(res); |
| | | if (res.code == 1) { |
| | | self.$message({ |
| | | type: 'success', |
| | | message: res.msg |
| | | }); |
| | | // 关闭弹窗 |
| | | self.editRoleGroup.show = false; |
| | | // 请求添加之后的数据 |
| | | self.findRole(); |
| | | } |
| | | }).catch( () => { |
| | | self.$message({ |
| | | type: 'error', |
| | | message: '请求后台失败,请检查网络连接!' |
| | | }); |
| | | }); |
| | | } |
| | | // 删除权限组 |
| | | ,delRoleGroup () { |
| | | // this.searchParams.group_id |
| | | // this.searchParams.group_name |
| | | if (!this.searchParams.group_id) { |
| | | return false; |
| | | } |
| | | var data = [{ |
| | | permit_group_id: this.searchParams.group_id, |
| | | permit_group_name: this.searchParams.group_name |
| | | }]; |
| | | this.$api.user.delPermitGroup(data).then((res) => { |
| | | var data = JSON.parse(res.data.result); |
| | | // console.log(data); |
| | | if (data.code == 1) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: data.msg |
| | | }); |
| | | |
| | | this.searchParams.group_id = ''; |
| | | // 重新取数据刷新 |
| | | this.findRole(); |
| | | } |
| | | }).catch(() => { |
| | | self.$message({ |
| | | type: 'error', |
| | | message: '请求后台失败,请检查网络连接!' |
| | | }); |
| | | }); |
| | | } |
| | | ,checkPermitGroup (value) { |
| | | var rs = { |
| | | code: 1, |
| | | message: '', |
| | | }; |
| | | |
| | | // 为空检测 |
| | | if(value == '') { |
| | | rs.code = 0; |
| | | rs.message = "权限组名称不能为空"; |
| | | return rs; |
| | | } |
| | | |
| | | // 遍历权限组列表获取是否重名 |
| | | for(var i = 0, j = this.roleList.length; i < j; i++) { |
| | | var _data = this.roleList[i]; |
| | | if(value == _data.txt) { |
| | | rs.code = 0; |
| | | rs.message = value + "已存在"; |
| | | break; |
| | | } |
| | | } |
| | | return rs; |
| | | } |
| | | // 查询所有权限 |
| | | ,getAllPermits () { |
| | | this.$api.user.getAllPermits().then((res) => { |
| | | var data = JSON.parse(res.data.result); |
| | | if (data.code == 1) { |
| | | var list = data.data; |
| | | this.AllPermits = list; |
| | | var obj = this.$common.permitsToObj(list); |
| | | var result = this.$common.objFormat(obj); |
| | | this.rootData[0].children = result.children; |
| | | this.treeId = result.maxPid; |
| | | |
| | | // 分配权限 要用的数据 |
| | | // console.log(result, '分配权限'); |
| | | // debugger; |
| | | var _obj = this.$common.permitsToObj(list, true); |
| | | var _result = this.$common.objFormat(_obj); |
| | | this.authority.data = _result.children; |
| | | } |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: '请求后台失败,请检查网络连接!' |
| | | }); |
| | | }); |
| | | } |
| | | // 添加权限按钮事件 |
| | | ,append (data) { |
| | | // console.log(data); |
| | | // 没有id 如果有子元素就取子元素的Pid 如果没有子元素就用 ++this.treeId, |
| | | if ( !data.id ) { |
| | | let id = this.$common.getAllAttr('permit_pid', data)[0]; |
| | | if ( !id ) { |
| | | id = ++this.treeId; |
| | | } |
| | | data.id = id; |
| | | } |
| | | // console.log(data.id); |
| | | this.addPermitForm.curData = data; |
| | | // 点击添加的时候弹个窗 接受输入 |
| | | this.addPermitForm.show = true; |
| | | } |
| | | // 添加权限弹窗 确定 |
| | | ,addPermitOK () { |
| | | // 限制 验证输入 |
| | | var label = this.addPermitForm.curData.label != 'root' ? this.addPermitForm.curData.label + '>' + this.addPermitForm.value : this.addPermitForm.value; |
| | | // console.log(this.addPermitForm.curData); |
| | | var canAppend = this.addPermitForm.permitNode; |
| | | |
| | | // 如果只是权限的父节点 而不是权限 就不请求接口 |
| | | if (canAppend) { |
| | | var newChild = { id: ++this.treeId, label: label, canAppend: canAppend, children: [] }; |
| | | if (!this.addPermitForm.curData.children) { |
| | | this.$set(this.addPermitForm.curData, 'children', []); |
| | | } |
| | | this.addPermitForm.curData.children.push(newChild); |
| | | this.addPermitFormInit(); |
| | | return false; |
| | | } |
| | | var data = [{ |
| | | permit_pid: this.addPermitForm.curData.id, |
| | | permit_name: this.addPermitForm.curData.label + '>' + this.addPermitForm.value, |
| | | permit_pname: this.addPermitForm.curData.label, |
| | | permit_enable: +this.addPermitForm.necessary, |
| | | permit_sibie: this.addPermitForm.path |
| | | }]; |
| | | |
| | | this.$api.user.addPermit(data).then((res) => { |
| | | this.addPermitFormInit(); |
| | | // console.log(res); |
| | | var data = JSON.parse(res.data.result); |
| | | if (data.code == 1) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: data.msg |
| | | }); |
| | | // 重新取数据 |
| | | this.getAllPermits(); |
| | | } |
| | | // 重新取值 |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: '请求后台失败,请检查网络连接!' |
| | | }); |
| | | }); |
| | | } |
| | | // 删除权限 |
| | | ,remove(node, data) { |
| | | // console.log(node, '====node === data ====', data); |
| | | // 如果是根节点 则不让删除 |
| | | if (data.label == 'root') { |
| | | return false; |
| | | } |
| | | // 看是不是删除的多个 只取真正的权限 permit_id 集合 |
| | | |
| | | var list = this.$common.getAllAttr('permit_id', data); |
| | | list = list.map((v, i, a) => { |
| | | return { |
| | | permit_id: v |
| | | }; |
| | | }); |
| | | // 删除的是没有子权限的目录节点 |
| | | if (!list.length) { |
| | | this.getAllPermits(); |
| | | return; |
| | | } |
| | | // console.log(list); |
| | | this.$api.user.delPermit(list).then((res) => { |
| | | // console.log(res); |
| | | var data = JSON.parse(res.data.result); |
| | | if (data.code == 1) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: data.msg |
| | | }); |
| | | // 重新取数据 |
| | | this.getAllPermits(); |
| | | } |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: '请求后台失败,请检查网络连接!' |
| | | }); |
| | | }); |
| | | } |
| | | // 表单初始化 |
| | | ,addPermitFormInit () { |
| | | this.addPermitForm.show = false; |
| | | this.addPermitForm.value = ''; |
| | | this.addPermitForm.path = ''; |
| | | this.addPermitForm.permitNode = false; |
| | | this.addPermitForm.necessary = false; |
| | | this.addPermitForm.pathDisabled = false; |
| | | } |
| | | // 给权限组增加权限 |
| | | ,selectPermit (fromData, toData, obj) { |
| | | // 树形穿梭框模式transfer时,返回参数为左侧树移动后数据、右侧树移动后数据、移动的{keys,nodes,halfKeys,halfNodes}对象 |
| | | // 通讯录模式addressList时,返回参数为右侧收件人列表、右侧抄送人列表、右侧密送人列表 |
| | | // console.log("obj:", obj); |
| | | let re = this.$common.getAllAttr('permit_id', obj.nodes); |
| | | var data = re.map((v, i, a) => { |
| | | return { |
| | | permit_group_id: this.searchParams.group_id |
| | | ,permit_group_name: this.searchParams.group_name |
| | | ,permit_name: obj.nodes[i].permit_name |
| | | ,permit_id: v |
| | | } |
| | | }); |
| | | // console.log(data); |
| | | this.$api.user.selectPermit(data).then((res) => { |
| | | var data = JSON.parse(res.data.result); |
| | | if (data.code == 1) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: data.msg |
| | | }); |
| | | // 重新取数据 |
| | | this.getPermitByGroupId(this.searchParams.group_id); |
| | | } |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: '请求后台失败,请检查网络连接!' |
| | | }); |
| | | }); |
| | | } |
| | | // 从权限组去除权限 |
| | | ,unselectPermit (fromData, toData, obj) { |
| | | // console.log(obj, '=====obj======'); |
| | | let re = this.$common.getAllAttr('permit_id', obj.nodes); |
| | | // console.log(re, 're'); |
| | | var data = re.map((v, i, a) => { |
| | | return { |
| | | permit_group_id: this.searchParams.group_id |
| | | ,permit_group_name: this.searchParams.group_name |
| | | ,permit_name: obj.nodes[i].permit_name |
| | | ,permit_id: v |
| | | } |
| | | }); |
| | | // console.log(data); |
| | | this.$api.user.unselectPermit(data).then((res) => { |
| | | var data = JSON.parse(res.data.result); |
| | | if (data.code == 1) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: data.msg |
| | | }); |
| | | // 重新取数据 |
| | | this.getPermitByGroupId(this.searchParams.group_id); |
| | | } |
| | | }).catch(() => { |
| | | this.$message({ |