{"remainingRequest":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/badp-bcxin-web-5.x-vue/src/components/electronicFenceEdit.vue?vue&type=script&lang=js","dependencies":[{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/src/components/electronicFenceEdit.vue","mtime":1748415977261},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/babel-loader/lib/index.js","mtime":456789000000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":["\n// import { parseTime } from \"@/utils/index\";\n// import selfTable from \"@/components/common/selfTable\";\nimport { createRailAccess, updateRailAccess } from \"@/api/security-station-rails-controller\";\n// import { nanoid } from \"nanoid\";\n\nexport default {\n name: \"trajectory\",\n components: {\n // selfTable,\n },\n props: {\n stationId: String,\n info: {\n type: Object,\n default() {\n return {};\n },\n },\n electronicFenceInfo: {\n type: Object,\n default() {\n return {};\n },\n },\n map: {\n type: Object,\n default() {\n return null;\n },\n },\n stationVisible: {\n type: Boolean,\n default: true,\n },\n },\n watch: {\n info: {\n handler(newVal) {\n console.log(\"newVal\", newVal);\n if (Object.keys(newVal).length !== 0) {\n this.form.stationId = newVal.stationId;\n this.form.peopleNum = newVal.countOfSecurityMan;\n if (Object.keys(this.electronicFenceInfo).length === 0) {\n this.form.stationName = newVal.name;\n }\n }\n },\n immediate: true,\n deep: true,\n },\n electronicFenceInfo: {\n handler(newVal) {\n console.log(\"electronicFenceInfo\", newVal);\n if (newVal && Object.keys(newVal).length !== 0) {\n let deepVal = JSON.parse(JSON.stringify(newVal));\n this.form.stationName = deepVal.stationName;\n this.form.id = deepVal.id;\n this.form.name = deepVal.name;\n this.form.ruleType = deepVal.ruleType;\n this.form.shapeType = deepVal.shapeType;\n this.form.shapedLocation = deepVal.shapedLocation;\n this.form.stationId = deepVal.stationId;\n this.form.peopleNum = deepVal.countOfSecurityMan;\n this.form.time = deepVal.time;\n this.form.note = deepVal.note;\n // if (deepVal.shapeType === \"Circle\") {\n // this.setCircle(deepVal.shapedLocation);\n // } else if (deepVal.shapeType === \"Crib\") {\n // this.setRectangle(deepVal.shapedLocation);\n // } else if (deepVal.shapeType === \"Polygon\") {\n // this.setPolygon(deepVal.shapedLocation);\n // }\n // this.form = newVal\n this.isAdd = false;\n } else {\n this.isAdd = true;\n this.reset();\n }\n },\n immediate: true,\n deep: true,\n },\n },\n data() {\n return {\n isAdd: false,\n typeList: [\n {\n id: \"Exit\",\n name: \"离开告警\",\n },\n {\n id: \"Enter\",\n name: \"进入告警\",\n },\n // {\n // id: \"Access\",\n // name: \"进出告警\",\n // },\n ],\n areaList: [\n {\n id: \"Crib\",\n icon: require(\"@/assets/images/mapToolbar/框选.png\"),\n name: \"框形选择\",\n },\n {\n id: \"Circle\",\n icon: require(\"@/assets/images/mapToolbar/圈选.png\"),\n name: \"圆形选择\",\n },\n {\n id: \"Polygon\",\n icon: require(\"@/assets/images/mapToolbar/多边形选择.png\"),\n name: \"多边形选择\",\n },\n ],\n form: {\n id: \"\",\n name: \"\",\n ruleType: \"Exit\",\n stationId: \"\",\n stationName: \"\",\n peopleNum: \"\",\n time: \"\",\n note: \"\",\n shapeType: \"\",\n peopleList: [],\n shapedLocation: {\n geos: [],\n radius: \"\",\n },\n },\n Circle: null,\n mousetool: null,\n };\n },\n methods: {\n changeAreaType(id) {\n let that = this;\n this.form.shapeType = id;\n if (this.mouseTool) {\n this.mouseTool.close(true);\n }\n this.$emit(\"cleanFigure\");\n if (id === \"Circle\") {\n that.drawCircle();\n } else if (id === \"Crib\") {\n that.drawRectangle();\n } else if (id === \"Polygon\") {\n that.drawPolygon();\n }\n },\n drawPolygon() {\n // todo: draw Polygon\n this.$emit(\"draw\", \"Polygon\");\n },\n drawCircle() {\n // todo: draw Circle\n this.$emit(\"draw\", \"Circle\");\n },\n drawRectangle() {\n // todo: draw Rectangle\n this.$emit(\"draw\", \"Rectangle\");\n },\n setCircle(data) {\n // todo: set circle\n console.log(data);\n },\n setRectangle(data) {\n console.log(data.geos);\n },\n setPolygon(data) {\n console.log(data.geos);\n },\n cancel() {\n if (this.mouseTool) {\n this.mouseTool.close(true);\n }\n this.$emit(\"cancel\");\n },\n updateGeometry({ geos, radius }) {\n this.form.shapedLocation = {\n geos,\n radius,\n };\n console.log(this.form.shapedLocation);\n },\n updateStation(station) {\n console.log(\"updateStation\", station);\n this.form.stationName = station.stationName;\n this.form.peopleNum = station.countOfSecurityMan;\n this.form.stationId = station.stationId;\n },\n reset() {\n console.log(\"reset\", this.stationId);\n console.log(\"reset\", this.form);\n this.form.id = \"\";\n this.form.name = \"\";\n this.form.ruleType = \"Exit\";\n this.form.time = [];\n this.form.note = \"\";\n this.form.shapeType = \"\";\n this.form.stationName = \"\";\n this.form.peopleNum = \"\";\n this.form.shapedLocation = {\n geos: [],\n radius: \"\",\n };\n this.$emit(\"cleanFigure\");\n },\n saveRail() {\n if (this.form.shapedLocation.geos.length === 0) {\n this.$message.warning(\"请选择围栏区域\");\n return;\n }\n // 发送数据到父窗口并请求关闭\n window.parent.postMessage({\n shapeType: this.form.shapeType,\n shapedLocation: this.form.shapedLocation\n }, '*');\n\n // 可选:本地提示\n this.$message.success('数据保存成功,即将关闭窗口');\n }\n },\n};\n",null]}