Commit 7ce94f43 authored by XieZhiXiong's avatar XieZhiXiong

feat: 对接检索项接口

parent 276947a4
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-06-22 09:49:42 * @Date: 2021-06-22 09:49:42
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-02 18:10:29 * @LastEditTime: 2021-09-22 13:57:50
* @Description: 商家优惠劵查询 * @Description: 商家优惠劵查询
*/ */
import React, { useRef, useState } from 'react'; import React, { useRef, useState } from 'react';
...@@ -253,6 +253,27 @@ const MerchantCouponQuery: React.FC = () => { ...@@ -253,6 +253,27 @@ const MerchantCouponQuery: React.FC = () => {
} }
}; };
// 初始化高级筛选选项
const fetchSearchItems = async () => {
const res = await PublicApi.getMarketingCouponPageCondition();
if (res.code === 1000) {
const { data } = res;
const {
typeList = [],
getWayList = [],
statusList = [],
} = data;
return {
type: typeList.map(item => ({ label: item.name, value: item.value })).filter(item => item.value),
getWay: getWayList.map(item => ({ label: item.name, value: item.value })).filter(item => item.value),
status: statusList.map(item => ({ label: item.name, value: item.value })).filter(item => item.value),
};
}
return {};
};
return ( return (
<Card> <Card>
<StandardTable <StandardTable
...@@ -276,6 +297,10 @@ const MerchantCouponQuery: React.FC = () => { ...@@ -276,6 +297,10 @@ const MerchantCouponQuery: React.FC = () => {
'name', 'name',
FORM_FILTER_PATH, FORM_FILTER_PATH,
); );
useAsyncInitSelect(
['type', 'getWay', 'status'],
fetchSearchItems,
);
}} }}
schema={querySchema} schema={querySchema}
/> />
......
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