Browse Source

项目首页,版本首页回退

yunxing 4 years ago
parent
commit
a9c1adcc89
2 changed files with 81 additions and 81 deletions
  1. 3 7
      src/views/homepage/index.vue
  2. 78 74
      src/views/statistics/index.vue

+ 3 - 7
src/views/homepage/index.vue

@@ -27,7 +27,7 @@
                         <div  class="content" v-if="option.total">
                             <p class="line">
                                 <span >{{option.type === 1 ? '维保': option.type === 0 ? '专维' :  '第三方检测' }}</span>
-                                <span><em :style="{color:item.level == 1? '#646C73':'#C13830'}">{{option.unfinished}}</em>/<em>{{option.total}}</em></span>
+                                <span><em :style="{color:item.level == 1? '#646C73': item.level == 2 ? '#E07A04 ' :'#C13830'}">{{option.unfinished}}</em>/<em>{{option.total}}</em></span>
                             </p>
                             <p class='desc'>当月未完成/总任务</p>
                         </div>
@@ -214,15 +214,11 @@ export default {
                         if (item.objtype === 0) {
                             item.type = '专维'
                         } else if (item.objtype === 1) {
-                            item.type = '重要维保'
+                            item.type = '维保'
                         } else if (item.objtype === 2) {
                             item.type = '第三方检测'
-                        } else if (item.objtype === 3) {
-                            item.type = '综合事项'
-                        } else if (item.objtype === 4) {
-                            item.type = '重点维修'
                         } else {
-                            item.type = '其他事项'
+                            item.type = '重点关注'
                         }
                     })
 

+ 78 - 74
src/views/statistics/index.vue

@@ -63,8 +63,10 @@
                             <div class='system-equipments' v-if='item.assetTypeList'>
                                 <div class='number' v-for='(equip , index) in item.assetTypeList' :key='index'>
                                     <div class="title">
-                                        <P :title="equip.category_name">{{equip.category_name}}</p>
-                                        <span :style="{right: equip.is_exception_num > 99 ? '-2rem' :  equip.is_exception_num > 9 ? '-1.5rem' :'-1rem'}" v-if='equip.is_exception_num'>{{equip.is_exception_num}}</span>
+                                        <div class="exception" :title="equip.category_name">
+                                            {{equip.category_name}}
+                                            <span style="right:-1rem;" v-if='equip.is_exception_num'>{{equip.is_exception_num}}</span>
+                                        </div>
                                     </div>
                                     <p>
                                         <span>{{equip.asset_num}}</span>
@@ -90,14 +92,14 @@
                         <div class='img'>
                             <img src='../../assets/images/icons/audit.png' />
                         </div>
-                        <p>当月说明书更新广场数量</p>
+                        <p>当月说明书更新项目数量</p>
                         <strong>{{plazaInfoCount.rptChangeCount}}</strong>
                     </div>
                     <div class='card' @click='navToFocusItems'>
                         <div class='img'>
                             <img src='../../assets/images/icons/contract.png' />
                         </div>
-                        <p>当前说明书更新事项数量</p>
+                        <p>当月重点关注事项项目数量</p>
                         <strong>{{plazaInfoCount.zhsxChangeCount}}</strong>
                     </div>
                 </section>
@@ -184,7 +186,7 @@ export default {
                 "东南": 'dongnan',
                 "其他": 'Other'
             },
-            provinceCities: {  // 各个区域的的中心坐标 缩放级别 
+            provinceCities: {  // 各个区域的的中心坐标 缩放级别
                 "青岛": {  center: [36.06667, 120.33333], zoom: 8 },
                 "北京": {  center: [39.604882122321174, 116.43660987308282], zoom: 8 },
                 "天津": {  center: [39.130593, 117.260892], zoom: 7 },
@@ -257,19 +259,19 @@ export default {
         ...mapGetters(['plazas', 'plazaId', 'accessLevel'])
     },
     watch: {
-         
+
     },
     created() {
         this.currentTime()
     },
     mounted() {
-         
-        
+
+
         window.vm = this
         this.getFrameworkTreeData()
         window.addEventListener('resize', this.reinitalMap, false)
     },
-    methods: {  
+    methods: {
         showToolTip (index) {
             this.maintainList.forEach(item => {item.showToolTip = false})
             this.maintainList[index].showToolTip = true
@@ -322,7 +324,7 @@ export default {
             this.currentZoneData = data
         },
         /**
-         * @Description 通过导航进行导航 
+         * @Description 通过导航进行导航
          * @Param id 所选区域的id
          * @Param index 点击项的序号
          */
@@ -332,12 +334,12 @@ export default {
             let level = data.level    //1集团 2中心 3区域 0广场
             if (level === this.regulateDistrictData[0].level) {
                 this.selectedZone = ''
-            } 
+            }
             this.currentZoneData = data
             this.currentLevel = level
             this.getEventStatusData(level, data.ccode)
-            this.queryPlazaInfoCount(data.ccode, data.level, data.cid) 
-            this.getSystemList(data.ccode, data.level) 
+            this.queryPlazaInfoCount(data.ccode, data.level, data.cid)
+            this.getSystemList(data.ccode, data.level)
             if (level === 1) {
                 this.pantGroupMap(data, this.currentSysId)
             } else if (level === 2) {
@@ -364,11 +366,11 @@ export default {
             } else {
                 this.queryPlazaInfoCount(data.ccode, data.level)
             }
-            this.getSystemList(data.ccode, data.level) 
+            this.getSystemList(data.ccode, data.level)
             this.getEventStatusData(this.currentLevel, data.ccode)
             this.createNavpathByData(data)
             this.currentZoneData = data
-  
+
             let level = data.level // //1集团 2中心 3区域 0广场
             if (level === 1) {
                 this.pantGroupMap(data, this.currentSysId)
@@ -378,7 +380,7 @@ export default {
                 this.pantProjectsMap(data, this.currentSysId)
             } else {   // 点击项为广场时 直接跳转到详情页  地图不用响应
                 let pathData = {fromGroup: 'true'}
-                let routeData = this.$router.resolve({  
+                let routeData = this.$router.resolve({
                     name:'/home/homePage',
                 })
                 window.open(routeData.href, '_blank');
@@ -387,11 +389,11 @@ export default {
                     plazaName: data.cname,
                     plazaId: data.ccode
                 }
-                this.$store.commit('SETPLAZENAME', data.cname) 
+                this.$store.commit('SETPLAZENAME', data.cname)
                 localStorage.setItem('PLAZAID', data.ccode)
             }
         },
-   
+
         /**
          * @Description  查询项目信息统计数量
          * @Param  ccode  管理分区编码 必填
@@ -478,7 +480,7 @@ export default {
             })
         },
          /**
-        * @Description 展开 维保 第三方检测 专维 
+        * @Description 展开 维保 第三方检测 专维
         * @Param  item 展开的某一项
         */
         toggerPanel(item) {
@@ -513,19 +515,19 @@ export default {
         /**
         *@Description 根据数据计算维保/第三方检测/专维各自颜色条的长度  维保、第三方检测是用即将逾期数据判断;专维是如果有逾期未完成直接标红,如果没有,按照即将逾期的数量显示颜色
         *@Param item 某一项的数据
-        *@Param title 标题 
+        *@Param title 标题
         */
         barStyle(item, title) {
             let bg = ''
             let type = this.selectColorByNum(item.due_num, item.total)
             let ratio = 0
             if (title === '专维') {
-                if (item.overdue_unfinished >0) {
-                    bg = 'linear-gradient(to right, #F54E45 , #F54E45)'  
+                if (item.unfinished>0) {
+                    bg = 'linear-gradient(to right, #F54E45 , #F54E45)'
                 } else {
                     bg = this.barColors[type]
                 }
-                ratio = ((item.overdue_unfinished  + item.due_num) / item.total) * 100
+                ratio = ((item.unfinished + item.due_num) / item.total) * 100
             } else {
                 bg = this.barColors[type]
                 ratio = (item.due_num / item.total) * 100
@@ -536,11 +538,11 @@ export default {
             }
         },
         /**
-         * @Description 根据数据来返 维保/第三方检测/专维 三个模块中显示条的颜色 
+         * @Description 根据数据来返 维保/第三方检测/专维 三个模块中显示条的颜色
          * @Param num 即将逾期数 / 逾期未完成数
          * @Param total 总数
          */
-        selectColorByNum (num, total) {    
+        selectColorByNum (num, total) {
             let devide =  num / total
             if ( (num > 1 && num <=24  ) || (  devide > 0.1 && devide <=0.2 ) ) {
                 return 0
@@ -550,7 +552,7 @@ export default {
                 return 2
             }
         },
-  
+
         /**
         * @Description 根据数据 判定地图上图标的显示显示颜色
         * @Param data 作为判断的数据
@@ -577,7 +579,7 @@ export default {
             this.times = moment().format('YYYY.MM.DD HH:mm')
             setTimeout(this.currentTime, 1000)
         },
- 
+
          /**
         * @Description 格式化时间
         * @method param empty
@@ -597,7 +599,7 @@ export default {
         * @method param plazaId 广场id  如果是广场则此参数必填 其他情况下非必填
         */
         getSystemList(ccode, level) {
-            let params = null 
+            let params = null
             if (level === 0) {
                 params = {getParams:{plazaId: ccode, level}}
             } else {
@@ -631,7 +633,7 @@ export default {
          * @Param ccode 管理分区编码 必填
          * @Param level 1集团 2中心 3区域 0广场 必填
          */
-        getEventStatusData(level, ccode) {  
+        getEventStatusData(level, ccode) {
             let params = {
                 getParams: {
                     level,
@@ -641,7 +643,7 @@ export default {
             queryEventStatus(params).then(res => {
                 if (res.result === 'success') {
                     let data = res.data
-                    let orginalObj = { 
+                    let orginalObj = {
                         1:{title:'维保',data:[], expand: 0, showToolTip:false},
                         2:{title:'第三方检测',data:[], expand: 0, showToolTip:false},
                         0:{title:'专维',data:[], expand: 0, showToolTip:false},
@@ -702,13 +704,13 @@ export default {
                     }
                 }
             }).addTo(myMaps)
-            if (this.currentLevel === 1) {//1集团 
+            if (this.currentLevel === 1) {//1集团
                 this.pantGroupMap(this.currentZoneData, this.currentSysId)
             } else if (this.currentLevel === 2) {  // 2中心
                 this.pantZonesMap(this.currentZoneData, this.currentSysId)
-            } else if (this.currentLevel === 3) {  // 3区域 
+            } else if (this.currentLevel === 3) {  // 3区域
                 this.pantProjectsMap(this.currentZoneData, this.currentSysId)
-            }  
+            }
         },
         /**
          * @Description 清空地图 并添加全国底图
@@ -771,7 +773,7 @@ export default {
                 let promise = new Promise((resolve, reject) => {
                     let params = {
                         getParams: {
-                            smsxt: this.currentSysId,  
+                            smsxt: this.currentSysId,
                             level: 2,    // 中心
                             ccode: item.ccode
                         }
@@ -844,7 +846,7 @@ export default {
                 let promise = new Promise((resolve, reject) => {
                     let params = {
                         getParams: {
-                            smsxt: this.currentSysId, 
+                            smsxt: this.currentSysId,
                             level: 3,   // 区域
                             ccode: item.ccode
                         }
@@ -852,7 +854,7 @@ export default {
                     querySystemCard(params).then(res => {
                         if (res.result === 'success') {
                             let name = item.cname.split('区域')[0]
-                            
+
                             let num = 0
                             if (res.data) {
                                 let equip = res.data[0]
@@ -911,7 +913,7 @@ export default {
                     let params = {
                         getParams: {
                             plazaId: item.cid,   // 所查对象是广场的时候plazaId必传
-                            smsxt: this.currentSysId,  
+                            smsxt: this.currentSysId,
                             level: 0,   // 广场
                             ccode: item.ccode
                         }
@@ -974,14 +976,14 @@ export default {
                 html: type =='group' ? name :`<div>${name}</div>`,
                 className: 'my-leaflet-div-icon',
                 iconSize: 30
-            }) 
+            })
             let circleIcon = L.icon({
                 iconUrl: require(`../../assets/images/icons/${color}.png`),
                 iconSize: [24, 24],
                 iconAnchor: [16, 38],
             });
- 
-            if (color  && center) { 
+
+            if (color  && center) {
                 let popup = L.popup({closeOnClick:true,offset: [-3,-20]}).setLatLng(center).setContent(contentHtml)
                 let marker = L.marker(center, { icon: textIcon }).addTo(groupLayer)
                 let marker2 = L.marker(center,{ icon: circleIcon} ).addTo(groupLayer)
@@ -996,18 +998,18 @@ export default {
                     this.currentZoneData = data
                     this.currentLevel = data.level
                     this.getEventStatusData(data.level, data.ccode)
-                    this.queryPlazaInfoCount(data.ccode, data.level) 
+                    this.queryPlazaInfoCount(data.ccode, data.level)
                     if (type !== 'project') {
                         groupLayer.clearLayers()
                     }
                     this.createNavpathByData(data)
-                    this.getSystemList(data.ccode, data.level)   
+                    this.getSystemList(data.ccode, data.level)
                     if (type === 'group') {
                         this.pantZonesMap(data, this.currentSysId)
-                    } 
+                    }
                     if (type === 'zone') {
                         this.pantProjectsMap(data, this.currentSysId)
-                    } 
+                    }
                     if (type === 'project') {
                         let routeData = this.$router.resolve({
                             name:'/home/homePage',
@@ -1018,9 +1020,9 @@ export default {
                             plazaName: data.cname,
                             plazaId: data.ccode
                         }
-                        this.$store.commit('SETPLAZENAME', data.cname) 
+                        this.$store.commit('SETPLAZENAME', data.cname)
                         localStorage.setItem('PLAZAID', data.ccode)
-                    }   
+                    }
                 })
             }
         },
@@ -1036,7 +1038,7 @@ export default {
                     let item = data[i]
                     if (item.is_exception_num) {
                         html += `<div class="line">
-                            <span>${item.category_name}</span> 
+                            <span>${item.category_name}</span>
                             <span>${item.asset_num || '--'}台</span>
                             <span><span style="display: inline-block;width: 16px;height: 16px;line-height: 16px;border-radius: 8px; color: white; background : #F54E45;text-align: center;cursor: default;">!</span><em>${
                                 item.is_exception_num
@@ -1044,7 +1046,7 @@ export default {
                         </div>`
                     } else {
                         html += `<div class="line">
-                            <span>${item.category_name}</span> 
+                            <span>${item.category_name}</span>
                             <span>${item.asset_num || '--'}台</span>
                         </div>`
                     }
@@ -1054,7 +1056,7 @@ export default {
                 return ''
             }
         },
-        
+
     },
     beforeDestroy() {
         window.removeEventListener('resize', this.reinitalMap)
@@ -1094,7 +1096,7 @@ export default {
         box-shadow: 0px 2px 10px 0px rgba(31, 35, 41, 0.1);
         overflow: hidden;
         .home {
-            width: 265px;
+            width: 285px;
             height: 48px;
             // line-height: 48px;
             text-align: center;
@@ -1246,9 +1248,9 @@ export default {
                 margin-left: 1.2rem;
             }
         }
-        
+
         .system-general {
-            width: 25.4%;
+            width: 29.4%;
             box-sizing: border-box;
             background: white;
             .system-main-title {
@@ -1275,7 +1277,7 @@ export default {
                             display: flex;
                             align-items: center;
                             width: 25%;
-                            padding: 1.2rem 0 1.2rem 1rem ;  
+                            padding: 1.2rem 0 1.2rem 1rem ;
                             border-right: 1px solid #EFF0F1;
                             .img {
                                 height: 2.8rem;
@@ -1311,27 +1313,30 @@ export default {
                                 width: 33.3%;
                                 .title{
                                     display: inline-block;
-                                    position: relative;
-                                    p{
-                                        display: inline-block;
+                                    width: 100%;
+                                    white-space: nowrap;
+                                    text-overflow: ellipsis;
+                                    overflow: hidden;
+                                    div.exception{
                                         position: relative;
-                                        width: 12rem;
+                                        display: inline;
                                         color: #1f2429;
                                         font-size: 1.4rem;
-                                        line-height: 2rem;
+                                        line-height: 4rem;
                                         white-space: nowrap;
                                         text-overflow: ellipsis;
                                         overflow: hidden;
-                                    }
-                                    span {
-                                        position: absolute;
-                                        top: -1.6rem;
-                                        right: -2rem;
-                                        padding: 2px 4px;
-                                        border-radius: 0.9rem;
-                                        font-size: 1.2rem;
-                                        color: #f54e45;
-                                        background: #fde3e2;
+                                        span {
+                                            position: absolute;
+                                            top: -1rem;
+                                            right: -1rem;
+                                            line-height: 1.6rem;
+                                            padding: 2px 4px;
+                                            border-radius: 0.9rem;
+                                            font-size: 1.2rem;
+                                            color: #f54e45;
+                                            background: #fde3e2;
+                                        }
                                     }
                                 }
                                 p:nth-of-type(2) {
@@ -1342,7 +1347,7 @@ export default {
                                     }
                                 }
                             }
-                             
+
                         }
                     }
                     li.selected {
@@ -1360,7 +1365,7 @@ export default {
             }
         }
         .map-box {
-            width: calc(56.6% - 2.4rem);
+            width: calc(52.6% - 2.4rem);
             margin: 0 12px;
             .cards-list {
                 display: flex;
@@ -1408,9 +1413,9 @@ export default {
                 #map {
                     height: 70vh;
                     overflow: hidden;
-                    
+
                     svg {
-                        pointer-events: none; 
+                        pointer-events: none;
                     }
                 }
                 .legend {
@@ -1520,5 +1525,4 @@ export default {
         }
     }
 }
-</style> 
- 
+</style>