From 2ecb435a6f8873ab644a7a940be9a096c734215b Mon Sep 17 00:00:00 2001
From: "DESKTOP-VMMLSOQ\\wangzg" <1161909281@qq.com>
Date: Thu, 6 Jun 2024 22:09:47 +0800
Subject: [PATCH] =?UTF-8?q?V1=E7=89=88=E6=9C=AC=E5=B0=81=E6=9D=BF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/Map.vue | 27 ++++-
components/WZDialog.vue | 13 ++-
config/mapConfig.js | 6 +-
nuxt.config.js | 14 ++-
package.json | 4 +-
.../PeakCoalMonitoring.vue | 8 +-
pages/visual/PeakCoalView.vue | 11 +-
plugins/axios.js | 6 +-
store/map.js | 101 ++++++++++++++++-
store/system.js | 15 +++
test/output.json | 102 ++++++++++++++++++
test/test.js | 47 ++++++++
test/test.xlsx | Bin 0 -> 10563 bytes
yarn.lock | 101 ++++++++++++++++-
14 files changed, 437 insertions(+), 18 deletions(-)
create mode 100644 store/system.js
create mode 100644 test/output.json
create mode 100644 test/test.js
create mode 100644 test/test.xlsx
diff --git a/components/Map.vue b/components/Map.vue
index a027524..e57b101 100644
--- a/components/Map.vue
+++ b/components/Map.vue
@@ -4,7 +4,7 @@
@@ -345,6 +351,9 @@ export default {
.w-z-dialog {
height: 2000px;
width: 100%;
+ &.middle {
+ height: 1200px;
+ }
}
diff --git a/config/mapConfig.js b/config/mapConfig.js
index 42e7688..d30b0b5 100644
--- a/config/mapConfig.js
+++ b/config/mapConfig.js
@@ -1,8 +1,10 @@
export const ms3dConfig = {
"scene": {
"center": {
- "lat": 36.543132,
- "lng": 114.110195,
+ "lat": 39.85981,
+ "lng": 106.90566,
+ // "lat": 36.543132,
+ // "lng": 114.110195,
"alt": 2187,
"heading": 0,
"pitch": -60
diff --git a/nuxt.config.js b/nuxt.config.js
index 8b70d4d..0e961b9 100644
--- a/nuxt.config.js
+++ b/nuxt.config.js
@@ -5,7 +5,8 @@ export default {
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
- title: '峰煤智慧监控应用系统',
+ // title: '峰煤智慧监控应用系统',
+ title: '',
htmlAttrs: {
lang: 'zh-cn'
},
@@ -58,7 +59,16 @@ export default {
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
+ "@gauseen/nuxt-proxy"
],
+ proxyTable: {
+ "/api": {
+ target: 'http://101.43.201.20:5000/',
+ changeOrigin: true,
+ ws: false,
+ pathRewrite: {}
+ }
+ },
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
@@ -66,5 +76,5 @@ export default {
},
env: {
scale: 0.5
- }
+ },
}
diff --git a/package.json b/package.json
index 078761a..d723f04 100644
--- a/package.json
+++ b/package.json
@@ -9,6 +9,7 @@
"generate": "nuxt generate"
},
"dependencies": {
+ "@gauseen/nuxt-proxy": "^1.0.1",
"ant-design-vue": "^1.7.8",
"axios": "^1.6.1",
"core-js": "^3.25.3",
@@ -27,6 +28,7 @@
},
"devDependencies": {
"less": "^4.2.0",
- "less-loader": "6"
+ "less-loader": "6",
+ "xlsx": "^0.18.5"
}
}
diff --git a/pages/peak-coal-monitoring/PeakCoalMonitoring.vue b/pages/peak-coal-monitoring/PeakCoalMonitoring.vue
index 99c80b4..06eafb2 100644
--- a/pages/peak-coal-monitoring/PeakCoalMonitoring.vue
+++ b/pages/peak-coal-monitoring/PeakCoalMonitoring.vue
@@ -8,7 +8,7 @@
@@ -56,9 +56,15 @@ import ZKZDialog from "@/components/ZKZDialog";
import GBZDialog from "@/components/GBZDialog";
import CEMSDialog from "@/components/CEMSDialog";
import pointDialog from '@/components/PointDialog'
+import {mapState} from "vuex";
export default {
name: "PeakCoalMonitoring",
components: {AlarmOverview, DeviceOverview, EnergyProfile, MonitorData, PollutionInformation, AtmosphericModule},
+ computed: {
+ ...mapState({
+ title: state => state.system.title,
+ })
+ },
methods: {
/**
* 图层构造器
diff --git a/pages/visual/PeakCoalView.vue b/pages/visual/PeakCoalView.vue
index 05c5815..ec97eed 100644
--- a/pages/visual/PeakCoalView.vue
+++ b/pages/visual/PeakCoalView.vue
@@ -3,8 +3,9 @@
@@ -126,6 +127,7 @@ import ZKZDialog from "@/components/ZKZDialog";
import GBZDialog from "@/components/GBZDialog";
import CEMSDialog from "@/components/CEMSDialog";
import pointDialog from '@/components/PointDialog'
+import {mapState} from "vuex";
export default {
name: "PeakCoalView",
components: {},
@@ -141,6 +143,11 @@ export default {
showCamera: false
}
},
+ computed: {
+ ...mapState({
+ title: state => state.system.title,
+ })
+ },
mounted() {
this.$log.info('test')
this.$log.error('test')
diff --git a/plugins/axios.js b/plugins/axios.js
index 008f6e7..ba6d55b 100644
--- a/plugins/axios.js
+++ b/plugins/axios.js
@@ -1,17 +1,17 @@
import axios from 'axios' //引用axios
import { message } from 'ant-design-vue';
import Vue from 'vue'
-
+axios.defaults.withcredentials =true
// create an axios instance
const service = axios.create({
- baseURL: '/smartcampus-web', // 所有异步请求都加上/api,nginx转发到后端Springboot
- withCredentials: true, // send cookies when cross-domain requests
+ baseURL: '', // 所有异步请求都加上/api,nginx转发到后端Springboot
timeout: 5000 // request timeout
})
// request interceptor
service.interceptors.request.use(
config => {
+ config.headers['Access-Control-Allow-Origin'] = '*'
return config
},
error => {
diff --git a/store/map.js b/store/map.js
index 6ce147c..52bef04 100644
--- a/store/map.js
+++ b/store/map.js
@@ -16,7 +16,106 @@ export const state = {
ssc: [],
shisc: [],
wz: [
- {"longitude":"114.100153","latitude":"36.55161"}
+ {
+ "longitude": 114.10027777777778,
+ "latitude": 36.55
+ },
+ {
+ "longitude": 114.10111111111111,
+ "latitude": 36.54972222222222
+ },
+ {
+ "longitude": 114.10111111111111,
+ "latitude": 36.55138888888889
+ },
+ {
+ "longitude": 114.10277777777777,
+ "latitude": 36.55
+ },
+ {
+ "longitude": 114.10305555555556,
+ "latitude": 36.55222222222222
+ },
+ {
+ "longitude": 114.1036111111111,
+ "latitude": 36.55166666666666
+ },
+ {
+ "longitude": 114.10722222222222,
+ "latitude": 36.55333333333333
+ },
+ {
+ "longitude": 114.1061111111111,
+ "latitude": 36.55416666666667
+ },
+ {
+ "longitude": 114.10472222222222,
+ "latitude": 36.55444444444444
+ },
+ {
+ "longitude": 114.11,
+ "latitude": 36.55416666666667
+ },
+ {
+ "longitude": 114.11055555555555,
+ "latitude": 36.555277777777775
+ },
+ {
+ "longitude": 114.11222222222221,
+ "latitude": 36.555277777777775
+ },
+ {
+ "longitude": 114.11222222222221,
+ "latitude": 36.553888888888885
+ },
+ {
+ "longitude": 114.11416666666666,
+ "latitude": 36.55416666666667
+ },
+ {
+ "longitude": 114.11444444444444,
+ "latitude": 36.555277777777775
+ },
+ {
+ "longitude": 114.11749999999999,
+ "latitude": 36.55777777777777
+ },
+ {
+ "longitude": 114.11888888888888,
+ "latitude": 36.55611111111111
+ },
+ {
+ "longitude": 114.11083333333333,
+ "latitude": 36.55777777777777
+ },
+ {
+ "longitude": 114.10888888888888,
+ "latitude": 36.556666666666665
+ },
+ {
+ "longitude": 114.10916666666667,
+ "latitude": 36.5575
+ },
+ {
+ "longitude": 114.10749999999999,
+ "latitude": 36.55777777777777
+ },
+ {
+ "longitude": 114.1061111111111,
+ "latitude": 36.55777777777777
+ },
+ {
+ "longitude": 114.10555555555555,
+ "latitude": 36.55611111111111
+ },
+ {
+ "longitude": 114.10722222222222,
+ "latitude": 36.556666666666665
+ },
+ {
+ "longitude": 114.11638888888888,
+ "latitude": 36.555277777777775
+ }
],
jkd: [
{"longitude":"114.103822","latitude":"36.5538"},
diff --git a/store/system.js b/store/system.js
new file mode 100644
index 0000000..7cd98bb
--- /dev/null
+++ b/store/system.js
@@ -0,0 +1,15 @@
+export const state = {
+ title: ''
+}
+
+export const mutations = {
+ setTitle (state, title) {
+ state.title = title
+ }
+}
+
+export const actions = {
+ setTitle ({ commit }, title) {
+ commit('setTitle', title)
+ }
+}
diff --git a/test/output.json b/test/output.json
new file mode 100644
index 0000000..69a4196
--- /dev/null
+++ b/test/output.json
@@ -0,0 +1,102 @@
+[
+ {
+ "longitude": 114.10027777777778,
+ "latitude": 36.55
+ },
+ {
+ "longitude": 114.10111111111111,
+ "latitude": 36.54972222222222
+ },
+ {
+ "longitude": 114.10111111111111,
+ "latitude": 36.55138888888889
+ },
+ {
+ "longitude": 114.10277777777777,
+ "latitude": 36.55
+ },
+ {
+ "longitude": 114.10305555555556,
+ "latitude": 36.55222222222222
+ },
+ {
+ "longitude": 114.1036111111111,
+ "latitude": 36.55166666666666
+ },
+ {
+ "longitude": 114.10722222222222,
+ "latitude": 36.55333333333333
+ },
+ {
+ "longitude": 114.1061111111111,
+ "latitude": 36.55416666666667
+ },
+ {
+ "longitude": 114.10472222222222,
+ "latitude": 36.55444444444444
+ },
+ {
+ "longitude": 114.11,
+ "latitude": 36.55416666666667
+ },
+ {
+ "longitude": 114.11055555555555,
+ "latitude": 36.555277777777775
+ },
+ {
+ "longitude": 114.11222222222221,
+ "latitude": 36.555277777777775
+ },
+ {
+ "longitude": 114.11222222222221,
+ "latitude": 36.553888888888885
+ },
+ {
+ "longitude": 114.11416666666666,
+ "latitude": 36.55416666666667
+ },
+ {
+ "longitude": 114.11444444444444,
+ "latitude": 36.555277777777775
+ },
+ {
+ "longitude": 114.11749999999999,
+ "latitude": 36.55777777777777
+ },
+ {
+ "longitude": 114.11888888888888,
+ "latitude": 36.55611111111111
+ },
+ {
+ "longitude": 114.11083333333333,
+ "latitude": 36.55777777777777
+ },
+ {
+ "longitude": 114.10888888888888,
+ "latitude": 36.556666666666665
+ },
+ {
+ "longitude": 114.10916666666667,
+ "latitude": 36.5575
+ },
+ {
+ "longitude": 114.10749999999999,
+ "latitude": 36.55777777777777
+ },
+ {
+ "longitude": 114.1061111111111,
+ "latitude": 36.55777777777777
+ },
+ {
+ "longitude": 114.10555555555555,
+ "latitude": 36.55611111111111
+ },
+ {
+ "longitude": 114.10722222222222,
+ "latitude": 36.556666666666665
+ },
+ {
+ "longitude": 114.11638888888888,
+ "latitude": 36.555277777777775
+ }
+]
\ No newline at end of file
diff --git a/test/test.js b/test/test.js
new file mode 100644
index 0000000..2df9615
--- /dev/null
+++ b/test/test.js
@@ -0,0 +1,47 @@
+const XLSX = require('xlsx');
+
+const fs = require('fs');
+// 读取xlsx文件
+const workbook = XLSX.readFile('./test.xlsx');
+
+// 读取特定的worksheet,默认第一个worksheet
+const worksheet = workbook.Sheets['Sheet2'];
+
+// 将worksheet转换为JSON对象
+const jsonData = XLSX.utils.sheet_to_json(worksheet);
+function dmsToDecimal(degrees, minutes, seconds) {
+ return degrees + minutes / 60 + seconds / 3600;
+}
+
+
+const results = []
+
+for (const jsonDatum of jsonData) {
+ const location = jsonDatum['经纬度']
+ const [lat, lon] = location.split(' ')
+ let latStr = lat.replace(/\°|\'|["(N|E)]/g, '@')
+ let lonStr = lon.replace(/\°|\'|["(N|E)]/g, '@')
+ const [latDegrees, latMinutes, latSeconds] = latStr.split('@')
+ const [longDegrees, longMinutes, longSeconds] = lonStr.split('@')
+ const latitude = dmsToDecimal(parseInt(latDegrees), parseInt(latMinutes), parseInt(latSeconds));
+ const longitude = dmsToDecimal(parseInt(longDegrees), parseInt(longMinutes),parseInt( longSeconds));
+ results.push( {
+ longitude,
+ latitude
+ })
+}
+
+
+// 文件内容
+const content = JSON.stringify(results, null, 2)
+
+// 文件路径
+const filePath = './output.json';
+
+// 写入文件
+fs.writeFile(filePath, content, 'utf8', function(err) {
+ if (err) {
+ return console.log(err);
+ }
+ console.log('文件已保存');
+});
diff --git a/test/test.xlsx b/test/test.xlsx
new file mode 100644
index 0000000000000000000000000000000000000000..4f3cedc1e4edae6fa1f8dadb0f4f3781038c8cf5
GIT binary patch
literal 10563
zcmeHNg
Fx&UM!G{9M34sQlu$}qLb?RWp*z0ObMEyV?)mx(O9Tx)WUUBso0I_QJ)IpRnAlEh>LF6G2iGYQ5qqZ#8$c-3*F1)
zNd~{I(2V_%5Y3g3hYSM2Of|s1Xr4D=wjqBcr^4Z?N8s4*K2h8eFOL+Fpz5ICDg$26
z?FkL`=m6#E-0@6!y+Tx(2;`Qv+S^swIW#G&v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