diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 091a95f..b228ae8 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -33,6 +33,8 @@ "Success": "Success", "Failed": "Failed", + "All": "All", + "Table": { "Total": "Total {{total}} items" }, diff --git a/public/locales/en/products.json b/public/locales/en/products.json index 0e90423..667c143 100644 --- a/public/locales/en/products.json +++ b/public/locales/en/products.json @@ -101,5 +101,11 @@ "sureCancel":"Sure you want to cancel?", "sureDelete":"Sure you want to delete?", + "CopyFormMsg": { + "requiredVendor": "Please pick a target vendor", + "requiredTypes": "Please select product types", + "requiredDept": "Please pick a owner department" + }, + "#": "#" } diff --git a/public/locales/zh/common.json b/public/locales/zh/common.json index cea837c..dd6e73e 100644 --- a/public/locales/zh/common.json +++ b/public/locales/zh/common.json @@ -33,6 +33,8 @@ "Success": "成功", "Failed": "失败", + "All": "所有", + "Table": { "Total": "共 {{total}} 条" }, diff --git a/public/locales/zh/products.json b/public/locales/zh/products.json index 3fe9c47..239af49 100644 --- a/public/locales/zh/products.json +++ b/public/locales/zh/products.json @@ -102,5 +102,11 @@ "sureCancel": "确定取消?", "sureDelete":"确定删除?", + "CopyFormMsg": { + "requiredVendor": "请选择目标供应商", + "requiredTypes": "请选择产品类型", + "requiredDept": "请选择所属小组" + }, + "#": "#" } diff --git a/src/components/DeptSelector.jsx b/src/components/DeptSelector.jsx new file mode 100644 index 0000000..ab8911c --- /dev/null +++ b/src/components/DeptSelector.jsx @@ -0,0 +1,61 @@ +import { Component } from 'react'; +import { Select } from 'antd'; +// import { groups, leafGroup } from '../../libs/ht'; + +/** + * 小组 + */ +export const groups = [ + { value: '1,2,28,7,33', key: '1,2,28,7,33', label: 'GH事业部', code: 'GH', children: [1, 2, 28, 7, 33] }, + { value: '8,9,11,12,20,21', key: '8,9,11,12,20,21', label: '国际事业部', code: 'INT', children: [8, 9, 11, 12, 20, 21] }, + { value: '10,18,16,30', key: '10,18,16,30', label: '孵化学院', code: '', children: [10, 18, 16, 30] }, + { value: '1', key: '1', label: 'CH直销', code: '', children: [] }, + { value: '2', key: '2', label: 'CH大客户', code: '', children: [] }, + { value: '28', key: '28', label: 'AH亚洲项目组', code: 'AH', children: [] }, + { value: '33', key: '33', label: 'GH项目组', code: '', children: [] }, + { value: '7', key: '7', label: '市场推广', code: '', children: [] }, + { value: '8', key: '8', label: '德语', code: '', children: [] }, + { value: '9', key: '9', label: '日语', code: '', children: [] }, + { value: '11', key: '11', label: '法语', code: '', children: [] }, + { value: '12', key: '12', label: '西语', code: '', children: [] }, + { value: '20', key: '20', label: '俄语', code: '', children: [] }, + { value: '21', key: '21', label: '意语', code: '', children: [] }, + { value: '10', key: '10', label: '商旅', code: '', children: [] }, + { value: '18', key: '18', label: 'CT', code: 'CT', children: [] }, + { value: '16', key: '16', label: 'APP', code: 'APP', children: [] }, + { value: '30', key: '30', label: 'Trippest', code: 'TP', children: [] }, + { value: '31', key: '31', label: '花梨鹰', code: '', children: [] }, +]; +export const groupsMappedByCode = groups.reduce((a, c) => ({ ...a, [String(c.code || c.key)]: c }), {}); +export const groupsMappedByKey = groups.reduce((a, c) => ({ ...a, [String(c.key)]: c }), {}); +export const leafGroup = groups.slice(3); +export const overviewGroup = groups.slice(0, 3); // todo: 花梨鹰 APP Trippest + +export const DeptSelector = ({show_all, isLeaf,...props}) => { + const _show_all = ['tags', 'multiple'].includes(props.mode) ? false : show_all; + const options = isLeaf===true ? leafGroup : groups; + + return ( +