SPMMR09100.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. Map = function(){
  2. this.map = new Object();
  3. };
  4. Map.prototype = {
  5. put : function(key, value){
  6. this.map[key] = value;
  7. },
  8. get : function(key){
  9. return this.map[key];
  10. },
  11. containsKey : function(key){
  12. return key in this.map;
  13. },
  14. containsValue : function(value){
  15. for(var prop in this.map){
  16. if(this.map[prop] == value) return true;
  17. }
  18. return false;
  19. },
  20. isEmpty : function(key){
  21. return (this.size() == 0);
  22. },
  23. clear : function(){
  24. for(var prop in this.map){
  25. delete this.map[prop];
  26. }
  27. },
  28. remove : function(key){
  29. delete this.map[key];
  30. },
  31. keys : function(){
  32. var keys = new Array();
  33. for(var prop in this.map){
  34. keys.push(prop);
  35. }
  36. return keys;
  37. },
  38. values : function(){
  39. var values = new Array();
  40. for(var prop in this.map){
  41. values.push(this.map[prop]);
  42. }
  43. return values;
  44. },
  45. size : function(){
  46. var count = 0;
  47. for (var prop in this.map) {
  48. count++;
  49. }
  50. return count;
  51. }
  52. };
  53. var gCodeMap = new Map();
  54. function fInit(){
  55. if(isPopup()){
  56. submit("TRMMR09100");
  57. }
  58. }
  59. function fInputCharacter(){
  60. var row = grd_codelist.row;
  61. var col = grd_codelist.col;
  62. var sCode;
  63. var sInputStr = model.getValue("/root/main/str");
  64. if(isDataCell()){
  65. sCode = grd_codelist.valuematrix(row, col);
  66. model.setValue("/root/main/str", sInputStr + sCode + ' ');
  67. ipt_str.refresh();
  68. }
  69. }
  70. function fInputZoomInCharacter(){
  71. var sCode = model.getValue("/root/main/char");
  72. var sInputStr = model.getValue("/root/main/str");
  73. model.setValue("/root/main/str", sInputStr + sCode + ' ');
  74. ipt_str.refresh();
  75. }
  76. function fZoomInCharacter(){
  77. var row = grd_codelist.row;
  78. var col = grd_codelist.col;
  79. var sCode;
  80. if(isDataCell()){
  81. sCode = grd_codelist.valuematrix(row, col);
  82. model.setValue("/root/main/char", sCode);
  83. ipt_str.refresh();
  84. }
  85. cap_zoom.refresh();
  86. }