Commit 25557f84 authored by xinzhedeai's avatar xinzhedeai

含水监测

parent 461278fc
...@@ -880,6 +880,128 @@ var reqApis = function () { ...@@ -880,6 +880,128 @@ var reqApis = function () {
}, },
}, },
}, },
/*******2024年8月28日10:03:08 新增页面-含水监测 by zjunbao***** */
hsjc: { // 含水监测
history: {
name: '含水监测',
Dict: {
baseInfo: {
"sensorname": { name: "设备名称" },
"sensorid": { name: "设备ID" },
//"stage": { name: "水位(m)" },
"depth": { name: "埋深(m)" },
"state": { name: "是否报警", type: 'select', },
"stage": { name: "水位"},
"waterpressure": { name: "水压"},
"watervolume": { name: "水量"},
"time": {
name: "监测时间", form: 0, type: "tableFormat", tableFormat: function (val) {
return Tools.Dates.format.call(new Date(val), 'yyyy-MM-dd HH:mm:ss')
}
},
"jcvalue": { name: "人工监测值", table: 0, form: 0, },
"jctime": { name: "人工监测时间", table: 0, form: 0, },
"difference": { name: "人工监测差异", table: 0, form: 0, },
},
selectList: {
sensorid: function () {
return reqApi.sensorListByCode({ code: 5 }).then(function (res) {
return res.body || []
});
},
monitorType: function () {
return reqPublic('/dic/artificial/jczxList', 'get', { code: 5 }).then(function (res) {
return res.body || [];
});
},
state: function () {
return reqApi.getDictDeviceStatus({}).then(function (res) {
return res.body || []
});
},
},
},
config: {
formWidth: '840px',
labelWidth: '120',
operWidth: '180',
title: '含水监测',
buttons: [
],
otherBtn: [
],
rightBtn: [
{
type: 'primary', icon: 'el-icon-refresh', name: '刷新', 'callback': function () {
this.loadData()
}
},
{
type: 'success', icon: 'el-icon-s-data', name: '图表', 'callback': function () {
reqApi.common.openCharts.call(this);
}
},
{
type: 'warning', icon: 'el-icon-document', name: '导出', 'callback': function () {
reqApi.common.toExports.call(this);
}
},
{
type: 'default', icon: 'el-icon-printer', name: '打印', 'callback': function () {
Tools.cuPrint(this.$refs.cuTable);
}
}
],
search: [
{ 'type': 'select', 'name': '设备', 'word': 'sensorid', 'mode': 1, 'width': '160px', val: 'equipno', key: 'equipname', },
{ 'type': 'datetimerange', 'defaultTime': ['00:00:00', '23:59:59'], 'name': '日期范围', 'word': 'daterange', 'mode': 0, 'width': '380px', format: 'yyyy-MM-dd HH:mm:ss' },
{ 'type': 'checkbox', 'name': ' ', 'word': 'state', 'mode': 1, 'label': '报警状态', 'width': '140px', },
{
'type': 'button', 'label': '搜索', 'width': '140px', 'icon': 'el-icon-search', 'click': function (e) {
// 设置展示条件
//var partTableStatus = ~~this.form.query.monitorType;
//this.Dict.baseInfo["jcvalue"].table = partTableStatus;
//this.Dict.baseInfo["jctime"].table = partTableStatus;
this.table.page = 1;
this.loadData()
}
},
{
'type': 'select', 'name': '加入人工监测值', 'word': 'monitorType', 'mode': 1, val: 'id', key: 'name', 'width': '140px', 'change': function (val, item) {
var that = this.$parent;
var baseInfo = that.Dict.baseInfo;
// 设置展示条件
var partTableStatus = ~~that.form.query.monitorType;
!that.Dict.valueName && (that.Dict.valueName = baseInfo["jcvalue"].name);
baseInfo["jcvalue"].name = that.Dict.valueName + '(' + item.name + ')';
baseInfo["jcvalue"].table = partTableStatus;
baseInfo["jctime"].table = partTableStatus;
baseInfo["difference"].table = partTableStatus;
//that.table.page = 1;
that.loadData()
}, clear: function () {
this.loadData()
}
},
],
},
created: function () {
var baseInfo = this.Dict.baseInfo;
baseInfo["jcvalue"].table = 0;
baseInfo["jctime"].table = 0;
},
request: function (type, param) {
return reqPublic('data/st/history', type, param)
},
reqchart: function (param) {
return reqPublic('data/st/imghistory', 'get', param)
},
download: function (param) {
return reqPublic('data/st/download', 'get', param, { responseType: 'blob' })
},
},
},
ksw: { // 库水位 ksw: { // 库水位
history: { history: {
name: '库水位', name: '库水位',
......
<template>
<div class="common-page qyzz page-t1">
<div class="option page-row">
<table-filter
ref="filter"
:form="form"
:Dict="Dict"
:rules="rules"
:config="form.config"
:loadData="loadData"
/>
</div>
<div class="panel-bottom page-row">
<div class="ctin-box">
<div class="content-within">
<div class="content-fix">
<div class="toolbar">
<div>
<el-button v-for="(item, key) in form.config.otherBtn" size="mini" :type="item.type" :icon="item.icon" @click="item.callback.call(_self, $event)">{{item.name}}</el-button>
</div>
<div>
<el-button v-for="(item, key) in form.config.rightBtn" size="mini" :type="item.type" :icon="item.icon" @click="item.callback.call(_self, $event)">{{item.name}}</el-button>
</div>
</div>
<!-- 表格渲染 -->
<cu-table
ref="cuTable"
:table="table"
:Dict="Dict"
:config="form.config"
:loadData="loadData"
/>
</div>
</div>
</div>
</div>
<!-- 表单渲染 -->
<cu-form
ref="cuForm"
:form="form"
:Dict="Dict"
:rules="rules"
:submit="submitForm"
:cancel="cancelForm"
:watchKeys="['paperfilename']"
/>
</div>
</template>
<script>
import { reqApi, Config } from '@/assets/js/httpApi.js';
import { Tools } from '@/assets/js/common.js';
import DateRangePicker from '@/components/DateRangePicker';
import TableFilter from '@/components/TableFilter';
import cuForm from '@/components/cuForm';
import cuTable from '@/components/cuTable';
export default {
name: 'Dashboard',
components: {
DateRangePicker, TableFilter, cuForm, cuTable
},
data() {
return {
Dict:{selectList:[]},
table:{
page: 1,
size: 10,
total: 0,
loading: false,
dataList:[],
},
rules: {},
form: {
title:'', visible:false, reqType:'add', historyDialog:false,
status:{cu:0},
query:{},
search:{},
item:{},
file:0,
config:{},
},
}
},
created(){
// 获取基本信息
this.pageApi = Config.getModuleInfo(this);
this.Dict = this.pageApi.Dict;
this.form.config = this.pageApi.config;
this.rules = reqApi.getRules(this.Dict.baseInfo) || (this.Dict.rules || {});
this.pageApi.created && this.pageApi.created();
},
mounted() {
this.$nextTick(() => {
this.loadData();
});
// 获取选择列表字典
var selectList = this.Dict.selectList;
Tools.asyncLoop.call(this, selectList, function(key, value, next){
if(typeof value === 'function'){
value.call(this.Dict).then(function(res){
selectList[key] = res; next();
})
}else{next()};
});
},
methods: {
loadData:reqApi.common.getRequst,
cancelForm(){
this.form.visible = false;
},
submitForm(form, item){
reqApi.common.submitForm.call(this, form, item);
},
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scope>
.qyzz{
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment