vue2-client 1.7.0 → 1.7.2
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/.env +15 -15
- package/CHANGELOG.md +661 -628
- package/Components.md +60 -0
- package/index.js +31 -30
- package/package.json +83 -81
- package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +316 -316
- package/src/base-client/components/common/CitySelect/CitySelect.vue +247 -247
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +669 -667
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +735 -733
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +466 -468
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +510 -508
- package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +144 -146
- package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -165
- package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
- package/src/base-client/components/common/Upload/Upload.vue +168 -168
- package/src/base-client/components/common/XAddForm/XAddForm.vue +72 -325
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +369 -279
- package/src/base-client/components/common/XAddNativeForm/index.md +107 -17
- package/src/base-client/components/common/XCard/XCard.vue +64 -64
- package/src/base-client/components/common/XDataDrawer/XDataDrawer.vue +180 -0
- package/src/base-client/components/common/XDataDrawer/index.js +3 -0
- package/src/base-client/components/common/XDataDrawer/index.md +41 -0
- package/src/base-client/components/common/XForm/XForm.vue +178 -180
- package/src/base-client/components/common/XForm/XFormItem.vue +521 -513
- package/src/base-client/components/common/XForm/XTreeSelect.vue +184 -184
- package/src/base-client/components/common/XFormCol/XFormCol.vue +38 -38
- package/src/base-client/components/common/XFormTable/XFormTable.vue +356 -344
- package/src/base-client/components/common/XFormTable/index.md +97 -97
- package/src/base-client/components/common/XImportExcel/XImportExcel.vue +132 -132
- package/src/base-client/components/common/XTable/XTable.vue +519 -506
- package/src/base-client/components/common/XTreeOne/XTreeOne.vue +111 -111
- package/src/base-client/components/index.js +41 -0
- package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +231 -231
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
- package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
- package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
- package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
- package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
- package/src/base-client/plugins/AppData.js +76 -76
- package/src/base-client/plugins/GetLoginInfoService.js +179 -179
- package/src/base-client/plugins/PagedList.js +177 -177
- package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
- package/src/base-client/plugins/i18n-extend.js +32 -32
- package/src/components/Ellipsis/Ellipsis.vue +65 -65
- package/src/components/Ellipsis/index.md +38 -38
- package/src/components/NumberInfo/index.md +43 -43
- package/src/components/STable/README.md +341 -341
- package/src/components/STable/index.js +318 -318
- package/src/components/Trend/index.md +45 -45
- package/src/components/checkbox/ColorCheckbox.vue +157 -157
- package/src/components/checkbox/ImgCheckbox.vue +163 -163
- package/src/components/exception/ExceptionPage.vue +70 -70
- package/src/components/form/FormRow.vue +52 -52
- package/src/components/index.js +36 -36
- package/src/components/menu/SideMenu.vue +75 -62
- package/src/components/menu/menu.js +273 -273
- package/src/components/page/header/index.less +40 -40
- package/src/components/setting/Setting.vue +235 -235
- package/src/components/table/StandardTable.vue +141 -141
- package/src/components/table/advance/ActionColumns.vue +158 -158
- package/src/components/table/advance/SearchArea.vue +355 -355
- package/src/components/tool/AStepItem.vue +60 -60
- package/src/components/tool/AvatarList.vue +68 -68
- package/src/components/tool/Drawer.vue +142 -142
- package/src/components/tool/TagSelect.vue +83 -83
- package/src/components/transition/PageToggleTransition.vue +97 -97
- package/src/config/CreateQueryConfig.js +307 -307
- package/src/config/default/admin.config.js +18 -18
- package/src/config/default/setting.config.js +4 -2
- package/src/config/replacer/resolve.config.js +67 -67
- package/src/layouts/CommonLayout.vue +42 -42
- package/src/layouts/ComponentLayoutOne.vue +47 -47
- package/src/layouts/PageLayout.vue +151 -151
- package/src/layouts/SinglePageView.vue +116 -116
- package/src/layouts/footer/PageFooter.vue +49 -49
- package/src/layouts/header/AdminHeader.vue +134 -134
- package/src/layouts/header/HeaderAvatar.vue +64 -64
- package/src/layouts/header/HeaderNotice.vue +176 -176
- package/src/layouts/header/HeaderSearch.vue +67 -67
- package/src/layouts/header/InstitutionDetail.vue +181 -181
- package/src/layouts/header/index.less +92 -92
- package/src/layouts/tabs/TabsHead.vue +190 -190
- package/src/layouts/tabs/TabsView.vue +379 -379
- package/src/lib.js +1 -0
- package/src/mock/goods/index.js +108 -108
- package/src/pages/CreateQueryPage.vue +84 -84
- package/src/pages/login/Login.vue +369 -369
- package/src/pages/report/ReportTable.js +124 -124
- package/src/pages/report/ReportTableHome.vue +28 -28
- package/src/pages/resourceManage/orgListManage.vue +98 -98
- package/src/pages/system/dictionary/index.vue +43 -43
- package/src/pages/system/file/index.vue +317 -317
- package/src/pages/system/monitor/loginInfor/index.vue +36 -36
- package/src/pages/system/monitor/operLog/index.vue +36 -36
- package/src/pages/system/settings/index.vue +126 -126
- package/src/pages/system/settings/modifyPassword.vue +109 -109
- package/src/router/async/config.async.js +28 -28
- package/src/router/async/router.map.js +66 -66
- package/src/router/guards.js +52 -12
- package/src/router/index.js +27 -27
- package/src/services/api/DictionaryDetailsViewApi.js +6 -6
- package/src/services/api/LogDetailsViewApi.js +10 -10
- package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
- package/src/services/api/TicketDetailsViewApi.js +34 -34
- package/src/services/api/cas.js +79 -79
- package/src/services/api/common.js +137 -137
- package/src/services/api/commonTempTable.js +10 -10
- package/src/services/api/index.js +17 -17
- package/src/services/api/logininfor/index.js +6 -6
- package/src/services/api/manage.js +8 -8
- package/src/services/apiService.js +14 -14
- package/src/services/user.js +67 -67
- package/src/store/modules/index.js +4 -4
- package/src/theme/default/nprogress.less +76 -76
- package/src/theme/default/style.less +58 -58
- package/src/utils/EncryptUtil.js +53 -53
- package/src/utils/colors.js +107 -107
- package/src/utils/excel/Blob.js +180 -180
- package/src/utils/excel/Export2Excel.js +141 -141
- package/src/utils/formatter.js +68 -68
- package/src/utils/i18n.js +80 -80
- package/src/utils/login.js +138 -0
- package/src/utils/map-utils.js +37 -37
- package/src/utils/theme-color-replacer-extend.js +91 -91
- package/src/utils/themeUtil.js +100 -100
- package/src/utils/util.js +230 -230
- package/vue.config.js +106 -106
|
@@ -1,344 +1,356 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<a-skeleton :loading="loading" :paragraph="{ rows: 4 }" />
|
|
4
|
-
<div v-show="!loading">
|
|
5
|
-
<x-add-form
|
|
6
|
-
ref="xAddForm"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
:
|
|
20
|
-
:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
@
|
|
24
|
-
@
|
|
25
|
-
@
|
|
26
|
-
@
|
|
27
|
-
@
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
</
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
serviceName: res.serviceName
|
|
217
|
-
})
|
|
218
|
-
this.$refs.
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
//
|
|
235
|
-
this.$
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
this
|
|
257
|
-
|
|
258
|
-
this.$
|
|
259
|
-
}).
|
|
260
|
-
|
|
261
|
-
})
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
*
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
*
|
|
275
|
-
* @param
|
|
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
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
*
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<a-skeleton :loading="loading" :paragraph="{ rows: 4 }" />
|
|
4
|
+
<div v-show="!loading">
|
|
5
|
+
<x-add-form
|
|
6
|
+
ref="xAddForm"
|
|
7
|
+
@onSubmit="onAddOrEditSubmit"
|
|
8
|
+
/>
|
|
9
|
+
<x-form
|
|
10
|
+
ref="xForm"
|
|
11
|
+
style="margin-bottom: 14px;"
|
|
12
|
+
@onSubmit="onSearchSubmit">
|
|
13
|
+
<slot name="formBtnExpand"></slot>
|
|
14
|
+
</x-form>
|
|
15
|
+
<x-table
|
|
16
|
+
ref="xTable"
|
|
17
|
+
:fixedQueryForm="fixedQueryForm"
|
|
18
|
+
:queryParamsName="queryParamsName"
|
|
19
|
+
:query-params-json="queryParamsJson"
|
|
20
|
+
:show-pagination="showPagination"
|
|
21
|
+
@add="add"
|
|
22
|
+
@edit="edit"
|
|
23
|
+
@afterDelete="afterDelete"
|
|
24
|
+
@action="action"
|
|
25
|
+
@selectRow="selectRow"
|
|
26
|
+
@afterQuery="afterQuery"
|
|
27
|
+
@tempTableEdit="tempTableEdit">
|
|
28
|
+
<template slot="leftButton" slot-scope="{selectedRowKeys, selectedRows}">
|
|
29
|
+
<slot name="leftButton" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
30
|
+
</template>
|
|
31
|
+
<template slot="button" slot-scope="{selectedRowKeys, selectedRows}">
|
|
32
|
+
<slot name="button" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
33
|
+
</template>
|
|
34
|
+
<template slot="rightBtnExpand" slot-scope="{selectedRowKeys, selectedRows}">
|
|
35
|
+
<slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
36
|
+
<a-button @click="toggleIsFormShow">
|
|
37
|
+
<a-icon :style="iconStyle" type="vertical-align-top"/>
|
|
38
|
+
</a-button>
|
|
39
|
+
</template>
|
|
40
|
+
<!-- 底部插槽 -->
|
|
41
|
+
<template slot="footer" slot-scope="{selectedRowKeys, selectedRows}">
|
|
42
|
+
<slot name="footer" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
43
|
+
</template>
|
|
44
|
+
</x-table>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
<script>
|
|
49
|
+
import XForm from '@vue2-client/base-client/components/common/XForm'
|
|
50
|
+
import XAddForm from '@vue2-client/base-client/components/common/XAddForm'
|
|
51
|
+
import XTable from '@vue2-client/base-client/components/common/XTable'
|
|
52
|
+
import XImportExcel from '@vue2-client/base-client/components/common/XImportExcel'
|
|
53
|
+
import { addOrModify, getConfigUrl } from '@vue2-client/services/api/common'
|
|
54
|
+
import { indexedDB } from '@vue2-client/utils/indexedDB'
|
|
55
|
+
import { mapState } from 'vuex'
|
|
56
|
+
import { post } from '@vue2-client/services/api/restTools'
|
|
57
|
+
|
|
58
|
+
export default {
|
|
59
|
+
name: 'XFormTable',
|
|
60
|
+
components: {
|
|
61
|
+
XTable,
|
|
62
|
+
XForm,
|
|
63
|
+
XAddForm,
|
|
64
|
+
XImportExcel
|
|
65
|
+
},
|
|
66
|
+
data () {
|
|
67
|
+
return {
|
|
68
|
+
// 加载状态
|
|
69
|
+
loading: false,
|
|
70
|
+
// 图标样式
|
|
71
|
+
iconStyle: {
|
|
72
|
+
position: 'relative',
|
|
73
|
+
top: '1px'
|
|
74
|
+
},
|
|
75
|
+
// 实际查询配置内容
|
|
76
|
+
realQueryConfig: {}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
computed: {
|
|
80
|
+
...mapState('setting', ['isMobile'])
|
|
81
|
+
},
|
|
82
|
+
props: {
|
|
83
|
+
// 业务名称
|
|
84
|
+
title: {
|
|
85
|
+
type: String,
|
|
86
|
+
default: ''
|
|
87
|
+
},
|
|
88
|
+
// 查询配置文件名
|
|
89
|
+
queryParamsName: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: null
|
|
92
|
+
},
|
|
93
|
+
// 配置所属命名空间
|
|
94
|
+
serviceName: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: undefined
|
|
97
|
+
},
|
|
98
|
+
// 查询配置文件Json,用于查询配置生成器的预览
|
|
99
|
+
queryParamsJson: {
|
|
100
|
+
type: Object,
|
|
101
|
+
default: null
|
|
102
|
+
},
|
|
103
|
+
// 业务逻辑名称, 通过logic获取表单表格配置
|
|
104
|
+
logicName: {
|
|
105
|
+
type: String,
|
|
106
|
+
default: null
|
|
107
|
+
},
|
|
108
|
+
// 执行logic传递的参数
|
|
109
|
+
logicParam: {
|
|
110
|
+
type: Object,
|
|
111
|
+
default: () => {}
|
|
112
|
+
},
|
|
113
|
+
// 固定新增表单
|
|
114
|
+
fixedAddForm: {
|
|
115
|
+
type: Object,
|
|
116
|
+
default: () => {
|
|
117
|
+
return {}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
// 固定查询表单
|
|
121
|
+
fixedQueryForm: {
|
|
122
|
+
type: Object,
|
|
123
|
+
default: () => {
|
|
124
|
+
return {}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
// 预览模式
|
|
128
|
+
viewMode: {
|
|
129
|
+
type: Boolean,
|
|
130
|
+
default: () => {
|
|
131
|
+
return false
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
// 数据只有一页时是否展示分页,true:展示,auto:隐藏
|
|
135
|
+
showPagination: {
|
|
136
|
+
type: Boolean,
|
|
137
|
+
default: true
|
|
138
|
+
},
|
|
139
|
+
// 调用logic获取数据源的追加参数
|
|
140
|
+
getDataParams: {
|
|
141
|
+
type: Object,
|
|
142
|
+
default: undefined
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
watch: {
|
|
146
|
+
logicParam: {
|
|
147
|
+
handler () {
|
|
148
|
+
this.getColumnJsonByLogic()
|
|
149
|
+
},
|
|
150
|
+
deep: true
|
|
151
|
+
},
|
|
152
|
+
fixedQueryForm: {
|
|
153
|
+
handler () {
|
|
154
|
+
this.$nextTick(() => {
|
|
155
|
+
this.refreshTable(true)
|
|
156
|
+
})
|
|
157
|
+
},
|
|
158
|
+
deep: true
|
|
159
|
+
},
|
|
160
|
+
queryParamsJson: {
|
|
161
|
+
handler () {
|
|
162
|
+
this.getColumnsJsonBySource()
|
|
163
|
+
},
|
|
164
|
+
deep: true
|
|
165
|
+
},
|
|
166
|
+
queryParamsName: {
|
|
167
|
+
handler () {
|
|
168
|
+
this.getColumnsJson()
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
created () {
|
|
173
|
+
if (this.queryParamsName) {
|
|
174
|
+
this.getColumnsJson()
|
|
175
|
+
} else if (this.queryParamsJson) {
|
|
176
|
+
this.getColumnsJsonBySource()
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
methods: {
|
|
180
|
+
getColumnsJson () {
|
|
181
|
+
this.loading = true
|
|
182
|
+
const url = getConfigUrl(this.serviceName)
|
|
183
|
+
indexedDB.getByWeb(this.queryParamsName, url, { configName: this.queryParamsName }, (res) => {
|
|
184
|
+
this.updateComponents(res)
|
|
185
|
+
})
|
|
186
|
+
},
|
|
187
|
+
getColumnsJsonBySource () {
|
|
188
|
+
this.loading = true
|
|
189
|
+
const url = getConfigUrl(this.serviceName)
|
|
190
|
+
post(url, { queryObject: this.queryParamsJson }).then(res => {
|
|
191
|
+
this.updateComponents(res, true)
|
|
192
|
+
})
|
|
193
|
+
},
|
|
194
|
+
getColumnJsonByLogic () {
|
|
195
|
+
this.loading = true
|
|
196
|
+
const url = getConfigUrl(this.serviceName)
|
|
197
|
+
indexedDB.getByWeb(`${this.logicName}_${JSON.stringify(this.logicParam)}`, url, { logic: this.logicName, logicParam: this.logicParam }, (res) => {
|
|
198
|
+
this.updateComponents(res, true)
|
|
199
|
+
})
|
|
200
|
+
},
|
|
201
|
+
/**
|
|
202
|
+
* 更新子组件
|
|
203
|
+
* @param res 参数
|
|
204
|
+
* @param setQueryParams 是否设置queryParams参数
|
|
205
|
+
*/
|
|
206
|
+
updateComponents (res, setQueryParams) {
|
|
207
|
+
this.realQueryConfig = res
|
|
208
|
+
if (this.$refs.xTable && this.$refs.xForm && this.$refs.xAddForm) {
|
|
209
|
+
this.$refs.xTable.init({
|
|
210
|
+
queryParams: setQueryParams ? res : null,
|
|
211
|
+
tableColumns: res.columnJson,
|
|
212
|
+
buttonState: res.buttonState,
|
|
213
|
+
title: this.title,
|
|
214
|
+
viewMode: this.viewMode,
|
|
215
|
+
isTableTemp: this.isTableTemp,
|
|
216
|
+
serviceName: res.serviceName
|
|
217
|
+
})
|
|
218
|
+
this.$refs.xForm.init({
|
|
219
|
+
formItems: res.formJson,
|
|
220
|
+
serviceName: res.serviceName,
|
|
221
|
+
getDataParams: this.getDataParams
|
|
222
|
+
})
|
|
223
|
+
}
|
|
224
|
+
this.loading = false
|
|
225
|
+
},
|
|
226
|
+
/**
|
|
227
|
+
* 提交查询表单事件
|
|
228
|
+
* @param res 参数
|
|
229
|
+
*/
|
|
230
|
+
onSearchSubmit (res) {
|
|
231
|
+
if (res.valid) {
|
|
232
|
+
// 表单赋值
|
|
233
|
+
this.$refs.xTable.setQueryForm(res.form)
|
|
234
|
+
// commit
|
|
235
|
+
this.$emit('afterSearchSubmit', res)
|
|
236
|
+
} else {
|
|
237
|
+
return false
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
/**
|
|
241
|
+
* 提交新增表单事件
|
|
242
|
+
*/
|
|
243
|
+
onAddOrEditSubmit (res, callback) {
|
|
244
|
+
// 组织请求
|
|
245
|
+
const requestParameters = {
|
|
246
|
+
queryParamsName: this.queryParamsName,
|
|
247
|
+
queryParams: this.queryParamsJson,
|
|
248
|
+
form: res.realForm,
|
|
249
|
+
businessType: res.businessType,
|
|
250
|
+
operator: res.currUserName
|
|
251
|
+
}
|
|
252
|
+
addOrModify(requestParameters, res.serviceName).then(data => {
|
|
253
|
+
this.$message.success(res.businessType + '成功!')
|
|
254
|
+
this.refreshTable(res.businessType === '新增')
|
|
255
|
+
// commit
|
|
256
|
+
this.$emit('afterSubmit', { type: res.businessType, id: data.id, form: requestParameters.form })
|
|
257
|
+
}).catch(e => {
|
|
258
|
+
this.$message.error(res.businessType + '失败:' + e)
|
|
259
|
+
}).finally(() => {
|
|
260
|
+
callback()
|
|
261
|
+
})
|
|
262
|
+
},
|
|
263
|
+
/**
|
|
264
|
+
* 表格查询后事件
|
|
265
|
+
* @param res 参数
|
|
266
|
+
* @param conditionParams 查询条件
|
|
267
|
+
*/
|
|
268
|
+
afterQuery (res, conditionParams) {
|
|
269
|
+
this.$emit('afterQuery', res, conditionParams)
|
|
270
|
+
},
|
|
271
|
+
/**
|
|
272
|
+
* 详情按钮事件
|
|
273
|
+
* @param record 本条数据
|
|
274
|
+
* @param id 数据标识
|
|
275
|
+
* @param actionType 操作类型
|
|
276
|
+
*/
|
|
277
|
+
action (record, id, actionType) {
|
|
278
|
+
this.$emit('action', record, id, actionType)
|
|
279
|
+
},
|
|
280
|
+
/**
|
|
281
|
+
* 新增按钮事件
|
|
282
|
+
*/
|
|
283
|
+
add () {
|
|
284
|
+
const res = this.realQueryConfig
|
|
285
|
+
this.$refs.xAddForm.init({
|
|
286
|
+
businessType: '新增',
|
|
287
|
+
title: this.title,
|
|
288
|
+
isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
|
|
289
|
+
formItems: res.formJson,
|
|
290
|
+
viewMode: this.viewMode,
|
|
291
|
+
isTableTemp: this.isTableTemp,
|
|
292
|
+
serviceName: res.serviceName,
|
|
293
|
+
fixedAddForm: this.fixedAddForm,
|
|
294
|
+
getDataParams: this.getDataParams
|
|
295
|
+
})
|
|
296
|
+
},
|
|
297
|
+
/**
|
|
298
|
+
* 修改按钮事件
|
|
299
|
+
* @param modifyModelData 修改表单数据
|
|
300
|
+
*/
|
|
301
|
+
edit (modifyModelData) {
|
|
302
|
+
const res = this.realQueryConfig
|
|
303
|
+
this.$refs.xAddForm.init({
|
|
304
|
+
businessType: '修改',
|
|
305
|
+
title: this.title,
|
|
306
|
+
isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
|
|
307
|
+
formItems: res.formJson,
|
|
308
|
+
viewMode: this.viewMode,
|
|
309
|
+
isTableTemp: this.isTableTemp,
|
|
310
|
+
serviceName: res.serviceName,
|
|
311
|
+
fixedAddForm: this.fixedAddForm,
|
|
312
|
+
getDataParams: this.getDataParams,
|
|
313
|
+
modifyModelData: modifyModelData
|
|
314
|
+
})
|
|
315
|
+
},
|
|
316
|
+
/**
|
|
317
|
+
* 删除后事件
|
|
318
|
+
* @param res
|
|
319
|
+
*/
|
|
320
|
+
afterDelete (res) {
|
|
321
|
+
this.$emit('afterDelete', res)
|
|
322
|
+
},
|
|
323
|
+
/**
|
|
324
|
+
* 查询表单部分显示/隐藏切换
|
|
325
|
+
*/
|
|
326
|
+
toggleIsFormShow () {
|
|
327
|
+
this.$refs.xForm.toggleVisible()
|
|
328
|
+
},
|
|
329
|
+
/**
|
|
330
|
+
* 选择列事件
|
|
331
|
+
* @param selectedRowKeys 选中列Key集合
|
|
332
|
+
* @param selectedRows 选中列
|
|
333
|
+
*/
|
|
334
|
+
selectRow (selectedRowKeys, selectedRows) {
|
|
335
|
+
this.$emit('selectRow', selectedRowKeys, selectedRows)
|
|
336
|
+
},
|
|
337
|
+
/**
|
|
338
|
+
* 临时表修改
|
|
339
|
+
* @param res 参数
|
|
340
|
+
*/
|
|
341
|
+
tempTableEdit (res) {
|
|
342
|
+
this.$emit('tempTableEdit', res)
|
|
343
|
+
},
|
|
344
|
+
/**
|
|
345
|
+
* 刷新表格
|
|
346
|
+
* @param toFirstPage 是否到第一页
|
|
347
|
+
*/
|
|
348
|
+
refreshTable (toFirstPage = true) {
|
|
349
|
+
this.$refs.xTable.refresh(toFirstPage)
|
|
350
|
+
},
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
</script>
|
|
354
|
+
<style lang="less" scoped>
|
|
355
|
+
|
|
356
|
+
</style>
|