样式更新

This commit is contained in:
978184212@qq.com 2025-11-21 19:03:05 +08:00
parent 3b2eaa75ef
commit b5cd18e351
2 changed files with 299 additions and 83 deletions

View File

@ -34,23 +34,24 @@
</picker> </picker>
</view> </view>
<view class="uni-form-item uni-column"> <view class="uni-form-item uni-column">
<radio-group name="radio" class="radio-group" @change="radioChange"> <radio-group class="radio-group" @change="radioChange">
<label class="radio-label"> <label class="radio-label" v-for="(item, index) in timList" :key="item.value">
<radio value="radio1" color="#0f6efe" class="radio-item" /> <radio :value="item.value" :checked="index === current" />
<text class="radio-text"></text> <view>{{item.name}}</view>
</label>
<label class="radio-label">
<radio value="radio2" color="#0f6efe" class="radio-item" />
<text class="radio-text"></text>
</label>
<label class="radio-label">
<radio value="radio3" color="#0f6efe" class="radio-item" />
<text class="radio-text"></text>
</label> </label>
</radio-group> </radio-group>
</view> </view>
<view class="uni-list-cell-db qstim">
<picker mode="date" :value="dateqs" :start="startDate" :end="endDate" @change="bindDateqsChange">
<view class="uni-input">{{dateqs}} <image src="../../static/data_btn_sanjiao_xia.png"></image></view>
</picker>
</view>
<view class="qstcontent"> <view class="qstcontent">
<uni-ec-canvas :ec="ec" canvas-id="multi-charts-pie"></uni-ec-canvas> <qiun-data-charts
type="line"
:opts="opts"
:chartData="chartData"
/>
</view> </view>
</view> </view>
<view class="znyj"> <view class="znyj">
@ -132,6 +133,9 @@
uniEcCanvas, uniEcCanvas,
}, },
data() { data() {
const currentDate = this.getDate({
format: true
})
return { return {
height: 0, height: 0,
scorllheight: 0, scorllheight: 0,
@ -145,64 +149,38 @@
list: [], list: [],
tabList: ['站点名称', '告警指标', '指标值', '告警时间'], tabList: ['站点名称', '告警指标', '指标值', '告警时间'],
pjlist: [], pjlist: [],
ec: { chartData: {},
option: { opts: {
title: { color: ["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],
subtext: '(单位mg/l)' padding: [15,10,0,15],
}, dataLabel: false,
grid: { dataPointShape: false,
top: "45", enableScroll: true,
left: "5", legend: {},
bottom: "5", xAxis: {
right: "25", disableGrid: true,
containLabel: true, scrollShow: true,
}, itemCount: 4
tooltip: { },
trigger: 'axis', yAxis: {
position: [20, 20], gridType: "dash",
axisPointer: { dashLength: 2,
type: 'cross', data: [
label: { {
backgroundColor: '#6a7985' min: 0,
} max: 150
} }
}, ]
legend: { },
icon: 'roundRect', extra: {
itemHeight: 10, line: {
itemWidth: 10, type: "curve",
right: '10%', width: 2,
top: '10%', activeType: "hollow",
textStyle: { linearType: "custom",
// onShadow: true,
fontSize: 10, animation: "horizontal"
}, }
data: []
},
color: [],
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: [{
type: 'category',
boundaryGap: false,
axisLabel: {
//x
show: true,
interval: 0, //使x
color: '#999999',
},
data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月',
'12月'
],
}],
yAxis: [{
type: 'value'
}],
series: []
} }
}, },
pjnr: '', pjnr: '',
@ -222,7 +200,25 @@
stationCode1: null, stationCode1: null,
stationCode: '', stationCode: '',
arrays1: [], arrays1: [],
zxtdata: [] zxtdata: [],
timList: [{
value: 'yearMonth',
name: '年',
checked: 'true'
},
{
value: 'monthDays',
name: '月'
},
{
value: 'dayhours',
name: '日'
},
],
current: 0,
dateqs:new Date().getFullYear(),
datetwo:currentDate,
riqinumber:'yearMonth',
} }
}, },
onLoad() { onLoad() {
@ -240,7 +236,8 @@
this.getpj() this.getpj()
this.getazsurvMulchRecord() this.getazsurvMulchRecord()
this.getyjList() this.getyjList()
this.gettj() // this.gettj()
this.qushicov()
}, },
methods: { methods: {
// //
@ -390,15 +387,100 @@
}, },
// //
radioChange(e){ radioChange(e){
console.log("选择年月日.......",e) this.riqinumber = e.detail.value
let data = { console.log("0000000000000",this.datetwo)
summrayMode:'dayhours', this.bindDateqsChange(this.datetwo,'twotime')
startTime:'2025-11-20', },
endTime:'endTime' //
bindDateqsChange(e,tiem) {
if (tiem=='twotime') {
let selectedDate = e
if (this.riqinumber === 'monthDays') {
this.dateqs = selectedDate.slice(0, 7); // YYYY-MM
} else if (this.riqinumber === 'yearMonth') {
this.dateqs = selectedDate.slice(0, 4); // YYYY
} else {
this.dateqs = selectedDate; // YYYY-MM-DD
}
} else {
let selectedDate = e.detail.value;
if (this.riqinumber === 'monthDays') {
this.dateqs = selectedDate.slice(0, 7); // YYYY-MM
} else if (this.riqinumber === 'yearMonth') {
this.dateqs = selectedDate.slice(0, 4); // YYYY
} else {
this.dateqs = selectedDate; // YYYY-MM-DD
}
} }
this.$http.get('/applet/survDeviceDeploy/waterIntegrateStatistic',data).then(res => {
console.log("66666666666",res) 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 series = [];
let allValues = []; //
if (lynum.tableHead && lynum.tableHead.length > 0) {
categories = lynum.tableIndex;
lynum.tableHead.forEach((header, index) => {
const seriesData = lynum.tableData2.map(row => {
const value = row[index] === "0" ? 0 : parseFloat(row[index]) || 0;
allValues.push(value); //
return value;
});
series.push({
name: header.eleDesc,
data: seriesData
});
});
// Y
const maxValue = Math.max(...allValues);
const minValue = Math.min(...allValues);
//
const padding = maxValue * 0.1; // 10%
const yAxisMax = maxValue + padding;
const yAxisMin = Math.max(0, minValue - padding); // 0
// optsyAxis
this.opts = {
...this.opts,
yAxis: {
gridType: "dash",
dashLength: 2,
data: [
{
min: yAxisMin,
max: yAxisMax
}
]
}
};
}
let res = {
categories: categories,
series: series
};
console.log("处理后的图表数据", res);
this.chartData = JSON.parse(JSON.stringify(res));
}, 500);
})
}, },
// 线 // 线
gettj() { gettj() {
@ -608,7 +690,8 @@
this.stationCode = this.arrays[i].value this.stationCode = this.arrays[i].value
} }
} }
this.gettj() // this.gettj()
this.qushicov()
}, },
// //
bindPickerChange1: function(e) { bindPickerChange1: function(e) {
@ -632,6 +715,21 @@
this.pageNo = 1 this.pageNo = 1
this.getyjList() this.getyjList()
}, },
getDate(type) {
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
if (type === 'start') {
year = year - 10;
} else if (type === 'end') {
year = year + 10;
}
month = month > 9 ? month : '0' + month;
day = day > 9 ? day : '0' + day;
return `${year}-${month}-${day}`;
}
} }
} }
</script> </script>
@ -1039,4 +1137,14 @@
} }
} }
} }
.qstim{
width: 40%;
display: block;
margin: 0 auto;
margin-top: 20rpx;
}
.qstim image {
width: 44rpx;
height: 44rpx;
}
</style> </style>

View File

@ -253,4 +253,112 @@
}, },
} }
} }
</script> </script>
<style lang="scss">
.bgimg {
position: fixed;
// z-index: -99;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.customCallout {
width: 349rpx;
height: 49rpx;
color: #fff;
font-size: 24rpx;
text-shadow: 1rpx 2rpx 0rpx #0D1934;
font-weight: bold;
// background-image: url('@/static/zhandian_icon_nongtian_title.png');
background-repeat: no-repeat;
background-size: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.customCallout1 {
width: 349rpx;
height: 49rpx;
color: #fff;
font-size: 24rpx;
text-shadow: 1rpx 2rpx 0rpx #0D1934;
font-weight: bold;
// background-image: url('@/static/zhandian_icon_xuqin_title.png');
background-repeat: no-repeat;
background-size: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.zdxq {
position: fixed;
left: 33rpx;
bottom: 36rpx;
}
.zdxqitem {
padding: 8rpx 0 7rpx 17rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 22rpx;
font-family: Source Han Sans SC;
font-weight: 500;
color: #FFFFFF;
text-shadow: 0rpx 1rpx 0rpx rgba(4, 49, 52, 0.55);
width: 359rpx;
background: rgba(0, 0, 0, 0.52);
border: 1px solid #4B677C;
border-radius: 6rpx;
margin-bottom: 10rpx;
position: relative;
}
.crildon {
width: 10rpx;
height: 10rpx;
border-radius: 50%;
margin-right: 15rpx;
}
.zdxqitem:last-child {
margin-bottom: 0;
}
.zdxqitem image {
width: 33rpx;
height: 50rpx;
margin-right: 15rpx;
}
.zdxqitem:first-child image {
width: 30rpx;
height: 40rpx;
margin-right: 15rpx;
}
.textss {
flex: 1;
text-align: left;
}
.imgs {
position: absolute;
width: 100%;
height: 100%;
z-index: -9;
}
.switchs {
position: fixed;
top: 36rpx;
right: 40rpx;
display: flex;
align-items: center;
}
</style>