@steedos/standard-ui 2.7.0-beta.8 → 2.7.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.
- package/main/default/applications/admin.app.yml +4 -1
- package/main/default/objects/apps/buttons/disable.button.js +56 -0
- package/main/default/objects/apps/buttons/disable.button.yml +4 -0
- package/main/default/objects/apps/buttons/enable.button.js +60 -0
- package/main/default/objects/apps/buttons/enable.button.yml +4 -0
- package/main/default/objects/tabs.object.yml +0 -13
- package/package.json +2 -2
|
@@ -153,9 +153,12 @@ tab_items:
|
|
|
153
153
|
admin_api_keys:
|
|
154
154
|
group: development
|
|
155
155
|
index: 42
|
|
156
|
-
|
|
156
|
+
admin_settings:
|
|
157
157
|
group: advanced_settings
|
|
158
158
|
index: 50
|
|
159
|
+
admin_logs:
|
|
160
|
+
group: advanced_settings
|
|
161
|
+
index: 52
|
|
159
162
|
objects: []
|
|
160
163
|
sort: 999999
|
|
161
164
|
#url: /app/admin
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: baozhoutao@steedos.com
|
|
3
|
+
* @Date: 2024-03-30 11:37:53
|
|
4
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
+
* @LastEditTime: 2024-04-15 10:43:38
|
|
6
|
+
* @Description:
|
|
7
|
+
*/
|
|
8
|
+
module.exports = {
|
|
9
|
+
disable: function (object_name, record_id) {
|
|
10
|
+
const record = Creator.odata.get(object_name, record_id);
|
|
11
|
+
const nodesSelect = Steedos.PackageRegistry.getNodesSelect();
|
|
12
|
+
swal({
|
|
13
|
+
title: '停用',
|
|
14
|
+
text: `确定要停用${record.name}?${nodesSelect}`,
|
|
15
|
+
html: true,
|
|
16
|
+
showCancelButton: true,
|
|
17
|
+
confirmButtonText: '停用',
|
|
18
|
+
cancelButtonText: TAPi18n.__('Cancel')
|
|
19
|
+
}, function (option) {
|
|
20
|
+
if (option) {
|
|
21
|
+
toastr.info(t('停用中,请稍后...'), null, {timeOut: false});
|
|
22
|
+
Steedos.authRequest(Steedos.absoluteUrl(`/api/v1/apps/${record_id}`), {
|
|
23
|
+
type: 'put', async: false, data: JSON.stringify({
|
|
24
|
+
doc: {
|
|
25
|
+
visible: false
|
|
26
|
+
}
|
|
27
|
+
}),
|
|
28
|
+
success: function(){
|
|
29
|
+
setTimeout(function(){
|
|
30
|
+
if (record_id) {
|
|
31
|
+
SteedosUI.reloadRecord(object_name, record_id)
|
|
32
|
+
}
|
|
33
|
+
toastr.clear();
|
|
34
|
+
toastr.success(t('steedos_packages.disable.toastr_success'));
|
|
35
|
+
FlowRouter.reload()
|
|
36
|
+
}, 100)
|
|
37
|
+
},
|
|
38
|
+
error: function(XMLHttpRequest){
|
|
39
|
+
toastr.clear();
|
|
40
|
+
toastr.error(XMLHttpRequest.responseJSON.error);
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
},
|
|
46
|
+
disableVisible: function (object_name, record_id) {
|
|
47
|
+
const record = Creator.odata.get(object_name, record_id);
|
|
48
|
+
if(record._id == record.code){
|
|
49
|
+
return false
|
|
50
|
+
}
|
|
51
|
+
if(record.visible){
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: baozhoutao@steedos.com
|
|
3
|
+
* @Date: 2024-03-30 11:37:53
|
|
4
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
+
* @LastEditTime: 2024-04-15 10:43:45
|
|
6
|
+
* @Description:
|
|
7
|
+
*/
|
|
8
|
+
module.exports = {
|
|
9
|
+
enable: function (object_name, record_id) {
|
|
10
|
+
const record = Creator.odata.get(object_name,record_id);
|
|
11
|
+
const nodesSelect = Steedos.PackageRegistry.getNodesSelect();
|
|
12
|
+
swal({
|
|
13
|
+
title: `启用`,
|
|
14
|
+
text: `确定要启用${record.name}?${nodesSelect}`,
|
|
15
|
+
html: true,
|
|
16
|
+
showCancelButton: true,
|
|
17
|
+
confirmButtonText: '启用',
|
|
18
|
+
cancelButtonText: TAPi18n.__('Cancel')
|
|
19
|
+
}, function (option) {
|
|
20
|
+
if (option) {
|
|
21
|
+
toastr.info('启用中,请稍后...', null, {timeOut: false});
|
|
22
|
+
Steedos.authRequest(Steedos.absoluteUrl(`/api/v1/apps/${record_id}`), {type: 'put', async: false, data: JSON.stringify({
|
|
23
|
+
doc: {
|
|
24
|
+
visible: true
|
|
25
|
+
}
|
|
26
|
+
}),
|
|
27
|
+
success: function(data){
|
|
28
|
+
if(data.status == 1){
|
|
29
|
+
toastr.clear();
|
|
30
|
+
toastr.error(data.msg);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
setTimeout(function(){
|
|
34
|
+
if (FlowRouter.current().params.record_id) {
|
|
35
|
+
SteedosUI.reloadRecord(object_name, record_id)
|
|
36
|
+
}
|
|
37
|
+
toastr.clear();
|
|
38
|
+
toastr.success('已启用');
|
|
39
|
+
FlowRouter.reload()
|
|
40
|
+
}, 100)
|
|
41
|
+
},
|
|
42
|
+
error: function(XMLHttpRequest){
|
|
43
|
+
toastr.clear();
|
|
44
|
+
toastr.error(XMLHttpRequest.responseJSON.error);
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
},
|
|
50
|
+
enableVisible: function (object_name,record_id) {
|
|
51
|
+
const record = Creator.odata.get(object_name,record_id);
|
|
52
|
+
if(record._id == record.code){
|
|
53
|
+
return false
|
|
54
|
+
}
|
|
55
|
+
if(record.visible){
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
return true
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -149,19 +149,6 @@ permission_set:
|
|
|
149
149
|
allowRead: true
|
|
150
150
|
modifyAllRecords: true
|
|
151
151
|
viewAllRecords: true
|
|
152
|
-
# form:
|
|
153
|
-
# beforeEdit: !!js/function |
|
|
154
|
-
# function(){
|
|
155
|
-
# return Steedos.TabsManager.changeSchema(this.doc, this.schema, 'edit');
|
|
156
|
-
# }
|
|
157
|
-
# afterEdit: !!js/function |
|
|
158
|
-
# function(){
|
|
159
|
-
# return Steedos.TabsManager.changeSchema(this.doc, this.schema, 'edit');
|
|
160
|
-
# }
|
|
161
|
-
# beforeView: !!js/function |
|
|
162
|
-
# function(){
|
|
163
|
-
# Steedos.TabsManager.changeSchema(this.doc, this.schema, 'view');
|
|
164
|
-
# }
|
|
165
152
|
relatedList:
|
|
166
153
|
- objectName: permission_tabs
|
|
167
154
|
columns:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/standard-ui",
|
|
3
|
-
"version": "2.7.0
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
"description": "steedos package",
|
|
13
13
|
"repository": {},
|
|
14
14
|
"license": "MIT",
|
|
15
|
-
"gitHead": "
|
|
15
|
+
"gitHead": "2f1586ea4f8af5b93753878e96f1f48adbef31a7"
|
|
16
16
|
}
|