mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-28 00:51:13 +08:00
发布v2.15.7版本,更新内容请查看:https://github.com/bufanyun/hotgo/tree/v2.0/docs/guide-zh-CN/addon-version-upgrade.md
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
@{.import}
|
||||
|
||||
@{.const}
|
||||
|
||||
export class State {@{range .stateItems}
|
||||
public @{.Name} = @{.DefaultValue}; // @{.Dc}@{end}
|
||||
|
||||
@@ -30,25 +32,9 @@ export function newState(state: State | Record<string, any> | null): State {
|
||||
@{.columns}
|
||||
|
||||
@{ if eq .dictOptions.Has true }
|
||||
// 字典数据选项
|
||||
export const options = ref({
|
||||
@{range .options.DictOps.Types} @{.}: [] as Option[],
|
||||
@{end}});
|
||||
|
||||
// 加载字典数据选项
|
||||
export function loadOptions() {
|
||||
Dicts({
|
||||
types: @{ToTSArray .options.DictOps.Types},
|
||||
}).then((res) => {
|
||||
options.value = res;
|
||||
for (const item of schemas.value) {
|
||||
switch (item.field) {@{range .options.DictOps.Schemas}
|
||||
case '@{.Field}':
|
||||
item.componentProps.options = options.value.@{.Type};
|
||||
break;@{end}
|
||||
}
|
||||
}
|
||||
});
|
||||
dict.loadOptions(@{ToTSArray .options.DictOps.Types});
|
||||
}
|
||||
@{end}
|
||||
|
||||
|
Reference in New Issue
Block a user