Commit c094c005 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

feat(平台营销活动报名): 列表接口接入

parent f58bf2c4
......@@ -77,7 +77,7 @@ const memberCenterRoute = {
// AuthConfigRoute,
// MemberRoute,
// HandlingRoute,
// marketingRoute,
marketingRoute,
...asyncRoutes,
{
path: '/memberCenter/noAuth',
......
......@@ -158,6 +158,10 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
if (routeAuthUrls.includes(pathname)) {
return;
}
if (isDev) {
return
}
// 无权限访问时
// console.log(pathname)
console.log('无权限访问时')
......
......@@ -130,13 +130,13 @@ export enum LAYOUT_TYPE {
// 本地环境跳过权限校验
// export const isDev = process.env.NODE_ENV === "development"
export const isDev = process.env.NODE_ENV === "development"
// 暂时将权限访问关闭
export const isDev = false
// export const isDev = false
export const Environment_Status = {
0: "所有",
......
......@@ -370,7 +370,7 @@ const HandlingInfo: React.FC<HandlingInfoPropsType> = (props) => {
const handleMallSelectChange = (val, option) => {
setDoor(option.children);
if (option.url) {
checkUrl(option.url) ? setResUrl(`${checkUrl(option.url)}.${getTopDomainByHost(siteUrl, true)}`) : setResUrl(`${siteUrl}`)
checkUrl(option.url) ? setResUrl(`${checkUrl(option.url)}.${getTopDomainByHost(siteUrl, true)}/aboutUs/${shopInfo.id}`) : setResUrl(`${siteUrl}`)
}
}
......
......@@ -371,7 +371,7 @@ const LogisticsInfo: React.FC<LogisticsInfoPropsType> = (props) => {
const handleMallSelectChange = (val, option) => {
setDoor(option.children);
if (option.url) {
checkUrl(option.url) ? setResUrl(`${checkUrl(option.url)}.${getTopDomainByHost(siteUrl, true)}`) : setResUrl(`${siteUrl}`)
checkUrl(option.url) ? setResUrl(`${checkUrl(option.url)}.${getTopDomainByHost(siteUrl, true)}/aboutUs/${shopInfo.id}`) : setResUrl(`${siteUrl}`)
}
}
......
import moment from 'moment';
export const format = (text, fmt?: string) => {
return <>{moment(text).format(fmt || "YYYY-MM-DD HH:mm")}</>
}
......@@ -33,6 +33,8 @@ interface Iprops {
externalStatusFetch?: Promise<unknown>,
/** 内部状态接口 */
interiorStatusFetch?: Promise<unknown>,
/** 状态选择接口 */
useStateEffects?: () => void,
}
const formActions = createFormActions();
const Table: React.FC<Iprops> = (props: any) => {
......@@ -46,7 +48,8 @@ const Table: React.FC<Iprops> = (props: any) => {
reload,
fetchRowkeys,
externalStatusFetch,
interiorStatusFetch
interiorStatusFetch,
useStateEffects,
} = props;
const tableRef = useRef<any>({});
......@@ -132,6 +135,7 @@ const Table: React.FC<Iprops> = (props: any) => {
searchSelectGetSelectCategoryOptionEffect(actions, 'category')
})
useBusinessEffects();
useStateEffects && useStateEffects();
}}
schema={schema}
>
......
......@@ -5,98 +5,83 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ColumnType } from 'antd/lib/table/interface';
import StatusTag from '@/components/StatusTag';
import { Button, Space } from 'antd'
import EyePreview from '@/components/EyePreview';
import { format } from '@/pages/transaction/common/dateFormat';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { FormEffectHooks } from '@formily/antd';
import { PublicApi } from '@/services/api';
const { onFormMount$ } = FormEffectHooks;
const ReadyExamineOne = () => {
const columns: ColumnType<any>[] = [{
title: 'ID',
dataIndex: 'id',
align: 'left',
},
{
title: '活动名称',
dataIndex: 'activityName',
align: 'left',
render: (text) =>
<span style={{ color: '#00B37A' }}>{text}</span>
},
{
title: '活动类型',
dataIndex: 'activityType',
align: 'left',
},
{
title: '活动开始时间',
dataIndex: 'startTime',
align: 'left',
},
{
title: '活动结束时间',
dataIndex: 'endTime',
align: 'left',
},
{
title: '报名开始时间',
dataIndex: 'startTime',
align: 'left',
},
{
title: '报名结束时间',
dataIndex: 'endTime',
align: 'left',
},
{
title: '外部状态',
dataIndex: 'outerStatus',
align: 'left',
render: (text) => (
<StatusTag type="danger" title={text} />
)
},
{
title: '内部状态',
dataIndex: 'innerStatus',
align: 'left',
},
{
title: '操作',
dataIndex: 'state',
align: 'left',
render: (_, record) => {
return (
<div>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }}>提交</span>
</div>
)
}
}
]
const mokiData = [
const columns: ColumnType<any>[] = [
{
title: '活动ID',
key: 'activityId',
dataIndex: 'activityId',
},
{
title: '活动名称',
key: 'activityName',
dataIndex: 'activityName',
render: (text) => <EyePreview>{text}</EyePreview>
},
{
title: '活动类型',
key: 'activityType',
dataIndex: 'activityType',
render: (_text, record) => <>{record.activityTypeName}</>,
},
{
title: '活动开始时间',
key: 'startTime',
dataIndex: 'startTime',
render: (text) => format(text)
},
{
title: '活动结束时间',
key: 'endTime',
dataIndex: 'endTime',
render: (text) => format(text)
},
{
title: '报名开始时间',
key: 'signUpStartTime',
dataIndex: 'signUpStartTime',
render: (text) => format(text)
},
{
title: '报名结束时间',
key: 'signUpEndTime',
dataIndex: 'signUpEndTime',
render: (text) => format(text)
},
{
id: '1',
activityName: 'tony',
activityType: '秒杀',
startTime: '2020-05-12 08:08',
endTime: '还剩 59 秒',
outerStatus: "待提交报平台审核",
innerStatus: '待提交审核',
title: '外部状态',
key: 'outerStatus',
dataIndex: 'outerStatus',
render: (text, record) => (
<StatusTag type="danger" title={record.outerStatusName} />
)
},
{
id: '2',
activityName: 'tony',
activityType: '秒杀',
startTime: '2020-05-12 08:08',
endTime: '还剩 59 秒',
outerStatus: "待提交报平台审核",
innerStatus: '待提交审核',
title: '内部状态',
key: 'innerStatus',
dataIndex: 'innerStatus',
render: (text, record) => (
<StatusTag type="danger" title={record.innerStatusName} />
)
},
{
id: '3',
activityName: 'tony',
activityType: '秒杀',
startTime: '2020-05-12 08:08',
endTime: '还剩 59 秒',
outerStatus: "待提交报平台审核",
innerStatus: '待提交审核',
}
title: '操作',
key: 'state',
dataIndex: 'state',
render: (text, record) => (
<>
<Button type='link'>提交审核</Button>
<Button type='link'>填写报名资料</Button>
</>
)
},
]
/* 多选返回的 */
const fetchRowkeys = (row) => {
......@@ -105,14 +90,28 @@ const ReadyExamineOne = () => {
/* 操作按钮 */
const controllerBtns = (
<Space>
<Button type="ghost">批量提交审核</Button>
<Button type="ghost">批量审核通过</Button>
</Space>
)
const useStateEffects = () => {
const linkage = useLinkageUtils();
onFormMount$().subscribe(() => {
/** 活动类型 */
PublicApi.getMarketingPlatformActivitySignupGetActivityTypeList().then(res => {
const _enum = res.data.map((item) => { return { label: item.name, value: item.status } });
linkage.enum('activityType', _enum);
}).catch(err => {
console.warn(err)
})
})
}
return (
<TableLayout
columns={columns}
effects="name"
fetch={mokiData}
effects="id"
fetch={PublicApi.getMarketingPlatformActivitySignupPageTobeExamineStep1}
selectedRow={true}
fetchRowkeys={fetchRowkeys}
controllerBtns={controllerBtns}
......@@ -130,16 +129,11 @@ const ReadyExamineOne = () => {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'controllerBtns',
},
name: {
id: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
tip: '输入 会员名称 进行搜索',
placeholder: '活动ID',
},
},
},
......@@ -153,39 +147,35 @@ const ReadyExamineOne = () => {
},
},
properties: {
subject: {
activityName: {
type: 'string',
'x-component-props': {
placeholder: '考评主题',
allowClear: true,
placeholder: '活动名称',
style: {
width: 160,
},
},
},
'[appraisalDayStart,appraisalDayEnd]': {
type: 'daterange',
'[startTime,endTime]': {
type: 'string',
"x-component": "DateRangePickerUnix",
'x-component-props': {
placeholder: ['考评开始时间', '考评完成时间'],
allowClear: true,
placeholder: ['开始时间', '结束时间'],
style: {
width: 240,
},
},
},
status: {
activityType: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '内部状态(全部)',
allowClear: true,
placeholder: '活动类型',
style: {
width: 160,
},
},
enum: [],
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
......@@ -201,6 +191,7 @@ const ReadyExamineOne = () => {
},
},
}}
useStateEffects={useStateEffects}
/>
);
}
......
......@@ -8,6 +8,12 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ColumnType } from 'antd/lib/table/interface';
import StatusTag from '@/components/StatusTag';
import { Button, Space } from 'antd'
import { format } from '@/pages/transaction/common/dateFormat';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { FormEffectHooks } from '@formily/antd';
import { PublicApi } from '@/services/api';
const { onFormMount$ } = FormEffectHooks;
const ReadyExamineTwo = () => {
const columns: ColumnType<any>[] = [{
title: 'ID',
......@@ -108,14 +114,28 @@ const ReadyExamineTwo = () => {
/* 操作按钮 */
const controllerBtns = (
<Space>
<Button type="ghost">批量提交审核</Button>
<Button type="ghost">批量审核通过</Button>
</Space>
)
const useStateEffects = () => {
const linkage = useLinkageUtils();
onFormMount$().subscribe(() => {
/** 活动类型 */
PublicApi.getMarketingPlatformActivitySignupGetActivityTypeList().then(res => {
const _enum = res.data.map((item) => { return { label: item.name, value: item.status } });
linkage.enum('activityType', _enum);
}).catch(err => {
console.warn(err)
})
})
}
return (
<TableLayout
columns={columns}
effects="name"
fetch={mokiData}
effects="id"
fetch={PublicApi.getMarketingPlatformActivitySignupPageTobeExamineStep2}
selectedRow={true}
fetchRowkeys={fetchRowkeys}
controllerBtns={controllerBtns}
......@@ -133,16 +153,11 @@ const ReadyExamineTwo = () => {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'controllerBtns',
},
name: {
id: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
tip: '输入 会员名称 进行搜索',
placeholder: '活动ID',
},
},
},
......@@ -156,39 +171,35 @@ const ReadyExamineTwo = () => {
},
},
properties: {
subject: {
activityName: {
type: 'string',
'x-component-props': {
placeholder: '考评主题',
allowClear: true,
placeholder: '活动名称',
style: {
width: 160,
},
},
},
'[appraisalDayStart,appraisalDayEnd]': {
type: 'daterange',
'[startTime,endTime]': {
type: 'string',
"x-component": "DateRangePickerUnix",
'x-component-props': {
placeholder: ['考评开始时间', '考评完成时间'],
allowClear: true,
placeholder: ['开始时间', '结束时间'],
style: {
width: 240,
},
},
},
status: {
activityType: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '内部状态(全部)',
allowClear: true,
placeholder: '活动类型',
style: {
width: 160,
},
},
enum: [],
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
......@@ -204,6 +215,7 @@ const ReadyExamineTwo = () => {
},
},
}}
useStateEffects={useStateEffects}
/>
);
}
......
......@@ -4,111 +4,84 @@ import TableLayout from '../../../components/TableLayout';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ColumnType } from 'antd/lib/table/interface';
import StatusTag from '@/components/StatusTag';
import { Button, Space } from 'antd'
const ReadySubmit = () => {
const columns: ColumnType<any>[] = [{
title: 'ID',
dataIndex: 'id',
align: 'left',
},
{
title: '活动名称',
dataIndex: 'activityName',
align: 'left',
render: (text) =>
<span style={{ color: '#00B37A' }}>{text}</span>
},
{
title: '活动类型',
dataIndex: 'activityType',
align: 'left',
},
{
title: '活动开始时间',
dataIndex: 'startTime',
align: 'left',
},
{
title: '活动结束时间',
dataIndex: 'endTime',
align: 'left',
},
{
title: '报名开始时间',
dataIndex: 'startTime',
align: 'left',
},
{
title: '报名结束时间',
dataIndex: 'endTime',
align: 'left',
},
{
title: '报名时间',
dataIndex: 'startTime',
align: 'left',
},
{
title: '外部状态',
dataIndex: 'outerStatus',
align: 'left',
render: (text) => (
<StatusTag type="danger" title={text} />
)
},
{
title: '内部状态',
dataIndex: 'innerStatus',
align: 'left',
render: (text) => (
<div style={{ display: 'flex', alignItems: 'center' }}>
<span style={{ backgroundColor: '#C8CACD', width: 8, height: 8, display: 'inline-block', borderRadius: 50, marginRight: 10, }}></span>
<span>{text}</span>
</div>
)
import { Button, Space } from 'antd';
import { format } from '@/pages/transaction/common/dateFormat';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { FormEffectHooks } from '@formily/antd';
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
const { onFormMount$ } = FormEffectHooks;
},
{
title: '操作',
dataIndex: 'state',
align: 'left',
render: (_, record) => {
return (
<div>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }}>提交</span>
</div>
)
}
}
]
const mokiData = [
const ReadySubmit = () => {
const columns: ColumnType<any>[] = [
{
title: '活动ID',
key: 'activityId',
dataIndex: 'activityId',
},
{
title: '活动名称',
key: 'activityName',
dataIndex: 'activityName',
render: (text) => <EyePreview>{text}</EyePreview>
},
{
title: '活动类型',
key: 'activityType',
dataIndex: 'activityType',
render: (_text, record) => <>{record.activityTypeName}</>,
},
{
title: '活动开始时间',
key: 'startTime',
dataIndex: 'startTime',
render: (text) => format(text)
},
{
title: '活动结束时间',
key: 'endTime',
dataIndex: 'endTime',
render: (text) => format(text)
},
{
id: '1',
activityName: 'tony',
activityType: '秒杀',
startTime: '2020-05-12 08:08',
endTime: '还剩 59 秒',
outerStatus: "待提交报平台审核",
innerStatus: '待提交审核',
title: '报名开始时间',
key: 'signUpStartTime',
dataIndex: 'signUpStartTime',
render: (text) => format(text)
},
{
id: '2',
activityName: 'tony',
activityType: '秒杀',
startTime: '2020-05-12 08:08',
endTime: '还剩 59 秒',
outerStatus: "待提交报平台审核",
innerStatus: '待提交审核',
title: '报名结束时间',
key: 'signUpEndTime',
dataIndex: 'signUpEndTime',
render: (text) => format(text)
},
{
id: '3',
activityName: 'tony',
activityType: '秒杀',
startTime: '2020-05-12 08:08',
endTime: '还剩 59 秒',
outerStatus: "待提交报平台审核",
innerStatus: '待提交审核',
}
title: '外部状态',
key: 'outerStatus',
dataIndex: 'outerStatus',
render: (text, record) => (
<StatusTag type="danger" title={record.outerStatusName} />
)
},
{
title: '内部状态',
key: 'innerStatus',
dataIndex: 'innerStatus',
render: (text, record) => (
<StatusTag type="danger" title={record.innerStatusName} />
)
},
{
title: '操作',
key: 'state',
dataIndex: 'state',
render: (text, record) => (
<>
<Button type='link'>提交审核</Button>
<Button type='link'>填写报名资料</Button>
</>
)
},
]
/* 多选返回的 */
const fetchRowkeys = (row) => {
......@@ -117,14 +90,28 @@ const ReadySubmit = () => {
/* 操作按钮 */
const controllerBtns = (
<Space>
<Button type="ghost">批量提交</Button>
<Button type="ghost">批量提交审核</Button>
</Space>
)
const useStateEffects = () => {
const linkage = useLinkageUtils();
onFormMount$().subscribe(() => {
/** 活动类型 */
PublicApi.getMarketingPlatformActivitySignupGetActivityTypeList().then(res => {
const _enum = res.data.map((item) => { return { label: item.name, value: item.status } });
linkage.enum('activityType', _enum);
}).catch(err => {
console.warn(err)
})
})
}
return (
<TableLayout
columns={columns}
effects="name"
fetch={mokiData}
effects="id"
fetch={PublicApi.getMarketingPlatformActivitySignupPageTobeSubmitSignUp}
selectedRow={true}
fetchRowkeys={fetchRowkeys}
controllerBtns={controllerBtns}
......@@ -142,16 +129,11 @@ const ReadySubmit = () => {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'controllerBtns',
},
name: {
id: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
tip: '输入 会员名称 进行搜索',
placeholder: '活动ID',
},
},
},
......@@ -165,39 +147,35 @@ const ReadySubmit = () => {
},
},
properties: {
subject: {
activityName: {
type: 'string',
'x-component-props': {
placeholder: '考评主题',
allowClear: true,
placeholder: '活动名称',
style: {
width: 160,
},
},
},
'[appraisalDayStart,appraisalDayEnd]': {
type: 'daterange',
'[startTime,endTime]': {
type: 'string',
"x-component": "DateRangePickerUnix",
'x-component-props': {
placeholder: ['考评开始时间', '考评完成时间'],
allowClear: true,
placeholder: ['开始时间', '结束时间'],
style: {
width: 240,
},
},
},
status: {
activityType: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '内部状态(全部)',
allowClear: true,
placeholder: '活动类型',
style: {
width: 160,
},
},
enum: [],
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
......@@ -213,6 +191,7 @@ const ReadySubmit = () => {
},
},
}}
useStateEffects={useStateEffects}
/>
);
}
......
......@@ -5,104 +5,83 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ColumnType } from 'antd/lib/table/interface';
import StatusTag from '@/components/StatusTag';
import { Button, Space } from 'antd'
import EyePreview from '@/components/EyePreview';
import { format } from '@/pages/transaction/common/dateFormat';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { FormEffectHooks } from '@formily/antd';
import { PublicApi } from '@/services/api';
const { onFormMount$ } = FormEffectHooks;
const ReadySubmitExamine = () => {
const columns: ColumnType<any>[] = [{
title: 'ID',
dataIndex: 'id',
align: 'left',
},
{
title: '活动名称',
dataIndex: 'activityName',
align: 'left',
render: (text) =>
<span style={{ color: '#00B37A' }}>{text}</span>
},
{
title: '活动类型',
dataIndex: 'activityType',
align: 'left',
},
{
title: '活动开始时间',
dataIndex: 'startTime',
align: 'left',
},
{
title: '活动结束时间',
dataIndex: 'endTime',
align: 'left',
},
{
title: '报名开始时间',
dataIndex: 'startTime',
align: 'left',
},
{
title: '报名结束时间',
dataIndex: 'endTime',
align: 'left',
},
{
title: '报名时间',
dataIndex: 'startTime',
align: 'left',
},
{
title: '外部状态',
dataIndex: 'outerStatus',
align: 'left',
render: (text) => (
<StatusTag type="danger" title={text} />
)
},
{
title: '内部状态',
dataIndex: 'innerStatus',
align: 'left',
},
{
title: '操作',
dataIndex: 'state',
align: 'left',
render: (_, record) => {
return (
<div>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }}>提交</span>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }}>修改</span>
</div>
)
}
}
]
const mokiData = [
const columns: ColumnType<any>[] = [
{
title: '活动ID',
key: 'activityId',
dataIndex: 'activityId',
},
{
title: '活动名称',
key: 'activityName',
dataIndex: 'activityName',
render: (text) => <EyePreview>{text}</EyePreview>
},
{
title: '活动类型',
key: 'activityType',
dataIndex: 'activityType',
render: (_text, record) => <>{record.activityTypeName}</>,
},
{
title: '活动开始时间',
key: 'startTime',
dataIndex: 'startTime',
render: (text) => format(text)
},
{
title: '活动结束时间',
key: 'endTime',
dataIndex: 'endTime',
render: (text) => format(text)
},
{
title: '报名开始时间',
key: 'signUpStartTime',
dataIndex: 'signUpStartTime',
render: (text) => format(text)
},
{
title: '报名结束时间',
key: 'signUpEndTime',
dataIndex: 'signUpEndTime',
render: (text) => format(text)
},
{
id: '1',
activityName: 'tony',
activityType: '秒杀',
startTime: '2020-05-12 08:08',
endTime: '还剩 59 秒',
outerStatus: "待提交报平台审核",
innerStatus: '待提交审核',
title: '外部状态',
key: 'outerStatus',
dataIndex: 'outerStatus',
render: (text, record) => (
<StatusTag type="danger" title={record.outerStatusName} />
)
},
{
id: '2',
activityName: 'tony',
activityType: '秒杀',
startTime: '2020-05-12 08:08',
endTime: '还剩 59 秒',
outerStatus: "待提交报平台审核",
innerStatus: '待提交审核',
title: '内部状态',
key: 'innerStatus',
dataIndex: 'innerStatus',
render: (text, record) => (
<StatusTag type="danger" title={record.innerStatusName} />
)
},
{
id: '3',
activityName: 'tony',
activityType: '秒杀',
startTime: '2020-05-12 08:08',
endTime: '还剩 59 秒',
outerStatus: "待提交报平台审核",
innerStatus: '待提交审核',
}
title: '操作',
key: 'state',
dataIndex: 'state',
render: (text, record) => (
<>
<Button type='link'>提交审核</Button>
<Button type='link'>填写报名资料</Button>
</>
)
},
]
/* 多选返回的 */
const fetchRowkeys = (row) => {
......@@ -114,11 +93,25 @@ const ReadySubmitExamine = () => {
<Button type="ghost">批量提交审核</Button>
</Space>
)
const useStateEffects = () => {
const linkage = useLinkageUtils();
onFormMount$().subscribe(() => {
/** 活动类型 */
PublicApi.getMarketingPlatformActivitySignupGetActivityTypeList().then(res => {
const _enum = res.data.map((item) => { return { label: item.name, value: item.status } });
linkage.enum('activityType', _enum);
}).catch(err => {
console.warn(err)
})
})
}
return (
<TableLayout
columns={columns}
effects="name"
fetch={mokiData}
effects="id"
fetch={PublicApi.getMarketingPlatformActivitySignupPageTobeSubmit}
selectedRow={true}
fetchRowkeys={fetchRowkeys}
controllerBtns={controllerBtns}
......@@ -136,16 +129,11 @@ const ReadySubmitExamine = () => {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'controllerBtns',
},
name: {
id: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
tip: '输入 会员名称 进行搜索',
placeholder: '活动ID',
},
},
},
......@@ -159,39 +147,35 @@ const ReadySubmitExamine = () => {
},
},
properties: {
subject: {
activityName: {
type: 'string',
'x-component-props': {
placeholder: '考评主题',
allowClear: true,
placeholder: '活动名称',
style: {
width: 160,
},
},
},
'[appraisalDayStart,appraisalDayEnd]': {
type: 'daterange',
'[startTime,endTime]': {
type: 'string',
"x-component": "DateRangePickerUnix",
'x-component-props': {
placeholder: ['考评开始时间', '考评完成时间'],
allowClear: true,
placeholder: ['开始时间', '结束时间'],
style: {
width: 240,
},
},
},
status: {
activityType: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '内部状态(全部)',
allowClear: true,
placeholder: '活动类型',
style: {
width: 160,
},
},
enum: [],
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
......@@ -207,6 +191,7 @@ const ReadySubmitExamine = () => {
},
},
}}
useStateEffects={useStateEffects}
/>
);
}
......
......@@ -4,102 +4,106 @@ import TableLayout from '../../../components/TableLayout';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ColumnType } from 'antd/lib/table/interface';
import StatusTag from '@/components/StatusTag';
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
import { format } from '@/pages/transaction/common/dateFormat';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { FormEffectHooks } from '@formily/antd';
const { onFormMount$ } = FormEffectHooks;
const Search = () => {
const columns: ColumnType<any>[] = [{
title: 'ID',
dataIndex: 'id',
align: 'left',
},
{
title: '活动名称',
dataIndex: 'activityName',
align: 'left',
render: (text) =>
<span style={{ color: '#00B37A' }}>{text}</span>
},
{
title: '活动类型',
dataIndex: 'activityType',
align: 'left',
},
{
title: '活动开始时间',
dataIndex: 'startTime',
align: 'left',
},
{
title: '活动结束时间',
dataIndex: 'endTime',
align: 'left',
},
{
title: '报名开始时间',
dataIndex: 'startTime',
align: 'left',
},
{
title: '报名结束时间',
dataIndex: 'endTime',
align: 'left',
},
{
title: '报名时间',
dataIndex: 'startTime',
align: 'left',
},
{
title: '外部状态',
dataIndex: 'outerStatus',
align: 'left',
render: (text) => (
<StatusTag type="danger" title={text} />
)
},
{
title: '内部状态',
dataIndex: 'innerStatus',
align: 'left',
}]
const mokiData = [
const columns: ColumnType<any>[] = [
{
id: '1',
activityName: 'tony',
activityType: '秒杀',
startTime: '2020-05-12 08:08',
endTime: '还剩 59 秒',
outerStatus: "待提交报平台审核",
innerStatus: '待提交审核',
title: '活动ID',
key: 'activityId',
dataIndex: 'activityId',
},
{
id: '2',
activityName: 'tony',
activityType: '秒杀',
startTime: '2020-05-12 08:08',
endTime: '还剩 59 秒',
outerStatus: "待提交报平台审核",
innerStatus: '待提交审核',
title: '活动名称',
key: 'activityName',
dataIndex: 'activityName',
render: (text) => <EyePreview>{text}</EyePreview>
},
{
id: '3',
activityName: 'tony',
activityType: '秒杀',
startTime: '2020-05-12 08:08',
endTime: '还剩 59 秒',
outerStatus: "待提交报平台审核",
innerStatus: '待提交审核',
}
title: '活动类型',
key: 'activityType',
dataIndex: 'activityType',
render: (_text, record) => <>{record.activityTypeName}</>,
},
{
title: '活动开始时间',
key: 'startTime',
dataIndex: 'startTime',
render: (text) => format(text)
},
{
title: '活动结束时间',
key: 'endTime',
dataIndex: 'endTime',
render: (text) => format(text)
},
{
title: '报名开始时间',
key: 'signUpStartTime',
dataIndex: 'signUpStartTime',
render: (text) => format(text)
},
{
title: '报名结束时间',
key: 'signUpEndTime',
dataIndex: 'signUpEndTime',
render: (text) => format(text)
},
{
title: '外部状态',
key: 'outerStatus',
dataIndex: 'outerStatus',
render: (text, record) => (
<StatusTag type="danger" title={record.outerStatusName} />
)
},
{
title: '内部状态',
key: 'innerStatus',
dataIndex: 'innerStatus',
render: (text, record) => (
<StatusTag type="danger" title={record.innerStatusName} />
)
},
]
/* 多选返回的 */
const fetchRowkeys = (row) => {
console.log(row);
const useStateEffects = () => {
const linkage = useLinkageUtils();
onFormMount$().subscribe(() => {
/** 活动类型 */
PublicApi.getMarketingPlatformActivitySignupGetActivityTypeList().then(res => {
const _enum = res.data.map((item) => { return { label: item.name, value: item.status } });
linkage.enum('activityType', _enum);
}).catch(err => {
console.warn(err)
})
/** 外部状态 */
PublicApi.getMarketingPlatformActivitySignupGetOuterStatusList().then(res => {
const _enum = res.data.map((item) => { return { label: item.name, value: item.status } });
linkage.enum('outerStatus', _enum);
}).catch(err => {
console.warn(err)
})
/** 内部状态 */
PublicApi.getMarketingPlatformActivitySignupGetInnerStatusList ().then(res => {
const _enum = res.data.map((item) => { return { label: item.name, value: item.status } })
linkage.enum('innerStatus', _enum);
}).catch(err => {
console.warn(err)
})
})
}
return (
<TableLayout
columns={columns}
effects="name"
fetch={mokiData}
selectedRow={true}
fetchRowkeys={fetchRowkeys}
effects="id"
fetch={PublicApi.getMarketingPlatformActivitySignupPage}
useStateEffects={useStateEffects}
schema={{
type: 'object',
properties: {
......@@ -114,13 +118,11 @@ const Search = () => {
grid: true,
},
properties: {
name: {
id: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
tip: '输入 会员名称 进行搜索',
placeholder: '活动ID',
},
},
},
......@@ -134,39 +136,55 @@ const Search = () => {
},
},
properties: {
subject: {
activityName: {
type: 'string',
'x-component-props': {
placeholder: '考评主题',
allowClear: true,
placeholder: '活动名称',
style: {
width: 160,
},
},
},
'[appraisalDayStart,appraisalDayEnd]': {
type: 'daterange',
'[startTime,endTime]': {
type: 'string',
"x-component": "DateRangePickerUnix",
'x-component-props': {
placeholder: ['考评开始时间', '考评完成时间'],
allowClear: true,
placeholder: ['开始时间', '结束时间'],
style: {
width: 240,
},
},
},
status: {
activityType: {
type: 'string',
default: undefined,
'x-component-props': {
placeholder: '活动类型',
style: {
width: 160,
},
},
enum: [],
},
outerStatus: {
type: 'string',
'x-component-props': {
placeholder: '内部状态(全部)',
allowClear: true,
placeholder: '外部状态',
style: {
width: 160,
},
},
enum: [],
},
innerStatus: {
type: 'string',
'x-component-props': {
placeholder: '内部状态',
style: {
width: 160,
},
},
enum: [],
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
......
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