mahao
1 year ago
25 changed files with 338 additions and 107 deletions
@ -0,0 +1,86 @@ |
|||||
|
const schema = { |
||||
|
title: "通用代码", |
||||
|
type: "object", |
||||
|
properties: { |
||||
|
userName: { |
||||
|
title: "项目", |
||||
|
type: "string", |
||||
|
readOnly: true, |
||||
|
showForList: true, |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
userName: { |
||||
|
title: "值", |
||||
|
type: "string", |
||||
|
readOnly: true, |
||||
|
showForList: true, |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
name: { |
||||
|
title: "描述", |
||||
|
type: "string", |
||||
|
showForList: true, |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
|
||||
|
const url = "base/code-settings"; |
||||
|
const createUrl = url; |
||||
|
const updateUrl = url; |
||||
|
const deleteUrl = url; |
||||
|
const method = "GET"; |
||||
|
const createMethod = "POST"; |
||||
|
const updateMethod = "PUT"; |
||||
|
const deleteMethod = "DELETE"; |
||||
|
|
||||
|
export default function () { |
||||
|
return { |
||||
|
query: { |
||||
|
url, |
||||
|
method, |
||||
|
schema: { |
||||
|
title: "通用代码", |
||||
|
type: "object", |
||||
|
properties: { |
||||
|
filter: { |
||||
|
title: "项目", |
||||
|
type: "string", |
||||
|
}, |
||||
|
skipCount: { |
||||
|
hidden: true, |
||||
|
default: 0, |
||||
|
}, |
||||
|
maxResultCount: { |
||||
|
hidden: true, |
||||
|
default: 10, |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
table: { |
||||
|
schema: schema, |
||||
|
}, |
||||
|
edit: { |
||||
|
createUrl, |
||||
|
updateUrl, |
||||
|
deleteUrl, |
||||
|
createMethod, |
||||
|
updateMethod, |
||||
|
deleteMethod, |
||||
|
schema: schema, |
||||
|
}, |
||||
|
}; |
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
import AppList from "../../components/list/index.js"; |
||||
|
import html from "html"; |
||||
|
import useConfig from "../../models/code-setting.js"; |
||||
|
import request from "../../request/index.js"; |
||||
|
import { format } from "../../utils/index.js"; |
||||
|
import { ElMessage } from "element-plus"; |
||||
|
|
||||
|
export default { |
||||
|
components: { AppList }, |
||||
|
template: html`<app-list :config="config" @command="onCommand" />`, |
||||
|
setup() { |
||||
|
// 变量定义
|
||||
|
const config = useConfig(); |
||||
|
// 函数定义
|
||||
|
const onCommand = async (item, rows) => { |
||||
|
console.log(item.path, item, rows); |
||||
|
if (item.path === "%s/reset-password") { |
||||
|
const url = format(item.path, rows[0].id); |
||||
|
await request(`base/user/${url}`, null, { method: item.meta.method }); |
||||
|
ElMessage({ |
||||
|
type: "info", |
||||
|
message: format("用户%s的密码已经成功重置为123456", rows[0].userName), |
||||
|
}); |
||||
|
} |
||||
|
}; |
||||
|
return { config, onCommand }; |
||||
|
}, |
||||
|
}; |
Binary file not shown.
@ -0,0 +1,32 @@ |
|||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Microsoft.Extensions.Logging; |
||||
|
using WTA.Application.Identity.Entities.SystemManagement; |
||||
|
using WTA.Shared.Application; |
||||
|
using WTA.Shared.Controllers; |
||||
|
using WTA.Shared.Data; |
||||
|
|
||||
|
namespace WTA.Application.Identity.Controllers; |
||||
|
|
||||
|
public class CodeSettingController : GenericController<CodeSetting, CodeSetting, CodeSetting, CodeSetting, CodeSetting, CodeSetting> |
||||
|
{ |
||||
|
public CodeSettingController(ILogger<CodeSetting> logger, IRepository<CodeSetting> repository) : base(logger, repository) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
[Display(Name = "导出Excel")] |
||||
|
public override IActionResult Export([FromBody] PaginationModel<CodeSetting, CodeSetting> model, bool includeAll = false, bool includeDeleted = false) |
||||
|
{ |
||||
|
return base.Export(model, includeAll, includeDeleted); |
||||
|
} |
||||
|
[Display(Name = "搜索")] |
||||
|
public override IActionResult Index([FromBody] PaginationModel<CodeSetting, CodeSetting> model) |
||||
|
{ |
||||
|
return base.Index(model); |
||||
|
} |
||||
|
[Display(Name = "新增")] |
||||
|
public override IActionResult Create([FromBody] CodeSetting model) |
||||
|
{ |
||||
|
return base.Create(model); |
||||
|
} |
||||
|
} |
@ -0,0 +1,29 @@ |
|||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using WTA.Shared.Attributes; |
||||
|
using WTA.Shared.Domain; |
||||
|
|
||||
|
namespace WTA.Application.Identity.Entities.SystemManagement; |
||||
|
|
||||
|
[SystemManagement] |
||||
|
[Order(4)] |
||||
|
[Display(Name = "通用代码")] |
||||
|
public class CodeSetting : BaseEntity |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 项目
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "项目")] |
||||
|
public string Project { set; get; } = null!; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 值
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "值")] |
||||
|
public string Value { set; get; } = null!; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 描述
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "描述")] |
||||
|
public string Description { set; get; } = null!; |
||||
|
} |
Loading…
Reference in new issue