Compare commits

...

6 Commits

Author SHA1 Message Date
JEECG
69fca254f0 补充注释 2025-08-13 11:47:27 +08:00
JEECG
b3de596199 彻底关闭 prettier 校验规则 2025-08-13 11:47:16 +08:00
JEECG
f46273d15e 设置ESLint 的 vue/html-self-closing 自闭合标签警告配置 2025-08-13 10:26:23 +08:00
JEECG
0fe258dbc2 修复 onExportXls defSort 不生效问题 #7570 2025-08-13 09:26:16 +08:00
JEECG
de7f23c555 Merge pull request #8496 from lileiAimee/developer
解决TableAction中自定义图标颜色不起作用的问题
2025-08-13 09:20:31 +08:00
lileiAimee
444c7140f6 解决TableAction中自定义图标颜色不起作用的问题 2025-06-25 09:55:07 +08:00
4 changed files with 26 additions and 8 deletions

View File

@@ -25,6 +25,7 @@ module.exports = defineConfig({
'plugin:jest/recommended',
],
rules: {
'prettier/prettier': 'off', // 彻底关闭 prettier 校验规则
'vue/script-setup-uses-vars': 'error',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
@@ -67,8 +68,8 @@ module.exports = defineConfig({
{
html: {
void: 'always',
normal: 'never',
component: 'always',
normal: 'any',
component: 'any',
},
svg: 'always',
math: 'always',

View File

@@ -15,6 +15,6 @@ module.exports = {
requirePragma: false,
proseWrap: 'never',
htmlWhitespaceSensitivity: 'strict',
endOfLine: 'auto',
endOfLine: 'auto', // 自动处理换行符LF/CRLF
rangeStart: 0,
};

View File

@@ -7,12 +7,12 @@
<template v-else>
<Tooltip v-if="action.tooltip" v-bind="getTooltip(action.tooltip)">
<PopConfirmButton v-bind="action">
<Icon :icon="action.icon" :class="{ 'mr-1': !!action.label }" v-if="action.icon" />
<Icon :icon="action.icon" :class="{ 'mr-1': !!action.label }" v-if="action.icon" :color="action.iconColor"/>
<template v-if="action.label">{{ action.label }}</template>
</PopConfirmButton>
</Tooltip>
<PopConfirmButton v-else v-bind="action">
<Icon :icon="action.icon" :class="{ 'mr-1': !!action.label }" v-if="action.icon" />
<Icon :icon="action.icon" :class="{ 'mr-1': !!action.label }" v-if="action.icon" :color="action.iconColor"/>
<template v-if="action.label">{{ action.label }}</template>
</PopConfirmButton>
</template>

View File

@@ -16,7 +16,10 @@ interface ListPageOptions {
// 样式作用域范围
designScope?: string;
// 【必填】表格参数配置
tableProps: TableProps;
tableProps: TableProps & {
// 添加 defSort 类型定义
defSort?: DefSort;
};
// 是否分页
pagination?: boolean;
// 导出配置
@@ -46,6 +49,11 @@ interface IDoRequestOptions {
clearSelection?: boolean;
}
interface DefSort {
column: string;
order: 'asc' | 'desc';
}
/**
* listPage页面公共方法
*
@@ -85,8 +93,17 @@ export function useListPage(options: ListPageOptions) {
//update-end-author:taoyan date:20220507 for: erp代码生成 子表 导出报错,原因未知-
//update-begin-author:liusq date:20230410 for:[/issues/409]导出功能没有按排序结果导出,设置导出默认排序,创建时间倒序
if(!paramsForm?.column){
Object.assign(paramsForm,{column:'createTime',order:'desc'});
// 获取表格的默认排序
const { defSort } = options?.tableProps ?? {};
if (defSort && !paramsForm?.column) {
// 使用类型断言确保 defSort 类型正确
Object.assign(paramsForm, {
column: (defSort as DefSort).column,
order: (defSort as DefSort).order,
});
} else if (!paramsForm?.column) {
// 如果没有默认排序,则使用创建时间倒序
Object.assign(paramsForm, { column: 'createTime', order: 'desc' });
}
//update-begin-author:liusq date:20230410 for: [/issues/409]导出功能没有按排序结果导出,设置导出默认排序,创建时间倒序