删除 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';
declare const Empty: () => JSX.Element;
export default Empty;

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import './index.less';
declare const Empty: () => JSX.Element;
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';
interface QrCodeProps {
id?: string;

View File

@ -1 +1,2 @@
/// <reference types="react" />
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';
export default function Web(props: {
config: WebConfig;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -34,7 +34,6 @@ function render(props) {
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 _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 listType = getListType(theme);
var setNewUploadFilesByStatus = function (file, status) {

View File

@ -1,3 +1,4 @@
/// <reference types="react" />
import { WebComponentProps } from "oak-frontend-base";
import { EntityDict } from "../../../general-app-domain";
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 { EntityDict } from '../../../general-app-domain';
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,
formData: function (_a) {
var props = _a.props;
return tslib_1.__awaiter(this, void 0, void 0, function () {
var width, data, self_1;
return tslib_1.__generator(this, function (_b) {
width = props.width;
data = this.consumeMessage();
if (data) {
self_1 = this;
message_1.default[data.type](Object.assign({}, process.env.OAK_PLATFORM === 'wechatMp' && {
// 处理小程序
offset: [20, 32],
icon: true,
context: self_1,
}, data));
}
return [2 /*return*/, {}];
});
});
var data = this.consumeMessage();
if (data) {
var self_1 = this;
message_1.default[data.type](Object.assign({}, process.env.OAK_PLATFORM === 'wechatMp' && {
// 处理小程序
offset: [20, 32],
icon: true,
context: self_1,
}, data));
}
return {};
},
lifetimes: {
attached: function () {

View File

@ -12,33 +12,31 @@ exports.default = OakComponent({
methods: {
tapAction: function (action) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var id;
return tslib_1.__generator(this, function (_a) {
id = this.props.oakId;
switch (action) {
case 'disable': {
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');
this.execute();
break;
}
// case 'remove': {
// await this.addOperation({
// action: 'remove',
// data: {},
// filter: {
// id,
// },
// });
// this.execute();
// break;
// }
default: {
break;
}
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*/];
}
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 jsx_runtime_1 = require("react/jsx-runtime");
var antd_1 = require("antd");
function render() {
function Render(props) {
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
? oakLegalActions.map(function (ele) {
var btnName = _this.t("userEntityGrant:action.".concat(ele));
var btnName = t("userEntityGrant:action.".concat(ele));
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) {
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 () {
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.tapAction(ele)];
case 0: return [4 /*yield*/, tapAction(ele)];
case 1:
_a.sent();
modal.destroy();
@ -36,4 +38,4 @@ function render() {
})
: null;
}
exports.default = render;
exports.default = Render;

View File

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

View File

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

View File

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

View File

@ -1 +1,2 @@
/// <reference types="react" />
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 antd_1 = require("antd");
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"));
function render() {
var _this = this;
@ -14,9 +13,9 @@ function render() {
{
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);
}, 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);
}, 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;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1 +1,2 @@
/// <reference types="react" />
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 antd_1 = require("antd");
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"));
function render() {
var _this = this;
@ -13,9 +12,9 @@ function render() {
{
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);
}, 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);
}, 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();

View File

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

View File

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

View File

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

View File

@ -1 +1,2 @@
/// <reference types="react" />
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 antd_1 = require("antd");
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"));
function render() {
var _this = this;
@ -14,9 +13,9 @@ function render() {
{
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);
}, 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);
}, 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);

View File

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

View File

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

View File

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

View File

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

View File

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

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 cellButton_1 = tslib_1.__importDefault(require("../../../components/userEntityGrant/cellButton"));
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
function render() {
var _this = this;
var _a = this.props, variant = _a.variant, namespace = _a.namespace, platformId = _a.platformId, showBack = _a.showBack;
var _b = this.state, _c = _b.list, list = _c === void 0 ? [] : _c, oakLoading = _b.oakLoading, pagination = _b.pagination;
var _d = pagination || {}, pageSize = _d.pageSize, total = _d.total, currentPage = _d.currentPage;
function render(props) {
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 _c = pagination || {}, pageSize = _c.pageSize, total = _c.total, currentPage = _c.currentPage;
var _d = props.methods, t = _d.t, setPageSize = _d.setPageSize, setCurrentPage = _d.setCurrentPage;
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',
@ -46,14 +45,14 @@ function render() {
dataIndex: 'type',
title: '授权类型',
render: function (value, record, index) {
return _this.t("userEntityGrant:v.type.".concat(value));
return t("userEntityGrant:v.type.".concat(value));
},
},
{
dataIndex: 'relation',
title: '权限',
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',
title: '状态',
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: '操作',
align: 'center',
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',
},
@ -85,10 +84,10 @@ function render() {
pageSize: pageSize,
current: currentPage,
onShowSizeChange: function (pageSize) {
_this.setPageSize(pageSize);
setPageSize(pageSize);
},
onChange: function (current) {
_this.setCurrentPage(current);
setCurrentPage(current);
},
} }) })));
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,6 @@
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 Input from '../../../components/common/input';
import Style from './web.module.less';

View File

@ -1,7 +1,6 @@
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 Input from '../../../components/common/input';
import Style from './web.module.less';

View File

@ -1,7 +1,6 @@
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 Input from '../../../components/common/input';
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 PageHeader from '../../../components/common/pageHeader';
import CellButton from '../../../components/userEntityGrant/cellButton';
import { EntityDict } from '../../../general-app-domain';
import { WebComponentProps } from 'oak-frontend-base';
import Style from './web.module.less';
export default function render(this: any) {
const { variant, namespace, platformId, showBack } = this.props;
export default function render(
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 { t, setPageSize, setCurrentPage } = props.methods;
return (
<Container showBack={showBack} variant={variant}>
<Table
@ -60,14 +84,14 @@ export default function render(this: any) {
dataIndex: 'type',
title: '授权类型',
render: (value, record, index) => {
return this.t(`userEntityGrant:v.type.${value}`);
return t(`userEntityGrant:v.type.${value}`);
},
},
{
dataIndex: 'relation',
title: '权限',
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 && (
<Typography.Text>
&nbsp;
{dayjs(record.expireAt).format(
{dayjs(record.expiresAt).format(
'YYYY-MM-DD HH:mm'
)}
</Typography.Text>
@ -107,7 +131,7 @@ export default function render(this: any) {
return (
<CellButton
oakId={record.id}
oakPath={`${this.state.oakFullpath}.${record.id}`}
oakPath={`${oakFullpath}.${record.id}`}
/>
);
},
@ -119,10 +143,10 @@ export default function render(this: any) {
pageSize,
current: currentPage,
onShowSizeChange: (pageSize: number) => {
this.setPageSize(pageSize);
setPageSize(pageSize);
},
onChange: (current: number) => {
this.setCurrentPage(current);
setCurrentPage(current);
},
}}
/>