Commit 81c8a0ce authored by XieZhiXiong's avatar XieZhiXiong

chore: 替换 锚点项 组件

parent dacd052c
......@@ -6,10 +6,10 @@
* @Description: 适用品牌列表
*/
import React from 'react';
import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import MellowCard from '@/components/MellowCard';
import ApplicableList, { ApplicableListProps } from '../ApplicableList';
export interface IProps extends Pick<ApplicableListProps, 'options' | 'value'>, MellowCardProps {}
export interface IProps extends Pick<ApplicableListProps, 'options' | 'value'> {}
const ApplicableCategories: React.FC<IProps> = (props) => {
const {
......
......@@ -6,10 +6,10 @@
* @Description: 适用品类列表
*/
import React from 'react';
import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import MellowCard from '@/components/MellowCard';
import ApplicableList, { ApplicableListProps } from '../ApplicableList';
export interface IProps extends Pick<ApplicableListProps, 'options' | 'value'>, MellowCardProps {}
export interface IProps extends Pick<ApplicableListProps, 'options' | 'value'> {}
const ApplicableCategories: React.FC<IProps> = (props) => {
const {
......
......@@ -6,7 +6,7 @@
* @Description: 适用商品
*/
import React from 'react';
import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import MellowCard from '@/components/MellowCard';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import { normalizeUnitPrice } from '../../utils';
......@@ -49,7 +49,7 @@ export type ListItemDataType = {
},
}
interface IProps extends MellowCardProps {
interface IProps {
/**
* 数据
*/
......
......@@ -10,7 +10,7 @@ import {
SchemaForm,
SchemaMarkupField as Field,
} from '@formily/antd';
import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import MellowCard from '@/components/MellowCard';
import TofuCheckGroup from '../FormilyFieldItem/TofuCheckGroup';
import MemberCheckboxGroup from '../FormilyFieldItem/MemberCheckboxGroup';
import { OptionItemType as MemberOptionItemType } from '../MemberCheckboxGroup';
......@@ -28,7 +28,7 @@ export type SuitableMemberType = {
name: string,
}
interface IProps extends MellowCardProps {
interface IProps {
/**
* 适用会员信息
*/
......
......@@ -6,10 +6,10 @@
* @Description: 适用商城列表
*/
import React from 'react';
import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import MellowCard from '@/components/MellowCard';
import ApplicableList, { ApplicableListProps } from '../ApplicableList';
export interface IProps extends Pick<ApplicableListProps, 'options' | 'value'>, MellowCardProps {}
export interface IProps extends Pick<ApplicableListProps, 'options' | 'value'> {}
const ApplicableShopList: React.FC<IProps> = (props) => {
const {
......
......@@ -208,7 +208,7 @@ const MerchantCouponDetail: React.FC<IProps> = (props) => {
key: 'innerFlowRecords',
name: '单据流转记录',
},
].filter(Boolean);
].filter(Boolean) as any;
const categories = useMemo(() => {
return normalizeCategoryList(dataSource?.suitableCategoryList!);
......@@ -232,60 +232,64 @@ const MerchantCouponDetail: React.FC<IProps> = (props) => {
<Row gutter={[16, 16]}>
{/* 流转记录 */}
<Col span={24}>
<AuditProcess
innerVerifySteps={dataSource?.taskSteps.map((item) => ({
step: item.step,
stepName: item.taskName,
roleName: item.roleName,
status: item.isExecute ? 'finish' : 'wait',
}))}
innerVerifyCurrent={findLastIndexFlowState(dataSource?.taskSteps)}
id="verifySteps"
/>
<AnchorPage.Item itemKey="verifySteps">
<AuditProcess
innerVerifySteps={dataSource?.taskSteps.map((item) => ({
step: item.step,
stepName: item.taskName,
roleName: item.roleName,
status: item.isExecute ? 'finish' : 'wait',
}))}
innerVerifyCurrent={findLastIndexFlowState(dataSource?.taskSteps)}
/>
</AnchorPage.Item>
</Col>
{/* 基本信息 */}
<Col span={24}>
<BacisInfo
dataSource={{
id: dataSource?.id,
type: dataSource?.type,
typeName: dataSource?.typeName,
releaseTimeStart: dataSource?.releaseTimeStart,
releaseTimeEnd: dataSource?.releaseTimeEnd,
name: dataSource?.name,
denomination: dataSource?.denomination,
statusName: dataSource?.statusName,
quantity: dataSource?.quantity,
}}
id="basicInfo"
/>
<AnchorPage.Item itemKey="basicInfo">
<BacisInfo
dataSource={{
id: dataSource?.id,
type: dataSource?.type,
typeName: dataSource?.typeName,
releaseTimeStart: dataSource?.releaseTimeStart,
releaseTimeEnd: dataSource?.releaseTimeEnd,
name: dataSource?.name,
denomination: dataSource?.denomination,
statusName: dataSource?.statusName,
quantity: dataSource?.quantity,
}}
/>
</AnchorPage.Item>
</Col>
{/* 优惠券规则 */}
<Col span={24}>
<CouponRules
dataSource={{
getWay: dataSource?.getWay,
getWayName: dataSource?.getWayName,
effectiveTimeStart: dataSource?.effectiveTimeStart,
effectiveTimeEnd: dataSource?.effectiveTimeEnd,
invalidDay: dataSource?.invalidDay,
useConditionMoney: dataSource?.useConditionMoney,
useConditionDesc: dataSource?.useConditionDesc,
conditionGetDay: dataSource?.conditionGetDay as number,
conditionGetTotal: dataSource?.conditionGetTotal as number,
}}
id="couponRules"
/>
<AnchorPage.Item itemKey="couponRules">
<CouponRules
dataSource={{
getWay: dataSource?.getWay,
getWayName: dataSource?.getWayName,
effectiveTimeStart: dataSource?.effectiveTimeStart,
effectiveTimeEnd: dataSource?.effectiveTimeEnd,
invalidDay: dataSource?.invalidDay,
useConditionMoney: dataSource?.useConditionMoney,
useConditionDesc: dataSource?.useConditionDesc,
conditionGetDay: dataSource?.conditionGetDay as number,
conditionGetTotal: dataSource?.conditionGetTotal as number,
}}
/>
</AnchorPage.Item>
</Col>
{/* 适用商城 */}
<Col span={24}>
<ApplicableShopList
options={shopList}
id="applicableShopList"
/>
<AnchorPage.Item itemKey="applicableShopList">
<ApplicableShopList
options={shopList}
/>
</AnchorPage.Item>
</Col>
{/* 适用商品 */}
......@@ -295,10 +299,11 @@ const MerchantCouponDetail: React.FC<IProps> = (props) => {
|| dataSource?.type === MERCHANT_COUPON_TYPE_VOUCHER
? (
<Col span={24}>
<ApplicableGoods
dataSource={dataSource?.suitableCommoditySkuList!}
id="applicableGoods"
/>
<AnchorPage.Item itemKey="applicableGoods">
<ApplicableGoods
dataSource={dataSource?.suitableCommoditySkuList!}
/>
</AnchorPage.Item>
</Col>
)
: null
......@@ -311,10 +316,11 @@ const MerchantCouponDetail: React.FC<IProps> = (props) => {
dataSource?.type === MERCHANT_COUPON_TYPE_CATEGORY
? (
<Col span={24}>
<ApplicableCategories
options={categories}
id="applicableCategories"
/>
<AnchorPage.Item itemKey="applicableCategories">
<ApplicableCategories
options={categories}
/>
</AnchorPage.Item>
</Col>
)
: null
......@@ -327,10 +333,11 @@ const MerchantCouponDetail: React.FC<IProps> = (props) => {
dataSource?.type === MERCHANT_COUPON_TYPE_BRAND
? (
<Col span={24}>
<ApplicableBrands
options={brandList}
id="applicableBrands"
/>
<AnchorPage.Item itemKey="applicableBrands">
<ApplicableBrands
options={brandList}
/>
</AnchorPage.Item>
</Col>
)
: null
......@@ -339,22 +346,24 @@ const MerchantCouponDetail: React.FC<IProps> = (props) => {
{/* 适用用户 */}
<Col span={24}>
<ApplicableMember
applicableMember={{
suitableMemberTypes: dataSource?.suitableMemberTypes,
memberTypes: dataSource?.memberTypes,
applicationMemberLevel: dataSource?.suitableMemberLevelTypes!.map(({ roleTypeName, memberLevelTypeName, ...rest }) => ({ roleName: roleTypeName, levelTypeName: memberLevelTypeName, ...rest })),
}}
id="applicableMember"
/>
<AnchorPage.Item itemKey="applicableMember">
<ApplicableMember
applicableMember={{
suitableMemberTypes: dataSource?.suitableMemberTypes,
memberTypes: dataSource?.memberTypes,
applicationMemberLevel: dataSource?.suitableMemberLevelTypes!.map(({ roleTypeName, memberLevelTypeName, ...rest }) => ({ roleName: roleTypeName, levelTypeName: memberLevelTypeName, ...rest })),
}}
/>
</AnchorPage.Item>
</Col>
{/* 流转记录 */}
<Col span={24}>
<InnerFlowRecords
dataSource={dataSource?.history.map((item, index) => ({ ...item, id: index }))}
id="innerFlowRecords"
/>
<AnchorPage.Item itemKey="innerFlowRecords">
<InnerFlowRecords
dataSource={dataSource?.history.map((item, index) => ({ ...item, id: index }))}
/>
</AnchorPage.Item>
</Col>
</Row>
</AnchorPage>
......
......@@ -21,7 +21,7 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import MellowCard from '@/components/MellowCard';
import PolymericTable, { FetchParamsType } from '@/components/PolymericTable';
import { querySchema, drawerSchema } from './schema';
import { postMemberManagePlatformMarketingSuitablePage, postMemberManagePlatformMarketingSuitablePageItems } from '@/services/MemberV2Api';
......@@ -84,7 +84,7 @@ type MemberListItemType = {
roleId: number,
}
interface IProps extends Omit<MellowCardProps, 'onChange'> {
interface IProps {
/**
* 适用会员等级类型
*/
......
......@@ -5,7 +5,7 @@
* @LastEditTime: 2021-09-26 14:54:19
* @Description: 内部流转记录
*/
import React, { HTMLAttributes } from 'react';
import React from 'react';
import { Badge } from 'antd';
import moment from 'moment';
import FlowRecords from '@/components/FlowRecords';
......@@ -50,7 +50,7 @@ export type FlowItem = {
remark: string
}
export interface IProps extends HTMLAttributes<HTMLDivElement> {
export interface IProps {
/**
* 数据源
*/
......
......@@ -14,7 +14,7 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import NiceForm from '@/components/NiceForm';
import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import MellowCard from '@/components/MellowCard';
import { querySchema } from './schema';
import moment from 'moment';
import {
......@@ -113,7 +113,7 @@ export type FetchExtraParams = {
shopId: number,
}
interface IProps extends MellowCardProps {
interface IProps {
/**
* 优惠券id
*/
......
......@@ -114,48 +114,51 @@ const PlatformCouponAnalysisDeliver: React.FC<{}> = () => {
<Row gutter={[16, 16]}>
{/* 基本信息 */}
<Col span={24}>
<BacisInfo
dataSource={{
id: couponInfo?.id as number,
type: couponInfo?.type as number,
typeName: couponInfo?.typeName as string,
releaseTimeStart: couponInfo?.releaseTimeStart as number,
releaseTimeEnd: couponInfo?.releaseTimeEnd as number,
name: couponInfo?.name as string,
denomination: couponInfo?.denomination as number,
statusName: couponInfo?.statusName as string,
quantity: couponInfo?.quantity as number,
}}
id="basicInfo"
/>
<AnchorPage.Item itemKey="basicInfo">
<BacisInfo
dataSource={{
id: couponInfo?.id as number,
type: couponInfo?.type as number,
typeName: couponInfo?.typeName as string,
releaseTimeStart: couponInfo?.releaseTimeStart as number,
releaseTimeEnd: couponInfo?.releaseTimeEnd as number,
name: couponInfo?.name as string,
denomination: couponInfo?.denomination as number,
statusName: couponInfo?.statusName as string,
quantity: couponInfo?.quantity as number,
}}
/>
</AnchorPage.Item>
</Col>
{/* 优惠券规则 */}
<Col span={24}>
<CouponRules
dataSource={{
getWay: couponInfo?.getWay as number,
getWayName: couponInfo?.getWayName as string,
effectiveTimeStart: couponInfo?.effectiveTimeStart as number,
effectiveTimeEnd: couponInfo?.effectiveTimeEnd as number,
invalidDay: couponInfo?.invalidDay as number,
useConditionMoney: couponInfo?.useConditionMoney as number,
useConditionDesc: couponInfo?.useConditionDesc as string,
conditionGetDay: couponInfo?.conditionGetDay as number,
conditionGetTotal: couponInfo?.conditionGetTotal as number,
}}
id="couponRules"
/>
<AnchorPage.Item itemKey="couponRules">
<CouponRules
dataSource={{
getWay: couponInfo?.getWay as number,
getWayName: couponInfo?.getWayName as string,
effectiveTimeStart: couponInfo?.effectiveTimeStart as number,
effectiveTimeEnd: couponInfo?.effectiveTimeEnd as number,
invalidDay: couponInfo?.invalidDay as number,
useConditionMoney: couponInfo?.useConditionMoney as number,
useConditionDesc: couponInfo?.useConditionDesc as string,
conditionGetDay: couponInfo?.conditionGetDay as number,
conditionGetTotal: couponInfo?.conditionGetTotal as number,
}}
/>
</AnchorPage.Item>
</Col>
{/* 发券明细 */}
<Col span={24}>
<DeliverCoupon
memberList={couponInfo?.memberList as []}
suitableMemberLevelTypes={couponInfo?.suitableMemberLevelTypes as []}
onChange={handleDeliverChange}
id="deliverCoupon"
/>
<AnchorPage.Item itemKey="deliverCoupon">
<DeliverCoupon
memberList={couponInfo?.memberList as []}
suitableMemberLevelTypes={couponInfo?.suitableMemberLevelTypes as []}
onChange={handleDeliverChange}
/>
</AnchorPage.Item>
</Col>
</Row>
</AnchorPage>
......
......@@ -73,60 +73,64 @@ const PlatformCouponAnalysisDetail: React.FC<{}> = () => {
<Row gutter={[16, 16]}>
{/* 流转记录 */}
<Col span={24}>
<AuditProcess
innerVerifySteps={couponInfo?.taskSteps.map((item) => ({
step: item.step,
stepName: item.taskName,
roleName: item.roleName,
status: item.isExecute ? 'finish' : 'wait',
}))}
innerVerifyCurrent={findLastIndexFlowState(couponInfo?.taskSteps as [])}
id="verifySteps"
/>
<AnchorPage.Item itemKey="verifySteps">
<AuditProcess
innerVerifySteps={couponInfo?.taskSteps.map((item) => ({
step: item.step,
stepName: item.taskName,
roleName: item.roleName,
status: item.isExecute ? 'finish' : 'wait',
}))}
innerVerifyCurrent={findLastIndexFlowState(couponInfo?.taskSteps as [])}
/>
</AnchorPage.Item>
</Col>
{/* 基本信息 */}
<Col span={24}>
<BacisInfo
dataSource={{
id: couponInfo?.id as number,
type: couponInfo?.type as number,
typeName: couponInfo?.typeName as string,
releaseTimeStart: couponInfo?.releaseTimeStart as number,
releaseTimeEnd: couponInfo?.releaseTimeEnd as number,
name: couponInfo?.name as string,
denomination: couponInfo?.denomination as number,
statusName: couponInfo?.statusName as string,
quantity: couponInfo?.quantity as number,
}}
id="basicInfo"
/>
<AnchorPage.Item itemKey="basicInfo">
<BacisInfo
dataSource={{
id: couponInfo?.id as number,
type: couponInfo?.type as number,
typeName: couponInfo?.typeName as string,
releaseTimeStart: couponInfo?.releaseTimeStart as number,
releaseTimeEnd: couponInfo?.releaseTimeEnd as number,
name: couponInfo?.name as string,
denomination: couponInfo?.denomination as number,
statusName: couponInfo?.statusName as string,
quantity: couponInfo?.quantity as number,
}}
/>
</AnchorPage.Item>
</Col>
{/* 优惠券规则 */}
<Col span={24}>
<CouponRules
dataSource={{
getWay: couponInfo?.getWay as number,
getWayName: couponInfo?.getWayName as string,
effectiveTimeStart: couponInfo?.effectiveTimeStart as number,
effectiveTimeEnd: couponInfo?.effectiveTimeEnd as number,
invalidDay: couponInfo?.invalidDay as number,
useConditionMoney: couponInfo?.useConditionMoney as number,
useConditionDesc: couponInfo?.useConditionDesc as string,
conditionGetDay: couponInfo?.conditionGetDay as number,
conditionGetTotal: couponInfo?.conditionGetTotal as number,
}}
id="couponRules"
/>
<AnchorPage.Item itemKey="couponRules">
<CouponRules
dataSource={{
getWay: couponInfo?.getWay as number,
getWayName: couponInfo?.getWayName as string,
effectiveTimeStart: couponInfo?.effectiveTimeStart as number,
effectiveTimeEnd: couponInfo?.effectiveTimeEnd as number,
invalidDay: couponInfo?.invalidDay as number,
useConditionMoney: couponInfo?.useConditionMoney as number,
useConditionDesc: couponInfo?.useConditionDesc as string,
conditionGetDay: couponInfo?.conditionGetDay as number,
conditionGetTotal: couponInfo?.conditionGetTotal as number,
}}
/>
</AnchorPage.Item>
</Col>
{/* 优惠券规则 */}
<Col span={24}>
<RunningInfo
couponId={+id}
id="runningInfo"
/>
<AnchorPage.Item itemKey="runningInfo">
<RunningInfo
couponId={+id}
/>
</AnchorPage.Item>
</Col>
</Row>
</AnchorPage>
......
......@@ -240,7 +240,7 @@ const CouponForm: React.FC<IProps> = (props) => {
key: 'applicableMember',
name: '适用用户',
},
].filter(Boolean);
].filter(Boolean) as any;
// 删除商品项
const handleRemoveItem = (index: number) => {
......
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