Browse Source

回显复杂路径

master
maochaoying 2 years ago
parent
commit
4028699418
  1. 7
      src/api/path.js
  2. 6
      src/components/PathPlan.vue
  3. 11
      src/components/Task.vue

7
src/api/path.js

@ -14,3 +14,10 @@ export const pathPlanApi = (id, data) => {
data,
})
}
export const getPlanPathListApi = id => {
return request({
url: `/path/list/${id}`,
method: 'GET',
})
}

6
src/components/PathPlan.vue

@ -16,7 +16,7 @@
</template>
<script setup>
import { ref } from 'vue'
import { ref, onMounted } from 'vue'
import { useTaskStore } from '@/store'
const taskStore = useTaskStore()
const props = defineProps({
@ -45,7 +45,7 @@ const getLine = (index, position) => {
const pathArr = ref([])
const showPath = item => {
const testArr = pathArr.value.filter(it => it.number == item)
const testArr = taskStore.pathData.filter(it => it.number == item)
if (testArr?.length > 0) {
return true
}
@ -53,7 +53,7 @@ const showPath = item => {
}
const getNumber = item => {
const testArr = pathArr.value.filter(it => it.number == item)
const testArr = taskStore.pathData.filter(it => it.number == item)
if (testArr?.length > 0) {
return testArr[0].orderNumber
}

11
src/components/Task.vue

@ -122,7 +122,7 @@ import {
} from '@/api/task'
import { getNuclearExcelApi } from '@/api'
import PathPlan from 'cpns/PathPlan'
import { checkCanDiyPathApi, pathPlanApi } from '@/api/path'
import { checkCanDiyPathApi, pathPlanApi, getPlanPathListApi } from '@/api/path'
import { useAccountStore, useTaskStore, useImageStore } from '@/store'
import { allOperatorApi } from '@/api/publish'
import moment from 'moment'
@ -449,11 +449,18 @@ export default {
onConfirm: async ({ e }) => {
const res = await checkCanDiyPathApi(taskId)
if (res?.code == 200) {
//
//
const listRes = await getPlanPathListApi(taskId)
if (listRes?.code == 200) {
if (listRes?.data) {
taskStore.updatePathData(listRes?.data)
}
}
this.pathVisible = true
} else {
this.$message.error(res?.msg)
}
//
confirmDia.destroy()
},
onClose: ({ e, trigger }) => {

Loading…
Cancel
Save