This commit is contained in:
ChenYi 2025-10-23 14:31:42 +08:00
parent 2874160e45
commit 68ff5db53f
2 changed files with 6 additions and 8 deletions

View File

@ -100,7 +100,6 @@ const editRow: Record<string, any> = ref({});
// //
const hasData = ref(true); const hasData = ref(true);
const [ThingModelModal, thingModelModalApi] = useVbenModal({ const [ThingModelModal, thingModelModalApi] = useVbenModal({
draggable: true, draggable: true,
footer: true, footer: true,
@ -278,7 +277,7 @@ const openCopyAnotherThingModelModal = async () => {
console.log('打开复制模态框当前props:', { console.log('打开复制模态框当前props:', {
productId: props.productId, productId: props.productId,
productName: props.productName, productName: props.productName,
ioTPlatform: props.ioTPlatform ioTPlatform: props.ioTPlatform,
}); });
copyModalApi.open(); copyModalApi.open();
}; };
@ -289,14 +288,14 @@ async function submitCopy() {
if (!valid) return; if (!valid) return;
const formValues = await copyFormApi.getValues(); const formValues = await copyFormApi.getValues();
console.log('复制提交参数:', { console.log('复制提交参数:', {
formValues, formValues,
props: { props: {
productId: props.productId, productId: props.productId,
productName: props.productName, productName: props.productName,
ioTPlatform: props.ioTPlatform ioTPlatform: props.ioTPlatform,
} },
}); });
try { try {
@ -365,7 +364,6 @@ function closeModal() {
emit('update:visible', false); emit('update:visible', false);
emit('close'); emit('close');
} }
</script> </script>
<template> <template>
@ -437,7 +435,7 @@ function closeModal() {
<ThingModelModal :title="editRow.id ? $t('common.edit') : $t('common.add')" class="w-[800px]"> <ThingModelModal :title="editRow.id ? $t('common.edit') : $t('common.add')" class="w-[800px]">
<component :is="editRow.id ? EditForm : AddForm" /> <component :is="editRow.id ? EditForm : AddForm" />
</ThingModelModal> </ThingModelModal>
<!-- 复制已有模型模态框 --> <!-- 复制已有模型模态框 -->
<CopyModal title="复制已有模型" class="w-[600px]"> <CopyModal title="复制已有模型" class="w-[600px]">
<CopyForm /> <CopyForm />

View File

@ -354,7 +354,7 @@ export const editThingModelFormSchema = computed(() => [
return items.map((item: any) => ({ return items.map((item: any) => ({
...item, ...item,
// 使用secondValue的小写版本作为value保持label为原始value // 使用secondValue的小写版本作为value保持label为原始value
value: item.secondValue || item.value?.toLowerCase(), value: item.secondValue || item.value,
label: item.value, // 显示文本 label: item.value, // 显示文本
})); }));
}, },