From cd1eb4f48fbbba55154e9aec80ec93f48e9c075b Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 03 七月 2025 11:03:37 +0800
Subject: [PATCH] 代码初始化
---
admin/src/views/index.vue | 73 ++++++++++++++++++++++++++++--------
1 files changed, 57 insertions(+), 16 deletions(-)
diff --git a/admin/src/views/index.vue b/admin/src/views/index.vue
index 687f6f2..db6abe6 100644
--- a/admin/src/views/index.vue
+++ b/admin/src/views/index.vue
@@ -34,8 +34,8 @@
-->
</div>
<div class="content">
- <div>鏈В鍐筹細{{ headerData.dbhYesNum || 0}}</div>
- <div>宸茶В鍐筹細{{ headerData.dbhNoNum || 0}}</div>
+ <div>鏈В鍐筹細{{ headerData.dbhNoNum || 0}}</div>
+ <div>宸茶В鍐筹細{{ headerData.dbhYesNum || 0}}</div>
<div>鎬诲伐鍗曢噺锛歿{ headerData.dbhNum || 0}}</div>
</div>
</div>
@@ -62,8 +62,8 @@
<!-- <img src="@/assets/images/bg_a.png" alt="" />-->
</div>
<div class="content">
- <div>鏈В鍐筹細{{ headerData.dcaChildYesNum || 0}}</div>
- <div>宸茶В鍐筹細{{ headerData.dcaChildNoNum || 0}}</div>
+ <div>鏈В鍐筹細{{ headerData.dcaChildNoNum || 0}}</div>
+ <div>宸茶В鍐筹細{{ headerData.dcaChildYesNum || 0}}</div>
<div>鎬诲伐鍗曢噺锛歿{ headerData.dcaChildNum || 0}}</div>
</div>
</div>
@@ -72,7 +72,17 @@
<div class="df mb50" >
<div class="wrap static1">
<div class="header" style="text-align: center">
- <div class="home_title" style="text-align: center;width: 100%">鍚勭被鍨嬪伐鍗曞崰姣旂粺璁�</div>
+ <div class="home_title" style="text-align: center;width: 80%">鍚勭被鍨嬪伐鍗曞崰姣旂粺璁★紙{{searchForm.timeName}}锛�</div>
+ <div style="text-align: right;width: 150px;font-size: 12px;height: 25px">
+ <el-form :model="searchForm" label-width="100px" inline >
+ <el-select v-model="searchForm.timeType" :popper-append-to-body="true" clearable placeholder="鏃堕棿鑼冨洿" @change="reloadDataByType()">
+ <el-option value="0" label="鏈懆"/>
+ <el-option value="1" label="鏈湀"/>
+ <el-option value="2" label="鏈搴�"/>
+ <el-option value="3" label="鏈勾"/>
+ </el-select>
+ </el-form>
+ </div>
</div>
<div class="echart" style="height: 400px" >
<div id="circleChart0"></div>
@@ -135,10 +145,15 @@
},
data () {
return {
+ searchForm: {
+ timeType: null,
+ timeName: '鍏ㄩ儴'
+ },
colors,
nowDate: '',
nowWeek: '',
headerData: {},
+ headerData1: {},
staticData0: {},
staticData01: {},
staticData1: {},
@@ -169,6 +184,23 @@
this.getWorkBody2()
this.getWorkBody3()
// this.getWorkBody()
+ },
+ reloadDataByType () {
+ getIndexData({timeType: this.searchForm.timeType }).then(res => {
+ if (this.searchForm.timeType == '0') {
+ this.searchForm.timeName = '鏈懆'
+ } else if (this.searchForm.timeType =='1') {
+ this.searchForm.timeName = '鏈湀'
+ } else if (this.searchForm.timeType =='2') {
+ this.searchForm.timeName = '鏈搴�'
+ } else if (this.searchForm.timeType == '3') {
+ this.searchForm.timeName = '鏈勾'
+ } else {
+ this.searchForm.timeName = '鍏ㄩ儴'
+ }
+ this.headerData1 =res || []
+ this.initAllData()
+ })
},
getWorkBody0 () {
getWorkOrderData({ queryType: 0, orderType: 0 }).then(res => {
@@ -213,18 +245,22 @@
getWorkHead () {
getIndexData({ }).then(res => {
this.headerData = res || {}
- var cdata = []
- cdata.push({ name: '璺岀粖婊戜簨浠�', value: res.dbhNum || 0 })
- cdata.push({ name: 'DCA浜嬩欢', value: res.dcaChildNum || 0 })
- cdata.push({ name: 'SHE浜嬩欢', value: res.sheNum || 0 })
- this.initEchartCircleDo('circleChart0', '鍚勭被鍨嬩簨浠跺伐鍗曚笂鎶ョ粺璁�', '', cdata)
- var xdata = ['SHE浜嬩欢', '璺岀粖婊戜簨浠�', 'DCA浜嬩欢']
- var ydata = []
- ydata.push({ name: '宸茶В鍐�', stack: 'cateNum', type: 'bar', unit: '椤�', color: '#f07e6f', data: [res.sheNum || 0, res.dbhYesNum || 0, res.dcaChildYesNum || 0] })
- ydata.push({ name: '鏈В鍐�', stack: 'cateNum', type: 'bar', unit: '椤�', color: '#8383ff', data: [0, res.dbhNoNum || 0, res.dcaChildNoNum || 0] })
- ydata.push({ name: '鎬诲崟閲�', type: 'bar', unit: '娆�', color: '#29aeff', data: [res.sheNum || 0, res.dbhNum || 0, res.dcaChildNum || 0] })
- this.initEchartDataDo('鍚勭被鍨嬩簨浠剁姸鎬佺粺璁�', 'circleChart1', xdata, ydata)
+ this.headerData1 = res || {}
+ this.initAllData()
})
+ },
+ initAllData(){
+ var cdata = []
+ cdata.push({ name: '璺岀粖婊戜簨浠�', value: this.headerData1.dbhNum || 0 })
+ cdata.push({ name: 'DCA浜嬩欢', value: this.headerData1.dcaChildNum || 0 })
+ cdata.push({ name: 'SHE浜嬩欢', value: this.headerData1.sheNum || 0 })
+ this.initEchartCircleDo('circleChart0', '鍚勭被鍨嬩簨浠跺伐鍗曚笂鎶ョ粺璁�', '', cdata)
+ var xdata = ['SHE浜嬩欢', '璺岀粖婊戜簨浠�', 'DCA浜嬩欢']
+ var ydata = []
+ ydata.push({ name: '宸茶В鍐�', stack: 'cateNum', type: 'bar', unit: '椤�', color: '#f07e6f', data: [this.headerData1.sheNum || 0, this.headerData1.dbhYesNum || 0, this.headerData1.dcaChildYesNum || 0] })
+ ydata.push({ name: '鏈В鍐�', stack: 'cateNum', type: 'bar', unit: '椤�', color: '#8383ff', data: [0, this.headerData1.dbhNoNum || 0, this.headerData1.dcaChildNoNum || 0] })
+ ydata.push({ name: '鎬诲崟閲�', type: 'bar', unit: '娆�', color: '#29aeff', data: [this.headerData1.sheNum || 0, this.headerData1.dbhNum || 0, this.headerData1.dcaChildNum || 0] })
+ this.initEchartDataDo('鍚勭被鍨嬩簨浠剁姸鎬佺粺璁�', 'circleChart1', xdata, ydata)
},
updateDate () {
this.nowDate = dayjs().format('YYYY骞碝鏈圖鏃�')
@@ -477,6 +513,11 @@
</script>
<style lang="scss" scoped>
+
+::v-deep .el-input--small .el-input__inner {
+ height: 30px !important; // 杩欓噷灏辨槸淇敼榛樿楂樺害
+ width: 120px;
+}
div {
box-sizing: border-box;
}
--
Gitblit v1.9.3