|
@@ -16,7 +16,15 @@
|
|
|
<!-- 主机选择 -->
|
|
<!-- 主机选择 -->
|
|
|
<van-row>
|
|
<van-row>
|
|
|
<van-col span="24">
|
|
<van-col span="24">
|
|
|
- <van-field v-model="host" is-link readonly label="监控主机" placeholder="" @click="showHost = true" />
|
|
|
|
|
|
|
+ <van-field
|
|
|
|
|
+ required
|
|
|
|
|
+ v-model="host"
|
|
|
|
|
+ is-link
|
|
|
|
|
+ readonly
|
|
|
|
|
+ label="监控主机"
|
|
|
|
|
+ placeholder=""
|
|
|
|
|
+ @click="showHost = true"
|
|
|
|
|
+ />
|
|
|
<van-popup v-model="showHost" round position="bottom">
|
|
<van-popup v-model="showHost" round position="bottom">
|
|
|
<van-picker
|
|
<van-picker
|
|
|
title="监控主机"
|
|
title="监控主机"
|
|
@@ -26,31 +34,39 @@
|
|
|
@cancel="onCancel"
|
|
@cancel="onCancel"
|
|
|
@change="onChange"
|
|
@change="onChange"
|
|
|
>
|
|
>
|
|
|
- <template #option="option">
|
|
|
|
|
|
|
+ <template #option="option">
|
|
|
<div style="display: flex; flex-direction: column; align-items: center">
|
|
<div style="display: flex; flex-direction: column; align-items: center">
|
|
|
- <!-- <div>{{ option.id }}</div> -->
|
|
|
|
|
<div>{{ option.deviceName }}</div>
|
|
<div>{{ option.deviceName }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
- </van-picker> </van-popup
|
|
|
|
|
- ></van-col>
|
|
|
|
|
|
|
+ </van-picker>
|
|
|
|
|
+ </van-popup></van-col
|
|
|
|
|
+ >
|
|
|
</van-row>
|
|
</van-row>
|
|
|
<!-- 视频通道 -->
|
|
<!-- 视频通道 -->
|
|
|
<van-row>
|
|
<van-row>
|
|
|
<van-col span="24">
|
|
<van-col span="24">
|
|
|
- <van-field v-model="fieldValue" :disabled="ishost" is-link readonly label="视频通道" placeholder="" @click="showStatus = true" />
|
|
|
|
|
|
|
+ <van-field
|
|
|
|
|
+ required
|
|
|
|
|
+ v-model="fieldValue"
|
|
|
|
|
+ :disabled="ishost"
|
|
|
|
|
+ is-link
|
|
|
|
|
+ readonly
|
|
|
|
|
+ label="视频通道"
|
|
|
|
|
+ placeholder=""
|
|
|
|
|
+ @click="showStatus = true"
|
|
|
|
|
+ />
|
|
|
<van-popup v-model="showStatus" :disabled="ishost" round position="bottom">
|
|
<van-popup v-model="showStatus" :disabled="ishost" round position="bottom">
|
|
|
<van-picker
|
|
<van-picker
|
|
|
title="视频通道"
|
|
title="视频通道"
|
|
|
show-toolbar
|
|
show-toolbar
|
|
|
:columns="columns"
|
|
:columns="columns"
|
|
|
- @confirm="onConfirm"
|
|
|
|
|
|
|
+ @confirm="onConfirmPassage"
|
|
|
@cancel="onCancel"
|
|
@cancel="onCancel"
|
|
|
@change="onChange"
|
|
@change="onChange"
|
|
|
>
|
|
>
|
|
|
<template #option="option">
|
|
<template #option="option">
|
|
|
<div style="display: flex; flex-direction: column; align-items: center">
|
|
<div style="display: flex; flex-direction: column; align-items: center">
|
|
|
- <div>{{ option.id }}</div>
|
|
|
|
|
<div>{{ option.deviceName }}</div>
|
|
<div>{{ option.deviceName }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -67,72 +83,56 @@
|
|
|
</van-row>
|
|
</van-row>
|
|
|
|
|
|
|
|
<div>
|
|
<div>
|
|
|
- <!-- 主体选择项 -->
|
|
|
|
|
- <van-collapse v-model="activeNames" :is-link="false">
|
|
|
|
|
- <van-collapse-item name="1">
|
|
|
|
|
- <template #title>
|
|
|
|
|
- <div>
|
|
|
|
|
- <van-checkbox v-model="checked" shape="square">复选框</van-checkbox>
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
-
|
|
|
|
|
- <van-row>
|
|
|
|
|
- <van-col span="24">
|
|
|
|
|
- <van-dropdown-menu>
|
|
|
|
|
- <van-dropdown-item v-model="value1" :options="option1" />
|
|
|
|
|
- </van-dropdown-menu>
|
|
|
|
|
- </van-col>
|
|
|
|
|
- </van-row>
|
|
|
|
|
- <van-row>
|
|
|
|
|
- <van-col span="24">
|
|
|
|
|
- <van-field
|
|
|
|
|
- v-model="message"
|
|
|
|
|
- rows="2"
|
|
|
|
|
- autosize
|
|
|
|
|
- label="异常说明"
|
|
|
|
|
- type="textarea"
|
|
|
|
|
- placeholder="请输入异常说明"
|
|
|
|
|
- show-word-limit
|
|
|
|
|
- />
|
|
|
|
|
- </van-col>
|
|
|
|
|
- </van-row>
|
|
|
|
|
- </van-collapse-item>
|
|
|
|
|
- <van-collapse-item name="2">
|
|
|
|
|
- <template #title>
|
|
|
|
|
- <div>
|
|
|
|
|
- <van-checkbox v-model="checked1" shape="square">复选框</van-checkbox>
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
|
|
+ <van-form ref="vform">
|
|
|
|
|
+ <!-- 主体选择项 -->
|
|
|
|
|
+ <van-collapse v-model="activeNames" :is-link="false">
|
|
|
|
|
+ <van-collapse-item :name="item.dictValue" v-for="item in dataList" :key="item.dictValue">
|
|
|
|
|
+ <template #title>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <van-checkbox v-model="item.isChecked" shape="square">{{ item.dictLabel }}</van-checkbox>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
|
|
|
- <van-row>
|
|
|
|
|
- <van-col span="24">
|
|
|
|
|
- <van-dropdown-menu>
|
|
|
|
|
- <van-dropdown-item v-model="value1" :options="option1" />
|
|
|
|
|
- </van-dropdown-menu>
|
|
|
|
|
- </van-col>
|
|
|
|
|
- </van-row>
|
|
|
|
|
- <van-row>
|
|
|
|
|
- <van-col span="24">
|
|
|
|
|
- <van-field
|
|
|
|
|
- v-show="value1 == 0"
|
|
|
|
|
- v-model="message"
|
|
|
|
|
- rows="2"
|
|
|
|
|
- autosize
|
|
|
|
|
- label="异常说明"
|
|
|
|
|
- type="textarea"
|
|
|
|
|
- placeholder="请输入异常说明"
|
|
|
|
|
- show-word-limit
|
|
|
|
|
- />
|
|
|
|
|
- </van-col>
|
|
|
|
|
- </van-row>
|
|
|
|
|
- </van-collapse-item>
|
|
|
|
|
- </van-collapse>
|
|
|
|
|
|
|
+ <van-row>
|
|
|
|
|
+ <van-col span="24">
|
|
|
|
|
+ <van-dropdown-menu>
|
|
|
|
|
+ <van-dropdown-item
|
|
|
|
|
+ v-model="item.situation"
|
|
|
|
|
+ @change="changeHandler($event, item)"
|
|
|
|
|
+ :options="dictList"
|
|
|
|
|
+ />
|
|
|
|
|
+ </van-dropdown-menu>
|
|
|
|
|
+ </van-col>
|
|
|
|
|
+ </van-row>
|
|
|
|
|
+ <van-form>
|
|
|
|
|
+ <van-row v-show="item.situation == '1'">
|
|
|
|
|
+ <van-col span="24">
|
|
|
|
|
+ <van-field
|
|
|
|
|
+ v-model="item.abnormalIllustrate"
|
|
|
|
|
+ rows="2"
|
|
|
|
|
+ autosize
|
|
|
|
|
+ required
|
|
|
|
|
+ label="异常说明"
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ placeholder="请输入异常说明"
|
|
|
|
|
+ show-word-limit
|
|
|
|
|
+ :rules="[{ required: true, message: '内容不能为空' }]"
|
|
|
|
|
+ />
|
|
|
|
|
+ </van-col>
|
|
|
|
|
+ </van-row>
|
|
|
|
|
+ </van-form>
|
|
|
|
|
+ </van-collapse-item>
|
|
|
|
|
+ </van-collapse>
|
|
|
|
|
+ </van-form>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
<!-- 底部按钮 -->
|
|
<!-- 底部按钮 -->
|
|
|
<div class="bottomClass">
|
|
<div class="bottomClass">
|
|
|
<van-row>
|
|
<van-row>
|
|
|
<van-col span="24">
|
|
<van-col span="24">
|
|
|
- <van-button type="info">添加</van-button>
|
|
|
|
|
|
|
+ <van-button type="info" @click="addForm">{{
|
|
|
|
|
+ $route.params.id.split('_')[2] == 'edit' ? '修改' : '添加'
|
|
|
|
|
+ }}</van-button>
|
|
|
</van-col>
|
|
</van-col>
|
|
|
</van-row>
|
|
</van-row>
|
|
|
</div>
|
|
</div>
|
|
@@ -143,29 +143,43 @@
|
|
|
import NavBar from '@/components/NavBar'
|
|
import NavBar from '@/components/NavBar'
|
|
|
// 主机列表组件
|
|
// 主机列表组件
|
|
|
import MonitoingList from './monitoringList.vue'
|
|
import MonitoingList from './monitoringList.vue'
|
|
|
-import { Col, Row, Dialog, Icon, Picker } from 'vant'
|
|
|
|
|
-import { registrationList, getorgHost } from '@/api/toConsult.js'
|
|
|
|
|
|
|
+import { Col, Row, Dialog, Icon, Toast, Picker } from 'vant'
|
|
|
|
|
+import {
|
|
|
|
|
+ registrationList,
|
|
|
|
|
+ addInfo,
|
|
|
|
|
+ updateInfo,
|
|
|
|
|
+ getEditInfo,
|
|
|
|
|
+ getSysDeviceByHostId,
|
|
|
|
|
+ getorgHost
|
|
|
|
|
+} from '@/api/toConsult.js'
|
|
|
import { mapGetters } from 'vuex'
|
|
import { mapGetters } from 'vuex'
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- columns: ['全部', '已调阅', '调阅中', '待调阅'],
|
|
|
|
|
|
|
+ taskId: '', //任务ID
|
|
|
|
|
+ falg: false, //校验是否通过
|
|
|
|
|
+ dictList: [], //异常正常字典
|
|
|
|
|
+ columns: [], //通道列表
|
|
|
hostList: [], //主机列表
|
|
hostList: [], //主机列表
|
|
|
showStatus: false, //通道显示隐藏
|
|
showStatus: false, //通道显示隐藏
|
|
|
showHost: false, //主机显示隐藏
|
|
showHost: false, //主机显示隐藏
|
|
|
checked: false,
|
|
checked: false,
|
|
|
checked1: false,
|
|
checked1: false,
|
|
|
message: '',
|
|
message: '',
|
|
|
- ishost:true,
|
|
|
|
|
|
|
+ ishost: true,
|
|
|
fieldValue: '',
|
|
fieldValue: '',
|
|
|
- host:'',//主机名称
|
|
|
|
|
- hostId:'',//主机ID
|
|
|
|
|
|
|
+ host: '', //主机名称
|
|
|
|
|
+ hostId: '', //主机ID
|
|
|
|
|
+ videoChannel: '', //通道ID
|
|
|
value1: 0,
|
|
value1: 0,
|
|
|
|
|
+ dicts: ['core_registration_project'],
|
|
|
option1: [
|
|
option1: [
|
|
|
{ text: '异常', value: 0 },
|
|
{ text: '异常', value: 0 },
|
|
|
{ text: '正常', value: 1 }
|
|
{ text: '正常', value: 1 }
|
|
|
],
|
|
],
|
|
|
activeNames: [''],
|
|
activeNames: [''],
|
|
|
|
|
+ dataList: [], //列表
|
|
|
taskData: []
|
|
taskData: []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -187,11 +201,45 @@ export default {
|
|
|
created() {
|
|
created() {
|
|
|
this.init()
|
|
this.init()
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ mounted() {},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ //根据卡片ID获取详情数据
|
|
|
|
|
+ getInfoHandler() {
|
|
|
|
|
+ //判断当前路由的信息是新增还是编辑
|
|
|
|
|
+ if (this.$route.params.id.split('_')[2] == 'edit' && this.dataList.length > 0) {
|
|
|
|
|
+ //当前是编辑
|
|
|
|
|
+ //获取卡片详情数据
|
|
|
|
|
+ getEditInfo(this.$route.params.id.split('_')[1]).then(res => {
|
|
|
|
|
+ let { data, msg, code } = res
|
|
|
|
|
+ if (code == 200) {
|
|
|
|
|
+ ;(this.activeNames = ['']), //滞空选中
|
|
|
|
|
+ this.dataList.forEach(item => {
|
|
|
|
|
+ data.coreMonitoringTaskMonitorInfoList.forEach(i => {
|
|
|
|
|
+ if (i.project == item.dictValue) {
|
|
|
|
|
+ //查询赋值
|
|
|
|
|
+ this.$set(item, 'isChecked', true)
|
|
|
|
|
+ this.$set(item, 'situation', i.situation)
|
|
|
|
|
+ this.$set(item, 'abnormalIllustrate', i.abnormalIllustrate)
|
|
|
|
|
+ this.activeNames.push(i.project)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ //赋值主机&通道名称
|
|
|
|
|
+ this.host = data.hostName
|
|
|
|
|
+ this.hostId = data.host
|
|
|
|
|
+ this.fieldValue = data.videoChannelName
|
|
|
|
|
+ this.videoChannel = data.videoChannel
|
|
|
|
|
+ console.log(this.hostId)
|
|
|
|
|
+ this.getHostTDlist(this.hostId)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
//项目初始化获取数据
|
|
//项目初始化获取数据
|
|
|
init() {
|
|
init() {
|
|
|
//获取组织机构数据
|
|
//获取组织机构数据
|
|
|
- registrationList({ taskId: this.$route.params.id }).then(res => {
|
|
|
|
|
|
|
+ registrationList({ taskId: this.$route.params.id.split('_')[0] }).then(res => {
|
|
|
let { code, data, msg } = res
|
|
let { code, data, msg } = res
|
|
|
if (code == 200) {
|
|
if (code == 200) {
|
|
|
this.taskData = data
|
|
this.taskData = data
|
|
@@ -199,24 +247,141 @@ export default {
|
|
|
})
|
|
})
|
|
|
//获取当前登录人机构下主机列表
|
|
//获取当前登录人机构下主机列表
|
|
|
|
|
|
|
|
- getorgHost(this.orgId).then(res => {
|
|
|
|
|
-
|
|
|
|
|
|
|
+ getorgHost({ orgId: this.orgId, monitorId: this.$route.params.id.split('_')[1] }).then(res => {
|
|
|
let { code, data, msg } = res
|
|
let { code, data, msg } = res
|
|
|
if (code == 200) {
|
|
if (code == 200) {
|
|
|
this.hostList = data
|
|
this.hostList = data
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+ this.getDictHandler('core_registration_project', res => {
|
|
|
|
|
+ this.dataList = JSON.parse(JSON.stringify(res))
|
|
|
|
|
+ this.dataList.forEach(item => {
|
|
|
|
|
+ this.$set(item, 'situation', '0') //异常情况初始化默认值
|
|
|
|
|
+ this.$set(item, 'abnormalIllustrate', ' ') //情况说明初始化默认值
|
|
|
|
|
+ })
|
|
|
|
|
+ this.getInfoHandler() //获取详情
|
|
|
|
|
+ })
|
|
|
|
|
+ //获取异常情况字典
|
|
|
|
|
+ this.getDictHandler('core_check_type', res => {
|
|
|
|
|
+ this.dictList = res
|
|
|
|
|
+ this.dictList.forEach(item => {
|
|
|
|
|
+ item.text = item.dictLabel
|
|
|
|
|
+ item.value = item.dictValue
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
onConfirm(value, index) {
|
|
onConfirm(value, index) {
|
|
|
- this.host=value
|
|
|
|
|
- this.hostId=this.hostList[index].id
|
|
|
|
|
- this.ishost=false
|
|
|
|
|
|
|
+ this.host = this.hostList[index].deviceName
|
|
|
|
|
+ this.hostId = this.hostList[index].id
|
|
|
|
|
+ this.getHostTDlist(this.hostId)
|
|
|
},
|
|
},
|
|
|
- onChange(picker, value, index) {
|
|
|
|
|
-
|
|
|
|
|
|
|
+ //通过主机ID获取通道列表
|
|
|
|
|
+ getHostTDlist(id) {
|
|
|
|
|
+ //通过主机ID获取通道列表
|
|
|
|
|
+ getSysDeviceByHostId({ hostId: id, monitorId: this.$route.params.id.split('_')[1] }).then(res => {
|
|
|
|
|
+ let { code, data, msg } = res
|
|
|
|
|
+ if (code == 200) {
|
|
|
|
|
+ this.columns = data
|
|
|
|
|
+ console.log(data)
|
|
|
|
|
+ this.ishost = false
|
|
|
|
|
+ this.showHost = false
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ onConfirmPassage(value, index) {
|
|
|
|
|
+ this.fieldValue = this.columns[index].deviceName
|
|
|
|
|
+ this.videoChannel = this.columns[index].id
|
|
|
|
|
+ this.showStatus = false
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ onChange(picker, value, index) {},
|
|
|
|
|
+
|
|
|
|
|
+ onFailed(errorInfo) {
|
|
|
|
|
+ this.falg = true
|
|
|
|
|
+ },
|
|
|
|
|
+ changeHandler(val, item) {
|
|
|
|
|
+ if (val == '0') {
|
|
|
|
|
+ item.abnormalIllustrate = ''
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
onCancel() {
|
|
onCancel() {
|
|
|
Toast('取消')
|
|
Toast('取消')
|
|
|
|
|
+ },
|
|
|
|
|
+ //表单提交前校验
|
|
|
|
|
+ beforSubmitV() {
|
|
|
|
|
+
|
|
|
|
|
+ this.falg = false
|
|
|
|
|
+ if (this.host == '' && this.hostId == '') {
|
|
|
|
|
+ Toast('监控主机不能为空!')
|
|
|
|
|
+ this.falg = true
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.fieldValue == '' && this.videoChannel == '') {
|
|
|
|
|
+ Toast('视频通道不能为空!')
|
|
|
|
|
+ this.falg = true
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.dataList.forEach(item => {
|
|
|
|
|
+ if (item.situation == '1' && item.abnormalIllustrate == '') {
|
|
|
|
|
+ Toast(`${item.dictLabel}的异常情况说明不能为空!`)
|
|
|
|
|
+ this.falg = true
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ //表单提交
|
|
|
|
|
+ addForm() {
|
|
|
|
|
+ this.beforSubmitV()
|
|
|
|
|
+
|
|
|
|
|
+ if (this.falg) {
|
|
|
|
|
+
|
|
|
|
|
+ //校验不通过
|
|
|
|
|
+ } else {
|
|
|
|
|
+ let list = []
|
|
|
|
|
+ this.activeNames.forEach(item => {
|
|
|
|
|
+ this.dataList.forEach(i => {
|
|
|
|
|
+ if (item == i.dictValue) {
|
|
|
|
|
+ i.project = i.dictValue
|
|
|
|
|
+ list.push(i)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ if (this.$route.params.id.split('_')[2] == 'edit') {
|
|
|
|
|
+ //编辑提交
|
|
|
|
|
+ updateInfo({
|
|
|
|
|
+ host: this.hostId,
|
|
|
|
|
+ // taskRegistrationId:+this.$route.params.id.split('_')[1],
|
|
|
|
|
+ videoChannel: this.videoChannel,
|
|
|
|
|
+ id: this.$route.params.id.split('_')[1],
|
|
|
|
|
+ coreMonitoringTaskMonitorInfoList: list
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ let { data, msg, code } = res
|
|
|
|
|
+ if (code == 200) {
|
|
|
|
|
+ Toast('编辑成功!')
|
|
|
|
|
+ this.$router.push('/consultInfo/' + this.$route.params.id.split('_')[0])
|
|
|
|
|
+ }
|
|
|
|
|
+ this.falg = false
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //新增提交
|
|
|
|
|
+ addInfo({
|
|
|
|
|
+ host: this.hostId,
|
|
|
|
|
+ // taskRegistrationId:+this.$route.params.id.split('_')[1],
|
|
|
|
|
+ videoChannel: this.videoChannel,
|
|
|
|
|
+ taskRegistrationId: this.$route.params.id.split('_')[1],
|
|
|
|
|
+ coreMonitoringTaskMonitorInfoList: list
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ let { data, msg, code } = res
|
|
|
|
|
+ if (code == 200) {
|
|
|
|
|
+ Toast('添加成功!')
|
|
|
|
|
+ this.$router.push('/consultInfo/' + this.$route.params.id.split('_')[0])
|
|
|
|
|
+ }
|
|
|
|
|
+ this.falg = false
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|