| | |
| | | </div> |
| | | <div class="des"> |
| | | <div class="desItem"> |
| | | <i class="iconfont"></i>{{ eventName }} |
| | | <i class="iconfont"></i>等级: {{ eventName }} |
| | | </div> |
| | | <div class="desItem"> |
| | | <i class="iconfont"></i>{{ timeName }} |
| | | <i class="iconfont"></i>时间: {{ timeName }} |
| | | </div> |
| | | <div class="desItem" v-if="rule.desc"> |
| | | <i class="iconfont"></i>{{ rule.desc }} |
| | | <div class="desItem"> |
| | | <i class="iconfont"></i>描述: |
| | | {{ rule.desc ? rule.desc : "-" }} |
| | | </div> |
| | | <div class="desItem" v-if="rule.voice && rule.voice.name"> |
| | | <i class="iconfont"></i>声音: |
| | | {{ rule.voice.name }} |
| | | </div> |
| | | |
| | | <div class="desItem" v-else> |
| | | <i class="iconfont"></i>声音: - |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <div class="empty" @dragover="dragover($event)" @drop="drop" v-else> |
| | | <img src="/images/hashrate/未配置算法空页面.png" alt="" /> |
| | | <img src="/images/hashrate/unSdk.png" alt="" /> |
| | | <div class="des"> |
| | | 暂未配置策略,点击上方操作面板按钮,从操作面板拖到算法到此处,即可配置 |
| | | 暂未配置策略,点击上方操作面板按钮,从操作面板拖动算法到此处,即可配置 |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="control"> |
| | | <div class="title">场景操作</div> |
| | | <span class="close iconfont" @click="deleteRule"></span> |
| | | <div class="content"> |
| | | <div class="btns"> |
| | | <div class="button cancel" @click="backToOrigin">取消</div> |
| | |
| | | |
| | | <script> |
| | | import bus from "@/plugin/bus"; |
| | | import { saveLinkScene, saveCameraScene } from "@/api/scene"; |
| | | import { saveLinkScene, saveCameraScene, deleteCameraScene } from "@/api/scene"; |
| | | |
| | | export default { |
| | | props: { |
| | | rule: {}, |
| | | ruleType: {}, |
| | | cameraId: {}, |
| | | }, |
| | | created() { |
| | | this.getSdkConnection(); |
| | |
| | | delSdk(index) { |
| | | this.rule.rules.splice(index, 1); |
| | | |
| | | if (this.rule.rules[index]) { |
| | | this.rule.rules[index].rule_with_pre = ""; |
| | | if (this.rule.rules.length == 1) { |
| | | this.rule.rules[0].rule_with_pre = ""; |
| | | } |
| | | |
| | | this.update(); |
| | | |
| | | console.log(this.rule.rules); |
| | | }, |
| | |
| | | }, |
| | | save() { |
| | | if (this.ruleType === "separate") { |
| | | this.rule.cameraIds = [this.rule.cameraId]; |
| | | this.rule.cameraIds = [this.cameraId]; |
| | | saveCameraScene(this.rule).then((rsp) => { |
| | | if (rsp && rsp.success) { |
| | | this.$notify({ |
| | | type: "success", |
| | | message: "策略保存成功!", |
| | | }); |
| | | this.backToOrigin(); |
| | | } |
| | | }); |
| | | } else { |
| | | saveLinkScene(this.rule) |
| | | .then((rsp) => { |
| | | if (rsp && rsp.success) { |
| | | this.$notify({ |
| | | type: "success", |
| | | message: "任务保存成功!", |
| | | }); |
| | | } else { |
| | | this.$notify({ |
| | | type: "error", |
| | | message: rsp.data, |
| | | }); |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | this.$message({ |
| | | type: "error", |
| | | message: "保存失败!", |
| | | delete this.rule.camera_polygons; |
| | | saveLinkScene(this.rule).then((rsp) => { |
| | | if (rsp && rsp.success) { |
| | | this.$notify({ |
| | | type: "success", |
| | | message: "任务保存成功!", |
| | | }); |
| | | }); |
| | | this.backToOrigin(); |
| | | } else { |
| | | this.$notify({ |
| | | type: "error", |
| | | message: rsp.data, |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | async deleteRule() { |
| | | if (!this.rule.id) { |
| | | console.log("87878"); |
| | | this.backToOrigin(); |
| | | return; |
| | | } |
| | | const res = await deleteCameraScene(this.rule.id); |
| | | if (res && res.success) { |
| | | this.$notify({ |
| | | type: "success", |
| | | message: "删除成功", |
| | | }); |
| | | this.$emit("deletRule"); |
| | | } |
| | | }, |
| | | update() { |
| | |
| | | |
| | | .desItem { |
| | | margin-top: 7px; |
| | | font-size: 13px; |
| | | .iconfont { |
| | | margin-right: 10px; |
| | | font-size: 16px; |
| | |
| | | } |
| | | |
| | | .control { |
| | | position: relative; |
| | | width: 128px; |
| | | |
| | | .close { |
| | | position: absolute; |
| | | top: 12px; |
| | | right: 15px; |
| | | font-size: 12px; |
| | | color: #e34d59; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .btns { |
| | | display: flex; |
| | | margin-top: 68px; |