super-pages 0.0.10-up → 0.0.12-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.
Files changed (52) hide show
  1. package/index.html +13 -0
  2. package/package.json +2 -12
  3. package/packages/index.js +30 -0
  4. package/packages/super-page/index.js +9 -0
  5. package/packages/super-page/src/button-group.vue +294 -0
  6. package/packages/super-page/src/chart-page.vue +215 -0
  7. package/packages/super-page/src/chart-query-page.vue +163 -0
  8. package/packages/super-page/src/common-form-page.vue +594 -0
  9. package/packages/super-page/src/export-form-report-dialog.vue +145 -0
  10. package/packages/super-page/src/form-head.vue +74 -0
  11. package/packages/super-page/src/form-page.vue +107 -0
  12. package/packages/super-page/src/group-tag.vue +21 -0
  13. package/packages/super-page/src/list-page.vue +1453 -0
  14. package/packages/super-page/src/list-toolbar-dynamic-source.vue +89 -0
  15. package/packages/super-page/src/list-toolbar-page.vue +377 -0
  16. package/packages/super-page/src/my-button-base.vue +438 -0
  17. package/packages/super-page/src/my-button.vue +196 -0
  18. package/packages/super-page/src/page-custom-component.vue +56 -0
  19. package/packages/super-page/src/remove-signer-dialog.vue +103 -0
  20. package/packages/super-page/src/sub-tab-page.vue +79 -0
  21. package/packages/super-page/src/super-page-component.vue +86 -0
  22. package/packages/super-page/src/super-page.vue +162 -0
  23. package/packages/super-page/src/tab-page.vue +154 -0
  24. package/packages/super-page/src/task-informition-dialog.vue +82 -0
  25. package/packages/super-page/src/util/ListButtonEvent.js +896 -0
  26. package/packages/super-page/src/util/api.js +37 -0
  27. package/packages/super-page/src/util/callEvents.js +62 -0
  28. package/packages/super-page/src/util/chartButtonEvent.js +60 -0
  29. package/packages/super-page/src/util/common-util.js +102 -0
  30. package/packages/super-page/src/util/commonButtonEvent.js +70 -0
  31. package/packages/super-page/src/util/eventBus.js +8 -0
  32. package/packages/super-page/src/util/formButtonEvent.js +509 -0
  33. package/packages/super-page/src/util/store.js +3 -0
  34. package/packages/super-page/src/util/super-page.js +29 -0
  35. package/packages/super-page/src/util/util.js +1491 -0
  36. package/packages/super-page/src/util/workflowButtonEvent.js +1729 -0
  37. package/packages/super-page/src/widget-col-page.vue +339 -0
  38. package/packages/super-page/src/widget-page.vue +703 -0
  39. package/packages/super-page/src/widget-sub-tab-pane-page.vue +115 -0
  40. package/packages/super-page/src/widget-tab-pane-page.vue +135 -0
  41. package/packages/super-page/src/workflow-button-group.vue +561 -0
  42. package/packages/super-page/src/workflow-form-page.vue +1310 -0
  43. package/packages/super-page-dialog/index.js +9 -0
  44. package/packages/super-page-dialog/src/super-page-dialog.vue +200 -0
  45. package/packages/utils/gogocodeTransfer.js +59 -0
  46. package/public/vite.svg +1 -0
  47. package/src/i18n/i18n.js +16 -0
  48. package/src/i18n/langs/cn.js +65 -0
  49. package/src/i18n/langs/en.js +68 -0
  50. package/src/styles/index.scss +4 -0
  51. package/src/utils/common-util.js +9 -0
  52. package/vite.config.js +36 -0
@@ -0,0 +1,339 @@
1
+ <template>
2
+ <div :style="colStyle">
3
+ <el-button
4
+ v-if="col.baseSetting.type === 'button'"
5
+ v-permission="permission"
6
+ :disabled="preventReclick"
7
+ :size="col.options.buttonSize ? col.options.buttonSize : 'small'"
8
+ :type="col.options.buttonType ? col.options.buttonType : ''"
9
+ :icon="col.options.buttonIcon"
10
+ :plain="col.options.buttonPlain ? col.options.buttonPlain : false"
11
+ :round="col.options.buttonRound ? col.options.buttonRound : false"
12
+ :circle="col.options.buttonCircle ? col.options.buttonCircle : false"
13
+ @click="clickButtonEvent(col, system)"
14
+ >
15
+ {{ $t(col.baseSetting.label) }}
16
+ </el-button>
17
+ <list-page
18
+ v-else-if="col.baseSetting.type === 'listView'"
19
+ :col-setting="col"
20
+ :page-code="pageCode"
21
+ :tab-code="tabCode"
22
+ @update-value="updateValues"
23
+ @prohibi-edit="fnProhibitToEdit"
24
+ />
25
+ <form-page
26
+ v-else-if="col.baseSetting.type === 'formView'"
27
+ ref="formView"
28
+ :col-setting="col"
29
+ :data-id="dataId"
30
+ :task-id="taskId"
31
+ :page-code="pageCode"
32
+ :tab-code="tabCode"
33
+ @update-value="updateSetValues"
34
+ @prohibi-edit="fnProhibitToEdit"
35
+ />
36
+ <chart-query-page
37
+ v-else-if="col.baseSetting.type === 'chartQuery'"
38
+ :query-code="col.baseSetting.modelCode"
39
+ :is-initial-query="col.baseSetting.isInitialQuery"
40
+ :col-setting="col"
41
+ :page-code="pageCode"
42
+ @export="exportReport"
43
+ @prohibi-edit="fnProhibitToEdit"
44
+ />
45
+ <chart-view-page
46
+ v-else-if="col.baseSetting.type === 'chartView'"
47
+ :chart-view-code="col.baseSetting.modelCode"
48
+ :is-initial-query="col.baseSetting.isInitialQuery"
49
+ :is-need-custom-style="col.baseSetting.isNeedCustomStyle"
50
+ :is-need-export="col.baseSetting.isNeedExport"
51
+ :col-setting="col"
52
+ :chart-query-setting="chartQuerySetting"
53
+ :page-code="pageCode"
54
+ :is-tab-chart-view="isTabChartView"
55
+ @export="exportReport"
56
+ @prohibi-edit="fnProhibitToEdit"
57
+ />
58
+ <component
59
+ :is="col.baseSetting.customComponentName"
60
+ v-else-if="col.baseSetting.type === 'customComponent'"
61
+ :ref="col.baseSetting.customComponentName + '_CustomComponent'"
62
+ @prohibi-edit="fnProhibitToEdit"
63
+ @refresh-tab="refreshTab"
64
+ />
65
+ <template v-else-if="isWorkflowHistory">
66
+ <template v-if="workflowId && workflowId !== null">
67
+ <workflow-history-list
68
+ v-if="col.baseSetting.type === 'workflowHistoryList'"
69
+ ref="historyList"
70
+ :workflow-id="workflowId"
71
+ :max-height="col.options.height"
72
+ />
73
+ <workflow-history
74
+ v-else-if="col.baseSetting.type === 'workflowHistoryGraph'"
75
+ :id="workflowId"
76
+ ref="historyGraph"
77
+ />
78
+ </template>
79
+ <template v-else>
80
+ {{ $t('superPage.unSubmitProcess') }}
81
+ </template>
82
+ </template>
83
+ <div v-else-if="col.baseSetting.type === 'label'">
84
+ {{ col.baseSetting.label }}
85
+ </div>
86
+ <div
87
+ v-else-if="
88
+ col.baseSetting.type === 'placeholder' ||
89
+ col.baseSetting.type === 'enter'
90
+ "
91
+ />
92
+ <group-tag
93
+ v-else-if="col.baseSetting.type === 'groupTag'"
94
+ :label="col.baseSetting.label"
95
+ />
96
+ </div>
97
+ </template>
98
+
99
+ <script>
100
+ import { $on, $off, $once, $emit } from '../../utils/gogocodeTransfer'
101
+ import { mapGetters } from 'vuex'
102
+ import ListPage from './list-page'
103
+ import FormPage from './form-page'
104
+ import ChartViewPage from './chart-page'
105
+ import ChartQueryPage from './chart-query-page'
106
+ import GroupTag from './group-tag'
107
+ import Util from './util/util'
108
+ import commonButtonEvents from './util/commonButtonEvent'
109
+ import eventBus from './util/eventBus'
110
+ import { getStoreInfo } from './util/common-util'
111
+ export default {
112
+ name: 'WidgetColPage',
113
+ components: {
114
+ ListPage,
115
+ FormPage,
116
+ ChartViewPage,
117
+ ChartQueryPage,
118
+ GroupTag,
119
+ },
120
+ props: {
121
+ // 单元格配置
122
+ col: {
123
+ type: Object,
124
+ default: null,
125
+ },
126
+ // 表单页面修改记录时记录id
127
+ dataId: {
128
+ type: Number,
129
+ default: null,
130
+ },
131
+ // 流程表单页面办理任务时任务id
132
+ taskId: {
133
+ type: Number,
134
+ default: null,
135
+ },
136
+ // 流程实例id
137
+ workflowId: {
138
+ type: Number,
139
+ default: null,
140
+ },
141
+ // 页面编码
142
+ pageCode: {
143
+ type: String,
144
+ default: null,
145
+ },
146
+ // 设置字段权限
147
+ fieldPermissions: {
148
+ type: Object,
149
+ default: null,
150
+ },
151
+ // 页签编码
152
+ tabCode: {
153
+ type: String,
154
+ default: null,
155
+ },
156
+ // 图表查询组件配置col
157
+ chartQuerySetting: {
158
+ type: Object,
159
+ default: null,
160
+ },
161
+ },
162
+ data() {
163
+ let isWorkflowHistory = false
164
+ if (
165
+ this.col.baseSetting.type === 'workflowHistoryGraph' ||
166
+ this.col.baseSetting.type === 'workflowHistoryList'
167
+ ) {
168
+ isWorkflowHistory = true
169
+ }
170
+ const system = getStoreInfo(this.pageCode, '_systemInfo')
171
+ const permissionPrefix = getStoreInfo(this.pageCode, '_colPermissionPrefix')
172
+
173
+ let permission = permissionPrefix + '.' + this.col.baseSetting.componentCode
174
+ if (isWorkflowHistory === true) {
175
+ permission = permissionPrefix + '.workflowHistory'
176
+ }
177
+ const isDevMode = getStoreInfo(this.pageCode, '_pageDevMode')
178
+ const isPreview = getStoreInfo(this.pageCode, '_pagePreview')
179
+ if (
180
+ (isDevMode && isDevMode === true) ||
181
+ (isPreview && isPreview === true)
182
+ ) {
183
+ // 开发模式 或 预览时按钮不受控制
184
+ permission = 'true'
185
+ }
186
+ console.log('tab.code==', this.tabCode)
187
+ let isTabChartView = false
188
+ if (this.tabCode) {
189
+ isTabChartView = true
190
+ }
191
+ return {
192
+ isWorkflowHistory, // 是否是流转历史组件
193
+ colStyle: this.getColStyle(this.col),
194
+ system,
195
+ permission,
196
+ permissionPrefix,
197
+ additionalParamMap: null, // 解析好的附加参数
198
+ isTabChartView, // 是否是图表tab页签页面,如果是,图表显示时不需要使用card显示。
199
+ }
200
+ },
201
+ computed: {
202
+ ...mapGetters(['preventReclick']),
203
+ },
204
+ watch: {
205
+ fieldPermissions: {
206
+ deep: true,
207
+ handler(fieldPermissions) {
208
+ if (fieldPermissions) {
209
+ this.fieldPermissions = fieldPermissions
210
+ this.fnProhibitToFormViewEdit(this.fieldPermissions)
211
+ }
212
+ },
213
+ },
214
+ },
215
+ created() {
216
+ const additionalParamMap = getStoreInfo(this.pageCode, 'additionalParamMap')
217
+ if (additionalParamMap) {
218
+ this.additionalParamMap = additionalParamMap
219
+ }
220
+ },
221
+ mounted() {
222
+ const that = this
223
+ // 切换页签时刷新流转历史
224
+ $on(eventBus, 'refreshHistory', () => {
225
+ // console.log('-refreshHistory--')
226
+ if (that.$refs.historyList) {
227
+ that.$refs.historyList.refresh()
228
+ }
229
+ if (that.$refs.historyGraph) {
230
+ that.$refs.historyGraph.refresh()
231
+ }
232
+ })
233
+ },
234
+ beforeUnmount() {
235
+ $off(eventBus, 'refreshHistory')
236
+ console.log('-refreshHistory-off')
237
+ },
238
+ methods: {
239
+ ...Util,
240
+ ...commonButtonEvents,
241
+ fnProhibitToEdit(entity) {
242
+ if (this.col.baseSetting.type === 'formView') {
243
+ this.fnProhibitToFormViewEdit(entity)
244
+ } else {
245
+ $emit(this, 'prohibi-edit', entity)
246
+ }
247
+ },
248
+ fnProhibitToFormViewEdit(entity) {
249
+ console.log('this.$refs.formView', this.$refs.formView)
250
+ if (this.$refs.formView && this.$refs.formView.fnProhibitToEdit) {
251
+ this.$refs.formView.fnProhibitToEdit(entity)
252
+ }
253
+ },
254
+ updateValues(soureModel, sourceTableName, targetRowIndex) {
255
+ console.log(
256
+ 'update-value---',
257
+ soureModel,
258
+ sourceTableName,
259
+ targetRowIndex
260
+ )
261
+ $emit(this, 'update-value', soureModel, sourceTableName, targetRowIndex)
262
+ },
263
+ updateSetValues(soureModel, sourceTableName, targetRowIndex) {
264
+ $emit(this, 'update-value', soureModel, sourceTableName, targetRowIndex)
265
+ },
266
+ getColStyle(myCol) {
267
+ let colStyle = {}
268
+ if (myCol.options) {
269
+ if (myCol.options.customStyle) {
270
+ colStyle = myCol.options.customStyle
271
+ } else {
272
+ colStyle = {}
273
+ const width = myCol.options.width
274
+ if (width) {
275
+ if (width.indexOf('px') > 0) {
276
+ colStyle.width = width
277
+ } else {
278
+ colStyle.width = width + 'px'
279
+ }
280
+ }
281
+ const height = myCol.options.height
282
+ if (height) {
283
+ if (height.indexOf('px') > 0) {
284
+ colStyle.height = height
285
+ } else {
286
+ colStyle.height = height + 'px'
287
+ }
288
+ }
289
+ if (myCol.options.padding) {
290
+ colStyle.padding = myCol.options.padding
291
+ }
292
+ if (myCol.options.margin) {
293
+ colStyle.margin = myCol.options.margin
294
+ }
295
+ if (myCol.options.position) {
296
+ colStyle.position = myCol.options.position
297
+ }
298
+ if (
299
+ colStyle.position &&
300
+ colStyle.position !== '' &&
301
+ (colStyle.position === 'absolute' ||
302
+ colStyle.position === 'fixed' ||
303
+ colStyle.position === 'relative')
304
+ ) {
305
+ if (myCol.options.positionTop) {
306
+ colStyle.top = myCol.options.positionTop
307
+ }
308
+ if (myCol.options.positionRight) {
309
+ colStyle.right = myCol.options.positionRight
310
+ }
311
+ if (myCol.options.positionBottom) {
312
+ colStyle.bottom = myCol.options.positionBottom
313
+ }
314
+ if (myCol.options.positionLeft) {
315
+ colStyle.left = myCol.options.positionLeft
316
+ }
317
+ }
318
+ if (myCol.options.backgroundColor) {
319
+ colStyle['background-color'] = myCol.options.backgroundColor
320
+ }
321
+ if (myCol.options.fontSize) {
322
+ colStyle['font-size'] = myCol.options.fontSize
323
+ }
324
+ if (myCol.options.fontColor) {
325
+ colStyle.color = myCol.options.fontColor
326
+ }
327
+ }
328
+ }
329
+ return colStyle
330
+ },
331
+ // chartQuery组件,导出报告
332
+ exportReport(beanName) {
333
+ // 向父页面传递
334
+ $emit(this, 'export', beanName)
335
+ },
336
+ },
337
+ emits: ['prohibi-edit', 'update-value', 'export'],
338
+ }
339
+ </script>