| | |
| | | |
| | | const $http = axios.create({ |
| | | baseURL: ip1, |
| | | timeout: 20000 |
| | | timeout: 30000 |
| | | }); |
| | | |
| | | //添加拦截器 |
| | |
| | | type: String, |
| | | modelValue: String |
| | | }, |
| | | emits: ['update:modelValue'], |
| | | emits: ['update:modelValue', 'initOver'], |
| | | data() { |
| | | return {}; |
| | | }, |
| | |
| | | this.deviceStore.fetchDevice().then((res) => { |
| | | if (res.success && res.data.length > 0) { |
| | | this.handleChange(this.deviceOptions[0].value); |
| | | this.$emit('initOver'); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | type: String, |
| | | modelValue: String |
| | | }, |
| | | emits: ['update:modelValue', 'change'], |
| | | emits: ['update:modelValue', 'initOver'], |
| | | data() { |
| | | return { |
| | | index: undefined |
| | |
| | | if (res.success && res.data.length > 0) { |
| | | this.index = 0; |
| | | this.handleChange(0); |
| | | this.$emit('initOver'); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | }, |
| | | modelValue: String |
| | | }, |
| | | emits: ['update:modelValue'], |
| | | emits: ['update:modelValue', 'initOver'], |
| | | data() { |
| | | return { |
| | | typeList: typeList(), |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$emit('initOver'); |
| | | this.handleChange(this.typeList[0].value); |
| | | } |
| | | }; |
| | |
| | | <BaseCard size="middle-s" direction="down"> |
| | | <template #content> |
| | | <el-form :inline="true"> |
| | | <OptionMission v-model="mission"></OptionMission> |
| | | <OptionType v-model="formSearch.deviceType"></OptionType> |
| | | <OptionMission v-model="mission" @init-over="initOver"></OptionMission> |
| | | <OptionType |
| | | v-model="formSearch.deviceType" |
| | | @init-over="initOver" |
| | | ></OptionType> |
| | | <OptionDevice |
| | | :type="formSearch.deviceType" |
| | | v-model="formSearch.deviceCode" |
| | | @init-over="initOver" |
| | | ></OptionDevice> |
| | | <OptionTime |
| | | v-model="formSearch.timeArray" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | // 可能会有延时初始化的选项总数,包括走航任务、设备类型、设备编号 |
| | | const MAX_INIT = 3; |
| | | // 已初始化的选项数 |
| | | let initCount = 0; |
| | | let initEvents = []; |
| | | |
| | | // 搜索框 |
| | | export default { |
| | | props: { |
| | |
| | | }, |
| | | mission(nV, oV) { |
| | | if (nV != oV) { |
| | | this.formSearch.timeArray = [ |
| | | new Date(nV.startTime), |
| | | new Date(nV.endTime) |
| | | ]; |
| | | this.dateRange = [new Date(nV.startTime), new Date(nV.endTime)]; |
| | | this.formSearch.deviceType = nV.deviceType; |
| | | this.formSearch.deviceCode = nV.deviceCode; |
| | | this.onInit(() => { |
| | | this.formSearch.timeArray = [ |
| | | new Date(nV.startTime), |
| | | new Date(nV.endTime) |
| | | ]; |
| | | this.dateRange = [new Date(nV.startTime), new Date(nV.endTime)]; |
| | | this.formSearch.deviceType = nV.deviceType; |
| | | this.formSearch.deviceCode = nV.deviceCode; |
| | | |
| | | // 代表首次进入界面,此时自动执行首个任务的数据查询操作 |
| | | if (oV == undefined) { |
| | | setTimeout(() => { |
| | | this.handleClick(); |
| | | }, 500); |
| | | } |
| | | // 代表首次进入界面,此时自动执行首个任务的数据查询操作 |
| | | if (oV == undefined) { |
| | | setTimeout(() => { |
| | | this.handleClick(); |
| | | }, 500); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | // 各选项初始化加载完成判定 |
| | | initOver() { |
| | | initCount++; |
| | | if (initCount == MAX_INIT && initEvents.length > 0) { |
| | | initEvents.forEach((e) => { |
| | | e(); |
| | | }); |
| | | initEvents = []; |
| | | } |
| | | }, |
| | | onInit(event) { |
| | | if (initCount == MAX_INIT) { |
| | | event(); |
| | | } else { |
| | | initEvents.push(event); |
| | | } |
| | | }, |
| | | handleClick() { |
| | | this.$emit('search', { ...this.formSearch, mission: this.mission }); |
| | | } |
| | |
| | | // 绘制3D走行路线图 |
| | | drawRoadMap(e) { |
| | | this.factorDatas.refreshHeight(this.factorType); |
| | | |
| | | Layer.drawRoadMap(this.factorDatas, e, this.merge, this.setCenter); |
| | | }, |
| | | drawRoadLine(e) { |
| | | this.factorDatas.refreshHeight(this.factorType); |
| | | mapLine.drawLine(this.factorDatas, e); |
| | | }, |
| | | drawMassMarks(e) { |