Commit 595fcec0 authored by co_dengxiongwen's avatar co_dengxiongwen

页面调整

parent 11907e95
...@@ -301,8 +301,9 @@ export default { ...@@ -301,8 +301,9 @@ export default {
sessionStorage.getItem('token') && sessionStorage.getItem('token') &&
sessionStorage.getItem('token') != undefined sessionStorage.getItem('token') != undefined
) { ) {
var paramsInfo = JSON.parse(e.data) // var paramsInfo = JSON.parse(e.data)
console.log('paramsInfo:', paramsInfo) var paramsInfo = e.data
console.log('paramsInfo:', e.data)
// 集合 // 集合
this.$store.dispatch('d2admin/typeList/set', paramsInfo) this.$store.dispatch('d2admin/typeList/set', paramsInfo)
} }
...@@ -357,8 +358,8 @@ export default { ...@@ -357,8 +358,8 @@ export default {
sessionStorage.getItem('token') !== undefined sessionStorage.getItem('token') !== undefined
) { ) {
this.$http({ this.$http({
url: this.$http.adornUrlAlarm('/kanban/getListParam'), url: this.$http.adornUrl('/kanban/getListParam'),
method: 'post', method: 'get',
params: this.$http.adornParams({}) params: this.$http.adornParams({})
}).then((data) => { }).then((data) => {
if (data && data.code === 0) { if (data && data.code === 0) {
......
...@@ -38,6 +38,7 @@ export default { ...@@ -38,6 +38,7 @@ export default {
return { return {
mapId: '', mapId: '',
mapList: [], mapList: [],
thresholdList: [],
dataList: [ dataList: [
// { // {
// name: '喷淋系统', // name: '喷淋系统',
...@@ -161,6 +162,7 @@ export default { ...@@ -161,6 +162,7 @@ export default {
// } // }
}, },
created() { created() {
this.getThresholdList()
this.getMapList() this.getMapList()
}, },
methods: { methods: {
...@@ -182,6 +184,39 @@ export default { ...@@ -182,6 +184,39 @@ export default {
this.getDataList() this.getDataList()
}) })
}, },
getThresholdList() {
this.$http({
url: this.$http.adornUrl(`/sysThreshold/list`),
method: 'post',
params: this.$http.adornParams({})
}).then((data) => {
if (data && data.code === 0) {
this.thresholdList = data.list
this.thresholdList.forEach((element) => {
if (element.unit === 1) {
element.unit = 'MPa'
} else if (element.unit === 2) {
element.unit = '%RH'
} else if (element.unit === 3) {
element.unit = '°C'
} else if (element.unit === 4) {
element.unit = 'PPM'
} else if (element.unit === 5) {
element.unit = 'm3/h'
} else if (element.unit === 6) {
element.unit = 'cm'
} else if (element.unit === 7) {
element.unit = 'm/s'
} else if (element.unit === 8) {
element.unit = 'pa'
}
})
console.log('3333333---', this.thresholdList)
} else {
this.thresholdList = []
}
})
},
handleChange(res) { handleChange(res) {
console.log('333333---', res) console.log('333333---', res)
this.mapId = res this.mapId = res
...@@ -206,82 +241,108 @@ export default { ...@@ -206,82 +241,108 @@ export default {
} }
let list = [] let list = []
e.list.forEach((el) => { e.list.forEach((el) => {
if (e.id === 'b47661ca1d454f9792ba5369f3cb2bc5') { let newThresholdList = this.thresholdList.filter(
//无线压力计 (res) => res.dicId === e.id
)
newThresholdList.forEach((element) => {
list.push({ list.push({
id: el.id,
leftName: el.resourceName, leftName: el.resourceName,
rightName: '水流压力', rightName: element.typeName,
type: 'slyl', type: element.code,
value: '0.319mp', value: '0.319mp',
scope: '参考值:0.2~0.8mp' scope:
}) '参考值:' +
} else if (e.id === 'c788ce98c1f248f590434394da485ce4') { element.minValue +
//4合1环境探测器 '~' +
list.push({ element.maxValue +
leftName: el.resourceName, ' ' +
rightName: '一氧化碳', element.unit
type: 'co',
value: '22.5℃',
scope: '参考值:0.0~50℃'
})
list.push({
leftName: el.resourceName,
rightName: '二氧化碳',
type: 'co2',
value: '22.5℃',
scope: '参考值:0.0~50℃'
}) })
list.push({ })
leftName: el.resourceName,
rightName: '温度', // if (e.id === 'b47661ca1d454f9792ba5369f3cb2bc5') {
type: 'wd', // //无线压力计
value: '22.5℃', // list.push({
scope: '参考值:0.0~50℃' // leftName: el.resourceName,
}) // rightName: element.typeName,
list.push({ // type: 'slyl',
leftName: el.resourceName, // value: '0.319mp',
rightName: '湿度', // scope:
type: 'sd', // '参考值:' +
value: '22.5℃', // element.minValue +
scope: '参考值:0.0~50℃' // '~' +
}) // element.maxValue +
} else if (e.id === 'b45827c068254695864ee3c1d42573cb') { // 'mp'
//流量计 // })
list.push({ // } else if (e.id === 'c788ce98c1f248f590434394da485ce4') {
leftName: el.resourceName, // //4合1环境探测器
rightName: '水流流量', // list.push({
type: 'slyl', // leftName: el.resourceName,
value: '0.319mp', // rightName: '一氧化碳',
scope: '参考值:0.2~0.8mp' // type: 'co',
}) // value: '22.5℃',
} else if (e.id === '303310efddb34a2e9bf269bdff8a7dc5') { // scope: '参考值:0.0~50℃'
//无线液位仪 // })
list.push({ // list.push({
leftName: el.resourceName, // leftName: el.resourceName,
rightName: '水流压力', // rightName: '二氧化碳',
type: 'slyl', // type: 'co2',
value: '0.319mp', // value: '22.5℃',
scope: '参考值:0.2~0.8mp' // scope: '参考值:0.0~50℃'
}) // })
} else if (e.id === 'f4c840711eae4bcb9536a890cdfda493') { // list.push({
//风速仪 // leftName: el.resourceName,
list.push({ // rightName: '温度',
leftName: el.resourceName, // type: 'wd',
rightName: '风速', // value: '22.5℃',
type: 'slyl', // scope: '参考值:0.0~50℃'
value: '0.319mp', // })
scope: '参考值:0.2~0.8mp' // list.push({
}) // leftName: el.resourceName,
} else if (e.id === '5b26f6c8f2a143048bd0e327ca5c186d') { // rightName: '湿度',
//风压仪 // type: 'sd',
list.push({ // value: '22.5℃',
leftName: el.resourceName, // scope: '参考值:0.0~50℃'
rightName: '风压', // })
type: 'slyl', // } else if (e.id === 'b45827c068254695864ee3c1d42573cb') {
value: '0.319mp', // //流量计
scope: '参考值:0.2~0.8mp' // list.push({
}) // leftName: el.resourceName,
} // rightName: '水流流量',
// type: 'slyl',
// value: '0.319mp',
// scope: '参考值:0.2~0.8mp'
// })
// } else if (e.id === '303310efddb34a2e9bf269bdff8a7dc5') {
// //无线液位仪
// list.push({
// leftName: el.resourceName,
// rightName: '水流压力',
// type: 'slyl',
// value: '0.319mp',
// scope: '参考值:0.2~0.8mp'
// })
// } else if (e.id === 'f4c840711eae4bcb9536a890cdfda493') {
// //风速仪
// list.push({
// leftName: el.resourceName,
// rightName: '风速',
// type: 'slyl',
// value: '0.319mp',
// scope: '参考值:0.2~0.8mp'
// })
// } else if (e.id === '5b26f6c8f2a143048bd0e327ca5c186d') {
// //风压仪
// list.push({
// leftName: el.resourceName,
// rightName: '风压',
// type: 'slyl',
// value: '0.319mp',
// scope: '参考值:0.2~0.8mp'
// })
// }
console.log('list:', list) console.log('list:', list)
}) })
item.name = e.name item.name = e.name
......
...@@ -7,12 +7,19 @@ ...@@ -7,12 +7,19 @@
el-form-item(label='类型:' prop='type') el-form-item(label='类型:' prop='type')
el-select.mywidth(style='width:100%;' v-model='dataForm.type' placeholder="请选择类型" clearable) el-select.mywidth(style='width:100%;' v-model='dataForm.type' placeholder="请选择类型" clearable)
el-option(v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.id") el-option(v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.id")
el-col(:span='14' :offset='4')
el-form-item(label='编码:' prop='code')
el-input.mywidth(v-model='dataForm.code' placeholder='请填写编码' clearable)
el-col(:span='14' :offset='4') el-col(:span='14' :offset='4')
el-form-item(label='最小值:' prop='minValue') el-form-item(label='最小值:' prop='minValue')
el-input.mywidth(v-model='dataForm.minValue' placeholder='请填写最小值' clearable) el-input.mywidth(v-model='dataForm.minValue' placeholder='请填写最小值' clearable)
el-col(:span='14' :offset='4') el-col(:span='14' :offset='4')
el-form-item(label='最大值:' prop='maxValue') el-form-item(label='最大值:' prop='maxValue')
el-input.mywidth(v-model='dataForm.maxValue' placeholder='请填写最大值' clearable) el-input.mywidth(v-model='dataForm.maxValue' placeholder='请填写最大值' clearable)
el-col(:span='14' :offset='4')
el-form-item(label='单位:' prop='unit')
el-select.mywidth(style='width:100%;' v-model='dataForm.unit' placeholder="请选择单位" clearable)
el-option(v-for="(item,index) in unitList" :key="index" :label="item.name" :value="item.id")
el-col(:span='14' :offset='4') el-col(:span='14' :offset='4')
el-form-item(label="阈值说明:" prop="remark") el-form-item(label="阈值说明:" prop="remark")
el-input.mywidth(v-model="dataForm.remark" type="textarea" :rows="5" resize="none" placeholder="请输入阈值说明" clearable) el-input.mywidth(v-model="dataForm.remark" type="textarea" :rows="5" resize="none" placeholder="请输入阈值说明" clearable)
...@@ -28,29 +35,47 @@ export default { ...@@ -28,29 +35,47 @@ export default {
visible: false, visible: false,
typeList: [], typeList: [],
dataForm: {}, dataForm: {},
unitList: [
{ id: 1, name: 'MPa' },
{ id: 2, name: '%RH' },
{ id: 3, name: '°C' },
{ id: 4, name: 'PPM' },
{ id: 5, name: 'm3/h' },
{ id: 6, name: 'cm' },
{ id: 7, name: 'm/s' },
{ id: 8, name: 'pa' }
],
dataRule: { dataRule: {
type: [ type: [
{ {
required: true, required: true,
message: '类型不能为空', message: '类型不能为空',
trigger: ['change', 'blur'], trigger: ['change', 'blur']
}, }
], ],
code: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
minValue: [ minValue: [
{ required: true, message: '名称不能为空', trigger: 'blur' }, { required: true, message: '最小值不能为空', trigger: 'blur' }
], ],
maxValue: [ maxValue: [
{ required: true, message: '编码不能为空', trigger: 'blur' }, { required: true, message: '最大值不能为空', trigger: 'blur' }
],
unit: [
{
required: true,
message: '单位不能为空',
trigger: ['change', 'blur']
}
], ],
remark: [ remark: [
{ {
min: 1, min: 1,
max: 500, max: 500,
message: '长度在 1 到 500 个字符', message: '长度在 1 到 500 个字符',
trigger: 'blur', trigger: 'blur'
}, }
], ]
}, }
} }
}, },
watch: { watch: {
...@@ -60,8 +85,8 @@ export default { ...@@ -60,8 +85,8 @@ export default {
this.$refs.dataForm.resetFields() this.$refs.dataForm.resetFields()
} }
}, },
deep: true, deep: true
}, }
}, },
mounted() { mounted() {
this.getAllType() this.getAllType()
...@@ -79,7 +104,7 @@ export default { ...@@ -79,7 +104,7 @@ export default {
name: '', name: '',
remark: '', remark: '',
dicId: typeId, dicId: typeId,
stationId: localStorage.getItem('stationId'), stationId: localStorage.getItem('stationId')
} }
} }
}, },
...@@ -89,8 +114,8 @@ export default { ...@@ -89,8 +114,8 @@ export default {
url: this.$http.adornUrl('/sysDictionary/getThresholdDicList'), url: this.$http.adornUrl('/sysDictionary/getThresholdDicList'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
stationId: localStorage.getItem('stationId'), stationId: localStorage.getItem('stationId')
}), })
}).then((data) => { }).then((data) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.typeList = data.list this.typeList = data.list
...@@ -108,7 +133,7 @@ export default { ...@@ -108,7 +133,7 @@ export default {
`/sysThreshold/${!this.dataForm.id ? 'save' : 'update'}` `/sysThreshold/${!this.dataForm.id ? 'save' : 'update'}`
), ),
method: 'post', method: 'post',
data: this.dataForm, data: this.dataForm
}).then((data) => { }).then((data) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
...@@ -118,7 +143,7 @@ export default { ...@@ -118,7 +143,7 @@ export default {
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.$emit('refreshdatalist') this.$emit('refreshdatalist')
}, }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
...@@ -132,7 +157,7 @@ export default { ...@@ -132,7 +157,7 @@ export default {
this.$confirm('确认取消?', this.dataForm.id ? '编辑阈值' : '新增阈值', { this.$confirm('确认取消?', this.dataForm.id ? '编辑阈值' : '新增阈值', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning'
}) })
.then(() => { .then(() => {
this.visible = false this.visible = false
...@@ -140,11 +165,11 @@ export default { ...@@ -140,11 +165,11 @@ export default {
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消退出', message: '已取消退出'
}) })
}) })
}, }
}, }
} }
</script> </script>
<style> <style>
......
...@@ -24,6 +24,15 @@ ...@@ -24,6 +24,15 @@
template( slot-scope="scope") template( slot-scope="scope")
span {{scope.$index+(pageIndex - 1) * pageSize + 1}} span {{scope.$index+(pageIndex - 1) * pageSize + 1}}
template( slot='unit' slot-scope="scope")
font(v-if='scope.row.unit===1') MPa
font(v-if='scope.row.unit===2') %RH
font(v-if='scope.row.unit===3') °C
font(v-if='scope.row.unit===4') PPM
font(v-if='scope.row.unit===5') m3/h
font(v-if='scope.row.unit===6') cm
font(v-if='scope.row.unit===7') m/s
font(v-if='scope.row.unit===8') pa
//- 操作项 //- 操作项
template.operation( slot-scope="scope") template.operation( slot-scope="scope")
el-button(v-if="isAuth('sys:threshold:update')" size="mini" type="text" @click="addOrUpdateHandle(scope.row)") 编辑 el-button(v-if="isAuth('sys:threshold:update')" size="mini" type="text" @click="addOrUpdateHandle(scope.row)") 编辑
...@@ -54,18 +63,20 @@ export default { ...@@ -54,18 +63,20 @@ export default {
checkList: [], //筛选数据 checkList: [], //筛选数据
tableHeader: [ tableHeader: [
{ label: '类型', prop: 'typeName', sort: false }, { label: '类型', prop: 'typeName', sort: false },
{ label: '编码', prop: 'code', sort: false },
{ label: '最小值', prop: 'minValue', sort: false }, { label: '最小值', prop: 'minValue', sort: false },
{ label: '最大值', prop: 'maxValue', sort: false }, { label: '最大值', prop: 'maxValue', sort: false },
{ label: '单位', prop: 'unit', sort: true }
], ],
tableOption: { tableOption: {
border: false, //是否边框 border: false, //是否边框
maxHeight: 500, //高度 maxHeight: 500 //高度
}, }
} }
}, },
components: { components: {
AddOrUpdate, AddOrUpdate,
dragTable, dragTable
}, },
watch: { watch: {
totalPage() { totalPage() {
...@@ -76,7 +87,7 @@ export default { ...@@ -76,7 +87,7 @@ export default {
this.pageIndex = pages || 1 this.pageIndex = pages || 1
this.getEvent() //获取表格数据的方法 this.getEvent() //获取表格数据的方法
} }
}, }
}, },
created() { created() {
this.checkList = [...this.tableHeader] this.checkList = [...this.tableHeader]
...@@ -116,8 +127,8 @@ export default { ...@@ -116,8 +127,8 @@ export default {
data: { data: {
page: this.pageIndex, page: this.pageIndex,
rows: this.pageSize, rows: this.pageSize,
dicId: this.typeId, dicId: this.typeId
}, }
}).then((data) => { }).then((data) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.thresholdData = data.page.rows this.thresholdData = data.page.rows
...@@ -135,8 +146,8 @@ export default { ...@@ -135,8 +146,8 @@ export default {
url: this.$http.adornUrl(`/sysDictionary/getResourceTypeDicList`), url: this.$http.adornUrl(`/sysDictionary/getResourceTypeDicList`),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
stationId: this.stationId, stationId: this.stationId
}), })
}) })
.then((data) => { .then((data) => {
if (data && data.code === 0) { if (data && data.code === 0) {
...@@ -170,13 +181,13 @@ export default { ...@@ -170,13 +181,13 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
closeOnClickModal: false, closeOnClickModal: false
}) })
.then(() => { .then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl(`/sysThreshold/deleteByFlag`), url: this.$http.adornUrl(`/sysThreshold/deleteByFlag`),
method: 'post', method: 'post',
data: this.$http.adornData(ids, false), data: this.$http.adornData(ids, false)
}).then((data) => { }).then((data) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
...@@ -185,7 +196,7 @@ export default { ...@@ -185,7 +196,7 @@ export default {
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.getThreshold() this.getThreshold()
}, }
}) })
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
...@@ -195,11 +206,11 @@ export default { ...@@ -195,11 +206,11 @@ export default {
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消删除', message: '已取消删除'
}) })
}) })
}, }
}, }
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment