diff --git a/src/tis_app_template_kt/src/components/Dialog/DialogPc.vue b/src/tis_app_template_kt/src/components/Dialog/DialogPc.vue index d880382..614f920 100644 --- a/src/tis_app_template_kt/src/components/Dialog/DialogPc.vue +++ b/src/tis_app_template_kt/src/components/Dialog/DialogPc.vue @@ -30,6 +30,7 @@ //import VueDragResize from "../vueDragResize/vue-drag-resize.vue"; import VueDragResize from 'vue-drag-resize' import {dialogMixins} from './dialogMixins' +import bus from '../../tis/bus' export default { name: "DialogPc", @@ -101,6 +102,7 @@ import VueDragResize from 'vue-drag-resize' }, minisize() { this.centerDialogVisible = false; + this.$tis.minimizeComponent(this.actives) }, onClose() { this.centerDialogVisible = false; diff --git a/src/tis_app_template_kt/src/components/Dialog/dialogMixins.js b/src/tis_app_template_kt/src/components/Dialog/dialogMixins.js index 0f49a44..dca2600 100644 --- a/src/tis_app_template_kt/src/components/Dialog/dialogMixins.js +++ b/src/tis_app_template_kt/src/components/Dialog/dialogMixins.js @@ -25,9 +25,13 @@ export const dialogMixins = { actives() { //保证打开的是激活组件 const d = this.$tis.getActivesByType("PopupWidget").pop(); + console.log('recalc d') if(d && d.component){ this.centerDialogVisible = true; } + if (d.status === 'normal') { + this.centerDialogVisible = true + } return d && d.component; }, }, diff --git a/src/tis_app_template_kt/src/tis/bus.js b/src/tis_app_template_kt/src/tis/bus.js index f306f24..1c15713 100644 --- a/src/tis_app_template_kt/src/tis/bus.js +++ b/src/tis_app_template_kt/src/tis/bus.js @@ -25,11 +25,11 @@ const bus = new Vue({ // 传递当前所处组件的上下文环境 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 = '' - console.log('============>', appId) + console.log('============>', appId, onActives) // 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) { @@ -103,6 +103,7 @@ const bus = new Vue({ const hit = components.includes(component); if (hit) { c.lazy = !hit; + c.status = c.status === 'minimize' ? 'normal' : c.status return c; } }).forEach(c => { @@ -129,10 +130,24 @@ const bus = new Vue({ }); //有 加入 无 删除? + // 强制触发更新 + this.actives = [...this.actives] + console.log('layouts变化状态', this.layouts); console.log('actives变化状态', this.actives); 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) { //修改layout中的状态 @@ -166,7 +181,6 @@ const bus = new Vue({ //获取组件 getWidgetsByType(type) { //以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 => { //string类型,来自配置文件,需要下载资源才能使用,懒加载组件不加载但是需要加入到数组中、、