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
|
@@ -791,46 +791,11 @@
|
|
|
791
791
|
|
|
792
792
|
import {PlSelectTree} from "sasp-base";
|
|
793
793
|
import OwnerMenuTree from "./ownerMenu/ownerMenuTree";
|
|
794
|
-
|
|
794
|
+
import sysOrgUserDetailMixins from './js/sysOrgUserDetailMixins'
|
|
795
795
|
export default {
|
|
796
796
|
name: "sys-ent-org-user-detail",
|
|
797
|
+
mxins: [sysOrgUserDetailMixins],
|
|
797
798
|
components: {OwnerMenuTree, PlSelectTree},
|
|
798
|
-
props: {
|
|
799
|
-
orgId: {type: String, default: ''},
|
|
800
|
-
orgDim: {type: String, default: ''},
|
|
801
|
-
orgObjReal: {
|
|
802
|
-
type: Object, default: function () {
|
|
803
|
-
return {}
|
|
804
|
-
}
|
|
805
|
-
},
|
|
806
|
-
orgTypeObj: {
|
|
807
|
-
type: Object, default: function () {
|
|
808
|
-
return {}
|
|
809
|
-
}
|
|
810
|
-
},
|
|
811
|
-
areaOptions: {
|
|
812
|
-
type:Array,
|
|
813
|
-
default:() => {return [];}
|
|
814
|
-
},
|
|
815
|
-
pageSetting: {
|
|
816
|
-
type: Object, default: function () {
|
|
817
|
-
return {}
|
|
818
|
-
}
|
|
819
|
-
},
|
|
820
|
-
areaSetting:{
|
|
821
|
-
type:Boolean,default:true
|
|
822
|
-
},
|
|
823
|
-
useRefresh:{
|
|
824
|
-
type:Boolean,default:false
|
|
825
|
-
},
|
|
826
|
-
refreshOrgId:{
|
|
827
|
-
type:Boolean,default:false
|
|
828
|
-
},
|
|
829
|
-
updateCallBack: {type: Function, default: null},
|
|
830
|
-
sysDataObj:{type:Object,default:() => {return {};}},
|
|
831
|
-
orgTreeData:{type:Array,default:()=>{return []}},
|
|
832
|
-
|
|
833
|
-
},
|
|
834
799
|
data() {
|
|
835
800
|
//let vm = this;
|
|
836
801
|
// let validUserRepeat = (rule, value, callback) => { // 重名验证
|
|
@@ -893,40 +858,6 @@
|
|
|
893
858
|
initNoSearch: true,
|
|
894
859
|
//afterRemoveSuccess:this.posRemoveSuc,
|
|
895
860
|
}),
|
|
896
|
-
cascadeOptions: [], // 地区选项
|
|
897
|
-
cascadeOptionsClone:[],
|
|
898
|
-
activeTabs: '1',
|
|
899
|
-
activeName: ['0'], // 默认不激活组织信息吧,如果想默认展开就设为1
|
|
900
|
-
activePosName: ['1'], // 默认激活岗位信息
|
|
901
|
-
dimObj: {}, // id与纬度名称对应关系
|
|
902
|
-
chooseUserDialog: false,
|
|
903
|
-
formOrgName: "", // 当前组织的名称
|
|
904
|
-
orgClassifyArr: [{value: '0', label: '普通部门'}, {value: '1', label: '处室'}, {value: '2', label: '安监局'}],
|
|
905
|
-
classify: "", // 部门分类
|
|
906
|
-
userTypeMap: {
|
|
907
|
-
'ent': '企业用户', 'gov': '政府用户',
|
|
908
|
-
'sup': '开发用户', 'dev': '开发用户',
|
|
909
|
-
},
|
|
910
|
-
userStatusMap: {
|
|
911
|
-
10: "正常", 20: "锁定", 30: "暂时锁定"
|
|
912
|
-
},
|
|
913
|
-
entDim: "",
|
|
914
|
-
sysEntDim: "",
|
|
915
|
-
orderDialog: false, // 排序对话框
|
|
916
|
-
posUserArr: [], // 岗位用户排序数组
|
|
917
|
-
userTypeOptions: [], // 用户类型下拉框
|
|
918
|
-
typeOptions: [], // 所有用户类型
|
|
919
|
-
addUserDialog: false, // 添加用户对话框
|
|
920
|
-
addUserForm: {},
|
|
921
|
-
statusOptions: [
|
|
922
|
-
{value: '10', label: "正常"},
|
|
923
|
-
{value: '20', label: "锁定"}
|
|
924
|
-
], // 用户状态下拉框
|
|
925
|
-
updateOrder: true, // 是调整用户顺序还是选择用户时添加数据
|
|
926
|
-
posTreeParam: {
|
|
927
|
-
"order": "PARENT_POS_ID,SORT",
|
|
928
|
-
"orgId": "$"
|
|
929
|
-
},
|
|
930
861
|
rules: {
|
|
931
862
|
userAccount: [
|
|
932
863
|
{
|
|
@@ -969,24 +900,6 @@
|
|
|
969
900
|
],
|
|
970
901
|
userPhone: this.plValidate('phone'),
|
|
971
902
|
},
|
|
972
|
-
posTreeProper: {'label': 'name','children':'children'},
|
|
973
|
-
posBaseForm: {}, // 岗位基本信息
|
|
974
|
-
posId: "", // 当前选择的岗位id
|
|
975
|
-
setPos: false, // 当前从用户列表选择的是岗位还是组织
|
|
976
|
-
menuVisible: false, // 右击菜单出现的办法
|
|
977
|
-
addPosDialog: false, // 添加岗位的对话框
|
|
978
|
-
addPosForm: {}, // 添加岗位的表单数据
|
|
979
|
-
orgLocation: null, // 组织所在地区
|
|
980
|
-
loading:false,
|
|
981
|
-
top:0,
|
|
982
|
-
left:0,
|
|
983
|
-
parentPosTree:[], // 上级岗位树
|
|
984
|
-
manyOrg:false, // 一人多岗
|
|
985
|
-
multipleSelection:[],
|
|
986
|
-
multipleSelectionIds:[],
|
|
987
|
-
createPushRoleArr:[], // 推送角色
|
|
988
|
-
orgObj:{},
|
|
989
|
-
|
|
990
903
|
allStationObj:{}, //岗位对象
|
|
991
904
|
allowStationObj:{}, //岗位对象
|
|
992
905
|
|
|
@@ -1051,56 +964,7 @@
|
|
|
1051
964
|
},
|
|
1052
965
|
created() {
|
|
1053
966
|
let vm = this;
|
|
1054
|
-
|
|
1055
|
-
document.onkeyup = function (e) { // 右键菜单快捷键
|
|
1056
|
-
if(vm.menuVisible){
|
|
1057
|
-
let key = e.key.toLowerCase();
|
|
1058
|
-
switch (key) {
|
|
1059
|
-
case "a":
|
|
1060
|
-
vm.menuVisible = false;
|
|
1061
|
-
vm.handleRightSelect('addChild');
|
|
1062
|
-
break;
|
|
1063
|
-
case "c":
|
|
1064
|
-
vm.menuVisible = false;
|
|
1065
|
-
vm.handleRightSelect('addSame');
|
|
1066
|
-
break;
|
|
1067
|
-
case "r":
|
|
1068
|
-
vm.menuVisible = false;
|
|
1069
|
-
vm.handleRightSelect('removeCurrent');
|
|
1070
|
-
break;
|
|
1071
|
-
case "d":
|
|
1072
|
-
vm.menuVisible = false;
|
|
1073
|
-
vm.handleRightSelect('removeCheck');
|
|
1074
|
-
break;
|
|
1075
|
-
default:
|
|
1076
|
-
break;
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
};
|
|
1080
|
-
vm.axios.post(vm.api.sysOrgDimension.find).then(function (res) {
|
|
1081
|
-
res.data.forEach(function (dimension) {
|
|
1082
|
-
vm.dimObj[dimension["id"]] = dimension["dimName"];
|
|
1083
|
-
})
|
|
1084
|
-
});
|
|
1085
|
-
vm.axios.post(vm.api.param.getSysParams, {"key": "entDim"}).then(function (res) {
|
|
1086
|
-
vm.entDim = res.data["entDim"];
|
|
1087
|
-
vm.axios.post(vm.api.param.getSysParams, {"key": "sysEntDim.id"}).then(function (paramRes) {
|
|
1088
|
-
vm.sysEntDim = paramRes.data["sysEntDim.id"];
|
|
1089
|
-
});
|
|
1090
|
-
});
|
|
1091
|
-
vm.axios.post(vm.api.param.getSysParams, {"key": "manyOrg"}).then(function (res) {
|
|
1092
|
-
let resData = res.data || {};
|
|
1093
|
-
vm.manyOrg = resData["manyOrg"] == "是";
|
|
1094
|
-
});
|
|
1095
|
-
vm.axios.post(vm.api.param.getSysParams,{key:"SysUserType"}).then(function (res) { // 是否可以修改用户详情,获取用户的类型
|
|
1096
|
-
let result = res.data;
|
|
1097
|
-
if(typeof(result) != Object && typeof(result) != "object"){
|
|
1098
|
-
result = JSON.parse(result.replace(/'/g, '"'));
|
|
1099
|
-
}
|
|
1100
|
-
for (let [key, value] of Object.entries(result)) {
|
|
1101
|
-
vm.typeOptions.push({"label": value, "value": key})
|
|
1102
|
-
}
|
|
1103
|
-
});
|
|
967
|
+
vm.commonInit();
|
|
1104
968
|
|
|
1105
969
|
//加载当前岗位
|
|
1106
970
|
vm.initStation(); //加载当前岗位
|
|
@@ -1210,42 +1074,6 @@
|
|
|
1210
1074
|
this.adminRoleIds = roleIds || '';
|
|
1211
1075
|
},
|
|
1212
1076
|
|
|
1213
|
-
initCreatePushRole(){
|
|
1214
|
-
let loginUser = this.USER_GLOBAL.getLoginUser() || {};
|
|
1215
|
-
this.axios.post(this.api.role.find,{"created":loginUser.id,"pushRole":"1"}).then(res => {
|
|
1216
|
-
this.createPushRoleArr = res.data || [];
|
|
1217
|
-
})
|
|
1218
|
-
},
|
|
1219
|
-
buildParentTree(){
|
|
1220
|
-
let vm = this;
|
|
1221
|
-
vm.parentPosTree = [];
|
|
1222
|
-
if(vm.orgObj.orgParentTree){
|
|
1223
|
-
vm.axios.post(vm.api.sysPos.find,{"parentPosIds":vm.orgObj.orgParentTree}).then(res => {
|
|
1224
|
-
let arr = [];
|
|
1225
|
-
(res.data || []).forEach(item => {
|
|
1226
|
-
arr.push({
|
|
1227
|
-
"id":item.id,
|
|
1228
|
-
"label":item.posName,
|
|
1229
|
-
"parentId":item.parentPosId
|
|
1230
|
-
})
|
|
1231
|
-
});
|
|
1232
|
-
vm.parentPosTree = vm.COMMON_FUNC.buildElTree(arr);
|
|
1233
|
-
//递归去除
|
|
1234
|
-
function clearTreeChildren(parentPosTreeArr) {
|
|
1235
|
-
(parentPosTreeArr || []).forEach(item =>{
|
|
1236
|
-
if(item.children){
|
|
1237
|
-
if(item.children.length == 0){
|
|
1238
|
-
delete item['children'];
|
|
1239
|
-
}else {
|
|
1240
|
-
clearTreeChildren(item.children);
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
})
|
|
1244
|
-
}
|
|
1245
|
-
clearTreeChildren(vm.parentPosTree);
|
|
1246
|
-
})
|
|
1247
|
-
}
|
|
1248
|
-
},
|
|
1249
1077
|
init() {
|
|
1250
1078
|
let vm = this;
|
|
1251
1079
|
vm.orgId && (vm.posTreeParam["orgId"] = vm.orgId) && (vm.posCrud.searchForm["orgId"] = vm.orgId);
|
|
@@ -1919,15 +1747,13 @@
|
|
|
1919
1747
|
}
|
|
1920
1748
|
}else if(field == 'userRoleIdArr'){ //用户角色
|
|
1921
1749
|
(vm.addUserForm['userRoleIdArr'] || []).forEach(roleId =>{
|
|
1922
|
-
if(vm.allRoleObj[roleId]){
|
|
1923
|
-
if(
|
|
1924
|
-
if(
|
|
1925
|
-
if(this.diableRoleIdArr.indexOf(roleId) == -1){
|
|
1926
|
-
userRoleIdArr.push(roleId);
|
|
1927
|
-
}
|
|
1928
|
-
}else{
|
|
1750
|
+
if(vm.allRoleObj[roleId]&&this.disableDveRoleId.indexOf(roleId) == -1){
|
|
1751
|
+
if(vm.loginUser.id == vm.addUserForm.userId){ //排除管理员角色
|
|
1752
|
+
if(this.diableRoleIdArr.indexOf(roleId) == -1){
|
|
1929
1753
|
userRoleIdArr.push(roleId);
|
|
1930
1754
|
}
|
|
1755
|
+
}else{
|
|
1756
|
+
userRoleIdArr.push(roleId);
|
|
1931
1757
|
}
|
|
1932
1758
|
}
|
|
1933
1759
|
});
|
|
@@ -2021,458 +1847,12 @@
|
|
|
2021
1847
|
vm.crud.search();
|
|
2022
1848
|
})
|
|
2023
1849
|
},
|
|
2024
|
-
formatterColumn(row, column, cellValue) { // 格式化列
|
|
2025
|
-
let vm = this;
|
|
2026
|
-
if (column.property == 'userType') {
|
|
2027
|
-
return vm.userTypeMap[cellValue];
|
|
2028
|
-
} else if (column.property == 'userStatus') {
|
|
2029
|
-
return vm.userStatusMap[cellValue];
|
|
2030
|
-
} else {
|
|
2031
|
-
return cellValue;
|
|
2032
|
-
}
|
|
2033
|
-
},
|
|
2034
|
-
/**
|
|
2035
|
-
* 岗位信息
|
|
2036
|
-
*/
|
|
2037
|
-
posTreeCallBack(posTreeVm) { // 岗位初始化全部展开
|
|
2038
|
-
let nodesMap = posTreeVm.getAllNode();
|
|
2039
|
-
let chooseFirstData = {};
|
|
2040
|
-
let chooseFirstNode = {};
|
|
2041
|
-
if((posTreeVm.data || []).length > 0){
|
|
2042
|
-
chooseFirstData = posTreeVm.data[0];
|
|
2043
|
-
}
|
|
2044
|
-
for (let [key, node] of Object.entries(nodesMap)) {
|
|
2045
|
-
node.expanded = true;
|
|
2046
|
-
if(chooseFirstData.id && node.data.id == chooseFirstData.id){
|
|
2047
|
-
chooseFirstNode = node;
|
|
2048
|
-
node.isCurrent = true;
|
|
2049
|
-
}
|
|
2050
|
-
}
|
|
2051
|
-
if(chooseFirstData.id){
|
|
2052
|
-
this.posNodeClick(chooseFirstData,chooseFirstNode);
|
|
2053
|
-
}
|
|
2054
|
-
},
|
|
2055
|
-
posDealTree(data) {
|
|
2056
|
-
let vm = this;
|
|
2057
|
-
data.forEach(function (pos) {
|
|
2058
|
-
pos["name"] = pos["posName"];
|
|
2059
|
-
if (pos["isMainpos"] === '1') {
|
|
2060
|
-
pos["name"] = pos["posName"] + "[主岗位]";
|
|
2061
|
-
pos["className"] = vm.pageSetting["posMainIcon"] || "saspiconfont pl-icon-yonghu";
|
|
2062
|
-
} else {
|
|
2063
|
-
pos["className"] = vm.pageSetting["posIcon"] || "saspiconfont pl-icon-account";
|
|
2064
|
-
}
|
|
2065
|
-
});
|
|
2066
|
-
},
|
|
2067
|
-
posNodeClick(data, node) { // 岗位树节点点击事件
|
|
2068
|
-
let vm = this;
|
|
2069
|
-
vm.posId = data.id;
|
|
2070
|
-
vm.posBaseForm = Object.assign({}, data);
|
|
2071
|
-
if(!vm.posBaseForm || vm.posBaseForm.parentPosId == '-1'){
|
|
2072
|
-
vm.posBaseForm.parentPosId = null;
|
|
2073
|
-
}
|
|
2074
|
-
vm.menuVisible = false;
|
|
2075
|
-
},
|
|
2076
|
-
posTreeRightClick(event, data, node) {
|
|
2077
|
-
let vm = this;
|
|
2078
|
-
let expand = node.expanded;
|
|
2079
|
-
let target = window.event.target;
|
|
2080
|
-
if (target.tagName === 'DIV') {
|
|
2081
|
-
target.click(); // 右键时点击当前节点
|
|
2082
|
-
} else {
|
|
2083
|
-
let pNode = target.parentNode;
|
|
2084
|
-
if (target.className === 'el-checkbox__inner') { // 右击checkBox
|
|
2085
|
-
pNode.parentNode.parentNode.click();
|
|
2086
|
-
} else { // 右击下拉图标
|
|
2087
|
-
pNode.click();
|
|
2088
|
-
}
|
|
2089
|
-
}
|
|
2090
|
-
node.expanded = expand; // 右击仅选中当前节点保持当前节点展开情况不变
|
|
2091
|
-
if (vm.objectID !== data.id) {
|
|
2092
|
-
vm.objectID = data.id;
|
|
2093
|
-
vm.menuVisible = true;
|
|
2094
|
-
} else {
|
|
2095
|
-
vm.menuVisible = !vm.menuVisible;
|
|
2096
|
-
}
|
|
2097
|
-
|
|
2098
|
-
vm.left = window.event.clientX + "px";
|
|
2099
|
-
vm.top = window.event.clientY + "px";
|
|
2100
|
-
},
|
|
2101
|
-
savePos() { // 保存岗位数据addPosForm
|
|
2102
|
-
let vm = this;
|
|
2103
|
-
vm.$refs.addPosRef.validate(function (valid) {
|
|
2104
|
-
if (valid) {
|
|
2105
|
-
if (vm.addPosForm.isMainpos == "1") { // 设置为主岗位时检索当前组织下是否有主岗位
|
|
2106
|
-
vm.axios.post(vm.api.sysPos.find, {
|
|
2107
|
-
"orgId": vm.orgId,
|
|
2108
|
-
"isMainpos": "1"
|
|
2109
|
-
}).then(function (res) {
|
|
2110
|
-
let result = res.data;
|
|
2111
|
-
if ((result || []).length > 0 && result[0].id !== vm.addPosForm.id) {
|
|
2112
|
-
let msg = "目前此组织内已存在主岗位[" + result[0].posName + "],是否确定设置此岗位为主岗位(系统会自动把[" + result[0].posName + "]设置为普通岗位)?";
|
|
2113
|
-
vm.$confirm(msg, '警告', {
|
|
2114
|
-
confirmButtonText: '确定',
|
|
2115
|
-
cancelButtonText: '取消',
|
|
2116
|
-
}).then(async function () {
|
|
2117
|
-
vm.addPosDialog = false;
|
|
2118
|
-
await vm.axios.post(vm.api.sysPos.update, {
|
|
2119
|
-
"id": result[0].id,
|
|
2120
|
-
"isMainpos": "0"
|
|
2121
|
-
});
|
|
2122
|
-
vm.addPosData();
|
|
2123
|
-
}).catch(() => {
|
|
2124
|
-
vm.$message({
|
|
2125
|
-
duration: 1000,
|
|
2126
|
-
type: 'info',
|
|
2127
|
-
message: '已取消'
|
|
2128
|
-
});
|
|
2129
|
-
});
|
|
2130
|
-
} else {
|
|
2131
|
-
vm.addPosDialog = false;
|
|
2132
|
-
vm.addPosData();
|
|
2133
|
-
}
|
|
2134
|
-
})
|
|
2135
|
-
} else {
|
|
2136
|
-
vm.addPosDialog = false;
|
|
2137
|
-
vm.addPosData();
|
|
2138
|
-
}
|
|
2139
|
-
}
|
|
2140
|
-
})
|
|
2141
|
-
},
|
|
2142
|
-
addPosData() { // 添加岗位数据
|
|
2143
|
-
let vm = this;
|
|
2144
|
-
if(!vm.addPosForm.parentPosId){
|
|
2145
|
-
vm.addPosForm.parentPosId = '-1';
|
|
2146
|
-
}
|
|
2147
|
-
vm.axios.post(vm.api.sysPos.add, vm.addPosForm).then(function (res) {
|
|
2148
|
-
vm.$message({
|
|
2149
|
-
duration: 1200,
|
|
2150
|
-
message: res.data.operateMessage,
|
|
2151
|
-
type: "success"
|
|
2152
|
-
});
|
|
2153
|
-
vm.$refs.posTreeRef.init();
|
|
2154
|
-
})
|
|
2155
|
-
},
|
|
2156
|
-
handleRightSelect(key) {
|
|
2157
|
-
let vm = this;
|
|
2158
|
-
switch (key) {
|
|
2159
|
-
case "addChild":
|
|
2160
|
-
case "addSame":
|
|
2161
|
-
vm.addNode(key);
|
|
2162
|
-
break;
|
|
2163
|
-
case "removeCurrent":
|
|
2164
|
-
vm.removeCurrentNode();
|
|
2165
|
-
break;
|
|
2166
|
-
case "removeCheck":
|
|
2167
|
-
vm.removeNode();
|
|
2168
|
-
break;
|
|
2169
|
-
default:
|
|
2170
|
-
console.log("未检测到当前操作的对应方法!");
|
|
2171
|
-
break;
|
|
2172
|
-
}
|
|
2173
|
-
},
|
|
2174
|
-
addNode(key) { // addPosForm
|
|
2175
|
-
let vm = this;
|
|
2176
|
-
if (!vm.orgId || vm.orgId == "$") {
|
|
2177
|
-
vm.$message("请选择左侧组织后继续操作!");
|
|
2178
|
-
return;
|
|
2179
|
-
}
|
|
2180
|
-
vm.addPosForm = {"isMainpos": "0"};
|
|
2181
|
-
key = key ? key : "addChild";
|
|
2182
|
-
let data = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
2183
|
-
vm.addPosForm["orgId"] = vm.orgId;
|
|
2184
|
-
vm.addPosForm["orgName"] = vm.orgObj["orgName"];
|
|
2185
|
-
if (key == "addChild") {
|
|
2186
|
-
if (!data) { // 直接添加未选择任何节点,默认第一级
|
|
2187
|
-
vm.addPosForm["parentPosId"] = null;
|
|
2188
|
-
vm.addPosForm["parentPosTree"] = "-1";
|
|
2189
|
-
vm.addPosForm["layer"] = "1";
|
|
2190
|
-
} else {
|
|
2191
|
-
vm.addPosForm["parentPosId"] = data.id;
|
|
2192
|
-
vm.addPosForm["parentPosTree"] = data["parentPosTree"] + "," + data["id"];
|
|
2193
|
-
vm.addPosForm["parentPosName"] = data.posName;
|
|
2194
|
-
vm.addPosForm["layer"] = Number(data["layer"]) + 1;
|
|
2195
|
-
}
|
|
2196
|
-
vm.addPosForm["sort"] = vm.getMaxOrder("child");
|
|
2197
|
-
} else { // 添加同级数据
|
|
2198
|
-
vm.addPosForm["parentPosId"] = data["parentPosId"];
|
|
2199
|
-
if(vm.addPosForm["parentPosId"] == "-1"){
|
|
2200
|
-
vm.addPosForm["parentPosId"] = null;
|
|
2201
|
-
}
|
|
2202
|
-
vm.addPosForm["parentPosTree"] = data["parentPosTree"];
|
|
2203
|
-
vm.addPosForm["parentPosName"] = data.parentPosName;
|
|
2204
|
-
vm.addPosForm["layer"] = data["layer"];
|
|
2205
|
-
vm.addPosForm["sort"] = vm.getMaxOrder("same");
|
|
2206
|
-
}
|
|
2207
|
-
vm.addPosDialog = true;
|
|
2208
|
-
vm.$nextTick(function () {
|
|
2209
|
-
vm.$refs.addPosRef.clearValidate();
|
|
2210
|
-
})
|
|
2211
|
-
},
|
|
2212
|
-
getMaxOrder(type) {
|
|
2213
|
-
let vm = this;
|
|
2214
|
-
let currentNode = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
2215
|
-
let sort = 1;
|
|
2216
|
-
let arr = [];
|
|
2217
|
-
if (type == "same") {
|
|
2218
|
-
let nodesMap = vm.$refs.posTreeRef.getAllNode();
|
|
2219
|
-
if (!currentNode.parentPosId || currentNode.parentPosId == "-1") {
|
|
2220
|
-
for (let [key, node] of Object.entries(nodesMap)) {
|
|
2221
|
-
if (node.level == 1) {
|
|
2222
|
-
arr.push(node.data);
|
|
2223
|
-
}
|
|
2224
|
-
}
|
|
2225
|
-
} else {
|
|
2226
|
-
// 是下级
|
|
2227
|
-
if(nodesMap[currentNode.parentPosId]){
|
|
2228
|
-
arr = nodesMap[currentNode.parentPosId].data.children;
|
|
2229
|
-
}else{ // 第一级
|
|
2230
|
-
Object.keys(nodesMap).forEach(key => {
|
|
2231
|
-
if(nodesMap[key].level == 1){
|
|
2232
|
-
arr.push(nodesMap[key].data);
|
|
2233
|
-
}
|
|
2234
|
-
})
|
|
2235
|
-
}
|
|
2236
|
-
}
|
|
2237
|
-
}
|
|
2238
|
-
if (type == "child") {
|
|
2239
|
-
arr = (currentNode || {}).children;
|
|
2240
|
-
}
|
|
2241
|
-
(arr || []).forEach(function (each) {
|
|
2242
|
-
sort = sort > Number(each["sort"]) ? sort : Number(each["sort"]);
|
|
2243
|
-
});
|
|
2244
|
-
return ++sort;
|
|
2245
|
-
},
|
|
2246
|
-
removeCurrentNode() { // 删除当前节点
|
|
2247
|
-
let vm = this;
|
|
2248
|
-
vm.$confirm('确定删除当前节点?', '警告', {
|
|
2249
|
-
confirmButtonText: '确定',
|
|
2250
|
-
cancelButtonText: '取消',
|
|
2251
|
-
}).then(function () {
|
|
2252
|
-
let currentNode = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
2253
|
-
let removeNodeArr = vm.$refs.posTreeRef.getCurrentChildren(currentNode, []);
|
|
2254
|
-
vm.axios.post(vm.api.sysPos.delete, {"ids": removeNodeArr.join(",")}).then(function (res) {
|
|
2255
|
-
if (res.data.operateSuccess) {
|
|
2256
|
-
vm.$refs.posTreeRef.defaultTreeRemove(removeNodeArr.join(","));
|
|
2257
|
-
//同步修改下级岗位中
|
|
2258
|
-
vm.axios.post(vm.api.sysPos.updateParentPos, {"parentPosIds": removeNodeArr.join(",")});
|
|
2259
|
-
|
|
2260
|
-
}
|
|
2261
|
-
vm.$message({
|
|
2262
|
-
duration: 1000,
|
|
2263
|
-
type: 'success',
|
|
2264
|
-
message: res.data.operateMessage
|
|
2265
|
-
}
|
|
2266
|
-
);
|
|
2267
|
-
});
|
|
2268
|
-
}).catch(function () {
|
|
2269
|
-
vm.$message({
|
|
2270
|
-
duration: 1000,
|
|
2271
|
-
type: 'info',
|
|
2272
|
-
message: '已取消'
|
|
2273
|
-
});
|
|
2274
|
-
});
|
|
2275
|
-
},
|
|
2276
|
-
removeNode() { // 刪除勾選節點
|
|
2277
|
-
let vm = this;
|
|
2278
|
-
let removeArr = vm.$refs.posTreeRef.getTreeCheckedNodes("key");
|
|
2279
|
-
if (removeArr.length == 0) {
|
|
2280
|
-
vm.$message("请勾选需要删除的节点!");
|
|
2281
|
-
return;
|
|
2282
|
-
}
|
|
2283
|
-
vm.$confirm('确定删除已勾选节点?', '警告', {
|
|
2284
|
-
confirmButtonText: '确定',
|
|
2285
|
-
cancelButtonText: '取消',
|
|
2286
|
-
}).then(function () {
|
|
2287
|
-
vm.loading = true;
|
|
2288
|
-
vm.axios.post(vm.api.sysPos.delete, {"ids": removeArr.join(",")}).then(function (res) {
|
|
2289
|
-
if (res.data.operateSuccess) {
|
|
2290
|
-
vm.$refs.posTreeRef.defaultTreeRemove(removeArr.join(","));
|
|
2291
|
-
}
|
|
2292
|
-
vm.loading = false;
|
|
2293
|
-
vm.$message({
|
|
2294
|
-
duration: 1000,
|
|
2295
|
-
type: 'success',
|
|
2296
|
-
message: res.data.operateMessage
|
|
2297
|
-
}
|
|
2298
|
-
);
|
|
2299
|
-
vm.init();
|
|
2300
|
-
})
|
|
2301
|
-
}).catch(function () {
|
|
2302
|
-
vm.$message({
|
|
2303
|
-
duration: 1000,
|
|
2304
|
-
type: 'info',
|
|
2305
|
-
message: '已取消'
|
|
2306
|
-
});
|
|
2307
|
-
});
|
|
2308
|
-
},
|
|
2309
|
-
updatePosInfo() { // 更新岗位信息
|
|
2310
|
-
let vm = this;
|
|
2311
|
-
if (!vm.posId) {
|
|
2312
|
-
vm.$message("请选择左侧岗位后再操作!");
|
|
2313
|
-
return;
|
|
2314
|
-
}
|
|
2315
|
-
vm.$refs.posBaseRef.validate(function (valid) {
|
|
2316
|
-
if (valid) {
|
|
2317
|
-
if (vm.posBaseForm.isMainpos == "1") { // 设置为主岗位时检索当前组织下是否有主岗位
|
|
2318
|
-
vm.axios.post(vm.api.sysPos.find, {
|
|
2319
|
-
"orgId": vm.orgId,
|
|
2320
|
-
"isMainpos": "1"
|
|
2321
|
-
}).then(function (res) {
|
|
2322
|
-
let result = res.data;
|
|
2323
|
-
if ((result || []).length > 0 && result[0].id != vm.posBaseForm.id) {
|
|
2324
|
-
let msg = "目前此组织内已存在主岗位[" + result[0].posName + "],是否确定设置此岗位为主岗位(系统会自动把[" + result[0].posName + "]设置为普通岗位)?";
|
|
2325
|
-
vm.$confirm(msg, '警告', {
|
|
2326
|
-
confirmButtonText: '确定',
|
|
2327
|
-
cancelButtonText: '取消',
|
|
2328
|
-
}).then(function () {
|
|
2329
|
-
vm.submitPosForm();
|
|
2330
|
-
vm.axios.post(vm.api.sysPos.update, {
|
|
2331
|
-
"id": result[0].id,
|
|
2332
|
-
"isMainpos": "0"
|
|
2333
|
-
});
|
|
2334
|
-
let nodesMap = vm.$refs.posTreeRef.getAllNode();
|
|
2335
|
-
let oldMainPosData = nodesMap[result[0].id].data;
|
|
2336
|
-
oldMainPosData.isMainpos = "0"; // 修改树中的数据
|
|
2337
|
-
oldMainPosData["name"] = oldMainPosData["posName"]; // 修改树中的数据
|
|
2338
|
-
oldMainPosData["className"] = vm.pageSetting["posIcon"] || "saspiconfont pl-icon-account";
|
|
2339
|
-
}).catch(() => {
|
|
2340
|
-
vm.$message({
|
|
2341
|
-
duration: 1000,
|
|
2342
|
-
type: 'info',
|
|
2343
|
-
message: '已取消'
|
|
2344
|
-
});
|
|
2345
|
-
});
|
|
2346
|
-
} else {
|
|
2347
|
-
vm.submitPosForm();
|
|
2348
|
-
}
|
|
2349
|
-
})
|
|
2350
|
-
} else {
|
|
2351
|
-
vm.submitPosForm();
|
|
2352
|
-
}
|
|
2353
|
-
}
|
|
2354
|
-
});
|
|
2355
|
-
},
|
|
2356
|
-
posRemoveSuc(){
|
|
2357
|
-
this.posBaseForm = {};
|
|
2358
|
-
},
|
|
2359
|
-
submitPosForm() { // 提交岗位表单数据
|
|
2360
|
-
let vm = this;
|
|
2361
|
-
let obj = {};
|
|
2362
|
-
obj["id"] = vm.posBaseForm["id"];
|
|
2363
|
-
obj["posName"] = vm.posBaseForm["posName"];
|
|
2364
|
-
obj["isMainpos"] = vm.posBaseForm["isMainpos"];
|
|
2365
|
-
obj["parentPosId"] = vm.posBaseForm["parentPosId"] || "-1";
|
|
2366
|
-
vm.axios.post(vm.api.sysPos.update, obj).then(function (res) {
|
|
2367
|
-
vm.$message({
|
|
2368
|
-
duration: 1200,
|
|
2369
|
-
message: res.data.operateMessage,
|
|
2370
|
-
type: "success"
|
|
2371
|
-
});
|
|
2372
|
-
if (obj["isMainpos"] == "1") {
|
|
2373
|
-
obj["name"] = obj["posName"] + "[主岗位]";
|
|
2374
|
-
} else {
|
|
2375
|
-
obj["name"] = obj["posName"];
|
|
2376
|
-
}
|
|
2377
|
-
let currentNode = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
2378
|
-
for (let [key, value] of Object.entries(obj)) { // 更新树中的数据
|
|
2379
|
-
currentNode[key] = value;
|
|
2380
|
-
}
|
|
2381
|
-
if (obj["isMainpos"] == "1") {
|
|
2382
|
-
currentNode["className"] = vm.pageSetting["posMainIcon"] || "saspiconfont pl-icon-yonghu";
|
|
2383
|
-
}else{
|
|
2384
|
-
currentNode["className"] = vm.pageSetting["posIcon"] || "saspiconfont pl-icon-account";
|
|
2385
|
-
}
|
|
2386
|
-
})
|
|
2387
|
-
},
|
|
2388
|
-
addMainPosChange(value){
|
|
2389
|
-
let vm = this;
|
|
2390
|
-
if(value == '1' && vm.addPosForm.layer != '1'){
|
|
2391
|
-
vm.$message("非一级岗位不能设置为主岗位!");
|
|
2392
|
-
vm.addPosForm.isMainpos = "0";
|
|
2393
|
-
}
|
|
2394
|
-
},
|
|
2395
|
-
mainPosChange(value) { // 主岗位变化时判断是否可以进行变更
|
|
2396
|
-
let vm = this;
|
|
2397
|
-
let currentNode = vm.$refs.posTreeRef.getTreeCurrentNode();
|
|
2398
|
-
if (!currentNode) { // 未选择树,不操作
|
|
2399
|
-
return;
|
|
2400
|
-
}
|
|
2401
|
-
if (value == "1" && currentNode.layer != '1') {
|
|
2402
|
-
vm.$message("非一级岗位不能设置为主岗位!");
|
|
2403
|
-
vm.posBaseForm.isMainpos = "0";
|
|
2404
|
-
}
|
|
2405
|
-
},
|
|
2406
|
-
activePosRow(row) {
|
|
2407
|
-
this.activeRow(row, this.posCrud.tableRef);
|
|
2408
|
-
},
|
|
2409
|
-
activeUserRow(row) {
|
|
2410
|
-
this.activeRow(row, this.userCrud.tableRef);
|
|
2411
|
-
this.tableSelect([],row);
|
|
2412
|
-
},
|
|
2413
1850
|
activeOrgRow(row,column) {
|
|
2414
1851
|
if(column.property == 'operate'){
|
|
2415
1852
|
return;
|
|
2416
1853
|
}
|
|
2417
1854
|
this.activeRow(row, this.crud.tableRef);
|
|
2418
1855
|
},
|
|
2419
|
-
activeRow(row, ref) { // 行点击选中当前行
|
|
2420
|
-
this.$refs[ref].toggleRowSelection(row);
|
|
2421
|
-
},
|
|
2422
|
-
//复选框选中/取消事件
|
|
2423
|
-
tableSelect(selection, row) {
|
|
2424
|
-
if (this.multipleSelection.length > 0) {
|
|
2425
|
-
let index = this.multipleSelectionIds.indexOf(row.id);
|
|
2426
|
-
if (this.multipleSelectionIds.indexOf(row.id) == -1) {
|
|
2427
|
-
this.multipleSelection.push(row);
|
|
2428
|
-
this.multipleSelectionIds.push(row.id);
|
|
2429
|
-
} else {
|
|
2430
|
-
this.multipleSelectionIds.splice(index, 1);
|
|
2431
|
-
this.multipleSelection.splice(index, 1);
|
|
2432
|
-
}
|
|
2433
|
-
} else {
|
|
2434
|
-
this.multipleSelection.push(row);
|
|
2435
|
-
this.multipleSelectionIds.push(row.id);
|
|
2436
|
-
}
|
|
2437
|
-
},
|
|
2438
|
-
userSelectAll(selection) {
|
|
2439
|
-
var vm = this;
|
|
2440
|
-
var rows = vm.userCrud.dataStore.records;
|
|
2441
|
-
if (selection.length > 0) {
|
|
2442
|
-
//全选
|
|
2443
|
-
selection.forEach(item => {
|
|
2444
|
-
this.userSelectAllPush(item);
|
|
2445
|
-
});
|
|
2446
|
-
} else {
|
|
2447
|
-
//取消全选
|
|
2448
|
-
rows.forEach(item => {
|
|
2449
|
-
this.userSelectAllCancel(item);
|
|
2450
|
-
})
|
|
2451
|
-
}
|
|
2452
|
-
},
|
|
2453
|
-
userSelectAllPush(row) {
|
|
2454
|
-
if (this.multipleSelectionIds.indexOf(row.id) == -1) {
|
|
2455
|
-
this.multipleSelection.push(row);
|
|
2456
|
-
this.multipleSelectionIds.push(row.id);
|
|
2457
|
-
}
|
|
2458
|
-
},
|
|
2459
|
-
userSelectAllCancel(row) {
|
|
2460
|
-
let index = this.multipleSelectionIds.indexOf(row.id);
|
|
2461
|
-
if (this.multipleSelectionIds.indexOf(row.id) != -1) {
|
|
2462
|
-
this.multipleSelectionIds.splice(index, 1);
|
|
2463
|
-
this.multipleSelection.splice(index, 1);
|
|
2464
|
-
}
|
|
2465
|
-
},
|
|
2466
|
-
userSearch() {
|
|
2467
|
-
let vm = this;
|
|
2468
|
-
vm.$nextTick(() => {
|
|
2469
|
-
vm.userCrud.dataStore.records.forEach(item => {
|
|
2470
|
-
if (vm.multipleSelectionIds.indexOf(item.id) > -1) {
|
|
2471
|
-
vm.$refs[vm.userCrud.tableRef].toggleRowSelection(item);
|
|
2472
|
-
}
|
|
2473
|
-
})
|
|
2474
|
-
});
|
|
2475
|
-
},
|
|
2476
1856
|
/**
|
|
2477
1857
|
* 加载已保存岗位
|
|
2478
1858
|
*/
|
|
@@ -2793,10 +2173,8 @@
|
|
|
2793
2173
|
let valueArr = [];
|
|
2794
2174
|
let userRoleIdArr = (userRoleId || "").split(",");
|
|
2795
2175
|
userRoleIdArr.forEach(roleId =>{
|
|
2796
|
-
if(this.allowRoleObj[roleId]){
|
|
2797
|
-
|
|
2798
|
-
valueArr.push(this.allowRoleObj[roleId]['roleName']);
|
|
2799
|
-
}
|
|
2176
|
+
if(this.allowRoleObj[roleId] && this.allowRoleObj[roleId] && this.allowRoleObj[roleId]['roleName']){
|
|
2177
|
+
valueArr.push(this.allowRoleObj[roleId]['roleName']);
|
|
2800
2178
|
}
|
|
2801
2179
|
});
|
|
2802
2180
|
value = valueArr.join(",");
|