linwenling
2023-07-24 228302bc93feabc7b51a965db4374781844cc033
ruoyi-ui/src/views/device/index.vue
@@ -99,7 +99,7 @@
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          @click="handleExportTemplate"
          v-hasPermi="['family:note:export']"
        >导入模板下载</el-button>
      </el-col>
@@ -123,9 +123,9 @@
    </el-row>
    <!-- 序号、设备名称、时间、购买人、事项内容、存放地点、电子文件、备注 操作-->
    <!-- 这里有个familyList数组 是在data()中定义的 -->
    <el-table v-loading="loading" :data="equipmentList"  @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" style="background: #FFEFF2;  border-radius: 14px 14px 14px 14px;">
      <el-table-column type="selection" width="55"  align="center" />
      <el-table-column  label="序号" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="120"/>
    <el-table v-loading="loading" :data="equipmentList"  :row-key="getRowId" ref="multipleTable" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" style="background: #FFEFF2;  border-radius: 14px 14px 14px 14px;">
      <el-table-column type="selection" :reserve-selection="true" width="55"  align="center" />
      <el-table-column fixed label="序号" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="120"/>
      <el-table-column label="设备名称" prop="name" sortable width="120" />
      <el-table-column label="时间" align="center" sortable prop="happenTime" width="180">
@@ -137,7 +137,7 @@
        </template>
      </el-table-column>
      <el-table-column label="购买人" prop="buyer" sortable width="100" />
      <el-table-column label="标题" prop="content" sortable :show-overflow-tooltip="true" width="150" />
      <el-table-column label="事项内容" prop="content" sortable :show-overflow-tooltip="true" width="150" />
      <el-table-column label="存放地点" prop="location" sortable width="100" />
      <el-table-column label="备注" prop="remark" sortable width="100" >
@@ -145,24 +145,26 @@
      </el-table-column>
      <el-table-column label="电子文件" prop="url" width="160" >
      <el-table-column label="电子文件" prop="url" width="180" align="center">
        <template slot-scope="scope" >
          <img
            class="el-upload-list__item-thumbnail"
            src="../../assets/images/deviceLis.png"
            alt=""
            style="width: 35px; height: 35px;"
            fit="cover"
            v-if="scope.row.url !== ','"
          >
          <img
            class="el-upload-list__item-thumbnail"
            src="../../assets/images/deviceA.png"
            alt=""
            style="width: 35px; height: 35px;"
            fit="cover"
            v-if="scope.row.url === ','"
          >
          <div  @click="handleCheck(scope.row)">
            <img
              class="el-upload-list__item-thumbnail"
              src="../../assets/images/deviceLis.png"
              alt=""
              style="width: 35px; height: 35px;"
              fit="cover"
              v-if="scope.row.url !== ',' "
            >
            <img
              class="el-upload-list__item-thumbnail"
              src="../../assets/images/deviceA.png"
              alt=""
              style="width: 35px; height: 35px;"
              fit="cover"
              v-if="scope.row.url === ','"
            ></div>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@@ -221,7 +223,7 @@
          <el-input v-model="formDat.buyer" placeholder="请输入购买人" clearable :style="{width: '100%'}" >
          </el-input>
        </el-form-item>
        <el-form-item label="标题" prop="content">
        <el-form-item label="事项内容" prop="content">
          <el-input v-model="formDat.content" placeholder="请输入事项内容" clearable :style="{width: '100%'}" ></el-input>
        </el-form-item>
        <el-form-item label="存放地点" prop="location">
@@ -569,7 +571,10 @@
        }
      });
    },
getRowId(row)
    {
      return row.id
    },
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url;
@@ -631,9 +636,23 @@
    },
    /** 导出按钮操作 */
    handleExport() {
      const Ids = this.ids;
      if(Ids.length==0)
      {
      this.download('/zfEquipment/export', {
        ...this.queryParams
      }, `zfEquiment_${new Date().getTime()}.xlsx`)
      }
      else{
        this.download('/zfEquipment/export1/'+Ids, {
        }, `zfEquiment_${new Date().getTime()}.xlsx`)
      }
    },
    handleExportTemplate(){
      this.download('/zfEquipment/model', {
      }, `zfEquiment_${new Date().getTime()}.xlsx`)
    },
    /** 导入操作*/
    handleEnport(params){