黎星凯
2024-05-08 b4adff68a07b783fc90da1c9370d8be5f383e700
admin-web/src/views/mixins/listPage.js
@@ -16,6 +16,12 @@
        orgId: '',
        show: false,
      },
      uploadPageSetting: {
        title: '上传页面',
        id: '',
        orgId: '',
        show: false,
      },
      detailSetting: {
        title: '详情',
        id: '',
@@ -43,7 +49,6 @@
  methods: {
    // 导出
    handleExport(api, fileName, params) {
      console.log(fileName)
      let loading = this.$loading({
        lock: true,
        text: '导出中,请稍候...',
@@ -53,24 +58,7 @@
      // 判断总条数是否大于最大支持条数
      dataExport[api](params)
        .then((res) => {
          const blob = new Blob([res], {type: 'application/vnd.ms-excel'});
          /*if ('download' in document.createElement('a')) {
            // 非IE下载
            const elink = document.createElement('a');
            elink.download = `${fileName}.xls`;
            elink.style.display = 'none';
            const URL = window.URL || window.webkitURL
            const href = URL.createObjectURL(blob)
            elink.href = href;
            document.body.appendChild(elink);
            elink.click();
            URL.revokeObjectURL(elink.href);
            document.body.removeChild(elink);
            window.URL.revokeObjectURL(href)
          } else {
            // IE10+下载
            navigator.msSaveBlob(blob, `${fileName}.xls`);
          }*/
          console.log(res)
          downLoad(res)
          this.$message.success('导出成功!');
          loading.close();
@@ -99,6 +87,12 @@
      this.detailSetting.title = '详情';
      this.detailSetting.show = true;
    },
    // 导入
    handleUploadPage(row) {
      this.uploadPageSetting.id = row.id;
      this.uploadPageSetting.title = '导入';
      this.uploadPageSetting.show = true;
    },
    // 分页
    handleSizeChange(pageSize) {
      this.pageSize = pageSize;