Browse Source

优化一些小问题

pull/11096/head
期贤 2 years ago
parent
commit
b4069b2d95
  1. 13475
      pnpm-lock.yaml
  2. 21
      src/pages/dashboard/analysis/components/IntroduceRow.tsx
  3. 4
      src/pages/dashboard/analysis/components/SalesCard.tsx
  4. 10
      src/pages/dashboard/analysis/style.style.ts
  5. 8
      src/pages/list/basic-list/components/OperationModal.tsx
  6. 4
      src/pages/list/basic-list/index.tsx
  7. 2
      src/pages/list/basic-list/style.style.ts
  8. 2
      src/pages/list/table-list/components/CreateForm.tsx
  9. 2
      src/pages/list/table-list/components/UpdateForm.tsx
  10. 4
      src/pages/list/table-list/index.tsx
  11. 8
      src/pages/user/register/index.tsx

13475
pnpm-lock.yaml

File diff suppressed because it is too large

21
src/pages/dashboard/analysis/components/IntroduceRow.tsx

@ -1,6 +1,6 @@
import { InfoCircleOutlined } from '@ant-design/icons'; import { InfoCircleOutlined } from '@ant-design/icons';
import { Tiny } from '@ant-design/plots'; import { Tiny } from '@ant-design/plots';
import { Col, Row, Tooltip } from 'antd'; import { Col, Progress, Row, Tooltip } from 'antd';
import numeral from 'numeral'; import numeral from 'numeral';
import type { DataItem } from '../data.d'; import type { DataItem } from '../data.d';
import useStyles from '../style.style'; import useStyles from '../style.style';
@ -70,7 +70,11 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
yField="y" yField="y"
shapeField="smooth" shapeField="smooth"
height={46} height={46}
style={{ fill: 'linear-gradient(-90deg, white 0%, #975FE4 100%)', fillOpacity: 0.6 }} style={{
fill: 'linear-gradient(-90deg, white 0%, #975FE4 100%)',
fillOpacity: 0.6,
width: '100%',
}}
data={visitData} data={visitData}
line={{ style: { stroke: '#975FE4' } }} line={{ style: { stroke: '#975FE4' } }}
/> />
@ -134,18 +138,7 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
} }
contentHeight={46} contentHeight={46}
> >
<Tiny.Progress <Progress percent={78} strokeColor={{ from: '#108ee9', to: '#87d068' }} status="active" />
height={12}
color={['#E9EEF4', '#13C2C2']}
percent={0.78}
annotations={[
{
type: 'lineY',
data: [0.8],
style: { stroke: '#13C2C2', strokeOpacity: 1 },
},
]}
/>
</ChartCard> </ChartCard>
</Col> </Col>
</Row> </Row>

4
src/pages/dashboard/analysis/components/SalesCard.tsx

@ -173,8 +173,8 @@ const SalesCard = ({
{rankingListData.map((item, i) => ( {rankingListData.map((item, i) => (
<li key={item.title}> <li key={item.title}>
<span <span
className={`${styles.rankingItemNumber} ${ className={`${
i < 3 ? styles.active : '' i < 3 ? styles.rankingItemNumberActive : styles.rankingItemNumber
}`} }`}
> >
{i + 1} {i + 1}

10
src/pages/dashboard/analysis/style.style.ts

@ -60,6 +60,16 @@ const useStyles = createStyles(({ token }) => {
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
}, },
rankingItemNumberActive: { rankingItemNumberActive: {
display: 'inline-block',
width: '20px',
height: '20px',
marginTop: '1.5px',
marginRight: '16px',
fontWeight: '600',
fontSize: '12px',
lineHeight: '20px',
textAlign: 'center',
borderRadius: '20px',
color: '#fff', color: '#fff',
backgroundColor: token.colorBgSpotlight, backgroundColor: token.colorBgSpotlight,
}, },

8
src/pages/list/basic-list/components/OperationModal.tsx

@ -11,7 +11,7 @@ import type { BasicListItemDataType } from '../data.d';
import useStyles from '../style.style'; import useStyles from '../style.style';
type OperationModalProps = { type OperationModalProps = {
done: boolean; done: boolean;
visible: boolean; open: boolean;
current: Partial<BasicListItemDataType> | undefined; current: Partial<BasicListItemDataType> | undefined;
onDone: () => void; onDone: () => void;
onSubmit: (values: BasicListItemDataType) => void; onSubmit: (values: BasicListItemDataType) => void;
@ -19,13 +19,13 @@ type OperationModalProps = {
}; };
const OperationModal: FC<OperationModalProps> = (props) => { const OperationModal: FC<OperationModalProps> = (props) => {
const { styles } = useStyles(); const { styles } = useStyles();
const { done, visible, current, onDone, onSubmit, children } = props; const { done, open, current, onDone, onSubmit, children } = props;
if (!visible) { if (!open) {
return null; return null;
} }
return ( return (
<ModalForm<BasicListItemDataType> <ModalForm<BasicListItemDataType>
visible={visible} open={open}
title={done ? null : `任务${current ? '编辑' : '添加'}`} title={done ? null : `任务${current ? '编辑' : '添加'}`}
className={styles.standardListForm} className={styles.standardListForm}
width={640} width={640}

4
src/pages/list/basic-list/index.tsx

@ -70,7 +70,7 @@ const ListContent = ({
export const BasicList: FC = () => { export const BasicList: FC = () => {
const { styles } = useStyles(); const { styles } = useStyles();
const [done, setDone] = useState<boolean>(false); const [done, setDone] = useState<boolean>(false);
const [visible, setVisible] = useState<boolean>(false); const [open, setVisible] = useState<boolean>(false);
const [current, setCurrent] = useState<Partial<BasicListItemDataType> | undefined>(undefined); const [current, setCurrent] = useState<Partial<BasicListItemDataType> | undefined>(undefined);
const { const {
data: listData, data: listData,
@ -247,7 +247,7 @@ export const BasicList: FC = () => {
</Button> </Button>
<OperationModal <OperationModal
done={done} done={done}
visible={visible} open={open}
current={current} current={current}
onDone={handleDone} onDone={handleDone}
onSubmit={handleSubmit} onSubmit={handleSubmit}

2
src/pages/list/basic-list/style.style.ts

@ -111,7 +111,7 @@ const useStyles = createStyles(({ token }) => {
listCard: { listCard: {
[`@media screen and (max-width: ${token.screenXS}px)`]: { [`@media screen and (max-width: ${token.screenXS}px)`]: {
'.ant-card-head-title': { '.ant-card-head-title': {
overflow: 'visible', overflow: 'open',
}, },
}, },
[`@media screen and (max-width: ${token.screenMD}px)`]: { [`@media screen and (max-width: ${token.screenMD}px)`]: {

2
src/pages/list/table-list/components/CreateForm.tsx

@ -14,7 +14,7 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
<Modal <Modal
destroyOnClose destroyOnClose
title="新建规则" title="新建规则"
visible={modalVisible} open={modalVisible}
onCancel={() => onCancel()} onCancel={() => onCancel()}
footer={null} footer={null}
> >

2
src/pages/list/table-list/components/UpdateForm.tsx

@ -40,7 +40,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
}} }}
destroyOnClose destroyOnClose
title="规则配置" title="规则配置"
visible={props.updateModalVisible} open={props.updateModalVisible}
footer={submitter} footer={submitter}
onCancel={() => { onCancel={() => {
props.onCancel(); props.onCancel();

4
src/pages/list/table-list/index.tsx

@ -249,7 +249,7 @@ const TableList: React.FC = () => {
<ModalForm <ModalForm
title="新建规则" title="新建规则"
width="400px" width="400px"
visible={createModalVisible} open={createModalVisible}
onVisibleChange={handleModalVisible} onVisibleChange={handleModalVisible}
onFinish={async (value) => { onFinish={async (value) => {
const success = await handleAdd(value as TableListItem); const success = await handleAdd(value as TableListItem);
@ -296,7 +296,7 @@ const TableList: React.FC = () => {
<Drawer <Drawer
width={600} width={600}
visible={showDetail} open={showDetail}
onClose={() => { onClose={() => {
setCurrentRow(undefined); setCurrentRow(undefined);
setShowDetail(false); setShowDetail(false);

8
src/pages/user/register/index.tsx

@ -22,7 +22,7 @@ const passwordProgressMap: {
const Register: FC = () => { const Register: FC = () => {
const { styles } = useStyles(); const { styles } = useStyles();
const [count, setCount]: [number, any] = useState(0); const [count, setCount]: [number, any] = useState(0);
const [visible, setVisible]: [boolean, any] = useState(false); const [open, setVisible]: [boolean, any] = useState(false);
const [prefix, setPrefix]: [string, any] = useState('86'); const [prefix, setPrefix]: [string, any] = useState('86');
const [popover, setPopover]: [boolean, any] = useState(false); const [popover, setPopover]: [boolean, any] = useState(false);
const confirmDirty = false; const confirmDirty = false;
@ -105,7 +105,7 @@ const Register: FC = () => {
return promise.reject('请输入密码!'); return promise.reject('请输入密码!');
} }
// 有值的情况 // 有值的情况
if (!visible) { if (!open) {
setVisible(!!value); setVisible(!!value);
} }
setPopover(!popover); setPopover(!popover);
@ -161,7 +161,7 @@ const Register: FC = () => {
return node; return node;
}} }}
content={ content={
visible && ( open && (
<div <div
style={{ style={{
padding: '4px 0', padding: '4px 0',
@ -183,7 +183,7 @@ const Register: FC = () => {
width: 240, width: 240,
}} }}
placement="right" placement="right"
visible={visible} open={open}
> >
<FormItem <FormItem
name="password" name="password"

Loading…
Cancel
Save