Commit bfde62bc authored by XieZhiXiong's avatar XieZhiXiong

Merge branch 'dev' into test

parents 7d14c639 be8041d3
This diff is collapsed.
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Input, Button, message } from 'antd'; import { Input, Button, message } from 'antd';
import { LinkOutlined } from '@ant-design/icons'; import { LinkOutlined } from '@ant-design/icons';
import styled from 'styled-components'; import styled from 'styled-components';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'; import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import ModalTable from '@/components/ModalTable'; import ModalTable from '@/components/ModalTable';
const RowStyleLayout = styled(props => <div {...props} />)` const RowStyleLayout = styled(props => <div {...props} />)`
width: 100%; width: 100%;
.relevance { .relevance {
height: 100%; height: 100%;
background: #909399; background: #909399;
border-radius: 0; border-radius: 0;
&[disabled] { &[disabled] {
background: #F4F5F7; background: #F4F5F7;
} }
} }
.ant-input-group-addon { .ant-input-group-addon {
padding: 0; padding: 0;
border: none; border: none;
} }
`; `;
const Relevance = props => { const Relevance = props => {
const { const {
editable, editable,
value = [], value = [],
} = props; } = props;
const { const {
modalProps = { modalProps = {
title: '标题', title: '标题',
width: 960, width: 960,
}, },
selectionType = 'radio', selectionType = 'radio',
columns, columns,
formilyProps, formilyProps,
tableProps = {}, tableProps = {},
fetchTableData, fetchTableData,
title = '选择', title = '选择',
tip = '', // 点击按钮前的提示,用于前提需要提示的场景 tip = '', // 点击按钮前的提示,用于前提需要提示的场景
disabled = false, disabled = false,
} = props.props['x-component-props']; } = props.props['x-component-props'];
const tableRowKey = tableProps.rowKey || 'id'; const tableRowKey = tableProps.rowKey || 'id';
const tableRowLableKey = tableProps.lableKey || ''; // Input展示用的 key val const tableRowLableKey = tableProps.lableKey || ''; // Input展示用的 key val
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const [rowSelection, rowCtl] = useRowSelectionTable({ type: selectionType, customKey: tableRowKey }); const [rowSelection, rowCtl] = useRowSelectionTable({ type: selectionType, customKey: tableRowKey });
useEffect(() => { useEffect(() => {
// Table 只能缓存 keys // Table 只能缓存 keys
const rowKeys = value.map(item => item[tableRowKey]); const rowKeys = value.map(item => item[tableRowKey]);
rowCtl.setSelectedRowKeys(rowKeys); rowCtl.setSelectedRowKeys(rowKeys);
rowCtl.setSelectRow(value); rowCtl.setSelectRow(value);
}, [props.value, tableProps.rowKey]); }, [props.value, tableProps.rowKey]);
const handleConfirm = () => { const handleConfirm = () => {
const rows = rowCtl.selectRow; const rows = rowCtl.selectRow;
const keys = rows.map(item => item[tableRowKey]); const keys = rows.map(item => item[tableRowKey]);
if (props.mutators) { if (props.mutators) {
if (rows && rows.length) { if (rows && rows.length) {
props.mutators.change(rows); props.mutators.change(rows);
} }
setVisible(false); setVisible(false);
return; return;
} }
rowCtl.setSelectedRowKeys(keys); rowCtl.setSelectedRowKeys(keys);
setVisible(false); setVisible(false);
}; };
const handleModalVisible = () => { const handleModalVisible = () => {
if (!fetchTableData) { if (!fetchTableData) {
message.warning(tip || '请传入 fetchTableData 属性,否则Table 将无法发起请求'); message.warning(tip || '请传入 fetchTableData 属性,否则Table 将无法发起请求');
return; return;
} }
setVisible(true); setVisible(true);
}; };
return ( return (
<RowStyleLayout> <RowStyleLayout>
<Input <Input
value={ value={
tableRowLableKey ? tableRowLableKey ?
value.map(item => item[tableRowLableKey]).join(',') : value.map(item => item[tableRowLableKey]).join(',') :
'' ''
} }
addonAfter={( addonAfter={(
<> <>
{editable && ( {editable && (
<Button <Button
type="primary" type="primary"
className="relevance" className="relevance"
icon={<LinkOutlined />} icon={<LinkOutlined />}
onClick={handleModalVisible} onClick={handleModalVisible}
disabled={disabled} disabled={disabled}
block block
> >
{title} {title}
</Button> </Button>
)} )}
</> </>
)} )}
disabled disabled
/> />
<ModalTable <ModalTable
confirm={handleConfirm} confirm={handleConfirm}
cancel={() => setVisible(false)} cancel={() => setVisible(false)}
visible={visible} visible={visible}
width={960} width={960}
{...modalProps} {...modalProps}
modalTitle={modalProps.title} modalTitle={modalProps.title}
rowSelection={rowSelection} rowSelection={rowSelection}
columns={columns} columns={columns}
fetchTableData={fetchTableData} fetchTableData={fetchTableData}
formilyProps={formilyProps} formilyProps={formilyProps}
tableProps={tableProps} tableProps={tableProps}
/> resetModal={{
</RowStyleLayout> destroyOnClose: true,
); }}
}; />
</RowStyleLayout>
Relevance.defaultProps = {}; );
};
Relevance.isFieldComponent = true;
Relevance.defaultProps = {};
export default Relevance;
Relevance.isFieldComponent = true;
export default Relevance;
...@@ -141,7 +141,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => { ...@@ -141,7 +141,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
return ( return (
<ProLayout <ProLayout
pageTitleRender={() => currentRouter ? currentRouter.name : window.location.href} pageTitleRender={() => currentRouter ? currentRouter.name : window.location.href}
style={{ minHeight: '100vh' }} style={{ minHeight: '100vh', minWidth: "1500px" }}
logo={logo} logo={logo}
formatMessage={formatMessage} formatMessage={formatMessage}
menuHeaderRender={(logoDom, titleDom) => ( menuHeaderRender={(logoDom, titleDom) => (
......
...@@ -106,4 +106,4 @@ const MenuSlider: React.FC<MenuSliderProps> = (props) => { ...@@ -106,4 +106,4 @@ const MenuSlider: React.FC<MenuSliderProps> = (props) => {
MenuSlider.defaultProps = {} MenuSlider.defaultProps = {}
export default MenuSlider export default MenuSlider
\ No newline at end of file
...@@ -28,33 +28,12 @@ const AppendixItem = (props) => { ...@@ -28,33 +28,12 @@ const AppendixItem = (props) => {
let link = document.createElement("a"); let link = document.createElement("a");
link.style.display = "none"; link.style.display = "none";
link.href = url; link.href = url;
link.setAttribute("download", name + '.txt'); link.setAttribute("download", name);
document.body.appendChild(link) //a标签插至页面中 document.body.appendChild(link) //a标签插至页面中
link.click(); link.click();
document.body.removeChild(link); document.body.removeChild(link);
} }
const downloadUrlFile = (name, url) => {
const xhr = new XMLHttpRequest()
xhr.open('GET', url, true)
xhr.responseType = 'blob'
xhr.onload = () => {
if (xhr.status === 200) {
saveAs(xhr.response, name)
}
}
xhr.send()
}
const saveAs = (data, name) => {
var urlObject = window.URL
var export_blob = new Blob([data]);
var save_link = document.createElement("a");
save_link.href = urlObject.createObjectURL(export_blob);
save_link.download = name;
save_link.click();
}
return ( return (
<div style={styles}> <div style={styles}>
......
...@@ -53,18 +53,18 @@ const SettlementAbility: React.FC<Iprops> = () => { ...@@ -53,18 +53,18 @@ const SettlementAbility: React.FC<Iprops> = () => {
: Object.keys(requestData).map((record) => { : Object.keys(requestData).map((record) => {
return ( return (
<Row key={record} className={styles.row}> <Row key={record} className={styles.row}>
<Col xxl={4} xl={4} lg={24} md={24} sm={24} className={styles.rowTitle}>{KEY_TITLE[record]}</Col> <Col span={4} className={styles.rowTitle}>{KEY_TITLE[record]}</Col>
<Col xxl={20} xl={20} lg={24} md={24} sm={24} className={styles.colRow}> <Col span={20} className={styles.colRow}>
{ {
requestData[record].map((item, key) => { requestData[record].map((item, key) => {
return ( return (
<Col xxl={4} xl={6} lg={6} md={6} sm={12} xs={24} key={key} className={styles.col}> <Col span={4} key={key} className={styles.col}>
<div className={styles.colTitle}>{item.name}</div> <div className={styles.colTitle}>{item.name}</div>
{ {
item.link item.link
? <Link to={item.link} className={styles.colValue}>{item.count}</Link> ? <Link to={item.link} className={styles.colValue}>{item.count}</Link>
: <div className={styles.colValue}>{item.count}</div> : <div className={styles.colValue}>{item.count}</div>
} }
</Col> </Col>
) )
}) })
......
...@@ -64,24 +64,6 @@ const FundCenter: React.FC<Iprops> = () => { ...@@ -64,24 +64,6 @@ const FundCenter: React.FC<Iprops> = () => {
? <Skeleton active /> ? <Skeleton active />
: ( : (
<> <>
{/* <div className={styles.tags}>
{
tagsList.map((item) => {
const hasAuth = !urls.includes(item.url);
if(!hasAuth) {
return null
}
return (
<Link to={item.url} className={styles.tagsItem} key={item.text}>
<div className={styles.icon}>
<img src={item.icon} />
</div>
<div className={styles.text}>{item.text}</div>
</Link>
)
})
}
</div> */}
<Row gutter={[16,16]}> <Row gutter={[16,16]}>
{ {
tagsList.map((item) => { tagsList.map((item) => {
...@@ -90,7 +72,7 @@ const FundCenter: React.FC<Iprops> = () => { ...@@ -90,7 +72,7 @@ const FundCenter: React.FC<Iprops> = () => {
return null return null
} }
return ( return (
<Col xxl={5} xl={12} lg={8} md={12} sm={24} xs={24} key={item.text}> <Col span={4} key={item.text}>
<Link to={item.url} className={styles.tagsItem}> <Link to={item.url} className={styles.tagsItem}>
<div className={styles.icon}> <div className={styles.icon}>
<img src={item.icon} /> <img src={item.icon} />
...@@ -107,12 +89,12 @@ const FundCenter: React.FC<Iprops> = () => { ...@@ -107,12 +89,12 @@ const FundCenter: React.FC<Iprops> = () => {
Object.keys(requestData).map((item) => { Object.keys(requestData).map((item) => {
return ( return (
<Row key={item} className={styles.row}> <Row key={item} className={styles.row}>
<Col xxl={4} xl={4} lg={24} md={24} sm={24} xs={24} className={styles.rowTitle}>{KEY_TO_TITLE[item]}</Col> <Col span={4} className={styles.rowTitle}>{KEY_TO_TITLE[item]}</Col>
<Col xxl={20} xl={20} lg={24} md={24} sm={24} xs={24} className={styles.colRow}> <Col span={20} className={styles.colRow}>
{ {
requestData[item].map((record) => { requestData[item].map((record) => {
return ( return (
<Col xxl={4} xl={6} lg={8} md={8} sm={12} xs={24} key={record.name} className={styles.col}> <Col span={4} key={record.name} className={styles.col}>
<div className={styles.colTitle}>{record.name}</div> <div className={styles.colTitle}>{record.name}</div>
{ {
record.link record.link
......
...@@ -73,7 +73,7 @@ const LogisticsCenter: React.FC<Iprops> = () => { ...@@ -73,7 +73,7 @@ const LogisticsCenter: React.FC<Iprops> = () => {
loading loading
? <Skeleton active /> ? <Skeleton active />
: <> : <>
<Row gutter={[16,16]}> <Row gutter={[24,16]}>
{ {
data.map((item) => { data.map((item) => {
const hasAuth = !urls.includes(item.url); const hasAuth = !urls.includes(item.url);
...@@ -81,7 +81,7 @@ const LogisticsCenter: React.FC<Iprops> = () => { ...@@ -81,7 +81,7 @@ const LogisticsCenter: React.FC<Iprops> = () => {
return null return null
} }
return ( return (
<Col xxl={5} xl={12} lg={8} md={12} sm={24} xs={24} key={item.text}> <Col span={4} key={item.text}>
<Link to={item.url} className={styles.tagsItem}> <Link to={item.url} className={styles.tagsItem}>
<div className={styles.icon}> <div className={styles.icon}>
<img src={item.icon} /> <img src={item.icon} />
......
...@@ -44,12 +44,12 @@ const ProcessCenter: React.FC<Iprops> = () => { ...@@ -44,12 +44,12 @@ const ProcessCenter: React.FC<Iprops> = () => {
: Object.keys(requestData).map((record) => { : Object.keys(requestData).map((record) => {
return ( return (
<Row key={record} className={styles.row}> <Row key={record} className={styles.row}>
<Col xxl={4} xl={4} lg={24} md={24} sm={24} xs={24} className={styles.rowTitle}>{KEY_TITLE[record]}</Col> <Col span={4} className={styles.rowTitle}>{KEY_TITLE[record]}</Col>
<Col xxl={20} xl={20} lg={24} md={24} sm={24} xs={24} className={styles.colRow}> <Col span={20} className={styles.colRow}>
{ {
requestData[record].map((item, key) => { requestData[record].map((item, key) => {
return ( return (
<Col xxl={4} xl={6} lg={8} md={8} sm={12} xs={24} key={key} className={styles.col}> <Col span={4} key={key} className={styles.col}>
<div className={styles.colTitle}>{item.name}</div> <div className={styles.colTitle}>{item.name}</div>
{ {
item.link item.link
...@@ -69,27 +69,6 @@ const ProcessCenter: React.FC<Iprops> = () => { ...@@ -69,27 +69,6 @@ const ProcessCenter: React.FC<Iprops> = () => {
) )
} }
} }
{/* {
data.map((record) => {
return (
<Row key={record.id} className={styles.row}>
<Col span={4} className={styles.rowTitle}>平台代收账款结算</Col>
<Col span={20} className={styles.colRow}>
{
record.list.map((item) => {
return (
<Col span={4} key={item} className={styles.col}>
<div className={styles.colTitle}>待提交审核咨询单</div>
<div className={styles.colValue}>5</div>
</Col>
)
})
}
</Col>
</Row>
)
})
} */}
</AbilityContainer> </AbilityContainer>
) )
......
...@@ -59,12 +59,12 @@ const ProductCenter: React.FC<Iprops> = () => { ...@@ -59,12 +59,12 @@ const ProductCenter: React.FC<Iprops> = () => {
? <Skeleton active /> ? <Skeleton active />
: <> : <>
<Row className={styles.row}> <Row className={styles.row}>
<Col xxl={4} xl={4} lg={24} md={24} sm={24} className={styles.rowTitle}>商品</Col> <Col span={4} className={styles.rowTitle}>商品</Col>
<Col xxl={20} xl={20} lg={24} md={24} sm={24} className={styles.colRow}> <Col span={20} className={styles.colRow}>
{ {
isArray && requestData.map((item) => { isArray && requestData.map((item) => {
return ( return (
<Col xxl={4} xl={6} lg={8} md={8} sm={12} xs={24} key={item.name} className={styles.col}> <Col span={4} key={item.name} className={styles.col}>
<div className={styles.colTitle}>{item.name}</div> <div className={styles.colTitle}>{item.name}</div>
{ {
item.link item.link
......
...@@ -66,7 +66,7 @@ const SettlementCenter: React.FC<Iprops> = () => { ...@@ -66,7 +66,7 @@ const SettlementCenter: React.FC<Iprops> = () => {
loading loading
? <Skeleton active /> ? <Skeleton active />
: <> : <>
<Row gutter={[16,16]}> <Row gutter={[16,24]}>
{ {
tagsList.map((item) => { tagsList.map((item) => {
const hasAuth = !urls.includes(item.url); const hasAuth = !urls.includes(item.url);
...@@ -74,7 +74,7 @@ const SettlementCenter: React.FC<Iprops> = () => { ...@@ -74,7 +74,7 @@ const SettlementCenter: React.FC<Iprops> = () => {
return null return null
} }
return ( return (
<Col xxl={6} xl={12} lg={8} md={12} sm={24} xs={24} key={item.text}> <Col span={4} key={item.text}>
<Link to={item.url} className={styles.tagsItem}> <Link to={item.url} className={styles.tagsItem}>
<div className={styles.icon}> <div className={styles.icon}>
<img src={item.icon} /> <img src={item.icon} />
...@@ -90,12 +90,12 @@ const SettlementCenter: React.FC<Iprops> = () => { ...@@ -90,12 +90,12 @@ const SettlementCenter: React.FC<Iprops> = () => {
Object.keys(requestData).map((record) => { Object.keys(requestData).map((record) => {
return ( return (
<Row key={record} className={styles.row}> <Row key={record} className={styles.row}>
<Col xxl={4} xl={4} lg={24} md={24} sm={24}className={styles.rowTitle}>{KEY_TITLE[record]}</Col> <Col span={4} className={styles.rowTitle}>{KEY_TITLE[record]}</Col>
<Col xxl={20} xl={20} lg={24} md={24} sm={24} className={styles.colRow}> <Col span={20} className={styles.colRow}>
{ {
requestData[record].map((item, key) => { requestData[record].map((item, key) => {
return ( return (
<Col xxl={4} xl={6} lg={6} md={6} sm={12} xs={24} key={key} className={styles.col}> <Col span={4} key={key} className={styles.col}>
<div className={styles.colTitle}>{item.name}</div> <div className={styles.colTitle}>{item.name}</div>
{ {
item.link item.link
......
...@@ -15,12 +15,16 @@ const CREATE_SHOP = '/memberCenter/shopAbility/infoManage'; ...@@ -15,12 +15,16 @@ const CREATE_SHOP = '/memberCenter/shopAbility/infoManage';
const ShopCenter: React.FC<Iprops> = () => { const ShopCenter: React.FC<Iprops> = () => {
///template/shop/findShopList ///template/shop/findShopList
const userAuth = getAuth();
const request = useCallback(async () => { const request = useCallback(async () => {
const {code, data} = await PublicApi.getTemplateShopFindShopList({current: '1', pageSize: '1', categoryId: '0', areaCode: '', memberName: ''}); const {code, data} = await PublicApi.getTemplateShopFindShop({
memberId: userAuth.memberId,
roleId: userAuth.roleId
});
return { return {
code: code, code: code,
data: { data: {
totalCount: code === 1000 ? data.totalCount : 0 totalCount: code === 1000 && data.id || 0
} }
} }
}, []) }, [])
...@@ -43,9 +47,9 @@ const ShopCenter: React.FC<Iprops> = () => { ...@@ -43,9 +47,9 @@ const ShopCenter: React.FC<Iprops> = () => {
return ( return (
loading loading
? <Skeleton active /> ? <Skeleton active />
: <Row gutter={[16,16]}> : <Row gutter={[16,24]}>
<Authorize url={CREATE_SHOP} canView={true}> <Authorize url={CREATE_SHOP} canView={true}>
<Col xxl={6} xl={8} lg={8} md={12} sm={24} xs={24} className={styles.tagsSpecial} > <Col span={4} className={styles.tagsSpecial} >
<Link to={CREATE_SHOP} className={styles.tagsItem}> <Link to={CREATE_SHOP} className={styles.tagsItem}>
<div className={styles.icon}> <div className={styles.icon}>
<img src={create_shop} /> <img src={create_shop} />
...@@ -66,7 +70,7 @@ const ShopCenter: React.FC<Iprops> = () => { ...@@ -66,7 +70,7 @@ const ShopCenter: React.FC<Iprops> = () => {
</Col> </Col>
</Authorize> </Authorize>
<Authorize url={SHOP_CENTER} canView={true}> <Authorize url={SHOP_CENTER} canView={true}>
<Col xxl={6} xl={8} lg={8} md={12} sm={24} xs={24}> <Col span={4}>
<Link to={SHOP_CENTER} className={styles.tagsItem} > <Link to={SHOP_CENTER} className={styles.tagsItem} >
<div className={styles.icon}> <div className={styles.icon}>
<img src={create_shop} /> <img src={create_shop} />
...@@ -76,7 +80,7 @@ const ShopCenter: React.FC<Iprops> = () => { ...@@ -76,7 +80,7 @@ const ShopCenter: React.FC<Iprops> = () => {
</Col> </Col>
</Authorize> </Authorize>
<Authorize url={SHOP_CENTER} canView={true}> <Authorize url={SHOP_CENTER} canView={true}>
<Col xxl={6} xl={6} lg={6} md={6} sm={24} xs={24}> <Col span={4}>
<Link to={SHOP_CENTER} className={styles.tagsItem} > <Link to={SHOP_CENTER} className={styles.tagsItem} >
<div className={styles.icon}> <div className={styles.icon}>
<img src={create_shop} /> <img src={create_shop} />
......
...@@ -56,12 +56,12 @@ const TradeCenter: React.FC<Iprops> = () => { ...@@ -56,12 +56,12 @@ const TradeCenter: React.FC<Iprops> = () => {
: Object.keys(requestData).map((record) => { : Object.keys(requestData).map((record) => {
return ( return (
<Row key={record} className={styles.row}> <Row key={record} className={styles.row}>
<Col xxl={4} xl={4} lg={24} md={24} sm={24}className={styles.rowTitle}>{KEY_TITLE[record]}</Col> <Col span={4} className={styles.rowTitle}>{KEY_TITLE[record]}</Col>
<Col xxl={20} xl={20} lg={24} md={24} sm={24} className={styles.colRow}> <Col span={20} className={styles.colRow}>
{ {
requestData[record].map((item, key) => { requestData[record].map((item, key) => {
return ( return (
<Col xxl={4} xl={6} lg={6} md={6} sm={12} xs={24} key={key} className={styles.col}> <Col span={4} key={key} className={styles.col}>
<div className={styles.colTitle}>{item.name}</div> <div className={styles.colTitle}>{item.name}</div>
{ {
item.link item.link
......
...@@ -39,90 +39,98 @@ ...@@ -39,90 +39,98 @@
.content { .content {
// height: 104px; // height: 104px;
padding: 24px;
border-radius: 0px 0px 8px 8px; border-radius: 0px 0px 8px 8px;
background-color: #fff; background-color: #fff;
display: flex; display: flex;
flex-direction: column; flex-direction: row;
justify-content: center; align-items: center;
padding: 24px; // justify-content: center;
.userLogo {
height: 56px;
width: 56px;
margin-right: 12px;
.randomLogo {
background-color: #255BA3;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
height: 100%;
border-radius: 50%;
color: #fff;
}
}
.row { .infos {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between;
flex: 1;
.companyName {
display: flex;
flex-direction: row;
align-items: center;
margin-bottom: 12px;
.company {
font-size: 14px;
font-weight: 600;
margin-right: 16px;
}
.user { .roles {
// display: flex; display: flex;
// flex-direction: row; flex-direction: row;
// align-items: center;
.pic {
width: 56px;
height: 56px;
margin-right: 12px;
border-radius: 50%;
// background-color: red;
overflow: hidden;
img {
width: 100%;
height: 100%;
}
.randomLogo {
width: 100%;
height: 100%;
background: linear-gradient(135deg, #4981CC 0%, #1A4F97 100%) #255BA3;
border-radius: 50%;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
font-size: 18px;
}
} }
}
.wrapper { .otherValues {
display: flex;
flex-direction: row;
align-items: center;
.divider {
border-left: 1px solid #EEF0F3;
margin-left: 24px;
padding-left: 24px;
display: flex; display: flex;
flex-direction: column; flex-direction: row;
align-items: center;
.company { .level {
display: flex; .levelImg {
flex-direction: row; height: 16px;
align-items: center;
.tags {
margin-left: 16px;
} }
} }
}
.status { .score {
margin-top: 12px; margin: 0 30px;
}
} }
} }
.level {
height: 16px;
}
}
}
@media (max-width: 576px) {
.role {
margin: 5px 0;
}
}
@media (max-width: 796px) {
.date,
.hi {
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
line-clamp: 1;
-webkit-box-orient: vertical;
} }
} }
} }
// @media (max-width: 576px) {
// .role {
// margin: 5px 0;
// }
// }
// @media (max-width: 796px) {
// .date,
// .hi {
// text-overflow: -o-ellipsis-lastline;
// overflow: hidden;
// text-overflow: ellipsis;
// display: -webkit-box;
// -webkit-line-clamp: 1;
// line-clamp: 1;
// -webkit-box-orient: vertical;
// }
// }
// }
...@@ -13,7 +13,7 @@ import home_user from '@/assets/imgs/home_user.png'; ...@@ -13,7 +13,7 @@ import home_user from '@/assets/imgs/home_user.png';
interface Iprops {} interface Iprops {}
const WEEKDAYS = ["天", "一","二", "三", "四", "五","六"]; const WEEKDAYS = ["天", "一","二", "三", "四", "五","六"];
const LEVEL_IMAGE = [level1, level2, level3, level4]; const LEVEL_IMAGE = [level1, level1, level2, level3, level4];
const EDIT_USER_URL = '/memberCenter/memberAbility/query'; const EDIT_USER_URL = '/memberCenter/memberAbility/query';
const USER_CENTER_URL = '/memberCenter/memberAbility/manage/maintain' const USER_CENTER_URL = '/memberCenter/memberAbility/manage/maintain'
const STATUS_COLOR: ("default" | "processing" | "error" | "success")[] = ["default", "processing", "error", "success"] const STATUS_COLOR: ("default" | "processing" | "error" | "success")[] = ["default", "processing", "error", "success"]
...@@ -23,7 +23,7 @@ const UserCenter: React.FC<Iprops> = () => { ...@@ -23,7 +23,7 @@ const UserCenter: React.FC<Iprops> = () => {
const userAuth = getAuth(); const userAuth = getAuth();
const hasChangeMemberAuth = userAuth?.urls.includes(EDIT_USER_URL); const hasChangeMemberAuth = userAuth?.urls.includes(EDIT_USER_URL);
const hasCenterAuth = userAuth?.urls.includes(USER_CENTER_URL); const hasCenterAuth = userAuth?.urls.includes(USER_CENTER_URL);
const currentRole = userAuth.roles.filter((item) => item.memberRoleId === userAuth.memberRoleId)
if(!userAuth) { if(!userAuth) {
return null return null
} }
...@@ -44,64 +44,46 @@ const UserCenter: React.FC<Iprops> = () => { ...@@ -44,64 +44,46 @@ const UserCenter: React.FC<Iprops> = () => {
</div> </div>
</div> </div>
<div className={styles.content}> <div className={styles.content}>
<Row className={styles.row} gutter={[8, 8]}> {/* http://10.0.0.25:4000/project/15/interface/api/38926 上传用户头像 */}
<Col xxl={14} xl={24} lg={14} md={24} sm={24} xs={24} className={styles.user}> <div className={styles.userLogo}>
{/* http://10.0.0.25:4000/project/15/interface/api/38926 上传用户头像 */} {
<Row align={"middle"}> userAuth.logo
<Col xxl={4} xl={4} lg={4} md={4} sm={4} xs={6}> ? <img src={userAuth.logo || ''} />
<div className={styles.pic} > : <div className={styles.randomLogo}>H</div>
{ }
userAuth.logo </div>
? <img src={userAuth.logo || ''} /> <div className={styles.infos}>
: <div className={styles.randomLogo}>H</div> <div>
} <div className={styles.companyName}>
<span className={styles.company}>{userAuth.company}</span>
</div> <div className={styles.roles}>
</Col> {
<Col xxl={8} xl={7} lg={7} md={7} sm={7} xs={18}> currentRole.map((item, key) => {
<div className={styles.wrapper}> const statusList = ["success", "danger", "default", "warning", "nobility", "primary"]
<div className={styles.company}> return (
<span>{userAuth.company}</span> <div style={{marginRight: '16px'}} key={key}>
</div> <StatusTag type={statusList[key]} title={item.memberRoleName} />
<div className={styles.status}> </div>
<Badge status={STATUS_COLOR[userAuth.validateStatus]} text={userAuth.validateStatusDesc}></Badge> )
</div> })
</div> }
</Col>
<Col xxl={8} xl={9} lg={9} md={8} sm={9} xs={24} className={styles.role}>
<div className={styles.tags}>
{
userAuth.roles.map((item, key) => {
return (
<div style={{marginRight: '8px'}} key={key}>
<StatusTag type="success" title={item.memberRoleName} />
</div>
)
})
}
</div>
</Col>
<Col xxl={4} xl={4} lg={4} md={5} sm={4} xs={24} className={styles.role}>
<div>
<Link to={EDIT_USER_URL}>修改会员信息</Link>
</div> </div>
</Col> </div>
</Row> <div className={styles.status}><Badge status={STATUS_COLOR[userAuth.validateStatus]} text={userAuth.validateStatusDesc}></Badge></div>
</Col> </div>
<Col xxl={10} xl={24} lg={10} md={24} sm={24}> <div className={styles.otherValues}>
<Row gutter={[8, 8]} align={"middle"}> <Link to={EDIT_USER_URL}>修改会员信息</Link>
<Col xxl={12} lg={12} md={10} sm={10}> <div className={styles.divider}>
<span>会员等级: </span> <div className={styles.level}>
<img src={LEVEL_IMAGE[userAuth.level]} className={styles.level} /> 会员等级: <img src={LEVEL_IMAGE[userAuth.level]} className={styles.levelImg} />
</Col> </div>
<Col xxl={6} lg={6} md={10 } sm={10} xs={24}>平台积分: <strong>{userAuth.score}</strong></Col> <div className={styles.score}>
<Col xxl={6} lg={6} md={4} sm={4} xs={24}> 平台积分: <strong>{userAuth.score}</strong>
<Link to={USER_CENTER_URL}>进入会员中心</Link> </div>
</Col> <Link to={USER_CENTER_URL}>进入会员中心</Link>
</Row> </div>
</div>
</Col> </div>
</Row>
</div> </div>
</div> </div>
) )
......
.grid_container { .container {
display: grid; display: flex;
} flex-direction: row;
.ability { min-width: 1366px;
margin-top: 16px;
.left {
flex: 1;
.otherCenters {
margin-top: 24px;
}
.ability {
margin-top: 24px;
}
}
.right {
margin-left: 24px;
flex-basis: 386px;
.actions {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-bottom: 24px;
.workBench {
width: 181px;
}
}
.commonMargin {
margin-bottom: 24px;
}
}
} }
.controller { .controller {
background-color: @main-color; background-color: @main-color;
height: 48px; height: 48px;
...@@ -16,6 +47,7 @@ ...@@ -16,6 +47,7 @@
flex-direction: row; flex-direction: row;
margin-left: auto; margin-left: auto;
cursor: pointer; cursor: pointer;
width: 181px;
.icon { .icon {
font-size: 22px; font-size: 22px;
...@@ -24,80 +56,3 @@ ...@@ -24,80 +56,3 @@
margin-left: 8px; margin-left: 8px;
} }
} }
.advertise {
margin-top: 16px;
}
@media (min-width: 1600px) {
.grid_container {
// display: grid;
// grid-template-columns: 75% 25%;
// grid-template-columns: repeat(24, 1fr);
// grid-auto-flow: column dense;
// grid-column-gap: 16px;
.top {
display: grid;
grid-template-columns: repeat(24, 1fr);
grid-column-gap: 16px;
grid-row-gap: 16px;
.userCenter {
grid-column-start: 1;
grid-column-end: 19;
grid-row-start: 1;
}
.actions {
grid-column-start: 19;
grid-column-end: 25;
grid-row-start: 1;
}
.announce {
grid-column-start: 19;
grid-column-end: 25;
margin-top: -200px;
}
.recentVisit {
grid-column-start: 19;
grid-column-end: 25;
}
}
}
.bottom {
display: grid;
grid-template-columns: repeat(24, 1fr);
grid-column-gap: 16px;
grid-row-gap: 16px;
.otherCenter {
grid-column-start: 1;
grid-column-end: 19;
grid-row-start: 1;
margin-top: -430px;
}
.anyQuestion {
grid-column-start: 19;
grid-column-end: 25;
margin-top: 16px;
}
.advertise {
grid-column-start: 19;
grid-column-end: 25;
}
}
}
@media (max-width: 1599px) {
.userCenter {
margin: 16px 0;
}
.recentVisit {
margin-top: 16px;
}
}
@media (min-width: 1200px) and (max-width: 1599px) {
}
...@@ -53,64 +53,60 @@ const Home: React.FC<{}> = () => { ...@@ -53,64 +53,60 @@ const Home: React.FC<{}> = () => {
return ( return (
<PageHeaderWrapper> <PageHeaderWrapper>
<div style={{minWidth: '1280px'}}> <div >
<div className={styles.userGuaid} style={{display: visible ? 'none': 'none'}}> <div className={styles.userGuaid} style={{display: visible ? 'none': 'none'}}>
<UseGuaid/> <UseGuaid/>
</div> </div>
<div className={styles.grid_container}> <div className={styles.container}>
<div className={styles.top}> <div className={styles.left}>
<div className={styles.actions}>
<Row gutter={24}>
<Col span={12}>
<CustomWorkBench
handleChangeOrder={handleChangeOrder}
layouts={layout}
/></Col>
<Col span={12}>
<div className={styles.controller} onClick={() => setVisible((state) => !state)}>
<CompassFilled className={styles.icon} />
<span className={styles.text}>使用向导</span>
</div>
</Col>
</Row>
</div>
<div className={styles.userCenter}> <div className={styles.userCenter}>
<UserCenter /> <UserCenter />
</div> </div>
<div className={styles.announce}> <div className={styles.otherCenters}>
<Row gutter={[24, 12]}> {
<Col xxl={24} xl={12} lg={12} md={24} sm={24}><LatestAnnounce /></Col> layout.map((item) => {
<Col xxl={24} xl={12} lg={12} md={24} sm={24}><RecentVisit /></Col> const RenderComponent = ComponentSelect[item.name]
</Row> return (
<div
className={styles.ability}
style={{order: item.sort, display: (item.isShow ? 'block' : 'none')}}
key={item.code}
>
{
RenderComponent &&
<RenderComponent />
}
</div>
)
})
}
</div> </div>
</div> </div>
<div className={styles.bottom}> <div className={styles.right}>
<div className={styles.otherCenter}> <div className={styles.actions}>
{ <div className={styles.workBench}>
layout.map((item) => { <CustomWorkBench
const RenderComponent = ComponentSelect[item.name] handleChangeOrder={handleChangeOrder}
return ( layouts={layout}
<div />
className={styles.ability} </div>
style={{order: item.sort, display: (item.isShow ? 'block' : 'none')}} <div className={styles.controller} onClick={() => setVisible((state) => !state)}>
key={item.code} <CompassFilled className={styles.icon} />
> <span className={styles.text}>使用向导</span>
{ </div>
RenderComponent &&
<RenderComponent />
}
</div>
)
})
}
</div> </div>
<div className={styles.anyQuestion}> <div className={styles.commonMargin}>
<LatestAnnounce />
</div>
<div className={styles.commonMargin}>
<RecentVisit />
</div>
<div className={styles.commonMargin}>
<AnyQuestion /> <AnyQuestion />
<div className={styles.advertise}>
<AdvertisementContainer />
</div>
</div> </div>
<div className={styles.commonMargin}>
<AdvertisementContainer />
</div>
</div> </div>
</div> </div>
......
/*
* @Author: XieZhiXiong
* @Date: 2020-12-22 18:01:50
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-22 18:01:51
* @Description: 单据列表 弹窗表格列
*/
import {
ORDER_TYPE2,
PurchaseOrderInsideWorkStateTexts,
} from '@/constants';
/**
* 采购订单-弹窗表格列
*/
export const purchaseOrderColumns: any[] = [
{
title: '订单号',
align: 'center',
dataIndex: 'orderNo',
},
{
title: '订单摘要',
align: 'center',
dataIndex: 'orderThe',
},
{
title: '会员名称',
align: 'center',
dataIndex: 'supplyMembersName',
},
{
title: '下单时间',
align: 'center',
dataIndex: 'createTime',
},
{
title: '订单类型',
align: 'center',
dataIndex: 'type',
render: text => ORDER_TYPE2[text],
},
{
title: '订单状态',
align: 'center',
dataIndex: 'interiorState',
render: text => PurchaseOrderInsideWorkStateTexts[text],
},
];
/**
* 销售订单-弹窗表格列
*/
export const salesOrderColumns: any[] = [
{
title: '订单号',
align: 'center',
dataIndex: 'orderNo',
},
{
title: '订单摘要',
align: 'center',
dataIndex: 'orderThe',
},
{
title: '会员名称',
align: 'center',
dataIndex: 'createMemberName',
},
{
title: '下单时间',
align: 'center',
dataIndex: 'createTime',
},
{
title: '订单类型',
align: 'center',
dataIndex: 'type',
render: text => ORDER_TYPE2[text],
},
{
title: '订单状态',
align: 'center',
dataIndex: 'interiorState',
render: text => PurchaseOrderInsideWorkStateTexts[text],
},
];
/**
* 加工入库单列表
*/
export const machiningWarehousingColumns = [
{
title: '通知单号',
align: 'center',
dataIndex: 'noticeNo',
},
{
title: '通知单摘要',
align: 'center',
dataIndex: 'summary',
},
{
title: '加工企业名称',
align: 'center',
dataIndex: 'processName',
},
{
title: '单据时间',
align: 'center',
dataIndex: 'createTime',
},
{
title: '申请单状态',
align: 'center',
dataIndex: 'outerStatusName',
},
];
/**
* 加工发货单列表
*/
export const machiningDeliveryColumns = [
{
title: '通知单号',
align: 'center',
dataIndex: 'noticeNo',
},
{
title: '通知单摘要',
align: 'center',
dataIndex: 'summary',
},
{
title: '供应会员',
align: 'center',
dataIndex: 'supplierName',
},
{
title: '单据时间',
align: 'center',
dataIndex: 'createTime',
},
{
title: '申请单状态',
align: 'center',
dataIndex: 'outerStatusName',
},
];
/**
* 售后发货、入库订单列表
*/
export const getAfterSaleColumns = (isPurchaser?: boolean) => {
return [
{
title: '申请单号',
align: 'center',
dataIndex: 'applyNo',
},
{
title: '申请单摘要',
align: 'center',
dataIndex: 'applyAbstract',
},
isPurchaser ? {
title: '供应会员',
align: 'center',
dataIndex: 'supplierName',
} : {
title: '采购会员',
align: 'center',
dataIndex: 'consumerName',
},
{
title: '单据时间',
align: 'center',
dataIndex: 'applyTime',
},
{
title: '申请单状态',
align: 'center',
dataIndex: 'outerStatusName',
},
];
};
\ No newline at end of file
...@@ -752,6 +752,84 @@ export const machiningDeliveryBillSchema: ISchema = { ...@@ -752,6 +752,84 @@ export const machiningDeliveryBillSchema: ISchema = {
}, },
}; };
// 售后发货、入库 弹窗 search schema
export const afterSaleBillSchema = (isPurchaser: boolean): ISchema => {
return {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'Mega-Layout',
properties: {
search: {
type: 'string',
'x-component': 'Search',
'x-mega-props': {},
'x-component-props': {
placeholder: '搜索',
align: 'flex-start',
tip: '输入 通知单号 进行搜索',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 3,
},
properties: {
applyAbstract: {
type: 'string',
'x-component-props': {
placeholder: '申请单摘要',
allowClear: true,
},
},
...(isPurchaser ? {
supplierName: {
type: 'string',
'x-component-props': {
placeholder: '供应会员',
allowClear: true,
},
},
} : {
consumerName: {
type: 'string',
'x-component-props': {
placeholder: '采购会员',
allowClear: true,
},
},
}),
'[startTime, endTime]': {
type: 'string',
'x-component': 'DateSelect',
'x-component-props': {
placeholder: '单据时间',
allowClear: true,
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
}
}
},
},
},
},
},
}
};
export const goodsSearchSchema: ISchema = { export const goodsSearchSchema: ISchema = {
type: 'object', type: 'object',
properties: { properties: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment