xiangpei
2024-09-03 c30d5534c86d48cdd94d06b6760aeb57df56963f
src/views/system/data-manage/data-detail/index.vue
@@ -2,7 +2,8 @@
  <div class="app-container">
    <el-card class="box-card" v-show="index !== 'image_resource_security'">
      <el-row style="display: flex; flex-direction: row; align-items: center" justify="space-between">
        <div v-for="card in cardList" style="display: flex;flex-direction: row; margin-right: 50px" :key="card.label">
        <div style="margin-right: 20px;font-size: 18px">{{ruleName}}</div>
        <div v-if="cardList && cardList.length > 0" v-for="card in cardList" style="display: flex;flex-direction: row; margin-right: 50px" :key="card.label">
          <div>
            <div class="icon-container">
              <i :class="card.icon"></i>
@@ -25,7 +26,7 @@
      </el-row>
    </el-card>
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
    <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
          @keyup.enter.native="handleQuery" />
@@ -82,12 +83,13 @@
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <div v-if="tableData.list && tableData.list.length >0">
    <right-toolbar :showSearch.sync="showSearch" @queryTable="handleQuery" :columns="showList"></right-toolbar>
    <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" :key="index" v-if="item"/>
        <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>
    </div>
    <el-empty v-else description="暂无数据"></el-empty>
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />
@@ -149,27 +151,13 @@
import { getToken } from "@/utils/auth";
export default {
  name: "Platform",
  // watch: {
  //   tableData: {
  //     immediate: true,
  //     deep: true,
  //     handler(newVal) {
  //       if(newVal && newVal.list) {
  //         this.list = newVal.detail;
  //       }
  //     }
  //   }
  // },
  // computed: {
  //   startTime() {
  //     var date = new Date();
  //     var s1 = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + (date.getDate()-1);
  //     return s1;
  //   }
  // },
  computed: {
    ruleName() {
      return this.$route.query.ruleName
    }
  },
  data() {
    return {
      list: [],
      // 导入参数
      upload: {
        // 是否显示弹出层
@@ -238,6 +226,7 @@
        ],
      },
      showList: [],
      tableHead: [],
      cardList: [],
      index: null
@@ -261,29 +250,43 @@
    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]
      this.tableHead = data.columns;
      this.cardList = data.card;
      console.log(this.cardList, "wcnm")
      this.showList = data.showList;
    }
    if (this.$route.query.type === '2') {
      let data = carData.table.filter(item => item.index === this.$route.query.index)[0]
      this.tableHead = data.columns;
      this.cardList = data.card;
      this.showList = data.showList;
    }
    if (this.$route.query.type === '3') {
      let data = faceData.table.filter(item => item.index === this.$route.query.index)[0]
      this.tableHead = data.columns;
      this.cardList = data.card;
      this.showList = data.showList;
    }
    if (this.$route.query.type === '4') {
      let data = equipment.table.filter(item => item.index === this.$route.query.index)[0]
      this.tableHead = data.columns;
      this.cardList = data.card;
      this.showList = data.showList;
    }
    this.getList();
  },
  methods: {
    showListPD(item) {
      if (!this.showList) {
        return true
      }
      let arr = this.showList.filter(d => d.label === item.label)
      if (item && (!arr || arr.length <1)) {
        return true;
      } else {
        return item && arr && arr.length > 0 && arr[0].visible
      }
    },
    /** 修改按钮操作 */
    handleResourceUpdate(row) {
      this.reset("resourceForm");