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

save

parent 6b3a0258
This diff is collapsed.
......@@ -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>
......
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{
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