Commit 6d5017e6 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 待审核品牌国际化

parent 061eb730
......@@ -117,7 +117,7 @@ const CommodityRoute: RouterChild = {
},
// 品牌-新增
{
path: '/memberCenter/commodityAbility/trademarkApply/add',
path: '/memberCenter/commodityAbility/trademark/trademarkApply/add',
name: 'addBrand',
icon: 'smile',
hideInMenu: true,
......@@ -125,7 +125,7 @@ const CommodityRoute: RouterChild = {
},
// 品牌-编辑
{
path: '/memberCenter/commodityAbility/trademarkApply/edit',
path: '/memberCenter/commodityAbility/trademark/trademarkApply/edit',
name: 'editBrand',
icon: 'smile',
hideInMenu: true,
......@@ -133,7 +133,7 @@ const CommodityRoute: RouterChild = {
},
// 品牌-查看
{
path: '/memberCenter/commodityAbility/trademarkApply/detail',
path: '/memberCenter/commodityAbility/trademark/trademarkApply/detail',
name: 'brandDetail',
hideInMenu: true,
icon: 'smile',
......@@ -156,37 +156,6 @@ const CommodityRoute: RouterChild = {
},
]
},
// // 品牌
// {
// path: '/memberCenter/commodityAbility/trademark',
// name: 'trademark',
// icon: 'smile',
// component: '@/pages/trademark',
// },
// // 品牌-新增
// {
// path: '/memberCenter/commodityAbility/trademark/add',
// name: 'addBrand',
// icon: 'smile',
// hideInMenu: true,
// component: '@/pages/trademark/addBrand',
// },
// // 品牌-编辑
// {
// path: '/memberCenter/commodityAbility/trademark/edit',
// name: 'editBrand',
// icon: 'smile',
// hideInMenu: true,
// component: '@/pages/trademark/addBrand',
// },
// // 品牌-查看
// {
// path: '/memberCenter/commodityAbility/trademark/detail',
// name: 'brandDetail',
// hideInMenu: true,
// icon: 'smile',
// component: '@/pages/trademark/viewBrand',
// },
// 商品
{
path: '/memberCenter/commodityAbility/commodity',
......
export default {
'trademark.columns.name':'Brand name',
'trademark.columns.memberName' : 'Member name',
'trademark.columns.check' : 'Check',
'trademark.columns.sourceBrandName':'Original Brand',
'trademark.columns.applyTime':'Apply for review time',
'trademark.columns.isEnable':'Status',
......@@ -76,4 +78,23 @@ export default {
'trademark.addBrand.card.2.logoUrl.extra':'Support JPG/PNG/JPEG, the maximum is not more than 60K, in order to reduce the amount of loaded data, only the first-level project is recommended',
'trademark.addBrand.card.2.logoUrl.message':'Upload a picture!',
};
\ No newline at end of file
'trademark.checkBrand.state.1': 'Pending review',
'trademark.checkBrand.state.2': 'To audit',
'trademark.checkBrand.state.3': 'Audit failed',
'trademark.checkBrand.state.4': 'Pass the audit',
'trademark.checkBrand.state.5': 'Has been on',
'trademark.checkBrand.state.6': 'Remove sth from shelves',
'trademark.checkBrand.description.1': 'Vendor name',
'trademark.checkBrand.description.2': 'Application Review Time',
'trademark.checkBrand.description.3': 'Audit status',
'trademark.checkBrand.description.4': 'State of the brand',
'trademark.checkBrand.extra': 'Brand audit',
'trademark.checkBrand.modal.title': 'Brand audit',
'trademark.checkBrand.modal.message.1': 'Please select Audit status',
'trademark.checkBrand.modal.radio.1': 'Pass the audit',
'trademark.checkBrand.modal.radio.2': 'Audit failed',
'trademark.checkBrand.modal.checkRemark.label': 'Reasons for failure of audit',
'trademark.checkBrand.modal.checkRemark.message': 'Please fill in the reason.',
'trademark.checkBrand.modal.checkRemark.placeholder': 'Please fill in the reason.',
};
export default {
'trademark.columns.name' : '브랜드 이름',
'trademark.columns.memberName' : '회원 이름',
'trademark.columns.check' : '심사하다',
'trademark.columns.sourceBrandName' : '원브랜드',
'trademark.columns.applyTime' : '신청 심사 시간',
'trademark.columns.isEnable' : '컨디션',
......@@ -76,4 +78,23 @@ export default {
'trademark.addBrand.card.2.logoUrl.extra' : '최대 60K 이하의 JPG/PNG/JPEG 지원, 로드 데이터 양을 줄이기 위해 레벨 1 항목만 권장',
'trademark.addBrand.card.2.logoUrl.message' : '사진 업로드!',
'trademark.checkBrand.state.1': '심사 제출을 기다리다',
'trademark.checkBrand.state.2': '심의를 기다리다',
'trademark.checkBrand.state.3': '심사가 통과되지 않다',
'trademark.checkBrand.state.4': '심사를 통과하다',
'trademark.checkBrand.state.5': '이미 진열대에 올랐다',
'trademark.checkBrand.state.6': '진열대에서 이미 내렸다',
'trademark.checkBrand.description.1': '상점 이름',
'trademark.checkBrand.description.2': '신청 심사시간',
'trademark.checkBrand.description.3': '상태 확인',
'trademark.checkBrand.description.4': '브랜드 상태',
'trademark.checkBrand.extra': '브랜드 심의',
'trademark.checkBrand.modal.title': '브랜드 심의',
'trademark.checkBrand.modal.message.1': '감사 상태를 선택하십시오',
'trademark.checkBrand.modal.radio.1': '심사를 통과하다',
'trademark.checkBrand.modal.radio.2': '심사가 통과되지 않다',
'trademark.checkBrand.modal.checkRemark.label': '심사 불통과 사유',
'trademark.checkBrand.modal.checkRemark.message': '이유를 기재해 주십시오',
'trademark.checkBrand.modal.checkRemark.placeholder': '이유를 기재해 주십시오',
};
export default {
'trademark.columns.name' : '品牌名称',
'trademark.columns.memberName' : '会员名称',
'trademark.columns.sourceBrandName' : '原品牌',
'trademark.columns.applyTime' : '申请审核时间',
'trademark.columns.isEnable' : '状态',
......@@ -10,6 +11,7 @@ export default {
'trademark.columns.isEnable.button.2' : '无效',
'trademark.columns.status' : '审核状态',
'trademark.columns.option' : '操作',
'trademark.columns.check' : '审核',
'trademark.columns.option.button.1' : '提交审核',
'trademark.columns.option.button.2' : '修改',
'trademark.columns.option.button.3' : '删除',
......@@ -25,6 +27,7 @@ export default {
'trademark.schema.status.4' : '审核不通过',
'trademark.schema.status.5' : '审核通过',
'trademark.schema.status.placeholder' : '状态',
'trademark.schema.status.placeholder0' : '请输入会员名称',
'trademark.schema.submit' : '查询',
'trademark.viewBrand.brandOpeartionLabel.1' : '提交审核',
......@@ -76,4 +79,22 @@ export default {
'trademark.addBrand.card.2.logoUrl.extra' : '支持JPG/PNG/JPEG,最大不超过 60K,为了减少加载数据量,只建议一级项目使用',
'trademark.addBrand.card.2.logoUrl.message' : '上传图片!',
'trademark.checkBrand.state.1': '待提交审核',
'trademark.checkBrand.state.2': '待审核',
'trademark.checkBrand.state.3': '审核不通过',
'trademark.checkBrand.state.4': '审核通过',
'trademark.checkBrand.state.5': '已上架',
'trademark.checkBrand.state.6': '已下架',
'trademark.checkBrand.description.1': '商家名称',
'trademark.checkBrand.description.2': '申请审核时间',
'trademark.checkBrand.description.3': '审核状态',
'trademark.checkBrand.description.4': '品牌状态',
'trademark.checkBrand.extra': '品牌审核',
'trademark.checkBrand.modal.title': '品牌审核',
'trademark.checkBrand.modal.message.1': '请选择审核状态',
'trademark.checkBrand.modal.radio.1': '审核通过',
'trademark.checkBrand.modal.radio.2': '审核不通过',
'trademark.checkBrand.modal.checkRemark.label': '审核不通过原因',
'trademark.checkBrand.modal.checkRemark.message': '请填写原因',
'trademark.checkBrand.modal.checkRemark.placeholder': '请填写原因',
};
import React, { ReactNode, useRef } from 'react'
import { history } from 'umi'
import React, { ReactNode, useMemo, useRef } from 'react'
import { history, useIntl } from 'umi'
import { Button, Card } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { StandardTable } from 'god'
......@@ -7,6 +7,14 @@ import { ColumnType } from 'antd/lib/table/interface'
import moment from 'moment'
import EyePreview from '@/components/EyePreview'
import { getProductBrandGetPlatformBrandList } from '@/services/ProductV2Api'
import NiceForm from '@/components/NiceForm'
import { createFormActions } from '@formily/antd'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import Submit from '@/components/NiceForm/components/Submit'
import useSetSearchValueInTable from '@/hooks/useSetSearchValueInTable'
const formActions = createFormActions();
/**
* 待审核品牌列表
......@@ -14,10 +22,36 @@ import { getProductBrandGetPlatformBrandList } from '@/services/ProductV2Api'
*/
const CheckBrand: React.FC<{}> = () => {
const ref = useRef<any>({})
const intl = useIntl();
/** 带参数查询,给表单带默认值 */
const { searchData, formatInitialValue, clear } = useSetSearchValueInTable();
const formatedFormValue = useMemo(() => {
const value = formatInitialValue?.value || {};
if (value && "status" in value) {
return {
value: {
...value,
status: +value.status
}
}
}
return value
}, [formatInitialValue])
const fetchData = (params: any) => {
const searchParams = {
...searchData,
...params,
}
const postData = {
...searchParams,
name: searchParams?.name || '',
status: 2,
}
return new Promise((resolve, reject) => {
getProductBrandGetPlatformBrandList({ ...params, name: params.name || '', status: 2 }).then(res => {
getProductBrandGetPlatformBrandList(postData).then(res => {
const { data } = res
resolve(data)
})
......@@ -31,56 +65,48 @@ const CheckBrand: React.FC<{}> = () => {
key: 'id',
},
{
title: '品牌名称',
title: intl.formatMessage({id: 'trademark.columns.name'}),
dataIndex: 'name',
key: 'name',
className: 'commonPickColor',
render: (text: any, record: any) => <EyePreview
url={`/productManage/trademark/trademarkWillCheck/detail?id=${record.id}&preview=1`}
>
render: (text, record) => <EyePreview url={`/memberCenter/commodityAbility/trademark/trademarkWillCheck/detail?id=${record.id}&preview=1`}>
{text}
</EyePreview>
},
{
title: '商家名称',
title: intl.formatMessage({id: 'trademark.columns.memberName'}),
dataIndex: 'memberName',
key: 'memberName',
},
{
title: '申请审核时间',
title: intl.formatMessage({id: 'trademark.columns.applyTime'}),
dataIndex: 'applyTime',
key: 'applyTime',
render: (text: any, record: any) => text && moment(text).format('YYYY-MM-DD HH:mm:ss'),
render: text => text && moment(text).format('YYYY-MM-DD HH:mm:ss'),
defaultSortOrder: 'descend',
sorter: (a, b) => a.applyTime - b.applyTime,
},
{
title: '审核状态',
title: intl.formatMessage({id: 'trademark.columns.status'}),
dataIndex: 'status',
key: 'status',
render: (text: any, record: any) => {
render: (text, record) => {
let component: ReactNode = null
if (record.status === 1)
component = (<><span className="commonStatusInvalid"></span>待提交审核</>)
component = (<><span className="commonStatusInvalid"></span>{intl.formatMessage({id: 'trademark.schema.status.2'})}</>)
else if (record.status === 2)
component = (<><span className="commonStatusModify"></span>待审核</>)
component = (<><span className="commonStatusModify"></span>{intl.formatMessage({id: 'trademark.schema.status.3'})}</>)
else if (record.status === 3)
component = (<><span className="commonStatusStop"></span>审核不通过</>)
component = (<><span className="commonStatusStop"></span>{intl.formatMessage({id: 'trademark.schema.status.4'})}</>)
else if (record.status === 4)
component = (<><span className="commonStatusValid"></span>审核通过</>)
component = (<><span className="commonStatusValid"></span>{intl.formatMessage({id: 'trademark.schema.status.5'})}</>)
return component
}
},
{
title: '操作',
title: intl.formatMessage({id: 'trademark.columns.option'}),
dataIndex: 'option',
render: (text: any, record: any) => {
return (
<>
<Button type='link' onClick={() => history.push(`/productManage/trademark/trademarkWillCheck/detail?id=${record.id}`)}>审核</Button>
</>
)
}
render: (text, record) => <Button type='link' onClick={() => history.push(`/memberCenter/commodityAbility/trademark/trademarkWillCheck/detail?id=${record.id}`)}>{intl.formatMessage({id: 'trademark.columns.check'})}</Button>
}
]
......@@ -91,36 +117,94 @@ const CheckBrand: React.FC<{}> = () => {
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
formilyProps={{
layouts: {
span: 4,
},
ctx: {
inline: false,
schema: {
controlRender={
<NiceForm
actions={formActions}
components={{
Submit
}}
effects={($, action) => {
useStateFilterSearchLinkageEffect(
$,
action,
'name',
FORM_FILTER_PATH,
);
}}
schema={{
type: 'object',
properties: {
megaLayout0: {
mageLayout: {
type: 'object',
'x-component': 'mega-layout',
"x-component-props": {
grid: true,
columns: 2,
},
properties: {
name: {
type: 'string',
topLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
placeholder: '品牌名称',
grid: true,
},
'x-component': 'Search'
}
}
}
properties: {
name: {
type: 'string',
"x-component": 'Search',
'x-component-props': {
placeholder: intl.formatMessage({id: 'trademark.schema.name'}),
align: 'flex-end',
},
}
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
},
colStyle: {
marginLeft: 20,
},
},
properties: {
memberName: {
type: 'string',
'x-component-props': {
placeholder: intl.formatMessage({id: 'trademark.schema.status.placeholder0'}),
}
},
status: {
type: 'string',
enum: [
{ label: intl.formatMessage({id: 'trademark.schema.status.1'}), value: 0 },
{ label: intl.formatMessage({id: 'trademark.schema.status.2'}), value: 1 },
{ label: intl.formatMessage({id: 'trademark.schema.status.3'}), value: 2 },
{ label: intl.formatMessage({id: 'trademark.schema.status.4'}), value: 3 },
{ label: intl.formatMessage({id: 'trademark.schema.status.5'}), value: 4 }
],
'x-component-props': {
placeholder: intl.formatMessage({id: 'trademark.schema.status.placeholder'}),
}
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: intl.formatMessage({id: 'trademark.schema.submit'}),
},
},
},
},
},
},
}
}
}
}}
}}
onSubmit={values => ref.current.reload(values)}
onReset={() => {
clear()
}}
{...formatedFormValue}
/>
}
/>
</Card>
</PageHeaderWrapper>
......
This diff is collapsed.
......@@ -78,7 +78,6 @@ const Trademark: React.FC<{}> = () => {
},
{
title: intl.formatMessage({id: 'trademark.columns.sourceBrandName'}),
// dataIndex: ['sourceBrand', 'name'],
dataIndex: 'sourceBrandName',
key: 'sourceBrandName',
},
......@@ -131,7 +130,7 @@ const Trademark: React.FC<{}> = () => {
<Dropdown overlay={
<Menu>
<Menu.Item>
<Button type='link' onClick={() => history.push(`/memberCenter/commodityAbility/trademark/edit?id=${record.id}`)}>{intl.formatMessage({id: 'trademark.columns.option.button.2'})}</Button>
<Button type='link' onClick={() => history.push(`/memberCenter/commodityAbility/trademark/trademarkApply/edit?id=${record.id}`)}>{intl.formatMessage({id: 'trademark.columns.option.button.2'})}</Button>
</Menu.Item>
<Menu.Item>
<Button onClick={() => handelDelete(record)} type='link'>{intl.formatMessage({id: 'trademark.columns.option.button.3'})}</Button>
......@@ -147,7 +146,7 @@ const Trademark: React.FC<{}> = () => {
<>
{
record.isEnable && <>
<Button type='link' onClick={() => history.push(`/memberCenter/commodityAbility/trademark/add?id=${record.id}`)}>{intl.formatMessage({id: 'trademark.columns.option.button.2'})}</Button>
<Button type='link' onClick={() => history.push(`/memberCenter/commodityAbility/trademark/trademarkApply/add?id=${record.id}`)}>{intl.formatMessage({id: 'trademark.columns.option.button.2'})}</Button>
</>
}
{
......@@ -162,7 +161,7 @@ const Trademark: React.FC<{}> = () => {
];
const handleSee = (record: any) => {
history.push(`/memberCenter/commodityAbility/trademark/detail?id=${record.id}`)
history.push(`/memberCenter/commodityAbility/trademark/trademarkApply/detail?id=${record.id}`)
}
const confirmUpdate = (record: any) => {
......@@ -201,7 +200,7 @@ const Trademark: React.FC<{}> = () => {
}
const Actions = <Space>
<Button type="primary" icon={<PlusOutlined />} onClick={() => history.push('/memberCenter/commodityAbility/trademark/add')}>
<Button type="primary" icon={<PlusOutlined />} onClick={() => history.push('/memberCenter/commodityAbility/trademark/trademarkApply/add')}>
{intl.formatMessage({id: 'trademark.actions'})}
</Button>
</Space>
......@@ -213,7 +212,6 @@ const Trademark: React.FC<{}> = () => {
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
......@@ -230,9 +228,6 @@ const Trademark: React.FC<{}> = () => {
'name',
FORM_FILTER_PATH,
);
// $('onFieldValueChange', 'status').subscribe(state => {
// ref.current.reload({current:1, pageSize: 10, status: state.value})
// })
}}
schema={{
type: 'object',
......@@ -309,73 +304,6 @@ const Trademark: React.FC<{}> = () => {
{...formatedFormValue}
/>
}
// formilyLayouts={{
// justify: 'space-between'
// }}
// formilyProps={{
// layouts: {
// order: 1,
// span: 8,
// },
// ctx: {
// inline: false,
// effects: ($, action) => {
// $('onFieldValueChange', 'status').subscribe(state => {
// ref.current.reload({current:1, pageSize: 10, status: state.value})
// })
// },
// schema: {
// type: 'object',
// properties: {
// megaLayout0: {
// type: 'object',
// 'x-component': 'mega-layout',
// "x-component-props": {
// grid: true,
// columns: 2,
// },
// properties: {
// status: {
// type: 'string',
// enum: [
// { label: '全部', value: 0 },
// { label: '待提交审核', value: 1 },
// { label: '待审核', value: 2 },
// { label: '审核不通过', value: 3 },
// { label: '审核通过', value: 4 }
// ],
// // default: 0,
// 'x-component-props': {
// placeholder: '状态',
// }
// },
// name: {
// type: 'string',
// 'x-component-props': {
// placeholder: '品牌名称',
// },
// 'x-component': 'Search'
// }
// }
// }
// }
// }
// }
// }}
// formilyChilds={{
// layouts: {
// order: 0
// },
// children: (
// <>
// <Button type="primary" icon={<PlusOutlined />} onClick={() => history.push('/memberCenter/commodityAbility/trademark/add')}>
// 新建
// </Button>
// </>
// )
// }}
/>
</Card>
</PageHeaderWrapper>
......
......@@ -25,7 +25,7 @@ const BrandOpeartionLabel = [
const viewBrand: React.FC<{}> = () => {
const intl = useIntl();
const [queryId, setQueryId] = useState<number>(null)
const [queryId, setQueryId] = useState(null)
const [brandInfo, setBrandInfo] = useState<any>({})
const [fixStep, setFixStep] = useState(0)
const [recordData, setRecordData] = useState<any[]>([])
......
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