zkx 1 year ago
parent
commit
02e4f733d3
4 changed files with 34 additions and 5 deletions
  1. 1 1
      components/tree/tree-node.vue
  2. 2 2
      config/.env.dev.js
  3. 30 1
      main.js
  4. 1 1
      pages/managementList/applyAuthorisation.vue

+ 1 - 1
components/tree/tree-node.vue

@@ -16,7 +16,7 @@
 				
 			  <view class="meter-name"  :style="level==0||level==1?'font-weight: bold;':''"
 			   
-			   @click="toggle" >{{ node.name }}</view>
+			   @click="toggle" >{{replaceLastTwoWords( node.name )}}</view>
 			   <template v-if="level==0&&showPark">
 				   <view class="meter-state" v-if="node.online">
 				   				在线

+ 2 - 2
config/.env.dev.js

@@ -3,7 +3,7 @@ const UNI_APP = {
 	//BASE_URL: 'http://36.134.122.108/railroad-server/',
 
 	BASE_URL: 'https://charging.xiaoxinda.com/electric-manager-api/', //test
-	//BASE_URL: 'https://dgj.hbjp.com.cn/electric-manager-api/',
+	BASE_URL: 'https://dgj.hbjp.com.cn/electric-manager-api/',
 	
 	//BASE_URL:'http://192.168.77.162:8081/electric-manager-api/', //sz
 	
@@ -16,7 +16,7 @@ const UNI_APP = {
 	// openId:"oK9Wr54VbEh3xvWYmD_zT5NbH4AY",
 	//openId:"oLowyuOJvTszgk96C0f8j0XfcEXg",//zkx
 	
-	//openId:"oLowyuAJ1Ld0ivnLj4qp1k5Vy_l4", //老板
+	openId:"oLowyuAJ1Ld0ivnLj4qp1k5Vy_l4", //老板
 	//openId:"oLowyuFTU3SzpvU4pGNzWk7NC9y0", //me
 	//openId:"oLowyuMMjIkA_bLA4MXzRQ3KJB2E",
 	//openId:"oLowyuHCGgMomNBQEXZSbb5SJxfQ",//杨所

+ 30 - 1
main.js

@@ -51,7 +51,36 @@ Vue.mixin({
 		
 
 	},
-	methods: {
+	methods: {
+		replaceLastTwoWords(str) {
+		
+		  
+		
+		
+		    return str;  
+		
+		},
+		 replaceLastTwoWords2(str) {  
+		
+		  
+		
+		    if (str.length >= 2 && str.indexOf('总表') !=-1) {  
+		
+		
+		        return str.replace('总表', '总电源');  
+		
+		    }  
+			if (str.length >= 2 && str.indexOf('电表') !=-1) {  
+					
+					
+			  return str.replace('电表', '电源');  
+					
+			}  
+		
+		
+		    return str;  
+		
+		},
 		jpAmount(amount){
 			if(amount){
 				return amount.toFixed(2)

+ 1 - 1
pages/managementList/applyAuthorisation.vue

@@ -9,7 +9,7 @@
 				 :key="i" >
 					 <view class="item1">
 						 <view class="item11">
-						 {{replaceLastTwoWords(item.name)}}</view>
+						 {{replaceLastTwoWords2(item.name)}}</view>
 						  <view class="item12">电源状态:<span>{{item.switchStatus?'开':'关'}}</span></view>
 					 </view>