去掉 userentitygrant cell button

This commit is contained in:
Wang Kejun 2023-04-25 14:32:37 +08:00
parent fa482db47b
commit b90e0a7d86
10 changed files with 0 additions and 206 deletions

View File

@ -1,4 +0,0 @@
/// <reference types="wechat-miniprogram" />
/// <reference types="react" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../general-app-domain").EntityDict, "userEntityGrant", false, WechatMiniprogram.Component.DataOption>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
export default _default;

View File

@ -1,44 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
exports.default = OakComponent({
entity: 'userEntityGrant',
isList: false,
formData: function (_a) {
var data = _a.data;
return {};
},
actions: ['disable'],
methods: {
tapAction: function (action) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var id, _a;
return tslib_1.__generator(this, function (_b) {
switch (_b.label) {
case 0:
id = this.props.oakId;
_a = action;
switch (_a) {
case 'disable': return [3 /*break*/, 1];
}
return [3 /*break*/, 3];
case 1:
this.update({
expired: true,
}, 'disable');
return [4 /*yield*/, this.execute()];
case 2:
_b.sent();
return [3 /*break*/, 4];
case 3:
{
return [3 /*break*/, 4];
}
_b.label = 4;
case 4: return [2 /*return*/];
}
});
});
},
},
});

View File

@ -1,8 +0,0 @@
/// <reference types="react" />
import { EntityDict } from '../../../general-app-domain';
import { WebComponentProps } from 'oak-frontend-base';
export default function Render(props: WebComponentProps<EntityDict, 'userEntityGrant', true, {
oakLegalActions: string[];
}, {
tapAction: (action: string) => Promise<void>;
}>): JSX.Element[] | null;

View File

@ -1,41 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var jsx_runtime_1 = require("react/jsx-runtime");
var antd_1 = require("antd");
function Render(props) {
var _this = this;
var data = props.data, methods = props.methods;
var oakLegalActions = data.oakLegalActions;
var tapAction = methods.tapAction, t = methods.t;
return (oakLegalActions === null || oakLegalActions === void 0 ? void 0 : oakLegalActions.length) > 0
? oakLegalActions.map(function (ele) {
var btnName = t("userEntityGrant:action.".concat(ele));
if (ele === 'remove') {
btnName = t("common:action.".concat(ele));
}
return ((0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "link", onClick: function (event) {
var modal = antd_1.Modal.confirm({
title: "\u786E\u8BA4".concat(btnName, "\u8BE5\u6388\u6743\u8BB0\u5F55\u5417\uFF1F"),
okText: '确定',
cancelText: '取消',
onOk: function (e) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, tapAction(ele)];
case 1:
_a.sent();
modal.destroy();
return [2 /*return*/];
}
});
}); },
onCancel: function (e) {
modal.destroy();
},
});
} }, { children: btnName })));
})
: null;
}
exports.default = Render;

View File

@ -68,21 +68,6 @@ function render(props) {
return ((0, jsx_runtime_1.jsxs)(antd_1.Typography.Text, tslib_1.__assign({ type: record.expired ? 'danger' : 'success' }, { children: [record.expired ? '失效' : '有效', !record.expired && ((0, jsx_runtime_1.jsxs)(antd_1.Typography.Text, { children: ["\u00A0", (0, dayjs_1.default)(record.expiresAt).format('YYYY-MM-DD HH:mm')] }))] })));
},
},
// {
// dataIndex: 'op',
// width: 200,
// title: '操作',
// align: 'center',
// render: (value, record, index) => {
// return (
// <CellButton
// oakId={record.id}
// oakPath={`${oakFullpath}.${record.id}`}
// />
// );
// },
// fixed: 'right',
// },
], pagination: {
total: total,
pageSize: pageSize,

View File

@ -1,25 +0,0 @@
export default OakComponent({
entity: 'userEntityGrant',
isList: false,
formData({ data }) {
return {};
},
actions: ['disable'],
methods: {
async tapAction(action: string) {
const { oakId: id } = this.props;
switch (action) {
case 'disable': {
this.update({
expired: true,
}, 'disable');
await this.execute();
break;
}
default: {
break;
}
}
},
},
});

View File

@ -1,53 +0,0 @@
import React from 'react';
import { Button, Modal } from 'antd';
import { EntityDict } from '../../../general-app-domain';
import { WebComponentProps } from 'oak-frontend-base';
export default function Render(
props: WebComponentProps<
EntityDict,
'userEntityGrant',
true,
{
oakLegalActions: string[];
},
{
tapAction: (action: string) => Promise<void>;
}
>
) {
const { data, methods } = props;
const { oakLegalActions } = data;
const { tapAction, t } = methods;
return oakLegalActions?.length > 0
? oakLegalActions.map((ele: string) => {
let btnName = t(`userEntityGrant:action.${ele}`);
if (ele === 'remove') {
btnName = t(`common:action.${ele}`);
}
return (
<Button
type="link"
onClick={(event) => {
const modal = Modal!.confirm!({
title: `确认${btnName}该授权记录吗?`,
okText: '确定',
cancelText: '取消',
onOk: async (e) => {
await tapAction(ele);
modal!.destroy!();
},
onCancel: (e) => {
modal!.destroy!();
},
});
}}
>
{btnName}
</Button>
);
})
: null;
}

View File

@ -2,7 +2,6 @@ import * as React from 'react';
import { Table, Button, Space, Typography, Modal } from 'antd';
import dayjs from 'dayjs';
import PageHeader from '../../../components/common/pageHeader';
import CellButton from '../../../components/userEntityGrant/cellButton';
import { EntityDict } from '../../../general-app-domain';
import { WebComponentProps } from 'oak-frontend-base';
@ -122,21 +121,6 @@ export default function render(
);
},
},
// {
// dataIndex: 'op',
// width: 200,
// title: '操作',
// align: 'center',
// render: (value, record, index) => {
// return (
// <CellButton
// oakId={record.id}
// oakPath={`${oakFullpath}.${record.id}`}
// />
// );
// },
// fixed: 'right',
// },
]}
pagination={{
total,