Commit c41d636e authored by 前端-李俊鑫's avatar 前端-李俊鑫
parents 38078cce 64cf8dc0
......@@ -17,12 +17,12 @@ const RefactorRoutes = [
MemberManageRoutes,
transactionManageRoutes,
purchaseManageRoutes,
// orderManageRoutes,
orderManageRoutes,
// afterServiceRoutes,
// settlementManageRoutes,
// logisticsRoutes,
// productionNoticeRoutes,
// MarketingManageRoutes,
MarketingManageRoutes,
// pageCustomized,
// contentRoute,
// systemManageRoute,
......
This diff is collapsed.
......@@ -20,6 +20,7 @@ const SchemaDropDown = createVirtualBox('SchemaDropDown', Dropdown.Button);
const actions = createFormActions();
import advertisementSchema from './schema';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
const getData = async (params: any) => {
const res = await PublicApi.getManageContentNoticePage(params);
......@@ -114,110 +115,112 @@ const Announcements = () => {
}
return (
<Card>
<FilterTable
schema={advertisementSchema}
components={{
CustomSearch,
// SchemaFlexRowLayout,
// SchemaFlexColumnLayout,
SchemaDropDown,
Select,
Table,
TablePagination
}}
actions={actions}
expressionScope={{
goToCreate: () => {
history.push(`/content/announcements/add`)
},
reset: () => {
actions.setFieldValue('search');
actions.setFieldValue('columnType');
actions.setFieldValue('status'); // 状态
actions.setFieldValue('time');
resetPagination({current: 1})
handleSearch({current: 1})
},
search: (value) => {
resetPagination({current: 1})
handleSearch({title: value, current: 1 });
},
// eslint-disable-next-line react/display-name
renderStatus: (text, record) => {
const STATUSMAP = {
"1": "待上架",
"2": "已上架",
"3": "已下架"
}
return (
<span style={{...tagColorStyle[record.status], padding: '3px 5px'}}>
{STATUSMAP[record.status]}
</span>
)
},
toggleFilters: () => {
actions.setFieldState('FILTERS', state => {
const visible = !state.visible;
state.visible = visible;
actions.setFieldState('HIGHT_FILTER_BTN', (state) => {
//@ts-ignore
state.props['x-component-props'].children = (
<div>高级搜索 {visible ? <UpOutlined /> : <DownOutlined /> }</div>
)
})
});
},
// eslint-disable-next-line react/display-name
renderOperation: (val, record) => {
const status = ["", "上架", "下架", "上架"];
const canModify = [1, 3]
const menu = (
<Menu>
<Menu.Item>
<Link to={`/content/announcements/detail?id=${record.id}`}>
编辑
</Link>
</Menu.Item>
<Menu.Item onClick={() => handleDelete(record.id)}>
<a>
删除
</a>
</Menu.Item>
</Menu>
)
return (
<Space>
{/* 这里反向操作, 上架的对应的是下架, 待上架,下架对应的是上架 */}
<Popconfirm
title="确定要执行这个操作吗"
onConfirm={() => handleUpdateStatus(record.id, status[record.status] == '上架' ? 2 : 3)}
okText="是"
cancelText="否"
>
<a href="#">{status[record.status]}</a>
</Popconfirm>
{/* // 只有待上架, 已下架架才有 修改和删除 */}
{
canModify.includes(record.status)
? (
<Dropdown overlay={menu}>
<a>
更多 <DownOutlined />
</a>
</Dropdown>
)
: null
}
</Space>
)
},
}}
effects={announcementEffects()}
>
</FilterTable>
</Card>
<PageHeaderWrapper>
<Card>
<FilterTable
schema={advertisementSchema}
components={{
CustomSearch,
// SchemaFlexRowLayout,
// SchemaFlexColumnLayout,
SchemaDropDown,
Select,
Table,
TablePagination
}}
actions={actions}
expressionScope={{
goToCreate: () => {
history.push(`/content/announcements/add`)
},
reset: () => {
actions.setFieldValue('search');
actions.setFieldValue('columnType');
actions.setFieldValue('status'); // 状态
actions.setFieldValue('time');
resetPagination({current: 1})
handleSearch({current: 1})
},
search: (value) => {
resetPagination({current: 1})
handleSearch({title: value, current: 1 });
},
// eslint-disable-next-line react/display-name
renderStatus: (text, record) => {
const STATUSMAP = {
"1": "待上架",
"2": "已上架",
"3": "已下架"
}
return (
<span style={{...tagColorStyle[record.status], padding: '3px 5px'}}>
{STATUSMAP[record.status]}
</span>
)
},
toggleFilters: () => {
actions.setFieldState('FILTERS', state => {
const visible = !state.visible;
state.visible = visible;
actions.setFieldState('HIGHT_FILTER_BTN', (state) => {
//@ts-ignore
state.props['x-component-props'].children = (
<div>高级搜索 {visible ? <UpOutlined /> : <DownOutlined /> }</div>
)
})
});
},
// eslint-disable-next-line react/display-name
renderOperation: (val, record) => {
const status = ["", "上架", "下架", "上架"];
const canModify = [1, 3]
const menu = (
<Menu>
<Menu.Item>
<Link to={`/content/announcements/detail?id=${record.id}`}>
编辑
</Link>
</Menu.Item>
<Menu.Item onClick={() => handleDelete(record.id)}>
<a>
删除
</a>
</Menu.Item>
</Menu>
)
return (
<Space>
{/* 这里反向操作, 上架的对应的是下架, 待上架,下架对应的是上架 */}
<Popconfirm
title="确定要执行这个操作吗"
onConfirm={() => handleUpdateStatus(record.id, status[record.status] == '上架' ? 2 : 3)}
okText="是"
cancelText="否"
>
<a href="#">{status[record.status]}</a>
</Popconfirm>
{/* // 只有待上架, 已下架架才有 修改和删除 */}
{
canModify.includes(record.status)
? (
<Dropdown overlay={menu}>
<a>
更多 <DownOutlined />
</a>
</Dropdown>
)
: null
}
</Space>
)
},
}}
effects={announcementEffects()}
>
</FilterTable>
</Card>
</PageHeaderWrapper>
)
}
......
import React, { useState, useEffect, useRef } from 'react'
import { Card, Space, Row, Col, List, Skeleton, Badge } from 'antd'
import React, { useState, useEffect, useRef } from 'react';
import { Card, Space, Row, Col, List, Skeleton, Badge } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import TodayAdd from './components/TodayAdd';
// import OrderStatistics from './components/OrderStatistics';
import StatisticsColumn from './components/StatisticsColumn';
import Settlement from './components/Settlement';
import DataCenter from './components/DataCenter'
import DataCenter from './components/DataCenter';
import RiskCenter from './components/RiseCenter';
import MemberStatisticsContainer from './components/MemberStatistics/MemberStatisticsContainer';
import OrderContainer from './components/Order';
......@@ -14,7 +15,7 @@ const Home: React.FC<{}> = () => {
return (
// 全局统计
<div>
<PageHeaderWrapper>
<Space direction="vertical" style={{width:'100%'}}>
<TodayAdd />
</Space>
......@@ -46,8 +47,8 @@ const Home: React.FC<{}> = () => {
<Space direction="vertical" style={{width:'100%'}} >
<RiskCenter />
</Space>
</div>
</PageHeaderWrapper>
);
}
};
export default Home
export default Home;
......@@ -275,25 +275,29 @@ function useGetLayout() {
};
const childNodesKeys: string[] = [];
if ( childrenData.length > 0 && _row.key !== 'suggestProduct') {
const formatedData = formatData[_row.key]?.(childrenData);
const requestData = await service[_row.key]?.(formatedData, { ctlType: 'none' });
const afterRequestFormatedData = afterRequestFormat[_row.key]?.(requestData);
afterRequestFormatedData?.forEach((_item, _index) => {
const keyNum = `${startKey}-${_index + 1}`;
childNodesKeys.push(keyNum);
const sonConfig = {
componentName: `${CHILD_COMPONENT_NAME[_row.key]}`,
title: _item?.productName || _item.name,
props: {
..._item,
},
otherProps: {
type: `${_row.key}Item`
},
childNodes: []
};
pageConfig[keyNum] = sonConfig;
});
const formatedData = formatData[_row.key]?.(childrenData.filter(Boolean));
const length = typeof formatedData.ids !== 'undefined' ? formatedData?.ids?.length : formatedData?.couponList.length;
if (length > 0) {
const requestData = await service[_row.key]?.(formatedData, { ctlType: 'none' });
const afterRequestFormatedData = afterRequestFormat[_row.key]?.(requestData);
afterRequestFormatedData?.forEach((_item, _index) => {
const keyNum = `${startKey}-${_index + 1}`;
childNodesKeys.push(keyNum);
const sonConfig = {
componentName: `${CHILD_COMPONENT_NAME[_row.key]}`,
title: _item?.productName || _item.name,
props: {
..._item,
},
otherProps: {
type: `${_row.key}Item`
},
childNodes: []
};
pageConfig[keyNum] = sonConfig;
});
}
} else if (_row.key === 'suggestProduct') {
// const suggestDataKeys: string[] = [];
let _index = 0;
......
......@@ -27,7 +27,7 @@
"specialOffer":{
"sort":5,
"props": {
"theme": 1,
"theme": 0,
"visible": true,
"title":"特价促销",
"childrenData": []
......@@ -36,7 +36,7 @@
"plummet":{
"sort":4,
"props": {
"theme":1,
"theme":0,
"visible": false,
"title":"直降促销",
"childrenData": []
......@@ -54,7 +54,7 @@
"fullQuantitySub":{
"sort":7,
"props": {
"theme":0,
"theme":1,
"visible": false,
"title":"满量促销--满量减",
"childrenData": []
......@@ -63,7 +63,7 @@
"fullQuantityDiscount":{
"sort":8,
"props": {
"theme":0,
"theme":1,
"visible": false,
"title":"满量促销--满量折",
"childrenData": []
......@@ -72,7 +72,7 @@
"fullMoneySub":{
"sort":9,
"props": {
"theme":0,
"theme":1,
"visible": false,
"title":"满额促销--满额减",
"childrenData": []
......@@ -81,7 +81,7 @@
"fullMoneyDiscount":{
"sort":10,
"props": {
"theme":0,
"theme":1,
"visible": false,
"title":"满额促销--满额折",
"childrenData": []
......
......@@ -5,6 +5,7 @@ import differenceWith from 'lodash/differenceWith';
import { createFormActions } from '@formily/antd';
import { unstable_batchedUpdates as batchedUpdates } from 'react-dom';
import { ColumnsType } from 'antd/es/table';
import moment from 'moment';
import schema from './schema';
import styles from './activityProductDrawer.less';
import ActivityItem from './activityItem';
......@@ -13,9 +14,9 @@ import { GetMarketingAdornPlatformActivityListAdornResponseDetail } from '@/serv
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import NiceForm from '@/components/NiceForm';
import moment from 'moment';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { PublicApi } from '@/services/api';
import omit from 'lodash/omit';
const actions = createFormActions();
type GoodListType = GetMarketingAdornPlatformActivityListAdornResponseDetail["goodsList"]
......@@ -30,6 +31,8 @@ interface Iprops {
mode?: 'radio' | 'checked',
/** mode === 'radio'的时候, 禁用的的活动商品 [`${id}_${activityId}`] */
disabledList?: string[],
/** 去除某些高级筛选 */
ignoresFilters?: string[],
}
type SubmitType = {
......@@ -100,18 +103,23 @@ const columns: ColumnsType<GoodListType[0]> = [
];
const ActivityProductDrawer: React.FC<Iprops> = (props: Iprops) => {
const { visible, onCancel, fetchData = null, onOk, products = [], activityImage, mode = 'checked', disabledList = [] } = props;
const { visible, onCancel, fetchData = null, onOk, products = [], activityImage, mode = 'checked', disabledList = [], ignoresFilters = [] } = props;
const [current, setPage] = useState<number>(1);
const [currentPageSize, setPageSize] = useState<number>(10);
const [dataSource, setDataSource] = useState<GetMarketingAdornPlatformActivityListAdornResponseDetail[]>([]);
const [totalCount, setTotalCount] = useState<number>(0);
const [selectedKey, setSelectKey] = useState<number | null>(null);
const [selectedActivityProductList, setSelectedActivityProductList] = useState<GoodListType>();
const [selectedActivityProductList, setSelectedActivityProductList] = useState<GoodListType>([]);
const [checkedProduct, setCheckedProduct] = useState<GoodListType>([]);
const [loading, setLoading] = useState<boolean>(false);
const selectedRowKeys = useMemo(() => checkedProduct.map((_item) => `${_item.activityId!}-${_item.id!}`), [checkedProduct]);
const ignoredSchema = useMemo(() => {
const ignoreData = ignoresFilters.map((_item) => `properties.megaLayout.properties.FORM_FILTER_PATH.properties.${_item}`);
return omit(schema, ignoreData);
}, [ignoresFilters]);
const fetchList = useCallback(async (params: any) => {
if (fetchData === null) {
return;
......@@ -123,6 +131,8 @@ const ActivityProductDrawer: React.FC<Iprops> = (props: Iprops) => {
setLoading(false);
setDataSource(data.data);
setTotalCount(data.totalCount);
setSelectedActivityProductList([]);
setSelectKey(null);
});
}
}, [fetchData]);
......@@ -181,7 +191,6 @@ const ActivityProductDrawer: React.FC<Iprops> = (props: Iprops) => {
if (code !== 1000) {
return [];
}
console.log(data);
return data;
};
......@@ -245,7 +254,7 @@ const ActivityProductDrawer: React.FC<Iprops> = (props: Iprops) => {
<div className={styles.container}>
<div className={styles.form}>
<NiceForm
schema={schema}
schema={ignoredSchema}
actions={actions}
onReset={onReset}
onSubmit={onSubmit}
......
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
const schema: ISchema = {
type: 'object',
......@@ -46,13 +46,14 @@ const schema: ISchema = {
},
type: 'daterange',
'x-component-props': {
placeholder: ['活动开始时间', "活动结束时间"]
placeholder: ['活动开始时间', "活动结束时间"],
showTime: true,
}
},
productName: {
type: 'string',
"x-component-props": {
placeholder: '活动名称'
placeholder: '商品名称'
}
},
merchantName: {
......
......@@ -40,9 +40,9 @@ const FormilyActivityProduct: React.FC<Iprops> & { isFieldComponent: boolean } =
const { value, mutators } = props;
const { shopId } = useContext(ShopContext) || {};
const componentProps = props.props?.['x-component-props'] || {};
const activityImage = componentProps.activityImage || activityImageSvg;
const disabledKeys = componentProps.disabledKeys || [];
const ignoresFilters = componentProps?.activityType ? ['activityType'] : [];
const { state: productVisible, toggle: setProductVisible } = useToggle();
const cacheProductList = useMemo(() => [{ ...value }], [value]);
......@@ -104,7 +104,8 @@ const FormilyActivityProduct: React.FC<Iprops> & { isFieldComponent: boolean } =
/>
<ActivityProductDrawer
activityImage={activityImage}
products={cacheProductList}
ignoresFilters={ignoresFilters}
products={cacheProductList as any}
onOk={onOk}
fetchData={fetchData}
visible={productVisible}
......
......@@ -5,6 +5,7 @@ import { unstable_batchedUpdates as batchedUpdates } from 'react-dom';
import { useDebounce } from '@umijs/hooks';
import { Link } from 'umi';
import moment from 'moment';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import ActivityItem from './components/ActivityItem';
import styles from './index.less';
import SearchPannel from './components/SearchPannel';
......@@ -62,14 +63,14 @@ const ActivePage = () => {
};
useEffect(() => {
getData({...debouncedValue, name: searchInput});
getData({...debouncedValue, name: searchInput} as unknown as GetTemplateWebActivityPagePageRequest );
}, [debouncedValue]);
const handleRemove = async (id: number) => {
const { data, code } = await PublicApi.postTemplateWebActivityPageDelete({id});
if (code === 1000) {
getData({...debouncedValue, name: searchInput});
getData({...debouncedValue, name: searchInput} as unknown as GetTemplateWebActivityPagePageRequest );
}
};
......@@ -79,7 +80,7 @@ const ActivePage = () => {
status,
});
if (code === 1000) {
getData({...debouncedValue, name: searchInput});
getData({...debouncedValue, name: searchInput} as unknown as GetTemplateWebActivityPagePageRequest );
}
};
......@@ -88,60 +89,62 @@ const ActivePage = () => {
};
const handleSearch = () => {
getData({...debouncedValue, name: searchInput});
getData({...debouncedValue, name: searchInput} as unknown as GetTemplateWebActivityPagePageRequest );
};
return (
<div className={styles.page}>
<div className={styles.searchPannel}>
<SearchPannel onFormValueChange={onSearchChange} />
</div>
<div className={styles.tablePanenl}>
<div className={styles.header}>
<div className={styles.search}>
<Search placeholder="搜索" onChange={(e) => onChange(e.target.value)} onSearch={handleSearch}/>
</div>
<Link to='/marketingManage/marketing/activitiesManagement/add'>
<Button icon={<PlusOutlined />} type="primary">新增</Button>
</Link>
<PageHeaderWrapper>
<div className={styles.page}>
<div className={styles.searchPannel}>
<SearchPannel onFormValueChange={onSearchChange} />
</div>
<Spin spinning={loading} wrapperClassName={styles.body}>
<div className={styles.table}>
{
dataSource.map((_item, key) => {
return (
<div className={styles.tableItem} key={key} >
<ActivityItem
id={_item.id}
templatePicUrl={_item.templatePicUrl}
title={_item.name}
templateName={_item.templateName}
statusName={_item.statusName}
shopName={_item.shopName}
startTime={_item.startTime}
endTime={_item.endTime}
environment={_item.environment}
status={_item.status}
onRemove={handleRemove}
onChangeStatus={onChangeStatus}
/>
</div>
);
})
}
<div className={styles.tablePanenl}>
<div className={styles.header}>
<div className={styles.search}>
<Search placeholder="搜索" onChange={(e) => onChange(e.target.value)} onSearch={handleSearch}/>
</div>
<Link to='/marketingManage/marketing/activitiesManagement/add'>
<Button icon={<PlusOutlined />} type="primary">新增</Button>
</Link>
</div>
<div className={styles.footer}>
{
total > 0 && (
<div className={styles.pagination}>
<Pagination showQuickJumper total={total} pageSize={currentPageSize} current={currentPage} onChange={onPaginationChange} />
</div>
) || null
}
</div>
</Spin>
<Spin spinning={loading} wrapperClassName={styles.body}>
<div className={styles.table}>
{
dataSource.map((_item, key) => {
return (
<div className={styles.tableItem} key={key} >
<ActivityItem
id={_item.id}
templatePicUrl={_item.templatePicUrl}
title={_item.name}
templateName={_item.templateName}
statusName={_item.statusName}
shopName={_item.shopName}
startTime={_item.startTime}
endTime={_item.endTime}
environment={_item.environment}
status={_item.status}
onRemove={handleRemove}
onChangeStatus={onChangeStatus}
/>
</div>
);
})
}
</div>
<div className={styles.footer}>
{
total > 0 && (
<div className={styles.pagination}>
<Pagination showQuickJumper total={total} pageSize={currentPageSize} current={currentPage} onChange={onPaginationChange} />
</div>
) || null
}
</div>
</Spin>
</div>
</div>
</div>
</PageHeaderWrapper>
);
};
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-22 15:34:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-22 16:44:56
* @LastEditTime: 2021-09-30 17:11:02
* @Description: 基本信息
*/
import React from 'react';
......@@ -91,7 +91,7 @@ const CouponBacisInfo: React.FC<PropsType> = (props: PropsType) => {
},
{
title: '活动名称',
value: '全品类通用优惠券',
value: dataSource.name,
},
{
title: '券面额',
......
......@@ -8,10 +8,10 @@
import React, { useRef } from 'react';
import { Modal } from 'antd';
import ReasonForm, { ReasonValueType, ReasonFormRefHandle } from '../ReasonForm';
import EditForm, { EditSubmitValueType, EditFormRefHandle } from '../EditForm';
import EditForm, { EditSubmitValueType, EditFormRefHandle, EditValueType } from '../EditForm';
export type ActionModalType = 'stop' | 'cancel' | 'startUp' | 'edit';
export type ActionModalValueType = { id: number };
export type ActionModalValueType = { id: number } & Partial<EditValueType>;
interface IProps {
/**
......@@ -96,6 +96,7 @@ const ActionModal: React.FC<IProps> = (props) => {
render: () => (
<EditForm
onSubmit={handleEditSubmit}
value={value as EditValueType}
ref={formRef}
/>
),
......
......@@ -40,6 +40,10 @@ interface IProps {
* 提交触发事件
*/
onSubmit: (values: EditSubmitValueType) => void,
/**
* 值
*/
value: EditValueType,
}
export interface EditFormRefHandle {
......@@ -70,6 +74,7 @@ const EditForm: React.ForwardRefRenderFunction<EditFormRefHandle, IProps> = ((pr
components={{
DatePicker,
}}
value={value}
effects={($, { setFieldState }) => {
}}
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-22 09:49:42
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-09-22 14:09:45
* @LastEditTime: 2021-09-30 17:07:20
* @Description: 商家优惠劵查询
*/
import React, { useRef, useState } from 'react';
......@@ -179,7 +179,7 @@ const PlatformCouponQuery: React.FC = () => {
{record.update && (
<Button
type="link"
onClick={() => handleShowActionModal('edit', { id: record.id })}
onClick={() => handleShowActionModal('edit', { id: record.id, releaseTimeStart: moment(record.releaseTimeStart).format('YYYY-MM-DD HH:mm:ss'), releaseTimeEnd: moment(record.releaseTimeEnd).format('YYYY-MM-DD HH:mm:ss'), quantity: `${record.quantity}` })}
>
修改
</Button>
......
......@@ -2,10 +2,11 @@
* @Author: XieZhiXiong
* @Date: 2021-06-24 14:04:16
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-09-27 10:08:44
* @LastEditTime: 2021-09-30 16:39:11
* @Description:
*/
import { FormEffectHooks, FormPath, IFormActions } from '@formily/antd';
import moment from 'moment';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import {
MERCHANT_COUPON_TYPE_UNIVERSAL,
......@@ -230,12 +231,80 @@ export const useBusinessEffects = (context, actions: IFormActions) => {
onFieldInputChange$('receiveCondition.conditionGetTotal').subscribe(state => {
const { value } = state;
const conditionGetDayValue = getFieldValue('receiveCondition.conditionGetDay'); // 每会员ID总共可领取;
if (+value < +conditionGetDayValue) {
setFieldState('receiveCondition.conditionGetTotal', fieldState => {
FormPath.setIn(fieldState, 'errors', '每会员ID总共可领取必须大于每日可领取');
const quantityValue = getFieldValue('quantity'); // 每会员ID总共可领取
if (value && quantityValue) {
if (+value > +quantityValue) {
setFieldState('receiveCondition.conditionGetTotal', fieldState => {
FormPath.setIn(fieldState, 'errors', '每会员ID总共可领取数量应该小于等于发券数量');
});
} else {
actions.clearErrors('receiveCondition.conditionGetTotal');
}
}
if (value && conditionGetDayValue) {
if (+value < +conditionGetDayValue) {
setFieldState('receiveCondition.conditionGetTotal', fieldState => {
FormPath.setIn(fieldState, 'errors', '每会员ID总共可领取必须大于每日可领取');
});
} else {
actions.clearErrors('receiveCondition.conditionGetTotal');
}
}
});
// 领(发)券起始时间
onFieldValueChange$('[releaseTimeStart, releaseTimeEnd]').subscribe(state => {
const { value } = state;
const releaseTimeStartValue = value?.[0];
const effectiveTime = getFieldValue('[effectiveTimeStart, effectiveTimeEnd]'); // 券有效期
const effectiveTimeStartValue = effectiveTime?.[0];
if (
releaseTimeStartValue
&& effectiveTimeStartValue
&& moment(releaseTimeStartValue) > moment(effectiveTimeStartValue)
) {
setFieldState('[releaseTimeStart, releaseTimeEnd]', fieldState => {
FormPath.setIn(fieldState, 'errors', '领(发)券起始时间应该小于券有效期起始时间');
});
} else {
actions.clearErrors('[releaseTimeStart, releaseTimeEnd]');
}
});
// 券有效期始时间
onFieldValueChange$('[effectiveTimeStart, effectiveTimeEnd]').subscribe(state => {
const { value } = state;
const effectiveTimeStartValue = value?.[0];
const releaseTime = getFieldValue('[releaseTimeStart, releaseTimeEnd]'); // 券有效期
const releaseTimeStartValue = releaseTime?.[0];
if (
effectiveTimeStartValue
&& releaseTimeStartValue
&& moment(effectiveTimeStartValue) < moment(releaseTimeStartValue)
) {
setFieldState('[effectiveTimeStart, effectiveTimeEnd]', fieldState => {
FormPath.setIn(fieldState, 'errors', '券有效期起始时间应该大于等于领(发)券起始时间');
});
} else {
actions.clearErrors('[effectiveTimeStart, effectiveTimeEnd]');
}
});
// 发券数量
onFieldValueChange$('quantity').subscribe(state => {
const { value } = state;
const conditionGetTotalValue = getFieldValue('receiveCondition.conditionGetTotal'); // 每会员ID总共可领取
if (value && conditionGetTotalValue && +value <= +conditionGetTotalValue) {
setFieldState('quantity', fieldState => {
FormPath.setIn(fieldState, 'errors', '发券数量应该大于等于每会员ID总共可领取数量');
});
} else {
actions.clearErrors('receiveCondition.conditionGetTotal');
actions.clearErrors('quantity');
}
});
}
\ No newline at end of file
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const listSearchSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
TOPLAYOUT: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
},
product: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
tip: '输入 交易商品 进行搜索',
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'Flex-Layout',
'x-component-props': {
colStyle: {
marginLeft: 20,
},
},
properties: {
subMemberName: {
type: 'string',
default: undefined,
'x-component-props': {
placeholder: '被评价方',
allowClear: true,
style: {
width: 160,
},
},
},
memberName: {
type: 'string',
default: undefined,
'x-component-props': {
placeholder: '评价方',
allowClear: true,
style: {
width: 160,
},
},
},
star: {
type: 'string',
default: undefined,
enum: [
{
label: '一星',
value: 1,
},
{
label: '二星',
value: 2,
},
{
label: '三星',
value: 3,
},
{
label: '四星',
value: 4,
},
{
label: '五星',
value: 5,
},
],
'x-component-props': {
placeholder: '评价星级(全部)',
allowClear: true,
style: {
width: 160,
},
},
},
'[createTimeStart, createTimeEnd]': {
type: 'string',
default: '',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '评价时间(全部)',
allowClear: true,
style: {
width: 160,
},
},
},
'[dealTimeStart, dealTimeEnd]': {
type: 'string',
default: '',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '交易时间(全部)',
allowClear: true,
style: {
width: 160,
},
},
},
'comment': {
type: 'string',
default: '',
'x-component-props': {
placeholder: '评价内容',
allowClear: true,
style: {
width: 160,
},
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const listSearchSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
TOPLAYOUT: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
},
product: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
tip: '输入 交易商品 进行搜索',
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'Flex-Layout',
'x-component-props': {
colStyle: {
marginLeft: 20,
},
},
properties: {
subMemberName: {
type: 'string',
default: undefined,
'x-component-props': {
placeholder: '被评价方',
allowClear: true,
style: {
width: 160,
},
},
},
memberName: {
type: 'string',
default: undefined,
'x-component-props': {
placeholder: '评价方',
allowClear: true,
style: {
width: 160,
},
},
},
star: {
type: 'string',
default: undefined,
enum: [
{
label: '一星',
value: 1,
},
{
label: '二星',
value: 2,
},
{
label: '三星',
value: 3,
},
{
label: '四星',
value: 4,
},
{
label: '五星',
value: 5,
},
],
'x-component-props': {
placeholder: '评价星级(全部)',
allowClear: true,
style: {
width: 160,
},
},
},
'[createTimeStart, createTimeEnd]': {
type: 'string',
default: '',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '评价时间(全部)',
allowClear: true,
style: {
width: 160,
},
},
},
'[dealTimeStart, dealTimeEnd]': {
type: 'string',
default: '',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '交易时间(全部)',
allowClear: true,
style: {
width: 160,
},
},
},
'comment': {
type: 'string',
default: '',
'x-component-props': {
placeholder: '评价内容',
allowClear: true,
style: {
width: 160,
},
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
\ No newline at end of file
@import '../../../../../../../global/styles/utils.less';
@import '../../../../../../../global/styles/index.less';
.shelves {
&-title {
......
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const listSearchSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
memberName: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
tip: '输入 会员名称 进行搜索',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 6,
},
properties: {
memberTypeId: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '会员类型(全部)',
allowClear: true,
},
},
roleId: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '会员角色(全部)',
allowClear: true,
},
},
level: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '会员等级(全部)',
allowClear: true,
},
},
avgStar: {
type: 'string',
default: undefined,
enum: [
{
label: '一星',
value: 1,
},
{
label: '二星',
value: 2,
},
{
label: '三星',
value: 3,
},
{
label: '四星',
value: 4,
},
{
label: '五星',
value: 5,
},
],
'x-component-props': {
placeholder: '交易满意度(全部)',
allowClear: true,
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const listSearchSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
memberName: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
align: 'flex-left',
tip: '输入 会员名称 进行搜索',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 6,
},
properties: {
memberTypeId: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '会员类型(全部)',
allowClear: true,
},
},
roleId: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '会员角色(全部)',
allowClear: true,
},
},
level: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '会员等级(全部)',
allowClear: true,
},
},
avgStar: {
type: 'string',
default: undefined,
enum: [
{
label: '一星',
value: 1,
},
{
label: '二星',
value: 2,
},
{
label: '三星',
value: 3,
},
{
label: '四星',
value: 4,
},
{
label: '五星',
value: 5,
},
],
'x-component-props': {
placeholder: '交易满意度(全部)',
allowClear: true,
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
\ No newline at end of file
......@@ -30,6 +30,7 @@ interface Iprops {
},
}
/** 销量排行 */
const FormilyCommodity: React.FC<Iprops> & { isFieldComponent: boolean } = (props: Iprops) => {
const { value, mutators } = props;
/** 1 级分类 id */
......
......@@ -6,6 +6,7 @@ import { Product } from '@/pages/marketingManage/marketing/marketingActivitiesMa
import ActivityProductDrawer from '@/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/fixtures/components/ActivityAreaSetting/activityProductDrawer';
import { PublicApi } from '@/services/api';
import { GetMarketingAdornPlatformActivityListAdornRequest } from '@/services/MaketingV2Api';
import activityImage from '@/asserts/activity/ActivityImage.svg';
interface Iprops {
value: {
......@@ -29,16 +30,16 @@ interface Iprops {
},
}
/** 秒杀 */
const FormilyActivityProduct: React.FC<Iprops> & { isFieldComponent: boolean } = (props: Iprops) => {
const { value, mutators } = props;
/** 1 级分类 id */
const { activeKey } = useSelector<any, "activeKey" >(['activeKey']);
const fixtureContext = useContext(context);
console.log(value);
const ignoresFilters = ['activityType'];
const componentProps = props.props?.['x-component-props'] || {};
const activityImage = "logo.png";
const { state: productVisible, toggle: setProductVisible } = useToggle();
/** @tofixed activityId */
const cacheProductList = useMemo(() => [{ ...value }], [value]);
......@@ -74,12 +75,14 @@ const FormilyActivityProduct: React.FC<Iprops> & { isFieldComponent: boolean } =
return await PublicApi.getMarketingAdornPlatformActivityListAdorn(isWithActivityType as any);
};
return (
<div style={{ position: 'relative' }}>
<Product onEdit={onEdit} {...productProps} isWithLabels={componentProps.isWithLabels || false} />
<ActivityProductDrawer
ignoresFilters={ignoresFilters}
activityImage={activityImage}
products={cacheProductList}
products={cacheProductList as any}
onOk={onOk}
fetchData={fetchData}
visible={productVisible}
......
.shop_center_template {
padding: 24px;
.add_card {
display: flex;
height: 100%;
......@@ -33,4 +33,4 @@
}
}
}
\ No newline at end of file
}
......@@ -220,8 +220,8 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) =>
return (
<div className={styles['banner-record-shop']}>
<img src={record?.logo} />
<Tooltip title={record?.memberName}>
<span>{record?.memberName}</span>
<Tooltip title={record?.name || record?.memberName}>
<span>{record?.name || record?.memberName}</span>
</Tooltip>
</div>
);
......
......@@ -188,8 +188,8 @@ const CardNavItem: React.FC<CardNavItemProps> = (props: CardNavItemProps) => {
return (
<div className={styles['banner-record-shop']}>
<img src={record?.logo} />
<Tooltip title={record?.memberName}>
<span>{record?.memberName}</span>
<Tooltip title={record?.name || record?.memberName}>
<span>{record?.name || record?.memberName}</span>
</Tooltip>
</div>
)
......
.shop_center_template {
padding: 24px;
.add_card {
display: flex;
height: 100%;
......@@ -33,4 +33,4 @@
}
}
}
\ No newline at end of file
}
.shop_center_template {
padding: 24px;
.add_card {
display: flex;
......@@ -33,4 +34,4 @@
}
}
}
\ No newline at end of file
}
.shop_center_template {
padding: 24px;
.add_card {
display: flex;
......@@ -33,4 +34,4 @@
}
}
}
\ No newline at end of file
}
......@@ -144,7 +144,7 @@ const PropertyValue: React.FC<{}> = () => {
record.isEnable ? '' : <>
<Button
type='link'
onClick={() => history.push(`/classAndProperty/propertyValue/edit?attrId=${selectKey}&attrName=${selectNode._title}&attrValueId=${record.id}`)}
onClick={() => history.push(`/productManage/classAndProperty/propertyValue/edit?attrId=${selectKey}&attrName=${selectNode._title}&attrValueId=${record.id}`)}
>
编辑
</Button>
......
......@@ -4,8 +4,8 @@ import { BidDetailContext } from '@/pages/purchaseManage/procurement/_public/bid
import { useBidDetail } from '@/pages/purchaseManage/procurement/_public/bid/effects/useBidDetail';
import BidDetailHeader from '@/pages/purchaseManage/procurement/components/bidDetailHeader';
import BidDetailSection from '@/pages/purchaseManage/procurement/components/bidDetailSection';
import OrderDetailWrapper from '@/pages/orderManage/orderSystem/components/OrderDetailWrapper';
import { BidOuterWorkState } from '@/constants';
import OrderDetailWrapper from '@/pages/orderManage/orderSystem/components/OrderDetailWrapper';
const CallForBidsSearchDetail: React.FC = () => {
const { formContext, id } = useBidDetail({ type: 'callForBid' })
......
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