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 0000000..260a3d5 Binary files /dev/null and b/src/assets/map/emergency_rescue/reset_point.png differ 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 @@ +