Tcsm
2023-08-06 90d7429ca4b71ef854f8fbc18560c2e02a12c166
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="开始日期"
@@ -128,10 +128,10 @@
      <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="150">
        <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">
      <el-table-column label="是否注销" align="center" sortable prop="status" width="120">
        <template slot-scope="scope">
          {{ getSrc1(scope.row.status) }}
        </template>
@@ -145,7 +145,7 @@
      </el-table-column>
      <el-table-column label="电子文件" prop="url" width="180" align="center">
      <el-table-column label="电子文件" prop="url" width="120" align="center">
        <template slot-scope="scope" >
          <div  @click="handleCheck(scope.row)">
@@ -155,15 +155,16 @@
              alt=""
              style="width: 35px; height: 35px;"
              fit="cover"
              v-if="scope.row.url !== ',' "
              v-if="!(scope.row.url === '' || scope.row.url === ',' || scope.row.url === null)"
            >
            <img
              v-else
              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>
@@ -210,11 +211,11 @@
        </el-form-item>
        <el-form-item label="发生时间" prop="happenTime">
          <el-date-picker
          <el-input
            v-model='formDat.happenTime'
            type='date'
            placeholder='选择日期'
          ></el-date-picker>
          ></el-input>
        </el-form-item>
@@ -285,7 +286,7 @@
          class="upload-demo"
          multiple
          :on-remove="handleRemove"
          :on-remove="handleRemoveFile"
          :http-request="requestUpload"
          :show-file-list="true"
        >
@@ -386,7 +387,8 @@
        content:undefined,
        buyer:undefined,
        location:undefined,
        createDate:undefined
        createDate:undefined,
        happenTime:undefined
      },
      // 表单参数
      form: {},
@@ -402,7 +404,7 @@
          trigger: 'blur'
        }],
        status: [{
          required: true,
          // required: true,
          message: '是否注销',
          trigger: 'change'
        }],
@@ -481,6 +483,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 => {
@@ -580,6 +584,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() {
@@ -600,6 +618,12 @@
          });
        }
      });
      // 清空formDat对象的数据
      Object.keys(this.formDat).forEach(key => {
        this.formDat[key] = '';
      });
      this.handleRemove(this.fileList[0]);
      this.handleRemoveFile(this.fileListOther[0]);
    },
    requestUpload(params)
    {