@etsoo/smarterp-crm
Version:
TypeScript APIs for SmartERP Customer Relationship Management (CRM)
25 lines (24 loc) • 932 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { Tiplist } from "@etsoo/materialui";
import { useRequiredCrmContext } from "../../CrmApp";
/**
* Person tiplist
* 人员提示列表
* @param props Properties
* @returns Component
*/
export function PersonTiplist(props) {
// CRM app
const crm = useRequiredCrmContext();
// Destruct
const { fullWidth = true, label = crm.app.get("user"), maxItems = 10, getOptionLabel = (data) => data.name, name = "personId", rq = { enabled: true }, ...rest } = props;
// Layout
return (_jsx(Tiplist, { label: label, getOptionLabel: getOptionLabel, name: name, fullWidth: fullWidth, maxItems: maxItems, loadData: (keyword, id, maxItems) => crm.personApi.list({
...rq,
keyword,
id,
queryPaging: {
batchSize: maxItems
}
}, { showLoading: false, defaultValue: [] }), ...rest }));
}