删除 input

This commit is contained in:
Wang Kejun 2022-11-26 13:15:14 +08:00
parent d845ac9994
commit 6a2d90cb44
88 changed files with 199 additions and 290 deletions

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import './index.less'; import './index.less';
declare const Empty: () => JSX.Element; declare const Empty: () => JSX.Element;
export default Empty; export default Empty;

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import './index.less'; import './index.less';
declare const Empty: () => JSX.Element; declare const Empty: () => JSX.Element;
export default Empty; export default Empty;

View File

@ -1,14 +0,0 @@
import React from 'react';
import { InputProps } from 'antd';
interface IProps extends InputProps {
value?: string;
autoSize?: boolean | object;
}
declare const Component: {
(props: IProps): JSX.Element;
Search(props: IProps): JSX.Element;
TextArea(props: IProps): JSX.Element;
Password: React.ForwardRefExoticComponent<import("antd/es/input").PasswordProps & React.RefAttributes<import("antd").InputRef>>;
Group: React.FC<import("antd/es/input").GroupProps>;
};
export default Component;

View File

@ -1,60 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var jsx_runtime_1 = require("react/jsx-runtime");
var react_1 = require("react");
var antd_1 = require("antd");
function BaseHOC(key) {
return function (props) {
var defaultValue = props.defaultValue, value = props.value, onChange = props.onChange;
var hasValue = props.hasOwnProperty('value');
// 用户切换到底是显示 value 还是 input
// 不能直接用 isOnComposition 原因是,这个值发生变化不会触发重新渲染
// 不能只使用 flag 原因是setFlag 是异步的
var _a = tslib_1.__read((0, react_1.useState)(false), 2), flag = _a[0], setFlag = _a[1];
// 非中文输入时候显示 value。中文输入的时候显示 input
var _b = tslib_1.__read((0, react_1.useState)(hasValue ? value : defaultValue), 2), input = _b[0], setInput = _b[1];
(0, react_1.useEffect)(function () {
if (hasValue && input !== value) {
setInput(value);
}
}, [value]);
var isOnComposition = false;
function handleChange(e) {
setInput(e.target.value);
if (isOnComposition)
return;
onChange && onChange(e);
}
function handleComposition(e) {
if ('compositionend' === (e === null || e === void 0 ? void 0 : e.type)) {
isOnComposition = false;
handleChange(e);
}
else {
isOnComposition = true;
}
if (flag !== isOnComposition) {
setFlag(isOnComposition);
}
}
var Component = antd_1.Input;
if (key) {
// @ts-ignore
Component = antd_1.Input[key];
}
return ((0, jsx_runtime_1.jsx)(Component, tslib_1.__assign({}, props, { value: hasValue && !flag ? value : input, onCompositionStart: handleComposition, onCompositionUpdate: handleComposition, onCompositionEnd: handleComposition, onChange: handleChange })));
};
}
var Component = function (props) {
return BaseHOC()(props);
};
Component.Search = function (props) {
return BaseHOC('Search')(props);
};
Component.TextArea = function (props) {
return BaseHOC('TextArea')(props);
};
Component.Password = antd_1.Input.Password;
Component.Group = antd_1.Input.Group;
exports.default = Component;

View File

@ -1,13 +0,0 @@
.chineseInput {
:global {
// 隐藏safari表单输入项右侧出现的图标
input::-webkit-contacts-auto-fill-button {
visibility: hidden;
display: none !important;
pointer-events: none;
position: absolute;
right: 0;
}
}
}

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import './index.less'; import './index.less';
interface QrCodeProps { interface QrCodeProps {
id?: string; id?: string;

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebConfig } from '../../../../general-app-domain/Application/Schema'; import { WebConfig } from '../../../../general-app-domain/Application/Schema';
export default function Web(props: { export default function Web(props: {
config: WebConfig; config: WebConfig;

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WechatMpConfig } from '../../../../general-app-domain/Application/Schema'; import { WechatMpConfig } from '../../../../general-app-domain/Application/Schema';
export default function WechatMp(props: { export default function WechatMp(props: {
config: WechatMpConfig; config: WechatMpConfig;

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WechatPublicConfig } from '../../../../general-app-domain/Application/Schema'; import { WechatPublicConfig } from '../../../../general-app-domain/Application/Schema';
export default function WechatPublic(props: { export default function WechatPublic(props: {
config: WechatPublicConfig; config: WechatPublicConfig;

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { Config } from '../../../../types/Config'; import { Config } from '../../../../types/Config';
export default function Account(props: { export default function Account(props: {
account: Required<Config>['Account']; account: Required<Config>['Account'];

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { Config } from '../../../../types/Config'; import { Config } from '../../../../types/Config';
export default function Cos(props: { export default function Cos(props: {
cos: Required<Config>['Cos']; cos: Required<Config>['Cos'];

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { Config } from '../../../../types/Config'; import { Config } from '../../../../types/Config';
export default function Cos(props: { export default function Cos(props: {
live: Required<Config>['Live']; live: Required<Config>['Live'];

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { Config } from '../../../../types/Config'; import { Config } from '../../../../types/Config';
export default function Cos(props: { export default function Cos(props: {
map: Required<Config>['Map']; map: Required<Config>['Map'];

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(): JSX.Element; export default function render(): JSX.Element;

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { UploadFile } from 'antd'; import { UploadFile } from 'antd';
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../general-app-domain'; import { EntityDict } from '../../../general-app-domain';

View File

@ -34,7 +34,6 @@ function render(props) {
var _this = this; var _this = this;
var _a = props.data, _b = _a.accept, accept = _b === void 0 ? 'image/*' : _b, _c = _a.maxNumber, maxNumber = _c === void 0 ? 20 : _c, _d = _a.multiple, multiple = _d === void 0 ? true : _d, _e = _a.draggable, draggable = _e === void 0 ? false : _e, _f = _a.theme, theme = _f === void 0 ? 'image' : _f, tips = _a.tips, beforeUpload = _a.beforeUpload, disabled = _a.disabled, style = _a.style, className = _a.className, _g = _a.directory, directory = _g === void 0 ? false : _g, onPreview = _a.onPreview, onDownload = _a.onDownload, children = _a.children, _h = _a.showUploadList, showUploadList = _h === void 0 ? true : _h, files = _a.files, systemConfig = _a.systemConfig, disableInsert = _a.disableInsert; var _a = props.data, _b = _a.accept, accept = _b === void 0 ? 'image/*' : _b, _c = _a.maxNumber, maxNumber = _c === void 0 ? 20 : _c, _d = _a.multiple, multiple = _d === void 0 ? true : _d, _e = _a.draggable, draggable = _e === void 0 ? false : _e, _f = _a.theme, theme = _f === void 0 ? 'image' : _f, tips = _a.tips, beforeUpload = _a.beforeUpload, disabled = _a.disabled, style = _a.style, className = _a.className, _g = _a.directory, directory = _g === void 0 ? false : _g, onPreview = _a.onPreview, onDownload = _a.onDownload, children = _a.children, _h = _a.showUploadList, showUploadList = _h === void 0 ? true : _h, files = _a.files, systemConfig = _a.systemConfig, disableInsert = _a.disableInsert;
var _j = props.methods, onPickByWeb = _j.onPickByWeb, onDeleteByWeb = _j.onDeleteByWeb; var _j = props.methods, onPickByWeb = _j.onPickByWeb, onDeleteByWeb = _j.onDeleteByWeb;
// 这里的逻辑可能和原来有点不对
var _k = tslib_1.__read((0, react_1.useState)([]), 2), newUploadFiles = _k[0], setNewUploadFiles = _k[1]; var _k = tslib_1.__read((0, react_1.useState)([]), 2), newUploadFiles = _k[0], setNewUploadFiles = _k[1];
var listType = getListType(theme); var listType = getListType(theme);
var setNewUploadFilesByStatus = function (file, status) { var setNewUploadFilesByStatus = function (file, status) {

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebComponentProps } from "oak-frontend-base"; import { WebComponentProps } from "oak-frontend-base";
import { EntityDict } from "../../../general-app-domain"; import { EntityDict } from "../../../general-app-domain";
export default function Render(props: WebComponentProps<EntityDict, 'user', false, { export default function Render(props: WebComponentProps<EntityDict, 'user', false, {

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../general-app-domain'; import { EntityDict } from '../../../general-app-domain';
export default function render(props: WebComponentProps<EntityDict, 'address', true, { export default function render(props: WebComponentProps<EntityDict, 'address', true, {

View File

@ -1,5 +0,0 @@
.container {
display: flex;
}

View File

@ -6,23 +6,17 @@ exports.default = OakComponent({
isList: false, isList: false,
formData: function (_a) { formData: function (_a) {
var props = _a.props; var props = _a.props;
return tslib_1.__awaiter(this, void 0, void 0, function () { var data = this.consumeMessage();
var width, data, self_1; if (data) {
return tslib_1.__generator(this, function (_b) { var self_1 = this;
width = props.width; message_1.default[data.type](Object.assign({}, process.env.OAK_PLATFORM === 'wechatMp' && {
data = this.consumeMessage(); // 处理小程序
if (data) { offset: [20, 32],
self_1 = this; icon: true,
message_1.default[data.type](Object.assign({}, process.env.OAK_PLATFORM === 'wechatMp' && { context: self_1,
// 处理小程序 }, data));
offset: [20, 32], }
icon: true, return {};
context: self_1,
}, data));
}
return [2 /*return*/, {}];
});
});
}, },
lifetimes: { lifetimes: {
attached: function () { attached: function () {

View File

@ -12,33 +12,31 @@ exports.default = OakComponent({
methods: { methods: {
tapAction: function (action) { tapAction: function (action) {
return tslib_1.__awaiter(this, void 0, void 0, function () { return tslib_1.__awaiter(this, void 0, void 0, function () {
var id; var id, _a;
return tslib_1.__generator(this, function (_a) { return tslib_1.__generator(this, function (_b) {
id = this.props.oakId; switch (_b.label) {
switch (action) { case 0:
case 'disable': { id = this.props.oakId;
_a = action;
switch (_a) {
case 'disable': return [3 /*break*/, 1];
}
return [3 /*break*/, 3];
case 1:
this.update({ this.update({
expired: true, expired: true,
}, 'disable'); }, 'disable');
this.execute(); return [4 /*yield*/, this.execute()];
break; case 2:
} _b.sent();
// case 'remove': { return [3 /*break*/, 4];
// await this.addOperation({ case 3:
// action: 'remove', {
// data: {}, return [3 /*break*/, 4];
// filter: { }
// id, _b.label = 4;
// }, case 4: return [2 /*return*/];
// });
// this.execute();
// break;
// }
default: {
break;
}
} }
return [2 /*return*/];
}); });
}); });
}, },

View File

@ -1 +1,8 @@
export default function render(this: any): any; /// <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

@ -3,14 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib"); var tslib_1 = require("tslib");
var jsx_runtime_1 = require("react/jsx-runtime"); var jsx_runtime_1 = require("react/jsx-runtime");
var antd_1 = require("antd"); var antd_1 = require("antd");
function render() { function Render(props) {
var _this = this; var _this = this;
var oakLegalActions = this.state.oakLegalActions; 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 return (oakLegalActions === null || oakLegalActions === void 0 ? void 0 : oakLegalActions.length) > 0
? oakLegalActions.map(function (ele) { ? oakLegalActions.map(function (ele) {
var btnName = _this.t("userEntityGrant:action.".concat(ele)); var btnName = t("userEntityGrant:action.".concat(ele));
if (ele === 'remove') { if (ele === 'remove') {
btnName = _this.t("common:action.".concat(ele)); btnName = t("common:action.".concat(ele));
} }
return ((0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "link", onClick: function (event) { return ((0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "link", onClick: function (event) {
var modal = antd_1.Modal.confirm({ var modal = antd_1.Modal.confirm({
@ -20,7 +22,7 @@ function render() {
onOk: function (e) { return tslib_1.__awaiter(_this, void 0, void 0, function () { onOk: function (e) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) { return tslib_1.__generator(this, function (_a) {
switch (_a.label) { switch (_a.label) {
case 0: return [4 /*yield*/, this.tapAction(ele)]; case 0: return [4 /*yield*/, tapAction(ele)];
case 1: case 1:
_a.sent(); _a.sent();
modal.destroy(); modal.destroy();
@ -36,4 +38,4 @@ function render() {
}) })
: null; : null;
} }
exports.default = render; exports.default = Render;

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../general-app-domain'; import { EntityDict } from '../../../general-app-domain';
export default function Render(props: WebComponentProps<EntityDict, 'address', true, { export default function Render(props: WebComponentProps<EntityDict, 'address', true, {

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../general-app-domain'; import { EntityDict } from '../../../general-app-domain';
export default function Render(props: WebComponentProps<EntityDict, 'address', false, { export default function Render(props: WebComponentProps<EntityDict, 'address', false, {

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -4,7 +4,6 @@ var tslib_1 = require("tslib");
var jsx_runtime_1 = require("react/jsx-runtime"); var jsx_runtime_1 = require("react/jsx-runtime");
var antd_1 = require("antd"); var antd_1 = require("antd");
var pageHeader_1 = tslib_1.__importDefault(require("../../../components/common/pageHeader")); var pageHeader_1 = tslib_1.__importDefault(require("../../../components/common/pageHeader"));
var input_1 = tslib_1.__importDefault(require("../../../components/common/input"));
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less")); var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
function render() { function render() {
var _this = this; var _this = this;
@ -14,9 +13,9 @@ function render() {
{ {
required: true, required: true,
}, },
] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(input_1.default, { onChange: function (e) { ] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { onChange: function (e) {
_this.setUpdateData('name', e.target.value); _this.setUpdateData('name', e.target.value);
}, value: name }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u63CF\u8FF0", requiredMark: true, name: "description" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(input_1.default.TextArea, { onChange: function (e) { }, value: name }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u63CF\u8FF0", requiredMark: true, name: "description" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input.TextArea, { onChange: function (e) {
_this.setUpdateData('description', e.target.value); _this.setUpdateData('description', e.target.value);
}, value: description }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u5E94\u7528\u7C7B\u578B", requiredMark: true, name: "type", rules: [ }, value: description }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u5E94\u7528\u7C7B\u578B", requiredMark: true, name: "type", rules: [
{ {

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../general-app-domain'; import { EntityDict } from '../../../general-app-domain';
export default function render(props: WebComponentProps<EntityDict, 'article', true, { export default function render(props: WebComponentProps<EntityDict, 'article', true, {

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../general-app-domain'; import { EntityDict } from '../../../general-app-domain';
export default function render(props: WebComponentProps<EntityDict, 'article', false, { export default function render(props: WebComponentProps<EntityDict, 'article', false, {

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import '@wangeditor/editor/dist/css/style.css'; import '@wangeditor/editor/dist/css/style.css';
import { EntityDict } from './../../../general-app-domain'; import { EntityDict } from './../../../general-app-domain';
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../general-app-domain'; import { EntityDict } from '../../general-app-domain';
export default function render(props: WebComponentProps<EntityDict, 'token', false, { export default function render(props: WebComponentProps<EntityDict, 'token', false, {

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../general-app-domain'; import { EntityDict } from '../../../general-app-domain';
export default function render(props: WebComponentProps<EntityDict, 'mobile', true, { export default function render(props: WebComponentProps<EntityDict, 'mobile', true, {

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { EntityDict } from '../../../general-app-domain'; import { EntityDict } from '../../../general-app-domain';
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
export default function render(props: WebComponentProps<EntityDict, 'area', true, { export default function render(props: WebComponentProps<EntityDict, 'area', true, {

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -4,7 +4,6 @@ var tslib_1 = require("tslib");
var jsx_runtime_1 = require("react/jsx-runtime"); var jsx_runtime_1 = require("react/jsx-runtime");
var antd_1 = require("antd"); var antd_1 = require("antd");
var pageHeader_1 = tslib_1.__importDefault(require("../../../components/common/pageHeader")); var pageHeader_1 = tslib_1.__importDefault(require("../../../components/common/pageHeader"));
var input_1 = tslib_1.__importDefault(require("../../../components/common/input"));
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less")); var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
function render() { function render() {
var _this = this; var _this = this;
@ -13,9 +12,9 @@ function render() {
{ {
required: true, required: true,
}, },
] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(input_1.default, { onChange: function (e) { ] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { onChange: function (e) {
_this.setUpdateData('name', e.target.value); _this.setUpdateData('name', e.target.value);
}, value: name }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u63CF\u8FF0", requiredMark: true, name: "description" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(input_1.default.TextArea, { onChange: function (e) { }, value: name }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u63CF\u8FF0", requiredMark: true, name: "description" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input.TextArea, { onChange: function (e) {
_this.setUpdateData('description', e.target.value); _this.setUpdateData('description', e.target.value);
}, value: description }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 4 } }, { children: (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () { }, value: description }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 4 } }, { children: (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () {
_this.confirm(); _this.confirm();

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -4,7 +4,6 @@ var tslib_1 = require("tslib");
var jsx_runtime_1 = require("react/jsx-runtime"); var jsx_runtime_1 = require("react/jsx-runtime");
var antd_1 = require("antd"); var antd_1 = require("antd");
var pageHeader_1 = tslib_1.__importDefault(require("../../../components/common/pageHeader")); var pageHeader_1 = tslib_1.__importDefault(require("../../../components/common/pageHeader"));
var input_1 = tslib_1.__importDefault(require("../../../components/common/input"));
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less")); var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
function render() { function render() {
var _this = this; var _this = this;
@ -14,9 +13,9 @@ function render() {
{ {
required: true, required: true,
}, },
] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(input_1.default, { onChange: function (e) { ] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { onChange: function (e) {
_this.setUpdateData('name', e.target.value); _this.setUpdateData('name', e.target.value);
}, value: name }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u63CF\u8FF0", requiredMark: true, name: "description" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(input_1.default.TextArea, { onChange: function (e) { }, value: name }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u63CF\u8FF0", requiredMark: true, name: "description" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input.TextArea, { onChange: function (e) {
_this.setUpdateData('description', e.target.value); _this.setUpdateData('description', e.target.value);
}, value: description }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u662F\u5426\u4E3A\u8D85\u7EA7\u7CFB\u7EDF", requiredMark: true, name: "super" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Switch, { checkedChildren: "\u662F", unCheckedChildren: "\u5426", checked: super2, onChange: function (checked) { }, value: description }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u662F\u5426\u4E3A\u8D85\u7EA7\u7CFB\u7EDF", requiredMark: true, name: "super" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Switch, { checkedChildren: "\u662F", unCheckedChildren: "\u5426", checked: super2, onChange: function (checked) {
_this.setUpdateData('super', checked); _this.setUpdateData('super', checked);

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { EntityDict } from '../../../general-app-domain'; import { EntityDict } from '../../../general-app-domain';
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
export default function Render(props: WebComponentProps<EntityDict, 'token', true, { export default function Render(props: WebComponentProps<EntityDict, 'token', true, {

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../../general-app-domain'; import { EntityDict } from '../../../../general-app-domain';
export default function render(props: WebComponentProps<EntityDict, 'user', false, { export default function render(props: WebComponentProps<EntityDict, 'user', false, {

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { EntityDict } from '../../../../general-app-domain'; import { EntityDict } from '../../../../general-app-domain';
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
export default function Render(props: WebComponentProps<EntityDict, 'user', false, { export default function Render(props: WebComponentProps<EntityDict, 'user', false, {

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { EntityDict } from '../../../general-app-domain'; import { EntityDict } from '../../../general-app-domain';
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
export default function render(props: WebComponentProps<EntityDict, 'user', true, { export default function render(props: WebComponentProps<EntityDict, 'user', true, {

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(): JSX.Element; export default function render(): JSX.Element;

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(): JSX.Element; export default function render(): JSX.Element;

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../general-app-domain'; import { EntityDict } from '../../../general-app-domain';
export default function Render(props: WebComponentProps<EntityDict, 'user', true, { export default function Render(props: WebComponentProps<EntityDict, 'user', true, {

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1 +1,10 @@
export default function render(this: any): JSX.Element; /// <reference types="react" />
import { EntityDict } from '../../../general-app-domain';
import { WebComponentProps } from 'oak-frontend-base';
export default function render(props: WebComponentProps<EntityDict, 'userEntityGrant', true, {
searchValue: string;
list: EntityDict['userEntityGrant']['Schema'][];
pagination: any;
showBack: boolean;
variant?: 'inline' | 'alone' | 'dialog';
}, {}>): JSX.Element;

View File

@ -7,11 +7,10 @@ var dayjs_1 = tslib_1.__importDefault(require("dayjs"));
var pageHeader_1 = tslib_1.__importDefault(require("../../../components/common/pageHeader")); var pageHeader_1 = tslib_1.__importDefault(require("../../../components/common/pageHeader"));
var cellButton_1 = tslib_1.__importDefault(require("../../../components/userEntityGrant/cellButton")); var cellButton_1 = tslib_1.__importDefault(require("../../../components/userEntityGrant/cellButton"));
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less")); var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
function render() { function render(props) {
var _this = this; var _a = props.data, pagination = _a.pagination, _b = _a.list, list = _b === void 0 ? [] : _b, oakLoading = _a.oakLoading, showBack = _a.showBack, variant = _a.variant, oakFullpath = _a.oakFullpath;
var _a = this.props, variant = _a.variant, namespace = _a.namespace, platformId = _a.platformId, showBack = _a.showBack; var _c = pagination || {}, pageSize = _c.pageSize, total = _c.total, currentPage = _c.currentPage;
var _b = this.state, _c = _b.list, list = _c === void 0 ? [] : _c, oakLoading = _b.oakLoading, pagination = _b.pagination; var _d = props.methods, t = _d.t, setPageSize = _d.setPageSize, setCurrentPage = _d.setCurrentPage;
var _d = pagination || {}, pageSize = _d.pageSize, total = _d.total, currentPage = _d.currentPage;
return ((0, jsx_runtime_1.jsx)(Container, tslib_1.__assign({ showBack: showBack, variant: variant }, { children: (0, jsx_runtime_1.jsx)(antd_1.Table, { loading: oakLoading, dataSource: list, rowKey: "id", columns: [ return ((0, jsx_runtime_1.jsx)(Container, tslib_1.__assign({ showBack: showBack, variant: variant }, { children: (0, jsx_runtime_1.jsx)(antd_1.Table, { loading: oakLoading, dataSource: list, rowKey: "id", columns: [
// { // {
// dataIndex: 'id', // dataIndex: 'id',
@ -46,14 +45,14 @@ function render() {
dataIndex: 'type', dataIndex: 'type',
title: '授权类型', title: '授权类型',
render: function (value, record, index) { render: function (value, record, index) {
return _this.t("userEntityGrant:v.type.".concat(value)); return t("userEntityGrant:v.type.".concat(value));
}, },
}, },
{ {
dataIndex: 'relation', dataIndex: 'relation',
title: '权限', title: '权限',
render: function (value, record, index) { render: function (value, record, index) {
return _this.t("".concat(record.entity, ":r.").concat(value)); return t("".concat(record.entity, ":r.").concat(value));
}, },
}, },
{ {
@ -67,7 +66,7 @@ function render() {
dataIndex: 'expired', dataIndex: 'expired',
title: '状态', title: '状态',
render: function (value, record, index) { render: function (value, record, index) {
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.expireAt).format('YYYY-MM-DD HH:mm')] }))] }))); 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')] }))] })));
}, },
}, },
{ {
@ -76,7 +75,7 @@ function render() {
title: '操作', title: '操作',
align: 'center', align: 'center',
render: function (value, record, index) { render: function (value, record, index) {
return ((0, jsx_runtime_1.jsx)(cellButton_1.default, { oakId: record.id, oakPath: "".concat(_this.state.oakFullpath, ".").concat(record.id) })); return ((0, jsx_runtime_1.jsx)(cellButton_1.default, { oakId: record.id, oakPath: "".concat(oakFullpath, ".").concat(record.id) }));
}, },
fixed: 'right', fixed: 'right',
}, },
@ -85,10 +84,10 @@ function render() {
pageSize: pageSize, pageSize: pageSize,
current: currentPage, current: currentPage,
onShowSizeChange: function (pageSize) { onShowSizeChange: function (pageSize) {
_this.setPageSize(pageSize); setPageSize(pageSize);
}, },
onChange: function (current) { onChange: function (current) {
_this.setCurrentPage(current); setCurrentPage(current);
}, },
} }) }))); } }) })));
} }

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../general-app-domain'; import { EntityDict } from '../../../general-app-domain';
export default function Render(props: WebComponentProps<EntityDict, 'user', true, { export default function Render(props: WebComponentProps<EntityDict, 'user', true, {

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../general-app-domain'; import { EntityDict } from '../../../general-app-domain';
export default function Render(props: WebComponentProps<EntityDict, 'user', true, { export default function Render(props: WebComponentProps<EntityDict, 'user', true, {

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../../general-app-domain'; import { EntityDict } from '../../../../general-app-domain';
export default function Render(props: WebComponentProps<EntityDict, 'mobile', false, { export default function Render(props: WebComponentProps<EntityDict, 'mobile', false, {

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../../general-app-domain'; import { EntityDict } from '../../../../general-app-domain';
export default function Render(props: WebComponentProps<EntityDict, 'user', false, { export default function Render(props: WebComponentProps<EntityDict, 'user', false, {

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../../general-app-domain'; import { EntityDict } from '../../../../general-app-domain';
export default function render(props: WebComponentProps<EntityDict, 'userEntityGrant', false, { export default function render(props: WebComponentProps<EntityDict, 'userEntityGrant', false, {

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../../../general-app-domain'; import { EntityDict } from '../../../../../general-app-domain';
export default function Render(props: WebComponentProps<EntityDict, 'user', false, { export default function Render(props: WebComponentProps<EntityDict, 'user', false, {

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../../general-app-domain'; import { EntityDict } from '../../../../general-app-domain';
export default function Render(props: WebComponentProps<EntityDict, 'user', false, { export default function Render(props: WebComponentProps<EntityDict, 'user', false, {

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebComponentProps } from 'oak-frontend-base'; import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../general-app-domain'; import { EntityDict } from '../../../general-app-domain';
export default function Render(props: WebComponentProps<EntityDict, 'user', false, { export default function Render(props: WebComponentProps<EntityDict, 'user', false, {

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1 +1,2 @@
/// <reference types="react" />
export default function render(this: any): JSX.Element; export default function render(this: any): JSX.Element;

View File

@ -1,13 +0,0 @@
.chineseInput {
:global {
// 隐藏safari表单输入项右侧出现的图标
input::-webkit-contacts-auto-fill-button {
visibility: hidden;
display: none !important;
pointer-events: none;
position: absolute;
right: 0;
}
}
}

View File

@ -1,80 +0,0 @@
import React, { useState, useEffect } from 'react';
import { Input, InputProps } from 'antd';
interface IProps extends InputProps {
value?: string;
autoSize?: boolean | object;
}
function BaseHOC(key?: string) {
return function (props: IProps) {
const { defaultValue, value, onChange } = props;
const hasValue = props.hasOwnProperty('value');
// 用户切换到底是显示 value 还是 input
// 不能直接用 isOnComposition 原因是,这个值发生变化不会触发重新渲染
// 不能只使用 flag 原因是setFlag 是异步的
const [flag, setFlag] = useState(false);
// 非中文输入时候显示 value。中文输入的时候显示 input
const [input, setInput] = useState(hasValue ? value : defaultValue);
useEffect(
function () {
if (hasValue && input !== value) {
setInput(value);
}
},
[value]
);
let isOnComposition = false;
function handleChange(e: React.ChangeEvent<HTMLInputElement>) {
setInput(e.target.value);
if (isOnComposition) return;
onChange && onChange(e);
}
function handleComposition(
e?:any
) {
if ('compositionend' === e?.type) {
isOnComposition = false;
handleChange(e);
} else {
isOnComposition = true;
}
if (flag !== isOnComposition) {
setFlag(isOnComposition);
}
}
let Component = Input;
if (key) {
// @ts-ignore
Component = Input[key];
}
return (
<Component
{...props}
value={hasValue && !flag ? value : input}
onCompositionStart={handleComposition}
onCompositionUpdate={handleComposition}
onCompositionEnd={handleComposition}
onChange={handleChange}
/>
);
};
}
const Component = function (props: IProps) {
return BaseHOC()(props);
};
Component.Search = function (props: IProps) {
return BaseHOC('Search')(props);
};
Component.TextArea = function (props: IProps) {
return BaseHOC('TextArea')(props);
};
Component.Password = Input.Password
Component.Group = Input.Group
export default Component;

View File

@ -100,7 +100,6 @@ export default function render(
} = props.data; } = props.data;
const { onPickByWeb, onDeleteByWeb } = props.methods; const { onPickByWeb, onDeleteByWeb } = props.methods;
// 这里的逻辑可能和原来有点不对
const [newUploadFiles, setNewUploadFiles] = useState([] as NewUploadFile[]); const [newUploadFiles, setNewUploadFiles] = useState([] as NewUploadFile[]);
const listType = getListType(theme); const listType = getListType(theme);
@ -168,7 +167,7 @@ export default function render(
theme === 'custom' theme === 'custom'
? [] ? []
: files?.length : files?.length
? files.map((ele: any) => ? files.map((ele) =>
extraFileToUploadFile(ele, systemConfig) extraFileToUploadFile(ele, systemConfig)
) )
: undefined : undefined

View File

@ -3,8 +3,7 @@ import Message from '../../utils/message';
export default OakComponent({ export default OakComponent({
isList: false, isList: false,
async formData({ props }) { formData({ props }) {
const { width } = props;
const data = this.consumeMessage() as MessageProps; const data = this.consumeMessage() as MessageProps;
if (data) { if (data) {
const self = this; const self = this;

View File

@ -13,20 +13,9 @@ export default OakComponent({
this.update({ this.update({
expired: true, expired: true,
}, 'disable'); }, 'disable');
this.execute(); await this.execute();
break; break;
} }
// case 'remove': {
// await this.addOperation({
// action: 'remove',
// data: {},
// filter: {
// id,
// },
// });
// this.execute();
// break;
// }
default: { default: {
break; break;
} }

View File

@ -1,14 +1,31 @@
import React from 'react'; import React from 'react';
import { Button, Modal } from 'antd'; import { Button, Modal } from 'antd';
export default function render(this: any) { import { EntityDict } from '../../../general-app-domain';
const { oakLegalActions } = this.state; 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 return oakLegalActions?.length > 0
? oakLegalActions.map((ele: string) => { ? oakLegalActions.map((ele: string) => {
let btnName = this.t(`userEntityGrant:action.${ele}`); let btnName = t(`userEntityGrant:action.${ele}`);
if (ele === 'remove') { if (ele === 'remove') {
btnName = this.t(`common:action.${ele}`); btnName = t(`common:action.${ele}`);
} }
return ( return (
<Button <Button
@ -19,7 +36,7 @@ export default function render(this: any) {
okText: '确定', okText: '确定',
cancelText: '取消', cancelText: '取消',
onOk: async (e) => { onOk: async (e) => {
await this.tapAction(ele); await tapAction(ele);
modal!.destroy!(); modal!.destroy!();
}, },
onCancel: (e) => { onCancel: (e) => {

View File

@ -1,7 +1,6 @@
import React from 'react'; import React from 'react';
import { Button, Form, Row, Col, Select, Space } from 'antd'; import { Button, Form, Row, Col, Select, Space, Input } from 'antd';
import PageHeader from '../../../components/common/pageHeader'; import PageHeader from '../../../components/common/pageHeader';
import Input from '../../../components/common/input';
import Style from './web.module.less'; import Style from './web.module.less';

View File

@ -1,7 +1,6 @@
import React from 'react'; import React from 'react';
import { Button, Form, Row, Col } from 'antd'; import { Button, Form, Row, Col, Input } from 'antd';
import PageHeader from '../../../components/common/pageHeader'; import PageHeader from '../../../components/common/pageHeader';
import Input from '../../../components/common/input';
import Style from './web.module.less'; import Style from './web.module.less';

View File

@ -1,7 +1,6 @@
import React from 'react'; import React from 'react';
import { Button, Form, Row, Col, Switch } from 'antd'; import { Button, Form, Row, Col, Switch, Input } from 'antd';
import PageHeader from '../../../components/common/pageHeader'; import PageHeader from '../../../components/common/pageHeader';
import Input from '../../../components/common/input';
import Style from './web.module.less'; import Style from './web.module.less';

View File

@ -3,15 +3,39 @@ import { Table, Button, Space, Typography, Modal } from 'antd';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import PageHeader from '../../../components/common/pageHeader'; import PageHeader from '../../../components/common/pageHeader';
import CellButton from '../../../components/userEntityGrant/cellButton'; import CellButton from '../../../components/userEntityGrant/cellButton';
import { EntityDict } from '../../../general-app-domain';
import { WebComponentProps } from 'oak-frontend-base';
import Style from './web.module.less'; import Style from './web.module.less';
export default function render(this: any) { export default function render(
const { variant, namespace, platformId, showBack } = this.props; props: WebComponentProps<
EntityDict,
'userEntityGrant',
true,
{
searchValue: string;
list: EntityDict['userEntityGrant']['Schema'][];
pagination: any;
showBack: boolean;
variant?: 'inline' | 'alone' | 'dialog';
},
{}
>
) {
const {
pagination,
list = [],
oakLoading,
showBack,
variant,
oakFullpath,
} = props.data;
const { list = [], oakLoading, pagination } = this.state;
const { pageSize, total, currentPage } = pagination || {}; const { pageSize, total, currentPage } = pagination || {};
const { t, setPageSize, setCurrentPage } = props.methods;
return ( return (
<Container showBack={showBack} variant={variant}> <Container showBack={showBack} variant={variant}>
<Table <Table
@ -60,14 +84,14 @@ export default function render(this: any) {
dataIndex: 'type', dataIndex: 'type',
title: '授权类型', title: '授权类型',
render: (value, record, index) => { render: (value, record, index) => {
return this.t(`userEntityGrant:v.type.${value}`); return t(`userEntityGrant:v.type.${value}`);
}, },
}, },
{ {
dataIndex: 'relation', dataIndex: 'relation',
title: '权限', title: '权限',
render: (value, record, index) => { render: (value, record, index) => {
return this.t(`${record.entity}:r.${value}`); return t(`${record.entity}:r.${value}`);
}, },
}, },
{ {
@ -89,7 +113,7 @@ export default function render(this: any) {
{!record.expired && ( {!record.expired && (
<Typography.Text> <Typography.Text>
&nbsp; &nbsp;
{dayjs(record.expireAt).format( {dayjs(record.expiresAt).format(
'YYYY-MM-DD HH:mm' 'YYYY-MM-DD HH:mm'
)} )}
</Typography.Text> </Typography.Text>
@ -107,7 +131,7 @@ export default function render(this: any) {
return ( return (
<CellButton <CellButton
oakId={record.id} oakId={record.id}
oakPath={`${this.state.oakFullpath}.${record.id}`} oakPath={`${oakFullpath}.${record.id}`}
/> />
); );
}, },
@ -119,10 +143,10 @@ export default function render(this: any) {
pageSize, pageSize,
current: currentPage, current: currentPage,
onShowSizeChange: (pageSize: number) => { onShowSizeChange: (pageSize: number) => {
this.setPageSize(pageSize); setPageSize(pageSize);
}, },
onChange: (current: number) => { onChange: (current: number) => {
this.setCurrentPage(current); setCurrentPage(current);
}, },
}} }}
/> />