owl-cli 7.15.0 → 7.17.0
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.
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// filepath: c:\work\gzs\gzsBackend\gzsowl\models\owlsys\systemAdmin\apps\api\src\plugins\uninstall.jsx
|
|
2
|
+
//#import app.js
|
|
3
|
+
|
|
4
|
+
// 卸载插件(示例实现)
|
|
5
|
+
// 接受前端传入的 selected / ids / records 字段,返回卸载结果。
|
|
6
|
+
|
|
7
|
+
//#import $owl_apps:services/modelService.jsx
|
|
8
|
+
|
|
9
|
+
function main() {
|
|
10
|
+
var params = JSON.parse($body);
|
|
11
|
+
var id = params.id;
|
|
12
|
+
var ids = params.ids;
|
|
13
|
+
if (!ids && id) {
|
|
14
|
+
ids = [id];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
$.log('uninstall plugin called, ids=' + JSON.stringify(ids));
|
|
19
|
+
|
|
20
|
+
if (!ids || ids.length === 0) {
|
|
21
|
+
var err = { state: 'err', msg: '参数错误: 未提供要卸载的记录' };
|
|
22
|
+
out.print(JSON.stringify(err));
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// TODO: 这里可以加入实际的卸载逻辑(如删除注册表、清理数据库、撤销配置等)。
|
|
27
|
+
// 当前实现仅模拟成功返回,并回显 ids。
|
|
28
|
+
var tableIds = [];
|
|
29
|
+
for(var i = 0; i < ids.length; i++){
|
|
30
|
+
var id = ids[i]
|
|
31
|
+
var owlapp = owl_appsService.get(id);
|
|
32
|
+
if(owlapp){
|
|
33
|
+
var tableId = owlapp.tableId;
|
|
34
|
+
AppService.deleteMyApp('head_merchant', tableId);
|
|
35
|
+
tableIds.push(tableId);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
var idString = tableIds.join(',');
|
|
42
|
+
var ret = {
|
|
43
|
+
state: 'ok',
|
|
44
|
+
msg: '卸载成功: ' + idString,
|
|
45
|
+
ids: ids
|
|
46
|
+
};
|
|
47
|
+
out.print(JSON.stringify(ret));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
main();
|
|
51
|
+
|
|
@@ -70,6 +70,14 @@
|
|
|
70
70
|
"position": "batch",
|
|
71
71
|
"responseAction": "showMessage",
|
|
72
72
|
"help": "刷新"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"label": "卸载",
|
|
76
|
+
"id": "apps_uninstall",
|
|
77
|
+
"action": "/owl_apps/plugins/uninstall.jsx",
|
|
78
|
+
"position": "batch",
|
|
79
|
+
"responseAction": "showMessage",
|
|
80
|
+
"help": "卸载"
|
|
73
81
|
}
|
|
74
82
|
],
|
|
75
83
|
"export": [
|
|
@@ -275,6 +275,7 @@ function filterOrgsApps(apps,orgId) {
|
|
|
275
275
|
}
|
|
276
276
|
level2.children.push({
|
|
277
277
|
path: "/owl/" + app.id,
|
|
278
|
+
id:app.id,
|
|
278
279
|
name: app.name,
|
|
279
280
|
icon: app.icon,
|
|
280
281
|
pos: app.pos
|
|
@@ -282,6 +283,7 @@ function filterOrgsApps(apps,orgId) {
|
|
|
282
283
|
} else {
|
|
283
284
|
group.children.push({
|
|
284
285
|
path: "/owl/" + app.id,
|
|
286
|
+
id:app.id,
|
|
285
287
|
name: app.name,
|
|
286
288
|
icon: app.icon,
|
|
287
289
|
pos:app.pos
|
|
@@ -291,6 +293,7 @@ function filterOrgsApps(apps,orgId) {
|
|
|
291
293
|
} else {
|
|
292
294
|
apps[app.id] = {
|
|
293
295
|
path: "/owl/" + app.id,
|
|
296
|
+
id:app.id,
|
|
294
297
|
name: app.name,
|
|
295
298
|
icon: app.icon,
|
|
296
299
|
pos:app.pos
|