Commit 9d2c761c by fsn

部门管理改为树形

parent fa741273
...@@ -15,7 +15,6 @@ Dept.initColumn = function () { ...@@ -15,7 +15,6 @@ Dept.initColumn = function () {
return [ return [
{field: 'selectItem', radio: true}, {field: 'selectItem', radio: true},
{title: 'id', field: 'id', align: 'center', valign: 'middle'}, {title: 'id', field: 'id', align: 'center', valign: 'middle'},
{title: '父级部门', field: 'pName', align: 'center', valign: 'middle', sortable: true},
{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,7 +25,7 @@ Dept.initColumn = function () { ...@@ -26,7 +25,7 @@ Dept.initColumn = function () {
* 检查是否选中 * 检查是否选中
*/ */
Dept.check = function () { Dept.check = function () {
var selected = $('#' + this.id).bootstrapTable('getSelections'); var selected = $('#' + this.id).treegridData('getSelections');
if(selected.length == 0){ if(selected.length == 0){
Feng.info("请先选中表格中的某一记录!"); Feng.info("请先选中表格中的某一记录!");
return false; return false;
...@@ -95,7 +94,12 @@ Dept.search = function () { ...@@ -95,7 +94,12 @@ Dept.search = function () {
$(function () { $(function () {
var defaultColunms = Dept.initColumn(); var defaultColunms = Dept.initColumn();
var table = new BSTable(Dept.id, "/dept/list", defaultColunms); var table = new BSTreeTable(Dept.id, "/dept/list", defaultColunms);
table.setPaginationType("client"); table.setExpandColumn(2);
Dept.table = table.init(); table.setIdField("id");
table.setCodeField("id");
table.setParentCodeField("pid");
table.setExpandAll(true);
table.init();
Dept.table = table;
}); });
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