From f19e5267cc23b1c714dc746239864f33ed715dd9 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 05 十二月 2025 17:55:02 +0800
Subject: [PATCH] 完成地图制作任务功能初版
---
src/components/list-item/ItemSubTask.vue | 155 ++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 128 insertions(+), 27 deletions(-)
diff --git a/src/components/list-item/ItemSubTask.vue b/src/components/list-item/ItemSubTask.vue
index 210bebc..42cc041 100644
--- a/src/components/list-item/ItemSubTask.vue
+++ b/src/components/list-item/ItemSubTask.vue
@@ -1,36 +1,71 @@
<template>
<div class="wrapper">
- <div class="text-title">
- {{ item.name }}
- </div>
- <div class="text-info">
- <div class="text-label">
- <el-icon class="m-r-4" size="16"><LocationInformation /></el-icon>
- <span>浠诲姟鍦板潃锛�</span>
- </div>
- {{ item.scenseaddress }}
- </div>
- <div class="text-info">
- <div class="text-label">
- <!-- <el-icon><Clock /></el-icon> -->
- <el-icon class="m-r-4" size="16"><AlarmClock /></el-icon>
- <span>浠诲姟鏃堕棿锛�</span>
- </div>
- {{ $fm.formatYMD(item.planstarttime) }}
- </div>
- <div class="text-info">
- <div class="text-label">
- <el-icon class="m-r-4" size="16"><User /></el-icon>
- 浠诲姟浜哄憳锛�
- </div>
- {{ item.executorrealtimes }}
- </div>
- <el-row justify="end" style="margin-top: 4px">
- <slot :item="item"></slot>
+ <el-row justify="space-between" class="m-t-4">
+ <el-col :span="24">
+ <div class="text-title">
+ <el-tag
+ size="small"
+ :type="statusType.type"
+ effect="plain"
+ class="m-r-4 m-b-4"
+ >
+ <el-space :size="4">
+ <el-icon size="16">
+ <component :is="statusType.icon"></component>
+ </el-icon>
+ {{ item.status }}
+ </el-space>
+ </el-tag>
+ {{ item.name }}
+ </div>
+ <div class="text-info">
+ <div class="text-label">
+ <el-icon class="m-r-4" size="16"><LocationInformation /></el-icon>
+ <span>鍦板潃锛�</span>
+ </div>
+ {{ item.scenseaddress }}
+ </div>
+ <div class="text-info">
+ <div class="text-label">
+ <!-- <el-icon><Clock /></el-icon> -->
+ <el-icon class="m-r-4" size="16"><AlarmClock /></el-icon>
+ <span>鏃堕棿锛�</span>
+ </div>
+ {{ $fm.formatYMDHM(item.executionstarttime) }}鑷硔{
+ $fm.formatYMDHM(item.executionendtime)
+ }}
+ </div>
+ <div class="text-info">
+ <div class="text-label">
+ <el-icon class="m-r-4" size="16"><User /></el-icon>
+ 浜哄憳锛�
+ </div>
+ {{ item.executorrealtimes }}
+ </div>
+ <el-row justify="space-between">
+ <el-space class="m-t-4">
+ <el-tag size="small" type="info" effect=""
+ >闂锛歿{ status.proNum }}</el-tag
+ >
+ <el-tag size="small" type="info" effect=""
+ >鏁存敼锛歿{ status.changeNum }}</el-tag
+ >
+ <el-tag size="small" :type="changePerType" effect=""
+ >鏁存敼鐜囷細{{ status.changePer }}</el-tag
+ >
+ </el-space>
+ <slot :item="item"></slot>
+ </el-row>
+ </el-col>
+ <!-- <el-col :span="4"> </el-col> -->
</el-row>
</div>
</template>
<script setup>
+import { ref, watch, computed } from 'vue';
+import problemApi from '@/api/fysp/problemApi';
+import ProCheckProxy from '@/views/fysp/check/ProCheckProxy';
+
/**
* 鐩戠瀵硅薄
*/
@@ -40,6 +75,72 @@
default: () => {}
}
});
+
+const loading = ref(false);
+const proList = ref([]);
+const status = ref({});
+
+const statusType = computed(() => {
+ switch (props.item.status) {
+ case '鏈墽琛�':
+ return {
+ type: 'danger',
+ icon: 'WarningFilled'
+ };
+ case '姝e湪鎵ц':
+ return {
+ type: 'success',
+ icon: 'Timer'
+ };
+ case '宸茬粨鏉�':
+ return {
+ type: 'info',
+ icon: 'SuccessFilled'
+ };
+ default:
+ return {
+ type: 'danger',
+ icon: 'Warning'
+ };
+ }
+});
+
+const changePerType = computed(() => {
+ if (status.value.changeNum == 0) {
+ if (status.value.proNum == 0) {
+ return 'success';
+ } else {
+ return 'danger';
+ }
+ } else if (status.value.proNum == status.value.changeNum) {
+ return 'success';
+ } else {
+ return 'warning';
+ }
+});
+
+watch(
+ () => props.item,
+ (nV, oV) => {
+ if (nV != oV) {
+ fetchProblems(nV);
+ }
+ },
+ { immediate: true }
+);
+
+function fetchProblems(subtask) {
+ loading.value = true;
+ problemApi
+ .getProBySubtask(subtask.stguid)
+ .then((res) => {
+ proList.value = res;
+ status.value = ProCheckProxy.calProStatus(res);
+ })
+ .finally(() => {
+ loading.value = false;
+ });
+}
</script>
<style scoped>
.wrapper {
--
Gitblit v1.9.3