Commit 50ddf91f by fengshuonan

修改部门管理

parent c56b9d96
...@@ -164,6 +164,7 @@ ...@@ -164,6 +164,7 @@
@} @}
@if(array.contain(plugins,"bootstrap-treetable")){ @if(array.contain(plugins,"bootstrap-treetable")){
<script src="${ctxPath}/assets/common/plugins/bootstrap-treetable/bootstrap-treetable.min.js"></script> <script src="${ctxPath}/assets/common/plugins/bootstrap-treetable/bootstrap-treetable.min.js"></script>
<script src="${ctxPath}/assets/common/plugins/bootstrap-treetable/bootstrap-treetable-object.js"></script>
@} @}
@} @}
......
@layout("/common/_container.html"){ @layout("/common/_container.html",{plugins:["table","layer","bootstrap-treetable"],js:["/assets/modular/system/dept/dept.js"]}){
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-12" id="deptPage">
<div class="ibox float-e-margins"> <div class="row">
<div class="ibox-title"> <div class="col-lg-12">
<h5>部门管理</h5> <div class="card card-outline-theme m-b-10">
</div> <div class="card-body">
<div class="ibox-content"> <div class="form-horizontal">
<div class="row row-lg"> <div class="form-body">
<div class="col-sm-12"> <div class="row">
<div class="row"> <div class="col-md-3">
<div class="col-sm-3"> <div class="input-group">
<#NameCon id="condition" name="名称" /> <div class="input-group-prepend">
</div> <div class="input-group-text">部门名称</div>
<div class="col-sm-3"> </div>
<#button name="搜索" icon="fa-search" clickFun="Dept.search()"/> <input v-model="name" type="text" class="form-control" placeholder="" autocomplete="off">
</div>
</div>
<div class="col-md-3">
<div class="input-group condition-button">
<div class="input-group-btn condition-button">
<button type="button" id="check-minutes"
class="btn btn-info waves-effect waves-light condition-button-width" onclick="Dept.search()">查询
</button>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
<div class="hidden-xs" id="DeptTableToolbar" role="group"> </div>
@if(shiro.hasPermission("/dept/add")){ </div>
<#button name="添加" icon="fa-plus" clickFun="Dept.openAddDept()"/> </div>
@} </div>
@if(shiro.hasPermission("/dept/update")){ <div class="row">
<#button name="修改" icon="fa-plus" clickFun="Dept.openDeptDetail()" space="true"/> <div class="col-lg-12">
@} <div class="card card-outline-theme m-b-0">
@if(shiro.hasPermission("/dept/delete")){ <div class="card-body p-t-0 p-b-0">
<#button name="删除" icon="fa-plus" clickFun="Dept.delete()" space="true"/> <div class="form-horizontal">
@} <div class="form-actions">
<div class="row">
<div class="col-lg-12">
<div class="card m-b-0 p-b-0">
<div class="hidden-xs" id="managerTableToolbar" role="group">
@if(shiro.hasPermission("/dept/add")){
<button type="button" class="btn btn-primary waves-effect m-l-5" onclick="Dept.openAddDept()">
<i class="fa fa-check-circle"></i>&nbsp;添加
</button>
@}
@if(shiro.hasPermission("/dept/update")){
<button type="button" class="btn btn-primary waves-effect m-l-5" onclick="Dept.openDeptDetail()">
<i class="fa fa-check-circle"></i>&nbsp;修改
</button>
@}
@if(shiro.hasPermission("/dept/delete")){
<button type="button" class="btn btn-primary waves-effect m-l-5" onclick="Dept.delete()">
<i class="fa fa-check-circle"></i>&nbsp;删除
</button>
@}
</div>
<#table id="DeptTable"/>
</div>
</div>
</div>
</div>
</div> </div>
<#table id="DeptTable"/>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<script src="${ctxPath}/static/modular/system/dept/dept.js"></script>
@} @}
...@@ -5,7 +5,10 @@ var Dept = { ...@@ -5,7 +5,10 @@ var Dept = {
id: "DeptTable", //表格id id: "DeptTable", //表格id
seItem: null, //选中的条目 seItem: null, //选中的条目
table: null, table: null,
layerIndex: -1 layerIndex: -1,
condition: {
name: ''
}
}; };
/** /**
...@@ -14,7 +17,7 @@ var Dept = { ...@@ -14,7 +17,7 @@ var Dept = {
Dept.initColumn = function () { Dept.initColumn = function () {
return [ return [
{field: 'selectItem', radio: true}, {field: 'selectItem', radio: true},
{title: 'id', field: 'id', align: 'center', valign: 'middle',width:'50px'}, {title: 'id', field: 'id', align: 'center', valign: 'middle', width: '50px'},
{title: '部门简称', field: 'simplename', align: 'center', valign: 'middle', sortable: true}, {title: '部门简称', field: 'simplename', align: 'center', valign: 'middle', sortable: true},
{title: '部门全称', field: 'fullname', align: 'center', valign: 'middle', sortable: true}, {title: '部门全称', field: 'fullname', align: 'center', valign: 'middle', sortable: true},
{title: '排序', field: 'num', align: 'center', valign: 'middle', sortable: true}, {title: '排序', field: 'num', align: 'center', valign: 'middle', sortable: true},
...@@ -26,10 +29,10 @@ Dept.initColumn = function () { ...@@ -26,10 +29,10 @@ Dept.initColumn = function () {
*/ */
Dept.check = function () { Dept.check = function () {
var selected = $('#' + this.id).bootstrapTreeTable('getSelections'); var selected = $('#' + this.id).bootstrapTreeTable('getSelections');
if(selected.length == 0){ if (selected.length == 0) {
Feng.info("请先选中表格中的某一记录!"); Feng.info("请先选中表格中的某一记录!");
return false; return false;
}else{ } else {
Dept.seItem = selected[0]; Dept.seItem = selected[0];
return true; return true;
} }
...@@ -73,14 +76,14 @@ Dept.openDeptDetail = function () { ...@@ -73,14 +76,14 @@ Dept.openDeptDetail = function () {
Dept.delete = function () { Dept.delete = function () {
if (this.check()) { if (this.check()) {
var operation = function(){ var operation = function () {
var ajax = new $ax(Feng.ctxPath + "/dept/delete", function () { var ajax = new $ax(Feng.ctxPath + "/dept/delete", function () {
Feng.success("删除成功!"); Feng.success("删除成功!");
Dept.table.refresh(); Dept.table.refresh();
}, function (data) { }, function (data) {
Feng.error("删除失败!" + data.responseJSON.message + "!"); Feng.error("删除失败!" + data.responseJSON.message + "!");
}); });
ajax.set("deptId",Dept.seItem.id); ajax.set("deptId", Dept.seItem.id);
ajax.start(); ajax.start();
}; };
...@@ -98,13 +101,19 @@ Dept.search = function () { ...@@ -98,13 +101,19 @@ Dept.search = function () {
}; };
$(function () { $(function () {
Dept.app = new Vue({
el: '#deptPage',
data: Dept.condition
});
var defaultColunms = Dept.initColumn(); var defaultColunms = Dept.initColumn();
var table = new BSTreeTable(Dept.id, "/dept/list", defaultColunms); var table = new BSTreeTable('DeptTable', "/dept/list", defaultColunms);
table.setExpandColumn(2); table.setExpandColumn(2);
table.setIdField("id"); table.setIdField("id");
table.setCodeField("id"); table.setCodeField("id");
table.setParentCodeField("pid"); table.setParentCodeField("pid");
table.setExpandAll(true); table.setExpandAll(true);
table.init(); table.init();
Dept.table = table; Dept.table = table.init();
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment