Compare commits
No commits in common. "6c7390f61ee0875af7f448b2c7aebbd20322b832" and "f2e38b5e67d17e05da9cf40e863ba845fd8045ab" have entirely different histories.
6c7390f61e
...
f2e38b5e67
2
.env.dev
2
.env.dev
@ -20,7 +20,7 @@ VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
|||||||
# VUE_APP_BASE_API = 'http://192.168.1.8:48082'
|
# VUE_APP_BASE_API = 'http://192.168.1.8:48082'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
|
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.1.56:48082'
|
# VUE_APP_BASE_API = 'http://192.168.1.56:48082'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.1.62:48082'
|
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
|
||||||
|
|
||||||
# 积木报表指向地址
|
# 积木报表指向地址
|
||||||
VUE_APP_JIMU_API = 'http://192.168.0.33:48082'
|
VUE_APP_JIMU_API = 'http://192.168.0.33:48082'
|
||||||
|
@ -1,92 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 获得环保检测指标实时数据
|
|
||||||
export function environmentalCheckRealtime(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/environmental-check/realtime',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获得环保检测指标趋势数据
|
|
||||||
export function environmentalCheckRealtimeTrend(data) {
|
|
||||||
return request({
|
|
||||||
url: '/base/environmental-check-record/trend',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获得环保检测指标分页
|
|
||||||
export function environmentalCheckPage(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/environmental-check/page',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 创建环保检测指标
|
|
||||||
export function environmentalCheckCreate(data) {
|
|
||||||
return request({
|
|
||||||
url: '/base/environmental-check/create',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 更新环保检测指标
|
|
||||||
export function environmentalCheckUpdate(data) {
|
|
||||||
return request({
|
|
||||||
url: '/base/environmental-check/update',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获得环保检测指标
|
|
||||||
export function environmentalCheckGet(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/environmental-check/get',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除环保检测指标
|
|
||||||
export function environmentalCheckDelete(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/environmental-check/delete',
|
|
||||||
method: 'delete',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获得环保检测记录分页
|
|
||||||
export function environmentalCheckRecordPage(data) {
|
|
||||||
return request({
|
|
||||||
url: '/base/environmental-check-record/page',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 导出环保检测记录 Excel
|
|
||||||
export function environmentalCheckRecordExport(data) {
|
|
||||||
return request({
|
|
||||||
url: '/base/environmental-check-record/export-excel',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
responseType: 'blob'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取环保检测指标code
|
|
||||||
export function getEnvironmentalCheckCode(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/environmental-check/getCode',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB |
@ -106,9 +106,6 @@ export const DICT_TYPE = {
|
|||||||
// ============== EQUIPMENT - 设备模块 =============
|
// ============== EQUIPMENT - 设备模块 =============
|
||||||
MAINTAIN_TYPE: 'maintain_type',
|
MAINTAIN_TYPE: 'maintain_type',
|
||||||
FAULT_LEVEL: 'fault-level',
|
FAULT_LEVEL: 'fault-level',
|
||||||
|
|
||||||
// ============== ENVIRONMENTAL - 环保模块 =============
|
|
||||||
ENVIRONMENT_CHECK_UNIT: 'environment_check_unit'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -221,30 +221,18 @@ export default {
|
|||||||
timeSelect() {
|
timeSelect() {
|
||||||
switch (this.queryParams.timeDim) {
|
switch (this.queryParams.timeDim) {
|
||||||
case '1':
|
case '1':
|
||||||
if (!this.timeValue) {
|
|
||||||
this.$modal.msgError('时间范围不能为空')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (this.timeValue[1] - this.timeValue[0] > 7*24*3600000) {
|
if (this.timeValue[1] - this.timeValue[0] > 7*24*3600000) {
|
||||||
this.$modal.msgError('最大时间范围为7天,请重新选择')
|
this.$modal.msgError('最大时间范围为7天,请重新选择')
|
||||||
this.timeValue = []
|
this.timeValue = []
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case '2':
|
case '2':
|
||||||
if (!this.dateValue) {
|
|
||||||
this.$modal.msgError('时间范围不能为空')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (this.dateValue[1] - this.dateValue[0] > 29*24*3600000) {
|
if (this.dateValue[1] - this.dateValue[0] > 29*24*3600000) {
|
||||||
this.$modal.msgError('最大时间范围为30天,请重新选择') // 自动选择默认是0:00:00要求是23:59:59
|
this.$modal.msgError('最大时间范围为30天,请重新选择') // 自动选择默认是0:00:00要求是23:59:59
|
||||||
this.dateValue = []
|
this.dateValue = []
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case '4':
|
case '4':
|
||||||
if (!this.monthValue) {
|
|
||||||
this.$modal.msgError('时间范围不能为空')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (this.monthValue[1] - this.monthValue[0] > 729*24*3600000) {
|
if (this.monthValue[1] - this.monthValue[0] > 729*24*3600000) {
|
||||||
this.$modal.msgError('最大时间范围为24个月,请重新选择')// 同理上面
|
this.$modal.msgError('最大时间范围为24个月,请重新选择')// 同理上面
|
||||||
this.monthValue = []
|
this.monthValue = []
|
||||||
@ -350,7 +338,7 @@ export default {
|
|||||||
}
|
}
|
||||||
switch (this.queryParams.timeDim) {
|
switch (this.queryParams.timeDim) {
|
||||||
case '1':
|
case '1':
|
||||||
if (this.timeValue && this.timeValue.length > 0) {
|
if (this.timeValue.length > 0) {
|
||||||
this.queryParams.startTime = this.timeValue[0]
|
this.queryParams.startTime = this.timeValue[0]
|
||||||
this.queryParams.endTime = this.timeValue[1] // 不用转
|
this.queryParams.endTime = this.timeValue[1] // 不用转
|
||||||
} else {
|
} else {
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import * as echarts from 'echarts'
|
import * as echarts from 'echarts'
|
||||||
import resize from '@/utils/chartMixins/resize'
|
import resize from '@/utils/chartMixins/resize'
|
||||||
|
import moment from 'moment'
|
||||||
export default {
|
export default {
|
||||||
name: "LineChart",
|
name: "LineChart",
|
||||||
mixins: [resize],
|
mixins: [resize],
|
||||||
|
@ -207,30 +207,18 @@ export default {
|
|||||||
timeSelect() {
|
timeSelect() {
|
||||||
switch (this.queryParams.timeDim) {
|
switch (this.queryParams.timeDim) {
|
||||||
case '1':
|
case '1':
|
||||||
if (!this.timeValue) {
|
|
||||||
this.$modal.msgError('时间范围不能为空')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (this.timeValue[1] - this.timeValue[0] > 7*24*3600000) {
|
if (this.timeValue[1] - this.timeValue[0] > 7*24*3600000) {
|
||||||
this.$modal.msgError('最大时间范围为7天,请重新选择')
|
this.$modal.msgError('最大时间范围为7天,请重新选择')
|
||||||
this.timeValue = []
|
this.timeValue = []
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case '2':
|
case '2':
|
||||||
if (!this.dateValue) {
|
|
||||||
this.$modal.msgError('时间范围不能为空')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (this.dateValue[1] - this.dateValue[0] > 29*24*3600000) {
|
if (this.dateValue[1] - this.dateValue[0] > 29*24*3600000) {
|
||||||
this.$modal.msgError('最大时间范围为30天,请重新选择') // 自动选择默认是0:00:00要求是23:59:59
|
this.$modal.msgError('最大时间范围为30天,请重新选择') // 自动选择默认是0:00:00要求是23:59:59
|
||||||
this.dateValue = []
|
this.dateValue = []
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case '4':
|
case '4':
|
||||||
if (!this.monthValue) {
|
|
||||||
this.$modal.msgError('时间范围不能为空')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (this.monthValue[1] - this.monthValue[0] > 729*24*3600000) {
|
if (this.monthValue[1] - this.monthValue[0] > 729*24*3600000) {
|
||||||
this.$modal.msgError('最大时间范围为24个月,请重新选择')// 同理上面
|
this.$modal.msgError('最大时间范围为24个月,请重新选择')// 同理上面
|
||||||
this.monthValue = []
|
this.monthValue = []
|
||||||
@ -319,7 +307,7 @@ export default {
|
|||||||
}
|
}
|
||||||
switch (this.queryParams.timeDim) {
|
switch (this.queryParams.timeDim) {
|
||||||
case '1':
|
case '1':
|
||||||
if (this.timeValue && this.timeValue.length > 0) {
|
if (this.timeValue.length > 0) {
|
||||||
this.queryParams.startTime = this.timeValue[0]
|
this.queryParams.startTime = this.timeValue[0]
|
||||||
this.queryParams.endTime = this.timeValue[1] // 不用转
|
this.queryParams.endTime = this.timeValue[1] // 不用转
|
||||||
} else {
|
} else {
|
||||||
@ -328,7 +316,7 @@ export default {
|
|||||||
}
|
}
|
||||||
break
|
break
|
||||||
case '2':
|
case '2':
|
||||||
if (this.dateValue && this.dateValue.length > 0) {
|
if (this.dateValue.length > 0) {
|
||||||
this.queryParams.startTime = this.dateValue[0]
|
this.queryParams.startTime = this.dateValue[0]
|
||||||
this.queryParams.endTime = this.dateValue[1] + 86399000 // 转为23:59:59
|
this.queryParams.endTime = this.dateValue[1] + 86399000 // 转为23:59:59
|
||||||
} else {
|
} else {
|
||||||
@ -348,7 +336,7 @@ export default {
|
|||||||
}
|
}
|
||||||
break
|
break
|
||||||
case '4':// 转为本月最后一天的最后一秒
|
case '4':// 转为本月最后一天的最后一秒
|
||||||
if (this.monthValue && this.monthValue.length > 0) {
|
if (this.monthValue.length > 0) {
|
||||||
this.queryParams.startTime = this.monthValue[0]
|
this.queryParams.startTime = this.monthValue[0]
|
||||||
this.queryParams.endTime = this.transformTime(this.monthValue[1])
|
this.queryParams.endTime = this.transformTime(this.monthValue[1])
|
||||||
} else {
|
} else {
|
||||||
|
@ -175,7 +175,7 @@ export default {
|
|||||||
btnName: '删除'
|
btnName: '删除'
|
||||||
}
|
}
|
||||||
: undefined
|
: undefined
|
||||||
].filter((v)=>v),
|
],
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
|
@ -1,150 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div
|
|
||||||
id="wasteWaterLine"
|
|
||||||
style="width: 100%"
|
|
||||||
:style="{ height: chartHeight + 'px' }"
|
|
||||||
></div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import * as echarts from 'echarts'
|
|
||||||
import resize from '@/utils/chartMixins/resize'
|
|
||||||
export default {
|
|
||||||
name: "LineChart",
|
|
||||||
mixins: [resize],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
chartDom: '',
|
|
||||||
chart: '',
|
|
||||||
chartHeight: this.tableHeight(420)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
chartData: {
|
|
||||||
type: Object,
|
|
||||||
required: true,
|
|
||||||
default: () => {
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
timeDim: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
window.addEventListener('resize', () => {
|
|
||||||
this.chartHeight = this.tableHeight(420)
|
|
||||||
})
|
|
||||||
this.getChart()
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
chartData: function () {
|
|
||||||
this.getChart()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getChart() {
|
|
||||||
if (
|
|
||||||
this.chart !== null &&
|
|
||||||
this.chart !== '' &&
|
|
||||||
this.chart !== undefined
|
|
||||||
) {
|
|
||||||
this.chart.dispose() // 页面多次刷新会出现警告,Dom已经初始化了一个实例,这是销毁实例
|
|
||||||
}
|
|
||||||
this.chartDom = document.getElementById('wasteWaterLine');
|
|
||||||
this.chart = echarts.init(this.chartDom);
|
|
||||||
if (Object.keys(this.chartData).length === 0) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
let legendData = []
|
|
||||||
let xData = []
|
|
||||||
let seriesData = []
|
|
||||||
for (let item in this.chartData) {
|
|
||||||
legendData.push(item)
|
|
||||||
let obj = {}
|
|
||||||
let data = []
|
|
||||||
for (let subItem in this.chartData[item]) {
|
|
||||||
data.push(this.chartData[item][subItem].checkValue)
|
|
||||||
}
|
|
||||||
obj.name = item
|
|
||||||
obj.type = 'line'
|
|
||||||
obj.stack = 'Total'
|
|
||||||
obj.symbol = 'none'
|
|
||||||
obj.data = data
|
|
||||||
seriesData.push(obj)
|
|
||||||
}
|
|
||||||
for (let i = 0; i < this.chartData[legendData[0]].length; i++) {
|
|
||||||
let time = ""
|
|
||||||
if (this.timeDim === '3') {
|
|
||||||
let year = this.chartData[legendData[0]][i].axisTime.slice(0,4)
|
|
||||||
let weak = this.chartData[legendData[0]][i].axisTime.slice(6,8)
|
|
||||||
time = year+' 第 '+weak+' 周'
|
|
||||||
} else {
|
|
||||||
time = this.chartData[legendData[0]][i].axisTime
|
|
||||||
}
|
|
||||||
xData.push(time)
|
|
||||||
}
|
|
||||||
var option = {
|
|
||||||
color: ['#63BDFF', '#7164FF', '#FF6860', '#FF9747', '#B0EB42', '#D680FF', '#0043D2'],
|
|
||||||
tooltip: {
|
|
||||||
trigger: 'axis',
|
|
||||||
formatter: function (params) {
|
|
||||||
return (
|
|
||||||
params[0].axisValue +
|
|
||||||
`<br>` +
|
|
||||||
params
|
|
||||||
.map((item) => {
|
|
||||||
let str = `<span style="display:inline-block;width:8px;height:8px;margin: 0 8px 0 -3px;border-radius:2px;background-color:${item.color};"></span>`;
|
|
||||||
let seriesNameStr = `<span style="display:inline-block;">${item.seriesName}</span>`;
|
|
||||||
let value = item.value ? item.value : '-';
|
|
||||||
let valueStr = `<span style="display:inline-block;margin-left:10px;color:rgba(0,0,0,0.45);">${value}</span>`;
|
|
||||||
return `<span style="display:flex; justify-content:space-between; margin-bottom: 2px">
|
|
||||||
<span>${str}${seriesNameStr}</span>
|
|
||||||
<span>${valueStr}</span>
|
|
||||||
</span>`;
|
|
||||||
})
|
|
||||||
.join(``)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
legend: {
|
|
||||||
data: legendData,
|
|
||||||
right: '2%',
|
|
||||||
icon: 'rect',
|
|
||||||
itemHeight: 8,
|
|
||||||
itemWidth: 8,
|
|
||||||
textStyle: {
|
|
||||||
color: 'auto'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
grid: {
|
|
||||||
left: '3%',
|
|
||||||
right: '2%',
|
|
||||||
bottom: '3%',
|
|
||||||
containLabel: true
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
type: 'category',
|
|
||||||
boundaryGap: false,
|
|
||||||
data: xData,
|
|
||||||
axisLabel: {
|
|
||||||
rotate: "45"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
type: 'value'
|
|
||||||
},
|
|
||||||
axisPointer: {
|
|
||||||
type: 'line',
|
|
||||||
lineStyle: {
|
|
||||||
color: 'rgba(11, 88, 255, 1)'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
series: seriesData
|
|
||||||
};
|
|
||||||
|
|
||||||
option && this.chart.setOption(option);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,378 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="searchBarBox divHeight" ref="searchBarRef">
|
|
||||||
<el-form :inline="true" class="demo-form-inline">
|
|
||||||
<el-form-item label="时间维度" required>
|
|
||||||
<el-select v-model="queryParams.timeDim" placeholder="请选择" style="width: 80px;" size="small">
|
|
||||||
<el-option
|
|
||||||
v-for="item in getDictDatas(this.DICT_TYPE.TIME_DIM)"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
size="small">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="时间范围" required>
|
|
||||||
<div v-show="queryParams.timeDim === '1'">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="timeValue"
|
|
||||||
type="datetimerange"
|
|
||||||
range-separator="至"
|
|
||||||
start-placeholder="开始日期"
|
|
||||||
end-placeholder="结束日期"
|
|
||||||
format="yyyy-MM-dd HH:mm"
|
|
||||||
value-format="timestamp"
|
|
||||||
:picker-options="pickerOptions"
|
|
||||||
popper-class="noneMinute"
|
|
||||||
@change="timeSelect"
|
|
||||||
size="small"
|
|
||||||
style='width:350px;'
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
|
||||||
</div>
|
|
||||||
<div v-show="queryParams.timeDim === '2'">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="dateValue"
|
|
||||||
type="daterange"
|
|
||||||
range-separator="至"
|
|
||||||
start-placeholder="开始日期"
|
|
||||||
end-placeholder="结束日期"
|
|
||||||
value-format="timestamp"
|
|
||||||
:picker-options="pickerOptions"
|
|
||||||
@change="timeSelect"
|
|
||||||
size="small"
|
|
||||||
style='width:350px;'
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
|
||||||
</div>
|
|
||||||
<div v-show="queryParams.timeDim === '3'">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="weekValue1"
|
|
||||||
type="week"
|
|
||||||
format="yyyy 第 WW 周"
|
|
||||||
style='width:170px;'
|
|
||||||
:picker-options="pickerOptionsWeek"
|
|
||||||
@change="startWeek"
|
|
||||||
size="small"
|
|
||||||
placeholder="选择周">
|
|
||||||
</el-date-picker>-
|
|
||||||
<el-date-picker
|
|
||||||
v-model="weekValue2"
|
|
||||||
type="week"
|
|
||||||
format="yyyy 第 WW 周"
|
|
||||||
:picker-options="pickerOptionsWeek"
|
|
||||||
style='width:170px;'
|
|
||||||
@change="endWeek"
|
|
||||||
size="small"
|
|
||||||
placeholder="选择周">
|
|
||||||
</el-date-picker>
|
|
||||||
</div>
|
|
||||||
<div v-show="queryParams.timeDim === '4'">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="monthValue"
|
|
||||||
type="monthrange"
|
|
||||||
range-separator="至"
|
|
||||||
start-placeholder="开始日期"
|
|
||||||
end-placeholder="结束日期"
|
|
||||||
value-format="timestamp"
|
|
||||||
:picker-options="pickerOptions"
|
|
||||||
size="small"
|
|
||||||
style='width:350px;'
|
|
||||||
@change="timeSelect"
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
|
||||||
</div>
|
|
||||||
<div v-show="queryParams.timeDim === '5'">
|
|
||||||
<el-date-picker
|
|
||||||
style='width:170px;'
|
|
||||||
v-model="yearValue1"
|
|
||||||
type="year"
|
|
||||||
:picker-options="pickerOptions"
|
|
||||||
value-format="timestamp"
|
|
||||||
placeholder="选择年"
|
|
||||||
size="small"
|
|
||||||
@change="startYear"
|
|
||||||
>
|
|
||||||
</el-date-picker>-
|
|
||||||
<el-date-picker
|
|
||||||
style='width:170px;'
|
|
||||||
v-model="yearValue2"
|
|
||||||
type="year"
|
|
||||||
:picker-options="pickerOptions"
|
|
||||||
value-format="timestamp"
|
|
||||||
placeholder="选择年"
|
|
||||||
size="small"
|
|
||||||
@change="endYear"
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" size="small" @click="search">查询</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import moment from 'moment'
|
|
||||||
export default {
|
|
||||||
name: 'SearchArea',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
timeDim: null,
|
|
||||||
startTime: null,
|
|
||||||
endTime: null
|
|
||||||
},
|
|
||||||
timeValue: [],// 最大7天只能整点
|
|
||||||
dateValue: [],// 最大30天
|
|
||||||
weekValue1: null,//最多24周
|
|
||||||
weekValue2: null,
|
|
||||||
monthValue: [],//最多24月
|
|
||||||
yearValue1: null,//最多10年
|
|
||||||
yearValue2: null,
|
|
||||||
pickerOptions: {
|
|
||||||
disabledDate(date) {
|
|
||||||
return date.getTime() > Date.now()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
pickerOptionsWeek: {
|
|
||||||
disabledDate(time) {
|
|
||||||
let day = Date.now()
|
|
||||||
let limitTime = moment(day).day(-1)
|
|
||||||
return time.getTime() > new Date(limitTime).getTime()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.queryParams.timeDim = this.getDictDatas(this.DICT_TYPE.TIME_DIM)[0].value // 默认时
|
|
||||||
this.timeValue = [moment().startOf('day'), moment().endOf('day')-59*61*1000]
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 范围选择器
|
|
||||||
timeSelect() {
|
|
||||||
switch (this.queryParams.timeDim) {
|
|
||||||
case '1':
|
|
||||||
if (!this.timeValue) {
|
|
||||||
this.$modal.msgError('时间范围不能为空')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (this.timeValue[1] - this.timeValue[0] > 7*24*3600000) {
|
|
||||||
this.$modal.msgError('最大时间范围为7天,请重新选择')
|
|
||||||
this.timeValue = []
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case '2':
|
|
||||||
if (!this.dateValue) {
|
|
||||||
this.$modal.msgError('时间范围不能为空')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (this.dateValue[1] - this.dateValue[0] > 29*24*3600000) {
|
|
||||||
this.$modal.msgError('最大时间范围为30天,请重新选择') // 自动选择默认是0:00:00要求是23:59:59
|
|
||||||
this.dateValue = []
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case '4':
|
|
||||||
if (!this.monthValue) {
|
|
||||||
this.$modal.msgError('时间范围不能为空')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (this.monthValue[1] - this.monthValue[0] > 729*24*3600000) {
|
|
||||||
this.$modal.msgError('最大时间范围为24个月,请重新选择')// 同理上面
|
|
||||||
this.monthValue = []
|
|
||||||
}
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 年选择器
|
|
||||||
startYear() {
|
|
||||||
if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
|
|
||||||
this.$modal.msgError('开始时间不能晚于结束时间,请重新选择')
|
|
||||||
this.yearValue1 = null
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (this.yearValue1 && this.yearValue2) {
|
|
||||||
if (this.yearValue2 - this.yearValue1 > 10*365*24*3600000) {
|
|
||||||
this.$modal.msgError('最大时间范围为10年,请重新选择')
|
|
||||||
this.yearValue1 = null
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
endYear() {
|
|
||||||
if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
|
|
||||||
this.$modal.msgError('结束时间不能早于开始时间,请重新选择')
|
|
||||||
this.yearValue2 = null
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (this.yearValue1 && this.yearValue2) {
|
|
||||||
if (this.yearValue2 - this.yearValue1 > 10*365*24*3600000) {
|
|
||||||
this.$modal.msgError('最大时间范围为10年,请重新选择')
|
|
||||||
this.yearValue2 = null
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 周选择器
|
|
||||||
startWeek() {
|
|
||||||
if (this.weekValue1 && this.weekValue2) {
|
|
||||||
let a = new Date(this.weekValue1).getTime()
|
|
||||||
let b = new Date(this.weekValue2).getTime()
|
|
||||||
if (a > b) {
|
|
||||||
this.$modal.msgError('开始时间不能晚于结束时间,请重新选择')
|
|
||||||
this.weekValue1 = null
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (b - a > 167*24*3600000) {
|
|
||||||
this.$modal.msgError('最大时间范围为24周,请重新选择')
|
|
||||||
this.weekValue1 = null
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
endWeek() {
|
|
||||||
if (this.weekValue1 && this.weekValue2) {
|
|
||||||
let a = new Date(this.weekValue1).getTime()
|
|
||||||
let b = new Date(this.weekValue2).getTime()
|
|
||||||
if (a > b) {
|
|
||||||
this.$modal.msgError('结束时间不能早于开始时间,请重新选择')
|
|
||||||
this.weekValue2 = null
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (b - a > 167*24*3600000) {
|
|
||||||
this.$modal.msgError('最大时间范围为24周,请重新选择')
|
|
||||||
this.weekValue2 = null
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 查询
|
|
||||||
search() {
|
|
||||||
if (!this.queryParams.timeDim) {
|
|
||||||
this.$modal.msgError('请选择时间维度')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
switch (this.queryParams.timeDim) {
|
|
||||||
case '1':
|
|
||||||
if (this.timeValue && this.timeValue.length > 0) {
|
|
||||||
this.queryParams.startTime = this.timeValue[0]
|
|
||||||
this.queryParams.endTime = this.timeValue[1] // 不用转
|
|
||||||
} else {
|
|
||||||
this.$modal.msgError('时间范围不能为空')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case '2':
|
|
||||||
if (this.dateValue && this.dateValue.length > 0) {
|
|
||||||
this.queryParams.startTime = this.dateValue[0]
|
|
||||||
this.queryParams.endTime = this.dateValue[1] + 86399000 // 转为23:59:59
|
|
||||||
} else {
|
|
||||||
this.$modal.msgError('日范围不能为空')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case '3':
|
|
||||||
if (this.weekValue1 && this.weekValue2) {
|
|
||||||
let a = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 00:00:00'
|
|
||||||
let b = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 23:59:59'
|
|
||||||
this.queryParams.startTime = new Date(a).getTime()
|
|
||||||
this.queryParams.endTime = new Date(b).getTime()
|
|
||||||
} else {
|
|
||||||
this.$modal.msgError('周范围不能为空')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case '4':// 转为本月最后一天的最后一秒
|
|
||||||
if (this.monthValue && this.monthValue.length > 0) {
|
|
||||||
this.queryParams.startTime = this.monthValue[0]
|
|
||||||
this.queryParams.endTime = this.transformTime(this.monthValue[1])
|
|
||||||
} else {
|
|
||||||
this.$modal.msgError('月范围不能为空')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
break
|
|
||||||
default://本年最后一天
|
|
||||||
if (this.yearValue1 && this.yearValue2) {
|
|
||||||
if (this.yearValue2 < this.yearValue1) {
|
|
||||||
this.$modal.msgError('结束时间不能早于开始时间')
|
|
||||||
return false
|
|
||||||
} else {
|
|
||||||
this.queryParams.startTime = this.yearValue1
|
|
||||||
this.queryParams.endTime = this.transformYear(this.yearValue2)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$modal.msgError('年范围不能为空')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.queryParams.startTime = this.queryParams.startTime + ''
|
|
||||||
this.queryParams.endTime = this.queryParams.endTime + ''
|
|
||||||
this.$emit('submit', this.queryParams)
|
|
||||||
},
|
|
||||||
transformTime(timeStamp) {// 本月最后一天
|
|
||||||
let year = moment(timeStamp).format('YYYY')
|
|
||||||
let month = moment(timeStamp).format('MM')
|
|
||||||
let newData = moment(new Date(year,month,0)).format('YYYY-MM-DD') + ' 23:59:59'
|
|
||||||
let value = new Date(newData).getTime()
|
|
||||||
return value
|
|
||||||
},
|
|
||||||
transformYear(timeStamp) {// 本年最后一天
|
|
||||||
let year = moment(timeStamp).format('YYYY')
|
|
||||||
let newData = year+'-12-31 23:59:59'
|
|
||||||
let value = new Date(newData).getTime()
|
|
||||||
return value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang='scss'>
|
|
||||||
/* 级联选择器 */
|
|
||||||
.cascaderParent .el-cascader-panel .el-scrollbar:first-child .el-radio {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
/* 时间整点 */
|
|
||||||
.noneMinute .el-time-spinner__wrapper {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.noneMinute .el-scrollbar:nth-of-type(2) {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.demo-form-inline {
|
|
||||||
.el-date-editor .el-range__icon {
|
|
||||||
font-size: 16px;
|
|
||||||
color: #0B58FF;
|
|
||||||
}
|
|
||||||
.el-input__prefix .el-icon-date {
|
|
||||||
font-size: 16px;
|
|
||||||
color: #0B58FF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.searchBarBox .foldClass {
|
|
||||||
position: absolute;
|
|
||||||
top: 14px;
|
|
||||||
right: 0;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 12px;
|
|
||||||
color:#0B58FF;
|
|
||||||
}
|
|
||||||
.searchBarBox .foldClass .iconfont {
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
.divHeight {
|
|
||||||
height: 45px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.separateStyle {
|
|
||||||
display: inline-block;
|
|
||||||
width: 1px;
|
|
||||||
height: 24px;
|
|
||||||
background: #E8E8E8;
|
|
||||||
vertical-align: middle;
|
|
||||||
margin: 0 10px;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,185 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container vocHis">
|
<div>vocDetectionHistory</div>
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<search-bar
|
|
||||||
:formConfigs="formConfig"
|
|
||||||
ref="searchBarForm"
|
|
||||||
@headBtnClick="buttonClick"
|
|
||||||
/>
|
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-props="tableProps"
|
|
||||||
:table-data="list"
|
|
||||||
:max-height="tableH"
|
|
||||||
:row-class-name="tableRowClassName"
|
|
||||||
/>
|
|
||||||
<pagination
|
|
||||||
:page.sync="queryParams.pageNo"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
:total="total"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { publicFormatter } from '@/utils/dict'
|
|
||||||
import { parseTime } from '@/utils/ruoyi'
|
|
||||||
import { environmentalCheckRecordPage, environmentalCheckRecordExport, environmentalCheckPage } from '@/api/safetyEnvironmental/environmental'
|
|
||||||
import moment from 'moment'
|
|
||||||
const tableProps = [
|
|
||||||
{
|
|
||||||
prop: 'checkName',
|
|
||||||
label: '指标名称'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'checkValue',
|
|
||||||
label: '检测数值'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'unit',
|
|
||||||
label: '单位',
|
|
||||||
filter: publicFormatter('environment_check_unit')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'checkTime',
|
|
||||||
label: '检测时间',
|
|
||||||
filter: parseTime,
|
|
||||||
minWidth: 160
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'origin',
|
|
||||||
label: '来源',
|
|
||||||
filter: (val) => ['手动', '自动'][val]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'recordPerson',
|
|
||||||
label: '录入人'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'recordTime',
|
|
||||||
label: '录入时间',
|
|
||||||
filter: parseTime,
|
|
||||||
minWidth: 160
|
|
||||||
}
|
|
||||||
]
|
|
||||||
export default {
|
export default {
|
||||||
name: 'VocDetectionHistory',
|
name: 'VocDetectionHistory'
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
formConfig: [
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '指标名称',
|
|
||||||
selectOptions: [],
|
|
||||||
param: 'checkId',
|
|
||||||
filterable: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'datePicker',
|
|
||||||
label: '时间',
|
|
||||||
dateType: 'datetimerange',
|
|
||||||
format: 'yyyy-MM-dd HH:mm:ss',
|
|
||||||
valueFormat: "timestamp",
|
|
||||||
rangeSeparator: '-',
|
|
||||||
startPlaceholder: '开始时间',
|
|
||||||
endPlaceholder: '结束时间',
|
|
||||||
param: 'timeVal',
|
|
||||||
defaultSelect: [],
|
|
||||||
width: 350
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:voc:export') ? 'separate' : '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:voc:export') ? 'button' : '',
|
|
||||||
btnName: '导出',
|
|
||||||
name: 'export',
|
|
||||||
color: 'primary',
|
|
||||||
plain: true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
checkId: null,
|
|
||||||
checkType: 3,
|
|
||||||
startTime: null,
|
|
||||||
endTime: null
|
|
||||||
},
|
|
||||||
tableProps,
|
|
||||||
list: [],
|
|
||||||
total: 0,
|
|
||||||
tableH: this.tableHeight(260)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
window.addEventListener('resize', () => {
|
|
||||||
this.tableH = this.tableHeight(260)
|
|
||||||
})
|
|
||||||
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf()
|
|
||||||
let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf()
|
|
||||||
this.formConfig[1].defaultSelect = [start, end]
|
|
||||||
this.queryParams.startTime = start
|
|
||||||
this.queryParams.endTime = end
|
|
||||||
this.getSelectList()
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
buttonClick(val) {
|
|
||||||
this.queryParams.pageNo = 1;
|
|
||||||
this.queryParams.checkId = val.checkId
|
|
||||||
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
|
|
||||||
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
|
|
||||||
if (val.btnName === 'search') {
|
|
||||||
this.getList()
|
|
||||||
} else {
|
|
||||||
this.$modal.confirm('是否确认导出').then(() => {
|
|
||||||
return environmentalCheckRecordExport({...this.queryParams});
|
|
||||||
}).then(response => {
|
|
||||||
this.$download.excel(response, '废水检测历史记录.xls');
|
|
||||||
}).catch(() => {})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getList() {
|
|
||||||
environmentalCheckRecordPage({...this.queryParams}).then(res => {
|
|
||||||
this.list = res.data.list || []
|
|
||||||
this.total = res.data.total || 0
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getSelectList() {
|
|
||||||
environmentalCheckPage({
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 100,
|
|
||||||
checkType: 3
|
|
||||||
}).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
this.formConfig[0].selectOptions = res.data.list || []
|
|
||||||
})
|
|
||||||
},
|
|
||||||
tableRowClassName({row, rowIndex}) {
|
|
||||||
console.log(row)
|
|
||||||
if (row.markRed) {
|
|
||||||
return 'warning-row'
|
|
||||||
}else {
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss'>
|
|
||||||
.vocHis {
|
|
||||||
.el-table .warning-row {
|
|
||||||
background: #fee1e1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,124 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-form ref="vocAddForm" :rules="rules" label-width="80px" :model="form">
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="指标名称" prop="name">
|
|
||||||
<el-input v-model="form.name" :disabled='isEdit'></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="指标编码" prop="code">
|
|
||||||
<el-input v-model="form.code"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="单位" prop="unit">
|
|
||||||
<el-select v-model="form.unit" placeholder="请选择" style="width: 100%;" :disabled='form.method == 2'>
|
|
||||||
<el-option
|
|
||||||
v-for="item in getDictDatas(DICT_TYPE.ENVIRONMENT_CHECK_UNIT)"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="最小值" prop="minValue">
|
|
||||||
<el-input-number v-model="form.minValue" placeholder="最小值" :max="9999999" style="width: 100%;"></el-input-number>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="最大值" prop="maxValue">
|
|
||||||
<el-input-number v-model="form.maxValue" placeholder="最大值" :max="9999999" style="width: 100%;"></el-input-number>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="form.remark"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import { environmentalCheckGet, environmentalCheckUpdate, environmentalCheckCreate, getEnvironmentalCheckCode } from '@/api/safetyEnvironmental/environmental'
|
|
||||||
export default {
|
|
||||||
name: 'VocAdd',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
form: {
|
|
||||||
id: '',
|
|
||||||
name: '',
|
|
||||||
code: '',
|
|
||||||
unit: '',
|
|
||||||
minValue: null,
|
|
||||||
maxValue: null,
|
|
||||||
remark: '',
|
|
||||||
checkType: 3
|
|
||||||
},
|
|
||||||
isEdit: false,
|
|
||||||
rules: {
|
|
||||||
name: [{ required: true, message: "指标名称不能为空", trigger: "blur" }],
|
|
||||||
code: [{ required: true, message: "指标编码不能为空", trigger: "blur" }],
|
|
||||||
// unit: [{ required: true, message: "unit不能为空", trigger: "change" }],
|
|
||||||
minValue: [{ required: true, message: "最小值不能为空", trigger: "blur" }],
|
|
||||||
maxValue: [{ required: true, message: "最大值不能为空", trigger: "blur" }]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init(id) {
|
|
||||||
if (id) {
|
|
||||||
this.isEdit = true
|
|
||||||
this.form.id = id
|
|
||||||
environmentalCheckGet({id: this.form.id}).then(res => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.form = res.data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.isEdit = false
|
|
||||||
this.form.id = ''
|
|
||||||
// 编码
|
|
||||||
getEnvironmentalCheckCode().then(res => {
|
|
||||||
this.form.code = res.data || ''
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
submitForm() {
|
|
||||||
this.$refs['vocAddForm'].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.minValue > this.form.maxValue) {
|
|
||||||
this.$modal.msgError('最小值不能大于最大值')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
console.log(this.form)
|
|
||||||
if (this.isEdit) {
|
|
||||||
//编辑
|
|
||||||
environmentalCheckUpdate({ ...this.form }).then((res) => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.$modal.msgSuccess("操作成功");
|
|
||||||
this.$emit('successSubmit')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
environmentalCheckCreate({ ...this.form }).then((res) => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.$modal.msgSuccess("操作成功");
|
|
||||||
this.$emit('successSubmit')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
formClear() {
|
|
||||||
this.$refs.vocAddForm.resetFields()
|
|
||||||
this.isEdit = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,205 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div>vocDetectionIndication</div>
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<search-bar
|
|
||||||
:formConfigs="formConfig"
|
|
||||||
ref="searchBarForm"
|
|
||||||
@headBtnClick="buttonClick"
|
|
||||||
/>
|
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-props="tableProps"
|
|
||||||
:table-data="list"
|
|
||||||
:max-height="tableH"
|
|
||||||
>
|
|
||||||
<method-btn
|
|
||||||
v-if="tableBtn.length"
|
|
||||||
slot="handleBtn"
|
|
||||||
:width="80"
|
|
||||||
label="操作"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleClick"
|
|
||||||
/>
|
|
||||||
</base-table>
|
|
||||||
<pagination
|
|
||||||
:page.sync="queryParams.pageNo"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
:total="total"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
<!-- 新增&编辑 -->
|
|
||||||
<base-dialog
|
|
||||||
:dialogTitle="addOrEditTitle"
|
|
||||||
:dialogVisible="centervisible"
|
|
||||||
@cancel="handleCancel"
|
|
||||||
@confirm="handleConfirm"
|
|
||||||
:before-close="handleCancel"
|
|
||||||
width='60%'
|
|
||||||
>
|
|
||||||
<voc-add ref="vocAdd" @successSubmit="successSubmit" />
|
|
||||||
</base-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { parseTime } from '@/utils/ruoyi'
|
|
||||||
import VocAdd from './components/vocAdd'
|
|
||||||
import { publicFormatter } from '@/utils/dict'
|
|
||||||
import { environmentalCheckPage, environmentalCheckDelete } from '@/api/safetyEnvironmental/environmental'
|
|
||||||
const tableProps = [
|
|
||||||
{
|
|
||||||
prop: 'name',
|
|
||||||
label: '指标名称',
|
|
||||||
minWidth: 120,
|
|
||||||
showOverflowtooltip: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'code',
|
|
||||||
label: '指示编码',
|
|
||||||
minWidth: 120
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'unit',
|
|
||||||
label: '单位',
|
|
||||||
filter: publicFormatter('environment_check_unit')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'minValue',
|
|
||||||
label: '最小值'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'maxValue',
|
|
||||||
label: '最大值'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'creator',
|
|
||||||
label: '创建人'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'createTime',
|
|
||||||
label: '创建时间',
|
|
||||||
filter: parseTime,
|
|
||||||
minWidth: 160
|
|
||||||
}
|
|
||||||
]
|
|
||||||
export default {
|
export default {
|
||||||
name: 'VocDetectionIndication',
|
name: 'VocDetectionIndication'
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
formConfig: [
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '指标名称',
|
|
||||||
placeholder: '指标名称',
|
|
||||||
param: 'name'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:voc:create') ? 'separate' : '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:voc:create') ? 'button' : '',
|
|
||||||
btnName: '新增',
|
|
||||||
name: 'add',
|
|
||||||
color: 'success',
|
|
||||||
plain: true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
checkType: 3,
|
|
||||||
name: null
|
|
||||||
},
|
|
||||||
total: 0,
|
|
||||||
tableProps,
|
|
||||||
list: [],
|
|
||||||
tableH: this.tableHeight(260),
|
|
||||||
tableBtn: [
|
|
||||||
this.$auth.hasPermi('base:voc:update')
|
|
||||||
? {
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '编辑'
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi('base:voc:delete')
|
|
||||||
? {
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除'
|
|
||||||
}
|
|
||||||
: undefined
|
|
||||||
].filter((v)=>v),
|
|
||||||
addOrEditTitle: '',
|
|
||||||
centervisible: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: { VocAdd },
|
|
||||||
mounted() {
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getList() {
|
|
||||||
environmentalCheckPage({...this.queryParams}).then(res => {
|
|
||||||
this.list = res.data.list || []
|
|
||||||
this.total = res.data.total || 0
|
|
||||||
})
|
|
||||||
},
|
|
||||||
buttonClick(val) {
|
|
||||||
console.log(val)
|
|
||||||
if (val.btnName === 'search') {
|
|
||||||
this.queryParams.name = val.name
|
|
||||||
this.getList()
|
|
||||||
} else {
|
|
||||||
this.addOrEditTitle = '新增'
|
|
||||||
this.centervisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.vocAdd.init()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleClick(val) {
|
|
||||||
console.log(val)
|
|
||||||
switch (val.type) {
|
|
||||||
case 'edit':
|
|
||||||
this.addOrEditTitle = '编辑'
|
|
||||||
this.centervisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.vocAdd.init(val.data.id)
|
|
||||||
})
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
this.handleDelete(val.data)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 删除
|
|
||||||
handleDelete(val) {
|
|
||||||
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
|
|
||||||
return environmentalCheckDelete({ id: val.id })
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.$modal.msgSuccess("操作成功");
|
|
||||||
}).catch(() => {});
|
|
||||||
},
|
|
||||||
// 新增
|
|
||||||
handleCancel() {
|
|
||||||
this.$refs.vocAdd.formClear()
|
|
||||||
this.centervisible = false
|
|
||||||
this.addOrEditTitle = ''
|
|
||||||
},
|
|
||||||
handleConfirm() {
|
|
||||||
this.$refs.vocAdd.submitForm()
|
|
||||||
},
|
|
||||||
successSubmit() {
|
|
||||||
this.handleCancel()
|
|
||||||
this.getList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
@ -1,152 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="voc">
|
<div>voc</div>
|
||||||
<div class="box1">
|
|
||||||
<div class="boxTitle">
|
|
||||||
<span class="blueTitle"></span>
|
|
||||||
<span>检测指标实时数据</span>
|
|
||||||
</div>
|
|
||||||
<div class="itemBox">
|
|
||||||
<div class="itemBox">
|
|
||||||
<div class="itemClass" v-for="(item, index) in realtimeList" :key='index'>
|
|
||||||
<div class="itemSub">
|
|
||||||
<p class="itemNum">{{item.checkValue}}</p>
|
|
||||||
<p class="itemDescribe">
|
|
||||||
<img src="./../../../../../assets/images/detectionData.png" alt="">
|
|
||||||
{{item.name}}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="box2">
|
|
||||||
<div class="boxTitle">
|
|
||||||
<span class="blueTitle"></span>
|
|
||||||
<span>检测指标趋势图</span>
|
|
||||||
</div>
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<search-area @submit="getTrend"/>
|
|
||||||
<line-chart :chartData="chartData" v-show='Object.keys(chartData).length !== 0' :timeDim="queryParams.timeDim"/>
|
|
||||||
<!-- 没有数据 -->
|
|
||||||
<div class="no-data-bg" v-show='Object.keys(chartData).length === 0'></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { environmentalCheckRealtime, environmentalCheckRealtimeTrend } from '@/api/safetyEnvironmental/environmental'
|
|
||||||
import LineChart from './../../components/lineChart'
|
|
||||||
import SearchArea from './../../components/searchArea'
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Voc',
|
name: 'Voc'
|
||||||
data(){
|
|
||||||
return {
|
|
||||||
realtimeList:[],
|
|
||||||
queryParams:{
|
|
||||||
checkType: 1,
|
|
||||||
timeDim: null,
|
|
||||||
timeRange: []
|
|
||||||
},
|
|
||||||
chartData: {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: { LineChart, SearchArea },
|
|
||||||
mounted() {
|
|
||||||
this.getMsg()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getMsg() {
|
|
||||||
environmentalCheckRealtime({checkType: 3}).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
this.realtimeList = res.data || []
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getTrend(params) {
|
|
||||||
console.log(params)
|
|
||||||
this.queryParams.timeDim = params.timeDim
|
|
||||||
this.queryParams.timeRange[0] = params.startTime
|
|
||||||
this.queryParams.timeRange[1] = params.endTime
|
|
||||||
environmentalCheckRealtimeTrend({...this.queryParams}).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.chartData = res.data
|
|
||||||
} else {
|
|
||||||
this.chartData = {}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss' scoped>
|
|
||||||
.voc {
|
|
||||||
background-color: #f2f4f9;
|
|
||||||
.box1 {
|
|
||||||
height: 172px;
|
|
||||||
padding: 12px 16px 0;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 9px;
|
|
||||||
.itemBox {
|
|
||||||
display: flex;
|
|
||||||
flex-flow: row nowrap;
|
|
||||||
overflow: auto;
|
|
||||||
.itemClass {
|
|
||||||
width: 198px;
|
|
||||||
height: 88px;
|
|
||||||
// border: 1px solid green;
|
|
||||||
padding: 12px 0px 12px 18px;
|
|
||||||
.itemSub {
|
|
||||||
width: 176px;
|
|
||||||
height: 65px;
|
|
||||||
padding-right: 26px;
|
|
||||||
border-right: 1px solid #E8E8E8;
|
|
||||||
P{
|
|
||||||
margin: 0;
|
|
||||||
img {
|
|
||||||
width: 24px;
|
|
||||||
height: 24px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.itemNum {
|
|
||||||
font-size: 32px;
|
|
||||||
font-weight: 600;
|
|
||||||
height: 43px;
|
|
||||||
color: #3E6AF7;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
.itemDescribe {
|
|
||||||
font-size: 16px;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.itemClass:last-child > .itemSub{
|
|
||||||
border: none !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.box2 {
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 9px;
|
|
||||||
padding: 16px;
|
|
||||||
height: calc(100vh - 308px);
|
|
||||||
}
|
|
||||||
.boxTitle {
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #000000;
|
|
||||||
margin:0 10px 20px 0;
|
|
||||||
}
|
|
||||||
.blueTitle {
|
|
||||||
content: '';
|
|
||||||
display: inline-block;
|
|
||||||
width: 4px;
|
|
||||||
height: 18px;
|
|
||||||
background-color: #0B58FF;
|
|
||||||
border-radius: 1px;
|
|
||||||
margin-right: 8px;
|
|
||||||
vertical-align: bottom;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,185 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container wasteGasHis">
|
<div>wasteGasDetectionHistory</div>
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<search-bar
|
|
||||||
:formConfigs="formConfig"
|
|
||||||
ref="searchBarForm"
|
|
||||||
@headBtnClick="buttonClick"
|
|
||||||
/>
|
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-props="tableProps"
|
|
||||||
:table-data="list"
|
|
||||||
:max-height="tableH"
|
|
||||||
:row-class-name="tableRowClassName"
|
|
||||||
/>
|
|
||||||
<pagination
|
|
||||||
:page.sync="queryParams.pageNo"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
:total="total"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { publicFormatter } from '@/utils/dict'
|
|
||||||
import { parseTime } from '@/utils/ruoyi'
|
|
||||||
import { environmentalCheckRecordPage, environmentalCheckRecordExport, environmentalCheckPage } from '@/api/safetyEnvironmental/environmental'
|
|
||||||
import moment from 'moment'
|
|
||||||
const tableProps = [
|
|
||||||
{
|
|
||||||
prop: 'checkName',
|
|
||||||
label: '指标名称'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'checkValue',
|
|
||||||
label: '检测数值'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'unit',
|
|
||||||
label: '单位',
|
|
||||||
filter: publicFormatter('environment_check_unit')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'checkTime',
|
|
||||||
label: '检测时间',
|
|
||||||
filter: parseTime,
|
|
||||||
minWidth: 160
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'origin',
|
|
||||||
label: '来源',
|
|
||||||
filter: (val) => ['手动', '自动'][val]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'recordPerson',
|
|
||||||
label: '录入人'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'recordTime',
|
|
||||||
label: '录入时间',
|
|
||||||
filter: parseTime,
|
|
||||||
minWidth: 160
|
|
||||||
}
|
|
||||||
]
|
|
||||||
export default {
|
export default {
|
||||||
name: 'WasteGasDetectionHistory',
|
name: 'WasteGasDetectionHistory'
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
formConfig: [
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '指标名称',
|
|
||||||
selectOptions: [],
|
|
||||||
param: 'checkId',
|
|
||||||
filterable: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'datePicker',
|
|
||||||
label: '时间',
|
|
||||||
dateType: 'datetimerange',
|
|
||||||
format: 'yyyy-MM-dd HH:mm:ss',
|
|
||||||
valueFormat: "timestamp",
|
|
||||||
rangeSeparator: '-',
|
|
||||||
startPlaceholder: '开始时间',
|
|
||||||
endPlaceholder: '结束时间',
|
|
||||||
param: 'timeVal',
|
|
||||||
defaultSelect: [],
|
|
||||||
width: 350
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:waste-gas:export') ? 'separate' : '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:waste-gas:export') ? 'button' : '',
|
|
||||||
btnName: '导出',
|
|
||||||
name: 'export',
|
|
||||||
color: 'primary',
|
|
||||||
plain: true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
checkId: null,
|
|
||||||
checkType: 2,
|
|
||||||
startTime: null,
|
|
||||||
endTime: null
|
|
||||||
},
|
|
||||||
tableProps,
|
|
||||||
list: [],
|
|
||||||
total: 0,
|
|
||||||
tableH: this.tableHeight(260)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
window.addEventListener('resize', () => {
|
|
||||||
this.tableH = this.tableHeight(260)
|
|
||||||
})
|
|
||||||
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf()
|
|
||||||
let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf()
|
|
||||||
this.formConfig[1].defaultSelect = [start, end]
|
|
||||||
this.queryParams.startTime = start
|
|
||||||
this.queryParams.endTime = end
|
|
||||||
this.getSelectList()
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
buttonClick(val) {
|
|
||||||
this.queryParams.pageNo = 1;
|
|
||||||
this.queryParams.checkId = val.checkId
|
|
||||||
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
|
|
||||||
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
|
|
||||||
if (val.btnName === 'search') {
|
|
||||||
this.getList()
|
|
||||||
} else {
|
|
||||||
this.$modal.confirm('是否确认导出').then(() => {
|
|
||||||
return environmentalCheckRecordExport({...this.queryParams});
|
|
||||||
}).then(response => {
|
|
||||||
this.$download.excel(response, '废气检测历史记录.xls');
|
|
||||||
}).catch(() => {})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getList() {
|
|
||||||
environmentalCheckRecordPage({...this.queryParams}).then(res => {
|
|
||||||
this.list = res.data.list || []
|
|
||||||
this.total = res.data.total || 0
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getSelectList() {
|
|
||||||
environmentalCheckPage({
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 100,
|
|
||||||
checkType: 2
|
|
||||||
}).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
this.formConfig[0].selectOptions = res.data.list || []
|
|
||||||
})
|
|
||||||
},
|
|
||||||
tableRowClassName({row, rowIndex}) {
|
|
||||||
console.log(row)
|
|
||||||
if (row.markRed) {
|
|
||||||
return 'warning-row'
|
|
||||||
}else {
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss'>
|
|
||||||
.wasteGasHis {
|
|
||||||
.el-table .warning-row {
|
|
||||||
background: #fee1e1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,124 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-form ref="wasteGasAddForm" :rules="rules" label-width="80px" :model="form">
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="指标名称" prop="name">
|
|
||||||
<el-input v-model="form.name" :disabled='isEdit'></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="指标编码" prop="code">
|
|
||||||
<el-input v-model="form.code"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="单位" prop="unit">
|
|
||||||
<el-select v-model="form.unit" placeholder="请选择" style="width: 100%;" :disabled='form.method == 2'>
|
|
||||||
<el-option
|
|
||||||
v-for="item in getDictDatas(DICT_TYPE.ENVIRONMENT_CHECK_UNIT)"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="最小值" prop="minValue">
|
|
||||||
<el-input-number v-model="form.minValue" placeholder="最小值" :max="9999999" style="width: 100%;"></el-input-number>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="最大值" prop="maxValue">
|
|
||||||
<el-input-number v-model="form.maxValue" placeholder="最大值" :max="9999999" style="width: 100%;"></el-input-number>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span='12'>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="form.remark"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import { environmentalCheckGet, environmentalCheckUpdate, environmentalCheckCreate, getEnvironmentalCheckCode } from '@/api/safetyEnvironmental/environmental'
|
|
||||||
export default {
|
|
||||||
name: 'WasteGasAdd',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
form: {
|
|
||||||
id: '',
|
|
||||||
name: '',
|
|
||||||
code: '',
|
|
||||||
unit: '',
|
|
||||||
minValue: null,
|
|
||||||
maxValue: null,
|
|
||||||
remark: '',
|
|
||||||
checkType: 2
|
|
||||||
},
|
|
||||||
isEdit: false,
|
|
||||||
rules: {
|
|
||||||
name: [{ required: true, message: "指标名称不能为空", trigger: "blur" }],
|
|
||||||
code: [{ required: true, message: "指标编码不能为空", trigger: "blur" }],
|
|
||||||
// unit: [{ required: true, message: "unit不能为空", trigger: "change" }],
|
|
||||||
minValue: [{ required: true, message: "最小值不能为空", trigger: "blur" }],
|
|
||||||
maxValue: [{ required: true, message: "最大值不能为空", trigger: "blur" }]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init(id) {
|
|
||||||
if (id) {
|
|
||||||
this.isEdit = true
|
|
||||||
this.form.id = id
|
|
||||||
environmentalCheckGet({id: this.form.id}).then(res => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.form = res.data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.isEdit = false
|
|
||||||
this.form.id = ''
|
|
||||||
// 编码
|
|
||||||
getEnvironmentalCheckCode().then(res => {
|
|
||||||
this.form.code = res.data || ''
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
submitForm() {
|
|
||||||
this.$refs['wasteGasAddForm'].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.minValue > this.form.maxValue) {
|
|
||||||
this.$modal.msgError('最小值不能大于最大值')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
console.log(this.form)
|
|
||||||
if (this.isEdit) {
|
|
||||||
//编辑
|
|
||||||
environmentalCheckUpdate({ ...this.form }).then((res) => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.$modal.msgSuccess("操作成功");
|
|
||||||
this.$emit('successSubmit')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
environmentalCheckCreate({ ...this.form }).then((res) => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.$modal.msgSuccess("操作成功");
|
|
||||||
this.$emit('successSubmit')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
formClear() {
|
|
||||||
this.$refs.wasteGasAddForm.resetFields()
|
|
||||||
this.isEdit = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,205 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div>wasteGasDetectionIndication</div>
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<search-bar
|
|
||||||
:formConfigs="formConfig"
|
|
||||||
ref="searchBarForm"
|
|
||||||
@headBtnClick="buttonClick"
|
|
||||||
/>
|
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-props="tableProps"
|
|
||||||
:table-data="list"
|
|
||||||
:max-height="tableH"
|
|
||||||
>
|
|
||||||
<method-btn
|
|
||||||
v-if="tableBtn.length"
|
|
||||||
slot="handleBtn"
|
|
||||||
:width="80"
|
|
||||||
label="操作"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleClick"
|
|
||||||
/>
|
|
||||||
</base-table>
|
|
||||||
<pagination
|
|
||||||
:page.sync="queryParams.pageNo"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
:total="total"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
<!-- 新增&编辑 -->
|
|
||||||
<base-dialog
|
|
||||||
:dialogTitle="addOrEditTitle"
|
|
||||||
:dialogVisible="centervisible"
|
|
||||||
@cancel="handleCancel"
|
|
||||||
@confirm="handleConfirm"
|
|
||||||
:before-close="handleCancel"
|
|
||||||
width='60%'
|
|
||||||
>
|
|
||||||
<waste-gas-add ref="wasteGasAdd" @successSubmit="successSubmit" />
|
|
||||||
</base-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { parseTime } from '@/utils/ruoyi'
|
|
||||||
import WasteGasAdd from './components/wasteGasAdd'
|
|
||||||
import { publicFormatter } from '@/utils/dict'
|
|
||||||
import { environmentalCheckPage, environmentalCheckDelete } from '@/api/safetyEnvironmental/environmental'
|
|
||||||
const tableProps = [
|
|
||||||
{
|
|
||||||
prop: 'name',
|
|
||||||
label: '指标名称',
|
|
||||||
minWidth: 120,
|
|
||||||
showOverflowtooltip: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'code',
|
|
||||||
label: '指示编码',
|
|
||||||
minWidth: 120
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'unit',
|
|
||||||
label: '单位',
|
|
||||||
filter: publicFormatter('environment_check_unit')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'minValue',
|
|
||||||
label: '最小值'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'maxValue',
|
|
||||||
label: '最大值'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'creator',
|
|
||||||
label: '创建人'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'createTime',
|
|
||||||
label: '创建时间',
|
|
||||||
filter: parseTime,
|
|
||||||
minWidth: 160
|
|
||||||
}
|
|
||||||
]
|
|
||||||
export default {
|
export default {
|
||||||
name: 'WasteGasDetectionIndication',
|
name: 'WasteGasDetectionIndication'
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
formConfig: [
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '指标名称',
|
|
||||||
placeholder: '指标名称',
|
|
||||||
param: 'name'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:waste-gas:create') ? 'separate' : '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:waste-gas:create') ? 'button' : '',
|
|
||||||
btnName: '新增',
|
|
||||||
name: 'add',
|
|
||||||
color: 'success',
|
|
||||||
plain: true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
checkType: 2,
|
|
||||||
name: null
|
|
||||||
},
|
|
||||||
total: 0,
|
|
||||||
tableProps,
|
|
||||||
list: [],
|
|
||||||
tableH: this.tableHeight(260),
|
|
||||||
tableBtn: [
|
|
||||||
this.$auth.hasPermi('base:waste-gas:update')
|
|
||||||
? {
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '编辑'
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi('base:waste-gas:delete')
|
|
||||||
? {
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除'
|
|
||||||
}
|
|
||||||
: undefined
|
|
||||||
].filter((v)=>v),
|
|
||||||
addOrEditTitle: '',
|
|
||||||
centervisible: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: { WasteGasAdd },
|
|
||||||
mounted() {
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getList() {
|
|
||||||
environmentalCheckPage({...this.queryParams}).then(res => {
|
|
||||||
this.list = res.data.list || []
|
|
||||||
this.total = res.data.total || 0
|
|
||||||
})
|
|
||||||
},
|
|
||||||
buttonClick(val) {
|
|
||||||
console.log(val)
|
|
||||||
if (val.btnName === 'search') {
|
|
||||||
this.queryParams.name = val.name
|
|
||||||
this.getList()
|
|
||||||
} else {
|
|
||||||
this.addOrEditTitle = '新增'
|
|
||||||
this.centervisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.wasteGasAdd.init()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleClick(val) {
|
|
||||||
console.log(val)
|
|
||||||
switch (val.type) {
|
|
||||||
case 'edit':
|
|
||||||
this.addOrEditTitle = '编辑'
|
|
||||||
this.centervisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.wasteGasAdd.init(val.data.id)
|
|
||||||
})
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
this.handleDelete(val.data)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 删除
|
|
||||||
handleDelete(val) {
|
|
||||||
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
|
|
||||||
return environmentalCheckDelete({ id: val.id })
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.$modal.msgSuccess("操作成功");
|
|
||||||
}).catch(() => {});
|
|
||||||
},
|
|
||||||
// 新增
|
|
||||||
handleCancel() {
|
|
||||||
this.$refs.wasteGasAdd.formClear()
|
|
||||||
this.centervisible = false
|
|
||||||
this.addOrEditTitle = ''
|
|
||||||
},
|
|
||||||
handleConfirm() {
|
|
||||||
this.$refs.wasteGasAdd.submitForm()
|
|
||||||
},
|
|
||||||
successSubmit() {
|
|
||||||
this.handleCancel()
|
|
||||||
this.getList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
@ -1,152 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="wasteGasManagement">
|
<div>wasteGas</div>
|
||||||
<div class="box1">
|
|
||||||
<div class="boxTitle">
|
|
||||||
<span class="blueTitle"></span>
|
|
||||||
<span>检测指标实时数据</span>
|
|
||||||
</div>
|
|
||||||
<div class="itemBox">
|
|
||||||
<div class="itemBox">
|
|
||||||
<div class="itemClass" v-for="(item, index) in realtimeList" :key='index'>
|
|
||||||
<div class="itemSub">
|
|
||||||
<p class="itemNum">{{item.checkValue}}</p>
|
|
||||||
<p class="itemDescribe">
|
|
||||||
<img src="./../../../../../assets/images/detectionData.png" alt="">
|
|
||||||
{{item.name}}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="box2">
|
|
||||||
<div class="boxTitle">
|
|
||||||
<span class="blueTitle"></span>
|
|
||||||
<span>检测指标趋势图</span>
|
|
||||||
</div>
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<search-area @submit="getTrend"/>
|
|
||||||
<line-chart :chartData="chartData" v-show='Object.keys(chartData).length !== 0' :timeDim="queryParams.timeDim"/>
|
|
||||||
<!-- 没有数据 -->
|
|
||||||
<div class="no-data-bg" v-show='Object.keys(chartData).length === 0'></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { environmentalCheckRealtime, environmentalCheckRealtimeTrend } from '@/api/safetyEnvironmental/environmental'
|
|
||||||
import LineChart from './../../components/lineChart'
|
|
||||||
import SearchArea from './../../components/searchArea'
|
|
||||||
export default {
|
export default {
|
||||||
name: 'WasteGasManagement',
|
name: 'WasteGas'
|
||||||
data(){
|
|
||||||
return {
|
|
||||||
realtimeList:[],
|
|
||||||
queryParams:{
|
|
||||||
checkType: 2,
|
|
||||||
timeDim: null,
|
|
||||||
timeRange: []
|
|
||||||
},
|
|
||||||
chartData: {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: { LineChart, SearchArea },
|
|
||||||
mounted() {
|
|
||||||
this.getMsg()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getMsg() {
|
|
||||||
environmentalCheckRealtime({checkType: 2}).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
this.realtimeList = res.data || []
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getTrend(params) {
|
|
||||||
console.log(params)
|
|
||||||
this.queryParams.timeDim = params.timeDim
|
|
||||||
this.queryParams.timeRange[0] = params.startTime
|
|
||||||
this.queryParams.timeRange[1] = params.endTime
|
|
||||||
environmentalCheckRealtimeTrend({...this.queryParams}).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.chartData = res.data
|
|
||||||
} else {
|
|
||||||
this.chartData = {}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss' scoped>
|
|
||||||
.wasteGasManagement {
|
|
||||||
background-color: #f2f4f9;
|
|
||||||
.box1 {
|
|
||||||
height: 172px;
|
|
||||||
padding: 12px 16px 0;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 9px;
|
|
||||||
.itemBox {
|
|
||||||
display: flex;
|
|
||||||
flex-flow: row nowrap;
|
|
||||||
overflow: auto;
|
|
||||||
.itemClass {
|
|
||||||
width: 198px;
|
|
||||||
height: 88px;
|
|
||||||
// border: 1px solid green;
|
|
||||||
padding: 12px 0px 12px 18px;
|
|
||||||
.itemSub {
|
|
||||||
width: 176px;
|
|
||||||
height: 65px;
|
|
||||||
padding-right: 26px;
|
|
||||||
border-right: 1px solid #E8E8E8;
|
|
||||||
P{
|
|
||||||
margin: 0;
|
|
||||||
img {
|
|
||||||
width: 24px;
|
|
||||||
height: 24px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.itemNum {
|
|
||||||
font-size: 32px;
|
|
||||||
font-weight: 600;
|
|
||||||
height: 43px;
|
|
||||||
color: #3E6AF7;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
.itemDescribe {
|
|
||||||
font-size: 16px;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.itemClass:last-child > .itemSub{
|
|
||||||
border: none !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.box2 {
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 9px;
|
|
||||||
padding: 16px;
|
|
||||||
height: calc(100vh - 308px);
|
|
||||||
}
|
|
||||||
.boxTitle {
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #000000;
|
|
||||||
margin:0 10px 20px 0;
|
|
||||||
}
|
|
||||||
.blueTitle {
|
|
||||||
content: '';
|
|
||||||
display: inline-block;
|
|
||||||
width: 4px;
|
|
||||||
height: 18px;
|
|
||||||
background-color: #0B58FF;
|
|
||||||
border-radius: 1px;
|
|
||||||
margin-right: 8px;
|
|
||||||
vertical-align: bottom;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,185 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container wasteWaterHis">
|
<div>wasteWaterDetectionHistory</div>
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<search-bar
|
|
||||||
:formConfigs="formConfig"
|
|
||||||
ref="searchBarForm"
|
|
||||||
@headBtnClick="buttonClick"
|
|
||||||
/>
|
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-props="tableProps"
|
|
||||||
:table-data="list"
|
|
||||||
:max-height="tableH"
|
|
||||||
:row-class-name="tableRowClassName"
|
|
||||||
/>
|
|
||||||
<pagination
|
|
||||||
:page.sync="queryParams.pageNo"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
:total="total"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { publicFormatter } from '@/utils/dict'
|
|
||||||
import { parseTime } from '@/utils/ruoyi'
|
|
||||||
import { environmentalCheckRecordPage, environmentalCheckRecordExport, environmentalCheckPage } from '@/api/safetyEnvironmental/environmental'
|
|
||||||
import moment from 'moment'
|
|
||||||
const tableProps = [
|
|
||||||
{
|
|
||||||
prop: 'checkName',
|
|
||||||
label: '指标名称'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'checkValue',
|
|
||||||
label: '检测数值'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'unit',
|
|
||||||
label: '单位',
|
|
||||||
filter: publicFormatter('environment_check_unit')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'checkTime',
|
|
||||||
label: '检测时间',
|
|
||||||
filter: parseTime,
|
|
||||||
minWidth: 160
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'origin',
|
|
||||||
label: '来源',
|
|
||||||
filter: (val) => ['手动', '自动'][val]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'recordPerson',
|
|
||||||
label: '录入人'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'recordTime',
|
|
||||||
label: '录入时间',
|
|
||||||
filter: parseTime,
|
|
||||||
minWidth: 160
|
|
||||||
}
|
|
||||||
]
|
|
||||||
export default {
|
export default {
|
||||||
name: 'WasteWaterDetectionHistory',
|
name: 'WasteWaterDetectionHistory'
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
formConfig: [
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '指标名称',
|
|
||||||
selectOptions: [],
|
|
||||||
param: 'checkId',
|
|
||||||
filterable: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'datePicker',
|
|
||||||
label: '检测时间',
|
|
||||||
dateType: 'datetimerange',
|
|
||||||
format: 'yyyy-MM-dd HH:mm:ss',
|
|
||||||
valueFormat: "timestamp",
|
|
||||||
rangeSeparator: '-',
|
|
||||||
startPlaceholder: '开始时间',
|
|
||||||
endPlaceholder: '结束时间',
|
|
||||||
param: 'timeVal',
|
|
||||||
defaultSelect: [],
|
|
||||||
width: 350
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:waste-water:export') ? 'separate' : '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:waste-water:export') ? 'button' : '',
|
|
||||||
btnName: '导出',
|
|
||||||
name: 'export',
|
|
||||||
color: 'primary',
|
|
||||||
plain: true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
checkId: null,
|
|
||||||
checkType: 1,
|
|
||||||
startTime: null,
|
|
||||||
endTime: null
|
|
||||||
},
|
|
||||||
tableProps,
|
|
||||||
list: [],
|
|
||||||
total: 0,
|
|
||||||
tableH: this.tableHeight(260)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
window.addEventListener('resize', () => {
|
|
||||||
this.tableH = this.tableHeight(260)
|
|
||||||
})
|
|
||||||
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf()
|
|
||||||
let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf()
|
|
||||||
this.formConfig[1].defaultSelect = [start, end]
|
|
||||||
this.queryParams.startTime = start
|
|
||||||
this.queryParams.endTime = end
|
|
||||||
this.getSelectList()
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
buttonClick(val) {
|
|
||||||
this.queryParams.pageNo = 1;
|
|
||||||
this.queryParams.checkId = val.checkId
|
|
||||||
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
|
|
||||||
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
|
|
||||||
if (val.btnName === 'search') {
|
|
||||||
this.getList()
|
|
||||||
} else {
|
|
||||||
this.$modal.confirm('是否确认导出').then(() => {
|
|
||||||
return environmentalCheckRecordExport({...this.queryParams});
|
|
||||||
}).then(response => {
|
|
||||||
this.$download.excel(response, '废水检测历史记录.xls');
|
|
||||||
}).catch(() => {})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getList() {
|
|
||||||
environmentalCheckRecordPage({...this.queryParams}).then(res => {
|
|
||||||
this.list = res.data.list || []
|
|
||||||
this.total = res.data.total || 0
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getSelectList() {
|
|
||||||
environmentalCheckPage({
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 100,
|
|
||||||
checkType: 1
|
|
||||||
}).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
this.formConfig[0].selectOptions = res.data.list || []
|
|
||||||
})
|
|
||||||
},
|
|
||||||
tableRowClassName({row, rowIndex}) {
|
|
||||||
console.log(row)
|
|
||||||
if (row.markRed) {
|
|
||||||
return 'warning-row'
|
|
||||||
}else {
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss'>
|
|
||||||
.wasteWaterHis {
|
|
||||||
.el-table .warning-row {
|
|
||||||
background: #fee1e1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form ref="wasteWaterAddForm" :rules="rules" label-width="80px" :model="form">
|
<el-form ref="wasteWaterAddForm" :rules="rules" label-width="130px" :model="form">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span='12'>
|
<el-col :span='12'>
|
||||||
<el-form-item label="指标名称" prop="name">
|
<el-form-item label="指标名称" prop="name">
|
||||||
<el-input v-model="form.name" :disabled='isEdit'></el-input>
|
<el-input v-model="form.name"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span='12'>
|
<el-col :span='12'>
|
||||||
@ -12,113 +12,150 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span='12'>
|
<el-col :span='12'>
|
||||||
<el-form-item label="单位" prop="unit">
|
<el-form-item label="指标名称" prop="name1">
|
||||||
<el-select v-model="form.unit" placeholder="请选择" style="width: 100%;" :disabled='form.method == 2'>
|
<el-input v-model="form.name"></el-input>
|
||||||
<el-option
|
|
||||||
v-for="item in getDictDatas(DICT_TYPE.ENVIRONMENT_CHECK_UNIT)"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span='12'>
|
<el-col :span='12'>
|
||||||
<el-form-item label="最小值" prop="minValue">
|
<el-form-item label="最小值" prop="code11">
|
||||||
<el-input-number v-model="form.minValue" placeholder="最小值" :max="9999999" style="width: 100%;"></el-input-number>
|
<el-input v-model="form.code"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span='12'>
|
<el-col :span='12'>
|
||||||
<el-form-item label="最大值" prop="maxValue">
|
<el-form-item label="最大值" prop="name12">
|
||||||
<el-input-number v-model="form.maxValue" placeholder="最大值" :max="9999999" style="width: 100%;"></el-input-number>
|
<el-input v-model="form.name"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span='12'>
|
<el-col :span='12'>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="code1122">
|
||||||
<el-input v-model="form.remark"></el-input>
|
<el-input v-model="form.code"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { environmentalCheckGet, environmentalCheckUpdate, environmentalCheckCreate, getEnvironmentalCheckCode } from '@/api/safetyEnvironmental/environmental'
|
|
||||||
export default {
|
export default {
|
||||||
name: 'WasteWaterAdd',
|
name: 'WasteWaterAdd',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {
|
// rules: {
|
||||||
id: '',
|
// name: [{ required: true, message: "订单名称不能为空", trigger: "blur" }],
|
||||||
name: '',
|
// code: [{ required: true, message: "订单号不能为空", trigger: "blur" }],
|
||||||
code: '',
|
// planQuantity: [{ required: true, message: "计划加工数量不能为空", trigger: "blur" }],
|
||||||
unit: '',
|
// planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }]
|
||||||
minValue: null,
|
// }
|
||||||
maxValue: null,
|
|
||||||
remark: '',
|
|
||||||
checkType: 1
|
|
||||||
},
|
|
||||||
isEdit: false,
|
|
||||||
rules: {
|
|
||||||
name: [{ required: true, message: "指标名称不能为空", trigger: "blur" }],
|
|
||||||
code: [{ required: true, message: "指标编码不能为空", trigger: "blur" }],
|
|
||||||
// unit: [{ required: true, message: "unit不能为空", trigger: "change" }],
|
|
||||||
minValue: [{ required: true, message: "最小值不能为空", trigger: "blur" }],
|
|
||||||
maxValue: [{ required: true, message: "最大值不能为空", trigger: "blur" }]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(id) {
|
// init(id) {
|
||||||
if (id) {
|
// this.getList()
|
||||||
this.isEdit = true
|
// if (id) {
|
||||||
this.form.id = id
|
// this.isEdit = true
|
||||||
environmentalCheckGet({id: this.form.id}).then(res => {
|
// this.form.id = id
|
||||||
if (res.code === 0) {
|
// getOrderById({id: this.form.id}).then(res => {
|
||||||
this.form = res.data
|
// if (res.code === 0) {
|
||||||
}
|
// this.form.name = res.data.name
|
||||||
})
|
// this.form.code = res.data.code
|
||||||
} else {
|
// this.form.planQuantity = res.data.planQuantity
|
||||||
this.isEdit = false
|
// this.form.planProductId = res.data.planProductId
|
||||||
this.form.id = ''
|
// this.form.price = res.data.price
|
||||||
// 编码
|
// this.form.customerId = res.data.customerId
|
||||||
getEnvironmentalCheckCode().then(res => {
|
// this.form.priority = res.data.priority ? res.data.priority + '' : ''
|
||||||
this.form.code = res.data || ''
|
// this.form.planStartTime = res.data.planStartTime ? res.data.planStartTime : null
|
||||||
})
|
// this.form.packSpec = res.data.packSpec ? res.data.packSpec+'' : ''
|
||||||
}
|
// this.form.workers = res.data.workers
|
||||||
},
|
// this.form.processFlowId = res.data.processFlowId
|
||||||
submitForm() {
|
// this.form.materialMethod = res.data.materialMethod
|
||||||
this.$refs['wasteWaterAddForm'].validate((valid) => {
|
// this.form.planFinishTime = res.data.planFinishTime ? res.data.planFinishTime : null
|
||||||
if (valid) {
|
// this.form.remark = res.data.remark
|
||||||
if (this.form.minValue > this.form.maxValue) {
|
// // this.form.description = res.data.description
|
||||||
this.$modal.msgError('最小值不能大于最大值')
|
// }
|
||||||
return false
|
// })
|
||||||
}
|
// } else {
|
||||||
console.log(this.form)
|
// this.isEdit = false
|
||||||
if (this.isEdit) {
|
// this.form.id = ''
|
||||||
//编辑
|
// // 订单号
|
||||||
environmentalCheckUpdate({ ...this.form }).then((res) => {
|
// getOrderCode().then(res => {
|
||||||
if (res.code === 0) {
|
// this.form.code = res.data || ''
|
||||||
this.$modal.msgSuccess("操作成功");
|
// })
|
||||||
this.$emit('successSubmit')
|
// }
|
||||||
}
|
// },
|
||||||
})
|
// getList() {
|
||||||
} else {
|
// // 产品
|
||||||
environmentalCheckCreate({ ...this.form }).then((res) => {
|
// getProductAll().then(res => {
|
||||||
if (res.code === 0) {
|
// this.productList = res.data || []
|
||||||
this.$modal.msgSuccess("操作成功");
|
// })
|
||||||
this.$emit('successSubmit')
|
// // 客户
|
||||||
}
|
// getCustomerList().then(res => {
|
||||||
})
|
// this.customerList = res.data || []
|
||||||
}
|
// })
|
||||||
} else {
|
// // 工艺
|
||||||
return false
|
// getProcessFlowList().then(res => {
|
||||||
}
|
// this.processFlowList = res.data || []
|
||||||
})
|
// })
|
||||||
},
|
// },
|
||||||
formClear() {
|
// timeChange() {
|
||||||
this.$refs.wasteWaterAddForm.resetFields()
|
// if (this.form.planStartTime && this.form.planFinishTime) {
|
||||||
this.isEdit = false
|
// if (this.form.planStartTime > this.form.planFinishTime) {
|
||||||
}
|
// this.$modal.msgError('计划开始时间不能大于结束时间')
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// // 工艺变更
|
||||||
|
// materialMethodChange(val) {
|
||||||
|
// if (val === 2 && !this.form.processFlowId) {
|
||||||
|
// this.form.materialMethod = 1
|
||||||
|
// this.$modal.msgError("请先选择关联工艺");
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// // 工艺变更
|
||||||
|
// processFlowIdChange(val) {
|
||||||
|
// console.log(val)
|
||||||
|
// if (!val) {
|
||||||
|
// this.form.materialMethod = 1
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// submitForm() {
|
||||||
|
// this.$refs['orderAddForm'].validate((valid) => {
|
||||||
|
// if (valid) {
|
||||||
|
// if (this.form.planStartTime && this.form.planFinishTime) {
|
||||||
|
// if (this.form.planStartTime > this.form.planFinishTime) {
|
||||||
|
// this.$modal.msgError('计划开始时间不能大于结束时间')
|
||||||
|
// return false
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// // console.log(this.form)
|
||||||
|
// if (this.isEdit) {
|
||||||
|
// //编辑
|
||||||
|
// orderUpdate({ ...this.form }).then((res) => {
|
||||||
|
// if (res.code === 0) {
|
||||||
|
// this.$modal.msgSuccess("操作成功");
|
||||||
|
// this.$emit('successSubmit')
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// } else {
|
||||||
|
// this.form.status = 1
|
||||||
|
// this.form.triggerOrigin = 1
|
||||||
|
// orderCreate({ ...this.form }).then((res) => {
|
||||||
|
// if (res.code === 0) {
|
||||||
|
// this.$modal.msgSuccess("操作成功");
|
||||||
|
// this.$emit('successSubmit')
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// return false
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// },
|
||||||
|
// formClear() {
|
||||||
|
// this.$refs.orderAddForm.resetFields()
|
||||||
|
// this.form.materialMethod = 1
|
||||||
|
// this.form.price = 0.00
|
||||||
|
// this.form.planQuantity = 0
|
||||||
|
// this.isEdit = false
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
@ -17,7 +17,7 @@
|
|||||||
<method-btn
|
<method-btn
|
||||||
v-if="tableBtn.length"
|
v-if="tableBtn.length"
|
||||||
slot="handleBtn"
|
slot="handleBtn"
|
||||||
:width="80"
|
:width="120"
|
||||||
label="操作"
|
label="操作"
|
||||||
:method-list="tableBtn"
|
:method-list="tableBtn"
|
||||||
@clickBtn="handleClick"
|
@clickBtn="handleClick"
|
||||||
@ -44,13 +44,11 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { parseTime } from '@/utils/ruoyi'
|
import { parseTime } from '@/utils/ruoyi'
|
||||||
import WasteWaterAdd from './components/wasteWaterAdd'
|
// import { publicFormatter } from '@/utils/dict'
|
||||||
import { publicFormatter } from '@/utils/dict'
|
|
||||||
import { environmentalCheckPage, environmentalCheckDelete } from '@/api/safetyEnvironmental/environmental'
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
label: '指标名称',
|
label: '指示名称',
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
showOverflowtooltip: true
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
@ -60,22 +58,26 @@ const tableProps = [
|
|||||||
minWidth: 120
|
minWidth: 120
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'unit',
|
prop: 'customerId',
|
||||||
label: '单位',
|
label: '单位'
|
||||||
filter: publicFormatter('environment_check_unit')
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'minValue',
|
prop: 'customerId1',
|
||||||
label: '最小值'
|
label: '最小值'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'maxValue',
|
prop: 'customerId2',
|
||||||
label: '最大值'
|
label: '最大值'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'creator',
|
prop: 'customerId3',
|
||||||
label: '创建人'
|
label: '创建人'
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// prop: 'triggerOrigin',
|
||||||
|
// label: '来源',
|
||||||
|
// filter: publicFormatter('order_Origin')
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
prop: 'createTime',
|
prop: 'createTime',
|
||||||
label: '创建时间',
|
label: '创建时间',
|
||||||
@ -89,9 +91,11 @@ export default {
|
|||||||
return {
|
return {
|
||||||
formConfig: [
|
formConfig: [
|
||||||
{
|
{
|
||||||
type: 'input',
|
type: 'select',
|
||||||
label: '指标名称',
|
label: '指标名称',
|
||||||
placeholder: '指标名称',
|
selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
|
||||||
|
labelField: 'label',
|
||||||
|
valueField: 'value',
|
||||||
param: 'name'
|
param: 'name'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -101,10 +105,10 @@ export default {
|
|||||||
color: 'primary'
|
color: 'primary'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: this.$auth.hasPermi('base:waste-water:create') ? 'separate' : '',
|
type: this.$auth.hasPermi('base:order-manage:create') ? 'separate' : '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: this.$auth.hasPermi('base:waste-water:create') ? 'button' : '',
|
type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '',
|
||||||
btnName: '新增',
|
btnName: '新增',
|
||||||
name: 'add',
|
name: 'add',
|
||||||
color: 'success',
|
color: 'success',
|
||||||
@ -115,42 +119,35 @@ export default {
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
checkType: 1,
|
name: null,
|
||||||
name: null
|
status: null
|
||||||
},
|
},
|
||||||
total: 0,
|
total: 0,
|
||||||
tableProps,
|
tableProps,
|
||||||
list: [],
|
list: [
|
||||||
|
{name:'1111'}
|
||||||
|
],
|
||||||
tableH: this.tableHeight(260),
|
tableH: this.tableHeight(260),
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi('base:waste-water:update')
|
this.$auth.hasPermi('base:order-manage:edit')
|
||||||
? {
|
? {
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
btnName: '编辑'
|
btnName: '编辑'
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
this.$auth.hasPermi('base:waste-water:delete')
|
this.$auth.hasPermi('base:order-manage:delete')
|
||||||
? {
|
? {
|
||||||
type: 'delete',
|
type: 'delete',
|
||||||
btnName: '删除'
|
btnName: '删除'
|
||||||
}
|
}
|
||||||
: undefined
|
: undefined
|
||||||
].filter((v)=>v),
|
],
|
||||||
addOrEditTitle: '',
|
addOrEditTitle: '',
|
||||||
centervisible: false
|
centervisible: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: { WasteWaterAdd },
|
|
||||||
mounted() {
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
getList() {
|
getList() {},
|
||||||
environmentalCheckPage({...this.queryParams}).then(res => {
|
|
||||||
this.list = res.data.list || []
|
|
||||||
this.total = res.data.total || 0
|
|
||||||
})
|
|
||||||
},
|
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
console.log(val)
|
console.log(val)
|
||||||
if (val.btnName === 'search') {
|
if (val.btnName === 'search') {
|
||||||
@ -181,7 +178,7 @@ export default {
|
|||||||
// 删除
|
// 删除
|
||||||
handleDelete(val) {
|
handleDelete(val) {
|
||||||
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
|
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
|
||||||
return environmentalCheckDelete({ id: val.id })
|
// return wasteWaterDelete({ id: val.id })
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("操作成功");
|
this.$modal.msgSuccess("操作成功");
|
||||||
|
@ -1,150 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="wasteWaterManagement">
|
<div>wasteWater</div>
|
||||||
<div class="box1">
|
|
||||||
<div class="boxTitle">
|
|
||||||
<span class="blueTitle"></span>
|
|
||||||
<span>检测指标实时数据</span>
|
|
||||||
</div>
|
|
||||||
<div class="itemBox">
|
|
||||||
<div class="itemClass" v-for="(item, index) in realtimeList" :key='index'>
|
|
||||||
<div class="itemSub">
|
|
||||||
<p class="itemNum">{{item.checkValue}}</p>
|
|
||||||
<p class="itemDescribe">
|
|
||||||
<img src="./../../../../../assets/images/detectionData.png" alt="">
|
|
||||||
{{item.name}}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="box2">
|
|
||||||
<div class="boxTitle">
|
|
||||||
<span class="blueTitle"></span>
|
|
||||||
<span>检测指标趋势图</span>
|
|
||||||
</div>
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<search-area @submit="getTrend"/>
|
|
||||||
<line-chart :chartData="chartData" v-show='Object.keys(chartData).length !== 0' :timeDim="queryParams.timeDim"/>
|
|
||||||
<!-- 没有数据 -->
|
|
||||||
<div class="no-data-bg" v-show='Object.keys(chartData).length === 0'></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { environmentalCheckRealtime, environmentalCheckRealtimeTrend } from '@/api/safetyEnvironmental/environmental'
|
|
||||||
import LineChart from './../../components/lineChart'
|
|
||||||
import SearchArea from './../../components/searchArea'
|
|
||||||
export default {
|
export default {
|
||||||
name: 'WasteWaterManagement',
|
name: 'WasteWater'
|
||||||
data(){
|
|
||||||
return {
|
|
||||||
realtimeList:[],
|
|
||||||
queryParams:{
|
|
||||||
checkType: 1,
|
|
||||||
timeDim: null,
|
|
||||||
timeRange: []
|
|
||||||
},
|
|
||||||
chartData: {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: { LineChart, SearchArea },
|
|
||||||
mounted() {
|
|
||||||
this.getMsg()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getMsg() {
|
|
||||||
environmentalCheckRealtime({checkType: 1}).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
this.realtimeList = res.data || []
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getTrend(params) {
|
|
||||||
console.log(params)
|
|
||||||
this.queryParams.timeDim = params.timeDim
|
|
||||||
this.queryParams.timeRange[0] = params.startTime
|
|
||||||
this.queryParams.timeRange[1] = params.endTime
|
|
||||||
environmentalCheckRealtimeTrend({...this.queryParams}).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.chartData = res.data
|
|
||||||
} else {
|
|
||||||
this.chartData = {}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss' scoped>
|
|
||||||
.wasteWaterManagement {
|
|
||||||
background-color: #f2f4f9;
|
|
||||||
.box1 {
|
|
||||||
height: 172px;
|
|
||||||
padding: 12px 16px 0;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 9px;
|
|
||||||
.itemBox {
|
|
||||||
display: flex;
|
|
||||||
flex-flow: row nowrap;
|
|
||||||
overflow: auto;
|
|
||||||
.itemClass {
|
|
||||||
width: 198px;
|
|
||||||
height: 88px;
|
|
||||||
// border: 1px solid green;
|
|
||||||
padding: 12px 0px 12px 18px;
|
|
||||||
.itemSub {
|
|
||||||
width: 176px;
|
|
||||||
height: 65px;
|
|
||||||
padding-right: 26px;
|
|
||||||
border-right: 1px solid #E8E8E8;
|
|
||||||
P{
|
|
||||||
margin: 0;
|
|
||||||
img {
|
|
||||||
width: 24px;
|
|
||||||
height: 24px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.itemNum {
|
|
||||||
font-size: 32px;
|
|
||||||
font-weight: 600;
|
|
||||||
height: 43px;
|
|
||||||
color: #3E6AF7;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
.itemDescribe {
|
|
||||||
font-size: 16px;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.itemClass:last-child > .itemSub{
|
|
||||||
border: none !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.box2 {
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 9px;
|
|
||||||
padding: 16px;
|
|
||||||
height: calc(100vh - 308px);
|
|
||||||
}
|
|
||||||
.boxTitle {
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #000000;
|
|
||||||
margin:0 10px 20px 0;
|
|
||||||
}
|
|
||||||
.blueTitle {
|
|
||||||
content: '';
|
|
||||||
display: inline-block;
|
|
||||||
width: 4px;
|
|
||||||
height: 18px;
|
|
||||||
background-color: #0B58FF;
|
|
||||||
border-radius: 1px;
|
|
||||||
margin-right: 8px;
|
|
||||||
vertical-align: bottom;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
Loading…
Reference in New Issue
Block a user