Commit 6c76bf43 authored by mayongxin's avatar mayongxin

角色选择组件支持传入自定义组件

parent df6e1b18
Pipeline #26475 skipped with stages
import React, { useState, useEffect, useRef } from 'react' import React, { useState, useEffect, useRef } from 'react'
import SiteModal from '@/components/Modal/SiteModa'; import SiteModal from '@/components/Modal/SiteModa';
import { Form, Input, notification, Select, Checkbox, message } from 'antd' import { Form, Input, notification, Select, Checkbox, message, Button } from 'antd'
import BaseForm from '@/components/BaseForm/index'; import BaseForm from '@/components/BaseForm/index';
import { Switch } from 'react-router'; import { Switch } from 'react-router';
import { iteratee } from 'lodash'; import { iteratee } from 'lodash';
...@@ -267,7 +267,7 @@ const EditModal = props => { ...@@ -267,7 +267,7 @@ const EditModal = props => {
name="to_person" name="to_person"
> >
<VisibleRoleModal onSubmit={onPushSubmit} /> <VisibleRoleModal onSubmit={onPushSubmit} title={"推送人员"} operate={<Button>adfasdf</Button>}/>
</Item> </Item>
<Item <Item
label="定时计划" label="定时计划"
......
...@@ -24,7 +24,7 @@ const VisibleRoleModal = props => { ...@@ -24,7 +24,7 @@ const VisibleRoleModal = props => {
const [dataTree, setDataTree] = useState([]) const [dataTree, setDataTree] = useState([])
const [dataLeafs, setDataLeafs] = useState([]) const [dataLeafs, setDataLeafs] = useState([])
const [selectValues, setSelectValues] = useState([]) const [selectValues, setSelectValues] = useState([])
const { onSubmit } = props const { onSubmit, title, operate } = props
const GetRoleGroupList = () => { const GetRoleGroupList = () => {
...@@ -87,12 +87,24 @@ const VisibleRoleModal = props => { ...@@ -87,12 +87,24 @@ const VisibleRoleModal = props => {
return ( return (
<div className={styles.role_container}> <div className={styles.role_container}>
<Input disabled={true} value={selectRole} /> {
<div className={styles.select_btn} onClick={handleClick}>推送人员</div> operate ? (
<div onClick={handleClick}>
{
operate
}
</div>
) : (
<div style={{ display: "flex", flexDirection: "row", width: "100%" }}>
<Input disabled={true} value={selectRole} />
<div className={styles.select_btn} onClick={handleClick}>{title ? title : "选择角色"}</div>
</div>
)
}
<SiteModal <SiteModal
{...props} {...props}
title="选择推送人员" title={title ? `选择${title}` : 关联角色}
bodyStyle={{ width: '100%', minHeight: '100px' }} bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: 200, borderRadius: '20px' }} style={{ top: 200, borderRadius: '20px' }}
width="800px" width="800px"
......
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