Compare commits
No commits in common. "68ff5db53f6106e69f13a3a9e1cf4c4a04ca8a37" and "5fe1af6a75a87115aa827daef51796b389b9ef94" have entirely different histories.
68ff5db53f
...
5fe1af6a75
@ -8890,11 +8890,6 @@ export const UpdateDetailInputSchema = {
|
||||
order: {
|
||||
type: 'integer',
|
||||
format: 'int32'
|
||||
},
|
||||
extendedAttribute: {
|
||||
type: 'string',
|
||||
description: '扩展属性',
|
||||
nullable: true
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
|
||||
@ -4574,10 +4574,6 @@ export type UpdateDetailInput = {
|
||||
displayText?: (string) | null;
|
||||
description?: (string) | null;
|
||||
order?: number;
|
||||
/**
|
||||
* 扩展属性
|
||||
*/
|
||||
extendedAttribute?: (string) | null;
|
||||
};
|
||||
|
||||
export type UpdateFeatureDto = {
|
||||
|
||||
@ -100,6 +100,7 @@ const editRow: Record<string, any> = ref({});
|
||||
// 跟踪数据状态,用于控制按钮显示
|
||||
const hasData = ref(true);
|
||||
|
||||
|
||||
const [ThingModelModal, thingModelModalApi] = useVbenModal({
|
||||
draggable: true,
|
||||
footer: true,
|
||||
@ -277,7 +278,7 @@ const openCopyAnotherThingModelModal = async () => {
|
||||
console.log('打开复制模态框,当前props:', {
|
||||
productId: props.productId,
|
||||
productName: props.productName,
|
||||
ioTPlatform: props.ioTPlatform,
|
||||
ioTPlatform: props.ioTPlatform
|
||||
});
|
||||
copyModalApi.open();
|
||||
};
|
||||
@ -288,14 +289,14 @@ async function submitCopy() {
|
||||
if (!valid) return;
|
||||
|
||||
const formValues = await copyFormApi.getValues();
|
||||
|
||||
|
||||
console.log('复制提交参数:', {
|
||||
formValues,
|
||||
props: {
|
||||
productId: props.productId,
|
||||
productName: props.productName,
|
||||
ioTPlatform: props.ioTPlatform,
|
||||
},
|
||||
ioTPlatform: props.ioTPlatform
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
@ -364,6 +365,7 @@ function closeModal() {
|
||||
emit('update:visible', false);
|
||||
emit('close');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -435,7 +437,7 @@ function closeModal() {
|
||||
<ThingModelModal :title="editRow.id ? $t('common.edit') : $t('common.add')" class="w-[800px]">
|
||||
<component :is="editRow.id ? EditForm : AddForm" />
|
||||
</ThingModelModal>
|
||||
|
||||
|
||||
<!-- 复制已有模型模态框 -->
|
||||
<CopyModal title="复制已有模型" class="w-[600px]">
|
||||
<CopyForm />
|
||||
|
||||
@ -354,7 +354,7 @@ export const editThingModelFormSchema = computed(() => [
|
||||
return items.map((item: any) => ({
|
||||
...item,
|
||||
// 使用secondValue的小写版本作为value,保持label为原始value
|
||||
value: item.secondValue || item.value,
|
||||
value: item.secondValue?.toLowerCase() || item.value?.toLowerCase(),
|
||||
label: item.value, // 显示文本
|
||||
}));
|
||||
},
|
||||
|
||||
@ -5,7 +5,6 @@ import { useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import {
|
||||
getCommonGetSelectList,
|
||||
postDataDictionaryCreateDetail,
|
||||
postDataDictionaryUpdateDetail,
|
||||
} from '#/api-client/index';
|
||||
@ -70,38 +69,9 @@ const [Form, formApi] = useVbenForm({
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
component: 'ApiSelect',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
api: getCommonGetSelectList,
|
||||
params: {
|
||||
query: {
|
||||
typeName: 'StandardThingModelDataTypeEnum',
|
||||
},
|
||||
},
|
||||
labelField: 'value',
|
||||
valueField: 'secondValue',
|
||||
optionsPropName: 'options',
|
||||
immediate: true,
|
||||
allowClear: true,
|
||||
placeholder:
|
||||
$t('common.pleaseSelect') +
|
||||
$t('abp.dataDictionary.extendedAttribute'),
|
||||
afterFetch: (res: any) => {
|
||||
// 确保返回的是数组格式
|
||||
if (Array.isArray(res)) {
|
||||
return res;
|
||||
}
|
||||
// 如果是包装在 items 中的,提取出来
|
||||
if (res && Array.isArray(res.items)) {
|
||||
return res.items;
|
||||
}
|
||||
// 如果是包装在 data 中的,提取出来
|
||||
if (res && Array.isArray(res.data)) {
|
||||
return res.data;
|
||||
}
|
||||
// 如果都不是,返回空数组
|
||||
return [];
|
||||
},
|
||||
placeholder: $t('common.pleaseInput'),
|
||||
},
|
||||
fieldName: 'extendedAttribute',
|
||||
label: $t('abp.dataDictionary.extendedAttribute'),
|
||||
@ -140,15 +110,15 @@ const [Modal, modalApi] = useVbenModal({
|
||||
const values = await formApi.getValues();
|
||||
await (data.value.isEdit
|
||||
? postDataDictionaryUpdateDetail({
|
||||
body: {
|
||||
...values,
|
||||
id: data.value.row.id,
|
||||
dataDictionaryId: data.value.id,
|
||||
},
|
||||
})
|
||||
body: {
|
||||
...values,
|
||||
id: data.value.row.id,
|
||||
dataDictionaryId: data.value.id,
|
||||
},
|
||||
})
|
||||
: postDataDictionaryCreateDetail({
|
||||
body: { ...values, id: data.value.id },
|
||||
}));
|
||||
body: { ...values, id: data.value.id },
|
||||
}));
|
||||
emit('reload');
|
||||
modalApi.close();
|
||||
} finally {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user