index.md 1.69 KB

选部门组件

/**
 * debug: true
 */
import { QxOrgSelector } from '@qx/common';
import React from 'react';
import { request } from '@qx/common';

export default () => {
  return (
    <div>
      <QxOrgSelector request={request} />
    </div>
  );
};

弹框

import {QxOrgSelector} from '@qx/common';
import React, {useState} from 'react';
import {request} from '@qx/common';

export default () => {
    const [visible, setVisible] = useState(false)
    return (
        <div>
            <div onClick={()=> setVisible(true)}>点一下</div>
            <QxOrgSelector.Dialog
                request={request}
                checkStrictly
                title={'添加部门'}
                visible={visible}
                multiple={true}
                onOk={(orgIds: any) => {
                    console.log(orgIds,'lllll')
                }}
                onCancel={() => {
                    setVisible(false);
                }}
            />
        </div>
    );
};

API

参数 说明 类型 默认值
onChange 选的人变化时的回调 function(value) -
defaultValue 默认值 string[] -
disabled 禁用 bool -
multiple 是否多选 bool -
max 最多选几个,ps:没有控制 number -
readOnly 只读 bool -
value string[] \ string