|
@ -25,11 +25,11 @@ const bus = new Vue({ |
|
|
|
|
|
|
|
|
// 传递当前所处组件的上下文环境
|
|
|
// 传递当前所处组件的上下文环境
|
|
|
menuStatusUpdate(){ |
|
|
menuStatusUpdate(){ |
|
|
const onActives = this.getTemplateLayouts().filter(l => !l.lazy).map(c=>c.component.name || c.component); |
|
|
|
|
|
|
|
|
const onActives = this.getTemplateLayouts().filter(l => !l.lazy).map(c => ({component: c.component.name || c.component, status: c.status})); |
|
|
const appId = '' |
|
|
const appId = '' |
|
|
console.log('============>', appId) |
|
|
|
|
|
|
|
|
console.log('============>', appId, onActives) |
|
|
// TODO 这里通过event-bus来实现吧,Vue实例获取不到
|
|
|
// TODO 这里通过event-bus来实现吧,Vue实例获取不到
|
|
|
this.$emit('TIS_TEMPLATE_MENU_ACTIVE', {appId, onActives: onActives,system:true}) |
|
|
|
|
|
|
|
|
window.esapp.tis.$emit('TIS_TEMPLATE_MENU_ACTIVE', {appId, onActives: onActives,system:true}) |
|
|
}, |
|
|
}, |
|
|
async loadComponent(component) { |
|
|
async loadComponent(component) { |
|
|
|
|
|
|
|
@ -103,6 +103,7 @@ const bus = new Vue({ |
|
|
const hit = components.includes(component); |
|
|
const hit = components.includes(component); |
|
|
if (hit) { |
|
|
if (hit) { |
|
|
c.lazy = !hit; |
|
|
c.lazy = !hit; |
|
|
|
|
|
c.status = c.status === 'minimize' ? 'normal' : c.status |
|
|
return c; |
|
|
return c; |
|
|
} |
|
|
} |
|
|
}).forEach(c => { |
|
|
}).forEach(c => { |
|
@ -129,10 +130,24 @@ const bus = new Vue({ |
|
|
}); |
|
|
}); |
|
|
//有 加入 无 删除?
|
|
|
//有 加入 无 删除?
|
|
|
|
|
|
|
|
|
|
|
|
// 强制触发更新
|
|
|
|
|
|
this.actives = [...this.actives] |
|
|
|
|
|
|
|
|
console.log('layouts变化状态', this.layouts); |
|
|
console.log('layouts变化状态', this.layouts); |
|
|
console.log('actives变化状态', this.actives); |
|
|
console.log('actives变化状态', this.actives); |
|
|
this.menuStatusUpdate(); |
|
|
this.menuStatusUpdate(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 最小化激活的弹窗
|
|
|
|
|
|
minimizeComponent(component) { |
|
|
|
|
|
this.actives.forEach(c => { |
|
|
|
|
|
const comp = c.component.name || c.component |
|
|
|
|
|
if (comp === component) { |
|
|
|
|
|
c.status = 'minimize' |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
this.menuStatusUpdate() |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// 关闭组件
|
|
|
// 关闭组件
|
|
|
closeComponent(components) { |
|
|
closeComponent(components) { |
|
|
//修改layout中的状态
|
|
|
//修改layout中的状态
|
|
@ -166,7 +181,6 @@ const bus = new Vue({ |
|
|
//获取组件
|
|
|
//获取组件
|
|
|
getWidgetsByType(type) { |
|
|
getWidgetsByType(type) { |
|
|
//以type 或 position 命中widget,背景板默认lazy=false
|
|
|
//以type 或 position 命中widget,背景板默认lazy=false
|
|
|
console.log(type, this.layouts) |
|
|
|
|
|
return this.layouts.filter(f => (f.type === type || f.position === type) && !f.lazy).map(f => { |
|
|
return this.layouts.filter(f => (f.type === type || f.position === type) && !f.lazy).map(f => { |
|
|
//string类型,来自配置文件,需要下载资源才能使用,懒加载组件不加载但是需要加入到数组中、、
|
|
|
//string类型,来自配置文件,需要下载资源才能使用,懒加载组件不加载但是需要加入到数组中、、
|
|
|
|
|
|
|
|
|