editor.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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 updateShuliang_djcs = (data, row) => {
  49. return Service.updateShuliang_djcs(data, row);
  50. };
  51. export const changguidinge = (dingeclick, selectedRow) => {
  52. return Service.changguidinge(dingeclick, selectedRow);
  53. };
  54. export const changguidinge_djcs = (dingeclick, selectedRow) => {
  55. return Service.changguidinge_djcs(dingeclick, selectedRow);
  56. };
  57. export const handleBeizhu = (beizhuFK, derow, fuzhuSelect, fuzhu ) => {
  58. console.log(beizhuFK);
  59. let bianma = [];
  60. let xuhao = [];
  61. let fuzhuSelect_ = Array.from(fuzhuSelect);
  62. let keys = beizhuFK['BZBH'];
  63. for(let j = 0; j < fuzhuSelect_.length; j++) {
  64. let entry = fuzhuSelect_[j];
  65. for(let i = 0; i < fuzhu.length; i++) {
  66. if (fuzhu[i]['key'] == entry) {
  67. bianma.push(fuzhu[i]['编号']);
  68. xuhao.push(fuzhu[i]['序号']);
  69. }
  70. }
  71. }
  72. let result = [];
  73. for(let i = 0; i < bianma.length; i++) {
  74. let bh = bianma[i];
  75. for(let j = 0; j < Object.keys(keys).length; j++) {
  76. let BZBH_ = Object.keys(keys)[j];
  77. let BZBH = keys[BZBH_];
  78. if (BZBH == bh) {
  79. result.push([beizhuFK['BH'][BZBH_], beizhuFK['MC'][BZBH_], beizhuFK['LB'][BZBH_], beizhuFK['SL'][BZBH_], beizhuFK['DW'][BZBH_]]);
  80. }
  81. }
  82. }
  83. console.log(result);
  84. return Service.updateBeizhu(derow, result, xuhao);
  85. };
  86. export const handleBeizhu_djcs = (beizhuFK, derow, fuzhuSelect, fuzhu ) => {
  87. console.log(beizhuFK);
  88. let bianma = [];
  89. let xuhao = [];
  90. let fuzhuSelect_ = Array.from(fuzhuSelect);
  91. let keys = beizhuFK['BZBH'];
  92. for(let j = 0; j < fuzhuSelect_.length; j++) {
  93. let entry = fuzhuSelect_[j];
  94. for(let i = 0; i < fuzhu.length; i++) {
  95. if (fuzhu[i]['key'] == entry) {
  96. bianma.push(fuzhu[i]['编号']);
  97. xuhao.push(fuzhu[i]['序号']);
  98. }
  99. }
  100. }
  101. let result = [];
  102. for(let i = 0; i < bianma.length; i++) {
  103. let bh = bianma[i];
  104. for(let j = 0; j < Object.keys(keys).length; j++) {
  105. let BZBH_ = Object.keys(keys)[j];
  106. let BZBH = keys[BZBH_];
  107. if (BZBH == bh) {
  108. result.push([beizhuFK['BH'][BZBH_], beizhuFK['MC'][BZBH_], beizhuFK['LB'][BZBH_], beizhuFK['SL'][BZBH_], beizhuFK['DW'][BZBH_]]);
  109. }
  110. }
  111. }
  112. console.log(result);
  113. return Service.updateBeizhu_djcs(derow, result, xuhao);
  114. };