Merge branch 'net5.0'

This commit is contained in:
不做码农
2022-05-09 12:28:54 +08:00
32 changed files with 854 additions and 226 deletions

View File

@@ -0,0 +1,233 @@
using Infrastructure;
using Infrastructure.Attribute;
using Infrastructure.Enums;
using Infrastructure.Model;
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using ZR.Admin.WebApi.Extensions;
using ZR.Admin.WebApi.Filters;
using ZR.Common;
using ZR.Model;
using ZR.Model.Dto;
using ZR.Model.Models;
using ZR.Service.System.ISystemService;
namespace ZR.Admin.WebApi.Controllers
{
/// <summary>
/// 多语言配置Controller
///
/// @author zr
/// @date 2022-05-06
/// </summary>
[Verify]
[Route("system/CommonLang")]
public class CommonLangController : BaseController
{
/// <summary>
/// 多语言配置接口
/// </summary>
private readonly ICommonLangService _CommonLangService;
public CommonLangController(ICommonLangService CommonLangService)
{
_CommonLangService = CommonLangService;
}
/// <summary>
/// 查询多语言配置列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "system:lang:list")]
public IActionResult QueryCommonLang([FromQuery] CommonLangQueryDto parm)
{
if (parm.ShowMode == 2)
{
PagedInfo<dynamic> pagedInfo = new();
pagedInfo.Result = _CommonLangService.GetListToPivot(parm);
return SUCCESS(pagedInfo);
}
return SUCCESS(_CommonLangService.GetList(parm));
}
/// <summary>
/// 查询多语言配置列表
/// </summary>
/// <returns></returns>
[HttpGet("list/{lang}")]
[AllowAnonymous]
public IActionResult QueryCommonLangs()
{
var msgList = _CommonLangService.GetLangList(new CommonLangQueryDto() { LangCode = "zh-cn" });
var msgListEn = _CommonLangService.GetLangList(new CommonLangQueryDto() { LangCode = "en" });
var msgListTw = _CommonLangService.GetLangList(new CommonLangQueryDto() { LangCode = "zh-tw" });
Dictionary<string, object> dic = new();
Dictionary<string, object> dicEn = new();
Dictionary<string, object> dicTw = new();
SetLang(msgList, dic);
SetLang(msgListEn, dicEn);
SetLang(msgListTw, dicTw);
return SUCCESS(new
{
en = dicEn,
cn = dic,
tw = dicTw
});
}
private static void SetLang(List<CommonLang> msgList, Dictionary<string, object> dic)
{
foreach (var item in msgList)
{
if (!dic.ContainsKey(item.LangKey))
{
dic.Add(item.LangKey, item.LangName);
}
}
}
/// <summary>
/// 查询多语言配置详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "system:lang:query")]
public IActionResult GetCommonLang(long Id)
{
var response = _CommonLangService.GetFirst(x => x.Id == Id);
var modal = response.Adapt<CommonLangDto>();
if (modal != null)
{
var list = _CommonLangService.GetList(f => f.LangKey == modal.LangKey);
modal.LangName = list.Find(f => f.LangCode == "zh-cn")?.LangName;
modal.LangNameEn = list.Find(f => f.LangCode == "en")?.LangName;
modal.LangNameTw = list.Find(f => f.LangCode == "zh-tw")?.LangName;
}
return SUCCESS(modal);
}
/// <summary>
/// 查询多语言配置详情
/// </summary>
/// <param name="langKey"></param>
/// <returns></returns>
[HttpGet("key/{langKey}")]
[ActionPermissionFilter(Permission = "system:lang:query")]
public IActionResult GetCommonLangByKey(string langKey)
{
var response = _CommonLangService.GetList(x => x.LangKey == langKey);
return SUCCESS(response);
}
/// <summary>
/// 添加多语言配置
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "system:lang:add")]
[Log(Title = "多语言配置", BusinessType = BusinessType.INSERT)]
public IActionResult AddCommonLang([FromBody] CommonLangDto parm)
{
if (parm == null)
{
throw new CustomException("请求参数错误");
}
//从 Dto 映射到 实体
var modal = parm.Adapt<CommonLang>().ToCreate(HttpContext);
var list = _CommonLangService.GetList(f => f.LangKey == modal.LangKey);
modal.Addtime = DateTime.Now;
modal.LangCode = "zh-cn";
modal.LangName = parm.LangName;
if (!list.Any(f => f.LangCode == modal.LangCode))
{
_CommonLangService.InsertReturnSnowflakeId(modal);
}
modal.LangCode = "zh-tw";
modal.LangName = parm.LangNameTw;
if (!list.Any(f => f.LangCode == modal.LangCode))
{
_CommonLangService.InsertReturnSnowflakeId(modal);
}
modal.LangCode = "en";
modal.LangName = parm.LangNameEn;
if (!list.Any(f => f.LangCode == modal.LangCode))
{
_CommonLangService.InsertReturnSnowflakeId(modal);
}
return ToResponse(1);
}
/// <summary>
/// 更新多语言配置
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "system:lang:edit")]
[Log(Title = "多语言配置", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateCommonLang([FromBody] CommonLangDto parm)
{
if (parm == null)
{
throw new CustomException("请求实体不能为空");
}
//从 Dto 映射到 实体
var modal = parm.Adapt<CommonLang>().ToUpdate(HttpContext);
var list = _CommonLangService.GetList(f => f.LangKey == modal.LangKey);
List<CommonLang> langs = new();
langs.Add(new CommonLang() { Addtime = DateTime.Now, LangCode = "zh-cn", LangKey = modal.LangKey, LangName = parm.LangName });
langs.Add(new CommonLang() { Addtime = DateTime.Now, LangCode = "zh-tw", LangKey = modal.LangKey, LangName = parm.LangNameTw });
langs.Add(new CommonLang() { Addtime = DateTime.Now, LangCode = "en", LangKey = modal.LangKey, LangName = parm.LangNameEn });
var storage = _CommonLangService.Storageable(langs).WhereColumns(it => new { it.LangKey, it.LangCode }).ToStorage();
long r = storage.AsInsertable.ExecuteReturnSnowflakeId();//执行插入
storage.AsUpdateable.UpdateColumns(it => new { it.LangName }).ExecuteCommand();//执行修改
return ToResponse(r);
}
/// <summary>
/// 删除多语言配置
/// </summary>
/// <returns></returns>
[HttpDelete("{ids}")]
[ActionPermissionFilter(Permission = "system:lang:delete")]
[Log(Title = "多语言配置", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteCommonLang(string ids)
{
long[] idsArr = Tools.SpitLongArrary(ids);
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _CommonLangService.Delete(idsArr);
return ToResponse(response);
}
/// <summary>
/// 导出多语言配置
/// </summary>
/// <returns></returns>
[Log(Title = "多语言配置", BusinessType = BusinessType.EXPORT, IsSaveResponseData = false)]
[HttpGet("export")]
[ActionPermissionFilter(Permission = "system:lang:export")]
public IActionResult Export([FromQuery] CommonLangQueryDto parm)
{
parm.PageSize = 10000;
var list = _CommonLangService.GetList(parm).Result;
string sFileName = ExportExcel(list, "CommonLang", "多语言配置");
return SUCCESS(new { path = "/export/" + sFileName, fileName = sFileName });
}
}
}

View File

@@ -12,13 +12,13 @@
},
"conn_zrAdmin_type": 1, //MySql = 0, SqlServer = 1
"conn_bus_type": 1,
"urls": "http://localhost:8888", //<2F><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>url
"urls": "http://localhost:8888", //<2F><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>url<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><EFBFBD>˿<EFBFBD>ǰ<EFBFBD>˶<EFBFBD>ӦdevServerҲ<EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>
"corsUrls": "http://localhost:8887", //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF>ǰ<EFBFBD><C7B0><EFBFBD>˷<EFBFBD><CBB7><EFBFBD><EBB5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>","<22><><EFBFBD><EFBFBD>
"JwtSettings": {
"Issuer": "ZRAdmin.NET",
"Audience": "ZRAdmin.NET",
"SecretKey": "SecretKey-ZRADMIN.NET-20210101",
"Expire": 30
"Expire": 30//jwt<77><74>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>֣<EFBFBD>
},
"DemoMode": false, //<2F>Ƿ<EFBFBD><C7B7><EFBFBD>ʾģʽ
"DbKey": "", //<2F><><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD><EFBFBD>key

View File

@@ -1,26 +1,22 @@
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Infrastructure;
using Infrastructure;
using Infrastructure.Attribute;
using Infrastructure.Enums;
using Infrastructure.Model;
using Mapster;
using Microsoft.AspNetCore.Mvc;
using ${options.ModelsNamespace}.Dto;
using ${options.ModelsNamespace}.Models;
using ${options.IServicsNamespace}.${options.SubNamespace}.I${options.SubNamespace}Service;
using ${options.ApiControllerNamespace}.Extensions;
using ${options.ApiControllerNamespace}.Filters;
using ZR.Common;
using Infrastructure.Extensions;
using System.Linq;
using ${options.BaseNamespace}.Common;
namespace ${options.ApiControllerNamespace}.Controllers
{
/// <summary>
/// ${genTable.functionName}Controller
///
///
/// @tableName ${genTable.TableName}
/// @author ${replaceDto.Author}
/// @date ${replaceDto.AddTime}
/// </summary>
@@ -97,14 +93,8 @@ $if(replaceDto.ShowBtnAdd)
//从 Dto 映射到 实体
var modal = parm.Adapt<${replaceDto.ModelTypeName}>().ToCreate(HttpContext);
var response = _${replaceDto.ModelTypeName}Service.Insert(modal, it => new
{
$foreach(item in genTable.Columns)
$if((item.IsInsert))
it.$item.CsharpField,
$end
${end}
});
var response = _${replaceDto.ModelTypeName}Service.Add${replaceDto.ModelTypeName}(modal);
return ToResponse(response);
}
$end

View File

@@ -19,5 +19,6 @@ namespace ${options.IServicsNamespace}.${options.SubNamespace}.I${options.SubNam
$if(genTable.TplCategory == "tree")
List<${replaceDto.ModelTypeName}> GetTreeList(${replaceDto.ModelTypeName}QueryDto parm);
$end
int Add${replaceDto.ModelTypeName}(${replaceDto.ModelTypeName} parm);
}
}

View File

@@ -23,7 +23,7 @@ $if(replaceDto.ShowBtnExport)
[EpplusTableColumn(Header = "$if(item.ColumnComment == "")${item.CsharpField}${else}${item.ColumnComment}${end}"$if(item.CsharpType == "DateTime"), NumberFormat = "yyyy-MM-dd HH:mm:ss"$end)]
$end
$if(item.IsPk || item.IsIncrement)
[SqlSugar.SugarColumn(IsPrimaryKey = ${item.IsPk.ToString().ToLower()}, IsIdentity = ${item.IsIncrement.ToString().ToLower()}$if(item.CsharpField.ToLower() != item.ColumnName.ToLower()), ColumnName = "$item.ColumnName"$end)]
[SugarColumn(IsPrimaryKey = ${item.IsPk.ToString().ToLower()}, IsIdentity = ${item.IsIncrement.ToString().ToLower()}$if(item.CsharpField.ToLower() != item.ColumnName.ToLower()), ColumnName = "$item.ColumnName"$end)]
$elseif(item.CsharpField.ToLower() != item.ColumnName.ToLower())
[SugarColumn(ColumnName = "$item.ColumnName")]
$end
@@ -35,5 +35,15 @@ $if(genTable.TplCategory == "tree")
[SugarColumn(IsIgnore = true)]
public List<${replaceDto.ModelTypeName}> Children { get; set; }
$end
$if(genTable.TplCategory == "subNav" && genTable.SubTable != null)
[Navigate(NavigateType.Dynamic, null)] //自定义关系映射
public ${genTable.SubTable.ClassName} Sub { get; set; }
$end
$if(genTable.TplCategory == "subNavMore" && genTable.SubTable != null)
[Navigate(NavigateType.Dynamic, null)] //自定义关系映射
public List<${genTable.SubTable.ClassName}> Sub { get; set; }
$end
}
}

View File

@@ -1,13 +1,13 @@
using Infrastructure;
using System;
using SqlSugar;
using System.Collections.Generic;
using Infrastructure;
using Infrastructure.Attribute;
using ${options.ModelsNamespace};
using ${options.ModelsNamespace}.Dto;
using ${options.ModelsNamespace}.Models;
using ${options.IRepositoriesNamespace};
using ${options.IServicsNamespace}.${options.SubNamespace}.I${options.SubNamespace}Service;
using System;
using SqlSugar;
using System.Collections.Generic;
namespace ${options.ServicesNamespace}.${options.SubNamespace}
{
@@ -20,10 +20,10 @@ namespace ${options.ServicesNamespace}.${options.SubNamespace}
[AppService(ServiceType = typeof(I${replaceDto.ModelTypeName}Service), ServiceLifetime = LifeTime.Transient)]
public class ${replaceDto.ModelTypeName}Service : BaseService<${replaceDto.ModelTypeName}>, I${replaceDto.ModelTypeName}Service
{
private readonly ${replaceDto.ModelTypeName}Repository _${replaceDto.ModelTypeName}repository;
private readonly ${replaceDto.ModelTypeName}Repository _${replaceDto.ModelTypeName}Repository;
public ${replaceDto.ModelTypeName}Service(${replaceDto.ModelTypeName}Repository repository)
{
_${replaceDto.ModelTypeName}repository = repository;
_${replaceDto.ModelTypeName}Repository = repository;
}
#region 业务逻辑代码
@@ -51,15 +51,17 @@ $elseif(column.CsharpType == "int" || column.CsharpType == "long")
$end
$end
$end
$if(genTable.SortField != "" && genTable.SortField != null)
var response = _${replaceDto.ModelTypeName}repository
.GetPages(predicate.ToExpression(), parm, it => it.${genTable.SortField}, "${genTable.SortType}");
$else
var response = _${replaceDto.ModelTypeName}repository
var response = _${replaceDto.ModelTypeName}Repository
.Queryable()
$if(genTable.SubTableName != "" && genTable.SubTableName != null)
.Includes(it => it.Sub.MappingField(z => z.${genTable.SubTableFkName}, () => it.${replaceDto.PKName}))
$end
$if(genTable.SortField != "" && genTable.SortField != null)
.OrderBy("${genTable.SortField} ${genTable.SortType}")
$end
.Where(predicate.ToExpression())
.ToPage(parm);
$end
return response;
}
@@ -85,12 +87,29 @@ $end
$end
$end
var response = _${replaceDto.ModelTypeName}repository.Queryable().Where(predicate.ToExpression())
var response = _${replaceDto.ModelTypeName}Repository.Queryable().Where(predicate.ToExpression())
.ToTree(it => it.Children, it => it.${genTable.TreeParentCode}, 0);
return response;
}
$end
/// <summary>
/// 添加${genTable.FunctionName}
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
public int Add${replaceDto.ModelTypeName}(${replaceDto.ModelTypeName} parm)
{
var response = _${replaceDto.ModelTypeName}Repository.Insert(parm, it => new
{
${foreach(item in genTable.Columns)}
$if((item.IsInsert))
it.$item.CsharpField,
$end
${end}
});
return response;
}
#endregion
}
}

View File

@@ -1,10 +1,10 @@
<!--
* @Descripttion: (${genTable.functionName}/${genTable.remark})
* @Descripttion: (${genTable.functionName}/${genTable.tableName})
* @version: (1.0)
* @Author: (${replaceDto.Author})
* @Date: (${replaceDto.AddTime})
* @LastEditors: (最后更新作者)
* @LastEditTime: (最后更新时间)
* @LastEditors: (${replaceDto.Author})
* @LastEditTime: (${replaceDto.AddTime})
-->
<template>
<div class="app-container">

View File

@@ -1,10 +1,10 @@
<!--
* @Descripttion: (${genTable.functionName}/${genTable.remark})
* @Descripttion: (${genTable.functionName}/${genTable.tableName})
* @version: (1.0)
* @Author: (${replaceDto.Author})
* @Date: (${replaceDto.AddTime})
* @LastEditors: (最后更新作者)
* @LastEditTime: (最后更新时间)
* @LastEditors: (${replaceDto.Author})
* @LastEditTime: (${replaceDto.AddTime})
-->
<template>
<div class="app-container">

View File

@@ -1,10 +1,10 @@
<!--
* @Descripttion: (${genTable.functionName}/${genTable.remark})
* @Descripttion: (${genTable.functionName}/${genTable.tableName})
* @version: (1.0)
* @Author: (${replaceDto.Author})
* @Date: (${replaceDto.AddTime})
* @LastEditors: (最后更新作者)
* @LastEditTime: (最后更新时间)
* @LastEditors: (${replaceDto.Author})
* @LastEditTime: (${replaceDto.AddTime})
-->
<template>
<div class="app-container">
@@ -45,15 +45,17 @@ $end
$end
$end
<el-form-item>
<el-button icon="search" type="primary" @click="handleQuery">搜索</el-button>
<el-button icon="refresh" @click="resetQuery">重置</el-button>
<el-button icon="search" type="primary" @click="handleQuery">{{ ${t}t('btn.search') }}</el-button>
<el-button icon="refresh" @click="resetQuery">{{ ${t}t('btn.reset') }}</el-button>
</el-form-item>
</el-form>
<!-- 工具区域 -->
<el-row :gutter="10" class="mb8">
$if(replaceDto.ShowBtnAdd)
<el-col :span="1.5">
<el-button type="primary" v-hasPermi="['${replaceDto.PermissionPrefix}:add']" plain icon="plus" @click="handleAdd">新增</el-button>
<el-button type="primary" v-hasPermi="['${replaceDto.PermissionPrefix}:add']" plain icon="plus" @click="handleAdd">
{{ ${t}t('btn.add') }}
</el-button>
</el-col>
$end
<el-col :span="1.5">
@@ -61,12 +63,16 @@ $end
</el-col>
$if(replaceDto.ShowBtnDelete)
<el-col :span="1.5">
<el-button type="danger" :disabled="multiple" v-hasPermi="['${replaceDto.PermissionPrefix}:delete']" plain icon="delete" @click="handleDelete">删除</el-button>
<el-button type="danger" :disabled="multiple" v-hasPermi="['${replaceDto.PermissionPrefix}:delete']" plain icon="delete" @click="handleDelete">
{{ ${t}t('btn.delete') }}
</el-button>
</el-col>
$end
$if(replaceDto.ShowBtnExport)
<el-col :span="1.5">
<el-button type="warning" plain icon="download" @click="handleExport" v-hasPermi="['${replaceDto.PermissionPrefix}:export']">导出</el-button>
<el-button type="warning" plain icon="download" @click="handleExport" v-hasPermi="['${replaceDto.PermissionPrefix}:export']">
{{ ${t}t('btn.export') }}
</el-button>
</el-col>
$end
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
@@ -272,8 +278,8 @@ $end
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="text" @click="cancel">取 消</el-button>
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button type="text" @click="cancel">{{ ${t}t('btn.cancel') }}</el-button>
<el-button type="primary" @click="submitForm">{{ ${t}t('btn.submit') }}</el-button>
</div>
</template>
</el-dialog>

View File

@@ -1,10 +1,10 @@
<!--
* @Descripttion: (${genTable.functionName}/${genTable.remark})
* @Descripttion: (${genTable.functionName}/${genTable.tableName})
* @version: (1.0)
* @Author: (${replaceDto.Author})
* @Date: (${replaceDto.AddTime})
* @LastEditors: (最后更新作者)
* @LastEditTime: (最后更新时间)
* @LastEditors: (${replaceDto.Author})
* @LastEditTime: (${replaceDto.AddTime})
-->
<template>
<div class="app-container">
@@ -52,32 +52,39 @@ $else
$end
$end
$end
<el-form-item>
<el-button icon="search" type="primary" @click="handleQuery">搜索</el-button>
<el-button icon="refresh" @click="resetQuery">重置</el-button>
<el-button icon="search" type="primary" @click="handleQuery">{{ ${t}t('btn.search') }}</el-button>
<el-button icon="refresh" @click="resetQuery">{{ ${t}t('btn.reset') }}</el-button>
</el-form-item>
</el-form>
<!-- 工具区域 -->
<el-row :gutter="10" class="mb8">
$if(replaceDto.ShowBtnAdd)
<el-col :span="1.5">
<el-button type="primary" v-hasPermi="['${replaceDto.PermissionPrefix}:add']" plain icon="plus" @click="handleAdd">新增</el-button>
<el-button type="primary" v-hasPermi="['${replaceDto.PermissionPrefix}:add']" plain icon="plus" @click="handleAdd">
{{ ${t}t('btn.add') }}
</el-button>
</el-col>
$end
$if(replaceDto.ShowBtnEdit)
<el-col :span="1.5">
<el-button type="success" :disabled="single" v-hasPermi="['${replaceDto.PermissionPrefix}:edit']" plain icon="edit" @click="handleUpdate">修改</el-button>
<el-button type="success" :disabled="single" v-hasPermi="['${replaceDto.PermissionPrefix}:edit']" plain icon="edit" @click="handleUpdate">
{{ ${t}t('btn.edit') }}
</el-button>
</el-col>
$end
$if(replaceDto.ShowBtnDelete)
<el-col :span="1.5">
<el-button type="danger" :disabled="multiple" v-hasPermi="['${replaceDto.PermissionPrefix}:delete']" plain icon="delete" @click="handleDelete">删除</el-button>
<el-button type="danger" :disabled="multiple" v-hasPermi="['${replaceDto.PermissionPrefix}:delete']" plain icon="delete" @click="handleDelete">
{{ ${t}t('btn.delete') }}
</el-button>
</el-col>
$end
$if(replaceDto.ShowBtnExport)
<el-col :span="1.5">
<el-button type="warning" plain icon="download" @click="handleExport" v-hasPermi="['${replaceDto.PermissionPrefix}:export']">导出</el-button>
<el-button type="warning" plain icon="download" @click="handleExport" v-hasPermi="['${replaceDto.PermissionPrefix}:export']">
{{ ${t}t('btn.export') }}
</el-button>
</el-col>
$end
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
@@ -256,8 +263,8 @@ $end
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="text" @click="cancel">取 消</el-button>
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button type="text" @click="cancel">{{ ${t}t('btn.cancel') }}</el-button>
<el-button type="primary" @click="submitForm">{{ ${t}t('btn.submit') }}</el-button>
</div>
</template>
</el-dialog>