This commit is contained in:
Pan Qiancheng 2024-10-12 19:45:37 +08:00
parent 4914a1f3d5
commit 03a80a90cb
5 changed files with 62 additions and 37 deletions

View File

@ -106,7 +106,7 @@
"@types/lodash": "^4.14.179",
"@types/luxon": "^2.3.2",
"@types/mocha": "^8.2.0",
"@types/node": "^20.10.2",
"@types/node": "^20.16.11",
"@types/nprogress": "^0.2.0",
"@types/react": "^18.0.12",
"@types/react-dom": "^18.0.5",
@ -119,8 +119,8 @@
"assert": "^2.0.0",
"babel-jest": "^27.4.2",
"babel-loader": "^8.2.3",
"babel-plugin-named-asset-import": "^0.3.8",
"babel-plugin-module-resolver": "^5.0.0",
"babel-plugin-named-asset-import": "^0.3.8",
"babel-preset-react-app": "^10.0.1",
"bfj": "^7.0.2",
"browserify-zlib": "^0.2.0",
@ -210,4 +210,4 @@
]
},
"copyWebpack": []
}
}

View File

@ -129,6 +129,18 @@ const i18ns: I18n[] = [
"finish": "完成"
}
},
{
id: "abbeafa1d4a3b7aff602280501d45aaf",
namespace: "new-demo-l-menu",
language: "zh-CN",
module: "new-demo",
position: "locales/menu",
data: {
"System": "系统配置",
"userManage": "用户管理",
"relationManage": "关系管理"
}
},
{
id: "0c0bd7390065f2f22f87bd11fb41205b",
namespace: "actionAuth",

View File

@ -1,9 +1,3 @@
import {
String,
Text,
Price
} from 'oak-domain/lib/types/DataType';
import { EntityShape } from 'oak-domain/lib/types/Entity';
import { Schema as System } from 'oak-general-business/lib/entities/System';
import { EntityDesc } from 'oak-domain/lib/types';
@ -12,7 +6,7 @@ export interface Schema extends System {
export type Relation = 'owner' | 'manager';
const entityDesc: EntityDesc<Schema, '', Relation> = {
export const entityDesc: EntityDesc<Schema, '', Relation> = {
locales: {
zh_CN: {
name: '系统',

View File

@ -0,0 +1,5 @@
{
"System": "系统配置",
"userManage": "用户管理",
"relationManage": "关系管理"
}

View File

@ -1,28 +1,42 @@
import React from 'react';
import UserRelationUpsert from 'oak-general-business/es/components/userRelation/upsert';
import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '@project/oak-app-domain';
import Styles from './web.pc.module.less';
import React from "react";
import UserRelationUpsert from "oak-general-business/es/components/userRelation/upsert";
import { WebComponentProps } from "oak-frontend-base";
import { EntityDict } from "@project/oak-app-domain";
import PageHeader from "oak-frontend-base/es/components/pageHeader2";
import Styles from "./web.pc.module.less";
export default function render(props: WebComponentProps<EntityDict, 'userRelation', false, {
entity: keyof EntityDict;
entityId: string;
}>) {
const { entity, entityId, oakFullpath } = props.data;
const { t } = props.methods;
if (oakFullpath) {
if (entity && entityId) {
return (
<UserRelationUpsert
entity={entity}
entityId={entityId}
oakPath={`${oakFullpath}.relations`}
claimUrl="/userEntityGrant/claim"
qrCodeType="wechatPublic"
/>
);
}
return <div className={Styles.container}>{t('tips')}</div>
}
return null;
}
export default function render(
props: WebComponentProps<
EntityDict,
"userRelation",
false,
{
entity: keyof EntityDict;
entityId: string;
}
>
) {
const { entity, entityId, oakFullpath } = props.data;
const { t } = props.methods;
if (oakFullpath) {
if (entity && entityId) {
return (
<PageHeader>
<UserRelationUpsert
entity={entity}
entityId={entityId}
oakPath={`${oakFullpath}.relations`}
claimUrl="/userEntityGrant/claim"
qrCodeType="wechatPublic"
/>
</PageHeader>
);
}
return (
<PageHeader>
<div className={Styles.container}>{t("tips")}</div>
</PageHeader>
);
}
return null;
}