@@ -114,8 +114,8 @@ export default defineComponent({ | |||
} | |||
const handleClick = (list) => { | |||
router.push('/') | |||
inspectionStore.setList(list) | |||
router.push('/') | |||
} | |||
data.timer = setInterval(() => { |
@@ -0,0 +1,22 @@ | |||
import { defineStore } from 'pinia' | |||
export const useLiveStore = defineStore('live', { | |||
state() { | |||
return { | |||
list: null | |||
} | |||
}, | |||
getters: { | |||
getList() { | |||
return this.list | |||
} | |||
}, | |||
actions: { | |||
setList(data) { | |||
this.list = data | |||
}, | |||
resetList() { | |||
this.list = null | |||
} | |||
} | |||
}) |
@@ -111,6 +111,7 @@ import camera from '@/assets/icon/camera.png' | |||
import materials from '@/assets/icon/materials.png' | |||
import personnel from '@/assets/icon/personnel.png' | |||
import { implement } from '@/api/task/index.js' | |||
import { useLiveStore } from '@/store/modules/live.js' | |||
const ICON_LIST = { | |||
'002000': problemSpot_icon, | |||
'002001': deadTree_icon, | |||
@@ -122,6 +123,7 @@ export default { | |||
emits: ['send'], | |||
setup(props, { emit }) { | |||
const router = useRouter() | |||
const liveStore = useLiveStore() | |||
const data = reactive({ | |||
selectedTab: 0, | |||
extendList: [ | |||
@@ -287,10 +289,9 @@ export default { | |||
*/ | |||
const liveShow = (rowInfo) => { | |||
rowInfo = JSON.stringify(rowInfo) | |||
liveStore.setList(rowInfo) | |||
router.push({ | |||
path: '/taskManage/all', | |||
query: { rowInfo: rowInfo } | |||
path: '/taskManage/all' | |||
}) | |||
} | |||
@@ -249,6 +249,11 @@ export default { | |||
? 'pointer' | |||
: '' | |||
}) | |||
// 从其他页面点击网页头部进来, 若有直播, 则打开抽屉 | |||
if (inspectionStore.getList?.id) { | |||
data.drawerShow = true | |||
} | |||
} | |||
/** |
@@ -65,7 +65,7 @@ | |||
</template> | |||
<script> | |||
import { defineComponent, ref, reactive, toRefs, computed, watch, nextTick, onBeforeUnmount } from 'vue' | |||
import { defineComponent, ref, reactive, toRefs, computed, watch, nextTick, onBeforeUnmount, onMounted } from 'vue' | |||
import Underlay from './Underlay.vue' | |||
import ControlPanel from './ControlPanel.vue' | |||
import SpeedChart from './SpeedChart.vue' | |||
@@ -192,6 +192,12 @@ export default defineComponent({ | |||
}) | |||
watch(() => inspectionStore.getList, (value) => { | |||
if (inspectionStore.getList) { | |||
uavCheck(value) | |||
} | |||
}) | |||
const uavCheck = (value) => { | |||
if (value) { | |||
// 获取无人机实时数据,绘制表格 | |||
if (value.airportId) { | |||
@@ -240,7 +246,7 @@ export default defineComponent({ | |||
} | |||
}, 6 * 60 * 1000) | |||
} | |||
}) | |||
} | |||
// 获取无人机信息 | |||
const getUavInfo = async(id) => { | |||
@@ -388,6 +394,12 @@ export default defineComponent({ | |||
} | |||
} | |||
onMounted(() => { | |||
if (inspectionStore.getList) { | |||
uavCheck(inspectionStore.getList) | |||
} | |||
}) | |||
onBeforeUnmount(() => { | |||
emergencyVideo.value?.disposeVideo() | |||
clearTimer() |
@@ -57,6 +57,7 @@ import { getTrackList, getLineList } from '@/api/task/index.js' | |||
import { useRouter } from 'vue-router' | |||
// 视频组件 | |||
import VideoPlayer from '@/components/VideoPlayer/index.vue' | |||
import { useLiveStore } from '@/store/modules/live.js' | |||
export default defineComponent({ | |||
name: 'LiveDrawer', | |||
components: { VideoPlayer }, | |||
@@ -78,6 +79,7 @@ export default defineComponent({ | |||
setup(props, { emit }) { | |||
const originRef = ref() | |||
const router = useRouter() | |||
const liveStore = useLiveStore() | |||
const data = reactive({ | |||
mapData: null, | |||
view: null, | |||
@@ -155,6 +157,7 @@ export default defineComponent({ | |||
}) | |||
} | |||
liveStore.resetList() | |||
} | |||
/* 获取轨迹数据 */ |
@@ -73,11 +73,13 @@ import VerifyDrawer from './components/VerifyDrawer.vue' | |||
import { reactive, ref, unref, toRefs, onUnmounted, onMounted } from 'vue' | |||
import { getTaskList } from '@/api/task/index.js' | |||
import { useRoute } from 'vue-router' | |||
import { useLiveStore } from '@/store/modules/live.js' | |||
export default { | |||
name: 'TaskAll', | |||
components: { HeadSearch, DataTable, TaskModal, LiveDrawer, DemandDrawer, VerifyDrawer }, | |||
setup() { | |||
const route = useRoute() | |||
const liveStore = useLiveStore() | |||
const rowInfo = route.query.rowInfo | |||
getAirOptions() | |||
@@ -121,9 +123,13 @@ export default { | |||
} | |||
} | |||
onMounted(() => { | |||
if (rowInfo) { | |||
data.rowData = JSON.parse(rowInfo) | |||
data.liveDrawer = true | |||
if (liveStore.getList) { | |||
// data.rowData = JSON.parse(rowInfo) | |||
data.rowData = JSON.parse(liveStore.getList) | |||
// 巡检任务才展示 | |||
if (data.rowData?.type === 1) { | |||
data.liveDrawer = true | |||
} | |||
} | |||
}) | |||
onUnmounted(() => { |