| | |
| | | import axios from 'axios'; |
| | | import { ElMessage } from 'element-plus'; |
| | | |
| | | const debug = true; |
| | | const debug = false; |
| | | |
| | | // let ip1 = 'http://114.215.109.124:8805/'; |
| | | let ip1 = 'http://47.100.191.150:9029/'; |
| | |
| | | DataSummary: typeof import('./components/monitor/DataSummary.vue')['default'] |
| | | DataTable: typeof import('./components/monitor/DataTable.vue')['default'] |
| | | ElButton: typeof import('element-plus/es')['ElButton'] |
| | | ElCascader: typeof import('element-plus/es')['ElCascader'] |
| | | ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] |
| | | ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup'] |
| | | ElCol: typeof import('element-plus/es')['ElCol'] |
| | |
| | | MapLocation: typeof import('./components/map/MapLocation.vue')['default'] |
| | | MapScene: typeof import('./components/map/MapScene.vue')['default'] |
| | | MapToolbox: typeof import('./components/map/MapToolbox.vue')['default'] |
| | | MessageBox: typeof import('./components/MessageBox.vue')['default'] |
| | | MissionCreate: typeof import('./components/mission/MissionCreate.vue')['default'] |
| | | MissionImport: typeof import('./components/mission/MissionImport.vue')['default'] |
| | | MissionManage: typeof import('./components/mission/MissionManage.vue')['default'] |
| | | OptionDevice: typeof import('./components/search/OptionDevice.vue')['default'] |
| | | OptionLocation: typeof import('./components/search/OptionLocation.vue')['default'] |
| | | OptionLocation2: typeof import('./components/search/OptionLocation2.vue')['default'] |
| | | OptionMission: typeof import('./components/search/OptionMission.vue')['default'] |
| | | OptionTime: typeof import('./components/search/OptionTime.vue')['default'] |
| | | OptionType: typeof import('./components/search/OptionType.vue')['default'] |
| | |
| | | @opened="handleChange(true)" |
| | | @closed="handleChange(false)" |
| | | :show-close="false" |
| | | :destroy-on-close="true" |
| | | align-center |
| | | :width="width" |
| | | > |
| | | <template #header="{ close, titleId, titleClass }"> |
| | | <BaseCard direction="top-left" borderless="t"> |
| | |
| | | <template #content> |
| | | <slot></slot> |
| | | </template> |
| | | <template #footer> |
| | | <slot name="footer"></slot> |
| | | </template> |
| | | </BaseCard> |
| | | </el-dialog> |
| | | </template> |
| | |
| | | export default { |
| | | props: { |
| | | title: String, |
| | | modelValue: Boolean |
| | | modelValue: Boolean, |
| | | width: { |
| | | type: [String, Number], |
| | | default: '50%' |
| | | } |
| | | }, |
| | | emits: ['update:modelValue'], |
| | | methods: { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <CardDialog |
| | | :title="title" |
| | | :model-value="modelValue" |
| | | :width="400" |
| | | @handleChange="handleChange" |
| | | > |
| | | <el-row justify="center"> |
| | | <div class="m-v-16">{{ msg }}</div> |
| | | </el-row> |
| | | <template #footer> |
| | | <el-row justify="end"> |
| | | <el-button type="primary" class="el-button-custom" @click="cancel"> |
| | | {{ cancelText }} |
| | | </el-button> |
| | | <el-button |
| | | type="danger" |
| | | class="el-button-custom-light" |
| | | @click="confirm" |
| | | > |
| | | {{ confirmText }} |
| | | </el-button> |
| | | </el-row> |
| | | </template> |
| | | </CardDialog> |
| | | </template> |
| | | <script> |
| | | export default { |
| | | props: { |
| | | title: String, |
| | | msg: String, |
| | | modelValue: Boolean, |
| | | confirmText: { |
| | | type: String, |
| | | default: '确认' |
| | | }, |
| | | cancelText: { |
| | | type: String, |
| | | default: 'åæ¶' |
| | | }, |
| | | onConfirm: Function, |
| | | onCancel: Function |
| | | }, |
| | | data() {}, |
| | | emits: ['update:modelValue'], |
| | | methods: { |
| | | handleChange(value) { |
| | | this.$emit('update:modelValue', value); |
| | | }, |
| | | confirm() { |
| | | if (this.onConfirm) { |
| | | this.onConfirm(); |
| | | } |
| | | this.$emit('update:modelValue', false); |
| | | }, |
| | | cancel() { |
| | | if (this.onCancel) { |
| | | this.onCancel(); |
| | | } |
| | | this.$emit('update:modelValue', false); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | }, |
| | | locateIndex(nV, oV) { |
| | | if (nV == oV) return; |
| | | // 1. å®ä½ç¹åºè¯¥å±ç¤ºå¨è¶å¿å¾ä¸é´ï¼å æ¤å®ä½ç¾åæ¯å¾ååç§»å½å_sizeçä¸å |
| | | let i = nV - parseInt(this.pageSize / 2); |
| | | // 2. ç¡®ä¿ç´¢å¼ä¸ä¼è¶
åºèå´ |
| | | i = i < 0 ? 0 : i; |
| | | // 3. è·åç´¢å¼å¯¹åºçè¿åº¦ç¾åæ¯ |
| | | this.progress = (i / (this.allXAxis.length - this.pageSize)) * 100; |
| | | |
| | | for (const iterator of this.allSeries) { |
| | | // if (iterator.name == factorName || (iterator.name == 'TVOC' || factorName == 'VOC')) { |
| | | iterator.markLine = { |
| | |
| | | ] |
| | | }; |
| | | } |
| | | this.changeChartRange(); |
| | | // 计ç®è¶
åºåé¡µæ°æ®éçé¿åº¦ |
| | | let len = this.allXAxis.length - this.pageSize; |
| | | len = len < 0 ? 0 : len; |
| | | // å®ä½ç¹åºè¯¥å±ç¤ºå¨è¶å¿å¾ä¸é´ï¼å æ¤å®ä½ç¾åæ¯å¾ååç§»å½å_sizeçä¸å |
| | | let i = nV - parseInt(this.pageSize / 2); |
| | | // ç¡®ä¿ç´¢å¼ä¸ä¼è¶
åºèå´ |
| | | i = i < 0 ? 0 : i; |
| | | i = i > len ? len : i; |
| | | // è·åç´¢å¼å¯¹åºçè¿åº¦ç¾åæ¯ |
| | | const _progress = (i / len) * 100; |
| | | if (this.progress != _progress) { |
| | | this.progress = _progress; |
| | | } else { |
| | | this.changeChartRange(); |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | }, |
| | | getShowSeries(sIndex, eIndex) { |
| | | this.allSeries.forEach((s) => { |
| | | if (sIndex && eIndex) { |
| | | s.data = s.allData.slice(sIndex, eIndex); |
| | | } |
| | | s.data = s.allData.slice(sIndex, eIndex); |
| | | }); |
| | | const res = this.allSeries.filter((s) => { |
| | | return this.selectFactorType.includes(s.key); |
| | |
| | | { |
| | | name: 'èµ°èªçæµ', |
| | | path: 'rmode' |
| | | }, |
| | | { |
| | | name: 'æ±¡ææº¯æº2', |
| | | path: 'hmode2' |
| | | } |
| | | // { |
| | | // name: 'æ±¡ææº¯æº2', |
| | | // path: 'hmode2' |
| | | // } |
| | | // { |
| | | // name: 'ç½æ ¼åçæµ', |
| | | // path: 'gridmonitor' |
| | | // } |
| | |
| | | label-position="right" |
| | | label-width="100px" |
| | | > |
| | | <el-form-item label="åºå¿" prop="location"> |
| | | <OptionLocation2 |
| | | :level="3" |
| | | :initValue="false" |
| | | :checkStrictly="false" |
| | | :allOption="false" |
| | | v-model="formObj.location" |
| | | ></OptionLocation2> |
| | | </el-form-item> |
| | | <el-form-item label="ä»»å¡ç¼å·" prop="missionCode"> |
| | | <el-input |
| | | size="small" |
| | |
| | | /> |
| | | </el-form-item> |
| | | <OptionType v-model="formObj.deviceType"></OptionType> |
| | | <el-form-item label="设å¤ç¼å·" prop="acountname"> |
| | | <!-- <el-form-item label="设å¤ç¼å·" prop="acountname"> |
| | | <el-input |
| | | size="small" |
| | | clearable |
| | | v-model="formObj.deviceCode" |
| | | placeholder="设å¤ç¼å·" |
| | | /> |
| | | </el-form-item> |
| | | </el-form-item> --> |
| | | <OptionDevice |
| | | :type="formObj.deviceType" |
| | | v-model="formObj.deviceCode" |
| | | ></OptionDevice> |
| | | <OptionTime v-model="formObj.timeArray"></OptionTime> |
| | | <el-form-item> |
| | | <el-button |
| | |
| | | import missionApi from '@/api/missionApi'; |
| | | import { useFormConfirm } from '@/composables/formConfirm'; |
| | | import { useFetchData } from '@/composables/fetchData'; |
| | | import { useMissionStore } from '@/stores/mission'; |
| | | |
| | | const missionStore = useMissionStore(); |
| | | const dialogVisible = ref(false); |
| | | const { loading, fetchData } = useFetchData(); |
| | | const baseRules = reactive({ |
| | | _usertype: [ |
| | | const rules = reactive({ |
| | | location: [ |
| | | { |
| | | required: true, |
| | | message: 'ç¨æ·ç±»åä¸è½ä¸ºç©º', |
| | | message: 'åºå¿ä¸è½ä¸ºç©º', |
| | | trigger: 'change' |
| | | } |
| | | ], |
| | | _locations: [ |
| | | missionCode: [ |
| | | { |
| | | required: true, |
| | | message: 'è¡æ¿åºåä¸è½ä¸ºç©º', |
| | | trigger: 'change' |
| | | message: 'ä»»å¡ç¼å·ä¸è½ä¸ºç©º', |
| | | trigger: 'blur' |
| | | } |
| | | ], |
| | | _scenetype: [ |
| | | timeArray: [ |
| | | { |
| | | required: true, |
| | | message: 'åºæ¯ç±»åä¸è½ä¸ºç©º', |
| | | message: 'æ¶é´ä¸è½ä¸ºç©º', |
| | | trigger: 'change' |
| | | } |
| | | ] |
| | | }); |
| | | const param = computed(() => { |
| | | return { |
| | | districtName: formObj.value.location.dName, |
| | | missionCode: formObj.value.missionCode, |
| | | deviceType: formObj.value.deviceType, |
| | | deviceCode: formObj.value.deviceCode, |
| | |
| | | fetchData((page, pageSize) => { |
| | | return missionApi.putNewMission(param.value).then((res) => { |
| | | dialogVisible.value = false; |
| | | missionStore.fetchMission(); |
| | | }); |
| | | }); |
| | | } |
| | |
| | | > |
| | | ä»»å¡ç®¡ç |
| | | </el-button> |
| | | <el-dialog v-model="dialogVisible" :show-close="false" align-center> |
| | | <template #header="{ close, titleId, titleClass }"> |
| | | <BaseCard direction="top-left" borderless="t"> |
| | | <template #content> |
| | | <el-row justify="space-between" align="middle"> |
| | | <el-row align="middle"> |
| | | <font-awesome-icon icon="fa fa-list" class="m-r-4" /> |
| | | <span :id="titleId" :class="titleClass">èµ°èªä»»å¡ç®¡ç</span> |
| | | </el-row> |
| | | <font-awesome-icon |
| | | icon="fa fa-times" |
| | | class="cursor-p m-r-4" |
| | | @click="close" |
| | | /> |
| | | </el-row> |
| | | </template> |
| | | </BaseCard> |
| | | </template> |
| | | <BaseCard size="medium"> |
| | | <template #content> |
| | | <el-row class="mission-table"> |
| | | <el-col :span="20"> |
| | | <el-table |
| | | :data="missionList" |
| | | table-layout="fixed" |
| | | size="small" |
| | | :show-overflow-tooltip="true" |
| | | border |
| | | row-class-name="t-row" |
| | | cell-class-name="t-cell" |
| | | header-row-class-name="t-header-row" |
| | | header-cell-class-name="t-header-cell" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | label="åºå·" |
| | | align="center" |
| | | width="50" |
| | | /> |
| | | <el-table-column |
| | | prop="missionCode" |
| | | label="ä»»å¡ç¼å·" |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | prop="startTime" |
| | | label="å¼å§æ¶é´" |
| | | align="center" |
| | | :formatter="timeFormatter" |
| | | /> |
| | | <el-table-column |
| | | prop="endTime" |
| | | label="ç»ææ¶é´" |
| | | align="center" |
| | | :formatter="timeFormatter" |
| | | /> |
| | | <el-table-column label="管ç" width="70" align="center"> |
| | | <template #default="{ row }"> |
| | | <el-button |
| | | type="primary" |
| | | size="small" |
| | | class="el-button-custom" |
| | | @click="deleteMission(row)" |
| | | >å é¤</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-col> |
| | | <el-col :span="4" class="flex-col"> |
| | | <div> |
| | | <!-- <el-button type="primary" class="el-button-custom"> |
| | | <CardDialog v-model="dialogVisible" title="èµ°èªä»»å¡ç®¡ç"> |
| | | <el-row class="mission-table"> |
| | | <el-col :span="20"> |
| | | <el-table |
| | | :data="missionStore.missionList" |
| | | table-layout="fixed" |
| | | size="small" |
| | | :show-overflow-tooltip="true" |
| | | border |
| | | height="64vh" |
| | | row-class-name="t-row" |
| | | cell-class-name="t-cell" |
| | | header-row-class-name="t-header-row" |
| | | header-cell-class-name="t-header-cell" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | label="åºå·" |
| | | align="center" |
| | | width="50" |
| | | /> |
| | | <el-table-column prop="missionCode" label="ä»»å¡ç¼å·" align="center" /> |
| | | <el-table-column |
| | | prop="startTime" |
| | | label="å¼å§æ¶é´" |
| | | align="center" |
| | | :formatter="timeFormatter" |
| | | /> |
| | | <el-table-column |
| | | prop="endTime" |
| | | label="ç»ææ¶é´" |
| | | align="center" |
| | | :formatter="timeFormatter" |
| | | /> |
| | | <el-table-column label="管ç" width="70" align="center"> |
| | | <template #default="{ row }"> |
| | | <el-button |
| | | type="primary" |
| | | size="small" |
| | | class="el-button-custom" |
| | | @click="deleteMission(row)" |
| | | >å é¤</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-col> |
| | | <el-col :span="4" class="flex-col"> |
| | | <div> |
| | | <!-- <el-button type="primary" class="el-button-custom"> |
| | | æ°å»ºä»»å¡ |
| | | </el-button> --> |
| | | <MissionCreate></MissionCreate> |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" class="el-button-custom"> |
| | | æ°æ®å¯¼å
¥ |
| | | </el-button> |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" class="el-button-custom"> |
| | | ä¸è½½æ¨¡æ¿ |
| | | </el-button> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | </BaseCard> |
| | | </el-dialog> |
| | | <MissionCreate></MissionCreate> |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" class="el-button-custom"> |
| | | æ°æ®å¯¼å
¥ |
| | | </el-button> |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" class="el-button-custom"> |
| | | ä¸è½½æ¨¡æ¿ |
| | | </el-button> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </CardDialog> |
| | | <MessageBox |
| | | v-model="msgBoxVisible" |
| | | :on-confirm="onConfirm" |
| | | title="å é¤èµ°èªä»»å¡" |
| | | msg="确认æ¯å¦å é¤è¯¥èµ°èªä»»å¡" |
| | | confirmText="å é¤" |
| | | ></MessageBox> |
| | | </template> |
| | | <script> |
| | | import moment from 'moment'; |
| | | import { mapState } from 'pinia'; |
| | | import { mapStores } from 'pinia'; |
| | | import { useMissionStore } from '@/stores/mission'; |
| | | import { useFetchData } from '@/composables/fetchData'; |
| | | |
| | | export default { |
| | | setup() { |
| | | const { loading, fetchData } = useFetchData(); |
| | | return { loading, fetchData }; |
| | | }, |
| | | props: {}, |
| | | data() { |
| | | return { |
| | | dialogVisible: false |
| | | dialogVisible: false, |
| | | msgBoxVisible: false, |
| | | onConfirm: undefined |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapState(useMissionStore, ['missionList']) |
| | | ...mapStores(useMissionStore) |
| | | }, |
| | | methods: { |
| | | createMission() {}, |
| | | deleteMission(row) {}, |
| | | deleteMission(row) { |
| | | this.onConfirm = () => { |
| | | this.missionStore.deleteMission(row.missionCode); |
| | | }; |
| | | this.msgBoxVisible = true; |
| | | }, |
| | | timeFormatter(row, col, cellValue, index) { |
| | | return moment(cellValue).format('YYYY-MM-DD HH:mm:ss'); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!-- <el-form-item :label="placeholder" :prop="prop"> --> |
| | | <el-cascader |
| | | :model-value="formatedValue" |
| | | @change="handleChange" |
| | | :options="locations" |
| | | :placeholder="placeholder" |
| | | :props="optionProps" |
| | | size="small" |
| | | :style="'width: ' + width + 'px'" |
| | | /> |
| | | <!-- </el-form-item> --> |
| | | </template> |
| | | |
| | | <script> |
| | | import { enumLocation } from '@/constant/location'; |
| | | |
| | | export default { |
| | | props: { |
| | | // æ¯å¦å¨é¦é项夿·»å âå
¨é¨âé项 |
| | | allOption: { |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | // æ¥è¯¢çè¡æ¿çº§å«ï¼åå¼1ï¼2ï¼3ï¼4, 5, 6 |
| | | level: { |
| | | type: Number, |
| | | default: 4 |
| | | }, |
| | | // ç»æè¿å |
| | | modelValue: Object, |
| | | // æ¯å¦é»è®¤è¿ååå§é项 |
| | | initValue: { |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | // è½å¦éæ©ä»»æä¸çº§é项 |
| | | checkStrictly: { |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | prop: { |
| | | type: String, |
| | | default: '_locations' |
| | | }, |
| | | width: { |
| | | type: Number, |
| | | default: 220 |
| | | } |
| | | }, |
| | | emits: ['update:modelValue'], |
| | | data() { |
| | | return { |
| | | locations: enumLocation(this.allOption, this.level), |
| | | optionProps: { |
| | | checkStrictly: this.checkStrictly |
| | | } |
| | | }; |
| | | }, |
| | | computed: { |
| | | placeholder() { |
| | | const list = 'ç/å¸/åº/é/é/ç©'.split('/'); |
| | | const p = []; |
| | | for (let i = 0; i < this.level; i++) { |
| | | p.push(list[i]); |
| | | } |
| | | return p.join('/'); |
| | | }, |
| | | formatedValue() { |
| | | return this.optionFormatReverse(this.modelValue); |
| | | } |
| | | }, |
| | | methods: { |
| | | handleChange(value) { |
| | | this.$emit('update:modelValue', this.optionFormat(value)); |
| | | }, |
| | | /** |
| | | * å°åºéé¡¹ç»ææ ¼å¼å |
| | | */ |
| | | optionFormat(val) { |
| | | const res = { |
| | | pCode: null, |
| | | pName: null, |
| | | cCode: null, |
| | | cName: null, |
| | | dCode: null, |
| | | dName: null, |
| | | tCode: null, |
| | | tName: null, |
| | | aCode: null, |
| | | aName: null, |
| | | mCode: null, |
| | | mName: null |
| | | }; |
| | | if (val.length > 0) { |
| | | res.pCode = val[0][0]; |
| | | res.pName = val[0][1]; |
| | | } |
| | | if (val.length > 1) { |
| | | res.cCode = val[1][0]; |
| | | res.cName = val[1][1]; |
| | | } |
| | | if (val.length > 2) { |
| | | res.dCode = val[2][0]; |
| | | res.dName = val[2][1]; |
| | | } |
| | | if (val.length > 3) { |
| | | res.tCode = val[3][0]; |
| | | res.tName = val[3][1]; |
| | | } |
| | | if (val.length > 4) { |
| | | res.aCode = val[4][0]; |
| | | res.aName = val[4][1]; |
| | | } |
| | | if (val.length > 5) { |
| | | res.mCode = val[5][0]; |
| | | res.mName = val[5][1]; |
| | | } |
| | | return res; |
| | | }, |
| | | optionFormatReverse(val) { |
| | | const res = []; |
| | | if (val) { |
| | | if (val.pName) { |
| | | res.push([val.pCode, val.pName]); |
| | | } |
| | | if (val.cName) { |
| | | res.push([val.cCode, val.cName]); |
| | | } |
| | | if (val.dName) { |
| | | res.push([val.dCode, val.dName]); |
| | | } |
| | | if (val.tName) { |
| | | res.push([val.tCode, val.tName]); |
| | | } |
| | | if (val.aName) { |
| | | res.push([val.aCode, val.aName]); |
| | | } |
| | | if (val.mName) { |
| | | res.push([val.mCode, val.mName]); |
| | | } |
| | | } |
| | | return res; |
| | | } |
| | | }, |
| | | mounted() { |
| | | if (this.initValue) { |
| | | if (this.checkStrictly) { |
| | | this.handleChange([this.locations[0].value]); |
| | | } else { |
| | | const f = (location) => { |
| | | if (location.children && location.children.length > 0) { |
| | | const r = f(location.children[0]); |
| | | r.unshift(location.value); |
| | | return r; |
| | | } else { |
| | | return [location.value]; |
| | | } |
| | | }; |
| | | this.handleChange(f(this.locations[0])); |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | class="w-150" |
| | | > |
| | | <el-option |
| | | v-for="(s, i) in missionList" |
| | | v-for="(s, i) in missionStore.missionList" |
| | | :key="i" |
| | | :label="s.missionCode" |
| | | :value="i" |
| | |
| | | emits: ['update:modelValue', 'change'], |
| | | data() { |
| | | return { |
| | | missionList: [], |
| | | index: undefined |
| | | }; |
| | | }, |
| | |
| | | }, |
| | | methods: { |
| | | fetchMission() { |
| | | this.fetchData((page, pageSize) => { |
| | | return missionApi |
| | | .fethchMission({ type: this.type, page, pageSize }) |
| | | .then((res) => { |
| | | this.missionList = res.data; |
| | | this.missionStore.missionList = res.data; |
| | | // if (this.missionList.length > 0) { |
| | | // this.handleChange(0); |
| | | // } |
| | | return res.head; |
| | | }); |
| | | }); |
| | | // this.fetchData((page, pageSize) => { |
| | | // return missionApi |
| | | // .fethchMission({ type: this.type, page, pageSize }) |
| | | // .then((res) => { |
| | | // this.missionList = res.data; |
| | | // this.missionStore.missionList = res.data; |
| | | // // if (this.missionList.length > 0) { |
| | | // // this.handleChange(0); |
| | | // // } |
| | | // return res.head; |
| | | // }); |
| | | // }); |
| | | this.missionStore.fetchMission(this.type); |
| | | }, |
| | | handleChange(value) { |
| | | this.$emit('update:modelValue', this.missionList[value]); |
| | | this.$emit('update:modelValue', this.missionStore.missionList[value]); |
| | | // this.$emit('change', this.missionList[value]); |
| | | } |
| | | }, |
| | |
| | | <template> |
| | | <el-form-item label="æ¶é´"> |
| | | <el-form-item label="æ¶é´" prop="timeArray"> |
| | | <el-date-picker |
| | | :model-value="modelValue" |
| | | @update:model-value="handleChange" |
| | |
| | | // æ°æ®è·å |
| | | function fetchData(fetch) { |
| | | loadStatus.value = 1; |
| | | fetch(page.value, pageSize.value) |
| | | return fetch(page.value, pageSize.value) |
| | | .then((pageInfo) => { |
| | | if (pageInfo) { |
| | | page.value = pageInfo.page ? pageInfo.page : 1; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { ElMessageBox, ElNotification, ElMessage } from 'element-plus'; |
| | | |
| | | function useMessageBoxTip({ |
| | | confirmMsg, |
| | | confirmTitle = 'æäº¤', |
| | | doneMsg = confirmTitle, |
| | | onConfirm, |
| | | }) { |
| | | ElMessageBox.confirm(confirmMsg, `${confirmTitle}确认`, { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | }) |
| | | .then(async () => { |
| | | let msg = `å·²${doneMsg}` |
| | | if (typeof onConfirm === 'function') { |
| | | const str = await onConfirm(); |
| | | if (typeof str === 'string' && str != '') { |
| | | msg = `å·²${doneMsg}, ${str}` |
| | | } |
| | | } |
| | | ElNotification({ |
| | | title: `${confirmTitle}æå`, |
| | | message: msg, |
| | | type: 'success', |
| | | // offset: 170, |
| | | position: 'bottom-left', |
| | | }); |
| | | }) |
| | | .catch((err) => { |
| | | let errStr = `${confirmTitle}åæ¶`; |
| | | if (err != 'cancel') { |
| | | errStr = `${confirmTitle}失败, ${err}`; |
| | | } |
| | | ElMessage({ |
| | | message: errStr, |
| | | type: 'warning', |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | function useMessageBox({ confirmMsg, confirmTitle, onConfirm }) { |
| | | ElMessageBox.confirm(confirmMsg, confirmTitle, { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | }) |
| | | .then(async () => { |
| | | if (typeof onConfirm === 'function') { |
| | | onConfirm(); |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | } |
| | | |
| | | export { useMessageBoxTip, useMessageBox }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * è·åè¡æ¿åºå |
| | | * @param {Boolean} allOption æ¯å¦å¨å¤´é¨æ·»å âå
¨é¨âé项 |
| | | * @param {Number} level è·åçå类深度ï¼èå´ 1 - 4 |
| | | * @returns |
| | | */ |
| | | function enumLocation(allOption = true, level = 4) { |
| | | const l = _enumLocation(); |
| | | if (!allOption) { |
| | | l.shift(); |
| | | } |
| | | _deleteByLevel(l, level, 1); |
| | | |
| | | return l; |
| | | } |
| | | |
| | | function _enumLocation() { |
| | | return [ |
| | | { |
| | | label: 'å
¨å¸', |
| | | value: [null, 'å
¨å¸'] |
| | | }, |
| | | { |
| | | label: '䏿µ·å¸', |
| | | value: ['31', '䏿µ·å¸'], |
| | | children: [ |
| | | { |
| | | label: '䏿µ·å¸', |
| | | value: ['3100', '䏿µ·å¸'], |
| | | children: [ |
| | | { |
| | | label: 'éå±±åº', |
| | | value: ['310116', 'éå±±åº'], |
| | | children: [ |
| | | { label: 'å¼ å °é', value: ['310116103', 'å¼ å °é'] }, |
| | | { label: 'äºæé', value: ['310116104', 'äºæé'] }, |
| | | { label: 'åå··é', value: ['310116105', 'åå··é'] }, |
| | | { label: 'å»ä¸é', value: ['310116107', 'å»ä¸é'] }, |
| | | { label: '髿°åº', value: ['310116503', '髿°åº'] }, |
| | | { label: 'éå±±å«é', value: ['310116109', 'éå±±å«é'] }, |
| | | { label: 'æ¼æ³¾é', value: ['310116112', 'æ¼æ³¾é'] }, |
| | | { |
| | | label: 'å±±é³é', |
| | | value: ['310116113', 'å±±é³é'], |
| | | children: [ |
| | | { |
| | | label: 'ä¸è¾¾å¹¿åº', |
| | | value: ['31011611301', 'ä¸è¾¾å¹¿åº'] |
| | | } |
| | | ] |
| | | }, |
| | | { label: 'ç³åè¡é', value: ['310116001', 'ç³åè¡é'] }, |
| | | { label: 'æ±æ³¾é', value: ['310116101', 'æ±æ³¾é'] }, |
| | | { label: 'æ«æ³¾é', value: ['310116102', 'æ«æ³¾é'] }, |
| | | { label: '碳谷绿湾', value: ['9000', '碳谷绿湾'] } |
| | | ] |
| | | }, |
| | | { |
| | | label: '徿±åº', |
| | | value: ['310104', '徿±åº'], |
| | | children: [ |
| | | { |
| | | label: 'æ¼æ²³æ³¾æ°å
´ææ¯å¼ååº', |
| | | value: ['310104501', 'æ¼æ²³æ³¾æ°å
´ææ¯å¼ååº'] |
| | | }, |
| | | { label: 'æ¹åè·¯è¡é', value: ['310104004', 'æ¹åè·¯è¡é'] }, |
| | | { label: '天平路è¡é', value: ['310104003', '天平路è¡é'] }, |
| | | { label: 'è¹æ¢
è·¯è¡é', value: ['310104012', 'è¹æ¢
è·¯è¡é'] }, |
| | | { label: 'æ«æè·¯è¡é', value: ['310104008', 'æ«æè·¯è¡é'] }, |
| | | { label: 'æåè·¯è¡é', value: ['310104007', 'æåè·¯è¡é'] }, |
| | | { label: 'é¿æ¡¥è¡é', value: ['310104010', 'é¿æ¡¥è¡é'] }, |
| | | { |
| | | label: 'ç°æè¡é', |
| | | value: ['310104011', 'ç°æè¡é'], |
| | | children: [ |
| | | { |
| | | label: 'ç°å°å', |
| | | value: ['31010401101', 'ç°å°å'] |
| | | } |
| | | ] |
| | | }, |
| | | { label: 'åº·å¥æ°æè¡é', value: ['310104013', 'åº·å¥æ°æè¡é'] }, |
| | | { |
| | | label: 'å¾å®¶æ±è¡é', |
| | | value: ['310104014', 'å¾å®¶æ±è¡é'], |
| | | children: [ |
| | | { |
| | | label: '天饿¡¥', |
| | | value: ['31010401401', '天饿¡¥'] |
| | | } |
| | | ] |
| | | }, |
| | | { label: 'åäºè·¯è¡é', value: ['310104015', 'åäºè·¯è¡é'] }, |
| | | { label: 'é¾åè¡é', value: ['310104016', 'é¾åè¡é'] }, |
| | | { label: 'æ¼æ²³æ³¾è¡é', value: ['310104017', 'æ¼æ²³æ³¾è¡é'] }, |
| | | { label: 'åæ³¾é', value: ['310104103', 'åæ³¾é'] } |
| | | ] |
| | | }, |
| | | { |
| | | label: 'éå®åº', |
| | | value: ['310106', 'éå®åº'], |
| | | children: [ |
| | | { |
| | | label: '大å®è·¯è¡é', |
| | | value: ['310106019', '大å®è·¯è¡é'], |
| | | children: [ |
| | | { |
| | | label: 'ä¹
å
ä¸å¿', |
| | | value: ['31010601901', 'ä¹
å
ä¸å¿'] |
| | | } |
| | | ] |
| | | }, |
| | | { label: '彿µ¦æ°æè¡é', value: ['310106020', '彿µ¦æ°æè¡é'] }, |
| | | { label: '临汾路è¡é', value: ['310106021', '临汾路è¡é'] }, |
| | | { label: 'è·æ±è¥¿è·¯è¡é', value: ['310106022', 'è·æ±è¥¿è·¯è¡é'] }, |
| | | { |
| | | label: '彿µ¦é', |
| | | value: ['310106101', '彿µ¦é'], |
| | | children: [ |
| | | { |
| | | label: '大èå', |
| | | value: ['31010610101', '大èå'] |
| | | } |
| | | ] |
| | | }, |
| | | { label: 'æ±å®è·¯è¡é', value: ['310106006', 'æ±å®è·¯è¡é'] }, |
| | | { label: 'ç³é¨äºè·¯è¡é', value: ['310106011', 'ç³é¨äºè·¯è¡é'] }, |
| | | { |
| | | label: 'å京西路è¡é', |
| | | value: ['310106012', 'å京西路è¡é'], |
| | | children: [ |
| | | { |
| | | label: 'X88', |
| | | value: ['31010601201', 'X88'] |
| | | } |
| | | ] |
| | | }, |
| | | { label: 'éå®å¯ºè¡é', value: ['310106013', 'éå®å¯ºè¡é'] }, |
| | | { |
| | | label: 'æ¹å®¶æ¸¡è¡é', |
| | | value: ['310106014', 'æ¹å®¶æ¸¡è¡é'], |
| | | children: [ |
| | | { |
| | | label: '889', |
| | | value: ['31010601401', '889'] |
| | | } |
| | | ] |
| | | }, |
| | | { label: '天ç®è¥¿è·¯è¡é', value: ['310106015', '天ç®è¥¿è·¯è¡é'] }, |
| | | { |
| | | label: 'åç«è¡é', |
| | | value: ['310106016', 'åç«è¡é'], |
| | | children: [ |
| | | { |
| | | label: '大æ¦å', |
| | | value: ['31010601601', '大æ¦å'] |
| | | } |
| | | ] |
| | | }, |
| | | { label: 'å®å±±è·¯è¡é', value: ['310106017', 'å®å±±è·¯è¡é'] }, |
| | | { label: 'å
±åæ°è·¯è¡é', value: ['310106018', 'å
±åæ°è·¯è¡é'] } |
| | | ] |
| | | }, |
| | | { |
| | | label: 'æ®éåº', |
| | | value: ['310107', 'æ®éåº'], |
| | | children: [ |
| | | { label: 'æ¹æ¨æ°æè¡é', value: ['310107005', 'æ¹æ¨æ°æè¡é'] }, |
| | | { label: 'ä¸éè¡é', value: ['310107021', 'ä¸éè¡é'] }, |
| | | { label: 'çå¦éè¡é', value: ['310107022', 'çå¦éè¡é'] }, |
| | | { label: 'é¿å¾é', value: ['310107102', 'é¿å¾é'] }, |
| | | { label: 'æ¡æµ¦é', value: ['310107103', 'æ¡æµ¦é'] }, |
| | | { label: 'ç³æ³è·¯è¡é', value: ['310107017', 'ç³æ³è·¯è¡é'] }, |
| | | { label: 'çæ³è·¯è¡é', value: ['310107016', 'çæ³è·¯è¡é'] }, |
| | | { label: 'é¿å¯¿è·¯è¡é', value: ['310107015', 'é¿å¯¿è·¯è¡é'] }, |
| | | { label: 'é¿é£æ°æè¡é', value: ['310107014', 'é¿é£æ°æè¡é'] }, |
| | | { label: 'å®å·è·¯è¡é', value: ['310107020', 'å®å·è·¯è¡é'] } |
| | | ] |
| | | }, |
| | | { |
| | | label: 'éµè¡åº', |
| | | value: ['310112', 'éµè¡åº'], |
| | | children: [ |
| | | { label: 'æ±å·è·¯è¡é', value: ['310112001', 'æ±å·è·¯è¡é'] }, |
| | | { label: 'å¤ç¾è¡é', value: ['310112006', 'å¤ç¾è¡é'] }, |
| | | { label: 'æ°è¹è¡é', value: ['310112008', 'æ°è¹è¡é'] }, |
| | | { label: '浦é¦è¡é', value: ['310112009', '浦é¦è¡é'] }, |
| | | { label: 'èåºé', value: ['310112101', 'èåºé'] }, |
| | | { label: 'ä¸å®é', value: ['310112102', 'ä¸å®é'] }, |
| | | { label: '颿¡¥é', value: ['310112103', '颿¡¥é'] }, |
| | | { label: 'åæ¼é', value: ['310112106', 'åæ¼é'] }, |
| | | { label: 'è¹æ¡¥é', value: ['310112107', 'è¹æ¡¥é'] }, |
| | | { label: 'æ¢
éé', value: ['310112108', 'æ¢
éé'] }, |
| | | { label: 'å´æ³¾é', value: ['310112110', 'å´æ³¾é'] }, |
| | | { label: '马桥é', value: ['310112112', '马桥é'] }, |
| | | { label: '浦æ±é', value: ['310112114', '浦æ±é'] }, |
| | | { label: 'èåºå·¥ä¸åº', value: ['310112501', 'èåºå·¥ä¸åº'] } |
| | | ] |
| | | }, |
| | | { |
| | | label: 'é¿å®åº', |
| | | value: ['310105', 'é¿å®åº'], |
| | | children: [ |
| | | { label: 'åé³è·¯è¡é', value: ['310105001', 'åé³è·¯è¡é'] }, |
| | | { label: 'æ±èè·¯è¡é', value: ['310105002', 'æ±èè·¯è¡é'] }, |
| | | { label: 'æ°åè·¯è¡é', value: ['310105004', 'æ°åè·¯è¡é'] }, |
| | | { label: 'å¨å®¶æ¡¥è¡é', value: ['310105005', 'å¨å®¶æ¡¥è¡é'] }, |
| | | { label: '天山路è¡é', value: ['310105006', '天山路è¡é'] }, |
| | | { label: 'ä»éæ°æè¡é', value: ['310105008', 'ä»éæ°æè¡é'] }, |
| | | { label: 'è¹æ¡¥è¡é', value: ['310105009', 'è¹æ¡¥è¡é'] }, |
| | | { label: 'ç¨å®¶æ¡¥è¡é', value: ['310105010', 'ç¨å®¶æ¡¥è¡é'] }, |
| | | { label: 'åæ°æ³¾è¡é', value: ['310105011', 'åæ°æ³¾è¡é'] }, |
| | | { label: 'æ°æ³¾é', value: ['310105102', 'æ°æ³¾é'] } |
| | | ] |
| | | }, |
| | | { |
| | | label: 'å®å±±åº', |
| | | value: ['310113', 'å®å±±åº'], |
| | | children: [] |
| | | }, |
| | | { |
| | | label: 'åå®åº', |
| | | value: ['310114', 'åå®åº'], |
| | | children: [] |
| | | }, |
| | | { |
| | | label: 'æµ¦ä¸æ°åº', |
| | | value: ['310115', 'æµ¦ä¸æ°åº'], |
| | | children: [] |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | ]; |
| | | } |
| | | |
| | | // æç
§éæ±çå®ä½ç²¾åº¦è¿åå¯¹åºæ°æ® |
| | | function _deleteByLevel(locations, level, step) { |
| | | if (step == level) { |
| | | locations.forEach((l) => { |
| | | if (l.children) { |
| | | l.children = undefined; |
| | | } |
| | | }); |
| | | return; |
| | | } else { |
| | | step++; |
| | | locations.forEach((l) => { |
| | | if (l.children) { |
| | | _deleteByLevel(l.children, level, step); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | export { enumLocation }; |
| | |
| | | import { createApp } from 'vue'; |
| | | import { createPinia } from 'pinia'; |
| | | import * as ElementPlusIconsVue from '@element-plus/icons-vue'; |
| | | import 'element-plus/theme-chalk/src/overlay.scss'; |
| | | import 'element-plus/theme-chalk/src/message.scss'; |
| | | import 'element-plus/theme-chalk/src/message-box.scss'; |
| | | import 'element-plus/theme-chalk/src/notification.scss'; |
| | | |
| | | import App from './App.vue'; |
| | | import router from './router'; |
| | |
| | | import { ref } from 'vue'; |
| | | import { defineStore } from 'pinia'; |
| | | import missionApi from '@/api/missionApi'; |
| | | import { useFetchData } from '@/composables/fetchData'; |
| | | |
| | | // èµ°èªä»»å¡ |
| | | export const useMissionStore = defineStore('mission', () => { |
| | | const missionList = ref([]); |
| | | const { loading, fetchData } = useFetchData(); |
| | | |
| | | return { missionList }; |
| | | function fetchMission(type) { |
| | | return fetchData((page, pageSize) => { |
| | | return missionApi |
| | | .fethchMission({ type: type, page, pageSize }) |
| | | .then((res) => { |
| | | missionList.value = res.data; |
| | | return res; |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | function deleteMission(missionCode) { |
| | | return fetchData(() => { |
| | | return missionApi.deleteMission(missionCode).then((res) => { |
| | | let index = -1; |
| | | for (let i = 0; i < missionList.value.length; i++) { |
| | | const e = missionList.value[i]; |
| | | if (e.missionCode == missionCode) { |
| | | index = i; |
| | | break; |
| | | } |
| | | } |
| | | if (index != -1) { |
| | | missionList.value.splice(index, 1); |
| | | } |
| | | return res; |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | return { missionList, loading, fetchMission, deleteMission }; |
| | | }); |
| | |
| | | --el-button-active-border-color: transparent; |
| | | } |
| | | |
| | | .el-button-custom-light { |
| | | --el-button-bg-color: var(--font-color); |
| | | --el-button-text-color: var(--bg-color); |
| | | --el-button-hover-text-color: var(--bg-color); |
| | | --el-button-hover-bg-color: var(--font-color); |
| | | --el-button-border-color: var(--bg-color); |
| | | --el-button-active-border-color: transparent; |
| | | } |
| | | |
| | | .el-button-custom:focus-visible { |
| | | outline: 0px solid var(--el-button-outline-color); |
| | | } |
| | |
| | | const fDatas = _factorDatas; |
| | | const factor = _factor; |
| | | drawMesh(fDatas, factor); |
| | | // console.log(map.getZoom()); |
| | | } |
| | | |
| | | var _maxHeight = 1000, |
| | |
| | | /** |
| | | * ç»å¾ |
| | | */ |
| | | function drawMesh(fDatas, factor, center, merge) { |
| | | function drawMesh(fDatas, factor, merge) { |
| | | const lnglats_GD = fDatas.lnglats_GD; |
| | | const coors = fDatas.coors_GD; |
| | | const heights = factor.heights; |
| | | const colors = factor.colors; |
| | | const bColor = factor.bottomColor; |
| | | if (center) { |
| | | map.setZoomAndCenter(16, center); |
| | | } |
| | | |
| | | // eslint-disable-next-line no-undef |
| | | var cylinder = new AMap.Object3D.Mesh(); |
| | |
| | | _maxH = maxH; |
| | | } |
| | | |
| | | // 3.ç¡®å®å®ä½åæ ç¹ |
| | | var center; |
| | | if (setCenter && lnglats_GD.length > 0) { |
| | | var p = lnglats_GD[0]; |
| | | for (let i = 0; i < lnglats_GD.length; i++) { |
| | | const e = lnglats_GD[i]; |
| | | if (e[0] != 0) { |
| | | p = e; |
| | | break; |
| | | } |
| | | } |
| | | // eslint-disable-next-line no-undef |
| | | center = new AMap.LngLat(...p); |
| | | } |
| | | |
| | | // 5.ç»å¶3Då¾å½¢ |
| | | this.drawMesh(fDatas, factor, center, merge); |
| | | this.drawMesh(fDatas, factor, merge); |
| | | |
| | | // 缩æ¾å°å¾å°åéçè§éçº§å« |
| | | // map.setFitView() |
| | |
| | | isCustom: true, //使ç¨èªå®ä¹çªä½ |
| | | content: this.createWindowContent(m), |
| | | // eslint-disable-next-line no-undef |
| | | offset: new AMap.Pixel(16, -45) |
| | | offset: new AMap.Pixel(16, -45), |
| | | autoMove: false |
| | | }); |
| | | return m.window; |
| | | }, |
| | |
| | | */ |
| | | |
| | | import { map } from './index_old'; |
| | | import sector from './sector'; |
| | | import { DialogUtil } from './dialog'; |
| | | import { useToolboxStore } from '@/stores/toolbox'; |
| | | |
| | | const toolboxStore = useToolboxStore(); |
| | |
| | | if (!toolboxStore.dataMarkerStatus) { |
| | | return; |
| | | } |
| | | if (_massMarks) { |
| | | map.remove(_massMarks); |
| | | _massMarks = undefined; |
| | | } |
| | | this.clearMassMarks(); |
| | | const lnglats = fDatas.lnglats_GD; |
| | | var data = []; |
| | | for (let i = 0; i < lnglats.length; i++) { |
| | |
| | | _massMarks = massMarks; |
| | | map.add(massMarks); |
| | | }, |
| | | clearMassMarks() { |
| | | if (_massMarks) { |
| | | map.remove(_massMarks); |
| | | _massMarks = undefined; |
| | | } |
| | | }, |
| | | |
| | | createLabelMarks(img, dataList) { |
| | | // eslint-disable-next-line no-undef |
| | |
| | | import { map, object3Dlayer } from './index_old'; |
| | | import calculate from './calculate'; |
| | | import imgLocation from '@/assets/mipmap/location.png'; |
| | | import { FactorDatas } from '@/model/FactorDatas'; |
| | | |
| | | var _defaultDeg = 30, |
| | | _sector = undefined, |
| | |
| | | content: content, |
| | | offset: [-35, 0], |
| | | position: 'BM', |
| | | minZoom: 15 |
| | | minZoom: 10 |
| | | } |
| | | } |
| | | ], |
| | |
| | | } |
| | | |
| | | function drawSectorMesh(sDeg, eDeg, lnglat, distance, distance2) { |
| | | if (distance == 0 || distance2 == 0) { |
| | | return; |
| | | } |
| | | // eslint-disable-next-line no-undef |
| | | var sector = new AMap.Object3D.Mesh(); |
| | | sector.transparent = true; |
| | |
| | | var angle1 = sDeg + unitDeg * i; |
| | | var angle2 = sDeg + unitDeg * (i + 1); |
| | | |
| | | var l1 = calculate.getLatLon(lnglat, distance, angle1); |
| | | var l2 = calculate.getLatLon(lnglat, distance, angle2); |
| | | var l3 = calculate.getLatLon(lnglat, distance2, angle1); |
| | | var l4 = calculate.getLatLon(lnglat, distance2, angle2); |
| | | var p1 = calculate.getLatLon(lnglat, distance, angle1); |
| | | var p2 = calculate.getLatLon(lnglat, distance, angle2); |
| | | var p3 = calculate.getLatLon(lnglat, distance2, angle1); |
| | | var p4 = calculate.getLatLon(lnglat, distance2, angle2); |
| | | |
| | | var coors = calculate.lngLatToGeodeticCoord([l1, l2, l3, l4]); |
| | | l1 = coors[0]; |
| | | l2 = coors[1]; |
| | | l3 = coors[2]; |
| | | l4 = coors[3]; |
| | | var coors = calculate.lngLatToGeodeticCoord([p1, p2, p3, p4]); |
| | | const l1 = coors[0]; |
| | | const l2 = coors[1]; |
| | | const l3 = coors[2]; |
| | | const l4 = coors[3]; |
| | | |
| | | // å
æµæå½¢ |
| | | geometry.vertices.push(p0.x, p0.y, 0); |
| | |
| | | } |
| | | |
| | | export default { |
| | | /** |
| | | * æ¸
空æå½¢åææ¬æ è®° |
| | | */ |
| | | clearSector() { |
| | | var list = []; |
| | | for (const iterator of _sectorViews) { |
| | |
| | | } |
| | | this.clearSectorMesh(); |
| | | }, |
| | | /** |
| | | * åªæ¸
空æå½¢ |
| | | */ |
| | | clearSectorMesh() { |
| | | if (_sector) { |
| | | object3Dlayer.remove(_sector); |
| | | } |
| | | }, |
| | | /** |
| | | * ç»å¶æå½¢ |
| | | * @param {FactorDatas} fDatas |
| | | * @param {number} i |
| | | * @returns æ°æ®åæ ç¹åæå½¢æå¤§åå¾ |
| | | */ |
| | | drawSector(fDatas, i) { |
| | | if (_sector != undefined) { |
| | | this.clearSector(); |
| | |
| | | sectorParams(fDatas, i); |
| | | drawSectorMesh(sDeg, eDeg, lnglat, distance, distance2); |
| | | drawElasticMarker(list, list2, distance, distance2); |
| | | return { p: lnglat, r: distance }; |
| | | }, |
| | | |
| | | /** |
| | | * ç»å¶è½¨è¿¹å¨ç»ä¸çæå½¢ |
| | | * @param {FactorDatas} fDatas |
| | | * @param {number} i |
| | | */ |
| | | drawSectorAna(fDatas, i) { |
| | | this.clearSectorMesh(); |
| | | const { sDeg, eDeg, lnglat, distance, distance2, list, list2 } = |
| | |
| | | import { map, isDragging } from '@/utils/map/index_old'; |
| | | import marks from '@/utils/map/marks'; |
| | | |
| | | /** |
| | | * åæ éåçæè¥¿åè§åæä¸åè§ |
| | | * @param {*} list |
| | | * list æ¯æ¥å£è·åçç¹ çæ°ç» |
| | | */ |
| | | const getBound = (list) => { |
| | | const offset = 0.005; |
| | | let south = null; |
| | | let west = null; |
| | | let north = null; |
| | | let east = null; |
| | | for (let item of list) { |
| | | // æé¤æ æç»çº¬åº¦ |
| | | if (item[0] == 0 && item[1] == 0) { |
| | | continue; |
| | | } |
| | | if ((west && item[0] < west) || !west) { |
| | | west = item[0] - offset; |
| | | } |
| | | if ((south && item[1] < south) || !south) { |
| | | south = item[1] - offset; |
| | | } |
| | | if ((east && item[0] > east) || !east) { |
| | | east = item[0] + offset; |
| | | } |
| | | if ((north && item[1] > north) || !north) { |
| | | north = item[1] + offset; |
| | | } |
| | | } |
| | | if (!south || !west || !north || !east) { |
| | | return { sw: null, ne: null }; |
| | | } else { |
| | | return { sw: [west, south], ne: [east, north] }; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸å¿ç¹åºåçåå¾ï¼å¾å°åéçå°å¾ç¼©æ¾ç³»æ° |
| | | * é«å¾·å°å¾ç¼©æ¾ç³»æ°æ¯åå°1ï¼åå°å¾å±ç¤ºçå®é
è·ç¦»æ¾å¤§1å |
| | | * é«å¾·å°å¾ç¼©æ¾ç³»æ°èå´[3, 18] |
| | | * @param {*} d |
| | | */ |
| | | const distanceToZoom = (d) => { |
| | | let baseDis = 250, |
| | | z = 0; |
| | | while (baseDis < d) { |
| | | baseDis *= 2; |
| | | z++; |
| | | } |
| | | |
| | | // å¤ä½çå°å¾ç¼©æ¾ç³»æ° |
| | | const x = (baseDis - d) / (baseDis / 2); |
| | | z -= x; |
| | | z = z < 0 ? 0 : z; |
| | | |
| | | z = 18 - z; |
| | | z = z < 3 ? 3 : z; |
| | | return z; |
| | | }; |
| | | |
| | | export default { |
| | | setCenter(lnglat) { |
| | |
| | | removeViews(view) { |
| | | map.remove(view); |
| | | }, |
| | | setFitView() { |
| | | map.setFitView(); |
| | | clearMap() { |
| | | marks.clearMassMarks(); |
| | | map.clearMap(); |
| | | }, |
| | | setFitView(views) { |
| | | if (views) { |
| | | map.setFitView(views); |
| | | } else { |
| | | map.setFitView(); |
| | | } |
| | | }, |
| | | setFitSector({ p, r }) { |
| | | this.setCenter(p); |
| | | const z = distanceToZoom(r); |
| | | map.setZoom(z); |
| | | }, |
| | | setBound(lnglats_GD) { |
| | | const { sw, ne } = getBound(lnglats_GD); |
| | | if (!sw || !ne) { |
| | | return; |
| | | } |
| | | // eslint-disable-next-line no-undef |
| | | var mybounds = new AMap.Bounds(sw, ne); // sw, ne > [xxx,xxx], [xxx,xxx] |
| | | map.setBounds(mybounds); |
| | | } |
| | | }; |
| | |
| | | import Layer from '@/utils/map/3dLayer'; |
| | | import marks from '@/utils/map/marks'; |
| | | import sector from '@/utils/map/sector'; |
| | | import mapUtil from '@/utils/map/util'; |
| | | import { DialogUtil } from '@/utils/map/dialog'; |
| | | import monitorDataApi from '@/api/monitorDataApi'; |
| | | import { useFetchData } from '@/composables/fetchData'; |
| | |
| | | import { FactorDatas } from '@/model/FactorDatas'; |
| | | import TrendAnalysis from './component/TrendAnalysis.vue'; |
| | | import DataSheet from './component/DataSheet.vue'; |
| | | import { ElMessageBox, ElNotification, ElMessage } from 'element-plus'; |
| | | |
| | | export default { |
| | | components: { TrendAnalysis, DataSheet }, |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | // æ£æ¥æ°æ®ç»çº¬åº¦æ¯å¦åæ³ |
| | | checkDataIsValid(index) { |
| | | const lnglats_GD = this.factorDatas.lnglats_GD[index]; |
| | | const time = this.factorDatas.times[index]; |
| | | if (lnglats_GD[0] == 0 && lnglats_GD[1] == 0) { |
| | | ElMessage({ |
| | | message: `${time}çæ°æ®ç»çº¬åº¦æ æ`, |
| | | type: 'warning' |
| | | }); |
| | | return false; |
| | | } else { |
| | | this.locateIndex = index; |
| | | return true; |
| | | } |
| | | }, |
| | | // çå¬æçº¿å¾åè¡¨æ ¼çç¹å»äºä»¶ |
| | | handelIndexChange(index) { |
| | | this.locateIndex = index; |
| | | this.drawSector(index); |
| | | if (this.checkDataIsValid(index)) { |
| | | this.drawSector(index); |
| | | } |
| | | }, |
| | | draw() { |
| | | // todo å·æ°å¾ä¾ |
| | | // å·æ°å¾ä¾ |
| | | const factor = this.factorDatas.factor[this.factorType]; |
| | | sector.clearSector(); |
| | | this.drawRoadMap(factor); |
| | | this.drawMassMarks(factor); |
| | | }, |
| | |
| | | marks.drawMassMarks(this.factorDatas, e, (index) => { |
| | | // æ¥è¯¢èå´å
ççæµç«ç¹ |
| | | // SceneUtil.searchByCoordinate(lnglat[0], lnglat[1], distance); |
| | | this.drawSector(index); |
| | | this.locateIndex = index; |
| | | if (this.checkDataIsValid(index)) { |
| | | this.drawSector(index); |
| | | } |
| | | }); |
| | | // è°æ´å°å¾è§è§ |
| | | mapUtil.setBound(this.factorDatas.lnglats_GD); |
| | | }, |
| | | drawSector(index) { |
| | | // 1. ç»å¶æ°æå½¢åºå |
| | | sector.drawSector(this.factorDatas, index); |
| | | const pr = sector.drawSector(this.factorDatas, index); |
| | | // è°æ´è§è§å±
䏿¾ç¤º |
| | | mapUtil.setFitSector(pr); |
| | | // 2. ç»å¶å¯¹è¯æ¡ |
| | | DialogUtil.openNewWindow(this.factorDatas, index, () => { |
| | | // ç§»é¤æå½¢åºå |
| | |
| | | }, |
| | | mounted() { |
| | | this.fetchRealTimeData(); |
| | | }, |
| | | unmounted() { |
| | | mapUtil.clearMap(); |
| | | } |
| | | }; |
| | | </script> |