gaoluyang
2025-03-07 8ccadce62956850bbbd2a4e7202c4f8cb1caa0a4
src/views/CNAS/resourceDemand/device/component/files.vue
@@ -175,7 +175,7 @@
        <el-table-column fixed="right" label="操作" min-width="180">
          <template slot-scope="scope">
            <el-button type="text" size="small" @click="handleAttachmentClick(scope.row)">下载附件</el-button>
            <el-button type="text" size="small" @click="handleViewClick(scope.row)">查看</el-button>
            <el-button type="text" size="small" @click="handleViewClick(scope.row)">编辑</el-button>
            <el-button type="text" size="small" @click="handleDeleteClick(scope.row)">删除</el-button>
          </template>
        </el-table-column>
@@ -264,7 +264,7 @@
        <el-col :span="7">
          <el-form :model="editData" label-width="140px" ref="ruleForm" :rules="rules1">
            <!-- 实验室列表 -->
            <el-form-item label="所属部门:">
            <el-form-item label="所属部门:" prop="subordinateDepartmentsId">
              <el-select v-model="editData.subordinateDepartmentsId" placeholder="请选择" size="small" style="width:100%">
                <el-option v-for="item in subordinateDepartmentsList" :key="item.value" :label="item.label"
                  :value="item.value">
@@ -341,7 +341,7 @@
        </el-row>
      </span>
    </el-dialog>
    <el-dialog title="添加设备附件" top="5vh" v-if="dialogVisible1" :visible.sync="dialogVisible1" width="40%">
    <el-dialog title="设备附件" top="5vh" v-if="dialogVisible1" :visible.sync="dialogVisible1" width="40%">
      <el-form ref="form" :model="addFile" label-width="120px">
        <el-row :gutter="20">
          <el-col :span="12">
@@ -512,6 +512,9 @@
        calibrationDate: [
          { required: true, message: '请输入校准周期(月)', trigger: 'blur' },
        ],
        subordinateDepartmentsId: [
          { required: true, message: '请选择所属部门', trigger: 'change' },
        ]
      },
      // dateForm: {
@@ -615,18 +618,7 @@
    handleAttachmentClick(row) {
      console.log(row)
      if (row.fileName) {
        let state = /\.(jpg|jpeg|png|gif)$/i.test(row.fileName)
        if (state) {
          let url = this.javaApi + '/img/' + row.fileName;
          fileDownload.downloadIamge(url, row.fileName)
        } else {
          const url = this.javaApi + '/word/' + row.fileName
          const link = document.createElement('a');
          link.href = url;
          link.download = row.fileName;
          link.click();
          this.$message.success('下载成功')
        }
        this.$download.downloadFileFromUrl(row.fileName)
      } else {
        this.$message.warning('未上传文件!')
      }