|
@@ -1,4 +1,4 @@
|
|
|
-define(['exports'], function (exports) { 'use strict';
|
|
|
+define(['exports', 'sql-formatter'], function (exports, sqlFormatter) { 'use strict';
|
|
|
|
|
|
var labelWidth = 80;
|
|
|
var windows = {
|
|
@@ -61841,20 +61841,17 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
}
|
|
|
//# sourceMappingURL=Scope.js.map
|
|
|
|
|
|
- var FuncDomain;
|
|
|
(function (FuncDomain) {
|
|
|
FuncDomain["SCOPE"] = "scope";
|
|
|
FuncDomain["SYSTEM"] = "system";
|
|
|
- })(FuncDomain || (FuncDomain = {}));
|
|
|
- var BizMode;
|
|
|
+ })(exports.FuncDomain || (exports.FuncDomain = {}));
|
|
|
(function (BizMode) {
|
|
|
//mode : 1, '仅查询' 2, '表单+表格编辑' 3, '仅表单编辑' 4, '仅表格编辑'
|
|
|
BizMode[BizMode["query"] = 1] = "query";
|
|
|
BizMode[BizMode["formAndGridEdit"] = 2] = "formAndGridEdit";
|
|
|
BizMode[BizMode["formEditOnly"] = 3] = "formEditOnly";
|
|
|
BizMode[BizMode["gridEditOnly"] = 4] = "gridEditOnly";
|
|
|
- })(BizMode || (BizMode = {}));
|
|
|
- var BizFormat;
|
|
|
+ })(exports.BizMode || (exports.BizMode = {}));
|
|
|
(function (BizFormat) {
|
|
|
// "format" : 1, button 2 progres 3 date 4 datetime 5 percentage
|
|
|
BizFormat[BizFormat["button"] = 1] = "button";
|
|
@@ -61862,8 +61859,7 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
BizFormat[BizFormat["date"] = 3] = "date";
|
|
|
BizFormat[BizFormat["datetime"] = 4] = "datetime";
|
|
|
BizFormat[BizFormat["percentage"] = 5] = "percentage";
|
|
|
- })(BizFormat || (BizFormat = {}));
|
|
|
- var BizUnique;
|
|
|
+ })(exports.BizFormat || (exports.BizFormat = {}));
|
|
|
(function (BizUnique) {
|
|
|
// "unique" : 1主键(全局唯一) 2仓库唯一 3货主唯一 4项目唯一 5单据唯一 6仓库+货主+项目唯一
|
|
|
BizUnique[BizUnique["u_a"] = 1] = "u_a";
|
|
@@ -61872,7 +61868,7 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
BizUnique[BizUnique["u_pj"] = 4] = "u_pj";
|
|
|
BizUnique[BizUnique["u_od"] = 5] = "u_od";
|
|
|
BizUnique[BizUnique["u_wh_ow_pj"] = 6] = "u_wh_ow_pj";
|
|
|
- })(BizUnique || (BizUnique = {}));
|
|
|
+ })(exports.BizUnique || (exports.BizUnique = {}));
|
|
|
var ScopeEngine = /** @class */ (function () {
|
|
|
function ScopeEngine() {
|
|
|
}
|
|
@@ -61881,51 +61877,64 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
debugger;
|
|
|
});
|
|
|
};
|
|
|
+ ScopeEngine.buildScopeFromBillFile = function (billFile) {
|
|
|
+ return new Promise(function (resolve, reject) {
|
|
|
+ var requireArr = [];
|
|
|
+ var requireKeyArr = [];
|
|
|
+ lodash.forOwn(billFile.domains, function (v, k) {
|
|
|
+ requireArr.push(v.domain);
|
|
|
+ requireKeyArr.push(k);
|
|
|
+ if (v.layout) {
|
|
|
+ requireArr.push(v.layout);
|
|
|
+ requireKeyArr.push(k + "_layout");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ requireArr.push(billFile.layout);
|
|
|
+ requireKeyArr.push("layout");
|
|
|
+ requireArr.push(billFile.converter);
|
|
|
+ requireKeyArr.push("converter");
|
|
|
+ // @ts-ignore
|
|
|
+ require(requireArr, function () {
|
|
|
+ var requireReArr = [];
|
|
|
+ for (var _i = 0; _i < arguments.length; _i++) {
|
|
|
+ requireReArr[_i] = arguments[_i];
|
|
|
+ }
|
|
|
+ if (requireReArr.length <= 0) {
|
|
|
+ reject(new Error("没有加载到相关的文件!"));
|
|
|
+ }
|
|
|
+ var domains = {};
|
|
|
+ for (var i = 0; i < requireReArr.length - 2; i++) {
|
|
|
+ if (requireKeyArr[i].endsWith("_layout")) {
|
|
|
+ var key_d = requireKeyArr[i].substr(0, requireKeyArr[i].indexOf("_layout"));
|
|
|
+ domains[key_d].layout = requireReArr[i].default;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ domains[requireKeyArr[i]] = requireReArr[i].default;
|
|
|
+ domains[requireKeyArr[i]].type = billFile.domains[requireKeyArr[i]].type;
|
|
|
+ domains[requireKeyArr[i]].mode = billFile.domains[requireKeyArr[i]].mode;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var bizFile = {
|
|
|
+ bill: billFile,
|
|
|
+ domains: domains,
|
|
|
+ layout: requireReArr[requireReArr.length - 2].default,
|
|
|
+ converter: requireReArr[requireReArr.length - 1].default,
|
|
|
+ };
|
|
|
+ var scope = ScopeEngine.buildScopeFromBizFile(bizFile);
|
|
|
+ scope.billSetting = bizFile;
|
|
|
+ resolve(scope);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ };
|
|
|
ScopeEngine.buildScopeFromPath = function (path) {
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
// @ts-ignore
|
|
|
require([path], function (bill) {
|
|
|
bill = bill.default;
|
|
|
- var requireArr = [];
|
|
|
- var requireKeyArr = [];
|
|
|
- lodash.forOwn(bill.domains, function (v, k) {
|
|
|
- requireArr.push(v.domain);
|
|
|
- requireKeyArr.push(k);
|
|
|
- if (v.layout) {
|
|
|
- requireArr.push(v.layout);
|
|
|
- requireKeyArr.push(k + "_layout");
|
|
|
- }
|
|
|
- });
|
|
|
- requireArr.push(bill.layout);
|
|
|
- requireKeyArr.push("layout");
|
|
|
- // @ts-ignore
|
|
|
- require(requireArr, function () {
|
|
|
- var requireReArr = [];
|
|
|
- for (var _i = 0; _i < arguments.length; _i++) {
|
|
|
- requireReArr[_i] = arguments[_i];
|
|
|
- }
|
|
|
- if (requireReArr.length <= 0) {
|
|
|
- reject(new Error("没有加载到相关的文件!"));
|
|
|
- }
|
|
|
- var domains = {};
|
|
|
- for (var i = 0; i < requireReArr.length - 1; i++) {
|
|
|
- if (requireKeyArr[i].endsWith("_layout")) {
|
|
|
- var key_d = requireKeyArr[i].substr(0, requireKeyArr[i].indexOf("_layout"));
|
|
|
- domains[key_d].layout = requireReArr[i].default;
|
|
|
- }
|
|
|
- else {
|
|
|
- domains[requireKeyArr[i]] = requireReArr[i].default;
|
|
|
- domains[requireKeyArr[i]].type = bill.domains[requireKeyArr[i]].type;
|
|
|
- domains[requireKeyArr[i]].mode = bill.domains[requireKeyArr[i]].mode;
|
|
|
- }
|
|
|
- }
|
|
|
- var bizFile = {
|
|
|
- bill: bill,
|
|
|
- domains: domains,
|
|
|
- layout: requireReArr[requireReArr.length - 1].default
|
|
|
- };
|
|
|
- var scope = ScopeEngine.buildScopeFromBizFile(bizFile);
|
|
|
+ ScopeEngine.buildScopeFromBillFile(bill).then(function (scope) {
|
|
|
resolve(scope);
|
|
|
+ }).catch(function (e) {
|
|
|
+ reject(e);
|
|
|
});
|
|
|
});
|
|
|
});
|
|
@@ -62118,7 +62127,7 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
if (item.listeners) {
|
|
|
var listeners_1 = {};
|
|
|
lodash.forOwn(item.listeners, function (v, k) {
|
|
|
- if (v.startsWith(FuncDomain.SCOPE + ".") || v.startsWith(FuncDomain.SYSTEM + ".")) {
|
|
|
+ if (v.startsWith(exports.FuncDomain.SCOPE + ".") || v.startsWith(exports.FuncDomain.SYSTEM + ".")) {
|
|
|
listeners_1[k] = v;
|
|
|
}
|
|
|
else {
|
|
@@ -62152,10 +62161,10 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
}
|
|
|
var _a = __read(strArr, 2), funcDomain = _a[0], funcName = _a[1];
|
|
|
switch (funcDomain) {
|
|
|
- case FuncDomain.SCOPE:
|
|
|
+ case exports.FuncDomain.SCOPE:
|
|
|
controller[k] = findCustFunc(item, k);
|
|
|
break;
|
|
|
- case FuncDomain.SYSTEM:
|
|
|
+ case exports.FuncDomain.SYSTEM:
|
|
|
break;
|
|
|
default:
|
|
|
throw new Error("错误的函数域定义");
|
|
@@ -63422,6 +63431,36 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
+ // 未完成
|
|
|
+ SystemEventFu.prototype.showDialogAndFillData = function (url, lookupForData, map) {
|
|
|
+ return function (sender) {
|
|
|
+ var scope = lookupScope(sender);
|
|
|
+ var data = scope.viewModel.data;
|
|
|
+ var billSetting = scope.billSetting;
|
|
|
+ var param = calcObjectFlat(data, lookupForData);
|
|
|
+ return new Promise(function (resolve, reject) {
|
|
|
+ var sf = function (scope) {
|
|
|
+ scope.success = function (dlgScope, dlgSender, reData) {
|
|
|
+ };
|
|
|
+ scope.showDialog(sender, {}, { data: param });
|
|
|
+ };
|
|
|
+ // @ts-ignore
|
|
|
+ require([url], function (module) {
|
|
|
+ // 业务描述文件
|
|
|
+ if (url.endsWith(".bill")) {
|
|
|
+ ScopeEngine.buildScopeFromBillFile(module.default).then(function (scope) {
|
|
|
+ sf(scope);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else { //原生yvanui文件
|
|
|
+ var ScopeClass = module.default;
|
|
|
+ var scope_1 = new ScopeClass();
|
|
|
+ sf(scope_1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ };
|
|
|
+ };
|
|
|
__decorate([
|
|
|
Lib({
|
|
|
title: '按下回车键之后默认是否按下某个按钮',
|
|
@@ -63641,6 +63680,22 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
__metadata("design:paramtypes", [Object]),
|
|
|
__metadata("design:returntype", void 0)
|
|
|
], SystemEventFu.prototype, "closeMe", null);
|
|
|
+ __decorate([
|
|
|
+ Lib({
|
|
|
+ title: '打开对话框并返回数据',
|
|
|
+ author: '余亮',
|
|
|
+ createAt: '2022-07-07',
|
|
|
+ updateAt: '2022-07-07',
|
|
|
+ type: 'system',
|
|
|
+ category: '对话框',
|
|
|
+ }),
|
|
|
+ __param(0, LibParam('业务模块名', 'module')),
|
|
|
+ __param(1, LibParam('参数数据 lookup 表达式', 'lookup', true)),
|
|
|
+ __param(2, LibParam('结果映射关系', 'string', true)),
|
|
|
+ __metadata("design:type", Function),
|
|
|
+ __metadata("design:paramtypes", [String, Object, Object]),
|
|
|
+ __metadata("design:returntype", void 0)
|
|
|
+ ], SystemEventFu.prototype, "showDialogAndFillData", null);
|
|
|
return SystemEventFu;
|
|
|
}());
|
|
|
/**
|
|
@@ -96716,6 +96771,7 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
}
|
|
|
// throw new TypeError('无法识别的调用方法')
|
|
|
}
|
|
|
+ //# sourceMappingURL=grid.js.map
|
|
|
|
|
|
/**
|
|
|
* 创建一个 Ajax 客户端
|
|
@@ -133152,6 +133208,141 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
}
|
|
|
//# sourceMappingURL=bpmn.js.map
|
|
|
|
|
|
+ function initSqlEditor () {
|
|
|
+ Ext.define('com.yvan.studio.SqlEditor', {
|
|
|
+ extend: 'Ext.panel.Panel',
|
|
|
+ alias: 'widget.sqleditor',
|
|
|
+ xtype: 'sqleditor',
|
|
|
+ layout: 'fit',
|
|
|
+ border: false,
|
|
|
+ html: "<div class=\"editor\"/>",
|
|
|
+ config: {
|
|
|
+ value: ''
|
|
|
+ },
|
|
|
+ codeChange: undefined,
|
|
|
+ isChangeFromOuter: false,
|
|
|
+ setCode: function (value) {
|
|
|
+ var _this = this;
|
|
|
+ this.code = value;
|
|
|
+ this.value = value;
|
|
|
+ lodash.defer(function () {
|
|
|
+ _this.isChangeFromOuter = true;
|
|
|
+ if (_this.editor) {
|
|
|
+ _this.editor.setValue(value);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getCode: function () {
|
|
|
+ return this.getValue();
|
|
|
+ },
|
|
|
+ updateOptions: function (options) {
|
|
|
+ if (this.editor && options) {
|
|
|
+ this.editor.updateOptions(options);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getValue: function () {
|
|
|
+ if (!this.editor) {
|
|
|
+ return this.code;
|
|
|
+ }
|
|
|
+ return this.editor.getValue();
|
|
|
+ },
|
|
|
+ applyPosition: function () {
|
|
|
+ var _this = this;
|
|
|
+ if (this.autoFocusMethod) {
|
|
|
+ if (this.editor) {
|
|
|
+ lodash.defer(function () {
|
|
|
+ if (_this.autoFocusStartLine) {
|
|
|
+ _this.editor.setPosition({
|
|
|
+ lineNumber: _this.autoFocusStartLine,
|
|
|
+ column: _this.autoFocusStartColumn
|
|
|
+ });
|
|
|
+ _this.editor.revealLine(_this.autoFocusStartLine); //滚动到特定行
|
|
|
+ }
|
|
|
+ _this.editor.focus();
|
|
|
+ });
|
|
|
+ delete this.autoFocusMethod;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.editor.layout();
|
|
|
+ },
|
|
|
+ setValue: function (value, fromEditor) {
|
|
|
+ this.setCode(value);
|
|
|
+ var me = this;
|
|
|
+ if (me.value === value) {
|
|
|
+ // 值相等,不需要变化
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (fromEditor !== true && me.editor) {
|
|
|
+ // 不是来源于编辑器的变化,才设置编辑器的值
|
|
|
+ me.editor.setValue(value);
|
|
|
+ }
|
|
|
+ // 通知mixins setValue
|
|
|
+ me.value = value;
|
|
|
+ me.fireEvent('change', value);
|
|
|
+ },
|
|
|
+ initComponent: function () {
|
|
|
+ var that = this;
|
|
|
+ this.superclass.initComponent.call(this);
|
|
|
+ that.on({
|
|
|
+ resize: function () {
|
|
|
+ if (that.editor) {
|
|
|
+ that.editor.layout();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ destory: function () {
|
|
|
+ if (that.editor) {
|
|
|
+ that.editor.dispose();
|
|
|
+ delete that.editor;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ afterrender: function (sender) {
|
|
|
+ var $dom = $(that.el.dom).find('.editor');
|
|
|
+ attach_2($dom[0], {
|
|
|
+ value: that.code
|
|
|
+ }).then(function (editor) {
|
|
|
+ that.editor = editor;
|
|
|
+ that.applyPosition();
|
|
|
+ that.editor.onDidChangeModelContent(function (e) {
|
|
|
+ that.fireEvent('change', that.editor, e);
|
|
|
+ if (typeof that.codeChange === "function" && !that.isChangeFromOuter) {
|
|
|
+ that.codeChange(that.editor.getValue(), that.name, e);
|
|
|
+ }
|
|
|
+ that.isChangeFromOuter = false;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ function attach_2(element, opts) {
|
|
|
+ if (!window['monaco']) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var monaco = window['monaco'];
|
|
|
+ return new Promise(function (resolve) {
|
|
|
+ var editor = monaco.editor.create(element, __assign(__assign({}, opts), { language: 'sql', minimap: {
|
|
|
+ enabled: false
|
|
|
+ } }));
|
|
|
+ editor.addCommand(monaco.KeyMod.Shift | monaco.KeyMod.Alt | monaco.KeyCode.KeyF, function () {
|
|
|
+ var sql = editor.getValue();
|
|
|
+ if (lodash.trim(sql).length > 0) {
|
|
|
+ editor.setValue(sqlFormatter.format(sql, {
|
|
|
+ indent: ' ',
|
|
|
+ uppercase: true,
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ editor.onKeyUp(function (e) {
|
|
|
+ // console.log(e)
|
|
|
+ if ( /*e.code === 'Enter'||*/e.code === 'Quote') {
|
|
|
+ editor.trigger('随便写点儿啥', 'editor.action.triggerSuggest', {});
|
|
|
+ }
|
|
|
+ });
|
|
|
+ resolve(editor);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
var FixClass = /** @class */ (function () {
|
|
|
function FixClass() {
|
|
|
}
|
|
@@ -133395,6 +133586,7 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
initComboGridMulti();
|
|
|
initIframe();
|
|
|
initBpmn();
|
|
|
+ initSqlEditor();
|
|
|
}
|
|
|
//# sourceMappingURL=init.js.map
|
|
|
|