{"hidden":false,"children":[{"configs":{"serverScript":"var data = app.get(),\n  id, ids = [],\n  recs = Wb.decode(data.create);\nWb.each(recs, function(rec) {\n  id = SysUtil.getId();\n  rec.KEY_ID = id;\n  ids.push({\n    KEY_ID: id\n  });\n});\nrequest.setAttribute('create', Wb.encode(recs)); //重置create记录\napp.update({\n  tableName: 'WB_KEY'\n});\nvar K, map = new java.util.concurrent.ConcurrentHashMap(),\n  buffer = com.wb.common.KVBuffer.buffer,\n  rs = app.run('select * from WB_KEY where KEY_NAME={?KEY_NAME?} order by KEY_NAME');\nwhile (rs.next()) {\n  K = rs.getString('K');\n  map.put(rs.getInt('TYPE') == 1 ? K : SysUtil.javaInt(K), rs.getString('V'));\n}\nif (map.isEmpty())\n  buffer.remove(data.KEY_NAME);\nelse\n  buffer.put(data.KEY_NAME, map);\napp.send(ids); //把id列表发送到客户端以回填到表格","itemId":"module"},"expanded":true,"children":[],"type":"module"}],"roles":{},"title":"保存","iconCls":"","inframe":false,"pageLink":""}