editor.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 redo = () => {
  11. let newData = Service.redo();
  12. return newData;
  13. };
  14. export const shanchu = ( selectedRow) => {
  15. let newData = Service.shanchu(selectedRow);
  16. return newData;
  17. };
  18. export const quanbushanchu = (hotRef, selectedRow) => {
  19. let qdbm = hotRef.current?.hotInstance?.getData()[selectedRow.current][2];
  20. let newData = Service.quanbushanchu(qdbm);
  21. return newData;
  22. };
  23. export const danxiangdinge = (selectedRow) => {
  24. return Service.danxiangdinge(selectedRow);
  25. };
  26. export const updateDercj = (row, data) => {
  27. return Service.updateDercj(row, data);
  28. };
  29. export const changguidinge = (dingeclick, selectedRow) => {
  30. return Service.changguidinge(dingeclick, selectedRow);
  31. };
  32. export const handleBeizhu = (beizhuFK, derow, fuzhuSelect, fuzhu ) => {
  33. console.log(beizhuFK);
  34. let bianma = [];
  35. let xuhao = [];
  36. let fuzhuSelect_ = Array.from(fuzhuSelect);
  37. let keys = beizhuFK['BZBH'];
  38. for(let j = 0; j < fuzhuSelect_.length; j++) {
  39. let entry = fuzhuSelect_[j];
  40. for(let i = 0; i < fuzhu.length; i++) {
  41. if (fuzhu[i]['id'] == entry) {
  42. bianma.push(fuzhu[i]['编号']);
  43. xuhao.push(fuzhu[i]['序号']);
  44. }
  45. }
  46. }
  47. let result = [];
  48. for(let i = 0; i < bianma.length; i++) {
  49. let bh = bianma[i];
  50. for(let j = 0; j < Object.keys(keys).length; j++) {
  51. let BZBH_ = Object.keys(keys)[j];
  52. let BZBH = keys[BZBH_];
  53. if (BZBH == bh) {
  54. result.push([beizhuFK['BH'][BZBH_], beizhuFK['MC'][BZBH_], beizhuFK['LB'][BZBH_], beizhuFK['SL'][BZBH_], beizhuFK['DW'][BZBH_]]);
  55. }
  56. }
  57. }
  58. console.log(result);
  59. return Service.updateBeizhu(derow, result, xuhao);
  60. };