ludc
2024-10-25 7d8cdd841db1cb7b70e2bd7bd79661d03b27762b
文件柜导出接口联调
已修改2个文件
30 ■■■■ 文件已修改
Source/plt-web/plt-web-ui/src/api/system/fileCab/api.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/system/fileCab/index.vue 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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
  })
}
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>