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,89 @@
1
+ <template>
2
+ <span>
3
+ <dynamic-source-select
4
+ v-model:value="selectValue"
5
+ :base-props="{
6
+ multiple: toolbar.controlType === 'multiselect' ? true : false,
7
+ disabled: false,
8
+ }"
9
+ :analysis-area="1"
10
+ :entity="modelObj"
11
+ :full-width="false"
12
+ :clearable="false"
13
+ :size="toolbar.size ? toolbar.size : 'small'"
14
+ :options="{
15
+ dynamicDataSourceCode: dynamicDataSourceCode,
16
+ valueSetOptions: valueSetOptions,
17
+ isSql: true,
18
+ }"
19
+ :is-join-table="false"
20
+ @load-completed="loadCompleted"
21
+ @change="multiselectChange"
22
+ @set-value="setDynamicSourceSelectValue"
23
+ />
24
+ </span>
25
+ </template>
26
+
27
+ <script>
28
+ import { $on, $off, $once, $emit } from '../../utils/gogocodeTransfer'
29
+ export default {
30
+ name: 'ListToolbarDynamicSource',
31
+ components: {},
32
+ props: {
33
+ modelObj: {
34
+ type: Object,
35
+ default: null,
36
+ },
37
+ toolbar: {
38
+ type: Object,
39
+ default: null,
40
+ },
41
+ },
42
+ data() {
43
+ return {
44
+ dynamicDataSourceCode: null,
45
+ valueSetOptions: [],
46
+ dymLoadCompleted: false,
47
+ selectValue: null,
48
+ }
49
+ },
50
+ created() {
51
+ this.dynamicDataSourceCode = this.toolbar.dynamicDataSourceCode
52
+ this.valueSetOptions = this.toolbar.valueSetOptions
53
+ },
54
+ mounted() {},
55
+ beforeUnmount() {},
56
+ methods: {
57
+ multiselectChange() {
58
+ $emit(this, 'search-grid-data', this.toolbar.controlType)
59
+ },
60
+ setDynamicSourceSelectValue(selectValue) {
61
+ this.valueSetOptions.forEach((element) => {
62
+ this.modelObj[element.valueField] =
63
+ selectValue.selectedItem[element.columnName]
64
+ })
65
+ console.log(this.modelObj, '------------')
66
+ },
67
+ loadCompleted(dynamicDataSourceDto) {
68
+ if (
69
+ dynamicDataSourceDto.defaultSelect &&
70
+ dynamicDataSourceDto.options &&
71
+ dynamicDataSourceDto.options.length > 0
72
+ ) {
73
+ this.setDynamicSourceSelectValue({
74
+ selectedItem: dynamicDataSourceDto.options[0],
75
+ })
76
+ // this.modelObj[this.toolbar.propDbName] = dynamicDataSourceDto.options[0][dynamicDataSourceDto.valueAttribute]
77
+ this.selectValue =
78
+ dynamicDataSourceDto.options[0][dynamicDataSourceDto.valueAttribute]
79
+ $emit(this, 'dynamic-source-onload', dynamicDataSourceDto, this.toolbar)
80
+ } else {
81
+ this.modelObj[this.toolbar.propDbName] = null
82
+ $emit(this, 'dynamic-source-onload', dynamicDataSourceDto, this.toolbar)
83
+ }
84
+ this.dymLoadCompleted = true
85
+ },
86
+ },
87
+ emits: ['search-grid-data', 'dynamic-source-onload'],
88
+ }
89
+ </script>
@@ -0,0 +1,377 @@
1
+ <template>
2
+ <span>
3
+ <span
4
+ v-for="(toolbar, index) in listToolbarList"
5
+ :key="index"
6
+ style="display: inline-block; margin-bottom: 10px"
7
+ >
8
+ {{ toolbar.label }}
9
+ <template
10
+ v-if="
11
+ (toolbar.controlType === 'select' ||
12
+ toolbar.controlType === 'multipleSelect') &&
13
+ toolbar.dynamicDataSourceCode
14
+ "
15
+ >
16
+ <list-toolbar-dynamic-source
17
+ :toolbar="toolbar"
18
+ :additional-param-map="additionalParamMap"
19
+ :model-obj="modelObj"
20
+ @dynamic-source-onload="dynamicSourceOnload"
21
+ @search-grid-data="searchGridData"
22
+ />
23
+ </template>
24
+ <template v-else>
25
+ <el-select
26
+ v-if="toolbar.controlType === 'select'"
27
+ v-model="modelObj[toolbar.propDbName]"
28
+ :placeholder="toolbar.nullLabel"
29
+ :size="toolbar.size ? toolbar.size : small"
30
+ clearable
31
+ @change="searchGridData"
32
+ >
33
+ <el-option
34
+ v-for="item in toolbar.dynamicDataSourceCode
35
+ ? optionsList[toolbar.dynamicDataSourceCode]
36
+ : toolbar.optionGroupCode
37
+ ? optionsList[toolbar.optionGroupCode]
38
+ : null"
39
+ :key="item.value"
40
+ :label="item.label"
41
+ :value="item.value"
42
+ />
43
+ </el-select>
44
+ <el-select
45
+ v-if="toolbar.controlType === 'multipleSelect'"
46
+ v-model="modelObj[toolbar.propDbName]"
47
+ :placeholder="toolbar.nullLabel"
48
+ :size="toolbar.size ? toolbar.size : small"
49
+ collapse-tags
50
+ multiple
51
+ clearable
52
+ @change="searchGridData"
53
+ >
54
+ <el-option
55
+ v-for="item in toolbar.dynamicDataSourceCode
56
+ ? optionsList[toolbar.dynamicDataSourceCode]
57
+ : toolbar.optionGroupCode
58
+ ? optionsList[toolbar.optionGroupCode]
59
+ : null"
60
+ :key="item.value"
61
+ :label="item.label"
62
+ :value="item.value"
63
+ />
64
+ </el-select>
65
+ <el-radio-group
66
+ v-if="toolbar.controlType === 'radio'"
67
+ v-model="modelObj[toolbar.propDbName]"
68
+ :size="toolbar.size ? toolbar.size : small"
69
+ @change="searchGridData"
70
+ >
71
+ <el-radio
72
+ v-for="item in toolbar.dynamicDataSourceCode
73
+ ? optionsList[toolbar.dynamicDataSourceCode]
74
+ : toolbar.optionGroupCode
75
+ ? optionsList[toolbar.optionGroupCode]
76
+ : null"
77
+ :key="item.value"
78
+ :label="item.value"
79
+ >
80
+ {{ item.name == null ? item.label : item.name }}</el-radio
81
+ >
82
+ </el-radio-group>
83
+ <el-checkbox-group
84
+ v-if="toolbar.controlType === 'checkbox'"
85
+ v-model="modelObj[toolbar.propDbName]"
86
+ :size="toolbar.size ? toolbar.size : small"
87
+ @change="searchGridData"
88
+ >
89
+ <el-checkbox
90
+ v-for="item in toolbar.dynamicDataSourceCode
91
+ ? optionsList[toolbar.dynamicDataSourceCode]
92
+ : toolbar.optionGroupCode
93
+ ? optionsList[toolbar.optionGroupCode]
94
+ : null"
95
+ :key="item.value"
96
+ :label="item.value"
97
+ >
98
+ {{ item.name == null ? item.label : item.name }}
99
+ </el-checkbox>
100
+ </el-checkbox-group>
101
+ <el-date-picker
102
+ v-if="toolbar.controlType === 'year'"
103
+ v-model="modelObj[toolbar.propDbName]"
104
+ :size="toolbar.size ? toolbar.size : small"
105
+ :placeholder="toolbar.nullLabel"
106
+ type="year"
107
+ value-format="yyyy"
108
+ @change="searchGridData(toolbar.controlType)"
109
+ />
110
+ <el-date-picker
111
+ v-if="toolbar.controlType === 'month'"
112
+ v-model="modelObj[toolbar.propDbName]"
113
+ :size="toolbar.size ? toolbar.size : small"
114
+ :placeholder="toolbar.nullLabel"
115
+ type="month"
116
+ value-format="yyyy-MM"
117
+ @change="searchGridData(toolbar.controlType)"
118
+ />
119
+ </template>
120
+ </span>
121
+ </span>
122
+ </template>
123
+
124
+ <script>
125
+ import { $on, $off, $once, $emit } from '../../utils/gogocodeTransfer'
126
+
127
+ import Util from './util/util'
128
+ import { getStoreInfo } from './util/common-util'
129
+ import ListToolbarDynamicSource from './list-toolbar-dynamic-source'
130
+ export default {
131
+ name: 'ListToolbarPage',
132
+ components: {
133
+ ListToolbarDynamicSource,
134
+ },
135
+ props: {
136
+ // 工具栏
137
+ listToolbarList: {
138
+ type: Array,
139
+ default: null,
140
+ },
141
+ // 页面编码
142
+ pageCode: {
143
+ type: String,
144
+ default: null,
145
+ },
146
+ },
147
+ data() {
148
+ return {
149
+ modelObj: {},
150
+ modelObjType: {},
151
+ optionsList: {},
152
+ additionalParamMap: null,
153
+ dataTypeObj: {},
154
+ allData: {},
155
+ dynamicDataSources: {},
156
+ modelDynamicMapping: {},
157
+ }
158
+ },
159
+ created() {
160
+ const additionalParamMap = getStoreInfo(this.pageCode, 'additionalParamMap')
161
+ if (additionalParamMap) {
162
+ this.additionalParamMap = additionalParamMap
163
+ }
164
+ this.analysisListToolbarList()
165
+ },
166
+ mounted() {},
167
+ beforeUnmount() {},
168
+ methods: {
169
+ ...Util,
170
+ optionListResult(toolbar) {
171
+ return toolbar.dynamicDataSourceCode
172
+ ? this.optionsList[toolbar.dynamicDataSourceCode]
173
+ : toolbar.optionGroupCode
174
+ ? this.optionsList[toolbar.optionGroupCode]
175
+ : null
176
+ },
177
+ // 解析listToolbarList
178
+ analysisListToolbarList() {
179
+ if (this.listToolbarList && this.listToolbarList.length > 0) {
180
+ // 将每一条合并起来封装为一个对象 {prop}
181
+ this.toolbarListToObj()
182
+ // 将数据来源解析后封装
183
+ this.toolbarListOptions()
184
+ // 解析默认值
185
+ this.analysisDefaultValue()
186
+ }
187
+ },
188
+ // 将每一条合并起来封装为一个对象 {prop}
189
+ toolbarListToObj() {
190
+ for (var i = 0; i < this.listToolbarList.length; i++) {
191
+ const item = this.listToolbarList[i]
192
+ if (item && item.propDbName) {
193
+ if (!this.modelObj[item.propDbName]) {
194
+ this.modelObj[item.propDbName] = null
195
+ if (
196
+ item.controlType &&
197
+ (item.controlType === 'year' || item.controlType === 'month')
198
+ ) {
199
+ this.modelObjType[item.propDbName + '~~' + item.controlType] =
200
+ item.controlType
201
+ } else {
202
+ this.modelObjType[item.propDbName] = item.controlType
203
+ }
204
+ this.dataTypeObj[item.propDbName] = item.dataType
205
+ }
206
+ }
207
+ }
208
+ },
209
+ // 将数据来源解析后封装
210
+ toolbarListOptions() {
211
+ for (var i = 0; i < this.listToolbarList.length; i++) {
212
+ const item = this.listToolbarList[i]
213
+ if (item && item.propDbName) {
214
+ if (item.dynamicDataSourceCode) {
215
+ this.dynamicDataSources[item.dynamicDataSourceCode] = {
216
+ mounted: false,
217
+ }
218
+ this.modelDynamicMapping[item.propDbName] =
219
+ item.dynamicDataSourceCode
220
+ }
221
+ if (item.optionGroupCode) {
222
+ this.dynamicDataSources[item.optionGroupCode] = { mounted: false }
223
+ this.getOptionGroupOptions(item.optionGroupCode).then((data) => {
224
+ const defaultSelected = data.find(
225
+ (element) => element.selected === true
226
+ )
227
+ this.dynamicDataSources[item.optionGroupCode].mounted = true
228
+ if (defaultSelected) {
229
+ this.modelObj[item.propDbName] = defaultSelected.value
230
+ this.dynamicDataSources[
231
+ item.optionGroupCode
232
+ ].dynamicDataSourceDto = { defaultSelect: true }
233
+ this.dynamicSourceAllCompleted()
234
+ }
235
+ this.optionsList[item.optionGroupCode] = data
236
+ })
237
+ }
238
+ }
239
+ }
240
+ },
241
+ // 解析默认值
242
+ analysisDefaultValue() {
243
+ const defaultValueList = []
244
+ for (var i = 0; i < this.listToolbarList.length; i++) {
245
+ const item = this.listToolbarList[i]
246
+ if (item && item.propDbName) {
247
+ if (item.propValue) {
248
+ defaultValueList.push(item.propValue)
249
+ } else {
250
+ defaultValueList.push(null)
251
+ }
252
+ } else {
253
+ defaultValueList.push(null)
254
+ }
255
+ }
256
+ // 发送请求
257
+ const map = {
258
+ additionalParamMap: this.additionalParamMap,
259
+ values: defaultValueList,
260
+ }
261
+ this.analysisStandardValues(map).then((data) => {
262
+ if (data && data.returnValues) {
263
+ if (data.returnValues.length === 1 && data.returnValues[0] === null) {
264
+ return
265
+ }
266
+ for (var k = 0; k < this.listToolbarList.length; k++) {
267
+ const item = this.listToolbarList[k]
268
+ if (item && item.propDbName) {
269
+ const value = data.returnValues[k]
270
+ if (
271
+ item.controlType === 'multipleSelect' ||
272
+ item.controlType === 'checkbox'
273
+ ) {
274
+ this.modelObj[item.propDbName] = []
275
+ if (value !== undefined && value !== null) {
276
+ if (typeof value === 'string') {
277
+ this.modelObj[item.propDbName] = value.split(',')
278
+ } else {
279
+ this.modelObj[item.propDbName] = value
280
+ }
281
+ }
282
+ } else {
283
+ if (value !== undefined && value !== null) {
284
+ if (item.controlType === 'year') {
285
+ const valArr = value.split('-')
286
+ let year = null
287
+ if (valArr.length >= 1) {
288
+ year = valArr[0]
289
+ }
290
+ this.modelObj[item.propDbName] = year
291
+ } else if (item.controlType === 'month') {
292
+ const valArr = value.split('-')
293
+ let month = null
294
+ if (valArr.length >= 2) {
295
+ month = valArr[0] + '-' + valArr[1]
296
+ }
297
+ this.modelObj[item.propDbName] = month
298
+ } else {
299
+ this.modelObj[item.propDbName] = value
300
+ }
301
+ }
302
+ }
303
+ }
304
+ }
305
+ this.dynamicSourceAllCompleted()
306
+ }
307
+ })
308
+ },
309
+ // 刷新列表数据
310
+ searchGridData(contorlType) {
311
+ console.log(this.modelObj)
312
+ this.handleDymSelectEmptyValue()
313
+ $emit(
314
+ this,
315
+ 'searchGridData',
316
+ this.modelObj,
317
+ this.modelObjType,
318
+ this.dataTypeObj,
319
+ contorlType
320
+ )
321
+ },
322
+ dynamicSourceOnload(dynamicDataSourceDto) {
323
+ this.dynamicDataSources[dynamicDataSourceDto.code].mounted = true
324
+ this.dynamicDataSources[dynamicDataSourceDto.code].dynamicDataSourceDto =
325
+ dynamicDataSourceDto
326
+ this.dynamicSourceAllCompleted()
327
+ },
328
+ dynamicSourceAllCompleted() {
329
+ const values = Object.values(this.dynamicDataSources)
330
+ if (values.length === 0) {
331
+ this.searchGridData()
332
+ } else {
333
+ const result = Object.values(this.dynamicDataSources).filter(
334
+ (dym) => dym.mounted === false
335
+ )
336
+ if (result.length === 0) {
337
+ const keys = Object.keys(this.dynamicDataSources)
338
+ for (let i = 0; i < keys.length; i++) {
339
+ if (
340
+ this.dynamicDataSources[keys[i]].dynamicDataSourceDto
341
+ .defaultSelect
342
+ ) {
343
+ this.searchGridData()
344
+ break
345
+ }
346
+ }
347
+ }
348
+ }
349
+ },
350
+ handleDymSelectEmptyValue() {
351
+ // 处理当动态数据源工具栏选项选择的是空值时,传递给后台所有的下拉值
352
+ if (this.modelDynamicMapping) {
353
+ const keys = Object.keys(this.modelDynamicMapping)
354
+ keys.forEach((key) => {
355
+ if (
356
+ !this.modelObj[key] &&
357
+ this.dynamicDataSources[this.modelDynamicMapping[key]]
358
+ .dynamicDataSourceDto.defaultSelect
359
+ ) {
360
+ const ddsd =
361
+ this.dynamicDataSources[this.modelDynamicMapping[key]]
362
+ .dynamicDataSourceDto
363
+ const valArr = []
364
+ ddsd.options.forEach((option) => {
365
+ if (option[ddsd.valueAttribute]) {
366
+ valArr.push(option[ddsd.valueAttribute])
367
+ }
368
+ })
369
+ this.modelObj[key] = valArr
370
+ }
371
+ })
372
+ }
373
+ },
374
+ },
375
+ emits: ['searchGridData'],
376
+ }
377
+ </script>