iframe 父子兄弟 調用方法 賦值等

好久好久不用iframe了。最近作項目居然所有用是iframe,各類不會各類查。。html

this.loadingProcess(data); 接口返回的data。父頁面賦值各子頁面
  loadingProcess(data) {
            this.data = data;
            //循環各頁面賦值
            this.activitys.forEach(obj => {
                let activity = obj.statusCode;
                let obj1 = window.frames[activity + "IFRAME"];//得到對應iframe的window對象
                if (obj1 != undefined) {
                    obj1.vm.assignment(data, this.formObj);
                }
            });
        },

  同級頁面  調用方法,取值獲取等ios

saveAccp() {
           // parent.frames[iframe的name].vm (當前name的實例)
            let objDiag = parent.frames["DIAGIFRAME"].vm
            let objCompt = parent.frames["COMPTIFRAME"].vm
            let objRepair = parent.frames["REPAIRIFRAME"].vm
            let objRevup = parent.frames["REVUPIFRAME"].vm
            let objDpk = parent.frames["DPKIFRAME"].vm
            let objTest = parent.frames["TESTIFRAME"].vm
            let objShip = parent.frames["SHIPIFRAME"].vm
            
            let commentDto = {
                acceptComment: this.accpObj.acceptComment
            };
            obj.commentDto = commentDto;
            // obj.activity = parent.vm.formObj.activity
            var url = parent.window.parent.vm.rmsServerUrl + '/accp/insertAccp';
            axios.post(url, obj).then((response) => {
                if (response.status === 200 && response.data !== "") {
                    var data = response.data;
                        // 調用其餘頁面內的方法  wipeData()// 一個狀況的方法
                        objDiag.wipeData()
                        objCompt.wipeData()
                        objRepair.wipeData()
                        objRevup.wipeData()
                        objDpk.wipeData()
                        objTest.wipeData()
                        objShip.wipeData()
                      
                        //父頁面賦值
                        // parent.vm.loadingNexeNodeAndGiveValue(data.obj.rmsRepairStatus);
                }
            }).catch(function (error) {
                console.log(error);
            })
        },        
相關文章
相關標籤/搜索