Commit 95b22549 authored by 前端-许佳敏's avatar 前端-许佳敏

调整schema写法,更新依赖,修复用户管理bug

parent 21439ef9
......@@ -37,7 +37,7 @@
"braft-editor": "^2.3.9",
"classnames": "^2.2.6",
"core-js": "^3.6.5",
"god": "0.1.20",
"god": "0.1.21",
"lint-staged": "^10.0.7",
"mobx": "^5.15.4",
"mobx-react": "^6.2.2",
......
......@@ -65,7 +65,7 @@ export function render(oldRender:Function) {
removeRouters()
history.push('/login')
}
console.log('render')
oldRender()
})
} else {
......@@ -84,6 +84,7 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
console.log('onRouteChange')
if (isDev) {
console.log('dev')
return;
}
......
......@@ -49,6 +49,7 @@ export interface RenderIconsProps {
toolsRender?: toolsRenderProps
}
// 注意该方法只能在hooks中使用, 如果在函数外使用 会导致页面一直处于loading, 函数外可以直接用createTreeActions
export const useTreeActions = (action?): TabTreeActions => {
const actionRef = useRef<any>(null)
actionRef.current = actionRef.current || action || createTreeActions()
......
......@@ -3,3 +3,18 @@ export const NOT_CHANGE_VALUE = 'hello, world'
// 本地环境跳过权限校验
export const isDev = process.env.NODE_ENV === "development"
// export const isDev = false
export const STATUS_ENUM = [
{
label: '全部',
value: null
},
{
label: '有效',
value: 1
},
{
label: '无效',
value: 0
}
]
\ No newline at end of file
......@@ -8,28 +8,14 @@ export interface BusinessType {
typeName: string;
}
export interface Data {
export interface UseType {
memberType: MemberType[];
businessType: BusinessType[];
}
export interface UseType {
code: number;
message: string;
data: Data;
time: number;
}
export interface UseDetail {
code: number;
message: string;
data?: any;
time: number;
}
export interface UserRegister {
useType: UseType;
useDetail: UseDetail;
useDetail?: any;
}
export interface RuleConfiguration {
......@@ -44,36 +30,22 @@ export interface PayWayResponse {
label: string;
}
export interface Data {
export interface PayInitializeConfig {
payType: number;
ruleConfigurations: RuleConfiguration[];
payWayResponses: PayWayResponse[];
}
export interface PayInitializeConfig {
code: number;
message: string;
data: Data[];
time: number;
}
export interface Data {
export interface PayPlatformPayConfig {
id: number;
payType: number;
way: string;
isPitchOn: number;
}
export interface PayPlatformPayConfig {
code: number;
message: string;
data: Data[];
time: number;
}
export interface PayConfig {
payInitializeConfig: PayInitializeConfig;
payPlatformPayConfig: PayPlatformPayConfig;
payInitializeConfig: PayInitializeConfig[];
payPlatformPayConfig: PayPlatformPayConfig[];
}
export interface CountryList {
......
export interface MemberType {
id: number;
typeName: string;
}
export interface BusinessType {
id: number;
typeName: string;
}
export interface UseType {
memberType: MemberType[];
businessType: BusinessType[];
}
export interface UserRegister {
useType: UseType;
useDetail?: any;
}
export interface PayConfig {
payInitializeConfig?: any;
payPlatformPayConfig?: any;
}
export interface CountryList {
name: string;
key: string;
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 {
userRegister: UserRegister;
payConfig: PayConfig;
global: Global;
}
\ No newline at end of file
......@@ -54,6 +54,7 @@ export default {
'menu.authConfig.memberSystem': '角色管理',
'menu.authConfig.memberDetail': '角色详情',
'menu.authConfig.userSystem': '用户管理',
'menu.authConfig.userDetail': '用户详情',
// 会员能力
'menu.memberAbility': '会员管理',
'menu.memberAbility.memberMaintain': '会员维护',
......
......@@ -77,7 +77,7 @@ const MemberSystem: React.FC<{}> = () => {
dataIndex: 'option',
align: 'center',
render: (text:any, record:any) => {
return (
return record.status === 0 ? (
<>
<Popconfirm
title="确定要执行这个操作?"
......@@ -89,7 +89,7 @@ const MemberSystem: React.FC<{}> = () => {
</Popconfirm>
<Button type='link' onClick={()=>updateItem(record)}>修改</Button>
</>
)
) : null
}
}
];
......
......@@ -14,6 +14,7 @@ import { IButtonFilter, IFormFilter } from 'god/dist/src/standard-table/TableCon
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
import StatusSwitch from '@/components/StatusSwitch';
import { STATUS_ENUM } from '@/constants';
// 模拟请求
const fetchData = async (params) => {
......@@ -25,7 +26,7 @@ const UserSystem: React.FC<{}> = () => {
const ref = useRef<any>({})
const addItem = () => {
history.push('/authConfig/userSystem/userDetail?preview=0')
history.push('/authConfig/userSystem/userDetail')
}
const deleteItem = (record) => {
// 删除该项
......@@ -62,7 +63,10 @@ const UserSystem: React.FC<{}> = () => {
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '所属机构',
//@todo 需要添加字段
},
{
title: '绑定手机号码',
......@@ -83,7 +87,7 @@ const UserSystem: React.FC<{}> = () => {
key: 'lastLoginTime',
},
{
title: '外部状态',
title: '状态',
align: 'center',
dataIndex: 'status',
key: 'status',
......@@ -130,13 +134,31 @@ const UserSystem: React.FC<{}> = () => {
order: 3
},
ctx: {
effects: ($) => {
$('onFieldInputChange', 'status').subscribe(() => {
ref.current.reload()
})
},
schema: {
type: 'object',
properties: {
account: {
type: 'Search',
"x-component-props": {
placeholder: '请输入账号'
}
},
name: {
type: 'Search',
"x-component-props": {
placeholder: '请输入角色名称'
placeholder: '请输入用户姓名'
}
},
status: {
type: 'string',
enum: STATUS_ENUM,
"x-component-props": {
placeholder: '请选择状态'
}
}
}
......
import React, { useRef, useState, useEffect } from 'react';
import { Button, Modal, Tag, Row, Col } from 'antd';
import { Form, FormItem, createFormActions, FormButtonGroup, Submit } from '@formily/antd'
import { Input } from '@formily/antd-components'
import { PlusOutlined, LinkOutlined } from '@ant-design/icons';
import {StandardTable} from 'god'
import { Button, Modal } from 'antd';
import { createFormActions, FormButtonGroup } from '@formily/antd'
import {LinkOutlined } from '@ant-design/icons';
import {ColumnType} from 'antd/lib/table/interface';
import { PublicApi } from '@/services/api';
import { history } from 'umi';
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus';
import DetailPage from '@/components/DetailPage';
import NiceForm from '@/components/NiceForm';
......@@ -15,13 +14,10 @@ import './index.less'
import ModalTable from '@/components/ModalTable';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import { findItemAndDelete, omit, getParentTreeTitles } from '@/utils';
import TabTree, { useTreeActions } from '@/components/TabTree';
import TabTree, { useTreeActions, createTreeActions } from '@/components/TabTree';
import { useTreeTabs } from '@/hooks/useTreeTabs';
import { useHttpRequest } from '@/hooks/useHttpRequest';
// 定义选择的行数据的类型
type Item = any
const titleRender = (title) => {
if (title === PageStatus.PREVIEW) return '查看用户'
if (title === PageStatus.ADD) return '新增用户'
......@@ -35,14 +31,11 @@ const fetchOriginTreeData = async (params?) => { // 平台后台树
}
const userActions = createFormActions()
const originTreeActions = useTreeActions()
const originTreeActions = createTreeActions()
const AddUser: React.FC<{}> = () => {
const [originVisible, setOriginVisible] = useState(false)
const checkBoxRef = useRef<any[]>([])
const [roleVisible, setRoleVisible] = useState(false)
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const ref = useRef<any>({})
const [formData, setFormData] = useState<any>(null)
const { id, pageStatus } = usePageStatus()
......
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