oak-general-business/es/components/application/cos/web.pc.js

47 lines
2.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from 'react';
import Styles from './styles.module.less';
import { Affix, Alert, Button, Select, Space, Typography } from 'antd';
const Cos = (props) => {
const { currentConfig, dirty, entity, name, selections } = props.data;
const { t, setValue, resetConfig, updateConfig } = props.methods;
return (<>
<Affix offsetTop={64}>
<Alert message={<div>
<text>
您正在更新
<Typography.Text keyboard>
{entity}
</Typography.Text>
对象
<Typography.Text keyboard>
{name}
</Typography.Text>
的COS配置请谨慎操作
</text>
</div>} type="info" showIcon action={<Space>
<Button disabled={!dirty} type="primary" danger onClick={() => resetConfig()} style={{
marginRight: 10,
}}>
{t('common::reset')}
</Button>
<Button disabled={!dirty} type="primary" onClick={() => updateConfig()}>
{t('common::action.confirm')}
</Button>
</Space>}/>
</Affix>
<div className={Styles.contains}>
<Space direction="vertical" style={{ width: '100%' }}>
<Typography.Text strong>默认COS源</Typography.Text>
<Select value={currentConfig?.cos?.defaultOrigin} onChange={(v) => {
setValue('cos.defaultOrigin', v);
}} style={{ width: '100%' }} allowClear placeholder="请选择默认COS源">
{selections.map((item) => (<Select.Option key={item.value} value={item.value}>
{t(item.name)}
</Select.Option>))}
</Select>
</Space>
</div>
</>);
};
export default Cos;