修复模版生成model.ts默认值不带引号

This commit is contained in:
lzl
2025-08-18 14:35:59 +08:00
parent 9f1c1ce031
commit ae540c6bfe
2 changed files with 23 additions and 6 deletions

View File

@@ -2,9 +2,16 @@
@{.const}
export class State {@{range .stateItems}
public @{.Name} = @{.DefaultValue}; // @{.Dc}@{end}
export class State {
@{range .stateItems}
public @{.Name} = @{if and .DataType (or
(eq .DataType "varchar")
(eq .DataType "char")
(eq .DataType "text")
(eq .DataType "json")
(eq .DataType "date")
(eq .DataType "datetime")
)}'@{.DefaultValue}'@{else}@{.DefaultValue}@{end};//@{.Dc}@{end}
constructor(state?: Partial<State>) {
if (state) {
Object.assign(this, state);