<!doctype html>
|
<html>
|
<head>
|
<meta charset="utf-8"><meta http-equiv="Expires" content="0"><meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-control" content="no-cache"><meta http-equiv="Cache" content="no-cache">
|
<title>请求错误信息显示</title>
|
|
<script type="text/javascript">
|
var pageVue = null;
|
function loadJsCss(callback) {
|
var jscss_urls = [];
|
window.top.initJsCss(document, jscss_urls, callback);
|
};
|
|
function initVue() {
|
new BasicsVue({
|
el: "#vbody",
|
data: {
|
title: "错误信息",
|
listData: [],
|
|
islong: false,
|
short_height: 200,
|
long_height: 500,
|
tableFields: [],
|
tableData: [],
|
|
},
|
created() {
|
this.popupParames = clone(Root.popupParames);
|
this.title = this.popupParames.title || this.popupParames.text;
|
if (this.popupParames.delta) {
|
this.listData = clone(this.popupParames.delta);
|
}
|
|
if (this.popupParames.data) {
|
if (this.popupParames.data.error_attr) {
|
this.tableFields = clone(this.popupParames.data.tableFields);
|
this.tableData = clone(this.popupParames.data.tableData);
|
}
|
}
|
},
|
|
mounted() {
|
var me = this;
|
|
this.initData();
|
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
hideLoading();
|
|
//重新设置弹窗宽高
|
this.$nextTick(function(){
|
//let w_ = this.$refs.popup_body.offsetWidth + "px";
|
let w_ = "900px";
|
let h_ = this.$refs.popup_body.offsetHeight + "px";
|
Root.setPopupWH(w_, h_);
|
})
|
});
|
},
|
|
methods:{
|
closeDialog() {
|
var me = this;
|
if (me.popupParames.totab){
|
Root.tab.removeItem(Root.tab.selected);
|
Root.tab.open(me.popupParames.parentOption, false);
|
}
|
else {
|
Root.hidePopup();
|
}
|
},
|
saveAfter() {//调回调的关闭
|
var me = this;
|
if(this.popupParames.callback) {
|
let obj = {}
|
this.popupParames.callback(obj, function() {
|
me.closeDialog();
|
});
|
}
|
else {
|
me.closeDialog();
|
}
|
},
|
|
showDetail() {
|
this.islong = !this.islong;
|
this.$nextTick(function(){
|
//let w_ = this.$refs.popup_body.offsetWidth + "px";
|
let w_ = "900px";
|
let h_ = this.$refs.popup_body.offsetHeight + "px";
|
Root.setPopupWH(w_, h_);
|
})
|
},
|
|
initData() {
|
let me = this;
|
|
},
|
|
}
|
});
|
};
|
|
loadJsCss(function () {
|
initVue();
|
});
|
</script>
|
<style>
|
/* 在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
|
[v-cloak] {
|
display: none !important;
|
}
|
html {
|
overflow: hidden;
|
}
|
.errorspan {
|
color: red;
|
}
|
.alertspan {
|
color: #ffff00;
|
}
|
</style>
|
|
</head>
|
|
<body style="margin: 0px;">
|
<div v-cloak id="vbody">
|
<div id="page_root">
|
<div ref="popup_body" style="padding: 0px 20px;">
|
<div class="popup_el-dialog__header">
|
<div class="dialog-title">
|
<i class="iconfont icon-customermanagement"></i>
|
<span> {{title}} </span>
|
</div>
|
</div>
|
<div :style="{height: (islong ? long_height : short_height) + 'px'} ">
|
<div v-if="!islong" :style="{height: short_height + 'px', 'overflow-y': 'auto'}">
|
<div v-for="(messages, key) in listData" :key="key">
|
<i v-if="messages.level == 'Error'" class="errorspan">{{messages.message}}</i>
|
<i v-if="messages.level == 'Alert'" class="alertspan">{{messages.message}}</i>
|
</div>
|
|
<div class="h_dialog__body" v-if="tableFields.length && tableData.length">
|
<h-table
|
ref="table1"
|
:table-fields="tableFields"
|
:table-data="tableData"
|
|
:table-height="200"
|
:isdraggableorder="false"
|
:isfilterfield="false"
|
:is-pagination="false"
|
>
|
</h-table>
|
</div>
|
</div>
|
<div v-else-if="islong" :style="{height: long_height + 'px', 'overflow-y': 'auto'}">
|
<div v-for="(messages, key) in listData" :key="key" :class="[messages.level == 'Error' ? 'errorspan' : messages.level == 'Alert' ? 'alertspan' : 'infospan']">
|
<i>{{messages.step}}:</i>
|
<i>{{messages.message}}</i>
|
</div>
|
|
<div class="h_dialog__body" v-if="tableFields.length && tableData.length">
|
<h-table
|
ref="table1"
|
:table-fields="tableFields"
|
:table-data="tableData"
|
|
:table-height="200"
|
:isdraggableorder="false"
|
:isfilterfield="false"
|
:is-pagination="false"
|
>
|
</h-table>
|
</div>
|
</div>
|
|
|
|
</div>
|
<div class="el-dialog__footer">
|
<el-button size="small" type="" @click="showDetail">{{islong ? "简 要" : "详 情"}}</el-button>
|
<el-button size="small" type="default" @click="closeDialog">关 闭</el-button>
|
</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>
|
|
</body>
|
</html>
|