| | |
| | | /> |
| | | </div> |
| | | </div> |
| | | </div> --> |
| | | <div class="top" > |
| | | </div>--> |
| | | <div class="top"> |
| | | <p class="task-css"> |
| | | <b style="font-size: 14px; line-height: 18px;">场景</b> |
| | | </p> |
| | |
| | | :ShowLocalVedio="cameraType === 'dataStack'" |
| | | v-if="showSysInfo" |
| | | style="margin-top:-10px" |
| | | /> --> |
| | | />--> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | :tableRuleList="tableRuleList" |
| | | :onSaveScene="saveSceneRule" |
| | | @delete-rule="showRules" |
| | | v-loading="loadingRuleList" |
| | | ></scene-rule> |
| | | </div> |
| | | </div> |
| | |
| | | }, |
| | | computed: { |
| | | selectedCameraIds() { |
| | | let ids = []; |
| | | if (this.TreeDataPool.treeActiveName == 'dataStack') { |
| | | if (this.TreeDataPool.checkedLocalVedio.length > 0) { |
| | | ids = this.TreeDataPool.checkedLocalVedio.map(i => { |
| | | return i.id; |
| | | }) |
| | | |
| | | } |
| | | } else { |
| | | if (this.TreeDataPool.selectedNodes.length > 0) { |
| | | ids = this.TreeDataPool.selectedNodes; |
| | | } |
| | | } |
| | | |
| | | return ids; |
| | | return this.TreeDataPool.selectedNodes; |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | loadingRuleList: false, |
| | | Carmeras: [], |
| | | Camera: new VideoRuleData(), |
| | | tasksTable: {}, |
| | |
| | | prevEl: ".pre-border" |
| | | } |
| | | }, |
| | | showSysInfo: false |
| | | showSysInfo: false, |
| | | requestSeq: "" |
| | | }; |
| | | }, |
| | | watch: { |
| | |
| | | initCameraData() { |
| | | this.$nextTick(() => { |
| | | this.Carmeras = []; |
| | | this.loading = false; |
| | | this.showSysInfo = true; |
| | | if (this.TreeDataPool.treeActiveName == 'dataStack') { |
| | | this.TreeDataPool.checkedLocalVedio.forEach(camera => { |
| | | this.Carmeras.push(new VideoRuleData(camera.id)); |
| | | }); |
| | | } else { |
| | | this.TreeDataPool.selectedNodes.forEach(camera => { |
| | | this.Carmeras.push(new VideoRuleData(camera)); |
| | | }); |
| | | } |
| | | |
| | | this.selectedCameraIds.forEach(cid => { |
| | | this.Carmeras.push(new VideoRuleData(cid)); |
| | | }); |
| | | |
| | | this.$refs.timeSlider.activeTab = this.VideoManageData.TimeRules[0].id; |
| | | this.showRules(); |
| | | }) |
| | |
| | | } |
| | | this.swipercanvasData = swipers; |
| | | }, |
| | | refresh(url,id) { |
| | | this.swipercanvasData.forEach(data=>{ |
| | | if(data.cameraId == id){ |
| | | refresh(url, id) { |
| | | this.swipercanvasData.forEach(data => { |
| | | if (data.cameraId == id) { |
| | | data.baseImg = url; |
| | | } |
| | | }) |
| | | //this.Camera.baseImg = url |
| | | }, |
| | | getCanvasData() { }, |
| | | newUid() { |
| | | |
| | | let originStr = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; |
| | | let originChar = "0123456789abcdef"; |
| | | let len = originChar.length; |
| | | return originStr.replace(/x/g, function (match) { |
| | | return originChar.charAt(Math.floor(Math.random() * len)); |
| | | }); |
| | | }, |
| | | showRules() { |
| | | this.tableRuleList = []; |
| | | |
| | | if (this.selectedCameraIds.length > 0) { |
| | | this.loadingRuleList = true; |
| | | let seq = this.newUid(); |
| | | this.requestSeq = seq; |
| | | |
| | | getLinkSceneRule({ cameraIds: this.selectedCameraIds }).then( |
| | | rsp => { |
| | | if (rsp && rsp.success) { |
| | | this.loadingRuleList = false; |
| | | if (rsp && rsp.success && seq === this.requestSeq) { |
| | | |
| | | this.tableRuleList = rsp.data; |
| | | |
| | |
| | | } |
| | | // this.TreeDataPool.fetchTreeData(); |
| | | } |
| | | ); |
| | | ).catch(() => { |
| | | this.loadingRuleList = false; |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | |
| | | saveSceneRule(groupRule) { |
| | | const payload = { ...groupRule } |
| | | if (!payload.rules) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "规则参数有误" |
| | | }); |
| | | |
| | | return |
| | | } |
| | | |
| | | payload.cameraIds = this.selectedCameraIds; |
| | | |
| | | saveLinkScene(payload).then(rsp => { |
| | | if (rsp && rsp.success) { |
| | | //this.Camera.update(); |
| | | this.initCameraData(); |
| | | // this.showRules(); |
| | | this.$notify({ |
| | | type: "success", |
| | | message: "任务保存成功!" |
| | |
| | | }).catch(err => { |
| | | this.$message({ |
| | | type: "error", |
| | | message: "保存失败!" + err.data |
| | | message: "保存失败!" |
| | | }); |
| | | }); |
| | | }, |
| | |
| | | //height: 100%; |
| | | //padding: 13px 0 20px; |
| | | position: relative; |
| | | .devide{ |
| | | .devide { |
| | | height: 10px; |
| | | background: #E9EBF2; |
| | | background: #e9ebf2; |
| | | } |
| | | .top { |
| | | width: 100%; |
| | |
| | | float: right; |
| | | width: 54%; |
| | | height: 144px; |
| | | .card-box{ |
| | | width: 54%!important; |
| | | .card-box { |
| | | width: 54% !important; |
| | | } |
| | | .eCharts-box{ |
| | | .eCharts-box { |
| | | width: 45%; |
| | | canvas{ |
| | | width: 98%!important; |
| | | } |
| | | canvas { |
| | | width: 98% !important; |
| | | } |
| | | } |
| | | } |
| | | .task-css { |
| | |
| | | .add-btn:hover { |
| | | color: #2249b4; |
| | | } |
| | | |
| | | } |
| | | </style> |
| | | <style lang="scss" scoped> |