2020-12-04 13:33:23 +00:00
|
|
|
<template>
|
2021-01-21 19:24:52 +00:00
|
|
|
<div class="d-flex">
|
2020-12-04 13:33:23 +00:00
|
|
|
<iframe
|
|
|
|
|
:width="width"
|
|
|
|
|
ref="xIFrame"
|
|
|
|
|
frameborder="0"
|
|
|
|
|
:src="path"
|
|
|
|
|
:height="height"
|
|
|
|
|
allowfullscreen
|
2021-01-21 19:24:52 +00:00
|
|
|
@load="onLoadIframe"
|
2020-12-04 13:33:23 +00:00
|
|
|
></iframe>
|
2021-01-28 19:05:33 +00:00
|
|
|
<Debugger v-if="openDebug === true" :style="'height:' + height + 'px'" ref="debugger"/>
|
2020-12-04 13:33:23 +00:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2021-01-21 19:24:52 +00:00
|
|
|
import Debugger from "../components/home/debugger/Debugger.vue";
|
|
|
|
|
import api from "../api/index";
|
2020-12-04 13:33:23 +00:00
|
|
|
export default {
|
|
|
|
|
name: "XCase",
|
2021-01-11 13:35:23 +00:00
|
|
|
components: {
|
2021-01-21 20:48:51 +00:00
|
|
|
Debugger
|
2021-01-11 13:35:23 +00:00
|
|
|
},
|
2020-12-04 13:33:23 +00:00
|
|
|
props: {
|
2021-01-21 20:48:51 +00:00
|
|
|
data: Object
|
2020-12-04 13:33:23 +00:00
|
|
|
},
|
2021-09-06 19:56:47 -04:00
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
openDebug: false,
|
|
|
|
|
dataCase: null,
|
|
|
|
|
height: "100%",
|
|
|
|
|
width: "100%",
|
|
|
|
|
diffHeight: 10,
|
|
|
|
|
path: "",
|
|
|
|
|
};
|
|
|
|
|
},
|
2020-12-04 13:33:23 +00:00
|
|
|
mounted() {
|
2021-01-21 19:24:52 +00:00
|
|
|
let that = this;
|
2020-12-04 13:33:23 +00:00
|
|
|
this.height = window.innerHeight - this.diffHeight;
|
|
|
|
|
this.dataCase = this.$parent.dataCase;
|
2021-01-21 20:48:51 +00:00
|
|
|
if (this.dataCase.ACTION === "jump") {
|
2020-12-10 17:37:02 +00:00
|
|
|
this.path =
|
2021-03-24 14:56:11 +00:00
|
|
|
window.config.SYS_SERVER_AJAX +
|
2020-12-10 17:37:02 +00:00
|
|
|
window.config.SYS_URI +
|
|
|
|
|
`cases/open?APP_NUMBER=${this.dataCase.APP_NUMBER}&action=${this.dataCase.ACTION}&actionFromList=${this.dataCase.ACTION_FROM_LIST}`;
|
|
|
|
|
} else {
|
|
|
|
|
this.path =
|
2021-03-24 14:56:11 +00:00
|
|
|
window.config.SYS_SERVER_AJAX +
|
2020-12-10 17:37:02 +00:00
|
|
|
window.config.SYS_URI +
|
2021-01-26 18:54:19 +00:00
|
|
|
`cases/open?APP_UID=${this.dataCase.APP_UID}&DEL_INDEX=${this.dataCase.DEL_INDEX}&TAS_UID=${this.dataCase.TAS_UID}&action=${this.dataCase.ACTION}`;
|
2020-12-10 17:37:02 +00:00
|
|
|
}
|
2021-10-02 18:20:36 -04:00
|
|
|
if (this.dataCase.UNASSIGNED === true) {
|
|
|
|
|
this.path =
|
|
|
|
|
window.config.SYS_SERVER_AJAX +
|
|
|
|
|
window.config.SYS_URI +
|
|
|
|
|
`cases/open?APP_UID=${this.dataCase.APP_UID}&DEL_INDEX=${this.dataCase.DEL_INDEX}&action=unassigned`;
|
|
|
|
|
}
|
2021-01-21 19:24:52 +00:00
|
|
|
|
|
|
|
|
setTimeout(() => {
|
2021-09-06 19:56:47 -04:00
|
|
|
let that = this;
|
|
|
|
|
if (this.dataCase.APP_UID) {
|
|
|
|
|
api.cases.debugStatus(this.dataCase)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.data) {
|
|
|
|
|
that.openDebug = true;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
that.openDebug = false;
|
|
|
|
|
});
|
|
|
|
|
}
|
2021-01-21 19:24:52 +00:00
|
|
|
}, 2000);
|
2021-03-12 16:58:52 +00:00
|
|
|
window.addEventListener("resize", this.handleIframeResize);
|
2020-12-04 13:33:23 +00:00
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
classBtn(cls) {
|
|
|
|
|
return "btn v-btn-request " + cls;
|
|
|
|
|
},
|
2021-01-28 19:05:33 +00:00
|
|
|
/**
|
|
|
|
|
* update view in component
|
|
|
|
|
*/
|
|
|
|
|
updateView(){
|
|
|
|
|
if(this.openDebug){
|
|
|
|
|
this.$refs["debugger"].loadData();
|
|
|
|
|
}
|
|
|
|
|
},
|
2021-01-21 19:24:52 +00:00
|
|
|
onLoadIframe() {},
|
2021-03-12 16:58:52 +00:00
|
|
|
/**
|
|
|
|
|
* Resize event Handler
|
|
|
|
|
* @param {object} e
|
|
|
|
|
*/
|
|
|
|
|
handleIframeResize(e) {
|
|
|
|
|
this.height = window.innerHeight - this.diffHeight;
|
|
|
|
|
}
|
2020-12-04 13:33:23 +00:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
2021-01-21 19:24:52 +00:00
|
|
|
.debugger-inline-cont {
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
2020-12-04 13:33:23 +00:00
|
|
|
</style>
|