Commit 595fcec0 authored by co_dengxiongwen's avatar co_dengxiongwen

页面调整

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