@manycore/budget-plugin-api 0.0.1-alpha.6 → 0.0.1-alpha.9

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.6",
3
+ "version": "0.0.1-alpha.9",
4
4
  "title": "@manycore/budget-plugin-api",
5
5
  "description": "清单插件平台二开应用的API",
6
6
  "license": "MIT",
@@ -35,6 +35,11 @@ var ListingService = /*#__PURE__*/function (_ServService) {
35
35
  return _createClass(ListingService, [{
36
36
  key: "getDetail",
37
37
  value:
38
+ /**
39
+ * 行选中事件 - 当用户选中或取消选中行时触发
40
+ * 替代原 IRowSelection.onSelect 回调函数
41
+ */
42
+
38
43
  /**
39
44
  * 读清单数据
40
45
  */
@@ -81,15 +86,34 @@ var ListingService = /*#__PURE__*/function (_ServService) {
81
86
  value: function updateProjectInfo(params) {
82
87
  return API_UNSUPPORT();
83
88
  }
89
+ /**
90
+ * 行选中配置
91
+ */
92
+ }, {
93
+ key: "setRowSelection",
94
+ value: function setRowSelection(rowSelection) {
95
+ return API_UNSUPPORT();
96
+ }
97
+ /**
98
+ * 显示订单详情
99
+ */
100
+ }, {
101
+ key: "showOrderDetail",
102
+ value: function showOrderDetail(order, onClose) {
103
+ return API_UNSUPPORT();
104
+ }
84
105
  }]);
85
106
  }(ServService);
86
107
  __decorate([anno.decl.event(), __metadata("design:type", Object)], ListingService.prototype, "syncDesignEvent", void 0);
108
+ __decorate([anno.decl.event(), __metadata("design:type", Object)], ListingService.prototype, "rowSelectEvent", void 0);
87
109
  __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], ListingService.prototype, "getDetail", null);
88
110
  __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], ListingService.prototype, "updateCells", null);
89
111
  __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], ListingService.prototype, "lock", null);
90
112
  __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Object)], ListingService.prototype, "unlock", null);
91
113
  __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Object)], ListingService.prototype, "getCurrentListingId", null);
92
114
  __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], ListingService.prototype, "updateProjectInfo", null);
115
+ __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], ListingService.prototype, "setRowSelection", null);
116
+ __decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object, Function]), __metadata("design:returntype", Object)], ListingService.prototype, "showOrderDetail", null);
93
117
  ListingService = __decorate([anno.decl({
94
118
  id: 'sapp.listing.service',
95
119
  version: '1.0.0'
@@ -259,11 +259,90 @@ export interface IProjectInfoUpdateParams {
259
259
  */
260
260
  projectInfos: IProjectInfo[];
261
261
  }
262
+ /**
263
+ * 表ID
264
+ */
265
+ export declare type SheetId = string | number;
266
+ /**
267
+ * 行ID
268
+ */
269
+ export declare type RowKey = string | number;
270
+ /**
271
+ * 表格行选中项,key为表id,value为选中行id数组
272
+ */
273
+ export declare type SelectedRowKeys = Record<SheetId, RowKey[]>;
274
+ /**
275
+ * 行选中事件数据
276
+ */
277
+ export interface IRowSelectionEventData<D = any> {
278
+ /**
279
+ * 表ID
280
+ */
281
+ sheetId: SheetId;
282
+ /**
283
+ * 选中的行keys
284
+ */
285
+ selectedKeys: RowKey[];
286
+ }
287
+ /**
288
+ * 行选中变化事件数据
289
+ */
290
+ export interface IRowSelectionChangeEventData {
291
+ /**
292
+ * 所有表的选中状态
293
+ */
294
+ selectedRowKeys: SelectedRowKeys;
295
+ }
296
+ export interface IRowSelection<D = any> {
297
+ /**
298
+ * 默认选中的行keys
299
+ */
300
+ selectedRowKeys: SelectedRowKeys;
301
+ /**
302
+ * 禁用checkbox的行keys
303
+ */
304
+ disabledRowKeys?: SelectedRowKeys;
305
+ }
306
+ export interface IOrder {
307
+ /**
308
+ * 订单obsId
309
+ */
310
+ obsId: string;
311
+ /**
312
+ * 订单所属清单ID
313
+ */
314
+ obsListingId: string;
315
+ /**
316
+ * 订单编号
317
+ */
318
+ customOrderId: string;
319
+ /**
320
+ * 订单备注
321
+ */
322
+ description: string;
323
+ /**
324
+ * 订单创建时间
325
+ */
326
+ created: number;
327
+ /**
328
+ * 订单详情ID
329
+ */
330
+ obsOrderDetailId: string;
331
+ /**
332
+ * 0-无效 1-有效 2-撤销
333
+ */
334
+ status: 0 | 1 | 2;
335
+ }
262
336
  /**
263
337
  * 清单插件平台API,给插件提供读写清单数据的api
264
338
  */
265
339
  export declare class ListingService extends ServService {
266
340
  syncDesignEvent: ServEventer<void>;
341
+ /**
342
+ * 行选中事件 - 当用户选中或取消选中行时触发
343
+ * 替代原 IRowSelection.onSelect 回调函数
344
+ */
345
+ rowSelectEvent: ServEventer<IRowSelectionEventData>;
267
346
  /**
268
347
  * 读清单数据
269
348
  */
@@ -288,4 +367,12 @@ export declare class ListingService extends ServService {
288
367
  * 更新项目信息
289
368
  */
290
369
  updateProjectInfo(params: IProjectInfoUpdateParams): ServAPIRetn<void>;
370
+ /**
371
+ * 行选中配置
372
+ */
373
+ setRowSelection(rowSelection?: IRowSelection): ServAPIRetn<void>;
374
+ /**
375
+ * 显示订单详情
376
+ */
377
+ showOrderDetail(order: IOrder, onClose?: () => void): ServAPIRetn<void>;
291
378
  }