feat: 自行开发设计 ui样式优化 超管端-控制台 相关的页面
This commit is contained in:
@@ -27,6 +27,7 @@ import { renderToStaticMarkup } from 'react-dom/server';
|
||||
import * as Ant from 'antd';
|
||||
import * as pagination from '../src/components/ui/pagination.js';
|
||||
import { transformWithEsbuild } from 'vite';
|
||||
import * as clipboard from '../src/helpers/clipboard.js';
|
||||
|
||||
async function compile(relativePath) {
|
||||
const filename = new URL(relativePath, import.meta.url);
|
||||
@@ -61,6 +62,7 @@ const { createCardProPagination } = loadUtils({
|
||||
'./officialPrice': {},
|
||||
'./data': {},
|
||||
'./tableCompactMode.js': {},
|
||||
'./clipboard': clipboard,
|
||||
});
|
||||
const loadUsersPage = await compile('../src/components/table/users/index.jsx');
|
||||
|
||||
@@ -75,8 +77,11 @@ function paginationProps(element) {
|
||||
function foundationFor(props) {
|
||||
const events = paginationEvents(props);
|
||||
return {
|
||||
changePageSize: size => { events.onShowSizeChange(props.currentPage, size); events.onChange(props.currentPage, size); },
|
||||
goPage: page => events.onChange(page, props.pageSize),
|
||||
changePageSize: (size) => {
|
||||
events.onShowSizeChange(props.currentPage, size);
|
||||
events.onChange(props.currentPage, size);
|
||||
},
|
||||
goPage: (page) => events.onChange(page, props.pageSize),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -130,6 +135,7 @@ for (const isMobile of [false, true]) {
|
||||
'../../../hooks/users/useUsersData': { useUsersData: () => usersData },
|
||||
'../../../hooks/common/useIsMobile': { useIsMobile: () => isMobile },
|
||||
'../../../helpers/utils': { createCardProPagination },
|
||||
'../../console/ConsoleContext': { useConsolePage: () => null },
|
||||
});
|
||||
const renderPagination = () => {
|
||||
const card = React.Children.toArray(UsersPage().props.children).find(
|
||||
@@ -166,9 +172,14 @@ const { Table, Pagination } = loadUi({
|
||||
antd: Ant,
|
||||
'./controls': { controlSize: (size) => size },
|
||||
'./pagination': pagination,
|
||||
'./pagination.css': {},
|
||||
'../../hooks/common/useIsMobile': { useIsMobile: () => false },
|
||||
'./overlayPolicy': {},
|
||||
'./form': {},
|
||||
'./chat': {},
|
||||
'../console/ConsoleContext': { useConsolePage: () => null },
|
||||
'../console/ConsolePrimitives': {},
|
||||
'../console/consoleTableAdapter': {},
|
||||
});
|
||||
|
||||
for (const [name, render] of [
|
||||
@@ -181,7 +192,7 @@ for (const [name, render] of [
|
||||
pagination: props,
|
||||
}),
|
||||
],
|
||||
['Pagination', (props) => Pagination(props)],
|
||||
['Pagination', (props) => React.createElement(Pagination, props)],
|
||||
]) {
|
||||
test(`${name} renders legacy boolean showTotal without crashing`, () => {
|
||||
const element = render({ total: 25, pageSize: 10, showTotal: true });
|
||||
|
||||
Reference in New Issue
Block a user