123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534 |
- <template>
- <div :class="showDatePicker? 'homeMobeilMask': ''">
- </div>
- <div class="homeMobeilPage">
- <van-nav-bar title="年度单位评级" />
- <div class="mobeilVant">
- <div class="mobeilTop">
- <div class="topLeft">
- <!-- <van-icon name="star" size="20" /> -->
- <img :src="logoImg" alt="">
- <span>全业务域考评系统</span>
- </div>
- <div class="topRight">
- <span>系统导航</span>
- <img :src="daohangImg" alt="" @click="chooseMenu">
- </div>
- </div>
- <div class="mobeilMain">
- <div class="rankingList">
- <span>{{showDate}}年度排行榜</span>
- <img :src="dateImg" @click="changeDate" alt="">
- <van-date-picker
- v-model="currentDate"
- title="选择年份"
- :columns-type="['year']"
- @confirm="confirmFn"
- @cancel="cancelFn"
- v-if="showDatePicker"
- />
- </div>
- <div class="mainModel" v-for="(it, index) in cupDataYearArr" :key="index">
- <div class="mainModelTit">
- <div class="mainModelTit_left">
- <img :src="huodianImg" alt="" v-if="it.nameEn === 'HD'">
- <img :src="shuidianImg" alt="" v-else-if="it.nameEn === 'SD'">
- <img :src="xinnengyuanImg" alt="" v-else-if="it.nameEn === 'XNYFG'">
- <img :src="guojiImg" alt="" v-else-if="it.nameEn === 'GJYW'">
- <img :src="meidianImg" alt="" v-else-if="it.nameEn === 'MDYTH'">
- <span>{{it.name}}</span>
- </div>
- <img :src="moreImg" alt="" class="mainModelTit_right" @click="enterDetail(it.nameEn)">
- </div>
- <div class="mainModelMsg">
- <div class="mainTwo">
- <!-- <div class="echartsNum" :style="it.echartsData.allNum < 10 ? 'left:56px': 'left: 65px'">{{it.echartsData.allNum}}</div> -->
- <div :id="'pieChart'+index" style="height: 100px;width: 100%"></div>
- <el-row>
- <el-col :span="12">
- <span class="mainTwoComColor" style="background: #F65177;"></span>
- <span class="mainTwoComTit">A级</span>
- </el-col>
- <el-col :span="12">
- <span class="mainTwoComColor" style="background: #50C14E;"></span>
- <span class="mainTwoComTit">B级</span>
- </el-col>
- <el-col :span="12">
- <span class="mainTwoComColor" style="background: #5093E1;"></span>
- <span class="mainTwoComTit">C级</span>
- </el-col>
- <el-col :span="12">
- <span class="mainTwoComColor" style="background: #9DA5BE;"></span>
- <span class="mainTwoComTit">D级</span>
- </el-col>
- </el-row>
- </div>
- <div class="mainThree">
- <div class="headerNameTit">
- <div class="headerNameTit_left">
- <span>单位名称</span>
- </div>
- <div class="headerNameTit_right">
- <span>级别</span>
- <span>得分</span>
- </div>
- </div>
- <div style="display: flex" v-for="(item, index) in it.tableDatas" :key="index">
- <div class="mainThreeMsg">
- <img :src="item.img" alt="">
- <div class="msgProgress">
- <span>{{item.company}}</span>
- <span>{{item.grade}}</span>
- <span>{{item.score}}</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import logoImg from '../assets/mobeilImg/logo.png'
- import daohangImg from '../assets/mobeilImg/daohang.png'
- import dateImg from '../assets/mobeilImg/date.png'
- import huodianImg from '../assets/mobeilImg/huodian.png'
- import shuidianImg from '../assets/mobeilImg/shuidian.png'
- import xinnengyuanImg from '../assets/mobeilImg/xinnengyuan.png'
- import meidianImg from '../assets/mobeilImg/meidian.png'
- import guojiImg from '../assets/mobeilImg/guoji.png'
- import moreImg from '../assets/mobeilImg/more.png'
- import cup1 from '../assets/getwayImg/cup1.png'
- import cup2 from '../assets/getwayImg/cup2.png'
- import cup3 from '../assets/getwayImg/cup3.png'
- import {apiGetappAnnualRankingData} from '../api/api'
- export default {
- data() {
- return {
- forecastDatas: [],
- expendData: ['0'],
- openeds: [],
- routeTags: [],
- userName: '',
- logoImg: logoImg,
- daohangImg: daohangImg,
- dateImg: dateImg,
- huodianImg: huodianImg,
- shuidianImg: shuidianImg,
- xinnengyuanImg: xinnengyuanImg,
- meidianImg: meidianImg,
- guojiImg: guojiImg,
- moreImg: moreImg,
- showDatePicker: false,
- currentDate: [],
- showDate: '',
- cupDataYearArr: []
- }
- },
- created() {
- this.showDate = new Date().getFullYear()
- this.getyearCompanyList()
- },
- methods: {
- //获取年度单位考评数据
- getyearCompanyList() {
- let that = this
- that.cupDataYearArr = []
- let params = {
- binSection: '',
- year: that.showDate
- }
- apiGetappAnnualRankingData(params).then(datas =>{
- if (datas && datas.data) {
- let secArr = ['HD', 'SD', 'XNYFG', 'GJYW', 'MDYTH']
- secArr.forEach(item =>{
- for(let i in datas.data.year) {
- let it = datas.data.year[i]
- if (item === i) {
- let gradeA = 0
- let gradeB = 0
- let gradeC = 0
- let gradeD = 0
- let tableData = []
- it.forEach((iv, index) =>{
- if (index < 3) {
- let obj = iv
- if (index === 0) {
- obj.img = cup1
- } else if (index === 1) {
- obj.img = cup2
- } else if (index === 2) {
- obj.img = cup3
- }
- tableData.push(iv)
- }
- if (iv.grade === 'A') {
- gradeA ++
- } else if (iv.grade === 'B') {
- gradeB ++
- } else if (iv.grade === 'C') {
- gradeC ++
- } else if (iv.grade === 'D') {
- gradeD ++
- }
- })
- let obj = {
- name: item === 'HD' ? '火电板块' : item === 'SD' ? '水电板块' :item === 'XNYFG' ? '新能源' : item === 'GJYW' ? '海外业务':'煤电一体化',
- nameEn: item,
- echartsData: {
- allNum: it.length,
- echarts: [
- { value: gradeA, name: 'A类' },
- { value: gradeB, name: 'B类' },
- { value: gradeC, name: 'C类' },
- { value: gradeD, name: 'D类' }
- ]
- },
- tableDatas: tableData,
- allTableData: it,
- section: [],
- sectionAll: []
- }
- that.cupDataYearArr.push(obj)
- }
- }
- })
- that.cupDataYearArr.forEach(item =>{
- for(let i in datas.data.season) {
- let it = datas.data.season[i]
- if (item.nameEn === i) {
- it.forEach((iv, index) =>{
- if (index<3) {
- item.section.push(iv)
- }
- })
- item.sectionAll = it
- }
- }
- })
- this.$nextTick(() =>{
- that.getEcharts(that.cupDataYearArr)
- })
- }
- })
- },
- getEcharts(datas) {
- datas.forEach((item, index) =>{
- this.getEchartsData(item.echartsData.echarts, 'pieChart'+index)
- })
- },
- chooseMenu() {
- this.$router.push({ path: "/menu"})
- },
- enterDetail(type) {
- this.$router.push({ path: "/yearConpanyDetail", query: {binSection: type, year: this.showDate}})
- },
- getEchartsData(data, name) {
- let total = 0
- data.forEach(it =>{
- total += it.value
- })
- let option = {
- color: ['#F65177', '#50C14E', '#5093E1', '#9DA5BE'],
- tooltip: {
- trigger: 'item'
- },
- series: [
- {
- name: '年度榜',
- type: 'pie',
- radius: ['50%', '70%'],
- avoidLabelOverlap: false,
- label: {
- show: true,
- position: 'center',
- formatter: () =>{
- return total
- },
- fontSize: 16,
- fontWeight: 600
- },
- labelLine: {
- show: false
- },
- data: data
- }
- ]
- };
- // 基于准备好的dom,初始化echarts实例
- let dom = document.getElementById(name);
- dom.removeAttribute("_echarts_instance_")
- let myChart = this.$echarts.init(dom);
- myChart.setOption(option);
- window.addEventListener("resize", function () {
- myChart.resize()
- })
- },
- changeDate() {
- this.showDatePicker = true
- },
- confirmFn(val) {
- this.showDate = val.selectedValues[0]
- console.log('riqi', val)
- this.getyearCompanyList()
- this.cancelFn()
- },
- cancelFn() {
- this.showDatePicker = false
- }
- }
- }
- </script>
- <style lang="less">
- .homeMobeilMask{
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background-color: rgba(0,0,0,0.5);
- z-index: 111;
- }
- .homeMobeilPage {
- background-color: #184FB4;
- .van-nav-bar{
- width: 100%;
- background-color: #184FB4;
- color: #fff;
- position: fixed;
- top: 0;
- }
- .mobeilVant{
- height: 100%;
- margin-top: 45px;
- border-radius: 10px 10px 0 0;
- background-color: #fff;
- .mobeilTop{
- height: 60px;
- display: flex;
- justify-content: space-around;
- .topLeft{
- display: flex;
- img{
- width: 24px;
- height: 28px;
- position: relative;
- top: 18px;
- left: -10px;
- }
- span{
- font-family: MicrosoftYaHei;
- font-weight: 600;
- font-size: 16px;
- color: #444950;
- line-height: 60px;
- }
- }
- .topRight{
- display: flex;
- img{
- width: 22px;
- height: 18px;
- position: relative;
- top: 21px;
- left: 5px;
- }
- span{
- font-family: MicrosoftYaHei;
- font-weight: 400;
- font-size: 14px;
- color: #545960;
- line-height: 60px;
- margin-right: 5px;
- }
- }
- }
- .mobeilMain{
- // height: 50px;
- background-color: #ededf5;
- padding: 17px 20px;
- .rankingList{
- width: 100%;
- height: 45px;
- background: #184FB4;
- border-radius: 5px;
- margin-bottom: 15px;
- span{
- display: inline-block;
- width: 85%;
- text-align: center;
- font-family: MicrosoftYaHei;
- font-weight: 400;
- font-size: 16px;
- color: #fff;
- margin-right: 5px;
- position: relative;
- top: 12px;
- left: 8vw;
- }
- img{
- width: 22px;
- height: 18px;
- position: relative;
- top: 15px;
- right: 5px;
- }
- .van-picker{
- z-index: 222;
- }
- }
- .mainModel{
- background: #fff;
- border-radius: 5px;
- .mainModelTit{
- height: 40px;
- padding: 0 15px;
- display: flex;
- justify-content: space-between;
- border-bottom: 1px solid #96A1B4;
- .mainModelTit_left{
- img{
- width: 20px;
- height: 20px;
- position: relative;
- top: 10px;
- right: 5px;
- }
- span{
- display: inline-block;
- font-family: MicrosoftYaHei;
- font-weight: 500;
- font-size: 16px;
- color: #545960;
- margin-right: 5px;
- position: relative;
- top: 7px;
- }
- }
- .mainModelTit_right{
- width: 14px;
- height: 14px;
- position: relative;
- top: 14px;
- right: 5px;
- }
- }
- .mainModelMsg{
- width: 100%;
- display: flex;
- margin-bottom: 10px;
- .mainTwo{
- width: 35%;
- border-right: 1px solid #E1E3EA;
- position: relative;
- .echartsNum{
- font-size: 16px;
- font-weight: 600;
- position: absolute;
- top: 40px;
- left: 60px;
- }
- .mainTwoComColor{
- display: inline-block;
- width: 6px;
- height: 6px;
- border-radius: 20px;
- margin-left: 15px;
- position: relative;
- top: -1px;
- }
- .mainTwoComTit{
- font-size: 14px;
- display: inline-block;
- margin-left: 5px;
- }
- }
- .mainThree{
- width: 65%;
- padding-top: 5px;
- border-right: 1px solid #E1E3EA;
- position: relative;
- .headerNameTit{
- display: flex;
- // justify-content: space-between;
- padding: 0px 15px;
- margin-bottom: 5px;
- font-size: 14px;
- color: #414141;
- .headerNameTit_left{
- width: 65%;
- }
- .headerNameTit_right{
- width: 40%;
- span:nth-child(1){
- display: inline-block;
- width: 60%;
- }
- span:nth-child(2){
- display: inline-block;
- width: 40%;
- }
- }
- }
- .mainThreeMsg{
- display: flex;
- margin: 0 10px;
- width: calc(100% - 36px);
- height: 33px;
- background: #F6F7FA;
- margin-bottom: 8px;
- padding-left: 8px;
- padding-right: 8px;
- padding-top: 2px;
- border-radius: 5px;
- img{
- width: 20px;
- height: 20px;
- position: relative;
- top: 5px;
- margin-right: 10px;
- }
- .msgProgress{
- margin-top: 5px;
- display: flex;
- width: 100%;
- span{
- font-size: 14px;
- font-family: Microsoft YaHei;
- }
- span:nth-child(1){
- display: inline-block;
- width: 60%;
- font-weight: 400;
- color: #666;
- // margin-right: 10px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- span:nth-child(2){
- display: inline-block;
- width: 17%;
- font-weight: 600;
- color: #F65177;
- }
- span:nth-child(3){
- display: inline-block;
- width: 20%;
- font-weight: 600;
- color: #666;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- </style>
|