platform application system 相关页面

This commit is contained in:
Wang Kejun 2022-11-11 14:33:21 +08:00
parent 158c5eee21
commit bf6592f0d0
66 changed files with 2495 additions and 471 deletions

5
lib/checkers/application.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
import { Checker } from 'oak-domain/lib/types';
import { EntityDict } from '../general-app-domain';
import { RuntimeContext } from '../context/RuntimeContext';
declare const checkers: Checker<EntityDict, 'application', RuntimeContext<EntityDict>>[];
export default checkers;

View File

@ -0,0 +1,38 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var validator_1 = require("oak-domain/lib/utils/validator");
var checkers = [
{
type: 'data',
action: 'create',
entity: 'application',
checker: function (_a, context) {
var operation = _a.operation;
return tslib_1.__awaiter(void 0, void 0, void 0, function () {
var action, data;
return tslib_1.__generator(this, function (_b) {
action = operation.action, data = operation.data;
if (data instanceof Array) {
data.forEach(function (ele) {
(0, validator_1.checkAttributesNotNull)('application', ele, [
'name',
'type',
'systemId',
]);
});
}
else {
(0, validator_1.checkAttributesNotNull)('application', data, [
'name',
'type',
'systemId',
]);
}
return [2 /*return*/, 0];
});
});
},
},
];
exports.default = checkers;

View File

@ -1,2 +1,2 @@
declare const checkers: (import("oak-domain/lib/types").Checker<import("../general-app-domain").EntityDict, "address", import("../context/RuntimeContext").RuntimeContext<import("../general-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../general-app-domain").EntityDict, "token", import("../context/RuntimeContext").RuntimeContext<import("../general-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../general-app-domain").EntityDict, "user", import("../context/RuntimeContext").RuntimeContext<import("../general-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../general-app-domain").EntityDict, "userEntityGrant", import("../context/RuntimeContext").RuntimeContext<import("../general-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../general-app-domain").EntityDict, "wechatQrCode", import("../context/RuntimeContext").RuntimeContext<import("../general-app-domain").EntityDict>>)[];
declare const checkers: (import("oak-domain/lib/types").Checker<import("../general-app-domain").EntityDict, "address", import("../context/RuntimeContext").RuntimeContext<import("../general-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../general-app-domain").EntityDict, "token", import("../context/RuntimeContext").RuntimeContext<import("../general-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../general-app-domain").EntityDict, "user", import("../context/RuntimeContext").RuntimeContext<import("../general-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../general-app-domain").EntityDict, "userEntityGrant", import("../context/RuntimeContext").RuntimeContext<import("../general-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../general-app-domain").EntityDict, "wechatQrCode", import("../context/RuntimeContext").RuntimeContext<import("../general-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../general-app-domain").EntityDict, "application", import("../context/RuntimeContext").RuntimeContext<import("../general-app-domain").EntityDict>>)[];
export default checkers;

View File

@ -6,7 +6,8 @@ var token_1 = tslib_1.__importDefault(require("./token"));
var user_1 = tslib_1.__importDefault(require("./user"));
var userEntityGrant_1 = tslib_1.__importDefault(require("./userEntityGrant"));
var wechatQrCode_1 = tslib_1.__importDefault(require("./wechatQrCode"));
var application_1 = tslib_1.__importDefault(require("./application"));
var check_1 = require("../utils/check");
var checkers = tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(address_1.default), false), tslib_1.__read(token_1.default), false), tslib_1.__read(user_1.default), false), tslib_1.__read(userEntityGrant_1.default), false), tslib_1.__read(wechatQrCode_1.default), false);
var checkers = tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(address_1.default), false), tslib_1.__read(token_1.default), false), tslib_1.__read(user_1.default), false), tslib_1.__read(userEntityGrant_1.default), false), tslib_1.__read(wechatQrCode_1.default), false), tslib_1.__read(application_1.default), false);
(0, check_1.processCheckers)(checkers);
exports.default = checkers;

5
lib/checkers/platform.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
import { Checker } from 'oak-domain/lib/types';
import { EntityDict } from '../general-app-domain';
import { RuntimeContext } from '../context/RuntimeContext';
declare const checkers: Checker<EntityDict, 'platform', RuntimeContext<EntityDict>>[];
export default checkers;

34
lib/checkers/platform.js Normal file
View File

@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var validator_1 = require("oak-domain/lib/utils/validator");
var checkers = [
{
type: 'data',
action: 'create',
entity: 'platform',
checker: function (_a, context) {
var operation = _a.operation;
return tslib_1.__awaiter(void 0, void 0, void 0, function () {
var action, data;
return tslib_1.__generator(this, function (_b) {
action = operation.action, data = operation.data;
if (data instanceof Array) {
data.forEach(function (ele) {
(0, validator_1.checkAttributesNotNull)('platform', ele, [
'name',
]);
});
}
else {
(0, validator_1.checkAttributesNotNull)('platform', data, [
'name',
]);
}
return [2 /*return*/, 0];
});
});
},
},
];
exports.default = checkers;

5
lib/checkers/system.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
import { Checker } from 'oak-domain/lib/types';
import { EntityDict } from '../general-app-domain';
import { RuntimeContext } from '../context/RuntimeContext';
declare const checkers: Checker<EntityDict, 'system', RuntimeContext<EntityDict>>[];
export default checkers;

30
lib/checkers/system.js Normal file
View File

@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var validator_1 = require("oak-domain/lib/utils/validator");
var checkers = [
{
type: 'data',
action: 'create',
entity: 'system',
checker: function (_a, context) {
var operation = _a.operation;
return tslib_1.__awaiter(void 0, void 0, void 0, function () {
var action, data;
return tslib_1.__generator(this, function (_b) {
action = operation.action, data = operation.data;
if (data instanceof Array) {
data.forEach(function (ele) {
(0, validator_1.checkAttributesNotNull)('system', ele, ['name', 'platformId']);
});
}
else {
(0, validator_1.checkAttributesNotNull)('system', data, ['name', 'platformId']);
}
return [2 /*return*/, 0];
});
});
},
},
];
exports.default = checkers;

View File

@ -4,89 +4,133 @@ 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 TabPane = antd_1.Tabs.TabPane;
function TencentAccount(props) {
var accounts = props.accounts, setValue = props.setValue, removeItem = props.removeItem, addItem = props.addItem;
return ((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: "\u817E\u8BAF\u4E91\u914D\u7F6E" })), (0, jsx_runtime_1.jsx)(antd_1.Tabs, tslib_1.__assign({ tabPosition: 'top', size: 'middle', type: "editable-card", hideAdd: !(accounts.length > 0), onEdit: function (targetKey, action) {
return ((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: "\u817E\u8BAF\u4E91\u914D\u7F6E" })), (0, jsx_runtime_1.jsx)(antd_1.Tabs, { tabPosition: 'top', size: 'middle', type: "editable-card", hideAdd: !(accounts.length > 0), onEdit: function (targetKey, action) {
if (action === 'add') {
addItem('', accounts.length);
}
else {
removeItem('', parseInt(targetKey, 10));
}
} }, { children: accounts.length > 0 ? (accounts.map(function (ele, idx) {
console.log(ele);
return ((0, jsx_runtime_1.jsx)(TabPane, tslib_1.__assign({ tab: "\u5E10\u53F7".concat(idx + 1) }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: false, labelAlign: "left", layout: "vertical", style: { marginTop: 10 } }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "secretId", name: "secretId" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165secretId", type: "text", value: ele.secretId, onChange: function (e) {
}, items: accounts.length > 0
? accounts.map(function (ele, idx) { return ({
key: "".concat(idx),
label: "\u5E10\u53F7".concat(idx + 1),
children: ((0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: false, labelAlign: "left", layout: "vertical", style: { marginTop: 10 } }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "secretId", name: "secretId" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165secretId", type: "text", value: ele.secretId, onChange: function (e) {
return setValue("".concat(idx, ".secretId"), e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "secretKey", name: "secretKey" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165secretKey", type: "text", value: ele.secretKey, onChange: function (e) {
return setValue("".concat(idx, ".secretKey"), e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "region", name: "region" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165region", type: "text", value: ele.region, onChange: function (e) {
return setValue("".concat(idx, ".region"), e.target.value);
} }) }) }))] })) }), idx));
})) : ((0, jsx_runtime_1.jsx)(TabPane, tslib_1.__assign({ tab: "\u65B0\u5EFA\u5E10\u53F7", closable: false }, { children: (0, jsx_runtime_1.jsxs)(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: "secretId", name: "secretId" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165secretId", type: "text", value: "", onChange: function (e) {
return setValue("0.secretId", e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "secretKey", name: "secretKey" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165secretKey", type: "text", value: "", onChange: function (e) {
return setValue("0.secretKey", e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "region", name: "region" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165region", type: "text", value: "", onChange: function (e) {
return setValue("0.region", e.target.value);
} }) }) }))] })) }), 0)) }))] })));
} }) }) }))] }))),
}); })
: [
{
label: '新建帐号',
key: '0',
children: ((0, jsx_runtime_1.jsxs)(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: "secretId", name: "secretId" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165secretId", type: "text", value: "", onChange: function (e) {
return setValue("0.secretId", e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "secretKey", name: "secretKey" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165secretKey", type: "text", value: "", onChange: function (e) {
return setValue("0.secretKey", e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "region", name: "region" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165region", type: "text", value: "", onChange: function (e) {
return setValue("0.region", e.target.value);
} }) }) }))] }))),
},
] })] })));
}
function QiniuAccount(props) {
var accounts = props.accounts, setValue = props.setValue, removeItem = props.removeItem, addItem = props.addItem;
return ((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: "\u4E03\u725B\u4E91\u914D\u7F6E" })), (0, jsx_runtime_1.jsx)(antd_1.Tabs, tslib_1.__assign({ tabPosition: 'top', size: 'middle', type: "editable-card", hideAdd: !(accounts.length > 0), onEdit: function (targetKey, action) {
return ((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: "\u4E03\u725B\u4E91\u914D\u7F6E" })), (0, jsx_runtime_1.jsx)(antd_1.Tabs, { tabPosition: 'top', size: 'middle', type: "editable-card", hideAdd: !(accounts.length > 0), onEdit: function (targetKey, action) {
if (action === 'add') {
addItem('', accounts.length);
}
else {
removeItem('', parseInt(targetKey, 10));
}
} }, { children: accounts.length > 0 ? (accounts.map(function (ele, idx) { return ((0, jsx_runtime_1.jsx)(TabPane, tslib_1.__assign({ tab: "\u5E10\u53F7".concat(idx + 1) }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: false, labelAlign: "left", layout: "vertical", style: { marginTop: 10 } }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "accessKey", name: "accessKey" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165accessKey", type: "text", value: ele.accessKey, onChange: function (e) {
return setValue("".concat(idx, ".accessKey"), e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "secretKey", name: "secretKey" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165secretKey", type: "text", value: ele.secretKey, onChange: function (e) {
return setValue("".concat(idx, ".secretKey"), e.target.value);
} }) }) }))] })) }), idx)); })) : ((0, jsx_runtime_1.jsx)(TabPane, tslib_1.__assign({ tab: "\u65B0\u5EFA\u5E10\u53F7", closable: false }, { children: (0, jsx_runtime_1.jsxs)(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: "accessKey", name: "accessKey" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165accessKey", type: "text", value: "", onChange: function (e) {
return setValue("0.accessKey", e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "secretKey", name: "secretKey" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165secretKey", type: "text", value: "", onChange: function (e) {
return setValue("0.secretKey", e.target.value);
} }) }) }))] })) }), 0)) }))] })));
}, items: accounts.length > 0
? accounts.map(function (ele, idx) { return ({
key: "".concat(idx),
label: "\u5E10\u53F7".concat(idx + 1),
children: ((0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: false, labelAlign: "left", layout: "vertical", style: { marginTop: 10 } }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "accessKey", name: "accessKey" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165accessKey", type: "text", value: ele.accessKey, onChange: function (e) {
return setValue("".concat(idx, ".accessKey"), e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "secretKey", name: "secretKey" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165secretKey", type: "text", value: ele.secretKey, onChange: function (e) {
return setValue("".concat(idx, ".secretKey"), e.target.value);
} }) }) }))] }))),
}); })
: [
{
label: '新建帐号',
key: '0',
children: ((0, jsx_runtime_1.jsxs)(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: "accessKey", name: "accessKey" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165accessKey", type: "text", value: "", onChange: function (e) {
return setValue("0.accessKey", e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "secretKey", name: "secretKey" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165secretKey", type: "text", value: "", onChange: function (e) {
return setValue("0.secretKey", e.target.value);
} }) }) }))] }))),
},
] })] })));
}
function AliAccount(props) {
var accounts = props.accounts, setValue = props.setValue, removeItem = props.removeItem, addItem = props.addItem;
return ((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: "\u963F\u91CC\u4E91\u914D\u7F6E" })), (0, jsx_runtime_1.jsx)(antd_1.Tabs, tslib_1.__assign({ tabPosition: 'top', size: 'middle', type: "editable-card", hideAdd: !(accounts.length > 0), onEdit: function (targetKey, action) {
return ((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: "\u963F\u91CC\u4E91\u914D\u7F6E" })), (0, jsx_runtime_1.jsx)(antd_1.Tabs, { tabPosition: 'top', size: 'middle', type: "editable-card", hideAdd: !(accounts.length > 0), onEdit: function (targetKey, action) {
if (action === 'add') {
addItem('', accounts.length);
}
else {
removeItem('', parseInt(targetKey, 10));
}
} }, { children: accounts.length > 0 ? (accounts.map(function (ele, idx) { return ((0, jsx_runtime_1.jsx)(TabPane, tslib_1.__assign({ tab: "\u5E10\u53F7".concat(idx + 1) }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: false, labelAlign: "left", layout: "vertical", style: { marginTop: 10 } }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "accessKeyId", name: "accessKeyId" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165accessKeyId", type: "text", value: ele.accessKeyId, onChange: function (e) {
return setValue("".concat(idx, ".accessKeyId"), e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "accessKeySecret", name: "accessKeySecret" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165accessKeySecret", type: "text", value: ele.accessKeySecret, onChange: function (e) {
return setValue("".concat(idx, ".accessKeySecret"), e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "regionId", name: "regionId" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165regionId", type: "text", value: ele.regionId, onChange: function (e) {
return setValue("".concat(idx, ".regionId"), e.target.value);
} }) }) }))] })) }), idx)); })) : ((0, jsx_runtime_1.jsx)(TabPane, tslib_1.__assign({ tab: "\u65B0\u5EFA\u5E10\u53F7", closable: false }, { children: (0, jsx_runtime_1.jsxs)(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: "accessKeyId", name: "accessKeyId" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165accessKeyId", type: "text", value: "", onChange: function (e) {
return setValue("0.accessKeyId", e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "accessKeySecret", name: "accessKeySecret" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165accessKeySecret", type: "text", value: "", onChange: function (e) {
return setValue("0.accessKeySecret", e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "regionId", name: "regionId" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165regionId", type: "text", value: "", onChange: function (e) {
return setValue("0.regionId", e.target.value);
} }) }) }))] })) }), 0)) }))] })));
}, items: accounts.length > 0
? accounts.map(function (ele, idx) { return ({
key: "".concat(idx),
label: "\u5E10\u53F7".concat(idx + 1),
children: ((0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: false, labelAlign: "left", layout: "vertical", style: { marginTop: 10 } }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "accessKeyId", name: "accessKeyId" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165accessKeyId", type: "text", value: ele.accessKeyId, onChange: function (e) {
return setValue("".concat(idx, ".accessKeyId"), e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "accessKeySecret", name: "accessKeySecret" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165accessKeySecret", type: "text", value: ele.accessKeySecret, onChange: function (e) {
return setValue("".concat(idx, ".accessKeySecret"), e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "regionId", name: "regionId" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165regionId", type: "text", value: ele.regionId, onChange: function (e) {
return setValue("".concat(idx, ".regionId"), e.target.value);
} }) }) }))] }))),
}); })
: [
{
label: '新建帐号',
key: '0',
children: ((0, jsx_runtime_1.jsxs)(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: "accessKeyId", name: "accessKeyId" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165accessKeyId", type: "text", value: "", onChange: function (e) {
return setValue("0.accessKeyId", e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "accessKeySecret", name: "accessKeySecret" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165accessKeySecret", type: "text", value: "", onChange: function (e) {
return setValue("0.accessKeySecret", e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "regionId", name: "regionId" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165regionId", type: "text", value: "", onChange: function (e) {
return setValue("0.regionId", e.target.value);
} }) }) }))] }))),
},
] })] })));
}
function AmapAccount(props) {
var accounts = props.accounts, setValue = props.setValue, removeItem = props.removeItem, addItem = props.addItem;
return ((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: "\u9AD8\u5FB7\u4E91\u914D\u7F6E" })), (0, jsx_runtime_1.jsx)(antd_1.Tabs, tslib_1.__assign({ tabPosition: "top", size: "middle", type: "editable-card", hideAdd: !(accounts.length > 0), onEdit: function (targetKey, action) {
return ((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: "\u9AD8\u5FB7\u4E91\u914D\u7F6E" })), (0, jsx_runtime_1.jsx)(antd_1.Tabs, { tabPosition: "top", size: "middle", type: "editable-card", hideAdd: !(accounts.length > 0), onEdit: function (targetKey, action) {
if (action === 'add') {
addItem('', accounts.length);
}
else {
removeItem('', parseInt(targetKey, 10));
}
} }, { children: accounts.length > 0 ? (accounts.map(function (ele, idx) { return ((0, jsx_runtime_1.jsx)(TabPane, tslib_1.__assign({ tab: "\u5E10\u53F7".concat(idx + 1) }, { children: (0, jsx_runtime_1.jsx)(antd_1.Form, tslib_1.__assign({ colon: false, labelAlign: "left", layout: "vertical", style: { marginTop: 10 } }, { children: (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "webApiKey", name: "webApiKey" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165webApiKey", type: "text", value: ele.webApiKey, onChange: function (e) {
return setValue("".concat(idx, ".webApiKey"), e.target.value);
} }) }) })) })) }), idx)); })) : ((0, jsx_runtime_1.jsx)(TabPane, tslib_1.__assign({ tab: "\u65B0\u5EFA\u5E10\u53F7", closable: false }, { 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: "webApiKey", name: "webApiKey" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165webApiKey", type: "text", value: "", onChange: function (e) {
return setValue("0.webApiKey", e.target.value);
} }) }) })) })) }), 0)) }))] })));
}, items: accounts.length > 0
? accounts.map(function (ele, idx) { return ({
key: "".concat(idx),
label: "\u5E10\u53F7".concat(idx + 1),
children: ((0, jsx_runtime_1.jsx)(antd_1.Form, tslib_1.__assign({ colon: false, labelAlign: "left", layout: "vertical", style: { marginTop: 10 } }, { children: (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "webApiKey", name: "webApiKey" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165webApiKey", type: "text", value: ele.webApiKey, onChange: function (e) {
return setValue("".concat(idx, ".webApiKey"), e.target.value);
} }) }) })) }))),
}); })
: [
{
label: '新建帐号',
key: '0',
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: "webApiKey", name: "webApiKey" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165webApiKey", type: "text", value: "", onChange: function (e) {
return setValue("0.webApiKey", e.target.value);
} }) }) })) }))),
},
] })] })));
}
function Account(props) {
var account = props.account, setValue = props.setValue, removeItem = props.removeItem;

View File

@ -1,7 +1,7 @@
.container {
background: var(--oak-bg-color-container);
box-shadow: 0 2px 3px #0000001a;
border-radius: 3px;
// box-shadow: 0 2px 3px #0000001a;
// border-radius: 3px;
padding: 30px 32px;
}

3
lib/pages/application/list/index.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
/// <reference types="react" />
declare const _default: import("react").ComponentType<any>;
export default _default;

View File

@ -0,0 +1,84 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
exports.default = OakComponent({
isList: true,
entity: 'application',
projection: {
id: 1,
name: 1,
description: 1,
config: 1,
systemId: 1,
type: 1,
},
filters: [
{
filter: function (_a) {
var props = _a.props;
return tslib_1.__awaiter(void 0, void 0, void 0, function () {
return tslib_1.__generator(this, function (_b) {
if (props.systemId) {
return [2 /*return*/, {
systemId: props.systemId,
}];
}
return [2 /*return*/, {}];
});
});
},
},
],
formData: function (_a) {
var data = _a.data;
return tslib_1.__awaiter(this, void 0, void 0, function () {
var pagination;
return tslib_1.__generator(this, function (_b) {
pagination = this.getPagination();
return [2 /*return*/, {
list: data,
pagination: pagination,
}];
});
});
},
data: {
open: false,
},
methods: {
goDetail: function (id) {
this.navigateTo({
url: '/application/detail',
oakId: id,
});
},
goUpdate: function (id) {
this.navigateTo({
url: '/application/upsert',
oakId: id,
});
},
goSetConfig: function (id) {
this.navigateTo({
url: '/application/config/upsert',
oakId: id,
});
},
goCreate: function () {
var _a = this.props, width = _a.width, systemId = _a.systemId;
// if (width === 'xs') {
// this.navigateTo({
// url: '/application/upsert',
// });
// return;
// }
// this.setState({
// open: true,
// });
this.navigateTo({
url: '/application/upsert',
systemId: systemId,
});
},
},
});

View File

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

View File

@ -0,0 +1,90 @@
"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"));
// import ApplicationUpsert from '../../../pages/application/upsert';
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
function render() {
var _this = this;
var _a = this.props, variant = _a.variant, namespace = _a.namespace, systemId = _a.systemId;
var _b = this.state, _c = _b.list, list = _c === void 0 ? [] : _c, oakLoading = _b.oakLoading, pagination = _b.pagination;
var _d = pagination || {}, pageSize = _d.pageSize, total = _d.total, currentPage = _d.currentPage;
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 () {
_this.goCreate();
} }, { children: "\u6DFB\u52A0\u5E94\u7528" })) }), (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 () {
_this.goDetail(record.id);
} }, { children: value })));
},
},
{
dataIndex: 'description',
title: '应用描述',
width: 200,
ellipsis: true,
},
{
dataIndex: 'type',
title: '应用类型',
render: function (value, record, index) {
return _this.t("application:v.type.".concat(value));
},
},
{
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 () {
_this.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 () {
_this.goDetail(record.id);
} }, { children: "\u8BE6\u60C5" })), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "link", onClick: function () {
_this.goUpdate(record.id);
} }, { children: "\u66F4\u65B0" }))] }));
},
fixed: 'right',
},
], pagination: {
total: total,
pageSize: pageSize,
current: currentPage,
onShowSizeChange: function (pageSize) {
_this.setPageSize(pageSize);
},
onChange: function (current) {
_this.setCurrentPage(current);
},
} })] })));
}
exports.default = render;
function Container(props) {
var children = props.children, variant = props.variant, showBack = props.showBack;
if (variant === 'inline') {
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 })) })));
}

View File

@ -0,0 +1,3 @@
/// <reference types="react" />
declare const _default: import("react").ComponentType<any>;
export default _default;

View File

@ -0,0 +1,61 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
exports.default = OakComponent({
isList: false,
entity: 'application',
projection: {
id: 1,
name: 1,
config: 1,
description: 1,
type: 1,
systemId: 1,
},
formData: function (_a) {
var data = _a.data;
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_b) {
return [2 /*return*/, data || {}];
});
});
},
data: {
typeArr: [
{
value: 'web',
},
{
value: "wechatMp",
},
{
value: "wechatPublic",
},
],
},
lifetimes: {
ready: function () {
var _a = this.props, systemId = _a.systemId, oakId = _a.oakId;
if (!oakId) {
if (systemId) {
this.setUpdateData('systemId', systemId);
}
}
},
},
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*/];
}
});
});
},
},
});

View File

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

View File

@ -0,0 +1,48 @@
"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 input_1 = tslib_1.__importDefault(require("../../../components/common/input"));
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
function render() {
var _this = this;
var _a = this.props, variant = _a.variant, _b = _a.showBack, showBack = _b === void 0 ? true : _b, oakId = _a.oakId, systemId = _a.systemId;
var _c = this.state, name = _c.name, description = _c.description, type = _c.type, typeArr = _c.typeArr;
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)(input_1.default, { onChange: function (e) {
_this.setUpdateData('name', e.target.value);
}, value: name }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u63CF\u8FF0", requiredMark: true, name: "description" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(input_1.default.TextArea, { onChange: function (e) {
_this.setUpdateData('description', e.target.value);
}, value: description }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u5E94\u7528\u7C7B\u578B", requiredMark: true, name: "type", rules: [
{
required: true,
},
] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Select, { value: type, style: { width: 120 }, disabled: !!oakId, options: typeArr.map(function (ele) { return ({
label: _this.t("application:v.type.".concat(ele.value)),
value: ele.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 () {
_this.confirm();
} }, { children: "\u786E\u5B9A" })), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ onClick: function () {
_this.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: "\u5E94\u7528\u7F16\u8F91" }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: children })) })));
}

View File

@ -8,6 +8,6 @@ var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
function render() {
var _a = this.props, namespace = _a.namespace, oakId = _a.oakId;
var _b = this.state, config = _b.config, name = _b.name;
return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: (0, jsx_runtime_1.jsx)(upsert_1.default, { config: config, entity: "platform", entityId: oakId, name: name, namespace: namespace }) })) }));
return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ showBack: true, title: "\u5E73\u53F0\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)(upsert_1.default, { config: config, entity: "platform", entityId: oakId, name: name, namespace: namespace }) })) })));
}
exports.default = render;

View File

@ -2,11 +2,24 @@
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 list_1 = tslib_1.__importDefault(require("../../../pages/system/list"));
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
function render() {
var _a = this.props, namespace = _a.namespace, oakId = _a.oakId;
var _b = this.state, config = _b.config, name = _b.name;
return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, { children: (0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.container }) }));
return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ showBack: true, title: "\u5E73\u53F0\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: '平台概览',
children: (0, jsx_runtime_1.jsx)("div", { children: "\u8BE6\u60C5" }),
},
{
label: '系统管理',
key: '系统管理',
children: ((0, jsx_runtime_1.jsx)(list_1.default, { namespace: namespace, platformId: oakId, variant: "inline", oakPath: "$platform/detail/-system/list", oakAutoUnmount: true })),
},
] }) })) })) })));
}
exports.default = render;

View File

@ -9,24 +9,31 @@ function render() {
var _this = this;
var _a = this.state, _b = _a.list, list = _b === void 0 ? [] : _b, oakLoading = _a.oakLoading, pagination = _a.pagination;
var _c = pagination || {}, pageSize = _c.pageSize, total = _c.total, currentPage = _c.currentPage;
return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, { children: (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { 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 () {
return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ title: "\u5E73\u53F0\u7BA1\u7406" }, { children: (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { 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 () {
_this.goNewPlatform();
} }, { children: "\u6DFB\u52A0\u5E73\u53F0" })) }), (0, jsx_runtime_1.jsx)(antd_1.Table, { loading: oakLoading, dataSource: list, rowKey: "id", columns: [
{
dataIndex: 'id',
title: '序号',
render: function (value, record, index) {
return index + 1;
},
},
// {
// dataIndex: 'id',
// title: '序号',
// render: (value, record, index) => {
// return index + 1;
// },
// },
{
dataIndex: 'name',
title: '名称',
title: '平台名称',
width: 300,
render: function (value, record, index) {
return ((0, jsx_runtime_1.jsx)(antd_1.Typography.Link, tslib_1.__assign({ onClick: function () {
_this.goDetail(record.id);
} }, { children: value })));
},
},
{
dataIndex: 'description',
title: '描述',
width: 400,
width: 200,
ellipsis: true,
},
{
dataIndex: 'config',
@ -46,7 +53,7 @@ function render() {
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 () {
_this.goDetail(record.id);
} }, { children: "\u8BE6\u60C5" })), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "link", onClick: function () {
} }, { children: "\u6982\u89C8" })), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "link", onClick: function () {
_this.goUpdate(record.id);
} }, { children: "\u66F4\u65B0" }))] }));
},
@ -62,6 +69,6 @@ function render() {
onChange: function (current) {
_this.setCurrentPage(current);
},
} })] })) }));
} })] })) })));
}
exports.default = render;

View File

@ -9,7 +9,7 @@ var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
function render() {
var _this = this;
var _a = this.state, name = _a.name, description = _a.description;
return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, { 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: [
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: [
{
required: true,
},
@ -19,6 +19,6 @@ function render() {
_this.setUpdateData('description', e.target.value);
}, value: description }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 4 } }, { children: (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () {
_this.confirm();
} }, { children: "\u786E\u5B9A" })) }))] })) })) }) })) }));
} }, { children: "\u786E\u5B9A" })) }))] })) })) }) })) })));
}
exports.default = render;

View File

@ -0,0 +1,3 @@
/// <reference types="react" />
declare const _default: import("react").ComponentType<any>;
export default _default;

View File

@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
exports.default = OakComponent({
isList: false,
entity: 'system',
projection: {
id: 1,
name: 1,
config: 1,
},
formData: function (_a) {
var data = _a.data;
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_b) {
return [2 /*return*/, data || {}];
});
});
},
methods: {},
});

View File

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

View File

@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var jsx_runtime_1 = require("react/jsx-runtime");
var upsert_1 = tslib_1.__importDefault(require("../../../../components/config/upsert"));
var pageHeader_1 = tslib_1.__importDefault(require("../../../../components/common/pageHeader"));
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
function render() {
var _a = this.props, namespace = _a.namespace, oakId = _a.oakId;
var _b = this.state, config = _b.config, name = _b.name;
return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ showBack: true, title: "\u7CFB\u7EDF\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)(upsert_1.default, { config: config, entity: "system", entityId: oakId, name: name, namespace: namespace }) })) })));
}
exports.default = render;

3
lib/pages/system/detail/index.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
/// <reference types="react" />
declare const _default: import("react").ComponentType<any>;
export default _default;

View File

@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
exports.default = OakComponent({
isList: false,
entity: 'system',
projection: {
id: 1,
name: 1,
config: 1,
description: 1,
super: 1,
},
formData: function (_a) {
var data = _a.data;
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_b) {
return [2 /*return*/, data || {}];
});
});
},
methods: {},
});

2
lib/pages/system/detail/web.d.ts vendored Normal file
View File

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

View File

@ -0,0 +1,25 @@
"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 list_1 = tslib_1.__importDefault(require("../../../pages/application/list"));
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
function render() {
var _a = this.props, namespace = _a.namespace, oakId = _a.oakId;
var _b = this.state, config = _b.config, name = _b.name;
return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ showBack: true, title: "\u7CFB\u7EDF\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: '系统概览',
children: (0, jsx_runtime_1.jsx)("div", { children: "\u8BE6\u60C5" }),
},
{
label: '应用管理',
key: '应用管理',
children: ((0, jsx_runtime_1.jsx)(list_1.default, { namespace: namespace, systemId: oakId, variant: "inline", oakPath: "$system/detail-application/list" })),
},
] }) })) })) })));
}
exports.default = render;

3
lib/pages/system/list/index.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
/// <reference types="react" />
declare const _default: import("react").ComponentType<any>;
export default _default;

View File

@ -0,0 +1,81 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
exports.default = OakComponent({
isList: true,
entity: 'system',
projection: {
id: 1,
name: 1,
description: 1,
config: 1,
super: 1,
platformId: 1,
},
filters: [
{
filter: function (_a) {
var props = _a.props;
return tslib_1.__awaiter(void 0, void 0, void 0, function () {
return tslib_1.__generator(this, function (_b) {
if (props.platformId) {
return [2 /*return*/, {
platformId: props.platformId,
}];
}
return [2 /*return*/, {}];
});
});
},
},
],
formData: function (_a) {
var data = _a.data;
return tslib_1.__awaiter(this, void 0, void 0, function () {
var pagination;
return tslib_1.__generator(this, function (_b) {
pagination = this.getPagination();
return [2 /*return*/, {
list: data,
pagination: pagination,
}];
});
});
},
data: {
open: false,
},
methods: {
goDetail: function (id) {
this.navigateTo({
url: '/system/detail',
oakId: id,
});
},
goUpdate: function (id) {
this.navigateTo({
url: '/system/upsert',
oakId: id,
});
},
goSetConfig: function (id) {
this.navigateTo({
url: '/system/config/upsert',
oakId: id,
});
},
goCreate: function () {
var _a = this.props, width = _a.width, platformId = _a.platformId;
if (width === 'xs') {
this.navigateTo({
url: '/system/upsert',
platformId: platformId,
});
return;
}
this.setState({
open: true,
});
},
},
});

2
lib/pages/system/list/web.pc.d.ts vendored Normal file
View File

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

View File

@ -0,0 +1,117 @@
"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 upsert_1 = tslib_1.__importDefault(require("../../../pages/system/upsert"));
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
function render() {
var _this = this;
var _a = this.props, variant = _a.variant, namespace = _a.namespace, platformId = _a.platformId, showBack = _a.showBack;
var _b = this.state, _c = _b.list, list = _c === void 0 ? [] : _c, oakLoading = _b.oakLoading, pagination = _b.pagination;
var _d = pagination || {}, pageSize = _d.pageSize, total = _d.total, currentPage = _d.currentPage;
return ((0, jsx_runtime_1.jsxs)(Container, tslib_1.__assign({ showBack: showBack, 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 () {
_this.goCreate();
} }, { children: "\u6DFB\u52A0\u7CFB\u7EDF" })) }), (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 () {
_this.goDetail(record.id);
} }, { children: value })));
},
},
{
dataIndex: 'description',
title: '描述',
width: 200,
ellipsis: true,
},
{
dataIndex: 'super',
title: '是否为超级系统',
render: function (value, record, index) {
return value ? '是' : '否';
},
},
{
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 () {
_this.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 () {
_this.goDetail(record.id);
} }, { children: "\u8BE6\u60C5" })), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "link", onClick: function () {
_this.goUpdate(record.id);
} }, { children: "\u66F4\u65B0" }))] }));
},
fixed: 'right',
},
], pagination: {
total: total,
pageSize: pageSize,
current: currentPage,
onShowSizeChange: function (pageSize) {
_this.setPageSize(pageSize);
},
onChange: function (current) {
_this.setCurrentPage(current);
},
} }), (0, jsx_runtime_1.jsx)(antd_1.Modal, tslib_1.__assign({ title: "\u521B\u5EFA\u7CFB\u7EDF", destroyOnClose: true, open: this.state.open, onCancel: function () {
_this.setState({
open: false,
});
}, width: "60%", onOk: function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
var _a;
var _b, _c;
return tslib_1.__generator(this, function (_d) {
switch (_d.label) {
case 0:
_a = this.execute;
_b = {
action: 'create'
};
_c = {};
return [4 /*yield*/, generateNewId()];
case 1: return [4 /*yield*/, _a.apply(this, [(_b.data = (_c.id = _d.sent(),
_c),
_b)])];
case 2:
_d.sent();
this.setState({
open: false,
});
return [2 /*return*/];
}
});
}); }, okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88" }, { children: (0, jsx_runtime_1.jsx)(upsert_1.default, { platformId: platformId, namespace: namespace, variant: "dialog", oakPath: this.state.oakFullpath }) }))] })));
}
exports.default = render;
function Container(props) {
var children = props.children, variant = props.variant, showBack = props.showBack;
if (variant === 'inline') {
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: "\u7CFB\u7EDF\u7BA1\u7406" }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: children })) })));
}

3
lib/pages/system/upsert/index.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
/// <reference types="react" />
declare const _default: import("react").ComponentType<any>;
export default _default;

View File

@ -0,0 +1,47 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
exports.default = OakComponent({
isList: false,
entity: 'system',
projection: {
id: 1,
name: 1,
config: 1,
description: 1,
super: 1,
},
formData: function (_a) {
var data = _a.data;
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_b) {
return [2 /*return*/, data || {}];
});
});
},
lifetimes: {
ready: function () {
var _a = this.props, platformId = _a.platformId, oakId = _a.oakId;
if (!oakId) {
if (platformId) {
this.setUpdateData('platformId', platformId);
}
}
},
},
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*/];
}
});
});
}
},
});

2
lib/pages/system/upsert/web.pc.d.ts vendored Normal file
View File

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

View File

@ -0,0 +1,41 @@
"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 input_1 = tslib_1.__importDefault(require("../../../components/common/input"));
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
function render() {
var _this = this;
var _a = this.props, variant = _a.variant, _b = _a.showBack, showBack = _b === void 0 ? true : _b;
var _c = this.state, name = _c.name, description = _c.description, super2 = _c.super;
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)(input_1.default, { onChange: function (e) {
_this.setUpdateData('name', e.target.value);
}, value: name }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u63CF\u8FF0", requiredMark: true, name: "description" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(input_1.default.TextArea, { onChange: function (e) {
_this.setUpdateData('description', e.target.value);
}, value: description }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u662F\u5426\u4E3A\u8D85\u7EA7\u7CFB\u7EDF", requiredMark: true, name: "super" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Switch, { checkedChildren: "\u662F", unCheckedChildren: "\u5426", checked: super2, onChange: function (checked) {
_this.setUpdateData('super', checked);
} }) }) })), (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.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () {
_this.confirm();
} }, { children: "\u786E\u5B9A" })) })) }))] })) })) }) })));
}
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: "\u7CFB\u7EDF\u7F16\u8F91" }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: children })) })));
}

View File

@ -0,0 +1,38 @@
import { checkFilterContains } from 'oak-domain/lib/store/actionDef';
import { Checker, CreateChecker } from 'oak-domain/lib/types';
import { EntityDict } from '../general-app-domain';
import { RuntimeContext } from '../context/RuntimeContext';
import { checkAttributesNotNull } from 'oak-domain/lib/utils/validator';
const checkers: Checker<
EntityDict,
'application',
RuntimeContext<EntityDict>
>[] = [
{
type: 'data',
action: 'create',
entity: 'application',
checker: async ({ operation }, context) => {
const { action, data } = operation;
if (data instanceof Array) {
data.forEach((ele) => {
checkAttributesNotNull('application', ele, [
'name',
'type',
'systemId',
]);
});
} else {
checkAttributesNotNull('application', data, [
'name',
'type',
'systemId',
]);
}
return 0;
},
} as CreateChecker<EntityDict, 'application', RuntimeContext<EntityDict>>,
];
export default checkers;

View File

@ -3,6 +3,7 @@ import tokenCheckers from './token';
import userCheckers from './user';
import userEntityGrantCheckers from './userEntityGrant';
import wechatQrCodeCheckers from './wechatQrCode';
import applicationCheckers from './application';
import { processCheckers } from '../utils/check';
@ -12,6 +13,7 @@ const checkers = [
...userCheckers,
...userEntityGrantCheckers,
...wechatQrCodeCheckers,
...applicationCheckers,
];
processCheckers(checkers as any);

31
src/checkers/platform.ts Normal file
View File

@ -0,0 +1,31 @@
import { checkFilterContains } from 'oak-domain/lib/store/actionDef';
import { Checker, CreateChecker } from 'oak-domain/lib/types';
import { EntityDict } from '../general-app-domain';
import { RuntimeContext } from '../context/RuntimeContext';
import { checkAttributesNotNull } from 'oak-domain/lib/utils/validator';
const checkers: Checker<EntityDict, 'platform', RuntimeContext<EntityDict>>[] =
[
{
type: 'data',
action: 'create',
entity: 'platform',
checker: async ({ operation }, context) => {
const { action, data } = operation;
if (data instanceof Array) {
data.forEach((ele) => {
checkAttributesNotNull('platform', ele, [
'name',
]);
});
} else {
checkAttributesNotNull('platform', data, [
'name',
]);
}
return 0;
},
} as CreateChecker<EntityDict, 'platform', RuntimeContext<EntityDict>>,
];
export default checkers;

26
src/checkers/system.ts Normal file
View File

@ -0,0 +1,26 @@
import { checkFilterContains } from 'oak-domain/lib/store/actionDef';
import { Checker, CreateChecker } from 'oak-domain/lib/types';
import { EntityDict } from '../general-app-domain';
import { RuntimeContext } from '../context/RuntimeContext';
import { checkAttributesNotNull } from 'oak-domain/lib/utils/validator';
const checkers: Checker<EntityDict, 'system', RuntimeContext<EntityDict>>[] = [
{
type: 'data',
action: 'create',
entity: 'system',
checker: async ({ operation }, context) => {
const { action, data } = operation;
if (data instanceof Array) {
data.forEach((ele) => {
checkAttributesNotNull('system', ele, ['name', 'platformId']);
});
} else {
checkAttributesNotNull('system', data, ['name', 'platformId']);
}
return 0;
},
} as CreateChecker<EntityDict, 'system', RuntimeContext<EntityDict>>,
];
export default checkers;

View File

@ -1,9 +1,14 @@
import React, { useState } from 'react';
import { Tabs, Row, Col, Card, Divider, Input, Form, Space } from 'antd';
import Styles from './web.module.less';
import { AliCloudConfig, AmapCloudConfig, Config, QiniuCloudConfig, TencentCloudConfig } from '../../../../types/Config';
import {
AliCloudConfig,
AmapCloudConfig,
Config,
QiniuCloudConfig,
TencentCloudConfig,
} from '../../../../types/Config';
const { TabPane } = Tabs;
function TencentAccount(props: {
accounts: TencentCloudConfig[];
@ -29,124 +34,143 @@ function TencentAccount(props: {
removeItem('', parseInt(targetKey, 10));
}
}}
>
{accounts.length > 0 ? (
accounts.map((ele, idx) => {
console.log(ele);
return (
<TabPane key={idx} tab={`帐号${idx + 1}`}>
<Form
colon={false}
labelAlign="left"
layout="vertical"
style={{ marginTop: 10 }}
>
<Form.Item label="secretId" name="secretId">
<>
<Input
placeholder="请输入secretId"
type="text"
value={ele.secretId}
onChange={(e) =>
setValue(
`${idx}.secretId`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item
label="secretKey"
name="secretKey"
>
<>
<Input
placeholder="请输入secretKey"
type="text"
value={ele.secretKey}
onChange={(e) =>
setValue(
`${idx}.secretKey`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item label="region" name="region">
<>
<Input
placeholder="请输入region"
type="text"
value={ele.region}
onChange={(e) =>
setValue(
`${idx}.region`,
e.target.value
)
}
/>
</>
</Form.Item>
</Form>
</TabPane>
);
})
) : (
<TabPane key={0} tab="新建帐号" closable={false}>
<Form
colon={true}
labelAlign="left"
layout="vertical"
style={{ marginTop: 10 }}
>
<Form.Item label="secretId" name="secretId">
<>
<Input
placeholder="请输入secretId"
type="text"
value=""
onChange={(e) =>
setValue(
`0.secretId`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item label="secretKey" name="secretKey">
<>
<Input
placeholder="请输入secretKey"
type="text"
value=""
onChange={(e) =>
setValue(
`0.secretKey`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item label="region" name="region">
<>
<Input
placeholder="请输入region"
type="text"
value=""
onChange={(e) =>
setValue(`0.region`, e.target.value)
}
/>
</>
</Form.Item>
</Form>
</TabPane>
)}
</Tabs>
items={
accounts.length > 0
? accounts.map((ele, idx) => ({
key: `${idx}`,
label: `帐号${idx + 1}`,
children: (
<Form
colon={false}
labelAlign="left"
layout="vertical"
style={{ marginTop: 10 }}
>
<Form.Item
label="secretId"
name="secretId"
>
<>
<Input
placeholder="请输入secretId"
type="text"
value={ele.secretId}
onChange={(e) =>
setValue(
`${idx}.secretId`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item
label="secretKey"
name="secretKey"
>
<>
<Input
placeholder="请输入secretKey"
type="text"
value={ele.secretKey}
onChange={(e) =>
setValue(
`${idx}.secretKey`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item label="region" name="region">
<>
<Input
placeholder="请输入region"
type="text"
value={ele.region}
onChange={(e) =>
setValue(
`${idx}.region`,
e.target.value
)
}
/>
</>
</Form.Item>
</Form>
),
}))
: [
{
label: '新建帐号',
key: '0',
children: (
<Form
colon={true}
labelAlign="left"
layout="vertical"
style={{ marginTop: 10 }}
>
<Form.Item
label="secretId"
name="secretId"
>
<>
<Input
placeholder="请输入secretId"
type="text"
value=""
onChange={(e) =>
setValue(
`0.secretId`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item
label="secretKey"
name="secretKey"
>
<>
<Input
placeholder="请输入secretKey"
type="text"
value=""
onChange={(e) =>
setValue(
`0.secretKey`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item
label="region"
name="region"
>
<>
<Input
placeholder="请输入region"
type="text"
value=""
onChange={(e) =>
setValue(
`0.region`,
e.target.value
)
}
/>
</>
</Form.Item>
</Form>
),
},
]
}
></Tabs>
</Col>
);
}
@ -170,96 +194,115 @@ function QiniuAccount(props: {
hideAdd={!(accounts.length > 0)}
onEdit={(targetKey: any, action: 'add' | 'remove') => {
if (action === 'add') {
addItem('', accounts.length);
addItem('', accounts.length);
} else {
removeItem('', parseInt(targetKey, 10));
}
}}
>
{accounts.length > 0 ? (
accounts.map((ele, idx) => (
<TabPane key={idx} tab={`帐号${idx + 1}`}>
<Form
colon={false}
labelAlign="left"
layout="vertical"
style={{ marginTop: 10 }}
>
<Form.Item label="accessKey" name="accessKey">
<>
<Input
placeholder="请输入accessKey"
type="text"
value={ele.accessKey}
onChange={(e) =>
setValue(
`${idx}.accessKey`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item label="secretKey" name="secretKey">
<>
<Input
placeholder="请输入secretKey"
type="text"
value={ele.secretKey}
onChange={(e) =>
setValue(
`${idx}.secretKey`,
e.target.value
)
}
/>
</>
</Form.Item>
</Form>
</TabPane>
))
) : (
<TabPane key={0} tab="新建帐号" closable={false}>
<Form
colon={true}
labelAlign="left"
layout="vertical"
style={{ marginTop: 10 }}
>
<Form.Item label="accessKey" name="accessKey">
<>
<Input
placeholder="请输入accessKey"
type="text"
value=""
onChange={(e) =>
setValue(
`0.accessKey`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item label="secretKey" name="secretKey">
<>
<Input
placeholder="请输入secretKey"
type="text"
value=""
onChange={(e) =>
setValue(
`0.secretKey`,
e.target.value
)
}
/>
</>
</Form.Item>
</Form>
</TabPane>
)}
</Tabs>
items={
accounts.length > 0
? accounts.map((ele, idx) => ({
key: `${idx}`,
label: `帐号${idx + 1}`,
children: (
<Form
colon={false}
labelAlign="left"
layout="vertical"
style={{ marginTop: 10 }}
>
<Form.Item
label="accessKey"
name="accessKey"
>
<>
<Input
placeholder="请输入accessKey"
type="text"
value={ele.accessKey}
onChange={(e) =>
setValue(
`${idx}.accessKey`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item
label="secretKey"
name="secretKey"
>
<>
<Input
placeholder="请输入secretKey"
type="text"
value={ele.secretKey}
onChange={(e) =>
setValue(
`${idx}.secretKey`,
e.target.value
)
}
/>
</>
</Form.Item>
</Form>
),
}))
: [
{
label: '新建帐号',
key: '0',
children: (
<Form
colon={true}
labelAlign="left"
layout="vertical"
style={{ marginTop: 10 }}
>
<Form.Item
label="accessKey"
name="accessKey"
>
<>
<Input
placeholder="请输入accessKey"
type="text"
value=""
onChange={(e) =>
setValue(
`0.accessKey`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item
label="secretKey"
name="secretKey"
>
<>
<Input
placeholder="请输入secretKey"
type="text"
value=""
onChange={(e) =>
setValue(
`0.secretKey`,
e.target.value
)
}
/>
</>
</Form.Item>
</Form>
),
},
]
}
></Tabs>
</Col>
);
}
@ -288,135 +331,150 @@ function AliAccount(props: {
removeItem('', parseInt(targetKey, 10));
}
}}
>
{accounts.length > 0 ? (
accounts.map((ele, idx) => (
<TabPane key={idx} tab={`帐号${idx + 1}`}>
<Form
colon={false}
labelAlign="left"
layout="vertical"
style={{ marginTop: 10 }}
>
<Form.Item
label="accessKeyId"
name="accessKeyId"
>
<>
<Input
placeholder="请输入accessKeyId"
type="text"
value={ele.accessKeyId}
onChange={(e) =>
setValue(
`${idx}.accessKeyId`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item
label="accessKeySecret"
name="accessKeySecret"
>
<>
<Input
placeholder="请输入accessKeySecret"
type="text"
value={ele.accessKeySecret}
onChange={(e) =>
setValue(
`${idx}.accessKeySecret`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item label="regionId" name="regionId">
<>
<Input
placeholder="请输入regionId"
type="text"
value={ele.regionId}
onChange={(e) =>
setValue(
`${idx}.regionId`,
e.target.value
)
}
/>
</>
</Form.Item>
</Form>
</TabPane>
))
) : (
<TabPane key={0} tab="新建帐号" closable={false}>
<Form
colon={true}
labelAlign="left"
layout="vertical"
style={{ marginTop: 10 }}
>
<Form.Item label="accessKeyId" name="accessKeyId">
<>
<Input
placeholder="请输入accessKeyId"
type="text"
value=""
onChange={(e) =>
setValue(
`0.accessKeyId`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item
label="accessKeySecret"
name="accessKeySecret"
>
<>
<Input
placeholder="请输入accessKeySecret"
type="text"
value=""
onChange={(e) =>
setValue(
`0.accessKeySecret`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item label="regionId" name="regionId">
<>
<Input
placeholder="请输入regionId"
type="text"
value=""
onChange={(e) =>
setValue(
`0.regionId`,
e.target.value
)
}
/>
</>
</Form.Item>
</Form>
</TabPane>
)}
</Tabs>
items={
accounts.length > 0
? accounts.map((ele, idx) => ({
key: `${idx}`,
label: `帐号${idx + 1}`,
children: (
<Form
colon={false}
labelAlign="left"
layout="vertical"
style={{ marginTop: 10 }}
>
<Form.Item
label="accessKeyId"
name="accessKeyId"
>
<>
<Input
placeholder="请输入accessKeyId"
type="text"
value={ele.accessKeyId}
onChange={(e) =>
setValue(
`${idx}.accessKeyId`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item
label="accessKeySecret"
name="accessKeySecret"
>
<>
<Input
placeholder="请输入accessKeySecret"
type="text"
value={ele.accessKeySecret}
onChange={(e) =>
setValue(
`${idx}.accessKeySecret`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item
label="regionId"
name="regionId"
>
<>
<Input
placeholder="请输入regionId"
type="text"
value={ele.regionId}
onChange={(e) =>
setValue(
`${idx}.regionId`,
e.target.value
)
}
/>
</>
</Form.Item>
</Form>
),
}))
: [
{
label: '新建帐号',
key: '0',
children: (
<Form
colon={true}
labelAlign="left"
layout="vertical"
style={{ marginTop: 10 }}
>
<Form.Item
label="accessKeyId"
name="accessKeyId"
>
<>
<Input
placeholder="请输入accessKeyId"
type="text"
value=""
onChange={(e) =>
setValue(
`0.accessKeyId`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item
label="accessKeySecret"
name="accessKeySecret"
>
<>
<Input
placeholder="请输入accessKeySecret"
type="text"
value=""
onChange={(e) =>
setValue(
`0.accessKeySecret`,
e.target.value
)
}
/>
</>
</Form.Item>
<Form.Item
label="regionId"
name="regionId"
>
<>
<Input
placeholder="请输入regionId"
type="text"
value=""
onChange={(e) =>
setValue(
`0.regionId`,
e.target.value
)
}
/>
</>
</Form.Item>
</Form>
),
},
]
}
></Tabs>
</Col>
);
}
function AmapAccount(props: {
accounts: AmapCloudConfig[];
setValue: (path: string, value: any) => void;
@ -441,69 +499,82 @@ function AmapAccount(props: {
removeItem('', parseInt(targetKey, 10));
}
}}
>
{accounts.length > 0 ? (
accounts.map((ele, idx) => (
<TabPane key={idx} tab={`帐号${idx + 1}`}>
<Form
colon={false}
labelAlign="left"
layout="vertical"
style={{ marginTop: 10 }}
>
<Form.Item label="webApiKey" name="webApiKey">
<>
<Input
placeholder="请输入webApiKey"
type="text"
value={ele.webApiKey}
onChange={(e) =>
setValue(
`${idx}.webApiKey`,
e.target.value
)
}
/>
</>
</Form.Item>
</Form>
</TabPane>
))
) : (
<TabPane key={0} tab="新建帐号" closable={false}>
<Form
colon={true}
labelAlign="left"
layout="vertical"
style={{ marginTop: 10 }}
>
<Form.Item label="webApiKey" name="webApiKey">
<>
<Input
placeholder="请输入webApiKey"
type="text"
value=""
onChange={(e) =>
setValue(
`0.webApiKey`,
e.target.value
)
}
/>
</>
</Form.Item>
</Form>
</TabPane>
)}
</Tabs>
items={
accounts.length > 0
? accounts.map((ele, idx) => ({
key: `${idx}`,
label: `帐号${idx + 1}`,
children: (
<Form
colon={false}
labelAlign="left"
layout="vertical"
style={{ marginTop: 10 }}
>
<Form.Item
label="webApiKey"
name="webApiKey"
>
<>
<Input
placeholder="请输入webApiKey"
type="text"
value={ele.webApiKey}
onChange={(e) =>
setValue(
`${idx}.webApiKey`,
e.target.value
)
}
/>
</>
</Form.Item>
</Form>
),
}))
: [
{
label: '新建帐号',
key: '0',
children: (
<Form
colon={true}
labelAlign="left"
layout="vertical"
style={{ marginTop: 10 }}
>
<Form.Item
label="webApiKey"
name="webApiKey"
>
<>
<Input
placeholder="请输入webApiKey"
type="text"
value=""
onChange={(e) =>
setValue(
`0.webApiKey`,
e.target.value
)
}
/>
</>
</Form.Item>
</Form>
),
},
]
}
></Tabs>
</Col>
);
}
export default function Account(props: {
account: Required<Config>['Account'],
setValue: (path: string, value: any) => void
removeItem: (path: string, index: number) => void
account: Required<Config>['Account'];
setValue: (path: string, value: any) => void;
removeItem: (path: string, index: number) => void;
}) {
const { account, setValue, removeItem } = props;
const { tencent, qiniu, ali, amap } = account;
@ -540,4 +611,4 @@ export default function Account(props: {
/>
</Space>
);
}
}

View File

@ -1,7 +1,7 @@
.container {
background: var(--oak-bg-color-container);
box-shadow: 0 2px 3px #0000001a;
border-radius: 3px;
// box-shadow: 0 2px 3px #0000001a;
// border-radius: 3px;
padding: 30px 32px;
}

View File

@ -0,0 +1,70 @@
export default OakComponent({
isList: true,
entity: 'application',
projection: {
id: 1,
name: 1,
description: 1,
config: 1,
systemId: 1,
type: 1,
},
filters: [
{
filter: async ({ props }) => {
if (props.systemId) {
return {
systemId: props.systemId,
};
}
return {};
},
},
],
async formData({ data }) {
const pagination = this.getPagination();
return {
list: data,
pagination,
};
},
data: {
open: false,
},
methods: {
goDetail(id: string) {
this.navigateTo({
url: '/application/detail',
oakId: id,
});
},
goUpdate(id: string) {
this.navigateTo({
url: '/application/upsert',
oakId: id,
});
},
goSetConfig(id: string) {
this.navigateTo({
url: '/application/config/upsert',
oakId: id,
});
},
goCreate() {
const { width, systemId } = this.props;
// if (width === 'xs') {
// this.navigateTo({
// url: '/application/upsert',
// });
// return;
// }
// this.setState({
// open: true,
// });
this.navigateTo({
url: '/application/upsert',
systemId,
});
},
},
});

View File

@ -0,0 +1,6 @@
.container {
background: var(--oak-bg-color-container);
box-shadow: 0 2px 3px #0000001a;
border-radius: 3px;
padding: 30px 32px;
}

View File

@ -0,0 +1,182 @@
import * as React from 'react';
import { Table, Button, Space, Typography, Modal } from 'antd';
import PageHeader from '../../../components/common/pageHeader';
// import ApplicationUpsert from '../../../pages/application/upsert';
import Style from './web.module.less';
export default function render(this: any) {
const { variant, namespace, systemId } = this.props;
const { list = [], oakLoading, pagination } = this.state;
const { pageSize, total, currentPage } = pagination || {};
return (
<Container variant={variant}>
<Space>
<Button
type="primary"
onClick={() => {
this.goCreate();
}}
>
</Button>
</Space>
<Table
loading={oakLoading}
dataSource={list}
rowKey="id"
columns={[
// {
// dataIndex: 'id',
// title: '序号',
// render: (value, record, index) => {
// return index + 1;
// },
// },
{
dataIndex: 'name',
title: '应用名称',
width: 300,
render: (value, record, index) => {
return (
<Typography.Link
onClick={() => {
this.goDetail(record.id);
}}
>
{value}
</Typography.Link>
);
},
},
{
dataIndex: 'description',
title: '应用描述',
width: 200,
ellipsis: true,
},
{
dataIndex: 'type',
title: '应用类型',
render: (value, record, index) => {
return this.t(`application:v.type.${value}`);
},
},
{
dataIndex: 'config',
title: '应用配置',
align: 'center',
render: (value, record, index) => {
return (
<>
<Button
type="link"
onClick={() => {
this.goSetConfig(record.id);
}}
>
</Button>
</>
);
},
},
{
dataIndex: 'op',
width: 200,
title: '操作',
align: 'center',
render: (value, record, index) => {
return (
<>
<Button
type="link"
onClick={() => {
this.goDetail(record.id);
}}
>
</Button>
<Button
type="link"
onClick={() => {
this.goUpdate(record.id);
}}
>
</Button>
</>
);
},
fixed: 'right',
},
]}
pagination={{
total,
pageSize,
current: currentPage,
onShowSizeChange: (pageSize: number) => {
this.setPageSize(pageSize);
},
onChange: (current: number) => {
this.setCurrentPage(current);
},
}}
/>
{/* <Modal
title="创建系统"
destroyOnClose={true}
open={this.state.open}
onCancel={() => {
this.setState({
open: false,
});
}}
width="60%"
onOk={async () => {
await this.execute(
{
action: 'create',
data: {
id: await generateNewId(),
},
},
'$application/list-application/upsert'
);
this.setState({
open: false,
});
}}
okText="确定"
cancelText="取消"
>
<ApplicationUpsert
platformId={platformId}
namespace={namespace}
variant="dialog"
oakPath="$application/list-application/upsert"
/>
</Modal> */}
</Container>
);
}
function Container(props: {
children: React.ReactNode;
variant?: 'inline' | 'alone';
showBack?: boolean;
}) {
const { children, variant, showBack } = props;
if (variant === 'inline') {
return <>{children}</>;
}
return (
<PageHeader showBack={showBack} title="应用管理">
<div className={Style.container}>{children}</div>
</PageHeader>
);
}

View File

@ -0,0 +1,51 @@
import { AppType } from '../../../general-app-domain/Application/Schema';
type typeOption = {
value: AppType
}
export default OakComponent({
isList: false,
entity: 'application',
projection: {
id: 1,
name: 1,
config: 1,
description: 1,
type: 1,
systemId: 1,
},
async formData({ data }) {
return data || {};
},
data: {
typeArr: [
{
value: 'web',
},
{
value: "wechatMp",
},
{
value: "wechatPublic",
},
] as typeOption[],
},
lifetimes: {
ready() {
const { systemId, oakId } = this.props;
if (!oakId) {
if (systemId) {
this.setUpdateData('systemId', systemId);
}
}
},
},
methods: {
async confirm() {
await this.execute();
this.navigateBack();
},
},
});

View File

@ -0,0 +1,6 @@
.container {
background: var(--oak-bg-color-container);
box-shadow: 0 2px 3px #0000001a;
border-radius: 3px;
padding: 30px 32px;
}

View File

@ -0,0 +1,140 @@
import React from 'react';
import { Button, Form, Row, Col, Select, Space } from 'antd';
import PageHeader from '../../../components/common/pageHeader';
import Input from '../../../components/common/input';
import Style from './web.module.less';
export default function render(this: any) {
const { variant, showBack = true, oakId, systemId } = this.props;
const { name, description, type, typeArr } = this.state;
return (
<Container variant={variant} showBack={showBack}>
<Row>
<Col xs={24} sm={12}>
<Form
colon={true}
labelCol={{ span: 6 }}
wrapperCol={{ span: 16 }}
>
<Form.Item
label="名称"
requiredMark
name="name"
rules={[
{
required: true,
},
]}
>
<>
<Input
onChange={(e) => {
this.setUpdateData(
'name',
e.target.value
);
}}
value={name}
/>
</>
</Form.Item>
<Form.Item label="描述" requiredMark name="description">
<>
<Input.TextArea
onChange={(e) => {
this.setUpdateData(
'description',
e.target.value
);
}}
value={description}
/>
</>
</Form.Item>
<Form.Item
label="应用类型"
requiredMark
name="type"
rules={[
{
required: true,
},
]}
>
<>
<Select
value={type}
style={{ width: 120 }}
disabled={!!oakId}
options={typeArr.map(
(ele: { value: string }) => ({
label: this.t(
`application:v.type.${ele.value}`
),
value: ele.value,
})
)}
onChange={(value) => {
this.setUpdateData('type', value);
}}
/>
</>
</Form.Item>
<Action variant={variant}>
<Form.Item wrapperCol={{ offset: 6 }}>
<Space>
<Button
type="primary"
onClick={() => {
this.confirm();
}}
>
</Button>
<Button
onClick={() => {
this.navigateBack();
}}
>
</Button>
</Space>
</Form.Item>
</Action>
</Form>
</Col>
</Row>
</Container>
);
}
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 (
<PageHeader showBack={showBack} title="应用编辑">
<div className={Style.container}>{children}</div>
</PageHeader>
);
}

View File

@ -8,7 +8,7 @@ export default function render(this: any) {
const { namespace, oakId } = this.props;
const { config, name } = this.state;
return (
<PageHeader>
<PageHeader showBack={true} title="平台配置">
<div className={Style.container}>
<ConfigUpsert
config={config}

View File

@ -1,6 +1,7 @@
import React from 'react';
import { Tabs, Card } from 'antd';
import PageHeader from '../../../components/common/pageHeader';
import SystemList from '../../../pages/system/list';
import Style from './web.module.less';
@ -8,7 +9,7 @@ export default function render(this: any) {
const { namespace, oakId } = this.props;
const { config, name } = this.state;
return (
<PageHeader>
<PageHeader showBack={true} title="平台概览">
<div className={Style.container}>
<Card title={name} bordered={false}>
<Tabs
@ -21,7 +22,15 @@ export default function render(this: any) {
{
label: '系统管理',
key: '系统管理',
children: <div></div>,
children: (
<SystemList
namespace={namespace}
platformId={oakId}
variant="inline"
oakPath="$platform/detail/-system/list"
oakAutoUnmount={true}
/>
),
},
]}
/>

View File

@ -1,5 +1,5 @@
import * as React from 'react';
import { Table, Button, Space } from 'antd';
import { Table, Button, Space, Typography } from 'antd';
import PageHeader from '../../../components/common/pageHeader';
import Style from './web.module.less';
@ -8,7 +8,7 @@ export default function render(this: any) {
const { pageSize, total, currentPage } = pagination || {};
return (
<PageHeader>
<PageHeader title="平台管理">
<div className={Style.container}>
<Space>
<Button
@ -26,21 +26,34 @@ export default function render(this: any) {
dataSource={list}
rowKey="id"
columns={[
{
dataIndex: 'id',
title: '序号',
render: (value, record, index) => {
return index + 1;
},
},
// {
// dataIndex: 'id',
// title: '序号',
// render: (value, record, index) => {
// return index + 1;
// },
// },
{
dataIndex: 'name',
title: '名称',
title: '平台名称',
width: 300,
render: (value, record, index) => {
return (
<Typography.Link
onClick={() => {
this.goDetail(record.id);
}}
>
{value}
</Typography.Link>
);
},
},
{
dataIndex: 'description',
title: '描述',
width: 400,
width: 200,
ellipsis: true,
},
{
dataIndex: 'config',
@ -75,7 +88,7 @@ export default function render(this: any) {
this.goDetail(record.id);
}}
>
</Button>
<Button
type="link"

View File

@ -8,7 +8,7 @@ import Style from './web.module.less';
export default function render(this: any) {
const { name, description } = this.state;
return (
<PageHeader>
<PageHeader showBack={true} title="平台编辑">
<div className={Style.container}>
<Row>
<Col xs={24} sm={12}>

View File

@ -0,0 +1,14 @@
export default OakComponent({
isList: false,
entity: 'system',
projection: {
id: 1,
name: 1,
config: 1,
},
async formData({ data }) {
return data || {};
},
methods: {
},
});

View File

@ -0,0 +1,6 @@
.container {
background: var(--oak-bg-color-container);
box-shadow: 0 2px 3px #0000001a;
border-radius: 3px;
padding: 30px 32px;
}

View File

@ -0,0 +1,23 @@
import React from 'react';
import ConfigUpsert from '../../../../components/config/upsert';
import PageHeader from '../../../../components/common/pageHeader';
import Style from './web.module.less';
export default function render(this: any) {
const { namespace, oakId } = this.props;
const { config, name } = this.state;
return (
<PageHeader showBack={true} title="系统配置">
<div className={Style.container}>
<ConfigUpsert
config={config}
entity="system"
entityId={oakId}
name={name}
namespace={namespace}
/>
</div>
</PageHeader>
);
}

View File

@ -0,0 +1,16 @@
export default OakComponent({
isList: false,
entity: 'system',
projection: {
id: 1,
name: 1,
config: 1,
description: 1,
super: 1,
},
async formData({ data }) {
return data || {};
},
methods: {
},
});

View File

@ -0,0 +1,6 @@
.container {
background: var(--oak-bg-color-container);
box-shadow: 0 2px 3px #0000001a;
border-radius: 3px;
padding: 30px 32px;
}

View File

@ -0,0 +1,40 @@
import React from 'react';
import { Tabs, Card } from 'antd';
import PageHeader from '../../../components/common/pageHeader';
import ApplicationList from '../../../pages/application/list';
import Style from './web.module.less';
export default function render(this: any) {
const { namespace, oakId } = this.props;
const { config, name } = this.state;
return (
<PageHeader showBack={true} title="系统概览">
<div className={Style.container}>
<Card title={name} bordered={false}>
<Tabs
items={[
{
label: '系统概览',
key: '系统概览',
children: <div></div>,
},
{
label: '应用管理',
key: '应用管理',
children: (
<ApplicationList
namespace={namespace}
systemId={oakId}
variant="inline"
oakPath="$system/detail-application/list"
/>
),
},
]}
/>
</Card>
</div>
</PageHeader>
);
}

View File

@ -0,0 +1,67 @@
export default OakComponent({
isList: true,
entity: 'system',
projection: {
id: 1,
name: 1,
description: 1,
config: 1,
super: 1,
platformId: 1,
},
filters: [
{
filter: async ({ props }) => {
if (props.platformId) {
return {
platformId: props.platformId,
};
}
return {};
},
},
],
async formData({ data }) {
const pagination = this.getPagination();
return {
list: data,
pagination,
};
},
data: {
open: false,
},
methods: {
goDetail(id: string) {
this.navigateTo({
url: '/system/detail',
oakId: id,
});
},
goUpdate(id: string) {
this.navigateTo({
url: '/system/upsert',
oakId: id,
});
},
goSetConfig(id: string) {
this.navigateTo({
url: '/system/config/upsert',
oakId: id,
});
},
goCreate() {
const { width, platformId } = this.props;
if (width === 'xs') {
this.navigateTo({
url: '/system/upsert',
platformId,
});
return;
}
this.setState({
open: true,
});
},
},
});

View File

@ -0,0 +1,6 @@
.container {
background: var(--oak-bg-color-container);
box-shadow: 0 2px 3px #0000001a;
border-radius: 3px;
padding: 30px 32px;
}

View File

@ -0,0 +1,183 @@
import * as React from 'react';
import { Table, Button, Space, Typography, Modal } from 'antd';
import PageHeader from '../../../components/common/pageHeader';
import SystemUpsert from '../../../pages/system/upsert';
import Style from './web.module.less';
export default function render(this: any) {
const { variant, namespace, platformId, showBack } = this.props;
const { list = [], oakLoading, pagination } = this.state;
const { pageSize, total, currentPage } = pagination || {};
return (
<Container showBack={showBack} variant={variant}>
<Space>
<Button
type="primary"
onClick={() => {
this.goCreate();
}}
>
</Button>
</Space>
<Table
loading={oakLoading}
dataSource={list}
rowKey="id"
columns={[
// {
// dataIndex: 'id',
// title: '序号',
// render: (value, record, index) => {
// return index + 1;
// },
// },
{
dataIndex: 'name',
title: '系统名称',
width: 300,
render: (value, record, index) => {
return (
<Typography.Link
onClick={() => {
this.goDetail(record.id);
}}
>
{value}
</Typography.Link>
);
},
},
{
dataIndex: 'description',
title: '描述',
width: 200,
ellipsis: true,
},
{
dataIndex: 'super',
title: '是否为超级系统',
render: (value, record, index) => {
return value ? '是' : '否';
},
},
{
dataIndex: 'config',
title: '配置',
align: 'center',
render: (value, record, index) => {
return (
<>
<Button
type="link"
onClick={() => {
this.goSetConfig(record.id);
}}
>
</Button>
</>
);
},
},
{
dataIndex: 'op',
width: 200,
title: '操作',
align: 'center',
render: (value, record, index) => {
return (
<>
<Button
type="link"
onClick={() => {
this.goDetail(record.id);
}}
>
</Button>
<Button
type="link"
onClick={() => {
this.goUpdate(record.id);
}}
>
</Button>
</>
);
},
fixed: 'right',
},
]}
pagination={{
total,
pageSize,
current: currentPage,
onShowSizeChange: (pageSize: number) => {
this.setPageSize(pageSize);
},
onChange: (current: number) => {
this.setCurrentPage(current);
},
}}
/>
<Modal
title="创建系统"
destroyOnClose={true}
open={this.state.open}
onCancel={() => {
this.setState({
open: false,
});
}}
width="60%"
onOk={async () => {
await this.execute(
{
action: 'create',
data: {
id: await generateNewId(),
},
},
// '$system/list-system/upsert'
);
this.setState({
open: false,
});
}}
okText="确定"
cancelText="取消"
>
<SystemUpsert
platformId={platformId}
namespace={namespace}
variant="dialog"
oakPath={this.state.oakFullpath}
// oakPath="$system/list-system/upsert"
/>
</Modal>
</Container>
);
}
function Container(props: {
children: React.ReactNode;
variant?: 'inline' | 'alone';
showBack?: boolean;
}) {
const { children, variant, showBack } = props;
if (variant === 'inline') {
return <>{children}</>;
}
return (
<PageHeader showBack={showBack} title="系统管理">
<div className={Style.container}>{children}</div>
</PageHeader>
);
}

View File

@ -0,0 +1,31 @@
export default OakComponent({
isList: false,
entity: 'system',
projection: {
id: 1,
name: 1,
config: 1,
description: 1,
super: 1,
},
async formData({ data }) {
return data || {};
},
lifetimes: {
ready() {
const { platformId, oakId } = this.props;
if (!oakId) {
if (platformId) {
this.setUpdateData('platformId', platformId);
}
}
},
},
methods: {
async confirm() {
await this.execute();
this.navigateBack();
}
},
});

View File

@ -0,0 +1,6 @@
.container {
background: var(--oak-bg-color-container);
box-shadow: 0 2px 3px #0000001a;
border-radius: 3px;
padding: 30px 32px;
}

View File

@ -0,0 +1,118 @@
import React from 'react';
import { Button, Form, Row, Col, Switch } from 'antd';
import PageHeader from '../../../components/common/pageHeader';
import Input from '../../../components/common/input';
import Style from './web.module.less';
export default function render(this: any) {
const { variant, showBack = true } = this.props;
const { name, description, super: super2 } = this.state;
return (
<Container variant={variant} showBack={showBack}>
<Row>
<Col xs={24} sm={12}>
<Form
colon={true}
labelCol={{ span: 6 }}
wrapperCol={{ span: 16 }}
>
<Form.Item
label="名称"
requiredMark
name="name"
rules={[
{
required: true,
},
]}
>
<>
<Input
onChange={(e) => {
this.setUpdateData(
'name',
e.target.value
);
}}
value={name}
/>
</>
</Form.Item>
<Form.Item label="描述" requiredMark name="description">
<>
<Input.TextArea
onChange={(e) => {
this.setUpdateData(
'description',
e.target.value
);
}}
value={description}
/>
</>
</Form.Item>
<Form.Item
label="是否为超级系统"
requiredMark
name="super"
>
<>
<Switch
checkedChildren="是"
unCheckedChildren="否"
checked={super2}
onChange={(checked) => {
this.setUpdateData('super', checked);
}}
/>
</>
</Form.Item>
<Action variant={variant}>
<Form.Item wrapperCol={{ offset: 6 }}>
<Button
type="primary"
onClick={() => {
this.confirm();
}}
>
</Button>
</Form.Item>
</Action>
</Form>
</Col>
</Row>
</Container>
);
}
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 (
<PageHeader showBack={showBack} title="系统编辑">
<div className={Style.container}>{children}</div>
</PageHeader>
);
}