From f19e5267cc23b1c714dc746239864f33ed715dd9 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 05 十二月 2025 17:55:02 +0800
Subject: [PATCH] 完成地图制作任务功能初版
---
src/views/fysp/task/components/CompSubTaskSelect.vue | 44 ++++++++++++++++++++++++++++++++++----------
1 files changed, 34 insertions(+), 10 deletions(-)
diff --git a/src/views/fysp/task/components/CompSubTaskSelect.vue b/src/views/fysp/task/components/CompSubTaskSelect.vue
index cfeb571..11a515e 100644
--- a/src/views/fysp/task/components/CompSubTaskSelect.vue
+++ b/src/views/fysp/task/components/CompSubTaskSelect.vue
@@ -17,7 +17,7 @@
collapse-tags
placeholder="閫夋嫨鎵ц浜�"
:max-collapse-tags="1"
- style="width: 240px"
+ style="width: 150px"
>
<template #header>
<el-checkbox
@@ -40,9 +40,13 @@
</FYForm>
</el-row>
<div>
- <el-scrollbar :height="scrollHeight" v-if="data.length > 0">
- <el-space wrap>
- <ItemMonitorObj v-for="obj in data" :key="obj.movid" :item="obj">
+ <el-scrollbar :height="height" v-if="modelValue.length > 0">
+ <el-space wrap :direction="direction">
+ <ItemMonitorObj
+ v-for="obj in modelValue"
+ :key="obj.movid"
+ :item="obj"
+ >
<template #default="{ item }">
<el-button
size="small"
@@ -79,21 +83,34 @@
const props = defineProps({
// 瀛愪换鍔¢泦鍚�
- data: {
+ modelValue: {
type: Array,
default: () => []
},
- height: String,
+ height: {
+ type: String,
+ default: '14vh'
+ },
+ direction: {
+ type: String,
+ default: 'horizontal'
+ },
// 鏃ヤ换鍔�
dayTask: Object
});
-const emit = defineEmits(['submit', 'delete']);
+const emit = defineEmits(['submit', 'delete', 'update:modelValue']);
-const scrollHeight = ref('14vh');
+const data = computed(() => props.modelValue);
// 绉婚櫎浠诲姟鍦烘櫙
function deleteScene(item) {
+ item.select = false;
+ const index = data.value.indexOf(item);
+ if (index > -1) {
+ data.value.splice(index, 1);
+ emit('update:modelValue', data.value);
+ }
emit('delete', item);
}
@@ -109,7 +126,7 @@
]
});
function submit(v, success, fail) {
- if (props.data.length == 0) {
+ if (props.modelValue.length == 0) {
fail('鏈�夋嫨鐩戠鍦烘櫙');
} else if (v.value.executor.length == 0) {
fail('鏈�夋嫨鎵ц浜�');
@@ -117,7 +134,13 @@
success();
// 灏嗕换鍔℃墽琛屼汉鏍煎紡鍖栧苟浼犻��
const param = TaskProxy.getExecutors(v.value.executor, executors.value);
- emit('submit', param);
+ TaskProxy.createSubtasks(props.dayTask, props.modelValue, param).then(
+ () => {
+ formInfo.value.executor = [];
+ emit('update:modelValue', []);
+ emit('submit');
+ }
+ );
}
}
@@ -161,6 +184,7 @@
});
executors.value = list;
+ formInfo.value.executor = [];
}
// watch(topTask, (nV, oV) => {
// if (nV != oV) {
--
Gitblit v1.9.3