-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix [Bug]: 非受管软件包元数据加载到库里,页面修改对象相关配置,前台页面不生效 #7047
- Loading branch information
1 parent
ae3e4f1
commit fec77cc
Showing
2 changed files
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/* | ||
* @Author: [email protected] | ||
* @Date: 2022-05-28 11:07:57 | ||
* @LastEditors: 孙浩林 sunhaolin@steedos.com | ||
* @LastEditTime: 2024-05-11 13:57:23 | ||
* @LastEditors: baozhoutao@steedos.com | ||
* @LastEditTime: 2024-10-31 17:36:24 | ||
* @Description: | ||
*/ | ||
const InternalData = require('@steedos/standard-objects').internalData; | ||
|
@@ -17,7 +17,22 @@ module.exports = { | |
doc.visible; | ||
}, | ||
beforeUpdate: async function(){ | ||
const { doc } = this; | ||
const { doc, id } = this; | ||
if(doc.label){ | ||
const dbRecord = await this.getObject('object_actions').findOne(id); | ||
|
||
const amis_schema = doc.amis_schema || dbRecord.amis_schema; | ||
|
||
if(dbRecord && dbRecord.label != doc.label && amis_schema && _.isString(amis_schema) ){ | ||
try { | ||
const json = JSON.parse(amis_schema); | ||
json.body[0].label = doc.label | ||
doc.amis_schema = JSON.stringify(json) | ||
} catch (error) { | ||
console.log(error) | ||
} | ||
} | ||
} | ||
delete doc.visible_type | ||
doc.visible; | ||
}, | ||
|