Showing
1 changed file
with
10 additions
and
0 deletions
@@ -10,6 +10,8 @@ | @@ -10,6 +10,8 @@ | ||
10 | import { onMounted } from 'vue'; | 10 | import { onMounted } from 'vue'; |
11 | import { getBoundingClientRect } from '/@/utils/domUtils'; | 11 | import { getBoundingClientRect } from '/@/utils/domUtils'; |
12 | import { TaskRecordType } from '/@/api/task/model'; | 12 | import { TaskRecordType } from '/@/api/task/model'; |
13 | + import { RunTaskModal } from '/@/views/task/center/components/RunTaskModal'; | ||
14 | + import { useModal } from '/@/components/Modal'; | ||
13 | 15 | ||
14 | const props = defineProps<{ | 16 | const props = defineProps<{ |
15 | tbDeviceId: string; | 17 | tbDeviceId: string; |
@@ -17,6 +19,8 @@ | @@ -17,6 +19,8 @@ | ||
17 | 19 | ||
18 | const listElRef = ref<Nullable<ComponentElRef>>(null); | 20 | const listElRef = ref<Nullable<ComponentElRef>>(null); |
19 | 21 | ||
22 | + const [registerRunTaskModal, { openModal }] = useModal(); | ||
23 | + | ||
20 | const [registerForm, { getFieldsValue }] = useForm({ | 24 | const [registerForm, { getFieldsValue }] = useForm({ |
21 | schemas: formSchemas, | 25 | schemas: formSchemas, |
22 | baseColProps: { span: 8 }, | 26 | baseColProps: { span: 8 }, |
@@ -87,6 +91,10 @@ | @@ -87,6 +91,10 @@ | ||
87 | (listContainerEl.style.overflowX = 'hidden'); | 91 | (listContainerEl.style.overflowX = 'hidden'); |
88 | }; | 92 | }; |
89 | 93 | ||
94 | + const handleRunTask = (record: TaskRecordType) => { | ||
95 | + openModal(true, record); | ||
96 | + }; | ||
97 | + | ||
90 | onMounted(() => { | 98 | onMounted(() => { |
91 | setListHeight(); | 99 | setListHeight(); |
92 | getDataSource(); | 100 | getDataSource(); |
@@ -127,10 +135,12 @@ | @@ -127,10 +135,12 @@ | ||
127 | :reload="reload" | 135 | :reload="reload" |
128 | :tbDeviceId="tbDeviceId" | 136 | :tbDeviceId="tbDeviceId" |
129 | :deviceTaskCardMode="true" | 137 | :deviceTaskCardMode="true" |
138 | + @runTask="handleRunTask" | ||
130 | /> | 139 | /> |
131 | </List.Item> | 140 | </List.Item> |
132 | </template> | 141 | </template> |
133 | </List> | 142 | </List> |
143 | + <RunTaskModal :reload="reload" @register="registerRunTaskModal" /> | ||
134 | </section> | 144 | </section> |
135 | </PageWrapper> | 145 | </PageWrapper> |
136 | </template> | 146 | </template> |