Compare commits

...

2 Commits

Author SHA1 Message Date
ChenYi
68ff5db53f 修复 2025-10-23 14:31:42 +08:00
ChenYi
2874160e45 完善数据字典 2025-10-23 14:31:32 +08:00
5 changed files with 55 additions and 18 deletions

View File

@ -8890,6 +8890,11 @@ export const UpdateDetailInputSchema = {
order: { order: {
type: 'integer', type: 'integer',
format: 'int32' format: 'int32'
},
extendedAttribute: {
type: 'string',
description: '扩展属性',
nullable: true
} }
}, },
additionalProperties: false additionalProperties: false

View File

@ -4574,6 +4574,10 @@ export type UpdateDetailInput = {
displayText?: (string) | null; displayText?: (string) | null;
description?: (string) | null; description?: (string) | null;
order?: number; order?: number;
/**
*
*/
extendedAttribute?: (string) | null;
}; };
export type UpdateFeatureDto = { export type UpdateFeatureDto = {

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?.toLowerCase() || item.value?.toLowerCase(), value: item.secondValue || item.value,
label: item.value, // 显示文本 label: item.value, // 显示文本
})); }));
}, },

View File

@ -5,6 +5,7 @@ import { useVbenModal } from '@vben/common-ui';
import { useVbenForm } from '#/adapter/form'; import { useVbenForm } from '#/adapter/form';
import { import {
getCommonGetSelectList,
postDataDictionaryCreateDetail, postDataDictionaryCreateDetail,
postDataDictionaryUpdateDetail, postDataDictionaryUpdateDetail,
} from '#/api-client/index'; } from '#/api-client/index';
@ -69,9 +70,38 @@ const [Form, formApi] = useVbenForm({
rules: 'required', rules: 'required',
}, },
{ {
component: 'Input', component: 'ApiSelect',
componentProps: { componentProps: {
placeholder: $t('common.pleaseInput'), 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 [];
},
}, },
fieldName: 'extendedAttribute', fieldName: 'extendedAttribute',
label: $t('abp.dataDictionary.extendedAttribute'), label: $t('abp.dataDictionary.extendedAttribute'),
@ -110,15 +140,15 @@ const [Modal, modalApi] = useVbenModal({
const values = await formApi.getValues(); const values = await formApi.getValues();
await (data.value.isEdit await (data.value.isEdit
? postDataDictionaryUpdateDetail({ ? postDataDictionaryUpdateDetail({
body: { body: {
...values, ...values,
id: data.value.row.id, id: data.value.row.id,
dataDictionaryId: data.value.id, dataDictionaryId: data.value.id,
}, },
}) })
: postDataDictionaryCreateDetail({ : postDataDictionaryCreateDetail({
body: { ...values, id: data.value.id }, body: { ...values, id: data.value.id },
})); }));
emit('reload'); emit('reload');
modalApi.close(); modalApi.close();
} finally { } finally {