vue2-client 1.9.174 → 1.9.176
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/package.json +2 -2
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +1 -1
- package/src/base-client/components/common/XAddNativeForm/demo.vue +2 -5
- package/src/base-client/components/common/XFormTable/demo.vue +1 -1
- package/src/base-client/components/common/XTable/ExportExcel.vue +33 -8
- package/src/base-client/components/common/XTable/XTable.vue +55 -34
- package/src/router/async/router.map.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue2-client",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.176",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@hufe921/canvas-editor": "^0.9.49",
|
|
25
25
|
"@vue/babel-preset-jsx": "^1.4.0",
|
|
26
26
|
"@afwenming123/vue-easy-tree": "^1.0.1",
|
|
27
|
-
"@afwenming123/vue-plugin-hiprint": "^0.0.
|
|
27
|
+
"@afwenming123/vue-plugin-hiprint": "^0.0.59",
|
|
28
28
|
"animate.css": "^4.1.1",
|
|
29
29
|
"ant-design-vue": "^1.7.8",
|
|
30
30
|
"axios": "^0.27.2",
|
|
@@ -950,7 +950,7 @@ export default {
|
|
|
950
950
|
if (modifyModelData.data[item.model] instanceof Array) {
|
|
951
951
|
this.form[item.model] = modifyModelData.data[item.model]
|
|
952
952
|
} else {
|
|
953
|
-
this.form[item.model] = modifyModelData.data[item.model]
|
|
953
|
+
this.form[item.model] = modifyModelData.data[item.model]
|
|
954
954
|
}
|
|
955
955
|
}
|
|
956
956
|
}
|
|
@@ -6,14 +6,11 @@ export default {
|
|
|
6
6
|
name: 'Demo',
|
|
7
7
|
components: { XAddNativeForm },
|
|
8
8
|
mounted () {
|
|
9
|
-
getConfigByNameAsync('
|
|
10
|
-
console.log('===res', res)
|
|
9
|
+
getConfigByNameAsync('feeCategories', 'af-his').then(res => {
|
|
11
10
|
this.$refs.xAddFrom.init(Object.assign(res, {
|
|
12
11
|
modifyModelData: {
|
|
13
12
|
data: {
|
|
14
|
-
|
|
15
|
-
f_oxygen_method: '1'
|
|
16
|
-
}
|
|
13
|
+
f_f_type: 2
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
16
|
}))
|
|
@@ -13,13 +13,16 @@ export default {
|
|
|
13
13
|
return {
|
|
14
14
|
// 导出列选择
|
|
15
15
|
exportModalVisible: false,
|
|
16
|
+
summaryLoadingShow: false,
|
|
17
|
+
tipMsg: '正在获取汇总数据。。。',
|
|
16
18
|
exportType: false,
|
|
17
19
|
type: 'export',
|
|
18
20
|
selectedExportColumns: [],
|
|
19
21
|
exportSelectedRows: false,
|
|
20
22
|
allColumnsSelected: false,
|
|
21
23
|
exportFileName: null,
|
|
22
|
-
confirmLoading: null
|
|
24
|
+
confirmLoading: null,
|
|
25
|
+
printData: {}
|
|
23
26
|
}
|
|
24
27
|
},
|
|
25
28
|
inject: ['tableContext'],
|
|
@@ -30,8 +33,9 @@ export default {
|
|
|
30
33
|
this.handle(type)
|
|
31
34
|
},
|
|
32
35
|
// 导出选中或本页数据
|
|
33
|
-
handlePrint (type) {
|
|
36
|
+
handlePrint (type, printData) {
|
|
34
37
|
this.type = 'print'
|
|
38
|
+
this.printData = printData
|
|
35
39
|
this.handle(type)
|
|
36
40
|
},
|
|
37
41
|
handle (type) {
|
|
@@ -80,15 +84,27 @@ export default {
|
|
|
80
84
|
async handlePrintByQuery (tHeader, filterVal) {
|
|
81
85
|
try {
|
|
82
86
|
const requestParameters = this.tableContext.requestParameters
|
|
87
|
+
this.summaryLoadingShow = true
|
|
88
|
+
this.tipMsg = '正在组织数据。。。'
|
|
83
89
|
const res = await queryAll(Object.assign(requestParameters, { userId: this.tableContext.currUser?.id, pageSize: 200 }), this.tableContext.serviceName, this.tableContext.env === 'dev')
|
|
84
90
|
this.handlePrintGen(tHeader, filterVal, res.data)
|
|
85
91
|
} finally {
|
|
86
|
-
|
|
92
|
+
this.confirmLoading = false
|
|
87
93
|
}
|
|
88
94
|
},
|
|
89
95
|
// 获取模板内容
|
|
90
96
|
handlePrintGen (tHeader, filterVal, exportData) {
|
|
91
97
|
getConfigByNameAsync(this.tableContext.printTemplate, this.tableContext.serviceName).then(async res => {
|
|
98
|
+
if (this.printData && this.printData.summary) {
|
|
99
|
+
this.summaryLoadingShow = true
|
|
100
|
+
this.tipMsg = '正在获取汇总数据。。。'
|
|
101
|
+
this.printData.summaryData = {}
|
|
102
|
+
const tempSummary = await this.printData.summary()
|
|
103
|
+
tempSummary.forEach(row => {
|
|
104
|
+
this.printData.summaryData[row.key] = row.value
|
|
105
|
+
})
|
|
106
|
+
this.summaryLoadingShow = false
|
|
107
|
+
}
|
|
92
108
|
// 如果模板中有默认表格 使用当前选中字段替换表格内容
|
|
93
109
|
const crudTableIndex = res.panels[0].printElements.findIndex(h => h.printElementType?.type === 'table' && h.options.field === 'CRUD_TABLE')
|
|
94
110
|
if (crudTableIndex !== -1) {
|
|
@@ -106,7 +122,7 @@ export default {
|
|
|
106
122
|
})]
|
|
107
123
|
}
|
|
108
124
|
this.$nextTick(() => {
|
|
109
|
-
this.$print(undefined, res, { CRUD_TABLE: exportData
|
|
125
|
+
this.$print(undefined, res, { ...this.printData, CRUD_TABLE: exportData }, {}, {
|
|
110
126
|
callback: () => {
|
|
111
127
|
this.confirmLoading = false
|
|
112
128
|
this.closeModal()
|
|
@@ -118,6 +134,9 @@ export default {
|
|
|
118
134
|
}
|
|
119
135
|
})
|
|
120
136
|
})
|
|
137
|
+
}).finally(() => {
|
|
138
|
+
this.confirmLoading = false
|
|
139
|
+
this.summaryLoadingShow = false
|
|
121
140
|
})
|
|
122
141
|
},
|
|
123
142
|
// 导出选中或本页数据
|
|
@@ -154,6 +173,9 @@ export default {
|
|
|
154
173
|
form: conditionParams,
|
|
155
174
|
userId: that.tableContext.currUser.id
|
|
156
175
|
}
|
|
176
|
+
const dateTime = formatDate(new Date(), 'yyyy-MM-dd_hh-mm-ss')
|
|
177
|
+
const fileNamePrefix = that.exportFileName || `${that.tableContext.currUser.username}`
|
|
178
|
+
const name = `${fileNamePrefix}_${dateTime}`
|
|
157
179
|
const param = {
|
|
158
180
|
exportData: defaultExportData,
|
|
159
181
|
asyncExportData: {
|
|
@@ -163,11 +185,11 @@ export default {
|
|
|
163
185
|
// 导出条件
|
|
164
186
|
f_tag1: defaultExportData,
|
|
165
187
|
// 导出文件名
|
|
166
|
-
f_tag2:
|
|
188
|
+
f_tag2: name,
|
|
167
189
|
// 执行数据源
|
|
168
190
|
f_tag3: process.env.VUE_APP_SYSTEM_NAME,
|
|
169
191
|
f_service_name: that.tableContext.serviceName || process.env.VUE_APP_SYSTEM_NAME,
|
|
170
|
-
f_task_name:
|
|
192
|
+
f_task_name: name,
|
|
171
193
|
}
|
|
172
194
|
}
|
|
173
195
|
exportData(param, that.tableContext.serviceName).then(res => {
|
|
@@ -210,7 +232,7 @@ export default {
|
|
|
210
232
|
:destroy-on-close="true"
|
|
211
233
|
@ok="handleGen"
|
|
212
234
|
>
|
|
213
|
-
<a-row type="flex" justify="space-between" style="padding-left: 3rem">
|
|
235
|
+
<a-row type="flex" justify="space-between" style="padding-left: 3rem" v-show="!summaryLoadingShow">
|
|
214
236
|
<a-col :span="8" style="margin-top: 3px">
|
|
215
237
|
<a-checkbox
|
|
216
238
|
:checked="selectedExportColumns.length === tableContext.tableColumns.length"
|
|
@@ -220,7 +242,7 @@ export default {
|
|
|
220
242
|
</a-checkbox>
|
|
221
243
|
</a-col>
|
|
222
244
|
</a-row>
|
|
223
|
-
<a-checkbox-group v-model="selectedExportColumns">
|
|
245
|
+
<a-checkbox-group v-model="selectedExportColumns" v-show="!summaryLoadingShow">
|
|
224
246
|
<a-row type="flex" justify="space-between" style="padding-left: 3rem">
|
|
225
247
|
<a-col
|
|
226
248
|
:span="8"
|
|
@@ -238,6 +260,9 @@ export default {
|
|
|
238
260
|
</a-col>
|
|
239
261
|
</a-row>
|
|
240
262
|
</a-checkbox-group>
|
|
263
|
+
<a-row type="flex" justify="center" v-show="summaryLoadingShow">
|
|
264
|
+
<a-spin :tip="tipMsg" v-show="summaryLoadingShow" />
|
|
265
|
+
</a-row>
|
|
241
266
|
</a-modal>
|
|
242
267
|
</template>
|
|
243
268
|
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
<a-menu-item
|
|
238
238
|
v-for="(action_item, actionIndex) in item.actionArr"
|
|
239
239
|
:key="actionIndex"
|
|
240
|
-
v-
|
|
240
|
+
v-show="!action_item.customFunction || executeStrFunction( action_item.customFunction,[record,c_index])">
|
|
241
241
|
<a
|
|
242
242
|
style="text-align: center"
|
|
243
243
|
@click="action(record, item.dataIndex, action_item.func)"
|
|
@@ -346,6 +346,7 @@ import { getRealKeyData } from '@vue2-client/utils/formatter'
|
|
|
346
346
|
import ReportTableHome from '../../../../pages/report/ReportTableHome.vue'
|
|
347
347
|
import CustomFuncCel from '@vue2-client/base-client/components/common/XTable/CustomFuncCel.vue'
|
|
348
348
|
import ExportExcel from '@vue2-client/base-client/components/common/XTable/ExportExcel.vue'
|
|
349
|
+
import moment from 'moment/moment'
|
|
349
350
|
|
|
350
351
|
export default {
|
|
351
352
|
name: 'XTable',
|
|
@@ -1039,7 +1040,14 @@ export default {
|
|
|
1039
1040
|
this.$refs.exportExcel.handleExport(type)
|
|
1040
1041
|
},
|
|
1041
1042
|
handlePrint (type) {
|
|
1042
|
-
|
|
1043
|
+
const printData = {
|
|
1044
|
+
title: this.title,
|
|
1045
|
+
form: this.form,
|
|
1046
|
+
operaInfo: this.currUser.operaInfo,
|
|
1047
|
+
operaTime: moment().format('YYYY-MM-DD HH:mm:ss'),
|
|
1048
|
+
summary: this.retrieveSummaryData
|
|
1049
|
+
}
|
|
1050
|
+
this.$refs.exportExcel.handlePrint(type, printData)
|
|
1043
1051
|
},
|
|
1044
1052
|
validateTableAndSyncData (currRow, defaultAppendRowData) {
|
|
1045
1053
|
let isLastRow = false
|
|
@@ -1187,49 +1195,62 @@ export default {
|
|
|
1187
1195
|
importData () {
|
|
1188
1196
|
this.$refs.importExcel.importExcelHandleOpen()
|
|
1189
1197
|
},
|
|
1190
|
-
afterVisibleChange () {
|
|
1191
|
-
|
|
1198
|
+
afterVisibleChange (val) {
|
|
1199
|
+
if (val) {
|
|
1200
|
+
this.retrieveSummaryData()
|
|
1201
|
+
}
|
|
1192
1202
|
},
|
|
1193
1203
|
async retrieveSummaryData () {
|
|
1204
|
+
const promises = []
|
|
1205
|
+
|
|
1194
1206
|
if (this.requestParameters.querySummary) {
|
|
1195
|
-
querySummary(Object.assign(this.requestParameters, { userId: this.currUser?.id }), this.serviceName, this.env === 'dev')
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
item.
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
+
const querySummaryPromise = querySummary(Object.assign(this.requestParameters, { userId: this.currUser?.id }), this.serviceName, this.env === 'dev')
|
|
1208
|
+
.then(res => {
|
|
1209
|
+
if (this.compatible === 'V3') {
|
|
1210
|
+
res = res.data
|
|
1211
|
+
}
|
|
1212
|
+
if (res.length > 0) {
|
|
1213
|
+
this.summaryData.forEach(item => {
|
|
1214
|
+
res.forEach(summary => {
|
|
1215
|
+
if (item.title === summary.title) {
|
|
1216
|
+
item.value = summary.value
|
|
1217
|
+
item.success = true
|
|
1218
|
+
item.loading = false
|
|
1219
|
+
}
|
|
1220
|
+
})
|
|
1207
1221
|
})
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
|
|
1222
|
+
}
|
|
1223
|
+
})
|
|
1224
|
+
promises.push(querySummaryPromise)
|
|
1211
1225
|
}
|
|
1226
|
+
|
|
1212
1227
|
if (this.showCustomSummary) {
|
|
1213
1228
|
this.customSummaryArray.forEach(item => {
|
|
1214
|
-
runLogic(item.source, Object.assign(this.requestParameters, { userId: this.currUser?.id }), this.serviceName, this.env === 'dev')
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1229
|
+
const runLogicPromise = runLogic(item.source, Object.assign(this.requestParameters, { userId: this.currUser?.id }), this.serviceName, this.env === 'dev')
|
|
1230
|
+
.then(res => {
|
|
1231
|
+
this.summaryData.forEach(summary => {
|
|
1232
|
+
if (item.key === summary.key) {
|
|
1233
|
+
summary.value = res.value
|
|
1234
|
+
summary.success = true
|
|
1235
|
+
summary.loading = false
|
|
1236
|
+
}
|
|
1237
|
+
})
|
|
1221
1238
|
})
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1239
|
+
.catch(e => {
|
|
1240
|
+
this.summaryData.forEach(summary => {
|
|
1241
|
+
if (item.key === summary.key) {
|
|
1242
|
+
summary.value = 0
|
|
1243
|
+
summary.success = false
|
|
1244
|
+
summary.loading = false
|
|
1245
|
+
}
|
|
1246
|
+
})
|
|
1229
1247
|
})
|
|
1230
|
-
|
|
1248
|
+
promises.push(runLogicPromise)
|
|
1231
1249
|
})
|
|
1232
1250
|
}
|
|
1251
|
+
|
|
1252
|
+
await Promise.all(promises)
|
|
1253
|
+
return this.summaryData
|
|
1233
1254
|
},
|
|
1234
1255
|
showDrawer () {
|
|
1235
1256
|
if (this.summaryUpdate) {
|
|
@@ -83,10 +83,10 @@ routerResource.example = {
|
|
|
83
83
|
{
|
|
84
84
|
path: 'default',
|
|
85
85
|
name: '示例页面',
|
|
86
|
-
|
|
86
|
+
component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
|
|
87
87
|
// component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
|
|
88
88
|
// component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
|
|
89
|
-
component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
|
|
89
|
+
// component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
|
|
90
90
|
// component: () => import('@vue2-client/base-client/components/common/XDatePicker/demo.vue'),
|
|
91
91
|
// component: () => import('@vue2-client/base-client/components/common/XTab/XTabDemo.vue'),
|
|
92
92
|
// component: () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo.vue'),
|