MrShi
2024-02-22 8d7bb4ac830444afde480a588e99952105ea8ede
platform/src/components/common/ImportWindow.vue
@@ -102,7 +102,7 @@
     */
    confirm () {
      if (this.form.file == null) {
        this.$message.warning('请选择文件')
        this.$tip.warning('请选择文件')
        return
      }
      this.isWorking = true
@@ -114,12 +114,12 @@
        }
      })
        .then(() => {
          this.$message.success('导入成功')
          this.$tip.success('导入成功')
          this.visible = false
          this.$emit('success')
        })
        .catch(e => {
          this.$message.error(e)
          this.$tip.apiFailed(e)
        })
        .finally(() => {
          this.isWorking = false
@@ -137,11 +137,10 @@
    downloadTemplate () {
      const link = document.createElement('a')
      link.setAttribute('download', this.templateName) //下载的文件名
      // console.log(`window.location.origin`, window.location.origin);
      // console.log(`process.env.VUE_APP_CONTEXT_PATH`, process.env.VUE_APP_CONTEXT_PATH);
      // console.log(`this.templatePath`, this.templatePath);
      console.log(`${window.location.origin}${process.env.VUE_APP_CONTEXT_PATH}${this.templatePath}`);
      link.href = `${window.location.origin}${process.env.VUE_APP_CONTEXT_PATH}${this.templatePath}`  //文件url
      link.click()
      // this.$emit('download')
    },
    /**
     * 文件上传前存储上传的文件