|
@@ -8,6 +8,7 @@ export default {
|
|
groupChecked: "",
|
|
groupChecked: "",
|
|
systemChecked: "",
|
|
systemChecked: "",
|
|
},
|
|
},
|
|
|
|
+ inputName: "",
|
|
visible: {
|
|
visible: {
|
|
actionGroup: false,
|
|
actionGroup: false,
|
|
user: false,
|
|
user: false,
|
|
@@ -410,26 +411,28 @@ export default {
|
|
// 最终需要的数组
|
|
// 最终需要的数组
|
|
this.addedSystemArr = [];
|
|
this.addedSystemArr = [];
|
|
|
|
|
|
- this.addedSystemMap.forEach((list, i) => {
|
|
|
|
- if (JSON.stringify(list) !== "{}") {
|
|
|
|
- for (let key in list) {
|
|
|
|
- let deviceArr = list[key].map((m) => {
|
|
|
|
- return `[${m.name}]`;
|
|
|
|
- });
|
|
|
|
- let deviceId = list[key].map((m) => {
|
|
|
|
- return m.id;
|
|
|
|
- });
|
|
|
|
- this.addedSystemArr.push({
|
|
|
|
- id: publicFunc.buildGuid("checked"),
|
|
|
|
- group: i.split("-")[0],
|
|
|
|
- system: i.split("-")[1],
|
|
|
|
- floor: key,
|
|
|
|
- deviceName: deviceArr.join(" "),
|
|
|
|
- deviceId: deviceId,
|
|
|
|
- });
|
|
|
|
|
|
+ if (this.addedSystemMap.size > 0) {
|
|
|
|
+ this.addedSystemMap.forEach((list, i) => {
|
|
|
|
+ if (JSON.stringify(list) !== "{}") {
|
|
|
|
+ for (let key in list) {
|
|
|
|
+ let deviceArr = list[key].map((m) => {
|
|
|
|
+ return `[${m.name}]`;
|
|
|
|
+ });
|
|
|
|
+ let deviceId = list[key].map((m) => {
|
|
|
|
+ return m.id;
|
|
|
|
+ });
|
|
|
|
+ this.addedSystemArr.push({
|
|
|
|
+ id: publicFunc.buildGuid("checked"),
|
|
|
|
+ group: i.split("-")[0],
|
|
|
|
+ system: i.split("-")[1],
|
|
|
|
+ floor: key,
|
|
|
|
+ deviceName: deviceArr.join(" "),
|
|
|
|
+ deviceId: deviceId,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
treeValue(data) {
|
|
treeValue(data) {
|
|
@@ -450,7 +453,11 @@ export default {
|
|
this.checkedObj.groupChecked = data;
|
|
this.checkedObj.groupChecked = data;
|
|
},
|
|
},
|
|
systemClick(data) {
|
|
systemClick(data) {
|
|
- this.checkedObj.systemChecked = data;
|
|
|
|
|
|
+ if (this.checkedObj.groupChecked == "") {
|
|
|
|
+ this.$message.info("请先选择角色组");
|
|
|
|
+ } else {
|
|
|
|
+ this.checkedObj.systemChecked = data;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
deleteEvent(data) {
|
|
deleteEvent(data) {
|
|
let targetObj = this.addedSystemMap.get(`${data.group}-${data.system}`);
|
|
let targetObj = this.addedSystemMap.get(`${data.group}-${data.system}`);
|
|
@@ -480,6 +487,11 @@ export default {
|
|
this.addedSystemArr = this.addedSystemArr.filter((v) => {
|
|
this.addedSystemArr = this.addedSystemArr.filter((v) => {
|
|
return v.id !== data.id;
|
|
return v.id !== data.id;
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ if (this.addedSystemArr.length === 0) {
|
|
|
|
+ this.checkedObj.groupChecked = "";
|
|
|
|
+ this.checkedObj.systemChecked = "";
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 打开新建权限行为组对话框
|
|
// 打开新建权限行为组对话框
|
|
createActionDialog() {
|
|
createActionDialog() {
|
|
@@ -491,6 +503,13 @@ export default {
|
|
},
|
|
},
|
|
addActionGroupEvent() {
|
|
addActionGroupEvent() {
|
|
this.visible.actionGroup = false;
|
|
this.visible.actionGroup = false;
|
|
|
|
+ this.$message.success("角色组添加成功!");
|
|
|
|
+ let groupName = this.inputName;
|
|
|
|
+ this.roleListData.push({
|
|
|
|
+ id: publicFunc.buildGuid("group"),
|
|
|
|
+ label: groupName,
|
|
|
|
+ type: "group",
|
|
|
|
+ });
|
|
},
|
|
},
|
|
addUserEvent() {
|
|
addUserEvent() {
|
|
this.visible.user = false;
|
|
this.visible.user = false;
|
|
@@ -563,6 +582,15 @@ export default {
|
|
title="新建行为权限组"
|
|
title="新建行为权限组"
|
|
@ok="addActionGroupEvent"
|
|
@ok="addActionGroupEvent"
|
|
>
|
|
>
|
|
|
|
+ <div class="dialog-content">
|
|
|
|
+ <div class="dialog-content-title">组名:</div>
|
|
|
|
+ <div class="dialog-content-input">
|
|
|
|
+ <a-input
|
|
|
|
+ placeholder="请输入名称"
|
|
|
|
+ v-model="inputName"
|
|
|
|
+ ></a-input>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</a-modal>
|
|
</a-modal>
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
@@ -763,6 +791,29 @@ export default {
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
@fontDefaultColor: #7f7f7f;
|
|
@fontDefaultColor: #7f7f7f;
|
|
@fontColor: #66beff;
|
|
@fontColor: #66beff;
|
|
|
|
+.ant-modal-body {
|
|
|
|
+ .dialog-content {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ &-title {
|
|
|
|
+ width: 20%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ }
|
|
|
|
+ &-input {
|
|
|
|
+ width: 75%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
.auth-action {
|
|
.auth-action {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
height: 100%;
|