| | |
| | | </div> |
| | | <div class="config-item"> |
| | | <b>推送字段</b> |
| | | <el-button type="primary" size="mini" @click="pushFieldDialog=true">设置</el-button> |
| | | <el-button type="primary" size="mini" @click="openPushSetDialog">设置</el-button> |
| | | </div> |
| | | <div class="save-btn"> |
| | | <el-button type="info" size="small" @click="onCancle" style="color:#222">取消</el-button> |
| | |
| | | <el-checkbox v-model="allFieldChecked"></el-checkbox> |
| | | </div> |
| | | </div> |
| | | <div class="check-area" v-for="configObj in pushFields" :key="configObj.id"> |
| | | <div class="check-area" v-for="configObj in tempPushSet" :key="configObj.id"> |
| | | <div class="header"> |
| | | <div class="title">{{configObj.name}}</div> |
| | | <div class="right"> |
| | |
| | | </div> |
| | | </div> |
| | | <div slot="footer" class="text-center"> |
| | | <el-button size="small">取消</el-button> |
| | | <el-button size="small" @click="canclePushFieldSet">取消</el-button> |
| | | <el-button |
| | | size="small" |
| | | type="primary" |
| | |
| | | </template> |
| | | <script> |
| | | |
| | | import { eventPushsSave, findByEventTopic } from "@/api/event"; |
| | | import { eventPushsSave, findByEventTopic,getPushSet } from "@/api/event"; |
| | | import { findDictionaryByType, findDictionaryByID } from "@/api/dictionary"; |
| | | import { getTaskList } from "@/api/search"; |
| | | |
| | |
| | | ruleValueOptions: [] |
| | | }, |
| | | pushFieldDialog: false, |
| | | tempPushSet: [], |
| | | pushFields: [], |
| | | allFieldChecked: false, |
| | | disabledPushFieldSet: true, |
| | |
| | | if (!this.taskEditData.urls) { |
| | | this.$set(this.taskEditData, "urls", []) |
| | | } |
| | | //this.taskEditData.push_set = this.eventObject.push_set; |
| | | if(!this.eventObject.push_set.length){ |
| | | this.$set(this.taskEditData, "push_set", this.pushFields) |
| | | }else{ |
| | | this.$set(this.taskEditData, "push_set", this.eventObject.push_set) |
| | | } |
| | | if (newVal.rules) { |
| | | newVal.rules.forEach(element => { |
| | | let newRule = Object.assign(JSON.parse(JSON.stringify(this.baseRule)), element) |
| | |
| | | }, |
| | | deep: true |
| | | }, |
| | | pushFields: { |
| | | tempPushSet: { |
| | | handler (n, o) { |
| | | let _this = this; |
| | | let flag = false; |
| | |
| | | this.getPushFields(); |
| | | }, |
| | | methods: { |
| | | openPushSetDialog(){ |
| | | this.pushFieldDialog=true; |
| | | this.tempPushSet = JSON.parse(JSON.stringify(this.taskEditData.push_set)); |
| | | }, |
| | | varifyField (param) { |
| | | var reg = /^[A-Za-z]+[0-9-_]?$/; |
| | | if (!reg.test(param.alias)) { |
| | |
| | | // }) |
| | | |
| | | }, |
| | | canclePushFieldSet(){ |
| | | this.pushFieldDialog = false; |
| | | }, |
| | | submitPushFieldSet () { |
| | | let flag = false; |
| | | this.pushFields.forEach(configObj => { |
| | | //this.pushFields.forEach(configObj => { |
| | | this.tempPushSet.forEach(configObj => { |
| | | let errorOne = configObj.children.find(param => param.checked && param.error); |
| | | if (errorOne) { |
| | | this.$notify({ |
| | |
| | | } |
| | | }); |
| | | if(flag){ |
| | | //NO SUBMIT |
| | | return |
| | | } |
| | | alert('submit') |
| | | this.taskEditData.push_set = this.tempPushSet; |
| | | console.log(this.taskEditData.push_set); |
| | | this.pushFieldDialog = false; |
| | | }, |
| | | toggleConfigCheck (configObj) { |
| | | configObj.children.forEach(child => { |
| | |
| | | }) |
| | | }, |
| | | getPushFields () { |
| | | this.pushFields = [ |
| | | { id: 'sxjxx', name: '摄像机信息', checked: false, alias: '', |
| | | children: [ |
| | | { name: '摄像机ID', checked: false, alias: 'cameraID', id: 'cameraID', children: null }, |
| | | { name: '摄像机名称', checked: false, alias: 'cameraName', id: 'cameraName', children: null }, |
| | | { name: '摄像机地址', checked: false, alias: 'cameraAddr', id: 'cameraAddr', children: null }, |
| | | { name: '摄像机址', checked: false, alias: 'cameraAdr', id: 'cameraAdr', children: null } |
| | | ] }, |
| | | { id: 'cjxx', name: '场景信息', checked: false, alias: '', |
| | | children: [{ name: '场景ID', checked: false, alias: 'taskId', id: 'tskId', children: null }] }, |
| | | ]; |
| | | let _this = this; |
| | | getPushSet().then(res=>{ |
| | | _this.pushFields = res.data; |
| | | }) |
| | | // this.pushFields = [ |
| | | // { id: 'sxjxx', name: '摄像机信息', checked: false, alias: '', |
| | | // children: [ |
| | | // { name: '摄像机ID', checked: false, alias: 'cameraID', id: 'cameraID', children: null }, |
| | | // { name: '摄像机名称', checked: false, alias: 'cameraName', id: 'cameraName', children: null }, |
| | | // { name: '摄像机地址', checked: false, alias: 'cameraAddr', id: 'cameraAddr', children: null }, |
| | | // { name: '摄像机址', checked: false, alias: 'cameraAdr', id: 'cameraAdr', children: null } |
| | | // ] }, |
| | | // { id: 'cjxx', name: '场景信息', checked: false, alias: '', |
| | | // children: [{ name: '场景ID', checked: false, alias: 'taskId', id: 'tskId', children: null }] }, |
| | | // ]; |
| | | |
| | | }, |
| | | addUrl () { |
| | |
| | | time_end: this.taskEditData.time[1], |
| | | urls: this.taskEditData.urls, |
| | | is_satisfy_all: this.taskEditData.radioValue === "1", |
| | | link_type: this.taskEditData.lineWay |
| | | link_type: this.taskEditData.lineWay, |
| | | push_set: this.taskEditData.push_set |
| | | }; |
| | | |
| | | let res = await eventPushsSave(json); |