editor.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. import {danxiangdinge_index} from './utils';
  2. import Service from './Service';
  3. function copy(input) {
  4. return JSON.parse(JSON.stringify(input));
  5. }
  6. export const undo = () => {
  7. let newData = Service.undo();
  8. return newData;
  9. };
  10. export const undo_djcs = () => {
  11. let newData = Service.undo_djcs();
  12. return newData;
  13. };
  14. export const redo = () => {
  15. let newData = Service.redo();
  16. return newData;
  17. };
  18. export const redo_djcs = () => {
  19. let newData = Service.redo_djcs();
  20. return newData;
  21. };
  22. export const shanchu = ( selectedRow) => {
  23. let newData = Service.shanchu(selectedRow);
  24. return newData;
  25. };
  26. export const shanchu_djcs = ( selectedRow) => {
  27. let newData = Service.shanchu_djcs(selectedRow);
  28. return newData;
  29. };
  30. export const danxiangdinge = (selectedRow) => {
  31. return Service.danxiangdinge(selectedRow);
  32. };
  33. export const danxiangdinge_djcs = (selectedRow) => {
  34. return Service.danxiangdinge_djcs(selectedRow);
  35. };
  36. export const updateDercj = (row, data) => {
  37. return Service.updateDercj(row, data);
  38. };
  39. export const updateDercj_djcs = (row, data) => {
  40. return Service.updateDercj_djcs(row, data);
  41. };
  42. export const huan = (replaceState, row) => {
  43. return Service.huan(replaceState['old'],replaceState['newBianhao'],replaceState['newName'], replaceState['newJia'], row);
  44. };
  45. export const updateShuliang = (data, row) => {
  46. return Service.updateShuliang(data, row);
  47. };
  48. export const updateDeMingcheng = (data, row) => {
  49. return Service.updateDeMingcheng(data, row);
  50. };
  51. export const updateShuliang_djcs = (data, row) => {
  52. return Service.updateShuliang_djcs(data, row);
  53. };
  54. export const changguidinge = (dingeclick, selectedRow) => {
  55. return Service.changguidinge(dingeclick, selectedRow);
  56. };
  57. export const changguidinge_djcs = (dingeclick, selectedRow) => {
  58. return Service.changguidinge_djcs(dingeclick, selectedRow);
  59. };
  60. export const handleYuban = (derow, select ) => {
  61. return Service.handleYuban(derow, select);
  62. };
  63. export const handleRcjbc = (derow, rcjbc ) => {
  64. return Service.handleRcjbc(derow, rcjbc);
  65. };
  66. export const handleBeizhu = (beizhuFK, derow, fuzhuSelect, fuzhu ) => {
  67. console.log(beizhuFK);
  68. let bianma = [];
  69. let xuhao = [];
  70. let fuzhuSelect_ = Array.from(fuzhuSelect);
  71. let keys = beizhuFK['BZBH'];
  72. for(let j = 0; j < fuzhuSelect_.length; j++) {
  73. let entry = fuzhuSelect_[j];
  74. for(let i = 0; i < fuzhu.length; i++) {
  75. if (fuzhu[i]['key'] == entry) {
  76. bianma.push(fuzhu[i]['编号']);
  77. xuhao.push(fuzhu[i]['序号']);
  78. }
  79. }
  80. }
  81. let result = [];
  82. for(let i = 0; i < bianma.length; i++) {
  83. let bh = bianma[i];
  84. for(let j = 0; j < Object.keys(keys).length; j++) {
  85. let BZBH_ = Object.keys(keys)[j];
  86. let BZBH = keys[BZBH_];
  87. if (BZBH == bh) {
  88. result.push([beizhuFK['BH'][BZBH_], beizhuFK['MC'][BZBH_], beizhuFK['LB'][BZBH_], beizhuFK['SL'][BZBH_], beizhuFK['DW'][BZBH_]]);
  89. }
  90. }
  91. }
  92. console.log(result);
  93. return Service.updateBeizhu(derow, result, xuhao);
  94. };
  95. export const handleBeizhu_djcs = (beizhuFK, derow, fuzhuSelect, fuzhu ) => {
  96. console.log(beizhuFK);
  97. let bianma = [];
  98. let xuhao = [];
  99. let fuzhuSelect_ = Array.from(fuzhuSelect);
  100. let keys = beizhuFK['BZBH'];
  101. for(let j = 0; j < fuzhuSelect_.length; j++) {
  102. let entry = fuzhuSelect_[j];
  103. for(let i = 0; i < fuzhu.length; i++) {
  104. if (fuzhu[i]['key'] == entry) {
  105. bianma.push(fuzhu[i]['编号']);
  106. xuhao.push(fuzhu[i]['序号']);
  107. }
  108. }
  109. }
  110. let result = [];
  111. for(let i = 0; i < bianma.length; i++) {
  112. let bh = bianma[i];
  113. for(let j = 0; j < Object.keys(keys).length; j++) {
  114. let BZBH_ = Object.keys(keys)[j];
  115. let BZBH = keys[BZBH_];
  116. if (BZBH == bh) {
  117. result.push([beizhuFK['BH'][BZBH_], beizhuFK['MC'][BZBH_], beizhuFK['LB'][BZBH_], beizhuFK['SL'][BZBH_], beizhuFK['DW'][BZBH_]]);
  118. }
  119. }
  120. }
  121. console.log(result);
  122. return Service.updateBeizhu_djcs(derow, result, xuhao);
  123. };