mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-04-24 07:02:51 +08:00
chore: 🔨 时间选择器调整
[skip ci]
This commit is contained in:
parent
e5e1d6f50f
commit
ef17a8bd79
@ -14,4 +14,9 @@ public record ExecuteSqlReq : DataAbstraction
|
||||
/// 超时时间(秒)
|
||||
/// </summary>
|
||||
public int TimeoutSecs { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 等待结果
|
||||
/// </summary>
|
||||
public bool WaitResult { get; init; } = true;
|
||||
}
|
@ -13,10 +13,11 @@ public sealed class ToolsService : ServiceBase<IToolsService>, IToolsService
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<object[][]> ExecuteSqlAsync(ExecuteSqlReq req)
|
||||
public async Task<object[][]> ExecuteSqlAsync(ExecuteSqlReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return App.GetService<IFreeSql>().Ado.CommandFluent(req.Sql).CommandTimeout(req.TimeoutSecs).ExecuteArrayAsync();
|
||||
var cmd = App.GetService<IFreeSql>().Ado.CommandFluent(req.Sql).CommandTimeout(req.TimeoutSecs).ExecuteArrayAsync();
|
||||
return req.WaitResult ? await cmd.ConfigureAwait(false) : null;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -5,7 +5,7 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0"/>
|
||||
<PackageReference Include="xunit" Version="2.9.2"/>
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0-pre.49">
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
|
@ -196,58 +196,70 @@ export default {
|
||||
},
|
||||
},
|
||||
{
|
||||
text: this.$t('最近三日'),
|
||||
text: this.$t('本周'),
|
||||
value: () => {
|
||||
const start = new Date()
|
||||
start.setHours(0, 0, 0, 0)
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 2)
|
||||
const end = new Date()
|
||||
end.setHours(0, 0, 0, 0)
|
||||
return [start, end]
|
||||
// 获取当前日期对象
|
||||
const currentDate = new Date()
|
||||
currentDate.setHours(0, 0, 0, 0)
|
||||
|
||||
// 获取当前日期是本周的第几天(0代表周日,1代表周一,...,6代表周六)
|
||||
const dayOfWeek = currentDate.getDay()
|
||||
|
||||
// 获取当前日期距离本周第一天的天数差(负数代表本周之前的天数,正数或零代表本周之后的天数)
|
||||
const diffToFirstDay = dayOfWeek > 0 ? -(dayOfWeek - 1) : -6
|
||||
|
||||
// 获取本周第一天的日期对象
|
||||
const firstDayOfWeek = new Date(currentDate)
|
||||
firstDayOfWeek.setDate(currentDate.getDate() + diffToFirstDay)
|
||||
return [firstDayOfWeek, new Date()]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: this.$t('最近一周'),
|
||||
text: this.$t('后退一周'),
|
||||
value: () => {
|
||||
const start = new Date()
|
||||
start.setHours(0, 0, 0, 0)
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 6)
|
||||
const end = new Date()
|
||||
end.setHours(0, 0, 0, 0)
|
||||
try {
|
||||
const start = new Date(this.form.dy[this.dateField][0])
|
||||
const end = new Date(this.form.dy[this.dateField][1])
|
||||
start.setDate(start.getDate() - 7)
|
||||
end.setDate(end.getDate() - 7)
|
||||
return [start, end]
|
||||
} catch {}
|
||||
},
|
||||
},
|
||||
{
|
||||
text: this.$t('最近一月'),
|
||||
text: this.$t('本月'),
|
||||
value: () => {
|
||||
const start = new Date()
|
||||
start.setHours(0, 0, 0, 0)
|
||||
start.setMonth(start.getMonth() - 1)
|
||||
const end = new Date()
|
||||
end.setHours(0, 0, 0, 0)
|
||||
return [start, end]
|
||||
start.setDate(1)
|
||||
return [start, new Date()]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: this.$t('最近三月'),
|
||||
text: this.$t('后退一月'),
|
||||
value: () => {
|
||||
const start = new Date()
|
||||
start.setHours(0, 0, 0, 0)
|
||||
start.setMonth(start.getMonth() - 3)
|
||||
const end = new Date()
|
||||
end.setHours(0, 0, 0, 0)
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: this.$t('最近六月'),
|
||||
value: () => {
|
||||
const start = new Date()
|
||||
start.setHours(0, 0, 0, 0)
|
||||
start.setMonth(start.getMonth() - 6)
|
||||
const end = new Date()
|
||||
end.setHours(0, 0, 0, 0)
|
||||
return [start, end]
|
||||
try {
|
||||
const start = new Date(this.form.dy[this.dateField][0])
|
||||
const end = new Date(this.form.dy[this.dateField][1])
|
||||
return [
|
||||
new Date(
|
||||
start.getMonth() === 0 ? start.getFullYear() - 1 : start.getFullYear(),
|
||||
start.getMonth() === 0 ? 11 : start.getMonth() - 1,
|
||||
start.getDate(),
|
||||
start.getHours(),
|
||||
start.getMinutes(),
|
||||
start.getSeconds(),
|
||||
),
|
||||
new Date(
|
||||
end.getMonth() === 0 ? end.getFullYear() - 1 : end.getFullYear(),
|
||||
end.getMonth() === 0 ? 11 : end.getMonth() - 1,
|
||||
end.getDate(),
|
||||
end.getHours(),
|
||||
end.getMinutes(),
|
||||
end.getSeconds(),
|
||||
),
|
||||
]
|
||||
} catch {}
|
||||
},
|
||||
},
|
||||
],
|
||||
@ -432,6 +444,16 @@ export default {
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: this.$t('最近整点'),
|
||||
value: () => {
|
||||
const start = new Date()
|
||||
return [
|
||||
new Date(start.getFullYear(), start.getMonth(), start.getDate(), start.getHours(), 0, 0),
|
||||
new Date(start.getFullYear(), start.getMonth(), start.getDate(), start.getHours() + 1, 0, 0),
|
||||
]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: this.$t('后退一时'),
|
||||
value: () => {
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div v-for="item in data" :class="`sc-select-filter__item${item.w100p ? ' sc-select-filter__item-w100p' : ''}`" :key="item.key">
|
||||
<div :style="{ width: labelWidth + 'rem' }" @click="autoHeight" class="sc-select-filter__item-title">
|
||||
<label>
|
||||
<span>{{ item.title }}({{ item.options.length - 1 }})</span>
|
||||
<span>{{ item.title }}({{ item.options?.length - 1 }})</span>
|
||||
<el-icon style="display: none">
|
||||
<el-icon-arrow-up></el-icon-arrow-up>
|
||||
</el-icon>
|
||||
|
@ -3,7 +3,7 @@ export default {
|
||||
return {
|
||||
required: true,
|
||||
message: '您的邮箱地址',
|
||||
pattern: _this.$GLOBAL.chars.RGX_EMAIL,
|
||||
pattern: _this.$GLOBAL.chars.RGXL_EMAIL,
|
||||
}
|
||||
},
|
||||
emailNoUsed: (_this, id) => {
|
||||
|
@ -49,7 +49,7 @@
|
||||
<Tags v-if="!ismobile && layoutTags" :vue="this"></Tags>
|
||||
<div class="adminui-main" id="adminui-main">
|
||||
<router-view v-slot="{ Component }" :key="routerViewKey">
|
||||
<keep-alive>
|
||||
<keep-alive :max="5">
|
||||
<component v-if="$store.state.keepAlive.routeShow" :is="Component" :key="$route.fullPath" />
|
||||
</keep-alive>
|
||||
</router-view>
|
||||
@ -96,7 +96,7 @@
|
||||
<Tags v-if="!ismobile && layoutTags" :vue="this"></Tags>
|
||||
<div class="adminui-main" id="adminui-main">
|
||||
<router-view v-slot="{ Component }" :key="routerViewKey">
|
||||
<keep-alive>
|
||||
<keep-alive :max="5">
|
||||
<component v-if="$store.state.keepAlive.routeShow" :is="Component" :key="$route.fullPath" />
|
||||
</keep-alive>
|
||||
</router-view>
|
||||
@ -138,7 +138,7 @@
|
||||
<Tags v-if="!ismobile && layoutTags" :vue="this"></Tags>
|
||||
<div class="adminui-main" id="adminui-main">
|
||||
<router-view v-slot="{ Component }" :key="routerViewKey">
|
||||
<keep-alive>
|
||||
<keep-alive :max="5">
|
||||
<component v-if="$store.state.keepAlive.routeShow" :is="Component" :key="$route.fullPath" />
|
||||
</keep-alive>
|
||||
</router-view>
|
||||
@ -197,7 +197,7 @@
|
||||
<Tags v-if="!ismobile && layoutTags" :vue="this"></Tags>
|
||||
<div class="adminui-main" id="adminui-main">
|
||||
<router-view v-slot="{ Component }" :key="routerViewKey">
|
||||
<keep-alive>
|
||||
<keep-alive :max="5">
|
||||
<component v-if="$store.state.keepAlive.routeShow" :is="Component" :key="$route.fullPath" />
|
||||
</keep-alive>
|
||||
</router-view>
|
||||
|
@ -150,7 +150,7 @@ export default {
|
||||
executionCron: [
|
||||
{
|
||||
required: true,
|
||||
pattern: this.$GLOBAL.chars.RGX_CRON,
|
||||
pattern: this.$GLOBAL.chars.RGXL_CRON,
|
||||
message: this.$t('执行计划不正确'),
|
||||
},
|
||||
],
|
||||
|
@ -293,7 +293,7 @@ export default {
|
||||
email: [
|
||||
{
|
||||
message: '您的电子邮箱',
|
||||
pattern: this.$GLOBAL.chars.RGX_EMAIL,
|
||||
pattern: this.$GLOBAL.chars.RGXL_EMAIL,
|
||||
},
|
||||
],
|
||||
passwordText: [
|
||||
|
Loading…
x
Reference in New Issue
Block a user