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
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
let objResult = {
|
|
2
|
+
|
|
3
|
+
// 消息提醒模板
|
|
4
|
+
messageMould:{
|
|
5
|
+
url:"/messageMouldController",
|
|
6
|
+
add:"/messageMouldController/add",
|
|
7
|
+
update:"/messageMouldController/update",
|
|
8
|
+
find:"/messageMouldController/find",
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
plFlowDefine:{
|
|
12
|
+
url:"/plFlowDefineController",
|
|
13
|
+
add:"/plFlowDefineController/add",
|
|
14
|
+
update:"/plFlowDefineController/update",
|
|
15
|
+
findAllFlowClass:"/plFlowDefineController/findAllFlowClass",
|
|
16
|
+
saveFlowDraw:"/plFlowDefineController/saveFlowDraw", //保存流程图中间
|
|
17
|
+
saveFlowDrawNew:"/plFlowDefineController/saveFlowDrawNew", //保存流程图(最新)
|
|
18
|
+
getFlowDraw:"/plFlowDefineController/getFlowDraw",
|
|
19
|
+
batchDeletFlowDraw:"/plFlowDefineController/batchDeletFlowDraw",
|
|
20
|
+
getById:"/plFlowDefineController/getById",
|
|
21
|
+
find:"/plFlowDefineController/find",
|
|
22
|
+
releaseFlow:"/plFlowDefineController/releaseFlow", //流程发布
|
|
23
|
+
exportFlowData:"/plFlowDefineController/exportFlowData",//流程导出
|
|
24
|
+
impFlowData:"/plFlowDefineController/impFlowData",//流程导入
|
|
25
|
+
getReleaseDefineById:"/plFlowDefineController/getReleaseDefineById", //获取最新已发布的流程
|
|
26
|
+
updateFlowDefineVersion:"/plFlowDefineController/updateFlowDefineVersion", //更新流程版本
|
|
27
|
+
testRunFlow:"/plFlowDefineController/testRunFlow", //流程试运行
|
|
28
|
+
findMaxVersionRelasePage:"/plFlowDefineController/findMaxVersionRelasePage", //查询最大版本已发布流程(用于导出)
|
|
29
|
+
exportFlowDataByCloud:"/plFlowDefineController/exportFlowDataByCloud",//云仓库导出
|
|
30
|
+
uploadFlowDataByCloud:"/plFlowDefineController/uploadFlowDataByCloud",//上传到云仓库
|
|
31
|
+
},
|
|
32
|
+
plFlowScript:{
|
|
33
|
+
url:"/plFlowScriptController",
|
|
34
|
+
find:"/plFlowScriptController/find",
|
|
35
|
+
},
|
|
36
|
+
externalFlow:{
|
|
37
|
+
executeNextStep:"/externalFlowController/executeNextStep",
|
|
38
|
+
runFlow:"/externalFlowController/runFlow",
|
|
39
|
+
saveDraft:"/externalFlowController/saveDraft",
|
|
40
|
+
runFlowAndNextStep:"/externalFlowController/runFlowAndNextStep",
|
|
41
|
+
getFlowInstId:"/externalFlowController/getFlowInstId",
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
// 工作流框架外部接口
|
|
45
|
+
workflowProcess:{
|
|
46
|
+
create: "/engine-rest/api/engine/default/deployment/create",
|
|
47
|
+
getResource: "/engine-rest/engine/default/deployment/{id}/resources",
|
|
48
|
+
getResourceData: "/engine-rest/engine/default/deployment/{id}/resources/{resourceId}/data"
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 事件规则
|
|
53
|
+
*/
|
|
54
|
+
eventRule:{
|
|
55
|
+
url:"/plEventRuleSetController",
|
|
56
|
+
find:"/plEventRuleSetController/find",
|
|
57
|
+
add:"/plEventRuleSetController/add",
|
|
58
|
+
update:"/plEventRuleSetController/update",
|
|
59
|
+
delete:"/plEventRuleSetController/delete",
|
|
60
|
+
findByVersion:"/plEventRuleSetController/findByVersion",//事件规则根据版本分页查询
|
|
61
|
+
findPage:"/plEventRuleSetController/findPage",
|
|
62
|
+
saveEvent:"/plEventRuleSetController/saveEvent", //保存事件规则
|
|
63
|
+
getMaxOrder:"/plEventRuleSetController/getMaxOrder", //获取最大版本事件规则
|
|
64
|
+
importEventData:"/plEventRuleSetController/importEventData",//事件规则导入
|
|
65
|
+
downloadTemplate:"/plEventRuleSetController/downloadTemplate", //事件规则模版下载
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
// 公共流程块
|
|
69
|
+
plCommonBlock:{
|
|
70
|
+
url:"/plCommonBlockController",
|
|
71
|
+
add:"/plCommonBlockController/add",
|
|
72
|
+
update:"/plCommonBlockController/update",
|
|
73
|
+
find:"/plCommonBlockController/find",
|
|
74
|
+
maxOrder:"/plCommonBlockController/maxOrder",
|
|
75
|
+
saveFlowDraw:"/plCommonBlockController/saveFlowDraw", //保存流程图中间
|
|
76
|
+
getFlowDraw:"/plCommonBlockController/getFlowDraw",
|
|
77
|
+
queryFlowNames:"/plCommonBlockController/queryFlowNames",
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
//流程节点配置
|
|
81
|
+
plFlowNode:{
|
|
82
|
+
url:"/plFlowNodeController",
|
|
83
|
+
find:"/plFlowNodeController/find",
|
|
84
|
+
saveNodeInfo:"/plFlowNodeController/saveNodeInfo",
|
|
85
|
+
deleteByCondition:"/plFlowNodeController/deleteByCondition",
|
|
86
|
+
queryCommonNode:"/plFlowNodeController/queryCommonNode",
|
|
87
|
+
getById:"/plFlowNodeController/getById",
|
|
88
|
+
saveNodeInfoRelease:"/plFlowNodeController/saveNodeInfoRelease", //发布流程实例保存节点配置
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
//流程节点配置
|
|
92
|
+
plFlowInstNodeResult:{
|
|
93
|
+
listNoPageByResult:"/flowInstNodeResultController/listNoPageByResult",
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
plFlowInst:{
|
|
97
|
+
url:"/plFlowInstController",
|
|
98
|
+
queryFormData:"/plFlowInstController/queryFormData",
|
|
99
|
+
findFlowInstPage:"/plFlowInstController/findFlowInstPage",
|
|
100
|
+
add:"/plFlowInstController/add",
|
|
101
|
+
deleteFlowInst:"/plFlowInstController/deleteFlowInst",
|
|
102
|
+
getNextUsers:"/plFlowInstController/getNextUsers", //获取流程下一步
|
|
103
|
+
executeNextStep:"/plFlowInstController/executeNextStep", //执行下一步
|
|
104
|
+
skipToNode:"/plFlowInstController/skipToNode", //退回到指定节点
|
|
105
|
+
skipNodeRewrite:"/plFlowInstController/skipNodeRewrite", //退回到指定节点重写
|
|
106
|
+
skipFinishNodeRewrite:"/plFlowInstController/skipFinishNodeRewrite", //已办结退回到指定节点重写
|
|
107
|
+
backToPrevious:"/plFlowInstController/backToPrevious",//退回上一个节点
|
|
108
|
+
getBackPrevious:"/plFlowInstController/getBackPrevious",//取回
|
|
109
|
+
getAllFlowInst:"/plFlowInstController/getAllFlowInst", // 获取所有流程实例
|
|
110
|
+
suspendOrRecover:"/plFlowInstController/suspendOrRecover", // 挂起或恢复选中流程实例
|
|
111
|
+
getListInfoByResource:"/plFlowInstController/getListInfoByResource", // 根据资源id获取列表视图数据
|
|
112
|
+
findInstPending:"/plFlowInstController/findInstPending",
|
|
113
|
+
findInstProcessed:"/plFlowInstController/findInstProcessed",
|
|
114
|
+
findInstFinished:"/plFlowInstController/findInstFinished",
|
|
115
|
+
findAllInstPendingByUser:"/plFlowInstController/findAllInstPendingByUser",//获取代办提醒
|
|
116
|
+
getBackData:"/plFlowInstController/getBackData", // 根据资源id获取列表视图数据
|
|
117
|
+
getById:"/plFlowInstController/getById",
|
|
118
|
+
getHistoryActInst:"/plFlowInstController/getHistoryActInst", // 根据流程实例id获取历史记录
|
|
119
|
+
completeSign:"/plFlowInstController/completeSign",//加签
|
|
120
|
+
turnSign:"/plFlowInstController/turnSign",//转签
|
|
121
|
+
findInstQuery:"/plFlowInstController/findInstQuery", //流程查询
|
|
122
|
+
findInstQueryNew:"/plFlowInstController/findInstQueryNew",
|
|
123
|
+
stopFlow:"/plFlowInstController/stopFlow",//中止和恢复
|
|
124
|
+
revokeFlow:"/plFlowInstController/revokeFlow",//撤销
|
|
125
|
+
findRescinded:"/plFlowInstController/findRescinded", //查询已撤销
|
|
126
|
+
finDiscontinue:"/plFlowInstController/findDiscontinue", //查询已中止
|
|
127
|
+
getTabsNum:"/plFlowInstController/getTabsNum", //查询选项卡数量
|
|
128
|
+
//表单信息接口
|
|
129
|
+
queryInstPending:"/plFlowInstController/queryInstPending",//待处理数据
|
|
130
|
+
queryInstProcessed:"/plFlowInstController/queryInstProcessed",//已处理数据
|
|
131
|
+
queryInstFinished:"/plFlowInstController/queryInstFinished",//查询已办结
|
|
132
|
+
queryRescinded:"/plFlowInstController/queryRescinded",//查询已撤销
|
|
133
|
+
queryDiscontinue:"/plFlowInstController/queryDiscontinue",//查询已中止
|
|
134
|
+
queryInstQuery:"/plFlowInstController/queryInstQuery", //流程查询
|
|
135
|
+
executAgent:"/plFlowInstController/executAgent", //流程代理
|
|
136
|
+
backRewrite:"/plFlowInstController/backRewrite", // 退回重写
|
|
137
|
+
getBackRewrite:"/plFlowInstController/getBackRewrite", // 取回重写
|
|
138
|
+
|
|
139
|
+
getCurrentNode:"/plFlowInstController/getCurrentNode",//查询待处理节点
|
|
140
|
+
getCurrentNodeNameByInstId:"/plFlowInstController/getCurrentNodeNameByInstId",//查询当前节点名称
|
|
141
|
+
|
|
142
|
+
saveRemind:"/plFlowInstController/saveRemind",
|
|
143
|
+
|
|
144
|
+
changeDealer:"/plFlowInstController/changeDealer", // 切换当前任务处理人
|
|
145
|
+
forceEnd:"/plFlowInstController/forceEnd", // 强制办结
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
plFlowSetting:{
|
|
149
|
+
url:"/plFlowSettingController",
|
|
150
|
+
add:"/plFlowSettingController/add",
|
|
151
|
+
update:"/plFlowSettingController/update",
|
|
152
|
+
getById:"/plFlowSettingController/getById",
|
|
153
|
+
getByUserFlowId:"/plFlowSettingController/getByUserFlowId",
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
plFlowDefineVersion:{
|
|
157
|
+
url:"/plFlowDefineVersionController",
|
|
158
|
+
add:"/plFlowDefineVersionController/add",
|
|
159
|
+
update:"/plFlowDefineVersionController/update",
|
|
160
|
+
find:"/plFlowDefineVersionController/find",
|
|
161
|
+
deleteByCondition:"/plFlowDefineVersionController/deleteByCondition"
|
|
162
|
+
},
|
|
163
|
+
plFlowEventDetail:{
|
|
164
|
+
url:"/plFlowEventDetailController",
|
|
165
|
+
find:"/plFlowEventDetailController/find",
|
|
166
|
+
add:"/plFlowEventDetailController/add",
|
|
167
|
+
delete:"/plFlowEventDetailController/delete",
|
|
168
|
+
findEventRule:"/plFlowEventDetailController/findEventRule",
|
|
169
|
+
getMaxFuncOrder:"/plFlowEventDetailController/getMaxFuncOrder",
|
|
170
|
+
findByFlowAndLeadFunc:"/plFlowEventDetailController/findByFlowAndLeadFunc",
|
|
171
|
+
},
|
|
172
|
+
loginMethod:{
|
|
173
|
+
login: "/loginController/login",
|
|
174
|
+
logout: "/loginController/logout",
|
|
175
|
+
},
|
|
176
|
+
plFlowDomain:{
|
|
177
|
+
url:"/plFlowDomainController",
|
|
178
|
+
find:"/plFlowDomainController/find",
|
|
179
|
+
add:"/plFlowDomainController/add",
|
|
180
|
+
update:"/plFlowDomainController/update",
|
|
181
|
+
delete:"/plFlowDomainController/delete",
|
|
182
|
+
},
|
|
183
|
+
plFlowInterface:{
|
|
184
|
+
url:"/plFlowInterfaceController",
|
|
185
|
+
find:"/plFlowInterfaceController/find",
|
|
186
|
+
add:"/plFlowInterfaceController/add",
|
|
187
|
+
update:"/plFlowInterfaceController/update",
|
|
188
|
+
delete:"/plFlowInterfaceController/delete",
|
|
189
|
+
refreshCache:"/plFlowInterfaceController/refreshCache",
|
|
190
|
+
},
|
|
191
|
+
plFlowUser:{
|
|
192
|
+
url:"/plFlowUser", //用户管理
|
|
193
|
+
find:"/plFlowUser/find",
|
|
194
|
+
findPage:"/plFlowUser/findPage",
|
|
195
|
+
findPageByParam:"/plFlowUser/findPageByParam",
|
|
196
|
+
add:"/plFlowUser/add",
|
|
197
|
+
update:"/plFlowUser/update",
|
|
198
|
+
resetPwd: "/plFlowUser/resetPwd",
|
|
199
|
+
findTitle: "/plFlowUser/findTitle",
|
|
200
|
+
getUserByAccount: "/plFlowUser/getUserByAccount",
|
|
201
|
+
updateUserStatusById: "/plFlowUser/updateUserStatusById"
|
|
202
|
+
},
|
|
203
|
+
plFlowCss:{
|
|
204
|
+
uploadCss:"/plFlowCss/uploadCss",
|
|
205
|
+
find:"/plFlowCss/find",
|
|
206
|
+
add:"/plFlowCss/add",
|
|
207
|
+
update:"/plFlowCss/update",
|
|
208
|
+
delete:"/plFlowCss/delete",
|
|
209
|
+
getById:"/plFlowCss/getById",
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
import {SaspModuleUtil} from "sasp-base";
|
|
214
|
+
export default {
|
|
215
|
+
init(serviceAddr) {
|
|
216
|
+
SaspModuleUtil.initServiceAddrs(objResult, serviceAddr);
|
|
217
|
+
},
|
|
218
|
+
apis: objResult
|
|
219
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "../font/iconfont.css";
|
|
2
|
+
import flowGlobal from "./global/flowGlobal";
|
|
3
|
+
import flowUserGlobal from "./global/flowUserGlobal";
|
|
4
|
+
import cacheGlobal from "./global/cacheGlobal";
|
|
5
|
+
import interfaceCache from "./global/interfaceCache";
|
|
6
|
+
import apiFlow from "./api/apiFlow";
|
|
7
|
+
|
|
8
|
+
import {registerAxiosFormData} from "sasp-base";
|
|
9
|
+
|
|
10
|
+
const install = function (Vue, opts = {}) {
|
|
11
|
+
apiFlow.init(opts.SERVICE_URL);
|
|
12
|
+
|
|
13
|
+
registerAxiosFormData(opts.SERVICE_URL);
|
|
14
|
+
|
|
15
|
+
Vue.use(flowUserGlobal,opts);
|
|
16
|
+
Vue.prototype.FLOW_GLOBAL = flowGlobal;
|
|
17
|
+
Vue.prototype.CACHE_GLOBAL = cacheGlobal;
|
|
18
|
+
Vue.prototype.INTER_CACHE = interfaceCache;
|
|
19
|
+
Vue.prototype.FLOW_USER_GLOBAL = flowUserGlobal;
|
|
20
|
+
Object.assign(Vue.prototype.api, apiFlow.apis);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
install
|
|
25
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import {storageIO} from "sasp-base";
|
|
2
|
+
let axios = null;
|
|
3
|
+
|
|
4
|
+
let {setLocalJSON, getLocalJSON, removeLocal} = storageIO;
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
name: "CACHE_GLOBAL",
|
|
9
|
+
|
|
10
|
+
DATA_CACHE: {},
|
|
11
|
+
ARR_USER_INFO:[],//所有用户信息
|
|
12
|
+
|
|
13
|
+
ARR_ALL_USER_INFO:[], //所有用户信息(包含已锁定)
|
|
14
|
+
|
|
15
|
+
LOCK_USER_INFO:[], //锁定用户信息
|
|
16
|
+
ARR_ALL_POS_USER_INFO:[], //所有组织岗位用户信息(包含已锁定)
|
|
17
|
+
install(Vue,opts){
|
|
18
|
+
axios = opts.axios;
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
clearCache(){
|
|
22
|
+
this.ARR_USER_INFO=[];
|
|
23
|
+
this.ARR_ALL_USER_INFO = [];
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
init() {
|
|
27
|
+
this.DATA_CACHE = {};
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
getLoginUser() {
|
|
31
|
+
return getLocalJSON('LOGINUSER') || {};
|
|
32
|
+
},
|
|
33
|
+
/*
|
|
34
|
+
** 将登录用户存入sessionStorage中
|
|
35
|
+
*/
|
|
36
|
+
setLocalJSON(key,value){
|
|
37
|
+
setLocalJSON(key, value);
|
|
38
|
+
},
|
|
39
|
+
setLoginUser(user, token) {
|
|
40
|
+
setLocalJSON('LOGINUSER', user);
|
|
41
|
+
},
|
|
42
|
+
setLoginToken(token) {
|
|
43
|
+
setLocalJSON('USERTOKEN', "pl_token_" + token);
|
|
44
|
+
|
|
45
|
+
localStorage["Authorization" + (window.projectSuffix || "")] = "pl_token_" + token;
|
|
46
|
+
axios.defaults.headers.common["Authorization"] = "pl_token_" + token;
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
clearLoginToken(token) { // 登陆前清空登录认证token
|
|
50
|
+
setLocalJSON('USERTOKEN', "");
|
|
51
|
+
localStorage["Authorization" + (window.projectSuffix || "")] = "";
|
|
52
|
+
axios.defaults.headers.common["Authorization"] = "";
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* 将登录用户的部门信息存入sessionStorage中
|
|
57
|
+
* @param deptInfo
|
|
58
|
+
*/
|
|
59
|
+
setLoginDept(deptInfo) {
|
|
60
|
+
setLocalJSON('LOGINUSERDEPT', deptInfo);
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
clearLoginDept() { // 登陆前清空登录部门信息
|
|
64
|
+
setLocalJSON('LOGINUSERDEPT', "");
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
/*
|
|
68
|
+
** 从sessionStorage中获取登录用户
|
|
69
|
+
*/
|
|
70
|
+
getLoginToken() {
|
|
71
|
+
return getLocalJSON('USERTOKEN');
|
|
72
|
+
},
|
|
73
|
+
/*
|
|
74
|
+
** 从sessionStorage中获取登录用户
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
getLocalJSON(key){
|
|
78
|
+
return getLocalJSON(key);
|
|
79
|
+
},
|
|
80
|
+
/*
|
|
81
|
+
** 将登录用户存入sessionStorage中
|
|
82
|
+
*/
|
|
83
|
+
setSysDataObj(sysdata,sourceKey) {
|
|
84
|
+
setLocalJSON('SYSDATA_'+sourceKey, sysdata);
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
/*
|
|
88
|
+
** 从sessionStorage中获取登录用户
|
|
89
|
+
*/
|
|
90
|
+
getSysDataObj(sourceKey) {
|
|
91
|
+
return getLocalJSON('SYSDATA_' + sourceKey);
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* 从sessionStorage中获取登录用户的部门信息
|
|
97
|
+
* @returns {*}
|
|
98
|
+
*/
|
|
99
|
+
getLoginDept() {
|
|
100
|
+
return getLocalJSON('LOGINUSERDEPT');
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* 获取纯前端地址
|
|
105
|
+
*/
|
|
106
|
+
getWebUrl(route) {
|
|
107
|
+
let path = route.path;
|
|
108
|
+
return location.href.substring(0, location.href.lastIndexOf(path));
|
|
109
|
+
},
|
|
110
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import axios from 'axios/index';
|
|
2
|
+
import flow from "../api/apiFlow";
|
|
3
|
+
let apiFlow = flow.apis;
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: "FLOW_GLOBAL",
|
|
7
|
+
|
|
8
|
+
OBJ_FLOW_DEFINE: {}, // 流程定义信息
|
|
9
|
+
OBJ_FLOW_NODES: {}, // 流程节点信息
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 根据ID获取流程定义信息
|
|
13
|
+
* @param id
|
|
14
|
+
* @returns {*}
|
|
15
|
+
*/
|
|
16
|
+
getFlowDefineById(id) {
|
|
17
|
+
return new Promise(resolve => {
|
|
18
|
+
if (!this.OBJ_FLOW_DEFINE.hasOwnProperty(id)) {
|
|
19
|
+
axios.post(apiFlow.plFlowDefine.getReleaseDefineById, {id: id}).then(res => {
|
|
20
|
+
if (res.data) {
|
|
21
|
+
this.OBJ_FLOW_DEFINE[id] = res.data || {};
|
|
22
|
+
resolve(this.OBJ_FLOW_DEFINE[id]);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
} else {
|
|
26
|
+
resolve(this.OBJ_FLOW_DEFINE[id]);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 根据ID获取节点定义信息
|
|
33
|
+
* @param flowId
|
|
34
|
+
* @param flowVersion
|
|
35
|
+
* @returns {*}
|
|
36
|
+
*/
|
|
37
|
+
getFlowNodesByFlowId(flowId) {
|
|
38
|
+
return new Promise(resolve => {
|
|
39
|
+
if (!this.OBJ_FLOW_NODES.hasOwnProperty(flowId)) {
|
|
40
|
+
axios.post(apiFlow.plFlowNode.find, {flowId: flowId,order:"NODE_SORT ASC,VERSION DESC"}).then(res => {
|
|
41
|
+
if (res.data) {
|
|
42
|
+
this.OBJ_FLOW_NODES[flowId] = res.data || {};
|
|
43
|
+
resolve(this.OBJ_FLOW_NODES[flowId]);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
} else {
|
|
47
|
+
resolve(this.OBJ_FLOW_NODES[flowId]);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 流程定义保存时
|
|
54
|
+
* 清空改流程缓存信息
|
|
55
|
+
* @param id
|
|
56
|
+
*/
|
|
57
|
+
clearFlowDefineById(id){
|
|
58
|
+
delete this.OBJ_FLOW_DEFINE[id];
|
|
59
|
+
delete this.OBJ_FLOW_NODES[id];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {setLocalJSON, getLocalJSON, removeLocal} from "../storageIO";
|
|
2
|
+
|
|
3
|
+
let axios = null;
|
|
4
|
+
export default {
|
|
5
|
+
name: "FLOW_USER_GLOBAL",
|
|
6
|
+
|
|
7
|
+
install(Vue,opts){
|
|
8
|
+
axios = opts.axios;
|
|
9
|
+
},
|
|
10
|
+
clearLoginToken(){
|
|
11
|
+
setLocalJSON('USERTOKEN', "");
|
|
12
|
+
localStorage["Authorization" + (window.projectSuffix || "")] = "";
|
|
13
|
+
axios.defaults.headers.common["Authorization"] = "";
|
|
14
|
+
},
|
|
15
|
+
setLoginToken(token){
|
|
16
|
+
setLocalJSON('USERTOKEN', "pl_token_" + token);
|
|
17
|
+
localStorage["Authorization" + (window.projectSuffix || "")] = "pl_token_" + token;
|
|
18
|
+
axios.defaults.headers.common["Authorization"] = "pl_token_" + token;
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
getLoginUser() {
|
|
22
|
+
return getLocalJSON('FLOW_LOGINUSER') || {};
|
|
23
|
+
},
|
|
24
|
+
setLoginUser(user) {
|
|
25
|
+
setLocalJSON('FLOW_LOGINUSER', user);
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
logout(){
|
|
29
|
+
removeLocal("LOGINUSER");
|
|
30
|
+
removeLocal("USERTOKEN");
|
|
31
|
+
localStorage.loginUser = null;
|
|
32
|
+
localStorage["Authorization" + (window.projectSuffix || "")] = "";
|
|
33
|
+
axios.defaults.headers.common["Authorization"] = "";
|
|
34
|
+
},
|
|
35
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
name:"INTER_CACHE",
|
|
3
|
+
cacheMap:{},
|
|
4
|
+
userMap:{},
|
|
5
|
+
userArr:null,
|
|
6
|
+
getCacheInfo(type){
|
|
7
|
+
return this.cacheMap[type];
|
|
8
|
+
},
|
|
9
|
+
setCacheInfo(type,data){
|
|
10
|
+
this.cacheMap[type] = data;
|
|
11
|
+
},
|
|
12
|
+
removeCacheInfo(type){
|
|
13
|
+
delete this.cacheMap[type];
|
|
14
|
+
if(type === 'userData'){
|
|
15
|
+
this.userArr = null;
|
|
16
|
+
this.userMap = {};
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
getUserArr(){
|
|
20
|
+
return this.userArr;
|
|
21
|
+
},
|
|
22
|
+
getUserMap(){
|
|
23
|
+
return this.userMap;
|
|
24
|
+
},
|
|
25
|
+
setUserArr(userArr){
|
|
26
|
+
this.userArr = userArr;
|
|
27
|
+
userArr.forEach(item => {
|
|
28
|
+
this.userMap[item.id] = item.userName;
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/*
|
|
2
|
+
** 获取storage
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const _getStorage = (type, key) => {
|
|
6
|
+
return window[type+'Storage'].getItem(key);
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
** 存入storage
|
|
11
|
+
*/
|
|
12
|
+
const _setStorage = (type, key, value) => {
|
|
13
|
+
window[type+'Storage'].setItem(key, value);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
** 根据key删除storage
|
|
18
|
+
*/
|
|
19
|
+
const _removeStorage = (type, key) => {
|
|
20
|
+
window[type+'Storage'].removeItem(key);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/*
|
|
24
|
+
** 清空storage
|
|
25
|
+
*/
|
|
26
|
+
const _clearStorage = (type) => {
|
|
27
|
+
window[type+'Storage'].clear();
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
const setSession = (key, value) => {
|
|
32
|
+
_setStorage('session', key, value);
|
|
33
|
+
};
|
|
34
|
+
const setSesionJSON = (key, value) => {
|
|
35
|
+
const jsonStr = JSON.stringify(value);
|
|
36
|
+
_setStorage('session', key, jsonStr);
|
|
37
|
+
};
|
|
38
|
+
const setLocal = (key, value) => {
|
|
39
|
+
_setStorage('local', key, value);
|
|
40
|
+
};
|
|
41
|
+
const setLocalJSON = (key, value) => {
|
|
42
|
+
const jsonStr = JSON.stringify(value);
|
|
43
|
+
let suffix = window.projectSuffix || "";
|
|
44
|
+
key += suffix;
|
|
45
|
+
_setStorage('local', key, jsonStr);
|
|
46
|
+
};
|
|
47
|
+
const getSession = key => {
|
|
48
|
+
return _getStorage('session', key);
|
|
49
|
+
};
|
|
50
|
+
const getSessionJSON = key => {
|
|
51
|
+
const value = _getStorage('session', key);
|
|
52
|
+
return JSON.parse(value);
|
|
53
|
+
};
|
|
54
|
+
const getLocal = key => {
|
|
55
|
+
return _getStorage('local', key);
|
|
56
|
+
};
|
|
57
|
+
const getLocalJSON = key => {
|
|
58
|
+
let suffix = window.projectSuffix || "";
|
|
59
|
+
key += suffix;
|
|
60
|
+
const value = _getStorage('local', key);
|
|
61
|
+
return JSON.parse(value);
|
|
62
|
+
};
|
|
63
|
+
const removeSession = key => {
|
|
64
|
+
_removeStorage('session', key);
|
|
65
|
+
};
|
|
66
|
+
const removeLocal = key => {
|
|
67
|
+
let suffix = window.projectSuffix || "";
|
|
68
|
+
key += suffix;
|
|
69
|
+
_removeStorage('local', key);
|
|
70
|
+
};
|
|
71
|
+
const clearSession = key => {
|
|
72
|
+
_clearStorage('session');
|
|
73
|
+
};
|
|
74
|
+
const clearLocal = key => {
|
|
75
|
+
_clearStorage('local');
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
setSession,
|
|
80
|
+
setSesionJSON,
|
|
81
|
+
setLocal,
|
|
82
|
+
setLocalJSON,
|
|
83
|
+
getSession,
|
|
84
|
+
getSessionJSON,
|
|
85
|
+
getLocal,
|
|
86
|
+
getLocalJSON,
|
|
87
|
+
removeSession,
|
|
88
|
+
removeLocal,
|
|
89
|
+
clearSession,
|
|
90
|
+
clearLocal
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export default {
|
|
94
|
+
setSession,
|
|
95
|
+
setSesionJSON,
|
|
96
|
+
setLocal,
|
|
97
|
+
setLocalJSON,
|
|
98
|
+
getSession,
|
|
99
|
+
getSessionJSON,
|
|
100
|
+
getLocal,
|
|
101
|
+
getLocalJSON,
|
|
102
|
+
removeSession,
|
|
103
|
+
removeLocal,
|
|
104
|
+
clearSession,
|
|
105
|
+
clearLocal
|
|
106
|
+
}
|