sasp-admin 0.2.63 → 0.2.64
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/index.js +38 -31
- package/package.json +1 -1
- package/router.js +5 -1
- package/src/assets/font/iconfont.css +1902 -1846
- package/src/assets/font/iconfont.eot +0 -0
- package/src/assets/font/iconfont.js +1 -1
- package/src/assets/font/iconfont.svg +959 -825
- package/src/assets/font/iconfont.ttf +0 -0
- package/src/assets/font/iconfont.woff +0 -0
- package/src/assets/js/api/apiAdmin.js +10 -0
- package/src/assets/js/global/dataGlobal.js +7 -3
- package/src/assets/js/global/userGlobal.js +9 -3
- package/src/components/complexViewRendering.vue +214 -198
- package/src/components/ifmLink.vue +20 -3
- package/src/components/public/data/plDataSelect.vue +8 -6
- package/src/components/public/org/sysOrgPosUserSelect.vue +56 -17
- package/src/components/public/upload/images/ofd.png +0 -0
- package/src/components/public/upload/plImage.vue +3 -1
- package/src/components/public/upload/plUpload.vue +167 -40
- package/src/components/public/upload/preview/OfdPreview.vue +223 -0
- package/src/components/public/upload/preview/officeViewer.vue +116 -0
- package/src/components/public/upload/preview/pdfPreview.vue +91 -0
- package/src/{views → components/public/upload}/preview/pdfViewer.vue +1 -1
- package/src/views/VueMenuView.vue +11 -13
- package/src/views/data/dataManage.vue +51 -5
- package/src/views/event/eventManager/vueEventDiy.vue +4 -6
- package/src/views/log/loginlog/logManageDevOrSup.vue +8 -5
- package/src/views/log/loginlog/logManageEnt.vue +96 -55
- package/src/views/log/loginlog/logManageGov.vue +8 -5
- package/src/views/menu/component/menuManageComponent.vue +3 -5
- package/src/views/menuRouter/menuView.vue +226 -117
- package/src/views/menuRouter/urlMenuRouter.vue +13 -16
- package/src/views/org/entOrgTree.vue +1 -3
- package/src/views/org/js/sysOrgUserDetailMixins.js +646 -0
- package/src/views/org/sysEntOrgUserDetail.vue +10 -632
- package/src/views/org/sysOrgDimension.vue +4 -8
- package/src/views/org/sysOrgPosUserDetail.vue +4 -619
- package/src/views/org/sysOrgTree.vue +2 -4
- package/src/views/param/sysParam.vue +2 -0
- package/src/views/resources/resRouter/resView.vue +9 -11
- package/src/views/resources/tabs/comp/pageResRegister.vue +3 -5
- package/src/views/resources/tabs/dataResources.vue +3 -1
- package/src/views/resources/tabs/pageResources.vue +3 -1
- package/src/views/role/authRole/component/allocateSetting.vue +2 -589
- package/src/views/role/authRole/component/authSetting.vue +2 -597
- package/src/views/role/authRole/component/js/authMixins.js +622 -0
- package/src/views/role/commonRole/commonRole.vue +122 -3
- package/src/views/role/commonRole/compoment/commonSetting.vue +4 -6
- package/src/views/role/commonRole/compoment/commonSettingAdjust.vue +2 -89
- package/src/views/role/commonRole/compoment/commonSettingNew.vue +13 -97
- package/src/views/role/commonRole/compoment/js/commonSettingMixins.js +90 -0
- package/src/views/role/commonRole/compoment/roleMenuPower.vue +17 -2
- package/src/views/role/commonRole/compoment/roleMenuSetting.vue +12 -5
- package/src/views/sms/sendSms.vue +1 -1
- package/src/views/threeinone/init/safeInitRegion.vue +2 -4
- package/src/views/threeinone/safeManager.vue +1 -0
- package/src/views/threeinone/safeOrgSpv.vue +360 -337
- package/src/views/threeinone/safeSpvEconView.vue +37 -17
- package/src/views/uploadManage/uploadManage.vue +133 -0
- package/src/views/user/empowerUser/empowerUserListViewMenuTree.vue +6 -2
- package/src/views/user/stationUserManage.vue +3 -5
- package/src/views/user/userManage.vue +99 -3
- package/src/views/user/userMangement.vue +4 -6
|
@@ -0,0 +1,646 @@
|
|
|
1
|
+
const sysOrgUserDetailMixins = {
|
|
2
|
+
props: {
|
|
3
|
+
orgId: {type: String, default: ''},
|
|
4
|
+
orgDim: {type: String, default: ''},
|
|
5
|
+
orgObjReal: {
|
|
6
|
+
type: Object, default: function () {
|
|
7
|
+
return {}
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
orgTypeObj: {
|
|
11
|
+
type: Object, default: function () {
|
|
12
|
+
return {}
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
areaOptions: {
|
|
16
|
+
type: Array,
|
|
17
|
+
default: () => {
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
pageSetting: {
|
|
22
|
+
type: Object, default: function () {
|
|
23
|
+
return {}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
areaSetting: {
|
|
27
|
+
type: Boolean, default: true
|
|
28
|
+
},
|
|
29
|
+
useRefresh: {
|
|
30
|
+
type: Boolean, default: false
|
|
31
|
+
},
|
|
32
|
+
refreshOrgId: {
|
|
33
|
+
type: Boolean, default: false
|
|
34
|
+
},
|
|
35
|
+
updateCallBack: {type: Function, default: null},
|
|
36
|
+
sysDataObj: {
|
|
37
|
+
type: Object, default: () => {
|
|
38
|
+
return {};
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
orgTreeData: {
|
|
42
|
+
type: Array, default: () => {
|
|
43
|
+
return []
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
},
|
|
48
|
+
data() {
|
|
49
|
+
return {
|
|
50
|
+
cascadeOptions: [], // 地区选项
|
|
51
|
+
cascadeOptionsClone: [],
|
|
52
|
+
activeTabs: '1',
|
|
53
|
+
activeName: ['0'], // 默认不激活组织信息吧,如果想默认展开就设为1
|
|
54
|
+
activePosName: ['1'], // 默认激活岗位信息
|
|
55
|
+
dimObj: {}, // id与纬度名称对应关系
|
|
56
|
+
chooseUserDialog: false,
|
|
57
|
+
formOrgName: "", // 当前组织的名称
|
|
58
|
+
orgClassifyArr: [{value: '0', label: '普通部门'}, {value: '1', label: '处室'}, {
|
|
59
|
+
value: '2',
|
|
60
|
+
label: '安监局'
|
|
61
|
+
}],
|
|
62
|
+
classify: "", // 部门分类
|
|
63
|
+
userTypeMap: {
|
|
64
|
+
'ent': '企业用户', 'gov': '政府用户',
|
|
65
|
+
'sup': '开发用户', 'dev': '开发用户',
|
|
66
|
+
},
|
|
67
|
+
userStatusMap: {
|
|
68
|
+
10: "正常", 20: "锁定", 30: "暂时锁定"
|
|
69
|
+
},
|
|
70
|
+
entDim: "",
|
|
71
|
+
sysEntDim: "",
|
|
72
|
+
orderDialog: false, // 排序对话框
|
|
73
|
+
posUserArr: [], // 岗位用户排序数组
|
|
74
|
+
userTypeOptions: [], // 用户类型下拉框
|
|
75
|
+
typeOptions: [], // 所有用户类型
|
|
76
|
+
addUserDialog: false, // 添加用户对话框
|
|
77
|
+
addUserForm: {},
|
|
78
|
+
statusOptions: [
|
|
79
|
+
{value: '10', label: "正常"},
|
|
80
|
+
{value: '20', label: "锁定"}
|
|
81
|
+
], // 用户状态下拉框
|
|
82
|
+
updateOrder: true, // 是调整用户顺序还是选择用户时添加数据
|
|
83
|
+
posTreeParam: {
|
|
84
|
+
"order": "PARENT_POS_ID,SORT",
|
|
85
|
+
"orgId": "$"
|
|
86
|
+
},
|
|
87
|
+
posTreeProper: {'label': 'name', 'children': 'children'},
|
|
88
|
+
posBaseForm: {}, // 岗位基本信息
|
|
89
|
+
posId: "", // 当前选择的岗位id
|
|
90
|
+
setPos: false, // 当前从用户列表选择的是岗位还是组织
|
|
91
|
+
menuVisible: false, // 右击菜单出现的办法
|
|
92
|
+
addPosDialog: false, // 添加岗位的对话框
|
|
93
|
+
addPosForm: {}, // 添加岗位的表单数据
|
|
94
|
+
orgLocation: null, // 组织所在地区
|
|
95
|
+
loading: false,
|
|
96
|
+
top: 0,
|
|
97
|
+
left: 0,
|
|
98
|
+
parentPosTree: [], // 上级岗位树
|
|
99
|
+
manyOrg: false, // 一人多岗
|
|
100
|
+
multipleSelection: [],
|
|
101
|
+
multipleSelectionIds: [],
|
|
102
|
+
createPushRoleArr: [], // 推送角色
|
|
103
|
+
orgObj: {}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
methods: {
|
|
107
|
+
commonInit() {
|
|
108
|
+
let vm = this;
|
|
109
|
+
this.orgObj = this.orgObjReal || {};
|
|
110
|
+
document.onkeyup = function (e) { // 右键菜单快捷键
|
|
111
|
+
if (vm.menuVisible) {
|
|
112
|
+
let key = e.key.toLowerCase();
|
|
113
|
+
switch (key) {
|
|
114
|
+
case "a":
|
|
115
|
+
vm.menuVisible = false;
|
|
116
|
+
vm.handleRightSelect('addChild');
|
|
117
|
+
break;
|
|
118
|
+
case "c":
|
|
119
|
+
vm.menuVisible = false;
|
|
120
|
+
vm.handleRightSelect('addSame');
|
|
121
|
+
break;
|
|
122
|
+
case "r":
|
|
123
|
+
vm.menuVisible = false;
|
|
124
|
+
vm.handleRightSelect('removeCurrent');
|
|
125
|
+
break;
|
|
126
|
+
case "d":
|
|
127
|
+
vm.menuVisible = false;
|
|
128
|
+
vm.handleRightSelect('removeCheck');
|
|
129
|
+
break;
|
|
130
|
+
default:
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
vm.axios.post(vm.api.sysOrgDimension.find).then(function (res) {
|
|
136
|
+
res.data.forEach(function (dimension) {
|
|
137
|
+
vm.dimObj[dimension["id"]] = dimension["dimName"];
|
|
138
|
+
})
|
|
139
|
+
});
|
|
140
|
+
vm.axios.post(vm.api.param.getSysParams, {"key": "entDim"}).then(function (res) {
|
|
141
|
+
vm.entDim = res.data["entDim"];
|
|
142
|
+
vm.axios.post(vm.api.param.getSysParams, {"key": "sysEntDim.id"}).then(function (paramRes) {
|
|
143
|
+
vm.sysEntDim = paramRes.data["sysEntDim.id"];
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
vm.axios.post(vm.api.param.getSysParams, {"key": "manyOrg"}).then(function (res) {
|
|
147
|
+
let resData = res.data || {};
|
|
148
|
+
vm.manyOrg = resData["manyOrg"] == "是";
|
|
149
|
+
});
|
|
150
|
+
vm.axios.post(vm.api.param.getSysParams, {key: "SysUserType"}).then(function (res) { // 是否可以修改用户详情,获取用户的类型
|
|
151
|
+
let result = res.data;
|
|
152
|
+
if (typeof (result) != Object && typeof (result) != "object") {
|
|
153
|
+
result = JSON.parse(result.replace(/'/g, '"'));
|
|
154
|
+
}
|
|
155
|
+
for (let [key, value] of Object.entries(result)) {
|
|
156
|
+
vm.typeOptions.push({"label": value, "value": key})
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
},
|
|
160
|
+
initCreatePushRole() {
|
|
161
|
+
let loginUser = this.USER_GLOBAL.getLoginUser() || {};
|
|
162
|
+
this.axios.post(this.api.role.find, {"created": loginUser.id, "pushRole": "1"}).then(res => {
|
|
163
|
+
this.createPushRoleArr = res.data || [];
|
|
164
|
+
})
|
|
165
|
+
},
|
|
166
|
+
buildParentTree() {
|
|
167
|
+
let vm = this;
|
|
168
|
+
vm.parentPosTree = [];
|
|
169
|
+
if (vm.orgObj.orgParentTree) {
|
|
170
|
+
vm.axios.post(vm.api.sysPos.find, {"parentPosIds": vm.orgObj.orgParentTree}).then(res => {
|
|
171
|
+
let arr = [];
|
|
172
|
+
(res.data || []).forEach(item => {
|
|
173
|
+
arr.push({
|
|
174
|
+
"id": item.id,
|
|
175
|
+
"label": item.posName,
|
|
176
|
+
"parentId": item.parentPosId
|
|
177
|
+
})
|
|
178
|
+
});
|
|
179
|
+
vm.parentPosTree = vm.COMMON_FUNC.buildElTree(arr);
|
|
180
|
+
|
|
181
|
+
//递归去除
|
|
182
|
+
function clearTreeChildren(parentPosTreeArr) {
|
|
183
|
+
(parentPosTreeArr || []).forEach(item => {
|
|
184
|
+
if (item.children) {
|
|
185
|
+
if (item.children.length == 0) {
|
|
186
|
+
delete item['children'];
|
|
187
|
+
} else {
|
|
188
|
+
clearTreeChildren(item.children);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
})
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
clearTreeChildren(vm.parentPosTree);
|
|
195
|
+
})
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
formatterColumn(row, column, cellValue) { // 格式化列
|
|
199
|
+
let vm = this;
|
|
200
|
+
if (column.property == 'userType') {
|
|
201
|
+
return vm.userTypeMap[cellValue];
|
|
202
|
+
} else if (column.property == 'userStatus') {
|
|
203
|
+
return vm.userStatusMap[cellValue];
|
|
204
|
+
} else {
|
|
205
|
+
return cellValue;
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
/**
|
|
209
|
+
* 岗位信息
|
|
210
|
+
*/
|
|
211
|
+
posTreeCallBack(posTreeVm) { // 岗位初始化全部展开
|
|
212
|
+
let nodesMap = posTreeVm.getAllNode();
|
|
213
|
+
let chooseFirstData = {};
|
|
214
|
+
let chooseFirstNode = {};
|
|
215
|
+
if ((posTreeVm.data || []).length > 0) {
|
|
216
|
+
chooseFirstData = posTreeVm.data[0];
|
|
217
|
+
}
|
|
218
|
+
for (let [key, node] of Object.entries(nodesMap)) {
|
|
219
|
+
node.expanded = true;
|
|
220
|
+
if (chooseFirstData.id && node.data.id == chooseFirstData.id) {
|
|
221
|
+
chooseFirstNode = node;
|
|
222
|
+
node.isCurrent = true;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (chooseFirstData.id) {
|
|
226
|
+
this.posNodeClick(chooseFirstData, chooseFirstNode);
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
posDealTree(data) {
|
|
230
|
+
let vm = this;
|
|
231
|
+
data.forEach(function (pos) {
|
|
232
|
+
pos["name"] = pos["posName"];
|
|
233
|
+
if (pos["isMainpos"] === '1') {
|
|
234
|
+
pos["name"] = pos["posName"] + "[主岗位]";
|
|
235
|
+
pos["className"] = vm.pageSetting["posMainIcon"] || "saspiconfont pl-icon-yonghu";
|
|
236
|
+
} else {
|
|
237
|
+
pos["className"] = vm.pageSetting["posIcon"] || "saspiconfont pl-icon-account";
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
},
|
|
241
|
+
posNodeClick(data, node) { // 岗位树节点点击事件
|
|
242
|
+
let vm = this;
|
|
243
|
+
vm.posId = data.id;
|
|
244
|
+
vm.posBaseForm = Object.assign({}, data);
|
|
245
|
+
if (!vm.posBaseForm || vm.posBaseForm.parentPosId == '-1') {
|
|
246
|
+
vm.posBaseForm.parentPosId = null;
|
|
247
|
+
}
|
|
248
|
+
vm.menuVisible = false;
|
|
249
|
+
},
|
|
250
|
+
posTreeRightClick(event, data, node) {
|
|
251
|
+
let vm = this;
|
|
252
|
+
let expand = node.expanded;
|
|
253
|
+
let target = window.event.target;
|
|
254
|
+
if (target.tagName === 'DIV') {
|
|
255
|
+
target.click(); // 右键时点击当前节点
|
|
256
|
+
} else {
|
|
257
|
+
let pNode = target.parentNode;
|
|
258
|
+
if (target.className === 'el-checkbox__inner') { // 右击checkBox
|
|
259
|
+
pNode.parentNode.parentNode.click();
|
|
260
|
+
} else { // 右击下拉图标
|
|
261
|
+
pNode.click();
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
node.expanded = expand; // 右击仅选中当前节点保持当前节点展开情况不变
|
|
265
|
+
if (vm.objectID !== data.id) {
|
|
266
|
+
vm.objectID = data.id;
|
|
267
|
+
vm.menuVisible = true;
|
|
268
|
+
} else {
|
|
269
|
+
vm.menuVisible = !vm.menuVisible;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
vm.left = window.event.clientX + "px";
|
|
273
|
+
vm.top = window.event.clientY + "px";
|
|
274
|
+
},
|
|
275
|
+
savePos() { // 保存岗位数据addPosForm
|
|
276
|
+
let vm = this;
|
|
277
|
+
vm.$refs.addPosRef.validate(function (valid) {
|
|
278
|
+
if (valid) {
|
|
279
|
+
if (vm.addPosForm.isMainpos == "1") { // 设置为主岗位时检索当前组织下是否有主岗位
|
|
280
|
+
vm.axios.post(vm.api.sysPos.find, {
|
|
281
|
+
"orgId": vm.orgId,
|
|
282
|
+
"isMainpos": "1"
|
|
283
|
+
}).then(function (res) {
|
|
284
|
+
let result = res.data;
|
|
285
|
+
if ((result || []).length > 0 && result[0].id !== vm.addPosForm.id) {
|
|
286
|
+
let msg = "目前此组织内已存在主岗位[" + result[0].posName + "],是否确定设置此岗位为主岗位(系统会自动把[" + result[0].posName + "]设置为普通岗位)?";
|
|
287
|
+
vm.$confirm(msg, '警告', {
|
|
288
|
+
confirmButtonText: '确定',
|
|
289
|
+
cancelButtonText: '取消',
|
|
290
|
+
}).then(async function () {
|
|
291
|
+
vm.addPosDialog = false;
|
|
292
|
+
await vm.axios.post(vm.api.sysPos.update, {
|
|
293
|
+
"id": result[0].id,
|
|
294
|
+
"isMainpos": "0"
|
|
295
|
+
});
|
|
296
|
+
vm.addPosData();
|
|
297
|
+
}).catch(() => {
|
|
298
|
+
vm.$message({
|
|
299
|
+
duration: 1000,
|
|
300
|
+
type: 'info',
|
|
301
|
+
message: '已取消'
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
} else {
|
|
305
|
+
vm.addPosDialog = false;
|
|
306
|
+
vm.addPosData();
|
|
307
|
+
}
|
|
308
|
+
})
|
|
309
|
+
} else {
|
|
310
|
+
vm.addPosDialog = false;
|
|
311
|
+
vm.addPosData();
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
})
|
|
315
|
+
},
|
|
316
|
+
addPosData() { // 添加岗位数据
|
|
317
|
+
let vm = this;
|
|
318
|
+
if (!vm.addPosForm.parentPosId) {
|
|
319
|
+
vm.addPosForm.parentPosId = '-1';
|
|
320
|
+
}
|
|
321
|
+
vm.axios.post(vm.api.sysPos.add, vm.addPosForm).then(function (res) {
|
|
322
|
+
vm.$message({
|
|
323
|
+
duration: 1200,
|
|
324
|
+
message: res.data.operateMessage,
|
|
325
|
+
type: "success"
|
|
326
|
+
});
|
|
327
|
+
vm.$refs.posTreeRef.init();
|
|
328
|
+
})
|
|
329
|
+
},
|
|
330
|
+
handleRightSelect(key) {
|
|
331
|
+
let vm = this;
|
|
332
|
+
switch (key) {
|
|
333
|
+
case "addChild":
|
|
334
|
+
case "addSame":
|
|
335
|
+
vm.addNode(key);
|
|
336
|
+
break;
|
|
337
|
+
case "removeCurrent":
|
|
338
|
+
vm.removeCurrentNode();
|
|
339
|
+
break;
|
|
340
|
+
case "removeCheck":
|
|
341
|
+
vm.removeNode();
|
|
342
|
+
break;
|
|
343
|
+
default:
|
|
344
|
+
console.log("未检测到当前操作的对应方法!");
|
|
345
|
+
break;
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
addNode(key) { // addPosForm
|
|
349
|
+
let vm = this;
|
|
350
|
+
if (!vm.orgId || vm.orgId == "$") {
|
|
351
|
+
vm.$message("请选择左侧组织后继续操作!");
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
vm.addPosForm = {"isMainpos": "0"};
|
|
355
|
+
key = key ? key : "addChild";
|
|
356
|
+
let data = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
357
|
+
vm.addPosForm["orgId"] = vm.orgId;
|
|
358
|
+
vm.addPosForm["orgName"] = vm.orgObj["orgName"];
|
|
359
|
+
if (key == "addChild") {
|
|
360
|
+
if (!data) { // 直接添加未选择任何节点,默认第一级
|
|
361
|
+
vm.addPosForm["parentPosId"] = null;
|
|
362
|
+
vm.addPosForm["parentPosTree"] = "-1";
|
|
363
|
+
vm.addPosForm["layer"] = "1";
|
|
364
|
+
} else {
|
|
365
|
+
vm.addPosForm["parentPosId"] = data.id;
|
|
366
|
+
vm.addPosForm["parentPosTree"] = data["parentPosTree"] + "," + data["id"];
|
|
367
|
+
vm.addPosForm["parentPosName"] = data.posName;
|
|
368
|
+
vm.addPosForm["layer"] = Number(data["layer"]) + 1;
|
|
369
|
+
}
|
|
370
|
+
vm.addPosForm["sort"] = vm.getMaxOrder("child");
|
|
371
|
+
} else { // 添加同级数据
|
|
372
|
+
vm.addPosForm["parentPosId"] = data["parentPosId"];
|
|
373
|
+
if (vm.addPosForm["parentPosId"] == "-1") {
|
|
374
|
+
vm.addPosForm["parentPosId"] = null;
|
|
375
|
+
}
|
|
376
|
+
vm.addPosForm["parentPosTree"] = data["parentPosTree"];
|
|
377
|
+
vm.addPosForm["parentPosName"] = data.parentPosName;
|
|
378
|
+
vm.addPosForm["layer"] = data["layer"];
|
|
379
|
+
vm.addPosForm["sort"] = vm.getMaxOrder("same");
|
|
380
|
+
}
|
|
381
|
+
vm.addPosDialog = true;
|
|
382
|
+
vm.$nextTick(function () {
|
|
383
|
+
vm.$refs.addPosRef.clearValidate();
|
|
384
|
+
})
|
|
385
|
+
},
|
|
386
|
+
getMaxOrder(type) {
|
|
387
|
+
let vm = this;
|
|
388
|
+
let currentNode = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
389
|
+
let sort = 1;
|
|
390
|
+
let arr = [];
|
|
391
|
+
if (type == "same") {
|
|
392
|
+
let nodesMap = vm.$refs.posTreeRef.getAllNode();
|
|
393
|
+
if (!currentNode.parentPosId || currentNode.parentPosId == "-1") {
|
|
394
|
+
for (let [key, node] of Object.entries(nodesMap)) {
|
|
395
|
+
if (node.level == 1) {
|
|
396
|
+
arr.push(node.data);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
} else {
|
|
400
|
+
// 是下级
|
|
401
|
+
if (nodesMap[currentNode.parentPosId]) {
|
|
402
|
+
arr = nodesMap[currentNode.parentPosId].data.children;
|
|
403
|
+
} else { // 第一级
|
|
404
|
+
Object.keys(nodesMap).forEach(key => {
|
|
405
|
+
if (nodesMap[key].level == 1) {
|
|
406
|
+
arr.push(nodesMap[key].data);
|
|
407
|
+
}
|
|
408
|
+
})
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
if (type == "child") {
|
|
413
|
+
arr = (currentNode || {}).children;
|
|
414
|
+
}
|
|
415
|
+
(arr || []).forEach(function (each) {
|
|
416
|
+
sort = sort > Number(each["sort"]) ? sort : Number(each["sort"]);
|
|
417
|
+
});
|
|
418
|
+
return ++sort;
|
|
419
|
+
},
|
|
420
|
+
removeCurrentNode() { // 删除当前节点
|
|
421
|
+
let vm = this;
|
|
422
|
+
vm.$confirm('确定删除当前节点?', '警告', {
|
|
423
|
+
confirmButtonText: '确定',
|
|
424
|
+
cancelButtonText: '取消',
|
|
425
|
+
}).then(function () {
|
|
426
|
+
let currentNode = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
427
|
+
let removeNodeArr = vm.$refs.posTreeRef.getCurrentChildren(currentNode, []);
|
|
428
|
+
vm.axios.post(vm.api.sysPos.delete, {"ids": removeNodeArr.join(",")}).then(function (res) {
|
|
429
|
+
if (res.data.operateSuccess) {
|
|
430
|
+
vm.$refs.posTreeRef.defaultTreeRemove(removeNodeArr.join(","));
|
|
431
|
+
//同步修改下级岗位中
|
|
432
|
+
vm.axios.post(vm.api.sysPos.updateParentPos, {"parentPosIds": removeNodeArr.join(",")});
|
|
433
|
+
|
|
434
|
+
}
|
|
435
|
+
vm.$message({
|
|
436
|
+
duration: 1000,
|
|
437
|
+
type: 'success',
|
|
438
|
+
message: res.data.operateMessage
|
|
439
|
+
}
|
|
440
|
+
);
|
|
441
|
+
});
|
|
442
|
+
}).catch(function () {
|
|
443
|
+
vm.$message({
|
|
444
|
+
duration: 1000,
|
|
445
|
+
type: 'info',
|
|
446
|
+
message: '已取消'
|
|
447
|
+
});
|
|
448
|
+
});
|
|
449
|
+
},
|
|
450
|
+
removeNode() { // 刪除勾選節點
|
|
451
|
+
let vm = this;
|
|
452
|
+
let removeArr = vm.$refs.posTreeRef.getTreeCheckedNodes("key");
|
|
453
|
+
if (removeArr.length == 0) {
|
|
454
|
+
vm.$message("请勾选需要删除的节点!");
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
vm.$confirm('确定删除已勾选节点?', '警告', {
|
|
458
|
+
confirmButtonText: '确定',
|
|
459
|
+
cancelButtonText: '取消',
|
|
460
|
+
}).then(function () {
|
|
461
|
+
vm.loading = true;
|
|
462
|
+
vm.axios.post(vm.api.sysPos.delete, {"ids": removeArr.join(",")}).then(function (res) {
|
|
463
|
+
if (res.data.operateSuccess) {
|
|
464
|
+
vm.$refs.posTreeRef.defaultTreeRemove(removeArr.join(","));
|
|
465
|
+
}
|
|
466
|
+
vm.loading = false;
|
|
467
|
+
vm.$message({
|
|
468
|
+
duration: 1000,
|
|
469
|
+
type: 'success',
|
|
470
|
+
message: res.data.operateMessage
|
|
471
|
+
}
|
|
472
|
+
);
|
|
473
|
+
vm.init();
|
|
474
|
+
})
|
|
475
|
+
}).catch(function () {
|
|
476
|
+
vm.$message({
|
|
477
|
+
duration: 1000,
|
|
478
|
+
type: 'info',
|
|
479
|
+
message: '已取消'
|
|
480
|
+
});
|
|
481
|
+
});
|
|
482
|
+
},
|
|
483
|
+
updatePosInfo() { // 更新岗位信息
|
|
484
|
+
let vm = this;
|
|
485
|
+
if (!vm.posId) {
|
|
486
|
+
vm.$message("请选择左侧岗位后再操作!");
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
vm.$refs.posBaseRef.validate(function (valid) {
|
|
490
|
+
if (valid) {
|
|
491
|
+
if (vm.posBaseForm.isMainpos == "1") { // 设置为主岗位时检索当前组织下是否有主岗位
|
|
492
|
+
vm.axios.post(vm.api.sysPos.find, {
|
|
493
|
+
"orgId": vm.orgId,
|
|
494
|
+
"isMainpos": "1"
|
|
495
|
+
}).then(function (res) {
|
|
496
|
+
let result = res.data;
|
|
497
|
+
if ((result || []).length > 0 && result[0].id != vm.posBaseForm.id) {
|
|
498
|
+
let msg = "目前此组织内已存在主岗位[" + result[0].posName + "],是否确定设置此岗位为主岗位(系统会自动把[" + result[0].posName + "]设置为普通岗位)?";
|
|
499
|
+
vm.$confirm(msg, '警告', {
|
|
500
|
+
confirmButtonText: '确定',
|
|
501
|
+
cancelButtonText: '取消',
|
|
502
|
+
}).then(function () {
|
|
503
|
+
vm.submitPosForm();
|
|
504
|
+
vm.axios.post(vm.api.sysPos.update, {
|
|
505
|
+
"id": result[0].id,
|
|
506
|
+
"isMainpos": "0"
|
|
507
|
+
});
|
|
508
|
+
let nodesMap = vm.$refs.posTreeRef.getAllNode();
|
|
509
|
+
let oldMainPosData = nodesMap[result[0].id].data;
|
|
510
|
+
oldMainPosData.isMainpos = "0"; // 修改树中的数据
|
|
511
|
+
oldMainPosData["name"] = oldMainPosData["posName"]; // 修改树中的数据
|
|
512
|
+
oldMainPosData["className"] = vm.pageSetting["posIcon"] || "saspiconfont pl-icon-account";
|
|
513
|
+
}).catch(() => {
|
|
514
|
+
vm.$message({
|
|
515
|
+
duration: 1000,
|
|
516
|
+
type: 'info',
|
|
517
|
+
message: '已取消'
|
|
518
|
+
});
|
|
519
|
+
});
|
|
520
|
+
} else {
|
|
521
|
+
vm.submitPosForm();
|
|
522
|
+
}
|
|
523
|
+
})
|
|
524
|
+
} else {
|
|
525
|
+
vm.submitPosForm();
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
},
|
|
530
|
+
posRemoveSuc() {
|
|
531
|
+
this.posBaseForm = {};
|
|
532
|
+
},
|
|
533
|
+
submitPosForm() { // 提交岗位表单数据
|
|
534
|
+
let vm = this;
|
|
535
|
+
let obj = {};
|
|
536
|
+
obj["id"] = vm.posBaseForm["id"];
|
|
537
|
+
obj["posName"] = vm.posBaseForm["posName"];
|
|
538
|
+
obj["isMainpos"] = vm.posBaseForm["isMainpos"];
|
|
539
|
+
obj["parentPosId"] = vm.posBaseForm["parentPosId"] || "-1";
|
|
540
|
+
vm.axios.post(vm.api.sysPos.update, obj).then(function (res) {
|
|
541
|
+
vm.$message({
|
|
542
|
+
duration: 1200,
|
|
543
|
+
message: res.data.operateMessage,
|
|
544
|
+
type: "success"
|
|
545
|
+
});
|
|
546
|
+
if (obj["isMainpos"] == "1") {
|
|
547
|
+
obj["name"] = obj["posName"] + "[主岗位]";
|
|
548
|
+
} else {
|
|
549
|
+
obj["name"] = obj["posName"];
|
|
550
|
+
}
|
|
551
|
+
let currentNode = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
552
|
+
for (let [key, value] of Object.entries(obj)) { // 更新树中的数据
|
|
553
|
+
currentNode[key] = value;
|
|
554
|
+
}
|
|
555
|
+
if (obj["isMainpos"] == "1") {
|
|
556
|
+
currentNode["className"] = vm.pageSetting["posMainIcon"] || "saspiconfont pl-icon-yonghu";
|
|
557
|
+
} else {
|
|
558
|
+
currentNode["className"] = vm.pageSetting["posIcon"] || "saspiconfont pl-icon-account";
|
|
559
|
+
}
|
|
560
|
+
})
|
|
561
|
+
},
|
|
562
|
+
addMainPosChange(value) {
|
|
563
|
+
let vm = this;
|
|
564
|
+
if (value == '1' && vm.addPosForm.layer != '1') {
|
|
565
|
+
vm.$message("非一级岗位不能设置为主岗位!");
|
|
566
|
+
vm.addPosForm.isMainpos = "0";
|
|
567
|
+
}
|
|
568
|
+
},
|
|
569
|
+
mainPosChange(value) { // 主岗位变化时判断是否可以进行变更
|
|
570
|
+
let vm = this;
|
|
571
|
+
let currentNode = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
572
|
+
if (!currentNode) { // 未选择树,不操作
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
if (value == "1" && currentNode.layer != '1') {
|
|
576
|
+
vm.$message("非一级岗位不能设置为主岗位!");
|
|
577
|
+
vm.posBaseForm.isMainpos = "0";
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
activePosRow(row) {
|
|
581
|
+
this.activeRow(row, this.posCrud.tableRef);
|
|
582
|
+
},
|
|
583
|
+
activeUserRow(row) {
|
|
584
|
+
this.activeRow(row, this.userCrud.tableRef);
|
|
585
|
+
this.tableSelect([], row);
|
|
586
|
+
},
|
|
587
|
+
activeRow(row, ref) { // 行点击选中当前行
|
|
588
|
+
this.$refs[ref].toggleRowSelection(row);
|
|
589
|
+
},
|
|
590
|
+
//复选框选中/取消事件
|
|
591
|
+
tableSelect(selection, row) {
|
|
592
|
+
if (this.multipleSelection.length > 0) {
|
|
593
|
+
let index = this.multipleSelectionIds.indexOf(row.id);
|
|
594
|
+
if (this.multipleSelectionIds.indexOf(row.id) == -1) {
|
|
595
|
+
this.multipleSelection.push(row);
|
|
596
|
+
this.multipleSelectionIds.push(row.id);
|
|
597
|
+
} else {
|
|
598
|
+
this.multipleSelectionIds.splice(index, 1);
|
|
599
|
+
this.multipleSelection.splice(index, 1);
|
|
600
|
+
}
|
|
601
|
+
} else {
|
|
602
|
+
this.multipleSelection.push(row);
|
|
603
|
+
this.multipleSelectionIds.push(row.id);
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
userSelectAll(selection) {
|
|
607
|
+
var vm = this;
|
|
608
|
+
var rows = vm.userCrud.dataStore.records;
|
|
609
|
+
if (selection.length > 0) {
|
|
610
|
+
//全选
|
|
611
|
+
selection.forEach(item => {
|
|
612
|
+
this.userSelectAllPush(item);
|
|
613
|
+
});
|
|
614
|
+
} else {
|
|
615
|
+
//取消全选
|
|
616
|
+
rows.forEach(item => {
|
|
617
|
+
this.userSelectAllCancel(item);
|
|
618
|
+
})
|
|
619
|
+
}
|
|
620
|
+
},
|
|
621
|
+
userSelectAllPush(row) {
|
|
622
|
+
if (this.multipleSelectionIds.indexOf(row.id) == -1) {
|
|
623
|
+
this.multipleSelection.push(row);
|
|
624
|
+
this.multipleSelectionIds.push(row.id);
|
|
625
|
+
}
|
|
626
|
+
},
|
|
627
|
+
userSelectAllCancel(row) {
|
|
628
|
+
let index = this.multipleSelectionIds.indexOf(row.id);
|
|
629
|
+
if (this.multipleSelectionIds.indexOf(row.id) != -1) {
|
|
630
|
+
this.multipleSelectionIds.splice(index, 1);
|
|
631
|
+
this.multipleSelection.splice(index, 1);
|
|
632
|
+
}
|
|
633
|
+
},
|
|
634
|
+
userSearch() {
|
|
635
|
+
let vm = this;
|
|
636
|
+
vm.$nextTick(() => {
|
|
637
|
+
vm.userCrud.dataStore.records.forEach(item => {
|
|
638
|
+
if (vm.multipleSelectionIds.indexOf(item.id) > -1) {
|
|
639
|
+
vm.$refs[vm.userCrud.tableRef].toggleRowSelection(item);
|
|
640
|
+
}
|
|
641
|
+
})
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
export default sysOrgUserDetailMixins;
|