yh-pub 1.0.2 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AdminLogin-BoxKRRwd.js +140 -0
- package/AdminLogin-BoxKRRwd.js.map +1 -0
- package/Dict.vue_vue_type_script_setup_true_lang-A8BZwEiK.js +55 -0
- package/Dict.vue_vue_type_script_setup_true_lang-A8BZwEiK.js.map +1 -0
- package/Error-BCu4KHfU.js +43 -0
- package/Error-BCu4KHfU.js.map +1 -0
- package/Error401-C5kTyMSM.js +30 -0
- package/Error401-C5kTyMSM.js.map +1 -0
- package/Error404-P3qKjHk6.js +30 -0
- package/Error404-P3qKjHk6.js.map +1 -0
- package/Error500-NVnuOBIQ.js +30 -0
- package/Error500-NVnuOBIQ.js.map +1 -0
- package/HomeIndex-C806Fp-9.js +438 -0
- package/HomeIndex-C806Fp-9.js.map +1 -0
- package/IconExplorer-CBg1lvD0.js +66 -0
- package/IconExplorer-CBg1lvD0.js.map +1 -0
- package/Index-AjfvK7Ss.js +5 -0
- package/Index-AjfvK7Ss.js.map +1 -0
- package/MainLogin-wW7bSk0F.js +155 -0
- package/MainLogin-wW7bSk0F.js.map +1 -0
- package/MenuManage-CIxqmusr.js +641 -0
- package/MenuManage-CIxqmusr.js.map +1 -0
- package/OrgManage-BcTWbnyc.js +378 -0
- package/OrgManage-BcTWbnyc.js.map +1 -0
- package/RoleManage-Bw83c_7q.js +729 -0
- package/RoleManage-Bw83c_7q.js.map +1 -0
- package/SysConfig-L0A1eY-O.js +727 -0
- package/SysConfig-L0A1eY-O.js.map +1 -0
- package/TenantList-B5imzQc5.js +696 -0
- package/TenantList-B5imzQc5.js.map +1 -0
- package/index-BP41Ph8K.js +55257 -0
- package/index-BP41Ph8K.js.map +1 -0
- package/index-CJ0So9-k.js +7 -0
- package/index-CJ0So9-k.js.map +1 -0
- package/index-wVC41gTc.js +23955 -0
- package/index-wVC41gTc.js.map +1 -0
- package/index.d.ts +35 -0
- package/index.es.js +66 -0
- package/index.es.js.map +1 -0
- package/package.json +27 -6
- package/style.css +1 -0
- package/README.MD +0 -19
- package/layout/admin/adminIndex.vue +0 -104
- package/layout/admin/api/loginApi.js +0 -24
- package/layout/admin/api/routers.js +0 -93
- package/layout/admin/api/tenantApi.js +0 -123
- package/layout/admin/home/homeIndex.vue +0 -25
- package/layout/admin/login/login.vue +0 -161
- package/layout/admin/menu/MenuIndex.vue +0 -648
- package/layout/admin/menu/icon.vue +0 -108
- package/layout/admin/menu/iconList.js +0 -934
- package/layout/admin/saTenant/saTenant.js +0 -0
- package/layout/admin/saTenant/saTenant.vue +0 -173
- package/layout/admin/saTenant/saTenantForm.js +0 -80
- package/layout/admin/saTenant/saTenantForm.vue +0 -61
- package/layout/admin/saTenant/saTenantRoleManage.js +0 -417
- package/layout/admin/saTenant/saTenantRoleManage.vue +0 -99
- package/layout/admin/user/saUser.less +0 -6
- package/layout/admin/user/saUser.vue +0 -72
- package/layout/main/components/console/console.vue +0 -205
- package/layout/main/components/error-store/error-store.vue +0 -72
- package/layout/main/components/error-store/index.js +0 -2
- package/layout/main/components/fullscreen/fullscreen.vue +0 -57
- package/layout/main/components/fullscreen/index.js +0 -2
- package/layout/main/components/language/language.vue +0 -71
- package/layout/main/components/side-menu/side-menu.less +0 -74
- package/layout/main/components/side-menu/side-menu.vue +0 -75
- package/layout/main/components/tags-nav/tags-nav.less +0 -45
- package/layout/main/components/tags-nav/tags-nav.vue +0 -144
- package/layout/main/components/user/user.less +0 -12
- package/layout/main/components/user/user.vue +0 -185
- package/layout/main/home/home.vue +0 -480
- package/layout/main/home/index.js +0 -2
- package/layout/main/home/toDoList.vue +0 -32
- package/layout/main/login/login.less +0 -93
- package/layout/main/login/login.vue +0 -151
- package/layout/main/main.less +0 -81
- package/layout/main/main.vue +0 -254
- package/layout/main/system/dict.vue +0 -64
- package/layout/main/system/orgManage.vue +0 -473
- package/layout/main/system/roleManage.js +0 -807
- package/layout/main/system/roleManage.vue +0 -424
- package/view/basic/error-logger.vue +0 -74
- package/view/basic/error-page/401.vue +0 -22
- package/view/basic/error-page/404.vue +0 -22
- package/view/basic/error-page/500.vue +0 -22
- package/view/basic/error-page/back-btn-group.vue +0 -48
- package/view/basic/error-page/error-content.vue +0 -28
- package/view/basic/error-page/error.less +0 -46
- package/view/config/component/confFormItem.vue +0 -49
- package/view/config/config.scss +0 -45
- package/view/config/configIndex.vue +0 -150
- package/view/config/subPage/router-config.vue +0 -5
- package/view/config/subPage/sys-config.vue +0 -249
- package/view/window/IframeFReportView.vue +0 -28
- package/view/window/windowIndex.vue +0 -22
|
@@ -1,807 +0,0 @@
|
|
|
1
|
-
import dict from "./dict.vue";
|
|
2
|
-
import { deepClone } from "@/libs/util";
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
name: "role-manage",
|
|
6
|
-
components: {
|
|
7
|
-
dict,
|
|
8
|
-
},
|
|
9
|
-
data () {
|
|
10
|
-
return {
|
|
11
|
-
maxHeight: 510,
|
|
12
|
-
openTip: false,
|
|
13
|
-
loading: true,
|
|
14
|
-
userLoading: false,
|
|
15
|
-
treeLoading: true,
|
|
16
|
-
submitPermLoading: false,
|
|
17
|
-
submitDepLoading: false,
|
|
18
|
-
searchKey: "",
|
|
19
|
-
modalType: 0,
|
|
20
|
-
roleModalVisible: false,
|
|
21
|
-
roleOrgData: {},
|
|
22
|
-
permModalVisible: false,
|
|
23
|
-
orgModalVisible: false,
|
|
24
|
-
orgData: [],
|
|
25
|
-
modalTitle: "",
|
|
26
|
-
searchForm: {
|
|
27
|
-
// 搜索框初始化对象
|
|
28
|
-
pageNumber: 1, // 当前页数
|
|
29
|
-
pageSize: 10, // 页面大小
|
|
30
|
-
sort: "createTime", // 默认排序字段
|
|
31
|
-
order: "desc", // 默认排序方式
|
|
32
|
-
key: "",
|
|
33
|
-
},
|
|
34
|
-
roleForm: {
|
|
35
|
-
adOrgId: "",
|
|
36
|
-
name: "",
|
|
37
|
-
isAdmin: "N",
|
|
38
|
-
description: "",
|
|
39
|
-
adRoleId: "",
|
|
40
|
-
},
|
|
41
|
-
roleFormValidate: {
|
|
42
|
-
adOrgId: [{ required: true, message: "组织机构不能为空", trigger: "change" }],
|
|
43
|
-
name: [{ required: true, message: "角色名称不能为空", trigger: "change" }],
|
|
44
|
-
},
|
|
45
|
-
submitLoading: false,
|
|
46
|
-
selectList: [],
|
|
47
|
-
data: [],
|
|
48
|
-
userData: [],
|
|
49
|
-
paginationUser: { currentPage: 1, pageSize: 10, total: 0 },
|
|
50
|
-
listLoading: false,
|
|
51
|
-
pagination: { currentPage: 1, pageSize: 10, total: 0 },
|
|
52
|
-
permData: [],
|
|
53
|
-
editRolePermId: "",
|
|
54
|
-
selectAllFlag: false,
|
|
55
|
-
dataType: 0,
|
|
56
|
-
indeterminate: false,
|
|
57
|
-
checkAll: false,
|
|
58
|
-
checkAllGroup: [],
|
|
59
|
-
curWindowBtnList: [],
|
|
60
|
-
saveWinBtnList: [],
|
|
61
|
-
roleSavedBtnPermMap: {}, // 角色已授予的按钮权限
|
|
62
|
-
curSelectedMenuId: "", // 当前选中目录ID
|
|
63
|
-
selectedKeys: [],
|
|
64
|
-
selectedNodes: [],
|
|
65
|
-
halfSelectedNodes: [],
|
|
66
|
-
deptCheckedKeys: [],
|
|
67
|
-
timer: null,
|
|
68
|
-
queryOrgId: "",
|
|
69
|
-
queryRoteId: "",
|
|
70
|
-
queryUserList: [],
|
|
71
|
-
currentRow: null,
|
|
72
|
-
userIds: [],
|
|
73
|
-
userListVisible: false,
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
methods: {
|
|
77
|
-
init () {
|
|
78
|
-
this.getDataList();
|
|
79
|
-
},
|
|
80
|
-
parseOrgTreeData (curLevelData, curLevel, roleOrgData) {
|
|
81
|
-
let curVm = this;
|
|
82
|
-
let newLevelData = curLevelData;
|
|
83
|
-
newLevelData.key = curLevelData.adOrgId;
|
|
84
|
-
newLevelData.title = curLevelData.name;
|
|
85
|
-
if (roleOrgData[curLevelData.adOrgId]) {
|
|
86
|
-
if (roleOrgData[curLevelData.adOrgId].isOrgAdmin === "Y") {
|
|
87
|
-
this.deptCheckedKeys.push(curLevelData.adOrgId);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
newLevelData["level"] = curLevel;
|
|
91
|
-
if (curLevelData["_childs"] && curLevelData["_childs"].length > 0) {
|
|
92
|
-
curLevelData["_childs"].forEach(function (sonTreeData) {
|
|
93
|
-
if (!newLevelData.children) {
|
|
94
|
-
newLevelData.children = [];
|
|
95
|
-
}
|
|
96
|
-
newLevelData.children.push(curVm.parseOrgTreeData(sonTreeData, curLevel + 1, roleOrgData));
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
return newLevelData;
|
|
100
|
-
},
|
|
101
|
-
async loadRoleOrg () {
|
|
102
|
-
let roleOrgData = {};
|
|
103
|
-
// 请求系统数据
|
|
104
|
-
this.axios
|
|
105
|
-
.post(
|
|
106
|
-
"/roleController/getRoleOrgAccess",
|
|
107
|
-
this.$qs.stringify({
|
|
108
|
-
roleId: this.editRolePermId,
|
|
109
|
-
}),
|
|
110
|
-
)
|
|
111
|
-
.then((response) => {
|
|
112
|
-
if (response.data.result) {
|
|
113
|
-
if (response.data.roleOrgAccess) {
|
|
114
|
-
response.data.roleOrgAccess.forEach(function (sd) {
|
|
115
|
-
roleOrgData[sd.orgId] = sd;
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
return roleOrgData;
|
|
121
|
-
},
|
|
122
|
-
async editOrg (v) {
|
|
123
|
-
this.editRolePermId = v.adRoleId;
|
|
124
|
-
this.modalTitle = "分配 " + v.name + " 的组织机构权限";
|
|
125
|
-
let roleOrgData = await this.loadRoleOrg();
|
|
126
|
-
this.roleOrgData = roleOrgData;
|
|
127
|
-
// 请求系统数据
|
|
128
|
-
this.axios.post("/orgController/getUserOrgTree", {}).then((response) => {
|
|
129
|
-
if (response.data.result) {
|
|
130
|
-
let newTreeData = [];
|
|
131
|
-
this.deptCheckedKeys = [];
|
|
132
|
-
response.data.list.forEach((e) => {
|
|
133
|
-
newTreeData.push(this.parseOrgTreeData(e, 0, roleOrgData));
|
|
134
|
-
});
|
|
135
|
-
this.orgData = newTreeData;
|
|
136
|
-
this.$nextTick(() => {
|
|
137
|
-
this.$refs.depTree.setCheckedKeys(this.deptCheckedKeys);
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
this.orgModalVisible = true;
|
|
142
|
-
},
|
|
143
|
-
checkOrgTree () {
|
|
144
|
-
if (this.timer) {
|
|
145
|
-
clearTimeout(this.timer);
|
|
146
|
-
}
|
|
147
|
-
this.timer = setTimeout(() => {
|
|
148
|
-
this.deptCheckedKeys = this.$refs.depTree.getCheckedKeys();
|
|
149
|
-
}, 300);
|
|
150
|
-
},
|
|
151
|
-
submitRoleOrg () {
|
|
152
|
-
let selectedNodes = this.$refs.depTree.getCheckedKeys() || [];
|
|
153
|
-
let curVm = this;
|
|
154
|
-
let subRoleOrgData = [];
|
|
155
|
-
// 判断已提交角色机构数据
|
|
156
|
-
selectedNodes.forEach(function (e) {
|
|
157
|
-
subRoleOrgData.push({ ad_org_id: e, is_org_admin: "Y" });
|
|
158
|
-
});
|
|
159
|
-
this.axios
|
|
160
|
-
.post(
|
|
161
|
-
"/roleController/saveRoleOrgAccess",
|
|
162
|
-
this.$qs.stringify({
|
|
163
|
-
roleId: curVm.editRolePermId,
|
|
164
|
-
subJsonData: JSON.stringify(subRoleOrgData),
|
|
165
|
-
}),
|
|
166
|
-
)
|
|
167
|
-
.then((response) => {
|
|
168
|
-
if (response.data.result) {
|
|
169
|
-
curVm.$message.success(response.data.msg);
|
|
170
|
-
} else {
|
|
171
|
-
curVm.$message.error(response.data.msg);
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
this.orgModalVisible = false;
|
|
175
|
-
},
|
|
176
|
-
renderContent (h, { root, node, data }) {
|
|
177
|
-
let icon = "";
|
|
178
|
-
if (data.level === 0) {
|
|
179
|
-
icon = "ios-navigate";
|
|
180
|
-
} else if (data.level === 1) {
|
|
181
|
-
icon = "md-list-box";
|
|
182
|
-
} else if (data.level === 2) {
|
|
183
|
-
icon = "md-list";
|
|
184
|
-
} else if (data.level === 3) {
|
|
185
|
-
icon = "md-radio-button-on";
|
|
186
|
-
} else {
|
|
187
|
-
icon = "md-radio-button-off";
|
|
188
|
-
}
|
|
189
|
-
return h(
|
|
190
|
-
"span",
|
|
191
|
-
{
|
|
192
|
-
style: {
|
|
193
|
-
display: "inline-block",
|
|
194
|
-
cursor: "pointer",
|
|
195
|
-
},
|
|
196
|
-
on: {
|
|
197
|
-
click: () => {
|
|
198
|
-
data.checked = !data.checked;
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
[
|
|
203
|
-
h("span", [
|
|
204
|
-
h("Icon", {
|
|
205
|
-
props: {
|
|
206
|
-
type: icon,
|
|
207
|
-
size: "16",
|
|
208
|
-
},
|
|
209
|
-
style: {
|
|
210
|
-
"margin-right": "8px",
|
|
211
|
-
"margin-bottom": "3px",
|
|
212
|
-
},
|
|
213
|
-
}),
|
|
214
|
-
h("span", data.title),
|
|
215
|
-
]),
|
|
216
|
-
],
|
|
217
|
-
);
|
|
218
|
-
},
|
|
219
|
-
checkedMenuTree () {
|
|
220
|
-
if (this.timer) {
|
|
221
|
-
clearTimeout(this.timer);
|
|
222
|
-
}
|
|
223
|
-
this.timer = setTimeout(() => {
|
|
224
|
-
this.selectedNodes = this.$refs.tree.getCheckedKeys(true);
|
|
225
|
-
this.halfSelectedNodes = this.$refs.tree.getHalfCheckedKeys(true);
|
|
226
|
-
}, 300);
|
|
227
|
-
},
|
|
228
|
-
selectTree (data, node) {
|
|
229
|
-
if (data) {
|
|
230
|
-
this.curSelectedMenuId = data.sysWindowId;
|
|
231
|
-
// 加载目录树
|
|
232
|
-
this.axios
|
|
233
|
-
.post("/rolePermissionsSetting/getMenuWindowButton", { windowId: this.curSelectedMenuId })
|
|
234
|
-
.then((response) => {
|
|
235
|
-
let { result, data } = response.data;
|
|
236
|
-
if (result && data) {
|
|
237
|
-
let roleBtnData = [];
|
|
238
|
-
let tempQyBtnData = [];
|
|
239
|
-
data.forEach((tData) => {
|
|
240
|
-
if (tData.TYPE === "QY") {
|
|
241
|
-
roleBtnData.push(tData);
|
|
242
|
-
tempQyBtnData[tData.ID] = [];
|
|
243
|
-
} else {
|
|
244
|
-
if (tempQyBtnData[tData.PARENT_ID]) {
|
|
245
|
-
tempQyBtnData[tData.PARENT_ID].push(tData);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
roleBtnData.forEach((item) => {
|
|
250
|
-
item["childs"] = tempQyBtnData[item.ID];
|
|
251
|
-
// e['checkAll'] = false
|
|
252
|
-
let roleSavedBtns = this.roleSavedBtnPermMap[this.curSelectedMenuId] || [];
|
|
253
|
-
let checkChilds = [];
|
|
254
|
-
let tcount = 0;
|
|
255
|
-
tempQyBtnData[item.ID].forEach((es) => {
|
|
256
|
-
if (roleSavedBtns.includes(es.ID)) {
|
|
257
|
-
checkChilds.push(es.ID);
|
|
258
|
-
tcount++;
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
if (tcount === tempQyBtnData[item.ID].length) {
|
|
262
|
-
item["checkAll"] = true;
|
|
263
|
-
item["indeterminate"] = false;
|
|
264
|
-
} else if (tcount > 0) {
|
|
265
|
-
item["checkAll"] = false;
|
|
266
|
-
item["indeterminate"] = true;
|
|
267
|
-
} else {
|
|
268
|
-
item["checkAll"] = false;
|
|
269
|
-
item["indeterminate"] = false;
|
|
270
|
-
}
|
|
271
|
-
item["checkChilds"] = checkChilds;
|
|
272
|
-
});
|
|
273
|
-
this.curWindowBtnList = roleBtnData;
|
|
274
|
-
// 加载角色已授权的按钮
|
|
275
|
-
this.saveWinBtnList = this.roleSavedBtnPermMap[this.curSelectedMenuId];
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
},
|
|
280
|
-
resetBtnPerData () {
|
|
281
|
-
this.roleSavedBtnPermMap = {};
|
|
282
|
-
this.curWindowBtnList = [];
|
|
283
|
-
this.saveWinBtnList = [];
|
|
284
|
-
},
|
|
285
|
-
doWinBtnData (doType, btnId) {
|
|
286
|
-
if (!this.saveWinBtnList) {
|
|
287
|
-
this.saveWinBtnList = [];
|
|
288
|
-
}
|
|
289
|
-
if (doType === "add") {
|
|
290
|
-
if (this.saveWinBtnList.length !== 0) {
|
|
291
|
-
for (let i = 0; i < this.saveWinBtnList.length; i++) {
|
|
292
|
-
if (this.saveWinBtnList[i] === btnId) {
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
this.saveWinBtnList.push(btnId);
|
|
298
|
-
} else {
|
|
299
|
-
for (let i = 0; i < this.saveWinBtnList.length; i++) {
|
|
300
|
-
if (this.saveWinBtnList[i] === btnId) {
|
|
301
|
-
this.saveWinBtnList.splice(i, 1);
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
},
|
|
307
|
-
handleCheckAll (item, key) {
|
|
308
|
-
let checkChilds = [];
|
|
309
|
-
if (!item.checkAll) {
|
|
310
|
-
// 已经全选取消全选状态
|
|
311
|
-
item.checkAll = false;
|
|
312
|
-
item.indeterminate = false;
|
|
313
|
-
item.checkChilds = checkChilds;
|
|
314
|
-
} else {
|
|
315
|
-
// 不是全选状态,获取所有ids,并设定全选状态相关参数
|
|
316
|
-
checkChilds = item.childs.map((item) => item.ID);
|
|
317
|
-
item.checkAll = true;
|
|
318
|
-
item.indeterminate = false;
|
|
319
|
-
item.checkChilds = checkChilds;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
// 状态设置完成,将数据赋值到 响应对象上去
|
|
323
|
-
this.updateBtnsToList();
|
|
324
|
-
this.curWindowBtnList[key] = item;
|
|
325
|
-
},
|
|
326
|
-
checkAllGroupChange (event, key) {
|
|
327
|
-
let list = deepClone({}, this.curWindowBtnList);
|
|
328
|
-
let currentItem = list[key];
|
|
329
|
-
if (event.length > 0) {
|
|
330
|
-
// 判断是否存在值
|
|
331
|
-
let containFlag = 0; // 0 不包含 1 部分包括 2 全包括
|
|
332
|
-
let okCount = 0; // 统计包括次数
|
|
333
|
-
for (var i = 0; i < currentItem.childs.length; i++) {
|
|
334
|
-
if (event.includes(currentItem.childs[i].ID)) {
|
|
335
|
-
okCount++;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
if (okCount === currentItem.childs.length) {
|
|
339
|
-
containFlag = 2;
|
|
340
|
-
} else {
|
|
341
|
-
containFlag = 1;
|
|
342
|
-
}
|
|
343
|
-
// 判断是否选中
|
|
344
|
-
if (containFlag === 1) {
|
|
345
|
-
currentItem.checkAll = false;
|
|
346
|
-
if (okCount === 0) {
|
|
347
|
-
currentItem.indeterminate = false;
|
|
348
|
-
} else {
|
|
349
|
-
currentItem.indeterminate = true;
|
|
350
|
-
}
|
|
351
|
-
} else if (containFlag === 2) {
|
|
352
|
-
currentItem.checkAll = true;
|
|
353
|
-
currentItem.indeterminate = false;
|
|
354
|
-
}
|
|
355
|
-
} else {
|
|
356
|
-
currentItem.checkAll = false;
|
|
357
|
-
currentItem.indeterminate = false;
|
|
358
|
-
}
|
|
359
|
-
currentItem.checkChilds = event;
|
|
360
|
-
this.curWindowBtnList[key] = currentItem;
|
|
361
|
-
this.updateBtnsToList();
|
|
362
|
-
},
|
|
363
|
-
updateBtnsToList () {
|
|
364
|
-
let btns = new Set();
|
|
365
|
-
this.curWindowBtnList.forEach((item) => {
|
|
366
|
-
item.checkChilds.forEach((checkId) => {
|
|
367
|
-
btns.add(checkId);
|
|
368
|
-
});
|
|
369
|
-
});
|
|
370
|
-
btns = Array.from(btns);
|
|
371
|
-
this.roleSavedBtnPermMap[this.curSelectedMenuId] = btns;
|
|
372
|
-
},
|
|
373
|
-
changePage (v) {
|
|
374
|
-
this.searchForm.pageNumber = v;
|
|
375
|
-
this.getDataList();
|
|
376
|
-
this.clearSelectAll();
|
|
377
|
-
},
|
|
378
|
-
changePageSize (v) {
|
|
379
|
-
this.searchForm.pageSize = v;
|
|
380
|
-
this.getDataList();
|
|
381
|
-
},
|
|
382
|
-
changeSort (e) {
|
|
383
|
-
this.searchForm.sort = e.key;
|
|
384
|
-
this.searchForm.order = e.order;
|
|
385
|
-
if (e.order === "normal") {
|
|
386
|
-
this.searchForm.order = "";
|
|
387
|
-
}
|
|
388
|
-
this.getDataList();
|
|
389
|
-
},
|
|
390
|
-
getDataList () {
|
|
391
|
-
this.loading = true;
|
|
392
|
-
this.axios.post("/roleController/getRoleList",
|
|
393
|
-
this.$qs.stringify({
|
|
394
|
-
name: this.searchForm.key,
|
|
395
|
-
pageSize: this.pagination.pageSize,
|
|
396
|
-
pageIndex: this.pagination.currentPage,
|
|
397
|
-
}),
|
|
398
|
-
).then((response) => {
|
|
399
|
-
this.loading = false;
|
|
400
|
-
if (response.data.result) {
|
|
401
|
-
this.data = response.data.data.records;
|
|
402
|
-
this.pagination.total = response.data.data.total;
|
|
403
|
-
}
|
|
404
|
-
});
|
|
405
|
-
},
|
|
406
|
-
getUserDataList (val) {
|
|
407
|
-
if (val === undefined) {
|
|
408
|
-
this.userData = [];
|
|
409
|
-
return;
|
|
410
|
-
}
|
|
411
|
-
if (val != 1) {
|
|
412
|
-
this.currentRow = val;
|
|
413
|
-
}
|
|
414
|
-
this.userLoading = true;
|
|
415
|
-
this.userIds = [];
|
|
416
|
-
this.axios.post("/roteUser/getAdRoleUsers",
|
|
417
|
-
this.$qs.stringify({
|
|
418
|
-
roteId: this.currentRow.adRoleId,
|
|
419
|
-
orgId: this.currentRow.adOrgId,
|
|
420
|
-
pageSize: this.paginationUser.pageSize,
|
|
421
|
-
pageIndex: this.paginationUser.currentPage,
|
|
422
|
-
}),
|
|
423
|
-
).then((response) => {
|
|
424
|
-
this.userLoading = false;
|
|
425
|
-
if (response.data.result) {
|
|
426
|
-
this.queryOrgId = this.currentRow.adOrgId;
|
|
427
|
-
this.queryRoteId = this.currentRow.adRoleId;
|
|
428
|
-
this.userData = response.data.data.records;
|
|
429
|
-
this.paginationUser.total = response.data.data.total;
|
|
430
|
-
this.userData.forEach(value => {
|
|
431
|
-
this.userIds.push(value.ad_user_id);
|
|
432
|
-
});
|
|
433
|
-
}
|
|
434
|
-
});
|
|
435
|
-
},
|
|
436
|
-
getUserList () {
|
|
437
|
-
this.userListVisible = true;
|
|
438
|
-
this.axios.post("/roteUser/getUserList",
|
|
439
|
-
this.$qs.stringify({
|
|
440
|
-
orgId: this.queryOrgId,
|
|
441
|
-
}),
|
|
442
|
-
).then((response) => {
|
|
443
|
-
this.userLoading = false;
|
|
444
|
-
if (response.data.result) {
|
|
445
|
-
this.queryUserList = response.data.data;
|
|
446
|
-
}
|
|
447
|
-
});
|
|
448
|
-
},
|
|
449
|
-
addUserRote () {
|
|
450
|
-
this.axios.post("/roteUser/addUserRote",
|
|
451
|
-
this.$qs.stringify({
|
|
452
|
-
roteId: this.queryRoteId,
|
|
453
|
-
userIds: this.userIds.toString(),
|
|
454
|
-
}),
|
|
455
|
-
).then((response) => {
|
|
456
|
-
this.userLoading = false;
|
|
457
|
-
this.userListVisible = false;
|
|
458
|
-
this.$message.success("操作成功");
|
|
459
|
-
this.getUserDataList(this.currentRow);
|
|
460
|
-
});
|
|
461
|
-
},
|
|
462
|
-
deleteUserRote (v) {
|
|
463
|
-
if (v && v.adRoleId && v.ad_user_id) {
|
|
464
|
-
this.axios.post("/roteUser/deleteUserRote",
|
|
465
|
-
this.$qs.stringify({
|
|
466
|
-
roteId: v.adRoleId,
|
|
467
|
-
userId: v.ad_user_id,
|
|
468
|
-
}),
|
|
469
|
-
).then((response) => {
|
|
470
|
-
this.userLoading = false;
|
|
471
|
-
this.$message.success("操作成功");
|
|
472
|
-
this.getUserDataList(this.currentRow);
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
},
|
|
476
|
-
onCanael () {
|
|
477
|
-
this.userListVisible = false;
|
|
478
|
-
},
|
|
479
|
-
parseTreeData (curLevelData, curLevel) {
|
|
480
|
-
let newLevelData = curLevelData;
|
|
481
|
-
newLevelData["id"] = curLevelData.adMenuId;
|
|
482
|
-
newLevelData["key"] = curLevelData.adMenuId;
|
|
483
|
-
newLevelData["title"] = curLevelData.name;
|
|
484
|
-
newLevelData["expand"] = true;
|
|
485
|
-
newLevelData["checked"] = false;
|
|
486
|
-
newLevelData["level"] = curLevel;
|
|
487
|
-
if (curLevelData["_childs"] && curLevelData["_childs"].length > 0) {
|
|
488
|
-
curLevelData["_childs"].forEach((sonTreeData) => {
|
|
489
|
-
if (!newLevelData.children) {
|
|
490
|
-
newLevelData.children = [];
|
|
491
|
-
}
|
|
492
|
-
newLevelData.children.push(this.parseTreeData(sonTreeData, curLevel + 1));
|
|
493
|
-
});
|
|
494
|
-
}
|
|
495
|
-
return newLevelData;
|
|
496
|
-
},
|
|
497
|
-
getRoleMenus: async function () {
|
|
498
|
-
// 请求角色菜单数据
|
|
499
|
-
let roleMenuData = [];
|
|
500
|
-
await this.axios
|
|
501
|
-
.post("/rolePermissionsSetting/getRoleMenus", this.$qs.stringify({ roleId: this.editRolePermId }))
|
|
502
|
-
.then((response) => {
|
|
503
|
-
if (response.data.result) {
|
|
504
|
-
response.data.data.forEach(function (e) {
|
|
505
|
-
roleMenuData[e.AD_MENU_ID] = e;
|
|
506
|
-
});
|
|
507
|
-
}
|
|
508
|
-
}).catch((e) => {
|
|
509
|
-
console.error(e);
|
|
510
|
-
});
|
|
511
|
-
return roleMenuData;
|
|
512
|
-
},
|
|
513
|
-
// 递归标记是否选中
|
|
514
|
-
calNewTreeData (newTreeData, roleMenuData) {
|
|
515
|
-
let checkedCount = 0;
|
|
516
|
-
newTreeData.forEach((e) => {
|
|
517
|
-
if (e.level === 0 || e.level === 1) {
|
|
518
|
-
e.expand = true;
|
|
519
|
-
} else {
|
|
520
|
-
e.expand = true;
|
|
521
|
-
}
|
|
522
|
-
// 判断是否选中
|
|
523
|
-
if (roleMenuData[e.adMenuId]) {
|
|
524
|
-
e.checked = true;
|
|
525
|
-
checkedCount++;
|
|
526
|
-
}
|
|
527
|
-
if (e.children && e.children.length > 0) {
|
|
528
|
-
let sonCheckedCount = this.calNewTreeData(e.children, roleMenuData);
|
|
529
|
-
// 判断父节点是否选中
|
|
530
|
-
if (sonCheckedCount === e.children.length) {
|
|
531
|
-
e.checked = true;
|
|
532
|
-
e.indeterminate = false;
|
|
533
|
-
} else if (sonCheckedCount > 0 && sonCheckedCount < e.children.length) {
|
|
534
|
-
e.indeterminate = true;
|
|
535
|
-
e.checked = false;
|
|
536
|
-
} else {
|
|
537
|
-
e.checked = false;
|
|
538
|
-
e.indeterminate = false;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
if (e.checked) {
|
|
542
|
-
this.halfSelectedNodes.push(e.adMenuId);
|
|
543
|
-
}
|
|
544
|
-
if (e.checked) {
|
|
545
|
-
this.selectedNodes.push(e.adMenuId);
|
|
546
|
-
}
|
|
547
|
-
} else {
|
|
548
|
-
if (e.checked) {
|
|
549
|
-
this.selectedNodes.push(e.adMenuId);
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
});
|
|
553
|
-
return checkedCount;
|
|
554
|
-
},
|
|
555
|
-
getPermList: async function () {
|
|
556
|
-
this.treeLoading = true;
|
|
557
|
-
|
|
558
|
-
this.expandedKeys = [];
|
|
559
|
-
this.selectedNodes = [];
|
|
560
|
-
|
|
561
|
-
let roleMenuData = await this.getRoleMenus();
|
|
562
|
-
this.axios.post("/rolePermissionsSetting/getMenuList", this.$qs.stringify({})).then((response) => {
|
|
563
|
-
if (response.data.result) {
|
|
564
|
-
let newTreeData = [];
|
|
565
|
-
// 仅展开指定级数 默认后端已展开所有
|
|
566
|
-
response.data.menuList.forEach((e) => {
|
|
567
|
-
newTreeData.push(this.parseTreeData(e, 0));
|
|
568
|
-
});
|
|
569
|
-
this.calNewTreeData(newTreeData, roleMenuData);
|
|
570
|
-
this.deleteDisableNode(newTreeData);
|
|
571
|
-
this.permData = newTreeData;
|
|
572
|
-
this.treeLoading = false;
|
|
573
|
-
|
|
574
|
-
this.$nextTick(() => {
|
|
575
|
-
let checked = this.selectedNodes.filter((item) => !this.halfSelectedNodes.includes(item));
|
|
576
|
-
this.$refs.tree.setCheckedKeys(checked);
|
|
577
|
-
});
|
|
578
|
-
}
|
|
579
|
-
this.loading = false;
|
|
580
|
-
});
|
|
581
|
-
},
|
|
582
|
-
// 递归标记禁用节点
|
|
583
|
-
deleteDisableNode (permData) {
|
|
584
|
-
let that = this;
|
|
585
|
-
permData.forEach(function (e) {
|
|
586
|
-
if (e.status === -1) {
|
|
587
|
-
e.title = "[已禁用] " + e.title;
|
|
588
|
-
e.disabled = true;
|
|
589
|
-
}
|
|
590
|
-
if (e.children && e.children.length > 0) {
|
|
591
|
-
that.deleteDisableNode(e.children);
|
|
592
|
-
}
|
|
593
|
-
});
|
|
594
|
-
},
|
|
595
|
-
cancelRole () {
|
|
596
|
-
this.roleModalVisible = false;
|
|
597
|
-
},
|
|
598
|
-
submitRole () {
|
|
599
|
-
let that = this;
|
|
600
|
-
let subForm = {
|
|
601
|
-
orgId: this.roleForm.adOrgId,
|
|
602
|
-
adRoleId: this.roleForm.adRoleId,
|
|
603
|
-
name: this.roleForm.name,
|
|
604
|
-
description: this.roleForm.description,
|
|
605
|
-
isAdmin: this.roleForm.isAdmin,
|
|
606
|
-
};
|
|
607
|
-
this.$refs.roleForm.validate((valid) => {
|
|
608
|
-
if (valid) {
|
|
609
|
-
this.submitLoading = true;
|
|
610
|
-
debugger;
|
|
611
|
-
this.axios.post("/roleController/submitRole", this.$qs.stringify(subForm)).then((response) => {
|
|
612
|
-
that.submitLoading = false;
|
|
613
|
-
if (response.data.result) {
|
|
614
|
-
that.$message.success("操作成功");
|
|
615
|
-
that.getDataList();
|
|
616
|
-
that.roleModalVisible = false;
|
|
617
|
-
} else {
|
|
618
|
-
that.$message.error(response.data.msg);
|
|
619
|
-
}
|
|
620
|
-
});
|
|
621
|
-
}
|
|
622
|
-
});
|
|
623
|
-
},
|
|
624
|
-
addRole () {
|
|
625
|
-
// 处理状态
|
|
626
|
-
this.modalType = 0;
|
|
627
|
-
this.modalTitle = "添加角色";
|
|
628
|
-
// 清理表单
|
|
629
|
-
this.roleForm.adRoleId = undefined;
|
|
630
|
-
this.roleForm.name = "";
|
|
631
|
-
this.roleForm.isAdmin = "N";
|
|
632
|
-
this.roleForm.description = "";
|
|
633
|
-
this.roleForm.adRoleId = "";
|
|
634
|
-
// 显示弹窗
|
|
635
|
-
this.roleModalVisible = true;
|
|
636
|
-
},
|
|
637
|
-
edit (v) {
|
|
638
|
-
// 处理状态
|
|
639
|
-
this.modalType = 1;
|
|
640
|
-
this.modalTitle = "编辑角色";
|
|
641
|
-
// 填充表单
|
|
642
|
-
this.roleForm.adOrgId = v.adOrgId;
|
|
643
|
-
this.roleForm.name = v.name;
|
|
644
|
-
this.roleForm.isAdmin = v.isAdmin;
|
|
645
|
-
this.roleForm.description = v.description;
|
|
646
|
-
this.roleForm.adRoleId = v.adRoleId;
|
|
647
|
-
// 显示弹窗
|
|
648
|
-
this.roleModalVisible = true;
|
|
649
|
-
},
|
|
650
|
-
deleteRole (delId) {
|
|
651
|
-
this.axios
|
|
652
|
-
.post(
|
|
653
|
-
"/roleController/delRoleByIds",
|
|
654
|
-
this.$qs.stringify({
|
|
655
|
-
ids: delId,
|
|
656
|
-
}),
|
|
657
|
-
)
|
|
658
|
-
.then((response) => {
|
|
659
|
-
if (response.data.result) {
|
|
660
|
-
this.$message.success("删除成功");
|
|
661
|
-
this.clearSelectAll();
|
|
662
|
-
this.getDataList();
|
|
663
|
-
} else {
|
|
664
|
-
this.$message.success("删除失败");
|
|
665
|
-
}
|
|
666
|
-
});
|
|
667
|
-
},
|
|
668
|
-
remove (v) {
|
|
669
|
-
if (v && v.adRoleId) {
|
|
670
|
-
this.deleteRole(v.adRoleId);
|
|
671
|
-
}
|
|
672
|
-
},
|
|
673
|
-
clearSelectAll () {
|
|
674
|
-
this.selectList = [];
|
|
675
|
-
},
|
|
676
|
-
changeSelect (e) {
|
|
677
|
-
this.selectList = e;
|
|
678
|
-
},
|
|
679
|
-
delAll () {
|
|
680
|
-
if (this.selectList.length <= 0) {
|
|
681
|
-
this.$message.warning("您还未选择要删除的数据");
|
|
682
|
-
return;
|
|
683
|
-
}
|
|
684
|
-
let ids = this.selectList.join(",");
|
|
685
|
-
// 删除按钮代码
|
|
686
|
-
this.deleteRole(ids);
|
|
687
|
-
},
|
|
688
|
-
editPerm (v) {
|
|
689
|
-
this.editRolePermId = v.adRoleId;
|
|
690
|
-
// 获取所有菜单权限树
|
|
691
|
-
this.getPermList();
|
|
692
|
-
this.modalTitle = "分配 " + v.name + " 的菜单权限";
|
|
693
|
-
// 递归判断子节点
|
|
694
|
-
this.checkPermTree(this.permData, []);
|
|
695
|
-
// 加载所有已授予的按钮权限
|
|
696
|
-
this.axios
|
|
697
|
-
.post("/roleController/getRoleWindowButton", this.$qs.stringify({ roleId: this.editRolePermId }))
|
|
698
|
-
.then((response) => {
|
|
699
|
-
if (response.data.result && response.data.data) {
|
|
700
|
-
let roleBtnPermMap = {};
|
|
701
|
-
response.data.data.forEach(function (e) {
|
|
702
|
-
if (!roleBtnPermMap[e.WINDOW_ID]) {
|
|
703
|
-
roleBtnPermMap[e.WINDOW_ID] = [];
|
|
704
|
-
}
|
|
705
|
-
roleBtnPermMap[e.WINDOW_ID].push(e.BUTTON_ID);
|
|
706
|
-
});
|
|
707
|
-
this.roleSavedBtnPermMap = roleBtnPermMap;
|
|
708
|
-
}
|
|
709
|
-
});
|
|
710
|
-
this.permModalVisible = true;
|
|
711
|
-
},
|
|
712
|
-
// 递归判断子节点
|
|
713
|
-
checkPermTree (permData, rolePerms) {
|
|
714
|
-
let that = this;
|
|
715
|
-
permData.forEach(function (p) {
|
|
716
|
-
if (that.hasPerm(p, rolePerms) && p.status !== -1) {
|
|
717
|
-
p.checked = true;
|
|
718
|
-
} else {
|
|
719
|
-
p.checked = false;
|
|
720
|
-
}
|
|
721
|
-
if (p.children && p.children.length > 0) {
|
|
722
|
-
that.checkPermTree(p.children, rolePerms);
|
|
723
|
-
}
|
|
724
|
-
});
|
|
725
|
-
},
|
|
726
|
-
// 判断角色拥有的权限节点勾选
|
|
727
|
-
hasPerm (p, rolePerms) {
|
|
728
|
-
let flag = false;
|
|
729
|
-
for (let i = 0; i < rolePerms.length; i++) {
|
|
730
|
-
if (p.id === rolePerms[i].permissionId) {
|
|
731
|
-
flag = true;
|
|
732
|
-
break;
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
if (flag) {
|
|
736
|
-
return true;
|
|
737
|
-
}
|
|
738
|
-
return false;
|
|
739
|
-
},
|
|
740
|
-
// 全选反选
|
|
741
|
-
selectTreeAll () {
|
|
742
|
-
this.selectAllFlag = !this.selectAllFlag;
|
|
743
|
-
let select = this.selectAllFlag;
|
|
744
|
-
this.selectedTreeAll(this.permData, select);
|
|
745
|
-
},
|
|
746
|
-
// 递归全选节点
|
|
747
|
-
selectedTreeAll (permData, select) {
|
|
748
|
-
let that = this;
|
|
749
|
-
permData.forEach(function (e) {
|
|
750
|
-
e.checked = select;
|
|
751
|
-
if (!select) {
|
|
752
|
-
e.indeterminate = false;
|
|
753
|
-
}
|
|
754
|
-
if (e.children && e.children.length > 0) {
|
|
755
|
-
that.selectedTreeAll(e.children, select);
|
|
756
|
-
}
|
|
757
|
-
});
|
|
758
|
-
},
|
|
759
|
-
async submitPermEdit () {
|
|
760
|
-
let curVm = this;
|
|
761
|
-
this.submitPermLoading = true;
|
|
762
|
-
let permMenuIds = "";
|
|
763
|
-
let selectedNodes = this.selectedNodes.concat(this.halfSelectedNodes);
|
|
764
|
-
permMenuIds = selectedNodes.join(",");
|
|
765
|
-
// 所有菜单项
|
|
766
|
-
// 所有菜单窗口按钮
|
|
767
|
-
let permMenuBtnIds = {};
|
|
768
|
-
Object.keys(curVm.roleSavedBtnPermMap).forEach(function (key) {
|
|
769
|
-
permMenuBtnIds["W_" + key] = curVm.roleSavedBtnPermMap[key];
|
|
770
|
-
});
|
|
771
|
-
this.axios
|
|
772
|
-
.post(
|
|
773
|
-
"/rolePermissionsSetting/setMenus",
|
|
774
|
-
this.$qs.stringify({
|
|
775
|
-
roleId: this.editRolePermId,
|
|
776
|
-
ids: permMenuIds,
|
|
777
|
-
btns: JSON.stringify(permMenuBtnIds),
|
|
778
|
-
}),
|
|
779
|
-
)
|
|
780
|
-
.then((response) => {
|
|
781
|
-
this.submitPermLoading = false;
|
|
782
|
-
if (response.data.result) {
|
|
783
|
-
this.$message.success("操作成功");
|
|
784
|
-
this.getDataList();
|
|
785
|
-
this.permModalVisible = false;
|
|
786
|
-
this.cancelPermEdit();
|
|
787
|
-
} else {
|
|
788
|
-
this.$message.error(response.data.msg);
|
|
789
|
-
}
|
|
790
|
-
});
|
|
791
|
-
},
|
|
792
|
-
cancelPermEdit () {
|
|
793
|
-
this.selectedKeys = [];
|
|
794
|
-
this.expandedKeys = [];
|
|
795
|
-
this.selectedNodes = [];
|
|
796
|
-
this.halfSelectedNodes = [];
|
|
797
|
-
this.$nextTick(() => {
|
|
798
|
-
this.permModalVisible = false;
|
|
799
|
-
this.resetBtnPerData();
|
|
800
|
-
});
|
|
801
|
-
},
|
|
802
|
-
},
|
|
803
|
-
mounted () {
|
|
804
|
-
this.maxHeight = Number(document.documentElement.clientHeight - 121) + "px";
|
|
805
|
-
this.init();
|
|
806
|
-
},
|
|
807
|
-
};
|