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
|
@@ -555,43 +555,10 @@
|
|
|
555
555
|
</template>
|
|
556
556
|
|
|
557
557
|
<script>
|
|
558
|
-
|
|
558
|
+
import sysOrgUserDetailMixins from './js/sysOrgUserDetailMixins'
|
|
559
559
|
export default {
|
|
560
560
|
name: "sys-org-pos-user-detail",
|
|
561
|
-
|
|
562
|
-
orgId: {type: String, default: ''},
|
|
563
|
-
orgDim: {type: String, default: ''},
|
|
564
|
-
orgObjReal: {
|
|
565
|
-
type: Object, default: function () {
|
|
566
|
-
return {}
|
|
567
|
-
}
|
|
568
|
-
},
|
|
569
|
-
orgTypeObj: {
|
|
570
|
-
type: Object, default: function () {
|
|
571
|
-
return {}
|
|
572
|
-
}
|
|
573
|
-
},
|
|
574
|
-
areaOptions: {
|
|
575
|
-
type:Array,
|
|
576
|
-
default:() => {return [];}
|
|
577
|
-
},
|
|
578
|
-
pageSetting: {
|
|
579
|
-
type: Object, default: function () {
|
|
580
|
-
return {}
|
|
581
|
-
}
|
|
582
|
-
},
|
|
583
|
-
areaSetting:{
|
|
584
|
-
type:Boolean,default:true
|
|
585
|
-
},
|
|
586
|
-
useRefresh:{
|
|
587
|
-
type:Boolean,default:false
|
|
588
|
-
},
|
|
589
|
-
refreshOrgId:{
|
|
590
|
-
type:Boolean,default:false
|
|
591
|
-
},
|
|
592
|
-
updateCallBack: {type: Function, default: null},
|
|
593
|
-
sysDataObj:{type:Object,default:() => {return {};}}
|
|
594
|
-
},
|
|
561
|
+
mixins: [sysOrgUserDetailMixins],
|
|
595
562
|
data() {
|
|
596
563
|
let vm = this;
|
|
597
564
|
let validUserRepeat = (rule, value, callback) => { // 重名验证
|
|
@@ -641,40 +608,6 @@
|
|
|
641
608
|
initNoSearch: true,
|
|
642
609
|
//afterRemoveSuccess:this.posRemoveSuc,
|
|
643
610
|
}),
|
|
644
|
-
cascadeOptions: [], // 地区选项
|
|
645
|
-
cascadeOptionsClone:[],
|
|
646
|
-
activeTabs: '1',
|
|
647
|
-
activeName: ['0'], // 默认不激活组织信息吧,如果想默认展开就设为1
|
|
648
|
-
activePosName: ['1'], // 默认激活岗位信息
|
|
649
|
-
dimObj: {}, // id与纬度名称对应关系
|
|
650
|
-
chooseUserDialog: false,
|
|
651
|
-
formOrgName: "", // 当前组织的名称
|
|
652
|
-
orgClassifyArr: [{value: '0', label: '普通部门'}, {value: '1', label: '处室'}, {value: '2', label: '安监局'}],
|
|
653
|
-
classify: "", // 部门分类
|
|
654
|
-
userTypeMap: {
|
|
655
|
-
'ent': '企业用户', 'gov': '政府用户',
|
|
656
|
-
'sup': '开发用户', 'dev': '开发用户',
|
|
657
|
-
},
|
|
658
|
-
userStatusMap: {
|
|
659
|
-
10: "正常", 20: "锁定", 30: "暂时锁定"
|
|
660
|
-
},
|
|
661
|
-
entDim: "",
|
|
662
|
-
sysEntDim: "",
|
|
663
|
-
orderDialog: false, // 排序对话框
|
|
664
|
-
posUserArr: [], // 岗位用户排序数组
|
|
665
|
-
userTypeOptions: [], // 用户类型下拉框
|
|
666
|
-
typeOptions: [], // 所有用户类型
|
|
667
|
-
addUserDialog: false, // 添加用户对话框
|
|
668
|
-
addUserForm: {},
|
|
669
|
-
statusOptions: [
|
|
670
|
-
{value: '10', label: "正常"},
|
|
671
|
-
{value: '20', label: "锁定"}
|
|
672
|
-
], // 用户状态下拉框
|
|
673
|
-
updateOrder: true, // 是调整用户顺序还是选择用户时添加数据
|
|
674
|
-
posTreeParam: {
|
|
675
|
-
"order": "PARENT_POS_ID,SORT",
|
|
676
|
-
"orgId": "$"
|
|
677
|
-
},
|
|
678
611
|
rules: {
|
|
679
612
|
userAccount: [
|
|
680
613
|
{
|
|
@@ -708,78 +641,12 @@
|
|
|
708
641
|
userType: this.plValidate('required'),
|
|
709
642
|
userQQ: this.plValidate('qq'),
|
|
710
643
|
userEmail: this.plValidate('email'),
|
|
711
|
-
}
|
|
712
|
-
posTreeProper: {'label': 'name','children':'children'},
|
|
713
|
-
posBaseForm: {}, // 岗位基本信息
|
|
714
|
-
posId: "", // 当前选择的岗位id
|
|
715
|
-
setPos: false, // 当前从用户列表选择的是岗位还是组织
|
|
716
|
-
menuVisible: false, // 右击菜单出现的办法
|
|
717
|
-
addPosDialog: false, // 添加岗位的对话框
|
|
718
|
-
addPosForm: {}, // 添加岗位的表单数据
|
|
719
|
-
orgLocation: null, // 组织所在地区
|
|
720
|
-
loading:false,
|
|
721
|
-
top:0,
|
|
722
|
-
left:0,
|
|
723
|
-
parentPosTree:[], // 上级岗位树
|
|
724
|
-
manyOrg:false, // 一人多岗
|
|
725
|
-
multipleSelection:[],
|
|
726
|
-
multipleSelectionIds:[],
|
|
727
|
-
createPushRoleArr:[], // 推送角色
|
|
728
|
-
orgObj:{}
|
|
644
|
+
}
|
|
729
645
|
}
|
|
730
646
|
},
|
|
731
647
|
created() {
|
|
732
648
|
let vm = this;
|
|
733
|
-
|
|
734
|
-
document.onkeyup = function (e) { // 右键菜单快捷键
|
|
735
|
-
if(vm.menuVisible){
|
|
736
|
-
let key = e.key.toLowerCase();
|
|
737
|
-
switch (key) {
|
|
738
|
-
case "a":
|
|
739
|
-
vm.menuVisible = false;
|
|
740
|
-
vm.handleRightSelect('addChild');
|
|
741
|
-
break;
|
|
742
|
-
case "c":
|
|
743
|
-
vm.menuVisible = false;
|
|
744
|
-
vm.handleRightSelect('addSame');
|
|
745
|
-
break;
|
|
746
|
-
case "r":
|
|
747
|
-
vm.menuVisible = false;
|
|
748
|
-
vm.handleRightSelect('removeCurrent');
|
|
749
|
-
break;
|
|
750
|
-
case "d":
|
|
751
|
-
vm.menuVisible = false;
|
|
752
|
-
vm.handleRightSelect('removeCheck');
|
|
753
|
-
break;
|
|
754
|
-
default:
|
|
755
|
-
break;
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
};
|
|
759
|
-
vm.axios.post(vm.api.sysOrgDimension.find).then(function (res) {
|
|
760
|
-
res.data.forEach(function (dimension) {
|
|
761
|
-
vm.dimObj[dimension["id"]] = dimension["dimName"];
|
|
762
|
-
})
|
|
763
|
-
});
|
|
764
|
-
vm.axios.post(vm.api.param.getSysParams, {"key": "entDim"}).then(function (res) {
|
|
765
|
-
vm.entDim = res.data["entDim"];
|
|
766
|
-
vm.axios.post(vm.api.param.getSysParams, {"key": "sysEntDim.id"}).then(function (paramRes) {
|
|
767
|
-
vm.sysEntDim = paramRes.data["sysEntDim.id"];
|
|
768
|
-
});
|
|
769
|
-
});
|
|
770
|
-
vm.axios.post(vm.api.param.getSysParams, {"key": "manyOrg"}).then(function (res) {
|
|
771
|
-
let resData = res.data || {};
|
|
772
|
-
vm.manyOrg = resData["manyOrg"] == "是";
|
|
773
|
-
});
|
|
774
|
-
vm.axios.post(vm.api.param.getSysParams,{key:"SysUserType"}).then(function (res) { // 是否可以修改用户详情,获取用户的类型
|
|
775
|
-
let result = res.data;
|
|
776
|
-
if(typeof(result) != Object && typeof(result) != "object"){
|
|
777
|
-
result = JSON.parse(result.replace(/'/g, '"'));
|
|
778
|
-
}
|
|
779
|
-
for (let [key, value] of Object.entries(result)) {
|
|
780
|
-
vm.typeOptions.push({"label": value, "value": key})
|
|
781
|
-
}
|
|
782
|
-
});
|
|
649
|
+
vm.commonInit();
|
|
783
650
|
vm.init();
|
|
784
651
|
// vm.initCreatePushRole();
|
|
785
652
|
},
|
|
@@ -818,42 +685,6 @@
|
|
|
818
685
|
}
|
|
819
686
|
},
|
|
820
687
|
methods: {
|
|
821
|
-
initCreatePushRole(){
|
|
822
|
-
let loginUser = this.USER_GLOBAL.getLoginUser() || {};
|
|
823
|
-
this.axios.post(this.api.role.find,{"created":loginUser.id,"pushRole":"1"}).then(res => {
|
|
824
|
-
this.createPushRoleArr = res.data || [];
|
|
825
|
-
})
|
|
826
|
-
},
|
|
827
|
-
buildParentTree(){
|
|
828
|
-
let vm = this;
|
|
829
|
-
vm.parentPosTree = [];
|
|
830
|
-
if(vm.orgObj.orgParentTree){
|
|
831
|
-
vm.axios.post(vm.api.sysPos.find,{"parentPosIds":vm.orgObj.orgParentTree}).then(res => {
|
|
832
|
-
let arr = [];
|
|
833
|
-
(res.data || []).forEach(item => {
|
|
834
|
-
arr.push({
|
|
835
|
-
"id":item.id,
|
|
836
|
-
"label":item.posName,
|
|
837
|
-
"parentId":item.parentPosId
|
|
838
|
-
})
|
|
839
|
-
});
|
|
840
|
-
vm.parentPosTree = vm.COMMON_FUNC.buildElTree(arr);
|
|
841
|
-
//递归去除
|
|
842
|
-
function clearTreeChildren(parentPosTreeArr) {
|
|
843
|
-
(parentPosTreeArr || []).forEach(item =>{
|
|
844
|
-
if(item.children){
|
|
845
|
-
if(item.children.length == 0){
|
|
846
|
-
delete item['children'];
|
|
847
|
-
}else {
|
|
848
|
-
clearTreeChildren(item.children);
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
})
|
|
852
|
-
}
|
|
853
|
-
clearTreeChildren(vm.parentPosTree);
|
|
854
|
-
})
|
|
855
|
-
}
|
|
856
|
-
},
|
|
857
688
|
init() {
|
|
858
689
|
let vm = this;
|
|
859
690
|
vm.orgId && (vm.posTreeParam["orgId"] = vm.orgId) && (vm.posCrud.searchForm["orgId"] = vm.orgId);
|
|
@@ -1146,455 +977,9 @@
|
|
|
1146
977
|
vm.$emit("saveRollBack",obj);
|
|
1147
978
|
})
|
|
1148
979
|
},
|
|
1149
|
-
formatterColumn(row, column, cellValue) { // 格式化列
|
|
1150
|
-
let vm = this;
|
|
1151
|
-
if (column.property == 'userType') {
|
|
1152
|
-
return vm.userTypeMap[cellValue];
|
|
1153
|
-
} else if (column.property == 'userStatus') {
|
|
1154
|
-
return vm.userStatusMap[cellValue];
|
|
1155
|
-
} else {
|
|
1156
|
-
return cellValue;
|
|
1157
|
-
}
|
|
1158
|
-
},
|
|
1159
|
-
/**
|
|
1160
|
-
* 岗位信息
|
|
1161
|
-
*/
|
|
1162
|
-
posTreeCallBack(posTreeVm) { // 岗位初始化全部展开
|
|
1163
|
-
let nodesMap = posTreeVm.getAllNode();
|
|
1164
|
-
let chooseFirstData = {};
|
|
1165
|
-
let chooseFirstNode = {};
|
|
1166
|
-
if((posTreeVm.data || []).length > 0){
|
|
1167
|
-
chooseFirstData = posTreeVm.data[0];
|
|
1168
|
-
}
|
|
1169
|
-
for (let [key, node] of Object.entries(nodesMap)) {
|
|
1170
|
-
node.expanded = true;
|
|
1171
|
-
if(chooseFirstData.id && node.data.id == chooseFirstData.id){
|
|
1172
|
-
chooseFirstNode = node;
|
|
1173
|
-
node.isCurrent = true;
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
if(chooseFirstData.id){
|
|
1177
|
-
this.posNodeClick(chooseFirstData,chooseFirstNode);
|
|
1178
|
-
}
|
|
1179
|
-
},
|
|
1180
|
-
posDealTree(data) {
|
|
1181
|
-
let vm = this;
|
|
1182
|
-
data.forEach(function (pos) {
|
|
1183
|
-
pos["name"] = pos["posName"];
|
|
1184
|
-
if (pos["isMainpos"] === '1') {
|
|
1185
|
-
pos["name"] = pos["posName"] + "[主岗位]";
|
|
1186
|
-
pos["className"] = vm.pageSetting["posMainIcon"] || "saspiconfont pl-icon-yonghu";
|
|
1187
|
-
} else {
|
|
1188
|
-
pos["className"] = vm.pageSetting["posIcon"] || "saspiconfont pl-icon-account";
|
|
1189
|
-
}
|
|
1190
|
-
});
|
|
1191
|
-
},
|
|
1192
|
-
posNodeClick(data, node) { // 岗位树节点点击事件
|
|
1193
|
-
let vm = this;
|
|
1194
|
-
vm.posId = data.id;
|
|
1195
|
-
vm.posBaseForm = Object.assign({}, data);
|
|
1196
|
-
if(!vm.posBaseForm || vm.posBaseForm.parentPosId == '-1'){
|
|
1197
|
-
vm.posBaseForm.parentPosId = null;
|
|
1198
|
-
}
|
|
1199
|
-
vm.menuVisible = false;
|
|
1200
|
-
},
|
|
1201
|
-
posTreeRightClick(event, data, node) {
|
|
1202
|
-
let vm = this;
|
|
1203
|
-
let expand = node.expanded;
|
|
1204
|
-
let target = window.event.target;
|
|
1205
|
-
if (target.tagName === 'DIV') {
|
|
1206
|
-
target.click(); // 右键时点击当前节点
|
|
1207
|
-
} else {
|
|
1208
|
-
let pNode = target.parentNode;
|
|
1209
|
-
if (target.className === 'el-checkbox__inner') { // 右击checkBox
|
|
1210
|
-
pNode.parentNode.parentNode.click();
|
|
1211
|
-
} else { // 右击下拉图标
|
|
1212
|
-
pNode.click();
|
|
1213
|
-
}
|
|
1214
|
-
}
|
|
1215
|
-
node.expanded = expand; // 右击仅选中当前节点保持当前节点展开情况不变
|
|
1216
|
-
if (vm.objectID !== data.id) {
|
|
1217
|
-
vm.objectID = data.id;
|
|
1218
|
-
vm.menuVisible = true;
|
|
1219
|
-
} else {
|
|
1220
|
-
vm.menuVisible = !vm.menuVisible;
|
|
1221
|
-
}
|
|
1222
|
-
|
|
1223
|
-
vm.left = window.event.clientX + "px";
|
|
1224
|
-
vm.top = window.event.clientY + "px";
|
|
1225
|
-
},
|
|
1226
|
-
savePos() { // 保存岗位数据addPosForm
|
|
1227
|
-
let vm = this;
|
|
1228
|
-
vm.$refs.addPosRef.validate(function (valid) {
|
|
1229
|
-
if (valid) {
|
|
1230
|
-
if (vm.addPosForm.isMainpos == "1") { // 设置为主岗位时检索当前组织下是否有主岗位
|
|
1231
|
-
vm.axios.post(vm.api.sysPos.find, {
|
|
1232
|
-
"orgId": vm.orgId,
|
|
1233
|
-
"isMainpos": "1"
|
|
1234
|
-
}).then(function (res) {
|
|
1235
|
-
let result = res.data;
|
|
1236
|
-
if ((result || []).length > 0 && result[0].id !== vm.addPosForm.id) {
|
|
1237
|
-
let msg = "目前此组织内已存在主岗位[" + result[0].posName + "],是否确定设置此岗位为主岗位(系统会自动把[" + result[0].posName + "]设置为普通岗位)?";
|
|
1238
|
-
vm.$confirm(msg, '警告', {
|
|
1239
|
-
confirmButtonText: '确定',
|
|
1240
|
-
cancelButtonText: '取消',
|
|
1241
|
-
}).then(async function () {
|
|
1242
|
-
vm.addPosDialog = false;
|
|
1243
|
-
await vm.axios.post(vm.api.sysPos.update, {
|
|
1244
|
-
"id": result[0].id,
|
|
1245
|
-
"isMainpos": "0"
|
|
1246
|
-
});
|
|
1247
|
-
vm.addPosData();
|
|
1248
|
-
}).catch(() => {
|
|
1249
|
-
vm.$message({
|
|
1250
|
-
duration: 1000,
|
|
1251
|
-
type: 'info',
|
|
1252
|
-
message: '已取消'
|
|
1253
|
-
});
|
|
1254
|
-
});
|
|
1255
|
-
} else {
|
|
1256
|
-
vm.addPosDialog = false;
|
|
1257
|
-
vm.addPosData();
|
|
1258
|
-
}
|
|
1259
|
-
})
|
|
1260
|
-
} else {
|
|
1261
|
-
vm.addPosDialog = false;
|
|
1262
|
-
vm.addPosData();
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
})
|
|
1266
|
-
},
|
|
1267
|
-
addPosData() { // 添加岗位数据
|
|
1268
|
-
let vm = this;
|
|
1269
|
-
if(!vm.addPosForm.parentPosId){
|
|
1270
|
-
vm.addPosForm.parentPosId = '-1';
|
|
1271
|
-
}
|
|
1272
|
-
vm.axios.post(vm.api.sysPos.add, vm.addPosForm).then(function (res) {
|
|
1273
|
-
vm.$message({
|
|
1274
|
-
duration: 1200,
|
|
1275
|
-
message: res.data.operateMessage,
|
|
1276
|
-
type: "success"
|
|
1277
|
-
});
|
|
1278
|
-
vm.$refs.posTreeRef.init();
|
|
1279
|
-
})
|
|
1280
|
-
},
|
|
1281
|
-
handleRightSelect(key) {
|
|
1282
|
-
let vm = this;
|
|
1283
|
-
switch (key) {
|
|
1284
|
-
case "addChild":
|
|
1285
|
-
case "addSame":
|
|
1286
|
-
vm.addNode(key);
|
|
1287
|
-
break;
|
|
1288
|
-
case "removeCurrent":
|
|
1289
|
-
vm.removeCurrentNode();
|
|
1290
|
-
break;
|
|
1291
|
-
case "removeCheck":
|
|
1292
|
-
vm.removeNode();
|
|
1293
|
-
break;
|
|
1294
|
-
default:
|
|
1295
|
-
console.log("未检测到当前操作的对应方法!");
|
|
1296
|
-
break;
|
|
1297
|
-
}
|
|
1298
|
-
},
|
|
1299
|
-
addNode(key) { // addPosForm
|
|
1300
|
-
let vm = this;
|
|
1301
|
-
if (!vm.orgId || vm.orgId == "$") {
|
|
1302
|
-
vm.$message("请选择左侧组织后继续操作!");
|
|
1303
|
-
return;
|
|
1304
|
-
}
|
|
1305
|
-
vm.addPosForm = {"isMainpos": "0"};
|
|
1306
|
-
key = key ? key : "addChild";
|
|
1307
|
-
let data = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
1308
|
-
vm.addPosForm["orgId"] = vm.orgId;
|
|
1309
|
-
vm.addPosForm["orgName"] = vm.orgObj["orgName"];
|
|
1310
|
-
if (key == "addChild") {
|
|
1311
|
-
if (!data) { // 直接添加未选择任何节点,默认第一级
|
|
1312
|
-
vm.addPosForm["parentPosId"] = null;
|
|
1313
|
-
vm.addPosForm["parentPosTree"] = "-1";
|
|
1314
|
-
vm.addPosForm["layer"] = "1";
|
|
1315
|
-
} else {
|
|
1316
|
-
vm.addPosForm["parentPosId"] = data.id;
|
|
1317
|
-
vm.addPosForm["parentPosTree"] = data["parentPosTree"] + "," + data["id"];
|
|
1318
|
-
vm.addPosForm["parentPosName"] = data.posName;
|
|
1319
|
-
vm.addPosForm["layer"] = Number(data["layer"]) + 1;
|
|
1320
|
-
}
|
|
1321
|
-
vm.addPosForm["sort"] = vm.getMaxOrder("child");
|
|
1322
|
-
} else { // 添加同级数据
|
|
1323
|
-
vm.addPosForm["parentPosId"] = data["parentPosId"];
|
|
1324
|
-
if(vm.addPosForm["parentPosId"] == "-1"){
|
|
1325
|
-
vm.addPosForm["parentPosId"] = null;
|
|
1326
|
-
}
|
|
1327
|
-
vm.addPosForm["parentPosTree"] = data["parentPosTree"];
|
|
1328
|
-
vm.addPosForm["parentPosName"] = data.parentPosName;
|
|
1329
|
-
vm.addPosForm["layer"] = data["layer"];
|
|
1330
|
-
vm.addPosForm["sort"] = vm.getMaxOrder("same");
|
|
1331
|
-
}
|
|
1332
|
-
vm.addPosDialog = true;
|
|
1333
|
-
vm.$nextTick(function () {
|
|
1334
|
-
vm.$refs.addPosRef.clearValidate();
|
|
1335
|
-
})
|
|
1336
|
-
},
|
|
1337
|
-
getMaxOrder(type) {
|
|
1338
|
-
let vm = this;
|
|
1339
|
-
let currentNode = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
1340
|
-
let sort = 1;
|
|
1341
|
-
let arr = [];
|
|
1342
|
-
if (type == "same") {
|
|
1343
|
-
let nodesMap = vm.$refs.posTreeRef.getAllNode();
|
|
1344
|
-
if (!currentNode.parentPosId || currentNode.parentPosId == "-1") {
|
|
1345
|
-
for (let [key, node] of Object.entries(nodesMap)) {
|
|
1346
|
-
if (node.level == 1) {
|
|
1347
|
-
arr.push(node.data);
|
|
1348
|
-
}
|
|
1349
|
-
}
|
|
1350
|
-
} else {
|
|
1351
|
-
// 是下级
|
|
1352
|
-
if(nodesMap[currentNode.parentPosId]){
|
|
1353
|
-
arr = nodesMap[currentNode.parentPosId].data.children;
|
|
1354
|
-
}else{ // 第一级
|
|
1355
|
-
Object.keys(nodesMap).forEach(key => {
|
|
1356
|
-
if(nodesMap[key].level == 1){
|
|
1357
|
-
arr.push(nodesMap[key].data);
|
|
1358
|
-
}
|
|
1359
|
-
})
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
}
|
|
1363
|
-
if (type == "child") {
|
|
1364
|
-
arr = (currentNode || {}).children;
|
|
1365
|
-
}
|
|
1366
|
-
(arr || []).forEach(function (each) {
|
|
1367
|
-
sort = sort > Number(each["sort"]) ? sort : Number(each["sort"]);
|
|
1368
|
-
});
|
|
1369
|
-
return ++sort;
|
|
1370
|
-
},
|
|
1371
|
-
removeCurrentNode() { // 删除当前节点
|
|
1372
|
-
let vm = this;
|
|
1373
|
-
vm.$confirm('确定删除当前节点?', '警告', {
|
|
1374
|
-
confirmButtonText: '确定',
|
|
1375
|
-
cancelButtonText: '取消',
|
|
1376
|
-
}).then(function () {
|
|
1377
|
-
let currentNode = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
1378
|
-
let removeNodeArr = vm.$refs.posTreeRef.getCurrentChildren(currentNode, []);
|
|
1379
|
-
vm.axios.post(vm.api.sysPos.delete, {"ids": removeNodeArr.join(",")}).then(function (res) {
|
|
1380
|
-
if (res.data.operateSuccess) {
|
|
1381
|
-
vm.$refs.posTreeRef.defaultTreeRemove(removeNodeArr.join(","));
|
|
1382
|
-
//同步修改下级岗位中
|
|
1383
|
-
vm.axios.post(vm.api.sysPos.updateParentPos, {"parentPosIds": removeNodeArr.join(",")});
|
|
1384
|
-
|
|
1385
|
-
}
|
|
1386
|
-
vm.$message({
|
|
1387
|
-
duration: 1000,
|
|
1388
|
-
type: 'success',
|
|
1389
|
-
message: res.data.operateMessage
|
|
1390
|
-
}
|
|
1391
|
-
);
|
|
1392
|
-
});
|
|
1393
|
-
}).catch(function () {
|
|
1394
|
-
vm.$message({
|
|
1395
|
-
duration: 1000,
|
|
1396
|
-
type: 'info',
|
|
1397
|
-
message: '已取消'
|
|
1398
|
-
});
|
|
1399
|
-
});
|
|
1400
|
-
},
|
|
1401
|
-
removeNode() { // 刪除勾選節點
|
|
1402
|
-
let vm = this;
|
|
1403
|
-
let removeArr = vm.$refs.posTreeRef.getTreeCheckedNodes("key");
|
|
1404
|
-
if (removeArr.length == 0) {
|
|
1405
|
-
vm.$message("请勾选需要删除的节点!");
|
|
1406
|
-
return;
|
|
1407
|
-
}
|
|
1408
|
-
vm.$confirm('确定删除已勾选节点?', '警告', {
|
|
1409
|
-
confirmButtonText: '确定',
|
|
1410
|
-
cancelButtonText: '取消',
|
|
1411
|
-
}).then(function () {
|
|
1412
|
-
vm.loading = true;
|
|
1413
|
-
vm.axios.post(vm.api.sysPos.delete, {"ids": removeArr.join(",")}).then(function (res) {
|
|
1414
|
-
if (res.data.operateSuccess) {
|
|
1415
|
-
vm.$refs.posTreeRef.defaultTreeRemove(removeArr.join(","));
|
|
1416
|
-
}
|
|
1417
|
-
vm.loading = false;
|
|
1418
|
-
vm.$message({
|
|
1419
|
-
duration: 1000,
|
|
1420
|
-
type: 'success',
|
|
1421
|
-
message: res.data.operateMessage
|
|
1422
|
-
}
|
|
1423
|
-
);
|
|
1424
|
-
vm.init();
|
|
1425
|
-
})
|
|
1426
|
-
}).catch(function () {
|
|
1427
|
-
vm.$message({
|
|
1428
|
-
duration: 1000,
|
|
1429
|
-
type: 'info',
|
|
1430
|
-
message: '已取消'
|
|
1431
|
-
});
|
|
1432
|
-
});
|
|
1433
|
-
},
|
|
1434
|
-
updatePosInfo() { // 更新岗位信息
|
|
1435
|
-
let vm = this;
|
|
1436
|
-
if (!vm.posId) {
|
|
1437
|
-
vm.$message("请选择左侧岗位后再操作!");
|
|
1438
|
-
return;
|
|
1439
|
-
}
|
|
1440
|
-
vm.$refs.posBaseRef.validate(function (valid) {
|
|
1441
|
-
if (valid) {
|
|
1442
|
-
if (vm.posBaseForm.isMainpos == "1") { // 设置为主岗位时检索当前组织下是否有主岗位
|
|
1443
|
-
vm.axios.post(vm.api.sysPos.find, {
|
|
1444
|
-
"orgId": vm.orgId,
|
|
1445
|
-
"isMainpos": "1"
|
|
1446
|
-
}).then(function (res) {
|
|
1447
|
-
let result = res.data;
|
|
1448
|
-
if ((result || []).length > 0 && result[0].id != vm.posBaseForm.id) {
|
|
1449
|
-
let msg = "目前此组织内已存在主岗位[" + result[0].posName + "],是否确定设置此岗位为主岗位(系统会自动把[" + result[0].posName + "]设置为普通岗位)?";
|
|
1450
|
-
vm.$confirm(msg, '警告', {
|
|
1451
|
-
confirmButtonText: '确定',
|
|
1452
|
-
cancelButtonText: '取消',
|
|
1453
|
-
}).then(function () {
|
|
1454
|
-
vm.submitPosForm();
|
|
1455
|
-
vm.axios.post(vm.api.sysPos.update, {
|
|
1456
|
-
"id": result[0].id,
|
|
1457
|
-
"isMainpos": "0"
|
|
1458
|
-
});
|
|
1459
|
-
let nodesMap = vm.$refs.posTreeRef.getAllNode();
|
|
1460
|
-
let oldMainPosData = nodesMap[result[0].id].data;
|
|
1461
|
-
oldMainPosData.isMainpos = "0"; // 修改树中的数据
|
|
1462
|
-
oldMainPosData["name"] = oldMainPosData["posName"]; // 修改树中的数据
|
|
1463
|
-
oldMainPosData["className"] = vm.pageSetting["posIcon"] || "saspiconfont pl-icon-account";
|
|
1464
|
-
}).catch(() => {
|
|
1465
|
-
vm.$message({
|
|
1466
|
-
duration: 1000,
|
|
1467
|
-
type: 'info',
|
|
1468
|
-
message: '已取消'
|
|
1469
|
-
});
|
|
1470
|
-
});
|
|
1471
|
-
} else {
|
|
1472
|
-
vm.submitPosForm();
|
|
1473
|
-
}
|
|
1474
|
-
})
|
|
1475
|
-
} else {
|
|
1476
|
-
vm.submitPosForm();
|
|
1477
|
-
}
|
|
1478
|
-
}
|
|
1479
|
-
});
|
|
1480
|
-
},
|
|
1481
|
-
posRemoveSuc(){
|
|
1482
|
-
this.posBaseForm = {};
|
|
1483
|
-
},
|
|
1484
|
-
submitPosForm() { // 提交岗位表单数据
|
|
1485
|
-
let vm = this;
|
|
1486
|
-
let obj = {};
|
|
1487
|
-
obj["id"] = vm.posBaseForm["id"];
|
|
1488
|
-
obj["posName"] = vm.posBaseForm["posName"];
|
|
1489
|
-
obj["isMainpos"] = vm.posBaseForm["isMainpos"];
|
|
1490
|
-
obj["parentPosId"] = vm.posBaseForm["parentPosId"] || "-1";
|
|
1491
|
-
vm.axios.post(vm.api.sysPos.update, obj).then(function (res) {
|
|
1492
|
-
vm.$message({
|
|
1493
|
-
duration: 1200,
|
|
1494
|
-
message: res.data.operateMessage,
|
|
1495
|
-
type: "success"
|
|
1496
|
-
});
|
|
1497
|
-
if (obj["isMainpos"] == "1") {
|
|
1498
|
-
obj["name"] = obj["posName"] + "[主岗位]";
|
|
1499
|
-
} else {
|
|
1500
|
-
obj["name"] = obj["posName"];
|
|
1501
|
-
}
|
|
1502
|
-
let currentNode = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
1503
|
-
for (let [key, value] of Object.entries(obj)) { // 更新树中的数据
|
|
1504
|
-
currentNode[key] = value;
|
|
1505
|
-
}
|
|
1506
|
-
if (obj["isMainpos"] == "1") {
|
|
1507
|
-
currentNode["className"] = vm.pageSetting["posMainIcon"] || "saspiconfont pl-icon-yonghu";
|
|
1508
|
-
}else{
|
|
1509
|
-
currentNode["className"] = vm.pageSetting["posIcon"] || "saspiconfont pl-icon-account";
|
|
1510
|
-
}
|
|
1511
|
-
})
|
|
1512
|
-
},
|
|
1513
|
-
addMainPosChange(value){
|
|
1514
|
-
let vm = this;
|
|
1515
|
-
if(value == '1' && vm.addPosForm.layer != '1'){
|
|
1516
|
-
vm.$message("非一级岗位不能设置为主岗位!");
|
|
1517
|
-
vm.addPosForm.isMainpos = "0";
|
|
1518
|
-
}
|
|
1519
|
-
},
|
|
1520
|
-
mainPosChange(value) { // 主岗位变化时判断是否可以进行变更
|
|
1521
|
-
let vm = this;
|
|
1522
|
-
let currentNode = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
1523
|
-
if (!currentNode) { // 未选择树,不操作
|
|
1524
|
-
return;
|
|
1525
|
-
}
|
|
1526
|
-
if (value == "1" && currentNode.layer != '1') {
|
|
1527
|
-
vm.$message("非一级岗位不能设置为主岗位!");
|
|
1528
|
-
vm.posBaseForm.isMainpos = "0";
|
|
1529
|
-
}
|
|
1530
|
-
},
|
|
1531
|
-
activePosRow(row) {
|
|
1532
|
-
this.activeRow(row, this.posCrud.tableRef);
|
|
1533
|
-
},
|
|
1534
|
-
activeUserRow(row) {
|
|
1535
|
-
this.activeRow(row, this.userCrud.tableRef);
|
|
1536
|
-
this.tableSelect([],row);
|
|
1537
|
-
},
|
|
1538
980
|
activeOrgRow(row) {
|
|
1539
981
|
this.activeRow(row, this.crud.tableRef);
|
|
1540
982
|
},
|
|
1541
|
-
activeRow(row, ref) { // 行点击选中当前行
|
|
1542
|
-
this.$refs[ref].toggleRowSelection(row);
|
|
1543
|
-
},
|
|
1544
|
-
//复选框选中/取消事件
|
|
1545
|
-
tableSelect(selection, row) {
|
|
1546
|
-
if (this.multipleSelection.length > 0) {
|
|
1547
|
-
let index = this.multipleSelectionIds.indexOf(row.id);
|
|
1548
|
-
if (this.multipleSelectionIds.indexOf(row.id) == -1) {
|
|
1549
|
-
this.multipleSelection.push(row);
|
|
1550
|
-
this.multipleSelectionIds.push(row.id);
|
|
1551
|
-
} else {
|
|
1552
|
-
this.multipleSelectionIds.splice(index, 1);
|
|
1553
|
-
this.multipleSelection.splice(index, 1);
|
|
1554
|
-
}
|
|
1555
|
-
} else {
|
|
1556
|
-
this.multipleSelection.push(row);
|
|
1557
|
-
this.multipleSelectionIds.push(row.id);
|
|
1558
|
-
}
|
|
1559
|
-
},
|
|
1560
|
-
userSelectAll(selection) {
|
|
1561
|
-
var vm = this;
|
|
1562
|
-
var rows = vm.userCrud.dataStore.records;
|
|
1563
|
-
if (selection.length > 0) {
|
|
1564
|
-
//全选
|
|
1565
|
-
selection.forEach(item => {
|
|
1566
|
-
this.userSelectAllPush(item);
|
|
1567
|
-
});
|
|
1568
|
-
} else {
|
|
1569
|
-
//取消全选
|
|
1570
|
-
rows.forEach(item => {
|
|
1571
|
-
this.userSelectAllCancel(item);
|
|
1572
|
-
})
|
|
1573
|
-
}
|
|
1574
|
-
},
|
|
1575
|
-
userSelectAllPush(row) {
|
|
1576
|
-
if (this.multipleSelectionIds.indexOf(row.id) == -1) {
|
|
1577
|
-
this.multipleSelection.push(row);
|
|
1578
|
-
this.multipleSelectionIds.push(row.id);
|
|
1579
|
-
}
|
|
1580
|
-
},
|
|
1581
|
-
userSelectAllCancel(row) {
|
|
1582
|
-
let index = this.multipleSelectionIds.indexOf(row.id);
|
|
1583
|
-
if (this.multipleSelectionIds.indexOf(row.id) != -1) {
|
|
1584
|
-
this.multipleSelectionIds.splice(index, 1);
|
|
1585
|
-
this.multipleSelection.splice(index, 1);
|
|
1586
|
-
}
|
|
1587
|
-
},
|
|
1588
|
-
userSearch() {
|
|
1589
|
-
let vm = this;
|
|
1590
|
-
vm.$nextTick(() => {
|
|
1591
|
-
vm.userCrud.dataStore.records.forEach(item => {
|
|
1592
|
-
if (vm.multipleSelectionIds.indexOf(item.id) > -1) {
|
|
1593
|
-
vm.$refs[vm.userCrud.tableRef].toggleRowSelection(item);
|
|
1594
|
-
}
|
|
1595
|
-
})
|
|
1596
|
-
});
|
|
1597
|
-
}
|
|
1598
983
|
}
|
|
1599
984
|
}
|
|
1600
985
|
</script>
|
|
@@ -500,10 +500,8 @@
|
|
|
500
500
|
if (currentData[elem]) {
|
|
501
501
|
regionArr.push(currentData[elem]);
|
|
502
502
|
} else {
|
|
503
|
-
if (!currentData["province"]) {
|
|
504
|
-
|
|
505
|
-
regionArr.push(vm.cascadeOptions[0].id);
|
|
506
|
-
}
|
|
503
|
+
if (!currentData["province"]&&vm.cascadeOptions[0]) {
|
|
504
|
+
regionArr.push(vm.cascadeOptions[0].id);
|
|
507
505
|
}
|
|
508
506
|
break;
|
|
509
507
|
}
|