fix entityactionbutton
This commit is contained in:
parent
6fccaa64ee
commit
6dc9457070
|
|
@ -4,7 +4,7 @@ import { EntityDict } from '../../general-app-domain';
|
|||
declare type Item = {
|
||||
label?: string;
|
||||
action?: string;
|
||||
unRelation: boolean;
|
||||
auth: boolean;
|
||||
type?: 'a' | 'button';
|
||||
index?: number;
|
||||
alerted?: boolean;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,8 @@ function Render(props) {
|
|||
var t = methods.t;
|
||||
var items = data.items, oakLegalActions = data.oakLegalActions, spaceProps = data.spaceProps, entity = data.entity;
|
||||
return ((0, jsx_runtime_1.jsx)(antd_1.Space, tslib_1.__assign({}, spaceProps, { children: items && items.map(function (ele, index) {
|
||||
if (ele.unRelation || (oakLegalActions === null || oakLegalActions === void 0 ? void 0 : oakLegalActions.includes(ele.action))) {
|
||||
var _a = ele.auth, auth = _a === void 0 ? true : _a;
|
||||
if (auth || (oakLegalActions === null || oakLegalActions === void 0 ? void 0 : oakLegalActions.includes(ele.action))) {
|
||||
var onClick = function () {
|
||||
if (ele.onClick) {
|
||||
ele.onClick();
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ const { confirm } = Modal;
|
|||
type Item = {
|
||||
label?: string;
|
||||
action?: string;
|
||||
unRelation: boolean;
|
||||
auth: boolean;
|
||||
type?: 'a' | 'button';
|
||||
index?: number;
|
||||
alerted?: boolean;
|
||||
|
|
@ -78,7 +78,8 @@ export default function Render(
|
|||
return (
|
||||
<Space {...spaceProps}>
|
||||
{items && items.map((ele, index: number) => {
|
||||
if (ele.unRelation || oakLegalActions?.includes(ele.action as EntityDict[keyof EntityDict]['Action'])) {
|
||||
const { auth = true} = ele;
|
||||
if (auth || oakLegalActions?.includes(ele.action as EntityDict[keyof EntityDict]['Action'])) {
|
||||
let onClick = () => {
|
||||
if (ele.onClick) {
|
||||
ele.onClick();
|
||||
|
|
|
|||
Loading…
Reference in New Issue