fuliqi
2025-01-16 e5fae45afc610c0cbc5620f2e9138e2188dcf243
src/views/system/data-manage/data-detail/index.vue
@@ -76,11 +76,11 @@
    </el-row>
    <div style="display: flex;position: relative">
      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
        <el-form-item label="关键词" prop="bayonetNumber">
          <el-input v-model="queryParams.keyword" placeholder="关键词搜索" clearable @input="handleQuery"/>
        <el-form-item label="关键字" prop="bayonetNumber">
          <el-input v-model="queryParams.keyword" placeholder="国标码/设备名/ip搜索" clearable @keyup.enter.native="handleQuery" @clear="handleQuery"/>
        </el-form-item>
        <el-form-item :label="this.optionsName" prop="option" v-show = "this.optionsStatus">
          <el-select  v-model="queryParams.option" size="small" clearable>
          <el-select  v-model="queryParams.option" size="small" clearable @change="handleQuery">
            <el-option v-for="option in options" :key="option.value" :label="option.label" :value="option.value"></el-option>
          </el-select>
        </el-form-item>
@@ -89,7 +89,8 @@
              v-model="queryParams.date"
              type="date"
              placeholder="选择日期"
              value-format="yyyy-MM-dd">
              value-format="yyyy-MM-dd"
              @change="handleQuery">
            </el-date-picker>
        </el-form-item>
        <el-form-item>
@@ -101,8 +102,14 @@
                     :columns="showList"></right-toolbar>
    </div>
    <div  v-show="exportUrl" style="margin-bottom: 5px">
      <el-button  slot="reference" type="primary" size="mini" @click="handleExport(exportUrl)" plain
                 v-hasPermi="['platform:platform:export']">导出
      </el-button>
    </div>
    <div v-show="index === 'image_resource_security'" style="margin-bottom: 5px">
        <el-button type="primary" plain icon="el-icon-upload" size="mini" @click="handleExport"
        <el-button type="primary" plain icon="el-icon-upload" size="mini" @click="handleImport"
                   v-hasPermi="['platform:platform:export']">导入
        </el-button>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -110,7 +117,9 @@
    <div>
      <el-table v-loading="loading" :data="tableData.list">
        <el-table-column :prop="item.prop" :label="item.label" :width="item.width" v-for="(item, index) in tableHead"
<!--        <el-table-column :prop="item.prop" :label="item.label" :width="item.width" v-for="(item, index) in tableHead"-->
<!--                         :key="index" v-if="showListPD(item)">-->
        <el-table-column :prop="item.prop" :label="item.label" v-for="(item, index) in tableHead"
                         :key="index" v-if="showListPD(item)">
          <template slot-scope="scope">
            <span :class="{'error-text': scope.row[item.error]}"> {{ scope.row[item.prop] }} </span>
@@ -266,7 +275,8 @@
      showList: [],
      tableHead: [],
      cardList: [],
      index: null
      index: null,
      exportUrl: null,
    };
  },
@@ -285,17 +295,16 @@
    // 拼接成 yyyy-MM-dd 格式
    this.queryParams.date = `${year}-${month}-${day}`;
    this.index = this.$route.query.index;
    if (this.$route.query.type === '1') {
      let data = videoData.table.filter(item => item.index === this.$route.query.index)[0]
      // if(this.index = 'monitor_qualification'){
      //
      // }
      this.tableHead = data.columns;
      this.cardList = data.card;
      this.showList = data.showList;
      this.optionsStatus = data.optionsStatus;
      this.options = data.options;
      this.optionsName = data.optionsName;
      this.exportUrl = data.exportUrl
    }
    if (this.$route.query.type === '2') {
      let data = carData.table.filter(item => item.index === this.$route.query.index)[0]
@@ -305,6 +314,7 @@
      this.optionsStatus = data.optionsStatus;
      this.options = data.options;
      this.optionsName = data.optionsName;
      this.exportUrl = data.exportUrl
    }
    if (this.$route.query.type === '3') {
      let data = faceData.table.filter(item => item.index === this.$route.query.index)[0]
@@ -314,6 +324,7 @@
      this.optionsStatus = data.optionsStatus;
      this.options = data.options;
      this.optionsName = data.optionsName;
      this.exportUrl = data.exportUrl
    }
    if (this.$route.query.type === '4') {
      let data = equipment.table.filter(item => item.index === this.$route.query.index)[0]
@@ -323,6 +334,7 @@
      this.optionsStatus = data.optionsStatus;
      this.options = data.options;
      this.optionsName = data.optionsName;
      this.exportUrl = data.exportUrl
    }
    this.getList();
  },
@@ -424,10 +436,17 @@
      this.handleQuery();
    },
    /** 导入按钮操作 */
    handleExport() {
    handleImport() {
      this.upload.title = "数据导入";
      this.upload.open = true;
    },
    handleExport(url) {
      this.download(url, {
        ...this.queryParams,
      }, this.$route.query.ruleName+`_${new Date().getTime()}.xlsx`, {
        timeout: 60000
      })
    },
    /** 下载模板 */
    importTemplate() {
      this.download('platform/resourceSecurity/importTemplate', {