|
@@ -2807,6 +2807,7 @@ define(['exports', 'axios', 'qs', 'lodash', 'jquery', 'moment', 'recast', 'xlsx'
|
|
|
dbcode: undefined,
|
|
|
report: undefined,
|
|
|
widget: undefined,
|
|
|
+ whLayout: undefined,
|
|
|
};
|
|
|
window['handles'] = handles$1;
|
|
|
function setDictTree(value) {
|
|
@@ -2830,6 +2831,9 @@ define(['exports', 'axios', 'qs', 'lodash', 'jquery', 'moment', 'recast', 'xlsx'
|
|
|
function setWidget(value) {
|
|
|
handles$1.widget = value;
|
|
|
}
|
|
|
+ function setWhLayout(value) {
|
|
|
+ handles$1.whLayout = value;
|
|
|
+ }
|
|
|
function setViewoutlinetree(value) {
|
|
|
handles$1.viewoutlinetree = value;
|
|
|
}
|
|
@@ -4921,11 +4925,62 @@ define(['exports', 'axios', 'qs', 'lodash', 'jquery', 'moment', 'recast', 'xlsx'
|
|
|
console.error(msg, e);
|
|
|
});
|
|
|
}
|
|
|
+ function saveWhLayout(param) {
|
|
|
+ return request.post(getLayoutUrl() + "@saveWhLayout", {
|
|
|
+ args: [
|
|
|
+ param,
|
|
|
+ ]
|
|
|
+ }).catch(function (e) {
|
|
|
+ var _a, _b;
|
|
|
+ var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'saveWhLayout ERROR!';
|
|
|
+ showErrorDialog('发生错误:' + msg);
|
|
|
+ console.error(msg, e);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ function deleteWhLayout(param) {
|
|
|
+ return request.post(getLayoutUrl() + "@deleteWhLayout", {
|
|
|
+ args: [
|
|
|
+ param,
|
|
|
+ ]
|
|
|
+ }).catch(function (e) {
|
|
|
+ var _a, _b;
|
|
|
+ var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'deleteWhLayout ERROR!';
|
|
|
+ showErrorDialog('发生错误:' + msg);
|
|
|
+ console.error(msg, e);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ function loadWhLayoutAll() {
|
|
|
+ return request.post(getLayoutUrl() + "@loadWhLayoutAll", {
|
|
|
+ args: []
|
|
|
+ }).catch(function (e) {
|
|
|
+ var _a, _b;
|
|
|
+ var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'loadWhLayoutAll ERROR!';
|
|
|
+ showErrorDialog('发生错误:' + msg);
|
|
|
+ console.error(msg, e);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ function loadWhLayout(param) {
|
|
|
+ return request.post(getLayoutUrl() + "@loadWhLayout", {
|
|
|
+ args: [
|
|
|
+ param,
|
|
|
+ ]
|
|
|
+ }).catch(function (e) {
|
|
|
+ var _a, _b;
|
|
|
+ var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'loadWhLayout ERROR!';
|
|
|
+ showErrorDialog('发生错误:' + msg);
|
|
|
+ console.error(msg, e);
|
|
|
+ });
|
|
|
+ }
|
|
|
var baseUrl = "/api/com/yvan/studio/FileManager";
|
|
|
+ var layoutUrl = "/api/com/yvan/studio/LayoutManager";
|
|
|
function getBaseUrl() {
|
|
|
// return getCurrentProject().url + baseUrl
|
|
|
return baseUrl;
|
|
|
}
|
|
|
+ function getLayoutUrl() {
|
|
|
+ // return getCurrentProject().url + baseUrl
|
|
|
+ return layoutUrl;
|
|
|
+ }
|
|
|
var Request = /** @class */ (function () {
|
|
|
function Request(axiosInstance) {
|
|
|
this.axiosInstance = axiosInstance;
|
|
@@ -13960,20 +14015,38 @@ define(['exports', 'axios', 'qs', 'lodash', 'jquery', 'moment', 'recast', 'xlsx'
|
|
|
this.viewModel.set('layoutCode', this.layoutCode);
|
|
|
this.viewModel.set('layoutName', this.layoutName);
|
|
|
if (this.layoutCode) {
|
|
|
- this.viewModel.set('title', this.layoutName);
|
|
|
+ this.viewModel.set('title', this.layoutName + ' [' + this.layoutCode + ']');
|
|
|
}
|
|
|
else {
|
|
|
this.viewModel.set('title', '新建图纸');
|
|
|
}
|
|
|
};
|
|
|
+ WidgetDesign.prototype.reload = function () {
|
|
|
+ var _this = this;
|
|
|
+ this.setLoading(true);
|
|
|
+ loadWhLayout({
|
|
|
+ layoutCode: this.layoutCode,
|
|
|
+ layoutName: this.layoutName,
|
|
|
+ }).then(function (res) {
|
|
|
+ if (res.success) {
|
|
|
+ var xml = res.data.layoutContent;
|
|
|
+ var doc = mxUtils.parseXml(xml);
|
|
|
+ var graph = _this.editorUi.editor.graph;
|
|
|
+ graph.setSelectionCells(graph.importGraphModel(doc.documentElement));
|
|
|
+ }
|
|
|
+ }).finally(function () {
|
|
|
+ _this.setLoading(false);
|
|
|
+ });
|
|
|
+ };
|
|
|
WidgetDesign.prototype.editorInit = function (sender) {
|
|
|
+ var that = this;
|
|
|
var dom = $(sender.el.dom).find('.geEditor')[0];
|
|
|
//@ts-ignore
|
|
|
require(['mxgraph'], function () {
|
|
|
var editorUiInit = EditorUi.prototype.init;
|
|
|
EditorUi.prototype.init = function () {
|
|
|
editorUiInit.apply(this, arguments);
|
|
|
- this.actions.get('export').setEnabled(false);
|
|
|
+ // this.actions.get('export').setEnabled(false);
|
|
|
// Updates action states which require a backend
|
|
|
// if (!Editor.useLocalStorage) {
|
|
|
// mxUtils.post(OPEN_URL, '', mxUtils.bind(this, function (req) {
|
|
@@ -13985,11 +14058,25 @@ define(['exports', 'axios', 'qs', 'lodash', 'jquery', 'moment', 'recast', 'xlsx'
|
|
|
// this.actions.get('export').setEnabled(enabled);
|
|
|
// }));
|
|
|
// }
|
|
|
+ // this.actions.get('save').setEnabled(enabled);
|
|
|
+ console.log('EditorUi=editorUi', this);
|
|
|
+ this.actions.get('save').funct = that.onFileSave.bind(that);
|
|
|
+ this.actions.get('saveAs').funct = that.onFileSaveAs.bind(that);
|
|
|
+ this.actions.get('open').visible = false;
|
|
|
+ this.actions.get('new').visible = false;
|
|
|
+ this.actions.get('preview').visible = false;
|
|
|
+ this.actions.get('print').visible = false;
|
|
|
+ this.actions.get('pageSetup').visible = false;
|
|
|
+ this.actions.get('help').visible = false;
|
|
|
+ this.actions.get('about').visible = false;
|
|
|
+ this.menus.menus.help.setEnabled(false);
|
|
|
+ that.editorUi = this;
|
|
|
+ if (that.layoutCode) {
|
|
|
+ that.reload();
|
|
|
+ }
|
|
|
};
|
|
|
var RESOURCE_BASE = '/assets/mxgraph-editor/resources/grapheditor';
|
|
|
var mxLanguage = 'zh';
|
|
|
- // Adds required resources (disables loading of fallback properties, this can only
|
|
|
- // be used if we know that all keys are defined in the language specific file)
|
|
|
mxResources.loadDefaultBundle = false;
|
|
|
var bundle = mxResources.getDefaultBundle(RESOURCE_BASE, mxLanguage) ||
|
|
|
mxResources.getSpecialBundle(RESOURCE_BASE, mxLanguage);
|
|
@@ -14002,14 +14089,103 @@ define(['exports', 'axios', 'qs', 'lodash', 'jquery', 'moment', 'recast', 'xlsx'
|
|
|
var themes = new Object();
|
|
|
themes[Graph.prototype.defaultThemeName] = xhr[1].getDocumentElement();
|
|
|
// Main
|
|
|
- new EditorUi(new Editor(urlParams['chrome'] == '0', themes), dom);
|
|
|
+ new EditorUi(new Editor(false, themes), dom);
|
|
|
}, function () {
|
|
|
- document.body.innerHTML = '<center style="margin-top:10%;">Error loading resource files. Please check browser console.</center>';
|
|
|
+ dom.innerHTML = '<center style="margin-top:10%;">Error loading resource files. Please check browser console.</center>';
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
WidgetDesign.prototype.onDestroy = function () {
|
|
|
};
|
|
|
+ WidgetDesign.prototype.onFileLoad = function () {
|
|
|
+ };
|
|
|
+ WidgetDesign.prototype.onFileSaveAs = function () {
|
|
|
+ var _this = this;
|
|
|
+ this.showSaveAsDlg({ code: this.layoutCode, name: this.layoutName })
|
|
|
+ .then(function (_a) {
|
|
|
+ var code = _a.code, name = _a.name;
|
|
|
+ _this.layoutCode = code;
|
|
|
+ _this.layoutName = name;
|
|
|
+ _this.onSave();
|
|
|
+ });
|
|
|
+ };
|
|
|
+ WidgetDesign.prototype.onSave = function () {
|
|
|
+ var _this = this;
|
|
|
+ var layoutContent = this.editorUi.getEditBlankXml();
|
|
|
+ var layoutCode = this.layoutCode;
|
|
|
+ var layoutName = this.layoutName;
|
|
|
+ if (!layoutCode || !layoutName) {
|
|
|
+ msg$1('图形编号和图形名称必填');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.viewModel.set('title', this.layoutName + ' [' + this.layoutCode + ']');
|
|
|
+ this.setLoading(true);
|
|
|
+ saveWhLayout({
|
|
|
+ layoutCode: layoutCode, layoutName: layoutName, layoutContent: layoutContent
|
|
|
+ }).then(function (res) {
|
|
|
+ msg$1(res.msg);
|
|
|
+ }).finally(function () {
|
|
|
+ _this.setLoading(false);
|
|
|
+ });
|
|
|
+ };
|
|
|
+ WidgetDesign.prototype.onFileSave = function () {
|
|
|
+ if (!this.layoutCode || !this.layoutName) {
|
|
|
+ this.onFileSaveAs();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.onSave();
|
|
|
+ }
|
|
|
+ };
|
|
|
+ WidgetDesign.prototype.showSaveAsDlg = function (_a) {
|
|
|
+ var code = _a.code, name = _a.name;
|
|
|
+ return new Promise(function (resolve, reject) {
|
|
|
+ var viewModel = new Ext.app.ViewModel({
|
|
|
+ data: {
|
|
|
+ code: code !== null && code !== void 0 ? code : '',
|
|
|
+ name: name !== null && name !== void 0 ? name : '',
|
|
|
+ }
|
|
|
+ });
|
|
|
+ var dlg = Ext.create('Ext.window.Window', {
|
|
|
+ title: '保存',
|
|
|
+ viewModel: viewModel,
|
|
|
+ layout: {
|
|
|
+ type: "vbox",
|
|
|
+ pack: "start",
|
|
|
+ align: "stretch"
|
|
|
+ },
|
|
|
+ items: [
|
|
|
+ {
|
|
|
+ xtype: 'textfield', fieldLabel: '图编号', margin: '0 15 15 0',
|
|
|
+ bind: '{code}'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ xtype: 'textfield', fieldLabel: '图名称', margin: '0 15 15 0',
|
|
|
+ bind: '{name}'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ fbar: [
|
|
|
+ {
|
|
|
+ xtype: 'button', text: '保存', iconCls: 'x-fa fa-save', listeners: {
|
|
|
+ click: function () {
|
|
|
+ var code = viewModel.get('code');
|
|
|
+ var name = viewModel.get('name');
|
|
|
+ resolve({ code: code, name: name });
|
|
|
+ dlg.close();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ xtype: 'button', text: '取消', iconCls: 'x-fa fa-times', listeners: {
|
|
|
+ click: function () {
|
|
|
+ dlg.close();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ });
|
|
|
+ dlg.show();
|
|
|
+ });
|
|
|
+ };
|
|
|
return WidgetDesign;
|
|
|
}(Scope));
|
|
|
//@ts-ignore
|
|
@@ -14017,7 +14193,6 @@ define(['exports', 'axios', 'qs', 'lodash', 'jquery', 'moment', 'recast', 'xlsx'
|
|
|
path: {},
|
|
|
shim: {}
|
|
|
});
|
|
|
- //# sourceMappingURL=WhLayoutDesign.js.map
|
|
|
|
|
|
// init()
|
|
|
var Workbench = /** @class */ (function (_super) {
|
|
@@ -30475,8 +30650,9 @@ define(['exports', 'axios', 'qs', 'lodash', 'jquery', 'moment', 'recast', 'xlsx'
|
|
|
if (res.success) {
|
|
|
msg$1('添加成功');
|
|
|
// 添加
|
|
|
- handles$1.mainWindow.showWidget(widgetPath, title);
|
|
|
- me.reload();
|
|
|
+ handles$1.mainWindow.showWidget(widgetPath, title, function () {
|
|
|
+ me.reload();
|
|
|
+ });
|
|
|
win.close();
|
|
|
}
|
|
|
});
|
|
@@ -30494,6 +30670,7 @@ define(['exports', 'axios', 'qs', 'lodash', 'jquery', 'moment', 'recast', 'xlsx'
|
|
|
};
|
|
|
WidgetGridController.prototype.widgetRemove = function (sender) {
|
|
|
var _this = this;
|
|
|
+ //@ts-ignore
|
|
|
var record = this.getView().selection.data;
|
|
|
if (!record) {
|
|
|
msg$1('请选择一行');
|
|
@@ -30522,11 +30699,14 @@ define(['exports', 'axios', 'qs', 'lodash', 'jquery', 'moment', 'recast', 'xlsx'
|
|
|
}
|
|
|
};
|
|
|
WidgetGridController.prototype.onDestory = function (sender) {
|
|
|
+ var me = this;
|
|
|
setWidget(undefined);
|
|
|
instance$3.unregiste(me.reloadData.bind(this));
|
|
|
};
|
|
|
WidgetGridController.prototype.reloadData = function (res) {
|
|
|
var me = this;
|
|
|
+ //@ts-ignore
|
|
|
+ var view = me.getView();
|
|
|
if (typeof res === 'object') {
|
|
|
// const data = []
|
|
|
// _.forOwn(res, (v, k) => {
|
|
@@ -30536,31 +30716,34 @@ define(['exports', 'axios', 'qs', 'lodash', 'jquery', 'moment', 'recast', 'xlsx'
|
|
|
// vjson : v
|
|
|
// })
|
|
|
// })
|
|
|
- me.getView().setStore(new Ext.data.Store({
|
|
|
+ view.setStore(new Ext.data.Store({
|
|
|
fields: ['widget_path', 'widget_name'],
|
|
|
data: res.data,
|
|
|
}));
|
|
|
}
|
|
|
else if (typeof res === 'boolean') {
|
|
|
- me.getView().setLoading(res);
|
|
|
+ view.setLoading(res);
|
|
|
}
|
|
|
};
|
|
|
WidgetGridController.prototype.reload = function () {
|
|
|
instance$3.reloadForce(undefined);
|
|
|
};
|
|
|
WidgetGridController.prototype.filterChanged = function (sender, value) {
|
|
|
+ //@ts-ignore
|
|
|
this.view.store.clearFilter();
|
|
|
if (value) {
|
|
|
+ //@ts-ignore
|
|
|
this.view.store.filterBy(function (record) {
|
|
|
var widget_path = record.get('widget_path');
|
|
|
var widget_name = record.get('widget_name');
|
|
|
- return (system.pinyinMatch(widget_name, value) ||
|
|
|
- _.includes(_.toLower(widget_path), _.toLower(value)));
|
|
|
+ return (window['system'].pinyinMatch(widget_name, value) ||
|
|
|
+ _$2.includes(_$2.toLower(widget_path), _$2.toLower(value)));
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
WidgetGridController.prototype.onClearClick = function () {
|
|
|
var _a, _b;
|
|
|
+ //@ts-ignore
|
|
|
(_b = (_a = this.getReferences()) === null || _a === void 0 ? void 0 : _a.txtFilter) === null || _b === void 0 ? void 0 : _b.setValue('');
|
|
|
};
|
|
|
WidgetGridController.prototype.onDblClick = function (sender, record) {
|
|
@@ -30651,12 +30834,83 @@ define(['exports', 'axios', 'qs', 'lodash', 'jquery', 'moment', 'recast', 'xlsx'
|
|
|
var WhLayoutController = /** @class */ (function () {
|
|
|
function WhLayoutController() {
|
|
|
}
|
|
|
+ WhLayoutController.prototype.onLoad = function (sender) {
|
|
|
+ var _this = this;
|
|
|
+ var me = this;
|
|
|
+ setWhLayout(me);
|
|
|
+ _$2.defer(function () {
|
|
|
+ _this.reload();
|
|
|
+ });
|
|
|
+ };
|
|
|
WhLayoutController.prototype.reload = function () {
|
|
|
+ //@ts-ignore
|
|
|
+ var view = this.getView();
|
|
|
+ view.setLoading(true);
|
|
|
+ loadWhLayoutAll().then(function (res) {
|
|
|
+ view.setStore(new Ext.data.Store({
|
|
|
+ fields: ['layout_code', 'layout_name'],
|
|
|
+ data: res.data,
|
|
|
+ }));
|
|
|
+ }).finally(function () {
|
|
|
+ view.setLoading(false);
|
|
|
+ });
|
|
|
};
|
|
|
WhLayoutController.prototype.add = function () {
|
|
|
handles$1.mainWindow.showLayoutDesign(undefined, undefined);
|
|
|
};
|
|
|
+ WhLayoutController.prototype.edit = function (data) {
|
|
|
+ handles$1.mainWindow.showLayoutDesign(data.layout_code, data.layout_name);
|
|
|
+ };
|
|
|
WhLayoutController.prototype.remove = function () {
|
|
|
+ var _this = this;
|
|
|
+ var _a;
|
|
|
+ //@ts-ignore
|
|
|
+ var view = this.getView();
|
|
|
+ var record = (_a = view.selection) === null || _a === void 0 ? void 0 : _a.data;
|
|
|
+ if (!record) {
|
|
|
+ msg$1('请选择一行数据');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var layoutCode = record.layout_code;
|
|
|
+ Ext.Msg.confirm('提示', "是否删除图形:" + layoutCode + "?", function (btn) {
|
|
|
+ if (btn === 'yes') {
|
|
|
+ deleteWhLayout({ layoutCode: layoutCode }).then(function (res) {
|
|
|
+ if (res.success) {
|
|
|
+ msg$1(res.msg);
|
|
|
+ _this.reload();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ };
|
|
|
+ WhLayoutController.prototype.onDblClick = function () {
|
|
|
+ var _a;
|
|
|
+ //@ts-ignore
|
|
|
+ var view = this.getView();
|
|
|
+ var record = (_a = view.selection) === null || _a === void 0 ? void 0 : _a.data;
|
|
|
+ if (!record) {
|
|
|
+ msg$1('请选择一行数据');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.edit(record);
|
|
|
+ };
|
|
|
+ WhLayoutController.prototype.filterChanged = function (sender, value) {
|
|
|
+ //@ts-ignore
|
|
|
+ this.view.store.clearFilter();
|
|
|
+ if (value) {
|
|
|
+ //@ts-ignore
|
|
|
+ this.view.store.filterBy(function (record) {
|
|
|
+ var widget_path = record.get('widget_path');
|
|
|
+ var widget_name = record.get('widget_name');
|
|
|
+ return (window['system'].pinyinMatch(widget_name, value) ||
|
|
|
+ _$2.includes(_$2.toLower(widget_path), _$2.toLower(value)));
|
|
|
+ });
|
|
|
+ }
|
|
|
+ };
|
|
|
+ WhLayoutController.prototype.onClearClick = function () {
|
|
|
+ var _a, _b;
|
|
|
+ //@ts-ignore
|
|
|
+ (_b = (_a = this.getReferences()) === null || _a === void 0 ? void 0 : _a.txtFilter) === null || _b === void 0 ? void 0 : _b.setValue('');
|
|
|
};
|
|
|
return WhLayoutController;
|
|
|
}());
|