Merge pull request '修复编辑模板bug' (#114) from 616036448/Admin.NET.Pro:main into main

Reviewed-on: http://101.43.53.74:3000/Admin.NET/Admin.NET.Pro/pulls/114
This commit is contained in:
zuohuaijun 2024-08-31 14:36:16 +08:00
commit 605dc6e1d5

View File

@ -181,8 +181,11 @@ import type { FormRules } from "element-plus";
} else {
@:import {
@if(Model.RemoteVerify){
@:exists@(RemoteField),
}
@:exists@(RemoteField),
}
@foreach (var column in Model.TableField.Where(x=>x.EffectType == "fk").ToList()){
@:get@(@column.FkEntityName)@(@column.PropertyName)Dropdown,
}
@:add@(@Model.ClassName),
@:update@(@Model.ClassName),
@:detail@(@Model.ClassName) } from "/@@/api/@(@Model.PagePath)/@(@Model.LowerClassName)";
@ -192,11 +195,6 @@ if(@Model.TableField.Any(x=>x.EffectType == "Upload")){
@:import { UploadRequestOptions } from "element-plus";
@:import { @string.Join(",",Model.TableField.Where(x=>x.EffectType == "Upload").Select(x=>"upload"+x.PropertyName).ToList()) } from '/@@/api/@(@Model.PagePath)/@(@Model.LowerClassName)';
}
foreach (var column in Model.QueryWhetherList){
if(@column.EffectType == "fk"){
@:import { get@(@column.FkEntityName)@(@column.PropertyName)Dropdown } from '/@@/api/@(@Model.PagePath)/@(@Model.LowerClassName)';
}
}
}
@if(@Model.TableField.Any(x=>x.EffectType == "ConstSelector")){
@:import { getConstType } from "/@@/utils/constHelper";
@ -371,6 +369,7 @@ const submit = async () => {
@foreach (var column in Model.TableField){
if(@column.EffectType == "fk" && @column.WhetherAddUpdate == "Y"){
@://下拉列表@(@column.ColumnComment)
@:const @LowerFirstLetter(@column.FkEntityName)@(@column.PropertyName)DropdownList = ref<any>([]);
@:const get@(@column.FkEntityName)@(@column.PropertyName)DropdownList = async () => {
@if (@Model.IsApiService) {
@ -410,6 +409,7 @@ else if(@column.EffectType == "ConstSelector"){
@foreach (var column in Model.TableField){
if(column.WhetherAddUpdate=="N") continue;
if(@column.EffectType == "Upload"){
@://上传@(@column.ColumnComment)
@:const upload@(@column.PropertyName)Handle = async (options: UploadRequestOptions) => {
@if (@Model.IsApiService) {
@:let res = await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)Upload@(@column.FkEntityName)PostForm(options);