样式更新

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>
</view>
<view class="uni-form-item uni-column">
<radio-group name="radio" class="radio-group" @change="radioChange">
<label class="radio-label">
<radio value="radio1" color="#0f6efe" class="radio-item" />
<text class="radio-text"></text>
</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>
<radio-group class="radio-group" @change="radioChange">
<label class="radio-label" v-for="(item, index) in timList" :key="item.value">
<radio :value="item.value" :checked="index === current" />
<view>{{item.name}}</view>
</label>
</radio-group>
</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">
<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 class="znyj">
@ -132,6 +133,9 @@
uniEcCanvas,
},
data() {
const currentDate = this.getDate({
format: true
})
return {
height: 0,
scorllheight: 0,
@ -145,64 +149,38 @@
list: [],
tabList: ['站点名称', '告警指标', '指标值', '告警时间'],
pjlist: [],
ec: {
option: {
title: {
subtext: '(单位mg/l)'
},
grid: {
top: "45",
left: "5",
bottom: "5",
right: "25",
containLabel: true,
},
tooltip: {
trigger: 'axis',
position: [20, 20],
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
},
legend: {
icon: 'roundRect',
itemHeight: 10,
itemWidth: 10,
right: '10%',
top: '10%',
textStyle: {
//
fontSize: 10,
},
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: []
chartData: {},
opts: {
color: ["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],
padding: [15,10,0,15],
dataLabel: false,
dataPointShape: false,
enableScroll: true,
legend: {},
xAxis: {
disableGrid: true,
scrollShow: true,
itemCount: 4
},
yAxis: {
gridType: "dash",
dashLength: 2,
data: [
{
min: 0,
max: 150
}
]
},
extra: {
line: {
type: "curve",
width: 2,
activeType: "hollow",
linearType: "custom",
onShadow: true,
animation: "horizontal"
}
}
},
pjnr: '',
@ -222,7 +200,25 @@
stationCode1: null,
stationCode: '',
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() {
@ -240,7 +236,8 @@
this.getpj()
this.getazsurvMulchRecord()
this.getyjList()
this.gettj()
// this.gettj()
this.qushicov()
},
methods: {
//
@ -390,15 +387,100 @@
},
//
radioChange(e){
console.log("选择年月日.......",e)
let data = {
summrayMode:'dayhours',
startTime:'2025-11-20',
endTime:'endTime'
this.riqinumber = e.detail.value
console.log("0000000000000",this.datetwo)
this.bindDateqsChange(this.datetwo,'twotime')
},
//
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() {
@ -608,7 +690,8 @@
this.stationCode = this.arrays[i].value
}
}
this.gettj()
// this.gettj()
this.qushicov()
},
//
bindPickerChange1: function(e) {
@ -632,6 +715,21 @@
this.pageNo = 1
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>
@ -1039,4 +1137,14 @@
}
}
}
.qstim{
width: 40%;
display: block;
margin: 0 auto;
margin-top: 20rpx;
}
.qstim image {
width: 44rpx;
height: 44rpx;
}
</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>