|
@@ -37747,7 +37747,6 @@ define(['exports'], function (exports) { 'use strict';
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- //# sourceMappingURL=lib.js.map
|
|
|
|
|
|
|
|
var Scope = /** @class */ (function () {
|
|
var Scope = /** @class */ (function () {
|
|
function Scope(_a) {
|
|
function Scope(_a) {
|
|
@@ -38158,7 +38157,6 @@ define(['exports'], function (exports) { 'use strict';
|
|
Scope.SHOW_PAGE_STACK = [];
|
|
Scope.SHOW_PAGE_STACK = [];
|
|
return Scope;
|
|
return Scope;
|
|
}());
|
|
}());
|
|
- //# sourceMappingURL=Scope.js.map
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 全局 ajax 方法
|
|
* 全局 ajax 方法
|
|
@@ -38256,7 +38254,6 @@ define(['exports'], function (exports) { 'use strict';
|
|
});
|
|
});
|
|
return found >= ws.length;
|
|
return found >= ws.length;
|
|
}
|
|
}
|
|
- //# sourceMappingURL=config.js.map
|
|
|
|
|
|
|
|
function initComponent () {
|
|
function initComponent () {
|
|
var ct = Ext.Component.prototype.constructor;
|
|
var ct = Ext.Component.prototype.constructor;
|
|
@@ -38273,7 +38270,6 @@ define(['exports'], function (exports) { 'use strict';
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- //# sourceMappingURL=component.js.map
|
|
|
|
|
|
|
|
var labelWidth = 80;
|
|
var labelWidth = 80;
|
|
var date = {
|
|
var date = {
|
|
@@ -38381,162 +38377,178 @@ define(['exports'], function (exports) { 'use strict';
|
|
flex: 1
|
|
flex: 1
|
|
},
|
|
},
|
|
};
|
|
};
|
|
- //# sourceMappingURL=Defaults.js.map
|
|
|
|
|
|
|
|
- if (!window["time_offset"]) {
|
|
|
|
- window["time_offset"] = 0;
|
|
|
|
- }
|
|
|
|
- function syncDate(date) {
|
|
|
|
- if (date && date.setTime && date.getTime) {
|
|
|
|
- date.setTime(date.getTime() + window["time_offset"]);
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 创建一个 Ajax 客户端
|
|
|
|
+ */
|
|
|
|
+ function createAjax(createOption) {
|
|
|
|
+ if (createOption.baseUrl) {
|
|
|
|
+ axios$1.defaults.baseURL = createOption.baseUrl;
|
|
|
|
+ axios$1.defaults.timeout = createOption.timeout;
|
|
|
|
+ axios$1.defaults.timeoutErrorMessage = '网络超时';
|
|
}
|
|
}
|
|
- return date;
|
|
|
|
- }
|
|
|
|
- //# sourceMappingURL=utils.js.map
|
|
|
|
-
|
|
|
|
- function initDate () {
|
|
|
|
- var cc = Ext.field.Date.prototype.constructor;
|
|
|
|
- var _a = Ext.field.Date.prototype, initialize = _a.initialize, getValue = _a.getValue, valueToRaw = _a.valueToRaw, onPickerChange = _a.onPickerChange;
|
|
|
|
- Ext.field.Date.override({
|
|
|
|
- dateFormat: 'Y-m-d',
|
|
|
|
- altFormats: 'Y-m-d',
|
|
|
|
- constructor: function (config) {
|
|
|
|
- var newConfig = lodash.defaultsDeep({
|
|
|
|
- // 强制属性
|
|
|
|
- }, date, config);
|
|
|
|
- cc.call(this, newConfig);
|
|
|
|
- },
|
|
|
|
- getValue: function () {
|
|
|
|
- var ov = getValue.call(this);
|
|
|
|
- var nv = Ext.util.Format.date(ov, 'Y-m-d');
|
|
|
|
- return nv;
|
|
|
|
- },
|
|
|
|
- onPickerChange: function (sender, value) {
|
|
|
|
- var _a, _b, _c;
|
|
|
|
- onPickerChange.call(this, sender, value);
|
|
|
|
- value = Ext.util.Format.date(value, 'Y-m-d');
|
|
|
|
- var scope = lookupScope(this);
|
|
|
|
- // console.log('cc:', nv, ov)
|
|
|
|
- if (scope) {
|
|
|
|
- var bind = '';
|
|
|
|
- if (typeof ((_a = this.config.bind) === null || _a === void 0 ? void 0 : _a.value) === 'string') {
|
|
|
|
- bind = (_b = this.config.bind) === null || _b === void 0 ? void 0 : _b.value;
|
|
|
|
- }
|
|
|
|
- else if (typeof this.config.bind === 'string') {
|
|
|
|
- bind = this.config.bind;
|
|
|
|
- }
|
|
|
|
- if (bind && lodash.startsWith(bind, '{') && lodash.endsWith(bind, '}')) {
|
|
|
|
- bind = bind.substr(1, bind.length - 2);
|
|
|
|
- if (bind) {
|
|
|
|
- scope.viewModel.set(bind, value);
|
|
|
|
- (_c = sender.ownerCmp) === null || _c === void 0 ? void 0 : _c.fireEvent('change2', sender, value);
|
|
|
|
- }
|
|
|
|
|
|
+ return function (option) {
|
|
|
|
+ //@ts-ignore
|
|
|
|
+ option.method = (option.method || 'get').toLocaleLowerCase();
|
|
|
|
+ //@ts-ignore
|
|
|
|
+ var ax = __assign({}, option);
|
|
|
|
+ switch (option.method) {
|
|
|
|
+ case 'get':
|
|
|
|
+ ax.method = 'GET';
|
|
|
|
+ ax.params = option.param;
|
|
|
|
+ ax.headers = __assign({}, option.headers);
|
|
|
|
+ break;
|
|
|
|
+ case 'post':
|
|
|
|
+ ax.method = 'POST';
|
|
|
|
+ ax.headers = __assign({ 'Content-Type': 'application/x-www-form-urlencoded' }, option.headers);
|
|
|
|
+ ax.params = option.param;
|
|
|
|
+ ax.data = lib.stringify(option.data);
|
|
|
|
+ break;
|
|
|
|
+ case 'put':
|
|
|
|
+ case 'patch':
|
|
|
|
+ case 'delete':
|
|
|
|
+ ax.method = option.method;
|
|
|
|
+ ax.headers = option.headers;
|
|
|
|
+ ax.params = option.param;
|
|
|
|
+ ax.data = lib.stringify(option.data);
|
|
|
|
+ break;
|
|
|
|
+ case 'download':
|
|
|
|
+ downLoad(createOption.baseUrl + option.url, option.fileName || 'file', option.data, option.headers);
|
|
|
|
+ return new Promise(function (resolver, reject) {
|
|
|
|
+ });
|
|
|
|
+ case "invoke":
|
|
|
|
+ ax.url = serverInvokeUrlTransform(option.url, option);
|
|
|
|
+ ax.method = 'POST';
|
|
|
|
+ ax.headers = __assign({ 'Content-Type': 'application/json' }, option.headers);
|
|
|
|
+ if (typeof option.args === 'object') {
|
|
|
|
+ ax.data = JSON.stringify({
|
|
|
|
+ args: option.args,
|
|
|
|
+ });
|
|
}
|
|
}
|
|
- }
|
|
|
|
- },
|
|
|
|
- initialize: function () {
|
|
|
|
- this.on({
|
|
|
|
- expand: function (sender, opts) {
|
|
|
|
- var value = sender.getRawValue();
|
|
|
|
- if (value) {
|
|
|
|
- //@ts-ignore
|
|
|
|
- var dt_1 = moment(value).toDate();
|
|
|
|
- var picker_1 = sender.getPicker();
|
|
|
|
- picker_1.setValue(dt_1);
|
|
|
|
- // 延迟200毫秒后再设定一次值,动画会造成 bug
|
|
|
|
- setTimeout(function () {
|
|
|
|
- picker_1.setValue(dt_1);
|
|
|
|
- }, 200);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- var dt_2 = syncDate(new Date());
|
|
|
|
- var picker_2 = sender.getPicker();
|
|
|
|
- picker_2.setValue(dt_2);
|
|
|
|
- setTimeout(function () { return picker_2.setValue(dt_2); }, 200);
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
- initialize.call(this);
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- //# sourceMappingURL=datefield.js.map
|
|
|
|
-
|
|
|
|
- function initText () {
|
|
|
|
- var cc = Ext.field.Text.prototype.constructor;
|
|
|
|
- var _a = Ext.field.Text.prototype, initialize = _a.initialize, getValue = _a.getValue, valueToRaw = _a.valueToRaw, onPickerChange = _a.onPickerChange;
|
|
|
|
- Ext.field.Text.override({
|
|
|
|
- constructor: function (config) {
|
|
|
|
- var newConfig = lodash.defaultsDeep({
|
|
|
|
- // 强制属性
|
|
|
|
- }, config, text);
|
|
|
|
- cc.call(this, newConfig);
|
|
|
|
- },
|
|
|
|
- initialize: function () {
|
|
|
|
- var that = this;
|
|
|
|
- this.on({
|
|
|
|
- initialize: function () {
|
|
|
|
- $(this.el.dom).on('keyup', function (e) {
|
|
|
|
- if ([10, 13, 20, 40].includes(e.keyCode)) {
|
|
|
|
- // const value = sender.getRawValue()
|
|
|
|
- // console.log('keyup2', value)
|
|
|
|
- that.fireEvent('scancode', that, e.target.value);
|
|
|
|
- }
|
|
|
|
|
|
+ else {
|
|
|
|
+ ax.data = JSON.stringify({
|
|
|
|
+ args: [
|
|
|
|
+ __assign(__assign({}, option.data), option.param)
|
|
|
|
+ ],
|
|
|
|
+ filterModel: option.filterModel,
|
|
|
|
+ sortModel: option.sortModel
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- });
|
|
|
|
- initialize.call(this);
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- //# sourceMappingURL=textfield.js.map
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 构建所有组件的公共属性
|
|
|
|
- * @param config 原始config
|
|
|
|
- * @param dragType 组件模式
|
|
|
|
- * 不填,代表不能在设计时被拖拽
|
|
|
|
- * row-container 是一个rows容器
|
|
|
|
- * col-container 是一个cols容器
|
|
|
|
- * col-item cols中的一个格子(非容器),比如 textfield / combofield 等等
|
|
|
|
- * row-item rows中的一行,比如 tree / grid / panel 等等
|
|
|
|
- */
|
|
|
|
- function baseConfig(config, dragType) {
|
|
|
|
- if (config && config.designMode && dragType) {
|
|
|
|
- var cc = '';
|
|
|
|
- switch (dragType) {
|
|
|
|
- case "cols-container":
|
|
|
|
- cc = 'design_cols_container';
|
|
|
|
break;
|
|
break;
|
|
- case "col-item":
|
|
|
|
- cc = 'design_col_item';
|
|
|
|
|
|
+ case 'post-json':
|
|
|
|
+ ax.method = 'POST';
|
|
|
|
+ ax.headers = __assign({ 'Content-Type': 'application/json' }, option.headers);
|
|
|
|
+ ax.data = JSON.stringify(__assign(__assign({}, option.data), { filterModel: option.filterModel, sortModel: option.sortModel }));
|
|
break;
|
|
break;
|
|
- case "rows-container":
|
|
|
|
- cc = 'design_rows_container';
|
|
|
|
|
|
+ case 'post-raw':
|
|
|
|
+ ax.method = 'POST';
|
|
|
|
+ ax.headers = __assign({ 'Content-Type': 'application/json' }, option.headers);
|
|
|
|
+ ax.data = option.data;
|
|
break;
|
|
break;
|
|
- case "row-item":
|
|
|
|
- cc = 'design_row_item';
|
|
|
|
|
|
+ case 'post-file':
|
|
|
|
+ //TODO 刘壮. 上传文件
|
|
|
|
+ var forms = new FormData();
|
|
|
|
+ ax.headers = __assign({ 'Content-Type': 'multipart/form-data' }, option.headers);
|
|
|
|
+ lodash.forOwn(option.data, function (value, key) {
|
|
|
|
+ if (key === 'files') {
|
|
|
|
+ var i_1 = 0;
|
|
|
|
+ lodash.each(value, function (f) {
|
|
|
|
+ // @ts-ignore
|
|
|
|
+ forms.append('file' + (++i_1), f);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ forms.append(key, value);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ ax.data = forms;
|
|
|
|
+ ax.method = 'POST';
|
|
break;
|
|
break;
|
|
|
|
+ case "sql":
|
|
|
|
+ ax.url = sqlUrlTransform(option.url);
|
|
|
|
+ ax.method = 'POST';
|
|
|
|
+ ax.headers = __assign({ 'Content-Type': 'application/json' }, option.headers);
|
|
|
|
+ ax.data = JSON.stringify({
|
|
|
|
+ args: [option.data],
|
|
|
|
+ db: option.db,
|
|
|
|
+ filterModel: option.filterModel,
|
|
|
|
+ sortModel: option.sortModel
|
|
|
|
+ });
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ throw new Error('not implements');
|
|
}
|
|
}
|
|
- if (typeof config.cls === 'string') {
|
|
|
|
- lodash.extend(config, {
|
|
|
|
- cls: [config.cls, 'yvan_design', cc]
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- else if (lodash.isArray(config.cls)) {
|
|
|
|
- lodash.extend(config, {
|
|
|
|
- cls: __spread(config.cls, ['yvan_design', cc])
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- lodash.extend(config, {
|
|
|
|
- cls: ['yvan_design', cc]
|
|
|
|
|
|
+ return new Promise(function (resolver, reject) {
|
|
|
|
+ axios$1(ax).then(function (resolverRaw) {
|
|
|
|
+ var apiResult = {
|
|
|
|
+ rawData: resolverRaw.data,
|
|
|
|
+ status: resolverRaw.status,
|
|
|
|
+ success: (resolverRaw.data && resolverRaw.data.success),
|
|
|
|
+ data: resolverRaw.data.data,
|
|
|
|
+ pagination: resolverRaw.data.pagination,
|
|
|
|
+ msg: (resolverRaw.data.msg),
|
|
|
|
+ errors: resolverRaw.data.errors,
|
|
|
|
+ headers: resolverRaw.headers
|
|
|
|
+ };
|
|
|
|
+ resolver(apiResult);
|
|
|
|
+ }).catch(function (reason) {
|
|
|
|
+ reject(reason);
|
|
});
|
|
});
|
|
- }
|
|
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ function downLoad(downLoadUrl, filename, data, header, isJson) {
|
|
|
|
+ if (isJson === void 0) { isJson = false; }
|
|
|
|
+ var YvanUI = lodash.get(window, 'YvanUI');
|
|
|
|
+ YvanUI.loading();
|
|
|
|
+ var createObjectURL = function (object) {
|
|
|
|
+ return (window.URL) ? window.URL.createObjectURL(object) : lodash.get(window, 'webkitURL').createObjectURL(object);
|
|
|
|
+ };
|
|
|
|
+ // const formData = new FormData();
|
|
|
|
+ // _.forOwn(data, (v, k) => {
|
|
|
|
+ // formData.append(k, v);
|
|
|
|
+ // });
|
|
|
|
+ var formData = '';
|
|
|
|
+ var xhr = new XMLHttpRequest();
|
|
|
|
+ xhr.open('POST', downLoadUrl);
|
|
|
|
+ xhr.responseType = 'blob';
|
|
|
|
+ // xhr.setRequestHeader('Authorization', $.cookie('auth'))
|
|
|
|
+ if (isJson) {
|
|
|
|
+ formData = data ? JSON.stringify(data) : '';
|
|
|
|
+ xhr.setRequestHeader('Content-Type', 'application/json');
|
|
}
|
|
}
|
|
- return config;
|
|
|
|
|
|
+ else {
|
|
|
|
+ formData = data ? lib.stringify(data) : '';
|
|
|
|
+ xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
|
|
|
+ }
|
|
|
|
+ //
|
|
|
|
+ if (header) {
|
|
|
|
+ lodash.forOwn(header, function (v, k) {
|
|
|
|
+ xhr.setRequestHeader(k, v);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ xhr.onload = function (e) {
|
|
|
|
+ if (this.status === 200) {
|
|
|
|
+ var blob = this.response;
|
|
|
|
+ if (lodash.hasIn(window, 'navigator.msSaveOrOpenBlob')) {
|
|
|
|
+ navigator.msSaveBlob(blob, filename);
|
|
|
|
+ YvanUI.clearLoading();
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ var a = document.createElement('a');
|
|
|
|
+ var url = createObjectURL(blob);
|
|
|
|
+ a.href = url;
|
|
|
|
+ a.download = filename;
|
|
|
|
+ document.append(a);
|
|
|
|
+ a.click();
|
|
|
|
+ a.remove();
|
|
|
|
+ window.URL.revokeObjectURL(url);
|
|
|
|
+ YvanUI.clearLoading();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ xhr.send(formData);
|
|
}
|
|
}
|
|
- //# sourceMappingURL=base.js.map
|
|
|
|
|
|
|
|
function prompt(message, multiLine, value) {
|
|
function prompt(message, multiLine, value) {
|
|
if (value === void 0) { value = ''; }
|
|
if (value === void 0) { value = ''; }
|
|
@@ -38642,7 +38654,6 @@ define(['exports'], function (exports) { 'use strict';
|
|
$w.remove();
|
|
$w.remove();
|
|
}, 3000);
|
|
}, 3000);
|
|
}
|
|
}
|
|
- //# sourceMappingURL=message.js.map
|
|
|
|
|
|
|
|
var SIMPLE_RE = /^(?:\{(?:(\d+)|([a-z_][\w\.]*))\})$/i;
|
|
var SIMPLE_RE = /^(?:\{(?:(\d+)|([a-z_][\w\.]*))\})$/i;
|
|
/**
|
|
/**
|
|
@@ -39793,65 +39804,215 @@ define(['exports'], function (exports) { 'use strict';
|
|
lodash.remove(rows, function (n) {
|
|
lodash.remove(rows, function (n) {
|
|
return true;
|
|
return true;
|
|
});
|
|
});
|
|
- msg$1("请确保输入的数据正确");
|
|
|
|
- errFunc();
|
|
|
|
- // Ext.Msg.alert('提示', '请确保输入的数据正确', errFunc)
|
|
|
|
- return false;
|
|
|
|
|
|
+ msg$1("请确保输入的数据正确");
|
|
|
|
+ errFunc();
|
|
|
|
+ // Ext.Msg.alert('提示', '请确保输入的数据正确', errFunc)
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ if (lodash.findIndex(newRecords, function (item) {
|
|
|
|
+ return item === record;
|
|
|
|
+ }) >= 0) {
|
|
|
|
+ newRows.push(record.data);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ modifyRows.push(record.data);
|
|
|
|
+ }
|
|
|
|
+ rows.push(record.data);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return {
|
|
|
|
+ rows: rows,
|
|
|
|
+ newRows: newRows,
|
|
|
|
+ modifyRows: modifyRows,
|
|
|
|
+ removeRecords: removeRecords,
|
|
|
|
+ err: err
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var SystemLib = /*#__PURE__*/Object.freeze({
|
|
|
|
+ __proto__: null,
|
|
|
|
+ SIMPLE_RE: SIMPLE_RE,
|
|
|
|
+ replaceNA: replaceNA,
|
|
|
|
+ calcExpress: calcExpress,
|
|
|
|
+ calcObjectFlat: calcObjectFlat,
|
|
|
|
+ mergeViewModel: mergeViewModel,
|
|
|
|
+ flatRow: flatRow$1,
|
|
|
|
+ tryWriteByExpress: tryWriteByExpress,
|
|
|
|
+ tryWriteObject: tryWriteObject,
|
|
|
|
+ tryVarSimple: tryVarSimple,
|
|
|
|
+ calcObject: calcObject,
|
|
|
|
+ getParentGrid: getParentGrid,
|
|
|
|
+ tryEnable: tryEnable,
|
|
|
|
+ setComboStore: setComboStore,
|
|
|
|
+ invokeServer: invokeServer,
|
|
|
|
+ clearViewModelValues: clearViewModelValues,
|
|
|
|
+ reloadGrid: reloadGrid,
|
|
|
|
+ toPlainObject: toPlainObject,
|
|
|
|
+ confirm: confirm$1,
|
|
|
|
+ normId: normId,
|
|
|
|
+ clearViewModelReloadGrid: clearViewModelReloadGrid,
|
|
|
|
+ SystemEventFu: SystemEventFu,
|
|
|
|
+ clearViewModel: clearViewModel,
|
|
|
|
+ clearViewModelByLookup: clearViewModelByLookup,
|
|
|
|
+ showWidget: showWidget,
|
|
|
|
+ stopEvent: stopEvent,
|
|
|
|
+ msg: msg$1,
|
|
|
|
+ showErrorDialog: showErrorDialog$1,
|
|
|
|
+ evalFunction: evalFunction,
|
|
|
|
+ getGridEditRows: getGridEditRows
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ if (!window["time_offset"]) {
|
|
|
|
+ window["time_offset"] = 0;
|
|
|
|
+ }
|
|
|
|
+ function syncDate(date) {
|
|
|
|
+ if (date && date.setTime && date.getTime) {
|
|
|
|
+ date.setTime(date.getTime() + window["time_offset"]);
|
|
|
|
+ }
|
|
|
|
+ return date;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function initDate () {
|
|
|
|
+ var cc = Ext.field.Date.prototype.constructor;
|
|
|
|
+ var _a = Ext.field.Date.prototype, initialize = _a.initialize, getValue = _a.getValue, valueToRaw = _a.valueToRaw, onPickerChange = _a.onPickerChange;
|
|
|
|
+ Ext.field.Date.override({
|
|
|
|
+ dateFormat: 'Y-m-d',
|
|
|
|
+ altFormats: 'Y-m-d',
|
|
|
|
+ constructor: function (config) {
|
|
|
|
+ var newConfig = lodash.defaultsDeep({
|
|
|
|
+ // 强制属性
|
|
|
|
+ }, date, config);
|
|
|
|
+ cc.call(this, newConfig);
|
|
|
|
+ },
|
|
|
|
+ getValue: function () {
|
|
|
|
+ var ov = getValue.call(this);
|
|
|
|
+ var nv = Ext.util.Format.date(ov, 'Y-m-d');
|
|
|
|
+ return nv;
|
|
|
|
+ },
|
|
|
|
+ onPickerChange: function (sender, value) {
|
|
|
|
+ var _a, _b, _c;
|
|
|
|
+ onPickerChange.call(this, sender, value);
|
|
|
|
+ value = Ext.util.Format.date(value, 'Y-m-d');
|
|
|
|
+ var scope = lookupScope(this);
|
|
|
|
+ // console.log('cc:', nv, ov)
|
|
|
|
+ if (scope) {
|
|
|
|
+ var bind = '';
|
|
|
|
+ if (typeof ((_a = this.config.bind) === null || _a === void 0 ? void 0 : _a.value) === 'string') {
|
|
|
|
+ bind = (_b = this.config.bind) === null || _b === void 0 ? void 0 : _b.value;
|
|
|
|
+ }
|
|
|
|
+ else if (typeof this.config.bind === 'string') {
|
|
|
|
+ bind = this.config.bind;
|
|
|
|
+ }
|
|
|
|
+ if (bind && lodash.startsWith(bind, '{') && lodash.endsWith(bind, '}')) {
|
|
|
|
+ bind = bind.substr(1, bind.length - 2);
|
|
|
|
+ if (bind) {
|
|
|
|
+ scope.viewModel.set(bind, value);
|
|
|
|
+ (_c = sender.ownerCmp) === null || _c === void 0 ? void 0 : _c.fireEvent('change2', sender, value);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ initialize: function () {
|
|
|
|
+ this.on({
|
|
|
|
+ expand: function (sender, opts) {
|
|
|
|
+ var value = sender.getRawValue();
|
|
|
|
+ if (value) {
|
|
|
|
+ //@ts-ignore
|
|
|
|
+ var dt_1 = moment(value).toDate();
|
|
|
|
+ var picker_1 = sender.getPicker();
|
|
|
|
+ picker_1.setValue(dt_1);
|
|
|
|
+ // 延迟200毫秒后再设定一次值,动画会造成 bug
|
|
|
|
+ setTimeout(function () {
|
|
|
|
+ picker_1.setValue(dt_1);
|
|
|
|
+ }, 200);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ var dt_2 = syncDate(new Date());
|
|
|
|
+ var picker_2 = sender.getPicker();
|
|
|
|
+ picker_2.setValue(dt_2);
|
|
|
|
+ setTimeout(function () { return picker_2.setValue(dt_2); }, 200);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ initialize.call(this);
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function initText () {
|
|
|
|
+ var cc = Ext.field.Text.prototype.constructor;
|
|
|
|
+ var _a = Ext.field.Text.prototype, initialize = _a.initialize, getValue = _a.getValue, valueToRaw = _a.valueToRaw, onPickerChange = _a.onPickerChange;
|
|
|
|
+ Ext.field.Text.override({
|
|
|
|
+ constructor: function (config) {
|
|
|
|
+ var newConfig = lodash.defaultsDeep({
|
|
|
|
+ // 强制属性
|
|
|
|
+ }, config, text);
|
|
|
|
+ cc.call(this, newConfig);
|
|
|
|
+ },
|
|
|
|
+ initialize: function () {
|
|
|
|
+ var that = this;
|
|
|
|
+ this.on({
|
|
|
|
+ initialize: function () {
|
|
|
|
+ $(this.el.dom).on('keyup', function (e) {
|
|
|
|
+ if ([10, 13, 20, 40].includes(e.keyCode)) {
|
|
|
|
+ // const value = sender.getRawValue()
|
|
|
|
+ // console.log('keyup2', value)
|
|
|
|
+ that.fireEvent('scancode', that, e.target.value);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ initialize.call(this);
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 构建所有组件的公共属性
|
|
|
|
+ * @param config 原始config
|
|
|
|
+ * @param dragType 组件模式
|
|
|
|
+ * 不填,代表不能在设计时被拖拽
|
|
|
|
+ * row-container 是一个rows容器
|
|
|
|
+ * col-container 是一个cols容器
|
|
|
|
+ * col-item cols中的一个格子(非容器),比如 textfield / combofield 等等
|
|
|
|
+ * row-item rows中的一行,比如 tree / grid / panel 等等
|
|
|
|
+ */
|
|
|
|
+ function baseConfig(config, dragType) {
|
|
|
|
+ if (config && config.designMode && dragType) {
|
|
|
|
+ var cc = '';
|
|
|
|
+ switch (dragType) {
|
|
|
|
+ case "cols-container":
|
|
|
|
+ cc = 'design_cols_container';
|
|
|
|
+ break;
|
|
|
|
+ case "col-item":
|
|
|
|
+ cc = 'design_col_item';
|
|
|
|
+ break;
|
|
|
|
+ case "rows-container":
|
|
|
|
+ cc = 'design_rows_container';
|
|
|
|
+ break;
|
|
|
|
+ case "row-item":
|
|
|
|
+ cc = 'design_row_item';
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if (typeof config.cls === 'string') {
|
|
|
|
+ lodash.extend(config, {
|
|
|
|
+ cls: [config.cls, 'yvan_design', cc]
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ else if (lodash.isArray(config.cls)) {
|
|
|
|
+ lodash.extend(config, {
|
|
|
|
+ cls: __spread(config.cls, ['yvan_design', cc])
|
|
|
|
+ });
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- if (lodash.findIndex(newRecords, function (item) {
|
|
|
|
- return item === record;
|
|
|
|
- }) >= 0) {
|
|
|
|
- newRows.push(record.data);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- modifyRows.push(record.data);
|
|
|
|
- }
|
|
|
|
- rows.push(record.data);
|
|
|
|
|
|
+ lodash.extend(config, {
|
|
|
|
+ cls: ['yvan_design', cc]
|
|
|
|
+ });
|
|
}
|
|
}
|
|
- });
|
|
|
|
- return {
|
|
|
|
- rows: rows,
|
|
|
|
- newRows: newRows,
|
|
|
|
- modifyRows: modifyRows,
|
|
|
|
- removeRecords: removeRecords,
|
|
|
|
- err: err
|
|
|
|
- };
|
|
|
|
|
|
+ }
|
|
|
|
+ return config;
|
|
}
|
|
}
|
|
- //# sourceMappingURL=systemLib.js.map
|
|
|
|
-
|
|
|
|
- var SystemLib = /*#__PURE__*/Object.freeze({
|
|
|
|
- __proto__: null,
|
|
|
|
- SIMPLE_RE: SIMPLE_RE,
|
|
|
|
- replaceNA: replaceNA,
|
|
|
|
- calcExpress: calcExpress,
|
|
|
|
- calcObjectFlat: calcObjectFlat,
|
|
|
|
- mergeViewModel: mergeViewModel,
|
|
|
|
- flatRow: flatRow$1,
|
|
|
|
- tryWriteByExpress: tryWriteByExpress,
|
|
|
|
- tryWriteObject: tryWriteObject,
|
|
|
|
- tryVarSimple: tryVarSimple,
|
|
|
|
- calcObject: calcObject,
|
|
|
|
- getParentGrid: getParentGrid,
|
|
|
|
- tryEnable: tryEnable,
|
|
|
|
- setComboStore: setComboStore,
|
|
|
|
- invokeServer: invokeServer,
|
|
|
|
- clearViewModelValues: clearViewModelValues,
|
|
|
|
- reloadGrid: reloadGrid,
|
|
|
|
- toPlainObject: toPlainObject,
|
|
|
|
- confirm: confirm$1,
|
|
|
|
- normId: normId,
|
|
|
|
- clearViewModelReloadGrid: clearViewModelReloadGrid,
|
|
|
|
- SystemEventFu: SystemEventFu,
|
|
|
|
- clearViewModel: clearViewModel,
|
|
|
|
- clearViewModelByLookup: clearViewModelByLookup,
|
|
|
|
- showWidget: showWidget,
|
|
|
|
- stopEvent: stopEvent,
|
|
|
|
- msg: msg$1,
|
|
|
|
- showErrorDialog: showErrorDialog$1,
|
|
|
|
- evalFunction: evalFunction,
|
|
|
|
- getGridEditRows: getGridEditRows
|
|
|
|
- });
|
|
|
|
|
|
|
|
function initMultipleSearch () {
|
|
function initMultipleSearch () {
|
|
var _a = Ext.field.Text.prototype, initialize = _a.initialize, getValue = _a.getValue, valueToRaw = _a.valueToRaw, onPickerChange = _a.onPickerChange;
|
|
var _a = Ext.field.Text.prototype, initialize = _a.initialize, getValue = _a.getValue, valueToRaw = _a.valueToRaw, onPickerChange = _a.onPickerChange;
|
|
@@ -39989,7 +40150,6 @@ define(['exports'], function (exports) { 'use strict';
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- //# sourceMappingURL=multiplesearch.js.map
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 构建一个 grid 支持的 dataSource
|
|
* 构建一个 grid 支持的 dataSource
|
|
@@ -40128,7 +40288,6 @@ define(['exports'], function (exports) { 'use strict';
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- //# sourceMappingURL=stores.js.map
|
|
|
|
|
|
|
|
function initList () {
|
|
function initList () {
|
|
Ext.define('Yvan.List', {
|
|
Ext.define('Yvan.List', {
|
|
@@ -40272,7 +40431,6 @@ define(['exports'], function (exports) { 'use strict';
|
|
}
|
|
}
|
|
// throw new TypeError('无法识别的调用方法')
|
|
// throw new TypeError('无法识别的调用方法')
|
|
}
|
|
}
|
|
- //# sourceMappingURL=list.js.map
|
|
|
|
|
|
|
|
function initCols () {
|
|
function initCols () {
|
|
Ext.define('Yvan.Cols', {
|
|
Ext.define('Yvan.Cols', {
|
|
@@ -40289,7 +40447,6 @@ define(['exports'], function (exports) { 'use strict';
|
|
},
|
|
},
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- //# sourceMappingURL=cols.js.map
|
|
|
|
|
|
|
|
var PropertyDescription = /** @class */ (function () {
|
|
var PropertyDescription = /** @class */ (function () {
|
|
function PropertyDescription() {
|
|
function PropertyDescription() {
|
|
@@ -40331,7 +40488,6 @@ define(['exports'], function (exports) { 'use strict';
|
|
};
|
|
};
|
|
return PropertyDescription;
|
|
return PropertyDescription;
|
|
}());
|
|
}());
|
|
- //# sourceMappingURL=PropertyDescription.js.map
|
|
|
|
|
|
|
|
var PropertyDescriptionTable = new Map();
|
|
var PropertyDescriptionTable = new Map();
|
|
PropertyDescriptionTable.set('tabCell', new PropertyDescription({
|
|
PropertyDescriptionTable.set('tabCell', new PropertyDescription({
|
|
@@ -40663,7 +40819,6 @@ define(['exports'], function (exports) { 'use strict';
|
|
width, height
|
|
width, height
|
|
]
|
|
]
|
|
}));
|
|
}));
|
|
- //# sourceMappingURL=PropertyDescriptionTable.js.map
|
|
|
|
|
|
|
|
function initGrid () {
|
|
function initGrid () {
|
|
Ext.define('Yvan.Grid', {
|
|
Ext.define('Yvan.Grid', {
|
|
@@ -41146,7 +41301,6 @@ define(['exports'], function (exports) { 'use strict';
|
|
}
|
|
}
|
|
// throw new TypeError('无法识别的调用方法')
|
|
// throw new TypeError('无法识别的调用方法')
|
|
}
|
|
}
|
|
- //# sourceMappingURL=grid.js.map
|
|
|
|
|
|
|
|
function initGridColumn () {
|
|
function initGridColumn () {
|
|
var ct = Ext.grid.column.Column.prototype.constructor;
|
|
var ct = Ext.grid.column.Column.prototype.constructor;
|
|
@@ -41179,7 +41333,6 @@ define(['exports'], function (exports) { 'use strict';
|
|
// }
|
|
// }
|
|
// });
|
|
// });
|
|
}
|
|
}
|
|
- //# sourceMappingURL=gridcolumn.js.map
|
|
|
|
|
|
|
|
function initLocale() {
|
|
function initLocale() {
|
|
Ext.define('Ext.locale.zh_CN.Panel', {
|
|
Ext.define('Ext.locale.zh_CN.Panel', {
|
|
@@ -41223,7 +41376,6 @@ define(['exports'], function (exports) { 'use strict';
|
|
// }
|
|
// }
|
|
// });
|
|
// });
|
|
}
|
|
}
|
|
- //# sourceMappingURL=locale-zh_CN.js.map
|
|
|
|
|
|
|
|
var FixClass = /** @class */ (function () {
|
|
var FixClass = /** @class */ (function () {
|
|
function FixClass() {
|
|
function FixClass() {
|
|
@@ -41270,7 +41422,6 @@ define(['exports'], function (exports) { 'use strict';
|
|
], FixClass.prototype, "fix", null);
|
|
], FixClass.prototype, "fix", null);
|
|
return FixClass;
|
|
return FixClass;
|
|
}());
|
|
}());
|
|
- //# sourceMappingURL=fix.js.map
|
|
|
|
|
|
|
|
function init() {
|
|
function init() {
|
|
Ext.util.Format.defaultDateFormat = 'Y-m-d';
|
|
Ext.util.Format.defaultDateFormat = 'Y-m-d';
|
|
@@ -41351,180 +41502,6 @@ define(['exports'], function (exports) { 'use strict';
|
|
initGrid();
|
|
initGrid();
|
|
initStores();
|
|
initStores();
|
|
}
|
|
}
|
|
- //# sourceMappingURL=init.js.map
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 创建一个 Ajax 客户端
|
|
|
|
- */
|
|
|
|
- function createAjax(createOption) {
|
|
|
|
- if (createOption.baseUrl) {
|
|
|
|
- axios$1.defaults.baseURL = createOption.baseUrl;
|
|
|
|
- axios$1.defaults.timeout = createOption.timeout;
|
|
|
|
- axios$1.defaults.timeoutErrorMessage = '网络超时';
|
|
|
|
- }
|
|
|
|
- return function (option) {
|
|
|
|
- //@ts-ignore
|
|
|
|
- option.method = (option.method || 'get').toLocaleLowerCase();
|
|
|
|
- //@ts-ignore
|
|
|
|
- var ax = __assign({}, option);
|
|
|
|
- switch (option.method) {
|
|
|
|
- case 'get':
|
|
|
|
- ax.method = 'GET';
|
|
|
|
- ax.params = option.param;
|
|
|
|
- ax.headers = __assign({}, option.headers);
|
|
|
|
- break;
|
|
|
|
- case 'post':
|
|
|
|
- ax.method = 'POST';
|
|
|
|
- ax.headers = __assign({ 'Content-Type': 'application/x-www-form-urlencoded' }, option.headers);
|
|
|
|
- ax.params = option.param;
|
|
|
|
- ax.data = lib.stringify(option.data);
|
|
|
|
- break;
|
|
|
|
- case 'put':
|
|
|
|
- case 'patch':
|
|
|
|
- case 'delete':
|
|
|
|
- ax.method = option.method;
|
|
|
|
- ax.headers = option.headers;
|
|
|
|
- ax.params = option.param;
|
|
|
|
- ax.data = lib.stringify(option.data);
|
|
|
|
- break;
|
|
|
|
- case 'download':
|
|
|
|
- downLoad(createOption.baseUrl + option.url, option.fileName || 'file', option.data, option.headers);
|
|
|
|
- return new Promise(function (resolver, reject) {
|
|
|
|
- });
|
|
|
|
- case "invoke":
|
|
|
|
- ax.url = serverInvokeUrlTransform(option.url, option);
|
|
|
|
- ax.method = 'POST';
|
|
|
|
- ax.headers = __assign({ 'Content-Type': 'application/json' }, option.headers);
|
|
|
|
- if (typeof option.args === 'object') {
|
|
|
|
- ax.data = JSON.stringify({
|
|
|
|
- args: option.args,
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- ax.data = JSON.stringify({
|
|
|
|
- args: [
|
|
|
|
- __assign(__assign({}, option.data), option.param)
|
|
|
|
- ],
|
|
|
|
- filterModel: option.filterModel,
|
|
|
|
- sortModel: option.sortModel
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- break;
|
|
|
|
- case 'post-json':
|
|
|
|
- ax.method = 'POST';
|
|
|
|
- ax.headers = __assign({ 'Content-Type': 'application/json' }, option.headers);
|
|
|
|
- ax.data = JSON.stringify(__assign(__assign({}, option.data), { filterModel: option.filterModel, sortModel: option.sortModel }));
|
|
|
|
- break;
|
|
|
|
- case 'post-raw':
|
|
|
|
- ax.method = 'POST';
|
|
|
|
- ax.headers = __assign({ 'Content-Type': 'application/json' }, option.headers);
|
|
|
|
- ax.data = option.data;
|
|
|
|
- break;
|
|
|
|
- case 'post-file':
|
|
|
|
- //TODO 刘壮. 上传文件
|
|
|
|
- var forms = new FormData();
|
|
|
|
- ax.headers = __assign({ 'Content-Type': 'multipart/form-data' }, option.headers);
|
|
|
|
- lodash.forOwn(option.data, function (value, key) {
|
|
|
|
- if (key === 'files') {
|
|
|
|
- var i_1 = 0;
|
|
|
|
- lodash.each(value, function (f) {
|
|
|
|
- // @ts-ignore
|
|
|
|
- forms.append('file' + (++i_1), f);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- forms.append(key, value);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- ax.data = forms;
|
|
|
|
- ax.method = 'POST';
|
|
|
|
- break;
|
|
|
|
- case "sql":
|
|
|
|
- ax.url = sqlUrlTransform(option.url);
|
|
|
|
- ax.method = 'POST';
|
|
|
|
- ax.headers = __assign({ 'Content-Type': 'application/json' }, option.headers);
|
|
|
|
- ax.data = JSON.stringify({
|
|
|
|
- args: [option.data],
|
|
|
|
- db: option.db,
|
|
|
|
- filterModel: option.filterModel,
|
|
|
|
- sortModel: option.sortModel
|
|
|
|
- });
|
|
|
|
- break;
|
|
|
|
- default:
|
|
|
|
- throw new Error('not implements');
|
|
|
|
- }
|
|
|
|
- return new Promise(function (resolver, reject) {
|
|
|
|
- axios$1(ax).then(function (resolverRaw) {
|
|
|
|
- var apiResult = {
|
|
|
|
- rawData: resolverRaw.data,
|
|
|
|
- status: resolverRaw.status,
|
|
|
|
- success: (resolverRaw.data && resolverRaw.data.success),
|
|
|
|
- data: resolverRaw.data.data,
|
|
|
|
- pagination: resolverRaw.data.pagination,
|
|
|
|
- msg: (resolverRaw.data.msg),
|
|
|
|
- errors: resolverRaw.data.errors,
|
|
|
|
- headers: resolverRaw.headers
|
|
|
|
- };
|
|
|
|
- resolver(apiResult);
|
|
|
|
- }).catch(function (reason) {
|
|
|
|
- reject(reason);
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- };
|
|
|
|
- }
|
|
|
|
- function downLoad(downLoadUrl, filename, data, header, isJson) {
|
|
|
|
- if (isJson === void 0) { isJson = false; }
|
|
|
|
- var YvanUI = lodash.get(window, 'YvanUI');
|
|
|
|
- YvanUI.loading();
|
|
|
|
- var createObjectURL = function (object) {
|
|
|
|
- return (window.URL) ? window.URL.createObjectURL(object) : lodash.get(window, 'webkitURL').createObjectURL(object);
|
|
|
|
- };
|
|
|
|
- // const formData = new FormData();
|
|
|
|
- // _.forOwn(data, (v, k) => {
|
|
|
|
- // formData.append(k, v);
|
|
|
|
- // });
|
|
|
|
- var formData = '';
|
|
|
|
- var xhr = new XMLHttpRequest();
|
|
|
|
- xhr.open('POST', downLoadUrl);
|
|
|
|
- xhr.responseType = 'blob';
|
|
|
|
- // xhr.setRequestHeader('Authorization', $.cookie('auth'))
|
|
|
|
- if (isJson) {
|
|
|
|
- formData = data ? JSON.stringify(data) : '';
|
|
|
|
- xhr.setRequestHeader('Content-Type', 'application/json');
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- formData = data ? lib.stringify(data) : '';
|
|
|
|
- xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
|
|
|
- }
|
|
|
|
- //
|
|
|
|
- if (header) {
|
|
|
|
- lodash.forOwn(header, function (v, k) {
|
|
|
|
- xhr.setRequestHeader(k, v);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- xhr.onload = function (e) {
|
|
|
|
- if (this.status === 200) {
|
|
|
|
- var blob = this.response;
|
|
|
|
- if (lodash.hasIn(window, 'navigator.msSaveOrOpenBlob')) {
|
|
|
|
- navigator.msSaveBlob(blob, filename);
|
|
|
|
- YvanUI.clearLoading();
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- var a = document.createElement('a');
|
|
|
|
- var url = createObjectURL(blob);
|
|
|
|
- a.href = url;
|
|
|
|
- a.download = filename;
|
|
|
|
- document.append(a);
|
|
|
|
- a.click();
|
|
|
|
- a.remove();
|
|
|
|
- window.URL.revokeObjectURL(url);
|
|
|
|
- YvanUI.clearLoading();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
- xhr.send(formData);
|
|
|
|
- }
|
|
|
|
- //# sourceMappingURL=ajax.js.map
|
|
|
|
|
|
|
|
exports.Lib = Lib;
|
|
exports.Lib = Lib;
|
|
exports.LibParam = LibParam;
|
|
exports.LibParam = LibParam;
|