Commit 695cbc51 authored by 前端-许佳敏's avatar 前端-许佳敏

Merge branch 'v2-220418' of…

Merge branch 'v2-220418' of ssh://gitlab.shushangyun.com:8122/linkseeks-design/pro-platform into v2-220418
parents 88220af9 235e1f21
......@@ -50,8 +50,8 @@ const commonColumns = [
{
title: `${intl.formatMessage({ id: 'member.memberEvaluate.hooks.useEvaluateColumn.innerState'})}`,
dataIndex: 'status',
filters: [],
onFilter: (_value, record) => record.status === _value,
// filters: [],
// onFilter: (_value, record) => record.status === _value,
render: (text, record) => {
const offset = record.status % (TYPE.length)
return (
......@@ -128,7 +128,7 @@ function useEvaluateColumn<T extends { [key: string]: any } = any>(defaultColumn
keys.forEach((_item: "status") => {
map[_item] = mapKeys[_item].map((_row) => ({ text: _row.label, ..._row }))
})
setColumnsWithFilterOption(map)
// setColumnsWithFilterOption(map)
}, [statusOptions])
return {columns, fetchStatusOptions}
......
......@@ -132,6 +132,7 @@ const MemberForm: React.FC<MemberFormProps> = ({
outerStatusName,
roleName,
verifySteps,
level,
...rest
} = infoRes.data;
// 注册资料处理
......@@ -192,6 +193,7 @@ const MemberForm: React.FC<MemberFormProps> = ({
areas: areaCodes,
channelLevel: channelLevelTag,
upperRelationId: upperMemberId,
level: level || undefined,
...detail,
});
......@@ -474,6 +476,7 @@ const MemberForm: React.FC<MemberFormProps> = ({
if (res.code === 1000) {
const { data = [] } = res;
const options = data.map(item => ({ label: item.levelTag, value: item.level })).filter((item) => item.value);
console.log('optionsoptionsoptions', options)
linkage.enum('level', options);
}
}).catch((err) => {
......
......@@ -127,7 +127,7 @@ const MemberQuery: React.FC<{}> = () => {
{/* 渠道会员, 且外部审核状态为不通过才可以 变更信息 */}
{
record.showModify && (
<AuthButton btnCode='profile.update' >
<AuthButton btnCode='profile.change' >
<Button
type="link"
onClick={() => handleJumpChangeDeposit(record)}
......
......@@ -43,7 +43,7 @@ const listColumns: ColumnsType<GetMemberRectifySummaryPageResponseDetail> = [
const offset = record.outerStatus % OuterStatusType.length;
return <StatusTag type={OuterStatusType[offset] as 'success'} title={record.outerStatusName} />
},
onFilter: (value, record) => { return record.outerStatus === value },
// onFilter: (value, record) => { return record.outerStatus === value },
}
]
......
......@@ -61,7 +61,7 @@ export default function useColumns<T>(columnsList: ColumnsType<T>, actionColumn?
keys.forEach((_item: keyof typeof mapKeys) => {
map[_item] = mapKeys[_item].map((_row) => ({ text: _row.label, ..._row }))
})
setColumnsWithFilterOption(map)
// setColumnsWithFilterOption(map)
}, [statusOptions])
......
......@@ -68,17 +68,6 @@ export const rectificationListSchema: ISchema = {
},
},
},
outerStatus: {
type: 'string',
enum: [],
'x-component-props': {
placeholder: `${intl.formatMessage({ id: 'member.memberRectification.common.columns.queryColumns.outState'})}`,
allowClear: true,
style: {
width: 160,
},
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
......
......@@ -39,7 +39,7 @@ const List: React.FC<Iprops> = (props: Iprops) => {
<Card>
<CustomizeQueryList
columns={columns}
schema={querySchema}
schema={querySchema(true)}
fetchListData={handleFetch}
expressionScope={{
controllerBtns,
......
......@@ -56,7 +56,7 @@ const List: React.FC<Iprops> = (props: Iprops) => {
<Card>
<CustomizeQueryList
columns={columns}
schema={querySchema}
schema={querySchema(false)}
fetchListData={handleFetch}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'name', FORM_FILTER_PATH,);
......
......@@ -77,77 +77,87 @@ export default confirmEditResultSchema
/**
* 会员考评页scheam
* @param visibleOuterStatus 是否可见外部状态
* @returns
*/
export const querySchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: `${intl.formatMessage({ id: 'member.memberInspection.common.schema.add.searchMemberName'})}`,
align: 'flex-left',
tip: `${intl.formatMessage({ id: 'member.memberEvaluate.allQuery.schema.searchForMemberName'})}`,
},
export const querySchema: (visibleOuterStatus: boolean) => ISchema = (visibleOuterStatus) => {
const extraProperties = {
subject: {
type: 'string',
'x-component-props': {
placeholder: `${intl.formatMessage({ id: 'member.memberRectification.common.hooks.useGetDetailCommon.rectifyTopic'})}`,
allowClear: true,
style: {
width: 160,
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 6,
},
properties: {
subject: {
type: 'string',
'x-component-props': {
placeholder: `${intl.formatMessage({ id: 'member.memberRectification.common.hooks.useGetDetailCommon.rectifyTopic'})}`,
allowClear: true,
style: {
width: 160,
},
},
},
'[rectifyDayStart,rectifyDayEnd]': {
type: 'daterange',
'x-component-props': {
placeholder: [`${intl.formatMessage({ id: 'member.memberRectification.common.schema.index.rectifyBeginTime'})}`, `${intl.formatMessage({ id: 'member.memberRectification.tobeConfirmRectification.schema.rectifyCompleteTime'})}`],
allowClear: true,
style: {
width: 240,
},
},
},
outerStatus: {
type: 'string',
enum: [],
'x-component-props': {
placeholder: `${intl.formatMessage({ id: 'member.memberRectification.common.columns.queryColumns.outState'})}`,
allowClear: true,
style: {
width: 160,
},
},
},
},
'[rectifyDayStart,rectifyDayEnd]': {
type: 'daterange',
'x-component-props': {
placeholder: [`${intl.formatMessage({ id: 'member.memberRectification.common.schema.index.rectifyBeginTime'})}`, `${intl.formatMessage({ id: 'member.memberRectification.tobeConfirmRectification.schema.rectifyCompleteTime'})}`],
allowClear: true,
style: {
width: 240,
},
},
},
outerStatus: {
type: 'string',
enum: [],
'x-component-props': {
placeholder: `${intl.formatMessage({ id: 'member.memberRectification.common.columns.queryColumns.outState'})}`,
allowClear: true,
style: {
width: 160,
},
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: `${intl.formatMessage({ id: 'member.memberInspection.common.schema.add.query'})}`,
},
},
};
if (!visibleOuterStatus) {
delete extraProperties.outerStatus;
}
return {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: `${intl.formatMessage({ id: 'member.memberInspection.common.schema.add.searchMemberName'})}`,
align: 'flex-left',
tip: `${intl.formatMessage({ id: 'member.memberEvaluate.allQuery.schema.searchForMemberName'})}`,
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: `${intl.formatMessage({ id: 'member.memberInspection.common.schema.add.query'})}`,
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 6,
},
properties: extraProperties,
},
},
},
},
},
}
};
......@@ -9,7 +9,7 @@ import {
BaseInfo, BuyerLabel, ConsigneeTimeLabel, DeliveryAbstractLabel, DeliveryDate,
DeliveryGood, DeliveryInfo, DeliveryNameLabel, DeliveryPanleNoLabel, DeliveryPhoneLabel, DeliverySlefAddrLabel, DeliveryTime,
DeliveryTimeLabel, DeliveryTypeLabel, Distribution, LogisticsCarNoLabel,
LogisticsCompanyLabel, LogisticsInfo, LogisticsNoLabel, NoteLabel, ReceivingAddress as ReceivingAddressLabel
LogisticsCompanyLabel, LogisticsInfo, LogisticsNoLabel, Material, NoteLabel, ReceivingAddress as ReceivingAddressLabel
} from '../../constants'
import { BaseInfo as ContentBox } from '@/components/BaseInfo'
import { Input, Table, Radio, Form, Button, Modal } from 'antd';
......@@ -32,6 +32,8 @@ import { ShipperAddress, ReceiverAddress } from '@/components/AddressDrawer'
import { checkRegExp } from '@/utils/regExp';
import { PATTERN_MAPS } from '@/constants/regExp';
import usePrompt from '@/hooks/usePrompt';
import { useAnchor } from '@/utils/hooks';
import { RoleTypeEnum } from '../../constants/RoleTypeEnum';
const DeliveryNoticeManageSRMDetails: React.FC = () => {
......@@ -46,12 +48,11 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
const service = DeliveryAddFactory.getInstance(Number(ot));
service.setForm(form)
const [anchors, setAnchors] = useState<AnchorsItem[]>([
const { anchors, update, delUpdate } = useAnchor([
BaseInfo,
Distribution,
DeliveryInfo,
LogisticsInfo,
DeliveryGood,
])
useEffect(() => {
......@@ -63,6 +64,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
let formFeils = service.formatField(data)
setTableDataSource(data.products)
handleAnchor(data?.products?.length)
form.setFieldsValue({
sourceType: SourceTypeEnum.PlanAdd,
......@@ -89,7 +91,31 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
}, [form, tableDataSource])
const handleAnchor = (len) => {
update([
ot === RoleTypeEnum.B2B ? {
...DeliveryGood,
name: `${DeliveryGood.name}(${len})`
} :
{
...Material,
name: `${Material.name}(${len})`
}
])
}
const handleDelAnchor = (len) => {
delUpdate([
ot === RoleTypeEnum.B2B ? {
...DeliveryGood,
name: `${DeliveryGood.name}(${len})`
} :
{
...Material,
name: `${Material.name}(${len})`
}
])
}
return (
<AnchorPage title="送货单管理新增"
......@@ -124,7 +150,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
</FormItem>
<FormItem label={NoteLabel} name="remark">
<Input />
<Input maxLength={150} placeholder="150个汉字" />
</FormItem>
<FormItem
......@@ -154,9 +180,6 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
</FormItem>
<FormItem
rules={[
required(`${DeliveryNameLabel}不能为空`)
]}
label={DeliveryNameLabel} name="executorVO.consignee">
<Input />
</FormItem>
......@@ -171,7 +194,6 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<FormItem
rules={[
required(`${DeliveryPhoneLabel}不能为空`),
{ pattern: PATTERN_MAPS.phone, message: "手机号是否正确" }
]}
label={DeliveryPhoneLabel} name="executorVO.phone">
......@@ -191,9 +213,9 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
</FormItem>
<FormItem
rules={[
required(`${ReceivingAddressLabel}不能为空`)
]}
// rules={[
// required(`${ReceivingAddressLabel}不能为空`)
// ]}
label={ReceivingAddressLabel} name="receiveVO">
<ReceiverAddress />
......
......@@ -2,7 +2,7 @@ import AnchorPage, { AnchorsItem } from "@/components/AnchorPage";
import { Button, Form, Input, message, Radio, Table } from "antd";
import { useCallback, useEffect, useState } from "react";
import { DeliveryNoticeOrderAddService } from "../../assets/handles/HandleFormSubmit";
import { BillsInfo, BuyerLabel, ConsigneeTimeLabel, DeliveryAbstractLabel, DeliveryAbstractNoLabel, DeliveryDateLabel, DeliveryGood, DeliveryInfo, DeliveryNameLabel, DeliveryPhoneLabel, DeliverySlefAddrLabel, DeliveryTimeLabel, DeliveryTypeLabel, Distribution, LogisticsCarNoLabel, LogisticsCompanyLabel, LogisticsInfo, LogisticsNoLabel, NoteLabel, ReceivingAddress } from "../../constants";
import { BillsInfo, BuyerLabel, ConsigneeTimeLabel, DeliveryAbstractLabel, DeliveryAbstractNoLabel, DeliveryDate, DeliveryDateLabel, DeliveryGood, DeliveryInfo, DeliveryNameLabel, DeliveryNoLabel, DeliveryPanleNoLabel, DeliveryPhoneLabel, DeliverySlefAddrLabel, DeliveryTimeLabel, DeliveryTypeLabel, Distribution, LogisticsCarNoLabel, LogisticsCompanyLabel, LogisticsInfo, LogisticsNoLabel, Material, NoteLabel, ReceivingAddress, ReceivingTime } from "../../constants";
import { BaseInfo } from '@/components/BaseInfo';
import { required, FormItem } from "@/components/FormItem";
import { RoleSelect } from "@/components/RoleSelect";
......@@ -17,6 +17,7 @@ import { useLocation } from "umi";
import AuthButton from "@/components/AuthButton";
import { RoleTypeEnum } from "../../constants/RoleTypeEnum";
import usePrompt from "@/hooks/usePrompt";
import { useAnchor } from "@/utils/hooks";
const ContentBox = BaseInfo
const service = new DeliveryNoticeOrderAddService();
......@@ -32,12 +33,11 @@ function DeliveryNoticeFromCreate() {
const location: any = useLocation()
const { id } = location.query
const [anchors, setAnchors] = useState<AnchorsItem[]>([
const { anchors, update, delUpdate } = useAnchor([
BillsInfo,
Distribution,
DeliveryInfo,
LogisticsInfo,
DeliveryGood,
])
useEffect(() => {
......@@ -56,13 +56,40 @@ function DeliveryNoticeFromCreate() {
setType(type);
form.setFieldsValue(res)
console.log(res.products);
handleAnchor(res.products.length)
setTableDataSource(res.products)
})
}, [])
const handleAnchor = (len) => {
update([
type === RoleTypeEnum.B2B ? {
...DeliveryGood,
name: `${DeliveryGood.name}(${len})`
} :
{
...Material,
name: `${Material.name}(${len})`
}
])
}
const handleDelAnchor = (len) => {
delUpdate([
type === RoleTypeEnum.B2B ? {
...DeliveryGood,
name: `${DeliveryGood.name}(${len})`
} :
{
...Material,
name: `${Material.name}(${len})`
}
])
}
const handleSubmit = useCallback(() => {
service.getForomService().setTableData(tableDataSource);
service.getForomService().submit().then(res => {
......@@ -75,7 +102,8 @@ function DeliveryNoticeFromCreate() {
const handleRemoveMaterialTableRow = (i: number) => {
const source: any[] = tableDataSource;
const newSource = source.splice(i, 0)
const newSource = source.splice(i, 0);
handleDelAnchor(newSource.length);
setTableDataSource(newSource);
}
......@@ -103,7 +131,7 @@ function DeliveryNoticeFromCreate() {
rules={[
required()
]}
label={DeliveryAbstractNoLabel} name="sourceNo">
label={DeliveryNoLabel} name="sourceNo">
<Input />
</FormItem>
......@@ -116,7 +144,7 @@ function DeliveryNoticeFromCreate() {
</FormItem>
<FormItem label={NoteLabel} name="remark">
<Input />
<Input placeholder="最长100字符,50个汉字" />
</FormItem>
<FormItem
......@@ -143,14 +171,11 @@ function DeliveryNoticeFromCreate() {
rules={[
required()
]}
label={DeliveryDateLabel} name="deliveryTime">
label={DeliveryDate} name="deliveryTime">
<DatePickerSelect disabled={true} className='w-full' />
</FormItem>
<FormItem
rules={[
required()
]}
label={DeliveryNameLabel} name="executorVO.consignee">
<Input />
</FormItem>
......@@ -164,9 +189,6 @@ function DeliveryNoticeFromCreate() {
</FormItem>
<FormItem
rules={[
required()
]}
label={DeliveryPhoneLabel} name="executorVO.phone">
<Input />
</FormItem>
......@@ -185,9 +207,6 @@ function DeliveryNoticeFromCreate() {
</FormItem>
<FormItem
rules={[
required()
]}
label={ReceivingAddress} name="receiveVO">
<ReceiverAddress
......@@ -217,7 +236,7 @@ function DeliveryNoticeFromCreate() {
<FormItem
rules={[
required()
required(`请选择${DeliveryTypeLabel}`)
]}
label={DeliveryTypeLabel} name="deliveryType">
<Radio.Group onChange={(e) => {
......@@ -259,17 +278,19 @@ function DeliveryNoticeFromCreate() {
value={rcode[OrderNumColumn.key]}
index={index}
keyup="deliveryCount"
disabled={true}
/>
)
}
}, {
title: "操作",
render: (t, r, i) => {
return (
<Button type='link' onClick={() => handleRemoveMaterialTableRow(i)}>删除</Button>
)
}
}
// , {
// title: "操作",
// render: (t, r, i) => {
// return (
// <Button type='link' onClick={() => handleRemoveMaterialTableRow(i)}>删除</Button>
// )
// }
// }
]}
dataSource={tableDataSource}
/>
......
......@@ -18,7 +18,7 @@ const service = ReceiveNoteFacotry.getInstance()
const DeliveryNoteManageDetails: React.FC = () => {
const anchors = DeliveryNoteQuery
const [anchors, setAnchors] = useState(DeliveryNoteQuery)
const [info, setInfo] = useState<any>({})
const [tableDataSource, setTableDataSource] = useState([])
......@@ -26,6 +26,8 @@ const DeliveryNoteManageDetails: React.FC = () => {
const { id } = (location as any).query
const [loading, setLoading] = useState(true)
const [outerHistoryList, setOuterHistoryList] = useState([])
useEffect(() => {
Promise.all([
......@@ -33,8 +35,24 @@ const DeliveryNoteManageDetails: React.FC = () => {
service.getDetailProduct({ id, current: 1 })
]).then((values) => {
setInfo(values[0])
setOuterHistoryList(values[0].outerHistoryList)
setTableDataSource(values[1].data)
setLoading(false)
setAnchors([
...anchors,
{
...Material,
...{
name: `${Material.name}(${values[1].totalCount})`
}
},
{
...ExternalRoamRecord,
...{
name: `${ExternalRoamRecord.name}(${values[0].outerHistoryList.length})`
}
}
])
})
}, [])
......@@ -127,7 +145,7 @@ const DeliveryNoteManageDetails: React.FC = () => {
<ListInfoItem label='物流单号'>
{info?.logisticsNo ?? '-'}
</ListInfoItem>
</ListInfo>
<ListInfo className='mt-15' title={Material.name} id={Material.key} cols={1}>
......@@ -157,6 +175,16 @@ const DeliveryNoteManageDetails: React.FC = () => {
/>
</ListInfo>
<ListInfo className='mt-15' title={ExternalRoamRecord.name} id={ExternalRoamRecord.key} cols={1}>
<Table
columns={[
...ExternalRoamRecordTableColumn,
]}
rowKey="id"
dataSource={outerHistoryList}
/>
</ListInfo>
</AnchorPage>
</Spin>
)
......
......@@ -45,14 +45,16 @@ const DeliveryNoteDetails: React.FC = () => {
name: `${Material.name}(${values[1].totalCount})`
}
},
// {
// ...ExternalRoamRecord,
// ...{
// name: `${ExternalRoamRecord.name}(${values[0].outerHistoryList.length})`
// }
// }
{
...ExternalRoamRecord,
...{
name: `${ExternalRoamRecord.name}(${values[0].outerHistoryList.length})`
}
}
])
setOuterHistoryList(values[0].outerHistoryList)
})
}, [])
......@@ -165,7 +167,7 @@ const DeliveryNoteDetails: React.FC = () => {
/>
</ListInfo>
{/* <ListInfo className='mt-15' title={ExternalRoamRecord.name} id={ExternalRoamRecord.key} cols={1}>
<ListInfo className='mt-15' title={ExternalRoamRecord.name} id={ExternalRoamRecord.key} cols={1}>
<Table
columns={[
...ExternalRoamRecordTableColumn,
......@@ -173,7 +175,7 @@ const DeliveryNoteDetails: React.FC = () => {
rowKey="id"
dataSource={outerHistoryList}
/>
</ListInfo> */}
</ListInfo>
</AnchorPage>
)
......
......@@ -50,8 +50,8 @@ const commonColumns = [
{
title: `${intl.formatMessage({ id: 'member.memberEvaluate.hooks.useEvaluateColumn.innerState'})}`,
dataIndex: 'status',
filters: [],
onFilter: (_value, record) => record.status === _value || _value===0,
// filters: [],
// onFilter: (_value, record) => record.status === _value || _value===0,
render: (text, record) => {
const offset = record.status % (TYPE.length)
return (
......@@ -128,7 +128,7 @@ function useEvaluateColumn<T extends { [key: string]: any } = any>(defaultColumn
keys.forEach((_item: "status") => {
map[_item] = mapKeys[_item].map((_row) => ({ text: _row.label, ..._row }))
})
setColumnsWithFilterOption(map)
// setColumnsWithFilterOption(map)
}, [statusOptions])
return {columns, fetchStatusOptions}
......
......@@ -132,6 +132,7 @@ const MemberForm: React.FC<MemberFormProps> = ({
outerStatusName,
roleName,
verifySteps,
level,
...rest
} = infoRes.data;
// 注册资料处理
......@@ -192,6 +193,7 @@ const MemberForm: React.FC<MemberFormProps> = ({
areas: areaCodes,
channelLevel: channelLevelTag,
upperRelationId: upperMemberId,
level: level || undefined,
...detail,
});
......
......@@ -127,7 +127,7 @@ const MemberQuery: React.FC<{}> = () => {
{/* 渠道会员, 且外部审核状态为不通过才可以 变更信息 */}
{
record.showModify && (
<AuthButton btnCode='profile.update' >
<AuthButton btnCode='profile.change' >
<Button
type="link"
onClick={() => handleJumpChangeDeposit(record)}
......
......@@ -61,7 +61,7 @@ export default function useColumns<T>(columnsList: ColumnsType<T>, actionColumn?
keys.forEach((_item: keyof typeof mapKeys) => {
map[_item] = mapKeys[_item].map((_row) => ({ text: _row.label, ..._row }))
})
setColumnsWithFilterOption(map)
// setColumnsWithFilterOption(map)
}, [statusOptions])
......
......@@ -106,56 +106,47 @@ const MerchantCouponQuery: React.FC = () => {
title: `${intl.formatMessage({ id: 'merchantCoupon.DealsCoupontype' })}`,
dataIndex: 'typeName',
align: 'center',
filters: [],
},
{
title: `${intl.formatMessage({ id: 'merchantCoupon.giveCouponStartTime' })}`,
dataIndex: 'releaseTimeStart',
align: 'center',
sorter: (a, b) => a.releaseTimeStart - b.releaseTimeStart,
render: (text) => text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '',
},
{
title: `${intl.formatMessage({ id: 'merchantCoupon.giveCouponEndTime' })}`,
dataIndex: 'releaseTimeEnd',
align: 'center',
sorter: (a, b) => a.releaseTimeEnd - b.releaseTimeEnd,
render: (text) => text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '',
},
{
title: `${intl.formatMessage({ id: 'merchantCoupon.effectiveTimeEnd' })}`,
dataIndex: 'effectiveTimeStart',
align: 'center',
sorter: (a, b) => a.effectiveTimeStart - b.effectiveTimeStart,
render: (text) => text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '-',
},
{
title: `${intl.formatMessage({ id: 'merchantCoupon.effectiveTimeEnd' })}`,
dataIndex: 'effectiveTimeEnd',
align: 'center',
sorter: (a, b) => a.effectiveTimeEnd - b.effectiveTimeEnd,
render: (text, record) => text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : `领取${record.invalidDay}天后失效`,
},
{
title: `${intl.formatMessage({ id: 'merchantCoupon.getWayName' })}`,
dataIndex: 'getWayName',
align: 'center',
filters: [],
},
{
title: `${intl.formatMessage({ id: 'merchantCoupon.denomination' })}`,
dataIndex: 'denomination',
sorter: (a, b) => a.denomination - b.denomination,
},
{
title: `${intl.formatMessage({ id: 'merchantCoupon.Quantity' })}`,
dataIndex: 'quantity',
sorter: (a, b) => a.quantity - b.quantity,
},
{
title: `${intl.formatMessage({ id: 'merchantCoupon.innerState' })}`,
dataIndex: 'statusName',
filters: [],
},
{
title: `${intl.formatMessage({ id: 'merchantCoupon.operation' })}`,
......
......@@ -4,7 +4,7 @@ export function HandelFormFieldsKeyValue(fields) {
let result = {}
for (const field in fields) {
const split = field.split('.');
if (split.length > 1) {
//为空的时候创建一个默认对象
if (result[split[0]] === undefined) {
......@@ -13,7 +13,7 @@ export function HandelFormFieldsKeyValue(fields) {
result[split[0]][split[1]] = momentFormatValue(fields[field]);
} else {
if (['deliveryRangeTime'].includes(field)) {
result[field] = fields[field].map(v => momentFormatValue(v, 'HH:mm:ss'))
result[field] = fields[field].map(v => momentFormatValue(v, 'HH:mm'))
} else {
result[field] = momentFormatValue(fields[field]);
}
......
import React, { useState, useEffect } from 'react'
import useAnchor from './useAnchor'
export interface UseCountDownProps {
maxTime: number,
minTime: number,
......@@ -19,7 +20,7 @@ const useCountDown = (options: UseCountDownProps): ReturnValue => {
const [isOpen, setIsOpen] = useState(false)
useEffect(() => {
const { maxTime = 60, minTime = 0, initText = '获取验证码', delay = 1 * 1000, onEnd = () => {}, decayRate = 1 } = options
const { maxTime = 60, minTime = 0, initText = '获取验证码', delay = 1 * 1000, onEnd = () => { }, decayRate = 1 } = options
let activeInterval: any = null
let activeTime = maxTime
if (isOpen) {
......@@ -53,4 +54,8 @@ const useCountDown = (options: UseCountDownProps): ReturnValue => {
}
}
export default useCountDown
\ No newline at end of file
export default useCountDown
export {
useAnchor
}
\ No newline at end of file
import { AnchorsItem } from "@/components/AnchorPage";
import { useState } from "react";
function useAnchor(initValue: AnchorsItem[]) {
const [anchors, setAnchors] = useState<AnchorsItem[]>(initValue)
function update(data: AnchorsItem[]) {
setAnchors([
...anchors,
...data
])
}
function delUpdate(data: any[]) {
for (const d in data) {
anchors.pop()
}
setAnchors([
...anchors,
...data
])
}
return {
anchors,
update,
delUpdate
}
}
export default useAnchor;
\ No newline at end of file
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