{
 "hidden": false,
 "children": [{
  "configs": {"itemId": "module"},
  "expanded": true,
  "children": [{
   "configs": {
    "layout": "border",
    "itemId": "viewport1"
   },
   "expanded": true,
   "children": [
    {
     "configs": {
      "layout": "border",
      "itemId": "panelLeft",
      "split": "true",
      "width": "400",
      "region": "west"
     },
     "expanded": true,
     "children": [
      {
       "configs": {
        "itemId": "toolbar",
        "region": "north",
        "height": "24"
       },
       "expanded": false,
       "children": [
        {
         "configs": {
          "itemId": "addItem",
          "text": "增加",
          "iconCls": "record_add_icon"
         },
         "expanded": false,
         "children": [],
         "type": "item",
         "events": {"click": "/**\
*Description: 新增，在表格最后一行添加一行\
*Author: xl\
*Version: 1.0\
*Create Date Time: 2020-11-25\
*/\
Wb.addEdit(app.gridTextLimitUrl,{ID:Wb.getUuid()},\"last\",1,false);"}
        },
        {
         "configs": {
          "itemId": "delItem",
          "text": "删除",
          "iconCls": "record_delete_icon"
         },
         "expanded": false,
         "children": [],
         "type": "item",
         "events": {"click": "/**\
*Description: 删除数据\
*Author: xl\
*Version: 1.0\
*Create Date Time: 2020-11-25\
*/\
var res = app.gridTextLimitUrl.getSelection()[0];\
if(!res){\
  Wb.warn(\"请选择一条记录\");\
  return;\
}\
\
Wb.remove(app.gridTextLimitUrl);"}
        },
        {
         "configs": {
          "itemId": "saveItem",
          "text": "保存",
          "iconCls": "save_icon"
         },
         "expanded": false,
         "children": [],
         "type": "item",
         "events": {"click": "/**\
*Description:保存表格编辑的数据，包含删除，新增、修改\
*Author: wangll\
*Version: 1.0\
*Create Date Time: 2020-03-18\
*/\
if (!Wb.verifyGrid(app.gridTextLimitUrl)) \
  return;\
Wb.requestAg({\
  params: {\
    datatable: [Wb.getModified(app.gridTextLimitUrl)],\
    className: \"com.ag.secp.cargo.business.basecode.pojo.TTextLimitUrl\",\
    insertSql: \"resources/cargo/basecode.TTextLimitUrlMapper.insert\",\
    deleteSql: \"resources/cargo/basecode.TTextLimitUrlMapper.deleteByPrimaryKey\",\
    updateSql: \"resources/cargo/basecode.TTextLimitUrlMapper.updateByPrimaryKeySelective\",\
    bean: \"psamatheComBean\",\
    method: \"saveGrid\" //业务方法名 \
  },\
  success: function(resp) {\
    app.findUrlItem.fireEvent('click');\
    Wb.tip('保存成功');\
  }\
});"}
        },
        {
         "configs": {
          "itemId": "findUrlItem",
          "text": "查询",
          "iconCls": "search_icon"
         },
         "expanded": false,
         "children": [],
         "type": "item",
         "events": {"click": "app.gridTextLimitUrl.store.load({\
  out: app.toolbar\
});"}
        }
       ],
       "type": "toolbar"
      },
      {
       "configs": {
        "itemId": "gridTextLimitUrl",
        "editable": "true",
        "region": "center"
       },
       "expanded": true,
       "children": [
        {
         "configs": {
          "itemId": "store",
          "autoLoad": "true",
          "url": "m?xwl=common/selectTextLimitUrl"
         },
         "expanded": false,
         "children": [],
         "type": "store",
         "events": {"success": "app.gridTextLimitUrl.getSelectionModel().select(records[0]);//选中第一行\
var record = app.gridTextLimitUrl.getSelection()[0];\
app.url = record.data.URL;\
app.urlName = record.data.URL_NAME;\
app.tableName = record.data.TABLE_NAME;\
app.gridTextLimit.store.load({\
  params:{ url:record.data.URL}\
});"}
        },
        {
         "configs": {"itemId": "columns"},
         "expanded": false,
         "children": [
          {
           "configs": {
            "itemId": "rownumbererCol",
            "xtype": "rownumberer"
           },
           "expanded": false,
           "children": [],
           "type": "column"
          },
          {
           "configs": {
            "itemId": "IDCol",
            "hidden": "true",
            "dataIndex": "ID",
            "width": "180",
            "text": "ID"
           },
           "expanded": true,
           "children": [],
           "type": "column"
          },
          {
           "configs": {
            "itemId": "URL_NAMECol",
            "dataIndex": "URL_NAME",
            "width": "120",
            "text": "页面名称"
           },
           "expanded": true,
           "children": [{
            "configs": {
             "itemId": "editor",
             "allowBlank": "false"
            },
            "expanded": false,
            "children": [],
            "type": "text"
           }],
           "type": "column"
          },
          {
           "configs": {
            "itemId": "URLCol",
            "dataIndex": "URL",
            "width": "120",
            "text": "页面Url"
           },
           "expanded": true,
           "children": [{
            "configs": {
             "itemId": "editor",
             "allowBlank": "false",
             "maxLength": "100"
            },
            "expanded": false,
            "children": [],
            "type": "text"
           }],
           "type": "column"
          },
          {
           "configs": {
            "itemId": "TABLE_NAMECol",
            "dataIndex": "TABLE_NAME",
            "width": "120",
            "text": "表名"
           },
           "expanded": true,
           "children": [{
            "configs": {
             "itemId": "editor",
             "allowBlank": "false",
             "maxLength": "100"
            },
            "expanded": false,
            "children": [],
            "type": "text"
           }],
           "type": "column"
          }
         ],
         "type": "array"
        }
       ],
       "type": "grid",
       "events": {"itemclick": "app.url = record.data.URL;\
app.urlName = record.data.URL_NAME;\
app.tableName = record.data.TABLE_NAME;\
app.gridTextLimit.store.load({\
  params:{ url:record.data.URL}\
});\
"}
      }
     ],
     "type": "panel"
    },
    {
     "configs": {
      "layout": "fit",
      "itemId": "panelGrid",
      "region": "center"
     },
     "expanded": true,
     "children": [{
      "configs": {
       "itemId": "gridTextLimit",
       "editable": "true"
      },
      "expanded": true,
      "children": [
       {
        "configs": {
         "itemId": "store",
         "url": "m?xwl=common/selectTextLimit"
        },
        "expanded": false,
        "children": [],
        "type": "store"
       },
       {
        "configs": {"itemId": "tbar"},
        "expanded": true,
        "children": [
         {
          "configs": {
           "itemId": "addItem",
           "text": "增加",
           "iconCls": "record_add_icon"
          },
          "expanded": false,
          "children": [],
          "type": "item",
          "events": {"click": "/**\
*Description: 新增，在表格最后一行添加一行\
*Author: xl\
*Version: 1.0\
*Create Date Time: 2020-11-25\
*/\
if(Wb.isEmpty(app.url)){\
  Wb.warn(\"请先选择页面\");\
  return;\
}\
Wb.addEdit(app.gridTextLimit,{ID:Wb.getUuid(),NAME:app.urlName,URL:app.url,CREATED_BY:'{#sys.username#}',CREATED_ON:new Date(),\
                      UPDATED_BY:'{#sys.username#}',UPDATED_ON:new Date()},\"last\",1,false);"}
         },
         {
          "configs": {
           "itemId": "delItem",
           "text": "删除",
           "iconCls": "record_delete_icon"
          },
          "expanded": false,
          "children": [],
          "type": "item",
          "events": {"click": "/**\
*Description: 删除数据\
*Author: xl\
*Version: 1.0\
*Create Date Time: 2020-11-25\
*/\
var res = app.gridTextLimit.getSelection()[0];\
if(!res){\
  Wb.warn(\"请选择一条记录\");\
  return;\
}\
\
Wb.remove(app.gridTextLimit);"}
         },
         {
          "configs": {
           "itemId": "saveItem",
           "text": "保存",
           "iconCls": "save_icon"
          },
          "expanded": false,
          "children": [],
          "type": "item",
          "events": {"click": "/**\
*Description:保存表格编辑的数据，包含删除，新增、修改\
*Author: wangll\
*Version: 1.0\
*Create Date Time: 2020-03-18\
*/\
if (!Wb.verifyGrid(app.gridTextLimit)) \
  return;\
Wb.requestAg({\
  params: {\
    datatable: [Wb.getModified(app.gridTextLimit)],\
    className: \"com.ag.secp.cargo.business.basecode.pojo.TTextLimit\",\
    insertSql: \"resources/cargo/basecode.TTextLimitMapper.insert\",\
    deleteSql: \"resources/cargo/basecode.TTextLimitMapper.deleteByPrimaryKey\",\
    updateSql: \"resources/cargo/basecode.TTextLimitMapper.updateByPrimaryKeySelective\",\
    bean: \"psamatheComBean\",\
    method: \"saveGrid\" //业务方法名 \
  },\
  success: function(resp) {\
    app.findItem.fireEvent('click');\
    Wb.tip('保存成功');\
  }\
});"}
         },
         {
          "configs": {
           "itemId": "columnName",
           "labelAlign": "right",
           "fieldLabel": "字段名",
           "width": "170",
           "labelWidth": "70"
          },
          "expanded": false,
          "children": [],
          "type": "text"
         },
         {
          "configs": {
           "itemId": "findItem",
           "text": "查询",
           "iconCls": "search_icon"
          },
          "expanded": false,
          "children": [],
          "type": "item",
          "events": {"click": "app.gridTextLimit.store.load({\
   params:{ url:app.url,\
            columnName:app.columnName.getValue()\
          }\
});"}
         }
        ],
        "type": "toolbar"
       },
       {
        "configs": {"itemId": "columns"},
        "expanded": true,
        "children": [
         {
          "configs": {
           "itemId": "rownumbererCol",
           "xtype": "rownumberer"
          },
          "expanded": false,
          "children": [],
          "type": "column"
         },
         {
          "configs": {
           "itemId": "IDCol",
           "hidden": "true",
           "dataIndex": "ID",
           "width": "180",
           "text": "ID"
          },
          "expanded": true,
          "children": [],
          "type": "column"
         },
         {
          "configs": {
           "itemId": "NAMECol",
           "dataIndex": "NAME",
           "width": "180",
           "text": "页面名称"
          },
          "expanded": true,
          "children": [],
          "type": "column"
         },
         {
          "configs": {
           "itemId": "URLCol",
           "hidden": "true",
           "dataIndex": "URL",
           "width": "180",
           "text": "页面Url"
          },
          "expanded": true,
          "children": [{
           "configs": {"itemId": "editor"},
           "expanded": false,
           "children": [],
           "type": "text"
          }],
          "type": "column"
         },
         {
          "configs": {
           "itemId": "ITEMIDCol",
           "hidden": "true",
           "dataIndex": "ITEMID"
          },
          "expanded": false,
          "children": [],
          "type": "column"
         },
         {
          "configs": {
           "itemId": "ITEMID_NAMECol",
           "dataIndex": "ITEMID_NAME",
           "width": "180",
           "text": "控件名"
          },
          "expanded": true,
          "children": [{
           "configs": {
            "tagConfigs": "matchFieldWidth:false",
            "itemId": "editor",
            "allowBlank": "false",
            "displayField": "COMMENTS",
            "valueField": "COMMENTS"
           },
           "expanded": true,
           "children": [{
            "configs": {
             "itemId": "store",
             "url": "m?xwl=common/selectColumnByTable"
            },
            "expanded": false,
            "children": [],
            "type": "store",
            "events": {"beforeload": "operation.params={tableName:app.tableName,query:operation.params.query};"}
           }],
           "type": "combo",
           "events": {"select": "var rec = app.gridTextLimit.getSelection()[0];\
rec.set('ITEMID',records[0].data.COLUMN_NAME);"}
          }],
          "type": "column"
         },
         {
          "configs": {
           "itemId": "ALLOWBLANKCol",
           "renderer": "if(value == '0'){\
  return '是';\
}\
if(value == '1'){\
  return '否';\
}",
           "dataIndex": "ALLOWBLANK",
           "width": "130",
           "text": "是否必填"
          },
          "expanded": true,
          "children": [{
           "configs": {
            "itemId": "editor",
            "allowBlank": "false",
            "pickList": "[['0','是'],['1','否']]"
           },
           "expanded": false,
           "children": [],
           "type": "combo"
          }],
          "type": "column"
         },
         {
          "configs": {
           "itemId": "MAXLENGTHCol",
           "dataIndex": "MAXLENGTH",
           "width": "180",
           "text": "最大长度",
           "align": "right"
          },
          "expanded": true,
          "children": [{
           "configs": {"itemId": "editor"},
           "expanded": false,
           "children": [],
           "type": "number"
          }],
          "type": "column"
         },
         {
          "configs": {
           "itemId": "WRAPLENGTHCol",
           "dataIndex": "WRAPLENGTH",
           "width": "180",
           "text": "每行显示字符数",
           "align": "right"
          },
          "expanded": true,
          "children": [{
           "configs": {"itemId": "editor"},
           "expanded": false,
           "children": [],
           "type": "number"
          }],
          "type": "column"
         },
         {
          "configs": {
           "itemId": "CREATED_BYCol",
           "dataIndex": "CREATED_BY",
           "text": "创建人"
          },
          "expanded": false,
          "children": [],
          "type": "column"
         },
         {
          "configs": {
           "itemId": "CREATED_ONCol",
           "dataIndex": "CREATED_ON",
           "text": "创建时间"
          },
          "expanded": false,
          "children": [],
          "type": "column"
         },
         {
          "configs": {
           "itemId": "UPDATED_BYCol",
           "dataIndex": "UPDATED_BY",
           "text": "修改人"
          },
          "expanded": false,
          "children": [],
          "type": "column"
         },
         {
          "configs": {
           "itemId": "UPDATED_ONCol",
           "dataIndex": "UPDATED_ON",
           "text": "修改时间"
          },
          "expanded": false,
          "children": [],
          "type": "column"
         }
        ],
        "type": "array"
       }
      ],
      "type": "grid",
      "events": {"itemclick": "\
"}
     }],
     "type": "panel"
    }
   ],
   "type": "viewport"
  }],
  "type": "module",
  "events": {"finalize": "app.url = '';\
app.urlName = '';\
app.tableName = '';"}
 }],
 "roles": {"default": 1},
 "title": "页面必填长度限制维护",
 "iconCls": "",
 "inframe": false,
 "pageLink": ""
}