Browse Source

优化一些小问题

pull/11096/head
期贤 2 years ago
parent
commit
b4069b2d95
  1. 11345
      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

11345
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 { Tiny } from '@ant-design/plots';
import { Col, Row, Tooltip } from 'antd';
import { Col, Progress, Row, Tooltip } from 'antd';
import numeral from 'numeral';
import type { DataItem } from '../data.d';
import useStyles from '../style.style';
@ -70,7 +70,11 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
yField="y"
shapeField="smooth"
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}
line={{ style: { stroke: '#975FE4' } }}
/>
@ -134,18 +138,7 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
}
contentHeight={46}
>
<Tiny.Progress
height={12}
color={['#E9EEF4', '#13C2C2']}
percent={0.78}
annotations={[
{
type: 'lineY',
data: [0.8],
style: { stroke: '#13C2C2', strokeOpacity: 1 },
},
]}
/>
<Progress percent={78} strokeColor={{ from: '#108ee9', to: '#87d068' }} status="active" />
</ChartCard>
</Col>
</Row>

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

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

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

@ -60,6 +60,16 @@ const useStyles = createStyles(({ token }) => {
textOverflow: 'ellipsis',
},
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',
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';
type OperationModalProps = {
done: boolean;
visible: boolean;
open: boolean;
current: Partial<BasicListItemDataType> | undefined;
onDone: () => void;
onSubmit: (values: BasicListItemDataType) => void;
@ -19,13 +19,13 @@ type OperationModalProps = {
};
const OperationModal: FC<OperationModalProps> = (props) => {
const { styles } = useStyles();
const { done, visible, current, onDone, onSubmit, children } = props;
if (!visible) {
const { done, open, current, onDone, onSubmit, children } = props;
if (!open) {
return null;
}
return (
<ModalForm<BasicListItemDataType>
visible={visible}
open={open}
title={done ? null : `任务${current ? '编辑' : '添加'}`}
className={styles.standardListForm}
width={640}

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

@ -70,7 +70,7 @@ const ListContent = ({
export const BasicList: FC = () => {
const { styles } = useStyles();
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 {
data: listData,
@ -247,7 +247,7 @@ export const BasicList: FC = () => {
</Button>
<OperationModal
done={done}
visible={visible}
open={open}
current={current}
onDone={handleDone}
onSubmit={handleSubmit}

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

@ -111,7 +111,7 @@ const useStyles = createStyles(({ token }) => {
listCard: {
[`@media screen and (max-width: ${token.screenXS}px)`]: {
'.ant-card-head-title': {
overflow: 'visible',
overflow: 'open',
},
},
[`@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
destroyOnClose
title="新建规则"
visible={modalVisible}
open={modalVisible}
onCancel={() => onCancel()}
footer={null}
>

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

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

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

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

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

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

Loading…
Cancel
Save