| .env | ●●●●● patch | view | raw | blame | history | |
| .env.production | ●●●●● patch | view | raw | blame | history | |
| .env.test | ●●●●● patch | view | raw | blame | history | |
| Dockerfile.test | ●●●●● patch | view | raw | blame | history | |
| package.json | ●●●●● patch | view | raw | blame | history | |
| src/views/Home/Footer.vue | ●●●●● patch | view | raw | blame | history | |
| src/views/Home/useEventOperate/useEventOperate.js | ●●●●● patch | view | raw | blame | history | |
| src/views/Home/useMapAggregation/DevicePopUpBox.vue | patch | view | raw | blame | history | |
| src/views/Home/useMapAggregation/EventPopUpBox.vue | patch | view | raw | blame | history | |
| src/views/Home/useMapAggregation/useMapAggregation.js | ●●●●● patch | view | raw | blame | history |
.env
New file @@ -0,0 +1,7 @@ VITE_APP_API = /api #调试参数 VITE_APP_DEBUG_KEY = saber VITE_APP_DEBUG_SWITCH = false #页面基础路径 VITE_APP_BASE = /command-center-dashboard/ .env.production
@@ -1,17 +1,5 @@ #生产环境配置 VITE_APP_ENV = 'production' #接口地址 #填写前缀 [/api] 需要用nginx进行反向代理 #填写地址 [https://api.bladex.cn] 只需要保证接口支持跨域即可, 无需再做代理 VITE_APP_API=/api #调试参数 VITE_APP_DEBUG_KEY=saber VITE_APP_DEBUG_SWITCH=false #页面基础路径 VITE_APP_BASE = /command-center-dashboard/ # 是否在打包时开启压缩,支持 gzip 和 brotli VITE_BUILD_COMPRESS = gzip .env.test
New file @@ -0,0 +1,4 @@ #测试环境配置 VITE_APP_ENV = 'test' Dockerfile.test
@@ -10,7 +10,7 @@ RUN rm -rf node_modules package-lock.json && npm install --registry=https://registry.npmmirror.com # 构建项目 RUN npm run build:dev RUN npm run build:test # 查看 RUN ls /app/dist RUN ls /app/dist package.json
@@ -5,6 +5,7 @@ "dev": "vite --host", "prod": "vite --mode production", "build:dev": "vite build --mode development", "build:test": "vite build --mode test", "build:prod": "vite build --mode production", "serve": "vite preview --host", "format": "prettier --write \"src/**/*.+(js|ts|jsx|tsx)\"" @@ -52,4 +53,4 @@ "vite-plugin-svg-icons": "^2.0.1", "vite-plugin-vue-setup-extend": "^0.4.0" } } } src/views/Home/Footer.vue
@@ -25,13 +25,12 @@ import img5 from '@/assets/images/home/footer/orthophoto.png' import activeImg5 from '@/assets/images/home/footer/orthophoto1.png' import { useUavHome } from '@/views/Home/useUavHome/useUavHome' import { useEventOperate } from '@/views/Home/useEventOperate/useEventOperate' import { useMapAggregation } from '@/views/Home/useMapAggregation/useMapAggregation' // 机巢聚合 const { init, removeAll } = useUavHome('device'); const { init, removeAll } = useMapAggregation('device'); // 事件聚合 const { init: eventInit, removeAll: eventRemove } = useUavHome('event'); const { init: eventInit, removeAll: eventRemove } = useMapAggregation('event'); const list = ref([ { src/views/Home/useEventOperate/useEventOperate.js
File was deleted src/views/Home/useMapAggregation/DevicePopUpBox.vue
src/views/Home/useMapAggregation/EventPopUpBox.vue
src/views/Home/useMapAggregation/useMapAggregation.js
File was renamed from src/views/Home/useUavHome/useUavHome.js @@ -4,8 +4,8 @@ import eventImg from '@/assets/images/home/useEventOperate/event.png'; import DevicePopUpBox from '@/views/Home/useUavHome/DevicePopUpBox.vue'; import EventPopUpBox from '@/views/Home/useEventOperate/EventPopUpBox.vue'; import DevicePopUpBox from '@/views/Home/useMapAggregation/DevicePopUpBox.vue'; import EventPopUpBox from '@/views/Home/useMapAggregation/EventPopUpBox.vue'; import { render } from 'vue'; import { useStore } from 'vuex'; @@ -16,7 +16,7 @@ /** * 机巢聚合功能 */ export const useUavHome = type => { export const useMapAggregation = type => { const { flyTo } = cesiumOperation(); const singleImg = type === 'device' ? uavImg : eventImg; @@ -117,22 +117,22 @@ function getMapEventCount(areaCode) { return getMapEvents({ areaCode }).then(res => { return processChildren(res?.data?.data?.childrens || []); }); } function getEventDetailsFun(areaCode){ return getEventDetails({areaCode}).then(res => { console.log(res.data.data,'getEventDetailsFun'); const resData= res?.data?.data if (resData?.data){ eventList = resData?.data return [] } return processChildren(resData?.childrens); }); } const findFun = (featItem, numItem) => Number(featItem.region_code.slice(0, 6)) === numItem.properties.adcode; const { VITE_APP_BASE } = import.meta.env; const defaultDir = `${VITE_APP_BASE}public/geoJson/100000/`; const { VITE_APP_BASE,VITE_APP_ENV } = import.meta.env; const defaultDir = `${VITE_APP_BASE}${VITE_APP_ENV === 'development' ? 'public/' : ''}geoJson/100000/`; const getFiler = async url => { const gJson = await import(/* @vite-ignore */ url); return JSON.parse(JSON.stringify(gJson)); const res = await fetch(url); return await res.json() }; const getOutLine = async (jsonPathPre, hierarchy) => { const parentGJson = await getFiler(`${defaultDir}${jsonPathPre}/index.json`); @@ -150,6 +150,7 @@ }; const initMapData = async areaCode => { eventList = [] if (!areaCode) return; const list = type === 'device' ? await getDeviceCount(areaCode) : await getMapEventCount(areaCode); const splashedList = type === 'device' @@ -164,8 +165,9 @@ scalingJudgment[0].gJson = null; scalingJudgment[0].splashedList = splashedList; active = null; console.log(hierarchy); // 轮廓 const outlineGJson = await getOutLine(jsonPathPre, hierarchy); scalingJudgment.forEach(item => item.show && (item.outline = outlineGJson)); // 省 if (hierarchy.length === 1) { const gJson1 = await getFiler(`${defaultDir}${jsonPath}/indexDistrict.json`); @@ -200,9 +202,7 @@ const center = outlineGJson.features[0].properties.center; flyTo({ longitude: center[0], latitude: center[1] }, 0, scalingJudgment[0].height); } // 轮廓 const outlineGJson = await getOutLine(jsonPathPre, hierarchy); scalingJudgment.forEach(item => item.show && (item.outline = outlineGJson)); determineScaling() }; watch(