样式更新
This commit is contained in:
parent
9ee7ff809b
commit
e4c8f8c24d
|
|
@ -164,18 +164,10 @@
|
|||
enableScroll: false,
|
||||
legend: {},
|
||||
xAxis: {
|
||||
// X全显示
|
||||
disabled: true, // 禁用默认X轴
|
||||
itemCount: 3,
|
||||
// 可滚动
|
||||
// disableGrid: true, // 禁用网格线
|
||||
// type: 'grid', // 网格类型
|
||||
// gridType: 'dash', // 虚线样式
|
||||
// itemCount: 3, // 单屏显示数据数量
|
||||
// scrollShow: true, // 显示滚动条
|
||||
// scrollAlign: 'left', // 滚动条初始位置
|
||||
// scrollBackgroundColor: '#F7F7FF', // 滚动条背景色
|
||||
// scrollColor: '#DEE7F7' // 滚动条颜色
|
||||
disabled: false, // 启用X轴
|
||||
// 不设置itemCount,因为我们自定义显示的数据
|
||||
gridType: 'dash', // 网格类型
|
||||
dashLength: 2,
|
||||
},
|
||||
yAxis: {
|
||||
gridType: "dash",
|
||||
|
|
@ -403,7 +395,6 @@
|
|||
// 选择年月日
|
||||
radioChange(e){
|
||||
this.riqinumber = e.detail.value
|
||||
console.log("0000000000000",this.datetwo)
|
||||
this.bindDateqsChange(this.datetwo,'twotime')
|
||||
},
|
||||
// 趋势时间
|
||||
|
|
@ -431,24 +422,38 @@
|
|||
this.qushicov();
|
||||
},
|
||||
// 趋势接口
|
||||
// 在 qushicov 方法中修改
|
||||
qushicov() {
|
||||
let data = {
|
||||
summrayMode: this.riqinumber,
|
||||
startTime: this.dateqs,
|
||||
}
|
||||
this.$http.post('/applet/survDeviceDeploy/waterIntegrateStatistic', data).then(iem => {
|
||||
console.log("接口返回数据", iem)
|
||||
let lynum = iem.data.data
|
||||
|
||||
setTimeout(() => {
|
||||
let categories = [];
|
||||
let displayCategories = []; // 用于显示的X轴数据
|
||||
let series = [];
|
||||
let allValues = []; // 收集所有数值
|
||||
|
||||
if (lynum.tableHead && lynum.tableHead.length > 0) {
|
||||
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) => {
|
||||
const seriesData = lynum.tableData2.map(row => {
|
||||
const value = row[index] === "0" ? 0 : parseFloat(row[index]) || 0;
|
||||
|
|
@ -488,11 +493,9 @@
|
|||
}
|
||||
|
||||
let res = {
|
||||
categories: categories,
|
||||
categories: displayCategories, // 使用处理后的显示数据
|
||||
series: series
|
||||
};
|
||||
|
||||
console.log("处理后的图表数据", res);
|
||||
this.chartData = JSON.parse(JSON.stringify(res));
|
||||
}, 500);
|
||||
})
|
||||
|
|
|
|||
|
|
@ -2,17 +2,25 @@
|
|||
<view class="container">
|
||||
<view class="form">
|
||||
<view class="form_item" v-if="details.stationName">
|
||||
<view class="left">选择站点:</view>
|
||||
<view class="left">站点名称:</view>
|
||||
<view class="nr">{{details.stationName}}</view>
|
||||
</view>
|
||||
<view class="form_item" v-if="details.omName">
|
||||
<view class="left">维护内容:</view>
|
||||
<view class="nr">{{details.omName}}</view>
|
||||
<view class="form_item" v-if="details.maintainData3">
|
||||
<view class="left">站点位置:</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 class="form_item" v-if="details.maintainPerson">
|
||||
<view class="left">负责人:</view>
|
||||
<view class="nr">{{details.maintainPerson}}</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="left">维护时间:</view>
|
||||
<view class="nr">{{details.maintainTime}}</view>
|
||||
|
|
@ -43,6 +51,9 @@
|
|||
maintainPerson:'',
|
||||
maintainTime:'',
|
||||
maintainNote:'',
|
||||
maintainData1:'',
|
||||
maintainData2:'',
|
||||
maintainData3:'',
|
||||
omName:''
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,19 @@
|
|||
</view>
|
||||
<input type="text" placeholder="请输入运维人姓名" v-model="details.maintainPerson">
|
||||
</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_top">
|
||||
维护时间:
|
||||
|
|
@ -100,11 +113,11 @@
|
|||
tag:'',
|
||||
hobby: [],
|
||||
checkbox1: [],
|
||||
reload:'true'
|
||||
reload:'true',
|
||||
phoneError: '', // 添加错误提示信息
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
console.log("00000000",JSON.parse(decodeURIComponent(options.item)))
|
||||
this.details = JSON.parse(decodeURIComponent(options.item));
|
||||
},
|
||||
onShow() {
|
||||
|
|
@ -112,6 +125,25 @@
|
|||
this.getazsurvMulchRecord1()
|
||||
},
|
||||
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(){
|
||||
this.array = []
|
||||
|
|
@ -184,6 +216,23 @@
|
|||
})
|
||||
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){
|
||||
uni.showToast({
|
||||
title: "请选择维护时间",
|
||||
|
|
@ -316,4 +365,9 @@
|
|||
text-align: center;
|
||||
color: #0472e3;
|
||||
}
|
||||
.error-text {
|
||||
color: #ff0000;
|
||||
font-size: 24rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue