单独页面配置,更加方便,逻辑更清晰
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>调试数据管理</title>
|
||||
<link rel="stylesheet" type="text/css" href="../zui/css/zui.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
调试数据管理
|
||||
</div>
|
||||
</body>
|
||||
<script src="../zui/js/zui.min.js"></script>
|
||||
<script src="../mg-ui/js/jquery-3.1.0.min.js"></script>
|
||||
<script src="../vue/vue.js"></script>
|
||||
|
||||
<script>
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
userId: "",
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
@@ -9,27 +9,129 @@
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
文档展示配置
|
||||
<table class="table table-bordered setting-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 150px;">参数名</td>
|
||||
<td style="width: 300px;">参数值</td>
|
||||
<td>说明</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="info">目录展示方式</td>
|
||||
<td>
|
||||
<label><input type="radio" name="catalogShowType" value="1" v-model="catalogShowType">分路径展示</label>
|
||||
<label><input type="radio" name="catalogShowType" value="2" v-model="catalogShowType">分标签展示</label>
|
||||
</td>
|
||||
<td>分路径:/api/data/getDataList 分标签:/api└/data└/getDateList└post└get</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">树形菜单展示方式</td>
|
||||
<td>
|
||||
<label><input type="radio" name="treeShowType" value="1" v-model="treeShowType">直角</label>
|
||||
<label><input type="radio" name="treeShowType" value="2" v-model="treeShowType">导航</label>
|
||||
<label><input type="radio" name="treeShowType" value="3" v-model="treeShowType">加减</label>
|
||||
<label><input type="radio" name="treeShowType" value="4" v-model="treeShowType">文件夹</label>
|
||||
<label><input type="radio" name="treeShowType" value="5" v-model="treeShowType">V型</label>
|
||||
</td>
|
||||
<td>请自行修改体验</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">是否展示字段的类型</td>
|
||||
<td>
|
||||
<label><input type="radio" name="showParamType" value="1" v-model="showParamType">是</label>
|
||||
<label><input type="radio" name="showParamType" value="0" v-model="showParamType">否</label>
|
||||
</td>
|
||||
<td>文档中是否展示类型:"reference": "(boolean)"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">仅使用上次请求参数</td>
|
||||
<td>
|
||||
<label><input type="radio" name="onlyUseLastParam" value="1" v-model="onlyUseLastParam">是</label>
|
||||
<label><input type="radio" name="onlyUseLastParam" value="0" v-model="onlyUseLastParam">否</label>
|
||||
</td>
|
||||
<td>每个接口都使用最后一次请求的header、form、body参数,参数列表有但上一次请求没有使用的则不会展示在请求参数里面,从未请求过则展示所有参数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">自动填充请求参数</td>
|
||||
<td>
|
||||
<label><input type="radio" name="autoFillParam" value="0" v-model="autoFillParam">否</label>
|
||||
<label><input type="radio" name="autoFillParam" value="1" v-model="autoFillParam">智能填充</label>
|
||||
<label><input type="radio" name="autoFillParam" value="2" v-model="autoFillParam">全部填充</label>
|
||||
</td>
|
||||
<td>否:不填充,智能填充:只填充flag、time等后缀的参数,全部填充:对应不上类型的使用“我是默认字符串”填充</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
<script src="../zui/js/zui.min.js"></script>
|
||||
<script src="../mg-ui/js/jquery-3.1.0.min.js"></script>
|
||||
<script src="../zui/js/zui.min.js"></script>
|
||||
<script src="../mg-ui/js/common.js"></script>
|
||||
<script src="../vue/vue.js"></script>
|
||||
|
||||
<script>
|
||||
var urlBase = "../../";
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
userId: "",
|
||||
catalogShowType: '',
|
||||
treeShowType: '',
|
||||
showParamType:'',
|
||||
onlyUseLastParam: '',
|
||||
autoFillParam: '',
|
||||
userSettings: {}
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
mounted: function(){
|
||||
getStorage('userSettings', function(data){
|
||||
app.userSettings = data;
|
||||
app.catalogShowType = data.catalogShowType;
|
||||
app.treeShowType = data.treeShowType;
|
||||
app.showParamType = data.showParamType;
|
||||
app.onlyUseLastParam = data.onlyUseLastParam;
|
||||
app.autoFillParam = data.autoFillParam;
|
||||
});
|
||||
},
|
||||
watch: {
|
||||
catalogShowType: function(newVal, oldval){
|
||||
app.userSettings.catalogShowType = newVal;
|
||||
storeUserSettings();
|
||||
window.parent.window.regeneratePathTree();
|
||||
},
|
||||
treeShowType: function(newVal, oldval){
|
||||
app.userSettings.treeShowType = newVal;
|
||||
storeUserSettings();
|
||||
window.parent.window.updateTreeShowType();
|
||||
},
|
||||
showParamType: function(newVal, oldval){
|
||||
app.userSettings.showParamType = newVal;
|
||||
storeUserSettings();
|
||||
},
|
||||
onlyUseLastParam: function(newVal, oldval){
|
||||
app.userSettings.onlyUseLastParam = newVal;
|
||||
storeUserSettings();
|
||||
},
|
||||
autoFillParam: function(newVal, oldval){
|
||||
app.userSettings.autoFillParam = newVal;
|
||||
storeUserSettings();
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
// 存储用户的配置信息
|
||||
function storeUserSettings(){
|
||||
setStorage('userSettings', app.userSettings, function(){
|
||||
window.parent.window.updateUserSettings(app.userSettings);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
#app{padding-top: 10px;}
|
||||
</style>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>文档地址管理</title>
|
||||
<link rel="stylesheet" type="text/css" href="../zui/css/zui.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<table class="table table-bordered setting-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 50px;">序号</td>
|
||||
<td>地址</td>
|
||||
<td>操作</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item,index) in swaggerResourcesList" :key="item.id" :data-id="item.id" :data-index="index" >
|
||||
<td>{{index+1}}</td>
|
||||
<td>{{item}}</td>
|
||||
<td>
|
||||
<button class="btn btn-danger" type="button" v-on:click="deleteDocUrl($event)">删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" align="center">
|
||||
<button class="btn" type="button" v-on:click="btnRefreshList"> 刷新 </button>
|
||||
<button class="btn btn-info" type="button" v-on:click="exportDocument">导出文档</button>
|
||||
<button class="btn btn-primary" type="button" v-on:click="addNewDocument">增加文档</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- 增加文档弹出框 -->
|
||||
<div class="modal fade" id="addNewDocumentModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
|
||||
</button>
|
||||
<h4 class="modal-title">输入文档地址</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input v-model="addNewDocumentInput" type="text" class="form-control" placeholder="例:http://192.168.0.172/swagger-resources">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" v-on:click="addNewDocumentBtn">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="../mg-ui/js/jquery-3.1.0.min.js"></script>
|
||||
<script src="../zui/js/zui.min.js"></script>
|
||||
<script src="../mg-ui/js/common.js"></script>
|
||||
<script src="../vue/vue.js"></script>
|
||||
<script src="../mg-ui/js/toast.js"></script>
|
||||
|
||||
<script>
|
||||
var urlBase = "../../";
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
swaggerResourcesList: [],
|
||||
addNewDocumentInput: ''
|
||||
},
|
||||
methods: {
|
||||
btnRefreshList: function(){
|
||||
this.refreshList();
|
||||
Toast.success("刷新成功!");
|
||||
},
|
||||
refreshList: function(){
|
||||
getStorage('swagger-resources-list', function(data){
|
||||
//console.log(data);
|
||||
app.swaggerResourcesList = data;
|
||||
});
|
||||
},
|
||||
addNewDocument: function(){
|
||||
app.addNewDocumentInput = '';
|
||||
$('#addNewDocumentModal').modal({moveable:true});
|
||||
},
|
||||
addNewDocumentBtn: function(){
|
||||
var addNewDocumentInput = app.addNewDocumentInput;
|
||||
if(isEmpty(addNewDocumentInput)) {
|
||||
Toast.error("地址不可以为空");return;
|
||||
}
|
||||
ajaxTemp(urlBase + "swagger-mg-ui/document/addSwaggerResources", "post", "json", {resourcesUrl: addNewDocumentInput}, function(json){
|
||||
if(validateResult(json)) {
|
||||
//window.parent.document.location.reload();
|
||||
app.swaggerResourcesList.push(addNewDocumentInput);
|
||||
$('#addNewDocumentModal').modal('hide');
|
||||
Toast.success("保存成功,刷新后生效!");
|
||||
}
|
||||
});
|
||||
},
|
||||
exportDocument: function(){
|
||||
window.parent.window.exportDocument();
|
||||
},
|
||||
deleteDocUrl: function(event){
|
||||
if(!confirm("确定要删除吗?")) {
|
||||
return;
|
||||
}
|
||||
var tr = $(event.currentTarget).parents("tr");
|
||||
var index = tr.data("index");
|
||||
var newDocList = [];
|
||||
for(var i=0;i<app.swaggerResourcesList.length;i++){
|
||||
if(i != index) {
|
||||
newDocList.push(app.swaggerResourcesList[i]);
|
||||
}
|
||||
}
|
||||
setStorage('swagger-resources-list', newDocList, function(data){
|
||||
app.swaggerResourcesList = newDocList;
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted: function(){
|
||||
this.refreshList();
|
||||
},
|
||||
watch: {
|
||||
catalogShowType: function(newVal, oldval){
|
||||
app.userSettings.catalogShowType = newVal;
|
||||
storeUserSettings();
|
||||
window.parent.window.regeneratePathTree();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#app{padding-top: 10px;}
|
||||
</style>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>全局参数管理</title>
|
||||
<link rel="stylesheet" type="text/css" href="../zui/css/zui.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
全局参数管理
|
||||
</div>
|
||||
</body>
|
||||
<script src="../zui/js/zui.min.js"></script>
|
||||
<script src="../mg-ui/js/jquery-3.1.0.min.js"></script>
|
||||
<script src="../vue/vue.js"></script>
|
||||
|
||||
<script>
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
userId: "",
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user