super-pages 0.8.16-dw → 0.8.17-dw

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