@manycore/budget-plugin-api 0.0.1-alpha.1 → 0.0.1-alpha.10

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manycore/budget-plugin-api",
3
- "version": "0.0.1-alpha.1",
3
+ "version": "0.0.1-alpha.10",
4
4
  "title": "@manycore/budget-plugin-api",
5
5
  "description": "清单插件平台二开应用的API",
6
6
  "license": "MIT",
@@ -17,6 +17,12 @@ var __metadata = this && this.__metadata || function (k, v) {
17
17
  if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
18
18
  };
19
19
  import { anno, API_UNSUPPORT, ServService } from 'servkit';
20
+ // 是否系统字段
21
+ export var ESystematic;
22
+ (function (ESystematic) {
23
+ ESystematic[ESystematic["SYSTEMATIC"] = 0] = "SYSTEMATIC";
24
+ ESystematic[ESystematic["CUSTOM"] = 1] = "CUSTOM";
25
+ })(ESystematic || (ESystematic = {}));
20
26
  /**
21
27
  * 清单插件平台API,给插件提供读写清单数据的api
22
28
  */
@@ -29,6 +35,10 @@ var ListingService = /*#__PURE__*/function (_ServService) {
29
35
  return _createClass(ListingService, [{
30
36
  key: "getDetail",
31
37
  value:
38
+ /**
39
+ * 行选中变化事件 - 当用户选中或取消选中行时触发
40
+ */
41
+
32
42
  /**
33
43
  * 读清单数据
34
44
  */
@@ -67,13 +77,42 @@ var ListingService = /*#__PURE__*/function (_ServService) {
67
77
  value: function getCurrentListingId() {
68
78
  return API_UNSUPPORT();
69
79
  }
80
+ /**
81
+ * 更新项目信息
82
+ */
83
+ }, {
84
+ key: "updateProjectInfo",
85
+ value: function updateProjectInfo(params) {
86
+ return API_UNSUPPORT();
87
+ }
88
+ /**
89
+ * 行选中配置
90
+ */
91
+ }, {
92
+ key: "setRowSelection",
93
+ value: function setRowSelection(rowSelection) {
94
+ return API_UNSUPPORT();
95
+ }
96
+ /**
97
+ * 显示订单详情
98
+ */
99
+ }, {
100
+ key: "showOrderDetail",
101
+ value: function showOrderDetail(order, onClose) {
102
+ return API_UNSUPPORT();
103
+ }
70
104
  }]);
71
105
  }(ServService);
106
+ __decorate([anno.decl.event(), __metadata("design:type", Object)], ListingService.prototype, "syncDesignEvent", void 0);
107
+ __decorate([anno.decl.event(), __metadata("design:type", Object)], ListingService.prototype, "rowSelectChangeEvent", void 0);
72
108
  __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], ListingService.prototype, "getDetail", null);
73
109
  __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], ListingService.prototype, "updateCells", null);
74
110
  __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], ListingService.prototype, "lock", null);
75
111
  __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Object)], ListingService.prototype, "unlock", null);
76
112
  __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Object)], ListingService.prototype, "getCurrentListingId", null);
113
+ __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], ListingService.prototype, "updateProjectInfo", null);
114
+ __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], ListingService.prototype, "setRowSelection", null);
115
+ __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object, Function]), __metadata("design:returntype", Object)], ListingService.prototype, "showOrderDetail", null);
77
116
  ListingService = __decorate([anno.decl({
78
117
  id: 'sapp.listing.service',
79
118
  version: '1.0.0'
@@ -17,6 +17,12 @@ var __metadata = this && this.__metadata || function (k, v) {
17
17
  if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
18
18
  };
19
19
  import { anno, API_UNSUPPORT, ServService } from 'servkit';
20
+ export var SyncDesignStatus;
21
+ (function (SyncDesignStatus) {
22
+ SyncDesignStatus["success"] = "success";
23
+ SyncDesignStatus["error"] = "error";
24
+ SyncDesignStatus["loading"] = "loading";
25
+ })(SyncDesignStatus || (SyncDesignStatus = {}));
20
26
  var SappUiToastService = /*#__PURE__*/function (_ServService) {
21
27
  function SappUiToastService() {
22
28
  _classCallCheck(this, SappUiToastService);
@@ -69,6 +75,11 @@ var SappUiToastService = /*#__PURE__*/function (_ServService) {
69
75
  value: function loading(msg) {
70
76
  return API_UNSUPPORT();
71
77
  }
78
+ }, {
79
+ key: "setSyncDesignStatus",
80
+ value: function setSyncDesignStatus(status) {
81
+ return API_UNSUPPORT();
82
+ }
72
83
  }]);
73
84
  }(ServService);
74
85
  __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], SappUiToastService.prototype, "success", null);
@@ -76,6 +87,7 @@ __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("de
76
87
  __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], SappUiToastService.prototype, "info", null);
77
88
  __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], SappUiToastService.prototype, "warning", null);
78
89
  __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], SappUiToastService.prototype, "loading", null);
90
+ __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [String]), __metadata("design:returntype", Object)], SappUiToastService.prototype, "setSyncDesignStatus", null);
79
91
  SappUiToastService = __decorate([anno.decl({
80
92
  id: 's.app.ui.',
81
93
  version: '1.0.0'
@@ -1,9 +1,62 @@
1
1
  import { ServService } from 'servkit';
2
- import type { ServAPIRetn } from 'servkit';
2
+ import type { ServAPIRetn, ServEventer } from 'servkit';
3
+ export declare enum ESystematic {
4
+ SYSTEMATIC = 0,
5
+ CUSTOM = 1
6
+ }
7
+ export interface IProjectInfo {
8
+ /**
9
+ * 项目信息的唯一标识
10
+ */
11
+ obsId: string;
12
+ /**
13
+ * 清单ID
14
+ */
15
+ listingId: string;
16
+ /**
17
+ * 字段名
18
+ */
19
+ name: string;
20
+ /**
21
+ * 字段值
22
+ */
23
+ value: string;
24
+ /**
25
+ * 列结构, json字符串
26
+ */
27
+ struct?: string;
28
+ /**
29
+ * 1-文本
30
+ * 2-日期
31
+ * 3-单选
32
+ */
33
+ type: 1 | 2 | 3;
34
+ /**
35
+ * SYSTEMATIC-系统字段
36
+ * CUSTOM-自定义
37
+ */
38
+ systemic: ESystematic;
39
+ /**
40
+ * 顺序
41
+ */
42
+ order: number;
43
+ /**
44
+ * 创建时间
45
+ */
46
+ created: number;
47
+ /**
48
+ * 最后修改时间
49
+ */
50
+ lastmodified: number;
51
+ /**
52
+ * 可选,企业项目信息库配置
53
+ */
54
+ apiCode?: string;
55
+ }
3
56
  /**
4
57
  * 表格元信息
5
58
  */
6
- interface ISheet {
59
+ export interface ISheet {
7
60
  /**
8
61
  * 表名称
9
62
  */
@@ -12,7 +65,7 @@ interface ISheet {
12
65
  /**
13
66
  * 表格列信息
14
67
  */
15
- interface IColumn {
68
+ export interface IColumn {
16
69
  /**
17
70
  * 列ID,表内唯一
18
71
  */
@@ -33,7 +86,7 @@ interface IColumn {
33
86
  /**
34
87
  * 单元格错误信息
35
88
  */
36
- interface ICellError {
89
+ export interface ICellError {
37
90
  /**
38
91
  * 单元格错误信息
39
92
  */
@@ -42,7 +95,7 @@ interface ICellError {
42
95
  /**
43
96
  * 单元格基础信息
44
97
  */
45
- interface ICellBase {
98
+ export interface ICellBase {
46
99
  /**
47
100
  * 表ID
48
101
  */
@@ -63,7 +116,7 @@ interface ICellBase {
63
116
  /**
64
117
  * 单元格信息
65
118
  */
66
- interface ICell extends ICellBase {
119
+ export interface ICell extends ICellBase {
67
120
  /**
68
121
  * 子表也是一个独立的表格,表Id在清单范围内唯一
69
122
  */
@@ -76,7 +129,7 @@ interface ICell extends ICellBase {
76
129
  /**
77
130
  * 表格单行信息
78
131
  */
79
- interface IROW {
132
+ export interface IROW {
80
133
  /**
81
134
  * 行ID,表内唯一
82
135
  */
@@ -94,7 +147,6 @@ interface IROW {
94
147
  * columnId: 1,
95
148
  * rowId: 2,
96
149
  * value: 'abc'
97
- *
98
150
  * },
99
151
  * 12: {
100
152
  * tableId: 1,
@@ -110,7 +162,7 @@ interface IROW {
110
162
  /**
111
163
  * 单个表数据
112
164
  */
113
- interface ITable {
165
+ export interface ITable {
114
166
  /**
115
167
  * 表ID,清单内唯一
116
168
  */
@@ -131,7 +183,7 @@ interface ITable {
131
183
  /**
132
184
  * 清单元信息
133
185
  */
134
- interface IListingMeta {
186
+ export interface IListingMeta {
135
187
  /**
136
188
  * 清单的唯一标识
137
189
  */
@@ -144,6 +196,14 @@ interface IListingMeta {
144
196
  * 用户ID
145
197
  */
146
198
  userId: string;
199
+ /**
200
+ * 用户邮箱
201
+ */
202
+ email?: string;
203
+ /**
204
+ * 清单项目信息列表
205
+ */
206
+ projectInfos: Array<IProjectInfo>;
147
207
  }
148
208
  /**
149
209
  * 清单详情
@@ -190,10 +250,108 @@ export interface IListingLockParams {
190
250
  */
191
251
  message: string;
192
252
  }
253
+ /**
254
+ * 更新项目信息参数
255
+ */
256
+ export interface IProjectInfoUpdateParams {
257
+ /**
258
+ * 清单ID
259
+ */
260
+ listingId: string;
261
+ /**
262
+ * 清单项目信息列表
263
+ */
264
+ projectInfos: IProjectInfo[];
265
+ }
266
+ /**
267
+ * 表ID
268
+ */
269
+ export declare type SheetId = string | number;
270
+ /**
271
+ * 行ID
272
+ */
273
+ export declare type RowKey = string | number;
274
+ /**
275
+ * 指定的行,key为表id,value为选中行id数组
276
+ */
277
+ export interface SheetRowKeys {
278
+ [sheetId: SheetId]: RowKey[];
279
+ }
280
+ /**
281
+ * 行选中事件数据
282
+ */
283
+ export interface IRowSelectionEventData<D = any> {
284
+ /**
285
+ * 表ID
286
+ */
287
+ sheetId: SheetId;
288
+ /**
289
+ * 选中的行keys
290
+ */
291
+ selectedKeys: RowKey[];
292
+ }
293
+ /**
294
+ * 行选中变化事件数据
295
+ */
296
+ export interface IRowSelectionChangeEventData {
297
+ /**
298
+ * 所有表的选中状态
299
+ */
300
+ selectedRowKeys: SheetRowKeys;
301
+ }
302
+ export interface IRowSelection<D = any> {
303
+ /**
304
+ * 默认选中的行keys
305
+ */
306
+ selectedRowKeys: SheetRowKeys;
307
+ /**
308
+ * 禁用checkbox的行keys
309
+ */
310
+ disabledRowKeys?: SheetRowKeys;
311
+ }
312
+ export interface IOrder {
313
+ /**
314
+ * 订单obsId
315
+ */
316
+ obsId: string;
317
+ /**
318
+ * 订单所属清单ID
319
+ */
320
+ obsListingId: string;
321
+ /**
322
+ * 订单编号
323
+ */
324
+ customOrderId: string;
325
+ /**
326
+ * 订单备注
327
+ */
328
+ description: string;
329
+ /**
330
+ * 订单创建时间
331
+ */
332
+ created: number;
333
+ /**
334
+ * 订单详情ID
335
+ */
336
+ obsOrderDetailId: string;
337
+ /**
338
+ * 0-无效 1-有效 2-撤销
339
+ */
340
+ status: 0 | 1 | 2;
341
+ /**
342
+ * 最后更新时间
343
+ */
344
+ lastmodified?: number;
345
+ }
193
346
  /**
194
347
  * 清单插件平台API,给插件提供读写清单数据的api
195
348
  */
196
349
  export declare class ListingService extends ServService {
350
+ syncDesignEvent: ServEventer<void>;
351
+ /**
352
+ * 行选中变化事件 - 当用户选中或取消选中行时触发
353
+ */
354
+ rowSelectChangeEvent: ServEventer<SheetRowKeys>;
197
355
  /**
198
356
  * 读清单数据
199
357
  */
@@ -214,5 +372,16 @@ export declare class ListingService extends ServService {
214
372
  * 获取当前清单id
215
373
  */
216
374
  getCurrentListingId(): ServAPIRetn<string>;
375
+ /**
376
+ * 更新项目信息
377
+ */
378
+ updateProjectInfo(params: IProjectInfoUpdateParams): ServAPIRetn<void>;
379
+ /**
380
+ * 行选中配置
381
+ */
382
+ setRowSelection(rowSelection?: IRowSelection): ServAPIRetn<void>;
383
+ /**
384
+ * 显示订单详情
385
+ */
386
+ showOrderDetail(order: IOrder, onClose?: () => void): ServAPIRetn<void>;
217
387
  }
218
- export {};
@@ -1,5 +1,10 @@
1
1
  import { ServService } from 'servkit';
2
2
  import type { ServAPIRetn } from 'servkit';
3
+ export declare enum SyncDesignStatus {
4
+ success = "success",
5
+ error = "error",
6
+ loading = "loading"
7
+ }
3
8
  export interface IToastConfig {
4
9
  title: string;
5
10
  content: string;
@@ -30,4 +35,5 @@ export declare class SappUiToastService extends ServService {
30
35
  * @param msg 可以传字符串,也可以传 T
31
36
  */
32
37
  loading(msg: string | IToastConfig): ServAPIRetn<void>;
38
+ setSyncDesignStatus(status: SyncDesignStatus): ServAPIRetn<void>;
33
39
  }