<!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 ListVue({
|
el: "#vbody",
|
data: {
|
dataname: "sys_interface_log",
|
title: "接口日志",
|
orderby: "create_time desc",
|
|
filterAttr: {
|
columnnumber: 3,
|
labelwidth: "100px",
|
labelposition: "right",
|
size: "medium",
|
border: "3px solid #c6c6c600"
|
},
|
|
filterFields: [
|
{isshow: "T", field: "create_time", name: "调用时间", inputtype: "date", type: "daterange"},
|
],
|
|
tableFields: [
|
{isshow: "T", field: "interface_name", name: "名称", width: "150"},
|
{isshow: "T", field: "interface_source", name: "来源"},
|
{isshow: "T", field: "start_time", name: "开始时间", width: "150"},/* , formatter: "formatter_date" */
|
{isshow: "T", field: "end_time", name: "结束时间", width: "150"},/* , formatter: "formatter_date" */
|
{isshow: "T", field: "call_name", name: "调用人"},
|
{isshow: "T", field: "create_time", name: "调用时间", width: "150"},
|
{isshow: "T", field: "request", name: "请求内容"},
|
{isshow: "T", field: "return", name: "返回内容"},
|
],
|
|
filterfieldClick: {},
|
tablefieldClick: {},
|
formfieldClick: {},
|
|
},
|
|
created() {
|
this.popupParames = clone(Root.popupParames);
|
|
if (this.popupParames.data) {
|
this.filterTxt = "interface_id ='" + this.popupParames.data.id +"'";
|
}
|
},
|
|
mounted() {
|
//获取数据
|
this.initData();
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
hideLoading();
|
});
|
},
|
|
methods:{
|
//关闭弹窗
|
closeDialog() {
|
this.docloseDialog(true);
|
},
|
|
//关闭前调回调
|
saveAfter() {
|
var me = this;
|
if(this.popupParames.callback) {
|
let obj = {
|
row: clone(this.selectedrow)
|
}
|
this.popupParames.callback(obj, function() {
|
me.docloseDialog();
|
});
|
}
|
else {
|
me.docloseDialog();
|
}
|
},
|
|
initData() {
|
var me = this;
|
|
this.onQuery(function(result, callback) {//查询后的回调,用于获取字段的
|
if (result.meta && result.meta[me.dataname] && result.meta[me.dataname].fields) {
|
var metas = clone(result.meta[me.dataname].fields);
|
var filterFields_ = [];
|
var tableFields_ = [];
|
|
metas.map(f=>{
|
f.isshow = "T";
|
|
if (f.isfilter) {
|
filterFields_.push(clone(f));
|
}
|
else {
|
var filter_f = clone(f);
|
filter_f.isshow = "F";
|
filterFields_.push(filter_f);
|
}
|
|
tableFields_.push(clone(f));
|
})
|
if (!me.filterFields || (me.filterFields && me.filterFields.length == 0)) {
|
me.filterFields = clone(filterFields_);
|
me.tableFields = clone(tableFields_);
|
}
|
}
|
|
//字段数组转字段obj,目的为了筛选时获取字段属性
|
me.fieldsToFieldsObj();
|
|
//设置字段事件
|
me.tableFieldClick();
|
|
if (callback) {
|
callback();
|
}
|
});
|
},
|
|
tableFieldClick() {
|
var me = this;
|
//筛选字段事件设置
|
this.filterfieldClick = {
|
|
};
|
|
//表格字段事件设置
|
this.tablefieldClick = {
|
request: { //字段事件设置
|
defaultval: {
|
val: "查看",//空值时的显示值
|
onclick: function(obj) {//默认值点击事件,此事件需要设置val才有效
|
//查看详情
|
me.showInfo_request(obj);
|
}
|
},
|
},
|
|
return: { //字段事件设置
|
defaultval: {
|
val: "查看",//空值时的显示值
|
onclick: function(obj) {//默认值点击事件,此事件需要设置val才有效
|
//查看详情
|
me.showInfo_return(obj);
|
}
|
},
|
},
|
};
|
|
},
|
|
showInfo_request(obj){
|
var me = this;
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "新页面",
|
id: "new_window",//totab: true时需设置,用于判断是否已打开此页面
|
url: "module/system/page/sample/new_window.html",
|
data: {},
|
delta: {
|
uel: window.top.config.url_root + 'root/interface/getFile?token=' + Root.getToken() + '&id=' + obj.row.id +'&type=out'
|
},
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
|
// window.open(window.top.config.url_root + 'root/interface/getFile?token=admin&id=' + obj.row.id +'&type=out');
|
},
|
|
showInfo_return(obj){
|
var me = this;
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "新页面",
|
id: "new_window",//totab: true时需设置,用于判断是否已打开此页面
|
url: "module/system/page/sample/new_window.html",
|
data: {},
|
delta: {
|
uel: window.top.config.url_root + 'root/interface/getFile?token=' + Root.getToken() + '&id=' + obj.row.id +'&type=in'
|
},
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
|
// window.open(window.top.config.url_root + 'root/interface/getFile?token=admin&id=' + obj.row.id +'&type=in');
|
},
|
}
|
});
|
};
|
|
loadJsCss(function () {
|
initVue();
|
});
|
</script>
|
<style>
|
/* 在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
|
[v-cloak] {
|
display: none !important;
|
}
|
</style>
|
|
</head>
|
|
<body style="margin: 0px;">
|
<div v-cloak id="vbody">
|
<div id="page_root">
|
<div ref="popup_body" style="padding: 0 20px;">
|
<!-- 标题 -->
|
<div class="el-dialog__header">
|
<div class="dialog-title">
|
<i class="iconfont icon-customermanagement"></i>
|
<span>{{title}}</span>
|
</div>
|
</div>
|
<!-- 主体 -->
|
<div class="topbar-line">
|
<div class="query-bar">
|
<h-form-filter ref="form1"
|
:form-attr="filterAttr"
|
:table-fields="filterFields"
|
:form-data="filterObj"
|
:table-field-click="filterfieldClick"
|
|
v-on:on-query="onQuery"
|
v-on:on-init-query="onInitFilter">
|
</h-form-filter>
|
</div>
|
</div>
|
|
<div class="h_dialog__body">
|
<h-table
|
v-if="isRefresh"
|
ref="table1"
|
:table-fields="tableFields"
|
:table-data="tableData"
|
:pagesize="pagesize"
|
:pagenum="pagenum"
|
:total="total"
|
:table-height="tableHeight"
|
:table-field-click="tablefieldClick"
|
:is-highlight-row="isedit"
|
|
v-on:get-data="getData"
|
v-on:row-click="rowClick"
|
v-on:row-dblclick="rowDblclick">
|
</h-table>
|
</div>
|
|
<!-- 底部工具栏 -->
|
<div class="el-dialog__footer">
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
</div>
|
</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>
|
|
</body>
|
</html>
|