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

save

parent 6b3a0258
This diff is collapsed.
...@@ -7,10 +7,11 @@ ...@@ -7,10 +7,11 @@
*/ */
const CommodityRoute = { const CommodityRoute = {
// 商品能力
path: '/memberCenter/commodityAbility', path: '/memberCenter/commodityAbility',
name: 'commodityAbility', name: 'commodityAbility',
key: 'commodityAbility', key: 'commodityAbility',
icon: 'smile',
menuCode: '',
routes: [ routes: [
{ {
path: '/memberCenter/commodityAbility/classAndProperty', path: '/memberCenter/commodityAbility/classAndProperty',
...@@ -21,6 +22,7 @@ const CommodityRoute = { ...@@ -21,6 +22,7 @@ const CommodityRoute = {
path: '/memberCenter/commodityAbility/classAndProperty/class', path: '/memberCenter/commodityAbility/classAndProperty/class',
name: 'class', name: 'class',
icon: 'smile', icon: 'smile',
menuCode: '/memberCenter/commodityAbility/classAndProperty/class',
component: '@/pages/classAndProperty/class', component: '@/pages/classAndProperty/class',
}, },
{ {
......
...@@ -25,7 +25,6 @@ const memberCenterRoute = { ...@@ -25,7 +25,6 @@ const memberCenterRoute = {
redirect: '/memberCenter/shopAbility/infoManage' redirect: '/memberCenter/shopAbility/infoManage'
}, },
{ {
// 首页
path: `/memberCenter/home`, path: `/memberCenter/home`,
name: 'home', name: 'home',
icon: 'smile', icon: 'smile',
......
...@@ -25,6 +25,10 @@ const mockData = { ...@@ -25,6 +25,10 @@ const mockData = {
key: 'ko', key: 'ko',
icon: 'http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png' 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'; // 导入全局样式 ...@@ -8,9 +8,21 @@ import '@/global/styles/global.less'; // 导入全局样式
// 默认引入所有的ant样式, 不引入css因为无法做到变量覆盖 // 默认引入所有的ant样式, 不引入css因为无法做到变量覆盖
import 'antd/dist/antd.less' import 'antd/dist/antd.less'
import { setup } from '@formily/antd-components'; import { setup } from '@formily/antd-components';
import { GlobalConfig } from './global/config';
setup() 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函数一起结合可根据接口动态配置路由 * @description 配置函数,对已配置的路由做修改, 一般与render函数一起结合可根据接口动态配置路由
...@@ -27,7 +39,8 @@ let extraRoutes = [] ...@@ -27,7 +39,8 @@ let extraRoutes = []
* *
*/ */
// export function patchRoutes({ routes }: IRoutes) { // 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 = [] ...@@ -38,19 +51,22 @@ let extraRoutes = []
* @export * @export
*/ */
// export function render(oldRender:Function) { // export function render(oldRender:Function) {
// // 做动态路由 // mockFetchData().then((res: any[]) => {
// fetch('/api').then((res: any) => { // extraRoutes = res
// extraRoutes = res.routes
// }) // })
// // 做动态路由
// // fetch('/api').then((res: any) => {
// // extraRoutes = res.routes
// // })
// // 做权限校验 // // // 做权限校验
// fetch('/auth').then((res: any) => { // // fetch('/auth').then((res: any) => {
// if (res.isLogin) { // // if (res.isLogin) {
// oldRender() // // oldRender()
// } else { // // } else {
// history.push('/login') // // 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' ...@@ -3,13 +3,13 @@ import { Input, Space, Button, Table } from 'antd'
import { PlusOutlined } from '@ant-design/icons' import { PlusOutlined } from '@ant-design/icons'
const MultTable = (props) => { const MultTable = (props) => {
const { columns } = props.props['x-component-props'] const { columns, prefix, rowKey } = props.props['x-component-props']
const value = props.value || [] const value = props.value || []
return ( return (
<div style={{width: '100%'}}> <div style={{width: '100%'}}>
<Button block icon={<PlusOutlined/>} type='dashed'>选择指定会员</Button> {prefix}
<Table <Table
rowKey='id' rowKey={rowKey || 'id'}
columns={columns} columns={columns}
dataSource={value} dataSource={value}
/> />
......
...@@ -26,6 +26,7 @@ const Search = (props) => { ...@@ -26,6 +26,7 @@ const Search = (props) => {
filterSearch: !state.filterSearch filterSearch: !state.filterSearch
}) })
} }
return ( return (
<Space size={20} style={{justifyContent: 'flex-end', width: '100%'}}> <Space size={20} style={{justifyContent: 'flex-end', width: '100%'}}>
<Input.Search <Input.Search
......
import React from 'react' 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 { Button, Space } from 'antd';
import CustomUpload from './components/CustomUpload'; import CustomUpload from './components/CustomUpload';
import CustomStatus from './components/CustomStatus'; import CustomStatus from './components/CustomStatus';
...@@ -10,7 +10,7 @@ import Submit from './components/Submit'; ...@@ -10,7 +10,7 @@ import Submit from './components/Submit';
import Text from './components/Text'; import Text from './components/Text';
import CardCheckBox from './components/CardCheckBox'; import CardCheckBox from './components/CardCheckBox';
import MultTable from './components/MultTable'; import MultTable from './components/MultTable';
import { setup, FormTab } from '@formily/antd-components';
export interface NiceFormProps extends IAntdSchemaFormProps { export interface NiceFormProps extends IAntdSchemaFormProps {
} }
...@@ -25,7 +25,7 @@ const NiceForm:React.FC<NiceFormProps> = (props) => { ...@@ -25,7 +25,7 @@ const NiceForm:React.FC<NiceFormProps> = (props) => {
Submit, Submit,
Text, Text,
CardCheckBox, CardCheckBox,
MultTable MultTable,
} }
const defineComponents = Object.assign(customComponents, components) const defineComponents = Object.assign(customComponents, components)
......
...@@ -41,9 +41,19 @@ export interface CountryList { ...@@ -41,9 +41,19 @@ export interface CountryList {
icon: string; icon: string;
} }
export interface Children {
code: string;
}
export interface MenuList {
code: string;
children: Children[];
}
export interface Global { export interface Global {
logo: string; logo: string;
countryList: CountryList[]; countryList: CountryList[];
menuList: MenuList[];
} }
export interface RootObject { 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) => { ...@@ -20,8 +20,7 @@ const OuterSider: React.FC<OuterSiderProps> = (props) => {
if (pathname.indexOf(item.key) > -1) { if (pathname.indexOf(item.key) > -1) {
defaultSelectedKeys = item.key defaultSelectedKeys = item.key
} }
!item.hideInMenu && subHeadMenus.push({
subHeadMenus.push({
path: item.path, path: item.path,
title: item.name, title: item.name,
icon: item.icon, icon: item.icon,
...@@ -38,7 +37,7 @@ const OuterSider: React.FC<OuterSiderProps> = (props) => { ...@@ -38,7 +37,7 @@ const OuterSider: React.FC<OuterSiderProps> = (props) => {
<ul className={styles.menuBox}> <ul className={styles.menuBox}>
{ {
siderMunu.map(item => ( 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}> <Link to={item.path}>
<AppstoreOutlined /> <AppstoreOutlined />
<label>{item.title}</label> <label>{item.title}</label>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>God-Template</title> <title>瓴犀开放平台</title>
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
......
This diff is collapsed.
.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{ .storeItemRadio{
display: flex; display: flex;
......
...@@ -105,6 +105,13 @@ export const repositDetailSchema: ISchema = { ...@@ -105,6 +105,13 @@ export const repositDetailSchema: ISchema = {
productName: { productName: {
type: 'string', type: 'string',
title: '商品名称', title: '商品名称',
"x-mega-props": {
full: true
},
"x-component-props": {
disabled: true,
addonAfter: "{{connectProduct}}"
},
required: true required: true
}, },
warehouseId: { warehouseId: {
...@@ -154,7 +161,6 @@ export const repositDetailSchema: ISchema = { ...@@ -154,7 +161,6 @@ export const repositDetailSchema: ISchema = {
"x-component-props": { "x-component-props": {
"tab": "适用商城" "tab": "适用商城"
}, },
"properties": { "properties": {
MEGA_LAYOUT2: { MEGA_LAYOUT2: {
type: 'object', type: 'object',
...@@ -206,17 +212,22 @@ export const repositDetailSchema: ISchema = { ...@@ -206,17 +212,22 @@ export const repositDetailSchema: ISchema = {
"title": "选择渠道会员", "title": "选择渠道会员",
default: 1, default: 1,
required: true, required: true,
"x-linkages": [
{
type: 'value:visible',
target: 'applyMember',
"condition": "{{!$value}}"
}
]
}, },
applyMember: { applyMember: {
type: 'array:number', type: 'array:number',
"x-component": 'MultTable', "x-component": 'MultTable',
"x-component-props": { "x-component-props": {
columns: "{{tableColumns}}" rowKey: 'memberId',
}, columns: "{{tableColumns}}",
default: [ prefix: "{{tableAddButton}}"
{ id: 1, name: '名称', type: '类型' }, }
{ id: 2, name: '名称1', type: '类型1' }
]
} }
} }
} }
......
...@@ -6,6 +6,7 @@ import { ...@@ -6,6 +6,7 @@ import {
ExclamationCircleFilled ExclamationCircleFilled
} from '@ant-design/icons'; } from '@ant-design/icons';
import styles from '../index.less' import styles from '../index.less'
import { PublicApi } from '@/services/api';
const LoginWrap: React.FC = () => { const LoginWrap: React.FC = () => {
const [validFrame, setValidFrame] = useState(false) const [validFrame, setValidFrame] = useState(false)
...@@ -13,6 +14,9 @@ const LoginWrap: React.FC = () => { ...@@ -13,6 +14,9 @@ const LoginWrap: React.FC = () => {
const finish = (value:any) => { const finish = (value:any) => {
console.log(value) console.log(value)
PublicApi.postMemberLogin(value).then(res => {
console.log(res)
})
} }
return ( return (
......
...@@ -3,7 +3,7 @@ import ThemeStore from './theme' ...@@ -3,7 +3,7 @@ import ThemeStore from './theme'
import ProductStroe from './product' import ProductStroe from './product'
import React from 'react'; import React from 'react';
import { Provider } from 'mobx-react' import { Provider } from 'mobx-react'
import { IUserModule } from '@/module/userModule'; import { ILoginModule } from '@/module/userModule';
import { IProductModule } from '@/module/productModule' import { IProductModule } from '@/module/productModule'
// import { ProductContext } from '@/pages/commodity/products/addProducts'; // import { ProductContext } from '@/pages/commodity/products/addProducts';
...@@ -23,7 +23,7 @@ import { IProductModule } from '@/module/productModule' ...@@ -23,7 +23,7 @@ import { IProductModule } from '@/module/productModule'
*/ */
export interface IStore { export interface IStore {
userStore: IUserModule; userStore: ILoginModule;
ProductStore: IProductModule; 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