Browse Source

try

pull/10914/head
期贤 3 years ago
parent
commit
17c396615b
  1. 58
      src/pages/account/settings/components/BaseView.style.ts
  2. 112
      src/pages/account/settings/components/base.tsx
  3. 82
      src/pages/dashboard/analysis/components/Charts/ChartCard/index.style.ts
  4. 2
      src/pages/dashboard/analysis/style.style.ts
  5. 4
      src/pages/dashboard/workplace/style.style.ts
  6. 4
      src/pages/list/basic-list/style.style.ts
  7. 2
      src/pages/list/card-list/style.style.ts
  8. 339
      src/pages/profile/advanced/index.tsx
  9. 2
      src/pages/profile/advanced/style.style.ts
  10. 8
      src/pages/result/fail/index.style.ts

58
src/pages/account/settings/components/BaseView.style.ts

@ -1,58 +1,58 @@
import { createStyles } from "antd-style";
import { createStyles } from 'antd-style';
const useStyles = createStyles(({ token }) => {
return {
baseView: {
display: "flex",
paddingTop: "12px",
display: 'flex',
paddingTop: '12px',
},
".ant-legacy-form-item .ant-legacy-form-item-control-wrapper": {
width: "100%",
'.ant-legacy-form-item .ant-legacy-form-item-control-wrapper': {
width: '100%',
},
left: {
minWidth: "224px",
maxWidth: "448px",
minWidth: '224px',
maxWidth: '448px',
},
right: {
flex: "1",
paddingLeft: "104px",
flex: '1',
paddingLeft: '104px',
},
avatar_title: {
height: "22px",
marginBottom: "8px",
height: '22px',
marginBottom: '8px',
color: token.colorTextHeading,
fontSize: token.fontSize,
lineHeight: "22px",
lineHeight: '22px',
},
avatar: {
width: "144px",
height: "144px",
marginBottom: "12px",
overflow: "hidden",
width: '144px',
height: '144px',
marginBottom: '12px',
overflow: 'hidden',
},
img: {
width: "100%",
width: '100%',
},
button_view: {
width: "144px",
textAlign: "center",
width: '144px',
textAlign: 'center',
},
area_code: {
width: "72px",
width: '72px',
},
phone_number: {
width: "214px",
width: '214px',
},
[`@media screen and (max-width: token.screen-xl)`]: {
baseView: { flexDirection: "column-reverse" },
[`@media screen and (max-width: ${token.screenXL})`]: {
baseView: { flexDirection: 'column-reverse' },
right: {
display: "flex",
flexDirection: "column",
alignItems: "center",
maxWidth: "448px",
padding: "20px",
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
maxWidth: '448px',
padding: '20px',
},
avatar_title: { display: "none" },
avatar_title: { display: 'none' },
},
};
});

112
src/pages/account/settings/components/base.tsx

@ -1,6 +1,6 @@
import React from "react";
import { UploadOutlined } from "@ant-design/icons";
import { Button, Input, Upload, message } from "antd";
import React from 'react';
import { UploadOutlined } from '@ant-design/icons';
import { Button, Input, Upload, message } from 'antd';
import {
ProForm,
ProFormDependency,
@ -8,43 +8,40 @@ import {
ProFormSelect,
ProFormText,
ProFormTextArea,
} from "@ant-design/pro-components";
import { useRequest } from "@umijs/max";
import { queryCurrent } from "../service";
import { queryProvince, queryCity } from "../service";
import useStyles from "./BaseView.style";
const validatorPhone = (
rule: any,
value: string[],
callback: (message?: string) => void
) => {
} from '@ant-design/pro-components';
import { useRequest } from '@umijs/max';
import { queryCurrent } from '../service';
import { queryProvince, queryCity } from '../service';
import useStyles from './BaseView.style';
const validatorPhone = (rule: any, value: string[], callback: (message?: string) => void) => {
if (!value[0]) {
callback("Please input your area code!");
callback('Please input your area code!');
}
if (!value[1]) {
callback("Please input your phone number!");
callback('Please input your phone number!');
}
callback();
};
// 头像组件 方便以后独立,增加裁剪之类的功能
const AvatarView = ({ avatar }: { avatar: string }) => (
<>
<div className={styles.avatar_title}></div>
<div className={styles.avatar}>
<img src={avatar} alt="avatar" />
</div>
<Upload showUploadList={false}>
<div className={styles.button_view}>
<Button>
<UploadOutlined />
</Button>
</div>
</Upload>
</>
);
const BaseView: React.FC = () => {
const { styles } = useStyles();
// 头像组件 方便以后独立,增加裁剪之类的功能
const AvatarView = ({ avatar }: { avatar: string }) => (
<>
<div className={styles.avatar_title}></div>
<div className={styles.avatar}>
<img src={avatar} alt="avatar" />
</div>
<Upload showUploadList={false}>
<div className={styles.button_view}>
<Button>
<UploadOutlined />
</Button>
</div>
</Upload>
</>
);
const { data: currentUser, loading } = useRequest(() => {
return queryCurrent();
});
@ -53,14 +50,13 @@ const BaseView: React.FC = () => {
if (currentUser.avatar) {
return currentUser.avatar;
}
const url =
"https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png";
const url = 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png';
return url;
}
return "";
return '';
};
const handleFinish = async () => {
message.success("更新基本信息成功");
message.success('更新基本信息成功');
};
return (
<div className={styles.baseView}>
@ -72,13 +68,13 @@ const BaseView: React.FC = () => {
onFinish={handleFinish}
submitter={{
searchConfig: {
submitText: "更新基本信息",
submitText: '更新基本信息',
},
render: (_, dom) => dom[1],
}}
initialValues={{
...currentUser,
phone: currentUser?.phone.split("-"),
phone: currentUser?.phone.split('-'),
}}
hideRequiredMark
>
@ -89,7 +85,7 @@ const BaseView: React.FC = () => {
rules={[
{
required: true,
message: "请输入您的邮箱!",
message: '请输入您的邮箱!',
},
]}
/>
@ -100,7 +96,7 @@ const BaseView: React.FC = () => {
rules={[
{
required: true,
message: "请输入您的昵称!",
message: '请输入您的昵称!',
},
]}
/>
@ -110,7 +106,7 @@ const BaseView: React.FC = () => {
rules={[
{
required: true,
message: "请输入个人简介!",
message: '请输入个人简介!',
},
]}
placeholder="个人简介"
@ -122,13 +118,13 @@ const BaseView: React.FC = () => {
rules={[
{
required: true,
message: "请输入您的国家或地区!",
message: '请输入您的国家或地区!',
},
]}
options={[
{
label: "中国",
value: "China",
label: '中国',
value: 'China',
},
]}
/>
@ -138,7 +134,7 @@ const BaseView: React.FC = () => {
rules={[
{
required: true,
message: "请输入您的所在省!",
message: '请输入您的所在省!',
},
]}
width="sm"
@ -158,7 +154,7 @@ const BaseView: React.FC = () => {
});
}}
/>
<ProFormDependency name={["province"]}>
<ProFormDependency name={['province']}>
{({ province }) => {
return (
<ProFormSelect
@ -170,7 +166,7 @@ const BaseView: React.FC = () => {
rules={[
{
required: true,
message: "请输入您的所在城市!",
message: '请输入您的所在城市!',
},
]}
disabled={!province}
@ -179,16 +175,14 @@ const BaseView: React.FC = () => {
if (!province?.key) {
return [];
}
return queryCity(province.key || "").then(
({ data }) => {
return data.map((item) => {
return {
label: item.name,
value: item.id,
};
});
}
);
return queryCity(province.key || '').then(({ data }) => {
return data.map((item) => {
return {
label: item.name,
value: item.id,
};
});
});
}}
/>
);
@ -202,7 +196,7 @@ const BaseView: React.FC = () => {
rules={[
{
required: true,
message: "请输入您的街道地址!",
message: '请输入您的街道地址!',
},
]}
/>
@ -212,7 +206,7 @@ const BaseView: React.FC = () => {
rules={[
{
required: true,
message: "请输入您的联系电话!",
message: '请输入您的联系电话!',
},
{
validator: validatorPhone,

82
src/pages/dashboard/analysis/components/Charts/ChartCard/index.style.ts

@ -1,77 +1,77 @@
import { createStyles } from 'antd-style';
import { createStyles } from "antd-style";
const useStyles = createStyles(({ token }) => {
return {
chartCard: {
position: 'relative',
position: "relative",
},
chartTop: {
position: 'relative',
width: '100%',
overflow: 'hidden',
position: "relative",
width: "100%",
overflow: "hidden",
},
chartTopMargin: {
marginBottom: '12px',
marginBottom: "12px",
},
chartTopHasMargin: {
marginBottom: '20px',
marginBottom: "20px",
},
metaWrap: {
float: 'left',
float: "left",
},
avatar: {
position: 'relative',
top: '4px',
float: 'left',
marginRight: '20px',
position: "relative",
top: "4px",
float: "left",
marginRight: "20px",
},
img: {
borderRadius: '100%',
borderRadius: "100%",
},
meta: {
height: '22px',
height: "22px",
color: token.colorTextSecondary,
fontSize: token.fontSize,
lineHeight: '22px',
lineHeight: "22px",
},
action: {
position: 'absolute',
top: '4px',
right: '0',
lineHeight: '1',
cursor: 'pointer',
position: "absolute",
top: "4px",
right: "0",
lineHeight: "1",
cursor: "pointer",
},
total: {
height: '38px',
marginTop: '4px',
marginBottom: '0',
overflow: 'hidden',
height: "38px",
marginTop: "4px",
marginBottom: "0",
overflow: "hidden",
color: token.colorTextHeading,
fontSize: '30px',
lineHeight: '38px',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
wordBreak: 'break-all',
fontSize: "30px",
lineHeight: "38px",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
wordBreak: "break-all",
},
content: {
position: 'relative',
width: '100%',
marginBottom: '12px',
position: "relative",
width: "100%",
marginBottom: "12px",
},
contentFixed: {
position: 'absolute',
bottom: '0',
left: '0',
width: '100%',
position: "absolute",
bottom: "0",
left: "0",
width: "100%",
},
footer: {
marginTop: '8px',
paddingTop: '9px',
borderTop: '1px solid @border-color-split',
'& > *': { position: 'relative' },
marginTop: "8px",
paddingTop: "9px",
borderTop: "1px solid @border-color-split",
"& > *": { position: "relative" },
},
footerMargin: {
marginTop: '20px',
marginTop: "20px",
},
};
});

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

@ -139,7 +139,7 @@ const useStyles = createStyles(({ token }) => {
salesCard: { padding: "16px" },
salesBar: { padding: "16px" },
},
[`@media screen and (max-width: token.screen-sm)`]: {
[`@media screen and (max-width: ${token.screenSM})`]: {
salesExtraWrap: { display: "none" },
salesCard: {},
".ant-tabs-content": { paddingTop: "30px" },

4
src/pages/dashboard/workplace/style.style.ts

@ -169,7 +169,7 @@ const useStyles = createStyles(({ token }) => {
datetime: {
color: token.colorTextDisabled,
},
[`@media screen and (max-width: token.screen-xl) and (min-width: token.screen-lg)`]:
[`@media screen and (max-width: ${token.screenXL}) and (min-width: @screen-lg)`]:
{
activeCard: { marginBottom: "24px" },
members: { marginBottom: "0" },
@ -193,7 +193,7 @@ const useStyles = createStyles(({ token }) => {
projectList: {},
projectGrid: { width: "50%" },
},
[`@media screen and (max-width: token.screen-sm)`]: {
[`@media screen and (max-width: ${token.screenSM})`]: {
pageHeaderContent: { display: "block" },
content: { marginLeft: "0" },
extraContent: {},

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

@ -86,7 +86,7 @@ const useStyles = createStyles(({ token }) => {
listCard: {},
".ant-card-head-title": { overflow: "visible" },
},
[`@media screen and (max-width: token.screen-sm)`]: {
[`@media screen and (max-width: ${token.screenSM})`]: {
standardList: {},
extraContentSearch: { width: "100%", marginLeft: "0" },
headerInfo: {
@ -123,7 +123,7 @@ const useStyles = createStyles(({ token }) => {
},
},
},
[`@media screen and (max-width: token.screen-xl)`]: {
[`@media screen and (max-width: ${token.screenXL})`]: {
standardList: {},
listContent: {
"& > div": {

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

@ -65,7 +65,7 @@ const useStyles = createStyles(({ token }) => {
[`@media screen and (max-width: ${token.screenMD})`]: {
extraImg: { display: "none" },
},
[`@media screen and (max-width: token.screen-sm)`]: {
[`@media screen and (max-width: ${token.screenSM})`]: {
pageHeaderContent: { paddingBottom: "30px" },
contentLink: {
position: "absolute",

339
src/pages/profile/advanced/index.tsx

@ -3,7 +3,7 @@ import {
DownOutlined,
EllipsisOutlined,
InfoCircleOutlined,
} from "@ant-design/icons";
} from '@ant-design/icons';
import {
Badge,
Button,
@ -18,19 +18,15 @@ import {
Table,
Tooltip,
Empty,
} from "antd";
import {
GridContent,
PageContainer,
RouteContext,
} from "@ant-design/pro-components";
import type { FC } from "react";
import React, { Fragment, useState } from "react";
import classNames from "classnames";
import { useRequest } from "@umijs/max";
import type { AdvancedProfileData } from "./data.d";
import { queryAdvancedProfile } from "./service";
import useStyles from "./style.style";
} from 'antd';
import { GridContent, PageContainer, RouteContext } from '@ant-design/pro-components';
import type { FC } from 'react';
import React, { Fragment, useState } from 'react';
import classNames from 'classnames';
import { useRequest } from '@umijs/max';
import type { AdvancedProfileData } from './data.d';
import { queryAdvancedProfile } from './service';
import useStyles from './style.style';
const { Step } = Steps;
const ButtonGroup = Button.Group;
const menu = (
@ -81,173 +77,172 @@ const action = (
}}
</RouteContext.Consumer>
);
const extra = (
<div className={styles.moreInfo}>
<Statistic title="状态" value="待审批" />
<Statistic title="订单金额" value={568.08} prefix="¥" />
</div>
);
const description = (
<RouteContext.Consumer>
{({ isMobile }) => (
<Descriptions
className={styles.headerList}
size="small"
column={isMobile ? 1 : 2}
>
<Descriptions.Item label="创建人"></Descriptions.Item>
<Descriptions.Item label="订购产品">XX </Descriptions.Item>
<Descriptions.Item label="创建时间">2017-07-07</Descriptions.Item>
<Descriptions.Item label="关联单据">
<a href="">12421</a>
</Descriptions.Item>
<Descriptions.Item label="生效日期">
2017-07-07 ~ 2017-08-08
</Descriptions.Item>
<Descriptions.Item label="备注"></Descriptions.Item>
</Descriptions>
)}
</RouteContext.Consumer>
);
const desc1 = (
<div className={classNames(styles.textSecondary, styles.stepDescription)}>
<Fragment>
<DingdingOutlined
style={{
marginLeft: 8,
}}
/>
</Fragment>
<div>2016-12-12 12:32</div>
</div>
);
const desc2 = (
<div className={styles.stepDescription}>
<Fragment>
<DingdingOutlined
style={{
color: "#00A0E9",
marginLeft: 8,
}}
/>
</Fragment>
<div>
<a href=""></a>
</div>
</div>
);
const popoverContent = (
<div
style={{
width: 160,
}}
>
<span
className={styles.textSecondary}
style={{
float: "right",
}}
>
<Badge
status="default"
text={
<span
style={{
color: "rgba(0, 0, 0, 0.45)",
}}
>
</span>
}
/>
</span>
<div
className={styles.textSecondary}
style={{
marginTop: 4,
}}
>
225
</div>
</div>
);
const customDot = (
dot: React.ReactNode,
{
status,
}: {
status: string;
}
) => {
if (status === "process") {
return (
<Popover placement="topLeft" arrowPointAtCenter content={popoverContent}>
<span>{dot}</span>
</Popover>
);
}
return dot;
};
const operationTabList = [
{
key: "tab1",
tab: "操作日志一",
key: 'tab1',
tab: '操作日志一',
},
{
key: "tab2",
tab: "操作日志二",
key: 'tab2',
tab: '操作日志二',
},
{
key: "tab3",
tab: "操作日志三",
key: 'tab3',
tab: '操作日志三',
},
];
const columns = [
{
title: "操作类型",
dataIndex: "type",
key: "type",
title: '操作类型',
dataIndex: 'type',
key: 'type',
},
{
title: "操作人",
dataIndex: "name",
key: "name",
title: '操作人',
dataIndex: 'name',
key: 'name',
},
{
title: "执行结果",
dataIndex: "status",
key: "status",
title: '执行结果',
dataIndex: 'status',
key: 'status',
render: (text: string) => {
if (text === "agree") {
if (text === 'agree') {
return <Badge status="success" text="成功" />;
}
return <Badge status="error" text="驳回" />;
},
},
{
title: "操作时间",
dataIndex: "updatedAt",
key: "updatedAt",
title: '操作时间',
dataIndex: 'updatedAt',
key: 'updatedAt',
},
{
title: "备注",
dataIndex: "memo",
key: "memo",
title: '备注',
dataIndex: 'memo',
key: 'memo',
},
];
type AdvancedState = {
operationKey: "tab1" | "tab2" | "tab3";
operationKey: 'tab1' | 'tab2' | 'tab3';
tabActiveKey: string;
};
const Advanced: FC = () => {
const { styles } = useStyles();
const extra = (
<div className={styles.moreInfo}>
<Statistic title="状态" value="待审批" />
<Statistic title="订单金额" value={568.08} prefix="¥" />
</div>
);
const description = (
<RouteContext.Consumer>
{({ isMobile }) => (
<Descriptions className={styles.headerList} size="small" column={isMobile ? 1 : 2}>
<Descriptions.Item label="创建人"></Descriptions.Item>
<Descriptions.Item label="订购产品">XX </Descriptions.Item>
<Descriptions.Item label="创建时间">2017-07-07</Descriptions.Item>
<Descriptions.Item label="关联单据">
<a href="">12421</a>
</Descriptions.Item>
<Descriptions.Item label="生效日期">2017-07-07 ~ 2017-08-08</Descriptions.Item>
<Descriptions.Item label="备注"></Descriptions.Item>
</Descriptions>
)}
</RouteContext.Consumer>
);
const desc1 = (
<div className={classNames(styles.textSecondary, styles.stepDescription)}>
<Fragment>
<DingdingOutlined
style={{
marginLeft: 8,
}}
/>
</Fragment>
<div>2016-12-12 12:32</div>
</div>
);
const desc2 = (
<div className={styles.stepDescription}>
<Fragment>
<DingdingOutlined
style={{
color: '#00A0E9',
marginLeft: 8,
}}
/>
</Fragment>
<div>
<a href=""></a>
</div>
</div>
);
const [tabStatus, seTabStatus] = useState<AdvancedState>({
operationKey: "tab1",
tabActiveKey: "detail",
operationKey: 'tab1',
tabActiveKey: 'detail',
});
const customDot = (
dot: React.ReactNode,
{
status,
}: {
status: string;
},
) => {
const popoverContent = (
<div
style={{
width: 160,
}}
>
<span
className={styles.textSecondary}
style={{
float: 'right',
}}
>
<Badge
status="default"
text={
<span
style={{
color: 'rgba(0, 0, 0, 0.45)',
}}
>
</span>
}
/>
</span>
<div
className={styles.textSecondary}
style={{
marginTop: 4,
}}
>
225
</div>
</div>
);
if (status === 'process') {
return (
<Popover placement="topLeft" arrowPointAtCenter content={popoverContent}>
<span>{dot}</span>
</Popover>
);
}
return dot;
};
const { data = {}, loading } = useRequest<{
data: AdvancedProfileData;
}>(queryAdvancedProfile);
@ -287,7 +282,7 @@ const Advanced: FC = () => {
const onOperationTabChange = (key: string) => {
seTabStatus({
...tabStatus,
operationKey: key as "tab1",
operationKey: key as 'tab1',
});
};
return (
@ -301,12 +296,12 @@ const Advanced: FC = () => {
onTabChange={onTabChange}
tabList={[
{
key: "detail",
tab: "详情",
key: 'detail',
tab: '详情',
},
{
key: "rule",
tab: "规则",
key: 'rule',
tab: '规则',
},
]}
>
@ -321,7 +316,7 @@ const Advanced: FC = () => {
<RouteContext.Consumer>
{({ isMobile }) => (
<Steps
direction={isMobile ? "vertical" : "horizontal"}
direction={isMobile ? 'vertical' : 'horizontal'}
progressDot={customDot}
current={1}
>
@ -346,15 +341,9 @@ const Advanced: FC = () => {
}}
>
<Descriptions.Item label="用户姓名"></Descriptions.Item>
<Descriptions.Item label="会员卡号">
32943898021309809423
</Descriptions.Item>
<Descriptions.Item label="身份证">
3321944288191034921
</Descriptions.Item>
<Descriptions.Item label="联系方式">
18112345678
</Descriptions.Item>
<Descriptions.Item label="会员卡号">32943898021309809423</Descriptions.Item>
<Descriptions.Item label="身份证">3321944288191034921</Descriptions.Item>
<Descriptions.Item label="联系方式">18112345678</Descriptions.Item>
<Descriptions.Item label="联系地址">
18100000000 西
</Descriptions.Item>
@ -366,9 +355,7 @@ const Advanced: FC = () => {
title="信息组"
>
<Descriptions.Item label="某某数据">725</Descriptions.Item>
<Descriptions.Item label="该数据更新时间">
2017-08-08
</Descriptions.Item>
<Descriptions.Item label="该数据更新时间">2017-08-08</Descriptions.Item>
<Descriptions.Item
label={
<span>
@ -376,7 +363,7 @@ const Advanced: FC = () => {
<Tooltip title="数据说明">
<InfoCircleOutlined
style={{
color: "rgba(0, 0, 0, 0.43)",
color: 'rgba(0, 0, 0, 0.43)',
marginLeft: 4,
}}
/>
@ -386,9 +373,7 @@ const Advanced: FC = () => {
>
725
</Descriptions.Item>
<Descriptions.Item label="该数据更新时间">
2017-08-08
</Descriptions.Item>
<Descriptions.Item label="该数据更新时间">2017-08-08</Descriptions.Item>
</Descriptions>
<h4
style={{
@ -406,19 +391,15 @@ const Advanced: FC = () => {
>
<Descriptions.Item label="负责人"></Descriptions.Item>
<Descriptions.Item label="角色码">1234567</Descriptions.Item>
<Descriptions.Item label="所属部门">
XX公司 - YY部
</Descriptions.Item>
<Descriptions.Item label="过期时间">
2017-08-08
</Descriptions.Item>
<Descriptions.Item label="所属部门">XX公司 - YY部</Descriptions.Item>
<Descriptions.Item label="过期时间">2017-08-08</Descriptions.Item>
<Descriptions.Item label="描述">
...
</Descriptions.Item>
</Descriptions>
<Divider
style={{
margin: "16px 0",
margin: '16px 0',
}}
/>
<Descriptions
@ -435,7 +416,7 @@ const Advanced: FC = () => {
</Descriptions>
<Divider
style={{
margin: "16px 0",
margin: '16px 0',
}}
/>
<Descriptions title="组名称">

2
src/pages/profile/advanced/style.style.ts

@ -32,7 +32,7 @@ const useStyles = createStyles(({ token }) => {
justifyContent: "space-between",
width: "200px",
},
[`@media screen and (max-width: token.screen-sm)`]: {
[`@media screen and (max-width: ${token.screenSM})`]: {
stepDescription: { left: "8px" },
pageHeader: {},
".ant-pro-page-header-wrap-row": { flexDirection: "column" },

8
src/pages/result/fail/index.style.ts

@ -1,4 +1,4 @@
import { createStyles } from 'antd-style';
import { createStyles } from "antd-style";
const useStyles = createStyles(({ token }) => {
return {
@ -6,10 +6,10 @@ const useStyles = createStyles(({ token }) => {
color: token.colorBgTextActive,
},
title: {
marginBottom: '16px',
marginBottom: "16px",
color: token.colorTextHeading,
fontWeight: '500',
fontSize: '16px',
fontWeight: "500",
fontSize: "16px",
},
};
});

Loading…
Cancel
Save