Mike vor 8 Jahren
Ursprung
Commit
2ff349e703

+ 44 - 23
yanshi/www/css/style.css

xqd
@@ -6,33 +6,54 @@
        left: 0;
       right: 0;
       }
-      table{
+      
+      ul{
       	width: 80%;
-      	margin: 20px auto;
+      	margin: 0 auto ;
       	font-size: 22px;
       }
-  tr{
-  	height: 28px;
-  }
-  td:nth-child(1){
-  	width: 20%;
+       ul:nth-child(3){
+      	height: 120px;
+      }
+       ul:nth-child(5){
+      	height: 150px;
+      }
+       ul:nth-child(7){
+      	height: 210px;
+      }
+      ul:nth-child(9){
+      	height: 150px;
+      }
+
+ li{
+ 	text-align: center;
+ 	border: 1px solid black;
+ 	float: left;
+ 	height: 30px;
+ 	line-height: 30px;
+ }
+  li:nth-child(4n-3){
+  	font-weight: bold;
+  	width: 30%;
   } 
-   td:nth-child(2){
-  	width: 20%;
+   li:nth-child(4n-2){
+  	width: 30%;
   } 
-   td:nth-child(3){
-  	width: 15%;
+   li:nth-child(4n-1){
+   	font-weight: bold;
+  	width: 30%;
   }   
-   td:nth-child(4){
-  	width: 25%;
-  } 
-   td:nth-child(5){
-  	width: 8%;
+   li:nth-child(4n){
+  	width: 10%;
   } 
-	td{
-		text-align: center;
-		border: 1px solid black;
-	}
-.line{
-	background-color: pink;
-}
+  .line{
+  	width: 80%;
+  	line-height: 30px;
+  	font-size: 22px;
+  	text-align: center;
+  	height: 30px;
+  	background: pink;
+  	border: 1px solid black;
+  	margin: 0 auto;
+  }
+

+ 2 - 2
yanshi/www/index.html

xqd
@@ -27,6 +27,6 @@
 	<script src="js/app.js"></script>
 	<script src="js/controllers.js"></script>
 
-	<!--<script src="https://a.alipayobjects.com/g/datavis/g2/2.2.3/g2.js"></script>
-	<script src="js/g2.js"></script>-->
+	<script src="https://a.alipayobjects.com/g/datavis/g2/2.2.3/g2.js"></script>
+	<script src="js/g2.js"></script>
 

+ 27 - 11
yanshi/www/js/controllers.js

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -94,14 +94,22 @@ starter.controller('showCtrl',["$scope",'$ionicHistory','$state','$timeout','$st
 			$timeout(function() {
 		        $ionicLoading.hide();
 		        //主页参数
-		     	console.log(req.t2);
+		        $scope.table1 = req.t.t1;
+		        $scope.table2 = req.t.t2;
+		        $scope.table3 = req.t.t3;
+		        $scope.table4 = req.t.t4;
+		        
 		        //tn曲线图参数
 				$scope.item1= req.speed;
 				$scope.data2 = [req.torque,req.v,req.p,req.a,req.efficiency];
 				//五轴图参数
 				$scope.item2 = req.nj;
 				$scope.data3 = [req.glys,req.ssgl,req.xl,req.zs,req.dl];
-				
+				//效率云图
+				$scope.x = req.n_zs;
+				$scope.y = req.n_zj;
+				$scope.z = req.n_xl;
+				console.log(req)
 			});
 		}).error(function(){
 			$timeout(function(){
@@ -116,8 +124,8 @@ starter.controller('showCtrl',["$scope",'$ionicHistory','$state','$timeout','$st
 			     ]
 		        });
 			})
-		})
-
+		})	
+		
 		var Stat = G2.Stat;
 	    var vvvdata = [];
 	    for(var i = 0; i <= 20; i ++) {
@@ -135,14 +143,14 @@ starter.controller('showCtrl',["$scope",'$ionicHistory','$state','$timeout','$st
       var chart = new G2.Chart({
         id: 'c1',
         forceFit: true,
-        height: 450
+        height: 700
       });
       //为了将数据与图片上的位置完全吻合,我们需要将横轴和纵轴的范围设定为数据对应范围,并将范围优化处理关闭
       var defs = {
         'l': {
           type: 'linear',
-          min: 0,
-          max: 512,
+          min: 2735,
+          max: 2900,
           nice: false//优化处理关闭
         },
         'g': {
@@ -152,7 +160,7 @@ starter.controller('showCtrl',["$scope",'$ionicHistory','$state','$timeout','$st
           nice: false
         },
         'Altitude': {
-          tickCount:200
+          tickCount:5
         }
       };
 
@@ -173,13 +181,17 @@ starter.controller('showCtrl',["$scope",'$ionicHistory','$state','$timeout','$st
 		}).success(function(req){	
 		    $ionicLoading.hide();
 			$timeout(function() {
+				 //主页参数
+		        $scope.table1 = req.t.t1;
+		        $scope.table2 = req.t.t2;
+		        $scope.table3 = req.t.t3;
+		        $scope.table4 = req.t.t4;
 		        //tn曲线图参数
 				$scope.item1= req.speed;
 				$scope.data2 = [req.torque,req.v,req.p,req.a,req.efficiency];
 				//五轴图参数
-				$scope.item2 = req.torque;
-				$scope.data3 = [req.speed,req.v,req.p,req.a,req.efficiency];
-				console.log(req)
+				$scope.item2 = req.nj;
+				$scope.data3 = [req.glys,req.ssgl,req.xl,req.zs,req.dl];
 			});
 		}).error(function(){
 			$timeout(function(){
@@ -196,6 +208,8 @@ starter.controller('showCtrl',["$scope",'$ionicHistory','$state','$timeout','$st
 			})
 		})
 	}
+    
+    	
 
 	$scope.tabs = [
 	{"title":"主页","url":"line.html"},
@@ -224,6 +238,7 @@ starter.controller('showCtrl',["$scope",'$ionicHistory','$state','$timeout','$st
     $scope.num = [0,1,2,3,4];
 
 }])
+
 starter.filter('filet', function () {
     return function (filepath) {
     	if(filepath){
@@ -232,6 +247,7 @@ starter.filter('filet', function () {
         }
     };
 }) 
+
 starter.directive('main', function() {  
     return {  
         scope: {  

+ 0 - 26
yanshi/www/js/g2.js

xqd
@@ -1,26 +0,0 @@
-var data = [
-  {genre: 'Sports', sold: 275},
-  {genre: 'Strategy', sold: 115},
-  {genre: 'Action', sold: 120},
-  {genre: 'Shooter', sold: 350},
-  {genre: 'Other', sold: 150},
-]; // G2 对数据源格式的要求,仅仅是 JSON 数组,数组的每个元素是一个标准 JSON 对象。
-// Step 1: 创建 Chart 对象
-var chart = new G2.Chart({
-  id: 'c1', // 指定图表容器 ID
-  width : 600, // 指定图表宽度
-  height : 300 // 指定图表高度
-});
-// Step 2: 载入数据源
-chart.source(data, {
-  genre: {
-    alias: '游戏种类' // 列定义,定义该属性显示的别名
-  },
-  sold: {
-    alias: '销售量'
-  }
-});
-// Step 3:创建图形语法,绘制柱状图,由 genre 和 sold 两个属性决定图形位置,genre 映射至 x 轴,sold 映射至 y 轴
-chart.interval().position('genre*sold').color('genre')
-// Step 4: 渲染图表
-chart.render();

+ 0 - 1
yanshi/www/templates/login.html

xqd
@@ -13,6 +13,5 @@
     <div style="text-align: center;margin-top: 15%;">
     	<button class="button button-calm" style="width: 70%;font-weight: bold;" ng-click="login()">登录</button>
     </div>
-    
   </ion-content>
 </ion-view>

+ 42 - 74
yanshi/www/templates/show.html

xqd xqd xqd
@@ -1,4 +1,4 @@
-<ion-view view-title="{{name | filet }}">
+<ion-view view-title="{{name}}">
     <ion-nav-bar class="nav-bar-container" nav-bar-transition="ios" nav-bar-direction="exit" nav-swipe="">
         <ion-nav-buttons side="left">
              <button class="icon ion-chevron-left" style="font-size: 16px;border: none;background: white;" ng-click="go('home')">返回</button>
@@ -15,82 +15,50 @@
 		</div>
 	</ion-content>
 	<script id="line.html" type="text/ng-template">
-		<button ng-click='refresh()' style="margin: 10px;font-size: 24px;">刷新任务</button>
+		
 		<select style="display: block; width: 25%;height: 44px;font-size: 24px;" ng-change="change(selectedName)" 
 		ng-model="selectedName" ng-init="selectedName = name" ng-options="x for x in excels">
 		</select>
 		<h1 style="text-align: center;font-weight: bold;">电机自动化测试报告</h1>
-		<table>
-			<tr>
-				<td>PA设备</td>
-				<td>PA设备</td>
-				<td></td>
-				<td></td>
-				<td></td>
-			</tr>
-			<tr>
-				<td>系统设备</td>
-				<td>系统设备</td>
-				<td></td>
-				<td></td>
-				<td></td>
-			</tr>
-			<tr>
-				<td>测温设备</td>
-				<td>热电偶</td>
-				<td></td>
-				<td></td>
-				<td></td>
-			</tr>
-			<tr>
-				<td>传感器设备</td>
-				<td>扭矩传感器</td>
-				<td></td>
-				<td></td>
-				<td></td>
-			</tr>
-
-			<tr  class="line" ng-repeat="x in records track by $index"> </tr>
-				<td colspan="5">驱动器设备</td>
-			</tr>
-			<tr>
-				<td style="font-weight: bold;"></td>
-				<td></td>
-				<td></td>
-				<td style="font-weight: bold;"></td>
-				<td></td>
-			</tr>
-			<tr class="line">
-				<td colspan="5">电机设备</td>
-			</tr>
-			<tr>
-				<td style="font-weight: bold;"></td>
-				<td></td>
-				<td></td>
-				<td style="font-weight: bold;"></td>
-				<td></td>
-			</tr>
-			<tr class="line">
-				<td colspan="5">驱动器设备</td>
-			</tr>
-			<tr>
-				<td style="font-weight: bold;"></td>
-				<td></td>
-				<td></td>
-				<td style="font-weight: bold;"></td>
-				<td></td>
-			</tr>
-			<tr class="line">
-				<td colspan="5">电机设备</td>
-			</tr>
-			<tr>
-				<td style="font-weight: bold;"></td>
-				<td></td>
-				<td></td>
-				<td style="font-weight: bold;"></td>
-				<td></td>
-			</tr>
-		</table>
+		<ul>
+			<li>PA设备</li>
+			<li>PA设备</li>
+			<li></li>
+			<li></li>
+			<li>系统设备</li>
+			<li>系统设备</li>
+			<li></li>
+			<li></li>
+			<li>测温设备</li>
+			<li>热电偶</li>
+			<li></li>
+			<li></li>
+			<li>传感器设备</li>
+			<li>扭矩传感器</li>
+			<li></li>
+			<li></li>
+		</ul>
+		<div class="line">驱动器设备</div>
+		<ul>
+			<li ng-repeat="tab1 in table1 track by $index">{{tab1}}</li>
+			<li></li>
+			<li></li>
+		</ul>
+		<div class="line">电机设备</div>
+		<ul>
+			<li ng-repeat="tab2 in table2 track by $index">{{tab2}}</li>
+		</ul>
+		<div class="line">驱动器设备</div>
+		<ul>
+			<li ng-repeat="tab3 in table3 track by $index">{{tab3}}</li>
+			<li></li>
+			<li></li>
+		</ul>
+		<div class="line">电机设备</div>
+		<ul>
+			<li ng-repeat="tab4 in table4 track by $index">{{tab4}}</li>
+		</ul>
+		
 	</script>	
 	<script id="tn.html" type="text/ng-template">
 		<div>
@@ -103,7 +71,7 @@
 		</div>
 	</script>
 	<div id="newchats">
-	<div id="c1"></div>
+		<div id="c1"></div>
 	</div>
 		
 </ion-view>