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

fix: 商家营销活动管理BUG修复

parent 1eee144e
......@@ -63,7 +63,11 @@ const Table: React.FC<Iprops> = (props: any) => {
return new Promise((resolve, reject) => {
if (!Array.isArray(fetch)) {
fetch({ ...params }).then(res => {
resolve(res.data)
const data = {
totalCount: res.data.totalCount,
data: res.data.data || []
}
resolve(data)
}).catch(error => {
console.warn(error)
})
......
import React from 'react';
import React, { useRef } from 'react';
import { history } from 'umi';
import { Button, Tag, Typography } from 'antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
......@@ -13,6 +13,7 @@ import { getMarketingPlatformActivityExecutePage, getMarketingPlatformActivityGe
const { onFormMount$ } = FormEffectHooks;
const Search = () => {
const ref = useRef<any>({})
const columns: ColumnType<any>[] = [
{
title: 'ID',
......@@ -91,40 +92,35 @@ const Search = () => {
return (
<TableLayout
reload={ref}
columns={columns}
effects="id"
fetch={getMarketingPlatformActivityExecutePage}
useStateEffects={useStateEffects}
schema={{
type: 'object',
type: "object",
properties: {
mageLayout: {
megalayout: {
type: "object",
"x-component": "flex-layout",
"x-component-props": {
rowStyle: {
justifyContent: 'space-between'
}
},
"x-component": "mega-layout",
properties: {
id: {
type: 'string',
'x-component': 'Search',
'x-rules': [{
pattern: PATTERN_MAPS.quantity,
message: '请输入活动ID',
}],
'x-component-props': {
placeholder: '活动ID'
placeholder: '活动ID',
align: "flex-left",
},
'x-rules': [
{
pattern: PATTERN_MAPS.quantity,
message: '请输入ID',
},
],
},
},
}
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'Flex-Layout',
type: "object",
"x-component": "flex-layout",
"x-component-props": {
rowStyle: {
justifyContent: "flex-start",
......@@ -135,62 +131,68 @@ const Search = () => {
}
},
properties: {
activityName: {
type: 'string',
'x-component-props': {
placeholder: '活动名称',
allowClear: true,
style: {
width: 160,
},
PRO_LAYOUT: {
type: "object",
"x-component": "mega-layout",
"x-mega-props": {
span: 5
},
},
'[startTime,endTime]': {
type: 'daterange',
'x-component-props': {
placeholder: ['开始时间', '结束时间'],
allowClear: true,
style: {
width: 240,
},
"x-component-props": {
inline: true
},
},
activityType: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '活动类型',
allowClear: true,
style: {
width: 160,
properties: {
activityName: {
type: 'string',
'x-component-props': {
placeholder: '活动名称',
style: {
width: 160,
},
},
},
},
},
outerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '外部状态',
allowClear: true,
style: {
width: 160,
'[startTime,endTime]': {
type: 'daterange',
'x-component-props': {
placeholder: ['开始时间', '结束时间'],
style: {
width: 240,
},
},
},
},
activityType: {
type: 'string',
'x-component-props': {
placeholder: '活动类型',
style: {
width: 160,
},
},
enum: [],
},
outerStatus: {
type: 'string',
'x-component-props': {
placeholder: '外部状态',
style: {
width: 160,
},
},
enum: [],
},
}
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
sumbit: {
"x-component": "Submit",
"x-mega-props": {
span: 1
},
},
},
},
},
"x-component-props": {
children: "查询"
}
}
}
}
}
}}
/>
);
......
......@@ -92,11 +92,11 @@ const DetialLayout = () => {
return
}
let { data } = res;
let externalLogStates: any = [];
let externalLogs: any = [];
if (data.outerTaskList) {
data.outerTaskList.forEach((item: any) => {
externalLogStates.push({
let interiorLogStates: any = [];
let interiorLogs: any = [];
if (data.innerTaskList) {
data.innerTaskList.forEach((item: any) => {
interiorLogStates.push({
state: item.step,
stateName: null,
isExecute: item.isExecute,
......@@ -104,11 +104,11 @@ const DetialLayout = () => {
roleName: item.roleName,
})
})
data.externalLogStates = externalLogStates;
data.interiorLogStates = interiorLogStates;
}
if (data.outerRecordDOList) {
data.outerRecordDOList.forEach((item: any, index: number) => {
externalLogs.push({
if (data.innerRecordDOList) {
data.innerRecordDOList.forEach((item: any, index: number) => {
interiorLogs.push({
operation: item.operate,
createTime: item.operateTime,
roleName: item.roleName,
......@@ -119,7 +119,7 @@ const DetialLayout = () => {
step: index,
})
})
data.externalLogs = externalLogs;
data.interiorLogs = interiorLogs;
}
if (data.activityType === ACTIVITY_TYPE_6) {
setRemind(remindLayout(data.activityType, data.activityDefined.giveType, data.activityDefined.giftType));
......
......@@ -9,9 +9,10 @@ import { FormEffectHooks } from '@formily/antd';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import {
getMarketingPlatformMerchantActivityGetActivityTypeList,
getMarketingPlatformMerchantActivityGetOuterStatusList,
getMarketingPlatformMerchantActivityGetInnerStatusList,
getMarketingPlatformMerchantActivityPage
} from '@/services/MarketingV2Api';
import { PATTERN_MAPS } from '@/constants/regExp';
const { onFormMount$ } = FormEffectHooks;
const MerchantMarketingSearch = () => {
......@@ -71,9 +72,9 @@ const MerchantMarketingSearch = () => {
console.warn(err)
})
/** 外部状态 */
getMarketingPlatformMerchantActivityGetOuterStatusList().then(res => {
getMarketingPlatformMerchantActivityGetInnerStatusList().then(res => {
const _enum = res.data.map((item) => { return { label: item.name, value: item.status } });
linkage.enum('outerStatus', _enum);
linkage.enum('innerStatus', _enum);
}).catch(err => {
console.warn(err)
})
......@@ -97,6 +98,10 @@ const MerchantMarketingSearch = () => {
id: {
type: 'string',
'x-component': 'Search',
'x-rules': [{
pattern: PATTERN_MAPS.quantity,
message: '请输入活动ID',
}],
'x-component-props': {
placeholder: '活动ID',
align: "flex-left",
......@@ -155,10 +160,10 @@ const MerchantMarketingSearch = () => {
},
enum: [],
},
outerStatus: {
innerStatus: {
type: 'string',
'x-component-props': {
placeholder: '部状态',
placeholder: '部状态',
style: {
width: 160,
},
......
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