优化输入框
This commit is contained in:
8
src/api/system/sysconf.js
Normal file
8
src/api/system/sysconf.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
export function getSysConfList() {
|
||||||
|
return request({
|
||||||
|
url: '/admin/sysConf/getList',
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
@@ -17,7 +17,7 @@
|
|||||||
<!-- search form (Optional) -->
|
<!-- search form (Optional) -->
|
||||||
<form method="get" class="sidebar-form" onsubmit="return false;">
|
<form method="get" class="sidebar-form" onsubmit="return false;">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" name="q" class="form-control" placeholder="Search...">
|
<input type="text" name="q" class="form-control" placeholder="Search..." @input="search">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button name="search" id="search-btn" class="btn btn-flat" @click="search">
|
<button name="search" id="search-btn" class="btn btn-flat" @click="search">
|
||||||
<i class="fa fa-search"></i>
|
<i class="fa fa-search"></i>
|
||||||
|
@@ -17,9 +17,6 @@
|
|||||||
<button id="sysConf-multiDel" class="btn btn-default">
|
<button id="sysConf-multiDel" class="btn btn-default">
|
||||||
<i class="glyphicon glyphicon-wrench"></i>批量删除
|
<i class="glyphicon glyphicon-wrench"></i>批量删除
|
||||||
</button>
|
</button>
|
||||||
<!--<button id="sysConf-load" class="btn btn-default">-->
|
|
||||||
<!--<i class="glyphicon glyphicon-wrench"></i>加载-->
|
|
||||||
<!--</button>-->
|
|
||||||
</div>
|
</div>
|
||||||
</section><!-- .content -->
|
</section><!-- .content -->
|
||||||
</div>
|
</div>
|
||||||
@@ -91,6 +88,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||||
|
import { getSysConfList } from '@/api/system/sysconf';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "SysconfAdminView",
|
name: "SysconfAdminView",
|
||||||
@@ -100,9 +98,15 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.$nextTick(function () {
|
this.$nextTick(function () {
|
||||||
this.initData();
|
this.initData();
|
||||||
|
this.getSysConf();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getSysConf() {
|
||||||
|
getSysConfList().then(res => {
|
||||||
|
$('#table').bootstrapTable('load', res.rows);
|
||||||
|
});
|
||||||
|
},
|
||||||
initData() {
|
initData() {
|
||||||
$(function () {
|
$(function () {
|
||||||
$('#table').bootstrapTable('destroy');
|
$('#table').bootstrapTable('destroy');
|
||||||
@@ -135,30 +139,13 @@ export default {
|
|||||||
cache: false,
|
cache: false,
|
||||||
striped: true,
|
striped: true,
|
||||||
showRefresh: true,
|
showRefresh: true,
|
||||||
pagination: false,
|
pageNumber: 1,
|
||||||
search: false,
|
pageSize: 10,
|
||||||
sidePagination: "server", //表示服务端请求
|
pagination: true,
|
||||||
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
pageList: [10, 25, 50, 100],
|
||||||
//设置为limit可以获取limit, offset, search, sort, order
|
search: true,
|
||||||
queryParamsType: "undefined",
|
sidePagination: "client",
|
||||||
queryParams: function queryParams(params) { //设置查询参数
|
toolbar: '#toolbar'
|
||||||
var param = {
|
|
||||||
pageNumber: params.pageNumber,
|
|
||||||
pageSize: params.pageSize,
|
|
||||||
searchText: params.searchText
|
|
||||||
};
|
|
||||||
return param;
|
|
||||||
},
|
|
||||||
toolbar: '#toolbar',
|
|
||||||
url: '/admin/sysConf/getList.action',
|
|
||||||
onLoadSuccess: function () { //加载成功时执行
|
|
||||||
console.log("load success");
|
|
||||||
$("#table").addClass("table_line");
|
|
||||||
$("td,th").addClass("td_center");
|
|
||||||
},
|
|
||||||
onLoadError: function () { //加载失败时执行
|
|
||||||
console.log("load fail");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#table").on("click", '.opt-remove', function () {
|
$("#table").on("click", '.opt-remove', function () {
|
||||||
@@ -179,6 +166,9 @@ export default {
|
|||||||
if (json.success == 'true') {
|
if (json.success == 'true') {
|
||||||
$("#tipMsg").text("删除成功");
|
$("#tipMsg").text("删除成功");
|
||||||
$("#tipModal").modal('show');
|
$("#tipModal").modal('show');
|
||||||
|
getSysConfList().then(res => {
|
||||||
|
$('#table').bootstrapTable('load', res.rows);
|
||||||
|
});
|
||||||
TableHelper.doRefresh("#table");
|
TableHelper.doRefresh("#table");
|
||||||
} else {
|
} else {
|
||||||
$("#tipMsg").text("删除失败");
|
$("#tipMsg").text("删除失败");
|
||||||
@@ -209,7 +199,6 @@ export default {
|
|||||||
idArr.push(rows[i]['configId']);
|
idArr.push(rows[i]['configId']);
|
||||||
}
|
}
|
||||||
console.log(idArr);
|
console.log(idArr);
|
||||||
|
|
||||||
if (confirm("你确认批量删除该记录吗?" +
|
if (confirm("你确认批量删除该记录吗?" +
|
||||||
"\r\n删除后再也不能找回,请谨慎操作!")) {
|
"\r\n删除后再也不能找回,请谨慎操作!")) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -221,6 +210,9 @@ export default {
|
|||||||
if (json.success == 'true') {
|
if (json.success == 'true') {
|
||||||
$("#tipMsg").text("删除成功");
|
$("#tipMsg").text("删除成功");
|
||||||
$("#tipModal").modal('show');
|
$("#tipModal").modal('show');
|
||||||
|
getSysConfList().then(res => {
|
||||||
|
$('#table').bootstrapTable('load', res.rows);
|
||||||
|
});
|
||||||
TableHelper.doRefresh("#table");
|
TableHelper.doRefresh("#table");
|
||||||
} else {
|
} else {
|
||||||
$("#tipMsg").text("删除失败");
|
$("#tipMsg").text("删除失败");
|
||||||
@@ -251,7 +243,6 @@ export default {
|
|||||||
$("#nameSpace").val(json.entity.nameSpace);
|
$("#nameSpace").val(json.entity.nameSpace);
|
||||||
var status = json.entity.configStatus - 1;
|
var status = json.entity.configStatus - 1;
|
||||||
$("input:radio[name='configStatus']")[status].checked = true;
|
$("input:radio[name='configStatus']")[status].checked = true;
|
||||||
|
|
||||||
// 打开编辑弹窗
|
// 打开编辑弹窗
|
||||||
$("#sysConfModal").modal('show');
|
$("#sysConfModal").modal('show');
|
||||||
} else {
|
} else {
|
||||||
@@ -274,6 +265,9 @@ export default {
|
|||||||
$("#sysConfModal").modal('hide');
|
$("#sysConfModal").modal('hide');
|
||||||
$("#tipMsg").text("保存成功");
|
$("#tipMsg").text("保存成功");
|
||||||
$("#tipModal").modal('show');
|
$("#tipModal").modal('show');
|
||||||
|
getSysConfList().then(res => {
|
||||||
|
$('#table').bootstrapTable('load', res.rows);
|
||||||
|
});
|
||||||
TableHelper.doRefresh("#table");
|
TableHelper.doRefresh("#table");
|
||||||
} else {
|
} else {
|
||||||
$("#tipMsg").text("保存失败");
|
$("#tipMsg").text("保存失败");
|
||||||
@@ -284,25 +278,6 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// $("#sysConf-load").click(function(){
|
|
||||||
// $.ajax({
|
|
||||||
// type: 'post',
|
|
||||||
// url: "/admin/sysConf/loadList.action",
|
|
||||||
// dataType: "json",
|
|
||||||
// success: function (json) {
|
|
||||||
// if(json.success == 'true')
|
|
||||||
// {
|
|
||||||
// $("#tipMsg").text("删除成功");
|
|
||||||
// $("#tipModal").modal('show');
|
|
||||||
// TableHelper.doRefresh("#table");
|
|
||||||
// } else {
|
|
||||||
// $("#tipMsg").text("删除失败");
|
|
||||||
// $("#tipModal").modal('show');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -323,4 +298,5 @@ export default {
|
|||||||
|
|
||||||
.td_center {
|
.td_center {
|
||||||
vertical-align: middle !important;
|
vertical-align: middle !important;
|
||||||
}</style>
|
}
|
||||||
|
</style>
|
Reference in New Issue
Block a user