guoshilong
2023-09-13 79f8ad79d4aebbc26037cda5d5a9a1ed295b6e4b
计划选择航线回显
4 files modified
30 ■■■■ changed files
src/api/manage.ts 9 ●●●●● patch | view | raw | blame | history
src/components/task/CreatePlan.vue 16 ●●●● patch | view | raw | blame | history
src/pages/page-web/projects/tsa.vue 3 ●●●●● patch | view | raw | blame | history
src/pages/page-web/projects/wayline.vue 2 ●●● patch | view | raw | blame | history
src/api/manage.ts
@@ -3,6 +3,7 @@
import { Device } from '/@/types/device'
const HTTP_PREFIX = 'api/system'
const HTTP_PREFIX_MANAGE='api/drone'
// login
export interface LoginBody {
@@ -60,10 +61,10 @@
  return result.data
}
// Get Device Topo
export const getDeviceTopo = async function (workspace_id: string): Promise<IWorkspaceResponse<any>> {
  const url = `${HTTP_PREFIX}/devices/${workspace_id}/devices`
  const result = await request.get(url)
// 获取在线设备信息
export const getDeviceTopo = async function (params:any): Promise<IWorkspaceResponse<any>> {
  const url = `${HTTP_PREFIX_MANAGE}/manage/device`
  const result = await request.get(url,{params})
  return result.data
}
src/components/task/CreatePlan.vue
@@ -25,9 +25,11 @@
                  {{ wayline.name }}
                </div>
              </a-tooltip>
              <div class="ml10">
                <UserOutlined />
              </div>
              <a-tooltip :title="wayline.user_name">
                <div class="ml5 pr10"
                  style="width: 80px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;">
@@ -264,7 +266,7 @@
</template>
<script lang="ts" setup>
import { computed, onMounted, onUnmounted, reactive, ref, toRaw, UnwrapRef } from 'vue'
import { computed, onMounted, onUnmounted, reactive, ref, toRaw, UnwrapRef, watch } from 'vue'
import {
  CloseOutlined,
  RocketOutlined,
@@ -291,6 +293,7 @@
} from '/@/types/task'
import moment, { Moment } from 'moment'
import { RuleObject } from 'ant-design-vue/es/form/interface'
import { clickPoint, pointCenter } from '/@/hooks/use-center-point'
const btnSize = 'size'
const root = getRoot()
@@ -298,6 +301,13 @@
const workspaceId = localStorage.getItem(ELocalStorageKey.WorkspaceId)!
const wayline = computed<WaylineFile>(() => {
  return store.state.waylineInfo
})
watch(() => wayline, (newVal) => {
  if (newVal.value.id) {
    planForm.fileId = newVal.value.id
  }
}, {
  deep: true
})
const calculateDisabled = computed(() => {
@@ -370,8 +380,6 @@
  }
}
const repeatRuleValue = ref([] as string[])
const dock = computed<Device>(() => {
  return store.state.dockInfo
})
@@ -423,7 +431,7 @@
  // 公共字段
  form.name = planForm.name
  form.workspaceId = store.state.common.projectId
  form.waylineId = planForm.waylineId
  form.fileId = planForm.fileId
  form.dockSn = planForm.dockSn
  form.taskType = planForm.taskType
  form.rthAltitude = planForm.rthAltitude
src/pages/page-web/projects/tsa.vue
@@ -9,6 +9,7 @@
      </a-row>
    </div>
    <div class="scrollbar" :style="{ height: scorllHeight + 'px' }">
      <!--机场-->
      <a-collapse :bordered="false" expandIconPosition="right" accordion style="background: #232323;">
        <a-collapse-panel :key="EDeviceTypeName.Dock" header="机场" style="border-bottom: 1px solid #4f4f4f;">
          <div v-if="onlineDocks.data.length === 0" style="height: 150px; color: white;">
@@ -163,6 +164,8 @@
          </div>
        </a-collapse-panel>
      </a-collapse>
      <!--设备-->
      <a-collapse :bordered="false" expandIconPosition="right" accordion style="background: #232323;">
        <a-collapse-panel :key="EDeviceTypeName.Aircraft" header="在线设备" style="border-bottom: 1px solid #4f4f4f;">
          <div v-if="onlineDevices.data.length === 0" style="height: 150px; color: white;">
src/pages/page-web/projects/wayline.vue
@@ -193,7 +193,7 @@
function selectRoute (wayline: WaylineFile) {
  initKmlFile('/src/assets/kmz/test.kmz')
  // store.commit('SET_SELECT_WAYLINE_INFO', wayline)
  store.commit('SET_SELECT_WAYLINE_INFO', wayline)
}
/**