Commit 888ed036 authored by GuanHua's avatar GuanHua
parents 8c744b25 3480ed80
......@@ -4,6 +4,8 @@ import home from './zh-CN/home'
import order from './zh-CN/order'
import shop from './zh-CN/shop'
import priceManage from './zh-CN/priceManage'
import classAndProperty from './zh-CN/classAndProperty'
import member from './zh-CN/member'
export default {
'global.siteName': '瓴犀',
......@@ -13,4 +15,6 @@ export default {
...order,
...shop,
...priceManage,
...classAndProperty,
...member,
}
This diff is collapsed.
/*
* @Author: XieZhiXiong
* @Date: 2021-11-29 11:33:12
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-11-29 15:47:49
* @Description:
*/
export default {
// 会员导入
'member.management.import.query.memberId': '会员Id',
'member.management.import.query.memberName': '会员名称',
'member.management.import.query.memberTypeName': '会员类型',
'member.management.import.query.roleName': '会员角色',
'member.management.import.query.sourceName': '注册来源',
'member.management.import.query.registerTime': '时间',
'member.management.import.query.outerStatusName': '外部状态',
'member.management.import.query.commit': '提交平台审核',
'member.management.import.query.commit-committing': '正在提交',
'member.management.import.query.edit': '编辑',
'member.management.import.query.delete': '删除',
'member.management.import.query.delete-description': '确定要删除吗?',
'member.management.import.query.delete-deleting': '正在删除',
'member.management.import.query.placeholder-name': '搜索',
'member.management.import.query.placeholder-name-tip': '输入 会员名称 进行搜索',
'member.management.import.query.placeholder-memberTypeId': '会员类型(全部)',
'member.management.import.query.placeholder-roleId': '会员角色(全部)',
'member.management.import.query.placeholder-outerStatus': '外部状态(全部)',
'member.management.import.query.placeholder-date': '时间范围(全部)',
'member.management.import.query.query': '查询',
'member.management.import.query.form.create': '新建会员',
'member.management.import.query.form.edit': '编辑会员',
'member.management.import.query.form.saving': '正在保存,请稍候...',
'member.management.import.query.form.creating': '正在添加,请稍候...',
'member.management.import.query.form.placeholder-select': '请选择',
'member.management.import.query.form.basic': '基本信息',
'member.management.import.query.form.basic.memberTypeId': '会员类型',
'member.management.import.query.form.basic.roleId': '会员角色',
'member.management.import.query.form.basic.level': '会员等级',
'member.management.import.query.form.basic.phone': '注册手机',
'member.management.import.query.form.basic.phone.placeholder': '请输入你的手机号码',
'member.management.import.query.form.basic.phone.rules-fact': '请输入正确格式的手机号',
'member.management.import.query.form.basic.email': '邮箱',
'member.management.import.query.form.basic.email.rules-fact': '请输入正确格式的邮箱',
'member.management.import.query.form.channel': '渠道信息',
'member.management.import.query.form.channel.upperRelationId': '上级渠道',
'member.management.import.query.form.channel.channelLevel': '渠道级别',
'member.management.import.query.form.channel.channelTypeId': '渠道类型',
'member.management.import.query.form.channel.areas': '代理城市',
'member.management.import.query.form.channel.remark': '渠道描述',
'member.management.import.query.form.channel.remark.placeholder': '最大200个字符,100个汉字',
// 会员状态
'member.status.notAaudit': '待审核',
};
import React, { useRef, useState } from 'react'
import { history } from 'umi'
import { history, useIntl, getIntl } from 'umi'
import { Button, Popconfirm, Card, Tooltip, message, Space } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import {
......@@ -35,7 +35,7 @@ const formProduct: ISchema = {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '请输入属性组名称',
placeholder: getIntl().formatMessage({ id: 'classAndProperty.attribute.formProduct.groupName' }),
align: 'flex-left',
},
},
......@@ -57,7 +57,7 @@ const formProduct: ISchema = {
name: {
type: 'string',
"x-component-props": {
placeholder: '属性名称',
placeholder: getIntl().formatMessage({ id: 'classAndProperty.attribute.formProduct.name' }),
style: {
width: 160
}
......@@ -69,7 +69,7 @@ const formProduct: ISchema = {
span: 1
},
"x-component-props": {
children: '查询'
children: getIntl().formatMessage({ id: 'classAndProperty.attribute.formProduct.submit' })
}
}
}
......@@ -78,6 +78,7 @@ const formProduct: ISchema = {
}
const Attribute: React.FC<{}> = () => {
const intl = useIntl();
const ref = useRef<any>({})
const syncRef = useRef<any>({})
const [syncVisible, setSyncVisible] = useState<boolean>(false)
......@@ -85,7 +86,7 @@ const Attribute: React.FC<{}> = () => {
// const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const [syncLoading, setSyncLoading] = useState<boolean>(false)
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'})
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({ customKey: 'id' })
const fetchData = (params?: any) => {
return new Promise((resolve, reject) => {
......@@ -110,64 +111,64 @@ const Attribute: React.FC<{}> = () => {
key: 'id',
},
{
title: '属性名称',
title: intl.formatMessage({ id: 'classAndProperty.attribute.columns.name' }),
dataIndex: 'name',
key: 'name',
render: (text: any, record: any) => <span className="commonPickColor" onClick={() => handleSee(record)}>{text}&nbsp;<EyeOutlined /></span>
},
{
title: '属性组名',
title: intl.formatMessage({ id: 'classAndProperty.attribute.columns.groupName' }),
dataIndex: 'groupName',
key: 'groupName',
},
{
title: '展示方式',
title: intl.formatMessage({ id: 'classAndProperty.attribute.columns.type' }),
dataIndex: 'type',
key: 'type',
render: (text: number) => {
let txt = new Map([[1, '单选'], [2, '多选'], [3, '输入']])
let txt = new Map([[1, intl.formatMessage({ id: 'classAndProperty.attribute.columns.type.1' })], [2, intl.formatMessage({ id: 'classAndProperty.attribute.columns.type.2' })], [3, intl.formatMessage({ id: 'classAndProperty.attribute.columns.type.3' })]])
return txt.get(text)
}
},
{
title: '是否必填',
title: intl.formatMessage({ id: 'classAndProperty.attribute.columns.isEmpty' }),
dataIndex: 'isEmpty',
key: 'isEmpty',
render: (text: any) => text ? '是' : '否'
render: (text: any) => text ? intl.formatMessage({ id: 'classAndProperty.attribute.columns.isEmpty.1' }) : intl.formatMessage({ id: 'classAndProperty.attribute.columns.isEmpty.2' })
},
{
title: '状态',
title: intl.formatMessage({ id: 'classAndProperty.attribute.columns.isEnable' }),
dataIndex: 'isEnable',
key: 'isEnable',
render: (text: any, record: any) => (
<Popconfirm
title="确定要执行这个操作?"
title={intl.formatMessage({ id: 'classAndProperty.attribute.columns.isEnable.title' })}
onConfirm={() => confirm(record)}
onCancel={cancel}
okText="是"
cancelText="否"
okText={intl.formatMessage({ id: 'classAndProperty.attribute.columns.isEnable.okText' })}
cancelText={intl.formatMessage({ id: 'classAndProperty.attribute.columns.isEnable.cancelText' })}
>
<Button
type="link"
style={record.isEnable ? { color: '#00B37A' } : { color: 'red' }}>
{record.isEnable ? <>有效 <PlayCircleOutlined /></> : <>无效 <PauseCircleOutlined /></>}
{record.isEnable ? <>{intl.formatMessage({ id: 'classAndProperty.attribute.columns.isEnable.link.1' })} <PlayCircleOutlined /></> : <>{intl.formatMessage({ id: 'classAndProperty.attribute.columns.isEnable.link.2' })} <PauseCircleOutlined /></>}
</Button>
</Popconfirm>
)
},
{
title: '操作',
title: intl.formatMessage({ id: 'classAndProperty.attribute.columns.option' }),
dataIndex: 'option',
render: (text: any, record: any) => record.isEnable ? '' : <>
<Button type='link' onClick={() => handleEdit(record)}>编辑</Button>
<Button type='link' onClick={() => handleEdit(record)}>{intl.formatMessage({ id: 'classAndProperty.attribute.columns.option.linke.1' })}</Button>
<Popconfirm
title="确定要执行这个操作?"
title={intl.formatMessage({ id: 'classAndProperty.attribute.columns.option.title' })}
onConfirm={() => clickDelete(record)}
onCancel={cancel}
okText="是"
cancelText="否"
okText={intl.formatMessage({ id: 'classAndProperty.attribute.columns.option.okText' })}
cancelText={intl.formatMessage({ id: 'classAndProperty.attribute.columns.option.cancelText' })}
>
<Button type='link'>删除</Button>
<Button type='link'>{intl.formatMessage({ id: 'classAndProperty.attribute.columns.option.linke.2' })}</Button>
</Popconfirm>
</>
}
......@@ -178,14 +179,14 @@ const Attribute: React.FC<{}> = () => {
}
const confirm = (record: any) => {
postProductCustomerUpdateCustomerAttributeStatus({id: record.id, isEnable: !record.isEnable}).then(res=>{
ref.current.reload()
postProductCustomerUpdateCustomerAttributeStatus({ id: record.id, isEnable: !record.isEnable }).then(res => {
ref.current.reload()
})
}
const clickDelete = (record: any) => {
postProductCustomerDeleteCustomerAttribute({ id: record.id }).then(res=>{
ref.current.reload()
postProductCustomerDeleteCustomerAttribute({ id: record.id }).then(res => {
ref.current.reload()
})
}
......@@ -212,10 +213,10 @@ const Attribute: React.FC<{}> = () => {
const handleAsyncOk = () => {
setSyncLoading(true)
if(rowSelectionCtl.selectedRowKeys.length) {
if (rowSelectionCtl.selectedRowKeys.length) {
// @ts-ignore
postProductCustomerSyncAttribute({idList: rowSelectionCtl.selectedRowKeys}).then(res => {
if(res.code === 1000) {
postProductCustomerSyncAttribute({ idList: rowSelectionCtl.selectedRowKeys }).then(res => {
if (res.code === 1000) {
ref.current.reload()
rowSelectionCtl.setSelectedRowKeys([])
}
......@@ -224,7 +225,7 @@ const Attribute: React.FC<{}> = () => {
clearModalParams()
})
} else {
message.error('请选择需要同步的属性')
message.error(intl.formatMessage({ id: 'classAndProperty.attribute.error' }))
setSyncLoading(false)
}
}
......@@ -237,11 +238,11 @@ const Attribute: React.FC<{}> = () => {
const Actions = (
<Space>
<Button type="primary" icon={<PlusOutlined />} onClick={() => { history.push('/memberCenter/commodityAbility/classAndProperty/attribute/add') }}>
新建
{intl.formatMessage({ id: 'classAndProperty.attribute.actions.button.1' })}
</Button>
<span>
<Button type="default" style={{marginLeft: 16}} onClick={syncAttribute}>平台属性同步</Button>
<Tooltip title="同步平台维护的属性,同步时按属性结构进行同步。">
<Button type="default" style={{ marginLeft: 16 }} onClick={syncAttribute}>{intl.formatMessage({ id: 'classAndProperty.attribute.actions.button.2' })}</Button>
<Tooltip title={intl.formatMessage({ id: 'classAndProperty.attribute.actions.tooltip' })}>
&nbsp;<QuestionCircleOutlined />
</Tooltip>
</span>
......@@ -285,7 +286,7 @@ const Attribute: React.FC<{}> = () => {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '属性名称',
placeholder: intl.formatMessage({ id: 'classAndProperty.attribute.niceForm.name' }),
advanced: false,
// tip: '输入 属性名称 进行搜索',
},
......@@ -300,7 +301,7 @@ const Attribute: React.FC<{}> = () => {
/>
<ModalTable
modalTitle='同步平台属性'
modalTitle={intl.formatMessage({ id: 'classAndProperty.attribute.modalTable' })}
confirm={handleAsyncOk}
cancel={handleAsyncCancel}
visible={syncVisible}
......@@ -311,7 +312,7 @@ const Attribute: React.FC<{}> = () => {
{
ctx: {
schema: formProduct,
components: { ModalSearch: Search, Submit } ,
components: { ModalSearch: Search, Submit },
effects: ($, actions) => {
actions.reset()
useStateFilterSearchLinkageEffect(
......
import React, { useState, useEffect } from 'react'
import { Row, Col, Form, Input, Select, Card, Checkbox, Tooltip } from 'antd';
import { history } from 'umi';
import { history, useIntl } from 'umi';
import { InfoCircleOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import ReutrnEle from '@/components/ReturnEle';
......@@ -18,15 +18,16 @@ const layout = {
};
const viewAtttributes: React.FC<{}> = () => {
const intl = useIntl();
const [menuForm] = Form.useForm();
const [queryId, setQueryId] = useState('')
const [formValue, setFormValue] = useState<any>({})
useEffect(() => {
const { location } = history
if(location.query.id) {
if (location.query.id) {
setQueryId(location.query.id)
getProductCustomerGetCustomerAttribute({id: location.query.id}).then(res=>{
getProductCustomerGetCustomerAttribute({ id: location.query.id }).then(res => {
const { data } = res
setFormValue(data)
menuForm.setFieldsValue(data)
......@@ -34,104 +35,104 @@ const viewAtttributes: React.FC<{}> = () => {
}
}, [])
return <PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回"/>}
title="查看品类属性"
>
return <PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description={intl.formatMessage({ id: 'classAndProperty.viewAttributes.back' })} />}
title={intl.formatMessage({ id: 'classAndProperty.viewAttributes.title' })}
>
<Card>
<Row gutter={[36, 36]}>
<Col span={16}>
<Form
form={menuForm}
name="edit_infomation"
layout="horizontal"
labelAlign="left"
{...layout}
initialValues={formValue}
>
<Row gutter={24}>
<Col span={18}>
<Form.Item
name='id'
label='属性ID'
>
<Input disabled />
</Form.Item>
</Col>
<Col span={18}>
<Form.Item
name='groupName'
label='属性组名'
>
<Input disabled />
</Form.Item>
</Col>
<Col span={18}>
<Form.Item
name='name'
label='属性名称'
>
<Input disabled />
</Form.Item>
</Col>
<Col span={18}>
<Form.Item
name='type'
label='展示方式'
>
<Select disabled>
<Option value={2}>多选</Option>
<Option value={1}>单选</Option>
<Option value={3}>输入</Option>
</Select>
</Form.Item>
</Col>
<Col span={18}>
<Form
form={menuForm}
name="edit_infomation"
layout="horizontal"
labelAlign="left"
{...layout}
initialValues={formValue}
>
<Row gutter={24}>
<Col span={18}>
<Form.Item
label='属性设置'
name='id'
label={intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.id' })}
>
<Input disabled />
</Form.Item>
</Col>
<Col span={18}>
<Form.Item
name='groupName'
label={intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.groupName' })}
>
<Input disabled />
</Form.Item>
</Col>
<Col span={18}>
<Form.Item
name='name'
label={intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.name' })}
>
<Input disabled />
</Form.Item>
</Col>
<Col span={18}>
<Form.Item
name='type'
label={intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.type' })}
>
<Select disabled>
<Option value={2}>{intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.type.2' })}</Option>
<Option value={1}>{intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.type.1' })}</Option>
<Option value={3}>{intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.type.3' })}</Option>
</Select>
</Form.Item>
</Col>
<Col span={18}>
<Form.Item
label={intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.setting' })}
>
<Row>
<Col span={24}>
<Form.Item name="isEmpty" valuePropName="checked" initialValue={false} noStyle><Checkbox disabled>必填</Checkbox></Form.Item>
<Form.Item name="isEmpty" valuePropName="checked" initialValue={false} noStyle><Checkbox disabled>{intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.setting.isEmpty' })}</Checkbox></Form.Item>
</Col>
<Col span={24}>
<Form.Item name="isImage" valuePropName="checked" initialValue={false} noStyle><Checkbox disabled>上传图片</Checkbox></Form.Item>
<Tooltip title="勾选后对于此属性的属性值可以上传属性值的对应图片!">
<Form.Item name="isImage" valuePropName="checked" initialValue={false} noStyle><Checkbox disabled>{intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.setting.isImage' })}</Checkbox></Form.Item>
<Tooltip title={intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.setting.isImage.tooltip' })}>
<InfoCircleOutlined />
</Tooltip>
</Col>
<Col span={24}>
<Form.Item name="isName" valuePropName="checked" initialValue={false} noStyle><Checkbox disabled>名称属性</Checkbox></Form.Item>
<Tooltip title="勾选后对于此属性的属性值会将属性值添加到商品名称之后,中间以/区隔!">
<Form.Item name="isName" valuePropName="checked" initialValue={false} noStyle><Checkbox disabled>{intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.setting.isName' })}</Checkbox></Form.Item>
<Tooltip title={intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.setting.isName.tooltip' })}>
<InfoCircleOutlined />
</Tooltip>
</Col>
<Col span={24}>
<Form.Item name="isPrice" valuePropName="checked" initialValue={false} noStyle><Checkbox disabled>价格属性</Checkbox></Form.Item>
<Tooltip title="勾选后对于此属性的每个属性值会在商品发布时按属性设置不同的价格!">
<Form.Item name="isPrice" valuePropName="checked" initialValue={false} noStyle><Checkbox disabled>{intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.setting.isPrice' })}</Checkbox></Form.Item>
<Tooltip title={intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.setting.isPrice.tooltip' })}>
<InfoCircleOutlined />
</Tooltip>
</Col>
<Col span={24}>
<Form.Item name="isSearch" valuePropName="checked" initialValue={false} noStyle><Checkbox disabled>搜索属性</Checkbox></Form.Item>
<Tooltip title="勾选后对于此属性会在商城店铺商品列表进行筛选操作时作为筛选项!">
<Form.Item name="isSearch" valuePropName="checked" initialValue={false} noStyle><Checkbox disabled>{intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.setting.isSearch' })}</Checkbox></Form.Item>
<Tooltip title={intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.setting.isSearch.tooltip' })}>
<InfoCircleOutlined />
</Tooltip>
</Col>
</Row>
</Form.Item>
</Col>
<Col span={18}>
<Form.Item
label='状态'
name="isEnable"
>
{formValue.isEnable?<><span className="commonStatusValid"></span>有效</>:<><span className="commonStatusInvalid"></span>无效</>}
</Form.Item>
</Col>
</Row>
</Form>
</Col>
<Col span={18}>
<Form.Item
label={intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.isEnable' })}
name="isEnable"
>
{formValue.isEnable ? <><span className="commonStatusValid"></span>{intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.isEnable.1' })}</> : <><span className="commonStatusInvalid"></span>{intl.formatMessage({ id: 'classAndProperty.viewAttributes.form.isEnable.2' })}</>}
</Form.Item>
</Col>
</Row>
</Form>
</Col>
</Row>
</Card>
......
This diff is collapsed.
import { ISchema } from '@formily/antd';
import { getIntl } from 'umi';
export const classSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
"x-component": "mega-layout",
"x-component-props": {
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
columns: 16,
labelAlign: 'top'
labelAlign: 'top',
},
properties: {
noField1: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
'x-component': 'mega-layout',
'x-component-props': {
full: true,
},
"x-mega-props": {
span: 1
'x-mega-props': {
span: 1,
},
properties: {
name: {
type: 'string',
title: '品类名称',
title: getIntl().formatMessage({id: 'classAndProperty.class.classSchema.name'}),
required: true,
"x-component-props": {
placeholder: '请输入品类名称'
'x-component-props': {
placeholder: getIntl().formatMessage({id: 'classAndProperty.class.classSchema.name.placeholder'}),
},
"x-rules": [
'x-rules': [
{
limitByte: true,
maxByte: 16
}
]
maxByte: 16,
},
],
},
type: {
type: 'number',
title: '品类类型',
title: getIntl().formatMessage({id: 'classAndProperty.class.classSchema.type'}),
required: true,
"x-component-props": {
placeholder: '请选择品类类型'
'x-component-props': {
placeholder: getIntl().formatMessage({id: 'classAndProperty.class.classSchema.type.placeholder'}),
},
enum: [
{ label: '实物商品', value: 1 },
{ label: '虚拟商品', value: 2 },
{ label: '服务商品', value: 3 },
{ label: '积分兑换商品', value: 4 }
{ label: getIntl().formatMessage({id: 'classAndProperty.class.classSchema.type.value.1'}), value: 1 },
{ label: getIntl().formatMessage({id: 'classAndProperty.class.classSchema.type.value.2'}), value: 2 },
{ label: getIntl().formatMessage({id: 'classAndProperty.class.classSchema.type.value.3'}), value: 3 },
{ label: getIntl().formatMessage({id: 'classAndProperty.class.classSchema.type.value.4'}), value: 4 },
],
},
imageUrl: {
title: '品类图片',
'x-component': 'CustomUpload'
title: getIntl().formatMessage({id: 'classAndProperty.class.classSchema.imageUrl'}),
'x-component': 'CustomUpload',
},
category: {
type: "object",
type: 'object',
properties: {
id: {
type: 'number',
display: false
display: false,
},
name: {
type: 'string',
title: '对应平台品类',
title: getIntl().formatMessage({id: 'classAndProperty.class.classSchema.category.name'}),
'x-component-props': {
disabled: true,
addonAfter: "{{connectCategory}}"
addonAfter: '{{connectCategory}}',
},
}
}
},
},
},
sort: {
type: 'number',
title: '品类排序',
title: getIntl().formatMessage({id: 'classAndProperty.class.classSchema.sort'}),
required: true,
"x-component-props": {
placeholder: '请输入品类排序'
'x-component-props': {
placeholder: getIntl().formatMessage({id: 'classAndProperty.class.classSchema.sort.placeholder'}),
},
},
}
},
},
}
}
}
}
},
},
},
};
import React, { useState, useEffect } from 'react';
import { history, Prompt } from 'umi';
import { history, Prompt, useIntl } from 'umi';
import { Button, Card, Spin, message } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined } from '@ant-design/icons';
......@@ -12,7 +12,20 @@ import { useLinkageUtils } from '@/utils/formEffectUtils';
import { getAuth, setAuth } from '@/utils/auth';
import { initDetailSchema } from './schema';
import AreaSelect from '../../../components/AreaSelect';
import { getMemberAbilitySubGet, getMemberAbilitySubPageitemsBasic, getMemberAbilitySubPageitemsChannel, getMemberAbilitySubPageitemsCity, getMemberAbilitySubPageitemsDetail, getMemberAbilitySubPageitemsLevel, getMemberAbilitySubPageitemsProvince, getMemberAbilitySubPageitemsRole, getMemberMainpageDetailGet, postMemberAbilitySubAdd, postMemberAbilitySubUpdate, postMemberMainpageDetailUpdate } from '@/services/MemberV2Api';
import {
getMemberAbilitySubGet,
getMemberAbilitySubPageitemsBasic,
getMemberAbilitySubPageitemsChannel,
getMemberAbilitySubPageitemsCity,
getMemberAbilitySubPageitemsDetail,
getMemberAbilitySubPageitemsLevel,
getMemberAbilitySubPageitemsProvince,
getMemberAbilitySubPageitemsRole,
getMemberMainpageDetailGet,
postMemberAbilitySubAdd,
postMemberAbilitySubUpdate,
postMemberMainpageDetailUpdate,
} from '@/services/MemberV2Api';
const formActions = createFormActions();
const {
......@@ -74,6 +87,8 @@ const MemberForm: React.FC<MemberFormProps> = ({
const [infoLoading, setInfoLoading] = useState(false);
const [unsaved, setUnsaved] = useState(false);
const intl = useIntl();
const getDetailedInfo = async () => {
let infoRes: {
code: number,
......@@ -227,7 +242,7 @@ const MemberForm: React.FC<MemberFormProps> = ({
if (mode === 'myself') {
setSubmitLoading(true);
const msg = message.loading({
content: '正在保存,请稍候...',
content: intl.formatMessage({ id: 'member.management.import.query.form.saving' }),
duration: 0,
});
postMemberMainpageDetailUpdate({
......@@ -243,7 +258,7 @@ const MemberForm: React.FC<MemberFormProps> = ({
company: rest.company_name,
validateMsg: null,
validateStatus: 1,
validateStatusDesc: '待审核',
validateStatusDesc: intl.formatMessage({ id: 'member.status.notAaudit' }), // 待审核
} as any);
setUnsaved(false);
setTimeout(() => {
......@@ -259,7 +274,7 @@ const MemberForm: React.FC<MemberFormProps> = ({
if (!id && isEdit) {
setSubmitLoading(true);
const msg = message.loading({
content: '正在添加,请稍候...',
content: intl.formatMessage({ id: 'member.management.import.query.form.creating' }),
duration: 0,
});
postMemberAbilitySubAdd(payload, {
......@@ -281,7 +296,7 @@ const MemberForm: React.FC<MemberFormProps> = ({
if (id && validateId && isEdit) {
setSubmitLoading(true);
const msg = message.loading({
content: '正在保存,请稍候...',
content: intl.formatMessage({ id: 'member.management.import.query.form.saving' }),
duration: 0,
});
postMemberAbilitySubUpdate({
......@@ -555,8 +570,8 @@ const MemberForm: React.FC<MemberFormProps> = ({
padding: 24,
}}
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
title={!id && mode === 'any' ? '新建会员' : '编辑会员'}
backIcon={<ReutrnEle description={intl.formatMessage({ id: 'common.button.back' })} />}
title={!id && mode === 'any' ? intl.formatMessage({ id: 'member.management.import.query.form.create' }) : intl.formatMessage({ id: 'member.management.import.query.form.edit' })}
extra={[
<Button
key="1"
......@@ -565,7 +580,7 @@ const MemberForm: React.FC<MemberFormProps> = ({
loading={submitLoading}
onClick={() => formActions.submit()}
>
保存
{intl.formatMessage({ id: 'common.button.save' })}
</Button>,
]}
>
......@@ -600,7 +615,7 @@ const MemberForm: React.FC<MemberFormProps> = ({
</Card>
</PageHeaderWrapper>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
<Prompt when={unsaved} message={intl.formatMessage({ id: 'common.tip.save.confirm' })} />
</Spin>
);
};
......
import { getIntl } from 'umi';
import { ISchema } from '@formily/antd';
import { PATTERN_MAPS } from '@/constants/regExp';
import { createMemberSchema, GroupItem } from '../../../../utils';
const intl = getIntl();
export const initDetailSchema = (props: GroupItem[]) => {
let tabSchema: ISchema = {
properties: {
......@@ -9,7 +12,7 @@ export const initDetailSchema = (props: GroupItem[]) => {
type: 'object',
'x-component': 'TabPane',
'x-component-props': {
tab: '基本信息',
tab: intl.formatMessage({ id: 'member.management.import.query.form.basic' }),
},
properties: {
MEGA_LAYOUT1: {
......@@ -24,19 +27,19 @@ export const initDetailSchema = (props: GroupItem[]) => {
memberTypeId: {
type: 'string',
required: true,
title: '会员类型',
title: intl.formatMessage({ id: 'member.management.import.query.form.basic.memberTypeId' }),
enum: [],
'x-component-props': {
placeholder: '请选择',
placeholder: intl.formatMessage({ id: 'member.management.import.query.form.placeholder-select' }),
},
},
roleId: {
type: 'string',
required: true,
title: '会员角色',
title: intl.formatMessage({ id: 'member.management.import.query.form.basic.roleId' }),
enum: [],
'x-component-props': {
placeholder: '请选择',
placeholder: intl.formatMessage({ id: 'member.management.import.query.form.placeholder-select' }),
},
'x-props': {
hasFeedback: true,
......@@ -45,10 +48,10 @@ export const initDetailSchema = (props: GroupItem[]) => {
level: {
type: 'string',
required: true,
title: '会员等级',
title: intl.formatMessage({ id: 'member.management.import.query.form.basic.level' }),
enum: [],
'x-component-props': {
placeholder: '请选择',
placeholder: intl.formatMessage({ id: 'member.management.import.query.form.placeholder-select' }),
},
'x-props': {
hasFeedback: true,
......@@ -58,7 +61,7 @@ export const initDetailSchema = (props: GroupItem[]) => {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
label: '注册手机',
label: intl.formatMessage({ id: 'member.management.import.query.form.basic.phone' }),
required: true,
wrapperCol: 24,
},
......@@ -75,7 +78,7 @@ export const initDetailSchema = (props: GroupItem[]) => {
type: 'string',
enum: [],
'x-component-props': {
placeholder: '请选择',
placeholder: intl.formatMessage({ id: 'member.management.import.query.form.placeholder-select' }),
},
required: true,
},
......@@ -86,13 +89,13 @@ export const initDetailSchema = (props: GroupItem[]) => {
span: 2,
},
'x-component-props': {
placeholder: '请输入你的手机号码',
placeholder: intl.formatMessage({ id: 'member.management.import.query.form.basic.phone.placeholder' }),
maxLength: 11,
},
'x-rules': [
{
pattern: PATTERN_MAPS.phone,
message: '请输入正确格式的手机号',
message: intl.formatMessage({ id: 'member.management.import.query.form.basic.phone.rules-fact' }),
},
],
},
......@@ -102,12 +105,12 @@ export const initDetailSchema = (props: GroupItem[]) => {
},
email: {
type: 'string',
title: '邮箱',
title: intl.formatMessage({ id: 'member.management.import.query.form.basic.email' }),
'x-component-props': {},
'x-rules': [
{
pattern: PATTERN_MAPS.email,
message: '请输入正确格式的邮箱',
message: intl.formatMessage({ id: 'member.management.import.query.form.basic.email.rules-fact' }),
},
],
},
......@@ -119,7 +122,7 @@ export const initDetailSchema = (props: GroupItem[]) => {
type: 'object',
'x-component': 'TabPane',
'x-component-props': {
tab: '渠道信息',
tab: intl.formatMessage({ id: 'member.management.import.query.form.channel' }),
},
properties: {
MEGA_LAYOUT1: {
......@@ -135,7 +138,7 @@ export const initDetailSchema = (props: GroupItem[]) => {
upperRelationId: {
type: 'string',
enum: [],
title: '上级渠道',
title: intl.formatMessage({ id: 'member.management.import.query.form.channel.upperRelationId' }),
required: true,
'x-component-props': {
......@@ -143,12 +146,12 @@ export const initDetailSchema = (props: GroupItem[]) => {
},
channelLevel: {
type: 'text',
title: '渠道级别',
title: intl.formatMessage({ id: 'member.management.import.query.form.channel.channelLevel' }),
},
channelTypeId: {
type: 'string',
enum: [],
title: '渠道类型',
title: intl.formatMessage({ id: 'member.management.import.query.form.channel.channelTypeId' }),
required: true,
'x-component-props': {
......@@ -156,7 +159,7 @@ export const initDetailSchema = (props: GroupItem[]) => {
},
areas: {
type: 'array',
title: '代理城市',
title: intl.formatMessage({ id: 'member.management.import.query.form.channel.areas' }),
required: true,
'x-component': 'CustomAddArray',
default: [],
......@@ -182,12 +185,12 @@ export const initDetailSchema = (props: GroupItem[]) => {
},
remark: {
type: 'string',
title: '渠道描述',
title: intl.formatMessage({ id: 'member.management.import.query.form.channel.remark' }),
required: true,
'x-component': 'TextArea',
'x-component-props': {
rows: 4,
placeholder: '最大200个字符,100个汉字',
placeholder: intl.formatMessage({ id: 'member.management.import.query.form.channel.remark.placeholder' }),
},
'x-rules': [
{
......
import React, { useState, useRef } from 'react';
import { history } from 'umi';
import { history, useIntl } from 'umi';
import {
Card,
Space,
......@@ -54,10 +54,11 @@ const MemberMaintain: React.FC<[]> = () => {
const [visibleModal, setVisibleModal] = useState(false);
const userInfo = getAuth();
const intl = useIntl();
const handleDelete = (memberId: number, validateId: number) => {
const mesInstance = message.loading({
content: '正在删除',
content: intl.formatMessage({ id: 'member.management.import.query.delete-deleting' }),
duration: 0,
});
postMemberAbilitySubDelete({
......@@ -75,7 +76,7 @@ const MemberMaintain: React.FC<[]> = () => {
const handleCommit = (memberId: number, validateId: number) => {
const mesInstance = message.loading({
content: '正在提交',
content: intl.formatMessage({ id: 'member.management.import.query.commit-committing' }),
duration: 0,
});
postMemberAbilitySubCommit({
......@@ -93,7 +94,7 @@ const MemberMaintain: React.FC<[]> = () => {
const defaultColumns: ColumnType<any>[] = [
{
title: '会员ID/名称',
title: `${intl.formatMessage({ id: 'member.management.import.query.memberId' })}/${intl.formatMessage({ id: 'member.management.import.query.memberName' })}`,
dataIndex: 'memberId',
render: (text, record) => (
<>
......@@ -109,32 +110,32 @@ const MemberMaintain: React.FC<[]> = () => {
),
},
{
title: '会员类型',
title: intl.formatMessage({ id: 'member.management.import.query.memberTypeName' }),
dataIndex: 'memberTypeName',
render: (text: any, record: any) => <>{text}</>,
},
{
title: '会员角色',
title: intl.formatMessage({ id: 'member.management.import.query.roleName' }),
dataIndex: 'roleName',
render: (text: any, record: any) => <>{text}</>,
},
{
title: '注册来源',
title: intl.formatMessage({ id: 'member.management.import.query.sourceName' }),
dataIndex: 'sourceName',
},
{
title: '时间',
title: intl.formatMessage({ id: 'member.management.import.query.registerTime' }),
dataIndex: 'registerTime',
},
{
title: '外部状态',
title: intl.formatMessage({ id: 'member.management.import.query.outerStatusName' }),
dataIndex: 'outerStatusName',
render: (text, record) => (
<StatusTag type={MEMBER_OUTER_STATUS_TYPE[record.outerStatus]} title={text} />
),
},
{
title: '操作',
title: intl.formatMessage({ id: 'common.table.action' }),
dataIndex: 'option',
width: '20%',
render: (text: any, record: any) => (
......@@ -146,7 +147,7 @@ const MemberMaintain: React.FC<[]> = () => {
type="link"
onClick={() => handleCommit(record.memberId, record.validateId)}
>
提交平台审核
{intl.formatMessage({ id: 'member.management.import.query.commit' })}
</Button>
</>
)}
......@@ -159,23 +160,23 @@ const MemberMaintain: React.FC<[]> = () => {
history.push(`/memberCenter/memberAbility/manage/import/edit?id=${record.memberId}&validateId=${record.validateId}`)
}
>
编辑
{intl.formatMessage({ id: 'member.management.import.query.edit' })}
</Button>
</>
)}
{/* 外部审核状态不等于 审核通过 可进行删除操作 */}
{record.showDelete && (
<Popconfirm
title="确定要删除吗?"
okText="是"
cancelText="否"
title={intl.formatMessage({ id: 'member.management.import.query.delete-description' })}
okText={intl.formatMessage({ id: 'common.button.yes' })}
cancelText={intl.formatMessage({ id: 'common.button.no' })}
onConfirm={() => handleDelete(record.memberId, record.validateId)}
>
<Button
type="link"
danger
>
删除
{intl.formatMessage({ id: 'member.management.import.query.delete' })}
</Button>
</Popconfirm>
)}
......
import { getIntl } from 'umi';
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
const intl = getIntl();
export const importSchema: ISchema = {
type: 'object',
properties: {
......@@ -23,8 +26,8 @@ export const importSchema: ISchema = {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
tip: '输入 会员名称 进行搜索',
placeholder: intl.formatMessage({ id: 'member.management.import.query.placeholder-name' }),
tip: intl.formatMessage({ id: 'member.management.import.query.placeholder-name-tip' }),
},
},
},
......@@ -43,7 +46,7 @@ export const importSchema: ISchema = {
default: undefined,
enum: [],
'x-component-props': {
placeholder: '会员类型(全部)',
placeholder: intl.formatMessage({ id: 'member.management.import.query.placeholder-memberTypeId' }),
allowClear: true,
style: {
width: 160,
......@@ -55,7 +58,7 @@ export const importSchema: ISchema = {
default: undefined,
enum: [],
'x-component-props': {
placeholder: '会员角色(全部)',
placeholder: intl.formatMessage({ id: 'member.management.import.query.placeholder-roleId' }),
allowClear: true,
style: {
width: 160,
......@@ -67,7 +70,7 @@ export const importSchema: ISchema = {
default: undefined,
enum: [],
'x-component-props': {
placeholder: '外部状态(全部)',
placeholder: intl.formatMessage({ id: 'member.management.import.query.placeholder-outerStatus' }),
allowClear: true,
style: {
width: 160,
......@@ -79,7 +82,7 @@ export const importSchema: ISchema = {
default: '',
'x-component': 'dateSelect',
'x-component-props': {
placeholder: '时间范围(全部)',
placeholder: intl.formatMessage({ id: 'member.management.import.query.placeholder-date' }),
allowClear: true,
style: {
width: 160,
......@@ -92,7 +95,7 @@ export const importSchema: ISchema = {
span: 1,
},
'x-component-props': {
children: '查询',
children: intl.formatMessage({ id: 'member.management.import.query.query' }),
},
},
},
......@@ -100,40 +103,4 @@ export const importSchema: ISchema = {
},
},
},
};
export const auditModalSchema = props => {
let modalSchema: ISchema = {
type: 'object',
properties: {
MEGA_LAYOUT: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelAlign: 'top',
},
properties: {
remark: {
type: 'string',
title: `会员${props.status === 1 ? '解冻' : '冻结'}原因`,
'x-component': 'TextArea',
'x-component-props': {
placeholder: '在此输入你的内容,最长120个字符,60个汉字',
},
'x-rules': [
{
required: true,
message: '请填写审核不通过原因'
},
{
limitByte: true, // 自定义校验规则
maxByte: 120
}
],
},
},
},
},
};
return modalSchema;
};
\ No newline at end of file
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