Commit 0a684b24 authored by GuanHua's avatar GuanHua

feat: 装修相关翻译文案抽取

parent 888ed036
......@@ -35,7 +35,6 @@
"build:v2scm": "cross-env PRO_ENV=v2scm yarn build",
"build:v2-demo": "cross-env PRO_ENV=v2-demo yarn build",
"build:v2Test": "cross-env SITE_ID=1 BACK_GATEWAY=http://lx-pre-gateway.shushangyun.com USE_ROUTE_CONFIG=false SOCKET_URL=ws://lx-pre-gateway.shushangyun.com yarn build",
"postinstall": "umi generate tmp",
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
"test": "umi-test",
"test:coverage": "umi-test --coverage",
......
......@@ -6,6 +6,7 @@ import shop from './zh-CN/shop'
import priceManage from './zh-CN/priceManage'
import classAndProperty from './zh-CN/classAndProperty'
import member from './zh-CN/member'
import editor from './zh-CN/editor'
export default {
'global.siteName': '瓴犀',
......@@ -17,4 +18,5 @@ export default {
...priceManage,
...classAndProperty,
...member,
...editor,
}
......@@ -4,6 +4,7 @@
export default {
/** button */
'common.button.save': '保存',
'common.button.confirm': '确定',
'common.button.cancel': '取消',
'common.button.add': '新建',
'common.button.modify': '修改',
......@@ -20,10 +21,12 @@
/** tips */
'common.tip.save.confirm': '您还有未保存的内容,是否确定要离开?',
'common.tip.option.confirm': '确定要执行这个操作?',
'common.tip.select.required': '请选择一条记录',
/** table */
'common.table.action': "操作",
'common.table.status': "状态",
'common.table.columns.memberName': "商家名称",
/** status */
'common.status.effective': '有效',
......@@ -37,8 +40,16 @@
'common.text.longest': '最长',
'common.text.select': '选择',
'common.text.most': '最多',
'common.text.platform': '平台',
'common.text.business': '商家',
'common.text.search': '搜索',
/** form */
'common.form.name.placeholder': '请输入姓名',
'common.form.startTime.placeholder': '开始时间',
'common.form.endTime.placeholder': '结束时间',
'common.form.activity.startTime.placeholder': '活动开始时间',
'common.form.activity.endTime.placeholder': '活动结束时间',
}
/**
* 装修相关
*/
export default {
'editor.menu.home': '首页',
'editor.menu.commodity': '商品',
'editor.menu.integral': '积分兑换',
'editor.menu.infomation': '行情资讯',
'editor.menu.about': '关于我们',
'editor.left.components.mymodule': '我的模块',
'editor.drawer.activity.columns.name': '活动信息',
'editor.drawer.activity.columns.activityName': '活动名称',
'editor.drawer.activity.columns.activityType': '活动类型',
'editor.drawer.activity.columns.templateName': '类型',
'editor.drawer.activity.columns.startTime': '有效期',
'editor.drawer.activity.columns.memberName': '所属',
'editor.drawer.activity.title': '选择活动',
'editor.drawer.activity.product.title': '选择活动商品',
'editor.drawer.activity.product.search.id': '输入活动ID进行搜索',
'editor.drawer.activity.columns.productInfo': '商品信息',
'editor.columns.category': '品类',
'editor.columns.brand': '品牌',
'editor.columns.memberName': '商家名称',
'editor.columns.unit': '单价',
'editor.columns.activityPrice': '活动价',
}
import { FormattedMessage } from 'umi'
export const menuData = [
{
"path": "/shop",
"name": "首页",
"name": <FormattedMessage id='editor.menu.home' />,
"key": "shopHome",
},
{
"path": "/shop/commodity",
"name": "商品",
"name": <FormattedMessage id='editor.menu.commodity' />,
"key": "shopCommodity",
},
{
"path": "/shop/pointsMall",
"name": "积分兑换",
"name": <FormattedMessage id='editor.menu.integral' />,
"key": "shopPointsMall",
},
{
"path": "/shop/infomation",
"name": "行情资讯",
"name": <FormattedMessage id='editor.menu.infomation' />,
"key": "shopInfomation",
},
{
"path": "/shop/about",
"name": "关于我们",
"name": <FormattedMessage id='editor.menu.about' />,
"key": "shopAbout",
},
]
import React, { useEffect, useState } from 'react';
import { cloneDeep, map } from 'lodash';
import { useIntl } from 'umi'
import { EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons'
import cx from 'classnames'
import { selectComponent, PageConfigType, PropsType, ChildNodesType, SelectedInfoBaseType, SelectedInfoType, clearSelectedStatus, STATE_PROPS, produce } from '@lingxi-design/core';
......@@ -31,7 +32,7 @@ type SettingPanelType = {
const AllComponents = () => {
const [allComponents, setAllComponents] = useState<VirtualDOMType[]>([]);
const { selectedInfo, pageConfig } = useSelector<SettingPanelType, STATE_PROPS>(['selectedInfo', 'pageConfig']);
const intl = useIntl()
useEffect(() => {
const newList: VirtualDOMType[] = []
......@@ -75,7 +76,7 @@ const AllComponents = () => {
return (
<div className={styles.allcomponents_container}>
<div className={styles.header}>
<span>我的模块</span>
<span>{intl.formatMessage({ id: 'editor.left.components.mymodule' })}</span>
</div>
<div className={styles.components_list}>
{
......
import React, { useState, useRef, useMemo, useEffect } from 'react';
import { history } from 'umi';
import { history, useIntl } from 'umi';
import { Drawer, Button, Radio, message, Space, Typography } from 'antd';
import { PlayCircleOutlined, PoweroffOutlined } from '@ant-design/icons';
import { StandardTable } from 'god';
......@@ -13,12 +13,6 @@ import StatusTag from '@/components/StatusTag'
import { getTemplateWebActivityPageListAdorn } from '@/services/TemplateV2Api';
import * as tableSchemas from './schema';
// const options = [
// { label: '平台', value: 1 },
// { label: '商家', value: 2 },
// ];
interface ActivityDrawerProps {
visible: boolean,
onClose: () => void,
......@@ -38,13 +32,15 @@ const ActivityDrawer: React.FC<ActivityDrawerProps> = (props: ActivityDrawerProp
return tableSchemas[`ActivitySchema${type}`]
}, [type])
const intl = useIntl()
useEffect(() => {
setSelectedRowKeys(selectId ? [selectId] : []);
}, [selectId])
const columns = [
{
title: '活动信息',
title: intl.formatMessage({ id: 'editor.drawer.activity.columns.name' }),
dataIndex: 'name',
key: 'name',
render: (text: any, record: any) => (
......@@ -58,12 +54,12 @@ const ActivityDrawer: React.FC<ActivityDrawerProps> = (props: ActivityDrawerProp
)
},
{
title: '类型',
title: intl.formatMessage({ id: 'editor.drawer.activity.columns.templateName' }),
dataIndex: 'templateName',
key: 'templateName'
},
{
title: '有效期',
title: intl.formatMessage({ id: 'editor.drawer.activity.columns.startTime' }),
dataIndex: 'startTime',
key: 'startTime',
render: (_: any, record: any) => <>
......@@ -72,12 +68,12 @@ const ActivityDrawer: React.FC<ActivityDrawerProps> = (props: ActivityDrawerProp
</>
},
{
title: '所属',
title: intl.formatMessage({ id: 'editor.drawer.activity.columns.memberName' }),
dataIndex: 'memberName',
key: 'memberName',
render: (text: any, record: any) => (
<Space direction='vertical'>
<StatusTag title={record.type === 1 ? '平台' : '商家'} type={record.type === 1 ? 'success' : 'primary'} />
<StatusTag title={record.type === 1 ? intl.formatMessage({ id: 'common.text.platform' }) : intl.formatMessage({ id: 'common.text.business' })} type={record.type === 1 ? 'success' : 'primary'} />
{record.type === 2 && <Typography.Text type='secondary'>{text}</Typography.Text>}
</Space>
)
......@@ -88,15 +84,10 @@ const ActivityDrawer: React.FC<ActivityDrawerProps> = (props: ActivityDrawerProp
if (selectedRows.length > 0) {
onConfirm?.(selectedRows[0]);
} else {
message.warning('请选择一条记录')
message.warning(intl.formatMessage({ id: 'common.tip.select.required' }))
}
}
const _onRadioChange = (e: any) => {
setType(e.target.value);
ref?.current?.reload();
}
const fetchTableData = async (params: any) => {
const _params = { ...params, environment, type, shopId }
const { data } = await getTemplateWebActivityPageListAdorn(_params);
......@@ -119,13 +110,13 @@ const ActivityDrawer: React.FC<ActivityDrawerProps> = (props: ActivityDrawerProp
bodyStyle={drawerStyle}
footerStyle={drawerStyle}
width={1200}
title={'选择活动'}
title={intl.formatMessage({ id: 'editor.drawer.activity.title' })}
visible={visible}
onClose={onClose}
footer={
<div style={{ textAlign: 'right', }}>
<Button onClick={onClose} style={{ marginRight: 8 }}>取消</Button>
<Button onClick={_onConfirm} type="primary">确定</Button>
<Button onClick={onClose} style={{ marginRight: 8 }}>{intl.formatMessage({ id: 'common.button.cancel' })}</Button>
<Button onClick={_onConfirm} type="primary">{intl.formatMessage({ id: 'common.button.confirm' })}</Button>
</div>
}
>
......@@ -158,22 +149,6 @@ const ActivityDrawer: React.FC<ActivityDrawerProps> = (props: ActivityDrawerProp
span: 16
}
}}
// formilyChilds={{
// children: (
// <div style={{ textAlign: 'right' }}>
// <Radio.Group
// options={options}
// onChange={_onRadioChange}
// value={type}
// optionType="button"
// />
// </div>
// ),
// layouts: {
// order: 2,
// span: 8
// }
// }}
/>
</Drawer>
)
......
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { FormattedMessage } from 'umi'
export const ActivitySchema1: ISchema = {
type: 'object',
......@@ -8,7 +9,7 @@ export const ActivitySchema1: ISchema = {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '搜索',
placeholder: <FormattedMessage id='common.text.search' />,
allowClear: true,
align: 'flex-start',
},
......@@ -30,7 +31,7 @@ export const ActivitySchema1: ISchema = {
type: 'array',
'x-component': 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
placeholder: [<FormattedMessage id='common.form.startTime.placeholder' />, <FormattedMessage id='common.form.endTime.placeholder' />],
allowClear: true,
},
},
......@@ -40,7 +41,7 @@ export const ActivitySchema1: ISchema = {
span: 1,
},
'x-component-props': {
children: '查询',
children: <FormattedMessage id='common.button.query' />,
},
},
},
......@@ -55,7 +56,7 @@ export const ActivitySchema2: ISchema = {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '搜索',
placeholder: <FormattedMessage id='common.text.search' />,
allowClear: true,
align: 'flex-start',
},
......@@ -76,7 +77,7 @@ export const ActivitySchema2: ISchema = {
memberName: {
type: 'string',
'x-component-props': {
placeholder: '商家名称',
placeholder: <FormattedMessage id='common.table.columns.memberName' />,
allowClear: true,
},
},
......@@ -84,7 +85,7 @@ export const ActivitySchema2: ISchema = {
type: 'array',
'x-component': 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
placeholder: [<FormattedMessage id='common.form.startTime.placeholder' />, <FormattedMessage id='common.form.endTime.placeholder' />],
allowClear: true,
},
},
......@@ -94,7 +95,7 @@ export const ActivitySchema2: ISchema = {
span: 1,
},
'x-component-props': {
children: '查询',
children: <FormattedMessage id='common.button.query' />,
},
},
},
......
/* eslint-disable react/display-name */
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { Drawer, Table, Button, Space, Pagination, Spin } from 'antd';
import { Drawer, Table, Button, Space, Pagination } from 'antd';
import { useIntl, FormattedMessage} from 'umi'
import NiceForm from '@/components/NiceForm';
import { createFormActions } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
......@@ -33,7 +34,7 @@ type SubmitType = {
const columns: ColumnsType<GetMarketingAdornMerchantActivityListAdornResponseDetail["goodsList"][0]> = [
{
title: '商品信息',
title: <FormattedMessage id='editor.drawer.activity.columns.productInfo' />,
dataIndex: 'productInfo',
render: (_text, _record) => {
return (
......@@ -46,22 +47,22 @@ const columns: ColumnsType<GetMarketingAdornMerchantActivityListAdornResponseDet
},
{
title: '品类',
title: <FormattedMessage id='editor.drawer.activity.columns.category' />,
dataIndex:'category',
render: (_text) => {
return <StatusTag title={_text} type="default" />;
}
},
{
title: '品牌',
title: <FormattedMessage id='editor.drawer.activity.columns.brand' />,
dataIndex: 'brand'
},
{
title: '商家名称',
title: <FormattedMessage id='editor.drawer.activity.columns.memberName' />,
dataIndex: 'memberName',
},
{
title: '单价',
title: <FormattedMessage id='editor.drawer.activity.columns.unit' />,
dataIndex: 'unit',
render: (_text, _record) => {
return (
......@@ -73,7 +74,7 @@ const columns: ColumnsType<GetMarketingAdornMerchantActivityListAdornResponseDet
}
},
{
title: '活动价',
title: <FormattedMessage id='editor.drawer.activity.columns.activityPrice' />,
dataIndex: 'activityPrice',
render: (_text, _record) => {
return (
......@@ -97,6 +98,7 @@ const ActivityProductDrawer: React.FC<Iprops> = (props: Iprops) => {
const [selectedActivityProductList, setSelectedActivityProductList] = useState<GetMarketingAdornMerchantActivityListAdornResponseDetail["goodsList"]>();
const [checkedProduct, setCheckedProduct] = useState<GetMarketingAdornMerchantActivityListAdornResponseDetail["goodsList"]>([]);
const [loading, setLoading] = useState<boolean>(false);
const intl = useIntl()
const selectedRowKeys = useMemo(() => checkedProduct.map((_item) => `${_item.activityId!}-${_item.id!}`), [checkedProduct]);
......@@ -186,14 +188,14 @@ const ActivityProductDrawer: React.FC<Iprops> = (props: Iprops) => {
headerStyle={drawerStyle}
bodyStyle={drawerStyle}
footerStyle={drawerStyle}
title="选择活动商品"
title={intl.formatMessage({ id: 'editor.drawer.activity.product.title' })}
visible={visible}
width={950}
footer={
<div className={styles.drawerFooter}>
<Space>
<Button onClick={handleCancel}>取消</Button>
<Button onClick={handleOk}>确定</Button>
<Button onClick={handleCancel}>{intl.formatMessage({ id: 'common.button.cancel' })}</Button>
<Button onClick={handleOk}>{intl.formatMessage({ id: 'common.button.confirm' })}</Button>
</Space>
</div>
}
......
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ISchema } from '@formily/antd';
import { FormattedMessage } from 'umi'
const schema: ISchema = {
type: 'object',
......@@ -12,9 +13,9 @@ const schema: ISchema = {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
placeholder: <FormattedMessage id='common.text.search' />,
align: 'flex-left',
tip: '输入活动ID进行搜索',
tip: <FormattedMessage id='editor.drawer.activity.product.search.id' />,
},
},
[FORM_FILTER_PATH]: {
......@@ -29,14 +30,14 @@ const schema: ISchema = {
activityName: {
type: 'string',
"x-component-props": {
placeholder: '活动名称'
placeholder: <FormattedMessage id='editor.drawer.activity.columns.activityName' />
}
},
activityType: {
type: 'string',
enum: [],
"x-component-props": {
placeholder: '活动类型'
placeholder: <FormattedMessage id='editor.drawer.activity.columns.activityType' />
}
},
'[startTime, endTime]': {
......@@ -45,19 +46,19 @@ const schema: ISchema = {
},
type: 'daterange',
'x-component-props': {
placeholder: ['活动开始时间', "活动结束时间"]
placeholder: [<FormattedMessage id='common.form.activity.startTime.placeholder' />, <FormattedMessage id='common.form.activity.endTime.placeholder' />]
}
},
product: {
type: 'string',
"x-component-props": {
placeholder: '活动名称'
placeholder: <FormattedMessage id='editor.drawer.activity.columns.activityName' />
}
},
merchantName: {
type: 'string',
"x-component-props": {
placeholder: '商家名称'
placeholder: <FormattedMessage id='common.table.columns.memberName' />
}
},
submit: {
......@@ -66,7 +67,7 @@ const schema: ISchema = {
span: 1,
},
'x-component-props': {
children: '查询',
children: <FormattedMessage id='common.text.query' />,
},
},
},
......
.selectBox {
width: 100%;
}
.text_line {
margin-bottom: 8px;
&>span {
color: #909399;
}
&>label {
color: #303133;
margin: 0 3px;
}
}
\ No newline at end of file
import React from 'react'
import { Modal, Form, Select, Checkbox } from 'antd'
import styles from './index.less'
interface UseModalPropsType {
visible: boolean;
onOk: Function;
onCancel: Function;
title: string;
type: string;
}
const UseModal: React.FC<UseModalPropsType> = (props) => {
const { visible, onOk, onCancel, title, type } = props
const [form] = Form.useForm()
const layout = {
labelCol: { span: 24 },
wrapperCol: { span: 24 },
};
return (
<Modal
width={576}
title={title}
visible={visible}
onOk={() => onOk()}
centered
onCancel={() => onCancel()}
>
<Form {...layout} form={form}>
<Form.Item
name="station"
label="选择站点"
rules={[{ required: true }]}
>
<Select className={styles.selectBox}>
<Select.Option value="1">中国站</Select.Option>
<Select.Option value="2">美国站</Select.Option>
</Select>
</Form.Item>
<Form.Item
name="shopCenter"
label="选择商城"
rules={[{ required: true }]}
>
<Select className={styles.selectBox}>
<Select.Option value="1">WEB商城</Select.Option>
<Select.Option value="2">H5商城</Select.Option>
</Select>
</Form.Item>
{
type === "shop" ? (
<div>
<Checkbox >允许使用</Checkbox>
</div>
) : (
<>
<div className={styles.text_line}>
<span>您选择的站点</span>
<label>美国站-WEB商城</label>
<span>现在使用的模板是</span>
<label>“模板003-清新类”</label>
<span>模板,</span>
</div>
<div className={styles.text_line}>
<span>您是否使用</span>
<label>“模板001-清新类”</label>
<span>模板,来替换您正在使用的模板</span>
</div>
</>
)
}
</Form>
</Modal>
)
}
export default UseModal
......@@ -370,7 +370,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
}}
>
<div className={styles['wrapper']}>
<ToolBar />
<ToolBar type={2} />
<div className={styles['content']}>
<div className={styles['canvas-container']}>
<DesignPanel onlyEidt theme={theme} pageConfig={componentConfigs} />
......
......@@ -248,7 +248,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
}}
>
<div className={styles['wrapper']}>
<ToolBar type={2} title="首页" />
<ToolBar type={2} />
<div className={styles['content']}>
<div className={styles['canvas-container']}>
<PreviewPanel onlyEidt theme={theme} pageConfig={componentConfigs} />
......
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