| | |
| | | <el-form-item label="图标"> |
| | | <!-- 图片预览 --> |
| | | <div class="icon-preview-container"> |
| | | <el-image :src="sceneForm.iconUrl?sceneForm.iconUrl + '?t=' + timestamp:'/opt/smart/icon/task_icon.png'" fit="cover" /> |
| | | <!-- <el-image v-else src="@/assets/img/容器@1x.png" fit="cover" /> --> |
| | | <el-image v-if="sceneForm.iconUrl" |
| | | :src="sceneForm.iconUrl + '?t=' + timestamp"></el-image> |
| | | <!-- <el-image :src="sceneForm.iconUrl?'http://192.168.1.235:7009'+sceneForm.iconUrl + '?t=' + timestamp:'http://192.168.1.235:7009/opt/smart/icon/task_icon.png'" fit="cover" /> --> |
| | | <img v-else src="@/assets/img/空白.png" fit="cover" /> |
| | | <!-- <img style="width: 60px;" v-else src="@/assets/img/容器@1x.png" /> --> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label="事件等级"> |
| | | <el-form-item label="事件等级" required> |
| | | <el-select v-model="sceneForm.alarm_level" placeholder="请选择" size="mini" style="width: 250px"> |
| | | <el-option label="一级" :value="1"></el-option> |
| | | <el-option label="二级" :value="2"></el-option> |
| | |
| | | <el-option label="五级" :value="5"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="时间段"> |
| | | <el-form-item label="时间段" required> |
| | | <el-select v-model="sceneForm.workTimeId" placeholder="请选择" size="mini"> |
| | | <el-option v-for="item in VideoManageData.TimeRules" :key="item.id" :label="item.name" |
| | | :value="item.id"></el-option> |
| | |
| | | </div> |
| | | <div class="right"> |
| | | |
| | | <el-form-item label="任务名称"> |
| | | <el-input v-model="sceneForm.scene_name" size="mini" maxlength="15"></el-input> |
| | | <el-form-item label="任务名称" required> |
| | | <el-input v-model="sceneForm.scene_name" placeholder="请输入任务名称" size="mini" maxlength="15"></el-input> |
| | | </el-form-item> |
| | | <!-- 预警规则 --> |
| | | <el-form-item label="任务描述"> |
| | | <el-form-item label="任务描述" required> |
| | | <!-- <el-select v-model="sceneForm.warningRules" placeholder="请选择" size="mini" multiple> |
| | | <el-option v-for="item in VideoManageData.ruleOptions" :key="item.ruleId" :label="item.fileName" |
| | | :value="item.ruleId"></el-option> |
| | |
| | | created() { |
| | | this.userInfo = sessionStorage.getItem("userInfo") && JSON.parse(sessionStorage.getItem("userInfo")) |
| | | }, |
| | | computed: { |
| | | isGb28182() { |
| | | return this.TreeDataPool.selectedNode.cameraType === 1 |
| | | } |
| | | }, |
| | | mounted() { |
| | | // window.addEventListener('resize', this.windowSizeChange) |
| | | this.getSounds(); |
| | |
| | | this.sceneForm.iconUrl = rule.iconUrl |
| | | // 更新时间戳强制刷新图片 |
| | | this.timestamp = Date.now(); |
| | | console.info(this.sceneForm.iconUrl) |
| | | console.info("iconUrl:" + this.sceneForm.iconUrl) |
| | | // 执行预警判断逻辑 |
| | | }, |
| | | handleRuleCreate(newRule) { |
| | | // console.log('创建新规则:', newRule); |
| | | this.sceneForm.ruleName = newRule.fileName |
| | | this.sceneForm.warningRules = [] |
| | | this.sceneForm.rules = [] |
| | | // 将新规则保存到后端 |
| | | if (newRule) { |
| | | // console.log('创建新规则:', newRule); |
| | | this.sceneForm.ruleName = newRule.fileName |
| | | this.sceneForm.warningRules = [] |
| | | this.sceneForm.rules = [] |
| | | this.sceneForm.iconUrl = newRule.iconUrl |
| | | console.log(this.sceneForm) |
| | | // 将新规则保存到后端 |
| | | } else { |
| | | this.sceneForm.ruleName = null |
| | | this.sceneForm.warningRules = [] |
| | | this.sceneForm.rules = [] |
| | | this.sceneForm.iconUrl = null |
| | | } |
| | | }, |
| | | getSoundById(id) { |
| | | if (id) { |
| | |
| | | time_rule_id: "", |
| | | voice: {}, |
| | | voiceId: "", |
| | | iconUrl:"" |
| | | iconUrl: "" |
| | | }; |
| | | // this.$refs.sceneEditor.cleanRule(); |
| | | // this.$refs.sceneEditor.getSdkConnection(); |
| | |
| | | ? this.bubbleSort(tempArr)[tempArr.length - 1] + 1 |
| | | : 1; |
| | | |
| | | this.sceneForm.scene_name = "场景" + latest; |
| | | // this.sceneForm.scene_name = "场景" + latest;//去掉初始化名称 |
| | | //初始化时间段 |
| | | this.sceneForm.time_rule_id = this.VideoManageData.TimeRules[0].id; |
| | | }, |
| | |
| | | return true; |
| | | }, |
| | | saveSceneRule() { |
| | | console.log(this.Camera) |
| | | if (!this.validateForm()) { |
| | | return; |
| | | } |
| | |
| | | this.sceneForm.taskDescription = this.sceneForm.desc |
| | | this.sceneForm.knows = fileIds, |
| | | this.sceneForm.createUser = this.userInfo.id |
| | | this.sceneForm.type = this.isGb28182 ? 1 : 0 |
| | | // console.info(this.sceneForm) |
| | | this.onSaveScene(this.sceneForm); |
| | | }, |