From 81c9b1f75b80fade52653243b914ccb2677b4a8f Mon Sep 17 00:00:00 2001
From: ZZJ <zzjdsg2300@163.com>
Date: 星期二, 22 三月 2022 18:34:17 +0800
Subject: [PATCH] 禅道bug修复
---
src/pages/cameraAccess/components/SeparateRules.vue | 144 +++++++++++++++++++----------------------------
1 files changed, 59 insertions(+), 85 deletions(-)
diff --git a/src/pages/cameraAccess/components/SeparateRules.vue b/src/pages/cameraAccess/components/SeparateRules.vue
index 6bce67a..6d0872b 100644
--- a/src/pages/cameraAccess/components/SeparateRules.vue
+++ b/src/pages/cameraAccess/components/SeparateRules.vue
@@ -28,25 +28,13 @@
</div>
<div v-if="Camera.analytics" class="flex-box" v-show="cameraType === 'camera'">
- <span class="label">鍒嗚鲸鐜�</span>
- <el-select
- v-model="Camera.selectResolution"
- placeholder="璇烽�夋嫨"
- size="mini"
- style="width: 134px;
- margin-left:10px;"
- >
- <el-option
- v-for="item in Camera.resolutionOption"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
+ <span
+ class="label"
+ >鍒嗚鲸鐜�: {{(Camera.camearInfo.resolution_width == 0 || Camera.camearInfo.resolution_height == 0) ? '鏈満鍒嗚鲸鐜�': `${Camera.camearInfo.resolution_width} * ${Camera.camearInfo.resolution_height}` }}</span>
</div>
<div v-if="Camera.analytics" class="flex-box">
- <span class="label">鏅鸿兘璁$畻鑺傜偣: {{ Camera.runServerName}}</span>
+ <span class="label">SmartAI鑺傜偣: {{ Camera.runServerName}}</span>
</div>
<div v-if="Camera.analytics" class="flex-box">
@@ -229,7 +217,6 @@
</template>
<script>
-//import { timeSilderData } from "@/mockData/timeSilder";
import { savePolygon } from "@/api/polygon";
import {
@@ -238,7 +225,6 @@
import {
saveCameraScene,
- getCameraSceneRule,
} from '@/api/scene'
import { changeRunType } from "@/api/pollConfig";
@@ -247,12 +233,9 @@
import TimeSlider from "./TimeSlider";
import polygonCanvas from "@/components/canvas";
-//import Sysinfo from "./SystemInfo";
import Sysinfo from "@/components/subComponents/SystemInfo";
import SceneRule from "./SceneRule";
import SlideScene from "./scene/SlideScene";
-import { duration } from 'moment';
-
export default {
components: {
@@ -270,11 +253,11 @@
}
},
computed: {
- cameraType () {
+ cameraType() {
return this.TreeDataPool.treeActiveName === 'camera' ? "camera" : "dataStack"
}
},
- data () {
+ data() {
return {
mockSceneData: [],
loading: false,
@@ -292,24 +275,21 @@
prevEl: ".swiper-local-prev"
}
},
- swiperOption: {
- slidesPerView: 5,
- spaceBetween: 8,
- pagination: {
- el: ".swiper-pagination",
- clickable: true
- },
- navigation: {
- nextEl: ".swiper-next-border",
- prevEl: ".swiper-pre-border"
- }
- },
+ // swiperOption: {
+ // slidesPerView: 5,
+ // spaceBetween: 8,
+ // pagination: {
+ // el: ".swiper-pagination",
+ // clickable: true
+ // },
+ // navigation: {
+ // nextEl: ".swiper-next-border",
+ // prevEl: ".swiper-pre-border"
+ // }
+ // },
tableRuleList: [],
cameraId: "",
- activeTaskIndex: 0,
- activeTaskId: "",
- booleanValue: false,
showSysInfo: false,
showCanvas: true,
canvasWidth: 576,
@@ -321,21 +301,20 @@
stackFilesSize: 5,
};
},
- mounted () {
+ mounted() {
this.mockAsync();
this.PollData.statistics();
},
watch: {
'Camera.cameraId': {
- handler (n, o) {
+ handler(n, o) {
if (n) {
if (this.TreeDataPool.treeActiveName == "dataStack") {
this.stackFilesPage = 1;
this.stackFilesSize = 5;
this.stackId = n;
if (this.stackId) {
- console.log('getStackFiles')
this.swipercanvasData = [];
this.getStackFiles()
}
@@ -345,15 +324,11 @@
}
},
methods: {
- prevClick () {
- console.log(this.swiperIndex)
- console.log(this.$refs.swiper.swiper.activeIndex)
+ prevClick() {
if (this.swiperIndex == 0) {
- console.log('鏈鍒嗛〉鐨勭涓�鏉�')
- //璇锋眰涓婁竴椤�
if (this.stackFilesPage > 1) {
this.stackFilesPage--;
- this.getStackFiles();
+ this.getStackFiles(true);
} else {
this.$message({
type: 'info',
@@ -363,17 +338,13 @@
}
},
- nextClick () {
- console.log(this.swiperIndex)
- console.log(this.$refs.swiper.swiper.activeIndex)
+ nextClick() {
if (this.swiperIndex == this.swipercanvasData.length - 1) {
- console.log('鏈�鍚庝竴寮�,鍔犺浇鏇村')
- //璇锋眰涓嬩竴椤�
this.stackFilesPage++;
- this.getStackFiles();
+ this.getStackFiles(true);
}
},
- getStackFiles () {
+ getStackFiles(onClick = false) {
this.getStackFileLoading = true;
let _this = this;
findAllFileByStackId({ name: '', stackId: this.stackId, page: this.stackFilesPage, size: this.stackFilesSize, type: 0 }).then(res => {
@@ -390,20 +361,18 @@
loading: false
}
});
- console.log(_this.swipercanvasData)
- console.log(this.swipercanvasData)
this.swiperIndex = 0;
this.$refs.swiper.swiper.activeIndex = 0;
} else {
- console.log(this.swipercanvasData)
- this.$message({
- type: 'info',
- message: '宸叉棤鏇村鏁版嵁!'
- });
+ if (onClick) {
+ this.$message({
+ type: 'warning',
+ message: '宸叉棤鏇村鏁版嵁!'
+ });
+ }
}
} else {
- console.log(this.swipercanvasData)
this.$message({
type: 'error',
message: '鏁版嵁璇锋眰澶辫触,璇风◢鍚庨噸璇�!'
@@ -411,14 +380,13 @@
}
this.getStackFileLoading = false;
}).catch(e => {
- console.log(e);
this.getStackFileLoading = false;
});
},
- swiperSlideChange () {
+ swiperSlideChange() {
this.swiperIndex = this.$refs.swiper.swiper.activeIndex;
},
- mockAsync () {
+ mockAsync() {
setTimeout(() => {
this.mockSceneData = [
{ scenename: "name1", id: 1, icon: ["iconrenlianjiance", "icongetijingzhi"] },
@@ -444,22 +412,28 @@
];
}, 3000)
},
- drawBaseImg () {
- this.$refs.canvas.showModal();
+ drawBaseImg() {
+ if (Array.isArray(this.$refs.canvas)) {
+ if (this.$refs.canvas.length > 0) {
+ this.$refs.canvas[0].showModal();
+ }
+ } else {
+ this.$refs.canvas.showModal();
+ }
},
- getCanvasData (data) {
+ getCanvasData(data) {
let polyon = { ...data };
polyon.camera_id = this.Camera.cameraId;
savePolygon(polyon).then(rsp => {
this.Camera.getPolygon();
- this.Camera.getCameraTask();
+ //this.Camera.getCameraTask();
});
},
- refresh (url) {
+ refresh(url) {
this.Camera.baseImg = url
},
// 鍒濆鍖栨憚鍍忔満淇℃伅锛岀埗缁勪欢璋冪敤
- async initCameraData (id) {
+ async initCameraData(id) {
this.Camera = new VideoRuleData();
if (id && id !== "") {
@@ -480,7 +454,7 @@
},
- saveSceneRule (groupRule) {
+ saveSceneRule(groupRule) {
const payload = { ...groupRule }
payload.cameraIds = [this.Camera.cameraId];
let _this = this;
@@ -498,15 +472,14 @@
}
});
},
- delScenRule () {
+ delScenRule() {
this.Camera.update();
},
- changeLoading (params) {
+ changeLoading(params) {
this.loading = params
- // console.log(this.loading,'changeLoading',params)
},
//鏄惁杩涜瑙嗛鍒嗘瀽澶勭悊
- pollEnable (row) {
+ pollEnable(row) {
let val = 0
if (row) {
if (this.PollData.RealTimeSum < this.PollData.channelTotal) {
@@ -521,6 +494,7 @@
val = -1
}
if (this.Camera.cameraId && this.Camera.cameraId !== undefined) {
+ debugger
changeRunType({ camera_ids: [this.Camera.cameraId], run_type: val }).then(
rsp => {
if (rsp && rsp.success) {
@@ -534,16 +508,16 @@
message: "閰嶇疆澶辫触"
});
}
- // this.selectCamera(this.TreeDataPool.selectedNode)
+ this.TreeDataPool.fetchTreeData();
}
);
}
- this.TreeDataPool.fetchTreeData();
this.PollData.statisticTaskInfo();
},
//瀹炴椂銆佽疆璇㈠垏鎹�
- changePoll (row) {
+ changePoll(row) {
//鍒ゆ柇鏄柊澧炶繕鏄洿鏂�
+ debugger
if (this.Camera.cameraId && this.Camera.cameraId !== undefined) {
if (this.PollData.RealTimeSum < this.PollData.channelTotal) {
if (row.value) {
@@ -551,6 +525,7 @@
} else {
this.Camera.dealWay = false
}
+ debugger
changeRunType({ camera_ids: [this.Camera.cameraId], run_type: this.Camera.dealWay ? 1 : 0 }).then(
rsp => {
if (rsp && rsp.success) {
@@ -569,6 +544,7 @@
} else {
if (this.Camera.dealWay) {
this.Camera.dealWay = false
+ debugger
changeRunType({ camera_ids: [this.Camera.cameraId], run_type: this.Camera.dealWay ? 1 : 0 }).then(
rsp => {
if (rsp && rsp.success) {
@@ -591,7 +567,7 @@
}
},
//澶嶅埗
- ctrlC () {
+ ctrlC() {
this.TreeDataPool.ctrlCameraId = this.Camera.cameraId;
this.TreeDataPool.ctrlCameraName = this.Camera.cameraName;
this.$notify({
@@ -599,7 +575,7 @@
message: "澶嶅埗绠楁硶鎴愬姛锛�"
})
},
- ctrlV () {
+ ctrlV() {
if (this.Camera.cameraId === this.TreeDataPool.ctrlCameraId) {
this.$notify({
type: "warning",
@@ -611,7 +587,6 @@
sourceId: this.TreeDataPool.ctrlCameraId,
targetIds: [this.Camera.cameraId]
}).then((res) => {
- // console.log(res,'澶嶅埗绠楁硶')
if (res && res.success) {
this.$notify({
type: "success",
@@ -625,7 +600,6 @@
})
}
}).catch(err => {
- // console.log(err,'澶嶅埗绠楁硶鎶ラ敊锛�')
this.$notify({
type: "error",
message: "绮樿创绠楁硶澶辫触锛�"
@@ -637,7 +611,7 @@
</script>
<style lang="scss">
.el-message--info .el-message__content {
- color: #999;
+ color: #999 !important;
}
.swiper-container {
margin-left: auto;
@@ -1023,7 +997,7 @@
}
}
.el-loading-spinner {
- background: url('/images/cameraAccess/loading.gif') no-repeat;
+ background: url("/images/cameraAccess/loading.gif") no-repeat;
top: 50%;
margin-top: -21px;
width: calc(100% - 260px) !important;
--
Gitblit v1.8.0