From 89ab2ec7f8790c5cc184de98682af032c69c2afc Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期三, 11 九月 2024 15:13:27 +0800 Subject: [PATCH] 2024.9.11 --- src/views/visualization/SubtaskVisual.vue | 153 +++++++++++++++++++++++++++++++++++---------------- 1 files changed, 105 insertions(+), 48 deletions(-) diff --git a/src/views/visualization/SubtaskVisual.vue b/src/views/visualization/SubtaskVisual.vue index 591758d..185b452 100644 --- a/src/views/visualization/SubtaskVisual.vue +++ b/src/views/visualization/SubtaskVisual.vue @@ -1,8 +1,29 @@ <template> - <el-scrollbar :height="mapHeight"> + <el-scrollbar v-if="mapStore.focusMarker" :height="mapHeight"> <el-card class="p-events-auto wrapper"> - <div>{{ subtask.name }}</div> - <el-timeline style="max-width: 600px"> + <el-row justify="space-between"> + <div class="font-small">{{ scene.name }}</div> + <el-button icon="Close" circle @click="mapStore.focusMarker = undefined"></el-button> + </el-row> + <el-divider></el-divider> + <div class="font-small">鐘舵�侊細{{ subtask.status }}</div> + <div class="font-small">璁″垝锛歿{ $fm.formatYMD(subtask.planstarttime) }}</div> + <div v-if="subtask.status != '鏈墽琛�'" class="font-small"> + <span>鎵ц锛歿{ $fm.formatH(subtask.executionstarttime) }}</span> + <span> - </span> + <span>{{ $fm.formatH(subtask.executionendtime) }}</span> + </div> + <div class="font-small">闂锛�</div> + <problem-item + v-for="(item, i) in problemList" + :key="item.guid" + :index="i + 1" + :problem="item" + ></problem-item> + <!-- <div v-for="item in problemList" :key="item.guid"> + {{ item.problemname }} + </div> --> + <!-- <el-timeline style="max-width: 600px"> <el-timeline-item v-for="(activity, index) in activities" :key="index" @@ -14,13 +35,18 @@ > {{ activity.content }} </el-timeline-item> - </el-timeline> + </el-timeline> --> </el-card> </el-scrollbar> </template> <script> import { inject } from 'vue' +import { useMapStore } from '@/stores/map.js' +import { mapStores } from 'pinia' + +import problemApi from '@/api/fysp/problemApi.js' + /** * 鍏蜂綋宸℃煡浠诲姟鍙鍖� * 鍖呮嫭鍦板浘瀹氫綅淇℃伅灞曠ず銆佸贰鏌ヤ换鍔″叏娴佺▼骞抽摵灞曠ず @@ -33,53 +59,80 @@ return { height, mapHeight } }, props: { - subtask: { - type: Object, - default: () => { - return { - guid: 'SMuheEkjswioSn7A', - name: '涓鐢熸�佹暟瀛楁腐椤圭洰宸℃煡涓鐢熸�佹暟瀛楁腐椤圭洰宸℃煡', - district: '閲戝北鍖�', - planTime: '2024-06-04', - startTime: '2024-06-04 13:31:26', - endTime: '2024-06-04 13:33:37', - userName: '鏈辨寮�', - status: '宸茬粨鏉�', - total: 4, - checked: 2 - } - } - } + // subtask: { + // type: Object, + // default: () => { + // return { + // guid: 'SMuheEkjswioSn7A', + // name: '涓鐢熸�佹暟瀛楁腐椤圭洰宸℃煡涓鐢熸�佹暟瀛楁腐椤圭洰宸℃煡', + // district: '閲戝北鍖�', + // planTime: '2024-06-04', + // startTime: '2024-06-04 13:31:26', + // endTime: '2024-06-04 13:33:37', + // userName: '鏈辨寮�', + // status: '宸茬粨鏉�', + // total: 4, + // checked: 2 + // } + // } + // } }, data() { return { - activities: [ - { - content: '浠诲姟鍒涘缓', - timestamp: '2024-06-04 08:00', - running: false - }, - { - content: '寮�濮嬪贰鏌�', - timestamp: '2024-06-04 09:00', - running: false - }, - { - content: '缁撴潫宸℃煡', - timestamp: '2024-06-04 09:15', - running: false - }, - { - content: '瀹屾垚闂瀹℃牳', - timestamp: '2024-06-04 10:15', - running: false - }, - { - content: '闂鏁存敼涓�...', - timestamp: '2024-06-04 10:15', - running: true - } - ] + // activities: [ + // { + // content: '浠诲姟鍒涘缓', + // timestamp: '2024-06-04 08:00', + // running: false + // }, + // { + // content: '寮�濮嬪贰鏌�', + // timestamp: '2024-06-04 09:00', + // running: false + // }, + // { + // content: '缁撴潫宸℃煡', + // timestamp: '2024-06-04 09:15', + // running: false + // }, + // { + // content: '瀹屾垚闂瀹℃牳', + // timestamp: '2024-06-04 10:15', + // running: false + // }, + // { + // content: '闂鏁存敼涓�...', + // timestamp: '2024-06-04 10:15', + // running: true + // } + // ] + problemList: [] + } + }, + computed: { + ...mapStores(useMapStore), + subtask() { + return this.mapStore.focusMarker ? this.mapStore.focusMarker.subtask : undefined + }, + scene() { + return this.mapStore.focusMarker ? this.mapStore.focusMarker.scene : undefined + }, + inspection() { + return this.mapStore.focusMarker ? this.mapStore.focusMarker.inspection : undefined + } + }, + watch: { + subtask(nV, oV) { + if (nV != undefined && nV != oV) { + this.fetchProblem(nV.stguid) + } + } + }, + methods: { + fetchProblem(stguid) { + problemApi.fetchProblems(stguid).then((res) => { + this.problemList = res + }) } } } @@ -92,4 +145,8 @@ right: 0; /* background-color: wheat; */ } + +.el-card { + --el-card-padding: 8px; +} </style> -- Gitblit v1.9.3