super-pages 0.7.57 → 0.7.58
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.css +1 -1
- package/lib/super-pages.umd.min.js +5 -5
- package/package.json +2 -2
- package/packages/index.js +33 -0
- package/packages/super-page/index.js +9 -0
- package/packages/super-page/src/button-group.vue +272 -0
- package/packages/super-page/src/chart-page.vue +173 -0
- package/packages/super-page/src/chart-query-page.vue +113 -0
- package/packages/super-page/src/common-form-page.vue +547 -0
- package/packages/super-page/src/export-form-report-dialog.vue +84 -0
- package/packages/super-page/src/form-head.vue +67 -0
- package/packages/super-page/src/form-page.vue +107 -0
- package/packages/super-page/src/group-tag.vue +29 -0
- package/packages/super-page/src/list-page.vue +1023 -0
- package/packages/super-page/src/list-toolbar-page.vue +257 -0
- package/packages/super-page/src/my-button-base.vue +367 -0
- package/packages/super-page/src/my-button.vue +185 -0
- package/packages/super-page/src/page-custom-component.vue +64 -0
- package/packages/super-page/src/remove-signer-dialog.vue +107 -0
- package/packages/super-page/src/sub-tab-page.vue +88 -0
- package/packages/super-page/src/super-page-component.vue +78 -0
- package/packages/super-page/src/super-page.vue +134 -0
- package/packages/super-page/src/tab-page.vue +152 -0
- package/packages/super-page/src/task-informition-dialog.vue +88 -0
- package/packages/super-page/src/util/ListButtonEvent.js +608 -0
- package/packages/super-page/src/util/api.js +32 -0
- package/packages/super-page/src/util/callEvents.js +52 -0
- package/packages/super-page/src/util/chartButtonEvent.js +60 -0
- package/packages/super-page/src/util/common-util.js +100 -0
- package/packages/super-page/src/util/commonButtonEvent.js +55 -0
- package/packages/super-page/src/util/eventBus.js +2 -0
- package/packages/super-page/src/util/formButtonEvent.js +262 -0
- package/packages/super-page/src/util/store.js +3 -0
- package/packages/super-page/src/util/super-page.js +19 -0
- package/packages/super-page/src/util/util.js +976 -0
- package/packages/super-page/src/util/workflowButtonEvent.js +1037 -0
- package/packages/super-page/src/widget-col-page.vue +339 -0
- package/packages/super-page/src/widget-page.vue +596 -0
- package/packages/super-page/src/widget-sub-tab-pane-page.vue +105 -0
- package/packages/super-page/src/widget-tab-pane-page.vue +125 -0
- package/packages/super-page/src/workflow-button-group.vue +487 -0
- package/packages/super-page/src/workflow-form-page.vue +1119 -0
- package/packages/super-page-dialog/index.js +9 -0
- 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.7.
|
|
3
|
+
"version": "0.7.58",
|
|
4
4
|
"description": "页面组件",
|
|
5
5
|
"main": "lib/super-pages.umd.min.js",
|
|
6
6
|
"keyword": "super-pages",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"eslint": "5.16.0",
|
|
28
28
|
"eslint-plugin-vue": "5.2.2",
|
|
29
29
|
"font-awesome": "^4.7.0",
|
|
30
|
-
"imatrix-ui": "2.8.
|
|
30
|
+
"imatrix-ui": "2.8.21",
|
|
31
31
|
"node-sass": "4.12.0",
|
|
32
32
|
"normalize.css": "^8.0.1",
|
|
33
33
|
"nprogress": "^0.2.0",
|
|
@@ -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,272 @@
|
|
|
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
|
+
<template v-slot:dropdown>
|
|
22
|
+
<el-dropdown-menu>
|
|
23
|
+
<span
|
|
24
|
+
v-for="(buttonChild, index) in button.buttons"
|
|
25
|
+
:key="buttonChild.code + index"
|
|
26
|
+
>
|
|
27
|
+
<el-dropdown-item
|
|
28
|
+
v-permission="
|
|
29
|
+
permissionPrefix && permissionPrefix !== ''
|
|
30
|
+
? permissionPrefix + buttonChild.code
|
|
31
|
+
: ''
|
|
32
|
+
"
|
|
33
|
+
:command="buttonChild.code"
|
|
34
|
+
:disabled="preventReclick"
|
|
35
|
+
>
|
|
36
|
+
{{
|
|
37
|
+
buttonChild.label
|
|
38
|
+
? buttonChild.label
|
|
39
|
+
: buttonChild.code === 'search'
|
|
40
|
+
? $t('superPageMessage.searchButtonLabel')
|
|
41
|
+
: ''
|
|
42
|
+
}}
|
|
43
|
+
</el-dropdown-item>
|
|
44
|
+
</span>
|
|
45
|
+
</el-dropdown-menu>
|
|
46
|
+
</template>
|
|
47
|
+
</el-dropdown>
|
|
48
|
+
<!--图表页面按钮区不显示统计和重置;列表页面时不显示查询按钮;-->
|
|
49
|
+
<my-button
|
|
50
|
+
v-else-if="!position || (position==='list' && button.code !=='search') || (position==='chart' && button.code !=='reset' && button.code !== 'statistics') || (position !=='chart' && position !=='list')"
|
|
51
|
+
:key="buttonIndex"
|
|
52
|
+
:search-form-info="searchFormInfo"
|
|
53
|
+
:button="button"
|
|
54
|
+
:permission-prefix="permissionPrefix"
|
|
55
|
+
:workflow-button-component="workflowButtonComponent"
|
|
56
|
+
:position="position"
|
|
57
|
+
:is-task-input="isTaskInput"
|
|
58
|
+
:table-name="tableName"
|
|
59
|
+
:page-code="pageCode"
|
|
60
|
+
:button-groups="button.code === 'workflowButton' ? buttonGroups : []"
|
|
61
|
+
:get-form-data="getFormData"
|
|
62
|
+
:selections="selections"
|
|
63
|
+
:form-data-fun="formDataFun"
|
|
64
|
+
:get-system-ref="getSystemRef"
|
|
65
|
+
:form-button-position="formButtonPosition"
|
|
66
|
+
:disabled="disabled"
|
|
67
|
+
@refresh="refreshEmit"
|
|
68
|
+
@click="commonButtonClick"
|
|
69
|
+
@workflowClick="workflowButtonClick"
|
|
70
|
+
@prohibi-edit="fnProhibitToEdit"
|
|
71
|
+
@refreshFrom="refreshFrom"
|
|
72
|
+
/>
|
|
73
|
+
</template>
|
|
74
|
+
<list-toolbar-page
|
|
75
|
+
v-if="listToolbarList"
|
|
76
|
+
:list-toolbar-list="listToolbarList"
|
|
77
|
+
:page-code="pageCode"
|
|
78
|
+
@searchGridData="searchGridData"
|
|
79
|
+
/>
|
|
80
|
+
<page-custom-component
|
|
81
|
+
:button-area-custom-component-arr="buttonAreaCustomComponentArr"
|
|
82
|
+
:page-code="pageCode"
|
|
83
|
+
@getSystemRef="getSystemRef"
|
|
84
|
+
/>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</template>
|
|
88
|
+
|
|
89
|
+
<script>
|
|
90
|
+
import Util from './util/util'
|
|
91
|
+
import MyButton from './my-button'
|
|
92
|
+
import listToolbarPage from './list-toolbar-page'
|
|
93
|
+
import pageCustomComponent from './page-custom-component'
|
|
94
|
+
import { mapGetters } from 'vuex'
|
|
95
|
+
export default {
|
|
96
|
+
name: 'ButtonGroup',
|
|
97
|
+
components: {
|
|
98
|
+
MyButton,
|
|
99
|
+
listToolbarPage,
|
|
100
|
+
pageCustomComponent
|
|
101
|
+
},
|
|
102
|
+
props: {
|
|
103
|
+
// 元素设置
|
|
104
|
+
buttonGroups: {
|
|
105
|
+
type: Array,
|
|
106
|
+
default: null
|
|
107
|
+
},
|
|
108
|
+
// 按钮的资源编码前缀,例如:系统编码.页面编码.列表组件编码 或 系统编码.页面编码.表单组件编码
|
|
109
|
+
permissionPrefix: {
|
|
110
|
+
type: String,
|
|
111
|
+
default: null
|
|
112
|
+
},
|
|
113
|
+
// 流程按钮组需要的信息
|
|
114
|
+
workflowButtonComponent: {
|
|
115
|
+
type: Object,
|
|
116
|
+
default: null
|
|
117
|
+
},
|
|
118
|
+
// 按钮组所在位置,list列表或form表单内或chart
|
|
119
|
+
position: {
|
|
120
|
+
type: String,
|
|
121
|
+
default: null
|
|
122
|
+
},
|
|
123
|
+
// 是否在任务办理页面(待办事宜中打开的),控制返回、关闭按钮
|
|
124
|
+
isTaskInput: {
|
|
125
|
+
type: Boolean,
|
|
126
|
+
default: false
|
|
127
|
+
},
|
|
128
|
+
// 数据表名称
|
|
129
|
+
tableName: {
|
|
130
|
+
type: String,
|
|
131
|
+
default: null
|
|
132
|
+
},
|
|
133
|
+
// 列表工具栏
|
|
134
|
+
listToolbarList: {
|
|
135
|
+
type: Array,
|
|
136
|
+
default: null
|
|
137
|
+
},
|
|
138
|
+
// 按钮区自定义组件
|
|
139
|
+
buttonAreaCustomComponentArr: {
|
|
140
|
+
type: Array,
|
|
141
|
+
default: null
|
|
142
|
+
},
|
|
143
|
+
// 页面编码
|
|
144
|
+
pageCode: {
|
|
145
|
+
type: String,
|
|
146
|
+
default: null
|
|
147
|
+
},
|
|
148
|
+
// 保存页面数据的方法
|
|
149
|
+
getFormData: {
|
|
150
|
+
type: Function,
|
|
151
|
+
default: function () {}
|
|
152
|
+
},
|
|
153
|
+
// 列表选中的记录集合
|
|
154
|
+
selections: {
|
|
155
|
+
type: Array,
|
|
156
|
+
default: null
|
|
157
|
+
},
|
|
158
|
+
// 表单对象方法
|
|
159
|
+
formDataFun: {
|
|
160
|
+
type: Function,
|
|
161
|
+
default: function () {}
|
|
162
|
+
},
|
|
163
|
+
searchFormInfo: {
|
|
164
|
+
type: Object,
|
|
165
|
+
default: () => {
|
|
166
|
+
return { data: {} }
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
formButtonPosition: {
|
|
170
|
+
type: String,
|
|
171
|
+
default: null
|
|
172
|
+
},
|
|
173
|
+
// 是否是图表页面按钮
|
|
174
|
+
isChartView: {
|
|
175
|
+
type: Boolean,
|
|
176
|
+
default: false
|
|
177
|
+
},
|
|
178
|
+
disabled: {
|
|
179
|
+
type: Boolean,
|
|
180
|
+
default: false
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
data () {
|
|
184
|
+
return {
|
|
185
|
+
myButtonGroups: null
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
computed: {
|
|
189
|
+
...mapGetters(['preventReclick'])
|
|
190
|
+
},
|
|
191
|
+
created () {
|
|
192
|
+
if (this.position === 'workflowForm') {
|
|
193
|
+
for (let i = 0; i < this.buttonGroups.length; i++) {
|
|
194
|
+
const button = this.buttonGroups[i]
|
|
195
|
+
if (button.code === 'workflowButton') {
|
|
196
|
+
this.myButtonGroups = []
|
|
197
|
+
this.myButtonGroups[0] = button
|
|
198
|
+
break
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
} else {
|
|
202
|
+
if (this.buttonGroups && this.buttonGroups.length > 0) {
|
|
203
|
+
this.myButtonGroups = []
|
|
204
|
+
const groupButtonMap = {}
|
|
205
|
+
this.buttonGroups.forEach(button => {
|
|
206
|
+
if (!button.groupName || button.groupName === '') {
|
|
207
|
+
// 未分组
|
|
208
|
+
this.myButtonGroups.push(button)
|
|
209
|
+
} else {
|
|
210
|
+
// 已分组
|
|
211
|
+
const groupNmae = button.groupName
|
|
212
|
+
if (groupButtonMap[groupNmae]) {
|
|
213
|
+
const groupButtons = groupButtonMap[groupNmae]
|
|
214
|
+
groupButtons.push(button)
|
|
215
|
+
} else {
|
|
216
|
+
const groupButtons = []
|
|
217
|
+
groupButtons.push(button)
|
|
218
|
+
groupButtonMap[groupNmae] = groupButtons
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
})
|
|
222
|
+
for (let key in groupButtonMap) {
|
|
223
|
+
const buttonGroup = {}
|
|
224
|
+
buttonGroup.isGroup = true
|
|
225
|
+
buttonGroup.label = key
|
|
226
|
+
buttonGroup.buttons = groupButtonMap[key]
|
|
227
|
+
this.myButtonGroups.push(buttonGroup)
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
methods: {
|
|
233
|
+
...Util,
|
|
234
|
+
searchGridData (data, dataTypes, dataTypeObj, currentControlType) {
|
|
235
|
+
this.$emit(
|
|
236
|
+
'searchGridData',
|
|
237
|
+
data,
|
|
238
|
+
dataTypes,
|
|
239
|
+
dataTypeObj,
|
|
240
|
+
currentControlType
|
|
241
|
+
)
|
|
242
|
+
},
|
|
243
|
+
getSystemRef (refKey, operation) {
|
|
244
|
+
this.$emit('getSystemRef', refKey, operation)
|
|
245
|
+
},
|
|
246
|
+
handleCommand (buttonCode) {
|
|
247
|
+
if (buttonCode && buttonCode !== '') {
|
|
248
|
+
let index = this.buttonGroups.findIndex(function (item) {
|
|
249
|
+
return buttonCode === item.code
|
|
250
|
+
})
|
|
251
|
+
if (index != null && index !== undefined && index !== -1) {
|
|
252
|
+
this.commonButtonClick(this.buttonGroups[index])
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
fnProhibitToEdit (data) {
|
|
257
|
+
this.$emit('prohibi-edit', data)
|
|
258
|
+
},
|
|
259
|
+
getFormButtonPosition () {
|
|
260
|
+
if (this.position === 'chart') {
|
|
261
|
+
return 'operation-area-chart'
|
|
262
|
+
}
|
|
263
|
+
if (this.position === 'list') {
|
|
264
|
+
return 'operation-area'
|
|
265
|
+
}
|
|
266
|
+
return this.formButtonPosition === 'topLeft' ? 'form-top-button' : 'form-bottom-button'
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
</script>
|
|
271
|
+
|
|
272
|
+
<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>
|