feat-wip(docs): 代码生成模板适配 Soybean 2.0

This commit is contained in:
xlsea
2025-10-28 15:32:47 +08:00
parent 2b3373a2bb
commit 355b5fe5e4
5 changed files with 98 additions and 74 deletions
+10 -4
View File
@@ -31,15 +31,21 @@ const model = defineModel<Api.$ModuleName.${BusinessName}SearchParams>('model',
const { options: ${dict.name}Options } = useDict('${dict.type}'#if($dict.immediate), false#end);
#end#end
async function reset() {
#foreach ($column in $columns)
const defaultModel = jsonClone(toRaw(model.value));
function resetModel() {
#foreach ($column in $columns)
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
dateRange${AttrName}.value = null;
#end
#end
Object.assign(model.value.params!, {});
Object.assign(model.value, defaultModel);
}
async function reset() {
await restoreValidation();
resetModel();
emit('reset');
}
@@ -61,7 +67,7 @@ async function search() {
<template>
<NCard :bordered="false" size="small" class="card-wrapper">
<NCollapse>
<NCollapseItem :title="$t('common.search')" name="user-search">
<NCollapseItem :title="$t('common.search')" name="$moduleName-${business__name}-search">
<NForm ref="formRef" :model="model" label-placement="left" :label-width="80">
<NGrid responsive="screen" item-responsive>
#foreach($column in $columns)