debug参数展示,基本功能开发
This commit is contained in:
@@ -77,6 +77,7 @@
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
initCount: 5,
|
||||
catalogShowType: '',
|
||||
treeShowType: '',
|
||||
showParamType:'',
|
||||
@@ -122,12 +123,14 @@
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 存储用户的配置信息
|
||||
function storeUserSettings(){
|
||||
setStorage(cacheKeys.userSettings, app.userSettings, function(){
|
||||
getExport().updateUserSettings(app.userSettings);
|
||||
});
|
||||
function storeUserSettings() {
|
||||
if (app.initCount-- <= 0) {
|
||||
setStorage(cacheKeys.userSettings, app.userSettings, function () {
|
||||
getExport().updateUserSettings(app.userSettings);
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<html xmlns:v-on="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
@@ -14,15 +14,18 @@
|
||||
<tr>
|
||||
<td style="width: 50px;">序号</td>
|
||||
<td>地址</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>{{item.url}}</td>
|
||||
<td>{{item.lastSync}}</td>
|
||||
<td>
|
||||
<button class="btn btn-danger" type="button" v-on:click="deleteDocUrl($event)">删除</button>
|
||||
<!--<button class="btn btn-danger" type="button" v-on:click="syncDocData($event)">持久化</button>-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -93,7 +96,8 @@
|
||||
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);
|
||||
//app.swaggerResourcesList.push(addNewDocumentInput);
|
||||
app.refreshList();
|
||||
$('#addNewDocumentModal').modal('hide');
|
||||
Toast.success("保存成功,刷新后生效!");
|
||||
}
|
||||
@@ -117,6 +121,17 @@
|
||||
setStorage(cacheKeys.swaggerResourcesList, newDocList, function(){
|
||||
app.swaggerResourcesList = newDocList;
|
||||
});
|
||||
},
|
||||
syncDocData: function(event){
|
||||
var tr = $(event.currentTarget).parents("tr");
|
||||
var index = tr.data("index");
|
||||
var newDocUrl = app.swaggerResourcesList[index].url;
|
||||
ajaxTemp(urlBase + "swagger-mg-ui/document/syncDocData", "post", "json", {resourcesUrl: newDocUrl}, function(json){
|
||||
if(validateResult(json)) {
|
||||
app.refreshList();
|
||||
Toast.success("持久化成功!");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted: function(){
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<tbody>
|
||||
<tr v-for="(item,index) in globalParamList" :key="item.id" :data-id="item.id" :data-index="index">
|
||||
<td>
|
||||
<select class="form-control" v-model:value="item.position">
|
||||
<select class="form-control" v-model:value="item.paramIn">
|
||||
<option value="header">header</option>
|
||||
<option value="form">form</option>
|
||||
</select>
|
||||
@@ -81,11 +81,12 @@
|
||||
},
|
||||
addGlobalParamLine: function () {
|
||||
app.globalParamList.push({
|
||||
position: 'header', key: '', value: ''
|
||||
paramIn: 'header', key: '', value: ''
|
||||
});
|
||||
},
|
||||
saveAllGlobalParam: function () {
|
||||
setStorage(cacheKeys.globalParamList, app.globalParamList, function(){
|
||||
getExport().updateGlobalParam(app.globalParamList);
|
||||
Toast.success("保存成功!");
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user