😎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

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

View File

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

View File

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

View File

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

View File

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

View File

@ -46,7 +46,7 @@
</template>
<script setup lang="ts" name="sysInfoSetting">
import { nextTick, reactive } from 'vue';
import { nextTick, onMounted, reactive } from 'vue';
import { getAPI } from '/@/utils/axios-utils';
import { SysConfigApi } from '/@/api-services';
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
const handleUploadChange = (file: any) => {
state.file = file;
@ -101,40 +132,15 @@ const onSave = async () => {
state.file = undefined;
await loadData();
ElMessage.success('保存成功');
//
window.location.reload();
} finally {
nextTick(() => {
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>
<style lang="scss" scoped>