Skip to content

Commit

Permalink
fix [Bug]: 非受管软件包元数据加载到库里,页面修改对象相关配置,前台页面不生效 #7047
Browse files Browse the repository at this point in the history
  • Loading branch information
baozhoutao committed Oct 31, 2024
1 parent ae3e4f1 commit fec77cc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ function _sendObjectMeta(objectConfig){
if(res){
// console.log('send object meta success', length);
broker.broadcast("$packages.statisticsActivatedPackages", {});
broker.emit(`translations.object.change`, {});
}
})
_objectConfigs = [];
Expand Down
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;
Expand All @@ -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;
},
Expand Down

0 comments on commit fec77cc

Please sign in to comment.