Merge branch 'master'
This commit is contained in:
commit
8b6d2a0a36
@ -82,7 +82,7 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
[ActionPermissionFilter(Permission = "system")]
|
||||
public IActionResult UploadFile([FromForm(Name = "file")] IFormFile formFile)
|
||||
{
|
||||
if (formFile == null) throw new CustomException(ResultCode.PARAM_ERROR, "上传图片不能为空");
|
||||
if (formFile == null) throw new CustomException(ResultCode.PARAM_ERROR, "上传文件不能为空");
|
||||
string fileExt = Path.GetExtension(formFile.FileName);
|
||||
string fileName = FileUtil.HashFileName(Guid.NewGuid().ToString()).ToLower() + fileExt;
|
||||
string finalFilePath = Path.Combine(WebHostEnvironment.WebRootPath, FileUtil.GetdirPath("uploads"), fileName);
|
||||
@ -99,23 +99,28 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
}
|
||||
|
||||
string accessPath = $"{OptionsSetting.Upload.UploadUrl}/{FileUtil.GetdirPath("uploads").Replace("\\", " /")}{fileName}";
|
||||
return ToResponse(ResultCode.SUCCESS, accessPath);
|
||||
return ToResponse(ResultCode.SUCCESS, new
|
||||
{
|
||||
url = accessPath,
|
||||
fileName
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 存储文件到阿里云
|
||||
/// </summary>
|
||||
/// <param name="formFile"></param>
|
||||
/// <param name="fileDir">上传文件夹路径</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Verify]
|
||||
[ActionPermissionFilter(Permission = "system")]
|
||||
public IActionResult UploadFileAliyun([FromForm(Name = "file")] IFormFile formFile)
|
||||
public IActionResult UploadFileAliyun([FromForm(Name = "file")] IFormFile formFile, string fileDir = "")
|
||||
{
|
||||
if (formFile == null) throw new CustomException(ResultCode.PARAM_ERROR, "上传文件不能为空");
|
||||
string fileExt = Path.GetExtension(formFile.FileName);
|
||||
string[] AllowedFileExtensions = new string[] { ".jpg", ".gif", ".png", ".jpeg", ".webp", ".svga", ".xls" };
|
||||
int MaxContentLength = 1024 * 1024 * 4;
|
||||
int MaxContentLength = 1024 * 1024 * 5;
|
||||
|
||||
if (!AllowedFileExtensions.Contains(fileExt))
|
||||
{
|
||||
@ -126,9 +131,13 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
return ToResponse(ResultCode.CUSTOM_ERROR, "上传文件过大,不能超过 " + (MaxContentLength / 1024).ToString() + " MB");
|
||||
}
|
||||
(bool, string) result = SysFileService.SaveFile("", formFile);
|
||||
(bool, string, string) result = SysFileService.SaveFile(fileDir, formFile);
|
||||
|
||||
return ToResponse(ResultCode.SUCCESS, result.Item2);
|
||||
return ToResponse(ResultCode.SUCCESS, new
|
||||
{
|
||||
url = result.Item2,
|
||||
fileName = result.Item3
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@ -195,36 +195,35 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
sortField = genTableDto.SortField,
|
||||
sortType = genTable.SortType
|
||||
});
|
||||
int updateCount = 0;
|
||||
bool result = GenTableService.UseTran2(() =>
|
||||
{
|
||||
int rows = GenTableService.UpdateGenTable(genTable);
|
||||
if (rows > 0)
|
||||
{
|
||||
GenTableColumnService.UpdateGenTableColumn(genTable.Columns);
|
||||
updateCount = GenTableColumnService.UpdateGenTableColumn(genTable.Columns);
|
||||
}
|
||||
return SUCCESS(rows);
|
||||
});
|
||||
|
||||
return SUCCESS(updateCount);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 预览代码
|
||||
/// </summary>
|
||||
/// <param name="tableId"></param>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("preview/{tableId}")]
|
||||
[HttpPost("preview/{tableId}")]
|
||||
[ActionPermissionFilter(Permission = "tool:gen:preview")]
|
||||
public IActionResult Preview(long tableId)
|
||||
public IActionResult Preview([FromBody] GenerateDto dto)
|
||||
{
|
||||
if (tableId <= 0)
|
||||
if (dto == null || dto.TableId <= 0)
|
||||
{
|
||||
throw new CustomException(ResultCode.CUSTOM_ERROR, "请求参数为空");
|
||||
}
|
||||
var genTableInfo = GenTableService.GetGenTableInfo(tableId);
|
||||
genTableInfo.Columns = GenTableColumnService.GenTableColumns(tableId);
|
||||
var genTableInfo = GenTableService.GetGenTableInfo(dto.TableId);
|
||||
genTableInfo.Columns = GenTableColumnService.GenTableColumns(dto.TableId);
|
||||
|
||||
//var dictList = genTableInfo.Columns.FindAll(x => !string.IsNullOrEmpty(x.DictType));
|
||||
//foreach (var item in dictList)
|
||||
//{
|
||||
// item.DictDatas = SysDictDataService.SelectDictDataByType(item.DictType);
|
||||
//}
|
||||
GenerateDto dto = new();
|
||||
dto.GenTable = genTableInfo;
|
||||
dto.ZipPath = Path.Combine(WebHostEnvironment.WebRootPath, "Generatecode");
|
||||
dto.GenCodePath = Path.Combine(dto.ZipPath, DateTime.Now.ToString("yyyyMMdd"));
|
||||
|
||||
@ -128,7 +128,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
{
|
||||
if (sysRoleDto == null || sysRoleDto.RoleId <= 0) return ToResponse(ApiResult.Error(101, "请求参数错误"));
|
||||
|
||||
sysRoleDto.Create_by = HttpContextExtension.GetName(HttpContext);
|
||||
sysRoleDto.Create_by = HttpContext.GetName();
|
||||
//删除角色菜单
|
||||
sysRoleService.DeleteRoleMenuByRoleId(sysRoleDto.RoleId);
|
||||
sysRoleService.InsertRoleMenu(sysRoleDto);
|
||||
|
||||
@ -25,7 +25,7 @@ namespace ZR.Admin.WebApi.Framework
|
||||
/// <returns></returns>
|
||||
public static LoginUser GetLoginUser(HttpContext httpContext)
|
||||
{
|
||||
string token = HttpContextExtension.GetToken(httpContext);
|
||||
string token = httpContext.GetToken();
|
||||
|
||||
if (!string.IsNullOrEmpty(token))
|
||||
{
|
||||
@ -44,6 +44,8 @@ namespace ZR.Admin.WebApi.Framework
|
||||
JwtSettings jwtSettings = new();
|
||||
ConfigUtils.Instance.Bind("JwtSettings", jwtSettings);
|
||||
|
||||
var authTime = DateTime.Now;
|
||||
var expiresAt = authTime.AddMinutes(jwtSettings.Expire);
|
||||
var tokenHandler = new JwtSecurityTokenHandler();
|
||||
var key = Encoding.ASCII.GetBytes(jwtSettings.SecretKey);
|
||||
claims.Add(new Claim("Audience", jwtSettings.Audience));
|
||||
@ -54,8 +56,9 @@ namespace ZR.Admin.WebApi.Framework
|
||||
Subject = new ClaimsIdentity(claims),
|
||||
Issuer = jwtSettings.Issuer,
|
||||
Audience = jwtSettings.Audience,
|
||||
IssuedAt = DateTime.Now,//token生成时间
|
||||
Expires = DateTime.Now.AddMinutes(jwtSettings.Expire),
|
||||
IssuedAt = authTime,//token生成时间
|
||||
Expires = expiresAt,
|
||||
//NotBefore = authTime,
|
||||
TokenType = "Bearer",
|
||||
//对称秘钥,签名证书
|
||||
SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256Signature)
|
||||
@ -83,7 +86,8 @@ namespace ZR.Admin.WebApi.Framework
|
||||
ValidAudience = jwtSettings.Audience,
|
||||
IssuerSigningKey = new SymmetricSecurityKey(key),
|
||||
ValidateLifetime = true,//是否验证Token有效期,使用当前时间与Token的Claims中的NotBefore和Expires对比
|
||||
RequireExpirationTime = true,//过期时间
|
||||
ClockSkew = TimeSpan.FromSeconds(30)
|
||||
//RequireExpirationTime = true,//过期时间
|
||||
};
|
||||
return tokenDescriptor;
|
||||
}
|
||||
|
||||
@ -30,6 +30,15 @@
|
||||
keepFileOpen="false"
|
||||
layout="${longdate} | ${event-properties:item=EventId_Id} | ${uppercase:${level}} | ${logger} | ${aspnet-request-iP} | ${event-properties:item=user} | ${aspnet-request-url} | ${message} | ${event-properties:item=requestParam} | ${event-properties:item=jsonResult} | ${onexception:${exception:format=tostring}"/>
|
||||
|
||||
<!--SQL-->
|
||||
<target name="sqlfile" xsi:type="File"
|
||||
fileName="${basedir}/adminlogs/all-sql.log"
|
||||
archiveFileName="${basedir}/adminlogs/all.sql{###}.txt"
|
||||
archiveAboveSize="20000000"
|
||||
maxArchiveFiles="30"
|
||||
keepFileOpen="false"
|
||||
layout="${longdate} | ${aspnet-request-iP} | ${aspnet-request-headers:HeaderNames=userid} | ${aspnet-request-url} | ${message}"/>
|
||||
|
||||
<!--写入控制台-->
|
||||
<target name="console" xsi:type="ColoredConsole"
|
||||
layout="${date:format=MM-dd HH\:mm\:ss} | ${uppercase:${level}} | ${logger} | ${aspnet-request-iP} | ${aspnet-request-url} | ${message}"/>
|
||||
@ -46,6 +55,7 @@
|
||||
<!--<logger name="System.*" writeTo="blackhole" final="true" />-->
|
||||
<!-- Quartz -->
|
||||
<logger name="Quartz*" minlevel="Trace" maxlevel="Info" final="true" />
|
||||
<logger name="ZR.Admin.WebApi.Startup" final="true" writeTo="sqlfile"/>
|
||||
|
||||
<logger name="*" minLevel="Debug" writeTo="console"/>
|
||||
<!--所有日志都写入到控制台-->
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Controllers\business\" />
|
||||
<Folder Include="Controllers\demo\" />
|
||||
<Folder Include="DataProtection\" />
|
||||
<Folder Include="wwwroot\export\" />
|
||||
<Folder Include="wwwroot\Generatecode\" />
|
||||
<Folder Include="wwwroot\uploads\" />
|
||||
|
||||
@ -15,13 +15,13 @@
|
||||
"urls": "http://localhost:8888", //项目启动url
|
||||
"sysConfig": {
|
||||
"DBCommandTimeout": 10,
|
||||
"cors": "http://localhost:8887" //跨域地址(前端启动项目),多个用","隔开
|
||||
"cors": "http://localhost:8887" //跨域地址(前端启动项目,前后端分离单独部署需要设置),多个用","隔开
|
||||
},
|
||||
"JwtSettings": {
|
||||
"Issuer": "https://localhost:8888",
|
||||
"Audience": "https://localhost:8888",
|
||||
"SecretKey": "Hello-key-ZRADMIN.NET-20210101",
|
||||
"Expire": 5
|
||||
"Issuer": "ZRAdmin.NET",
|
||||
"Audience": "ZRAdmin.NET",
|
||||
"SecretKey": "SecretKey-ZRADMIN.NET-20210101",
|
||||
"Expire": 30
|
||||
},
|
||||
"DemoMode": false, //是否演示模式
|
||||
"DbKey": "", //数据库加密key
|
||||
|
||||
@ -26,7 +26,7 @@ namespace ${options.ApiControllerNamespace}.Controllers
|
||||
/// @date ${replaceDto.AddTime}
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("${genTable.ModuleName}/${replaceDto.ModelTypeName}")]
|
||||
[Route("${genTable.ModuleName}/${genTable.BusinessName}")]
|
||||
public class ${replaceDto.ModelTypeName}Controller : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
@ -51,7 +51,18 @@ namespace ${options.ApiControllerNamespace}.Controllers
|
||||
var predicate = Expressionable.Create<${replaceDto.ModelTypeName}>();
|
||||
|
||||
//搜索条件查询语法参考Sqlsugar
|
||||
${QueryCondition}
|
||||
$foreach(column in genTable.Columns)
|
||||
$if(column.IsQuery)
|
||||
$if(column.CsharpType == "string")
|
||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.${column.CsharpField}), ${codeTool.QueryExp(column.CsharpField, column.QueryType)};
|
||||
$elseif(column.CsharpType == "DateTime")
|
||||
predicate = predicate.AndIF(parm.Begin${column.CsharpField} != null, it => it.${column.CsharpField} >= parm.Begin${column.CsharpField});
|
||||
predicate = predicate.AndIF(parm.End${column.CsharpField} != null, it => it.${column.CsharpField} <= parm.End${column.CsharpField});
|
||||
$elseif(column.CsharpType == "int" || column.CsharpType == "long")
|
||||
predicate = predicate.AndIF(parm.${column.CsharpField} != null, ${codeTool.QueryExp(column.CsharpField, column.QueryType)};
|
||||
$end
|
||||
$end
|
||||
$end
|
||||
$if(genTable.SortField != "" && genTable.SortField != null)
|
||||
var response = _${replaceDto.ModelTypeName}Service.GetPages(predicate.ToExpression(), parm, x => x.${genTable.SortField}, "${genTable.SortType}");
|
||||
$else
|
||||
|
||||
@ -14,7 +14,7 @@ $foreach(item in genTable.Columns)
|
||||
$if((item.IsInsert || item.IsEdit || item.IsPk || item.IsIncrement))
|
||||
public $item.CsharpType$item.RequiredStr $item.CsharpField { get; set; }
|
||||
$end
|
||||
${end}
|
||||
$end
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -27,8 +27,8 @@ $if(item.IsQuery && item.htmlType == "datetime")
|
||||
public DateTime? Begin$item.CsharpField { get; set; }
|
||||
public DateTime? End$item.CsharpField { get; set; }
|
||||
$elseif(item.IsQuery)
|
||||
public $item.CsharpType $item.CsharpField { get; set; }
|
||||
public $item.CsharpType$if(item.CsharpType != "string")?$end $item.CsharpField { get; set; }
|
||||
$end
|
||||
$end
|
||||
${end}
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,7 +8,6 @@ ${vueQueryFormHtml}
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<!-- 工具区域 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
@ -20,9 +19,11 @@ ${vueQueryFormHtml}
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" :disabled="multiple" v-hasPermi="['${replaceDto.PermissionPrefix}:delete']" plain icon="el-icon-delete" size="mini" @click="handleDelete">删除</el-button>
|
||||
</el-col>
|
||||
$if(replaceDto.ShowBtnExport)
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['${replaceDto.PermissionPrefix}:export']">导出</el-button>
|
||||
</el-col>
|
||||
$end
|
||||
$if(genTable.SortField != "" && 1 == 2)
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="el-icon-edit" size="mini" @click="handleShowSort" v-hasPermi="['${replaceDto.PermissionPrefix}:update']">修改排序</el-button>
|
||||
@ -32,15 +33,13 @@ $end
|
||||
</el-row>
|
||||
|
||||
<!-- 数据区域 -->
|
||||
<el-table :data="dataList" ref="table" border @selection-change="handleSelectionChange">
|
||||
<el-table :data="dataList" ref="table" border highlight-current-row @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="50" align="center"/>
|
||||
${VueViewListContent}
|
||||
<el-table-column label="操作" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-hasPermi="['${replaceDto.PermissionPrefix}:update']" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="handleDelete(scope.row)" style="margin-left:10px">
|
||||
<el-button slot="reference" v-hasPermi="['${replaceDto.PermissionPrefix}:delete']" type="text" icon="el-icon-delete">删除</el-button>
|
||||
</el-popconfirm>
|
||||
<el-button v-hasPermi="['${replaceDto.PermissionPrefix}:delete']" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -91,17 +90,30 @@ export default {
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 查询参数
|
||||
queryParams: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
$foreach(item in genTable.Columns)
|
||||
$if(item.IsQuery == true)
|
||||
${item.columnName}: undefined,
|
||||
$end
|
||||
$end
|
||||
},
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 时间范围数组
|
||||
timeRange: [],
|
||||
columns: [
|
||||
$set(index = 0)
|
||||
$foreach(column in genTable.Columns)
|
||||
{ index: $index, key: '${column.ColumnName}', label: `${column.ColumnComment}`, checked: $if(index < 9) true $else false $end },
|
||||
$set(index = index + 1)
|
||||
$end
|
||||
],
|
||||
$foreach(item in genTable.Columns)
|
||||
$if((item.HtmlType == "radio" || item.HtmlType == "select"))
|
||||
$if((item.HtmlType == "radio" || item.HtmlType == "select" || item.HtmlType == "checkbox"))
|
||||
// ${item.ColumnComment}选项列表
|
||||
${item.ColumnName}Options: [],
|
||||
$elseif(item.HtmlType == "datetime" && item.IsQuery == true)
|
||||
@ -109,7 +121,6 @@ $elseif(item.HtmlType == "datetime" && item.IsQuery == true)
|
||||
dateRange${item.CsharpField}: [],
|
||||
$end
|
||||
$end
|
||||
|
||||
$if(genTable.SortField != "" && genTable.SortField != null)
|
||||
// 是否显示编辑排序
|
||||
showEditSort: false,
|
||||
@ -122,7 +133,14 @@ $end
|
||||
btnSubmitVisible: true,
|
||||
// 表单校验
|
||||
rules: {
|
||||
${VueViewEditFormRuleContent}
|
||||
$foreach(column in genTable.Columns)
|
||||
$if(column.IsRequired)
|
||||
${column.ColumnName}: [
|
||||
{ required: true, message: "${column.ColumnComment}不能为空", trigger: $if(column.htmlType == "select")"change"$else"blur"$end
|
||||
$if(column.CsharpType == "int" || column.CsharpType == "long"), type: "number"$end }
|
||||
],
|
||||
$end
|
||||
$end
|
||||
},
|
||||
};
|
||||
},
|
||||
@ -131,7 +149,7 @@ ${VueViewEditFormRuleContent}
|
||||
this.getList();
|
||||
|
||||
$foreach(item in genTable.Columns)
|
||||
$if((item.HtmlType == "radio" || item.HtmlType == "select") && item.DictType != "")
|
||||
$if((item.HtmlType == "radio" || item.HtmlType == "select" || item.HtmlType == "checkbox") && item.DictType != "")
|
||||
this.getDicts("${item.DictType}").then((response) => {
|
||||
this.${item.ColumnName}Options = response.data;
|
||||
})
|
||||
@ -181,11 +199,6 @@ $if(item.HtmlType == "datetime" && item.IsQuery == true)
|
||||
$end
|
||||
$end
|
||||
this.resetForm("queryForm");
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
//TODO 重置字段
|
||||
};
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
@ -196,6 +209,7 @@ $end
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
@ -207,10 +221,16 @@ $end
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const Ids = row.${replaceDto.FistLowerPk} || this.ids;
|
||||
del${genTable.BusinessName}(Ids).then((res) => {
|
||||
this.msgSuccess("删除成功");
|
||||
|
||||
this.${confirm}confirm('是否确认删除参数编号为"' + Ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return del${genTable.BusinessName}(Ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.handleQuery();
|
||||
});
|
||||
this.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
@ -242,13 +262,12 @@ $if(genTable.SortField != "" && genTable.SortField != null)
|
||||
$end
|
||||
$if(replaceDto.UploadFile == 1)
|
||||
//图片上传成功方法
|
||||
handleUploadSuccess(res, columnName) {
|
||||
this.form[columnName] = res.data;
|
||||
console.log(JSON.stringify(this.form), JSON.stringify(res))
|
||||
handleUploadSuccess(columnName, filelist) {
|
||||
this.form[columnName] = filelist;
|
||||
},
|
||||
$end
|
||||
$foreach(item in genTable.Columns)
|
||||
$if((item.HtmlType == "radio" || item.HtmlType == "select") && item.DictType != "")
|
||||
$if((item.HtmlType == "radio" || item.HtmlType == "select" || item.HtmlType == "checkbox"))
|
||||
// ${item.ColumnComment}字典翻译
|
||||
${item.ColumnName}Format(row, column) {
|
||||
return this.selectDictLabel(this.${item.ColumnName}Options, row.${item.ColumnName});
|
||||
@ -303,8 +322,3 @@ $end
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.table-td-thumb {
|
||||
width: 80px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
*/
|
||||
export function list${genTable.BusinessName}(query) {
|
||||
return request({
|
||||
url: '${genTable.ModuleName}/${replaceDto.ModelTypeName}/list',
|
||||
url: '${genTable.ModuleName}/${genTable.BusinessName}/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
@ -18,7 +18,7 @@ export function list${genTable.BusinessName}(query) {
|
||||
*/
|
||||
export function add${genTable.BusinessName}(data) {
|
||||
return request({
|
||||
url: '${genTable.ModuleName}/${replaceDto.ModelTypeName}',
|
||||
url: '${genTable.ModuleName}/${genTable.BusinessName}',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
@ -30,7 +30,7 @@ export function add${genTable.BusinessName}(data) {
|
||||
*/
|
||||
export function update${genTable.BusinessName}(data) {
|
||||
return request({
|
||||
url: '${genTable.ModuleName}/${replaceDto.ModelTypeName}',
|
||||
url: '${genTable.ModuleName}/${genTable.BusinessName}',
|
||||
method: 'PUT',
|
||||
data: data,
|
||||
})
|
||||
@ -42,7 +42,7 @@ export function update${genTable.BusinessName}(data) {
|
||||
*/
|
||||
export function get${genTable.BusinessName}(id) {
|
||||
return request({
|
||||
url: '${genTable.ModuleName}/${replaceDto.ModelTypeName}/' + id,
|
||||
url: '${genTable.ModuleName}/${genTable.BusinessName}/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@ -53,15 +53,15 @@ export function get${genTable.BusinessName}(id) {
|
||||
*/
|
||||
export function del${genTable.BusinessName}(pid) {
|
||||
return request({
|
||||
url: '${genTable.ModuleName}/${replaceDto.ModelTypeName}/' + pid,
|
||||
url: '${genTable.ModuleName}/${genTable.BusinessName}/' + pid,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出${genTable.functionName}
|
||||
export function export${replaceDto.ModelTypeName}(query) {
|
||||
export function export${genTable.BusinessName}(query) {
|
||||
return request({
|
||||
url: '${genTable.ModuleName}/${replaceDto.ModelTypeName}/export',
|
||||
url: '${genTable.ModuleName}/${genTable.BusinessName}/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
@ -71,7 +71,7 @@ $if(genTable.SortField != "" && genTable.SortField != null)
|
||||
//排序
|
||||
export function changeSort(data) {
|
||||
return request({
|
||||
url: '${genTable.ModuleName}/${replaceDto.ModelTypeName}/ChangeSort',
|
||||
url: '${genTable.ModuleName}/${genTable.BusinessName}/ChangeSort',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
|
||||
@ -11,57 +11,8 @@ namespace ZR.CodeGenerator
|
||||
/// </summary>
|
||||
public class CodeGenerateTemplate
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询Dto属性
|
||||
/// </summary>
|
||||
/// <param name="tbColumn"></param>
|
||||
/// <param name="replaceDto">替换字符对象</param>
|
||||
/// <returns></returns>
|
||||
public static void GetQueryDtoProperty(GenTableColumn tbColumn, ReplaceDto replaceDto)
|
||||
{
|
||||
if (tbColumn.IsQuery)
|
||||
{
|
||||
//字符串类型表达式
|
||||
if (tbColumn.CsharpType == GenConstants.TYPE_STRING)
|
||||
{
|
||||
replaceDto.QueryCondition += $" predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.{tbColumn.CsharpField}), {QueryExp(tbColumn.CsharpField, tbColumn.QueryType)};\n";
|
||||
}
|
||||
//int类型表达式
|
||||
if (CodeGeneratorTool.IsNumber(tbColumn.CsharpType))
|
||||
{
|
||||
replaceDto.QueryCondition += $" predicate = predicate.AndIF(parm.{tbColumn.CsharpField} > 0, {QueryExp(tbColumn.CsharpField, tbColumn.QueryType)};\n";
|
||||
}
|
||||
//时间类型
|
||||
if (tbColumn.CsharpType == GenConstants.TYPE_DATE)
|
||||
{
|
||||
replaceDto.QueryCondition += $" predicate = predicate.AndIF(parm.Begin{tbColumn.CsharpField} != null, it => it.{tbColumn.CsharpField} >= parm.Begin{tbColumn.CsharpField});\n";
|
||||
replaceDto.QueryCondition += $" predicate = predicate.AndIF(parm.End{tbColumn.CsharpField} != null, it => it.{tbColumn.CsharpField} <= parm.End{tbColumn.CsharpField});\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region vue 模板
|
||||
|
||||
/// <summary>
|
||||
/// Vue rules
|
||||
/// </summary>
|
||||
/// <param name="dbFieldInfo"></param>
|
||||
/// <returns></returns>
|
||||
public static string TplFormRules(GenTableColumn dbFieldInfo)
|
||||
{
|
||||
StringBuilder sbRule = new StringBuilder();
|
||||
//Rule 规则验证
|
||||
if (!dbFieldInfo.IsPk && !dbFieldInfo.IsIncrement && dbFieldInfo.IsRequired)
|
||||
{
|
||||
sbRule.AppendLine($" {dbFieldInfo.ColumnName}: [{{ required: true, message: '请输入{dbFieldInfo.ColumnComment}', trigger: \"blur\"}}],");
|
||||
}
|
||||
else if (CodeGeneratorTool.IsNumber(dbFieldInfo.ColumnType) && dbFieldInfo.IsRequired)
|
||||
{
|
||||
sbRule.AppendLine($" {dbFieldInfo.ColumnName}: [{{ type: 'number', message: '{dbFieldInfo.ColumnName}必须为数字值', trigger: \"blur\"}}],");
|
||||
}
|
||||
return sbRule.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Vue 添加修改表单
|
||||
/// </summary>
|
||||
@ -85,8 +36,9 @@ namespace ZR.CodeGenerator
|
||||
}
|
||||
if (dbFieldInfo.HtmlType == GenConstants.HTML_INPUT_NUMBER)
|
||||
{
|
||||
//数字框
|
||||
sb.AppendLine(" <el-col :span=\"12\">");
|
||||
sb.AppendLine($" <el-form-item label=\"{labelName}\" :label-width=\"labelWidth\" prop=\"{columnName}\">");
|
||||
sb.AppendLine($" <el-form-item label=\"{labelName}\" prop=\"{columnName}\">");
|
||||
sb.AppendLine($" <el-input-number v-model.number=\"form.{columnName}\" placeholder=\"请输入{labelName}\" {labelDisabled}/>");
|
||||
sb.AppendLine(" </el-form-item>");
|
||||
sb.AppendLine(" </el-col>");
|
||||
@ -95,7 +47,7 @@ namespace ZR.CodeGenerator
|
||||
{
|
||||
//时间
|
||||
sb.AppendLine(" <el-col :span=\"12\">");
|
||||
sb.AppendLine($" <el-form-item label=\"{labelName}\" :label-width=\"labelWidth\" prop=\"{columnName}\">");
|
||||
sb.AppendLine($" <el-form-item label=\"{labelName}\" prop=\"{columnName}\">");
|
||||
sb.AppendLine($" <el-date-picker v-model=\"form.{columnName}\" format=\"yyyy-MM-dd HH:mm:ss\" value-format=\"yyyy-MM-dd HH:mm:ss\" type=\"datetime\" placeholder=\"选择日期时间\"> </el-date-picker>");
|
||||
sb.AppendLine(" </el-form-item>");
|
||||
sb.AppendLine(" </el-col>");
|
||||
@ -104,63 +56,64 @@ namespace ZR.CodeGenerator
|
||||
{
|
||||
//图片
|
||||
sb.AppendLine(" <el-col :span=\"24\">");
|
||||
sb.AppendLine($" <el-form-item label=\"{labelName}\" :label-width=\"labelWidth\" prop=\"{columnName}\">");
|
||||
sb.AppendLine($@" <UploadImage :icon=""form.{columnName}"" column='{columnName}' :key=""form.{columnName}"" @handleUploadSuccess=""handleUploadSuccess"" />");
|
||||
sb.AppendLine($" <el-form-item label=\"{labelName}\" prop=\"{columnName}\">");
|
||||
sb.AppendLine($@" <UploadImage v-model=""form.{columnName}"" column=""{columnName}"" @input=""handleUploadSuccess"" />");
|
||||
sb.AppendLine(" </el-form-item>");
|
||||
sb.AppendLine(" </el-col>");
|
||||
}
|
||||
else if (dbFieldInfo.HtmlType == GenConstants.HTML_RADIO && !string.IsNullOrEmpty(dbFieldInfo.DictType))
|
||||
else if (dbFieldInfo.HtmlType == GenConstants.HTML_FILE_UPLOAD)
|
||||
{
|
||||
sb.AppendLine(" <el-col :span=\"12\">");
|
||||
sb.AppendLine($" <el-form-item label=\"{labelName}\" :label-width=\"labelWidth\" prop=\"{columnName}\">");
|
||||
sb.AppendLine($" <el-radio-group v-model=\"form.{columnName}\">");
|
||||
sb.AppendLine($" <el-radio v-for=\"item in {columnName}Options\" :key=\"item.dictValue\" :label=\"{value}\">{{{{item.dictLabel}}}}</el-radio>");
|
||||
sb.AppendLine(" </el-radio-group>");
|
||||
//文件
|
||||
sb.AppendLine(" <el-col :span=\"24\">");
|
||||
sb.AppendLine($" <el-form-item label=\"{labelName}\" prop=\"{columnName}\">");
|
||||
sb.AppendLine($@" <UploadFile v-model=""form.{columnName}"" column=""{columnName}"" @input=""handleUploadSuccess"" />");
|
||||
sb.AppendLine(" </el-form-item>");
|
||||
sb.AppendLine(" </el-col>");
|
||||
}
|
||||
else if (dbFieldInfo.HtmlType == GenConstants.HTML_RADIO)
|
||||
{
|
||||
//单选按钮
|
||||
sb.AppendLine(" <el-col :span=\"12\">");
|
||||
sb.AppendLine($" <el-form-item label=\"{labelName}\" :label-width=\"labelWidth\" prop=\"{columnName}\">");
|
||||
sb.AppendLine($" <el-form-item label=\"{labelName}\" prop=\"{columnName}\">");
|
||||
sb.AppendLine($" <el-radio-group v-model=\"form.{columnName}\">");
|
||||
if (string.IsNullOrEmpty(dbFieldInfo.DictType))
|
||||
{
|
||||
sb.AppendLine(" <el-radio :label=\"1\">请选择字典生成</el-radio>");
|
||||
}
|
||||
sb.AppendLine($" <el-radio v-for=\"item in {columnName}Options\" :key=\"item.dictValue\" :label=\"{value}\">{{{{item.dictLabel}}}}</el-radio>");
|
||||
sb.AppendLine(" </el-radio-group>");
|
||||
sb.AppendLine(" </el-form-item>");
|
||||
sb.AppendLine(" </el-col>");
|
||||
}
|
||||
else if (dbFieldInfo.HtmlType == GenConstants.HTML_TEXTAREA)
|
||||
{
|
||||
//文本域
|
||||
sb.AppendLine(" <el-col :span=\"24\">");
|
||||
sb.AppendLine($" <el-form-item label=\"{ labelName}\" :label-width=\"labelWidth\" prop=\"{columnName}\">");
|
||||
sb.AppendLine($" <el-input type=\"textarea\" v-model=\"form.{columnName}\" placeholder=\"请输入内容\"/>");
|
||||
sb.AppendLine($" <el-form-item label=\"{ labelName}\" prop=\"{columnName}\">");
|
||||
sb.AppendLine($" <el-input type=\"textarea\" v-model=\"form.{columnName}\" placeholder=\"请输入{labelName}\"/>");
|
||||
sb.AppendLine(" </el-form-item>");
|
||||
sb.AppendLine(" </el-col>");
|
||||
}
|
||||
else if (dbFieldInfo.HtmlType == GenConstants.HTML_EDITOR)
|
||||
{
|
||||
//编辑器
|
||||
sb.AppendLine(" <el-col :span=\"24\">");
|
||||
sb.AppendLine($" <el-form-item label=\"{labelName}\" :label-width=\"labelWidth\" prop=\"{columnName}\">");
|
||||
sb.AppendLine($" <el-form-item label=\"{labelName}\" prop=\"{columnName}\">");
|
||||
sb.AppendLine($" <editor v-model=\"form.{columnName}\" :min-height=\"200\" />");
|
||||
sb.AppendLine(" </el-form-item>");
|
||||
sb.AppendLine(" </el-col>");
|
||||
}
|
||||
else if (dbFieldInfo.HtmlType == GenConstants.HTML_SELECT && !string.IsNullOrEmpty(dbFieldInfo.DictType))
|
||||
else if (dbFieldInfo.HtmlType == GenConstants.HTML_SELECT)
|
||||
{
|
||||
//下拉框
|
||||
sb.AppendLine(" <el-col :span=\"12\">");
|
||||
sb.AppendLine($" <el-form-item label=\"{labelName}\" :label-width=\"labelWidth\" prop=\"{columnName}\">");
|
||||
sb.AppendLine($" <el-form-item label=\"{labelName}\" prop=\"{columnName}\">");
|
||||
sb.AppendLine($" <el-select v-model=\"form.{columnName}\" placeholder=\"请选择{labelName}\"> ");
|
||||
sb.AppendLine($" <el-option v-for=\"item in {columnName}Options\" :key=\"item.dictValue\" :label=\"item.dictLabel\" :value=\"{value}\"></el-option>");
|
||||
sb.AppendLine(" </el-select>");
|
||||
sb.AppendLine(" </el-form-item>");
|
||||
sb.AppendLine(" </el-col>");
|
||||
}
|
||||
else if (dbFieldInfo.HtmlType == GenConstants.HTML_SELECT && string.IsNullOrEmpty(dbFieldInfo.DictType))
|
||||
if (string.IsNullOrEmpty(dbFieldInfo.DictType))
|
||||
{
|
||||
sb.AppendLine(" <el-col :span=\"12\">");
|
||||
sb.AppendLine($" <el-form-item label=\"{labelName}\" :label-width=\"labelWidth\" prop=\"{columnName}\">");
|
||||
sb.AppendLine($" <el-select v-model=\"form.{columnName}\">");
|
||||
sb.AppendLine($" <el-option label=\"请选择字典生成\"></el-option>");
|
||||
sb.AppendLine($" <el-option label=\"请选择字典生成\" value=\"\"></el-option>");
|
||||
}
|
||||
sb.AppendLine($" <el-option v-for=\"item in {columnName}Options\" :key=\"item.dictValue\" :label=\"item.dictLabel\" :value=\"{value}\"></el-option>");
|
||||
sb.AppendLine(" </el-select>");
|
||||
sb.AppendLine(" </el-form-item>");
|
||||
sb.AppendLine(" </el-col>");
|
||||
@ -169,7 +122,7 @@ namespace ZR.CodeGenerator
|
||||
{
|
||||
string inputNumTxt = CodeGeneratorTool.IsNumber(dbFieldInfo.CsharpType) ? ".number" : "";
|
||||
sb.AppendLine(" <el-col :span=\"12\">");
|
||||
sb.AppendLine($" <el-form-item label=\"{labelName}\" :label-width=\"labelWidth\" prop=\"{columnName}\">");
|
||||
sb.AppendLine($" <el-form-item label=\"{labelName}\" prop=\"{columnName}\">");
|
||||
sb.AppendLine($" <el-input v-model{inputNumTxt}=\"form.{columnName}\" placeholder=\"请输入{labelName}\" {labelDisabled}/>");
|
||||
sb.AppendLine(" </el-form-item>");
|
||||
sb.AppendLine(" </el-col>");
|
||||
@ -187,7 +140,7 @@ namespace ZR.CodeGenerator
|
||||
{
|
||||
StringBuilder sb = new();
|
||||
string labelName = CodeGeneratorTool.GetLabelName(dbFieldInfo.ColumnComment, dbFieldInfo.ColumnName);
|
||||
if (!dbFieldInfo.IsQuery || dbFieldInfo.HtmlType == GenConstants.HTML_FILE_UPLOAD) return sb.ToString();
|
||||
if (!dbFieldInfo.IsQuery) return sb.ToString();
|
||||
if (dbFieldInfo.HtmlType == GenConstants.HTML_DATETIME)
|
||||
{
|
||||
sb.AppendLine($" <el-form-item label=\"{labelName}\">");
|
||||
@ -195,28 +148,19 @@ namespace ZR.CodeGenerator
|
||||
sb.AppendLine($" end-placeholder=\"结束日期\" placeholder=\"请选择{dbFieldInfo.ColumnComment}\" ></el-date-picker>");
|
||||
sb.AppendLine(" </el-form-item>");
|
||||
}
|
||||
else if ((dbFieldInfo.HtmlType == GenConstants.HTML_SELECT || dbFieldInfo.HtmlType == GenConstants.HTML_RADIO) && !string.IsNullOrEmpty(dbFieldInfo.DictType))
|
||||
else if ((dbFieldInfo.HtmlType == GenConstants.HTML_SELECT || dbFieldInfo.HtmlType == GenConstants.HTML_RADIO))
|
||||
{
|
||||
//string value = CodeGeneratorTool.IsNumber(dbFieldInfo.CsharpType) ? "parseInt(item.dictValue)" : "item.dictValue";
|
||||
sb.AppendLine($" <el-form-item label=\"{ labelName}\" :label-width=\"labelWidth\" prop=\"{dbFieldInfo.ColumnName}\">");
|
||||
sb.AppendLine($" <el-select v-model=\"queryParams.{dbFieldInfo.ColumnName}\"> placeholder=\"请选择{dbFieldInfo.ColumnComment}\" size=\"small\"");
|
||||
sb.AppendLine($" <el-option v-for=\"item in {dbFieldInfo.ColumnName}Options\" :key=\"item.dictValue\" :label=\"item.dictLabel\" :value=\"item.dictValue\"></el-option>");
|
||||
sb.AppendLine(" </el-select>");
|
||||
sb.AppendLine(" </el-form-item>");
|
||||
}
|
||||
else if (dbFieldInfo.HtmlType == GenConstants.HTML_SELECT)
|
||||
{
|
||||
//string value = CodeGeneratorTool.IsNumber(dbFieldInfo.CsharpType) ? "parseInt(item.dictValue)" : "item.dictValue";
|
||||
sb.AppendLine($" <el-form-item label=\"{ labelName}\" :label-width=\"labelWidth\" prop=\"{dbFieldInfo.ColumnName}\">");
|
||||
sb.AppendLine($" <el-form-item label=\"{ labelName}\" prop=\"{dbFieldInfo.ColumnName}\">");
|
||||
sb.AppendLine($" <el-select v-model=\"queryParams.{dbFieldInfo.ColumnName}\" placeholder=\"请选择{dbFieldInfo.ColumnComment}\" size=\"small\" >");
|
||||
sb.AppendLine($" <el-option v-for=\"item in {dbFieldInfo.ColumnName}Options\" :key=\"item.dictValue\" :label=\"item.dictLabel\" :value=\"item.dictValue\"></el-option>");
|
||||
sb.AppendLine(" </el-select>");
|
||||
sb.AppendLine(" </el-form-item>");
|
||||
}
|
||||
else
|
||||
else if(dbFieldInfo.IsQuery)
|
||||
{
|
||||
string inputNumTxt = CodeGeneratorTool.IsNumber(dbFieldInfo.CsharpType) ? ".number" : "";
|
||||
sb.AppendLine($" <el-form-item label=\"{ labelName}\" :label-width=\"labelWidth\">");
|
||||
sb.AppendLine($" <el-form-item label=\"{ labelName}\" prop=\"{dbFieldInfo.ColumnName}\">");
|
||||
sb.AppendLine($" <el-input v-model{inputNumTxt}=\"queryParams.{dbFieldInfo.ColumnName}\" placeholder=\"请输入{dbFieldInfo.ColumnComment}\" size=\"small\"/>");
|
||||
sb.AppendLine(" </el-form-item>");
|
||||
}
|
||||
@ -235,11 +179,10 @@ namespace ZR.CodeGenerator
|
||||
string columnName = dbFieldInfo.ColumnName;
|
||||
string label = CodeGeneratorTool.GetLabelName(dbFieldInfo.ColumnComment, columnName);
|
||||
string showToolTip = dbFieldInfo.CsharpType == "string" ? ":show-overflow-tooltip=\"true\"" : "";
|
||||
string formatter = !string.IsNullOrEmpty(dbFieldInfo.DictType) ? $" :formatter=\"{columnName}Format\"" : "";
|
||||
string formatter = GetFormatter(dbFieldInfo.HtmlType, columnName);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
var sortField = genTable?.SortField ?? "";
|
||||
//有排序字段
|
||||
if (!string.IsNullOrEmpty(sortField.ToString()) && sortField.ToString() == dbFieldInfo.CsharpField && !dbFieldInfo.IsPk && CodeGeneratorTool.IsNumber(dbFieldInfo.CsharpType))
|
||||
//自定义排序字段
|
||||
if (GenConstants.HTML_SORT.Equals(dbFieldInfo.HtmlType) && !dbFieldInfo.IsPk && CodeGeneratorTool.IsNumber(dbFieldInfo.CsharpType))
|
||||
{
|
||||
sb.AppendLine($@" <el-table-column prop=""{columnName}"" label=""{label}"" width=""90"" sortable align=""center"">");
|
||||
sb.AppendLine(@" <template slot-scope=""scope"">");
|
||||
@ -256,6 +199,21 @@ namespace ZR.CodeGenerator
|
||||
sb.AppendLine(" </template>");
|
||||
sb.AppendLine(" </el-table-column>");
|
||||
}
|
||||
else if (dbFieldInfo.IsList && !string.IsNullOrEmpty(dbFieldInfo.DictType))
|
||||
{
|
||||
sb.AppendLine($@" <el-table-column label=""{label}"" align=""center"" prop=""{columnName}"">");
|
||||
sb.AppendLine(@" <template slot-scope=""scope"">");
|
||||
if (dbFieldInfo.HtmlType == GenConstants.HTML_CHECKBOX)
|
||||
{
|
||||
sb.AppendLine($@" <dict-tag :options=""{columnName}Options"" :value=""scope.row.{columnName} ? scope.row.{columnName}.split(',') : []""/>");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendLine($@" <dict-tag :options=""{columnName}Options"" :value=""scope.row.{columnName}""/>");
|
||||
}
|
||||
sb.AppendLine(@" </template>");
|
||||
sb.AppendLine(@" </el-table-column>");
|
||||
}
|
||||
else if (dbFieldInfo.IsList)
|
||||
{
|
||||
sb.AppendLine($" <el-table-column prop=\"{columnName}\" label=\"{label}\" align=\"center\" {showToolTip}{formatter}/>");
|
||||
@ -264,7 +222,7 @@ namespace ZR.CodeGenerator
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
//模板调用
|
||||
public static string QueryExp(string propertyName, string queryType)
|
||||
{
|
||||
if (queryType.Equals("EQ"))
|
||||
@ -297,5 +255,21 @@ namespace ZR.CodeGenerator
|
||||
}
|
||||
return "";
|
||||
}
|
||||
/// <summary>
|
||||
/// 格式化字典数据显示到table
|
||||
/// </summary>
|
||||
/// <param name="htmlType"></param>
|
||||
/// <param name="columnName"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetFormatter(string htmlType, string columnName)
|
||||
{
|
||||
if (htmlType.Equals(GenConstants.HTML_CHECKBOX) ||
|
||||
htmlType.Equals(GenConstants.HTML_SELECT) ||
|
||||
htmlType.Equals(GenConstants.HTML_RADIO))
|
||||
{
|
||||
return $" :formatter=\"{columnName}Format\"";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ using ZR.Model.System.Generate;
|
||||
namespace ZR.CodeGenerator
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成器。
|
||||
/// 代码生成器
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public class CodeGeneratorTool
|
||||
@ -52,24 +52,27 @@ namespace ZR.CodeGenerator
|
||||
replaceDto.ModelTypeName = dto.GenTable.ClassName;//表名对应C# 实体类名
|
||||
replaceDto.PermissionPrefix = $"{dto.GenTable.ModuleName}:{dto.GenTable.ClassName.ToLower()}";//权限
|
||||
replaceDto.Author = dto.GenTable.FunctionAuthor;
|
||||
replaceDto.ShowBtnAdd = dto.CheckedBtn.Any(f => f == 1);
|
||||
replaceDto.ShowBtnEdit = dto.CheckedBtn.Any(f => f == 2);
|
||||
replaceDto.ShowBtnDelete = dto.CheckedBtn.Any(f => f == 3);
|
||||
replaceDto.ShowBtnExport = dto.CheckedBtn.Any(f => f == 4);
|
||||
|
||||
//循环表字段信息
|
||||
foreach (GenTableColumn dbFieldInfo in dto.GenTable.Columns)
|
||||
foreach (GenTableColumn dbFieldInfo in dto.GenTable.Columns.OrderBy(x => x.Sort))
|
||||
{
|
||||
if (dbFieldInfo.IsPk || dbFieldInfo.IsIncrement)
|
||||
{
|
||||
PKName = dbFieldInfo.CsharpField;
|
||||
PKType = dbFieldInfo.CsharpType;
|
||||
}
|
||||
if (dbFieldInfo.HtmlType.Equals(GenConstants.HTML_IMAGE_UPLOAD))
|
||||
if (dbFieldInfo.HtmlType.Equals(GenConstants.HTML_IMAGE_UPLOAD) || dbFieldInfo.HtmlType.Equals(GenConstants.HTML_FILE_UPLOAD))
|
||||
{
|
||||
replaceDto.UploadFile = 1;
|
||||
}
|
||||
CodeGenerateTemplate.GetQueryDtoProperty(dbFieldInfo, replaceDto);
|
||||
//CodeGenerateTemplate.GetQueryDtoProperty(dbFieldInfo, replaceDto);
|
||||
|
||||
replaceDto.VueViewFormHtml += CodeGenerateTemplate.TplVueFormContent(dbFieldInfo);
|
||||
replaceDto.VueViewListHtml += CodeGenerateTemplate.TplTableColumn(dbFieldInfo, dto.GenTable);
|
||||
replaceDto.VueViewEditFormRuleContent += CodeGenerateTemplate.TplFormRules(dbFieldInfo);
|
||||
replaceDto.VueQueryFormHtml += CodeGenerateTemplate.TplQueryFormHtml(dbFieldInfo);
|
||||
}
|
||||
|
||||
@ -104,13 +107,12 @@ namespace ZR.CodeGenerator
|
||||
/// <param name="replaceDto">替换实体</param>
|
||||
private static void GenerateModels(ReplaceDto replaceDto, GenerateDto generateDto)
|
||||
{
|
||||
// ../ZR.Model/Models/User.cs
|
||||
var fullPath = Path.Combine(generateDto.GenCodePath, _option.ModelsNamespace, "Models", replaceDto.ModelTypeName + ".cs");
|
||||
var fullPath = Path.Combine(generateDto.GenCodePath, _option.ModelsNamespace, "Models", generateDto.GenTable.ModuleName, replaceDto.ModelTypeName + ".cs");
|
||||
|
||||
var tpl = FileHelper.ReadJtTemplate("TplModel.txt");
|
||||
var result = tpl.Render();
|
||||
|
||||
generateDto.GenCodes.Add(new GenCode(1, "Model", fullPath, result));
|
||||
generateDto.GenCodes.Add(new GenCode(1, "Model.cs", fullPath, result));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -120,12 +122,11 @@ namespace ZR.CodeGenerator
|
||||
/// <param name="replaceDto">替换实体</param>
|
||||
private static void GenerateInputDto(ReplaceDto replaceDto, GenerateDto generateDto)
|
||||
{
|
||||
var fullPath = Path.Combine(generateDto.GenCodePath, _option.ModelsNamespace, "Dto", $"{replaceDto.ModelTypeName}Dto.cs");
|
||||
|
||||
var fullPath = Path.Combine(generateDto.GenCodePath, _option.ModelsNamespace, "Dto", generateDto.GenTable.ModuleName, $"{replaceDto.ModelTypeName}Dto.cs");
|
||||
var tpl = FileHelper.ReadJtTemplate("TplDto.txt");
|
||||
|
||||
var result = tpl.Render();
|
||||
generateDto.GenCodes.Add(new GenCode(2, "Dto", fullPath, result));
|
||||
generateDto.GenCodes.Add(new GenCode(2, "Dto.cs", fullPath, result));
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -142,7 +143,7 @@ namespace ZR.CodeGenerator
|
||||
var tpl = FileHelper.ReadJtTemplate("TplRepository.txt");
|
||||
|
||||
var result = tpl.Render();
|
||||
generateDto.GenCodes.Add(new GenCode(3, "Repository", fullPath, result));
|
||||
generateDto.GenCodes.Add(new GenCode(3, "Repository.cs", fullPath, result));
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -156,15 +157,13 @@ namespace ZR.CodeGenerator
|
||||
{
|
||||
var fullPath = Path.Combine(generateDto.GenCodePath, _option.ServicesNamespace, "Business", $"{replaceDto.ModelTypeName}Service.cs");
|
||||
var tpl = FileHelper.ReadJtTemplate("TplService.txt");
|
||||
|
||||
var result = tpl.Render();
|
||||
generateDto.GenCodes.Add(new GenCode(4, "Service", fullPath, result));
|
||||
generateDto.GenCodes.Add(new GenCode(4, "Service.cs", fullPath, result));
|
||||
|
||||
var fullPath2 = Path.Combine(generateDto.GenCodePath, _option.IServicsNamespace, "Business", "IBusService", $"I{replaceDto.ModelTypeName}Service.cs");
|
||||
var tpl2 = FileHelper.ReadJtTemplate("TplIService.txt");
|
||||
|
||||
var result2 = tpl2.Render();
|
||||
generateDto.GenCodes.Add(new GenCode(4, "IService", fullPath2, result2));
|
||||
generateDto.GenCodes.Add(new GenCode(4, "IService.cs", fullPath2, result2));
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -180,7 +179,7 @@ namespace ZR.CodeGenerator
|
||||
|
||||
tpl.Set("QueryCondition", replaceDto.QueryCondition);
|
||||
var result = tpl.Render();
|
||||
generateDto.GenCodes.Add(new GenCode(5, "Controller", fullPath, result));
|
||||
generateDto.GenCodes.Add(new GenCode(5, "Controller.cs", fullPath, result));
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -264,7 +263,7 @@ namespace ZR.CodeGenerator
|
||||
{
|
||||
if (!string.IsNullOrEmpty(searcList[i].ToString()))
|
||||
{
|
||||
tableName = tableName.Replace(searcList[i], "");
|
||||
tableName = tableName.Replace(searcList[i], "", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -278,11 +277,11 @@ namespace ZR.CodeGenerator
|
||||
/// <returns>业务名</returns>
|
||||
public static string GetBusinessName(string tableName)
|
||||
{
|
||||
int lastIndex = tableName.IndexOf("_");//_前缀长度
|
||||
int nameLength = tableName.Length;
|
||||
int subLength = (nameLength - lastIndex) - 1;
|
||||
string businessName = tableName[(lastIndex + 1)..];
|
||||
return businessName.Replace("_", "").ToLower();
|
||||
//int firstIndex = tableName.IndexOf("_");//_前缀长度
|
||||
//int nameLength = tableName.Length;
|
||||
//int subLength = (nameLength - lastIndex) - 1;
|
||||
//string businessName = tableName[(lastIndex + 1)..];
|
||||
return tableName.Substring(0, 1).ToUpper() + tableName[1..].Replace("_", "");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -414,8 +413,8 @@ namespace ZR.CodeGenerator
|
||||
/// <param name="replaceDto"></param>
|
||||
private static void InitJntTemplate(GenerateDto dto, ReplaceDto replaceDto)
|
||||
{
|
||||
Engine.Current.Clean();
|
||||
|
||||
//Engine.Current.Clean();
|
||||
dto.GenTable.Columns = dto.GenTable.Columns.OrderBy(x => x.Sort).ToList();
|
||||
//jnt模板引擎全局变量
|
||||
Engine.Configure((options) =>
|
||||
{
|
||||
@ -429,9 +428,12 @@ namespace ZR.CodeGenerator
|
||||
options.Data.Set("replaceDto", replaceDto);
|
||||
options.Data.Set("options", dto.GenOptions);
|
||||
options.Data.Set("genTable", dto.GenTable);
|
||||
options.Data.Set("btns", dto.CheckedBtn);
|
||||
options.Data.Set("tool", new CodeGeneratorTool());
|
||||
options.Data.Set("codeTool", new CodeGenerateTemplate());
|
||||
options.EnableCache = true;
|
||||
//...其它数据
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,14 +14,14 @@ namespace ZR.CodeGenerator
|
||||
/// </summary>
|
||||
public class DbProvider
|
||||
{
|
||||
protected static SqlSugarScope CodeDb;
|
||||
protected static SqlSugarClient CodeDb;
|
||||
|
||||
/// <summary>
|
||||
/// 获取动态连接字符串
|
||||
/// </summary>
|
||||
/// <param name="dbName">数据库名</param>
|
||||
/// <returns></returns>
|
||||
public SqlSugarScope GetSugarDbContext(string dbName = "")
|
||||
public SqlSugarClient GetSugarDbContext(string dbName = "")
|
||||
{
|
||||
string connStr = ConfigUtils.Instance.GetConfig(GenConstants.Gen_conn);
|
||||
int dbType = ConfigUtils.Instance.GetAppConfig(GenConstants.Gen_conn_dbType, 0);
|
||||
@ -31,7 +31,7 @@ namespace ZR.CodeGenerator
|
||||
string replaceStr = GetValue(connStr, "database=", ";");
|
||||
connStr = connStr.Replace(replaceStr, dbName);
|
||||
}
|
||||
var db = new SqlSugarScope(new List<ConnectionConfig>()
|
||||
var db = new SqlSugarClient(new List<ConnectionConfig>()
|
||||
{
|
||||
new ConnectionConfig(){
|
||||
ConnectionString = connStr,
|
||||
|
||||
@ -130,7 +130,7 @@ namespace ZR.CodeGenerator
|
||||
try
|
||||
{
|
||||
//生成压缩包
|
||||
string zipReturnFileName = dto.GenTable.BaseNameSpace + DateTime.Now.ToString("yyyyMMddHHmmss") + ".zip";
|
||||
string zipReturnFileName = "ZrAdmin.NET" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".zip";
|
||||
|
||||
CreateDirectory(dto.GenCodePath);
|
||||
string zipFileName = Path.Combine(dto.ZipPath, zipReturnFileName);
|
||||
@ -187,7 +187,7 @@ namespace ZR.CodeGenerator
|
||||
}
|
||||
catch (Exception ex) // 异常处理
|
||||
{
|
||||
//Log4NetHelper.Error("代码生成异常", ex);
|
||||
Console.WriteLine("代码生成异常" + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -109,6 +109,12 @@ namespace ZR.CodeGenerator
|
||||
|
||||
/** 富文本控件 */
|
||||
public static string HTML_EDITOR = "editor";
|
||||
// 自定义排序
|
||||
public static string HTML_SORT = "sort";
|
||||
//颜色选择器
|
||||
public static string HTML_COLORPICKER = "colorPicker";
|
||||
//switch开关
|
||||
public static string HTML_SWITCH { get; set; }
|
||||
|
||||
/** 字符串类型 */
|
||||
public static string TYPE_STRING = "string";
|
||||
|
||||
@ -14,6 +14,10 @@ namespace ZR.CodeGenerator.Model
|
||||
/// 生成代码的数据库类型 0、mysql 1、sqlserver
|
||||
/// </summary>
|
||||
public int DbType { get; set; }
|
||||
/// <summary>
|
||||
/// 生成的按钮功能
|
||||
/// </summary>
|
||||
public int[] CheckedBtn { get; set; }
|
||||
public GenTable GenTable { get; set; }
|
||||
public CodeGenerateOption GenOptions { get; set; }
|
||||
#region 存储路径
|
||||
|
||||
@ -25,7 +25,7 @@ namespace ZR.CodeGenerator.Model
|
||||
/// </summary>
|
||||
public string ModelTypeName { get; set; }
|
||||
//vue、api
|
||||
public string VueViewFormResetHtml { get; set; }
|
||||
//public string VueViewFormResetHtml { get; set; }
|
||||
/// <summary>
|
||||
/// 前端列表查询html
|
||||
/// </summary>
|
||||
@ -47,7 +47,10 @@ namespace ZR.CodeGenerator.Model
|
||||
/// 查询条件
|
||||
/// </summary>
|
||||
public string QueryCondition { get; set; } = "";
|
||||
|
||||
public bool ShowBtnExport { get; set; }
|
||||
public bool ShowBtnAdd { get; set; }
|
||||
public bool ShowBtnEdit { get; set; }
|
||||
public bool ShowBtnDelete { get; set; }
|
||||
/// <summary>
|
||||
/// 上传URL data
|
||||
/// </summary>
|
||||
|
||||
@ -14,7 +14,7 @@ namespace ZR.CodeGenerator.Service
|
||||
public List<string> GetAllDataBases()
|
||||
{
|
||||
var db = GetSugarDbContext();
|
||||
var templist = db.DbMaintenance.GetDataBaseList(db.ScopedContext);
|
||||
var templist = db.DbMaintenance.GetDataBaseList(db);
|
||||
|
||||
return templist;
|
||||
}
|
||||
|
||||
@ -64,31 +64,26 @@ namespace ZR.Repository.System
|
||||
/// <returns></returns>
|
||||
public int UpdateGenTableColumn(List<GenTableColumn> tableColumn)
|
||||
{
|
||||
foreach (var item in tableColumn)
|
||||
return Context.Updateable(tableColumn)
|
||||
.WhereColumns(it => new { it.ColumnId, it.TableId})
|
||||
.UpdateColumns(it => new
|
||||
{
|
||||
Context.Updateable<GenTableColumn>()
|
||||
.Where(f => f.TableId == item.TableId)
|
||||
.SetColumns(it => new GenTableColumn()
|
||||
{
|
||||
ColumnComment = item.ColumnComment,
|
||||
CsharpField = item.CsharpField,
|
||||
CsharpType = item.CsharpType,
|
||||
IsQuery = item.IsQuery,
|
||||
IsEdit = item.IsEdit,
|
||||
IsInsert = item.IsInsert,
|
||||
IsList = item.IsList,
|
||||
QueryType = item.QueryType,
|
||||
HtmlType = item.HtmlType,
|
||||
IsRequired = item.IsRequired,
|
||||
Sort = item.Sort,
|
||||
Update_time = DateTime.Now,
|
||||
DictType = item.DictType
|
||||
it.ColumnComment,
|
||||
it.CsharpField,
|
||||
it.CsharpType,
|
||||
it.IsQuery,
|
||||
it.IsEdit,
|
||||
it.IsInsert,
|
||||
it.IsList,
|
||||
it.QueryType,
|
||||
it.HtmlType,
|
||||
it.IsRequired,
|
||||
it.Sort,
|
||||
it.Update_time,
|
||||
it.DictType,
|
||||
it.Update_by
|
||||
})
|
||||
.Where(f => f.ColumnId == item.ColumnId)
|
||||
.ExecuteCommand();
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,7 +5,13 @@ namespace ZR.Service.System.IService
|
||||
{
|
||||
public interface ISysFileService
|
||||
{
|
||||
(bool, string) SaveFile(string picdir, IFormFile formFile);
|
||||
/// <summary>
|
||||
/// 上传文件
|
||||
/// </summary>
|
||||
/// <param name="picdir"></param>
|
||||
/// <param name="formFile"></param>
|
||||
/// <returns>结果、地址、文件名</returns>
|
||||
(bool, string, string) SaveFile(string picdir, IFormFile formFile);
|
||||
|
||||
/// <summary>
|
||||
/// 按时间来创建文件夹
|
||||
|
||||
@ -25,7 +25,7 @@ namespace ZR.Service.System
|
||||
/// <param name="picdir"></param>
|
||||
/// <param name="formFile"></param>
|
||||
/// <returns></returns>
|
||||
public (bool, string) SaveFile(string picdir, IFormFile formFile)
|
||||
public (bool, string, string) SaveFile(string picdir, IFormFile formFile)
|
||||
{
|
||||
// eg: idcard/2020/08/18
|
||||
string dir = GetdirPath(picdir.ToString());
|
||||
@ -36,11 +36,7 @@ namespace ZR.Service.System
|
||||
|
||||
HttpStatusCode statusCode = AliyunOssHelper.PutObjectFromFile(formFile.OpenReadStream(), Path.Combine(dir, fileName));
|
||||
|
||||
if (statusCode == HttpStatusCode.OK)
|
||||
{
|
||||
return (true, webUrl);
|
||||
}
|
||||
return (false, "");
|
||||
return (statusCode == HttpStatusCode.OK, webUrl, fileName);
|
||||
}
|
||||
|
||||
public string GetdirPath(string path = "")
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
# 关于此文件说明 必须以VUE_APP开头
|
||||
# 开发环境配置
|
||||
ENV = 'development'
|
||||
|
||||
# ZR管理系统/开发环境
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = ZrAdmin.NET管理系统
|
||||
|
||||
# 开发环境
|
||||
VUE_APP_BASE_API = '/dev-api'
|
||||
|
||||
# 路由前缀
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
# 生产环境配置
|
||||
ENV = 'production'
|
||||
|
||||
# ZR管理系统/生产环境
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = ZrAdmin.NET管理系统
|
||||
|
||||
# 生产环境
|
||||
VUE_APP_BASE_API = '/prod-api'
|
||||
|
||||
# 路由前缀
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
# 测试环境配置
|
||||
ENV = 'staging'
|
||||
|
||||
# ZR管理系统/生产环境
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = ZrAdmin.NET管理系统
|
||||
|
||||
# 测试环境
|
||||
VUE_APP_BASE_API = '/stage-api'
|
||||
|
||||
# 路由前缀
|
||||
|
||||
@ -6,6 +6,6 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'App'
|
||||
}
|
||||
name: "App",
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -95,10 +95,11 @@ export function updateGenTable(data) {
|
||||
}
|
||||
|
||||
// 预览生成代码
|
||||
export function previewTable(tableId) {
|
||||
export function previewTable(tableId, data) {
|
||||
return request({
|
||||
url: '/tool/gen/preview/' + tableId,
|
||||
method: 'get'
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 173 KiB After Width: | Height: | Size: 207 KiB |
198
ZR.Vue/src/components/FileUpload/index.vue
Normal file
198
ZR.Vue/src/components/FileUpload/index.vue
Normal file
@ -0,0 +1,198 @@
|
||||
<template>
|
||||
<div class="upload-file">
|
||||
<el-upload :action="uploadFileUrl" :before-upload="handleBeforeUpload" :file-list="fileList" :limit="limit" :on-error="handleUploadError"
|
||||
:on-exceed="handleExceed" :on-success="handleUploadSuccess" :show-file-list="false" :headers="headers" class="upload-file-uploader"
|
||||
ref="upload">
|
||||
<!-- 上传按钮 -->
|
||||
<el-button size="mini" type="primary" icon="el-icon-upload">选取文件</el-button>
|
||||
<!-- 上传提示 -->
|
||||
<div class="el-upload__tip" slot="tip" v-if="showTip">
|
||||
请上传
|
||||
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
|
||||
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
|
||||
的文件
|
||||
</div>
|
||||
</el-upload>
|
||||
|
||||
<!-- 文件列表 -->
|
||||
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
|
||||
<li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
|
||||
<el-link :href="`${file.url}`" :underline="false" target="_blank">
|
||||
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
||||
</el-link>
|
||||
<div class="ele-upload-list__item-content-action">
|
||||
<el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
|
||||
</div>
|
||||
</li>
|
||||
</transition-group>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getToken } from "@/utils/auth";
|
||||
|
||||
export default {
|
||||
name: "FileUpload",
|
||||
props: {
|
||||
// 值
|
||||
value: [String, Object, Array],
|
||||
// 数量限制
|
||||
limit: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
// 大小限制(MB)
|
||||
fileSize: {
|
||||
type: Number,
|
||||
default: 5,
|
||||
},
|
||||
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
||||
fileType: {
|
||||
type: Array,
|
||||
default: () => ["doc", "xls", "ppt", "txt", "pdf", "svga", "json"],
|
||||
},
|
||||
// 是否显示提示
|
||||
isShowTip: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
// 上传地址
|
||||
uploadUrl: {
|
||||
type: String,
|
||||
default: "/Common/UploadFile",
|
||||
},
|
||||
column: [String],
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
baseUrl: process.env.VUE_APP_BASE_API,
|
||||
uploadFileUrl: process.env.VUE_APP_BASE_API + this.uploadUrl, // 上传的图片服务器地址
|
||||
headers: {
|
||||
Authorization: "Bearer " + getToken(),
|
||||
},
|
||||
fileList: [],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value: {
|
||||
handler(val) {
|
||||
if (val) {
|
||||
let temp = 1;
|
||||
// 首先将值转为数组
|
||||
const list = Array.isArray(val) ? val : this.value.split(",");
|
||||
// 然后将数组转为对象数组
|
||||
this.fileList = list.map((item) => {
|
||||
if (typeof item === "string") {
|
||||
item = { name: item, url: item };
|
||||
}
|
||||
item.uid = item.uid || new Date().getTime() + temp++;
|
||||
return item;
|
||||
});
|
||||
} else {
|
||||
this.fileList = [];
|
||||
return [];
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
// 是否显示提示
|
||||
showTip() {
|
||||
return this.isShowTip && (this.fileType || this.fileSize);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 上传前校检格式和大小
|
||||
handleBeforeUpload(file) {
|
||||
// 校检文件类型
|
||||
if (this.fileType) {
|
||||
let fileExtension = "";
|
||||
if (file.name.lastIndexOf(".") > -1) {
|
||||
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
|
||||
}
|
||||
const isTypeOk = this.fileType.some((type) => {
|
||||
if (file.type.indexOf(type) > -1) return true;
|
||||
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
|
||||
return false;
|
||||
});
|
||||
if (!isTypeOk) {
|
||||
this.msgError(
|
||||
`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// 校检文件大小
|
||||
if (this.fileSize) {
|
||||
const isLt = file.size / 1024 / 1024 < this.fileSize;
|
||||
if (!isLt) {
|
||||
this.msgError(`上传文件大小不能超过 ${this.fileSize} MB!`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
// 文件个数超出
|
||||
handleExceed() {
|
||||
this.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
|
||||
},
|
||||
// 上传失败
|
||||
handleUploadError(err) {
|
||||
this.msgError("上传失败, 请重试");
|
||||
},
|
||||
// 上传成功回调
|
||||
handleUploadSuccess(res, file) {
|
||||
this.msgSuccess("上传成功");
|
||||
console.log(res.data.fileName, res.data.url);
|
||||
this.fileList.push({ name: res.data.fileName, url: res.data.url });
|
||||
|
||||
this.$emit("input", this.column, this.listToString(this.fileList));
|
||||
},
|
||||
// 删除文件
|
||||
handleDelete(index) {
|
||||
this.fileList.splice(index, 1);
|
||||
this.$emit("input", this.column, this.listToString(this.fileList));
|
||||
},
|
||||
// 获取文件名称
|
||||
getFileName(name) {
|
||||
if (name.lastIndexOf("/") > -1) {
|
||||
return name.slice(name.lastIndexOf("/") + 1).toLowerCase();
|
||||
} else {
|
||||
return name;
|
||||
}
|
||||
},
|
||||
// 对象转成指定字符串分隔
|
||||
listToString(list, separator) {
|
||||
let strs = "";
|
||||
separator = separator || ",";
|
||||
for (let i in list) {
|
||||
strs += list[i].url + separator;
|
||||
}
|
||||
return strs != "" ? strs.substr(0, strs.length - 1) : "";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.upload-file-uploader {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.upload-file-list .el-upload-list__item {
|
||||
border: 1px solid #e4e7ed;
|
||||
line-height: 2;
|
||||
margin-bottom: 10px;
|
||||
position: relative;
|
||||
}
|
||||
.upload-file-list .ele-upload-list__item-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
color: inherit;
|
||||
}
|
||||
.ele-upload-list__item-content-action .el-link {
|
||||
margin-right: 10px;
|
||||
}
|
||||
</style>
|
||||
@ -1,10 +1,21 @@
|
||||
<template>
|
||||
<div class="component-upload-image">
|
||||
<el-upload :action="uploadImgUrl" :on-success="handleUploadSuccess" :before-upload="handleBeforeUpload" :on-error="handleUploadError" name="file"
|
||||
:show-file-list="false" :headers="headers" style="display: inline-block; vertical-align: top">
|
||||
<el-image v-if="imageUrl" :src="imageUrl" class="icon" />
|
||||
<i v-else class="el-icon-plus uploader-icon"></i>
|
||||
<el-upload list-type="picture-card" :action="uploadImgUrl" :on-success="handleUploadSuccess" :before-upload="handleBeforeUpload"
|
||||
:on-exceed="handleExceed" :on-remove="handleRemove" :on-error="handleUploadError" name="file" :show-file-list="true" :limit="limit"
|
||||
:file-list="fileList" :on-preview="handlePictureCardPreview" :class="{hide: this.fileList.length >= this.limit}" :headers="headers">
|
||||
<i class="el-icon-plus"></i>
|
||||
|
||||
<!-- 上传提示 -->
|
||||
<div class="el-upload__tip" slot="tip" v-if="showTip">
|
||||
请上传
|
||||
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
|
||||
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
|
||||
的文件
|
||||
</div>
|
||||
</el-upload>
|
||||
<el-dialog :visible.sync="dialogVisible" title="预览" width="800" append-to-body>
|
||||
<img :src="dialogImageUrl" style="display: block; max-width: 100%; margin: 0 auto" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -12,50 +23,100 @@
|
||||
import { getToken } from "@/utils/auth";
|
||||
|
||||
export default {
|
||||
name: "UploadImage",
|
||||
data() {
|
||||
return {
|
||||
uploadImgUrl: process.env.VUE_APP_BASE_API + this.uploadUrl, // 上传的图片服务器地址
|
||||
headers: {
|
||||
Authorization: "Bearer " + getToken(),
|
||||
},
|
||||
imageUrl: "",
|
||||
};
|
||||
},
|
||||
props: {
|
||||
icon: {
|
||||
type: String,
|
||||
value: [String],
|
||||
// 图片数量限制
|
||||
limit: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
// 当前form 列名
|
||||
column: { type: String },
|
||||
column: [String],
|
||||
// 上传地址
|
||||
uploadUrl: {
|
||||
type: String,
|
||||
default: "Common/UploadFile",
|
||||
default: "/Common/UploadFile",
|
||||
},
|
||||
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
||||
fileType: {
|
||||
type: Array,
|
||||
default: () => ["png", "jpg", "jpeg"],
|
||||
default: () => ["png", "jpg", "jpeg", "webp"],
|
||||
},
|
||||
// 大小限制(MB)
|
||||
fileSize: {
|
||||
type: Number,
|
||||
default: 5,
|
||||
},
|
||||
//显示手动输入地址
|
||||
showInput: false,
|
||||
// 是否显示提示
|
||||
isShowTip: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogImageUrl: "",
|
||||
dialogVisible: false,
|
||||
hideUpload: false,
|
||||
uploadImgUrl: process.env.VUE_APP_BASE_API + this.uploadUrl, // 上传的图片服务器地址
|
||||
headers: {
|
||||
Authorization: "Bearer " + getToken(),
|
||||
},
|
||||
imageUrl: "",
|
||||
fileList: [],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
//监听 v-model 的值
|
||||
value: {
|
||||
immediate: true,
|
||||
deep: true,
|
||||
handler: function (val) {
|
||||
if (val) {
|
||||
// 首先将值转为数组
|
||||
const list = Array.isArray(val) ? val : this.value.split(",");
|
||||
// 然后将数组转为对象数组
|
||||
this.fileList = list.map((item) => {
|
||||
if (typeof item === "string") {
|
||||
// if (item.indexOf(this.baseUrl) === -1) {
|
||||
// item = { name: this.baseUrl + item, url: this.baseUrl + item };
|
||||
// } else {
|
||||
item = { name: item, url: item };
|
||||
// }
|
||||
}
|
||||
return item;
|
||||
});
|
||||
} else {
|
||||
this.fileList = [];
|
||||
return [];
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
// 是否显示提示
|
||||
showTip() {
|
||||
return this.isShowTip && (this.fileType || this.fileSize);
|
||||
},
|
||||
mounted() {
|
||||
this.imageUrl = this.icon;
|
||||
},
|
||||
methods: {
|
||||
// 删除图片
|
||||
handleRemove(file, fileList) {
|
||||
const findex = this.fileList.map((f) => f.name).indexOf(file.name);
|
||||
if (findex > -1) {
|
||||
this.fileList.splice(findex, 1);
|
||||
this.$emit("input", this.column, this.listToString(this.fileList));
|
||||
}
|
||||
},
|
||||
//上传成功回调
|
||||
handleUploadSuccess(res) {
|
||||
this.$emit(`handleUploadSuccess`, res, this.column);
|
||||
this.imageUrl = res.data;
|
||||
this.fileList.push({ name: res.data.fileName, url: res.data.url });
|
||||
this.$emit(`input`, this.column, this.listToString(this.fileList));
|
||||
this.loading.close();
|
||||
},
|
||||
// 上传前loading加载
|
||||
handleBeforeUpload(file) {
|
||||
console.log(file)
|
||||
let isImg = false;
|
||||
if (this.fileType.length) {
|
||||
let fileExtension = "";
|
||||
@ -90,6 +151,24 @@ export default {
|
||||
background: "rgba(0, 0, 0, 0.7)",
|
||||
});
|
||||
},
|
||||
// 文件个数超出
|
||||
handleExceed() {
|
||||
this.$message.error(`上传文件数量不能超过 ${this.limit} 个!`);
|
||||
},
|
||||
// 预览
|
||||
handlePictureCardPreview(file) {
|
||||
this.dialogImageUrl = file.url;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
// 对象转成指定字符串分隔
|
||||
listToString(list, separator) {
|
||||
let strs = "";
|
||||
separator = separator || ",";
|
||||
for (let i in list) {
|
||||
strs += list[i].url.replace(this.baseUrl, "") + separator;
|
||||
}
|
||||
return strs != '' ? strs.substr(0, strs.length - 1) : '';
|
||||
},
|
||||
handleUploadError() {
|
||||
this.$message({
|
||||
type: "error",
|
||||
@ -98,13 +177,22 @@ export default {
|
||||
this.loading.close();
|
||||
},
|
||||
},
|
||||
watch: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.avatar {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
::v-deep.hide .el-upload--picture-card {
|
||||
display: none;
|
||||
}
|
||||
// 去掉动画效果
|
||||
::v-deep .el-list-enter-active,
|
||||
::v-deep .el-list-leave-active {
|
||||
transition: all 0s;
|
||||
}
|
||||
|
||||
::v-deep .el-list-enter,
|
||||
.el-list-leave-active {
|
||||
opacity: 0;
|
||||
transform: translateY(0);
|
||||
}
|
||||
</style>
|
||||
@ -10,7 +10,8 @@
|
||||
<div v-if="sideTheme === 'theme-dark'" class="setting-drawer-block-checbox-selectIcon" style="display: block;">
|
||||
<i aria-label="图标: check" class="anticon anticon-check">
|
||||
<svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true" focusable="false" class="">
|
||||
<path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" />
|
||||
<path
|
||||
d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" />
|
||||
</svg>
|
||||
</i>
|
||||
</div>
|
||||
@ -20,7 +21,8 @@
|
||||
<div v-if="sideTheme === 'theme-light'" class="setting-drawer-block-checbox-selectIcon" style="display: block;">
|
||||
<i aria-label="图标: check" class="anticon anticon-check">
|
||||
<svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true" focusable="false" class="">
|
||||
<path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" />
|
||||
<path
|
||||
d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" />
|
||||
</svg>
|
||||
</i>
|
||||
</div>
|
||||
@ -55,6 +57,10 @@
|
||||
<span>显示 Logo</span>
|
||||
<el-switch v-model="sidebarLogo" class="drawer-switch" />
|
||||
</div>
|
||||
<div class="drawer-item">
|
||||
<span>动态标题</span>
|
||||
<el-switch v-model="dynamicTitle" class="drawer-switch" />
|
||||
</div>
|
||||
<el-divider />
|
||||
|
||||
<el-button size="small" type="primary" plain icon="el-icon-document-add" @click="saveSetting">保存配置</el-button>
|
||||
@ -88,18 +94,21 @@ export default {
|
||||
},
|
||||
topNav: {
|
||||
get() {
|
||||
return this.$store.state.settings.topNav
|
||||
return this.$store.state.settings.topNav;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.dispatch('settings/changeSetting', {
|
||||
key: 'topNav',
|
||||
value: val
|
||||
})
|
||||
this.$store.dispatch("settings/changeSetting", {
|
||||
key: "topNav",
|
||||
value: val,
|
||||
});
|
||||
if (!val) {
|
||||
this.$store.commit("SET_SIDEBAR_ROUTERS", this.$store.state.permission.defaultRoutes);
|
||||
}
|
||||
this.$store.commit(
|
||||
"SET_SIDEBAR_ROUTERS",
|
||||
this.$store.state.permission.defaultRoutes
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
tagsView: {
|
||||
get() {
|
||||
return this.$store.state.settings.tagsView;
|
||||
@ -122,6 +131,17 @@ export default {
|
||||
});
|
||||
},
|
||||
},
|
||||
dynamicTitle: {
|
||||
get() {
|
||||
return this.$store.state.settings.dynamicTitle;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.dispatch("settings/changeSetting", {
|
||||
key: "dynamicTitle",
|
||||
value: val,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
themeChange(val) {
|
||||
@ -154,6 +174,7 @@ export default {
|
||||
"tagsView":${this.tagsView},
|
||||
"fixedHeader":${this.fixedHeader},
|
||||
"sidebarLogo":${this.sidebarLogo},
|
||||
"dynamicTitle":${this.dynamicTitle},
|
||||
"sideTheme":"${this.sideTheme}",
|
||||
"theme":"${this.theme}"
|
||||
}`
|
||||
|
||||
@ -29,6 +29,8 @@ import DictTag from '@/components/DictTag'
|
||||
// import DictData from '@/components/DictData'
|
||||
// 上传图片
|
||||
import UploadImage from '@/components/UploadImage/index';
|
||||
// 上传文件
|
||||
import UploadFile from '@/components/FileUpload/index';
|
||||
|
||||
// 全局方法挂载
|
||||
Vue.prototype.getDicts = getDicts
|
||||
@ -60,10 +62,11 @@ Vue.component('RightToolbar', RightToolbar)
|
||||
Vue.component('DictTag', DictTag)
|
||||
Vue.component('Editor', Editor)
|
||||
Vue.component('UploadImage', UploadImage)
|
||||
Vue.component('UploadFile', UploadFile)
|
||||
Vue.use(permission)
|
||||
|
||||
Vue.use(Element, {
|
||||
size: Cookies.get('size') || 'medium' // set element-ui default size
|
||||
size: Cookies.get('size') || 'small' // set element-ui default size
|
||||
})
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
@ -13,9 +13,10 @@ const whiteList = ['/login', '/auth-redirect', '/bind', '/register', '/demo']
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
NProgress.start()
|
||||
console.log('router to ' + to.path);
|
||||
console.log('path=' + to.path);
|
||||
|
||||
if (getToken()) {
|
||||
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
|
||||
/* has token*/
|
||||
if (to.path === '/login') {
|
||||
next({ path: '/' })
|
||||
|
||||
@ -3,11 +3,11 @@ module.exports = {
|
||||
* 框架版本号
|
||||
*/
|
||||
version: '3.7.0',
|
||||
title: 'ZrAdmin.NET',
|
||||
title: 'ZrAdmin.NET-管理系统',
|
||||
/**
|
||||
* 主题颜色
|
||||
*/
|
||||
theme: '#13C2C2',
|
||||
theme: '#409EFF',
|
||||
/**
|
||||
* 侧边栏主题 深色主题theme-dark,浅色主题theme-light
|
||||
*/
|
||||
@ -37,7 +37,10 @@ module.exports = {
|
||||
* 是否显示logo
|
||||
*/
|
||||
sidebarLogo: true,
|
||||
|
||||
/**
|
||||
* 是否显示动态标题
|
||||
*/
|
||||
dynamicTitle: false,
|
||||
/**
|
||||
* @type {string | array} 'production' | ['production', 'development']
|
||||
* @description Need show err logs component.
|
||||
|
||||
@ -7,6 +7,7 @@ const getters = {
|
||||
token: state => state.user.token,
|
||||
avatar: state => state.user.avatar,
|
||||
name: state => state.user.name,
|
||||
userId: state => state.user.userInfo.userId,
|
||||
introduction: state => state.user.introduction,
|
||||
roles: state => state.user.roles,
|
||||
permissions: state => state.user.permissions,
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import defaultSettings from '@/settings'
|
||||
|
||||
const { theme, sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo } = defaultSettings
|
||||
const { theme, sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings
|
||||
|
||||
const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || ''
|
||||
const state = {
|
||||
title: '',
|
||||
theme: storageSetting.theme || theme, //主题颜色
|
||||
sideTheme: storageSetting.sideTheme || sideTheme, //侧边主题样式
|
||||
topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav,
|
||||
@ -11,7 +12,7 @@ const state = {
|
||||
tagsView: storageSetting.tagsView === undefined ? tagsView : storageSetting.tagsView,
|
||||
fixedHeader: storageSetting.fixedHeader === undefined ? fixedHeader : storageSetting.fixedHeader,
|
||||
sidebarLogo: storageSetting.sidebarLogo === undefined ? sidebarLogo : storageSetting.sidebarLogo,
|
||||
// dynamicTitle: storageSetting.dynamicTitle === undefined ? dynamicTitle : storageSetting.dynamicTitle
|
||||
dynamicTitle: storageSetting.dynamicTitle === undefined ? dynamicTitle : storageSetting.dynamicTitle
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
@ -26,6 +27,11 @@ const actions = {
|
||||
//修改布局设置
|
||||
changeSetting({ commit }, data) {
|
||||
commit('CHANGE_SETTING', data)
|
||||
},
|
||||
// 设置网页标题
|
||||
setTitle({ commit }, title) {
|
||||
state.title = title;
|
||||
document.title = state.dynamicTitle ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -26,6 +26,7 @@ service.interceptors.request.use(config => {
|
||||
if (getToken()) {
|
||||
//将token放到请求头发送给服务器,将tokenkey放在请求头中
|
||||
config.headers['Authorization'] = 'Bearer ' + getToken();
|
||||
config.headers['userid'] = store.getters.userId;
|
||||
} else {
|
||||
// console.log(config)
|
||||
}
|
||||
|
||||
@ -66,8 +66,7 @@ export function addDateRange(params, dateRange) {
|
||||
}
|
||||
|
||||
export function addDateRange2(dateRange, index) {
|
||||
console.log(dateRange);
|
||||
var time = "";
|
||||
var time = undefined;
|
||||
if (null != dateRange && '' != dateRange) {
|
||||
if (dateRange.length <= 2) {
|
||||
time = dateRange[index];
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="login">
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
||||
<h3 class="title">{{title}}后台管理系统</h3>
|
||||
<h3 class="title">{{title}}</h3>
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
|
||||
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" v-show="showSearch" :inline="true">
|
||||
<el-form-item label="角色名称" prop="roleName">
|
||||
<el-input v-model="queryParams.roleName" placeholder="请输入角色名称" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="queryParams.roleName" placeholder="请输入角色名称" clearable size="small" style="width: 240px"
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="权限字符" prop="roleKey">
|
||||
<el-input v-model="queryParams.roleKey" placeholder="请输入权限字符" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||
@ -28,8 +29,7 @@
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="24" style="display:flex;">
|
||||
<el-col :span="15">
|
||||
<el-row :gutter="24">
|
||||
<el-table v-loading="loading" :data="roleList" border @selection-change="handleSelectionChange">
|
||||
<el-table-column label="编号" prop="roleId" width="80" />
|
||||
<el-table-column label="名称" prop="roleName" />
|
||||
@ -40,35 +40,38 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="150" />
|
||||
<el-table-column label="备注" align="center" prop="remark" width="150" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click.stop="handleUpdate(scope.row)" v-if="scope.row.roleKey != 'admin'" v-hasPermi="['system:role:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click.stop="handleDelete(scope.row)" v-if="scope.row.roleKey != 'admin'" v-hasPermi="['system:role:remove']">删除</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-circle-check" @click.stop="handleDataScope(scope.row)" v-if="scope.row.roleKey != 'admin'" v-hasPermi="['system:role:authorize']">数据权限</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click.stop="handleUpdate(scope.row)" v-if="scope.row.roleKey != 'admin'"
|
||||
v-hasPermi="['system:role:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click.stop="handleDelete(scope.row)" v-if="scope.row.roleKey != 'admin'"
|
||||
v-hasPermi="['system:role:remove']">删除</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-circle-check" @click.stop="handleDataScope(scope.row)"
|
||||
v-if="scope.row.roleKey != 'admin'" v-hasPermi="['system:role:authorize']">数据权限</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- <pagination :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" /> -->
|
||||
</el-col>
|
||||
<el-col :span="9">
|
||||
<el-form :model="form" v-show="showRoleScope" label-width="80px" style="width:90%">
|
||||
</el-row>
|
||||
|
||||
<el-dialog title="角色权限分配" :visible.sync="showRoleScope" width="600px">
|
||||
<el-form :model="form" label-width="80px">
|
||||
<el-form-item label="权限字符">
|
||||
{{form.roleKey}}
|
||||
</el-form-item>
|
||||
<el-form-item label="数据权限" style="max-height:350px;overflow:auto;">
|
||||
<el-form-item label="数据权限">
|
||||
<el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>
|
||||
<el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox>
|
||||
<el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox>
|
||||
<el-tree class="tree-border" :data="menuOptions" show-checkbox ref="menu" node-key="id" :check-strictly="!form.menuCheckStrictly" empty-text="加载中,请稍后" :props="defaultProps"></el-tree>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitDataScope" v-hasPermi="['system:role:authorize']">保存</el-button>
|
||||
<el-tree class="tree-border" :data="menuOptions" show-checkbox ref="menu" node-key="id" :check-strictly="!form.menuCheckStrictly"
|
||||
empty-text="加载中,请稍后" :props="defaultProps"></el-tree>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitDataScope" v-hasPermi="['system:role:authorize']">保存</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 添加或修改角色配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
@ -119,7 +122,6 @@ import {
|
||||
// treeselect as deptTreeselect,
|
||||
// roleDeptTreeselect,
|
||||
// } from "@/api/system/dept";
|
||||
import { downloadFile } from "@/utils/zipdownload.js";
|
||||
|
||||
export default {
|
||||
name: "Role",
|
||||
@ -420,7 +422,7 @@ export default {
|
||||
roleId: row.roleId,
|
||||
roleName: row.roleName,
|
||||
roleKey: row.roleKey,
|
||||
menuCheckStrictly: true
|
||||
menuCheckStrictly: true,
|
||||
};
|
||||
},
|
||||
/** 提交按钮 */
|
||||
@ -460,6 +462,7 @@ export default {
|
||||
dataScope(this.form).then((response) => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.getList();
|
||||
this.showRoleScope = false;
|
||||
this.handleDataScope({ roleId: this.form.roleId });
|
||||
});
|
||||
} else {
|
||||
|
||||
@ -1,22 +1,27 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="24" style="display:flex;">
|
||||
<el-col :span="4">
|
||||
<el-table ref="roleTable" v-loading="loadingRole" highlight-current-row :data="dataRoleTable" border :height="tableHeight-135" @row-click="handleRoleTableSelection">
|
||||
<el-table-column prop="roleName" label="角色名称" />
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4" :xs="24">
|
||||
<el-table ref="roleTable" v-loading="loadingRole" highlight-current-row :data="dataRoleTable" border :height="tableHeight-135"
|
||||
@row-click="handleRoleTableSelection">
|
||||
<el-table-column prop="roleName" label="请选择角色名称" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-form style="display:flex" :inline="true" @submit.native.prevent>
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-form :inline="true" @submit.native.prevent>
|
||||
<el-form-item>
|
||||
<el-button type="primary" plain size="mini" icon="el-icon-plus" @click="handleGetUserTable" v-hasPermi="['system:roleusers:add']">添加用户</el-button>
|
||||
<el-button type="danger" plain size="mini" icon="el-icon-circle-close" @click="cancelAuthUserAll" v-hasPermi="['system:roleusers:del']">批量取消授权</el-button>
|
||||
<el-button type="primary" plain size="mini" icon="el-icon-plus" @click="handleGetUserTable" v-hasPermi="['system:roleusers:add']">添加用户
|
||||
</el-button>
|
||||
<el-button type="danger" plain size="mini" icon="el-icon-circle-close" @click="cancelAuthUserAll" v-hasPermi="['system:roleusers:del']">
|
||||
批量取消授权</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-left:auto">
|
||||
<el-input v-model="search" placeholder="请输入用户名称" clearable prefix-icon="el-icon-search" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table ref="roleUserTable" v-loading="loadingRoleUser" :data="dataRoleUserTable.filter(data => !search || data.userName.toLowerCase().includes(search.toLowerCase()))" row-key="userId" stripe border :height="tableHeight-180">
|
||||
<el-table ref="roleUserTable" v-loading="loadingRoleUser"
|
||||
:data="dataRoleUserTable.filter(data => !search || data.userName.toLowerCase().includes(search.toLowerCase()))" row-key="userId" stripe
|
||||
border :height="tableHeight-180">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column prop="userId" align="center" label="用户Id" width="150" />
|
||||
<el-table-column prop="userName" align="center" label="用户账号" width="150" />
|
||||
@ -24,13 +29,15 @@
|
||||
<el-table-column prop="email" align="center" label="邮箱" />
|
||||
<el-table-column prop="status" align="center" label="账号状态" width="80">
|
||||
<template slot-scope="scope">
|
||||
<i :style="scope.row.status === '0' ?'color:green':'color:red'" :class="scope.row.status === '0' ? 'el-icon-success ':'el-icon-error'" />
|
||||
<i :style="scope.row.status === '0' ?'color:green':'color:red'"
|
||||
:class="scope.row.status === '0' ? 'el-icon-success ':'el-icon-error'" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" :show-overflow-tooltip="true" align="center" label="备注" />
|
||||
<el-table-column align="center" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-circle-close" @click="handleCancelPerm(scope.row)" v-if="scope.row.userId != 1" v-hasPermi="['system:roleusers:del']">取消授权</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-circle-close" @click="handleCancelPerm(scope.row)" v-if="scope.row.userId != 1"
|
||||
v-hasPermi="['system:roleusers:del']">取消授权</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -53,7 +60,8 @@
|
||||
<el-table-column prop="nickName" align="center" label="用户昵称" width="150" />
|
||||
<el-table-column prop="status" align="center" label="用户状态">
|
||||
<template slot-scope="scope" label="操作">
|
||||
<i :style="scope.row.status === '0' ?'color:green':'color:red'" :class="scope.row.status === '0' ? 'el-icon-success ':'el-icon-error'" />
|
||||
<i :style="scope.row.status === '0' ?'color:green':'color:red'"
|
||||
:class="scope.row.status === '0' ? 'el-icon-success ':'el-icon-error'" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -128,7 +136,7 @@ export default {
|
||||
this.delSelections.push(element.userId);
|
||||
});
|
||||
if (this.delSelections.length === 0) {
|
||||
console.log('未选中')
|
||||
console.log("未选中");
|
||||
return;
|
||||
}
|
||||
this.$confirm(
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<!--部门数据-->
|
||||
<el-col :span="4" :xs="24">
|
||||
<el-col :span="4">
|
||||
<div class="head-container">
|
||||
<el-input v-model="deptName" placeholder="请输入部门名称" clearable size="small" prefix-icon="el-icon-search" style="margin-bottom: 20px" />
|
||||
</div>
|
||||
@ -11,7 +11,7 @@
|
||||
</div>
|
||||
</el-col>
|
||||
<!--用户数据-->
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-col :span="20">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="用户名称" prop="userName">
|
||||
<el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-card>
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tabs v-model="activeName" tab-position="top">
|
||||
<el-tab-pane label="基本信息" name="basic">
|
||||
<basic-info-form ref="basicInfo" :info="info" />
|
||||
</el-tab-pane>
|
||||
@ -31,11 +31,6 @@
|
||||
<el-input v-model="scope.row.csharpField"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="必填" min-width="5%">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox v-model="scope.row.isRequired"></el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="插入" min-width="5%">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox v-model="scope.row.isInsert" :disabled="scope.row.isPk || scope.row.isIncrement"></el-checkbox>
|
||||
@ -71,6 +66,11 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="必填" min-width="5%">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox v-model="scope.row.isRequired"></el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="表单显示类型" min-width="12%">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.htmlType">
|
||||
@ -89,7 +89,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="字典类型" min-width="12%">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.dictType" clearable filterable placeholder="请选择" :disabled="scope.row.htmlType == 'datetime'">
|
||||
<el-select v-model="scope.row.dictType" clearable filterable placeholder="请选择"
|
||||
v-if="scope.row.htmlType == 'select' || scope.row.htmlType == 'radio' || scope.row.htmlType =='checkbox'">
|
||||
<el-option v-for="dict in dictOptions" :key="dict.dictType" :label="dict.dictName" :value="dict.dictType">
|
||||
<span style="float: left">{{ dict.dictName }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ dict.dictType }}</span>
|
||||
@ -177,13 +178,14 @@ export default {
|
||||
if (validateResult) {
|
||||
const genTable = Object.assign({}, basicForm.model, genForm.model);
|
||||
genTable.columns = this.cloumns;
|
||||
// genTable.params = {
|
||||
genTable.params = {
|
||||
// treeCode: genTable.treeCode,
|
||||
// treeName: genTable.treeName,
|
||||
// treeParentCode: genTable.treeParentCode,
|
||||
//parentMenuId: genTable.parentMenuId,
|
||||
// };
|
||||
// console.log(JSON.stringify(genTable));
|
||||
};
|
||||
console.log("genForm", genTable);
|
||||
// return;
|
||||
updateGenTable(genTable).then((res) => {
|
||||
this.msgSuccess(res.msg);
|
||||
if (res.code === 200) {
|
||||
@ -207,21 +209,32 @@ export default {
|
||||
this.$store.dispatch("tagsView/delView", this.$route);
|
||||
this.$router.push({ path: "/tool/gen", query: { t: Date.now() } });
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
sortTable(columns) {
|
||||
const el = this.$refs.dragTable.$el.querySelectorAll(
|
||||
".el-table__body-wrapper > table > tbody"
|
||||
)[0];
|
||||
var that = this;
|
||||
const sortable = Sortable.create(el, {
|
||||
handle: ".allowDrag",
|
||||
onEnd: (evt) => {
|
||||
const targetRow = this.cloumns.splice(evt.oldIndex, 1)[0];
|
||||
this.cloumns.splice(evt.newIndex, 0, targetRow);
|
||||
for (let index in this.cloumns) {
|
||||
this.cloumns[index].sort = parseInt(index) + 1;
|
||||
const targetRow = that.cloumns.splice(evt.oldIndex, 1)[0];
|
||||
columns.splice(evt.newIndex, 0, targetRow);
|
||||
for (let index in columns) {
|
||||
columns[index].sort = parseInt(index) + 1;
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.columns = columns;
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
cloumns: {
|
||||
handler(val) {
|
||||
this.sortTable(val);
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
<el-form-item prop="moduleName">
|
||||
<span slot="label">
|
||||
生成模块名
|
||||
<el-tooltip content="可理解为子系统名,例如 system、user、tool" placement="top">
|
||||
<el-tooltip content="可理解为子系统名,例如 system、user、tool(一般文件夹归类)" placement="top">
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
@ -237,10 +237,10 @@ export default {
|
||||
{ required: true, message: "请选择生成模板", trigger: "blur" },
|
||||
],
|
||||
moduleName: [
|
||||
{ required: true, message: "请输入生成模块名", trigger: "blur" },
|
||||
{ required: true, message: "请输入生成模块名", trigger: "blur", pattern:/^[A-Za-z]+$/ },
|
||||
],
|
||||
businessName: [
|
||||
{ required: true, message: "请输入生成业务名", trigger: "blur" },
|
||||
{ required: true, message: "请输入生成业务名", trigger: "blur", pattern:/^[A-Za-z]+$/},
|
||||
],
|
||||
functionName: [
|
||||
{ required: true, message: "请输入生成功能名", trigger: "blur" },
|
||||
|
||||
@ -35,11 +35,12 @@
|
||||
<el-table-column prop="updateTime" label="更新时间" />
|
||||
<el-table-column label="操作" align="center" width="350">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" icon="el-icon-view" @click="handlePreview(scope.row)" v-hasPermi="['tool:gen:preview']">预览</el-button>
|
||||
<el-button type="text" icon="el-icon-view" @click="handleShowDialog(scope.row, 'preview')" v-hasPermi="['tool:gen:preview']">预览</el-button>
|
||||
<el-button type="text" icon="el-icon-edit" @click="handleEditTable(scope.row)" v-hasPermi="['tool:gen:edit']">编辑</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['tool:gen:remove']">删除</el-button>
|
||||
<el-button type="text" icon="el-icon-refresh" @click="handleRefresh(scope.row)" v-hasPermi="['tool:gen:refresh']">同步</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="handleShowDialog(scope.row)" v-hasPermi="['tool:gen:code']">生成代码</el-button>
|
||||
<!-- <el-button type="text" icon="el-icon-refresh" @click="handleRefresh(scope.row)" v-hasPermi="['tool:gen:refresh']">同步</el-button> -->
|
||||
<el-button type="text" icon="el-icon-download" @click="handleShowDialog(scope.row, 'generate')" v-hasPermi="['tool:gen:code']">生成代码
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -56,9 +57,24 @@
|
||||
</el-dialog>
|
||||
<import-table ref="import" @ok="handleSearch" />
|
||||
|
||||
<el-dialog :visible.sync="showGenerate" title="代码生成" width="800px">
|
||||
<el-dialog :visible.sync="showGenerate" :title="preview.title" width="800px">
|
||||
<el-form ref="codeGenerateForm" label-width="140px">
|
||||
|
||||
<el-form-item label="显示按钮">
|
||||
<el-checkbox-group v-model="checkedBtnForm">
|
||||
<el-checkbox :label="1" :disabled=true>
|
||||
<el-tag type="primary">添加</el-tag>
|
||||
</el-checkbox>
|
||||
<el-checkbox :label="2" :disabled=true>
|
||||
<el-tag type="success">修改</el-tag>
|
||||
</el-checkbox>
|
||||
<el-checkbox :label="3" :disabled=true>
|
||||
<el-tag type="danger">删除</el-tag>
|
||||
</el-checkbox>
|
||||
<el-checkbox :label="4">
|
||||
<el-tag type="warning">导出</el-tag>
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据库类型">
|
||||
<el-radio v-model="dbType" :label="0">mySql</el-radio>
|
||||
<el-radio v-model="dbType" :label="1">sqlServer</el-radio>
|
||||
@ -103,7 +119,8 @@ export default {
|
||||
activeName: "0",
|
||||
},
|
||||
showGenerate: false,
|
||||
checkedCodeGenerateForm: [1, 2, 3, 4, 5, 6, 7, 8],
|
||||
// 显示的button
|
||||
checkedBtnForm: [1, 2, 3],
|
||||
rules: {},
|
||||
// 表数据
|
||||
tableData: [],
|
||||
@ -151,15 +168,28 @@ export default {
|
||||
},
|
||||
// 代码预览
|
||||
handlePreview(row) {
|
||||
previewTable(row.tableId).then((res) => {
|
||||
var seachdata = {
|
||||
tableId: this.currentSelected.tableId,
|
||||
checkedBtn: this.checkedBtnForm,
|
||||
dbType: this.dbType,
|
||||
};
|
||||
previewTable(row.tableId, seachdata).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.showGenerate = false;
|
||||
this.preview.open = true;
|
||||
this.preview.data = res.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleShowDialog(row) {
|
||||
// 打开对话框、预览、生成
|
||||
handleShowDialog(row, type) {
|
||||
this.showGenerate = true;
|
||||
if (type == "generate") {
|
||||
this.preview.title = "代码生成";
|
||||
}
|
||||
if (type == "preview") {
|
||||
this.preview.title = "预览";
|
||||
}
|
||||
this.currentSelected = row;
|
||||
},
|
||||
/**
|
||||
@ -167,6 +197,10 @@ export default {
|
||||
*/
|
||||
handleGenerate: async function () {
|
||||
console.log(JSON.stringify(this.currentSelected));
|
||||
if (this.preview.title == "预览") {
|
||||
this.handlePreview(this.currentSelected);
|
||||
return;
|
||||
}
|
||||
if (!this.currentSelected) {
|
||||
this.msgError("请先选择要生成代码的数据表");
|
||||
return false;
|
||||
@ -184,8 +218,7 @@ export default {
|
||||
var seachdata = {
|
||||
tableId: this.currentSelected.tableId,
|
||||
tableName: this.currentSelected.name,
|
||||
// genCodeFiles: this.checkedCodeGenerateForm,
|
||||
// coverd: this.coverd,
|
||||
checkedBtn: this.checkedBtnForm,
|
||||
dbType: this.dbType,
|
||||
// queryColumn: this.checkedQueryColumn,
|
||||
};
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const defaultSettings = require('./src/settings.js')
|
||||
// const FileManagerPlugin = require('filemanager-webpack-plugin');
|
||||
|
||||
function resolve(dir) {
|
||||
return path.join(__dirname, dir)
|
||||
@ -53,17 +52,6 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
// new FileManagerPlugin({
|
||||
// events: {
|
||||
// onEnd: {
|
||||
// //首先需要删除项目根目录下的dist.zip
|
||||
// delete: ["./dist/*.zip"],
|
||||
|
||||
// //然后我们选择dist文件夹将之打包成dist.zip并放在根目录
|
||||
// archive: [{ source: "./dist", destination: "./dist/dist.zip" }]
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
]
|
||||
},
|
||||
chainWebpack(config) {
|
||||
|
||||
@ -251,7 +251,7 @@ INSERT INTO sys_menu VALUES (102, '菜单管理', 1, 3, 'menu', 'system/menu/ind
|
||||
INSERT INTO sys_menu VALUES (103, '部门管理', 1, 4, 'dept', 'system/dept/index', 0, 0, 'C', '0', '0', 'system:dept:list', 'tree', '', SYSDATE(), '', NULL, '部门管理菜单');
|
||||
INSERT INTO sys_menu VALUES (104, '岗位管理', 1, 5, 'post', 'system/post/index', 0, 0, 'C', '0', '0', 'system:post:list', 'post', '', SYSDATE(), '', NULL, '岗位管理菜单');
|
||||
INSERT INTO sys_menu VALUES (105, '字典管理', 1, 6, 'dict', 'system/dict/index', 0, 0, 'C', '0', '0', 'system:dict:list', 'dict', '', SYSDATE(), '', NULL, '');
|
||||
INSERT INTO sys_menu VALUES (106, '角色分配', 1, 2, 'roleusers', 'system/roleusers/index', 0, 0, 'C', '0', '0', 'system:role:list', 'people', '', SYSDATE(), '', NULL, NULL);
|
||||
INSERT INTO sys_menu VALUES (106, '用户角色', 1, 2, 'roleusers', 'system/roleusers/index', 0, 0, 'C', '0', '0', 'system:role:list', 'people', '', SYSDATE(), '', NULL, NULL);
|
||||
INSERT into sys_menu VALUES (107, '参数设置', 1, 8, 'config','system/config/index', 0, 0, 'C', '0', '0', 'system:config:list','edit', '', SYSDATE(), '', NULL, '');
|
||||
INSERT INTO sys_menu VALUES (108, '日志管理', 1, 9, 'log', '' , 0, 0, 'M', '0', '0', '', 'log', '', SYSDATE(), '', NULL, '日志管理菜单');
|
||||
INSERT INTO sys_menu VALUES (110, '定时任务', 2, 10, 'job', 'monitor/job/index', 0, 0, 'C', '0', '0', '', 'job', '', SYSDATE(), '', NULL, '定时任务菜单');
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user