Skip to content

Commit a680e00

Browse files
Merge pull request #133 from SeasonsChange422/ui-dev_1.0
[bugfix] “槽”表单bug修复
2 parents f894427 + d4ed475 commit a680e00

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

mosaic-ui/src/components/hotSwap/CreateHotSwapInfoDialog.vue

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ const handleSave = () => {
6868
createPoint(createPointForm.value).then((res: any) => {
6969
if (res.code == 200) {
7070
emit('updateCode', res.data.code)
71+
slotStore.getSlots()
7172
statusStore.setLoading(false)
7273
} else {
7374
statusStore.setLoading(false)
@@ -104,13 +105,12 @@ const isJavaIdentifierValid = (name: String) => {
104105
105106
return !javaKeywords.has(name);
106107
}
107-
const handleSlotChange = (newSlot) => {
108-
// createPointForm.value = {
109-
// ...createPointForm.value,
110-
// ...newSlot
111-
// }
112-
console.log(newSlot)
113-
createPointForm.value.slotId = newSlot.slotId
108+
const handleSlotChange = (value) => {
109+
if (typeof value === 'string') {
110+
createPointForm.value.slotId = value
111+
} else if(typeof value === 'object'){
112+
createPointForm.value.slotId = value.slotId
113+
}
114114
}
115115
const handleSubmit = async () => {
116116
const {valid} = await form.value.validate();
@@ -167,9 +167,6 @@ const rules = [
167167
return t('slot.rule.empty')
168168
},
169169
]
170-
const customFilter = (item, queryText) => {
171-
return item.raw.slotId.toLowerCase().includes(queryText.toLowerCase())
172-
}
173170
</script>
174171
<template>
175172
<v-dialog class="hotSwap" v-model="dialog" max-width="480">
@@ -197,6 +194,7 @@ const customFilter = (item, queryText) => {
197194
item-value="slotId"
198195
item-title="slotId"
199196
aria-autocomplete="none"
197+
@update:modelValue="handleSlotChange"
200198
>
201199
</v-combobox>
202200
</v-list-item-subtitle>

0 commit comments

Comments
 (0)