feat(): 安全监测开发

master
李神峰 2025-01-15 17:43:55 +08:00
parent ff3efc5b66
commit 9f9ded1a80
10 changed files with 887 additions and 733 deletions

View File

@ -1,421 +1,376 @@
<template> <template>
<view :style="{height:'100vh',overflow:'hidden',backgroundColor:'#fff'}"> <view
:style="{ height: '100vh', overflow: 'hidden', backgroundColor: '#fff' }"
>
<u-status-bar></u-status-bar> <u-status-bar></u-status-bar>
<u-navbar title="安全监测" :autoBack="true" :titleStyle="{ <u-navbar
fontSize:'18px' title="安全监测"
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'> :autoBack="true"
:titleStyle="{
fontSize: '18px',
}"
:height="44"
:safeAreaInsetTop="true"
leftIconSize="20"
leftIconColor="rgb(153, 153, 153)"
>
</u-navbar> </u-navbar>
<picker @change="bindPickerChange" :range="array" range-key="profileName" style="margin-top:50px;padding: 0 10px;"> <view class="picker-sel">
<view class="uni-input12"> <picker @change="typeOnChange" :range="watchArr" range-key="name">
<view>{{profileName}}</view> <view class="uni-input12" style="margin-right: 10px">
<u-icon name="arrow-down-fill" color="#000" size="15"></u-icon> <view>{{ name }}</view>
</view> <u-icon name="arrow-down-fill" color="#000" size="15"></u-icon>
</picker> </view>
</picker>
<picker
@change="stationCodeChange"
:range="statiionCodeArray"
range-key="stationCode"
>
<view class="uni-input12">
<view>{{ stationCode }}</view>
<u-icon name="arrow-down-fill" color="#000" size="15"></u-icon>
</view>
</picker>
</view>
<view class="jcsj-box"> <view class="jcsj-box">
<view class="time-ranger"> <view class="time-ranger">
<view class="start-time"> <view class="start-time">
<text>开始时间</text> <text>开始时间</text>
<text @click="showTime=true" style="margin-left:10%;color:#3399ef">{{stm}}</text> <text
@click="showTime = true"
style="margin-left: 10%; color: #3399ef"
>{{ stm }}</text
>
</view> </view>
<view class="end-time"> <view class="end-time">
<text>结束时间</text> <text>结束时间</text>
<text @click="showTime1=true" style="margin:0 10%;color:#3399ef">{{etm}}</text> <text
<view class="search-btn" @click="searchHandle"> @click="showTime1 = true"
搜索 style="margin: 0 10%; color: #3399ef"
</view> >{{ etm }}</text
>
<view class="search-btn" @click="searchHandle"> </view>
</view> </view>
</view> </view>
<view class="jcsj-content"> <view class="jcsj-content">
<view class="tool-btn"> <view v-if="dataSources.length">
<view class="scale-btn"> <view style="width:100%;height:320px">
<u-button style="margin-right:10px" @click="fd" class="aqjc-custom-style">+</u-button> <qiun-data-charts :chartData="chartData.chartData" :echartsApp="true" :eopts="chartData.eopts" />
<u-button @click="sx" class="aqjc-custom-style">-</u-button>
</view>
<view class="play-btn">
<uni-icons type="videocam" size="40" :color="swiper ? '#2979ff':'#909399' " @click="play"></uni-icons>
</view> </view>
<JcsjTable :columns="newCol" :data="dataSources" :type="name" />
</view> </view>
<view class="jcsj-charts"> <image
<movable-area :style="areaStyle"> :src="showImg"
<movable-view @scale="scale" direction="all" :scale-value="scaleValue" scale-min="0.5" scale="true" style="width: 60%; height: 220px; margin: 50%;transform: translate(-50%,-50%)"
scale-max="4" out-of-bounds="true"> v-else
<qiun-data-charts :chartData="chartData.chartData" :echartsApp="true" :eopts="chartData.eopts" /> ></image>
</movable-view>
</movable-area>
</view>
<view style="margin-top: 20px;">
<JcsjTable :columns="columns" :data="dataSources" :newCol="newCol" :cols2="cols2" />
</view>
</view> </view>
<u-datetime-picker :show="showTime" v-model="startTime" mode="datetime" @confirm="handleStartTime" <u-datetime-picker
@cancel="showTime=false"></u-datetime-picker> :show="showTime"
<u-datetime-picker :show="showTime1" v-model="endTime" mode="datetime" @confirm="handleEndTime" v-model="startTime"
@cancel="showTime1=false"></u-datetime-picker> mode="datetime"
@confirm="handleStartTime"
@cancel="showTime = false"
></u-datetime-picker>
<u-datetime-picker
:show="showTime1"
v-model="endTime"
mode="datetime"
@confirm="handleEndTime"
@cancel="showTime1 = false"
></u-datetime-picker>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import moment from "moment" import moment from "moment";
import drpOption from './jrxOptions'; import drpOption from "./jrxOptions";
import JcsjTable from "./jcsjTable" import syOption from "./syOptions";
const stm = moment().subtract(1, 'days').add(1, 'hour').set({ import JcsjTable from "./jcsjTable";
const stm = moment()
.subtract(1, "days")
.add(1, "hour")
.set({
minute: 0, minute: 0,
second: 0 second: 0,
}).format("YYYY-MM-DD HH:mm"); })
const etm = moment().add(1, 'hour').set({ .format("YYYY-MM-DD HH:mm:ss");
const etm = moment()
.add(1, "hour")
.set({
minute: 0, minute: 0,
second: 0 second: 0,
}).format("YYYY-MM-DD HH:mm"); })
export default { .format("YYYY-MM-DD HH:mm:ss");
export default {
data() { data() {
return { return {
startTime: stm, startTime: stm,
endTime: etm, endTime: etm,
stm, stm,
etm, etm,
showTime: false, showTime: false,
showTime1: false, showTime1: false,
array: [], watchArr: [
profileCode: '', { name: "结构缝开度", type: 1 },
dbType: '', { name: "渗压", type: 2 },
trData: [], ],
dataSources: [], statiionCodeArray: [],
chartData: { stationCode: "",
chartData: {}, name: "结构缝开度",
eopts: {} dataSources: [],
showImg: "../../static/empty.png",
chartData: {
chartData: {},
eopts: {},
},
kfdCols: [
{
title: "监测点",
key: "stationCode",
dataIndex: "stationCode",
width: 100,
align: "center",
}, },
areaStyle: { {
left: "-450px" title: "缝开度(mm)",
key: "value",
dataIndex: "value",
width: 100,
align: "center",
}, },
scaleValue: 0.5, {
swiper: false, title: "温度(℃)",
timer: 100, key: "temp",
columns: [], dataIndex: "temp",
cols1: [{ width: 100,
title: '序号', align: "center",
key: 'index', },
width: 60, {
align: 'center', title: "模数(F)",
}, key: "modulus",
{ dataIndex: "modulus",
title: '时间', width: 100,
key: 'time', align: "center",
width: 120, },
align: 'center', {
}, title: "监测时间",
{ key: "tm",
title: '库水位(m)', dataIndex: "tm",
key: 'rz', width: 100,
dataIndex: 'rz', align: "center",
width: 150, },
align: "center" ],
}, syCols: [
], {
cols2: [{ title: "测点编号",
title: '结果分析', key: "stationCode",
key: 'status', dataIndex: "stationCode",
dataIndex: 'status', width: 120,
align: "center",
},
{
title: "水位(mm)",
key: "value",
dataIndex: "value",
width: 150, width: 150,
align: "center", align: "center",
}], },
newCol: [] {
title: "水压(KPa)",
key: "press",
dataIndex: "press",
width: 100,
align: "center",
},
{
title: "水位高程(m)",
key: "waterEle",
dataIndex: "waterEle",
width: 100,
align: "center",
},
{
title: "温度(℃)",
key: "temp",
dataIndex: "temp",
width: 100,
align: "center",
},
{
title: "模数(F)",
key: "modulus",
dataIndex: "modulus",
width: 100,
align: "center",
},
{
title: "监测时间",
key: "tm",
dataIndex: "tm",
width: 100,
align: "center",
},
],
newCol: [],
};
},
components: {
JcsjTable,
},
watch: {
name: {
handler(newVal, oldVal) {
const type = this.watchArr.find((item) => item.name == newVal)?.type;
this.getStationCode(type);
this.newCol = newVal == "结构缝开度" ? this.kfdCols : this.syCols;
},
immediate: true,
},
stationCode(newVal) {
this.getList(newVal);
},
},
methods: {
getStationCode(type) {
uni.$http
.get("/gunshiApp/ykz/osmoticStationInfo/list/" + type)
.then((res) => {
this.statiionCodeArray = res.data.data;
this.stationCode = res.data.data[0].stationCode;
});
},
stationCodeChange(e) {
this.stationCode = this.statiionCodeArray[e.target.value].stationCode;
},
async getList(code) {
const url =
this.name == "结构缝开度"
? "/gunshiApp/ykz/osmoticJointR/list"
: "/gunshiApp/ykz/osmoticPressR/list";
try {
const { data } = await uni.$http.post(url, {
dateTimeRangeSo: { start: this.stm, end: this.etm },
stationCode: code,
});
if (data.code == 200) {
this.dataSources = data.data;
this.chartData = this.name == "结构缝开度"? {...drpOption(data.data)} : {...syOption(data.data)}
}
} catch (error) {
console.log(error);
} }
}, },
components: {
JcsjTable searchHandle() {
this.getList(this.stationCode);
}, },
computed: { handleStartTime(e) {
profileName() { let time = moment(e.value).format("YYYY-MM-DD HH:mm:ss");
if (this.array.length > 0) { console.log("time", time);
return this.array.find(item => item.profileCode == this.profileCode).profileName;
} else { this.stm = time;
return ''; this.showTime = false;
}
},
}, },
watch: { handleEndTime(e) {
profileCode: { let time = moment(e.value).format("YYYY-MM-DD HH:mm:ss");
handler(newVal, oldVal) { this.etm = time;
if (newVal) { this.showTime1 = false;
let name = this.array.find(item => item.profileCode == newVal).profileName;
this.dbType = name == "大坝B0+060" ? "1" :
name == "大坝B0+090" ? "2" :
name == "大坝B0+120" ? "2" : '1'
this.getDmTree();
}
},
immediate: true,
},
trData: {
handler(newVal, oldVal) {
if (newVal) {
this.getTableData()
}
},
deep: true,
},
dataSources: {
handler(newVal, oldVal) {
if (newVal) {
this.chartData = {
...drpOption(newVal[0], this.dbType)
}
}
},
deep: true,
immediate: true,
},
swiper(newVal) {
console.log("ww", newVal);
if (newVal) {
this.InitialScroll(this.dataSources)
} else {
clearInterval(this.timer)
}
}
}, },
methods: { handleRanger(e) {
InitialScroll(data) { console.log(e);
let index = 0; this.tm = [...e];
this.timer = setInterval(() => {
console.log("data", data[index % data.length]);
this.chartData = {
...drpOption(data[index % data.length], this.dbType)
}
index++;
}, 1000)
},
//
play() {
this.swiper = !this.swiper;
},
//
fd() {
if (this.scaleValue == 4) {
return;
} else {
this.scaleValue += 0.1;
}
},
//
sx() {
if (this.scaleValue == 0.5) {
return ''
} else {
this.scaleValue -= 0.1;
}
},
//
scale(e) {
this.areaStyle.left = -(e.detail.scale + 1) * 450 + 'px';
},
searchHandle() {
this.getTableData();
},
handleStartTime(e) {
let time = moment(e.value).format("YYYY-MM-DD HH:mm")
console.log("time", time);
this.stm = time
this.showTime = false
},
handleEndTime(e) {
let time = moment(e.value).format("YYYY-MM-DD HH:mm")
this.etm = time;
this.showTime1 = false
},
handleRanger(e) {
console.log(e);
this.tm = [...e]
},
bindPickerChange(e) {
this.profileCode = this.array[e.target.value].profileCode
},
//
async getMonthData() {
try {
const {
data
} = await uni.$http.post(
`/gunshiApp/tsg/attDamProfile/list`, )
if (data.code == 200) {
this.array = data.data
this.profileCode = data.data[0].profileCode;
}
} catch (e) {
uni.$showMsg();
}
},
//
async getTableData() {
try {
const {
data
} = await uni.$http.post(
"/gunshiApp/tsg/osmoticPressR/infiltra/line", {
stationCodes: this.trData,
dateTimeRangeSo: {
start: moment(this.stm).format("YYYY-MM-DD HH:mm:00"),
end: moment(this.etm).format("YYYY-MM-DD HH:mm:00"),
}
}
)
if (data.code == 200) {
let newArr = [];
let newData = data.data.map((s, i) => {
newArr.push(s.list.map(c => ({
[c.stationCode]: c.value || '-',
tm: c.tm,
})))
return {
tm: s.tm,
rz: s.rz,
status: s.status || '',
inx: i + 1
}
})
let filterData = newArr.filter(s => s.length > 0).flat()
let result = newData.map(s => {
let tm1 = s.tm;
let r = filterData.filter(t => {
return t.tm == tm1
})
let obj = {};
r.forEach(s1 => {
obj = {
...s1,
...obj
}
})
return {
...s,
...obj,
}
})
this.dataSources = [...result];
}
} catch (error) {
uni.$showMsg();
}
},
//
async getDmTree() {
try {
const {
data
} = await uni.$http.post("/gunshiApp/tsg/attDamProfile/tree")
if (data.code == 200) {
console.log("data", data);
let filterData = data.data.filter(s => s.profileCode == this.profileCode)
this.trData = filterData[0].children;
const newCol = filterData[0].children.map(s => ({
title: `${s}(m)`,
key: s,
dataIndex: s,
width: 150,
align: "center",
}))
this.columns = [...this.cols1, ...newCol, ...this.cols2]
this.newCol = newCol;
}
} catch (error) {
uni.$showMsg();
}
},
//
onChange(e) {
console.log(e);
},
}, },
mounted() { typeOnChange(e) {
this.getMonthData() this.name = this.watchArr[e.target.value].name;
this.getDmTree()
}, },
} },
mounted() {},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.uni-input12 { .picker-sel {
display: flex; display: flex;
justify-content: center; justify-content: center;
column-gap: 30px; // column-gap: 10px;
align-items: center; margin-top: 50px;
padding: 5px 0; padding: 0 10px;
border: 1px solid #f2f2f2; }
border-left: none; .uni-input12 {
border-right: none; display: flex;
// background-image: '../../static/images/'; justify-content: center;
} column-gap: 10px;
align-items: center;
padding: 5px 0;
border: 1px solid #f2f2f2;
border-left: none;
border-right: none;
// background-image: '../../static/images/';
}
.jcsj-box { .jcsj-box {
padding: 0 10px; padding: 0 10px;
.jcsj-content { .jcsj-content {
max-height: 100vh; max-height: 100vh;
width: 100%; width: 100%;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
.tool-btn { .tool-btn {
display: flex;
justify-content: space-between;
align-items: "center";
padding: 5px;
.scale-btn {
display: flex; display: flex;
justify-content: space-between;
align-items: "center";
padding: 5px;
.scale-btn { button {
display: flex; height: 40px;
button {
height: 40px;
}
} }
} }
} }
.jcsj-charts {
width: 1310px;
height: 250px;
overflow-y: auto;
// margin-top: 20px;
&>movable-area {
height: 250px;
width: 3000px;
// position:fixed;
overflow: hidden;
z-index: 1;
background-color: #efefef;
movable-view {
display: flex;
justify-content: center;
width: 1310px;
height: 380px;
background-color: #fff;
left: 450px;
top: 10px
}
}
.active {
border-color: #68bbff !important;
color: #68bbff;
}
}
.aqjc-custom-style {
width: 80rpx;
}
} }
.jcsj-charts {
width: 1310px;
height: 250px;
overflow-y: auto;
// margin-top: 20px;
& > movable-area {
height: 250px;
width: 3000px;
// position:fixed;
overflow: hidden;
z-index: 1;
background-color: #efefef;
movable-view {
display: flex;
justify-content: center;
width: 1310px;
height: 380px;
background-color: #fff;
left: 450px;
top: 10px;
}
}
.active {
border-color: #68bbff !important;
color: #68bbff;
}
}
.aqjc-custom-style {
width: 80rpx;
}
}
</style> </style>

View File

@ -1,24 +1,19 @@
<template> <template>
<div class="table_div"> <div class="table_div" :style="{display:'block',width:name == '结构缝开度'? 500:730 ,overflowX:'scroll'}">
<div class="table_cur"> <div class="table_cur">
<table style="display:block;width:700px;overflow-x:auto"> <table >
<tr> <tr>
<th v-for="(cols,i) in columns" :key="i" :style="getStyle(cols)"> <th v-for="(cols,i) in columns" :key="i" :style="getStyle(cols)">
{{ cols.title }} {{ cols.title }}
</th> </th>
</tr> </tr>
<!-- style="max-height: 480px; overflow-y: auto" --> <!-- style="max-height: 480px; overflow-y: auto" -->
<div class="scroll-table"> <!-- <view>{{JSON.stringify(data)}}</view> -->
<div class="scroll-table" >
<tr v-for="(item, index) in data" :key="index"> <tr v-for="(item, index) in data" :key="index">
<td style="width:100px;text-align:center">{{ index + 1 }}</td> <td v-for="(col,i) in columns" :key="i" style="width:100px;text-align:center;">
<td style="width:200px;text-align:center">{{ item.tm }}</td>
<td style="width:100px;text-align:center">{{ item.rz }}</td>
<td v-for="(col,i) in newCol" :key="i" style="width:100px;text-align:center;">
{{item[col.key] }} {{item[col.key] }}
</td> </td>
<td style="width:100px;">
{{item.status == 1 ? "正常" : rec == 0 ? "异常" : ''}}
</td>
</tr> </tr>
</div> </div>
<div style="height:180px"></div> <div style="height:180px"></div>
@ -41,9 +36,9 @@
type:Array, type:Array,
default:[], default:[],
}, },
cols2:{ name:{
type:Array, type:String,
default:[], default:'',
}, },
newCol:{ newCol:{
type:Array, type:Array,
@ -60,7 +55,7 @@
methods:{ methods:{
getStyle(row){ getStyle(row){
return { return {
width:row.title == "时间" ? "200px": "100px" width:"100px"
} }
} }
} }
@ -86,7 +81,7 @@
.scroll-table{ .scroll-table{
height: calc(100vh - 180px); height: calc(100vh - 180px);
overflow-y: auto; overflow-y: auto;
overflow-x: auto; // overflow-x: auto;
width:'100%' width:'100%'
} }
.table_cur tr { .table_cur tr {

View File

@ -1,322 +1,198 @@
import { imageUrl060,imageUrl090,rule } from './dataUrl' import { imageUrl060,imageUrl090,rule } from './dataUrl'
export default function jrxOptions(data = {}, type = "1") { export default function jrxOptions(data ) {
const yMin = type == "1" ? 70 : type == "2" ? 70 : 70; // 缝开度
const yMax = type == "1" ? 154 : type == "2" ? 150 : 150; const kdMin = Math.floor(Math.min(...data.map(item => item.value)));
const type1 = ["SY05", "SY06", "SY07", "SY08"] const kdMax = Math.ceil(Math.max(...data.map(item => item.value)));
const type2 = ["SY09","SY10","SY11","SY12"]
const alltype = type == "1" ? type1 : type == "2" ? type2 : type2; // 温度
// 字体颜色 const tempMin = Math.floor(Math.min(...data.map(item => item.temp)));
const textColor = '#666' const tempMax = Math.ceil(Math.max(...data.map(item => item.temp)));
const imageUrl = type == "1" ? imageUrl060:
type == "2" ? imageUrl090 : imageUrl090; // 模数
const xValue = type == "1" ? (((data?.rz - 99) + 1.1 * 13) / 1.1): const modulusMin = Math.floor(Math.min(...data.map(item => item.modulus)));
type == "2" ? (((data?.rz - 99) + 1 * 14) / 1) : (((data?.rz - 99) + 1 * 14) / 1) const modulusMax = Math.ceil(Math.max(...data.map(item => item.modulus)));
const rz = data?.rz ?
[[xValue, data?.rz], [0, data?.rz], ] :
[]
const rz1 = data?.rz ?
type == "1" ?
[[0, 99], [13, 99], [xValue, data?.rz]]:
type == "2" ?
[[0, 99], [14, 99], [xValue, data?.rz]]
: [[0, 99], [14, 99], [xValue, data?.rz]]
:
[]
const gz1 = data[alltype[0]] ?
type == "1" ? [[51.6, 85], [51.6, data[alltype[0]]]] :
type == "2" ? [[47.5, 85], [47.5, data[alltype[0]]]] :
[[47.5, 158], [85, data[alltype[0]]]]
: [];
const gz2 = data[alltype[1]] ?
type == "1" ? [[53.6, 85], [53.6, data[alltype[1]]]] :
type == "2" ? [[49.5, 85], [49.5, data[alltype[1]]]] :
[[53.6, 158], [53.6, data[alltype[1]]]] :
[];
const gz3 = data[alltype[2]] ?
type == "1" ? [[72.5, 90], [72.5, data[alltype[2]]]] :
type == "2" ? [[66.5, 90], [66.5, data[alltype[2]]]] :
[[73, 161], [73, data[alltype[2]]]] : [];
const gz4 = data[alltype[3]] ?
type == "1" ? [[84.5, 96], [84.5, data[alltype[3]]]] :
type == "2" ? [[77, 96], [77, data[alltype[3]]]] :
[[85, 166], [85, data[alltype[3]]]] : [];
const line = data?.rz ?
type == "1" ?
[
[xValue, data?.rz],
[51.6, data[alltype[0]]],
[53.6, data[alltype[1]]],
[72.5, data[alltype[2]]],
[84.5, data[alltype[3]]]
] :
type == "2" ?
[
[xValue, data?.rz],
[47.5, data[alltype[0]]],
[49.5, data[alltype[1]]],
[66.5, data[alltype[2]]],
[77, data[alltype[3]]]
] :
[
[xValue, data?.rz],
[51.6, data[alltype[0]]],
[53.6, data[alltype[1]]],
[73, data[alltype[2]]],
[85, data[alltype[3]]]
]
: []
let eopts = { let eopts = {
toolbox: { tooltip: {
show: true, trigger: 'axis',
feature: { },
saveAsImage: { legend: {
show: true, top:'0%',
excludeComponents: ['toolbox'], data: ['缝开度', '温度', '模数']
pixelRatio: 2, },
name:"测值图" grid: {
}, left: 35,
}, right:120
right: "10%", },
top:"4%" xAxis: [
}, {
graphic: [ type: 'category',
{ data: data.map(o => o.tm),
type: 'image', inverse: false,
left: '5%', splitLine: {
top: 0, show: false
bottom:0, },
z: 1, axisLabel: {
bounding: 'raw', padding: [0, 0, 100, 0],
style: { color: '#333',
image: imageUrl, fontSize: 12,
width: 1310, format:'ykzXAxisFormat'
height: 380 },
} axisLine: {
}, lineStyle: {
{ color: '#8c8c8c',
type: 'image', width: 1,
// id: 'background', }
left: '5%', },
bottom:"5%", axisTick: {
z: 1, show: false,
bounding: 'all', },
style: { }
image: rule, ],
width: 10, yAxis: [
height: 450 {
} type: 'value',
} position: 'left',
], name: "缝开度(mm)",
grid: { nameTextStyle: {
top: '0%', padding: [-10, 0, 10, 10],
left: '2%', color: '#333333',
right: '5%', fontSize: 14
bottom: '0%', },
containLabel: true splitLine: {
}, show: true,
xAxis: { lineStyle: {
min: 0, color: '#bfbfbf',
max:100, width: 0.5,
axisLabel: { type: 'dotted'
show:false, }
// 坐标轴字体颜色 },
color: textColor, axisLabel: {
fontSize: 18 color: '#333',
}, fontSize: 12,
axisLine: { },
show:false, axisLine: {
lineStyle: { // show: false
color: textColor lineStyle: {
} color: '#8c8c8c',
}, width: 1,
axisTick: { }
// y轴刻度线 },
show: false axisTick: {
}, show: false,
splitLine: { },
// 网格 min: kdMin,
show: false max: kdMax,
}, },
boundaryGap: false {
}, type: 'value',
yAxis: { position: 'right',
type: 'value', offset: 80,
min: yMin, name: "温度(°℃)",
max: yMax, nameTextStyle: {
interval:5, padding: [0, 0, 10, 10],
// data:[155,160,180,190,210], color: '#333333',
nameTextStyle: { fontSize: 14
color: '#333', },
fontSize: 18, splitLine: {
padding: [0, 0, 0, 80] show: false,
}, lineStyle: {
axisLabel: { color: '#07a6ff',
// 坐标轴字体颜色 width: 0.25,
color: textColor, type: 'dotted'
fontSize: 18, }
showMinLabel: false, },
showMaxLabel: false axisLabel: {
}, color: '#333',
axisLine: { fontSize: 12,
show: false },
}, axisLine: {
axisTick: { // show: false
// y轴刻度线 lineStyle: {
show: false color: '#8c8c8c',
}, width: 1,
splitLine: { }
// 网格 },
show: false, axisTick: {
lineStyle: { show: false,
color: '#CCCCCC', },
type: 'dashed' min: tempMin,
} max: tempMax,
} },
}, {
type: 'value',
position: 'right',
name: "模数(F)",
nameTextStyle: {
padding: [0, 0, 10, 10],
color: '#333333',
fontSize: 14
},
splitLine: {
show: false,
lineStyle: {
color: '#07a6ff',
width: 0.25,
type: 'dotted'
}
},
axisLabel: {
color: '#333',
fontSize: 12,
},
axisLine: {
// show: false
lineStyle: {
color: '#8c8c8c',
width: 1,
}
},
axisTick: {
show: false,
},
min: modulusMin,
max: modulusMax,
}
],
} }
let chartData = { let chartData = {
series: [ series: [
// 和大坝坡面重合的线 斜率为0.75 {
{ yAxisIndex: 0,
name: '缝开度',
type: 'line', type: 'line',
symbol: 'none', color: "#d6eaec",
symbolSize: 10, data: data.map(o => o.value),
z: 1, symbol: 'none', // 设置标记点为'none',即去掉圆点
itemStyle: { smooth: 0.5
color: '#fff'
},
lineStyle: {
color: '#fff'
}, },
areaStyle: { {
origin: "end", // xAxisIndex: 1,
color: 'rgba(0, 128, 255, 0.3)' // 设置区域填充颜色 yAxisIndex: 1,
name: '温度',
type: 'line',
color: "#60a0f8",
lineStyle: {
// type: "dashed"
},
data: data.map(o => o.temp),
symbol: 'none', // 设置标记点为'none',即去掉圆点
smooth: 0.5
}, },
data:[...rz,...rz1] {
yAxisIndex: 2,
}, name: '模数',
{ type: 'line',
// color: "#60a0f8",
type: 'line', lineStyle: {
symbol: 'none', // type: "dashed"
symbolSize: 10, },
z: 1, data: data.map(o => o.modulus),
itemStyle: { symbol: 'none', // 设置标记点为'none',即去掉圆点
color: '#5487FF' smooth: 0.5
},
lineStyle: {
color: '#5487FF'
},
markPoint: {
data: [{ type: 'max',x:"20%", coord: [xValue, data?.rz] }],
symbol: 'pin',
symbolSize: [30, 10],
itemStyle: {
color: '#fff', // 标注点颜色
borderColor: '#ffa500', // 标注点边框颜色
borderWidth: 0 // 标注点边框宽度
},
label: {
show: true, // 是否显示标签
formatter: "库水位" +data?.rz + "m", // 标签格式
color: '#5487FF', // 标签文字颜色
fontSize: 12, // 标签文字大小
}
}, },
data:rz ]
},
{
type: 'line',
symbol: 'none',
symbolSize: 10,
z: 1,
itemStyle: {
color: '#5487FF'
},
lineStyle: {
color: '#5487FF'
},
data:rz1
},
// 管位
{
type: 'line',
symbol: 'none',
symbolSize: 10,
z: 1,
itemStyle: {
color: '#5487FF'
},
lineStyle: {
color: '#5487FF',
width:6
},
data: gz1
},
{
type: 'line',
symbol: 'none',
symbolSize: 10,
z: 1,
itemStyle: {
color: '#5487FF'
},
lineStyle: {
color: '#5487FF',
width:6
},
data: gz2
},
{
type: 'line',
symbol: 'none',
symbolSize: 10,
z: 1,
itemStyle: {
color: '#5487FF'
},
lineStyle: {
color: '#5487FF',
width:6
},
data: gz3
},
{
type: 'line',
symbol: 'none',
symbolSize: 10,
z: 1,
itemStyle: {
color: '#5487FF'
},
lineStyle: {
color: '#5487FF',
width:6
},
data: gz4
},
// 管位连接线
{
type: 'line',
symbol: 'none',
symbolSize: 10,
z: 1,
itemStyle: {
color: '#5487FF'
},
lineStyle: {
color: '#5487FF',
},
data: line
},
]
} }
return { return {
eopts, eopts,

300
pages/aqjc/syOptions.js Normal file
View File

@ -0,0 +1,300 @@
export default function syOptions(data) {
// 水位
const rzMin = Math.floor(Math.min(...data.map(item => item.value)));
const rzMax = Math.ceil(Math.max(...data.map(item => item.value)));
// 水压
const pressMin = Math.floor(Math.min(...data.map(item => item.press)));
const pressMax = Math.ceil(Math.max(...data.map(item => item.press)));
// 高程
const waterEleMin = Math.floor(Math.min(...data.map(item => item.waterEle)));
const waterEleMax = Math.ceil(Math.max(...data.map(item => item.waterEle)));
// 温度
const tempMin = Math.floor(Math.min(...data.map(item => item.temp)));
const tempMax = Math.ceil(Math.max(...data.map(item => item.temp)));
// 模数
const modulusMin = Math.floor(Math.min(...data.map(item => item.modulus)));
const modulusMax = Math.ceil(Math.max(...data.map(item => item.modulus)));
let chartData = {
series: [
{
yAxisIndex: 0,
name: '水位',
type: 'line',
color: "#d6eaec",
data: data.map(o => o.value),
symbol: 'none', // 设置标记点为'none',即去掉圆点
smooth: 0.5
},
{
yAxisIndex: 1,
name: '水压',
type: 'line',
color: "#60a0f8",
lineStyle: {
// type: "dashed"
},
data: data.map(o => o.press),
symbol: 'none', // 设置标记点为'none',即去掉圆点
smooth: 0.5
},
{
yAxisIndex: 2,
name: '水位高程',
type: 'line',
// color: "#60a0f8",
lineStyle: {
// type: "dashed"
},
data: data.map(o => o.waterEle),
symbol: 'none', // 设置标记点为'none',即去掉圆点
smooth: 0.5
},
{
yAxisIndex: 3,
name: '温度',
type: 'line',
// color: "#60a0f8",
lineStyle: {
// type: "dashed"
},
data: data.map(o => o.temp),
symbol: 'none', // 设置标记点为'none',即去掉圆点
smooth: 0.5
},
{
yAxisIndex: 4,
name: '模数',
type: 'line',
// color: "#60a0f8",
lineStyle: {
// type: "dashed"
},
data: data.map(o => o.modulus),
symbol: 'none', // 设置标记点为'none',即去掉圆点
smooth: 0.5
},
]
}
let eopts = {
tooltip: {
trigger: 'axis',
},
legend: {
top: '0%',
left:-10,
data: ['水位','水压','水位高程','温度', '模数']
},
grid: {
left: 35,
right: 120
},
xAxis: [
{
type: 'category',
data: data.map(o => o.tm),
inverse: false,
splitLine: {
show: false
},
axisLabel: {
padding: [0, 0, 100, 0],
color: '#333',
fontSize: 12,
format:'ykzXAxisFormat'
},
axisLine: {
lineStyle: {
color: '#8c8c8c',
width: 1,
}
},
axisTick: {
show: false,
},
}
],
yAxis: [
{
type: 'value',
position: 'left',
name: "水位(mm)",
nameTextStyle: {
padding: [0, 0, 10, 10],
color: '#333333',
fontSize: 14
},
splitLine: {
show: true,
lineStyle: {
color: '#bfbfbf',
width: 0.5,
type: 'dotted'
}
},
axisLabel: {
color: '#333',
fontSize: 12,
},
axisLine: {
// show: false
lineStyle: {
color: '#8c8c8c',
width: 1,
}
},
axisTick: {
show: false,
},
min: rzMin,
max: rzMax,
},
{
type: 'value',
position: 'right',
name: "水压(KPa)",
offset: -40,
nameTextStyle: {
padding: [0, 0, 10, 10],
color: '#333333',
fontSize: 14
},
splitLine: {
show: false,
lineStyle: {
color: '#07a6ff',
width: 0.25,
type: 'dotted'
}
},
axisLabel: {
color: '#333',
fontSize: 12,
},
axisLine: {
// show: false
lineStyle: {
color: '#8c8c8c',
width: 1,
}
},
axisTick: {
show: false,
},
min: pressMin,
max: pressMax,
},
{
type: 'value',
position: 'right',
name: "水位高程(m)",
offset: -115,
nameTextStyle: {
padding: [0, 0, 10, 10],
color: '#333333',
fontSize: 14
},
splitLine: {
show: false,
lineStyle: {
color: '#07a6ff',
width: 0.25,
type: 'dotted'
}
},
axisLabel: {
color: '#333',
fontSize: 12,
},
axisLine: {
// show: false
lineStyle: {
color: '#8c8c8c',
width: 1,
}
},
axisTick: {
show: false,
},
min: waterEleMin,
max: waterEleMax,
},
{
type: 'value',
position: 'right',
name: "温度(℃)",
offset: 25,
nameTextStyle: {
padding: [0, 0, 10, 10],
color: '#333333',
fontSize: 14
},
splitLine: {
show: false,
lineStyle: {
color: '#07a6ff',
width: 0.25,
type: 'dotted'
}
},
axisLabel: {
color: '#333',
fontSize: 12,
},
axisLine: {
// show: false
lineStyle: {
color: '#8c8c8c',
width: 1,
}
},
axisTick: {
show: false,
},
min: tempMin,
max: tempMax,
},
{
type: 'value',
position: 'right',
name: "模数(F)",
offset: 80,
nameTextStyle: {
padding: [0, 0, 10, 10],
color: '#333333',
fontSize: 14
},
splitLine: {
show: false,
lineStyle: {
color: '#07a6ff',
width: 0.25,
type: 'dotted'
}
},
axisLabel: {
color: '#333',
fontSize: 12,
},
axisLine: {
// show: false
lineStyle: {
color: '#8c8c8c',
width: 1,
}
},
axisTick: {
show: false,
},
min: modulusMin,
max: modulusMax,
}
]
}
return {
eopts,
chartData
}
}

View File

@ -107,7 +107,7 @@ export default {
}; };
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getYjData(); this.getAllList();
uni.$showMsg("刷新成功"); uni.$showMsg("刷新成功");
setTimeout(function () { setTimeout(function () {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
@ -119,7 +119,7 @@ export default {
{ {
value: "工程概况", value: "工程概况",
key: 1, key: 1,
icon: "../../static/tabs/zhjs.png", icon: "../../static/tabs/wxyh.png",
url: "/pages/gcgk/index", url: "/pages/gcgk/index",
}, },
{ {
@ -145,11 +145,11 @@ export default {
key: 3, key: 3,
icon: "../../static/tabs/spjk.png", icon: "../../static/tabs/spjk.png",
url: "/pages/spjk/index", url: "/pages/spjk/index",
}, },
{ {
value: "水雨情", value: "水雨情",
key: 6, key: 6,
icon: "../../static/tabs/spjk.png", icon: "../../static/tabs/xingzhuang2.png",
url: "/pages/syq/index", url: "/pages/syq/index",
}, },
]; ];
@ -206,25 +206,41 @@ export default {
}); });
this.setInsert(menu2); this.setInsert(menu2);
}, },
//
async getYjData() { //
const params = { getZqList() {
start: warnStm, return uni.$http.post("/gunshiApp/ykz/warnRecord/page", {
end: warnetm, pageSo: {
}; pageSize: 999,
try { pageNumber: 1,
const res = await uni.$http.post( },
"/gunshiApp/tsg/stQxWarnR/home/warn", dateTimeRangeSo: {
params start: warnStm,
); end: warnetm,
const { flowWarn, pressWarn, qxWarn, shiftWarn } = res.data.data; },
const arr = [...flowWarn, ...pressWarn, ...qxWarn, ...shiftWarn]; });
if (arr.length > 0) { },
//
getAqList() {
return uni.$http.post("/gunshiApp/ykz/osmoticWarnRecord/page", {
pageSo: {
pageSize: 999,
pageNumber: 1,
},
dateTimeRangeSo: {
start: warnStm,
end: warnetm,
},
});
},
getAllList() {
Promise.all([this.getZqList(), this.getAqList()]).then((res) => {
const result = res.map((item) => item.data?.data?.records).flat();
if (result.length > 0) {
this.warnStatus = true; this.warnStatus = true;
} }
} catch (error) { });
uni.$showMsg();
}
}, },
}, },
@ -240,7 +256,7 @@ export default {
}, 10000); }, 10000);
this.setInsert(); this.setInsert();
this.getYjData(); this.getAllList();
this.getSwList(); this.getSwList();
}, },
onHide() { onHide() {

View File

@ -1,12 +1,13 @@
<template> <template>
<view class="container"> <view class="container">
<div class="img">
<image style="width: 100%; height: 100%" src="../../static/images/bg_img.png" mode="scaleToFill"></image>
</div>
<view class="user-title"> <view class="user-title">
<text class="sub">用户登录</text> <text class="sub" >荆州新建盐卡闸信息化系统</text>
<text class="line"></text> <!-- <text class="line"></text> -->
</view> </view>
<div class="img">
<image style="width: 100%; height: 100%" src="../../static/images/loinBg.png" mode="scaleToFill"></image>
</div>
<uni-forms :modelValue="formData" class="form"> <uni-forms :modelValue="formData" class="form">
<uni-forms-item> <uni-forms-item>
<uni-easyinput type="text" v-model="formData.username" placeholder="请输入用户名" /> <uni-easyinput type="text" v-model="formData.username" placeholder="请输入用户名" />
@ -193,8 +194,9 @@
.img { .img {
width: 100vw; width: 100vw;
height: 40vh; // height: 40vh;
margin-top: 0vh; height: 30vh;
margin-top: 2vh;
/* background-color: red; */ /* background-color: red; */
} }
@ -214,8 +216,9 @@
flex-direction: column; flex-direction: column;
.sub { .sub {
font-size: 28px; font-size: 22px;
color: #000; color: #102e9e;
margin-top: 3vh;
} }
.line { .line {

View File

@ -15,7 +15,7 @@
</tr> </tr>
<!-- style="max-height: 480px; overflow-y: auto" --> <!-- style="max-height: 480px; overflow-y: auto" -->
<div class="scroll-table"> <div class="scroll-table">
<tr v-for="(item, index) in tableData" :key="index"> <tr v-for="(item, index) in tableData" :key="index">
<td style="width: 30%;">{{simpleData(item.typeName)}}</td> <td style="width: 30%;">{{simpleData(item.typeName)}}</td>
<td style="width:28%;">{{ item.val }}</td> <td style="width:28%;">{{ item.val }}</td>
<td style="width: 42%;">{{item.tm}}</td> <td style="width: 42%;">{{item.tm}}</td>

View File

@ -2,7 +2,7 @@
<view :style="{ height: '100vh', overflow: 'hidden' }"> <view :style="{ height: '100vh', overflow: 'hidden' }">
<u-status-bar></u-status-bar> <u-status-bar></u-status-bar>
<u-navbar <u-navbar
title="预警" title="预(报)警"
:autoBack="true" :autoBack="true"
:titleStyle="{ :titleStyle="{
fontSize: '18px', fontSize: '18px',
@ -24,7 +24,7 @@
padding: 0 10px; padding: 0 10px;
" "
> >
警时间{{ model.start }} {{ model.end }} ()警时间{{ model.start }} {{ model.end }}
</view> </view>
<view class="itemYj"> <view class="itemYj">
<view class="itemYjCont" v-for="(value, key) of list" :key="key"> <view class="itemYjCont" v-for="(value, key) of list" :key="key">
@ -147,6 +147,9 @@ export default {
pageSize: 999, pageSize: 999,
pageNumber: 1, pageNumber: 1,
}, },
dateTimeRangeSo:{
...this.model
}
}) })
}, },
@ -158,6 +161,9 @@ export default {
pageSize: 999, pageSize: 999,
pageNumber: 1, pageNumber: 1,
}, },
dateTimeRangeSo:{
...this.model
}
}) })
}, },

BIN
static/images/loinBg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@ -56,6 +56,9 @@ const cfe = {
}, },
"xAxisFormat": function (value) { "xAxisFormat": function (value) {
return value.substr('2020--'.length, 11) return value.substr('2020--'.length, 11)
},
"ykzXAxisFormat": function (value) {
return value.slice(0, 10)
}, },
"projectFormat":function (value) { "projectFormat":function (value) {
return value + 'mm'; return value + 'mm';