sasp-flow-render 1.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/index.js +108 -0
- package/package.json +21 -0
- package/router.js +13 -0
- package/src/assets/font/iconfont.css +1158 -0
- package/src/assets/font/iconfont.eot +0 -0
- package/src/assets/font/iconfont.js +1 -0
- package/src/assets/font/iconfont.svg +827 -0
- package/src/assets/font/iconfont.ttf +0 -0
- package/src/assets/font/iconfont.woff +0 -0
- package/src/assets/images/card_zwsj.png +0 -0
- package/src/assets/images/dataStore.png +0 -0
- package/src/assets/images/dataStore_icon.png +0 -0
- package/src/assets/images/draft.png +0 -0
- package/src/assets/images/edit_icon.png +0 -0
- package/src/assets/images/end.png +0 -0
- package/src/assets/images/end_icon.png +0 -0
- package/src/assets/images/gateway.png +0 -0
- package/src/assets/images/gateway_icon.png +0 -0
- package/src/assets/images/globalConnect_icon.png +0 -0
- package/src/assets/images/group_icon.png +0 -0
- package/src/assets/images/hander_icon.png +0 -0
- package/src/assets/images/icon_ quality.png +0 -0
- package/src/assets/images/lasso_icon.png +0 -0
- package/src/assets/images/mobile_preview.png +0 -0
- package/src/assets/images/participant_icon.png +0 -0
- package/src/assets/images/publicProcess_icon.png +0 -0
- package/src/assets/images/remind_example.png +0 -0
- package/src/assets/images/space_icon.png +0 -0
- package/src/assets/images/start.png +0 -0
- package/src/assets/images/start_icon.png +0 -0
- package/src/assets/images/subprocess_icon.png +0 -0
- package/src/assets/images/tab_set_example.png +0 -0
- package/src/assets/images/timer.png +0 -0
- package/src/assets/images/timer_icon.png +0 -0
- package/src/assets/images/userTask_icon.png +0 -0
- package/src/assets/images/user_task.png +0 -0
- package/src/assets/js/api/apiFlow.js +219 -0
- package/src/assets/js/flowInstall.js +25 -0
- package/src/assets/js/global/cacheGlobal.js +110 -0
- package/src/assets/js/global/flowGlobal.js +61 -0
- package/src/assets/js/global/flowUserGlobal.js +35 -0
- package/src/assets/js/global/interfaceCache.js +31 -0
- package/src/assets/js/storageIO.js +106 -0
- package/src/components/flowChart.vue +463 -0
- package/src/components/flowInst/css/flowInstList.scss +193 -0
- package/src/components/flowInst/flowInstList.vue +818 -0
- package/src/components/flowInst/flowInstTab.vue +2858 -0
- package/src/components/flowInst/popup/flowInstForm.vue +54 -0
- package/src/components/flowRoamRecords.vue +768 -0
- package/src/components/messageMould/messageMould.vue +547 -0
- package/src/components/roamRecord.vue +567 -0
- package/src/components/userSelect.vue +537 -0
- package/src/views/flowInstView.vue +178 -0
- package/src/views/menuRouter/flowMenuRouter.vue +260 -0
- package/src/views/menuRouter/flowResRouter.vue +223 -0
- package/src/views/popup/css/flowMain.scss +156 -0
- package/src/views/popup/event/compoment/diy/info.txt +1 -0
- package/src/views/popup/event/compoment/eventParentConfig.vue +45 -0
- package/src/views/popup/event/js/loadFlowEventPlugin.js +279 -0
- package/src/views/popup/js/controls/CustomContextPad.js +310 -0
- package/src/views/popup/js/controls/CustomPalette.js +303 -0
- package/src/views/popup/js/controls/CustomRenderer.js +219 -0
- package/src/views/popup/js/controls/index.js +11 -0
- package/src/views/popup/js/customModeler/CustomModeler.js +22 -0
- package/src/views/popup/js/translations/customTranslate.js +14 -0
- package/src/views/popup/js/translations/translations.js +234 -0
- package/src/views/popup/js/utils/utils.js +53 -0
- package/src/views/test.vue +79 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<flow-inst-tab :flow-id="useFlowId" :userArr="userArr" :userMap="userMap"
|
|
3
|
+
:initFormInfo="initFormInfo" :saveFormInfo="saveFormInfo" :class='flowViewMainClass'>
|
|
4
|
+
<template slot="formInfo">
|
|
5
|
+
<slot name="formInfo"></slot>
|
|
6
|
+
</template>
|
|
7
|
+
</flow-inst-tab>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import FlowInstTab from "../components/flowInst/flowInstTab";
|
|
12
|
+
export default {
|
|
13
|
+
name: "flowInstView",
|
|
14
|
+
components: {FlowInstTab},
|
|
15
|
+
props:{
|
|
16
|
+
loginUser:{type:Object,default:null}, // 登录用户
|
|
17
|
+
flowId:{type:String},
|
|
18
|
+
initFormInfo:{type: Function,default:null}, // 添加修改打开表单时执行的事件
|
|
19
|
+
saveFormInfo:{type: Function,default:null}, // 保存表单时执行的事件
|
|
20
|
+
},
|
|
21
|
+
data(){
|
|
22
|
+
return {
|
|
23
|
+
useFlowId:this.$route.query.flowId,
|
|
24
|
+
userId:this.$route.query.userCode,
|
|
25
|
+
userName:this.$route.query.userName,
|
|
26
|
+
doMainDatasObj:{},
|
|
27
|
+
userArr:[],
|
|
28
|
+
userMap:{},
|
|
29
|
+
flowViewMainClass:''
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
created() {
|
|
33
|
+
this.init();
|
|
34
|
+
this.loadSkin();
|
|
35
|
+
},
|
|
36
|
+
methods:{
|
|
37
|
+
loadSkin() {
|
|
38
|
+
this.axios.post(this.api.plFlowCss.find, {
|
|
39
|
+
'useable': '1',
|
|
40
|
+
'order': 'PRIORITY ASC,UPDATE_TIME ASC',
|
|
41
|
+
"applyType":"0"
|
|
42
|
+
}).then(res => {
|
|
43
|
+
// console.log('预览表单res',res);
|
|
44
|
+
// cssType 0:自定义皮肤,1:系统皮肤
|
|
45
|
+
// applyType 0:表单渲染,1:管理系统
|
|
46
|
+
(res.data || []).forEach(item => {
|
|
47
|
+
if (item.cssType === '0'){
|
|
48
|
+
if (!item.fileName) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (item.wholeClass) {
|
|
52
|
+
this.flowViewMainClass += "flow-render-class " + item.wholeClass;
|
|
53
|
+
}else {
|
|
54
|
+
this.flowViewMainClass += "flow-render-class";
|
|
55
|
+
}
|
|
56
|
+
let style = document.createElement('link');
|
|
57
|
+
style.type = "text/css";
|
|
58
|
+
style.href = window.JAVA_URL + "/uploadFile/customCss/" + item.id + "/" + item.fileName;
|
|
59
|
+
style.setAttribute("cus-css", "cusCss");
|
|
60
|
+
style.setAttribute("rel", "stylesheet");
|
|
61
|
+
document.head.appendChild(style);
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
},
|
|
66
|
+
init(){
|
|
67
|
+
if(this.loginUser){
|
|
68
|
+
this.CACHE_GLOBAL.setLoginUser(this.loginUser);
|
|
69
|
+
}else{
|
|
70
|
+
let loginUser = {};
|
|
71
|
+
if(this.userId){
|
|
72
|
+
loginUser.id = this.userId;
|
|
73
|
+
}else{
|
|
74
|
+
this.$message.error("请设置用户唯一标识,否则流程无法正常运转!");
|
|
75
|
+
}
|
|
76
|
+
if(this.userName){
|
|
77
|
+
loginUser.userName = this.userName;
|
|
78
|
+
}
|
|
79
|
+
this.CACHE_GLOBAL.setLoginUser(loginUser);
|
|
80
|
+
}
|
|
81
|
+
if(this.flowId){
|
|
82
|
+
this.useFlowId = this.flowId;
|
|
83
|
+
}
|
|
84
|
+
this.initUserData();
|
|
85
|
+
},
|
|
86
|
+
initUserData(){
|
|
87
|
+
// 先载入系统接口数据
|
|
88
|
+
let userArr = this.INTER_CACHE.getUserArr();
|
|
89
|
+
if(userArr && userArr.length > 0){
|
|
90
|
+
this.userMap = this.INTER_CACHE.getUserMap();
|
|
91
|
+
this.userArr = userArr;
|
|
92
|
+
}else{
|
|
93
|
+
this.axios.post(this.api.plFlowInterface.find,{sysInterName:'userData',interType:'sys',interStatus:'1'}).then(res => {
|
|
94
|
+
if((res.data || []).length == 0){
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
let dataInter = res.data[0];
|
|
98
|
+
this.loadUserData(dataInter);
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
loadUserData(dataInter){
|
|
103
|
+
this.axios.post(this.api.plFlowDomain.find,{status:'1'}).then(res => {
|
|
104
|
+
(res.data || []).forEach(item => {
|
|
105
|
+
this.doMainDatasObj[item.id] = item.domainUrl;
|
|
106
|
+
})
|
|
107
|
+
// 解析用户数据
|
|
108
|
+
this.analyseRequest(dataInter).then(data => {
|
|
109
|
+
let arr = [];
|
|
110
|
+
data.forEach(item => {
|
|
111
|
+
item.dataUserId = item[dataInter["idCode"] || "userId"];
|
|
112
|
+
item.dataKey = item.dataUserId;
|
|
113
|
+
item.flowDataType = "user";
|
|
114
|
+
item.dataLabel = item[dataInter["showCode"] || "userName"];
|
|
115
|
+
item.dataOrgId = item[dataInter["orgCode"] || "orgId"];
|
|
116
|
+
item.dataPosId = item[dataInter["posCode"] || "posId"];
|
|
117
|
+
if(item.dataOrgId){
|
|
118
|
+
item.dataParentId = item.orgId;
|
|
119
|
+
}
|
|
120
|
+
if(item.dataPosId){
|
|
121
|
+
item.dataParentId = item.posId;
|
|
122
|
+
}
|
|
123
|
+
arr.push({
|
|
124
|
+
id:item.dataKey,
|
|
125
|
+
userName:item.dataLabel
|
|
126
|
+
})
|
|
127
|
+
})
|
|
128
|
+
this.userArr = arr;
|
|
129
|
+
this.INTER_CACHE.setUserArr(arr);
|
|
130
|
+
this.userMap = this.INTER_CACHE.getUserMap();
|
|
131
|
+
})
|
|
132
|
+
})
|
|
133
|
+
},
|
|
134
|
+
analyseRequest(dataInter){
|
|
135
|
+
return new Promise(resolve => {
|
|
136
|
+
let domainUrl = this.doMainDatasObj[dataInter.domainId] || "";
|
|
137
|
+
let url = domainUrl + dataInter.requestUrl;
|
|
138
|
+
let requestParam = JSON.parse(dataInter.requestParam || "[]");
|
|
139
|
+
let obj = {};
|
|
140
|
+
requestParam.forEach(item => {
|
|
141
|
+
if(!item.key){
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
obj[item.key] = item.value || ""; // 注意这里要replace ${userCode}
|
|
145
|
+
})
|
|
146
|
+
if(dataInter.requestType === 'post'){
|
|
147
|
+
this.axios.post(url,obj).then(res => {
|
|
148
|
+
this.INTER_CACHE.setCacheInfo(dataInter.sysInterName,res.data);
|
|
149
|
+
resolve(res.data || []);
|
|
150
|
+
})
|
|
151
|
+
}else{
|
|
152
|
+
let params = "";
|
|
153
|
+
let arr = []
|
|
154
|
+
Object.keys(obj).forEach(key => {
|
|
155
|
+
arr.push(key + "=" + obj[key]);
|
|
156
|
+
})
|
|
157
|
+
params = arr.join("&");
|
|
158
|
+
if(params){
|
|
159
|
+
if(url.indexOf("?") > -1){
|
|
160
|
+
url += "&" + params;
|
|
161
|
+
}else{
|
|
162
|
+
url += "?" + params;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
this.axios(url).then(res => {
|
|
166
|
+
this.INTER_CACHE.setCacheInfo(dataInter.sysInterName,res.data);
|
|
167
|
+
resolve(res.data || []);
|
|
168
|
+
})
|
|
169
|
+
}
|
|
170
|
+
})
|
|
171
|
+
},
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
</script>
|
|
175
|
+
|
|
176
|
+
<style scoped>
|
|
177
|
+
|
|
178
|
+
</style>
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
<!--工作流菜单跳转-->
|
|
2
|
+
<template>
|
|
3
|
+
<div style="height: 100%">
|
|
4
|
+
<flow-inst-tab v-if="isShow"
|
|
5
|
+
:default-tab="defaultTab"
|
|
6
|
+
:flow-id="flowId"
|
|
7
|
+
:operate-root-arr="operateRootArr"
|
|
8
|
+
:data-permis="dataPermis"
|
|
9
|
+
:flowobj="flowObj"
|
|
10
|
+
:init-message-func="initMessageFunc">
|
|
11
|
+
</flow-inst-tab>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import FlowInstTab from "../../components/flowInst/flowInstTab";
|
|
17
|
+
export default {
|
|
18
|
+
name: "flow-menu-router",
|
|
19
|
+
components: {FlowInstTab},
|
|
20
|
+
props: {
|
|
21
|
+
cresourceId: { //资源id
|
|
22
|
+
type: String,
|
|
23
|
+
default: ''
|
|
24
|
+
},
|
|
25
|
+
cmenuId:{//菜单id
|
|
26
|
+
type: String,
|
|
27
|
+
default: ''
|
|
28
|
+
},
|
|
29
|
+
defaultTab:{
|
|
30
|
+
type: String,
|
|
31
|
+
default: ''
|
|
32
|
+
},
|
|
33
|
+
mesremind:{
|
|
34
|
+
type:String,
|
|
35
|
+
default:''
|
|
36
|
+
},
|
|
37
|
+
initMessageFunc:{
|
|
38
|
+
type: Function,
|
|
39
|
+
default:null
|
|
40
|
+
},
|
|
41
|
+
isCloudView:{
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
data(){
|
|
47
|
+
return{
|
|
48
|
+
resourceId:this.$route.params.resourceId,
|
|
49
|
+
optType:this.$route.query.optType,
|
|
50
|
+
menuId:this.$route.query.menuId,
|
|
51
|
+
operatePermis: '', //根据当前用户查询权限
|
|
52
|
+
dataPermis:'', //根据当前用户查询权限
|
|
53
|
+
resourceObj:{}, //自定义表单资源池
|
|
54
|
+
conditionId: '',//条件定义id 数据权限
|
|
55
|
+
operateAuthority:{}, //操作权限
|
|
56
|
+
isShow:false, //展示
|
|
57
|
+
menuObj:{},
|
|
58
|
+
flowId:"",//工作流id
|
|
59
|
+
sourcesObj:{},
|
|
60
|
+
operateRootArr:[],//操作权限根节点
|
|
61
|
+
operateLeafArr:[],//操作权限子节点
|
|
62
|
+
flowObj:{},//工作流定义对象
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
created(){
|
|
66
|
+
this.init();
|
|
67
|
+
},
|
|
68
|
+
methods:{
|
|
69
|
+
init(){
|
|
70
|
+
if((this.mesremind == "Y") || (!this.resourceId)){
|
|
71
|
+
this.resourceId = this.cresourceId || "";
|
|
72
|
+
}else{
|
|
73
|
+
this.resourceId = this.$route.params.resourceId || "";
|
|
74
|
+
}
|
|
75
|
+
if((!this.menuId) || (this.menuId == "0")){
|
|
76
|
+
this.menuId = this.cmenuId || "";
|
|
77
|
+
}
|
|
78
|
+
this.RES_GLOBAL.getById(this.resourceId).then(resData => {
|
|
79
|
+
if(resData){
|
|
80
|
+
this.resourceObj = resData; //当前资源池
|
|
81
|
+
this.executShow();//展示
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
//自定义表单展示
|
|
86
|
+
async executShow(){
|
|
87
|
+
// 跟据 menuId 和 当前用
|
|
88
|
+
// 传递
|
|
89
|
+
this.isShow = false;
|
|
90
|
+
let resourceObj = this.resourceObj;
|
|
91
|
+
this.flowId = resourceObj.rkey || '';
|
|
92
|
+
this.operateAuthority = {};
|
|
93
|
+
this.conditionId = "";
|
|
94
|
+
let menuObj = {};
|
|
95
|
+
if(window.menuIdToMenuObj){
|
|
96
|
+
menuObj = window.menuIdToMenuObj[this.menuId];
|
|
97
|
+
}else{
|
|
98
|
+
//新窗口打开时查询菜单信息
|
|
99
|
+
this.axios.post(this.api.menu.getById,{id:this.menuId}).then(function (res) {
|
|
100
|
+
if(res && res.data){
|
|
101
|
+
menuObj = res.data;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
// let menuObj = window.menuIdToMenuObj[this.menuId] || {};
|
|
106
|
+
|
|
107
|
+
let loginUser = this.CACHE_GLOBAL.getLoginUser(); //获取当前用户
|
|
108
|
+
//根据 当前用户查询 数据权限和操作权限
|
|
109
|
+
//判断当前用户类型
|
|
110
|
+
if(loginUser.userType == 'sup' || this.isCloudView){ //开发者
|
|
111
|
+
//查询数据权限和操作权限
|
|
112
|
+
//操作权限
|
|
113
|
+
let checkOperateKeysRoot = []; //操作权限 根节点
|
|
114
|
+
let checkOperateKeysLeaf = []; //操作权限 叶子节点
|
|
115
|
+
let operatePermisList = this.resourceObj.operatePermisList;
|
|
116
|
+
operatePermisList.forEach(item =>{
|
|
117
|
+
//处理操作权限
|
|
118
|
+
if(item.powerCode=='children'){//叶子节点
|
|
119
|
+
checkOperateKeysLeaf.push(item);
|
|
120
|
+
}else{
|
|
121
|
+
checkOperateKeysRoot.push(item);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
/* checkOperateKeysLeaf.forEach(leaf=>{
|
|
125
|
+
checkOperateKeysRoot.forEach(root=>{
|
|
126
|
+
if(leaf.parentId==root.id){
|
|
127
|
+
checkOperateKeys.push(root.powerKey+"_"+leaf.powerKey);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
});*/
|
|
131
|
+
this.operateRootArr=checkOperateKeysRoot;
|
|
132
|
+
|
|
133
|
+
//数据权限
|
|
134
|
+
let dataPermisList = this.resourceObj.dataPermisList || [];
|
|
135
|
+
dataPermisList.forEach(dataPermis => {
|
|
136
|
+
this.dataPermis += "," + dataPermis.powerKey;
|
|
137
|
+
});
|
|
138
|
+
if(this.dataPermis){
|
|
139
|
+
this.dataPermis = this.dataPermis.substring(1);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
this.isShow = true;
|
|
143
|
+
}else{ //根据 resourceId查询当前用户是否存在 资源权限 resourceId 如果存在获取数据权限和操作权限
|
|
144
|
+
this.RES_GLOBAL.getUserOwnMenuOpt().then(datas =>{
|
|
145
|
+
if(datas){
|
|
146
|
+
if(this.mesremind == "Y"){
|
|
147
|
+
this.operateRootArr=[{powerCode:this.defaultTab}];
|
|
148
|
+
this.isShow = true;
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
let roleOptArr = [];
|
|
153
|
+
(datas || []).forEach(item =>{
|
|
154
|
+
if(this.menuId == item.menuId){
|
|
155
|
+
roleOptArr.push(item);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
if(roleOptArr.length > 0){
|
|
159
|
+
//遍历权限
|
|
160
|
+
let optPowerArr = []; //操作权限
|
|
161
|
+
let dataPowerArr = []; //数据权限
|
|
162
|
+
roleOptArr.forEach(item =>{
|
|
163
|
+
if(item.optPower){
|
|
164
|
+
optPowerArr = optPowerArr.concat(item.optPower.split(",") || []);
|
|
165
|
+
}
|
|
166
|
+
if (item.dataPower){
|
|
167
|
+
dataPowerArr = dataPowerArr.concat(item.dataPower.split(",") || []);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
//去重
|
|
171
|
+
let optPowerSet = new Set(optPowerArr);
|
|
172
|
+
optPowerArr = Array.from(optPowerSet);
|
|
173
|
+
//去重
|
|
174
|
+
let dataPowerSet = new Set(dataPowerArr);
|
|
175
|
+
dataPowerArr = Array.from(dataPowerSet);
|
|
176
|
+
this.dataPermis = dataPowerArr.join(",");
|
|
177
|
+
// 处理资源池权限信息
|
|
178
|
+
let checkOperateKeysRoot = []; //操作权限 根节点1
|
|
179
|
+
let rootArr = []; //操作权限 根节点2
|
|
180
|
+
let arr = [];
|
|
181
|
+
let checkOperateKeysLeaf = []; //操作权限 叶子节点
|
|
182
|
+
let menuOperatePermisList = ((menuObj || {}).operatePermis || '').split(","); //菜单操作权限
|
|
183
|
+
let operatePermisList = this.resourceObj.operatePermisList;
|
|
184
|
+
optPowerArr.forEach(item =>{
|
|
185
|
+
operatePermisList.some(data =>{
|
|
186
|
+
if(item==data.id){
|
|
187
|
+
if(data.powerCode=='children'){//叶子节点
|
|
188
|
+
checkOperateKeysLeaf.push(data);
|
|
189
|
+
rootArr.push(data.parentId);
|
|
190
|
+
}else{//没有子节点的情况
|
|
191
|
+
arr.push(data.id)
|
|
192
|
+
}
|
|
193
|
+
return data;
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
let rootArrSet ="";
|
|
198
|
+
if(rootArr.length==0){
|
|
199
|
+
rootArrSet = new Set(arr);
|
|
200
|
+
}else{
|
|
201
|
+
rootArrSet=new Set(rootArr);
|
|
202
|
+
}
|
|
203
|
+
rootArr = Array.from(rootArrSet);
|
|
204
|
+
rootArr.forEach(item =>{
|
|
205
|
+
operatePermisList.some(data =>{
|
|
206
|
+
// 菜单与角色权限同时存在时可以显示
|
|
207
|
+
if(item==data.id && menuOperatePermisList.indexOf(item) > -1){
|
|
208
|
+
checkOperateKeysRoot.push(data);
|
|
209
|
+
return data;
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
this.operateRootArr=checkOperateKeysRoot;
|
|
214
|
+
this.isShow = true;
|
|
215
|
+
}else{
|
|
216
|
+
//强制跳转到首页
|
|
217
|
+
let url = "/commonHome/welcome";
|
|
218
|
+
this.routerPush(url);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
|
|
226
|
+
// /**
|
|
227
|
+
// * 获取资源池对象
|
|
228
|
+
// */
|
|
229
|
+
// async getResources(){
|
|
230
|
+
// let res = await this.axios.post(this.api.resources.findResources,{id:this.resourceId,rType:"page"}); //查询自定义表单中资源池数据
|
|
231
|
+
// if(res.data && res.data.operateObj){
|
|
232
|
+
// this.resourceObj = res.data.operateObj[0]; //当前资源池
|
|
233
|
+
// }
|
|
234
|
+
// },
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* 请求跳转
|
|
239
|
+
*/
|
|
240
|
+
routerPush(url) {
|
|
241
|
+
this.$router.push({
|
|
242
|
+
path: url
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
},
|
|
246
|
+
async initReousrceObj(){
|
|
247
|
+
let res = await vm.axios.post(this.api.resources.findResources,{'rSource':rSource,'rStatus':'1','rKey':this.rKey}); //获取绑定资源数据
|
|
248
|
+
if(res.data && res.data.operateObj){
|
|
249
|
+
res.data.operateObj.forEach(item =>{
|
|
250
|
+
this.sourcesObj[item.rkey] = item;
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
</script>
|
|
257
|
+
|
|
258
|
+
<style scoped>
|
|
259
|
+
|
|
260
|
+
</style>
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
<!--工作流菜单跳转-->
|
|
2
|
+
<template>
|
|
3
|
+
<div style="height: 100%">
|
|
4
|
+
<flow-inst-tab v-if="isShow" :default-tab="defaultTab" :flow-id="flowId" :operate-root-arr="operateRootArr" :flowobj="flowObj" :data-permis="dataPermis">
|
|
5
|
+
|
|
6
|
+
</flow-inst-tab>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import FlowInstTab from "../../components/flowInst/flowInstTab";
|
|
12
|
+
export default {
|
|
13
|
+
name: "flow-res-router",
|
|
14
|
+
components: {FlowInstTab},
|
|
15
|
+
props: {
|
|
16
|
+
cresourceId: { //资源id
|
|
17
|
+
type: String,
|
|
18
|
+
default: ''
|
|
19
|
+
},
|
|
20
|
+
defaultTab:{
|
|
21
|
+
type: String,
|
|
22
|
+
default: ''
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
data(){
|
|
26
|
+
return{
|
|
27
|
+
resourceId:this.$route.params.resourceId,
|
|
28
|
+
optType:this.$route.query.optType,
|
|
29
|
+
menuId:'',
|
|
30
|
+
operatePermis: '', //根据 当前用户查询权限
|
|
31
|
+
dataPermis:'', //根据当前用户查询权限
|
|
32
|
+
resourceObj:{}, //自定义表单资源池
|
|
33
|
+
conditionId: '',//条件定义id 数据权限
|
|
34
|
+
operateAuthority:{}, //操作权限
|
|
35
|
+
isShow:false, //展示
|
|
36
|
+
menuObj:{},
|
|
37
|
+
flowId:"",//工作流id
|
|
38
|
+
sourcesObj:{},
|
|
39
|
+
operateRootArr:[],//操作权限根节点
|
|
40
|
+
operateLeafArr:[],//操作权限子节点
|
|
41
|
+
flowObj:{}//工作流定义对象
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
watch:{
|
|
45
|
+
'$route.params.resourceId' (to, from) {
|
|
46
|
+
this.getResources().then(() => { //获取资源池
|
|
47
|
+
this.executShow();
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
created(){
|
|
52
|
+
this.resourceId = this.$route.params.resourceId||this.cresourceId||"";
|
|
53
|
+
this.RES_GLOBAL.getById(this.resourceId).then(resData => {
|
|
54
|
+
if(resData){
|
|
55
|
+
this.resourceObj = resData; //当前资源池
|
|
56
|
+
this.executShow();//展示
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
methods:{
|
|
61
|
+
//自定义表单展示
|
|
62
|
+
async executShow(){
|
|
63
|
+
// 跟据 menuId 和 当前用
|
|
64
|
+
// 传递
|
|
65
|
+
this.isShow = false;
|
|
66
|
+
let resourceObj = this.resourceObj;
|
|
67
|
+
this.flowId = resourceObj.rkey || '';
|
|
68
|
+
if(this.flowId){
|
|
69
|
+
/*await this.axios.post(this.api.plFlowDefine.getById, {"id":this.flowId}).then(res=>{
|
|
70
|
+
if(res.data){
|
|
71
|
+
this.flowObj=res.data;
|
|
72
|
+
}
|
|
73
|
+
});*/
|
|
74
|
+
}
|
|
75
|
+
this.operateAuthority = {};
|
|
76
|
+
this.conditionId = "";
|
|
77
|
+
//let menuObj = window.resourceToMemu[this.resourceId];
|
|
78
|
+
//this.menuId = menuObj.id;
|
|
79
|
+
|
|
80
|
+
let loginUser = this.CACHE_GLOBAL.getLoginUser(); //获取当前用户
|
|
81
|
+
//根据 当前用户查询 数据权限和操作权限
|
|
82
|
+
//判断当前用户类型
|
|
83
|
+
if(loginUser.userType == 'sup'){ //开发者
|
|
84
|
+
//查询数据权限和操作权限
|
|
85
|
+
//操作权限
|
|
86
|
+
let checkOperateKeysRoot = []; //操作权限 根节点
|
|
87
|
+
let checkOperateKeysLeaf = []; //操作权限 叶子节点
|
|
88
|
+
let operatePermisList=this.resourceObj.operatePermisList;
|
|
89
|
+
operatePermisList.forEach(item =>{
|
|
90
|
+
//处理操作权限
|
|
91
|
+
if(item.powerCode=='children'){//叶子节点
|
|
92
|
+
checkOperateKeysLeaf.push(item);
|
|
93
|
+
}else{
|
|
94
|
+
checkOperateKeysRoot.push(item);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
/* checkOperateKeysLeaf.forEach(leaf=>{
|
|
98
|
+
checkOperateKeysRoot.forEach(root=>{
|
|
99
|
+
if(leaf.parentId==root.id){
|
|
100
|
+
checkOperateKeys.push(root.powerKey+"_"+leaf.powerKey);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});*/
|
|
104
|
+
this.operateRootArr=checkOperateKeysRoot;
|
|
105
|
+
//数据权限
|
|
106
|
+
let dataPermisList = this.resourceObj.dataPermisList || [];
|
|
107
|
+
dataPermisList.forEach(dataPermis => {
|
|
108
|
+
this.dataPermis += "," + dataPermis.powerKey;
|
|
109
|
+
});
|
|
110
|
+
if(this.dataPermis){
|
|
111
|
+
this.dataPermis = this.dataPermis.substring(1);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
this.isShow = true;
|
|
115
|
+
}else{ //根据 resourceId查询当前用户是否存在 资源权限 resourceId 如果存在获取数据权限和操作权限
|
|
116
|
+
this.axios.post(this.api.auth.getOwnMenuOpt,{userId:loginUser.id,userType:loginUser.userType,optType:'source'}).then(res =>{
|
|
117
|
+
if(res && res.data){
|
|
118
|
+
let roleOptArr = [];
|
|
119
|
+
(res.data || []).forEach(item =>{
|
|
120
|
+
if(this.resourceId == item.menuId){
|
|
121
|
+
roleOptArr.push(item);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
if(roleOptArr.length > 0){
|
|
125
|
+
//遍历权限
|
|
126
|
+
let optPowerArr = []; //操作权限
|
|
127
|
+
let dataPowerArr = []; //数据权限
|
|
128
|
+
roleOptArr.forEach(item =>{
|
|
129
|
+
if(item.optPower){
|
|
130
|
+
optPowerArr = optPowerArr.concat(item.optPower.split(",") || []);
|
|
131
|
+
}
|
|
132
|
+
if (item.dataPower){
|
|
133
|
+
dataPowerArr = dataPowerArr.concat(item.dataPower.split(",") || []);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
//去重
|
|
137
|
+
let optPowerSet = new Set(optPowerArr);
|
|
138
|
+
optPowerArr = Array.from(optPowerSet);
|
|
139
|
+
//去重
|
|
140
|
+
let dataPowerSet = new Set(dataPowerArr);
|
|
141
|
+
dataPowerArr = Array.from(dataPowerSet);
|
|
142
|
+
this.dataPermis = dataPowerArr.join(",");
|
|
143
|
+
// 处理资源池权限信息
|
|
144
|
+
let checkOperateKeysRoot = []; //操作权限 根节点1
|
|
145
|
+
let rootArr = []; //操作权限 根节点2
|
|
146
|
+
let arr = [];
|
|
147
|
+
let checkOperateKeysLeaf = []; //操作权限 叶子节点
|
|
148
|
+
let operatePermisList=this.resourceObj.operatePermisList;
|
|
149
|
+
optPowerArr.forEach(item =>{
|
|
150
|
+
let result=operatePermisList.some(data =>{
|
|
151
|
+
if(item==data.id){
|
|
152
|
+
if(data.powerCode=='children'){//叶子节点
|
|
153
|
+
checkOperateKeysLeaf.push(data);
|
|
154
|
+
rootArr.push(data.parentId);
|
|
155
|
+
}else{//没有子节点的情况
|
|
156
|
+
arr.push(data.id)
|
|
157
|
+
}
|
|
158
|
+
return data;
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
let rootArrSet ="";
|
|
163
|
+
if(rootArr.length==0){
|
|
164
|
+
rootArrSet = new Set(arr);
|
|
165
|
+
}else{
|
|
166
|
+
rootArrSet=new Set(rootArr);
|
|
167
|
+
}
|
|
168
|
+
rootArr = Array.from(rootArrSet);
|
|
169
|
+
rootArr.forEach(item =>{
|
|
170
|
+
let result=operatePermisList.some(data =>{
|
|
171
|
+
if(item==data.id){
|
|
172
|
+
checkOperateKeysRoot.push(data);
|
|
173
|
+
return data;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
this.operateRootArr=checkOperateKeysRoot;
|
|
178
|
+
this.isShow = true;
|
|
179
|
+
}else{
|
|
180
|
+
//强制跳转到首页
|
|
181
|
+
let url = "/commonHome/welcome";
|
|
182
|
+
this.routerPush(url);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
// /**
|
|
190
|
+
// * 获取资源池对象
|
|
191
|
+
// */
|
|
192
|
+
// async getResources(){
|
|
193
|
+
// let res = await this.axios.post(this.api.resources.findResources,{id:this.resourceId,rType:"page"}); //查询自定义表单中资源池数据
|
|
194
|
+
// if(res.data && res.data.operateObj){
|
|
195
|
+
// this.resourceObj = res.data.operateObj[0]; //当前资源池
|
|
196
|
+
// }
|
|
197
|
+
// },
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* 请求跳转
|
|
202
|
+
*/
|
|
203
|
+
routerPush(url) {
|
|
204
|
+
this.$router.push({
|
|
205
|
+
path: url
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
},
|
|
209
|
+
async initReousrceObj(){
|
|
210
|
+
let res = await vm.axios.post(this.api.resources.findResources,{'rSource':rSource,'rStatus':'1','rKey':this.rKey}); //获取绑定资源数据
|
|
211
|
+
if(res.data && res.data.operateObj){
|
|
212
|
+
res.data.operateObj.forEach(item =>{
|
|
213
|
+
this.sourcesObj[item.rkey] = item;
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
</script>
|
|
220
|
+
|
|
221
|
+
<style scoped>
|
|
222
|
+
|
|
223
|
+
</style>
|