优化代码生成

This commit is contained in:
不做码农
2023-05-31 18:55:48 +08:00
parent 3f66fc9e60
commit 538dde51a8
6 changed files with 122 additions and 101 deletions

View File

@@ -70,7 +70,8 @@ $end
{
var response = _${replaceDto.ModelTypeName}Service.GetFirst(x => x.${replaceDto.PKName} == ${replaceDto.PKName});
return SUCCESS(response);
var info = response.Adapt<${replaceDto.ModelTypeName}>();
return SUCCESS(info);
}
$if(replaceDto.ShowBtnAdd)

View File

@@ -1,6 +1,7 @@
using System;
using SqlSugar;
using Infrastructure.Attribute;
using Infrastructure.Extensions;
using ${options.BaseNamespace}Model;
using ${options.DtosNamespace};
using ${options.ModelsNamespace}.${options.SubNamespace};

View File

@@ -120,9 +120,7 @@ $if(column.HtmlType == "customInput" && column.IsPk == false)
$elseif(column.HtmlType == "imageUpload")
<el-table-column prop="${columnName}" label="${labelName}" align="center">
<template #default="scope">
<el-image preview-teleported :hide-on-click-modal="true" lazy class="table-td-thumb" fit="contain" :src="scope.row.${columnName}" :preview-src-list="[scope.row.${columnName}]">
<div><el-icon :size="15"><document /></el-icon></div>
</el-image>
<ImagePreview :src="scope.row.${columnName}"></ImagePreview>
</template>
</el-table-column>
$elseif(column.HtmlType == "checkbox" || column.HtmlType == "select" || column.HtmlType == "radio")

View File

@@ -179,18 +179,7 @@ $if(column.HtmlType == "customInput" && column.IsPk == false)
$elseif(column.HtmlType == "imageUpload")
<el-table-column prop="${columnName}" label="${labelName}" align="center" v-if="columns.showColumn('${columnName}')">
<template #default="scope">
<el-image
preview-teleported
:hide-on-click-modal="true"
lazy
class="table-td-thumb"
fit="contain"
:src="scope.row.${columnName}"
:preview-src-list="[scope.row.${columnName}]">
<div>
<el-icon :size="15"><document /></el-icon>
</div>
</el-image>
<ImagePreview :src="scope.row.${columnName}"></ImagePreview>
</template>
</el-table-column>
$elseif(column.HtmlType == "checkbox" || column.HtmlType.Contains("select") || column.HtmlType == "radio")