feat(): 主页修改

master
李神峰 2025-04-18 13:53:13 +08:00
parent 670f8f7a33
commit f41bf1d1e0
18 changed files with 274 additions and 149 deletions

View File

@ -8,7 +8,7 @@ import {
} from '@escook/request-miniprogram'
Vue.config.productionTip = false
uni.$http = $http
$http.baseUrl = 'http://local.gunshiiot.com:18083'
$http.baseUrl = 'http://223.75.53.141:83'
// 请求拦截器
$http.beforeRequest = function (options) {
if (options.url.indexOf('/doLogin') == -1) {

View File

@ -157,7 +157,7 @@
getImgFlow(imgUrl) {
if (imgUrl) {
uni.request({
url: 'http://local.gunshiiot.com:18083' +
url: 'http://223.75.53.141:83' +
`/gunshiApp/tsg/common/download/resource?resource=${imgUrl}`,
responseType: 'arraybuffer',
success: (res) => {

View File

@ -107,7 +107,7 @@ export default {
uploadFilePromise(url,name) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: 'http://local.gunshiiot.com:18083/gunshiApp/tsg/maintain/service/file/upload/singleSimple', //
url: 'http://223.75.53.141:83/gunshiApp/tsg/maintain/service/file/upload/singleSimple', //
filePath: url,
name: 'file',
formData: {

View File

@ -99,7 +99,7 @@
getImgFlow(imgUrl) {
uni.request({
url: 'http://local.gunshiiot.com:18083' +
url: 'http://223.75.53.141:83' +
`/gunshiApp/tsg/common/download/resource?resource=${imgUrl}`,
responseType: 'arraybuffer',
success: (res) => {

View File

@ -1,89 +1,180 @@
<template>
<view class="container">
<u-navbar :title="name" :autoBack="true" :titleStyle="{
fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar>
<view style="margin-top: 70px; padding: 10px;">
<SlTable :tableData="slData" v-if="name == '渗流监测'"></SlTable>
<ZwyTable :tableData="zwyData" v-else-if="name == ''"></ZwyTable>
<ZwyTable :tableData="zwyData" v-else-if="name == ''"></ZwyTable>
<ZwyTable :tableData="zwyData" v-else-if="name == ''"></ZwyTable>
<ZsyTable :tableData="zsyData" v-else-if="name == ''"></ZsyTable>
<ZsyTable :tableData="sdData" v-else-if="name == ''"></ZsyTable>
<ZsyTable :tableData="fbData" v-else-if="name == ''"></ZsyTable>
<ZwyTable :tableData="zwyData" v-else-if="name == ''"></ZwyTable>
</view>
</view>
<view class="container">
<u-navbar
:title="name"
:autoBack="true"
:titleStyle="{
fontSize: '18px',
}"
:height="44"
:safeAreaInsetTop="true"
leftIconSize="20"
leftIconColor="rgb(153, 153, 153)"
>
</u-navbar>
<view style="margin-top: 70px; padding: 10px">
<SlTable :tableData="slData" v-if="name == '渗流监测'"></SlTable>
<ZwyTable
:tableData="zwyData"
v-else-if="name == '主坝位移监测'"
></ZwyTable>
<ZwyTable
:tableData="zwyData"
v-else-if="name == '溢洪道位移监测'"
></ZwyTable>
<ZwyTable
:tableData="zwyData"
v-else-if="name == '副坝位移监测'"
></ZwyTable>
<ZsyTable
:tableData="zsyData"
v-else-if="name == '主坝渗压监测'"
></ZsyTable>
<ZsyTable
:tableData="sdData"
v-else-if="name == '灌溉发电洞渗压监测'"
></ZsyTable>
<ZsyTable
:tableData="fbData"
v-else-if="name == '副坝渗压监测'"
></ZsyTable>
<ZwyTable
:tableData="zwyData"
v-else-if="name == '灌溉发电洞变形监测'"
></ZwyTable>
</view>
</view>
</template>
<script>
import SlTable from "./slTable.vue"
import ZwyTable from "./zwyTable.vue"
import ZsyTable from "./zsyTable.vue"
import SlTable from "./slTable.vue";
import ZwyTable from "./zwyTable.vue";
import ZsyTable from "./zsyTable.vue";
export default {
components:{
SlTable,
ZwyTable,
ZsyTable
components: {
SlTable,
ZwyTable,
ZsyTable,
},
data() {
return {
slData: [], //
zwyData: [], //
zsyData: [], //
sdData: [], //
fbData: [], //
name: "",
};
},
methods: {
filterStationsByCode(array, config) {
const { prefix, start, end, digitLength = 1 } = config;
console.log("array",array);
return array.filter((item) => {
if (!item.stationCode) return false;
const code = item.stationCode;
if (!code.startsWith(prefix)) return false;
const numStr = code.substring(prefix.length);
const num = parseInt(numStr);
//
if (digitLength > 1 && numStr.length !== digitLength) return false;
return num >= start && num <= end;
});
},
data() {
return {
slData:[], //
zwyData:[],//
zsyData:[],//
sdData:[],//
fbData:[],//
name:'',
async getSlData() {
try {
const { data } = await uni.$http.get(
"/gunshiApp/tsg/osmoticPressR/list/value?type=2"
);
if (data.code == 200) {
this.slData = data.data;
}
} catch (error) {
uni.$showMsg();
}
},
methods: {
async getSlData(){
try {
const {data} = await uni.$http.get('/gunshiApp/tsg/osmoticPressR/list/value?type=2')
if(data.code == 200){
this.slData = data.data;
}
} catch (error) {
uni.$showMsg();
}
},
async getZwyData(){
try {
const {data} = await uni.$http.get('/gunshiApp/tsg/osmoticShiftR/list/value')
if(data.code == 200){
this.zwyData = data.data;
}
} catch (error) {
uni.$showMsg();
}
},
async getzsyData(){
try {
const {data} = await uni.$http.get('/gunshiApp/tsg/osmoticPressR/list/value?type=1')
if(data.code == 200){
const zb = data.data.filter(item => item?.profileName?.split('+')[0] == 'ZB0')
const fb = data.data.filter(item => item?.profileName?.split('+')[0] == 'FB0')
const sd = data.data.filter(item => item?.profileName?.split('+')[0] == 'SD0')
this.zsyData = zb;
this.fbData = fb;
this.sdData = sd;
}
} catch (error) {
uni.$showMsg();
}
},
async getZwyData() {
try {
const { data } = await uni.$http.get(
"/gunshiApp/tsg/osmoticShiftR/list/value"
);
if (data.code == 200) {
let resData = [];
if (this.name == "主坝位移监测") {
resData = this.filterStationsByCode(data.data, {
prefix: "WY-",
start: 1,
end: 27,
digitLength: 2,
});
}else if(this.name == "溢洪道位移监测"){
const wy = this.filterStationsByCode(data.data, {
prefix: "WY-",
start: 28,
end: 31,
digitLength: 2,
});
const zy = this.filterStationsByCode(data.data, {
prefix: "ZY-",
start: 5,
end: 36,
digitLength: 2,
});
resData = [...wy,...zy]
}else if(this.name == "副坝位移监测"){
resData = this.filterStationsByCode(data.data, {
prefix: "ZY-",
start: 1,
end: 4,
digitLength: 2,
});
}else{
resData = data.data.filter(item => item.stationCode == 'WY-32')
}
this.zwyData = resData;
}
} catch (error) {
uni.$showMsg();
}
},
mounted() {
this.getSlData();
this.getZwyData();
this.getzsyData();
async getzsyData() {
try {
const { data } = await uni.$http.get(
"/gunshiApp/tsg/osmoticPressR/list/value?type=1"
);
if (data.code == 200) {
const zb = data.data.filter(
(item) => item?.profileName?.split("+")[0] == "ZB0"
);
const fb = data.data.filter(
(item) => item?.profileName?.split("+")[0] == "FB0"
);
const sd = data.data.filter(
(item) => item?.profileName?.split("+")[0] == "SD0"
);
this.zsyData = zb;
this.fbData = fb;
this.sdData = sd;
}
} catch (error) {
uni.$showMsg();
}
},
onLoad(options) {
this.name=options.name
}
}
},
mounted() {
this.getSlData();
this.getZwyData();
this.getzsyData();
},
onLoad(options) {
this.name = options.name;
},
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -4,7 +4,8 @@
fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar>
<u-tabs :list="list1" @click="click" :current="tabs" style="background-color: #fff;margin-top: 60px;"></u-tabs>
<view style="height:70px"></view>
<u-tabs :list="list1" @click="click" :current="tabs" style="background-color: #fff;"></u-tabs>
<Skjj v-if="tabs == 0" :skInfo="skInfo"></Skjj>
<Jcxx v-if="tabs == 1"></Jcxx>
<!-- 基础信息 -->

View File

@ -94,16 +94,34 @@
this.list = selectData[e]
if (e == 0) {
this.keyObj = this.skInfo;
} else if (e == 1 || e == 2 || e == 6) {
this.getDbData(e)
} else if (e == 3) {
this.getyhdData()
} else if (e == 4 || e == 5) {
this.getfdData(e)
} else {
this.getfxdData(e)
}else{
this.getOtherData()
}
// else if (e == 1 || e == 2 || e == 6) {
// this.getDbData(e)
// } else if (e == 3) {
// this.getyhdData()
// } else if (e == 4 || e == 5) {
// this.getfdData(e)
// } else {
// this.getfxdData(e)
// }
},
async getOtherData() {
try {
const {
data
} = await uni.$http.get('/gunshiApp/tsg/attResBuilding/info')
if (data.code == 200) {
this.keyObj = data.data
}
} catch (error) {
}
},
//
async getDbData(e) {
try {

View File

@ -126,18 +126,34 @@ export default {
mask: true,
});
try {
const { data } = await uni.$http.post("/gunshiApp/tsg/stWaterR/list", {
stcd: this.stcd,
startTime: moment(this.stm).format("YYYY-MM-DD HH:mm:ss"),
endTime: moment(this.etm).format("YYYY-MM-DD HH:mm:ss"),
isAsc: false,
orderField: "tm",
});
const { data } = await uni.$http.post(
"/gunshiApp/tsg/stWaterRReorganize/list",
{
searchType: 1,
startTime: moment(this.stm).format("YYYY-MM-DD HH:mm:ss"),
endTime: moment(this.etm).format("YYYY-MM-DD HH:mm:ss"),
isAsc: false,
orderField: "tm",
}
);
if (data.code == 200) {
uni.hideLoading();
this.tableData = [...data.data];
let newData = [];
if (this.name == "灌溉供水") {
newData = data.data.map((item) => ({
...item,
v: item.ecologyV,
q: item.ecologyQ,
}));
} else {
newData = data.data.map((item) => ({
...item,
v: item.lifeV,
q: item.lifeQ,
}));
}
this.tableData = [...newData];
}
} catch (error) {
uni.$showMsg();

View File

@ -8,7 +8,7 @@ export default function DrpOption(data,num) {
const maxS = Math.ceil(Math.max(...data?.map(s => s.v)));
let eopts = {
title: {
text: `时段总水量:${num.value}${num.unit}`,
text: `时段总水量:${num.value.toFixed(2)}${num.unit || '万'}`,
top: "0%",
right: "12%",
textStyle: {

View File

@ -3,7 +3,7 @@
export default {
0:[{
name: "所在河流(水系)名称",
key: "rvName"
key: "basName"
},
{
name: "倒水全流域面积(km²)",
@ -101,166 +101,166 @@ export default {
1: [
{
name: "坝顶高程(m)",
key:"damTopElev"
key:"mainCrestElevation"
},
{
name: "坝顶长度(m)",
key:"damTopLen"
key:"mainCrestLength"
},
{
name: "坝顶宽度(m)",
key:"damTopWid"
key:"mainCrestWidth"
},
{
name: "最大坝高(m)",
key:"damMaxHeig"
key:"mainMaxHeight"
}
],
2: [
{
name: "坝顶高程(m)",
key:"damTopElev"
key:"auxCrestElevation"
},
{
name: "坝顶长度(m)",
key:"damTopLen"
key:"auxCrestLength"
},
{
name: "坝顶宽度(m)",
key:"damTopWid"
key:"auxCrestWidth"
},
{
name: "最大坝高(m)",
key:"damMaxHeig"
key:"auxMaxHeight"
}
],
3: [
{
name: "堰鼎样式",
key:"crestType"
name: "堰顶型式",
key:"spillwayCrestType"
},
{
name: "地基特性",
key:"foundCharacter"
key:"spillwayFoundation"
},
{
name: "溢流堰顶高程(m)",
key:"crestEle"
key:"spillwayCrestElevation"
},
{
name: "溢流堰净宽(m)",
key:"netWidth"
key:"spillwayNetWidth"
},
{
name: "消能形式",
key:"elimMethod"
key:"spillwayEnergyDissipation"
},
{
name: "校验洪水下泄流量(m³/s)",
key:"caliQ"
key:"spillwayCheckFloodDischarge"
},
{
name: "设计洪水下泄流量(m³/s)",
key:"desQ"
key:"spillwayDesignFloodDischarge"
},
{
name: "消能防冲下泄流量(m³/s)",
key:"elimQ"
key:"spillwayScouringDischarge"
}
],
4: [
{
name: "型式",
key:"buildType"
key:"irrigationType"
},
{
name: "地基特性",
key:"foundCharacter"
key:"irrigationFoundation"
},
{
name: "进口地板高程(m)",
key:"inletEle"
key:"irrigationInletElevation"
},
{
name: "断面尺寸(m)",
key:"sectionSize"
key:"irrigationCrossSection"
},
{
name: "洞长(m)",
key:"tunnelLen"
key:"irrigationLength"
},
{
name: "设计流量(m³/s)",
key:"desQ"
key:"irrigationDesignFlow"
},
{
name: "进口闸门型式",
key:"valveType"
key:"irrigationGateType"
},
{
name: "进口启闭机型式",
key:"ocType"
key:"irrigationHoistType"
}
],
5: [
{
name: "型式",
key:"buildType"
key:"emptyingType"
},
{
name: "衬砌型式",
key:"liningType"
key:"emptyingLiningType"
},
{
name: "地基特性",
key:"foundCharacter"
key:"emptyingFoundation"
},
{
name: "进口地板高程(m)",
key:"inletEle"
key:"emptyingInletElevation"
},
{
name: "断面尺寸(m)",
key:"sectionSize"
key:"emptyingCrossSection"
},
{
name: "洞长(m)",
key:"tunnelLen"
key:"emptyingLength"
},
{
name: "设计流量(m³/s)",
key:"desQ"
key:"emptyingDesignFlow"
},
{
name: "进口闸门型式",
key:"valveType"
key:"emptyingGateType"
},
{
name: "进口启闭机型式",
key:"ocType"
key:"emptyingHoistType"
}
],
6: [
{
name: "坝顶高程(m)",
key:"damTopElev"
key:"floodControlCrestElevation"
},
{
name: "坝顶长度(m)",
key:"damTopLen"
key:"floodControlCrestLength"
},
{
name: "坝顶宽度(m)",
key:"damTopWid"
key:"floodControlCrestWidth"
},
{
name: "最大坝高(m)",
key:"damMaxHeig"
key:"floodControlMaxHeight"
}
],7: [
{
name: "防汛路长度(m)",
key:"floodRoadLen"
key:"roadLength"
},
{
name: "路面宽度(m)",

View File

@ -86,7 +86,7 @@
if (this.info.url) {
this.isStartDownload = true
//App
const baseUrl = `http://local.gunshiiot.com:18083/gunshiApp/tsg/common/download/resource?resource=${this.info.url}`
const baseUrl = `http://223.75.53.141:83/gunshiApp/tsg/common/download/resource?resource=${this.info.url}`
downloadApp(baseUrl, current => {
//
this.hasProgress = true

View File

@ -81,7 +81,7 @@ export function numberFormat(value) {
param.unit = ''
} else {
i = Math.floor(Math.log(value) / Math.log(k));
param.value = ((value / Math.pow(k, i))).toFixed(2);
param.value = ((value / Math.pow(k, i))).toFixed(1);
param.unit = sizes[i];
}
console.log(param)

View File

@ -195,7 +195,7 @@
uploadFilePromise(url, name) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: 'http://local.gunshiiot.com:18083/gunshiApp/tsg/inspect/task/file/upload/singleSimple', //
url: 'http://223.75.53.141:83/gunshiApp/tsg/inspect/task/file/upload/singleSimple', //
filePath: url,
name: 'file',
formData: {

View File

@ -76,8 +76,8 @@
showTime1:false,
start: '请选择开始时间',
end: '请选择结束时间',
stm:moment().startOf('year').format('YYYY-MM-DD'),
etm:moment().format('YYYY-MM-DD'),
stm:'',
etm:'',
list: [
]
};

View File

@ -142,7 +142,7 @@
uploadFilePromise(url,name) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: 'http://local.gunshiiot.com:18083/gunshiApp/tsg/maintain/service/file/upload/singleSimple', //
url: 'http://223.75.53.141:83/gunshiApp/tsg/maintain/service/file/upload/singleSimple', //
filePath: url,
name: 'file',
formData: {

View File

@ -370,7 +370,7 @@
uploadFilePromise(url, name, index, index1) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: 'http://local.gunshiiot.com:18083/gunshiApp/tsg/inspect/task/file/upload/singleSimple', //
url: 'http://223.75.53.141:83/gunshiApp/tsg/inspect/task/file/upload/singleSimple', //
filePath: url,
name: 'file',
formData: {

View File

@ -107,7 +107,7 @@ export default {
uploadFilePromise(url,name) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: 'http://local.gunshiiot.com:18083/gunshiApp/tsg/maintain/service/file/upload/singleSimple', //
url: 'http://223.75.53.141:83/gunshiApp/tsg/maintain/service/file/upload/singleSimple', //
filePath: url,
name: 'file',
formData: {

View File

@ -497,7 +497,6 @@
this.getVideoList();
this.getRainList();
this.getWaterList();
console.log(wgs84ToGcj02(114.7632670,31.4934740))
}
}
</script>