utils.sjs 965 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. var antmove_export = {};
  2. function desensitization(string = "", start, end, VisitorLog, type, notDesensitizedColumn) {
  3. var star = '';
  4. if (string) {
  5. let res = false
  6. if (VisitorLog == 'VisitorLog') {
  7. res = notDesensitizedColumn.includes(type)
  8. }
  9. if (res) {
  10. return string
  11. }
  12. function makeStar(number) {
  13. if (number > 0) {
  14. star += '*';
  15. return makeStar(--number);
  16. } else {
  17. return star;
  18. }
  19. };
  20. return string.substring(0, start) + makeStar(end - start) + string.substring(end);
  21. }
  22. }
  23. function indexOf(array, value) {
  24. return array.indexOf(value);
  25. }
  26. function floorCss(index, chooseFloorIndex) {
  27. let css = 'floor-item-box'
  28. chooseFloorIndex.forEach(item => {
  29. if (item == index) {
  30. css = css + ' choose-floor-item'
  31. }
  32. })
  33. return css;
  34. }
  35. antmove_export = {
  36. desensitization: desensitization,
  37. indexOf: indexOf,
  38. floorCss: floorCss,
  39. };
  40. export default antmove_export;