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

View File

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

View File

@ -107,7 +107,7 @@ export default {
uploadFilePromise(url,name) { uploadFilePromise(url,name) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let a = uni.uploadFile({ 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, filePath: url,
name: 'file', name: 'file',
formData: { formData: {

View File

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

View File

@ -1,89 +1,180 @@
<template> <template>
<view class="container"> <view class="container">
<u-navbar :title="name" :autoBack="true" :titleStyle="{ <u-navbar
fontSize:'18px' :title="name"
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'> :autoBack="true"
</u-navbar> :titleStyle="{
<view style="margin-top: 70px; padding: 10px;"> fontSize: '18px',
<SlTable :tableData="slData" v-if="name == '渗流监测'"></SlTable> }"
<ZwyTable :tableData="zwyData" v-else-if="name == ''"></ZwyTable> :height="44"
<ZwyTable :tableData="zwyData" v-else-if="name == ''"></ZwyTable> :safeAreaInsetTop="true"
<ZwyTable :tableData="zwyData" v-else-if="name == ''"></ZwyTable> leftIconSize="20"
<ZsyTable :tableData="zsyData" v-else-if="name == ''"></ZsyTable> leftIconColor="rgb(153, 153, 153)"
<ZsyTable :tableData="sdData" v-else-if="name == ''"></ZsyTable> >
<ZsyTable :tableData="fbData" v-else-if="name == ''"></ZsyTable> </u-navbar>
<ZwyTable :tableData="zwyData" v-else-if="name == ''"></ZwyTable> <view style="margin-top: 70px; padding: 10px">
</view> <SlTable :tableData="slData" v-if="name == '渗流监测'"></SlTable>
</view> <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> </template>
<script> <script>
import SlTable from "./slTable.vue" import SlTable from "./slTable.vue";
import ZwyTable from "./zwyTable.vue" import ZwyTable from "./zwyTable.vue";
import ZsyTable from "./zsyTable.vue" import ZsyTable from "./zsyTable.vue";
export default { export default {
components:{ components: {
SlTable, SlTable,
ZwyTable, ZwyTable,
ZsyTable ZsyTable,
}, },
data() { data() {
return { return {
slData:[], // slData: [], //
zwyData:[],// zwyData: [], //
zsyData:[],// zsyData: [], //
sdData:[],// sdData: [], //
fbData:[],// fbData: [], //
name:'', name: "",
} };
}, },
methods: { methods: {
async getSlData(){ filterStationsByCode(array, config) {
try { const { prefix, start, end, digitLength = 1 } = config;
const {data} = await uni.$http.get('/gunshiApp/tsg/osmoticPressR/list/value?type=2') console.log("array",array);
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') return array.filter((item) => {
const fb = data.data.filter(item => item?.profileName?.split('+')[0] == 'FB0') if (!item.stationCode) return false;
const sd = data.data.filter(item => item?.profileName?.split('+')[0] == 'SD0')
this.zsyData = zb; const code = item.stationCode;
this.fbData = fb; if (!code.startsWith(prefix)) return false;
this.sdData = sd;
} const numStr = code.substring(prefix.length);
} catch (error) { const num = parseInt(numStr);
uni.$showMsg();
} //
}, if (digitLength > 1 && numStr.length !== digitLength) return false;
return num >= start && num <= end;
});
}, },
mounted() { async getSlData() {
this.getSlData(); try {
this.getZwyData(); const { data } = await uni.$http.get(
this.getzsyData(); "/gunshiApp/tsg/osmoticPressR/list/value?type=2"
);
if (data.code == 200) {
this.slData = data.data;
}
} catch (error) {
uni.$showMsg();
}
}, },
onLoad(options) { async getZwyData() {
this.name=options.name 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();
}
},
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();
}
},
},
mounted() {
this.getSlData();
this.getZwyData();
this.getzsyData();
},
onLoad(options) {
this.name = options.name;
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
</style> </style>

View File

@ -4,7 +4,8 @@
fontSize:'18px' fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'> }" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar> </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> <Skjj v-if="tabs == 0" :skInfo="skInfo"></Skjj>
<Jcxx v-if="tabs == 1"></Jcxx> <Jcxx v-if="tabs == 1"></Jcxx>
<!-- 基础信息 --> <!-- 基础信息 -->

View File

@ -94,16 +94,34 @@
this.list = selectData[e] this.list = selectData[e]
if (e == 0) { if (e == 0) {
this.keyObj = this.skInfo; this.keyObj = this.skInfo;
} else if (e == 1 || e == 2 || e == 6) { }else{
this.getDbData(e) this.getOtherData()
} else if (e == 3) { }
this.getyhdData() // else if (e == 1 || e == 2 || e == 6) {
} else if (e == 4 || e == 5) { // this.getDbData(e)
this.getfdData(e) // } else if (e == 3) {
} else { // this.getyhdData()
this.getfxdData(e) // } 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) { async getDbData(e) {
try { try {

View File

@ -126,18 +126,34 @@ export default {
mask: true, mask: true,
}); });
try { try {
const { data } = await uni.$http.post("/gunshiApp/tsg/stWaterR/list", { const { data } = await uni.$http.post(
stcd: this.stcd, "/gunshiApp/tsg/stWaterRReorganize/list",
startTime: moment(this.stm).format("YYYY-MM-DD HH:mm:ss"), {
endTime: moment(this.etm).format("YYYY-MM-DD HH:mm:ss"), searchType: 1,
isAsc: false, startTime: moment(this.stm).format("YYYY-MM-DD HH:mm:ss"),
orderField: "tm", endTime: moment(this.etm).format("YYYY-MM-DD HH:mm:ss"),
}); isAsc: false,
orderField: "tm",
}
);
if (data.code == 200) { if (data.code == 200) {
uni.hideLoading(); uni.hideLoading();
let newData = [];
this.tableData = [...data.data]; 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) { } catch (error) {
uni.$showMsg(); 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))); const maxS = Math.ceil(Math.max(...data?.map(s => s.v)));
let eopts = { let eopts = {
title: { title: {
text: `时段总水量:${num.value}${num.unit}`, text: `时段总水量:${num.value.toFixed(2)}${num.unit || '万'}`,
top: "0%", top: "0%",
right: "12%", right: "12%",
textStyle: { textStyle: {

View File

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

View File

@ -86,7 +86,7 @@
if (this.info.url) { if (this.info.url) {
this.isStartDownload = true this.isStartDownload = true
//App //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 => { downloadApp(baseUrl, current => {
// //
this.hasProgress = true this.hasProgress = true

View File

@ -81,7 +81,7 @@ export function numberFormat(value) {
param.unit = '' param.unit = ''
} else { } else {
i = Math.floor(Math.log(value) / Math.log(k)); 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]; param.unit = sizes[i];
} }
console.log(param) console.log(param)

View File

@ -195,7 +195,7 @@
uploadFilePromise(url, name) { uploadFilePromise(url, name) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let a = uni.uploadFile({ 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, filePath: url,
name: 'file', name: 'file',
formData: { formData: {

View File

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

View File

@ -142,7 +142,7 @@
uploadFilePromise(url,name) { uploadFilePromise(url,name) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let a = uni.uploadFile({ 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, filePath: url,
name: 'file', name: 'file',
formData: { formData: {

View File

@ -370,7 +370,7 @@
uploadFilePromise(url, name, index, index1) { uploadFilePromise(url, name, index, index1) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let a = uni.uploadFile({ 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, filePath: url,
name: 'file', name: 'file',
formData: { formData: {

View File

@ -107,7 +107,7 @@ export default {
uploadFilePromise(url,name) { uploadFilePromise(url,name) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let a = uni.uploadFile({ 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, filePath: url,
name: 'file', name: 'file',
formData: { formData: {

View File

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