From 5be9679fb4288936b576cf3d1f1548af1c4151b8 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期一, 21 七月 2025 15:31:21 +0800 Subject: [PATCH] 2025.7.21 任务管理-监管地图功能(待完成) --- src/views/fysp/task/components/CompSubTaskSelect.vue | 68 ++++++++++++++++++++------------- 1 files changed, 41 insertions(+), 27 deletions(-) diff --git a/src/views/fysp/task/components/CompSubTaskSelect.vue b/src/views/fysp/task/components/CompSubTaskSelect.vue index cdf66b9..738df23 100644 --- a/src/views/fysp/task/components/CompSubTaskSelect.vue +++ b/src/views/fysp/task/components/CompSubTaskSelect.vue @@ -70,15 +70,12 @@ /** * 宸℃煡瀛愪换鍔″垱寤� */ -import { ref, reactive, watch, computed, onMounted } from 'vue'; +import { ref, reactive, watch, computed, onMounted, inject } from 'vue'; import { ElMessageBox, ElNotification, ElMessage } from 'element-plus'; import taskApi from '@/api/fysp/taskApi'; +import TaskProxy from '../TaskProxy'; -onMounted(() => { - // if (props.height) { - // scrollHeight.value = - // } -}); +// const topTask = inject('topTask'); const props = defineProps({ // 瀛愪换鍔¢泦鍚� @@ -91,7 +88,7 @@ dayTask: Object }); -const emit = defineEmits(['delete']); +const emit = defineEmits(['submit', 'delete']); const scrollHeight = ref('14vh'); @@ -120,10 +117,17 @@ fail('鏈�夋嫨鐩戠鍦烘櫙'); } else { success(); + // 灏嗕换鍔℃墽琛屼汉鏍煎紡鍖栧苟浼犻�� + const param = TaskProxy.getExecutors(v.value.executor, executors.value); + emit('submit', param); } } /************************* 浠诲姟鎵ц浜轰笅鎷夐�夋 *******************************/ +// onMounted(() => { +// getExecutors(topTask.value); +// }); + const executors = ref([]); // 鏄惁鍏ㄩ�� const checkAll = ref(false); @@ -138,36 +142,46 @@ formInfo.value.executor = []; } } + +function getExecutors(t) { + const ids = t.executorguids.split('#'); + const userNames = t.executorusernames.split('#'); + const realNames = t.executorrealnames.split('#'); + const list = []; + ids.forEach((e, i) => { + if (i < userNames.length && i < realNames.length) { + list.push({ + label: realNames[i], + value: e, + data: { + id: e, + userName: userNames[i], + realName: realNames[i] + } + }); + } + }); + + executors.value = list; +} +// watch(topTask, (nV, oV) => { +// if (nV != oV) { +// getExecutors(nV); +// } +// }); + watch( () => props.dayTask, (nV, oV) => { if (nV != oV) { taskApi.fetchTaskById(nV.guid).then((res) => { - const ids = res.executorguids.split('#'); - const userNames = res.executorusernames.split('#'); - const realNames = res.executorrealnames.split('#'); - const list = []; - ids.forEach((e, i) => { - if (i < userNames.length && i < realNames.length) { - list.push({ - label: realNames[i], - value: e, - data: { - id: e, - userName: userNames[i], - realName: realNames[i] - } - }); - } - }); - - executors.value = list; + getExecutors(res); }); } }, { immediate: true } ); -// + watch( () => formInfo.value.executor, (val) => { -- Gitblit v1.9.3