diff --git a/mock/_utils.js b/mock/_utils.js index 91e0a69..bbcbc4c 100644 --- a/mock/_utils.js +++ b/mock/_utils.js @@ -27,7 +27,6 @@ export function randomAvatar() { 'https://pbs.twimg.com/profile_images/584098247641300992/N25WgvW_.png', 'https://d3iw72m71ie81c.cloudfront.net/male-5.jpg', 'https://images.pexels.com/photos/413723/pexels-photo-413723.jpeg?h=350&auto=compress&cs=tinysrgb', - 'https://images.pexels.com/photos/61100/pexels-photo-61100.jpeg?h=350&auto=compress&cs=tinysrgb', 'https://randomuser.me/api/portraits/women/44.jpg', 'https://randomuser.me/api/portraits/women/68.jpg', 'https://randomuser.me/api/portraits/women/65.jpg', diff --git a/mock/route.js b/mock/route.js index 1a6e00f..b4f35ee 100644 --- a/mock/route.js +++ b/mock/route.js @@ -48,15 +48,6 @@ const database = [ zhName: 'UI组件', icon: 'camera-o', }, - { - id: '43', - breadcrumbParentId: '4', - menuParentId: '4', - name: 'DropOption', - zhName: 'DropOption', - icon: 'bars', - route: '/UIElement/dropOption', - }, { id: '45', breadcrumbParentId: '4', diff --git a/src/layouts/PrimaryLayout.js b/src/layouts/PrimaryLayout.js index 1fff7e8..3d5c33c 100644 --- a/src/layouts/PrimaryLayout.js +++ b/src/layouts/PrimaryLayout.js @@ -4,7 +4,7 @@ import React, { PureComponent, Fragment } from 'react' import PropTypes from 'prop-types' import withRouter from 'umi/withRouter' import { connect } from 'dva' -import { MyLayout, ScrollBar } from 'components' +import { MyLayout } from 'components' import { BackTop, Layout, Drawer } from 'antd' import { GlobalFooter } from 'ant-design-pro' import { enquireScreen, unenquireScreen } from 'enquire-js' @@ -138,26 +138,19 @@ class PrimaryLayout extends PureComponent { style={{ paddingTop: config.fixedHeader ? 72 : 0 }} id="primaryLayout" > - -
- - - {hasPermission ? children : } - - document.querySelector('#primaryLayout>div')} - /> - - +
+ + + {hasPermission ? children : } + + document.querySelector('#primaryLayout>div')} + /> + diff --git a/src/layouts/PrimaryLayout.less b/src/layouts/PrimaryLayout.less index 009cad3..6ee60c9 100644 --- a/src/layouts/PrimaryLayout.less +++ b/src/layouts/PrimaryLayout.less @@ -1,16 +1,5 @@ @import '~themes/vars.less'; -@media (max-width: 767px) { - .content { - padding: 12px; - } - - .backTop { - right: 20px; - bottom: 20px; - } -} - .backTop { right: 50px; @@ -31,12 +20,15 @@ .content { padding: 24px; min-height: ~'calc(100% - 72px)'; + // overflow-y: scroll; } .container { height: 100vh; flex: 1; width: ~'calc(100% - 256px)'; + overflow-y: scroll; + overflow-x: hidden; } .footer { @@ -47,3 +39,20 @@ padding-bottom: 24px; min-height: 72px; } + +@media (max-width: 767px) { + .content { + padding: 12px; + } + + .backTop { + right: 20px; + bottom: 20px; + } + + .container { + height: 100vh; + flex: 1; + width: 100%; + } +} diff --git a/src/pages/UIElement/dropOption/index.js b/src/pages/UIElement/dropOption/index.js deleted file mode 100644 index 1d848f2..0000000 --- a/src/pages/UIElement/dropOption/index.js +++ /dev/null @@ -1,112 +0,0 @@ -import React from 'react' -import { DropOption, Page } from 'components' -import { Table, Row, Col, Card, message } from 'antd' - -const DropOptionPage = () => ( - - - - - - - - - - - - - - - { - switch (key) { - case '1': - message.success('点击了编辑') - break - case '2': - message.success('点击了删除') - break - default: - break - } - }} - /> - - - -

Props

- - - key} - pagination={false} - bordered - scroll={{ x: 800 }} - columns={[ - { - title: '参数', - dataIndex: 'props', - }, - { - title: '说明', - dataIndex: 'desciption', - }, - { - title: '类型', - dataIndex: 'type', - }, - { - title: '默认值', - dataIndex: 'default', - }, - ]} - dataSource={[ - { - props: 'menuOptions', - desciption: '下拉操作的选项,格式为[{name:string,key:string}]', - type: 'Array', - default: '必选', - }, - { - props: 'onMenuClick', - desciption: - '点击 menuitem 调用此函数,参数为 {item, key, keyPath}', - type: 'Function', - default: '-', - }, - { - props: 'buttonStyle', - desciption: '按钮的样式', - type: 'Object', - default: '-', - }, - { - props: 'dropdownProps', - desciption: '下拉菜单的参数,可参考antd的【Dropdown】组件', - type: 'Object', - default: '-', - }, - ]} - /> - - - -) - -export default DropOptionPage diff --git a/src/pages/UIElement/editor/index.js b/src/pages/UIElement/editor/index.js index 052ec87..0fffab1 100644 --- a/src/pages/UIElement/editor/index.js +++ b/src/pages/UIElement/editor/index.js @@ -24,6 +24,9 @@ export default class EditorPage extends React.Component { const colProps = { lg: 12, md: 24, + style: { + marginBottom: 32, + }, } const textareaStyle = { minHeight: 496, diff --git a/src/pages/dashboard/components/user-background.png b/src/pages/dashboard/components/user-background.png new file mode 100644 index 0000000..5f99e13 Binary files /dev/null and b/src/pages/dashboard/components/user-background.png differ diff --git a/src/pages/dashboard/components/user.less b/src/pages/dashboard/components/user.less index 00645c1..d55a3e9 100644 --- a/src/pages/dashboard/components/user.less +++ b/src/pages/dashboard/components/user.less @@ -16,7 +16,8 @@ &::after { content: ''; - background: #c5bec7; + background-image: url('./user-background.png'); + background-size: contain; position: absolute; width: 100%; height: 200px; diff --git a/src/pages/post/components/List.js b/src/pages/post/components/List.js index e7741fc..c1ee0da 100644 --- a/src/pages/post/components/List.js +++ b/src/pages/post/components/List.js @@ -1,6 +1,8 @@ import React, { PureComponent } from 'react' import { Table, Avatar } from 'antd' import { withI18n } from '@lingui/react' +import { Ellipsis } from 'ant-design-pro' +import styles from './List.less' @withI18n() class List extends PureComponent { @@ -10,12 +12,12 @@ class List extends PureComponent { { title: i18n.t`Image`, dataIndex: 'image', - width: 100, render: text => , }, { title: i18n.t`Title`, dataIndex: 'title', + render: text => {text}, }, { title: i18n.t`Author`, @@ -56,7 +58,7 @@ class List extends PureComponent { showTotal: total => i18n.t`Total ${total} Items`, }} bordered - scroll={{ x: 1200, y: 'auto' }} + className={styles.table} columns={columns} simple rowKey={record => record.id} diff --git a/src/pages/post/components/List.less b/src/pages/post/components/List.less new file mode 100644 index 0000000..6d35765 --- /dev/null +++ b/src/pages/post/components/List.less @@ -0,0 +1,7 @@ +.table { + :global { + .ant-table td { + white-space: nowrap; + } + } +} diff --git a/src/pages/user/components/List.js b/src/pages/user/components/List.js index 39fc25b..a9d59b9 100644 --- a/src/pages/user/components/List.js +++ b/src/pages/user/components/List.js @@ -4,6 +4,7 @@ import { Table, Modal, Avatar } from 'antd' import { DropOption } from 'components' import { Trans, withI18n } from '@lingui/react' import Link from 'umi/link' +import styles from './List.less' const { confirm } = Modal @@ -38,7 +39,8 @@ class List extends PureComponent { title: Avatar, dataIndex: 'avatar', key: 'avatar', - width: 100, + width: 72, + fixed: 'left', render: text => , }, { @@ -86,7 +88,7 @@ class List extends PureComponent { { title: Operation, key: 'operation', - width: 100, + fixed: 'right', render: (text, record) => { return ( i18n.t`Total ${total} Items`, }} + className={styles.table} bordered - scroll={{ x: 1250, y: 'auto' }} + scroll={{ x: 1600 }} columns={columns} simple rowKey={record => record.id} diff --git a/src/pages/user/components/List.less b/src/pages/user/components/List.less new file mode 100644 index 0000000..6d35765 --- /dev/null +++ b/src/pages/user/components/List.less @@ -0,0 +1,7 @@ +.table { + :global { + .ant-table td { + white-space: nowrap; + } + } +} diff --git a/src/pages/user/components/Modal.js b/src/pages/user/components/Modal.js index 8f2a193..2d8fe28 100644 --- a/src/pages/user/components/Modal.js +++ b/src/pages/user/components/Modal.js @@ -139,7 +139,6 @@ class UserModal extends PureComponent { } UserModal.propTypes = { - form: PropTypes.object.isRequired, type: PropTypes.string, item: PropTypes.object, onOk: PropTypes.func, diff --git a/src/utils/config.js b/src/utils/config.js index 2da1835..786ee40 100644 --- a/src/utils/config.js +++ b/src/utils/config.js @@ -4,7 +4,7 @@ module.exports = { copyright: 'Ant Design Admin © 2018 zuiidea', logoPath: '/logo.svg', apiPrefix: '/api/v1', - fixedHeader: true, // sticky primary layout header + // fixedHeader: true, // sticky primary layout header /* Layout configuration, specify which layout to use for route. */ layouts: [