From 3fdd7cb635c582dd359979ce106b1d94444a6878 Mon Sep 17 00:00:00 2001 From: 付延余 <f-yanyu@outlook.com> Date: 星期二, 26 四月 2022 11:39:22 +0800 Subject: [PATCH] 首页数据 --- src/pages/show/index/index.vue | 410 ++++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 257 insertions(+), 153 deletions(-) diff --git a/src/pages/show/index/index.vue b/src/pages/show/index/index.vue index 2cea839..d4fd8df 100644 --- a/src/pages/show/index/index.vue +++ b/src/pages/show/index/index.vue @@ -197,7 +197,16 @@ <div class="shuju-scroll"> <div class="shuju-table-line2" v-for="(item,index) in LabourTable" :key="index"> <div class="biao-title"> - <h1>{{ item.dataType | dataFilter }}</h1> + <el-tooltip placement="top"> + <div slot="content"> + <h1>{{ item.dataType | dataFilter }}</h1> + </div> + <template> + <div class="content"> + <h1>{{ item.dataType | dataFilter }}</h1> + </div> + </template> + </el-tooltip> </div> <div class="title-flex"> <div class="title"> @@ -320,118 +329,118 @@ </div> </div> <div class="shuju-scroll"> - <div class="shuju-table-line2"> + <div class="shuju-table-line2 chengzhen_scroll" v-for="(item,index) in TownTable" :key="index"> <div class="biao-title"> - <h1>浜烘暟锛堜竾浜猴級</h1> + <h1>{{ item.name }}</h1> </div> <div class="title-flex"> <div class="title"> - <h1>277.8</h1> + <h1>{{ item.total }}</h1> </div> <div class="title"> - <h1>35.5</h1> + <h1>{{ item.office }}</h1> </div> <div class="title"> - <h1>242.3</h1> + <h1>{{ item.enterprise }}</h1> </div> </div> </div> - <div class="shuju-table-line2 shuju-bj-color"> - <div class="biao-title"> - <h1>鍦ㄨ亴锛堜竾浜猴級</h1> - </div> - <div class="title-flex"> - <div class="title"> - <h1>217.8</h1> - </div> - <div class="title"> - <h1>13.5</h1> - </div> - <div class="title"> - <h1>142.3</h1> - </div> - </div> - </div> - <div class="shuju-table-line2"> - <div class="biao-title"> - <h1>绂婚��浼戯紙涓囦汉锛�</h1> - </div> - <div class="title-flex"> - <div class="title"> - <h1>23.8</h1> - </div> - <div class="title"> - <h1>16.5</h1> - </div> - <div class="title"> - <h1>52.3</h1> - </div> - </div> - </div> - <div class="shuju-table-line2"> - <div class="biao-title"> - <h1>渚涘吇姣�</h1> - </div> - <div class="title-flex"> - <div class="title"> - <h1>3.8</h1> - </div> - <div class="title"> - <h1>2.5</h1> - </div> - <div class="title"> - <h1>1.3</h1> - </div> - </div> - </div> - <div class="shuju-table-line2"> - <div class="biao-title"> - <h1>鏀跺叆锛堜嚎鍏冿級</h1> - </div> - <div class="title-flex"> - <div class="title"> - <h1>233.8</h1> - </div> - <div class="title"> - <h1>24.5</h1> - </div> - <div class="title"> - <h1>341.3</h1> - </div> - </div> - </div> - <div class="shuju-table-line2"> - <div class="biao-title"> - <h1>鏀嚭锛堜嚎鍏冿級</h1> - </div> - <div class="title-flex"> - <div class="title"> - <h1>533.8</h1> - </div> - <div class="title"> - <h1>84.5</h1> - </div> - <div class="title"> - <h1>541.3</h1> - </div> - </div> - </div> - <div class="shuju-table-line2"> - <div class="biao-title"> - <h1>缁撲綑锛堜嚎鍏冿級</h1> - </div> - <div class="title-flex"> - <div class="title"> - <h1>33.8</h1> - </div> - <div class="title"> - <h1>34.5</h1> - </div> - <div class="title"> - <h1>341.3</h1> - </div> - </div> - </div> + <!-- <div class="shuju-table-line2 shuju-bj-color">--> + <!-- <div class="biao-title">--> + <!-- <h1>鍦ㄨ亴锛堜竾浜猴級</h1>--> + <!-- </div>--> + <!-- <div class="title-flex">--> + <!-- <div class="title">--> + <!-- <h1>217.8</h1>--> + <!-- </div>--> + <!-- <div class="title">--> + <!-- <h1>13.5</h1>--> + <!-- </div>--> + <!-- <div class="title">--> + <!-- <h1>142.3</h1>--> + <!-- </div>--> + <!-- </div>--> + <!-- </div>--> + <!-- <div class="shuju-table-line2">--> + <!-- <div class="biao-title">--> + <!-- <h1>绂婚��浼戯紙涓囦汉锛�</h1>--> + <!-- </div>--> + <!-- <div class="title-flex">--> + <!-- <div class="title">--> + <!-- <h1>23.8</h1>--> + <!-- </div>--> + <!-- <div class="title">--> + <!-- <h1>16.5</h1>--> + <!-- </div>--> + <!-- <div class="title">--> + <!-- <h1>52.3</h1>--> + <!-- </div>--> + <!-- </div>--> + <!-- </div>--> + <!-- <div class="shuju-table-line2">--> + <!-- <div class="biao-title">--> + <!-- <h1>渚涘吇姣�</h1>--> + <!-- </div>--> + <!-- <div class="title-flex">--> + <!-- <div class="title">--> + <!-- <h1>3.8</h1>--> + <!-- </div>--> + <!-- <div class="title">--> + <!-- <h1>2.5</h1>--> + <!-- </div>--> + <!-- <div class="title">--> + <!-- <h1>1.3</h1>--> + <!-- </div>--> + <!-- </div>--> + <!-- </div>--> + <!-- <div class="shuju-table-line2">--> + <!-- <div class="biao-title">--> + <!-- <h1>鏀跺叆锛堜嚎鍏冿級</h1>--> + <!-- </div>--> + <!-- <div class="title-flex">--> + <!-- <div class="title">--> + <!-- <h1>233.8</h1>--> + <!-- </div>--> + <!-- <div class="title">--> + <!-- <h1>24.5</h1>--> + <!-- </div>--> + <!-- <div class="title">--> + <!-- <h1>341.3</h1>--> + <!-- </div>--> + <!-- </div>--> + <!-- </div>--> + <!-- <div class="shuju-table-line2">--> + <!-- <div class="biao-title">--> + <!-- <h1>鏀嚭锛堜嚎鍏冿級</h1>--> + <!-- </div>--> + <!-- <div class="title-flex">--> + <!-- <div class="title">--> + <!-- <h1>533.8</h1>--> + <!-- </div>--> + <!-- <div class="title">--> + <!-- <h1>84.5</h1>--> + <!-- </div>--> + <!-- <div class="title">--> + <!-- <h1>541.3</h1>--> + <!-- </div>--> + <!-- </div>--> + <!-- </div>--> + <!-- <div class="shuju-table-line2">--> + <!-- <div class="biao-title">--> + <!-- <h1>缁撲綑锛堜嚎鍏冿級</h1>--> + <!-- </div>--> + <!-- <div class="title-flex">--> + <!-- <div class="title">--> + <!-- <h1>33.8</h1>--> + <!-- </div>--> + <!-- <div class="title">--> + <!-- <h1>34.5</h1>--> + <!-- </div>--> + <!-- <div class="title">--> + <!-- <h1>341.3</h1>--> + <!-- </div>--> + <!-- </div>--> + <!-- </div>--> </div> </div> <div class="shuju-echarts" id="chengzhenZhigongYanglaoEcharts"></div> @@ -743,7 +752,9 @@ getLoan, getPersonnel, getLabourTable, - getLabourChart + getLabourChart, + getInsuranceChart, + getTownTable } from "@/api/index"; export default { @@ -765,10 +776,36 @@ // 24. 鏌ヨ棣栭〉灏变笟鏁版嵁琛ㄦ牸鎺ュ彛 LabourTable: {}, // 25.棣栭〉灏变笟鏁版嵁鎶樼嚎鍥� - addJob: [], - reJob: [], - hardJob: [], - LabourChartYear: [] + JiuYeEchart: { + addJob: [], + reJob: [], + hardJob: [], + LabourChartYear: [] + }, + // 26. 鏌ヨ棣栭〉鍏昏�併�佸伐浼ゃ�佸け涓氫繚闄╂姌绾垮浘鎺ュ彛 + // 鍩庨晣鑱屽伐鍏昏�� + YangLaoEchart: { + years: [], + shouru: [], + zhichu: [], + jieyu: [] + }, + // 澶变笟淇濋櫓 + ShiYeEchart: { + years: [], + shouru: [], + zhichu: [], + jieyu: [] + }, + // 宸ヤ激 + GongShangEchart: { + years: [], + shouru: [], + zhichu: [], + jieyu: [] + }, + // 27. 鏌ヨ棣栭〉鍩庨晣鑱屽伐鍏昏�佽〃鏍兼暟鎹帴鍙� + TownTable: [] } }, mounted() { @@ -784,6 +821,8 @@ this.getPersonnel() this.getLabourTable() this.getLabourChart() + this.getInsuranceChart(), + this.getTownTable() }, filters: { dataFilter(type) { @@ -817,7 +856,6 @@ trigger: 'axis' }, legend: { - data: ['鎬绘暟', '鍦ㄨ亴鑱屽伐', '绂婚��浼�'], itemWidth: nowSize(24), itemHeight: nowSize(4), itemGap: nowSize(10), @@ -838,7 +876,7 @@ xAxis: { type: 'category', boundaryGap: false, - data: this.LabourChartYear, + data: this.JiuYeEchart.LabourChartYear, axisLabel: { show: true, textStyle: { @@ -882,19 +920,19 @@ } }, series: [{ - name: '鎬绘暟', + name: '鍩庨晣鏂板灏变笟', type: 'line', - data: this.addJob + data: this.JiuYeEchart.addJob }, { - name: '鍦ㄨ亴鑱屽伐', + name: '澶变笟鍐嶅氨涓�', type: 'line', - data: this.reJob + data: this.JiuYeEchart.reJob }, { - name: '绂婚��浼�', + name: '鍥伴毦鍐嶅氨涓�', type: 'line', - data: this.hardJob + data: this.JiuYeEchart.hardJob }] }; myEchart.setOption(option) @@ -912,11 +950,10 @@ trigger: 'axis' }, legend: { - data: ['鎬绘暟', '鍦ㄨ亴鑱屽伐', '绂婚��浼�'], itemWidth: nowSize(24), itemHeight: nowSize(4), itemGap: nowSize(10), - right: '0%', + right: '10%', top: '0%', textStyle: { color: '#FFFFFF', @@ -933,7 +970,7 @@ xAxis: { type: 'category', boundaryGap: false, - data: ['2021/4', '2021/5', '2021/6', '2021/7', '2021/8', '2021/9', '2021/10'], + data: this.YangLaoEchart.years, axisLabel: { show: true, textStyle: { @@ -974,19 +1011,19 @@ }, series: [ { - name: '鎬绘暟', + name: '鏀跺叆', type: 'line', - data: [370, 332, 401, 534, 490, 530, 910] + data: this.YangLaoEchart.shouru }, { - name: '鍦ㄨ亴鑱屽伐', + name: '鏀嚭', type: 'line', - data: [220, 182, 191, 234, 290, 330, 310] + data: this.YangLaoEchart.zhichu }, { - name: '绂婚��浼�', + name: '缁撲綑', type: 'line', - data: [150, 132, 201, 154, 190, 330, 410] + data: this.YangLaoEchart.jieyu } ] }; @@ -1005,11 +1042,10 @@ trigger: 'axis' }, legend: { - data: ['鎬绘暟', '鍦ㄨ亴鑱屽伐', '绂婚��浼�'], itemWidth: nowSize(24), itemHeight: nowSize(4), itemGap: nowSize(1), - right: '0%', + right: '10%', top: '0%', textStyle: { color: '#FFFFFF', @@ -1026,7 +1062,7 @@ xAxis: { type: 'category', boundaryGap: false, - data: ['2021/4', '2021/5', '2021/6', '2021/7', '2021/8', '2021/9', '2021/10'], + data: this.ShiYeEchart.years, axisLabel: { show: true, textStyle: { @@ -1067,19 +1103,19 @@ }, series: [ { - name: '鎬绘暟', + name: '鏀跺叆', type: 'line', - data: [370, 332, 401, 534, 490, 530, 910] + data: this.ShiYeEchart.shouru }, { - name: '鍦ㄨ亴鑱屽伐', + name: '鏀嚭', type: 'line', - data: [220, 182, 191, 234, 290, 330, 310] + data: this.ShiYeEchart.zhichu }, { - name: '绂婚��浼�', + name: '缁撲綑', type: 'line', - data: [150, 132, 201, 154, 190, 330, 410] + data: this.ShiYeEchart.jieyu } ] }; @@ -1098,11 +1134,10 @@ trigger: 'axis' }, legend: { - data: ['鎬绘暟', '鍦ㄨ亴鑱屽伐', '绂婚��浼�'], itemWidth: nowSize(24), itemHeight: nowSize(4), itemGap: nowSize(10), - right: '0%', + right: '10%', top: '0%', textStyle: { color: '#FFFFFF', @@ -1119,7 +1154,7 @@ xAxis: { type: 'category', boundaryGap: false, - data: ['2021/4', '2021/5', '2021/6', '2021/7', '2021/8', '2021/9', '2021/10'], + data: this.GongShangEchart.years, axisLabel: { show: true, textStyle: { @@ -1160,19 +1195,19 @@ }, series: [ { - name: '鎬绘暟', + name: '鏀跺叆', type: 'line', - data: [370, 332, 401, 534, 490, 530, 910] + data: this.GongShangEchart.shouru }, { - name: '鍦ㄨ亴鑱屽伐', + name: '鏀嚭', type: 'line', - data: [220, 182, 191, 234, 290, 330, 310] + data: this.GongShangEchart.zhichu }, { - name: '绂婚��浼�', + name: '缁撲綑', type: 'line', - data: [150, 132, 201, 154, 190, 330, 410] + data: this.GongShangEchart.jieyu } ] }; @@ -1240,15 +1275,56 @@ }) }, // 25. 鏌ヨ棣栭〉灏变笟鏁版嵁鎶樼嚎鍥炬帴鍙� - getLabourChart() { - getLabourChart().then(res => { + async getLabourChart() { + await getLabourChart().then(res => { + if (res.code === 1000) { + this.JiuYeEchart.LabourChartYear = res.obj.years; + this.JiuYeEchart.addJob = res.obj.addJob; + this.JiuYeEchart.reJob = res.obj.hardJob; + this.JiuYeEchart.hardJob = res.obj.reJob; + this.jiuyeshujuEcharts() + } + }) + }, + // 26. 鏌ヨ棣栭〉鍏昏�併�佸伐浼ゃ�佸け涓氫繚闄╂姌绾垮浘鎺ュ彛 + async getInsuranceChart() { + // 鍩庨晣鑱屽伐鍏昏�� + await getInsuranceChart({type: 1}).then(res => { + if (res.code === 1000) { + this.YangLaoEchart.shouru = res.obj.shouru + this.YangLaoEchart.zhichu = res.obj.zhichu + this.YangLaoEchart.jieyu = res.obj.jieyu + this.YangLaoEchart.years = res.obj.years + this.chengzhenZhigongYanglaoEcharts() + } + }) + // 澶变笟淇濋櫓 + await getInsuranceChart({type: 5}).then(res => { + if (res.code === 1000) { + this.ShiYeEchart.shouru = res.obj.shouru + this.ShiYeEchart.zhichu = res.obj.zhichu + this.ShiYeEchart.jieyu = res.obj.jieyu + this.ShiYeEchart.years = res.obj.years + this.shiyeBaoxianEcharts() + } + }) + // 宸ヤ激淇濋櫓 + await getInsuranceChart({type: 6}).then(res => { + if (res.code === 1000) { + this.GongShangEchart.shouru = res.obj.shouru + this.GongShangEchart.zhichu = res.obj.zhichu + this.GongShangEchart.jieyu = res.obj.jieyu + this.GongShangEchart.years = res.obj.years + this.gongshangBaoxianEcharts() + } + }) + }, + // 27. 鏌ヨ棣栭〉鍩庨晣鑱屽伐鍏昏�佽〃鏍兼暟鎹帴鍙� + getTownTable() { + getTownTable().then(res => { console.log(res); if (res.code === 1000) { - this.LabourChartYear = res.obj.years; - this.addJob = res.obj.addJob; - this.reJob = res.obj.hardJob; - this.hardJob = res.obj.reJob; - this.jiuyeshujuEcharts() + this.TownTable = res.list } }) } @@ -1539,17 +1615,19 @@ display: flex; .biao-title { - width: 1.328125rem /* 340/256 */ + width: 0.859375rem /* 220/256 */ ; } .title-flex { - width: 100%; + width: calc(100% - 0.859375rem); display: flex; } .title { flex: 1; + display: flex; + align-items: center; h1 { font-size: $fontSize-26; @@ -1578,6 +1656,8 @@ .title { flex: 1; + display: flex; + align-items: center; h1 { font-size: $fontSize-26; @@ -1592,12 +1672,12 @@ } .title-flex { - width: 100%; + width: calc(100% - 0.859375rem); display: flex; } .biao-title { - width: 1.328125rem /* 340/256 */ + width: 0.859375rem /* 220/256 */ ; h1 { @@ -1605,6 +1685,7 @@ color: $color-white; text-align: right; line-height: 1.5; + @include ellipsis() } .fontColor { @@ -1612,6 +1693,29 @@ } } } + // 鍩庡競鑱屽伐鍏昏�佺2锛�3鏉℃暟鎹� + .chengzhen_scroll { + &:nth-of-type(2) { + background: rgba(81, 210, 255, 0.10); + + h1 { + font-size: 24px; + line-height: 1; + color: #999999; + } + } + + &:nth-of-type(3) { + background: rgba(81, 210, 255, 0.10); + + h1 { + font-size: 24px; + line-height: 1; + color: #999999; + + } + } + } .shuju-bj-color { background: rgba(81, 210, 255, 0.10); -- Gitblit v1.9.1