吴羡
4 小时以前 9862248787934f4242ac9636e0c4d5b8ee0870b8
src/views/CNAS/resourceDemand/device/component/deviceOverview.vue
@@ -29,7 +29,7 @@
        v-if="list.length > 0 || loading">
        <ul class="card">
          <li v-for="(m, i) in list" :key="i">
            <el-image class="img" :src="javaApi + '/img/' + m.imageUpload">
            <el-image v-if="m.imageUpload" class="img" :src="javaApi + '/img/' + m.imageUpload">
              <template #error><div  class="image-error" style="width: 88px;
            height: 88px;
            border-radius: 16px;
@@ -40,6 +40,15 @@
                <lims-icon name="el-icon-picture-outline" style="font-size:20px;color:var(--lims-text-2);"></lims-icon>
              </div></template>
            </el-image>
            <div v-else class="image-error" style="width: 88px;
            height: 88px;
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--lims-divider);margin-right: 10px;">
              <lims-icon name="el-icon-picture-outline" style="font-size:20px;color:var(--lims-text-2);"></lims-icon>
            </div>
            <div class="list-left">
              <div class="list-left-info">
                <span class="label" style="white-space: nowrap;">设备名称:</span>
@@ -80,7 +89,7 @@
        <el-button link type="primary" @click="downloadTemplate">下载导入模板</el-button>
      </div>
      <el-upload ref="deviceUpload" drag name="file" accept=".xlsx" :action="importAction"
                 :headers="uploadHeader" :auto-upload="false" :limit="1" :file-list="importFiles"
                 :headers="uploadHeader" :auto-upload="false" :limit="1" v-model:file-list="importFiles"
                 :before-upload="beforeImport" :on-success="importSuccess" :on-error="importError">
        <lims-icon name="el-icon-upload"></lims-icon>
        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
@@ -99,6 +108,7 @@
  selectDeviceParameter,
  downloadDeviceImportTemplate,
} from '@/api/cnas/resourceDemand/device.js'
import { saveBlobOrShowError } from '@/utils/saveBlob'
export default {
  props: {
    clickNodeVal: {
@@ -146,11 +156,11 @@
  methods: {
    downloadTemplate() {
      downloadDeviceImportTemplate().then(res => {
        this.$download.saveAs(new Blob([res]), '设备导入模板.xlsx')
      })
        saveBlobOrShowError(res, '设备导入模板.xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
      }).catch(() => { })
    },
    submitImport() {
      if (!this.$refs.deviceUpload.uploadFiles.length) {
      if (!this.importFiles || this.importFiles.length === 0) {
        this.$message.warning('请选择需要导入的Excel文件')
        return
      }
@@ -252,6 +262,11 @@
          }
        }
        this.loading = false
      }).catch(() => {
        // 清掉本页占位,失败后可用查询/重置重新加载
        delete this.keyMap[key]
        this.loading = false
        this.finishLoding = true
      })
    },
    refresh() {