ZZJ
2022-04-12 994e5e08cba4e6b9ce321b7cf5cb1ec8d19dfa22
src/views/hashrate/CameraManage/CameraInfo/index.vue
@@ -77,33 +77,6 @@
          <el-form-item label="事件声音">
            <div class="flex-wrap">
              <el-switch v-model="form.voiceEnable" :width="56"></el-switch>
              <!-- 屏蔽声音选择,调整到场景 -->
              <!-- <el-select
                v-model="voice"
                placeholder="选择声音"
                size="small"
                value-key="id"
                @change="selSound"
              >
                <el-option
                  v-for="item in soundList"
                  :key="item.id"
                  :label="item.name"
                  :value="item"
                ></el-option>
              </el-select>
              <span class="player-btn" @click="togglePlayer" style="cursor:pointer;">
                <i
                  v-if="togglePlay"
                  class="el-icon-video-play"
                  style="font-size:26px; vertical-align:middle; color:#409eff"
                ></i>
                <i
                  v-else
                  class="el-icon-video-pause"
                  style="font-size:26px; vertical-align:middle; color:#409eff"
                ></i>
              </span>-->
            </div>
          </el-form-item>
        </div>
@@ -118,7 +91,7 @@
          </el-form-item>
        </div>
        <div class="row">
        <!--   <div class="row">
          <el-form-item label="所属集群">
            <el-select
              v-model="form.cluster"
@@ -134,7 +107,7 @@
              ></el-option>
            </el-select>
          </el-form-item>
        </div>
        </div> -->
        <!-- 添加传感器 -->
        <CameraInfoEditor
@@ -277,6 +250,9 @@
      type: Array,
    },
  },
  created() {
    document.querySelector("html").style["min-width"] = "1280px";
  },
  data() {
    return {
      videoItem: null,
@@ -350,7 +326,7 @@
      getSoundList()
        .then((res) => {
          if (res.success) {
            this.soundList = res.data;
            this.soundList = res.data.voices;
          }
        })
        .catch((e) => console.log(e));
@@ -396,16 +372,9 @@
      this.$refs.addForm.resetFields();
      this.voice = null;
      // this.initFormData();
      // this.$refs.addForm.clearValidate();
      if (node.type === "4") {
        console.log(getCameraInfo);
        getCameraInfo(node.id).then((res) => {
          if (res.success) {
            // console.log(res, '获取摄像机信息')
            console.log(5555555);
            if (res.data.resolutions) {
              let list = res.data.resolutions.map((i) => {
                let obj = {};
@@ -438,7 +407,7 @@
                this.form.isAI = false;
              }
              this.form.resolution =
                this.form.resolution_width + "*" + this.form.resolution_height;
                this.form.resolutionWidth + "*" + this.form.resolutionHeight;
            });
          }
        });
@@ -459,10 +428,10 @@
            ? 0
            : parseFloat(this.form.longitude);
          this.form.sensors = list;
          this.form.resolution_width = Number(
          this.form.resolutionWidth = Number(
            this.form.resolution.split("*")[0]
          );
          this.form.resolution_height = Number(
          this.form.resolutionHeight = Number(
            this.form.resolution.split("*")[1]
          );
          let _this = this;
@@ -473,7 +442,16 @@
              this.isGb28182
            );
            console.log(this.TreeDataPool.selectedNode);
            updateCameraInfo(this.form)
            let tem = {
              camera: this.form,
              sensors: this.form.sensors,
              areaid: this.form.areaid,
            };
            tem.camera.clusterId = this.TreeDataPool.clusterId;
            tem.camera.devId = this.TreeDataPool.devId;
            updateCameraInfo(tem)
              .then((rsp) => {
                if (rsp.success) {
                  this.$notify({
@@ -506,7 +484,15 @@
              });
          } else {
            this.form.areaid = this.addParentId;
            createCamera(this.form)
            let tem = {
              camera: this.form,
              sensors: this.form.sensors,
              areaid: this.form.areaid,
            };
            tem.camera.clusterId = this.TreeDataPool.clusterId;
            tem.camera.devId = this.TreeDataPool.devId;
            createCamera(tem)
              .then((rsp) => {
                if (rsp.success) {
                  this.$notify({
@@ -543,11 +529,11 @@
          name: this.form.name,
          rtsp: this.form.rtsp,
          id: this.form.id,
          isRunning: this.form.run_enable,
          isRunning: this.form.runEnable,
          cameraType: this.form.type,
        };
        console.log(this.videoItem.rtsp);
        console.log(this.videoItem);
      });
    },
    // * 验证必选项
@@ -574,7 +560,11 @@
        cancelButtonClass: "comfirm-class-cancle",
        confirmButtonClass: "comfirm-class-sure",
      }).then(() => {
        delCamera(this.form.id).then((res) => {
        delCamera({
          id: this.form.id,
          clusterId: this.TreeDataPool.clusterId,
          devId: this.TreeDataPool.devId,
        }).then((res) => {
          if (res.success) {
            this.initFormData();
            this.$notify({