super-pages 0.0.10-up → 0.0.11-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/index.html +13 -0
- package/package.json +2 -12
- package/packages/index.js +30 -0
- package/packages/super-page/index.js +9 -0
- package/packages/super-page/src/button-group.vue +294 -0
- package/packages/super-page/src/chart-page.vue +215 -0
- package/packages/super-page/src/chart-query-page.vue +163 -0
- package/packages/super-page/src/common-form-page.vue +594 -0
- package/packages/super-page/src/export-form-report-dialog.vue +145 -0
- package/packages/super-page/src/form-head.vue +74 -0
- package/packages/super-page/src/form-page.vue +107 -0
- package/packages/super-page/src/group-tag.vue +21 -0
- package/packages/super-page/src/list-page.vue +1453 -0
- package/packages/super-page/src/list-toolbar-dynamic-source.vue +89 -0
- package/packages/super-page/src/list-toolbar-page.vue +377 -0
- package/packages/super-page/src/my-button-base.vue +438 -0
- package/packages/super-page/src/my-button.vue +196 -0
- package/packages/super-page/src/page-custom-component.vue +56 -0
- package/packages/super-page/src/remove-signer-dialog.vue +103 -0
- package/packages/super-page/src/sub-tab-page.vue +79 -0
- package/packages/super-page/src/super-page-component.vue +86 -0
- package/packages/super-page/src/super-page.vue +162 -0
- package/packages/super-page/src/tab-page.vue +154 -0
- package/packages/super-page/src/task-informition-dialog.vue +82 -0
- package/packages/super-page/src/util/ListButtonEvent.js +896 -0
- package/packages/super-page/src/util/api.js +37 -0
- package/packages/super-page/src/util/callEvents.js +62 -0
- package/packages/super-page/src/util/chartButtonEvent.js +60 -0
- package/packages/super-page/src/util/common-util.js +102 -0
- package/packages/super-page/src/util/commonButtonEvent.js +70 -0
- package/packages/super-page/src/util/eventBus.js +8 -0
- package/packages/super-page/src/util/formButtonEvent.js +509 -0
- package/packages/super-page/src/util/store.js +3 -0
- package/packages/super-page/src/util/super-page.js +29 -0
- package/packages/super-page/src/util/util.js +1491 -0
- package/packages/super-page/src/util/workflowButtonEvent.js +1729 -0
- package/packages/super-page/src/widget-col-page.vue +339 -0
- package/packages/super-page/src/widget-page.vue +703 -0
- package/packages/super-page/src/widget-sub-tab-pane-page.vue +115 -0
- package/packages/super-page/src/widget-tab-pane-page.vue +135 -0
- package/packages/super-page/src/workflow-button-group.vue +561 -0
- package/packages/super-page/src/workflow-form-page.vue +1310 -0
- package/packages/super-page-dialog/index.js +9 -0
- package/packages/super-page-dialog/src/super-page-dialog.vue +200 -0
- package/packages/utils/gogocodeTransfer.js +59 -0
- package/public/vite.svg +1 -0
- package/src/i18n/i18n.js +16 -0
- package/src/i18n/langs/cn.js +65 -0
- package/src/i18n/langs/en.js +68 -0
- package/src/styles/index.scss +4 -0
- package/src/utils/common-util.js +9 -0
- package/vite.config.js +36 -0
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span v-if="isCustomVisible" :id="pageCode + '_' + button.code">
|
|
3
|
+
<span
|
|
4
|
+
v-if="!isView || button.code === 'back'"
|
|
5
|
+
v-permission="permission"
|
|
6
|
+
style="margin-right: 10px"
|
|
7
|
+
>
|
|
8
|
+
<span v-if="button.code !== 'exportPDF'">
|
|
9
|
+
<component
|
|
10
|
+
:is="button.customControl"
|
|
11
|
+
v-if="button.customControl"
|
|
12
|
+
:search-form-data="searchFormInfo.data"
|
|
13
|
+
:selections="selections"
|
|
14
|
+
:entity="initFormData"
|
|
15
|
+
:get-entity="myFormDataFun"
|
|
16
|
+
:refresh-list="getSystemRef"
|
|
17
|
+
:class="button.code"
|
|
18
|
+
:custom-params="customParams"
|
|
19
|
+
:button-groups="buttonGroups"
|
|
20
|
+
@workflow-button-click="clickWorkflowButton"
|
|
21
|
+
:additional-param-map="additionalParamMap"
|
|
22
|
+
@refresh="refreshEmit"
|
|
23
|
+
@prohibi-edit="fnProhibitToEdit"
|
|
24
|
+
@refresh-tab="refreshTab"
|
|
25
|
+
@refresh-from="refreshFrom"
|
|
26
|
+
/>
|
|
27
|
+
<el-button
|
|
28
|
+
v-else
|
|
29
|
+
:loading="button.loading === undefined ? false : button.loading"
|
|
30
|
+
:disabled="disabled ? disabled : preventReclick"
|
|
31
|
+
:size="button.size ? button.size : 'small'"
|
|
32
|
+
:type="getButtonType(button)"
|
|
33
|
+
:icon="icon"
|
|
34
|
+
:class="button.code"
|
|
35
|
+
:plain="
|
|
36
|
+
typeof button.isPlain === 'undefined' ? false : button.isPlain
|
|
37
|
+
"
|
|
38
|
+
:round="
|
|
39
|
+
typeof button.isRound === 'undefined' ? false : button.isRound
|
|
40
|
+
"
|
|
41
|
+
:circle="
|
|
42
|
+
typeof button.isCircle === 'undefined' ? false : button.isCircle
|
|
43
|
+
"
|
|
44
|
+
@click="clickMyButton(button)"
|
|
45
|
+
>{{ getButtonLabel(button) }}</el-button
|
|
46
|
+
>
|
|
47
|
+
</span>
|
|
48
|
+
<span v-else>
|
|
49
|
+
<export-pdf-button
|
|
50
|
+
v-if="showPdfButton"
|
|
51
|
+
:pdf-template-code="button.pdfTemplateCode"
|
|
52
|
+
:entity="formData"
|
|
53
|
+
:base-props="button"
|
|
54
|
+
:watermark-setting="watermarkSetting"
|
|
55
|
+
:befoer-open="befoerOpenPdf"
|
|
56
|
+
@closePreview="closePreview"
|
|
57
|
+
/>
|
|
58
|
+
</span>
|
|
59
|
+
</span>
|
|
60
|
+
<export-form-report-dialog
|
|
61
|
+
v-if="showExportForm"
|
|
62
|
+
:button="button"
|
|
63
|
+
:entity="initFormData"
|
|
64
|
+
@close="closeExportFormDialog"
|
|
65
|
+
@preview-export-form-report="previewExportFormReport"
|
|
66
|
+
@before-export-form-report="beforeExportFormReport"
|
|
67
|
+
/>
|
|
68
|
+
</span>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<script>
|
|
72
|
+
import { $on, $off, $once, $emit } from '../../utils/gogocodeTransfer'
|
|
73
|
+
import { mapGetters } from 'vuex'
|
|
74
|
+
import Util from './util/util'
|
|
75
|
+
import { getStoreInfo } from './util/common-util'
|
|
76
|
+
import superPageService from './util/super-page'
|
|
77
|
+
import ExportFormReportDialog from './export-form-report-dialog'
|
|
78
|
+
export default {
|
|
79
|
+
name: 'MyButtonBase',
|
|
80
|
+
components: {
|
|
81
|
+
ExportFormReportDialog,
|
|
82
|
+
},
|
|
83
|
+
props: {
|
|
84
|
+
button: {
|
|
85
|
+
type: Object,
|
|
86
|
+
default: null,
|
|
87
|
+
},
|
|
88
|
+
// 资源编码前缀,例如:系统编码.页面编码.列表组件编码 或 系统编码.页面编码.表单组件编码 或 系统编码.页面编码.按钮组组件编码
|
|
89
|
+
permissionPrefix: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: null,
|
|
92
|
+
},
|
|
93
|
+
// 按钮所在位置,list列表或form表单内
|
|
94
|
+
position: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: null,
|
|
97
|
+
},
|
|
98
|
+
// 数据表名称
|
|
99
|
+
tableName: {
|
|
100
|
+
type: String,
|
|
101
|
+
default: null,
|
|
102
|
+
},
|
|
103
|
+
// 流程表单页面才需要传该设置
|
|
104
|
+
buttonGroups: {
|
|
105
|
+
type: Array,
|
|
106
|
+
default: null,
|
|
107
|
+
},
|
|
108
|
+
// 列表行编辑时编辑的记录下标,行编辑按钮使用
|
|
109
|
+
rowIndex: {
|
|
110
|
+
type: Number,
|
|
111
|
+
default: null,
|
|
112
|
+
},
|
|
113
|
+
// 页面编码
|
|
114
|
+
pageCode: {
|
|
115
|
+
type: String,
|
|
116
|
+
default: null,
|
|
117
|
+
},
|
|
118
|
+
// 获取页面数据的方法
|
|
119
|
+
getFormData: {
|
|
120
|
+
type: Function,
|
|
121
|
+
default: function () {},
|
|
122
|
+
},
|
|
123
|
+
// 列表选中的记录集合
|
|
124
|
+
selections: {
|
|
125
|
+
type: Array,
|
|
126
|
+
default: null,
|
|
127
|
+
},
|
|
128
|
+
// 表单对象
|
|
129
|
+
myFormDataFun: {
|
|
130
|
+
type: Function,
|
|
131
|
+
default: function () {},
|
|
132
|
+
},
|
|
133
|
+
// 列表刷新方法
|
|
134
|
+
getSystemRef: {
|
|
135
|
+
type: Function,
|
|
136
|
+
default: function () {},
|
|
137
|
+
},
|
|
138
|
+
searchFormInfo: {
|
|
139
|
+
type: Object,
|
|
140
|
+
default: () => {
|
|
141
|
+
return { data: {} }
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
disabled: {
|
|
145
|
+
type: Boolean,
|
|
146
|
+
default: false,
|
|
147
|
+
},
|
|
148
|
+
// 没传的话,需要在本组件内判断是否显示
|
|
149
|
+
isVisible: {
|
|
150
|
+
type: String,
|
|
151
|
+
default: null,
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
data() {
|
|
155
|
+
let permission = 'true'
|
|
156
|
+
if (
|
|
157
|
+
this.button.isPermission === undefined ||
|
|
158
|
+
this.button.isPermission === true
|
|
159
|
+
) {
|
|
160
|
+
// 表示按钮受权限保护
|
|
161
|
+
permission = this.permissionPrefix + '.' + this.button.code
|
|
162
|
+
if (this.button.functionCode) {
|
|
163
|
+
permission = this.button.functionCode
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
console.log('my-button-base1111------permission=', permission)
|
|
167
|
+
const isDevMode = getStoreInfo(this.pageCode, '_pageDevMode')
|
|
168
|
+
const isPreview = getStoreInfo(this.pageCode, '_pagePreview')
|
|
169
|
+
console.log('my-button-base222------isDevMode=', isDevMode)
|
|
170
|
+
console.log('my-button-base333------isPreview=', isPreview)
|
|
171
|
+
if (
|
|
172
|
+
(isDevMode && isDevMode === true) ||
|
|
173
|
+
(isPreview && isPreview === true) ||
|
|
174
|
+
(this.button && this.button.code === 'back')
|
|
175
|
+
) {
|
|
176
|
+
// 开发模式 或 预览时 或 返回按钮,权限不受控制
|
|
177
|
+
permission = 'true'
|
|
178
|
+
}
|
|
179
|
+
console.log('my-button-base444------permission=', permission)
|
|
180
|
+
const displayConditions = this.button.buttonDisplayConditionsList
|
|
181
|
+
let isCustomVisible = false
|
|
182
|
+
const isView = this.isViewDetail(this.position)
|
|
183
|
+
let icon = this.button.icon
|
|
184
|
+
if (icon && icon.indexOf('fa-') === 0) {
|
|
185
|
+
// 表示以“fa-”开头,使用font-awesome中的图标
|
|
186
|
+
icon = 'fa fa-custom ' + icon
|
|
187
|
+
}
|
|
188
|
+
if (this.position === 'chart' && !icon && this.button.code === 'export') {
|
|
189
|
+
icon = 'fa fa-custom fa-cloud-download'
|
|
190
|
+
}
|
|
191
|
+
const formDataFun = this.myFormDataFun
|
|
192
|
+
let initFormData
|
|
193
|
+
if (formDataFun) {
|
|
194
|
+
initFormData = formDataFun.call(this)
|
|
195
|
+
}
|
|
196
|
+
let jumpInfo = sessionStorage.getItem(this.pageCode + '-jumpMode')
|
|
197
|
+
let backButtonName
|
|
198
|
+
if (jumpInfo) {
|
|
199
|
+
const jumpInfoObj = JSON.parse(jumpInfo)
|
|
200
|
+
const jumpMode = jumpInfoObj.jumpMode
|
|
201
|
+
if (jumpMode === 'openWindow' || jumpMode === 'newTab') {
|
|
202
|
+
// 新页签或新窗口显示“关闭”按钮
|
|
203
|
+
backButtonName = this.$t('superPage.closeButton')
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return {
|
|
207
|
+
permission, // 按钮的资源编码
|
|
208
|
+
isCustomVisible, // 是否显示按钮
|
|
209
|
+
displayConditions, // 按钮显示条件
|
|
210
|
+
isPreview, // 预览时导入按钮不操作
|
|
211
|
+
isView, // 是否是查看页面
|
|
212
|
+
additionalParamMap: null, // 跳转页面的附加参数
|
|
213
|
+
icon,
|
|
214
|
+
formData: {},
|
|
215
|
+
contextParameter: null,
|
|
216
|
+
watermarkSetting: null,
|
|
217
|
+
showPdfButton: false,
|
|
218
|
+
showExportForm: false,
|
|
219
|
+
initFormData, // 表单初始值
|
|
220
|
+
backButtonName,
|
|
221
|
+
customParams: {},
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
computed: {
|
|
225
|
+
...mapGetters(['preventReclick']),
|
|
226
|
+
},
|
|
227
|
+
created() {
|
|
228
|
+
if (this.button.customParams) {
|
|
229
|
+
this.customParams = this.formatCustomParams(this.button.customParams)
|
|
230
|
+
}
|
|
231
|
+
const additionalParamMap = getStoreInfo(this.pageCode, 'additionalParamMap')
|
|
232
|
+
if (additionalParamMap) {
|
|
233
|
+
this.additionalParamMap = additionalParamMap
|
|
234
|
+
}
|
|
235
|
+
const contextParameter = getStoreInfo(this.pageCode, '_contextParameter')
|
|
236
|
+
if (contextParameter) {
|
|
237
|
+
this.contextParameter = contextParameter
|
|
238
|
+
}
|
|
239
|
+
// 判断是否需要水印
|
|
240
|
+
if (this.button.code === 'exportPDF') {
|
|
241
|
+
this.judgeNeedWatermark()
|
|
242
|
+
// 判断pdf按钮需要的样式
|
|
243
|
+
this.judgePdfButtonStyle()
|
|
244
|
+
}
|
|
245
|
+
// 解析按钮是否显示
|
|
246
|
+
if (this.isVisible === undefined || this.isVisible === null) {
|
|
247
|
+
// 如果没有传按钮是否显示,则需要自己重新解析是否显示
|
|
248
|
+
if (!this.displayConditions || this.displayConditions.length === 0) {
|
|
249
|
+
// 如果没有配置按钮显示条件,则默认为显示
|
|
250
|
+
this.isCustomVisible = true
|
|
251
|
+
} else if (this.position === 'form' || this.position === 'workflowForm') {
|
|
252
|
+
this.isButtonVisible(
|
|
253
|
+
this.displayConditions,
|
|
254
|
+
this.tableName,
|
|
255
|
+
this.additionalParamMap
|
|
256
|
+
).then((result) => {
|
|
257
|
+
this.isCustomVisible = result
|
|
258
|
+
})
|
|
259
|
+
}
|
|
260
|
+
} else {
|
|
261
|
+
this.isCustomVisible = this.isVisible === 'true'
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
methods: {
|
|
265
|
+
...Util,
|
|
266
|
+
...superPageService,
|
|
267
|
+
judgePdfButtonStyle() {
|
|
268
|
+
if (this.button.loading === null || this.button.loading === undefined) {
|
|
269
|
+
this.button.loading = false
|
|
270
|
+
}
|
|
271
|
+
this.button.disabled = this.preventReclick
|
|
272
|
+
if (this.button.size === null || this.button.size === undefined) {
|
|
273
|
+
this.button.size = 'small'
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
// 判断是否需要水印
|
|
277
|
+
judgeNeedWatermark() {
|
|
278
|
+
if (this.button.pdfNeedAddWatermark) {
|
|
279
|
+
const system = getStoreInfo(this.pageCode, '_systemInfo')
|
|
280
|
+
let code = null
|
|
281
|
+
// 先获取按钮选择的水印
|
|
282
|
+
if (this.button.pdfTemplateWatermarkCode) {
|
|
283
|
+
code = this.button.pdfTemplateWatermarkCode
|
|
284
|
+
} else if (system && system.watermarkCode) {
|
|
285
|
+
// 当前系统的水印
|
|
286
|
+
code = system.watermarkCode
|
|
287
|
+
}
|
|
288
|
+
if (code) {
|
|
289
|
+
const contextParameter = getStoreInfo(
|
|
290
|
+
this.pageCode,
|
|
291
|
+
'_contextParameter'
|
|
292
|
+
)
|
|
293
|
+
this.getSystemWatermark(code).then((data) => {
|
|
294
|
+
if (data != null) {
|
|
295
|
+
if (data.watermarkSetting) {
|
|
296
|
+
// this.showPageWatermarkSetting(JSON.parse(data.watermarkSetting), contextParameter)
|
|
297
|
+
const pageWatermarkSetting = JSON.parse(data.watermarkSetting)
|
|
298
|
+
if (pageWatermarkSetting) {
|
|
299
|
+
const label = this.getWatermarkLabel(
|
|
300
|
+
pageWatermarkSetting,
|
|
301
|
+
contextParameter
|
|
302
|
+
)
|
|
303
|
+
pageWatermarkSetting.label = label
|
|
304
|
+
this.watermarkSetting = pageWatermarkSetting
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
this.showPdfButton = true
|
|
308
|
+
}
|
|
309
|
+
})
|
|
310
|
+
} else {
|
|
311
|
+
this.showPdfButton = true
|
|
312
|
+
}
|
|
313
|
+
} else {
|
|
314
|
+
this.showPdfButton = true
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
// 按钮组中按钮点击事件
|
|
318
|
+
clickMyButton(button) {
|
|
319
|
+
if (button.code === 'exportForm') {
|
|
320
|
+
this.showExportForm = true
|
|
321
|
+
} else {
|
|
322
|
+
$emit(this, 'click', button)
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
befoerOpenPdf() {
|
|
326
|
+
if (this.button.code === 'exportPDF') {
|
|
327
|
+
if (this.getFormData) {
|
|
328
|
+
const custFun = this.getFormData
|
|
329
|
+
custFun.call(this, false).then((data) => {
|
|
330
|
+
this.formData = data
|
|
331
|
+
})
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
return true
|
|
335
|
+
},
|
|
336
|
+
closePreview() {
|
|
337
|
+
setTimeout(function () {
|
|
338
|
+
const thisNode = document.getElementById('1.23452384164.123412456415')
|
|
339
|
+
if (thisNode != null) {
|
|
340
|
+
if (document.getElementById('pdfDom')) {
|
|
341
|
+
var cell1 = document.getElementById('pdfDom')
|
|
342
|
+
cell1.removeChild(
|
|
343
|
+
document.getElementById('1.23452384164.123412456415')
|
|
344
|
+
)
|
|
345
|
+
} else {
|
|
346
|
+
console.log(thisNode.parentNode.childNodes)
|
|
347
|
+
// thisNode.parentNode.childNodes.splice(10, 1)
|
|
348
|
+
thisNode.parentNode.removeChild(thisNode)
|
|
349
|
+
// 1.23452384164.123412456415
|
|
350
|
+
// document.body.removeChild(document.getElementById('1.23452384164.123412456415'))
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}, 500)
|
|
354
|
+
// this.$nextTick(() => {
|
|
355
|
+
// debugger
|
|
356
|
+
// const thisNode = document.getElementById('1.23452384164.123412456415')
|
|
357
|
+
// if (thisNode != null) {
|
|
358
|
+
// if (document.getElementById('pdfDom')) {
|
|
359
|
+
// var cell1 = document.getElementById('pdfDom')
|
|
360
|
+
// cell1.removeChild(document.getElementById('1.23452384164.123412456415'))
|
|
361
|
+
// } else {
|
|
362
|
+
// document.body.removeChild(document.getElementById('1.23452384164.123412456415'))
|
|
363
|
+
// }
|
|
364
|
+
// }
|
|
365
|
+
// })
|
|
366
|
+
},
|
|
367
|
+
beforeExportFormReport(templateFileInfo) {
|
|
368
|
+
this.button['templateShowPath'] = templateFileInfo.templateShowPath
|
|
369
|
+
this.button['templateUUID'] = templateFileInfo.templateUUID
|
|
370
|
+
$emit(this, 'click', this.button)
|
|
371
|
+
},
|
|
372
|
+
previewExportFormReport(templateFileInfo) {
|
|
373
|
+
this.button['isPreviewFormReport'] = true
|
|
374
|
+
this.button['templateShowPath'] = templateFileInfo.templateShowPath
|
|
375
|
+
this.button['templateUUID'] = templateFileInfo.templateUUID
|
|
376
|
+
$emit(this, 'click', this.button)
|
|
377
|
+
},
|
|
378
|
+
closeExportFormDialog() {
|
|
379
|
+
this.showExportForm = false
|
|
380
|
+
},
|
|
381
|
+
fnProhibitToEdit(data) {
|
|
382
|
+
$emit(this, 'prohibi-edit', data)
|
|
383
|
+
},
|
|
384
|
+
getButtonLabel(button) {
|
|
385
|
+
let label = button.label
|
|
386
|
+
? button.label
|
|
387
|
+
: button.code === 'search'
|
|
388
|
+
? this.$t('superPageMessage.searchButtonLabel')
|
|
389
|
+
: ''
|
|
390
|
+
if (button.code === 'back' && this.backButtonName) {
|
|
391
|
+
label = this.backButtonName
|
|
392
|
+
}
|
|
393
|
+
return label
|
|
394
|
+
},
|
|
395
|
+
getButtonType(button) {
|
|
396
|
+
return this.position && this.position === 'chart'
|
|
397
|
+
? 'text'
|
|
398
|
+
: button.type
|
|
399
|
+
? button.type
|
|
400
|
+
: button.code === 'delete'
|
|
401
|
+
? 'danger'
|
|
402
|
+
: ''
|
|
403
|
+
},
|
|
404
|
+
formatCustomParams(customParams) {
|
|
405
|
+
if (customParams) {
|
|
406
|
+
const params = {}
|
|
407
|
+
customParams.forEach((param) => {
|
|
408
|
+
params[param.name] = param.value
|
|
409
|
+
})
|
|
410
|
+
return params
|
|
411
|
+
} else {
|
|
412
|
+
return {}
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
clickWorkflowButton(clickParam) {
|
|
416
|
+
const workflowButton = this.buttonGroups.find(
|
|
417
|
+
(button) => button.code === 'workflowButton'
|
|
418
|
+
)
|
|
419
|
+
if (workflowButton && !Array.isArray(workflowButton)) {
|
|
420
|
+
this.workflowButtonClick(
|
|
421
|
+
clickParam.event,
|
|
422
|
+
null,
|
|
423
|
+
null,
|
|
424
|
+
workflowButton,
|
|
425
|
+
clickParam.completeTaskParam
|
|
426
|
+
)
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
},
|
|
430
|
+
emits: ['click', 'prohibi-edit'],
|
|
431
|
+
}
|
|
432
|
+
</script>
|
|
433
|
+
|
|
434
|
+
<style>
|
|
435
|
+
.fa-custom {
|
|
436
|
+
padding-right: 5px;
|
|
437
|
+
}
|
|
438
|
+
</style>
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span v-if="isVisible">
|
|
3
|
+
<workflow-button-group
|
|
4
|
+
v-if="button.code === 'workflowButton'"
|
|
5
|
+
ref="workflowButtonGroup"
|
|
6
|
+
:permission-prefix="permissionPrefix"
|
|
7
|
+
:workflow-button-component="workflowButtonComponent"
|
|
8
|
+
:is-task-input="isTaskInput"
|
|
9
|
+
:table-name="tableName"
|
|
10
|
+
:button="button"
|
|
11
|
+
:button-groups="buttonGroups"
|
|
12
|
+
:page-code="pageCode"
|
|
13
|
+
:work-name-color="workNameColor"
|
|
14
|
+
:get-form-data="getFormData"
|
|
15
|
+
:my-form-data-fun="formDataFun"
|
|
16
|
+
:form-button-position="formButtonPosition"
|
|
17
|
+
@refresh="refreshEmit"
|
|
18
|
+
@click="commonButtonClick"
|
|
19
|
+
@workflowClick="workflowButtonClick"
|
|
20
|
+
@prohibi-edit="fnProhibitToEdit"
|
|
21
|
+
@refreshFrom="refreshFrom"
|
|
22
|
+
/>
|
|
23
|
+
<my-button-base
|
|
24
|
+
v-else
|
|
25
|
+
:search-form-info="searchFormInfo"
|
|
26
|
+
:button="button"
|
|
27
|
+
:permission-prefix="permissionPrefix"
|
|
28
|
+
:disabled="disabled"
|
|
29
|
+
:position="position"
|
|
30
|
+
:table-name="tableName"
|
|
31
|
+
:page-code="pageCode"
|
|
32
|
+
:get-form-data="getFormData"
|
|
33
|
+
:selections="selections"
|
|
34
|
+
:my-form-data-fun="formDataFun"
|
|
35
|
+
:get-system-ref="getSystemRef"
|
|
36
|
+
is-visible="true"
|
|
37
|
+
:button-groups="buttonGroups"
|
|
38
|
+
@refresh="refreshEmit"
|
|
39
|
+
@click="commonButtonClick"
|
|
40
|
+
@workflowClick="workflowButtonClick"
|
|
41
|
+
@prohibi-edit="fnProhibitToEdit"
|
|
42
|
+
@refreshFrom="refreshFrom"
|
|
43
|
+
/>
|
|
44
|
+
</span>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script>
|
|
48
|
+
import { $on, $off, $once, $emit } from '../../utils/gogocodeTransfer'
|
|
49
|
+
import Util from './util/util'
|
|
50
|
+
import myButtonBase from './my-button-base'
|
|
51
|
+
import workflowButtonGroup from './workflow-button-group'
|
|
52
|
+
import { getStoreInfo } from './util/common-util'
|
|
53
|
+
export default {
|
|
54
|
+
name: 'MyButton',
|
|
55
|
+
components: {
|
|
56
|
+
myButtonBase,
|
|
57
|
+
workflowButtonGroup,
|
|
58
|
+
},
|
|
59
|
+
props: {
|
|
60
|
+
button: {
|
|
61
|
+
type: Object,
|
|
62
|
+
default: null,
|
|
63
|
+
},
|
|
64
|
+
// 资源编码前缀,例如:系统编码.页面编码.列表组件编码 或 系统编码.页面编码.表单组件编码 或 系统编码.页面编码.按钮组组件编码
|
|
65
|
+
permissionPrefix: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: null,
|
|
68
|
+
},
|
|
69
|
+
// 流程按钮组信息
|
|
70
|
+
workflowButtonComponent: {
|
|
71
|
+
type: Object,
|
|
72
|
+
default: null,
|
|
73
|
+
},
|
|
74
|
+
// 按钮所在位置,list列表或form表单内
|
|
75
|
+
position: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: null,
|
|
78
|
+
},
|
|
79
|
+
// 是否在任务办理页面(待办事宜中打开的),控制返回、关闭按钮
|
|
80
|
+
isTaskInput: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: false,
|
|
83
|
+
},
|
|
84
|
+
// 数据表名称
|
|
85
|
+
tableName: {
|
|
86
|
+
type: String,
|
|
87
|
+
default: null,
|
|
88
|
+
},
|
|
89
|
+
// 流程表单页面才需要传该设置
|
|
90
|
+
buttonGroups: {
|
|
91
|
+
type: Array,
|
|
92
|
+
default: null,
|
|
93
|
+
},
|
|
94
|
+
// 列表行编辑时编辑的记录下标,行编辑按钮使用
|
|
95
|
+
rowIndex: {
|
|
96
|
+
type: Number,
|
|
97
|
+
default: null,
|
|
98
|
+
},
|
|
99
|
+
// 页面编码
|
|
100
|
+
pageCode: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: null,
|
|
103
|
+
},
|
|
104
|
+
// 获取页面数据的方法
|
|
105
|
+
getFormData: {
|
|
106
|
+
type: Function,
|
|
107
|
+
default: null,
|
|
108
|
+
},
|
|
109
|
+
// 列表选中的记录集合
|
|
110
|
+
selections: {
|
|
111
|
+
type: Array,
|
|
112
|
+
default: null,
|
|
113
|
+
},
|
|
114
|
+
// 表单对象方法
|
|
115
|
+
formDataFun: {
|
|
116
|
+
type: Function,
|
|
117
|
+
default: function () {},
|
|
118
|
+
},
|
|
119
|
+
// 列表刷新方法
|
|
120
|
+
getSystemRef: {
|
|
121
|
+
type: Function,
|
|
122
|
+
default: function () {},
|
|
123
|
+
},
|
|
124
|
+
searchFormInfo: {
|
|
125
|
+
type: Object,
|
|
126
|
+
default: () => {
|
|
127
|
+
return { data: {} }
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
formButtonPosition: {
|
|
131
|
+
type: String,
|
|
132
|
+
default: null,
|
|
133
|
+
},
|
|
134
|
+
disabled: {
|
|
135
|
+
type: Boolean,
|
|
136
|
+
default: false,
|
|
137
|
+
},
|
|
138
|
+
workNameColor: {
|
|
139
|
+
type: String,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
data() {
|
|
143
|
+
let permission = this.permissionPrefix + '.' + this.button.code
|
|
144
|
+
const isDevMode = getStoreInfo(this.pageCode, '_pageDevMode')
|
|
145
|
+
|
|
146
|
+
const isPreview = getStoreInfo(this.pageCode, '_pagePreview')
|
|
147
|
+
if (
|
|
148
|
+
(isDevMode && isDevMode === true) ||
|
|
149
|
+
(isPreview && isPreview === true)
|
|
150
|
+
) {
|
|
151
|
+
// 开发模式 或 预览时按钮不受控制
|
|
152
|
+
permission = 'true'
|
|
153
|
+
}
|
|
154
|
+
const displayConditions = this.button.buttonDisplayConditionsList
|
|
155
|
+
let isVisible = false
|
|
156
|
+
if (!displayConditions || displayConditions === 0) {
|
|
157
|
+
// 如果没有配置按钮显示条件,则默认为显示
|
|
158
|
+
isVisible = true
|
|
159
|
+
}
|
|
160
|
+
const isView = this.isViewDetail(this.position)
|
|
161
|
+
return {
|
|
162
|
+
permission, // 按钮的资源编码
|
|
163
|
+
isVisible, // 是否显示按钮
|
|
164
|
+
displayConditions, // 按钮显示条件
|
|
165
|
+
isPreview, // 预览时导入按钮不操作
|
|
166
|
+
isView, // 是否是查看页面
|
|
167
|
+
additionalParamMap: null, // 跳转页面的附加参数
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
created() {
|
|
171
|
+
const additionalParamMap = getStoreInfo(this.pageCode, 'additionalParamMap')
|
|
172
|
+
if (additionalParamMap) {
|
|
173
|
+
this.additionalParamMap = additionalParamMap
|
|
174
|
+
}
|
|
175
|
+
// 解析按钮是否显示
|
|
176
|
+
if (!this.displayConditions || this.displayConditions.length === 0) {
|
|
177
|
+
this.isVisible = true
|
|
178
|
+
} else if (this.position === 'form' || this.position === 'workflowForm') {
|
|
179
|
+
this.isButtonVisible(
|
|
180
|
+
this.displayConditions,
|
|
181
|
+
this.tableName,
|
|
182
|
+
this.additionalParamMap
|
|
183
|
+
).then((result) => {
|
|
184
|
+
this.isVisible = result
|
|
185
|
+
})
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
methods: {
|
|
189
|
+
...Util,
|
|
190
|
+
fnProhibitToEdit(data) {
|
|
191
|
+
$emit(this, 'prohibi-edit', data)
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
emits: ['prohibi-edit'],
|
|
195
|
+
}
|
|
196
|
+
</script>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span>
|
|
3
|
+
<span
|
|
4
|
+
v-for="customComponent in buttonAreaCustomComponentArr"
|
|
5
|
+
:key="customComponent.code"
|
|
6
|
+
>
|
|
7
|
+
<component
|
|
8
|
+
:is="customComponent.code"
|
|
9
|
+
:ref="customComponent.code + '_Component'"
|
|
10
|
+
:refresh-list="getSystemRef"
|
|
11
|
+
@refresh-tab="refreshTab"
|
|
12
|
+
/>
|
|
13
|
+
</span>
|
|
14
|
+
</span>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
import { $on, $off, $once, $emit } from '../../utils/gogocodeTransfer'
|
|
19
|
+
import { getStoreInfo } from './util/common-util'
|
|
20
|
+
import eventBus from './util/util'
|
|
21
|
+
export default {
|
|
22
|
+
name: 'PageCustomComponent',
|
|
23
|
+
components: {},
|
|
24
|
+
props: {
|
|
25
|
+
// 页面编码
|
|
26
|
+
pageCode: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: null,
|
|
29
|
+
},
|
|
30
|
+
// 工具栏
|
|
31
|
+
buttonAreaCustomComponentArr: {
|
|
32
|
+
type: Array,
|
|
33
|
+
default: null,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
data() {
|
|
37
|
+
return {}
|
|
38
|
+
},
|
|
39
|
+
created() {},
|
|
40
|
+
mounted() {},
|
|
41
|
+
beforeUnmount() {},
|
|
42
|
+
methods: {
|
|
43
|
+
getSystemRef(refKey, operation) {
|
|
44
|
+
$emit(this, 'getSystemRef', refKey, operation)
|
|
45
|
+
},
|
|
46
|
+
// 刷新页签内容:列表数据或表单数据
|
|
47
|
+
refreshTab(tabCode, entity) {
|
|
48
|
+
if (tabCode === undefined || tabCode === null) {
|
|
49
|
+
tabCode = getStoreInfo(this.pageCode, '_activeTab')
|
|
50
|
+
}
|
|
51
|
+
$emit(eventBus, this.pageCode + '-refresh-tab', tabCode, entity)
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
emits: ['getSystemRef'],
|
|
55
|
+
}
|
|
56
|
+
</script>
|