mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-04-23 22:52:51 +08:00
parent
f00046265a
commit
4d63bd6bf5
@ -8,15 +8,14 @@ public sealed record SeedDataInsertedEvent : DataAbstraction, IEventSource
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SeedDataInsertedEvent" /> class.
|
||||
/// </summary>
|
||||
public SeedDataInsertedEvent(int insertedCount)
|
||||
public SeedDataInsertedEvent(int insertedCount, bool isConsumOnce = false)
|
||||
{
|
||||
IsConsumOnce = isConsumOnce;
|
||||
InsertedCount = insertedCount;
|
||||
CreatedTime = DateTime.Now;
|
||||
EventId = nameof(SeedDataInsertedEvent);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public CancellationToken CancellationToken { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public DateTime CreatedTime { get; }
|
||||
|
||||
@ -27,10 +26,13 @@ public sealed record SeedDataInsertedEvent : DataAbstraction, IEventSource
|
||||
public bool IsConsumOnce { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public object Payload { get; }
|
||||
public CancellationToken CancellationToken { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 插入数量
|
||||
/// </summary>
|
||||
public int InsertedCount { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public object Payload { get; init; }
|
||||
}
|
@ -52,6 +52,7 @@ public sealed class ExampleController(IExampleCache cache) : ControllerBase<IExa
|
||||
/// <summary>
|
||||
/// 示例是否存在
|
||||
/// </summary>
|
||||
[NonAction]
|
||||
public Task<bool> ExistAsync(QueryReq<QueryExampleReq> req)
|
||||
{
|
||||
return Cache.ExistAsync(req);
|
||||
@ -60,6 +61,7 @@ public sealed class ExampleController(IExampleCache cache) : ControllerBase<IExa
|
||||
/// <summary>
|
||||
/// 导出示例
|
||||
/// </summary>
|
||||
[NonAction]
|
||||
public Task<IActionResult> ExportAsync(QueryReq<QueryExampleReq> req)
|
||||
{
|
||||
return Cache.ExportAsync(req);
|
||||
@ -84,6 +86,7 @@ public sealed class ExampleController(IExampleCache cache) : ControllerBase<IExa
|
||||
/// <summary>
|
||||
/// 查询示例
|
||||
/// </summary>
|
||||
[NonAction]
|
||||
public Task<IEnumerable<QueryExampleRsp>> QueryAsync(QueryReq<QueryExampleReq> req)
|
||||
{
|
||||
return Cache.QueryAsync(req);
|
||||
|
@ -5,7 +5,7 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0-rc.2.24474.3"/>
|
||||
<PackageReference Include="xunit" Version="2.9.2"/>
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0-pre.42">
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0-pre.49">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
|
@ -49,28 +49,6 @@ export default {
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 示例是否存在
|
||||
*/
|
||||
exist: {
|
||||
url: `${config.API_URL}/api/tpl/example/exist`,
|
||||
name: `示例是否存在`,
|
||||
post: async function (data = {}, config = {}) {
|
||||
return await http.post(this.url, data, config)
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 导出示例
|
||||
*/
|
||||
export: {
|
||||
url: `${config.API_URL}/api/tpl/example/export`,
|
||||
name: `导出示例`,
|
||||
post: async function (data = {}, config = {}) {
|
||||
return await http.post(this.url, data, config)
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取单个示例
|
||||
*/
|
||||
@ -92,15 +70,4 @@ export default {
|
||||
return await http.post(this.url, data, config)
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询示例
|
||||
*/
|
||||
query: {
|
||||
url: `${config.API_URL}/api/tpl/example/query`,
|
||||
name: `查询示例`,
|
||||
post: async function (data = {}, config = {}) {
|
||||
return await http.post(this.url, data, config)
|
||||
},
|
||||
},
|
||||
}
|
@ -43,7 +43,7 @@ export default {
|
||||
const contents = []
|
||||
const msg = h('p', { style: 'width:230px;display:flex;justify-content:space-between' }, [
|
||||
h('span', {}, this.$t('即将开始更新……')),
|
||||
h('a', { style: 'color:#21A675', href: 'javascript:window.location.reload()' }, this.$t('立即更新')),
|
||||
h('a', { style: 'color:var(--el-color-primary)', href: 'javascript:window.location.reload()' }, this.$t('立即更新')),
|
||||
])
|
||||
const task = h('p', { style: 'font-weight:bold' }, version)
|
||||
const progress = h(
|
||||
@ -55,7 +55,7 @@ export default {
|
||||
style: {
|
||||
width: '230px',
|
||||
height: '6px',
|
||||
'background-color': '#21A675',
|
||||
'background-color': 'var(--el-color-primary)',
|
||||
'margin-top': '6px',
|
||||
'border-radius': '6px',
|
||||
},
|
||||
|
@ -1,5 +1,7 @@
|
||||
import DEFAULT_CONFIG from '@/config'
|
||||
|
||||
const T = {
|
||||
color: ['#21A675', '#36CE9E', '#f56e6a', '#626c91', '#edb00d', '#909399'],
|
||||
color: [DEFAULT_CONFIG.APP_SET_COLOR, '#36CE9E', '#f56e6a', '#626c91', '#edb00d', '#909399'],
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '3%',
|
||||
|
@ -440,7 +440,7 @@ export default {
|
||||
}
|
||||
|
||||
.sc-file-select__item__file .item-file.item-file-doc {
|
||||
color: #21a675;
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
|
||||
.sc-file-select__item__upload {
|
||||
|
@ -125,7 +125,7 @@ export default {
|
||||
|
||||
.sc-filter-my-list li:hover {
|
||||
background: #ecf5ff;
|
||||
color: #21a675;
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
|
||||
.sc-filter-my-list li label {
|
||||
|
@ -53,7 +53,7 @@ export default {
|
||||
.sc-page-header__icon span {
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
background: #21a675;
|
||||
background: var(--el-color-primary);
|
||||
border-radius: 40%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
export default {
|
||||
//标题
|
||||
//APP_NAME: "NetAdmin",
|
||||
//APP_NAME: "标题",
|
||||
//接口地址,如遇跨域需使用nginx代理
|
||||
//API_URL: "https://www.fastmock.site/mock/5039c4361c39a7e3252c5b55971f1bd3/api"
|
||||
//API_URL: import.meta.env.VITE_API_URL,
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
import API from '@/api'
|
||||
import DEFAULT_CONFIG from '@/config/index'
|
||||
|
||||
//文件选择器配置
|
||||
|
||||
@ -43,11 +44,11 @@ export default {
|
||||
files: {
|
||||
doc: {
|
||||
icon: 'sc-icon-file-word-2-fill',
|
||||
color: '#21A675',
|
||||
color: DEFAULT_CONFIG.APP_SET_COLOR,
|
||||
},
|
||||
docx: {
|
||||
icon: 'sc-icon-file-word-2-fill',
|
||||
color: '#21A675',
|
||||
color: DEFAULT_CONFIG.APP_SET_COLOR,
|
||||
},
|
||||
xls: {
|
||||
icon: 'sc-icon-file-excel-2-fill',
|
||||
|
@ -1,7 +1,7 @@
|
||||
//业务配置
|
||||
//会合并至this.$CONFIG
|
||||
//生产模式 public/config.js 同名key会覆盖这里的配置从而实现打包后的热更新
|
||||
//为避免和NetAdmin框架配置混淆建议添加前缀 MY_
|
||||
//为避免和框架配置混淆建议添加前缀 MY_
|
||||
//全局可使用 this.$CONFIG.MY_KEY 访问
|
||||
|
||||
export default {
|
||||
|
@ -15,9 +15,9 @@
|
||||
<el-main>
|
||||
<el-scrollbar>
|
||||
<el-menu
|
||||
:active-text-color="DEFAULT_CONFIG.APP_SET_COLOR"
|
||||
:default-active="$route.meta.active || $route.fullPath"
|
||||
@select="select"
|
||||
active-text-color="#21A675"
|
||||
background-color="#424c50"
|
||||
router
|
||||
text-color="#fff">
|
||||
@ -31,6 +31,7 @@
|
||||
|
||||
<script>
|
||||
import NavMenu from './NavMenu.vue'
|
||||
import DEFAULT_CONFIG from '@/config'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -42,7 +43,11 @@ export default {
|
||||
menu: [],
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
computed: {
|
||||
DEFAULT_CONFIG() {
|
||||
return DEFAULT_CONFIG
|
||||
},
|
||||
},
|
||||
created() {
|
||||
const menu = this.$router.sc_getMenu()
|
||||
this.menu = this.filterUrl(menu)
|
||||
|
@ -92,7 +92,7 @@ textarea {
|
||||
bottom: 10rem;
|
||||
right: 0;
|
||||
z-index: 100;
|
||||
background: #21a675;
|
||||
background: var(--el-color-primary);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
@ -234,7 +234,7 @@ textarea {
|
||||
}
|
||||
|
||||
.aminui-side-split li.active {
|
||||
background: #21a675;
|
||||
background: var(--el-color-primary);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@ -347,6 +347,7 @@ textarea {
|
||||
|
||||
.right-panel-search {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
@ -410,7 +411,7 @@ textarea {
|
||||
}
|
||||
|
||||
.adminui-tags li.active {
|
||||
background: #21a675;
|
||||
background: var(--el-color-primary);
|
||||
}
|
||||
|
||||
.adminui-tags li.active a {
|
||||
|
@ -44,7 +44,17 @@
|
||||
|
||||
.el-date-editor {
|
||||
--el-date-editor-daterange-width: 20rem;
|
||||
--el-date-editor-datetimerange-width: 30rem;
|
||||
--el-date-editor-datetimerange-width: 27rem;
|
||||
|
||||
.el-range-separator {
|
||||
flex: unset;
|
||||
padding: unset;
|
||||
}
|
||||
}
|
||||
|
||||
.el-range-editor.el-input__wrapper {
|
||||
padding: 0 0.5rem;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.el-menu {
|
||||
@ -93,6 +103,9 @@
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
--el-header-height: auto;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.el-header .left-panel {
|
||||
|
@ -77,8 +77,6 @@
|
||||
}
|
||||
|
||||
.right-panel-search {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.right-panel {
|
||||
|
@ -20,7 +20,7 @@ export default (error, vm) => {
|
||||
}
|
||||
const errorName = errorMap[error.name] || '未知错误'
|
||||
|
||||
console.warn(`[NetAdmin error]: ${error}`)
|
||||
console.warn(`[error]: ${error}`)
|
||||
console.error(error)
|
||||
//throw error;
|
||||
|
||||
|
@ -381,7 +381,7 @@ tool.crypto = {
|
||||
AES: {
|
||||
encrypt(data, secretKey, config = {}) {
|
||||
if (secretKey.length % 8 !== 0) {
|
||||
console.warn('[NetAdmin error]: 秘钥长度需为8的倍数,否则解密将会失败。')
|
||||
console.warn('[error]: 秘钥长度需为8的倍数,否则解密将会失败。')
|
||||
}
|
||||
const result = CryptoJS.AES.encrypt(data, CryptoJS.enc.Utf8.parse(secretKey), {
|
||||
iv: CryptoJS.enc.Utf8.parse(config.iv || ''),
|
||||
|
@ -178,8 +178,8 @@ export default {
|
||||
|
||||
.modItem-add:hover,
|
||||
.modItem-add:hover i {
|
||||
border-color: #21a675;
|
||||
color: #21a675 !important;
|
||||
border-color: var(--el-color-primary);
|
||||
color: var(--el-color-primary) !important;
|
||||
}
|
||||
|
||||
.setMods {
|
||||
|
@ -72,11 +72,12 @@
|
||||
|
||||
<script>
|
||||
import colorTool from '@/utils/color'
|
||||
import DEFAULT_CONFIG from '@/config'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
colorList: ['#21A675', '#009688', '#536dfe', '#ff5c93', '#c62f2f', '#fd726d'],
|
||||
colorList: [DEFAULT_CONFIG.APP_SET_COLOR, '#009688', '#536dfe', '#ff5c93', '#c62f2f', '#fd726d'],
|
||||
config: {
|
||||
layout: this.$TOOL.data.get('APP_SET_LAYOUT') || this.$CONFIG.APP_SET_LAYOUT,
|
||||
menuIsCollapse: this.$TOOL.data.get('APP_SET_MENU_IS_COLLAPSE') || this.$CONFIG.APP_SET_MENU_IS_COLLAPSE,
|
||||
@ -84,7 +85,7 @@ export default {
|
||||
layoutTags: this.$TOOL.data.get('APP_SET_MULTI_TAGS') || this.$CONFIG.APP_SET_MULTI_TAGS,
|
||||
lang: this.$TOOL.data.get('APP_SET_LANG') || this.$CONFIG.APP_SET_LANG,
|
||||
dark: this.$TOOL.data.get('APP_SET_DARK') || this.$CONFIG.APP_SET_DARK,
|
||||
colorPrimary: this.$TOOL.data.get('APP_SET_COLOR') || this.$CONFIG.APP_SET_COLOR || '#17ABE3',
|
||||
colorPrimary: this.$TOOL.data.get('APP_SET_COLOR') || this.$CONFIG.APP_SET_COLOR || DEFAULT_CONFIG.APP_SET_COLOR,
|
||||
autoExit: this.$TOOL.data.get('APP_SET_AUTO_EXIT') || this.$CONFIG.APP_SET_AUTO_EXIT,
|
||||
},
|
||||
}
|
||||
@ -136,8 +137,8 @@ export default {
|
||||
},
|
||||
'config.colorPrimary'(val) {
|
||||
if (!val) {
|
||||
val = '#21A675'
|
||||
this.config.colorPrimary = '#21A675'
|
||||
val = DEFAULT_CONFIG.APP_SET_COLOR
|
||||
this.config.colorPrimary = DEFAULT_CONFIG.APP_SET_COLOR
|
||||
}
|
||||
document.documentElement.style.setProperty('--el-color-primary', val)
|
||||
for (let i = 1; i <= 9; i++) {
|
||||
|
@ -82,7 +82,7 @@
|
||||
<el-table-column type="selection" width="50" />
|
||||
<el-table-column :label="$t('项名')" prop="key" sortable="custom" />
|
||||
<el-table-column :label="$t('项值')" prop="value" sortable="custom" />
|
||||
<el-table-column :label="$t('描述')" prop="summary" sortable="custom" />
|
||||
<el-table-column :label="$t('备注')" prop="summary" sortable="custom" />
|
||||
<el-table-column :label="$t('启用')" align="center" prop="enabled" sortable="custom" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-switch v-model="row.enabled" @change="changeSwitch($event, row)"></el-switch>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<el-form-item :label="$t('项值')" prop="value">
|
||||
<el-input v-model="form.value" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('描述')" prop="summary">
|
||||
<el-form-item :label="$t('备注')" prop="summary">
|
||||
<el-input v-model="form.summary" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
Loading…
x
Reference in New Issue
Block a user