zhangzengfei
2023-04-12 3639c456d1889cd3e688191a4398af8a3f49679c
添加常量的公共数据. 增加场景名称
1个文件已添加
5个文件已修改
287 ■■■■■ 已修改文件
src/Pool/constants.ts 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mixins.js 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataPush/components/point.vue 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hashrate/CameraManage/CameraRules/components/AddRuleBox.vue 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/manageCenter/index.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personalCenter/components/SubAccount.vue 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Pool/constants.ts
New file
@@ -0,0 +1,56 @@
export default class Constants {
  public sceneNameOptions: Array<object>
  constructor() {
    this.sceneNameOptions = [
      {
        value: "明火",
        label: "明火"
      },
      {
        value: "烟雾",
        label: "烟雾"
      },
      {
        value: "翻越围栏",
        label: "翻越围栏"
      },
      {
        value: "区域入侵",
        label: "区域入侵"
      },
      {
        value: "人员离岗",
        label: "人员离岗"
      },
      {
        value: "人员聚集",
        label: "人员聚集"
      },
      {
        value: "打电话",
        label: "打电话"
      },
      {
        value: "抽烟",
        label: "抽烟"
      },
      {
        value: "未佩戴安全帽",
        label: "未佩戴安全帽"
      },
      {
        value: "未穿工装",
        label: "未穿工装"
      },
      {
        value: "睡岗",
        label: "睡岗"
      },
      {
        value: "未佩戴安全帽(冬)",
        label: "未佩戴安全帽(冬)"
      }
    ]
  }
}
src/mixins.js
@@ -1,25 +1,28 @@
import VideoPhotoData from "@/Pool/VideoPhotoData";
import VideoTaskData from "@/Pool/VideoTaskData";
import TreeDataPool from "@/Pool/TreeData";
import CardList from "@/Pool/CardList";
import DataStackPool from "@/Pool/dataStack";
import AuthData from "@/Pool/AuthData";
import DataPool from "@/Pool/PollData";
import VideoManageData from "@/Pool/VideoManageData";
import TaskMange from "@/Pool/TaskMange";
import drag from "@/plugin/drag";
import VideoPhotoData from "@/Pool/VideoPhotoData"
import VideoTaskData from "@/Pool/VideoTaskData"
import TreeDataPool from "@/Pool/TreeData"
import CardList from "@/Pool/CardList"
import DataStackPool from "@/Pool/dataStack"
import AuthData from "@/Pool/AuthData"
import DataPool from "@/Pool/PollData"
import VideoManageData from "@/Pool/VideoManageData"
import TaskMange from "@/Pool/TaskMange"
import Constants from "@/Pool/constants"
import drag from "@/plugin/drag"
/* eslint-disable */
const onlyVideoPhotoData = new VideoPhotoData();
const onlyVideoTaskData = new VideoTaskData();
const onlyTreeDataPool = new TreeDataPool();
const onlyDataStack = new DataStackPool();
const onlyCardList = new CardList();
const onlyAuthData = new AuthData();
const onlyVideoPhotoData = new VideoPhotoData()
const onlyVideoTaskData = new VideoTaskData()
const onlyTreeDataPool = new TreeDataPool()
const onlyDataStack = new DataStackPool()
const onlyCardList = new CardList()
const onlyAuthData = new AuthData()
const onlyDataPool = new DataPool();
const onlyVideoManageData = new VideoManageData();
const onlyTaskMange = new TaskMange();
const onlyDataPool = new DataPool()
const onlyVideoManageData = new VideoManageData()
const onlyTaskMange = new TaskMange()
const onlyConstants = new Constants()
const mixin = {
  data() {
@@ -33,7 +36,8 @@
      VideoManageData: onlyVideoManageData,
      TaskMange: onlyTaskMange,
      PollData: onlyDataPool,
    };
  },
};
export default mixin;
      Constants: onlyConstants
    }
  }
}
export default mixin
src/views/dataPush/components/point.vue
@@ -171,52 +171,7 @@
      query: {},
      inputText: "", //输入框内容
      cameraOptions: [],
      scene_nameOptions: [
        {
          value: "明火",
          label: "明火"
        },
        {
          value: "烟雾",
          label: "烟雾"
        },
        {
          value: "翻越围栏",
          label: "翻越围栏"
        },
        {
          value: "区域入侵",
          label: "区域入侵"
        },
        {
          value: "人员离岗",
          label: "人员离岗"
        },
        {
          value: "人员聚集",
          label: "人员聚集"
        },
        {
          value: "打电话",
          label: "打电话"
        },
        {
          value: "抽烟",
          label: "抽烟"
        },
        {
          value: "未佩戴安全帽",
          label: "未佩戴安全帽"
        },
        {
          value: "未穿工装",
          label: "未穿工装"
        },
        {
          value: "睡岗",
          label: "睡岗"
        }
      ],
      scene_nameOptions: [],
      isShowAdd: false, //是否展示新增弹窗
      ruleForm: {
        CameraName: "", // 摄像机名称
@@ -273,7 +228,8 @@
    let res = await camerasList(query)
    this.dataList = res.data
    this.total = res.total
    this.aaaaa()
    this.scene_nameOptions = this.Constants.sceneNameOptions
    this.pageInit()
  },
  methods: {
@@ -330,7 +286,7 @@
      this.ruleForm.updatedAt = row.updatedAt
      this.ruleForm.id = row.id
    },
    async aaaaa() {
    async pageInit() {
      // 进入页面前的初始化
      let res = await camerasConfig()
      // 总开关
src/views/hashrate/CameraManage/CameraRules/components/AddRuleBox.vue
@@ -76,61 +76,9 @@
  components: {
    TimeSlider
  },
  mounted() {
    console.log(this.editData)
    this.getSounds()
    this.eventAudio.addEventListener("ended", () => {
      this.togglePlay = true
    })
  },
  data() {
    return {
      scene_nameOptions: [
        {
          value: "明火",
          label: "明火"
        },
        {
          value: "烟雾",
          label: "烟雾"
        },
        {
          value: "翻越围栏",
          label: "翻越围栏"
        },
        {
          value: "区域入侵",
          label: "区域入侵"
        },
        {
          value: "人员离岗",
          label: "人员离岗"
        },
        {
          value: "人员聚集",
          label: "人员聚集"
        },
        {
          value: "打电话",
          label: "打电话"
        },
        {
          value: "抽烟",
          label: "抽烟"
        },
        {
          value: "未佩戴安全帽",
          label: "未佩戴安全帽"
        },
        {
          value: "未穿着工作服",
          label: "未穿着工作服"
        },
        {
          value: "睡岗",
          label: "睡岗"
        }
      ],
      scene_nameOptions: [],
      ruleForm: {
        time_name: "",
        alarm_level: 1,
@@ -175,6 +123,14 @@
    }
  },
  mounted() {
    this.getSounds()
    this.eventAudio.addEventListener("ended", () => {
      this.togglePlay = true
    })
    this.scene_nameOptions = this.Constants.sceneNameOptions
  },
  methods: {
    //编辑时回填数据
    initEditData() {
src/views/manageCenter/index.vue
@@ -160,7 +160,7 @@
      <div class="hashRate">
        <div class="left">
          <div class="title">预警数据占比:</div>
          <div class="title">整改数据详情</div>
          <div class="info">
            <div class="equipmentInfo" style="margin-top: 25px">
              <div class="equipmentCard">
@@ -683,17 +683,20 @@
    //key 1=误报数据,2=已整改,3=未整改,4=已排查 doc_count=数量 total=总量
    decodeWarningRate(b64data) {
      if (b64data) {
        this.warningTotal = 0
        this.warningSolved = 0
        this.warningChecked = 0
        this.warningTotal = 0 // 总量
        this.warningSolved = 0 // 已整改
        this.warningChecked = 0 //已排查
        let falseAlarm = 0 // 误报
        let decodeString = Base64.decode(b64data)
        if (decodeString != "") {
          let decodeResult = JSON.parse(decodeString)
          if (decodeResult && decodeResult.total > 0) {
            this.warningTotal = decodeResult.total
            decodeResult.buckets.forEach((element) => {
              switch (element.key) {
                case 1:
                  falseAlarm += element.doc_count
                  break
                case 2:
                  this.warningSolved += element.doc_count
                  break
@@ -704,6 +707,10 @@
                  break
              }
            })
            // 2023/4/12 修改, 预警总量不统计误报
            // this.warningTotal = decodeResult.total - falseAlarm
            this.warningTotal = decodeResult.total
          }
          // console.log("WarningRate:", decodeResult)
        }
src/views/personalCenter/components/SubAccount.vue
@@ -252,54 +252,6 @@
    TreeMenu
  },
  computed: {
    taskOptions() {
      return [
        {
          value: "明火",
          label: "明火"
        },
        {
          value: "烟雾",
          label: "烟雾"
        },
        {
          value: "翻越围栏",
          label: "翻越围栏"
        },
        {
          value: "区域入侵",
          label: "区域入侵"
        },
        {
          value: "人员离岗",
          label: "人员离岗"
        },
        {
          value: "人员聚集",
          label: "人员聚集"
        },
        {
          value: "打电话",
          label: "打电话"
        },
        {
          value: "抽烟",
          label: "抽烟"
        },
        {
          value: "未佩戴安全帽",
          label: "未佩戴安全帽"
        },
        {
          value: "未穿工装",
          label: "未穿工装"
        },
        {
          value: "睡岗",
          label: "睡岗"
        }
      ]
    },
    showHeadName() {
      return this.$route.path === "/personalCenter"
    }
@@ -334,6 +286,7 @@
          enable: true
        }
      },
      taskOptions: [],
      options: {
        lazy: true,
        lazyLoad(node, resolve) {
@@ -435,6 +388,7 @@
    this.fetchDataTree()
  },
  mounted() {
    this.taskOptions = this.Constants.sceneNameOptions
    this.TreeDataPool.reset()
    this.TreeDataPool.multiple = true
    this.VideoPhotoData.queryTaskList()