Commit 45580020 authored by rainbowmorel@163.com's avatar rainbowmorel@163.com

Merge branch 'v2-220418' into 20418order

parents 192106ee 05aac1d5
......@@ -975,4 +975,64 @@ export default {
'member.management.assigned.query.batchReceive': 'Batch Receive',
'member.memberQuery.suggest.common.schema.eventTime.required': 'Please fill in the event time',
// 会员等级管理
'member.memberLevel.levelId': 'LevelId',
'member.memberLevel.level': 'Level',
'member.memberLevel.level.placeholder': 'Please choose',
'member.memberLevel.levelTag': 'Level Tag',
'member.memberLevel.levelTag.placeholder': 'Search',
'member.memberLevel.levelTag.tip': 'Enter level tag to search',
'member.memberLevel.levelTag.tip2': 'Please input, up to 16 characters, 8 Chinese characters',
'member.memberLevel.levelTag.required': 'Please enter level tag',
'member.memberLevel.levelTypeName': 'Level Type',
'member.memberLevel.levelTypeName.placeholder': 'Please choose',
'member.memberLevel.scoreTag': 'Score Tag',
'member.memberLevel.scoreTag.placeholder': 'Please input, up to 16 characters, 8 Chinese characters',
'member.memberLevel.scoreTag.required': 'Please enter an upgrade point label',
'member.memberLevel.roleName': 'Role Name',
'member.memberLevel.roleName.placeholder': 'Role Name',
'member.memberLevel.roleTypeName': 'Role Type',
'member.memberLevel.memberTypeName': 'Member Type',
'member.memberLevel.point': 'Upgrade Point',
'member.memberLevel.point.required': 'Please enter the upgrade point',
'member.memberLevel.point.legal': 'Please enter an integer',
'member.memberLevel.status': 'Status',
'member.memberLevel.status.changing': 'Changing, Please wait...',
'member.memberLevel.add': 'Add',
'member.memberLevel.add.adding': 'Adding, please wait...',
'member.memberLevel.modify': 'Modify',
'member.memberLevel.modify.modifying': 'Editing, please wait...',
'member.memberLevel.delete': 'Delete',
'member.memberLevel.delete.deleting': 'Deleting, Please wait...',
'member.memberLevel.delete.confirm.title': 'Are you sure you want to delete this level?',
'member.memberLevel.setRights': 'Set up rights and upgrade point',
'member.memberLevel.rebuild': 'Initialize level and rights',
'member.memberLevel.rebuild.confirm.title': 'Tip',
'member.memberLevel.rebuild.confirm.content': 'Clicking "OK" will initialize the membership level of all platform members to the initial level, and enjoy all the rights and interests of this level!',
'member.memberLevel.basic': 'Basic Information',
'member.memberLevel.applicableMemberRoles': 'Applicable member roles',
'member.memberLevel.remark': 'Level description',
'member.memberLevel.remark.placeholder': 'Enter your content here, up to 80 characters, 40 Chinese characters',
'member.memberLevel.add.level': 'Add level',
'member.memberLevel.modify.level': 'Edit Level',
'member.memberLevel.roleId': 'Role ID',
'member.memberLevel.role.choose': 'Choose Roles',
'member.memberLevel.role.required': 'Please select roles',
'member.memberLevel.rightsSetting': 'Membership rights setting',
'member.memberLevel.levelInfo': 'Level Information',
'member.memberLevel.rightId': 'Right Id',
'member.memberLevel.rightName': 'Right Name',
'member.memberLevel.rightRemark': 'Right Description',
'member.memberLevel.acquireWayName': 'Acquire Way Name',
'member.memberLevel.paramWayName': 'Param Way Name',
'member.memberLevel.rights': 'Select Rights',
'member.memberLevel.rights.required': 'Please select rights',
'member.memberLevel.parameter': 'parameter',
'member.memberLevel.parameter.required': 'Please enter parameter',
'member.memberLevel.parameter.legal': 'Please enter a whole number or a decimal with no more than two decimal places',
'member.memberLevel.disabled': 'Disable',
'member.memberLevel.enable': 'Enable',
'member.memberLevel.parameter.edit': 'Change parameters',
}
......@@ -969,4 +969,64 @@ export default {
'member.management.assigned.query.batchReceive': '일괄 수신',
'member.memberQuery.suggest.common.schema.eventTime.required': '이벤트 시간을 입력하십시오.',
// 会员等级管理
'member.memberLevel.levelId': '회원 등급 ID',
'member.memberLevel.level': '회원 등급',
'member.memberLevel.level.placeholder': '선택해주세요',
'member.memberLevel.levelTag': '회원 등급 라벨',
'member.memberLevel.levelTag.placeholder': '검색',
'member.memberLevel.levelTag.tip': '검색할 회원등급 태그를 입력하세요.',
'member.memberLevel.levelTag.tip2': '최대 16자, 한자 8자까지 입력하세요.',
'member.memberLevel.levelTag.required': '멤버십 등급 태그를 입력하세요.',
'member.memberLevel.levelTypeName': '회원 등급 유형',
'member.memberLevel.levelTypeName.placeholder': '선택해주세요',
'member.memberLevel.scoreTag': '업그레이드 포인트 라벨',
'member.memberLevel.scoreTag.placeholder': '최대 16자, 한자 8자까지 입력하세요.',
'member.memberLevel.scoreTag.required': '업그레이드 포인트 라벨을 입력하세요',
'member.memberLevel.roleName': '구성원 역할 이름',
'member.memberLevel.roleName.placeholder': '구성원 역할 이름',
'member.memberLevel.roleTypeName': '역할 유형',
'member.memberLevel.memberTypeName': '회원 유형',
'member.memberLevel.point': '업그레이드 임계값',
'member.memberLevel.point.required': '업그레이드 임계값을 입력하세요.',
'member.memberLevel.point.legal': '정수를 입력하세요',
'member.memberLevel.status': '상태',
'member.memberLevel.status.changing': '변경 중입니다. 잠시만 기다려 주십시오.',
'member.memberLevel.add': '새로운',
'member.memberLevel.add.adding': '추가 중입니다. 잠시만 기다려 주십시오.',
'member.memberLevel.modify': '편집하다',
'member.memberLevel.modify.modifying': '편집 중입니다. 잠시만 기다려 주십시오.',
'member.memberLevel.delete': '삭제',
'member.memberLevel.delete.deleting': '삭제 중입니다. 잠시만 기다려 주십시오.',
'member.memberLevel.delete.confirm.title': '이 멤버십 등급을 삭제하시겠습니까?',
'member.memberLevel.setRights': '혜택 및 업그레이드 임계값 설정',
'member.memberLevel.rebuild': '회원등급 및 혜택 초기화',
'member.memberLevel.rebuild.confirm.title': '힌트',
'member.memberLevel.rebuild.confirm.content': '"확인"을 클릭하면 모든 플랫폼 구성원의 멤버십 등급이 초기 등급으로 초기화되고 이 등급의 모든 권리와 이익을 향유하게 됩니다!',
'member.memberLevel.basic': '기본 정보',
'member.memberLevel.applicableMemberRoles': '적용 가능한 구성원 역할',
'member.memberLevel.remark': '회원 등급 설명',
'member.memberLevel.remark.placeholder': '여기에 내용을 입력하십시오. 최대 80자, 한자 40자',
'member.memberLevel.add.level': '회원 등급 추가',
'member.memberLevel.modify.level': '회원 등급 수정',
'member.memberLevel.roleId': '회원 역할 ID',
'member.memberLevel.role.choose': '멤버십 역할 선택',
'member.memberLevel.role.required': '회원 역할을 선택하십시오',
'member.memberLevel.rightsSetting': '멤버십 혜택 설정',
'member.memberLevel.levelInfo': '회원 등급 정보',
'member.memberLevel.rightId': '멤버십 혜택 ID',
'member.memberLevel.rightName': '멤버십 혜택 이름',
'member.memberLevel.rightRemark': '멤버십 혜택',
'member.memberLevel.acquireWayName': '권리를 얻는 방법',
'member.memberLevel.paramWayName': '파라미터 설정 방법',
'member.memberLevel.rights': '멤버십 혜택 선택',
'member.memberLevel.rights.required': '멤버십 혜택을 선택하세요.',
'member.memberLevel.parameter': '매개변수',
'member.memberLevel.parameter.required': '매개변수를 입력하세요.',
'member.memberLevel.parameter.legal': '정수 또는 소수점 이하 두 자리 이하의 소수를 입력하세요.',
'member.memberLevel.disabled': '장애를 입히다',
'member.memberLevel.enable': '활성화',
'member.memberLevel.parameter.edit': '매개변수 변경',
}
......@@ -973,4 +973,64 @@ export default {
'member.management.assigned.query.bind.suc': '会员领取成功!',
'member.memberQuery.suggest.common.schema.eventTime.required': '请填写事件时间',
// 会员等级管理
'member.memberLevel.levelId': '会员等级ID',
'member.memberLevel.level': '会员等级',
'member.memberLevel.level.placeholder': '请选择',
'member.memberLevel.levelTag': '会员等级标签',
'member.memberLevel.levelTag.placeholder': '搜索',
'member.memberLevel.levelTag.tip': '输入 会员等级标签 进行搜索',
'member.memberLevel.levelTag.tip2': '请输入,最长16个字符,8个汉字',
'member.memberLevel.levelTag.required': '请输入会员等级标签',
'member.memberLevel.levelTypeName': '会员等级类型',
'member.memberLevel.levelTypeName.placeholder': '请选择',
'member.memberLevel.scoreTag': '升级分值标签',
'member.memberLevel.scoreTag.placeholder': '请输入,最长16个字符,8个汉字',
'member.memberLevel.scoreTag.required': '请输入升级分值标签',
'member.memberLevel.roleName': '会员角色',
'member.memberLevel.roleName.placeholder': '会员角色名称',
'member.memberLevel.roleTypeName': '角色类型',
'member.memberLevel.memberTypeName': '会员类型',
'member.memberLevel.point': '升级阀值',
'member.memberLevel.point.required': '업그레이드 임계값을 입력하세요.',
'member.memberLevel.point.legal': '请输入整数',
'member.memberLevel.status': '状态',
'member.memberLevel.status.changing': '正在更改,请稍候...',
'member.memberLevel.add': '新增',
'member.memberLevel.add.adding': '正在添加,请稍候...',
'member.memberLevel.modify': '编辑',
'member.memberLevel.modify.modifying': '正在修改,请稍候...',
'member.memberLevel.delete': '删除',
'member.memberLevel.delete.deleting': '正在删除,请稍候...',
'member.memberLevel.delete.confirm.title': '是否确认删除该会员等级?',
'member.memberLevel.setRights': '设置权益与升级阀值',
'member.memberLevel.rebuild': '初始化会员等级与权益',
'member.memberLevel.rebuild.confirm.title': '提示',
'member.memberLevel.rebuild.confirm.content': '点击“确定”,会将所有平台会员的会员等级初始化为初始等级,并享有该等级的所有权益!',
'member.memberLevel.basic': '基本信息',
'member.memberLevel.applicableMemberRoles': '适用会员角色',
'member.memberLevel.remark': '会员等级说明',
'member.memberLevel.remark.placeholder': '在此输入你的内容,最长80个字符,40个汉字',
'member.memberLevel.add.level': '新增会员等级',
'member.memberLevel.modify.level': '编辑会员等级',
'member.memberLevel.roleId': '会员角色ID',
'member.memberLevel.role.choose': '选择会员角色',
'member.memberLevel.role.required': '请选择会员角色',
'member.memberLevel.rightsSetting': '会员权益设置',
'member.memberLevel.levelInfo': '会员等级信息',
'member.memberLevel.rightId': '会员权益ID',
'member.memberLevel.rightName': '会员权益名称',
'member.memberLevel.rightRemark': '会员权益说明',
'member.memberLevel.acquireWayName': '权益获取方式',
'member.memberLevel.paramWayName': '参数设置方式',
'member.memberLevel.rights': '选择会员权益',
'member.memberLevel.rights.required': '请选择会员权益',
'member.memberLevel.parameter': '参数',
'member.memberLevel.parameter.required': '请输入参数',
'member.memberLevel.parameter.legal': '请输入整数或小数位不超过两位的小数',
'member.memberLevel.disabled': '停用',
'member.memberLevel.enable': '启用',
'member.memberLevel.parameter.edit': '修改参数',
}
......@@ -3,16 +3,18 @@
*/
import React from 'react';
import { message } from 'antd';
import { history } from 'umi';
import { history, useIntl } from 'umi';
import { postMemberAbilityLevelCreate } from '@/services/MemberV2Api';
import MemberLevelForm, { SubmitValue } from './components/MemberLevelForm';
const AddMemberLevel: React.FC<{}> = (props) => {
const intl = useIntl();
const handleRoleRuleConfigFormSubmit = (value: SubmitValue): Promise<void> => (
new Promise((resolve, reject) => {
const msg = message.loading({
content: '正在添加,请稍候...',
content: intl.formatMessage({ id: 'member.memberLevel.add.adding' }, { default: '正在添加,请稍候...' }),
duration: 0,
});
const { memberApplicableRole, ...rest } = value;
......@@ -36,7 +38,7 @@ const AddMemberLevel: React.FC<{}> = (props) => {
return (
<MemberLevelForm
title='新增会员等级'
title={intl.formatMessage({ id: 'member.memberLevel.add.level' }, { default: '新增会员等级' })}
onSubmit={handleRoleRuleConfigFormSubmit}
/>
);
......
......@@ -2,6 +2,7 @@
* @Description: 平台会员等级 - 适用会员角色FormField
*/
import React, { useState, useEffect } from 'react';
import { useIntl, getIntl } from 'umi';
import { Button } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { ColumnType } from 'antd/lib/table/interface';
......@@ -9,6 +10,8 @@ import themeConfig from '@/../config/lingxi.theme.config';
import PolymericTable from '@/components/PolymericTable';
import MemberRoleDrawer, { MemberRoleDrawerSubmitValue, MemberRoleDrawerProps } from '../MemberRoleDrawer';
const intlShape = getIntl();
export type MemberApplicableRoleType = MemberRoleDrawerSubmitValue[0] & {}
export interface MemberApplicableRoleProps {
......@@ -20,19 +23,19 @@ export interface MemberApplicableRoleProps {
const normalColumns: ColumnType<MemberApplicableRoleType>[] = [
{
title: '会员角色ID',
title: intlShape.formatMessage({ id: 'member.memberLevel.roleId' }, { default: '会员角色ID' }),
dataIndex: 'roleId',
},
{
title: '会员角色',
title: intlShape.formatMessage({ id: 'member.memberLevel.roleName' }, { default: '会员角色' }),
dataIndex: 'roleName',
},
{
title: '角色类型',
title: intlShape.formatMessage({ id: 'member.memberLevel.roleTypeName' }, { default: '角色类型' }),
dataIndex: 'roleTypeName',
},
{
title: '会员类型',
title: intlShape.formatMessage({ id: 'member.memberLevel.memberTypeName' }, { default: '会员类型' }),
dataIndex: 'memberTypeName',
},
];
......@@ -43,6 +46,8 @@ const MemberApplicableRole = (props: MemberApplicableRoleProps) => {
const [innerValue, setInnerValue] = useState<MemberApplicableRoleType[]>([]);
const [visibleDrawer, setVisibleDrawer] = useState(false);
const intl = useIntl();
useEffect(() => {
if ('value' in props) {
setInnerValue(value!);
......@@ -69,7 +74,7 @@ const MemberApplicableRole = (props: MemberApplicableRoleProps) => {
const columns: ColumnType<MemberApplicableRoleType>[] = [
...normalColumns,
editable ? {
title: '操作',
title: intl.formatMessage({ id: 'common.table.action' }, { default: '操作' }),
dataIndex: 'option',
align: 'center',
render: (_, record) => (
......@@ -77,7 +82,7 @@ const MemberApplicableRole = (props: MemberApplicableRoleProps) => {
type="link"
onClick={() => handleRemoveItem(record)}
>
删除
{intl.formatMessage({ id: 'member.memberLevel.delete' }, { default: '删除' })}
</Button>
),
} : null,
......@@ -106,7 +111,7 @@ const MemberApplicableRole = (props: MemberApplicableRoleProps) => {
}}
block
>
选择会员角色
{intl.formatMessage({ id: 'member.memberLevel.role.choose' }, { default: '选择会员角色' })}
</Button>
)}
<PolymericTable
......
......@@ -2,6 +2,7 @@
* @Description: 会员角色规则 - 基础信息布局容器组件
*/
import React from 'react';
import { useIntl } from 'umi';
import AnchorPage from '@/components/AnchorPage';
import MellowCard from '@/components/MellowCard';
import { PLATFORM_MEMBER_LEVEL } from '../../config';
......@@ -12,10 +13,13 @@ interface BasicInfoVirtualFieldItemProps {
const BasicInfoVirtualFieldItem = (props: BasicInfoVirtualFieldItemProps) => {
const { children } = props;
const intl = useIntl();
return (
<AnchorPage.Item itemKey={PLATFORM_MEMBER_LEVEL}>
<MellowCard
title="平台会员等级"
title={intl.formatMessage({ id: 'member.memberLevel.add.level' }, { default: '新增会员等级' })}
bodyStyle={{
paddingBottom: 0,
}}
......
......@@ -2,6 +2,7 @@
* @Description: 平台会员等级 - 会员适用会员角色FormField
*/
import React from 'react';
import { useIntl } from 'umi';
import AnchorPage from '@/components/AnchorPage';
import MellowCard from '@/components/MellowCard';
import themeConfig from '@/../config/lingxi.theme.config';
......@@ -12,10 +13,13 @@ export type MemberApplicableRoleValue = MemberApplicableRoleType[]
const MemberApplicableRoleFormField = (props) => {
const componentProps = props.props['x-component-props'] || {};
const intl = useIntl();
return (
<AnchorPage.Item itemKey={MEMBER_APPLICABLE_ROLE}>
<MellowCard
title="适用会员角色"
title={intl.formatMessage({ id: 'member.memberLevel.applicableMemberRoles' }, { default: '适用会员角色' })}
style={{
marginTop: themeConfig['@margin-md'],
}}
......
import { getIntl } from 'umi';
const intl = getIntl();
export const PLATFORM_MEMBER_LEVEL = 'PLATFORM_MEMBER_LEVEL';
export const MEMBER_APPLICABLE_ROLE = 'MEMBER_APPLICABLE_ROLE';
......@@ -5,10 +9,10 @@ export const MEMBER_APPLICABLE_ROLE = 'MEMBER_APPLICABLE_ROLE';
export const anchorsArr = [
{
key: PLATFORM_MEMBER_LEVEL,
name: '基本信息',
name: intl.formatMessage({ id: 'member.memberLevel.basic' }, { default: '基本信息' }),
},
{
key: MEMBER_APPLICABLE_ROLE,
name: '适用会员角色',
name: intl.formatMessage({ id: 'member.memberLevel.applicableMemberRoles' }, { default: '适用会员角色' }),
},
];
\ No newline at end of file
......@@ -6,7 +6,7 @@ import { Button } from 'antd';
import { SaveOutlined } from '@ant-design/icons';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { Input } from '@formily/antd-components';
import { Prompt } from 'umi';
import { Prompt, useIntl } from 'umi';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { getMemberAbilityLevelRolePage, getMemberAbilityLevelTypes } from '@/services/MemberV2Api';
import AnchorPage from '@/components/AnchorPage';
......@@ -87,6 +87,8 @@ const MemberLevelForm: React.FC<MemberLevelFormProps> = (props) => {
const [submitLoading, setSubmitLoading] = useState(false);
const [unsaved, setUnsaved] = useState(false);
const intl = useIntl();
const fetchMemberApplicableRole = (): MemberApplicableRoleProps['fetchDataSource'] => (async (params) => {
const res = await getMemberAbilityLevelRolePage({
...params,
......@@ -124,7 +126,7 @@ const MemberLevelForm: React.FC<MemberLevelFormProps> = (props) => {
loading={submitLoading}
onClick={() => formActions.submit()}
>
保存
{intl.formatMessage({ id: 'common.button.save' }, { default: '保存' })}
</Button>
)
: null
......@@ -183,7 +185,7 @@ const MemberLevelForm: React.FC<MemberLevelFormProps> = (props) => {
/>
</AnchorPage>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
<Prompt when={unsaved} message={intl.formatMessage({ id: 'common.tip.save.confirm' }, { default: '您还有未保存的内容,是否确定要离开?' })} />
</div>
);
};
......
import { ISchema } from '@formily/antd';
import { MEMBER_LEVEL_ENUM } from '@/constants/member';
import { getIntl } from 'umi';
const intl = getIntl();
const schema: ISchema = {
type: 'object',
......@@ -21,24 +24,24 @@ const schema: ISchema = {
},
properties: {
level: {
title: '会员等级',
title: intl.formatMessage({ id: 'member.memberLevel.level' }, { default: '会员等级' }),
type: 'string',
enum: MEMBER_LEVEL_ENUM,
required: true,
'x-component-props': {
placeholder: '请选择',
placeholder: intl.formatMessage({ id: 'member.memberLevel.level.placeholder' }, { default: '请选择' }),
},
},
levelTag: {
title: '会员等级标签',
title: intl.formatMessage({ id: 'member.memberLevel.levelTag' }, { default: '会员等级标签' }),
type: 'string',
'x-component-props': {
placeholder: '请输入,最长16个字符,8个汉字',
placeholder: intl.formatMessage({ id: 'member.memberLevel.levelTag.tip2' }, { default: '请输入,最长16个字符,8个汉字' }),
},
'x-rules': [
{
required: true,
message: '请输入会员等级标签',
message: intl.formatMessage({ id: 'member.memberLevel.levelTag.required' }, { default: '请输入会员等级标签' }),
},
{
limitByte: true, // 自定义校验规则
......@@ -47,24 +50,24 @@ const schema: ISchema = {
],
},
levelType: {
title: '会员等级类型',
title: intl.formatMessage({ id: 'member.memberLevel.levelTypeName' }, { default: '会员等级类型' }),
type: 'string',
enum: [],
required: true,
'x-component-props': {
placeholder: '请选择',
placeholder: intl.formatMessage({ id: 'member.memberLevel.levelTypeName.placeholder' }, { default: '请选择' }),
},
},
scoreTag: {
title: '升级分值标签',
title: intl.formatMessage({ id: 'member.memberLevel.scoreTag' }, { default: '升级分值标签' }),
type: 'string',
'x-component-props': {
placeholder: '请输入,最长16个字符,8个汉字',
placeholder: intl.formatMessage({ id: 'member.memberLevel.scoreTag.placeholder' }, { default: '请输入,最长16个字符,8个汉字' }),
},
'x-rules': [
{
required: true,
message: '请输入升级分值标签',
message: intl.formatMessage({ id: 'member.memberLevel.scoreTag.required' }, { default: '请输入升级分值标签' }),
},
{
limitByte: true, // 自定义校验规则
......@@ -73,11 +76,11 @@ const schema: ISchema = {
],
},
remark: {
title: '会员等级说明',
title: intl.formatMessage({ id: 'member.memberLevel.remark' }, { default: '会员等级说明' }),
type: 'string',
'x-component': 'TextArea',
'x-component-props': {
placeholder: '在此输入你的内容,最长80个字符,40个汉字',
placeholder: intl.formatMessage({ id: 'member.memberLevel.remark.placeholder' }, { default: '在此输入你的内容,最长80个字符,40个汉字' }),
rows: 5,
},
'x-rules': [
......
......@@ -6,6 +6,7 @@ import { Drawer, Button, message } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import PolymericTable, { FetchParamsType, FetchResponse } from '@/components/PolymericTable';
import { useIntl } from 'umi';
export type MemberRoleType = {
/**
......@@ -63,6 +64,8 @@ const MemberRoleDrawer = (props: MemberRoleDrawerProps) => {
} = props;
const [rowSelection, rowCtl] = useRowSelectionTable({ type: 'checkbox', customKey: 'roleId' });
const intl = useIntl();
useEffect(() => {
if (value) {
rowCtl.setSelectRow(value);
......@@ -72,15 +75,15 @@ const MemberRoleDrawer = (props: MemberRoleDrawerProps) => {
const columns: ColumnType<MemberRoleType>[] = [
{
title: '会员角色名称',
title: intl.formatMessage({ id: 'member.memberLevel.roleName.placeholder' }, { default: '会员角色名称' }),
dataIndex: 'roleName',
},
{
title: '角色类型',
title: intl.formatMessage({ id: 'member.memberLevel.roleTypeName' }, { default: '角色类型' }),
dataIndex: 'roleTypeName',
},
{
title: '会员类型',
title: intl.formatMessage({ id: 'member.memberLevel.memberTypeName' }, { default: '会员类型' }),
dataIndex: 'memberTypeName',
},
];
......@@ -105,7 +108,7 @@ const MemberRoleDrawer = (props: MemberRoleDrawerProps) => {
const handleConfirm = () => {
if (!rowCtl.selectRow.length) {
message.warning('请选择会员角色');
message.warning(intl.formatMessage({ id: 'member.memberLevel.role.required' }, { default: '请选择会员角色' }));
return;
}
if (onSubmit) {
......@@ -115,7 +118,7 @@ const MemberRoleDrawer = (props: MemberRoleDrawerProps) => {
return (
<Drawer
title="选择会员"
title={intl.formatMessage({ id: 'member.memberLevel.role.choose' }, { default: '选择会员' })}
width={1000}
onClose={handleClose}
visible={visible}
......@@ -126,10 +129,10 @@ const MemberRoleDrawer = (props: MemberRoleDrawerProps) => {
}}
>
<Button onClick={handleClose} style={{ marginRight: 16 }}>
取消
{intl.formatMessage({ id: 'common.button.cancel' }, { default: '取消' })}
</Button>
<Button onClick={handleConfirm} type="primary">
确 定
{intl.formatMessage({ id: 'common.button.confirm' }, { default: '确定' })}
</Button>
</div>
}
......
......@@ -2,7 +2,7 @@
* @Description 会员等级管理 - 列表
*/
import React, { useState, useRef } from 'react';
import { history } from 'umi';
import { history, useIntl } from 'umi';
import { Card, Button, Space, Popconfirm, Modal, message } from 'antd';
import { PlusOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
import { ColumnType } from 'antd/lib/table/interface';
......@@ -30,6 +30,8 @@ const PlatformMemberLevelIndexIndex: React.FC<{}> = props => {
const [statusLoadingKey, setStatusLoadingKey] = useState(0);
const [deleteLoadingKey, setDeleteLoadingKey] = useState(0);
const intl = useIntl();
const polymericRef = useRef<NormalTableRefHandleType | null>(null);
const handleJumpFormPage = (record?: GetMemberLevelListRequestResponse) => {
......@@ -45,7 +47,7 @@ const PlatformMemberLevelIndexIndex: React.FC<{}> = props => {
return;
}
const msg = message.loading({
content: '正在更改,请稍候...',
content: intl.formatMessage({ id: 'member.memberLevel.status.changing' }, { default: '正在更改,请稍候...' }),
duration: 0,
});
setStatusLoadingKey(record.levelId);
......@@ -67,7 +69,7 @@ const PlatformMemberLevelIndexIndex: React.FC<{}> = props => {
return;
}
const msg = message.loading({
content: '正在删除,请稍候...',
content: intl.formatMessage({ id: 'member.memberLevel.delete.deleting' }, { default: '正在删除,请稍候...' }),
duration: 0,
});
setDeleteLoadingKey(record.levelId);
......@@ -85,17 +87,17 @@ const PlatformMemberLevelIndexIndex: React.FC<{}> = props => {
const columns: ColumnType<GetMemberLevelListRequestResponse>[] = [
{
title: '会员等级ID',
title: intl.formatMessage({ id: 'member.memberLevel.levelId' }, { default: '会员等级ID' }),
dataIndex: 'levelId',
width: '10%',
},
{
title: '会员等级',
title: intl.formatMessage({ id: 'member.memberLevel.level' }, { default: '会员等级' }),
dataIndex: 'level',
width: '10%',
},
{
title: '会员等级标签',
title: intl.formatMessage({ id: 'member.memberLevel.levelTag' }, { default: '会员等级标签' }),
dataIndex: 'levelTag',
render: (text: any, record) => (
<>
......@@ -109,37 +111,37 @@ const PlatformMemberLevelIndexIndex: React.FC<{}> = props => {
width: '10%',
},
{
title: '会员等级类型',
title: intl.formatMessage({ id: 'member.memberLevel.levelTypeName' }, { default: '会员等级类型' }),
dataIndex: 'levelTypeName',
width: '10%',
},
{
title: '升级分值标签',
title: intl.formatMessage({ id: 'member.memberLevel.scoreTag' }, { default: '升级分值标签' }),
dataIndex: 'scoreTag',
width: '10%',
},
{
title: '会员角色名称',
title: intl.formatMessage({ id: 'member.memberLevel.roleName' }, { default: '会员角色名称' }),
dataIndex: 'roleName',
width: '10%',
},
{
title: '角色类型',
title: intl.formatMessage({ id: 'member.memberLevel.roleTypeName' }, { default: '角色类型' }),
dataIndex: 'roleTypeName',
width: '10%',
},
{
title: '会员类型',
title: intl.formatMessage({ id: 'member.memberLevel.memberTypeName' }, { default: '会员类型' }),
dataIndex: 'memberTypeName',
width: '10%',
},
{
title: '升级阀值',
title: intl.formatMessage({ id: 'member.memberLevel.point' }, { default: '升级阀值' }),
dataIndex: 'point',
width: '10%',
},
{
title: '状态',
title: intl.formatMessage({ id: 'member.memberLevel.status' }, { default: '状态' }),
dataIndex: 'statusName',
width: '15%',
render: (text, record) => (
......@@ -150,7 +152,7 @@ const PlatformMemberLevelIndexIndex: React.FC<{}> = props => {
),
},
{
title: '操作',
title: intl.formatMessage({ id: 'common.table.action' }, { default: '操作' }),
dataIndex: 'actions',
align: 'center',
fixed: 'right',
......@@ -162,26 +164,26 @@ const PlatformMemberLevelIndexIndex: React.FC<{}> = props => {
onClick={() => handleJumpFormPage(record)}
disabled={record.status === 1}
>
编辑
{intl.formatMessage({ id: 'member.memberLevel.modify' }, { default: '编辑' })}
</Button>
<Popconfirm
title="是否确认删除该会员等级?"
title={intl.formatMessage({ id: 'member.memberLevel.delete.confirm.title' }, { default: '是否确认删除该会员等级?' })}
onConfirm={() => handleDeleteMemberLevel(record)}
okText="确认"
cancelText="取消"
okText={intl.formatMessage({ id: 'common.button.yes' }, { default: '确认' })}
cancelText={intl.formatMessage({ id: 'common.button.no' }, { default: '取消' })}
>
<Button
type="link"
loading={record.levelId === deleteLoadingKey}
>
删除
{intl.formatMessage({ id: 'member.memberLevel.delete' }, { default: '删除' })}
</Button>
</Popconfirm>
<Button
type="link"
onClick={() => handleJumpSetMemberLevelRight(record)}
>
设置权益与升级阀值
{intl.formatMessage({ id: 'member.memberLevel.setRights' }, { default: '设置权益与升级阀值' })}
</Button>
</>
),
......@@ -202,11 +204,11 @@ const PlatformMemberLevelIndexIndex: React.FC<{}> = props => {
const handleInitial = () => {
confirm({
title: '提示',
title: intl.formatMessage({ id: 'member.memberLevel.rebuild.confirm.title' }, { default: '提示' }),
icon: <ExclamationCircleOutlined />,
content: '点击“确定”,会将所有平台会员的会员等级初始化为初始等级,并享有该等级的所有权益!',
cancelText: '取消',
okText: '确定',
content: intl.formatMessage({ id: 'member.memberLevel.rebuild.confirm.content' }, { default: '点击“确定”,会将所有平台会员的会员等级初始化为初始等级,并享有该等级的所有权益!' }),
cancelText: intl.formatMessage({ id: 'common.button.cancel' }, { default: '取消' }),
okText: intl.formatMessage({ id: 'common.button.confirm' }, { default: '确定' }),
onOk() {
return postMemberAbilityLevelRebuild();
},
......@@ -223,13 +225,13 @@ const PlatformMemberLevelIndexIndex: React.FC<{}> = props => {
onClick={() => handleJumpFormPage()}
icon={<PlusOutlined />}
>
新增
{intl.formatMessage({ id: 'member.memberLevel.add' }, { default: '新增' })}
</Button>
<Button
type="primary"
onClick={() => handleInitial()}
>
初始化会员等级与权益
{intl.formatMessage({ id: 'member.memberLevel.rebuild' }, { default: '初始化会员等级与权益' })}
</Button>
</Space>
);
......
......@@ -3,7 +3,7 @@
*/
import React, { useState, useEffect } from 'react';
import { Spin, message } from 'antd';
import { history } from 'umi';
import { history, useIntl } from 'umi';
import { getMemberAbilityLevelGet, postMemberAbilityLevelUpdate } from '@/services/MemberV2Api';
import { usePageStatus } from '@/hooks/usePageStatus';
import MemberLevelForm, { SubmitValue, SubmitValueType } from './components/MemberLevelForm';
......@@ -13,6 +13,7 @@ const ModifyMemberLevel: React.FC<{}> = (props) => {
const [detailsLoading, setDetailsLoading] = useState(false);
const { id } = usePageStatus();
const intl = useIntl();
const fetchMemberLevelDetails = () => {
setDetailsLoading(true);
......@@ -39,7 +40,7 @@ const ModifyMemberLevel: React.FC<{}> = (props) => {
const handleRoleRuleConfigFormSubmit = (value: SubmitValue): Promise<void> => (
new Promise((resolve, reject) => {
const msg = message.loading({
content: '正在修改,请稍候...',
content: intl.formatMessage({ id: 'member.memberLevel.modify.modifying' }, { default: '正在修改,请稍候...' }),
duration: 0,
});
const { memberApplicableRole, ...rest } = value;
......@@ -64,7 +65,7 @@ const ModifyMemberLevel: React.FC<{}> = (props) => {
return (
<Spin spinning={detailsLoading}>
<MemberLevelForm
title='编辑会员角色'
title={intl.formatMessage({ id: 'member.memberLevel.add.level' }, { default: '编辑会员角色' })}
value={memberLevelDetails}
onSubmit={handleRoleRuleConfigFormSubmit}
cloudy
......
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ISchema } from '@formily/antd';
import { getIntl } from 'umi';
const intl = getIntl();
export const querySchema: ISchema = {
type: 'object',
......@@ -19,8 +22,8 @@ export const querySchema: ISchema = {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
tip: '输入 会员等级标签 进行搜索',
placeholder: intl.formatMessage({ id: 'member.memberLevel.levelTag.placeholder' }, { default: '搜索' }),
tip: intl.formatMessage({ id: 'member.memberLevel.levelTag.tip' }, { default: '输入 会员等级标签 进行搜索' }),
},
},
},
......@@ -37,7 +40,7 @@ export const querySchema: ISchema = {
roleName: {
type: 'string',
'x-component-props': {
placeholder: '会员角色名称',
placeholder: intl.formatMessage({ id: 'member.memberLevel.roleName' }, { default: '会员角色名称' }),
allowClear: true,
},
},
......@@ -47,7 +50,7 @@ export const querySchema: ISchema = {
span: 1,
},
'x-component-props': {
children: '查询',
children: intl.formatMessage({ id: 'common.button.search' }, { default: '查询' }),
},
},
},
......
......@@ -2,6 +2,7 @@
* @Description: 会员角色规则 - 基础信息布局容器组件
*/
import React from 'react';
import { useIntl } from 'umi';
import AnchorPage from '@/components/AnchorPage';
import MellowCard from '@/components/MellowCard';
import { MEMBER_LEVEL_INFO } from '../../config';
......@@ -12,10 +13,13 @@ interface BasicInfoVirtualFieldItemProps {
const BasicInfoVirtualFieldItem = (props: BasicInfoVirtualFieldItemProps) => {
const { children } = props;
const intl = useIntl();
return (
<AnchorPage.Item itemKey={MEMBER_LEVEL_INFO}>
<MellowCard
title="会员等级信息"
title={intl.formatMessage({ id: 'member.memberLevel.levelInfo' }, { default: '会员等级信息' })}
bodyStyle={{
paddingBottom: 0,
}}
......
......@@ -2,6 +2,7 @@
* @Description: 会员角色规则 - 适用会员角色FormField
*/
import React, { useEffect, useRef } from 'react';
import { useIntl } from 'umi';
import { Drawer, Button, message } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
......@@ -75,6 +76,8 @@ const MemberRightDrawer = (props: MemberRightDrawerProps) => {
} = props;
const [rowSelection, rowCtl] = useRowSelectionTable({ type: 'checkbox', customKey: 'rightType' });
const intl = useIntl();
useEffect(() => {
if (value) {
rowCtl.setSelectRow(value);
......@@ -84,24 +87,24 @@ const MemberRightDrawer = (props: MemberRightDrawerProps) => {
const columns: ColumnType<MemberRoleType>[] = [
{
title: '会员权益ID',
title: intl.formatMessage({ id: 'member.memberLevel.rightId' }, { default: '会员权益ID' }),
dataIndex: 'rightId',
width: '15%',
},
{
title: '会员权益名称',
title: intl.formatMessage({ id: 'member.memberLevel.rightName' }, { default: '会员权益名称' }),
dataIndex: 'name',
},
{
title: '会员权益说明',
title: intl.formatMessage({ id: 'member.memberLevel.rightRemark' }, { default: '会员权益说明' }),
dataIndex: 'remark',
},
{
title: '权益获取方式',
title: intl.formatMessage({ id: 'member.memberLevel.acquireWayName' }, { default: '权益获取方式' }),
dataIndex: 'acquireWayName',
},
{
title: '参数设置方式',
title: intl.formatMessage({ id: 'member.memberLevel.paramWayName' }, { default: '参数设置方式' }),
dataIndex: 'paramWayName',
},
];
......@@ -125,7 +128,7 @@ const MemberRightDrawer = (props: MemberRightDrawerProps) => {
const handleConfirm = () => {
if (!rowCtl.selectRow.length) {
message.warning('请选择会员权益');
message.warning(intl.formatMessage({ id: 'member.memberLevel.rights.required' }, { default: '请选择会员权益' }));
return;
}
if (onSubmit) {
......@@ -135,7 +138,7 @@ const MemberRightDrawer = (props: MemberRightDrawerProps) => {
return (
<Drawer
title="会员权益设置"
title={intl.formatMessage({ id: 'member.memberLevel.rightsSetting' }, { default: '会员权益设置' })}
width={1000}
onClose={handleClose}
visible={visible}
......@@ -146,10 +149,10 @@ const MemberRightDrawer = (props: MemberRightDrawerProps) => {
}}
>
<Button onClick={handleClose} style={{ marginRight: 16 }}>
取消
{intl.formatMessage({ id: 'common.button.cancel' }, { default: '取消' })}
</Button>
<Button onClick={handleConfirm} type="primary">
确 定
{intl.formatMessage({ id: 'common.button.confirm' }, { default: '确定' })}
</Button>
</div>
}
......
......@@ -15,6 +15,7 @@ import themeConfig from '@/../config/lingxi.theme.config';
import { MEMBER_RIGHT_SETTING } from '../../config';
import MemberRightDrawer, { MemberRightDrawerSubmitValue, MemberRightDrawerProps } from '../MemberRightDrawer';
import styles from './index.less';
import { useIntl } from 'umi';
export type MemberRightFormFieldType = MemberRightDrawerSubmitValue[0] & {
/**
......@@ -71,6 +72,8 @@ const MemberRightFormField = (props) => {
const [parameterLoadingKey, setParameterLoadingKey] = useState<number | undefined>(undefined);
const [statusLoadingKey, setStatusLoadingKey] = useState<number | undefined>(undefined);
const intl = useIntl();
useEffect(() => {
if ('value' in props) {
setInnerValue(value!);
......@@ -114,7 +117,7 @@ const MemberRightFormField = (props) => {
const handleChangeRightStatus = (index: number) => {
if (onStatusChange) {
const msg = message.loading({
content: '正在更改,请稍候...',
content: intl.formatMessage({ id: 'member.memberLevel.status.changing' }, { default: '正在更改,请稍候...' }),
duration: 0,
});
setStatusLoadingKey(index);
......@@ -128,7 +131,7 @@ const MemberRightFormField = (props) => {
const handleChangeParameter = (index: number) => {
if (onChangeParameter) {
const msg = message.loading({
content: '正在更改,请稍候...',
content: intl.formatMessage({ id: 'member.memberLevel.status.changing' }, { default: '正在更改,请稍候...' }),
duration: 0,
});
setParameterLoadingKey(index);
......@@ -141,27 +144,27 @@ const MemberRightFormField = (props) => {
const normalColumns: ColumnType<MemberRightFormFieldType>[] = [
{
title: '会员权益ID',
title: intl.formatMessage({ id: 'member.memberLevel.rightId' }, { default: '会员权益ID' }),
dataIndex: 'rightId',
},
{
title: '会员权益名称',
title: intl.formatMessage({ id: 'member.memberLevel.rightName' }, { default: '会员权益名称' }),
dataIndex: 'name',
},
{
title: '会员权益说明',
title: intl.formatMessage({ id: 'member.memberLevel.rightRemark' }, { default: '会员权益说明' }),
dataIndex: 'remark',
},
{
title: '权益获取方式',
title: intl.formatMessage({ id: 'member.memberLevel.acquireWayName' }, { default: '权益获取方式' }),
dataIndex: 'acquireWayName',
},
{
title: '参数设置方式',
title: intl.formatMessage({ id: 'member.memberLevel.paramWayName' }, { default: '参数设置方式' }),
dataIndex: 'paramWayName',
},
{
title: '参数',
title: intl.formatMessage({ id: 'member.memberLevel.parameter' }, { default: '参数' }),
dataIndex: 'parameter',
width: '15%',
render: (text, record, index) => editable ? (
......@@ -179,11 +182,11 @@ const MemberRightFormField = (props) => {
'x-rules': [
{
required: true,
message: '请输入参数',
message: intl.formatMessage({ id: 'member.memberLevel.parameter.required' }, { default: '请输入参数' }),
},
{
pattern: PATTERN_MAPS.money,
message: '请输入整数或小数位不超过两位的小数',
message: intl.formatMessage({ id: 'member.memberLevel.parameter.legal' }, { default: '请输入整数或小数位不超过两位的小数' }),
},
],
},
......@@ -194,7 +197,7 @@ const MemberRightFormField = (props) => {
) : `${text}%`,
},
{
title: '状态',
title: intl.formatMessage({ id: 'member.memberLevel.status' }, { default: '状态' }),
dataIndex: 'statusName',
},
];
......@@ -202,7 +205,7 @@ const MemberRightFormField = (props) => {
const columns: ColumnType<MemberRightFormFieldType>[] = [
...normalColumns,
editable ? {
title: '操作',
title: intl.formatMessage({ id: 'common.table.action' }, { default: '操作' }),
dataIndex: 'option',
align: 'center',
render: (_, record, index) => (
......@@ -212,7 +215,7 @@ const MemberRightFormField = (props) => {
onClick={() => handleRemoveItem(record)}
disabled={!editable}
>
删除
{intl.formatMessage({ id: 'member.memberLevel.delete' }, { default: '删除' })}
</Button>
{!record.fresh ? (
<>
......@@ -223,7 +226,7 @@ const MemberRightFormField = (props) => {
disabled={!editable}
loading={index === statusLoadingKey}
>
{record.status === 1 ? '停用' : '启用'}
{record.status === 1 ? intl.formatMessage({ id: 'member.memberLevel.disabled' }, { default: '停用' }) : intl.formatMessage({ id: 'member.memberLevel.enable' }, { default: '启用' })}
</Button>
) : null}
<Button
......@@ -232,7 +235,7 @@ const MemberRightFormField = (props) => {
disabled={!editable}
loading={index === parameterLoadingKey}
>
修改参数
{intl.formatMessage({ id: 'member.memberLevel.parameter.edit' }, { default: '修改参数' })}
</Button>
</>
) : null}
......@@ -244,7 +247,7 @@ const MemberRightFormField = (props) => {
return (
<AnchorPage.Item itemKey={MEMBER_RIGHT_SETTING}>
<MellowCard
title="会员权益设置"
title={intl.formatMessage({ id: 'member.memberLevel.rightsSetting' }, { default: '会员权益设置' })}
style={{
marginTop: themeConfig['@margin-md'],
}}
......@@ -261,7 +264,7 @@ const MemberRightFormField = (props) => {
}}
block
>
选择会员权益
{intl.formatMessage({ id: 'member.memberLevel.rights' }, { default: '选择会员权益' })}
</Button>
)}
<PolymericTable
......
import { getIntl } from 'umi';
const intl = getIntl();
export const MEMBER_LEVEL_INFO = 'MEMBER_LEVEL_INFO';
export const MEMBER_RIGHT_SETTING = 'MEMBER_RIGHT_SETTING';
......@@ -5,10 +9,10 @@ export const MEMBER_RIGHT_SETTING = 'MEMBER_RIGHT_SETTING';
export const anchorsArr = [
{
key: MEMBER_LEVEL_INFO,
name: '会员等级信息',
name: intl.formatMessage({ id: 'member.memberLevel.levelInfo' }, { default: '会员等级信息' }),
},
{
key: MEMBER_RIGHT_SETTING,
name: '会员权益设置',
name: intl.formatMessage({ id: 'member.memberLevel.rightsSetting' }, { default: '会员权益设置' }),
},
];
\ No newline at end of file
......@@ -5,7 +5,7 @@ import React, { useState, useEffect } from 'react';
import { Spin, message, Button } from 'antd';
import { SaveOutlined } from '@ant-design/icons';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { Prompt, history } from 'umi';
import { Prompt, history, useIntl } from 'umi';
import { usePageStatus } from '@/hooks/usePageStatus';
import { getMemberManageRightDetail, getMemberManageRightFind, postMemberManageRightParameterUpdate, postMemberManageRightStatus, postMemberManageRightUpdate } from '@/services/MemberV2Api';
import AnchorPage from '@/components/AnchorPage';
......@@ -72,6 +72,7 @@ const SetMemberLevelRight: React.FC<{}> = (props) => {
const [unsaved, setUnsaved] = useState(false);
const { id } = usePageStatus();
const intl = useIntl();
const fetchMemberLevelRightDetails = () => {
setDetailsLoading(true);
......@@ -108,7 +109,7 @@ const SetMemberLevelRight: React.FC<{}> = (props) => {
const handleSubmit = (values: SubmitValueType) => {
const msg = message.loading({
content: '正在修改,请稍候...',
content: intl.formatMessage({ id: 'member.memberLevel.modify.modifying' }, { default: '正在修改,请稍候...' }),
duration: 0,
});
const { point, memberRights, ...rest } = values;
......@@ -177,7 +178,7 @@ const SetMemberLevelRight: React.FC<{}> = (props) => {
<Spin spinning={detailsLoading}>
<div className={styles['role-rule-config-form']}>
<AnchorPage
title="平台会员权益设置"
title={intl.formatMessage({ id: 'member.memberLevel.rightsSetting' }, { default: '会员权益设置' })}
anchors={anchorsArr}
extra={[
<Button
......@@ -187,7 +188,7 @@ const SetMemberLevelRight: React.FC<{}> = (props) => {
loading={submitLoading}
onClick={() => formActions.submit()}
>
保存
{intl.formatMessage({ id: 'common.button.save' }, { default: '保存' })}
</Button>,
]}
>
......@@ -225,7 +226,7 @@ const SetMemberLevelRight: React.FC<{}> = (props) => {
/>
</AnchorPage>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
<Prompt when={unsaved} message={intl.formatMessage({ id: 'common.tip.save.confirm' }, { default: '您还有未保存的内容,是否确定要离开?' })} />
</div>
</Spin>
);
......
import { ISchema } from '@formily/antd';
import { getIntl } from 'umi';
const intl = getIntl();
const schema: ISchema = {
type: 'object',
properties: {
......@@ -20,56 +24,56 @@ const schema: ISchema = {
},
properties: {
level: {
title: '会员等级',
title: intl.formatMessage({ id: 'member.memberLevel.level' }, { default: '会员等级' }),
type: 'string',
editable: false,
},
levelTag: {
title: '会员等级标签',
title: intl.formatMessage({ id: 'member.memberLevel.levelTag' }, { default: '会员等级标签' }),
type: 'string',
editable: false,
},
levelTypeName: {
title: '会员等级类型',
title: intl.formatMessage({ id: 'member.memberLevel.levelTypeName' }, { default: '会员等级类型' }),
type: 'string',
editable: false,
},
scoreTag: {
title: '升级分值标签',
title: intl.formatMessage({ id: 'member.memberLevel.scoreTag' }, { default: '升级分值标签' }),
type: 'string',
editable: false,
},
remark: {
title: '会员等级说明',
title: intl.formatMessage({ id: 'member.memberLevel.remark' }, { default: '会员等级说明' }),
type: 'string',
editable: false,
},
roleName: {
title: '会员角色名称',
title: intl.formatMessage({ id: 'member.memberLevel.roleName.placeholder' }, { default: '会员角色名称' }),
type: 'string',
editable: false,
},
roleTypeName: {
title: '角色类型',
title: intl.formatMessage({ id: 'member.memberLevel.roleTypeName' }, { default: '角色类型' }),
type: 'string',
editable: false,
},
memberTypeName: {
title: '会员类型',
title: intl.formatMessage({ id: 'member.memberLevel.memberTypeName' }, { default: '会员类型' }),
type: 'string',
editable: false,
},
point: {
title: '升级阀值',
title: intl.formatMessage({ id: 'member.memberLevel.point' }, { default: '升级阀值' }),
type: 'string',
'x-rules': [
{
required: true,
message: '请输入升级阀值',
message: intl.formatMessage({ id: 'member.memberLevel.point.required' }, { default: '请输入升级阀值' }),
},
{
pattern: /^[1-9]?[0-9]*$/,
message: '请输入整数',
message: intl.formatMessage({ id: 'member.memberLevel.point.legal' }, { default: '请输入整数' }),
},
]
},
......
......@@ -150,6 +150,7 @@ export const transformDataForNiceForm = (value: any, ctx: ISchemaFormActions | I
initValue["commodityMemberLevelList"] = value.commodityMemberLevelList.map(item => ({
roleId: item.memberRoleId,
roleName: item.memberRoleName,
levelId: item.id,
...item,
}))
initValue["shopId"] = value["shopId"]
......
......@@ -25,6 +25,9 @@ export const fileChangeStringArray = (arr) => arr.map(item => {
})
const isAll = (element) => {
return element.some(item => item['provinceCode'] === '0' && item['cityCode'] === '0')
}
/** 传参 数据转换 id:判断是否编辑 */
export const paramsConversionFn = (value) => {
const { pageStatus } = usePageStatus()
......@@ -81,7 +84,8 @@ export const paramsConversionFn = (value) => {
})
}
// 增加不限区域和城市字段
if (value?.inviteTenderAreaList?.length > 0) {
// if (value?.inviteTenderAreaList?.length > 0) {
if (value?.inviteTenderAreaList?.length > 0 && !isAll(value.inviteTenderAreaList)) {
value.isAllArea = false
value['inviteTenderAreaList'] = _value.inviteTenderAreaList.map(item => {
let param = {
......
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