分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-07-19 7a4c218909936721fe281737491d10efc7378e09
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<template>
  <div>
    <vol-box :lazy="true"
             v-model="model.box1"
             title="弹出框1"
             :height="400"
             :width="700"
             :padding="15">
      <div>弹出框1
        <el-button type="primary"
        size="mini"
                @click="getParent">获取父组件对象</el-button>
        <p>通过 this.$emit("parentCall", $vue => {})可以访问父组件ViewGird中的任何属性、对象、方法</p>
        <p>{{model.box1Text}}</p>
      </div>
    </vol-box>
 
    <!-- 弹出框2 -->
    <vol-box :lazy="true"
             v-model="model.box2"
             title="弹出框2"
             :height="420"
             :width="900"
             :padding="10">
      <div>
        <el-tabs type="border-card"
                 style="height: 358px;">
          <el-tab-pane>
            <template #label>  <span ><i class="el-icon-date"></i> 我的行程</span></template>
          
            我的行程
          </el-tab-pane>
          <el-tab-pane :lazy="true"
                       label="消息中心">消息中心</el-tab-pane>
          <el-tab-pane :lazy="true"
                       label="角色管理">角色管理</el-tab-pane>
          <el-tab-pane :lazy="true"
                       label="定时任务补偿">定时任务补偿</el-tab-pane>
        </el-tabs>
 
      </div>
    </vol-box>
 
    <!-- 弹出框3 -->
    <vol-box :lazy="true"
             v-model="model.box3"
             title="弹出框3"
             :height="400"
             :width="700"
             :padding="15">
  <div>当前操作的行数据{{JSON.stringify(model.box3Row)}}</div>
        <template #footer> 
      <div >
        <el-button type="primary"
        size="mini"
                @click="$Message.error('点击确认')">确认</el-button>
        <el-button type="default"
           size="mini"
                @click="model.box3=false">点击关闭弹出框</el-button>
      </div></template>
    </vol-box>
  </div>
</template>
<script>
import VolBox from "@/components/basic/VolBox.vue";
export default {
  components: { "vol-box": VolBox },
  methods: {},
  data() {
    return {
      model: {
        box1Text: "",
        box1: false,
        box1Text: "",
        box2: false,
        box3: false,   
        box3Row: {},
      },
    };
  },
  methods: {
    getParent() {
      this.$emit("parentCall", ($vue) => {
        this.model.box1Text = JSON.stringify($vue.buttons);
      });
    },
    getTestData() {
      return "这里是获取到的子组件对象" + JSON.stringify(this.model);
    },
    //弹出框1
    open1() {
      this.model.box1 = true;
    },
    //弹出框2
    open2() {
      this.model.box2 = true;
    },
    //弹出框3
    open3(row) {
      this.model.box3Row = row;
      this.model.box3 = true;
    },
  },
};
</script>