Commit 7e990265 authored by 前端-许佳敏's avatar 前端-许佳敏

fix:修复权限能力bug

parent 6b9a5cbb
import React, { useState, ReactText, useImperativeHandle, useEffect, useRef } from 'react'
import { Tree, Space, Tooltip, Button } from 'antd'
import { Tree, Space, Tooltip, Button, Popconfirm } from 'antd'
import { findItemAndDelete, findTreeKeys, treeReduction, getParentTreeTitles } from '@/utils'
import './index.less'
import deepClone from 'clone'
......@@ -115,14 +115,16 @@ const RenderIcons: React.FC<RenderIconsProps> = props => {
/>
</Tooltip>
<Tooltip title="删除当前节点">
<DeleteOutlined
onClick={e => {
e.stopPropagation();
toolsRender &&
toolsRender.deleteNode &&
toolsRender.deleteNode(props.node);
}}
/>
<Popconfirm title='确认删除当前节点?' onConfirm={e => {
toolsRender &&
toolsRender.deleteNode &&
toolsRender.deleteNode(props.node);
}}>
<DeleteOutlined
onClick={e => e.stopPropagation()}
/>
</Popconfirm>
</Tooltip>
</Space>
);
......
......@@ -16,4 +16,5 @@ export const PATTERN_MAPS = {
smsCode: /^\d{6}$/,
money:/^\d*(?:\.\d{0,2})?$/,
weight:/^\d*(?:\.\d{0,3})?$/,
idCard: /^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
}
\ No newline at end of file
......@@ -165,7 +165,16 @@ const MemberDetail: React.FC<{}> = () => {
roleName: {
type: 'string',
title: '角色名称',
required: true
"x-rules": [
{
message: '请输入角色名称',
required: true
},
{
limitByte: true,
maxByte: 20
}
]
},
remark: {
type: 'textarea',
......
......@@ -13,6 +13,7 @@ import { omit } from '@/utils';
import { useMap, useBoolean } from '@umijs/hooks';
import { useTreeTabs } from '@/hooks/useTreeTabs';
import { isObject } from '@antv/util';
import { Prompt } from 'umi';
// import "./index.less"
const { ON_FORM_INPUT_CHANGE } = LifeCycleTypes
......@@ -46,7 +47,8 @@ const Organ: React.FC<{}> = () => {
setTreeMaps,
resetMenu,
toolsRender,
handleDeleteMenu
handleDeleteMenu,
isEditForm
} = useTreeTabs({
treeActions,
formActions,
......@@ -72,11 +74,13 @@ const Organ: React.FC<{}> = () => {
}
const fn = editOrAdd ? PublicApi.postMemberOrgUpdate : PublicApi.postMemberOrgAdd
fn(params).then(res => {
resetMenu()
setTreeStatus(FormState.FREE)
setNodeRecord(undefined)
// 保存后要将是否填写过表单设为false
setIsEditForm(false)
if (res.code === 1000) {
resetMenu()
setTreeStatus(FormState.FREE)
setNodeRecord(undefined)
// 保存后要将是否填写过表单设为false
setIsEditForm(false)
}
})
}
......@@ -129,7 +133,7 @@ const Organ: React.FC<{}> = () => {
}
</Col>
</Row>
<Prompt when={isEditForm} message='有未提交的内容,确定要离开吗?'/>
</div>
}
......
......@@ -14,20 +14,43 @@ export const menuSchema: ISchema = {
code: {
type: 'string',
title: '组织代码',
required: true,
"x-rules": [
{
message: '请输入组织代码',
required: true
},
{
limitByte: true,
maxByte: 12
}
]
},
title: {
type: 'string',
title: '组织机构',
required: true
"x-rules": [
{
message: '请输入组织机构',
required: true
},
{
limitByte: true,
maxByte: 40
}
]
},
remark: {
type: 'textarea',
title: '描述',
"x-component-props": {
rows: 4
}
},
"x-rules": [
{
limitByte: true,
maxByte: 64
}
]
}
}
}
......
......@@ -39,8 +39,16 @@ export const UserDetailSchema:ISchema = {
name: {
type: 'string',
title: '姓名',
maxLength: 16,
required: true
"x-rules": [
{
message: '请输入姓名',
required: true
},
{
limitByte: true,
maxByte: 16
}
]
},
phoneLayout: {
type: 'object',
......@@ -88,7 +96,13 @@ export const UserDetailSchema:ISchema = {
},
idCardNo: {
type: 'string',
title: '身份证号'
title: '身份证号',
"x-rules": [
{
pattern: PATTERN_MAPS.idCard,
message: '请输入正确的身份证号'
}
]
},
email: {
type: 'string',
......@@ -103,7 +117,12 @@ export const UserDetailSchema:ISchema = {
jobTitle: {
type: 'string',
title: '职位',
maxLength: 20,
"x-rules": [
{
limitByte: true,
maxByte: 20
}
]
},
orgName: {
type: 'string',
......
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