From d55581ed00fd0a8ecce78a6ebe6f9e2ee86274b3 Mon Sep 17 00:00:00 2001
From: zyx <zyx123456>
Date: 星期五, 04 八月 2023 17:01:13 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/tzskasrs' into tzskasrs
---
src/main/java/com/zy/asrs/controller/MapController.java | 62 ++++++++++--------------------
src/main/webapp/views/home/map.html | 17 ++++----
src/main/webapp/views/home/map_realtime.html | 18 +++++++-
3 files changed, 45 insertions(+), 52 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/MapController.java b/src/main/java/com/zy/asrs/controller/MapController.java
index a4d9ec8..c3d6517 100644
--- a/src/main/java/com/zy/asrs/controller/MapController.java
+++ b/src/main/java/com/zy/asrs/controller/MapController.java
@@ -50,22 +50,9 @@
@GetMapping("/map/getData/{lev}/auth")
@ManagerAuth
public String getMapData(@PathVariable("lev") Integer lev) {
- try {
- String mapFilename = "map.json";
- String fileName = this.getClass().getClassLoader().getResource(mapFilename).getPath();//鑾峰彇鏂囦欢璺緞
- File file = new File(fileName);
- StringBuffer stringBuffer = new StringBuffer();
- if (file.isFile() && file.exists()) {
- InputStreamReader isr = new InputStreamReader(new FileInputStream(file), "GBK");
- BufferedReader br = new BufferedReader(isr);
- String lineTxt = null;
- while ((lineTxt = br.readLine()) != null) {
- stringBuffer.append(lineTxt);
- }
- br.close();
-
- //瑙f瀽json鍦板浘鏁版嵁
- List<ArrayList> arrayLists = JSON.parseArray(stringBuffer.toString(), ArrayList.class);
+ BasMap basMap = basMapService.selectLatestMap(lev);
+ //瑙f瀽json鍦板浘鏁版嵁
+ List<ArrayList> arrayLists = JSON.parseArray(basMap.getData(), ArrayList.class);
// ArrayList<HashMap<String, Integer>> lineRows = new ArrayList<>();
// int dataRow = 0;
// int dataRowCount = 0;
@@ -95,11 +82,11 @@
// }
// }
- //鑾峰彇褰撳墠妤煎眰搴撲綅鏁版嵁
- List<LocMast> locMasts = locMastService.selectLocByLev(lev);
- for (LocMast locMast : locMasts) {
- Integer row = locMast.getRow1();
- Integer bay = locMast.getBay1();
+ //鑾峰彇褰撳墠妤煎眰搴撲綅鏁版嵁
+ List<LocMast> locMasts = locMastService.selectLocByLev(lev);
+ for (LocMast locMast : locMasts) {
+ Integer row = locMast.getRow1();
+ Integer bay = locMast.getBay1();
// for (HashMap<String, Integer> lineRow : lineRows) {
// if (row > lineRow.get("start") && row <= lineRow.get("end")) {
// row += lineRow.get("count");
@@ -107,28 +94,21 @@
// }
// }
- ArrayList rowData = arrayLists.get(row);
- Object o = rowData.get(bay);
- JSONObject jsonObject = JSON.parseObject(o.toString());
- if (DISABLE_LOC_NO.contains(locMast.getLocNo())) {
- //绂佹搴撲綅
- jsonObject.put("value", 10);//灏嗙鐢ㄥ簱浣嶈繘琛岃缃�
- }
- jsonObject.put("locNo", locMast.getLocNo());//璁剧疆搴撲綅鍙�
- jsonObject.put("locSts", locMast.getLocSts());//搴撲綅鐘舵��
- //鏇存柊list
- rowData.set(bay, jsonObject);
- arrayLists.set(row, rowData);
- }
-
- return JSONObject.toJSONString(arrayLists);
- } else {
- System.out.println("鏂囦欢涓嶅瓨鍦�!");
+ ArrayList rowData = arrayLists.get(row);
+ Object o = rowData.get(bay);
+ JSONObject jsonObject = JSON.parseObject(o.toString());
+ if (DISABLE_LOC_NO.contains(locMast.getLocNo())) {
+ //绂佹搴撲綅
+ jsonObject.put("value", 10);//灏嗙鐢ㄥ簱浣嶈繘琛岃缃�
}
- } catch (IOException ioException) {
- ioException.printStackTrace();
+ jsonObject.put("locNo", locMast.getLocNo());//璁剧疆搴撲綅鍙�
+ jsonObject.put("locSts", locMast.getLocSts());//搴撲綅鐘舵��
+ //鏇存柊list
+ rowData.set(bay, jsonObject);
+ arrayLists.set(row, rowData);
}
- return null;
+
+ return JSONObject.toJSONString(arrayLists);
}
@RequestMapping("/map/searchData/auth")
diff --git a/src/main/webapp/views/home/map.html b/src/main/webapp/views/home/map.html
index 0e0126d..bf23ea1 100644
--- a/src/main/webapp/views/home/map.html
+++ b/src/main/webapp/views/home/map.html
@@ -381,7 +381,7 @@
</head>
<body>
<div id="app" style="display: flex;justify-content: space-around;margin-top: 50px;flex-wrap: wrap;" @click="bgClick()">
- <div style="flex: 12;display: flex;" :style="{scale:showScale/100.0,marginTop:(showScale-100)*0.7 + 'px'}">
+ <div style="flex: 18;display: flex;justify-content: center;" :style="{zoom:showScale/100.0,marginTop:(showScale)*4 + 'px'}">
<div style="margin-top: -110px;">
<div class="pointContainer" v-for="(x,index) in map" :key="index">
<div v-if="index != 0 && (index != map.length-1)" v-for="(y,idx) in x" :key="idx">
@@ -426,9 +426,15 @@
<div style="margin-top: 20px;"><button class="layui-btn" @click="currentLev = 2" :style="{background: currentLev==2?'red':''}">2F</button></div>
<div style="margin-top: 20px;"><button class="layui-btn" @click="currentLev = 3" :style="{background: currentLev==3?'red':''}">3F</button></div>
<div style="margin-top: 20px;"><button class="layui-btn" @click="currentLev = 4" :style="{background: currentLev==4?'red':''}">4F</button></div>
+ <div style="margin-top: 20px;"><button class="layui-btn" @click="currentLev = 5" :style="{background: currentLev==5?'red':''}">5F</button></div>
+ <div style="margin-top: 20px;"><button class="layui-btn" @click="currentLev = 6" :style="{background: currentLev==6?'red':''}">6F</button></div>
+ <div style="margin-top: 20px;"><button class="layui-btn" @click="currentLev = 7" :style="{background: currentLev==7?'red':''}">7F</button></div>
+ <div style="margin-top: 20px;"><button class="layui-btn" @click="currentLev = 8" :style="{background: currentLev==8?'red':''}">8F</button></div>
+ <div style="margin-top: 20px;"><button class="layui-btn" @click="currentLev = 9" :style="{background: currentLev==9?'red':''}">9F</button></div>
+ <div style="margin-top: 20px;"><button class="layui-btn" @click="currentLev = 10" :style="{background: currentLev==10?'red':''}">10F</button></div>
</div>
</div>
- <div style="padding: 40px 20px 10px 10px;flex: 5;margin-top: -70px;">
+ <div style="padding: 40px 20px 10px 10px;" :style="window.innerWidth < 2000 ? 'margin-top: 0px;' : 'flex: 5;margin-top: -70px;'">
<el-slider v-model="showScale" :marks="showScaleMarks"></el-slider>
<div style="display: flex;justify-content: space-between;flex-wrap: wrap;">
<div class="hoverCard" style="width: 100%;">
@@ -628,7 +634,7 @@
searchLocNo: "",
outSite: null,
outSites: null,
- showScale: 80, //鎺у埗鍦板浘鏄剧ず澶у皬姣斾緥
+ showScale: 65, //鎺у埗鍦板浘鏄剧ず澶у皬姣斾緥
showScaleMarks: {//姣斾緥婊戝姩鏉℃樉绀烘爣璁�
0: "0%",
50: {
@@ -645,11 +651,6 @@
this.init()
this.getOutSite()
-
- // setInterval((that) => {
- // //瀹氭椂鑾峰彇鍫嗗灈鏈烘暟鎹�
- // that.getCrnData()
- // },1000,this)
},
watch: {
map: {
diff --git a/src/main/webapp/views/home/map_realtime.html b/src/main/webapp/views/home/map_realtime.html
index dd06aa0..039c98f 100644
--- a/src/main/webapp/views/home/map_realtime.html
+++ b/src/main/webapp/views/home/map_realtime.html
@@ -381,7 +381,7 @@
</head>
<body>
<div id="app" style="display: flex;justify-content: space-around;margin-top: 50px;flex-wrap: wrap;" @click="bgClick()">
- <div style="flex: 12;display: flex;" :style="{scale:showScale/100.0,marginTop:(showScale-100)*0.7 + 'px'}">
+ <div style="flex: 18;display: flex;justify-content: center;" :style="{zoom:showScale/100.0,marginTop:(showScale)*4 + 'px'}">
<div style="margin-top: -110px;">
<div class="pointContainer" v-for="(x,index) in map" :key="index">
<div v-if="index != 0 && (index != map.length-1)" v-for="(y,idx) in x" :key="idx">
@@ -428,7 +428,7 @@
</div>
</div>
- <div style="padding: 40px 20px 10px 10px;flex: 5;margin-top: -70px;">
+ <div style="padding: 40px 20px 10px 10px;" :style="window.innerWidth < 2000 ? 'margin-top: 0px;' : 'flex: 5;margin-top: -70px;'">
<el-slider v-model="showScale" :marks="showScaleMarks"></el-slider>
<div style="display: flex;justify-content: space-between;flex-wrap: wrap;">
<div class="hoverCard">
@@ -479,6 +479,18 @@
<input id="03" type="radio" v-model="currentLev" name="r" value="3">
<label for="04">4F</label>
<input id="04" type="radio" v-model="currentLev" name="r" value="4">
+ <label for="05">5F</label>
+ <input id="05" type="radio" v-model="currentLev" name="r" value="5">
+ <label for="06">6F</label>
+ <input id="06" type="radio" v-model="currentLev" name="r" value="6">
+ <label for="07">7F</label>
+ <input id="07" type="radio" v-model="currentLev" name="r" value="7">
+ <label for="08">8F</label>
+ <input id="08" type="radio" v-model="currentLev" name="r" value="8">
+ <label for="09">9F</label>
+ <input id="09" type="radio" v-model="currentLev" name="r" value="9">
+ <label for="10">10F</label>
+ <input id="10" type="radio" v-model="currentLev" name="r" value="10">
</div>
</div>
</div>
@@ -552,7 +564,7 @@
searchLocNo: "",
outSite: null,
outSites: null,
- showScale: 80, //鎺у埗鍦板浘鏄剧ず澶у皬姣斾緥
+ showScale: 65, //鎺у埗鍦板浘鏄剧ず澶у皬姣斾緥
showScaleMarks: {//姣斾緥婊戝姩鏉℃樉绀烘爣璁�
0: "0%",
50: {
--
Gitblit v1.9.1