龚焕茏
2024-07-17 7ab713ab85eec0b4f6b6332ddc207a698be3db0f
src/views/system/data-manage/data-detail/index.vue
@@ -129,7 +129,9 @@
<script>
import { listPlatform, getPlatform, delPlatform, addPlatform, updatePlatform } from "@/api/platform/vehicle-data-monitor";
import { tableColumn } from "./list";
import { videoData, carData, faceData, equipment } from "./list";
import store from '@/store';
export default {
  name: "Platform",
  data() {
@@ -178,8 +180,15 @@
      tableHead: []
    };
  },
  beforeRouteEnter(to, from, next) {
    console.log(to);
    next();
  },
  created() {
    this.tableHead = tableColumn[0].columns;
    if (this.$route.query.type === '1') this.tableHead = videoData[this.$route.query.index].columns;
    if (this.$route.query.type === '2') this.tableHead = carData[this.$route.query.index].columns;
    if (this.$route.query.type === '3') this.tableHead = faceData[this.$route.query.index].columns;
    if (this.$route.query.type === '4') this.tableHead = equipment[this.$route.query.index].columns;
    this.getList();
  },
  methods: {
@@ -225,9 +234,9 @@
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
      this.ids = selection.map(item => item.id);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    /** 新增按钮操作 */
    handleAdd() {
@@ -238,7 +247,7 @@
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      const id = row.id || this.ids;
      getPlatform(id).then(response => {
        this.form = response.data;
        this.open = true;
@@ -279,7 +288,7 @@
    handleExport() {
      this.download('platform/platform/export', {
        ...this.queryParams
      }, `platform_${new Date().getTime()}.xlsx`)
      }, `platform_${new Date().getTime()}.xlsx`);
    }
  }
};