super-pages 0.7.57 → 0.7.58
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.css +1 -1
- package/lib/super-pages.umd.min.js +5 -5
- package/package.json +2 -2
- package/packages/index.js +33 -0
- package/packages/super-page/index.js +9 -0
- package/packages/super-page/src/button-group.vue +272 -0
- package/packages/super-page/src/chart-page.vue +173 -0
- package/packages/super-page/src/chart-query-page.vue +113 -0
- package/packages/super-page/src/common-form-page.vue +547 -0
- package/packages/super-page/src/export-form-report-dialog.vue +84 -0
- package/packages/super-page/src/form-head.vue +67 -0
- package/packages/super-page/src/form-page.vue +107 -0
- package/packages/super-page/src/group-tag.vue +29 -0
- package/packages/super-page/src/list-page.vue +1023 -0
- package/packages/super-page/src/list-toolbar-page.vue +257 -0
- package/packages/super-page/src/my-button-base.vue +367 -0
- package/packages/super-page/src/my-button.vue +185 -0
- package/packages/super-page/src/page-custom-component.vue +64 -0
- package/packages/super-page/src/remove-signer-dialog.vue +107 -0
- package/packages/super-page/src/sub-tab-page.vue +88 -0
- package/packages/super-page/src/super-page-component.vue +78 -0
- package/packages/super-page/src/super-page.vue +134 -0
- package/packages/super-page/src/tab-page.vue +152 -0
- package/packages/super-page/src/task-informition-dialog.vue +88 -0
- package/packages/super-page/src/util/ListButtonEvent.js +608 -0
- package/packages/super-page/src/util/api.js +32 -0
- package/packages/super-page/src/util/callEvents.js +52 -0
- package/packages/super-page/src/util/chartButtonEvent.js +60 -0
- package/packages/super-page/src/util/common-util.js +100 -0
- package/packages/super-page/src/util/commonButtonEvent.js +55 -0
- package/packages/super-page/src/util/eventBus.js +2 -0
- package/packages/super-page/src/util/formButtonEvent.js +262 -0
- package/packages/super-page/src/util/store.js +3 -0
- package/packages/super-page/src/util/super-page.js +19 -0
- package/packages/super-page/src/util/util.js +976 -0
- package/packages/super-page/src/util/workflowButtonEvent.js +1037 -0
- package/packages/super-page/src/widget-col-page.vue +339 -0
- package/packages/super-page/src/widget-page.vue +596 -0
- package/packages/super-page/src/widget-sub-tab-pane-page.vue +105 -0
- package/packages/super-page/src/widget-tab-pane-page.vue +125 -0
- package/packages/super-page/src/workflow-button-group.vue +487 -0
- package/packages/super-page/src/workflow-form-page.vue +1119 -0
- package/packages/super-page-dialog/index.js +9 -0
- package/packages/super-page-dialog/src/super-page-dialog.vue +173 -0
|
@@ -0,0 +1,547 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<template v-if="isShowForm">
|
|
4
|
+
<button-group
|
|
5
|
+
v-if="isShowBuuton && buttoGroups && refreshButton&&colSetting.options.buttonGroup.length>0"
|
|
6
|
+
:button-groups="buttoGroups"
|
|
7
|
+
:permission-prefix="permissionPrefix"
|
|
8
|
+
:table-name="tableName"
|
|
9
|
+
:button-area-custom-component-arr="
|
|
10
|
+
colSetting.options.buttonAreaCustomComponentArr
|
|
11
|
+
"
|
|
12
|
+
:class="formButtonPosition==='topLeft'?'button-at-top':'button-at-bottom'"
|
|
13
|
+
position="form"
|
|
14
|
+
:form-button-position="formButtonPosition"
|
|
15
|
+
:page-code="pageCode"
|
|
16
|
+
:get-form-data="saveFormData"
|
|
17
|
+
:form-data-fun="getFormData"
|
|
18
|
+
@refresh="refreshForm"
|
|
19
|
+
@click="clickCommonFormButton"
|
|
20
|
+
@prohibi-edit="fnProhibitToEdit"
|
|
21
|
+
@refreshFrom="clickRefreshFrom"
|
|
22
|
+
/>
|
|
23
|
+
<form-head
|
|
24
|
+
v-if="formTitle||formNo||formNoLabel"
|
|
25
|
+
:form-button-position="formButtonPosition"
|
|
26
|
+
:form-title="formTitle"
|
|
27
|
+
:form-no="formNo"
|
|
28
|
+
:form-no-label="formNoLabel"
|
|
29
|
+
/>
|
|
30
|
+
|
|
31
|
+
<template v-if="formViewId">
|
|
32
|
+
<!--自定义系统默认新建、修改表单数据时-->
|
|
33
|
+
|
|
34
|
+
<super-form
|
|
35
|
+
v-if="isInitDscFormData"
|
|
36
|
+
ref="superForm"
|
|
37
|
+
:form-view-id="formViewId"
|
|
38
|
+
:path-query="pathQuery"
|
|
39
|
+
:is-page-info="
|
|
40
|
+
isPreview ? isPreview : pageDevMode ? pageDevMode : false
|
|
41
|
+
"
|
|
42
|
+
:tab-code="tabCode"
|
|
43
|
+
:form-button-position="formButtonPosition"
|
|
44
|
+
:value="formData ? formData : {}"
|
|
45
|
+
:options="formOptions"
|
|
46
|
+
@update-value="updateSetValues"
|
|
47
|
+
@shou-button="reviewButton"
|
|
48
|
+
@change-grid-rows-per-page="changeSubTablePageSize"
|
|
49
|
+
/>
|
|
50
|
+
<!--根据urlForView查看表单数据时-->
|
|
51
|
+
<super-form
|
|
52
|
+
v-else
|
|
53
|
+
ref="superForm"
|
|
54
|
+
:form-view-id="formViewId"
|
|
55
|
+
:path-query="pathQuery"
|
|
56
|
+
:is-page-info="
|
|
57
|
+
isPreview ? isPreview : pageDevMode ? pageDevMode : false
|
|
58
|
+
"
|
|
59
|
+
:tab-code="tabCode"
|
|
60
|
+
:form-button-position="formButtonPosition"
|
|
61
|
+
:options="formOptions"
|
|
62
|
+
@update-value="updateSetValues"
|
|
63
|
+
@shou-button="reviewButton"
|
|
64
|
+
@change-grid-rows-per-page="changeSubTablePageSize"
|
|
65
|
+
/>
|
|
66
|
+
</template>
|
|
67
|
+
<template v-else>
|
|
68
|
+
<super-form
|
|
69
|
+
ref="superForm"
|
|
70
|
+
:form-view-code="formViewCode"
|
|
71
|
+
:form-view-version="formViewVersion"
|
|
72
|
+
:is-page-info="
|
|
73
|
+
isPreview ? isPreview : pageDevMode ? pageDevMode : false
|
|
74
|
+
"
|
|
75
|
+
:tab-code="tabCode"
|
|
76
|
+
:form-button-position="formButtonPosition"
|
|
77
|
+
:value="formData ? formData : {}"
|
|
78
|
+
:options="formOptions"
|
|
79
|
+
@update-value="updateSetValues"
|
|
80
|
+
@shou-button="reviewButton"
|
|
81
|
+
@change-grid-rows-per-page="changeSubTablePageSize"
|
|
82
|
+
/>
|
|
83
|
+
</template>
|
|
84
|
+
</template>
|
|
85
|
+
<super-page-dialog
|
|
86
|
+
v-if="isShowPageDialog"
|
|
87
|
+
:preview="isPreview"
|
|
88
|
+
:dev-mode="pageDevMode"
|
|
89
|
+
:jump-page-setting="jumpPageSetting"
|
|
90
|
+
@update-value="updateValues"
|
|
91
|
+
@close="closeInPage"
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
94
|
+
</template>
|
|
95
|
+
|
|
96
|
+
<script>
|
|
97
|
+
import Util from './util/util'
|
|
98
|
+
import Vue from 'vue'
|
|
99
|
+
import ButtonGroup from './button-group'
|
|
100
|
+
import formHead from './form-head'
|
|
101
|
+
import buttonEvents from './util/formButtonEvent'
|
|
102
|
+
import callEvents from './util/callEvents'
|
|
103
|
+
import apis from './util/api'
|
|
104
|
+
import { getStoreInfo, setStoreInfo } from './util/common-util'
|
|
105
|
+
import eventBus from './util/eventBus'
|
|
106
|
+
import { getSystemBackendUrl } from 'imatrix-ui/src/utils/common-util'
|
|
107
|
+
export default {
|
|
108
|
+
name: 'CommonFormPage',
|
|
109
|
+
components: {
|
|
110
|
+
ButtonGroup,
|
|
111
|
+
formHead
|
|
112
|
+
},
|
|
113
|
+
props: {
|
|
114
|
+
// 表单布局配置
|
|
115
|
+
colSetting: {
|
|
116
|
+
type: Object,
|
|
117
|
+
default: null
|
|
118
|
+
},
|
|
119
|
+
// 表单页面修改记录时记录id
|
|
120
|
+
dataId: {
|
|
121
|
+
type: Number,
|
|
122
|
+
default: null
|
|
123
|
+
},
|
|
124
|
+
// 页面编码
|
|
125
|
+
pageCode: {
|
|
126
|
+
type: String,
|
|
127
|
+
default: null
|
|
128
|
+
},
|
|
129
|
+
// 页签编码
|
|
130
|
+
tabCode: {
|
|
131
|
+
type: String,
|
|
132
|
+
default: null
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
data () {
|
|
136
|
+
// 实体类名,首字母小写
|
|
137
|
+
const entityName = this.colSetting.baseSetting.modelDataTableEntityName
|
|
138
|
+
const beanName = this.colSetting.baseSetting.beanName
|
|
139
|
+
const system = getStoreInfo(this.pageCode, '_systemInfo')
|
|
140
|
+
const isSqlQuery = getStoreInfo(this.pageCode, '_pageIsDsc')
|
|
141
|
+
const pageCode = getStoreInfo(this.pageCode, '_pageCode')
|
|
142
|
+
const pathQuery = getStoreInfo(this.pageCode, '_pathQuery')
|
|
143
|
+
let isPreview = getStoreInfo(this.pageCode, '_pagePreview')
|
|
144
|
+
if (isPreview === undefined) {
|
|
145
|
+
isPreview = false
|
|
146
|
+
}
|
|
147
|
+
let pageDevMode = getStoreInfo(this.pageCode, '_pageDevMode')
|
|
148
|
+
if (pageDevMode === null || pageDevMode === undefined) {
|
|
149
|
+
pageDevMode = false
|
|
150
|
+
}
|
|
151
|
+
let permissionPrefix
|
|
152
|
+
if (system) {
|
|
153
|
+
permissionPrefix =
|
|
154
|
+
system.code +
|
|
155
|
+
'.' +
|
|
156
|
+
pageCode +
|
|
157
|
+
'.' +
|
|
158
|
+
this.colSetting.baseSetting.componentCode
|
|
159
|
+
}
|
|
160
|
+
let buttoGroups = this.colSetting.options.buttonGroup
|
|
161
|
+
if (!buttoGroups) {
|
|
162
|
+
buttoGroups = []
|
|
163
|
+
}
|
|
164
|
+
// buttoGroups.push(this.getBackButton())
|
|
165
|
+
let formNoRuleCode = ''
|
|
166
|
+
if (this.colSetting.options && this.colSetting.options.formNoRuleCode) {
|
|
167
|
+
formNoRuleCode = this.colSetting.options.formNoRuleCode
|
|
168
|
+
}
|
|
169
|
+
let isBatchProcessing = false
|
|
170
|
+
if (this.colSetting.options && this.colSetting.options.isBatchProcessing) {
|
|
171
|
+
isBatchProcessing = this.colSetting.options.isBatchProcessing
|
|
172
|
+
}
|
|
173
|
+
const pageHeight = getStoreInfo(this.pageCode, '_pageHeight')
|
|
174
|
+
const formOptions = {
|
|
175
|
+
isSql: isSqlQuery,
|
|
176
|
+
pageCode: this.pageCode,
|
|
177
|
+
pageHeight: pageHeight
|
|
178
|
+
}
|
|
179
|
+
const isView = this.isViewDetail()
|
|
180
|
+
if (isView) {
|
|
181
|
+
// 查看详情页面中控制所有字段禁止编辑
|
|
182
|
+
formOptions.fieldPermissions = [{ name: 'all_fields', canEdit: false }]
|
|
183
|
+
}
|
|
184
|
+
formOptions.devMode = pageDevMode
|
|
185
|
+
let formViewVersion = null
|
|
186
|
+
if (this.colSetting.baseSetting.modelVersion) {
|
|
187
|
+
formViewVersion = parseInt(this.colSetting.baseSetting.modelVersion)
|
|
188
|
+
}
|
|
189
|
+
const formViewCode = this.colSetting.baseSetting.modelCode
|
|
190
|
+
// 表单事件集合
|
|
191
|
+
let formEvents = []
|
|
192
|
+
const pageEvents = getStoreInfo(this.pageCode, '_pageEvents')
|
|
193
|
+
if (pageEvents) {
|
|
194
|
+
formEvents = pageEvents.formEvents
|
|
195
|
+
}
|
|
196
|
+
formOptions.events = this.packageFormEvents(formViewCode)
|
|
197
|
+
let formButtonPosition = getStoreInfo(getStoreInfo(this.pageCode, '_pageCode'), '_formButtonPosition')
|
|
198
|
+
if (!formButtonPosition) {
|
|
199
|
+
formButtonPosition = 'topLeft'
|
|
200
|
+
}
|
|
201
|
+
return {
|
|
202
|
+
formViewCode,
|
|
203
|
+
formViewVersion,
|
|
204
|
+
tableName: this.colSetting.baseSetting.modelDataTableCode,
|
|
205
|
+
entityName: entityName,
|
|
206
|
+
beanName,
|
|
207
|
+
formTitle: this.colSetting.baseSetting.formTitle, // 表单标题
|
|
208
|
+
formOptions,
|
|
209
|
+
urlForView: this.colSetting.options.urlForView, // 查看表单url
|
|
210
|
+
formData: null, // 表单数据
|
|
211
|
+
isShowForm: false, // 是否显示表单
|
|
212
|
+
formViewId: null, // 表单id
|
|
213
|
+
isInitDscFormData: false, // 是否是自定义系统数据
|
|
214
|
+
permissionPrefix,
|
|
215
|
+
system,
|
|
216
|
+
buttoGroups,
|
|
217
|
+
isSqlQuery,
|
|
218
|
+
formNoRuleCode, // 表单编号规则定义的编号
|
|
219
|
+
judgeHeavyList: this.colSetting.options.judgeHeavyList, // 判重组合字段配置
|
|
220
|
+
notIdInitializationList: this.colSetting.options.notIdInitializationList, // 无id或taskId时初始化配置
|
|
221
|
+
formNo: null, // 根据表单编码规则生成的表单编码
|
|
222
|
+
formNoLabel: this.colSetting.baseSetting.formNoLabel, // 表单编号名称
|
|
223
|
+
isPreview, // 是否是预览页面
|
|
224
|
+
additionalParamMap: null, // 解析完的附加参数
|
|
225
|
+
dataTypeMap: null, // 数据类型map集合,key为字段名,value为字段类型,优化保存速度
|
|
226
|
+
formEvents,
|
|
227
|
+
pathQuery,
|
|
228
|
+
pageDevMode,
|
|
229
|
+
refreshButton: true,
|
|
230
|
+
ids: null,
|
|
231
|
+
isBatchProcessing, // 是否是批量处理
|
|
232
|
+
isShowPageDialog: false, // 是否显示弹框页面
|
|
233
|
+
jumpPageSetting: null, // 弹框页面的设置信息
|
|
234
|
+
customEvents: pageEvents ? pageEvents.customEvents : null,
|
|
235
|
+
isShowBuuton: true,
|
|
236
|
+
formButtonPosition,
|
|
237
|
+
pageType: 'form', // 页面类型
|
|
238
|
+
subTablePageInfo: {} // 表单子表每页显示多少条件记录
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
watch: {
|
|
242
|
+
jumpPageSetting: {
|
|
243
|
+
deep: true,
|
|
244
|
+
handler (jumpPageSetting) {
|
|
245
|
+
if (jumpPageSetting && jumpPageSetting !== null) {
|
|
246
|
+
const that = this
|
|
247
|
+
eventBus.$on(
|
|
248
|
+
jumpPageSetting.pageCode + '-close-dialog',
|
|
249
|
+
(pageCode, successOperation, popEntity, popPageCode) => {
|
|
250
|
+
if (pageCode === jumpPageSetting.pageCode) {
|
|
251
|
+
that.closeInPageEvent(
|
|
252
|
+
popEntity,
|
|
253
|
+
popPageCode,
|
|
254
|
+
successOperation,
|
|
255
|
+
that
|
|
256
|
+
)
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// 关闭事件
|
|
260
|
+
eventBus.$off(pageCode + '-close-dialog')
|
|
261
|
+
}
|
|
262
|
+
)
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
created () {
|
|
268
|
+
// 获得获取表单内容url
|
|
269
|
+
this.getRealUrlForView()
|
|
270
|
+
|
|
271
|
+
const additionalParamMap = getStoreInfo(this.pageCode, 'additionalParamMap')
|
|
272
|
+
if (additionalParamMap) {
|
|
273
|
+
this.additionalParamMap = additionalParamMap
|
|
274
|
+
this.formOptions.additionalParamMap = additionalParamMap
|
|
275
|
+
// console.log('common-form-page已获取到附加参数', additionalParamMap)
|
|
276
|
+
}
|
|
277
|
+
if (this.pathQuery && this.pathQuery.ids && this.pathQuery.ids !== '') {
|
|
278
|
+
if (typeof this.pathQuery.ids === 'string') {
|
|
279
|
+
this.ids = this.pathQuery.ids.split(',')
|
|
280
|
+
} else if (typeof this.pathQuery.ids === 'object') {
|
|
281
|
+
this.ids = this.pathQuery.ids
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
// 初始化自定义系统表单数据
|
|
285
|
+
this.initDscFormData()
|
|
286
|
+
const that = this
|
|
287
|
+
eventBus.$on(this.pageCode + '-close-component-page-dialog', (jumpInfo, popEntity, popPageCode) => {
|
|
288
|
+
console.log('closeFormPageDialog------', jumpInfo, popEntity, popPageCode)
|
|
289
|
+
that.closeFormPageDialog(jumpInfo, that, popEntity, popPageCode)
|
|
290
|
+
})
|
|
291
|
+
// 关闭弹框事件回调使用
|
|
292
|
+
eventBus.$on(this.pageCode + '_close-dialog-get-entity', () => {
|
|
293
|
+
eventBus.$emit(that.pageCode + '_close-super-dialog', that.formData)
|
|
294
|
+
})
|
|
295
|
+
|
|
296
|
+
// // TODO:刷新指定页签的表单数据。暂时没有该需求,后面有这个需求再实现
|
|
297
|
+
// eventBus.$on(that.pageCode + '-refresh-tab', (tabCode, entity) => {
|
|
298
|
+
// if (that.$refs.superForm && tabCode !== undefined && tabCode === that.tabCode && entity) {
|
|
299
|
+
// that.$refs.superForm.refresh(entity)
|
|
300
|
+
// }
|
|
301
|
+
// })
|
|
302
|
+
},
|
|
303
|
+
beforeDestroy () {
|
|
304
|
+
eventBus.$off(this.pageCode + '-close-form-page-dialog')
|
|
305
|
+
eventBus.$off(this.pageCode + '_close-dialog-get-entity')
|
|
306
|
+
eventBus.$off(this.pageCode + '-close-component-page-dialog')
|
|
307
|
+
// eventBus.$off(this.pageCode + '-refresh-tab')
|
|
308
|
+
},
|
|
309
|
+
methods: {
|
|
310
|
+
...Util,
|
|
311
|
+
...buttonEvents,
|
|
312
|
+
...callEvents,
|
|
313
|
+
...apis,
|
|
314
|
+
updateSetValues (soureModel, sourceTableName, targetRowIndex) {
|
|
315
|
+
this.$emit('update-value', soureModel, sourceTableName, targetRowIndex)
|
|
316
|
+
},
|
|
317
|
+
clickCommonFormButton (button) {
|
|
318
|
+
console.log('---clickCommonFormButton', button)
|
|
319
|
+
if (this.isPreview) {
|
|
320
|
+
return
|
|
321
|
+
}
|
|
322
|
+
if (button) {
|
|
323
|
+
if (button.code === 'downloadTemplate') {
|
|
324
|
+
this.downloadTemplate(this.system, button, this.tableName)
|
|
325
|
+
return
|
|
326
|
+
}
|
|
327
|
+
// 是否启用必填验证
|
|
328
|
+
let isEnableRequired = true
|
|
329
|
+
if (typeof button.isRequired !== 'undefined') {
|
|
330
|
+
isEnableRequired = button.isRequired
|
|
331
|
+
}
|
|
332
|
+
if (
|
|
333
|
+
typeof button.isRequired === 'undefined' &&
|
|
334
|
+
(button.code === 'back' || button.code === 'exportForm')
|
|
335
|
+
) {
|
|
336
|
+
// 返回、导出报告按钮不验证表单
|
|
337
|
+
isEnableRequired = false
|
|
338
|
+
}
|
|
339
|
+
this.saveFormData(isEnableRequired).then(model => {
|
|
340
|
+
const beforeClickResult = this.callBeforeClickButton(
|
|
341
|
+
this.formEvents,
|
|
342
|
+
this.formViewCode + '__' + button.code,
|
|
343
|
+
{
|
|
344
|
+
params: this.additionalParamMap,
|
|
345
|
+
entity: model,
|
|
346
|
+
button: button,
|
|
347
|
+
formNoRuleCode: this.formNoRuleCode,
|
|
348
|
+
subTablePageInfo: this.subTablePageInfo
|
|
349
|
+
}
|
|
350
|
+
)
|
|
351
|
+
if (!beforeClickResult) {
|
|
352
|
+
// 返回值为false,不继续执行按钮操作
|
|
353
|
+
return
|
|
354
|
+
}
|
|
355
|
+
// 是否可执行
|
|
356
|
+
this.canExecute(
|
|
357
|
+
button.executableData,
|
|
358
|
+
model,
|
|
359
|
+
this.isSqlQuery,
|
|
360
|
+
this.tableName,
|
|
361
|
+
this.additionalParamMap
|
|
362
|
+
).then(result => {
|
|
363
|
+
if (result.canExecute === true) {
|
|
364
|
+
// 表示可执行条件返回结果为true
|
|
365
|
+
const entities = result.entities
|
|
366
|
+
if (entities && entities.length > 0) {
|
|
367
|
+
model = entities[0]
|
|
368
|
+
}
|
|
369
|
+
let jsContent = false
|
|
370
|
+
if (button && typeof button.jsContent !== 'undefined') {
|
|
371
|
+
jsContent = button.jsContent
|
|
372
|
+
}
|
|
373
|
+
const needDeleteFileUuidS = this.getNeedDeleteFileUuidS()
|
|
374
|
+
this.clickFormButton(
|
|
375
|
+
button,
|
|
376
|
+
this.system,
|
|
377
|
+
this.formViewCode,
|
|
378
|
+
this.formViewVersion,
|
|
379
|
+
this.tableName,
|
|
380
|
+
model,
|
|
381
|
+
this.entityName,
|
|
382
|
+
jsContent,
|
|
383
|
+
this.formNoRuleCode,
|
|
384
|
+
this.ids,
|
|
385
|
+
this.isBatchProcessing,
|
|
386
|
+
needDeleteFileUuidS,
|
|
387
|
+
this.additionalParamMap,
|
|
388
|
+
this.beanName
|
|
389
|
+
)
|
|
390
|
+
}
|
|
391
|
+
})
|
|
392
|
+
})
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
// 获取需要删除的附件
|
|
396
|
+
getNeedDeleteFileUuidS () {
|
|
397
|
+
if (this.$refs.superForm) {
|
|
398
|
+
return this.$refs.superForm.getNeedDeleteFileUuid()
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
// 获得获取表单内容url
|
|
402
|
+
getRealUrlForView () {
|
|
403
|
+
if (this.urlForView) {
|
|
404
|
+
this.formOptions.urlForView = this.getRealRestApiPath(
|
|
405
|
+
this.urlForView.url,
|
|
406
|
+
this.system
|
|
407
|
+
)
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
// 初始化自定义系统表单数据
|
|
411
|
+
initDscFormData () {
|
|
412
|
+
if (
|
|
413
|
+
(!this.system || this.system.standard === false) &&
|
|
414
|
+
(!this.urlForView || !this.urlForView.url)
|
|
415
|
+
) {
|
|
416
|
+
// 表示自定义系统,并且没有配置路径
|
|
417
|
+
// 表示是普通表单
|
|
418
|
+
this.getDscFormData()
|
|
419
|
+
} else {
|
|
420
|
+
// 获得最高版本表单id
|
|
421
|
+
this.getHighestFormViewId()
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
// 保存表单内容并获得表单内容
|
|
425
|
+
saveFormData (isEnableRequired) {
|
|
426
|
+
const that = this
|
|
427
|
+
return new Promise((resolve, reject) => {
|
|
428
|
+
if (that.$refs.superForm) {
|
|
429
|
+
that.$refs.superForm.getModels(isEnableRequired).then(model => {
|
|
430
|
+
// console.log('表单数据=', model)
|
|
431
|
+
// 移除验证失败字段名,否则会造成后台保存失败
|
|
432
|
+
if (Object.keys(model).indexOf('validateErrorField') >= 0) {
|
|
433
|
+
delete model.validateErrorField
|
|
434
|
+
}
|
|
435
|
+
resolve(model)
|
|
436
|
+
})
|
|
437
|
+
} else {
|
|
438
|
+
resolve()
|
|
439
|
+
}
|
|
440
|
+
})
|
|
441
|
+
},
|
|
442
|
+
// 修改时获得自定义表单数据
|
|
443
|
+
getDscFormData () {
|
|
444
|
+
const backendUrl = getSystemBackendUrl(this.system.backendUrl)
|
|
445
|
+
console.log('this.ids ', this.ids)
|
|
446
|
+
const urlForView = backendUrl + '/dsc/commons/gets'
|
|
447
|
+
const param = {
|
|
448
|
+
formViewCode: this.formViewCode,
|
|
449
|
+
tableName: this.tableName,
|
|
450
|
+
formNoRuleCode: this.formNoRuleCode,
|
|
451
|
+
id: this.dataId,
|
|
452
|
+
systemCode: this.system.code,
|
|
453
|
+
functionCode: this.permissionPrefix + '.get'
|
|
454
|
+
}
|
|
455
|
+
if (this.ids) {
|
|
456
|
+
param.ids = this.ids
|
|
457
|
+
}
|
|
458
|
+
if (this.notIdInitializationList) {
|
|
459
|
+
param.noIdAndTaskIdInitSetting = JSON.stringify(
|
|
460
|
+
this.notIdInitializationList
|
|
461
|
+
)
|
|
462
|
+
}
|
|
463
|
+
if (this.additionalParamMap) {
|
|
464
|
+
param.additionalParamMap = JSON.parse(
|
|
465
|
+
JSON.stringify(this.additionalParamMap)
|
|
466
|
+
)
|
|
467
|
+
}
|
|
468
|
+
if (this.entityName) {
|
|
469
|
+
param.entityName = this.entityName
|
|
470
|
+
}
|
|
471
|
+
if (this.beanName) {
|
|
472
|
+
param.beanName = this.beanName
|
|
473
|
+
}
|
|
474
|
+
if (this.pathQuery && this.pathQuery.taskId) {
|
|
475
|
+
param.taskId = this.pathQuery.taskId
|
|
476
|
+
}
|
|
477
|
+
if (urlForView) {
|
|
478
|
+
this.isShowForm = false
|
|
479
|
+
this.$http.post(urlForView, param).then(formParam => {
|
|
480
|
+
if (formParam) {
|
|
481
|
+
this.formData = formParam.entity
|
|
482
|
+
// 获得表单编码规则解析结果
|
|
483
|
+
this.formNo = formParam.formNo
|
|
484
|
+
setStoreInfo(this.pageCode, '_formData', this.formData)
|
|
485
|
+
this.formViewId = formParam.formViewId
|
|
486
|
+
if (this.dataId) {
|
|
487
|
+
// 是否是新建表单
|
|
488
|
+
setStoreInfo(this.pageCode, '_isCreateformData', false)
|
|
489
|
+
} else {
|
|
490
|
+
setStoreInfo(this.pageCode, '_isCreateformData', true)
|
|
491
|
+
}
|
|
492
|
+
this.dataTypeMap = formParam.dataTypeMap
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
this.isShowForm = true
|
|
496
|
+
this.isInitDscFormData = true
|
|
497
|
+
})
|
|
498
|
+
}
|
|
499
|
+
},
|
|
500
|
+
// 新建时获得最高版本表单
|
|
501
|
+
getHighestFormViewId () {
|
|
502
|
+
const url =
|
|
503
|
+
Vue.prototype.baseAPI +
|
|
504
|
+
'/component/super-pages/forms/' +
|
|
505
|
+
this.formViewCode
|
|
506
|
+
this.isShowForm = false
|
|
507
|
+
this.$http.get(url).then(formViewId => {
|
|
508
|
+
this.formViewId = formViewId
|
|
509
|
+
this.isShowForm = true
|
|
510
|
+
})
|
|
511
|
+
},
|
|
512
|
+
getFormData () {
|
|
513
|
+
if (this.$refs.superForm) {
|
|
514
|
+
return this.$refs.superForm.getFormData()
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
fnProhibitToEdit (entity) {
|
|
518
|
+
console.log('this.$refs.superForm', this.$refs.superForm)
|
|
519
|
+
if (this.$refs.superForm) {
|
|
520
|
+
return this.$refs.superForm.fnProhibitToEdit(entity)
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
refresMainTableFields (entity) {
|
|
524
|
+
console.log('this.$refs.superForm', this.$refs.superForm)
|
|
525
|
+
if (this.$refs.superForm) {
|
|
526
|
+
this.reviewButton(entity)
|
|
527
|
+
return this.$refs.superForm.refresMainTableFields(entity)
|
|
528
|
+
}
|
|
529
|
+
},
|
|
530
|
+
clickRefreshFrom (entity) {
|
|
531
|
+
let dataId
|
|
532
|
+
if (entity.id) {
|
|
533
|
+
dataId = entity.id
|
|
534
|
+
} else if (entity.ID) {
|
|
535
|
+
dataId = entity.ID
|
|
536
|
+
}
|
|
537
|
+
if (dataId) {
|
|
538
|
+
this.getDscFormData()
|
|
539
|
+
} else {
|
|
540
|
+
this.refreshForm(entity)
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
</script>
|
|
546
|
+
|
|
547
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog
|
|
3
|
+
:show-close="true"
|
|
4
|
+
:append-to-body="true"
|
|
5
|
+
:title="$t('superPage.selectTemplate')"
|
|
6
|
+
visible
|
|
7
|
+
@close="closeExportForm"
|
|
8
|
+
>
|
|
9
|
+
<el-table
|
|
10
|
+
:data="templateFiles"
|
|
11
|
+
style="width: 100%"
|
|
12
|
+
>
|
|
13
|
+
<el-table-column
|
|
14
|
+
:label="$t('superPage.temlpate')"
|
|
15
|
+
prop="templateShowPath"
|
|
16
|
+
/>
|
|
17
|
+
<el-table-column
|
|
18
|
+
:label="$t('superPage.operating')"
|
|
19
|
+
width="200"
|
|
20
|
+
fixed="right"
|
|
21
|
+
>
|
|
22
|
+
<template slot-scope="scope">
|
|
23
|
+
<el-button
|
|
24
|
+
type="text"
|
|
25
|
+
size="small"
|
|
26
|
+
@click="exportForm(scope.row)"
|
|
27
|
+
>
|
|
28
|
+
{{ $t('superPage.export') }}
|
|
29
|
+
</el-button>
|
|
30
|
+
<!-- <el-button
|
|
31
|
+
type="text"
|
|
32
|
+
size="small"
|
|
33
|
+
@click="previewExportForm(scope.row)"
|
|
34
|
+
>
|
|
35
|
+
{{ $t('superPage.preview') }}
|
|
36
|
+
</el-button> -->
|
|
37
|
+
</template>
|
|
38
|
+
</el-table-column>
|
|
39
|
+
</el-table>
|
|
40
|
+
</el-dialog>
|
|
41
|
+
</template>
|
|
42
|
+
<script>
|
|
43
|
+
import {packageTemplateFiles} from './util/common-util'
|
|
44
|
+
export default {
|
|
45
|
+
name: 'ExportFormReportDialog',
|
|
46
|
+
props: {
|
|
47
|
+
button: {
|
|
48
|
+
type: [Array, Object],
|
|
49
|
+
default: () => {
|
|
50
|
+
return null
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
},
|
|
55
|
+
data () {
|
|
56
|
+
let templateFiles = []
|
|
57
|
+
if (this.button.templateFiles && this.button.templateFiles.length > 0) {
|
|
58
|
+
templateFiles = packageTemplateFiles(this.button.templateFiles)
|
|
59
|
+
} else if (this.button.templateUUID && this.button.templateShowPath) {
|
|
60
|
+
templateFiles.push({ templateUUID: this.button.templateUUID, templateShowPath: this.button.templateShowPath })
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
templateFiles
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
created () {
|
|
67
|
+
|
|
68
|
+
},
|
|
69
|
+
methods: {
|
|
70
|
+
exportForm (row) {
|
|
71
|
+
this.$emit('before-export-form-report', row)
|
|
72
|
+
},
|
|
73
|
+
previewExportForm (row) {
|
|
74
|
+
this.$emit('preview-export-form-report', row)
|
|
75
|
+
},
|
|
76
|
+
closeExportForm () {
|
|
77
|
+
this.$emit('close')
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
</script>
|
|
82
|
+
<style scoped>
|
|
83
|
+
|
|
84
|
+
</style>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:style="{marginTop:formButtonPosition==='topLeft'?'72px':''}"
|
|
4
|
+
class="formHead"
|
|
5
|
+
>
|
|
6
|
+
<div
|
|
7
|
+
v-if="formTitle && formTitle !== '' && formTitle !== null"
|
|
8
|
+
class="formTitle"
|
|
9
|
+
>
|
|
10
|
+
{{ formTitle }}
|
|
11
|
+
</div>
|
|
12
|
+
<span
|
|
13
|
+
v-if="formNo"
|
|
14
|
+
style="font-size:18px;position:relative;margin-left:75%;"
|
|
15
|
+
>{{ (formNoLabel && formNoLabel!==null&&formNoLabel.trim()!=="")?formNoLabel+":":$t('superPage.formNo') }}{{ formNo }}</span>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
export default {
|
|
21
|
+
name: 'FormHead',
|
|
22
|
+
components: {
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
// 表单标题
|
|
26
|
+
formTitle: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: null
|
|
29
|
+
},
|
|
30
|
+
// 表单编码规则解析获得的表单编码
|
|
31
|
+
formNo: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: null
|
|
34
|
+
},
|
|
35
|
+
formNoLabel: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: null
|
|
38
|
+
},
|
|
39
|
+
formButtonPosition: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: null
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<style lang="scss" scoped>
|
|
49
|
+
.formTitle {
|
|
50
|
+
color:#333;
|
|
51
|
+
padding:0;
|
|
52
|
+
border:0;
|
|
53
|
+
display:block;
|
|
54
|
+
margin-left: 40%;
|
|
55
|
+
margin-bottom:20px;
|
|
56
|
+
font-weight: 700;
|
|
57
|
+
font-size:24px;
|
|
58
|
+
}
|
|
59
|
+
.formHead {
|
|
60
|
+
color:#333;
|
|
61
|
+
padding:10px;
|
|
62
|
+
border:0;
|
|
63
|
+
display:block;
|
|
64
|
+
width:100%;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
</style>
|