super-pages 0.0.6-up → 0.0.8-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/lib/super-pages.js +1 -1
- package/lib/super-pages.umd.cjs +1 -1
- package/package.json +12 -2
- package/index.html +0 -13
- package/packages/index.js +0 -30
- package/packages/super-page/index.js +0 -9
- package/packages/super-page/src/button-group.vue +0 -294
- package/packages/super-page/src/chart-page.vue +0 -215
- package/packages/super-page/src/chart-query-page.vue +0 -163
- package/packages/super-page/src/common-form-page.vue +0 -594
- package/packages/super-page/src/export-form-report-dialog.vue +0 -145
- package/packages/super-page/src/form-head.vue +0 -74
- package/packages/super-page/src/form-page.vue +0 -107
- package/packages/super-page/src/group-tag.vue +0 -21
- package/packages/super-page/src/list-page.vue +0 -1453
- package/packages/super-page/src/list-toolbar-dynamic-source.vue +0 -89
- package/packages/super-page/src/list-toolbar-page.vue +0 -377
- package/packages/super-page/src/my-button-base.vue +0 -438
- package/packages/super-page/src/my-button.vue +0 -196
- package/packages/super-page/src/page-custom-component.vue +0 -56
- package/packages/super-page/src/remove-signer-dialog.vue +0 -103
- package/packages/super-page/src/sub-tab-page.vue +0 -79
- package/packages/super-page/src/super-page-component.vue +0 -86
- package/packages/super-page/src/super-page.vue +0 -162
- package/packages/super-page/src/tab-page.vue +0 -154
- package/packages/super-page/src/task-informition-dialog.vue +0 -82
- package/packages/super-page/src/util/ListButtonEvent.js +0 -896
- package/packages/super-page/src/util/api.js +0 -37
- package/packages/super-page/src/util/callEvents.js +0 -62
- package/packages/super-page/src/util/chartButtonEvent.js +0 -60
- package/packages/super-page/src/util/common-util.js +0 -102
- package/packages/super-page/src/util/commonButtonEvent.js +0 -70
- package/packages/super-page/src/util/eventBus.js +0 -8
- package/packages/super-page/src/util/formButtonEvent.js +0 -509
- package/packages/super-page/src/util/store.js +0 -3
- package/packages/super-page/src/util/super-page.js +0 -29
- package/packages/super-page/src/util/util.js +0 -1491
- package/packages/super-page/src/util/workflowButtonEvent.js +0 -1729
- package/packages/super-page/src/widget-col-page.vue +0 -339
- package/packages/super-page/src/widget-page.vue +0 -703
- package/packages/super-page/src/widget-sub-tab-pane-page.vue +0 -115
- package/packages/super-page/src/widget-tab-pane-page.vue +0 -135
- package/packages/super-page/src/workflow-button-group.vue +0 -561
- package/packages/super-page/src/workflow-form-page.vue +0 -1310
- package/packages/super-page-dialog/index.js +0 -9
- package/packages/super-page-dialog/src/super-page-dialog.vue +0 -200
- package/packages/utils/gogocodeTransfer.js +0 -59
- package/public/vite.svg +0 -1
- package/src/i18n/i18n.js +0 -16
- package/src/i18n/langs/cn.js +0 -65
- package/src/i18n/langs/en.js +0 -68
- package/src/styles/index.scss +0 -4
- package/src/utils/common-util.js +0 -9
- package/vite.config.js +0 -36
|
@@ -1,294 +0,0 @@
|
|
|
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>
|
|
@@ -1,215 +0,0 @@
|
|
|
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>
|
|
@@ -1,163 +0,0 @@
|
|
|
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
|
-
:default-open="defaultOpen"
|
|
18
|
-
:is-page-info="isPageInfo"
|
|
19
|
-
:options="options"
|
|
20
|
-
@search="search"
|
|
21
|
-
@initSearch="initSearch"
|
|
22
|
-
@reset="resetForm"
|
|
23
|
-
@export="exportChart"
|
|
24
|
-
/>
|
|
25
|
-
</div>
|
|
26
|
-
</template>
|
|
27
|
-
|
|
28
|
-
<script>
|
|
29
|
-
import eventBus from './util/eventBus'
|
|
30
|
-
import { getStoreInfo } from './util/common-util'
|
|
31
|
-
import Util from './util/util'
|
|
32
|
-
export default {
|
|
33
|
-
name: 'ChartQueryPage',
|
|
34
|
-
props: {
|
|
35
|
-
queryCode: {
|
|
36
|
-
type: String,
|
|
37
|
-
default: null,
|
|
38
|
-
},
|
|
39
|
-
// 页面编码
|
|
40
|
-
pageCode: {
|
|
41
|
-
type: String,
|
|
42
|
-
default: null,
|
|
43
|
-
},
|
|
44
|
-
colSetting: {
|
|
45
|
-
type: Object,
|
|
46
|
-
default: null,
|
|
47
|
-
},
|
|
48
|
-
// 是否需要立即查询
|
|
49
|
-
isInitialQuery: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
default: false,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
// isPageInfo 是否预览,页面管理注入
|
|
55
|
-
inject: {
|
|
56
|
-
isPageInfo: { value: 'isPageInfo', default: false },
|
|
57
|
-
},
|
|
58
|
-
data() {
|
|
59
|
-
let beanName
|
|
60
|
-
if (this.chartQuerySetting) {
|
|
61
|
-
beanName = this.chartQuerySetting.baseSetting.beanName
|
|
62
|
-
}
|
|
63
|
-
const options = {}
|
|
64
|
-
options.formEvents = this.packageFormEvents()
|
|
65
|
-
options.chartEvents = this.packageChartEvents()
|
|
66
|
-
return {
|
|
67
|
-
additionalParamMap: null, // 跳转页面的附加参数
|
|
68
|
-
beanName,
|
|
69
|
-
options,
|
|
70
|
-
defaultOpen: false,
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
created() {
|
|
74
|
-
let additionalParamMap = getStoreInfo(this.pageCode, '_pathQuery')
|
|
75
|
-
console.log('图表页面---pathQuery=', additionalParamMap)
|
|
76
|
-
if (!additionalParamMap) {
|
|
77
|
-
additionalParamMap = {}
|
|
78
|
-
}
|
|
79
|
-
const additionalParamMapNew = getStoreInfo(
|
|
80
|
-
this.pageCode,
|
|
81
|
-
'additionalParamMap'
|
|
82
|
-
)
|
|
83
|
-
console.log('图表页面---additionalParamMapNew=', additionalParamMapNew)
|
|
84
|
-
if (additionalParamMapNew) {
|
|
85
|
-
Object.assign(additionalParamMap, additionalParamMapNew)
|
|
86
|
-
}
|
|
87
|
-
this.additionalParamMap = additionalParamMap
|
|
88
|
-
this.options.additionalParamMap = additionalParamMap
|
|
89
|
-
},
|
|
90
|
-
mounted() {
|
|
91
|
-
const that = this
|
|
92
|
-
// 刷新指定页签的图表数据
|
|
93
|
-
eventBus.$on(that.pageCode + '-refresh-tab', (tabCode) => {
|
|
94
|
-
const refName =
|
|
95
|
-
'chartQueryRef' + that.colSetting.baseSetting.componentCode
|
|
96
|
-
if (that.$refs[refName]) {
|
|
97
|
-
that.$refs[refName].getSearchParams().then((searchForm) => {
|
|
98
|
-
that.search(searchForm)
|
|
99
|
-
})
|
|
100
|
-
}
|
|
101
|
-
})
|
|
102
|
-
},
|
|
103
|
-
beforeUnmount() {
|
|
104
|
-
eventBus.$off(this.pageCode + '-refresh-tab')
|
|
105
|
-
},
|
|
106
|
-
methods: {
|
|
107
|
-
...Util,
|
|
108
|
-
// 图表查询组件统计按钮
|
|
109
|
-
search(searchParam) {
|
|
110
|
-
$emit(
|
|
111
|
-
eventBus,
|
|
112
|
-
this.queryCode + '-clickChartSearchButton',
|
|
113
|
-
searchParam,
|
|
114
|
-
false
|
|
115
|
-
)
|
|
116
|
-
},
|
|
117
|
-
resetForm(searchParam) {
|
|
118
|
-
// 重置查询表单
|
|
119
|
-
$emit(eventBus, this.queryCode + '-clickChartResetButton', searchParam)
|
|
120
|
-
},
|
|
121
|
-
// 导出报告
|
|
122
|
-
exportChart() {
|
|
123
|
-
$emit(this, 'export', this.beanName)
|
|
124
|
-
},
|
|
125
|
-
// 进入页面初始化查询数据
|
|
126
|
-
initSearch(searchParam) {
|
|
127
|
-
const that = this
|
|
128
|
-
setTimeout(function () {
|
|
129
|
-
$emit(
|
|
130
|
-
eventBus,
|
|
131
|
-
that.queryCode + '-clickChartSearchButton',
|
|
132
|
-
searchParam,
|
|
133
|
-
true
|
|
134
|
-
)
|
|
135
|
-
}, 500)
|
|
136
|
-
},
|
|
137
|
-
packageChartEvents() {
|
|
138
|
-
const allChartEvents = {}
|
|
139
|
-
let chartEvents = []
|
|
140
|
-
const pageEvents = getStoreInfo(this.pageCode, '_pageEvents')
|
|
141
|
-
if (pageEvents) {
|
|
142
|
-
chartEvents = pageEvents.chartEvents
|
|
143
|
-
if (this.queryCode && chartEvents) {
|
|
144
|
-
Object.keys(chartEvents).forEach((key) => {
|
|
145
|
-
const formViewCodeKey = key.substring(0, key.indexOf('__'))
|
|
146
|
-
if (this.queryCode === formViewCodeKey) {
|
|
147
|
-
// 表示是当前表单的事件,封装到事件对象中
|
|
148
|
-
const event = key.substring(key.indexOf('__') + '__'.length)
|
|
149
|
-
allChartEvents[event] = chartEvents[key]
|
|
150
|
-
}
|
|
151
|
-
})
|
|
152
|
-
}
|
|
153
|
-
const customEvents = pageEvents.customEvents
|
|
154
|
-
if (customEvents) {
|
|
155
|
-
allChartEvents.customEvents = customEvents
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
return allChartEvents
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
emits: [, 'export'],
|
|
162
|
-
}
|
|
163
|
-
</script>
|