Best JavaScript code snippet using argos
getMenuAndButtonHasPerm.js
Source:getMenuAndButtonHasPerm.js
1let menuList = [{2 "children": [{3 "hasChildren": false,4 "id": 2,5 "isButton": 1,6 "isMarking": 0,7 "menuIco": "test.png",8 "menuName": "è¾
è¦è±åå",9 "menuUri": "/index/main/fjgl/fjhmc",10 "parentId": 1,11 "sort": 2,12 "status": 013 },14 {15 "hasChildren": false,16 "id": 3,17 "isButton": 1,18 "isMarking": 0,19 "menuIco": "test.png",20 "menuName": "è¾
è¦å
¥è管ç",21 "menuUri": "/index/main/fjgl/fjrzgl",22 "parentId": 1,23 "sort": 3,24 "status": 025 },26 {27 "hasChildren": false,28 "id": 4,29 "isButton": 1,30 "isMarking": 0,31 "menuIco": "test.png",32 "menuName": "è¾
è¦è§£è管ç",33 "menuUri": "/index/main/fjgl/fjjpgl",34 "parentId": 1,35 "sort": 4,36 "status": 037 },38 {39 "hasChildren": false,40 "id": 5,41 "isButton": 1,42 "isMarking": 0,43 "menuIco": "test.png",44 "menuName": "绩æèè¯ç»è®¡",45 "menuUri": "/index/main/fjgl/jxkptj",46 "parentId": 1,47 "sort": 5,48 "status": 049 },50 {51 "hasChildren": false,52 "id": 6,53 "isButton": 1,54 "isMarking": 0,55 "menuIco": "test.png",56 "menuName": "èå¤ç®¡ç",57 "menuUri": "/index/main/fjgl/kqgl",58 "parentId": 1,59 "sort": 6,60 "status": 061 },62 {63 "hasChildren": false,64 "id": 7,65 "isButton": 1,66 "isMarking": 0,67 "menuIco": "test.png",68 "menuName": "å·¥èµç®¡ç",69 "menuUri": "/index/main/fjgl/gzgl",70 "parentId": 1,71 "sort": 7,72 "status": 073 },74 {75 "hasChildren": false,76 "id": 8,77 "isButton": 1,78 "isMarking": 0,79 "menuIco": "test.png",80 "menuName": "åå管ç",81 "menuUri": "/index/main/fjgl/htgl",82 "parentId": 1,83 "sort": 8,84 "status": 085 },86 {87 "hasChildren": false,88 "id": 9,89 "isButton": 1,90 "isMarking": 0,91 "menuIco": "test.png",92 "menuName": "å¥æ©ç®¡ç",93 "menuUri": "/index/main/fjgl/jcgl",94 "parentId": 1,95 "sort": 9,96 "status": 097 },98 {99 "hasChildren": false,100 "id": 10,101 "isButton": 1,102 "isMarking": 0,103 "menuIco": "test.png",104 "menuName": "æå管ç",105 "menuUri": "/index/main/fjgl/jsgl",106 "parentId": 1,107 "sort": 10,108 "status": 0109 },110 {111 "hasChildren": false,112 "id": 11,113 "isButton": 1,114 "isMarking": 0,115 "menuIco": "test.png",116 "menuName": "è°å²ç®¡ç",117 "menuUri": "/index/main/fjgl/tggl",118 "parentId": 1,119 "sort": 11,120 "status": 0121 },122 {123 "hasChildren": false,124 "id": 149,125 "isButton": 1,126 "isMarking": 0,127 "menuDesc": "èå",128 "menuIco": "test.png",129 "menuName": "å·¥ä½è½¨è¿¹",130 "menuUri": "/index/main/fjgl/gzgj",131 "parentId": 1,132 "sort": 149,133 "status": 0134 },135 {136 "hasChildren": false,137 "id": 150,138 "isButton": 1,139 "isMarking": 0,140 "menuDesc": "èå",141 "menuIco": "test.png",142 "menuName": "ç»è®¡åæ",143 "menuUri": "/index/main/fjgl/tjfx",144 "parentId": 1,145 "sort": 150,146 "status": 0147 }148 ],149 "hasChildren": true,150 "id": 1,151 "isButton": 1,152 "isMarking": 0,153 "menuIco": "test.png",154 "menuName": "è¾
è¦ç®¡ç",155 "menuUri": "/index/main/fjgl",156 "parentId": 0,157 "sort": 1,158 "status": 0159 },160 {161 "children": [{162 "children": [{163 "hasChildren": false,164 "id": 22,165 "isButton": 1,166 "isMarking": 0,167 "menuName": "å
容管ç",168 "menuUri": "/index/main/zggl/zgxxgl/nrgl",169 "parentId": 21,170 "sort": 22,171 "status": 0172 },173 {174 "hasChildren": false,175 "id": 23,176 "isButton": 1,177 "isMarking": 0,178 "menuName": "æ ç®ç®¡ç",179 "menuUri": "/index/main/zggl/zgxxgl/lmgl",180 "parentId": 21,181 "sort": 23,182 "status": 0183 },184 {185 "hasChildren": false,186 "id": 24,187 "isButton": 1,188 "isMarking": 0,189 "menuName": "è½®æå¾ç®¡ç",190 "menuUri": "/index/main/zggl/zgxxgl/lbtgl",191 "parentId": 21,192 "sort": 24,193 "status": 0194 }195 ],196 "hasChildren": true,197 "id": 21,198 "isButton": 1,199 "isMarking": 0,200 "menuIco": "test.png",201 "menuName": "æ¿å·¥å¦ä¹ 管ç",202 "menuUri": "/index/main/zggl/zgxxgl",203 "parentId": 20,204 "sort": 21,205 "status": 0206 },207 {208 "children": [{209 "hasChildren": false,210 "id": 26,211 "isButton": 1,212 "isMarking": 0,213 "menuName": "é¢åºç®¡ç",214 "menuUri": "/index/main/zggl/ksgl/tkgl",215 "parentId": 25,216 "sort": 26,217 "status": 0218 },219 {220 "hasChildren": false,221 "id": 27,222 "isButton": 1,223 "isMarking": 0,224 "menuName": "è¯å·ç®¡ç",225 "menuUri": "/index/main/zggl/ksgl/sjgl",226 "parentId": 25,227 "sort": 27,228 "status": 0229 }230 ],231 "hasChildren": true,232 "id": 25,233 "isButton": 1,234 "isMarking": 0,235 "menuIco": "test.png",236 "menuName": "èè¯ç®¡ç",237 "menuUri": "/index/main/zggl/ksgl",238 "parentId": 20,239 "sort": 25,240 "status": 0241 }242 ],243 "hasChildren": true,244 "id": 20,245 "isButton": 1,246 "isMarking": 0,247 "menuIco": "test.png",248 "menuName": "æ¿å·¥ç®¡ç",249 "menuUri": "/index/main/zggl",250 "parentId": 0,251 "sort": 20,252 "status": 0253 },254 {255 "children": [{256 "hasChildren": false,257 "id": 31,258 "isButton": 1,259 "isMarking": 0,260 "menuIco": "test.png",261 "menuName": "ç³»ç»ç¨æ·ç®¡ç",262 "menuUri": "/index/main/xtgl/xtyhgl",263 "parentId": 30,264 "sort": 31,265 "status": 0266 },267 {268 "hasChildren": false,269 "id": 32,270 "isButton": 1,271 "isMarking": 0,272 "menuIco": "test.png",273 "menuName": "è§è²æé管ç",274 "menuUri": "/index/main/xtgl/jsqxgl",275 "parentId": 30,276 "sort": 32,277 "status": 0278 },279 {280 "hasChildren": false,281 "id": 38,282 "isButton": 1,283 "isMarking": 0,284 "menuIco": "test.png",285 "menuName": "é¨é¨ç®¡ç",286 "menuUri": "/index/main/xtgl/bmjggl",287 "parentId": 30,288 "sort": 38,289 "status": 0290 }291 ],292 "hasChildren": true,293 "id": 30,294 "isButton": 1,295 "isMarking": 0,296 "menuIco": "test.png",297 "menuName": "ç³»ç»ç®¡ç",298 "menuUri": "/index/main/xtgl",299 "parentId": 0,300 "sort": 30,301 "status": 0302 },303 {304 "children": [{305 "children": [{306 "hasChildren": false,307 "id": 42,308 "isButton": 1,309 "isMarking": 0,310 "menuName": "èè¯æ¨¡æ¿ç®¡ç",311 "menuUri": "/index/main/jcsjpz/jxkpgl/kpmbgl",312 "parentId": 41,313 "sort": 42,314 "status": 0315 },316 {317 "hasChildren": false,318 "id": 43,319 "isButton": 1,320 "isMarking": 0,321 "menuName": "ææ å
容管ç",322 "menuUri": "/index/main/jcsjpz/jxkpgl/zbnrgl",323 "parentId": 41,324 "sort": 43,325 "status": 0326 },327 {328 "hasChildren": false,329 "id": 44,330 "isButton": 1,331 "isMarking": 0,332 "menuName": "ææ å类管ç",333 "menuUri": "/index/main/jcsjpz/jxkpgl/zbflgl",334 "parentId": 41,335 "sort": 44,336 "status": 0337 }338 ],339 "hasChildren": true,340 "id": 41,341 "isButton": 1,342 "isMarking": 0,343 "menuIco": "test.png",344 "menuName": "绩æèè¯ç®¡ç",345 "menuUri": "/index/main/jcsjpz/jxkpgl",346 "parentId": 40,347 "sort": 41,348 "status": 0349 }],350 "hasChildren": true,351 "id": 40,352 "isButton": 1,353 "isMarking": 0,354 "menuIco": "test.png",355 "menuName": "åºç¡æ°æ®é
ç½®",356 "menuUri": "/index/main/jcsjpz",357 "parentId": 0,358 "sort": 40,359 "status": 0360 },361 {362 "children": [{363 "hasChildren": false,364 "id": 51,365 "isButton": 1,366 "isMarking": 0,367 "menuIco": "test.png",368 "menuName": "æèè¿ç¨",369 "menuUri": "/index/main/zpgl/zpgc",370 "parentId": 50,371 "sort": 51,372 "status": 0373 }],374 "hasChildren": true,375 "id": 50,376 "isButton": 1,377 "isMarking": 0,378 "menuIco": "test.png",379 "menuName": "æè管ç",380 "menuUri": "/index/main/zpgl",381 "parentId": 0,382 "sort": 50,383 "status": 0384 }385];386let permButtonList = [{387 "hasChildren": false,388 "id": 103,389 "isButton": 2,390 "isMarking": 0,391 "menuDesc": "æé®",392 "menuIco": "",393 "menuName": "æ¥ç详æ
",394 "menuUri": "/pc/recruit:selectEnrollInfoOnConditions",395 "parentId": 51,396 "sort": 103,397 "status": 0398 },399 {400 "hasChildren": false,401 "id": 104,402 "isButton": 2,403 "isMarking": 0,404 "menuDesc": "æé®",405 "menuIco": "",406 "menuName": "æ·»å æèä¿¡æ¯",407 "menuUri": "/index/main/zpgl/zpgc:add",408 "parentId": 51,409 "sort": 104,410 "status": 0411 },412 {413 "hasChildren": false,414 "id": 105,415 "isButton": 2,416 "isMarking": 0,417 "menuDesc": "æé®",418 "menuIco": "",419 "menuName": "ç¡®å®",420 "menuUri": "/pc/recruit:addRecruitInfo",421 "parentId": 104,422 "sort": 105,423 "status": 0424 },425 {426 "hasChildren": false,427 "id": 106,428 "isButton": 2,429 "isMarking": 0,430 "menuDesc": "æé®",431 "menuIco": "",432 "menuName": "é¢è§",433 "menuUri": "/pc/recruit:getRecruitInfoForEdit",434 "parentId": 51,435 "sort": 106,436 "status": 0437 },438 {439 "hasChildren": false,440 "id": 107,441 "isButton": 2,442 "isMarking": 0,443 "menuDesc": "æé®",444 "menuIco": "",445 "menuName": "ç»ææè",446 "menuUri": "/pc/recruit:stopRecruit",447 "parentId": 51,448 "sort": 107,449 "status": 0450 },451 {452 "hasChildren": false,453 "id": 108,454 "isButton": 2,455 "isMarking": 0,456 "menuDesc": "æé®",457 "menuIco": "",458 "menuName": "åæ¢æ¥å",459 "menuUri": "/pc/recruit:stopRecruit",460 "parentId": 51,461 "sort": 108,462 "status": 0463 },464 {465 "hasChildren": false,466 "id": 109,467 "isButton": 2,468 "isMarking": 0,469 "menuDesc": "æé®",470 "menuIco": "",471 "menuName": "ç¼è¾",472 "menuUri": "/pc/recruit:editRecruitInfo",473 "parentId": 51,474 "sort": 109,475 "status": 0476 },477 {478 "hasChildren": false,479 "id": 110,480 "isButton": 2,481 "isMarking": 0,482 "menuDesc": "æé®",483 "menuIco": "",484 "menuName": "å é¤",485 "menuUri": "/pc/recruit:deletePublishInfo",486 "parentId": 51,487 "sort": 110,488 "status": 0489 },490 {491 "hasChildren": false,492 "id": 111,493 "isButton": 2,494 "isMarking": 0,495 "menuDesc": "æé®",496 "menuIco": "",497 "menuName": "åå¸æè",498 "menuUri": "/pc/recruit:publishRecruit",499 "parentId": 51,500 "sort": 111,501 "status": 0502 },503 {504 "hasChildren": false,505 "id": 112,506 "isButton": 2,507 "isMarking": 0,508 "menuDesc": "æé®",509 "menuIco": "",510 "menuName": "æ¥å",511 "menuUri": "/index/main/zpgl/zpgc:apply",512 "parentId": 103,513 "sort": 112,514 "status": 0515 },516 {517 "hasChildren": false,518 "id": 113,519 "isButton": 2,520 "isMarking": 0,521 "menuDesc": "æé®",522 "menuIco": "",523 "menuName": "æ·»å æ¥å",524 "menuUri": "/pc/recruit:addApplyInfos",525 "parentId": 112,526 "sort": 113,527 "status": 0528 },529 {530 "hasChildren": false,531 "id": 114,532 "isButton": 2,533 "isMarking": 0,534 "menuDesc": "æé®",535 "menuIco": "",536 "menuName": "è¿å
¥èµæ ¼å®¡æ¥",537 "menuUri": "/pc/recruit:addApplyInfos",538 "parentId": 113,539 "sort": 114,540 "status": 0541 },542 {543 "hasChildren": false,544 "id": 115,545 "isButton": 2,546 "isMarking": 0,547 "menuDesc": "æé®",548 "menuIco": "",549 "menuName": "æ ¸å¯¹èµæ",550 "menuUri": "/index/main/zpgl/zpgct:collatePersonInfo",551 "parentId": 112,552 "sort": 115,553 "status": 0554 },555 {556 "hasChildren": false,557 "id": 116,558 "isButton": 2,559 "isMarking": 0,560 "menuDesc": "æé®",561 "menuIco": "",562 "menuName": "æ交",563 "menuUri": "/pc/recruit:collatePersonInfo",564 "parentId": 115,565 "sort": 116,566 "status": 0567 },568 {569 "hasChildren": false,570 "id": 117,571 "isButton": 2,572 "isMarking": 0,573 "menuDesc": "æé®",574 "menuIco": "",575 "menuName": "èµæ ¼å®¡æ¥",576 "menuUri": "/index/main/zpgl/zpgct:qualificationAction",577 "parentId": 103,578 "sort": 117,579 "status": 0580 },581 {582 "hasChildren": false,583 "id": 118,584 "isButton": 2,585 "isMarking": 0,586 "menuDesc": "æé®",587 "menuIco": "",588 "menuName": "æ交",589 "menuUri": "/pc/recruit:commonChangeStatue",590 "parentId": 117,591 "sort": 118,592 "status": 0593 },594 {595 "hasChildren": false,596 "id": 119,597 "isButton": 2,598 "isMarking": 0,599 "menuDesc": "æé®",600 "menuIco": "",601 "menuName": "è¿å
¥èè¯",602 "menuUri": "/index/main/zpgl/zpgct:commonChangeStatue",603 "parentId": 103,604 "sort": 119,605 "status": 0606 },607 {608 "hasChildren": false,609 "id": 120,610 "isButton": 2,611 "isMarking": 0,612 "menuDesc": "æé®",613 "menuIco": "",614 "menuName": "æ交",615 "menuUri": "/pc/recruit:commonChangeStatue",616 "parentId": 119,617 "sort": 120,618 "status": 0619 },620 {621 "hasChildren": false,622 "id": 121,623 "isButton": 2,624 "isMarking": 0,625 "menuDesc": "æé®",626 "menuIco": "",627 "menuName": "æ¹éè¿å
¥èè¯",628 "menuUri": "/index/main/zpgl/zpgct:commonChangeStatue",629 "parentId": 103,630 "sort": 121,631 "status": 0632 },633 {634 "hasChildren": false,635 "id": 122,636 "isButton": 2,637 "isMarking": 0,638 "menuDesc": "æé®",639 "menuIco": "",640 "menuName": "æ交",641 "menuUri": "/pc/recruit:commonChangeStatue",642 "parentId": 121,643 "sort": 122,644 "status": 0645 },646 {647 "hasChildren": false,648 "id": 123,649 "isButton": 2,650 "isMarking": 0,651 "menuDesc": "æé®",652 "menuIco": "",653 "menuName": "èµæ ¼å®¡æ¥æªéè¿",654 "menuUri": "/index/main/zpgl/zpgct:qualificationAction",655 "parentId": 103,656 "sort": 123,657 "status": 0658 },659 {660 "hasChildren": false,661 "id": 125,662 "isButton": 2,663 "isMarking": 0,664 "menuDesc": "æé®",665 "menuIco": "",666 "menuName": "è¿å
¥ä½æ£",667 "menuUri": "/index/main/zpgl/zpgct:entryTest",668 "parentId": 103,669 "sort": 125,670 "status": 0671 },672 {673 "hasChildren": false,674 "id": 127,675 "isButton": 2,676 "isMarking": 0,677 "menuDesc": "æé®",678 "menuIco": "",679 "menuName": "å½å
¥ç¬è¯æ绩",680 "menuUri": "/index/main/zpgl/zpgc:enteringWrittenAchievement",681 "parentId": 103,682 "sort": 127,683 "status": 0684 },685 {686 "hasChildren": false,687 "id": 128,688 "isButton": 2,689 "isMarking": 0,690 "menuDesc": "æé®",691 "menuIco": "",692 "menuName": "æ交",693 "menuUri": "/pc/recruit:enteringWrittenAchievement",694 "parentId": 127,695 "sort": 128,696 "status": 0697 },698 {699 "hasChildren": false,700 "id": 129,701 "isButton": 2,702 "isMarking": 0,703 "menuDesc": "æé®",704 "menuIco": "",705 "menuName": "å½å
¥é¢è¯æ绩",706 "menuUri": "/index/main/zpgl/zpgc:enteringInterviewAchievement",707 "parentId": 103,708 "sort": 129,709 "status": 0710 },711 {712 "hasChildren": false,713 "id": 130,714 "isButton": 2,715 "isMarking": 0,716 "menuDesc": "æé®",717 "menuIco": "",718 "menuName": "æ交",719 "menuUri": "/pc/recruit:enteringInterviewAchievement",720 "parentId": 129,721 "sort": 130,722 "status": 0723 },724 {725 "hasChildren": false,726 "id": 131,727 "isButton": 2,728 "isMarking": 0,729 "menuDesc": "æé®",730 "menuIco": "",731 "menuName": "å½å
¥ä½æµæ绩",732 "menuUri": "/index/main/zpgl/zpgc:enteringSportAchievement",733 "parentId": 103,734 "sort": 131,735 "status": 0736 },737 {738 "hasChildren": false,739 "id": 132,740 "isButton": 2,741 "isMarking": 0,742 "menuDesc": "æé®",743 "menuIco": "",744 "menuName": "æ交",745 "menuUri": "/pc/recruit:enteringSportAchievement",746 "parentId": 131,747 "sort": 132,748 "status": 0749 },750 {751 "hasChildren": false,752 "id": 133,753 "isButton": 2,754 "isMarking": 0,755 "menuDesc": "æé®",756 "menuIco": "",757 "menuName": "å½å
¥ä½æ£ç»æ",758 "menuUri": "/index/main/zpgl/zpgc:enteringHealthExamination",759 "parentId": 103,760 "sort": 133,761 "status": 0762 },763 {764 "hasChildren": false,765 "id": 134,766 "isButton": 2,767 "isMarking": 0,768 "menuDesc": "æé®",769 "menuIco": "",770 "menuName": "æ交",771 "menuUri": "/pc/recruit:enteringHealthExamination",772 "parentId": 133,773 "sort": 134,774 "status": 0775 },776 {777 "hasChildren": false,778 "id": 135,779 "isButton": 2,780 "isMarking": 0,781 "menuDesc": "æé®",782 "menuIco": "",783 "menuName": "è¿å
¥æ¿å®¡",784 "menuUri": "/index/main/zpgl/zpgc:enteringPoliticalProcess",785 "parentId": 103,786 "sort": 135,787 "status": 0788 },789 {790 "hasChildren": false,791 "id": 136,792 "isButton": 2,793 "isMarking": 0,794 "menuDesc": "æé®",795 "menuIco": "",796 "menuName": "æ交",797 "menuUri": "/pc/recruit:commonChangeStatue",798 "parentId": 135,799 "sort": 136,800 "status": 0801 },802 {803 "hasChildren": false,804 "id": 137,805 "isButton": 2,806 "isMarking": 0,807 "menuDesc": "æé®",808 "menuIco": "",809 "menuName": "å½å
¥æ¿å®¡ç»æ",810 "menuUri": "/index/main/zpgl/zpgc:enteringPoliticalResult",811 "parentId": 103,812 "sort": 137,813 "status": 0814 },815 {816 "hasChildren": false,817 "id": 138,818 "isButton": 2,819 "isMarking": 0,820 "menuDesc": "æé®",821 "menuIco": "",822 "menuName": "æ交",823 "menuUri": "/pc/recruit:commonChangeStatue",824 "parentId": 137,825 "sort": 138,826 "status": 0827 },828 {829 "hasChildren": false,830 "id": 139,831 "isButton": 2,832 "isMarking": 0,833 "menuDesc": "æé®",834 "menuIco": "",835 "menuName": "è¿å
¥å²åå¹è®",836 "menuUri": "/index/main/zpgl/zpgc:batchEnteringTrain",837 "parentId": 103,838 "sort": 139,839 "status": 0840 },841 {842 "hasChildren": false,843 "id": 140,844 "isButton": 2,845 "isMarking": 0,846 "menuDesc": "æé®",847 "menuIco": "",848 "menuName": "æ交",849 "menuUri": "/pc/recruit:commonChangeStatue",850 "parentId": 139,851 "sort": 140,852 "status": 0853 },854 {855 "hasChildren": false,856 "id": 141,857 "isButton": 2,858 "isMarking": 0,859 "menuDesc": "æé®",860 "menuIco": "",861 "menuName": "å½å
¥èæ ¸ç»æ",862 "menuUri": "/index/main/zpgl/zpgc:enteringAssessResult",863 "parentId": 103,864 "sort": 141,865 "status": 0866 },867 {868 "hasChildren": false,869 "id": 142,870 "isButton": 2,871 "isMarking": 0,872 "menuDesc": "æé®",873 "menuIco": "",874 "menuName": "æ交",875 "menuUri": "/pc/recruit:enteringAssessResult",876 "parentId": 141,877 "sort": 142,878 "status": 0879 },880 {881 "hasChildren": false,882 "id": 143,883 "isButton": 2,884 "isMarking": 0,885 "menuDesc": "æé®",886 "menuIco": "",887 "menuName": "é¢å½ç¨",888 "menuUri": "/index/main/zpgl/zpgc:batchEnteringPublicity",889 "parentId": 103,890 "sort": 143,891 "status": 0892 },893 {894 "hasChildren": false,895 "id": 144,896 "isButton": 2,897 "isMarking": 0,898 "menuDesc": "æé®",899 "menuIco": "",900 "menuName": "æ交",901 "menuUri": "/pc/recruit:commonChangeStatue",902 "parentId": 143,903 "sort": 144,904 "status": 0905 },906 {907 "hasChildren": false,908 "id": 145,909 "isButton": 2,910 "isMarking": 0,911 "menuDesc": "æé®",912 "menuIco": "",913 "menuName": "ç¡®å®å½ç¨",914 "menuUri": "/index/main/zpgl/zpgc:batchEnteringPreHire",915 "parentId": 103,916 "sort": 145,917 "status": 0918 },919 {920 "hasChildren": false,921 "id": 146,922 "isButton": 2,923 "isMarking": 0,924 "menuDesc": "æé®",925 "menuIco": "",926 "menuName": "ç¡®å®",927 "menuUri": "/pc/recruit:commonChangeStatue",928 "parentId": 145,929 "sort": 146,930 "status": 0931 },932 {933 "hasChildren": false,934 "id": 147,935 "isButton": 2,936 "isMarking": 0,937 "menuDesc": "æé®",938 "menuIco": "",939 "menuName": "å½ç¨ä¸éè¿",940 "menuUri": "/index/main/zpgl/zpgc:forbidEnteringPreHired",941 "parentId": 103,942 "sort": 147,943 "status": 0944 },945 {946 "hasChildren": false,947 "id": 148,948 "isButton": 2,949 "isMarking": 0,950 "menuDesc": "æé®",951 "menuIco": "",952 "menuName": "ç¡®å®",953 "menuUri": "/pc/recruit:commonChangeStatue",954 "parentId": 147,955 "sort": 148,956 "status": 0957 }958];959const permMenuAndButton = {960 menuList: menuList,961 permButtonList: permButtonList962}963export default {964 method: 'post',965 path: 'getMenuButtonByUser',//getPermMenuAndButtonList getMenuButtonByUser966 data: () => {967 return {968 code: '000000',969 message: 'success',970 data: permMenuAndButton971 };972 }...
categories.ts
Source:categories.ts
1import { Category } from "../products";2//1 level3const category1_l1: Category = {4 id: 1,5 name: "snariazhenie",6 title: "СнаÑÑжение",7 parentCategory: null,8 attributes: [{id: 1}, {id: 2}, {id: 3}],9 hasChildren: true10}11const category2_l1: Category = {12 id: 2,13 name: "odezhda",14 title: "Ðдежда",15 parentCategory: null,16 attributes: [{id: 1}, {id: 2}, {id: 3}],17 hasChildren: true18}19const category3_l1: Category = {20 id: 3,21 name: "obuv",22 title: "ÐбÑвÑ",23 parentCategory: null,24 attributes: [{id: 1}, {id: 2}, {id: 3}],25 hasChildren: true26}27const category4_l1: Category = {28 id: 4,29 name: "aksessuary",30 title: "ÐкÑеÑÑÑаÑÑ",31 parentCategory: null,32 attributes: [{id: 1}, {id: 2}, {id: 3}],33 hasChildren: true34}35const category5_l1: Category = {36 id: 5,37 name: "bivak",38 title: "Ðивак",39 parentCategory: null,40 attributes: [{id: 1}, {id: 2}, {id: 3}],41 hasChildren: true42}43const category6_l1: Category = {44 id: 6,45 name: "zimnii-sport",46 title: "Ðимний ÑпоÑÑ",47 parentCategory: null,48 attributes: [{id: 1}, {id: 2}, {id: 3}],49 hasChildren: true50}51const category7_l1: Category = {52 id: 7,53 name: "tovary-obshego-naznachenia",54 title: "ТоваÑÑ Ð¾Ð±Ñего назнаÑениÑ",55 parentCategory: null,56 attributes: [{id: 1}, {id: 2}, {id: 3}],57 hasChildren: true58}59const category8_l1: Category = {60 id: 8,61 name: "akcii",62 title: "ÐкÑии",63 parentCategory: null,64 attributes: [{id: 1}, {id: 2}, {id: 3}],65 hasChildren: false66}67//-------2 level--------------68const category1_l2: Category = {69 id: 9,70 name: "verevki",71 title: "ÐеÑевки",72 parentCategory: {id: 1},73 attributes: [],74 hasChildren: false75}76const category2_l2: Category = {77 id: 10,78 name: "zhelezo",79 title: "Ðелезо",80 parentCategory: {id: 1},81 attributes: [],82 hasChildren: false83}84const category3_l2: Category = {85 id: 11,86 name: "kaski",87 title: "ÐаÑки",88 parentCategory: {id: 1},89 attributes: [],90 hasChildren: false91}92const category4_l2: Category = {93 id: 12,94 name: "ledovoe-snariazhenie",95 title: "Ðедовое ÑнаÑÑжение",96 parentCategory: {id: 1},97 attributes: [],98 hasChildren: false99}100const category5_l2: Category = {101 id: 13,102 name: "golovnie-ubori",103 title: "ÐоловнÑе ÑбоÑÑ",104 parentCategory: {id: 2},105 attributes: [],106 hasChildren: true107}108const category6_l2: Category = {109 id: 14,110 name: "zhileti",111 title: "ÐилеÑÑ",112 parentCategory: {id: 2},113 attributes: [],114 hasChildren: false115}116const category7_l2: Category = {117 id: 15,118 name: "noski",119 title: "ÐоÑки",120 parentCategory: {id: 2},121 attributes: [],122 hasChildren: false123}124const category8_l2: Category = {125 id: 16,126 name: "termobelie",127 title: "ТеÑмобелÑе",128 parentCategory: {id: 2},129 attributes: [],130 hasChildren: false131}132const category9_l2: Category = {133 id: 17,134 name: "shtany",135 title: "ШÑанÑ",136 parentCategory: {id: 2},137 attributes: [],138 hasChildren: true139}140const category10_l2: Category = {141 id: 18,142 name: "botinki",143 title: "ÐоÑинки",144 parentCategory: {id: 3},145 attributes: [],146 hasChildren: false147}148const category11_l2: Category = {149 id: 19,150 name: "krossovki",151 title: "ÐÑоÑÑовки",152 parentCategory: {id: 3},153 attributes: [],154 hasChildren: false155}156const category12_l2: Category = {157 id: 20,158 name: "sandalii",159 title: "Сандалии",160 parentCategory: {id: 3},161 attributes: [],162 hasChildren: false163}164const category13_l2: Category = {165 id: 21,166 name: "skalniki",167 title: "СкалÑники",168 parentCategory: {id: 3},169 attributes: [],170 hasChildren: false171}172const category14_l2: Category = {173 id: 22,174 name: "breloki",175 title: "ÐÑелоки",176 parentCategory: {id: 4},177 attributes: [],178 hasChildren: false179}180const category15_l2: Category = {181 id: 23,182 name: "zamki-dla-bagazha",183 title: "Ðамки Ð´Ð»Ñ Ð±Ð°Ð³Ð°Ð¶Ð°",184 parentCategory: {id: 4},185 attributes: [],186 hasChildren: false187}188const category16_l2: Category = {189 id: 24,190 name: "zonti",191 title: "ÐонÑÑ",192 parentCategory: {id: 4},193 attributes: [],194 hasChildren: false195}196const category17_l2: Category = {197 id: 25,198 name: "stiazhki-stropi",199 title: "СÑÑжки/ÑÑÑопÑ",200 parentCategory: {id: 4},201 attributes: [],202 hasChildren: false203}204const category18_l2: Category = {205 id: 26,206 name: "furnitura",207 title: "ФÑÑниÑÑÑа",208 parentCategory: {id: 4},209 attributes: [],210 hasChildren: false211}212const category19_l2: Category = {213 id: 27,214 name: "palatki",215 title: "ÐалаÑки",216 parentCategory: {id: 5},217 attributes: [{id: 4}, {id: 5}, {id: 6}, {id: 7}, {id: 8}],218 hasChildren: true219}220const category20_l2: Category = {221 id: 28,222 name: "tenti",223 title: "ТенÑÑ",224 parentCategory: {id: 5},225 attributes: [],226 hasChildren: false227}228const category21_l2: Category = {229 id: 29,230 name: "rukzaki",231 title: "Ð Ñкзаки",232 parentCategory: {id: 5},233 attributes: [],234 hasChildren: false235}236const category22_l2: Category = {237 id: 30,238 name: "spalnie-meshki",239 title: "СпалÑнÑе меÑки",240 parentCategory: {id: 5},241 attributes: [],242 hasChildren: false243}244const category23_l2: Category = {245 id: 31,246 name: "kovriki",247 title: "ÐовÑики",248 parentCategory: {id: 5},249 attributes: [],250 hasChildren: false251}252const category24_l2: Category = {253 id: 32,254 name: "posuda",255 title: "ÐоÑÑда",256 parentCategory: {id: 5},257 attributes: [],258 hasChildren: true259}260const category25_l2: Category = {261 id: 33,262 name: "mebel",263 title: "ÐебелÑ",264 parentCategory: {id: 5},265 attributes: [],266 hasChildren: true267}268const category26_l2: Category = {269 id: 34,270 name: "gornolizhnie-maski",271 title: "ÐоÑнолÑжнÑе маÑки",272 parentCategory: {id: 6},273 attributes: [],274 hasChildren: false275}276const category27_l2: Category = {277 id: 35,278 name: "gornolizhnie-shlemi",279 title: "ÐоÑнолÑжнÑе ÑлемÑ",280 parentCategory: {id: 6},281 attributes: [],282 hasChildren: false283}284const category28_l2: Category = {285 id: 36,286 name: "snegostupi",287 title: "СнегоÑÑÑпÑ",288 parentCategory: {id: 6},289 attributes: [],290 hasChildren: false291}292const category29_l2: Category = {293 id: 37,294 name: "chehli-dla-lizh-snoubordov",295 title: "ЧеÑ
Ð»Ñ Ð´Ð»Ñ Ð»Ñж/ÑноÑбоÑдов",296 parentCategory: {id: 6},297 attributes: [],298 hasChildren: false299}300const category30_l2: Category = {301 id: 38,302 name: "gamaki",303 title: "Ðамаки",304 parentCategory: {id: 7},305 attributes: [],306 hasChildren: false307}308const category31_l2: Category = {309 id: 39,310 name: "germoupakovki",311 title: "ÐеÑмоÑпаковки",312 parentCategory: {id: 7},313 attributes: [],314 hasChildren: false315}316const category32_l2: Category = {317 id: 40,318 name: "kompressionnie-meshki-chehli",319 title: "ÐомпÑеÑÑионнÑе меÑки/ÑеÑ
лÑ",320 parentCategory: {id: 7},321 attributes: [],322 hasChildren: false323}324const category33_l2: Category = {325 id: 41,326 name: "kosmetichki-koshelki",327 title: "ÐоÑмеÑиÑки/коÑелÑки",328 parentCategory: {id: 7},329 attributes: [],330 hasChildren: false331}332const category34_l2: Category = {333 id: 42,334 name: "sredstva-gigieni-polotenca",335 title: "СÑедÑÑва гигиенÑ/полоÑенÑа",336 parentCategory: {id: 7},337 attributes: [],338 hasChildren: false339}340const category35_l2: Category = {341 id: 43,342 name: "sumki",343 title: "СÑмки",344 parentCategory: {id: 7},345 attributes: [],346 hasChildren: false347}348const category36_l2: Category = {349 id: 44,350 name: "fonari",351 title: "ФонаÑи",352 parentCategory: {id: 7},353 attributes: [],354 hasChildren: false355}356//-------3 level--------------357const category1_l3: Category = {358 id: 45,359 name: "balaklavi-maski-podshlemniki",360 title: "ÐалаклавÑ/маÑки/подÑлемники",361 parentCategory: {id: 13},362 attributes: [],363 hasChildren: false364}365const category2_l3: Category = {366 id: 46,367 name: "kepki-panami",368 title: "Ðепки/панамÑ",369 parentCategory: {id: 13},370 attributes: [],371 hasChildren: false372}373const category3_l3: Category = {374 id: 47,375 name: "multifunkcionalnie",376 title: "ÐÑлÑÑиÑÑнкÑионалÑнÑе",377 parentCategory: {id: 13},378 attributes: [],379 hasChildren: false380}381const category4_l3: Category = {382 id: 48,383 name: "poviazki-na-golovu",384 title: "ÐовÑзки на головÑ",385 parentCategory: {id: 13},386 attributes: [],387 hasChildren: false388}389const category5_l3: Category = {390 id: 49,391 name: "poviazki-na-sheju",392 title: "ÐовÑзки на ÑеÑ",393 parentCategory: {id: 13},394 attributes: [],395 hasChildren: false396}397const category6_l3: Category = {398 id: 50,399 name: "shapki",400 title: "Шапки",401 parentCategory: {id: 13},402 attributes: [],403 hasChildren: false404}405const category7_l3: Category = {406 id: 51,407 name: "gornolizhnie-shtani",408 title: "ÐоÑнолÑжнÑе ÑÑанÑ",409 parentCategory: {id: 17},410 attributes: [],411 hasChildren: false412}413const category8_l3: Category = {414 id: 52,415 name: "uteplennie-shtani",416 title: "УÑепленнÑе ÑÑанÑ",417 parentCategory: {id: 17},418 attributes: [],419 hasChildren: false420}421const category9_l3: Category = {422 id: 53,423 name: "membrannie-shtani",424 title: "ÐембÑаннÑе ÑÑанÑ",425 parentCategory: {id: 17},426 attributes: [],427 hasChildren: false428}429const category10_l3: Category = {430 id: 54,431 name: "trekkingovie-gorodskie-shtani",432 title: "ТÑеккинговÑе/гоÑодÑкие ÑÑанÑ",433 parentCategory: {id: 17},434 attributes: [],435 hasChildren: false436}437const category11_l3: Category = {438 id: 55,439 name: "kenpingovie",440 title: "ÐемпинговÑе",441 parentCategory: {id: 27},442 attributes: [],443 hasChildren: false444}445const category12_l3: Category = {446 id: 56,447 name: "trekkingovie",448 title: "ТÑеккинговÑе",449 parentCategory: {id: 27},450 attributes: [],451 hasChildren: false452}453const category13_l3: Category = {454 id: 57,455 name: "kastruli-kotli",456 title: "ÐаÑÑÑÑли/коÑлÑ",457 parentCategory: {id: 32},458 attributes: [],459 hasChildren: false460}461const category14_l3: Category = {462 id: 58,463 name: "miski",464 title: "ÐиÑки",465 parentCategory: {id: 32},466 attributes: [],467 hasChildren: false468}469const category15_l3: Category = {470 id: 59,471 name: "termokruzhki",472 title: "ТеÑмокÑÑжки",473 parentCategory: {id: 32},474 attributes: [],475 hasChildren: false476}477const category16_l3: Category = {478 id: 60,479 name: "termosa",480 title: "ТеÑмоÑа",481 parentCategory: {id: 32},482 attributes: [],483 hasChildren: false484}485const category17_l3: Category = {486 id: 61,487 name: "kresla",488 title: "ÐÑеÑла",489 parentCategory: {id: 33},490 attributes: [],491 hasChildren: false492}493const category18_l3: Category = {494 id: 62,495 name: "stoli",496 title: "СÑолÑ",497 parentCategory: {id: 33},498 attributes: [],499 hasChildren: false...
【树】从平铺树中找到选择项的父系和子系.js
Source:【树】从平铺树中找到选择项的父系和子系.js
1/**2 * @description é®é¢æè¿°:3 * ä¸ä¸ªå¹³éºæ åæçéæ©æ¡ï¼å¾éäºæ项åè®°å½äºè¯¥é¡¹çidï¼éè¦æ¾å°å¾é项çç¶ç³»(ç¶é¡¹ãç¶é¡¹çç¶é¡¹â¦â¦)ååç³»(å项ãå项çå项â¦â¦)ã4 *5 * @example6 * æ¯å¦ï¼ä¸æ¹ä»£ç ä¸testTreeæ¯è¿ä¸ªå¹³éºæ ï¼selectedIdsæ¯å¾é项ï¼é£ä¹æç»å¾æ¾å°ï¼-1, 1, 1-1, 2, 2-1 (顺åºä¸è®º)7 */8const testTree = {9 1: {10 id: '1',11 pId: '-1',12 name: 'å°çåºæ¯',13 loaded: true,14 hasChildren: true,15 nodes: ['1-1', '1-2', '1-3', '1-4', '1-5', '1-6', '1-7'],16 detail: {17 id: '1',18 name: 'å°çåºæ¯',19 hasChildren: true,20 info: '',21 },22 detailLoaded: false,23 },24 2: {25 id: '2',26 pId: '-1',27 name: 'å°çå®ä½',28 loaded: true,29 hasChildren: true,30 nodes: ['2-1', '2-2', '2-3', '2-4', '2-5', '2-6', '2-7'],31 detail: {32 id: '2',33 name: 'å°çå®ä½',34 hasChildren: true,35 info: '',36 },37 detailLoaded: false,38 },39 3: {40 id: '3',41 pId: '-1',42 name: 'å°çåå
',43 loaded: true,44 hasChildren: true,45 nodes: ['3-1', '3-2', '3-3', '3-4', '3-5', '3-6', '3-7'],46 detail: {47 id: '3',48 name: 'å°çåå
',49 hasChildren: true,50 info: '',51 },52 detailLoaded: false,53 },54 4: {55 id: '4',56 pId: '-1',57 name: 'ç©èæç¥',58 loaded: true,59 hasChildren: true,60 nodes: ['4-1', '4-2', '4-3', '4-4', '4-5', '4-6', '4-7'],61 detail: {62 id: '4',63 name: 'ç©èæç¥',64 hasChildren: true,65 info: '',66 },67 detailLoaded: false,68 },69 '-1': {70 id: '-1',71 nodes: ['1', '2', '3', '4'],72 loaded: true,73 },74 '1-1': {75 id: '1-1',76 pId: '1',77 name: 'ç¹äº',78 loaded: true,79 hasChildren: false,80 detail: {81 id: '1-1',82 name: 'ç¹äº',83 hasChildren: false,84 info: '',85 isScene: true,86 opacity: 0.5,87 },88 detailLoaded: false,89 },90 '1-2': {91 id: '1-2',92 pId: '1',93 name: 'å°å½¢',94 loaded: true,95 hasChildren: false,96 detail: {97 id: '1-2',98 name: 'å°å½¢',99 hasChildren: false,100 info: '',101 isScene: true,102 },103 detailLoaded: false,104 },105 '1-3': {106 id: '1-3',107 pId: '1',108 name: 'å¾æ',109 loaded: true,110 hasChildren: false,111 detail: {112 id: '1-3',113 name: 'å¾æ',114 hasChildren: false,115 info: '',116 isScene: true,117 },118 detailLoaded: false,119 },120 '1-4': {121 id: '1-4',122 pId: '1',123 name: 'å®æ¯',124 loaded: true,125 hasChildren: false,126 detail: {127 id: '1-4',128 name: 'å®æ¯',129 hasChildren: false,130 info: '',131 isScene: true,132 },133 detailLoaded: false,134 },135 '1-5': {136 id: '1-5',137 pId: '1',138 name: 'DOM',139 loaded: true,140 hasChildren: false,141 detail: {142 id: '1-5',143 name: 'DOM',144 hasChildren: false,145 info: '',146 isScene: true,147 },148 detailLoaded: false,149 },150 '1-6': {151 id: '1-6',152 pId: '1',153 name: 'TDOM',154 loaded: true,155 hasChildren: false,156 detail: {157 id: '1-6',158 name: 'TDOM',159 hasChildren: false,160 info: '',161 isScene: true,162 },163 detailLoaded: false,164 },165 '1-7': {166 id: '1-7',167 pId: '1',168 name: 'å
¨è¦ç´ ',169 loaded: true,170 hasChildren: false,171 detail: {172 id: '1-7',173 name: 'å
¨è¦ç´ ',174 hasChildren: false,175 info: '',176 isScene: true,177 },178 detailLoaded: false,179 },180 '2-1': {181 id: '2-1',182 pId: '2',183 name: 'å®å°',184 loaded: true,185 hasChildren: false,186 detail: {187 id: '2-1',188 name: 'å®å°',189 hasChildren: false,190 info: '',191 },192 detailLoaded: false,193 },194 '2-2': {195 id: '2-2',196 pId: '2',197 name: 'é¢è½',198 loaded: true,199 hasChildren: false,200 detail: {201 id: '2-2',202 name: 'é¢è½',203 hasChildren: false,204 info: '',205 },206 detailLoaded: false,207 },208 '2-3': {209 id: '2-3',210 pId: '2',211 name: '建ç',212 loaded: true,213 hasChildren: false,214 detail: {215 id: '2-3',216 name: '建ç',217 hasChildren: false,218 info: '',219 },220 detailLoaded: false,221 },222 '2-4': {223 id: '2-4',224 pId: '2',225 name: 'æ°´ç³»',226 loaded: true,227 hasChildren: false,228 detail: {229 id: '2-4',230 name: 'æ°´ç³»',231 hasChildren: false,232 info: '',233 },234 detailLoaded: false,235 },236 '2-5': {237 id: '2-5',238 pId: '2',239 name: '交é',240 loaded: true,241 hasChildren: false,242 detail: {243 id: '2-5',244 name: '交é',245 hasChildren: false,246 info: '',247 },248 detailLoaded: false,249 },250 '2-6': {251 id: '2-6',252 pId: '2',253 name: '管线',254 loaded: true,255 hasChildren: false,256 detail: {257 id: '2-6',258 name: '管线',259 hasChildren: false,260 info: '',261 },262 detailLoaded: false,263 },264 '2-7': {265 id: '2-7',266 pId: '2',267 name: 'å°è´¨',268 loaded: true,269 hasChildren: false,270 detail: {271 id: '2-7',272 name: 'å°è´¨',273 hasChildren: false,274 info: '',275 },276 detailLoaded: false,277 },278 '3-1': {279 id: '3-1',280 pId: '3',281 name: 'åºå',282 loaded: true,283 hasChildren: false,284 detail: {285 id: '3-1',286 name: 'åºå',287 hasChildren: false,288 info: '',289 },290 detailLoaded: false,291 },292 '3-2': {293 id: '3-2',294 pId: '3',295 name: 'å°è²',296 loaded: true,297 hasChildren: false,298 detail: {299 id: '3-2',300 name: 'å°è²',301 hasChildren: false,302 info: '',303 },304 detailLoaded: false,305 },306 '3-3': {307 id: '3-3',308 pId: '3',309 name: 'ä¿æ¤å°',310 loaded: true,311 hasChildren: false,312 detail: {313 id: '3-3',314 name: 'ä¿æ¤å°',315 hasChildren: false,316 info: '',317 },318 detailLoaded: false,319 },320 '3-4': {321 id: '3-4',322 pId: '3',323 name: 'èå°',324 loaded: true,325 hasChildren: false,326 detail: {327 id: '3-4',328 name: 'èå°',329 hasChildren: false,330 info: '',331 },332 detailLoaded: false,333 },334 '3-5': {335 id: '3-5',336 pId: '3',337 name: 'é¢è½',338 loaded: true,339 hasChildren: false,340 detail: {341 id: '3-5',342 name: 'é¢è½',343 hasChildren: false,344 info: '',345 },346 detailLoaded: false,347 },348 '3-6': {349 id: '3-6',350 pId: '3',351 name: 'åè´¨',352 loaded: true,353 hasChildren: false,354 detail: {355 id: '3-6',356 name: 'åè´¨',357 hasChildren: false,358 info: '',359 },360 detailLoaded: false,361 },362 '3-7': {363 id: '3-7',364 pId: '3',365 name: 'æä¸',366 loaded: true,367 hasChildren: false,368 detail: {369 id: '3-7',370 name: 'æä¸',371 hasChildren: false,372 info: '',373 },374 detailLoaded: false,375 },376 '4-1': {377 id: '4-1',378 pId: '4',379 name: 'çæ§',380 loaded: true,381 hasChildren: false,382 detail: {383 id: '4-1',384 name: 'çæ§',385 hasChildren: false,386 info: '',387 },388 detailLoaded: false,389 },390 '4-2': {391 id: '4-2',392 pId: '4',393 name: 'çæµ',394 loaded: true,395 hasChildren: false,396 detail: {397 id: '4-2',398 name: 'çæµ',399 hasChildren: false,400 info: '',401 },402 detailLoaded: false,403 },404 '4-3': {405 id: '4-3',406 pId: '4',407 name: 'å®ä½',408 loaded: true,409 hasChildren: false,410 detail: {411 id: '4-3',412 name: 'å®ä½',413 hasChildren: false,414 info: '',415 },416 detailLoaded: false,417 },418 '4-4': {419 id: '4-4',420 pId: '4',421 name: 'åºç«',422 loaded: true,423 hasChildren: false,424 detail: {425 id: '4-4',426 name: 'åºç«',427 hasChildren: false,428 info: '',429 },430 detailLoaded: false,431 },432 '4-5': {433 id: '4-5',434 pId: '4',435 name: 'å¡æ£',436 loaded: true,437 hasChildren: false,438 detail: {439 id: '4-5',440 name: 'å¡æ£',441 hasChildren: false,442 info: '',443 },444 detailLoaded: false,445 },446 '4-6': {447 id: '4-6',448 pId: '4',449 name: 'ä½ç½®',450 loaded: true,451 hasChildren: false,452 detail: {453 id: '4-6',454 name: 'ä½ç½®',455 hasChildren: false,456 info: '',457 },458 detailLoaded: false,459 },460 '4-7': {461 id: '4-7',462 pId: '4',463 name: 'æ°è±¡',464 loaded: true,465 hasChildren: false,466 detail: {467 id: '4-7',468 name: 'æ°è±¡',469 hasChildren: false,470 info: '',471 },472 detailLoaded: false,473 },474};475const selectedIds = ['1-1', '2-1'];476//1. æ¾å°ç®æ èç¹çç¶ç³»ï¼ 2. æ¾å°ç®æ èç¹çåç³»477const treeFilter = (tree, ids) => {478 const finalTree = {};479 const copyChildren = (tree, children) => {480 children.forEach((chId) => {481 const child = tree[chId];482 finalTree[chId] = child;483 if (child.hasChildren || (child.nodes && child.nodes.length > 0))484 copyChildren(tree, child.nodes);485 });486 };487 const copyFather = (tree, pId) => {488 const father = tree[pId];489 finalTree[pId] = father;490 if (father.pId) copyFather(tree, father.pId);491 };492 ids.forEach((selectedId) => {493 const selectedItem = tree[selectedId];494 finalTree[selectedId] = selectedItem;495 //æ¾ç¶ç³»496 if (selectedItem.pId) {497 copyFather(tree, selectedItem.pId);498 }499 // æ¾åç³»500 if (501 selectedItem.hasChildren ||502 (selectedItem.nodes && selectedItem.nodes.length > 0)503 ) {504 copyChildren(tree, selectedItem.nodes);505 }506 });507 // 移é¤æ¯ä¸ªèç¹çå项ä¸ä¸åå¨ç项508 Object.keys(finalTree).forEach((nodeId) => {509 const node = finalTree[nodeId];510 if (node.hasChildren || (node.nodes && node.nodes.length)) {511 const chNodes = [];512 node.nodes.forEach((chNodeId, idx) => {513 if (finalTree[chNodeId]) {514 chNodes.push(chNodeId);515 }516 });517 if (chNodes.length == 0) {518 delete node.nodes;519 node.hasChildren = false;520 } else {521 node.nodes = chNodes;522 }523 }524 });525 return finalTree;526};527const test = treeFilter(testTree, selectedIds);...
Using AI Code Generation
1define('Mobile/SalesLogix/Views/Opportunity/List', [2], function(3) {4 return declare('Mobile.SalesLogix.Views.Opportunity.List', [List], {5 itemTemplate: new Simplate([6 '<h3>{%: $.Description %}</h3>',7 '<h4>{%: $.AccountName %}</h4>',8 '<h4>{%: Mobile.SalesLogix.Format.multiCurrency($.EstimatedClose, $.ExchangeRate) %}</h4>',9 '<h4>{%: Mobile.SalesLogix.Format.date($.EstimatedClose, true) %}</h4>'10 hashTagQueries: {11 },12 formatSearchQuery: function(searchQuery) {13 return string.substitute('(upper(Description) like "${0}%" or upper(AccountName
Using AI Code Generation
1define('Mobile/SalesLogix/Views/OpportunityContact/List', [2], function(3) {4 return declare('Mobile.SalesLogix.Views.OpportunityContact.List', [List], {5 itemTemplate: new Simplate([6 '<h3>{%: $.ContactName %}</h3>',7 '<h4>{%: $.AccountName %}</h4>',8 '<h4>{%: $.Title %}</h4>'
Using AI Code Generation
1define('Mobile/SalesLogix/Views/OpportunityContact/List', [2], function(3) {4 return declare('Mobile.SalesLogix.Views.OpportunityContact.List', [List], {5 itemTemplate: new Simplate([6 '<h3>{%: $.ContactName %}</h3>',7 '<h4>{%: $.AccountName %}</h4>',8 '<h4>{%: $.Role %}</h4>'9 formatSearchQuery: function(searchQuery) {10 return string.substitute('upper(ContactName) like "${0}%" or upper(AccountName) like "${0}%"', [this.escapeSearchQuery(searchQuery.toUpperCase())]);11 },12 createToolLayout: function() {13 return this.tools || (this.tools = {14 'tbar': [{15 security: App.getViewSecurity(this.insertView, 'insert')16 }, {17 security: App.getViewSecurity(this.editView, 'update')18 }]19 });20 }21 });22});23define('Mobile/SalesLogix/Views/OpportunityContact/Detail', [
Using AI Code Generation
1require([2], function(3) {4 var test = declare('test', [_DetailBase], {5 hasChildren: function(entry) {6 return true;7 }8 });9 return test;10});
Using AI Code Generation
1define('Sage/Platform/Mobile/Store', [2], function(3) {4 return declare('Sage.Platform.Mobile.Store', [Memory], {5 constructor: function(options) {6 options = options || {};7 this.idProperty = options.idProperty || this.idProperty;8 this.data = options.data || this.data || [];9 this.index = {};10 this.setData(this.data);11 },12 setData: function(data) {13 this.data = data;14 this.index = {};15 this._rebuildIndex();16 },17 add: function(object, options) {18 return this.put(object, options);19 },20 put: function(object, options) {21 options = options || {};22 var id = this.getIdentity(object);23 if (id == null) {24 id = this._createIdentity(object);25 }26 if (id in this.index) {27 this.data[this.index[id]] = object;28 } else {29 this.index[id] = this.data.push(object) - 1;30 }31 return id;32 },33 get: function(id, options) {34 if (id in this.index) {35 return this.data[this.index[id]];36 }37 return null;38 },39 remove: function(id, options) {40 if (id in this.index) {41 this.data.splice(this.index[id], 1);42 this._rebuildIndex();43 return true;44 }45 return false;46 },47 query: function(query, options) {48 return QueryResults(this._filter(this.data, query, options));49 },50 hasChildren: function(id) {51 var item = this.get(id);52 if (item) {53 return item['$resources'] ? item['$resources'].length > 0 : false;54 }55 return false;56 },
Using AI Code Generation
1define('Sage/Utility/tests/nls/en-us/test', {2 root: {3 }4});5},6'Sage/Utility/tests/nls/test':function(){7define('Sage/Utility/tests/nls/test', ['Sage/Utility/tests/nls/en-us/test'], function () { });8},9'Sage/Utility/File/nls/en-us/GoogleDocPicker':function(){10define('Sage/Utility/File/nls/en-us/GoogleDocPicker',{});11},12'Sage/Utility/File/nls/GoogleDocPicker':function(){13define('Sage/Utility/File/nls/GoogleDocPicker', ['Sage/Utility/File/nls/en-us/GoogleDocPicker'], function () { });14},15'Sage/UI/nls/en-us/ConditionManager':function(){16define(17 "Sage/UI/nls/en-us/ConditionManager", ({18 })19);20},21'Sage/UI/nls/ConditionManager':function(){22define('Sage/UI/nls/ConditionManager', ['Sage/UI/nls/en-us/ConditionManager'], function () { });23},24'Sage/UI/Dashboard/nls/en-us/WidgetDefinition':function(){25define(26 "Sage/UI/Dashboard/nls/en-us/WidgetDefinition", ({
Using AI Code Generation
1var relatedViewManager = App.getView('relatedViewManager');2var hasChildren = relatedViewManager.hasChildren('Opportunity', 'Contact');3console.log(hasChildren);4var relatedViewManager = App.getView('relatedViewManager');5var relatedViews = relatedViewManager.getRelatedViews('Opportunity', 'Contact');6console.log(relatedViews);7var relatedViewManager = App.getView('relatedViewManager');8var relatedView = relatedViewManager.getRelatedView('Opportunity', 'Contact');9console.log(relatedView);10var relatedViewManager = App.getView('relatedViewManager');11var relatedView = relatedViewManager.getRelatedView('Opportunity', 'Contact', 'opportunity_contact_related');12console.log(relatedView);13var relatedViewManager = App.getView('relatedViewManager');14var relatedView = relatedViewManager.getRelatedView('Opportunity', 'Contact', 'opportunity_contact_related', 'opportunity_contact_related');15console.log(relatedView);16var relatedViewManager = App.getView('relatedViewManager');17var relatedView = relatedViewManager.getRelatedView('Opportunity', 'Contact', 'opportunity_contact_related', 'opportunity_contact_related', 'opportunity_contact_related');18console.log(relatedView);19var relatedViewManager = App.getView('relatedViewManager');20var relatedView = relatedViewManager.getRelatedView('Opportunity', 'Contact', 'opportunity_contact_related', 'opportunity_contact_related', 'opportunity_contact_related', 'opportunity_contact_related');21console.log(relatedView);
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!