diff --git a/src/api/codegen.ts b/src/api/codegen.ts index 8115b7fb..af2c1a57 100644 --- a/src/api/codegen.ts +++ b/src/api/codegen.ts @@ -31,11 +31,18 @@ const GeneratorAPI = { }, /** 获取代码生成预览数据 */ - getPreviewData(tableName: string, pageType?: "classic" | "curd") { + getPreviewData(tableName: string, pageType?: "classic" | "curd", type?: "ts" | "js") { + const params: Record = {}; + if (pageType) { + params.pageType = pageType; + } + if (type) { + params.type = type; + } return request({ url: `${GENERATOR_BASE_URL}/${tableName}/preview`, method: "get", - params: pageType ? { pageType } : undefined, + params: Object.keys(params).length ? params : undefined, }); }, @@ -52,11 +59,18 @@ const GeneratorAPI = { * @param url * @param fileName */ - download(tableName: string, pageType?: "classic" | "curd") { + download(tableName: string, pageType?: "classic" | "curd", type?: "ts" | "js") { + const params: Record = {}; + if (pageType) { + params.pageType = pageType; + } + if (type) { + params.type = type; + } return request({ url: `${GENERATOR_BASE_URL}/${tableName}/download`, method: "get", - params: pageType ? { pageType } : undefined, + params: Object.keys(params).length ? params : undefined, responseType: "blob", }).then((response) => { const contentDisposition = response?.headers?.["content-disposition"] as string | undefined; diff --git a/src/components/DictSelect/index.vue b/src/components/DictSelect/index.vue index 7349fb75..e5ddce09 100644 --- a/src/components/DictSelect/index.vue +++ b/src/components/DictSelect/index.vue @@ -1,4 +1,4 @@ -