{
 "hidden": false,
 "children": [{
  "configs": {"itemId": "module"},
  "expanded": true,
  "children": [
   {
    "configs": {
     "layout": "absolute",
     "itemId": "editWin",
     "dialog": "true",
     "closeAction": "hide",
     "autoReset": "true",
     "width": "528",
     "height": "300"
    },
    "expanded": true,
    "children": [
     {
      "configs": {
       "allowBlank": "false",
       "itemId": "ID",
       "hidden": "true",
       "labelAlign": "right",
       "fieldLabel": "id",
       "width": "312",
       "x": "8",
       "y": "224",
       "labelWidth": "90",
       "height": "26"
      },
      "expanded": false,
      "children": [],
      "type": "text"
     },
     {
      "configs": {
       "itemId": "SYS_CATEGORY",
       "allowBlank": "false",
       "labelAlign": "right",
       "fieldLabel": "代码字段",
       "width": "230",
       "x": "8",
       "y": "16",
       "isUpperCase": "true",
       "labelWidth": "90",
       "maxLength": "30",
       "height": "26"
      },
      "expanded": false,
      "children": [],
      "type": "text"
     },
     {
      "configs": {
       "itemId": "SYS_KEY",
       "allowBlank": "false",
       "labelAlign": "right",
       "fieldLabel": "键",
       "width": "230",
       "x": "8",
       "y": "48",
       "labelWidth": "90",
       "maxLength": "30",
       "height": "26"
      },
      "expanded": false,
      "children": [],
      "type": "text"
     },
     {
      "configs": {
       "itemId": "SYS_VALUE",
       "allowBlank": "false",
       "labelAlign": "right",
       "fieldLabel": "值",
       "width": "230",
       "x": "248",
       "y": "48",
       "isUpperCase": "true",
       "labelWidth": "90",
       "maxLength": "30",
       "height": "26"
      },
      "expanded": false,
      "children": [],
      "type": "text"
     },
     {
      "configs": {
       "itemId": "SYS_SEQ",
       "labelAlign": "right",
       "fieldLabel": "序号",
       "width": "230",
       "x": "8",
       "y": "112",
       "labelWidth": "90",
       "height": "26"
      },
      "expanded": false,
      "children": [],
      "type": "number"
     },
     {
      "configs": {
       "itemId": "SYS_NAME",
       "labelAlign": "right",
       "fieldLabel": "含义",
       "width": "230",
       "x": "248",
       "y": "16",
       "labelWidth": "90",
       "height": "26"
      },
      "expanded": false,
      "children": [],
      "type": "text"
     },
     {
      "configs": {
       "itemId": "NOTES",
       "labelAlign": "right",
       "fieldLabel": "备注",
       "width": "472",
       "x": "8",
       "y": "144",
       "labelWidth": "90",
       "height": "74"
      },
      "expanded": false,
      "children": [],
      "type": "textarea"
     },
     {
      "configs": {
       "itemId": "DATA_CLASS",
       "labelAlign": "right",
       "fieldLabel": "数据分类",
       "width": "230",
       "x": "8",
       "y": "80",
       "labelWidth": "90",
       "maxLength": "30",
       "height": "26"
      },
      "expanded": false,
      "children": [],
      "type": "text"
     },
     {
      "configs": {
       "itemId": "DATA_CLASS_NOTES",
       "labelAlign": "right",
       "fieldLabel": "数据分类说明",
       "width": "230",
       "x": "248",
       "y": "80",
       "labelWidth": "90",
       "maxLength": "30",
       "height": "26"
      },
      "expanded": false,
      "children": [],
      "type": "text"
     }
    ],
    "type": "window",
    "events": {"ok": "var values = Wb.getValue(app.editWin);\
var cate = app.SYS_CATEGORY.getValue();\
if (app.isEdit) {\
  //点击修改按钮的处理过程\
  Wb.request({\
    url: 'm?xwl=common/S_Code/S_CodeEdit/update',\
    params: Wb.applyIf(values, Wb.getData(app.selRec, true)), //合并窗口和记录数据作为参数，后者为默认值\
    success: function() {\
      //把窗口数据更新到选择记录中\
      Wb.update(app.selRec, values);\
      app.findMenu.fireEvent('click');//自动刷新\
      //隐藏对话框，在模块关闭时自动销毁对话框\
      app.editWin.close();\
    }\
  });\
} else {\
  //点击添加按钮的处理过程\
  Wb.request({\
    url: 'm?xwl=common/S_Code/S_CodeEdit/insert',\
    out: app.editWin,\
    success: function(resp) {\
      //把服务器返回的数据合并窗口数据（公司名称等数据）添加到表格中\
      Wb.add(app.grid1, Wb.apply(Wb.decode(resp.responseText), values));\
      app.findMenu.fireEvent('click');//自动刷新\
      //隐藏对话框，在模块关闭时自动销毁对话框\
      app.editWin.close();\
    }\
  });\
}\
console.info(cate);\
Wb.upRedisService(cate);\
\
"}
   },
   {
    "configs": {
     "layout": "fit",
     "itemId": "viewport1"
    },
    "expanded": true,
    "children": [{
     "configs": {
      "border": "false",
      "itemId": "grid1"
     },
     "expanded": true,
     "children": [
      {
       "configs": {
        "itemId": "store",
        "autoLoad": "true",
        "pageSize": "200",
        "url": "m?xwl=common/S_Code/S_CodeEdit/select"
       },
       "expanded": false,
       "children": [],
       "type": "store"
      },
      {
       "configs": {"itemId": "tbar"},
       "expanded": true,
       "children": [
        {
         "configs": {
          "itemId": "name",
          "labelAlign": "right",
          "fieldLabel": "类别",
          "displayField": "NAME",
          "labelWidth": "40",
          "valueField": "COD",
          "anyMatch": "true"
         },
         "expanded": true,
         "children": [{
          "configs": {
           "itemId": "store",
           "autoLoad": "true",
           "url": "m?xwl=common/S_Code/S_CodeEdit/selectSCode"
          },
          "expanded": false,
          "children": [],
          "type": "store"
         }],
         "type": "combo"
        },
        {
         "configs": {
          "itemId": "findMenu",
          "text": "查询",
          "iconCls": "search_icon"
         },
         "expanded": false,
         "children": [],
         "type": "item",
         "events": {"click": "app.grid1.store.load({\
  out:app.tbar\
});"}
        },
        {
         "configs": {
          "itemId": "addMenu",
          "text": "添加",
          "iconCls": "record_add_icon"
         },
         "expanded": false,
         "children": [],
         "type": "item",
         "events": {"click": "app.editWin.setTitle('添加 - 代码 ' );\
app.editWin.setIconCls('record_add_icon');\
app.editWin.show();\
app.isEdit = false; //标识是否为添加或修改状态，在editWin的ok事件中用到此属性"}
        },
        {
         "configs": {
          "itemId": "modifyMenu",
          "text": "修改",
          "iconCls": "record_edit_icon"
         },
         "expanded": false,
         "children": [],
         "type": "item",
         "events": {"click": "var sels = app.grid1.getSelection();\
if (sels.length != 1) {\
  Wb.warn('请选择 1 条需要修改的记录。');\
  return;\
}\
app.selRec = sels[0];\
app.editWin.setTitle('修改 - ' + app.selRec.data.SYS_CATEGORY);\
app.editWin.setIconCls('record_edit_icon');\
Wb.setValue(app.editWin, app.selRec.data);\
app.editWin.show();\
app.isEdit = true; //标识是否为添加或修改状态，在editWin的ok事件中用到此属性"}
        },
        {
         "configs": {
          "itemId": "copyMenu",
          "text": "复制",
          "iconCls": "record_copy_icon"
         },
         "expanded": false,
         "children": [],
         "type": "item",
         "events": {"click": "var rec = app.grid1.getSelection()[0];\
if (!rec) {\
  Wb.warn('请选择 1 条需要修改的记录。');\
  return;\
}\
app.editWin.setTitle('复制 - ' + rec.data.SYS_CATEGORY);\
app.editWin.setIconCls('record_edit_icon');\
app.SYS_CATEGORY.setValue(rec.data.SYS_CATEGORY);\
app.SYS_NAME.setValue(rec.data.SYS_NAME);\
app.SYS_SEQ.setValue(rec.data.SYS_SEQ);\
app.NOTES.setValue(rec.data.NOTES);\
app.editWin.show();\
app.isEdit = false; //标识是否为添加或修改状态，在editWin的ok事件中用到此属性\
\
"}
        },
        {
         "configs": {
          "itemId": "delMenu",
          "text": "删除",
          "iconCls": "record_delete_icon"
         },
         "expanded": false,
         "children": [],
         "type": "item",
         "events": {"click": "var sels = app.grid1.getSelection();\
Wb.confirmDo(sels, function() {\
  Wb.request({\
    url: 'm?xwl=common/S_Code/S_CodeEdit/delete',\
    params: {\
      destroy: Wb.getData(sels, true)\
    },\
    success: function() {\
      Wb.remove(app.grid1, sels);\
      Wb.upRedisService(sels[0].data.SYS_CATEGORY);\
    }\
  });\
}, 'SYS_CATEGORY');"}
        },
        {
         "configs": {
          "itemId": "loadMenu",
          "text": "加载代码",
          "iconCls": "folder_closed_icon"
         },
         "expanded": false,
         "children": [],
         "type": "item",
         "events": {"click": "\
var rec = app.grid1.getSelection()[0];\
if (!rec) {\
  Wb.warn('请选择 1 条需要刷新的记录。');\
  return;\
}\
\
Wb.request({\
      url: 'm?xwl=common/codeSet/load',\
      params: {tableName:rec.data.SYS_CATEGORY},\
      success: function(resp) {\
        Wb.tip('刷新完成！'); \
      }\
    });"}
        }
       ],
       "type": "toolbar"
      },
      {
       "configs": {"itemId": "columns"},
       "expanded": true,
       "children": [
        {
         "configs": {
          "itemId": "rowNumCol",
          "xtype": "rownumberer"
         },
         "expanded": false,
         "children": [],
         "type": "column"
        },
        {
         "configs": {
          "itemId": "sysCategoryCol",
          "dataIndex": "SYS_CATEGORY",
          "width": "140",
          "text": "代码字段",
          "align": "center"
         },
         "expanded": false,
         "children": [],
         "type": "column"
        },
        {
         "configs": {
          "itemId": "sysNameCol",
          "dataIndex": "SYS_NAME",
          "width": "120",
          "text": "含义",
          "align": "center"
         },
         "expanded": false,
         "children": [],
         "type": "column"
        },
        {
         "configs": {
          "itemId": "sysKeyCol",
          "dataIndex": "SYS_KEY",
          "text": "键",
          "align": "center"
         },
         "expanded": false,
         "children": [],
         "type": "column"
        },
        {
         "configs": {
          "itemId": "sysValueCol",
          "dataIndex": "SYS_VALUE",
          "width": "120",
          "text": "值",
          "align": "center"
         },
         "expanded": false,
         "children": [],
         "type": "column"
        },
        {
         "configs": {
          "itemId": "sysSeqCol",
          "dataIndex": "SYS_SEQ",
          "width": "60",
          "text": "序号",
          "align": "center"
         },
         "expanded": false,
         "children": [],
         "type": "column"
        },
        {
         "configs": {
          "itemId": "DATA_CLASS",
          "dataIndex": "DATA_CLASS",
          "text": "数据分类",
          "align": "center"
         },
         "expanded": false,
         "children": [],
         "type": "column"
        },
        {
         "configs": {
          "itemId": "DATA_CLASS_NOTES",
          "dataIndex": "DATA_CLASS_NOTES",
          "width": "140",
          "text": "数据分类说明",
          "align": "center"
         },
         "expanded": false,
         "children": [],
         "type": "column"
        },
        {
         "configs": {
          "itemId": "notesCol",
          "dataIndex": "NOTES",
          "text": "备注",
          "align": "center"
         },
         "expanded": false,
         "children": [],
         "type": "column"
        },
        {
         "configs": {
          "itemId": "createdBy",
          "dataIndex": "CREATED_BY",
          "width": "120",
          "text": "创建人",
          "align": "center"
         },
         "expanded": false,
         "children": [],
         "type": "column"
        },
        {
         "configs": {
          "itemId": "createdOn",
          "dataIndex": "CREATED_ON",
          "width": "120",
          "text": "创建时间",
          "align": "center"
         },
         "expanded": false,
         "children": [],
         "type": "column"
        },
        {
         "configs": {
          "itemId": "updatedBy",
          "dataIndex": "UPDATED_BY",
          "width": "120",
          "text": "修改人",
          "align": "center"
         },
         "expanded": false,
         "children": [],
         "type": "column"
        },
        {
         "configs": {
          "itemId": "updatedOn",
          "dataIndex": "UPDATED_ON",
          "width": "120",
          "text": "修改时间",
          "align": "center"
         },
         "expanded": false,
         "children": [],
         "type": "column"
        }
       ],
       "type": "array"
      }
     ],
     "type": "grid",
     "events": {"itemdblclick": "app.modifyMenu.fireEvent('click');"}
    }],
    "type": "viewport"
   }
  ],
  "type": "module"
 }],
 "roles": {
  "ORDER": 1,
  "business": 1,
  "TRUK_UNIT": 1,
  "basic": 1,
  "truck_unit": 1
 },
 "title": "代码维护",
 "iconCls": "",
 "inframe": false,
 "pageLink": ""
}