>;
+export declare type SortNode = {
+ $attr: SortAttr;
+ $direction?: "asc" | "desc";
+};
+export declare type Sorter = SortNode[];
+export declare type SelectOperation = Omit, "id">;
+export declare type Selection = Omit, "action">;
+export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>;
+export declare type CreateOperationData = FormCreateData> & ({
+ entity?: string;
+ entityId?: string;
+ [K: string]: any;
+});
+export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
+export declare type CreateMultipleOperation = OakOperation<"create", Array>;
+export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
+export declare type UpdateOperationData = FormUpdateData & {
+ [k: string]: any;
+};
+export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
+export declare type RemoveOperationData = {};
+export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
+export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation;
+export declare type SubscriptionIdSubQuery = Selection;
+export declare type NativeAttr = OpAttr;
+export declare type FullAttr = NativeAttr;
+export declare type EntityDef = {
+ Schema: Schema;
+ OpSchema: OpSchema;
+ Action: OakMakeAction | string;
+ Selection: Selection;
+ Operation: Operation;
+ Create: CreateOperation;
+ Update: UpdateOperation;
+ Remove: RemoveOperation;
+ CreateSingle: CreateSingleOperation;
+ CreateMulti: CreateMultipleOperation;
+};
+export {};
diff --git a/lib/general-app-domain/Subscription/Schema.js b/lib/general-app-domain/Subscription/Schema.js
new file mode 100644
index 000000000..c8ad2e549
--- /dev/null
+++ b/lib/general-app-domain/Subscription/Schema.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/lib/general-app-domain/Subscription/Storage.d.ts b/lib/general-app-domain/Subscription/Storage.d.ts
new file mode 100644
index 000000000..a3f0fbbb0
--- /dev/null
+++ b/lib/general-app-domain/Subscription/Storage.d.ts
@@ -0,0 +1,3 @@
+import { StorageDesc } from "oak-domain/lib/types/Storage";
+import { OpSchema } from "./Schema";
+export declare const desc: StorageDesc;
diff --git a/lib/general-app-domain/Subscription/Storage.js b/lib/general-app-domain/Subscription/Storage.js
new file mode 100644
index 000000000..233cb5c00
--- /dev/null
+++ b/lib/general-app-domain/Subscription/Storage.js
@@ -0,0 +1,56 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.desc = void 0;
+var action_1 = require("oak-domain/lib/actions/action");
+exports.desc = {
+ attributes: {
+ entity: {
+ type: "varchar",
+ params: {
+ length: 32
+ }
+ },
+ entityId: {
+ type: "varchar",
+ params: {
+ length: 64
+ }
+ },
+ name: {
+ type: "varchar",
+ params: {
+ length: 32
+ }
+ },
+ description: {
+ type: "text"
+ },
+ config: {
+ type: "object"
+ }
+ },
+ actionType: "crud",
+ actions: action_1.genericActions,
+ indexes: [
+ //索引
+ {
+ name: 'index_name',
+ attributes: [
+ {
+ name: 'name'
+ },
+ ]
+ },
+ {
+ name: 'index_entity',
+ attributes: [
+ {
+ name: 'entity'
+ },
+ {
+ name: 'entityId'
+ }
+ ]
+ }
+ ]
+};
diff --git a/lib/general-app-domain/Subscription/locales/zh_CN.json b/lib/general-app-domain/Subscription/locales/zh_CN.json
new file mode 100644
index 000000000..c19190e92
--- /dev/null
+++ b/lib/general-app-domain/Subscription/locales/zh_CN.json
@@ -0,0 +1 @@
+{ "attr": { "name": "名称", "entity": "对象名称", "entityId": "对象Id", "description": "描述", "config": "配置" } }
diff --git a/lib/general-app-domain/_SubQuery.d.ts b/lib/general-app-domain/_SubQuery.d.ts
index aec8dd2ff..4a9298815 100644
--- a/lib/general-app-domain/_SubQuery.d.ts
+++ b/lib/general-app-domain/_SubQuery.d.ts
@@ -18,6 +18,7 @@ import * as Mobile from "./Mobile/Schema";
import * as Platform from "./Platform/Schema";
import * as UserRole from "./UserRole/Schema";
import * as Role from "./Role/Schema";
+import * as Subscription from "./Subscription/Schema";
import * as System from "./System/Schema";
import * as Token from "./Token/Schema";
import * as UserEntityGrant from "./UserEntityGrant/Schema";
@@ -164,6 +165,11 @@ export declare type RoleIdSubQuery = {
entity: "role";
}) | any;
};
+export declare type SubscriptionIdSubQuery = {
+ [K in "$in" | "$nin"]?: (Subscription.SubscriptionIdSubQuery & {
+ entity: "subscription";
+ }) | any;
+};
export declare type SystemIdSubQuery = {
[K in "$in" | "$nin"]?: (Application.SystemIdSubQuery & {
entity: "application";
diff --git a/lib/triggers/message.d.ts b/lib/triggers/message.d.ts
index 15e9b007e..d79650ded 100644
--- a/lib/triggers/message.d.ts
+++ b/lib/triggers/message.d.ts
@@ -1,10 +1,13 @@
import { Trigger } from 'oak-domain/lib/types/Trigger';
import { EntityDict } from '../general-app-domain/EntityDict';
+import { CreateOperationData as CreateMessageData } from '../general-app-domain/Message/Schema';
import { RuntimeCxt } from '../types/RuntimeCxt';
+import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
import { MessagePropsToSms, MessagePropsToWechat } from '../types/Message';
export declare function registerMessagePropsConverter(converter: {
sms?: MessagePropsToSms;
wechat?: MessagePropsToWechat;
}): void;
+export declare function addMessageSent(message: CreateMessageData, context: BackendRuntimeContext): Promise<0 | 1>;
declare const triggers: Trigger[];
export default triggers;
diff --git a/lib/triggers/message.js b/lib/triggers/message.js
index 77f978cdd..e4280097f 100644
--- a/lib/triggers/message.js
+++ b/lib/triggers/message.js
@@ -1,7 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.registerMessagePropsConverter = void 0;
+exports.addMessageSent = exports.registerMessagePropsConverter = void 0;
var tslib_1 = require("tslib");
+var uuid_1 = require("oak-domain/lib/utils/uuid");
var assert_1 = require("oak-domain/lib/utils/assert");
var SmsCoverter;
var WechatConverter;
@@ -13,37 +14,67 @@ function registerMessagePropsConverter(converter) {
exports.registerMessagePropsConverter = registerMessagePropsConverter;
function tryAddMessageSent(message, channel, context) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
- return tslib_1.__generator(this, function (_a) {
- // const { systemId, type } = message;
- // const disperse = MessageDisperse && MessageDisperse[systemId] && MessageDisperse[systemId][type] && MessageDisperse[systemId][type][channel];
- // if (!disperse) {
- // return 0;
- // }
- // // 有配置也未必一定能发,比如说用户没有注册手机号,则无法发gsm
- // const data = disperse(message);
- // if (!data) {
- // return 0;
- // }
- // const messageSent = {
- // messageId: message.id,
- // iState: 'sending',
- // channel,
- // };
- // await context.operate('messageSent', {
- // id: await generateNewIdAsync(),
- // action: 'create',
- // data: {
- // id: await generateNewId(),
- // ...messageSent,
- // } as EntityDict['messageSent']['OpSchema'],
- // }, {});
- return [2 /*return*/, 1];
+ var systemId, props, type, _a, application, config2, appId, dispersedData, _b, _c, _d;
+ var _e;
+ return tslib_1.__generator(this, function (_f) {
+ switch (_f.label) {
+ case 0:
+ if (!WechatConverter) {
+ return [2 /*return*/, 0];
+ }
+ systemId = message.systemId, props = message.props, type = message.type;
+ return [4 /*yield*/, context.select('application', {
+ data: {
+ id: 1,
+ name: 1,
+ config: 1,
+ type: 1,
+ systemId: 1,
+ style: 1,
+ },
+ filter: {
+ type: 'wechatPublic',
+ systemId: systemId,
+ },
+ }, {})];
+ case 1:
+ _a = tslib_1.__read.apply(void 0, [_f.sent(), 1]), application = _a[0];
+ config2 = application.config;
+ appId = config2.appId;
+ switch (channel) {
+ case 'weChat': {
+ dispersedData = WechatConverter(type, props, appId);
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ if (!dispersedData) {
+ return [2 /*return*/, 0];
+ }
+ _c = (_b = context).operate;
+ _d = ['messageSent'];
+ _e = {};
+ return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()];
+ case 2: return [4 /*yield*/, _c.apply(_b, _d.concat([(_e.id = _f.sent(),
+ _e.action = 'create',
+ _e.data = {
+ messageId: message.id,
+ data: dispersedData,
+ channel: channel,
+ },
+ _e), {}]))];
+ case 3:
+ _f.sent();
+ return [2 /*return*/, 1];
+ }
});
});
}
function addMessageSent(message, context) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
- var weight, _a, result, count, result, count2, result, result;
+ var weight, _a, result, count, result, count2, result;
return tslib_1.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -52,16 +83,12 @@ function addMessageSent(message, context) {
switch (_a) {
case 'high': return [3 /*break*/, 1];
case 'medium': return [3 /*break*/, 3];
- case 'low': return [3 /*break*/, 10];
- case 'data': return [3 /*break*/, 12];
+ case 'low': return [3 /*break*/, 9];
}
- return [3 /*break*/, 14];
+ return [3 /*break*/, 11];
case 1: return [4 /*yield*/, Promise.all([
- tryAddMessageSent(message, 'public', context),
- tryAddMessageSent(message, 'jPush', context),
- tryAddMessageSent(message, 'jim', context),
- tryAddMessageSent(message, 'mp', context),
- tryAddMessageSent(message, 'gsm', context),
+ tryAddMessageSent(message, 'wechat', context),
+ tryAddMessageSent(message, 'sms', context),
])];
case 2:
result = _b.sent();
@@ -69,52 +96,41 @@ function addMessageSent(message, context) {
case 3: return [4 /*yield*/, context.count('messageSent', {
filter: {
messageId: message.id,
- }
+ },
}, {})];
case 4:
count = _b.sent();
- if (!(count < 1)) return [3 /*break*/, 8];
+ if (!(count < 1)) return [3 /*break*/, 7];
return [4 /*yield*/, Promise.all([
- tryAddMessageSent(message, 'public', context),
- tryAddMessageSent(message, 'jPush', context),
- tryAddMessageSent(message, 'jim', context),
- tryAddMessageSent(message, 'mp', context),
+ tryAddMessageSent(message, 'wechat', context),
])];
case 5:
result = _b.sent();
count2 = result.reduce(function (a, b) { return a || b; });
- if (!(count2 === 0)) return [3 /*break*/, 7];
- return [4 /*yield*/, tryAddMessageSent(message, 'gsm', context)];
+ if (count2 > 0) {
+ return [2 /*return*/, count2];
+ }
+ return [4 /*yield*/, tryAddMessageSent(message, 'sms', context)];
case 6: return [2 /*return*/, _b.sent()];
- case 7: return [2 /*return*/, count2];
- case 8: return [4 /*yield*/, tryAddMessageSent(message, 'gsm', context)];
- case 9: return [2 /*return*/, _b.sent()];
- case 10: return [4 /*yield*/, Promise.all([
- tryAddMessageSent(message, 'public', context),
- tryAddMessageSent(message, 'jPush', context),
- tryAddMessageSent(message, 'jim', context),
- tryAddMessageSent(message, 'mp', context),
+ case 7: return [4 /*yield*/, tryAddMessageSent(message, 'sms', context)];
+ case 8: return [2 /*return*/, _b.sent()];
+ case 9: return [4 /*yield*/, Promise.all([
+ tryAddMessageSent(message, 'wechat', context),
])];
+ case 10:
+ result = _b.sent();
+ return [2 /*return*/, result.reduce(function (a, b) { return a || b; })];
case 11:
- result = _b.sent();
- return [2 /*return*/, result.reduce(function (a, b) { return a || b; })];
- case 12: return [4 /*yield*/, Promise.all([
- tryAddMessageSent(message, 'jPush', context),
- tryAddMessageSent(message, 'jim', context),
- ])];
- case 13:
- result = _b.sent();
- return [2 /*return*/, result.reduce(function (a, b) { return a || b; })];
- case 14:
{
(0, assert_1.assert)(false);
}
- _b.label = 15;
- case 15: return [2 /*return*/];
+ _b.label = 12;
+ case 12: return [2 /*return*/];
}
});
});
}
+exports.addMessageSent = addMessageSent;
var triggers = [
{
name: '当创建message时,创建相应的messageSent',
@@ -130,11 +146,17 @@ var triggers = [
case 0:
data = operation.data, filter = operation.filter;
fn = function (messageData) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
+ var result;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, addMessageSent(messageData, context)];
case 1:
- _a.sent();
+ result = _a.sent();
+ if (result === 0) {
+ Object.assign(messageData, {
+ iState: 'fail',
+ });
+ }
return [2 /*return*/];
}
});
diff --git a/lib/triggers/messageSent.d.ts b/lib/triggers/messageSent.d.ts
new file mode 100644
index 000000000..c48e3a374
--- /dev/null
+++ b/lib/triggers/messageSent.d.ts
@@ -0,0 +1,5 @@
+import { Trigger } from 'oak-domain/lib/types/Trigger';
+import { EntityDict } from '../general-app-domain/EntityDict';
+import { RuntimeCxt } from '../types/RuntimeCxt';
+declare const triggers: Trigger[];
+export default triggers;
diff --git a/lib/triggers/messageSent.js b/lib/triggers/messageSent.js
new file mode 100644
index 000000000..412fd24e7
--- /dev/null
+++ b/lib/triggers/messageSent.js
@@ -0,0 +1,85 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tslib_1 = require("tslib");
+var assert_1 = require("oak-domain/lib/utils/assert");
+function sendMessage(messageSentData, context) {
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
+ var data, channel, messageId, _a, message, _b, application, config2, appId;
+ return tslib_1.__generator(this, function (_c) {
+ switch (_c.label) {
+ case 0:
+ data = messageSentData.data, channel = messageSentData.channel, messageId = messageSentData.messageId;
+ return [4 /*yield*/, context.select('message', {
+ data: {
+ id: 1,
+ systemId: 1,
+ },
+ filter: {
+ id: messageId,
+ },
+ }, {})];
+ case 1:
+ _a = tslib_1.__read.apply(void 0, [_c.sent(), 1]), message = _a[0];
+ return [4 /*yield*/, context.select('application', {
+ data: {
+ id: 1,
+ name: 1,
+ config: 1,
+ type: 1,
+ systemId: 1,
+ style: 1,
+ },
+ filter: {
+ type: 'wechatPublic',
+ systemId: message.systemId,
+ },
+ }, {})];
+ case 2:
+ _b = tslib_1.__read.apply(void 0, [_c.sent(), 1]), application = _b[0];
+ config2 = application.config;
+ appId = config2.appId;
+ return [2 /*return*/];
+ }
+ });
+ });
+}
+var triggers = [
+ {
+ name: '当创建messageSent后,业务提交后再进行推送',
+ entity: 'messageSent',
+ action: 'create',
+ when: 'commit',
+ strict: 'makeSure',
+ fn: function (_a, context, params) {
+ var operation = _a.operation;
+ return tslib_1.__awaiter(void 0, void 0, void 0, function () {
+ var data, filter, fn;
+ return tslib_1.__generator(this, function (_b) {
+ switch (_b.label) {
+ case 0:
+ data = operation.data, filter = operation.filter;
+ fn = function (messageSentData) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
+ return tslib_1.__generator(this, function (_a) {
+ switch (_a.label) {
+ case 0: return [4 /*yield*/, sendMessage(messageSentData, context)];
+ case 1:
+ _a.sent();
+ return [2 /*return*/];
+ }
+ });
+ }); };
+ if (!(data instanceof Array)) return [3 /*break*/, 1];
+ (0, assert_1.assert)('不存在一对多的情况');
+ return [3 /*break*/, 3];
+ case 1: return [4 /*yield*/, fn(data)];
+ case 2:
+ _b.sent();
+ _b.label = 3;
+ case 3: return [2 /*return*/, 0];
+ }
+ });
+ });
+ }
+ },
+];
+exports.default = triggers;
diff --git a/src/triggers/message.ts b/src/triggers/message.ts
index d8ff75061..aafe67610 100644
--- a/src/triggers/message.ts
+++ b/src/triggers/message.ts
@@ -69,7 +69,7 @@ async function tryAddMessageSent(message: CreateMessageData, channel: string, co
data: dispersedData,
channel,
},
- }, {});
+ } as EntityDict['messageSent']['CreateSingle'], {});
return 1;
}
From c4557e65ffd65ba9653d259ff0381f7d0e06a600 Mon Sep 17 00:00:00 2001
From: wenjiarui
Date: Wed, 21 Dec 2022 13:17:10 +0800
Subject: [PATCH 4/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=AC=E4=BC=97?=
=?UTF-8?q?=E5=8F=B7=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/entities/Subscription.ts | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/entities/Subscription.ts b/src/entities/Subscription.ts
index 8df557da4..caa662c07 100644
--- a/src/entities/Subscription.ts
+++ b/src/entities/Subscription.ts
@@ -2,6 +2,7 @@ import {
String,
Boolean,
Text,
+ Int,
} from 'oak-domain/lib/types/DataType';
import { ActionDef } from 'oak-domain/lib/types/Action';
import { EntityShape } from 'oak-domain/lib/types/Entity';
@@ -20,6 +21,7 @@ export interface Schema extends EntityShape {
name: String<32>;
description: Text;
config: WechatPublicConfig;
+ offset: Int<4>;
};
@@ -60,6 +62,7 @@ const locale: LocaleDef<
entityId: '对象Id',
description: '描述',
config: '配置',
+ offset: '已同步素材位置',
},
},
};
From 0ce7322c32bb7f101756b4bc6f9a3cd82f9128d4 Mon Sep 17 00:00:00 2001
From: wkj <278599135@qq.com>
Date: Wed, 21 Dec 2022 13:20:06 +0800
Subject: [PATCH 5/8] =?UTF-8?q?build=20=E5=8F=8A=20style=E9=85=8D=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/aspects/AspectDict.d.ts | 5 ++
lib/aspects/config.d.ts | 5 ++
lib/aspects/config.js | 27 +++++-
lib/aspects/index.d.ts | 3 +-
lib/aspects/index.js | 3 +-
lib/components/config/application/index.js | 2 +-
lib/components/config/style/index.d.ts | 7 ++
lib/components/config/style/index.js | 42 ++++++++++
lib/components/config/style/index.module.less | 5 ++
lib/components/message/index.xml | 2 +-
lib/entities/Subscription.d.ts | 3 +-
lib/entities/Subscription.js | 1 +
lib/features/config.d.ts | 1 +
lib/features/config.js | 19 ++++-
lib/miniprogram_npm/lin-ui/album/index.less | 48 -----------
lib/pages/application/detail/web.js | 2 +-
lib/pages/application/upsert/index.js | 5 +-
lib/pages/application/upsert/web.pc.d.ts | 1 +
lib/pages/application/upsert/web.pc.js | 9 +-
lib/pages/domain/detail/index.js | 4 +
lib/pages/domain/detail/web.d.ts | 1 +
lib/pages/domain/detail/web.js | 5 +-
lib/pages/domain/list/web.pc.js | 5 ++
lib/pages/platform/detail/index.js | 1 +
lib/pages/platform/detail/web.js | 2 +-
lib/pages/platform/upsert/index.js | 3 +-
lib/pages/platform/upsert/web.pc.d.ts | 1 +
lib/pages/platform/upsert/web.pc.js | 9 +-
lib/pages/system/detail/web.js | 2 +-
lib/pages/system/list/web.pc.js | 2 +-
lib/pages/system/upsert/web.pc.js | 19 ++---
lib/types/Style.d.ts | 7 +-
package.json | 3 +-
src/aspects/AspectDict.ts | 8 ++
src/aspects/config.ts | 29 +++++++
src/aspects/index.ts | 8 +-
src/components/config/application/index.ts | 2 +-
src/components/config/style/index.module.less | 5 ++
src/components/config/style/index.tsx | 84 +++++++++++++++++++
src/features/config.ts | 23 ++++-
src/pages/application/detail/web.tsx | 6 +-
src/pages/application/upsert/index.ts | 5 +-
src/pages/application/upsert/web.pc.tsx | 16 ++++
src/pages/domain/detail/index.ts | 4 +
src/pages/domain/detail/web.tsx | 45 +++++++++-
src/pages/domain/list/web.pc.tsx | 11 +++
src/pages/platform/detail/index.ts | 1 +
src/pages/platform/detail/web.tsx | 28 +++++--
src/pages/platform/upsert/index.ts | 3 +-
src/pages/platform/upsert/web.pc.tsx | 22 ++++-
src/pages/system/detail/web.tsx | 6 +-
src/pages/system/list/web.pc.tsx | 2 +-
src/pages/system/upsert/web.pc.tsx | 35 ++------
src/types/Style.ts | 13 +--
54 files changed, 461 insertions(+), 149 deletions(-)
create mode 100644 lib/components/config/style/index.d.ts
create mode 100644 lib/components/config/style/index.js
create mode 100644 lib/components/config/style/index.module.less
create mode 100644 src/components/config/style/index.module.less
create mode 100644 src/components/config/style/index.tsx
diff --git a/lib/aspects/AspectDict.d.ts b/lib/aspects/AspectDict.d.ts
index 77fd4771e..436acbde5 100644
--- a/lib/aspects/AspectDict.d.ts
+++ b/lib/aspects/AspectDict.d.ts
@@ -44,6 +44,11 @@ declare type GeneralAspectDict Promise;
+ updateApplicationConfig: (params: {
+ entity: 'application';
+ entityId: string;
+ config: EntityDict['application']['Schema']['config'];
+ }, context: Cxt) => Promise;
};
export declare type AspectDict> = GeneralAspectDict;
export {};
diff --git a/lib/aspects/config.d.ts b/lib/aspects/config.d.ts
index 8cf2822a1..8c4c993a8 100644
--- a/lib/aspects/config.d.ts
+++ b/lib/aspects/config.d.ts
@@ -6,3 +6,8 @@ export declare function updateConfig;
+export declare function updateApplicationConfig>(params: {
+ entity: 'application';
+ entityId: string;
+ config: EntityDict['application']['Schema']['config'];
+}, context: Cxt): Promise;
diff --git a/lib/aspects/config.js b/lib/aspects/config.js
index 309863772..6d05f41b1 100644
--- a/lib/aspects/config.js
+++ b/lib/aspects/config.js
@@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.updateConfig = void 0;
+exports.updateApplicationConfig = exports.updateConfig = void 0;
var tslib_1 = require("tslib");
var uuid_1 = require("oak-domain/lib/utils/uuid");
function updateConfig(params, context) {
@@ -28,3 +28,28 @@ function updateConfig(params, context) {
});
}
exports.updateConfig = updateConfig;
+function updateApplicationConfig(params, context) {
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
+ var entity, entityId, config;
+ return tslib_1.__generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ entity = params.entity, entityId = params.entityId, config = params.config;
+ return [4 /*yield*/, context.operate(entity, {
+ id: (0, uuid_1.generateNewId)(),
+ action: 'update',
+ data: {
+ config: config,
+ },
+ filter: {
+ id: entityId,
+ },
+ }, {})];
+ case 1:
+ _a.sent();
+ return [2 /*return*/];
+ }
+ });
+ });
+}
+exports.updateApplicationConfig = updateApplicationConfig;
diff --git a/lib/aspects/index.d.ts b/lib/aspects/index.d.ts
index 3060b2856..0792c2feb 100644
--- a/lib/aspects/index.d.ts
+++ b/lib/aspects/index.d.ts
@@ -1,7 +1,7 @@
import { loginByMobile, loginWechat, loginWechatMp, syncUserInfoWechatMp, sendCaptcha } from './token';
import { getUploadInfo } from './extraFile';
import { getApplication } from './application';
-import { updateConfig } from './config';
+import { updateConfig, updateApplicationConfig } from './config';
export declare const aspectDict: {
loginByMobile: typeof loginByMobile;
loginWechat: typeof loginWechat;
@@ -11,4 +11,5 @@ export declare const aspectDict: {
sendCaptcha: typeof sendCaptcha;
getApplication: typeof getApplication;
updateConfig: typeof updateConfig;
+ updateApplicationConfig: typeof updateApplicationConfig;
};
diff --git a/lib/aspects/index.js b/lib/aspects/index.js
index 22643d992..48812e998 100644
--- a/lib/aspects/index.js
+++ b/lib/aspects/index.js
@@ -5,7 +5,6 @@ var token_1 = require("./token");
var extraFile_1 = require("./extraFile");
var application_1 = require("./application");
var config_1 = require("./config");
-// import commonAspectDict from 'oak-common-aspect';
exports.aspectDict = {
loginByMobile: token_1.loginByMobile,
loginWechat: token_1.loginWechat,
@@ -15,5 +14,5 @@ exports.aspectDict = {
sendCaptcha: token_1.sendCaptcha,
getApplication: application_1.getApplication,
updateConfig: config_1.updateConfig,
+ updateApplicationConfig: config_1.updateApplicationConfig,
};
-// export type AspectDict = TokenAD & CrudAD;
diff --git a/lib/components/config/application/index.js b/lib/components/config/application/index.js
index bfedc9a63..54497f070 100644
--- a/lib/components/config/application/index.js
+++ b/lib/components/config/application/index.js
@@ -77,7 +77,7 @@ exports.default = OakComponent({
case 0:
currentConfig = this.state.currentConfig;
_a = this.props, entity = _a.entity, entityId = _a.entityId;
- return [4 /*yield*/, this.features.config.updateConfig(entity, entityId, currentConfig)];
+ return [4 /*yield*/, this.features.config.updateApplicationConfig(entity, entityId, currentConfig)];
case 1:
_b.sent();
this.setMessage({
diff --git a/lib/components/config/style/index.d.ts b/lib/components/config/style/index.d.ts
new file mode 100644
index 000000000..2469d4262
--- /dev/null
+++ b/lib/components/config/style/index.d.ts
@@ -0,0 +1,7 @@
+import { Style as StyleType } from '../../../types/Style';
+declare type StyleProps = {
+ value?: StyleType | null;
+ onChange: (value: StyleType) => void;
+};
+export default function Render(props: StyleProps): JSX.Element;
+export {};
diff --git a/lib/components/config/style/index.js b/lib/components/config/style/index.js
new file mode 100644
index 000000000..8d855d03f
--- /dev/null
+++ b/lib/components/config/style/index.js
@@ -0,0 +1,42 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tslib_1 = require("tslib");
+var jsx_runtime_1 = require("react/jsx-runtime");
+var antd_1 = require("antd");
+var lodash_1 = require("oak-domain/lib/utils/lodash");
+var Colors = ['primary', 'success', 'error', 'warning', 'info'];
+function Color(props) {
+ var _a = props.value, value = _a === void 0 ? {} : _a, setValue = props.setValue;
+ ;
+ return ((0, jsx_runtime_1.jsx)(antd_1.Form, { children: Colors.map(function (ele) { return ((0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: ele, requiredMark: true, name: "folder", tooltip: "\u8BBE\u7F6E\u7CFB\u7EDF\u3010".concat(ele, "\u3011\u989C\u8272"), rules: [
+ {
+ required: true,
+ },
+ ] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { onChange: function (e) {
+ setValue(ele, e.target.value);
+ }, value: (0, lodash_1.get)(value, ele) }) }) }), ele)); }) }));
+}
+function Render(props) {
+ var styleValue = props.value, onChange = props.onChange;
+ var setStyle = function (path, value) {
+ var newStyle = (0, lodash_1.set)(styleValue || {}, path, value);
+ onChange(newStyle);
+ };
+ return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(antd_1.Tabs, { onChange: function () { }, type: "card", items: [
+ {
+ label: '颜色',
+ key: 'color',
+ component: Color,
+ },
+ ].map(function (ele, i) {
+ var ItemComponent = ele.component;
+ return {
+ label: ele.label,
+ key: ele.key,
+ children: ((0, jsx_runtime_1.jsx)(ItemComponent, { value: (0, lodash_1.get)(styleValue, ele.key), setValue: function (path, value) {
+ setStyle("".concat(ele.key, ".").concat(path), value);
+ } })),
+ };
+ }) }) }));
+}
+exports.default = Render;
diff --git a/lib/components/config/style/index.module.less b/lib/components/config/style/index.module.less
new file mode 100644
index 000000000..7c0f8675f
--- /dev/null
+++ b/lib/components/config/style/index.module.less
@@ -0,0 +1,5 @@
+
+
+.box {
+ display: block;
+}
\ No newline at end of file
diff --git a/lib/components/message/index.xml b/lib/components/message/index.xml
index e523fe35b..f0536c57d 100644
--- a/lib/components/message/index.xml
+++ b/lib/components/message/index.xml
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/lib/entities/Subscription.d.ts b/lib/entities/Subscription.d.ts
index d703bae55..322fe8770 100644
--- a/lib/entities/Subscription.d.ts
+++ b/lib/entities/Subscription.d.ts
@@ -1,4 +1,4 @@
-import { String, Text } from 'oak-domain/lib/types/DataType';
+import { String, Text, Int } from 'oak-domain/lib/types/DataType';
import { EntityShape } from 'oak-domain/lib/types/Entity';
export declare type WechatPublicConfig = {
type: 'wechatPublic';
@@ -11,4 +11,5 @@ export interface Schema extends EntityShape {
name: String<32>;
description: Text;
config: WechatPublicConfig;
+ offset: Int<4>;
}
diff --git a/lib/entities/Subscription.js b/lib/entities/Subscription.js
index 79a51660e..77d028e4c 100644
--- a/lib/entities/Subscription.js
+++ b/lib/entities/Subscription.js
@@ -31,6 +31,7 @@ var locale = {
entityId: '对象Id',
description: '描述',
config: '配置',
+ offset: '已同步素材位置',
},
},
};
diff --git a/lib/features/config.d.ts b/lib/features/config.d.ts
index f3e1c4576..1f976a97d 100644
--- a/lib/features/config.d.ts
+++ b/lib/features/config.d.ts
@@ -10,4 +10,5 @@ export declare class Config>);
updateConfig(entity: 'platform' | 'system', entityId: string, config: ConfigDef): Promise;
+ updateApplicationConfig(entity: 'application', entityId: string, config: EntityDict['application']['Schema']['config']): Promise;
}
diff --git a/lib/features/config.js b/lib/features/config.js
index 54e9cc549..783dccf38 100644
--- a/lib/features/config.js
+++ b/lib/features/config.js
@@ -17,7 +17,24 @@ var Config = /** @class */ (function (_super) {
case 0: return [4 /*yield*/, this.cache.exec('updateConfig', {
entity: entity,
entityId: entityId,
- config: config
+ config: config,
+ })];
+ case 1:
+ _a.sent();
+ this.publish();
+ return [2 /*return*/];
+ }
+ });
+ });
+ };
+ Config.prototype.updateApplicationConfig = function (entity, entityId, config) {
+ 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.cache.exec('updateApplicationConfig', {
+ entity: entity,
+ entityId: entityId,
+ config: config,
})];
case 1:
_a.sent();
diff --git a/lib/miniprogram_npm/lin-ui/album/index.less b/lib/miniprogram_npm/lin-ui/album/index.less
index 558ca1aa8..e69de29bb 100644
--- a/lib/miniprogram_npm/lin-ui/album/index.less
+++ b/lib/miniprogram_npm/lin-ui/album/index.less
@@ -1,48 +0,0 @@
-/* miniprogram_npm/lin-ui/picture-album/index.wxss */
-.container {
- display: grid;
-}
-
-.vertical {
- height: 360rpx;
-}
-
-.parent {
- display: inline-grid;
- grid-template-columns: repeat(auto-fill);
-}
-
-.child {
- box-sizing: border-box;
- background-color: white;
- flex: 0 0 44%;
- height: 100px;
- border: 1px solid red;
- margin-top: 4%;
- margin-left: 2%;
- margin-right: 2%;
-}
-
-.dimback {
- background: #000;
-}
-
-.dim {
- opacity: 0.6;
- filter: alpha(opacity=60);
-}
-
-
-.imageContainer {
- position: relative;
-}
-
-.imageContainer:last-child>.text {
- color: white;
- font-weight: bold;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- font-size: larger;
-}
diff --git a/lib/pages/application/detail/web.js b/lib/pages/application/detail/web.js
index 19a59693d..f8d0e7e3a 100644
--- a/lib/pages/application/detail/web.js
+++ b/lib/pages/application/detail/web.js
@@ -12,7 +12,7 @@ function Render(props) {
{
label: '应用概览',
key: 'detail',
- children: ((0, jsx_runtime_1.jsxs)(antd_1.Descriptions, tslib_1.__assign({ column: 1, bordered: true }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: "id" }, { children: oakId })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('application:attr.name') }, { children: name })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('application:attr.description') }, { children: description })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('application:attr.type') }, { children: t("application:v.type.".concat(type)) })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('application:attr.system') +
+ children: ((0, jsx_runtime_1.jsxs)(antd_1.Descriptions, tslib_1.__assign({ column: 1, bordered: true }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: "id" }, { children: (0, jsx_runtime_1.jsx)(antd_1.Typography.Paragraph, tslib_1.__assign({ copyable: true }, { children: oakId })) })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('application:attr.name') }, { children: name })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('application:attr.description') }, { children: description })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('application:attr.type') }, { children: t("application:v.type.".concat(type)) })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('application:attr.system') +
t('system:attr.name') }, { children: system === null || system === void 0 ? void 0 : system.name }))] }))),
},
] }) })) })) })));
diff --git a/lib/pages/application/upsert/index.js b/lib/pages/application/upsert/index.js
index f6988d76e..fcddfc790 100644
--- a/lib/pages/application/upsert/index.js
+++ b/lib/pages/application/upsert/index.js
@@ -11,6 +11,7 @@ exports.default = OakComponent({
description: 1,
type: 1,
systemId: 1,
+ style: 1,
},
formData: function (_a) {
var data = _a.data;
@@ -22,10 +23,10 @@ exports.default = OakComponent({
value: 'web',
},
{
- value: "wechatMp",
+ value: 'wechatMp',
},
{
- value: "wechatPublic",
+ value: 'wechatPublic',
},
],
},
diff --git a/lib/pages/application/upsert/web.pc.d.ts b/lib/pages/application/upsert/web.pc.d.ts
index c775ea403..90a5cdac0 100644
--- a/lib/pages/application/upsert/web.pc.d.ts
+++ b/lib/pages/application/upsert/web.pc.d.ts
@@ -13,6 +13,7 @@ export default function Render(props: WebComponentProps;
systemId: string;
oakId: string;
+ style: EntityDict['system']['Schema']['style'];
}, {
confirm: () => void;
}>): JSX.Element;
diff --git a/lib/pages/application/upsert/web.pc.js b/lib/pages/application/upsert/web.pc.js
index 3beb53385..527a4ea7c 100644
--- a/lib/pages/application/upsert/web.pc.js
+++ b/lib/pages/application/upsert/web.pc.js
@@ -4,9 +4,10 @@ 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 style_1 = tslib_1.__importDefault(require("../../../components/config/style"));
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
function Render(props) {
- var _a = props.data, name = _a.name, description = _a.description, type = _a.type, typeArr = _a.typeArr, variant = _a.variant, _b = _a.showBack, showBack = _b === void 0 ? true : _b, systemId = _a.systemId, oakId = _a.oakId;
+ var _a = props.data, name = _a.name, description = _a.description, type = _a.type, typeArr = _a.typeArr, variant = _a.variant, _b = _a.showBack, showBack = _b === void 0 ? true : _b, systemId = _a.systemId, oakId = _a.oakId, style = _a.style;
var _c = props.methods, t = _c.t, update = _c.update, navigateBack = _c.navigateBack, confirm = _c.confirm;
return ((0, jsx_runtime_1.jsx)(Container, tslib_1.__assign({ variant: variant, showBack: showBack }, { children: (0, jsx_runtime_1.jsx)(antd_1.Row, { children: (0, jsx_runtime_1.jsx)(antd_1.Col, tslib_1.__assign({ xs: 24, sm: 12 }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: true, labelCol: { span: 6 }, wrapperCol: { span: 16 } }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u540D\u79F0", requiredMark: true, name: "name", rules: [
{
@@ -31,7 +32,11 @@ function Render(props) {
update({
type: value,
});
- } }) }) })), (0, jsx_runtime_1.jsx)(Action, tslib_1.__assign({ variant: variant }, { children: (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 6 } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () {
+ } }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u6837\u5F0F", requiredMark: true, name: "style" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(style_1.default, { onChange: function (value) {
+ update({
+ style: value,
+ });
+ }, value: style }) }) })), (0, jsx_runtime_1.jsx)(Action, tslib_1.__assign({ variant: variant }, { children: (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 6 } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () {
confirm();
} }, { children: "\u786E\u5B9A" })), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ onClick: function () {
navigateBack();
diff --git a/lib/pages/domain/detail/index.js b/lib/pages/domain/detail/index.js
index 854279906..51809af30 100644
--- a/lib/pages/domain/detail/index.js
+++ b/lib/pages/domain/detail/index.js
@@ -6,6 +6,10 @@ exports.default = OakComponent({
projection: {
id: 1,
systemId: 1,
+ system: {
+ id: 1,
+ name: 1,
+ },
url: 1,
apiPath: 1,
port: 1,
diff --git a/lib/pages/domain/detail/web.d.ts b/lib/pages/domain/detail/web.d.ts
index 0fde0e02e..8703ed615 100644
--- a/lib/pages/domain/detail/web.d.ts
+++ b/lib/pages/domain/detail/web.d.ts
@@ -8,6 +8,7 @@ export default function Render(props: WebComponentProps void;
}>): JSX.Element;
diff --git a/lib/pages/domain/detail/web.js b/lib/pages/domain/detail/web.js
index edea38d8f..e5d1dc467 100644
--- a/lib/pages/domain/detail/web.js
+++ b/lib/pages/domain/detail/web.js
@@ -6,7 +6,7 @@ var antd_1 = require("antd");
var pageHeader_1 = tslib_1.__importDefault(require("../../../components/common/pageHeader"));
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
function Render(props) {
- var _a = props.data, oakId = _a.oakId, url = _a.url, tabValue = _a.tabValue;
+ var _a = props.data, oakId = _a.oakId, url = _a.url, tabValue = _a.tabValue, system = _a.system, apiPath = _a.apiPath, protocol = _a.protocol, port = _a.port;
var _b = props.methods, t = _b.t, navigateBack = _b.navigateBack, onTabClick = _b.onTabClick;
return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ showBack: true, title: "\u57DF\u540D\u6982\u89C8" }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: (0, jsx_runtime_1.jsx)(antd_1.Card, tslib_1.__assign({ title: url, bordered: false }, { children: (0, jsx_runtime_1.jsx)(antd_1.Tabs, { activeKey: tabValue, onTabClick: function (key) {
onTabClick(key);
@@ -14,7 +14,8 @@ function Render(props) {
{
label: '域名概览',
key: 'detail',
- children: (0, jsx_runtime_1.jsx)("div", { children: "\u8BE6\u60C5" }),
+ children: ((0, jsx_runtime_1.jsxs)(antd_1.Descriptions, tslib_1.__assign({ column: 1, bordered: true }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: "id" }, { children: (0, jsx_runtime_1.jsx)(antd_1.Typography.Paragraph, tslib_1.__assign({ copyable: true }, { children: oakId })) })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('domain:attr.url') }, { children: url })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('domain:attr.apiPath') }, { children: apiPath })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('domain:attr.port') }, { children: port })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('domain:attr.protocol') }, { children: protocol })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('domain:attr.system') +
+ t('system:attr.name') }, { children: system === null || system === void 0 ? void 0 : system.name }))] }))),
},
] }) })) })) })));
}
diff --git a/lib/pages/domain/list/web.pc.js b/lib/pages/domain/list/web.pc.js
index 6da24787f..cf3870980 100644
--- a/lib/pages/domain/list/web.pc.js
+++ b/lib/pages/domain/list/web.pc.js
@@ -22,6 +22,11 @@ function Render(props) {
{
dataIndex: 'url',
title: '域名',
+ render: function (value, record, index) {
+ return ((0, jsx_runtime_1.jsx)(antd_1.Typography.Link, tslib_1.__assign({ onClick: function () {
+ goDetail(record.id);
+ } }, { children: value })));
+ },
},
{
dataIndex: 'apiPath',
diff --git a/lib/pages/platform/detail/index.js b/lib/pages/platform/detail/index.js
index 014f67765..f7631038b 100644
--- a/lib/pages/platform/detail/index.js
+++ b/lib/pages/platform/detail/index.js
@@ -8,6 +8,7 @@ exports.default = OakComponent({
name: 1,
config: 1,
description: 1,
+ style: 1,
},
formData: function (_a) {
var data = _a.data;
diff --git a/lib/pages/platform/detail/web.js b/lib/pages/platform/detail/web.js
index b03ae07f0..5b461918a 100644
--- a/lib/pages/platform/detail/web.js
+++ b/lib/pages/platform/detail/web.js
@@ -15,7 +15,7 @@ function Render(props) {
{
label: '平台信息',
key: 'detail',
- children: (0, jsx_runtime_1.jsxs)(antd_1.Descriptions, tslib_1.__assign({ column: 1, bordered: true }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: "id" }, { children: oakId })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('platform:attr.name') }, { children: name })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('platform:attr.description') }, { children: description }))] })),
+ children: ((0, jsx_runtime_1.jsxs)(antd_1.Descriptions, tslib_1.__assign({ column: 1, bordered: true }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: "id" }, { children: (0, jsx_runtime_1.jsx)(antd_1.Typography.Paragraph, tslib_1.__assign({ copyable: true }, { children: oakId })) })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('platform:attr.name') }, { children: name })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('platform:attr.description') }, { children: description }))] }))),
},
{
label: '系统管理',
diff --git a/lib/pages/platform/upsert/index.js b/lib/pages/platform/upsert/index.js
index 08d6c4dbe..36aef985d 100644
--- a/lib/pages/platform/upsert/index.js
+++ b/lib/pages/platform/upsert/index.js
@@ -9,6 +9,7 @@ exports.default = OakComponent({
name: 1,
config: 1,
description: 1,
+ style: 1,
},
formData: function (_a) {
var data = _a.data;
@@ -27,6 +28,6 @@ exports.default = OakComponent({
}
});
});
- }
+ },
},
});
diff --git a/lib/pages/platform/upsert/web.pc.d.ts b/lib/pages/platform/upsert/web.pc.d.ts
index edcc6ab29..d7aefb70d 100644
--- a/lib/pages/platform/upsert/web.pc.d.ts
+++ b/lib/pages/platform/upsert/web.pc.d.ts
@@ -3,6 +3,7 @@ import { WebComponentProps } from 'oak-frontend-base';
export default function Render(props: WebComponentProps void;
}>): JSX.Element;
diff --git a/lib/pages/platform/upsert/web.pc.js b/lib/pages/platform/upsert/web.pc.js
index 52e0f4b14..55fd2b2b4 100644
--- a/lib/pages/platform/upsert/web.pc.js
+++ b/lib/pages/platform/upsert/web.pc.js
@@ -4,9 +4,10 @@ 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 style_1 = tslib_1.__importDefault(require("../../../components/config/style"));
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
function Render(props) {
- var _a = props.data, name = _a.name, description = _a.description;
+ var _a = props.data, name = _a.name, description = _a.description, style = _a.style;
var _b = props.methods, t = _b.t, update = _b.update, navigateBack = _b.navigateBack, confirm = _b.confirm;
return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ showBack: true, title: "\u5E73\u53F0\u7F16\u8F91" }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: (0, jsx_runtime_1.jsx)(antd_1.Row, { children: (0, jsx_runtime_1.jsx)(antd_1.Col, tslib_1.__assign({ xs: 24, sm: 12 }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: true, labelCol: { span: 4 }, wrapperCol: { span: 16 } }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u540D\u79F0", requiredMark: true, name: "name", rules: [
{
@@ -20,7 +21,11 @@ function Render(props) {
update({
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.jsxs)(antd_1.Space, { 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({ label: "\u6837\u5F0F", requiredMark: true, name: "style" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(style_1.default, { onChange: function (value) {
+ update({
+ style: value,
+ });
+ }, value: style }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 4 } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () {
confirm();
} }, { children: "\u786E\u5B9A" })), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ onClick: function () {
navigateBack();
diff --git a/lib/pages/system/detail/web.js b/lib/pages/system/detail/web.js
index 233582c84..f53536ada 100644
--- a/lib/pages/system/detail/web.js
+++ b/lib/pages/system/detail/web.js
@@ -16,7 +16,7 @@ function Render(props) {
{
label: '系统概览',
key: 'detail',
- children: ((0, jsx_runtime_1.jsxs)(antd_1.Descriptions, tslib_1.__assign({ column: 1, bordered: true }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: "id" }, { children: oakId })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.name') }, { children: name })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.description') }, { children: description })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.super') }, { children: isSuper ? '是' : '否' })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.folder') }, { children: folder })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.platform') +
+ children: ((0, jsx_runtime_1.jsxs)(antd_1.Descriptions, tslib_1.__assign({ column: 1, bordered: true }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: "id" }, { children: (0, jsx_runtime_1.jsx)(antd_1.Typography.Paragraph, tslib_1.__assign({ copyable: true }, { children: oakId })) })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.name') }, { children: name })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.description') }, { children: description })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.super') }, { children: isSuper ? '是' : '否' })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.folder') }, { children: folder })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.platform') +
t('platform:attr.name') }, { children: platform === null || platform === void 0 ? void 0 : platform.name }))] }))),
},
{
diff --git a/lib/pages/system/list/web.pc.js b/lib/pages/system/list/web.pc.js
index aaabc5d66..57f3cc7a4 100644
--- a/lib/pages/system/list/web.pc.js
+++ b/lib/pages/system/list/web.pc.js
@@ -47,7 +47,7 @@ function Render(props) {
title: '访问域名',
render: function (value, record, index) {
return value
- ? value.map(function (ele) { return ((0, jsx_runtime_1.jsx)(antd_1.Space, { children: (0, jsx_runtime_1.jsx)(antd_1.Tag, { children: ele.url }) })); })
+ ? value.map(function (ele) { return ((0, jsx_runtime_1.jsx)(antd_1.Space, tslib_1.__assign({ direction: "vertical" }, { children: (0, jsx_runtime_1.jsx)(antd_1.Tag, { children: ele.url }) }))); })
: '';
},
},
diff --git a/lib/pages/system/upsert/web.pc.js b/lib/pages/system/upsert/web.pc.js
index a61b69b65..94aa5594d 100644
--- a/lib/pages/system/upsert/web.pc.js
+++ b/lib/pages/system/upsert/web.pc.js
@@ -4,16 +4,11 @@ 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 style_1 = tslib_1.__importDefault(require("../../../components/config/style"));
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
-var lodash_1 = require("oak-domain/lib/utils/lodash");
function Render(props) {
var _a = props.data, name = _a.name, description = _a.description, folder = _a.folder, super2 = _a.super, style = _a.style, variant = _a.variant, _b = _a.showBack, showBack = _b === void 0 ? true : _b;
var _c = props.methods, t = _c.t, update = _c.update, navigateBack = _c.navigateBack, confirm = _c.confirm;
- var setStyle = function (path, value) {
- update({
- style: (0, lodash_1.set)(style || {}, path, value),
- });
- };
return ((0, jsx_runtime_1.jsx)(Container, tslib_1.__assign({ variant: variant, showBack: showBack }, { children: (0, jsx_runtime_1.jsx)(antd_1.Row, { children: (0, jsx_runtime_1.jsx)(antd_1.Col, tslib_1.__assign({ xs: 24, sm: 12 }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: true, labelCol: { span: 6 }, wrapperCol: { span: 16 } }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u540D\u79F0", requiredMark: true, name: "name", rules: [
{
required: true,
@@ -38,13 +33,11 @@ function Render(props) {
update({
super: checked,
});
- } }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u4E3B\u9898\u8272", requiredMark: true, name: "folder", tooltip: "\u8BBE\u7F6E\u7CFB\u7EDF\u4E3B\u9898\u989C\u8272", rules: [
- {
- required: true,
- },
- ] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { onChange: function (e) {
- setStyle('color.primary', e.target.value);
- }, value: (0, lodash_1.get)(style || {}, 'color.primary') }) }) })), (0, jsx_runtime_1.jsx)(Action, tslib_1.__assign({ variant: variant }, { children: (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 6 } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () {
+ } }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u6837\u5F0F", requiredMark: true, name: "style" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(style_1.default, { onChange: function (value) {
+ update({
+ style: value,
+ });
+ }, value: style }) }) })), (0, jsx_runtime_1.jsx)(Action, tslib_1.__assign({ variant: variant }, { children: (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 6 } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () {
confirm();
} }, { children: "\u786E\u5B9A" })), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ onClick: function () {
navigateBack();
diff --git a/lib/types/Style.d.ts b/lib/types/Style.d.ts
index 9790ea60a..5b0330583 100644
--- a/lib/types/Style.d.ts
+++ b/lib/types/Style.d.ts
@@ -1,9 +1,6 @@
+export declare type ColorType = 'primary' | 'success' | 'error' | 'warning' | 'info';
export declare type Color = {
- primary: string;
- success?: string;
- error?: string;
- warning?: string;
- info?: string;
+ [k in ColorType]?: string;
};
export declare type Style = {
color?: Color;
diff --git a/package.json b/package.json
index a0f8d79ca..86e45edb1 100644
--- a/package.json
+++ b/package.json
@@ -80,7 +80,8 @@
"gen:areaDebug": "ts-node ./scripts/generateAreaDebug.ts",
"clean:dir": "ts-node ./scripts/cleanDtsAndJs",
"test": "ts-node ./test/test.ts",
- "prepare": "rimraf node_modules/react & rimraf node_modules/react-dom & rimraf node_modules/react-router"
+ "prepare": "rimraf node_modules/react & rimraf node_modules/react-dom & rimraf node_modules/react-router",
+ "remove-antd": "rimraf node_modules/antd & rimraf node_modules/antd-mobile & rimraf node_modules/@ant-design & rimraf node_modules/antd-mobile-icons & rimraf node_modules/antd-mobile-v5-count"
},
"main": "lib/index"
}
diff --git a/src/aspects/AspectDict.ts b/src/aspects/AspectDict.ts
index 0b4949499..f3783093e 100644
--- a/src/aspects/AspectDict.ts
+++ b/src/aspects/AspectDict.ts
@@ -81,6 +81,14 @@ type GeneralAspectDict<
},
context: Cxt
) => Promise;
+ updateApplicationConfig: (
+ params: {
+ entity: 'application';
+ entityId: string;
+ config: EntityDict['application']['Schema']['config'];
+ },
+ context: Cxt
+ ) => Promise;
};
export type AspectDict> = GeneralAspectDict;
\ No newline at end of file
diff --git a/src/aspects/config.ts b/src/aspects/config.ts
index fd82918b9..3cb2dbffc 100644
--- a/src/aspects/config.ts
+++ b/src/aspects/config.ts
@@ -19,4 +19,33 @@ export async function updateConfig
+>(
+ params: {
+ entity: 'application';
+ entityId: string;
+ config: EntityDict['application']['Schema']['config'];
+ },
+ context: Cxt
+) {
+ const { entity, entityId, config } = params;
+ await context.operate(
+ entity,
+ {
+ id: generateNewId(),
+ action: 'update',
+ data: {
+ config,
+ },
+ filter: {
+ id: entityId,
+ },
+ },
+ {}
+ );
}
\ No newline at end of file
diff --git a/src/aspects/index.ts b/src/aspects/index.ts
index a03bd06aa..e5a89771b 100644
--- a/src/aspects/index.ts
+++ b/src/aspects/index.ts
@@ -7,8 +7,7 @@ import {
} from './token';
import { getUploadInfo } from './extraFile';
import { getApplication } from './application';
-import { updateConfig } from './config';
-// import commonAspectDict from 'oak-common-aspect';
+import { updateConfig, updateApplicationConfig } from './config';
export const aspectDict = {
loginByMobile,
@@ -19,6 +18,5 @@ export const aspectDict = {
sendCaptcha,
getApplication,
updateConfig,
-};
-
-// export type AspectDict = TokenAD & CrudAD;
\ No newline at end of file
+ updateApplicationConfig,
+};
\ No newline at end of file
diff --git a/src/components/config/application/index.ts b/src/components/config/application/index.ts
index dbb809194..5983f4849 100644
--- a/src/components/config/application/index.ts
+++ b/src/components/config/application/index.ts
@@ -78,7 +78,7 @@ export default OakComponent({
const { currentConfig } = this.state;
const { entity, entityId } = this.props;
- await this.features.config.updateConfig(
+ await this.features.config.updateApplicationConfig(
entity,
entityId,
currentConfig
diff --git a/src/components/config/style/index.module.less b/src/components/config/style/index.module.less
new file mode 100644
index 000000000..7c0f8675f
--- /dev/null
+++ b/src/components/config/style/index.module.less
@@ -0,0 +1,5 @@
+
+
+.box {
+ display: block;
+}
\ No newline at end of file
diff --git a/src/components/config/style/index.tsx b/src/components/config/style/index.tsx
new file mode 100644
index 000000000..f1345b91a
--- /dev/null
+++ b/src/components/config/style/index.tsx
@@ -0,0 +1,84 @@
+import React from 'react';
+import { Button, Form, Input, Tooltip, Tabs } from 'antd';
+import { Style as StyleType, ColorType } from '../../../types/Style';
+import { set, get } from 'oak-domain/lib/utils/lodash';
+
+import Style from './index.module.less';
+
+type StyleProps = {
+ value?: StyleType | null;
+ onChange: (value: StyleType) => void;
+};
+
+const Colors: ColorType[] = ['primary', 'success', 'error', 'warning', 'info'];
+
+function Color(props: { value: StyleType['color'], setValue: (path: string, value: string) => void }) {
+ const { value = {}, setValue } = props;;
+ return (
+
+ <>
+ {
+ setValue(ele, e.target.value);
+ }}
+ value={get(value, ele)}
+ />
+ >
+
+ ))}
+
+ );
+}
+
+export default function Render(props: StyleProps) {
+ const { value: styleValue, onChange } = props;
+
+ const setStyle = (path: string, value: string) => {
+ const newStyle = set(styleValue || {}, path, value);
+ onChange(newStyle);
+ };
+
+ return (
+
+ {}}
+ type="card"
+ items={[
+ {
+ label: '颜色',
+ key: 'color',
+ component: Color,
+ },
+ ].map((ele, i) => {
+ const ItemComponent = ele.component;
+ return {
+ label: ele.label,
+ key: ele.key,
+ children: (
+ {
+ setStyle(`${ele.key}.${path}`, value);
+ }}
+ />
+ ),
+ };
+ })}
+ />
+
+ );
+}
+
diff --git a/src/features/config.ts b/src/features/config.ts
index cdba20056..13d76bf7b 100644
--- a/src/features/config.ts
+++ b/src/features/config.ts
@@ -13,10 +13,12 @@ export class Config<
Cxt extends BackendRuntimeContext,
FrontCxt extends FrontendRuntimeContext,
AD extends AspectDict & CommonAspectDict
- > extends Feature {
+> extends Feature {
private cache: Cache>;
- constructor(cache: Cache>) {
+ constructor(
+ cache: Cache>
+ ) {
super();
this.cache = cache;
}
@@ -24,12 +26,25 @@ export class Config<
async updateConfig(
entity: 'platform' | 'system',
entityId: string,
- config: ConfigDef,
+ config: ConfigDef
) {
await this.cache.exec('updateConfig', {
entity,
entityId,
- config
+ config,
+ });
+ this.publish();
+ }
+
+ async updateApplicationConfig(
+ entity: 'application',
+ entityId: string,
+ config: EntityDict['application']['Schema']['config']
+ ) {
+ await this.cache.exec('updateApplicationConfig', {
+ entity,
+ entityId,
+ config,
});
this.publish();
}
diff --git a/src/pages/application/detail/web.tsx b/src/pages/application/detail/web.tsx
index a18a60430..ca415dbf5 100644
--- a/src/pages/application/detail/web.tsx
+++ b/src/pages/application/detail/web.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { Tabs, Card, Descriptions } from 'antd';
+import { Tabs, Card, Descriptions, Typography } from 'antd';
import PageHeader from '../../../components/common/pageHeader';
import Style from './web.module.less';
@@ -51,7 +51,9 @@ export default function Render(
children: (
- {oakId}
+
+ {oakId}
+
;
systemId: string;
oakId: string;
+ style: EntityDict['system']['Schema']['style'];
},
{
confirm: () => void;
@@ -39,6 +41,7 @@ export default function Render(
showBack = true,
systemId,
oakId,
+ style,
} = props.data;
const { t, update, navigateBack, confirm } = props.methods;
return (
@@ -115,6 +118,19 @@ export default function Render(
>
+
+ <>
+ {
+ update({
+ style: value,
+ });
+ }}
+ value={style}
+ />
+ >
+
+
diff --git a/src/pages/domain/detail/index.ts b/src/pages/domain/detail/index.ts
index 6ba35835c..5e6a9c3f6 100644
--- a/src/pages/domain/detail/index.ts
+++ b/src/pages/domain/detail/index.ts
@@ -4,6 +4,10 @@ export default OakComponent({
projection: {
id: 1,
systemId: 1,
+ system: {
+ id: 1,
+ name: 1,
+ },
url: 1,
apiPath: 1,
port: 1,
diff --git a/src/pages/domain/detail/web.tsx b/src/pages/domain/detail/web.tsx
index cdd37ee94..6501ace63 100644
--- a/src/pages/domain/detail/web.tsx
+++ b/src/pages/domain/detail/web.tsx
@@ -1,7 +1,6 @@
import React from 'react';
-import { Tabs, Card } from 'antd';
+import { Tabs, Card, Descriptions, Typography } from 'antd';
import PageHeader from '../../../components/common/pageHeader';
-import ApplicationList from '../../../pages/application/list';
import Style from './web.module.less';
@@ -21,13 +20,15 @@ export default function Render(
port: string;
protocol: EntityDict['domain']['Schema']['protocol'];
tabValue: 'detail';
+ system: EntityDict['system']['Schema'];
},
{
onTabClick: (key: string) => void;
}
>
) {
- const { oakId, url, tabValue } = props.data;
+ const { oakId, url, tabValue, system, apiPath, protocol, port } =
+ props.data;
const { t, navigateBack, onTabClick } = props.methods;
return (
@@ -42,7 +43,43 @@ export default function Render(
{
label: '域名概览',
key: 'detail',
- children: 详情
,
+ children: (
+
+
+
+ {oakId}
+
+
+
+ {url}
+
+
+ {apiPath}
+
+
+ {port}
+
+
+ {protocol}
+
+
+ {system?.name}
+
+
+ ),
},
]}
/>
diff --git a/src/pages/domain/list/web.pc.tsx b/src/pages/domain/list/web.pc.tsx
index eaff16570..3bf437642 100644
--- a/src/pages/domain/list/web.pc.tsx
+++ b/src/pages/domain/list/web.pc.tsx
@@ -75,6 +75,17 @@ export default function Render(
{
dataIndex: 'url',
title: '域名',
+ render: (value, record, index) => {
+ return (
+ {
+ goDetail(record.id);
+ }}
+ >
+ {value}
+
+ );
+ },
},
{
dataIndex: 'apiPath',
diff --git a/src/pages/platform/detail/index.ts b/src/pages/platform/detail/index.ts
index cca66eff4..7008e0da1 100644
--- a/src/pages/platform/detail/index.ts
+++ b/src/pages/platform/detail/index.ts
@@ -6,6 +6,7 @@ export default OakComponent({
name: 1,
config: 1,
description: 1,
+ style: 1,
},
formData({ data }) {
return data || {};
diff --git a/src/pages/platform/detail/web.tsx b/src/pages/platform/detail/web.tsx
index b98682006..8e973a695 100644
--- a/src/pages/platform/detail/web.tsx
+++ b/src/pages/platform/detail/web.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { Tabs, Card, Descriptions } from 'antd';
+import { Tabs, Card, Descriptions, Typography } from 'antd';
import PageHeader from '../../../components/common/pageHeader';
import SystemList from '../../system/list';
@@ -42,11 +42,27 @@ export default function Render(
{
label: '平台信息',
key: 'detail',
- children:
- {oakId}
- {name}
- {description}
- ,
+ children: (
+
+
+
+ {oakId}
+
+
+
+ {name}
+
+
+ {description}
+
+
+ ),
},
{
label: '系统管理',
diff --git a/src/pages/platform/upsert/index.ts b/src/pages/platform/upsert/index.ts
index 4b30e7bbd..c10c206dc 100644
--- a/src/pages/platform/upsert/index.ts
+++ b/src/pages/platform/upsert/index.ts
@@ -6,6 +6,7 @@ export default OakComponent({
name: 1,
config: 1,
description: 1,
+ style: 1,
},
formData({ data }) {
return data || {};
@@ -14,6 +15,6 @@ export default OakComponent({
async confirm() {
await this.execute();
this.navigateBack();
- }
+ },
},
});
diff --git a/src/pages/platform/upsert/web.pc.tsx b/src/pages/platform/upsert/web.pc.tsx
index a118f6b71..4ecdc12d0 100644
--- a/src/pages/platform/upsert/web.pc.tsx
+++ b/src/pages/platform/upsert/web.pc.tsx
@@ -1,6 +1,8 @@
import React from 'react';
import { Button, Form, Row, Col, Input, Space } from 'antd';
import PageHeader from '../../../components/common/pageHeader';
+import ComponentStyle from '../../../components/config/style';
+
import Style from './web.module.less';
@@ -15,13 +17,14 @@ export default function Render(
{
name: string;
description: string;
+ style: EntityDict['system']['Schema']['style'];
},
{
confirm: () => void;
}
>
) {
- const { name, description } = props.data;
+ const { name, description, style } = props.data;
const { t, update, navigateBack, confirm } = props.methods;
return (
@@ -70,6 +73,23 @@ export default function Render(
/>
>
+
+ <>
+ {
+ update({
+ style: value,
+ });
+ }}
+ value={style}
+ />
+ >
+
+
-
+
<>
- {
- setStyle(
- 'color.primary',
- e.target.value
- );
+ {
+ update({
+ style: value,
+ });
}}
- value={get(
- style || {},
- 'color.primary'
- )}
+ value={style}
/>
>
diff --git a/src/types/Style.ts b/src/types/Style.ts
index c760d025e..3de9893d8 100644
--- a/src/types/Style.ts
+++ b/src/types/Style.ts
@@ -1,9 +1,12 @@
+export type ColorType = 'primary' | 'success' | 'error' | 'warning' | 'info';
+
export type Color = {
- primary: string;
- success?: string;
- error?: string;
- warning?: string;
- info?: string;
+ // primary: string;
+ // success?: string;
+ // error?: string;
+ // warning?: string;
+ // info?: string;
+ [k in ColorType]?: string;
};
From 3bc4b85179fc6fb8f9fb167bedea2b6e52e77fad Mon Sep 17 00:00:00 2001
From: wkj <278599135@qq.com>
Date: Wed, 21 Dec 2022 19:47:37 +0800
Subject: [PATCH 6/8] =?UTF-8?q?=E8=AE=A2=E9=98=85=E5=8F=B7=E7=AE=A1?=
=?UTF-8?q?=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/components/config/application/web.pc.d.ts | 1 +
lib/components/config/application/web.pc.js | 10 +-
.../application/wechatPublic/index.d.ts | 1 +
.../config/application/wechatPublic/index.js | 13 +-
lib/miniprogram_npm/lin-ui/album/index.less | 48 ++++
lib/pages/application/upsert/web.pc.d.ts | 1 -
.../subscription/config/upsert/index.d.ts | 3 +
lib/pages/subscription/config/upsert/index.js | 16 ++
.../config/upsert/web.module.less | 6 +
.../subscription/config/upsert/web.pc.d.ts | 11 +
.../subscription/config/upsert/web.pc.js | 12 +
lib/pages/subscription/detail/index.d.ts | 3 +
lib/pages/subscription/detail/index.js | 19 ++
lib/pages/subscription/detail/web.d.ts | 16 ++
lib/pages/subscription/detail/web.js | 19 ++
lib/pages/subscription/detail/web.module.less | 6 +
lib/pages/subscription/list/index.d.ts | 3 +
lib/pages/subscription/list/index.js | 68 +++++
lib/pages/subscription/list/web.module.less | 6 +
lib/pages/subscription/list/web.pc.d.ts | 15 +
lib/pages/subscription/list/web.pc.js | 83 ++++++
lib/pages/subscription/upsert/index.d.ts | 3 +
lib/pages/subscription/upsert/index.js | 48 ++++
lib/pages/subscription/upsert/web.module.less | 6 +
lib/pages/subscription/upsert/web.pc.d.ts | 13 +
lib/pages/subscription/upsert/web.pc.js | 43 +++
src/components/config/application/web.pc.tsx | 15 +-
.../config/application/wechatPublic/index.tsx | 260 +++++++++---------
src/pages/application/upsert/web.pc.tsx | 1 -
src/pages/subscription/config/upsert/index.ts | 13 +
.../config/upsert/web.module.less | 6 +
.../subscription/config/upsert/web.pc.tsx | 43 +++
src/pages/subscription/detail/index.ts | 16 ++
src/pages/subscription/detail/web.module.less | 6 +
src/pages/subscription/detail/web.tsx | 76 +++++
src/pages/subscription/list/index.ts | 64 +++++
src/pages/subscription/list/web.module.less | 6 +
src/pages/subscription/list/web.pc.tsx | 186 +++++++++++++
src/pages/subscription/upsert/index.ts | 39 +++
src/pages/subscription/upsert/web.module.less | 6 +
src/pages/subscription/upsert/web.pc.tsx | 136 +++++++++
41 files changed, 1207 insertions(+), 139 deletions(-)
create mode 100644 lib/pages/subscription/config/upsert/index.d.ts
create mode 100644 lib/pages/subscription/config/upsert/index.js
create mode 100644 lib/pages/subscription/config/upsert/web.module.less
create mode 100644 lib/pages/subscription/config/upsert/web.pc.d.ts
create mode 100644 lib/pages/subscription/config/upsert/web.pc.js
create mode 100644 lib/pages/subscription/detail/index.d.ts
create mode 100644 lib/pages/subscription/detail/index.js
create mode 100644 lib/pages/subscription/detail/web.d.ts
create mode 100644 lib/pages/subscription/detail/web.js
create mode 100644 lib/pages/subscription/detail/web.module.less
create mode 100644 lib/pages/subscription/list/index.d.ts
create mode 100644 lib/pages/subscription/list/index.js
create mode 100644 lib/pages/subscription/list/web.module.less
create mode 100644 lib/pages/subscription/list/web.pc.d.ts
create mode 100644 lib/pages/subscription/list/web.pc.js
create mode 100644 lib/pages/subscription/upsert/index.d.ts
create mode 100644 lib/pages/subscription/upsert/index.js
create mode 100644 lib/pages/subscription/upsert/web.module.less
create mode 100644 lib/pages/subscription/upsert/web.pc.d.ts
create mode 100644 lib/pages/subscription/upsert/web.pc.js
create mode 100644 src/pages/subscription/config/upsert/index.ts
create mode 100644 src/pages/subscription/config/upsert/web.module.less
create mode 100644 src/pages/subscription/config/upsert/web.pc.tsx
create mode 100644 src/pages/subscription/detail/index.ts
create mode 100644 src/pages/subscription/detail/web.module.less
create mode 100644 src/pages/subscription/detail/web.tsx
create mode 100644 src/pages/subscription/list/index.ts
create mode 100644 src/pages/subscription/list/web.module.less
create mode 100644 src/pages/subscription/list/web.pc.tsx
create mode 100644 src/pages/subscription/upsert/index.ts
create mode 100644 src/pages/subscription/upsert/web.module.less
create mode 100644 src/pages/subscription/upsert/web.pc.tsx
diff --git a/lib/components/config/application/web.pc.d.ts b/lib/components/config/application/web.pc.d.ts
index 289c251d1..caa53b0c0 100644
--- a/lib/components/config/application/web.pc.d.ts
+++ b/lib/components/config/application/web.pc.d.ts
@@ -8,6 +8,7 @@ export default function render(props: WebComponentProps void;
updateConfig: () => void;
diff --git a/lib/components/config/application/web.pc.js b/lib/components/config/application/web.pc.js
index 2fde580a4..257d24522 100644
--- a/lib/components/config/application/web.pc.js
+++ b/lib/components/config/application/web.pc.js
@@ -8,7 +8,7 @@ var index_1 = tslib_1.__importDefault(require("./web/index"));
var index_2 = tslib_1.__importDefault(require("./wechatMp/index"));
var index_3 = tslib_1.__importDefault(require("./wechatPublic/index"));
function AppView(props) {
- var type = props.type, config = props.config, setValue = props.setValue, removeItem = props.removeItem, cleanKey = props.cleanKey;
+ var type = props.type, config = props.config, setValue = props.setValue, removeItem = props.removeItem, cleanKey = props.cleanKey, isService = props.isService;
if (type === 'web') {
return ((0, jsx_runtime_1.jsx)(index_1.default, { config: config || {}, setValue: function (path, value) { return setValue(path, value); }, removeItem: function (path, index) { return removeItem(path, index); }, cleanKey: function (path, key) { return cleanKey(path, key); } }));
}
@@ -16,20 +16,20 @@ function AppView(props) {
return ((0, jsx_runtime_1.jsx)(index_2.default, { config: config || {}, setValue: function (path, value) { return setValue(path, value); }, removeItem: function (path, index) { return removeItem(path, index); }, cleanKey: function (path, key) { return cleanKey(path, key); } }));
}
if (type === 'wechatPublic') {
- return ((0, jsx_runtime_1.jsx)(index_3.default, { config: config || {}, setValue: function (path, value) { return setValue(path, value); }, removeItem: function (path, index) { return removeItem(path, index); }, cleanKey: function (path, key) { return cleanKey(path, key); } }));
+ return ((0, jsx_runtime_1.jsx)(index_3.default, { isService: isService, config: config || {}, setValue: function (path, value) { return setValue(path, value); }, removeItem: function (path, index) { return removeItem(path, index); }, cleanKey: function (path, key) { return cleanKey(path, key); } }));
}
return null;
}
function render(props) {
- var _a = props.data, entity = _a.entity, name = _a.name, type = _a.type, currentConfig = _a.currentConfig, dirty = _a.dirty;
- var _b = props.methods, resetConfig = _b.resetConfig, updateConfig = _b.updateConfig, setValue = _b.setValue, removeItem = _b.removeItem, cleanKey = _b.cleanKey;
+ var _a = props.data, entity = _a.entity, name = _a.name, type = _a.type, currentConfig = _a.currentConfig, dirty = _a.dirty, _b = _a.isService, isService = _b === void 0 ? true : _b;
+ var _c = props.methods, resetConfig = _c.resetConfig, updateConfig = _c.updateConfig, setValue = _c.setValue, removeItem = _c.removeItem, cleanKey = _c.cleanKey;
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(antd_1.Affix, tslib_1.__assign({ offsetTop: 64 }, { children: (0, jsx_runtime_1.jsx)(antd_1.Alert, { message: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("text", { children: ["\u60A8\u6B63\u5728\u66F4\u65B0", (0, jsx_runtime_1.jsx)(antd_1.Typography.Text, tslib_1.__assign({ keyboard: true, className: web_module_less_1.default.weight }, { children: entity })), "\u5BF9\u8C61", (0, jsx_runtime_1.jsx)(antd_1.Typography.Text, tslib_1.__assign({ keyboard: true, className: web_module_less_1.default.weight }, { children: name })), "\u7684\u914D\u7F6E\uFF0C\u8BF7\u8C28\u614E\u64CD\u4F5C"] }) }), type: "info", showIcon: true, action: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ disabled: !dirty, type: "primary", danger: true, onClick: function () { return resetConfig(); }, style: {
marginRight: 10,
} }, { children: "\u91CD\u7F6E" })), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ disabled: !dirty, type: "primary", onClick: function () { return updateConfig(); } }, { children: "\u786E\u5B9A" }))] }) }) })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: (0, jsx_runtime_1.jsx)(antd_1.Tabs, { tabPosition: "left", items: [
{
key: '参数设置',
label: '参数设置',
- children: ((0, jsx_runtime_1.jsx)(AppView, { type: type, config: currentConfig || {}, setValue: function (path, value) {
+ children: ((0, jsx_runtime_1.jsx)(AppView, { isService: isService, type: type, config: currentConfig || {}, setValue: function (path, value) {
return setValue(path, value);
}, removeItem: function (path, index) {
return removeItem(path, index);
diff --git a/lib/components/config/application/wechatPublic/index.d.ts b/lib/components/config/application/wechatPublic/index.d.ts
index 51cd047a7..10f5a622e 100644
--- a/lib/components/config/application/wechatPublic/index.d.ts
+++ b/lib/components/config/application/wechatPublic/index.d.ts
@@ -1,5 +1,6 @@
import { WechatPublicConfig } from '../../../../general-app-domain/Application/Schema';
export default function WechatPublic(props: {
+ isService?: boolean;
config: WechatPublicConfig;
setValue: (path: string, value: any) => void;
removeItem: (path: string, index: number) => void;
diff --git a/lib/components/config/application/wechatPublic/index.js b/lib/components/config/application/wechatPublic/index.js
index 44fbc0beb..940374e56 100644
--- a/lib/components/config/application/wechatPublic/index.js
+++ b/lib/components/config/application/wechatPublic/index.js
@@ -8,7 +8,7 @@ var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
function WechatPublic(props) {
var _a = tslib_1.__read((0, react_1.useState)(false), 2), open = _a[0], setModal = _a[1];
var _b = tslib_1.__read((0, react_1.useState)(''), 2), messageType = _b[0], setMessageType = _b[1];
- var config = props.config, setValue = props.setValue, cleanKey = props.cleanKey, removeItem = props.removeItem;
+ var config = props.config, setValue = props.setValue, cleanKey = props.cleanKey, removeItem = props.removeItem, _c = props.isService, isService = _c === void 0 ? true : _c;
var templateMsgs = (config === null || config === void 0 ? void 0 : config.templateMsgs) || {};
return ((0, jsx_runtime_1.jsxs)(antd_1.Space, tslib_1.__assign({ direction: "vertical", size: "middle", style: { display: 'flex' } }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Row, { children: (0, jsx_runtime_1.jsx)(antd_1.Card, tslib_1.__assign({ className: web_module_less_1.default.tips }, { children: "\u6BCF\u79CD\u5747\u53EF\u914D\u7F6E\u4E00\u4E2A\uFF0C\u76F8\u5E94\u7684\u670D\u52A1\u6240\u4F7F\u7528\u7684\u5E10\u53F7\u8BF7\u51C6\u786E\u5BF9\u5E94" })) }), (0, jsx_runtime_1.jsxs)(antd_1.Col, tslib_1.__assign({ flex: "auto" }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Divider, tslib_1.__assign({ orientation: "left", className: web_module_less_1.default.title }, { children: "\u5FAE\u4FE1\u516C\u4F17\u53F7-\u57FA\u7840" })), (0, jsx_runtime_1.jsx)(antd_1.Tabs, { tabPosition: 'top', size: 'middle', type: "card", items: [
{
@@ -18,11 +18,11 @@ function WechatPublic(props) {
return setValue("appId", e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "appSecret", name: "appSecret" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165appSecret", type: "text", value: config === null || config === void 0 ? void 0 : config.appSecret, onChange: function (e) {
return setValue("appSecret", e.target.value);
- } }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u662F\u5426\u4E3A\u670D\u52A1\u53F7", name: "isService" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Switch, { checkedChildren: "\u662F", unCheckedChildren: "\u5426", checked: config === null || config === void 0 ? void 0 : config.isService, onChange: function (checked) {
+ } }) }) })), isService && ((0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u662F\u5426\u4E3A\u670D\u52A1\u53F7", name: "isService" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Switch, { checkedChildren: "\u662F", unCheckedChildren: "\u5426", checked: config === null || config === void 0 ? void 0 : config.isService, onChange: function (checked) {
return setValue("isService", checked);
- } }) }) }))] }))),
+ } }) }) })))] }))),
},
- ] })] })), (0, jsx_runtime_1.jsxs)(antd_1.Col, tslib_1.__assign({ flex: "auto" }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Divider, tslib_1.__assign({ orientation: "left", className: web_module_less_1.default.title }, { children: "\u5FAE\u4FE1\u516C\u4F17\u53F7-\u6A21\u7248" })), (0, jsx_runtime_1.jsx)(antd_1.Tabs, { tabPosition: 'top', size: 'middle', type: "editable-card",
+ ] })] })), isService && ((0, jsx_runtime_1.jsxs)(antd_1.Col, tslib_1.__assign({ flex: "auto" }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Divider, tslib_1.__assign({ orientation: "left", className: web_module_less_1.default.title }, { children: "\u5FAE\u4FE1\u516C\u4F17\u53F7-\u6A21\u7248" })), (0, jsx_runtime_1.jsx)(antd_1.Tabs, { tabPosition: 'top', size: 'middle', type: "editable-card",
// hideAdd={!(Object.keys(templateMsgs).length > 0)}
onEdit: function (targetKey, action) {
if (action === 'add') {
@@ -38,7 +38,8 @@ function WechatPublic(props) {
key: "".concat(name),
label: "".concat(name),
children: ((0, jsx_runtime_1.jsx)(antd_1.Form, tslib_1.__assign({ colon: true, labelAlign: "left", layout: "vertical", style: { marginTop: 10 } }, { children: (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "templateId", name: "templateId" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165templateId", type: "text", value: templateId, onChange: function (e) {
- return setValue("templateMsgs.".concat(name), e.target.value);
+ return setValue("templateMsgs.".concat(name), e.target
+ .value);
} }) }) })) }))),
};
})
@@ -63,6 +64,6 @@ function WechatPublic(props) {
setMessageType('');
}, open: open, cancelText: "\u53D6\u6D88", okText: "\u786E\u5B9A", destroyOnClose: true }, { children: (0, jsx_runtime_1.jsx)(antd_1.Form, tslib_1.__assign({ colon: true, labelAlign: "left", layout: "vertical", style: { marginTop: 10 } }, { children: (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u6807\u7B7E\u540D\u79F0", name: "messageType", help: "\u53EA\u80FD\u8F93\u5165\u82F1\u6587\u548C\u4E2D\u6587" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165\u6807\u7B7E\u540D\u79F0", type: "text", value: messageType, onChange: function (e) {
return setMessageType(e.target.value.replace(/[0-9-.]/g, ''));
- } }) }) })) })) }))] }))] })));
+ } }) }) })) })) }))] })))] })));
}
exports.default = WechatPublic;
diff --git a/lib/miniprogram_npm/lin-ui/album/index.less b/lib/miniprogram_npm/lin-ui/album/index.less
index e69de29bb..558ca1aa8 100644
--- a/lib/miniprogram_npm/lin-ui/album/index.less
+++ b/lib/miniprogram_npm/lin-ui/album/index.less
@@ -0,0 +1,48 @@
+/* miniprogram_npm/lin-ui/picture-album/index.wxss */
+.container {
+ display: grid;
+}
+
+.vertical {
+ height: 360rpx;
+}
+
+.parent {
+ display: inline-grid;
+ grid-template-columns: repeat(auto-fill);
+}
+
+.child {
+ box-sizing: border-box;
+ background-color: white;
+ flex: 0 0 44%;
+ height: 100px;
+ border: 1px solid red;
+ margin-top: 4%;
+ margin-left: 2%;
+ margin-right: 2%;
+}
+
+.dimback {
+ background: #000;
+}
+
+.dim {
+ opacity: 0.6;
+ filter: alpha(opacity=60);
+}
+
+
+.imageContainer {
+ position: relative;
+}
+
+.imageContainer:last-child>.text {
+ color: white;
+ font-weight: bold;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ font-size: larger;
+}
diff --git a/lib/pages/application/upsert/web.pc.d.ts b/lib/pages/application/upsert/web.pc.d.ts
index 90a5cdac0..bdc1b84ea 100644
--- a/lib/pages/application/upsert/web.pc.d.ts
+++ b/lib/pages/application/upsert/web.pc.d.ts
@@ -3,7 +3,6 @@ import { WebComponentProps } from 'oak-frontend-base';
export default function Render(props: WebComponentProps
+declare const _default: import("react").ComponentType;
+export default _default;
diff --git a/lib/pages/subscription/config/upsert/index.js b/lib/pages/subscription/config/upsert/index.js
new file mode 100644
index 000000000..c838759be
--- /dev/null
+++ b/lib/pages/subscription/config/upsert/index.js
@@ -0,0 +1,16 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.default = OakComponent({
+ isList: false,
+ entity: 'subscription',
+ projection: {
+ id: 1,
+ name: 1,
+ config: 1,
+ },
+ formData: function (_a) {
+ var data = _a.data;
+ return data || {};
+ },
+ methods: {},
+});
diff --git a/lib/pages/subscription/config/upsert/web.module.less b/lib/pages/subscription/config/upsert/web.module.less
new file mode 100644
index 000000000..9f3d17c7f
--- /dev/null
+++ b/lib/pages/subscription/config/upsert/web.module.less
@@ -0,0 +1,6 @@
+.container {
+ background: var(--oak-bg-color-container);
+ box-shadow: 0 2px 3px #0000001a;
+ border-radius: 3px;
+ padding: 30px 32px;
+}
\ No newline at end of file
diff --git a/lib/pages/subscription/config/upsert/web.pc.d.ts b/lib/pages/subscription/config/upsert/web.pc.d.ts
new file mode 100644
index 000000000..40fe3752c
--- /dev/null
+++ b/lib/pages/subscription/config/upsert/web.pc.d.ts
@@ -0,0 +1,11 @@
+import { WechatPublicConfig } from '../../../../general-app-domain/Application/Schema';
+import { EntityDict } from '../../../../general-app-domain';
+import { WebComponentProps } from 'oak-frontend-base';
+declare type Config = WechatPublicConfig;
+export default function render(props: WebComponentProps): JSX.Element;
+export {};
diff --git a/lib/pages/subscription/config/upsert/web.pc.js b/lib/pages/subscription/config/upsert/web.pc.js
new file mode 100644
index 000000000..e225d1f54
--- /dev/null
+++ b/lib/pages/subscription/config/upsert/web.pc.js
@@ -0,0 +1,12 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tslib_1 = require("tslib");
+var jsx_runtime_1 = require("react/jsx-runtime");
+var application_1 = tslib_1.__importDefault(require("../../../../components/config/application"));
+var pageHeader_1 = tslib_1.__importDefault(require("../../../../components/common/pageHeader"));
+var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
+function render(props) {
+ var _a = props.data, oakId = _a.oakId, config = _a.config, name = _a.name;
+ return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ showBack: true, title: "\u8BA2\u9605\u53F7\u914D\u7F6E" }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: (0, jsx_runtime_1.jsx)(application_1.default, { isService: false, type: "wechatPublic", config: config, entity: "subscription", entityId: oakId, name: name }) })) })));
+}
+exports.default = render;
diff --git a/lib/pages/subscription/detail/index.d.ts b/lib/pages/subscription/detail/index.d.ts
new file mode 100644
index 000000000..42765aac1
--- /dev/null
+++ b/lib/pages/subscription/detail/index.d.ts
@@ -0,0 +1,3 @@
+///
+declare const _default: import("react").ComponentType;
+export default _default;
diff --git a/lib/pages/subscription/detail/index.js b/lib/pages/subscription/detail/index.js
new file mode 100644
index 000000000..9b7ceb6c3
--- /dev/null
+++ b/lib/pages/subscription/detail/index.js
@@ -0,0 +1,19 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.default = OakComponent({
+ isList: false,
+ entity: 'subscription',
+ projection: {
+ id: 1,
+ name: 1,
+ config: 1,
+ description: 1,
+ entity: 1,
+ entityId: 1,
+ },
+ formData: function (_a) {
+ var data = _a.data;
+ return data || {};
+ },
+ methods: {},
+});
diff --git a/lib/pages/subscription/detail/web.d.ts b/lib/pages/subscription/detail/web.d.ts
new file mode 100644
index 000000000..858e76969
--- /dev/null
+++ b/lib/pages/subscription/detail/web.d.ts
@@ -0,0 +1,16 @@
+import { WechatPublicConfig } from '../../../general-app-domain/Application/Schema';
+import { EntityDict } from '../../../general-app-domain';
+import { WebComponentProps } from 'oak-frontend-base';
+declare type Config = WechatPublicConfig;
+export default function Render(props: WebComponentProps void;
+}>): JSX.Element;
+export {};
diff --git a/lib/pages/subscription/detail/web.js b/lib/pages/subscription/detail/web.js
new file mode 100644
index 000000000..ee63eb67f
--- /dev/null
+++ b/lib/pages/subscription/detail/web.js
@@ -0,0 +1,19 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+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 web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
+function Render(props) {
+ var _a = props.data, oakId = _a.oakId, tabValue = _a.tabValue, config = _a.config, name = _a.name, description = _a.description, entity = _a.entity, entityId = _a.entityId;
+ var _b = props.methods, t = _b.t, navigateBack = _b.navigateBack, onTabClick = _b.onTabClick;
+ return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ showBack: true, title: "\u8BA2\u9605\u53F7\u6982\u89C8" }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: (0, jsx_runtime_1.jsx)(antd_1.Card, tslib_1.__assign({ title: name, bordered: false }, { children: (0, jsx_runtime_1.jsx)(antd_1.Tabs, { items: [
+ {
+ label: '订阅号概览',
+ key: 'detail',
+ children: ((0, jsx_runtime_1.jsxs)(antd_1.Descriptions, tslib_1.__assign({ column: 1, bordered: true }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: "id" }, { children: (0, jsx_runtime_1.jsx)(antd_1.Typography.Paragraph, tslib_1.__assign({ copyable: true }, { children: oakId })) })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('subscription:attr.name') }, { children: name })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('subscription:attr.description') }, { children: description }))] }))),
+ },
+ ] }) })) })) })));
+}
+exports.default = Render;
diff --git a/lib/pages/subscription/detail/web.module.less b/lib/pages/subscription/detail/web.module.less
new file mode 100644
index 000000000..9f3d17c7f
--- /dev/null
+++ b/lib/pages/subscription/detail/web.module.less
@@ -0,0 +1,6 @@
+.container {
+ background: var(--oak-bg-color-container);
+ box-shadow: 0 2px 3px #0000001a;
+ border-radius: 3px;
+ padding: 30px 32px;
+}
\ No newline at end of file
diff --git a/lib/pages/subscription/list/index.d.ts b/lib/pages/subscription/list/index.d.ts
new file mode 100644
index 000000000..42765aac1
--- /dev/null
+++ b/lib/pages/subscription/list/index.d.ts
@@ -0,0 +1,3 @@
+///
+declare const _default: import("react").ComponentType;
+export default _default;
diff --git a/lib/pages/subscription/list/index.js b/lib/pages/subscription/list/index.js
new file mode 100644
index 000000000..6f25a97be
--- /dev/null
+++ b/lib/pages/subscription/list/index.js
@@ -0,0 +1,68 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.default = OakComponent({
+ isList: true,
+ entity: 'subscription',
+ projection: {
+ id: 1,
+ name: 1,
+ description: 1,
+ config: 1,
+ entity: 1,
+ entityId: 1,
+ },
+ filters: [
+ {
+ filter: function (_a) {
+ var props = _a.props;
+ return {
+ entityId: props.entityId,
+ entity: props.entity,
+ };
+ },
+ },
+ ],
+ formData: function (_a) {
+ var data = _a.data;
+ var pagination = this.getPagination();
+ return {
+ list: data,
+ pagination: pagination,
+ };
+ },
+ data: {
+ open: false,
+ },
+ methods: {
+ goDetail: function (id) {
+ this.navigateTo({
+ url: '/subscription/detail',
+ oakId: id,
+ });
+ },
+ goUpdate: function (id) {
+ this.navigateTo({
+ url: '/subscription/upsert',
+ oakId: id,
+ });
+ },
+ goSetConfig: function (id) {
+ this.navigateTo({
+ url: '/subscription/config/upsert',
+ oakId: id,
+ });
+ },
+ goCreate: function () {
+ var _a = this.props, width = _a.width, entityId = _a.entityId, entity = _a.entity;
+ this.navigateTo({
+ url: '/subscription/upsert',
+ entityId: entityId,
+ entity: entity,
+ });
+ },
+ remove: function (id) {
+ this.removeItem(id);
+ this.execute();
+ },
+ },
+});
diff --git a/lib/pages/subscription/list/web.module.less b/lib/pages/subscription/list/web.module.less
new file mode 100644
index 000000000..9f3d17c7f
--- /dev/null
+++ b/lib/pages/subscription/list/web.module.less
@@ -0,0 +1,6 @@
+.container {
+ background: var(--oak-bg-color-container);
+ box-shadow: 0 2px 3px #0000001a;
+ border-radius: 3px;
+ padding: 30px 32px;
+}
\ No newline at end of file
diff --git a/lib/pages/subscription/list/web.pc.d.ts b/lib/pages/subscription/list/web.pc.d.ts
new file mode 100644
index 000000000..dbad0b381
--- /dev/null
+++ b/lib/pages/subscription/list/web.pc.d.ts
@@ -0,0 +1,15 @@
+import { EntityDict } from '../../../general-app-domain';
+import { WebComponentProps } from 'oak-frontend-base';
+export default function Render(props: WebComponentProps void;
+ goCreate: () => void;
+ goSetConfig: (id: string) => void;
+ goUpdate: (id: string) => void;
+ remove: (id: string) => void;
+}>): JSX.Element;
diff --git a/lib/pages/subscription/list/web.pc.js b/lib/pages/subscription/list/web.pc.js
new file mode 100644
index 000000000..80a9480d6
--- /dev/null
+++ b/lib/pages/subscription/list/web.pc.js
@@ -0,0 +1,83 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+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 web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
+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, goCreate = _d.goCreate, goDetail = _d.goDetail, goSetConfig = _d.goSetConfig, goUpdate = _d.goUpdate, remove = _d.remove;
+ return ((0, jsx_runtime_1.jsxs)(Container, tslib_1.__assign({ variant: variant }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Space, { children: (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () {
+ goCreate();
+ } }, { children: "\u6DFB\u52A0\u8BA2\u9605\u53F7" })) }), (0, jsx_runtime_1.jsx)(antd_1.Table, { loading: oakLoading, dataSource: list, rowKey: "id", columns: [
+ // {
+ // dataIndex: 'id',
+ // title: '序号',
+ // render: (value, record, index) => {
+ // return index + 1;
+ // },
+ // },
+ {
+ dataIndex: 'name',
+ title: '订阅号名称',
+ width: 300,
+ render: function (value, record, index) {
+ return ((0, jsx_runtime_1.jsx)(antd_1.Typography.Link, tslib_1.__assign({ onClick: function () {
+ goDetail(record.id);
+ } }, { children: value })));
+ },
+ },
+ {
+ dataIndex: 'description',
+ title: '描述',
+ width: 200,
+ ellipsis: true,
+ },
+ {
+ dataIndex: 'config',
+ title: '配置',
+ align: 'center',
+ render: function (value, record, index) {
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "link", onClick: function () {
+ goSetConfig(record.id);
+ } }, { children: "\u914D\u7F6E" })) }));
+ },
+ },
+ {
+ dataIndex: 'op',
+ width: 200,
+ title: '操作',
+ align: 'center',
+ render: function (value, record, index) {
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "link", onClick: function () {
+ goDetail(record.id);
+ } }, { children: "\u8BE6\u60C5" })), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "link", onClick: function () {
+ goUpdate(record.id);
+ } }, { children: "\u66F4\u65B0" })), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "link", onClick: function () {
+ remove(record.id);
+ } }, { children: "\u5220\u9664" }))] }));
+ },
+ fixed: 'right',
+ },
+ ], pagination: {
+ total: total,
+ pageSize: pageSize,
+ current: currentPage,
+ onShowSizeChange: function (pageSize) {
+ setPageSize(pageSize);
+ },
+ onChange: function (current) {
+ setCurrentPage(current);
+ },
+ } })] })));
+}
+exports.default = Render;
+function Container(props) {
+ var children = props.children, _a = props.variant, variant = _a === void 0 ? 'alone' : _a, showBack = props.showBack;
+ if (['inline', 'dialog'].includes(variant)) {
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
+ }
+ return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ showBack: showBack, title: "\u5E94\u7528\u7BA1\u7406" }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: children })) })));
+}
diff --git a/lib/pages/subscription/upsert/index.d.ts b/lib/pages/subscription/upsert/index.d.ts
new file mode 100644
index 000000000..42765aac1
--- /dev/null
+++ b/lib/pages/subscription/upsert/index.d.ts
@@ -0,0 +1,3 @@
+///
+declare const _default: import("react").ComponentType;
+export default _default;
diff --git a/lib/pages/subscription/upsert/index.js b/lib/pages/subscription/upsert/index.js
new file mode 100644
index 000000000..2594de17e
--- /dev/null
+++ b/lib/pages/subscription/upsert/index.js
@@ -0,0 +1,48 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tslib_1 = require("tslib");
+exports.default = OakComponent({
+ isList: false,
+ entity: 'subscription',
+ projection: {
+ id: 1,
+ name: 1,
+ config: 1,
+ description: 1,
+ entity: 1,
+ entityId: 1,
+ },
+ formData: function (_a) {
+ var data = _a.data;
+ return data || {};
+ },
+ data: {},
+ lifetimes: {
+ ready: function () {
+ var _a = this.props, entityId = _a.entityId, entity = _a.entity, oakId = _a.oakId;
+ if (!oakId) {
+ if (entityId) {
+ this.update({
+ entityId: entityId,
+ entity: entity,
+ });
+ }
+ }
+ },
+ },
+ methods: {
+ confirm: function () {
+ 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.execute()];
+ case 1:
+ _a.sent();
+ this.navigateBack();
+ return [2 /*return*/];
+ }
+ });
+ });
+ },
+ },
+});
diff --git a/lib/pages/subscription/upsert/web.module.less b/lib/pages/subscription/upsert/web.module.less
new file mode 100644
index 000000000..9f3d17c7f
--- /dev/null
+++ b/lib/pages/subscription/upsert/web.module.less
@@ -0,0 +1,6 @@
+.container {
+ background: var(--oak-bg-color-container);
+ box-shadow: 0 2px 3px #0000001a;
+ border-radius: 3px;
+ padding: 30px 32px;
+}
\ No newline at end of file
diff --git a/lib/pages/subscription/upsert/web.pc.d.ts b/lib/pages/subscription/upsert/web.pc.d.ts
new file mode 100644
index 000000000..caf5cf5b4
--- /dev/null
+++ b/lib/pages/subscription/upsert/web.pc.d.ts
@@ -0,0 +1,13 @@
+import { EntityDict } from '../../../general-app-domain';
+import { WebComponentProps } from 'oak-frontend-base';
+export default function Render(props: WebComponentProps void;
+}>): JSX.Element;
diff --git a/lib/pages/subscription/upsert/web.pc.js b/lib/pages/subscription/upsert/web.pc.js
new file mode 100644
index 000000000..d22fdc9ea
--- /dev/null
+++ b/lib/pages/subscription/upsert/web.pc.js
@@ -0,0 +1,43 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+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 web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
+function Render(props) {
+ var _a = props.data, name = _a.name, description = _a.description, variant = _a.variant, _b = _a.showBack, showBack = _b === void 0 ? true : _b, entityId = _a.entityId, entity = _a.entity, oakId = _a.oakId;
+ var _c = props.methods, t = _c.t, update = _c.update, navigateBack = _c.navigateBack, confirm = _c.confirm;
+ return ((0, jsx_runtime_1.jsx)(Container, tslib_1.__assign({ variant: variant, showBack: showBack }, { children: (0, jsx_runtime_1.jsx)(antd_1.Row, { children: (0, jsx_runtime_1.jsx)(antd_1.Col, tslib_1.__assign({ xs: 24, sm: 12 }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: true, labelCol: { span: 6 }, wrapperCol: { span: 16 } }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u540D\u79F0", requiredMark: true, name: "name", rules: [
+ {
+ required: true,
+ },
+ ] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { onChange: function (e) {
+ update({
+ 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)(antd_1.Input.TextArea, { onChange: function (e) {
+ update({
+ description: e.target.value,
+ });
+ }, value: description }) }) })), (0, jsx_runtime_1.jsx)(Action, tslib_1.__assign({ variant: variant }, { children: (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 6 } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () {
+ confirm();
+ } }, { children: "\u786E\u5B9A" })), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ onClick: function () {
+ navigateBack();
+ } }, { children: "\u8FD4\u56DE" }))] }) })) }))] })) })) }) })));
+}
+exports.default = Render;
+function Action(props) {
+ var children = props.children, variant = props.variant;
+ if (variant === 'dialog') {
+ return null;
+ }
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }));
+}
+function Container(props) {
+ var children = props.children, variant = props.variant, showBack = props.showBack;
+ if (variant === 'inline' || variant === 'dialog') {
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
+ }
+ return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ showBack: showBack, title: "\u8BA2\u9605\u53F7\u7F16\u8F91" }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: children })) })));
+}
diff --git a/src/components/config/application/web.pc.tsx b/src/components/config/application/web.pc.tsx
index aa5b3c1d4..9bce878e0 100644
--- a/src/components/config/application/web.pc.tsx
+++ b/src/components/config/application/web.pc.tsx
@@ -18,13 +18,14 @@ import { WebComponentProps } from 'oak-frontend-base';
type Config = WebConfig | WechatPublicConfig | WechatMpConfig;
function AppView(props: {
+ isService?: boolean;
type: AppType;
config: Config;
setValue: (path: string, value: string) => void;
removeItem: (path: string, index: number) => void;
cleanKey: (path: string, key: string) => void;
}) {
- const { type, config, setValue, removeItem, cleanKey } = props;
+ const { type, config, setValue, removeItem, cleanKey, isService } = props;
if (type === 'web') {
return (
setValue(path, value)}
removeItem={(path, index) => removeItem(path, index)}
@@ -69,6 +71,7 @@ export default function render(
currentConfig: Config;
dirty: boolean;
type: AppType;
+ isService?: boolean; //只对type为wechatPublic有效 默认配置服务号
},
{
resetConfig: () => void;
@@ -79,7 +82,14 @@ export default function render(
}
>
) {
- const { entity, name, type, currentConfig, dirty } = props.data;
+ const {
+ entity,
+ name,
+ type,
+ currentConfig,
+ dirty,
+ isService = true,
+ } = props.data;
const { resetConfig, updateConfig, setValue, removeItem, cleanKey } =
props.methods;
@@ -143,6 +153,7 @@ export default function render(
label: '参数设置',
children: (
diff --git a/src/components/config/application/wechatPublic/index.tsx b/src/components/config/application/wechatPublic/index.tsx
index 1127e4a52..2ec31c06b 100644
--- a/src/components/config/application/wechatPublic/index.tsx
+++ b/src/components/config/application/wechatPublic/index.tsx
@@ -24,6 +24,7 @@ import {
export default function WechatPublic(props: {
+ isService?: boolean;
config: WechatPublicConfig;
setValue: (path: string, value: any) => void;
removeItem: (path: string, index: number) => void;
@@ -32,7 +33,7 @@ export default function WechatPublic(props: {
const [open, setModal] = useState(false);
const [messageType, setMessageType] = useState('');
- const { config, setValue, cleanKey, removeItem } = props;
+ const { config, setValue, cleanKey, removeItem, isService = true } = props;
const templateMsgs = config?.templateMsgs || {};
return (
@@ -93,139 +94,150 @@ export default function WechatPublic(props: {
/>
>
-
- <>
-
- setValue(
- `isService`,
- checked
- )
- }
- />
- >
-
+ {isService && (
+
+ <>
+
+ setValue(
+ `isService`,
+ checked
+ )
+ }
+ />
+ >
+
+ )}
),
},
]}
>
-
-
- 微信公众号-模版
-
- 0)}
- onEdit={(targetKey: any, action: 'add' | 'remove') => {
- if (action === 'add') {
- setModal(true);
- } else {
- cleanKey(`templateMsgs`, targetKey);
- }
- }}
- items={
- Object.keys(templateMsgs).length > 0
- ? Object.keys(templateMsgs).map((name, idx) => {
- const templateId = templateMsgs[name];
- return {
- key: `${name}`,
- label: `${name}`,
- children: (
-
+
+ 微信公众号-模版
+
+ 0)}
+ onEdit={(targetKey: any, action: 'add' | 'remove') => {
+ if (action === 'add') {
+ setModal(true);
+ } else {
+ cleanKey(`templateMsgs`, targetKey);
+ }
+ }}
+ items={
+ Object.keys(templateMsgs).length > 0
+ ? Object.keys(templateMsgs).map((name, idx) => {
+ const templateId = templateMsgs[name];
+ return {
+ key: `${name}`,
+ label: `${name}`,
+ children: (
+
-
- ),
- };
- })
- : []
- }
- >
- {
- setModal(false);
- setMessageType('');
- }}
- onOk={() => {
- if (!messageType) {
- message.error({
- content: '请输入标签名称',
- });
- return;
+
+ <>
+
+ setValue(
+ `templateMsgs.${name}`,
+ e.target
+ .value
+ )
+ }
+ />
+ >
+
+
+ ),
+ };
+ })
+ : []
}
- if (Object.keys(templateMsgs).includes(messageType)) {
- message.error({
- content: '已存在相同的标签名,请重新输入',
- });
- return;
- }
- setValue(`templateMsgs.${messageType}`, '');
- setModal(false);
- setMessageType('');
- }}
- open={open}
- cancelText="取消"
- okText="确定"
- destroyOnClose={true}
- >
-
-
-
+ }
+ />
+ >
+
+
+
+
+ )}
);
}
\ No newline at end of file
diff --git a/src/pages/application/upsert/web.pc.tsx b/src/pages/application/upsert/web.pc.tsx
index a2e63ab43..de66f6e63 100644
--- a/src/pages/application/upsert/web.pc.tsx
+++ b/src/pages/application/upsert/web.pc.tsx
@@ -15,7 +15,6 @@ export default function Render(
{
name: string;
description: string;
- super: string;
variant: 'inline' | 'alone' | 'dialog';
showBack: boolean;
type: EntityDict['application']['Schema']['type'];
diff --git a/src/pages/subscription/config/upsert/index.ts b/src/pages/subscription/config/upsert/index.ts
new file mode 100644
index 000000000..9eb1d7a07
--- /dev/null
+++ b/src/pages/subscription/config/upsert/index.ts
@@ -0,0 +1,13 @@
+export default OakComponent({
+ isList: false,
+ entity: 'subscription',
+ projection: {
+ id: 1,
+ name: 1,
+ config: 1,
+ },
+ formData({ data }) {
+ return data || {};
+ },
+ methods: {},
+});
diff --git a/src/pages/subscription/config/upsert/web.module.less b/src/pages/subscription/config/upsert/web.module.less
new file mode 100644
index 000000000..9f3d17c7f
--- /dev/null
+++ b/src/pages/subscription/config/upsert/web.module.less
@@ -0,0 +1,6 @@
+.container {
+ background: var(--oak-bg-color-container);
+ box-shadow: 0 2px 3px #0000001a;
+ border-radius: 3px;
+ padding: 30px 32px;
+}
\ No newline at end of file
diff --git a/src/pages/subscription/config/upsert/web.pc.tsx b/src/pages/subscription/config/upsert/web.pc.tsx
new file mode 100644
index 000000000..c7e6d02cf
--- /dev/null
+++ b/src/pages/subscription/config/upsert/web.pc.tsx
@@ -0,0 +1,43 @@
+import React from 'react';
+import ConfigUpsert from '../../../../components/config/application';
+import PageHeader from '../../../../components/common/pageHeader';
+
+import Style from './web.module.less';
+
+import { WechatPublicConfig } from '../../../../general-app-domain/Application/Schema';
+
+import { EntityDict } from '../../../../general-app-domain';
+import { WebComponentProps } from 'oak-frontend-base';
+
+type Config = WechatPublicConfig;
+
+export default function render(
+ props: WebComponentProps<
+ EntityDict,
+ 'application',
+ false,
+ {
+ name: string;
+ description: string;
+ oakId: string;
+ config: Config;
+ },
+ {}
+ >
+) {
+ const { oakId, config, name } = props.data;
+ return (
+
+
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/src/pages/subscription/detail/index.ts b/src/pages/subscription/detail/index.ts
new file mode 100644
index 000000000..4f04303f6
--- /dev/null
+++ b/src/pages/subscription/detail/index.ts
@@ -0,0 +1,16 @@
+export default OakComponent({
+ isList: false,
+ entity: 'subscription',
+ projection: {
+ id: 1,
+ name: 1,
+ config: 1,
+ description: 1,
+ entity: 1,
+ entityId: 1,
+ },
+ formData({ data }) {
+ return data || {};
+ },
+ methods: {},
+});
diff --git a/src/pages/subscription/detail/web.module.less b/src/pages/subscription/detail/web.module.less
new file mode 100644
index 000000000..9f3d17c7f
--- /dev/null
+++ b/src/pages/subscription/detail/web.module.less
@@ -0,0 +1,6 @@
+.container {
+ background: var(--oak-bg-color-container);
+ box-shadow: 0 2px 3px #0000001a;
+ border-radius: 3px;
+ padding: 30px 32px;
+}
\ No newline at end of file
diff --git a/src/pages/subscription/detail/web.tsx b/src/pages/subscription/detail/web.tsx
new file mode 100644
index 000000000..ecf73a606
--- /dev/null
+++ b/src/pages/subscription/detail/web.tsx
@@ -0,0 +1,76 @@
+import React from 'react';
+import { Tabs, Card, Descriptions, Typography } from 'antd';
+import PageHeader from '../../../components/common/pageHeader';
+import Style from './web.module.less';
+
+import {
+ WechatPublicConfig,
+} from '../../../general-app-domain/Application/Schema';
+
+import { EntityDict } from '../../../general-app-domain';
+import { WebComponentProps } from 'oak-frontend-base';
+
+type Config = WechatPublicConfig;
+
+export default function Render(
+ props: WebComponentProps<
+ EntityDict,
+ 'subscription',
+ false,
+ {
+ name: string;
+ description: string;
+ oakId: string;
+ config: Config;
+ entity: string;
+ entityId: string;
+ tabValue: 'detail';
+ },
+ {
+ onTabClick: (key: string) => void;
+ }
+ >
+) {
+ const { oakId, tabValue, config, name, description, entity, entityId } =
+ props.data;
+ const { t, navigateBack, onTabClick } = props.methods;
+
+ return (
+
+
+
+
+
+
+ {oakId}
+
+
+
+ {name}
+
+
+ {description}
+
+
+
+ ),
+ },
+ ]}
+ />
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/src/pages/subscription/list/index.ts b/src/pages/subscription/list/index.ts
new file mode 100644
index 000000000..52de07c26
--- /dev/null
+++ b/src/pages/subscription/list/index.ts
@@ -0,0 +1,64 @@
+export default OakComponent({
+ isList: true,
+ entity: 'subscription',
+ projection: {
+ id: 1,
+ name: 1,
+ description: 1,
+ config: 1,
+ entity: 1,
+ entityId: 1,
+ },
+ filters: [
+ {
+ filter: ({ props }) => {
+ return {
+ entityId: props.entityId,
+ entity: props.entity,
+ };
+ },
+ },
+ ],
+ formData({ data }) {
+ const pagination = this.getPagination();
+ return {
+ list: data,
+ pagination,
+ };
+ },
+ data: {
+ open: false,
+ },
+ methods: {
+ goDetail(id: string) {
+ this.navigateTo({
+ url: '/subscription/detail',
+ oakId: id,
+ });
+ },
+ goUpdate(id: string) {
+ this.navigateTo({
+ url: '/subscription/upsert',
+ oakId: id,
+ });
+ },
+ goSetConfig(id: string) {
+ this.navigateTo({
+ url: '/subscription/config/upsert',
+ oakId: id,
+ });
+ },
+ goCreate() {
+ const { width, entityId, entity } = this.props;
+ this.navigateTo({
+ url: '/subscription/upsert',
+ entityId,
+ entity,
+ });
+ },
+ remove(id: string) {
+ this.removeItem(id);
+ this.execute();
+ },
+ },
+});
diff --git a/src/pages/subscription/list/web.module.less b/src/pages/subscription/list/web.module.less
new file mode 100644
index 000000000..9f3d17c7f
--- /dev/null
+++ b/src/pages/subscription/list/web.module.less
@@ -0,0 +1,6 @@
+.container {
+ background: var(--oak-bg-color-container);
+ box-shadow: 0 2px 3px #0000001a;
+ border-radius: 3px;
+ padding: 30px 32px;
+}
\ No newline at end of file
diff --git a/src/pages/subscription/list/web.pc.tsx b/src/pages/subscription/list/web.pc.tsx
new file mode 100644
index 000000000..99ccfaec1
--- /dev/null
+++ b/src/pages/subscription/list/web.pc.tsx
@@ -0,0 +1,186 @@
+import * as React from 'react';
+import { Table, Button, Space, Typography, Modal } from 'antd';
+import PageHeader from '../../../components/common/pageHeader';
+
+import Style from './web.module.less';
+import { EntityDict } from '../../../general-app-domain';
+import { WebComponentProps } from 'oak-frontend-base';
+
+export default function Render(
+ props: WebComponentProps<
+ EntityDict,
+ 'subscription',
+ true,
+ {
+ searchValue: string;
+ list: EntityDict['subscription']['Schema'][];
+ pagination: any;
+ showBack: boolean;
+ variant?: 'inline' | 'alone' | 'dialog';
+ },
+ {
+ goDetail: (id: string) => void;
+ goCreate: () => void;
+ goSetConfig: (id: string) => void;
+ goUpdate: (id: string) => void;
+ remove: (id: string) => void;
+ }
+ >
+) {
+ const {
+ pagination,
+ list = [],
+ oakLoading,
+ showBack,
+ variant,
+ oakFullpath,
+ } = props.data;
+
+ const { pageSize, total, currentPage } = pagination || {};
+
+ const {
+ t,
+ setPageSize,
+ setCurrentPage,
+ goCreate,
+ goDetail,
+ goSetConfig,
+ goUpdate,
+ remove,
+ } = props.methods;
+
+ return (
+
+
+
+
+
+ {
+ // return index + 1;
+ // },
+ // },
+ {
+ dataIndex: 'name',
+ title: '订阅号名称',
+ width: 300,
+ render: (value, record, index) => {
+ return (
+ {
+ goDetail(record.id);
+ }}
+ >
+ {value}
+
+ );
+ },
+ },
+ {
+ dataIndex: 'description',
+ title: '描述',
+ width: 200,
+ ellipsis: true,
+ },
+ {
+ dataIndex: 'config',
+ title: '配置',
+ align: 'center',
+ render: (value, record, index) => {
+ return (
+ <>
+
+ >
+ );
+ },
+ },
+ {
+ dataIndex: 'op',
+ width: 200,
+ title: '操作',
+ align: 'center',
+ render: (value, record, index) => {
+ return (
+ <>
+
+
+
+ >
+ );
+ },
+ fixed: 'right',
+ },
+ ]}
+ pagination={{
+ total,
+ pageSize,
+ current: currentPage,
+ onShowSizeChange: (pageSize: number) => {
+ setPageSize(pageSize);
+ },
+ onChange: (current: number) => {
+ setCurrentPage(current);
+ },
+ }}
+ />
+
+ );
+}
+
+function Container(props: {
+ children: React.ReactNode;
+ variant?: 'inline' | 'alone' | 'dialog';
+ showBack?: boolean;
+}) {
+ const { children, variant = 'alone', showBack } = props;
+ if (['inline', 'dialog'].includes(variant)) {
+ return <>{children}>;
+ }
+ return (
+
+ {children}
+
+ );
+}
diff --git a/src/pages/subscription/upsert/index.ts b/src/pages/subscription/upsert/index.ts
new file mode 100644
index 000000000..3c435e547
--- /dev/null
+++ b/src/pages/subscription/upsert/index.ts
@@ -0,0 +1,39 @@
+
+
+export default OakComponent({
+ isList: false,
+ entity: 'subscription',
+ projection: {
+ id: 1,
+ name: 1,
+ config: 1,
+ description: 1,
+ entity: 1,
+ entityId: 1,
+ },
+ formData({ data }) {
+ return data || {};
+ },
+ data: {
+ },
+ lifetimes: {
+ ready() {
+ const { entityId, entity, oakId } = this.props;
+
+ if (!oakId) {
+ if (entityId) {
+ this.update({
+ entityId,
+ entity,
+ });
+ }
+ }
+ },
+ },
+ methods: {
+ async confirm() {
+ await this.execute();
+ this.navigateBack();
+ },
+ },
+});
diff --git a/src/pages/subscription/upsert/web.module.less b/src/pages/subscription/upsert/web.module.less
new file mode 100644
index 000000000..9f3d17c7f
--- /dev/null
+++ b/src/pages/subscription/upsert/web.module.less
@@ -0,0 +1,6 @@
+.container {
+ background: var(--oak-bg-color-container);
+ box-shadow: 0 2px 3px #0000001a;
+ border-radius: 3px;
+ padding: 30px 32px;
+}
\ No newline at end of file
diff --git a/src/pages/subscription/upsert/web.pc.tsx b/src/pages/subscription/upsert/web.pc.tsx
new file mode 100644
index 000000000..b6556ee6f
--- /dev/null
+++ b/src/pages/subscription/upsert/web.pc.tsx
@@ -0,0 +1,136 @@
+import React from 'react';
+import { Button, Form, Row, Col, Select, Space, Input } from 'antd';
+import PageHeader from '../../../components/common/pageHeader';
+import Style from './web.module.less';
+
+import { EntityDict } from '../../../general-app-domain';
+import { WebComponentProps } from 'oak-frontend-base';
+
+export default function Render(
+ props: WebComponentProps<
+ EntityDict,
+ 'subscription',
+ false,
+ {
+ name: string;
+ description: string;
+ variant: 'inline' | 'alone' | 'dialog';
+ showBack: boolean;
+ entity: string;
+ entityId: string;
+ oakId: string;
+ },
+ {
+ confirm: () => void;
+ }
+ >
+) {
+ const {
+ name,
+ description,
+ variant,
+ showBack = true,
+ entityId,
+ entity,
+ oakId,
+ } = props.data;
+ const { t, update, navigateBack, confirm } = props.methods;
+ return (
+
+
+
+
+ <>
+ {
+ update({
+ name: e.target.value,
+ });
+ }}
+ value={name}
+ />
+ >
+
+
+ <>
+ {
+ update({
+ description: e.target.value,
+ });
+ }}
+ value={description}
+ />
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
+
+function Action(props: {
+ children: React.ReactNode;
+ variant?: 'inline' | 'alone' | 'dialog';
+}) {
+ const { children, variant } = props;
+ if (variant === 'dialog') {
+ return null;
+ }
+ return (
+ <>{children}>
+ )
+}
+
+function Container(props: {
+ children: React.ReactNode;
+ variant?: 'inline' | 'alone' | 'dialog';
+ showBack?: boolean;
+}) {
+ const { children, variant, showBack } = props;
+ if (variant === 'inline' || variant === 'dialog') {
+ return <>{children}>;
+ }
+ return (
+
+ {children}
+
+ );
+}
From 0b4813ffa6e3628dd79adbcdc6ee8c3e6b7008f0 Mon Sep 17 00:00:00 2001
From: wkj <278599135@qq.com>
Date: Thu, 22 Dec 2022 11:31:44 +0800
Subject: [PATCH 7/8] =?UTF-8?q?message=20=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/components/message/cell/index.d.ts | 3 +
lib/components/message/cell/index.js | 27 +++
lib/components/message/cell/web.d.ts | 14 ++
lib/components/message/cell/web.js | 33 ++++
lib/components/message/cell/web.module.less | 46 +++++
lib/components/message/cellButton/index.d.ts | 3 +
lib/components/message/cellButton/index.js | 32 ++++
lib/components/message/cellButton/web.d.ts | 5 +
lib/components/message/cellButton/web.js | 29 ++++
.../message/cellButton/web.module.less | 0
lib/pages/message/detail/index.d.ts | 3 +
lib/pages/message/detail/index.js | 48 ++++++
lib/pages/message/detail/index.json | 4 +
lib/pages/message/detail/mobile.module.less | 32 ++++
lib/pages/message/detail/web.d.ts | 13 ++
lib/pages/message/detail/web.js | 16 ++
lib/pages/message/detail/web.module.less | 46 +++++
lib/pages/message/detail/web.pc.d.ts | 13 ++
lib/pages/message/detail/web.pc.js | 17 ++
lib/pages/message/drawerList/index.d.ts | 3 +
lib/pages/message/drawerList/index.js | 69 ++++++++
lib/pages/message/drawerList/index.json | 4 +
lib/pages/message/drawerList/web.d.ts | 10 ++
lib/pages/message/drawerList/web.js | 26 +++
lib/pages/message/drawerList/web.module.less | 6 +
lib/pages/message/list/index.d.ts | 3 +
lib/pages/message/list/index.js | 64 +++++++
lib/pages/message/list/index.json | 4 +
lib/pages/message/list/mobile.module.less | 6 +
lib/pages/message/list/web.d.ts | 7 +
lib/pages/message/list/web.js | 18 ++
lib/pages/message/list/web.module.less | 7 +
lib/pages/message/list/web.pc.d.ts | 12 ++
lib/pages/message/list/web.pc.js | 88 ++++++++++
src/components/message/cell/index.ts | 24 +++
src/components/message/cell/web.module.less | 46 +++++
src/components/message/cell/web.tsx | 107 ++++++++++++
src/components/message/cellButton/index.ts | 22 +++
.../message/cellButton/web.module.less | 0
src/components/message/cellButton/web.tsx | 46 +++++
src/pages/message/detail/index.json | 4 +
src/pages/message/detail/index.ts | 52 ++++++
src/pages/message/detail/mobile.module.less | 32 ++++
src/pages/message/detail/web.module.less | 46 +++++
src/pages/message/detail/web.pc.tsx | 61 +++++++
src/pages/message/detail/web.tsx | 54 ++++++
src/pages/message/drawerList/index.json | 4 +
src/pages/message/drawerList/index.ts | 67 ++++++++
src/pages/message/drawerList/web.module.less | 6 +
src/pages/message/drawerList/web.tsx | 92 ++++++++++
src/pages/message/list/index.json | 4 +
src/pages/message/list/index.ts | 62 +++++++
src/pages/message/list/mobile.module.less | 6 +
src/pages/message/list/web.module.less | 7 +
src/pages/message/list/web.pc.tsx | 161 ++++++++++++++++++
src/pages/message/list/web.tsx | 57 +++++++
56 files changed, 1671 insertions(+)
create mode 100644 lib/components/message/cell/index.d.ts
create mode 100644 lib/components/message/cell/index.js
create mode 100644 lib/components/message/cell/web.d.ts
create mode 100644 lib/components/message/cell/web.js
create mode 100644 lib/components/message/cell/web.module.less
create mode 100644 lib/components/message/cellButton/index.d.ts
create mode 100644 lib/components/message/cellButton/index.js
create mode 100644 lib/components/message/cellButton/web.d.ts
create mode 100644 lib/components/message/cellButton/web.js
create mode 100644 lib/components/message/cellButton/web.module.less
create mode 100644 lib/pages/message/detail/index.d.ts
create mode 100644 lib/pages/message/detail/index.js
create mode 100644 lib/pages/message/detail/index.json
create mode 100644 lib/pages/message/detail/mobile.module.less
create mode 100644 lib/pages/message/detail/web.d.ts
create mode 100644 lib/pages/message/detail/web.js
create mode 100644 lib/pages/message/detail/web.module.less
create mode 100644 lib/pages/message/detail/web.pc.d.ts
create mode 100644 lib/pages/message/detail/web.pc.js
create mode 100644 lib/pages/message/drawerList/index.d.ts
create mode 100644 lib/pages/message/drawerList/index.js
create mode 100644 lib/pages/message/drawerList/index.json
create mode 100644 lib/pages/message/drawerList/web.d.ts
create mode 100644 lib/pages/message/drawerList/web.js
create mode 100644 lib/pages/message/drawerList/web.module.less
create mode 100644 lib/pages/message/list/index.d.ts
create mode 100644 lib/pages/message/list/index.js
create mode 100644 lib/pages/message/list/index.json
create mode 100644 lib/pages/message/list/mobile.module.less
create mode 100644 lib/pages/message/list/web.d.ts
create mode 100644 lib/pages/message/list/web.js
create mode 100644 lib/pages/message/list/web.module.less
create mode 100644 lib/pages/message/list/web.pc.d.ts
create mode 100644 lib/pages/message/list/web.pc.js
create mode 100644 src/components/message/cell/index.ts
create mode 100644 src/components/message/cell/web.module.less
create mode 100644 src/components/message/cell/web.tsx
create mode 100644 src/components/message/cellButton/index.ts
create mode 100644 src/components/message/cellButton/web.module.less
create mode 100644 src/components/message/cellButton/web.tsx
create mode 100644 src/pages/message/detail/index.json
create mode 100644 src/pages/message/detail/index.ts
create mode 100644 src/pages/message/detail/mobile.module.less
create mode 100644 src/pages/message/detail/web.module.less
create mode 100644 src/pages/message/detail/web.pc.tsx
create mode 100644 src/pages/message/detail/web.tsx
create mode 100644 src/pages/message/drawerList/index.json
create mode 100644 src/pages/message/drawerList/index.ts
create mode 100644 src/pages/message/drawerList/web.module.less
create mode 100644 src/pages/message/drawerList/web.tsx
create mode 100644 src/pages/message/list/index.json
create mode 100644 src/pages/message/list/index.ts
create mode 100644 src/pages/message/list/mobile.module.less
create mode 100644 src/pages/message/list/web.module.less
create mode 100644 src/pages/message/list/web.pc.tsx
create mode 100644 src/pages/message/list/web.tsx
diff --git a/lib/components/message/cell/index.d.ts b/lib/components/message/cell/index.d.ts
new file mode 100644
index 000000000..42765aac1
--- /dev/null
+++ b/lib/components/message/cell/index.d.ts
@@ -0,0 +1,3 @@
+///
+declare const _default: import("react").ComponentType;
+export default _default;
diff --git a/lib/components/message/cell/index.js b/lib/components/message/cell/index.js
new file mode 100644
index 000000000..f484b5152
--- /dev/null
+++ b/lib/components/message/cell/index.js
@@ -0,0 +1,27 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.default = OakComponent({
+ isList: false,
+ entity: 'message',
+ projection: {
+ id: 1,
+ $$createAt$$: 1,
+ type: 1,
+ title: 1,
+ content: 1,
+ visitState: 1,
+ userId: 1,
+ user: {
+ id: 1,
+ name: 1,
+ },
+ params: 1,
+ props: 1,
+ },
+ formData: function (_a) {
+ var message = _a.data, features = _a.features, props = _a.props;
+ return message || {};
+ },
+ methods: {},
+ actions: ['visit'],
+});
diff --git a/lib/components/message/cell/web.d.ts b/lib/components/message/cell/web.d.ts
new file mode 100644
index 000000000..cd388ec18
--- /dev/null
+++ b/lib/components/message/cell/web.d.ts
@@ -0,0 +1,14 @@
+import { WebComponentProps } from 'oak-frontend-base';
+import { EntityDict } from '../../../general-app-domain';
+export default function Render(props: WebComponentProps void;
+ $$createAt$$: number;
+ type: string;
+ title: string;
+ params: EntityDict['message']['Schema']['params'];
+ visitState: EntityDict['message']['Schema']['visitState'];
+ id: string;
+}, {}>): JSX.Element;
diff --git a/lib/components/message/cell/web.js b/lib/components/message/cell/web.js
new file mode 100644
index 000000000..48993f5c0
--- /dev/null
+++ b/lib/components/message/cell/web.js
@@ -0,0 +1,33 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tslib_1 = require("tslib");
+var jsx_runtime_1 = require("react/jsx-runtime");
+var antd_1 = require("antd");
+var dayjs_1 = tslib_1.__importDefault(require("dayjs"));
+var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
+var MessageType = {
+ adminNotification: '系统通知',
+ conversationMessage: '客服消息',
+};
+// success、 processing、error、default、warning
+var MessageTypeToColor = {
+ adminNotification: 'processing',
+ conversationMessage: 'warning',
+};
+function Render(props) {
+ var data = props.data, methods = props.methods;
+ var id = data.id, params = data.params, title = data.title, type = data.type, $$createAt$$ = data.$$createAt$$, visitState = data.visitState, _a = data.oakLegalActions, oakLegalActions = _a === void 0 ? [] : _a, onItemClicked = data.onItemClicked;
+ var navigateTo = methods.navigateTo, execute = methods.execute;
+ return ((0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: web_module_less_1.default.list, onClick: onItemClicked
+ ? function () {
+ onItemClicked({
+ id: id,
+ params: params,
+ });
+ }
+ : undefined }, { children: [(0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: web_module_less_1.default.list__notify }, { children: [visitState === 'unvisited' && ((0, jsx_runtime_1.jsx)(antd_1.Badge, { style: { marginRight: 5 }, status: "processing" })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.notify_deadline }, { children: title })), oakLegalActions.includes('visit') && ((0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.notify_mask, onClick: function (event) {
+ execute('visit', false);
+ event.stopPropagation();
+ } }, { children: "\u6807\u8BB0\u5DF2\u8BFB" })))] })), (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: web_module_less_1.default.list__info }, { children: [(0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.tags }, { children: (0, jsx_runtime_1.jsx)(antd_1.Tag, tslib_1.__assign({ color: MessageTypeToColor[type] }, { children: MessageType[type] })) })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.create_time }, { children: (0, dayjs_1.default)($$createAt$$).format('YYYY-MM-DD HH:mm:ss') }))] }))] })));
+}
+exports.default = Render;
diff --git a/lib/components/message/cell/web.module.less b/lib/components/message/cell/web.module.less
new file mode 100644
index 000000000..8e3a0e282
--- /dev/null
+++ b/lib/components/message/cell/web.module.less
@@ -0,0 +1,46 @@
+.list {
+ padding: 10px 20px 10px 31px;
+ border-bottom: 1px solid #ddd;
+ cursor: pointer;
+ position: relative;
+}
+
+.list__notify {
+ margin-bottom: 5px;
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+
+ .notify_mask {
+ // display: none;
+ color: var(--oak-color-primary);
+ flex-grow: 0;
+ flex-shrink: 0;
+ white-space: nowrap;
+ font-size: 12px;
+ }
+
+ .notify_deadline {
+ color: #000;
+ font-weight: 600;
+ line-height: 20px;
+ flex: 1 1 auto;
+ min-width: 20px;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+ }
+}
+
+.list__info {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+
+
+ .create_time {
+ color: rgba(0, 0, 0, .4);
+ line-height: 20px;
+ font-size: 12px;
+ }
+}
\ No newline at end of file
diff --git a/lib/components/message/cellButton/index.d.ts b/lib/components/message/cellButton/index.d.ts
new file mode 100644
index 000000000..42765aac1
--- /dev/null
+++ b/lib/components/message/cellButton/index.d.ts
@@ -0,0 +1,3 @@
+///
+declare const _default: import("react").ComponentType;
+export default _default;
diff --git a/lib/components/message/cellButton/index.js b/lib/components/message/cellButton/index.js
new file mode 100644
index 000000000..0b552b395
--- /dev/null
+++ b/lib/components/message/cellButton/index.js
@@ -0,0 +1,32 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tslib_1 = require("tslib");
+exports.default = OakComponent({
+ entity: 'message',
+ isList: false,
+ formData: function (_a) {
+ var data = _a.data;
+ return {};
+ },
+ actions: ['visit'],
+ 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 'visit': {
+ this.execute('visit', false);
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ return [2 /*return*/];
+ });
+ });
+ },
+ },
+});
diff --git a/lib/components/message/cellButton/web.d.ts b/lib/components/message/cellButton/web.d.ts
new file mode 100644
index 000000000..416690e8d
--- /dev/null
+++ b/lib/components/message/cellButton/web.d.ts
@@ -0,0 +1,5 @@
+import { WebComponentProps } from 'oak-frontend-base';
+import { EntityDict } from '../../../general-app-domain';
+export default function Render(props: WebComponentProps void;
+}>): JSX.Element[] | null;
diff --git a/lib/components/message/cellButton/web.js b/lib/components/message/cellButton/web.js
new file mode 100644
index 000000000..110bfedfa
--- /dev/null
+++ b/lib/components/message/cellButton/web.js
@@ -0,0 +1,29 @@
+"use strict";
+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(props) {
+ var data = props.data, methods = props.methods;
+ var t = methods.t, tapAction = methods.tapAction;
+ var oakLegalActions = data.oakLegalActions;
+ return oakLegalActions && (oakLegalActions === null || oakLegalActions === void 0 ? void 0 : oakLegalActions.length) > 0
+ ? oakLegalActions.map(function (ele) {
+ return ((0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "link", onClick: function (event) {
+ var modal = antd_1.Modal.confirm({
+ title: "\u786E\u8BA4\u8BE5\u6D88\u606F\u6807\u4E3A\u5DF2\u8BFB\u5417\uFF1F",
+ okText: '确定',
+ cancelText: '取消',
+ onOk: function (e) {
+ tapAction(ele);
+ modal.destroy();
+ },
+ onCancel: function (e) {
+ modal.destroy();
+ },
+ });
+ } }, { children: "\u6807\u4E3A\u5DF2\u8BFB" })));
+ })
+ : null;
+}
+exports.default = Render;
diff --git a/lib/components/message/cellButton/web.module.less b/lib/components/message/cellButton/web.module.less
new file mode 100644
index 000000000..e69de29bb
diff --git a/lib/pages/message/detail/index.d.ts b/lib/pages/message/detail/index.d.ts
new file mode 100644
index 000000000..42765aac1
--- /dev/null
+++ b/lib/pages/message/detail/index.d.ts
@@ -0,0 +1,3 @@
+///
+declare const _default: import("react").ComponentType;
+export default _default;
diff --git a/lib/pages/message/detail/index.js b/lib/pages/message/detail/index.js
new file mode 100644
index 000000000..222257bf2
--- /dev/null
+++ b/lib/pages/message/detail/index.js
@@ -0,0 +1,48 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tslib_1 = require("tslib");
+exports.default = OakComponent({
+ entity: 'message',
+ projection: {
+ id: 1,
+ $$createAt$$: 1,
+ type: 1,
+ title: 1,
+ content: 1,
+ visitState: 1,
+ userId: 1,
+ user: {
+ id: 1,
+ name: 1,
+ },
+ params: 1,
+ props: 1,
+ },
+ isList: false,
+ formData: function (_a) {
+ var message = _a.data;
+ return message || {};
+ },
+ observers: {
+ 'visitState,userId': function (visitState, userId) {
+ var userId2 = this.features.token.getUserId(true);
+ if (userId === userId2) {
+ if (visitState === 'unvisited') {
+ this.execute('visit', false);
+ }
+ }
+ },
+ },
+ methods: {
+ goPage: function () {
+ var params = this.state.params;
+ var pathname = params === null || params === void 0 ? void 0 : params.pathname;
+ var props = (params === null || params === void 0 ? void 0 : params.props) || {};
+ var state = params === null || params === void 0 ? void 0 : params.state;
+ if (!pathname) {
+ return;
+ }
+ this.redirectTo(tslib_1.__assign({ url: pathname }, props), state);
+ },
+ },
+});
diff --git a/lib/pages/message/detail/index.json b/lib/pages/message/detail/index.json
new file mode 100644
index 000000000..2b99d3cf1
--- /dev/null
+++ b/lib/pages/message/detail/index.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText": "消息详情",
+ "usingComponents": {}
+}
diff --git a/lib/pages/message/detail/mobile.module.less b/lib/pages/message/detail/mobile.module.less
new file mode 100644
index 000000000..0db2cfa99
--- /dev/null
+++ b/lib/pages/message/detail/mobile.module.less
@@ -0,0 +1,32 @@
+/** index.wxss **/
+.container {
+ background: var(--oak-bg-color-container);
+ box-shadow: 0 2px 3px #0000001a;
+ border-radius: 3px;
+ padding: 30px 32px;
+
+ margin: 20px;
+}
+
+
+.title {
+ font-family: "helvetica neue", PingFangSC-Light, arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif;
+ font-size: 20px;
+ line-height: 36px;
+ margin: 0px 0px 22px;
+}
+
+.content {
+ font-family: "helvetica neue", PingFangSC-Light, arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif;
+ font-size: 14px;
+ color: rgb(51, 51, 51);
+ line-height: 24px;
+ margin: 6px 0px 0px;
+ overflow-wrap: break-word;
+ word-break: break-all;
+ font-size: 14px;
+}
+
+.btn {
+ margin-top: 30px;
+}
\ No newline at end of file
diff --git a/lib/pages/message/detail/web.d.ts b/lib/pages/message/detail/web.d.ts
new file mode 100644
index 000000000..096610138
--- /dev/null
+++ b/lib/pages/message/detail/web.d.ts
@@ -0,0 +1,13 @@
+import { EntityDict } from '../../../general-app-domain';
+import { WebComponentProps } from 'oak-frontend-base';
+export default function Render(props: WebComponentProps void;
+}>): JSX.Element;
diff --git a/lib/pages/message/detail/web.js b/lib/pages/message/detail/web.js
new file mode 100644
index 000000000..c0d1144d5
--- /dev/null
+++ b/lib/pages/message/detail/web.js
@@ -0,0 +1,16 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tslib_1 = require("tslib");
+var jsx_runtime_1 = require("react/jsx-runtime");
+var antd_1 = require("antd");
+var mobile_module_less_1 = tslib_1.__importDefault(require("./mobile.module.less"));
+function Render(props) {
+ var data = props.data, methods = props.methods;
+ var title = data.title, content = data.content, params = data.params;
+ var t = methods.t, goPage = methods.goPage;
+ var pathname = params === null || params === void 0 ? void 0 : params.pathname;
+ return ((0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: mobile_module_less_1.default.container }, { children: [(0, jsx_runtime_1.jsx)("h1", tslib_1.__assign({ className: mobile_module_less_1.default.title }, { children: title })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: mobile_module_less_1.default.content }, { children: content })), pathname && ((0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ className: mobile_module_less_1.default.btn, block: true, type: "primary", onClick: function () {
+ goPage();
+ } }, { children: "\u524D\u5F80" })))] })));
+}
+exports.default = Render;
diff --git a/lib/pages/message/detail/web.module.less b/lib/pages/message/detail/web.module.less
new file mode 100644
index 000000000..1338af954
--- /dev/null
+++ b/lib/pages/message/detail/web.module.less
@@ -0,0 +1,46 @@
+/** index.wxss **/
+.container {
+ background: var(--oak-bg-color-container);
+ box-shadow: 0 2px 3px #0000001a;
+ border-radius: 3px;
+ padding: 30px 32px;
+}
+
+.warp {
+ word-break: break-all;
+ min-width: 320px;
+ max-width: 600px;
+ border: 1px solid rgb(246, 246, 246);
+ background-color: rgb(247, 248, 250);
+ margin: auto;
+ padding: 30px;
+}
+
+.inner {
+ background-color: rgb(255, 255, 255);
+ padding: 30px;
+ box-shadow: rgb(122 55 55 / 20%) 0px 1px 1px 0px;
+}
+
+
+.title {
+ // font-family: "helvetica neue", PingFangSC-Light, arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif;
+ font-size: 20px;
+ line-height: 36px;
+ margin: 0px 0px 22px;
+}
+
+.content {
+ // font-family: "helvetica neue", PingFangSC-Light, arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif;
+ font-size: 14px;
+ color: rgb(51, 51, 51);
+ line-height: 24px;
+ margin: 6px 0px 0px;
+ overflow-wrap: break-word;
+ word-break: break-all;
+ font-size: 14px;
+}
+
+.btn {
+ margin-top: 30px;
+}
\ No newline at end of file
diff --git a/lib/pages/message/detail/web.pc.d.ts b/lib/pages/message/detail/web.pc.d.ts
new file mode 100644
index 000000000..096610138
--- /dev/null
+++ b/lib/pages/message/detail/web.pc.d.ts
@@ -0,0 +1,13 @@
+import { EntityDict } from '../../../general-app-domain';
+import { WebComponentProps } from 'oak-frontend-base';
+export default function Render(props: WebComponentProps void;
+}>): JSX.Element;
diff --git a/lib/pages/message/detail/web.pc.js b/lib/pages/message/detail/web.pc.js
new file mode 100644
index 000000000..64c710684
--- /dev/null
+++ b/lib/pages/message/detail/web.pc.js
@@ -0,0 +1,17 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+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 web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
+function Render(props) {
+ var data = props.data, methods = props.methods;
+ var title = data.title, content = data.content, params = data.params;
+ var t = methods.t, goPage = methods.goPage;
+ var pathname = params === null || params === void 0 ? void 0 : params.pathname;
+ return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ title: "\u6D88\u606F\u8BE6\u60C5", showBack: true }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.warp }, { children: (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: web_module_less_1.default.inner }, { children: [(0, jsx_runtime_1.jsx)("h1", tslib_1.__assign({ className: web_module_less_1.default.title }, { children: title })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.content }, { children: content })), pathname && ((0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ className: web_module_less_1.default.btn, block: true, type: "primary", onClick: function () {
+ goPage();
+ } }, { children: "\u524D\u5F80" })))] })) })) })) })));
+}
+exports.default = Render;
diff --git a/lib/pages/message/drawerList/index.d.ts b/lib/pages/message/drawerList/index.d.ts
new file mode 100644
index 000000000..42765aac1
--- /dev/null
+++ b/lib/pages/message/drawerList/index.d.ts
@@ -0,0 +1,3 @@
+///
+declare const _default: import("react").ComponentType;
+export default _default;
diff --git a/lib/pages/message/drawerList/index.js b/lib/pages/message/drawerList/index.js
new file mode 100644
index 000000000..9601b0595
--- /dev/null
+++ b/lib/pages/message/drawerList/index.js
@@ -0,0 +1,69 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.default = OakComponent({
+ entity: 'message',
+ isList: true,
+ projection: {
+ id: 1,
+ $$createAt$$: 1,
+ type: 1,
+ title: 1,
+ content: 1,
+ visitState: 1,
+ userId: 1,
+ user: {
+ id: 1,
+ name: 1,
+ },
+ params: 1,
+ props: 1,
+ },
+ filters: [
+ {
+ filter: function (_a) {
+ var features = _a.features, props = _a.props;
+ var userId = features.token.getUserId(true);
+ var application = features.application.getApplication();
+ var systemId = application.systemId;
+ return {
+ userId: userId,
+ // systemId,
+ // visitState: 'unvisited',
+ };
+ },
+ },
+ ],
+ sorters: [
+ {
+ sorter: function () {
+ return {
+ $attr: {
+ $$createAt$$: 1,
+ },
+ $direction: 'desc',
+ };
+ },
+ },
+ ],
+ formData: function (_a) {
+ var messages = _a.data, features = _a.features, props = _a.props;
+ var pagination = this.getPagination();
+ return {
+ messages: messages,
+ pagination: pagination,
+ };
+ },
+ methods: {
+ goDetailById: function (id) {
+ this.navigateTo({
+ url: "/message/detail",
+ oakId: id,
+ });
+ },
+ goMessageList: function () {
+ this.navigateTo({
+ url: '/message/list',
+ });
+ },
+ },
+});
diff --git a/lib/pages/message/drawerList/index.json b/lib/pages/message/drawerList/index.json
new file mode 100644
index 000000000..a07c620d3
--- /dev/null
+++ b/lib/pages/message/drawerList/index.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText": "消息",
+ "oakDisablePulldownRefresh": true
+}
diff --git a/lib/pages/message/drawerList/web.d.ts b/lib/pages/message/drawerList/web.d.ts
new file mode 100644
index 000000000..942f0fbde
--- /dev/null
+++ b/lib/pages/message/drawerList/web.d.ts
@@ -0,0 +1,10 @@
+import { WebComponentProps } from 'oak-frontend-base';
+import { EntityDict } from '../../../general-app-domain';
+export default function Render(props: WebComponentProps void;
+ open: boolean;
+}, {
+ goDetailById: (id: string) => void;
+ goMessageList: () => void;
+}>): JSX.Element;
diff --git a/lib/pages/message/drawerList/web.js b/lib/pages/message/drawerList/web.js
new file mode 100644
index 000000000..986988cf8
--- /dev/null
+++ b/lib/pages/message/drawerList/web.js
@@ -0,0 +1,26 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tslib_1 = require("tslib");
+var jsx_runtime_1 = require("react/jsx-runtime");
+var antd_1 = require("antd");
+var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
+var cell_1 = tslib_1.__importDefault(require("../../../components/message/cell"));
+var empty_1 = tslib_1.__importDefault(require("../../../components/common/empty"));
+function Render(props) {
+ var data = props.data, methods = props.methods;
+ var messages = data.messages, open = data.open, onClose = data.onClose, oakFullpath = data.oakFullpath;
+ var goDetailById = methods.goDetailById, goMessageList = methods.goMessageList;
+ return ((0, jsx_runtime_1.jsx)(antd_1.Drawer, tslib_1.__assign({ title: "\u6D88\u606F", placement: "right", onClose: onClose, open: open, extra: (0, jsx_runtime_1.jsx)(antd_1.Space, { children: (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ size: "small", type: "text", onClick: function () {
+ onClose && onClose();
+ goMessageList();
+ } }, { children: "\u67E5\u770B\u66F4\u591A" })) }), bodyStyle: {
+ padding: 0,
+ }, destroyOnClose: true }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: (messages === null || messages === void 0 ? void 0 : messages.length) > 0 ? ((0, jsx_runtime_1.jsx)("div", { children: messages === null || messages === void 0 ? void 0 : messages.map(function (message, index) { return ((0, jsx_runtime_1.jsx)(cell_1.default, { oakId: message.id, oakPath: oakFullpath
+ ? "".concat(oakFullpath, ".").concat(message.id)
+ : '', onItemClicked: function (item) {
+ var params = item.params, id = item.id;
+ onClose && onClose();
+ goDetailById(id);
+ } }, message.id)); }) })) : ((0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.noData }, { children: (0, jsx_runtime_1.jsx)(empty_1.default, { description: "\u6682\u65E0\u6D88\u606F", image: empty_1.default.PRESENTED_IMAGE_SIMPLE }) }))) })) })));
+}
+exports.default = Render;
diff --git a/lib/pages/message/drawerList/web.module.less b/lib/pages/message/drawerList/web.module.less
new file mode 100644
index 000000000..ea50e8b2c
--- /dev/null
+++ b/lib/pages/message/drawerList/web.module.less
@@ -0,0 +1,6 @@
+/** index.wxss **/
+.container {
+ display: flex;
+ flex-direction: column;
+ background-color: var(--oak-bg-color-page);
+}
\ No newline at end of file
diff --git a/lib/pages/message/list/index.d.ts b/lib/pages/message/list/index.d.ts
new file mode 100644
index 000000000..42765aac1
--- /dev/null
+++ b/lib/pages/message/list/index.d.ts
@@ -0,0 +1,3 @@
+///
+declare const _default: import("react").ComponentType;
+export default _default;
diff --git a/lib/pages/message/list/index.js b/lib/pages/message/list/index.js
new file mode 100644
index 000000000..39a12994e
--- /dev/null
+++ b/lib/pages/message/list/index.js
@@ -0,0 +1,64 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.default = OakComponent({
+ entity: 'message',
+ isList: true,
+ projection: {
+ id: 1,
+ $$createAt$$: 1,
+ type: 1,
+ title: 1,
+ content: 1,
+ visitState: 1,
+ userId: 1,
+ user: {
+ id: 1,
+ name: 1,
+ },
+ params: 1,
+ props: 1,
+ },
+ filters: [
+ {
+ filter: function (_a) {
+ var features = _a.features, props = _a.props;
+ var userId = features.token.getUserId(true);
+ var application = features.application.getApplication();
+ var systemId = application.systemId;
+ return {
+ userId: userId,
+ // systemId,
+ // visitState: 'unvisited',
+ };
+ },
+ },
+ ],
+ sorters: [
+ {
+ sorter: function () {
+ return {
+ $attr: {
+ $$createAt$$: 1,
+ },
+ $direction: 'desc',
+ };
+ },
+ },
+ ],
+ formData: function (_a) {
+ var messages = _a.data, features = _a.features, props = _a.props;
+ var pagination = this.getPagination();
+ return {
+ messages: messages,
+ pagination: pagination,
+ };
+ },
+ methods: {
+ goDetailById: function (id) {
+ this.navigateTo({
+ url: "/message/detail",
+ oakId: id,
+ });
+ },
+ },
+});
diff --git a/lib/pages/message/list/index.json b/lib/pages/message/list/index.json
new file mode 100644
index 000000000..23ae42df6
--- /dev/null
+++ b/lib/pages/message/list/index.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText": "消息通知",
+ "usingComponents": {}
+}
diff --git a/lib/pages/message/list/mobile.module.less b/lib/pages/message/list/mobile.module.less
new file mode 100644
index 000000000..ea50e8b2c
--- /dev/null
+++ b/lib/pages/message/list/mobile.module.less
@@ -0,0 +1,6 @@
+/** index.wxss **/
+.container {
+ display: flex;
+ flex-direction: column;
+ background-color: var(--oak-bg-color-page);
+}
\ No newline at end of file
diff --git a/lib/pages/message/list/web.d.ts b/lib/pages/message/list/web.d.ts
new file mode 100644
index 000000000..1ae79b66a
--- /dev/null
+++ b/lib/pages/message/list/web.d.ts
@@ -0,0 +1,7 @@
+import { WebComponentProps } from 'oak-frontend-base';
+import { EntityDict } from '../../../general-app-domain';
+export default function Render(props: WebComponentProps void;
+}>): JSX.Element;
diff --git a/lib/pages/message/list/web.js b/lib/pages/message/list/web.js
new file mode 100644
index 000000000..87e52feab
--- /dev/null
+++ b/lib/pages/message/list/web.js
@@ -0,0 +1,18 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tslib_1 = require("tslib");
+var jsx_runtime_1 = require("react/jsx-runtime");
+var mobile_module_less_1 = tslib_1.__importDefault(require("./mobile.module.less"));
+var cell_1 = tslib_1.__importDefault(require("../../../components/message/cell"));
+var empty_1 = tslib_1.__importDefault(require("../../../components/common/empty"));
+function Render(props) {
+ var data = props.data, methods = props.methods;
+ var messages = data.messages, oakFullpath = data.oakFullpath;
+ var goDetailById = methods.goDetailById;
+ return ((0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: mobile_module_less_1.default.container }, { children: (messages === null || messages === void 0 ? void 0 : messages.length) > 0 ? ((0, jsx_runtime_1.jsx)("div", { children: messages === null || messages === void 0 ? void 0 : messages.map(function (message, index) { return ((0, jsx_runtime_1.jsx)(cell_1.default, { oakId: message.id, oakPath: oakFullpath
+ ? "".concat(oakFullpath, ".").concat(message.id)
+ : '', onItemClicked: function (item) {
+ goDetailById(item.id);
+ } }, message.id)); }) })) : ((0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: mobile_module_less_1.default.noData }, { children: (0, jsx_runtime_1.jsx)(empty_1.default, { description: "\u6682\u65E0\u6D88\u606F", image: empty_1.default.PRESENTED_IMAGE_SIMPLE }) }))) })));
+}
+exports.default = Render;
diff --git a/lib/pages/message/list/web.module.less b/lib/pages/message/list/web.module.less
new file mode 100644
index 000000000..b8e6934cf
--- /dev/null
+++ b/lib/pages/message/list/web.module.less
@@ -0,0 +1,7 @@
+/** index.wxss **/
+.container {
+ background: var(--oak-bg-color-container);
+ box-shadow: 0 2px 3px #0000001a;
+ border-radius: 3px;
+ padding: 30px 32px;
+}
\ No newline at end of file
diff --git a/lib/pages/message/list/web.pc.d.ts b/lib/pages/message/list/web.pc.d.ts
new file mode 100644
index 000000000..03c6b10fc
--- /dev/null
+++ b/lib/pages/message/list/web.pc.d.ts
@@ -0,0 +1,12 @@
+import { WebComponentProps } from 'oak-frontend-base';
+import { EntityDict } from '../../../general-app-domain';
+export default function Render(props: WebComponentProps void;
+}>): JSX.Element;
diff --git a/lib/pages/message/list/web.pc.js b/lib/pages/message/list/web.pc.js
new file mode 100644
index 000000000..956c54b3b
--- /dev/null
+++ b/lib/pages/message/list/web.pc.js
@@ -0,0 +1,88 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tslib_1 = require("tslib");
+var jsx_runtime_1 = require("react/jsx-runtime");
+var antd_1 = require("antd");
+var dayjs_1 = tslib_1.__importDefault(require("dayjs"));
+var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
+var pageHeader_1 = tslib_1.__importDefault(require("../../../components/common/pageHeader"));
+var cellButton_1 = tslib_1.__importDefault(require("../../../components/message/cellButton"));
+var MessageType = {
+ adminNotification: '系统通知',
+ conversationMessage: '客服消息',
+};
+function Render(props) {
+ var data = props.data, methods = props.methods;
+ var t = methods.t, setPageSize = methods.setPageSize, setCurrentPage = methods.setCurrentPage, goDetailById = methods.goDetailById;
+ var messages = data.messages, oakFullpath = data.oakFullpath, oakLoading = data.oakLoading, pagination = data.pagination;
+ var _a = pagination || {}, pageSize = _a.pageSize, total = _a.total, currentPage = _a.currentPage;
+ return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ title: "\u6D88\u606F\u901A\u77E5" }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: (0, jsx_runtime_1.jsx)(antd_1.Table, { loading: oakLoading, dataSource: messages || [], rowKey: "id",
+ // scroll={{ x: 1200 }}
+ columns: [
+ // {
+ // dataIndex: 'serial-number',
+ // title: '序号',
+ // render: (value, record, index) => {
+ // return index + 1;
+ // },
+ // },
+ {
+ dataIndex: 'title',
+ title: '消息内容',
+ render: function (value, record, index) {
+ if (record.visitState === 'unvisited') {
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(antd_1.Badge, { style: { marginRight: 5 }, status: "processing" }), (0, jsx_runtime_1.jsx)(antd_1.Typography.Link, tslib_1.__assign({ onClick: function () {
+ goDetailById(record.id);
+ } }, { children: value }))] }));
+ }
+ return ((0, jsx_runtime_1.jsx)(antd_1.Typography.Text, tslib_1.__assign({ onClick: function () {
+ goDetailById(record.id);
+ } }, { children: value })));
+ },
+ },
+ {
+ dataIndex: 'type',
+ title: '类型',
+ render: function (value, record, index) {
+ return MessageType[value];
+ },
+ },
+ {
+ dataIndex: 'visitState',
+ title: '是否已读',
+ render: function (value, record, index) {
+ return value === 'unvisited' ? '未读' : '已读';
+ },
+ },
+ {
+ dataIndex: '$$createAt$$',
+ title: '接收时间',
+ render: function (value, record, index) {
+ return ((0, jsx_runtime_1.jsx)("div", { children: (0, dayjs_1.default)(value).format('YYYY-MM-DD HH:mm:ss') }));
+ },
+ },
+ {
+ dataIndex: 'op',
+ width: 300,
+ title: '操作',
+ align: 'center',
+ render: function (value, record, index) {
+ return ((0, jsx_runtime_1.jsxs)(antd_1.Space, tslib_1.__assign({ wrap: true }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "link", onClick: function () {
+ goDetailById(record === null || record === void 0 ? void 0 : record.id);
+ } }, { children: "\u8BE6\u60C5" })), (0, jsx_runtime_1.jsx)(cellButton_1.default, { oakId: record.id, oakPath: "".concat(oakFullpath, ".").concat(record.id) })] })));
+ },
+ fixed: 'right',
+ },
+ ], pagination: {
+ total: total,
+ pageSize: pageSize,
+ current: currentPage,
+ onShowSizeChange: function (current, pageSize) {
+ setPageSize(pageSize);
+ },
+ onChange: function (page, pageSize) {
+ setCurrentPage(page);
+ },
+ } }) })) })));
+}
+exports.default = Render;
diff --git a/src/components/message/cell/index.ts b/src/components/message/cell/index.ts
new file mode 100644
index 000000000..a6e17eedd
--- /dev/null
+++ b/src/components/message/cell/index.ts
@@ -0,0 +1,24 @@
+export default OakComponent({
+ isList: false,
+ entity: 'message',
+ projection: {
+ id: 1,
+ $$createAt$$: 1,
+ type: 1,
+ title: 1,
+ content: 1,
+ visitState: 1,
+ userId: 1,
+ user: {
+ id: 1,
+ name: 1,
+ },
+ params: 1,
+ props: 1,
+ },
+ formData: function ({ data: message, features, props }) {
+ return message || {};
+ },
+ methods: {},
+ actions: ['visit'],
+});
diff --git a/src/components/message/cell/web.module.less b/src/components/message/cell/web.module.less
new file mode 100644
index 000000000..8e3a0e282
--- /dev/null
+++ b/src/components/message/cell/web.module.less
@@ -0,0 +1,46 @@
+.list {
+ padding: 10px 20px 10px 31px;
+ border-bottom: 1px solid #ddd;
+ cursor: pointer;
+ position: relative;
+}
+
+.list__notify {
+ margin-bottom: 5px;
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+
+ .notify_mask {
+ // display: none;
+ color: var(--oak-color-primary);
+ flex-grow: 0;
+ flex-shrink: 0;
+ white-space: nowrap;
+ font-size: 12px;
+ }
+
+ .notify_deadline {
+ color: #000;
+ font-weight: 600;
+ line-height: 20px;
+ flex: 1 1 auto;
+ min-width: 20px;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+ }
+}
+
+.list__info {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+
+
+ .create_time {
+ color: rgba(0, 0, 0, .4);
+ line-height: 20px;
+ font-size: 12px;
+ }
+}
\ No newline at end of file
diff --git a/src/components/message/cell/web.tsx b/src/components/message/cell/web.tsx
new file mode 100644
index 000000000..d6f1b645a
--- /dev/null
+++ b/src/components/message/cell/web.tsx
@@ -0,0 +1,107 @@
+import React from 'react';
+import { Tag, Badge } from 'antd';
+import dayjs from 'dayjs';
+import Style from './web.module.less';
+
+import { WebComponentProps } from 'oak-frontend-base';
+import { EntityDict } from '../../../general-app-domain';
+
+const MessageType = {
+ adminNotification: '系统通知',
+ conversationMessage: '客服消息',
+};
+
+// success、 processing、error、default、warning
+const MessageTypeToColor = {
+ adminNotification: 'processing',
+ conversationMessage: 'warning',
+};
+
+
+export default function Render(
+ props: WebComponentProps<
+ EntityDict,
+ 'message',
+ false,
+ {
+ onItemClicked: (item: {
+ id: string;
+ params: EntityDict['message']['Schema']['params'];
+ }) => void;
+ $$createAt$$: number;
+ type: string;
+ title: string;
+ params: EntityDict['message']['Schema']['params'];
+ visitState: EntityDict['message']['Schema']['visitState'];
+ id: string;
+ },
+ {}
+ >
+) {
+ const { data, methods } = props;
+ const {
+ id,
+ params,
+ title,
+ type,
+ $$createAt$$,
+ visitState,
+ oakLegalActions = [],
+ onItemClicked,
+ } = data;
+ const { navigateTo, execute } = methods;
+
+ return (
+ {
+ onItemClicked({
+ id,
+ params,
+ });
+ }
+ : undefined
+ }
+ >
+
+ {visitState === 'unvisited' && (
+
+ )}
+
{title}
+ {oakLegalActions.includes('visit') && (
+
{
+ execute('visit', false);
+ event.stopPropagation();
+ }}
+ >
+ 标记已读
+
+ )}
+
+
+
+
+ {MessageType[type as keyof typeof MessageType]}
+
+
+
+
+ {dayjs($$createAt$$).format('YYYY-MM-DD HH:mm:ss')}
+
+
+
+ );
+}
diff --git a/src/components/message/cellButton/index.ts b/src/components/message/cellButton/index.ts
new file mode 100644
index 000000000..7ab5cd5ce
--- /dev/null
+++ b/src/components/message/cellButton/index.ts
@@ -0,0 +1,22 @@
+export default OakComponent({
+ entity: 'message',
+ isList: false,
+ formData({ data }) {
+ return {};
+ },
+ actions: ['visit'],
+ methods: {
+ async tapAction(action: string) {
+ const { oakId: id } = this.props;
+ switch (action) {
+ case 'visit': {
+ this.execute('visit', false);
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ },
+ },
+});
diff --git a/src/components/message/cellButton/web.module.less b/src/components/message/cellButton/web.module.less
new file mode 100644
index 000000000..e69de29bb
diff --git a/src/components/message/cellButton/web.tsx b/src/components/message/cellButton/web.tsx
new file mode 100644
index 000000000..bd506e156
--- /dev/null
+++ b/src/components/message/cellButton/web.tsx
@@ -0,0 +1,46 @@
+import React from 'react';
+import { Button, Modal } from 'antd';
+import { WebComponentProps } from 'oak-frontend-base';
+import { EntityDict } from '../../../general-app-domain';
+
+export default function Render(
+ props: WebComponentProps<
+ EntityDict,
+ 'message',
+ false,
+ {},
+ {
+ tapAction: (action: string) => void;
+ }
+ >
+) {
+ const { data, methods } = props;
+ const { t, tapAction } = methods;
+ const { oakLegalActions } = data;
+
+ return oakLegalActions && oakLegalActions?.length > 0
+ ? oakLegalActions.map((ele: string) => {
+ return (
+
+ );
+ })
+ : null;
+}
diff --git a/src/pages/message/detail/index.json b/src/pages/message/detail/index.json
new file mode 100644
index 000000000..2b99d3cf1
--- /dev/null
+++ b/src/pages/message/detail/index.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText": "消息详情",
+ "usingComponents": {}
+}
diff --git a/src/pages/message/detail/index.ts b/src/pages/message/detail/index.ts
new file mode 100644
index 000000000..61bc1f180
--- /dev/null
+++ b/src/pages/message/detail/index.ts
@@ -0,0 +1,52 @@
+
+export default OakComponent({
+ entity: 'message',
+ projection: {
+ id: 1,
+ $$createAt$$: 1,
+ type: 1,
+ title: 1,
+ content: 1,
+ visitState: 1,
+ userId: 1,
+ user: {
+ id: 1,
+ name: 1,
+ },
+ params: 1,
+ props: 1,
+ },
+ isList: false,
+ formData: ({ data: message }) => {
+ return message || {};
+ },
+ observers: {
+ 'visitState,userId': function (visitState, userId) {
+ const userId2 = this.features.token.getUserId(true);
+ if (userId === userId2) {
+ if (visitState === 'unvisited') {
+ this.execute('visit', false);
+ }
+ }
+ },
+ },
+ methods: {
+ goPage() {
+ const { params } = this.state;
+ const pathname = params?.pathname;
+ const props = params?.props || {};
+ const state = params?.state;
+ if (!pathname) {
+ return;
+ }
+
+ this.redirectTo(
+ {
+ url: pathname,
+ ...props,
+ },
+ state
+ );
+ },
+ },
+});
diff --git a/src/pages/message/detail/mobile.module.less b/src/pages/message/detail/mobile.module.less
new file mode 100644
index 000000000..0db2cfa99
--- /dev/null
+++ b/src/pages/message/detail/mobile.module.less
@@ -0,0 +1,32 @@
+/** index.wxss **/
+.container {
+ background: var(--oak-bg-color-container);
+ box-shadow: 0 2px 3px #0000001a;
+ border-radius: 3px;
+ padding: 30px 32px;
+
+ margin: 20px;
+}
+
+
+.title {
+ font-family: "helvetica neue", PingFangSC-Light, arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif;
+ font-size: 20px;
+ line-height: 36px;
+ margin: 0px 0px 22px;
+}
+
+.content {
+ font-family: "helvetica neue", PingFangSC-Light, arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif;
+ font-size: 14px;
+ color: rgb(51, 51, 51);
+ line-height: 24px;
+ margin: 6px 0px 0px;
+ overflow-wrap: break-word;
+ word-break: break-all;
+ font-size: 14px;
+}
+
+.btn {
+ margin-top: 30px;
+}
\ No newline at end of file
diff --git a/src/pages/message/detail/web.module.less b/src/pages/message/detail/web.module.less
new file mode 100644
index 000000000..1338af954
--- /dev/null
+++ b/src/pages/message/detail/web.module.less
@@ -0,0 +1,46 @@
+/** index.wxss **/
+.container {
+ background: var(--oak-bg-color-container);
+ box-shadow: 0 2px 3px #0000001a;
+ border-radius: 3px;
+ padding: 30px 32px;
+}
+
+.warp {
+ word-break: break-all;
+ min-width: 320px;
+ max-width: 600px;
+ border: 1px solid rgb(246, 246, 246);
+ background-color: rgb(247, 248, 250);
+ margin: auto;
+ padding: 30px;
+}
+
+.inner {
+ background-color: rgb(255, 255, 255);
+ padding: 30px;
+ box-shadow: rgb(122 55 55 / 20%) 0px 1px 1px 0px;
+}
+
+
+.title {
+ // font-family: "helvetica neue", PingFangSC-Light, arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif;
+ font-size: 20px;
+ line-height: 36px;
+ margin: 0px 0px 22px;
+}
+
+.content {
+ // font-family: "helvetica neue", PingFangSC-Light, arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif;
+ font-size: 14px;
+ color: rgb(51, 51, 51);
+ line-height: 24px;
+ margin: 6px 0px 0px;
+ overflow-wrap: break-word;
+ word-break: break-all;
+ font-size: 14px;
+}
+
+.btn {
+ margin-top: 30px;
+}
\ No newline at end of file
diff --git a/src/pages/message/detail/web.pc.tsx b/src/pages/message/detail/web.pc.tsx
new file mode 100644
index 000000000..2cf72473e
--- /dev/null
+++ b/src/pages/message/detail/web.pc.tsx
@@ -0,0 +1,61 @@
+import React from 'react';
+import {
+ Card,
+ Button,
+} from 'antd';
+import PageHeader from '../../../components/common/pageHeader';
+import { EntityDict } from '../../../general-app-domain';
+import { WebComponentProps } from 'oak-frontend-base';
+import Style from './web.module.less';
+
+export default function Render(
+ props: WebComponentProps<
+ EntityDict,
+ 'message',
+ false,
+ {
+ title: string;
+ content: string;
+ id: string;
+ $$createAt$$: number;
+ type: string;
+ visitState: EntityDict['message']['Schema']['visitState'];
+ params: EntityDict['message']['Schema']['params'];
+ },
+ {
+ goPage: () => void;
+ }
+ >
+) {
+ const { data, methods } = props;
+ const { title, content, params } = data;
+ const { t, goPage } = methods;
+ const pathname = params?.pathname;
+
+
+ return (
+
+
+
+
+
{title}
+
{content}
+
+ {pathname && (
+
+ )}
+
+
+
+
+ );
+}
diff --git a/src/pages/message/detail/web.tsx b/src/pages/message/detail/web.tsx
new file mode 100644
index 000000000..f2eb8d18e
--- /dev/null
+++ b/src/pages/message/detail/web.tsx
@@ -0,0 +1,54 @@
+import React from 'react';
+import {
+ Card,
+ Button,
+} from 'antd';
+import { EntityDict } from '../../../general-app-domain';
+import { WebComponentProps } from 'oak-frontend-base';
+import Style from './mobile.module.less';
+
+
+export default function Render(
+ props: WebComponentProps<
+ EntityDict,
+ 'message',
+ false,
+ {
+ title: string;
+ content: string;
+ id: string;
+ $$createAt$$: number;
+ type: string;
+ visitState: EntityDict['message']['Schema']['visitState'];
+ params: EntityDict['message']['Schema']['params'];
+ },
+ {
+ goPage: () => void;
+ }
+ >
+) {
+ const { data, methods } = props;
+ const { title, content, params } = data;
+ const { t, goPage } = methods;
+ const pathname = params?.pathname;
+
+ return (
+
+
{title}
+
{content}
+
+ {pathname && (
+
+ )}
+
+ );
+}
diff --git a/src/pages/message/drawerList/index.json b/src/pages/message/drawerList/index.json
new file mode 100644
index 000000000..a07c620d3
--- /dev/null
+++ b/src/pages/message/drawerList/index.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText": "消息",
+ "oakDisablePulldownRefresh": true
+}
diff --git a/src/pages/message/drawerList/index.ts b/src/pages/message/drawerList/index.ts
new file mode 100644
index 000000000..2c3398fd4
--- /dev/null
+++ b/src/pages/message/drawerList/index.ts
@@ -0,0 +1,67 @@
+
+export default OakComponent({
+ entity: 'message',
+ isList: true,
+ projection: {
+ id: 1,
+ $$createAt$$: 1,
+ type: 1,
+ title: 1,
+ content: 1,
+ visitState: 1,
+ userId: 1,
+ user: {
+ id: 1,
+ name: 1,
+ },
+ params: 1,
+ props: 1,
+ },
+ filters: [
+ {
+ filter: ({ features, props }) => {
+ const userId = features.token.getUserId(true);
+ const application = features.application.getApplication();
+ const { systemId } = application;
+
+ return {
+ userId,
+ // systemId,
+ // visitState: 'unvisited',
+ };
+ },
+ },
+ ],
+ sorters: [
+ {
+ sorter: () => {
+ return {
+ $attr: {
+ $$createAt$$: 1,
+ },
+ $direction: 'desc',
+ };
+ },
+ },
+ ],
+ formData: function ({ data: messages, features, props }) {
+ const pagination = this.getPagination();
+ return {
+ messages,
+ pagination,
+ };
+ },
+ methods: {
+ goDetailById(id: string) {
+ this.navigateTo({
+ url: `/message/detail`,
+ oakId: id,
+ });
+ },
+ goMessageList() {
+ this.navigateTo({
+ url: '/message/list',
+ });
+ },
+ },
+});
diff --git a/src/pages/message/drawerList/web.module.less b/src/pages/message/drawerList/web.module.less
new file mode 100644
index 000000000..ea50e8b2c
--- /dev/null
+++ b/src/pages/message/drawerList/web.module.less
@@ -0,0 +1,6 @@
+/** index.wxss **/
+.container {
+ display: flex;
+ flex-direction: column;
+ background-color: var(--oak-bg-color-page);
+}
\ No newline at end of file
diff --git a/src/pages/message/drawerList/web.tsx b/src/pages/message/drawerList/web.tsx
new file mode 100644
index 000000000..49f1acf16
--- /dev/null
+++ b/src/pages/message/drawerList/web.tsx
@@ -0,0 +1,92 @@
+import React from 'react';
+import { Button, Space, Drawer } from 'antd';
+import Style from './web.module.less';
+import MessageCell from '../../../components/message/cell';
+import Empty from '../../../components/common/empty';
+
+import { WebComponentProps } from 'oak-frontend-base';
+import { EntityDict } from '../../../general-app-domain';
+
+
+
+
+export default function Render(
+ props: WebComponentProps<
+ EntityDict,
+ 'message',
+ false,
+ {
+ messages: EntityDict['message']['Schema'][];
+ onClose: () => void;
+ open: boolean;
+ },
+ {
+ goDetailById: (id: string) => void;
+ goMessageList: () => void;
+ }
+ >
+) {
+ const { data, methods } = props;
+ const { messages, open, onClose, oakFullpath } = data;
+ const { goDetailById, goMessageList } = methods;
+
+ return (
+
+
+
+ }
+ bodyStyle={{
+ padding: 0,
+ }}
+ destroyOnClose={true}
+ >
+
+ {messages?.length > 0 ? (
+
+ {messages?.map((message, index: number) => (
+ {
+ const { params, id } = item;
+ onClose && onClose();
+ goDetailById(id);
+ }}
+ />
+ ))}
+
+ ) : (
+
+
+
+ )}
+
+
+ );
+}
diff --git a/src/pages/message/list/index.json b/src/pages/message/list/index.json
new file mode 100644
index 000000000..23ae42df6
--- /dev/null
+++ b/src/pages/message/list/index.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText": "消息通知",
+ "usingComponents": {}
+}
diff --git a/src/pages/message/list/index.ts b/src/pages/message/list/index.ts
new file mode 100644
index 000000000..e69c4d44f
--- /dev/null
+++ b/src/pages/message/list/index.ts
@@ -0,0 +1,62 @@
+
+export default OakComponent({
+ entity: 'message',
+ isList: true,
+ projection: {
+ id: 1,
+ $$createAt$$: 1,
+ type: 1,
+ title: 1,
+ content: 1,
+ visitState: 1,
+ userId: 1,
+ user: {
+ id: 1,
+ name: 1,
+ },
+ params: 1,
+ props: 1,
+ },
+ filters: [
+ {
+ filter: ({ features, props }) => {
+ const userId = features.token.getUserId(true);
+ const application = features.application.getApplication();
+ const { systemId } = application;
+
+ return {
+ userId,
+ // systemId,
+ // visitState: 'unvisited',
+ };
+ },
+ },
+ ],
+ sorters: [
+ {
+ sorter: () => {
+ return {
+ $attr: {
+ $$createAt$$: 1,
+ },
+ $direction: 'desc',
+ };
+ },
+ },
+ ],
+ formData: function ({ data: messages, features, props }) {
+ const pagination = this.getPagination();
+ return {
+ messages,
+ pagination,
+ };
+ },
+ methods: {
+ goDetailById(id: string) {
+ this.navigateTo({
+ url: `/message/detail`,
+ oakId: id,
+ });
+ },
+ },
+});
diff --git a/src/pages/message/list/mobile.module.less b/src/pages/message/list/mobile.module.less
new file mode 100644
index 000000000..ea50e8b2c
--- /dev/null
+++ b/src/pages/message/list/mobile.module.less
@@ -0,0 +1,6 @@
+/** index.wxss **/
+.container {
+ display: flex;
+ flex-direction: column;
+ background-color: var(--oak-bg-color-page);
+}
\ No newline at end of file
diff --git a/src/pages/message/list/web.module.less b/src/pages/message/list/web.module.less
new file mode 100644
index 000000000..b8e6934cf
--- /dev/null
+++ b/src/pages/message/list/web.module.less
@@ -0,0 +1,7 @@
+/** index.wxss **/
+.container {
+ background: var(--oak-bg-color-container);
+ box-shadow: 0 2px 3px #0000001a;
+ border-radius: 3px;
+ padding: 30px 32px;
+}
\ No newline at end of file
diff --git a/src/pages/message/list/web.pc.tsx b/src/pages/message/list/web.pc.tsx
new file mode 100644
index 000000000..fdaff4358
--- /dev/null
+++ b/src/pages/message/list/web.pc.tsx
@@ -0,0 +1,161 @@
+import React from 'react';
+import { Button, Badge, Table, Space, Typography } from 'antd';
+import dayjs from 'dayjs';
+import Style from './web.module.less';
+import PageHeader from '../../../components/common/pageHeader';
+import CellButton from '../../../components/message/cellButton';
+
+import { WebComponentProps } from 'oak-frontend-base';
+import { EntityDict } from '../../../general-app-domain';
+
+const MessageType = {
+ adminNotification: '系统通知',
+ conversationMessage: '客服消息',
+};
+
+
+export default function Render(
+ props: WebComponentProps<
+ EntityDict,
+ 'message',
+ true,
+ {
+ pagination?: {
+ pageSize: number;
+ total: number;
+ currentPage: number;
+ };
+ messages: EntityDict['message']['Schema'][];
+ },
+ {
+ goDetailById: (id: string) => void;
+ }
+ >
+) {
+ const { data, methods } = props;
+ const { t, setPageSize, setCurrentPage, goDetailById } = methods;
+ const { messages, oakFullpath, oakLoading, pagination } = data;
+ const { pageSize, total, currentPage } = pagination || {};
+
+ return (
+
+
+
{
+ // return index + 1;
+ // },
+ // },
+ {
+ dataIndex: 'title',
+ title: '消息内容',
+ render: (value, record, index) => {
+ if (record.visitState === 'unvisited') {
+ return (
+ <>
+
+ {
+ goDetailById(record.id);
+ }}
+ >
+ {value}
+
+ >
+ );
+ }
+ return (
+ {
+ goDetailById(record.id);
+ }}
+ >
+ {value}
+
+ );
+ },
+ },
+ {
+ dataIndex: 'type',
+ title: '类型',
+ render: (value, record, index) => {
+ return MessageType[
+ value as keyof typeof MessageType
+ ];
+ },
+ },
+ {
+ dataIndex: 'visitState',
+ title: '是否已读',
+ render: (value, record, index) => {
+ return value === 'unvisited' ? '未读' : '已读';
+ },
+ },
+ {
+ dataIndex: '$$createAt$$',
+ title: '接收时间',
+ render: (value, record, index) => {
+ return (
+
+ {dayjs(value).format(
+ 'YYYY-MM-DD HH:mm:ss'
+ )}
+
+ );
+ },
+ },
+ {
+ dataIndex: 'op',
+ width: 300,
+ title: '操作',
+ align: 'center',
+ render: (value, record, index) => {
+ return (
+
+
+
+
+ );
+ },
+ fixed: 'right',
+ },
+ ]}
+ pagination={{
+ total: total,
+ pageSize: pageSize,
+ current: currentPage,
+ onShowSizeChange: (
+ current: number,
+ pageSize: number
+ ) => {
+ setPageSize(pageSize);
+ },
+ onChange: (page: number, pageSize: number) => {
+ setCurrentPage(page);
+ },
+ }}
+ />
+
+
+ );
+}
diff --git a/src/pages/message/list/web.tsx b/src/pages/message/list/web.tsx
new file mode 100644
index 000000000..8f0a287d9
--- /dev/null
+++ b/src/pages/message/list/web.tsx
@@ -0,0 +1,57 @@
+import React from 'react';
+import { Tag, Badge } from 'antd';
+import Style from './mobile.module.less';
+import MessageCell from '../../../components/message/cell';
+import Empty from '../../../components/common/empty';
+
+import { WebComponentProps } from 'oak-frontend-base';
+import { EntityDict } from '../../../general-app-domain';
+
+
+export default function Render(
+ props: WebComponentProps<
+ EntityDict,
+ 'message',
+ true,
+ {
+ messages: EntityDict['message']['Schema'][];
+ },
+ {
+ goDetailById: (id: string) => void;
+ }
+ >
+) {
+ const { data, methods } = props;
+ const { messages, oakFullpath } = data;
+ const { goDetailById } = methods;
+
+ return (
+
+ {messages?.length > 0 ? (
+
+ {messages?.map((message, index: number) => (
+ {
+ goDetailById(item.id);
+ }}
+ />
+ ))}
+
+ ) : (
+
+
+
+ )}
+
+ );
+}
From b69e9f775dcbcd7ded0469a31fbbb6db206c88eb Mon Sep 17 00:00:00 2001
From: wkj <278599135@qq.com>
Date: Thu, 22 Dec 2022 12:15:14 +0800
Subject: [PATCH 8/8] =?UTF-8?q?=E6=88=91=E7=9A=84message=20=E6=8C=89?=
=?UTF-8?q?=E9=92=AE=E5=9B=BE=E6=A0=87=20=E7=94=A8=E6=9D=A5=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E6=B6=88=E6=81=AF=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/components/my/message/index.d.ts | 3 ++
lib/components/my/message/index.js | 52 ++++++++++++++++++++
lib/components/my/message/mobile.module.less | 4 ++
lib/components/my/message/web.d.ts | 7 +++
lib/components/my/message/web.js | 16 ++++++
lib/components/my/message/web.module.less | 8 +++
lib/components/my/message/web.pc.d.ts | 7 +++
lib/components/my/message/web.pc.js | 20 ++++++++
package.json | 5 +-
src/components/my/info/web.tsx | 3 +-
src/components/my/message/index.ts | 39 +++++++++++++++
src/components/my/message/mobile.module.less | 4 ++
src/components/my/message/web.module.less | 8 +++
src/components/my/message/web.pc.tsx | 48 ++++++++++++++++++
src/components/my/message/web.tsx | 38 ++++++++++++++
15 files changed, 259 insertions(+), 3 deletions(-)
create mode 100644 lib/components/my/message/index.d.ts
create mode 100644 lib/components/my/message/index.js
create mode 100644 lib/components/my/message/mobile.module.less
create mode 100644 lib/components/my/message/web.d.ts
create mode 100644 lib/components/my/message/web.js
create mode 100644 lib/components/my/message/web.module.less
create mode 100644 lib/components/my/message/web.pc.d.ts
create mode 100644 lib/components/my/message/web.pc.js
create mode 100644 src/components/my/message/index.ts
create mode 100644 src/components/my/message/mobile.module.less
create mode 100644 src/components/my/message/web.module.less
create mode 100644 src/components/my/message/web.pc.tsx
create mode 100644 src/components/my/message/web.tsx
diff --git a/lib/components/my/message/index.d.ts b/lib/components/my/message/index.d.ts
new file mode 100644
index 000000000..42765aac1
--- /dev/null
+++ b/lib/components/my/message/index.d.ts
@@ -0,0 +1,3 @@
+///
+declare const _default: import("react").ComponentType;
+export default _default;
diff --git a/lib/components/my/message/index.js b/lib/components/my/message/index.js
new file mode 100644
index 000000000..ca5aa503c
--- /dev/null
+++ b/lib/components/my/message/index.js
@@ -0,0 +1,52 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tslib_1 = require("tslib");
+exports.default = OakComponent({
+ isList: false,
+ lifetimes: {
+ attached: function () {
+ this.getMessageCount();
+ },
+ },
+ data: {
+ count: undefined,
+ },
+ methods: {
+ goMessageList: function () {
+ this.navigateTo({
+ url: '/message/list',
+ });
+ },
+ getMessageCount: function () {
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
+ var userId, application, systemId, result;
+ return tslib_1.__generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ userId = this.features.token.getUserId(true);
+ application = this.features.application.getApplication();
+ systemId = application.systemId;
+ if (!userId) return [3 /*break*/, 2];
+ return [4 /*yield*/, this.features.cache.count('message', {
+ data: {
+ id: 1,
+ },
+ filter: {
+ userId: userId,
+ systemId: systemId,
+ visitState: 'unvisited',
+ },
+ })];
+ case 1:
+ result = _a.sent();
+ this.setState({
+ count: result,
+ });
+ _a.label = 2;
+ case 2: return [2 /*return*/];
+ }
+ });
+ });
+ },
+ },
+});
diff --git a/lib/components/my/message/mobile.module.less b/lib/components/my/message/mobile.module.less
new file mode 100644
index 000000000..9594d0233
--- /dev/null
+++ b/lib/components/my/message/mobile.module.less
@@ -0,0 +1,4 @@
+ .icon {
+ font-size: 20px;
+ color: var(--oak-color-primary);
+ }
\ No newline at end of file
diff --git a/lib/components/my/message/web.d.ts b/lib/components/my/message/web.d.ts
new file mode 100644
index 000000000..6be12245f
--- /dev/null
+++ b/lib/components/my/message/web.d.ts
@@ -0,0 +1,7 @@
+import { WebComponentProps } from 'oak-frontend-base';
+import { EntityDict } from '../../../general-app-domain';
+export default function Render(props: WebComponentProps void;
+}>): JSX.Element;
diff --git a/lib/components/my/message/web.js b/lib/components/my/message/web.js
new file mode 100644
index 000000000..13733ff45
--- /dev/null
+++ b/lib/components/my/message/web.js
@@ -0,0 +1,16 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tslib_1 = require("tslib");
+var jsx_runtime_1 = require("react/jsx-runtime");
+var antd_mobile_1 = require("antd-mobile");
+var icons_1 = require("@ant-design/icons");
+var mobile_module_less_1 = tslib_1.__importDefault(require("./mobile.module.less"));
+function Render(props) {
+ var data = props.data, methods = props.methods;
+ var count = data.count;
+ var goMessageList = methods.goMessageList;
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_mobile_1.Badge, tslib_1.__assign({ content: count || '' }, { children: (0, jsx_runtime_1.jsx)(icons_1.BellOutlined, { className: mobile_module_less_1.default.icon, onClick: function () {
+ goMessageList();
+ } }) })) }));
+}
+exports.default = Render;
diff --git a/lib/components/my/message/web.module.less b/lib/components/my/message/web.module.less
new file mode 100644
index 000000000..42071e75e
--- /dev/null
+++ b/lib/components/my/message/web.module.less
@@ -0,0 +1,8 @@
+.btn {
+ padding-inline-start: 5px;
+ padding-inline-end: 5px;
+}
+
+.icon {
+ font-size: 20px;
+}
\ No newline at end of file
diff --git a/lib/components/my/message/web.pc.d.ts b/lib/components/my/message/web.pc.d.ts
new file mode 100644
index 000000000..6be12245f
--- /dev/null
+++ b/lib/components/my/message/web.pc.d.ts
@@ -0,0 +1,7 @@
+import { WebComponentProps } from 'oak-frontend-base';
+import { EntityDict } from '../../../general-app-domain';
+export default function Render(props: WebComponentProps void;
+}>): JSX.Element;
diff --git a/lib/components/my/message/web.pc.js b/lib/components/my/message/web.pc.js
new file mode 100644
index 000000000..14f86f4e8
--- /dev/null
+++ b/lib/components/my/message/web.pc.js
@@ -0,0 +1,20 @@
+"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");
+var icons_1 = require("@ant-design/icons");
+var drawerList_1 = tslib_1.__importDefault(require("../../../pages/message/drawerList"));
+var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
+function Render(props) {
+ var data = props.data;
+ var count = data.count;
+ var _a = tslib_1.__read((0, react_1.useState)(false), 2), open = _a[0], setOpen = _a[1];
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(antd_1.Badge, tslib_1.__assign({ count: count }, { children: (0, jsx_runtime_1.jsx)(antd_1.Button, { className: web_module_less_1.default.btn, type: "text", shape: "circle", icon: (0, jsx_runtime_1.jsx)(icons_1.BellOutlined, {}), onClick: function () {
+ setOpen(true);
+ } }) })), (0, jsx_runtime_1.jsx)(drawerList_1.default, { open: open, onClose: function () {
+ setOpen(false);
+ } })] }));
+}
+exports.default = Render;
diff --git a/package.json b/package.json
index 86e45edb1..4826b3347 100644
--- a/package.json
+++ b/package.json
@@ -75,8 +75,9 @@
"scripts": {
"make:domain": "ts-node ./scripts/make.ts",
"clean": "rimraf lib/*",
- "copy-files": "copyfiles -u 1 src/**/*.less lib/ & copyfiles -u 1 src/**/*.svg lib/ & copyfiles -u 1 src/**/*.xml lib/ & copyfiles -u 1 src/**/*.wxml lib/ & copyfiles -u 1 src/**/*.wxs lib/ & copyfiles -u 1 src/miniprogram_npm/**/*.js lib/ ",
- "build": "tsc && npm run copy-files",
+ "copy-files": "copyfiles -u 1 src/**/*.svg lib/ & copyfiles -u 1 src/**/*.xml lib/ & copyfiles -u 1 src/**/*.wxml lib/ & copyfiles -u 1 src/**/*.wxs lib/ & copyfiles -u 1 src/miniprogram_npm/**/*.js lib/ ",
+ "copy-less": "copyfiles -u 1 src/**/*.less lib/",
+ "build": "tsc && npm run copy-files && npm run copy-less",
"gen:areaDebug": "ts-node ./scripts/generateAreaDebug.ts",
"clean:dir": "ts-node ./scripts/cleanDtsAndJs",
"test": "ts-node ./test/test.ts",
diff --git a/src/components/my/info/web.tsx b/src/components/my/info/web.tsx
index 79e61ed69..a9b300856 100644
--- a/src/components/my/info/web.tsx
+++ b/src/components/my/info/web.tsx
@@ -1,5 +1,6 @@
-import { WebComponentProps } from 'oak-frontend-base';
import React, { useState } from 'react';
+
+import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../general-app-domain';
import Styles from './web.pc.module.less';
import { Button, List, Popup, Tag, Input, Radio, Form, Space } from 'antd-mobile';
diff --git a/src/components/my/message/index.ts b/src/components/my/message/index.ts
new file mode 100644
index 000000000..09cb495ca
--- /dev/null
+++ b/src/components/my/message/index.ts
@@ -0,0 +1,39 @@
+
+export default OakComponent({
+ isList: false,
+ lifetimes: {
+ attached() {
+ this.getMessageCount();
+ },
+ },
+ data: {
+ count: undefined,
+ },
+ methods: {
+ goMessageList() {
+ this.navigateTo({
+ url: '/message/list',
+ });
+ },
+ async getMessageCount() {
+ const userId = this.features.token.getUserId(true);
+ const application = this.features.application.getApplication();
+ const { systemId } = application;
+ if (userId) {
+ const result = await this.features.cache.count('message', {
+ data: {
+ id: 1,
+ },
+ filter: {
+ userId,
+ systemId,
+ visitState: 'unvisited',
+ },
+ });
+ this.setState({
+ count: result,
+ });
+ }
+ },
+ },
+});
diff --git a/src/components/my/message/mobile.module.less b/src/components/my/message/mobile.module.less
new file mode 100644
index 000000000..9594d0233
--- /dev/null
+++ b/src/components/my/message/mobile.module.less
@@ -0,0 +1,4 @@
+ .icon {
+ font-size: 20px;
+ color: var(--oak-color-primary);
+ }
\ No newline at end of file
diff --git a/src/components/my/message/web.module.less b/src/components/my/message/web.module.less
new file mode 100644
index 000000000..42071e75e
--- /dev/null
+++ b/src/components/my/message/web.module.less
@@ -0,0 +1,8 @@
+.btn {
+ padding-inline-start: 5px;
+ padding-inline-end: 5px;
+}
+
+.icon {
+ font-size: 20px;
+}
\ No newline at end of file
diff --git a/src/components/my/message/web.pc.tsx b/src/components/my/message/web.pc.tsx
new file mode 100644
index 000000000..ed857947a
--- /dev/null
+++ b/src/components/my/message/web.pc.tsx
@@ -0,0 +1,48 @@
+import React, { useState } from 'react';
+import { Button, Badge } from 'antd';
+import { BellOutlined } from '@ant-design/icons';
+import { WebComponentProps } from 'oak-frontend-base';
+import { EntityDict } from '../../../general-app-domain';
+import MessageDrawerList from '../../../pages/message/drawerList';
+
+import Style from './web.module.less';
+
+export default function Render(
+ props: WebComponentProps<
+ EntityDict,
+ 'user',
+ false,
+ {
+ count?: number;
+ },
+ {
+ goMessageList: () => void;
+ }
+ >
+) {
+ const { data } = props;
+ const { count } = data;
+ const [open, setOpen] = useState(false);
+
+ return (
+ <>
+
+ }
+ onClick={() => {
+ setOpen(true);
+ }}
+ />
+
+ {
+ setOpen(false);
+ }}
+ />
+ >
+ );
+}
diff --git a/src/components/my/message/web.tsx b/src/components/my/message/web.tsx
new file mode 100644
index 000000000..d3b91203a
--- /dev/null
+++ b/src/components/my/message/web.tsx
@@ -0,0 +1,38 @@
+import React from 'react';
+import { Badge } from 'antd-mobile';
+import { BellOutlined } from '@ant-design/icons';
+import { WebComponentProps } from 'oak-frontend-base';
+import { EntityDict } from '../../../general-app-domain';
+
+import Style from './mobile.module.less';
+
+export default function Render(
+ props: WebComponentProps<
+ EntityDict,
+ 'user',
+ false,
+ {
+ count?: number;
+ },
+ {
+ goMessageList: () => void;
+ }
+ >
+) {
+ const { data, methods } = props;
+ const { count } = data;
+ const { goMessageList } = methods;
+
+ return (
+ <>
+
+ {
+ goMessageList();
+ }}
+ />
+
+ >
+ );
+}