| | |
| | | </el-col> |
| | | <el-col :span="9" :offset="1"> |
| | | <el-form-item label="事件声音"> |
| | | <div class="flex-wrap" style="margin-left:-10px"> |
| | | <div class="flex-wrap" style="margin-top: 10px;"> |
| | | <el-switch v-model="form.voiceEnable" :width="50"></el-switch> |
| | | <el-select |
| | | <!-- 屏蔽声音选择,调整到场景 --> |
| | | <!-- <el-select |
| | | v-model="voice" |
| | | placeholder="选择声音" |
| | | size="small" |
| | |
| | | class="el-icon-video-pause" |
| | | style="font-size:26px; vertical-align:middle; color:#409eff" |
| | | ></i> |
| | | </span> |
| | | </span>--> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | // console.log(list, "sensor") |
| | | // id为空,新增摄像机 |
| | | |
| | | if (this.form.voiceEnable && this.form.voiceId === "") { |
| | | this.$notify({ |
| | | type: "error", |
| | | message: "请选择一个事件声音" |
| | | }); |
| | | // if (this.form.voiceEnable && this.form.voiceId === "") { |
| | | // this.$notify({ |
| | | // type: "error", |
| | | // message: "请选择一个事件声音" |
| | | // }); |
| | | |
| | | return; |
| | | } |
| | | // return; |
| | | // } |
| | | |
| | | this.$refs[formName].validate(async valid => { |
| | | if (valid) { |
| | |
| | | message: "摄像机信息修改失败!" |
| | | }); |
| | | } |
| | | }).catch(err => { |
| | | this.$notify({ |
| | | type: "error", |
| | | message: err.data |
| | | }); |
| | | }); |
| | | } else { |
| | | this.form.areaid = this.addParentId; |
| | |
| | | |
| | | <template v-for="stack in DataStackPool.dirs"> |
| | | <!-- 文件上传组件 --> |
| | | <file-uploader :ref="`uploader_${stack.id}`" :key="stack.id" v-show="activeName === 'uploading' && stack.id == DataStackPool.selectedDir.id" :sourceType="stack.type" /> |
| | | <!-- <file-uploader ref="uploader" v-show="activeName === 'uploading'" /> --> |
| | | <file-uploader |
| | | :ref="`uploader_${stack.id}`" |
| | | :key="stack.id" |
| | | v-show="activeName === 'uploading' && stack.id == DataStackPool.selectedDir.id" |
| | | :sourceType="stack.type" |
| | | /> |
| | | </template> |
| | | <!-- 文件预览 --> |
| | | <el-dialog title="查看文件" :visible.sync="previewDialog" width="500px"> |
| | |
| | | this.$root.$children[0].$children[1].$refs['sepRule'].getStackFiles(); |
| | | } |
| | | }, |
| | | |
| | | }, |
| | | methods: { |
| | | preview (row) { |
| | |
| | | vertical-align: middle; |
| | | } |
| | | .snapshot-video { |
| | | background: url('/images/cameraAccess/video.png'); |
| | | background: url("/images/cameraAccess/video.png"); |
| | | background-repeat: round; |
| | | } |
| | | .snapshot-image { |
| | | background: url('/images/cameraAccess/image.png'); |
| | | background: url("/images/cameraAccess/image.png"); |
| | | background-repeat: round; |
| | | } |
| | | .snapshot-audio { |
| | | background: url('/images/cameraAccess/audio.png'); |
| | | background: url("/images/cameraAccess/audio.png"); |
| | | background-repeat: round; |
| | | } |
| | | .snapshot-files { |
| | | background: url('/images/cameraAccess/files.png'); |
| | | background: url("/images/cameraAccess/files.png"); |
| | | background-repeat: round; |
| | | } |
| | | } |
| | |
| | | <el-form-item label="场景描述"> |
| | | <el-input v-model="sceneForm.desc" type="textarea" size="mini"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="事件声音"> |
| | | <el-select |
| | | v-model="sceneForm.voice" |
| | | placeholder="空" |
| | | size="small" |
| | | value-key="id" |
| | | @change="selSound" |
| | | > |
| | | <el-option v-for="item in soundList" :key="item.id" :label="item.name" :value="item"></el-option> |
| | | </el-select> |
| | | <span |
| | | @click="togglePlayer" |
| | | style="cursor:pointer; margin-left:20px" |
| | | v-show="sceneForm.voiceId.length" |
| | | > |
| | | <i |
| | | v-if="togglePlay" |
| | | class="el-icon-video-play" |
| | | style="font-size:26px; vertical-align:middle; color:#409eff" |
| | | ></i> |
| | | <i |
| | | v-else |
| | | class="el-icon-video-pause" |
| | | style="font-size:26px; vertical-align:middle; color:#409eff" |
| | | ></i> |
| | | </span> |
| | | </el-form-item> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | :header-cell-style="{background:'#f8f8f8',color:'#222222'}" |
| | | > |
| | | <el-table-column label="序号" type="index" align="center" ></el-table-column> |
| | | <el-table-column |
| | | label="场景名称" |
| | | prop="scene_name" |
| | | |
| | | align="center" |
| | | show-overflow-tooltip |
| | | ></el-table-column> |
| | | <el-table-column label="场景名称" prop="scene_name" align="center" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="策略" prop="group_text" align="center" min-width="350px"> |
| | | <template slot-scope="scope"> |
| | | <span v-html="scope.row.group_text"></span> |
| | |
| | | @click="handleEdit(scope.row)" |
| | | ></i> |
| | | </el-tooltip> |
| | | <el-tooltip content="删除" :hide-after="700" placement="top" popper-class="atooltipgroup_"> |
| | | <el-tooltip |
| | | content="删除" |
| | | :hide-after="700" |
| | | placement="top" |
| | | popper-class="atooltipgroup_" |
| | | > |
| | | <i |
| | | class="iconfont iconshanchu4 btn-icon" |
| | | style="font-size: 28px; color:red;" |
| | |
| | | } from '@/api/scene' |
| | | import RuleEditor from "@/components/subComponents/RuleEditor"; |
| | | import SceneEditor from "./scene/Editor"; |
| | | import { getSoundList } from "@/api/event"; |
| | | |
| | | export default { |
| | | name: "SceneRuleEditor", |
| | |
| | | }, |
| | | mounted() { |
| | | // window.addEventListener('resize', this.windowSizeChange) |
| | | |
| | | this.getSounds(); |
| | | this.eventAudio.addEventListener("ended", () => { |
| | | this.togglePlay = true |
| | | }) |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | desc: "", |
| | | template_id: "", |
| | | time_rule_id: "", |
| | | voice: {}, |
| | | voiceId: "" |
| | | }, |
| | | templateSdks: [], |
| | | templateRules: "", |
| | | ruleList: [], |
| | | sceneNameStore: [] |
| | | sceneNameStore: [], |
| | | eventAudio: new Audio(), |
| | | soundList: [], |
| | | togglePlay: true |
| | | } |
| | | }, |
| | | methods: { |
| | | getSounds() { |
| | | getSoundList().then(res => { |
| | | if (res.success) { |
| | | this.soundList = [{ id: "", name: "空", path: "" }].concat(res.data.list) |
| | | } |
| | | }).catch( |
| | | e => console.log(e) |
| | | ) |
| | | }, |
| | | selSound(sound) { |
| | | this.soundPath = sound.path; |
| | | this.sceneForm.voiceId = sound.id; |
| | | this.togglePlay = true; |
| | | this.eventAudio.pause() |
| | | this.$forceUpdate() |
| | | // this.eventAudio. |
| | | }, |
| | | togglePlayer() { |
| | | if (!this.soundPath) { |
| | | this.$notify({ |
| | | type: 'info', |
| | | message: '请先选择一个声音!' |
| | | }) |
| | | return false; |
| | | } |
| | | this.eventAudio.src = this.soundPath; |
| | | if (this.togglePlay) { |
| | | this.eventAudio.play(); |
| | | this.togglePlay = false |
| | | } else { |
| | | this.eventAudio.pause() |
| | | this.togglePlay = true |
| | | } |
| | | // this.togglePlay = !this.togglePlay |
| | | }, |
| | | bubbleSort(arr) { |
| | | for (var i = arr.length - 1; i > 0; i--) { |
| | | for (var j = 0; j < i; j++) { |
| | |
| | | desc: "", |
| | | template_id: "", |
| | | time_rule_id: "", |
| | | voice: {}, |
| | | voiceId: "" |
| | | }; |
| | | this.$refs.sceneEditor.cleanRule(); |
| | | this.$refs.sceneEditor.getSdkConnection(); |
| | | }, |
| | | handleCreate() { |
| | | |
| | | console.log(this.DataStackPool.selectedDir.id, this.TreeDataPool.treeActiveName == 'dataStack') |
| | | if (this.linkRule && this.TreeDataPool.selectedNodes.length < 2) { |
| | | this.$notify({ |
| | | type: "warning", |
| | |
| | | } |
| | | this.editScene = true; |
| | | this.cleanForm(); |
| | | console.log(this.tableRuleList) |
| | | |
| | | //初始化场景名称 |
| | | var pattern = /^场景\s*\d+\s*$/; |
| | |
| | | |
| | | }, |
| | | handleEdit(scene) { |
| | | |
| | | this.sceneForm = scene; |
| | | this.sceneForm.voice = this.soundList.find(o => o.id === scene.voiceId); |
| | | |
| | | this.editScene = true; |
| | | let selectedTpl = {}; |
| | | this.sceneTemplates.forEach((t) => { |
| | |
| | | |
| | | }, |
| | | |
| | | selectTemplate() { |
| | | let selectedTpl = {}; |
| | | this.sceneTemplates.forEach((t) => { |
| | | if (t.id == this.sceneForm.template_id) { |
| | | selectedTpl = t; |
| | | } |
| | | }) |
| | | |
| | | // 设置默认参数, 时间规则取第一个 |
| | | this.sceneForm.time_rule_id = this.VideoManageData.TimeRules[0].id; |
| | | this.sceneForm.scene_name = selectedTpl.name; |
| | | this.sceneForm.desc = selectedTpl.desc; |
| | | |
| | | this.templateSdks = selectedTpl.sdks; |
| | | this.templateRules = selectedTpl.rules; |
| | | }, |
| | | validateForm() { |
| | | |
| | | if (!this.sceneForm.scene_name.trim()) { |
| | | this.$notify({ |
| | | type: 'warning', |
| | |
| | | return true |
| | | }, |
| | | saveSceneRule() { |
| | | |
| | | if (!this.validateForm()) { |
| | | return |
| | | } |
| | |
| | | this.sceneForm.rules = editorResp.rules; |
| | | this.sceneForm.id = editorResp.id; |
| | | this.sceneForm.group_text = editorResp.text; |
| | | |
| | | this.onSaveScene(this.sceneForm); |
| | | }, |
| | | handleDelScene(groupRule) { |
| | |
| | | } |
| | | } |
| | | textarea { |
| | | height: 143px; |
| | | height: 92px; |
| | | } |
| | | } |
| | | .right { |
| | |
| | | </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.resolutionOption.find(o=>o.value === Camera.selectResolution).label}}</span> |
| | | </div> |
| | | |
| | | <div v-if="Camera.analytics" class="flex-box"> |
| | |
| | | },
|
| | | methods: {
|
| | | getSdkConnection() {
|
| | | console.log(this.VideoManageData.Dictionary)
|
| | | this.sdkConnects = this.VideoManageData.Dictionary['RULECOMPUTEBETWEEN'].map(r => {
|
| | |
|
| | | return {
|
| | |
| | | }
|
| | | })
|
| | |
|
| | | console.log(argObj.valueOptions)
|
| | | },
|
| | | setOptArgValueOptions(optArg) {
|
| | |
|
| | | let alias = optArg.alias;
|
| | | console.log(this.VideoManageData.Dictionary[alias])
|
| | | optArg.valueOptions = this.VideoManageData.Dictionary[alias].map(r => {
|
| | | return {
|
| | | name: r.name,
|
| | |
| | | //sdkItem.sdk_id = sdkItem.sdkObj.id;
|
| | | if (resetArgs) {
|
| | | sdkItem.argDef = JSON.parse(sdkItem.sdkObj.argDef)
|
| | | console.log(sdkItem.argDef)
|
| | | //取出默认参数
|
| | | sdkItem.defaultArg = sdkItem.argDef.filter(
|
| | | arg => !arg.config.isOptional
|
| | |
| | | }
|
| | |
|
| | | })
|
| | | console.log(group_text)
|
| | | }
|
| | |
|
| | | groupRule.text = group_text
|
| | |
| | | <template>
|
| | | <div class="swiper-box">
|
| | | <p class="task-tip" v-if="sceneData.length == 0 ">暂无场景,请开始创建</p>
|
| | | <swiper ref="sceneSwiper" v-if="sceneData.length>=1" :options="swiperOption" class="swiper-box-container">
|
| | | <swiper
|
| | | ref="sceneSwiper"
|
| | | v-if="sceneData.length>=1"
|
| | | :options="swiperOption"
|
| | | class="swiper-box-container"
|
| | | >
|
| | | <swiper-slide v-for="item in sceneData" :key="item.id+'s'">
|
| | | <div class="wrap-box" >
|
| | | <div class="inner">
|
| | |
| | | <!-- <svg class="icon" aria-hidden="true" style="font-size:4rem;">
|
| | | <use :xlink:href="`#${item.rules[0].icon}`" />
|
| | | </svg> -->
|
| | | <img class="baseImg" :src="item.rules[0].icon_blob.indexOf(',')>0?item.rules[0].icon_blob:`data:image/png;base64,${item.rules[0].icon_blob}`" alt="">
|
| | | <img
|
| | | class="baseImg"
|
| | | :src="item.rules[0].icon_blob && item.rules[0].icon_blob.indexOf(',')>0?item.rules[0].icon_blob:`data:image/png;base64,${item.rules[0].icon_blob}`"
|
| | | alt
|
| | | />
|
| | | </div>
|
| | | </div>
|
| | | <div class="double" v-else-if="item.rules.length==2">
|
| | |
| | | <!-- <svg class="icon" aria-hidden="true" style="font-size:2rem;">
|
| | | <use :xlink:href="`#${rule.icon}`" />
|
| | | </svg> -->
|
| | | <img class="baseImg" :src="item.rules[0].icon_blob.indexOf(',')>0?item.rules[0].icon_blob:`data:image/png;base64,${rule.icon_blob}`" alt="">
|
| | | <img
|
| | | class="baseImg"
|
| | | :src="item.rules[0].icon_blob &&item.rules[0].icon_blob.indexOf(',')>0?item.rules[0].icon_blob:`data:image/png;base64,${rule.icon_blob}`"
|
| | | alt
|
| | | />
|
| | | </div>
|
| | | </div>
|
| | | <div class="third" v-else-if="item.rules.length==3">
|
| | |
| | | <!-- <svg class="icon" aria-hidden="true" style="font-size:2rem;">
|
| | | <use :xlink:href="`#${rule.icon}`" />
|
| | | </svg> -->
|
| | | <img class="baseImg" :src="item.rules[0].icon_blob.indexOf(',')>0?item.rules[0].icon_blob:`data:image/png;base64,${rule.icon_blob}`" alt="">
|
| | | <img
|
| | | class="baseImg"
|
| | | :src="item.rules[0].icon_blob &&item.rules[0].icon_blob.indexOf(',')>0?item.rules[0].icon_blob:`data:image/png;base64,${rule.icon_blob}`"
|
| | | alt
|
| | | />
|
| | | </div>
|
| | | </div>
|
| | | <div class="four" v-else-if="item.rules.length==4">
|
| | |
| | | <!-- <svg class="icon" aria-hidden="true" style="font-size:2rem;">
|
| | | <use :xlink:href="`#${rule.icon}`" />
|
| | | </svg> -->
|
| | | <img class="baseImg" :src="item.rules[0].icon_blob.indexOf(',')>0?item.rules[0].icon_blob:`data:image/png;base64,${rule.icon_blob}`" alt="">
|
| | | <img
|
| | | class="baseImg"
|
| | | :src="item.rules[0].icon_blob && item.rules[0].icon_blob.indexOf(',')>0?item.rules[0].icon_blob:`data:image/png;base64,${rule.icon_blob}`"
|
| | | alt
|
| | | />
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | |
| | | left: 50%;
|
| | | transform: translate(-50%, -50%);
|
| | | box-shadow: none;
|
| | | width: 100%
|
| | | width: 100%;
|
| | | }
|
| | | }
|
| | | .double {
|
| | |
| | | changeOrigin: true, |
| | | }, |
| | | "/data/api-v/app/findAllApp": { |
| | | target: '/', |
| | | // target: 'http://localhost:8080/', |
| | | // target: '/', |
| | | target: 'http://localhost:8080/', |
| | | changeOrigin: true, |
| | | pathRewrite: { |
| | | '^/data/api-v/app/findAllApp': 'apps.json' |