zhangyanpeng
2024-05-29 1f227a1cf627526701c652ba84bae3e430bba8d3
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
106
107
108
109
110
111
112
113
114
115
116
<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title>版本对比</title>
        
        <script type="text/javascript">
            let me;
            
            var pageVue = null;
            function loadJsCss(callback) {
                var jscss_urls = []
                window.top.initJsCss(document, jscss_urls, callback);
            };
            var initlized = false;
            let id = 1000;
            
            function initVue() {
                new ListVue({
                    el: "#vbody",
                    data: {
                        dataname: "",
                        title: "版本对比",
                        compare_page: "./hierarchyByVER_list.html?status=locked",
                        versionList: ["202208003", "202208004"],
                        value: "202208003",
                        currentVersion: "2022-4-4",
                        popupParames: {},
                        pageHeight: 0,
                    },
                    created() {
                        me = this
                        
                        this.popupParames = clone(Root.popupParames);
                        console.log(this.popupParames)
                        this.pageHeight = this.popupParames.height.replace("px", "") * 1 - 90
                    },
                    mounted() {
                        this.initData();
                        this.$nextTick(() => {
                            hideLoading();
                            this.$refs.compare_page_iframe.contentWindow.postMessage({status: "locked"}, window.top.config.url_page);
                        });
                    },
                    
                    methods:{
                        initData() {
                            //this.$refs.compare_page_iframe.contentWindow.postMessage({status: "locked"}, window.top.config.url_page);
                            //this.$refs.compare_page_iframe2.contentWindow.postMessage({status: "locked"}, window.top.config.url_page);
                        },
                          
                        onServerInitData(data) {},
                        
                        versionChange(obj) {
                            this.$refs.compare_page_iframe2.contentWindow.postMessage({status: "locked", versionNo: obj}, window.top.config.url_page);
                        }
                    }
                });
            };
            
            loadJsCss(function () {
                initVue();
            });
        </script>
    </head>
    
    <body style="overflow: hidden;">
        <div v-cloak id="vbody">
            <div id="page_root">
                <div class="total-container">
                    <div class="el-dialog__header">
                        <div class="dialog-title">
                          <i class="iconfont icon-customermanagement"></i>
                          <span> {{title}} </span>
                        </div>
                    </div>    
                    <div class="left-container" style="height: 560px; width: 45%; margin: .5em 2em; display: inline-block">
                        <div style="height: 32px; line-height: 32px; float: left; margin-bottom: .5em;">
                            <span>版本号:{{popupParames.data.versionno}}</span>
                        </div>
                        <iframe ref="compare_page_iframe" style="height: 100%; width: 100%;" frameborder="0" :src="compare_page + '&height=' + pageHeight"></iframe>
                    </div>
                    
                    <div style="height: 560px; width: 45%; margin: .5em 2em; display: inline-block">
                        <div style="height: 32px; line-height: 32px; float: left; margin-bottom: .5em;">
                            <span>版本号:</span>
                            <el-select v-model="value" placeholder="请选择" @change="versionChange">
                                <el-option
                                    v-for="version in versionList"
                                    :key="version"
                                    :label="version"
                                    :value="version"
                                    >
                                </el-option>
                            </el-select>
                        </div>
                        <iframe ref="compare_page_iframe2" style="height: 100%; width: 100%;" frameborder="0" :src="compare_page + '&height=' + pageHeight"></iframe>
                    </div>
                </div>
            </div>
            
            <div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 50vh;">
                <div class="spinner">
                  <div class="cube1"></div>
                  <div class="cube2"></div>
                </div>
            </div>
        </div>    
        
        <style>
            [v-cloak] {
                display: none !important;
            }
        </style>
    </body>
</html>