完善页面

This commit is contained in:
WenC 2024-03-18 18:50:36 +08:00
parent c18cc21a8c
commit ba054a7448
14 changed files with 228 additions and 122 deletions

BIN
src/assets/no-data.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -6,24 +6,24 @@ import {AgentMedalEnum, IAgent} from "../../interfaces/card/ICardProj.ts";
export default function CardAgent(props: IAgent) {
const renderMedal = () => {
if(props.medal == AgentMedalEnum.GOLD) {
if (props.medal == AgentMedalEnum.GOLD) {
return <span className="card-agent-medal gold"></span>;
}
if(props.medal == AgentMedalEnum.SILVER) {
if (props.medal == AgentMedalEnum.SILVER) {
return <span className="card-agent-medal silver"></span>;
}
if(props.medal == AgentMedalEnum.BRONZE) {
if (props.medal == AgentMedalEnum.BRONZE) {
return <span className="card-agent-medal bronze"></span>;
}
return <span className="card-agent-medal"></span>;
}
return (
<div className="card-agent" onClick={() => {
<div className={props.selected ? 'card-agent selected' : 'card-agent'} onClick={() => {
props.handleSelect();
}}>
<div className="card-agent-head">
{props.logo ? <Image width={30} src={props.logo} fallback={errorImage} /> : <></>}
{props.logo ? <Image width={30} src={props.logo} fallback={errorImage}/> : <></>}
<span className="card-agent-title">{props.name}</span>
{renderMedal()}
</div>

View File

@ -1,18 +1,6 @@
import './card-proj.css';
import {DownOutlined, EditOutlined, SearchOutlined, EyeOutlined, FolderOutlined} from '@ant-design/icons';
import {MenuProps} from 'antd';
import {Dropdown, Space} from 'antd';
const items: MenuProps['items'] = [
{
key: '1',
label: (
<a target="_blank" rel="noopener noreferrer" href="https://www.antgroup.com">
1st menu item
</a>
),
},
];
import {EditOutlined, SearchOutlined, EyeOutlined, FolderOutlined, SettingOutlined, DownloadOutlined} from '@ant-design/icons';
import {Button, ConfigProvider, Tag} from 'antd';
export default function CardProj() {
return (
@ -49,30 +37,37 @@ export default function CardProj() {
</div>
</div>
<div className="line">
<div className="left">
<span>
<Dropdown menu={{items}}>
<a onClick={(e) => e.preventDefault()}>
<Space> <DownOutlined/></Space>
</a>
</Dropdown>
</span>
<span>
<Dropdown menu={{items}}>
<a onClick={(e) => e.preventDefault()}>
<Space> <DownOutlined/></Space>
</a>
</Dropdown>
</span>
</div>
<div className="left"></div>
<div className="right">
<span>
<FolderOutlined />
<FolderOutlined/>
<a href="/#"></a>
</span>
</div>
</div>
</div>
<hr/>
<div className="foot">
<ConfigProvider theme={{
components: {
Button: {
contentFontSizeSM: 12,
}
}
}}>
<div className="option">
<Button size="small" type="text"><SettingOutlined/> </Button>
<Button size="small" type="text"><SettingOutlined/> (0)</Button>
<Button size="small" type="text"><SettingOutlined/> (0)</Button>
</div>
<div className="option">
<Button size="small" type="text"><DownloadOutlined/> </Button>
<Button size="small" type="text"><DownloadOutlined/> </Button>
<Button size="small" type="text"><DownloadOutlined/> </Button>
<Button size="small" type="text"><DownloadOutlined /> </Button>
</div>
</ConfigProvider>
</div>
</div>
)
}

View File

@ -1,6 +1,23 @@
.card-agent {
}
.selected {
position: relative;
}
.selected:before {
content: '';
position: absolute;
width: 10px;
height: 10px;
border: 5px solid var(--color-red);
z-index: 10;
top: 0;
right: 0;
border-left: transparent;
border-bottom: transparent;
}
.card-agent .card-agent-head {
padding: 10px 10px 5px 10px;
display: flex;

View File

@ -83,13 +83,13 @@
}
.proj .proj-body .proj-charge .ant-checkbox-wrapper:hover .ant-checkbox-inner {
border-color: var(--color-orange);
border-color: var(--color-primary);
}
.proj .proj-body .proj-charge .ant-checkbox-wrapper .ant-checkbox-checked .ant-checkbox-inner,
.proj .proj-body .proj-charge .ant-checkbox-wrapper:hover .ant-checkbox-checked .ant-checkbox-inner {
border-color: var(--color-orange);
background-color: var(--color-orange);
border-color: var(--color-primary);
background-color: var(--color-primary);
}
.proj .proj-foot {
@ -103,7 +103,7 @@
text-align: center;
margin: 0 5px;
padding: 10px 0;
background-color: var(--color-orange);
background-color: var(--color-primary);
color: var(--color-light);
flex-basis: 100%;
}

View File

@ -74,3 +74,10 @@
margin-left: 5px;
}
.card-proj .foot {
position: unset;
background-color: transparent;
display: flex;
justify-content: space-between;
align-items: center;
}

View File

@ -41,8 +41,8 @@
}
.list-proj-agent .body .page .ant-pagination-item-active {
border-color: var(--color-orange);
background-color: var(--color-orange);
border-color: var(--color-primary);
background-color: var(--color-primary);
}
.list-proj-agent .body .page .ant-pagination-item-active a {

View File

@ -41,8 +41,8 @@
}
.list-proj .body .page .ant-pagination-item-active {
border-color: var(--color-orange);
background-color: var(--color-orange);
border-color: var(--color-primary);
background-color: var(--color-primary);
}
.list-proj .body .page .ant-pagination-item-active a {

View File

@ -23,13 +23,13 @@
}
.step-proj .step .complete {
border: 1px solid var(--color-blue);
color: var(--color-blue);
border: 1px solid var(--color-primary);
color: var(--color-primary);
}
.step-proj .step .processing {
border: 1px solid var(--color-blue);
background-color: var(--color-blue);
border: 1px solid var(--color-primary);
background-color: var(--color-primary);
color: var(--color-light);
}
@ -77,7 +77,7 @@
}
.step-proj .step-line-complete {
border-color: var(--color-blue);
border-color: var(--color-primary);
}
.step-proj .step-card {

View File

@ -2,7 +2,7 @@
--color-border: rgba(206, 206, 206, 0.4);
--color-box-shadow: rgba(206, 206, 206, 0.4);
--color-red: #ff5722;
--color-orange: rgba(252, 189, 0, 1);
--color-primary: rgba(252, 189, 0, 1);
--color-green: rgba(129, 179, 55, 1);
--color-blue: rgba(64, 149, 229, 1);
--color-purple: #a233c6;
@ -55,7 +55,7 @@ ul {
}
.btn-orange {
background-color: var(--color-orange);
background-color: var(--color-primary);
color: var(--color-light);
}

View File

@ -5,6 +5,7 @@ import CardAgent from "../../components/card/CardAgent.tsx";
import {errorImage} from "../../util/CommonUtil.ts";
import {useState} from "react";
import {AgentMedalEnum} from "../../interfaces/card/ICardProj.ts";
import NoData from '../../assets/no-data.png';
export default function AgentSelect() {
const [value, setValue] = useState(1);
@ -12,6 +13,121 @@ export default function AgentSelect() {
// const params = useParams();
const height = window.innerHeight - 150;
const [selectedAgentId, setSelectedAgentId] = useState('0');
const [selectedAgent, setSelectedAgent] = useState({});
// 列表
const [agentList, setAgentList] = useState([{
id: '1',
logo: '1',
name: '标题1',
desc: '描述1',
medal: AgentMedalEnum.GOLD,
certificateImg: '1',
selected: false
}, {
id: '2',
logo: '2',
name: '标题2',
desc: '描述2',
medal: AgentMedalEnum.GOLD,
certificateImg: '1',
selected: false
}]);
const renderAgent = () => {
return agentList.map((item, index) => {
return (
<CardAgent key={`agent${index}`} logo={item.logo}
name={item.name}
desc={item.desc}
medal={item.medal}
certificateImg={item.certificateImg}
selected={selectedAgentId == item.id}
handleSelect={() => {
setSelectedAgentId(item.id);
setSelectedAgent(item);
}}
/>
)
})
}
const renderSelectedAgent = () => {
if (Object.keys(selectedAgent).length == 0) {
return (
<>
<div className="no-data">
<Image src={NoData}/>
<span></span>
</div>
</>
)
}
return (
<>
<div className="agent-info">
<div className="agent-title"></div>
<div className="agent-body">
<div className="agent-name"></div>
<div className="agent-desc">
西西
</div>
<Divider dashed style={{
marginTop: '10px',
marginBottom: '10px'
}}/>
<div className="agent-img-title"></div>
<div className="agent-img-list">
<Image width={270}
height={170}
fallback={errorImage}
/>
<Image width={270}
height={170}
fallback={errorImage}
/>
<Image width={270}
height={170}
fallback={errorImage}
/>
<Image width={270}
height={170}
fallback={errorImage}
/>
</div>
<Divider dashed style={{
marginTop: '10px',
marginBottom: '10px'
}}/>
<div className="agent-contact">
<div className="line">
<span>XXXXXX</span>
<span>13888888888</span>
</div>
<div className="line">
<span>XXXXXX</span>
</div>
</div>
</div>
</div>
<div className="agent-price">
<span className="label"></span>
<Radio.Group onChange={(e: RadioChangeEvent) => {
console.log('radio checked', e.target.value);
setValue(e.target.value);
}} value={value}>
<Radio value={1}>200</Radio>
<Radio value={2}>400</Radio>
</Radio.Group>
</div>
<div style={{marginTop: '15px', textAlign: 'center'}}>
<Button type="primary" style={{backgroundColor: 'var(--color-primary)'}}></Button>
</div>
</>
)
}
return (
<>
<Breadcrumb
@ -31,78 +147,27 @@ export default function AgentSelect() {
<div className="agent-select-left">
<div className="list">
<div className="list-item">
<CardAgent logo="1"
name="标题标题"
desc="描述描述试试少时诵诗书"
medal={AgentMedalEnum.NORMAL}
certificateImg="1"
handleSelect={() => {
console.log('1')
}}
/>
{renderAgent()}
</div>
<div className="load">
<Button type="text">...</Button>
<Button type="text" onClick={() => {
setAgentList([
...agentList,
{
id: '3',
logo: '3',
name: '标题3',
desc: '描述3',
medal: AgentMedalEnum.SILVER,
certificateImg: '3',
selected: false
}
])
}}>...</Button>
</div>
</div>
</div>
<div className="agent-select-right">
<div className="agent-info">
<div className="agent-title"></div>
<div className="agent-body">
<div className="agent-name"></div>
<div className="agent-desc">
西西
</div>
<Divider dashed style={{
marginTop: '10px',
marginBottom: '10px'
}}/>
<div className="agent-img-title"></div>
<div className="agent-img-list">
<Image width={270}
height={170}
fallback={errorImage}
/>
<Image width={270}
height={170}
fallback={errorImage}
/>
<Image width={270}
height={170}
fallback={errorImage}
/>
<Image width={270}
height={170}
fallback={errorImage}
/>
</div>
<Divider dashed style={{
marginTop: '10px',
marginBottom: '10px'
}}/>
<div className="agent-contact">
<div className="line">
<span>XXXXXX</span>
<span>13888888888</span>
</div>
<div className="line">
<span>XXXXXX</span>
</div>
</div>
</div>
</div>
<div className="agent-price">
<span className="label"></span>
<Radio.Group onChange={(e: RadioChangeEvent) => {
console.log('radio checked', e.target.value);
setValue(e.target.value);
}} value={value}>
<Radio value={1}>200</Radio>
<Radio value={2}>400</Radio>
</Radio.Group>
</div>
</div>
<div className="agent-select-right">{renderSelectedAgent()}</div>
</div>
</>

View File

@ -48,13 +48,27 @@
padding: 15px;
height: calc(100% - 30px);
overflow: auto;
width: 840px;
}
.agent-select .agent-select-right .no-data {
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.agent-select .agent-select-right .no-data span {
margin-top: 15px;
color: var(--color-dark);
}
.agent-select .agent-select-right .agent-info .agent-title {
border: 1px solid var(--color-border);
background-color: rgba(228,229,238,0.5);
padding: 5px 15px;
font-weight: 600;
font-weight: bold;
}
.agent-select .agent-select-right .agent-info .agent-body {
@ -65,7 +79,7 @@
.agent-select .agent-select-right .agent-info .agent-body .agent-name {
padding: 5px 0;
font-weight: 500;
font-weight: bold;
}
.agent-select .agent-select-right .agent-info .agent-body .agent-desc {
@ -103,6 +117,14 @@
padding: 15px;
}
.agent-select .agent-select-right .agent-price .ant-radio-inner {
border: 1px solid var(--color-primary);
}
.agent-select .agent-select-right .agent-price .ant-radio-checked .ant-radio-inner {
background-color: var(--color-primary);
}
.agent-select .agent-select-right .agent-price .label {
font-weight: bold;
}

View File

@ -74,7 +74,7 @@ export default function ProjEdit() {
</StepProjEdit>
</div>
<div className="btn-container">
<Button size="large" style={{width: '200px', fontSize: '14px', backgroundColor: 'var(--color-blue)', color: 'var(--color-light)'}} onClick={() => {
<Button size="large" style={{width: '200px', fontSize: '14px', backgroundColor: 'var(--color-primary)', color: 'var(--color-light)'}} onClick={() => {
nav(-1);
}}></Button>
</div>

View File

@ -80,7 +80,7 @@ export default function ProjNew() {
<Form.Item>
<Flex align="center" justify="center" gap="large">
<Button type="primary" htmlType="submit" style={{backgroundColor: 'var(--color-orange)'}}>
<Button type="primary" htmlType="submit" style={{backgroundColor: 'var(--color-primary)'}}>
</Button>
<Button type="default" htmlType="button" onClick={onBack}>