feat-wip(docs): 代码生成模板适配 Soybean 2.0
This commit is contained in:
Vendored
+10
-4
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user