优化产品管理表单字段类型定义,将部分字段设为可选
This commit is contained in:
@@ -44,9 +44,9 @@ import Editor from '/@/components/editor/index.vue';
|
|||||||
interface ProductFormData {
|
interface ProductFormData {
|
||||||
id: number; // 产品ID
|
id: number; // 产品ID
|
||||||
name: string; // 产品名称
|
name: string; // 产品名称
|
||||||
description: string; // 产品详情(富文本内容)
|
description?: string; // 产品详情(富文本内容)
|
||||||
creator: '';
|
creator?: string;
|
||||||
modifier: '';
|
modifier?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -126,7 +126,7 @@ const openDialog = async (row?: ProductFormData) => {
|
|||||||
const handleEditMode = async (row: ProductFormData) => {
|
const handleEditMode = async (row: ProductFormData) => {
|
||||||
try {
|
try {
|
||||||
state.formData.id = row.id;
|
state.formData.id = row.id;
|
||||||
state.formData.description = row.description;
|
state.formData.description = row.description ?? '';
|
||||||
state.formData.name = row.name;
|
state.formData.name = row.name;
|
||||||
|
|
||||||
console.log(row, '编辑');
|
console.log(row, '编辑');
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ interface ProductData {
|
|||||||
createdAt: string;
|
createdAt: string;
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
rag_doc_id?: string; // 添加缺失的属性
|
rag_doc_id?: string; // 添加缺失的属性
|
||||||
|
description?: string; // 产品详情
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user