@manycore/budget-plugin-api 0.0.1-alpha.1
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/index.js +1 -0
- package/package.json +21 -0
- package/src/decl/index.js +4 -0
- package/src/decl/listing.service.js +81 -0
- package/src/decl/sapp.dev.service.js +51 -0
- package/src/decl/sapp.service.js +44 -0
- package/src/decl/sapp.ui.toast.service.js +83 -0
- package/src/index.js +1 -0
- package/types/decl/index.d.ts +4 -0
- package/types/decl/listing.service.d.ts +218 -0
- package/types/decl/sapp.dev.service.d.ts +26 -0
- package/types/decl/sapp.service.d.ts +6 -0
- package/types/decl/sapp.ui.toast.service.d.ts +33 -0
- package/types/index.d.ts +1 -0
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@manycore/budget-plugin-api",
|
|
3
|
+
"version": "0.0.1-alpha.1",
|
|
4
|
+
"title": "@manycore/budget-plugin-api",
|
|
5
|
+
"description": "清单插件平台二开应用的API",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "./index.js",
|
|
8
|
+
"module": "./index.js",
|
|
9
|
+
"typings": "types/index.d.ts",
|
|
10
|
+
"peerDependencies": {
|
|
11
|
+
"servkit": "1.0.15"
|
|
12
|
+
},
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=10.0.0"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"prepare": "kjl link-cloud-packages",
|
|
18
|
+
"dev": "kjl baozheng:dev",
|
|
19
|
+
"build": "kjl baozheng:build"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
+
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
|
|
10
|
+
var c = arguments.length,
|
|
11
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
12
|
+
d;
|
|
13
|
+
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
|
+
};
|
|
16
|
+
var __metadata = this && this.__metadata || function (k, v) {
|
|
17
|
+
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
18
|
+
};
|
|
19
|
+
import { anno, API_UNSUPPORT, ServService } from 'servkit';
|
|
20
|
+
/**
|
|
21
|
+
* 清单插件平台API,给插件提供读写清单数据的api
|
|
22
|
+
*/
|
|
23
|
+
var ListingService = /*#__PURE__*/function (_ServService) {
|
|
24
|
+
function ListingService() {
|
|
25
|
+
_classCallCheck(this, ListingService);
|
|
26
|
+
return _callSuper(this, ListingService, arguments);
|
|
27
|
+
}
|
|
28
|
+
_inherits(ListingService, _ServService);
|
|
29
|
+
return _createClass(ListingService, [{
|
|
30
|
+
key: "getDetail",
|
|
31
|
+
value:
|
|
32
|
+
/**
|
|
33
|
+
* 读清单数据
|
|
34
|
+
*/
|
|
35
|
+
function getDetail(params) {
|
|
36
|
+
return API_UNSUPPORT();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 批量更新单元格值
|
|
40
|
+
*/
|
|
41
|
+
}, {
|
|
42
|
+
key: "updateCells",
|
|
43
|
+
value: function updateCells(params) {
|
|
44
|
+
return API_UNSUPPORT();
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 锁定清单
|
|
48
|
+
*/
|
|
49
|
+
}, {
|
|
50
|
+
key: "lock",
|
|
51
|
+
value: function lock(params) {
|
|
52
|
+
return API_UNSUPPORT();
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 解除锁定
|
|
56
|
+
*/
|
|
57
|
+
}, {
|
|
58
|
+
key: "unlock",
|
|
59
|
+
value: function unlock() {
|
|
60
|
+
return API_UNSUPPORT();
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* 获取当前清单id
|
|
64
|
+
*/
|
|
65
|
+
}, {
|
|
66
|
+
key: "getCurrentListingId",
|
|
67
|
+
value: function getCurrentListingId() {
|
|
68
|
+
return API_UNSUPPORT();
|
|
69
|
+
}
|
|
70
|
+
}]);
|
|
71
|
+
}(ServService);
|
|
72
|
+
__decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], ListingService.prototype, "getDetail", null);
|
|
73
|
+
__decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], ListingService.prototype, "updateCells", null);
|
|
74
|
+
__decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], ListingService.prototype, "lock", null);
|
|
75
|
+
__decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Object)], ListingService.prototype, "unlock", null);
|
|
76
|
+
__decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Object)], ListingService.prototype, "getCurrentListingId", null);
|
|
77
|
+
ListingService = __decorate([anno.decl({
|
|
78
|
+
id: 'sapp.listing.service',
|
|
79
|
+
version: '1.0.0'
|
|
80
|
+
})], ListingService);
|
|
81
|
+
export { ListingService };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
+
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
|
|
10
|
+
var c = arguments.length,
|
|
11
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
12
|
+
d;
|
|
13
|
+
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
|
+
};
|
|
16
|
+
var __metadata = this && this.__metadata || function (k, v) {
|
|
17
|
+
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
18
|
+
};
|
|
19
|
+
import { anno, API_UNSUPPORT, ServService } from 'servkit';
|
|
20
|
+
var SappDevService = /*#__PURE__*/function (_ServService) {
|
|
21
|
+
function SappDevService() {
|
|
22
|
+
_classCallCheck(this, SappDevService);
|
|
23
|
+
return _callSuper(this, SappDevService, arguments);
|
|
24
|
+
}
|
|
25
|
+
_inherits(SappDevService, _ServService);
|
|
26
|
+
return _createClass(SappDevService, [{
|
|
27
|
+
key: "start",
|
|
28
|
+
value:
|
|
29
|
+
/**
|
|
30
|
+
* 启动某个小程序
|
|
31
|
+
*/
|
|
32
|
+
function start(sapp) {
|
|
33
|
+
return API_UNSUPPORT();
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* stop 停止某个小程序
|
|
37
|
+
*/
|
|
38
|
+
}, {
|
|
39
|
+
key: "stop",
|
|
40
|
+
value: function stop(sapp) {
|
|
41
|
+
return API_UNSUPPORT();
|
|
42
|
+
}
|
|
43
|
+
}]);
|
|
44
|
+
}(ServService);
|
|
45
|
+
__decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], SappDevService.prototype, "start", null);
|
|
46
|
+
__decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], SappDevService.prototype, "stop", null);
|
|
47
|
+
SappDevService = __decorate([anno.decl({
|
|
48
|
+
id: 'mini.dev.budget.',
|
|
49
|
+
version: '1.0.0'
|
|
50
|
+
})], SappDevService);
|
|
51
|
+
export { SappDevService };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
+
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
|
|
10
|
+
var c = arguments.length,
|
|
11
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
12
|
+
d;
|
|
13
|
+
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
|
+
};
|
|
16
|
+
var __metadata = this && this.__metadata || function (k, v) {
|
|
17
|
+
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
18
|
+
};
|
|
19
|
+
import { anno, API_UNSUPPORT, ServService } from 'servkit';
|
|
20
|
+
var SappService = /*#__PURE__*/function (_ServService) {
|
|
21
|
+
function SappService() {
|
|
22
|
+
_classCallCheck(this, SappService);
|
|
23
|
+
return _callSuper(this, SappService, arguments);
|
|
24
|
+
}
|
|
25
|
+
_inherits(SappService, _ServService);
|
|
26
|
+
return _createClass(SappService, [{
|
|
27
|
+
key: "show",
|
|
28
|
+
value: function show() {
|
|
29
|
+
return API_UNSUPPORT();
|
|
30
|
+
}
|
|
31
|
+
}, {
|
|
32
|
+
key: "hide",
|
|
33
|
+
value: function hide() {
|
|
34
|
+
return API_UNSUPPORT();
|
|
35
|
+
}
|
|
36
|
+
}]);
|
|
37
|
+
}(ServService);
|
|
38
|
+
__decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Object)], SappService.prototype, "show", null);
|
|
39
|
+
__decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Object)], SappService.prototype, "hide", null);
|
|
40
|
+
SappService = __decorate([anno.decl({
|
|
41
|
+
id: 'mini.app.budget.',
|
|
42
|
+
version: '1.0.0'
|
|
43
|
+
})], SappService);
|
|
44
|
+
export { SappService };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
+
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
|
|
10
|
+
var c = arguments.length,
|
|
11
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
12
|
+
d;
|
|
13
|
+
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
|
+
};
|
|
16
|
+
var __metadata = this && this.__metadata || function (k, v) {
|
|
17
|
+
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
18
|
+
};
|
|
19
|
+
import { anno, API_UNSUPPORT, ServService } from 'servkit';
|
|
20
|
+
var SappUiToastService = /*#__PURE__*/function (_ServService) {
|
|
21
|
+
function SappUiToastService() {
|
|
22
|
+
_classCallCheck(this, SappUiToastService);
|
|
23
|
+
return _callSuper(this, SappUiToastService, arguments);
|
|
24
|
+
}
|
|
25
|
+
_inherits(SappUiToastService, _ServService);
|
|
26
|
+
return _createClass(SappUiToastService, [{
|
|
27
|
+
key: "success",
|
|
28
|
+
value:
|
|
29
|
+
/**
|
|
30
|
+
* 成功的提示
|
|
31
|
+
* @param msg 可以传字符串,也可以传 T
|
|
32
|
+
*/
|
|
33
|
+
function success(msg) {
|
|
34
|
+
return API_UNSUPPORT();
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 出错的提示
|
|
38
|
+
* @param msg 可以传字符串,也可以传 T
|
|
39
|
+
*/
|
|
40
|
+
}, {
|
|
41
|
+
key: "error",
|
|
42
|
+
value: function error(msg) {
|
|
43
|
+
return API_UNSUPPORT();
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 一般的提示
|
|
47
|
+
* @param msg 可以传字符串,也可以传 T
|
|
48
|
+
*/
|
|
49
|
+
}, {
|
|
50
|
+
key: "info",
|
|
51
|
+
value: function info(msg) {
|
|
52
|
+
return API_UNSUPPORT();
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 警告的提示
|
|
56
|
+
* @param msg 可以传字符串,也可以传 T
|
|
57
|
+
*/
|
|
58
|
+
}, {
|
|
59
|
+
key: "warning",
|
|
60
|
+
value: function warning(msg) {
|
|
61
|
+
return API_UNSUPPORT();
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* 加载中的提示
|
|
65
|
+
* @param msg 可以传字符串,也可以传 T
|
|
66
|
+
*/
|
|
67
|
+
}, {
|
|
68
|
+
key: "loading",
|
|
69
|
+
value: function loading(msg) {
|
|
70
|
+
return API_UNSUPPORT();
|
|
71
|
+
}
|
|
72
|
+
}]);
|
|
73
|
+
}(ServService);
|
|
74
|
+
__decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], SappUiToastService.prototype, "success", null);
|
|
75
|
+
__decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], SappUiToastService.prototype, "error", null);
|
|
76
|
+
__decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], SappUiToastService.prototype, "info", null);
|
|
77
|
+
__decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], SappUiToastService.prototype, "warning", null);
|
|
78
|
+
__decorate([anno.decl.api(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Object)], SappUiToastService.prototype, "loading", null);
|
|
79
|
+
SappUiToastService = __decorate([anno.decl({
|
|
80
|
+
id: 's.app.ui.',
|
|
81
|
+
version: '1.0.0'
|
|
82
|
+
})], SappUiToastService);
|
|
83
|
+
export { SappUiToastService };
|
package/src/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './decl';
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { ServService } from 'servkit';
|
|
2
|
+
import type { ServAPIRetn } from 'servkit';
|
|
3
|
+
/**
|
|
4
|
+
* 表格元信息
|
|
5
|
+
*/
|
|
6
|
+
interface ISheet {
|
|
7
|
+
/**
|
|
8
|
+
* 表名称
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 表格列信息
|
|
14
|
+
*/
|
|
15
|
+
interface IColumn {
|
|
16
|
+
/**
|
|
17
|
+
* 列ID,表内唯一
|
|
18
|
+
*/
|
|
19
|
+
columnId: number;
|
|
20
|
+
/**
|
|
21
|
+
* 列名称,表内唯一
|
|
22
|
+
*/
|
|
23
|
+
name: string;
|
|
24
|
+
/**
|
|
25
|
+
* 列的显隐,0-显示,1-隐藏
|
|
26
|
+
*/
|
|
27
|
+
visible: 0 | 1;
|
|
28
|
+
/**
|
|
29
|
+
* 列引用名,表内唯一
|
|
30
|
+
*/
|
|
31
|
+
referencedName: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 单元格错误信息
|
|
35
|
+
*/
|
|
36
|
+
interface ICellError {
|
|
37
|
+
/**
|
|
38
|
+
* 单元格错误信息
|
|
39
|
+
*/
|
|
40
|
+
message: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* 单元格基础信息
|
|
44
|
+
*/
|
|
45
|
+
interface ICellBase {
|
|
46
|
+
/**
|
|
47
|
+
* 表ID
|
|
48
|
+
*/
|
|
49
|
+
tableId: number;
|
|
50
|
+
/**
|
|
51
|
+
* 列ID
|
|
52
|
+
*/
|
|
53
|
+
columnId: number;
|
|
54
|
+
/**
|
|
55
|
+
* 行ID
|
|
56
|
+
*/
|
|
57
|
+
rowId: number;
|
|
58
|
+
/**
|
|
59
|
+
* 单元格的值,属性类型的值是json str
|
|
60
|
+
*/
|
|
61
|
+
value: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* 单元格信息
|
|
65
|
+
*/
|
|
66
|
+
interface ICell extends ICellBase {
|
|
67
|
+
/**
|
|
68
|
+
* 子表也是一个独立的表格,表Id在清单范围内唯一
|
|
69
|
+
*/
|
|
70
|
+
subTableId?: number;
|
|
71
|
+
/**
|
|
72
|
+
* 单元格错误信息, 比如往数字类型的单元格写了字符串,就会有错误信息
|
|
73
|
+
*/
|
|
74
|
+
error?: ICellError;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* 表格单行信息
|
|
78
|
+
*/
|
|
79
|
+
interface IROW {
|
|
80
|
+
/**
|
|
81
|
+
* 行ID,表内唯一
|
|
82
|
+
*/
|
|
83
|
+
rowId: number;
|
|
84
|
+
/**
|
|
85
|
+
* 是否可见,通过列筛选等可隐藏
|
|
86
|
+
*/
|
|
87
|
+
visible: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* 行内单元格信息,key为columnId,columnId由后端生成,并非1-n连续的数字
|
|
90
|
+
* 示例:
|
|
91
|
+
* {
|
|
92
|
+
* 1: {
|
|
93
|
+
* tableId: 1,
|
|
94
|
+
* columnId: 1,
|
|
95
|
+
* rowId: 2,
|
|
96
|
+
* value: 'abc'
|
|
97
|
+
*
|
|
98
|
+
* },
|
|
99
|
+
* 12: {
|
|
100
|
+
* tableId: 1,
|
|
101
|
+
* columnId: 12,
|
|
102
|
+
* rowId: 2,
|
|
103
|
+
* value: "7",
|
|
104
|
+
* subTableId: 1
|
|
105
|
+
* }
|
|
106
|
+
* }
|
|
107
|
+
*/
|
|
108
|
+
cells: Record<string, ICell>;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* 单个表数据
|
|
112
|
+
*/
|
|
113
|
+
interface ITable {
|
|
114
|
+
/**
|
|
115
|
+
* 表ID,清单内唯一
|
|
116
|
+
*/
|
|
117
|
+
tableId: number;
|
|
118
|
+
/**
|
|
119
|
+
* 表元信息
|
|
120
|
+
*/
|
|
121
|
+
sheet: ISheet;
|
|
122
|
+
/**
|
|
123
|
+
* 表列信息
|
|
124
|
+
*/
|
|
125
|
+
columns: Array<IColumn>;
|
|
126
|
+
/**
|
|
127
|
+
* 表行信息,内部包含单元格信息
|
|
128
|
+
*/
|
|
129
|
+
rows: Array<IROW>;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* 清单元信息
|
|
133
|
+
*/
|
|
134
|
+
interface IListingMeta {
|
|
135
|
+
/**
|
|
136
|
+
* 清单的唯一标识
|
|
137
|
+
*/
|
|
138
|
+
id: string;
|
|
139
|
+
/**
|
|
140
|
+
* 清单名称
|
|
141
|
+
*/
|
|
142
|
+
name: string;
|
|
143
|
+
/**
|
|
144
|
+
* 用户ID
|
|
145
|
+
*/
|
|
146
|
+
userId: string;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* 清单详情
|
|
150
|
+
*/
|
|
151
|
+
export interface IListingDetail {
|
|
152
|
+
/**
|
|
153
|
+
* 清单元信息
|
|
154
|
+
*/
|
|
155
|
+
metaData: IListingMeta;
|
|
156
|
+
/**
|
|
157
|
+
* 清单表格数据
|
|
158
|
+
*/
|
|
159
|
+
tableData: Array<ITable>;
|
|
160
|
+
}
|
|
161
|
+
export interface IListingQueryParams {
|
|
162
|
+
/**
|
|
163
|
+
* 清单ID
|
|
164
|
+
*/
|
|
165
|
+
listingId: string;
|
|
166
|
+
}
|
|
167
|
+
export interface ICellsUpdateParams {
|
|
168
|
+
/**
|
|
169
|
+
* 清单ID
|
|
170
|
+
*/
|
|
171
|
+
listingId: string;
|
|
172
|
+
/**
|
|
173
|
+
* 单元格信息
|
|
174
|
+
*/
|
|
175
|
+
updateCells: Array<ICellBase>;
|
|
176
|
+
}
|
|
177
|
+
export interface ICellsUpdateRes {
|
|
178
|
+
/**
|
|
179
|
+
* 清单ID
|
|
180
|
+
*/
|
|
181
|
+
listingId: string;
|
|
182
|
+
/**
|
|
183
|
+
* 清单更新结果
|
|
184
|
+
*/
|
|
185
|
+
updateCells: Array<ICell>;
|
|
186
|
+
}
|
|
187
|
+
export interface IListingLockParams {
|
|
188
|
+
/**
|
|
189
|
+
* 清单锁定时,模态框上显示的提示信息
|
|
190
|
+
*/
|
|
191
|
+
message: string;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* 清单插件平台API,给插件提供读写清单数据的api
|
|
195
|
+
*/
|
|
196
|
+
export declare class ListingService extends ServService {
|
|
197
|
+
/**
|
|
198
|
+
* 读清单数据
|
|
199
|
+
*/
|
|
200
|
+
getDetail(params: IListingQueryParams): ServAPIRetn<IListingDetail>;
|
|
201
|
+
/**
|
|
202
|
+
* 批量更新单元格值
|
|
203
|
+
*/
|
|
204
|
+
updateCells(params: ICellsUpdateParams): ServAPIRetn<ICellsUpdateRes>;
|
|
205
|
+
/**
|
|
206
|
+
* 锁定清单
|
|
207
|
+
*/
|
|
208
|
+
lock(params: IListingLockParams): ServAPIRetn<void>;
|
|
209
|
+
/**
|
|
210
|
+
* 解除锁定
|
|
211
|
+
*/
|
|
212
|
+
unlock(): ServAPIRetn<void>;
|
|
213
|
+
/**
|
|
214
|
+
* 获取当前清单id
|
|
215
|
+
*/
|
|
216
|
+
getCurrentListingId(): ServAPIRetn<string>;
|
|
217
|
+
}
|
|
218
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ServService } from 'servkit';
|
|
2
|
+
import type { ServAPIRetn } from 'servkit';
|
|
3
|
+
export interface ISappInfo {
|
|
4
|
+
/**
|
|
5
|
+
* 应用使用的链接
|
|
6
|
+
*/
|
|
7
|
+
url: string;
|
|
8
|
+
/**
|
|
9
|
+
* 应用的ID
|
|
10
|
+
*/
|
|
11
|
+
id: string;
|
|
12
|
+
/**
|
|
13
|
+
* 应用的标题
|
|
14
|
+
*/
|
|
15
|
+
title: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class SappDevService extends ServService {
|
|
18
|
+
/**
|
|
19
|
+
* 启动某个小程序
|
|
20
|
+
*/
|
|
21
|
+
start(sapp: ISappInfo): ServAPIRetn<void>;
|
|
22
|
+
/**
|
|
23
|
+
* stop 停止某个小程序
|
|
24
|
+
*/
|
|
25
|
+
stop(sapp: ISappInfo): ServAPIRetn<void>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ServService } from 'servkit';
|
|
2
|
+
import type { ServAPIRetn } from 'servkit';
|
|
3
|
+
export interface IToastConfig {
|
|
4
|
+
title: string;
|
|
5
|
+
content: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class SappUiToastService extends ServService {
|
|
8
|
+
/**
|
|
9
|
+
* 成功的提示
|
|
10
|
+
* @param msg 可以传字符串,也可以传 T
|
|
11
|
+
*/
|
|
12
|
+
success(msg: string | IToastConfig): ServAPIRetn<void>;
|
|
13
|
+
/**
|
|
14
|
+
* 出错的提示
|
|
15
|
+
* @param msg 可以传字符串,也可以传 T
|
|
16
|
+
*/
|
|
17
|
+
error(msg: string | IToastConfig): ServAPIRetn<void>;
|
|
18
|
+
/**
|
|
19
|
+
* 一般的提示
|
|
20
|
+
* @param msg 可以传字符串,也可以传 T
|
|
21
|
+
*/
|
|
22
|
+
info(msg: string | IToastConfig): ServAPIRetn<void>;
|
|
23
|
+
/**
|
|
24
|
+
* 警告的提示
|
|
25
|
+
* @param msg 可以传字符串,也可以传 T
|
|
26
|
+
*/
|
|
27
|
+
warning(msg: string | IToastConfig): ServAPIRetn<void>;
|
|
28
|
+
/**
|
|
29
|
+
* 加载中的提示
|
|
30
|
+
* @param msg 可以传字符串,也可以传 T
|
|
31
|
+
*/
|
|
32
|
+
loading(msg: string | IToastConfig): ServAPIRetn<void>;
|
|
33
|
+
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './decl';
|