vue2-client 1.8.335 → 1.8.336
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
CHANGED
|
@@ -143,7 +143,7 @@ export default {
|
|
|
143
143
|
table_selectedRowKeys: [],
|
|
144
144
|
table_selectedRows: [],
|
|
145
145
|
allowedCardMode: false,
|
|
146
|
-
cardModeConfig: undefined
|
|
146
|
+
cardModeConfig: undefined,
|
|
147
147
|
}
|
|
148
148
|
},
|
|
149
149
|
computed: {
|
|
@@ -366,6 +366,7 @@ export default {
|
|
|
366
366
|
if (res.valid) {
|
|
367
367
|
// 表单赋值
|
|
368
368
|
this.$refs.xTable.setQueryForm(res.form)
|
|
369
|
+
this.$refs.xTable.summaryUpdate = true
|
|
369
370
|
// commit
|
|
370
371
|
this.$emit('afterSearchSubmit', res)
|
|
371
372
|
} else {
|
|
@@ -45,6 +45,11 @@
|
|
|
45
45
|
<span :style="{ float: 'right', overflow: 'hidden', marginBottom: '8px' }">
|
|
46
46
|
<a-button-group>
|
|
47
47
|
<slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
48
|
+
<a-tooltip title="汇总" placement="bottom">
|
|
49
|
+
<a-button @click="showDrawer">
|
|
50
|
+
<a-icon :style="iconStyle" type="container"/>
|
|
51
|
+
</a-button>
|
|
52
|
+
</a-tooltip>
|
|
48
53
|
<a-tooltip title="重新查询" placement="bottom">
|
|
49
54
|
<a-button @click="refresh(true)">
|
|
50
55
|
<a-icon :style="iconStyle" type="reload"/>
|
|
@@ -120,15 +125,6 @@
|
|
|
120
125
|
<template slot="footer">
|
|
121
126
|
<slot name="footer" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
|
|
122
127
|
</template>
|
|
123
|
-
<template #fixedfooter v-if="showSummary && summaryData.length">
|
|
124
|
-
<div class="footer_sum_warp">
|
|
125
|
-
<span class="footer_sum_title">汇总信息 </span>
|
|
126
|
-
<span class="footer_sum_item" v-for="(f,index) in summaryData" :key="index">
|
|
127
|
-
<span>{{ f.title }}:</span>
|
|
128
|
-
<span>{{ f.value }} </span>
|
|
129
|
-
</span>
|
|
130
|
-
</div>
|
|
131
|
-
</template>
|
|
132
128
|
</s-table>
|
|
133
129
|
</template>
|
|
134
130
|
<!-- 如果当前是看板模式 -->
|
|
@@ -141,6 +137,27 @@
|
|
|
141
137
|
:card-data="loadData"/>
|
|
142
138
|
</template>
|
|
143
139
|
<!-- 上传文件 -->
|
|
140
|
+
<a-drawer
|
|
141
|
+
title="汇总信息"
|
|
142
|
+
placement="right"
|
|
143
|
+
:closable="false"
|
|
144
|
+
:visible="summaryDrawerVisible"
|
|
145
|
+
:z-index="2000"
|
|
146
|
+
:after-visible-change="afterVisibleChange"
|
|
147
|
+
@close="onClose"
|
|
148
|
+
>
|
|
149
|
+
<template>
|
|
150
|
+
<div>
|
|
151
|
+
<a-statistic
|
|
152
|
+
v-for="(f,index) in summaryData"
|
|
153
|
+
:key="index"
|
|
154
|
+
:title="f.title + ':'"
|
|
155
|
+
:value="f.value"
|
|
156
|
+
:precision="2"
|
|
157
|
+
style="margin-right: 50px" />
|
|
158
|
+
</div>
|
|
159
|
+
</template>
|
|
160
|
+
</a-drawer>
|
|
144
161
|
<x-import-excel
|
|
145
162
|
ref="importExcel"
|
|
146
163
|
@ok="importExcelOk"
|
|
@@ -178,7 +195,7 @@ export default {
|
|
|
178
195
|
STable,
|
|
179
196
|
Ellipsis,
|
|
180
197
|
XBadge,
|
|
181
|
-
XImportExcel
|
|
198
|
+
XImportExcel,
|
|
182
199
|
},
|
|
183
200
|
data () {
|
|
184
201
|
return {
|
|
@@ -213,9 +230,11 @@ export default {
|
|
|
213
230
|
requestParameters.conditionParams = conditionParams
|
|
214
231
|
requestParameters.queryParamsName = this.queryParamsName
|
|
215
232
|
requestParameters.queryParams = this.queryParams
|
|
233
|
+
this.requestParameters = requestParameters
|
|
216
234
|
// 加载数据
|
|
217
235
|
return this.loadTableData(requestParameters)
|
|
218
236
|
},
|
|
237
|
+
requestParameters: {},
|
|
219
238
|
rowKey: undefined,
|
|
220
239
|
// x滚动条宽度
|
|
221
240
|
scrollXWidth: 1600,
|
|
@@ -233,6 +252,7 @@ export default {
|
|
|
233
252
|
tableColumns: [],
|
|
234
253
|
// 查询用表单
|
|
235
254
|
form: {},
|
|
255
|
+
oldForm: {},
|
|
236
256
|
// 是否允许修改
|
|
237
257
|
isModify: false,
|
|
238
258
|
// 是否允许删除
|
|
@@ -260,7 +280,11 @@ export default {
|
|
|
260
280
|
// 当前环境
|
|
261
281
|
env: 'prod',
|
|
262
282
|
// 预览模式(表格 or 看板)
|
|
263
|
-
isTableMode: true
|
|
283
|
+
isTableMode: true,
|
|
284
|
+
// 汇总抽屉是否显示
|
|
285
|
+
summaryDrawerVisible: false,
|
|
286
|
+
// 汇总更新标志
|
|
287
|
+
summaryUpdate: false
|
|
264
288
|
}
|
|
265
289
|
},
|
|
266
290
|
props: {
|
|
@@ -326,7 +350,9 @@ export default {
|
|
|
326
350
|
...mapState('setting', ['compatible'])
|
|
327
351
|
},
|
|
328
352
|
mounted () {
|
|
329
|
-
this
|
|
353
|
+
this.$nextTick(() => {
|
|
354
|
+
this.setScrollYHeight({}) // 初始化时也调用一次,确保加载时高度正确
|
|
355
|
+
})
|
|
330
356
|
window.addEventListener('resize', this.handleResize)
|
|
331
357
|
},
|
|
332
358
|
beforeDestroy () {
|
|
@@ -419,10 +445,6 @@ export default {
|
|
|
419
445
|
result = this.initTempTable(requestParameters)
|
|
420
446
|
}
|
|
421
447
|
}
|
|
422
|
-
if (requestParameters.querySummary) {
|
|
423
|
-
this.showSummary = true
|
|
424
|
-
this.summaryData = await querySummary(Object.assign(requestParameters, { userId: this.currUser?.id }), this.serviceName, this.env === 'dev')
|
|
425
|
-
}
|
|
426
448
|
if (!this.isTableTemp) {
|
|
427
449
|
result = query(Object.assign(requestParameters, { userId: this.currUser?.id }), this.serviceName, this.env === 'dev')
|
|
428
450
|
}
|
|
@@ -584,16 +606,15 @@ export default {
|
|
|
584
606
|
content: (h) => (
|
|
585
607
|
<div>
|
|
586
608
|
<p>此操作将导出当前条件下所有数据而非选中数据</p>
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
onChange={(e) => this.exportFileName = e.target.value}
|
|
590
|
-
/>
|
|
609
|
+
{/* eslint-disable-next-line no-return-assign */}
|
|
610
|
+
<a-input placeholder="请输入导出文件名" onChange={(e) => this.exportFileName = e.target.value}/>
|
|
591
611
|
</div>
|
|
592
612
|
),
|
|
593
613
|
onOk: () => {
|
|
594
614
|
if (!this.exportFileName) {
|
|
595
|
-
this.$message.error('文件名不能为空')
|
|
596
|
-
|
|
615
|
+
this.$message.error('文件名不能为空')
|
|
616
|
+
// eslint-disable-next-line prefer-promise-reject-errors
|
|
617
|
+
return Promise.reject() // 阻止对话框关闭
|
|
597
618
|
}
|
|
598
619
|
// 在这里执行导出的逻辑,并使用 this.exportFileName 作为文件名
|
|
599
620
|
const queryData = {
|
|
@@ -614,14 +635,14 @@ export default {
|
|
|
614
635
|
f_task_name: `${this.exportFileName}_${that.currUser.username}_${date}`
|
|
615
636
|
}, that.serviceName, that.env === 'dev')
|
|
616
637
|
.then(res => {
|
|
617
|
-
|
|
638
|
+
}).catch(error => {
|
|
618
639
|
// 失败时的处理
|
|
619
|
-
console.log('失败:', error)
|
|
620
|
-
})
|
|
640
|
+
console.log('失败:', error)
|
|
641
|
+
})
|
|
621
642
|
},
|
|
622
643
|
onCancel () {
|
|
623
644
|
}
|
|
624
|
-
})
|
|
645
|
+
})
|
|
625
646
|
},
|
|
626
647
|
// 新增业务
|
|
627
648
|
add () {
|
|
@@ -742,7 +763,25 @@ export default {
|
|
|
742
763
|
}).then(res => {
|
|
743
764
|
return res
|
|
744
765
|
})
|
|
745
|
-
}
|
|
766
|
+
},
|
|
767
|
+
afterVisibleChange () {
|
|
768
|
+
this.retrieveSummaryData()
|
|
769
|
+
},
|
|
770
|
+
async retrieveSummaryData () {
|
|
771
|
+
if (this.requestParameters.querySummary) {
|
|
772
|
+
this.summaryData = await querySummary(Object.assign(this.requestParameters, { userId: this.currUser?.id }), this.serviceName, this.env === 'dev')
|
|
773
|
+
}
|
|
774
|
+
},
|
|
775
|
+
showDrawer () {
|
|
776
|
+
if (this.summaryUpdate) {
|
|
777
|
+
this.summaryDrawerVisible = true
|
|
778
|
+
} else {
|
|
779
|
+
this.$message.warning('请查询后再来查看')
|
|
780
|
+
}
|
|
781
|
+
},
|
|
782
|
+
onClose () {
|
|
783
|
+
this.summaryDrawerVisible = false
|
|
784
|
+
},
|
|
746
785
|
}
|
|
747
786
|
}
|
|
748
787
|
</script>
|