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
package/index.html ADDED
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Vite + Vue</title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ <script type="module" src="/src/main.js"></script>
12
+ </body>
13
+ </html>
package/package.json CHANGED
@@ -1,19 +1,9 @@
1
1
  {
2
2
  "name": "super-pages",
3
3
  "private": false,
4
- "version": "0.0.10-up",
4
+ "version": "0.0.12-up",
5
5
  "type": "module",
6
- "main": "./lib/super-pages.umd.cjs",
7
- "files": [
8
- "lib"
9
- ],
10
- "module": "./lib/super-pages.js",
11
- "exports": {
12
- ".": {
13
- "import": "./lib/super-pages.js",
14
- "require": "./lib/super-pages.umd.cjs"
15
- }
16
- },
6
+ "main": "./lib/super-pages.js",
17
7
  "scripts": {
18
8
  "lib": "vite build",
19
9
  "preview": "vite preview"
@@ -0,0 +1,30 @@
1
+ // 本文件用来整合所有的组件,对外导出,形成一个完整的组件库
2
+ import SuperPage from './super-page'
3
+ import SuperPageDialog from './super-page-dialog'
4
+ // 后续可以import其他的组件
5
+
6
+ // 存储组件列表
7
+ const components = [SuperPage, SuperPageDialog]
8
+
9
+ // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
10
+ const install = function (Vue) {
11
+ // 判断是否安装
12
+ if (install.installed) return
13
+ // 遍历注册全局组件
14
+ // components.map(component => Vue.component(component.name, component))
15
+ components.forEach((component) => {
16
+ window.$vueApp.component(component.name, component)
17
+ })
18
+ }
19
+
20
+ // 判断是否是直接引入文件
21
+ if (typeof window !== 'undefined' && window.Vue) {
22
+ install(window.Vue)
23
+ }
24
+
25
+ export default {
26
+ // 导出的对象必须具有 install,才能被 Vue.use() 方法安装
27
+ install,
28
+ SuperPage,
29
+ SuperPageDialog,
30
+ }
@@ -0,0 +1,9 @@
1
+ // 本文件用来导出单个组件
2
+ import SuperPage from './src/super-page.vue'
3
+
4
+ // 每个组件都提供了install方法,这样就可以按需引入单个组件
5
+ SuperPage.install = function (Vue) {
6
+ window.$vueApp.component(SuperPage.name, SuperPage)
7
+ }
8
+
9
+ export default SuperPage
@@ -0,0 +1,294 @@
1
+ <template>
2
+ <div style="width: 100%">
3
+ <div v-if="myButtonGroups" :class="getFormButtonPosition()">
4
+ <span style="white-space: nowrap">
5
+ <template v-for="(button, buttonIndex) in myButtonGroups">
6
+ <el-dropdown
7
+ v-if="button.isGroup"
8
+ style="margin-right: 10px"
9
+ split-button
10
+ :size="
11
+ button.buttons && button.buttons.length > 0
12
+ ? button.buttons[0].size
13
+ : 'small'
14
+ "
15
+ @command="handleCommand"
16
+ >
17
+ {{ button.label }}
18
+ <template v-slot:dropdown>
19
+ <el-dropdown-menu>
20
+ <span
21
+ v-for="(buttonChild, index) in button.buttons"
22
+ :key="buttonChild.code + index"
23
+ >
24
+ <el-dropdown-item
25
+ v-permission="
26
+ permissionPrefix && permissionPrefix !== ''
27
+ ? permissionPrefix + buttonChild.code
28
+ : ''
29
+ "
30
+ :command="buttonChild.code"
31
+ :disabled="preventReclick"
32
+ >
33
+ {{
34
+ buttonChild.label
35
+ ? buttonChild.label
36
+ : buttonChild.code === 'search'
37
+ ? $t('superPageMessage.searchButtonLabel')
38
+ : ''
39
+ }}
40
+ </el-dropdown-item>
41
+ </span>
42
+ </el-dropdown-menu>
43
+ </template>
44
+ </el-dropdown>
45
+ <!--图表页面按钮区不显示统计和重置;列表页面时不显示查询按钮;-->
46
+ <my-button
47
+ v-else-if="
48
+ !position ||
49
+ (position === 'list' && button.code !== 'search') ||
50
+ (position === 'chart' &&
51
+ button.code !== 'reset' &&
52
+ button.code !== 'statistics') ||
53
+ (position !== 'chart' && position !== 'list')
54
+ "
55
+ :search-form-info="searchFormInfo"
56
+ :button="button"
57
+ :permission-prefix="permissionPrefix"
58
+ :workflow-button-component="workflowButtonComponent"
59
+ :position="position"
60
+ :is-task-input="isTaskInput"
61
+ :table-name="tableName"
62
+ :page-code="pageCode"
63
+ :work-name-color="workNameColor"
64
+ :button-groups="
65
+ button.code === 'workflowButton' ? buttonGroups : []
66
+ "
67
+ :get-form-data="getFormData"
68
+ :selections="selections"
69
+ :form-data-fun="formDataFun"
70
+ :get-system-ref="getSystemRef"
71
+ :form-button-position="formButtonPosition"
72
+ :disabled="disabled"
73
+ @refresh="refreshEmit"
74
+ @click="commonButtonClick"
75
+ @workflowClick="workflowButtonClick"
76
+ @prohibi-edit="fnProhibitToEdit"
77
+ @refreshFrom="refreshFrom"
78
+ />
79
+ </template>
80
+ </span>
81
+ <list-toolbar-page
82
+ v-if="listToolbarList"
83
+ :list-toolbar-list="listToolbarList"
84
+ :page-code="pageCode"
85
+ class="list_toolbar_page_style"
86
+ @searchGridData="searchGridData"
87
+ />
88
+ <page-custom-component
89
+ v-if="buttonAreaCustomComponentArr"
90
+ :button-area-custom-component-arr="buttonAreaCustomComponentArr"
91
+ :page-code="pageCode"
92
+ @getSystemRef="getSystemRef"
93
+ />
94
+ </div>
95
+ </div>
96
+ </template>
97
+
98
+ <script>
99
+ import { $on, $off, $once, $emit } from '../../utils/gogocodeTransfer'
100
+ import Util from './util/util'
101
+ import MyButton from './my-button'
102
+ import listToolbarPage from './list-toolbar-page'
103
+ import pageCustomComponent from './page-custom-component'
104
+ import { mapGetters } from 'vuex'
105
+ export default {
106
+ name: 'ButtonGroup',
107
+ components: {
108
+ MyButton,
109
+ listToolbarPage,
110
+ pageCustomComponent,
111
+ },
112
+ props: {
113
+ // 元素设置
114
+ buttonGroups: {
115
+ type: Array,
116
+ default: null,
117
+ },
118
+ // 按钮的资源编码前缀,例如:系统编码.页面编码.列表组件编码 或 系统编码.页面编码.表单组件编码
119
+ permissionPrefix: {
120
+ type: String,
121
+ default: null,
122
+ },
123
+ // 流程按钮组需要的信息
124
+ workflowButtonComponent: {
125
+ type: Object,
126
+ default: null,
127
+ },
128
+ // 按钮组所在位置,list列表或form表单内或chart
129
+ position: {
130
+ type: String,
131
+ default: null,
132
+ },
133
+ // 是否在任务办理页面(待办事宜中打开的),控制返回、关闭按钮
134
+ isTaskInput: {
135
+ type: Boolean,
136
+ default: false,
137
+ },
138
+ // 数据表名称
139
+ tableName: {
140
+ type: String,
141
+ default: null,
142
+ },
143
+ // 列表工具栏
144
+ listToolbarList: {
145
+ type: Array,
146
+ default: null,
147
+ },
148
+ // 按钮区自定义组件
149
+ buttonAreaCustomComponentArr: {
150
+ type: Array,
151
+ default: null,
152
+ },
153
+ // 页面编码
154
+ pageCode: {
155
+ type: String,
156
+ default: null,
157
+ },
158
+ // 保存页面数据的方法
159
+ getFormData: {
160
+ type: Function,
161
+ default: function () {},
162
+ },
163
+ // 列表选中的记录集合
164
+ selections: {
165
+ type: Array,
166
+ default: null,
167
+ },
168
+ // 表单对象方法
169
+ formDataFun: {
170
+ type: Function,
171
+ default: function () {},
172
+ },
173
+ searchFormInfo: {
174
+ type: Object,
175
+ default: () => {
176
+ return { data: {} }
177
+ },
178
+ },
179
+ formButtonPosition: {
180
+ type: String,
181
+ default: null,
182
+ },
183
+ // 是否是图表页面按钮
184
+ isChartView: {
185
+ type: Boolean,
186
+ default: false,
187
+ },
188
+ disabled: {
189
+ type: Boolean,
190
+ default: false,
191
+ },
192
+ // 工具栏是否靠右显示
193
+ toolbarRightShow: {
194
+ type: Boolean,
195
+ },
196
+ workNameColor: {
197
+ type: String,
198
+ },
199
+ },
200
+ data() {
201
+ return {
202
+ myButtonGroups: null,
203
+ }
204
+ },
205
+ computed: {
206
+ ...mapGetters(['preventReclick']),
207
+ },
208
+ created() {
209
+ if (this.position === 'workflowForm') {
210
+ for (let i = 0; i < this.buttonGroups.length; i++) {
211
+ const button = this.buttonGroups[i]
212
+ if (button.code === 'workflowButton') {
213
+ this.myButtonGroups = []
214
+ this.myButtonGroups[0] = button
215
+ break
216
+ }
217
+ }
218
+ } else {
219
+ if (this.buttonGroups && this.buttonGroups.length > 0) {
220
+ this.myButtonGroups = []
221
+ const groupButtonMap = {}
222
+ this.buttonGroups.forEach((button) => {
223
+ if (!button.groupName || button.groupName === '') {
224
+ // 未分组
225
+ this.myButtonGroups.push(button)
226
+ } else {
227
+ // 已分组
228
+ const groupNmae = button.groupName
229
+ if (groupButtonMap[groupNmae]) {
230
+ const groupButtons = groupButtonMap[groupNmae]
231
+ groupButtons.push(button)
232
+ } else {
233
+ const groupButtons = []
234
+ groupButtons.push(button)
235
+ groupButtonMap[groupNmae] = groupButtons
236
+ }
237
+ }
238
+ })
239
+ for (let key in groupButtonMap) {
240
+ const buttonGroup = {}
241
+ buttonGroup.isGroup = true
242
+ buttonGroup.label = key
243
+ buttonGroup.buttons = groupButtonMap[key]
244
+ this.myButtonGroups.push(buttonGroup)
245
+ }
246
+ }
247
+ }
248
+ },
249
+ methods: {
250
+ ...Util,
251
+ searchGridData(data, dataTypes, dataTypeObj, currentControlType) {
252
+ $emit(
253
+ this,
254
+ 'searchGridData',
255
+ data,
256
+ dataTypes,
257
+ dataTypeObj,
258
+ currentControlType
259
+ )
260
+ },
261
+ getSystemRef(refKey, operation) {
262
+ $emit(this, 'getSystemRef', refKey, operation)
263
+ },
264
+ handleCommand(buttonCode) {
265
+ if (buttonCode && buttonCode !== '') {
266
+ let index = this.buttonGroups.findIndex(function (item) {
267
+ return buttonCode === item.code
268
+ })
269
+ if (index != null && index !== undefined && index !== -1) {
270
+ this.commonButtonClick(this.buttonGroups[index])
271
+ }
272
+ }
273
+ },
274
+ fnProhibitToEdit(data) {
275
+ $emit(this, 'prohibi-edit', data)
276
+ },
277
+ getFormButtonPosition() {
278
+ if (this.position === 'chart') {
279
+ return 'operation-area-chart'
280
+ }
281
+ if (this.position === 'list' && this.toolbarRightShow) {
282
+ return 'operation-area toolbar_flex'
283
+ }
284
+ if (this.position === 'list') {
285
+ return 'operation-area'
286
+ }
287
+ return this.formButtonPosition === 'topLeft'
288
+ ? 'form-top-button'
289
+ : 'form-bottom-button'
290
+ },
291
+ },
292
+ emits: ['searchGridData', 'getSystemRef', 'prohibi-edit'],
293
+ }
294
+ </script>
@@ -0,0 +1,215 @@
1
+ <template>
2
+ <div>
3
+ <button-group
4
+ v-if="chartQuerySetting && chartQuerySetting.options.buttonGroup"
5
+ :button-groups="chartQuerySetting.options.buttonGroup"
6
+ :permission-prefix="permissionPrefix"
7
+ :additional-param-map="additionalParamMap"
8
+ :button-area-custom-component-arr="
9
+ chartQuerySetting.options.buttonAreaCustomComponentArr
10
+ "
11
+ position="chart"
12
+ :page-code="pageCode"
13
+ @click="clickListButton"
14
+ />
15
+ <super-chart
16
+ ref="superChart"
17
+ :code="chartViewCode"
18
+ :is-initial-query="isInitialQuery"
19
+ :is-custom="isNeedCustomStyle"
20
+ :options="chartOptions"
21
+ :query="query"
22
+ :is-tab-chart-view="isTabChartView"
23
+ />
24
+ </div>
25
+ </template>
26
+
27
+ <script>
28
+ import ButtonGroup from './button-group'
29
+ import eventBus from './util/eventBus'
30
+ import { getStoreInfo, setStoreInfo } from './util/common-util'
31
+ import * as Vue from 'vue'
32
+ import Util from './util/util'
33
+ import chartButtonEvent from './util/chartButtonEvent'
34
+ export default {
35
+ name: 'ChartViewPage',
36
+ components: {
37
+ ButtonGroup,
38
+ },
39
+ props: {
40
+ chartViewCode: {
41
+ type: String,
42
+ default: null,
43
+ },
44
+ // 页面编码
45
+ pageCode: {
46
+ type: String,
47
+ default: null,
48
+ },
49
+ // 是否需要立即查询
50
+ isInitialQuery: {
51
+ type: Boolean,
52
+ default: true,
53
+ },
54
+ // 是否需要设置自定义样式
55
+ isNeedCustomStyle: {
56
+ type: Boolean,
57
+ default: false,
58
+ },
59
+ // 是否需要导出
60
+ isNeedExport: {
61
+ type: Boolean,
62
+ default: true,
63
+ },
64
+ // 图表查询组件配置col
65
+ chartQuerySetting: {
66
+ type: Object,
67
+ default: null,
68
+ },
69
+ // 是否是tab图表页面
70
+ isTabChartView: {
71
+ type: Boolean,
72
+ default: false,
73
+ },
74
+ },
75
+ data() {
76
+ let additionalParamMap = getStoreInfo(this.pageCode, '_pathQuery')
77
+ console.log('图表页面---pathQuery=', additionalParamMap)
78
+ if (!additionalParamMap) {
79
+ additionalParamMap = {}
80
+ }
81
+ const additionalParamMapNew = getStoreInfo(
82
+ this.pageCode,
83
+ 'additionalParamMap'
84
+ )
85
+ console.log('图表页面---additionalParamMapNew=', additionalParamMapNew)
86
+ if (additionalParamMapNew) {
87
+ Object.assign(additionalParamMap, additionalParamMapNew)
88
+ }
89
+ let isPreview = getStoreInfo(this.pageCode, '_pagePreview')
90
+ if (isPreview === undefined) {
91
+ // 开发模式 或 预览时按钮不受控制
92
+ isPreview = false
93
+ }
94
+ let beanName
95
+ let componentCode
96
+ if (this.chartQuerySetting) {
97
+ beanName = this.chartQuerySetting.baseSetting.beanName
98
+ componentCode = this.chartQuerySetting.baseSetting.componentCode
99
+ }
100
+ const system = getStoreInfo(this.pageCode, '_systemInfo')
101
+ let permissionPrefix
102
+ if (system) {
103
+ permissionPrefix = system.code + '.' + this.pageCode + '.' + componentCode
104
+ }
105
+ return {
106
+ isPreview, // 是否是预览页面
107
+ query: null,
108
+ chartQueryCode: null, // 统计图对应的查询组件编码
109
+ additionalParamMap,
110
+ permissionPrefix,
111
+ beanName,
112
+ componentCode,
113
+ chartOptions: {
114
+ additionalParamMap,
115
+ },
116
+ }
117
+ },
118
+ created() {
119
+ const that = this
120
+ // 关闭弹框事件回调使用
121
+ eventBus.$on(this.pageCode + '_close-dialog-get-entity', () => {
122
+ $emit(eventBus, that.pageCode + '_close-super-dialog')
123
+ })
124
+ },
125
+ mounted() {
126
+ this.addRef()
127
+ this.getChartQueryCodeByChart(this.chartViewCode).then((queryCode) => {
128
+ const that = this
129
+ that.chartQueryCode = queryCode
130
+ // 响应点击统计按钮
131
+ eventBus.$on(
132
+ that.chartQueryCode + '-clickChartSearchButton',
133
+ (searchParam, isInitSearch) => {
134
+ console.log('准备传递数据', searchParam)
135
+ if (that.isPreview) {
136
+ // 预览时,统计按钮不生效
137
+ return
138
+ }
139
+ if (isInitSearch && this.isInitialQuery === false) {
140
+ // 当是初始化触发且禁止初始化时,不查询
141
+ return
142
+ }
143
+ // 表示是指定的查询组件点击的“统计”按钮
144
+ if (!searchParam) {
145
+ that.query = null
146
+ return
147
+ }
148
+ // 如果是Promise需要返回再赋值
149
+ if (
150
+ searchParam &&
151
+ Object.prototype.toString.call(searchParam) === '[object Promise]'
152
+ ) {
153
+ searchParam.then((res) => {
154
+ that.query = res
155
+ })
156
+ } else {
157
+ that.query = searchParam
158
+ }
159
+ }
160
+ )
161
+ // 响应点击重置按钮
162
+ eventBus.$on(
163
+ that.chartQueryCode + '-clickChartResetButton',
164
+ (searchParam) => {
165
+ if (that.isPreview) {
166
+ // 预览时,重置按钮不生效
167
+ return
168
+ }
169
+ // 表示是指定的查询组件点击的“重置”按钮
170
+ if (searchParam) {
171
+ that.query = searchParam
172
+ } else {
173
+ that.query = null
174
+ }
175
+ }
176
+ )
177
+ })
178
+ },
179
+ beforeUnmount() {
180
+ eventBus.$off(this.chartQueryCode + '-clickChartSearchButton')
181
+ eventBus.$off(this.chartQueryCode + '-clickChartResetButton')
182
+ eventBus.$off(this.pageCode + '_close-dialog-get-entity')
183
+ },
184
+ methods: {
185
+ ...Util,
186
+ ...chartButtonEvent,
187
+ getChartQueryCodeByChart(code) {
188
+ return this.$http.get(
189
+ window.$vueApp.config.globalProperties.baseAPI +
190
+ '/component/chart-query-codes/charts/' +
191
+ code
192
+ )
193
+ },
194
+ // 缓存添加ref对象,方便后期使用
195
+ addRef() {
196
+ if (this.isNeedExport) {
197
+ let chartRefList = getStoreInfo(this.pageCode, 'chartRefList')
198
+ if (!chartRefList) {
199
+ chartRefList = []
200
+ }
201
+ chartRefList.push({
202
+ code: this.chartViewCode,
203
+ refData: this.$refs.superChart,
204
+ })
205
+ setStoreInfo(this.pageCode, 'chartRefList', chartRefList)
206
+ }
207
+ },
208
+ // 导出报告
209
+ exportChart() {
210
+ $emit(this, 'export', this.beanName)
211
+ },
212
+ },
213
+ emits: ['export'],
214
+ }
215
+ </script>