Commit 90cd407d870df6f9686c60035cf8510642e1e33a
1 parent
764f1fb4
perf: in create product profile form default select after create script
Showing
3 changed files
with
7 additions
and
4 deletions
@@ -25,6 +25,7 @@ | @@ -25,6 +25,7 @@ | ||
25 | import { useDrawer } from '/@/components/Drawer'; | 25 | import { useDrawer } from '/@/components/Drawer'; |
26 | import { useSyncConfirm } from '/@/hooks/component/useSyncConfirm'; | 26 | import { useSyncConfirm } from '/@/hooks/component/useSyncConfirm'; |
27 | import { getBoundingClientRect } from '/@/utils/domUtils'; | 27 | import { getBoundingClientRect } from '/@/utils/domUtils'; |
28 | + import configurationSrc from '/@/assets/icons/configuration.svg'; | ||
28 | 29 | ||
29 | const listColumn = ref(4); | 30 | const listColumn = ref(4); |
30 | 31 | ||
@@ -204,8 +205,9 @@ | @@ -204,8 +205,9 @@ | ||
204 | <Card hoverable> | 205 | <Card hoverable> |
205 | <template #cover> | 206 | <template #cover> |
206 | <img | 207 | <img |
208 | + class="w-48 h-48 flex justify-center items-center" | ||
207 | alt="example" | 209 | alt="example" |
208 | - src="https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png" | 210 | + :src="configurationSrc" |
209 | /> | 211 | /> |
210 | </template> | 212 | </template> |
211 | <template class="ant-card-actions" #actions> | 213 | <template class="ant-card-actions" #actions> |
@@ -42,7 +42,7 @@ | @@ -42,7 +42,7 @@ | ||
42 | import ConverScriptModal from '/@/views/scriptmanage/converscript/ConverScriptModal.vue'; | 42 | import ConverScriptModal from '/@/views/scriptmanage/converscript/ConverScriptModal.vue'; |
43 | 43 | ||
44 | const { createMessage } = useMessage(); | 44 | const { createMessage } = useMessage(); |
45 | - const selectScript = reactive({ | 45 | + const selectScript = reactive<Record<'script', Nullable<string>>>({ |
46 | script: null, | 46 | script: null, |
47 | }); | 47 | }); |
48 | const selectOptions: Ref<SelectTypes['options']> = ref([]); | 48 | const selectOptions: Ref<SelectTypes['options']> = ref([]); |
@@ -55,7 +55,7 @@ | @@ -55,7 +55,7 @@ | ||
55 | }; | 55 | }; |
56 | }); | 56 | }); |
57 | }); | 57 | }); |
58 | - const handleSuccess = async () => { | 58 | + const handleSuccess = async (val: { id: string }) => { |
59 | const res = await getScriptManageMeList(); | 59 | const res = await getScriptManageMeList(); |
60 | selectOptions.value = res.map((m) => { | 60 | selectOptions.value = res.map((m) => { |
61 | return { | 61 | return { |
@@ -63,6 +63,7 @@ | @@ -63,6 +63,7 @@ | ||
63 | value: m.id, | 63 | value: m.id, |
64 | }; | 64 | }; |
65 | }); | 65 | }); |
66 | + selectScript.script = val.id; | ||
66 | }; | 67 | }; |
67 | 68 | ||
68 | const [register] = useForm({ | 69 | const [register] = useForm({ |
@@ -101,7 +101,7 @@ | @@ -101,7 +101,7 @@ | ||
101 | converScriptRef.value?.setScriptOutputData(res?.output); | 101 | converScriptRef.value?.setScriptOutputData(res?.output); |
102 | } | 102 | } |
103 | } | 103 | } |
104 | - emits('success'); | 104 | + emits('success', res); |
105 | } finally { | 105 | } finally { |
106 | setModalProps({ confirmLoading: false }); | 106 | setModalProps({ confirmLoading: false }); |
107 | } | 107 | } |