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

🐞 fix(Card组件): 修改大小写问题

parent d9a5eadf
......@@ -109,7 +109,7 @@ const router = [
// ...routeList,
// merchantMarketingRoute,
// ruleSettingRoutes,
// marketingRoutes,
marketingRoutes,
// platformCouponManageRoute,
...asyncRoutes,
// purchaseBidRoute,
......
......@@ -26,6 +26,15 @@ const marketingRoutes = {
component: '@/pages/marketing/waitAddedMarketing',
},
{
/** 待新增平台营销活动 - preview */
path: '/marketing/waitAddedMarketing/preview',
name: '待新增平台营销活动详情',
hidePageHeader: true,
hideInMenu: true,
noMargin: true,
component: '@/pages/marketing/detail',
},
{
/** 新增平台营销活动 - add */
path: '/marketing/waitAddedMarketing/add',
name: '新增平台营销活动',
......@@ -49,6 +58,24 @@ const marketingRoutes = {
component: '@/pages/marketing/waitAuditApply',
},
{
/** 待审核报名 - preview */
path: '/marketing/waitAuditApply/preview',
name: '待审核报名详情',
hidePageHeader: true,
hideInMenu: true,
noMargin: true,
component: '@/pages/marketing/detail',
},
{
/** 待审核报名 - detail */
path: '/marketing/waitAuditApply/detail',
name: '待审核报名详情',
hidePageHeader: true,
hideInMenu: true,
noMargin: true,
component: '@/pages/marketing/detail',
},
{
/** 待提交审核平台营销活动 - waitSubmitMarketing */
path: '/marketing/waitSubmitMarketing',
name: '待提交审核平台营销活动',
......
/** 详情通用 - 基本信息 */
import React from 'react';
import { Row, Col } from 'antd';
import Card from '../../../card';
import Card from '../../../Card';
import style from './index.less';
export interface BasicInfoProps {
......
......@@ -14,7 +14,7 @@ export interface IProps {
title: string,
visible: boolean,
id: number,
modalType: 'audit' | 'abandon',
modalType: 'audit' | 'abandon' | 'merkeingAudit',
onCancel?: () => void,
onOk?: () => void,
fetch?: () => Promise<unknown>,
......@@ -44,6 +44,17 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
})
})
}
if (modalType === 'merkeingAudit') {
onFieldChange$('isPass').subscribe(({ value }) => {
setFieldState('opinion', state => {
if (value == 1) {
state.visible = false
} else {
state.visible = true
}
})
})
}
}
const disabledDate = (current) => {
......@@ -62,29 +73,48 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
required
x-component="Radio"
x-component-props={{}}
/> :
<Field
title="作废时间"
name="reasonTime"
required
x-component="DatePicker"
x-component-props={{
format: 'YYYY-MM-DD HH:mm:ss',
disabledDate,
}}
/>
/> : modalType === 'merkeingAudit' ?
<Field
enum={
[
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 }
]}
name='isPass'
required
x-component="Radio"
x-component-props={{}}
/>
:
<Field
title="作废时间"
name="reasonTime"
required
x-component="DatePicker"
x-component-props={{
format: 'YYYY-MM-DD HH:mm:ss',
disabledDate,
}}
/>
const handleSubmit = (val: any) => {
let value = { ...val }
let params: any = {}
if (modalType === 'audit') {
params.id = id;
params.state = value.state;
value.state !== 1 && (params.auditOpinion = value.auditOpinion);
} else if (modalType === 'merkeingAudit') {
params.signUpId = id,
params.isPass = value.isPass;
params.opinion = value.opinion;
} else {
params.id = id;
params.reason = value.reason
params.reasonTime = new Date(value.reasonTime).getTime();
}
fetch({id, ...params}).then(res => {
fetch({ ...params }).then(res => {
if (res.code === 1000) {
onOk()
}
......@@ -118,13 +148,14 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
effects={() => useFormEffects()}
onSubmit={(values) => handleSubmit(values)}
initialValues={{
state: 1
state: 1,
isPass: 1,
}}
>
{modalNode}
<Field
title={modalText}
name={modalType === 'audit' ? 'auditOpinion' : 'reason'}
name={modalType === 'audit' ? 'auditOpinion' : modalType === 'merkeingAudit' ? 'opinion' : 'reason'}
x-component="TextArea"
required
x-component-props={{
......
......@@ -18,6 +18,7 @@ import { Columns } from './columns';
import { PublicApi } from '@/services/api';
import { isEmpty } from 'lodash';
import { CheckCircleOutlined } from '@ant-design/icons';
import ModalOperate from '@/pages/demand/components/modalOperate';
const TABLINK = [
{ id: 'progressLayout', title: '流转进度' },
......@@ -156,10 +157,20 @@ const DetialLayout = () => {
return Columns(dataSource.activityType || 1)
}, [dataSource.activityType])
const fetchLink = () => {
let fetchSoure: any = null;
switch (pathPci) {
case 'waitAuditApply':
fetchSoure = PublicApi.postMarketingPlatformActivityExamineSignUp
break;
}
return fetchSoure
}
return (
<Context.Provider value={dataSource}>
<PeripheralLayout
no={dataSource.activityId}
no={dataSource.id}
detail={dataSource.activityName}
tabLink={TABLINK}
effect={
......@@ -188,8 +199,8 @@ const DetialLayout = () => {
/>
<ListLayout
anchor="activityProductLayout"
done
data={[]}
fetch={PublicApi.getMarketingPlatformActivityDetailGoodsPage}
ids={{activityId: id}}
title="活动商品"
columns={columns}
/>
......@@ -199,6 +210,16 @@ const DetialLayout = () => {
</Fragment>
}
/>
{/* 审核 */}
<ModalOperate
id={signUpId}
title="单据审核"
modalType="merkeingAudit"
visible={visible}
fetch={fetchLink()}
onCancel={() => setVisible(false)}
onOk={() => history.goBack()}
/>
</Context.Provider>
)
}
......
......@@ -143,12 +143,18 @@ export const LADDERBOLIST = (int, type=1) => {
tooltip: type === 1 ? '优惠金额为最后订单总额减去的优惠金额' : '折扣为最后订单总额的折扣,输入数字,如85折,输入85,9折输入90',
label: `满量${type ===1 ? '减' : '折'}`,
message: `请新增满量${type ===1 ? '减' : '折'}`,
addon: '数量' ,
addonAfter: type === 1 ? '减' : '打',
addonBefore: type === 1 ? '元' : '折',
}
case 5:
return {
tooltip: type === 1 ? '优惠金额为最后订单总额减去的优惠金额' : '折扣为最后订单总额的折扣,输入数字,如85折,输入85,9折输入90',
label: `满额${type ===1 ? '减' : '折'}`,
message: `请新增满额${type ===1 ? '减' : '折'}`,
addon: '元' ,
addonAfter: type === 1 ? '减' : '打',
addonBefore: type === 1 ? '元' : '折',
}
case 7:
return {
......
......@@ -17,7 +17,13 @@ interface RulesLayoutProps {
const RulesLayout: React.FC<RulesLayoutProps> = (props: any) => {
const { option, form } = props;
const [data, setData] = useState<any>({});
console.log(data)
const [ladderType, setLadderType] = useState<number>(1)
const handleActivityDefinedBO = (e) => {
const { value } = e.target
setLadderType(Number(value));
}
/** 叠加活动类型 */
const allowActivity = (int) => {
switch (int) {
......@@ -121,8 +127,9 @@ const RulesLayout: React.FC<RulesLayoutProps> = (props: any) => {
label={PROMOTIONTYPE(int)?.label}
rules={[{ required: true, message: PROMOTIONTYPE(int)?.message }]}
className={style.rulesLayout}
initialValue={1}
>
<Radio.Group>
<Radio.Group onChange={handleActivityDefinedBO}>
{PROMOTIONTYPE(int)?.radio.map(item => (
<Radio.Button key={item.value} value={item.value}>{item.label}</Radio.Button>
))}
......@@ -191,7 +198,7 @@ const RulesLayout: React.FC<RulesLayoutProps> = (props: any) => {
}
}
/** 满量/额减 */
const ladderBOList = (int, type = 1) => {
const ladderBOList = (int, type) => {
switch (int) {
/** 满量促销 */
case 4:
......@@ -205,9 +212,8 @@ const RulesLayout: React.FC<RulesLayoutProps> = (props: any) => {
rules={[
{
validator: async (_, ladderBOList) => {
console.log(ladderBOList, 10086)
if (!ladderBOList || isEmpty(ladderBOList)) {
return Promise.reject(new Error(LADDERBOLIST(int)?.message));
return Promise.reject(new Error(LADDERBOLIST(int, type)?.message));
}
},
},
......@@ -215,8 +221,8 @@ const RulesLayout: React.FC<RulesLayoutProps> = (props: any) => {
>
{(fields, { add, remove }, { errors }) => (
<Form.Item
tooltip={LADDERBOLIST(int)?.tooltip}
label={LADDERBOLIST(int)?.label}
tooltip={LADDERBOLIST(int, type)?.tooltip}
label={LADDERBOLIST(int, type)?.label}
required
>
{fields.map(({ key, name, fieldKey, ...restField }) => (
......@@ -229,9 +235,9 @@ const RulesLayout: React.FC<RulesLayoutProps> = (props: any) => {
fieldKey={[fieldKey, `${int === 7 ? 'num' : 'key'}`]}
rules={[{ required: true, message: '请输入' }]}
>
<Input addonAfter="个" />
<Input addonAfter={LADDERBOLIST(int, type)?.addon} />
</Form.Item>
{LADDERBOLIST(int, type)?.addonAfter}
<Form.Item
{...restField}
style={{ margin: 0 }}
......@@ -239,7 +245,7 @@ const RulesLayout: React.FC<RulesLayoutProps> = (props: any) => {
fieldKey={[fieldKey, `${int === 7 ? 'discount' : 'value'}`]}
rules={[{ required: true, message: '请输入' }]}
>
<Input addonAfter="个" />
<Input addonAfter={LADDERBOLIST(int, type)?.addonBefore} />
</Form.Item>
<Button icon={<MinusOutlined />} onClick={() => remove(name)} />
</Space>
......@@ -480,7 +486,7 @@ const RulesLayout: React.FC<RulesLayoutProps> = (props: any) => {
>
{type(Number(data.value) || 1)}
{restrictNum(Number(data.value) || 1)}
{ladderBOList(Number(data.value) || 1)}
{ladderBOList(Number(data.value) || 1, ladderType)}
{giftType(Number(data.value) || 1)}
{swapType(Number(data.value) || 1)}
{allowActivity(Number(data.value) || 1)}
......
......@@ -63,7 +63,7 @@ const WaitAddedMarketing = () => {
title: '活动名称',
key: 'activityName',
dataIndex: 'activityName',
render: (text, record) => <EyePreview url={`/memberCenter/marketingAbility/paltformSign/search/detail?activityId=${record.activityId}`}>{text}</EyePreview>
render: (text, record) => <EyePreview url={`/marketing/waitAddedMarketing/preview?id=${record.id}`}>{text}</EyePreview>
},
{
title: '活动类型',
......
/** 待审核报名 */
import React from 'react';
import { Button } from 'antd';
import { history } from 'umi';
import TableLayout from '@/components/TableLayout';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ColumnType } from 'antd/lib/table/interface';
......@@ -23,7 +24,7 @@ const WaitAuditApply = () => {
title: '活动名称',
key: 'activityName',
dataIndex: 'activityName',
render: (text, record) => <EyePreview>{text}</EyePreview>
render: (text, record) => <EyePreview url={`/marketing/waitAuditApply/preview?id=${record.id}`}>{text}</EyePreview>
},
{
title: '活动类型',
......@@ -74,7 +75,7 @@ const WaitAuditApply = () => {
title: '操作',
key: 'state',
dataIndex: 'state',
render: (text, record) => <Button type='link'>审核报名</Button>
render: (text, record) => <Button type='link' onClick={() => history.push(`/marketing/waitAuditApply/detail?id=${record.id}&signUpId=${record.signUpId}`)}>审核报名</Button>
}
]
......
/** 详情通用 - 基本信息 */
import React from 'react';
import { Row, Col } from 'antd';
import Card from '../../../card';
import Card from '../../../Card';
import style from './index.less';
export interface BasicInfoProps {
......
......@@ -2,7 +2,7 @@ import React from 'react';
import { Row, Col, Divider, Tooltip } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import Card from '../../../card';
import Card from '../../../Card';
import selfStyles from './index.less';
......@@ -140,4 +140,4 @@ const BidCommonLayout: React.FC<BidCommonLayoutProps> = (props: any) => {
)
}
export default BidCommonLayout
\ No newline at end of file
export default BidCommonLayout
import React, { useContext, useEffect, useState } from 'react';
import { Tabs, Table, Row, Col, Space, Typography, Button } from 'antd';
import { Context } from '../context';
import Card from '../../../card';
import Card from '../../../Card';
import { PublicApi } from '@/services/api';
import style from './index.less';
import { CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons';
......
/** 详情通用 - 交易条件 */
import React from 'react';
import { Row, Col } from 'antd';
import Card from '../../../card';
import Card from '../../../Card';
import style from './index.less';
export interface ConditionProps {
......
......@@ -3,7 +3,7 @@ import { Space, Button, Tabs, Divider, Skeleton, Typography, message, Row, Col }
import { StandardTable } from 'god';
import { history } from 'umi';
import moment from 'moment';
import Card from '../../../card';
import Card from '../../../Card';
import { PRICECONTRAST_TYPE } from '../../../../constants';
import style from './index.less';
import EyePreview from '@/components/EyePreview';
......
import React, { useContext, useEffect, useState } from 'react';
import Card from '../../../card';
import Card from '../../../Card';
import { PRICECONTRAST_TYPE } from '../../../../constants';
import { Tabs, message, Row, Col, Typography, Skeleton, Divider, Empty, Pagination } from 'antd';
import { FilePdfOutlined } from '@ant-design/icons';
......
import React, { useContext } from 'react';
import { Row, Col, Image, Table, Tooltip, Switch, Typography } from 'antd';
import Card from '../../../card';
import Card from '../../../Card';
import { Context } from '../context';
import style from './index.less';
import { QuestionCircleOutlined } from '@ant-design/icons';
......
import React, { useRef, useState } from 'react';
import { StandardTable } from 'god';
import Card from '../../../card';
import Card from '../../../Card';
import EyePreview from '@/components/EyePreview';
import DetailDrawer from '../../../detailDrawer';
......
/** 详情通用 - 基本信息 */
import React from 'react';
import { Row, Col } from 'antd';
import Card from '../../../card';
import Card from '../../../Card';
import style from './index.less';
export interface OtherInfoProps {
......
/** 详情通用 - 流转进度 */
import React, { useEffect, useState } from 'react';
import { Radio, Steps } from 'antd';
import Card from '../../../card';
import Card from '../../../Card';
export interface ProgressProps {
......
......@@ -2,7 +2,7 @@
import React, { useContext, useState } from 'react';
import { Radio, Steps } from 'antd';
import { Context } from '../context';
import Card from '../../../card';
import Card from '../../../Card';
import style from './index.less';
const LOGSTATESTYPE = {
......
......@@ -4,7 +4,7 @@ import { StandardTable } from 'god';
import StatusTag from '@/components/StatusTag';
import Card from '../../../card';
import Card from '../../../Card';
import { Context } from '../context';
import style from './index.less';
import { QuestionCircleOutlined } from '@ant-design/icons';
......
......@@ -8,7 +8,7 @@ import { formatTimeString } from '@/utils'
import { Context } from '../context';
import Card from '../../../card';
import Card from '../../../Card';
const LOGSTATESTYPE = {
/** 外部流转 */
......
......@@ -2,7 +2,7 @@
import React, { useContext, useState } from 'react';
import { Radio, Table } from 'antd';
import { Context } from '../context';
import Card from '../../../card';
import Card from '../../../Card';
import {
EXTERNALLOGS,
INTERNALLOGS,
......
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