fuliqi
2024-09-29 06cf1c7f78a33a22d075d116a3cf40e6b6915b6c
src/views/screen/index.vue
@@ -213,6 +213,7 @@
    return {
      deptList: [],
      deptId: '',
      intervalId: null, // 用于存储定时器的ID
      carList: [],
      videoList: [],
      faceList: [],
@@ -220,49 +221,49 @@
      workOrderRegion: [],
      platformData: null,
      scoreData: {
          自流井区: [
            {
              value: 0,
              name: '得分'
            }
          ],
          高新区: [
            {
              value: 0,
              name: '得分'
            }
          ],
          大安区: [
            {
              value: 0,
              name: '得分'
            }
          ],
          沿滩区: [
            {
              value: 0,
              name: '得分'
            }
          ],
          贡井区: [
            {
              value: 0,
              name: '得分'
            }
          ],
          荣县: [
            {
              value: 0,
              name: '得分'
            }
          ],
          富顺县: [
            {
              value: 0,
              name: '得分'
            }
          ]
        },
        自流井区: [
          {
            value: 0,
            name: '得分'
          }
        ],
        高新区: [
          {
            value: 0,
            name: '得分'
          }
        ],
        大安区: [
          {
            value: 0,
            name: '得分'
          }
        ],
        沿滩区: [
          {
            value: 0,
            name: '得分'
          }
        ],
        贡井区: [
          {
            value: 0,
            name: '得分'
          }
        ],
        荣县: [
          {
            value: 0,
            name: '得分'
          }
        ],
        富顺县: [
          {
            value: 0,
            name: '得分'
          }
        ]
      },
      // 设备数据
      facilityData: {
        video: [],
@@ -309,7 +310,14 @@
      .catch((err) => {
      });
    // 查询数据
    this.getData();
    this.intervalId = setInterval(this.getData,  3600000); //一小时一次
  },
  beforeDestroy() {
    // 组件销毁前清除定时器,防止内存泄漏
    if (this.intervalId) {
      clearInterval(this.intervalId);
      this.intervalId = null;
    }
  },
  methods: {
    getDeptId(deptName) {
@@ -366,7 +374,7 @@
        });
      checkScore(this.activerBtnType, this.deptId)
        .then((res) => {
          if(res.data && Object.keys(res.data).length > 0){
          if (res.data && Object.keys(res.data).length > 0) {
            this.scoreData = res.data;
          }
        })
@@ -374,7 +382,7 @@
        });
      getPlatform(this.activerBtnType, this.deptId)
        .then((res) => {
          if(res.data && Object.keys(res.data).length > 0){
          if (res.data && Object.keys(res.data).length > 0) {
            this.platformData = res.data;
          }
        })
@@ -1118,6 +1126,7 @@
              list-style-type: none;
              border-bottom: 1px dashed #223654;
              margin: 7px 0;
              li {
                width: 25%;
                text-align: center;