Commit 17a037df authored by 前端-许佳敏's avatar 前端-许佳敏

save

parent 6b3a0258
{"userRegister":{"useType":{"memberType":[{"id":1,"typeName":"企业会员"},{"id":2,"typeName":"企业个人会员"},{"id":3,"typeName":"渠道企业会员"},{"id":4,"typeName":"渠道个人会员"}],"businessType":[{"id":1,"typeName":"采购"},{"id":2,"typeName":"商品销售"},{"id":3,"typeName":"加工服务"},{"id":4,"typeName":"物流服务"},{"id":5,"typeName":"金融服务"},{"id":6,"typeName":"保险服务"},{"id":7,"typeName":"1"},{"id":8,"typeName":"2"},{"id":9,"typeName":"3"},{"id":10,"typeName":"4"},{"id":11,"typeName":"23"},{"id":12,"typeName":"6"},{"id":13,"typeName":"5"},{"id":14,"typeName":"11111111111111111111111111"},{"id":16,"typeName":"44"},{"id":17,"typeName":"33"},{"id":18,"typeName":"32"},{"id":19,"typeName":"33333"},{"id":20,"typeName":"4432"}]},"useDetail":[{"groupName":"联系信息","elements":[{"id":26,"fieldName":"contact","fieldCNName":"联系人","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":27,"fieldName":"fixed_contact_number","fieldCNName":"固定联系电话","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":28,"fieldName":"phone_number","fieldCNName":"手机号码","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":29,"fieldName":"fax_number","fieldCNName":"传真号码","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":30,"fieldName":"address","fieldCNName":"地址","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":31,"fieldName":"zip_code","fieldCNName":"邮编","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":32,"fieldName":"url","fieldCNName":"网址","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":33,"fieldName":"email","fieldCNName":"邮箱","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"营业执照信息","elements":[{"id":10,"fieldName":"company_name","fieldCNName":"公司名称","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":11,"fieldName":"enterprise_type","fieldCNName":"企业类型","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":12,"fieldName":"residence","fieldCNName":"住所","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":13,"fieldName":"legal_representative","fieldCNName":"法定代表人","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":14,"fieldName":"register_capital","fieldCNName":"注册资本","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":15,"fieldName":"establish_date","fieldCNName":"成立日期","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":16,"fieldName":"business_term","fieldCNName":"营业期限","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":17,"fieldName":"business_scope","fieldCNName":"经营范围","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":18,"fieldName":"registration_authority","fieldCNName":"登记机关","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":19,"fieldName":"registration_time","fieldCNName":"登记时间","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":20,"fieldName":"unified_social_credit_code","fieldCNName":"统一社会信用代码","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":21,"fieldName":"business_license","fieldCNName":"营业执照","fieldType":"file","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":35,"fieldName":" C_COMPANY_KIND","fieldCNName":"企业类型1","fieldType":"file","fieldLength":66,"fieldEmpty":1,"fieldOrder":2,"fieldRemark":"","checkRules":[]}]},{"groupName":"填写会员基本信息","elements":[{"id":1,"fieldName":"member_type","fieldCNName":"会员类型","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":2,"fieldName":"MEMBER_ROLE","fieldCNName":"会员角色","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":3,"fieldName":"member_level","fieldCNName":"会员等级","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":4,"fieldName":"REGISTER_PHONE","fieldCNName":"注册手机号","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":5,"fieldName":"register_email","fieldCNName":"注册邮箱","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"法定代表人信息","elements":[{"id":22,"fieldName":"legal_name","fieldCNName":"法人姓名","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":23,"fieldName":"legal_phone","fieldCNName":"法人手机号","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":24,"fieldName":"legal_id_card","fieldCNName":"法人身份证号","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":25,"fieldName":"legal_id_card_information","fieldCNName":"法人身份证信息","fieldType":"file","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"填写渠道信息","elements":[{"id":6,"fieldName":"channel_level","fieldCNName":"渠道级别","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":7,"fieldName":"channel_type","fieldCNName":"渠道类型","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":8,"fieldName":"agent_city","fieldCNName":"代理地市","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":9,"fieldName":"channel_describe","fieldCNName":"渠道描述","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]}]},"global":{"logo":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/logo.png","countryList":[{"name":"简体中文-ZH","key":"cn","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"},{"name":"English-EN","key":"en","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"},{"name":"日本語-JP","key":"jp","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png"},{"name":"한국어-KO","key":"ko","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png"}]}}
{"userRegister":{"useType":{"memberType":[{"id":1,"typeName":"企业会员"},{"id":2,"typeName":"企业个人会员"},{"id":3,"typeName":"渠道企业会员"},{"id":4,"typeName":"渠道个人会员"}],"businessType":[{"id":1,"typeName":"采购"},{"id":2,"typeName":"商品销售"},{"id":3,"typeName":"加工服务"},{"id":4,"typeName":"物流服务"},{"id":5,"typeName":"金融服务"},{"id":6,"typeName":"保险服务"},{"id":7,"typeName":"1"},{"id":8,"typeName":"2"},{"id":9,"typeName":"3"},{"id":10,"typeName":"4"},{"id":11,"typeName":"23"},{"id":12,"typeName":"6"},{"id":13,"typeName":"5"},{"id":14,"typeName":"11111111111111111111111111"},{"id":16,"typeName":"44"},{"id":17,"typeName":"33"},{"id":18,"typeName":"32"},{"id":19,"typeName":"33333"},{"id":20,"typeName":"4432"},{"id":21,"typeName":"11111111111"},{"id":22,"typeName":"别删"},{"id":23,"typeName":"测试"}]},"useDetail":[{"groupName":"联系信息","elements":[{"id":26,"fieldName":"contact","fieldCNName":"联系人","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":27,"fieldName":"fixed_contact_number","fieldCNName":"固定联系电话","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":28,"fieldName":"phone_number","fieldCNName":"手机号码","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":29,"fieldName":"fax_number","fieldCNName":"传真号码","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":30,"fieldName":"address","fieldCNName":"地址","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":31,"fieldName":"zip_code","fieldCNName":"邮编","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":32,"fieldName":"url","fieldCNName":"网址","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":33,"fieldName":"email","fieldCNName":"邮箱","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"营业执照信息","elements":[{"id":10,"fieldName":"company_name","fieldCNName":"公司名称","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":11,"fieldName":"enterprise_type","fieldCNName":"企业类型","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":12,"fieldName":"residence","fieldCNName":"住所","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":13,"fieldName":"legal_representative","fieldCNName":"法定代表人","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":14,"fieldName":"register_capital","fieldCNName":"注册资本","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":15,"fieldName":"establish_date","fieldCNName":"成立日期","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":16,"fieldName":"business_term","fieldCNName":"营业期限","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":17,"fieldName":"business_scope","fieldCNName":"经营范围","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":18,"fieldName":"registration_authority","fieldCNName":"登记机关","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":19,"fieldName":"registration_time","fieldCNName":"登记时间","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":20,"fieldName":"unified_social_credit_code","fieldCNName":"统一社会信用代码","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":21,"fieldName":"business_license","fieldCNName":"营业执照","fieldType":"upload","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":35,"fieldName":" C_COMPANY_KIND","fieldCNName":"企业类型1","fieldType":"upload","fieldLength":66,"fieldEmpty":1,"fieldOrder":2,"fieldRemark":"","checkRules":[]}]},{"groupName":"填写会员基本信息","elements":[{"id":1,"fieldName":"member_type","fieldCNName":"会员类型","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":2,"fieldName":"MEMBER_ROLE","fieldCNName":"会员角色","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":3,"fieldName":"member_level","fieldCNName":"会员等级","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":4,"fieldName":"REGISTER_PHONE","fieldCNName":"注册手机号","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":5,"fieldName":"register_email","fieldCNName":"注册邮箱","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"法定代表人信息","elements":[{"id":22,"fieldName":"legal_name","fieldCNName":"法人姓名","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":23,"fieldName":"legal_phone","fieldCNName":"法人手机号","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":24,"fieldName":"legal_id_card","fieldCNName":"法人身份证号","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":25,"fieldName":"legal_id_card_information","fieldCNName":"法人身份证信息","fieldType":"upload","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"填写渠道信息","elements":[{"id":6,"fieldName":"channel_level","fieldCNName":"渠道级别","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":7,"fieldName":"channel_type","fieldCNName":"渠道类型","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":8,"fieldName":"agent_city","fieldCNName":"代理地市","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":9,"fieldName":"channel_describe","fieldCNName":"渠道描述","fieldType":"string","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]}]},"global":{"logo":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/logo.png","countryList":[{"name":"简体中文-ZH","key":"cn","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"},{"name":"English-EN","key":"en","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"},{"name":"日本語-JP","key":"jp","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png"},{"name":"한국어-KO","key":"ko","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png"}],"menuList":[{"code":"/memberCenter/commodityAbility","children":[{"code":"/mem"}]},{"code":"/memberCenter/commodityAbility/classAndProperty/class"}]}}
......@@ -7,10 +7,11 @@
*/
const CommodityRoute = {
// 商品能力
path: '/memberCenter/commodityAbility',
name: 'commodityAbility',
key: 'commodityAbility',
icon: 'smile',
menuCode: '',
routes: [
{
path: '/memberCenter/commodityAbility/classAndProperty',
......@@ -21,6 +22,7 @@ const CommodityRoute = {
path: '/memberCenter/commodityAbility/classAndProperty/class',
name: 'class',
icon: 'smile',
menuCode: '/memberCenter/commodityAbility/classAndProperty/class',
component: '@/pages/classAndProperty/class',
},
{
......
......@@ -25,7 +25,6 @@ const memberCenterRoute = {
redirect: '/memberCenter/shopAbility/infoManage'
},
{
// 首页
path: `/memberCenter/home`,
name: 'home',
icon: 'smile',
......
......@@ -25,6 +25,10 @@ const mockData = {
key: 'ko',
icon: 'http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png'
}
],
menuList: [
{ code: '/memberCenter/commodityAbility', children: [ {code: '/mem'} ] },
{ code: '/memberCenter/commodityAbility/classAndProperty/class' },
]
}
}
......
......@@ -8,9 +8,21 @@ import '@/global/styles/global.less'; // 导入全局样式
// 默认引入所有的ant样式, 不引入css因为无法做到变量覆盖
import 'antd/dist/antd.less'
import { setup } from '@formily/antd-components';
import { GlobalConfig } from './global/config';
setup()
let extraRoutes = []
const mockFetchData = () => {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve([
{ menuCode: '/memberCenter/commodityAbility' },
{ menuCode: '/memberCenter/commodityAbility/classAndProperty/class' },
])
}, 2000)
})
}
let extraRoutes: any[] = []
/**
* @description 配置函数,对已配置的路由做修改, 一般与render函数一起结合可根据接口动态配置路由
......@@ -27,7 +39,8 @@ let extraRoutes = []
*
*/
// export function patchRoutes({ routes }: IRoutes) {
// routes.concat(extraRoutes as [])
// GlobalConfig.global.menuList.map(v => v.menuCode)
// console.log(routes)
// }
......@@ -38,19 +51,22 @@ let extraRoutes = []
* @export
*/
// export function render(oldRender:Function) {
// // 做动态路由
// fetch('/api').then((res: any) => {
// extraRoutes = res.routes
// mockFetchData().then((res: any[]) => {
// extraRoutes = res
// })
// // 做动态路由
// // fetch('/api').then((res: any) => {
// // extraRoutes = res.routes
// // })
// // 做权限校验
// fetch('/auth').then((res: any) => {
// if (res.isLogin) {
// oldRender()
// } else {
// history.push('/login')
// }
// })
// // // 做权限校验
// // fetch('/auth').then((res: any) => {
// // if (res.isLogin) {
// // oldRender()
// // } else {
// // history.push('/login')
// // }
// // })
// }
......
import React from 'react'
// 从pass平台获取所有菜单列表的集合
const authList = []
/**
* @description 对组件级别进行权限控制,只有当传入的preId复合存在authList中,才显示
*
*/
export const AuthWrapper = (props) => {
const { preId, children } = props
const result = authList.includes(preId)
return result ? children : null
}
export default AuthWrapper
\ No newline at end of file
......@@ -3,13 +3,13 @@ import { Input, Space, Button, Table } from 'antd'
import { PlusOutlined } from '@ant-design/icons'
const MultTable = (props) => {
const { columns } = props.props['x-component-props']
const { columns, prefix, rowKey } = props.props['x-component-props']
const value = props.value || []
return (
<div style={{width: '100%'}}>
<Button block icon={<PlusOutlined/>} type='dashed'>选择指定会员</Button>
{prefix}
<Table
rowKey='id'
rowKey={rowKey || 'id'}
columns={columns}
dataSource={value}
/>
......
......@@ -26,6 +26,7 @@ const Search = (props) => {
filterSearch: !state.filterSearch
})
}
return (
<Space size={20} style={{justifyContent: 'flex-end', width: '100%'}}>
<Input.Search
......
import React from 'react'
import SchemaForm, { IAntdSchemaFormProps, createFormActions, FormPath, SchemaField } from '@formily/antd'
import SchemaForm, { IAntdSchemaFormProps } from '@formily/antd'
import { Button, Space } from 'antd';
import CustomUpload from './components/CustomUpload';
import CustomStatus from './components/CustomStatus';
......@@ -10,7 +10,7 @@ import Submit from './components/Submit';
import Text from './components/Text';
import CardCheckBox from './components/CardCheckBox';
import MultTable from './components/MultTable';
import { setup, FormTab } from '@formily/antd-components';
export interface NiceFormProps extends IAntdSchemaFormProps {
}
......@@ -25,7 +25,7 @@ const NiceForm:React.FC<NiceFormProps> = (props) => {
Submit,
Text,
CardCheckBox,
MultTable
MultTable,
}
const defineComponents = Object.assign(customComponents, components)
......
......@@ -41,9 +41,19 @@ export interface CountryList {
icon: string;
}
export interface Children {
code: string;
}
export interface MenuList {
code: string;
children: Children[];
}
export interface Global {
logo: string;
countryList: CountryList[];
menuList: MenuList[];
}
export interface RootObject {
......
import { useState } from 'react'
import { TableRowSelection } from 'antd/es/table/interface'
interface useRowSelectionTableCtl {
selectRow: any[],
selectedRowKeys: any[],
setSelectRow(rows: any[]),
setSelectedRowKeys(rows: any)
}
interface useRowSelectionOptions {
type?: 'checkbox' | 'radio'
}
/**
* 用于处理table 多选或者单选时的hooks
* @auth xjm
*/
export const useRowSelectionTable = (options: useRowSelectionOptions = {}): [TableRowSelection<any>, useRowSelectionTableCtl] => {
const { type = 'checkbox' } = options
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
const [selectedRowKeys, setSelectedRowKeys] = useState<any[]>(() => [])
const rowSelection = {
selectedRowKeys: selectedRowKeys,
type,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows);
setSelectedRowKeys(selectedRowKeys);
}
}
return [rowSelection, { selectRow, setSelectRow, selectedRowKeys, setSelectedRowKeys }]
}
\ No newline at end of file
......@@ -20,8 +20,7 @@ const OuterSider: React.FC<OuterSiderProps> = (props) => {
if (pathname.indexOf(item.key) > -1) {
defaultSelectedKeys = item.key
}
subHeadMenus.push({
!item.hideInMenu && subHeadMenus.push({
path: item.path,
title: item.name,
icon: item.icon,
......@@ -38,7 +37,7 @@ const OuterSider: React.FC<OuterSiderProps> = (props) => {
<ul className={styles.menuBox}>
{
siderMunu.map(item => (
<li key={item.key} className={defaultSelectedKeys === item.key ? styles.currentItem : ''}>
!item.hideInMenu && <li key={item.key} className={defaultSelectedKeys === item.key ? styles.currentItem : ''}>
<Link to={item.path}>
<AppstoreOutlined />
<label>{item.title}</label>
......
......@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>God-Template</title>
<title>瓴犀开放平台</title>
</head>
<body>
<div id="root"></div>
......
......@@ -13,16 +13,16 @@ import { ColumnType } from 'antd/lib/table/interface';
import { StandardTable } from 'god'
import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableController';
import ReutrnEle from '@/components/ReturnEle';
import styles from './index.less'
import './index.less'
import NiceForm from '@/components/NiceForm'
import { repositDetailSchema } from './schema'
import { createFormActions } from '@formily/antd'
import { createFormActions, ISchema } from '@formily/antd'
import EyePreview from '@/components/EyePreview'
import { findItemAndDelete } from '@/utils'
import { PublicApi } from '@/services/api'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
const {Item}:any = Form
const { Option } = Select
const { TabPane } = Tabs
// 定义选择的行数据的类型
interface Item {
......@@ -34,276 +34,180 @@ interface Item {
status: string;
}
const layout = {
labelCol: {
span: 2,
},
wrapperCol: {
span: 12,
},
const fetchMemberList = async (params) => {
const res = await PublicApi.getMemberMaintenancePage(params)
return res.data
}
const layoutStore = {
labelCol: {
span: 3,
},
wrapperCol: {
span: 21,
},
}
const data = [
{
key: '1',
role: '采购商',
businessType: '采购',
roleType: '服务消费',
memberType: '企业会员',
},
{
key: '2',
role: '供应商',
businessType: '商品供应',
roleType: '服务提供',
memberType: '企业会员',
},
]
const dataSetMember = [
{
key: '1',
name: '渠道名称',
type: '渠道企业会员',
role: '渠道采购商',
class: '青铜会员',
},
{
key: '2',
name: '渠道名称',
type: '渠道企业会员',
role: '渠道采购商',
class: '铁皮会员',
},
]
// 模拟请求
const fetchData = (params:any) => {
return new Promise((resolve, reject) => {
const queryResult = data.find(v => v.key === params.keywords)
setTimeout(() => {
resolve({
code: 200,
message: '',
data: queryResult ? [queryResult] : data
})
}, 1000)
})
const fetchProductList = async (params) => {
const res = await PublicApi.getProductCommodityGetCommodityList(params)
return res.data
}
const addSchemaAction = createFormActions()
const AddRepository:React.FC<{}> = (props) => {
const ref = useRef({})
const [form] = Form.useForm()
const [reduceType, setReduceType] = useState(0)
const [memberType, setMemberType] = useState(0)
const ref = useRef<any>({})
const [visibleChannelMember, setVisibleChannelMember] = useState(false)
const [visibleChannelRroduct, setVisibleChannelRroduct] = useState(false)
const [selectRow, setSelectRow] = useState<Item[]>([]) // 模态框选择的行数据
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const [inputSliderValue, setInputSliderValue] = useState(1)
const [memberRowSelection, memberRowCtl] = useRowSelectionTable()
const [productRowSelection, productRowCtl] = useRowSelectionTable({type: 'radio'})
const columns: ColumnType<any>[] = [
const columnsSetMember: ColumnType<any>[] = [
{
title: 'ID',
dataIndex: 'key',
dataIndex: 'memberId',
align: 'center',
key: 'key',
key: 'memberId',
},
{
title: '商品名称',
dataIndex: 'role',
title: '会员名称',
dataIndex: 'name',
align: 'center',
key: 'role',
key: 'name',
},
{
title: '品类',
title: '会员类型',
dataIndex: 'memberTypeName',
align: 'center',
dataIndex: 'businessType',
key: 'businessType',
key: 'memberTypeName',
},
{
title: '品牌',
title: '会员角色',
dataIndex: 'roleName',
align: 'center',
dataIndex: 'roleType',
key: 'roleType',
key: 'roleName',
},
{
title: '单位',
title: '会员等级',
dataIndex: 'levelTag',
align: 'center',
dataIndex: 'memberType',
key: 'memberType',
},
];
const search: IFormFilter[] = [
{
type: 'Input',
value: 'keywords',
col: 6,
label: '商品名称',
placeHolder: '商品名称'
},
{
type: 'Select',
value: 'class',
col: 6,
placeHolder: '商品品类',
statusList: [{
type: 'Select',
label:'还不错',
value:'1'
},{
type: 'Select',
label:'还可以',
value:'2'
}]
},
{
type: 'Select',
value: 'brand',
col: 6,
placeHolder: '商品品牌',
statusList: [{
type: 'Select',
label:'还不错',
value:'1'
},{
type: 'Select',
label:'还可以',
value:'2'
}]
},
]
const searchBarActions: IButtonFilter[] = [
{
text: '查询',
handler: () => {
console.log('查询')
}
key: 'levelTag',
}
]
const columnsSetMember: ColumnType<any>[] = [
const columnsSetProduct: ColumnType<any>[] = [
{
title: 'ID',
dataIndex: 'key',
title: '商品ID',
dataIndex: 'id',
align: 'center',
key: 'key',
key: 'id',
},
{
title: '会员名称',
title: '商品名称',
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '会员类型',
dataIndex: 'type',
title: '品类',
dataIndex: ['customerCategory', 'name'],
align: 'center',
key: 'type',
key: 'customerCategory.name',
},
{
title: '会员角色',
dataIndex: 'role',
title: '品牌',
dataIndex: ['brand', 'name'],
align: 'center',
key: 'role',
key: 'brand.name',
},
{
title: '会员等级',
dataIndex: 'class',
title: '单位',
dataIndex: 'unitName',
align: 'center',
key: 'class',
key: 'unitName',
},
{
title: <>操作<a style={{color:'#868f9e'}}> <SettingOutlined /></a></>,
dataIndex: 'option',
align: 'center',
render: (text:any, record:any) => {
return (
<>
<Button type='link'>删除</Button>
</>
)
}
}
]
const callback = (key: any) => {
console.log(key)
}
const handleReduceTypeChange = (v:any) => {
setReduceType(v.target.value)
console.log(v.target.value,'v')
}
const handleMemberTypeChange = (v:any) => {
setMemberType(v.target.value)
console.log(v.target.value,'v')
}
const rowSelection = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows);
setSelectedRowKeys(selectedRowKeys);
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
}
}
// 弹出会员
const handleAddMemberBtn = () => {
const checkBoxs = addSchemaAction.getFieldValue('applyMember')
memberRowCtl.setSelectedRowKeys(checkBoxs.map(v => v.memberId))
memberRowCtl.setSelectRow(checkBoxs)
setVisibleChannelMember(true)
}
// 弹出商品选择
const handleAddProductBtn = () => {
productRowCtl.setSelectedRowKeys([])
productRowCtl.setSelectRow([])
setVisibleChannelRroduct(true)
}
// 会员添加弹窗控制
const handleOkAddMember = () => {
setVisibleChannelMember(false)
console.log('handleOkAddMember')
addSchemaAction.setFieldValue('applyMember', memberRowCtl.selectRow)
}
const handleCancelAddMember = () => {
setVisibleChannelMember(false)
console.log('handleCancelAddMember')
}
const handleLink = () => {
console.log("操作关联")
// 商品添加弹窗控制
const handleOkAddProduct = () => {
setVisibleChannelRroduct(false)
addSchemaAction.setFieldValue('productName', productRowCtl.selectRow[0].name)
}
const onNumberChange = (v: any) => {
setInputSliderValue(v)
}
const handleSubmit = (values) => {
console.log(values)
const handleCancelAddProduct = () => {
setVisibleChannelRroduct(false)
}
// 会员选择后的表格
const handleDeleteTable = (id) => {
const value = addSchemaAction.getFieldValue('applyMember')
addSchemaAction.setFieldValue('applyMember', findItemAndDelete(value, id))
}
const tableColumns = [
{ dataIndex: 'id', title: 'ID' },
{ dataIndex: 'name', title: '会员名称', render: (_, record) => <EyePreview url={`/memberCenter/memberAbility/manage/addMember?id=${record.id}&preview=1`}/> },
{ dataIndex: 'type', title: '会员类型' },
{ dataIndex: 'ctl', title: '操作', render: (_, record) => <Button type='link' onClick={() => handleDeleteTable(record.id)}>删除</Button> }
{ dataIndex: 'memberId', title: 'ID', align: 'center' },
{ dataIndex: 'name', align: 'center', title: '会员名称', render: (_, record) => <EyePreview url={`/memberCenter/memberAbility/manage/addMember?id=${record.memberId}&preview=1`}>{_}</EyePreview> },
{ dataIndex: 'memberTypeName', title: '会员类型', align: 'center' },
{ dataIndex: 'ctl', title: '操作', align: 'center', render: (_, record) => <Button type='link' onClick={() => handleDeleteTable(record.id)}>删除</Button> }
]
const tableAddButton = <Button style={{marginBottom: 16}} block icon={<PlusOutlined/>} onClick={handleAddMemberBtn} type='dashed'>选择指定会员</Button>
const formSearch: ISchema = {
type: 'object',
properties: {
name: {
type: 'string',
"x-component": 'Search',
"x-component-props": {
placeholder: '请输入会员名称'
}
}
}
}
const formProduct: ISchema = {
type: 'object',
properties: {
name: {
type: 'string',
"x-component": 'Search',
"x-component-props": {
placeholder: '请输入商品名称'
}
}
}
}
// 商品选择
const connectProduct = <div className='connectBtn' onClick={handleAddProductBtn}><LinkOutlined style={{marginRight: 4}}/>选择</div>
// 整体表单提交
const handleSubmit = (values) => {
console.log(values)
}
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回"/>}
className='addRepository'
title="新建仓位"
extra={[
<Button key="1" onClick={() => addSchemaAction.submit()} type="primary" icon={<SaveOutlined />}>
......@@ -314,239 +218,69 @@ const AddRepository:React.FC<{}> = (props) => {
<Card className=''>
<NiceForm
expressionScope={{
tableColumns
tableColumns,
tableAddButton,
connectProduct
}}
onSubmit={handleSubmit}
actions={addSchemaAction}
schema={repositDetailSchema}
/>
</Card>
</PageHeaderWrapper>
)
return (<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回"/>}
title="新建仓位"
extra={[
<Button key="1" onClick={handleSubmit} type="primary" icon={<SaveOutlined />}>
保存
</Button>,
]}
>
<Card>
<Tabs onChange={callback} type="card" defaultActiveKey="1">
<TabPane tab="基本信息" key="1">
<Form
{...layout}
form={form}
name="add-repository-basic"
labelAlign="left"
<Modal
width={704}
title='选择渠道会员'
onOk={handleOkAddMember}
onCancel={handleCancelAddMember}
visible={visibleChannelMember}
>
<Form.Item
name='repositoryName'
label={
<span>
仓位名称&nbsp;
<Tooltip title="这是一条描述文字!">
<QuestionCircleOutlined />
</Tooltip>
</span>
}
rules={[
<StandardTable
columns={columnsSetMember}
rowSelection={memberRowSelection}
fetchTableData={params => fetchMemberList(params)}
formilyProps={
{
required: true,
message: '输入仓位名称!',
},
]}
>
<Input placeholder="输入仓位名称" />
</Form.Item>
<Form.Item
name='productName'
label={
<span>
商品名称&nbsp;
<Tooltip title="这是一条描述文字!">
<QuestionCircleOutlined />
</Tooltip>
</span>
ctx: { schema: formSearch }
}
rules={[
{
required: true,
message: '输入商品名称!',
},
]}
>
<Row>
<Col span={20}><Input /></Col>
<Col span={4}>
<Button type="primary" icon={<LinkOutlined />} style={{backgroundColor: '#6B778C', borderColor: '#6B778C'}} onClick={handleLink}>
关联
</Button>
</Col>
</Row>
</Form.Item>
<Form.Item
name='mapRespoName'
label='对应仓库名称'
>
<Select defaultValue="guang">
<Option value="guang">广州成品仓</Option>
<Option value="shi">石河子原料仓</Option>
<Option value="wu">乌苏里半成品仓</Option>
</Select>
</Form.Item>
<Form.Item
name='mapProduName'
label='对应货品'
initialValue="M-112/进口头层牛皮荔枝纹/红色/XL/¥14.50"
>
<Input disabled placeholder="输入属性名称" />
</Form.Item>
<Form.Item
name='distribute'
label='分配仓位库存'
rules={[
{
required: true,
message: '请分配库存!',
},
]}
>
<Row>
<Col span={24}>
<Slider
min={1}
max={10000}
onChange={onNumberChange}
value={typeof inputSliderValue === 'number' ? inputSliderValue : 0}
/>
</Col>
<Col span={24}>
<Input.Group compact>
<InputNumber
min={1}
max={10000}
value={inputSliderValue}
onChange={onNumberChange}
/>
<Input
style={{
width: 40,
borderLeft: 0,
// borderRight: 0,
pointerEvents: 'none',
}
tableProps={{
rowKey: 'memberId'
}}
placeholder="尺"
disabled
/>
<span style={{lineHeight:'32px'}}>&nbsp;&nbsp;&nbsp;&nbsp;还剩:{10000-inputSliderValue}</span>
</Input.Group>
</Col>
</Row>
</Form.Item>
<Form.Item
name="reduceType"
label="库存扣减方式"
rules={[{
required: true,
message: '请选择库存扣减方式'
}]}
initialValue={reduceType}
>
<Radio.Group onChange={handleReduceTypeChange}>
<Radio value={0}>按仓位随机扣减</Radio>
<Radio value={1}>按仓库物理地址远近顺序扣减</Radio>
</Radio.Group>
</Form.Item>
</Form>
</TabPane>
<TabPane tab="适用商城" key="2">
<Form
{...layoutStore}
name="add-repository-store"
labelAlign="left"
</StandardTable>
</Modal>
<Modal
width={704}
title='选择商品'
onOk={handleOkAddProduct}
onCancel={handleCancelAddProduct}
visible={visibleChannelRroduct}
>
<Form.Item
name='storeType'
label={
<span>
适用商城&nbsp;
<Tooltip title="这是一条描述文字!">
<QuestionCircleOutlined />
</Tooltip>
</span>
}
rules={[
<StandardTable
columns={columnsSetProduct}
rowSelection={productRowSelection}
fetchTableData={params => fetchProductList(params)}
formilyProps={
{
required: true,
message: '请选择适用商城'
ctx: { schema: formProduct }
}
]}
initialValue="f"
>
<Radio.Group className={styles.storeItemRadio} name="storeType" size="large">
<Radio.Button value="c"><Avatar style={{marginBottom:5}}>LOGO</Avatar>&nbsp;WEB-会员商城</Radio.Button>
<Radio.Button value="d"><Avatar style={{marginBottom:5}}>LOGO</Avatar>&nbsp;WEB-渠道商城</Radio.Button>
<Radio.Button value="e"><Avatar style={{marginBottom:5}}>LOGO</Avatar>&nbsp;H5-会员商城</Radio.Button>
<Radio.Button value="f"><Avatar style={{marginBottom:5}}>LOGO</Avatar>&nbsp;H5-渠道商城</Radio.Button>
<Radio.Button value="g"><Avatar style={{marginBottom:5}}>LOGO</Avatar>&nbsp;小程序-会员商城</Radio.Button>
<Radio.Button value="h"><Avatar style={{marginBottom:5}}>LOGO</Avatar>&nbsp;APP-渠道商城</Radio.Button>
</Radio.Group>
</Form.Item>
</Form>
</TabPane>
<TabPane tab="适用会员" key="3">
<Form
{...layout}
form={form}
name="add-repository"
labelAlign="left"
>
<Form.Item
name="memberType"
label="选择渠道会员"
rules={[{
required: true,
message: '请选择渠道会员'
}]}
initialValue={memberType}
>
<Radio.Group onChange={handleMemberTypeChange}>
<Radio value={0}>所有会员共享(默认)</Radio>
<Radio value={1}>指定会员</Radio>
</Radio.Group>
</Form.Item>
</Form>
{
memberType ? <>
<Button onClick={handleAddMemberBtn} style={{width:'100%', marginBottom: 24, backgroundColor: '#fafbfc'}}>
<PlusOutlined /> 选择指定会员
</Button>
<Table dataSource={dataSetMember} columns={columnsSetMember} />
</> : ''
}
</TabPane>
</Tabs>
<Modal
title="选择渠道会员"
visible={visibleChannelMember}
onOk={handleOkAddMember}
onCancel={handleCancelAddMember}
tableProps={{
rowKey: 'id',
onRow: (record) => ({
onClick: () => {
productRowCtl.setSelectRow([record]);
productRowCtl.setSelectedRowKeys([record.id]);
},
})
}}
>
<StandardTable
columns={columns}
rowSelection={rowSelection}
currentRef={ref}
fetchTableData={(params:any) => fetchData(params)}
formFilters={search}
buttonFilters={searchBarActions}
/>
</StandardTable>
</Modal>
</Card>
</PageHeaderWrapper>)
</PageHeaderWrapper>
)
}
export default AddRepository
.addRepository {
.ant-input-group-addon {
padding: 0;
border: none;
}
.connectBtn {
width: 80px;
height: 32px;
line-height: 32px;
background: #6B778C;
color: #fff;
text-align: center;
cursor: pointer;
}
}
// 添加仓位
.storeItemRadio{
display: flex;
......
......@@ -105,6 +105,13 @@ export const repositDetailSchema: ISchema = {
productName: {
type: 'string',
title: '商品名称',
"x-mega-props": {
full: true
},
"x-component-props": {
disabled: true,
addonAfter: "{{connectProduct}}"
},
required: true
},
warehouseId: {
......@@ -154,7 +161,6 @@ export const repositDetailSchema: ISchema = {
"x-component-props": {
"tab": "适用商城"
},
"properties": {
MEGA_LAYOUT2: {
type: 'object',
......@@ -206,17 +212,22 @@ export const repositDetailSchema: ISchema = {
"title": "选择渠道会员",
default: 1,
required: true,
"x-linkages": [
{
type: 'value:visible',
target: 'applyMember',
"condition": "{{!$value}}"
}
]
},
applyMember: {
type: 'array:number',
"x-component": 'MultTable',
"x-component-props": {
columns: "{{tableColumns}}"
},
default: [
{ id: 1, name: '名称', type: '类型' },
{ id: 2, name: '名称1', type: '类型1' }
]
rowKey: 'memberId',
columns: "{{tableColumns}}",
prefix: "{{tableAddButton}}"
}
}
}
}
......
......@@ -6,6 +6,7 @@ import {
ExclamationCircleFilled
} from '@ant-design/icons';
import styles from '../index.less'
import { PublicApi } from '@/services/api';
const LoginWrap: React.FC = () => {
const [validFrame, setValidFrame] = useState(false)
......@@ -13,6 +14,9 @@ const LoginWrap: React.FC = () => {
const finish = (value:any) => {
console.log(value)
PublicApi.postMemberLogin(value).then(res => {
console.log(res)
})
}
return (
......
......@@ -3,7 +3,7 @@ import ThemeStore from './theme'
import ProductStroe from './product'
import React from 'react';
import { Provider } from 'mobx-react'
import { IUserModule } from '@/module/userModule';
import { ILoginModule } from '@/module/userModule';
import { IProductModule } from '@/module/productModule'
// import { ProductContext } from '@/pages/commodity/products/addProducts';
......@@ -23,7 +23,7 @@ import { IProductModule } from '@/module/productModule'
*/
export interface IStore {
userStore: IUserModule;
userStore: ILoginModule;
ProductStore: IProductModule;
}
......
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