tengxi 2 years ago
parent 5a9f59d172
commit fadb9543bc

@ -15,12 +15,24 @@
</el-input>
</el-form-item>
</el-col>
<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">
<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>
<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>
@ -30,7 +42,8 @@
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>
@ -67,47 +80,50 @@
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-row>
@ -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: [],
@ -131,17 +148,18 @@
isDetail: false,
dataForm: {
mName: '',
monitoringId : "",
monitoringId: '',
serialnumber: '',
mStatus : "0",
mStatus: '0',
flvAddress: '',
flvHdAddress: '',
channelNumber: '',
isEnable : "0",
isEnable: '0',
lastmodifytime: '',
deleteUserId: '',
creatorUserName: '',
creatorTime : '',
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"}],
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 => {
@ -175,20 +194,20 @@
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();
this.$refs['elForm'].resetFields()
if (this.dataForm.id) {
this.loading = true
request({
@ -197,11 +216,11 @@
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
})
} else {
this.clearData(this.dataForm)
}
});
})
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
@ -249,14 +268,14 @@
}
},
dataList() {
var _data = JSON.parse(JSON.stringify(this.dataForm));
return _data;
var _data = JSON.parse(JSON.stringify(this.dataForm))
return _data
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
},
},
}
}
}
</script>

Loading…
Cancel
Save