From 7d8cdd841db1cb7b70e2bd7bd79661d03b27762b Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期五, 25 十月 2024 13:01:21 +0800
Subject: [PATCH] 文件柜导出接口联调
---
Source/plt-web/plt-web-ui/src/api/system/fileCab/api.js | 6 +++---
Source/plt-web/plt-web-ui/src/views/system/fileCab/index.vue | 24 +++++++++++++++++++++++-
2 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/api/system/fileCab/api.js b/Source/plt-web/plt-web-ui/src/api/system/fileCab/api.js
index 9b23bdf..5cf0f80 100644
--- a/Source/plt-web/plt-web-ui/src/api/system/fileCab/api.js
+++ b/Source/plt-web/plt-web-ui/src/api/system/fileCab/api.js
@@ -33,9 +33,9 @@
export const exportPvolumes = (params) => {
return request({
url: '/api/pvolumesController/exportPvolumes',
- method: 'POST',
- headers: {'Content-Type': 'application/json;charset=UTF-8'},
+ method: 'get',
+ headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'},
responseType: 'blob',
- data: params
+ params
})
}
diff --git a/Source/plt-web/plt-web-ui/src/views/system/fileCab/index.vue b/Source/plt-web/plt-web-ui/src/views/system/fileCab/index.vue
index b0427c1..ccad73e 100644
--- a/Source/plt-web/plt-web-ui/src/views/system/fileCab/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/system/fileCab/index.vue
@@ -11,6 +11,7 @@
@row-save="rowSaveHandler"
@row-update="rowUpdateHandler"
@row-del="rowDeleteHandler"
+ @selection-change="selectionChange"
>
<template slot="menuLeft" slot-scope="scope">
<el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭</el-button>
@@ -109,6 +110,16 @@
leftRoleData: [], // 鍒嗛厤鎴愬憳绌挎妗嗗乏渚у垵濮嬫暟鎹�
rightRoleData: [], // 鍒嗛厤鎴愬憳绌挎妗嗗彸渚у垵濮嬫暟鎹�
transferTitle: ['鏂囦欢鏌滃鎴愬憳', '鏂囦欢鏌滃唴鎴愬憳'],
+ selectionList: [],
+ }
+ },
+ computed: {
+ ids() {
+ let ids = [];
+ this.selectionList.forEach(ele => {
+ ids.push(ele.id);
+ });
+ return ids.join(",");
}
},
methods: {
@@ -173,8 +184,15 @@
},
// 瀵煎嚭
exportClickHandler() {
+ if(this.ids == null || this.ids == ""){
+ this.$message({
+ type: 'warning',
+ message: '璇峰嬀閫夎瀵煎嚭鐨勬暟鎹�!'
+ });
+ return;
+ }
const loading = this.$loading({});
- exportPvolumes().then(res => {
+ exportPvolumes({"pvolumeIds": this.ids}).then(res => {
func.downloadFileByBlobHandler(res);
this.createdLoading = false
this.$message.success('瀵煎嚭鎴愬姛');
@@ -214,6 +232,10 @@
this.getTableList();
})
},
+ //閫夋嫨鐨勮
+ selectionChange(list) {
+ this.selectionList = list;
+ },
}
}
</script>
--
Gitblit v1.9.3