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 614f920..14f8892 100644
--- a/src/tis_app_template_kt/src/components/Dialog/DialogPc.vue
+++ b/src/tis_app_template_kt/src/components/Dialog/DialogPc.vue
@@ -1,159 +1,38 @@
-
-
-
-
+
-
-
+ },
+ methods: {
+ }
+}
+
diff --git a/src/tis_app_template_kt/src/components/Dialog/Pc.vue b/src/tis_app_template_kt/src/components/Dialog/Pc.vue
new file mode 100644
index 0000000..85e5c71
--- /dev/null
+++ b/src/tis_app_template_kt/src/components/Dialog/Pc.vue
@@ -0,0 +1,171 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/tis_app_template_kt/src/tis/bus.js b/src/tis_app_template_kt/src/tis/bus.js
index 1c15713..08cbd76 100644
--- a/src/tis_app_template_kt/src/tis/bus.js
+++ b/src/tis_app_template_kt/src/tis/bus.js
@@ -1,6 +1,8 @@
import Vue from "vue";
import {registerApps} from './scriptsLoader/index'
+let dialogZIndex = 400
+
// temp
let curBaseUrl = ''
const dev = process.env.NODE_ENV === 'development';
@@ -119,7 +121,12 @@ const bus = new Vue({
}
if (!this.actives.some(l => l.component === c.component)) {
- //弹窗暂定为同一时间只能打开一个
+ //弹窗暂定为同一时间只能打开一个 "PopupWidget" 非dialog
+ // 计算z-index
+ if (!c.zIndex) {
+ c.zIndex = this.getNextDialogZIndex()
+ }
+
if (c.type === 'dialog') {
this.actives = [c];
} else {
@@ -137,17 +144,44 @@ const bus = new Vue({
console.log('actives变化状态', this.actives);
this.menuStatusUpdate();
},
+
+ getNextDialogZIndex() {
+ let zIndex = 0
+ for (let item of this.actives) {
+ if (item.zIndex && item.zIndex > zIndex) {
+ zIndex = item.zIndex
+ }
+ }
+ return zIndex > 0 ? zIndex + 1 : dialogZIndex
+ },
+
// 最小化激活的弹窗
minimizeComponent(component) {
this.actives.forEach(c => {
const comp = c.component.name || c.component
+ console.log(comp, component, c)
if (comp === component) {
c.status = 'minimize'
+ c.zIndex = 0
}
})
+ this.actives = [...this.actives]
+ console.log('after minimize', this.actives)
this.menuStatusUpdate()
},
+ // 激活窗口
+ activeComponent(component) {
+ const curComponent = this.actives.find(v => (c.component.name || c.component) === component)
+ const maxZIndex = Math.max.apply(Math, this.actives.map(function(o) { return o.zIndex; }))
+ const maxComponent = this.actives.find(v => v.zIndex === maxZIndex)
+ if (curComponent === maxComponent) return;
+
+ maxComponent.zIndex = curComponent.zIndex
+ curComponent.zIndex = maxZIndex
+ this.actives = [...this.actives]
+ },
+
// 关闭组件
closeComponent(components) {
//修改layout中的状态