| | |
| | | } else { |
| | | sdkItem = this.$store.state.newSdk; |
| | | } |
| | | console.log(typeof sdkItem.argDef); |
| | | if (typeof sdkItem.argDef === "string") { |
| | | sdkItem.argDef = JSON.parse(sdkItem.argDef); |
| | | } |
| | |
| | | initPolygon() { |
| | | let cameras = []; |
| | | if (this.linkEditCamera) { |
| | | this.allPolygonData = []; |
| | | cameras = this.linkEditCamera; |
| | | this.linkEditCamera.forEach((camera) => { |
| | | camera.polygon.forEach((polygon) => { |
| | | this.allPolygonData.push({ |
| | | defence_state: polygon.defenceState, |
| | | polygonId: polygon.id, |
| | | name: camera.cameraName + ":" + polygon.name, |
| | | cameraId: camera.cameraId, |
| | | }); |
| | | }); |
| | | }); |
| | | } else { |
| | | cameras = [...this.Cameras]; |
| | | } |
| | | for (let i = 0; i < cameras.length; i++) { |
| | | let polyOpt = cameras[i].polygonData.map((p) => { |
| | | return { |
| | | defence_state: p.defence_state, |
| | | polygonId: p.id, |
| | | name: |
| | | this.isLinkRule || this.linkEditCamera |
| | | ? cameras[i].cameraName + ":" + p.name |
| | | : p.name, |
| | | |
| | | for (let i = 0; i < cameras.length; i++) { |
| | | let polyOpt = cameras[i].polygonData.map((p) => { |
| | | return { |
| | | defence_state: p.defence_state, |
| | | polygonId: p.id, |
| | | name: |
| | | this.isLinkRule || this.linkEditCamera |
| | | ? cameras[i].cameraName + ":" + p.name |
| | | : p.name, |
| | | |
| | | cameraId: cameras[i].cameraId, |
| | | }; |
| | | }); |
| | | this.allPolygonData = this.allPolygonData.concat(polyOpt); |
| | | cameraId: cameras[i].cameraId, |
| | | }; |
| | | }); |
| | | this.allPolygonData = this.allPolygonData.concat(polyOpt); |
| | | } |
| | | } |
| | | |
| | | this.$forceUpdate(); |
| | |
| | | optArgDesc.substring(optArgDesc.length - 1, optArgDesc.length); |
| | | optArgDesc += ")"; |
| | | tempObj.sdk_set = defaultArgs.concat(optArgs); |
| | | tempObj.icon_blob = this.$store.state.newSdk.iconBlob; |
| | | |
| | | if (this.editSdk) { |
| | | tempObj.icon_blob = this.editSdk.icon_blob; |
| | | this.$emit("getEditSdk", tempObj); |
| | | } else { |
| | | tempObj.icon_blob = this.$store.state.newSdk.iconBlob; |
| | | this.$emit("getNewSdk", tempObj); |
| | | } |
| | | }, |