From bfe63596fcfc9662ec547009cb82522604c73197 Mon Sep 17 00:00:00 2001 From: wkj <278599135@qq.com> Date: Fri, 8 Sep 2023 16:18:03 +0800 Subject: [PATCH] =?UTF-8?q?message=20=E5=A2=9E=E5=8A=A0platformId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- es/components/config/style/index.js | 16 ++-- es/data/userRole.js | 4 +- es/entities/Message.d.ts | 2 + es/entities/Message.js | 3 +- es/entities/MessageType.d.ts | 1 + es/entities/MessageType.js | 3 +- es/oak-app-domain/Message/Schema.d.ts | 42 +++++++++- es/oak-app-domain/Message/Storage.js | 4 + es/oak-app-domain/Message/locales/zh_CN.json | 2 +- es/oak-app-domain/MessageType/Schema.d.ts | 6 ++ es/oak-app-domain/MessageType/Storage.js | 6 ++ .../MessageType/locales/zh_CN.json | 2 +- es/oak-app-domain/Platform/Schema.d.ts | 12 +++ es/oak-app-domain/_SubQuery.d.ts | 4 +- es/pages/application/list/index.js | 2 +- es/pages/application/list/web.pc.d.ts | 4 - es/pages/application/list/web.pc.js | 33 +++----- es/pages/domain/list/index.js | 2 +- es/pages/domain/list/web.pc.d.ts | 4 - es/pages/domain/list/web.pc.js | 31 +++---- es/pages/platform/detail/web.js | 2 +- es/pages/platform/list/index.js | 2 +- es/pages/platform/list/web.pc.d.ts | 4 - es/pages/platform/list/web.pc.js | 24 +++--- es/pages/system/detail/web.js | 4 +- es/pages/system/list/index.js | 2 +- es/pages/system/list/web.pc.d.ts | 4 - es/pages/system/list/web.pc.js | 33 +++----- es/pages/user/manage/upsert/index.js | 8 ++ es/pages/user/manage/upsert/web.js | 2 +- es/pages/user/manage/upsert/web.pc.js | 2 +- es/triggers/message.js | 9 +- es/triggers/user.js | 44 ++++------ es/types/projection.js | 2 + lib/components/config/style/index.js | 12 ++- lib/data/userRole.js | 4 +- lib/entities/Message.d.ts | 2 + lib/entities/Message.js | 3 +- lib/entities/MessageType.d.ts | 1 + lib/entities/MessageType.js | 3 +- lib/oak-app-domain/Message/Schema.d.ts | 42 +++++++++- lib/oak-app-domain/Message/Storage.js | 4 + lib/oak-app-domain/Message/locales/zh_CN.json | 2 +- lib/oak-app-domain/MessageType/Schema.d.ts | 6 ++ lib/oak-app-domain/MessageType/Storage.js | 6 ++ .../MessageType/locales/zh_CN.json | 2 +- lib/oak-app-domain/Platform/Schema.d.ts | 12 +++ lib/oak-app-domain/_SubQuery.d.ts | 4 +- lib/pages/application/list/index.js | 2 +- lib/pages/application/list/web.pc.d.ts | 4 - lib/pages/application/list/web.pc.js | 37 ++++----- lib/pages/domain/list/index.js | 2 +- lib/pages/domain/list/web.pc.d.ts | 4 - lib/pages/domain/list/web.pc.js | 34 +++----- lib/pages/platform/detail/web.js | 2 +- lib/pages/platform/list/index.js | 2 +- lib/pages/platform/list/web.pc.d.ts | 4 - lib/pages/platform/list/web.pc.js | 26 +++--- lib/pages/system/detail/web.js | 4 +- lib/pages/system/list/index.js | 2 +- lib/pages/system/list/web.pc.d.ts | 4 - lib/pages/system/list/web.pc.js | 37 ++++----- lib/pages/user/manage/upsert/index.js | 12 ++- lib/pages/user/manage/upsert/web.js | 2 +- lib/pages/user/manage/upsert/web.pc.js | 2 +- lib/triggers/message.js | 11 +-- lib/triggers/user.js | 82 +++++++++---------- lib/types/projection.js | 2 + src/components/config/style/index.tsx | 34 +++++--- src/data/userRole.ts | 4 +- src/entities/Message.ts | 18 ++-- src/entities/MessageType.ts | 4 +- src/oak-app-domain/Message/Schema.ts | 42 +++++++++- src/oak-app-domain/Message/Storage.ts | 4 + src/oak-app-domain/Message/locales/zh_CN.json | 2 +- src/oak-app-domain/Platform/Schema.ts | 12 +++ src/oak-app-domain/_SubQuery.ts | 4 +- src/pages/application/detail/web.tsx | 2 +- src/pages/application/list/index.ts | 2 +- src/pages/application/list/web.pc.tsx | 81 +++++++++--------- src/pages/domain/list/index.ts | 2 +- src/pages/domain/list/web.pc.tsx | 72 +++++++--------- src/pages/platform/detail/web.tsx | 1 - src/pages/platform/list/index.ts | 2 +- src/pages/platform/list/web.pc.tsx | 57 +++++++------ src/pages/system/detail/web.tsx | 2 - src/pages/system/list/index.ts | 2 +- src/pages/system/list/web.pc.tsx | 77 ++++++++--------- src/pages/user/manage/upsert/index.ts | 8 ++ src/pages/user/manage/upsert/web.pc.tsx | 2 +- src/pages/user/manage/upsert/web.tsx | 5 +- src/triggers/message.ts | 10 +-- src/triggers/user.ts | 46 ++++------- src/types/projection.ts | 4 +- 94 files changed, 658 insertions(+), 544 deletions(-) diff --git a/es/components/config/style/index.js b/es/components/config/style/index.js index c2c1af53a..444f4943f 100644 --- a/es/components/config/style/index.js +++ b/es/components/config/style/index.js @@ -1,5 +1,6 @@ -import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime"; -import { Form, Input, Tabs } from 'antd'; +import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; +import { Space, Form, Input, Button, Tabs, ColorPicker } from 'antd'; +import { ClearOutlined } from '@ant-design/icons'; import { set, get } from 'oak-domain/lib/utils/lodash'; const Colors = ['primary', 'success', 'error', 'warning', 'info']; function Color(props) { @@ -7,10 +8,13 @@ function Color(props) { ; return (_jsx(Form, { children: Colors.map((ele) => (_jsx(Form.Item, { label: ele, // required - // name="folder" - tooltip: `设置系统【${ele}】颜色`, children: _jsx(_Fragment, { children: _jsx(Input, { onChange: (e) => { - setValue(ele, e.target.value); - }, value: get(value, ele) }) }) }, ele))) })); + tooltip: `设置系统【${ele}】颜色`, children: _jsxs(Space.Compact, { block: true, children: [_jsx(ColorPicker, { onChangeComplete: (color) => { + setValue(ele, color.toHexString()); + }, children: _jsx(Input, { value: get(value, ele), readOnly: true, onChange: (e) => { + setValue(ele, e.target.value); + } }) }), _jsx(Button, { icon: _jsx(ClearOutlined, {}), onClick: (e) => { + setValue(ele, ''); + } })] }) }, ele))) })); } export default function Render(props) { const { value: styleValue, onChange } = props; diff --git a/es/data/userRole.js b/es/data/userRole.js index e5846d25f..22b627bf3 100644 --- a/es/data/userRole.js +++ b/es/data/userRole.js @@ -6,7 +6,9 @@ export const users = [ name: 'root', isRoot: true, id: ROOT_USER_ID, - } + userState: 'shadow', + idState: 'unverified', + }, ]; export const mobiles = [ { diff --git a/es/entities/Message.d.ts b/es/entities/Message.d.ts index 0a2a4dff1..76fcae173 100644 --- a/es/entities/Message.d.ts +++ b/es/entities/Message.d.ts @@ -2,6 +2,7 @@ import { String, Text } from 'oak-domain/lib/types/DataType'; import { Schema as User } from './User'; import { EntityShape } from 'oak-domain/lib/types/Entity'; import { Channel, Weight } from '../types/Message'; +import { Schema as Platform } from './Platform'; declare type Router = { pathname: string; props?: Record; @@ -23,5 +24,6 @@ export interface Schema extends EntityShape { content: Text; data?: Object; router?: Router; + platform?: Platform; } export {}; diff --git a/es/entities/Message.js b/es/entities/Message.js index 6e98d0c4d..909dbeb30 100644 --- a/es/entities/Message.js +++ b/es/entities/Message.js @@ -28,6 +28,7 @@ const entityDesc = { visitState: '访问状态', router: '目标路由', data: '透传数据', + platform: '平台', }, action: { succeed: '成功', @@ -51,6 +52,6 @@ const entityDesc = { }, }, }, - } + }, }; export {}; diff --git a/es/entities/MessageType.d.ts b/es/entities/MessageType.d.ts index 0b5b6863e..abf747d1c 100644 --- a/es/entities/MessageType.d.ts +++ b/es/entities/MessageType.d.ts @@ -2,4 +2,5 @@ import { String } from 'oak-domain/lib/types/DataType'; import { EntityShape } from 'oak-domain/lib/types/Entity'; export interface Schema extends EntityShape { type: String<64>; + display?: String<64>; } diff --git a/es/entities/MessageType.js b/es/entities/MessageType.js index ebcd51a80..3011eee66 100644 --- a/es/entities/MessageType.js +++ b/es/entities/MessageType.js @@ -5,8 +5,9 @@ const entityDesc = { name: '消息类型', attr: { type: '类型', + display: '显示值', }, }, - } + }, }; export {}; diff --git a/es/oak-app-domain/Message/Schema.d.ts b/es/oak-app-domain/Message/Schema.d.ts index 9b67b662b..5775ce2f6 100644 --- a/es/oak-app-domain/Message/Schema.d.ts +++ b/es/oak-app-domain/Message/Schema.d.ts @@ -7,6 +7,7 @@ import { String, Text } from "oak-domain/lib/types/DataType"; import { EntityShape } from "oak-domain/lib/types/Entity"; import { Channel, Weight } from "../../types/Message"; import * as User from "../User/Schema"; +import * as Platform from "../Platform/Schema"; import * as MessageSystem from "../MessageSystem/Schema"; declare type Router = { pathname: string; @@ -29,6 +30,7 @@ export declare type OpSchema = EntityShape & { content: Text; data?: Object | null; router?: Router | null; + platformId?: ForeignKey<"platform"> | null; iState?: IState | null; visitState?: VisitState | null; }; @@ -44,9 +46,11 @@ export declare type Schema = EntityShape & { content: Text; data?: Object | null; router?: Router | null; + platformId?: ForeignKey<"platform"> | null; iState?: IState | null; visitState?: VisitState | null; user: User.Schema; + platform?: Platform.Schema | null; messageSystem$message?: Array; messageSystem$message$$aggr?: AggregationResult; } & { @@ -68,6 +72,8 @@ declare type AttrFilter = { content: Q_StringValue; data: Object; router: JsonFilter; + platformId: Q_StringValue; + platform: Platform.Filter; iState: Q_EnumValue; visitState: Q_EnumValue; messageSystem$message: MessageSystem.Filter & SubQueryPredicateMetadata; @@ -91,6 +97,8 @@ export declare type Projection = { content?: number; data?: number | Object; router?: number | JsonProjection; + platformId?: number; + platform?: Platform.Projection; iState?: number; visitState?: number; messageSystem$message?: MessageSystem.Selection & { @@ -106,6 +114,9 @@ declare type MessageIdProjection = OneOf<{ declare type UserIdProjection = OneOf<{ userId: number; }>; +declare type PlatformIdProjection = OneOf<{ + platformId: number; +}>; export declare type SortAttr = { id: number; } | { @@ -134,6 +145,10 @@ export declare type SortAttr = { content: number; } | { router: number; +} | { + platformId: number; +} | { + platform: Platform.SortAttr; } | { iState: number; } | { @@ -149,7 +164,7 @@ export declare type Sorter = SortNode[]; export declare type SelectOperation

= OakSelection<"select", P, Filter, Sorter>; export declare type Selection

= SelectOperation

; export declare type Aggregation = DeduceAggregation; -export declare type CreateOperationData = FormCreateData> & (({ +export declare type CreateOperationData = FormCreateData> & (({ userId?: never; user: User.CreateSingleOperation; } | { @@ -157,6 +172,14 @@ export declare type CreateOperationData = FormCreateData; +}) & ({ + platformId?: never; + platform?: Platform.CreateSingleOperation; +} | { + platformId: ForeignKey<"platform">; + platform?: Platform.UpdateOperation; +} | { + platformId?: ForeignKey<"platform">; })) & ({ entity?: string; entityId?: string; @@ -167,7 +190,7 @@ export declare type CreateOperationData = FormCreateData; export declare type CreateMultipleOperation = OakOperation<"create", Array>; export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation; -export declare type UpdateOperationData = FormUpdateData> & (({ +export declare type UpdateOperationData = FormUpdateData> & (({ user: User.CreateSingleOperation; userId?: never; } | { @@ -179,6 +202,18 @@ export declare type UpdateOperationData = FormUpdateData | null; +}) & ({ + platform: Platform.CreateSingleOperation; + platformId?: never; +} | { + platform: Platform.UpdateOperation; + platformId?: never; +} | { + platform: Platform.RemoveOperation; + platformId?: never; +} | { + platform?: never; + platformId?: ForeignKey<"platform"> | null; })) & { [k: string]: any; messageSystem$message?: OakOperation, Omit> | OakOperation, Omit> | OakOperation<"create", Omit[]> | Array> | OakOperation, Omit> | OakOperation, Omit>>; @@ -186,10 +221,13 @@ export declare type UpdateOperationData = FormUpdateData; export declare type RemoveOperationData = {} & (({ user?: User.UpdateOperation | User.RemoveOperation; +}) & ({ + platform?: Platform.UpdateOperation | Platform.RemoveOperation; })); export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>; export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation; export declare type UserIdSubQuery = Selection; +export declare type PlatformIdSubQuery = Selection; export declare type MessageIdSubQuery = Selection; export declare type EntityDef = { Schema: Schema; diff --git a/es/oak-app-domain/Message/Storage.js b/es/oak-app-domain/Message/Storage.js index c397d2916..1ea1e6152 100644 --- a/es/oak-app-domain/Message/Storage.js +++ b/es/oak-app-domain/Message/Storage.js @@ -52,6 +52,10 @@ export const desc = { router: { type: "object" }, + platformId: { + type: "ref", + ref: "platform" + }, iState: { type: "enum", enumeration: ["sending", "success", "failure"] diff --git a/es/oak-app-domain/Message/locales/zh_CN.json b/es/oak-app-domain/Message/locales/zh_CN.json index 48c11855d..5e8475bc6 100644 --- a/es/oak-app-domain/Message/locales/zh_CN.json +++ b/es/oak-app-domain/Message/locales/zh_CN.json @@ -1 +1 @@ -{ "name": "消息", "attr": { "entity": "关联对象", "entityId": "关联对象ID", "restriction": "限制", "title": "标题", "content": "内容", "user": "关联用户", "type": "消息类型", "weight": "优先级", "iState": "发送状态", "visitState": "访问状态", "router": "目标路由", "data": "透传数据" }, "action": { "succeed": "成功", "fail": "失败", "visit": "阅读" }, "v": { "iState": { "sending": "发送中", "success": "发送成功", "failure": "发送失败" }, "visitState": { "unvisited": "未读", "visited": "已读" }, "weight": { "high": "高", "medium": "中", "low": "低" } } } +{ "name": "消息", "attr": { "entity": "关联对象", "entityId": "关联对象ID", "restriction": "限制", "title": "标题", "content": "内容", "user": "关联用户", "type": "消息类型", "weight": "优先级", "iState": "发送状态", "visitState": "访问状态", "router": "目标路由", "data": "透传数据", "platform": "平台" }, "action": { "succeed": "成功", "fail": "失败", "visit": "阅读" }, "v": { "iState": { "sending": "发送中", "success": "发送成功", "failure": "发送失败" }, "visitState": { "unvisited": "未读", "visited": "已读" }, "weight": { "high": "高", "medium": "中", "low": "低" } } } diff --git a/es/oak-app-domain/MessageType/Schema.d.ts b/es/oak-app-domain/MessageType/Schema.d.ts index a0213fc28..5952064e6 100644 --- a/es/oak-app-domain/MessageType/Schema.d.ts +++ b/es/oak-app-domain/MessageType/Schema.d.ts @@ -6,10 +6,12 @@ import { String } from "oak-domain/lib/types/DataType"; import { EntityShape } from "oak-domain/lib/types/Entity"; export declare type OpSchema = EntityShape & { type: String<64>; + display?: String<64> | null; }; export declare type OpAttr = keyof OpSchema; export declare type Schema = EntityShape & { type: String<64>; + display?: String<64> | null; } & { [A in ExpressionKey]?: any; }; @@ -19,6 +21,7 @@ declare type AttrFilter = { $$seq$$: Q_StringValue; $$updateAt$$: Q_DateValue; type: Q_StringValue; + display: Q_StringValue; }; export declare type Filter = MakeFilter>; export declare type Projection = { @@ -29,6 +32,7 @@ export declare type Projection = { $$updateAt$$?: number; $$seq$$?: number; type?: number; + display?: number; } & Partial>; declare type MessageTypeIdProjection = OneOf<{ id: number; @@ -43,6 +47,8 @@ export declare type SortAttr = { $$updateAt$$: number; } | { type: number; +} | { + display: number; } | { [k: string]: any; } | OneOf>; diff --git a/es/oak-app-domain/MessageType/Storage.js b/es/oak-app-domain/MessageType/Storage.js index 1d43cc64c..0285644ff 100644 --- a/es/oak-app-domain/MessageType/Storage.js +++ b/es/oak-app-domain/MessageType/Storage.js @@ -7,6 +7,12 @@ export const desc = { params: { length: 64 } + }, + display: { + type: "varchar", + params: { + length: 64 + } } }, actionType: "crud", diff --git a/es/oak-app-domain/MessageType/locales/zh_CN.json b/es/oak-app-domain/MessageType/locales/zh_CN.json index d8d1b8576..0a89f68aa 100644 --- a/es/oak-app-domain/MessageType/locales/zh_CN.json +++ b/es/oak-app-domain/MessageType/locales/zh_CN.json @@ -1 +1 @@ -{ "name": "消息类型", "attr": { "type": "类型" } } +{ "name": "消息类型", "attr": { "type": "类型", "display": "显示值" } } diff --git a/es/oak-app-domain/Platform/Schema.d.ts b/es/oak-app-domain/Platform/Schema.d.ts index 9c7eccf6e..596a126b3 100644 --- a/es/oak-app-domain/Platform/Schema.d.ts +++ b/es/oak-app-domain/Platform/Schema.d.ts @@ -7,6 +7,7 @@ import { String, Text } from "oak-domain/lib/types/DataType"; import { EntityShape } from "oak-domain/lib/types/Entity"; import { Config } from "../../types/Config"; import { Style } from "../../types/Style"; +import * as Message from "../Message/Schema"; import * as System from "../System/Schema"; export declare type OpSchema = EntityShape & { name: String<32>; @@ -24,6 +25,8 @@ export declare type Schema = EntityShape & { style?: Style | null; entity?: String<32> | null; entityId?: String<64> | null; + message$platform?: Array; + message$platform$$aggr?: AggregationResult; system$platform?: Array; system$platform$$aggr?: AggregationResult; } & { @@ -40,6 +43,7 @@ declare type AttrFilter = { style: JsonFilter