123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- define(function (require) {
- return function (context) {
- var $tree1;
- return {
- center: {
- border: false,
- items: {
- xtype: 'yvtreegrid',
- onRender: function () {
- $tree1 = $(this);
- },
- autoSizeColumns: false,
- idField: 'menuId',
- checkbox: true,
- keyDataField: 'menuId',
- parentDataField: 'parentId',
- onRowClick: function () {
- console.log('onRowClick', this, arguments);
- },
- onRowSelect: function () {
- console.log('onRowSelect', this, arguments);
- },
- onRowCheck: function () {
- console.log('onRowCheck', this, arguments);
- },
- toolbar: {
- xtype: 'toolbar', title: '系统字典详情',
- items: [
- {
- text: '查询',
- onClick: function () {
- $.yvan.ajax({
- url: ('/api/menu/queryMenu'),
- success: function (root) {
- $tree1.yvtreegrid('reload', {
- data: root.data
- });
- }
- });
- }
- },
- {
- text: 'selectRow',
- iconCls: 'fa fa-search',
- onClick: function () {
- console.log('getSelected', $tree1.yvtreegrid('getSelected'));
- }
- },
- {
- text: 'getCheckedRows',
- iconCls: 'fa fa-search',
- onClick: function () {
- console.log('getCheckedRows', $tree1.yvtreegrid('getCheckedRows'));
- }
- }
- ]
- },
- columns: [[
- {field: 'menuName', title: '菜单名称', width: 200},
- {field: 'menuId', title: '菜单编号', width: 100},
- {
- field: 'menuIcon', title: '图标', width: 40, formatter: function (v) {
- return "<i class='" + v + "'></i>";
- }
- },
- {
- field: 'menuType',
- title: '菜单类型',
- width: 100,
- formatter: [{id: 'ent', text: '企业'}, {id: 'wms', text: '仓库'}]
- },
- {field: 'moduleId', title: '模块名称', width: 100},
- {field: 'sortNum', title: '序号', width: 40, hidden: true, type: 'number'},
- {field: 'menuUrl', title: '功能地址', width: 100},
- {field: 'permissionCode', title: '权限编号', hidden: true, width: 100},
- {field: 'clientType', title: '客户端', width: 60},
- {
- field: 'beActive',
- title: '状态',
- width: 40,
- formatter: [{id: 'Y', text: '启用'}, {id: 'N', text: '禁用'}, {id: 'D', text: '删除'}]
- },
- {field: 'createAt', title: '新增时间', width: 160, formatter: fmtDate},
- {field: 'updateAt', title: '最后更新时间', width: 160, formatter: fmtDate}
- ]]
- }
- }
- };
- };
- });
|