vue2-client 1.4.64 → 1.5.0
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 +11 -0
- package/package.json +1 -1
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +602 -601
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +713 -782
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +436 -310
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +508 -553
- package/src/base-client/components/common/XAddForm/XAddForm.vue +325 -354
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +24 -74
- package/src/base-client/components/common/XForm/XForm.vue +25 -114
- package/src/base-client/components/common/XForm/XFormItem.vue +485 -538
- package/src/base-client/components/common/XForm/index.md +177 -196
- package/src/base-client/components/common/XFormTable/XFormTable.vue +143 -418
- package/src/base-client/components/common/XTable/XTable.vue +504 -262
- package/src/components/STable/index.js +1 -1
- package/src/config/CreateQueryConfig.js +307 -313
- package/src/layouts/SinglePageView.vue +1 -1
- package/src/layouts/header/HeaderAvatar.vue +61 -60
- package/src/pages/login/Login.vue +48 -33
- package/src/router/guards.js +11 -2
- package/src/utils/indexedDB.js +145 -146
- package/vue.config.js +106 -111
|
@@ -1,98 +1,53 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
<a-button
|
|
42
|
-
v-if="!buttonState || buttonState.edit"
|
|
43
|
-
:disabled="!isModify"
|
|
44
|
-
:loading="editDataLoading"
|
|
45
|
-
class="btn-success"
|
|
46
|
-
type="dashed"
|
|
47
|
-
@click="editItem()">
|
|
48
|
-
<a-icon :style="iconStyle" type="edit"/>修改
|
|
49
|
-
</a-button>
|
|
50
|
-
<a-button v-if="!buttonState || buttonState.delete" :disabled="!isDelete" type="danger" @click="deleteItem">
|
|
51
|
-
<a-icon :style="iconStyle" type="delete"/>删除
|
|
52
|
-
</a-button>
|
|
53
|
-
<a-button v-if="!buttonState || buttonState.import" type="dashed" @click="$refs.importExcel.importExcelHandleOpen()">
|
|
54
|
-
<a-icon :style="iconStyle" type="import" />导入
|
|
55
|
-
</a-button>
|
|
56
|
-
<a-dropdown v-if="!buttonState || buttonState.export">
|
|
57
|
-
<a-menu slot="overlay">
|
|
58
|
-
<a-menu-item :disabled="selectedRowKeys.length === 0" key="1" @click="handleExport(true)"><a-icon :style="iconStyle" type="ordered-list" />导出选中数据</a-menu-item>
|
|
59
|
-
<a-menu-item key="2" @click="handleExport(false)"><a-icon :style="iconStyle" type="snippets" />导出本页数据</a-menu-item>
|
|
60
|
-
<a-menu-item key="3" @click="handleExportByQuery"><a-icon :style="iconStyle" type="download" />导出所有符合条件的数据</a-menu-item>
|
|
61
|
-
</a-menu>
|
|
62
|
-
<a-button>导出 <a-icon type="down" /> </a-button>
|
|
63
|
-
</a-dropdown>
|
|
64
|
-
<slot :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows" name="button"></slot>
|
|
65
|
-
</a-space>
|
|
66
|
-
<slot name="expand"></slot>
|
|
67
|
-
</template>
|
|
68
|
-
<!-- 底部插槽 -->
|
|
69
|
-
<template slot="footer">
|
|
70
|
-
<slot name="footer"></slot>
|
|
71
|
-
</template>
|
|
72
|
-
</x-table>
|
|
73
|
-
<!-- 上传文件 -->
|
|
74
|
-
<x-import-excel
|
|
75
|
-
ref="importExcel"
|
|
76
|
-
@ok="refreshTable"
|
|
77
|
-
:title="title"
|
|
78
|
-
:service-name="serviceName"
|
|
79
|
-
:query-params-name="queryParamsName"
|
|
80
|
-
/>
|
|
81
|
-
</template>
|
|
82
|
-
</a-skeleton>
|
|
2
|
+
<div>
|
|
3
|
+
<x-add-form
|
|
4
|
+
ref="xAddForm"
|
|
5
|
+
@afterSubmit="afterAddOrEditSubmit"
|
|
6
|
+
/>
|
|
7
|
+
<x-form
|
|
8
|
+
ref="xForm"
|
|
9
|
+
style="margin-bottom: 14px;"
|
|
10
|
+
@onSubmit="onSearchSubmit">
|
|
11
|
+
<slot></slot>
|
|
12
|
+
</x-form>
|
|
13
|
+
<x-table
|
|
14
|
+
ref="xTable"
|
|
15
|
+
:fixedQueryForm="fixedQueryForm"
|
|
16
|
+
:queryParamsName="queryParamsName"
|
|
17
|
+
:query-params-json="queryParamsJson"
|
|
18
|
+
:show-pagination="showPagination"
|
|
19
|
+
@add="add"
|
|
20
|
+
@edit="edit"
|
|
21
|
+
@afterDelete="afterDelete"
|
|
22
|
+
@action="action"
|
|
23
|
+
@selectRow="selectRow"
|
|
24
|
+
@afterQuery="afterQuery"
|
|
25
|
+
@tempTableEdit="tempTableEdit">
|
|
26
|
+
<template slot="expand">
|
|
27
|
+
<slot name="expand"></slot>
|
|
28
|
+
</template>
|
|
29
|
+
<template slot="rightBtnExpand">
|
|
30
|
+
<slot name="rightBtnExpand"></slot>
|
|
31
|
+
<a-button @click="toggleIsFormShow">
|
|
32
|
+
<a-icon :style="iconStyle" type="vertical-align-top"/>
|
|
33
|
+
</a-button>
|
|
34
|
+
</template>
|
|
35
|
+
<!-- 底部插槽 -->
|
|
36
|
+
<template slot="footer">
|
|
37
|
+
<slot name="footer"></slot>
|
|
38
|
+
</template>
|
|
39
|
+
</x-table>
|
|
40
|
+
</div>
|
|
83
41
|
</template>
|
|
84
42
|
<script>
|
|
85
43
|
import XForm from '@vue2-client/base-client/components/common/XForm'
|
|
86
44
|
import XAddForm from '@vue2-client/base-client/components/common/XAddForm'
|
|
87
45
|
import XTable from '@vue2-client/base-client/components/common/XTable'
|
|
88
46
|
import XImportExcel from '@vue2-client/base-client/components/common/XImportExcel'
|
|
89
|
-
import {
|
|
47
|
+
import { commonApi } from '@vue2-client/services/api/common'
|
|
90
48
|
import { indexedDB } from '@vue2-client/utils/indexedDB'
|
|
91
49
|
import { mapState } from 'vuex'
|
|
92
|
-
import { Modal } from 'ant-design-vue'
|
|
93
50
|
import { post } from '@vue2-client/services/api/restTools'
|
|
94
|
-
import { CommonTempTable } from '@vue2-client/services/api/commonTempTable'
|
|
95
|
-
import { exportJson } from '@vue2-client/utils/excel/Export2Excel'
|
|
96
51
|
|
|
97
52
|
export default {
|
|
98
53
|
name: 'XFormTable',
|
|
@@ -104,59 +59,15 @@ export default {
|
|
|
104
59
|
},
|
|
105
60
|
data () {
|
|
106
61
|
return {
|
|
107
|
-
// Query参数文件内容加载中
|
|
108
|
-
mainLoading: false,
|
|
109
|
-
// Query参数文件内容加载完成
|
|
110
|
-
loaded: false,
|
|
111
|
-
// 是否展示表单
|
|
112
|
-
isFormShow: true,
|
|
113
|
-
// 当使用logic获取到表单表格配置时, 将配置对象直接传入到x-table用于查询
|
|
114
|
-
queryParams: null,
|
|
115
|
-
// 服务名称
|
|
116
|
-
serviceName: 'af-system',
|
|
117
|
-
// 表格列集合
|
|
118
|
-
tableColumns: [],
|
|
119
|
-
// 操作按钮集合
|
|
120
|
-
buttonState: {},
|
|
121
|
-
// 表格选择列Key集合
|
|
122
|
-
selectedRowKeys: [],
|
|
123
|
-
// 表格选择Row集合
|
|
124
|
-
selectedRows: [],
|
|
125
|
-
// 选中用于修改的id
|
|
126
|
-
selectId: undefined,
|
|
127
|
-
// 表单项集合
|
|
128
|
-
formItems: [],
|
|
129
|
-
// 表单
|
|
130
|
-
form: {},
|
|
131
62
|
// 图标样式
|
|
132
63
|
iconStyle: {
|
|
133
64
|
position: 'relative',
|
|
134
65
|
top: '1px'
|
|
135
|
-
}
|
|
136
|
-
// 当前业务类型:新增,修改
|
|
137
|
-
businessType: '',
|
|
138
|
-
// 是否显示新增/修改模态框
|
|
139
|
-
modelVisible: false,
|
|
140
|
-
// 修改业务时查询的单条业务数据
|
|
141
|
-
modifyModelData: {},
|
|
142
|
-
// 是否允许修改
|
|
143
|
-
isModify: false,
|
|
144
|
-
// 是否允许删除
|
|
145
|
-
isDelete: false,
|
|
146
|
-
// 新增,修改业务执行状态
|
|
147
|
-
loading: false,
|
|
148
|
-
// 被修改数据加载状态
|
|
149
|
-
editDataLoading: false,
|
|
150
|
-
// 是否为临时表
|
|
151
|
-
isTableTemp: false
|
|
66
|
+
}
|
|
152
67
|
}
|
|
153
68
|
},
|
|
154
69
|
computed: {
|
|
155
|
-
...mapState('
|
|
156
|
-
...mapState('setting', ['isMobile']),
|
|
157
|
-
businessTitle () {
|
|
158
|
-
return this.businessType + this.title
|
|
159
|
-
}
|
|
70
|
+
...mapState('setting', ['isMobile'])
|
|
160
71
|
},
|
|
161
72
|
props: {
|
|
162
73
|
// 业务名称
|
|
@@ -220,7 +131,7 @@ export default {
|
|
|
220
131
|
},
|
|
221
132
|
fixedQueryForm: {
|
|
222
133
|
handler () {
|
|
223
|
-
this.
|
|
134
|
+
this.$refs.xTable.refresh(true)
|
|
224
135
|
},
|
|
225
136
|
deep: true
|
|
226
137
|
},
|
|
@@ -244,322 +155,136 @@ export default {
|
|
|
244
155
|
}
|
|
245
156
|
},
|
|
246
157
|
methods: {
|
|
247
|
-
refreshTable (toFirstPage = true) {
|
|
248
|
-
this.$refs.xTable.refresh(toFirstPage)
|
|
249
|
-
},
|
|
250
|
-
clearRowKeys () {
|
|
251
|
-
this.$refs.xTable.clearRowKeys()
|
|
252
|
-
},
|
|
253
|
-
setParams (res) {
|
|
254
|
-
// 深拷贝json,避免筛选列报错
|
|
255
|
-
this.tableColumns = JSON.parse(JSON.stringify(res.columnJson))
|
|
256
|
-
this.formItems = res.formJson
|
|
257
|
-
this.buttonState = res.buttonState
|
|
258
|
-
this.serviceName = res.serviceName
|
|
259
|
-
this.mainLoading = false
|
|
260
|
-
this.loaded = true
|
|
261
|
-
},
|
|
262
158
|
getColumnsJson () {
|
|
263
|
-
this.
|
|
264
|
-
|
|
265
|
-
indexedDB.getByWeb(this.queryParamsName, commonApi.getColumnsJson, { str: this.queryParamsName }, (ret) => {
|
|
266
|
-
this.setParams(ret)
|
|
159
|
+
indexedDB.getByWeb(this.queryParamsName, commonApi.getColumnsJson, { str: this.queryParamsName }, (res) => {
|
|
160
|
+
this.updateComponents(res)
|
|
267
161
|
})
|
|
268
162
|
},
|
|
269
163
|
getColumnsJsonBySource () {
|
|
270
|
-
this.form = {}
|
|
271
|
-
this.mainLoading = true
|
|
272
164
|
post(commonApi.getColumnsJson, { queryObject: this.queryParamsJson }).then(res => {
|
|
273
|
-
this.
|
|
274
|
-
this.setParams(res)
|
|
165
|
+
this.updateComponents(res)
|
|
275
166
|
})
|
|
276
167
|
},
|
|
277
168
|
getColumnJsonByLogic () {
|
|
278
|
-
this.
|
|
279
|
-
|
|
280
|
-
indexedDB.getByWeb(`${this.logicName}_${JSON.stringify(this.logicParam)}`, commonApi.getColumnsJson, { logic: this.logicName, logicParam: this.logicParam }, (ret) => {
|
|
281
|
-
this.queryParams = ret
|
|
282
|
-
this.setParams(ret)
|
|
169
|
+
indexedDB.getByWeb(`${this.logicName}_${JSON.stringify(this.logicParam)}`, commonApi.getColumnsJson, { logic: this.logicName, logicParam: this.logicParam }, (res) => {
|
|
170
|
+
this.updateComponents(res)
|
|
283
171
|
})
|
|
284
172
|
},
|
|
285
|
-
|
|
286
|
-
|
|
173
|
+
/**
|
|
174
|
+
* 更新子组件
|
|
175
|
+
* @param res 参数
|
|
176
|
+
*/
|
|
177
|
+
updateComponents (res) {
|
|
178
|
+
this.$refs.xTable.init({
|
|
179
|
+
queryParams: res,
|
|
180
|
+
tableColumns: res.columnJson,
|
|
181
|
+
buttonState: res.buttonState,
|
|
182
|
+
title: this.title,
|
|
183
|
+
viewMode: this.viewMode,
|
|
184
|
+
isTableTemp: this.isTableTemp,
|
|
185
|
+
serviceName: res.serviceName
|
|
186
|
+
})
|
|
187
|
+
this.$refs.xForm.init({
|
|
188
|
+
formItems: res.formJson,
|
|
189
|
+
serviceName: res.serviceName
|
|
190
|
+
})
|
|
191
|
+
this.$refs.xAddForm.init({
|
|
192
|
+
isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
|
|
193
|
+
formItems: res.formJson,
|
|
194
|
+
viewMode: this.viewMode,
|
|
195
|
+
isTableTemp: this.isTableTemp,
|
|
196
|
+
queryParamsName: this.queryParamsName,
|
|
197
|
+
serviceName: res.serviceName
|
|
198
|
+
})
|
|
199
|
+
},
|
|
200
|
+
/**
|
|
201
|
+
* 提交查询表单事件
|
|
202
|
+
* @param res 参数
|
|
203
|
+
*/
|
|
204
|
+
onSearchSubmit (res) {
|
|
287
205
|
if (res.valid) {
|
|
288
206
|
// 表单赋值
|
|
289
|
-
this.
|
|
207
|
+
this.$refs.xTable.setQueryForm(res.form, true)
|
|
290
208
|
// commit
|
|
291
209
|
this.$emit('afterSearchSubmit', res)
|
|
292
210
|
} else {
|
|
293
211
|
return false
|
|
294
212
|
}
|
|
295
213
|
},
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
317
|
-
if (this.businessType === '修改') {
|
|
318
|
-
// 将更新需要的主键值加入到表单中
|
|
319
|
-
const key = this.tableColumns[0].dataIndex
|
|
320
|
-
const realKey = this.getRealKey(key)
|
|
321
|
-
requestParameters.form[realKey] = this.selectId
|
|
322
|
-
}
|
|
323
|
-
for (const key of Object.keys(res.form)) {
|
|
324
|
-
const realKey = this.getRealKey(key)
|
|
325
|
-
requestParameters.form[realKey] = res.form[key]
|
|
326
|
-
}
|
|
327
|
-
addOrModify(requestParameters, this.serviceName).then(res => {
|
|
328
|
-
this.$message.success(this.businessType + '成功!')
|
|
329
|
-
this.loading = false
|
|
330
|
-
this.modelVisible = false
|
|
331
|
-
this.$refs.xTable.refresh(true)
|
|
332
|
-
// commit
|
|
333
|
-
this.$emit('afterSubmit', { type: this.businessType, id: res.id, form: requestParameters.form })
|
|
334
|
-
}).catch(e => {
|
|
335
|
-
this.loading = false
|
|
336
|
-
this.modelVisible = false
|
|
337
|
-
this.$message.error(this.businessType + '失败!')
|
|
338
|
-
})
|
|
339
|
-
},
|
|
340
|
-
// 刷新加载表格数据
|
|
341
|
-
loadData (requestParameters, callback) {
|
|
342
|
-
let result = {}
|
|
343
|
-
if (this.queryParamsJson) {
|
|
344
|
-
if (this.queryParamsJson.tableName.startsWith('##')) {
|
|
345
|
-
this.isTableTemp = true
|
|
346
|
-
result = this.initTempTable(requestParameters)
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
if (!this.isTableTemp) {
|
|
350
|
-
result = query(requestParameters, this.serviceName)
|
|
351
|
-
}
|
|
352
|
-
this.$emit('afterQuery', result)
|
|
353
|
-
callback(result)
|
|
354
|
-
},
|
|
355
|
-
// 详情按钮事件
|
|
214
|
+
/**
|
|
215
|
+
* 新增或修改后事件
|
|
216
|
+
* @param res 参数
|
|
217
|
+
*/
|
|
218
|
+
afterAddOrEditSubmit (res) {
|
|
219
|
+
this.$refs.xTable.refresh(res.type === '新增')
|
|
220
|
+
},
|
|
221
|
+
/**
|
|
222
|
+
* 表格查询后事件
|
|
223
|
+
* @param res 参数
|
|
224
|
+
*/
|
|
225
|
+
afterQuery (res) {
|
|
226
|
+
this.$emit('afterQuery', res)
|
|
227
|
+
},
|
|
228
|
+
/**
|
|
229
|
+
* 详情按钮事件
|
|
230
|
+
* @param record 本条数据
|
|
231
|
+
* @param id 数据标识
|
|
232
|
+
* @param actionType 操作类型
|
|
233
|
+
*/
|
|
356
234
|
action (record, id, actionType) {
|
|
357
235
|
this.$emit('action', record, id, actionType)
|
|
358
236
|
},
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
this.modelVisible = true
|
|
368
|
-
},
|
|
369
|
-
// 修改业务
|
|
370
|
-
editItem (selectId) {
|
|
371
|
-
this.businessType = '修改'
|
|
372
|
-
const requestParameters = {
|
|
373
|
-
queryParamsName: this.queryParamsName,
|
|
374
|
-
conditionParams: {},
|
|
375
|
-
pageNo: 1,
|
|
376
|
-
pageSize: 1
|
|
377
|
-
}
|
|
378
|
-
if (selectId === undefined) {
|
|
379
|
-
selectId = this.selectedRowKeys[0]
|
|
380
|
-
}
|
|
381
|
-
this.selectId = selectId
|
|
382
|
-
requestParameters.conditionParams[this.tableColumns[0].dataIndex] = selectId
|
|
383
|
-
requestParameters.f_businessid = selectId
|
|
384
|
-
if (this.isTableTemp) {
|
|
385
|
-
this.$emit('tempTableEdit', requestParameters)
|
|
386
|
-
return
|
|
387
|
-
}
|
|
388
|
-
this.editDataLoading = true
|
|
389
|
-
queryWithResource(requestParameters, this.serviceName).then(res => {
|
|
390
|
-
this.modifyModelData = { data: res.data[0], images: res.images, files: res.files }
|
|
391
|
-
this.modelVisible = true
|
|
392
|
-
this.editDataLoading = false
|
|
237
|
+
/**
|
|
238
|
+
* 新增按钮事件
|
|
239
|
+
*/
|
|
240
|
+
add () {
|
|
241
|
+
this.$refs.xAddForm.open({
|
|
242
|
+
businessType: '新增',
|
|
243
|
+
title: this.title,
|
|
244
|
+
fixedAddForm: this.fixedAddForm
|
|
393
245
|
})
|
|
394
246
|
},
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
confirmLoading: this.loading,
|
|
405
|
-
zIndex: 1001,
|
|
406
|
-
onOk: () => {
|
|
407
|
-
this.loading = true
|
|
408
|
-
const requestParameters = {
|
|
409
|
-
queryParamsName: this.queryParamsName,
|
|
410
|
-
idList: this.selectedRowKeys
|
|
411
|
-
}
|
|
412
|
-
remove(requestParameters, this.serviceName).then(res => {
|
|
413
|
-
this.loading = false
|
|
414
|
-
this.$message.success('删除成功!')
|
|
415
|
-
this.$refs.xTable.clearRowKeys()
|
|
416
|
-
this.$refs.xTable.refresh(true)
|
|
417
|
-
// afterDelete
|
|
418
|
-
this.$emit('afterDelete', { idList: requestParameters.idList })
|
|
419
|
-
}).catch(e => {
|
|
420
|
-
this.loading = false
|
|
421
|
-
this.$message.error('删除失败!')
|
|
422
|
-
})
|
|
423
|
-
},
|
|
424
|
-
onCancel () {}
|
|
247
|
+
/**
|
|
248
|
+
* 修改按钮事件
|
|
249
|
+
* @param res 参数
|
|
250
|
+
*/
|
|
251
|
+
edit (res) {
|
|
252
|
+
this.$refs.xAddForm.open({
|
|
253
|
+
businessType: '修改',
|
|
254
|
+
modifyModelData: res,
|
|
255
|
+
title: this.title
|
|
425
256
|
})
|
|
426
257
|
},
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
exportData = this.$refs.xTable.selectedRows
|
|
434
|
-
} else {
|
|
435
|
-
exportData = this.$refs.xTable.dataSource
|
|
436
|
-
}
|
|
437
|
-
const data = this.formatJson(filterVal, exportData)
|
|
438
|
-
exportJson(tHeader, data, this.title + `数据_${new Date().toLocaleString()}`)
|
|
439
|
-
},
|
|
440
|
-
formatJson (filterVal, jsonData) {
|
|
441
|
-
return jsonData.map(v => filterVal.map(j => v[j]))
|
|
258
|
+
/**
|
|
259
|
+
* 删除后事件
|
|
260
|
+
* @param res
|
|
261
|
+
*/
|
|
262
|
+
afterDelete (res) {
|
|
263
|
+
this.$emit('afterDelete', res)
|
|
442
264
|
},
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
this.$confirm({
|
|
447
|
-
title: '是否确认导出?',
|
|
448
|
-
content: '此操作将导出当前条件下所有数据而非选中数据',
|
|
449
|
-
onOk () {
|
|
450
|
-
download({
|
|
451
|
-
queryParamsName: that.queryParamsName,
|
|
452
|
-
form: that.form,
|
|
453
|
-
type: 'exportData'
|
|
454
|
-
}, that.title + `数据_${new Date().toLocaleString()}.xlsx`, that.serviceName)
|
|
455
|
-
},
|
|
456
|
-
onCancel () {}
|
|
457
|
-
})
|
|
458
|
-
},
|
|
459
|
-
// 查询表单部分显示/隐藏切换
|
|
265
|
+
/**
|
|
266
|
+
* 查询表单部分显示/隐藏切换
|
|
267
|
+
*/
|
|
460
268
|
toggleIsFormShow () {
|
|
461
|
-
this.
|
|
462
|
-
},
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
this
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
define: define,
|
|
477
|
-
tableName: tableName
|
|
478
|
-
})
|
|
479
|
-
.then(
|
|
480
|
-
res => {
|
|
481
|
-
return res
|
|
482
|
-
},
|
|
483
|
-
err => {
|
|
484
|
-
console.log(err)
|
|
485
|
-
}
|
|
486
|
-
)
|
|
487
|
-
},
|
|
488
|
-
// 插入临时表数据sql生成
|
|
489
|
-
insertTempTableData (defineJson) {
|
|
490
|
-
const tableName = defineJson.tableName
|
|
491
|
-
const params = {}
|
|
492
|
-
params.define = defineJson.column
|
|
493
|
-
params.applyId = defineJson.applyId
|
|
494
|
-
params.stepName = defineJson.stepName
|
|
495
|
-
params.tableName = tableName
|
|
496
|
-
return post(CommonTempTable.insertDataToTempTable, {
|
|
497
|
-
tempTableData: params
|
|
498
|
-
})
|
|
499
|
-
.then(
|
|
500
|
-
res => {
|
|
501
|
-
return res
|
|
502
|
-
}
|
|
503
|
-
)
|
|
504
|
-
},
|
|
505
|
-
// 初始化临时表
|
|
506
|
-
async initTempTable (json) {
|
|
507
|
-
await this.createTempTable(this.queryParamsJson)
|
|
508
|
-
await this.insertTempTableData(this.queryParamsJson)
|
|
509
|
-
let result = {}
|
|
510
|
-
await post(CommonTempTable.initApplySubTable, {
|
|
511
|
-
define: json
|
|
512
|
-
})
|
|
513
|
-
.then(
|
|
514
|
-
res => {
|
|
515
|
-
console.log('子表临时表已创建')
|
|
516
|
-
result = res
|
|
517
|
-
}
|
|
518
|
-
)
|
|
519
|
-
return result
|
|
269
|
+
this.$refs.xForm.toggleVisible()
|
|
270
|
+
},
|
|
271
|
+
/**
|
|
272
|
+
* 选择列事件
|
|
273
|
+
* @param res 参数
|
|
274
|
+
*/
|
|
275
|
+
selectRow (res) {
|
|
276
|
+
this.$emit('selectRow', res)
|
|
277
|
+
},
|
|
278
|
+
/**
|
|
279
|
+
* 临时表修改
|
|
280
|
+
* @param res 参数
|
|
281
|
+
*/
|
|
282
|
+
tempTableEdit (res) {
|
|
283
|
+
this.$emit('tempTableEdit', res)
|
|
520
284
|
}
|
|
521
285
|
}
|
|
522
286
|
}
|
|
523
287
|
</script>
|
|
524
288
|
<style lang="less" scoped>
|
|
525
|
-
|
|
526
|
-
color: #ffffff;
|
|
527
|
-
}
|
|
528
|
-
.btn-success:hover {
|
|
529
|
-
color: #ffffff !important;
|
|
530
|
-
}
|
|
531
|
-
.btn-success:focus {
|
|
532
|
-
color: #ffffff !important;
|
|
533
|
-
}
|
|
534
|
-
.btn-success:enabled:hover {
|
|
535
|
-
background-color: #85CE61 !important;
|
|
536
|
-
border-color: #85CE61 !important;
|
|
537
|
-
}
|
|
538
|
-
.btn-success:enabled {
|
|
539
|
-
background-color: #67c23a;
|
|
540
|
-
border-color: #67c23a;
|
|
541
|
-
}
|
|
542
|
-
.btn-success:disabled {
|
|
543
|
-
color: rgba(0, 0, 0, 0.25);
|
|
544
|
-
}
|
|
545
|
-
.btn-warn {
|
|
546
|
-
color: #ffffff;
|
|
547
|
-
}
|
|
548
|
-
.btn-warn:hover {
|
|
549
|
-
color: #ffffff !important;
|
|
550
|
-
}
|
|
551
|
-
.btn-warn:focus {
|
|
552
|
-
color: #ffffff !important;
|
|
553
|
-
}
|
|
554
|
-
.btn-warn:enabled:hover {
|
|
555
|
-
background-color: #ffc833 !important;
|
|
556
|
-
border-color: #ffc833 !important;
|
|
557
|
-
}
|
|
558
|
-
.btn-warn:enabled {
|
|
559
|
-
background-color: #ffba00;
|
|
560
|
-
border-color: #ffba00;
|
|
561
|
-
}
|
|
562
|
-
.btn-warn:disabled {
|
|
563
|
-
color: rgba(0, 0, 0, 0.25);
|
|
564
|
-
}
|
|
289
|
+
|
|
565
290
|
</style>
|