Tcsm
2023-07-26 c003a5fb28554e2f37c431214dabf6f75f27cc29
ruoyi-ui/src/views/device/index.vue
@@ -2,11 +2,11 @@
  <div class="app-container" style="opacity: 1;">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
      <el-form-item label="时间" >
      <el-form-item label="时间" prop="happenTime">
        <el-date-picker
          v-model="dateRange"
          style="width: 240px;"
          value-format="yyyy-MM-dd HH-MM"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
@@ -42,10 +42,10 @@
      </el-form-item>
      <el-form-item label="标题" prop="content">
      <el-form-item label="事项内容" prop="content">
        <el-input
          v-model="queryParams.content"
          placeholder="请输入标题"
          placeholder="请输入事项内容"
          clearable
          style="width: 240px"
          @keyup.enter.native="handleQuery"
@@ -125,10 +125,10 @@
    <!-- 这里有个familyList数组 是在data()中定义的 -->
    <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  label="序号" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="120"/>
      <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">
      <el-table-column label="时间" align="happenTime" sortable prop="happenTime" width="180">
        <template slot-scope="scope">{{scope.row.happenTime? scope.row.happenTime: '————'}}</template>
      </el-table-column>
      <el-table-column label="是否注销" align="center" sortable prop="status" width="180">
@@ -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">
@@ -283,7 +285,7 @@
          class="upload-demo"
          multiple
          :on-remove="handleRemove"
          :on-remove="handleRemoveFile"
          :http-request="requestUpload"
          :show-file-list="true"
        >
@@ -384,7 +386,8 @@
        content:undefined,
        buyer:undefined,
        location:undefined,
        createDate:undefined
        createDate:undefined,
        happenTime:undefined
      },
      // 表单参数
      form: {},
@@ -400,7 +403,7 @@
          trigger: 'blur'
        }],
        status: [{
          required: true,
          // required: true,
          message: '是否注销',
          trigger: 'change'
        }],
@@ -479,6 +482,8 @@
    getList() {
      this.loading = true;
      this.queryParams.happenStartTime = this.dateRange.length > 0 && this.dateRange[0]
      this.queryParams.happenEndTime = this.dateRange.length > 0 && this.dateRange[1]
      // console.log(this.queryParams)
      //  listProperty(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
      listEquipment(this.queryParams).then(response => {
@@ -578,6 +583,20 @@
      this.dialogImageUrl = file.url;
      this.dialogVisible = true;
    },
    handleRemove(file) {
      for(let i = 0; i < this.fileList.length; i++)
      {
        if(this.fileList[i].url==file.url)
          this.$delete(this.fileList,i);
      }
    },
    handleRemoveFile(file) {
      for(let i = 0; i < this.fileListOther.length; i++)
      {
        if(this.fileListOther[i].url==file.url)
          this.$delete(this.fileListOther,i);
      }
    },
    /** 提交按钮(数据权限) */
    submitDataScope: function() {
@@ -598,6 +617,12 @@
          });
        }
      });
      // 清空formDat对象的数据
      Object.keys(this.formDat).forEach(key => {
        this.formDat[key] = '';
      });
      this.handleRemove(this.fileList[0]);
      this.handleRemoveFile(this.fileListOther[0]);
    },
    requestUpload(params)
    {
@@ -635,7 +660,7 @@
    /** 导出按钮操作 */
    handleExport() {
      const Ids = this.ids;
      if(Ids.length==0)
      {
      this.download('/zfEquipment/export', {