|
@@ -37686,6 +37686,43 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
var vm = extHandle.lookupViewModel();
|
|
|
return vm.yvanScope;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 转换内联结构的行,到平面结构
|
|
|
+ * company: { name:'公司1', id:'编号1' } => { company_id:'编号1', company_name:'公司1' }
|
|
|
+ *
|
|
|
+ * @param array
|
|
|
+ * @param flatOption
|
|
|
+ * @return {[]}
|
|
|
+ */
|
|
|
+ function flatRow(array) {
|
|
|
+ var ret = [];
|
|
|
+ lodash.forEach(array, function (row) {
|
|
|
+ var newRow = {};
|
|
|
+ flatObject(newRow, '', row);
|
|
|
+ ret.push(newRow);
|
|
|
+ });
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ function flatObject(parentObj, parentProp, obj) {
|
|
|
+ lodash.forOwn(obj, function (value, key) {
|
|
|
+ var fullKey = parentProp ? parentProp + '_' + key : key;
|
|
|
+ if (lodash.isArray(value)) {
|
|
|
+ parentObj[fullKey] = lodash.map(value, function (row) {
|
|
|
+ var newRow = {};
|
|
|
+ flatObject(newRow, '', row);
|
|
|
+ return newRow;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if (typeof value === 'object') {
|
|
|
+ flatObject(parentObj, fullKey, value);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ parentObj[fullKey] = value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
var Scope = /** @class */ (function () {
|
|
|
function Scope(_a) {
|
|
@@ -37905,6 +37942,59 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
}
|
|
|
// scope._handle?.setLoading(value)
|
|
|
};
|
|
|
+ Scope.prototype.showDialog = function (sender, vjsonOption, dataOption) {
|
|
|
+ if (vjsonOption === void 0) { vjsonOption = {}; }
|
|
|
+ if (dataOption === void 0) { dataOption = {}; }
|
|
|
+ var _a;
|
|
|
+ var that = this;
|
|
|
+ lodash.defaults(vjsonOption, {});
|
|
|
+ lodash.defaults(dataOption, {});
|
|
|
+ this._vjsonOption = vjsonOption;
|
|
|
+ this._dataOption = dataOption;
|
|
|
+ var vmodel = lodash.defaultsDeep({
|
|
|
+ data: {}
|
|
|
+ }, that.model, dataOption);
|
|
|
+ var config = lodash.defaultsDeep({
|
|
|
+ // viewModel: this.viewModel,
|
|
|
+ viewModel: vmodel,
|
|
|
+ yvanScope: this,
|
|
|
+ referenceHolder: true,
|
|
|
+ }, vjsonOption, that.vjson, {
|
|
|
+ xtype: 'dialog',
|
|
|
+ });
|
|
|
+ if (config.height === 'unset') {
|
|
|
+ delete config.height;
|
|
|
+ }
|
|
|
+ if (config.width === 'unset') {
|
|
|
+ delete config.width;
|
|
|
+ }
|
|
|
+ var topScope = (_a = lookupScope(sender)) === null || _a === void 0 ? void 0 : _a.topScope;
|
|
|
+ if (topScope) {
|
|
|
+ config.constrain = true;
|
|
|
+ this.topScope = topScope;
|
|
|
+ }
|
|
|
+ that._handle = Ext.create(config);
|
|
|
+ this.viewModel = that._handle.getViewModel();
|
|
|
+ this.viewModel.yvanScope = this;
|
|
|
+ that._handle.on({
|
|
|
+ renderedchange: function (sender, item, rendered, opts) {
|
|
|
+ that._handle = this;
|
|
|
+ window['cw'] = that;
|
|
|
+ // 调用onLoad回调
|
|
|
+ try {
|
|
|
+ that._onLoad();
|
|
|
+ }
|
|
|
+ catch (e) {
|
|
|
+ console.error('errorAt onLoad', e);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ destroy: function () {
|
|
|
+ // 卸载
|
|
|
+ that._onDestroy();
|
|
|
+ },
|
|
|
+ });
|
|
|
+ that._handle.show();
|
|
|
+ };
|
|
|
/**
|
|
|
* 关闭对话框(或标签页)
|
|
|
*/
|
|
@@ -38738,7 +38828,7 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
*/
|
|
|
function mergeViewModel(viewModel, propertyName, data) {
|
|
|
var newRow = {};
|
|
|
- flatObject(newRow, '', data);
|
|
|
+ flatObject$1(newRow, '', data);
|
|
|
lodash.forOwn(newRow, function (value, key) {
|
|
|
viewModel.set(propertyName + "." + key, value);
|
|
|
});
|
|
@@ -38751,28 +38841,28 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
* @param flatOption
|
|
|
* @return {[]}
|
|
|
*/
|
|
|
- function flatRow(array) {
|
|
|
+ function flatRow$1(array) {
|
|
|
var ret = [];
|
|
|
lodash.forEach(array, function (row) {
|
|
|
var newRow = {};
|
|
|
- flatObject(newRow, '', row);
|
|
|
+ flatObject$1(newRow, '', row);
|
|
|
ret.push(newRow);
|
|
|
});
|
|
|
return ret;
|
|
|
}
|
|
|
- function flatObject(parentObj, parentProp, obj) {
|
|
|
+ function flatObject$1(parentObj, parentProp, obj) {
|
|
|
lodash.forOwn(obj, function (value, key) {
|
|
|
var fullKey = parentProp ? parentProp + '_' + key : key;
|
|
|
if (lodash.isArray(value)) {
|
|
|
parentObj[fullKey] = lodash.map(value, function (row) {
|
|
|
var newRow = {};
|
|
|
- flatObject(newRow, '', row);
|
|
|
+ flatObject$1(newRow, '', row);
|
|
|
return newRow;
|
|
|
});
|
|
|
}
|
|
|
else {
|
|
|
if (typeof value === 'object') {
|
|
|
- flatObject(parentObj, fullKey, value);
|
|
|
+ flatObject$1(parentObj, fullKey, value);
|
|
|
}
|
|
|
else {
|
|
|
parentObj[fullKey] = value;
|
|
@@ -39844,7 +39934,7 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
calcExpress: calcExpress,
|
|
|
calcObjectFlat: calcObjectFlat,
|
|
|
mergeViewModel: mergeViewModel,
|
|
|
- flatRow: flatRow,
|
|
|
+ flatRow: flatRow$1,
|
|
|
tryWriteByExpress: tryWriteByExpress,
|
|
|
tryWriteObject: tryWriteObject,
|
|
|
tryVarSimple: tryVarSimple,
|
|
@@ -40749,6 +40839,7 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
exports.createAjax = createAjax;
|
|
|
exports.downLoad = downLoad;
|
|
|
exports.extend = extend$1;
|
|
|
+ exports.flatRow = flatRow;
|
|
|
exports.getApiConvert = getApiConvert;
|
|
|
exports.getPinyin = getPinyin;
|
|
|
exports.getRegList = getRegList;
|