prolog.all-0.0.1.js 366 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467
  1. "use strict";
  2. var _oMultiDiff;
  3. function _typeof(obj) {
  4. return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  5. return typeof obj;
  6. } : function(obj) {
  7. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  8. })(obj);
  9. }
  10. function _defineProperty(obj, key, value) {
  11. return key in obj ? Object.defineProperty(obj, key, {
  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QQLLNJJYMSOYQBZGDLYXYLCQYXTSZEGXHZGLHWBLJHEYXTWQMAKBPQCGYSHHEGQCMWYYWLJYJHYYZLLJJYLHZYHMGSLJLJXCJJYCLYCJPCPZJZJMMYLCQLNQLJQJSXYJMLSZLJQLYCMMHCFMMFPQQMFYLQMCFFQMMMMHMZNFHHJGTTHHKHSLNCHHYQDXTMMQDCYZYXYQMYQYLTDCYYYZAZZCYMZYDLZFFFMMYCQZWZZMABTBYZTDMNZZGGDFTYPCGQYTTSSFFWFDTZQSSYSTWXJHXYTSXXYLBYQHWWKXHZXWZNNZZJZJJQJCCCHYYXBZXZCYZTLLCQXYNJYCYYCYNZZQYYYEWYCZDCJYCCHYJLBTZYYCQWMPWPYMLGKDLDLGKQQBGYCHJXY", oMultiDiff = (_defineProperty(_oMultiDiff = {
  19. 19969: "DZ",
  20. 19975: "WM",
  21. 19988: "QJ",
  22. 20048: "YL",
  23. 20056: "SC",
  24. 20060: "NM",
  25. 20094: "QG",
  26. 20127: "QJ",
  27. 20167: "QC",
  28. 20193: "YG",
  29. 20250: "KH",
  30. 20256: "ZC",
  31. 20282: "SC",
  32. 20285: "QJG",
  33. 20291: "TD",
  34. 20314: "YD",
  35. 20340: "NE",
  36. 20375: "TD",
  37. 20389: "YJ",
  38. 20391: "CZ",
  39. 20415: "PB",
  40. 20446: "YS",
  41. 20447: "SQ",
  42. 20504: "TC",
  43. 20608: "KG",
  44. 20854: "QJ",
  45. 20857: "ZC",
  46. 20911: "PF"
  47. }, "20504", "TC"), _defineProperty(_oMultiDiff, "20608", "KG"), _defineProperty(_oMultiDiff, "20854", "QJ"),
  48. _defineProperty(_oMultiDiff, "20857", "ZC"), _defineProperty(_oMultiDiff, "20911", "PF"),
  49. _defineProperty(_oMultiDiff, 20985, "AW"), _defineProperty(_oMultiDiff, 21032, "PB"),
  50. _defineProperty(_oMultiDiff, 21048, "XQ"), _defineProperty(_oMultiDiff, 21049, "SC"),
  51. _defineProperty(_oMultiDiff, 21089, "YS"), _defineProperty(_oMultiDiff, 21119, "JC"),
  52. _defineProperty(_oMultiDiff, 21242, "SB"), _defineProperty(_oMultiDiff, 21273, "SC"),
  53. _defineProperty(_oMultiDiff, 21305, "YP"), _defineProperty(_oMultiDiff, 21306, "QO"),
  54. _defineProperty(_oMultiDiff, 21330, "ZC"), _defineProperty(_oMultiDiff, 21333, "SDC"),
  55. _defineProperty(_oMultiDiff, 21345, "QK"), _defineProperty(_oMultiDiff, 21378, "CA"),
  56. _defineProperty(_oMultiDiff, 21397, "SC"), _defineProperty(_oMultiDiff, 21414, "XS"),
  57. _defineProperty(_oMultiDiff, 21442, "SC"), _defineProperty(_oMultiDiff, 21477, "JG"),
  58. _defineProperty(_oMultiDiff, 21480, "TD"), _defineProperty(_oMultiDiff, 21484, "ZS"),
  59. _defineProperty(_oMultiDiff, 21494, "YX"), _defineProperty(_oMultiDiff, 21505, "YX"),
  60. _defineProperty(_oMultiDiff, 21512, "HG"), _defineProperty(_oMultiDiff, 21523, "XH"),
  61. _defineProperty(_oMultiDiff, 21537, "PB"), _defineProperty(_oMultiDiff, 21542, "PF"),
  62. _defineProperty(_oMultiDiff, 21549, "KH"), _defineProperty(_oMultiDiff, 21571, "E"),
  63. _defineProperty(_oMultiDiff, 21574, "DA"), _defineProperty(_oMultiDiff, 21588, "TD"),
  64. _defineProperty(_oMultiDiff, 21589, "O"), _defineProperty(_oMultiDiff, 21618, "ZC"),
  65. _defineProperty(_oMultiDiff, 21621, "KHA"), _defineProperty(_oMultiDiff, 21632, "ZJ"),
  66. _defineProperty(_oMultiDiff, 21654, "KG"), _defineProperty(_oMultiDiff, 21679, "LKG"),
  67. _defineProperty(_oMultiDiff, 21683, "KH"), _defineProperty(_oMultiDiff, 21710, "A"),
  68. _defineProperty(_oMultiDiff, 21719, "YH"), _defineProperty(_oMultiDiff, 21734, "WOE"),
  69. _defineProperty(_oMultiDiff, 21769, "A"), _defineProperty(_oMultiDiff, 21780, "WN"),
  70. _defineProperty(_oMultiDiff, 21804, "XH"), _defineProperty(_oMultiDiff, 21834, "A"),
  71. _defineProperty(_oMultiDiff, 21899, "ZD"), _defineProperty(_oMultiDiff, 21903, "RN"),
  72. _defineProperty(_oMultiDiff, 21908, "WO"), _defineProperty(_oMultiDiff, 21939, "ZC"),
  73. _defineProperty(_oMultiDiff, 21956, "SA"), _defineProperty(_oMultiDiff, 21964, "YA"),
  74. _defineProperty(_oMultiDiff, 21970, "TD"), _defineProperty(_oMultiDiff, 22003, "A"),
  75. _defineProperty(_oMultiDiff, 22031, "JG"), _defineProperty(_oMultiDiff, 22040, "XS"),
  76. _defineProperty(_oMultiDiff, 22060, "ZC"), _defineProperty(_oMultiDiff, 22066, "ZC"),
  77. _defineProperty(_oMultiDiff, 22079, "MH"), _defineProperty(_oMultiDiff, 22129, "XJ"),
  78. _defineProperty(_oMultiDiff, 22179, "XA"), _defineProperty(_oMultiDiff, 22237, "NJ"),
  79. _defineProperty(_oMultiDiff, 22244, "TD"), _defineProperty(_oMultiDiff, 22280, "JQ"),
  80. _defineProperty(_oMultiDiff, 22300, "YH"), _defineProperty(_oMultiDiff, 22313, "XW"),
  81. _defineProperty(_oMultiDiff, 22331, "YQ"), _defineProperty(_oMultiDiff, 22343, "YJ"),
  82. _defineProperty(_oMultiDiff, 22351, "PH"), _defineProperty(_oMultiDiff, 22395, "DC"),
  83. _defineProperty(_oMultiDiff, 22412, "TD"), _defineProperty(_oMultiDiff, 22484, "PB"),
  84. _defineProperty(_oMultiDiff, 22500, "PB"), _defineProperty(_oMultiDiff, 22534, "ZD"),
  85. _defineProperty(_oMultiDiff, 22549, "DH"), _defineProperty(_oMultiDiff, 22561, "PB"),
  86. _defineProperty(_oMultiDiff, 22612, "TD"), _defineProperty(_oMultiDiff, 22771, "KQ"),
  87. _defineProperty(_oMultiDiff, 22831, "HB"), _defineProperty(_oMultiDiff, 22841, "JG"),
  88. _defineProperty(_oMultiDiff, 22855, "QJ"), _defineProperty(_oMultiDiff, 22865, "XQ"),
  89. _defineProperty(_oMultiDiff, 23013, "ML"), _defineProperty(_oMultiDiff, 23081, "WM"),
  90. _defineProperty(_oMultiDiff, 23487, "SX"), _defineProperty(_oMultiDiff, 23558, "QJ"),
  91. _defineProperty(_oMultiDiff, 23561, "YW"), _defineProperty(_oMultiDiff, 23586, "YW"),
  92. _defineProperty(_oMultiDiff, 23614, "YW"), _defineProperty(_oMultiDiff, 23615, "SN"),
  93. _defineProperty(_oMultiDiff, 23631, "PB"), _defineProperty(_oMultiDiff, 23646, "ZS"),
  94. _defineProperty(_oMultiDiff, 23663, "ZT"), _defineProperty(_oMultiDiff, 23673, "YG"),
  95. _defineProperty(_oMultiDiff, 23762, "TD"), _defineProperty(_oMultiDiff, 23769, "ZS"),
  96. _defineProperty(_oMultiDiff, 23780, "QJ"), _defineProperty(_oMultiDiff, 23884, "QK"),
  97. _defineProperty(_oMultiDiff, 24055, "XH"), _defineProperty(_oMultiDiff, 24113, "DC"),
  98. _defineProperty(_oMultiDiff, 24162, "ZC"), _defineProperty(_oMultiDiff, 24191, "GA"),
  99. _defineProperty(_oMultiDiff, 24273, "QJ"), _defineProperty(_oMultiDiff, 24324, "NL"),
  100. _defineProperty(_oMultiDiff, 24377, "TD"), _defineProperty(_oMultiDiff, 24378, "QJ"),
  101. _defineProperty(_oMultiDiff, 24439, "PF"), _defineProperty(_oMultiDiff, 24554, "ZS"),
  102. _defineProperty(_oMultiDiff, 24683, "TD"), _defineProperty(_oMultiDiff, 24694, "WE"),
  103. _defineProperty(_oMultiDiff, 24733, "LK"), _defineProperty(_oMultiDiff, 24925, "TN"),
  104. _defineProperty(_oMultiDiff, 25094, "ZG"), _defineProperty(_oMultiDiff, 25100, "XQ"),
  105. _defineProperty(_oMultiDiff, 25103, "XH"), _defineProperty(_oMultiDiff, 25153, "PB"),
  106. _defineProperty(_oMultiDiff, 25170, "PB"), _defineProperty(_oMultiDiff, 25179, "KG"),
  107. _defineProperty(_oMultiDiff, 25203, "PB"), _defineProperty(_oMultiDiff, 25240, "ZS"),
  108. _defineProperty(_oMultiDiff, 25282, "FB"), _defineProperty(_oMultiDiff, 25303, "NA"),
  109. _defineProperty(_oMultiDiff, 25324, "KG"), _defineProperty(_oMultiDiff, 25341, "ZY"),
  110. _defineProperty(_oMultiDiff, 25373, "WZ"), _defineProperty(_oMultiDiff, 25375, "XJ"),
  111. _defineProperty(_oMultiDiff, 25384, "A"), _defineProperty(_oMultiDiff, 25457, "A"),
  112. _defineProperty(_oMultiDiff, 25528, "SD"), _defineProperty(_oMultiDiff, 25530, "SC"),
  113. _defineProperty(_oMultiDiff, 25552, "TD"), _defineProperty(_oMultiDiff, 25774, "ZC"),
  114. _defineProperty(_oMultiDiff, 25874, "ZC"), _defineProperty(_oMultiDiff, 26044, "YW"),
  115. _defineProperty(_oMultiDiff, 26080, "WM"), _defineProperty(_oMultiDiff, 26292, "PB"),
  116. _defineProperty(_oMultiDiff, 26333, "PB"), _defineProperty(_oMultiDiff, 26355, "ZY"),
  117. _defineProperty(_oMultiDiff, 26366, "CZ"), _defineProperty(_oMultiDiff, 26397, "ZC"),
  118. _defineProperty(_oMultiDiff, 26399, "QJ"), _defineProperty(_oMultiDiff, 26415, "ZS"),
  119. _defineProperty(_oMultiDiff, 26451, "SB"), _defineProperty(_oMultiDiff, 26526, "ZC"),
  120. _defineProperty(_oMultiDiff, 26552, "JG"), _defineProperty(_oMultiDiff, 26561, "TD"),
  121. _defineProperty(_oMultiDiff, 26588, "JG"), _defineProperty(_oMultiDiff, 26597, "CZ"),
  122. _defineProperty(_oMultiDiff, 26629, "ZS"), _defineProperty(_oMultiDiff, 26638, "YL"),
  123. _defineProperty(_oMultiDiff, 26646, "XQ"), _defineProperty(_oMultiDiff, 26653, "KG"),
  124. _defineProperty(_oMultiDiff, 26657, "XJ"), _defineProperty(_oMultiDiff, 26727, "HG"),
  125. _defineProperty(_oMultiDiff, 26894, "ZC"), _defineProperty(_oMultiDiff, 26937, "ZS"),
  126. _defineProperty(_oMultiDiff, 26946, "ZC"), _defineProperty(_oMultiDiff, 26999, "KJ"),
  127. _defineProperty(_oMultiDiff, 27099, "KJ"), _defineProperty(_oMultiDiff, 27449, "YQ"),
  128. _defineProperty(_oMultiDiff, 27481, "XS"), _defineProperty(_oMultiDiff, 27542, "ZS"),
  129. _defineProperty(_oMultiDiff, 27663, "ZS"), _defineProperty(_oMultiDiff, 27748, "TS"),
  130. _defineProperty(_oMultiDiff, 27784, "SC"), _defineProperty(_oMultiDiff, 27788, "ZD"),
  131. _defineProperty(_oMultiDiff, 27795, "TD"), _defineProperty(_oMultiDiff, 27812, "O"),
  132. _defineProperty(_oMultiDiff, 27850, "PB"), _defineProperty(_oMultiDiff, 27852, "MB"),
  133. _defineProperty(_oMultiDiff, 27895, "SL"), _defineProperty(_oMultiDiff, 27898, "PL"),
  134. _defineProperty(_oMultiDiff, 27973, "QJ"), _defineProperty(_oMultiDiff, 27981, "KH"),
  135. _defineProperty(_oMultiDiff, 27986, "HX"), _defineProperty(_oMultiDiff, 27994, "XJ"),
  136. _defineProperty(_oMultiDiff, 28044, "YC"), _defineProperty(_oMultiDiff, 28065, "WG"),
  137. _defineProperty(_oMultiDiff, 28177, "SM"), _defineProperty(_oMultiDiff, 28267, "QJ"),
  138. _defineProperty(_oMultiDiff, 28291, "KH"), _defineProperty(_oMultiDiff, 28337, "ZQ"),
  139. _defineProperty(_oMultiDiff, 28463, "TL"), _defineProperty(_oMultiDiff, 28548, "DC"),
  140. _defineProperty(_oMultiDiff, 28601, "TD"), _defineProperty(_oMultiDiff, 28689, "PB"),
  141. _defineProperty(_oMultiDiff, 28805, "JG"), _defineProperty(_oMultiDiff, 28820, "QG"),
  142. _defineProperty(_oMultiDiff, 28846, "PB"), _defineProperty(_oMultiDiff, 28952, "TD"),
  143. _defineProperty(_oMultiDiff, 28975, "ZC"), _defineProperty(_oMultiDiff, 29100, "A"),
  144. _defineProperty(_oMultiDiff, 29325, "QJ"), _defineProperty(_oMultiDiff, 29575, "SL"),
  145. _defineProperty(_oMultiDiff, 29602, "FB"), _defineProperty(_oMultiDiff, 30010, "TD"),
  146. _defineProperty(_oMultiDiff, 30044, "CX"), _defineProperty(_oMultiDiff, 30058, "PF"),
  147. _defineProperty(_oMultiDiff, 30091, "YSP"), _defineProperty(_oMultiDiff, 30111, "YN"),
  148. _defineProperty(_oMultiDiff, 30229, "XJ"), _defineProperty(_oMultiDiff, 30427, "SC"),
  149. _defineProperty(_oMultiDiff, 30465, "SX"), _defineProperty(_oMultiDiff, 30631, "YQ"),
  150. _defineProperty(_oMultiDiff, 30655, "QJ"), _defineProperty(_oMultiDiff, 30684, "QJG"),
  151. _defineProperty(_oMultiDiff, 30707, "SD"), _defineProperty(_oMultiDiff, 30729, "XH"),
  152. _defineProperty(_oMultiDiff, 30796, "LG"), _defineProperty(_oMultiDiff, 30917, "PB"),
  153. _defineProperty(_oMultiDiff, 31074, "NM"), _defineProperty(_oMultiDiff, 31085, "JZ"),
  154. _defineProperty(_oMultiDiff, 31109, "SC"), _defineProperty(_oMultiDiff, 31181, "ZC"),
  155. _defineProperty(_oMultiDiff, 31192, "MLB"), _defineProperty(_oMultiDiff, 31293, "JQ"),
  156. _defineProperty(_oMultiDiff, 31400, "YX"), _defineProperty(_oMultiDiff, 31584, "YJ"),
  157. _defineProperty(_oMultiDiff, 31896, "ZN"), _defineProperty(_oMultiDiff, 31909, "ZY"),
  158. _defineProperty(_oMultiDiff, 31995, "XJ"), _defineProperty(_oMultiDiff, 32321, "PF"),
  159. _defineProperty(_oMultiDiff, 32327, "ZY"), _defineProperty(_oMultiDiff, 32418, "HG"),
  160. _defineProperty(_oMultiDiff, 32420, "XQ"), _defineProperty(_oMultiDiff, 32421, "HG"),
  161. _defineProperty(_oMultiDiff, 32438, "LG"), _defineProperty(_oMultiDiff, 32473, "GJ"),
  162. _defineProperty(_oMultiDiff, 32488, "TD"), _defineProperty(_oMultiDiff, 32521, "QJ"),
  163. _defineProperty(_oMultiDiff, 32527, "PB"), _defineProperty(_oMultiDiff, 32562, "ZSQ"),
  164. _defineProperty(_oMultiDiff, 32564, "JZ"), _defineProperty(_oMultiDiff, 32735, "ZD"),
  165. _defineProperty(_oMultiDiff, 32793, "PB"), _defineProperty(_oMultiDiff, 33071, "PF"),
  166. _defineProperty(_oMultiDiff, 33098, "XL"), _defineProperty(_oMultiDiff, 33100, "YA"),
  167. _defineProperty(_oMultiDiff, 33152, "PB"), _defineProperty(_oMultiDiff, 33261, "CX"),
  168. _defineProperty(_oMultiDiff, 33324, "BP"), _defineProperty(_oMultiDiff, 33333, "TD"),
  169. _defineProperty(_oMultiDiff, 33406, "YA"), _defineProperty(_oMultiDiff, 33426, "WM"),
  170. _defineProperty(_oMultiDiff, 33432, "PB"), _defineProperty(_oMultiDiff, 33445, "JG"),
  171. _defineProperty(_oMultiDiff, 33486, "ZN"), _defineProperty(_oMultiDiff, 33493, "TS"),
  172. _defineProperty(_oMultiDiff, 33507, "QJ"), _defineProperty(_oMultiDiff, 33540, "QJ"),
  173. _defineProperty(_oMultiDiff, 33544, "ZC"), _defineProperty(_oMultiDiff, 33564, "XQ"),
  174. _defineProperty(_oMultiDiff, 33617, "YT"), _defineProperty(_oMultiDiff, 33632, "QJ"),
  175. _defineProperty(_oMultiDiff, 33636, "XH"), _defineProperty(_oMultiDiff, 33637, "YX"),
  176. _defineProperty(_oMultiDiff, 33694, "WG"), _defineProperty(_oMultiDiff, 33705, "PF"),
  177. _defineProperty(_oMultiDiff, 33728, "YW"), _defineProperty(_oMultiDiff, 33882, "SR"),
  178. _defineProperty(_oMultiDiff, 34067, "WM"), _defineProperty(_oMultiDiff, 34074, "YW"),
  179. _defineProperty(_oMultiDiff, 34121, "QJ"), _defineProperty(_oMultiDiff, 34255, "ZC"),
  180. _defineProperty(_oMultiDiff, 34259, "XL"), _defineProperty(_oMultiDiff, 34425, "JH"),
  181. _defineProperty(_oMultiDiff, 34430, "XH"), _defineProperty(_oMultiDiff, 34485, "KH"),
  182. _defineProperty(_oMultiDiff, 34503, "YS"), _defineProperty(_oMultiDiff, 34532, "HG"),
  183. _defineProperty(_oMultiDiff, 34552, "XS"), _defineProperty(_oMultiDiff, 34558, "YE"),
  184. _defineProperty(_oMultiDiff, 34593, "ZL"), _defineProperty(_oMultiDiff, 34660, "YQ"),
  185. _defineProperty(_oMultiDiff, 34892, "XH"), _defineProperty(_oMultiDiff, 34928, "SC"),
  186. _defineProperty(_oMultiDiff, 34999, "QJ"), _defineProperty(_oMultiDiff, 35048, "PB"),
  187. _defineProperty(_oMultiDiff, 35059, "SC"), _defineProperty(_oMultiDiff, 35098, "ZC"),
  188. _defineProperty(_oMultiDiff, 35203, "TQ"), _defineProperty(_oMultiDiff, 35265, "JX"),
  189. _defineProperty(_oMultiDiff, 35299, "JX"), _defineProperty(_oMultiDiff, 35782, "SZ"),
  190. _defineProperty(_oMultiDiff, 35828, "YS"), _defineProperty(_oMultiDiff, 35830, "E"),
  191. _defineProperty(_oMultiDiff, 35843, "TD"), _defineProperty(_oMultiDiff, 35895, "YG"),
  192. _defineProperty(_oMultiDiff, 35977, "MH"), _defineProperty(_oMultiDiff, 36158, "JG"),
  193. _defineProperty(_oMultiDiff, 36228, "QJ"), _defineProperty(_oMultiDiff, 36426, "XQ"),
  194. _defineProperty(_oMultiDiff, 36466, "DC"), _defineProperty(_oMultiDiff, 36710, "JC"),
  195. _defineProperty(_oMultiDiff, 36711, "ZYG"), _defineProperty(_oMultiDiff, 36767, "PB"),
  196. _defineProperty(_oMultiDiff, 36866, "SK"), _defineProperty(_oMultiDiff, 36951, "YW"),
  197. _defineProperty(_oMultiDiff, 37034, "YX"), _defineProperty(_oMultiDiff, 37063, "XH"),
  198. _defineProperty(_oMultiDiff, 37218, "ZC"), _defineProperty(_oMultiDiff, 37325, "ZC"),
  199. _defineProperty(_oMultiDiff, 38063, "PB"), _defineProperty(_oMultiDiff, 38079, "TD"),
  200. _defineProperty(_oMultiDiff, 38085, "QY"), _defineProperty(_oMultiDiff, 38107, "DC"),
  201. _defineProperty(_oMultiDiff, 38116, "TD"), _defineProperty(_oMultiDiff, 38123, "YD"),
  202. _defineProperty(_oMultiDiff, 38224, "HG"), _defineProperty(_oMultiDiff, 38241, "XTC"),
  203. _defineProperty(_oMultiDiff, 38271, "ZC"), _defineProperty(_oMultiDiff, 38415, "YE"),
  204. _defineProperty(_oMultiDiff, 38426, "KH"), _defineProperty(_oMultiDiff, 38461, "YD"),
  205. _defineProperty(_oMultiDiff, 38463, "AE"), _defineProperty(_oMultiDiff, 38466, "PB"),
  206. _defineProperty(_oMultiDiff, 38477, "XJ"), _defineProperty(_oMultiDiff, 38518, "YT"),
  207. _defineProperty(_oMultiDiff, 38551, "WK"), _defineProperty(_oMultiDiff, 38585, "ZC"),
  208. _defineProperty(_oMultiDiff, 38704, "XS"), _defineProperty(_oMultiDiff, 38739, "LJ"),
  209. _defineProperty(_oMultiDiff, 38761, "GJ"), _defineProperty(_oMultiDiff, 38808, "SQ"),
  210. _defineProperty(_oMultiDiff, 39048, "JG"), _defineProperty(_oMultiDiff, 39049, "XJ"),
  211. _defineProperty(_oMultiDiff, 39052, "HG"), _defineProperty(_oMultiDiff, 39076, "CZ"),
  212. _defineProperty(_oMultiDiff, 39271, "XT"), _defineProperty(_oMultiDiff, 39534, "TD"),
  213. _defineProperty(_oMultiDiff, 39552, "TD"), _defineProperty(_oMultiDiff, 39584, "PB"),
  214. _defineProperty(_oMultiDiff, 39647, "SB"), _defineProperty(_oMultiDiff, 39730, "LG"),
  215. _defineProperty(_oMultiDiff, 39748, "TPB"), _defineProperty(_oMultiDiff, 40109, "ZQ"),
  216. _defineProperty(_oMultiDiff, 40479, "ND"), _defineProperty(_oMultiDiff, 40516, "HG"),
  217. _defineProperty(_oMultiDiff, 40536, "HG"), _defineProperty(_oMultiDiff, 40583, "QJ"),
  218. _defineProperty(_oMultiDiff, 40765, "YQ"), _defineProperty(_oMultiDiff, 40784, "QJ"),
  219. _defineProperty(_oMultiDiff, 40840, "YK"), _defineProperty(_oMultiDiff, 40863, "QJG"),
  220. _oMultiDiff);
  221. function makePy(str) {
  222. if ("string" != typeof str) throw new Error(-1, "函数makePy需要字符串类型参数!");
  223. for (var arrResult = new Array(), i = 0, len = str.length; i < len; i++) {
  224. var ch = str.charAt(i);
  225. arrResult.push(checkCh(ch));
  226. }
  227. return mkRslt(arrResult);
  228. }
  229. function checkCh(ch) {
  230. var uni = ch.charCodeAt(0);
  231. return 40869 < uni || uni < 19968 ? ch : oMultiDiff[uni] ? oMultiDiff[uni] : strChineseFirstPY.charAt(uni - 19968);
  232. }
  233. function mkRslt(arr) {
  234. for (var arrRslt = [ "" ], i = 0, len = arr.length; i < len; i++) {
  235. var str = arr[i], strlen = str.length;
  236. if (1 == strlen) for (var k = 0; k < arrRslt.length; k++) arrRslt[k] += str; else {
  237. var tmpArr = arrRslt.slice(0);
  238. for (arrRslt = [], k = 0; k < strlen; k++) {
  239. for (var tmp = tmpArr.slice(0), j = 0; j < tmp.length; j++) tmp[j] += str.charAt(k);
  240. arrRslt = arrRslt.concat(tmp);
  241. }
  242. }
  243. }
  244. return arrRslt;
  245. }
  246. String.prototype.trim = function() {
  247. return this.replace(/(^\s*)|(\s*$)/g, "");
  248. }, String.prototype.replaceAll = function(a, b) {
  249. var reg = new RegExp(a, "g");
  250. return this.replace(reg, b);
  251. };
  252. var pinyin = {};
  253. pinyin.makePy = makePy, Date.prototype.format = function(fmt) {
  254. var o = {
  255. "M+": this.getMonth() + 1,
  256. "d+": this.getDate(),
  257. "h+": this.getHours(),
  258. "m+": this.getMinutes(),
  259. "s+": this.getSeconds(),
  260. "q+": Math.floor((this.getMonth() + 3) / 3),
  261. S: this.getMilliseconds()
  262. };
  263. for (var k in /(y+)/.test(fmt) && (fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length))),
  264. o) new RegExp("(" + k + ")").test(fmt) && (fmt = fmt.replace(RegExp.$1, 1 == RegExp.$1.length ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)));
  265. return fmt;
  266. }, "undefined" != typeof dhtmlXCalendarObject && dhtmlXCalendarObject && (dhtmlXCalendarObject.prototype.langData.ch = {
  267. dateformat: "%Y-%m-%d",
  268. monthesFNames: [ "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月" ],
  269. monthesSNames: [ "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月" ],
  270. daysFNames: [ "星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" ],
  271. daysSNames: [ "日", "一", "二", "三", "四", "五", "六" ],
  272. weekstart: "周日",
  273. weekname: "星期",
  274. today: "今天",
  275. clear: "清除"
  276. }, dhtmlXCalendarObject.prototype.lang = "ch");
  277. var Prolog = {
  278. GridImageBasePath: "/prologui/dist/images/PlgGrid/",
  279. token: "",
  280. reloadToken: function() {
  281. Prolog.token = localStorage.getItem("authorization");
  282. },
  283. loginUrl: "",
  284. loginPage: "",
  285. refreshTokenUrl: "",
  286. showLoginForm: !1
  287. };
  288. function _t(key, selector) {
  289. try {
  290. if (!selector) {
  291. var v = i18next.t(key);
  292. return null == v ? key : v;
  293. }
  294. $(selector).attr("data-i18n", key);
  295. } catch (_unused) {
  296. return key;
  297. }
  298. }
  299. function setNavLang(element, arr, color) {
  300. var lan;
  301. if (arr && i18next) {
  302. lan = localStorage.getItem("lag");
  303. var li = '<a href="javascript:;"><i class="icon iconfont p-icon-lang_'.concat(lan, '" style="color:').concat(color || "", ';height:0.32rem;margin:0 10px;\n font-size: 0.32rem;\n vertical-align: middle;"></i>\n</a><dl class="plg-nav-child layui-nav-child">');
  304. for (var key in arr) li += "<dd " + (lan == key ? 'class="layui-this"' : "") + '><a href="javascript:;" title="' + key + '">' + arr[key] + "</a></dd>";
  305. li += "</dl>", li = $(li);
  306. var a = $(li[0]);
  307. $(li[1]).find("dd").click(function(e) {
  308. e.preventDefault(), $(this).addClass("layui-this").siblings().removeClass("layui-this"),
  309. i18next.changeLanguage($(this).children("a").attr("title")), a.find("i").attr("class", "icon iconfont p-icon-lang_".concat($(this).children("a").attr("title"))),
  310. $(this).parents("dl.plg-nav-child").hide();
  311. }), $(element).append(li).localize(), layui.element.render("nav"), null;
  312. }
  313. }
  314. Prolog.reloadToken(), Prolog.getTop = function(e) {
  315. var offset = e.offsetTop;
  316. return null != e.offsetParent && (offset += Prolog.getTop(e.offsetParent)), offset;
  317. }, Prolog.getLeft = function(e) {
  318. var offset = e.offsetLeft;
  319. return null != e.offsetParent && (offset += Prolog.getLeft(e.offsetParent)), offset;
  320. }, Prolog.hasJson = function(jsonArray, json) {
  321. for (var i = 0; i < jsonArray.length; i++) {
  322. var b = !0;
  323. for (var key in jsonArray[i]) if (jsonArray[i][key] != json[key]) {
  324. b = !1;
  325. break;
  326. }
  327. if (b) return i;
  328. }
  329. return -1;
  330. }, Prolog.validatePassword = function(pass, options) {
  331. var close = PlgDialog.loading2();
  332. if (null == pass || "" == pass) return close(), layer.msg(_t("请输入有效密码"), function() {}),
  333. !1;
  334. var userinfo = JSON.parse(localStorage.getItem("userinfo"));
  335. null != userinfo && null != userinfo.p_username ? $.ajax({
  336. url: Prolog.loginUrl,
  337. method: "POST",
  338. async: !1,
  339. data: {
  340. username: userinfo.p_username,
  341. password: pass
  342. },
  343. dataType: "json",
  344. success: function(data) {
  345. data.success ? (localStorage.setItem("authorization", "Bearer " + data.data.token),
  346. localStorage.setItem("token_expir", data.data.expir), Prolog.reloadToken(), options && Prolog.ajax(options)) : layer.msg(_t("密码错误"), {
  347. icon: 5
  348. });
  349. }
  350. }) : (localStorage.clear(), location.href = Prolog.loginPage), close();
  351. }, Prolog.requireLogin = function(options) {
  352. var url = options.url;
  353. if (null == url) return !1;
  354. if (-1 < url.indexOf(Prolog.loginUrl)) return !1;
  355. if (Prolog.isLogined()) return !1;
  356. if (Prolog.showLoginForm) return !1;
  357. if (Prolog.showLoginForm = !0, null != Prolog.loginUrl && "" != Prolog.loginUrl) {
  358. var iidx = layer.prompt({
  359. title: _t("请验证你的密码"),
  360. formType: 1,
  361. closeBtn: 0,
  362. btn: [ _t("确认"), _t("退出登录") ],
  363. success: function(layero, index) {
  364. var inp = layero.find("input");
  365. Prolog.removeLoading(), inp[0].onkeydown = function(event) {
  366. if (13 == event.keyCode) {
  367. inp[0].blur();
  368. var pass = layero.find("input").val();
  369. Prolog.validatePassword(pass, options), Prolog.showLoginForm = !1, layer.close(iidx);
  370. }
  371. };
  372. },
  373. btn2: function() {
  374. return localStorage.clear(), location.href = Prolog.loginPage, !0;
  375. }
  376. }, function(pass, index) {
  377. var btn = $("#layui-layer" + index).find(".layui-layer-btn0");
  378. btn.hasClass("layui-btn-disabled") || (btn.addClass("layui-btn-disabled"), Prolog.validatePassword(pass, options),
  379. Prolog.showLoginForm = !1, layer.close(index));
  380. });
  381. return !0;
  382. }
  383. null != Prolog.loginPage && "" != Prolog.loginPage && (localStorage.clear(), location.href = Prolog.loginPage);
  384. }, Prolog.refreshToken = function() {
  385. var expir = localStorage.getItem("token_expir"), authorization = localStorage.getItem("authorization");
  386. if (expir && authorization) {
  387. var exp = parseInt(expir), now = new Date().getTime();
  388. exp - now < 36e4 && now < exp && null != Prolog.refreshTokenUrl && "" != Prolog.refreshTokenUrl && $.ajax({
  389. url: Prolog.refreshTokenUrl,
  390. method: "GET",
  391. beforeSend: function(xhr) {
  392. xhr.setRequestHeader("Authorization", authorization);
  393. },
  394. success: function(data) {
  395. data.success && (localStorage.setItem("authorization", "Bearer " + data.data.token),
  396. localStorage.setItem("token_expir", data.data.expir), Prolog.reloadToken());
  397. }
  398. });
  399. }
  400. }, Prolog.showErrorMsg = function(text) {
  401. Prolog.showLoginForm || layer.alert(text, {
  402. time: 0,
  403. title: "错误",
  404. btn: [ "确认" ],
  405. yes: function(index) {
  406. layer.close(index);
  407. }
  408. });
  409. }, Prolog.ajax = function(options) {
  410. if (Prolog.requireLogin(options)) Prolog.closeLoading(); else {
  411. Prolog.refreshToken(), Prolog.reloadToken();
  412. var _this = this, opt = $.extend(!0, {
  413. timeout: 3e4,
  414. dataType: "json"
  415. }, options);
  416. opt.error = function(XMLHttpRequest, textStatus, errorThrown) {
  417. layer.closeAll("loading"), 401 == XMLHttpRequest.status ? Prolog.showErrorMsg(_t("未认证")) : 403 == XMLHttpRequest.status ? Prolog.showErrorMsg(_t("无权限访问")) : 404 == XMLHttpRequest.status ? Prolog.showErrorMsg(opt.url + "<br>" + _t("找不到服务或资源")) : 500 <= XMLHttpRequest.status ? Prolog.showErrorMsg(opt.url + "<br>" + _t("服务异常")) : Prolog.showErrorMsg(_t("访问错误,错误状态:" + XMLHttpRequest.status)),
  418. options.error && options.error(XMLHttpRequest, textStatus, errorThrown);
  419. }, opt.beforeSend = function(xhr) {
  420. xhr.setRequestHeader("Authorization", _this.token), options.beforeSend && options.beforeSend(xhr);
  421. }, $.ajax(opt);
  422. }
  423. }, Prolog.syncAjax = function(options) {
  424. if (Prolog.requireLogin(options)) Prolog.closeLoading(); else {
  425. Prolog.refreshToken(), Prolog.reloadToken();
  426. var _this = this, opt = $.extend(!0, {
  427. timeout: 3e4
  428. }, options);
  429. opt.error = function(XMLHttpRequest, textStatus, errorThrown) {
  430. layer.closeAll("loading"), 401 == XMLHttpRequest.status ? Prolog.showErrorMsg(_t("未认证")) : 403 == XMLHttpRequest.status ? Prolog.showErrorMsg(_t("无权限访问")) : 404 == XMLHttpRequest.status ? Prolog.showErrorMsg(opt.url + "<br>" + _t("找不到服务或资源")) : 500 <= XMLHttpRequest.status ? Prolog.showErrorMsg(opt.url + "<br>" + _t("服务异常")) : Prolog.showErrorMsg(_t("访问错误,错误状态:" + XMLHttpRequest.status)),
  431. options.error && options.error(XMLHttpRequest, textStatus, errorThrown);
  432. }, opt.async = !1, opt.beforeSend = function(xhr) {
  433. xhr.setRequestHeader("Authorization", _this.token), options.beforeSend && options.beforeSend(xhr);
  434. }, $.ajax(opt);
  435. }
  436. }, Prolog.getFormById = function(systemId, menuId, formId) {
  437. var myform = null, data = Prolog.getJsonData("/japi/sysform2/form", "GET", {
  438. systemId: systemId,
  439. menuId: menuId,
  440. formId: formId,
  441. id: systemId + "_" + menuId + "_" + formId
  442. });
  443. if (null != data && 1 == data.success) if (null != data.data && null != data.data.fields) {
  444. myform = new PrologForm();
  445. var formdata = JSON.parse(data.data.fields);
  446. myform.init(formdata);
  447. } else layer.msg("未定义表单内容");
  448. return myform;
  449. }, Prolog.createRandomId = function() {
  450. return new Date().getTime() + Math.random().toString().substr(2, 5);
  451. }, Prolog.loading = function(el) {
  452. return Prolog.loading2(el);
  453. }, Prolog.closeLoading = function(id) {
  454. layer.close(id);
  455. }, Prolog.deepClone = function(o) {
  456. if ("string" == typeof o || "number" == typeof o || "boolean" == typeof o || void 0 === o || "function" == typeof o) return o;
  457. if (Array.isArray(o)) {
  458. var _arr = [];
  459. return o.forEach(function(item) {
  460. _arr.push(item);
  461. }), _arr;
  462. }
  463. if ("object" === _typeof(o)) {
  464. var _o = {};
  465. for (var key in o) _o[key] = Prolog.deepClone(o[key]);
  466. return _o;
  467. }
  468. }, Prolog.removeLoading = function() {
  469. return $(".load-bar").remove();
  470. }, Prolog.loading2 = function() {
  471. var target = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "body", options = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};
  472. Prolog.removeLoading();
  473. var opts = {
  474. title: _t("数据加载中...")
  475. };
  476. opts = Object.assign(opts, options);
  477. var ele = $('<div class="load-bar">\n <div class="ant-spin ant-spin-spinning ant-spin-show-text">\n <div class="plg-loading"></div>\n <div class="ant-spin-text"></div></div>\n </div>');
  478. return $(target).append(ele), function() {
  479. return $(target).children(".load-bar").remove();
  480. };
  481. }, Prolog.delGridRowData = function(grid, url, type, contenttype, param, multiselect) {
  482. if (!1 === multiselect) {
  483. if (null == grid.getSelectedRowId() && param.length < 1) return void PlgDialog.msg("请选择行!");
  484. } else if (null == grid.getCheckedIds()) return void PlgDialog.msg("请选择行!");
  485. PlgDialog.confirm("是否删除吗?", {
  486. title: "删除提示",
  487. btn: [ "确定", "取消" ],
  488. zIndex: layer.zIndex
  489. }, function(index) {
  490. PlgDialog.close(index), "" === type && (type = "post"), "" === contenttype && (contenttype = "application/x-www-form-urlencoded"),
  491. layer.msg("数据处理中..."), Prolog.ajax({
  492. url: url,
  493. type: type,
  494. contentType: contenttype,
  495. data: param,
  496. success: function(data) {
  497. "object" != _typeof(data) && (data = JSON.parse(data)), data.success ? (grid.reload(),
  498. layer.closeAll()) : layer.open({
  499. type: 1,
  500. offset: "auto",
  501. id: "layerError",
  502. area: [ "500px" ],
  503. title: "错误提示",
  504. content: '<div style="padding: 10px;">' + $.parseJSON(data).message + "</div>",
  505. btn: "关闭",
  506. btnAlign: "r",
  507. shade: 0,
  508. yes: function() {
  509. layer.closeAll();
  510. }
  511. });
  512. },
  513. error: function() {}
  514. });
  515. });
  516. }, Prolog.setLocalStorage = function(name, val) {
  517. localStorage.setItem(name, JSON.stringify(val));
  518. }, Prolog.getLocalStorage = function(name) {
  519. return JSON.parse(localStorage.getItem(name));
  520. }, Prolog.removeItemLocalStorage = function(name) {
  521. localStorage.removeItem(name);
  522. }, Prolog.setSessionStorage = function(name, val) {
  523. sessionStorage.setItem(name, JSON.stringify(val));
  524. }, Prolog.getSessionStorage = function(name) {
  525. return JSON.parse(sessionStorage.getItem(name));
  526. }, Prolog.removeItemSessionStorage = function(name) {
  527. sessionStorage.removeItem(name);
  528. }, Prolog.getRequestParams = function() {
  529. var u = window.document.location.href.toString().split("?");
  530. if ("string" != typeof u[1]) return {};
  531. u = u[1].split("&");
  532. var get = {};
  533. for (var i in u) {
  534. var j = u[i].split("=");
  535. get[j[0]] = decodeURIComponent(j[1]);
  536. }
  537. return get;
  538. }, Prolog.isLogined = function() {
  539. var tk = null, exp = null, P_GET = Prolog.getRequestParams();
  540. if (P_GET.access_token && P_GET.expir ? (tk = P_GET.access_token, exp = P_GET.expir,
  541. localStorage.setItem("authorization", tk), localStorage.setItem("token_expir", exp)) : (tk = localStorage.getItem("authorization"),
  542. exp = localStorage.getItem("token_expir")), null == tk || "" == tk || null == exp || "" == exp) return !1;
  543. var expir = parseInt(exp);
  544. return !(new Date().getTime() > expir);
  545. };
  546. "use strict";
  547. !function($, layui) {
  548. layui.use([ "layer" ], function() {
  549. var layer = layui.layer;
  550. layer.config({
  551. anim: 0,
  552. zIndex: 1e4,
  553. shade: .5,
  554. btnAlign: "r",
  555. fixed: !1
  556. });
  557. var plgDialog = layer;
  558. plgDialog.showUploadDialog = function(url) {
  559. var winoptions = {
  560. title: "上传文件",
  561. skin: "layui-layer-lan",
  562. closeBtn: 1,
  563. type: 1,
  564. resize: !0,
  565. btn: [ "上传", "取消" ],
  566. btn1: function(index, layero) {
  567. PlgDialog.close(index);
  568. },
  569. btn2: function(index, layero) {
  570. PlgDialog.close(index);
  571. },
  572. area: [ "300px", "300px" ],
  573. content: '<div id="xx-win-dd-1"></div>',
  574. success: function(layero, index) {
  575. new PlgForm({
  576. items: [ {
  577. type: "upload",
  578. name: "files",
  579. url: url
  580. } ]
  581. }).renderTo("xx-win-dd-1");
  582. }
  583. };
  584. layer.open(winoptions);
  585. }, plgDialog.showGridDialog = function(plgGrid, callback, opts) {
  586. var winoptions = {
  587. title: opts.title ? opts.title : "",
  588. skin: "layui-layer-lan",
  589. closeBtn: 1,
  590. type: 1,
  591. resize: !0,
  592. tipsMore: !0,
  593. btn: [ "选择", "取消" ],
  594. btn1: function(index, layero) {
  595. var id = plgGrid.getSelectedRowId();
  596. if (id) {
  597. var record = plgGrid.getSelectedRowData();
  598. callback && callback(id, record), PlgDialog.close(index);
  599. } else layer.msg("为选择数据");
  600. },
  601. btn2: function(index, layero) {
  602. PlgDialog.close(index);
  603. },
  604. area: [ opts.width + "px", opts.height + "px" ],
  605. content: '<div id="' + panelId + '-win-grid-1"></div>',
  606. success: function(layero, index) {
  607. plgGrid.renderTo(panelId + "-win-grid-1"), plgGrid.loadData(), plgGrid.on("onRowDblClicked", function(rid, ind) {
  608. var record = plgGrid.getUserData(rid, "data");
  609. callback && callback(rid, record), PlgDialog.close(index);
  610. });
  611. }
  612. };
  613. 1 == type && (winoptions.btn = [ "保存", "取消" ], winoptions.btn2 = winoptions.btn3,
  614. winoptions.btn3 = null), PlgDialog.open(winoptions);
  615. }, plgDialog.loading2 = Prolog.loading2, plgDialog.removeLoading = Prolog.removeLoading,
  616. window.PlgDialog = plgDialog;
  617. });
  618. }(jQuery, layui);
  619. "use strict";
  620. function _typeof(obj) {
  621. return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  622. return typeof obj;
  623. } : function(obj) {
  624. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  625. })(obj);
  626. }
  627. function eXcell_button(cell) {
  628. cell && (this.cell = cell, this.grid = this.cell.parentNode.grid), this.edit = function() {},
  629. this.isDisabled = function() {
  630. return !0;
  631. }, this.setValue = function(val) {
  632. var row_id = this.cell.parentNode.idd, row_data = JSON.stringify(this.grid.getUserData(row_id, "data"));
  633. row_data = row_data.replaceAll("'", "");
  634. for (var btns = (val = val.replaceAll(",", ";")).split(";"), str = "", k = 0; k < btns.length; k++) {
  635. var btnstr = btns[k], btnv = btnstr.substring(0, btnstr.indexOf("^"));
  636. str += "<div class='plg-divider plg-divider-vertical'></div><a class='' href='javascript:void(0);' onclick='" + btnstr.substring(btnstr.indexOf("^") + 1) + '("' + row_id + '",' + row_data + ")' >" + btnv + "</a>";
  637. }
  638. str = str.substring(str.indexOf("<a")), this.setCValue(str, val);
  639. };
  640. }
  641. eXcell_button.prototype = new eXcell(), function($) {
  642. $.fn.initPlgGrid = function(options) {
  643. var pg = new plgGrid(options), id = $(this).attr("id");
  644. return pg.renderTo(id), pg;
  645. };
  646. var plgGrid = function(options) {
  647. var opts, panel, laypage, panelId, sideBarId, sideBarFormId, pageBarId, gridId, toolBarId, pageBarPanelId, gridTitleId, centerPanelId, mygrid, toolBarForm, sideBarForm, gridForm, formDisableFields, beforeDialogOpenEvent, afterDialogOpenEvent, columnArray, headerArray, hidenArray, plgGrid_default = {
  648. isI18n: window.isI18n || !1,
  649. title: "",
  650. renderer: "",
  651. fixedLast: !1,
  652. columns: [],
  653. multiselect: !1,
  654. url: "data.json",
  655. type: "get",
  656. pageNum: "pageNum",
  657. pageSize: "pageSize",
  658. params: {
  659. pageSize: 10,
  660. pageNum: 1
  661. },
  662. contentType: "application/x-www-form-urlencoded",
  663. page: !0,
  664. totalCount: "totalCount",
  665. toolbar: [],
  666. formData: [],
  667. pagebar: {
  668. buttons: [],
  669. type: "full"
  670. },
  671. beforeLoadData: null
  672. };
  673. opts = $.extend({}, plgGrid_default, options), this.opts = opts;
  674. var rand = Prolog.createRandomId(), pageNum = plgGrid_default.params.pageNum, pageSize = plgGrid_default.params.pageSize;
  675. if (opts.params) {
  676. var _tmp = opts.params;
  677. if ("object" == _typeof(_tmp)) pageNum = null != _tmp.pageNum ? _tmp.pageNum : pageNum,
  678. pageSize = null != _tmp.pageSize ? _tmp.pageSize : pageSize; else {
  679. var _tmpObj = JSON.parse(_tmp);
  680. pageNum = null != _tmpObj.pageNum ? _tmpObj.pageNum : pageNum, pageSize = null != _tmpObj.pageSize ? _tmpObj.pageSize : pageSize;
  681. }
  682. }
  683. var containerId, loadDataCallback, rownum = 1, Jumpcallback = null, fixColumn = {}, gscroll = 0, _this = this;
  684. function resetSize() {
  685. var objbox = $("#" + gridId + " .objbox"), gtable = $("#" + gridId + " .objbox table"), hdtable = $("#" + gridId + " .xhdr table");
  686. if (opts.fixedLast && objbox.width() > gtable.width()) {
  687. var ls_th, cw = objbox.width() - gtable.width() - 1;
  688. (ls_th = gtable.find("tbody tr:first-child th:last-child")).width(ls_th.width() + cw);
  689. var ls_header = hdtable.find("tbody tr:first-child th:last-child");
  690. ls_header.width(ls_header.width() + cw);
  691. }
  692. gtable.height() > objbox.height() && (ls_th = gtable.find("tbody tr:first-child th:last-child")).width(ls_th.width() - 8);
  693. var mtop = $("#" + toolBarId)[0] ? $("#" + toolBarId).height() + 5 : 0;
  694. $("#" + panelId + " .center-panel .plg-grid-sidebuttonpanel a").css("top", mtop),
  695. fixedColumn();
  696. }
  697. function renderTo(id) {
  698. $("#" + (containerId = id)).empty(), id + "-colsetting-" + rand, panelId = id + "-panel-" + rand,
  699. centerPanelId = id + "-centerPanelId-" + rand, sideBarId = id + "-sidebar-" + rand,
  700. sideBarFormId = id + "-sidebarform-" + rand, toolBarId = id + "-toolbar-" + rand,
  701. pageBarPanelId = id + "-pagebar-panel-" + rand, pageBarId = id + "-pagebar-" + rand,
  702. gridId = id + "-panel-grid-" + rand, gridTitleId = id + "-panel-grid-title-" + rand,
  703. function(containerId) {
  704. (panel = document.createElement("div")).className = "plg-grid-panel layui-row",
  705. panel.setAttribute("id", panelId), $("#" + containerId).append(panel);
  706. var centerPanel = document.createElement("div");
  707. centerPanel.setAttribute("id", centerPanelId), centerPanel.className = "center-panel layui-col-md12",
  708. panel.appendChild(centerPanel);
  709. var centerContainerPanel = document.createElement("div");
  710. if (centerContainerPanel.setAttribute("id", centerPanelId), centerContainerPanel.className = "plg-grid-body",
  711. opts.enableSideBar && null != !opts.sideBar) {
  712. var sideBtnPanel = function() {
  713. var sideButtonPanel = document.createElement("div");
  714. sideButtonPanel.className = "plg-grid-sidebuttonpanel";
  715. var alink = document.createElement("a");
  716. return alink.setAttribute("href", "javascript:void(0);"), alink.innerHTML = "<i class='layui-icon layui-icon-next'></i>",
  717. sideButtonPanel.appendChild(alink), alink.onclick = function() {
  718. var b = $("#" + sideBarId), m = $("#" + centerPanelId);
  719. b.is(":hidden") ? (m.removeClass("layui-col-md12"), m.addClass("layui-col-md9"),
  720. b.show(), alink.innerHTML = "<i class='layui-icon layui-icon-next'></i>") : (b.hide(),
  721. m.removeClass("layui-col-md9"), m.addClass("layui-col-md12"), alink.innerHTML = "<i class='layui-icon layui-icon-prev'></i>");
  722. }, sideButtonPanel;
  723. }();
  724. centerPanel.appendChild(sideBtnPanel);
  725. }
  726. if (centerPanel.appendChild(centerContainerPanel), opts.title && "" != opts.title) {
  727. var gridTitleDiv = document.createElement("div");
  728. gridTitleDiv.className = "plg-grid-title", gridTitleDiv.setAttribute("id", gridTitleId),
  729. gridTitleDiv.innerHTML = opts.title, centerContainerPanel.appendChild(gridTitleDiv);
  730. }
  731. if (opts.toolbar && 0 < opts.toolbar.length) {
  732. var toolBarDiv = document.createElement("div");
  733. toolBarDiv.setAttribute("id", toolBarId), toolBarDiv.className = "plg-toolbar",
  734. centerContainerPanel.appendChild(toolBarDiv), function(toolBarId, items) {
  735. toolBarForm = new PlgForm({
  736. renderer: toolBarId,
  737. items: items
  738. }), $("#" + toolBarId).addClass("plg-toolbar");
  739. }(toolBarId, opts.toolbar);
  740. }
  741. var gridDiv = document.createElement("div");
  742. if (gridDiv.setAttribute("id", gridId), gridDiv.className = "plg-grid", centerContainerPanel.appendChild(gridDiv),
  743. function(id) {
  744. mygrid = new dhtmlXGridObject(id);
  745. var cdata, Items, newObj, imp = opts.imagePath || Prolog.GridImageBasePath;
  746. imp && 0 < imp.length && (imp = "/" != imp.substr(imp.length - 1, 1) ? imp + "/" : imp,
  747. mygrid.setImagePath(imp)), cdata = opts.isI18n && 0 < opts.columns.length ? (Items = opts.columns,
  748. newObj = [], Items.map(function(item, index) {
  749. return newObj[index] = Prolog.deepClone(item), item.name && i18next.exists(item.name.toString()) && (newObj[index].name = i18next.t(item.name)),
  750. newObj;
  751. }), newObj) : opts.columns.slice(0), columnArray = new Array(), headerArray = new Array(),
  752. hidenArray = new Array();
  753. var widthArray = new Array(), alignArray = new Array(), headerAlignArray = new Array(), typeArray = new Array(), typeArray = new Array(), sortArray = new Array();
  754. columnArray.push("chbx000"), headerArray.push("<a href='javascript:void(0);' class='plg-grid-first-col'><i class='layui-icon layui-icon-component'></i></a>"),
  755. headerAlignArray.push("text-align:center"), widthArray.push("35"), alignArray.push("center"),
  756. typeArray.push("ro"), sortArray.push("int"), hidenArray.push(!1), opts.multiselect && (columnArray.push("chbx001"),
  757. headerArray.push('<img src="' + mygrid._imgURL + 'dhxgrid_web/item_chk0.gif" class="plg-grid-second-col" title="">'),
  758. headerAlignArray.push("text-align:center"), widthArray.push("35"), alignArray.push("center"),
  759. typeArray.push("ch"), sortArray.push("na"), hidenArray.push(!1)), sortArray.push("str");
  760. for (var i = 0; i < cdata.length; i++) {
  761. columnArray.push(cdata[i].id), headerArray.push(null == cdata[i].name ? cdata[i].id : cdata[i].name),
  762. widthArray.push(null == cdata[i].width ? "*" : cdata[i].width), alignArray.push(null == cdata[i].align ? "left" : cdata[i].align);
  763. var halign = cdata[i].headerAlign ? cdata[i].headerAlign : cdata[i].align;
  764. headerAlignArray.push(null == halign ? "text-align:left" : "text-align:" + cdata[i].align),
  765. typeArray.push(null == cdata[i].type ? "ro" : cdata[i].type), sortArray.push(null == cdata[i].sort ? "str" : cdata[i].sort),
  766. 1 == opts.fixedLast && i == cdata.length - 1 && (fixColumn.width = cdata[i].width,
  767. opts.multiselect ? fixColumn.index = i + 2 : fixColumn.index = i + 1), cdata[i].hidden ? (hidenArray.push(!0),
  768. opts.multiselect ? mygrid.setColumnHidden(i + 2, !0) : mygrid.setColumnHidden(i + 1, !0)) : hidenArray.push(!1);
  769. }
  770. mygrid.setColumnIds(columnArray.toString()), mygrid.setHeader(headerArray.toString(), null, headerAlignArray),
  771. mygrid.setInitWidths(widthArray.toString()), mygrid.setColAlign(alignArray.toString()),
  772. mygrid.setColTypes(typeArray.toString()), mygrid.setColSorting(sortArray.toString()),
  773. opts.filters && (opts.multiselect ? mygrid.attachHeader(",," + opts.filters.toString()) : mygrid.attachHeader("," + opts.filters.toString())),
  774. mygrid.enableMultiselect(opts.multiselect), mygrid.enableAutoHeight(!1), mygrid.enableRowsHover(!0, "plg-grid-hover"),
  775. mygrid.opts = opts, mygrid.attachEvent("onCheck", function(rId, cInd, state) {
  776. if (1 == cInd && opts.multiselect) {
  777. changePageBtnStatus();
  778. var ch = $("#" + panelId + " .plg-grid-second-col"), cstr = ch.attr("src");
  779. return mygrid.getAllRowIds().split(",").length == mygrid.getCheckedRows(1).split(",").length ? ch.attr("src", cstr.replaceAll("chk0", "chk1")) : ch.attr("src", cstr.replaceAll("chk1", "chk0")),
  780. !0;
  781. }
  782. return !0;
  783. }), mygrid.attachEvent("onAfterSorting", function(index, type, direction) {
  784. return resetSize(), !0;
  785. }), mygrid.attachEvent("onResizeEnd", function(index, type, direction) {
  786. return resetSize(), !0;
  787. }), mygrid.attachEvent("onHeaderClick", function(ind, obj) {
  788. if (0 == ind) return function(selector) {
  789. for (var html = '<div class="layui-form plg-clsset-form" >', i = opts.multiselect ? 2 : 1; i < columnArray.length; i++) html += '<div class="layui-form-item plg-clsset-item"><input type="checkbox" lay-filter="plgclssetitem" index=' + i + ' name="' + columnArray[i] + '" lay-skin="primary" title="' + headerArray[i] + '" ' + (hidenArray[i] ? "" : "checked") + "></div>";
  790. html += '<div style="clear:both;margin:0px;height:1px;">&nbsp;</div>', html += "</div>",
  791. PlgDialog.tips(html, selector, {
  792. tips: [ 3, "#fff" ],
  793. time: 0,
  794. shade: .001,
  795. shadeClose: !0,
  796. success: function(layero, ind) {
  797. $(layero).find(".layui-layer-TipsG").remove(), layui.form.render("checkbox"), layui.form.on("checkbox(plgclssetitem)", function(data) {
  798. var ind = $(data.elem).attr("index");
  799. data.elem.checked ? (mygrid.setColumnHidden(ind, !1), hidenArray[ind] = !1) : (mygrid.setColumnHidden(ind, !0),
  800. hidenArray[ind] = !0), resetSize();
  801. });
  802. }
  803. });
  804. }("#" + panelId + " .plg-grid-first-col i"), !1;
  805. if (1 != ind) return !0;
  806. if (opts.multiselect) {
  807. var ch = $("#" + panelId + " .plg-grid-second-col"), cstr = ch.attr("src");
  808. -1 < cstr.indexOf("chk0") ? (checkAll(!0), ch.attr("src", cstr.replaceAll("chk0", "chk1"))) : (checkAll(!1),
  809. ch.attr("src", cstr.replaceAll("chk1", "chk0"))), event.stopPropagation();
  810. }
  811. return !0;
  812. }), mygrid.init();
  813. }(gridId), function() {
  814. if (null != opts.formData) {
  815. gridForm = new PlgForm({
  816. items: opts.formData
  817. }), formDisableFields = new Array();
  818. for (var i = 0; i < opts.formData.length; i++) setEditable(opts.formData[i]);
  819. }
  820. }(), opts.pagebar || opts.page) {
  821. var pageBarPanel = document.createElement("div");
  822. if (pageBarPanel.className = "plg-grid-pagebar", pageBarPanel.setAttribute("id", pageBarPanelId),
  823. centerContainerPanel.appendChild(pageBarPanel), opts.pagebar && opts.pagebar.buttons && 0 < opts.pagebar.buttons.length && function(parentEl) {
  824. if (opts.pagebar && opts.pagebar.buttons && 0 < opts.pagebar.buttons.length) {
  825. var pdiv = document.createElement("div");
  826. pdiv.className = "div-pagebtn disable";
  827. var infodiv = document.createElement("div");
  828. infodiv.className = "div-pagebtn-info", infodiv.innerHTML = '<i class="layui-icon layui-icon-about"></i>已选择&nbsp;<span class="selectedCount">0</span>&nbsp;项',
  829. pdiv.appendChild(infodiv);
  830. for (var i = 0; i < opts.pagebar.buttons.length; i++) {
  831. var bop = opts.pagebar.buttons[i], btn = document.createElement("button");
  832. btn.className = "layui-btn pagebar-button layui-btn-disabled " + (null != bop.className ? bop.className : ""),
  833. btn.innerHTML = bop.text, bop.name && btn.setAttribute("name", bop.name), pdiv.appendChild(btn);
  834. }
  835. parentEl.appendChild(pdiv);
  836. }
  837. }(pageBarPanel), opts.page) {
  838. var pageBarDiv = document.createElement("div");
  839. pageBarDiv.setAttribute("id", pageBarId), pageBarDiv.className = "div-pagebar",
  840. pageBarPanel.appendChild(pageBarDiv);
  841. }
  842. }
  843. if (opts.enableSideBar && null != !opts.sideBar) {
  844. centerPanel.className = "center-panel layui-col-md9";
  845. var sidePanel = function(sideBarId, sideBarFormId) {
  846. var sidePanel = document.createElement("div");
  847. sidePanel.className = "layui-col-md3 plg-grid-sidebar", sidePanel.setAttribute("id", sideBarId);
  848. var sideContainerPanel = document.createElement("div");
  849. return sideContainerPanel.setAttribute("id", sideBarFormId), sideContainerPanel.className = "plg-grid-sidebarform",
  850. sidePanel.appendChild(sideContainerPanel), sidePanel;
  851. }(sideBarId, sideBarFormId);
  852. panel.appendChild(sidePanel), function(sideBarId, items) {
  853. sideBarForm = new PlgForm({
  854. renderer: sideBarId,
  855. items: items
  856. });
  857. }(sideBarFormId, opts.sideBar);
  858. }
  859. }(containerId), function() {
  860. for (var key in mygrid.entBox.onselectstart = null, mygrid) if (-1 === key.indexOf("_") && "function" == typeof mygrid[key] && !self[key]) {
  861. var objm = mygrid[key];
  862. self[key] = objm.bind(mygrid);
  863. }
  864. }(), $("#" + containerId).addClass("grid-container-full"), $(_this.getElement()).resize(function() {
  865. var xhdr = this.querySelector(".xhdr");
  866. 0 < xhdr.scrollLeft && (xhdr.scrollLeft = 0);
  867. var ee = $(this).find(".objbox table tr:first-child th:last-child");
  868. ee.width(ee.width() + .1), ee.width(ee.width() - .1), resetSize();
  869. });
  870. }
  871. function changePageBtnStatus() {
  872. var ch = mygrid.getCheckedRows(1), pl = $("#" + pageBarPanelId + " .div-pagebtn"), len = null != ch && "" != ch ? ch.split(",").length : 0;
  873. pl.find(".selectedCount").text(len), null != ch && "" != ch ? pl.hasClass("disable") && (pl.removeClass("disable"),
  874. pl.find("button").removeClass("layui-btn-disabled")) : pl.hasClass("disable") || (pl.addClass("disable"),
  875. pl.find("button").addClass("layui-btn-disabled"));
  876. }
  877. function setEditable(opt) {
  878. if (null != opt.editable && 0 == opt.editable && formDisableFields.push(opt.name),
  879. opt.list && 0 < opt.list.length) for (var i = 0; i < opt.list.length; i++) setEditable(opt.list[i]);
  880. }
  881. function pageJump(obj, first) {
  882. pageNum = obj.curr, pageSize = obj.limit, Jumpcallback && Jumpcallback(obj, first),
  883. first || reload();
  884. }
  885. function fixedColumn() {
  886. if (opts.fixedLast) {
  887. $("#" + gridId + " .objbox table.obj tr td:last-child").children().css("display", "none"),
  888. $("#" + gridId + " .objbox table.obj tr td:last-child").css("border-left", "none"),
  889. $("#" + gridId + " .xhdr table.hdr tr td:last-child").children().css("display", "none"),
  890. $("#" + gridId + " .xhdr table.hdr tr td:last-child").css("border-left", "none");
  891. var grd = $("#" + gridId), ghd = grd.find(".xhdr:first-child"), grdbox = $("#" + gridId + " .objbox");
  892. if (!(grd.length < 1 || ghd.length < 1 || grdbox.length < 1)) {
  893. $("#" + gridId + " .objbox table.obj tr:first-child th:last-child").width(), grd.height();
  894. var fixdiv = $("#" + gridId + "-fixed-panel");
  895. null == fixdiv || 0 == fixdiv.length ? ((fixdiv = $(document.createElement("div"))).attr("id", gridId + "-fixed-panel"),
  896. fixdiv.addClass("grid-fexed-column"), grd.append(fixdiv)) : fixdiv.empty();
  897. var headerText = ghd.find("table tr:last-child td:last-child .hdrcell").html(), headerHeight = ghd.height(), trs = (ghd.find("table tr:last-child td:last-child").width(),
  898. grd.find(".objbox table tr")), headerDiv = $(document.createElement("div"));
  899. headerDiv.addClass("header"), headerDiv.height(headerHeight), headerDiv.css("line-height", headerHeight + "px"),
  900. headerDiv.html(headerText), fixdiv.append(headerDiv);
  901. var containerDiv = $(document.createElement("div"));
  902. containerDiv.addClass("ul-container");
  903. for (var tableList = $(document.createElement("table")), i = 1; i < trs.length; i++) {
  904. var tr = trs[i], td = $(tr).find("td:last-child"), ntr = $(document.createElement("tr")), ntd = $(document.createElement("td"));
  905. ntd.attr("valign", "middle"), ntd.attr("align", "center"), ntd.css("height", $(tr).height() + "px"),
  906. ntd.html(td.html()), ntd.children().css("display", ""), ntr.append(ntd), tableList.append(ntr);
  907. }
  908. containerDiv.append(tableList), fixdiv.append(containerDiv), setTimeout(function() {
  909. containerDiv.css("max-height", grdbox[0].clientHeight + "px");
  910. try {
  911. containerDiv.scrollTop(grdbox.scrollTop());
  912. } catch (e) {}
  913. }, 100), grdbox.scroll(function() {
  914. 0 == gscroll && containerDiv.scrollTop(grdbox.scrollTop());
  915. }), grdbox.mouseover(function() {
  916. gscroll = 0;
  917. }), containerDiv.scroll(function() {
  918. 1 == gscroll && grdbox.scrollTop(containerDiv.scrollTop());
  919. }), containerDiv.mouseover(function() {
  920. gscroll = 1;
  921. });
  922. }
  923. }
  924. }
  925. function checkAll(b) {
  926. for (var count = mygrid.getRowsNum(), k = b ? 1 : 0, i = 0; i < count; i++) mygrid.cellByIndex(i, 1).setValue(k);
  927. changePageBtnStatus();
  928. }
  929. function loadData(data, callback) {
  930. var fixdiv, close = Prolog.loading2("#" + centerPanelId);
  931. if (opts.fixedLast && (null != (fixdiv = $("#" + gridId + "-fixed-panel")) && fixdiv.empty()),
  932. opts.beforeDataLoad && opts.beforeDataLoad(opts), data) return close(), parseData(data);
  933. callback && (loadDataCallback = callback);
  934. if (null != opts.url && "" != opts.url) {
  935. var pp = opts.params;
  936. if (opts.page) if ("object" == _typeof(pp)) pp[opts.pageNum] = pageNum, pp[opts.pageSize] = pageSize; else {
  937. var ppobj = JSON.parse(pp);
  938. ppobj[opts.pageNum] = pageNum, ppobj[opts.pageSize] = pageSize, pp = JSON.stringify(ppobj);
  939. }
  940. Prolog.ajax({
  941. url: opts.url,
  942. type: opts.type,
  943. data: pp,
  944. contentType: opts.contentType,
  945. success: function(da) {
  946. close(), da.success && parseData(da), loadDataCallback && loadDataCallback(!0);
  947. },
  948. error: function(_error) {
  949. close(), loadDataCallback && loadDataCallback(!1);
  950. }
  951. });
  952. }
  953. }
  954. function reload(data, callback) {
  955. mygrid.clearAll(), loadData(data, callback);
  956. }
  957. function parseData(da) {
  958. if ("function" == typeof opts.beforeLoadData && (da = opts.beforeLoadData(da)),
  959. "object" != _typeof(da) && (da = JSON.parse(da)), null == da.success || 0 != da.success) if (da.data && "" != da.data) {
  960. var ldata;
  961. ldata = da.data.list ? da.data.list : da.data, rownum = (pageNum - 1) * pageSize + 1;
  962. try {
  963. mygrid.parse(function(data) {
  964. for (var v, gridrows = new Array(), colArray = opts.columns, i = 0; i < data.length; i++) {
  965. var rd = data[i], row = new Array();
  966. opts.multiselect ? (row.push(rownum), row.push(0)) : row.push(rownum), rownum += 1;
  967. for (var j = 0; j < colArray.length; j++) {
  968. var col = colArray[j].id;
  969. colArray[j].render && (v = colArray[j].render(rd[col], rd)) ? row.push(v) : row.push(rd[col]);
  970. }
  971. gridrows.push({
  972. id: rd[colArray[0].id],
  973. data: row,
  974. userdata: {
  975. data: rd
  976. }
  977. });
  978. }
  979. return {
  980. rows: gridrows
  981. };
  982. }(ldata), "json"), changePageBtnStatus();
  983. } catch (ex) {
  984. return void PlgDialog.msg("数据错误!");
  985. }
  986. if (opts.page && function(id, totalCount, curr) {
  987. if (0 != opts.page) {
  988. pageSize = null == pageSize ? 0 : pageSize, totalCount = null == totalCount ? 0 : totalCount,
  989. $("#" + id).empty(), laypage = layui.laypage;
  990. var layout = [ "count", "prev", "page", "next", "limit", "skip", "refresh" ];
  991. opts.pagebar && "simple" == opts.pagebar.type ? layout = [ "count", "prev", "page", "next", "refresh" ] : opts.pagebar && "min" == opts.pagebar.type && (layout = [ "count", "prev", "next" ]),
  992. laypage.render({
  993. elem: id,
  994. count: totalCount,
  995. limit: pageSize,
  996. curr: curr,
  997. limits: [ 5, 10, 20, 30, 50, 100, 200, 500, 1e3, 2e3 ],
  998. groups: 4,
  999. theme: "plg",
  1000. prev: '<i class="layui-icon layui-icon-left"></i>',
  1001. next: '<i class="layui-icon layui-icon-right"></i>',
  1002. layout: layout,
  1003. jump: pageJump
  1004. });
  1005. }
  1006. }(pageBarId, da.data[opts.totalCount], pageNum), opts.multiselect) {
  1007. var ch = $("#" + panelId + " .plg-grid-second-col");
  1008. if (ch && 0 < ch.length) {
  1009. var cstr = ch.attr("src");
  1010. ch.attr("src", cstr.replaceAll("chk1", "chk0"));
  1011. }
  1012. }
  1013. resetSize();
  1014. } else PlgDialog.msg("数据为空"); else PlgDialog.alert(da.message ? da.message : "空指针异常");
  1015. }
  1016. _this.t = this.t(_this.opts.isI18n), _this.getPanelId = function() {
  1017. return panelId;
  1018. }, _this.getGridId = function() {
  1019. return gridId;
  1020. }, _this.getToolBarId = function() {
  1021. return toolBarId;
  1022. }, _this.getPageBarPanelId = function() {
  1023. return pageBarPanelId;
  1024. }, _this.getGridTitleId = function() {
  1025. return gridTitleId;
  1026. }, _this.getCombo = function(col_ind) {
  1027. return mygrid.getCombo(col_ind);
  1028. }, this.getSideBarForm = function() {
  1029. return sideBarForm;
  1030. }, this.attachPageBarEvent = function(callback) {
  1031. $("#" + pageBarPanelId).on("click", ".pagebar-button", function() {
  1032. var _this = $(this);
  1033. if (!_this.hasClass("layui-btn-disabled")) {
  1034. var name = _this.attr("name"), ids = mygrid.getCheckedRows(1);
  1035. callback(name, ids);
  1036. }
  1037. });
  1038. }, this.PageBarJump = function(callback) {
  1039. "function" == typeof callback && (Jumpcallback = callback);
  1040. }, this.showDialogResetBtn = null, this.showDialog = function(type, title, width, height, requestParams, isMultipleRow) {
  1041. beforeDialogOpenEvent && beforeDialogOpenEvent(type, title, width, height, requestParams);
  1042. var _this = this;
  1043. if (null != gridForm) if (1 != type || _this.getSelectedRowId()) {
  1044. var winoptions = {
  1045. title: title,
  1046. closeBtn: 1,
  1047. type: 1,
  1048. resize: !0,
  1049. tipsMore: !0,
  1050. btn: [ _this.t("保存"), _this.t("重置"), _this.t("取消") ],
  1051. btn1: function(index, layero) {
  1052. if (0 != gridForm.validate()) {
  1053. var dp, close = PlgDialog.loading2();
  1054. isMultipleRow ? (dp = new Array()).push(gridForm.getFormData()) : dp = gridForm.getFormData();
  1055. var checkoutList = [];
  1056. if (opts.formData && 1 < opts.formData.length && (opts.formData.map(function(val) {
  1057. "label" === val.type && val.list.map(function(value) {
  1058. checkoutList.push(value.name);
  1059. });
  1060. }), checkoutList = checkoutList.filter(function(val) {
  1061. return val;
  1062. })), null != requestParams.contentType && -1 < requestParams.contentType.indexOf("application/json") ? requestParams.data = JSON.stringify(dp) : requestParams.data = dp,
  1063. "function" == typeof requestParams.saveAfter) try {
  1064. if (requestParams.data = requestParams.saveAfter(gridForm, requestParams.data),
  1065. !requestParams.data) throw "saveAfter 回调没有return data";
  1066. if (void 0 === requestParams.data.id) throw "data.id 没有定义";
  1067. } catch (e) {
  1068. throw close(), new Error(e);
  1069. }
  1070. requestParams.success = function(data) {
  1071. data.success ? (_this.reload(), PlgDialog.close(index)) : data.message ? PlgDialog.alert(data.message) : PlgDialog.alert("数据返回失败"),
  1072. close();
  1073. }, Prolog.ajax(requestParams);
  1074. }
  1075. },
  1076. btn2: function(index, layero) {
  1077. return gridForm.clear(), Object.keys(gridForm.getFormData()).forEach(function(item) {
  1078. try {
  1079. gridForm.getDForm().clearNote(item), $(gridForm.getDForm().getInput(item)).parent().parent().removeClass("validate_error");
  1080. } catch (e) {}
  1081. }), "function" == typeof requestParams.resetAfter && requestParams.resetAfter(gridForm),
  1082. !1;
  1083. },
  1084. btn3: function(index, layero) {
  1085. PlgDialog.close(index);
  1086. },
  1087. area: [ width + "px", height + "px" ],
  1088. content: '<div id="' + panelId + '-win-form-1"></div>',
  1089. success: function(layero, index) {
  1090. if (gridForm.renderTo(panelId + "-win-form-1"), 1 == type) {
  1091. !function(plgform, data) {
  1092. var items = plgform.getFormData();
  1093. for (var key in items) items[key] = data[key];
  1094. plgform.setFormData(items);
  1095. }(gridForm, _this.getSelectedRowData());
  1096. for (var k = 0; k < formDisableFields.length; k++) gridForm.disableItem(formDisableFields[k]);
  1097. } else for (k = 0; k < formDisableFields.length; k++) gridForm.enableItem(formDisableFields[k]);
  1098. afterDialogOpenEvent && afterDialogOpenEvent(gridForm);
  1099. }
  1100. };
  1101. 1 == type && (winoptions.btn = [ _this.t("保存"), _this.t("取消") ], winoptions.btn2 = winoptions.btn3,
  1102. winoptions.btn3 = null), PlgDialog.open(winoptions);
  1103. } else PlgDialog.msg("请选择行!"); else PlgDialog.msg(_this.t("未设置表单"));
  1104. }, this.fixedColumn = function() {
  1105. fixedColumn();
  1106. }, this.getElement = function() {
  1107. return panel;
  1108. }, this.renderTo = function(id) {
  1109. return renderTo(id), this;
  1110. }, this.getGrid = function(id) {
  1111. return mygrid;
  1112. }, this.loadData = function(data, callback) {
  1113. return loadData(data, callback), this;
  1114. }, this.getParams = function() {
  1115. return opts.params;
  1116. }, this.setParams = function(params) {
  1117. opts.params = params, pageSize = params.pageSize ? params.pageSize : pageSize, pageNum = params.pageNum ? params.pageNum : pageNum;
  1118. }, this.getGridData = null, this.reload = function(data) {
  1119. reload(data);
  1120. }, this.getCheckedIds = function() {
  1121. return mygrid.getCheckedRows(1);
  1122. }, this.getSelectedRowId = function() {
  1123. return mygrid.getSelectedRowId();
  1124. }, this.getSelectedRowData = function(name) {
  1125. var rid = mygrid.getSelectedRowId();
  1126. return name ? mygrid.getUserData(rid, "data")[name] : mygrid.getUserData(rid, "data");
  1127. }, this.getRowData = function(rowId, fields) {
  1128. if (null == fields || 0 == fields.length) return mygrid.getUserData(rowId, "data");
  1129. if (Array.isArray(fields)) {
  1130. for (var data = {}, i = 0; i < fields.length; i++) data[fields[i]] = mygrid.getUserData(rowId, "data")[fields[i]];
  1131. return data;
  1132. }
  1133. return mygrid.getUserData(rowId, "data")[fields];
  1134. }, this.setRowSelectCheck = function(rowId) {
  1135. if (opts.multiselect || rowId) {
  1136. var row = this.getCellObject(rowId, 1), img = row.cell.children[0];
  1137. -1 < img.src.indexOf("chk0") ? (img.src = img.src.replaceAll("chk0", "chk1"), row.setChecked(!0)) : (img.src = img.src.replaceAll("chk1", "chk0"),
  1138. row.setChecked(!1));
  1139. var headerCh = $("#" + panelId + " .plg-grid-second-col");
  1140. this.getAllRowIds().split(",").length == this.getCheckedRows(1).split(",").length ? headerCh.attr("src", headerCh.attr("src").replaceAll("chk0", "chk1")) : headerCh.attr("src", headerCh.attr("src").replaceAll("chk1", "chk0"));
  1141. }
  1142. }, this.getSelectedCellIndex = function() {
  1143. return mygrid.getSelectedCellIndex();
  1144. }, this.getRowId = function(rowIndex) {
  1145. return mygrid.getRowId(rowIndex);
  1146. }, this.getRowIndex = function(rowId) {
  1147. return mygrid.getRowIndex(rowId);
  1148. }, this.getCellObject = function(rowId, colIndex) {
  1149. return mygrid.cells(rowId, colIndex);
  1150. }, this.getCellValue = function(rowId, colIndex) {
  1151. return mygrid.cells(rowId, colIndex).getValue();
  1152. }, this.getCellObject2 = function(rowIndex, colIndex) {
  1153. return mygrid.cells2(rowIndex, colIndex);
  1154. }, this.getCellValue2 = function(rowIndex, colIndex) {
  1155. return mygrid.cells2(rowIndex, colIndex).getValue();
  1156. }, this.setCellValue = function(rowId, colIndex, value) {
  1157. mygrid.cells(rowId, colIndex).setValue(value);
  1158. var cname = columnArray[colIndex], data = mygrid.getUserData(rowId, "data");
  1159. null != data && "" != data || (data = {}), data[cname] = value, mygrid.setUserData(rowId, "data", data);
  1160. }, this.addRow = function(rowId, row_data, index) {
  1161. var rdarray = [];
  1162. rdarray.push(mygrid.getRowsNum() + 1);
  1163. var start = 1;
  1164. opts.multiselect && (rdarray.push(0), start = 2);
  1165. for (var i = start; i < columnArray.length; i++) {
  1166. var t = row_data[columnArray[i]];
  1167. rdarray.push(t || "");
  1168. }
  1169. null != index ? mygrid.addRow(rowId, rdarray.toString(), index) : mygrid.addRow(rowId, rdarray.toString()),
  1170. mygrid.setUserData(rowId, "data", row_data), resetSize();
  1171. }, this.deleteRow = function(rid) {
  1172. mygrid.deleteRow(rid), resetSize();
  1173. }, this.getColumnsNum = function() {
  1174. return mygrid.getColumnsNum();
  1175. }, this.getColumns = function() {
  1176. return columnArray;
  1177. }, this.getColumn = function(index) {
  1178. return columnArray[index];
  1179. }, this.getHeaders = function() {
  1180. return headerArray;
  1181. }, this.getColumnHeader = function(index) {
  1182. return headerArray[index];
  1183. }, this.getGridForm = function() {
  1184. return gridForm;
  1185. }, this.getToolBarForm = function() {
  1186. return toolBarForm;
  1187. }, this.setColWidth = function(colIndex, width) {
  1188. mygrid.setColWidth(colIndex, width.toString());
  1189. }, this.setColumnColor = function(array) {
  1190. mygrid.setColumnColor(array.toString());
  1191. }, this.setColumnHidden = function(colIndex, isHidden) {
  1192. mygrid.setColumnHidden(colIndex, isHidden);
  1193. }, this.setRowHidden = function(rowId, isHidden) {
  1194. mygrid.setRowHidden(rowId, isHidden);
  1195. }, this.selectRowById = function(rowId) {
  1196. mygrid.selectRowById(rowId);
  1197. }, this.resetSize = resetSize, this.on = function(eventName, callback) {
  1198. "beforeDialogOpen" == eventName ? beforeDialogOpenEvent = callback : "afterDialogOpen" == eventName ? afterDialogOpenEvent = callback : "onAfterSorting" == eventName ? mygrid.attachEvent(eventName, function(index, type, direction) {
  1199. resetSize(), callback(index, type, direction);
  1200. }) : "onResizeEnd" == eventName ? mygrid.attachEvent(eventName, function(obj) {
  1201. resetSize(), callback(obj);
  1202. }) : "onCheck" == eventName ? mygrid.attachEvent(eventName, function(rId, cInd, state) {
  1203. 1 == cInd && opts.multiselect && changePageBtnStatus(), callback(rId, cInd, state);
  1204. }) : mygrid.attachEvent(eventName, callback);
  1205. }, this.attachEvent = this.on, this.attachToolBarEvent = function(eventName, callback) {
  1206. toolBarForm && toolBarForm.on(eventName, callback);
  1207. }, this.attachSideBarEvent = function(eventName, callback) {
  1208. sideBarForm && sideBarForm.on(eventName, callback);
  1209. }, this.splitAt = function(colIndex) {
  1210. mygrid.splitAt(colIndex);
  1211. for (var i = 0; i < hidenArray.length; i++) hidenArray[i] && mygrid.setColumnHidden(i, !0);
  1212. };
  1213. var self = this;
  1214. opts.renderer && "" != opts.renderer && renderTo(opts.renderer);
  1215. };
  1216. plgGrid.prototype.t = function(is) {
  1217. return this.t = is ? function(text) {
  1218. return i18next.t(text);
  1219. } : function(text) {
  1220. return text;
  1221. };
  1222. }, window.PlgGrid = plgGrid;
  1223. }(jQuery);
  1224. "use strict";
  1225. !function($) {
  1226. var calendar, renderDetails_area, fullMonth_title, detailMonth, detailMonth_title, detailMonth_day, ChineseCalendar = {
  1227. lunarInfo: [ 19416, 19168, 42352, 21717, 53856, 55632, 91476, 22176, 39632, 21970, 19168, 42422, 42192, 53840, 119381, 46400, 54944, 44450, 38320, 84343, 18800, 42160, 46261, 27216, 27968, 109396, 11104, 38256, 21234, 18800, 25958, 54432, 59984, 28309, 23248, 11104, 100067, 37600, 116951, 51536, 54432, 120998, 46416, 22176, 107956, 9680, 37584, 53938, 43344, 46423, 27808, 46416, 86869, 19872, 42416, 83315, 21168, 43432, 59728, 27296, 44710, 43856, 19296, 43748, 42352, 21088, 62051, 55632, 23383, 22176, 38608, 19925, 19152, 42192, 54484, 53840, 54616, 46400, 46752, 103846, 38320, 18864, 43380, 42160, 45690, 27216, 27968, 44870, 43872, 38256, 19189, 18800, 25776, 29859, 59984, 27480, 21952, 43872, 38613, 37600, 51552, 55636, 54432, 55888, 30034, 22176, 43959, 9680, 37584, 51893, 43344, 46240, 47780, 44368, 21977, 19360, 42416, 86390, 21168, 43312, 31060, 27296, 44368, 23378, 19296, 42726, 42208, 53856, 60005, 54576, 23200, 30371, 38608, 19195, 19152, 42192, 118966, 53840, 54560, 56645, 46496, 22224, 21938, 18864, 42359, 42160, 43600, 111189, 27936, 44448, 84835, 37744, 18936, 18800, 25776, 92326, 59984, 27424, 108228, 43744, 41696, 53987, 51552, 54615, 54432, 55888, 23893, 22176, 42704, 21972, 21200, 43448, 43344, 46240, 46758, 44368, 21920, 43940, 42416, 21168, 45683, 26928, 29495, 27296, 44368, 84821, 19296, 42352, 21732, 53600, 59752, 54560, 55968, 92838, 22224, 19168, 43476, 41680, 53584, 62034, 54560 ],
  1228. Gan: [ "甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸" ],
  1229. Zhe: [ "子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥" ],
  1230. Animals: [ "鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪" ],
  1231. solarTerm: [ "小寒", "大寒", "立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至" ],
  1232. weekend: [ "日", "一", "二", "三", "四", "五", "六", "七", "八", "九", "十" ],
  1233. lunarStr: [ "初", "十", "廿", "卅" ],
  1234. lunarMonStr: [ "正", "二", "三", "四", "五", "六", "七", "八", "九", "十", "冬", "腊" ],
  1235. sTermInfo: [ 0, 21208, 42467, 63836, 85337, 107014, 128867, 150921, 173149, 195551, 218072, 240693, 263343, 285989, 308563, 331033, 353350, 375494, 397447, 419210, 440795, 462224, 483532, 504758 ],
  1236. wFestive: [ "0520-母亲节", "0630-父亲节", "1144-感恩节" ],
  1237. cFestive: [ "0101-元旦", "0214-情人节", "0305#1963-雷锋日", "0308-妇女节", "0312-植树节", "0401-愚人节", "0501-劳动日", "0504-青年节", "0512-护士节", "0601#1925-儿童节", "0701#1997-建党节", "0801#1927-建军节", "0910-教师节", "1001#1949-国庆节", "1224-平安夜", "1225-圣诞节" ],
  1238. lFestive: [ "1230-除夕", "0101-春节", "0102-正月初二", "0115-元宵节", "0505-端午节", "0707-七夕节", "0715-中元节", "0815-中秋节", "0909-重阳节", "1208-腊八节", "1224-小年" ],
  1239. lunarYearLength: function(y) {
  1240. for (var sum = 348, i = 32768; 8 < i; i >>= 1) sum += ChineseCalendar.lunarInfo[y - 1900] & i ? 1 : 0;
  1241. return sum += ChineseCalendar.leapMonthLengths(y);
  1242. },
  1243. lunarMonthLength: function(y, m) {
  1244. return ChineseCalendar.lunarInfo[y - 1900] & 65536 >> m ? 30 : 29;
  1245. },
  1246. isLeapMonth: function(y) {
  1247. return !!(15 & ChineseCalendar.lunarInfo[y - 1900]);
  1248. },
  1249. leapMonth: function(y) {
  1250. return ChineseCalendar.isLeapMonth(y) ? 15 & ChineseCalendar.lunarInfo[y - 1900] : 0;
  1251. },
  1252. leapMonthLengths: function(y) {
  1253. return ChineseCalendar.isLeapMonth(y) ? 65536 & ChineseCalendar.lunarInfo[y - 1900] ? 30 : 29 : 0;
  1254. },
  1255. year2GanZhe: function(y) {
  1256. var gan = (y - 3) % 10;
  1257. 0 === gan && (gan = 10);
  1258. var zhe = (y - 3) % 12;
  1259. return 0 === zhe && (zhe = 12), ChineseCalendar.Gan[gan - 1] + ChineseCalendar.Zhe[zhe - 1];
  1260. },
  1261. month2GanZhe: function(y, m) {
  1262. var ganY = (y - 3) % 10;
  1263. 0 === ganY && (ganY = 10);
  1264. var month = (ganY - 1) % 5 * 12 + m + 1;
  1265. return ChineseCalendar.Gan[month % 10] + ChineseCalendar.Zhe[month % 12];
  1266. },
  1267. day2GanZhe: function(offset) {
  1268. var temp = 40 + offset;
  1269. return ChineseCalendar.Gan[temp % 10] + ChineseCalendar.Zhe[temp % 12];
  1270. },
  1271. sTerm: function(y, n) {
  1272. var ms = 31556925974.7 * (y - 1900) + 6e4 * ChineseCalendar.sTermInfo[n], base = Date.UTC(1900, 0, 6, 2, 5);
  1273. return new Date(ms + base);
  1274. },
  1275. isTerm: function(y, m, d) {
  1276. var date = new Date(y, m - 1, d), n = 2 * (m - 1), dateTerm = ChineseCalendar.sTerm(y, n);
  1277. return ChineseCalendar.isSameDay(dateTerm, date) ? ChineseCalendar.solarTerm[n] : (n += 1,
  1278. dateTerm = ChineseCalendar.sTerm(y, n), !!ChineseCalendar.isSameDay(dateTerm, date) && ChineseCalendar.solarTerm[n]);
  1279. },
  1280. isSameDay: function(date1, date2) {
  1281. return date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth() && date1.getDate() === date2.getDate();
  1282. },
  1283. getStar: function(month, day) {
  1284. return [ "魔羯", "水瓶", "双鱼", "白羊", "金牛", "双子", "巨蟹", "狮子", "处女", "天秤", "天蝎", "射手", "魔羯" ][month - 1 + ([ 20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22 ][month - 1] < day ? 1 : 0)] + "座";
  1285. },
  1286. toLunarMonth: function(m, flag) {
  1287. return flag ? "闰" + ChineseCalendar.lunarMonStr[m - 1] + "月" : ChineseCalendar.lunarMonStr[m - 1] + "月";
  1288. },
  1289. toLunarDay: function(d) {
  1290. return 10 === d ? "初十" : ChineseCalendar.lunarStr[Math.floor(d / 10)] + (d % 10 == 0 ? "十" : ChineseCalendar.weekend[d % 10]);
  1291. },
  1292. getAnimal: function(y) {
  1293. return ChineseCalendar.Animals[(y - 4) % 12];
  1294. },
  1295. isTody: function(date) {
  1296. var now = new Date();
  1297. return date.getFullYear() === now.getFullYear() && date.getMonth() === now.getMonth() && date.getDate() === now.getDate();
  1298. },
  1299. isFestive: function(y, m, d, ly, lm, ld) {
  1300. var lstr = 9 < lm ? lm + "" : "0" + lm;
  1301. lstr += 9 < ld ? ld + "" : "0" + ld;
  1302. var cstr = 9 < m ? m + "" : "0" + m;
  1303. cstr += 9 < d ? d + "" : "0" + d;
  1304. for (var festive = ChineseCalendar.lFestive, i = 0, l = festive.length; i < l; i += 1) {
  1305. if ((test = festive[i].match(/(\d*)-(.*)/))[1] === lstr) return test[2];
  1306. }
  1307. for (i = 0, l = (festive = ChineseCalendar.cFestive).length; i < l; i += 1) {
  1308. var year = (test = festive[i].match(/(\d*#?\d*)-(.*)/))[1].split("#");
  1309. if (year[1] && y > year[1]) {
  1310. if (year[0] === cstr) return test[2];
  1311. } else if (!year[1] && test[1] === cstr) return test[2];
  1312. }
  1313. festive = ChineseCalendar.wFestive;
  1314. var date = new Date(y, m - 1, d);
  1315. for (i = 0, l = festive.length; i < l; i += 1) {
  1316. var test, month = (test = festive[i].match(/(\d*)-(.*)/))[1].substring(0, 2), day = test[1].substring(3, 4), nWeek = test[1].substring(2, 3);
  1317. if ((9 < m ? m + "" : "0" + m) === month && date.getDay() === parseInt(day)) if (ChineseCalendar.theNoWeek(y, m, d) === parseInt(nWeek)) return test[2];
  1318. }
  1319. return !1;
  1320. },
  1321. theNoWeek: function(y, m, d) {
  1322. var first = new Date(y, m - 1, d);
  1323. first.setDate(1);
  1324. var date = new Date(y, m - 1, d), day = first.getDay(), current = date.getDate();
  1325. 0 === day && (day = 7);
  1326. for (var head = 1, tail = 8 - day, result = 1; ;) {
  1327. if (head <= current && current <= tail) return result;
  1328. result += 1, tail = (head = tail + 1) + 6;
  1329. }
  1330. },
  1331. isRunYear: function(year) {
  1332. return year % 400 == 0 || year % 4 == 0 && year % 100 != 0;
  1333. },
  1334. getlunarYMD: function(date) {
  1335. for (var result = {
  1336. year: date.getFullYear(),
  1337. month: date.getMonth() + 1,
  1338. day: date.getDate()
  1339. }, offset = (Date.UTC(result.year, result.month - 1, result.day) - Date.UTC(1900, 0, 31)) / 864e5, temp = 0, i = 1900; i < 2101 && 0 < offset; i++) offset -= temp = ChineseCalendar.lunarYearLength(i);
  1340. offset < 0 && (offset += temp, i--), result.lunarYear = i;
  1341. var isLear = !1, lunarMonth = ChineseCalendar.leapMonth(result.lunarYear);
  1342. for (i = 1; i < 13 && 0 <= offset; i++) offset -= temp = ChineseCalendar.lunarMonthLength(result.lunarYear, i),
  1343. isLear = !1, i === lunarMonth && (offset < 0 ? (i--, isLear = !0) : offset -= temp = ChineseCalendar.leapMonthLengths(result.lunarYear));
  1344. return offset < 0 && (i === lunarMonth && isLear ? (offset += temp, isLear = !1) : (i === lunarMonth + 1 ? (offset += temp,
  1345. isLear = !0) : offset += temp, i--)), result.lunarMonth = i, result.lunarMonthChiness = ChineseCalendar.toLunarMonth(result.lunarMonth, isLear),
  1346. result.lunarDay = offset + 1, result.lunarDayChiness = ChineseCalendar.toLunarDay(result.lunarDay),
  1347. result;
  1348. },
  1349. lunarFestival: function(date) {
  1350. var result = ChineseCalendar.getlunarYMD(date), festive = ChineseCalendar.isFestive(result.year, result.month, result.day, result.lunarYear, result.lunarMonth, result.lunarDay);
  1351. ChineseCalendar.isTerm(result.year, result.month, result.day);
  1352. if (festive) return festive;
  1353. },
  1354. lunarTerm: function(date) {
  1355. var result = ChineseCalendar.getlunarYMD(date), term = ChineseCalendar.isTerm(result.year, result.month, result.day);
  1356. if (term) return term;
  1357. },
  1358. lunarTime: function(date) {
  1359. return ChineseCalendar.getlunarYMD(date).lunarDayChiness;
  1360. },
  1361. date2lunar: function(date) {
  1362. var result = {
  1363. year: (date = date || new Date()).getFullYear(),
  1364. month: date.getMonth() + 1,
  1365. day: date.getDate()
  1366. }, offset = (Date.UTC(result.year, result.month - 1, result.day) - Date.UTC(1900, 0, 31)) / 864e5, temp = 0;
  1367. result.gzD = ChineseCalendar.day2GanZhe(offset);
  1368. for (var i = 1900; i < 2101 && 0 < offset; i++) offset -= temp = ChineseCalendar.lunarYearLength(i);
  1369. offset < 0 && (offset += temp, i--), result.lunarYear = i;
  1370. var isLear = !1, lunarMonth = ChineseCalendar.leapMonth(result.lunarYear);
  1371. for (i = 1; i < 13 && 0 <= offset; i++) offset -= temp = ChineseCalendar.lunarMonthLength(result.lunarYear, i),
  1372. isLear = !1, i === lunarMonth && (offset < 0 ? (i--, isLear = !0) : offset -= temp = ChineseCalendar.leapMonthLengths(result.lunarYear));
  1373. return offset < 0 && (i === lunarMonth && isLear ? (offset += temp, isLear = !1) : (i === lunarMonth + 1 ? (offset += temp,
  1374. isLear = !0) : offset += temp, i--)), result.lunarMonth = i, result.lunarMonthChiness = ChineseCalendar.toLunarMonth(result.lunarMonth, isLear),
  1375. result.lunarDay = offset + 1, result.lunarDayChiness = ChineseCalendar.toLunarDay(result.lunarDay),
  1376. result.animal = ChineseCalendar.getAnimal(result.year), result.week = "星期" + ChineseCalendar.weekend[date.getDay()],
  1377. result.start = ChineseCalendar.getStar(result.month, result.day), result.gzY = ChineseCalendar.year2GanZhe(result.lunarYear),
  1378. result.isTody = ChineseCalendar.isTody(date), result.gzM = ChineseCalendar.month2GanZhe(result.lunarYear, result.lunarMonth),
  1379. result.isTerm = ChineseCalendar.isTerm(result.year, result.month, result.day), result.isTerm && (result.term = result.isTerm,
  1380. result.isTerm = !0), result.isFestive = ChineseCalendar.isFestive(result.year, result.month, result.day, result.lunarYear, result.lunarMonth, result.lunarDay),
  1381. result.isFestive && (result.festive = result.isFestive, result.isFestive = !0),
  1382. result;
  1383. }
  1384. }, tools = {
  1385. renderDetailMonth: function(dayWrapper, recivedYear, recivedMonth) {
  1386. var array = [], recivedDate = new Date(), _html = "", date = new Date(recivedYear, recivedMonth, 1);
  1387. date.setDate(1);
  1388. var week = date.getDay();
  1389. date.setDate(1 - week);
  1390. for (var month = date.getMonth(), i = 0; i < 42; i++) month !== recivedMonth ? 0 === date.getDay() || 6 === date.getDay() ? array.push({
  1391. month: date.getMonth(),
  1392. day: date.getDate(),
  1393. lunar: ChineseCalendar.lunarTime(date),
  1394. state: "weekend",
  1395. festival: "",
  1396. term: "",
  1397. dateStr: tools.returnDateStr(date)
  1398. }) : array.push({
  1399. month: date.getMonth(),
  1400. day: date.getDate(),
  1401. lunar: ChineseCalendar.lunarTime(date),
  1402. state: "",
  1403. festival: "",
  1404. term: "",
  1405. dateStr: tools.returnDateStr(date)
  1406. }) : tools.curDay(date, recivedDate) ? 0 === date.getDay() || 6 === date.getDay() ? array.push({
  1407. month: date.getMonth(),
  1408. day: date.getDate(),
  1409. lunar: ChineseCalendar.lunarTime(date),
  1410. state: "weekend cur-day",
  1411. festival: "",
  1412. term: "",
  1413. dateStr: tools.returnDateStr(date)
  1414. }) : array.push({
  1415. month: date.getMonth(),
  1416. day: date.getDate(),
  1417. lunar: ChineseCalendar.lunarTime(date),
  1418. state: "cur-day",
  1419. festival: "",
  1420. term: "",
  1421. dateStr: tools.returnDateStr(date)
  1422. }) : 0 === date.getDay() || 6 === date.getDay() ? array.push({
  1423. month: date.getMonth(),
  1424. day: date.getDate(),
  1425. lunar: ChineseCalendar.lunarTime(date),
  1426. state: "weekend cur-month",
  1427. festival: "",
  1428. term: "",
  1429. dateStr: tools.returnDateStr(date)
  1430. }) : array.push({
  1431. month: date.getMonth(),
  1432. day: date.getDate(),
  1433. lunar: ChineseCalendar.lunarTime(date),
  1434. state: "cur-month",
  1435. festival: "",
  1436. term: "",
  1437. dateStr: tools.returnDateStr(date)
  1438. }), date.setDate(date.getDate() + 1), month = date.getMonth();
  1439. this.params.startTime = array[0].dateStr, this.params.endTime = array[array.length - 1].dateStr;
  1440. for (var j = 0; j < array.length; j++) {
  1441. var festival_state = array[j].festival ? "festival show" : "festival", term_state = array[j].term ? "term show" : "term", first_lunarday = "初一" == array[j].lunar ? ChineseCalendar.date2lunar(date).lunarMonthChiness + array[j].lunar : array[j].lunar;
  1442. if ("初一" == array[j].lunar) if ("正月" == ChineseCalendar.date2lunar(date).lunarMonthChiness) var lunar_state = "lunar first-lunarJanuary"; else lunar_state = "lunar first-lunarday"; else lunar_state = "lunar";
  1443. _html += '<li data-time="'.concat(array[j].dateStr, '" class="').concat(array[j].state, '">\n <p class="info">\n <span class="').concat(lunar_state, '">').concat(first_lunarday, '</span>\n <span class="date">').concat(1 === array[j].day ? array[j].month + 1 + "月" : "", "<em>").concat(array[j].day, '</em>日</span>\n </p>\n <div class="').concat(festival_state, '">').concat(array[j].festival, '</div>\n <div class="').concat(term_state, '">').concat(array[j].term, '</div>\n <div class="addForm"></div>\n </li>');
  1444. }
  1445. dayWrapper.html(_html);
  1446. },
  1447. nowDate: function() {
  1448. return new Date();
  1449. },
  1450. returnDateStr: function(date) {
  1451. var year = date.getFullYear(), month = date.getMonth() + 1, day = date.getDate();
  1452. return year + "-" + (month = month <= 9 ? "0" + month : "" + month) + "-" + (day = day <= 9 ? "0" + day : "" + day);
  1453. },
  1454. curDay: function(oldTime, nowTime) {
  1455. return oldTime.getFullYear() === nowTime.getFullYear() && oldTime.getMonth() === nowTime.getMonth() && oldTime.getDate() === nowTime.getDate();
  1456. },
  1457. strFormatDate: function(str) {
  1458. return new Date(parseInt(str.substr(0, 4)), parseInt(str.substr(4, 2)), parseInt(str.substr(6)));
  1459. }
  1460. };
  1461. function PlgCalendarPanel(config) {
  1462. return this.tab_num = 0, this.today = new Date(), this.year = this.today.getFullYear(),
  1463. this.month = this.today.getMonth(), this.detailsShow = !1, this.options = {
  1464. renderer: "",
  1465. data: null,
  1466. column: {
  1467. timeKey: "deliverdate",
  1468. width: 110,
  1469. height: 110
  1470. },
  1471. ajaxInit: {
  1472. url: "",
  1473. type: "get",
  1474. params: null,
  1475. success: null
  1476. },
  1477. addItemClick: null,
  1478. addItem: {
  1479. width: 600,
  1480. height: 500,
  1481. title: "新增日程",
  1482. formData: null,
  1483. url: null,
  1484. type: "post",
  1485. contentType: "application/json",
  1486. saveAfter: null
  1487. },
  1488. customDayRender: null,
  1489. clickDetails: null,
  1490. detailsDay: {
  1491. formData: null
  1492. }
  1493. }, this.params = {
  1494. startTime: "",
  1495. endTime: ""
  1496. }, this.options = $.extend(!0, this.options, config), this.options.detailsShow && (this.detailsShow = this.options.detailsShow),
  1497. this.element = function() {
  1498. return (calendar = $('\n <div id="calendar">\n <header class="header">\n \n </header>\n\n <div class="container">\n <div id="renderMonth" class="render render-show">\n <div class="toolbar">\n <h2 class="title"></h2>\n <ul class="week">\n <li>周日</li><li>周一</li><li>周二</li> <li>周三</li> <li>周四</li><li>周五</li><li>周六</li>\n </ul> \n </div> \n <ul class="day" style="grid-template-columns: repeat(7,'.concat(this.options.column.width, "px);grid-template-rows: repeat(6,").concat(this.options.column.height, 'px);"></ul>\n </div>\n <div id="renderDetails" class="render">\n <div class="title">\n <h2></h2>\n <p>\n <button class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-left"> 返回 </button>\n </p>\n </div>\n\n <div class="details-body">\n <div id="plgCalendar-details-content"></div>\n </div>\n\n </div>\n <div id="control">\n <input type="button" value="<" class="btn btn-prev">\n <input type="button" value="今天" class="today">\n <input type="button" value=">" class="btn btn-next">\n </div>\n <div id="popup" style="display: none;">\n <h3 class="title">\n <input type="text">\n </h3>\n <i class="arrow arrow-left"></i>\n <i class="arrow arrow-right"></i>\n <p class="date"></p>\n <p class="lunar"></p>\n </div>\n </div>\n </div>'))).find(".toolbar .week li").width(this.options.column.width),
  1499. renderDetails_area = calendar.find("#renderDetails"), fullMonth_title = renderDetails_area.find("h2"),
  1500. detailMonth = calendar.find("#renderMonth"), detailMonth_title = detailMonth.find(".title"),
  1501. detailMonth_day = detailMonth.find(".day"), calendar;
  1502. }.call(this), this.init(), this.promiseGetDate = loadData.call(this), this;
  1503. }
  1504. function loadData() {
  1505. var _this = this;
  1506. return new Promise(function(resolve, error) {
  1507. if (_this.options.data) return _this.options.data;
  1508. if (!_this.options.ajaxInit.url) return null;
  1509. var object = {
  1510. url: _this.options.ajaxInit.url,
  1511. type: _this.options.ajaxInit.type,
  1512. data: Object.assign(_this.options.ajaxInit.params, _this.params)
  1513. }, close = PlgDialog.loading2();
  1514. object.success = function(response) {
  1515. if (close(), response.success) return _this.options.data = response.data, "function" == typeof _this.options.ajaxInit.success && _this.options.ajaxInit.success(_this.options.data),
  1516. _this.options.data.forEach(function(item) {
  1517. var key = _this.options.column.timeKey, li = detailMonth_day.children('li[data-time="'.concat(item[key], '"]'));
  1518. item = "function" == typeof _this.options.customDayRender ? _this.options.customDayRender(item) : Object.values(item).join(","),
  1519. li.children(".festival").show().append(item);
  1520. }), resolve(_this.options.data);
  1521. }, object.error = function(XMLHttpRequest, textStatus, errorThrown) {}, object.complete = function() {
  1522. close();
  1523. }, Prolog.ajax(object);
  1524. });
  1525. }
  1526. function initalToday() {
  1527. detailMonth_title.html(this.year + "年" + (this.month + 1) + "月"), tools.renderDetailMonth.call(this, detailMonth_day, this.year, this.month);
  1528. }
  1529. PlgCalendarPanel.prototype.reset = function() {
  1530. return this.options.data = null, initalToday.call(this), this.promiseGetDate = loadData.call(this),
  1531. this;
  1532. }, PlgCalendarPanel.prototype.getData = function() {
  1533. return this.options.data;
  1534. }, PlgCalendarPanel.prototype.init = function() {
  1535. initalToday.call(this), function() {
  1536. var _this = this, control = calendar.find("#control"), control_btnPrev = control.find(".btn-prev"), control_today = control.find(".today"), control_btnNext = control.find(".btn-next"), container_day = (calendar.find("#popup"),
  1537. calendar.find(".container ul.day"));
  1538. control_today.click(function() {
  1539. _this.year = _this.today.getFullYear(), _this.month = _this.today.getMonth(), _this.reset();
  1540. }), control_btnPrev.click(function() {
  1541. 0 == _this.month ? (_this.year--, _this.month = 11) : _this.month--, _this.reset();
  1542. }), control_btnNext.click(function() {
  1543. 0 == _this.tab_num ? 11 == _this.month ? (_this.year++, _this.month = 0) : _this.month++ : _this.year++,
  1544. _this.reset();
  1545. }), renderDetails_area.find(".layui-icon-left").click(function(e) {
  1546. e.preventDefault(), renderDetails_area.hide(), detailMonth.show(), control.show();
  1547. }), container_day.on("click", "li>div", function(event) {
  1548. event.stopPropagation();
  1549. var date = $(this).parent().data("time");
  1550. return $(this).is(".festival") && (renderDetails_area.width(detailMonth.width()),
  1551. renderDetails_area.height(detailMonth.height()), "function" == typeof _this.options.clickDetails && _this.options.clickDetails(_this.getData().find(function(item) {
  1552. return item[_this.options.column.timeKey] == date;
  1553. })), _this.detailsShow && (_this.options.detailsDay.formData && new PlgForm({
  1554. renderer: "plgCalendar-details-content",
  1555. items: _this.options.detailsDay.formData
  1556. }), fullMonth_title.html(new Date(date).format("yyyy年MM月dd")), detailMonth.hide(),
  1557. control.hide(), renderDetails_area.show())), !!$(this).is(".addForm") && ("function" == typeof _this.options.addItemClick ? _this.options.addItemClick(date, _this.showDialog.bind(_this)) : void _this.showDialog());
  1558. });
  1559. }.call(this), this.options.renderer && this.renderTo(this.options.renderer);
  1560. }, PlgCalendarPanel.prototype.setAddItemFormData = function(array) {
  1561. if (Array.isArray(array)) return this.options.addItem.formData = array, this;
  1562. }, PlgCalendarPanel.prototype.getDialogForm = function() {
  1563. return new PlgForm({
  1564. items: this.options.addItem.formData
  1565. });
  1566. }, PlgCalendarPanel.prototype.showDialog = function() {
  1567. var _this = this;
  1568. if (this.options.addItem.formData) {
  1569. var gridForm, winoptions = {
  1570. title: this.options.addItem.title,
  1571. closeBtn: 1,
  1572. type: 1,
  1573. area: [ this.options.addItem.width + "px", this.options.addItem.height + "px" ],
  1574. resize: !0,
  1575. tipsMore: !0,
  1576. btn: [ "保存", "重置", "取消" ],
  1577. btn3: function(index, layero) {
  1578. PlgDialog.close(index);
  1579. },
  1580. btn1: function() {
  1581. if (0 != gridForm.validate()) {
  1582. var close = PlgDialog.loading2(), paramsData = gridForm.getFormData();
  1583. "function" == typeof _this.options.addItem.saveAfter && _this.options.addItem.saveAfter(paramsData, gridForm);
  1584. var requestParams = {
  1585. url: _this.options.addItem.url,
  1586. type: _this.options.addItem.type,
  1587. contentType: _this.options.addItem.contentType,
  1588. data: paramsData,
  1589. success: function(data) {
  1590. data.success ? (_this.options.addItem && _this.options.addItem.yes(), _this.reset()) : data.message ? PlgDialog.alert(data.message) : PlgDialog.alert("保存失败"),
  1591. close();
  1592. },
  1593. error: function() {
  1594. close();
  1595. }
  1596. };
  1597. Prolog.ajax(requestParams);
  1598. }
  1599. },
  1600. btn2: function() {
  1601. return gridForm.clear(), Object.keys(gridForm.getFormData()).forEach(function(item) {
  1602. try {
  1603. gridForm.getDForm().clearNote(item), $(gridForm.getDForm().getInput(item)).parent().parent().removeClass("validate_error");
  1604. } catch (e) {}
  1605. }), !1;
  1606. },
  1607. content: '<div id="plgCalendar-win-form-1"></div>',
  1608. success: function(layero, index) {
  1609. gridForm = _this.getDialogForm().renderTo("plgCalendar-win-form-1");
  1610. }
  1611. };
  1612. return PlgDialog.open(winoptions), this;
  1613. }
  1614. PlgDialog.msg("addItem.formData", "未设置表单");
  1615. }, PlgCalendarPanel.prototype.renderTo = function(domId) {
  1616. return this.options.renderer = domId, $("#" + this.options.renderer).addClass("plg-calendar-panel").empty().append(this.element),
  1617. this;
  1618. }, window.PlgCalendarPanel = PlgCalendarPanel;
  1619. }(jQuery);
  1620. "use strict";
  1621. function _defineProperty(obj, key, value) {
  1622. return key in obj ? Object.defineProperty(obj, key, {
  1623. value: value,
  1624. enumerable: !0,
  1625. configurable: !0,
  1626. writable: !0
  1627. }) : obj[key] = value, obj;
  1628. }
  1629. !function($) {
  1630. $.fn.initPlgCard = function(options) {
  1631. var pg = new PlgCard(options), id = $(this).attr("id");
  1632. return pg.renderTo(id), pg;
  1633. };
  1634. var PlgCard = function(options) {
  1635. var _factory;
  1636. if (options && options.renderer) {
  1637. var config;
  1638. config = {};
  1639. var factory = (_defineProperty(_factory = {
  1640. _style: (config = $.extend({}, config, options.config)).style,
  1641. _data: config.data || "",
  1642. _strTitle: function() {
  1643. return '<div class="plg-card-components"> <div class="plg-card-header-container"> <fieldset><legend>';
  1644. },
  1645. _strHead: function() {
  1646. return '<div class="plg-card-group">';
  1647. },
  1648. _strTitleHead: function() {
  1649. return '</legend></fieldset></div><div class="plg-card-group">';
  1650. },
  1651. _strFooter: function() {
  1652. return "</div>";
  1653. }
  1654. }, "_strFooter", function() {
  1655. return "</div></div>";
  1656. }), _defineProperty(_factory, "generateOneTemplate", function(data) {
  1657. var temFragment = "";
  1658. return data.forEach(function(val) {
  1659. temFragment += '\n <div class="plg-card">\n <div class="plg-card-body">\n <div class="plg-card-no">'.concat(val.cardNo, '</div>\n <div class="plg-card-main">').concat(val.cardName, '</div>\n </div>\n \n <ul class="plg-card-btn-group">\n ');
  1660. var temBtns = "";
  1661. val.btn.forEach(function(value) {
  1662. temBtns += "\n <li>".concat(value.text, "</li>\n ");
  1663. }), temFragment += temBtns, temFragment += "\n </ul>\n </div>\n ";
  1664. }), temFragment;
  1665. }), _defineProperty(_factory, "oneTemplate", function() {
  1666. var temFragment = "";
  1667. return this._data.forEach(function(val) {
  1668. temFragment += '\n <div class="plg-card">\n <div class="plg-card-body">\n <div class="plg-card-no">'.concat(val.cardNo, '</div>\n <div class="plg-card-main">').concat(val.cardName, '</div>\n </div>\n \n <ul class="plg-card-btn-group">\n ');
  1669. var temBtns = "";
  1670. val.btn.forEach(function(value) {
  1671. temBtns += "\n <li>".concat(value.text, "</li>\n ");
  1672. }), temFragment += temBtns, temFragment += "\n </ul>\n </div>\n ";
  1673. }), this._strHead() + temFragment + this._strFooter();
  1674. }), _defineProperty(_factory, "twoTemplate", function() {
  1675. var temFragment = "";
  1676. return this._data.forEach(function(val) {
  1677. temFragment += '\n <div class="plg-card">\n <div class="plg-card-body primary">\n '.concat(val.cardName, '\n </div>\n \n <ul class="plg-card-btn-group">\n ');
  1678. var temBtns = "";
  1679. val.btn.forEach(function(value) {
  1680. temBtns += "\n <li>".concat(value.text, "</li>\n ");
  1681. }), temFragment += temBtns, temFragment += "\n </ul>\n </div>\n ";
  1682. }), this._strHead() + temFragment + this._strFooter();
  1683. }), _defineProperty(_factory, "threeTemplate", function() {
  1684. var temFragment = "";
  1685. return this._data.forEach(function(val) {
  1686. temFragment += '\n <div class="plg-card">\n <div class="plg-card-body primary">\n '.concat(val.cardName, '\n </div>\n \n <ul class="plg-card-btn-group">\n ');
  1687. var temBtns = "";
  1688. val.btn.forEach(function(value) {
  1689. temBtns += "\n <li>".concat(value.text, "</li>\n ");
  1690. }), temFragment += temBtns, temFragment += "\n </ul>\n </div>\n ";
  1691. }), this._strHead() + temFragment + this._strFooter();
  1692. }), _defineProperty(_factory, "addTemplate", function() {
  1693. return '<div class="plg-card plg-add">\n <div class="layui-icon layui-icon-add-1 "></div>\n </div>';
  1694. }), _defineProperty(_factory, "oneTitleTemplate", function() {
  1695. var self = this, temFragment = "";
  1696. return self._data.forEach(function(val) {
  1697. temFragment += '<div class="plg-card-components"><div class="plg-card-header-container">\n <fieldset><legend>\n '.concat(val.title, "\n <legend><fieldset></div>"),
  1698. temFragment += self._strHead(), temFragment += self.generateOneTemplate(val.dataList),
  1699. temFragment += self._strFooter(), temFragment += "</div>";
  1700. }), temFragment;
  1701. }), _defineProperty(_factory, "oneTitleAddTemplate", function() {
  1702. var self = this, temFragment = "";
  1703. return !(!self._data || self._data.length < 1) && (self._data.forEach(function(val) {
  1704. temFragment += '<div class="plg-card-components"><div class="plg-card-header-container">\n <fieldset><legend>\n '.concat(val.title, "\n <legend><fieldset></div>"),
  1705. temFragment += self._strHead(), temFragment += self.generateOneTemplate(val.dataList),
  1706. temFragment += self.addTemplate(), temFragment += self._strFooter(), temFragment += "</div>";
  1707. }), temFragment);
  1708. }), _defineProperty(_factory, "getHtmlFragment", function() {
  1709. var attrName = this._style + "Template";
  1710. return this[attrName] ? this[attrName]() : new Error("不存在这个方法");
  1711. }), _factory);
  1712. this.on = function(eventname, callback) {
  1713. config && "add" !== config.style && eventname && "click" == eventname && ([ "one", "two", "three" ].includes(config.style) && $("#" + options.renderer).on("click", "li", function(e) {
  1714. var temIndex = $(this).closest(".plg-card").index(), cardNo = config.data[temIndex].cardNo, call_back_fn = config.data[temIndex].btn[$(this).index()].fn;
  1715. callback && callback(cardNo, call_back_fn);
  1716. }), [ "oneTitle", "twoTitle", "threeTitle", "oneTitleAdd", "twoTitleAdd", "threeTitleAdd" ].includes(config.style) && ($("#" + options.renderer).off("click").on("click", "li", function(e) {
  1717. var cardNo, call_back_fn, groupIndex = $(this).closest(".plg-card-components").index(), temIndex = $(this).closest(".plg-card").index(), currentData = config.data[groupIndex].dataList[temIndex];
  1718. cardNo = currentData.cardNo, call_back_fn = currentData.btn[$(this).index()].fn;
  1719. var title = config.data[groupIndex].title;
  1720. title ? callback && callback(cardNo, call_back_fn, title) : callback && callback(cardNo, call_back_fn);
  1721. }), $("#" + options.renderer).on("click", ".plg-add", function(e) {
  1722. var groupIndex = $(this).closest(".plg-card-components").index(), title = config.data[groupIndex].title;
  1723. title ? callback && callback(void 0, void 0, title) : callback && callback(void 0, void 0);
  1724. }))), config && "add" === config.style && eventname && "click" == eventname && $("#" + options.renderer).on("click", ".plg-card", function(e) {
  1725. callback && callback();
  1726. });
  1727. }, this.renderTo = function(id) {
  1728. $("#" + id).append(factory.getHtmlFragment());
  1729. }, options.renderer && this.renderTo(options.renderer);
  1730. }
  1731. };
  1732. window.PlgCard = PlgCard;
  1733. }(jQuery);
  1734. "use strict";
  1735. !function($) {
  1736. $.fn.initPlgCardList = function(options) {
  1737. var pg = new PlgCardList(options), id = $(this).attr("id");
  1738. return pg.renderTo(id), pg;
  1739. };
  1740. var PlgCardList = function PlgCardList(options) {
  1741. if (!options) return !1;
  1742. var config;
  1743. config = {
  1744. isShowAdd: !0
  1745. };
  1746. var factory = {
  1747. _data: (config = Object.assign({}, config, options.data)) || "",
  1748. _strTitle: function() {
  1749. var temStr = "";
  1750. return temStr += '<div class="plg-zone-container">\n <div class="plg-zone-header">\n <div class="plg-title"><i class="layui-icon layui-icon-location"></i>\n '.concat(this._data.zoneName, "</div>"),
  1751. this._data.isShowAdd && (temStr += '<div class="plg-add">\n <button class="layui-btn layui-btn-normal" data-zoneid='.concat(this._data.zoneId, ' name="plg-add">\n 添加\n </button>\n </div>')),
  1752. temStr += '</div>\n <div class="plg-customer-list">\n <ul class="layui-row">';
  1753. },
  1754. _strCellStart: function() {
  1755. return '<li class="layui-col-lg3 layui-col-md4 layui-col-sm6 \n layui-col-xs12">\n <div class="plg-cell">';
  1756. },
  1757. _strCellHead: function(head) {
  1758. return '<div class="plg-customer-name">\n <i class="plg-badge-dot"></i>'.concat(head, "\n </div>");
  1759. },
  1760. _strCellBody: function(des) {
  1761. return '<div class="plg-customer-des">'.concat(des, "</div>");
  1762. },
  1763. _strCellFooter: function(obj) {
  1764. var temFragment = "";
  1765. temFragment += '<div class="plg-customer-other">\n <div class="plg-cutomer-no">编号:<span>'.concat(obj.useNo, "</span></div>");
  1766. var temStr = "";
  1767. if (0 < Object.keys(obj.btns).length) {
  1768. var item;
  1769. JSON.stringify(obj.id);
  1770. for (item in temStr += '<div class="plg-cutomer-operating" data-id='.concat(obj.id, ">"),
  1771. obj.btns) temStr += '<span class="plg-'.concat(item, '">').concat(obj.btns[item], "</span>");
  1772. temStr += "</div>";
  1773. }
  1774. return temFragment += temStr, temFragment += "</div>";
  1775. },
  1776. _strCellEnd: function() {
  1777. return "</div>\n </li>";
  1778. },
  1779. _strFooter: function() {
  1780. return "</ul>\n </div>\n </div>";
  1781. },
  1782. getHtmlFragment: function() {
  1783. var self = this, temFragment = "";
  1784. return self._data.customerList && 0 < self._data.customerList.length && self._data.customerList.map(function(val) {
  1785. var temObj = {
  1786. id: val.id,
  1787. useNo: val.useNo,
  1788. btns: val.btns
  1789. };
  1790. temFragment += self._strCellStart(), temFragment += self._strCellHead(val.name),
  1791. temFragment += self._strCellBody(val.description), temFragment += self._strCellFooter(temObj),
  1792. temFragment += self._strCellEnd();
  1793. }), $(self._strTitle() + temFragment + self._strFooter());
  1794. }
  1795. };
  1796. function getData(id) {
  1797. if (null == config || null == config.customerList || config.customerList.length < 1) return null;
  1798. var result = null;
  1799. return config.customerList.map(function(item) {
  1800. item.id != id || (result = item);
  1801. }), result;
  1802. }
  1803. PlgCardList.prototype.cuson = function() {}, this.on = function(eventname, callback) {
  1804. "add" !== eventname ? this.event.find(".plg-" + eventname).length && this.event.find(".plg-" + eventname).on("click", function() {
  1805. var currentId = $(this).closest(".plg-cutomer-operating").data("id"), chddata = getData(currentId);
  1806. callback && callback(currentId, chddata);
  1807. }) : this.event.find(".plg-add").eq(0).on("click", function() {
  1808. var currentId = $(this).find(".layui-btn").eq(0).data("zoneid");
  1809. callback && callback(currentId);
  1810. });
  1811. }, this.getData = getData, this.renderTo = function(id) {
  1812. this.event = factory.getHtmlFragment(), $("#" + id).append(this.event);
  1813. }, options.renderer && this.renderTo(options.renderer);
  1814. };
  1815. window.PlgCardList = PlgCardList;
  1816. }(jQuery);
  1817. "use strict";
  1818. !function($, layui) {
  1819. layui.use([ "laydate" ], function() {
  1820. var plgDate = layui.laydate;
  1821. window.plgDate = plgDate, $.fn.plgDateRender = function(options) {
  1822. var _this = this, opts = $.extend(!0, {
  1823. value: ""
  1824. }, options);
  1825. return 1 < this.length ? $(this).each(function(index, value) {
  1826. opts.elem = this, _this.otps = plgDate.render(opts);
  1827. }) : (opts.elem = this.selector, _this.otps = plgDate.render(opts)), _this;
  1828. };
  1829. });
  1830. }(jQuery, layui);
  1831. "use strict";
  1832. !function($, h, c) {
  1833. var i, a = $([]), e = $.resize = $.extend($.resize, {}), k = "setTimeout", j = "resize", d = j + "-special-event", b = "delay", f = "throttleWindow";
  1834. e[b] = 250, e[f] = !0, $.event.special[j] = {
  1835. setup: function() {
  1836. if (!e[f] && this[k]) return !1;
  1837. var l = $(this);
  1838. a = a.add(l), $.data(this, d, {
  1839. w: l.width(),
  1840. h: l.height()
  1841. }), 1 === a.length && function g() {
  1842. i = h[k](function() {
  1843. a.each(function() {
  1844. var n = $(this), m = n.width(), l = n.height(), o = $.data(this, d);
  1845. m === o.w && l === o.h || n.trigger(j, [ o.w = m, o.h = l ]);
  1846. }), g();
  1847. }, e[b]);
  1848. }();
  1849. },
  1850. teardown: function() {
  1851. if (!e[f] && this[k]) return !1;
  1852. var l = $(this);
  1853. a = a.not(l), l.removeData(d), a.length || clearTimeout(i);
  1854. },
  1855. add: function(l) {
  1856. if (!e[f] && this[k]) return !1;
  1857. var n;
  1858. function m(s, o, p) {
  1859. var q = $(this), r = $.data(this, d);
  1860. r.w = o !== c ? o : q.width(), r.h = p !== c ? p : q.height(), n.apply(this, arguments);
  1861. }
  1862. if ($.isFunction(l)) return n = l, m;
  1863. n = l.handler, l.handler = m;
  1864. }
  1865. };
  1866. }(jQuery, window);
  1867. "use strict";
  1868. dhtmlXForm.prototype.items.blockSelect = {
  1869. render: function(item, data) {
  1870. item._type = "blockSelect", item._idd = data.name, item._value = "", item._eable = !0;
  1871. var _self = this, cid = "dhxId_blockSelect_" + Prolog.createRandomId();
  1872. item._cid = cid;
  1873. var label = document.createElement("div");
  1874. label.setAttribute("class", "dhxform_label " + data.labelAlign), label.innerHTML = '<label for="' + cid + '">' + data.label + "</label>",
  1875. data.labelWidth && (label.style.width = data.labelWidth + "px"), item.appendChild(label);
  1876. var control = document.createElement("div");
  1877. control.setAttribute("class", "dhxform_control");
  1878. var selectList = document.createElement("div");
  1879. selectList.setAttribute("class", "plg-form-multiSelect"), selectList.setAttribute("id", cid),
  1880. selectList.style.width = data.width + "px";
  1881. var ul = document.createElement("ul");
  1882. if (item._ul = ul, data.params = null == data.params ? {} : data.params, data.requestMethod = null == data.requestMethod ? "GET" : data.requestMethod,
  1883. data.valueField = null == data.valueField ? "value" : data.valueField, data.textField = null == data.textField ? "text" : data.textField,
  1884. null != data.url && "" != data.url) Prolog.ajax({
  1885. url: data.url,
  1886. type: data.requestMethod,
  1887. data: data.params,
  1888. success: function(da) {
  1889. if (da.success) {
  1890. for (var cdata = da.data.list ? da.data.list : da.data, i = 0; i < cdata.length; i++) {
  1891. var li = document.createElement("li");
  1892. li.innerHTML = "<span>" + cdata[i][data.textField] + "</span>", li.setAttribute("value", cdata[i][data.valueField]),
  1893. ul.appendChild(li);
  1894. }
  1895. if (selectList.appendChild(ul), control.appendChild(selectList), item.appendChild(control),
  1896. data.disabled) return this.disable(item), this;
  1897. _self.bindClickEvent(item, data);
  1898. }
  1899. }
  1900. }); else {
  1901. if (data.data && 0 < data.data.length) for (var i = 0; i < data.data.length; i++) {
  1902. var li = document.createElement("li");
  1903. li.innerHTML = "<span>" + data.data[i][data.textField] + "</span>", li.setAttribute("value", data.data[i][data.valueField]),
  1904. ul.appendChild(li);
  1905. }
  1906. if (selectList.appendChild(ul), control.appendChild(selectList), item.appendChild(control),
  1907. data.disabled) return this.disable(item), this;
  1908. this.bindClickEvent(item, data);
  1909. }
  1910. return data.hidden && (item.style.display = "none"), this;
  1911. },
  1912. bindClickEvent: function(item, data) {
  1913. var cid = item._cid;
  1914. $("#" + cid).on("click", "li", function() {
  1915. if (!$(this).hasClass("disabled")) {
  1916. null == data.multiSelect || 0 == data.multiSelect ? $(this).hasClass("active") ? $(this).removeClass("active") : ($("#" + cid + " li").removeClass("active"),
  1917. $(this).addClass("active")) : $(this).hasClass("active") ? $(this).removeClass("active") : $(this).addClass("active");
  1918. for (var values = [], selecteds = $("#" + cid + " .active"), k = 0; k < selecteds.length; k++) values.push($(selecteds[k]).attr("value"));
  1919. item._value = values.join(","), data.listener && data.listener(item._value);
  1920. }
  1921. });
  1922. },
  1923. destruct: function(item) {
  1924. $("#" + item._cid + " li").unbind("click"), item.innerHTML = "";
  1925. },
  1926. setValue: function(item, value) {
  1927. var values = (item._value = value).toString();
  1928. [].slice.call(item._ul.childNodes).forEach(function(item) {
  1929. var _val = item.getAttribute("value");
  1930. 0 <= values.indexOf(_val) && item.classList.add("active");
  1931. });
  1932. },
  1933. getValue: function(item) {
  1934. return item._value;
  1935. },
  1936. enable: function(item) {
  1937. $("#" + item._cid + " li").removeClass("disabled"), item._eable = !0;
  1938. },
  1939. disable: function(item) {
  1940. item._eable = !1, $("#" + item._cid + " li").addClass("disabled");
  1941. },
  1942. reset: function(item) {
  1943. $("#" + item._cid + " li").removeClass("active"), item._value = "";
  1944. },
  1945. clear: function(item) {
  1946. this.reset(item);
  1947. },
  1948. showItem: function(item) {
  1949. item.style.display = "block";
  1950. },
  1951. hideItem: function(item) {
  1952. item.style.display = "none";
  1953. }
  1954. }, dhtmlXForm.prototype.clearBlockSelect = function(name) {
  1955. return this.doWithItem(name, "clear");
  1956. }, dhtmlXForm.prototype.getFormData_blockSelect = function(name) {
  1957. return this.doWithItem(name, "getValue");
  1958. }, dhtmlXForm.prototype.setFormData_blockSelect = function(name, value) {
  1959. return this.doWithItem(name, "setValue", value);
  1960. };
  1961. "use strict";
  1962. dhtmlXForm.prototype.items.buttonGroup = {
  1963. render: function(item, data) {
  1964. item._idd = data.name, item._value = "", item._type = "buttonGroup", item._enabled = !data.disabled,
  1965. item.classList.add("buttonGroup");
  1966. var btnEl = document.createElement("div");
  1967. return 1 == data.hidden && this.hide(item), item._enabled || (this.userDisable(item),
  1968. item.classList.add("disabled")), btnEl.classList.add("dhxform_btn", "more_btn"),
  1969. btnEl.setAttribute("role", "link"), btnEl.innerHTML = '<div class="dhxform_btn_txt">' + data.value + '<i class="layui-icon layui-icon-right" style="font-size:12px;"></i></div><div class="dhxform_btn_filler" disabled="true"></div>',
  1970. item.appendChild(btnEl), data.width && (item.childNodes[0].style.width = data.width + "px"),
  1971. item._addSubListNode = function() {
  1972. var t = document.createElement("DIV");
  1973. return t._custom_css = "_child_list", t._ofsNested = 0, setTimeout(function() {
  1974. t.childNodes[0].setAttribute("class", "list-child");
  1975. }, 0), t.style.width = this.childNodes[0].offsetWidth + "px", this.appendChild(t),
  1976. t;
  1977. }, this;
  1978. },
  1979. destruct: function(item) {
  1980. for (this.doUnloadNestedLists(item), item.callEvent = null, item.checkEvent = null,
  1981. item.getForm = null, item._autoCheck = null, item._type = null, item._enabled = null,
  1982. item._cmd = null, item._name = null, item._doOnFocus = null, item._doOnBlur = null,
  1983. item._doOnKeyUpDown = null, item.onselectstart = null, item.firstChild.onselectstart = null,
  1984. item.firstChild.onkeypress = null, item.firstChild.ontouchstart = null, item.firstChild.onfocus = null,
  1985. item.firstChild.onblur = null, item.firstChild.onkeyup = null, item.firstChild.onkeydown = null,
  1986. item.firstChild.onmouseover = null, item.firstChild.onmouseout = null, item.firstChild.onmousedown = null,
  1987. item.firstChild.onmouseup = null; 0 < item.childNodes.length; ) item.removeChild(item.childNodes[0]);
  1988. item.parentNode.removeChild(item), item = null;
  1989. },
  1990. enable: function(item) {
  1991. 0 <= String(item.className).search("disabled") && (item.className = String(item.className).replace(/disabled/gi, "")),
  1992. item._enabled = !0, item.childNodes[0].removeAttribute("disabled"), item.childNodes[0].setAttribute("role", "link"),
  1993. item.childNodes[0].setAttribute("tabIndex", "0");
  1994. },
  1995. disable: function(item) {
  1996. String(item.className).search("disabled") < 0 && (item.className += " disabled"),
  1997. item._enabled = !1, item.childNodes[0].setAttribute("disabled", "true"), item.childNodes[0].removeAttribute("role"),
  1998. item.childNodes[0].removeAttribute("tabIndex");
  1999. }
  2000. };
  2001. "use strict";
  2002. dhtmlXCombo.prototype.getOption = function(value) {
  2003. for (var id = null, index = null, q = 0; q < this.list.childNodes.length; q++) if (null == id) {
  2004. var a = this.list.childNodes[q]._optId;
  2005. value && this.t[a].obj.getValue(this.t[a].item).toString() == value.toString() && (id = a,
  2006. index = q);
  2007. }
  2008. return null == id ? null : this._getOption(id, index);
  2009. };
  2010. "use strict";
  2011. !function($) {
  2012. $.fn.initPlgForm = function(options) {
  2013. var pg = new plgForm(options), id = $(this).attr("id");
  2014. return pg.renderTo(id), pg;
  2015. };
  2016. var plgForm = function plgForm(options) {
  2017. var opts, myForm, formStructure, _m_this = this, hiddenItems = new Array(), _default = {
  2018. renderer: null,
  2019. items: [],
  2020. isI18n: window.isI18n && "undefined" != typeof i18next || !1
  2021. };
  2022. function tips(is, txt, myForm, name) {
  2023. if (name) {
  2024. if ("hidden" == myForm.getItemType(name)) return !0;
  2025. var t_name = name;
  2026. is ? (myForm && myForm.clearNote(name), $(myForm.getInput(t_name)).parent().parent().removeClass("validate_error")) : myForm && (myForm.setNote(t_name, {
  2027. text: txt,
  2028. width: "auto"
  2029. }), $(myForm.getInput(t_name)).parents(".dhxform_item_label_left").addClass("validate_error"));
  2030. }
  2031. }
  2032. function resetSize(id) {
  2033. for (var i = 0; i < formStructure.length; i++) {
  2034. var item = formStructure[i];
  2035. setPlaceholder(id, item), setHiddenItems(item), setComboWidth(item), setToggleBtn(item);
  2036. }
  2037. $(".plg-toolbar-right").parent().css("float", "right"), $(".plg-toolbar-left").parent().css("float", "left"),
  2038. $("#" + id + " input").addClass("plg-input"), $("#" + id + " textarea").addClass("plg-input"),
  2039. $("#" + id + " select").addClass("plg-input"), $("#" + id).find(".layui-row").parent().css("width", "100%");
  2040. }
  2041. function renderTo(id) {
  2042. if (0 != $("#" + id).length) {
  2043. for (var key in $("#" + id).empty(), myForm = new dhtmlXForm(id, formStructure)) if (-1 === key.indexOf("_") && "function" == typeof myForm[key] && !_m_this[key]) {
  2044. var objm = myForm[key];
  2045. _m_this[key] = objm.bind(myForm);
  2046. }
  2047. Object.assign(plgForm.prototype, myForm.__proto__), resetSize(id), $("input.calendar").attr("autocomplete", "off");
  2048. }
  2049. }
  2050. function setComboWidth(item) {
  2051. if ("combo" == item.type) {
  2052. var dhxCombo = myForm.getCombo(item.name);
  2053. item.width ? (myForm.setItemWidth(item.name, item.width), dhxCombo.conf.combo_width = item.width,
  2054. dhxCombo.base.style.width = Math.max(0, dhxCombo.conf.combo_width) + "px") : setTimeout(function() {
  2055. dhxCombo.conf.combo_width = dhxCombo.DOMParent.clientWidth, dhxCombo.base.style.width = Math.max(0, dhxCombo.conf.combo_width) + "px";
  2056. }, 0), dhxCombo.DOMelem.parentNode.parentNode.append(dhxCombo.DOMlist), dhxCombo.attachEvent("onOpen", function() {
  2057. var w = $(dhxCombo.DOMelem).width();
  2058. return $(dhxCombo.DOMlist).width(w), dhxCombo.DOMlist.style.top = dhxCombo.DOMParent.offsetHeight + "px",
  2059. dhxCombo.DOMlist.style.left = 0, !(dhxCombo.DOMlist.style.right = 0);
  2060. });
  2061. }
  2062. if (item.list && 0 < item.list.length) for (var i = 0; i < item.list.length; i++) setComboWidth(item.list[i]);
  2063. }
  2064. function setToggleBtn(item) {
  2065. if ("button" == item.type && item.className && -1 < item.className.indexOf("toggle") && _m_this.renderHiddenToggleItem(item.name),
  2066. item.list && 0 < item.list.length) for (var i = 0; i < item.list.length; i++) setToggleBtn(item.list[i]);
  2067. }
  2068. function setHiddenItems(item) {
  2069. if (item.hidden && item.name && hiddenItems.push(item.name), item.list && 0 < item.list.length) for (var i = 0; i < item.list.length; i++) setHiddenItems(item.list[i]);
  2070. }
  2071. function setPlaceholder(id, item) {
  2072. if (item && item.placeholder && ("input" == item.type || "password" == item.type ? ($("#" + id + " textarea[name='" + item.name + "']").attr("placeholder", item.placeholder),
  2073. $("#" + id + " input[name='" + item.name + "']").attr("placeholder", item.placeholder)) : "select" == item.type ? $("#" + id + " select[name='" + item.name + "']").attr("placeholder", item.placeholder) : "combo" == item.type ? $("#" + id + " input[name='" + item.name + "']").parent().children("input").attr("placeholder", item.placeholder) : "calendar" == item.type && $("#" + id + " input[name='" + item.name + "']").parent().children("input").attr("placeholder", item.placeholder)),
  2074. item.list && 0 < item.list.length) for (var i = 0; i < item.list.length; i++) setPlaceholder(id, item.list[i]);
  2075. }
  2076. opts = $.extend({}, _default, options), this.t = this.t(this.isI18n), "undefined" != typeof i18next && opts.isI18n && 0 < opts.items.length && (opts.items = function setI18nItems(Items) {
  2077. var newObj = [];
  2078. return Items.map(function(item, index) {
  2079. if (newObj[index] = Prolog.deepClone(item), item.label) {
  2080. var labelOf = item.label.indexOf(":");
  2081. if (-1 != labelOf) {
  2082. var arr = item.label.toString().split("");
  2083. arr.splice(labelOf), item.label = arr.join("");
  2084. }
  2085. i18next.exists(item.label.toString()) && (newObj[index].label = i18next.t(item.label)),
  2086. -1 != labelOf && i18next.exists(item.label) && (newObj[index].label += ":");
  2087. }
  2088. return item.placeholder && i18next.exists(item.placeholder.toString()) && (newObj[index].placeholder = i18next.t(item.placeholder)),
  2089. "function" == typeof item.value ? newObj[index].value = item.value() : item.value && i18next.exists(item.value.toString()) && (newObj[index].value = i18next.t(item.value)),
  2090. item.text && i18next.exists(item.text.toString()) && (newObj[index].text = i18next.t(item.text)),
  2091. item.list && 0 < item.list.length ? newObj[index].list = setI18nItems(item.list) : item.options && 0 < item.options.length && (newObj[index].options = setI18nItems(item.options)),
  2092. newObj;
  2093. }), newObj;
  2094. }(opts.items)), formStructure = opts.items, this.resetSize = function() {
  2095. return resetSize(opts.renderer), this;
  2096. }, this.loadComboData = function(name, cfg) {
  2097. var item = function getOptsByName(name, array) {
  2098. for (var i = 0; i < array.length; i++) {
  2099. var item = array[i];
  2100. if (item.name == name) return item;
  2101. if (item.list) {
  2102. var re = getOptsByName(name, item.list);
  2103. if (null != re) return re;
  2104. }
  2105. }
  2106. return null;
  2107. }(name, formStructure);
  2108. if (null == item) PlgDialog.msg("找不到组件"); else {
  2109. var myCombo = myForm.getCombo(item.name), opss = (myconfig = item.remote ? item.remote : {}) ? myconfig.success : null;
  2110. if (cfg) var myconfig = $.extend(!0, item.remote, cfg);
  2111. myCombo.clearAll(!1);
  2112. var lind = PlgDialog.load(1);
  2113. myconfig.error = function() {
  2114. PlgDialog.close(lind);
  2115. }, myconfig.success = function(da) {
  2116. if (0 == da.success) return PlgDialog.msg("数据加载失败," + da.message), void PlgDialog.close(lind);
  2117. var obj = null;
  2118. obj = function(obj, cfg) {
  2119. for (var data = {
  2120. options: []
  2121. }, i = 0; i < obj.length; i++) {
  2122. var d = obj[i];
  2123. cfg.valueField && (d.value = d[cfg.valueField]), cfg.textField && (d.text = d[cfg.textField]),
  2124. data.options.push(d);
  2125. }
  2126. return data;
  2127. }(obj = da.data.list ? da.data.list : da.data, myconfig), "function" == typeof myconfig.beforeLoadData && (obj = myconfig.beforeLoadData(obj)),
  2128. myCombo.load(obj, function() {
  2129. PlgDialog.close(lind);
  2130. }), opss && opss(da);
  2131. }, Prolog.ajax(myconfig);
  2132. }
  2133. }, this.getFormData = function() {
  2134. return myForm.getFormData();
  2135. }, this.getDForm2 = function() {
  2136. var myForm = myForm;
  2137. return function() {
  2138. return myForm;
  2139. };
  2140. }, this.getDForm = function() {
  2141. return myForm;
  2142. }, this.getInput = function(name) {
  2143. return myForm.getInput(name);
  2144. }, this.getItemWidth = function(name) {
  2145. return myForm.getItemWidth(name);
  2146. }, this.getOptions = function(name) {
  2147. return myForm.getOptions(name);
  2148. }, this.getSelect = function(name) {
  2149. return myForm.getSelect(name);
  2150. }, this.getCheckedValue = function(name) {
  2151. return myForm.getCheckedValue(name);
  2152. }, this.getCombo = function(name) {
  2153. return myForm.getCombo(name);
  2154. }, this.hideItem = function(name, value) {
  2155. myForm.hideItem(name, value);
  2156. }, this.showItem = function(name, value) {
  2157. myForm.showItem(name, value);
  2158. }, this.showAllHItems = function() {
  2159. for (var i = 0; i < hiddenItems.length; i++) myForm.showItem(hiddenItems[i]);
  2160. hh = !1;
  2161. }, this.hideAllHItems = function() {
  2162. for (var i = 0; i < hiddenItems.length; i++) myForm.hideItem(hiddenItems[i]);
  2163. hh = !0;
  2164. };
  2165. var hh = !0;
  2166. function gid_openBtn() {
  2167. var i = "<i class='layui-icon layui-icon-down'></i>";
  2168. return opts.isI18n ? i18next.t("展开") + i : "展开" + i;
  2169. }
  2170. function gid_closeBtn() {
  2171. var i = "<i class='layui-icon layui-icon-up'></i>";
  2172. return opts.isI18n ? i18next.t("收起") + i : "收起" + i;
  2173. }
  2174. this.toggleHItems = function() {
  2175. return !(hh = hh ? (this.showAllHItems(), !1) : (this.hideAllHItems(), !0));
  2176. }, this.addHiddenToggleItem = function(pId, pos, insertAfter) {
  2177. var _this = this;
  2178. myForm.addItem(pId, {
  2179. type: "button",
  2180. name: "plg-more-001",
  2181. value: gid_openBtn,
  2182. className: "link"
  2183. }, pos, insertAfter), myForm.attachEvent("onButtonClick", function(name) {
  2184. "plg-more-001" == name && (_this.toggleHItems() ? _this.setItemLabel("plg-more-001", gid_closeBtn()) : _this.setItemLabel("plg-more-001", gid_openBtn()));
  2185. });
  2186. }, this.renderHiddenToggleItem = function(name) {
  2187. var _this = this;
  2188. _this.setItemLabel(name, gid_openBtn()), myForm.attachEvent("onButtonClick", function(na) {
  2189. name == na && (_this.toggleHItems() ? _this.setItemLabel(name, gid_closeBtn()) : _this.setItemLabel(name, gid_openBtn()));
  2190. });
  2191. }, this.disableItem = function(name) {
  2192. myForm.disableItem(name);
  2193. }, this.disableAllItem = function() {
  2194. myForm.forEachItem(function(name) {
  2195. myForm.disableItem(name);
  2196. });
  2197. }, this.enableItem = function(name) {
  2198. myForm.enableItem(name);
  2199. }, this.enableAllItem = function(name) {
  2200. myForm.forEachItem(function(name) {
  2201. myForm.enableItem(name);
  2202. });
  2203. }, this.clear = function() {
  2204. myForm.clear();
  2205. var data = myForm.getFormData();
  2206. for (var key in data) data[key] = "";
  2207. myForm.setFormData(data);
  2208. }, this.addItem = function(pid, itemData, pos, insertAfter) {
  2209. myForm.addItem(pid, itemData, pos, insertAfter);
  2210. }, this.removeItem = function(name, value) {
  2211. myForm.removeItem(name, value);
  2212. }, this.reset = function() {
  2213. myForm.reset();
  2214. }, this.getItemLabel = function(name, value) {
  2215. return 2 == arguments.length ? myForm.getItemLabel(name, value) : myForm.getItemLabel(name);
  2216. }, this.getItemValue = function(name) {
  2217. return myForm.getItemValue(name);
  2218. }, this.setFormData = function(jsonData) {
  2219. myForm.setFormData(jsonData);
  2220. }, this.setFormItemData = function(name, value) {
  2221. var item = {};
  2222. item[name] = value, myForm.setFormData(item);
  2223. }, this.setItemFocus = function(name) {
  2224. myForm.setItemFocus(name);
  2225. }, this.setItemHeight = function(name, height) {
  2226. myForm.setItemHeight(name, height);
  2227. }, this.setItemWidth = function(name, width) {
  2228. myForm.setItemWidth(name, width);
  2229. }, this.setItemLabel = function(name, label) {
  2230. myForm.setItemLabel(name, label);
  2231. }, this.setItemValue = function(name, value) {
  2232. myForm.setItemValue(name, value);
  2233. }, this.setItemReadonly = function(name, state) {
  2234. myForm.setReadonly(name, state);
  2235. }, this.setItemRequired = function(name, state) {
  2236. myForm.setRequired(name, state);
  2237. }, this.setItemValidation = function(name, rule) {
  2238. myForm.setValidation(name, rule);
  2239. }, this.validateItem = function(name) {
  2240. return myForm.validateItem(name);
  2241. }, this.validate = function() {
  2242. return Object.setPrototypeOf(dhtmlxValidation, function(myForm) {
  2243. return {
  2244. isPlusNumeric: function(value, name) {
  2245. var is = !!value.toString().match(/(^\d\d*\.\d*$)|(^\d\d*$)/);
  2246. return tips(is, "该项只能输入正数", myForm, name), is;
  2247. },
  2248. isNot24h: function(value, name) {
  2249. value = Number(value);
  2250. var is = isNaN(value);
  2251. return tips(is = value <= 24, "该项不能大于24小时", myForm, name), is;
  2252. },
  2253. isNotNegativeNume: function(value, name) {
  2254. value = Number(value);
  2255. var is = isNaN(value);
  2256. return tips(is = !!value.toString().match(/(^\d+$)/), "该项只能输入正整数", myForm, name),
  2257. is;
  2258. },
  2259. isEmpty: function(a) {
  2260. return "" == a;
  2261. },
  2262. isNotEmpty: function(a, name) {
  2263. null != a && (a = a.toString());
  2264. var is = a instanceof Array ? 0 < a.length : "" == !a;
  2265. return tips(is, "该项不能为空", myForm, name), is;
  2266. },
  2267. isValidBoolean: function(a) {
  2268. return !!a.toString().match(/^(0|1|true|false)$/);
  2269. },
  2270. isValidEmail: function(a) {
  2271. return !!a.toString().match(/(^[a-z0-9]([0-9a-z\-_\.]*)@([0-9a-z_\-\.]*)([.][a-z]{3})$)|(^[a-z]([0-9a-z_\.\-]*)@([0-9a-z_\-\.]*)(\.[a-z]{2,5})$)/i);
  2272. },
  2273. isValidInteger: function(a, name) {
  2274. var is = !!a.toString().match(/(^-?\d+$)/);
  2275. return tips(is, "该项只能为整数", _m_this.getDForm(), name), is;
  2276. },
  2277. isValidNumeric: function(a, name) {
  2278. var is = !!a.toString().match(/(^-?\d\d*[\.|,]\d*$)|(^-?\d\d*$)|(^-?[\.|,]\d\d*$)/);
  2279. return tips(is, "该项只能输入数字!", myForm, name), is;
  2280. },
  2281. isValidAplhaNumeric: function(a, name) {
  2282. var is = !!a.toString().match(/^[_\-a-z0-9]+$/gi);
  2283. return tips(is, "只能输入数字或小写字母!", myForm, name), is;
  2284. },
  2285. isValidDatetime: function(b) {
  2286. var a = b.toString().match(/^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})$/);
  2287. return a && !!(a[1] <= 9999 && a[2] <= 12 && a[3] <= 31 && a[4] <= 59 && a[5] <= 59 && a[6] <= 59) || !1;
  2288. },
  2289. isValidDate: function(a, name) {
  2290. var b = a.toString().match(/^(\d{4})-(\d{2})-(\d{2})$/), is = b && !!(b[1] <= 9999 && b[2] <= 12 && b[3] <= 31) || !1;
  2291. return tips(is, "日期格式不正确!", myForm, name), is;
  2292. },
  2293. isValidTime: function(b) {
  2294. var a = b.toString().match(/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/);
  2295. return a && !!(a[1] <= 24 && a[2] <= 59 && a[3] <= 59) || !1;
  2296. },
  2297. isValidIPv4: function(a, name) {
  2298. var b = a.toString().match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/), is = b && !!(b[1] <= 255 && b[2] <= 255 && b[3] <= 255 && b[4] <= 255) || !1;
  2299. return tips(is, "IP地址格式不正确!", myForm, name), is;
  2300. },
  2301. isValidCurrency: function(a) {
  2302. return !!a.toString().match(/^\$?\s?\d+?([\.,\,]?\d+)?\s?\$?$/);
  2303. },
  2304. isValidSSN: function(a) {
  2305. return !!a.toString().match(/^\d{3}\-?\d{2}\-?\d{4}$/);
  2306. },
  2307. isValidSIN: function(a, name) {
  2308. var is = !!a.toString().match(/^\d{9}$/);
  2309. return tips(is, "该项必须输入9位数字", myForm, name), is;
  2310. },
  2311. isMoney_11bit: function(a, name) {
  2312. a = Number(a);
  2313. var is = isNaN(a);
  2314. return tips(is = !!a.toString().match(/(^[1-9](\d){0,10}?(\.\d{1,2})?$)|(^0$)|(^\d\.\d{1,2}$)/), "该项只能输入0-11位数字,保留小数点后两位", myForm, name),
  2315. is && myForm.setItemValue(name, a), is;
  2316. }
  2317. };
  2318. }(myForm)), myForm.validate();
  2319. }, this.forEachItem = function(callback) {
  2320. callback && myForm.forEachItem(callback);
  2321. }, this.renderTo = function(id) {
  2322. return renderTo(id), opts.renderer = id, this;
  2323. }, this.on = function(eventName, callback) {
  2324. myForm.attachEvent(eventName, callback);
  2325. }, this.attachEvent = this.on, this.attachComboEvent = function(name, eventName, callback) {
  2326. myForm.getCombo(name) && myForm.getCombo(name).attachEvent(eventName, callback);
  2327. }, this.getLayDate = function(name) {
  2328. return myForm.getLaydate(name);
  2329. }, this.attachLayDateEvent = function(name, eventName, callback) {
  2330. this.getLayDate(name) && this.getDForm().attachLayDateEvent(name, eventName, callback);
  2331. }, opts.renderer && renderTo(opts.renderer);
  2332. };
  2333. plgForm.prototype.t = function(is) {
  2334. return this.t = is ? function(text) {
  2335. return i18next.t(text);
  2336. } : function(text) {
  2337. return text;
  2338. };
  2339. }, dhtmlXForm.prototype.setFormData = function(c) {
  2340. for (var b in c) {
  2341. var d = this.getItemType(b);
  2342. switch (d) {
  2343. case "checkbox":
  2344. this[1 == c[b] || 1 == parseInt(c[b]) || "true" == c[b] || c[b] == this.getItemValue(b, "realvalue") ? "checkItem" : "uncheckItem"](b);
  2345. break;
  2346. case "radio":
  2347. this.checkItem(b, c[b]);
  2348. break;
  2349. case "input":
  2350. case "laydate":
  2351. case "textarea":
  2352. case "password":
  2353. case "select":
  2354. case "multiselect":
  2355. case "hidden":
  2356. case "template":
  2357. case "blockSelect":
  2358. case "combo":
  2359. case "calendar":
  2360. case "colorpicker":
  2361. case "editor":
  2362. this.setItemValue(b, c[b]);
  2363. break;
  2364. default:
  2365. this["setFormData_" + d] ? this["setFormData_" + d](b, c[b]) : (this.hId || (this.hId = this._genStr(12)),
  2366. this.setUserData(this.hId, b, c[b]));
  2367. }
  2368. }
  2369. }, window.PlgForm = plgForm;
  2370. }(jQuery);
  2371. "use strict";
  2372. dhtmlXForm.prototype.items.laydate = {
  2373. render: function(item, data) {
  2374. var t = this;
  2375. item._type = "calendar";
  2376. item._enabled = !0;
  2377. data = Object.assign({
  2378. placeholder: "",
  2379. value: "",
  2380. lang: "zh_CN",
  2381. dateType: "date",
  2382. dateFormat: "yyyy/MM/dd",
  2383. range: !1,
  2384. showBottom: !0
  2385. }, data);
  2386. var n = navigator.userAgent;
  2387. 0 <= n.indexOf("MSIE 6.0") || 0 <= n.indexOf("MSIE 7.0") || n.indexOf("MSIE 8.0");
  2388. this.doAddLabel(item, data), this.doAddInput(item, data, "INPUT", "TEXT", !0, !0, "dhxform_textarea laydate"),
  2389. this.doAttachChangeLS(item);
  2390. document.createElement("input"), item.getForm();
  2391. var _input = item.childNodes[item._ll ? 1 : 0].childNodes[0];
  2392. _input.placeholder = data.placeholder, _input.setAttribute("readonly", !0), item.childNodes[item._ll ? 1 : 0].childNodes[0]._idd = item._idd,
  2393. item._f = data.dateFormat, item._lang = data.lang, item.value = data.value, "function" == typeof data.done && (item._done = data.done),
  2394. "function" == typeof data.ready && (item._ready = data.ready), "function" == typeof data.change && (item._change = data.change);
  2395. var paramDate = function(date) {
  2396. if (0 < !Object.getOwnPropertyNames(date).length) return null;
  2397. var dobj = {
  2398. year: 0,
  2399. month: 1,
  2400. date: 1,
  2401. hours: 0,
  2402. minutes: 0,
  2403. seconds: 0
  2404. };
  2405. for (var key in date) dobj[key] = date[key];
  2406. return new Date(Object.values(dobj).splice(0, 3).join("-") + " " + Object.values(dobj).splice(3).join(":"));
  2407. }, laydate_default = {
  2408. elem: _input,
  2409. type: data.dateType,
  2410. format: item._f,
  2411. value: item.value,
  2412. lang: item._lang,
  2413. showBottom: data.showBottom,
  2414. range: data.range,
  2415. ready: function(date) {
  2416. item.ready && item._ready(date);
  2417. },
  2418. done: function(value, date, endDate) {
  2419. var res = "";
  2420. res = date = paramDate(date), 0 < Object.getOwnPropertyNames(endDate).length && (endDate = paramDate(endDate),
  2421. (res = []).push(date, endDate)), item._done && item._done(value, date, endDate),
  2422. t.setValue(item, res);
  2423. },
  2424. change: function(value, date, endDate) {
  2425. var res = "";
  2426. res = date = paramDate(date), 0 < Object.getOwnPropertyNames(endDate).length && (endDate = paramDate(endDate),
  2427. (res = []).push(date, endDate)), item._change && item._change(value, date, endDate),
  2428. t.setValue(item, res);
  2429. }
  2430. };
  2431. return item._c = layui.laydate.render(laydate_default), this;
  2432. },
  2433. onReady: function(item, callback) {
  2434. return "function" == typeof callback ? item._ready = callback : null;
  2435. },
  2436. onDone: function(item, callback) {
  2437. return "function" == typeof callback ? item._done = callback : null;
  2438. },
  2439. onChange: function(item, callback) {
  2440. return "function" == typeof callback ? item._change = callback : null;
  2441. },
  2442. setLaydateLang: function(item, lang) {
  2443. return lang && (item._lang = lang, item._c.config.lang = item._f), item._lang;
  2444. },
  2445. getLaydate: function(item) {
  2446. return item;
  2447. },
  2448. setSkin: function(item, skin) {
  2449. return item._c.config.skin = skin;
  2450. },
  2451. setValue: function(item, value, cUpd) {
  2452. value && null != value && void 0 !== value && "" != value ? Array.isArray(value) ? (item.value = [],
  2453. value.forEach(function(v_item) {
  2454. v_item instanceof Date && item.value.push(new Date(v_item));
  2455. })) : (item.value = value instanceof Date ? value : new Date(value), item.childNodes[item._ll ? 1 : 0].childNodes[0].value = value instanceof Date ? layui.util.toDateString(value, item._f) : value) : (item.value = null,
  2456. item.childNodes[item._ll ? 1 : 0].childNodes[0].value = "");
  2457. },
  2458. getValue: function(item, asString) {
  2459. var d = item.value || null;
  2460. return !0 !== asString || d ? !0 === asString ? item.childNodes[item._ll ? 1 : 0].childNodes[0].value : d : "";
  2461. },
  2462. setLaydateFormat: function(item, dateFormat) {
  2463. item._f = dateFormat, item._c.config.format = item._f, this.setValue(item, this.getValue(item));
  2464. },
  2465. destruct: function(item) {
  2466. item._c = null, item._f = null, item.childNodes[item._ll ? 1 : 0].childNodes[0]._idd = null,
  2467. item.childNodes[item._ll ? 1 : 0].childNodes[0].onblur = null, this.d2(item), item = null;
  2468. },
  2469. checkEnteredValue: function(item) {}
  2470. }, function() {
  2471. for (var a in {
  2472. doAddLabel: 1,
  2473. doAddInput: 1,
  2474. doUnloadNestedLists: 1,
  2475. setText: 1,
  2476. getText: 1,
  2477. enable: 1,
  2478. disable: 1,
  2479. isEnabled: 1,
  2480. setWidth: 1,
  2481. setReadonly: 1,
  2482. isReadonly: 1,
  2483. setFocus: 1,
  2484. getInput: 1
  2485. }) dhtmlXForm.prototype.items.laydate[a] = dhtmlXForm.prototype.items.input[a];
  2486. }(), dhtmlXForm.prototype.items.laydate.doAttachChangeLS = dhtmlXForm.prototype.items.select.doAttachChangeLS,
  2487. dhtmlXForm.prototype.items.laydate.d2 = dhtmlXForm.prototype.items.input.destruct,
  2488. dhtmlXForm.prototype.getLaydate = function(name) {
  2489. return this.doWithItem(name, "getLaydate");
  2490. }, dhtmlXForm.prototype.setLaydateLang = function(name, lan) {
  2491. return this.doWithItem(name, "setLaydateLang", lan);
  2492. }, dhtmlXForm.prototype.attachLayDateEvent = function(name, event, callback) {
  2493. return this.doWithItem(name, event, callback);
  2494. }, dhtmlXForm.prototype.setLaydateFormat = function(name, dateFormat) {
  2495. this.doWithItem(name, "setLaydateFormat", dateFormat);
  2496. };
  2497. "use strict";
  2498. dhtmlXForm.prototype.items.row = {
  2499. _index: !1,
  2500. render: function(item, data) {
  2501. item._type = "row", item._idd = data.name, item.className = "row_" + data.position + ("string" == typeof data.className ? " " + data.className : ""),
  2502. item._enabled = !0, item._checked = !0;
  2503. var cid = "dhxId_row" + Prolog.createRandomId(), rowDiv = document.createElement("div");
  2504. return rowDiv.id = item._cid = cid, rowDiv.className = "cl", data.style && (rowDiv.style.cssText = data.style),
  2505. isNaN(data.width) ? item._width = "100%" : item._width = data.width + "px", rowDiv.style.width = item._width,
  2506. item.parentNode.style.cssText = "width:100%; ", item.parentNode.parentNode.style.width = "100%",
  2507. item.parentNode.parentNode.style.clear = "both", item.parentNode.parentNode.style.float = "none",
  2508. item.appendChild(rowDiv), 1 == data.hidden && this.hide(item), 1 == data.disabled && this.userDisable(item),
  2509. item._addSubListNode = function() {
  2510. var t = document.createElement("DIV");
  2511. return t._custom_css = "_row_list", t._ofsNested = 0, setTimeout(function() {
  2512. t.childNodes[0].setAttribute("class", "layui-row");
  2513. }, 0), this.childNodes[0].appendChild(t), t;
  2514. }, this;
  2515. },
  2516. destruct: function(item) {
  2517. item.innerHTML = "";
  2518. },
  2519. setValue: function(item) {},
  2520. getValue: function(item) {},
  2521. enable: function(itme) {},
  2522. disable: function(itme) {},
  2523. getText: function(itme) {},
  2524. getWidth: function() {},
  2525. getFormRow: function(item) {
  2526. return item;
  2527. }
  2528. }, dhtmlXForm.prototype.getFormRow = function(name) {
  2529. return this.doWithItem(name, "getFormRow");
  2530. };
  2531. "use strict";
  2532. function _typeof(obj) {
  2533. return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  2534. return typeof obj;
  2535. } : function(obj) {
  2536. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  2537. })(obj);
  2538. }
  2539. dhtmlXForm.prototype.items.selectTable = {
  2540. render: function(item, data) {
  2541. item._type = "selectTable", item._idd = data.name, item._value = "", item._table = data.table,
  2542. item._active = !1;
  2543. var sgrid, cid = "dhxId_selectTable_" + Prolog.createRandomId(), label = document.createElement("div");
  2544. label.setAttribute("class", "dhxform_label " + data.labelAlign), label.innerHTML = '<label for="' + cid + '">' + data.label + "</label>",
  2545. data.labelWidth && (label.style.width = data.labelWidth + "px"), item.appendChild(label);
  2546. var control = document.createElement("div");
  2547. control.setAttribute("class", "dhxform_control");
  2548. var mainInput = document.createElement("input");
  2549. mainInput.setAttribute("type", "text"), mainInput.setAttribute("class", "dhxform_textarea plg-input"),
  2550. mainInput.style.width = data.width + "px", mainInput.setAttribute("placeholder", data.placeholder),
  2551. mainInput.setAttribute("readonly", "readonly"), control.appendChild(mainInput);
  2552. var hiddenInput = document.createElement("input");
  2553. if (hiddenInput.setAttribute("type", "hidden"), hiddenInput.setAttribute("name", data.name),
  2554. control.appendChild(hiddenInput), item.appendChild(control), 1 == data.disabled) return mainInput.setAttribute("disabled", "disabled"),
  2555. hiddenInput.setAttribute("disabled", "disabled"), item._enabled = !1, this;
  2556. var win_index = -1;
  2557. function singleSelect(rId, cInd) {
  2558. var jo = sgrid.getRowData(rId, data.fieldValue), valueArray = [];
  2559. try {
  2560. valueArray = null != item._value && "" != item._value ? JSON.parse(item._value) : [];
  2561. } catch (e) {
  2562. valueArray = [];
  2563. }
  2564. -1 < Prolog.hasJson(valueArray, jo) ? setUnSelectedValue(rId) : setSelectedValue(rId),
  2565. PlgDialog.close(win_index);
  2566. }
  2567. function setUnSelectedValue(selectId) {
  2568. if (selectId) {
  2569. var jo = sgrid.getRowData(selectId, data.fieldValue), valueArray = [];
  2570. try {
  2571. valueArray = null != item._value && "" != item._value ? JSON.parse(item._value) : [];
  2572. } catch (e) {}
  2573. if (-1 == Prolog.hasJson(valueArray, jo)) return;
  2574. var showText = mainInput.getAttribute("value") ? mainInput.getAttribute("value").split(",") : [], textField = data.fieldText, valueFields = data.fieldValue, vData = sgrid.getRowData(selectId, valueFields), index = Prolog.hasJson(valueArray, vData);
  2575. -1 < index && valueArray.splice(index, 1);
  2576. var tData = sgrid.getRowData(selectId, textField);
  2577. showText.splice(showText.indexOf(tData), 1), mainInput.setAttribute("value", showText.toString()),
  2578. hiddenInput.setAttribute("value", JSON.stringify(valueArray)), item._textValue = showText.toString(),
  2579. item._value = JSON.stringify(valueArray), "object" === _typeof(data.listener) && "function" == typeof data.listener.afterSelect && data.listener.afterSelect(!1, selectId, sgrid);
  2580. }
  2581. }
  2582. function setSelectedValue(selectId) {
  2583. if (selectId) {
  2584. var jo = sgrid.getRowData(selectId, data.fieldValue), valueArray = [];
  2585. try {
  2586. valueArray = null != item._value && "" != item._value ? JSON.parse(item._value) : [];
  2587. } catch (e) {}
  2588. if (-1 < Prolog.hasJson(valueArray, jo)) return;
  2589. var showText = mainInput.getAttribute("value") ? mainInput.getAttribute("value").split(",") : [];
  2590. 0 == item._table.multiselect && (valueArray = [], showText = []);
  2591. var textField = data.fieldText, valueFields = data.fieldValue, vData = sgrid.getRowData(selectId, valueFields);
  2592. valueArray.push(vData);
  2593. var tData = sgrid.getRowData(selectId, textField);
  2594. showText.push(tData), mainInput.setAttribute("value", showText.toString()), hiddenInput.setAttribute("value", JSON.stringify(valueArray)),
  2595. item._textValue = showText.toString(), item._value = JSON.stringify(valueArray),
  2596. "object" === _typeof(data.listener) && "function" == typeof data.listener.afterSelect && data.listener.afterSelect(!0, selectId, sgrid);
  2597. }
  2598. }
  2599. return mainInput.onclick = function(e) {
  2600. var left = Prolog.getLeft(this), _width = (Prolog.getTop(this), $(this).parent().height(),
  2601. $(this).width()), layerId = ($(this).height(), data.fieldText, data.fieldValue,
  2602. "layer" + Prolog.createRandomId()), tableWidth = data.tableWidth ? data.tableWidth : 600, tableHeight = data.tableHeight ? data.tableHeight : 500;
  2603. left + _width > document.body.clientWidth ? left = document.body.clientWidth - tableWidth - 30 : left + tableWidth > document.body.clientWidth && (left = left - tableWidth + _width + 10),
  2604. window.innerHeight, win_index = layer.open({
  2605. type: 1,
  2606. id: layerId,
  2607. title: !1,
  2608. resize: !1,
  2609. offset: "auto",
  2610. btn: [],
  2611. closeBtn: 0,
  2612. area: [ tableWidth + "px", tableHeight + "px" ],
  2613. shadeClose: !0,
  2614. shade: .5,
  2615. content: '<div id="' + cid + '_grid" style="width:100%;height:' + (tableHeight - 30) + 'px;"></div>',
  2616. end: function() {
  2617. item._active = !1, "object" === _typeof(data.listener) && "function" == typeof data.listener.afterClose && data.listener.afterClose(item._textValue, item._value, sgrid);
  2618. },
  2619. success: function(layero, index) {
  2620. item._active = !0, $("#layui-layer" + index + " .layui-layer-btn").hide(), $("#layui-layer" + index).height($("#layui-layer" + index).height() - 23),
  2621. $("#layui-layer" + index + " .layui-layer-content").css("padding", "0px"), (sgrid = new PlgGrid(item._table)).renderTo(cid + "_grid"),
  2622. sgrid.loadData(null, function() {
  2623. for (var rownum = sgrid.getGrid().getRowsNum(), i = 0; i < rownum; i++) {
  2624. var rid = sgrid.getGrid().getRowId(i), jo = sgrid.getRowData(rid, data.fieldValue), valueArray = [];
  2625. try {
  2626. valueArray = null != item._value && "" != item._value ? JSON.parse(item._value) : [];
  2627. } catch (e) {}
  2628. -1 < Prolog.hasJson(valueArray, jo) && (item._table.multiselect ? sgrid.setCellValue(rid, 1, 1) : sgrid.selectRowById(rid));
  2629. }
  2630. }), item._table.multiselect ? (sgrid.on("onCheck", function(rId, cInd, state) {
  2631. 1 == cInd && (state ? setSelectedValue(rId) : setUnSelectedValue(rId));
  2632. }), sgrid.on("onHeaderClick", function(ind, obj) {
  2633. if (1 != ind) return !0;
  2634. if (-1 < $("#" + cid + "_grid .plg-grid-second-col").attr("src").indexOf("chk0")) for (var rownum = sgrid.getGrid().getRowsNum(), i = 0; i < rownum; i++) {
  2635. setUnSelectedValue(sgrid.getGrid().getRowId(i));
  2636. } else sgrid.getCheckedIds().split(",").forEach(function(val) {
  2637. setSelectedValue(val);
  2638. });
  2639. return !0;
  2640. })) : (sgrid.on("onRowSelect", singleSelect), sgrid.attachEvent("onRowDblClicked", singleSelect)),
  2641. data.listener && ("function" == typeof data.listener ? data.listener(sgrid) : "object" === _typeof(data.listener) && "function" == typeof data.listener.init && data.listener.init(sgrid));
  2642. }
  2643. });
  2644. }, data.hidden && (item.style.display = "none"), this;
  2645. },
  2646. destruct: function(item) {
  2647. item.getElementsByTagName("input")[0].onclick = null, item.innerHTML = "";
  2648. },
  2649. setValue: function(item, value) {
  2650. item.getElementsByTagName("input")[1].setAttribute("value", value), item._value = value;
  2651. },
  2652. getValue: function(item) {
  2653. return item._value;
  2654. },
  2655. enable: function(item) {
  2656. var inputs = item.getElementsByTagName("input");
  2657. inputs[0].removeAttribute("disabled"), inputs[1].removeAttribute("disabled");
  2658. },
  2659. disable: function(item) {
  2660. var inputs = item.getElementsByTagName("input");
  2661. inputs[0].setAttribute("disabled", "disabled"), inputs[1].setAttribute("disabled", "disabled");
  2662. },
  2663. getText: function(item) {
  2664. return item._textValue;
  2665. },
  2666. setText: function(item, value) {
  2667. item._textValue = value, item.getElementsByTagName("input")[0].setAttribute("value", value);
  2668. },
  2669. reset: function(item) {
  2670. var inputs = item.getElementsByTagName("input");
  2671. inputs[0].setAttribute("value", ""), inputs[1].setAttribute("value", ""), item._textValue = "",
  2672. item._value = "";
  2673. },
  2674. clear: function(item) {
  2675. this.reset(item);
  2676. },
  2677. setTableConfig: function(item, data) {
  2678. item._table = data;
  2679. },
  2680. showItem: function(item) {},
  2681. hideItem: function(item) {
  2682. item.style.display = "none";
  2683. },
  2684. active: function(item) {
  2685. var inputs = item.getElementsByTagName("input");
  2686. $(inputs[0]).trigger("click");
  2687. },
  2688. isActive: function(item) {
  2689. return item._active;
  2690. },
  2691. setData: function(item, txt, value) {
  2692. this.setText(item, txt), this.setValue(item, value);
  2693. }
  2694. }, dhtmlXForm.prototype.setData = function(name, txt, value) {
  2695. this.doWithItem(name, "setData", txt, value);
  2696. }, dhtmlXForm.prototype.active = function(name) {
  2697. this.doWithItem(name, "active");
  2698. }, dhtmlXForm.prototype.isActive = function(name) {
  2699. return this.doWithItem(name, "isActive");
  2700. }, dhtmlXForm.prototype.getText = function(name) {
  2701. return this.doWithItem(name, "getText");
  2702. }, dhtmlXForm.prototype.setText = function(name, value) {
  2703. return this.doWithItem(name, "setText", value);
  2704. }, dhtmlXForm.prototype.clearSelectTable = function(name) {
  2705. return this.doWithItem(name, "clear");
  2706. }, dhtmlXForm.prototype.setTableConfig = function(name, data) {
  2707. return this.doWithItem(name, "setTableConfig", data);
  2708. }, dhtmlXForm.prototype.getFormData_selectTable = function(name) {
  2709. return this.doWithItem(name, "getValue");
  2710. }, dhtmlXForm.prototype.setFormData_selectTable = function(name, value) {
  2711. return this.doWithItem(name, "setValue", value);
  2712. };
  2713. "use strict";
  2714. function eXcell_button(cell) {
  2715. cell && (this.cell = cell, this.grid = this.cell.parentNode.grid, cell.align = "center"),
  2716. this.edit = function() {}, this.isDisabled = function() {
  2717. return !0;
  2718. }, this.setValue = function(val) {
  2719. var row_id = this.cell.parentNode.idd, row_data = JSON.stringify(this.grid.getUserData(row_id, "data"));
  2720. row_data = row_data.replaceAll("'", "");
  2721. for (var btns = (val = val.replaceAll(",", ";")).split(";"), str = "", k = 0; k < btns.length; k++) {
  2722. var btnstr = btns[k], btnv = btnstr.substring(0, btnstr.indexOf("^"));
  2723. str += "<div class='plg-divider plg-divider-vertical'></div><a class='' href='javascript:void(0);' onclick='" + btnstr.substring(btnstr.indexOf("^") + 1) + '("' + row_id + '",' + row_data + ")' >" + btnv + "</a>";
  2724. }
  2725. str = str.substring(str.indexOf("<a")), this.setCValue(str, val);
  2726. };
  2727. }
  2728. eXcell_button.prototype = new eXcell();
  2729. "use strict";
  2730. function eXcell_co(a) {
  2731. a && (this.cell = a, this.grid = this.cell.parentNode.grid, this.combo = this.cell._combo || this.grid.getCombo(this.cell._cellIndex),
  2732. this.editable = !0), this.selectWidth = this.grid.opts.columns[this.cell._cellIndex - 1].selectWidth + "px" || this.cell.offsetWidth + "px",
  2733. this.selectHeight = this.grid.opts.columns[this.cell._cellIndex - 1].selectHeight + "px" || "auto",
  2734. this.shiftNext = function() {
  2735. var b = this.list.options[this.list.selectedIndex + 1];
  2736. return b && (b.selected = !0), this.obj.value = this.list.options[this.list.selectedIndex].text,
  2737. !0;
  2738. }, this.shiftPrev = function() {
  2739. if (0 != this.list.selectedIndex) {
  2740. var b = this.list.options[this.list.selectedIndex - 1];
  2741. b && (b.selected = !0), this.obj.value = this.list.options[this.list.selectedIndex].text;
  2742. }
  2743. return !0;
  2744. }, this.edit = function() {
  2745. var d = this.grid.getPosition(this.cell, this.cell);
  2746. this.list = document.createElement("SELECT"), this.list.className = "dhx_combo_select",
  2747. this.val = this.getValue(), this.text = this.getText()._dhx_trim(), this.obj = document.createElement("TEXTAREA"),
  2748. this.obj.className = "dhx_combo_edit", this.obj.style.height = this.cell.offsetHeight - (this.grid.multiLine ? 9 : 4) + "px",
  2749. this.obj.wrap = "soft", this.obj.style.textAlign = this.cell.style.textAlign, this.obj.onclick = function(i) {
  2750. (i || event).cancelBubble = !0;
  2751. }, this.obj.onmousedown = function(i) {
  2752. (i || event).cancelBubble = !0;
  2753. }, this.obj.value = this.text, this.obj.onselectstart = function(i) {
  2754. return i || (i = event), i.cancelBubble = !0;
  2755. };
  2756. var f = this;
  2757. this.obj.onkeyup = function(m) {
  2758. var l = (m || event).keyCode;
  2759. if (38 != l && 40 != l && 9 != l) for (var n = this.readonly ? String.fromCharCode(l) : this.value, o = f.list.options, j = 0; j < o.length; j++) if (0 == o[j].text.indexOf(n)) return o[j].selected = !0;
  2760. }, this.list.style.width = this.selectWidth, this.list.style.height = this.selectHeight,
  2761. this.list.style.left = 0, this.list.style.right = 0, this.list.style.left = this.cell.offsetLeft + "px",
  2762. this.list.style.top = d[1] + this.cell.offsetTop + this.cell.offsetHeight + "px";
  2763. this.list.onclick = function(l) {
  2764. var j = l || window.event, i = j.target || j.srcElement;
  2765. "OPTION" == i.tagName && (i = i.parentNode), f.editable = !1, f.grid.editStop(),
  2766. j.cancelBubble = !0, j.target.text;
  2767. };
  2768. for (var b = this.combo.getKeys(), e = !1, h = 0, c = 0; c < b.length; c++) {
  2769. var g = this.combo.get(b[c]);
  2770. this.list.options[this.list.options.length] = new Option(g, b[c]), b[c] == this.val && (h = this.list.options.length - 1,
  2771. e = !0);
  2772. }
  2773. 0 == e && (this.list.options[this.list.options.length] = new Option(this.text, null === this.val ? "" : this.val),
  2774. h = this.list.options.length - 1), this.cell.style.overflow = "hidden", this.cell.appendChild(this.list),
  2775. document.getSelection().empty(), this.list.size = "6", this.cstate = 1, this.editable ? this.cell.innerHTML = "" : (this.obj.style.width = "0px",
  2776. this.obj.style.height = "0px"), this.cell.appendChild(this.obj), this.list.options[h].selected = !0,
  2777. this.editable && this.obj.focus(), this.editable || (this.obj.style.visibility = "hidden",
  2778. this.obj.style.position = "absolute", this.list.focus(), this.list.onkeydown = function(i) {
  2779. if (i = i || window.event, f.grid.setActive(!0), i.keyCode < 30) return f.grid.doKey({
  2780. target: f.cell,
  2781. keyCode: i.keyCode,
  2782. shiftKey: i.shiftKey,
  2783. ctrlKey: i.ctrlKey
  2784. });
  2785. }), Array.prototype.slice.call(this.list.options).forEach(function(item) {
  2786. item.style.padding = "5px";
  2787. });
  2788. }, this.getValue = function() {
  2789. return this.cell.combo_value == window.undefined ? "" : this.cell.combo_value;
  2790. }, this.detach = function() {
  2791. if (this.val != this.getValue() && (this.cell.wasChanged = !0), null != this.list.parentNode) if (this.editable) {
  2792. var b = this.list.options[this.list.selectedIndex];
  2793. if (b && b.text == this.obj.value) this.setValue(this.list.value); else {
  2794. var c = this.cell._combo || this.grid.getCombo(this.cell._cellIndex), d = c.values._dhx_find(this.obj.value);
  2795. -1 != d ? this.setValue(c.keys[d]) : this.setValue(this.cell.combo_value = this.obj.value);
  2796. }
  2797. } else this.setValue(this.list.value);
  2798. return this.list.parentNode && this.list.parentNode.removeChild(this.list), this.obj.parentNode && this.obj.parentNode.removeChild(this.obj),
  2799. this.val != this.getValue();
  2800. };
  2801. }
  2802. "use strict";
  2803. function _typeof(obj) {
  2804. return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  2805. return typeof obj;
  2806. } : function(obj) {
  2807. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  2808. })(obj);
  2809. }
  2810. function eXcell_selectTable(cell) {
  2811. cell && (this.cell = cell, this.grid = this.cell.parentNode.grid, this.cell.selectTable = null,
  2812. this.cellIndex = cell.cellIndex, this.cellColumnId = this.grid.columnIds[this.cellIndex],
  2813. this.cellWidth = this.grid.cellWidthPX[this.cellIndex], this.cell.selectTable_value = "",
  2814. this.cell.selectTable_text = ""), this.setValue = function(val) {
  2815. if (null != val) {
  2816. this.setPTCellValue();
  2817. var row_id = this.cell.parentNode.idd, data = this.grid.getUserData(row_id, "data");
  2818. if (null != data && "" != data || (data = {}), "object" == _typeof(val)) this.setCValue(val.text),
  2819. this.cell.selectTable_value = val.value, this.cell.selectTable_text = val.text; else try {
  2820. var jo = JSON.parse(val);
  2821. this.setCValue(jo.text);
  2822. var tv = jo.value;
  2823. "object" == _typeof(tv) && (tv = JSON.stringify(tv)), this.cell.selectTable_value = tv,
  2824. this.cell.selectTable_text = jo.text;
  2825. } catch (e) {
  2826. this.setCValue(val), this.cell.selectTable_value = val, this.cell.selectTable_text = val;
  2827. }
  2828. data[this.cellColumnId] = val, this.grid.setUserData(row_id, "data", data);
  2829. var editTableCellData = this.grid.getUserData(row_id, "editTableCellData");
  2830. null != editTableCellData && "" != editTableCellData || (editTableCellData = {}),
  2831. editTableCellData[this.cellColumnId] = val, this.grid.setUserData(row_id, "editTableCellData", editTableCellData);
  2832. }
  2833. }, this.getValue = function() {
  2834. var row_id = this.cell.parentNode.idd, data = this.grid.getUserData(row_id, "editTableCellData");
  2835. return null != data && "" != data && null != data[this.cellColumnId] ? data[this.cellColumnId] : "";
  2836. }, this.getData = function() {
  2837. var row_id = this.cell.parentNode.idd, data = this.grid.getUserData(row_id, "editTableCellData");
  2838. return null != data && "" != data ? data[this.cellColumnId] : null;
  2839. }, this.edit = function() {
  2840. var rda = this.getData(), cv = this.cell.selectTable_value, ct = this.cell.selectTable_text;
  2841. null != rda && (cv = rda.value, ct = rda.text);
  2842. for (var columnOpt, opts = this.grid.opts, i = 0; i < opts.columns.length; i++) if (opts.columns[i].id == this.cellColumnId) {
  2843. columnOpt = opts.columns[i];
  2844. break;
  2845. }
  2846. var table = columnOpt.table;
  2847. this.cell.innerHTML = "<div id='selectTable_xcell_00001'></div>";
  2848. var _this = this;
  2849. table.beforeLoad && (0, table.beforeLoad)(table);
  2850. opts = {
  2851. renderer: "selectTable_xcell_00001",
  2852. items: [ {
  2853. type: "settings",
  2854. position: "label-left",
  2855. labelWidth: 0
  2856. }, {
  2857. type: "selectTable",
  2858. table: table,
  2859. width: _this.cellWidth - 8,
  2860. fieldText: columnOpt.fieldText,
  2861. fieldValue: columnOpt.fieldValue,
  2862. name: this.cellColumnId,
  2863. label: "",
  2864. placeholder: "单击选择",
  2865. listener: {
  2866. afterClose: function(txt, value, plgGrid) {
  2867. (null != txt && null != txt && "" != txt && (_this.cell.innerHTML = "", _this.setValue({
  2868. text: txt,
  2869. value: value
  2870. })), columnOpt.listener && columnOpt.listener.afterClose) && (0, columnOpt.listener.afterClose)(txt, value, plgGrid);
  2871. },
  2872. init: function(grid) {
  2873. columnOpt.listener && columnOpt.listener.init && (0, columnOpt.listener.init)(grid);
  2874. },
  2875. afterSelect: function(isSelected, selectId, sgrid) {
  2876. columnOpt.listener && columnOpt.listener.afterSelect && (0, columnOpt.listener.afterSelect)(isSelected, selectId, sgrid);
  2877. }
  2878. }
  2879. } ]
  2880. };
  2881. var frm = new PlgForm(opts);
  2882. this.cell.selectTable = frm, null != cv && null != ct && frm.getDForm().setData(this.cellColumnId, ct, cv);
  2883. }, this.detach = function() {
  2884. this.setPTCellValue();
  2885. }, this.setPTCellValue = function() {
  2886. var rda = this.getData();
  2887. this.cell.innerHTML = null != rda && null != rda.text ? rda.text : "";
  2888. };
  2889. }
  2890. eXcell_selectTable.prototype = new eXcell();
  2891. "use strict";
  2892. function _toConsumableArray(arr) {
  2893. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
  2894. }
  2895. function _nonIterableSpread() {
  2896. throw new TypeError("Invalid attempt to spread non-iterable instance");
  2897. }
  2898. function _iterableToArray(iter) {
  2899. if (Symbol.iterator in Object(iter) || "[object Arguments]" === Object.prototype.toString.call(iter)) return Array.from(iter);
  2900. }
  2901. function _arrayWithoutHoles(arr) {
  2902. if (Array.isArray(arr)) {
  2903. for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
  2904. return arr2;
  2905. }
  2906. }
  2907. function _typeof(obj) {
  2908. return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  2909. return typeof obj;
  2910. } : function(obj) {
  2911. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  2912. })(obj);
  2913. }
  2914. !function($) {
  2915. $.fn.initPlgGridExpand = function(options) {
  2916. var pg = new plgGridExpand(options), id = $(this).attr("id");
  2917. return pg.renderTo(id), pg;
  2918. };
  2919. var plgGridExpand = function(options) {
  2920. var opts, panel, laypage, panelId, sideBarId, sideBarFormId, pageBarId, gridId, toolBarId, pageBarPanelId, gridTitleId, centerPanelId, mygrid, toolBarForm, sideBarForm, gridForm, formDisableFields, beforeDialogOpenEvent, afterDialogOpenEvent, columnArray, headerArray, hidenArray, plgGrid_default = {
  2921. expandRow: !1,
  2922. isI18n: window.isI18n || !1,
  2923. title: "",
  2924. renderer: "",
  2925. fixedLast: !1,
  2926. columns: [],
  2927. multiselect: !1,
  2928. url: "data.json",
  2929. type: "get",
  2930. pageNum: "pageNum",
  2931. pageSize: "pageSize",
  2932. params: {
  2933. pageSize: 10,
  2934. pageNum: 1
  2935. },
  2936. contentType: "application/x-www-form-urlencoded",
  2937. page: !0,
  2938. expandedRowRender: null,
  2939. totalCount: "totalCount",
  2940. toolbar: [],
  2941. formData: [],
  2942. pagebar: {
  2943. buttons: [],
  2944. type: "full"
  2945. }
  2946. };
  2947. opts = $.extend({}, plgGrid_default, options), this.opts = opts;
  2948. var rand = Prolog.createRandomId(), pageNum = plgGrid_default.params.pageNum, pageSize = plgGrid_default.params.pageSize;
  2949. if (opts.params) {
  2950. var _tmp = opts.params;
  2951. if ("object" == _typeof(_tmp)) pageNum = null != _tmp.pageNum ? _tmp.pageNum : pageNum,
  2952. pageSize = null != _tmp.pageSize ? _tmp.pageSize : pageSize; else {
  2953. var _tmpObj = JSON.parse(_tmp);
  2954. pageNum = null != _tmpObj.pageNum ? _tmpObj.pageNum : pageNum, pageSize = null != _tmpObj.pageSize ? _tmpObj.pageSize : pageSize;
  2955. }
  2956. }
  2957. var containerId, loadDataCallback, rownum = 1, Jumpcallback = null, fixColumn = {}, gscroll = 0, _this = this;
  2958. function resetSize() {
  2959. var objbox = $("#" + gridId + " .objbox"), gtable = $("#" + gridId + " .objbox table"), hdtable = $("#" + gridId + " .xhdr table");
  2960. if (opts.expandRow || opts.fixedLast && objbox.width() > gtable.width()) gtable.find("tbody tr:first-child th:last-child"),
  2961. hdtable.find("tbody tr:first-child th:last-child");
  2962. gtable.height(), objbox.height();
  2963. var mtop = $("#" + toolBarId)[0] ? $("#" + toolBarId).height() + 5 : 0;
  2964. $("#" + panelId + " .center-panel .plg-grid-sidebuttonpanel a").css("top", mtop);
  2965. }
  2966. function renderTo(id) {
  2967. $("#" + (containerId = id)).empty(), id + "-colsetting-" + rand, panelId = id + "-panel-" + rand,
  2968. centerPanelId = id + "-centerPanelId-" + rand, sideBarId = id + "-sidebar-" + rand,
  2969. sideBarFormId = id + "-sidebarform-" + rand, toolBarId = id + "-toolbar-" + rand,
  2970. pageBarPanelId = id + "-pagebar-panel-" + rand, pageBarId = id + "-pagebar-" + rand,
  2971. gridId = id + "-panel-grid-" + rand, gridTitleId = id + "-panel-grid-title-" + rand,
  2972. function(containerId) {
  2973. (panel = document.createElement("div")).className = "plg-grid-panel layui-row",
  2974. panel.setAttribute("id", panelId), $("#" + containerId).append(panel);
  2975. var centerPanel = document.createElement("div");
  2976. centerPanel.setAttribute("id", centerPanelId), centerPanel.className = "center-panel layui-col-md12",
  2977. panel.appendChild(centerPanel);
  2978. var centerContainerPanel = document.createElement("div");
  2979. if (centerContainerPanel.setAttribute("id", centerPanelId), centerContainerPanel.className = "plg-grid-body",
  2980. opts.enableSideBar && null != !opts.sideBar) {
  2981. var sideBtnPanel = function() {
  2982. var sideButtonPanel = document.createElement("div");
  2983. sideButtonPanel.className = "plg-grid-sidebuttonpanel";
  2984. var alink = document.createElement("a");
  2985. return alink.setAttribute("href", "javascript:void(0);"), alink.innerHTML = "<i class='layui-icon layui-icon-next'></i>",
  2986. sideButtonPanel.appendChild(alink), alink.onclick = function() {
  2987. var b = $("#" + sideBarId), m = $("#" + centerPanelId);
  2988. b.is(":hidden") ? (m.removeClass("layui-col-md12"), m.addClass("layui-col-md9"),
  2989. b.show(), alink.innerHTML = "<i class='layui-icon layui-icon-next'></i>") : (b.hide(),
  2990. m.removeClass("layui-col-md9"), m.addClass("layui-col-md12"), alink.innerHTML = "<i class='layui-icon layui-icon-prev'></i>");
  2991. }, sideButtonPanel;
  2992. }();
  2993. centerPanel.appendChild(sideBtnPanel);
  2994. }
  2995. if (centerPanel.appendChild(centerContainerPanel), opts.title && "" != opts.title) {
  2996. var gridTitleDiv = document.createElement("div");
  2997. gridTitleDiv.className = "plg-grid-title", gridTitleDiv.setAttribute("id", gridTitleId),
  2998. gridTitleDiv.innerHTML = opts.title, centerContainerPanel.appendChild(gridTitleDiv);
  2999. }
  3000. if (opts.toolbar && 0 < opts.toolbar.length) {
  3001. var toolBarDiv = document.createElement("div");
  3002. toolBarDiv.setAttribute("id", toolBarId), toolBarDiv.className = "plg-toolbar",
  3003. centerContainerPanel.appendChild(toolBarDiv), function(toolBarId, items) {
  3004. toolBarForm = new PlgForm({
  3005. renderer: toolBarId,
  3006. items: items
  3007. }), $("#" + toolBarId).addClass("plg-toolbar");
  3008. }(toolBarId, opts.toolbar);
  3009. }
  3010. var gridDiv = document.createElement("div");
  3011. gridDiv.setAttribute("id", gridId), gridDiv.className = "plg-grid", gridDiv.classList.add("plg-gridExpand"),
  3012. opts.fixedLast && gridDiv.classList.add("fixed-right");
  3013. if (centerContainerPanel.appendChild(gridDiv), function(id) {
  3014. mygrid = new dhtmlXGridObject(id);
  3015. var cdata, Items, newObj, imp = opts.imagePath || Prolog.GridImageBasePath;
  3016. imp && 0 < imp.length && (imp = "/" != imp.substr(imp.length - 1, 1) ? imp + "/" : imp,
  3017. mygrid.setImagePath(imp)), cdata = opts.isI18n && 0 < opts.columns.length ? (Items = opts.columns,
  3018. newObj = [], Items.map(function(item, index) {
  3019. return newObj[index] = {}, newObj[index] = Object.assign(item, newObj[index]), newObj[index] = JSON.stringify(newObj[index]),
  3020. newObj[index] = JSON.parse(newObj[index]), item.name && i18next.exists(item.name.toString()) && (newObj[index].name = i18next.t(item.name)),
  3021. newObj;
  3022. }), newObj) : opts.columns.slice(0), columnArray = new Array(), headerArray = new Array(),
  3023. hidenArray = new Array();
  3024. var widthArray = new Array(), alignArray = new Array(), headerAlignArray = new Array(), typeArray = new Array(), typeArray = new Array(), sortArray = new Array();
  3025. columnArray.push("chbx000"), headerArray.push("<a href='javascript:void(0);' class='plg-grid-first-col'><i class='layui-icon layui-icon-component'></i></a>"),
  3026. headerAlignArray.push("text-align:center"), widthArray.push("35"), alignArray.push("center"),
  3027. typeArray.push("ro"), sortArray.push("int"), hidenArray.push(!1), opts.expandRow && (columnArray.push("exp"),
  3028. headerArray.push(""), headerAlignArray.push("text-align:center"), widthArray.push("28"),
  3029. alignArray.push("left"), typeArray.push("ro"), sortArray.push("na"), hidenArray.push(!1)),
  3030. opts.multiselect && (columnArray.push("chbx001"), headerArray.push('<img src="' + mygrid._imgURL + 'dhxgrid_web/item_chk0.gif" class="plg-grid-second-col" title="">'),
  3031. headerAlignArray.push("text-align:center"), widthArray.push("35"), alignArray.push("center"),
  3032. typeArray.push("ch"), sortArray.push("na"), hidenArray.push(!1)), sortArray.push("str");
  3033. for (var i = 0; i < cdata.length; i++) {
  3034. columnArray.push(cdata[i].id), headerArray.push(null == cdata[i].name ? cdata[i].id : cdata[i].name),
  3035. widthArray.push(cdata[i].width ? cdata[i].width : "*"), alignArray.push(cdata[i].align ? cdata[i].align : "left");
  3036. var halign = cdata[i].headerAlign ? cdata[i].headerAlign : cdata[i].align;
  3037. if (headerAlignArray.push(null == halign ? "text-align:left" : "text-align:" + cdata[i].align),
  3038. typeArray.push(null == cdata[i].type ? "ro" : cdata[i].type), sortArray.push(null == cdata[i].sort ? "str" : cdata[i].sort),
  3039. 1 == opts.fixedLast && i == cdata.length - 1 && (fixColumn.width = cdata[i].width,
  3040. headerAlignArray.splice(headerAlignArray.length - 1, 1, "text-align:center;visibility: hidden;"),
  3041. opts.multiselect ? fixColumn.index = i + 2 : opts.expandRow && opts.multiselect ? fixColumn.index = i + 3 : fixColumn.index = i + 1),
  3042. cdata[i].hidden) {
  3043. hidenArray.push(!0);
  3044. var int = i + 1;
  3045. opts.expandRow && (int += 1), opts.multiselect && (int += 1), mygrid.setColumnHidden(int, !0);
  3046. } else hidenArray.push(!1);
  3047. }
  3048. mygrid.setColumnIds(columnArray.toString()), mygrid.setHeader(headerArray.toString(), null, headerAlignArray),
  3049. mygrid.setInitWidths(widthArray.toString()), mygrid.setColAlign(alignArray.toString()),
  3050. mygrid.setColTypes(typeArray.toString()), mygrid.setColSorting(sortArray.toString()),
  3051. opts.filters && (opts.multiselect ? mygrid.attachHeader(",," + opts.filters.toString()) : mygrid.attachHeader("," + opts.filters.toString())),
  3052. mygrid.enableMultiselect(opts.multiselect), mygrid.enableAutoHeight(!1), mygrid.enableRowsHover(!0, "plg-grid-hover"),
  3053. mygrid.opts = opts, mygrid.attachEvent("onCheck", function(rId, cInd, state) {
  3054. _this.ch_ids = state ? (_this.ch_ids.push(rId), _toConsumableArray(new Set(_this.ch_ids))) : _this.ch_ids.filter(function(item) {
  3055. return rId !== item;
  3056. });
  3057. var num = 1;
  3058. if (!opts.expandRow && opts.multiselect ? num = 1 : opts.expandRow && opts.multiselect && (num = 2),
  3059. cInd == num && opts.multiselect) {
  3060. changePageBtnStatus();
  3061. var ch = $("#" + panelId + " .plg-grid-second-col"), cstr = ch.attr("src");
  3062. return mygrid.getAllRowIds().split(",").length == mygrid.getCheckedRows(num).split(",").length ? ch.attr("src", cstr.replaceAll("chk0", "chk1")) : ch.attr("src", cstr.replaceAll("chk1", "chk0")),
  3063. !0;
  3064. }
  3065. return !0;
  3066. }), mygrid.attachEvent("onAfterSorting", function(index, type, direction) {
  3067. return resetSize(), !0;
  3068. }), mygrid.attachEvent("onResizeEnd", function(index, type, direction) {
  3069. return resetSize(), !0;
  3070. }), opts.expandRow && mygrid.attachEvent("onRowSelect", function(id, ind) {
  3071. if (isNaN(id) || (id = id.toString()), !(-1 < id.indexOf("exp-"))) return 1 == ind && (_this.expandedRowsChange(createEXPID(id), id, $(mygrid.cell.children).hasClass("plg-table-row-collapsed")),
  3072. $(mygrid.cell.children).hasClass("plg-table-row-collapsed") ? _this.checkExpandColumn(id, !0) : _this.checkExpandColumn(id, !1)),
  3073. !0;
  3074. }), mygrid.attachEvent("onHeaderClick", function(ind, obj) {
  3075. var num = 1;
  3076. if (!opts.expandRow && opts.multiselect ? num = 1 : opts.expandRow && opts.multiselect && (num = 2),
  3077. 0 == ind) return function(selector) {
  3078. var html = '<div class="layui-form plg-clsset-form" >', k = 1;
  3079. opts.expandRow && (k += 1), opts.multiselect && (k += 1);
  3080. for (var i = k; i < columnArray.length; i++) html += '<div class="layui-form-item plg-clsset-item"><input type="checkbox" lay-filter="plgclssetitem" index=' + i + ' name="' + columnArray[i] + '" lay-skin="primary" title="' + headerArray[i] + '" ' + (hidenArray[i] ? "" : "checked") + "></div>";
  3081. html += '<div style="clear:both;margin:0px;height:1px;">&nbsp;</div>', html += "</div>",
  3082. PlgDialog.tips(html, selector, {
  3083. tips: [ 3, "#fff" ],
  3084. time: 0,
  3085. shade: .001,
  3086. shadeClose: !0,
  3087. success: function(layero, ind) {
  3088. $(layero).find(".layui-layer-TipsG").remove(), layui.form.render("checkbox"), layui.form.on("checkbox(plgclssetitem)", function(data) {
  3089. var ind = $(data.elem).attr("index");
  3090. data.elem.checked ? (mygrid.setColumnHidden(ind, !1), hidenArray[ind] = !1) : (mygrid.setColumnHidden(ind, !0),
  3091. hidenArray[ind] = !0), resetSize();
  3092. });
  3093. }
  3094. });
  3095. }("#" + panelId + " .plg-grid-first-col i"), !1;
  3096. if (ind != num) return !1;
  3097. if (opts.multiselect) {
  3098. var ch = $("#" + panelId + " .plg-grid-second-col"), cstr = ch.attr("src");
  3099. -1 < cstr.indexOf("chk0") ? (checkAll(!0), _this.ch_ids = _this.getCheckedRows(0).split(","),
  3100. ch.attr("src", cstr.replaceAll("chk0", "chk1"))) : (checkAll(!(_this.ch_ids = [])),
  3101. ch.attr("src", cstr.replaceAll("chk1", "chk0"))), event.stopPropagation();
  3102. }
  3103. return !1;
  3104. }), mygrid.init();
  3105. }(gridId), function() {
  3106. if (null != opts.formData) {
  3107. gridForm = new PlgForm({
  3108. items: opts.formData
  3109. }), formDisableFields = new Array();
  3110. for (var i = 0; i < opts.formData.length; i++) setEditable(opts.formData[i]);
  3111. }
  3112. }(), opts.pagebar || opts.page) {
  3113. var pageBarPanel = document.createElement("div");
  3114. if (pageBarPanel.className = "plg-grid-pagebar", pageBarPanel.setAttribute("id", pageBarPanelId),
  3115. centerContainerPanel.appendChild(pageBarPanel), opts.pagebar && opts.pagebar.buttons && 0 < opts.pagebar.buttons.length && function(parentEl) {
  3116. if (opts.pagebar && opts.pagebar.buttons && 0 < opts.pagebar.buttons.length) {
  3117. var pdiv = document.createElement("div");
  3118. pdiv.className = "div-pagebtn disable";
  3119. var infodiv = document.createElement("div");
  3120. infodiv.className = "div-pagebtn-info", infodiv.innerHTML = '<i class="layui-icon layui-icon-about"></i>已选择&nbsp;<span class="selectedCount">0</span>&nbsp;项',
  3121. pdiv.appendChild(infodiv);
  3122. for (var i = 0; i < opts.pagebar.buttons.length; i++) {
  3123. var bop = opts.pagebar.buttons[i], btn = document.createElement("button");
  3124. btn.className = "layui-btn pagebar-button layui-btn-disabled " + (null != bop.className ? bop.className : ""),
  3125. btn.innerHTML = bop.text, bop.name && btn.setAttribute("name", bop.name), pdiv.appendChild(btn);
  3126. }
  3127. parentEl.appendChild(pdiv);
  3128. }
  3129. }(pageBarPanel), opts.page) {
  3130. var pageBarDiv = document.createElement("div");
  3131. pageBarDiv.setAttribute("id", pageBarId), pageBarDiv.className = "div-pagebar",
  3132. pageBarPanel.appendChild(pageBarDiv);
  3133. }
  3134. }
  3135. if (opts.enableSideBar && null != !opts.sideBar) {
  3136. centerPanel.className = "center-panel layui-col-md9";
  3137. var sidePanel = function(sideBarId, sideBarFormId) {
  3138. var sidePanel = document.createElement("div");
  3139. sidePanel.className = "layui-col-md3 plg-grid-sidebar", sidePanel.setAttribute("id", sideBarId);
  3140. var sideContainerPanel = document.createElement("div");
  3141. return sideContainerPanel.setAttribute("id", sideBarFormId), sideContainerPanel.className = "plg-grid-sidebarform",
  3142. sidePanel.appendChild(sideContainerPanel), sidePanel;
  3143. }(sideBarId, sideBarFormId);
  3144. panel.appendChild(sidePanel), function(sideBarId, items) {
  3145. sideBarForm = new PlgForm({
  3146. renderer: sideBarId,
  3147. items: items
  3148. });
  3149. }(sideBarFormId, opts.sideBar);
  3150. }
  3151. }(containerId), function() {
  3152. for (var key in mygrid.entBox.onselectstart = null, mygrid) if (-1 === key.indexOf("_") && "function" == typeof mygrid[key] && !self[key]) {
  3153. var objm = mygrid[key];
  3154. self[key] = objm.bind(mygrid);
  3155. }
  3156. }(), $("#" + containerId).addClass("grid-container-full"), $(_this.getElement()).resize(function() {});
  3157. }
  3158. function changePageBtnStatus() {
  3159. var ch = mygrid.getCheckedRows(1), pl = $("#" + pageBarPanelId + " .div-pagebtn"), len = null != ch && "" != ch ? ch.split(",").length : 0;
  3160. pl.find(".selectedCount").text(len), null != ch && "" != ch ? pl.hasClass("disable") && (pl.removeClass("disable"),
  3161. pl.find("button").removeClass("layui-btn-disabled")) : pl.hasClass("disable") || (pl.addClass("disable"),
  3162. pl.find("button").addClass("layui-btn-disabled"));
  3163. }
  3164. function setEditable(opt) {
  3165. if (null != opt.editable && 0 == opt.editable && formDisableFields.push(opt.name),
  3166. opt.list && 0 < opt.list.length) for (var i = 0; i < opt.list.length; i++) setEditable(opt.list[i]);
  3167. }
  3168. function pageJump(obj, first) {
  3169. pageNum = obj.curr, pageSize = obj.limit, Jumpcallback && Jumpcallback(obj, first),
  3170. first || reload();
  3171. }
  3172. function emptyFixedColumn() {
  3173. null != _this.fixdiv && _this.fixdiv.empty();
  3174. }
  3175. function checkAll(b) {
  3176. var num = 1;
  3177. !opts.expandRow && opts.multiselect ? num = 1 : opts.expandRow && opts.multiselect && (num = 2);
  3178. for (var count = mygrid.getRowsNum(), k = b ? 1 : 0, i = 0; i < count; i++) opts.expandRow && i % 2 == 1 || mygrid.cellByIndex(i, num).setValue(k);
  3179. changePageBtnStatus();
  3180. }
  3181. function loadData(data, callback) {
  3182. var close = Prolog.loading2("#" + centerPanelId);
  3183. if (opts.fixedLast && emptyFixedColumn(), opts.beforeDataLoad && opts.beforeDataLoad(opts),
  3184. data) return parseData(data), close();
  3185. if (callback && (loadDataCallback = callback), null != opts.url && "" != opts.url) {
  3186. var pp = opts.params;
  3187. if (opts.page) if ("object" == _typeof(pp)) pp[opts.pageNum] = pageNum, pp[opts.pageSize] = pageSize; else {
  3188. var ppobj = JSON.parse(pp);
  3189. ppobj[opts.pageNum] = pageNum, ppobj[opts.pageSize] = pageSize, pp = JSON.stringify(ppobj);
  3190. }
  3191. Prolog.ajax({
  3192. url: opts.url,
  3193. type: opts.type,
  3194. data: pp,
  3195. contentType: opts.contentType,
  3196. success: function(da) {
  3197. parseData(da), loadDataCallback && loadDataCallback(!0), close();
  3198. },
  3199. error: function() {
  3200. loadDataCallback && loadDataCallback(!1), close();
  3201. }
  3202. });
  3203. }
  3204. }
  3205. function reload(data, callback) {
  3206. mygrid.clearAll(), loadData(data, callback);
  3207. }
  3208. function createEXPID(id) {
  3209. return "exp-".concat(id, "-").concat(rand);
  3210. }
  3211. function parseData(da) {
  3212. if ("object" != _typeof(da) && (da = JSON.parse(da)), _this.grdbox = $(_this.getElement().querySelector(".objbox")),
  3213. null == da.success || 0 != da.success) if (da.data && "" != da.data) {
  3214. var ldata, data, arr, ids, end;
  3215. ldata = da.data.list ? da.data.list : da.data, rownum = (pageNum - 1) * pageSize + 1,
  3216. mygrid.enableColSpan(!0);
  3217. try {
  3218. var _converData = function(data) {
  3219. for (var v, gridrows = new Array(), colArray = opts.columns, i = 0; i < data.length; i++) {
  3220. var rd = data[i], row = new Array();
  3221. row.push(rownum), rownum += 1, opts.expandRow && row.push('<div class="plg-table-row-expand-icon plg-table-row-collapsed"></div>'),
  3222. opts.multiselect && row.push(0);
  3223. for (var j = 0; j < colArray.length; j++) {
  3224. var col = colArray[j].id;
  3225. colArray[j].render && (v = colArray[j].render(rd[col], rd)) ? row.push(v) : row.push(rd[col]);
  3226. }
  3227. gridrows.push({
  3228. id: rd[colArray[0].id],
  3229. data: row,
  3230. userdata: {
  3231. data: rd
  3232. }
  3233. });
  3234. }
  3235. return {
  3236. rows: gridrows
  3237. };
  3238. }(ldata);
  3239. 0 < ldata.length && opts.expandRow ? (data = _converData, arr = [], ids = [], end = Object.keys(data.rows[0].userdata.data).length + 1,
  3240. opts.multiselect && (end += 1), opts.fixedLast, data.rows.forEach(function(item, index) {
  3241. ids.push("".concat(createEXPID(item.id))), !opts.fixedLast && opts.multiselect,
  3242. arr.push(item, {
  3243. id: "".concat(createEXPID(item.id)),
  3244. data: [ "", '<div class="plg-table-expand-row" id=\''.concat(createEXPID(item.id), "'></div>") ],
  3245. userdata: {
  3246. data: {}
  3247. }
  3248. });
  3249. }), 1 + end - 1, data.rows = arr, mygrid.parse(data, "json"), ids.forEach(function(id) {
  3250. mygrid.setColspan(id, 1, mygrid.getColumnsNum() - 1), mygrid.setRowHidden(id, !0);
  3251. }), _this.getExpandIds = function() {
  3252. return ids;
  3253. }, _this.getExpandIds().forEach(function(ids) {
  3254. _this.expandedRowRender(ids);
  3255. }), _this.fixedColumn()) : mygrid.parse(_converData, "json"), function() {
  3256. var main = _this.getElement();
  3257. if (!main.parentNode.style.height) {
  3258. if (!main.offsetHeight || main.parentNode.style.display && "none" != main.parentNode.style.display) return;
  3259. main.parentNode.style.height = main.offsetHeight + "px", setTimeout(function() {}, 0);
  3260. }
  3261. }(), changePageBtnStatus();
  3262. } catch (ex) {
  3263. return void PlgDialog.msg("数据错误!");
  3264. }
  3265. if (opts.page && function(id, totalCount, curr) {
  3266. if (0 != opts.page) {
  3267. pageSize = null == pageSize ? 0 : pageSize, totalCount = null == totalCount ? 0 : totalCount,
  3268. $("#" + id).empty(), laypage = layui.laypage;
  3269. var layout = [ "count", "prev", "page", "next", "limit", "skip", "refresh" ];
  3270. opts.pagebar && "simple" == opts.pagebar.type ? layout = [ "count", "prev", "page", "next", "refresh" ] : opts.pagebar && "min" == opts.pagebar.type && (layout = [ "count", "prev", "next" ]),
  3271. laypage.render({
  3272. elem: id,
  3273. count: totalCount,
  3274. limit: pageSize,
  3275. curr: curr,
  3276. limits: [ 5, 10, 20, 30, 50, 100, 200, 500, 1e3, 2e3 ],
  3277. groups: 4,
  3278. theme: "plg",
  3279. prev: '<i class="layui-icon layui-icon-left"></i>',
  3280. next: '<i class="layui-icon layui-icon-right"></i>',
  3281. layout: layout,
  3282. jump: pageJump
  3283. });
  3284. }
  3285. }(pageBarId, da.data[opts.totalCount], pageNum), opts.multiselect) {
  3286. var ch = $("#" + panelId + " .plg-grid-second-col");
  3287. if (ch && 0 < ch.length) {
  3288. var cstr = ch.attr("src");
  3289. ch.attr("src", cstr.replaceAll("chk1", "chk0"));
  3290. }
  3291. }
  3292. resetSize();
  3293. } else PlgDialog.msg("数据为空"); else PlgDialog.alert(da.message ? da.message : "空指针异常");
  3294. }
  3295. this.fixdiv = null, this.grdbox = null, _this.t = this.t(_this.opts.isI18n), this.ch_ids = [],
  3296. _this.getPanelId = function() {
  3297. return panelId;
  3298. }, _this.expandedRowRender = function(expId) {
  3299. if ("function" == typeof opts.expandedRowRender) return opts.expandedRowRender(expId);
  3300. }, _this.getGridId = function() {
  3301. return gridId;
  3302. }, _this.getToolBarId = function() {
  3303. return toolBarId;
  3304. }, _this.getPageBarPanelId = function() {
  3305. return pageBarPanelId;
  3306. }, _this.getGridTitleId = function() {
  3307. return gridTitleId;
  3308. }, _this.getCombo = function(col_ind) {
  3309. return mygrid.getCombo(col_ind);
  3310. }, this.getSideBarForm = function() {
  3311. return sideBarForm;
  3312. }, this.attachPageBarEvent = function(callback) {
  3313. $("#" + pageBarPanelId).on("click", ".pagebar-button", function() {
  3314. var _this = $(this);
  3315. if (!_this.hasClass("layui-btn-disabled")) {
  3316. var name = _this.attr("name"), ids = mygrid.getCheckedRows(1);
  3317. callback(name, ids);
  3318. }
  3319. });
  3320. }, this.PageBarJump = function(callback) {
  3321. "function" == typeof callback && (Jumpcallback = callback);
  3322. }, this.showDialogResetBtn = null, this.showDialog = function(type, title, width, height, requestParams, isMultipleRow) {
  3323. beforeDialogOpenEvent && beforeDialogOpenEvent(type, title, width, height, requestParams);
  3324. var _this = this;
  3325. if (null != gridForm) if (1 != type || _this.getSelectedRowId()) {
  3326. var winoptions = {
  3327. title: title,
  3328. closeBtn: 1,
  3329. type: 1,
  3330. resize: !0,
  3331. tipsMore: !0,
  3332. btn: [ _this.t("保存"), _this.t("重置"), _this.t("取消") ],
  3333. btn1: function(index, layero) {
  3334. if (0 != gridForm.validate()) {
  3335. var dp, close = PlgDialog.loading2();
  3336. isMultipleRow ? (dp = new Array()).push(gridForm.getFormData()) : dp = gridForm.getFormData();
  3337. var checkoutList = [];
  3338. if (opts.formData && 1 < opts.formData.length && (opts.formData.map(function(val) {
  3339. "label" === val.type && val.list.map(function(value) {
  3340. checkoutList.push(value.name);
  3341. });
  3342. }), checkoutList = checkoutList.filter(function(val) {
  3343. return val;
  3344. })), null != requestParams.contentType && -1 < requestParams.contentType.indexOf("application/json") ? requestParams.data = JSON.stringify(dp) : requestParams.data = dp,
  3345. "function" == typeof requestParams.saveAfter) try {
  3346. if (requestParams.data = requestParams.saveAfter(gridForm, requestParams.data),
  3347. !requestParams.data) throw "saveAfter 回调没有return data";
  3348. if (void 0 === requestParams.data.id) throw "data.id 没有定义";
  3349. } catch (e) {
  3350. throw close(), new Error(e);
  3351. }
  3352. requestParams.success = function(data) {
  3353. data.success ? (_this.reload(), PlgDialog.close(index)) : data.message ? PlgDialog.alert(data.message) : PlgDialog.alert("数据返回失败"),
  3354. close();
  3355. }, Prolog.ajax(requestParams);
  3356. }
  3357. },
  3358. btn2: function(index, layero) {
  3359. return gridForm.clear(), Object.keys(gridForm.getFormData()).forEach(function(item) {
  3360. try {
  3361. gridForm.getDForm().clearNote(item), $(gridForm.getDForm().getInput(item)).parent().parent().removeClass("validate_error");
  3362. } catch (e) {}
  3363. }), "function" == typeof requestParams.resetAfter && requestParams.resetAfter(gridForm),
  3364. !1;
  3365. },
  3366. btn3: function(index, layero) {
  3367. PlgDialog.close(index);
  3368. },
  3369. area: [ width + "px", height + "px" ],
  3370. content: '<div id="' + panelId + '-win-form-1"></div>',
  3371. success: function(layero, index) {
  3372. if (gridForm.renderTo(panelId + "-win-form-1"), 1 == type) {
  3373. !function(plgform, data) {
  3374. var items = plgform.getFormData();
  3375. for (var key in items) items[key] = data[key];
  3376. plgform.setFormData(items);
  3377. }(gridForm, _this.getSelectedRowData());
  3378. for (var k = 0; k < formDisableFields.length; k++) gridForm.disableItem(formDisableFields[k]);
  3379. } else for (k = 0; k < formDisableFields.length; k++) gridForm.enableItem(formDisableFields[k]);
  3380. afterDialogOpenEvent && afterDialogOpenEvent(gridForm);
  3381. }
  3382. };
  3383. 1 == type && (winoptions.btn = [ _this.t("保存"), _this.t("取消") ], winoptions.btn2 = winoptions.btn3,
  3384. winoptions.btn3 = null), PlgDialog.open(winoptions);
  3385. } else PlgDialog.msg("请选择行!"); else PlgDialog.msg(_this.t("未设置表单"));
  3386. }, this.fixedColumn = function() {
  3387. if (opts.fixedLast) {
  3388. var ids = _this.getAllRowIds().split(","), lastW = 0, tableList = $('<div class="ul-container"><table><colgroup><col></col></colgroup><tbody></tbody></table></div>'), grdbox = _this.grdbox;
  3389. ids.forEach(function(id) {
  3390. var _tr = $("<tr>");
  3391. if (-1 == id.indexOf("exp-")) {
  3392. var ctd = _this.getCellObject(id, mygrid.getColumnsNum() - 1);
  3393. _tr.append($(ctd.cell).clone()), _this.setCellTextStyle(id, mygrid.getColumnsNum() - 1, "visibility: hidden;"),
  3394. 0 === lastW && (lastW = ctd.cell.offsetWidth);
  3395. } else _tr.append($("<td>")), _tr.hide();
  3396. _tr.attr("id", "fixe-right-" + id), tableList.find("tbody").append(_tr);
  3397. });
  3398. var grid_panel = grdbox.parent(), ghd = grid_panel.children(".xhdr");
  3399. _this.fixdiv || (_this.fixdiv = $(document.createElement("div")), _this.fixdiv.attr("id", gridId + "-fixed-panel"),
  3400. _this.fixdiv.addClass("grid-fexed-column2"), grid_panel.append(_this.fixdiv));
  3401. var headerText = ghd.find("table tr:last-child td:last-child"), headerDiv = $('<div class="header">');
  3402. return headerDiv.append(headerText.children(".hdrcell").clone()), _this.fixdiv.append(headerDiv),
  3403. _this.fixdiv.append(tableList), lastW <= 1 ? lastW = _this.fixdiv.width() : lastW += grdbox[0].offsetWidth - grdbox[0].clientWidth,
  3404. _this.grdbox.find(".obj.row20px>tbody>tr>th:last-child").width(lastW), ghd.find("tbody>tr>th:last-child").width(lastW),
  3405. tableList.find("col").width(lastW), _this.getExpandIds().forEach(function(ids) {
  3406. mygrid.setCellTextStyle(ids, 1, "padding-right:".concat(lastW, "px;padding-left:").concat(30, "px"));
  3407. }), grdbox.resize(function(event) {
  3408. var _bottom = $(this)[0].offsetHeight - $(this)[0].clientHeight, _right = grdbox[0].offsetWidth - grdbox[0].clientWidth;
  3409. ghd.width("calc(100% - ".concat(_right, "px)")), $(this)[0].scrollHeight > _this.fixdiv[0].offsetHeight ? _this.fixdiv.css("bottom", _bottom) : _this.fixdiv.css("bottom", "");
  3410. }), grdbox.resize(), grdbox.scroll(function(event) {
  3411. 0 == gscroll && tableList.scrollTop(grdbox.scrollTop());
  3412. }), grdbox.mouseover(function() {
  3413. gscroll = 0;
  3414. }), tableList.scroll(function() {
  3415. 1 == gscroll && grdbox.scrollTop(tableList.scrollTop());
  3416. }), tableList.mouseover(function() {
  3417. gscroll = 1;
  3418. }), _this;
  3419. }
  3420. }, this.expandedRowsChange = function(callback) {
  3421. "function" == typeof callback && (this.expandedRowsChange = callback);
  3422. }, this.checkExpandColumn = function(id, isExp) {
  3423. setTimeout(function() {
  3424. var _cell = _this.getCellObject("".concat(createEXPID(id)), 1).cell;
  3425. return isExp ? (mygrid.setRowHidden("".concat(createEXPID(id)), !1), mygrid.cell && mygrid.cell.children[0].setAttribute("class", "plg-table-row-expand-icon plg-table-row-expanded"),
  3426. _cell.children[0].style.height = _cell.scrollHeight + "px", opts.fixedLast && _this.fixdiv && _this.fixdiv.find("tr#fixe-right-".concat(createEXPID(id))).height(_cell.scrollHeight).show()) : (mygrid.setRowHidden("".concat(createEXPID(id)), !0),
  3427. _cell.children[0].style.height = "", opts.fixedLast && _this.fixdiv && _this.fixdiv.find("tr#fixe-right-".concat(createEXPID(id))).hide().height(""),
  3428. mygrid.cell && mygrid.cell.children[0].setAttribute("class", "plg-table-row-expand-icon plg-table-row-collapsed")),
  3429. _this.grdbox.resize(), _this;
  3430. }, 200);
  3431. }, this.getElement = function() {
  3432. return panel;
  3433. }, this.renderTo = function(id) {
  3434. return renderTo(id), this;
  3435. }, this.getGrid = function(id) {
  3436. return mygrid;
  3437. }, this.loadData = function(data, callback) {
  3438. return loadData(data, callback), this;
  3439. }, this.getParams = function() {
  3440. return opts.params;
  3441. }, this.setParams = function(params) {
  3442. opts.params = params, pageSize = params.pageSize ? params.pageSize : pageSize, pageNum = params.pageNum ? params.pageNum : pageNum;
  3443. }, this.getGridData = null, this.reload = function(data) {
  3444. _this.ch_ids = [], reload(data);
  3445. }, this.getCheckedIds = function() {
  3446. return _this.ch_ids.join(",");
  3447. }, this.getSelectedRowId = function() {
  3448. return mygrid.getSelectedRowId();
  3449. }, this.getSelectedRowData = function(name) {
  3450. var rid = mygrid.getSelectedRowId();
  3451. return name ? mygrid.getUserData(rid, "data")[name] : mygrid.getUserData(rid, "data");
  3452. }, this.getRowData = function(rowId, fields) {
  3453. if (null == fields || 0 == fields.length) return mygrid.getUserData(rowId, "data");
  3454. if (Array.isArray(fields)) {
  3455. for (var data = {}, i = 0; i < fields.length; i++) data[fields[i]] = mygrid.getUserData(rowId, "data")[fields[i]];
  3456. return data;
  3457. }
  3458. return mygrid.getUserData(rowId, "data")[fields];
  3459. }, this.setRowSelectCheck = function(rowId) {
  3460. if (opts.multiselect || rowId) {
  3461. var row = this.getCellObject(rowId, 1), img = row.cell.children[0];
  3462. -1 < img.src.indexOf("chk0") ? (img.src = img.src.replaceAll("chk0", "chk1"), row.setChecked(!0)) : (img.src = img.src.replaceAll("chk1", "chk0"),
  3463. row.setChecked(!1));
  3464. var headerCh = $("#" + panelId + " .plg-grid-second-col");
  3465. this.getAllRowIds().split(",").length == this.getCheckedRows(1).split(",").length ? headerCh.attr("src", headerCh.attr("src").replaceAll("chk0", "chk1")) : headerCh.attr("src", headerCh.attr("src").replaceAll("chk1", "chk0"));
  3466. }
  3467. }, this.getExpandIds = function() {
  3468. return [];
  3469. }, this.getSelectedCellIndex = function() {
  3470. return mygrid.getSelectedCellIndex();
  3471. }, this.getRowId = function(rowIndex) {
  3472. return mygrid.getRowId(rowIndex);
  3473. }, this.getRowIndex = function(rowId) {
  3474. return mygrid.getRowIndex(rowId);
  3475. }, this.getCellObject = function(rowId, colIndex) {
  3476. return mygrid.cells(rowId, colIndex);
  3477. }, this.getCellValue = function(rowId, colIndex) {
  3478. return mygrid.cells(rowId, colIndex).getValue();
  3479. }, this.getCellObject2 = function(rowIndex, colIndex) {
  3480. return mygrid.cells2(rowIndex, colIndex);
  3481. }, this.getCellValue2 = function(rowIndex, colIndex) {
  3482. return mygrid.cells2(rowIndex, colIndex).getValue();
  3483. }, this.setCellValue = function(rowId, colIndex, value) {
  3484. mygrid.cells(rowId, colIndex).setValue(value);
  3485. var cname = columnArray[colIndex], data = mygrid.getUserData(rowId, "data");
  3486. null != data && "" != data || (data = {}), data[cname] = value, mygrid.setUserData(rowId, "data", data);
  3487. }, this.addRow = function(rowId, row_data, index) {
  3488. var rdarray = [];
  3489. rdarray.push(mygrid.getRowsNum() + 1);
  3490. var start = 1;
  3491. opts.multiselect && (rdarray.push(0), start = 2);
  3492. for (var i = start; i < columnArray.length; i++) {
  3493. var t = row_data[columnArray[i]];
  3494. rdarray.push(t || "");
  3495. }
  3496. null != index ? mygrid.addRow(rowId, rdarray.toString(), index) : mygrid.addRow(rowId, rdarray.toString()),
  3497. mygrid.setUserData(rowId, "data", row_data), resetSize();
  3498. }, this.deleteRow = function(rid) {
  3499. mygrid.deleteRow(rid), resetSize();
  3500. }, this.getColumnsNum = function() {
  3501. return mygrid.getColumnsNum();
  3502. }, this.getColumns = function() {
  3503. return columnArray;
  3504. }, this.getColumn = function(index) {
  3505. return columnArray[index];
  3506. }, this.getHeaders = function() {
  3507. return headerArray;
  3508. }, this.getColumnHeader = function(index) {
  3509. return headerArray[index];
  3510. }, this.getGridForm = function() {
  3511. return gridForm;
  3512. }, this.getToolBarForm = function() {
  3513. return toolBarForm;
  3514. }, this.setColWidth = function(colIndex, width) {
  3515. mygrid.setColWidth(colIndex, width.toString());
  3516. }, this.setColumnColor = function(array) {
  3517. mygrid.setColumnColor(array.toString());
  3518. }, this.setColumnHidden = function(colIndex, isHidden) {
  3519. mygrid.setColumnHidden(colIndex, isHidden);
  3520. }, this.setRowHidden = function(rowId, isHidden) {
  3521. mygrid.setRowHidden(rowId, isHidden);
  3522. }, this.selectRowById = function(rowId) {
  3523. mygrid.selectRowById(rowId);
  3524. }, this.resetSize = resetSize, this.on = function(eventName, callback) {
  3525. "beforeDialogOpen" == eventName ? beforeDialogOpenEvent = callback : "afterDialogOpen" == eventName ? afterDialogOpenEvent = callback : "onAfterSorting" == eventName ? mygrid.attachEvent(eventName, function(index, type, direction) {
  3526. resetSize(), callback(index, type, direction);
  3527. }) : "onResizeEnd" == eventName ? mygrid.attachEvent(eventName, function(obj) {
  3528. resetSize(), callback(obj);
  3529. }) : "onCheck" == eventName ? mygrid.attachEvent(eventName, function(rId, cInd, state) {
  3530. 1 == cInd && opts.multiselect && changePageBtnStatus(), callback(rId, cInd, state);
  3531. }) : mygrid.attachEvent(eventName, callback);
  3532. }, this.attachEvent = this.on, this.attachToolBarEvent = function(eventName, callback) {
  3533. toolBarForm && toolBarForm.on(eventName, callback);
  3534. }, this.attachSideBarEvent = function(eventName, callback) {
  3535. sideBarForm && sideBarForm.on(eventName, callback);
  3536. }, this.splitAt = function(colIndex) {
  3537. mygrid.splitAt(colIndex);
  3538. for (var i = 0; i < hidenArray.length; i++) hidenArray[i] && mygrid.setColumnHidden(i, !0);
  3539. };
  3540. var self = this;
  3541. opts.renderer && "" != opts.renderer && renderTo(opts.renderer);
  3542. };
  3543. plgGridExpand.prototype.t = function(is) {
  3544. return this.t = is ? function(text) {
  3545. return i18next.t(text);
  3546. } : function(text) {
  3547. return text;
  3548. };
  3549. }, window.PlgGridExpand = plgGridExpand;
  3550. }(jQuery);
  3551. "use strict";
  3552. !function($, layui) {
  3553. $.fn.initPlgInputTags = function(options) {
  3554. var pg = new plgInputTags(options), id = $(this).attr("id");
  3555. return pg.renderTo(id), pg;
  3556. };
  3557. var plgInputTags = function(params) {
  3558. var classMain = {
  3559. checkboxName: "",
  3560. layFilter: "",
  3561. data: null,
  3562. dom: null,
  3563. tagsId: "tags-" + Prolog.createRandomId(),
  3564. meunPanelThis: null,
  3565. setDefaultValue: function(data) {
  3566. if (!(data && 0 < data.length)) return !1;
  3567. data.map(function(val) {
  3568. val.hasOwnProperty("checked") || (val.checked = !1);
  3569. }), this.data = data;
  3570. },
  3571. wrapTemplate: function() {
  3572. var self = this, temTemplate = "";
  3573. return temTemplate += '<div class="layui-form-item">\n <label class="layui-form-label">原始复选框</label>\n <div class="layui-input-block">',
  3574. self.data.forEach(function(val) {
  3575. temTemplate += '<input type="checkbox" \n name="'.concat(self.checkboxName, "[").concat(val.alias, ']" \n lay-skin="primary" lay-filter="').concat(self.layFilter, '" \n title="').concat(val.text, '" ').concat(val.checked ? 'checked=""' : "", ' />\n <div class="layui-unselect layui-form-checkbox ').concat(val.checked ? "layui-form-checked" : "", '" \n lay-skin="primary"><span>').concat(val.text, '</span>\n <i class="layui-icon layui-icon-ok"></i></div>\n ');
  3576. }), temTemplate += '</div>\n </div>\n <div class="layui-form-item">\n <label class="layui-form-label">已经选中</label>\n <div class="layui-input-block tags" id="'.concat(self.tagsId, '"></div>\n </div>\n ');
  3577. }
  3578. };
  3579. if (!params.checkboxName || !params.layFilter) return !1;
  3580. classMain.checkboxName = params.checkboxName, classMain.setDefaultValue(params.data),
  3581. this.tagsId = classMain.tagsId, this.layFilter = classMain.layFilter = params.layFilter || "plg-" + Prolog.createRandomId(),
  3582. this.wrapTamplate = $(classMain.wrapTemplate()), params.renderer && this.renderTo(params.renderer);
  3583. };
  3584. plgInputTags.prototype.renderTo = function(targetId) {
  3585. var self = this, $targetId = $("#" + targetId);
  3586. $targetId.find("#" + self.tagsId);
  3587. $targetId.append(self.wrapTamplate);
  3588. var form = layui.form;
  3589. form.render();
  3590. var tagList = [], inputTags = {
  3591. init: function() {
  3592. var temObj = {}, checkboxList = $targetId.find(".layui-form-checked");
  3593. checkboxList.length && (temObj = {
  3594. value: checkboxList.siblings("input").attr("title"),
  3595. name: checkboxList.siblings("input").attr("name")
  3596. }), "{}" !== JSON.stringify(temObj) && (tagList.push(temObj), tagList.forEach(function(v) {
  3597. inputTags.add(v);
  3598. }));
  3599. },
  3600. add: function(temObj) {
  3601. var temTempalte = '<span>\n <em name="'.concat(temObj.name, '">').concat(temObj.value, '</em>\n <button type="button" class="close">×</button>\n </span>');
  3602. $("#" + self.tagsId).append(temTempalte);
  3603. var temInputHidden = '<input type="hidden" name="'.concat(temObj.name, '" \n value="').concat(temObj.value, '"/>');
  3604. $targetId.after(temInputHidden), -1 === tagList.indexOf(temObj) && tagList.push(temObj);
  3605. },
  3606. del: function(temObj) {
  3607. tagList && 0 < tagList.length && tagList.forEach(function(val, ind) {
  3608. val.name === temObj.name && tagList.splice(ind, 1);
  3609. }), $("#" + self.tagsId).empty();
  3610. var temTempalte = "";
  3611. tagList && 0 < tagList.length && tagList.forEach(function(val, ind) {
  3612. temTempalte += '<span><em name="'.concat(val.name, '">').concat(val.value, '</em><button type="button" class="close">×</button></span>');
  3613. }), $("#" + self.tagsId).append(temTempalte), $("#" + self.targetId).find('input[name="' + temObj.name + '"]').remove();
  3614. }
  3615. };
  3616. inputTags.init(), form.on("checkbox(" + self.layFilter + ")", function(data) {
  3617. var isChecked = data.elem.checked, jqueryElem = $(data.elem), temObj = {
  3618. value: jqueryElem.attr("title"),
  3619. name: jqueryElem.attr("name")
  3620. };
  3621. isChecked && inputTags.add(temObj), isChecked || inputTags.del(temObj);
  3622. }), $targetId.find("#" + self.tagsId).on("click", ".close", function(e) {
  3623. var temJqueryObj = $(this).siblings("em"), temObj = {
  3624. value: temJqueryObj.html(),
  3625. name: temJqueryObj.attr("name")
  3626. };
  3627. inputTags.del(temObj);
  3628. var checkedList = self.wrapTamplate.find(".layui-form-checkbox");
  3629. (checkedList = Array.prototype.slice.call(checkedList)) && 0 < checkedList.length && checkedList.forEach(function(val, ind) {
  3630. var temHtml = $($(val).find("span")[0]).html();
  3631. temObj.value === temHtml && self.wrapTamplate.find(".layui-form-checkbox").eq(ind).trigger("click");
  3632. });
  3633. });
  3634. }, window.PlgInputTags = plgInputTags;
  3635. }(jQuery, layui);
  3636. "use strict";
  3637. function _typeof(obj) {
  3638. return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  3639. return typeof obj;
  3640. } : function(obj) {
  3641. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  3642. })(obj);
  3643. }
  3644. !function($) {
  3645. var PlgMenu = function(options) {
  3646. var _this = this;
  3647. _this.options = options, _this.getActiveId = function() {
  3648. return vipspa.indexid;
  3649. }, this.fold = !1, this.selectedKeys = "", this.submenuElement = null;
  3650. var config = {
  3651. xScroll: !(this.openMenuId = []),
  3652. folding: !(this.openKey = ""),
  3653. defaultOpenMenuId: [],
  3654. options: "",
  3655. inlineIndent: 24,
  3656. data: null,
  3657. renderer: null,
  3658. url: null,
  3659. isI18n: window.isI18n || !1,
  3660. ajaxInit: {
  3661. url: null,
  3662. type: "get",
  3663. dataType: "json"
  3664. },
  3665. route: !1,
  3666. menuClick: null,
  3667. routerConfig: null
  3668. };
  3669. _this.options = $.extend(!0, config, _this.options), _this.options.data ? _this.promiseGetDate = new Promise(function(resolve) {
  3670. resolve(parseData(_this.options.data));
  3671. }) : _this.promiseGetDate = function(params) {
  3672. var _this = this, object = Object.assign({}, params);
  3673. return new Promise(function(resolve, error) {
  3674. var close = PlgDialog.loading2(), treedata = null;
  3675. object.success = function(response) {
  3676. response.success ? (params.success && params.success(response), treedata = parseData(response.data),
  3677. _this.options.data = treedata) : layer.msg("数据加载失败!"), treedata ? resolve(treedata) : error();
  3678. }, object.error = function(XMLHttpRequest, textStatus, errorThrown) {
  3679. params.error && params.error(arguments);
  3680. }, object.complete = function() {
  3681. params.complete && params.complete(arguments), close();
  3682. }, Prolog.ajax(object);
  3683. });
  3684. }.call(this, _this.options.ajaxInit), _this.document = function(mapData, opts) {
  3685. var tpl = $("<div>", {
  3686. class: "sidebar"
  3687. });
  3688. return $().localize && tpl.localize(), tpl;
  3689. }.call(_this), _this.init(_this.document);
  3690. };
  3691. PlgMenu.prototype.init = function(document) {
  3692. var _this = this;
  3693. return function() {
  3694. var _this = this, project_name = $(".plg-layout-sider"), plg_anticon = $('<i id="plg-logo-fold" class="plg_anticon layui-icon layui-icon-shrink-right"></i>');
  3695. project_name && (project_name.append(plg_anticon), plg_anticon.click(function(event) {
  3696. event.preventDefault(), _this.fold = !_this.fold, $("body").toggleClass("fold"),
  3697. $(".plg-menu-toolbar").toggle(), _this.fold ? $(this).removeClass("layui-icon-shrink-right").addClass("layui-icon-spread-left") : $(this).removeClass("layui-icon-spread-left").addClass("layui-icon-shrink-right"),
  3698. _this.promiseGetDate.then(function(data) {});
  3699. }));
  3700. }.call(this), this.promiseGetDate.then(function(treedata) {
  3701. if (_this.reset(treedata), _this.options.defaultSelectedMenuId) if (_this.options.route) {
  3702. var _data = treedata[_this.options.defaultSelectedMenuId], _hase = function() {
  3703. return location.hash.replace(/^#/, "");
  3704. };
  3705. if (_hase = _hase(), location.hash = _data.hash, _hase == _data.hash) return location.href = "";
  3706. if (!_hase && _hase == _data.hash) return;
  3707. setTimeout(function() {
  3708. location.hash = _hase;
  3709. }, 200);
  3710. } else _this.setActiveMenuItem(_this.options.defaultSelectedMenuId);
  3711. }), _this.options.renderer && _this.renderTo(_this.options.renderer), _this;
  3712. }, PlgMenu.prototype.updateMenu = function(newValue) {
  3713. var isI18n = this.options.isI18n, inlineIndent = this.options.inlineIndent, _mapArr = Object.values(newValue);
  3714. return $('<div class="plg-menu-scroll">').append(function dg(id, arry) {
  3715. var _ul = $("<ul>", {
  3716. class: "0" == id ? "plg-menu" : "plg-menu plg-menu-sub"
  3717. });
  3718. "0" !== id && _ul.hide();
  3719. var childArry = function(id, arry) {
  3720. var newArry = new Array();
  3721. for (var i in arry) arry[i].parentMenuId == id && newArry.push(arry[i]);
  3722. return newArry;
  3723. }(id, arry);
  3724. return 0 < childArry.length && childArry.forEach(function(item) {
  3725. var _li = $('<li class="'.concat(item.leaf ? "plg-menu-item" : "plg-menu-submenu", " ").concat(item.isActive && item.leaf ? "plg-menu-item-selected" : "", " ").concat(item.isActive && !item.leaf ? "ant-menu-submenu-open" : "", '"></li>')), title_div = $('<div class="plg-menu-submenu-title"></div>'), icon = $('<span class="icon-box"><i class="'.concat(item.imagePath, '"></i></span>')), right = $('<i class="right-mover layui-icon layui-icon-down" style="right: 0.28rem;"></i>'), _a = $('<a class="itemText" href="'.concat(item.blank ? item.path : item.hash && item.leaf ? "#" + item.hash : "javascript:;", '" ').concat(item.blank ? "target=_blank" : "", " ").concat(isI18n && i18next.exists(item.name.toString()) ? 'data-i18n="'.concat(item.name, '"') : "", " menu-id=").concat(item.menuId, ">").concat(item.name, "</a>"));
  3726. item.leaf && "0" == id ? _li.append(icon).append(_a).css("padding-left", inlineIndent * item.level / 100 + "rem") : item.leaf || "0" == id ? item.leaf || "0" != id ? item.leaf && "0" != id && _li.append(_a).css("padding-left", inlineIndent * item.level / 100 + "rem") : (title_div.append(icon).css("padding-left", inlineIndent * item.level / 100 + "rem"),
  3727. _a.append(right), title_div.append(_a), _li.append(title_div)) : (title_div.append(_a).append(right).css("padding-left", inlineIndent * item.level / 100 + "rem"),
  3728. _li.append(title_div)), item.leaf || _li.append(dg(item.menuId, arry)), _ul.append(_li);
  3729. }), _ul;
  3730. }("0", _mapArr));
  3731. };
  3732. var defWidth = null;
  3733. function setWidth(ele) {
  3734. var _this = this;
  3735. (document.querySelector(".plg-menu-scroll").scrollWidth < defWidth || ele.is(".plg-menu-submenu-open")) && (_this.document.find("li").css({
  3736. width: ""
  3737. }), _this.document.find("ul").css({
  3738. width: ""
  3739. })), setTimeout(function() {
  3740. var width = document.querySelector(".plg-menu-scroll").scrollWidth;
  3741. defWidth || (defWidth = width), _this.document.find("li").css({
  3742. width: width + "px"
  3743. }), _this.document.find("ul").css({
  3744. width: width + "px"
  3745. });
  3746. }, 300);
  3747. }
  3748. function parseData(da) {
  3749. var routeSetting = {}, treedata = function(data) {
  3750. data.forEach(function(item, index) {
  3751. delete item.children, delete item.type, delete item.queryId, delete item.operateType,
  3752. delete item.lastModifyTime, delete item.helpCode, delete item.creatorName, delete item.creatorId,
  3753. delete item.createTime, delete item.modifierId, delete item.modifierName, delete item.sort;
  3754. });
  3755. var map = {};
  3756. return data.forEach(function(item) {
  3757. map[item.menuId] = item;
  3758. }), {
  3759. mapData: map
  3760. };
  3761. }(da);
  3762. return da.forEach(function(item) {
  3763. if (!item.blank && (item.PY_code = pinyin.makePy(item.name)[0], item.leaf && item.path)) {
  3764. if (!item.hash) {
  3765. var index = item.path.indexOf("?");
  3766. item.hash = item.path, -1 < index && (item.hash = item.path.substr(0, index - 1)),
  3767. item.hash = item.hash.substr(1).split("/"), item.hash = item.hash[item.hash.length - 2] + "/" + item.hash[item.hash.length - 1],
  3768. -1 != item.hash.indexOf("=") && (item.hash = item.hash.match("([^=]+)$")[0]);
  3769. }
  3770. var obj = function resultName(mid) {
  3771. var arr = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : [];
  3772. var idarr = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : [];
  3773. var mapData = treedata.mapData;
  3774. var item = mapData[mid];
  3775. if (item && (arr.unshift(item.name), idarr.unshift(item.menuId), 0 != item.parentMenuId)) return resultName(item.parentMenuId, arr, idarr);
  3776. return {
  3777. arr: arr,
  3778. idarr: idarr
  3779. };
  3780. }(item.menuId);
  3781. item.path = function(item) {
  3782. var path = item.path, index = path.indexOf("?");
  3783. {
  3784. if (item.iframe) return path;
  3785. if (-1 < index) {
  3786. path.slice(index);
  3787. return path;
  3788. }
  3789. var hasHtml = path.indexOf(".html");
  3790. return -1 < hasHtml ? path : path + ".html";
  3791. }
  3792. }(item), -1 < index && (item.hash = item.menuId), routeSetting[item.hash] = {
  3793. templateUrl: item.path,
  3794. iframe: item.iframe || !1,
  3795. controller: item.srcPath ? item.srcPath + ".js" : null,
  3796. name: item.name,
  3797. menuId: item.menuId,
  3798. parent_name: obj.arr,
  3799. stateArr: obj.idarr
  3800. }, obj = null;
  3801. }
  3802. }), treedata.mapData;
  3803. }
  3804. PlgMenu.prototype.reset = function(newValue) {
  3805. var sidebarLi = this.updateMenu(newValue);
  3806. return this.document.empty().append(sidebarLi), function(element) {
  3807. var _this = this;
  3808. return element.find(".plg-menu-submenu-title").click(function(event) {
  3809. event.preventDefault(), event.stopPropagation(), _this.fold && (_this.fold = !1,
  3810. $("body").toggleClass("fold"), $(".plg-menu-toolbar").toggle()), _this.submenuElement = $(this),
  3811. $(this).find(".itemText").attr("menu-id"), _this.toggleOpenSubMenu($(this)), _this.options.xScroll && setWidth.call(_this, $(this).parent());
  3812. }), element.find(".plg-menu-item").click(function(event) {
  3813. event.preventDefault(), event.stopPropagation();
  3814. var mid = $(this).children(".itemText").attr("menu-id");
  3815. _this.setActiveMenuItem($(this)), mid && _this.selectedKeys == mid || _this.options.xScroll && setWidth.call(_this, $(this).parent());
  3816. }), element;
  3817. }.call(this, sidebarLi), this;
  3818. }, PlgMenu.prototype.setActiveMenuItem = function(key) {
  3819. var $jq, isCB = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], _this = this;
  3820. this.promiseGetDate.then(function() {
  3821. var mid = ($jq = "object" === _typeof(key) ? key : _this.document.find(".itemText[menu-id='".concat(key, "']")).parent()).children(".itemText").attr("menu-id");
  3822. if (_this.selectedKeys != mid) {
  3823. _this.selectedKeys = mid;
  3824. var _data = _this.options.data[_this.selectedKeys];
  3825. if (_data) {
  3826. if (_this.document.find(".plg-menu-item-selected").removeClass("plg-menu-item-selected"),
  3827. $jq.addClass("plg-menu-item-selected"), _this.document.find(".plg-menu-submenu").removeClass("plg-menu-submenu-selected"),
  3828. $jq.parents(".plg-menu-submenu").addClass("plg-menu-submenu-selected"), _data.blank) return window.open(_data.path);
  3829. isCB && _this.leafClick(_this.selectedKeys, _data, $jq);
  3830. }
  3831. }
  3832. });
  3833. }, PlgMenu.prototype.activeItemOpenSubMenu = function(mid) {
  3834. var isCB = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], _this = this;
  3835. if (!_this.options.data[mid]) return this.selectedKeys = mid, _this.document.find(".plg-menu-item-selected").removeClass("plg-menu-item-selected");
  3836. if (this.selectedKeys !== mid) {
  3837. _this.options.data[mid].leaf && this.setActiveMenuItem(mid, isCB);
  3838. !function getParentId(key) {
  3839. var itemData = _this.options.data[key];
  3840. if (itemData) {
  3841. var isOpen = _this.document.find(".itemText[menu-id='".concat(key, "']")).parent().parent().is(".plg-menu-submenu-open");
  3842. return !itemData.leaf && !isOpen && _this.toggleOpenSubMenu(itemData.menuId), "0" != itemData.parentMenuId ? getParentId(itemData.parentMenuId) : itemData.menuId;
  3843. }
  3844. }(_this.options.data[mid].parentMenuId);
  3845. }
  3846. }, PlgMenu.prototype.openChange = function(callback) {
  3847. return "function" == typeof callback ? this.openChange = callback : null;
  3848. }, PlgMenu.prototype.leafClick = function(callback) {
  3849. return "function" == typeof callback ? this.leafClick = callback : null;
  3850. }, PlgMenu.prototype.toggleOpenSubMenu = function(key) {
  3851. var _this = this;
  3852. this.promiseGetDate.then(function() {
  3853. var elem;
  3854. "object" === _typeof(key) ? (elem = key, _this.openKey = elem.find(".itemText").attr("menu-id")) : (_this.openKey = key,
  3855. elem = _this.document.find(".itemText[menu-id='".concat(_this.openKey, "']")).parent());
  3856. var menu_sub_ul = elem.parent().children(".plg-menu-sub"), icon = elem.find(".right-mover");
  3857. if (_this.options.folding && (_this.openMenuId = []), _this.openMenuId.push(_this.openKey),
  3858. elem.parent().is(".plg-menu-submenu-open")) _this.openMenuId.filter(function(item, index, arr) {
  3859. return item == _this.openKey && arr.splice(index, 1);
  3860. }); else if (_this.options.folding) {
  3861. var sib = elem.parents(".plg-menu-submenu").siblings().filter(".plg-menu-submenu");
  3862. sib.removeClass("plg-menu-submenu-open"), sib.children(".plg-menu-sub").slideUp(200),
  3863. sib.find(".right-mover").removeClass("layui-icon-up").addClass("layui-icon-down");
  3864. }
  3865. return elem.parent().toggleClass("plg-menu-submenu-open"), elem.parent().is(".plg-menu-submenu-open") ? (menu_sub_ul.slideDown(200),
  3866. icon.removeClass("layui-icon-down").addClass("layui-icon-up")) : (elem.parent().show(),
  3867. menu_sub_ul.slideUp(200), icon.removeClass("layui-icon-up").addClass("layui-icon-down")),
  3868. _this.openChange(_this.openKey, _this.openMenuId, elem), _this.submenuElement = null,
  3869. _this;
  3870. });
  3871. }, PlgMenu.prototype.renderTo = function(domId) {
  3872. this.options.renderer = domId, $("#" + this.options.renderer).addClass("plg-menu-sidebar").empty().append(this.document);
  3873. return this;
  3874. }, window.PlgMenu = PlgMenu, $.fn.initPlgMenu = function(options) {
  3875. return new PlgMenu(this, options);
  3876. };
  3877. }(jQuery);
  3878. "use strict";
  3879. !function($) {
  3880. var PlgMenuToolbar = function(options) {
  3881. var _this = this;
  3882. _this.options = options;
  3883. var config = {
  3884. isI18n: window.isI18n || !1,
  3885. title: "常用功能",
  3886. ajaxInit: {
  3887. url: null,
  3888. type: "get",
  3889. dataType: "json"
  3890. },
  3891. click: null
  3892. };
  3893. _this.options = $.extend(!0, config, _this.options), _this.options.data ? _this.promiseGetDate = new Promise(function(resolve) {
  3894. resolve(_this.options.data);
  3895. }) : _this.promiseGetDate = function(object) {
  3896. var _this = this;
  3897. return new Promise(function(resolve, error) {
  3898. var close = PlgDialog.loading2();
  3899. object.success = function(response) {
  3900. response.success ? (_this.options.data = response.data, resolve(_this.options.data)) : (layer.msg("数据加载失败!"),
  3901. error());
  3902. }, object.error = function(XMLHttpRequest, textStatus, errorThrown) {}, object.complete = function() {
  3903. close();
  3904. }, Prolog.ajax(object);
  3905. });
  3906. }.call(this, _this.options.ajaxInit), _this.document = $("<div>", {
  3907. class: "tool-main"
  3908. }), _this.init(_this.document);
  3909. };
  3910. PlgMenuToolbar.prototype.init = function() {
  3911. this.reset(), this.options.renderer && this.renderTo(this.options.renderer);
  3912. }, PlgMenuToolbar.prototype.renderTo = function(domId) {
  3913. this.options.renderer = domId;
  3914. var titleObj = $("<div>", {
  3915. class: "plg-menu-toolbar-title",
  3916. text: this.options.title
  3917. });
  3918. return this.document.append(titleObj), $("#" + this.options.renderer).addClass("plg-menu-toolbar").empty().append(this.document),
  3919. this;
  3920. }, PlgMenuToolbar.prototype.reset = function(newData) {
  3921. var _this = this;
  3922. this.promiseGetDate.then(function(data) {
  3923. newData && (newData, _this.options.data = newData);
  3924. var sidebarLi = function(data) {
  3925. if (!data) return;
  3926. var wrapper, body = $('<div class="plg-menu-toolbar-body">\n <div class="layui-carousel" >\n <div carousel-item>\n </div>\n </div>\n\n </div>'), carouselItem = body.find("div[carousel-item]");
  3927. return data.forEach(function(item, index) {
  3928. if (!(12 <= index)) {
  3929. index / 6 % 1 == 0 && (wrapper = $("<div>", {
  3930. class: "wrapper"
  3931. }), carouselItem.append($("<div>").append(wrapper)));
  3932. var list = $('\n <a class="list" href="javascript:;" menu-id="'.concat(item.menuId, '" >\n <div class="p_icon">\n ').concat(item.imagePath ? '<i class="'.concat(item.imagePath, '"></i>') : '<i style="font-size:0.18rem">'.concat(item.name[0], "</i>"), '\n </div>\n <span class="name">').concat(item.name, "</span>\n </a>"));
  3933. wrapper.append(list);
  3934. }
  3935. }), layui.carousel.render({
  3936. elem: carouselItem.parent(),
  3937. width: "100%",
  3938. height: "2.16rem",
  3939. arrow: "none",
  3940. autoplay: !1
  3941. }), body;
  3942. }(_this.options.data);
  3943. _this.document.append(sidebarLi), function(element) {
  3944. var _this = this;
  3945. element.find(".wrapper .list").click(function(event) {
  3946. event.preventDefault(), event.stopPropagation();
  3947. var mid = $(this).attr("menu-id"), _data = _this.options.data.find(function(item) {
  3948. return item.menuId === mid;
  3949. });
  3950. "function" == typeof _this.options.click && _this.options.click(mid, _data, $(this));
  3951. });
  3952. }.call(_this, sidebarLi);
  3953. });
  3954. }, window.PlgMenuToolbar = PlgMenuToolbar, $.fn.initPlgMenuToolbar = function(options) {
  3955. return new PlgMenuToolbar(this, options);
  3956. };
  3957. }(jQuery);
  3958. "use strict";
  3959. function _typeof(obj) {
  3960. return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  3961. return typeof obj;
  3962. } : function(obj) {
  3963. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  3964. })(obj);
  3965. }
  3966. !function($, layui) {
  3967. layui.use([ "element" ], function() {
  3968. function template() {
  3969. var skinOBJ = {
  3970. 0: "",
  3971. 1: "skin_1",
  3972. 2: "skin_2"
  3973. };
  3974. skinOBJ[this.skin] || (this.skin = 0);
  3975. var html = '<div class="layui-card PlgPanel '.concat(skinOBJ[this.skin], " ").concat(this.className ? this.className : "", '" id=').concat(this.getPanelId(), " ").concat(this.style ? 'style="'.concat(this.style, '"') : "", ">\n ").concat(this.header.isShow ? '<div class="layui-card-header">\n <div class="title io">'.concat(this.header.title, "</div>\n ").concat(this.header.moreBtn && 0 < this.header.moreBtn.length ? '<div class="more_group">\n '.concat(this.header.moreBtn.map(function(item) {
  3976. return '<a class="'.concat(item.className ? "".concat(item.className) : "", '" ').concat(item.style ? 'style="'.concat(item.style, '"') : "", ' href="javascript:;"> ').concat(item.icon ? '<i class="'.concat(item.icon, '"></i>') : "").concat(item.name, "</a>");
  3977. }).join(""), "\n </div>") : "", "\n </div>\n ") : "", '\n <div class="layui-card-body" id=').concat(this.getPanelBodyId(), ">\n\n </div>\n ").concat(this.floor ? '<div class="layui-card-floor">\n </div>' : "", "\n </div>\n ");
  3978. return $(html);
  3979. }
  3980. function PanelForm() {
  3981. if (this.defaultBody) {
  3982. var data = this.defaultBody, html = null;
  3983. if (data.layoutCol < 0 || data.layoutCol, data.cols) return html = '<form class="layui-form cl" style="padding:5px" lay-filter="">\n '.concat(data.cols.map(function(arr) {
  3984. return '<div class="layui-row layui-col-space10">\n '.concat(arr.map(function(item) {
  3985. return '<div class="layui-col-md'.concat(item.layoutCol || data.layoutCol, " ").concat(item.offset ? "layui-col-md-offset".concat(item.offset) : "", '">\n <div class="layui-form-item">\n <label class="layui-form-label">').concat(item.label, ':</label>\n <div class="layui-input-block">\n ').concat(function(item, valueBj) {
  3986. switch (item.type || (item.type = "text"), item.type) {
  3987. case "text":
  3988. var div = $("<div>", {
  3989. class: "text-info ".concat(valueBj ? "bj" : "")
  3990. });
  3991. return item.value || 0 === item.value ? div.text(item.value) : div.html("<span style='color:#c3c3c3'>暂无数据</span>"),
  3992. div[0].outerHTML;
  3993. case "input":
  3994. return item.value || 0 === item.value || (item.value = ""), $("<input>", {
  3995. type: "text",
  3996. placeholder: "请输入信息",
  3997. autocomplete: "off",
  3998. class: "layui-input",
  3999. value: item.value.toString()
  4000. })[0].outerHTML;
  4001. }
  4002. }(item, data.valueBj), "\n </div>\n </div>\n </div>");
  4003. }).join(""), "\n\n </div>");
  4004. }).join(""), "\n\n </form>"), $(html);
  4005. }
  4006. }
  4007. function plgPanel(ele, options) {
  4008. var opt, _this = this;
  4009. if (_this.Rand = Prolog.createRandomId(), 1 === arguments.length) {
  4010. if ("object" === _typeof(opt = arguments[0])) {
  4011. var config = {
  4012. renderer: "",
  4013. className: "",
  4014. style: "",
  4015. skin: 0,
  4016. title: "",
  4017. empyt: !0,
  4018. fromData: null,
  4019. header: {
  4020. isShow: !0,
  4021. title: "",
  4022. moreBtn: null
  4023. },
  4024. grid: null,
  4025. defaultBody: null,
  4026. page: !1,
  4027. floor: !0,
  4028. totalCount: "totalCount",
  4029. pageNum: "pageNum",
  4030. pageSize: "pageSize",
  4031. params: {
  4032. pageSize: 10,
  4033. pageNum: 1
  4034. },
  4035. pageType: "simple",
  4036. url: null,
  4037. type: "get",
  4038. contentType: "application/x-www-form-urlencoded",
  4039. success: null,
  4040. listFormData: [],
  4041. toolbar: [],
  4042. columns: null
  4043. };
  4044. (_this = Object.assign(_this, config, opt)).params = "[object Object]" === Object.prototype.toString.call(opt.params) ? Object.assign(config.params, opt.params) : config.params,
  4045. _this.getElement = template.call(_this), _this.header.moreBtn && 0 < _this.header.moreBtn.length && _this.getElement.find(".more_group>a").each(function(index, element) {
  4046. element.onclick = _this.header.moreBtn[index].onClick;
  4047. }), null != _this.defaultBody && (_this.defaultBody.cols && 0 < _this.defaultBody.cols.length ? _this.appendPanelBody(PanelForm.call(_this)) : $(_this.defaultBody)[0] instanceof HTMLElement && _this.appendPanelBody(_this.defaultBody)),
  4048. _this.renderBefore(), _this.renderTo(_this.renderer);
  4049. }
  4050. } else 2 === arguments.length && (ele = arguments[0], "object" === _typeof(opt = options) && (_this.opts = $.extend(!0, config, opt),
  4051. _this.getElement = template(_this.opts), _this.renderTo(ele)));
  4052. }
  4053. plgPanel.prototype.renderBefore = function(callback) {
  4054. return "function" != typeof callback ? null : (this.renderBefore = callback, this.renderBefore(),
  4055. this);
  4056. }, plgPanel.prototype.setPages = function() {
  4057. var self = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : this, floor = self.getElement.find(".layui-card-floor");
  4058. if (!self.page) return floor.empty();
  4059. var pageSize = null == self.params.pageSize ? 0 : self.params.pageSize, totalCount = null == self.totalCount ? 0 : self.totalCount, curr = null == self.params.pageNum ? 0 : self.params.pageNum;
  4060. floor.empty();
  4061. var laypage = layui.laypage, layout = [ "count", "prev", "page", "next", "limit", "skip", "refresh" ];
  4062. "simple" == self.pageType ? layout = [ "count", "prev", "page", "next", "refresh" ] : "min" == self.pageType && (layout = [ "count", "prev", "next" ]),
  4063. laypage.render({
  4064. elem: floor,
  4065. count: totalCount,
  4066. limit: pageSize,
  4067. curr: curr,
  4068. limits: [ 5, 10, 20, 30, 50, 100, 200, 500 ],
  4069. groups: 4,
  4070. theme: "plg",
  4071. prev: '<i class="layui-icon layui-icon-left"></i>',
  4072. next: '<i class="layui-icon layui-icon-right"></i>',
  4073. layout: layout,
  4074. jump: function(obj, first) {
  4075. this.params.pageNum = obj.curr, this.params.pageSize = obj.limit, first || this.getListForm && this.listReload();
  4076. }.bind(self)
  4077. });
  4078. }, plgPanel.prototype.renderTo = function(ele) {
  4079. if (!ele) return this;
  4080. if ("string" == typeof ele && (ele = -1 < ele.indexOf(".") ? ele : "#" + ele), this.renderer = ele,
  4081. this.empyt && $(ele).empty(), $(ele).append(this.getElement), this.grid) {
  4082. var odiv = document.createElement("div");
  4083. odiv.id = "panel-grid-" + this.Rand, this.appendPanelBody(odiv), this.grid = new PlgGrid({
  4084. fixedLast: !0,
  4085. multiselect: !0,
  4086. toolbar: this.toolbar,
  4087. columns: this.columns || [],
  4088. url: this.url,
  4089. type: this.type,
  4090. params: this.params,
  4091. page: this.page,
  4092. totalCount: this.totalCount
  4093. }), this.grid.loadData(), this.grid.renderTo(odiv.id);
  4094. } else this.toolbarReload(), this.listReload();
  4095. return this;
  4096. }, plgPanel.prototype.getGrid = function() {
  4097. return this.grid;
  4098. }, plgPanel.prototype.toolbarReload = function() {
  4099. if (!(Array.isArray(this.toolbar) && 0 < this.toolbar.length)) return null;
  4100. var odiv = document.createElement("div");
  4101. return odiv.id = "toolbar-" + this.Rand, this.appendPanelBody(odiv), this.getToolbar = new PlgForm({
  4102. renderer: odiv.id,
  4103. items: this.toolbar
  4104. }), this;
  4105. }, plgPanel.prototype.listReload = function() {
  4106. var param = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {};
  4107. if (!(Array.isArray(this.listFormData) && 0 < this.listFormData.length)) return null;
  4108. var odiv = document.createElement("div");
  4109. return odiv.id = "list-form-" + this.Rand, this.appendPanelBody(odiv), this.getListForm = new PlgForm({
  4110. renderer: odiv.id,
  4111. items: this.listFormData
  4112. }), this.url ? (function(self, param) {
  4113. var _this = self, opt = {
  4114. url: _this.url,
  4115. type: _this.type,
  4116. data: _this.params,
  4117. contentType: _this.contentType,
  4118. success: function(data) {
  4119. data.success ? (_this.params.pageSize = data.data.pageSize, _this.totalCount = data.data.totalCount,
  4120. _this.params.pageNum = data.data.pageNum, _this.done(_this, data.data), _this.setPages()) : alert(_this.url + "=>数据返回错误");
  4121. }
  4122. };
  4123. opt.data = Object.assign(opt.data, param), Prolog.ajax(opt);
  4124. }(this, param), this) : void 0;
  4125. }, plgPanel.prototype.done = function(callback) {
  4126. return "function" == typeof callback ? this.done = callback : null;
  4127. }, plgPanel.prototype.getPanelBodyId = function() {
  4128. return "PlgPanelBody-" + this.Rand;
  4129. }, plgPanel.prototype.getPanelId = function() {
  4130. return "PlgPanel-" + this.Rand;
  4131. }, plgPanel.prototype.appendPanelBody = function(ElementObjcet) {
  4132. var isEmpty = 1 < arguments.length && void 0 !== arguments[1] && arguments[1], ele = this.getElement.find(".layui-card-body");
  4133. return isEmpty && ele.empty(), ele.append(ElementObjcet), this;
  4134. }, window.PlgPanel = plgPanel;
  4135. });
  4136. }(jQuery, layui);
  4137. "use strict";
  4138. !function($) {
  4139. var plgSearch = function(options) {
  4140. var defaultOptions = {
  4141. renderer: null,
  4142. title: "所有服务",
  4143. menuData: null,
  4144. leafClick: null,
  4145. isI18n: window.isI18n || !1
  4146. };
  4147. options = Object.assign(defaultOptions, options);
  4148. for (var key in options) this[key] = options[key];
  4149. this.init(), this.renderer && this.renderTo(this.renderer);
  4150. };
  4151. function filterData(pid, Data) {
  4152. return Object.values(Data).filter(function(item) {
  4153. return item.parentMenuId == pid;
  4154. });
  4155. }
  4156. plgSearch.prototype.init = function() {
  4157. return this.vNode = [], this.vNode[0] = function() {
  4158. return $('\n <div class="product-all">\n <span class="icon-box"><i class="icon iconfont p-icon-all"></i></span>\n <span class="meun-name"> <a href="javascript:;">'.concat(this.title, '</a><i class="right-mover layui-icon layui-icon-right"></i>\n </span>\n </div>\n '));
  4159. }.call(this), this.vNode[1] = function() {
  4160. return $('<div class="pr-open">\n <div class="layui-layer-setwin"> <a class="layui-icon layui-icon-close" href="javascript:;"></a></div>\n <div class="pr-search">\n <span class="pr-icon-search-wrapper"><i class="layui-icon layui-icon-search"></i></span>\n\n <input type="text" id="selectInput" class="pr-search-input" autocomplete="off" '.concat(this.isI18n && i18next.exists("请输入关键词") ? "data-i18n=[placeholder]请输入关键词" : "placeholder='请输入关键词'", '>\n <div class="search-tip">\n <p><span>以下是与“<strong></strong>”相关的产品:</span></p></div>\n </div>\n\n \x3c!-- 左边搜索出的列表---\x3e\n <div class="pr-left">\n <div id="keyUpList" class="keyUpList"></div>\n <div id="menu-group" class="pr-meungroup-list">\n \x3c!-- 全部菜单列表---\x3e\n </div>\n </div>\n\n \x3c!-- 右边一级菜单---\x3e\n <div class="pr-right">\n <div class="scroll-nav">\n <ul id="right-search-nav" class="right-sidebar">\n \x3c!--展开的菜单--\x3e\n </ul>\n </div>\n </div>\n\n </div>'));
  4161. }.call(this), function() {
  4162. var _this = this, keyUpList = _this.vNode[1].find("#keyUpList");
  4163. $(document).on("click", function(e) {
  4164. _this.vNode[1].hasClass("pr-open-show") && _this.close();
  4165. }), this.vNode[0].click(function(event) {
  4166. event.stopPropagation(), event.preventDefault(), _this.vNode[1].toggleClass("pr-open-show");
  4167. }), this.vNode[1].find("#selectInput").keyup(function(event) {
  4168. event.stopPropagation(), event.preventDefault();
  4169. var menuGroup = _this.vNode[1].find("#menu-group"), listItems = menuGroup.find(".list-item"), tip = $(this).next(".search-tip"), val = $(this).val();
  4170. if (!(val = val.toUpperCase())) return tip.hide(), menuGroup.show(), void keyUpList.html("").hide();
  4171. tip.show().find("strong").text(val), menuGroup.hide(), keyUpList.html("").show();
  4172. var regCH = new RegExp("[\\u4E00-\\u9FFF]+", "g");
  4173. regCH.test(val), listItems.find("a").each(function(i, item) {
  4174. var mid = $(item).attr("menu-id");
  4175. _this.isI18n && "en" == i18next.language ? str = $(item).text().toUpperCase().indexOf(val) : (-1 < $(item).text().indexOf(val) || -1 < $(item).attr("py-code").indexOf(val)) && _this.menuData[mid] && (keyUpList.append('\n <div class="pr-meun-group"><div class="'.concat(_this.menuData[mid].leaf ? "list-item" : "list-item parent", '" >\n ').concat(item.outerHTML, "</div></div>")),
  4176. keyUpList.find("a").removeClass());
  4177. });
  4178. }), this.vNode[1].click(function(event) {
  4179. if (event.stopPropagation(), event.preventDefault(), "layui-icon layui-icon-close" == event.target.className) return _this.close();
  4180. var rightNav = $(event.target).parents("#right-search-nav");
  4181. if (0 < rightNav.length) {
  4182. var sItem = $(event.target).parents(".s-item"), meunTop = function(meungroupList) {
  4183. var list = meungroupList.find(".list-item"), obj = {};
  4184. return list.each(function(index, item) {
  4185. var key = item.id;
  4186. obj[key] = parseInt(item.offsetTop);
  4187. }), obj;
  4188. }(_this.vNode[3]), thisHref = sItem.find("a").attr("menu-id"), list = _this.vNode[3].find(".list-item");
  4189. for (var key in sItem.addClass("active").siblings().removeClass("active"), list.each(function() {
  4190. $(this)[0].id == thisHref ? $(this).addClass("select") : $(this).removeClass("select");
  4191. }), meunTop) key == thisHref && $(".pr-left").animate({
  4192. scrollTop: meunTop[key]
  4193. });
  4194. return !1;
  4195. }
  4196. var menuGroup = $(event.target).parents("#menu-group");
  4197. if ((0 < keyUpList.length || 0 < menuGroup.length) && "A" == event.target.tagName) {
  4198. var key = $(event.target).attr("menu-id"), listItem = $(event.target).parents(".list-item");
  4199. 0 == _this.menuData[key].parentMenuId && (_this.vNode[1].find("#menu-group").show(),
  4200. keyUpList.hide(), listItem = _this.vNode[3].find(".list-item a[menu-id=".concat(key, "]")).parent()),
  4201. menuGroup.find(".list-item").removeClass("select"), listItem.addClass("select");
  4202. var pKey = listItem.children().attr("menu-id"), sItem = _this.vNode[2].find("a[menu-id=".concat(pKey, "]")).parents(".s-item");
  4203. return sItem.addClass("active").siblings().removeClass("active"), "function" == typeof _this.leafClick && ($(event.target).attr("menu-id"),
  4204. _this.leafClick(key, _this.menuData[key], $(event.target)), _this.menuData[key].leaf && _this.close()),
  4205. !1;
  4206. }
  4207. });
  4208. }.call(this), this;
  4209. }, plgSearch.prototype.loadData = function(data) {
  4210. return this.vNode[2] = function(data, isI18n) {
  4211. var sidebarLi = "";
  4212. return Array.isArray(Object.values(data)) && Object.values(data).filter(function(item) {
  4213. "0" == item.parentMenuId && (sidebarLi += '<li class="s-item '.concat(item.isActive ? "active" : "", '">\n <span class="icon-box"><i class="').concat(item.imagePath, '"></i></span>\n <span class="meun-name">\n <a href="').concat(item.blank ? item.path : item.hash ? "#" + item.hash : "javascript:;", '" ').concat(item.blank ? "target=_blank" : "", " ").concat(isI18n && i18next.exists(item.name.toString()) ? 'data-i18n="'.concat(item.name, '"') : "", " menu-id=").concat(item.menuId, ">").concat(item.name, "</a></span>\n </li>"));
  4214. }), $(sidebarLi);
  4215. }(data, this.isI18n), this.vNode[3] = function(mapData, isI18n) {
  4216. if (mapData) {
  4217. var index = 0, group = $('<div class="pr-meun-group"></div><div class="pr-meun-group"></div><div class="pr-meun-group"></div>'), treeData = filterData(0, mapData), recursive = function recursive(pid) {
  4218. var str = "";
  4219. return filterData(pid, mapData).forEach(function(ditem) {
  4220. str += '<div class="menu-text">\n <a py-code='.concat(ditem.PY_code, " href=").concat(ditem.hash && ditem.leaf ? "#" + ditem.hash : "javascript:;", "\n parentmenu-id=").concat(ditem.parentMenuId, "\n menu-id=").concat(ditem.menuId, "\n leaf=").concat(ditem.leaf, "\n ").concat(isI18n && i18next.exists(ditem.name.toString()) ? "data-i18n=".concat(ditem.name) : "", ">\n ").concat(ditem.name, "</a>\n </div>"),
  4221. ditem.leaf || (str += recursive(ditem.menuId));
  4222. }), str;
  4223. };
  4224. for (var key in treeData) {
  4225. var ele = '<div class="list-item '.concat(treeData[key].isActive ? "select" : "", '" id=').concat(treeData[key].menuId, ">\n <a py-code=").concat(treeData[key].PY_code, " href=").concat(treeData[key].hash && treeData[key].leaf ? "#" + treeData[key].hash : "javascript:;", " menu-id=").concat(treeData[key].menuId, " ").concat(isI18n && i18next.exists(treeData[key].name.toString()) ? "data-i18n=".concat(treeData[key].name) : "", " parentmenu-id=").concat(treeData[key].parentMenuId, ' class="list-title" leaf=').concat(treeData[key].leaf, ">\n ").concat(treeData[key].name, "</a>");
  4226. ele += recursive(treeData[key].menuId), ele += "</div>", index % 3 == 0 ? group.eq(0).append(ele) : index % 3 == 1 ? group.eq(1).append(ele) : index % 3 == 2 && group.eq(2).append(ele),
  4227. index++;
  4228. }
  4229. return $(group).find(".menu-text>a[leaf='false']").parent().remove(), $(group);
  4230. }
  4231. }(data, this.isI18n), this.vNode[1].find("#right-search-nav").append(this.vNode[2]),
  4232. this.vNode[1].find("#menu-group").append(this.vNode[3]), this.menuData = data, this;
  4233. }, plgSearch.prototype.renderTo = function(domId) {
  4234. return this.renderer = domId, $("#" + this.renderer).addClass("plg-search").empty().append(this.vNode[0]),
  4235. $("body").append(this.vNode[1]), this;
  4236. }, plgSearch.prototype.close = function() {
  4237. var className = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "pr-open-show";
  4238. this.vNode[1].removeClass(className);
  4239. }, window.PlgSearch = plgSearch, $.fn.initPlgSearch = function(options) {
  4240. return new plgSearch(this, options);
  4241. };
  4242. }(jQuery);
  4243. "use strict";
  4244. !function($, layui) {
  4245. $.fn.PlgSelectPlusTags = function(options) {
  4246. return new plgSelectPlusTags(options);
  4247. };
  4248. var plgSelectPlusTags = function(options) {
  4249. this.render(options);
  4250. };
  4251. plgSelectPlusTags.prototype.render = function(options) {
  4252. if ($("#" + options.renderer).after('<div class="layui-input-block plg-select-tags"></div>'),
  4253. options.el = "#" + options.renderer, delete options.renderer, options.isAll) {
  4254. var temKey = options.valueName, temArr = [];
  4255. options.data.forEach(function(val) {
  4256. temArr.push(val[temKey]);
  4257. }), options.values = temArr;
  4258. }
  4259. return options.hasOwnProperty("isAll") && delete options.isAll, layui.selectPlus.render(options);
  4260. }, window.PlgSelectPlusTags = plgSelectPlusTags;
  4261. }(jQuery, layui);
  4262. "use strict";
  4263. function _typeof(obj) {
  4264. return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  4265. return typeof obj;
  4266. } : function(obj) {
  4267. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  4268. })(obj);
  4269. }
  4270. !function() {
  4271. var plgSidebar = function(ele, opts) {
  4272. var self = this, _acviveId = null, _isHover = !0, ClassMain = {
  4273. dom: null,
  4274. documentPanel: null,
  4275. meunPanelThis: null,
  4276. template: function(meunPanelThis) {
  4277. var opts = this.opes;
  4278. return $('<div class="plg-sidebar">\n <div class="main-nav">\n <div id="meunSoroll" class="layui-side-scroll">\n\n <div class="plg-logo" >\n <a class="logo-path '.concat("plg" == opts.logo && "plg-logo", '" ></a>\n <i id="plg-logo-fold" class="plg_anticon layui-icon layui-icon-shrink-right"></i>\n </div>\n \x3c!-- 左侧导航区域(可配合layui已有的垂直导航) --\x3e\n <div class="pr-open" data-type="hoot-click">\n <div class="layui-layer-setwin">\n <a class="layui-icon layui-icon-close" href="javascript:;"></a>\n </div>\n <div class="pr-search">\n <span class="pr-icon-search-wrapper"><i class="layui-icon layui-icon-search\n "></i></span>\n\n <input type="text" id="selectInput" class="pr-search-input"\n ').concat(this.isI18n && i18next.exists("请输入关键词") ? "data-i18n=[placeholder]请输入关键词" : "placeholder='请输入关键词'", '\n >\n\n <div class="search-tip">\n <p><span>以下是与“<strong></strong>”相关的产品:</span></p></div>\n\n </div>\n <div class="pr-left">\n <div id="keyUpList" class="keyUpList"></div>\n <div class="pr-meungroup-list">\n </div>\n </div>\n <div class="pr-right">\n <div class="scroll-nav">\n <ul class="right-sidebar">\n\n </ul>\n </div>\n </div>\n </div>\n <div class="product-all" data-type="hoot-click">\n <span class="icon-box">\n <i class="icon iconfont p-icon-all"></i>\n </span>\n <span class="meun-name">\n <a class="" href="javascript:;" ').concat(this.isI18n && i18next.exists("所有服务") ? 'data-i18n="所有服务"' : "", '>所有服务</a>\n <i class="right-mover layui-icon layui-icon-right\n "></i>\n </span>\n </div>\n <div class="nav-last" data-type="hoot-click">\n <ul id="sidebar" class="sidebar">\n\n\n\n\n </ul>\n <div class="nav-hover-child" >\n \x3c!-- 二级菜单 --\x3e\n <div class="layui-side">\n \x3c!--<div class="nav-title"></div>--\x3e\n <ul class="body-nav" lay-filter="test"></ul>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n '));
  4279. },
  4280. mainNav: function(parentData) {
  4281. if (parentData) {
  4282. var ele = "";
  4283. return parentData[0].filter(function(item) {
  4284. "0" === item.parentMenuId && (ele += '\n <li class="s-item" id='.concat(item.id, " menu-id=").concat(item.menuId, '>\n <span class="icon-box">\n <i class="').concat(item.imagePath, '"></i>\n </span>\n <span class="meun-name"><a href="').concat(item.leaf ? item.path : "javascript:;", '"\n ').concat(self.isI18n && i18next.exists(item.name.toString()) ? "data-i18n=".concat(item.name) : "", '\n title="').concat(item.name, '" alt="').concat(item.name, '"\n >').concat(self.isI18n && i18next.exists(item.name.toString()) ? "" : item.name, "</a>").concat(item.leaf ? "" : '<i class="right-mover layui-icon layui-icon-right" style="right: 0.28rem;"></i>', "</span>\n </li>\n "));
  4285. }), ele;
  4286. }
  4287. },
  4288. resetOpenMenuList: function(ele, data) {
  4289. if (data) {
  4290. var group = $('<div class="pr-meun-group"></div><div class="pr-meun-group"></div><div class="pr-meun-group"></div>');
  4291. $(this.documentPanel[0]).find(".right-sidebar").html("").append(this.mainNav(data)),
  4292. data[0].forEach(function(item, inxex) {
  4293. var ele = '<div class="list-item" id='.concat(item.menuId, '>\n <a href="').concat(item.leaf ? item.path : "javascript:;", '"\n menu-id=').concat(item.menuId, "\n parentmenuid=").concat(item.parentMenuId, '\n class="list-title"\n ').concat(self.isI18n && i18next.exists(item.name.toString()) ? "data-i18n=".concat(item.name) : "", '\n title="').concat(item.name, '" alt="').concat(item.name, '"\n >\n ').concat(self.isI18n && i18next.exists(item.name.toString()) ? "" : item.name, "</a>");
  4294. data[item.menuId] && data[item.menuId].forEach(function(citem) {
  4295. ele += '<div class="menu-text">\n <a href='.concat(citem.path || "javascript:;", "\n menu-id=").concat(citem.menuId, "\n parentmenuid=").concat(citem.parentMenuId, "\n leaf=").concat(citem.leaf, "\n ").concat(self.isI18n && i18next.exists(citem.name.toString()) ? "data-i18n=".concat(citem.name) : "", '\n title="').concat(citem.name, '" alt="').concat(citem.name, '"\n >\n ').concat(self.isI18n && i18next.exists(citem.name.toString()) ? "" : citem.name, "\n </a>\n\n </div>"),
  4296. data[citem.menuId] && data[citem.menuId].forEach(function(ditem) {
  4297. ele += '<div class="menu-text">\n <a href='.concat(ditem.path || "javascript:;", "\n menu-id=").concat(ditem.menuId, '\n title="').concat(ditem.name, '" alt="').concat(ditem.name, '"\n parentmenuid=').concat(ditem.parentMenuId, "\n leaf=").concat(ditem.leaf, "\n ").concat(self.isI18n && i18next.exists(ditem.name.toString()) ? "data-i18n=".concat(ditem.name) : "", "\n >\n ").concat(self.isI18n && i18next.exists(ditem.name.toString()) ? "" : ditem.name, "\n </a>\n </div>");
  4298. });
  4299. }), ele += "</div>", inxex % 3 == 0 ? group.eq(0).append(ele) : inxex % 3 == 1 ? group.eq(1).append(ele) : inxex % 3 == 2 && group.eq(2).append(ele);
  4300. }), group.find(".menu-text>a[leaf='false']").hide(), ele.append(group);
  4301. }
  4302. },
  4303. setOpenAll: function(getData) {
  4304. if (getData) {
  4305. var list = this.dom.meungroupList, parentDatas = getData.parentData, keyUpList = $(this.documentPanel[0]).find("#keyUpList");
  4306. this.resetOpenMenuList(list, parentDatas);
  4307. var regCH = new RegExp("[\\u4E00-\\u9FFF]+", "g");
  4308. $(this.documentPanel[0]).find("#selectInput").keyup(function(e) {
  4309. var val = $(this).val();
  4310. if (!(val = val.toUpperCase())) return $(this).next(".search-tip").hide(), list.show(),
  4311. void keyUpList.html("").hide();
  4312. $(this).next(".search-tip").show().find("strong").text(val), list.hide();
  4313. var ele = "";
  4314. for (var key in getData.mapAll) {
  4315. var item = getData.mapAll[key];
  4316. 0 <= (self.isI18n && "en" == i18next.language ? i18next.t(item.name).toUpperCase().indexOf(val) : regCH.test(val) ? item.name.indexOf(val) : item.PY_code.indexOf(val)) && item.leaf && (ele += '<div class="pr-meun-group">\n <div class="list-item" id='.concat(item.menuId, ' >\n <div class="menu-text">\n <a title="').concat(item.name, '" alt="').concat(item.name, '" ').concat(self.isI18n ? "data-i18n=".concat(item.name) : "", " href=").concat(item.path || "javascript:;", " parentmenuid=").concat(item.parentMenuId, " menu-id=").concat(item.menuId, " >\n ").concat(item.name, "\n </a>\n </div>\n </div>\n </div>"));
  4317. }
  4318. list.hide(), keyUpList.html("").show().append(ele), keyUpList.localize && keyUpList.localize();
  4319. });
  4320. }
  4321. },
  4322. meunTopObj: function(obj) {
  4323. var list = this.dom.meungroupList.find(".list-item");
  4324. return obj = {}, list.each(function(index, item) {
  4325. var key = item.id;
  4326. obj[key] = parseInt(item.offsetTop);
  4327. }), obj;
  4328. },
  4329. removerShowList: function() {
  4330. this.dom && this.dom.meunSoroll.removeClass("showList");
  4331. },
  4332. clickChild: function(callbakc) {
  4333. var othis, _this = this, bodyNav = _this.dom.bodyNav, _getData = _this.meunPanelThis.getData;
  4334. _this.dom.bodyNav.on("click", "a", function(e) {
  4335. e.stopPropagation(), e.preventDefault(), othis = $(this);
  4336. var mid = _acviveId = othis.attr("menu-id");
  4337. if (0 < othis.parent("li").length && !_getData.mapAll[mid].leaf) return othis.parent("li").toggleClass("itemeds"),
  4338. _isHover = !1;
  4339. _this.dom.meungroupList.find("a[menu-id='" + mid + "']").trigger("click");
  4340. }), _this.dom.prLeft.on("click", "a", function(e) {
  4341. e.stopPropagation(), e.preventDefault(), othis = $(this);
  4342. var mid = _acviveId = $(this).attr("menu-id"), bodyNav_this = bodyNav.find("a[menu-id='" + mid + "']"), callbakcData = (bodyNav_this.parent(),
  4343. bodyNav_this.siblings(".nav-child"), {
  4344. getCurrent: _getData.mapAll[mid]
  4345. }), pid = othis.parents(".list-item").attr("id"), leaf = _getData.mapAll[mid].leaf;
  4346. othis.attr("href");
  4347. othis.parents(".pr-open").find(".right-sidebar .s-item[menu-id=" + pid + "] a").trigger("click"),
  4348. _this.updateChildMeun(pid, mid), leaf && (_this.dom.meunSoroll.find(".nav-last").attr("data-show", ""),
  4349. _this.removerShowList()), callbakc && callbakc(callbakcData, e);
  4350. });
  4351. },
  4352. EventHanlder: function(menuObj) {
  4353. var _this = this;
  4354. $(document).on("click", function() {
  4355. _this.dom.meunSoroll.hasClass("showList") && _this.removerShowList();
  4356. }), _this.dom.documentPanel.find("#plg-logo-fold").click(function(event) {
  4357. $(this).hasClass("layui-icon-shrink-right") ? ($(this).removeClass("layui-icon-shrink-right").addClass("layui-icon-spread-left"),
  4358. $("body").addClass("plg-open-hover")) : ($(this).removeClass("layui-icon-spread-left").addClass("layui-icon-shrink-right"),
  4359. $("body").removeClass("plg-open-hover"));
  4360. }), _this.dom.meunSoroll.find(".nav-last").hover(function(event) {
  4361. return _isHover = !0, _this.removerShowList(), 0 < _this.dom.bodyNav.find("li").length && $(this).attr("data-show", "show-child"),
  4362. !1;
  4363. }, function(event) {
  4364. return _isHover && $(this).attr("data-show", ""), !(_isHover = !0);
  4365. }), _this.dom.meunSoroll.on("click", "[data-type='hoot-click']", function(e) {
  4366. e.stopPropagation(), e.preventDefault();
  4367. var eve = e.target;
  4368. switch ($(this).attr("class")) {
  4369. case "product-all":
  4370. _this.dom.meunSoroll.toggleClass("showList");
  4371. break;
  4372. case "pr-open":
  4373. if (0 < $(eve).parents(".pr-left").length || "A" != eve.nodeName) return;
  4374. if ("layui-layer-setwin" == eve.parentNode.className) return void _this.removerShowList();
  4375. var meunTop = _this.meunTopObj(), sItem = $(eve).parents(".s-item"), thisHref = sItem.attr("menu-id"), list = $(".pr-meungroup-list").find(".list-item");
  4376. for (var key in sItem.addClass("active").siblings().removeClass("active"), list.each(function() {
  4377. $(this)[0].id == thisHref ? $(this).addClass("select") : $(this).removeClass("select");
  4378. }), meunTop) key == thisHref && _this.dom.prLeft.animate({
  4379. scrollTop: meunTop[key]
  4380. });
  4381. break;
  4382. case "nav-last":
  4383. var menuid = $(eve).parents(".s-item").attr("menu-id");
  4384. if (!menuid) return;
  4385. var leaf = Boolean(menuObj.mapAll[menuid].leaf);
  4386. if (_this.dom.meunSoroll.find(".nav-last").attr("data-show", ""), _this.removerShowList(),
  4387. 0 < $(eve).parents("#sidebar").length && _this.dom.meungroupList.find("a[menu-id='" + menuid + "']").trigger("click"),
  4388. leaf) return !1;
  4389. setTimeout(function() {
  4390. _this.dom.meunSoroll.find(".nav-last").attr("data-show", "show-child");
  4391. }, 200);
  4392. break;
  4393. default:
  4394. return !1;
  4395. }
  4396. });
  4397. },
  4398. updateChildMeun: function(pid, mid) {
  4399. var _this = this;
  4400. pid = pid;
  4401. $("[menu-id=" + pid + "]").addClass("active").siblings().removeClass("active");
  4402. var _getData = _this.meunPanelThis.getData;
  4403. if (_this.dom.bodyNav.empty(), pid) {
  4404. if (_getData.mapAll[pid].leaf && 0 == _getData.mapAll[mid].parentMenuId) return;
  4405. var parentData = _getData.parentData;
  4406. parentData[pid] && parentData[pid].forEach(function(item) {
  4407. var oliClass = "item h-link";
  4408. mid && item.menuId == mid && (oliClass = "item h-link active-this itemeds");
  4409. var oli = $("<li>", {
  4410. class: oliClass
  4411. }), oa = $("<a>", {
  4412. href: item.path || "javascript:;",
  4413. "menu-id": item.menuId,
  4414. leaf: item.leaf,
  4415. level: item.level,
  4416. id: item.id,
  4417. title: item.name,
  4418. alt: item.name,
  4419. parentMenuId: item.parentMenuId
  4420. }).html("<span>".concat(item.name, "</span>")), _is = self.isI18n && i18next.exists(item.name.toString());
  4421. if (_is && oa.find("span").attr("data-i18n", item.name), oli.append(oa), !item.leaf && parentData[item.parentMenuId] && 0 < parentData[item.parentMenuId].length) {
  4422. var navchild = '<dl class="nav-child">';
  4423. parentData[item.menuId] && parentData[item.menuId].forEach(function(citem) {
  4424. navchild += "<dd class= ".concat(mid && citem.menuId == mid ? "active-this" : "", " >\n <a ").concat(_is ? "data-i18n=".concat(citem.name) : "", "\n href=").concat(citem.path || "javascript:;", " leaf=").concat(citem.leaf, '\n alt="').concat(citem.name, '"\n title="').concat(citem.name, '"\nmain-id=').concat(item.parentMenuId, " parentMenuId=").concat(citem.parentMenuId, " menu-id=").concat(citem.menuId, ">").concat(_is ? "" : citem.name, "</a></dd>");
  4425. }), navchild += "</dl>", oa.append('<i class="right-mover layui-icon layui-icon-right"></i>'),
  4426. oli.append(navchild), mid && oli.find("dd").each(function(index, item) {
  4427. if ("active-this" == $(item).attr("class")) return oli.addClass("active-this").addClass("itemeds"),
  4428. oli.find(".nav-child").show();
  4429. });
  4430. }
  4431. _this.dom.bodyNav.append(oli), _this.dom.bodyNav.localize && _this.dom.bodyNav.localize();
  4432. });
  4433. }
  4434. },
  4435. initPanel: function(meunPanelThis, opes) {
  4436. return this.meunPanelThis = meunPanelThis, this.opes = opes, this.documentPanel = this.template(this),
  4437. this.documentPanel && (this.dom = {
  4438. documentPanel: this.documentPanel,
  4439. meunSoroll: this.documentPanel.find("#meunSoroll"),
  4440. $sidebar: this.documentPanel.find("#sidebar"),
  4441. bodyNav: this.documentPanel.find(".body-nav"),
  4442. meungroupList: this.documentPanel.find(".pr-meungroup-list"),
  4443. prLeft: this.documentPanel.find(".pr-left"),
  4444. $tabli: $(".layui-tab-title li"),
  4445. $nav_hover_child: this.documentPanel.find(".nav-hover-child")
  4446. }), this.documentPanel;
  4447. }
  4448. };
  4449. this.isI18n = window.isI18n || !1, this.getActiveId = function() {
  4450. return _acviveId;
  4451. };
  4452. this.getFun = ClassMain;
  4453. var config = {
  4454. isTrigger: !1,
  4455. logo: null,
  4456. url: null,
  4457. type: "get",
  4458. dataType: "json",
  4459. params: null,
  4460. defaults: null,
  4461. menuClick: null,
  4462. tabsConfing: null
  4463. };
  4464. 1 == arguments.length ? (this.opts = ele, this.opts = $.extend(!0, config, this.opts),
  4465. this.init(this.opts)) : 2 == arguments.length && (this.ele = ele, this.opts = opts,
  4466. this.opts = $.extend(!0, config, this.opts), this.init(), this.renderTo(this.ele)),
  4467. this.opts.tabsConfing && (this.navTabs = new PlgTabs(this.opts.tabsConfing));
  4468. };
  4469. plgSidebar.prototype.setMapData = function() {
  4470. var index, dataAll, _this = this, closeLoad = (index = layer.load(2, {
  4471. shade: [ .6, "#fff" ]
  4472. }), function() {
  4473. layer.close(index);
  4474. }), mapAll = null, parentData = null;
  4475. mapAll = {};
  4476. var obj = null;
  4477. return new Promise(function(resolve, _error) {
  4478. Prolog.ajax({
  4479. type: _this.opts.type,
  4480. url: _this.opts.url,
  4481. dataType: _this.opts.dataType,
  4482. data: _this.opts.params,
  4483. success: function(res) {
  4484. res.success && ((dataAll = res.data).forEach(function(item, index) {
  4485. item.PY_code || (item.PY_code = pinyin.makePy(item.name)[0]);
  4486. }), parentData = function(dataAll) {
  4487. var map = {};
  4488. return dataAll.forEach(function(item) {
  4489. map[item.parentMenuId] || (map[item.parentMenuId] = []), map[item.parentMenuId].push(item);
  4490. }), map;
  4491. }(dataAll), dataAll.forEach(function(item) {
  4492. mapAll[item.menuId] = item;
  4493. }), obj = {
  4494. dataAll: dataAll,
  4495. mapAll: mapAll,
  4496. parentData: parentData
  4497. }), obj ? resolve(obj) : _error(obj);
  4498. },
  4499. error: function(err) {
  4500. layer.msg("数据加载失败!"), _error(obj);
  4501. },
  4502. complete: function() {
  4503. closeLoad();
  4504. }
  4505. });
  4506. });
  4507. }, plgSidebar.prototype.init = function(opts) {
  4508. var _class = this.getFun;
  4509. return "object" === _typeof(this.opts) && (this.opts = $.extend(!0, this.config, this.opts),
  4510. this.opts.url, this.getElement = _class.initPanel(this, this.opts), this.promiseGetDate = this.setMapData()),
  4511. this;
  4512. }, plgSidebar.prototype.renderTo = function(domId) {
  4513. var _this = this, _class = this.getFun, documentPanel = this.getFun.documentPanel;
  4514. return $("#" + domId).append(documentPanel), _this.promiseGetDate.then(function(menuObj) {
  4515. return menuObj ? (_class.meunPanelThis.getData = menuObj, _class.dom.$sidebar.append(_class.mainNav(menuObj.parentData)),
  4516. _class.setOpenAll(menuObj), _class.EventHanlder(menuObj), "function" == typeof _this.opts.menuClick ? _class.clickChild(_this.opts.menuClick.bind(_this)) : _class.clickChild(),
  4517. menuObj) : null;
  4518. }).then(function(menudata) {
  4519. if (menudata) {
  4520. if (_this.opts.isTrigger) {
  4521. var menuid = $("#" + domId).find(".sidebar li:first-child").addClass("active").attr("menu-id");
  4522. _this.getFun.updateChildMeun(null, menuid);
  4523. }
  4524. if (_this.opts.defaults) {
  4525. var defaults = menudata.mapAll[_this.opts.defaults];
  4526. defaults && _this.getFun.dom.meungroupList.find("a[menu-id='" + defaults.menuId + "']").trigger("click");
  4527. }
  4528. }
  4529. }), this;
  4530. }, window.PlgSideAccordion = plgSidebar, $.fn.initPlgSideAccordion = function(opts) {
  4531. return new plgSidebar(this, opts);
  4532. };
  4533. }();
  4534. "use strict";
  4535. !function($) {
  4536. var plgSidebar = function(options) {
  4537. var _this = this;
  4538. _this.options = options, _this.getActiveId = function() {
  4539. return vipspa.indexid;
  4540. };
  4541. var object, config = {
  4542. data: null,
  4543. renderer: null,
  4544. url: null,
  4545. isI18n: window.isI18n || !1,
  4546. ajaxInit: {
  4547. url: null,
  4548. type: "get",
  4549. dataType: "json"
  4550. },
  4551. logo: "",
  4552. route: !1,
  4553. menuClick: null,
  4554. routerConfig: null
  4555. };
  4556. _this.options = $.extend(!0, config, _this.options), _this.fold = !0, _this.options.data ? _this.promiseGetDate = new Promise(function(resolve) {
  4557. resolve(parseData(_this.options.data));
  4558. }) : _this.promiseGetDate = (object = _this.options.ajaxInit, new Promise(function(resolve, error) {
  4559. var close = PlgDialog.loading2(), treedata = null;
  4560. object.success = function(response) {
  4561. response.success ? treedata = parseData(response.data) : layer.msg("数据加载失败!"), treedata ? resolve(treedata) : error();
  4562. }, object.error = function(XMLHttpRequest, textStatus, errorThrown) {}, object.complete = function() {
  4563. close();
  4564. }, Prolog.ajax(object);
  4565. })), _this.document = function(mapData, opts) {
  4566. var opts = this.options, tpl = (this.mapData, $('<div class="plg-sidebar">\n <div class="main-nav">\n <div id="meunSoroll" class="layui-side-scroll">\n <div class="plg-logo" >\n <a class="logo-path '.concat("plg" == opts.logo && "plg-logo", '" ></a>\n <i id="plg-logo-fold" class="plg_anticon layui-icon ').concat(this.fold ? "layui-icon-shrink-right" : "layui-icon-spread-left", '"></i>\n </div>\n \x3c!-- 左侧打开全部导航区域 --\x3e\n <div class="pr-open" data-type="hoot-click">\n <div class="layui-layer-setwin">\n <a class="layui-icon layui-icon-close" href="javascript:;"></a>\n </div>\n <div class="pr-search">\n <span class="pr-icon-search-wrapper"><i class="layui-icon layui-icon-search\n "></i></span>\n\n <input type="text" id="selectInput" class="pr-search-input" ').concat(opts.isI18n && i18next.exists("请输入关键词") ? "data-i18n=[placeholder]请输入关键词" : "placeholder='请输入关键词'", '>\n <div class="search-tip">\n <p><span>以下是与“<strong></strong>”相关的产品:</span></p></div>\n </div>\n <div class="pr-left">\n <div id="keyUpList" class="keyUpList"></div>\n <div class="pr-meungroup-list">\n \x3c!-- 全部菜单列表---\x3e\n\n\n </div>\n </div>\n <div class="pr-right">\n <div class="scroll-nav">\n <ul class="right-sidebar">\n\n \x3c!--展开的菜单--\x3e\n\n\n </ul>\n </div>\n </div>\n </div>\n <div class="product-all" data-type="hoot-click">\n <span class="icon-box">\n <i class="icon iconfont p-icon-all"></i>\n </span>\n <span class="meun-name">\n <a href="javascript:;" ').concat(opts.isI18n && i18next.exists("所有服务") ? 'data-i18n="所有服务"' : "", '>所有服务</a>\n <i class="right-mover layui-icon layui-icon-right\n "></i>\n </span>\n </div>\n <div class="nav-last" data-show="">\n <ul id="sidebar" class="sidebar">\n\n \x3c!--一级菜单--\x3e\n\n </ul>\n <div class="nav-hover-child" >\n \x3c!-- 二级菜单 --\x3e\n <div class="layui-side">\n\n \x3c!-- 当前hover二级菜单列表---\x3e\n\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n ')));
  4567. return $().localize && tpl.localize(), $(tpl);
  4568. }.call(_this), _this.init(_this.document), _this.options.renderer && _this.renderTo(_this.options.renderer),
  4569. _this.promiseGetDate.then(function(data) {
  4570. vipspa.routerMap = Object.assign(vipspa.routerMap, data.routeSetting), vipspa.__defineGetter__("mapData", function() {
  4571. return data.treedata.mapData;
  4572. }), vipspa.loadRoute();
  4573. }), vipspa.__defineSetter__("mapData", function(newValue) {
  4574. newValue && _this.reset(newValue);
  4575. }), _this.options.routerConfig && vipspa.start(_this.options.routerConfig);
  4576. };
  4577. function filterData(pid, Data) {
  4578. return Object.values(Data).filter(function(item) {
  4579. return item.parentMenuId == pid;
  4580. });
  4581. }
  4582. function mapUpdateChildrenNan(id, mapData, dom, isI18n) {
  4583. var parent = mapData[mapData[id].parentMenuId];
  4584. parent ? "0" !== parent.parentMenuId && (parent = mapData[parent.parentMenuId]) : parent = mapData[id];
  4585. parent.children = function tree(pid) {
  4586. var data = [];
  4587. return Object.values(mapData).forEach(function(item) {
  4588. if (pid == item.parentMenuId && (data.push(item), !item.leaf)) return item.children = tree(item.menuId);
  4589. }), data;
  4590. }(parent.menuId);
  4591. var treeData = parent, sidebarLi = '<ul class="body-nav" parentmenu-id='.concat(parent.menuId, " name=").concat(parent.name, ">");
  4592. for (var key in treeData = treeData.children) sidebarLi += '<li class="item h-link '.concat(treeData[key].isActive ? "active-this" : "", " ").concat(treeData[key].isActive && treeData[key].children ? "itemeds" : "", '">\n <a href="').concat(treeData[key].blank ? treeData[key].path : treeData[key].hash ? "#" + treeData[key].hash : "javascript:;", '" ').concat(treeData[key].blank ? "target=_blank" : "", " menu-id=").concat(treeData[key].menuId, ' leaf="').concat(treeData[key].leaf, '" level="').concat(treeData[key].level, '"><span ').concat(isI18n && i18next.exists(treeData[key].name.toString()) ? "data-i18n=".concat(treeData[key].name) : "", ">").concat(treeData[key].name, "</span>\n ").concat(treeData[key].children && !treeData[key].leaf ? '<i class="right-mover layui-icon layui-icon-right"></i>' : "", "\n </a>\n ").concat(treeData[key].children && !treeData[key].leaf ? '<dl class="nav-child" parentmenu-id='.concat(treeData[key].menuId, ">\n ").concat(treeData[key].children.map(function(childItem, index, arr) {
  4593. return "<dd ".concat(childItem.isActive ? 'class="active-this"' : "", ">\n <a href=").concat(childItem.blank ? childItem.path : childItem.hash ? "#" + childItem.hash : "javascript:;", "\n ").concat(childItem.blank ? "target=_blank" : "", " leaf=").concat(childItem.leaf, " menu-id=").concat(childItem.menuId, " level=").concat(childItem.level, " ").concat(isI18n && i18next.exists(childItem.name.toString()) ? "data-i18n=".concat(childItem.name) : "", ">").concat(childItem.name, "</a></dd>");
  4594. }).join(""), "\n </dl>") : "", "\n </li>");
  4595. return sidebarLi += "</ul>", dom ? (dom.bodyNav.html(sidebarLi), $().localize && dom.bodyNav.localize()) : ($(".nav-hover-child .layui-side").html(sidebarLi),
  4596. $().localize && $(".nav-hover-child .layui-side").localize()), sidebarLi;
  4597. }
  4598. var _isHover = !0;
  4599. function EventHanlder(dom) {
  4600. var _this = this, opts = this.options, mapData = function() {
  4601. return vipspa.mapData;
  4602. };
  4603. $(document).on("click", function(e) {
  4604. dom.meunSoroll.hasClass("showList") && removerShowList(dom.meunSoroll);
  4605. }), dom.logoFold.click(function(event) {
  4606. _this.fold ? ($(this).removeClass("layui-icon-shrink-right").addClass("layui-icon-spread-left"),
  4607. $("body").addClass("plg-open-hover")) : ($(this).removeClass("layui-icon-spread-left").addClass("layui-icon-shrink-right"),
  4608. $("body").removeClass("plg-open-hover")), _this.fold = !_this.fold;
  4609. }), dom.navLast.hover(function(event) {
  4610. _isHover = !0;
  4611. var id = $(this).find("li.s-item.active a").attr("menu-id");
  4612. if (!id || !vipspa.mapData[id].leaf) return removerShowList(dom.meunSoroll), $(this).attr("data-show", "show-child"),
  4613. !1;
  4614. dom.navLast.attr("data-show", "");
  4615. }, function() {
  4616. return _isHover && $(this).attr("data-show", ""), !1;
  4617. }), dom.prLeft.on("click", ".list-item a", function(event) {
  4618. var id = $(this).attr("menu-id"), pid = $(this).attr("parentmenu-id");
  4619. if (event.preventDefault(), !mapData()[id].leaf || !mapData()[id].hash) return $(".scroll-nav").find("a[menu-id='" + mapData()[id].menuId + "']").click(),
  4620. !1;
  4621. if (location.hash = "#" + mapData()[id].hash, mapData()[id].leaf && "0" !== mapData()[id].parentMenuId) return mapUpdateChildrenNan(id, mapData(), dom, opts.isI18n),
  4622. void removerShowList(dom.meunSoroll);
  4623. mapData()[id].parentMenuId, pid = function result(pid) {
  4624. var obj = mapData()[pid];
  4625. if (obj && "0" !== obj.parentMenuId) return result(obj.parentMenuId);
  4626. mapUpdateChildrenNan(id, mapData(), dom, opts.isI18n);
  4627. var slfe = dom.bodyNav.find("a[menu-id='".concat(id, "']"));
  4628. return slfe.parent().is("dd") && (slfe.parents("li.item ").addClass("itemeds"),
  4629. slfe.parents("dl.nav-child").show()), slfe.parent().addClass("active-this").siblings().removeClass("active-this"),
  4630. pid;
  4631. }(pid), removerShowList(dom.meunSoroll);
  4632. }), dom.sidebar.on("click", "li", function(event) {
  4633. var slfe = $(this), id = $(this).find("a").attr("menu-id");
  4634. vipspa.indexid = id;
  4635. var i = $(this).index();
  4636. if ($(this).addClass("active").siblings().removeClass("active"), opts.index = i,
  4637. vipspa.mapData[id].leaf) return dom.navLast.attr("data-show", ""), location.hash = $(this).find("a").attr("href"),
  4638. void (opts.menuClick && opts.menuClick.call(_this, slfe));
  4639. event.preventDefault(), dom.navLast.attr("data-show", ""), mapUpdateChildrenNan(id, mapData(), dom, opts.isI18n),
  4640. setTimeout(function() {
  4641. dom.navLast.attr("data-show", "show-child");
  4642. }, 200), opts.menuClick && opts.menuClick.call(_this, slfe);
  4643. }), dom.bodyNav.on("click", "li a", function(event) {
  4644. event.stopPropagation();
  4645. var slfe = $(this), leaf = "true" == slfe.attr("leaf"), child = slfe.siblings("dl.nav-child");
  4646. if (vipspa.indexid = slfe.attr("menu-id"), slfe.parent().addClass("active-this").siblings().removeClass("active-this").find("dd").removeClass("active-this").removeClass("itemeds"),
  4647. slfe.parent().is("dd") && slfe.parents("li.item").addClass("active-this").siblings().removeClass("active-this").removeClass("itemeds"),
  4648. opts.menuClick && opts.menuClick.call(_this, slfe), !leaf && 0 < child.length) return slfe.parent().addClass("active-this").siblings().removeClass("active-this").removeClass("itemeds"),
  4649. child.slideToggle("fast"), slfe.parent().toggleClass("itemeds").siblings().children(".nav-child").slideUp(),
  4650. _isHover = !1;
  4651. "_blank" != $(this).attr("target") ? "javascript:;" !== $(this).attr("href") ? (dom.navLast.attr("data-show", ""),
  4652. location.hash = $(this).attr("href")) : event.preventDefault() : dom.navLast.attr("data-show", "");
  4653. }), dom.meunSoroll.on("click", "[data-type='hoot-click']", function(event) {
  4654. event.stopPropagation(), event.preventDefault();
  4655. var eve = event.target;
  4656. switch ($(this).attr("class")) {
  4657. case "product-all":
  4658. dom.meunSoroll.toggleClass("showList");
  4659. break;
  4660. case "pr-open":
  4661. "layui-layer-setwin" == eve.parentNode.className && removerShowList(dom.meunSoroll);
  4662. var meunTop = meunTopObj(dom.meungroupList), sItem = $(eve).parents(".s-item"), thisHref = sItem.find("a").attr("menu-id"), list = dom.meungroupList.find(".list-item");
  4663. for (var key in sItem.addClass("active").siblings().removeClass("active"), list.each(function() {
  4664. $(this)[0].id == thisHref ? $(this).addClass("select") : $(this).removeClass("select");
  4665. }), meunTop) key == thisHref && $(".pr-left").animate({
  4666. scrollTop: meunTop[key]
  4667. });
  4668. document.addEventListener("keyup", function() {});
  4669. break;
  4670. default:
  4671. return !1;
  4672. }
  4673. });
  4674. }
  4675. function setOpenKeyup(dom) {
  4676. var isI18n = this.options.isI18n, regCH = new RegExp("[\\u4E00-\\u9FFF]+", "g");
  4677. dom.meunSoroll.find("#selectInput").keyup(function(e) {
  4678. var keyUpList = dom.prLeft.find("#keyUpList"), tip = $(this).next(".search-tip"), val = $(this).val();
  4679. if (!(val = val.toUpperCase())) return tip.hide(), dom.meungroupList.show(), void keyUpList.html("").hide();
  4680. tip.show().find("strong").text(val), dom.meungroupList.hide(), keyUpList.html("").show(),
  4681. dom.meungroupList.find(".list-item").find("a").each(function(i, item) {
  4682. 0 <= (isI18n && "en" == i18next.language ? $(item).text().toUpperCase().indexOf(val) : regCH.test(val) ? $(item).text().indexOf(val) : $(item).attr("py-code").indexOf(val)) && Boolean($(item).attr("leaf")) && (keyUpList.append('<div class="pr-meun-group"><div class="list-item">'.concat(item.outerHTML, "</div></div>")),
  4683. keyUpList.find("a").removeClass());
  4684. });
  4685. });
  4686. }
  4687. function removerShowList(dom, className) {
  4688. className || (className = "showList"), dom.removeClass(className);
  4689. }
  4690. function parseData(da) {
  4691. var routeSetting = {}, treedata = function(data) {
  4692. data.forEach(function(item, index) {
  4693. delete item.children, delete item.type, delete item.queryId, delete item.operateType,
  4694. delete item.lastModifyTime, delete item.helpCode, delete item.creatorName, delete item.creatorId,
  4695. delete item.createTime, delete item.modifierId, delete item.modifierName, delete item.sort,
  4696. item.enable || delete data[index];
  4697. });
  4698. var map = {};
  4699. return data.forEach(function(item) {
  4700. map[item.menuId] = item;
  4701. }), {
  4702. mapData: map
  4703. };
  4704. }(da);
  4705. return da.forEach(function(item) {
  4706. if (!item.blank && (item.PY_code = pinyin.makePy(item.name)[0], item.leaf && item.path)) {
  4707. if (!item.hash) {
  4708. var index = item.path.indexOf("?");
  4709. item.hash = item.path, -1 < index && (item.hash = item.path.substr(0, index - 1)),
  4710. item.hash = item.hash.substr(1).split("/"), item.hash = item.hash[item.hash.length - 2] + "/" + item.hash[item.hash.length - 1],
  4711. -1 != item.hash.indexOf("=") && (item.hash = item.hash.match("([^=]+)$")[0]);
  4712. }
  4713. var obj = function resultName(mid) {
  4714. var arr = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : [];
  4715. var idarr = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : [];
  4716. var mapData = treedata.mapData;
  4717. var item = mapData[mid];
  4718. if (item && (arr.unshift(item.name), idarr.unshift(item.menuId), 0 != item.parentMenuId)) return resultName(item.parentMenuId, arr, idarr);
  4719. return {
  4720. arr: arr,
  4721. idarr: idarr
  4722. };
  4723. }(item.menuId);
  4724. item.path = function(item) {
  4725. var path = item.path, index = path.indexOf("?");
  4726. {
  4727. if (item.iframe) return path;
  4728. if (-1 < index) return path;
  4729. var hasHtml = path.indexOf(".html");
  4730. return -1 < hasHtml ? path : path + ".html";
  4731. }
  4732. }(item), -1 < index && (item.hash = item.menuId), routeSetting[item.hash] = {
  4733. templateUrl: item.path,
  4734. iframe: item.iframe || !1,
  4735. controller: item.srcPath ? item.srcPath + ".js" : null,
  4736. name: item.name,
  4737. menuId: item.menuId,
  4738. parent_name: obj.arr,
  4739. stateArr: obj.idarr
  4740. }, obj = null;
  4741. }
  4742. }), {
  4743. treedata: treedata,
  4744. routeSetting: routeSetting
  4745. };
  4746. }
  4747. plgSidebar.prototype.init = function(document) {
  4748. return this.$dom = {
  4749. sidebar: document.find("#sidebar"),
  4750. logoFold: document.find("#plg-logo-fold"),
  4751. meunSoroll: document.find("#meunSoroll"),
  4752. navLast: document.find("#meunSoroll .nav-last"),
  4753. bodyNav: document.find(".nav-hover-child .layui-side"),
  4754. meungroupList: document.find(".pr-meungroup-list"),
  4755. prLeft: document.find(".pr-left"),
  4756. rightSidebar: document.find(".right-sidebar"),
  4757. nav_hover_child: document.find(".nav-hover-child")
  4758. }, EventHanlder.call(this, this.$dom), setOpenKeyup.call(this, this.$dom), this;
  4759. }, plgSidebar.prototype.reset = function(newValue) {
  4760. var sidebarLi = function(mapData, isI18n) {
  4761. var sidebarLi = "";
  4762. return Object.values(mapData).filter(function(item) {
  4763. "0" == item.parentMenuId && (sidebarLi += '<li class="s-item '.concat(item.isActive ? "active" : "", '">\n <span class="icon-box"><i class="').concat(item.imagePath, '"></i></span>\n <span class="meun-name">\n <a href="').concat(item.blank ? item.path : item.hash ? "#" + item.hash : "javascript:;", '" ').concat(item.blank ? "target=_blank" : "", " ").concat(isI18n && i18next.exists(item.name.toString()) ? 'data-i18n="'.concat(item.name, '"') : "", " menu-id=").concat(item.menuId, ">").concat(item.name, "</a>\n ").concat(item.leaf ? "" : '<i class="right-mover layui-icon layui-icon-right" style="right: 0.28rem;"></i>', "</span>\n </li>"));
  4764. }), sidebarLi;
  4765. }(newValue, this.options.isI18n);
  4766. this.$dom.sidebar.empty().append(sidebarLi), this.$dom.rightSidebar.empty().append(sidebarLi);
  4767. var group = function(mapData, isI18n) {
  4768. if (mapData) {
  4769. var index = 0, group = $('<div class="pr-meun-group"></div><div class="pr-meun-group"></div><div class="pr-meun-group"></div>'), treeData = filterData("0", mapData), recursive = function recursive(pid) {
  4770. var str = "";
  4771. return filterData(pid, mapData).forEach(function(ditem) {
  4772. str += '<div class="menu-text">\n <a py-code='.concat(ditem.PY_code, " href=").concat(ditem.hash && ditem.leaf ? "#" + ditem.hash : "javascript:;", "\n parentmenu-id=").concat(ditem.parentMenuId, "\n menu-id=").concat(ditem.menuId, "\n leaf=").concat(ditem.leaf, "\n ").concat(isI18n && i18next.exists(ditem.name.toString()) ? "data-i18n=".concat(ditem.name) : "", ">\n ").concat(ditem.name, "</a>\n </div>"),
  4773. ditem.leaf || (str += recursive(ditem.menuId));
  4774. }), str;
  4775. };
  4776. for (var key in treeData) {
  4777. var ele = '<div class="list-item '.concat(treeData[key].isActive ? "select" : "", '" id=').concat(treeData[key].menuId, ">\n <a py-code=").concat(treeData[key].PY_code, " href=").concat(treeData[key].hash && treeData[key].leaf ? "#" + treeData[key].hash : "javascript:;", " menu-id=").concat(treeData[key].menuId, " ").concat(isI18n && i18next.exists(treeData[key].name.toString()) ? "data-i18n=".concat(treeData[key].name) : "", " parentmenu-id=").concat(treeData[key].parentMenuId, ' class="list-title" leaf=').concat(treeData[key].leaf, ">\n ").concat(treeData[key].name, "</a>");
  4778. ele += recursive(treeData[key].menuId), ele += "</div>", index % 3 == 0 ? group.eq(0).append(ele) : index % 3 == 1 ? group.eq(1).append(ele) : index % 3 == 2 && group.eq(2).append(ele),
  4779. index++;
  4780. }
  4781. return $(group).find(".menu-text>a[leaf='false']").hide(), $(group);
  4782. }
  4783. }(newValue, this.options.isI18n);
  4784. return this.$dom.meungroupList.empty().append(group), this;
  4785. }, plgSidebar.prototype.renderTo = function(domId) {
  4786. return this.options.renderer = domId, $("#" + this.options.renderer).empty().append(this.document),
  4787. this;
  4788. }, window.PlgSideAccordionRoute = plgSidebar, $.fn.initPlgSideAccordion = function(options) {
  4789. return new plgSidebar(this, options);
  4790. };
  4791. }(jQuery);
  4792. "use strict";
  4793. function _typeof(obj) {
  4794. return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  4795. return typeof obj;
  4796. } : function(obj) {
  4797. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  4798. })(obj);
  4799. }
  4800. !function($, layui) {
  4801. layui.use([ "element" ], function() {
  4802. layui.element;
  4803. this._onTab = null, this._onDelete = null;
  4804. var plgTabs = function(options) {
  4805. var _this = this;
  4806. _this.layids = [], _this.preIndex = -1;
  4807. var opt, Items, newObj, config = {
  4808. className: "",
  4809. targetLoading: !0,
  4810. isI18n: window.isI18n || !1,
  4811. time: 100,
  4812. renderer: null,
  4813. filter: "plgTabs-" + Prolog.createRandomId(),
  4814. indexActive: 0,
  4815. activeId: "",
  4816. closeAll: !1,
  4817. skin: "brief",
  4818. fadeIn: !1,
  4819. allowClose: !1,
  4820. content: []
  4821. };
  4822. "object" === _typeof(opt = options) && (_this.opts = $.extend(!0, config, opt),
  4823. "undefined" != typeof i18next && _this.opts.isI18n && 0 < _this.opts.content.length && (_this.opts.content = (Items = _this.opts.content,
  4824. newObj = [], Items.map(function(item, index) {
  4825. return newObj[index] = {}, newObj[index] = Object.assign(item, newObj[index]), "undefined" != typeof i18next && item.title && i18next.exists(item.title.toString()) && (newObj[index].title = i18next.t(item.title)),
  4826. newObj;
  4827. }), newObj)), _this.getElement = function(opts) {
  4828. var itemlist = function(content) {
  4829. if (content) {
  4830. var rp = "", ra = "";
  4831. return content.forEach(function(item, inxex) {
  4832. rp += "<li lay-id = ".concat(item.id, ' class="').concat(opts.indexActive === inxex ? "layui-this" : "", '" >').concat(item.title, "</li>"),
  4833. ra += '<div class="layui-tab-item '.concat(opts.indexActive === inxex ? "layui-show" : "", '" data-fade="">').concat(item.template, "</div>");
  4834. }), {
  4835. title: rp,
  4836. content: ra
  4837. };
  4838. }
  4839. return "";
  4840. };
  4841. itemlist = itemlist(opts.content);
  4842. var closeBtn = '\n\n <ul class="plg-tab-close-all" lay-filter="plg-tab-close-all">\n <div class="plg-tab-close-item">\n <a href="javascript:;" class="layui-icon layui-icon-more"></a>\n <dl class="child">\n <dd><a href="javascript:;" '.concat(opts.isI18n && i18next.exists("关闭其它标签页") ? 'data-i18n="关闭其它标签页"' : "", ' >关闭其它标签页</a></dd>\n <dd><a href="javascript:;" ').concat(opts.isI18n && i18next.exists("关闭其它标签页") ? 'data-i18n="关闭当前标签页"' : "", ' >关闭当前标签页</a></dd>\n <dd><a href="javascript:;" ').concat(opts.isI18n && i18next.exists("关闭所有标签页") ? 'data-i18n="关闭所有标签页"' : "", ">关闭所有标签页</a></dd>\n </dl>\n </li>\n </ul>"), tp = "\n ".concat("plgLayoutTabs" === opts.skin ? '<span class="icon-box"><i class="icon iconfont p-icon-home"></i></span>' : "", '\n <div class="').concat({
  4843. normal: "layui-tab",
  4844. brief: "layui-tab layui-tab-brief",
  4845. card: "layui-tab layui-tab-card",
  4846. plgtabs: "layui-tab layui-tab-brief plgtabs",
  4847. plgLayoutTabs: "layui-tab layui-tab-brief plgtabs plg-layout-tabs"
  4848. }[opts.skin] + " " + opts.className, '" ').concat(opts.allowClose ? 'lay-allowClose="true"' : "", "\n ").concat(opts.filter ? 'lay-filter="' + opts.filter + '"' : "", ">\n ").concat(opts.closeAll ? closeBtn : "", '\n <ul class="layui-tab-title ').concat("plgLayoutTabs" === opts.skin ? "home" : "", '">\n </ul>\n <div class="layui-tab-content"></div>\n </div>');
  4849. return $(tp);
  4850. }(_this.opts), _this.opts.closeAll && (_this.getElement.find(".plg-tab-close-all").hover(function() {
  4851. $(this).find(".child").show();
  4852. }, function() {
  4853. $(this).find(".child").hide();
  4854. }), _this.getElement.find(".plg-tab-close-all .child").on("click", "dd", function(e) {
  4855. e.preventDefault();
  4856. var oa = $(this).index();
  4857. $(this).parents(".plg-tab-close-all").next().children("li").each(function(index, item) {
  4858. var $this = $(item);
  4859. 0 !== $this.index() && ($this.hasClass("layui-this") ? 1 === oa && _this.deleteTabs($this.attr("lay-id")) : 0 === oa && _this.deleteTabs($this.attr("lay-id")),
  4860. 2 === oa && _this.deleteTabs($this.attr("lay-id")));
  4861. }), $(this).parents(".child").hide();
  4862. }))), _this.opts.renderer && _this.renderTo(this.opts.renderer);
  4863. };
  4864. plgTabs.prototype.renderTo = function(ele) {
  4865. var _this = this;
  4866. $("#" + ele).append(this.getElement), this.opts.content.forEach(function(item, index) {
  4867. var yes = !1;
  4868. _this.opts.indexActive === index && (yes = !0), _this.addTabs(item, yes);
  4869. });
  4870. var layid = this.getElement.find(".layui-tab-title > li").eq(_this.opts.indexActive).attr("lay-id");
  4871. return _this.changeTabs(layid), this.element.render("nav"), this.element.render("tab", this.opts.filter),
  4872. this.element.on("tab(".concat(this.opts.filter, ")"), function(data) {
  4873. (_this.activeId = this.getAttribute("lay-id"), _this.activeId) && (_this.layids.find(function(item) {
  4874. return item === _this.activeId;
  4875. }) || _this.layids.push(_this.activeId));
  4876. data.layId = _this.layids[data.index], "function" == typeof _this._onTab && _this._onTab.call(this, data),
  4877. _this.preIndex = data.index;
  4878. }), this.element.on("tabDelete(".concat(this.opts.filter, ")"), function(data) {
  4879. data.id = _this.layids.filter(function(item, index, arr) {
  4880. return item === _this.layids[data.index] && arr.splice(index, 1);
  4881. }), "function" == typeof _this._onDelete && _this._onDelete.call(this, data);
  4882. }), this;
  4883. };
  4884. var pindex = -1;
  4885. plgTabs.prototype.addTabs = function(obj, boole) {
  4886. var closeLoad = PlgDialog.loading2("#".concat(this.opts.renderer, " .layui-tab-content")), str = obj.title.replace(/<[a-zA-z](([\s\S])*?)<\/[a-zA-z]>/gm, ""), title = $("<span ".concat(this.opts.isI18n ? 'data-i18n="'.concat(str, ";[title]").concat(i18next.t(str), '"') : "title=".concat(str), ' class="name" style="vertical-align: top;" >').concat(str, "</span>"));
  4887. title.localize && title.localize(), title = title[0].outerHTML, obj.title = obj.title.replace(str, title);
  4888. var _this = this;
  4889. boole || (boole = null);
  4890. var isChange = boole;
  4891. this.preIndex = this.getElement.find(".layui-tab-title li.layui-this").index();
  4892. var oli = this.getElement.find(".layui-tab-title li"), curLi = Number(oli.length), define = {
  4893. title: '<span class="name">新标题</span>',
  4894. content: "",
  4895. id: "lay-" + Prolog.createRandomId(),
  4896. iframe: !1
  4897. }, opts = $.extend(!0, define, obj);
  4898. function reandTpl(data) {
  4899. try {
  4900. opts.content = data, _this.element.tabAdd(_this.opts.filter, opts), isChange && _this.changeTabs(opts.id);
  4901. } catch (e) {} finally {
  4902. _this.getElement.find(".layui-tab-content .layui-tab-item").attr("data-fade", ""),
  4903. function(titleObj) {
  4904. var count = titleObj.width() - 15, count01 = titleObj.find("li").eq(0).outerWidth(), count02 = titleObj.prev() ? titleObj.prev().outerWidth() : 0, liw = titleObj.find("li").last().outerWidth(), liNum = Math.floor(count - count01 - count02) / liw;
  4905. return Math.floor(liNum);
  4906. }(_this.getElement.find(".layui-tab-title")) - 1 < curLi && oli.eq(1) && _this.deleteTabs(oli.eq(1).attr("lay-id")),
  4907. closeLoad();
  4908. }
  4909. }
  4910. opts.url && !opts.iframe ? Prolog.ajax({
  4911. type: "get",
  4912. url: opts.url,
  4913. dataType: "html",
  4914. success: reandTpl,
  4915. error: function(XMLHttpRequest, textStatus, errorThrown) {
  4916. layer.msg("数据请求失败"), closeLoad();
  4917. }
  4918. }) : (opts.template && !opts.iframe || (opts.template = '<iframe class="plg-iframeClass" frameborder="no" src="'.concat(opts.url, '"></iframe>')),
  4919. reandTpl(opts.template), closeLoad()), _this.preIndex = pindex = _this.getElement.find(".layui-tab-title>.layui-this").index();
  4920. }, plgTabs.prototype.changeTabs = function(layid, callback) {
  4921. var id, eleObj;
  4922. if (/^[0-9]+.?[0-9]*$/.test(layid) ? id = (eleObj = this.getElement.find(".layui-tab-title>li").eq(layid)).attr("lay-id") : (id = layid,
  4923. eleObj = this.getElement.find(".layui-tab-title>li[lay-id='" + id + "']")), pindex = this.getElement.find(".layui-tab-title>.layui-this").index(),
  4924. this.element.tabChange(this.opts.filter, id), this.preIndex = pindex, this.opts.fadeIn) {
  4925. this.getElement.find(".layui-tab-content >.layui-tab-item").attr("data-fade", "");
  4926. var itme = this.getElement.find(".layui-tab-content >.layui-tab-item.layui-show");
  4927. if (itme.index() > this.preIndex) itme.attr("data-fade", "left"); else {
  4928. if (itme.index() == this.preIndex) return !1;
  4929. this.element.tabChange(this.opts.filter, id), itme.attr("data-fade", "right");
  4930. }
  4931. setTimeout(function() {
  4932. itme.attr("data-fade", "");
  4933. }, this.opts.time);
  4934. }
  4935. return "function" == typeof callback && callback(eleObj), this;
  4936. }, plgTabs.prototype.deleteTabs = function(layid) {
  4937. return this.element.tabDelete(this.opts.filter, layid), this;
  4938. }, plgTabs.prototype.element = layui.element, plgTabs.prototype.on = function(callback, eventName) {
  4939. var name = eventName, fun = callback;
  4940. return "string" == typeof callback && (name = callback, fun = eventName), eventName || (name = "tab"),
  4941. "tab" === name ? this._onTab = fun : "tabDelete" === name && (this._onDelete = fun),
  4942. this;
  4943. }, window.PlgTabs = plgTabs, $.fn.initPlgTabs = function(options) {
  4944. var id = $(this).attr("id");
  4945. return new plgTabs(options).renderTo(id);
  4946. };
  4947. });
  4948. }(jQuery, layui);
  4949. "use strict";
  4950. !function($) {
  4951. function PlgTransfer(config) {
  4952. this.options = {
  4953. renderer: ""
  4954. }, config.leftPlane.columns.push({
  4955. id: "op",
  4956. name: "操作",
  4957. type: "button",
  4958. width: 180,
  4959. align: "center",
  4960. render: function(v, d) {
  4961. return config.leftPlane.rowBtn + "^window.transferAddGroup";
  4962. }
  4963. });
  4964. Prolog.createRandomId();
  4965. config.rightPlane.columns.push({
  4966. id: "op",
  4967. name: "操作",
  4968. type: "button",
  4969. width: 180,
  4970. align: "center",
  4971. render: function(v, d) {
  4972. return config.rightPlane.rowBtn + "^window.transferDelGroup";
  4973. }
  4974. }), window.transferAddGroup = function(v, d) {
  4975. this.leftPlane.rowBtnClick && this.leftPlane.rowBtnClick(v, d);
  4976. }.bind(this), window.transferDelGroup = function(v, d) {
  4977. this.rightPlane.rowBtnClick && this.rightPlane.rowBtnClick(v, d);
  4978. }.bind(this);
  4979. return this.leftPlane = {
  4980. title: "",
  4981. toolbar: [],
  4982. columns: null,
  4983. url: "",
  4984. type: "get",
  4985. params: {},
  4986. page: !0,
  4987. totalCount: "totalCount"
  4988. }, this.rightPlane = {
  4989. title: "",
  4990. toolbar: [],
  4991. columns: null,
  4992. url: "",
  4993. type: "get",
  4994. params: {},
  4995. page: !0,
  4996. totalCount: "totalCount"
  4997. }, this.options = $.extend(!0, this.options, config), this.leftPlane = $.extend(!0, this.leftPlane, this.options.leftPlane),
  4998. this.rightPlane = $.extend(!0, this.rightPlane, this.options.rightPlane), this.element = function() {
  4999. var ele = '\n <div class="plg-flex" style="height: calc(100%); overflow: auto;">\n <div id="inputLeft" class="plg-flex-item" style="flex: 1; height: 100%">\n 1\n </div>\n <div class="plg-flex-item" style="height: 100%; flex: 0 0 80px;width:80px;">\n <div class="btnForm">\n <a id="leftPanelBtn" href="javascript:void(0)" class="disable">\n <i class="layui-icon layui-icon-right"></i>\n </a>\n <a id="rightPanelBtn" href="javascript:void(0)" class="disable">\n <i class="layui-icon layui-icon-left"></i>\n </a>\n </div>\n </div>\n <div id="outerRight" class="plg-flex-item" style="flex: 1;height: 100%;">\n 2\n </div>\n </div>';
  5000. ele = $(ele);
  5001. var setPlgPanelConfig = function(plane) {
  5002. return {
  5003. skin: 0,
  5004. className: "flex_panel",
  5005. grid: !0,
  5006. columns: this[plane].columns,
  5007. toolbar: this[plane].toolbar,
  5008. header: {
  5009. isShow: !!this[plane].title,
  5010. title: this[plane].title
  5011. },
  5012. url: this[plane].url,
  5013. type: this[plane].type,
  5014. params: this[plane].params,
  5015. page: this[plane].page,
  5016. totalCount: this[plane].totalCount
  5017. };
  5018. }.bind(this);
  5019. return this.inputLeft = new PlgPanel(setPlgPanelConfig("leftPlane")), this.inputLeft.ids = "",
  5020. this.inputLeft.btn = ele.find("#leftPanelBtn"), this.outerRight = new PlgPanel(setPlgPanelConfig("rightPlane")),
  5021. this.outerRight.ids = "", this.outerRight.btn = ele.find("#rightPanelBtn"), ele;
  5022. }.call(this), this.init(), this;
  5023. }
  5024. function checkIds(object) {
  5025. object.ids = object.grid.getCheckedIds(), object.ids ? object.btn.removeClass("disable") : object.btn.addClass("disable");
  5026. }
  5027. function setEvent(object) {
  5028. var _this = this;
  5029. object.grid.on("onRowSelect", function(rId, ind) {
  5030. return object.grid.setRowSelectCheck(rId), checkIds.call(_this, object), !1;
  5031. }), object.grid.on("onCheck", function(rId, cInd, state) {
  5032. checkIds.call(_this, object);
  5033. }), object.grid.on("onHeaderClick", function(ind, obj) {
  5034. 1 === ind && checkIds.call(_this, object);
  5035. });
  5036. }
  5037. PlgTransfer.prototype.init = function() {
  5038. var _this = this;
  5039. return this.options.renderer && (_this.element.find("#inputLeft").width(_this.element.find("#inputLeft").width()),
  5040. _this.element.find("#outerRight").width(_this.element.find("#outerRight").width()),
  5041. this.renderTo(this.options.renderer), this.inputLeft.renderTo(_this.element.find("#inputLeft")),
  5042. this.outerRight.renderTo(_this.element.find("#outerRight")), setEvent.call(_this, this.inputLeft),
  5043. setEvent.call(_this, this.outerRight), this.inputLeft.btn.click(function() {
  5044. if ($(this).is(".disable")) return !1;
  5045. _this.leftPlane.rowBtnClick && _this.leftPlane.rowBtnClick(_this.inputLeft.ids);
  5046. }), this.outerRight.btn.click(function() {
  5047. if ($(this).is(".disable")) return !1;
  5048. _this.rightPlane.rowBtnClick && _this.rightPlane.rowBtnClick(_this.outerRight.ids);
  5049. })), _this;
  5050. }, PlgTransfer.prototype.getRightPlaneGrid = function() {
  5051. return this.outerRight.grid;
  5052. }, PlgTransfer.prototype.getLeftPlaneGrid = function() {
  5053. return this.inputLeft.grid;
  5054. }, PlgTransfer.prototype.renderTo = function(domId) {
  5055. return "string" == typeof domId && (this.options.renderer = -1 < domId.indexOf(".") ? domId : "#" + domId),
  5056. this.element = $(this.options.renderer).addClass("plg-transfer").empty().append(this.element),
  5057. this;
  5058. }, window.PlgTransfer = PlgTransfer;
  5059. }(jQuery);
  5060. "use strict";
  5061. function _typeof(obj) {
  5062. return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  5063. return typeof obj;
  5064. } : function(obj) {
  5065. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  5066. })(obj);
  5067. }
  5068. !function($) {
  5069. var tree = $.fn.zTree;
  5070. var plgZtree = function(ele, options) {
  5071. var opt, opts, close, obj, _this = this, config = {
  5072. initAjax: null,
  5073. skin: "",
  5074. toolBar: !1,
  5075. toolBar2: {
  5076. isShow: !1,
  5077. btn: null
  5078. },
  5079. renderer: null,
  5080. setData: null,
  5081. isExpand: !1,
  5082. setting: {
  5083. treeId: Prolog.createRandomId(),
  5084. view: {
  5085. selectedMulti: !1
  5086. },
  5087. data: {
  5088. key: {
  5089. title: "name"
  5090. },
  5091. simpleData: {
  5092. enable: !0,
  5093. idKey: "menuId",
  5094. pIdKey: "parentMenuId",
  5095. rootPId: "0",
  5096. id: "id"
  5097. }
  5098. },
  5099. callback: {}
  5100. }
  5101. };
  5102. 1 === arguments.length ? "object" === _typeof(opt = arguments[0]) && (_this.opts = $.extend(!0, config, opt),
  5103. opt.setting && opt.setting.callback && "function" == typeof opt.setting.callback.onExpand && (_this.opts.setting.callback.onExpand = function(event, treeId, treeNode) {
  5104. (function(event, treeId, treeNode) {
  5105. if (!treeNode.tId) {
  5106. var obj = this.getZTreeObj(treeId), NOdes = obj.getNodes();
  5107. for (var key in NOdes) {
  5108. var td = NOdes[key];
  5109. td.tId != treeNode.tId ? obj.expandNode(td, !1, !1, !1) : obj.expandNode(td, !0);
  5110. }
  5111. }
  5112. }).bind(_this)(event, treeId, treeNode), opt.setting.callback.onExpand.call(_this, event, treeId, treeNode);
  5113. }), !_this.opts.setDate && _this.opts.initAjax && (_this.opts.setData = (opts = _this.opts.initAjax,
  5114. close = Prolog.loading2(), obj = {}, opts.success = function(res) {
  5115. res.success ? obj = res.data.map(function(item) {
  5116. return item.isParent = !0, item;
  5117. }) : layer.msg("数据加载失败!"), close();
  5118. }, opts.error = function() {
  5119. close();
  5120. }, Prolog.syncAjax(opts), obj))) : 2 === arguments.length && (ele = arguments[0],
  5121. opt = options), _this.opts.renderer && _this.renderTo(this.opts.renderer), setTimeout(window.onresize = function() {
  5122. var pObj = $("#" + _this.opts.renderer), toolbarBtnHeight = 0;
  5123. _this.toolbarBtn2 && (toolbarBtnHeight = _this.toolbarBtn2.height());
  5124. var parentHeight = parseInt(pObj.parent().height() - toolbarBtnHeight);
  5125. pObj.find(".ztree").css({
  5126. width: "100%",
  5127. height: parentHeight,
  5128. "overflow-y": "auto",
  5129. "pading-bottom": "20px"
  5130. });
  5131. }, 0);
  5132. };
  5133. for (var key in tree) plgZtree.prototype[key] = tree[key];
  5134. plgZtree.prototype.renderTo = function(ele) {
  5135. $("#" + ele).empty();
  5136. this.opts.skin && $("#" + ele).addClass(this.opts.skin);
  5137. var objUl = $("<ul>", {
  5138. class: "ztree",
  5139. id: this.opts.setting.treeId
  5140. });
  5141. return this.treeObj = this.init(objUl, this.opts.setting, this.opts.setData), this.opts.isExpand && this.treeObj.expandNode(this.treeObj.getNodes()[0], !0, !1, !0, !0),
  5142. this.opts.toolBar && (this.toolbarBtn = $('\n\n <div class="toolbar layui-row layui-col-space10 cl">\n\n\n <div class="layui-col-md4">\n <a class="layui-btn layui-btn-primary" href="javascript:void(0)">\n <i class="layui-icon layui-icon-delete"></i>删除\n </a>\n </div>\n <div class="layui-col-md4">\n \n <a class="layui-btn layui-btn-primary" href="javascript:void(0)" >\n <i class="layui-icon layui-icon-edit"></i>编辑</a>\n </div>\n <div class="layui-col-md4">\n \n <a class="layui-btn layui-btn-normal" href="javascript:void(0)">\n <i class="layui-icon layui-icon-add-1"></i>增加\n </a>\n </div>\n \n </div>\n \n \n \n \n '),
  5143. $("#" + ele).append(this.toolbarBtn)), this.opts.toolBar2.isShow && this.opts.toolBar2.btn && 0 < this.opts.toolBar2.btn.length && (this.toolbarBtn2 = function(_this) {
  5144. var obj = _this.opts.toolBar2.btn, btn = $('\n <div class="toolbar layui-row layui-col-space10 cl">\n '.concat(obj.map(function(item) {
  5145. return '<div class="hook layui-col-md'.concat(12 / obj.length, '">\n <a class="layui-btn ').concat(item.skin ? item.skin : "", '" href="javascript:void(0)">\n <i class="').concat(item.icon, '"></i>').concat(item.text, "</a>\n </div>");
  5146. }).join(""), " \n \n </div>")), zTree = _this.treeObj;
  5147. return obj.forEach(function(item, index) {
  5148. btn.find(".hook").eq(index).find("a").click(function(event) {
  5149. var treeNode = zTree.getSelectedNodes();
  5150. item.EventCallback && item.EventCallback(event, zTree, treeNode);
  5151. });
  5152. }), btn;
  5153. }(this), $("#" + ele).append(this.toolbarBtn2)), $("#" + ele).append(objUl), this;
  5154. };
  5155. Prolog.createRandomId(), Prolog.createRandomId();
  5156. window.PlgZtree = plgZtree;
  5157. }(jQuery);
  5158. "use strict";
  5159. window.onload = function() {
  5160. var userAgent, isIE, isIE11;
  5161. userAgent = navigator.userAgent, isIE = -1 < userAgent.indexOf("compatible") && -1 < userAgent.indexOf("MSIE"),
  5162. userAgent.indexOf("Edge"), isIE11 = -1 < userAgent.indexOf("Trident") && -1 < userAgent.indexOf("rv:11.0"),
  5163. (isIE || isIE11) && (document.getElementsByTagName("body")[0].innerHTML = [ '<div class="ieReg">\n <div class="banler">\n <div class="ie_content">\n <div class="header_title">尊敬的用户:您当前浏览器版本过低,本站功能可能无法正常浏览</div>\n\n <div class="topbar">推荐使用以下几种浏览器达到最佳效果</div>\n <ul class="bro_list">\n <li><i class="chrome"></i>\n <p>谷歌浏览器</p>\n </li>\n <li><i class="fires"></i>\n <p>火狐浏览器</p>\n </li>\n <li><i class="Safari"></i>\n <p>Safari苹果浏览器</p>\n </li>\n <li><i class="Edge"></i>\n <p>Microsoft Edge</p>\n </li>\n </ul>\n\n <div class="topbar">如360、QQ、极速浏览器等,请使用极速模式运行!</div>\n <div class="n_2"></div>\n\n\n\n </div>\n </div>\n \n </div>' ].join(""));
  5164. };
  5165. "use strict";
  5166. function _typeof(obj) {
  5167. return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  5168. return typeof obj;
  5169. } : function(obj) {
  5170. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  5171. })(obj);
  5172. }
  5173. layui.define("form", function(exports) {
  5174. var $ = layui.$, form = layui.form, hint = layui.hint(), MOD_NAME = "selectPlus", SELECT = "layui-form-select", SELECTED = "layui-form-selected", selectPlus = {
  5175. index: layui.selectPlus ? layui.selectPlus.index : 0,
  5176. set: function(options) {
  5177. return this.config = $.extend({}, this.config, options), this;
  5178. },
  5179. on: function(events, callback) {
  5180. return layui.onevent.call(this, MOD_NAME, events, callback);
  5181. }
  5182. }, Class = function(options) {
  5183. this.index = ++selectPlus.index, this.config = $.extend({}, this.config, selectPlus.config, options),
  5184. this.render();
  5185. }, renderInputTags = function(el, data) {
  5186. var temStr = "";
  5187. data.forEach(function(val) {
  5188. temStr += "<span>\n <em>".concat(val, '</em>\n <button type="button" class="close">×</button>\n </span>');
  5189. }), $(el).siblings(".plg-select-tags").html(temStr);
  5190. };
  5191. Class.prototype.config = {
  5192. type: "checkbox",
  5193. valueSeparator: "/",
  5194. labelSeparator: " --- ",
  5195. data: [],
  5196. valueName: "title",
  5197. label: [],
  5198. values: [],
  5199. url: "",
  5200. method: "get",
  5201. where: "",
  5202. contentType: "",
  5203. headers: "",
  5204. response: "data",
  5205. parseData: null,
  5206. config: {
  5207. checkedName: "SELECTPLUS_CHECKED",
  5208. indexName: "SELECTPLUS_INDEX"
  5209. },
  5210. error: ""
  5211. }, Class.prototype.render = function() {
  5212. var options = this.config;
  5213. "string" == typeof options.el ? options.el = $(options.el) : options.el, options.reElem = $('<div class="layui-unselect layui-form-select"><div class="layui-select-title"><input type="text" placeholder="请选择" value="" readonly="" class="layui-input layui-unselect" style="color: transparent;"><i class="layui-edge"></i></div><dl class="layui-anim layui-anim-upbit"><dd lay-value="" class="layui-select-tips layui-hide">请选择</dd></dl></div>'),
  5214. options.reElem.find(".layui-select-title").on("click", function(e) {
  5215. !$(this).parent().hasClass(SELECTED) && $(document).find("." + SELECT).removeClass(SELECTED),
  5216. $(this).parent().toggleClass(SELECTED);
  5217. }), $(document).on("click", function(e) {
  5218. $(e.target).parents("." + SELECT).length <= 0 && options.reElem.hasClass(SELECTED) && options.reElem.removeClass(SELECTED);
  5219. }), !Array.isArray(options.values) && (options.values = [ options.values ]), options.filter = options.el.parents(".layui-form").attr("lay-filter"),
  5220. options.el.append(options.reElem), options.url ? this.pullData() : this.renderData(),
  5221. options.el.on("click", ".layui-select-title", function() {
  5222. var $title = $(this), $dd0 = $title.next().find("dd").eq(0);
  5223. $dd0.hasClass("layui-hide") || $dd0.addClass("layui-hide"), $title.find("input").val(options.values.join(options.valueSeparator));
  5224. });
  5225. }, Class.prototype.pullData = function() {
  5226. var that = this, options = that.config;
  5227. $.ajax({
  5228. type: options.method || "get",
  5229. url: options.url,
  5230. contentType: options.contentType,
  5231. data: options.where || {},
  5232. dataType: "json",
  5233. headers: options.headers || {},
  5234. success: function(res) {
  5235. "function" == typeof options.parseData && (res = options.parseData(res) || res[options.response]),
  5236. Array.isArray(res) ? (options.data = that.formatData(res), options.error = "", that.renderData()) : options.error = "数据格式不对";
  5237. },
  5238. error: function(e, m) {
  5239. options.error = "数据接口请求异常:" + m;
  5240. }
  5241. });
  5242. }, Class.prototype.formatData = function(data) {
  5243. var options = this.config, valueName = options.valueName, values = options.values, checkedName = options.config.checkedName, indexName = options.config.indexName;
  5244. return layui.each(data, function(i, item) {
  5245. "object" !== _typeof(item) && (data[i] = {
  5246. title: item
  5247. }), data[i][indexName] = i, data[i][checkedName] || (data[i][checkedName] = !1),
  5248. layui.each(values, function(index, value) {
  5249. data[i][valueName] === value && (data[i][checkedName] = !0);
  5250. });
  5251. }), values.splice(0), data;
  5252. }, Class.prototype.renderData = function(data) {
  5253. var options = this.config, type = options.type, id = this.index, items = (data = data ? this.formatData(data) : this.formatData(options.data),
  5254. {
  5255. checkbox: function(config, data, id) {
  5256. var CLASSNAME = "layui-form-checkbox", CHECKED = "layui-form-checked", el = config.reElem.find("dl"), valueName = config.valueName, checkedName = config.config.checkedName, indexName = config.config.indexName, values = config.values, label = config.label, filter = config.filter, labelSeparator = config.labelSeparator, valueSeparator = config.valueSeparator, sum = 0;
  5257. el.append($('<dd lay-value="全选"></dd>')), layui.each(data, function(i, item) {
  5258. el.append($('<dd lay-value="' + item[valueName] + '"></dd>'));
  5259. });
  5260. var allEle = el.find("dd").eq(1);
  5261. allEle.nextAll().each(function(index) {
  5262. var $dd = $(this), item = data[index], layuiValue = item[valueName], title = layuiValue;
  5263. 0 < label.length && (title = "", layui.each(label, function(i, n) {
  5264. title += item[n], i < label.length - 1 && (title += labelSeparator);
  5265. }));
  5266. var checkbox = $('<input type="checkbox" name="selectPluscheckbox' + id + '" yw-index="' + item[indexName] + '" lay-skin="primary" title="' + title + '" layui-value="' + layuiValue + '">');
  5267. item[checkedName] && (checkbox.prop("checked", !0), values.push(layuiValue), sum++),
  5268. $dd.html(checkbox);
  5269. });
  5270. var allcheckbox = $('<input type="checkbox" selectplus-all lay-skin="primary" title="全选" layui-value="全选">');
  5271. sum === data.length && allcheckbox.prop("checked", !0), allEle.html(allcheckbox),
  5272. renderInputTags(config.el, values), allEle.parent().prev().find("input").val(values.join(valueSeparator)),
  5273. allEle.on("click", function(event) {
  5274. var $all = $(this), checked = "DD" === event.target.nodeName ? $all.find("." + CLASSNAME).toggleClass(CHECKED).hasClass(CHECKED) : $all.find("input").prop("checked");
  5275. $all.parents("." + SELECT).addClass(SELECTED), $all.find("input").prop("checked", checked),
  5276. $all.nextAll().each(function() {
  5277. var dd = $(this);
  5278. checked ? dd.find("." + CLASSNAME).addClass(CHECKED) : dd.find("." + CLASSNAME).removeClass(CHECKED),
  5279. dd.find("input").prop("checked", checked);
  5280. }), layui.event.call($all, MOD_NAME, "checkbox(selectPlus)", {
  5281. type: "checkbox",
  5282. ele: $all,
  5283. eleChecked: checked,
  5284. isAll: checked
  5285. });
  5286. }), config.el.siblings(".plg-select-tags").on("click", ".close", function(e) {
  5287. var currentHtml = $(this).siblings("em").html();
  5288. Array.prototype.slice.call(allEle.nextAll()).forEach(function(val, ind) {
  5289. val.innerText === currentHtml && el.find("dd").eq(ind + 2).off().on("click", function(event) {
  5290. if ($(this).index() === ind + 2) {
  5291. var $dd = $(this), checked = "DD" === event.target.nodeName ? $dd.find("." + CLASSNAME).toggleClass(CHECKED).hasClass(CHECKED) : $dd.find("input").prop("checked");
  5292. $dd.parents("." + SELECT).addClass(SELECTED), $dd.find("input").prop("checked", checked);
  5293. var $all = $dd.parents("dl").find("dd").eq(1), $dds = $all.nextAll(), sum = 0;
  5294. $dds.each(function() {
  5295. $(this).find("input").prop("checked") && sum++;
  5296. }), sum === $dds.length ? ($all.find("input").prop("checked", !0), $all.find("." + CLASSNAME).addClass(CHECKED)) : ($all.find("input").prop("checked", !1),
  5297. $all.find("." + CLASSNAME).removeClass(CHECKED)), layui.event.call($all, MOD_NAME, "checkbox(selectPlus)", {
  5298. type: "checkbox",
  5299. ele: $dd,
  5300. eleChecked: checked,
  5301. isAll: sum === $dds.length
  5302. });
  5303. }
  5304. }).trigger("click");
  5305. });
  5306. }), allEle.nextAll().on("click", function(e) {
  5307. var $dd = $(this), checked = "DD" === event.target.nodeName ? $dd.find("." + CLASSNAME).toggleClass(CHECKED).hasClass(CHECKED) : $dd.find("input").prop("checked");
  5308. $dd.parents("." + SELECT).addClass(SELECTED), $dd.find("input").prop("checked", checked);
  5309. var $all = $dd.parents("dl").find("dd").eq(1), $dds = $all.nextAll(), sum = 0;
  5310. $dds.each(function() {
  5311. $(this).find("input").prop("checked") && sum++;
  5312. }), sum === $dds.length ? ($all.find("input").prop("checked", !0), $all.find("." + CLASSNAME).addClass(CHECKED)) : ($all.find("input").prop("checked", !1),
  5313. $all.find("." + CLASSNAME).removeClass(CHECKED)), layui.event.call($all, MOD_NAME, "checkbox(selectPlus)", {
  5314. type: "checkbox",
  5315. ele: $dd,
  5316. eleChecked: checked,
  5317. isAll: sum === $dds.length
  5318. });
  5319. }), form.render("checkbox", filter);
  5320. },
  5321. radio: function(config, data, id) {
  5322. var ICON = [ "&#xe643;", "&#xe63f;" ], el = (config.el, config.reElem.find("dl")), valueName = config.valueName, checkedName = config.config.checkedName, indexName = config.config.indexName, checkedData = data.filter(function(item) {
  5323. return !0 === item[checkedName];
  5324. }), values = config.values, label = config.label, filter = config.filter, labelSeparator = config.labelSeparator, valueSeparator = config.valueSeparator;
  5325. layui.each(data, function(i, item) {
  5326. el.append('<dd lay-value="' + item[valueName] + '"></dd>');
  5327. }), form.render("select", options.filter), el.find("dd").eq(0).nextAll().each(function(index) {
  5328. var $dd = $(this), item = data[index], layuiValue = item[valueName], title = layuiValue;
  5329. 0 < label.length && (title = "", layui.each(label, function(i, n) {
  5330. title += item[n], i < label.length - 1 && (title += labelSeparator);
  5331. }));
  5332. var dd = $('<input type="radio" name="selectPlusradio' + id + '" yw-index="' + item[indexName] + '" lay-skin="primary" title="' + title + '" layui-value="' + layuiValue + '">');
  5333. 0 < checkedData.length && checkedData[0][indexName] === item[indexName] && (dd.prop("checked", !0),
  5334. values.push(layuiValue), $dd.parent().prev().find("input").val(values.join(valueSeparator))),
  5335. $dd.html(dd);
  5336. }), form.render("radio", filter), el.find("dd").on("click", function(event) {
  5337. var $dd = $(this);
  5338. $dd.find(".layui-form-radio").addClass("layui-form-radioed").find("i").addClass("layui-anim-scaleSpring").html(ICON[0]),
  5339. $dd.find("input").prop("checked", !0), $dd.siblings().find(".layui-form-radio").removeClass("layui-form-radioed").find("i").removeClass("layui-anim-scaleSpring").html(ICON[1]),
  5340. $dd.siblings().find("input").prop("checked", !1), layui.event.call($dd, MOD_NAME, "radio(selectPlus)", {
  5341. type: "radio",
  5342. ele: $dd,
  5343. eleChecked: !0,
  5344. isAll: !1
  5345. });
  5346. });
  5347. }
  5348. });
  5349. layui.onevent.call(this, MOD_NAME, type + "(" + MOD_NAME + ")", this.checked.bind(this)),
  5350. items[type] ? items[type](options, data, id) : hint.error("不支持的" + type + "表单渲染");
  5351. }, Class.prototype.checked = function(res) {
  5352. var options = this.config, data = options.data, checkedName = options.config.checkedName, type = res.type, isAll = res.isAll, ele = res.ele, eleChecked = res.eleChecked, filter = options.el.attr("lay-filter");
  5353. if ("checkbox" === type) options.values = [], ele.parents("dl").find('[type="checkbox"]').each(function(i) {
  5354. var $dd = $(this), ywIndex = $dd.attr("yw-index"), checked = $dd.prop("checked");
  5355. ywIndex && (data[ywIndex][checkedName] = checked), checked && ywIndex && options.values.push($dd.attr("layui-value"));
  5356. }), renderInputTags(options.el, options.values), ele.parent().prev().find("input").val(options.values.join(options.valueSeparator)),
  5357. layui.event.call(ele, MOD_NAME, MOD_NAME + "(" + filter + ")", {
  5358. checked: eleChecked,
  5359. isAll: isAll,
  5360. values: options.values,
  5361. checkedData: data.filter(function(item) {
  5362. return !0 === item[checkedName];
  5363. }),
  5364. ele: ele
  5365. }); else if ("radio" === type) {
  5366. var index = ele.find("input").attr("yw-index"), value = ele.find("input").attr("layui-value");
  5367. options.values = [ value ], ele.parent().prev().find("input").val(value), layui.each(data, function(i, item) {
  5368. item[checkedName] = !1;
  5369. }), data[index][checkedName] = !0, layui.event.call(ele, MOD_NAME, MOD_NAME + "(" + filter + ")", {
  5370. value: value,
  5371. checkedData: data[index],
  5372. ele: ele
  5373. });
  5374. }
  5375. }, Class.prototype.getChecked = function() {
  5376. var options = this.config, data = options.data, checkedName = options.config.checkedName;
  5377. return {
  5378. values: options.values,
  5379. data: data.filter(function(item) {
  5380. return !0 === item[checkedName];
  5381. })
  5382. };
  5383. }, selectPlus.render = function(options, tagsContainer) {
  5384. var ins = new Class(options, tagsContainer);
  5385. return function() {
  5386. var that = this;
  5387. return {
  5388. getChecked: function() {
  5389. return that.getChecked.call(that);
  5390. },
  5391. config: that.config
  5392. };
  5393. }.call(ins);
  5394. }, exports("selectPlus", selectPlus);
  5395. });