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

🐞 fix(商家营销活动审核): 修改批量审核接口

parent 7440e1c0
...@@ -7,7 +7,7 @@ export interface ShopInfo { ...@@ -7,7 +7,7 @@ export interface ShopInfo {
describe: string; describe: string;
state: number; state: number;
url: string; url: string;
isDefault: number; isDefault?: any;
} }
export interface OrderMode { export interface OrderMode {
...@@ -28,7 +28,7 @@ export interface SiteInfo { ...@@ -28,7 +28,7 @@ export interface SiteInfo {
name: string; name: string;
logo: string; logo: string;
siteUrl: string; siteUrl: string;
symbol: string; symbol?: any;
} }
export interface Site { export interface Site {
......
...@@ -15,6 +15,7 @@ const { onFormMount$ } = FormEffectHooks; ...@@ -15,6 +15,7 @@ const { onFormMount$ } = FormEffectHooks;
const WaitAuditMerchantMarketing = () => { const WaitAuditMerchantMarketing = () => {
const ref = useRef<any>({}); const ref = useRef<any>({});
const [rowkeys, setRowKeys] = useState<Array<number>>([]); const [rowkeys, setRowKeys] = useState<Array<number>>([]);
const [submitLoading, setSubmitLoading] = useState<boolean>(false);
const useStateEffects = () => { const useStateEffects = () => {
const linkage = useLinkageUtils(); const linkage = useLinkageUtils();
onFormMount$().subscribe(() => { onFormMount$().subscribe(() => {
...@@ -28,11 +29,26 @@ const WaitAuditMerchantMarketing = () => { ...@@ -28,11 +29,26 @@ const WaitAuditMerchantMarketing = () => {
}) })
} }
const fetchSubmitBatch = async () => {
const res = await PublicApi.postMarketingPlatformMerchantActivityExamineBatch({ ids: rowkeys });
setSubmitLoading(true)
if (res.code !== 1000) {
setSubmitLoading(false)
return
}
setSubmitLoading(false)
ref.current.reload();
setRowKeys([])
}
/* 操作按钮 */
const controllerBtns = ( const controllerBtns = (
<Row> <Row>
<Col span={6}> <Col span={6}>
<Button <Button
disabled={rowkeys.length === 0} disabled={rowkeys.length === 0}
loading={submitLoading}
onClick={() => fetchSubmitBatch()}
> >
批量提交审核 批量提交审核
</Button> </Button>
...@@ -98,6 +114,7 @@ const WaitAuditMerchantMarketing = () => { ...@@ -98,6 +114,7 @@ const WaitAuditMerchantMarketing = () => {
effects="id" effects="id"
fetch={PublicApi.getMarketingPlatformMerchantActivityPageTobeExam} fetch={PublicApi.getMarketingPlatformMerchantActivityPageTobeExam}
fetchRowkeys={(e) => setRowKeys(e)} fetchRowkeys={(e) => setRowKeys(e)}
controllerBtns={controllerBtns}
schema={{ schema={{
type: 'object', type: 'object',
properties: { properties: {
...@@ -109,11 +126,8 @@ const WaitAuditMerchantMarketing = () => { ...@@ -109,11 +126,8 @@ const WaitAuditMerchantMarketing = () => {
}, },
properties: { properties: {
ctl: { ctl: {
type: 'object', type: "object",
"x-component": "Children", "x-component": "controllerBtns",
"x-component-props": {
children: controllerBtns
}
}, },
id: { id: {
type: 'string', type: 'string',
......
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