lvxinghai 4 年 前
コミット
b3b6b9062a

+ 1 - 1
components/tm-callback-listpage/tm-callback-listpage.vue

@@ -25,7 +25,7 @@
 
 <style lang="less">
 	.tm-callback-listpage {
-		position: absolute;
+		position: fixed;
 		left: 25rpx;
 		bottom: 100rpx;
 		width: 75rpx;

+ 1 - 1
components/tm-modal/tm-modal.vue

@@ -21,7 +21,7 @@
 <style lang="less">
 	.tm-modal {
 		overflow: hidden;
-		position: absolute;
+		position: fixed;
 		top: 0;
 		left: 0;
 		width: 100%;

+ 2 - 1
pages/calendar/calendar.vue

@@ -61,6 +61,7 @@
 
 <script>
 import websocket from "../../utils/ws.js"; //引入websocket
+import {wsURL} from "../../utils/requestUrl.js";
 import moment from "moment";
 import changeCalendar from "./components/changeCalendar.vue";
 export default {
@@ -140,7 +141,7 @@ export default {
       this.getCanList();
     },
     initWebsocket(hiId, user, permission) {
-      websocket.url = `ws://192.168.1.45:8088/imed/pfm/websocket/${hiId}/${user}/${permission}`;
+      websocket.url = wsURL(hiId, user, permission);
       websocket.createWebSocket(this.resolverWsData.bind(this));
     },
     // 解析websocket返回数据

+ 9 - 8
pages/checkList/checkList.vue

@@ -3,7 +3,7 @@
 		<scroll-view scroll-y="true" class="check-map-list">
 			<tm-top-menu>
 				<view class="top-menu"  @click="showModalHandle(!showModal)">
-					<text>第{{checkIndex}}/{{planList.length}}次查核</text>
+					<text>{{createTitle}}</text>
 					<image :src="`../../static/${showModal?'open':'close'}-icon.png`"></image>
 				</view>
 			</tm-top-menu>
@@ -77,12 +77,13 @@
 			};
 		},
 		computed: {
-			checkIndex: function() {
-				let index = this.planList.findIndex((item)=> item.id === this.checkId);
-				if(index !== -1) {
-					return index + 1;
+			createTitle: function() {
+				let item = this.planList.find((item)=> item.id === this.checkId);
+				if(item) {
+					let name = item.name;
+					return name.slice(0, name.length - 3) + `/${this.planList.length}` + name.slice(-3);
 				} else {
-					return 0;
+					return '';
 				}
 			}
 		},
@@ -90,8 +91,8 @@
 			this.dispatch('planList', {situationId}).then((data)=>{
 				if(data) {
 					this.planList = data;
-					let check = data.find((item)=> Number(item.status)=== 2);
-					this.checkId = check ? check.id 
+					let checkArr = data.filter((item)=> Number(item.status)=== 2).sort((a,b)=>a.createTime - b.createTime);
+					this.checkId = checkArr ? checkArr[checkArr.length - 1].id 
 						: data.length > 0 ? data[0].id : '';
 					this.getDepList();
 				}

+ 2 - 1
pages/mission/mission.vue

@@ -42,6 +42,7 @@
 	// 任务列表
 	import listItem from './components/list-item.vue';
 	import websocket from '../../utils/ws.js';//引入websocket
+	import {wsURL} from "../../utils/requestUrl.js";
 	export default {
 		data(){
 			return {
@@ -163,7 +164,7 @@
 				 */
 			},
 			initWebsocket(hiId,user,permission) {
-			    websocket.url = `ws://192.168.1.45:8088/imed/pfm/websocket/${hiId}/${user}/${permission}`;
+			    websocket.url = wsURL(hiId, user, permission);
 			    websocket.createWebSocket(this.resolverWsData.bind(this));
 			},
 			// 解析websocket返回数据

+ 3 - 1
pages/situationsCenter/situationsCenter.vue

@@ -95,6 +95,8 @@
  */
 <script>
 import websocket from "../../utils/ws.js"; //引入websocket
+import {wsURL} from "../../utils/requestUrl.js";
+
 export default {
   data() {
     return {
@@ -240,7 +242,7 @@ export default {
       this.initSituationList();
     },
     initWebsocket(hiId, user, permission) {
-      websocket.url = `ws://192.168.1.45:8088/imed/pfm/websocket/${hiId}/${user}/${permission}`;
+      websocket.url = wsURL(hiId, user, permission);
       websocket.createWebSocket(this.resolverWsData.bind(this));
     },
     // 解析websocket返回数据

+ 1 - 1
utils/request.js

@@ -8,7 +8,7 @@
 import { URL } from "./requestUrl";
 import { stringify } from 'qs';
 
-const BASE_URL = `${URL}/imed/pfm/`;
+const BASE_URL = `http://${URL}`;
 let AllRequestNum = 0; // 存放请求数,以保证有请求未返回就持续loading
 
 /**

+ 9 - 8
utils/requestUrl.js

@@ -1,8 +1,9 @@
-// export const URL = 'http://192.168.51.80:8801'; // 本地
-// export const URL = 'http://192.168.38.174:8088';
-// export const URL = 'http://192.168.1.45:8088'; //内网
-// export const URL = 'http://s1.nsloop.com:5137';  // 外网
-export const URL = 'http://121.43.139.179:8801';  // 云端服务1
-// export const URL = 'http://172.18.116.20:8801';  // 云端服务2
-
-
+export const URL = '192.168.51.80:8801/imed/pfm/'; // 本地
+// export const URL = '192.168.38.174:8088/imed/pfm/';
+// export const URL = '192.168.1.45:8088/imed/pfm/'; //内网
+// export const URL = 's1.nsloop.com:5137/imed/pfm/';  // 外网
+// export const URL = '121.43.139.179:8801/imed/pfm/';  // 云端服务1
+// export const URL = '172.18.116.20:8801/imed/pfm/';  // 云端服务2
+export const wsURL = (hiId, user, permission) => {
+	return `ws://${URL}websocket/${hiId}/${user}/${permission}`;
+}

+ 0 - 3
utils/wsUrl.js

@@ -1,3 +0,0 @@
-// export const wsURL = `ws://192.168.1.45:8088/websocket/${hiId}/${user}/${permission}`; // 内网
-export const wsURL = `ws://121.43.139.179:8801/websocket/${hiId}/${user}/${permission}`; // 云端服务1
-// export const wsURL = `ws://172.18.116.20:8801/websocket/${hiId}/${user}/${permission}`; // 云端服务2