super-pages 0.0.7-up → 0.0.8-up
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/lib/super-pages.js +1 -1
- package/lib/super-pages.umd.cjs +1 -1
- package/package.json +12 -2
- package/index.html +0 -13
- package/packages/index.js +0 -30
- package/packages/super-page/index.js +0 -9
- package/packages/super-page/src/button-group.vue +0 -294
- package/packages/super-page/src/chart-page.vue +0 -215
- package/packages/super-page/src/chart-query-page.vue +0 -163
- package/packages/super-page/src/common-form-page.vue +0 -594
- package/packages/super-page/src/export-form-report-dialog.vue +0 -145
- package/packages/super-page/src/form-head.vue +0 -74
- package/packages/super-page/src/form-page.vue +0 -107
- package/packages/super-page/src/group-tag.vue +0 -21
- package/packages/super-page/src/list-page.vue +0 -1453
- package/packages/super-page/src/list-toolbar-dynamic-source.vue +0 -89
- package/packages/super-page/src/list-toolbar-page.vue +0 -377
- package/packages/super-page/src/my-button-base.vue +0 -438
- package/packages/super-page/src/my-button.vue +0 -196
- package/packages/super-page/src/page-custom-component.vue +0 -56
- package/packages/super-page/src/remove-signer-dialog.vue +0 -103
- package/packages/super-page/src/sub-tab-page.vue +0 -79
- package/packages/super-page/src/super-page-component.vue +0 -86
- package/packages/super-page/src/super-page.vue +0 -162
- package/packages/super-page/src/tab-page.vue +0 -154
- package/packages/super-page/src/task-informition-dialog.vue +0 -82
- package/packages/super-page/src/util/ListButtonEvent.js +0 -896
- package/packages/super-page/src/util/api.js +0 -37
- package/packages/super-page/src/util/callEvents.js +0 -62
- package/packages/super-page/src/util/chartButtonEvent.js +0 -60
- package/packages/super-page/src/util/common-util.js +0 -102
- package/packages/super-page/src/util/commonButtonEvent.js +0 -70
- package/packages/super-page/src/util/eventBus.js +0 -8
- package/packages/super-page/src/util/formButtonEvent.js +0 -509
- package/packages/super-page/src/util/store.js +0 -3
- package/packages/super-page/src/util/super-page.js +0 -29
- package/packages/super-page/src/util/util.js +0 -1491
- package/packages/super-page/src/util/workflowButtonEvent.js +0 -1729
- package/packages/super-page/src/widget-col-page.vue +0 -339
- package/packages/super-page/src/widget-page.vue +0 -703
- package/packages/super-page/src/widget-sub-tab-pane-page.vue +0 -115
- package/packages/super-page/src/widget-tab-pane-page.vue +0 -135
- package/packages/super-page/src/workflow-button-group.vue +0 -561
- package/packages/super-page/src/workflow-form-page.vue +0 -1310
- package/packages/super-page-dialog/index.js +0 -9
- package/packages/super-page-dialog/src/super-page-dialog.vue +0 -200
- package/packages/utils/gogocodeTransfer.js +0 -59
- package/public/vite.svg +0 -1
- package/src/i18n/i18n.js +0 -16
- package/src/i18n/langs/cn.js +0 -65
- package/src/i18n/langs/en.js +0 -68
- package/src/styles/index.scss +0 -4
- package/src/utils/common-util.js +0 -9
- package/vite.config.js +0 -36
|
@@ -1,1310 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<template v-if="isShowForm">
|
|
4
|
-
<button-group
|
|
5
|
-
v-if="
|
|
6
|
-
isShowBuuton &&
|
|
7
|
-
colSetting.options.buttonGroup &&
|
|
8
|
-
refreshButton &&
|
|
9
|
-
colSetting.options.buttonGroup.length > 0
|
|
10
|
-
"
|
|
11
|
-
ref="buttonGroup"
|
|
12
|
-
:button-groups="colSetting.options.buttonGroup"
|
|
13
|
-
:permission-prefix="permissionPrefix"
|
|
14
|
-
:is-task-input="isTaskInput"
|
|
15
|
-
:workflow-button-component="workflowButtonComponent"
|
|
16
|
-
:table-name="tableName"
|
|
17
|
-
:work-name-color="workNameColor"
|
|
18
|
-
:task-name="currentActivityName"
|
|
19
|
-
:button-area-custom-component-arr="
|
|
20
|
-
colSetting.options.buttonAreaCustomComponentArr
|
|
21
|
-
"
|
|
22
|
-
:form-button-position="formButtonPosition"
|
|
23
|
-
:class="
|
|
24
|
-
formButtonPosition === 'topLeft'
|
|
25
|
-
? 'button-at-top'
|
|
26
|
-
: 'button-at-bottom'
|
|
27
|
-
"
|
|
28
|
-
position="workflowForm"
|
|
29
|
-
:page-code="pageCode"
|
|
30
|
-
:form-data-fun="getFormData"
|
|
31
|
-
:get-form-data="saveWorkflowFormData"
|
|
32
|
-
@refresh="refreshForm"
|
|
33
|
-
@workflowClick="clickWorkflowButtonOn"
|
|
34
|
-
@click="clickWorkflowExtensionButtonOn"
|
|
35
|
-
@refreshFrom="clickRefreshFrom"
|
|
36
|
-
@prohibi-edit="fnProhibitToEdit"
|
|
37
|
-
/>
|
|
38
|
-
<form-head
|
|
39
|
-
v-if="formTitle || formNo || formNoLabel"
|
|
40
|
-
:form-title="formTitle"
|
|
41
|
-
:form-no="formNo"
|
|
42
|
-
:form-button-position="formButtonPosition"
|
|
43
|
-
:form-no-label="formNoLabel"
|
|
44
|
-
/>
|
|
45
|
-
<!--修改记录时-->
|
|
46
|
-
<super-form
|
|
47
|
-
v-if="formViewId && isShow"
|
|
48
|
-
ref="superForm"
|
|
49
|
-
:form-view-id="formViewId"
|
|
50
|
-
:form-button-position="formButtonPosition"
|
|
51
|
-
:path-query="pathQuery"
|
|
52
|
-
:value="formData"
|
|
53
|
-
:tab-code="tabCode"
|
|
54
|
-
:is-page-info="
|
|
55
|
-
isPreview !== undefined && isPreview !== null ? isPreview : false
|
|
56
|
-
"
|
|
57
|
-
:options="formOptions"
|
|
58
|
-
@shou-button="reviewButton"
|
|
59
|
-
@transmitFormConfig="transmitFormConfig"
|
|
60
|
-
@change-grid-rows-per-page="changeSubTablePageSize"
|
|
61
|
-
/>
|
|
62
|
-
<!--新建记录时-->
|
|
63
|
-
<super-form
|
|
64
|
-
v-else-if="isShow"
|
|
65
|
-
ref="superForm"
|
|
66
|
-
:form-button-position="formButtonPosition"
|
|
67
|
-
:form-view-code="formViewCode"
|
|
68
|
-
:form-view-version="formViewVersion"
|
|
69
|
-
:path-query="pathQuery"
|
|
70
|
-
:is-page-info="
|
|
71
|
-
isPreview !== undefined && isPreview !== null ? isPreview : false
|
|
72
|
-
"
|
|
73
|
-
:tab-code="tabCode"
|
|
74
|
-
:value="formData ? formData : {}"
|
|
75
|
-
:options="formOptions"
|
|
76
|
-
@shou-button="reviewButton"
|
|
77
|
-
@transmitFormConfig="transmitFormConfig"
|
|
78
|
-
@change-grid-rows-per-page="changeSubTablePageSize"
|
|
79
|
-
/>
|
|
80
|
-
</template>
|
|
81
|
-
<task-informition-dialog
|
|
82
|
-
v-if="showTaskInformitions"
|
|
83
|
-
:task-informitions="taskInformitions"
|
|
84
|
-
@close="showTaskInformitions = false"
|
|
85
|
-
@result="myReturnTaskTo"
|
|
86
|
-
/>
|
|
87
|
-
<!-- 部门人员树 -->
|
|
88
|
-
<department-user-tree
|
|
89
|
-
v-if="selectAddSignerUser || selectCopyUser || selectAssignUser"
|
|
90
|
-
width="60%"
|
|
91
|
-
:multiple="isMulti"
|
|
92
|
-
@close="closeDeptUserTree"
|
|
93
|
-
/>
|
|
94
|
-
<remove-signer-dialog
|
|
95
|
-
v-if="showRemoveSigner"
|
|
96
|
-
:task-id="completeTaskParam ? completeTaskParam.taskId : null"
|
|
97
|
-
:active-tasks="activeTasks"
|
|
98
|
-
@close="showRemoveSigner = false"
|
|
99
|
-
@result="myDoRemoveSigners"
|
|
100
|
-
/>
|
|
101
|
-
<super-page-dialog
|
|
102
|
-
v-if="isShowPageDialog"
|
|
103
|
-
:preview="isPreview"
|
|
104
|
-
:dev-mode="pageDevMode"
|
|
105
|
-
:jump-page-setting="jumpPageSetting"
|
|
106
|
-
@update-value="updateValues"
|
|
107
|
-
@close="closeInPage"
|
|
108
|
-
/>
|
|
109
|
-
</div>
|
|
110
|
-
</template>
|
|
111
|
-
|
|
112
|
-
<script>
|
|
113
|
-
import Util from './util/util'
|
|
114
|
-
import ButtonGroup from './button-group'
|
|
115
|
-
import workflowButtonEvents from './util/workflowButtonEvent'
|
|
116
|
-
import TaskInformitionDialog from './task-informition-dialog'
|
|
117
|
-
import RemoveSignerDialog from './remove-signer-dialog'
|
|
118
|
-
import formHead from './form-head'
|
|
119
|
-
import callEvents from './util/callEvents'
|
|
120
|
-
import apis from './util/api'
|
|
121
|
-
import { getStoreInfo, setStoreInfo } from './util/common-util'
|
|
122
|
-
import eventBus from './util/eventBus'
|
|
123
|
-
import { isPromise } from 'imatrix-ui/src/utils/common-util'
|
|
124
|
-
export default {
|
|
125
|
-
name: 'WorkflowFormPage',
|
|
126
|
-
components: {
|
|
127
|
-
ButtonGroup,
|
|
128
|
-
TaskInformitionDialog,
|
|
129
|
-
RemoveSignerDialog,
|
|
130
|
-
formHead,
|
|
131
|
-
},
|
|
132
|
-
props: {
|
|
133
|
-
// 表单布局配置
|
|
134
|
-
colSetting: {
|
|
135
|
-
type: Object,
|
|
136
|
-
default: null,
|
|
137
|
-
},
|
|
138
|
-
// 表单页面修改记录时记录id
|
|
139
|
-
dataId: {
|
|
140
|
-
type: Number,
|
|
141
|
-
default: null,
|
|
142
|
-
},
|
|
143
|
-
// 流程表单页面办理任务时任务id
|
|
144
|
-
taskId: {
|
|
145
|
-
type: Number,
|
|
146
|
-
default: null,
|
|
147
|
-
},
|
|
148
|
-
// 流程办理发送邮件对应的模板
|
|
149
|
-
emailTemplateCode: {
|
|
150
|
-
type: String,
|
|
151
|
-
default: null,
|
|
152
|
-
},
|
|
153
|
-
// 页面编码
|
|
154
|
-
pageCode: {
|
|
155
|
-
type: String,
|
|
156
|
-
default: null,
|
|
157
|
-
},
|
|
158
|
-
// 页签编码
|
|
159
|
-
tabCode: {
|
|
160
|
-
type: String,
|
|
161
|
-
default: null,
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
data() {
|
|
165
|
-
const pathQuery = getStoreInfo(this.pageCode, '_pathQuery')
|
|
166
|
-
const system = getStoreInfo(this.pageCode, '_systemInfo')
|
|
167
|
-
// 实体类名,首字母小写
|
|
168
|
-
const entityName = this.colSetting.baseSetting.modelDataTableEntityName
|
|
169
|
-
// 业务处理类bean名称
|
|
170
|
-
const beanName = this.colSetting.baseSetting.beanName
|
|
171
|
-
const pageCode = getStoreInfo(this.pageCode, '_pageCode')
|
|
172
|
-
let permissionPrefix
|
|
173
|
-
if (system) {
|
|
174
|
-
permissionPrefix =
|
|
175
|
-
system.code +
|
|
176
|
-
'.' +
|
|
177
|
-
pageCode +
|
|
178
|
-
'.' +
|
|
179
|
-
this.colSetting.baseSetting.componentCode
|
|
180
|
-
}
|
|
181
|
-
const isSqlQuery = getStoreInfo(this.pageCode, '_pageIsDsc')
|
|
182
|
-
let isTaskInput = false
|
|
183
|
-
if (typeof this.taskId !== 'undefined' && this.taskId !== null) {
|
|
184
|
-
isTaskInput = true
|
|
185
|
-
}
|
|
186
|
-
let formNoRuleCode = ''
|
|
187
|
-
if (this.colSetting.options && this.colSetting.options.formNoRuleCode) {
|
|
188
|
-
formNoRuleCode = this.colSetting.options.formNoRuleCode
|
|
189
|
-
}
|
|
190
|
-
let isBatchProcessing = false
|
|
191
|
-
if (this.colSetting.options && this.colSetting.options.isBatchProcessing) {
|
|
192
|
-
isBatchProcessing = this.colSetting.options.isBatchProcessing
|
|
193
|
-
}
|
|
194
|
-
const pageHeight = getStoreInfo(this.pageCode, '_pageHeight')
|
|
195
|
-
const formOptions = {
|
|
196
|
-
isSql: isSqlQuery,
|
|
197
|
-
pageCode: this.pageCode,
|
|
198
|
-
pageHeight: pageHeight,
|
|
199
|
-
}
|
|
200
|
-
if (system) {
|
|
201
|
-
// 当前系统,表示是当前的自定义系统信息
|
|
202
|
-
formOptions.system = system
|
|
203
|
-
}
|
|
204
|
-
const isView = this.isViewDetail()
|
|
205
|
-
if (isView) {
|
|
206
|
-
// 查看详情页面中控制所有字段禁止编辑
|
|
207
|
-
formOptions.fieldPermissions = [{ name: 'all_fields', canEdit: false }]
|
|
208
|
-
}
|
|
209
|
-
let isPreview = getStoreInfo(this.pageCode, '_pagePreview')
|
|
210
|
-
if (isPreview === undefined) {
|
|
211
|
-
isPreview = false
|
|
212
|
-
}
|
|
213
|
-
let pageDevMode = getStoreInfo(this.pageCode, '_pageDevMode')
|
|
214
|
-
if (pageDevMode === null || pageDevMode === undefined) {
|
|
215
|
-
pageDevMode = false
|
|
216
|
-
}
|
|
217
|
-
formOptions.devMode = pageDevMode
|
|
218
|
-
let formViewVersion = null
|
|
219
|
-
if (this.colSetting.baseSetting.modelVersion) {
|
|
220
|
-
formViewVersion = parseInt(this.colSetting.baseSetting.modelVersion)
|
|
221
|
-
}
|
|
222
|
-
const formViewCode = this.colSetting.baseSetting.modelCode
|
|
223
|
-
// 表单事件集合
|
|
224
|
-
let formEvents = []
|
|
225
|
-
const pageEvents = getStoreInfo(this.pageCode, '_pageEvents')
|
|
226
|
-
if (pageEvents) {
|
|
227
|
-
formEvents = pageEvents.formEvents
|
|
228
|
-
}
|
|
229
|
-
formOptions.events = this.packageFormEvents(formViewCode)
|
|
230
|
-
let formButtonPosition = getStoreInfo(
|
|
231
|
-
getStoreInfo(this.pageCode, '_pageCode'),
|
|
232
|
-
'_formButtonPosition'
|
|
233
|
-
)
|
|
234
|
-
if (!formButtonPosition) {
|
|
235
|
-
formButtonPosition = 'topLeft'
|
|
236
|
-
}
|
|
237
|
-
return {
|
|
238
|
-
formViewCode,
|
|
239
|
-
formViewVersion,
|
|
240
|
-
tableName: this.colSetting.baseSetting.modelDataTableCode,
|
|
241
|
-
entityName: entityName,
|
|
242
|
-
beanName,
|
|
243
|
-
formTitle: this.colSetting.baseSetting.formTitle, // 表单标题
|
|
244
|
-
myJsContent: null, // 事件的自定义js内容
|
|
245
|
-
successOperation: null, // 成功后操作
|
|
246
|
-
formData: null, // 表单数据
|
|
247
|
-
isShowForm: false, // 是否显示表单
|
|
248
|
-
isShow: true, // 用于刷新表单重新加载表单使用
|
|
249
|
-
definitionId: null, /// 流程定义id
|
|
250
|
-
formViewId: null, // 修改流程表单页面时把表单id传到前台
|
|
251
|
-
formOptions, // 表单组件配置项
|
|
252
|
-
workflowButtonComponent: {}, // 流程按钮组需要的参数
|
|
253
|
-
completeTaskParam: {}, // 不能删除,页面事件里会使用这个变量进行自定义填写意见
|
|
254
|
-
permissionPrefix,
|
|
255
|
-
system,
|
|
256
|
-
showTaskInformitions: false, // 是否显示“选择可退回环节弹框”
|
|
257
|
-
taskInformitions: [], // 可退回的环节集合
|
|
258
|
-
selectTaskNode: null, // 选中的环节
|
|
259
|
-
isTaskInput, // 是否是任务办理页面
|
|
260
|
-
formNoRuleCode, // 表单编号规则定义的编号
|
|
261
|
-
isEnableRequired: true, // 是否启用必填验证
|
|
262
|
-
defaultOpinionAttrName: '_defaultOpinion_', // 意见控件的默认属性名
|
|
263
|
-
judgeHeavyList: this.colSetting.options.judgeHeavyList, // 判重组合字段配置
|
|
264
|
-
notIdInitializationList: this.colSetting.options.notIdInitializationList, // 无id或taskId时初始化配置
|
|
265
|
-
dataConversionRule: null, // 数据转换规则编码
|
|
266
|
-
formNo: null, // 根据表单编码规则生成的表单编码
|
|
267
|
-
formNoLabel: this.colSetting.baseSetting.formNoLabel, // 表单编号名称
|
|
268
|
-
selectAddSignerUser: false, // 选择加签办理人状态位,用于控制人员树是否显示
|
|
269
|
-
selectCopyUser: false, // 选择抄送人员状态位,用于控制人员树是否显示
|
|
270
|
-
selectAssignUser: false, // 选择指派人员状态为,用于控制人员树是否显示
|
|
271
|
-
showRemoveSigner: false, // 是否显示“减签”弹框
|
|
272
|
-
activeTasks: [], // 当前环节所有待办任务
|
|
273
|
-
formModel: null, // 当前表单信息
|
|
274
|
-
isMulti: true, // 是否是多选组织结构树
|
|
275
|
-
taskName: null, // 当前任务名称
|
|
276
|
-
currentActivityName: null, // 当前任务名称
|
|
277
|
-
isPreview, // 是否是预览页面
|
|
278
|
-
additionalParamMap: null, // 解析好的附加参数
|
|
279
|
-
dataTypeMap: null, // 数据类型map集合,key为字段名,value为字段类型,优化保存速度
|
|
280
|
-
formEvents, // 表单事件维护
|
|
281
|
-
logSetting: null, // 日志维护
|
|
282
|
-
pathQuery,
|
|
283
|
-
refreshButton: true,
|
|
284
|
-
ids: null,
|
|
285
|
-
pageDevMode,
|
|
286
|
-
isBatchProcessing, // 是否是批量处理
|
|
287
|
-
isShowPageDialog: false, // 是否显示弹框页面
|
|
288
|
-
jumpPageSetting: null, // 弹框页面的设置信息
|
|
289
|
-
isSqlQuery,
|
|
290
|
-
isNeedValueMapping: false, // 关闭弹框时是否需要字段映射
|
|
291
|
-
firstNodeInfo: null, // 第一节点的信息
|
|
292
|
-
customEvents: pageEvents ? pageEvents.customEvents : null,
|
|
293
|
-
isShowBuuton: false,
|
|
294
|
-
formButtonPosition, // 表单按钮显示位置,
|
|
295
|
-
pageType: 'form', // 页面类型
|
|
296
|
-
subTablePageInfo: {}, // 表单子表每页显示多少条件记录
|
|
297
|
-
workNameColor: '',
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
watch: {
|
|
301
|
-
taskName(val) {
|
|
302
|
-
this.currentActivityName = val
|
|
303
|
-
},
|
|
304
|
-
jumpPageSetting: {
|
|
305
|
-
deep: true,
|
|
306
|
-
handler(jumpPageSetting) {
|
|
307
|
-
if (jumpPageSetting && jumpPageSetting !== null) {
|
|
308
|
-
const that = this
|
|
309
|
-
eventBus.$on(
|
|
310
|
-
jumpPageSetting.pageCode + '-close-dialog',
|
|
311
|
-
(pageCode, successOperation, popEntity, popPageCode) => {
|
|
312
|
-
if (pageCode === jumpPageSetting.pageCode) {
|
|
313
|
-
that.closeInPageEvent(
|
|
314
|
-
popEntity,
|
|
315
|
-
popPageCode,
|
|
316
|
-
successOperation,
|
|
317
|
-
that
|
|
318
|
-
)
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
// 关闭事件
|
|
322
|
-
eventBus.$off(pageCode + '-close-dialog')
|
|
323
|
-
}
|
|
324
|
-
)
|
|
325
|
-
}
|
|
326
|
-
},
|
|
327
|
-
},
|
|
328
|
-
},
|
|
329
|
-
created() {
|
|
330
|
-
const additionalParamMap = getStoreInfo(this.pageCode, 'additionalParamMap')
|
|
331
|
-
if (additionalParamMap) {
|
|
332
|
-
this.additionalParamMap = additionalParamMap
|
|
333
|
-
this.formOptions.additionalParamMap = additionalParamMap
|
|
334
|
-
console.log('workflow-form-page已获取到附加参数', additionalParamMap)
|
|
335
|
-
}
|
|
336
|
-
if (this.pathQuery && this.pathQuery.ids && this.pathQuery.ids !== '') {
|
|
337
|
-
if (typeof this.pathQuery.ids === 'string') {
|
|
338
|
-
this.ids = this.pathQuery.ids.split(',')
|
|
339
|
-
} else if (typeof this.pathQuery.ids === 'object') {
|
|
340
|
-
this.ids = this.pathQuery.ids
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
// 非预览页面时才需要请求数据
|
|
344
|
-
this.initWorkflowFormData()
|
|
345
|
-
const that = this
|
|
346
|
-
eventBus.$on(
|
|
347
|
-
that.pageCode + '-close-component-page-dialog',
|
|
348
|
-
(jumpInfo, popEntity, popPageCode) => {
|
|
349
|
-
console.log(
|
|
350
|
-
'closeFormPageDialog-workflow------',
|
|
351
|
-
jumpInfo,
|
|
352
|
-
popEntity,
|
|
353
|
-
popPageCode
|
|
354
|
-
)
|
|
355
|
-
that.closeFormPageDialog(jumpInfo, that, popEntity, popPageCode)
|
|
356
|
-
}
|
|
357
|
-
)
|
|
358
|
-
// 关闭弹框事件回调使用
|
|
359
|
-
eventBus.$on(this.pageCode + '_close-dialog-get-entity', () => {
|
|
360
|
-
eventBus.$emit(that.pageCode + '_close-super-dialog', that.formData)
|
|
361
|
-
})
|
|
362
|
-
// TODO:刷新指定页签的表单数据。暂时没有该需求,后面有这个需求再实现
|
|
363
|
-
// eventBus.$on(that.pageCode + '-refresh-tab', (tabCode, entity) => {
|
|
364
|
-
// if (that.$refs.superForm && tabCode !== undefined && tabCode === that.tabCode && entity) {
|
|
365
|
-
// that.$refs.superForm.refresh(entity)
|
|
366
|
-
// }
|
|
367
|
-
// })
|
|
368
|
-
},
|
|
369
|
-
mounted() {},
|
|
370
|
-
beforeUnmount() {
|
|
371
|
-
eventBus.$off(this.pageCode + '-close-component-page-dialog')
|
|
372
|
-
eventBus.$off(this.pageCode + '_close-dialog-get-entity')
|
|
373
|
-
// eventBus.$off(this.pageCode + '-refresh-tab')
|
|
374
|
-
},
|
|
375
|
-
methods: {
|
|
376
|
-
...Util,
|
|
377
|
-
...workflowButtonEvents,
|
|
378
|
-
...callEvents,
|
|
379
|
-
...apis,
|
|
380
|
-
// 传递表单属性配置
|
|
381
|
-
transmitFormConfig(config) {
|
|
382
|
-
if (config && config.currentLinkNameColor) {
|
|
383
|
-
this.workNameColor = config.currentLinkNameColor
|
|
384
|
-
}
|
|
385
|
-
},
|
|
386
|
-
// 响应点击流程按钮
|
|
387
|
-
clickWorkflowButtonOn(
|
|
388
|
-
event,
|
|
389
|
-
operation,
|
|
390
|
-
eventSetting,
|
|
391
|
-
workflowButton,
|
|
392
|
-
completeTaskParam
|
|
393
|
-
) {
|
|
394
|
-
console.log('clickWorkflowButtonOn-eventSetting', eventSetting)
|
|
395
|
-
// console.log('----clickWorkflowButton---', event, operation, eventSetting, workflowButton)
|
|
396
|
-
// operation 表示是办理任务时,点击的按钮,例如:提交(SUBMIT)
|
|
397
|
-
if (this.isPreview) {
|
|
398
|
-
// 预览页面时不走按钮操作
|
|
399
|
-
return
|
|
400
|
-
}
|
|
401
|
-
// console.log('form-clickWorkflowButton--', event, operation, eventSetting, workflowButton)
|
|
402
|
-
// 是否启用必填验证
|
|
403
|
-
let isEnableRequired = false
|
|
404
|
-
if (eventSetting && typeof eventSetting.isRequired !== 'undefined') {
|
|
405
|
-
isEnableRequired = eventSetting.isRequired
|
|
406
|
-
} else if (this.isDealFlowButton(event)) {
|
|
407
|
-
isEnableRequired = true
|
|
408
|
-
}
|
|
409
|
-
if (event === 'startInstance' || event === 'update') {
|
|
410
|
-
// 暂存按钮不验证必填
|
|
411
|
-
isEnableRequired = false
|
|
412
|
-
}
|
|
413
|
-
// 退回按钮有用这个属性
|
|
414
|
-
this.isEnableRequired = isEnableRequired
|
|
415
|
-
that.saveWorkflowFormData(isEnableRequired).then(async (model) => {
|
|
416
|
-
if (model && model !== false) {
|
|
417
|
-
// 如果model的值为true,表示验证失败,否则表示验证成功
|
|
418
|
-
let eventName = this.formViewCode + '__' + event
|
|
419
|
-
if (event === 'update') {
|
|
420
|
-
// 修改时点击暂存按钮的回调方法
|
|
421
|
-
eventName = this.formViewCode + '__' + 'startInstance'
|
|
422
|
-
}
|
|
423
|
-
let beforeClickResult = this.callBeforeClickButton(
|
|
424
|
-
this.formEvents,
|
|
425
|
-
eventName,
|
|
426
|
-
{
|
|
427
|
-
params: this.additionalParamMap,
|
|
428
|
-
additionalParamMap: this.additionalParamMap,
|
|
429
|
-
entity: model,
|
|
430
|
-
operation,
|
|
431
|
-
eventSetting: eventSetting,
|
|
432
|
-
button: workflowButton,
|
|
433
|
-
formNoRuleCode: this.formNoRuleCode,
|
|
434
|
-
subTablePageInfo: this.subTablePageInfo,
|
|
435
|
-
}
|
|
436
|
-
)
|
|
437
|
-
console.log('点击前事件返回结果-------', beforeClickResult)
|
|
438
|
-
if (isPromise(beforeClickResult)) {
|
|
439
|
-
await beforeClickResult.then((result) => {
|
|
440
|
-
console.log('点击前事件返回结果--Promise--resolve---', result)
|
|
441
|
-
beforeClickResult = result
|
|
442
|
-
})
|
|
443
|
-
}
|
|
444
|
-
if (!beforeClickResult) {
|
|
445
|
-
// 返回值为false,不继续执行按钮操作
|
|
446
|
-
// 按钮显示状态设为true,即显示按钮
|
|
447
|
-
this.hasLoaded = true
|
|
448
|
-
return
|
|
449
|
-
}
|
|
450
|
-
if (isPromise(beforeClickResult)) {
|
|
451
|
-
beforeClickResult.then((result) => {
|
|
452
|
-
if (result) {
|
|
453
|
-
this.clickWorkflowButtonOnSuccess(
|
|
454
|
-
event,
|
|
455
|
-
operation,
|
|
456
|
-
eventSetting,
|
|
457
|
-
workflowButton,
|
|
458
|
-
model
|
|
459
|
-
)
|
|
460
|
-
}
|
|
461
|
-
})
|
|
462
|
-
} else {
|
|
463
|
-
this.clickWorkflowButtonOnSuccess(
|
|
464
|
-
event,
|
|
465
|
-
operation,
|
|
466
|
-
eventSetting,
|
|
467
|
-
workflowButton,
|
|
468
|
-
model
|
|
469
|
-
)
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
})
|
|
473
|
-
},
|
|
474
|
-
clickWorkflowButtonOnSuccess(
|
|
475
|
-
event,
|
|
476
|
-
operation,
|
|
477
|
-
eventSetting,
|
|
478
|
-
workflowButton,
|
|
479
|
-
model
|
|
480
|
-
) {
|
|
481
|
-
// 获得当前环节的“逻辑设置”,包括:“意见是否必填”和“可执行条件”、“自动设值”、“转换规则”
|
|
482
|
-
this.logicSetting = this.getCurrentNodeLogicSetting(
|
|
483
|
-
workflowButton,
|
|
484
|
-
model,
|
|
485
|
-
event
|
|
486
|
-
)
|
|
487
|
-
// console.log('clickWorkflowButtonOn-this.logicSetting =', this.logicSetting)
|
|
488
|
-
let jsContent = false
|
|
489
|
-
if (eventSetting && typeof eventSetting.jsContent !== 'undefined') {
|
|
490
|
-
jsContent = eventSetting.jsContent
|
|
491
|
-
}
|
|
492
|
-
this.myJsContent = jsContent
|
|
493
|
-
if (eventSetting) {
|
|
494
|
-
this.isNeedValueMapping = eventSetting.isNeedValueMapping
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
let successOperation = false
|
|
498
|
-
if (
|
|
499
|
-
eventSetting &&
|
|
500
|
-
typeof eventSetting.successOperation !== 'undefined'
|
|
501
|
-
) {
|
|
502
|
-
successOperation = eventSetting.successOperation
|
|
503
|
-
}
|
|
504
|
-
this.successOperation = successOperation
|
|
505
|
-
let logSetting = false
|
|
506
|
-
if (eventSetting && typeof eventSetting.logSetting !== 'undefined') {
|
|
507
|
-
logSetting = eventSetting.logSetting
|
|
508
|
-
}
|
|
509
|
-
this.logSetting = logSetting
|
|
510
|
-
let dataConversionRule = ''
|
|
511
|
-
if (
|
|
512
|
-
this.logicSetting &&
|
|
513
|
-
this.logicSetting.current &&
|
|
514
|
-
typeof this.logicSetting.current.dataConversionRule !== 'undefined'
|
|
515
|
-
) {
|
|
516
|
-
dataConversionRule = this.logicSetting.current.dataConversionRule
|
|
517
|
-
}
|
|
518
|
-
let autoSetValueData = ''
|
|
519
|
-
if (
|
|
520
|
-
this.logicSetting &&
|
|
521
|
-
this.logicSetting.current &&
|
|
522
|
-
typeof this.logicSetting.current.autoSetValueData !== 'undefined'
|
|
523
|
-
) {
|
|
524
|
-
autoSetValueData = this.logicSetting.current.autoSetValueData
|
|
525
|
-
}
|
|
526
|
-
let taskMap = null
|
|
527
|
-
if (
|
|
528
|
-
eventSetting &&
|
|
529
|
-
eventSetting.taskMap &&
|
|
530
|
-
typeof eventSetting.taskMap !== 'undefined'
|
|
531
|
-
) {
|
|
532
|
-
taskMap = eventSetting.taskMap
|
|
533
|
-
}
|
|
534
|
-
const needDeleteFileUuid = this.getNeedDeleteFileUuidS()
|
|
535
|
-
if (event === 'returnTaskTo') {
|
|
536
|
-
// 退回按钮
|
|
537
|
-
this.dataConversionRule = dataConversionRule
|
|
538
|
-
this.getTaskInformitions(this.system, this.entityName, this.beanName)
|
|
539
|
-
} else if (event === 'returnToPreviousTask') {
|
|
540
|
-
// 驳回
|
|
541
|
-
this.returnToPreviousTask(
|
|
542
|
-
this.system,
|
|
543
|
-
this.tableName,
|
|
544
|
-
model,
|
|
545
|
-
this.formViewCode,
|
|
546
|
-
this.formViewVersion,
|
|
547
|
-
this.entityName,
|
|
548
|
-
jsContent,
|
|
549
|
-
successOperation,
|
|
550
|
-
this.isNeedValueMapping,
|
|
551
|
-
taskMap,
|
|
552
|
-
this.beanName
|
|
553
|
-
)
|
|
554
|
-
} else if (event === 'endInstance') {
|
|
555
|
-
// 强制结束
|
|
556
|
-
this.endInstance(
|
|
557
|
-
this.system,
|
|
558
|
-
this.tableName,
|
|
559
|
-
model,
|
|
560
|
-
this.formViewCode,
|
|
561
|
-
this.formViewVersion,
|
|
562
|
-
this.entityName,
|
|
563
|
-
jsContent,
|
|
564
|
-
successOperation,
|
|
565
|
-
this.isNeedValueMapping,
|
|
566
|
-
taskMap,
|
|
567
|
-
this.beanName
|
|
568
|
-
)
|
|
569
|
-
} else {
|
|
570
|
-
if (
|
|
571
|
-
!this.logicSetting ||
|
|
572
|
-
this.validateOpinion(this.logicSetting.current, operation, model) ===
|
|
573
|
-
true
|
|
574
|
-
) {
|
|
575
|
-
// 表示意见已填,或不需要必填意见
|
|
576
|
-
this.canExecuteWorkflow(model, event).then((result) => {
|
|
577
|
-
if (result.canExecute === true) {
|
|
578
|
-
// 表示可执行
|
|
579
|
-
const entities = result.entities
|
|
580
|
-
if (entities && entities.length > 0) {
|
|
581
|
-
model = entities[0]
|
|
582
|
-
}
|
|
583
|
-
let endLogicSetting = null
|
|
584
|
-
if (this.logicSetting) {
|
|
585
|
-
endLogicSetting = this.logicSetting.end
|
|
586
|
-
}
|
|
587
|
-
this.formModel = model
|
|
588
|
-
this.clickWorflowButton(
|
|
589
|
-
event,
|
|
590
|
-
this.system,
|
|
591
|
-
this.tableName,
|
|
592
|
-
model,
|
|
593
|
-
this.definitionId,
|
|
594
|
-
this.emailTemplateCode,
|
|
595
|
-
operation,
|
|
596
|
-
this.formViewCode,
|
|
597
|
-
this.formViewVersion,
|
|
598
|
-
this.entityName,
|
|
599
|
-
jsContent,
|
|
600
|
-
this.formNoRuleCode,
|
|
601
|
-
successOperation,
|
|
602
|
-
dataConversionRule,
|
|
603
|
-
endLogicSetting,
|
|
604
|
-
autoSetValueData,
|
|
605
|
-
this.logSetting,
|
|
606
|
-
null,
|
|
607
|
-
null,
|
|
608
|
-
workflowButton ? workflowButton.isNeedValueMapping : false,
|
|
609
|
-
taskMap,
|
|
610
|
-
needDeleteFileUuid,
|
|
611
|
-
this.beanName
|
|
612
|
-
)
|
|
613
|
-
}
|
|
614
|
-
})
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
},
|
|
618
|
-
// 响应点击流程表单页面中的扩展按钮
|
|
619
|
-
clickWorkflowExtensionButtonOn(button) {
|
|
620
|
-
console.log('clickWorkflowExtensionButtonOn====button=', button)
|
|
621
|
-
const that = this
|
|
622
|
-
if (that.isPreview) {
|
|
623
|
-
// 预览页面时不走按钮操作
|
|
624
|
-
return
|
|
625
|
-
}
|
|
626
|
-
if (button) {
|
|
627
|
-
if (button.code === 'downloadTemplate') {
|
|
628
|
-
this.downloadTemplate(that.system, button, this.tableName)
|
|
629
|
-
return
|
|
630
|
-
}
|
|
631
|
-
// 是否启用必填验证
|
|
632
|
-
let isEnableRequired = false
|
|
633
|
-
if (
|
|
634
|
-
typeof button.isRequired === 'undefined' &&
|
|
635
|
-
button.code === 'exportForm'
|
|
636
|
-
) {
|
|
637
|
-
// 导出报告按钮不验证表单
|
|
638
|
-
isEnableRequired = false
|
|
639
|
-
}
|
|
640
|
-
if (typeof button.isRequired !== 'undefined') {
|
|
641
|
-
isEnableRequired = button.isRequired
|
|
642
|
-
}
|
|
643
|
-
that.saveWorkflowFormData(isEnableRequired).then(async (model) => {
|
|
644
|
-
if (model && model !== false) {
|
|
645
|
-
let beforeClickResult = this.callBeforeClickButton(
|
|
646
|
-
this.formEvents,
|
|
647
|
-
this.formViewCode + '__' + button.code,
|
|
648
|
-
{
|
|
649
|
-
params: this.additionalParamMap,
|
|
650
|
-
additionalParamMap: this.additionalParamMap,
|
|
651
|
-
entity: model,
|
|
652
|
-
subTablePageInfo: this.subTablePageInfo,
|
|
653
|
-
}
|
|
654
|
-
)
|
|
655
|
-
if (isPromise(beforeClickResult)) {
|
|
656
|
-
await beforeClickResult.then((result) => {
|
|
657
|
-
console.log('点击前事件返回结果--Promise--resolve---', result)
|
|
658
|
-
beforeClickResult = result
|
|
659
|
-
})
|
|
660
|
-
}
|
|
661
|
-
if (!beforeClickResult) {
|
|
662
|
-
// 返回值为false,不继续执行按钮操作
|
|
663
|
-
return
|
|
664
|
-
}
|
|
665
|
-
if (isPromise(beforeClickResult)) {
|
|
666
|
-
beforeClickResult.then((result) => {
|
|
667
|
-
if (result) {
|
|
668
|
-
that.clickWorkflowExtensionButtonOnSuccess(
|
|
669
|
-
button,
|
|
670
|
-
model,
|
|
671
|
-
that
|
|
672
|
-
)
|
|
673
|
-
}
|
|
674
|
-
})
|
|
675
|
-
} else {
|
|
676
|
-
that.clickWorkflowExtensionButtonOnSuccess(button, model, that)
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
})
|
|
680
|
-
}
|
|
681
|
-
},
|
|
682
|
-
clickWorkflowExtensionButtonOnSuccess(button, model, that) {
|
|
683
|
-
// 是否可执行
|
|
684
|
-
that
|
|
685
|
-
.canExecute(
|
|
686
|
-
button.executableData,
|
|
687
|
-
model,
|
|
688
|
-
that.isSqlQuery,
|
|
689
|
-
that.tableName,
|
|
690
|
-
this.additionalParamMap
|
|
691
|
-
)
|
|
692
|
-
.then((result) => {
|
|
693
|
-
if (result.canExecute === true) {
|
|
694
|
-
// 可执行条件解析结果为true
|
|
695
|
-
const entities = result.entities
|
|
696
|
-
if (entities && entities.length > 0) {
|
|
697
|
-
model = entities[0]
|
|
698
|
-
}
|
|
699
|
-
let jsContent = false
|
|
700
|
-
if (
|
|
701
|
-
typeof button.jsContent !== 'undefined' &&
|
|
702
|
-
button.jsContent !== ''
|
|
703
|
-
) {
|
|
704
|
-
if (button && typeof button.jsContent !== 'undefined') {
|
|
705
|
-
jsContent = button.jsContent
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
let successOperation = false
|
|
709
|
-
if (button && typeof button.successOperation !== 'undefined') {
|
|
710
|
-
successOperation = button.successOperation
|
|
711
|
-
}
|
|
712
|
-
that.successOperation = successOperation
|
|
713
|
-
let dataConversionRule = ''
|
|
714
|
-
if (button && typeof button.dataConversionRule !== 'undefined') {
|
|
715
|
-
dataConversionRule = button.dataConversionRule
|
|
716
|
-
}
|
|
717
|
-
let autoSetValueData = ''
|
|
718
|
-
if (button && typeof button.autoSetValueData !== 'undefined') {
|
|
719
|
-
autoSetValueData = button.autoSetValueData
|
|
720
|
-
}
|
|
721
|
-
let taskMap = null
|
|
722
|
-
if (button && typeof button.taskMap !== 'undefined') {
|
|
723
|
-
taskMap = button.taskMap
|
|
724
|
-
}
|
|
725
|
-
const needDeleteFileUuid = this.getNeedDeleteFileUuidS()
|
|
726
|
-
if (this.isCommonButton(button.code)) {
|
|
727
|
-
// 表示点了非流程的“提交”、“同意”、“不同意”
|
|
728
|
-
that.clickWorflowButton(
|
|
729
|
-
'#_default_#' + button.code,
|
|
730
|
-
that.system,
|
|
731
|
-
that.tableName,
|
|
732
|
-
model,
|
|
733
|
-
that.definitionId,
|
|
734
|
-
that.emailTemplateCode,
|
|
735
|
-
null,
|
|
736
|
-
that.formViewCode,
|
|
737
|
-
that.formViewVersion,
|
|
738
|
-
that.entityName,
|
|
739
|
-
jsContent,
|
|
740
|
-
that.formNoRuleCode,
|
|
741
|
-
successOperation,
|
|
742
|
-
dataConversionRule,
|
|
743
|
-
that.logicSetting && that.logicSetting.end
|
|
744
|
-
? that.logicSetting.end
|
|
745
|
-
: null,
|
|
746
|
-
autoSetValueData,
|
|
747
|
-
button.logSetting,
|
|
748
|
-
this.ids,
|
|
749
|
-
this.isBatchProcessing,
|
|
750
|
-
button ? button.isNeedValueMapping : false,
|
|
751
|
-
taskMap,
|
|
752
|
-
needDeleteFileUuid,
|
|
753
|
-
this.beanName,
|
|
754
|
-
button
|
|
755
|
-
)
|
|
756
|
-
} else if (button.code === 'exportForm') {
|
|
757
|
-
// 表示点了“导出报告”
|
|
758
|
-
this.exportFormReport(
|
|
759
|
-
button.templateUUID,
|
|
760
|
-
button.templateShowPath,
|
|
761
|
-
jsContent,
|
|
762
|
-
that.entityName,
|
|
763
|
-
that.system,
|
|
764
|
-
button.logSetting,
|
|
765
|
-
taskMap,
|
|
766
|
-
that.additionalParamMap,
|
|
767
|
-
true,
|
|
768
|
-
this.beanName,
|
|
769
|
-
button,
|
|
770
|
-
this.tableName
|
|
771
|
-
)
|
|
772
|
-
} else {
|
|
773
|
-
that.clickWorkflowExtensionButton(
|
|
774
|
-
that.system,
|
|
775
|
-
that.tableName,
|
|
776
|
-
model,
|
|
777
|
-
that.definitionId,
|
|
778
|
-
that.emailTemplateCode,
|
|
779
|
-
that.formViewCode,
|
|
780
|
-
that.formViewVersion,
|
|
781
|
-
jsContent,
|
|
782
|
-
this.formNoRuleCode,
|
|
783
|
-
successOperation,
|
|
784
|
-
dataConversionRule,
|
|
785
|
-
autoSetValueData,
|
|
786
|
-
button,
|
|
787
|
-
needDeleteFileUuid,
|
|
788
|
-
this.entityName,
|
|
789
|
-
this.beanName
|
|
790
|
-
)
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
})
|
|
794
|
-
},
|
|
795
|
-
// 获取需要删除的附件
|
|
796
|
-
getNeedDeleteFileUuidS() {
|
|
797
|
-
if (this.$refs.superForm) {
|
|
798
|
-
return this.$refs.superForm.getNeedDeleteFileUuid()
|
|
799
|
-
}
|
|
800
|
-
},
|
|
801
|
-
// 是否是非流程的“提交”、“同意”、“不同意”、“导出报告”按钮
|
|
802
|
-
isCommonButton(buttonCode) {
|
|
803
|
-
if (
|
|
804
|
-
buttonCode === 'submit' ||
|
|
805
|
-
buttonCode === 'agree' ||
|
|
806
|
-
buttonCode === 'disagree'
|
|
807
|
-
) {
|
|
808
|
-
return true
|
|
809
|
-
}
|
|
810
|
-
return false
|
|
811
|
-
},
|
|
812
|
-
// 不同意时,验证意见是否必填
|
|
813
|
-
validateOpinion(logicSetting, operation, model) {
|
|
814
|
-
// console.log('validateOpinion --logicSetting, operation, model=', logicSetting, operation, model)
|
|
815
|
-
if (logicSetting) {
|
|
816
|
-
let isOpinionRequired = false
|
|
817
|
-
if (
|
|
818
|
-
logicSetting.isOpinionRequired &&
|
|
819
|
-
typeof logicSetting.isOpinionRequired !== 'undefined'
|
|
820
|
-
) {
|
|
821
|
-
isOpinionRequired = logicSetting.isOpinionRequired
|
|
822
|
-
}
|
|
823
|
-
if (isOpinionRequired === true) {
|
|
824
|
-
// 表示意见必填
|
|
825
|
-
const disagreeOperation = operation
|
|
826
|
-
if (
|
|
827
|
-
typeof disagreeOperation !== 'undefined' &&
|
|
828
|
-
disagreeOperation === 'REFUSE'
|
|
829
|
-
) {
|
|
830
|
-
// 表示点击了不同意按钮
|
|
831
|
-
isOpinionRequired = true
|
|
832
|
-
} else {
|
|
833
|
-
// 点击的不是不同意按钮,不控制意见必填
|
|
834
|
-
isOpinionRequired = false
|
|
835
|
-
}
|
|
836
|
-
}
|
|
837
|
-
if (isOpinionRequired === true) {
|
|
838
|
-
const opinion = model[this.defaultOpinionAttrName]
|
|
839
|
-
if (!opinion || opinion === null || opinion === '') {
|
|
840
|
-
// 表示没有填意见,给出提示
|
|
841
|
-
this.$message({
|
|
842
|
-
showClose: true,
|
|
843
|
-
type: 'warning',
|
|
844
|
-
message: this.$t('superPageMessage.mustFillOpinion'),
|
|
845
|
-
})
|
|
846
|
-
return false
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
return true
|
|
851
|
-
},
|
|
852
|
-
// 是否是流程办理按钮
|
|
853
|
-
isDealFlowButton(event) {
|
|
854
|
-
return (
|
|
855
|
-
event === 'startInstance' ||
|
|
856
|
-
event === 'submitProcess' ||
|
|
857
|
-
event === 'completeTask' ||
|
|
858
|
-
event === 'selectTransactors' ||
|
|
859
|
-
event === 'selectTaches' ||
|
|
860
|
-
event === 'update'
|
|
861
|
-
)
|
|
862
|
-
},
|
|
863
|
-
// 办理流程时,解析是否可执行条件
|
|
864
|
-
canExecuteWorkflow(model, event) {
|
|
865
|
-
const that = this
|
|
866
|
-
return new Promise((resolve, reject) => {
|
|
867
|
-
if (!that.logicSetting) {
|
|
868
|
-
resolve({ canExecute: true })
|
|
869
|
-
} else {
|
|
870
|
-
if (this.isDealFlowButton(event)) {
|
|
871
|
-
// 表示办理任务时,解析是否可执行条件
|
|
872
|
-
if (that.logicSetting.current) {
|
|
873
|
-
that
|
|
874
|
-
.canExecute(
|
|
875
|
-
that.logicSetting.current.executableData,
|
|
876
|
-
model,
|
|
877
|
-
this.isSqlQuery,
|
|
878
|
-
this.tableName,
|
|
879
|
-
this.additionalParamMap
|
|
880
|
-
)
|
|
881
|
-
.then((result) => {
|
|
882
|
-
// 表示可执行
|
|
883
|
-
resolve(result)
|
|
884
|
-
})
|
|
885
|
-
.catch((error) => {
|
|
886
|
-
reject(error)
|
|
887
|
-
})
|
|
888
|
-
} else {
|
|
889
|
-
resolve({ canExecute: true })
|
|
890
|
-
}
|
|
891
|
-
} else {
|
|
892
|
-
resolve({ canExecute: true })
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
})
|
|
896
|
-
},
|
|
897
|
-
getCurrentNodeLogicSetting(workflowButton, model, eventSetting) {
|
|
898
|
-
console.log(
|
|
899
|
-
'getCurrentNodeLogicSetting',
|
|
900
|
-
workflowButton,
|
|
901
|
-
model,
|
|
902
|
-
eventSetting
|
|
903
|
-
)
|
|
904
|
-
// console.log('getCurrentNodeLogicSetting-workflowButton, model, event=', workflowButton, model, event)
|
|
905
|
-
// 不同意时才需要验证意见是否必填
|
|
906
|
-
let currentLogicSetting = null
|
|
907
|
-
let processEndLogicSetting = null
|
|
908
|
-
const wfLogicSettingList = workflowButton.wfLogicSettingList
|
|
909
|
-
// console.log('getCurrentNodeLogicSetting-wfLogicSettingList=', wfLogicSettingList)
|
|
910
|
-
if (wfLogicSettingList) {
|
|
911
|
-
const result = {}
|
|
912
|
-
let isCurrentNode = false
|
|
913
|
-
for (let i = 0; i < wfLogicSettingList.length; i++) {
|
|
914
|
-
const wfLogicSetting = wfLogicSettingList[i]
|
|
915
|
-
const nodeId = wfLogicSetting.nodeId
|
|
916
|
-
const currentNodeId = model.currentActivityId
|
|
917
|
-
? model.currentActivityId
|
|
918
|
-
: model.current_activity_id
|
|
919
|
-
const workflowId = model.workflowId
|
|
920
|
-
? model.workflowId
|
|
921
|
-
: model.workflow_id
|
|
922
|
-
// console.log('getCurrentNodeLogicSetting-workflowId=', workflowId, 'currentNodeId=', currentNodeId, 'wfLogicSetting=', wfLogicSetting, 'nodeId=', nodeId)
|
|
923
|
-
// 判断是否是第一环节
|
|
924
|
-
if (
|
|
925
|
-
(workflowId === undefined || workflowId === null) &&
|
|
926
|
-
(eventSetting === 'startInstance' ||
|
|
927
|
-
eventSetting === 'submitProcess')
|
|
928
|
-
) {
|
|
929
|
-
if (
|
|
930
|
-
this.firstNodeInfo &&
|
|
931
|
-
this.firstNodeInfo.nodeId &&
|
|
932
|
-
this.firstNodeInfo.nodeId === nodeId
|
|
933
|
-
) {
|
|
934
|
-
currentLogicSetting = wfLogicSetting
|
|
935
|
-
isCurrentNode = true
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
// 判断是否是结束环节
|
|
939
|
-
if (nodeId === 'processEnd') {
|
|
940
|
-
// 表示是结束节点的逻辑配置
|
|
941
|
-
processEndLogicSetting = wfLogicSetting
|
|
942
|
-
isCurrentNode = true
|
|
943
|
-
// console.log('getCurrentNodeLogicSetting-currentNodeId === nodeId22=')
|
|
944
|
-
}
|
|
945
|
-
// 判断是否是中间环节
|
|
946
|
-
if (currentNodeId && currentNodeId === nodeId) {
|
|
947
|
-
currentLogicSetting = wfLogicSetting
|
|
948
|
-
isCurrentNode = true
|
|
949
|
-
}
|
|
950
|
-
if (isCurrentNode === true) {
|
|
951
|
-
if (currentLogicSetting !== null) {
|
|
952
|
-
result.current = currentLogicSetting
|
|
953
|
-
}
|
|
954
|
-
if (processEndLogicSetting !== null) {
|
|
955
|
-
result.end = processEndLogicSetting
|
|
956
|
-
}
|
|
957
|
-
break
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
// console.log('getCurrentNodeLogicSetting-result =', result)
|
|
961
|
-
return result
|
|
962
|
-
}
|
|
963
|
-
},
|
|
964
|
-
// 进入表单页面时获得表单数据及流程办理相关信息
|
|
965
|
-
initWorkflowFormData() {
|
|
966
|
-
const param = {
|
|
967
|
-
formViewCode: this.formViewCode,
|
|
968
|
-
formViewVersion: this.formViewVersion,
|
|
969
|
-
tableName: this.tableName,
|
|
970
|
-
formNoRuleCode: this.formNoRuleCode,
|
|
971
|
-
systemCode: this.system.code,
|
|
972
|
-
isWorkflowEntity: true,
|
|
973
|
-
functionCode: this.permissionPrefix + '.get',
|
|
974
|
-
}
|
|
975
|
-
const baseUrl = this.getBaseUrl(this.system)
|
|
976
|
-
const urlForView = baseUrl + '/dsc/workflow-commons/gets'
|
|
977
|
-
if (this.ids) {
|
|
978
|
-
param.ids = this.ids
|
|
979
|
-
}
|
|
980
|
-
if (this.taskId) {
|
|
981
|
-
// 办理任务页面
|
|
982
|
-
param.taskId = this.taskId
|
|
983
|
-
} else if (this.dataId) {
|
|
984
|
-
// 修改页面
|
|
985
|
-
param.id = this.dataId
|
|
986
|
-
} else {
|
|
987
|
-
if (sessionStorage.getItem(this.$route.query._t_) && sessionStorage.getItem(this.$route.query._t_ + '_id')) {
|
|
988
|
-
param.id = sessionStorage.getItem(this.$route.query._t_ + '_id')
|
|
989
|
-
}
|
|
990
|
-
// 新建页面
|
|
991
|
-
if (this.notIdInitializationList) {
|
|
992
|
-
// 有初始化条件配置时
|
|
993
|
-
param.noIdAndTaskIdInitSetting = JSON.stringify(
|
|
994
|
-
this.notIdInitializationList
|
|
995
|
-
)
|
|
996
|
-
}
|
|
997
|
-
}
|
|
998
|
-
if (this.additionalParamMap) {
|
|
999
|
-
param.additionalParamMap = JSON.parse(
|
|
1000
|
-
JSON.stringify(this.additionalParamMap)
|
|
1001
|
-
)
|
|
1002
|
-
}
|
|
1003
|
-
if (this.entityName) {
|
|
1004
|
-
param.entityName = this.entityName
|
|
1005
|
-
}
|
|
1006
|
-
if (this.beanName) {
|
|
1007
|
-
param.beanName = this.beanName
|
|
1008
|
-
}
|
|
1009
|
-
this.isShowForm = false
|
|
1010
|
-
this.$http.post(urlForView, param).then((formParam) => {
|
|
1011
|
-
this.definitionId = formParam.definitionId
|
|
1012
|
-
this.formViewId = formParam.formViewId
|
|
1013
|
-
if (
|
|
1014
|
-
formParam.completeTaskParam &&
|
|
1015
|
-
formParam.completeTaskParam.firstNodeInfo
|
|
1016
|
-
) {
|
|
1017
|
-
this['firstNodeInfo'] = formParam.completeTaskParam.firstNodeInfo
|
|
1018
|
-
}
|
|
1019
|
-
this.formOptions['taskParamMap'] = formParam.taskParamMap
|
|
1020
|
-
if (this.dataId) {
|
|
1021
|
-
setStoreInfo(this.pageCode, '_isCreateformData', false)
|
|
1022
|
-
} else {
|
|
1023
|
-
setStoreInfo(this.pageCode, '_isCreateformData', true)
|
|
1024
|
-
}
|
|
1025
|
-
this.dataTypeMap = formParam.dataTypeMap
|
|
1026
|
-
this.dealCompleteTaskParam(formParam, true)
|
|
1027
|
-
this.isShowForm = true
|
|
1028
|
-
})
|
|
1029
|
-
},
|
|
1030
|
-
// 保存流程表单内容并获得表单内容
|
|
1031
|
-
saveWorkflowFormData(isEnableRequired) {
|
|
1032
|
-
if (typeof isEnableRequired === 'undefined') {
|
|
1033
|
-
// 默认启用验证
|
|
1034
|
-
isEnableRequired = true
|
|
1035
|
-
}
|
|
1036
|
-
const that = this
|
|
1037
|
-
return new Promise((resolve, reject) => {
|
|
1038
|
-
// 传false是因为流程表单时字段权限以流程图中配置的为准,表单编辑器的不生效
|
|
1039
|
-
that.$refs.superForm.getModels(false).then((model) => {
|
|
1040
|
-
// console.log('表单数据1=', model, isEnableRequired)
|
|
1041
|
-
console.log('model', model)
|
|
1042
|
-
console.log(
|
|
1043
|
-
'that.completeTaskParam.fieldPermissions',
|
|
1044
|
-
that.completeTaskParam.fieldPermissions
|
|
1045
|
-
)
|
|
1046
|
-
if (isEnableRequired === true) {
|
|
1047
|
-
// 表示启用必填验证
|
|
1048
|
-
const isSql = true
|
|
1049
|
-
const additionalParamMap = JSON.parse(
|
|
1050
|
-
JSON.stringify(that.additionalParamMap)
|
|
1051
|
-
)
|
|
1052
|
-
const contextParameter = getStoreInfo(
|
|
1053
|
-
that.pageCode,
|
|
1054
|
-
'_contextParameter'
|
|
1055
|
-
)
|
|
1056
|
-
if (contextParameter) {
|
|
1057
|
-
that.contextParameter = contextParameter
|
|
1058
|
-
}
|
|
1059
|
-
let workflowFieldPermissionRules = that.$getValidator(
|
|
1060
|
-
that.completeTaskParam.fieldPermissions,
|
|
1061
|
-
model,
|
|
1062
|
-
isSql,
|
|
1063
|
-
additionalParamMap,
|
|
1064
|
-
that.formOptions.taskParamMap,
|
|
1065
|
-
contextParameter
|
|
1066
|
-
)
|
|
1067
|
-
if (model['__custom_rules']) {
|
|
1068
|
-
// 为了解决流程表单内,在页面事件内动态控制字段必填和非必填的问题
|
|
1069
|
-
const customRulesKeys = Object.keys(model['__custom_rules'])
|
|
1070
|
-
const customRules = model['__custom_rules']
|
|
1071
|
-
customRulesKeys.forEach((key) => {
|
|
1072
|
-
if (key === '__subRules') {
|
|
1073
|
-
const subRules = customRules['__subRules']
|
|
1074
|
-
const customSubTableKey = Object.keys(subRules)
|
|
1075
|
-
customSubTableKey.forEach((subTableKey) => {
|
|
1076
|
-
// 子表规则 获取自定义的子表校验规则赋值给表单校验规则
|
|
1077
|
-
if (!workflowFieldPermissionRules.subRules) {
|
|
1078
|
-
workflowFieldPermissionRules['subRules'] = {}
|
|
1079
|
-
}
|
|
1080
|
-
if (workflowFieldPermissionRules.subRules[subTableKey]) {
|
|
1081
|
-
// 向已有的子表校验规则。
|
|
1082
|
-
Object.assign(
|
|
1083
|
-
workflowFieldPermissionRules.subRules[subTableKey],
|
|
1084
|
-
subRules[subTableKey]
|
|
1085
|
-
)
|
|
1086
|
-
} else {
|
|
1087
|
-
workflowFieldPermissionRules.subRules[subTableKey] =
|
|
1088
|
-
subRules[subTableKey]
|
|
1089
|
-
}
|
|
1090
|
-
})
|
|
1091
|
-
} else {
|
|
1092
|
-
workflowFieldPermissionRules[key] = customRules[key]
|
|
1093
|
-
}
|
|
1094
|
-
})
|
|
1095
|
-
delete model['__custom_rules']
|
|
1096
|
-
}
|
|
1097
|
-
workflowFieldPermissionRules = this.sublistVerify(
|
|
1098
|
-
workflowFieldPermissionRules
|
|
1099
|
-
)
|
|
1100
|
-
console.log(
|
|
1101
|
-
'页面组件--流程表单页面---校验字段规则=',
|
|
1102
|
-
workflowFieldPermissionRules
|
|
1103
|
-
)
|
|
1104
|
-
console.log(
|
|
1105
|
-
'页面组件--流程表单页面---that.subTablePageInfo=',
|
|
1106
|
-
that.subTablePageInfo
|
|
1107
|
-
)
|
|
1108
|
-
// 验证流程字段权限
|
|
1109
|
-
const result = that.$formValidator(
|
|
1110
|
-
model,
|
|
1111
|
-
workflowFieldPermissionRules,
|
|
1112
|
-
isSql,
|
|
1113
|
-
additionalParamMap,
|
|
1114
|
-
that.formOptions.taskParamMap,
|
|
1115
|
-
contextParameter,
|
|
1116
|
-
that.subTablePageInfo
|
|
1117
|
-
)
|
|
1118
|
-
if (result !== true) {
|
|
1119
|
-
// 字段验证失败
|
|
1120
|
-
that.$message({
|
|
1121
|
-
showClose: true,
|
|
1122
|
-
message: result,
|
|
1123
|
-
type: 'warning',
|
|
1124
|
-
})
|
|
1125
|
-
resolve(false)
|
|
1126
|
-
} else {
|
|
1127
|
-
if (
|
|
1128
|
-
window.customValidatorRef &&
|
|
1129
|
-
window.customValidatorRef.get(this.pageCode) &&
|
|
1130
|
-
window.customValidatorRef.get(this.pageCode).size > 0
|
|
1131
|
-
) {
|
|
1132
|
-
// 验证自定义控件校验
|
|
1133
|
-
const pageCustomControlRef = window.customValidatorRef.get(
|
|
1134
|
-
this.pageCode
|
|
1135
|
-
)
|
|
1136
|
-
const validatorResult = []
|
|
1137
|
-
pageCustomControlRef.forEach((value, key, map) => {
|
|
1138
|
-
validatorResult.push(value.validator())
|
|
1139
|
-
})
|
|
1140
|
-
Promise.all(validatorResult).then((values) => {
|
|
1141
|
-
if (values.includes(false)) {
|
|
1142
|
-
// 验证失败的提示信息由自定义控件抛出
|
|
1143
|
-
resolve(false)
|
|
1144
|
-
} else {
|
|
1145
|
-
// 验证成功
|
|
1146
|
-
// 移除验证失败字段名,否则会造成后台保存失败
|
|
1147
|
-
if (Object.keys(model).indexOf('validateErrorField') >= 0) {
|
|
1148
|
-
delete model.validateErrorField
|
|
1149
|
-
}
|
|
1150
|
-
resolve(model)
|
|
1151
|
-
}
|
|
1152
|
-
})
|
|
1153
|
-
} else {
|
|
1154
|
-
// 验证成功
|
|
1155
|
-
// 移除验证失败字段名,否则会造成后台保存失败
|
|
1156
|
-
if (Object.keys(model).indexOf('validateErrorField') >= 0) {
|
|
1157
|
-
delete model.validateErrorField
|
|
1158
|
-
}
|
|
1159
|
-
resolve(model)
|
|
1160
|
-
}
|
|
1161
|
-
}
|
|
1162
|
-
} else {
|
|
1163
|
-
// 表示不启用必填验证
|
|
1164
|
-
resolve(model)
|
|
1165
|
-
}
|
|
1166
|
-
})
|
|
1167
|
-
})
|
|
1168
|
-
},
|
|
1169
|
-
/**
|
|
1170
|
-
* @description: 子表校验
|
|
1171
|
-
* @Date: 2023-07-18 09:39:37
|
|
1172
|
-
* @param {*}
|
|
1173
|
-
* @return {*}
|
|
1174
|
-
*/
|
|
1175
|
-
sublistVerify(rules) {
|
|
1176
|
-
Object.keys(rules).forEach((item) => {
|
|
1177
|
-
if (item.indexOf('.') >= 0) {
|
|
1178
|
-
let ruleKetArr = []
|
|
1179
|
-
ruleKetArr = item.split('.')
|
|
1180
|
-
if (rules[ruleKetArr[0]]) {
|
|
1181
|
-
rules[ruleKetArr[0]].fields[ruleKetArr[1]] = rules[item][0]
|
|
1182
|
-
} else {
|
|
1183
|
-
rules[ruleKetArr[0]] = new Object()
|
|
1184
|
-
rules[ruleKetArr[0]].fields = new Object()
|
|
1185
|
-
rules[ruleKetArr[0]].fields[ruleKetArr[1]] = rules[item][0]
|
|
1186
|
-
rules[ruleKetArr[0]].type = 'object'
|
|
1187
|
-
}
|
|
1188
|
-
delete rules[item]
|
|
1189
|
-
}
|
|
1190
|
-
})
|
|
1191
|
-
return rules
|
|
1192
|
-
},
|
|
1193
|
-
// 选择环节后,退回到指定环节
|
|
1194
|
-
myReturnTaskTo(selectTaskNode) {
|
|
1195
|
-
this.selectTaskNode = selectTaskNode
|
|
1196
|
-
this.showTaskInformitions = false
|
|
1197
|
-
const that = this
|
|
1198
|
-
this.saveWorkflowFormData(this.isEnableRequired).then((model) => {
|
|
1199
|
-
if (model && model !== false) {
|
|
1200
|
-
// 如果model的值为true,表示验证失败,否则表示验证成功
|
|
1201
|
-
that.returnTaskTo(
|
|
1202
|
-
that.system,
|
|
1203
|
-
that.tableName,
|
|
1204
|
-
model,
|
|
1205
|
-
selectTaskNode,
|
|
1206
|
-
that.formViewCode,
|
|
1207
|
-
that.formViewVersion,
|
|
1208
|
-
that.entityName,
|
|
1209
|
-
that.myJsContent,
|
|
1210
|
-
that.successOperation,
|
|
1211
|
-
that.isNeedValueMapping,
|
|
1212
|
-
this.beanName
|
|
1213
|
-
)
|
|
1214
|
-
}
|
|
1215
|
-
})
|
|
1216
|
-
},
|
|
1217
|
-
closeDeptUserTree(selectNodeInfo) {
|
|
1218
|
-
if (this.selectAddSignerUser === true) {
|
|
1219
|
-
// 表示是关闭加签人员树
|
|
1220
|
-
this.selectAddSignerUser = false
|
|
1221
|
-
this.doAddSigner(
|
|
1222
|
-
selectNodeInfo,
|
|
1223
|
-
this.myJsContent,
|
|
1224
|
-
this.system,
|
|
1225
|
-
this.entityName,
|
|
1226
|
-
this.beanName,
|
|
1227
|
-
this.dataId,
|
|
1228
|
-
this.formModel,
|
|
1229
|
-
this.successOperation,
|
|
1230
|
-
this.isNeedValueMapping
|
|
1231
|
-
)
|
|
1232
|
-
}
|
|
1233
|
-
if (this.selectCopyUser === true) {
|
|
1234
|
-
// 表示是关闭抄送人员树
|
|
1235
|
-
this.selectCopyUser = false
|
|
1236
|
-
this.doCreateCopyTask(
|
|
1237
|
-
selectNodeInfo,
|
|
1238
|
-
this.myJsContent,
|
|
1239
|
-
this.system,
|
|
1240
|
-
this.entityName,
|
|
1241
|
-
this.beanName
|
|
1242
|
-
)
|
|
1243
|
-
}
|
|
1244
|
-
if (this.selectAssignUser === true) {
|
|
1245
|
-
// 表示是关闭指派人员树
|
|
1246
|
-
this.selectAssignUser = false
|
|
1247
|
-
this.assign(
|
|
1248
|
-
this.system,
|
|
1249
|
-
this.tableName,
|
|
1250
|
-
this.formModel,
|
|
1251
|
-
this.formViewCode,
|
|
1252
|
-
this.formViewVersion,
|
|
1253
|
-
this.entityName,
|
|
1254
|
-
this.myJsContent,
|
|
1255
|
-
this.successOperation,
|
|
1256
|
-
selectNodeInfo,
|
|
1257
|
-
this.isNeedValueMapping,
|
|
1258
|
-
this.beanName
|
|
1259
|
-
)
|
|
1260
|
-
}
|
|
1261
|
-
},
|
|
1262
|
-
// 减签弹框页面中点击确定的处理
|
|
1263
|
-
myDoRemoveSigners(selectRemoveTasks) {
|
|
1264
|
-
this.doRemoveSigners(
|
|
1265
|
-
selectRemoveTasks,
|
|
1266
|
-
this.myJsContent,
|
|
1267
|
-
this.system,
|
|
1268
|
-
this.entityName,
|
|
1269
|
-
this.beanName
|
|
1270
|
-
)
|
|
1271
|
-
},
|
|
1272
|
-
getFormData() {
|
|
1273
|
-
if (this.$refs.superForm) {
|
|
1274
|
-
return this.$refs.superForm.getFormData()
|
|
1275
|
-
}
|
|
1276
|
-
},
|
|
1277
|
-
clickRefreshFrom(entity) {
|
|
1278
|
-
let dataId
|
|
1279
|
-
if (entity.id) {
|
|
1280
|
-
dataId = entity.id
|
|
1281
|
-
} else if (entity.ID) {
|
|
1282
|
-
dataId = entity.ID
|
|
1283
|
-
}
|
|
1284
|
-
if (dataId) {
|
|
1285
|
-
this.initWorkflowFormData()
|
|
1286
|
-
} else {
|
|
1287
|
-
this.refreshForm(entity)
|
|
1288
|
-
}
|
|
1289
|
-
},
|
|
1290
|
-
fnProhibitToEdit(entity) {
|
|
1291
|
-
if (this.$refs.superForm) {
|
|
1292
|
-
return this.$refs.superForm.fnProhibitToEdit(entity)
|
|
1293
|
-
}
|
|
1294
|
-
},
|
|
1295
|
-
// 刷新表单数据
|
|
1296
|
-
refresMainTableFields(entity) {
|
|
1297
|
-
console.log('this.$refs.superForm', this.$refs.superForm)
|
|
1298
|
-
if (this.$refs.superForm) {
|
|
1299
|
-
this.reviewButton(entity)
|
|
1300
|
-
return this.$refs.superForm.refresMainTableFields(entity)
|
|
1301
|
-
}
|
|
1302
|
-
},
|
|
1303
|
-
},
|
|
1304
|
-
emits: [],
|
|
1305
|
-
}
|
|
1306
|
-
</script>
|
|
1307
|
-
|
|
1308
|
-
<style lang="scss" scoped>
|
|
1309
|
-
@import '../../../src/styles/index.scss';
|
|
1310
|
-
</style>
|