import {
BizContainer,
BizValueType,
ProFormUploadMaterial,
} from '@/components';
import { business } from '@/services';
import { useIntl } from '@@/exports';
import {
ProColumns,
ProFormText,
ProFormTextArea,
} from '@ant-design/pro-components';
import { ProDescriptionsItemProps } from '@ant-design/pro-descriptions';
export default function ChannelList() {
const intl = useIntl();
const intlPrefix = 'channel';
const formContext = [
,
,
,
{
return {
logoList: value,
logo: value[0],
};
}}
fieldProps={{
maxCount: 1,
}}
/>,
{
return {
backgroundImageUrlList: value,
backgroundImageUrl: value[0],
};
}}
fieldProps={{
maxCount: 1,
}}
/>,
,
];
const columns: ProColumns[] = [
{
title: intl.formatMessage({ id: intlPrefix + '.column.logo' }),
dataIndex: 'logo',
valueType: 'image',
hideInSearch: true,
},
{
title: intl.formatMessage({ id: intlPrefix + '.column.title' }),
dataIndex: 'title',
},
{
title: intl.formatMessage({ id: intlPrefix + '.column.subTitle' }),
dataIndex: 'subTitle',
hideInSearch: true,
},
{
title: intl.formatMessage({ id: intlPrefix + '.column.domain' }),
dataIndex: 'domain',
valueType: 'text',
hideInSearch: true,
},
{
title: intl.formatMessage({
id: intlPrefix + '.column.backgroundImageUrl',
}),
dataIndex: 'backgroundImageUrl',
valueType: 'image',
hideInSearch: true,
},
{
title: intl.formatMessage({
id: intlPrefix + '.column.technicalSupport',
}),
dataIndex: 'technicalSupport',
hideInSearch: true,
},
{
title: intl.formatMessage({ id: intlPrefix + '.column.createdAt' }),
dataIndex: 'createdAt',
valueType: 'dateTime',
hideInSearch: true,
},
];
const detailColumns: ProDescriptionsItemProps<
BusinessAPI.ChannelVO,
BizValueType
>[] = columns as ProDescriptionsItemProps<
BusinessAPI.ChannelVO,
BizValueType
>[];
return (
rowKey={'channelId'}
permission={'operation-channel'}
func={business.channel}
method={'channel'}
methodUpper={'Channel'}
intlPrefix={intlPrefix}
modeType={'page'}
container={{}}
page={{
fieldProps: {},
columns,
}}
create={{
formType: 'drawer',
formContext,
}}
update={{
formType: 'drawer',
formContext,
// @ts-ignore
transform: (value) => {
return {
...value,
backgroundImageUrlList: [value.backgroundImageUrl],
logoList: [value.logo],
};
},
}}
destroy={{}}
detail={{
formType: 'drawer',
columns: detailColumns,
}}
/>
);
}