src/pages/labelMark/components/RightSide.vue
@@ -9,7 +9,7 @@
        element-loading-text="加载中"
        type="border-card"
      >
        <el-tab-pane label="位置标注" name="1">
        <el-tab-pane label="位置标定" name="1">
          <el-tabs type="border-card">
            <el-tab-pane label="摄像机标注" name="11">
              <div class>
@@ -312,7 +312,7 @@
          </div>
        </el-tab-pane>
      </el-tabs>
      <el-dialog class="dialog-group" title="新建分组" :visible.sync="groupModelVisible">
      <el-dialog class="dialog-group" :title="groupForm.id?'编辑分组':'新建分组'" :visible.sync="groupModelVisible">
        <el-form :model="groupForm" ref="groupForm">
          <el-form-item>
            <label>分组名称</label>
@@ -347,7 +347,7 @@
import { getCamerasByServer } from '@/api/pollConfig';
import { getCameraMarks, updateCameraMarks, findCameraGroups, saveCameraGroupInfo, delCameraGroup } from '@/api/camera';
import { getSearchList } from '@/api/search';
import TreeDataPool from "@/Pool/TreeData";
import { isNonnegativeInteger } from '@/scripts/validate';
import { getAllPolygon, saveRelationPolygon, findByCamGroup, findByGroup, delRelation } from '@/api/polygon';
import SlideCanvas from './SlideCanvas';
@@ -356,50 +356,42 @@
  components: { SlideCanvas },
  data () {
    return {
      labels: [],
      colorPick: '#79f2fb',
      dotSize: 3,
      isEdit: false,
      isShowPop: false,
      isNewLabel: false,
      // labels: [],
      // colorPick: '#79f2fb',
      // dotSize: 3,
      // isEdit: false,
      // isShowPop: false,
      // isNewLabel: false,
      // curLabel: {
      //   id: '',
      //   posX: '',
      //   posY: '',
      //   x: '',
      //   y: ''
      //   x1: '',
      //   y1: '',
      //   x0: '',
      //   y0: ''
      // },
      curLabel: {
        id: '',
        x1: '',
        y1: '',
        x0: '',
        y0: ''
      },
      rules: {
        x1: [
          { validator: isNonnegativeInteger, trigger: 'change' }
        ],
        y1: [
          { validator: isNonnegativeInteger, trigger: 'change' }
        ]
      },
      baseUrl: '',
      snapshot_url: '',
      userImg: '',
      cameraData: [],
      traceX: 0,
      traceY: 0,
      isShowCurPos: false,
      actPage: '1',
      loading: false,
      spaceWidth: '',
      spaceHeight: '',
      curCameraData: {
        cameraId: '',
        coords: []
      },
      relativeCameras: [],
      // rules: {
      //   x1: [
      //     { validator: isNonnegativeInteger, trigger: 'change' }
      //   ],
      //   y1: [
      //     { validator: isNonnegativeInteger, trigger: 'change' }
      //   ]
      // },
      // baseUrl: '',
      // snapshot_url: '',
      // userImg: '',
      // cameraData: [],
      // traceX: 0,
      // traceY: 0,
      // isShowCurPos: false,
      // actPage: '1',
      // loading: false,
      // spaceWidth: '',
      // spaceHeight: '',
      // curCameraData: {
      //   cameraId: '',
      //   coords: []
      // },
      relativeList: [],
      cameraAreas: [],
      groupModelVisible: false,
@@ -437,12 +429,7 @@
      },
      deep: true
    },
    // 'TreeDataPool.selectedNodes': {
    //   handler (n, o) {
    //   },
    //   deep: true
    // },
    isEdit (n, o) {
      if (n) {
        this.$refs['editBoard'].addEventListener('click', this.bindListen);
@@ -453,7 +440,6 @@
  },
  methods: {
    polygonUpdate(){
      debugger
      this.getAllGroups();
    },
    delRelation (item) {
@@ -506,13 +492,7 @@
        }
      })
    },
    saveRelativeList () {
      let params = {
        groupId: this.curGroup.id,
      }
      //saveRelationPolygon().then()
    },
    async findPolygonByIds (cameras) {
      for (var i = 0; i < cameras.length; i++) {
        let res = await getAllPolygon({ cameraId: cameras[i].id });
@@ -678,13 +658,8 @@
        cameras: []
      }
    },
    changeTab () {
      if (this.actPage == '1') {
        this.$parent.$children[0].$el.parentNode.parentElement.style.display = 'block';
      } else {
        this.$parent.$children[0].$el.parentNode.parentElement.style.display = 'none';
      }
    },
//labelMark start
    sure () {
      let _this = this;
      this.$refs['labelForm'].validate(valid => {
@@ -742,9 +717,6 @@
    onChange (file, fileList) {
      fileList = [file]
      this.isShowCurPos = false;
      // this.traceX = e.offsetX;
      // this.traceY = e.offsetY;
      //fileList.push(file)
    },
    definedUpload (params) {
      let _file = params.file
@@ -767,18 +739,6 @@
        console.log(e)
      })
    },
    // async getAllCameraData () {
    //   let res = await getCamerasByServer();
    //   this.cameraData = res.data;
    //   let tempArr = [];
    //   this.cameraData.forEach(camera=>{
    //     getAllPolygon({ cameraId: camera.id }).then(res=>{
    //       tempArr.push(res.data);
    //     })
    //   });
    //   this.cameraAndPolygonData = tempArr;
    //   console.log(this.cameraAndPolygonData)
    // },
    bindListen (e) {
      this.newLabel(e);
    },
@@ -803,13 +763,11 @@
      this.isNewLabel = true;
    },
    editLabel (label) {
      debugger
      if (!this.isEdit) return;
      this.isShowPop = true;
      this.$refs['labelForm'].clearValidate();
      this.curLabel = JSON.parse(JSON.stringify(label));
      console.log(this.curLabel)
      //this.curLabel = label;
    },
    cancle () {
      this.isShowPop = false;
@@ -1011,8 +969,6 @@
        }
        //color: #4966b7
      }
    }
    .img-card {
    }
    .upload-demo,
    .el-upload {