Merge remote-tracking branch 'upstream/main' into template

This commit is contained in:
Master 2024-07-16 08:23:21 +08:00
commit 2a4efa76a4
26 changed files with 1651 additions and 55 deletions

View File

@ -26,13 +26,13 @@
<PackageReference Include="Magicodes.IE.Excel" Version="2.7.5.1" />
<PackageReference Include="Magicodes.IE.Pdf" Version="2.7.5.1" />
<PackageReference Include="Magicodes.IE.Word" Version="2.7.5.1" />
<PackageReference Include="MailKit" Version="4.7.1" />
<PackageReference Include="MailKit" Version="4.7.1.1" />
<PackageReference Include="NewLife.Redis" Version="5.7.2024.709" />
<PackageReference Include="Novell.Directory.Ldap.NETStandard" Version="3.6.0" />
<PackageReference Include="QRCoder" Version="1.6.0" />
<PackageReference Include="RabbitMQ.Client" Version="6.8.1" />
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.2" />
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="3.3.0" />
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="3.4.0" />
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.6.0" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.162" />
<PackageReference Include="SSH.NET" Version="2024.1.0" />

View File

@ -0,0 +1,34 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core;
/// <summary>
/// 系统日程表
/// </summary>
[SugarTable(null, "系统日程表")]
[SysTable]
public class SysSchedule : EntityTenant
{
/// <summary>
/// 用户Id
/// </summary>
[SugarColumn(ColumnDescription = "用户Id")]
public long UserId { get; set; }
/// <summary>
/// 日程时间
/// </summary>
[SugarColumn(ColumnDescription = "日程时间")]
public DateTime? ScheduleTime { get; set; }
/// <summary>
/// 日程内容
/// </summary>
[SugarColumn(ColumnDescription = "日程内容", Length = 256)]
[Required, MaxLength(256)]
public virtual string Content { get; set; }
}

View File

@ -31,21 +31,27 @@ public static class SqlSugarFilterExtension
/// <param name="type"></param>
/// <param name="owners"></param>
/// <returns></returns>
public static LambdaExpression GetConditionExpression<T>(this Type type, List<long> owners)
where T : Attribute
public static LambdaExpression GetConditionExpression<T>(this Type type, List<long> owners) where T : Attribute
{
var fieldNames = type.GetPropertyNames<T>();
ParameterExpression parameter = Expression.Parameter(type, "c");
Expression right = Expression.Constant(false);
fieldNames.ForEach(filedName =>
fieldNames.ForEach(fieldName =>
{
owners.ForEach(owner =>
{
Expression left = Expression.Equal(
Expression.Property(parameter, type.GetProperty(filedName)),
Expression.Constant(owner)
);
var property = type.GetProperty(fieldName);
Expression temp = Expression.Property(parameter, property);
// 如果属性是可为空的类型,则转换为其基础类型
var propertyType = property.PropertyType;
if (Nullable.GetUnderlyingType(propertyType) != null)
{
temp = Expression.Convert(temp, Nullable.GetUnderlyingType(propertyType));
}
Expression left = Expression.Equal(temp, Expression.Constant(owner));
right = Expression.Or(left, right);
});
});

View File

@ -0,0 +1,31 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core.Service;
public class ScheduleInput
{
public DateTime? StartTime { get; set; }
public DateTime? EndTime { get; set; }
}
public class AddScheduleInput : SysSchedule
{
/// <summary>
/// 日程内容
/// </summary>
[Required(ErrorMessage = "日程内容不能为空")]
public override string Content { get; set; }
}
public class UpdateScheduleInput : AddScheduleInput
{
}
public class DeleteScheduleInput : BaseIdInput
{
}

View File

@ -0,0 +1,87 @@
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
namespace Admin.NET.Core.Service;
/// <summary>
/// 系统日程服务
/// </summary>
[ApiDescriptionSettings(Order = 295)]
public class SysScheduleService : IDynamicApiController, ITransient
{
private readonly UserManager _userManager;
private readonly SqlSugarRepository<SysSchedule> _sysSchedule;
public SysScheduleService(UserManager userManager,
SqlSugarRepository<SysSchedule> sysSchedle)
{
_userManager = userManager;
_sysSchedule = sysSchedle;
}
/// <summary>
/// 获取日程列表
/// </summary>
/// <returns></returns>
[DisplayName("获取日程列表")]
public async Task<List<SysSchedule>> Page(ScheduleInput input)
{
return await _sysSchedule.AsQueryable()
.Where(u => u.UserId == _userManager.UserId)
.WhereIF(!string.IsNullOrWhiteSpace(input.StartTime.ToString()), u => u.ScheduleTime >= input.StartTime)
.WhereIF(!string.IsNullOrWhiteSpace(input.EndTime.ToString()), u => u.ScheduleTime <= input.EndTime)
.OrderBy(u => u.CreateTime, OrderByType.Asc)
.ToListAsync();
}
/// <summary>
/// 获取日程详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[DisplayName("获取日程详情")]
public async Task<SysSchedule> GetDetail(long id)
{
return await _sysSchedule.GetFirstAsync(u => u.Id == id);
}
/// <summary>
/// 增加日程
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[ApiDescriptionSettings(Name = "Add"), HttpPost]
[DisplayName("增加日程")]
public async Task AddUserSchedule(AddScheduleInput input)
{
input.UserId = _userManager.UserId;
await _sysSchedule.InsertAsync(input.Adapt<SysSchedule>());
}
/// <summary>
/// 更新日程
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[ApiDescriptionSettings(Name = "Update"), HttpPost]
[DisplayName("更新日程")]
public async Task UpdateUserSchedule(UpdateScheduleInput input)
{
await _sysSchedule.AsUpdateable(input.Adapt<SysSchedule>()).IgnoreColumns(true).ExecuteCommandAsync();
}
/// <summary>
/// 删除日程
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[ApiDescriptionSettings(Name = "Delete"), HttpPost]
[DisplayName("删除日程")]
public async Task DeleteUserSchedule(DeleteScheduleInput input)
{
await _sysSchedule.DeleteAsync(u => u.Id == input.Id);
}
}

View File

@ -23,26 +23,26 @@
<el-form :model="state.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true" label-width="auto" style="flex: 1 1 0%" @@submit.prevent="handleQuery" >
<el-row :gutter="10">
@if(Model.QueryWhetherList.Count > 0){
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" class="mb5">
<el-form-item label="关键字" prop="searchKey">
<el-input v-model="state.queryParams.searchKey" placeholder="请输入模糊查询关键字" clearable @@keyup.enter.native="handleQuery" />
</el-form-item>
</el-col>
foreach (var column in Model.QueryWhetherList) {
if(@column.EffectType == "Input" || @column.EffectType == "InputTextArea") {
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI" class="mb5">
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
<el-input v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="@column.ColumnComment" clearable @@keyup.enter.native="handleQuery" />
</el-form-item>
</el-col>
} else if(@column.EffectType == "InputNumber") {
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI" class="mb5">
<el-form-item label="@column.ColumnComment">
<el-input-number v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="请输入@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery" />
</el-form-item>
</el-col>
} else if(@column.EffectType == "fk") {
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI" class="mb5">
<el-form-item label="@column.ColumnComment">
<el-select filterable="" v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="请选择@(@column.ColumnComment)" clearable>
<el-option v-for="(item,index) in @LowerFirstLetter(@column.FkEntityName)@(@column.PropertyName)DropdownList" :key="index" :value="item.value" :label="item.label" />
@ -50,7 +50,7 @@
</el-form-item>
</el-col>
} else if(@column.EffectType == "Select") {
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI" class="mb5">
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
<el-select v-model="state.queryParams.@(@column.LowerPropertyName)" filterable placeholder="请选择@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery" >
<el-option v-for="(item,index) in dl('@(@column.DictTypeCode)')" :key="index" :value="item.code" :label="`${item.name} [${item.code}] ${item.value}`" />
@ -58,7 +58,7 @@
</el-form-item>
</el-col>
} else if(@column.EffectType == "EnumSelector") {
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI" class="mb5">
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
<el-select v-model="state.queryParams.@(@column.LowerPropertyName)" filterable placeholder="请选择@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery" >
<el-option v-for="(item,index) in dl('@(@column.DictTypeCode)')" :key="index" :value="item.value" :label="`${item.name} [${item.code}] ${item.value}`" />
@ -66,7 +66,7 @@
</el-form-item>
</el-col>
} else if(@column.EffectType == "DatePicker") {
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI" class="mb5">
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
@if(@column.QueryType == "~"){
@:<el-date-picker type="daterange" v-model="state.queryParams.@(@column.LowerPropertyName)Range" value-format="YYYY-MM-DD HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" />
@ -163,14 +163,14 @@
<template #row_buttons="{ row }">
@if(@Model.PrintType == "custom") {
<el-tooltip content="打印" placement="top">
<el-button icon="ele-Printer" size="small" text type="primary" @@click="handlePrint(row)" v-auth="'@(@Model.LowerClassName):print'" :disabled="row.status === 1" />
<el-button icon="ele-Printer" size="small" text type="primary" @@click="handlePrint(row)" v-auth="'@(@Model.LowerClassName):print'" />
</el-tooltip>
}
<el-tooltip content="编辑" placement="top">
<el-button icon="ele-Edit" size="small" text type="primary" @@click="handleEdit(row)" v-auth="'@(@Model.LowerClassName):update'" :disabled="row.status === 1" />
<el-button icon="ele-Edit" size="small" text type="primary" @@click="handleEdit(row)" v-auth="'@(@Model.LowerClassName):update'" />
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button icon="ele-Delete" size="small" text type="danger" @@click="handleDelete(row)" v-auth="'@(@Model.LowerClassName):delete'" :disabled="row.status === 1" />
<el-button icon="ele-Delete" size="small" text type="danger" @@click="handleDelete(row)" v-auth="'@(@Model.LowerClassName):delete'" />
</el-tooltip>
</template>
</vxe-grid>

View File

@ -68,8 +68,8 @@
"vue-signature-pad": "^3.0.2",
"vue3-tree-org": "^4.2.2",
"vuedraggable": "4.0.3",
"vxe-pc-ui": "^4.0.67",
"vxe-table": "^4.7.50",
"vxe-pc-ui": "^4.0.68",
"vxe-table": "^4.7.51",
"vxe-table-plugin-element": "^4.0.4",
"vxe-table-plugin-export-xlsx": "^4.0.5",
"xe-utils": "^3.5.28",

View File

@ -45,6 +45,7 @@ export * from './apis/sys-print-api';
export * from './apis/sys-proc-api';
export * from './apis/sys-region-api';
export * from './apis/sys-role-api';
export * from './apis/sys-schedule-api';
export * from './apis/sys-server-api';
export * from './apis/sys-sms-api';
export * from './apis/sys-tenant-api';

View File

@ -0,0 +1,476 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
import { Configuration } from '../configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
import { AddScheduleInput } from '../models';
import { AdminResultListSysSchedule } from '../models';
import { AdminResultSysSchedule } from '../models';
import { DeleteScheduleInput } from '../models';
import { ScheduleInput } from '../models';
import { UpdateScheduleInput } from '../models';
/**
* SysScheduleApi - axios parameter creator
* @export
*/
export const SysScheduleApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @summary
* @param {AddScheduleInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysScheduleAddPost: async (body?: AddScheduleInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysSchedule/add`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication Bearer required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary
* @param {DeleteScheduleInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysScheduleDeletePost: async (body?: DeleteScheduleInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysSchedule/delete`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication Bearer required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysScheduleDetailIdGet: async (id: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new RequiredError('id','Required parameter id was null or undefined when calling apiSysScheduleDetailIdGet.');
}
const localVarPath = `/api/sysSchedule/detail/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication Bearer required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary
* @param {ScheduleInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysSchedulePagePost: async (body?: ScheduleInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysSchedule/page`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication Bearer required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary
* @param {UpdateScheduleInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysScheduleUpdatePost: async (body?: UpdateScheduleInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysSchedule/update`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication Bearer required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
}
};
/**
* SysScheduleApi - functional programming interface
* @export
*/
export const SysScheduleApiFp = function(configuration?: Configuration) {
return {
/**
*
* @summary
* @param {AddScheduleInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysScheduleAddPost(body?: AddScheduleInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await SysScheduleApiAxiosParamCreator(configuration).apiSysScheduleAddPost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary
* @param {DeleteScheduleInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysScheduleDeletePost(body?: DeleteScheduleInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await SysScheduleApiAxiosParamCreator(configuration).apiSysScheduleDeletePost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysScheduleDetailIdGet(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSysSchedule>>> {
const localVarAxiosArgs = await SysScheduleApiAxiosParamCreator(configuration).apiSysScheduleDetailIdGet(id, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary
* @param {ScheduleInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysSchedulePagePost(body?: ScheduleInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListSysSchedule>>> {
const localVarAxiosArgs = await SysScheduleApiAxiosParamCreator(configuration).apiSysSchedulePagePost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary
* @param {UpdateScheduleInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysScheduleUpdatePost(body?: UpdateScheduleInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await SysScheduleApiAxiosParamCreator(configuration).apiSysScheduleUpdatePost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
}
};
/**
* SysScheduleApi - factory interface
* @export
*/
export const SysScheduleApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
return {
/**
*
* @summary
* @param {AddScheduleInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysScheduleAddPost(body?: AddScheduleInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return SysScheduleApiFp(configuration).apiSysScheduleAddPost(body, options).then((request) => request(axios, basePath));
},
/**
*
* @summary
* @param {DeleteScheduleInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysScheduleDeletePost(body?: DeleteScheduleInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return SysScheduleApiFp(configuration).apiSysScheduleDeletePost(body, options).then((request) => request(axios, basePath));
},
/**
*
* @summary
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysScheduleDetailIdGet(id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSysSchedule>> {
return SysScheduleApiFp(configuration).apiSysScheduleDetailIdGet(id, options).then((request) => request(axios, basePath));
},
/**
*
* @summary
* @param {ScheduleInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysSchedulePagePost(body?: ScheduleInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListSysSchedule>> {
return SysScheduleApiFp(configuration).apiSysSchedulePagePost(body, options).then((request) => request(axios, basePath));
},
/**
*
* @summary
* @param {UpdateScheduleInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysScheduleUpdatePost(body?: UpdateScheduleInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return SysScheduleApiFp(configuration).apiSysScheduleUpdatePost(body, options).then((request) => request(axios, basePath));
},
};
};
/**
* SysScheduleApi - object-oriented interface
* @export
* @class SysScheduleApi
* @extends {BaseAPI}
*/
export class SysScheduleApi extends BaseAPI {
/**
*
* @summary
* @param {AddScheduleInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysScheduleApi
*/
public async apiSysScheduleAddPost(body?: AddScheduleInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
return SysScheduleApiFp(this.configuration).apiSysScheduleAddPost(body, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary
* @param {DeleteScheduleInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysScheduleApi
*/
public async apiSysScheduleDeletePost(body?: DeleteScheduleInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
return SysScheduleApiFp(this.configuration).apiSysScheduleDeletePost(body, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysScheduleApi
*/
public async apiSysScheduleDetailIdGet(id: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSysSchedule>> {
return SysScheduleApiFp(this.configuration).apiSysScheduleDetailIdGet(id, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary
* @param {ScheduleInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysScheduleApi
*/
public async apiSysSchedulePagePost(body?: ScheduleInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListSysSchedule>> {
return SysScheduleApiFp(this.configuration).apiSysSchedulePagePost(body, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary
* @param {UpdateScheduleInput} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysScheduleApi
*/
public async apiSysScheduleUpdatePost(body?: UpdateScheduleInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
return SysScheduleApiFp(this.configuration).apiSysScheduleUpdatePost(body, options).then((request) => request(this.axios, this.basePath));
}
}

View File

@ -0,0 +1,118 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/**
*
*
* @export
* @interface AddScheduleInput
*/
export interface AddScheduleInput {
/**
* Id
*
* @type {number}
* @memberof AddScheduleInput
*/
id?: number;
/**
*
*
* @type {Date}
* @memberof AddScheduleInput
*/
createTime?: Date;
/**
*
*
* @type {Date}
* @memberof AddScheduleInput
*/
updateTime?: Date | null;
/**
* Id
*
* @type {number}
* @memberof AddScheduleInput
*/
createUserId?: number | null;
/**
*
*
* @type {string}
* @memberof AddScheduleInput
*/
createUserName?: string | null;
/**
* Id
*
* @type {number}
* @memberof AddScheduleInput
*/
updateUserId?: number | null;
/**
*
*
* @type {string}
* @memberof AddScheduleInput
*/
updateUserName?: string | null;
/**
*
*
* @type {boolean}
* @memberof AddScheduleInput
*/
isDelete?: boolean;
/**
* Id
*
* @type {number}
* @memberof AddScheduleInput
*/
tenantId?: number | null;
/**
* Id
*
* @type {number}
* @memberof AddScheduleInput
*/
userId?: number;
/**
*
*
* @type {Date}
* @memberof AddScheduleInput
*/
scheduleTime?: Date | null;
/**
*
*
* @type {string}
* @memberof AddScheduleInput
*/
content: string;
}

View File

@ -0,0 +1,71 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { SysSchedule } from './sys-schedule';
/**
*
*
* @export
* @interface AdminResultListSysSchedule
*/
export interface AdminResultListSysSchedule {
/**
*
*
* @type {number}
* @memberof AdminResultListSysSchedule
*/
code?: number;
/**
* successwarningerror
*
* @type {string}
* @memberof AdminResultListSysSchedule
*/
type?: string | null;
/**
*
*
* @type {string}
* @memberof AdminResultListSysSchedule
*/
message?: string | null;
/**
*
*
* @type {Array<SysSchedule>}
* @memberof AdminResultListSysSchedule
*/
result?: Array<SysSchedule> | null;
/**
*
*
* @type {any}
* @memberof AdminResultListSysSchedule
*/
extras?: any | null;
/**
*
*
* @type {Date}
* @memberof AdminResultListSysSchedule
*/
time?: Date;
}

View File

@ -0,0 +1,69 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import { SysSchedule } from './sys-schedule';
/**
*
*
* @export
* @interface AdminResultSysSchedule
*/
export interface AdminResultSysSchedule {
/**
*
*
* @type {number}
* @memberof AdminResultSysSchedule
*/
code?: number;
/**
* successwarningerror
*
* @type {string}
* @memberof AdminResultSysSchedule
*/
type?: string | null;
/**
*
*
* @type {string}
* @memberof AdminResultSysSchedule
*/
message?: string | null;
/**
* @type {SysSchedule}
* @memberof AdminResultSysSchedule
*/
result?: SysSchedule;
/**
*
*
* @type {any}
* @memberof AdminResultSysSchedule
*/
extras?: any | null;
/**
*
*
* @type {Date}
* @memberof AdminResultSysSchedule
*/
time?: Date;
}

View File

@ -0,0 +1,30 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/**
*
*
* @export
* @interface DeleteScheduleInput
*/
export interface DeleteScheduleInput {
/**
* Id
*
* @type {number}
* @memberof DeleteScheduleInput
*/
id: number;
}

View File

@ -14,6 +14,7 @@ export * from './add-pos-input';
export * from './add-print-input';
export * from './add-region-input';
export * from './add-role-input';
export * from './add-schedule-input';
export * from './add-subscribe-message-template-input';
export * from './add-sys-ldap-input';
export * from './add-tenant-input';
@ -55,6 +56,7 @@ export * from './admin-result-list-sys-menu';
export * from './admin-result-list-sys-notice';
export * from './admin-result-list-sys-org';
export * from './admin-result-list-sys-region';
export * from './admin-result-list-sys-schedule';
export * from './admin-result-list-sys-user';
export * from './admin-result-list-sys-user-ext-org';
export * from './admin-result-list-table-output';
@ -98,6 +100,7 @@ export * from './admin-result-sys-ldap';
export * from './admin-result-sys-log-ex';
export * from './admin-result-sys-log-op';
export * from './admin-result-sys-print';
export * from './admin-result-sys-schedule';
export * from './admin-result-sys-user';
export * from './admin-result-sys-wechat-pay';
export * from './admin-result-visual-db-table';
@ -167,6 +170,7 @@ export * from './delete-pos-input';
export * from './delete-print-input';
export * from './delete-region-input';
export * from './delete-role-input';
export * from './delete-schedule-input';
export * from './delete-sys-ldap-input';
export * from './delete-tenant-input';
export * from './delete-user-input';
@ -276,6 +280,7 @@ export * from './role-output';
export * from './runtime-field-handle';
export * from './runtime-method-handle';
export * from './runtime-type-handle';
export * from './schedule-input';
export * from './schema-serialization-mode';
export * from './search';
export * from './security-rule-set';
@ -342,6 +347,7 @@ export * from './sys-org';
export * from './sys-plugin';
export * from './sys-print';
export * from './sys-region';
export * from './sys-schedule';
export * from './sys-user';
export * from './sys-user-ext-org';
export * from './sys-wechat-pay';
@ -374,6 +380,7 @@ export * from './update-pos-input';
export * from './update-print-input';
export * from './update-region-input';
export * from './update-role-input';
export * from './update-schedule-input';
export * from './update-sys-ldap-input';
export * from './update-tenant-input';
export * from './update-user-input';

View File

@ -30,12 +30,6 @@ export interface MemberInfo {
*/
memberType?: MemberTypes;
/**
* @type {string}
* @memberof MemberInfo
*/
name?: string | null;
/**
* @type {Type}
* @memberof MemberInfo
@ -48,6 +42,12 @@ export interface MemberInfo {
*/
reflectedType?: Type;
/**
* @type {string}
* @memberof MemberInfo
*/
name?: string | null;
/**
* @type {Module}
* @memberof MemberInfo

View File

@ -0,0 +1,34 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/**
*
*
* @export
* @interface ScheduleInput
*/
export interface ScheduleInput {
/**
* @type {Date}
* @memberof ScheduleInput
*/
startTime?: Date | null;
/**
* @type {Date}
* @memberof ScheduleInput
*/
endTime?: Date | null;
}

View File

@ -0,0 +1,118 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/**
*
*
* @export
* @interface SysSchedule
*/
export interface SysSchedule {
/**
* Id
*
* @type {number}
* @memberof SysSchedule
*/
id?: number;
/**
*
*
* @type {Date}
* @memberof SysSchedule
*/
createTime?: Date;
/**
*
*
* @type {Date}
* @memberof SysSchedule
*/
updateTime?: Date | null;
/**
* Id
*
* @type {number}
* @memberof SysSchedule
*/
createUserId?: number | null;
/**
*
*
* @type {string}
* @memberof SysSchedule
*/
createUserName?: string | null;
/**
* Id
*
* @type {number}
* @memberof SysSchedule
*/
updateUserId?: number | null;
/**
*
*
* @type {string}
* @memberof SysSchedule
*/
updateUserName?: string | null;
/**
*
*
* @type {boolean}
* @memberof SysSchedule
*/
isDelete?: boolean;
/**
* Id
*
* @type {number}
* @memberof SysSchedule
*/
tenantId?: number | null;
/**
* Id
*
* @type {number}
* @memberof SysSchedule
*/
userId?: number;
/**
*
*
* @type {Date}
* @memberof SysSchedule
*/
scheduleTime?: Date | null;
/**
*
*
* @type {string}
* @memberof SysSchedule
*/
content: string;
}

View File

@ -0,0 +1,118 @@
/* tslint:disable */
/* eslint-disable */
/**
* Admin.NET
* .NET <br/><u><b><font color='FF0000'> 👮</font></b></u>
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/**
*
*
* @export
* @interface UpdateScheduleInput
*/
export interface UpdateScheduleInput {
/**
* Id
*
* @type {number}
* @memberof UpdateScheduleInput
*/
id?: number;
/**
*
*
* @type {Date}
* @memberof UpdateScheduleInput
*/
createTime?: Date;
/**
*
*
* @type {Date}
* @memberof UpdateScheduleInput
*/
updateTime?: Date | null;
/**
* Id
*
* @type {number}
* @memberof UpdateScheduleInput
*/
createUserId?: number | null;
/**
*
*
* @type {string}
* @memberof UpdateScheduleInput
*/
createUserName?: string | null;
/**
* Id
*
* @type {number}
* @memberof UpdateScheduleInput
*/
updateUserId?: number | null;
/**
*
*
* @type {string}
* @memberof UpdateScheduleInput
*/
updateUserName?: string | null;
/**
*
*
* @type {boolean}
* @memberof UpdateScheduleInput
*/
isDelete?: boolean;
/**
* Id
*
* @type {number}
* @memberof UpdateScheduleInput
*/
tenantId?: number | null;
/**
* Id
*
* @type {number}
* @memberof UpdateScheduleInput
*/
userId?: number;
/**
*
*
* @type {Date}
* @memberof UpdateScheduleInput
*/
scheduleTime?: Date | null;
/**
*
*
* @type {string}
* @memberof UpdateScheduleInput
*/
content: string;
}

View File

@ -32,5 +32,6 @@ export default {
color: #999;
margin-top: 10px;
line-height: 1.8;
/* height: 100px; */
}
</style>

View File

@ -1,7 +1,9 @@
<template>
<el-card shadow="hover" header="更新记录">
<template #header>
<el-button type="primary" icon="ele-Refresh" round @click="refresh">更新记录</el-button>
<el-icon style="display: inline; vertical-align: middle"> <ele-DocumentCopy /> </el-icon>
<span style=""> 更新记录 </span>
<el-button type="primary" icon="ele-Refresh" round plain @click="refresh" style="float: right">更新记录</el-button>
</template>
<div class="commit" v-loading="state.loading">
<el-timeline style="max-width: 600px" v-if="state.list.length > 0">

View File

@ -0,0 +1,303 @@
<template>
<el-card shadow="hover" header="我的日程" class="item-background">
<template #header>
<el-icon style="display: inline; vertical-align: middle"> <ele-Calendar /> </el-icon>
<span style=""> 我的日程 </span>
<el-button type="primary" icon="ele-CirclePlus" round plain @click="openAddSchedule" style="float: right">添加日程</el-button>
</template>
<div class="custome-canlendar">
<div class="block">
<div class="data-analysis">
<el-calendar v-model="state.calendarValue">
<!--选中小红点-->
<template #date-cell="{ data }">
<div @click="handleClickDate(data)">
<div class="spandate">{{ data.day.split('-').slice(2).join('-') }}</div>
<div v-for="(item, key) in state.ScheduleData" :key="key">
<el-badge v-if="FormatDate(data.day) == FormatDate(item.scheduleTime)" is-dot class="item"></el-badge>
</div>
</div>
</template>
</el-calendar>
</div>
<div class="schedule-list">
<div class="item" v-for="(item, index) in state.TodayScheduleData" :key="index" @click="openEditSchedule(item)">
<!-- <span class="date">{{ item.start_time + '-' + item.end_time }}</span> -->
<el-icon style="display: inline; vertical-align: middle"> <ele-Calendar /> </el-icon>
<span class="content" style="padding-left: 10px">{{ item.content }}</span>
</div>
</div>
</div>
</div>
<EditSchedule ref="editScheduleRef" :title="state.editTitle" @handleQuery="handleQuery"> </EditSchedule>
</el-card>
</template>
<script lang="ts">
export default {
title: '日程',
icon: 'ele-Odometer',
description: '日程演示',
};
</script>
<script setup lang="ts">
import { reactive, onMounted, ref } from 'vue';
import { dayjs } from 'element-plus';
import EditSchedule from '/@/views/home/widgets/components/scheduleEdit.vue';
import { getAPI } from '/@/utils/axios-utils';
import { SysScheduleApi } from '/@/api-services/api';
import { SysSchedule } from '/@/api-services/models';
const editScheduleRef = ref<InstanceType<typeof EditSchedule>>();
const state = reactive({
ScheduleData: [] as Array<SysSchedule>, //
TodayScheduleData: [] as Array<SysSchedule>, //
calendarValue: new Date(),
queryParams: {
startTime: new Date(),
endTime: new Date(),
},
editTitle: '',
});
//
onMounted(async () => {
await handleQuery();
});
//
const handleQuery = async () => {
debugger;
state.queryParams.startTime = GetMonthFirstDay(state.calendarValue);
state.queryParams.endTime = GetMonthLastDay(state.calendarValue);
let params = Object.assign(state.queryParams);
var res = await getAPI(SysScheduleApi).apiSysSchedulePagePost(params);
state.ScheduleData = res.data.result ?? [];
if (state.ScheduleData.length > 0) {
state.TodayScheduleData = state.ScheduleData.filter((item) => {
return FormatDate(item.scheduleTime) == FormatDate(state.calendarValue);
});
}
};
//
const handleQueryByDate = async (date: any) => {
state.queryParams.startTime = FormatDateDelHMS(date);
state.queryParams.endTime = FormatDateDelHMS(date);
let params = Object.assign(state.queryParams);
var res = await getAPI(SysScheduleApi).apiSysSchedulePagePost(params);
state.TodayScheduleData = res.data.result ?? [];
};
//
const openAddSchedule = () => {
state.editTitle = '添加日程';
editScheduleRef.value?.openDialog({ id: undefined, status: 1, orderNo: 100 });
};
//
const openEditSchedule = async (row: any) => {
state.editTitle = '编辑日程';
editScheduleRef.value?.openDialog(row);
};
//
async function handleClickDate(data: any) {
await handleQueryByDate(data.day);
}
function GetMonthFirstDay(date: any) {
var newDate = new Date(date);
newDate.setDate(1);
newDate.setHours(0);
newDate.setMinutes(0);
newDate.setSeconds(0);
return newDate;
}
function GetMonthLastDay(date: any) {
var newDate = new Date(date);
newDate.setMonth(newDate.getMonth() + 1);
newDate.setDate(0);
newDate.setHours(0);
newDate.setMinutes(0);
newDate.setSeconds(0);
return newDate;
}
//
function FormatDateDelHMS(date: any) {
var newDate = new Date(date);
newDate.setHours(0);
newDate.setMinutes(0);
newDate.setSeconds(0);
return newDate;
}
//
function FormatDate(date: any) {
return dayjs(date).format('YYYY-MM-DD');
}
</script>
<style lang="scss" scoped>
.custome-canlendar {
background: #fff;
.title {
padding: 13px 8px 12px 19px;
border-bottom: 1px solid #f2f2f2;
font-weight: 500;
color: #1a1a1a;
font-size: 16px;
position: relative;
&:before {
content: '';
display: inline-block;
height: calc(100% - 30px);
width: 3px;
margin-right: 0px;
background: #c70019;
/*margin-top: 10px;*/
border-radius: 5px;
/*margin-left: 10px;*/
position: absolute;
left: 10px;
top: calc(50% - 7px);
}
.rtbtn {
float: right;
:deep(span) {
font-size: 14px;
}
}
}
}
.block {
height: calc(100% - 10px);
overflow-y: auto;
}
/*日历样式修改*/
.data-analysis {
position: relative;
:deep(.el-calendar) {
.el-calendar-table .el-calendar-day {
width: 100%;
height: 100%;
}
.el-calendar__header {
padding: 6px 10px;
border: 0;
justify-content: space-between;
border-bottom: #666 1px solid;
}
.el-calendar__button-group .el-button-group > .el-button span {
font-size: 14px;
}
.el-calendar-table thead th {
padding: 6px 0;
font-weight: bold;
}
.el-calendar__body {
padding: 8px 0;
}
/*去掉原本背景颜色*/
.el-calendar-table td:hover {
background: transparent;
}
/*去掉选中背景颜色*/
.el-calendar-table td.is-selected {
background: transparent !important;
}
/*修改每一小格大小*/
.el-calendar-table .el-calendar-day {
position: relative;
padding: 6px 8px;
text-align: center;
}
.el-calendar-table .el-calendar-day:hover {
background: transparent;
}
td .spandate {
margin: auto;
width: 26px;
height: 26px;
line-height: 26px;
border-radius: 50%;
// @include level3_fontsize();
}
td.is-selected .spandate {
width: 26px;
height: 26px;
line-height: 26px;
border-radius: 50%;
color: #fff;
background-color: var(--el-color-primary);
}
/*小红点样式*/
.el-badge {
position: absolute;
left: 0;
bottom: -13px;
width: 100%;
}
.el-badge__content {
background-color: var(--el-color-primary);
&.is-dot {
width: 7px;
height: 7px;
}
}
/*日历边框颜色*/
.el-calendar-table tr td:first-child,
.el-calendar-table tr:first-child td,
.el-calendar-table td {
border: 0;
}
}
}
.schedule-list {
padding: 0 20px 10px;
overflow-y: auto; /* 使div可滚动 */
height: 150px;
.item {
position: relative;
margin-bottom: 5px;
padding: 0 11px;
line-height: 24px;
background-color: #f1f1f1;
cursor: pointer;
&::before {
position: absolute;
left: 0;
top: 0;
height: 100%;
content: '';
width: 3px;
background: var(--el-color-primary);
}
.date {
margin-right: 5px;
font-size: 14px;
}
.content {
color: #666;
font-size: 14px;
}
}
}
</style>

View File

@ -0,0 +1,93 @@
<template>
<div class="editSchedule-container">
<el-dialog v-model="state.isShowDialog" draggable :close-on-click-modal="false" width="700px">
<template #header>
<div style="color: #fff">
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>
<span> {{ props.title }} </span>
</div>
</template>
<el-form :model="state.ruleForm" ref="ruleFormRef" label-width="auto">
<el-row :gutter="35">
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="日程时间" prop="scheduleTime" :rules="[{ required: true, message: '日程时间不能为空', trigger: 'blur' }]">
<el-date-picker v-model="state.ruleForm.scheduleTime" type="date" placeholder="请选择日程时间" format="YYYY-MM-DD" value-format="YYYY-MM-DD HH:mm:ss" class="w100" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="日程内容" prop="content" :rules="[{ required: true, message: '内容内容不能为空', trigger: 'blur' }]">
<el-input v-model="state.ruleForm.content" placeholder="内容内容" clearable type="textarea" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script lang="ts" setup name="editSchedule">
import { onMounted, reactive, ref } from 'vue';
import { dayjs, ElMessageBox, ElNotification } from 'element-plus';
import { getAPI } from '/@/utils/axios-utils';
import { SysScheduleApi } from '/@/api-services/api';
import { SysSchedule, UpdateScheduleInput } from '/@/api-services/models';
const props = defineProps({
title: String,
userScheduleData: Array<SysSchedule>,
});
const emits = defineEmits(['handleQuery']);
const ruleFormRef = ref();
const state = reactive({
isShowDialog: false,
ruleForm: {} as any,
});
//
onMounted(async () => {});
//
const openDialog = (row: any) => {
ruleFormRef.value?.resetFields();
state.ruleForm = JSON.parse(JSON.stringify(row));
state.ruleForm.scheduleTime = dayjs(state.ruleForm.scheduleTime ?? new Date()).format('YYYY-MM-DD HH:mm:ss');
state.isShowDialog = true;
};
//
const closeDialog = () => {
emits('handleQuery', true);
state.isShowDialog = false;
};
//
const cancel = () => {
state.isShowDialog = false;
};
//
const submit = () => {
console.log(JSON.stringify(state.ruleForm));
ruleFormRef.value.validate(async (valid: boolean) => {
if (!valid) return;
if (state.ruleForm.id != undefined && state.ruleForm.id > 0) {
await getAPI(SysScheduleApi).apiSysScheduleUpdatePost(state.ruleForm);
} else {
await getAPI(SysScheduleApi).apiSysScheduleAddPost(state.ruleForm);
}
closeDialog();
});
};
//
defineExpose({ openDialog });
</script>

View File

@ -19,7 +19,7 @@ export default {
};
</script>
<script setup lang="ts" name="timeing">
<script setup lang="ts" name="timer">
import { formatDate } from '/@/utils/formatTime';
import { ref, onMounted, onUnmounted } from 'vue';
const time = ref<string>('');

View File

@ -7,11 +7,11 @@
<div style="height: 210px; text-align: center">
<img :src="verSvg" style="height: 140px" />
<h2 style="margin-top: 15px">Admin.NET</h2>
<p style="margin-top: 5px">最新版本 {{ ver }}</p>
<p style="margin-top: 5px">最新版本 {{ version }}</p>
</div>
<div style="margin-top: 20px">
<el-button type="primary" plain round @click="golog">更新日志</el-button>
<el-button type="primary" plain round @click="gogit">gitee</el-button>
<div style="margin-top: 20px; margin-bottom: 20px; float: right">
<el-button type="primary" icon="ele-DocumentCopy" plain round @click="golog">更新日志</el-button>
<el-button type="primary" icon="ele-Eleme" plain round @click="gogit">gitee</el-button>
</div>
</el-card>
</template>
@ -24,18 +24,18 @@ export default {
};
</script>
<script setup lang="ts" name="ver">
<script setup lang="ts" name="version">
import { ref, onMounted } from 'vue';
import verSvg from '/@/assets/img/ver.svg';
const ver = ref<string>('loading...');
const version = ref<string>('loading...');
onMounted(() => {
ver.value = 'v2.0.0';
version.value = 'v2.0.0';
});
const getVer = () => {
ver.value = 'v2.0.0';
version.value = 'v2.0.0';
};
const golog = () => {

View File

@ -7,7 +7,7 @@
<div class="welcome">
<div class="logo">
<!-- <img src="/@/assets/logo.png" style="height: 150px;"/> -->
<h2>欢迎使用 {{ themeConfig.globalTitle }}</h2>
<h2>欢迎使用 Admin.NET</h2>
</div>
<div class="tips">
<div class="tips-item">
@ -37,12 +37,6 @@
</template>
<script lang="ts">
import { storeToRefs } from 'pinia';
import { useThemeConfig } from '/@/stores/themeConfig';
const storesThemeConfig = useThemeConfig();
const { themeConfig } = storeToRefs(storesThemeConfig);
export default {
title: '欢迎',
icon: 'ele-Present',
@ -52,7 +46,7 @@ export default {
<script setup lang="ts" name="welcome">
const godoc = () => {
window.open('http://101.43.53.74:5050/');
window.open('https://gitee.com/zuohuaijun/Admin.NET.git');
};
</script>

View File

@ -13,7 +13,7 @@
<div v-if="nowCompsList.length <= 0" class="no-widgets">
<el-empty description="没有部件啦" :image-size="300"></el-empty>
</div>
<el-row :gutter="15">
<el-row :gutter="8">
<el-col v-for="(item, index) in grid.layout" :key="index" :md="item" :xs="24">
<draggable
v-model="grid.copmsList[index]"
@ -27,12 +27,12 @@
class="draggable-box"
>
<template #item="{ element }">
<div class="widgets-item mb15">
<div class="widgets-item mb8">
<component :is="allComps[element]"></component>
<div v-if="customizing" class="customize-overlay">
<el-button class="close" type="danger" plain icon="ele-Close" @click="remove(element)"></el-button>
<label>
<el-icon><component :is="allComps[element].icon" /></el-icon>{{ allComps[element].title }}
<el-icon> <component :is="allComps[element].icon" /> </el-icon>{{ allComps[element].title }}
</label>
</div>
</div>
@ -43,6 +43,7 @@
</div>
</div>
</div>
<div v-if="customizing" class="widgets-aside">
<div class="widgets-top">
<div class="widgets-aside-title">
@ -111,7 +112,9 @@
</div>
<div v-for="item in myCompsList" :key="item.title" class="widgets-list-item">
<div class="item-logo">
<el-icon><component :is="item.icon" /></el-icon>
<el-icon>
<component :is="item.icon" />
</el-icon>
</div>
<div class="item-info">
<h2>{{ item.title }}</h2>
@ -132,7 +135,7 @@
</template>
<script setup lang="ts">
import { ref, reactive, computed, onMounted, nextTick } from 'vue';
import { ref, computed, onMounted, nextTick } from 'vue';
import draggable from 'vuedraggable';
import { clone } from '/@/utils/arrayOperation';
import allComps from './components/index';
@ -146,8 +149,8 @@ const defaultGrid = {
layout: [12, 6, 6],
copmsList: [
['welcome', 'commit'],
['about', 'ver'],
['timeing', 'progressing'],
['about', 'version'],
['timer', 'schedule'],
],
};
@ -182,7 +185,7 @@ const availableCompsList = computed(() => {
});
const myCompsList = computed(() => {
const myGrid = Local.get('DASHBOARDGRID') || ['welcome', 'myapp', 'ver', 'timeing', 'progressing', 'echarts', 'about', 'commit'];
const myGrid = Local.get('DASHBOARDGRID') || ['welcome', 'myapp', 'version', 'timer', 'echarts', 'about', 'commit', 'schedule'];
return availableCompsList.value.filter((comp) => !comp.disabled && myGrid.includes(comp.key));
});
@ -255,7 +258,7 @@ const close = () => {
flex: 1;
overflow: auto;
overflow-x: hidden;
padding: 10px;
padding: 4px;
}
.widgets-aside {
width: 360px;
@ -292,7 +295,7 @@ const close = () => {
}
.widgets-top {
margin-bottom: 15px;
margin-bottom: 8px;
display: flex;
justify-content: space-between;
align-items: center;