From 8c689b6b29ca2ceb239c43cd8e609c8ed8a4f4b6 Mon Sep 17 00:00:00 2001 From: "DESKTOP-2ESM03N\\zcloud" <1275851274@qq.com> Date: Mon, 29 Jul 2024 08:56:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BA=94=E6=80=A5=E6=95=91=E6=8F=B4?= =?UTF-8?q?=E6=8C=87=E6=8C=A5=E5=9C=B0=E5=9B=BE=E6=89=8E=E7=82=B9=E5=8F=8A?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E5=B1=95=E7=A4=BA=E6=A1=86=E7=BB=98=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/index.js | 2 +- package-lock.json | 6 + .../map/emergency_rescue/reset_point.png | Bin 0 -> 1401 bytes src/main.js | 2 +- src/utils/request.js | 1 - src/utils/request2.js | 131 ---- .../emergency_map/components/chat.vue | 286 +++++++++ .../emergency_map/components/mapAssembly.vue | 570 +++++++++++++----- src/views/login/index.vue | 3 +- static/config.js | 2 +- 10 files changed, 706 insertions(+), 297 deletions(-) create mode 100644 src/assets/map/emergency_rescue/reset_point.png delete mode 100644 src/utils/request2.js create mode 100644 src/views/emergen_cyrescue/emergency_map/components/chat.vue diff --git a/config/index.js b/config/index.js index 9d74899..f35cc5d 100644 --- a/config/index.js +++ b/config/index.js @@ -27,7 +27,7 @@ module.exports = { }, // Various Dev Server settings - host: 'localhost', // can be overwritten by process.env.HOST + host: '192.168.0.37', // can be overwritten by process.env.HOST 目前设置为本地主机的IP地址,目的是为了让同网络中的其他主机可通过该IP地址访问本脚手架项目 port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: false, // 是否自动开启浏览器预览能力 errorOverlay: true, diff --git a/package-lock.json b/package-lock.json index 0d912c7..6f00d19 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", + "autofit.js": "^3.1.1", "axios": "^0.21.1", "dayjs": "^1.11.10", "echarts": "^5.3.1", @@ -1747,6 +1748,11 @@ "node": ">= 4.5.0" } }, + "node_modules/autofit.js": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/autofit.js/-/autofit.js-3.1.1.tgz", + "integrity": "sha512-ECW7wNUW1e6F+c0lRc9X+xyCrbqY3FsSnCObNDhQAo77E4/45tWx0YeLuiqA7qxrnxl2Plh3lF/pC+vzXC+8ZA==" + }, "node_modules/autoprefixer": { "version": "7.2.6", "resolved": "https://registry.npmmirror.com/autoprefixer/-/autoprefixer-7.2.6.tgz", diff --git a/src/assets/map/emergency_rescue/reset_point.png b/src/assets/map/emergency_rescue/reset_point.png new file mode 100644 index 0000000000000000000000000000000000000000..260a3d564eb78ac47f0e51ca506725a9484868df GIT binary patch literal 1401 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~%1|*NXY)uAnN?apKg7ec#$`gxH85~pclTsBt za}(23gHjVyDhp4h+AuIMt7V2nltlRYSS9D@>Lr5I=vCwv0Ch7k*w|MTBqnF4mMA2p zrf25aD!t#mUr8Y|#a1cY)Yrhbz&SM|)1#^=HMq(zB)KX(*)m1R-cG@$!U||WZfZ%Q zLPc&)Ua?h$trFN=DzM-+Mp_!G5ft8Vw0u(3#Z7WJivkG!?gW3h;*(zm}loVL$>z9|8 z>y;bpKhp88yV>WRp=I1=9MH?=;jqG!%T2VElw`VEGWs$&r<-In3$Ab zT4JjNbScCOxdpzyaD(%Tp#cR9GX09g0)0b01O41wkiWpHi%Wu15zfG>x;Uh=AXPso zwK%`DC>aHC8V9$)&lec_p4Mwn{(|y_C!pD>GA5a|07YCnGZh zM?*tbH%ChsBUcwUGYe-YQ%3_sQ69T3n z5EGtsfgE_^Pt60S_#$A^uI^2>W?*1^>FMGaQgQ3ewe#7R6C@6NbeVn4s`^%Lj(PaC z?#;X3s9DTtHd@vpGG|jCr<|zTxq8PbcaJBWdABLB&1hkOrm*0V?%M~o&d7;;d#ohF zpIdh0!jIa+%4%0dK; zG;s1P;x?=~q87HHE&pEkE6ZTxNssN)H#Q0#OMKKiXZ1fFxn$wY%+m>O)rOp9JmKa}?QF5{TXMHA zSyArmx3{G1#?2Sm&v$0bF*dy{TKs&=jbne;Cren~o%Q5r-8Huf*%F)_Nq*ZR9sQF1 z=f@g;SM;ii+V^1EDiKAdFJ2Rz0=VwyzWU$w`-gzi3EP|cuY)aqeGZuSZBt70g=J#D z+eFSTza{c+#ZL3^o%erAr>ZLNzc4^RtkN2Eb#dLxe=WKzv$Gnjm;B{jc7>zv&T+ey+(iXXW*7UM`q6M_PviND sUe%R_`?k-Oy~^_Qzq?Y#Z@mKyqB}}r-tYXg98?&3y85}Sb4q9e07uXc{{R30 literal 0 HcmV?d00001 diff --git a/src/main.js b/src/main.js index 476fc2c..0c35631 100644 --- a/src/main.js +++ b/src/main.js @@ -26,6 +26,7 @@ Vue.component('Treeselect', Treeselect) import Viewer from 'v-viewer' import 'viewerjs/dist/viewer.css' + Vue.use(Viewer, { defaultOptions: { zIndex: 9999// 解决图片放大的层级问题 @@ -119,4 +120,3 @@ new Vue({ components: { App }, template: '' }) - diff --git a/src/utils/request.js b/src/utils/request.js index 27fa262..12ac44f 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -34,7 +34,6 @@ service.interceptors.request.use( background: 'rgba(0, 0, 0, 0.7)' }) } - config.headers['Authorization'] = JSON.parse(sessionStorage.getItem('user')).sessionId || '' return config }, error => { diff --git a/src/utils/request2.js b/src/utils/request2.js deleted file mode 100644 index b0193bb..0000000 --- a/src/utils/request2.js +++ /dev/null @@ -1,131 +0,0 @@ -import axios from 'axios' -import { Message, MessageBox, Loading } from 'element-ui' - -// create an axios instance -axios.defaults.withCredentials = true -let loadingService = null - -const service = axios.create({ - // baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url - // eslint-disable-next-line no-undef - baseURL: config.httpurl, - // withCredentials: true, // send cookies when cross-domain requests - timeout: 300000, // request timeout - headers: { 'Content-Type': 'application/x-www-form-urlencoded' } -}) - -// request interceptor -service.interceptors.request.use( - config => { - // do something before request is sent - if ( - ( - !config.url.includes('getLevels') && - !config.url.includes('hasMenu') && - !config.url.includes('hasButton') && - !config.url.includes('getInfo') - ) && - !loadingService - ) { - loadingService = Loading.service({ - lock: true, - text: '加载中......', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }) - } - if (config.url === '/admin/check') { - delete config.headers.Authorization - } - return config - }, - error => { - // do something with request error - return Promise.reject(error) - } -) - -// response interceptor -service.interceptors.response.use( - /** - * If you want to get http information such as headers or status - * Please return response => response - */ - - /** - * Determine the request status by custom code - * Here is just an example - * You can also judge the status by HTTP Status Code - */ - response => { - // console.info('response:' + response) - loadingService && loadingService.close() - loadingService = null - const res = response.data - // if the custom code is not 20000, it is judged as an error. - if (res.result !== 'success' && res.result !== 'fail') { - if (res.response == '302') { - MessageBox.alert('登录失效,请重新登录', { - confirmButtonText: '确定', - callback: action => { - sessionStorage.clear() - location.reload() - } - }) - } - if (res.result !== 'exception') { - Message({ - message: res.msg || '没有此页面的访问权限,请联系管理员', - type: 'error', - duration: 5 * 1000 - }) - } - Message({ - message: res.msg || '系统开小差了,请联系管理员', - type: 'error', - duration: 5 * 1000 - }) - return Promise.reject(new Error(res.message || '系统开小差了,请联系管理员')) - } else { - return res - } - }, - error => { - if (!error.response || error.response.status == '404' || error.response.status == '302') { - MessageBox.alert('登录失效,请重新登录', { - confirmButtonText: '确定', - callback: action => { - sessionStorage.clear() - location.reload() - } - }) - } else { - MessageBox.alert('登录失效,请重新登录', { - confirmButtonText: '确定', - callback: action => { - sessionStorage.clear() - location.reload() - } - }) - } - - return Promise.reject(error) - } -) - -export function requestFN2(url, data) { - // 基础请求方法 - const Qs = require('qs') - const method = 'post' - const obj = { - method, // 请求的类型 - url // 请求地址 - } - obj.data = Qs.stringify(data) // data 带参数 - // 返回axios的基础方法 - return service(obj).then(r => { - return r // 方法请求的数据 - }) -} -export default service - diff --git a/src/views/emergen_cyrescue/emergency_map/components/chat.vue b/src/views/emergen_cyrescue/emergency_map/components/chat.vue new file mode 100644 index 0000000..4ba3074 --- /dev/null +++ b/src/views/emergen_cyrescue/emergency_map/components/chat.vue @@ -0,0 +1,286 @@ +