no message

This commit is contained in:
kuaifan 2025-05-15 16:56:08 +08:00
parent 9888d9f59e
commit 04d31bd814
5 changed files with 19 additions and 13 deletions

View File

@ -131,11 +131,11 @@ export default {
},
mounted() {
emitter.on('openMicroApp', this.openMicroApp);
emitter.on('observeMicroApp', this.observeMicroApp);
},
beforeDestroy() {
emitter.off('openMicroApp', this.openMicroApp);
emitter.off('observeMicroApp', this.observeMicroApp);
},
watch: {
@ -346,7 +346,7 @@ export default {
},
/**
* 打开微应用
* 观察打开微应用
* @param config
* - name 应用名称
* - url 应用地址
@ -355,7 +355,7 @@ export default {
* - keepAlive 是否开启微应用保活 (true/false)默认 true
* - disableScopecss 是否禁用样式隔离 (true/false)默认 false
*/
openMicroApp(config) {
observeMicroApp(config) {
//
config.name = config.name || 'micro-app'
config.url = config.url || null

View File

@ -1184,7 +1184,11 @@ export default {
this.settingRoute(act)
break;
case 'appstore':
emitter.emit('openMicroApp', {name: 'appstore', url: $A.mainUrl('appstore/web/'), disableScopecss: true});
this.$store.dispatch("openMicroApp", {
name: 'appstore',
url: $A.mainUrl('appstore/web/'),
disableScopecss: true,
});
break;
}
},

View File

@ -22,7 +22,7 @@
:xl="{ span: 6 }"
:xxl="{ span: 3 }">
<div class="apply-col">
<div @click="microClick(item)">
<div @click="applyClick({value: 'microApp'}, item)">
<div class="logo">
<div class="apply-icon no-dark-content" :style="{backgroundImage: `url(${item.icon})`}"></div>
</div>
@ -449,13 +449,12 @@ export default {
}
return item.value == type && num > 0
},
//
microClick(item) {
this.$store.dispatch("openMicroApp", item);
},
//
applyClick(item, area = '') {
switch (item.value) {
case 'microApp':
this.$store.dispatch("openMicroApp", area);
return
case 'approve':
case 'calendar':
case 'file':

View File

@ -21,7 +21,7 @@ export default {
return
}
this.$refs.app.openMicroApp(app)
this.$refs.app.observeMicroApp(app)
}
}
</script>

View File

@ -4666,14 +4666,17 @@ export default {
return
}
const event = {
name: `${item.app_name}_${item.key}`,
name: item.app_name || item.name,
url: $A.mainUrl(item.url),
}
if (item.key) {
event.name += `_${item.key}`
}
for (let key in item) {
if (['props', 'transparent', 'keepAlive', 'disableScopecss'].includes(key)) {
event[key] = item[key]
}
}
emitter.emit('openMicroApp', event);
emitter.emit('observeMicroApp', event);
},
}