提交 a8b87878 作者: 龚洪江

Merge branch 'develop'

......@@ -14,4 +14,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/admin
newTag: e8642a205674071202d22ba8f884dd9dd226bc36
newTag: 69a87f6953407401ad1c17c2d6e409c4f5d581f7
......@@ -14,6 +14,7 @@ import { ResourceManageAPI } from './modules/resourceManageAPI';
import { ForumManageAPI } from './modules/forumManageAPI';
import { PilotTrainAPI } from './modules/pilotTrainAPI';
import { FlyerCenterAPI } from './modules/flyerCenterAPI';
import { RentManageAPI } from './modules/rentManageAPI';
export {
CommonAPI,
......@@ -32,4 +33,5 @@ export {
ForumManageAPI,
PilotTrainAPI,
FlyerCenterAPI,
RentManageAPI,
};
......@@ -109,161 +109,62 @@ export type removeMallGoodsType = InterFunction<{ id: number }, any>;
export type exchangeGoodsInfoType = InterFunction<{ firstId: number; secondId: number }, any>;
//商品-新增(新)
export type addMallGoodsType = InterFunction<
{
categoryPrimaryId: number;
categorySubId: number;
description: string;
goodsDetails: string;
goodsLabel: string;
goodsSpecList: {
chooseType: number;
goodsSpecValuesList: {
channelPrice?: number;
id: any;
partNo: string;
salePrice: number;
showPrice: number;
specValueImage: string;
specValueName: string;
stock?: number;
goodsSpecId?: number;
}[];
//商品item类型
type goodsItemType = {
categoryPrimaryId: number;
categorySubId: number;
description: string;
goodsDetails: string;
goodsLabel: string;
goodsSpecList?: {
chooseType: number;
goodsSpecValuesList: {
channelPrice?: number;
id: any;
mallGoodsId: number;
must: number;
skuUnitId: number;
specName: string;
}[];
labelShow: number;
resourcesList: {
id: number;
type: number;
url: string;
}[];
shelfStatus: number;
tradeName: string;
},
any
>;
//商品-编辑(新)
export type editMallGoodsType = InterFunction<
{
categoryPrimaryId: number;
categorySubId: number;
description: string;
goodsDetails: string;
goodsLabel: string;
goodsSpecList: {
chooseType: number;
goodsSpecValuesList: {
channelPrice?: number;
id: any;
partNo: string;
salePrice: number;
showPrice: number;
specValueImage: string;
specValueName: string;
stock?: number;
goodsSpecId: number;
}[];
id: any;
mallGoodsId: number;
must: number;
skuUnitId: number;
specName: string;
partNo: string;
salePrice: number;
showPrice: number;
specValueImage: string;
specValueName: string;
stock?: number;
goodsSpecId?: number;
}[];
id: any;
mallGoodsId: number;
must: number;
skuUnitId: number;
specName: string;
}[];
labelShow: number;
resourcesList: {
id: number;
labelShow: number;
resourcesList: {
id: number;
type: number;
url: string;
}[];
shelfStatus: number;
tradeName: string;
},
any
>;
type: number;
url: string;
}[];
shelfStatus: number;
tradeName: string;
priceStock: {
channelPrice: number;
id?: number;
productSpec: string;
salePrice: number;
skuImage: string;
skuNo: string;
stock: number;
}[];
specAttrList: {
specName: string;
id: number;
specValuesList: { specName: string; id: number }[];
}[];
};
export type addMallGoodsType = InterFunction<goodsItemType, any>;
//商品-编辑(新)
export type editMallGoodsType = InterFunction<goodsItemType & { id: number }, any>;
//商品-列表(新)
export type listPageGoodsInfoType = InterItemFunction<
{ categoryPrimaryId?: number; tradeName?: string; shelfStatus?: number },
{
categoryPrimaryId: number;
categorySubId: number;
createTime: string;
description: string;
goodsDetails: string;
goodsLabel: string;
goodsSpecList: {
chooseType: number;
goodsSpecValuesList: {
channelPrice: number;
goodsSpecId: number;
id: number;
partNo: string;
salePrice: number;
showPrice: number;
specValueImage: string;
specValueName: string;
stock: number;
}[];
id: number;
mallGoodsId: number;
must: number;
skuUnitId: number;
specName: string;
}[];
id: number;
labelShow: number;
resourcesList: {
id: number;
type: number;
url: string;
}[];
shelfStatus: number;
tradeName: string;
userAccountId: number;
}[]
goodsItemType & { id: number }[]
>;
//商城-详情(新)
export type mallGoodsDetailsType = InterFunction<
{ id: number },
{
categoryPrimaryId: number;
categorySubId: number;
createTime: string;
description: string;
goodsDetails: string;
goodsLabel: string;
goodsSpecList: {
chooseType: number;
goodsSpecValuesList: {
channelPrice: number;
goodsSpecId: number;
id: number;
partNo: string;
salePrice: number;
showPrice: number;
specValueImage: string;
specValueName: string;
stock: number;
}[];
id: number;
mallGoodsId: number;
must: number;
skuUnitId: number;
specName: string;
}[];
id: number;
labelShow: number;
resourcesList: {
id: number;
type: number;
url: string;
}[];
shelfStatus: number;
tradeName: string;
userAccountId: number;
}
>;
export type mallGoodsDetailsType = InterFunction<{ id: number }, goodsItemType & { id: number }>;
......@@ -649,3 +649,36 @@ export type DistributeMallOrderBonusType = InterFunction<
}>;
}
>;
// 后台管理——积分列表
export type UserPointListType = InterListFunction<
{
nickName?: string;
phoneNum?: string;
},
{
createTime: string;
id: number;
nickName: string;
phoneNum: number;
totalPoints: number;
updateTime: string;
userAccountId: number;
}
>;
// 后台管理——积分详情
export type DetailPointListType = InterListFunction<
{
userAccountId: number;
},
{
createTime: string;
id: number;
nickName: string;
phoneNum: number;
point: number;
pointSource: number;
timeOfRelease: number;
updateTime: string;
userAccountId: number;
}
>;
import { InterFunction, InterItemFunction } from '~/api/interface';
//租赁-类型-新增
export type addType = InterFunction<{ name: string; url: string }, any>;
//租赁-类型-列表
export type getTypeListType = InterItemFunction<any, { id: number; name: string; url: string }[]>;
//租赁-类型-编辑
export type rentTypeEditType = InterFunction<{ name: string; url: string; id: number }, any>;
//租赁-类型-删除
export type rentTypeRemoveType = InterFunction<{ id: number }, any>;
//租赁-品牌-新增
export type rentMakeAddType = InterFunction<{ brandName: string }, any>;
//租赁-品牌-编辑
export type editBrandInfoType = InterFunction<{ brandName: string; id?: number }, any>;
//租赁-品牌-列表
export type listBrandInfoType = InterItemFunction<
any,
{
brandName: string;
createTime: string;
id: number;
modeInfoList: {
brandInfoId: number;
id: number;
modeName: string;
productTypeId: number;
tag: string;
}[];
}[]
>;
//租赁-型号-新增
export type addRentModeType = InterFunction<
{ modeName: string; brandInfoId: number; productTypeId: number },
any
>;
......@@ -2,6 +2,7 @@ import axios from '../request';
import {
AddAndEditBonusRuleType,
AddConvertRuleType,
UserPointListType,
BonusRuleListQueryType,
CalculateOrderBonusVOType,
CheckUserScoreType,
......@@ -25,6 +26,7 @@ import {
UpdateMallOrderBonusType,
UserScoreDetailsListType,
UserScorePageListType,
DetailPointListType,
} from '../interface/pointManageType';
export class PointManageAPI {
......@@ -127,4 +129,14 @@ export class PointManageAPI {
// 积分管理-订单分成-发放积分
static DistributeMallOrderBonus: DistributeMallOrderBonusType = (params) =>
axios.get('/mallorder/orderBonus/distributeMallOrderBonus', { params });
// 后台管理——积分列表
static UserPointList: UserPointListType = (params) => {
return axios.post('/userapp/userPoint/userPointList', params);
};
// 后台管理——积分详情
static DetailPointList: DetailPointListType = (params) => {
return axios.post('/userapp/userPoint/detailPoint', params);
};
}
import {
addRentModeType,
addType,
editBrandInfoType,
getTypeListType,
listBrandInfoType,
rentMakeAddType,
rentTypeEditType,
rentTypeRemoveType,
} from '~/api/interface/rentManageType';
import axios from '../request';
export class RentManageAPI {
//租赁-类型-新增
static addTypeReq: addType = (data) => axios.post('/pms/attribute/addType', data);
//租赁-类型-列表
static getTypeList: getTypeListType = (params) =>
axios.get('/pms/attribute/typeList', { params });
// 租赁-类型-编辑
static editTypeReq: rentTypeEditType = (data) => axios.post('/pms/attribute/editType', data);
// 租赁-类型-删除
static rentTypeRemove: rentTypeRemoveType = (params) =>
axios.get('/pms/attribute/removeType', { params });
// 租赁-品牌-新增
static addBrandInfo: rentMakeAddType = (params) =>
axios.get('/pms/brand/addBrandInfo', { params });
// 租赁-品牌-编辑
static editBrandInfo: editBrandInfoType = (params) =>
axios.get('/pms/brand/editBrandInfo', { params });
// 租赁-品牌-列表
static getListBrandInfo: listBrandInfoType = (params) =>
axios.get('/pms/brand/listBrandInfo', { params });
// 租赁-型号-新增
static addRentMode: addRentModeType = (data) => axios.post('/pms/brand/addMode', data);
}
......@@ -20,6 +20,7 @@ const EditableCell: React.FC<
uploadSuccess?: (record: any, result: any) => void;
rules?: any;
maxLength?: number;
placeholder?: string;
}
> = ({
editing,
......@@ -34,15 +35,16 @@ const EditableCell: React.FC<
children,
rules,
maxLength,
placeholder,
...restProps
}) => {
const inputNode = () => {
switch (inputType) {
case 'number':
return <InputNumber placeholder={`请输入${title}`} maxLength={maxLength} />;
return <InputNumber placeholder={`请输入${placeholder || title}`} maxLength={maxLength} />;
case 'select':
return (
<Select placeholder={`请选择${title}`} style={{ textAlign: 'start' }}>
<Select placeholder={`请选择${placeholder || title}`} style={{ textAlign: 'start' }}>
{selectOption &&
selectOption.map((v) => (
<Select.Option value={v.id} key={v.id}>
......@@ -73,9 +75,15 @@ const EditableCell: React.FC<
</Radio.Group>
);
case 'textArea':
return <Input.TextArea placeholder={`请输入${title}`} maxLength={maxLength} showCount />;
return (
<Input.TextArea
placeholder={`请输入${placeholder || title}`}
maxLength={maxLength}
showCount
/>
);
default:
return <Input placeholder={`请输入${title}`} maxLength={maxLength} />;
return <Input placeholder={`请输入${placeholder || title}`} maxLength={maxLength} />;
}
};
return (
......
......@@ -3,19 +3,13 @@ import { useEffect, useRef, useState } from 'react';
import BaseInfo from './components/baseInfo';
import SkuInfo from './components/skuInfo';
import IntroduceInfo from './components/introduceInfo';
import SkuAddOrEditModal from './components/skuAddOrEditModal';
import './index.scss';
import { useNavigate, useSearchParams } from 'react-router-dom';
import { baseInfoType } from './components/baseInfo';
import { InterDataType, InterReqType } from '~/api/interface';
import { addMallGoodsType, mallGoodsDetailsType, skuUnitType } from '~/api/interface/goodsType';
import { InterDataType } from '~/api/interface';
import { mallGoodsDetailsType } from '~/api/interface/goodsType';
import GoodsAPI from '~/api/modules/goodsAPI';
import { filterObjAttr } from '~/utils';
//商品sku规格类型
type goodsSpecType = Exclude<InterReqType<addMallGoodsType>, undefined>['goodsSpecList'][0];
//单位返回类型
type unitType = InterDataType<skuUnitType>;
//商品详情-返回类型
type goodsDetailType = InterDataType<mallGoodsDetailsType>;
......@@ -23,16 +17,9 @@ const GoodsAddOrEditOrDetail = () => {
const baseInfoRef = useRef<any>();
const navigate = useNavigate();
const [searchParams] = useSearchParams();
const skuInfoRef = useRef<any>();
//单位列表
const [skuUnitList, setSkuUnitList] = useState<unitType>([]);
const [tabSelectKeys, setTabSelectKeys] = useState<string>('1');
//新增、编辑sku弹窗
const [addOrEditSkuModalShow, setAddOrEditSkuModalShow] = useState<boolean>(false);
//当前编辑sku
const [currentSku, setCurrentSku] = useState<goodsSpecType>();
//skuTable数据
const [skuTable, setSkuTable] = useState<goodsSpecType[]>([]);
//商品介绍详情
const [goodsDetails, setGoodsDetails] = useState<string>('');
//商品id
......@@ -40,30 +27,6 @@ const GoodsAddOrEditOrDetail = () => {
//商品详情
const [goodsDetailsInfo, setGoodsDetailsInfo] = useState<goodsDetailType>();
//新增、编辑sku弹窗显示
const addOrEditSkuClick = (record?: goodsSpecType) => {
setCurrentSku(record ? { ...record } : undefined);
setAddOrEditSkuModalShow(true);
};
const addOrEditSkuModalCancel = () => {
setAddOrEditSkuModalShow(false);
};
const addOrEditSkuModalOk = (values: goodsSpecType) => {
setAddOrEditSkuModalShow(false);
const skuTableIndex: number = skuTable.findIndex((v) => v.id === values.id);
if (skuTableIndex !== -1) {
skuTable.splice(skuTableIndex, 1, values);
setSkuTable([...skuTable]);
} else {
setSkuTable([...skuTable, { ...values }]);
}
};
//sku删除
const deleteSkuClick = (record: goodsSpecType) => {
const skuIndex: number = skuTable.findIndex((v) => v.id === record.id);
skuTable.splice(skuIndex, 1);
setSkuTable([...skuTable]);
};
//商品详情获取
const getIntroduceInfo = (richText: string) => {
setGoodsDetails(richText);
......@@ -78,15 +41,7 @@ const GoodsAddOrEditOrDetail = () => {
{
key: '2',
label: `商品规格`,
children: (
<SkuInfo
addOrEditSkuClick={addOrEditSkuClick}
skuTableData={skuTable}
skuUnitList={skuUnitList}
deleteSkuClick={deleteSkuClick}
editSkuClick={addOrEditSkuClick}
/>
),
children: <SkuInfo ref={skuInfoRef} goodsDetailsInfo={goodsDetailsInfo} />,
},
{
key: '3',
......@@ -114,11 +69,14 @@ const GoodsAddOrEditOrDetail = () => {
});
break;
case '2':
if (skuTable.length) {
setTabSelectKeys((Number(tabSelectKeys) + 1).toString());
} else {
message.warning('请添加规格');
}
skuInfoRef.current
.submitSku()
.then(() => {
setTabSelectKeys((Number(tabSelectKeys) + 1).toString());
})
.catch((error: any) => {
message.warning(error?.errorFields?.[0].errors[0] || error);
});
break;
case '3':
break;
......@@ -133,62 +91,45 @@ const GoodsAddOrEditOrDetail = () => {
const backRoute = () => {
navigate(-1);
};
//单位列表
const getSkuUnit = () => {
GoodsAPI.getSkuUnit().then(({ result }) => {
setSkuUnitList(result || []);
});
};
//商品保存
const saveGoods = () => {
baseInfoRef.current
.getForm()
.validateFields()
.then((values: baseInfoType) => {
if (skuTable.length) {
const skuList = skuTable.map((v) => ({
...v,
id: goodsDetailsInfo
? goodsDetailsInfo.goodsSpecList.find((i) => i.id === v.id)?.id
: undefined,
goodsSpecValuesList: v.goodsSpecValuesList.map((i) => ({
...i,
id: goodsDetailsInfo
? goodsDetailsInfo.goodsSpecList
.find((j) => j.id === v.id)
?.goodsSpecValuesList.find((k) => k.id === i.id)?.id
: undefined,
goodsSpecId: goodsDetailsInfo
? goodsDetailsInfo.goodsSpecList.find((i) => i.id === v.id)?.id
: undefined,
})),
}));
const addGoodsEditReq = {
...filterObjAttr(values, ['mainImgList', 'subImgList', 'videoList', 'categoryId']),
resourcesList: [
...values.mainImgList.map((v) => ({ type: 0, url: v.url })),
...(values.subImgList?.map((v) => ({ type: 1, url: v.url })) || []),
...(values.videoList?.map((v) => ({ type: 2, url: v.url })) || []),
],
categoryPrimaryId: values.categoryId[0],
categorySubId: values.categoryId.length === 2 ? values.categoryId[1] : undefined,
goodsDetails,
goodsSpecList: skuList,
id: goodsId || undefined,
};
GoodsAPI[goodsId ? 'editMallGoods' : 'addMallGoods'](addGoodsEditReq).then(({ code }) => {
if (code === '200') {
message.success(goodsId ? '编辑商城成功' : '新增商品成功');
navigate(-1);
}
});
} else {
message.warning('商品规格未添加');
}
Promise.all([
baseInfoRef.current.getForm().validateFields(),
skuInfoRef.current ? skuInfoRef.current.submitSku() : getDefaultSku(),
])
.then((values: any) => {
const addGoodsEditReq = {
...filterObjAttr(values[0], ['mainImgList', 'subImgList', 'videoList', 'categoryId']),
resourcesList: [
...values[0].mainImgList.map((v: any) => ({ type: 0, url: v.url })),
...(values[0].subImgList?.map((v: any) => ({ type: 1, url: v.url })) || []),
...(values[0].videoList?.map((v: any) => ({ type: 2, url: v.url })) || []),
],
categoryPrimaryId: values[0].categoryId[0],
categorySubId: values[0].categoryId.length === 2 ? values[0].categoryId[1] : undefined,
goodsDetails,
...values[1],
id: goodsId || undefined,
};
GoodsAPI[goodsId ? 'editMallGoods' : 'addMallGoods'](addGoodsEditReq).then(({ code }) => {
if (code === '200') {
message.success(goodsId ? '编辑商品成功' : '新增商品成功');
navigate(-1);
}
});
})
.catch((error: any) => {
message.error(error.errorFields[0].errors[0]);
baseInfoRef.current
.getForm()
.validateFields()
.then(() => {
setTabSelectKeys('2');
})
.catch(() => {
setTabSelectKeys('1');
});
message.error(error?.errorFields?.[0].errors[0] || error);
});
};
//商品详情
......@@ -204,7 +145,6 @@ const GoodsAddOrEditOrDetail = () => {
.filter((v) => v.type === 2)
.map((v) => ({ id: v.id, name: 'video', uid: v.id, url: v.url }));
setGoodsDetailsInfo(JSON.parse(JSON.stringify(result)));
setSkuTable(result.goodsSpecList);
setGoodsDetails(result.goodsDetails || '');
baseInfoRef.current.getForm().setFieldsValue({
tradeName: result.tradeName,
......@@ -225,9 +165,21 @@ const GoodsAddOrEditOrDetail = () => {
baseInfoRef.current.mediaData.setVideoFileList(videoList);
});
};
//编辑未点击规格时数据处理
const getDefaultSku = () => {
return new Promise((resolve, reject) => {
if (goodsDetailsInfo) {
resolve({
priceStock: goodsDetailsInfo.priceStock,
specAttrList: goodsDetailsInfo.specAttrList,
});
} else {
reject('请上传商品规格');
}
});
};
useEffect(() => {
getSkuUnit();
if (searchParams.get('id')) {
setGoodsId(Number(searchParams.get('id')));
getMallGoodsDetails(Number(searchParams.get('id')));
......@@ -255,14 +207,6 @@ const GoodsAddOrEditOrDetail = () => {
返回
</Button>
</div>
{/*新增、编辑sku弹窗*/}
<SkuAddOrEditModal
open={addOrEditSkuModalShow}
onCancel={addOrEditSkuModalCancel}
onHandleOk={addOrEditSkuModalOk}
skuUnitList={skuUnitList}
currentSku={currentSku}
/>
</div>
);
};
......
import { useSearchParams, useNavigate } from 'react-router-dom';
import { useEffect, useState } from 'react';
import GoodsAPI from '~/api/modules/goodsAPI';
import { InterDataType } from '~/api/interface';
import { mallGoodsDetailsType, skuUnitType } from '~/api/interface/goodsType';
import { Badge, Button, Descriptions, Image, Table, Tag } from 'antd';
import { InterDataType, InterReqType } from '~/api/interface';
import { addMallGoodsType, mallGoodsDetailsType } from '~/api/interface/goodsType';
import { Badge, Button, Descriptions, Image, Table } from 'antd';
import { CategoryManageAPI } from '~/api';
import { categoryListRespType } from '~/api/interface/categoryManage';
import './index.scss';
import { ColumnsType } from 'antd/es/table';
//详情返回类型
type detailType = InterDataType<mallGoodsDetailsType>;
//分类返回类型
type categoryType = InterDataType<categoryListRespType>['list'];
//单位返回类型
type unitType = InterDataType<skuUnitType>;
//规格表格类型
type skuTableType = Exclude<InterReqType<addMallGoodsType>, undefined>['priceStock'][0] & {
fileList: {
id: number;
name: string;
uid: number;
url: string;
}[];
};
//规格表单数据类型
type specificationFormListType = {
optionList: { label: string; value: string }[];
id: number;
name: string;
addSpecificationValueShow: boolean;
specificationValueList: { name: string; id: number; specificationName: string }[];
};
const GoodsDetails = () => {
const [searchParams] = useSearchParams();
const navigate = useNavigate();
//分类列表
const [categoryList, setCategoryList] = useState<categoryType>([]);
//单位列表
const [skuUnitList, setSkuUnitList] = useState<unitType>([]);
//表格数据
const [tableData, setTableData] = useState<(skuTableType & { [key: string]: string })[]>([]);
const [goodsInfoDetails, setGoodsInfoDetails] = useState<detailType>();
const tableColumns: ColumnsType<detailType['goodsSpecList'][0]> = [
const [tableColumns, setTableColumns] = useState<any>([
{
title: '序号',
title: '商品规格',
align: 'center',
render: (_text: string, _record, index: number) => index + 1,
dataIndex: 'specName',
children: [],
},
{
title: '规格名称',
title: '图片',
align: 'center',
dataIndex: 'specName',
dataIndex: 'skuImage',
render: (text: string) => <Image src={text} width={50} height={50} alt='暂无图片' />,
},
{
title: '选择方式',
title: 'sku编号',
align: 'center',
dataIndex: 'chooseType',
render: (text: number) => (text ? '多选' : '单选'),
dataIndex: 'skuNo',
},
{
title: '是否必选',
title: '销售价',
align: 'center',
dataIndex: 'must',
render: (text: number) => (text ? '必选' : '非必选'),
dataIndex: 'salePrice',
},
{
title: '规格单位',
title: '渠道价',
align: 'center',
dataIndex: 'skuUnitId',
render: (text: number) => skuUnitList.find((v) => v.id === text)?.unitName || '',
dataIndex: 'channelPrice',
},
{
title: '规格值',
title: '库存',
align: 'center',
dataIndex: 'goodsSpecValuesList',
render: (text: detailType['goodsSpecList'][0]['goodsSpecValuesList']) =>
text.map((v) => (
<Tag key={v.id}>
{v.specValueName}
{v.partNo ? `(${v.partNo})` : ''}
</Tag>
)),
dataIndex: 'stock',
},
];
]);
const getGoodsDetails = (id: number) => {
GoodsAPI.getMallGoodsDetails({ id }).then(({ result }) => {
setGoodsInfoDetails(result);
//转化数据
const covertSpecAttrList = result.specAttrList.map((v, index) => ({
id: v.id,
name: 'specName' + index,
optionList: [{ label: v.specName, value: v.specName }],
specificationValueList: v.specValuesList.map((i) => ({
id: i.id,
name: i.specName,
specificationName: v.specName,
})),
addSpecificationValueShow: false,
}));
mergeTableRow(covertSpecAttrList);
const tableDataList: (skuTableType & { [key: string]: string })[] = result.priceStock.map(
(v) => ({
id: v.id,
salePrice: v.salePrice,
skuImage: v.skuImage,
skuNo: v.skuNo,
stock: v.stock,
channelPrice: v.channelPrice,
fileList: v.skuImage
? [{ id: Math.random(), uid: Math.random(), url: v.skuImage, name: '规格图片' }]
: [],
...Object.getOwnPropertyNames(JSON.parse(v.productSpec)).reduce(
(pre: any, cur, currentIndex) => {
pre['name' + (currentIndex + 1)] = JSON.parse(v.productSpec)[cur];
pre['specificationName' + (currentIndex + 1)] = cur;
return pre;
},
{},
),
}),
);
setTableData(tableDataList);
});
};
//表头拆分及合并列
const mergeTableRow = (filterSpecificationFormList: specificationFormListType[]) => {
const columns = filterSpecificationFormList.map((v, index) => ({
title: v.optionList[0].value,
dataIndex: 'name' + (index + 1),
align: 'center',
onCell: (_: any, i: number) => {
//合并列
if (index < filterSpecificationFormList.length - 1) {
const count: number = filterSpecificationFormList
.slice(index + 1, filterSpecificationFormList.length)
.reduce((pre: number, cur) => {
return pre * cur.specificationValueList.length;
}, 1);
return {
rowSpan: count !== 1 ? ((i + 1) % count === 1 ? count : 0) : 1,
};
} else {
return {
rowSpan: 1,
};
}
},
}));
tableColumns[0].children = columns;
setTableColumns([...tableColumns]);
};
//分类列表
const getCategoryList = () => {
CategoryManageAPI.getCategoryRespList({ pageNo: 1, pageSize: 99999 }).then(({ result }) => {
setCategoryList(result.list || []);
});
};
//单位列表
const getSkuUnit = () => {
GoodsAPI.getSkuUnit().then(({ result }) => {
setSkuUnitList(result || []);
});
};
//返回
const backRoute = () => {
navigate(-1);
......@@ -91,7 +154,6 @@ const GoodsDetails = () => {
useEffect(() => {
getGoodsDetails(Number(searchParams.get('id')));
getCategoryList();
getSkuUnit();
}, []);
return (
<div className='goods-detail'>
......@@ -157,7 +219,7 @@ const GoodsDetails = () => {
<Table
bordered
columns={tableColumns}
dataSource={goodsInfoDetails?.goodsSpecList}
dataSource={tableData}
rowKey='id'
pagination={false}
></Table>
......
import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import { Button, message, Table } from 'antd';
import { ColumnsType } from 'antd/es/table';
import SearchView from '~/components/search-box/index';
import { PointManageAPI } from '~/api';
import { UserScorePageListType } from '~/api/interface/pointManageType';
import { UserPointListType } from '~/api/interface/pointManageType';
import { useNavigate } from 'react-router-dom';
import { InterListType, InterReqListType } from '~/api/interface';
import qs from 'query-string';
// 列表的类型
type TableType = (ReturnType<UserScorePageListType> extends Promise<infer T>
? T
: never)['result']['list']['userBasicInfo'];
// 后台返回的类型,但不是列表
type ListType = (ReturnType<UserScorePageListType> extends Promise<infer T>
? T
: never)['result']['list'];
type TableType = InterListType<UserPointListType>;
// 搜索表单的类型
type ReqType = Parameters<UserScorePageListType>[0];
type ReqType = InterReqListType<UserPointListType>;
// 搜索表单的数据
let query: ReqType = {};
export const PointList = () => {
// 路由操作
const navigation = useNavigate();
const navigate = useNavigate();
// 金额数据
const [pointData, setPointData] = useState<ListType>();
// const [pointData, setPointData] = useState<ListType>();
// 表格数据
const [tableData, setTableData] = useState<TableType>([]);
// 表格分页配置
......@@ -34,36 +30,30 @@ export const PointList = () => {
totalPage: 0,
});
// 跳转指定明细详情
const handleDetailList = (type: number) => {
navigation(`/pointManage/pointList/list?type=${type}`);
};
// const handleDetailList = (type: number) => {
// navigation(`/pointManage/pointList/list?type=${type}`);
// };
// +++++++++++++++++++++++++++++++++++++++++++++++++++ //
// 新版通用部分(ES6+ for React) ZhangLK 2022/08/30 Start
// 加载列表
const getTableList = async (value = {}) => {
// 只需要修改这个地方的接口即可
const res = await PointManageAPI.UserScorePageList({
const res = await PointManageAPI.UserPointList({
pageNo: pagination.current,
pageSize: pagination.pageSize,
...value,
...query,
});
if (res && res.code === '200') {
const {
list: { convertScore, releaseScore, userBasicInfo, withdrawScore, withdrawingScore },
pageNo,
totalCount,
pageSize,
totalPage,
} = res.result; // 解构
const { list, pageNo, totalCount, pageSize, totalPage } = res.result; // 解构
setPagination({
total: totalCount,
current: pageNo,
pageSize,
totalPage,
});
setTableData(userBasicInfo);
setPointData(res?.result?.list);
setTableData(list || []);
// setPointData(res?.result?.list);
} else {
message.warning(res.message);
}
......@@ -81,26 +71,28 @@ export const PointList = () => {
// +++++++++++++++++++++++++++++++++++++++++++++++++++ //
// 跳转详情
const handleDetail = (record: TableType[0]) => {
navigation({
pathname: '/pointManage/pointList/detail',
search: `id=${record?.mallUserId}&uid=${record?.uid}`,
});
const search = {
id: record.userAccountId,
totalPoints: record.totalPoints,
nickName: record.nickName || '游客用户',
};
navigate(`/pointManage/pointList/detail?${qs.stringify(search)}`);
};
// 表格结构
const columns: ColumnsType<TableType[0]> = [
{ title: 'UID', dataIndex: 'uid', align: 'center' },
{ title: 'UID', dataIndex: 'userAccountId', align: 'center' },
{
title: '用户名称',
dataIndex: 'userName',
align: 'center',
render: (text, record) => text || record?.nickName || `游客用户`,
},
{
title: '企业名称',
dataIndex: 'entName',
align: 'center',
render: (text: string, record) => text || (record.phoneNum ? '微信用户' : '游客用户'),
},
// {
// title: '企业名称',
// dataIndex: 'entName',
// align: 'center',
// render: (text: string, record) => text || (record.phoneNum ? '微信用户' : '游客用户'),
// },
{
title: '手机号',
dataIndex: 'phoneNum',
......@@ -108,7 +100,7 @@ export const PointList = () => {
},
{
title: '积分总额',
dataIndex: 'score',
dataIndex: 'totalPoints',
align: 'center',
render: (text: string, record) => {
return (
......@@ -132,10 +124,10 @@ export const PointList = () => {
<SearchView
search={[
{
label: '用户UID',
name: 'uid',
label: '微信昵称',
name: 'nickName',
type: 'input',
placeholder: '请输入UID',
placeholder: '请输入微信昵称',
width: 180,
},
{
......@@ -144,42 +136,42 @@ export const PointList = () => {
type: 'input',
placeholder: '请输入手机号',
},
{
label: '企业名称',
name: 'entName',
type: 'input',
placeholder: '请输入企业名称',
},
// {
// label: '企业名称',
// name: 'entName',
// type: 'input',
// placeholder: '请输入企业名称',
// },
]}
searchData={onFinish}
sufFixBtn={
<div className='point-list-head-number'>
<div className='head-number'>
<span className='number-label'>积分发放总额</span>
<Button type='link' onClick={() => handleDetailList(0)}>
{pointData?.releaseScore}
</Button>
</div>
<div className='head-number'>
<span className='number-label'>积分兑换总额</span>
<Button type='link' onClick={() => handleDetailList(1)}>
{pointData?.convertScore}
</Button>
</div>
<div className='head-number'>
<span className='number-label'>积分提现总额</span>
<Button type='link' onClick={() => handleDetailList(2)}>
{pointData?.withdrawScore}
</Button>
</div>
<div className='head-number'>
<span className='number-label'>待处理提现积分</span>
<Button type='link' onClick={() => handleDetailList(2)}>
{pointData?.withdrawingScore}
</Button>
</div>
</div>
}
// sufFixBtn={
// <div className='point-list-head-number'>
// <div className='head-number'>
// <span className='number-label'>积分发放总额</span>
// <Button type='link' onClick={() => handleDetailList(0)}>
// {pointData?.releaseScore}
// </Button>
// </div>
// <div className='head-number'>
// <span className='number-label'>积分兑换总额</span>
// <Button type='link' onClick={() => handleDetailList(1)}>
// {pointData?.convertScore}
// </Button>
// </div>
// <div className='head-number'>
// <span className='number-label'>积分提现总额</span>
// <Button type='link' onClick={() => handleDetailList(2)}>
// {pointData?.withdrawScore}
// </Button>
// </div>
// <div className='head-number'>
// <span className='number-label'>待处理提现积分</span>
// <Button type='link' onClick={() => handleDetailList(2)}>
// {pointData?.withdrawingScore}
// </Button>
// </div>
// </div>
// }
/>
<Table
size='small'
......
......@@ -71,7 +71,6 @@ const GoodsAddOrEditOrDetail = () => {
//删除规格
const deleteSkuEvent = (record: specEntity) => {
const index = specData.findIndex((v) => v.id === record.id);
console.log('删除index-->', index);
specData.splice(index, 1);
setSpecData([...specData]);
};
......
......@@ -188,19 +188,19 @@ const RentList = () => {
};
//新增商品
const toAddRentGoods = () => {
navigate({ pathname: '/mallManage/rentGoods/add' });
navigate({ pathname: '/rentManage/rentGoods/add' });
};
//编辑商品
const toEditGoods = (id: number) => {
navigate({
pathname: '/mallManage/rentGoods/edit',
pathname: '/rentManage/rentGoods/edit',
search: `id=${id}`,
});
};
//商品详情
const toRentGoodsDetail = (id: number) => {
navigate({
pathname: '/mallManage/rentGoods/detail',
pathname: '/rentManage/rentGoods/detail',
search: `id=${id}&isDetail=1`,
});
};
......
import { Form, Input, message, Modal, ModalProps } from 'antd';
import { FC, useEffect } from 'react';
import { InterDataType, InterReqType } from '~/api/interface';
import { listBrandInfoType, rentMakeAddType } from '~/api/interface/rentManageType';
import { RentManageAPI } from '~/api';
//品牌列表返回类型
type makeListType = InterDataType<listBrandInfoType>['list'];
interface selfProps {
onCancel: () => void;
onOk: () => void;
currentRentMakeItem: makeListType[0] | undefined;
}
//新增品牌参数类型
type addRentMakeParameterType = Exclude<InterReqType<rentMakeAddType>, undefined>;
const AddOrEditRentMakeModal: FC<ModalProps & selfProps> = ({
open,
onCancel,
onOk,
currentRentMakeItem,
}) => {
const [form] = Form.useForm<addRentMakeParameterType>();
const handleCancel = () => {
form.resetFields();
onCancel();
};
const handleOk = () => {
form.validateFields().then((values) => {
RentManageAPI[currentRentMakeItem ? 'editBrandInfo' : 'addBrandInfo']({
...values,
id: currentRentMakeItem ? currentRentMakeItem.id : undefined,
}).then(({ code }) => {
if (code === '200') {
message.success(currentRentMakeItem ? '编辑成功' : '新增成功');
form.resetFields();
onOk();
}
});
});
};
useEffect(() => {
if (currentRentMakeItem) {
form.setFieldValue('brandName', currentRentMakeItem.brandName);
}
}, [currentRentMakeItem]);
return (
<Modal open={open} onOk={handleOk} onCancel={handleCancel} title='新增品牌'>
<Form form={form}>
<Form.Item
label='品牌名称'
name='brandName'
rules={[{ required: true, message: '请输入品牌名称' }]}
>
<Input placeholder='请输入品牌名称' maxLength={30} />
</Form.Item>
</Form>
</Modal>
);
};
export default AddOrEditRentMakeModal;
import { Button, Table, Tag } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { ColumnsType } from 'antd/es/table';
import AddOrEditRentMakeModal from './components/addOrEditRentMakeModal';
import { useEffect, useState } from 'react';
import { RentManageAPI } from '~/api';
import { InterDataType, PaginationProps } from '~/api/interface';
import { listBrandInfoType } from '~/api/interface/rentManageType';
//品牌列表返回类型
type makeListType = InterDataType<listBrandInfoType>['list'];
const RentMake = () => {
const tableColumns: ColumnsType<makeListType[0]> = [
{
title: '品牌名称',
align: 'center',
dataIndex: 'brandName',
},
{
title: '设备型号',
align: 'center',
dataIndex: 'modeInfoList',
render: (text: makeListType[0]['modeInfoList']) =>
text?.map((v) => <Tag key={v.id}>{v.modeName}</Tag>),
},
{
title: '操作',
align: 'center',
width: '15%',
render: (_: any, record) => (
<>
<Button type='link'>绑定型号</Button>
<Button type='link' onClick={() => addOrEditRentMakeModalClick(record)}>
编辑
</Button>
<Button type='link'>详情</Button>
</>
),
},
];
const [addOrEditRentMakeModalShow, setAddOrEditRentMakeModalShow] = useState<boolean>(false);
const [pagination, setPagination] = useState<PaginationProps & { totalCount: number }>({
pageNo: 1,
pageSize: 10,
totalCount: 0,
});
const [tableData, setTableData] = useState<makeListType>([]);
const [currentRentMakeItem, setCurrentRentMakeItem] = useState<makeListType[0]>();
//品牌列表
const getListBrandInfo = () => {
RentManageAPI.getListBrandInfo({
pageNo: pagination.pageNo,
pageSize: pagination.pageSize,
}).then(({ result }) => {
pagination.totalCount = result.totalCount;
setPagination({ ...pagination });
setTableData(result.list || []);
});
};
//品牌新增,编辑弹窗
const addOrEditRentMakeModalClick = (record?: makeListType[0]) => {
setCurrentRentMakeItem(record ? { ...record } : undefined);
setAddOrEditRentMakeModalShow(true);
};
const addOrEditRentMakeModalCancel = () => {
setAddOrEditRentMakeModalShow(false);
};
const addOrEditRentMakeModalOk = () => {
getListBrandInfo();
setAddOrEditRentMakeModalShow(false);
};
//分页
const paginationChange = (pageNo: number, pageSize: number) => {
pagination.pageNo = pageNo;
pagination.pageSize = pageSize;
getListBrandInfo();
};
useEffect(() => {
getListBrandInfo();
}, []);
return (
<div className='rent-make'>
<div className='rent-make-operate' style={{ marginBottom: '10px' }}>
<Button
icon={<PlusOutlined />}
type='primary'
onClick={() => addOrEditRentMakeModalClick()}
>
新增品牌
</Button>
</div>
<Table
columns={tableColumns}
bordered
dataSource={tableData}
pagination={{
total: pagination.totalCount,
pageSize: pagination.pageSize,
current: pagination.pageNo,
showSizeChanger: true,
showQuickJumper: true,
onChange: (page: number, pageSize: number) => paginationChange(page, pageSize),
showTotal: (total, range) => `当前 ${range[0]}-${range[1]} 条记录 / 共 ${total} 条数据`,
}}
rowKey='id'
/>
<AddOrEditRentMakeModal
open={addOrEditRentMakeModalShow}
onCancel={addOrEditRentMakeModalCancel}
onOk={addOrEditRentMakeModalOk}
currentRentMakeItem={currentRentMakeItem}
/>
</div>
);
};
export default RentMake;
import { Form, Input, Modal, ModalProps, Select } from 'antd';
import { FC, useEffect, useState } from 'react';
import { InterDataType, InterReqType } from '~/api/interface';
import { addRentModeType, getTypeListType } from '~/api/interface/rentManageType';
import { RentManageAPI } from '~/api';
interface selfProps {
onOk: () => void;
onCancel: () => void;
}
//型号新增参数类型
type addRentParameterType = Exclude<InterReqType<addRentModeType>, undefined>;
//类型类别返回类型
type rentTypeListType = InterDataType<getTypeListType>['list'];
const AddOrEditRentModeModal: FC<ModalProps & selfProps> = ({ open, onOk, onCancel }) => {
const [form] = Form.useForm<addRentParameterType>();
const [rentTypeList, setRentTypeList] = useState<rentTypeListType>([]);
const handleOk = () => {
onOk();
};
const handleCancel = () => {
onCancel();
};
//获取类型列表
const getRentTypeList = () => {
RentManageAPI.getTypeList({ pageNo: 1, pageSize: 99999 }).then(({ result }) => {
setRentTypeList(result.list || []);
});
};
useEffect(() => {
getRentTypeList();
}, []);
return (
<Modal open={open} onOk={handleOk} onCancel={handleCancel} title='新增型号'>
<Form form={form}>
<Form.Item label='所属类别'>
<Select placeholder='请选择所属类别'>
{rentTypeList.map((v) => (
<Select.Option key={v.id} value={v.id}>
{v.name}
</Select.Option>
))}
</Select>
</Form.Item>
<Form.Item label='型号名称'>
<Input placeholder='请输入型号名称' />
</Form.Item>
</Form>
</Modal>
);
};
export default AddOrEditRentModeModal;
import SearchBox, { searchColumns as searchColumnsType } from '~/components/search-box';
import { Button, Table } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { ColumnsType } from 'antd/es/table/InternalTable';
import AddOrEditRentModeModal from '~/pages/rentManage/rentMode/components/addOrEditRentModeModal';
import { useState } from 'react';
const RentMode = () => {
const tableColumns: ColumnsType<any> = [
{
title: '型号名称',
align: 'center',
},
{
title: '所属类型',
align: 'center',
},
{
title: '所属品牌',
align: 'center',
},
{
title: '标签',
align: 'center',
},
{
title: '操作',
align: 'center',
},
];
const searchColumns: searchColumnsType[] = [
{
name: '',
label: '设备类型',
placeholder: '请选择设备类型',
type: 'select',
options: [],
},
];
const [addOrEditRentModelModalShow, setAddOrEditRentModelModalShow] = useState<boolean>(false);
//新增,编辑型号弹窗
const addOrEditRentModelClick = () => {
setAddOrEditRentModelModalShow(true);
};
const addOrEditRentModelModalCancel = () => {
setAddOrEditRentModelModalShow(false);
};
const addOrEditRentModelModalOk = () => {
setAddOrEditRentModelModalShow(true);
};
return (
<div className='rent-model'>
<SearchBox
search={searchColumns}
child={
<Button type='primary' icon={<PlusOutlined />} onClick={addOrEditRentModelClick}>
新增型号
</Button>
}
/>
<Table bordered columns={tableColumns} />
<AddOrEditRentModeModal
open={addOrEditRentModelModalShow}
onCancel={addOrEditRentModelModalCancel}
onOk={addOrEditRentModelModalOk}
/>
</div>
);
};
export default RentMode;
import { FC, useEffect, useState } from 'react';
import { Form, Input, message, Modal, ModalProps } from 'antd';
import { Uploader } from '~/components/uploader';
import { UploadOutlined } from '@ant-design/icons';
import { RentManageAPI } from '~/api';
import { InterDataType, InterReqType } from '~/api/interface';
import { addType, getTypeListType } from '~/api/interface/rentManageType';
//类型类别返回类型
type rentTypeListType = InterDataType<getTypeListType>['list'];
//新增租赁类型参数类型
type addRentTypeParameters = InterReqType<addType>;
interface selfProps {
onCancel: () => void;
onOk: () => void;
currentRentTypeItem: rentTypeListType[0] | undefined;
}
const AddOrEditTypeModal: FC<ModalProps & selfProps> = ({
open,
onCancel,
onOk,
currentRentTypeItem,
}) => {
const [form] = Form.useForm<addRentTypeParameters>();
const [fileList, setFileList] = useState<any>([]);
const handleCancel = () => {
form.resetFields();
setFileList([]);
onCancel();
};
const handelOk = () => {
form.validateFields().then((values: any) => {
RentManageAPI[currentRentTypeItem ? 'editTypeReq' : 'addTypeReq']({
...values,
id: currentRentTypeItem ? currentRentTypeItem.id : undefined,
}).then(({ code }) => {
if (code === '200') {
message.success(currentRentTypeItem ? '编辑成功' : '新增成功');
form.resetFields();
setFileList([]);
onOk();
}
});
});
};
//上传成功
const uploadSuccess = (fileList: any) => {
form.setFieldValue('url', fileList[0].url);
setFileList(fileList);
};
useEffect(() => {
if (currentRentTypeItem) {
form.setFieldsValue({
name: currentRentTypeItem.name,
url: currentRentTypeItem.url,
});
setFileList([
{ id: Math.random(), uid: Math.random(), url: currentRentTypeItem.url, name: '类型图片' },
]);
}
}, [currentRentTypeItem]);
return (
<Modal open={open} title='新增类型' onCancel={handleCancel} onOk={handelOk}>
<Form form={form} labelCol={{ span: 4 }} wrapperCol={{ span: 20 }}>
<Form.Item label='类型名称' name='name'>
<Input placeholder='请输入类型名称' maxLength={30} />
</Form.Item>
<Form.Item label='图片' name='url' rules={[{ required: true, message: '请上传图片' }]}>
<Uploader
fileUpload
listType='picture-card'
onChange={uploadSuccess}
defaultFileList={fileList}
>
<UploadOutlined />
</Uploader>
</Form.Item>
</Form>
</Modal>
);
};
export default AddOrEditTypeModal;
import { Button, Image, message, Modal, Table } from 'antd';
import { ColumnsType } from 'antd/es/table';
import AddOrEditTypeModal from './components/addOrEditTypeModal';
import { useEffect, useState } from 'react';
import { InterDataType, PaginationProps } from '~/api/interface';
import { RentManageAPI } from '~/api';
import { getTypeListType } from '~/api/interface/rentManageType';
//类型类别返回类型
type rentTypeListType = InterDataType<getTypeListType>['list'];
const RentType = () => {
const [addOrEditTypeModalShow, setAddOrEditTypeModalShow] = useState<boolean>(false);
const [pagination, setPagination] = useState<PaginationProps & { totalCount: number }>({
pageNo: 1,
pageSize: 10,
totalCount: 0,
});
const tableColumns: ColumnsType<rentTypeListType[0]> = [
{
title: '类型名称',
align: 'center',
dataIndex: 'name',
},
{
title: '图片',
align: 'center',
dataIndex: 'url',
render: (text: string) => <Image src={text} width={50} height={50} />,
},
{
title: '操作',
align: 'center',
render: (_text: string, record) => (
<>
<Button type='link' onClick={() => addOrEditTypeModalClick(record)}>
编辑
</Button>
<Button type='link' onClick={() => deleteRentType(record)}>
删除
</Button>
</>
),
},
];
const [tableData, setTableData] = useState<rentTypeListType>([]);
const [currentRentTypeItem, setCurrentRentTypeItem] = useState<rentTypeListType[0]>();
//类型列表
const getTypeList = () => {
RentManageAPI.getTypeList({ pageNo: pagination.pageNo, pageSize: pagination.pageSize }).then(
({ result }) => {
pagination.totalCount = result.totalCount;
setPagination({ ...pagination });
setTableData(result.list || []);
},
);
};
//新增,编辑类型
const addOrEditTypeModalClick = (record?: rentTypeListType[0]) => {
setCurrentRentTypeItem(record ? { ...record } : undefined);
setAddOrEditTypeModalShow(true);
};
const addOrEditTypeModalCancel = () => {
setAddOrEditTypeModalShow(false);
};
const addOrEditTypeModalOk = () => {
setAddOrEditTypeModalShow(false);
getTypeList();
};
//删除类型
const deleteRentType = (record: rentTypeListType[0]) => {
Modal.confirm({
title: '提示',
content: '确认删除该类型',
onOk: () => {
RentManageAPI.rentTypeRemove({ id: record.id }).then(({ code }) => {
if (code === '200') {
if (tableData.length === 1 && pagination.pageNo !== 1) {
pagination.pageNo -= 1;
}
message.success('删除成功');
getTypeList();
}
});
},
});
};
//分页
const paginationChange = (pageNo: number, pageSize: number) => {
pagination.pageNo = pageNo;
pagination.pageSize = pageSize;
getTypeList();
};
useEffect(() => {
getTypeList();
}, []);
return (
<div className='rent-type'>
<div className='rent-type-operate' style={{ marginBottom: '10px' }}>
<Button type='primary' onClick={() => addOrEditTypeModalClick()}>
新增类型
</Button>
</div>
<Table
bordered
columns={tableColumns}
dataSource={tableData}
rowKey='id'
pagination={{
total: pagination.totalCount,
pageSize: pagination.pageSize,
current: pagination.pageNo,
showSizeChanger: true,
showQuickJumper: true,
onChange: (page: number, pageSize: number) => paginationChange(page, pageSize),
showTotal: (total, range) => `当前 ${range[0]}-${range[1]} 条记录 / 共 ${total} 条数据`,
}}
/>
<AddOrEditTypeModal
open={addOrEditTypeModalShow}
onCancel={addOrEditTypeModalCancel}
onOk={addOrEditTypeModalOk}
currentRentTypeItem={currentRentTypeItem}
/>
</div>
);
};
export default RentType;
......@@ -20,7 +20,7 @@ export const authRouterList = async () => {
const getRouteList = (data: RouteObjectType[]) => {
return data.reduce((pre: RouteObjectType[], cur) => {
const Obj: RouteObjectType = { ...cur };
if (ids.includes(Obj.meta.id) || Obj.meta.hidden) {
if (ids.includes(Obj.meta.id) || Obj.meta.hidden || Obj.meta.develop) {
if (Obj.children) {
Obj.children = [...getRouteList(Obj.children)];
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论