😎1、调整全局大小与vxetable联动 2、代码清理

This commit is contained in:
zuohuaijun 2024-07-06 18:31:55 +08:00
parent a437211418
commit 57b2f884f5
12 changed files with 94 additions and 49 deletions

View File

@ -35,7 +35,7 @@ public class SysWechatRefund : EntityBase
[Required] [Required]
public string OutRefundNo { get; set; } public string OutRefundNo { get; set; }
/// <summary> /// <summary>
/// 退款原因,示例:商品已售完 /// 退款原因,示例:商品已售完
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "退款原因", Length = 80)] [SugarColumn(ColumnDescription = "退款原因", Length = 80)]
@ -62,7 +62,7 @@ public class SysWechatRefund : EntityBase
/// <summary> /// <summary>
/// 退款资金来源, 可不传,默认使用未结算资金退款(仅对老资金流商户适用) /// 退款资金来源, 可不传,默认使用未结算资金退款(仅对老资金流商户适用)
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "退款资金来源", Length = 32)] [SugarColumn(ColumnDescription = "退款资金来源", Length = 32)]
public string FundsAccount { get; set; } public string FundsAccount { get; set; }
/// <summary> /// <summary>
@ -111,11 +111,11 @@ public class SysWechatRefund : EntityBase
/// 附加数据 /// 附加数据
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "附加数据")] [SugarColumn(ColumnDescription = "附加数据")]
public string? Attachment { get; set; } public string? Attachment { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "备注")] [SugarColumn(ColumnDescription = "备注")]
public string? Remark { get; set; } public string? Remark { get; set; }
} }

View File

@ -104,7 +104,7 @@ public class SysCommonService : IDynamicApiController, ITransient
// 接口信息 // 接口信息
var apiController = apiOuput.Children.FirstOrDefault(u => u.Name.Equals(controllerName)); var apiController = apiOuput.Children.FirstOrDefault(u => u.Name.Equals(controllerName));
var displayName = controllerActionDescriptor.MethodInfo.GetCustomAttribute<DisplayNameAttribute>(true)?.DisplayName; var displayName = controllerActionDescriptor.MethodInfo.GetCustomAttribute<DisplayNameAttribute>(true)?.DisplayName;
apiController.Children.Add(new ApiOutput apiController.Children.Add(new ApiOutput
{ {
Name = displayName, Name = displayName,

View File

@ -41,7 +41,7 @@ public class MessageInput
/// <summary> /// <summary>
/// 发送者Id /// 发送者Id
/// </summary> /// </summary>
public string SendUserId{ get; set; } public string SendUserId { get; set; }
/// <summary> /// <summary>
/// 发送者名称 /// 发送者名称

View File

@ -8,7 +8,6 @@ using AlibabaCloud.SDK.Dysmsapi20170525.Models;
using TencentCloud.Common; using TencentCloud.Common;
using TencentCloud.Common.Profile; using TencentCloud.Common.Profile;
using TencentCloud.Sms.V20190711; using TencentCloud.Sms.V20190711;
using static SKIT.FlurlHttpClient.Wechat.Api.Models.ComponentTCBBatchCreateContainerServiceVersionRequest.Types;
namespace Admin.NET.Core.Service; namespace Admin.NET.Core.Service;

View File

@ -52,13 +52,13 @@ public class WechatPayParaInput
public string PrepayId { get; set; } public string PrepayId { get; set; }
} }
public class RefundRequestInput // : WechatTenpayRequest public class RefundRequestInput // : WechatTenpayRequest
{ {
/// <summary> /// <summary>
/// 商户订单号(原支付交易对应的付款单号) /// 商户订单号(原支付交易对应的付款单号)
/// </summary> /// </summary>
public string OutTradeNumber { get; set; } public string OutTradeNumber { get; set; }
///// <summary> ///// <summary>
///// 退款单号 ///// 退款单号
///// </summary> ///// </summary>
@ -67,46 +67,57 @@ public class RefundRequestInput // : WechatTenpayRequest
/// 原订单金额(分) /// 原订单金额(分)
/// </summary> /// </summary>
public int Total { get; set; } public int Total { get; set; }
/// <summary> /// <summary>
/// 退款金额(分) /// 退款金额(分)
/// </summary> /// </summary>
public int Refund { get; set; } public int Refund { get; set; }
/// <summary> /// <summary>
/// 退款原因 /// 退款原因
/// </summary> /// </summary>
public string Reason { get; set; } public string Reason { get; set; }
/// <summary> /// <summary>
/// 关联的商户订单号 /// 关联的商户订单号
/// </summary> /// </summary>
public long OrderId { get; set; } public long OrderId { get; set; }
/// <summary> /// <summary>
/// 关联的商户订单状态(或者为第几次支付,有些订单涉及多次支付,比如先付预付款,后补尾款) /// 关联的商户订单状态(或者为第几次支付,有些订单涉及多次支付,比如先付预付款,后补尾款)
/// </summary> /// </summary>
public int OrderStatus { get; set; } public int OrderStatus { get; set; }
/// <summary> /// <summary>
/// 关联的商户商品编码 /// 关联的商户商品编码
/// </summary> /// </summary>
public string MerchantGoodsId { get; set; } public string MerchantGoodsId { get; set; }
/// <summary> /// <summary>
/// 关联的商户商品名称 /// 关联的商户商品名称
/// </summary> /// </summary>
public string GoodsName { get; set; } public string GoodsName { get; set; }
/// <summary> /// <summary>
/// 关联的商户商品单价 /// 关联的商户商品单价
/// </summary> /// </summary>
public int UnitPrice { get; set; } = 0; public int UnitPrice { get; set; } = 0;
/// <summary> /// <summary>
/// 关联的商户商品退款金额 /// 关联的商户商品退款金额
/// </summary> /// </summary>
public int RefundAmount { get; set; } = 0; public int RefundAmount { get; set; } = 0;
/// <summary> /// <summary>
/// 关联的商户商品退货数量 /// 关联的商户商品退货数量
/// </summary> /// </summary>
public int RefundQuantity { get; set; } = 1; public int RefundQuantity { get; set; } = 1;
/// <summary> /// <summary>
/// 附加数据 /// 附加数据
/// </summary> /// </summary>
public string Attachment { get; set; } public string Attachment { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
@ -120,6 +131,7 @@ public class PageSysWechatPayInput : BasePageInput
/// </summary> /// </summary>
/// <example></example> /// <example></example>
public long? OrderId { get; set; } = -1; public long? OrderId { get; set; } = -1;
/// <summary> /// <summary>
/// order_status /// order_status
/// </summary> /// </summary>
@ -131,11 +143,13 @@ public class PageSysWechatPayInput : BasePageInput
/// </summary> /// </summary>
/// <example></example> /// <example></example>
public string OutTradeNumber { get; set; } public string OutTradeNumber { get; set; }
/// <summary> /// <summary>
/// success_time范围 /// success_time范围
/// </summary> /// </summary>
/// <example></example> /// <example></example>
public List<DateTime?> SuccessTimeRange { get; set; } public List<DateTime?> SuccessTimeRange { get; set; }
/// <summary> /// <summary>
/// expire_time范围 /// expire_time范围
/// </summary> /// </summary>

View File

@ -12,38 +12,47 @@ public class WechatPayOutput
/// OpenId /// OpenId
/// </summary> /// </summary>
public string OpenId { get; set; } public string OpenId { get; set; }
/// <summary> /// <summary>
/// 商户(支付交易)单号,微信唯一 /// 商户(支付交易)单号,微信唯一
/// </summary> /// </summary>
public string OutTradeNumber { get; set; } public string OutTradeNumber { get; set; }
/// <summary> /// <summary>
/// 关联的商户(商品交易)订单号 /// 关联的商户(商品交易)订单号
/// </summary> /// </summary>
public long OrderId { get; set; } public long OrderId { get; set; }
/// <summary> /// <summary>
/// 关联的商户订单状态(或者为第几次支付,有些订单涉及多次支付,比如先付预付款,后补尾款) /// 关联的商户订单状态(或者为第几次支付,有些订单涉及多次支付,比如先付预付款,后补尾款)
/// </summary> /// </summary>
public int OrderStatus { get; set; } public int OrderStatus { get; set; }
/// <summary> /// <summary>
/// 订单金额 /// 订单金额
/// </summary> /// </summary>
public int Total { get; set; } public int Total { get; set; }
/// <summary> /// <summary>
/// 附加数据 /// 附加数据
/// </summary> /// </summary>
public string Attachment { get; set; } public string Attachment { get; set; }
/// <summary> /// <summary>
/// 优惠标记 /// 优惠标记
/// </summary> /// </summary>
public string GoodsTag { get; set; } public string GoodsTag { get; set; }
/// <summary> /// <summary>
/// 支付发起时间 /// 支付发起时间
/// </summary> /// </summary>
public DateTimeOffset CreateTime { get; set; } public DateTimeOffset CreateTime { get; set; }
/// <summary> /// <summary>
/// 支付完成时间 /// 支付完成时间
/// </summary> /// </summary>
public DateTimeOffset SuccessTime { get; set; } public DateTimeOffset SuccessTime { get; set; }
/// <summary> /// <summary>
/// 交易状态(支付成功后,微信返回) /// 交易状态(支付成功后,微信返回)
/// </summary> /// </summary>
@ -59,4 +68,4 @@ public class CreatePayTransactionOutput
{ {
public string PrepayId { get; set; } public string PrepayId { get; set; }
public string OutTradeNumber { get; set; } public string OutTradeNumber { get; set; }
} }

View File

@ -411,7 +411,7 @@ public class SysWechatPayService : IDynamicApiController, ITransient
wechatPay.BankType = response.BankType; // 付款银行类型 wechatPay.BankType = response.BankType; // 付款银行类型
wechatPay.Total = response.Amount.Total; // 订单总金额 wechatPay.Total = response.Amount.Total; // 订单总金额
wechatPay.PayerTotal = response.Amount.PayerTotal; // 用户支付金额 wechatPay.PayerTotal = response.Amount.PayerTotal; // 用户支付金额
wechatPay.SuccessTime = response.SuccessTime; // 支付完成时间 wechatPay.SuccessTime = response.SuccessTime; // 支付完成时间
await _sysWechatPayRep.AsUpdateable(wechatPay).IgnoreColumns(true).ExecuteCommandAsync(); await _sysWechatPayRep.AsUpdateable(wechatPay).IgnoreColumns(true).ExecuteCommandAsync();
return wechatPay.Adapt<WechatPayOutput>(); return wechatPay.Adapt<WechatPayOutput>();
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<el-popover placement="bottom" width="280" trigger="hover"> <el-popover placement="bottom" width="300" trigger="hover">
<template #reference> <template #reference>
<el-text type="primary" class="cursor-default"> <el-text type="primary" class="cursor-default">
<el-icon><ele-InfoFilled /></el-icon> <el-icon><ele-InfoFilled /></el-icon>

View File

@ -6,17 +6,19 @@ import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx';
// import 'vxe-table/lib/style.css'; // 已在theme/vxe.scss引入 // import 'vxe-table/lib/style.css'; // 已在theme/vxe.scss引入
import 'vxe-table-plugin-element/dist/style.css'; import 'vxe-table-plugin-element/dist/style.css';
// Vxe UI 组件库 // Vxe UI 组件库
import VxeUI from 'vxe-pc-ui'; import VxeUI, { VxeComponentSizeType } from 'vxe-pc-ui';
import ExcelJS from 'exceljs'; import ExcelJS from 'exceljs';
import { Local } from '../utils/storage';
export const setupVXETable = (app: App) => { export const setupVXETable = (app: App) => {
let vxeSize = getVxeTableSize();
// 加载插件 // 加载插件
VxeUITable.use(VXETablePluginElement); VxeUITable.use(VXETablePluginElement);
VxeUITable.use(VXETablePluginExportXLSX, { ExcelJS: ExcelJS }); VxeUITable.use(VXETablePluginExportXLSX, { ExcelJS: ExcelJS });
// VXETable全局配置https://vxetable.cn/v4.7/#/table/start/global // VXETable全局配置https://vxetable.cn/v4.7/#/table/start/global
VxeUITable.setConfig({ VxeUITable.setConfig({
theme: 'light', // 主题颜色 theme: 'light', // 主题颜色
size: 'mini', // 全局尺寸 size: vxeSize, // 全局尺寸mini、small、medium/default
// i18n: (key, args) => i18n.global.t(key, args), // i18n: (key, args) => i18n.global.t(key, args),
// zIndex: 999, // 全局 zIndex 起始值,如果项目的的 z-index 样式值过大时就需要跟随设置更大,避免被遮挡 // zIndex: 999, // 全局 zIndex 起始值,如果项目的的 z-index 样式值过大时就需要跟随设置更大,避免被遮挡
// version: 0, // 版本号,对于某些带数据缓存的功能有用到,上升版本号可以用于重置数据 // version: 0, // 版本号,对于某些带数据缓存的功能有用到,上升版本号可以用于重置数据
@ -26,7 +28,7 @@ export const setupVXETable = (app: App) => {
stripe: true, // 是否带有斑马纹 stripe: true, // 是否带有斑马纹
// keepSource: false,// 保持原始值的状态,被某些功能所依赖,比如编辑状态、还原数据等(开启后影响性能,具体取决于数据量) // keepSource: false,// 保持原始值的状态,被某些功能所依赖,比如编辑状态、还原数据等(开启后影响性能,具体取决于数据量)
showOverflow: true, // 设置所有内容过长时显示为省略号(如果是固定列建议设置该值,提升渲染速度) showOverflow: true, // 设置所有内容过长时显示为省略号(如果是固定列建议设置该值,提升渲染速度)
size: 'mini', // 表格的尺寸[medium, small, mini] size: vxeSize, // 表格的尺寸[medium, small, mini]
autoResize: true, // 自动监听父元素的变化去重新计算表格(对于父元素可能存在动态变化、显示隐藏的容器中、列宽异常等场景中的可能会用到) autoResize: true, // 自动监听父元素的变化去重新计算表格(对于父元素可能存在动态变化、显示隐藏的容器中、列宽异常等场景中的可能会用到)
round: false, // 是否为圆角边框 round: false, // 是否为圆角边框
emptyText: '暂无数据', // emptyText: '暂无数据', //
@ -80,15 +82,15 @@ export const setupVXETable = (app: App) => {
}, },
}, },
grid: { grid: {
size: 'mini', size: vxeSize,
toolbarConfig: { toolbarConfig: {
size: 'mini', // 尺寸 medium, small, mini size: vxeSize, // 尺寸 medium, small, mini
perfect: false, // 配套的样式 perfect: false, // 配套的样式
}, },
zoomConfig: { escRestore: true }, // 是否允许通过按下 ESC 键还原 zoomConfig: { escRestore: true }, // 是否允许通过按下 ESC 键还原
}, },
pager: { pager: {
size: 'mini', size: vxeSize,
background: true, // 带背景颜色 background: true, // 带背景颜色
perfect: false, // 配套的样式 perfect: false, // 配套的样式
autoHidden: false, // 当只有一页时自动隐藏 autoHidden: false, // 当只有一页时自动隐藏
@ -107,3 +109,17 @@ export const setupVXETable = (app: App) => {
// app.config.globalProperties.$XSaveFile = VxeUI.saveFile // app.config.globalProperties.$XSaveFile = VxeUI.saveFile
// app.config.globalProperties.$XReadFile = VxeUI.readFile // app.config.globalProperties.$XReadFile = VxeUI.readFile
}; };
// 从全局主题里面获取组件大小模式
function getVxeTableSize() {
let themeConfig = Local.get('themeConfig');
let size = themeConfig.globalComponentSize;
// 匹配vxetable大小模式
let vxeSize: VxeComponentSizeType = 'mini';
if (size == 'large') vxeSize = 'medium';
else if (size == 'default') vxeSize = 'small';
else if (size == 'small') vxeSize = 'mini';
return vxeSize;
}

View File

@ -95,13 +95,13 @@ import { useThemeConfig } from '/@/stores/themeConfig';
import other from '/@/utils/other'; import other from '/@/utils/other';
import mittBus from '/@/utils/mitt'; import mittBus from '/@/utils/mitt';
import { Local } from '/@/utils/storage'; import { Local } from '/@/utils/storage';
import { clearAccessTokens, getAPI } from '/@/utils/axios-utils';
import { SysAuthApi, SysNoticeApi } from '/@/api-services/api';
import Push from 'push.js'; import Push from 'push.js';
import { signalR } from '/@/views/system/onlineUser/signalR'; import { signalR } from '/@/views/system/onlineUser/signalR';
import { Avatar, Guide } from '@element-plus/icons-vue'; import { Avatar, Guide } from '@element-plus/icons-vue';
import { clearAccessTokens, getAPI } from '/@/utils/axios-utils';
import { SysAuthApi, SysNoticeApi } from '/@/api-services/api';
// //
const UserNews = defineAsyncComponent(() => import('/@/layout/navBars/topBar/userNews.vue')); const UserNews = defineAsyncComponent(() => import('/@/layout/navBars/topBar/userNews.vue'));
const Search = defineAsyncComponent(() => import('/@/layout/navBars/topBar/search.vue')); const Search = defineAsyncComponent(() => import('/@/layout/navBars/topBar/search.vue'));

View File

@ -1,6 +1,7 @@
@import 'vxe-table/styles/all.scss'; @import 'vxe-table/styles/all.scss';
@import 'vxe-pc-ui/styles/all.scss'; @import 'vxe-pc-ui/styles/all.scss';
// 全局变量参考地址 https://github.com/x-extends/vxe-table/blob/master/styles/theme/base.scss
:root { :root {
--vxe-ui-font-family: var(--el-font-family); --vxe-ui-font-family: var(--el-font-family);
// --vxe-ui-font-color: var(--el-text-color-primary); // #606266; // --vxe-ui-font-color: var(--el-text-color-primary); // #606266;

View File

@ -46,7 +46,7 @@
</template> </template>
<script setup lang="ts" name="sysInfoSetting"> <script setup lang="ts" name="sysInfoSetting">
import { nextTick, reactive } from 'vue'; import { nextTick, onMounted, reactive } from 'vue';
import { getAPI } from '/@/utils/axios-utils'; import { getAPI } from '/@/utils/axios-utils';
import { SysConfigApi } from '/@/api-services'; import { SysConfigApi } from '/@/api-services';
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
@ -68,6 +68,37 @@ const state = reactive({
}, },
}); });
//
onMounted(async () => {
loadData();
});
//
const loadData = async () => {
try {
state.isLoading = true;
const res = await getAPI(SysConfigApi).apiSysConfigSysInfoGet();
if (res.data!.type !== 'success') return;
const result = res.data.result;
state.formData = {
sysLogoBlob: undefined,
sysLogo: result.sysLogo,
sysTitle: result.sysTitle,
sysViceTitle: result.sysViceTitle,
sysViceDesc: result.sysViceDesc,
sysWatermark: result.sysWatermark,
sysCopyright: result.sysCopyright,
sysIcp: result.sysIcp,
sysIcpUrl: result.sysIcpUrl,
};
} finally {
nextTick(() => {
state.isLoading = false;
});
}
};
// onChange // onChange
const handleUploadChange = (file: any) => { const handleUploadChange = (file: any) => {
state.file = file; state.file = file;
@ -101,40 +132,15 @@ const onSave = async () => {
state.file = undefined; state.file = undefined;
await loadData(); await loadData();
ElMessage.success('保存成功'); ElMessage.success('保存成功');
//
window.location.reload();
} finally { } finally {
nextTick(() => { nextTick(() => {
state.isLoading = false; state.isLoading = false;
}); });
} }
}; };
//
const loadData = async () => {
try {
state.isLoading = true;
const res = await getAPI(SysConfigApi).apiSysConfigSysInfoGet();
if (res.data!.type !== 'success') return;
const result = res.data.result;
state.formData = {
sysLogoBlob: undefined,
sysLogo: result.sysLogo,
sysTitle: result.sysTitle,
sysViceTitle: result.sysViceTitle,
sysViceDesc: result.sysViceDesc,
sysWatermark: result.sysWatermark,
sysCopyright: result.sysCopyright,
sysIcp: result.sysIcp,
sysIcpUrl: result.sysIcpUrl,
};
} finally {
nextTick(() => {
state.isLoading = false;
});
}
};
loadData();
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>