修正了userRelation的一些样式

This commit is contained in:
Xu Chang 2023-08-03 16:50:25 +08:00
parent 788b8a537d
commit cce3716067
8 changed files with 124 additions and 69 deletions

View File

@ -171,7 +171,7 @@ function render(props) {
onPickByWeb([(0, utils_1.file2Obj)(file)]);
}
else {
setNewUploadFiles([(0, utils_1.file2Obj)(file)]);
setNewUploadFiles(fileList);
}
}
}, onRemove: function (file) {

View File

@ -4,8 +4,11 @@ import { ReactComponentProps } from 'oak-frontend-base/lib/types/Page';
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, true, {
entity: keyof ED2;
entityId: string;
relations: string[];
redirectToAfterConfirm: EntityDict['userEntityGrant']['Schema']['redirectTo'];
redirectToAfterConfirm: ED2["userEntityGrant"]["Schema"]["redirectTo"];
qrCodeType: string;
showTitle: true;
showBack: false;
onCreate: () => void;
onUpdate: (id: string) => void;
}>) => React.ReactElement;
export default _default;

View File

@ -163,6 +163,8 @@ exports.default = OakComponent({
qrCodeType: '',
showTitle: true,
showBack: false,
onUpdate: function (id) { return undefined; },
onCreate: function () { return undefined; },
},
data: {
searchValue: '',
@ -198,24 +200,40 @@ exports.default = OakComponent({
},
methods: {
goUpsert: function () {
var _a = this.props, entity = _a.entity, entityId = _a.entityId, redirectToAfterConfirm = _a.redirectToAfterConfirm, qrCodeType = _a.qrCodeType;
this.navigateTo({
url: '/userRelation/upsert',
entity: entity,
entityId: entityId,
}, {
redirectToAfterConfirm: redirectToAfterConfirm,
qrCodeType: qrCodeType,
});
var _a = this.props, entity = _a.entity, entityId = _a.entityId, redirectToAfterConfirm = _a.redirectToAfterConfirm, qrCodeType = _a.qrCodeType, onCreate = _a.onCreate;
if (onCreate) {
onCreate();
}
else {
if (process.env.NODE_ENV === 'development') {
console.warn('userRelation将不再作为page直接使用请使用回调函数处理');
}
this.navigateTo({
url: '/userRelation/upsert',
entity: entity,
entityId: entityId,
}, {
redirectToAfterConfirm: redirectToAfterConfirm,
qrCodeType: qrCodeType,
});
}
},
goUpdate: function (id) {
var _a = this.props, entity = _a.entity, entityId = _a.entityId;
this.navigateTo({
url: '/userRelation/upsert/byUser',
entity: entity,
entityId: entityId,
oakId: id,
});
var _a = this.props, entity = _a.entity, entityId = _a.entityId, onUpdate = _a.onUpdate;
if (onUpdate) {
onUpdate(id);
}
else {
if (process.env.NODE_ENV === 'development') {
console.warn('userRelation将不再作为page直接使用请使用回调函数处理');
}
this.navigateTo({
url: '/userRelation/upsert/byUser',
entity: entity,
entityId: entityId,
oakId: id,
});
}
},
confirmDelete: function (idRemove) {
return tslib_1.__awaiter(this, void 0, void 0, function () {

View File

@ -1,10 +1,10 @@
/// <reference types="react" />
import { ReactComponentProps } from 'oak-frontend-base/lib/types/Page';
import { EntityDict } from '../../../general-app-domain';
import { QrCodeType } from '../../../types/Config';
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "relation", true, {
entity: keyof EntityDict;
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, true, {
entity: keyof ED2;
entityId: string;
redirectToAfterConfirm: import("../../../general-app-domain/UserEntityGrant/Schema").RedirectToProps | null | undefined;
qrCodeType: QrCodeType;
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
redirectToAfterConfirm: ED2["userEntityGrant"]["Schema"]["redirectTo"];
qrCodeType: string;
}>) => React.ReactElement;
export default _default;

View File

@ -165,6 +165,8 @@ export default OakComponent({
qrCodeType: '' as string,
showTitle: true,
showBack: false,
onUpdate: (id: string) => undefined as void,
onCreate: () => undefined as void,
},
data: {
searchValue: '',
@ -205,29 +207,46 @@ export default OakComponent({
entityId,
redirectToAfterConfirm,
qrCodeType,
onCreate,
} = this.props;
this.navigateTo(
{
url: '/userRelation/upsert',
entity,
entityId,
},
{
redirectToAfterConfirm,
qrCodeType,
if (onCreate) {
onCreate();
}
else {
if (process.env.NODE_ENV === 'development') {
console.warn('userRelation将不再作为page直接使用请使用回调函数处理');
}
);
this.navigateTo(
{
url: '/userRelation/upsert',
entity,
entityId,
},
{
redirectToAfterConfirm,
qrCodeType,
}
);
}
},
goUpdate(id: string) {
const { entity, entityId } = this.props;
this.navigateTo(
{
url: '/userRelation/upsert/byUser',
entity,
entityId,
oakId: id,
},
);
const { entity, entityId, onUpdate } = this.props;
if (onUpdate) {
onUpdate(id);
}
else {
if (process.env.NODE_ENV === 'development') {
console.warn('userRelation将不再作为page直接使用请使用回调函数处理');
}
this.navigateTo(
{
url: '/userRelation/upsert/byUser',
entity,
entityId,
oakId: id,
},
);
}
},
async confirmDelete(idRemove: string) {
const { entity, entityId } = this.props;
@ -373,16 +392,19 @@ export default OakComponent({
},
},
}) as <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(
props: ReactComponentProps<
ED2,
T2,
true,
{
entity: keyof ED2,
entityId: string,
relations: string[],
redirectToAfterConfirm: EntityDict['userEntityGrant']['Schema']['redirectTo'],
qrCodeType: string,
}
>
) => React.ReactElement;
props: ReactComponentProps<
ED2,
T2,
true,
{
entity: keyof ED2,
entityId: string,
redirectToAfterConfirm: ED2['userEntityGrant']['Schema']['redirectTo'],
qrCodeType: string,
showTitle: true,
showBack: false,
onCreate: () => void,
onUpdate: (id: string) => void,
}
>
) => React.ReactElement;

View File

@ -9,7 +9,6 @@ import {
Tag,
Modal,
} from 'antd';
import PageHeader from '../../../components/common/pageHeader';
// import UserEntityGrantList from '../../../pages/userEntityGrant/list';
import Style from './web.module.less';
@ -64,7 +63,7 @@ export default function Render(
const [inviteVisible, setInviteVisible] = useState(false);
return (
<PageHeader title={showTitle ? '权限列表' : undefined} showBack={showBack}>
<>
<div className={Style.container}>
<Space style={{ marginBottom: 16 }}>
<Button type="primary" onClick={() => goUpsert()}>
@ -197,6 +196,6 @@ export default function Render(
oakPath="$userRelation/list-userEntityGrant/list"
/>
</Modal> */}
</PageHeader>
</>
);
}

View File

@ -1,6 +1,8 @@
import assert from 'assert';
import { ReactComponentProps } from 'oak-frontend-base/lib/types/Page';
import { WebConfig } from '../../../entities/Application';
import { EntityDict } from '../../../general-app-domain';
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
import { QrCodeType } from '../../../types/Config';
export default OakComponent({
@ -99,4 +101,16 @@ export default OakComponent({
});
},
},
});
}) as <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(
props: ReactComponentProps<
ED2,
T2,
true,
{
entity: keyof ED2,
entityId: string,
redirectToAfterConfirm: ED2['userEntityGrant']['Schema']['redirectTo'],
qrCodeType: string,
}
>
) => React.ReactElement;

View File

@ -1,6 +1,5 @@
import React from 'react';
import { Tabs } from 'antd';
import PageHeader from '../../../components/common/pageHeader';
import Style from './web.module.less';
import ByMobile from './byMobile/index';
import ByUserEntityGrant from './byUserEntityGrant';
@ -56,7 +55,7 @@ export default function Render(
entity={entity}
entityId={entityId}
relations={relations}
oakPath={oakFullpath ? `$${oakFullpath}-mobile` : undefined}
oakPath={oakFullpath ? `$userRelation-upsert-by-mobile` : undefined}
oakAutoUnmount={true}
/>
);
@ -70,7 +69,7 @@ export default function Render(
relations={relations}
oakPath={
oakFullpath
? `$${oakFullpath}-userEntityGrant`
? `$userRelation-upsert-by-userEntityGrant`
: undefined
}
oakAutoUnmount={true}
@ -94,7 +93,7 @@ export default function Render(
entityId={entityId}
relations={relations}
oakPath={
oakFullpath ? `$${oakFullpath}-mobile` : undefined
oakFullpath ? `$userRelation-upsert-by-mobile` : undefined
}
oakAutoUnmount={true}
/>
@ -111,7 +110,7 @@ export default function Render(
qrCodeType={qrCodeType}
oakPath={
oakFullpath
? `$${oakFullpath}-userEntityGrant`
? `$userRelation-upsert-by-userEntityGrant`
: undefined
}
oakAutoUnmount={true}
@ -133,8 +132,8 @@ export default function Render(
SubPart = <Tabs items={items2} />;
}
return (
<PageHeader showBack={true} title="添加权限">
<>
{SubPart}
</PageHeader>
</>
);
}