vue2-client 1.8.11 → 1.8.13
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/CHANGELOG.md +692 -685
- package/package.json +92 -92
- package/src/assets/img/querySlotDemo.svg +15 -15
- package/src/base-client/components/common/AMisRender/index.vue +243 -257
- package/src/base-client/components/common/CitySelect/index.js +3 -3
- package/src/base-client/components/common/CitySelect/index.md +109 -109
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +13 -26
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +37 -9
- package/src/base-client/components/common/PersonSetting/index.js +3 -3
- package/src/base-client/components/common/Upload/index.js +3 -3
- package/src/base-client/components/common/XFormTable/XFormTable.vue +347 -384
- package/src/base-client/components/common/XImportExcel/XImportExcel.vue +15 -16
- package/src/base-client/components/common/XStepView/XStepView.vue +252 -252
- package/src/config/CreateQueryConfig.js +11 -1
- package/src/pages/AMisDemo/AMisDemo.vue +67 -223
- package/src/router.js +13 -15
- package/src/services/api/common.js +10 -1
- package/src/services/api/restTools.js +24 -24
- package/src/base-client/components/common/AMisRender/index.js +0 -3
- package/src/pages/AMisDemo/AMisDemo2.vue +0 -70
|
@@ -1,384 +1,347 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<a-skeleton :loading="loading" :paragraph="{ rows: 4 }" />
|
|
4
|
-
<div v-show="!loading">
|
|
5
|
-
<template v-if="!loadError">
|
|
6
|
-
<x-add-form
|
|
7
|
-
ref="xAddForm"
|
|
8
|
-
@afterSubmit="onAddOrEditSubmitAfterSubmit"
|
|
9
|
-
/>
|
|
10
|
-
<x-form
|
|
11
|
-
ref="xForm"
|
|
12
|
-
style="margin-bottom: 14px;"
|
|
13
|
-
@onSubmit="onSearchSubmit">
|
|
14
|
-
<slot name="formBtnExpand"></slot>
|
|
15
|
-
</x-form>
|
|
16
|
-
<x-table
|
|
17
|
-
ref="xTable"
|
|
18
|
-
:fixedQueryForm="fixedQueryForm"
|
|
19
|
-
:queryParamsName="queryParamsName"
|
|
20
|
-
:query-params-json="queryParamsJson"
|
|
21
|
-
:show-pagination="showPagination"
|
|
22
|
-
@add="add"
|
|
23
|
-
@edit="edit"
|
|
24
|
-
@afterDelete="afterDelete"
|
|
25
|
-
@action="action"
|
|
26
|
-
@selectRow="selectRow"
|
|
27
|
-
@afterQuery="afterQuery"
|
|
28
|
-
@tempTableEdit="tempTableEdit">
|
|
29
|
-
<template slot="leftButton" slot-scope="{selectedRowKeys, selectedRows}">
|
|
30
|
-
<slot name="leftButton" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
31
|
-
</template>
|
|
32
|
-
<template slot="button" slot-scope="{selectedRowKeys, selectedRows}">
|
|
33
|
-
<slot name="button" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
34
|
-
</template>
|
|
35
|
-
<template slot="rightBtnExpand" slot-scope="{selectedRowKeys, selectedRows}">
|
|
36
|
-
<slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
37
|
-
<a-button @click="toggleIsFormShow">
|
|
38
|
-
<a-icon :style="iconStyle" type="vertical-align-top"/>
|
|
39
|
-
</a-button>
|
|
40
|
-
</template>
|
|
41
|
-
<!-- 底部插槽 -->
|
|
42
|
-
<template slot="footer" slot-scope="{selectedRowKeys, selectedRows}">
|
|
43
|
-
<slot name="footer" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
44
|
-
</template>
|
|
45
|
-
</x-table>
|
|
46
|
-
</template>
|
|
47
|
-
<template v-else>
|
|
48
|
-
<a-empty>
|
|
49
|
-
<span slot="description"> 页面配置不存在,请联系系统管理员 </span>
|
|
50
|
-
</a-empty>
|
|
51
|
-
</template>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
</template>
|
|
55
|
-
<script>
|
|
56
|
-
import XForm from '@vue2-client/base-client/components/common/XForm'
|
|
57
|
-
import XAddForm from '@vue2-client/base-client/components/common/XAddForm'
|
|
58
|
-
import XTable from '@vue2-client/base-client/components/common/XTable'
|
|
59
|
-
import XImportExcel from '@vue2-client/base-client/components/common/XImportExcel'
|
|
60
|
-
import { getConfigByName, getConfigByLogic, parseConfig } from '@vue2-client/services/api/common'
|
|
61
|
-
import { mapState } from 'vuex'
|
|
62
|
-
|
|
63
|
-
export default {
|
|
64
|
-
name: 'XFormTable',
|
|
65
|
-
components: {
|
|
66
|
-
XTable,
|
|
67
|
-
XForm,
|
|
68
|
-
XAddForm,
|
|
69
|
-
XImportExcel
|
|
70
|
-
},
|
|
71
|
-
data () {
|
|
72
|
-
return {
|
|
73
|
-
// 加载状态
|
|
74
|
-
loading: false,
|
|
75
|
-
// 图标样式
|
|
76
|
-
iconStyle: {
|
|
77
|
-
position: 'relative',
|
|
78
|
-
top: '1px'
|
|
79
|
-
},
|
|
80
|
-
loadError: false,
|
|
81
|
-
// 实际查询配置内容
|
|
82
|
-
realQueryConfig: {}
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
computed: {
|
|
86
|
-
...mapState('setting', ['isMobile'])
|
|
87
|
-
},
|
|
88
|
-
props: {
|
|
89
|
-
// 业务名称
|
|
90
|
-
title: {
|
|
91
|
-
type: String,
|
|
92
|
-
default: ''
|
|
93
|
-
},
|
|
94
|
-
// 查询配置文件名
|
|
95
|
-
queryParamsName: {
|
|
96
|
-
type: String,
|
|
97
|
-
default: null
|
|
98
|
-
},
|
|
99
|
-
// 配置所属命名空间
|
|
100
|
-
serviceName: {
|
|
101
|
-
type: String,
|
|
102
|
-
default: undefined
|
|
103
|
-
},
|
|
104
|
-
// 查询配置文件Json,用于查询配置生成器的预览
|
|
105
|
-
queryParamsJson: {
|
|
106
|
-
type: Object,
|
|
107
|
-
default: null
|
|
108
|
-
},
|
|
109
|
-
// 业务逻辑名称, 通过logic获取表单表格配置
|
|
110
|
-
logicName: {
|
|
111
|
-
type: String,
|
|
112
|
-
default: null
|
|
113
|
-
},
|
|
114
|
-
// 执行logic传递的参数
|
|
115
|
-
logicParam: {
|
|
116
|
-
type: Object,
|
|
117
|
-
default: () => {}
|
|
118
|
-
},
|
|
119
|
-
// 固定新增表单
|
|
120
|
-
fixedAddForm: {
|
|
121
|
-
type: Object,
|
|
122
|
-
default: () => {
|
|
123
|
-
return {}
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
// 固定查询表单
|
|
127
|
-
fixedQueryForm: {
|
|
128
|
-
type: Object,
|
|
129
|
-
default: () => {
|
|
130
|
-
return {}
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
// 预览模式
|
|
134
|
-
viewMode: {
|
|
135
|
-
type: Boolean,
|
|
136
|
-
default: () => {
|
|
137
|
-
return false
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
// 数据只有一页时是否展示分页,true:展示,auto:隐藏
|
|
141
|
-
showPagination: {
|
|
142
|
-
type: Boolean,
|
|
143
|
-
default: true
|
|
144
|
-
},
|
|
145
|
-
// 调用logic获取数据源的追加参数
|
|
146
|
-
getDataParams: {
|
|
147
|
-
type: Object,
|
|
148
|
-
default: undefined
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
watch: {
|
|
152
|
-
logicParam: {
|
|
153
|
-
handler () {
|
|
154
|
-
this.initConfig()
|
|
155
|
-
},
|
|
156
|
-
deep: true
|
|
157
|
-
},
|
|
158
|
-
queryParamsJson: {
|
|
159
|
-
handler () {
|
|
160
|
-
this.initConfig()
|
|
161
|
-
},
|
|
162
|
-
deep: true
|
|
163
|
-
},
|
|
164
|
-
queryParamsName: {
|
|
165
|
-
handler () {
|
|
166
|
-
this.initConfig()
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
created () {
|
|
171
|
-
this.initConfig()
|
|
172
|
-
},
|
|
173
|
-
methods: {
|
|
174
|
-
initConfig () {
|
|
175
|
-
this.loading = true
|
|
176
|
-
this.loadError = false
|
|
177
|
-
if (this.queryParamsName) {
|
|
178
|
-
this.getConfig()
|
|
179
|
-
} else if (this.queryParamsJson) {
|
|
180
|
-
this.getConfigBySource()
|
|
181
|
-
} else if (this.logicName && this.logicParam) {
|
|
182
|
-
this.getColumnJsonByLogic()
|
|
183
|
-
} else {
|
|
184
|
-
this.loading = false
|
|
185
|
-
this.loadError = true
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
getConfig () {
|
|
189
|
-
getConfigByName(this.queryParamsName, this.serviceName, (res) => {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
*
|
|
206
|
-
* @param
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
this.
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
*
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
})
|
|
306
|
-
},
|
|
307
|
-
/**
|
|
308
|
-
*
|
|
309
|
-
* @param
|
|
310
|
-
*/
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
},
|
|
328
|
-
/**
|
|
329
|
-
*
|
|
330
|
-
* @param res
|
|
331
|
-
*/
|
|
332
|
-
|
|
333
|
-
this.$emit('
|
|
334
|
-
},
|
|
335
|
-
/**
|
|
336
|
-
*
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
},
|
|
349
|
-
/**
|
|
350
|
-
* 临时表修改
|
|
351
|
-
* @param res 参数
|
|
352
|
-
*/
|
|
353
|
-
tempTableEdit (res) {
|
|
354
|
-
this.$emit('tempTableEdit', res)
|
|
355
|
-
},
|
|
356
|
-
/**
|
|
357
|
-
* 刷新表格
|
|
358
|
-
* @param toFirstPage 是否到第一页
|
|
359
|
-
*/
|
|
360
|
-
refreshTable (toFirstPage = true) {
|
|
361
|
-
this.$refs.xTable.refresh(toFirstPage)
|
|
362
|
-
},
|
|
363
|
-
},
|
|
364
|
-
action: {
|
|
365
|
-
/**
|
|
366
|
-
* 实现doAction方法
|
|
367
|
-
*/
|
|
368
|
-
doAction (actionType, args, data) {
|
|
369
|
-
switch (actionType) {
|
|
370
|
-
case 'refreshTable':
|
|
371
|
-
for (const item in args) {
|
|
372
|
-
console.log('item', item)
|
|
373
|
-
}
|
|
374
|
-
break
|
|
375
|
-
default:
|
|
376
|
-
break
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
</script>
|
|
382
|
-
<style lang="less" scoped>
|
|
383
|
-
|
|
384
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<a-skeleton :loading="loading" :paragraph="{ rows: 4 }" />
|
|
4
|
+
<div v-show="!loading">
|
|
5
|
+
<template v-if="!loadError">
|
|
6
|
+
<x-add-form
|
|
7
|
+
ref="xAddForm"
|
|
8
|
+
@afterSubmit="onAddOrEditSubmitAfterSubmit"
|
|
9
|
+
/>
|
|
10
|
+
<x-form
|
|
11
|
+
ref="xForm"
|
|
12
|
+
style="margin-bottom: 14px;"
|
|
13
|
+
@onSubmit="onSearchSubmit">
|
|
14
|
+
<slot name="formBtnExpand"></slot>
|
|
15
|
+
</x-form>
|
|
16
|
+
<x-table
|
|
17
|
+
ref="xTable"
|
|
18
|
+
:fixedQueryForm="fixedQueryForm"
|
|
19
|
+
:queryParamsName="queryParamsName"
|
|
20
|
+
:query-params-json="queryParamsJson"
|
|
21
|
+
:show-pagination="showPagination"
|
|
22
|
+
@add="add"
|
|
23
|
+
@edit="edit"
|
|
24
|
+
@afterDelete="afterDelete"
|
|
25
|
+
@action="action"
|
|
26
|
+
@selectRow="selectRow"
|
|
27
|
+
@afterQuery="afterQuery"
|
|
28
|
+
@tempTableEdit="tempTableEdit">
|
|
29
|
+
<template slot="leftButton" slot-scope="{selectedRowKeys, selectedRows}">
|
|
30
|
+
<slot name="leftButton" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
31
|
+
</template>
|
|
32
|
+
<template slot="button" slot-scope="{selectedRowKeys, selectedRows}">
|
|
33
|
+
<slot name="button" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
34
|
+
</template>
|
|
35
|
+
<template slot="rightBtnExpand" slot-scope="{selectedRowKeys, selectedRows}">
|
|
36
|
+
<slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
37
|
+
<a-button @click="toggleIsFormShow">
|
|
38
|
+
<a-icon :style="iconStyle" type="vertical-align-top"/>
|
|
39
|
+
</a-button>
|
|
40
|
+
</template>
|
|
41
|
+
<!-- 底部插槽 -->
|
|
42
|
+
<template slot="footer" slot-scope="{selectedRowKeys, selectedRows}">
|
|
43
|
+
<slot name="footer" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
44
|
+
</template>
|
|
45
|
+
</x-table>
|
|
46
|
+
</template>
|
|
47
|
+
<template v-else>
|
|
48
|
+
<a-empty>
|
|
49
|
+
<span slot="description"> 页面配置不存在,请联系系统管理员 </span>
|
|
50
|
+
</a-empty>
|
|
51
|
+
</template>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</template>
|
|
55
|
+
<script>
|
|
56
|
+
import XForm from '@vue2-client/base-client/components/common/XForm'
|
|
57
|
+
import XAddForm from '@vue2-client/base-client/components/common/XAddForm'
|
|
58
|
+
import XTable from '@vue2-client/base-client/components/common/XTable'
|
|
59
|
+
import XImportExcel from '@vue2-client/base-client/components/common/XImportExcel'
|
|
60
|
+
import { getConfigByName, getConfigByLogic, parseConfig } from '@vue2-client/services/api/common'
|
|
61
|
+
import { mapState } from 'vuex'
|
|
62
|
+
|
|
63
|
+
export default {
|
|
64
|
+
name: 'XFormTable',
|
|
65
|
+
components: {
|
|
66
|
+
XTable,
|
|
67
|
+
XForm,
|
|
68
|
+
XAddForm,
|
|
69
|
+
XImportExcel
|
|
70
|
+
},
|
|
71
|
+
data () {
|
|
72
|
+
return {
|
|
73
|
+
// 加载状态
|
|
74
|
+
loading: false,
|
|
75
|
+
// 图标样式
|
|
76
|
+
iconStyle: {
|
|
77
|
+
position: 'relative',
|
|
78
|
+
top: '1px'
|
|
79
|
+
},
|
|
80
|
+
loadError: false,
|
|
81
|
+
// 实际查询配置内容
|
|
82
|
+
realQueryConfig: {}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
computed: {
|
|
86
|
+
...mapState('setting', ['isMobile'])
|
|
87
|
+
},
|
|
88
|
+
props: {
|
|
89
|
+
// 业务名称
|
|
90
|
+
title: {
|
|
91
|
+
type: String,
|
|
92
|
+
default: ''
|
|
93
|
+
},
|
|
94
|
+
// 查询配置文件名
|
|
95
|
+
queryParamsName: {
|
|
96
|
+
type: String,
|
|
97
|
+
default: null
|
|
98
|
+
},
|
|
99
|
+
// 配置所属命名空间
|
|
100
|
+
serviceName: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: undefined
|
|
103
|
+
},
|
|
104
|
+
// 查询配置文件Json,用于查询配置生成器的预览
|
|
105
|
+
queryParamsJson: {
|
|
106
|
+
type: Object,
|
|
107
|
+
default: null
|
|
108
|
+
},
|
|
109
|
+
// 业务逻辑名称, 通过logic获取表单表格配置
|
|
110
|
+
logicName: {
|
|
111
|
+
type: String,
|
|
112
|
+
default: null
|
|
113
|
+
},
|
|
114
|
+
// 执行logic传递的参数
|
|
115
|
+
logicParam: {
|
|
116
|
+
type: Object,
|
|
117
|
+
default: () => {}
|
|
118
|
+
},
|
|
119
|
+
// 固定新增表单
|
|
120
|
+
fixedAddForm: {
|
|
121
|
+
type: Object,
|
|
122
|
+
default: () => {
|
|
123
|
+
return {}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
// 固定查询表单
|
|
127
|
+
fixedQueryForm: {
|
|
128
|
+
type: Object,
|
|
129
|
+
default: () => {
|
|
130
|
+
return {}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
// 预览模式
|
|
134
|
+
viewMode: {
|
|
135
|
+
type: Boolean,
|
|
136
|
+
default: () => {
|
|
137
|
+
return false
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
// 数据只有一页时是否展示分页,true:展示,auto:隐藏
|
|
141
|
+
showPagination: {
|
|
142
|
+
type: Boolean,
|
|
143
|
+
default: true
|
|
144
|
+
},
|
|
145
|
+
// 调用logic获取数据源的追加参数
|
|
146
|
+
getDataParams: {
|
|
147
|
+
type: Object,
|
|
148
|
+
default: undefined
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
watch: {
|
|
152
|
+
logicParam: {
|
|
153
|
+
handler () {
|
|
154
|
+
this.initConfig()
|
|
155
|
+
},
|
|
156
|
+
deep: true
|
|
157
|
+
},
|
|
158
|
+
queryParamsJson: {
|
|
159
|
+
handler () {
|
|
160
|
+
this.initConfig()
|
|
161
|
+
},
|
|
162
|
+
deep: true
|
|
163
|
+
},
|
|
164
|
+
queryParamsName: {
|
|
165
|
+
handler () {
|
|
166
|
+
this.initConfig()
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
created () {
|
|
171
|
+
this.initConfig()
|
|
172
|
+
},
|
|
173
|
+
methods: {
|
|
174
|
+
initConfig () {
|
|
175
|
+
this.loading = true
|
|
176
|
+
this.loadError = false
|
|
177
|
+
if (this.queryParamsName) {
|
|
178
|
+
this.getConfig()
|
|
179
|
+
} else if (this.queryParamsJson) {
|
|
180
|
+
this.getConfigBySource()
|
|
181
|
+
} else if (this.logicName && this.logicParam) {
|
|
182
|
+
this.getColumnJsonByLogic()
|
|
183
|
+
} else {
|
|
184
|
+
this.loading = false
|
|
185
|
+
this.loadError = true
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
getConfig () {
|
|
189
|
+
getConfigByName(this.queryParamsName, this.serviceName, (res) => {
|
|
190
|
+
this.updateComponents(res)
|
|
191
|
+
})
|
|
192
|
+
},
|
|
193
|
+
getConfigBySource () {
|
|
194
|
+
parseConfig(this.queryParamsJson, 'CRUD_FORM', this.serviceName).then(res => {
|
|
195
|
+
this.updateComponents(res, true)
|
|
196
|
+
})
|
|
197
|
+
},
|
|
198
|
+
getColumnJsonByLogic () {
|
|
199
|
+
getConfigByLogic(this.logicName, this.logicParam, this.serviceName, (res) => {
|
|
200
|
+
this.updateComponents(res, true)
|
|
201
|
+
})
|
|
202
|
+
},
|
|
203
|
+
/**
|
|
204
|
+
* 更新子组件
|
|
205
|
+
* @param res 参数
|
|
206
|
+
* @param setQueryParams 是否设置queryParams参数
|
|
207
|
+
*/
|
|
208
|
+
updateComponents (res, setQueryParams) {
|
|
209
|
+
this.realQueryConfig = res
|
|
210
|
+
if (this.$refs.xTable && this.$refs.xForm && this.$refs.xAddForm) {
|
|
211
|
+
this.$refs.xTable.init({
|
|
212
|
+
queryParams: setQueryParams ? res : null,
|
|
213
|
+
tableColumns: res.columnJson,
|
|
214
|
+
buttonState: res.buttonState,
|
|
215
|
+
title: this.title,
|
|
216
|
+
viewMode: this.viewMode,
|
|
217
|
+
isTableTemp: this.isTableTemp,
|
|
218
|
+
serviceName: this.serviceName
|
|
219
|
+
})
|
|
220
|
+
this.$refs.xForm.init({
|
|
221
|
+
formItems: res.formJson,
|
|
222
|
+
serviceName: this.serviceName,
|
|
223
|
+
getDataParams: this.getDataParams
|
|
224
|
+
})
|
|
225
|
+
}
|
|
226
|
+
this.loading = false
|
|
227
|
+
},
|
|
228
|
+
/**
|
|
229
|
+
* 提交查询表单事件
|
|
230
|
+
* @param res 参数
|
|
231
|
+
*/
|
|
232
|
+
onSearchSubmit (res) {
|
|
233
|
+
if (res.valid) {
|
|
234
|
+
// 表单赋值
|
|
235
|
+
this.$refs.xTable.setQueryForm(res.form)
|
|
236
|
+
// commit
|
|
237
|
+
this.$emit('afterSearchSubmit', res)
|
|
238
|
+
} else {
|
|
239
|
+
return false
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
/**
|
|
243
|
+
* 提交新增/修改表单后事件
|
|
244
|
+
*/
|
|
245
|
+
onAddOrEditSubmitAfterSubmit (res) {
|
|
246
|
+
this.refreshTable(res.businessType === '新增')
|
|
247
|
+
// commit
|
|
248
|
+
this.$emit('afterSubmit', res)
|
|
249
|
+
},
|
|
250
|
+
/**
|
|
251
|
+
* 表格查询后事件
|
|
252
|
+
* @param res 参数
|
|
253
|
+
* @param conditionParams 查询条件
|
|
254
|
+
*/
|
|
255
|
+
afterQuery (res, conditionParams) {
|
|
256
|
+
this.$emit('afterQuery', res, conditionParams)
|
|
257
|
+
},
|
|
258
|
+
/**
|
|
259
|
+
* 详情按钮事件
|
|
260
|
+
* @param record 本条数据
|
|
261
|
+
* @param id 数据标识
|
|
262
|
+
* @param actionType 操作类型
|
|
263
|
+
*/
|
|
264
|
+
action (record, id, actionType) {
|
|
265
|
+
this.$emit('action', record, id, actionType)
|
|
266
|
+
},
|
|
267
|
+
/**
|
|
268
|
+
* 新增按钮事件
|
|
269
|
+
*/
|
|
270
|
+
add () {
|
|
271
|
+
const res = this.realQueryConfig
|
|
272
|
+
this.$refs.xAddForm.init({
|
|
273
|
+
businessType: '新增',
|
|
274
|
+
title: this.title,
|
|
275
|
+
isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
|
|
276
|
+
configName: this.queryParamsName,
|
|
277
|
+
configContent: this.queryParamsJson,
|
|
278
|
+
formItems: res.formJson,
|
|
279
|
+
viewMode: this.viewMode,
|
|
280
|
+
isTableTemp: this.isTableTemp,
|
|
281
|
+
serviceName: this.serviceName,
|
|
282
|
+
fixedAddForm: this.fixedAddForm,
|
|
283
|
+
getDataParams: this.getDataParams
|
|
284
|
+
})
|
|
285
|
+
},
|
|
286
|
+
/**
|
|
287
|
+
* 修改按钮事件
|
|
288
|
+
* @param modifyModelData 修改表单数据
|
|
289
|
+
*/
|
|
290
|
+
edit (modifyModelData) {
|
|
291
|
+
const res = this.realQueryConfig
|
|
292
|
+
this.$refs.xAddForm.init({
|
|
293
|
+
businessType: '修改',
|
|
294
|
+
title: this.title,
|
|
295
|
+
isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
|
|
296
|
+
configName: this.queryParamsName,
|
|
297
|
+
configContent: this.queryParamsJson,
|
|
298
|
+
formItems: res.formJson,
|
|
299
|
+
viewMode: this.viewMode,
|
|
300
|
+
isTableTemp: this.isTableTemp,
|
|
301
|
+
serviceName: this.serviceName,
|
|
302
|
+
fixedAddForm: this.fixedAddForm,
|
|
303
|
+
getDataParams: this.getDataParams,
|
|
304
|
+
modifyModelData: modifyModelData
|
|
305
|
+
})
|
|
306
|
+
},
|
|
307
|
+
/**
|
|
308
|
+
* 删除后事件
|
|
309
|
+
* @param res
|
|
310
|
+
*/
|
|
311
|
+
afterDelete (res) {
|
|
312
|
+
this.$emit('afterDelete', res)
|
|
313
|
+
},
|
|
314
|
+
/**
|
|
315
|
+
* 查询表单部分显示/隐藏切换
|
|
316
|
+
*/
|
|
317
|
+
toggleIsFormShow () {
|
|
318
|
+
this.$refs.xForm.toggleVisible()
|
|
319
|
+
},
|
|
320
|
+
/**
|
|
321
|
+
* 选择列事件
|
|
322
|
+
* @param selectedRowKeys 选中列Key集合
|
|
323
|
+
* @param selectedRows 选中列
|
|
324
|
+
*/
|
|
325
|
+
selectRow (selectedRowKeys, selectedRows) {
|
|
326
|
+
this.$emit('selectRow', selectedRowKeys, selectedRows)
|
|
327
|
+
},
|
|
328
|
+
/**
|
|
329
|
+
* 临时表修改
|
|
330
|
+
* @param res 参数
|
|
331
|
+
*/
|
|
332
|
+
tempTableEdit (res) {
|
|
333
|
+
this.$emit('tempTableEdit', res)
|
|
334
|
+
},
|
|
335
|
+
/**
|
|
336
|
+
* 刷新表格
|
|
337
|
+
* @param toFirstPage 是否到第一页
|
|
338
|
+
*/
|
|
339
|
+
refreshTable (toFirstPage = true) {
|
|
340
|
+
this.$refs.xTable.refresh(toFirstPage)
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
</script>
|
|
345
|
+
<style lang="less" scoped>
|
|
346
|
+
|
|
347
|
+
</style>
|