@zhubangyun/lowcode-core 5.3.132 → 5.3.181

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/components/schema-render/components/schema-render-base.js +1 -1
  2. package/es/index.d.ts +2 -3
  3. package/es/index.js +2 -3
  4. package/es/utils/{common → api}/RestApi.d.ts +10 -8
  5. package/es/utils/{common → api}/RestApi.js +142 -85
  6. package/es/utils/api/index.d.ts +2 -0
  7. package/es/utils/api/index.js +49 -2
  8. package/es/utils/cache/index.d.ts +9 -0
  9. package/es/utils/cache/index.js +75 -0
  10. package/es/utils/common/SingletonInstanceMap.d.ts +7 -0
  11. package/es/utils/common/SingletonInstanceMap.js +73 -0
  12. package/es/utils/common/index.d.ts +0 -2
  13. package/es/utils/common/index.js +1 -30
  14. package/es/utils/{common/RestFormApi.d.ts → form/form.api.d.ts} +9 -4
  15. package/es/utils/{common/RestFormApi.js → form/form.api.js} +85 -36
  16. package/es/utils/form/form.handler.js +0 -0
  17. package/es/utils/form/form.instance.d.ts +26 -0
  18. package/es/utils/form/form.instance.js +100 -0
  19. package/es/utils/form/form.process.js +0 -0
  20. package/es/utils/index.d.ts +2 -0
  21. package/es/utils/index.js +2 -0
  22. package/lib/components/schema-render/components/schema-render-base.js +1 -1
  23. package/lib/index.d.ts +2 -3
  24. package/lib/index.js +4 -6
  25. package/lib/utils/{common → api}/RestApi.d.ts +10 -8
  26. package/lib/utils/{common → api}/RestApi.js +142 -85
  27. package/lib/utils/api/index.d.ts +2 -0
  28. package/lib/utils/api/index.js +51 -2
  29. package/lib/utils/cache/index.d.ts +9 -0
  30. package/lib/utils/cache/index.js +80 -0
  31. package/lib/utils/common/SingletonInstanceMap.d.ts +7 -0
  32. package/lib/utils/common/SingletonInstanceMap.js +78 -0
  33. package/lib/utils/common/index.d.ts +0 -2
  34. package/lib/utils/common/index.js +2 -32
  35. package/lib/utils/{common/RestFormApi.d.ts → form/form.api.d.ts} +9 -4
  36. package/lib/utils/{common/RestFormApi.js → form/form.api.js} +85 -36
  37. package/lib/utils/form/form.handler.js +1 -0
  38. package/lib/utils/form/form.instance.d.ts +26 -0
  39. package/lib/utils/form/form.instance.js +105 -0
  40. package/lib/utils/form/form.process.js +1 -0
  41. package/lib/utils/index.d.ts +2 -0
  42. package/lib/utils/index.js +2 -0
  43. package/package.json +1 -1
  44. package/es/utils/common/ClientCache.d.ts +0 -36
  45. package/es/utils/common/ClientCache.js +0 -120
  46. package/lib/utils/common/ClientCache.d.ts +0 -36
  47. package/lib/utils/common/ClientCache.js +0 -125
  48. /package/es/utils/{common → api}/Request.d.ts +0 -0
  49. /package/es/utils/{common → api}/Request.js +0 -0
  50. /package/lib/utils/{common → api}/Request.d.ts +0 -0
  51. /package/lib/utils/{common → api}/Request.js +0 -0
@@ -1,36 +1,7 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
- import _regeneratorRuntime from "@babel/runtime/regenerator";
3
1
  import { v4 } from "uuid";
4
- import { ClientCache } from "./ClientCache";
5
- import { request } from "../api";
6
2
  export { loadPlugins } from "./LoadPlugins";
7
3
  export function uuid(prefix, separator) {
8
4
  return [prefix, separator, v4()].filter(function (v) {
9
5
  return !!v;
10
6
  }).join("");
11
- }
12
- export var schemaCache = new ClientCache({
13
- name: "schema",
14
- loadData: function () {
15
- var _loadData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(name) {
16
- var res;
17
- return _regeneratorRuntime.wrap(function _callee$(_context) {
18
- while (1) switch (_context.prev = _context.next) {
19
- case 0:
20
- _context.next = 2;
21
- return request.get("schemas/" + name + ".json");
22
- case 2:
23
- res = _context.sent;
24
- return _context.abrupt("return", res.data);
25
- case 4:
26
- case "end":
27
- return _context.stop();
28
- }
29
- }, _callee);
30
- }));
31
- function loadData(_x) {
32
- return _loadData.apply(this, arguments);
33
- }
34
- return loadData;
35
- }()
36
- });
7
+ }
@@ -1,12 +1,17 @@
1
- import { BaseRequestOptions, RestApi, RestApiOptions } from "./RestApi";
1
+ import { BaseRequestOptions, RestApi } from "../api/RestApi";
2
+ import { AxiosRequestConfig } from "axios";
2
3
  export declare class RestFormApi<DataType> extends RestApi<DataType> {
4
+ private readonly formId;
5
+ private readonly mock;
3
6
  private initialized;
4
7
  private schema;
5
- constructor(formName: string, options: RestApiOptions);
6
- initialize(): Promise<true>;
7
- search(params?: Record<string, any>, page?: number, pageSize?: number): Promise<any>;
8
+ constructor(formId: string, mock?: boolean);
9
+ initialize(): Promise<boolean>;
10
+ search(params?: Record<string, any>, page?: number, pageSize?: number): Promise<import("../api/RestApi").ManyResult<DataType>>;
8
11
  getById(id: string, options?: BaseRequestOptions<DataType>): Promise<any>;
12
+ save(data: DataType, options?: BaseRequestOptions<DataType>): Promise<any>;
9
13
  create(data: DataType, options?: BaseRequestOptions<DataType>): Promise<any>;
10
14
  update(id: string, data: DataType, options?: BaseRequestOptions<DataType>): Promise<any>;
11
15
  deleteById(id: string, options?: BaseRequestOptions<DataType>): Promise<any>;
16
+ handleRequestConfig(config: AxiosRequestConfig): void;
12
17
  }
@@ -1,13 +1,18 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
- import { RestApi } from "./RestApi";
4
+ import { RestApi } from "../api/RestApi";
5
+ import { getSchema } from "../api";
5
6
  export var RestFormApi = /*#__PURE__*/function (_RestApi) {
6
- function RestFormApi(formName, options) {
7
+ function RestFormApi(formId, mock) {
7
8
  var _this;
8
- _this = _RestApi.call(this, "forms/" + formName, options) || this;
9
+ _this = _RestApi.call(this, "forms", {}) || this;
10
+ _this.formId = void 0;
11
+ _this.mock = void 0;
9
12
  _this.initialized = false;
10
13
  _this.schema = void 0;
14
+ _this.formId = formId;
15
+ _this.mock = !!mock;
11
16
  return _this;
12
17
  }
13
18
  _inheritsLoose(RestFormApi, _RestApi);
@@ -17,28 +22,35 @@ export var RestFormApi = /*#__PURE__*/function (_RestApi) {
17
22
  return _regeneratorRuntime.wrap(function _callee$(_context) {
18
23
  while (1) switch (_context.prev = _context.next) {
19
24
  case 0:
20
- if (this.initialized) {
21
- _context.next = 8;
25
+ if (!this.initialized) {
26
+ _context.next = 4;
22
27
  break;
23
28
  }
24
- _context.prev = 1;
25
- //this.schema = await schemaCache.get(super.uri)
26
- /* this.schema = await PageUtils.schemaCache.lazyGet(this.title);
27
- this.handler = new FormDataHandler(this.schema);*/
28
- this.initialized = true;
29
- _context.next = 8;
29
+ return _context.abrupt("return", true);
30
+ case 4:
31
+ _context.prev = 4;
32
+ _context.next = 7;
33
+ return getSchema(this.formId, this.mock);
34
+ case 7:
35
+ this.schema = _context.sent;
36
+ this.initialized = !!this.schema;
37
+ _context.next = 15;
30
38
  break;
31
- case 5:
32
- _context.prev = 5;
33
- _context.t0 = _context["catch"](1);
39
+ case 11:
40
+ _context.prev = 11;
41
+ _context.t0 = _context["catch"](4);
42
+ console.log("获取schema失败!", {
43
+ id: this.formId,
44
+ mock: this.mock
45
+ });
34
46
  throw _context.t0;
35
- case 8:
47
+ case 15:
36
48
  return _context.abrupt("return", this.initialized);
37
- case 9:
49
+ case 16:
38
50
  case "end":
39
51
  return _context.stop();
40
52
  }
41
- }, _callee, this, [[1, 5]]);
53
+ }, _callee, this, [[4, 11]]);
42
54
  }));
43
55
  function initialize() {
44
56
  return _initialize.apply(this, arguments);
@@ -94,65 +106,102 @@ export var RestFormApi = /*#__PURE__*/function (_RestApi) {
94
106
  }
95
107
  return getById;
96
108
  }();
97
- _proto.create = /*#__PURE__*/function () {
98
- var _create = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(data, options) {
109
+ _proto.save = /*#__PURE__*/function () {
110
+ var _save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(data, options) {
111
+ var config;
99
112
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
100
113
  while (1) switch (_context4.prev = _context4.next) {
101
114
  case 0:
102
115
  _context4.next = 2;
103
116
  return this.initialize();
104
117
  case 2:
105
- return _context4.abrupt("return", _RestApi.prototype.create.call(this, data, options));
106
- case 3:
118
+ config = {};
119
+ this.handleRequestConfig(config);
120
+ return _context4.abrupt("return", _RestApi.prototype.save.call(this, data, options));
121
+ case 5:
107
122
  case "end":
108
123
  return _context4.stop();
109
124
  }
110
125
  }, _callee4, this);
111
126
  }));
112
- function create(_x6, _x7) {
113
- return _create.apply(this, arguments);
127
+ function save(_x6, _x7) {
128
+ return _save.apply(this, arguments);
114
129
  }
115
- return create;
130
+ return save;
116
131
  }();
117
- _proto.update = /*#__PURE__*/function () {
118
- var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(id, data, options) {
132
+ _proto.create = /*#__PURE__*/function () {
133
+ var _create = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(data, options) {
134
+ var config;
119
135
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
120
136
  while (1) switch (_context5.prev = _context5.next) {
121
137
  case 0:
122
138
  _context5.next = 2;
123
139
  return this.initialize();
124
140
  case 2:
125
- return _context5.abrupt("return", _RestApi.prototype.update.call(this, id, data, options));
126
- case 3:
141
+ config = {};
142
+ this.handleRequestConfig(config);
143
+ return _context5.abrupt("return", _RestApi.prototype.create.call(this, data, options));
144
+ case 5:
127
145
  case "end":
128
146
  return _context5.stop();
129
147
  }
130
148
  }, _callee5, this);
131
149
  }));
132
- function update(_x8, _x9, _x10) {
133
- return _update.apply(this, arguments);
150
+ function create(_x8, _x9) {
151
+ return _create.apply(this, arguments);
134
152
  }
135
- return update;
153
+ return create;
136
154
  }();
137
- _proto.deleteById = /*#__PURE__*/function () {
138
- var _deleteById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id, options) {
155
+ _proto.update = /*#__PURE__*/function () {
156
+ var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id, data, options) {
157
+ var config;
139
158
  return _regeneratorRuntime.wrap(function _callee6$(_context6) {
140
159
  while (1) switch (_context6.prev = _context6.next) {
141
160
  case 0:
142
161
  _context6.next = 2;
143
162
  return this.initialize();
144
163
  case 2:
145
- return _context6.abrupt("return", _RestApi.prototype.deleteById.call(this, id, options));
146
- case 3:
164
+ config = {};
165
+ this.handleRequestConfig(config);
166
+ return _context6.abrupt("return", _RestApi.prototype.update.call(this, id, data, options));
167
+ case 5:
147
168
  case "end":
148
169
  return _context6.stop();
149
170
  }
150
171
  }, _callee6, this);
151
172
  }));
152
- function deleteById(_x11, _x12) {
173
+ function update(_x10, _x11, _x12) {
174
+ return _update.apply(this, arguments);
175
+ }
176
+ return update;
177
+ }();
178
+ _proto.deleteById = /*#__PURE__*/function () {
179
+ var _deleteById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id, options) {
180
+ var config;
181
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
182
+ while (1) switch (_context7.prev = _context7.next) {
183
+ case 0:
184
+ _context7.next = 2;
185
+ return this.initialize();
186
+ case 2:
187
+ config = {};
188
+ this.handleRequestConfig(config);
189
+ return _context7.abrupt("return", _RestApi.prototype.deleteById.call(this, id, options));
190
+ case 5:
191
+ case "end":
192
+ return _context7.stop();
193
+ }
194
+ }, _callee7, this);
195
+ }));
196
+ function deleteById(_x13, _x14) {
153
197
  return _deleteById.apply(this, arguments);
154
198
  }
155
199
  return deleteById;
156
200
  }();
201
+ _proto.handleRequestConfig = function handleRequestConfig(config) {
202
+ config.params = config.params || {};
203
+ config.params.formId = this.formId;
204
+ config.params.mock = this.mock;
205
+ };
157
206
  return RestFormApi;
158
207
  }(RestApi);
File without changes
@@ -0,0 +1,26 @@
1
+ import { FormInstance } from "antd/lib";
2
+ import { NamePath, StoreValue } from "antd/es/form/interface";
3
+ declare type NamePaths = (string | number)[];
4
+ export declare class SubFormInstance implements FormInstance {
5
+ parentForm: FormInstance;
6
+ namePath: NamePaths;
7
+ constructor(form: FormInstance, namePath: NamePaths);
8
+ overwritePathName(name: NamePath): any[];
9
+ overwriteFields(fields: any[]): any[];
10
+ getFieldError(name: NamePath): string[];
11
+ getFieldValue(name: NamePath): StoreValue;
12
+ getFieldWarning(name: NamePath): string[];
13
+ getFieldsError(nameList: NamePath[] | undefined): any[];
14
+ getFieldsValue(nameList?: NamePath[] | true, filterFunc?: (meta: any) => boolean): any;
15
+ isFieldTouched(name: NamePath): boolean;
16
+ isFieldValidating(name: NamePath): boolean;
17
+ isFieldsTouched(): boolean;
18
+ isFieldsValidating(nameList: NamePath[]): boolean;
19
+ resetFields(fields: NamePath[] | undefined): void;
20
+ setFieldValue(name: NamePath, value: any): void;
21
+ setFields(fields: any[]): void;
22
+ setFieldsValue(values: any): void;
23
+ submit(): void;
24
+ validateFields(nameList: NamePath[] | undefined): Promise<any>;
25
+ }
26
+ export {};
@@ -0,0 +1,100 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ export var SubFormInstance = /*#__PURE__*/function () {
3
+ function SubFormInstance(form, namePath) {
4
+ this.parentForm = void 0;
5
+ this.namePath = void 0;
6
+ this.parentForm = form;
7
+ this.namePath = namePath;
8
+ }
9
+ var _proto = SubFormInstance.prototype;
10
+ _proto.overwritePathName = function overwritePathName(name) {
11
+ if (Array.isArray(name)) {
12
+ return [].concat(this.namePath, name);
13
+ } else {
14
+ return [].concat(this.namePath, [name]);
15
+ }
16
+ };
17
+ _proto.overwriteFields = function overwriteFields(fields) {
18
+ var _this = this;
19
+ return fields === null || fields === void 0 ? void 0 : fields.map(function (field) {
20
+ return _extends({}, field, {
21
+ name: _this.overwritePathName(field.name)
22
+ });
23
+ });
24
+ };
25
+ _proto.getFieldError = function getFieldError(name) {
26
+ return this.parentForm.getFieldError(this.overwritePathName(name));
27
+ };
28
+ _proto.getFieldValue = function getFieldValue(name) {
29
+ return this.parentForm.getFieldValue(this.overwritePathName(name));
30
+ };
31
+ _proto.getFieldWarning = function getFieldWarning(name) {
32
+ return this.parentForm.getFieldWarning(this.overwritePathName(name));
33
+ }
34
+
35
+ // @ts-ignore
36
+ ;
37
+ _proto.getFieldsError = function getFieldsError(nameList) {
38
+ var _this2 = this;
39
+ return this.parentForm.getFieldsError(nameList === null || nameList === void 0 ? void 0 : nameList.map(function (name) {
40
+ return _this2.overwritePathName(name);
41
+ }));
42
+ }
43
+
44
+ // @ts-ignore
45
+ ;
46
+ _proto.getFieldsValue = function getFieldsValue(nameList, filterFunc) {
47
+ var values = _extends({}, this.parentForm.getFieldValue(this.namePath));
48
+ values.parent = this.parentForm.getFieldsValue(true);
49
+ return values;
50
+ };
51
+ _proto.isFieldTouched = function isFieldTouched(name) {
52
+ return this.parentForm.isFieldTouched(this.overwritePathName(name));
53
+ };
54
+ _proto.isFieldValidating = function isFieldValidating(name) {
55
+ return this.parentForm.isFieldValidating(this.overwritePathName(name));
56
+ };
57
+ _proto.isFieldsTouched = function isFieldsTouched() {
58
+ return this.parentForm.isFieldsTouched();
59
+ };
60
+ // @ts-ignore
61
+ _proto.isFieldsValidating = function isFieldsValidating(nameList) {
62
+ var _this3 = this;
63
+ return this.parentForm.isFieldsValidating(nameList.map(function (name) {
64
+ return _this3.overwritePathName(name);
65
+ }));
66
+ };
67
+ _proto.resetFields = function resetFields(fields) {
68
+ if (Array.isArray(fields)) {
69
+ // @ts-ignore
70
+ this.parentForm.resetFields(this.overwriteFields(fields));
71
+ } else {
72
+ this.parentForm.resetFields();
73
+ }
74
+ };
75
+ _proto.setFieldValue = function setFieldValue(name, value) {
76
+ return this.parentForm.setFieldValue(this.overwritePathName(name), value);
77
+ };
78
+ _proto.setFields = function setFields(fields) {
79
+ this.parentForm.setFields(this.overwriteFields(fields));
80
+ };
81
+ _proto.setFieldsValue = function setFieldsValue(values) {
82
+ var _this4 = this;
83
+ if (!values) return;
84
+ //删除父值
85
+ delete values.parent;
86
+ Object.keys(values).forEach(function (name) {
87
+ return _this4.parentForm.setFieldValue(_this4.overwritePathName(name), values[name]);
88
+ });
89
+ };
90
+ _proto.submit = function submit() {
91
+ this.parentForm.submit();
92
+ }
93
+
94
+ // @ts-ignore
95
+ ;
96
+ _proto.validateFields = function validateFields(nameList) {
97
+ return this.parentForm.validateFields(nameList);
98
+ };
99
+ return SubFormInstance;
100
+ }();
File without changes
@@ -1,8 +1,10 @@
1
+ import * as cache from "./cache";
1
2
  import * as common from "./common";
2
3
  import * as api from "./api";
3
4
  import * as designer from "./designer";
4
5
  declare const _default: {
5
6
  api: typeof api;
7
+ cache: typeof cache;
6
8
  designer: typeof designer;
7
9
  common: typeof common;
8
10
  };
package/es/utils/index.js CHANGED
@@ -1,8 +1,10 @@
1
+ import * as cache from "./cache";
1
2
  import * as common from "./common";
2
3
  import * as api from "./api";
3
4
  import * as designer from "./designer";
4
5
  export default {
5
6
  api: api,
7
+ cache: cache,
6
8
  designer: designer,
7
9
  common: common
8
10
  };
@@ -49,7 +49,7 @@ var SchemaRenderBase = exports.SchemaRenderBase = /*#__PURE__*/function (_Compon
49
49
  return _context.abrupt("return");
50
50
  case 6:
51
51
  _context.next = 8;
52
- return _utils["default"].common.schemaCache.get(schemaId);
52
+ return _utils["default"].request.getSchema(schemaId);
53
53
  case 8:
54
54
  schema = _context.sent;
55
55
  _this.setState({
package/lib/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import utils from "./utils";
2
- export { RestApi } from "./utils/common/RestApi";
3
- export { RestFormApi } from "./utils/common/RestFormApi";
4
- export { ClientCache } from "./utils/common/ClientCache";
2
+ export { RestApi } from "./utils/api/RestApi";
3
+ export { RestFormApi } from "./utils/form/form.api";
5
4
  export { Layout } from "./components/layout";
6
5
  export { SchemaRender } from "./components/schema-render";
7
6
  export { ReactRender } from "./components/react-render";
package/lib/index.js CHANGED
@@ -2,15 +2,13 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
  exports.__esModule = true;
5
- exports.SchemaRender = exports.RestFormApi = exports.RestApi = exports.ReactRender = exports.Layout = exports.ClientCache = void 0;
5
+ exports.SchemaRender = exports.RestFormApi = exports.RestApi = exports.ReactRender = exports.Layout = void 0;
6
6
  var _utils = _interopRequireDefault(require("./utils"));
7
7
  exports.utils = _utils["default"];
8
- var _RestApi = require("./utils/common/RestApi");
8
+ var _RestApi = require("./utils/api/RestApi");
9
9
  exports.RestApi = _RestApi.RestApi;
10
- var _RestFormApi = require("./utils/common/RestFormApi");
11
- exports.RestFormApi = _RestFormApi.RestFormApi;
12
- var _ClientCache = require("./utils/common/ClientCache");
13
- exports.ClientCache = _ClientCache.ClientCache;
10
+ var _form = require("./utils/form/form.api");
11
+ exports.RestFormApi = _form.RestFormApi;
14
12
  var _layout = require("./components/layout");
15
13
  exports.Layout = _layout.Layout;
16
14
  var _schemaRender = require("./components/schema-render");
@@ -1,4 +1,4 @@
1
- import { AxiosInstance } from "axios";
1
+ import { AxiosInstance, AxiosRequestConfig } from "axios";
2
2
  export interface RestApiOptions {
3
3
  /**
4
4
  * 超时时间
@@ -9,31 +9,33 @@ export interface RestApiOptions {
9
9
  */
10
10
  title?: string;
11
11
  }
12
- export declare class RestApi<DataType> {
12
+ export declare abstract class RestApi<DataType> {
13
13
  uri: string;
14
14
  title: string;
15
15
  request: AxiosInstance;
16
- constructor(uri: string, options?: RestApiOptions);
16
+ protected constructor(uri: string, options?: RestApiOptions);
17
+ abstract handleRequestConfig(config: AxiosRequestConfig): void;
17
18
  search(params?: Record<string, any>, page?: number, pageSize?: number): Promise<ManyResult<DataType>>;
18
19
  /**
19
20
  * 通过id获取
20
21
  * @param id
21
22
  * @param options
22
23
  */
23
- getById(id: string, options?: BaseRequestOptions<DataType>): Promise<DataType & BaseType>;
24
+ getById(id: string, options?: BaseRequestOptions<DataType>): Promise<OneResult<DataType>>;
25
+ save(data: DataType, options?: BaseRequestOptions<DataType>): Promise<OneResult<DataType>>;
24
26
  /**
25
27
  * 创建
26
28
  */
27
- create(data: DataType, options?: BaseRequestOptions<DataType>): Promise<DataType & BaseType>;
29
+ create(data: DataType, options?: BaseRequestOptions<DataType>): Promise<OneResult<DataType>>;
28
30
  /**
29
31
  * 更新
30
32
  */
31
- update(id: string, data: DataType, options?: BaseRequestOptions<DataType>): Promise<DataType & BaseType>;
33
+ update(id: string, data: DataType, options?: BaseRequestOptions<DataType>): Promise<OneResult<DataType>>;
32
34
  /**
33
35
  * 通过id删除
34
36
  */
35
- deleteById(id: string, options?: BaseRequestOptions<DataType>): Promise<boolean>;
36
- showError(type?: string, msg?: string): Promise<void>;
37
+ deleteById(id: string, options?: BaseRequestOptions<DataType>): Promise<OneResult<DataType>>;
38
+ private showError;
37
39
  }
38
40
  export interface BaseType {
39
41
  /**