xiejun
2023-12-07 05d45bd440ffc92e14e6c8728ac8956a0488c0ab
Source/UBCS-WEB/src/components/Master/MasterTransfer.vue
@@ -1,5 +1,6 @@
<template>
  <el-dialog :close-on-click-modal="false" :visible.sync="dialogPush" append-to-body style="width: 1550px; margin: auto" title="导出"
  <el-dialog :close-on-click-modal="false" :visible.sync="dialogPush" append-to-body style="width: 1550px; margin: auto"
             title="导出"
             @close="escHandler">
    <div style="margin-bottom: 20px;">
      <div>
@@ -10,7 +11,7 @@
          <el-radio :label="2">页码</el-radio>
        </el-radio-group>
        <span v-if="radio === 2" style="margin-left: 20px;"><el-input v-model="pageExport"
                                                                      style="width: 150px"></el-input> (输入页码或者页面范围,如:1-10))</span>
                                                                      style="width: 150px"></el-input> (输入页码或者页面范围,如:1-10)</span>
      </div>
    </div>
    <div style="text-align: center">
@@ -112,7 +113,7 @@
    },
    value: {
      handler(newval, oldval) {
        console.log('value', newval)
        // console.log('value', newval)
      }
    }
  },
@@ -120,6 +121,24 @@
  mounted() {
  },
  methods: {
    handlerFile(res) {
      // let reader = new FileReader();
      // reader.readAsText(res.data);
      // reader.onload = (result) => {
      //   try {
      //     let resData = JSON.parse(result.target.result);  // 解析对象成功
      //     if (resData.code != 200) {
      //       this.$message.error(resData.msg);
      //     }
      //   } catch (err) {
      //   // 解析成对象失败,说明是正常的文件流
      //     func.downloadFileByBlobHandler(res);
      //     this.$message.success('下载成功,请查看!');
      //   }
      // };
      func.downloadFileByBlobHandler(res);
      this.$message.success('下载成功,请查看!');
    },
    escHandler() {
      this.$emit('update:visible', false);
      this.value = [];
@@ -157,11 +176,8 @@
              'conditionMap[oid]': this.ids, ...this.exportArrTwo,
              limit: -1
            }).then(res => {
              // console.log('res',res)
              if (res) {
                func.downloadFileByBlobHandler(res);
                this.escHandler()
              }
              this.handlerFile(res);
              this.escHandler();
            })
          } else {
@@ -170,10 +186,9 @@
              'conditionMap[oid]': this.ids, ...this.exportArr
            }).then(res => {
              // console.log('res',res)
              if (res) {
                func.downloadFileByBlobHandler(res);
                this.escHandler()
              }
              this.handlerFile(res);
              this.escHandler();
            })
          }
@@ -185,19 +200,15 @@
              this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop;
            });
          exportCode({codeClassifyOid: this.codeClassifyOid, ...this.exportArrTwo, limit: -1}).then(res => {
            // console.log('res',res)
            if (res) {
              func.downloadFileByBlobHandler(res);
              this.escHandler()
              this.escHandler();
            }
          })
        } else {
          exportCode({codeClassifyOid: this.codeClassifyOid, ...this.exportArr, limit: -1}).then(res => {
            // console.log('res',res)
            if (res) {
              func.downloadFileByBlobHandler(res);
              this.escHandler()
            }
            this.handlerFile(res);
            this.escHandler();
          })
        }
      } else if (this.radio === 2) {
@@ -233,10 +244,9 @@
            endPage: end
          }).then((res) => {
            // console.log('res',res)
            if (res) {
              func.downloadFileByBlobHandler(res);
              this.escHandler()
            }
            this.handlerFile(res);
            this.escHandler();
          });
        } else {
          this.tableHeadData.map(item => item.prop)
@@ -249,11 +259,9 @@
            page: start,
            endPage: end
          }).then(res => {
            // console.log('res',res)
            if (res) {
              func.downloadFileByBlobHandler(res);
              this.escHandler()
            }
            // console.log('res', res)
            this.handlerFile(res);
            this.escHandler();
          })
        }
      }