Merge branch 'dev' of codeup.aliyun.com:61c14a7efa282c88e103c23f/oak-general-business into dev
This commit is contained in:
commit
6aa49282f1
|
|
@ -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,15 @@ 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 ||
|
||||
(auth && (
|
||||
oakLegalActions === null || oakLegalActions === void 0
|
||||
? void 0
|
||||
: oakLegalActions.includes(ele.action)
|
||||
))
|
||||
) {
|
||||
var onClick = function () {
|
||||
if (ele.onClick) {
|
||||
ele.onClick();
|
||||
|
|
@ -56,11 +64,18 @@ function Render(props) {
|
|||
if (ele.callBack) {
|
||||
ele.callBack(index);
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
}
|
||||
return ((0, jsx_runtime_1.jsx)(ItemComponent, tslib_1.__assign({}, ele, { entity: entity, t: t, onClick: onClick })));
|
||||
return (0, jsx_runtime_1.jsx)(
|
||||
ItemComponent,
|
||||
tslib_1.__assign({}, ele, {
|
||||
entity: entity,
|
||||
t: t,
|
||||
onClick: 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,13 +78,22 @@ 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 ||
|
||||
(auth &&
|
||||
oakLegalActions?.includes(
|
||||
ele.action as EntityDict[keyof EntityDict]['Action']
|
||||
))
|
||||
) {
|
||||
let onClick = () => {
|
||||
if (ele.onClick) {
|
||||
ele.onClick();
|
||||
return;
|
||||
}
|
||||
methods.execute(ele.action as EntityDict[keyof EntityDict]['Action'])
|
||||
methods.execute(
|
||||
ele.action as EntityDict[keyof EntityDict]['Action']
|
||||
);
|
||||
};
|
||||
if (ele.alerted) {
|
||||
onClick = () => {
|
||||
|
|
@ -98,17 +107,24 @@ export default function Render(
|
|||
ele.onClick();
|
||||
return;
|
||||
}
|
||||
methods.execute(ele.action as EntityDict[keyof EntityDict]['Action'])
|
||||
methods.execute(
|
||||
ele.action as EntityDict[keyof EntityDict]['Action']
|
||||
);
|
||||
if (ele.callBack) {
|
||||
ele.callBack(index);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
}
|
||||
return (
|
||||
<ItemComponent {...ele} entity={entity} t={t} onClick={onClick} />
|
||||
)
|
||||
<ItemComponent
|
||||
{...ele}
|
||||
entity={entity}
|
||||
t={t}
|
||||
onClick={onClick}
|
||||
/>
|
||||
);
|
||||
}
|
||||
})}
|
||||
</Space>
|
||||
|
|
|
|||
Loading…
Reference in New Issue