Просмотр исходного кода

[Feat 0000]ip配置功能优化

bobo04052021@163.com 1 день назад
Родитель
Сommit
bbc92b8036

+ 6 - 1
common/service/config.service.js

@@ -7,7 +7,11 @@ if (process.env.NODE_ENV == "development") {
   // BASE_URL = "http://10.35.116.82:9999";//棋盘井东区
   // BASE_URL = "http://10.35.116.82:9999";//棋盘井东区
   // BASE_URL = "http://192.168.126.12:9999";//王洼二矿
   // BASE_URL = "http://192.168.126.12:9999";//王洼二矿
   // BASE_URL = "http://172.17.3.15:9999"; //黑龙煤矿
   // BASE_URL = "http://172.17.3.15:9999"; //黑龙煤矿
-  // BASE_URL = "http://182.92.126.35:9999";
+  BASE_URL = "http://172.19.7.101:9999"; //准东二矿
+  // BASE_URL = "http://172.16.53.16:9999"; //大海则煤矿
+  //BASE_URL = "http://10.7.0.19:9999"; //特拉布拉
+  //BASE_URL = "http://10.35.116.82:9999"; //棋盘井东区
+  //BASE_URL = "http://182.92.126.35:9999"; //测试环境
 }
 }
 let staticDomainURL = BASE_URL + "/sys/common/static";
 let staticDomainURL = BASE_URL + "/sys/common/static";
 const configService = {
 const configService = {
@@ -15,6 +19,7 @@ const configService = {
   apiUrlP: "http://182.92.126.35",
   apiUrlP: "http://182.92.126.35",
   // apiUrlP: 'http://182.92.126.35:6006',
   // apiUrlP: 'http://182.92.126.35:6006',
   staticDomainURL: staticDomainURL,
   staticDomainURL: staticDomainURL,
+  hasBaseUrl: !!BASE_URL,
 };
 };
 
 
 export default configService;
 export default configService;

+ 1 - 1
pages/gasreport/components/gasImgIdentify.vue

@@ -150,7 +150,7 @@
 import api from "@/api/api";
 import api from "@/api/api";
 import moment from "moment";
 import moment from "moment";
 import configService from "@/common/service/config.service.js";
 import configService from "@/common/service/config.service.js";
-import { RHFselcet } from "@/uni_modules/fz-media-selcet";
+// import { RHFselcet } from "@/uni_modules/fz-media-selcet";
 import helangCompress from "@/components/helang-compress/helang-compress";
 import helangCompress from "@/components/helang-compress/helang-compress";
 export default {
 export default {
   name: "gasFill",
   name: "gasFill",

+ 61 - 34
pages/ipConfig/ipConfig.vue

@@ -1,15 +1,27 @@
   <template>
   <template>
-    <view class="zai-box">
-      <scroll-view scroll-y class="page">
-        <view class="IPSet">
-          <span class="text-style"><u-button :plain="true" color="#18a5ff" size="small" :text="IPSet ? IPSet : '选择IP地址'"
-              @tap="changeIP()"></u-button></span>
-          <u-picker :show="ipShow" :columns="IpConfig" @cancel="ipShow = false" @confirm="selectIpAddr"
-            keyName="label"></u-picker>
-        </view>
-      </scroll-view>
-    </view>
-  </template>
+  <view class="zai-box">
+    <scroll-view scroll-y class="page">
+      <view class="IPSet">
+        <span class="text-style"
+          ><u-button
+            :plain="true"
+            color="#18a5ff"
+            size="small"
+            :text="IPSet ? IPSet : '选择IP地址'"
+            @tap="changeIP()"
+          ></u-button
+        ></span>
+        <u-picker
+          :show="ipShow"
+          :columns="IpConfig"
+          @cancel="ipShow = false"
+          @confirm="selectIpAddr"
+          keyName="label"
+        ></u-picker>
+      </view>
+    </scroll-view>
+  </view>
+</template>
 
 
 <script>
 <script>
 import configService from "@/common/service/config.service.js";
 import configService from "@/common/service/config.service.js";
@@ -21,25 +33,40 @@ export default {
       IPSet: "",
       IPSet: "",
       IpConfig: [
       IpConfig: [
         [
         [
-          { label: "棋盘井", value: "http://10.35.116.82:9999", code: 'qpj' },
-          { label: "准东二矿", value: "http://172.19.7.101:9999", code: 'zdrk' },
-          { label: "大海则煤矿", value: "http://172.16.53.16:9999", code: 'dhz' },
-          { label: "大柳塔井", value: "http://10.248.135.10:9999", code: 'dlt' },
-          { label: "活鸡兔井", value: "http://10.248.135.121:9999", code: 'hjt' },
-          { label: "寸草塔二矿", value: "http://10.246.63.5:9999", code: 'cctr' },
-          { label: "乌兰木伦", value: "http://10.246.183.35:9999", code: 'wlml' },
-          { label: "哈拉沟煤矿", value: "http://10.248.223.12:9999", code: 'hlg' },
-          { label: "布尔台", value: "http://10.246.95.4:9999", code: 'brt' },
-          { label: "上湾", value: "http://10.246.167.205:9999", code: 'sw' },
-          { label: "锦界", value: "http://10.248.151.42:9999", code: 'jj' },
-          { label: "补连塔", value: "http://10.246.175.16:9999", code: 'blt' },
-          { label: "寸草塔", value: "http://10.246.23.171:9999", code: 'cct' },
-          { label: "柳塔", value: "http://10.246.87.121:9999", code: 'lt' },
-          { label: "石圪台", value: "http://10.246.191.13:9999", code: 'sgt' },
-          { label: "榆家梁", value: "http://10.248.143.211:9999", code: 'yjl' },
-          { label: "开发", value: "http://182.92.126.35:9999", code: 'kf' },
-          { label: "测试", value: "http://182.92.126.35:9998", code: 'cs' },
-          { label: "特拉布拉", value: "http://10.7.0.19:9999", code: 'lblt' },
+          {
+            label: "大柳塔井",
+            value: "http://10.248.135.10:9999",
+            code: "dlt",
+          },
+          {
+            label: "活鸡兔井",
+            value: "http://10.248.135.121:9999",
+            code: "hjt",
+          },
+          {
+            label: "寸草塔二矿",
+            value: "http://10.246.63.5:9999",
+            code: "cctr",
+          },
+          {
+            label: "乌兰木伦",
+            value: "http://10.246.183.35:9999",
+            code: "wlml",
+          },
+          {
+            label: "哈拉沟煤矿",
+            value: "http://10.248.223.12:9999",
+            code: "hlg",
+          },
+          { label: "布尔台", value: "http://10.246.95.4:9999", code: "brt" },
+          { label: "上湾", value: "http://10.246.167.205:9999", code: "sw" },
+          { label: "锦界", value: "http://10.248.151.42:9999", code: "jj" },
+          { label: "补连塔", value: "http://10.246.175.16:9999", code: "blt" },
+          { label: "寸草塔", value: "http://10.246.23.171:9999", code: "cct" },
+          { label: "柳塔", value: "http://10.246.87.121:9999", code: "lt" },
+          { label: "石圪台", value: "http://10.246.191.13:9999", code: "sgt" },
+          { label: "榆家梁", value: "http://10.248.143.211:9999", code: "yjl" },
+          { label: "保德", value: "http://10.248.210.152:9999", code: "bd" },
         ],
         ],
       ],
       ],
       fromSetting: false, // 是否来自设置页
       fromSetting: false, // 是否来自设置页
@@ -56,9 +83,9 @@ export default {
       this.ipShow = false;
       this.ipShow = false;
       this.ip = e.value[0].value;
       this.ip = e.value[0].value;
       const fullURL = e.value[0].value;
       const fullURL = e.value[0].value;
-      console.log(fullURL, 'fullURL')
-      const apicode = e.value[0].code
-      console.log(apicode, '9900')
+      console.log(fullURL, "fullURL");
+      const apicode = e.value[0].code;
+      console.log(apicode, "9900");
       this.IPSet = e.value[0].label;
       this.IPSet = e.value[0].label;
       configService.apiUrl = fullURL;
       configService.apiUrl = fullURL;
       uni.setStorageSync("selectedIP", true);
       uni.setStorageSync("selectedIP", true);
@@ -78,7 +105,7 @@ export default {
       this.ipShow = true;
       this.ipShow = true;
     },
     },
   },
   },
-  beforeDestroy() { },
+  beforeDestroy() {},
 };
 };
 </script>
 </script>
 
 

+ 42 - 24
pages/login/login.vue

@@ -9,7 +9,7 @@
         </view>
         </view>
         <view class="text-center" :style="[{ animation: 'show ' + 0.4 + 's 1' }]">
         <view class="text-center" :style="[{ animation: 'show ' + 0.4 + 's 1' }]">
           <!-- <u-link  class="zai-title2 text-shadow " href="http://localhost:8080?ticket=234" >切换单点登录</u-link> -->
           <!-- <u-link  class="zai-title2 text-shadow " href="http://localhost:8080?ticket=234" >切换单点登录</u-link> -->
-          <view class="zai-title2 text-shadow " @click="changeloginType">切换单点登录</view>
+          <view class="zai-title2 text-shadow " v-if="!hasBaseUrl" @click="changeloginType">切换单点登录</view>
         </view>
         </view>
         <view class="box padding-lr-xl login-paddingtop" :style="[{ animation: 'show ' + 0.6 + 's 1' }]">
         <view class="box padding-lr-xl login-paddingtop" :style="[{ animation: 'show ' + 0.6 + 's 1' }]">
           <block>
           <block>
@@ -46,7 +46,7 @@
         <image src="/static/desk-img/144.png" mode="aspectFit" class="round"></image>
         <image src="/static/desk-img/144.png" mode="aspectFit" class="round"></image>
         <view class="gray-text">登录中...</view>
         <view class="gray-text">登录中...</view>
       </view>
       </view>
-      <scroll-view scroll-y class="page" v-if="ipShow">
+      <scroll-view scroll-y class="page" v-if="!hasBaseUrl">
         <!-- <view class="IPSet">
         <!-- <view class="IPSet">
             <span class="text-style">IP地址:  <u--input
             <span class="text-style">IP地址:  <u--input
               placeholder="请输入IP地址"
               placeholder="请输入IP地址"
@@ -108,25 +108,40 @@ export default {
       IPSet: "",
       IPSet: "",
       IpConfig: [
       IpConfig: [
         [
         [
-          { label: "棋盘井", value: "http://10.35.116.82:9999", code: 'qpj' },
-          { label: "准东二矿", value: "http://172.19.7.101:9999", code: 'zdrk' },
-          { label: "大海则煤矿", value: "http://172.16.53.16:9999", code: 'dhz' },
-          { label: "大柳塔井", value: "http://10.248.135.10:9999", code: 'dlt' },
-          { label: "活鸡兔井", value: "http://10.248.135.121:9999", code: 'hjt' },
-          { label: "寸草塔二矿", value: "http://10.246.63.5:9999", code: 'cctr' },
-          { label: "乌兰木伦", value: "http://10.246.183.35:9999", code: 'wlml' },
-          { label: "哈拉沟煤矿", value: "http://10.248.223.12:9999", code: 'hlg' },
-          { label: "布尔台", value: "http://10.246.95.4:9999", code: 'brt' },
-          { label: "上湾", value: "http://10.246.167.205:9999", code: 'sw' },
-          { label: "锦界", value: "http://10.248.151.42:9999", code: 'jj' },
-          { label: "补连塔", value: "http://10.246.175.16:9999", code: 'blt' },
-          { label: "寸草塔", value: "http://10.246.23.171:9999", code: 'cct' },
-          { label: "柳塔", value: "http://10.246.87.121:9999", code: 'lt' },
-          { label: "石圪台", value: "http://10.246.191.13:9999", code: 'sgt' },
-          { label: "榆家梁", value: "http://10.248.143.211:9999", code: 'yjl' },
-          { label: "开发", value: "http://182.92.126.35:9999", code: 'kf' },
-          { label: "测试", value: "http://182.92.126.35:9998", code: 'cs' },
-          { label: "特拉布拉", value: "http://10.7.0.19:9999", code: 'lblt' },
+          {
+            label: "大柳塔井",
+            value: "http://10.248.135.10:9999",
+            code: "dlt",
+          },
+          {
+            label: "活鸡兔井",
+            value: "http://10.248.135.121:9999",
+            code: "hjt",
+          },
+          {
+            label: "寸草塔二矿",
+            value: "http://10.246.63.5:9999",
+            code: "cctr",
+          },
+          {
+            label: "乌兰木伦",
+            value: "http://10.246.183.35:9999",
+            code: "wlml",
+          },
+          {
+            label: "哈拉沟煤矿",
+            value: "http://10.248.223.12:9999",
+            code: "hlg",
+          },
+          { label: "布尔台", value: "http://10.246.95.4:9999", code: "brt" },
+          { label: "上湾", value: "http://10.246.167.205:9999", code: "sw" },
+          { label: "锦界", value: "http://10.248.151.42:9999", code: "jj" },
+          { label: "补连塔", value: "http://10.246.175.16:9999", code: "blt" },
+          { label: "寸草塔", value: "http://10.246.23.171:9999", code: "cct" },
+          { label: "柳塔", value: "http://10.246.87.121:9999", code: "lt" },
+          { label: "石圪台", value: "http://10.246.191.13:9999", code: "sgt" },
+          { label: "榆家梁", value: "http://10.248.143.211:9999", code: "yjl" },
+          { label: "保德", value: "http://10.248.210.152:9999", code: "bd" },
         ],
         ],
       ],
       ],
     };
     };
@@ -142,6 +157,9 @@ export default {
     // #endif
     // #endif
   },
   },
   computed: {
   computed: {
+    hasBaseUrl() {
+      return configService.hasBaseUrl;
+    },
     isSendSMSEnable() {
     isSendSMSEnable() {
       return this.smsCountDown <= 0 && this.phoneNo.length > 4;
       return this.smsCountDown <= 0 && this.phoneNo.length > 4;
     },
     },
@@ -179,7 +197,7 @@ export default {
       let loginParams = {
       let loginParams = {
         username: this.userName,
         username: this.userName,
         password: this.password,
         password: this.password,
-        clientId: uni.getStorageSync('push_cid')
+        clientId: uni.getStorageSync("push_cid"),
       };
       };
       // 加密
       // 加密
       const loginCipher = getLoginCipher();
       const loginCipher = getLoginCipher();
@@ -417,7 +435,7 @@ export default {
       this.ipShow1 = false;
       this.ipShow1 = false;
       const fullURL = e.value[0].value;
       const fullURL = e.value[0].value;
       this.IPSet = e.value[0].label;
       this.IPSet = e.value[0].label;
-      const apiCode = e.value[0].code
+      const apiCode = e.value[0].code;
       configService.apiUrl = fullURL;
       configService.apiUrl = fullURL;
       uni.setStorageSync("apiUrl", configService.apiUrl);
       uni.setStorageSync("apiUrl", configService.apiUrl);
       uni.setStorageSync("apiCode", apiCode);
       uni.setStorageSync("apiCode", apiCode);
@@ -491,4 +509,4 @@ export default {
 .text-style {
 .text-style {
   margin: 20px;
   margin: 20px;
 }
 }
-</style>
+</style>