|
|
|
@ -1,115 +1,131 @@
|
|
|
|
|
<template>
|
|
|
|
|
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
|
|
|
|
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
|
|
|
|
:close-on-click-modal="false" append-to-body
|
|
|
|
|
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
|
|
|
|
width="800px">
|
|
|
|
|
<el-row :gutter="15" class="">
|
|
|
|
|
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
|
|
|
|
|
<el-row :gutter="15" class="">
|
|
|
|
|
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
|
|
|
|
|
<template v-if="!loading">
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="设备名称"
|
|
|
|
|
prop="mName" >
|
|
|
|
|
prop="mName">
|
|
|
|
|
<el-input v-model="dataForm.mName"
|
|
|
|
|
placeholder="请输入设备名称" clearable :style='{"width":"100%"}'>
|
|
|
|
|
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="设备序列号"
|
|
|
|
|
prop="mName">
|
|
|
|
|
<el-input v-model="dataForm.serialnumber"
|
|
|
|
|
placeholder="请输入序列号" clearable :style='{"width":"100%"}'>
|
|
|
|
|
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="区域"
|
|
|
|
|
prop="monitoringId" >
|
|
|
|
|
prop="monitoringId">
|
|
|
|
|
<el-select v-model="dataForm.monitoringId"
|
|
|
|
|
placeholder="请选择区域" clearable :style='{"width":"100%"}' filterable >
|
|
|
|
|
<el-option v-for="(item, index) in monitoringIdOptions" :key="index" :label="item.m_name" :value="item.id" :disabled="item.disabled" ></el-option>
|
|
|
|
|
placeholder="请选择区域" clearable :style='{"width":"100%"}' filterable>
|
|
|
|
|
<el-option v-for="(item, index) in monitoringIdOptions" :key="index" :label="item.m_name"
|
|
|
|
|
:value="item.id" :disabled="item.disabled"></el-option>
|
|
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="设备状态:"
|
|
|
|
|
prop="mStatus" >
|
|
|
|
|
prop="mStatus">
|
|
|
|
|
<el-select v-model="dataForm.mStatus"
|
|
|
|
|
placeholder="请选择设备状态" clearable :style='{"width":"100%"}'>
|
|
|
|
|
<el-option v-for="(item, index) in mStatusOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
|
|
|
|
<el-option v-for="(item, index) in mStatusOptions" :key="index" :label="item.fullName" :value="item.id"
|
|
|
|
|
:disabled="item.disabled"></el-option>
|
|
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="标清flv直播地址"
|
|
|
|
|
prop="flvAddress" >
|
|
|
|
|
prop="flvAddress">
|
|
|
|
|
<el-input v-model="dataForm.flvAddress"
|
|
|
|
|
placeholder="请输入" readonly clearable :style='{"width":"100%"}'>
|
|
|
|
|
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="高清flv直播地址"
|
|
|
|
|
prop="flvHdAddress" >
|
|
|
|
|
prop="flvHdAddress">
|
|
|
|
|
<el-input v-model="dataForm.flvHdAddress"
|
|
|
|
|
placeholder="请输入" readonly clearable :style='{"width":"100%"}'>
|
|
|
|
|
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="设备通道号"
|
|
|
|
|
prop="channelNumber" >
|
|
|
|
|
prop="channelNumber">
|
|
|
|
|
<el-input v-model="dataForm.channelNumber"
|
|
|
|
|
placeholder="请输入" readonly clearable :style='{"width":"100%"}'>
|
|
|
|
|
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="是否显示"
|
|
|
|
|
prop="isEnable" >
|
|
|
|
|
prop="isEnable">
|
|
|
|
|
<el-select v-model="dataForm.isEnable"
|
|
|
|
|
placeholder="请选择是否显示" clearable :style='{"width":"100%"}'>
|
|
|
|
|
<el-option v-for="(item, index) in isEnableOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
|
|
|
|
<el-option v-for="(item, index) in isEnableOptions" :key="index" :label="item.fullName" :value="item.id"
|
|
|
|
|
:disabled="item.disabled"></el-option>
|
|
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<el-form-item label="修改时间"
|
|
|
|
|
prop="lastmodifytime" >
|
|
|
|
|
<el-date-picker v-model="dataForm.lastmodifytime"
|
|
|
|
|
placeholder="请选择" readonly clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
|
|
|
|
|
<!-- <el-col :span="24">-->
|
|
|
|
|
<!-- <el-form-item label="修改时间"-->
|
|
|
|
|
<!-- prop="lastmodifytime">-->
|
|
|
|
|
<!-- <el-date-picker v-model="dataForm.lastmodifytime"-->
|
|
|
|
|
<!-- placeholder="请选择" readonly clearable :style='{"width":"100%"}' type="datetime"-->
|
|
|
|
|
<!-- format="yyyy-MM-dd HH:mm:ss" value-format="timestamp">-->
|
|
|
|
|
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<el-form-item label="修改人id"
|
|
|
|
|
prop="deleteUserId" >
|
|
|
|
|
<el-input v-model="dataForm.deleteUserId"
|
|
|
|
|
placeholder="请输入" readonly clearable :style='{"width":"100%"}'>
|
|
|
|
|
<!-- </el-date-picker>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
<!-- <el-col :span="24">-->
|
|
|
|
|
<!-- <el-form-item label="修改人id"-->
|
|
|
|
|
<!-- prop="deleteUserId">-->
|
|
|
|
|
<!-- <el-input v-model="dataForm.deleteUserId"-->
|
|
|
|
|
<!-- placeholder="请输入" readonly clearable :style='{"width":"100%"}'>-->
|
|
|
|
|
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<el-form-item label="创建人名称"
|
|
|
|
|
prop="creatorUserName" >
|
|
|
|
|
<el-input v-model="dataForm.creatorUserName"
|
|
|
|
|
placeholder="请输入" readonly clearable :style='{"width":"100%"}'>
|
|
|
|
|
<!-- </el-input>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
<!-- <el-col :span="24">-->
|
|
|
|
|
<!-- <el-form-item label="创建人名称"-->
|
|
|
|
|
<!-- prop="creatorUserName">-->
|
|
|
|
|
<!-- <el-input v-model="dataForm.creatorUserName"-->
|
|
|
|
|
<!-- placeholder="请输入" readonly clearable :style='{"width":"100%"}'>-->
|
|
|
|
|
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<el-form-item label="创建时间"
|
|
|
|
|
prop="creatorTime" >
|
|
|
|
|
<el-date-picker v-model="dataForm.creatorTime"
|
|
|
|
|
placeholder="请选择" readonly clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
|
|
|
|
|
<!-- </el-input>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
<!-- <el-col :span="24">-->
|
|
|
|
|
<!-- <el-form-item label="创建时间"-->
|
|
|
|
|
<!-- prop="creatorTime">-->
|
|
|
|
|
<!-- <el-date-picker v-model="dataForm.creatorTime"-->
|
|
|
|
|
<!-- placeholder="请选择" readonly clearable :style='{"width":"100%"}' type="datetime"-->
|
|
|
|
|
<!-- format="yyyy-MM-dd HH:mm:ss" value-format="timestamp">-->
|
|
|
|
|
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!-- </el-date-picker>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
</template>
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-row>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="visible = false"> 取 消</el-button>
|
|
|
|
@ -121,6 +137,7 @@
|
|
|
|
|
import request from '@/utils/request'
|
|
|
|
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
|
|
|
|
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {},
|
|
|
|
|
props: [],
|
|
|
|
@ -130,18 +147,19 @@
|
|
|
|
|
loading: false,
|
|
|
|
|
isDetail: false,
|
|
|
|
|
dataForm: {
|
|
|
|
|
mName : '',
|
|
|
|
|
monitoringId : "",
|
|
|
|
|
serialnumber : '',
|
|
|
|
|
mStatus : "0",
|
|
|
|
|
flvAddress : '',
|
|
|
|
|
flvHdAddress : '',
|
|
|
|
|
channelNumber : '',
|
|
|
|
|
isEnable : "0",
|
|
|
|
|
lastmodifytime : '',
|
|
|
|
|
deleteUserId : '',
|
|
|
|
|
creatorUserName : '',
|
|
|
|
|
creatorTime : '',
|
|
|
|
|
mName: '',
|
|
|
|
|
monitoringId: '',
|
|
|
|
|
|
|
|
|
|
serialnumber: '',
|
|
|
|
|
mStatus: '0',
|
|
|
|
|
flvAddress: '',
|
|
|
|
|
flvHdAddress: '',
|
|
|
|
|
channelNumber: '',
|
|
|
|
|
isEnable: '0',
|
|
|
|
|
lastmodifytime: '',
|
|
|
|
|
deleteUserId: '',
|
|
|
|
|
creatorUserName: '',
|
|
|
|
|
creatorTime: ''
|
|
|
|
|
},
|
|
|
|
|
rules:
|
|
|
|
|
{
|
|
|
|
@ -150,21 +168,22 @@
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请输入设备名称',
|
|
|
|
|
trigger: 'blur'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
monitoringIdOptions:[],
|
|
|
|
|
mStatusOptions:[{"fullName":"在线","id":"1"},{"fullName":"不在线","id":"0"}],
|
|
|
|
|
isEnableOptions:[{"fullName":"显示","id":"1"},{"fullName":"不显示","id":"0"}],
|
|
|
|
|
monitoringIdOptions: [],
|
|
|
|
|
mStatusOptions: [{ 'fullName': '在线', 'id': '1' }, { 'fullName': '不在线', 'id': '0' }],
|
|
|
|
|
isEnableOptions: [{ 'fullName': '显示', 'id': '1' }, { 'fullName': '不显示', 'id': '0' }]
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {},
|
|
|
|
|
watch: {},
|
|
|
|
|
created() {
|
|
|
|
|
this.getmonitoringIdOptions();
|
|
|
|
|
this.getmonitoringIdOptions()
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
},
|
|
|
|
|
mounted() {},
|
|
|
|
|
methods: {
|
|
|
|
|
getmonitoringIdOptions() {
|
|
|
|
|
getDataInterfaceRes('370933183241262469').then(res => {
|
|
|
|
@ -172,36 +191,36 @@
|
|
|
|
|
this.monitoringIdOptions = data
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
clearData(data){
|
|
|
|
|
clearData(data) {
|
|
|
|
|
for (let key in data) {
|
|
|
|
|
if (data[key] instanceof Array) {
|
|
|
|
|
data[key] = [];
|
|
|
|
|
data[key] = []
|
|
|
|
|
} else if (data[key] instanceof Object) {
|
|
|
|
|
this.clearData(data[key]);
|
|
|
|
|
this.clearData(data[key])
|
|
|
|
|
} else {
|
|
|
|
|
data[key] = "";
|
|
|
|
|
data[key] = ''
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
init(id, isDetail) {
|
|
|
|
|
this.dataForm.id = id || 0;
|
|
|
|
|
this.visible = true;
|
|
|
|
|
this.isDetail = isDetail || false;
|
|
|
|
|
this.dataForm.id = id || 0
|
|
|
|
|
this.visible = true
|
|
|
|
|
this.isDetail = isDetail || false
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs['elForm'].resetFields();
|
|
|
|
|
if(this.dataForm.id){
|
|
|
|
|
this.$refs['elForm'].resetFields()
|
|
|
|
|
if (this.dataForm.id) {
|
|
|
|
|
this.loading = true
|
|
|
|
|
request({
|
|
|
|
|
url: '/api/example/Monitoringitem/'+this.dataForm.id,
|
|
|
|
|
url: '/api/example/Monitoringitem/' + this.dataForm.id,
|
|
|
|
|
method: 'get'
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.dataInfo(res.data)
|
|
|
|
|
this.loading = false
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.clearData(this.dataForm)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
|
|
|
|
},
|
|
|
|
|
// 表单提交
|
|
|
|
@ -213,7 +232,7 @@
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
request() {
|
|
|
|
|
var _data =this.dataList()
|
|
|
|
|
var _data = this.dataList()
|
|
|
|
|
if (!this.dataForm.id) {
|
|
|
|
|
request({
|
|
|
|
|
url: '/api/example/Monitoringitem',
|
|
|
|
@ -230,9 +249,9 @@
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
request({
|
|
|
|
|
url: '/api/example/Monitoringitem/'+this.dataForm.id,
|
|
|
|
|
url: '/api/example/Monitoringitem/' + this.dataForm.id,
|
|
|
|
|
method: 'PUT',
|
|
|
|
|
data: _data
|
|
|
|
|
}).then((res) => {
|
|
|
|
@ -248,15 +267,15 @@
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
dataList(){
|
|
|
|
|
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
|
|
|
|
return _data;
|
|
|
|
|
dataList() {
|
|
|
|
|
var _data = JSON.parse(JSON.stringify(this.dataForm))
|
|
|
|
|
return _data
|
|
|
|
|
},
|
|
|
|
|
dataInfo(dataAll){
|
|
|
|
|
let _dataAll =dataAll
|
|
|
|
|
dataInfo(dataAll) {
|
|
|
|
|
let _dataAll = dataAll
|
|
|
|
|
this.dataForm = _dataAll
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|