From 9fa82e0217d54a38dd1546094d8d15cb43e827b0 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 22 四月 2025 11:22:47 +0800
Subject: [PATCH] 代码初始化

---
 admin/src/views/index.vue |   65 ++++++++++++++++++++++++++------
 1 files changed, 53 insertions(+), 12 deletions(-)

diff --git a/admin/src/views/index.vue b/admin/src/views/index.vue
index 687f6f2..b090fe8 100644
--- a/admin/src/views/index.vue
+++ b/admin/src/views/index.vue
@@ -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