样式更新

This commit is contained in:
978184212@qq.com 2025-11-27 14:37:33 +08:00
parent 9ee7ff809b
commit e4c8f8c24d
3 changed files with 92 additions and 24 deletions

View File

@ -164,18 +164,10 @@
enableScroll: false, enableScroll: false,
legend: {}, legend: {},
xAxis: { xAxis: {
// X disabled: false, // X
disabled: true, // X // itemCount
itemCount: 3, gridType: 'dash', //
// dashLength: 2,
// disableGrid: true, // 线
// type: 'grid', //
// gridType: 'dash', // 线
// itemCount: 3, //
// scrollShow: true, //
// scrollAlign: 'left', //
// scrollBackgroundColor: '#F7F7FF', //
// scrollColor: '#DEE7F7' //
}, },
yAxis: { yAxis: {
gridType: "dash", gridType: "dash",
@ -403,7 +395,6 @@
// //
radioChange(e){ radioChange(e){
this.riqinumber = e.detail.value this.riqinumber = e.detail.value
console.log("0000000000000",this.datetwo)
this.bindDateqsChange(this.datetwo,'twotime') this.bindDateqsChange(this.datetwo,'twotime')
}, },
// //
@ -431,24 +422,38 @@
this.qushicov(); this.qushicov();
}, },
// //
// qushicov
qushicov() { qushicov() {
let data = { let data = {
summrayMode: this.riqinumber, summrayMode: this.riqinumber,
startTime: this.dateqs, startTime: this.dateqs,
} }
this.$http.post('/applet/survDeviceDeploy/waterIntegrateStatistic', data).then(iem => { this.$http.post('/applet/survDeviceDeploy/waterIntegrateStatistic', data).then(iem => {
console.log("接口返回数据", iem)
let lynum = iem.data.data let lynum = iem.data.data
setTimeout(() => { setTimeout(() => {
let categories = []; let categories = [];
let displayCategories = []; // X
let series = []; let series = [];
let allValues = []; // let allValues = []; //
if (lynum.tableHead && lynum.tableHead.length > 0) { if (lynum.tableHead && lynum.tableHead.length > 0) {
categories = lynum.tableIndex; categories = lynum.tableIndex;
// X
if (categories.length > 0) {
const first = categories[0];
const middle = categories[Math.floor(categories.length / 2)];
const last = categories[categories.length - 3];
// categories
displayCategories = categories.map((item, index) => {
if (index === 0 || index === Math.floor(categories.length / 2) || index === categories.length - 2) {
return item;
}
return '';
});
}
lynum.tableHead.forEach((header, index) => { lynum.tableHead.forEach((header, index) => {
const seriesData = lynum.tableData2.map(row => { const seriesData = lynum.tableData2.map(row => {
const value = row[index] === "0" ? 0 : parseFloat(row[index]) || 0; const value = row[index] === "0" ? 0 : parseFloat(row[index]) || 0;
@ -488,11 +493,9 @@
} }
let res = { let res = {
categories: categories, categories: displayCategories, // 使
series: series series: series
}; };
console.log("处理后的图表数据", res);
this.chartData = JSON.parse(JSON.stringify(res)); this.chartData = JSON.parse(JSON.stringify(res));
}, 500); }, 500);
}) })

View File

@ -2,17 +2,25 @@
<view class="container"> <view class="container">
<view class="form"> <view class="form">
<view class="form_item" v-if="details.stationName"> <view class="form_item" v-if="details.stationName">
<view class="left">选择站点:</view> <view class="left">站点名称:</view>
<view class="nr">{{details.stationName}}</view> <view class="nr">{{details.stationName}}</view>
</view> </view>
<view class="form_item" v-if="details.omName"> <view class="form_item" v-if="details.maintainData3">
<view class="left">维护内容:</view> <view class="left">站点位置:</view>
<view class="nr">{{details.omName}}</view> <view class="nr">{{details.maintainData3}}</view>
</view>
<view class="form_item" v-if="details.maintainData1">
<view class="left">检测情况:</view>
<view class="nr">{{details.maintainData1}}</view>
</view> </view>
<view class="form_item" v-if="details.maintainPerson"> <view class="form_item" v-if="details.maintainPerson">
<view class="left">负责人:</view> <view class="left">负责人:</view>
<view class="nr">{{details.maintainPerson}}</view> <view class="nr">{{details.maintainPerson}}</view>
</view> </view>
<view class="form_item" v-if="details.maintainData2">
<view class="left">联系方式:</view>
<view class="nr">{{details.maintainData2}}</view>
</view>
<view class="form_item" v-if="details.maintainTime"> <view class="form_item" v-if="details.maintainTime">
<view class="left">维护时间:</view> <view class="left">维护时间:</view>
<view class="nr">{{details.maintainTime}}</view> <view class="nr">{{details.maintainTime}}</view>
@ -43,6 +51,9 @@
maintainPerson:'', maintainPerson:'',
maintainTime:'', maintainTime:'',
maintainNote:'', maintainNote:'',
maintainData1:'',
maintainData2:'',
maintainData3:'',
omName:'' omName:''
} }
} }

View File

@ -37,6 +37,19 @@
</view> </view>
<input type="text" placeholder="请输入运维人姓名" v-model="details.maintainPerson"> <input type="text" placeholder="请输入运维人姓名" v-model="details.maintainPerson">
</view> </view>
<view class="form_item">
<view class="form_top">
联系方式:
</view>
<input
type="text"
placeholder="请输入联系方式"
v-model="details.maintainData2"
@blur="validatePhone"
maxlength="11"
/>
<view class="error-text" v-if="phoneError">{{phoneError}}</view>
</view>
<view class="form_item"> <view class="form_item">
<view class="form_top"> <view class="form_top">
维护时间: 维护时间:
@ -100,11 +113,11 @@
tag:'', tag:'',
hobby: [], hobby: [],
checkbox1: [], checkbox1: [],
reload:'true' reload:'true',
phoneError: '', //
} }
}, },
onLoad(options) { onLoad(options) {
console.log("00000000",JSON.parse(decodeURIComponent(options.item)))
this.details = JSON.parse(decodeURIComponent(options.item)); this.details = JSON.parse(decodeURIComponent(options.item));
}, },
onShow() { onShow() {
@ -112,6 +125,25 @@
this.getazsurvMulchRecord1() this.getazsurvMulchRecord1()
}, },
methods:{ methods:{
//
validatePhone() {
const phone = this.details.maintainData2;
if (!phone) {
this.phoneError = '';
return true;
}
//
const phoneRegex = /^1[3-9]\d{9}$/;
if (!phoneRegex.test(phone)) {
this.phoneError = '请输入正确的手机号码';
return false;
} else {
this.phoneError = '';
return true;
}
},
// //
getazsurvMulchRecord(){ getazsurvMulchRecord(){
this.array = [] this.array = []
@ -184,6 +216,23 @@
}) })
return return
} }
if(!this.details.maintainData2){
uni.showToast({
title: "请输入联系方式",
icon: 'none',
duration: 2000
})
return
}
//
if (!this.validatePhone()) {
uni.showToast({
title: "请输入正确的手机号码",
icon: 'none',
duration: 2000
})
return;
}
if(!this.details.maintainTime){ if(!this.details.maintainTime){
uni.showToast({ uni.showToast({
title: "请选择维护时间", title: "请选择维护时间",
@ -316,4 +365,9 @@
text-align: center; text-align: center;
color: #0472e3; color: #0472e3;
} }
.error-text {
color: #ff0000;
font-size: 24rpx;
margin-top: 10rpx;
}
</style> </style>