@ctzy-web-client/data-model 1.0.0 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/es/SimpleOrm.mjs +85 -0
  2. package/es/_virtual/_rollupPluginBabelHelpers.mjs +2830 -0
  3. package/es/abstract/DataColumn.mjs +65 -0
  4. package/es/abstract/DataForm.mjs +178 -0
  5. package/es/abstract/DataModel.mjs +223 -0
  6. package/es/abstract/DataModelAdapter.mjs +86 -0
  7. package/es/abstract/DataTable.mjs +339 -0
  8. package/es/abstract/FilterColumn.mjs +44 -0
  9. package/es/abstract/FilterPanel.mjs +392 -0
  10. package/es/abstract/FormColumn.mjs +27 -0
  11. package/es/abstract/TableColumn.mjs +34 -0
  12. package/es/abstract/dataForm2.mjs +178 -0
  13. package/es/abstract/where/CombineCondition.mjs +63 -0
  14. package/es/abstract/where/Condition.mjs +4 -0
  15. package/es/abstract/where/SingleCondition.mjs +22 -0
  16. package/es/abstract/where/Where.mjs +21 -0
  17. package/es/decorator/constant.mjs +11 -0
  18. package/es/decorator/dataForm.mjs +18 -0
  19. package/es/decorator/dataTable.mjs +18 -0
  20. package/es/decorator/filterColumn.mjs +21 -0
  21. package/es/decorator/formColumn.mjs +19 -0
  22. package/es/decorator/tableColumn.mjs +20 -0
  23. package/es/factory.mjs +14 -0
  24. package/es/index.mjs +14 -0
  25. package/es/utils/index.mjs +15 -0
  26. package/lib/SimpleOrm.js +89 -0
  27. package/lib/_virtual/_rollupPluginBabelHelpers.js +2948 -0
  28. package/lib/abstract/DataColumn.js +69 -0
  29. package/lib/abstract/DataForm.js +186 -0
  30. package/lib/abstract/DataModel.js +231 -0
  31. package/lib/abstract/DataModelAdapter.js +90 -0
  32. package/lib/abstract/DataTable.js +343 -0
  33. package/lib/abstract/FilterColumn.js +48 -0
  34. package/lib/abstract/FilterPanel.js +396 -0
  35. package/lib/abstract/FormColumn.js +31 -0
  36. package/lib/abstract/TableColumn.js +38 -0
  37. package/lib/abstract/dataForm2.js +186 -0
  38. package/lib/abstract/where/CombineCondition.js +67 -0
  39. package/lib/abstract/where/Condition.js +8 -0
  40. package/lib/abstract/where/SingleCondition.js +26 -0
  41. package/lib/abstract/where/Where.js +25 -0
  42. package/lib/decorator/constant.js +20 -0
  43. package/lib/decorator/dataForm.js +22 -0
  44. package/lib/decorator/dataTable.js +22 -0
  45. package/lib/decorator/filterColumn.js +25 -0
  46. package/lib/decorator/formColumn.js +23 -0
  47. package/lib/decorator/tableColumn.js +24 -0
  48. package/lib/factory.js +19 -0
  49. package/lib/index.js +36 -0
  50. package/lib/utils/index.js +19 -0
  51. package/package.json +33 -33
@@ -0,0 +1,65 @@
1
+ import { BehaviorSubject } from 'rxjs';
2
+
3
+ class DataColumn {
4
+ constructor(options) {
5
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
6
+ this.title = "";
7
+ this.name = "";
8
+ this.attrName = "";
9
+ this.fullAttrName = "";
10
+ this.default = void 0;
11
+ this._visible = true;
12
+ this.component = void 0;
13
+ this.isExtend = false;
14
+ this.componentTitle = "";
15
+ this.componentProps = void 0;
16
+ this._visibleSubject = null;
17
+ this.title = (_a = options == null ? void 0 : options.title) != null ? _a : this.title;
18
+ this.name = (_b = options == null ? void 0 : options.name) != null ? _b : this.name;
19
+ this.attrName = (_c = options == null ? void 0 : options.attrName) != null ? _c : this.attrName;
20
+ this.default = (_d = options == null ? void 0 : options.default) != null ? _d : this.default;
21
+ this._visible = (_e = options == null ? void 0 : options.visible) != null ? _e : this._visible;
22
+ this.component = (_f = options == null ? void 0 : options.component) != null ? _f : this.component;
23
+ this.componentTitle = (_g = options == null ? void 0 : options.componentTitle) != null ? _g : this.componentTitle;
24
+ this.componentProps = (_h = options == null ? void 0 : options.componentProps) != null ? _h : this.componentProps;
25
+ this.isExtend = (_i = options == null ? void 0 : options.isExtend) != null ? _i : this.isExtend;
26
+ this.fullAttrName = this.isExtend ? options == null ? void 0 : options.fullAttrName : this.attrName;
27
+ this._visibleSubject = new BehaviorSubject(this._visible);
28
+ }
29
+ get visible() {
30
+ return this._visible;
31
+ }
32
+ set visible(visible) {
33
+ if (visible) {
34
+ this.show();
35
+ return;
36
+ }
37
+ this.hide();
38
+ }
39
+ getVisibleSubject() {
40
+ return this._visibleSubject;
41
+ }
42
+ show() {
43
+ if (this._visible) {
44
+ return;
45
+ }
46
+ this._visible = true;
47
+ this._visibleSubject.next(this._visible);
48
+ }
49
+ hide() {
50
+ if (!this._visible) {
51
+ return;
52
+ }
53
+ this._visible = false;
54
+ this._visibleSubject.next(this._visible);
55
+ }
56
+ toggleVisible() {
57
+ if (this._visible) {
58
+ this.hide();
59
+ return;
60
+ }
61
+ this.show();
62
+ }
63
+ }
64
+
65
+ export { DataColumn as default };
@@ -0,0 +1,178 @@
1
+ import get from 'lodash/get';
2
+ import { DATA_FORM, DATA_FORM_COLUMNS } from '../decorator/constant.mjs';
3
+ import { sortColumn } from '../utils/index.mjs';
4
+ import DataModel from './DataModel.mjs';
5
+ import FormColumn from './FormColumn.mjs';
6
+
7
+ class DataForm extends DataModel {
8
+ constructor(option) {
9
+ super(option);
10
+ this.changed = false;
11
+ this.locking = false;
12
+ this.disabled = false;
13
+ this.data = {};
14
+ this.formValivators = [];
15
+ this._loadCallbacks = [];
16
+ this._inited = false;
17
+ }
18
+ setOptions(options) {
19
+ if (!options.model) {
20
+ return;
21
+ }
22
+ super.setOptions({
23
+ ...options.model[DATA_FORM],
24
+ model: options.model
25
+ });
26
+ }
27
+ disable() {
28
+ this.disabled = true;
29
+ }
30
+ enable() {
31
+ this.disabled = false;
32
+ }
33
+ init() {
34
+ super.init();
35
+ const model = this.model;
36
+ if (!model) {
37
+ return;
38
+ }
39
+ if (this.extendField) {
40
+ return;
41
+ } else {
42
+ const columns = (model[DATA_FORM_COLUMNS] || []).map((columnConfig) => new FormColumn(columnConfig));
43
+ for (const column of columns) {
44
+ this.addColumn(column);
45
+ }
46
+ model.formColumns = this.getColumns().map((column) => column.attrName);
47
+ }
48
+ this.setData(null);
49
+ this._inited = true;
50
+ this.emit("init-completed");
51
+ }
52
+ setExtendFieldInfos(extendFieldInfos) {
53
+ if (this._inited) {
54
+ return;
55
+ }
56
+ this.extendFieldInfos = extendFieldInfos;
57
+ const formColumns = extendFieldInfos.map((extendField) => {
58
+ var _a;
59
+ return new FormColumn({
60
+ name: extendField.name,
61
+ title: extendField.title,
62
+ attrName: extendField.name,
63
+ submitName: extendField.name,
64
+ default: extendField.defaultValue || "",
65
+ isExtend: !extendField.type,
66
+ required: !!extendField.isRequired,
67
+ component: extendField.component,
68
+ componentProps: (_a = extendField.extendInfo) != null ? _a : {},
69
+ fullAttrName: `${this.extendField}.${extendField.name}`
70
+ });
71
+ });
72
+ this.setColumns(formColumns);
73
+ this.setData(null);
74
+ this._inited = true;
75
+ for (const callback of this._loadCallbacks) {
76
+ callback();
77
+ }
78
+ this.emit("init-completed");
79
+ }
80
+ setData(data) {
81
+ if (data) {
82
+ this.data = data;
83
+ } else {
84
+ this.reset();
85
+ }
86
+ this.ready = true;
87
+ }
88
+ reset() {
89
+ this.setData(this.formatData({}));
90
+ }
91
+ async loadDataByRecId(params) {
92
+ if (!this._inited) {
93
+ return new Promise((resolve, reject) => {
94
+ this._loadCallbacks.push(() => {
95
+ this.loadDataByRecId(params).then(resolve, reject);
96
+ });
97
+ });
98
+ }
99
+ this.locking = true;
100
+ if (typeof params !== "object") {
101
+ params = {
102
+ [this.primaryKey]: params
103
+ };
104
+ }
105
+ params = {
106
+ ...this.defaultParams,
107
+ ...params
108
+ };
109
+ this.emit("before-load", params);
110
+ return this.adapter.loadDataByRecIdHandle(this, params).then((res) => {
111
+ const data = this.formatData(Array.isArray(res.data) ? res.data[0] : res.data);
112
+ this.setData(data);
113
+ this.emit("load-successfully", res);
114
+ return res;
115
+ }).catch((e) => {
116
+ this.emit("load-failed", e);
117
+ return Promise.reject(e);
118
+ }).finally(() => {
119
+ this.locking = false;
120
+ this.emit("load-complete");
121
+ });
122
+ }
123
+ formatSubmitData(data) {
124
+ return this._format(data, "submitName");
125
+ }
126
+ sortColumns(columns) {
127
+ return sortColumn(columns, this.model.formColumns || []);
128
+ }
129
+ async validate() {
130
+ if (!this.formValivators.length) {
131
+ return Promise.resolve(false);
132
+ }
133
+ const validateResults = await Promise.all(this.formValivators.map((validator) => validator.validate().then(() => true, () => false)));
134
+ return validateResults.reduce((result, item) => result && item, true);
135
+ }
136
+ async submit(data = {}) {
137
+ if (this.disabled) {
138
+ throw new Error("\u7981\u7528\u72B6\u6001\u4E0D\u80FD\u4FDD\u5B58");
139
+ }
140
+ if (this.locking) {
141
+ return;
142
+ }
143
+ if (!await this.validate()) {
144
+ return;
145
+ }
146
+ this.locking = true;
147
+ const submitData = {};
148
+ for (let column of this.getColumns().filter((column2) => !column2.isExtend)) {
149
+ submitData[column.submitName] = this.data[column.attrName];
150
+ }
151
+ if (this.extendField) {
152
+ let extendObject = {};
153
+ for (let column of this.getColumns().filter((column2) => column2.isExtend)) {
154
+ extendObject[column.attrName] = get(this.data, column.fullAttrName);
155
+ }
156
+ submitData[this.extendField] = extendObject;
157
+ }
158
+ Object.assign(submitData, data);
159
+ this.emit("before-submit", data);
160
+ return this.adapter.submitHandle(this, submitData).then((res) => {
161
+ this.emit("submit-successfully", res);
162
+ return res;
163
+ }).catch((e) => {
164
+ this.emit("submit-failed", e);
165
+ return Promise.reject(e);
166
+ }).finally(() => {
167
+ this.emit("submit-complete");
168
+ this.locking = false;
169
+ });
170
+ }
171
+ setDisplayColumns(displayColumns) {
172
+ const displayColumnNames = displayColumns.map((column) => column.fullAttrName);
173
+ this._displayColumns = this.getColumns().filter((column) => displayColumnNames.includes(column.fullAttrName));
174
+ this.getDisplayColumnsSubject().next(this.getDisplayColumns());
175
+ }
176
+ }
177
+
178
+ export { DataForm as default };
@@ -0,0 +1,223 @@
1
+ import { initializerDefineProperty as _initializerDefineProperty, applyDecoratedDescriptor as _applyDecoratedDescriptor } from '../_virtual/_rollupPluginBabelHelpers.mjs';
2
+ import get from 'lodash/get';
3
+ import DataModelAdapter from './DataModelAdapter.mjs';
4
+ import './DataColumn.mjs';
5
+ import { inject } from '@ctzy-web-client/ioc-annotations';
6
+ import { EventDispatcher } from '@ctzy-web-client/support';
7
+ import { InstantiationService } from '@ctzy-web-client/ioc';
8
+ import { clone, cloneDeep } from 'lodash';
9
+ import { BehaviorSubject } from 'rxjs';
10
+
11
+ var _dec, _dec2, _class, _descriptor, _descriptor2;
12
+ let DataModel = (_dec = inject(DataModelAdapter), _dec2 = inject(InstantiationService), _class = class DataModel2 extends EventDispatcher {
13
+ constructor(options) {
14
+ super();
15
+ this.name = "";
16
+ this.title = "";
17
+ this.primaryKey = "id";
18
+ _initializerDefineProperty(this, "adapter", _descriptor, this);
19
+ _initializerDefineProperty(this, "instantiationService", _descriptor2, this);
20
+ this.defaultParams = {};
21
+ this.model = null;
22
+ this.ready = false;
23
+ this._options = null;
24
+ this.extendField = "";
25
+ this.extendFieldInfos = [];
26
+ this._columns = [];
27
+ this._displayColumns = [];
28
+ this._columnSubscriptionMap = /* @__PURE__ */ new Map();
29
+ this._displayColumnsSubject = new BehaviorSubject([]);
30
+ this.setOptions(options);
31
+ }
32
+ setOptions(options) {
33
+ this._options = options;
34
+ this.name = options.name;
35
+ this.title = options.title;
36
+ this.primaryKey = options.primaryKey || this.primaryKey;
37
+ this.extendField = options.extendField;
38
+ this.model = options.model;
39
+ }
40
+ init() {
41
+ var _a;
42
+ if (typeof ((_a = this._options) == null ? void 0 : _a.adapter) === "function") {
43
+ this.adapter = this.instantiationService.createInstance(this._options.adapter);
44
+ }
45
+ }
46
+ _format(data, propName = "name") {
47
+ const columns = this.getColumns();
48
+ const _data = {};
49
+ for (let column of columns.filter((column2) => !column2.isExtend)) {
50
+ const value = data == null ? void 0 : data[column[propName]];
51
+ _data[column.attrName] = value === "" || value == null ? column.default : value;
52
+ }
53
+ if (this.extendField) {
54
+ let extendObject = {};
55
+ for (let column of columns.filter((column2) => column2.isExtend)) {
56
+ const value = get(data, column.fullAttrName);
57
+ extendObject[column.attrName] = value === "" || value == null ? column.default : value;
58
+ }
59
+ _data[this.extendField] = extendObject;
60
+ }
61
+ const extendProperties = (source, target, predicate) => {
62
+ let keys = Object.keys(source);
63
+ keys = keys.filter((key) => !columns.filter(predicate).find((column) => column.attrName === key));
64
+ for (const key of keys) {
65
+ target[key] = source[key];
66
+ }
67
+ };
68
+ extendProperties(data, _data, (column) => !column.isExtend);
69
+ if (this.extendField && data[this.extendField]) {
70
+ extendProperties(data[this.extendField], _data[this.extendField], (column) => column.isExtend);
71
+ }
72
+ return _data;
73
+ }
74
+ getDisplayColumnsSubject() {
75
+ return this._displayColumnsSubject;
76
+ }
77
+ setParam(key, value) {
78
+ this.defaultParams[key] = value;
79
+ }
80
+ getParam(key) {
81
+ return this.defaultParams[key];
82
+ }
83
+ hasParam(key) {
84
+ return Reflect.has(this.defaultParams, key);
85
+ }
86
+ removeParam(key) {
87
+ Reflect.deleteProperty(this.defaultParams, key);
88
+ }
89
+ addParams(params = {}) {
90
+ this.defaultParams = {
91
+ ...this.defaultParams,
92
+ ...params
93
+ };
94
+ }
95
+ setParams(params = {}) {
96
+ this.defaultParams = params;
97
+ }
98
+ clearParam() {
99
+ this.defaultParams = {};
100
+ }
101
+ formatData(data) {
102
+ return this._format(data);
103
+ }
104
+ formatExtendFieldInfo(extendFieldInfo) {
105
+ return {
106
+ title: extendFieldInfo.title,
107
+ name: extendFieldInfo.name,
108
+ default: extendFieldInfo.defaultValue,
109
+ attrName: extendFieldInfo.name,
110
+ isExtend: !extendFieldInfo.type,
111
+ required: !!extendFieldInfo.isRequired,
112
+ visible: !!extendFieldInfo.isVisible,
113
+ component: extendFieldInfo.component,
114
+ componentProps: {
115
+ ...extendFieldInfo.extendInfo
116
+ }
117
+ };
118
+ }
119
+ mergeTableColumn(formatedExtendFieldInfo, modelFieldInfo) {
120
+ return {
121
+ ...modelFieldInfo,
122
+ ...formatedExtendFieldInfo,
123
+ fullAttrName: `${this.extendField}.${formatedExtendFieldInfo.name}`,
124
+ componentProps: {
125
+ ...modelFieldInfo == null ? void 0 : modelFieldInfo.componentProps,
126
+ ...formatedExtendFieldInfo.extendInfo
127
+ }
128
+ };
129
+ }
130
+ mergeTableColumns(extendFieldInfos, modelFieldInfos = []) {
131
+ return extendFieldInfos.map((extendFieldInfo) => {
132
+ const modelFieldInfo = modelFieldInfos.find((field) => field.name === extendFieldInfo.name);
133
+ const formatedExtendFieldInfo = this.formatExtendFieldInfo(extendFieldInfo);
134
+ return this.mergeTableColumn(formatedExtendFieldInfo, modelFieldInfo);
135
+ });
136
+ }
137
+ getColumns() {
138
+ return this._columns.slice();
139
+ }
140
+ setColumns(columns) {
141
+ this._columnSubscriptionMap.clear();
142
+ this._columns = [];
143
+ for (let column of columns) {
144
+ this.addColumn(column);
145
+ }
146
+ }
147
+ sortColumns(columns) {
148
+ throw new Error("\u6682\u672A\u5B9E\u73B0\u3002");
149
+ }
150
+ addColumn(column) {
151
+ if (!this.getColumn(column.attrName)) {
152
+ this._columns = this.sortColumns(this.getColumns().concat(column));
153
+ const subscription = column.getVisibleSubject().subscribe({
154
+ next: (visible) => {
155
+ if (visible) {
156
+ this.addDisplayColumn(column);
157
+ return;
158
+ }
159
+ this.removeDisplayColumn(column);
160
+ },
161
+ error: () => {
162
+ this.removeDisplayColumn(column);
163
+ },
164
+ complete: () => {
165
+ this.removeDisplayColumn(column);
166
+ }
167
+ });
168
+ this._columnSubscriptionMap.set(column.attrName, subscription);
169
+ } else {
170
+ throw new Error("\u65E0\u6CD5\u6DFB\u52A0\u4E24\u4E2A\u5B57\u6BB5\u540D\u79F0\u4E00\u6837\u7684\u5B57\u6BB5:" + column.attrName);
171
+ }
172
+ }
173
+ getColumn(columnName) {
174
+ var _a;
175
+ return (_a = this._columns.find((column) => column.attrName === columnName)) != null ? _a : null;
176
+ }
177
+ getDisplayColumns() {
178
+ return this._displayColumns.slice();
179
+ }
180
+ setDisplayColumns(displayColumns) {
181
+ this._displayColumns = displayColumns;
182
+ this.getDisplayColumnsSubject().next(this.getDisplayColumns());
183
+ }
184
+ hasDisplayColumn(column) {
185
+ return !!this._displayColumns.find((item) => item.attrName === column.attrName);
186
+ }
187
+ addDisplayColumn(column) {
188
+ if (!this.getColumn(column.attrName) || this.hasDisplayColumn(column)) {
189
+ return;
190
+ }
191
+ this.setDisplayColumns(this._displayColumns.concat(column));
192
+ }
193
+ removeDisplayColumn(column) {
194
+ if (!this.hasDisplayColumn(column)) {
195
+ return;
196
+ }
197
+ this.setDisplayColumns(this._displayColumns.filter((item) => item.attrName !== column.attrName));
198
+ }
199
+ clone() {
200
+ const cloned = clone(this);
201
+ cloned.adapter = this.adapter;
202
+ cloned.instantiationService = this.instantiationService;
203
+ cloned.defaultParams = cloneDeep(this.defaultParams);
204
+ cloned._columns = cloneDeep(this._columns);
205
+ return cloned;
206
+ }
207
+ }, _descriptor = _applyDecoratedDescriptor(_class.prototype, "adapter", [_dec], {
208
+ configurable: true,
209
+ enumerable: true,
210
+ writable: true,
211
+ initializer: function() {
212
+ return null;
213
+ }
214
+ }), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "instantiationService", [_dec2], {
215
+ configurable: true,
216
+ enumerable: true,
217
+ writable: true,
218
+ initializer: function() {
219
+ return null;
220
+ }
221
+ }), _class);
222
+
223
+ export { DataModel as default };
@@ -0,0 +1,86 @@
1
+ import { initializerDefineProperty as _initializerDefineProperty, applyDecoratedDescriptor as _applyDecoratedDescriptor } from '../_virtual/_rollupPluginBabelHelpers.mjs';
2
+ import { inject, value } from '@ctzy-web-client/ioc-annotations';
3
+ import { HttpRequest } from '@ctzy-web-client/support';
4
+
5
+ var _dec, _dec2, _class, _descriptor, _descriptor2;
6
+ let DataModelAdapter = (_dec = inject(HttpRequest), _dec2 = value("AppName"), _class = class DataModelAdapter2 {
7
+ constructor() {
8
+ _initializerDefineProperty(this, "httpRequest", _descriptor, this);
9
+ _initializerDefineProperty(this, "appName", _descriptor2, this);
10
+ this.loadDataListItfMethod = "POST";
11
+ this.deleteItfMethod = "POST";
12
+ this.loadDataByRecIdMethod = "POST";
13
+ this.saveItfMethod = "POST";
14
+ this.updateItfMethod = "POST";
15
+ this.extendFieldItfMethod = "POST";
16
+ this.loadDataListItfUrl = "/${DataModelName}/page";
17
+ this.saveItfUrl = "${DataModelName}/save";
18
+ this.updateItfUrl = "${DataModelName}/update";
19
+ this.loadDataByRecIdItfUrl = "/${DataModelName}/find";
20
+ this.deleteItfUrl = "/${DataModelName}/delete";
21
+ this.extendFieldItfUrl = "/sceneField/default/page";
22
+ this.submitMethod = "POST";
23
+ this.pagerNumParamName = "pageNo";
24
+ this.recCountParamName = "pageSize";
25
+ this.dataNodeName = "data";
26
+ this.totalRecCountNodeName = "totalRecCount";
27
+ }
28
+ formatUrl(url, context) {
29
+ return url.replace(/(\$\{[\S]+?\})/g, (name) => {
30
+ if (name == "${AppName}") {
31
+ return context.appName;
32
+ } else if (name == "${DataModelName}") {
33
+ return context.dataModelName;
34
+ }
35
+ return name;
36
+ });
37
+ }
38
+ async sendRequest(url, method, params) {
39
+ return this.httpRequest[method.toLowerCase()](url, params);
40
+ }
41
+ async _sendRequest(context, url, method, params) {
42
+ const _context = {
43
+ appName: this.appName,
44
+ dataModelName: context.name
45
+ };
46
+ url = this.formatUrl(url, _context);
47
+ return this.sendRequest(url, method, params);
48
+ }
49
+ getExtendsFieldHandle(context, params) {
50
+ return this._sendRequest(context, this.extendFieldItfUrl, this.extendFieldItfMethod, params);
51
+ }
52
+ async loadDataListHandle(context, params) {
53
+ return this._sendRequest(context, this.loadDataListItfUrl, this.loadDataListItfMethod, params);
54
+ }
55
+ async deleteHandle(context, params) {
56
+ return this._sendRequest(context, this.deleteItfUrl, this.deleteItfMethod, params);
57
+ }
58
+ async loadDataByRecIdHandle(context, params) {
59
+ return this._sendRequest(context, this.loadDataByRecIdItfUrl, this.loadDataByRecIdMethod, params);
60
+ }
61
+ async saveHandle(context, params) {
62
+ return this._sendRequest(context, this.saveItfUrl, this.saveItfMethod, params);
63
+ }
64
+ async updateHandle(context, params) {
65
+ return this._sendRequest(context, this.updateItfUrl, this.updateItfMethod, params);
66
+ }
67
+ async submitHandle(context, params) {
68
+ return (params == null ? void 0 : params[context.primaryKey]) ? this.updateHandle(context, params) : this.saveHandle(context, params);
69
+ }
70
+ }, _descriptor = _applyDecoratedDescriptor(_class.prototype, "httpRequest", [_dec], {
71
+ configurable: true,
72
+ enumerable: true,
73
+ writable: true,
74
+ initializer: function() {
75
+ return null;
76
+ }
77
+ }), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "appName", [_dec2], {
78
+ configurable: true,
79
+ enumerable: true,
80
+ writable: true,
81
+ initializer: function() {
82
+ return "";
83
+ }
84
+ }), _class);
85
+
86
+ export { DataModelAdapter as default };