first commit
This commit is contained in:
1
dist/core/annotation/.pydio
vendored
Normal file
1
dist/core/annotation/.pydio
vendored
Normal file
@@ -0,0 +1 @@
|
||||
39248b24-b5d5-42f2-bf62-d312254ad586
|
||||
68
dist/core/annotation/AutoController.js
vendored
Normal file
68
dist/core/annotation/AutoController.js
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CreateApplicationIpc = exports.CreateTray = exports.CreateTouchbar = exports.CreateApplicationMenu = exports.AutoController = void 0;
|
||||
const tslib_1 = require("tslib");
|
||||
const index_utils_1 = tslib_1.__importDefault(require("@utils/index.utils"));
|
||||
const ApplicationMenu_interactive_1 = require("@interactive/ApplicationMenu.interactive");
|
||||
const Touchbar_interactive_1 = require("@interactive/Touchbar.interactive");
|
||||
const Tray_interactive_1 = require("@interactive/Tray.interactive");
|
||||
const application_ipc_1 = require("@ipc/application.ipc");
|
||||
function AutoController() {
|
||||
return (_constructor) => {
|
||||
return class extends _constructor {
|
||||
constructor() {
|
||||
new (index_utils_1.default.GetController());
|
||||
super();
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
exports.AutoController = AutoController;
|
||||
function CreateApplicationMenu() {
|
||||
return (_constructor) => {
|
||||
return class extends _constructor {
|
||||
constructor() {
|
||||
// 创建顶部菜单
|
||||
new ApplicationMenu_interactive_1.ApplicationMenu();
|
||||
super();
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
exports.CreateApplicationMenu = CreateApplicationMenu;
|
||||
function CreateTouchbar() {
|
||||
return (_constructor) => {
|
||||
return class extends _constructor {
|
||||
constructor() {
|
||||
// 创建Touchbar
|
||||
new Touchbar_interactive_1.Touchbar();
|
||||
super();
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
exports.CreateTouchbar = CreateTouchbar;
|
||||
function CreateTray() {
|
||||
return (_constructor) => {
|
||||
return class extends _constructor {
|
||||
constructor() {
|
||||
// 创建Mac系统顶部图标
|
||||
new Tray_interactive_1.TrayInteractive();
|
||||
super();
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
exports.CreateTray = CreateTray;
|
||||
function CreateApplicationIpc() {
|
||||
return (_constructor) => {
|
||||
return class extends _constructor {
|
||||
constructor() {
|
||||
// 开启应用级ipc监听
|
||||
new application_ipc_1.ApplicationIpc();
|
||||
super();
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
exports.CreateApplicationIpc = CreateApplicationIpc;
|
||||
69
dist/core/annotation/Creted.annotation.js
vendored
Normal file
69
dist/core/annotation/Creted.annotation.js
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Render = exports.CreateApplicationIpc = exports.Ipc = void 0;
|
||||
var Index_config_1 = __importDefault(require("@config/Index.config"));
|
||||
var Index_utils_1 = __importDefault(require("@utils/Index.utils"));
|
||||
/**
|
||||
* @Ipc()
|
||||
* 实现居中IPC的注册,用在controller方法上
|
||||
* @param IpcParams 传入需要被注册的ipc类
|
||||
* @constructor
|
||||
*/
|
||||
function Ipc(IpcParams) {
|
||||
return function (target, propertyKey, descriptor) {
|
||||
/**
|
||||
* 因为TS没有提供像java那种可以直接提取某个类中所有方法的系统方法
|
||||
* 这边原本使用 Object.getOwnPropertyNames 能够正常提取类中方法,但是如果类中有被 @Inject() 依赖注入的属性
|
||||
* 那么这个属性也会被 (new IpcParams())[val](),这样是肯定报错的,所以做下面约定!
|
||||
* 在IPC 类中,如果在类的属性上使用 @Inject() 注入。那么请在类的属性名前加上 _,例如:
|
||||
* @Inject()
|
||||
* private readonly _Net!: Http;
|
||||
*/
|
||||
IpcParams.forEach(function (val) {
|
||||
Object.getOwnPropertyNames(val.prototype).splice(1)
|
||||
.filter(function (f) { return !f.includes("_"); })
|
||||
.forEach(function (v) { return (new val())[v](); });
|
||||
});
|
||||
};
|
||||
}
|
||||
exports.Ipc = Ipc;
|
||||
/**
|
||||
* @CreateApplicationIpc()
|
||||
* 实现全局IPC的注册
|
||||
* 能够自动实例化传入的类数组中的所有类,并自动调用类中的所有的方法
|
||||
* @param IpcParams 类数组,实例:[ classIpc1, classIpc2, classIpc3 ]
|
||||
* @constructor
|
||||
*/
|
||||
function CreateApplicationIpc(IpcParams) {
|
||||
return function (_constructor) {
|
||||
IpcParams.forEach(function (val) {
|
||||
Object.getOwnPropertyNames(val.prototype).splice(1)
|
||||
.filter(function (f) { return !f.includes("_"); })
|
||||
.forEach(function (v) { return (new val())[v](); });
|
||||
});
|
||||
};
|
||||
}
|
||||
exports.CreateApplicationIpc = CreateApplicationIpc;
|
||||
/**
|
||||
* @Render()
|
||||
* 创建窗口
|
||||
* @param templateName 要渲染的模板名称
|
||||
* @constructor
|
||||
*/
|
||||
function Render(templateName) {
|
||||
return function (target, propertyKey, descriptor) {
|
||||
/**
|
||||
* 如果被打上注解的类中某个方法是配置文件中的默认启动窗口,那么调用这个方法来创建窗体
|
||||
* 其他的方法一律不管!由js前端渲染进程触发ipc创建
|
||||
*/
|
||||
if (propertyKey.includes((Index_config_1.default.StartPage.split("/"))[1])) {
|
||||
// 如果没有传参数,那么采用方法名来创建窗体!
|
||||
templateName == undefined ? Index_utils_1.default.startWindows(target, propertyKey) : Index_utils_1.default.startWindows(target, templateName);
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.Render = Render;
|
||||
//# sourceMappingURL=Creted.annotation.js.map
|
||||
1
dist/core/annotation/Creted.annotation.js.map
vendored
Normal file
1
dist/core/annotation/Creted.annotation.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Creted.annotation.js","sourceRoot":"","sources":["../../../src/core/annotation/Creted.annotation.ts"],"names":[],"mappings":";;;;;;AAAA,sEAA0C;AAC1C,mEAAuC;AAGvC;;;;;GAKG;AACH,SAAgB,GAAG,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AC,CAAC,CAAC,CAAC,EAAE;YACxD,wBAAwB;YACxB,YAAY,IAAI,SAAS,CAAC,CAAC,CAAC,qBAAK,CAAC,YAAY,CAAC,MAAM,EAAC,WAAW,CAAC,CAAC,CAAC,CAAC,qBAAK,CAAC,YAAY,CAAC,MAAM,EAAC,YAAY,CAAC,CAAA;SAC/G;IACL,CAAC,CAAA;AACL,CAAC;AAXD,wBAWC"}
|
||||
25
dist/core/annotation/Creted.js
vendored
Normal file
25
dist/core/annotation/Creted.js
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Creted = void 0;
|
||||
const tslib_1 = require("tslib");
|
||||
const Windows_model_1 = tslib_1.__importDefault(require("@model/Windows.model"));
|
||||
const electron_1 = require("electron");
|
||||
const index_config_1 = tslib_1.__importDefault(require("@config/index.config"));
|
||||
function Creted() {
|
||||
return (_constructor) => {
|
||||
let ControllerName = _constructor.name.split("Controller")[0];
|
||||
let ConfigName = `${ControllerName}Config`;
|
||||
let PathName = `${ControllerName}Path`;
|
||||
try {
|
||||
// @ts-ignore
|
||||
Windows_model_1.default.CurrentBrowserWindow = new electron_1.BrowserWindow(index_config_1.default.PageSize[ConfigName]);
|
||||
// @ts-ignore
|
||||
Windows_model_1.default.CurrentBrowserWindow.loadFile(index_config_1.default.PagePath[PathName]).then(r => { });
|
||||
}
|
||||
catch (e) {
|
||||
console.log("controller不存在,请检查命名,示例:AboutController。");
|
||||
}
|
||||
Windows_model_1.default.CurrentBrowserWindow.show();
|
||||
};
|
||||
}
|
||||
exports.Creted = Creted;
|
||||
93
dist/core/annotation/Http.annotation.js
vendored
Normal file
93
dist/core/annotation/Http.annotation.js
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GET = void 0;
|
||||
var Index_config_1 = __importDefault(require("@config/Index.config"));
|
||||
var Http_net_1 = require("@net/Http.net");
|
||||
/**
|
||||
* @GET()
|
||||
* 用在service类的方法上。
|
||||
* 如果不传参数将自动根据方法名获取接口请求的地址
|
||||
* 如果传参了,那么使用用户传入的地址去发送网络请求
|
||||
*
|
||||
* 如果 useHandle 为 true 那么方法将获得ajax请求的数据
|
||||
* 否则 不会将数据给方法
|
||||
* @param RequestParams
|
||||
* @constructor
|
||||
*/
|
||||
function GET(RequestParams) {
|
||||
return function (target, propertyKey, descriptor) {
|
||||
var _this = this;
|
||||
var url = Index_config_1.default.ApiUrl.ApiList[propertyKey], handle = false, header = {};
|
||||
(RequestParams && RequestParams.url)
|
||||
? url = RequestParams.url
|
||||
: (RequestParams && RequestParams.useHandle)
|
||||
? handle = RequestParams.useHandle
|
||||
: (RequestParams && RequestParams.header)
|
||||
? header = RequestParams.header
|
||||
: '';
|
||||
var OldMethods = descriptor.value;
|
||||
if (handle) {
|
||||
descriptor.value = function (data) { return __awaiter(_this, void 0, void 0, function () { var _a, _b, _c; return __generator(this, function (_d) {
|
||||
switch (_d.label) {
|
||||
case 0:
|
||||
_b = (_a = OldMethods).apply;
|
||||
_c = [target];
|
||||
return [4 /*yield*/, (new Http_net_1.Http).GET({ url: url, data: data, header: header })];
|
||||
case 1: return [4 /*yield*/, _b.apply(_a, _c.concat([[_d.sent()]]))];
|
||||
case 2: return [2 /*return*/, _d.sent()];
|
||||
}
|
||||
}); }); };
|
||||
return descriptor;
|
||||
}
|
||||
else {
|
||||
descriptor.value = function (data) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, (new Http_net_1.Http).GET({ url: url, data: data, header: header })];
|
||||
case 1: return [2 /*return*/, _a.sent()];
|
||||
}
|
||||
}); }); };
|
||||
return descriptor;
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.GET = GET;
|
||||
//# sourceMappingURL=Http.annotation.js.map
|
||||
1
dist/core/annotation/Http.annotation.js.map
vendored
Normal file
1
dist/core/annotation/Http.annotation.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Http.annotation.js","sourceRoot":"","sources":["../../../src/core/annotation/Http.annotation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAA0C;AAC1C,0CAAmC;AAEnC;;;;;;;;;;GAUG;AACH,SAAgB,GAAG,CAAE,aAAwF;IACzG,OAAO,UAAU,MAAW,EAAE,WAAmB,EAAE,UAA8B;QAA1E,iBAuBN;QAtBG,IAAI,GAAG,GAAW,sBAAM,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAChD,MAAM,GAAY,KAAK,EACvB,MAAM,GAAW,EAAE,CAAC;QAExB,CAAC,aAAa,IAAI,aAAa,CAAC,GAAG,CAAC;YAChC,CAAC,CAAC,GAAG,GAAG,aAAa,CAAC,GAAG;YACzB,CAAC,CAAC,CAAC,aAAa,IAAI,aAAa,CAAC,SAAS,CAAC;gBACxC,CAAC,CAAC,MAAM,GAAG,aAAa,CAAC,SAAS;gBAClC,CAAC,CAAC,CAAC,aAAa,IAAI,aAAa,CAAC,MAAM,CAAC;oBACrC,CAAC,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM;oBAC/B,CAAC,CAAC,EAAE,CAAC;QAEjB,IAAI,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC;QAClC,IAAI,MAAM,EAAE;YACR,UAAU,CAAC,KAAK,GAAG,UAAO,IAA2B;;;wBAC3C,KAAA,CAAA,KAAA,UAAU,CAAA,CAAC,KAAK,CAAA;8BAAC,MAAM;wBAAI,qBAAM,CAAC,IAAI,eAAI,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAA;4BAA/F,qBAAM,yBAA2B,SAA8D,IAAG,EAAA;4BAAlG,sBAAA,SAAkG,EAAA;;qBAAA,CAAA;YACtG,OAAO,UAAU,CAAA;SACpB;aAAM;YACH,UAAU,CAAC,KAAK,GAAG,UAAO,IAA2B;;4BACjD,qBAAM,CAAC,IAAI,eAAI,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAA;4BAA9D,sBAAA,SAA8D,EAAA;;qBAAA,CAAA;YAClE,OAAO,UAAU,CAAA;SACpB;IACL,CAAC,CAAA;AACL,CAAC;AAzBD,kBAyBC"}
|
||||
49
dist/core/annotation/Ioc.annotation.js
vendored
Normal file
49
dist/core/annotation/Ioc.annotation.js
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Inject = exports.Injectable = void 0;
|
||||
require("reflect-metadata");
|
||||
var Ioc_model_1 = __importDefault(require("@model/Ioc.model"));
|
||||
/**
|
||||
* 收集类依赖
|
||||
* @constructor
|
||||
*/
|
||||
function Injectable() {
|
||||
return function (_constructor) {
|
||||
if (Ioc_model_1.default.classPool.indexOf(_constructor) !== -1) {
|
||||
throw new Error('无需重复收集类');
|
||||
}
|
||||
else {
|
||||
//注册
|
||||
Ioc_model_1.default.classPool = [_constructor];
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.Injectable = Injectable;
|
||||
/**
|
||||
* 将类依赖实例化然后注入到被装饰的属性中
|
||||
* @constructor
|
||||
*/
|
||||
function Inject() {
|
||||
return function (target, propertyName) {
|
||||
console.log("target: ", target);
|
||||
console.log("propertyName: ", propertyName);
|
||||
/**
|
||||
* 使用 reflect-metadata 提供的内置 类型元数据键 design:type 通过反射拿到被装饰属性的类型
|
||||
* 也就是 类属性要实例化 的 service 类
|
||||
*/
|
||||
var propertyType = Reflect.getMetadata('design:type', target, propertyName);
|
||||
console.log("类属性要实例化 propertyType: ", propertyType);
|
||||
if (Ioc_model_1.default.classPool.indexOf(propertyType) == -1) {
|
||||
throw new Error('被装饰的属性所属的变量类型类,没有被装饰器@Injectable()注入,请检查!');
|
||||
}
|
||||
else {
|
||||
// 从存取器的数组中通过下标取出被装饰属性对应的service类,然后实例化这个类,在放入被装饰的属性中
|
||||
target[propertyName] = new (Ioc_model_1.default.classPool[Ioc_model_1.default.classPool.indexOf(propertyType)])();
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.Inject = Inject;
|
||||
//# sourceMappingURL=Ioc.annotation.js.map
|
||||
1
dist/core/annotation/Ioc.annotation.js.map
vendored
Normal file
1
dist/core/annotation/Ioc.annotation.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Ioc.annotation.js","sourceRoot":"","sources":["../../../src/core/annotation/Ioc.annotation.ts"],"names":[],"mappings":";;;;;;AAAA,4BAA0B;AAC1B,+DAAwC;AAExC;;;GAGG;AACH,SAAgB,UAAU;IACtB,OAAO,UAAC,YAA4C;QAChD,IAAG,mBAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE;YAChD,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;SAC9B;aAAM;YACH,IAAI;YACJ,mBAAQ,CAAC,SAAS,GAAG,CAAC,YAAY,CAAC,CAAA;SACtC;IACL,CAAC,CAAA;AACL,CAAC;AATD,gCASC;AAED;;;GAGG;AACH,SAAgB,MAAM;IAClB,OAAO,UAAU,MAAW,EAAE,YAAoB;QAC9C,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;QAC/B,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAA;QAC3C;;;WAGG;QACH,IAAM,YAAY,GAAQ,OAAO,CAAC,WAAW,CAAC,aAAa,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;QACnF,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,YAAY,CAAC,CAAA;QAEnD,IAAI,mBAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE;YAChD,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;SAChE;aAAM;YACH,qDAAqD;YACrD,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,mBAAQ,CAAC,SAAS,CAAC,mBAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAA;SAC9F;IACL,CAAC,CAAA;AACL,CAAC;AAlBD,wBAkBC"}
|
||||
8
dist/core/annotation/Open.js
vendored
Normal file
8
dist/core/annotation/Open.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function Open() {
|
||||
// @ts-ignore
|
||||
return (target, propertyKey, descriptor) => {
|
||||
};
|
||||
}
|
||||
exports.default = Open;
|
||||
1
dist/core/annotation/Run.annotation.js.map
vendored
Normal file
1
dist/core/annotation/Run.annotation.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Run.annotation.js","sourceRoot":"","sources":["../../../src/core/annotation/Run.annotation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,mEAAuC;AACvC,wFAAyE;AACzE,0EAA2D;AAC3D,kEAA8D;AAG9D,SAAgB,cAAc;IAC1B,OAAQ,UAAC,YAAqC;QAC1C;YAAqB,2BAAY;YAC7B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/annotation/run.annotation.js
vendored
Normal file
114
dist/core/annotation/run.annotation.js
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CreateTray = exports.CreateTouchbar = exports.CreateApplicationMenu = exports.AutoLoadWindow = void 0;
|
||||
var Index_utils_1 = __importDefault(require("@utils/Index.utils"));
|
||||
var ApplicationMenu_interactive_1 = require("@interactive/ApplicationMenu.interactive");
|
||||
var Touchbar_interactive_1 = require("@interactive/Touchbar.interactive");
|
||||
var Tray_interactive_1 = require("@interactive/Tray.interactive");
|
||||
function AutoLoadWindow() {
|
||||
return function (_constructor) {
|
||||
return /** @class */ (function (_super) {
|
||||
__extends(class_1, _super);
|
||||
function class_1() {
|
||||
var _this = this;
|
||||
// 这里只要动态 require 导入类即可,然后类上的装饰器就会运行
|
||||
Index_utils_1.default.GetController();
|
||||
_this = _super.call(this) || this;
|
||||
return _this;
|
||||
}
|
||||
return class_1;
|
||||
}(_constructor));
|
||||
};
|
||||
}
|
||||
exports.AutoLoadWindow = AutoLoadWindow;
|
||||
function CreateApplicationMenu() {
|
||||
return function (_constructor) {
|
||||
return /** @class */ (function (_super) {
|
||||
__extends(class_2, _super);
|
||||
function class_2() {
|
||||
var _this = this;
|
||||
// 创建顶部菜单
|
||||
new ApplicationMenu_interactive_1.ApplicationMenu();
|
||||
_this = _super.call(this) || this;
|
||||
return _this;
|
||||
}
|
||||
return class_2;
|
||||
}(_constructor));
|
||||
};
|
||||
}
|
||||
exports.CreateApplicationMenu = CreateApplicationMenu;
|
||||
function CreateTouchbar() {
|
||||
return function (_constructor) {
|
||||
return /** @class */ (function (_super) {
|
||||
__extends(class_3, _super);
|
||||
function class_3() {
|
||||
var _this = this;
|
||||
/**
|
||||
* 创建Touchbar
|
||||
* 这边做延时300毫秒的原因解释起来有点复杂
|
||||
* 1:因为我设计了 @Inject() 和 @Injectable() 注解,而在 controller 中
|
||||
* 被注解的属性 VideoImplService 存放的是 请求中间层,而请求中间层是调用的Http请求方法GET,而这个方法
|
||||
* 为了拿到返回值,所以设计成async异步的,这就导致使用请求中间层的controller方法也是async。
|
||||
* 2:而使用的方法如果是 async 那么就会导致 注解 @Render() 内部 也就是 startWindows 方法内,在自动调用方法
|
||||
* 获取传递给模板的方法返回数值的时候必须 await,也就变成了:await target[name]()。
|
||||
* 而这个注解 @CreateTouchbar() 运行时间 和 注解 @AutoLoadWindow() 基本同时间跑,
|
||||
* 所以会导致 @CreateTouchbar() 运行的时候太快了,尼玛币 await target[name]() 还没跑完,所以导致
|
||||
* 存取器里面:Windows.CurrentBrowserWindow 没有数值,所以 @CreateTouchbar() 所依赖的 Windows.CurrentBrowserWindow
|
||||
* 为空,所以touchbar菜单无法 setTouchBar 上。
|
||||
* 3:这里等300毫秒,是等 await target[name]() 完成,窗口也创建完成,然后 Windows.CurrentBrowserWindow
|
||||
* 再去创建 touchbar菜单。
|
||||
* 好了,说完了....同学不要睡了!
|
||||
*/
|
||||
setTimeout(function () { return new Touchbar_interactive_1.Touchbar(); }, 3000);
|
||||
_this = _super.call(this) || this;
|
||||
return _this;
|
||||
}
|
||||
return class_3;
|
||||
}(_constructor));
|
||||
};
|
||||
}
|
||||
exports.CreateTouchbar = CreateTouchbar;
|
||||
function CreateTray() {
|
||||
return function (_constructor) {
|
||||
return /** @class */ (function (_super) {
|
||||
__extends(class_4, _super);
|
||||
function class_4() {
|
||||
var _this = this;
|
||||
// 创建Mac系统顶部图标
|
||||
new Tray_interactive_1.TrayInteractive();
|
||||
_this = _super.call(this) || this;
|
||||
return _this;
|
||||
}
|
||||
return class_4;
|
||||
}(_constructor));
|
||||
};
|
||||
}
|
||||
exports.CreateTray = CreateTray;
|
||||
// export function CreateApplicationIpc(): any {
|
||||
// return (_constructor: {new(...args:any[]):{}}) => {
|
||||
// return class extends _constructor {
|
||||
// constructor() {
|
||||
// // 开启应用级ipc监听
|
||||
// new Application()
|
||||
// super();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//# sourceMappingURL=Run.annotation.js.map
|
||||
Reference in New Issue
Block a user