tanyanfei 5 years ago
parent
commit
02b392d058

+ 19 - 33
src/views/CompanyData.vue

@@ -478,6 +478,10 @@ export default {
                 },
                 },
                 }]
                 }]
             };
             };
+            let rw_name=[]
+            for(let i=0;i<data.riskpoint_warning_top5.length;i++){
+              rw_name.push(data.riskpoint_warning_top5[i].riskpoint_name)
+            }
             var option6 = {
             var option6 = {
                 backgroundColor:'rgba(0,0,0,0)',
                 backgroundColor:'rgba(0,0,0,0)',
                 color:['#3398dc'],
                 color:['#3398dc'],
@@ -490,7 +494,7 @@ export default {
                 textStyle:{
                 textStyle:{
                     color:'#8C8C8C',
                     color:'#8C8C8C',
                 },
                 },
-                        data:['风险点', '管控任务']
+                        // data:['风险点', '管控任务']
                     },
                     },
                 grid: {
                 grid: {
                     left: '1%',
                     left: '1%',
@@ -500,43 +504,25 @@ export default {
                     containLabel: true
                     containLabel: true
                 },
                 },
                 yAxis: {
                 yAxis: {
-                data: ['加油区1', '加油区2','加油区3','加油区4','加油区5'], 
+                data: rw_name, 
                     },
                     },
                     xAxis: {
                     xAxis: {
                 show:false
                 show:false
                 },
                 },
-                    series: [
-                {
-                        name: '风险点',
-                        type: 'bar',
-                        barWidth:10,
-                        data: [320, 332, 301, 334,690],
-                        itemStyle: {
-                            color: new echarts.graphic.LinearGradient(
-                                0, 0, 0, 1,
-                                [
-                                    {offset: 0, color: '#FFEE7F'},
-                                    {offset: 1, color: '#E8B35F'}
-                                ]
-                            )
-                        },
-                },
-                {
-                        name: '管控任务',
-                        type: 'bar',
-                        barWidth:10,
-                        data: [30, 132, 201, 34,270],
-                        itemStyle: {
-                            color: new echarts.graphic.LinearGradient(
-                                0, 0, 0, 1,
-                                [
-                                    {offset: 0, color: '#7AF7FF'},
-                                    {offset: 1, color: '#3687FF'}
-                                ]
-                            )
-                        },
+                 series: [{
+                type: 'bar',
+                barWidth: 10,
+                data:  data.riskpoint_warning_top5,
+                itemStyle: {
+                        color: new echarts.graphic.LinearGradient(
+                            0, 0, 0, 1,
+                            [
+                                {offset: 0, color: '#7AF7FF'},
+                                {offset: 1, color: '#3687FF'}
+                            ]
+                        )
                 },
                 },
-                ]
+                }]
             };
             };
             // 使用刚指定的配置项和数据显示图表。
             // 使用刚指定的配置项和数据显示图表。
             myChart1.setOption(option1);
             myChart1.setOption(option1);

+ 22 - 22
src/views/Data.vue

@@ -295,7 +295,7 @@
             <div class="li">
             <div class="li">
               <img class="top" src="../images/bk.png" alt="">
               <img class="top" src="../images/bk.png" alt="">
               <h4>风险企业TOP5</h4>
               <h4>风险企业TOP5</h4>
-              <div id="chart6" style="width: 100%;height:230px;"></div>
+              <div id="chart6" style="width: 100%;height:300px;"></div>
               <img class="bottom" src="../images/bk.png" alt="">
               <img class="bottom" src="../images/bk.png" alt="">
             </div>
             </div>
             <div class="li">
             <div class="li">
@@ -602,20 +602,20 @@ export default {
         backgroundColor:'rgba(0,0,0,0)',
         backgroundColor:'rgba(0,0,0,0)',
         color:color,
         color:color,
         tooltip: {trigger: 'axis',},
         tooltip: {trigger: 'axis',},
-        // legend: {
-        //   y:'bottom',
-        //   x:'left',
-        //   itemWidth:8,
-        //   itemHeight:8,
-        //   textStyle:{
-        //     color:'#8C8C8C',
-        //   },
-				//   data:['重大风险', '较大风险','一般风险','低风险']
-			  // },
+        legend: {
+          y:'bottom',
+          x:'left',
+          itemWidth:8,
+          itemHeight:8,
+          textStyle:{
+            color:'#8C8C8C',
+          },
+				  data:['重大风险', '较大风险','一般风险','低风险']
+			  },
         grid: {
         grid: {
             left: '1%',
             left: '1%',
             right: '1%',
             right: '1%',
-            bottom: '10px',
+            bottom: '50px',
             top:'10px',
             top:'10px',
             containLabel: true
             containLabel: true
         },
         },
@@ -658,16 +658,16 @@ export default {
         backgroundColor:'rgba(0,0,0,0)',
         backgroundColor:'rgba(0,0,0,0)',
         color:['#dc402c','#fcd865'],
         color:['#dc402c','#fcd865'],
         tooltip: {trigger: 'axis',},
         tooltip: {trigger: 'axis',},
-        // legend: {
-        //   y:'bottom',
-        //   x:'left',
-        //   itemWidth:8,
-        //   itemHeight:8,
-        //   textStyle:{
-        //     color:'#8C8C8C',
-        //   },
-				//   data:['重大风险', '较大风险','一般风险','低风险']
-			  // },
+        legend: {
+          y:'bottom',
+          x:'left',
+          itemWidth:8,
+          itemHeight:8,
+          textStyle:{
+            color:'#8C8C8C',
+          },
+				  data:['重大隐患','一般隐患']
+			  },
         grid: {
         grid: {
             left: '1%',
             left: '1%',
             right: '1%',
             right: '1%',

+ 23 - 23
src/views/GovermentData.vue

@@ -294,7 +294,7 @@
             <div class="li">
             <div class="li">
               <img class="top" src="../images/bk.png" alt="">
               <img class="top" src="../images/bk.png" alt="">
               <h4>风险企业TOP5</h4>
               <h4>风险企业TOP5</h4>
-              <div id="chart6" style="width: 100%;height:230px;"></div>
+              <div id="chart6" style="width: 100%;height:300px;"></div>
               <img class="bottom" src="../images/bk.png" alt="">
               <img class="bottom" src="../images/bk.png" alt="">
             </div>
             </div>
             <div class="li">
             <div class="li">
@@ -321,7 +321,7 @@ export default {
   },
   },
   methods:{
   methods:{
     getData(){   
     getData(){   
-      this.$api.getChartData({type:'zf'}).then(res=>{
+      this.$api.getChartData({type:'pt'}).then(res=>{
           this.data=res.data.data
           this.data=res.data.data
           var data=res.data.data;
           var data=res.data.data;
           let count=0;
           let count=0;
@@ -601,20 +601,20 @@ export default {
         backgroundColor:'rgba(0,0,0,0)',
         backgroundColor:'rgba(0,0,0,0)',
         color:color,
         color:color,
         tooltip: {trigger: 'axis',},
         tooltip: {trigger: 'axis',},
-        // legend: {
-        //   y:'bottom',
-        //   x:'left',
-        //   itemWidth:8,
-        //   itemHeight:8,
-        //   textStyle:{
-        //     color:'#8C8C8C',
-        //   },
-				//   data:['重大风险', '较大风险','一般风险','低风险']
-			  // },
+        legend: {
+          y:'bottom',
+          x:'left',
+          itemWidth:8,
+          itemHeight:8,
+          textStyle:{
+            color:'#8C8C8C',
+          },
+				  data:['重大风险', '较大风险','一般风险','低风险']
+			  },
         grid: {
         grid: {
             left: '1%',
             left: '1%',
             right: '1%',
             right: '1%',
-            bottom: '10px',
+            bottom: '50px',
             top:'10px',
             top:'10px',
             containLabel: true
             containLabel: true
         },
         },
@@ -657,16 +657,16 @@ export default {
         backgroundColor:'rgba(0,0,0,0)',
         backgroundColor:'rgba(0,0,0,0)',
         color:['#dc402c','#fcd865'],
         color:['#dc402c','#fcd865'],
         tooltip: {trigger: 'axis',},
         tooltip: {trigger: 'axis',},
-        // legend: {
-        //   y:'bottom',
-        //   x:'left',
-        //   itemWidth:8,
-        //   itemHeight:8,
-        //   textStyle:{
-        //     color:'#8C8C8C',
-        //   },
-				//   data:['重大风险', '较大风险','一般风险','低风险']
-			  // },
+        legend: {
+          y:'bottom',
+          x:'left',
+          itemWidth:8,
+          itemHeight:8,
+          textStyle:{
+            color:'#8C8C8C',
+          },
+				  data:['重大隐患','一般隐患']
+			  },
         grid: {
         grid: {
             left: '1%',
             left: '1%',
             right: '1%',
             right: '1%',

+ 9 - 5
src/views/Home.vue

@@ -28,12 +28,12 @@
 			<!-- 左侧菜单 -->
 			<!-- 左侧菜单 -->
 			<el-aside class="left-aside" width="210px">
 			<el-aside class="left-aside" width="210px">
 				<el-menu background-color='#151932'	text-color='#ffffff' :unique-opened='true'  :default-active="$route.path" router class="left-menue" active-text-color="#ffffff">
 				<el-menu background-color='#151932'	text-color='#ffffff' :unique-opened='true'  :default-active="$route.path" router class="left-menue" active-text-color="#ffffff">
-					<template v-for="(item, index) in $router.options.routes">
-							<el-menu-item v-if='item.show&&item.isLeaf' :index="item.path"  :key='index'>
+					<template v-for="(item, index) in $router.options.routes"  >
+							<el-menu-item v-show="permission(item.name)"  v-if='item.show&&item.isLeaf' :index="item.path"  :key='index'>
 								<i :class="item.icon"></i>
 								<i :class="item.icon"></i>
 								<span slot="title">{{item.name}}</span>
 								<span slot="title">{{item.name}}</span>
 							</el-menu-item>
 							</el-menu-item>
-							<el-submenu v-if='item.show&&!item.isLeaf' :index="'index_'+index"  :key='index'>
+							<el-submenu v-show="permission(item.name)"  v-if='item.show&&!item.isLeaf' :index="'index_'+index"  :key='index'>
 								<template slot="title">
 								<template slot="title">
 								<i :class="item.icon"></i>
 								<i :class="item.icon"></i>
 								<span>{{item.name}}</span>
 								<span>{{item.name}}</span>
@@ -83,8 +83,12 @@ export default {
 			})
 			})
 		},
 		},
 		permission(name){
 		permission(name){
-			let permissions=this.info.permissions||''
-			if(permissions.indexOf(name)<0){
+			let permissions=this.info.permissions||[];
+			let list='';
+			for(let i=0;i<permissions.length;i++){
+				list+=permissions[i].name
+			}
+			if(list.indexOf(name)<0){
 				return false;
 				return false;
 			}else{
 			}else{
 				return true;
 				return true;

+ 2 - 1
src/views/company/Company.vue

@@ -67,9 +67,10 @@
                 label="时间">
                 label="时间">
                 </el-table-column>
                 </el-table-column>
                 <el-table-column fixed="right"
                 <el-table-column fixed="right"
-                prop="zip"  width="220"
+                prop="zip"  width="320"
                 label="操作">
                 label="操作">
                 <template slot-scope="scope">
                 <template slot-scope="scope">
+                    <el-button icon="el-icon-view" size="mini" @click="$router.push({path:'/monitjob',query:{id:scope.row.id}})"  type="success">查看巡检记录</el-button>
                     <el-button icon="el-icon-view" size="mini" @click="$router.push({path:'/company/detail',query:{id:scope.row.id}})"  type="success">查看</el-button>
                     <el-button icon="el-icon-view" size="mini" @click="$router.push({path:'/company/detail',query:{id:scope.row.id}})"  type="success">查看</el-button>
                     <el-button icon="el-icon-edit" @click="$router.push({path:'/company/add',query:{id:scope.row.id}})" size="mini" type="warning">编辑</el-button>
                     <el-button icon="el-icon-edit" @click="$router.push({path:'/company/add',query:{id:scope.row.id}})" size="mini" type="warning">编辑</el-button>
                     <el-button icon="el-icon-delete" @click="del(scope.row.id)" size="mini"  type="danger">删除</el-button>
                     <el-button icon="el-icon-delete" @click="del(scope.row.id)" size="mini"  type="danger">删除</el-button>

+ 18 - 2
src/views/task/Monitjob.vue

@@ -24,7 +24,7 @@
                 style="width: 100%">
                 style="width: 100%">
               
               
                 <el-table-column
                 <el-table-column
-                prop="sender_user_name" 
+                prop="enterprise_name" 
                 label="公司名称">
                 label="公司名称">
                 </el-table-column>
                 </el-table-column>
                 <el-table-column
                 <el-table-column
@@ -34,6 +34,14 @@
                 <el-table-column
                 <el-table-column
                 prop="content" 
                 prop="content" 
                 label="任务状态">
                 label="任务状态">
+                <template slot-scope="scope">
+                    <span v-if="scope.row.task_status==-1">过期未巡检</span>
+                    <span v-if="scope.row.task_status==0">待巡检</span>
+                    <span v-if="scope.row.task_status==1">无异常</span>
+                    <span v-if="scope.row.task_status==2">待审核</span>
+                    <span v-if="scope.row.task_status==3">审核中</span>
+                    <span v-if="scope.row.task_status==4">整改中</span>
+                </template>
                 </el-table-column>
                 </el-table-column>
                 <el-table-column
                 <el-table-column
                 prop="report_person_name" 
                 prop="report_person_name" 
@@ -63,7 +71,12 @@
                     {{message.name}}
                     {{message.name}}
                 </el-form-item>
                 </el-form-item>
                 <el-form-item label="任务状态">
                 <el-form-item label="任务状态">
-                    {{message.task_status}}
+                    <span v-if="message.task_status==-1">过期未巡检</span>
+                    <span v-if="message.task_status==0">待巡检</span>
+                    <span v-if="message.task_status==1">无异常</span>
+                    <span v-if="message.task_status==2">待审核</span>
+                    <span v-if="message.task_status==3">审核中</span>
+                    <span v-if="message.task_status==4">整改中</span>
                 </el-form-item>
                 </el-form-item>
                 <el-form-item label="上报人">
                 <el-form-item label="上报人">
                     {{message.report_person_name}}                
                     {{message.report_person_name}}                
@@ -168,6 +181,9 @@ export default {
         }
         }
   },
   },
   created(){
   created(){
+      if(this.$route.query.id){
+            this.form.enterprise_id=this.$route.query.id
+      }
       this.getData()
       this.getData()
   }
   }
 }
 }