This commit is contained in:
felinae98 2021-11-29 15:26:30 +08:00
parent 82a13ceb66
commit ae62a763ed
No known key found for this signature in database
GPG Key ID: 00C8B010587FF610
3 changed files with 14 additions and 7 deletions

View File

@ -26,7 +26,7 @@ function InputTagCustom(prop: InputTagCustomProp) {
return ( return (
<> <>
{ {
prop.disabled ? <Tag color="red"></Tag>: prop.disabled ? <Tag color="default"></Tag>:
<> <>
{value.length === 0 && {value.length === 0 &&
<Tag color="green"></Tag> <Tag color="green"></Tag>
@ -77,9 +77,12 @@ export function AddModal({
} }
const handleSubmit = (value: any) => { const handleSubmit = (value: any) => {
let newVal = Object.assign({}, value) let newVal = Object.assign({}, value)
if (typeof newVal.tags != 'object') { if (typeof newVal.tags !== 'object') {
newVal.tags = [] newVal.tags = []
} }
if (typeof newVal.cats !== 'object') {
newVal.cats = []
}
if (newVal.target === '') { if (newVal.target === '') {
newVal.target = 'default' newVal.target = 'default'
} }

View File

@ -67,7 +67,7 @@ export function SubscribeCard({groupNumber, config, reload, groupSubscribes}: Su
}) })
} }
return ( return (
<Col span={6} key={`${config.platformName}-${config.target}`}> <Col span={8} key={`${config.platformName}-${config.target}`}>
<Card title={`${platformConf.name} - ${config.targetName}`} <Card title={`${platformConf.name} - ${config.targetName}`}
actions={[ actions={[
<Tooltip title="编辑"> <Tooltip title="编辑">
@ -81,15 +81,18 @@ export function SubscribeCard({groupNumber, config, reload, groupSubscribes}: Su
<Tooltip title="删除" ><DeleteOutlined /></Tooltip> <Tooltip title="删除" ><DeleteOutlined /></Tooltip>
</Popconfirm>, </Popconfirm>,
]}> ]}>
<Form labelCol={{ span: 6 }}> <Form labelCol={{ span: 4 }}>
<Form.Item label="订阅帐号">
{ platformConf.hasTarget ? config.target : <Tag color="default"></Tag> }
</Form.Item>
<Form.Item label="订阅类型"> <Form.Item label="订阅类型">
{Object.keys(platformConf.categories).length > 0 ? {Object.keys(platformConf.categories).length > 0 ?
config.cats.map((catKey: number) => (<Tag color="green" key={catKey}>{platformConf.categories[catKey]}</Tag>)) : config.cats.map((catKey: number) => (<Tag color="green" key={catKey}>{platformConf.categories[catKey]}</Tag>)) :
<Tag color="red"></Tag>} <Tag color="default"></Tag>}
</Form.Item> </Form.Item>
<Form.Item label="订阅Tag"> <Form.Item label="订阅Tag">
{platformConf.enabledTag ? config.tags.length > 0 ? config.tags.map(tag => (<Tag color="green" key={tag}>{tag}</Tag>)) : (<Tag color="blue"></Tag>) : {platformConf.enabledTag ? config.tags.length > 0 ? config.tags.map(tag => (<Tag color="green" key={tag}>{tag}</Tag>)) : (<Tag color="blue"></Tag>) :
<Tag color="red">Tag</Tag>} <Tag color="default">Tag</Tag>}
</Form.Item> </Form.Item>
</Form> </Form>
</Card> </Card>

View File

@ -37,7 +37,8 @@ export function ConfigPage(prop: ConfigPageProp) {
<Collapse.Panel key={key} header={ <Collapse.Panel key={key} header={
<span>{`${key} - ${value.name}`}<Button style={{float: "right"}} onClick={clickNew(key)}></Button></span> <span>{`${key} - ${value.name}`}<Button style={{float: "right"}} onClick={clickNew(key)}></Button></span>
}> }>
<Row gutter={{ xs: 8, sm: 16, md: 24, lg: 32 }} align="middle"> <Row gutter={[{ xs: 8, sm: 16, md: 24, lg: 32},
{ xs: 8, sm: 16, md: 24, lg: 32}]} align="middle">
{value.subscribes.map((subs, idx) => <SubscribeCard key={idx} {value.subscribes.map((subs, idx) => <SubscribeCard key={idx}
groupNumber={key} config={subs} groupSubscribes={configData} reload={loadData} groupNumber={key} config={subs} groupSubscribes={configData} reload={loadData}
/>)} />)}