vendor.js 825 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!************************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  5. \************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. /* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 3);
  10. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 4));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  11. var realAtob;
  12. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  13. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  14. if (typeof atob !== 'function') {
  15. realAtob = function realAtob(str) {
  16. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  17. if (!b64re.test(str)) {throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");}
  18. // Adding the padding if missing, for semplicity
  19. str += '=='.slice(2 - (str.length & 3));
  20. var bitmap;var result = '';var r1;var r2;var i = 0;
  21. for (; i < str.length;) {
  22. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 |
  23. (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  24. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
  25. r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
  26. String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  27. }
  28. return result;
  29. };
  30. } else {
  31. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  32. realAtob = atob;
  33. }
  34. function b64DecodeUnicode(str) {
  35. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  36. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  37. }).join(''));
  38. }
  39. function getCurrentUserInfo() {
  40. var token = wx.getStorageSync('uni_id_token') || '';
  41. var tokenArr = token.split('.');
  42. if (!token || tokenArr.length !== 3) {
  43. return {
  44. uid: null,
  45. role: [],
  46. permission: [],
  47. tokenExpired: 0 };
  48. }
  49. var userInfo;
  50. try {
  51. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  52. } catch (error) {
  53. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  54. }
  55. userInfo.tokenExpired = userInfo.exp * 1000;
  56. delete userInfo.exp;
  57. delete userInfo.iat;
  58. return userInfo;
  59. }
  60. function uniIdMixin(Vue) {
  61. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  62. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  63. return role.indexOf(roleId) > -1;
  64. };
  65. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  66. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  67. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  68. };
  69. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  70. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  71. return tokenExpired > Date.now();
  72. };
  73. }
  74. var _toString = Object.prototype.toString;
  75. var hasOwnProperty = Object.prototype.hasOwnProperty;
  76. function isFn(fn) {
  77. return typeof fn === 'function';
  78. }
  79. function isStr(str) {
  80. return typeof str === 'string';
  81. }
  82. function isPlainObject(obj) {
  83. return _toString.call(obj) === '[object Object]';
  84. }
  85. function hasOwn(obj, key) {
  86. return hasOwnProperty.call(obj, key);
  87. }
  88. function noop() {}
  89. /**
  90. * Create a cached version of a pure function.
  91. */
  92. function cached(fn) {
  93. var cache = Object.create(null);
  94. return function cachedFn(str) {
  95. var hit = cache[str];
  96. return hit || (cache[str] = fn(str));
  97. };
  98. }
  99. /**
  100. * Camelize a hyphen-delimited string.
  101. */
  102. var camelizeRE = /-(\w)/g;
  103. var camelize = cached(function (str) {
  104. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  105. });
  106. function sortObject(obj) {
  107. var sortObj = {};
  108. if (isPlainObject(obj)) {
  109. Object.keys(obj).sort().forEach(function (key) {
  110. sortObj[key] = obj[key];
  111. });
  112. }
  113. return !Object.keys(sortObj) ? obj : sortObj;
  114. }
  115. var HOOKS = [
  116. 'invoke',
  117. 'success',
  118. 'fail',
  119. 'complete',
  120. 'returnValue'];
  121. var globalInterceptors = {};
  122. var scopedInterceptors = {};
  123. function mergeHook(parentVal, childVal) {
  124. var res = childVal ?
  125. parentVal ?
  126. parentVal.concat(childVal) :
  127. Array.isArray(childVal) ?
  128. childVal : [childVal] :
  129. parentVal;
  130. return res ?
  131. dedupeHooks(res) :
  132. res;
  133. }
  134. function dedupeHooks(hooks) {
  135. var res = [];
  136. for (var i = 0; i < hooks.length; i++) {
  137. if (res.indexOf(hooks[i]) === -1) {
  138. res.push(hooks[i]);
  139. }
  140. }
  141. return res;
  142. }
  143. function removeHook(hooks, hook) {
  144. var index = hooks.indexOf(hook);
  145. if (index !== -1) {
  146. hooks.splice(index, 1);
  147. }
  148. }
  149. function mergeInterceptorHook(interceptor, option) {
  150. Object.keys(option).forEach(function (hook) {
  151. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  152. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  153. }
  154. });
  155. }
  156. function removeInterceptorHook(interceptor, option) {
  157. if (!interceptor || !option) {
  158. return;
  159. }
  160. Object.keys(option).forEach(function (hook) {
  161. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  162. removeHook(interceptor[hook], option[hook]);
  163. }
  164. });
  165. }
  166. function addInterceptor(method, option) {
  167. if (typeof method === 'string' && isPlainObject(option)) {
  168. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  169. } else if (isPlainObject(method)) {
  170. mergeInterceptorHook(globalInterceptors, method);
  171. }
  172. }
  173. function removeInterceptor(method, option) {
  174. if (typeof method === 'string') {
  175. if (isPlainObject(option)) {
  176. removeInterceptorHook(scopedInterceptors[method], option);
  177. } else {
  178. delete scopedInterceptors[method];
  179. }
  180. } else if (isPlainObject(method)) {
  181. removeInterceptorHook(globalInterceptors, method);
  182. }
  183. }
  184. function wrapperHook(hook) {
  185. return function (data) {
  186. return hook(data) || data;
  187. };
  188. }
  189. function isPromise(obj) {
  190. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  191. }
  192. function queue(hooks, data) {
  193. var promise = false;
  194. for (var i = 0; i < hooks.length; i++) {
  195. var hook = hooks[i];
  196. if (promise) {
  197. promise = Promise.resolve(wrapperHook(hook));
  198. } else {
  199. var res = hook(data);
  200. if (isPromise(res)) {
  201. promise = Promise.resolve(res);
  202. }
  203. if (res === false) {
  204. return {
  205. then: function then() {} };
  206. }
  207. }
  208. }
  209. return promise || {
  210. then: function then(callback) {
  211. return callback(data);
  212. } };
  213. }
  214. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  215. ['success', 'fail', 'complete'].forEach(function (name) {
  216. if (Array.isArray(interceptor[name])) {
  217. var oldCallback = options[name];
  218. options[name] = function callbackInterceptor(res) {
  219. queue(interceptor[name], res).then(function (res) {
  220. /* eslint-disable no-mixed-operators */
  221. return isFn(oldCallback) && oldCallback(res) || res;
  222. });
  223. };
  224. }
  225. });
  226. return options;
  227. }
  228. function wrapperReturnValue(method, returnValue) {
  229. var returnValueHooks = [];
  230. if (Array.isArray(globalInterceptors.returnValue)) {
  231. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  232. }
  233. var interceptor = scopedInterceptors[method];
  234. if (interceptor && Array.isArray(interceptor.returnValue)) {
  235. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  236. }
  237. returnValueHooks.forEach(function (hook) {
  238. returnValue = hook(returnValue) || returnValue;
  239. });
  240. return returnValue;
  241. }
  242. function getApiInterceptorHooks(method) {
  243. var interceptor = Object.create(null);
  244. Object.keys(globalInterceptors).forEach(function (hook) {
  245. if (hook !== 'returnValue') {
  246. interceptor[hook] = globalInterceptors[hook].slice();
  247. }
  248. });
  249. var scopedInterceptor = scopedInterceptors[method];
  250. if (scopedInterceptor) {
  251. Object.keys(scopedInterceptor).forEach(function (hook) {
  252. if (hook !== 'returnValue') {
  253. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  254. }
  255. });
  256. }
  257. return interceptor;
  258. }
  259. function invokeApi(method, api, options) {for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {params[_key - 3] = arguments[_key];}
  260. var interceptor = getApiInterceptorHooks(method);
  261. if (interceptor && Object.keys(interceptor).length) {
  262. if (Array.isArray(interceptor.invoke)) {
  263. var res = queue(interceptor.invoke, options);
  264. return res.then(function (options) {
  265. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  266. });
  267. } else {
  268. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  269. }
  270. }
  271. return api.apply(void 0, [options].concat(params));
  272. }
  273. var promiseInterceptor = {
  274. returnValue: function returnValue(res) {
  275. if (!isPromise(res)) {
  276. return res;
  277. }
  278. return new Promise(function (resolve, reject) {
  279. res.then(function (res) {
  280. if (res[0]) {
  281. reject(res[0]);
  282. } else {
  283. resolve(res[1]);
  284. }
  285. });
  286. });
  287. } };
  288. var SYNC_API_RE =
  289. /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting/;
  290. var CONTEXT_API_RE = /^create|Manager$/;
  291. // Context例外情况
  292. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  293. // 同步例外情况
  294. var ASYNC_API = ['createBLEConnection'];
  295. var CALLBACK_API_RE = /^on|^off/;
  296. function isContextApi(name) {
  297. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  298. }
  299. function isSyncApi(name) {
  300. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  301. }
  302. function isCallbackApi(name) {
  303. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  304. }
  305. function handlePromise(promise) {
  306. return promise.then(function (data) {
  307. return [null, data];
  308. }).
  309. catch(function (err) {return [err];});
  310. }
  311. function shouldPromise(name) {
  312. if (
  313. isContextApi(name) ||
  314. isSyncApi(name) ||
  315. isCallbackApi(name))
  316. {
  317. return false;
  318. }
  319. return true;
  320. }
  321. /* eslint-disable no-extend-native */
  322. if (!Promise.prototype.finally) {
  323. Promise.prototype.finally = function (callback) {
  324. var promise = this.constructor;
  325. return this.then(
  326. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  327. function (reason) {return promise.resolve(callback()).then(function () {
  328. throw reason;
  329. });});
  330. };
  331. }
  332. function promisify(name, api) {
  333. if (!shouldPromise(name)) {
  334. return api;
  335. }
  336. return function promiseApi() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {params[_key2 - 1] = arguments[_key2];}
  337. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  338. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  339. }
  340. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  341. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  342. success: resolve,
  343. fail: reject })].concat(
  344. params));
  345. })));
  346. };
  347. }
  348. var EPS = 1e-4;
  349. var BASE_DEVICE_WIDTH = 750;
  350. var isIOS = false;
  351. var deviceWidth = 0;
  352. var deviceDPR = 0;
  353. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  354. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  355. deviceWidth = windowWidth;
  356. deviceDPR = pixelRatio;
  357. isIOS = platform === 'ios';
  358. }
  359. function upx2px(number, newDeviceWidth) {
  360. if (deviceWidth === 0) {
  361. checkDeviceWidth();
  362. }
  363. number = Number(number);
  364. if (number === 0) {
  365. return 0;
  366. }
  367. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  368. if (result < 0) {
  369. result = -result;
  370. }
  371. result = Math.floor(result + EPS);
  372. if (result === 0) {
  373. if (deviceDPR === 1 || !isIOS) {
  374. result = 1;
  375. } else {
  376. result = 0.5;
  377. }
  378. }
  379. return number < 0 ? -result : result;
  380. }
  381. var LOCALE_ZH_HANS = 'zh-Hans';
  382. var LOCALE_ZH_HANT = 'zh-Hant';
  383. var LOCALE_EN = 'en';
  384. var LOCALE_FR = 'fr';
  385. var LOCALE_ES = 'es';
  386. var messages = {};
  387. var locale;
  388. {
  389. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  390. }
  391. function initI18nMessages() {
  392. if (!isEnableLocale()) {
  393. return;
  394. }
  395. var localeKeys = Object.keys(__uniConfig.locales);
  396. if (localeKeys.length) {
  397. localeKeys.forEach(function (locale) {
  398. var curMessages = messages[locale];
  399. var userMessages = __uniConfig.locales[locale];
  400. if (curMessages) {
  401. Object.assign(curMessages, userMessages);
  402. } else {
  403. messages[locale] = userMessages;
  404. }
  405. });
  406. }
  407. }
  408. initI18nMessages();
  409. var i18n = (0, _uniI18n.initVueI18n)(
  410. locale,
  411. {});
  412. var t = i18n.t;
  413. var i18nMixin = i18n.mixin = {
  414. beforeCreate: function beforeCreate() {var _this = this;
  415. var unwatch = i18n.i18n.watchLocale(function () {
  416. _this.$forceUpdate();
  417. });
  418. this.$once('hook:beforeDestroy', function () {
  419. unwatch();
  420. });
  421. },
  422. methods: {
  423. $$t: function $$t(key, values) {
  424. return t(key, values);
  425. } } };
  426. var setLocale = i18n.setLocale;
  427. var getLocale = i18n.getLocale;
  428. function initAppLocale(Vue, appVm, locale) {
  429. var state = Vue.observable({
  430. locale: locale || i18n.getLocale() });
  431. var localeWatchers = [];
  432. appVm.$watchLocale = function (fn) {
  433. localeWatchers.push(fn);
  434. };
  435. Object.defineProperty(appVm, '$locale', {
  436. get: function get() {
  437. return state.locale;
  438. },
  439. set: function set(v) {
  440. state.locale = v;
  441. localeWatchers.forEach(function (watch) {return watch(v);});
  442. } });
  443. }
  444. function isEnableLocale() {
  445. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  446. }
  447. function include(str, parts) {
  448. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  449. }
  450. function startsWith(str, parts) {
  451. return parts.find(function (part) {return str.indexOf(part) === 0;});
  452. }
  453. function normalizeLocale(locale, messages) {
  454. if (!locale) {
  455. return;
  456. }
  457. locale = locale.trim().replace(/_/g, '-');
  458. if (messages && messages[locale]) {
  459. return locale;
  460. }
  461. locale = locale.toLowerCase();
  462. if (locale === 'chinese') {
  463. // 支付宝
  464. return LOCALE_ZH_HANS;
  465. }
  466. if (locale.indexOf('zh') === 0) {
  467. if (locale.indexOf('-hans') > -1) {
  468. return LOCALE_ZH_HANS;
  469. }
  470. if (locale.indexOf('-hant') > -1) {
  471. return LOCALE_ZH_HANT;
  472. }
  473. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  474. return LOCALE_ZH_HANT;
  475. }
  476. return LOCALE_ZH_HANS;
  477. }
  478. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  479. if (lang) {
  480. return lang;
  481. }
  482. }
  483. // export function initI18n() {
  484. // const localeKeys = Object.keys(__uniConfig.locales || {})
  485. // if (localeKeys.length) {
  486. // localeKeys.forEach((locale) =>
  487. // i18n.add(locale, __uniConfig.locales[locale])
  488. // )
  489. // }
  490. // }
  491. function getLocale$1() {
  492. // 优先使用 $locale
  493. var app = getApp({
  494. allowDefault: true });
  495. if (app && app.$vm) {
  496. return app.$vm.$locale;
  497. }
  498. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  499. }
  500. function setLocale$1(locale) {
  501. var app = getApp();
  502. if (!app) {
  503. return false;
  504. }
  505. var oldLocale = app.$vm.$locale;
  506. if (oldLocale !== locale) {
  507. app.$vm.$locale = locale;
  508. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  509. locale: locale });});
  510. return true;
  511. }
  512. return false;
  513. }
  514. var onLocaleChangeCallbacks = [];
  515. function onLocaleChange(fn) {
  516. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  517. onLocaleChangeCallbacks.push(fn);
  518. }
  519. }
  520. if (typeof global !== 'undefined') {
  521. global.getLocale = getLocale$1;
  522. }
  523. var interceptors = {
  524. promiseInterceptor: promiseInterceptor };
  525. var baseApi = /*#__PURE__*/Object.freeze({
  526. __proto__: null,
  527. upx2px: upx2px,
  528. getLocale: getLocale$1,
  529. setLocale: setLocale$1,
  530. onLocaleChange: onLocaleChange,
  531. addInterceptor: addInterceptor,
  532. removeInterceptor: removeInterceptor,
  533. interceptors: interceptors });
  534. function findExistsPageIndex(url) {
  535. var pages = getCurrentPages();
  536. var len = pages.length;
  537. while (len--) {
  538. var page = pages[len];
  539. if (page.$page && page.$page.fullPath === url) {
  540. return len;
  541. }
  542. }
  543. return -1;
  544. }
  545. var redirectTo = {
  546. name: function name(fromArgs) {
  547. if (fromArgs.exists === 'back' && fromArgs.delta) {
  548. return 'navigateBack';
  549. }
  550. return 'redirectTo';
  551. },
  552. args: function args(fromArgs) {
  553. if (fromArgs.exists === 'back' && fromArgs.url) {
  554. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  555. if (existsPageIndex !== -1) {
  556. var delta = getCurrentPages().length - 1 - existsPageIndex;
  557. if (delta > 0) {
  558. fromArgs.delta = delta;
  559. }
  560. }
  561. }
  562. } };
  563. var previewImage = {
  564. args: function args(fromArgs) {
  565. var currentIndex = parseInt(fromArgs.current);
  566. if (isNaN(currentIndex)) {
  567. return;
  568. }
  569. var urls = fromArgs.urls;
  570. if (!Array.isArray(urls)) {
  571. return;
  572. }
  573. var len = urls.length;
  574. if (!len) {
  575. return;
  576. }
  577. if (currentIndex < 0) {
  578. currentIndex = 0;
  579. } else if (currentIndex >= len) {
  580. currentIndex = len - 1;
  581. }
  582. if (currentIndex > 0) {
  583. fromArgs.current = urls[currentIndex];
  584. fromArgs.urls = urls.filter(
  585. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  586. } else {
  587. fromArgs.current = urls[0];
  588. }
  589. return {
  590. indicator: false,
  591. loop: false };
  592. } };
  593. var UUID_KEY = '__DC_STAT_UUID';
  594. var deviceId;
  595. function useDeviceId(result) {
  596. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  597. if (!deviceId) {
  598. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  599. wx.setStorage({
  600. key: UUID_KEY,
  601. data: deviceId });
  602. }
  603. result.deviceId = deviceId;
  604. }
  605. function addSafeAreaInsets(result) {
  606. if (result.safeArea) {
  607. var safeArea = result.safeArea;
  608. result.safeAreaInsets = {
  609. top: safeArea.top,
  610. left: safeArea.left,
  611. right: result.windowWidth - safeArea.right,
  612. bottom: result.screenHeight - safeArea.bottom };
  613. }
  614. }
  615. function populateParameters(result) {var _result$brand =
  616. result.brand,brand = _result$brand === void 0 ? '' : _result$brand,_result$model = result.model,model = _result$model === void 0 ? '' : _result$model,_result$system = result.system,system = _result$system === void 0 ? '' : _result$system,_result$language = result.language,language = _result$language === void 0 ? '' : _result$language,theme = result.theme,version = result.version,platform = result.platform,fontSizeSetting = result.fontSizeSetting,SDKVersion = result.SDKVersion,pixelRatio = result.pixelRatio,deviceOrientation = result.deviceOrientation;
  617. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  618. // osName osVersion
  619. var osName = '';
  620. var osVersion = '';
  621. {
  622. osName = system.split(' ')[0] || '';
  623. osVersion = system.split(' ')[1] || '';
  624. }
  625. var hostVersion = version;
  626. // deviceType
  627. var deviceType = getGetDeviceType(result, model);
  628. // deviceModel
  629. var deviceBrand = getDeviceBrand(brand);
  630. // hostName
  631. var _hostName = getHostName(result);
  632. // deviceOrientation
  633. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  634. // devicePixelRatio
  635. var _devicePixelRatio = pixelRatio;
  636. // SDKVersion
  637. var _SDKVersion = SDKVersion;
  638. // hostLanguage
  639. var hostLanguage = language.replace(/_/g, '-');
  640. // wx.getAccountInfoSync
  641. var parameters = {
  642. appId: "__UNI__EDAB3EB",
  643. appName: "agriculture",
  644. appVersion: "1.0.0",
  645. appVersionCode: "100",
  646. appLanguage: getAppLanguage(hostLanguage),
  647. uniCompileVersion: "3.5.1",
  648. uniRuntimeVersion: "3.5.1",
  649. uniPlatform: undefined || "mp-weixin",
  650. deviceBrand: deviceBrand,
  651. deviceModel: model,
  652. deviceType: deviceType,
  653. devicePixelRatio: _devicePixelRatio,
  654. deviceOrientation: _deviceOrientation,
  655. osName: osName.toLocaleLowerCase(),
  656. osVersion: osVersion,
  657. hostTheme: theme,
  658. hostVersion: hostVersion,
  659. hostLanguage: hostLanguage,
  660. hostName: _hostName,
  661. hostSDKVersion: _SDKVersion,
  662. hostFontSizeSetting: fontSizeSetting,
  663. windowTop: 0,
  664. windowBottom: 0,
  665. // TODO
  666. osLanguage: undefined,
  667. osTheme: undefined,
  668. ua: undefined,
  669. hostPackageName: undefined,
  670. browserName: undefined,
  671. browserVersion: undefined };
  672. Object.assign(result, parameters);
  673. }
  674. function getGetDeviceType(result, model) {
  675. var deviceType = result.deviceType || 'phone';
  676. {
  677. var deviceTypeMaps = {
  678. ipad: 'pad',
  679. windows: 'pc',
  680. mac: 'pc' };
  681. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  682. var _model = model.toLocaleLowerCase();
  683. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  684. var _m = deviceTypeMapsKeys[index];
  685. if (_model.indexOf(_m) !== -1) {
  686. deviceType = deviceTypeMaps[_m];
  687. break;
  688. }
  689. }
  690. }
  691. return deviceType;
  692. }
  693. function getDeviceBrand(brand) {
  694. var deviceBrand = brand;
  695. if (deviceBrand) {
  696. deviceBrand = brand.toLocaleLowerCase();
  697. }
  698. return deviceBrand;
  699. }
  700. function getAppLanguage(defaultLanguage) {
  701. return getLocale$1 ?
  702. getLocale$1() :
  703. defaultLanguage;
  704. }
  705. function getHostName(result) {
  706. var _platform = 'WeChat';
  707. var _hostName = result.hostName || _platform; // mp-jd
  708. {
  709. if (result.environment) {
  710. _hostName = result.environment;
  711. } else if (result.host && result.host.env) {
  712. _hostName = result.host.env;
  713. }
  714. }
  715. return _hostName;
  716. }
  717. var getSystemInfo = {
  718. returnValue: function returnValue(result) {
  719. useDeviceId(result);
  720. addSafeAreaInsets(result);
  721. populateParameters(result);
  722. } };
  723. var showActionSheet = {
  724. args: function args(fromArgs) {
  725. if (typeof fromArgs === 'object') {
  726. fromArgs.alertText = fromArgs.title;
  727. }
  728. } };
  729. var getAppBaseInfo = {
  730. returnValue: function returnValue(result) {var _result =
  731. result,version = _result.version,language = _result.language,SDKVersion = _result.SDKVersion,theme = _result.theme;
  732. var _hostName = getHostName(result);
  733. var hostLanguage = language.replace('_', '-');
  734. result = sortObject(Object.assign(result, {
  735. appId: "__UNI__EDAB3EB",
  736. appName: "agriculture",
  737. appVersion: "1.0.0",
  738. appVersionCode: "100",
  739. appLanguage: getAppLanguage(hostLanguage),
  740. hostVersion: version,
  741. hostLanguage: hostLanguage,
  742. hostName: _hostName,
  743. hostSDKVersion: SDKVersion,
  744. hostTheme: theme }));
  745. } };
  746. var getDeviceInfo = {
  747. returnValue: function returnValue(result) {var _result2 =
  748. result,brand = _result2.brand,model = _result2.model;
  749. var deviceType = getGetDeviceType(result, model);
  750. var deviceBrand = getDeviceBrand(brand);
  751. useDeviceId(result);
  752. result = sortObject(Object.assign(result, {
  753. deviceType: deviceType,
  754. deviceBrand: deviceBrand,
  755. deviceModel: model }));
  756. } };
  757. var getWindowInfo = {
  758. returnValue: function returnValue(result) {
  759. addSafeAreaInsets(result);
  760. result = sortObject(Object.assign(result, {
  761. windowTop: 0,
  762. windowBottom: 0 }));
  763. } };
  764. // import navigateTo from 'uni-helpers/navigate-to'
  765. var protocols = {
  766. redirectTo: redirectTo,
  767. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  768. previewImage: previewImage,
  769. getSystemInfo: getSystemInfo,
  770. getSystemInfoSync: getSystemInfo,
  771. showActionSheet: showActionSheet,
  772. getAppBaseInfo: getAppBaseInfo,
  773. getDeviceInfo: getDeviceInfo,
  774. getWindowInfo: getWindowInfo };
  775. var todos = [
  776. 'vibrate',
  777. 'preloadPage',
  778. 'unPreloadPage',
  779. 'loadSubPackage'];
  780. var canIUses = [];
  781. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  782. function processCallback(methodName, method, returnValue) {
  783. return function (res) {
  784. return method(processReturnValue(methodName, res, returnValue));
  785. };
  786. }
  787. function processArgs(methodName, fromArgs) {var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  788. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  789. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  790. if (isFn(argsOption)) {
  791. argsOption = argsOption(fromArgs, toArgs) || {};
  792. }
  793. for (var key in fromArgs) {
  794. if (hasOwn(argsOption, key)) {
  795. var keyOption = argsOption[key];
  796. if (isFn(keyOption)) {
  797. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  798. }
  799. if (!keyOption) {// 不支持的参数
  800. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  801. } else if (isStr(keyOption)) {// 重写参数 key
  802. toArgs[keyOption] = fromArgs[key];
  803. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  804. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  805. }
  806. } else if (CALLBACKS.indexOf(key) !== -1) {
  807. if (isFn(fromArgs[key])) {
  808. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  809. }
  810. } else {
  811. if (!keepFromArgs) {
  812. toArgs[key] = fromArgs[key];
  813. }
  814. }
  815. }
  816. return toArgs;
  817. } else if (isFn(fromArgs)) {
  818. fromArgs = processCallback(methodName, fromArgs, returnValue);
  819. }
  820. return fromArgs;
  821. }
  822. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  823. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  824. res = protocols.returnValue(methodName, res);
  825. }
  826. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  827. }
  828. function wrapper(methodName, method) {
  829. if (hasOwn(protocols, methodName)) {
  830. var protocol = protocols[methodName];
  831. if (!protocol) {// 暂不支持的 api
  832. return function () {
  833. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  834. };
  835. }
  836. return function (arg1, arg2) {// 目前 api 最多两个参数
  837. var options = protocol;
  838. if (isFn(protocol)) {
  839. options = protocol(arg1);
  840. }
  841. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  842. var args = [arg1];
  843. if (typeof arg2 !== 'undefined') {
  844. args.push(arg2);
  845. }
  846. if (isFn(options.name)) {
  847. methodName = options.name(arg1);
  848. } else if (isStr(options.name)) {
  849. methodName = options.name;
  850. }
  851. var returnValue = wx[methodName].apply(wx, args);
  852. if (isSyncApi(methodName)) {// 同步 api
  853. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  854. }
  855. return returnValue;
  856. };
  857. }
  858. return method;
  859. }
  860. var todoApis = Object.create(null);
  861. var TODOS = [
  862. 'onTabBarMidButtonTap',
  863. 'subscribePush',
  864. 'unsubscribePush',
  865. 'onPush',
  866. 'offPush',
  867. 'share'];
  868. function createTodoApi(name) {
  869. return function todoApi(_ref)
  870. {var fail = _ref.fail,complete = _ref.complete;
  871. var res = {
  872. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  873. isFn(fail) && fail(res);
  874. isFn(complete) && complete(res);
  875. };
  876. }
  877. TODOS.forEach(function (name) {
  878. todoApis[name] = createTodoApi(name);
  879. });
  880. var providers = {
  881. oauth: ['weixin'],
  882. share: ['weixin'],
  883. payment: ['wxpay'],
  884. push: ['weixin'] };
  885. function getProvider(_ref2)
  886. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  887. var res = false;
  888. if (providers[service]) {
  889. res = {
  890. errMsg: 'getProvider:ok',
  891. service: service,
  892. provider: providers[service] };
  893. isFn(success) && success(res);
  894. } else {
  895. res = {
  896. errMsg: 'getProvider:fail service not found' };
  897. isFn(fail) && fail(res);
  898. }
  899. isFn(complete) && complete(res);
  900. }
  901. var extraApi = /*#__PURE__*/Object.freeze({
  902. __proto__: null,
  903. getProvider: getProvider });
  904. var getEmitter = function () {
  905. var Emitter;
  906. return function getUniEmitter() {
  907. if (!Emitter) {
  908. Emitter = new _vue.default();
  909. }
  910. return Emitter;
  911. };
  912. }();
  913. function apply(ctx, method, args) {
  914. return ctx[method].apply(ctx, args);
  915. }
  916. function $on() {
  917. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  918. }
  919. function $off() {
  920. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  921. }
  922. function $once() {
  923. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  924. }
  925. function $emit() {
  926. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  927. }
  928. var eventApi = /*#__PURE__*/Object.freeze({
  929. __proto__: null,
  930. $on: $on,
  931. $off: $off,
  932. $once: $once,
  933. $emit: $emit });
  934. /**
  935. * 框架内 try-catch
  936. */
  937. /**
  938. * 开发者 try-catch
  939. */
  940. function tryCatch(fn) {
  941. return function () {
  942. try {
  943. return fn.apply(fn, arguments);
  944. } catch (e) {
  945. // TODO
  946. console.error(e);
  947. }
  948. };
  949. }
  950. function getApiCallbacks(params) {
  951. var apiCallbacks = {};
  952. for (var name in params) {
  953. var param = params[name];
  954. if (isFn(param)) {
  955. apiCallbacks[name] = tryCatch(param);
  956. delete params[name];
  957. }
  958. }
  959. return apiCallbacks;
  960. }
  961. var cid;
  962. var cidErrMsg;
  963. var enabled;
  964. function normalizePushMessage(message) {
  965. try {
  966. return JSON.parse(message);
  967. } catch (e) {}
  968. return message;
  969. }
  970. function invokePushCallback(
  971. args)
  972. {
  973. if (args.type === 'enabled') {
  974. enabled = true;
  975. } else if (args.type === 'clientId') {
  976. cid = args.cid;
  977. cidErrMsg = args.errMsg;
  978. invokeGetPushCidCallbacks(cid, args.errMsg);
  979. } else if (args.type === 'pushMsg') {
  980. onPushMessageCallbacks.forEach(function (callback) {
  981. callback({
  982. type: 'receive',
  983. data: normalizePushMessage(args.message) });
  984. });
  985. } else if (args.type === 'click') {
  986. onPushMessageCallbacks.forEach(function (callback) {
  987. callback({
  988. type: 'click',
  989. data: normalizePushMessage(args.message) });
  990. });
  991. }
  992. }
  993. var getPushCidCallbacks = [];
  994. function invokeGetPushCidCallbacks(cid, errMsg) {
  995. getPushCidCallbacks.forEach(function (callback) {
  996. callback(cid, errMsg);
  997. });
  998. getPushCidCallbacks.length = 0;
  999. }
  1000. function getPushClientId(args) {
  1001. if (!isPlainObject(args)) {
  1002. args = {};
  1003. }var _getApiCallbacks =
  1004. getApiCallbacks(args),success = _getApiCallbacks.success,fail = _getApiCallbacks.fail,complete = _getApiCallbacks.complete;
  1005. var hasSuccess = isFn(success);
  1006. var hasFail = isFn(fail);
  1007. var hasComplete = isFn(complete);
  1008. Promise.resolve().then(function () {
  1009. if (typeof enabled === 'undefined') {
  1010. enabled = false;
  1011. cid = '';
  1012. cidErrMsg = 'unipush is not enabled';
  1013. }
  1014. getPushCidCallbacks.push(function (cid, errMsg) {
  1015. var res;
  1016. if (cid) {
  1017. res = {
  1018. errMsg: 'getPushClientId:ok',
  1019. cid: cid };
  1020. hasSuccess && success(res);
  1021. } else {
  1022. res = {
  1023. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '') };
  1024. hasFail && fail(res);
  1025. }
  1026. hasComplete && complete(res);
  1027. });
  1028. if (typeof cid !== 'undefined') {
  1029. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1030. }
  1031. });
  1032. }
  1033. var onPushMessageCallbacks = [];
  1034. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1035. var onPushMessage = function onPushMessage(fn) {
  1036. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1037. onPushMessageCallbacks.push(fn);
  1038. }
  1039. };
  1040. var offPushMessage = function offPushMessage(fn) {
  1041. if (!fn) {
  1042. onPushMessageCallbacks.length = 0;
  1043. } else {
  1044. var index = onPushMessageCallbacks.indexOf(fn);
  1045. if (index > -1) {
  1046. onPushMessageCallbacks.splice(index, 1);
  1047. }
  1048. }
  1049. };
  1050. var api = /*#__PURE__*/Object.freeze({
  1051. __proto__: null,
  1052. getPushClientId: getPushClientId,
  1053. onPushMessage: onPushMessage,
  1054. offPushMessage: offPushMessage,
  1055. invokePushCallback: invokePushCallback });
  1056. var MPPage = Page;
  1057. var MPComponent = Component;
  1058. var customizeRE = /:/g;
  1059. var customize = cached(function (str) {
  1060. return camelize(str.replace(customizeRE, '-'));
  1061. });
  1062. function initTriggerEvent(mpInstance) {
  1063. var oldTriggerEvent = mpInstance.triggerEvent;
  1064. var newTriggerEvent = function newTriggerEvent(event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  1065. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  1066. };
  1067. try {
  1068. // 京东小程序 triggerEvent 为只读
  1069. mpInstance.triggerEvent = newTriggerEvent;
  1070. } catch (error) {
  1071. mpInstance._triggerEvent = newTriggerEvent;
  1072. }
  1073. }
  1074. function initHook(name, options, isComponent) {
  1075. var oldHook = options[name];
  1076. if (!oldHook) {
  1077. options[name] = function () {
  1078. initTriggerEvent(this);
  1079. };
  1080. } else {
  1081. options[name] = function () {
  1082. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  1083. return oldHook.apply(this, args);
  1084. };
  1085. }
  1086. }
  1087. if (!MPPage.__$wrappered) {
  1088. MPPage.__$wrappered = true;
  1089. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1090. initHook('onLoad', options);
  1091. return MPPage(options);
  1092. };
  1093. Page.after = MPPage.after;
  1094. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1095. initHook('created', options);
  1096. return MPComponent(options);
  1097. };
  1098. }
  1099. var PAGE_EVENT_HOOKS = [
  1100. 'onPullDownRefresh',
  1101. 'onReachBottom',
  1102. 'onAddToFavorites',
  1103. 'onShareTimeline',
  1104. 'onShareAppMessage',
  1105. 'onPageScroll',
  1106. 'onResize',
  1107. 'onTabItemTap'];
  1108. function initMocks(vm, mocks) {
  1109. var mpInstance = vm.$mp[vm.mpType];
  1110. mocks.forEach(function (mock) {
  1111. if (hasOwn(mpInstance, mock)) {
  1112. vm[mock] = mpInstance[mock];
  1113. }
  1114. });
  1115. }
  1116. function hasHook(hook, vueOptions) {
  1117. if (!vueOptions) {
  1118. return true;
  1119. }
  1120. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1121. return true;
  1122. }
  1123. vueOptions = vueOptions.default || vueOptions;
  1124. if (isFn(vueOptions)) {
  1125. if (isFn(vueOptions.extendOptions[hook])) {
  1126. return true;
  1127. }
  1128. if (vueOptions.super &&
  1129. vueOptions.super.options &&
  1130. Array.isArray(vueOptions.super.options[hook])) {
  1131. return true;
  1132. }
  1133. return false;
  1134. }
  1135. if (isFn(vueOptions[hook])) {
  1136. return true;
  1137. }
  1138. var mixins = vueOptions.mixins;
  1139. if (Array.isArray(mixins)) {
  1140. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  1141. }
  1142. }
  1143. function initHooks(mpOptions, hooks, vueOptions) {
  1144. hooks.forEach(function (hook) {
  1145. if (hasHook(hook, vueOptions)) {
  1146. mpOptions[hook] = function (args) {
  1147. return this.$vm && this.$vm.__call_hook(hook, args);
  1148. };
  1149. }
  1150. });
  1151. }
  1152. function initVueComponent(Vue, vueOptions) {
  1153. vueOptions = vueOptions.default || vueOptions;
  1154. var VueComponent;
  1155. if (isFn(vueOptions)) {
  1156. VueComponent = vueOptions;
  1157. } else {
  1158. VueComponent = Vue.extend(vueOptions);
  1159. }
  1160. vueOptions = VueComponent.options;
  1161. return [VueComponent, vueOptions];
  1162. }
  1163. function initSlots(vm, vueSlots) {
  1164. if (Array.isArray(vueSlots) && vueSlots.length) {
  1165. var $slots = Object.create(null);
  1166. vueSlots.forEach(function (slotName) {
  1167. $slots[slotName] = true;
  1168. });
  1169. vm.$scopedSlots = vm.$slots = $slots;
  1170. }
  1171. }
  1172. function initVueIds(vueIds, mpInstance) {
  1173. vueIds = (vueIds || '').split(',');
  1174. var len = vueIds.length;
  1175. if (len === 1) {
  1176. mpInstance._$vueId = vueIds[0];
  1177. } else if (len === 2) {
  1178. mpInstance._$vueId = vueIds[0];
  1179. mpInstance._$vuePid = vueIds[1];
  1180. }
  1181. }
  1182. function initData(vueOptions, context) {
  1183. var data = vueOptions.data || {};
  1184. var methods = vueOptions.methods || {};
  1185. if (typeof data === 'function') {
  1186. try {
  1187. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1188. } catch (e) {
  1189. if (Object({"VUE_APP_NAME":"agriculture","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1190. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1191. }
  1192. }
  1193. } else {
  1194. try {
  1195. // 对 data 格式化
  1196. data = JSON.parse(JSON.stringify(data));
  1197. } catch (e) {}
  1198. }
  1199. if (!isPlainObject(data)) {
  1200. data = {};
  1201. }
  1202. Object.keys(methods).forEach(function (methodName) {
  1203. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1204. data[methodName] = methods[methodName];
  1205. }
  1206. });
  1207. return data;
  1208. }
  1209. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1210. function createObserver(name) {
  1211. return function observer(newVal, oldVal) {
  1212. if (this.$vm) {
  1213. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1214. }
  1215. };
  1216. }
  1217. function initBehaviors(vueOptions, initBehavior) {
  1218. var vueBehaviors = vueOptions.behaviors;
  1219. var vueExtends = vueOptions.extends;
  1220. var vueMixins = vueOptions.mixins;
  1221. var vueProps = vueOptions.props;
  1222. if (!vueProps) {
  1223. vueOptions.props = vueProps = [];
  1224. }
  1225. var behaviors = [];
  1226. if (Array.isArray(vueBehaviors)) {
  1227. vueBehaviors.forEach(function (behavior) {
  1228. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1229. if (behavior === 'uni://form-field') {
  1230. if (Array.isArray(vueProps)) {
  1231. vueProps.push('name');
  1232. vueProps.push('value');
  1233. } else {
  1234. vueProps.name = {
  1235. type: String,
  1236. default: '' };
  1237. vueProps.value = {
  1238. type: [String, Number, Boolean, Array, Object, Date],
  1239. default: '' };
  1240. }
  1241. }
  1242. });
  1243. }
  1244. if (isPlainObject(vueExtends) && vueExtends.props) {
  1245. behaviors.push(
  1246. initBehavior({
  1247. properties: initProperties(vueExtends.props, true) }));
  1248. }
  1249. if (Array.isArray(vueMixins)) {
  1250. vueMixins.forEach(function (vueMixin) {
  1251. if (isPlainObject(vueMixin) && vueMixin.props) {
  1252. behaviors.push(
  1253. initBehavior({
  1254. properties: initProperties(vueMixin.props, true) }));
  1255. }
  1256. });
  1257. }
  1258. return behaviors;
  1259. }
  1260. function parsePropType(key, type, defaultValue, file) {
  1261. // [String]=>String
  1262. if (Array.isArray(type) && type.length === 1) {
  1263. return type[0];
  1264. }
  1265. return type;
  1266. }
  1267. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';var options = arguments.length > 3 ? arguments[3] : undefined;
  1268. var properties = {};
  1269. if (!isBehavior) {
  1270. properties.vueId = {
  1271. type: String,
  1272. value: '' };
  1273. {
  1274. if (options.virtualHost) {
  1275. properties.virtualHostStyle = {
  1276. type: null,
  1277. value: '' };
  1278. properties.virtualHostClass = {
  1279. type: null,
  1280. value: '' };
  1281. }
  1282. }
  1283. // scopedSlotsCompiler auto
  1284. properties.scopedSlotsCompiler = {
  1285. type: String,
  1286. value: '' };
  1287. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1288. type: null,
  1289. value: [],
  1290. observer: function observer(newVal, oldVal) {
  1291. var $slots = Object.create(null);
  1292. newVal.forEach(function (slotName) {
  1293. $slots[slotName] = true;
  1294. });
  1295. this.setData({
  1296. $slots: $slots });
  1297. } };
  1298. }
  1299. if (Array.isArray(props)) {// ['title']
  1300. props.forEach(function (key) {
  1301. properties[key] = {
  1302. type: null,
  1303. observer: createObserver(key) };
  1304. });
  1305. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  1306. Object.keys(props).forEach(function (key) {
  1307. var opts = props[key];
  1308. if (isPlainObject(opts)) {// title:{type:String,default:''}
  1309. var value = opts.default;
  1310. if (isFn(value)) {
  1311. value = value();
  1312. }
  1313. opts.type = parsePropType(key, opts.type);
  1314. properties[key] = {
  1315. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1316. value: value,
  1317. observer: createObserver(key) };
  1318. } else {// content:String
  1319. var type = parsePropType(key, opts);
  1320. properties[key] = {
  1321. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1322. observer: createObserver(key) };
  1323. }
  1324. });
  1325. }
  1326. return properties;
  1327. }
  1328. function wrapper$1(event) {
  1329. // TODO 又得兼容 mpvue 的 mp 对象
  1330. try {
  1331. event.mp = JSON.parse(JSON.stringify(event));
  1332. } catch (e) {}
  1333. event.stopPropagation = noop;
  1334. event.preventDefault = noop;
  1335. event.target = event.target || {};
  1336. if (!hasOwn(event, 'detail')) {
  1337. event.detail = {};
  1338. }
  1339. if (hasOwn(event, 'markerId')) {
  1340. event.detail = typeof event.detail === 'object' ? event.detail : {};
  1341. event.detail.markerId = event.markerId;
  1342. }
  1343. if (isPlainObject(event.detail)) {
  1344. event.target = Object.assign({}, event.target, event.detail);
  1345. }
  1346. return event;
  1347. }
  1348. function getExtraValue(vm, dataPathsArray) {
  1349. var context = vm;
  1350. dataPathsArray.forEach(function (dataPathArray) {
  1351. var dataPath = dataPathArray[0];
  1352. var value = dataPathArray[2];
  1353. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  1354. var propPath = dataPathArray[1];
  1355. var valuePath = dataPathArray[3];
  1356. var vFor;
  1357. if (Number.isInteger(dataPath)) {
  1358. vFor = dataPath;
  1359. } else if (!dataPath) {
  1360. vFor = context;
  1361. } else if (typeof dataPath === 'string' && dataPath) {
  1362. if (dataPath.indexOf('#s#') === 0) {
  1363. vFor = dataPath.substr(3);
  1364. } else {
  1365. vFor = vm.__get_value(dataPath, context);
  1366. }
  1367. }
  1368. if (Number.isInteger(vFor)) {
  1369. context = value;
  1370. } else if (!propPath) {
  1371. context = vFor[value];
  1372. } else {
  1373. if (Array.isArray(vFor)) {
  1374. context = vFor.find(function (vForItem) {
  1375. return vm.__get_value(propPath, vForItem) === value;
  1376. });
  1377. } else if (isPlainObject(vFor)) {
  1378. context = Object.keys(vFor).find(function (vForKey) {
  1379. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1380. });
  1381. } else {
  1382. console.error('v-for 暂不支持循环数据:', vFor);
  1383. }
  1384. }
  1385. if (valuePath) {
  1386. context = vm.__get_value(valuePath, context);
  1387. }
  1388. }
  1389. });
  1390. return context;
  1391. }
  1392. function processEventExtra(vm, extra, event) {
  1393. var extraObj = {};
  1394. if (Array.isArray(extra) && extra.length) {
  1395. /**
  1396. *[
  1397. * ['data.items', 'data.id', item.data.id],
  1398. * ['metas', 'id', meta.id]
  1399. *],
  1400. *[
  1401. * ['data.items', 'data.id', item.data.id],
  1402. * ['metas', 'id', meta.id]
  1403. *],
  1404. *'test'
  1405. */
  1406. extra.forEach(function (dataPath, index) {
  1407. if (typeof dataPath === 'string') {
  1408. if (!dataPath) {// model,prop.sync
  1409. extraObj['$' + index] = vm;
  1410. } else {
  1411. if (dataPath === '$event') {// $event
  1412. extraObj['$' + index] = event;
  1413. } else if (dataPath === 'arguments') {
  1414. if (event.detail && event.detail.__args__) {
  1415. extraObj['$' + index] = event.detail.__args__;
  1416. } else {
  1417. extraObj['$' + index] = [event];
  1418. }
  1419. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1420. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1421. } else {
  1422. extraObj['$' + index] = vm.__get_value(dataPath);
  1423. }
  1424. }
  1425. } else {
  1426. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1427. }
  1428. });
  1429. }
  1430. return extraObj;
  1431. }
  1432. function getObjByArray(arr) {
  1433. var obj = {};
  1434. for (var i = 1; i < arr.length; i++) {
  1435. var element = arr[i];
  1436. obj[element[0]] = element[1];
  1437. }
  1438. return obj;
  1439. }
  1440. function processEventArgs(vm, event) {var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];var isCustom = arguments.length > 4 ? arguments[4] : undefined;var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1441. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1442. if (isCustom) {// 自定义事件
  1443. isCustomMPEvent = event.currentTarget &&
  1444. event.currentTarget.dataset &&
  1445. event.currentTarget.dataset.comType === 'wx';
  1446. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1447. if (isCustomMPEvent) {
  1448. return [event];
  1449. }
  1450. return event.detail.__args__ || event.detail;
  1451. }
  1452. }
  1453. var extraObj = processEventExtra(vm, extra, event);
  1454. var ret = [];
  1455. args.forEach(function (arg) {
  1456. if (arg === '$event') {
  1457. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1458. ret.push(event.target.value);
  1459. } else {
  1460. if (isCustom && !isCustomMPEvent) {
  1461. ret.push(event.detail.__args__[0]);
  1462. } else {// wxcomponent 组件或内置组件
  1463. ret.push(event);
  1464. }
  1465. }
  1466. } else {
  1467. if (Array.isArray(arg) && arg[0] === 'o') {
  1468. ret.push(getObjByArray(arg));
  1469. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1470. ret.push(extraObj[arg]);
  1471. } else {
  1472. ret.push(arg);
  1473. }
  1474. }
  1475. });
  1476. return ret;
  1477. }
  1478. var ONCE = '~';
  1479. var CUSTOM = '^';
  1480. function isMatchEventType(eventType, optType) {
  1481. return eventType === optType ||
  1482. optType === 'regionchange' && (
  1483. eventType === 'begin' ||
  1484. eventType === 'end');
  1485. }
  1486. function getContextVm(vm) {
  1487. var $parent = vm.$parent;
  1488. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1489. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1490. $parent = $parent.$parent;
  1491. }
  1492. return $parent && $parent.$parent;
  1493. }
  1494. function handleEvent(event) {var _this2 = this;
  1495. event = wrapper$1(event);
  1496. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1497. var dataset = (event.currentTarget || event.target).dataset;
  1498. if (!dataset) {
  1499. return console.warn('事件信息不存在');
  1500. }
  1501. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1502. if (!eventOpts) {
  1503. return console.warn('事件信息不存在');
  1504. }
  1505. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1506. var eventType = event.type;
  1507. var ret = [];
  1508. eventOpts.forEach(function (eventOpt) {
  1509. var type = eventOpt[0];
  1510. var eventsArray = eventOpt[1];
  1511. var isCustom = type.charAt(0) === CUSTOM;
  1512. type = isCustom ? type.slice(1) : type;
  1513. var isOnce = type.charAt(0) === ONCE;
  1514. type = isOnce ? type.slice(1) : type;
  1515. if (eventsArray && isMatchEventType(eventType, type)) {
  1516. eventsArray.forEach(function (eventArray) {
  1517. var methodName = eventArray[0];
  1518. if (methodName) {
  1519. var handlerCtx = _this2.$vm;
  1520. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1521. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1522. }
  1523. if (methodName === '$emit') {
  1524. handlerCtx.$emit.apply(handlerCtx,
  1525. processEventArgs(
  1526. _this2.$vm,
  1527. event,
  1528. eventArray[1],
  1529. eventArray[2],
  1530. isCustom,
  1531. methodName));
  1532. return;
  1533. }
  1534. var handler = handlerCtx[methodName];
  1535. if (!isFn(handler)) {
  1536. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1537. }
  1538. if (isOnce) {
  1539. if (handler.once) {
  1540. return;
  1541. }
  1542. handler.once = true;
  1543. }
  1544. var params = processEventArgs(
  1545. _this2.$vm,
  1546. event,
  1547. eventArray[1],
  1548. eventArray[2],
  1549. isCustom,
  1550. methodName);
  1551. params = Array.isArray(params) ? params : [];
  1552. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1553. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1554. // eslint-disable-next-line no-sparse-arrays
  1555. params = params.concat([,,,,,,,,,, event]);
  1556. }
  1557. ret.push(handler.apply(handlerCtx, params));
  1558. }
  1559. });
  1560. }
  1561. });
  1562. if (
  1563. eventType === 'input' &&
  1564. ret.length === 1 &&
  1565. typeof ret[0] !== 'undefined')
  1566. {
  1567. return ret[0];
  1568. }
  1569. }
  1570. var eventChannels = {};
  1571. var eventChannelStack = [];
  1572. function getEventChannel(id) {
  1573. if (id) {
  1574. var eventChannel = eventChannels[id];
  1575. delete eventChannels[id];
  1576. return eventChannel;
  1577. }
  1578. return eventChannelStack.shift();
  1579. }
  1580. var hooks = [
  1581. 'onShow',
  1582. 'onHide',
  1583. 'onError',
  1584. 'onPageNotFound',
  1585. 'onThemeChange',
  1586. 'onUnhandledRejection'];
  1587. function initEventChannel() {
  1588. _vue.default.prototype.getOpenerEventChannel = function () {
  1589. // 微信小程序使用自身getOpenerEventChannel
  1590. {
  1591. return this.$scope.getOpenerEventChannel();
  1592. }
  1593. };
  1594. var callHook = _vue.default.prototype.__call_hook;
  1595. _vue.default.prototype.__call_hook = function (hook, args) {
  1596. if (hook === 'onLoad' && args && args.__id__) {
  1597. this.__eventChannel__ = getEventChannel(args.__id__);
  1598. delete args.__id__;
  1599. }
  1600. return callHook.call(this, hook, args);
  1601. };
  1602. }
  1603. function initScopedSlotsParams() {
  1604. var center = {};
  1605. var parents = {};
  1606. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1607. var has = center[vueId];
  1608. if (!has) {
  1609. parents[vueId] = this;
  1610. this.$on('hook:destroyed', function () {
  1611. delete parents[vueId];
  1612. });
  1613. }
  1614. return has;
  1615. };
  1616. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1617. var data = center[vueId];
  1618. if (data) {
  1619. var object = data[name] || {};
  1620. return key ? object[key] : object;
  1621. } else {
  1622. parents[vueId] = this;
  1623. this.$on('hook:destroyed', function () {
  1624. delete parents[vueId];
  1625. });
  1626. }
  1627. };
  1628. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1629. var vueIds = this.$options.propsData.vueId;
  1630. if (vueIds) {
  1631. var vueId = vueIds.split(',')[0];
  1632. var object = center[vueId] = center[vueId] || {};
  1633. object[name] = value;
  1634. if (parents[vueId]) {
  1635. parents[vueId].$forceUpdate();
  1636. }
  1637. }
  1638. };
  1639. _vue.default.mixin({
  1640. destroyed: function destroyed() {
  1641. var propsData = this.$options.propsData;
  1642. var vueId = propsData && propsData.vueId;
  1643. if (vueId) {
  1644. delete center[vueId];
  1645. delete parents[vueId];
  1646. }
  1647. } });
  1648. }
  1649. function parseBaseApp(vm, _ref3)
  1650. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1651. initEventChannel();
  1652. {
  1653. initScopedSlotsParams();
  1654. }
  1655. if (vm.$options.store) {
  1656. _vue.default.prototype.$store = vm.$options.store;
  1657. }
  1658. uniIdMixin(_vue.default);
  1659. _vue.default.prototype.mpHost = "mp-weixin";
  1660. _vue.default.mixin({
  1661. beforeCreate: function beforeCreate() {
  1662. if (!this.$options.mpType) {
  1663. return;
  1664. }
  1665. this.mpType = this.$options.mpType;
  1666. this.$mp = _defineProperty({
  1667. data: {} },
  1668. this.mpType, this.$options.mpInstance);
  1669. this.$scope = this.$options.mpInstance;
  1670. delete this.$options.mpType;
  1671. delete this.$options.mpInstance;
  1672. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1673. var app = getApp();
  1674. if (app.$vm && app.$vm.$i18n) {
  1675. this._i18n = app.$vm.$i18n;
  1676. }
  1677. }
  1678. if (this.mpType !== 'app') {
  1679. initRefs(this);
  1680. initMocks(this, mocks);
  1681. }
  1682. } });
  1683. var appOptions = {
  1684. onLaunch: function onLaunch(args) {
  1685. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1686. return;
  1687. }
  1688. {
  1689. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1690. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1691. }
  1692. }
  1693. this.$vm = vm;
  1694. this.$vm.$mp = {
  1695. app: this };
  1696. this.$vm.$scope = this;
  1697. // vm 上也挂载 globalData
  1698. this.$vm.globalData = this.globalData;
  1699. this.$vm._isMounted = true;
  1700. this.$vm.__call_hook('mounted', args);
  1701. this.$vm.__call_hook('onLaunch', args);
  1702. } };
  1703. // 兼容旧版本 globalData
  1704. appOptions.globalData = vm.$options.globalData || {};
  1705. // 将 methods 中的方法挂在 getApp() 中
  1706. var methods = vm.$options.methods;
  1707. if (methods) {
  1708. Object.keys(methods).forEach(function (name) {
  1709. appOptions[name] = methods[name];
  1710. });
  1711. }
  1712. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  1713. initHooks(appOptions, hooks);
  1714. return appOptions;
  1715. }
  1716. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1717. function findVmByVueId(vm, vuePid) {
  1718. var $children = vm.$children;
  1719. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1720. for (var i = $children.length - 1; i >= 0; i--) {
  1721. var childVm = $children[i];
  1722. if (childVm.$scope._$vueId === vuePid) {
  1723. return childVm;
  1724. }
  1725. }
  1726. // 反向递归查找
  1727. var parentVm;
  1728. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1729. parentVm = findVmByVueId($children[_i], vuePid);
  1730. if (parentVm) {
  1731. return parentVm;
  1732. }
  1733. }
  1734. }
  1735. function initBehavior(options) {
  1736. return Behavior(options);
  1737. }
  1738. function isPage() {
  1739. return !!this.route;
  1740. }
  1741. function initRelation(detail) {
  1742. this.triggerEvent('__l', detail);
  1743. }
  1744. function selectAllComponents(mpInstance, selector, $refs) {
  1745. var components = mpInstance.selectAllComponents(selector);
  1746. components.forEach(function (component) {
  1747. var ref = component.dataset.ref;
  1748. $refs[ref] = component.$vm || component;
  1749. {
  1750. if (component.dataset.vueGeneric === 'scoped') {
  1751. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1752. selectAllComponents(scopedComponent, selector, $refs);
  1753. });
  1754. }
  1755. }
  1756. });
  1757. }
  1758. function initRefs(vm) {
  1759. var mpInstance = vm.$scope;
  1760. Object.defineProperty(vm, '$refs', {
  1761. get: function get() {
  1762. var $refs = {};
  1763. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1764. // TODO 暂不考虑 for 中的 scoped
  1765. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1766. forComponents.forEach(function (component) {
  1767. var ref = component.dataset.ref;
  1768. if (!$refs[ref]) {
  1769. $refs[ref] = [];
  1770. }
  1771. $refs[ref].push(component.$vm || component);
  1772. });
  1773. return $refs;
  1774. } });
  1775. }
  1776. function handleLink(event) {var _ref4 =
  1777. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1778. var parentVm;
  1779. if (vuePid) {
  1780. parentVm = findVmByVueId(this.$vm, vuePid);
  1781. }
  1782. if (!parentVm) {
  1783. parentVm = this.$vm;
  1784. }
  1785. vueOptions.parent = parentVm;
  1786. }
  1787. function parseApp(vm) {
  1788. return parseBaseApp(vm, {
  1789. mocks: mocks,
  1790. initRefs: initRefs });
  1791. }
  1792. function createApp(vm) {
  1793. App(parseApp(vm));
  1794. return vm;
  1795. }
  1796. var encodeReserveRE = /[!'()*]/g;
  1797. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1798. var commaRE = /%2C/g;
  1799. // fixed encodeURIComponent which is more conformant to RFC3986:
  1800. // - escapes [!'()*]
  1801. // - preserve commas
  1802. var encode = function encode(str) {return encodeURIComponent(str).
  1803. replace(encodeReserveRE, encodeReserveReplacer).
  1804. replace(commaRE, ',');};
  1805. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1806. var res = obj ? Object.keys(obj).map(function (key) {
  1807. var val = obj[key];
  1808. if (val === undefined) {
  1809. return '';
  1810. }
  1811. if (val === null) {
  1812. return encodeStr(key);
  1813. }
  1814. if (Array.isArray(val)) {
  1815. var result = [];
  1816. val.forEach(function (val2) {
  1817. if (val2 === undefined) {
  1818. return;
  1819. }
  1820. if (val2 === null) {
  1821. result.push(encodeStr(key));
  1822. } else {
  1823. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1824. }
  1825. });
  1826. return result.join('&');
  1827. }
  1828. return encodeStr(key) + '=' + encodeStr(val);
  1829. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1830. return res ? "?".concat(res) : '';
  1831. }
  1832. function parseBaseComponent(vueComponentOptions)
  1833. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1834. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1835. var options = _objectSpread({
  1836. multipleSlots: true,
  1837. addGlobalClass: true },
  1838. vueOptions.options || {});
  1839. {
  1840. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1841. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1842. Object.assign(options, vueOptions['mp-weixin'].options);
  1843. }
  1844. }
  1845. var componentOptions = {
  1846. options: options,
  1847. data: initData(vueOptions, _vue.default.prototype),
  1848. behaviors: initBehaviors(vueOptions, initBehavior),
  1849. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  1850. lifetimes: {
  1851. attached: function attached() {
  1852. var properties = this.properties;
  1853. var options = {
  1854. mpType: isPage.call(this) ? 'page' : 'component',
  1855. mpInstance: this,
  1856. propsData: properties };
  1857. initVueIds(properties.vueId, this);
  1858. // 处理父子关系
  1859. initRelation.call(this, {
  1860. vuePid: this._$vuePid,
  1861. vueOptions: options });
  1862. // 初始化 vue 实例
  1863. this.$vm = new VueComponent(options);
  1864. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1865. initSlots(this.$vm, properties.vueSlots);
  1866. // 触发首次 setData
  1867. this.$vm.$mount();
  1868. },
  1869. ready: function ready() {
  1870. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1871. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1872. if (this.$vm) {
  1873. this.$vm._isMounted = true;
  1874. this.$vm.__call_hook('mounted');
  1875. this.$vm.__call_hook('onReady');
  1876. }
  1877. },
  1878. detached: function detached() {
  1879. this.$vm && this.$vm.$destroy();
  1880. } },
  1881. pageLifetimes: {
  1882. show: function show(args) {
  1883. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1884. },
  1885. hide: function hide() {
  1886. this.$vm && this.$vm.__call_hook('onPageHide');
  1887. },
  1888. resize: function resize(size) {
  1889. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1890. } },
  1891. methods: {
  1892. __l: handleLink,
  1893. __e: handleEvent } };
  1894. // externalClasses
  1895. if (vueOptions.externalClasses) {
  1896. componentOptions.externalClasses = vueOptions.externalClasses;
  1897. }
  1898. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1899. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1900. componentOptions.methods[callMethod] = function (args) {
  1901. return this.$vm[callMethod](args);
  1902. };
  1903. });
  1904. }
  1905. if (isPage) {
  1906. return componentOptions;
  1907. }
  1908. return [componentOptions, VueComponent];
  1909. }
  1910. function parseComponent(vueComponentOptions) {
  1911. return parseBaseComponent(vueComponentOptions, {
  1912. isPage: isPage,
  1913. initRelation: initRelation });
  1914. }
  1915. var hooks$1 = [
  1916. 'onShow',
  1917. 'onHide',
  1918. 'onUnload'];
  1919. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1920. function parseBasePage(vuePageOptions, _ref6)
  1921. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1922. var pageOptions = parseComponent(vuePageOptions);
  1923. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1924. pageOptions.methods.onLoad = function (query) {
  1925. this.options = query;
  1926. var copyQuery = Object.assign({}, query);
  1927. delete copyQuery.__id__;
  1928. this.$page = {
  1929. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1930. this.$vm.$mp.query = query; // 兼容 mpvue
  1931. this.$vm.__call_hook('onLoad', query);
  1932. };
  1933. return pageOptions;
  1934. }
  1935. function parsePage(vuePageOptions) {
  1936. return parseBasePage(vuePageOptions, {
  1937. isPage: isPage,
  1938. initRelation: initRelation });
  1939. }
  1940. function createPage(vuePageOptions) {
  1941. {
  1942. return Component(parsePage(vuePageOptions));
  1943. }
  1944. }
  1945. function createComponent(vueOptions) {
  1946. {
  1947. return Component(parseComponent(vueOptions));
  1948. }
  1949. }
  1950. function createSubpackageApp(vm) {
  1951. var appOptions = parseApp(vm);
  1952. var app = getApp({
  1953. allowDefault: true });
  1954. vm.$scope = app;
  1955. var globalData = app.globalData;
  1956. if (globalData) {
  1957. Object.keys(appOptions.globalData).forEach(function (name) {
  1958. if (!hasOwn(globalData, name)) {
  1959. globalData[name] = appOptions.globalData[name];
  1960. }
  1961. });
  1962. }
  1963. Object.keys(appOptions).forEach(function (name) {
  1964. if (!hasOwn(app, name)) {
  1965. app[name] = appOptions[name];
  1966. }
  1967. });
  1968. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1969. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1970. vm.__call_hook('onShow', args);
  1971. });
  1972. }
  1973. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1974. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1975. vm.__call_hook('onHide', args);
  1976. });
  1977. }
  1978. if (isFn(appOptions.onLaunch)) {
  1979. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1980. vm.__call_hook('onLaunch', args);
  1981. }
  1982. return vm;
  1983. }
  1984. function createPlugin(vm) {
  1985. var appOptions = parseApp(vm);
  1986. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1987. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1988. vm.__call_hook('onShow', args);
  1989. });
  1990. }
  1991. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1992. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1993. vm.__call_hook('onHide', args);
  1994. });
  1995. }
  1996. if (isFn(appOptions.onLaunch)) {
  1997. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1998. vm.__call_hook('onLaunch', args);
  1999. }
  2000. return vm;
  2001. }
  2002. todos.forEach(function (todoApi) {
  2003. protocols[todoApi] = false;
  2004. });
  2005. canIUses.forEach(function (canIUseApi) {
  2006. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  2007. canIUseApi;
  2008. if (!wx.canIUse(apiName)) {
  2009. protocols[canIUseApi] = false;
  2010. }
  2011. });
  2012. var uni = {};
  2013. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  2014. uni = new Proxy({}, {
  2015. get: function get(target, name) {
  2016. if (hasOwn(target, name)) {
  2017. return target[name];
  2018. }
  2019. if (baseApi[name]) {
  2020. return baseApi[name];
  2021. }
  2022. if (api[name]) {
  2023. return promisify(name, api[name]);
  2024. }
  2025. {
  2026. if (extraApi[name]) {
  2027. return promisify(name, extraApi[name]);
  2028. }
  2029. if (todoApis[name]) {
  2030. return promisify(name, todoApis[name]);
  2031. }
  2032. }
  2033. if (eventApi[name]) {
  2034. return eventApi[name];
  2035. }
  2036. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  2037. return;
  2038. }
  2039. return promisify(name, wrapper(name, wx[name]));
  2040. },
  2041. set: function set(target, name, value) {
  2042. target[name] = value;
  2043. return true;
  2044. } });
  2045. } else {
  2046. Object.keys(baseApi).forEach(function (name) {
  2047. uni[name] = baseApi[name];
  2048. });
  2049. {
  2050. Object.keys(todoApis).forEach(function (name) {
  2051. uni[name] = promisify(name, todoApis[name]);
  2052. });
  2053. Object.keys(extraApi).forEach(function (name) {
  2054. uni[name] = promisify(name, todoApis[name]);
  2055. });
  2056. }
  2057. Object.keys(eventApi).forEach(function (name) {
  2058. uni[name] = eventApi[name];
  2059. });
  2060. Object.keys(api).forEach(function (name) {
  2061. uni[name] = promisify(name, api[name]);
  2062. });
  2063. Object.keys(wx).forEach(function (name) {
  2064. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2065. uni[name] = promisify(name, wrapper(name, wx[name]));
  2066. }
  2067. });
  2068. }
  2069. wx.createApp = createApp;
  2070. wx.createPage = createPage;
  2071. wx.createComponent = createComponent;
  2072. wx.createSubpackageApp = createSubpackageApp;
  2073. wx.createPlugin = createPlugin;
  2074. var uni$1 = uni;var _default =
  2075. uni$1;exports.default = _default;
  2076. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  2077. /***/ }),
  2078. /***/ 11:
  2079. /*!**********************************************************************************************************!*\
  2080. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  2081. \**********************************************************************************************************/
  2082. /*! exports provided: default */
  2083. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2084. "use strict";
  2085. __webpack_require__.r(__webpack_exports__);
  2086. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  2087. /* globals __VUE_SSR_CONTEXT__ */
  2088. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  2089. // This module is a runtime utility for cleaner component module output and will
  2090. // be included in the final webpack user bundle.
  2091. function normalizeComponent (
  2092. scriptExports,
  2093. render,
  2094. staticRenderFns,
  2095. functionalTemplate,
  2096. injectStyles,
  2097. scopeId,
  2098. moduleIdentifier, /* server only */
  2099. shadowMode, /* vue-cli only */
  2100. components, // fixed by xxxxxx auto components
  2101. renderjs // fixed by xxxxxx renderjs
  2102. ) {
  2103. // Vue.extend constructor export interop
  2104. var options = typeof scriptExports === 'function'
  2105. ? scriptExports.options
  2106. : scriptExports
  2107. // fixed by xxxxxx auto components
  2108. if (components) {
  2109. if (!options.components) {
  2110. options.components = {}
  2111. }
  2112. var hasOwn = Object.prototype.hasOwnProperty
  2113. for (var name in components) {
  2114. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  2115. options.components[name] = components[name]
  2116. }
  2117. }
  2118. }
  2119. // fixed by xxxxxx renderjs
  2120. if (renderjs) {
  2121. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  2122. this[renderjs.__module] = this
  2123. });
  2124. (options.mixins || (options.mixins = [])).push(renderjs)
  2125. }
  2126. // render functions
  2127. if (render) {
  2128. options.render = render
  2129. options.staticRenderFns = staticRenderFns
  2130. options._compiled = true
  2131. }
  2132. // functional template
  2133. if (functionalTemplate) {
  2134. options.functional = true
  2135. }
  2136. // scopedId
  2137. if (scopeId) {
  2138. options._scopeId = 'data-v-' + scopeId
  2139. }
  2140. var hook
  2141. if (moduleIdentifier) { // server build
  2142. hook = function (context) {
  2143. // 2.3 injection
  2144. context =
  2145. context || // cached call
  2146. (this.$vnode && this.$vnode.ssrContext) || // stateful
  2147. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  2148. // 2.2 with runInNewContext: true
  2149. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  2150. context = __VUE_SSR_CONTEXT__
  2151. }
  2152. // inject component styles
  2153. if (injectStyles) {
  2154. injectStyles.call(this, context)
  2155. }
  2156. // register component module identifier for async chunk inferrence
  2157. if (context && context._registeredComponents) {
  2158. context._registeredComponents.add(moduleIdentifier)
  2159. }
  2160. }
  2161. // used by ssr in case component is cached and beforeCreate
  2162. // never gets called
  2163. options._ssrRegister = hook
  2164. } else if (injectStyles) {
  2165. hook = shadowMode
  2166. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  2167. : injectStyles
  2168. }
  2169. if (hook) {
  2170. if (options.functional) {
  2171. // for template-only hot-reload because in that case the render fn doesn't
  2172. // go through the normalizer
  2173. options._injectStyles = hook
  2174. // register for functioal component in vue file
  2175. var originalRender = options.render
  2176. options.render = function renderWithStyleInjection (h, context) {
  2177. hook.call(context)
  2178. return originalRender(h, context)
  2179. }
  2180. } else {
  2181. // inject component registration as beforeCreate hook
  2182. var existing = options.beforeCreate
  2183. options.beforeCreate = existing
  2184. ? [].concat(existing, hook)
  2185. : [hook]
  2186. }
  2187. }
  2188. return {
  2189. exports: scriptExports,
  2190. options: options
  2191. }
  2192. }
  2193. /***/ }),
  2194. /***/ 116:
  2195. /*!*************************************!*\
  2196. !*** F:/工作项目/pingpu_H5/api/pest.js ***!
  2197. \*************************************/
  2198. /*! no static exports found */
  2199. /***/ (function(module, exports, __webpack_require__) {
  2200. "use strict";
  2201. Object.defineProperty(exports, "__esModule", { value: true });exports.handlePlantDiscern = exports.handlePestDiscern = exports.loadPestList = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 13));var _index = _interopRequireDefault(__webpack_require__(/*! @/utils/request/index.js */ 33));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  2202. /**
  2203. * 病害监测模块
  2204. */
  2205. // 病害监测数据请求父类函数
  2206. var pestRequest = /*#__PURE__*/function () {var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(url, data) {var res;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.next = 2;return (
  2207. _index.default.post("api/api_gateway?method=pest.pests.".concat(url), data));case 2:res = _context.sent;return _context.abrupt("return",
  2208. res === null || res === void 0 ? void 0 : res.data);case 4:case "end":return _context.stop();}}}, _callee);}));return function pestRequest(_x, _x2) {return _ref.apply(this, arguments);};}();
  2209. // 病虫害库
  2210. var loadPestList = function loadPestList(data) {return pestRequest('pests_info', data);};
  2211. // 虫害识别
  2212. exports.loadPestList = loadPestList;var handlePestDiscern = function handlePestDiscern(data) {return pestRequest('insect_discern', data);};
  2213. // 病害识别
  2214. exports.handlePestDiscern = handlePestDiscern;var handlePlantDiscern = function handlePlantDiscern(data) {return pestRequest('plant_discern', data);};exports.handlePlantDiscern = handlePlantDiscern;
  2215. /***/ }),
  2216. /***/ 12:
  2217. /*!***************************************!*\
  2218. !*** F:/工作项目/pingpu_H5/utils/tool.js ***!
  2219. \***************************************/
  2220. /*! no static exports found */
  2221. /***/ (function(module, exports, __webpack_require__) {
  2222. "use strict";
  2223. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.showModal = showModal;exports.pageScrollTo = exports.currentPage = exports.prePage = exports.hide = exports.loading = exports.msg = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 13));var _utils = __webpack_require__(/*! ./utils.js */ 16);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  2224. /**
  2225. * 全局uni api二次封装工具
  2226. */
  2227. //统一消息提醒
  2228. var msg = function msg(title) {var icon = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'none';var duration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1500;var mask = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  2229. //统一提示方便全局修改
  2230. if (Boolean(title) === false) {
  2231. return;
  2232. }
  2233. uni.showToast({
  2234. title: title,
  2235. duration: duration,
  2236. mask: mask,
  2237. icon: icon });
  2238. };
  2239. //showLoading状态
  2240. exports.msg = msg;var loading = function loading(title) {
  2241. uni.showLoading({
  2242. title: title,
  2243. mask: true });
  2244. };exports.loading = loading;
  2245. var hide = function hide() {
  2246. uni.hideLoading();
  2247. };
  2248. //确认模态框封装
  2249. exports.hide = hide;function showModal() {return _showModal.apply(this, arguments);}
  2250. // 函数用于获取上一页页面栈的实例
  2251. function _showModal() {_showModal = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var content,color,confirmText,res,_args = arguments;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:content = _args.length > 0 && _args[0] !== undefined ? _args[0] : "";color = _args.length > 1 && _args[1] !== undefined ? _args[1] : "#108DFC";confirmText = _args.length > 2 && _args[2] !== undefined ? _args[2] : "确定";_context.next = 5;return uni.showModal({ title: '提示', content: content, confirmColor: color, confirmText: confirmText });case 5:res = _context.sent;if (res[1].confirm) {_context.next = 8;break;}return _context.abrupt("return", false);case 8:return _context.abrupt("return", true);case 9:case "end":return _context.stop();}}}, _callee);}));return _showModal.apply(this, arguments);}var prePage = function prePage() {var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2;
  2252. return getCurrentPageCustom(index);
  2253. };
  2254. // 函数用于获取当前页面栈的实例
  2255. exports.prePage = prePage;var currentPage = function currentPage() {var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
  2256. return getCurrentPageCustom(index);
  2257. };
  2258. // 获取自定义页面栈
  2259. exports.currentPage = currentPage;function getCurrentPageCustom(index) {
  2260. var pages = getCurrentPages(); // 函数用于获取当前页面栈的实例
  2261. var prePage = pages[pages.length - index];
  2262. return prePage.$vm;
  2263. }
  2264. /**
  2265. * 页面滚动到指定位置
  2266. */
  2267. var pageScrollTo = function pageScrollTo(id) {var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
  2268. // 获取某元素距离顶部的距离
  2269. var query = uni.createSelectorQuery();
  2270. query.select(id).boundingClientRect(function (res) {
  2271. var scrollTop = res.top;
  2272. console.log(res);
  2273. // 开始滚动
  2274. uni.pageScrollTo({
  2275. scrollTop: scrollTop,
  2276. duration: duration });
  2277. }).exec();
  2278. };exports.pageScrollTo = pageScrollTo;
  2279. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2280. /***/ }),
  2281. /***/ 13:
  2282. /*!**********************************************************!*\
  2283. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  2284. \**********************************************************/
  2285. /*! no static exports found */
  2286. /***/ (function(module, exports, __webpack_require__) {
  2287. module.exports = __webpack_require__(/*! regenerator-runtime */ 14);
  2288. /***/ }),
  2289. /***/ 14:
  2290. /*!************************************************************!*\
  2291. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  2292. \************************************************************/
  2293. /*! no static exports found */
  2294. /***/ (function(module, exports, __webpack_require__) {
  2295. /**
  2296. * Copyright (c) 2014-present, Facebook, Inc.
  2297. *
  2298. * This source code is licensed under the MIT license found in the
  2299. * LICENSE file in the root directory of this source tree.
  2300. */
  2301. // This method of obtaining a reference to the global object needs to be
  2302. // kept identical to the way it is obtained in runtime.js
  2303. var g = (function() {
  2304. return this || (typeof self === "object" && self);
  2305. })() || Function("return this")();
  2306. // Use `getOwnPropertyNames` because not all browsers support calling
  2307. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  2308. var hadRuntime = g.regeneratorRuntime &&
  2309. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  2310. // Save the old regeneratorRuntime in case it needs to be restored later.
  2311. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  2312. // Force reevalutation of runtime.js.
  2313. g.regeneratorRuntime = undefined;
  2314. module.exports = __webpack_require__(/*! ./runtime */ 15);
  2315. if (hadRuntime) {
  2316. // Restore the original runtime.
  2317. g.regeneratorRuntime = oldRuntime;
  2318. } else {
  2319. // Remove the global property added by runtime.js.
  2320. try {
  2321. delete g.regeneratorRuntime;
  2322. } catch(e) {
  2323. g.regeneratorRuntime = undefined;
  2324. }
  2325. }
  2326. /***/ }),
  2327. /***/ 15:
  2328. /*!*****************************************************!*\
  2329. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  2330. \*****************************************************/
  2331. /*! no static exports found */
  2332. /***/ (function(module, exports) {
  2333. /**
  2334. * Copyright (c) 2014-present, Facebook, Inc.
  2335. *
  2336. * This source code is licensed under the MIT license found in the
  2337. * LICENSE file in the root directory of this source tree.
  2338. */
  2339. !(function(global) {
  2340. "use strict";
  2341. var Op = Object.prototype;
  2342. var hasOwn = Op.hasOwnProperty;
  2343. var undefined; // More compressible than void 0.
  2344. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  2345. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  2346. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  2347. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  2348. var inModule = typeof module === "object";
  2349. var runtime = global.regeneratorRuntime;
  2350. if (runtime) {
  2351. if (inModule) {
  2352. // If regeneratorRuntime is defined globally and we're in a module,
  2353. // make the exports object identical to regeneratorRuntime.
  2354. module.exports = runtime;
  2355. }
  2356. // Don't bother evaluating the rest of this file if the runtime was
  2357. // already defined globally.
  2358. return;
  2359. }
  2360. // Define the runtime globally (as expected by generated code) as either
  2361. // module.exports (if we're in a module) or a new, empty object.
  2362. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  2363. function wrap(innerFn, outerFn, self, tryLocsList) {
  2364. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  2365. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  2366. var generator = Object.create(protoGenerator.prototype);
  2367. var context = new Context(tryLocsList || []);
  2368. // The ._invoke method unifies the implementations of the .next,
  2369. // .throw, and .return methods.
  2370. generator._invoke = makeInvokeMethod(innerFn, self, context);
  2371. return generator;
  2372. }
  2373. runtime.wrap = wrap;
  2374. // Try/catch helper to minimize deoptimizations. Returns a completion
  2375. // record like context.tryEntries[i].completion. This interface could
  2376. // have been (and was previously) designed to take a closure to be
  2377. // invoked without arguments, but in all the cases we care about we
  2378. // already have an existing method we want to call, so there's no need
  2379. // to create a new function object. We can even get away with assuming
  2380. // the method takes exactly one argument, since that happens to be true
  2381. // in every case, so we don't have to touch the arguments object. The
  2382. // only additional allocation required is the completion record, which
  2383. // has a stable shape and so hopefully should be cheap to allocate.
  2384. function tryCatch(fn, obj, arg) {
  2385. try {
  2386. return { type: "normal", arg: fn.call(obj, arg) };
  2387. } catch (err) {
  2388. return { type: "throw", arg: err };
  2389. }
  2390. }
  2391. var GenStateSuspendedStart = "suspendedStart";
  2392. var GenStateSuspendedYield = "suspendedYield";
  2393. var GenStateExecuting = "executing";
  2394. var GenStateCompleted = "completed";
  2395. // Returning this object from the innerFn has the same effect as
  2396. // breaking out of the dispatch switch statement.
  2397. var ContinueSentinel = {};
  2398. // Dummy constructor functions that we use as the .constructor and
  2399. // .constructor.prototype properties for functions that return Generator
  2400. // objects. For full spec compliance, you may wish to configure your
  2401. // minifier not to mangle the names of these two functions.
  2402. function Generator() {}
  2403. function GeneratorFunction() {}
  2404. function GeneratorFunctionPrototype() {}
  2405. // This is a polyfill for %IteratorPrototype% for environments that
  2406. // don't natively support it.
  2407. var IteratorPrototype = {};
  2408. IteratorPrototype[iteratorSymbol] = function () {
  2409. return this;
  2410. };
  2411. var getProto = Object.getPrototypeOf;
  2412. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  2413. if (NativeIteratorPrototype &&
  2414. NativeIteratorPrototype !== Op &&
  2415. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  2416. // This environment has a native %IteratorPrototype%; use it instead
  2417. // of the polyfill.
  2418. IteratorPrototype = NativeIteratorPrototype;
  2419. }
  2420. var Gp = GeneratorFunctionPrototype.prototype =
  2421. Generator.prototype = Object.create(IteratorPrototype);
  2422. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  2423. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  2424. GeneratorFunctionPrototype[toStringTagSymbol] =
  2425. GeneratorFunction.displayName = "GeneratorFunction";
  2426. // Helper for defining the .next, .throw, and .return methods of the
  2427. // Iterator interface in terms of a single ._invoke method.
  2428. function defineIteratorMethods(prototype) {
  2429. ["next", "throw", "return"].forEach(function(method) {
  2430. prototype[method] = function(arg) {
  2431. return this._invoke(method, arg);
  2432. };
  2433. });
  2434. }
  2435. runtime.isGeneratorFunction = function(genFun) {
  2436. var ctor = typeof genFun === "function" && genFun.constructor;
  2437. return ctor
  2438. ? ctor === GeneratorFunction ||
  2439. // For the native GeneratorFunction constructor, the best we can
  2440. // do is to check its .name property.
  2441. (ctor.displayName || ctor.name) === "GeneratorFunction"
  2442. : false;
  2443. };
  2444. runtime.mark = function(genFun) {
  2445. if (Object.setPrototypeOf) {
  2446. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  2447. } else {
  2448. genFun.__proto__ = GeneratorFunctionPrototype;
  2449. if (!(toStringTagSymbol in genFun)) {
  2450. genFun[toStringTagSymbol] = "GeneratorFunction";
  2451. }
  2452. }
  2453. genFun.prototype = Object.create(Gp);
  2454. return genFun;
  2455. };
  2456. // Within the body of any async function, `await x` is transformed to
  2457. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  2458. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  2459. // meant to be awaited.
  2460. runtime.awrap = function(arg) {
  2461. return { __await: arg };
  2462. };
  2463. function AsyncIterator(generator) {
  2464. function invoke(method, arg, resolve, reject) {
  2465. var record = tryCatch(generator[method], generator, arg);
  2466. if (record.type === "throw") {
  2467. reject(record.arg);
  2468. } else {
  2469. var result = record.arg;
  2470. var value = result.value;
  2471. if (value &&
  2472. typeof value === "object" &&
  2473. hasOwn.call(value, "__await")) {
  2474. return Promise.resolve(value.__await).then(function(value) {
  2475. invoke("next", value, resolve, reject);
  2476. }, function(err) {
  2477. invoke("throw", err, resolve, reject);
  2478. });
  2479. }
  2480. return Promise.resolve(value).then(function(unwrapped) {
  2481. // When a yielded Promise is resolved, its final value becomes
  2482. // the .value of the Promise<{value,done}> result for the
  2483. // current iteration.
  2484. result.value = unwrapped;
  2485. resolve(result);
  2486. }, function(error) {
  2487. // If a rejected Promise was yielded, throw the rejection back
  2488. // into the async generator function so it can be handled there.
  2489. return invoke("throw", error, resolve, reject);
  2490. });
  2491. }
  2492. }
  2493. var previousPromise;
  2494. function enqueue(method, arg) {
  2495. function callInvokeWithMethodAndArg() {
  2496. return new Promise(function(resolve, reject) {
  2497. invoke(method, arg, resolve, reject);
  2498. });
  2499. }
  2500. return previousPromise =
  2501. // If enqueue has been called before, then we want to wait until
  2502. // all previous Promises have been resolved before calling invoke,
  2503. // so that results are always delivered in the correct order. If
  2504. // enqueue has not been called before, then it is important to
  2505. // call invoke immediately, without waiting on a callback to fire,
  2506. // so that the async generator function has the opportunity to do
  2507. // any necessary setup in a predictable way. This predictability
  2508. // is why the Promise constructor synchronously invokes its
  2509. // executor callback, and why async functions synchronously
  2510. // execute code before the first await. Since we implement simple
  2511. // async functions in terms of async generators, it is especially
  2512. // important to get this right, even though it requires care.
  2513. previousPromise ? previousPromise.then(
  2514. callInvokeWithMethodAndArg,
  2515. // Avoid propagating failures to Promises returned by later
  2516. // invocations of the iterator.
  2517. callInvokeWithMethodAndArg
  2518. ) : callInvokeWithMethodAndArg();
  2519. }
  2520. // Define the unified helper method that is used to implement .next,
  2521. // .throw, and .return (see defineIteratorMethods).
  2522. this._invoke = enqueue;
  2523. }
  2524. defineIteratorMethods(AsyncIterator.prototype);
  2525. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  2526. return this;
  2527. };
  2528. runtime.AsyncIterator = AsyncIterator;
  2529. // Note that simple async functions are implemented on top of
  2530. // AsyncIterator objects; they just return a Promise for the value of
  2531. // the final result produced by the iterator.
  2532. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  2533. var iter = new AsyncIterator(
  2534. wrap(innerFn, outerFn, self, tryLocsList)
  2535. );
  2536. return runtime.isGeneratorFunction(outerFn)
  2537. ? iter // If outerFn is a generator, return the full iterator.
  2538. : iter.next().then(function(result) {
  2539. return result.done ? result.value : iter.next();
  2540. });
  2541. };
  2542. function makeInvokeMethod(innerFn, self, context) {
  2543. var state = GenStateSuspendedStart;
  2544. return function invoke(method, arg) {
  2545. if (state === GenStateExecuting) {
  2546. throw new Error("Generator is already running");
  2547. }
  2548. if (state === GenStateCompleted) {
  2549. if (method === "throw") {
  2550. throw arg;
  2551. }
  2552. // Be forgiving, per 25.3.3.3.3 of the spec:
  2553. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  2554. return doneResult();
  2555. }
  2556. context.method = method;
  2557. context.arg = arg;
  2558. while (true) {
  2559. var delegate = context.delegate;
  2560. if (delegate) {
  2561. var delegateResult = maybeInvokeDelegate(delegate, context);
  2562. if (delegateResult) {
  2563. if (delegateResult === ContinueSentinel) continue;
  2564. return delegateResult;
  2565. }
  2566. }
  2567. if (context.method === "next") {
  2568. // Setting context._sent for legacy support of Babel's
  2569. // function.sent implementation.
  2570. context.sent = context._sent = context.arg;
  2571. } else if (context.method === "throw") {
  2572. if (state === GenStateSuspendedStart) {
  2573. state = GenStateCompleted;
  2574. throw context.arg;
  2575. }
  2576. context.dispatchException(context.arg);
  2577. } else if (context.method === "return") {
  2578. context.abrupt("return", context.arg);
  2579. }
  2580. state = GenStateExecuting;
  2581. var record = tryCatch(innerFn, self, context);
  2582. if (record.type === "normal") {
  2583. // If an exception is thrown from innerFn, we leave state ===
  2584. // GenStateExecuting and loop back for another invocation.
  2585. state = context.done
  2586. ? GenStateCompleted
  2587. : GenStateSuspendedYield;
  2588. if (record.arg === ContinueSentinel) {
  2589. continue;
  2590. }
  2591. return {
  2592. value: record.arg,
  2593. done: context.done
  2594. };
  2595. } else if (record.type === "throw") {
  2596. state = GenStateCompleted;
  2597. // Dispatch the exception by looping back around to the
  2598. // context.dispatchException(context.arg) call above.
  2599. context.method = "throw";
  2600. context.arg = record.arg;
  2601. }
  2602. }
  2603. };
  2604. }
  2605. // Call delegate.iterator[context.method](context.arg) and handle the
  2606. // result, either by returning a { value, done } result from the
  2607. // delegate iterator, or by modifying context.method and context.arg,
  2608. // setting context.delegate to null, and returning the ContinueSentinel.
  2609. function maybeInvokeDelegate(delegate, context) {
  2610. var method = delegate.iterator[context.method];
  2611. if (method === undefined) {
  2612. // A .throw or .return when the delegate iterator has no .throw
  2613. // method always terminates the yield* loop.
  2614. context.delegate = null;
  2615. if (context.method === "throw") {
  2616. if (delegate.iterator.return) {
  2617. // If the delegate iterator has a return method, give it a
  2618. // chance to clean up.
  2619. context.method = "return";
  2620. context.arg = undefined;
  2621. maybeInvokeDelegate(delegate, context);
  2622. if (context.method === "throw") {
  2623. // If maybeInvokeDelegate(context) changed context.method from
  2624. // "return" to "throw", let that override the TypeError below.
  2625. return ContinueSentinel;
  2626. }
  2627. }
  2628. context.method = "throw";
  2629. context.arg = new TypeError(
  2630. "The iterator does not provide a 'throw' method");
  2631. }
  2632. return ContinueSentinel;
  2633. }
  2634. var record = tryCatch(method, delegate.iterator, context.arg);
  2635. if (record.type === "throw") {
  2636. context.method = "throw";
  2637. context.arg = record.arg;
  2638. context.delegate = null;
  2639. return ContinueSentinel;
  2640. }
  2641. var info = record.arg;
  2642. if (! info) {
  2643. context.method = "throw";
  2644. context.arg = new TypeError("iterator result is not an object");
  2645. context.delegate = null;
  2646. return ContinueSentinel;
  2647. }
  2648. if (info.done) {
  2649. // Assign the result of the finished delegate to the temporary
  2650. // variable specified by delegate.resultName (see delegateYield).
  2651. context[delegate.resultName] = info.value;
  2652. // Resume execution at the desired location (see delegateYield).
  2653. context.next = delegate.nextLoc;
  2654. // If context.method was "throw" but the delegate handled the
  2655. // exception, let the outer generator proceed normally. If
  2656. // context.method was "next", forget context.arg since it has been
  2657. // "consumed" by the delegate iterator. If context.method was
  2658. // "return", allow the original .return call to continue in the
  2659. // outer generator.
  2660. if (context.method !== "return") {
  2661. context.method = "next";
  2662. context.arg = undefined;
  2663. }
  2664. } else {
  2665. // Re-yield the result returned by the delegate method.
  2666. return info;
  2667. }
  2668. // The delegate iterator is finished, so forget it and continue with
  2669. // the outer generator.
  2670. context.delegate = null;
  2671. return ContinueSentinel;
  2672. }
  2673. // Define Generator.prototype.{next,throw,return} in terms of the
  2674. // unified ._invoke helper method.
  2675. defineIteratorMethods(Gp);
  2676. Gp[toStringTagSymbol] = "Generator";
  2677. // A Generator should always return itself as the iterator object when the
  2678. // @@iterator function is called on it. Some browsers' implementations of the
  2679. // iterator prototype chain incorrectly implement this, causing the Generator
  2680. // object to not be returned from this call. This ensures that doesn't happen.
  2681. // See https://github.com/facebook/regenerator/issues/274 for more details.
  2682. Gp[iteratorSymbol] = function() {
  2683. return this;
  2684. };
  2685. Gp.toString = function() {
  2686. return "[object Generator]";
  2687. };
  2688. function pushTryEntry(locs) {
  2689. var entry = { tryLoc: locs[0] };
  2690. if (1 in locs) {
  2691. entry.catchLoc = locs[1];
  2692. }
  2693. if (2 in locs) {
  2694. entry.finallyLoc = locs[2];
  2695. entry.afterLoc = locs[3];
  2696. }
  2697. this.tryEntries.push(entry);
  2698. }
  2699. function resetTryEntry(entry) {
  2700. var record = entry.completion || {};
  2701. record.type = "normal";
  2702. delete record.arg;
  2703. entry.completion = record;
  2704. }
  2705. function Context(tryLocsList) {
  2706. // The root entry object (effectively a try statement without a catch
  2707. // or a finally block) gives us a place to store values thrown from
  2708. // locations where there is no enclosing try statement.
  2709. this.tryEntries = [{ tryLoc: "root" }];
  2710. tryLocsList.forEach(pushTryEntry, this);
  2711. this.reset(true);
  2712. }
  2713. runtime.keys = function(object) {
  2714. var keys = [];
  2715. for (var key in object) {
  2716. keys.push(key);
  2717. }
  2718. keys.reverse();
  2719. // Rather than returning an object with a next method, we keep
  2720. // things simple and return the next function itself.
  2721. return function next() {
  2722. while (keys.length) {
  2723. var key = keys.pop();
  2724. if (key in object) {
  2725. next.value = key;
  2726. next.done = false;
  2727. return next;
  2728. }
  2729. }
  2730. // To avoid creating an additional object, we just hang the .value
  2731. // and .done properties off the next function object itself. This
  2732. // also ensures that the minifier will not anonymize the function.
  2733. next.done = true;
  2734. return next;
  2735. };
  2736. };
  2737. function values(iterable) {
  2738. if (iterable) {
  2739. var iteratorMethod = iterable[iteratorSymbol];
  2740. if (iteratorMethod) {
  2741. return iteratorMethod.call(iterable);
  2742. }
  2743. if (typeof iterable.next === "function") {
  2744. return iterable;
  2745. }
  2746. if (!isNaN(iterable.length)) {
  2747. var i = -1, next = function next() {
  2748. while (++i < iterable.length) {
  2749. if (hasOwn.call(iterable, i)) {
  2750. next.value = iterable[i];
  2751. next.done = false;
  2752. return next;
  2753. }
  2754. }
  2755. next.value = undefined;
  2756. next.done = true;
  2757. return next;
  2758. };
  2759. return next.next = next;
  2760. }
  2761. }
  2762. // Return an iterator with no values.
  2763. return { next: doneResult };
  2764. }
  2765. runtime.values = values;
  2766. function doneResult() {
  2767. return { value: undefined, done: true };
  2768. }
  2769. Context.prototype = {
  2770. constructor: Context,
  2771. reset: function(skipTempReset) {
  2772. this.prev = 0;
  2773. this.next = 0;
  2774. // Resetting context._sent for legacy support of Babel's
  2775. // function.sent implementation.
  2776. this.sent = this._sent = undefined;
  2777. this.done = false;
  2778. this.delegate = null;
  2779. this.method = "next";
  2780. this.arg = undefined;
  2781. this.tryEntries.forEach(resetTryEntry);
  2782. if (!skipTempReset) {
  2783. for (var name in this) {
  2784. // Not sure about the optimal order of these conditions:
  2785. if (name.charAt(0) === "t" &&
  2786. hasOwn.call(this, name) &&
  2787. !isNaN(+name.slice(1))) {
  2788. this[name] = undefined;
  2789. }
  2790. }
  2791. }
  2792. },
  2793. stop: function() {
  2794. this.done = true;
  2795. var rootEntry = this.tryEntries[0];
  2796. var rootRecord = rootEntry.completion;
  2797. if (rootRecord.type === "throw") {
  2798. throw rootRecord.arg;
  2799. }
  2800. return this.rval;
  2801. },
  2802. dispatchException: function(exception) {
  2803. if (this.done) {
  2804. throw exception;
  2805. }
  2806. var context = this;
  2807. function handle(loc, caught) {
  2808. record.type = "throw";
  2809. record.arg = exception;
  2810. context.next = loc;
  2811. if (caught) {
  2812. // If the dispatched exception was caught by a catch block,
  2813. // then let that catch block handle the exception normally.
  2814. context.method = "next";
  2815. context.arg = undefined;
  2816. }
  2817. return !! caught;
  2818. }
  2819. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2820. var entry = this.tryEntries[i];
  2821. var record = entry.completion;
  2822. if (entry.tryLoc === "root") {
  2823. // Exception thrown outside of any try block that could handle
  2824. // it, so set the completion value of the entire function to
  2825. // throw the exception.
  2826. return handle("end");
  2827. }
  2828. if (entry.tryLoc <= this.prev) {
  2829. var hasCatch = hasOwn.call(entry, "catchLoc");
  2830. var hasFinally = hasOwn.call(entry, "finallyLoc");
  2831. if (hasCatch && hasFinally) {
  2832. if (this.prev < entry.catchLoc) {
  2833. return handle(entry.catchLoc, true);
  2834. } else if (this.prev < entry.finallyLoc) {
  2835. return handle(entry.finallyLoc);
  2836. }
  2837. } else if (hasCatch) {
  2838. if (this.prev < entry.catchLoc) {
  2839. return handle(entry.catchLoc, true);
  2840. }
  2841. } else if (hasFinally) {
  2842. if (this.prev < entry.finallyLoc) {
  2843. return handle(entry.finallyLoc);
  2844. }
  2845. } else {
  2846. throw new Error("try statement without catch or finally");
  2847. }
  2848. }
  2849. }
  2850. },
  2851. abrupt: function(type, arg) {
  2852. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2853. var entry = this.tryEntries[i];
  2854. if (entry.tryLoc <= this.prev &&
  2855. hasOwn.call(entry, "finallyLoc") &&
  2856. this.prev < entry.finallyLoc) {
  2857. var finallyEntry = entry;
  2858. break;
  2859. }
  2860. }
  2861. if (finallyEntry &&
  2862. (type === "break" ||
  2863. type === "continue") &&
  2864. finallyEntry.tryLoc <= arg &&
  2865. arg <= finallyEntry.finallyLoc) {
  2866. // Ignore the finally entry if control is not jumping to a
  2867. // location outside the try/catch block.
  2868. finallyEntry = null;
  2869. }
  2870. var record = finallyEntry ? finallyEntry.completion : {};
  2871. record.type = type;
  2872. record.arg = arg;
  2873. if (finallyEntry) {
  2874. this.method = "next";
  2875. this.next = finallyEntry.finallyLoc;
  2876. return ContinueSentinel;
  2877. }
  2878. return this.complete(record);
  2879. },
  2880. complete: function(record, afterLoc) {
  2881. if (record.type === "throw") {
  2882. throw record.arg;
  2883. }
  2884. if (record.type === "break" ||
  2885. record.type === "continue") {
  2886. this.next = record.arg;
  2887. } else if (record.type === "return") {
  2888. this.rval = this.arg = record.arg;
  2889. this.method = "return";
  2890. this.next = "end";
  2891. } else if (record.type === "normal" && afterLoc) {
  2892. this.next = afterLoc;
  2893. }
  2894. return ContinueSentinel;
  2895. },
  2896. finish: function(finallyLoc) {
  2897. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2898. var entry = this.tryEntries[i];
  2899. if (entry.finallyLoc === finallyLoc) {
  2900. this.complete(entry.completion, entry.afterLoc);
  2901. resetTryEntry(entry);
  2902. return ContinueSentinel;
  2903. }
  2904. }
  2905. },
  2906. "catch": function(tryLoc) {
  2907. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2908. var entry = this.tryEntries[i];
  2909. if (entry.tryLoc === tryLoc) {
  2910. var record = entry.completion;
  2911. if (record.type === "throw") {
  2912. var thrown = record.arg;
  2913. resetTryEntry(entry);
  2914. }
  2915. return thrown;
  2916. }
  2917. }
  2918. // The context.catch method must only be called with a location
  2919. // argument that corresponds to a known catch block.
  2920. throw new Error("illegal catch attempt");
  2921. },
  2922. delegateYield: function(iterable, resultName, nextLoc) {
  2923. this.delegate = {
  2924. iterator: values(iterable),
  2925. resultName: resultName,
  2926. nextLoc: nextLoc
  2927. };
  2928. if (this.method === "next") {
  2929. // Deliberately forget the last sent value so that we don't
  2930. // accidentally pass it on to the delegate.
  2931. this.arg = undefined;
  2932. }
  2933. return ContinueSentinel;
  2934. }
  2935. };
  2936. })(
  2937. // In sloppy mode, unbound `this` refers to the global object, fallback to
  2938. // Function constructor if we're in global strict mode. That is sadly a form
  2939. // of indirect eval which violates Content Security Policy.
  2940. (function() {
  2941. return this || (typeof self === "object" && self);
  2942. })() || Function("return this")()
  2943. );
  2944. /***/ }),
  2945. /***/ 16:
  2946. /*!****************************************!*\
  2947. !*** F:/工作项目/pingpu_H5/utils/utils.js ***!
  2948. \****************************************/
  2949. /*! no static exports found */
  2950. /***/ (function(module, exports, __webpack_require__) {
  2951. "use strict";
  2952. Object.defineProperty(exports, "__esModule", { value: true });exports.timeFormat = timeFormat;exports.dateToUnix = dateToUnix;exports.timeFrame = timeFrame;exports.createMap = exports.throttle = exports.debounce = exports.deepClone = exports.jsonClone = exports.$parent = exports.sleep = void 0;var _this = void 0;function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;} /**
  2953. * 全局工具类
  2954. */
  2955. /**
  2956. * 进行延时,以达到可以简写代码的目的
  2957. */
  2958. var sleep = function sleep() {var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 30;
  2959. return new Promise(function (resolve) {
  2960. setTimeout(function () {
  2961. resolve();
  2962. }, value);
  2963. });
  2964. };
  2965. // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  2966. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  2967. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  2968. // 值(默认为undefined),就是查找最顶层的$parent
  2969. exports.sleep = sleep;var $parent = function $parent() {var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  2970. var parent = _this.$parent;
  2971. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  2972. while (parent) {
  2973. // 父组件
  2974. if (parent.$options && parent.$options.name !== name) {
  2975. // 如果组件的name不相等,继续上一级寻找
  2976. parent = parent.$parent;
  2977. } else {
  2978. return parent;
  2979. }
  2980. }
  2981. return false;
  2982. };
  2983. // json数据克隆
  2984. exports.$parent = $parent;var jsonClone = function jsonClone(obj) {
  2985. // 对常见的“非”值,直接返回原来值
  2986. return JSON.parse(JSON.stringify(obj));
  2987. };
  2988. // 深度克隆
  2989. exports.jsonClone = jsonClone;var deepClone = function deepClone(obj) {
  2990. // 对常见的“非”值,直接返回原来值
  2991. if ([null, undefined, NaN, false].includes(obj)) return obj;
  2992. if (typeof obj !== 'object' && typeof obj !== 'function') {
  2993. // 原始类型直接返回
  2994. return obj;
  2995. }
  2996. var o = test.array(obj) ? [] : {};
  2997. for (var i in obj) {
  2998. if (obj.hasOwnProperty(i)) {
  2999. o[i] = typeof obj[i] === 'object' ? deepClone(obj[i]) : obj[i];
  3000. }
  3001. }
  3002. return o;
  3003. };
  3004. /**
  3005. * 防抖函数
  3006. */exports.deepClone = deepClone;
  3007. var debounce = function debounce(fn, context) {var delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 500;
  3008. var timer;
  3009. return function () {for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}
  3010. if (timer) {
  3011. clearTimeout(timer);
  3012. }
  3013. timer = setTimeout(function () {
  3014. fn.apply(context, args);
  3015. }, delay);
  3016. };
  3017. };
  3018. /**
  3019. * 节流函数
  3020. */exports.debounce = debounce;
  3021. var throttle = function throttle(fn, context) {var wait = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 500;
  3022. var flag = true;
  3023. return function () {
  3024. if (flag) {
  3025. flag = false;for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {args[_key2] = arguments[_key2];}
  3026. fn.apply(context, args); //立即执行
  3027. setTimeout(function () {
  3028. flag = true;
  3029. }, wait);
  3030. }
  3031. };
  3032. };
  3033. /**
  3034. * 根据属性数组创建一个新对象
  3035. * @param {Object} obj 对象数据
  3036. * @param { Array} keys 需要提取的字段集合
  3037. */exports.throttle = throttle;
  3038. var createMap = function createMap(obj, keys) {
  3039. return keys.reduce(function (result, key) {
  3040. if (obj.hasOwnProperty(key)) {
  3041. result[key] = obj[key];
  3042. }
  3043. return result;
  3044. }, {});
  3045. };
  3046. /**
  3047. * @description 格式化时间
  3048. * @param {String|Number} dateTime 需要格式化的时间戳
  3049. * @param {String} fmt 格式化规则 yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等 ss 秒,可自定义组合 默认yyyy-mm-dd
  3050. * @returns {string} 返回格式化后的字符串
  3051. */exports.createMap = createMap;
  3052. function timeFormat() {var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var formatStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd hh:MM:ss';
  3053. var date;
  3054. // 若传入时间为假值,则取当前时间
  3055. if (!dateTime) {
  3056. date = new Date();
  3057. }
  3058. // 若为unix秒时间戳,则转为毫秒时间戳(逻辑有点奇怪,但不敢改,以保证历史兼容)
  3059. else if (/^\d{10}$/.test(dateTime === null || dateTime === void 0 ? void 0 : dateTime.toString().trim())) {
  3060. date = new Date(dateTime * 1000);
  3061. }
  3062. // 若用户传入字符串格式时间戳,new Date无法解析,需做兼容
  3063. else if (typeof dateTime === 'string' && /^\d+$/.test(dateTime.trim())) {
  3064. date = new Date(Number(dateTime));
  3065. }
  3066. // 其他都认为符合 RFC 2822 规范
  3067. else {
  3068. // 处理平台性差异,在Safari/Webkit中,new Date仅支持/作为分割符的字符串时间
  3069. date = new Date(
  3070. typeof dateTime === 'string' ?
  3071. dateTime.replace(/-/g, '/') :
  3072. dateTime);
  3073. }
  3074. var timeSource = {
  3075. 'y': date.getFullYear().toString(), // 年
  3076. 'm': (date.getMonth() + 1).toString().padStart(2, '0'), // 月
  3077. 'd': date.getDate().toString().padStart(2, '0'), // 日
  3078. 'h': date.getHours().toString().padStart(2, '0'), // 时
  3079. 'M': date.getMinutes().toString().padStart(2, '0'), // 分
  3080. 's': date.getSeconds().toString().padStart(2, '0') // 秒
  3081. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  3082. };
  3083. for (var key in timeSource) {var _ref =
  3084. new RegExp("".concat(key, "+")).exec(formatStr) || [],_ref2 = _slicedToArray(_ref, 1),ret = _ref2[0];
  3085. if (ret) {
  3086. // 年可能只需展示两位
  3087. var beginIndex = key === 'y' && ret.length === 2 ? 2 : 0;
  3088. formatStr = formatStr.replace(ret, timeSource[key].slice(beginIndex));
  3089. }
  3090. }
  3091. return formatStr;
  3092. }
  3093. // 日期字符串转秒级时间戳
  3094. function dateToUnix(dateText) {
  3095. var times = new Date(dateText);
  3096. return times.getTime() / 1000;
  3097. }
  3098. /**
  3099. * 获取一天的时间戳
  3100. * @param {String} type
  3101. */
  3102. function timeFrame() {var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'start';
  3103. var timestamp = Date.parse(new Date());
  3104. var date = new Date(timestamp);
  3105. var Y = date.getUTCFullYear();
  3106. var M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
  3107. var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
  3108. var startTime = Date.parse(Y + '/' + M + '/' + D + ' ' + '00:00:00');
  3109. var endTime = Date.parse(Y + '/' + M + '/' + D + ' ' + '23:59:59');
  3110. return type == 'start' ? startTime / 1000 : endTime / 1000;
  3111. }
  3112. /***/ }),
  3113. /***/ 17:
  3114. /*!******************************************!*\
  3115. !*** F:/工作项目/pingpu_H5/filters/index.js ***!
  3116. \******************************************/
  3117. /*! no static exports found */
  3118. /***/ (function(module, exports, __webpack_require__) {
  3119. "use strict";
  3120. Object.defineProperty(exports, "__esModule", { value: true });exports.timeFrom = timeFrom;var util = _interopRequireWildcard(__webpack_require__(/*! @/utils/utils.js */ 16));function _getRequireWildcardCache() {if (typeof WeakMap !== "function") return null;var cache = new WeakMap();_getRequireWildcardCache = function _getRequireWildcardCache() {return cache;};return cache;}function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;}if (obj === null || typeof obj !== "object" && typeof obj !== "function") {return { default: obj };}var cache = _getRequireWildcardCache();if (cache && cache.has(obj)) {return cache.get(obj);}var newObj = {};var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;if (desc && (desc.get || desc.set)) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}newObj.default = obj;if (cache) {cache.set(obj, newObj);}return newObj;}
  3121. /**/
  3122. /**
  3123. * 格式化日期
  3124. * @param {*} value
  3125. * @param {*} num
  3126. * @returns
  3127. */
  3128. function timeFrom(value) {var formatStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd hh:MM:ss';
  3129. return util.timeFormat(value, formatStr);
  3130. }
  3131. /***/ }),
  3132. /***/ 192:
  3133. /*!*****************************************************************************!*\
  3134. !*** F:/工作项目/pingpu_H5/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  3135. \*****************************************************************************/
  3136. /*! no static exports found */
  3137. /***/ (function(module, exports, __webpack_require__) {
  3138. "use strict";
  3139. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  3140. "id": "2852637",
  3141. "name": "uniui图标库",
  3142. "font_family": "uniicons",
  3143. "css_prefix_text": "uniui-",
  3144. "description": "",
  3145. "glyphs": [
  3146. {
  3147. "icon_id": "25027049",
  3148. "name": "yanse",
  3149. "font_class": "color",
  3150. "unicode": "e6cf",
  3151. "unicode_decimal": 59087 },
  3152. {
  3153. "icon_id": "25027048",
  3154. "name": "wallet",
  3155. "font_class": "wallet",
  3156. "unicode": "e6b1",
  3157. "unicode_decimal": 59057 },
  3158. {
  3159. "icon_id": "25015720",
  3160. "name": "settings-filled",
  3161. "font_class": "settings-filled",
  3162. "unicode": "e6ce",
  3163. "unicode_decimal": 59086 },
  3164. {
  3165. "icon_id": "25015434",
  3166. "name": "shimingrenzheng-filled",
  3167. "font_class": "auth-filled",
  3168. "unicode": "e6cc",
  3169. "unicode_decimal": 59084 },
  3170. {
  3171. "icon_id": "24934246",
  3172. "name": "shop-filled",
  3173. "font_class": "shop-filled",
  3174. "unicode": "e6cd",
  3175. "unicode_decimal": 59085 },
  3176. {
  3177. "icon_id": "24934159",
  3178. "name": "staff-filled-01",
  3179. "font_class": "staff-filled",
  3180. "unicode": "e6cb",
  3181. "unicode_decimal": 59083 },
  3182. {
  3183. "icon_id": "24932461",
  3184. "name": "VIP-filled",
  3185. "font_class": "vip-filled",
  3186. "unicode": "e6c6",
  3187. "unicode_decimal": 59078 },
  3188. {
  3189. "icon_id": "24932462",
  3190. "name": "plus_circle_fill",
  3191. "font_class": "plus-filled",
  3192. "unicode": "e6c7",
  3193. "unicode_decimal": 59079 },
  3194. {
  3195. "icon_id": "24932463",
  3196. "name": "folder_add-filled",
  3197. "font_class": "folder-add-filled",
  3198. "unicode": "e6c8",
  3199. "unicode_decimal": 59080 },
  3200. {
  3201. "icon_id": "24932464",
  3202. "name": "yanse-filled",
  3203. "font_class": "color-filled",
  3204. "unicode": "e6c9",
  3205. "unicode_decimal": 59081 },
  3206. {
  3207. "icon_id": "24932465",
  3208. "name": "tune-filled",
  3209. "font_class": "tune-filled",
  3210. "unicode": "e6ca",
  3211. "unicode_decimal": 59082 },
  3212. {
  3213. "icon_id": "24932455",
  3214. "name": "a-rilidaka-filled",
  3215. "font_class": "calendar-filled",
  3216. "unicode": "e6c0",
  3217. "unicode_decimal": 59072 },
  3218. {
  3219. "icon_id": "24932456",
  3220. "name": "notification-filled",
  3221. "font_class": "notification-filled",
  3222. "unicode": "e6c1",
  3223. "unicode_decimal": 59073 },
  3224. {
  3225. "icon_id": "24932457",
  3226. "name": "wallet-filled",
  3227. "font_class": "wallet-filled",
  3228. "unicode": "e6c2",
  3229. "unicode_decimal": 59074 },
  3230. {
  3231. "icon_id": "24932458",
  3232. "name": "paihangbang-filled",
  3233. "font_class": "medal-filled",
  3234. "unicode": "e6c3",
  3235. "unicode_decimal": 59075 },
  3236. {
  3237. "icon_id": "24932459",
  3238. "name": "gift-filled",
  3239. "font_class": "gift-filled",
  3240. "unicode": "e6c4",
  3241. "unicode_decimal": 59076 },
  3242. {
  3243. "icon_id": "24932460",
  3244. "name": "fire-filled",
  3245. "font_class": "fire-filled",
  3246. "unicode": "e6c5",
  3247. "unicode_decimal": 59077 },
  3248. {
  3249. "icon_id": "24928001",
  3250. "name": "refreshempty",
  3251. "font_class": "refreshempty",
  3252. "unicode": "e6bf",
  3253. "unicode_decimal": 59071 },
  3254. {
  3255. "icon_id": "24926853",
  3256. "name": "location-ellipse",
  3257. "font_class": "location-filled",
  3258. "unicode": "e6af",
  3259. "unicode_decimal": 59055 },
  3260. {
  3261. "icon_id": "24926735",
  3262. "name": "person-filled",
  3263. "font_class": "person-filled",
  3264. "unicode": "e69d",
  3265. "unicode_decimal": 59037 },
  3266. {
  3267. "icon_id": "24926703",
  3268. "name": "personadd-filled",
  3269. "font_class": "personadd-filled",
  3270. "unicode": "e698",
  3271. "unicode_decimal": 59032 },
  3272. {
  3273. "icon_id": "24923351",
  3274. "name": "back",
  3275. "font_class": "back",
  3276. "unicode": "e6b9",
  3277. "unicode_decimal": 59065 },
  3278. {
  3279. "icon_id": "24923352",
  3280. "name": "forward",
  3281. "font_class": "forward",
  3282. "unicode": "e6ba",
  3283. "unicode_decimal": 59066 },
  3284. {
  3285. "icon_id": "24923353",
  3286. "name": "arrowthinright",
  3287. "font_class": "arrow-right",
  3288. "unicode": "e6bb",
  3289. "unicode_decimal": 59067 },
  3290. {
  3291. "icon_id": "24923353",
  3292. "name": "arrowthinright",
  3293. "font_class": "arrowthinright",
  3294. "unicode": "e6bb",
  3295. "unicode_decimal": 59067 },
  3296. {
  3297. "icon_id": "24923354",
  3298. "name": "arrowthinleft",
  3299. "font_class": "arrow-left",
  3300. "unicode": "e6bc",
  3301. "unicode_decimal": 59068 },
  3302. {
  3303. "icon_id": "24923354",
  3304. "name": "arrowthinleft",
  3305. "font_class": "arrowthinleft",
  3306. "unicode": "e6bc",
  3307. "unicode_decimal": 59068 },
  3308. {
  3309. "icon_id": "24923355",
  3310. "name": "arrowthinup",
  3311. "font_class": "arrow-up",
  3312. "unicode": "e6bd",
  3313. "unicode_decimal": 59069 },
  3314. {
  3315. "icon_id": "24923355",
  3316. "name": "arrowthinup",
  3317. "font_class": "arrowthinup",
  3318. "unicode": "e6bd",
  3319. "unicode_decimal": 59069 },
  3320. {
  3321. "icon_id": "24923356",
  3322. "name": "arrowthindown",
  3323. "font_class": "arrow-down",
  3324. "unicode": "e6be",
  3325. "unicode_decimal": 59070 },
  3326. {
  3327. "icon_id": "24923356",
  3328. "name": "arrowthindown",
  3329. "font_class": "arrowthindown",
  3330. "unicode": "e6be",
  3331. "unicode_decimal": 59070 },
  3332. {
  3333. "icon_id": "24923349",
  3334. "name": "arrowdown",
  3335. "font_class": "bottom",
  3336. "unicode": "e6b8",
  3337. "unicode_decimal": 59064 },
  3338. {
  3339. "icon_id": "24923349",
  3340. "name": "arrowdown",
  3341. "font_class": "arrowdown",
  3342. "unicode": "e6b8",
  3343. "unicode_decimal": 59064 },
  3344. {
  3345. "icon_id": "24923346",
  3346. "name": "arrowright",
  3347. "font_class": "right",
  3348. "unicode": "e6b5",
  3349. "unicode_decimal": 59061 },
  3350. {
  3351. "icon_id": "24923346",
  3352. "name": "arrowright",
  3353. "font_class": "arrowright",
  3354. "unicode": "e6b5",
  3355. "unicode_decimal": 59061 },
  3356. {
  3357. "icon_id": "24923347",
  3358. "name": "arrowup",
  3359. "font_class": "top",
  3360. "unicode": "e6b6",
  3361. "unicode_decimal": 59062 },
  3362. {
  3363. "icon_id": "24923347",
  3364. "name": "arrowup",
  3365. "font_class": "arrowup",
  3366. "unicode": "e6b6",
  3367. "unicode_decimal": 59062 },
  3368. {
  3369. "icon_id": "24923348",
  3370. "name": "arrowleft",
  3371. "font_class": "left",
  3372. "unicode": "e6b7",
  3373. "unicode_decimal": 59063 },
  3374. {
  3375. "icon_id": "24923348",
  3376. "name": "arrowleft",
  3377. "font_class": "arrowleft",
  3378. "unicode": "e6b7",
  3379. "unicode_decimal": 59063 },
  3380. {
  3381. "icon_id": "24923334",
  3382. "name": "eye",
  3383. "font_class": "eye",
  3384. "unicode": "e651",
  3385. "unicode_decimal": 58961 },
  3386. {
  3387. "icon_id": "24923335",
  3388. "name": "eye-filled",
  3389. "font_class": "eye-filled",
  3390. "unicode": "e66a",
  3391. "unicode_decimal": 58986 },
  3392. {
  3393. "icon_id": "24923336",
  3394. "name": "eye-slash",
  3395. "font_class": "eye-slash",
  3396. "unicode": "e6b3",
  3397. "unicode_decimal": 59059 },
  3398. {
  3399. "icon_id": "24923337",
  3400. "name": "eye-slash-filled",
  3401. "font_class": "eye-slash-filled",
  3402. "unicode": "e6b4",
  3403. "unicode_decimal": 59060 },
  3404. {
  3405. "icon_id": "24923305",
  3406. "name": "info-filled",
  3407. "font_class": "info-filled",
  3408. "unicode": "e649",
  3409. "unicode_decimal": 58953 },
  3410. {
  3411. "icon_id": "24923299",
  3412. "name": "reload-01",
  3413. "font_class": "reload",
  3414. "unicode": "e6b2",
  3415. "unicode_decimal": 59058 },
  3416. {
  3417. "icon_id": "24923195",
  3418. "name": "mic_slash_fill",
  3419. "font_class": "micoff-filled",
  3420. "unicode": "e6b0",
  3421. "unicode_decimal": 59056 },
  3422. {
  3423. "icon_id": "24923165",
  3424. "name": "map-pin-ellipse",
  3425. "font_class": "map-pin-ellipse",
  3426. "unicode": "e6ac",
  3427. "unicode_decimal": 59052 },
  3428. {
  3429. "icon_id": "24923166",
  3430. "name": "map-pin",
  3431. "font_class": "map-pin",
  3432. "unicode": "e6ad",
  3433. "unicode_decimal": 59053 },
  3434. {
  3435. "icon_id": "24923167",
  3436. "name": "location",
  3437. "font_class": "location",
  3438. "unicode": "e6ae",
  3439. "unicode_decimal": 59054 },
  3440. {
  3441. "icon_id": "24923064",
  3442. "name": "starhalf",
  3443. "font_class": "starhalf",
  3444. "unicode": "e683",
  3445. "unicode_decimal": 59011 },
  3446. {
  3447. "icon_id": "24923065",
  3448. "name": "star",
  3449. "font_class": "star",
  3450. "unicode": "e688",
  3451. "unicode_decimal": 59016 },
  3452. {
  3453. "icon_id": "24923066",
  3454. "name": "star-filled",
  3455. "font_class": "star-filled",
  3456. "unicode": "e68f",
  3457. "unicode_decimal": 59023 },
  3458. {
  3459. "icon_id": "24899646",
  3460. "name": "a-rilidaka",
  3461. "font_class": "calendar",
  3462. "unicode": "e6a0",
  3463. "unicode_decimal": 59040 },
  3464. {
  3465. "icon_id": "24899647",
  3466. "name": "fire",
  3467. "font_class": "fire",
  3468. "unicode": "e6a1",
  3469. "unicode_decimal": 59041 },
  3470. {
  3471. "icon_id": "24899648",
  3472. "name": "paihangbang",
  3473. "font_class": "medal",
  3474. "unicode": "e6a2",
  3475. "unicode_decimal": 59042 },
  3476. {
  3477. "icon_id": "24899649",
  3478. "name": "font",
  3479. "font_class": "font",
  3480. "unicode": "e6a3",
  3481. "unicode_decimal": 59043 },
  3482. {
  3483. "icon_id": "24899650",
  3484. "name": "gift",
  3485. "font_class": "gift",
  3486. "unicode": "e6a4",
  3487. "unicode_decimal": 59044 },
  3488. {
  3489. "icon_id": "24899651",
  3490. "name": "link",
  3491. "font_class": "link",
  3492. "unicode": "e6a5",
  3493. "unicode_decimal": 59045 },
  3494. {
  3495. "icon_id": "24899652",
  3496. "name": "notification",
  3497. "font_class": "notification",
  3498. "unicode": "e6a6",
  3499. "unicode_decimal": 59046 },
  3500. {
  3501. "icon_id": "24899653",
  3502. "name": "staff",
  3503. "font_class": "staff",
  3504. "unicode": "e6a7",
  3505. "unicode_decimal": 59047 },
  3506. {
  3507. "icon_id": "24899654",
  3508. "name": "VIP",
  3509. "font_class": "vip",
  3510. "unicode": "e6a8",
  3511. "unicode_decimal": 59048 },
  3512. {
  3513. "icon_id": "24899655",
  3514. "name": "folder_add",
  3515. "font_class": "folder-add",
  3516. "unicode": "e6a9",
  3517. "unicode_decimal": 59049 },
  3518. {
  3519. "icon_id": "24899656",
  3520. "name": "tune",
  3521. "font_class": "tune",
  3522. "unicode": "e6aa",
  3523. "unicode_decimal": 59050 },
  3524. {
  3525. "icon_id": "24899657",
  3526. "name": "shimingrenzheng",
  3527. "font_class": "auth",
  3528. "unicode": "e6ab",
  3529. "unicode_decimal": 59051 },
  3530. {
  3531. "icon_id": "24899565",
  3532. "name": "person",
  3533. "font_class": "person",
  3534. "unicode": "e699",
  3535. "unicode_decimal": 59033 },
  3536. {
  3537. "icon_id": "24899566",
  3538. "name": "email-filled",
  3539. "font_class": "email-filled",
  3540. "unicode": "e69a",
  3541. "unicode_decimal": 59034 },
  3542. {
  3543. "icon_id": "24899567",
  3544. "name": "phone-filled",
  3545. "font_class": "phone-filled",
  3546. "unicode": "e69b",
  3547. "unicode_decimal": 59035 },
  3548. {
  3549. "icon_id": "24899568",
  3550. "name": "phone",
  3551. "font_class": "phone",
  3552. "unicode": "e69c",
  3553. "unicode_decimal": 59036 },
  3554. {
  3555. "icon_id": "24899570",
  3556. "name": "email",
  3557. "font_class": "email",
  3558. "unicode": "e69e",
  3559. "unicode_decimal": 59038 },
  3560. {
  3561. "icon_id": "24899571",
  3562. "name": "personadd",
  3563. "font_class": "personadd",
  3564. "unicode": "e69f",
  3565. "unicode_decimal": 59039 },
  3566. {
  3567. "icon_id": "24899558",
  3568. "name": "chatboxes-filled",
  3569. "font_class": "chatboxes-filled",
  3570. "unicode": "e692",
  3571. "unicode_decimal": 59026 },
  3572. {
  3573. "icon_id": "24899559",
  3574. "name": "contact",
  3575. "font_class": "contact",
  3576. "unicode": "e693",
  3577. "unicode_decimal": 59027 },
  3578. {
  3579. "icon_id": "24899560",
  3580. "name": "chatbubble-filled",
  3581. "font_class": "chatbubble-filled",
  3582. "unicode": "e694",
  3583. "unicode_decimal": 59028 },
  3584. {
  3585. "icon_id": "24899561",
  3586. "name": "contact-filled",
  3587. "font_class": "contact-filled",
  3588. "unicode": "e695",
  3589. "unicode_decimal": 59029 },
  3590. {
  3591. "icon_id": "24899562",
  3592. "name": "chatboxes",
  3593. "font_class": "chatboxes",
  3594. "unicode": "e696",
  3595. "unicode_decimal": 59030 },
  3596. {
  3597. "icon_id": "24899563",
  3598. "name": "chatbubble",
  3599. "font_class": "chatbubble",
  3600. "unicode": "e697",
  3601. "unicode_decimal": 59031 },
  3602. {
  3603. "icon_id": "24881290",
  3604. "name": "upload-filled",
  3605. "font_class": "upload-filled",
  3606. "unicode": "e68e",
  3607. "unicode_decimal": 59022 },
  3608. {
  3609. "icon_id": "24881292",
  3610. "name": "upload",
  3611. "font_class": "upload",
  3612. "unicode": "e690",
  3613. "unicode_decimal": 59024 },
  3614. {
  3615. "icon_id": "24881293",
  3616. "name": "weixin",
  3617. "font_class": "weixin",
  3618. "unicode": "e691",
  3619. "unicode_decimal": 59025 },
  3620. {
  3621. "icon_id": "24881274",
  3622. "name": "compose",
  3623. "font_class": "compose",
  3624. "unicode": "e67f",
  3625. "unicode_decimal": 59007 },
  3626. {
  3627. "icon_id": "24881275",
  3628. "name": "qq",
  3629. "font_class": "qq",
  3630. "unicode": "e680",
  3631. "unicode_decimal": 59008 },
  3632. {
  3633. "icon_id": "24881276",
  3634. "name": "download-filled",
  3635. "font_class": "download-filled",
  3636. "unicode": "e681",
  3637. "unicode_decimal": 59009 },
  3638. {
  3639. "icon_id": "24881277",
  3640. "name": "pengyouquan",
  3641. "font_class": "pyq",
  3642. "unicode": "e682",
  3643. "unicode_decimal": 59010 },
  3644. {
  3645. "icon_id": "24881279",
  3646. "name": "sound",
  3647. "font_class": "sound",
  3648. "unicode": "e684",
  3649. "unicode_decimal": 59012 },
  3650. {
  3651. "icon_id": "24881280",
  3652. "name": "trash-filled",
  3653. "font_class": "trash-filled",
  3654. "unicode": "e685",
  3655. "unicode_decimal": 59013 },
  3656. {
  3657. "icon_id": "24881281",
  3658. "name": "sound-filled",
  3659. "font_class": "sound-filled",
  3660. "unicode": "e686",
  3661. "unicode_decimal": 59014 },
  3662. {
  3663. "icon_id": "24881282",
  3664. "name": "trash",
  3665. "font_class": "trash",
  3666. "unicode": "e687",
  3667. "unicode_decimal": 59015 },
  3668. {
  3669. "icon_id": "24881284",
  3670. "name": "videocam-filled",
  3671. "font_class": "videocam-filled",
  3672. "unicode": "e689",
  3673. "unicode_decimal": 59017 },
  3674. {
  3675. "icon_id": "24881285",
  3676. "name": "spinner-cycle",
  3677. "font_class": "spinner-cycle",
  3678. "unicode": "e68a",
  3679. "unicode_decimal": 59018 },
  3680. {
  3681. "icon_id": "24881286",
  3682. "name": "weibo",
  3683. "font_class": "weibo",
  3684. "unicode": "e68b",
  3685. "unicode_decimal": 59019 },
  3686. {
  3687. "icon_id": "24881288",
  3688. "name": "videocam",
  3689. "font_class": "videocam",
  3690. "unicode": "e68c",
  3691. "unicode_decimal": 59020 },
  3692. {
  3693. "icon_id": "24881289",
  3694. "name": "download",
  3695. "font_class": "download",
  3696. "unicode": "e68d",
  3697. "unicode_decimal": 59021 },
  3698. {
  3699. "icon_id": "24879601",
  3700. "name": "help",
  3701. "font_class": "help",
  3702. "unicode": "e679",
  3703. "unicode_decimal": 59001 },
  3704. {
  3705. "icon_id": "24879602",
  3706. "name": "navigate-filled",
  3707. "font_class": "navigate-filled",
  3708. "unicode": "e67a",
  3709. "unicode_decimal": 59002 },
  3710. {
  3711. "icon_id": "24879603",
  3712. "name": "plusempty",
  3713. "font_class": "plusempty",
  3714. "unicode": "e67b",
  3715. "unicode_decimal": 59003 },
  3716. {
  3717. "icon_id": "24879604",
  3718. "name": "smallcircle",
  3719. "font_class": "smallcircle",
  3720. "unicode": "e67c",
  3721. "unicode_decimal": 59004 },
  3722. {
  3723. "icon_id": "24879605",
  3724. "name": "minus-filled",
  3725. "font_class": "minus-filled",
  3726. "unicode": "e67d",
  3727. "unicode_decimal": 59005 },
  3728. {
  3729. "icon_id": "24879606",
  3730. "name": "micoff",
  3731. "font_class": "micoff",
  3732. "unicode": "e67e",
  3733. "unicode_decimal": 59006 },
  3734. {
  3735. "icon_id": "24879588",
  3736. "name": "closeempty",
  3737. "font_class": "closeempty",
  3738. "unicode": "e66c",
  3739. "unicode_decimal": 58988 },
  3740. {
  3741. "icon_id": "24879589",
  3742. "name": "clear",
  3743. "font_class": "clear",
  3744. "unicode": "e66d",
  3745. "unicode_decimal": 58989 },
  3746. {
  3747. "icon_id": "24879590",
  3748. "name": "navigate",
  3749. "font_class": "navigate",
  3750. "unicode": "e66e",
  3751. "unicode_decimal": 58990 },
  3752. {
  3753. "icon_id": "24879591",
  3754. "name": "minus",
  3755. "font_class": "minus",
  3756. "unicode": "e66f",
  3757. "unicode_decimal": 58991 },
  3758. {
  3759. "icon_id": "24879592",
  3760. "name": "image",
  3761. "font_class": "image",
  3762. "unicode": "e670",
  3763. "unicode_decimal": 58992 },
  3764. {
  3765. "icon_id": "24879593",
  3766. "name": "mic",
  3767. "font_class": "mic",
  3768. "unicode": "e671",
  3769. "unicode_decimal": 58993 },
  3770. {
  3771. "icon_id": "24879594",
  3772. "name": "paperplane",
  3773. "font_class": "paperplane",
  3774. "unicode": "e672",
  3775. "unicode_decimal": 58994 },
  3776. {
  3777. "icon_id": "24879595",
  3778. "name": "close",
  3779. "font_class": "close",
  3780. "unicode": "e673",
  3781. "unicode_decimal": 58995 },
  3782. {
  3783. "icon_id": "24879596",
  3784. "name": "help-filled",
  3785. "font_class": "help-filled",
  3786. "unicode": "e674",
  3787. "unicode_decimal": 58996 },
  3788. {
  3789. "icon_id": "24879597",
  3790. "name": "plus-filled",
  3791. "font_class": "paperplane-filled",
  3792. "unicode": "e675",
  3793. "unicode_decimal": 58997 },
  3794. {
  3795. "icon_id": "24879598",
  3796. "name": "plus",
  3797. "font_class": "plus",
  3798. "unicode": "e676",
  3799. "unicode_decimal": 58998 },
  3800. {
  3801. "icon_id": "24879599",
  3802. "name": "mic-filled",
  3803. "font_class": "mic-filled",
  3804. "unicode": "e677",
  3805. "unicode_decimal": 58999 },
  3806. {
  3807. "icon_id": "24879600",
  3808. "name": "image-filled",
  3809. "font_class": "image-filled",
  3810. "unicode": "e678",
  3811. "unicode_decimal": 59000 },
  3812. {
  3813. "icon_id": "24855900",
  3814. "name": "locked-filled",
  3815. "font_class": "locked-filled",
  3816. "unicode": "e668",
  3817. "unicode_decimal": 58984 },
  3818. {
  3819. "icon_id": "24855901",
  3820. "name": "info",
  3821. "font_class": "info",
  3822. "unicode": "e669",
  3823. "unicode_decimal": 58985 },
  3824. {
  3825. "icon_id": "24855903",
  3826. "name": "locked",
  3827. "font_class": "locked",
  3828. "unicode": "e66b",
  3829. "unicode_decimal": 58987 },
  3830. {
  3831. "icon_id": "24855884",
  3832. "name": "camera-filled",
  3833. "font_class": "camera-filled",
  3834. "unicode": "e658",
  3835. "unicode_decimal": 58968 },
  3836. {
  3837. "icon_id": "24855885",
  3838. "name": "chat-filled",
  3839. "font_class": "chat-filled",
  3840. "unicode": "e659",
  3841. "unicode_decimal": 58969 },
  3842. {
  3843. "icon_id": "24855886",
  3844. "name": "camera",
  3845. "font_class": "camera",
  3846. "unicode": "e65a",
  3847. "unicode_decimal": 58970 },
  3848. {
  3849. "icon_id": "24855887",
  3850. "name": "circle",
  3851. "font_class": "circle",
  3852. "unicode": "e65b",
  3853. "unicode_decimal": 58971 },
  3854. {
  3855. "icon_id": "24855888",
  3856. "name": "checkmarkempty",
  3857. "font_class": "checkmarkempty",
  3858. "unicode": "e65c",
  3859. "unicode_decimal": 58972 },
  3860. {
  3861. "icon_id": "24855889",
  3862. "name": "chat",
  3863. "font_class": "chat",
  3864. "unicode": "e65d",
  3865. "unicode_decimal": 58973 },
  3866. {
  3867. "icon_id": "24855890",
  3868. "name": "circle-filled",
  3869. "font_class": "circle-filled",
  3870. "unicode": "e65e",
  3871. "unicode_decimal": 58974 },
  3872. {
  3873. "icon_id": "24855891",
  3874. "name": "flag",
  3875. "font_class": "flag",
  3876. "unicode": "e65f",
  3877. "unicode_decimal": 58975 },
  3878. {
  3879. "icon_id": "24855892",
  3880. "name": "flag-filled",
  3881. "font_class": "flag-filled",
  3882. "unicode": "e660",
  3883. "unicode_decimal": 58976 },
  3884. {
  3885. "icon_id": "24855893",
  3886. "name": "gear-filled",
  3887. "font_class": "gear-filled",
  3888. "unicode": "e661",
  3889. "unicode_decimal": 58977 },
  3890. {
  3891. "icon_id": "24855894",
  3892. "name": "home",
  3893. "font_class": "home",
  3894. "unicode": "e662",
  3895. "unicode_decimal": 58978 },
  3896. {
  3897. "icon_id": "24855895",
  3898. "name": "home-filled",
  3899. "font_class": "home-filled",
  3900. "unicode": "e663",
  3901. "unicode_decimal": 58979 },
  3902. {
  3903. "icon_id": "24855896",
  3904. "name": "gear",
  3905. "font_class": "gear",
  3906. "unicode": "e664",
  3907. "unicode_decimal": 58980 },
  3908. {
  3909. "icon_id": "24855897",
  3910. "name": "smallcircle-filled",
  3911. "font_class": "smallcircle-filled",
  3912. "unicode": "e665",
  3913. "unicode_decimal": 58981 },
  3914. {
  3915. "icon_id": "24855898",
  3916. "name": "map-filled",
  3917. "font_class": "map-filled",
  3918. "unicode": "e666",
  3919. "unicode_decimal": 58982 },
  3920. {
  3921. "icon_id": "24855899",
  3922. "name": "map",
  3923. "font_class": "map",
  3924. "unicode": "e667",
  3925. "unicode_decimal": 58983 },
  3926. {
  3927. "icon_id": "24855825",
  3928. "name": "refresh-filled",
  3929. "font_class": "refresh-filled",
  3930. "unicode": "e656",
  3931. "unicode_decimal": 58966 },
  3932. {
  3933. "icon_id": "24855826",
  3934. "name": "refresh",
  3935. "font_class": "refresh",
  3936. "unicode": "e657",
  3937. "unicode_decimal": 58967 },
  3938. {
  3939. "icon_id": "24855808",
  3940. "name": "cloud-upload",
  3941. "font_class": "cloud-upload",
  3942. "unicode": "e645",
  3943. "unicode_decimal": 58949 },
  3944. {
  3945. "icon_id": "24855809",
  3946. "name": "cloud-download-filled",
  3947. "font_class": "cloud-download-filled",
  3948. "unicode": "e646",
  3949. "unicode_decimal": 58950 },
  3950. {
  3951. "icon_id": "24855810",
  3952. "name": "cloud-download",
  3953. "font_class": "cloud-download",
  3954. "unicode": "e647",
  3955. "unicode_decimal": 58951 },
  3956. {
  3957. "icon_id": "24855811",
  3958. "name": "cloud-upload-filled",
  3959. "font_class": "cloud-upload-filled",
  3960. "unicode": "e648",
  3961. "unicode_decimal": 58952 },
  3962. {
  3963. "icon_id": "24855813",
  3964. "name": "redo",
  3965. "font_class": "redo",
  3966. "unicode": "e64a",
  3967. "unicode_decimal": 58954 },
  3968. {
  3969. "icon_id": "24855814",
  3970. "name": "images-filled",
  3971. "font_class": "images-filled",
  3972. "unicode": "e64b",
  3973. "unicode_decimal": 58955 },
  3974. {
  3975. "icon_id": "24855815",
  3976. "name": "undo-filled",
  3977. "font_class": "undo-filled",
  3978. "unicode": "e64c",
  3979. "unicode_decimal": 58956 },
  3980. {
  3981. "icon_id": "24855816",
  3982. "name": "more",
  3983. "font_class": "more",
  3984. "unicode": "e64d",
  3985. "unicode_decimal": 58957 },
  3986. {
  3987. "icon_id": "24855817",
  3988. "name": "more-filled",
  3989. "font_class": "more-filled",
  3990. "unicode": "e64e",
  3991. "unicode_decimal": 58958 },
  3992. {
  3993. "icon_id": "24855818",
  3994. "name": "undo",
  3995. "font_class": "undo",
  3996. "unicode": "e64f",
  3997. "unicode_decimal": 58959 },
  3998. {
  3999. "icon_id": "24855819",
  4000. "name": "images",
  4001. "font_class": "images",
  4002. "unicode": "e650",
  4003. "unicode_decimal": 58960 },
  4004. {
  4005. "icon_id": "24855821",
  4006. "name": "paperclip",
  4007. "font_class": "paperclip",
  4008. "unicode": "e652",
  4009. "unicode_decimal": 58962 },
  4010. {
  4011. "icon_id": "24855822",
  4012. "name": "settings",
  4013. "font_class": "settings",
  4014. "unicode": "e653",
  4015. "unicode_decimal": 58963 },
  4016. {
  4017. "icon_id": "24855823",
  4018. "name": "search",
  4019. "font_class": "search",
  4020. "unicode": "e654",
  4021. "unicode_decimal": 58964 },
  4022. {
  4023. "icon_id": "24855824",
  4024. "name": "redo-filled",
  4025. "font_class": "redo-filled",
  4026. "unicode": "e655",
  4027. "unicode_decimal": 58965 },
  4028. {
  4029. "icon_id": "24841702",
  4030. "name": "list",
  4031. "font_class": "list",
  4032. "unicode": "e644",
  4033. "unicode_decimal": 58948 },
  4034. {
  4035. "icon_id": "24841489",
  4036. "name": "mail-open-filled",
  4037. "font_class": "mail-open-filled",
  4038. "unicode": "e63a",
  4039. "unicode_decimal": 58938 },
  4040. {
  4041. "icon_id": "24841491",
  4042. "name": "hand-thumbsdown-filled",
  4043. "font_class": "hand-down-filled",
  4044. "unicode": "e63c",
  4045. "unicode_decimal": 58940 },
  4046. {
  4047. "icon_id": "24841492",
  4048. "name": "hand-thumbsdown",
  4049. "font_class": "hand-down",
  4050. "unicode": "e63d",
  4051. "unicode_decimal": 58941 },
  4052. {
  4053. "icon_id": "24841493",
  4054. "name": "hand-thumbsup-filled",
  4055. "font_class": "hand-up-filled",
  4056. "unicode": "e63e",
  4057. "unicode_decimal": 58942 },
  4058. {
  4059. "icon_id": "24841494",
  4060. "name": "hand-thumbsup",
  4061. "font_class": "hand-up",
  4062. "unicode": "e63f",
  4063. "unicode_decimal": 58943 },
  4064. {
  4065. "icon_id": "24841496",
  4066. "name": "heart-filled",
  4067. "font_class": "heart-filled",
  4068. "unicode": "e641",
  4069. "unicode_decimal": 58945 },
  4070. {
  4071. "icon_id": "24841498",
  4072. "name": "mail-open",
  4073. "font_class": "mail-open",
  4074. "unicode": "e643",
  4075. "unicode_decimal": 58947 },
  4076. {
  4077. "icon_id": "24841488",
  4078. "name": "heart",
  4079. "font_class": "heart",
  4080. "unicode": "e639",
  4081. "unicode_decimal": 58937 },
  4082. {
  4083. "icon_id": "24839963",
  4084. "name": "loop",
  4085. "font_class": "loop",
  4086. "unicode": "e633",
  4087. "unicode_decimal": 58931 },
  4088. {
  4089. "icon_id": "24839866",
  4090. "name": "pulldown",
  4091. "font_class": "pulldown",
  4092. "unicode": "e632",
  4093. "unicode_decimal": 58930 },
  4094. {
  4095. "icon_id": "24813798",
  4096. "name": "scan",
  4097. "font_class": "scan",
  4098. "unicode": "e62a",
  4099. "unicode_decimal": 58922 },
  4100. {
  4101. "icon_id": "24813786",
  4102. "name": "bars",
  4103. "font_class": "bars",
  4104. "unicode": "e627",
  4105. "unicode_decimal": 58919 },
  4106. {
  4107. "icon_id": "24813788",
  4108. "name": "cart-filled",
  4109. "font_class": "cart-filled",
  4110. "unicode": "e629",
  4111. "unicode_decimal": 58921 },
  4112. {
  4113. "icon_id": "24813790",
  4114. "name": "checkbox",
  4115. "font_class": "checkbox",
  4116. "unicode": "e62b",
  4117. "unicode_decimal": 58923 },
  4118. {
  4119. "icon_id": "24813791",
  4120. "name": "checkbox-filled",
  4121. "font_class": "checkbox-filled",
  4122. "unicode": "e62c",
  4123. "unicode_decimal": 58924 },
  4124. {
  4125. "icon_id": "24813794",
  4126. "name": "shop",
  4127. "font_class": "shop",
  4128. "unicode": "e62f",
  4129. "unicode_decimal": 58927 },
  4130. {
  4131. "icon_id": "24813795",
  4132. "name": "headphones",
  4133. "font_class": "headphones",
  4134. "unicode": "e630",
  4135. "unicode_decimal": 58928 },
  4136. {
  4137. "icon_id": "24813796",
  4138. "name": "cart",
  4139. "font_class": "cart",
  4140. "unicode": "e631",
  4141. "unicode_decimal": 58929 }] };exports.default = _default;
  4142. /***/ }),
  4143. /***/ 2:
  4144. /*!***********************************!*\
  4145. !*** (webpack)/buildin/global.js ***!
  4146. \***********************************/
  4147. /*! no static exports found */
  4148. /***/ (function(module, exports) {
  4149. var g;
  4150. // This works in non-strict mode
  4151. g = (function() {
  4152. return this;
  4153. })();
  4154. try {
  4155. // This works if eval is allowed (see CSP)
  4156. g = g || new Function("return this")();
  4157. } catch (e) {
  4158. // This works if the window reference is available
  4159. if (typeof window === "object") g = window;
  4160. }
  4161. // g can still be undefined, but nothing to do about it...
  4162. // We return undefined, instead of nothing here, so it's
  4163. // easier to handle this case. if(!global) { ...}
  4164. module.exports = g;
  4165. /***/ }),
  4166. /***/ 212:
  4167. /*!******************************************************************************************************!*\
  4168. !*** F:/工作项目/pingpu_H5/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js ***!
  4169. \******************************************************************************************************/
  4170. /*! no static exports found */
  4171. /***/ (function(module, exports, __webpack_require__) {
  4172. "use strict";
  4173. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 213));
  4174. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 214));
  4175. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 215));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
  4176. {
  4177. en: _en.default,
  4178. 'zh-Hans': _zhHans.default,
  4179. 'zh-Hant': _zhHant.default };exports.default = _default;
  4180. /***/ }),
  4181. /***/ 213:
  4182. /*!*****************************************************************************************************!*\
  4183. !*** F:/工作项目/pingpu_H5/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/en.json ***!
  4184. \*****************************************************************************************************/
  4185. /*! exports provided: uni-datetime-picker.selectDate, uni-datetime-picker.selectTime, uni-datetime-picker.selectDateTime, uni-datetime-picker.startDate, uni-datetime-picker.endDate, uni-datetime-picker.startTime, uni-datetime-picker.endTime, uni-datetime-picker.ok, uni-datetime-picker.clear, uni-datetime-picker.cancel, uni-datetime-picker.year, uni-datetime-picker.month, uni-calender.MON, uni-calender.TUE, uni-calender.WED, uni-calender.THU, uni-calender.FRI, uni-calender.SAT, uni-calender.SUN, uni-calender.confirm, default */
  4186. /***/ (function(module) {
  4187. module.exports = JSON.parse("{\"uni-datetime-picker.selectDate\":\"select date\",\"uni-datetime-picker.selectTime\":\"select time\",\"uni-datetime-picker.selectDateTime\":\"select datetime\",\"uni-datetime-picker.startDate\":\"start date\",\"uni-datetime-picker.endDate\":\"end date\",\"uni-datetime-picker.startTime\":\"start time\",\"uni-datetime-picker.endTime\":\"end time\",\"uni-datetime-picker.ok\":\"ok\",\"uni-datetime-picker.clear\":\"clear\",\"uni-datetime-picker.cancel\":\"cancel\",\"uni-datetime-picker.year\":\"-\",\"uni-datetime-picker.month\":\"\",\"uni-calender.MON\":\"MON\",\"uni-calender.TUE\":\"TUE\",\"uni-calender.WED\":\"WED\",\"uni-calender.THU\":\"THU\",\"uni-calender.FRI\":\"FRI\",\"uni-calender.SAT\":\"SAT\",\"uni-calender.SUN\":\"SUN\",\"uni-calender.confirm\":\"confirm\"}");
  4188. /***/ }),
  4189. /***/ 214:
  4190. /*!**********************************************************************************************************!*\
  4191. !*** F:/工作项目/pingpu_H5/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hans.json ***!
  4192. \**********************************************************************************************************/
  4193. /*! exports provided: uni-datetime-picker.selectDate, uni-datetime-picker.selectTime, uni-datetime-picker.selectDateTime, uni-datetime-picker.startDate, uni-datetime-picker.endDate, uni-datetime-picker.startTime, uni-datetime-picker.endTime, uni-datetime-picker.ok, uni-datetime-picker.clear, uni-datetime-picker.cancel, uni-datetime-picker.year, uni-datetime-picker.month, uni-calender.SUN, uni-calender.MON, uni-calender.TUE, uni-calender.WED, uni-calender.THU, uni-calender.FRI, uni-calender.SAT, uni-calender.confirm, default */
  4194. /***/ (function(module) {
  4195. module.exports = JSON.parse("{\"uni-datetime-picker.selectDate\":\"选择日期\",\"uni-datetime-picker.selectTime\":\"选择时间\",\"uni-datetime-picker.selectDateTime\":\"选择日期时间\",\"uni-datetime-picker.startDate\":\"开始日期\",\"uni-datetime-picker.endDate\":\"结束日期\",\"uni-datetime-picker.startTime\":\"开始时间\",\"uni-datetime-picker.endTime\":\"结束时间\",\"uni-datetime-picker.ok\":\"确定\",\"uni-datetime-picker.clear\":\"清除\",\"uni-datetime-picker.cancel\":\"取消\",\"uni-datetime-picker.year\":\"年\",\"uni-datetime-picker.month\":\"月\",\"uni-calender.SUN\":\"日\",\"uni-calender.MON\":\"一\",\"uni-calender.TUE\":\"二\",\"uni-calender.WED\":\"三\",\"uni-calender.THU\":\"四\",\"uni-calender.FRI\":\"五\",\"uni-calender.SAT\":\"六\",\"uni-calender.confirm\":\"确认\"}");
  4196. /***/ }),
  4197. /***/ 215:
  4198. /*!**********************************************************************************************************!*\
  4199. !*** F:/工作项目/pingpu_H5/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hant.json ***!
  4200. \**********************************************************************************************************/
  4201. /*! exports provided: uni-datetime-picker.selectDate, uni-datetime-picker.selectTime, uni-datetime-picker.selectDateTime, uni-datetime-picker.startDate, uni-datetime-picker.endDate, uni-datetime-picker.startTime, uni-datetime-picker.endTime, uni-datetime-picker.ok, uni-datetime-picker.clear, uni-datetime-picker.cancel, uni-datetime-picker.year, uni-datetime-picker.month, uni-calender.SUN, uni-calender.MON, uni-calender.TUE, uni-calender.WED, uni-calender.THU, uni-calender.FRI, uni-calender.SAT, uni-calender.confirm, default */
  4202. /***/ (function(module) {
  4203. module.exports = JSON.parse("{\"uni-datetime-picker.selectDate\":\"選擇日期\",\"uni-datetime-picker.selectTime\":\"選擇時間\",\"uni-datetime-picker.selectDateTime\":\"選擇日期時間\",\"uni-datetime-picker.startDate\":\"開始日期\",\"uni-datetime-picker.endDate\":\"結束日期\",\"uni-datetime-picker.startTime\":\"開始时间\",\"uni-datetime-picker.endTime\":\"結束时间\",\"uni-datetime-picker.ok\":\"確定\",\"uni-datetime-picker.clear\":\"清除\",\"uni-datetime-picker.cancel\":\"取消\",\"uni-datetime-picker.year\":\"年\",\"uni-datetime-picker.month\":\"月\",\"uni-calender.SUN\":\"日\",\"uni-calender.MON\":\"一\",\"uni-calender.TUE\":\"二\",\"uni-calender.WED\":\"三\",\"uni-calender.THU\":\"四\",\"uni-calender.FRI\":\"五\",\"uni-calender.SAT\":\"六\",\"uni-calender.confirm\":\"確認\"}");
  4204. /***/ }),
  4205. /***/ 251:
  4206. /*!********************************************************************************************!*\
  4207. !*** F:/工作项目/pingpu_H5/uni_modules/uni-pagination/components/uni-pagination/i18n/index.js ***!
  4208. \********************************************************************************************/
  4209. /*! no static exports found */
  4210. /***/ (function(module, exports, __webpack_require__) {
  4211. "use strict";
  4212. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 252));
  4213. var _es = _interopRequireDefault(__webpack_require__(/*! ./es.json */ 253));
  4214. var _fr = _interopRequireDefault(__webpack_require__(/*! ./fr.json */ 254));
  4215. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 255));
  4216. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 256));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
  4217. {
  4218. en: _en.default,
  4219. es: _es.default,
  4220. fr: _fr.default,
  4221. 'zh-Hans': _zhHans.default,
  4222. 'zh-Hant': _zhHant.default };exports.default = _default;
  4223. /***/ }),
  4224. /***/ 252:
  4225. /*!*******************************************************************************************!*\
  4226. !*** F:/工作项目/pingpu_H5/uni_modules/uni-pagination/components/uni-pagination/i18n/en.json ***!
  4227. \*******************************************************************************************/
  4228. /*! exports provided: uni-pagination.prevText, uni-pagination.nextText, uni-pagination.piecePerPage, default */
  4229. /***/ (function(module) {
  4230. module.exports = JSON.parse("{\"uni-pagination.prevText\":\"prev\",\"uni-pagination.nextText\":\"next\",\"uni-pagination.piecePerPage\":\"piece/page\"}");
  4231. /***/ }),
  4232. /***/ 253:
  4233. /*!*******************************************************************************************!*\
  4234. !*** F:/工作项目/pingpu_H5/uni_modules/uni-pagination/components/uni-pagination/i18n/es.json ***!
  4235. \*******************************************************************************************/
  4236. /*! exports provided: uni-pagination.prevText, uni-pagination.nextText, uni-pagination.piecePerPage, default */
  4237. /***/ (function(module) {
  4238. module.exports = JSON.parse("{\"uni-pagination.prevText\":\"anterior\",\"uni-pagination.nextText\":\"prxima\",\"uni-pagination.piecePerPage\":\"Art��culo/P��gina\"}");
  4239. /***/ }),
  4240. /***/ 254:
  4241. /*!*******************************************************************************************!*\
  4242. !*** F:/工作项目/pingpu_H5/uni_modules/uni-pagination/components/uni-pagination/i18n/fr.json ***!
  4243. \*******************************************************************************************/
  4244. /*! exports provided: uni-pagination.prevText, uni-pagination.nextText, uni-pagination.piecePerPage, default */
  4245. /***/ (function(module) {
  4246. module.exports = JSON.parse("{\"uni-pagination.prevText\":\"précédente\",\"uni-pagination.nextText\":\"suivante\",\"uni-pagination.piecePerPage\":\"Articles/Pages\"}");
  4247. /***/ }),
  4248. /***/ 255:
  4249. /*!************************************************************************************************!*\
  4250. !*** F:/工作项目/pingpu_H5/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hans.json ***!
  4251. \************************************************************************************************/
  4252. /*! exports provided: uni-pagination.prevText, uni-pagination.nextText, uni-pagination.piecePerPage, default */
  4253. /***/ (function(module) {
  4254. module.exports = JSON.parse("{\"uni-pagination.prevText\":\"上一页\",\"uni-pagination.nextText\":\"下一页\",\"uni-pagination.piecePerPage\":\"条/页\"}");
  4255. /***/ }),
  4256. /***/ 256:
  4257. /*!************************************************************************************************!*\
  4258. !*** F:/工作项目/pingpu_H5/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hant.json ***!
  4259. \************************************************************************************************/
  4260. /*! exports provided: uni-pagination.prevText, uni-pagination.nextText, uni-pagination.piecePerPage, default */
  4261. /***/ (function(module) {
  4262. module.exports = JSON.parse("{\"uni-pagination.prevText\":\"上一頁\",\"uni-pagination.nextText\":\"下一頁\",\"uni-pagination.piecePerPage\":\"條/頁\"}");
  4263. /***/ }),
  4264. /***/ 281:
  4265. /*!********************************************************************************************!*\
  4266. !*** F:/工作项目/pingpu_H5/uni_modules/uni-search-bar/components/uni-search-bar/i18n/index.js ***!
  4267. \********************************************************************************************/
  4268. /*! no static exports found */
  4269. /***/ (function(module, exports, __webpack_require__) {
  4270. "use strict";
  4271. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 282));
  4272. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 283));
  4273. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 284));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
  4274. {
  4275. en: _en.default,
  4276. 'zh-Hans': _zhHans.default,
  4277. 'zh-Hant': _zhHant.default };exports.default = _default;
  4278. /***/ }),
  4279. /***/ 282:
  4280. /*!*******************************************************************************************!*\
  4281. !*** F:/工作项目/pingpu_H5/uni_modules/uni-search-bar/components/uni-search-bar/i18n/en.json ***!
  4282. \*******************************************************************************************/
  4283. /*! exports provided: uni-search-bar.cancel, uni-search-bar.placeholder, default */
  4284. /***/ (function(module) {
  4285. module.exports = JSON.parse("{\"uni-search-bar.cancel\":\"cancel\",\"uni-search-bar.placeholder\":\"Search enter content\"}");
  4286. /***/ }),
  4287. /***/ 283:
  4288. /*!************************************************************************************************!*\
  4289. !*** F:/工作项目/pingpu_H5/uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hans.json ***!
  4290. \************************************************************************************************/
  4291. /*! exports provided: uni-search-bar.cancel, uni-search-bar.placeholder, default */
  4292. /***/ (function(module) {
  4293. module.exports = JSON.parse("{\"uni-search-bar.cancel\":\"cancel\",\"uni-search-bar.placeholder\":\"请输入搜索内容\"}");
  4294. /***/ }),
  4295. /***/ 284:
  4296. /*!************************************************************************************************!*\
  4297. !*** F:/工作项目/pingpu_H5/uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hant.json ***!
  4298. \************************************************************************************************/
  4299. /*! exports provided: uni-search-bar.cancel, uni-search-bar.placeholder, default */
  4300. /***/ (function(module) {
  4301. module.exports = JSON.parse("{\"uni-search-bar.cancel\":\"cancel\",\"uni-search-bar.placeholder\":\"請輸入搜索內容\"}");
  4302. /***/ }),
  4303. /***/ 292:
  4304. /*!*************************************************************************************************!*\
  4305. !*** F:/工作项目/pingpu_H5/uni_modules/uni-transition/components/uni-transition/createAnimation.js ***!
  4306. \*************************************************************************************************/
  4307. /*! no static exports found */
  4308. /***/ (function(module, exports, __webpack_require__) {
  4309. "use strict";
  4310. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.createAnimation = createAnimation;function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} // const defaultOption = {
  4311. // duration: 300,
  4312. // timingFunction: 'linear',
  4313. // delay: 0,
  4314. // transformOrigin: '50% 50% 0'
  4315. // }
  4316. var
  4317. MPAnimation = /*#__PURE__*/function () {
  4318. function MPAnimation(options, _this) {_classCallCheck(this, MPAnimation);
  4319. this.options = options;
  4320. this.animation = uni.createAnimation(options);
  4321. this.currentStepAnimates = {};
  4322. this.next = 0;
  4323. this.$ = _this;
  4324. }_createClass(MPAnimation, [{ key: "_nvuePushAnimates", value: function _nvuePushAnimates(
  4325. type, args) {
  4326. var aniObj = this.currentStepAnimates[this.next];
  4327. var styles = {};
  4328. if (!aniObj) {
  4329. styles = {
  4330. styles: {},
  4331. config: {} };
  4332. } else {
  4333. styles = aniObj;
  4334. }
  4335. if (animateTypes1.includes(type)) {
  4336. if (!styles.styles.transform) {
  4337. styles.styles.transform = '';
  4338. }
  4339. var unit = '';
  4340. if (type === 'rotate') {
  4341. unit = 'deg';
  4342. }
  4343. styles.styles.transform += "".concat(type, "(").concat(args + unit, ") ");
  4344. } else {
  4345. styles.styles[type] = "".concat(args);
  4346. }
  4347. this.currentStepAnimates[this.next] = styles;
  4348. } }, { key: "_animateRun", value: function _animateRun()
  4349. {var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  4350. var ref = this.$.$refs['ani'].ref;
  4351. if (!ref) return;
  4352. return new Promise(function (resolve, reject) {
  4353. nvueAnimation.transition(ref, _objectSpread({
  4354. styles: styles },
  4355. config),
  4356. function (res) {
  4357. resolve();
  4358. });
  4359. });
  4360. } }, { key: "_nvueNextAnimate", value: function _nvueNextAnimate(
  4361. animates) {var _this2 = this;var step = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;var fn = arguments.length > 2 ? arguments[2] : undefined;
  4362. var obj = animates[step];
  4363. if (obj) {var
  4364. styles =
  4365. obj.styles,config = obj.config;
  4366. this._animateRun(styles, config).then(function () {
  4367. step += 1;
  4368. _this2._nvueNextAnimate(animates, step, fn);
  4369. });
  4370. } else {
  4371. this.currentStepAnimates = {};
  4372. typeof fn === 'function' && fn();
  4373. this.isEnd = true;
  4374. }
  4375. } }, { key: "step", value: function step()
  4376. {var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  4377. this.animation.step(config);
  4378. return this;
  4379. } }, { key: "run", value: function run(
  4380. fn) {
  4381. this.$.animationData = this.animation.export();
  4382. this.$.timer = setTimeout(function () {
  4383. typeof fn === 'function' && fn();
  4384. }, this.$.durationTime);
  4385. } }]);return MPAnimation;}();
  4386. var animateTypes1 = ['matrix', 'matrix3d', 'rotate', 'rotate3d', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scale3d',
  4387. 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'translate', 'translate3d', 'translateX', 'translateY',
  4388. 'translateZ'];
  4389. var animateTypes2 = ['opacity', 'backgroundColor'];
  4390. var animateTypes3 = ['width', 'height', 'left', 'right', 'top', 'bottom'];
  4391. animateTypes1.concat(animateTypes2, animateTypes3).forEach(function (type) {
  4392. MPAnimation.prototype[type] = function () {var _this$animation;
  4393. (_this$animation = this.animation)[type].apply(_this$animation, arguments);
  4394. return this;
  4395. };
  4396. });
  4397. function createAnimation(option, _this) {
  4398. if (!_this) return;
  4399. clearTimeout(_this.timer);
  4400. return new MPAnimation(option, _this);
  4401. }
  4402. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  4403. /***/ }),
  4404. /***/ 298:
  4405. /*!************************************************************************************!*\
  4406. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js ***!
  4407. \************************************************************************************/
  4408. /*! no static exports found */
  4409. /***/ (function(module, exports, __webpack_require__) {
  4410. "use strict";
  4411. /* WEBPACK VAR INJECTION */(function(global, uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 13));var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 3);var _pages = _interopRequireDefault(__webpack_require__(/*! @/pages.json */ 299));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _createForOfIteratorHelper(o, allowArrayLike) {var it;if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {if (it) o = it;var i = 0;var F = function F() {};return { s: F, n: function n() {if (i >= o.length) return { done: true };return { done: false, value: o[i++] };}, e: function e(_e32) {throw _e32;}, f: F };}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion = true,didErr = false,err;return { s: function s() {it = o[Symbol.iterator]();}, n: function n() {var step = it.next();normalCompletion = step.done;return step;}, e: function e(_e33) {didErr = true;err = _e33;}, f: function f() {try {if (!normalCompletion && it.return != null) it.return();} finally {if (didErr) throw err;}} };}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _inherits(subClass, superClass) {if (typeof superClass !== "function" && superClass !== null) {throw new TypeError("Super expression must either be null or a function");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });if (superClass) _setPrototypeOf(subClass, superClass);}function _createSuper(Derived) {var hasNativeReflectConstruct = _isNativeReflectConstruct();return function _createSuperInternal() {var Super = _getPrototypeOf(Derived),result;if (hasNativeReflectConstruct) {var NewTarget = _getPrototypeOf(this).constructor;result = Reflect.construct(Super, arguments, NewTarget);} else {result = Super.apply(this, arguments);}return _possibleConstructorReturn(this, result);};}function _possibleConstructorReturn(self, call) {if (call && (typeof call === "object" || typeof call === "function")) {return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _wrapNativeSuper(Class) {var _cache = typeof Map === "function" ? new Map() : undefined;_wrapNativeSuper = function _wrapNativeSuper(Class) {if (Class === null || !_isNativeFunction(Class)) return Class;if (typeof Class !== "function") {throw new TypeError("Super expression must either be null or a function");}if (typeof _cache !== "undefined") {if (_cache.has(Class)) return _cache.get(Class);_cache.set(Class, Wrapper);}function Wrapper() {return _construct(Class, arguments, _getPrototypeOf(this).constructor);}Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } });return _setPrototypeOf(Wrapper, Class);};return _wrapNativeSuper(Class);}function _construct(Parent, args, Class) {if (_isNativeReflectConstruct()) {_construct = Reflect.construct;} else {_construct = function _construct(Parent, args, Class) {var a = [null];a.push.apply(a, args);var Constructor = Function.bind.apply(Parent, a);var instance = new Constructor();if (Class) _setPrototypeOf(instance, Class.prototype);return instance;};}return _construct.apply(null, arguments);}function _isNativeReflectConstruct() {if (typeof Reflect === "undefined" || !Reflect.construct) return false;if (Reflect.construct.sham) return false;if (typeof Proxy === "function") return true;try {Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));return true;} catch (e) {return false;}}function _isNativeFunction(fn) {return Function.toString.call(fn).indexOf("[native code]") !== -1;}function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}"undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;function n(e) {return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;}function s(e, t, n) {return e(n = { path: t, exports: {}, require: function require(e, t) {return function () {throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");}(null == t && n.path);} }, n.exports), n.exports;}var o = s(function (e, t) {var n;e.exports = (n = n || function (e, t) {var n = Object.create || function () {function e() {}return function (t) {var n;return e.prototype = t, n = new e(), e.prototype = null, n;};}(),s = {},o = s.lib = {},r = o.Base = { extend: function extend(e) {var t = n(this);return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {t.$super.init.apply(this, arguments);}), t.init.prototype = t, t.$super = this, t;}, create: function create() {var e = this.extend();return e.init.apply(e, arguments), e;}, init: function init() {}, mixIn: function mixIn(e) {for (var t in e) {e.hasOwnProperty(t) && (this[t] = e[t]);}e.hasOwnProperty("toString") && (this.toString = e.toString);}, clone: function clone() {return this.init.prototype.extend(this);} },i = o.WordArray = r.extend({ init: function init(e, n) {e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length;}, toString: function toString(e) {return (e || c).stringify(this);}, concat: function concat(e) {var t = this.words,n = e.words,s = this.sigBytes,o = e.sigBytes;if (this.clamp(), s % 4) for (var r = 0; r < o; r++) {var i = n[r >>> 2] >>> 24 - r % 4 * 8 & 255;t[s + r >>> 2] |= i << 24 - (s + r) % 4 * 8;} else for (r = 0; r < o; r += 4) {t[s + r >>> 2] = n[r >>> 2];}return this.sigBytes += o, this;}, clamp: function clamp() {var t = this.words,n = this.sigBytes;t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);}, clone: function clone() {var e = r.clone.call(this);return e.words = this.words.slice(0), e;}, random: function random(t) {for (var n, s = [], o = function o(t) {t = t;var n = 987654321,s = 4294967295;return function () {var o = ((n = 36969 * (65535 & n) + (n >> 16) & s) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & s) & s;return o /= 4294967296, (o += .5) * (e.random() > .5 ? 1 : -1);};}, r = 0; r < t; r += 4) {var a = o(4294967296 * (n || e.random()));n = 987654071 * a(), s.push(4294967296 * a() | 0);}return new i.init(s, t);} }),a = s.enc = {},c = a.Hex = { stringify: function stringify(e) {for (var t = e.words, n = e.sigBytes, s = [], o = 0; o < n; o++) {var r = t[o >>> 2] >>> 24 - o % 4 * 8 & 255;s.push((r >>> 4).toString(16)), s.push((15 & r).toString(16));}return s.join("");}, parse: function parse(e) {for (var t = e.length, n = [], s = 0; s < t; s += 2) {n[s >>> 3] |= parseInt(e.substr(s, 2), 16) << 24 - s % 8 * 4;}return new i.init(n, t / 2);} },u = a.Latin1 = { stringify: function stringify(e) {for (var t = e.words, n = e.sigBytes, s = [], o = 0; o < n; o++) {var r = t[o >>> 2] >>> 24 - o % 4 * 8 & 255;s.push(String.fromCharCode(r));}return s.join("");}, parse: function parse(e) {for (var t = e.length, n = [], s = 0; s < t; s++) {n[s >>> 2] |= (255 & e.charCodeAt(s)) << 24 - s % 4 * 8;}return new i.init(n, t);} },l = a.Utf8 = { stringify: function stringify(e) {try {return decodeURIComponent(escape(u.stringify(e)));} catch (e) {throw new Error("Malformed UTF-8 data");}}, parse: function parse(e) {return u.parse(unescape(encodeURIComponent(e)));} },h = o.BufferedBlockAlgorithm = r.extend({ reset: function reset() {this._data = new i.init(), this._nDataBytes = 0;}, _append: function _append(e) {"string" == typeof e && (e = l.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;}, _process: function _process(t) {var n = this._data,s = n.words,o = n.sigBytes,r = this.blockSize,a = o / (4 * r),c = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * r,u = e.min(4 * c, o);if (c) {for (var l = 0; l < c; l += r) {this._doProcessBlock(s, l);}var h = s.splice(0, c);n.sigBytes -= u;}return new i.init(h, u);}, clone: function clone() {var e = r.clone.call(this);return e._data = this._data.clone(), e;}, _minBufferSize: 0 });o.Hasher = h.extend({ cfg: r.extend(), init: function init(e) {this.cfg = this.cfg.extend(e), this.reset();}, reset: function reset() {h.reset.call(this), this._doReset();}, update: function update(e) {return this._append(e), this._process(), this;}, finalize: function finalize(e) {return e && this._append(e), this._doFinalize();}, blockSize: 16, _createHelper: function _createHelper(e) {return function (t, n) {return new e.init(n).finalize(t);};}, _createHmacHelper: function _createHmacHelper(e) {return function (t, n) {return new d.HMAC.init(e, n).finalize(t);};} });var d = s.algo = {};return s;}(Math), n);}),r = (s(function (e, t) {var n;e.exports = (n = o, function (e) {var t = n,s = t.lib,o = s.WordArray,r = s.Hasher,i = t.algo,a = [];!function () {for (var t = 0; t < 64; t++) {a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;}}();var c = i.MD5 = r.extend({ _doReset: function _doReset() {this._hash = new o.init([1732584193, 4023233417, 2562383102, 271733878]);}, _doProcessBlock: function _doProcessBlock(e, t) {for (var n = 0; n < 16; n++) {var s = t + n,o = e[s];e[s] = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8);}var r = this._hash.words,i = e[t + 0],c = e[t + 1],f = e[t + 2],g = e[t + 3],p = e[t + 4],m = e[t + 5],y = e[t + 6],_ = e[t + 7],w = e[t + 8],k = e[t + 9],T = e[t + 10],S = e[t + 11],v = e[t + 12],P = e[t + 13],A = e[t + 14],I = e[t + 15],b = r[0],O = r[1],C = r[2],E = r[3];b = u(b, O, C, E, i, 7, a[0]), E = u(E, b, O, C, c, 12, a[1]), C = u(C, E, b, O, f, 17, a[2]), O = u(O, C, E, b, g, 22, a[3]), b = u(b, O, C, E, p, 7, a[4]), E = u(E, b, O, C, m, 12, a[5]), C = u(C, E, b, O, y, 17, a[6]), O = u(O, C, E, b, _, 22, a[7]), b = u(b, O, C, E, w, 7, a[8]), E = u(E, b, O, C, k, 12, a[9]), C = u(C, E, b, O, T, 17, a[10]), O = u(O, C, E, b, S, 22, a[11]), b = u(b, O, C, E, v, 7, a[12]), E = u(E, b, O, C, P, 12, a[13]), C = u(C, E, b, O, A, 17, a[14]), b = l(b, O = u(O, C, E, b, I, 22, a[15]), C, E, c, 5, a[16]), E = l(E, b, O, C, y, 9, a[17]), C = l(C, E, b, O, S, 14, a[18]), O = l(O, C, E, b, i, 20, a[19]), b = l(b, O, C, E, m, 5, a[20]), E = l(E, b, O, C, T, 9, a[21]), C = l(C, E, b, O, I, 14, a[22]), O = l(O, C, E, b, p, 20, a[23]), b = l(b, O, C, E, k, 5, a[24]), E = l(E, b, O, C, A, 9, a[25]), C = l(C, E, b, O, g, 14, a[26]), O = l(O, C, E, b, w, 20, a[27]), b = l(b, O, C, E, P, 5, a[28]), E = l(E, b, O, C, f, 9, a[29]), C = l(C, E, b, O, _, 14, a[30]), b = h(b, O = l(O, C, E, b, v, 20, a[31]), C, E, m, 4, a[32]), E = h(E, b, O, C, w, 11, a[33]), C = h(C, E, b, O, S, 16, a[34]), O = h(O, C, E, b, A, 23, a[35]), b = h(b, O, C, E, c, 4, a[36]), E = h(E, b, O, C, p, 11, a[37]), C = h(C, E, b, O, _, 16, a[38]), O = h(O, C, E, b, T, 23, a[39]), b = h(b, O, C, E, P, 4, a[40]), E = h(E, b, O, C, i, 11, a[41]), C = h(C, E, b, O, g, 16, a[42]), O = h(O, C, E, b, y, 23, a[43]), b = h(b, O, C, E, k, 4, a[44]), E = h(E, b, O, C, v, 11, a[45]), C = h(C, E, b, O, I, 16, a[46]), b = d(b, O = h(O, C, E, b, f, 23, a[47]), C, E, i, 6, a[48]), E = d(E, b, O, C, _, 10, a[49]), C = d(C, E, b, O, A, 15, a[50]), O = d(O, C, E, b, m, 21, a[51]), b = d(b, O, C, E, v, 6, a[52]), E = d(E, b, O, C, g, 10, a[53]), C = d(C, E, b, O, T, 15, a[54]), O = d(O, C, E, b, c, 21, a[55]), b = d(b, O, C, E, w, 6, a[56]), E = d(E, b, O, C, I, 10, a[57]), C = d(C, E, b, O, y, 15, a[58]), O = d(O, C, E, b, P, 21, a[59]), b = d(b, O, C, E, p, 6, a[60]), E = d(E, b, O, C, S, 10, a[61]), C = d(C, E, b, O, f, 15, a[62]), O = d(O, C, E, b, k, 21, a[63]), r[0] = r[0] + b | 0, r[1] = r[1] + O | 0, r[2] = r[2] + C | 0, r[3] = r[3] + E | 0;}, _doFinalize: function _doFinalize() {var t = this._data,n = t.words,s = 8 * this._nDataBytes,o = 8 * t.sigBytes;n[o >>> 5] |= 128 << 24 - o % 32;var r = e.floor(s / 4294967296),i = s;n[15 + (o + 64 >>> 9 << 4)] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8), n[14 + (o + 64 >>> 9 << 4)] = 16711935 & (i << 8 | i >>> 24) | 4278255360 & (i << 24 | i >>> 8), t.sigBytes = 4 * (n.length + 1), this._process();for (var a = this._hash, c = a.words, u = 0; u < 4; u++) {var l = c[u];c[u] = 16711935 & (l << 8 | l >>> 24) | 4278255360 & (l << 24 | l >>> 8);}return a;}, clone: function clone() {var e = r.clone.call(this);return e._hash = this._hash.clone(), e;} });function u(e, t, n, s, o, r, i) {var a = e + (t & n | ~t & s) + o + i;return (a << r | a >>> 32 - r) + t;}function l(e, t, n, s, o, r, i) {var a = e + (t & s | n & ~s) + o + i;return (a << r | a >>> 32 - r) + t;}function h(e, t, n, s, o, r, i) {var a = e + (t ^ n ^ s) + o + i;return (a << r | a >>> 32 - r) + t;}function d(e, t, n, s, o, r, i) {var a = e + (n ^ (t | ~s)) + o + i;return (a << r | a >>> 32 - r) + t;}t.MD5 = r._createHelper(c), t.HmacMD5 = r._createHmacHelper(c);}(Math), n.MD5);}), s(function (e, t) {var n, s, r;e.exports = (s = (n = o).lib.Base, r = n.enc.Utf8, void (n.algo.HMAC = s.extend({ init: function init(e, t) {e = this._hasher = new e.init(), "string" == typeof t && (t = r.parse(t));var n = e.blockSize,s = 4 * n;t.sigBytes > s && (t = e.finalize(t)), t.clamp();for (var o = this._oKey = t.clone(), i = this._iKey = t.clone(), a = o.words, c = i.words, u = 0; u < n; u++) {a[u] ^= 1549556828, c[u] ^= 909522486;}o.sigBytes = i.sigBytes = s, this.reset();}, reset: function reset() {var e = this._hasher;e.reset(), e.update(this._iKey);}, update: function update(e) {return this._hasher.update(e), this;}, finalize: function finalize(e) {var t = this._hasher,n = t.finalize(e);return t.reset(), t.finalize(this._oKey.clone().concat(n));} })));}), s(function (e, t) {e.exports = o.HmacMD5;}));var i = "FUNCTION",a = "OBJECT",c = "CLIENT_DB";function u(e) {return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();}function l(e) {return "object" === u(e);}function h(e) {return e && "string" == typeof e ? JSON.parse(e) : e;}var d = "development" === "development",f = "mp-weixin";var g;switch (f) {case "h5":g = "web";break;case "app-plus":g = "app";break;default:g = f;}var p = h(undefined),m = h([]),y = true;var _ = "";try {{var _e2 = __webpack_require__(/*! uni-stat-config */ 300).default || __webpack_require__(/*! uni-stat-config */ 300);_ = _e2.appid;}} catch (e) {}var w = {};function k(e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var n, s;return n = w, s = e, Object.prototype.hasOwnProperty.call(n, s) || (w[e] = t), w[e];}"app" === g && (w = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {});var T = ["invoke", "success", "fail", "complete"],S = k("_globalUniCloudInterceptor");function v(e, t) {S[e] || (S[e] = {}), l(t) && Object.keys(t).forEach(function (n) {T.indexOf(n) > -1 && function (e, t, n) {var s = S[e][t];s || (s = S[e][t] = []), -1 === s.indexOf(n) && "function" == typeof n && s.push(n);}(e, n, t[n]);});}function P(e, t) {S[e] || (S[e] = {}), l(t) ? Object.keys(t).forEach(function (n) {T.indexOf(n) > -1 && function (e, t, n) {var s = S[e][t];if (!s) return;var o = s.indexOf(n);o > -1 && s.splice(o, 1);}(e, n, t[n]);}) : delete S[e];}function A(e, t) {return e && 0 !== e.length ? e.reduce(function (e, n) {return e.then(function () {return n(t);});}, Promise.resolve()) : Promise.resolve();}function I(e, t) {return S[e] && S[e][t] || [];}var b = k("_globalUniCloudListener"),O = "response",C = "needLogin",E = "refreshToken",R = "clientdb",U = "cloudfunction",x = "cloudobject";function L(e) {return b[e] || (b[e] = []), b[e];}function D(e, t) {var n = L(e);n.includes(t) || n.push(t);}function q(e, t) {var n = L(e),s = n.indexOf(t);-1 !== s && n.splice(s, 1);}function N(e, t) {var n = L(e);for (var _e3 = 0; _e3 < n.length; _e3++) {(0, n[_e3])(t);}}function F(e, t) {return t ? function (n) {var _this = this;var s = !1;if ("callFunction" === t) {var _e4 = n && n.type || i;s = _e4 !== i;}var o = "callFunction" === t && !s;var r;r = this.isReady ? Promise.resolve() : this.initUniCloud, n = n || {};var a = r.then(function () {return s ? Promise.resolve() : A(I(t, "invoke"), n);}).then(function () {return e.call(_this, n);}).then(function (e) {return s ? Promise.resolve(e) : A(I(t, "success"), e).then(function () {return A(I(t, "complete"), e);}).then(function () {return o && N(O, { type: U, content: e }), Promise.resolve(e);});}, function (e) {return s ? Promise.reject(e) : A(I(t, "fail"), e).then(function () {return A(I(t, "complete"), e);}).then(function () {return N(O, { type: U, content: e }), Promise.reject(e);});});if (!(n.success || n.fail || n.complete)) return a;a.then(function (e) {n.success && n.success(e), n.complete && n.complete(e), o && N(O, { type: U, content: e });}, function (e) {n.fail && n.fail(e), n.complete && n.complete(e), o && N(O, { type: U, content: e });});} : function (t) {if (!((t = t || {}).success || t.fail || t.complete)) return e.call(this, t);e.call(this, t).then(function (e) {t.success && t.success(e), t.complete && t.complete(e);}, function (e) {t.fail && t.fail(e), t.complete && t.complete(e);});};}var M = /*#__PURE__*/function (_Error) {_inherits(M, _Error);var _super = _createSuper(M);function M(e) {var _this2;_classCallCheck(this, M);_this2 = _super.call(this, e.message), _this2.errMsg = e.message || "", _this2.errCode = _this2.code = e.code || "SYSTEM_ERROR", _this2.requestId = e.requestId;return _this2;}return M;}( /*#__PURE__*/_wrapNativeSuper(Error));function j() {var e, t;try {if (uni.getLaunchOptionsSync) {if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return;var _uni$getLaunchOptions = uni.getLaunchOptionsSync(),_n = _uni$getLaunchOptions.scene,_s = _uni$getLaunchOptions.channel;e = _s, t = _n;}} catch (e) {}return { channel: e, scene: t };}var $;function K() {var e = uni.getLocale && uni.getLocale() || "en";if ($) return _objectSpread(_objectSpread({}, $), {}, { locale: e, LOCALE: e });var t = uni.getSystemInfoSync(),n = t.deviceId,s = t.platform,o = t.osName,r = t.uniPlatform,i = t.appId,a = ["pixelRatio", "brand", "model", "system", "language", "version", "platform", "host", "SDKVersion", "swanNativeVersion", "app", "AppPlatform", "fontSizeSetting"];for (var _e5 = 0; _e5 < a.length; _e5++) {delete t[a[_e5]];}return $ = _objectSpread(_objectSpread({ PLATFORM: r || f, OS: o || s, APPID: i || _, DEVICEID: n }, j()), t), _objectSpread(_objectSpread({}, $), {}, { locale: e, LOCALE: e });}var B = { sign: function sign(e, t) {var n = "";return Object.keys(e).sort().forEach(function (t) {e[t] && (n = n + "&" + t + "=" + e[t]);}), n = n.slice(1), r(n, t).toString();}, wrappedRequest: function wrappedRequest(e, t) {return new Promise(function (n, s) {t(Object.assign(e, { complete: function complete(e) {e || (e = {}), d && "web" === g && e.errMsg && 0 === e.errMsg.indexOf("request:fail") && console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5");var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"];if (!e.statusCode || e.statusCode >= 400) return s(new M({ code: "SYS_ERR", message: e.errMsg || "request:fail", requestId: t }));var o = e.data;if (o.error) return s(new M({ code: o.error.code, message: o.error.message, requestId: t }));o.result = o.data, o.requestId = t, delete o.data, n(o);} }));});} };var H = { request: function request(e) {return uni.request(e);}, uploadFile: function uploadFile(e) {return uni.uploadFile(e);}, setStorageSync: function setStorageSync(e, t) {return uni.setStorageSync(e, t);}, getStorageSync: function getStorageSync(e) {return uni.getStorageSync(e);}, removeStorageSync: function removeStorageSync(e) {return uni.removeStorageSync(e);}, clearStorageSync: function clearStorageSync() {return uni.clearStorageSync();} },W = { "uniCloud.init.paramRequired": "{param} required", "uniCloud.uploadFile.fileError": "filePath should be instance of File" };var _e6 = (0, _uniI18n.initVueI18n)({ "zh-Hans": { "uniCloud.init.paramRequired": "缺少参数:{param}", "uniCloud.uploadFile.fileError": "filePath应为File对象" }, "zh-Hant": { "uniCloud.init.paramRequired": "缺少参数:{param}", "uniCloud.uploadFile.fileError": "filePath应为File对象" }, en: W, fr: { "uniCloud.init.paramRequired": "{param} required", "uniCloud.uploadFile.fileError": "filePath should be instance of File" }, es: { "uniCloud.init.paramRequired": "{param} required", "uniCloud.uploadFile.fileError": "filePath should be instance of File" }, ja: W }, "zh-Hans"),z = _e6.t;var V = /*#__PURE__*/function () {function V(e) {_classCallCheck(this, V);["spaceId", "clientSecret"].forEach(function (t) {if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error(z("uniCloud.init.paramRequired", { param: t }));}), this.config = Object.assign({}, { endpoint: "https://api.bspapp.com" }, e), this.config.provider = "aliyun", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.config.accessTokenKey = "access_token_" + this.config.spaceId, this.adapter = H, this._getAccessTokenPromise = null, this._getAccessTokenPromiseStatus = null;}_createClass(V, [{ key: "setAccessToken", value: function setAccessToken(e) {this.accessToken = e;} }, { key: "requestWrapped", value: function requestWrapped(e) {return B.wrappedRequest(e, this.adapter.request);} }, { key: "requestAuth", value: function requestAuth(e) {return this.requestWrapped(e);} }, { key: "request", value: function request(e, t) {var _this3 = this;return Promise.resolve().then(function () {return _this3.hasAccessToken ? t ? _this3.requestWrapped(e) : _this3.requestWrapped(e).catch(function (t) {return new Promise(function (e, n) {!t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e();}).then(function () {return _this3.getAccessToken();}).then(function () {var t = _this3.rebuildRequest(e);return _this3.request(t, !0);});}) : _this3.getAccessToken().then(function () {var t = _this3.rebuildRequest(e);return _this3.request(t, !0);});});} }, { key: "rebuildRequest", value: function rebuildRequest(e) {var t = Object.assign({}, e);return t.data.token = this.accessToken, t.header["x-basement-token"] = this.accessToken, t.header["x-serverless-sign"] = B.sign(t.data, this.config.clientSecret), t;} }, { key: "setupRequest", value: function setupRequest(e, t) {var n = Object.assign({}, e, { spaceId: this.config.spaceId, timestamp: Date.now() }),s = { "Content-Type": "application/json" };return "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = B.sign(n, this.config.clientSecret), { url: this.config.requestUrl, method: "POST", data: n, dataType: "json", header: s };} }, { key: "getAccessToken", value: function getAccessToken() {var _this4 = this;if ("pending" === this._getAccessTokenPromiseStatus) return this._getAccessTokenPromise;this._getAccessTokenPromiseStatus = "pending";return this._getAccessTokenPromise = this.requestAuth(this.setupRequest({ method: "serverless.auth.user.anonymousAuthorize", params: "{}" }, "auth")).then(function (e) {return new Promise(function (t, n) {e.result && e.result.accessToken ? (_this4.setAccessToken(e.result.accessToken), _this4._getAccessTokenPromiseStatus = "fulfilled", t(_this4.accessToken)) : (_this4._getAccessTokenPromiseStatus = "rejected", n(new M({ code: "AUTH_FAILED", message: "获取accessToken失败" })));});}, function (e) {return _this4._getAccessTokenPromiseStatus = "rejected", Promise.reject(e);}), this._getAccessTokenPromise;} }, { key: "authorize", value: function authorize() {this.getAccessToken();} }, { key: "callFunction", value: function callFunction(e) {var t = { method: "serverless.function.runtime.invoke", params: JSON.stringify({ functionTarget: e.name, functionArgs: e.data || {} }) };return this.request(this.setupRequest(t));} }, { key: "getOSSUploadOptionsFromPath", value: function getOSSUploadOptionsFromPath(e) {var t = { method: "serverless.file.resource.generateProximalSign", params: JSON.stringify(e) };return this.request(this.setupRequest(t));} }, { key: "uploadFileToOSS", value: function uploadFileToOSS(_ref) {var _this5 = this;var e = _ref.url,t = _ref.formData,n = _ref.name,s = _ref.filePath,o = _ref.fileType,r = _ref.onUploadProgress;return new Promise(function (i, a) {var c = _this5.adapter.uploadFile({ url: e, formData: t, name: n, filePath: s, fileType: o, header: { "X-OSS-server-side-encrpytion": "AES256" }, success: function success(e) {e && e.statusCode < 400 ? i(e) : a(new M({ code: "UPLOAD_FAILED", message: "文件上传失败" }));}, fail: function fail(e) {a(new M({ code: e.code || "UPLOAD_FAILED", message: e.message || e.errMsg || "文件上传失败" }));} });"function" == typeof r && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {r({ loaded: e.totalBytesSent, total: e.totalBytesExpectedToSend });});});} }, { key: "reportOSSUpload", value: function reportOSSUpload(e) {var t = { method: "serverless.file.resource.report", params: JSON.stringify(e) };return this.request(this.setupRequest(t));} }, { key: "uploadFile", value: function uploadFile(_ref2) {var _this6 = this;var e = _ref2.filePath,t = _ref2.cloudPath,_ref2$fileType = _ref2.fileType,n = _ref2$fileType === void 0 ? "image" : _ref2$fileType,s = _ref2.onUploadProgress,o = _ref2.config;if ("string" !== u(t)) throw new M({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" });if (!(t = t.trim())) throw new M({ code: "CLOUDPATH_REQUIRED", message: "cloudPath不可为空" });if (/:\/\//.test(t)) throw new M({ code: "INVALID_PARAM", message: "cloudPath不合法" });var r = o && o.envType || this.config.envType;var i, a;return this.getOSSUploadOptionsFromPath({ env: r, filename: t }).then(function (t) {var o = t.result;i = o.id, a = "https://" + o.cdnDomain + "/" + o.ossPath;var r = { url: "https://" + o.host, formData: { "Cache-Control": "max-age=2592000", "Content-Disposition": "attachment", OSSAccessKeyId: o.accessKeyId, Signature: o.signature, host: o.host, id: i, key: o.ossPath, policy: o.policy, success_action_status: 200 }, fileName: "file", name: "file", filePath: e, fileType: n };return _this6.uploadFileToOSS(Object.assign({}, r, { onUploadProgress: s }));}).then(function () {return _this6.reportOSSUpload({ id: i });}).then(function (t) {return new Promise(function (n, s) {t.success ? n({ success: !0, filePath: e, fileID: a }) : s(new M({ code: "UPLOAD_FAILED", message: "文件上传失败" }));});});} }, { key: "deleteFile", value: function deleteFile(_ref3) {var e = _ref3.fileList;var t = { method: "serverless.file.resource.delete", params: JSON.stringify({ id: e[0] }) };return this.request(this.setupRequest(t));} }, { key: "getTempFileURL", value: function getTempFileURL() {var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref4.fileList;return new Promise(function (t, n) {Array.isArray(e) && 0 !== e.length || n(new M({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" })), t({ fileList: e.map(function (e) {return { fileID: e, tempFileURL: e };}) });});} }, { key: "hasAccessToken", get: function get() {return !!this.accessToken;} }]);return V;}();var J = { init: function init(e) {var t = new V(e),n = { signInAnonymously: function signInAnonymously() {return t.authorize();}, getLoginState: function getLoginState() {return Promise.resolve(!1);} };return t.auth = function () {return n;}, t.customAuth = t.auth, t;} };var Y = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";var X;!function (e) {e.local = "local", e.none = "none", e.session = "session";}(X || (X = {}));var G = function G() {};var Q = function Q() {var e;if (!Promise) {e = function e() {}, e.promise = {};var _t2 = function _t2() {throw new M({ message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.' });};return Object.defineProperty(e.promise, "then", { get: _t2 }), Object.defineProperty(e.promise, "catch", { get: _t2 }), e;}var t = new Promise(function (t, n) {e = function e(_e7, s) {return _e7 ? n(_e7) : t(s);};});return e.promise = t, e;};function Z(e) {return void 0 === e;}function ee(e) {return "[object Null]" === Object.prototype.toString.call(e);}var te;function ne(e) {var t = (n = e, "[object Array]" === Object.prototype.toString.call(n) ? e : [e]);var n;var _iterator = _createForOfIteratorHelper(t),_step;try {for (_iterator.s(); !(_step = _iterator.n()).done;) {var _e8 = _step.value;var _t3 = _e8.isMatch,_n2 = _e8.genAdapter,_s2 = _e8.runtime;if (_t3()) return { adapter: _n2(), runtime: _s2 };}} catch (err) {_iterator.e(err);} finally {_iterator.f();}}!function (e) {e.WEB = "web", e.WX_MP = "wx_mp";}(te || (te = {}));var se = { adapter: null, runtime: void 0 },oe = ["anonymousUuidKey"];var re = /*#__PURE__*/function (_G) {_inherits(re, _G);var _super2 = _createSuper(re);function re() {var _this7;_classCallCheck(this, re);_this7 = _super2.call(this), se.adapter.root.tcbObject || (se.adapter.root.tcbObject = {});return _this7;}_createClass(re, [{ key: "setItem", value: function setItem(e, t) {se.adapter.root.tcbObject[e] = t;} }, { key: "getItem", value: function getItem(e) {return se.adapter.root.tcbObject[e];} }, { key: "removeItem", value: function removeItem(e) {delete se.adapter.root.tcbObject[e];} }, { key: "clear", value: function clear() {delete se.adapter.root.tcbObject;} }]);return re;}(G);function ie(e, t) {switch (e) {case "local":return t.localStorage || new re();case "none":return new re();default:return t.sessionStorage || new re();}}var ae = /*#__PURE__*/function () {function ae(e) {_classCallCheck(this, ae);if (!this._storage) {this._persistence = se.adapter.primaryStorage || e.persistence, this._storage = ie(this._persistence, se.adapter);var _t4 = "access_token_".concat(e.env),_n3 = "access_token_expire_".concat(e.env),_s3 = "refresh_token_".concat(e.env),_o = "anonymous_uuid_".concat(e.env),_r = "login_type_".concat(e.env),_i = "user_info_".concat(e.env);this.keys = { accessTokenKey: _t4, accessTokenExpireKey: _n3, refreshTokenKey: _s3, anonymousUuidKey: _o, loginTypeKey: _r, userInfoKey: _i };}}_createClass(ae, [{ key: "updatePersistence", value: function updatePersistence(e) {if (e === this._persistence) return;var t = "local" === this._persistence;this._persistence = e;var n = ie(e, se.adapter);for (var _e9 in this.keys) {var _s4 = this.keys[_e9];if (t && oe.includes(_e9)) continue;var _o2 = this._storage.getItem(_s4);Z(_o2) || ee(_o2) || (n.setItem(_s4, _o2), this._storage.removeItem(_s4));}this._storage = n;} }, { key: "setStore", value: function setStore(e, t, n) {if (!this._storage) return;var s = { version: n || "localCachev1", content: t },o = JSON.stringify(s);try {this._storage.setItem(e, o);} catch (e) {throw e;}} }, { key: "getStore", value: function getStore(e, t) {try {if (!this._storage) return;} catch (e) {return "";}t = t || "localCachev1";var n = this._storage.getItem(e);if (!n) return "";if (n.indexOf(t) >= 0) {return JSON.parse(n).content;}return "";} }, { key: "removeStore", value: function removeStore(e) {this._storage.removeItem(e);} }]);return ae;}();var ce = {},ue = {};function le(e) {return ce[e];}var he = function he(e, t) {_classCallCheck(this, he);this.data = t || null, this.name = e;};var de = /*#__PURE__*/function (_he) {_inherits(de, _he);var _super3 = _createSuper(de);function de(e, t) {var _this8;_classCallCheck(this, de);_this8 = _super3.call(this, "error", { error: e, data: t }), _this8.error = e;return _this8;}return de;}(he);var fe = new ( /*#__PURE__*/function () {function _class() {_classCallCheck(this, _class);this._listeners = {};}_createClass(_class, [{ key: "on", value: function on(e, t) {return function (e, t, n) {n[e] = n[e] || [], n[e].push(t);}(e, t, this._listeners), this;} }, { key: "off", value: function off(e, t) {return function (e, t, n) {if (n && n[e]) {var _s5 = n[e].indexOf(t);-1 !== _s5 && n[e].splice(_s5, 1);}}(e, t, this._listeners), this;} }, { key: "fire", value: function fire(e, t) {if (e instanceof de) return console.error(e.error), this;var n = "string" == typeof e ? new he(e, t || {}) : e;var s = n.name;if (this._listens(s)) {n.target = this;var _e10 = this._listeners[s] ? _toConsumableArray(this._listeners[s]) : [];var _iterator2 = _createForOfIteratorHelper(_e10),_step2;try {for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {var _t5 = _step2.value;_t5.call(this, n);}} catch (err) {_iterator2.e(err);} finally {_iterator2.f();}}return this;} }, { key: "_listens", value: function _listens(e) {return this._listeners[e] && this._listeners[e].length > 0;} }]);return _class;}())();function ge(e, t) {fe.on(e, t);}function pe(e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};fe.fire(e, t);}function me(e, t) {fe.off(e, t);}var ye = "loginStateChanged",_e = "loginStateExpire",we = "loginTypeChanged",ke = "anonymousConverted",Te = "refreshAccessToken";var Se;!function (e) {e.ANONYMOUS = "ANONYMOUS", e.WECHAT = "WECHAT", e.WECHAT_PUBLIC = "WECHAT-PUBLIC", e.WECHAT_OPEN = "WECHAT-OPEN", e.CUSTOM = "CUSTOM", e.EMAIL = "EMAIL", e.USERNAME = "USERNAME", e.NULL = "NULL";}(Se || (Se = {}));var ve = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"],Pe = { "X-SDK-Version": "1.3.5" };function Ae(e, t, n) {var s = e[t];e[t] = function (t) {var o = {},r = {};n.forEach(function (n) {var _n$call = n.call(e, t),s = _n$call.data,i = _n$call.headers;Object.assign(o, s), Object.assign(r, i);});var i = t.data;return i && function () {var e;if (e = i, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = _objectSpread(_objectSpread({}, i), o);else for (var _e11 in o) {i.append(_e11, o[_e11]);}}(), t.headers = _objectSpread(_objectSpread({}, t.headers || {}), r), s.call(e, t);};}function Ie() {var e = Math.random().toString(16).slice(2);return { data: { seqId: e }, headers: _objectSpread(_objectSpread({}, Pe), {}, { "x-seqid": e }) };}var be = /*#__PURE__*/function () {function be() {var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};_classCallCheck(this, be);var t;this.config = e, this._reqClass = new se.adapter.reqClass({ timeout: this.config.timeout, timeoutMsg: "\u8BF7\u6C42\u5728".concat(this.config.timeout / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD"), restrictedMethods: ["post"] }), this._cache = le(this.config.env), this._localCache = (t = this.config.env, ue[t]), Ae(this._reqClass, "post", [Ie]), Ae(this._reqClass, "upload", [Ie]), Ae(this._reqClass, "download", [Ie]);}_createClass(be, [{ key: "post", value: function () {var _post = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.next = 2;return this._reqClass.post(e);case 2:return _context.abrupt("return", _context.sent);case 3:case "end":return _context.stop();}}}, _callee, this);}));function post(_x) {return _post.apply(this, arguments);}return post;}() }, { key: "upload", value: function () {var _upload = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2(e) {return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:_context2.next = 2;return this._reqClass.upload(e);case 2:return _context2.abrupt("return", _context2.sent);case 3:case "end":return _context2.stop();}}}, _callee2, this);}));function upload(_x2) {return _upload.apply(this, arguments);}return upload;}() }, { key: "download", value: function () {var _download = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3(e) {return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:_context3.next = 2;return this._reqClass.download(e);case 2:return _context3.abrupt("return", _context3.sent);case 3:case "end":return _context3.stop();}}}, _callee3, this);}));function download(_x3) {return _download.apply(this, arguments);}return download;}() }, { key: "refreshAccessToken", value: function () {var _refreshAccessToken2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee4() {var e, t;return _regenerator.default.wrap(function _callee4$(_context4) {while (1) {switch (_context4.prev = _context4.next) {case 0:this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());_context4.prev = 1;_context4.next = 4;return this._refreshAccessTokenPromise;case 4:e = _context4.sent;_context4.next = 10;break;case 7:_context4.prev = 7;_context4.t0 = _context4["catch"](1);t = _context4.t0;case 10:if (!(this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t)) {_context4.next = 12;break;}throw t;case 12:return _context4.abrupt("return", e);case 13:case "end":return _context4.stop();}}}, _callee4, this, [[1, 7]]);}));function refreshAccessToken() {return _refreshAccessToken2.apply(this, arguments);}return refreshAccessToken;}() }, { key: "_refreshAccessToken", value: function () {var _refreshAccessToken3 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee5() {var _this$_cache$keys, e, t, n, s, o, r, i, a, _e12, _e13, _t6, _s6;return _regenerator.default.wrap(function _callee5$(_context5) {while (1) {switch (_context5.prev = _context5.next) {case 0:_this$_cache$keys = this._cache.keys, e = _this$_cache$keys.accessTokenKey, t = _this$_cache$keys.accessTokenExpireKey, n = _this$_cache$keys.refreshTokenKey, s = _this$_cache$keys.loginTypeKey, o = _this$_cache$keys.anonymousUuidKey;this._cache.removeStore(e), this._cache.removeStore(t);r = this._cache.getStore(n);if (r) {_context5.next = 5;break;}throw new M({ message: "未登录CloudBase" });case 5:i = { refresh_token: r };_context5.next = 8;return this.request("auth.fetchAccessTokenWithRefreshToken", i);case 8:a = _context5.sent;if (!a.data.code) {_context5.next = 21;break;}_e12 = a.data.code;if (!("SIGN_PARAM_INVALID" === _e12 || "REFRESH_TOKEN_EXPIRED" === _e12 || "INVALID_REFRESH_TOKEN" === _e12)) {_context5.next = 20;break;}if (!(this._cache.getStore(s) === Se.ANONYMOUS && "INVALID_REFRESH_TOKEN" === _e12)) {_context5.next = 19;break;}_e13 = this._cache.getStore(o);_t6 = this._cache.getStore(n);_context5.next = 17;return this.send("auth.signInAnonymously", { anonymous_uuid: _e13, refresh_token: _t6 });case 17:_s6 = _context5.sent;return _context5.abrupt("return", (this.setRefreshToken(_s6.refresh_token), this._refreshAccessToken()));case 19:pe(_e), this._cache.removeStore(n);case 20:throw new M({ code: a.data.code, message: "\u5237\u65B0access token\u5931\u8D25\uFF1A".concat(a.data.code) });case 21:if (!a.data.access_token) {_context5.next = 23;break;}return _context5.abrupt("return", (pe(Te), this._cache.setStore(e, a.data.access_token), this._cache.setStore(t, a.data.access_token_expire + Date.now()), { accessToken: a.data.access_token, accessTokenExpire: a.data.access_token_expire }));case 23:a.data.refresh_token && (this._cache.removeStore(n), this._cache.setStore(n, a.data.refresh_token), this._refreshAccessToken());case 24:case "end":return _context5.stop();}}}, _callee5, this);}));function _refreshAccessToken() {return _refreshAccessToken3.apply(this, arguments);}return _refreshAccessToken;}() }, { key: "getAccessToken", value: function () {var _getAccessToken = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee6() {var _this$_cache$keys2, e, t, n, s, o, r;return _regenerator.default.wrap(function _callee6$(_context6) {while (1) {switch (_context6.prev = _context6.next) {case 0:_this$_cache$keys2 = this._cache.keys, e = _this$_cache$keys2.accessTokenKey, t = _this$_cache$keys2.accessTokenExpireKey, n = _this$_cache$keys2.refreshTokenKey;if (this._cache.getStore(n)) {_context6.next = 3;break;}throw new M({ message: "refresh token不存在,登录状态异常" });case 3:s = this._cache.getStore(e), o = this._cache.getStore(t), r = !0;_context6.t0 = this._shouldRefreshAccessTokenHook;if (!_context6.t0) {_context6.next = 9;break;}_context6.next = 8;return this._shouldRefreshAccessTokenHook(s, o);case 8:_context6.t0 = !_context6.sent;case 9:_context6.t1 = _context6.t0;if (!_context6.t1) {_context6.next = 12;break;}r = !1;case 12:return _context6.abrupt("return", (!s || !o || o < Date.now()) && r ? this.refreshAccessToken() : { accessToken: s, accessTokenExpire: o });case 13:case "end":return _context6.stop();}}}, _callee6, this);}));function getAccessToken() {return _getAccessToken.apply(this, arguments);}return getAccessToken;}() }, { key: "request", value: function () {var _request = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee7(e, t, n) {var s, o, r, _e14, i, _e15, _e16, a, c, u, l, h, d, f, g, p;return _regenerator.default.wrap(function _callee7$(_context7) {while (1) {switch (_context7.prev = _context7.next) {case 0:s = "x-tcb-trace_".concat(this.config.env);o = "application/x-www-form-urlencoded";r = _objectSpread({ action: e, env: this.config.env, dataVersion: "2019-08-16" }, t);if (!(-1 === ve.indexOf(e))) {_context7.next = 10;break;}_e14 = this._cache.keys.refreshTokenKey;_context7.t0 = this._cache.getStore(_e14);if (!_context7.t0) {_context7.next = 10;break;}_context7.next = 9;return this.getAccessToken();case 9:r.access_token = _context7.sent.accessToken;case 10:if ("storage.uploadFile" === e) {i = new FormData();for (_e15 in i) {i.hasOwnProperty(_e15) && void 0 !== i[_e15] && i.append(_e15, r[_e15]);}o = "multipart/form-data";} else {o = "application/json", i = {};for (_e16 in r) {void 0 !== r[_e16] && (i[_e16] = r[_e16]);}}a = { headers: { "content-type": o } };n && n.onUploadProgress && (a.onUploadProgress = n.onUploadProgress);c = this._localCache.getStore(s);c && (a.headers["X-TCB-Trace"] = c);u = t.parse, l = t.inQuery, h = t.search;d = { env: this.config.env };u && (d.parse = !0), l && (d = _objectSpread(_objectSpread({}, l), d));f = function (e, t) {var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};var s = /\?/.test(t);var o = "";for (var _e17 in n) {"" === o ? !s && (t += "?") : o += "&", o += "".concat(_e17, "=").concat(encodeURIComponent(n[_e17]));}return /^http(s)?\:\/\//.test(t += o) ? t : "".concat(e).concat(t);}(Y, "//tcb-api.tencentcloudapi.com/web", d);h && (f += h);_context7.next = 22;return this.post(_objectSpread({ url: f, data: i }, a));case 22:g = _context7.sent;p = g.header && g.header["x-tcb-trace"];if (!(p && this._localCache.setStore(s, p), 200 !== Number(g.status) && 200 !== Number(g.statusCode) || !g.data)) {_context7.next = 26;break;}throw new M({ code: "NETWORK_ERROR", message: "network request error" });case 26:return _context7.abrupt("return", g);case 27:case "end":return _context7.stop();}}}, _callee7, this);}));function request(_x4, _x5, _x6) {return _request.apply(this, arguments);}return request;}() }, { key: "send", value: function () {var _send = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee8(e) {var t,n,_n4,_args8 = arguments;return _regenerator.default.wrap(function _callee8$(_context8) {while (1) {switch (_context8.prev = _context8.next) {case 0:t = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : {};_context8.next = 3;return this.request(e, t, { onUploadProgress: t.onUploadProgress });case 3:n = _context8.sent;if (!("ACCESS_TOKEN_EXPIRED" === n.data.code && -1 === ve.indexOf(e))) {_context8.next = 13;break;}_context8.next = 7;return this.refreshAccessToken();case 7:_context8.next = 9;return this.request(e, t, { onUploadProgress: t.onUploadProgress });case 9:_n4 = _context8.sent;if (!_n4.data.code) {_context8.next = 12;break;}throw new M({ code: _n4.data.code, message: _n4.data.message });case 12:return _context8.abrupt("return", _n4.data);case 13:if (!n.data.code) {_context8.next = 15;break;}throw new M({ code: n.data.code, message: n.data.message });case 15:return _context8.abrupt("return", n.data);case 16:case "end":return _context8.stop();}}}, _callee8, this);}));function send(_x7) {return _send.apply(this, arguments);}return send;}() }, { key: "setRefreshToken", value: function setRefreshToken(e) {var _this$_cache$keys3 = this._cache.keys,t = _this$_cache$keys3.accessTokenKey,n = _this$_cache$keys3.accessTokenExpireKey,s = _this$_cache$keys3.refreshTokenKey;this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);} }]);return be;}();var Oe = {};function Ce(e) {return Oe[e];}var Ee = /*#__PURE__*/function () {function Ee(e) {_classCallCheck(this, Ee);this.config = e, this._cache = le(e.env), this._request = Ce(e.env);}_createClass(Ee, [{ key: "setRefreshToken", value: function setRefreshToken(e) {var _this$_cache$keys4 = this._cache.keys,t = _this$_cache$keys4.accessTokenKey,n = _this$_cache$keys4.accessTokenExpireKey,s = _this$_cache$keys4.refreshTokenKey;this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);} }, { key: "setAccessToken", value: function setAccessToken(e, t) {var _this$_cache$keys5 = this._cache.keys,n = _this$_cache$keys5.accessTokenKey,s = _this$_cache$keys5.accessTokenExpireKey;this._cache.setStore(n, e), this._cache.setStore(s, t);} }, { key: "refreshUserInfo", value: function () {var _refreshUserInfo = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee9() {var _yield$this$_request$, e;return _regenerator.default.wrap(function _callee9$(_context9) {while (1) {switch (_context9.prev = _context9.next) {case 0:_context9.next = 2;return this._request.send("auth.getUserInfo", {});case 2:_yield$this$_request$ = _context9.sent;e = _yield$this$_request$.data;return _context9.abrupt("return", (this.setLocalUserInfo(e), e));case 5:case "end":return _context9.stop();}}}, _callee9, this);}));function refreshUserInfo() {return _refreshUserInfo.apply(this, arguments);}return refreshUserInfo;}() }, { key: "setLocalUserInfo", value: function setLocalUserInfo(e) {var t = this._cache.keys.userInfoKey;this._cache.setStore(t, e);} }]);return Ee;}();var Re = /*#__PURE__*/function () {function Re(e) {_classCallCheck(this, Re);if (!e) throw new M({ code: "PARAM_ERROR", message: "envId is not defined" });this._envId = e, this._cache = le(this._envId), this._request = Ce(this._envId), this.setUserInfo();}_createClass(Re, [{ key: "linkWithTicket", value: function linkWithTicket(e) {if ("string" != typeof e) throw new M({ code: "PARAM_ERROR", message: "ticket must be string" });return this._request.send("auth.linkWithTicket", { ticket: e });} }, { key: "linkWithRedirect", value: function linkWithRedirect(e) {e.signInWithRedirect();} }, { key: "updatePassword", value: function updatePassword(e, t) {return this._request.send("auth.updatePassword", { oldPassword: t, newPassword: e });} }, { key: "updateEmail", value: function updateEmail(e) {return this._request.send("auth.updateEmail", { newEmail: e });} }, { key: "updateUsername", value: function updateUsername(e) {if ("string" != typeof e) throw new M({ code: "PARAM_ERROR", message: "username must be a string" });return this._request.send("auth.updateUsername", { username: e });} }, { key: "getLinkedUidList", value: function () {var _getLinkedUidList = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee10() {var _yield$this$_request$2, e, t, n;return _regenerator.default.wrap(function _callee10$(_context10) {while (1) {switch (_context10.prev = _context10.next) {case 0:_context10.next = 2;return this._request.send("auth.getLinkedUidList", {});case 2:_yield$this$_request$2 = _context10.sent;e = _yield$this$_request$2.data;t = !1;n = e.users;return _context10.abrupt("return", (n.forEach(function (e) {e.wxOpenId && e.wxPublicId && (t = !0);}), { users: n, hasPrimaryUid: t }));case 7:case "end":return _context10.stop();}}}, _callee10, this);}));function getLinkedUidList() {return _getLinkedUidList.apply(this, arguments);}return getLinkedUidList;}() }, { key: "setPrimaryUid", value: function setPrimaryUid(e) {return this._request.send("auth.setPrimaryUid", { uid: e });} }, { key: "unlink", value: function unlink(e) {return this._request.send("auth.unlink", { platform: e });} }, { key: "update", value: function () {var _update = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee11(e) {var t, n, s, o, r, i, _yield$this$_request$3, a;return _regenerator.default.wrap(function _callee11$(_context11) {while (1) {switch (_context11.prev = _context11.next) {case 0:t = e.nickName;n = e.gender;s = e.avatarUrl;o = e.province;r = e.country;i = e.city;_context11.next = 8;return this._request.send("auth.updateUserInfo", { nickName: t, gender: n, avatarUrl: s, province: o, country: r, city: i });case 8:_yield$this$_request$3 = _context11.sent;a = _yield$this$_request$3.data;this.setLocalUserInfo(a);case 11:case "end":return _context11.stop();}}}, _callee11, this);}));function update(_x8) {return _update.apply(this, arguments);}return update;}() }, { key: "refresh", value: function () {var _refresh = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee12() {var _yield$this$_request$4, e;return _regenerator.default.wrap(function _callee12$(_context12) {while (1) {switch (_context12.prev = _context12.next) {case 0:_context12.next = 2;return this._request.send("auth.getUserInfo", {});case 2:_yield$this$_request$4 = _context12.sent;e = _yield$this$_request$4.data;return _context12.abrupt("return", (this.setLocalUserInfo(e), e));case 5:case "end":return _context12.stop();}}}, _callee12, this);}));function refresh() {return _refresh.apply(this, arguments);}return refresh;}() }, { key: "setUserInfo", value: function setUserInfo() {var _this9 = this;var e = this._cache.keys.userInfoKey,t = this._cache.getStore(e);["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach(function (e) {_this9[e] = t[e];}), this.location = { country: t.country, province: t.province, city: t.city };} }, { key: "setLocalUserInfo", value: function setLocalUserInfo(e) {var t = this._cache.keys.userInfoKey;this._cache.setStore(t, e), this.setUserInfo();} }]);return Re;}();var Ue = /*#__PURE__*/function () {function Ue(e) {_classCallCheck(this, Ue);if (!e) throw new M({ code: "PARAM_ERROR", message: "envId is not defined" });this._cache = le(e);var _this$_cache$keys6 = this._cache.keys,t = _this$_cache$keys6.refreshTokenKey,n = _this$_cache$keys6.accessTokenKey,s = _this$_cache$keys6.accessTokenExpireKey,o = this._cache.getStore(t),r = this._cache.getStore(n),i = this._cache.getStore(s);this.credential = { refreshToken: o, accessToken: r, accessTokenExpire: i }, this.user = new Re(e);}_createClass(Ue, [{ key: "isAnonymousAuth", get: function get() {return this.loginType === Se.ANONYMOUS;} }, { key: "isCustomAuth", get: function get() {return this.loginType === Se.CUSTOM;} }, { key: "isWeixinAuth", get: function get() {return this.loginType === Se.WECHAT || this.loginType === Se.WECHAT_OPEN || this.loginType === Se.WECHAT_PUBLIC;} }, { key: "loginType", get: function get() {return this._cache.getStore(this._cache.keys.loginTypeKey);} }]);return Ue;}();var xe = /*#__PURE__*/function (_Ee) {_inherits(xe, _Ee);var _super4 = _createSuper(xe);function xe() {_classCallCheck(this, xe);return _super4.apply(this, arguments);}_createClass(xe, [{ key: "signIn", value: function () {var _signIn = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee13() {var _this$_cache$keys7, e, t, n, s, o, _e18;return _regenerator.default.wrap(function _callee13$(_context13) {while (1) {switch (_context13.prev = _context13.next) {case 0:this._cache.updatePersistence("local");_this$_cache$keys7 = this._cache.keys;e = _this$_cache$keys7.anonymousUuidKey;t = _this$_cache$keys7.refreshTokenKey;n = this._cache.getStore(e) || void 0;s = this._cache.getStore(t) || void 0;_context13.next = 8;return this._request.send("auth.signInAnonymously", { anonymous_uuid: n, refresh_token: s });case 8:o = _context13.sent;if (!(o.uuid && o.refresh_token)) {_context13.next = 20;break;}this._setAnonymousUUID(o.uuid);this.setRefreshToken(o.refresh_token);_context13.next = 14;return this._request.refreshAccessToken();case 14:pe(ye);pe(we, { env: this.config.env, loginType: Se.ANONYMOUS, persistence: "local" });_e18 = new Ue(this.config.env);_context13.next = 19;return _e18.user.refresh();case 19:return _context13.abrupt("return", _e18);case 20:throw new M({ message: "匿名登录失败" });case 21:case "end":return _context13.stop();}}}, _callee13, this);}));function signIn() {return _signIn.apply(this, arguments);}return signIn;}() }, { key: "linkAndRetrieveDataWithTicket", value: function () {var _linkAndRetrieveDataWithTicket = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {var _this$_cache$keys8, t, n, s, o, r;return _regenerator.default.wrap(function _callee14$(_context14) {while (1) {switch (_context14.prev = _context14.next) {case 0:_this$_cache$keys8 = this._cache.keys;t = _this$_cache$keys8.anonymousUuidKey;n = _this$_cache$keys8.refreshTokenKey;s = this._cache.getStore(t);o = this._cache.getStore(n);_context14.next = 7;return this._request.send("auth.linkAndRetrieveDataWithTicket", { anonymous_uuid: s, refresh_token: o, ticket: e });case 7:r = _context14.sent;if (!r.refresh_token) {_context14.next = 16;break;}this._clearAnonymousUUID();this.setRefreshToken(r.refresh_token);_context14.next = 13;return this._request.refreshAccessToken();case 13:pe(ke, { env: this.config.env });pe(we, { loginType: Se.CUSTOM, persistence: "local" });return _context14.abrupt("return", { credential: { refreshToken: r.refresh_token } });case 16:throw new M({ message: "匿名转化失败" });case 17:case "end":return _context14.stop();}}}, _callee14, this);}));function linkAndRetrieveDataWithTicket(_x9) {return _linkAndRetrieveDataWithTicket.apply(this, arguments);}return linkAndRetrieveDataWithTicket;}() }, { key: "_setAnonymousUUID", value: function _setAnonymousUUID(e) {var _this$_cache$keys9 = this._cache.keys,t = _this$_cache$keys9.anonymousUuidKey,n = _this$_cache$keys9.loginTypeKey;this._cache.removeStore(t), this._cache.setStore(t, e), this._cache.setStore(n, Se.ANONYMOUS);} }, { key: "_clearAnonymousUUID", value: function _clearAnonymousUUID() {this._cache.removeStore(this._cache.keys.anonymousUuidKey);} }]);return xe;}(Ee);var Le = /*#__PURE__*/function (_Ee2) {_inherits(Le, _Ee2);var _super5 = _createSuper(Le);function Le() {_classCallCheck(this, Le);return _super5.apply(this, arguments);}_createClass(Le, [{ key: "signIn", value: function () {var _signIn2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee15(e) {var t, n;return _regenerator.default.wrap(function _callee15$(_context15) {while (1) {switch (_context15.prev = _context15.next) {case 0:if (!("string" != typeof e)) {_context15.next = 2;break;}throw new M({ param: "PARAM_ERROR", message: "ticket must be a string" });case 2:t = this._cache.keys.refreshTokenKey;_context15.next = 5;return this._request.send("auth.signInWithTicket", { ticket: e, refresh_token: this._cache.getStore(t) || "" });case 5:n = _context15.sent;if (!n.refresh_token) {_context15.next = 15;break;}this.setRefreshToken(n.refresh_token);_context15.next = 10;return this._request.refreshAccessToken();case 10:pe(ye);pe(we, { env: this.config.env, loginType: Se.CUSTOM, persistence: this.config.persistence });_context15.next = 14;return this.refreshUserInfo();case 14:return _context15.abrupt("return", new Ue(this.config.env));case 15:throw new M({ message: "自定义登录失败" });case 16:case "end":return _context15.stop();}}}, _callee15, this);}));function signIn(_x10) {return _signIn2.apply(this, arguments);}return signIn;}() }]);return Le;}(Ee);var De = /*#__PURE__*/function (_Ee3) {_inherits(De, _Ee3);var _super6 = _createSuper(De);function De() {_classCallCheck(this, De);return _super6.apply(this, arguments);}_createClass(De, [{ key: "signIn", value: function () {var _signIn3 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee16(e, t) {var n, s, o, r, i;return _regenerator.default.wrap(function _callee16$(_context16) {while (1) {switch (_context16.prev = _context16.next) {case 0:if (!("string" != typeof e)) {_context16.next = 2;break;}throw new M({ code: "PARAM_ERROR", message: "email must be a string" });case 2:n = this._cache.keys.refreshTokenKey;_context16.next = 5;return this._request.send("auth.signIn", { loginType: "EMAIL", email: e, password: t, refresh_token: this._cache.getStore(n) || "" });case 5:s = _context16.sent;o = s.refresh_token;r = s.access_token;i = s.access_token_expire;if (!o) {_context16.next = 22;break;}this.setRefreshToken(o);if (!(r && i)) {_context16.next = 15;break;}this.setAccessToken(r, i);_context16.next = 17;break;case 15:_context16.next = 17;return this._request.refreshAccessToken();case 17:_context16.next = 19;return this.refreshUserInfo();case 19:pe(ye);pe(we, { env: this.config.env, loginType: Se.EMAIL, persistence: this.config.persistence });return _context16.abrupt("return", new Ue(this.config.env));case 22:throw s.code ? new M({ code: s.code, message: "\u90AE\u7BB1\u767B\u5F55\u5931\u8D25: ".concat(s.message) }) : new M({ message: "邮箱登录失败" });case 23:case "end":return _context16.stop();}}}, _callee16, this);}));function signIn(_x11, _x12) {return _signIn3.apply(this, arguments);}return signIn;}() }, { key: "activate", value: function () {var _activate = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee17(e) {return _regenerator.default.wrap(function _callee17$(_context17) {while (1) {switch (_context17.prev = _context17.next) {case 0:return _context17.abrupt("return", this._request.send("auth.activateEndUserMail", { token: e }));case 1:case "end":return _context17.stop();}}}, _callee17, this);}));function activate(_x13) {return _activate.apply(this, arguments);}return activate;}() }, { key: "resetPasswordWithToken", value: function () {var _resetPasswordWithToken = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee18(e, t) {return _regenerator.default.wrap(function _callee18$(_context18) {while (1) {switch (_context18.prev = _context18.next) {case 0:return _context18.abrupt("return", this._request.send("auth.resetPasswordWithToken", { token: e, newPassword: t }));case 1:case "end":return _context18.stop();}}}, _callee18, this);}));function resetPasswordWithToken(_x14, _x15) {return _resetPasswordWithToken.apply(this, arguments);}return resetPasswordWithToken;}() }]);return De;}(Ee);var qe = /*#__PURE__*/function (_Ee4) {_inherits(qe, _Ee4);var _super7 = _createSuper(qe);function qe() {_classCallCheck(this, qe);return _super7.apply(this, arguments);}_createClass(qe, [{ key: "signIn", value: function () {var _signIn4 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee19(e, t) {var n, s, o, r, i;return _regenerator.default.wrap(function _callee19$(_context19) {while (1) {switch (_context19.prev = _context19.next) {case 0:if (!("string" != typeof e)) {_context19.next = 2;break;}throw new M({ code: "PARAM_ERROR", message: "username must be a string" });case 2:"string" != typeof t && (t = "", console.warn("password is empty"));n = this._cache.keys.refreshTokenKey;_context19.next = 6;return this._request.send("auth.signIn", { loginType: Se.USERNAME, username: e, password: t, refresh_token: this._cache.getStore(n) || "" });case 6:s = _context19.sent;o = s.refresh_token;r = s.access_token_expire;i = s.access_token;if (!o) {_context19.next = 23;break;}this.setRefreshToken(o);if (!(i && r)) {_context19.next = 16;break;}this.setAccessToken(i, r);_context19.next = 18;break;case 16:_context19.next = 18;return this._request.refreshAccessToken();case 18:_context19.next = 20;return this.refreshUserInfo();case 20:pe(ye);pe(we, { env: this.config.env, loginType: Se.USERNAME, persistence: this.config.persistence });return _context19.abrupt("return", new Ue(this.config.env));case 23:throw s.code ? new M({ code: s.code, message: "\u7528\u6237\u540D\u5BC6\u7801\u767B\u5F55\u5931\u8D25: ".concat(s.message) }) : new M({ message: "用户名密码登录失败" });case 24:case "end":return _context19.stop();}}}, _callee19, this);}));function signIn(_x16, _x17) {return _signIn4.apply(this, arguments);}return signIn;}() }]);return qe;}(Ee);var Ne = /*#__PURE__*/function () {function Ne(e) {_classCallCheck(this, Ne);this.config = e, this._cache = le(e.env), this._request = Ce(e.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), ge(we, this._onLoginTypeChanged);}_createClass(Ne, [{ key: "anonymousAuthProvider", value: function anonymousAuthProvider() {return new xe(this.config);} }, { key: "customAuthProvider", value: function customAuthProvider() {return new Le(this.config);} }, { key: "emailAuthProvider", value: function emailAuthProvider() {return new De(this.config);} }, { key: "usernameAuthProvider", value: function usernameAuthProvider() {return new qe(this.config);} }, { key: "signInAnonymously", value: function () {var _signInAnonymously = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee20() {return _regenerator.default.wrap(function _callee20$(_context20) {while (1) {switch (_context20.prev = _context20.next) {case 0:return _context20.abrupt("return", new xe(this.config).signIn());case 1:case "end":return _context20.stop();}}}, _callee20, this);}));function signInAnonymously() {return _signInAnonymously.apply(this, arguments);}return signInAnonymously;}() }, { key: "signInWithEmailAndPassword", value: function () {var _signInWithEmailAndPassword = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee21(e, t) {return _regenerator.default.wrap(function _callee21$(_context21) {while (1) {switch (_context21.prev = _context21.next) {case 0:return _context21.abrupt("return", new De(this.config).signIn(e, t));case 1:case "end":return _context21.stop();}}}, _callee21, this);}));function signInWithEmailAndPassword(_x18, _x19) {return _signInWithEmailAndPassword.apply(this, arguments);}return signInWithEmailAndPassword;}() }, { key: "signInWithUsernameAndPassword", value: function signInWithUsernameAndPassword(e, t) {return new qe(this.config).signIn(e, t);} }, { key: "linkAndRetrieveDataWithTicket", value: function () {var _linkAndRetrieveDataWithTicket2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee22(e) {return _regenerator.default.wrap(function _callee22$(_context22) {while (1) {switch (_context22.prev = _context22.next) {case 0:this._anonymousAuthProvider || (this._anonymousAuthProvider = new xe(this.config)), ge(ke, this._onAnonymousConverted);_context22.next = 3;return this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e);case 3:return _context22.abrupt("return", _context22.sent);case 4:case "end":return _context22.stop();}}}, _callee22, this);}));function linkAndRetrieveDataWithTicket(_x20) {return _linkAndRetrieveDataWithTicket2.apply(this, arguments);}return linkAndRetrieveDataWithTicket;}() }, { key: "signOut", value: function () {var _signOut = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee23() {var _this$_cache$keys10, e, t, n, s, o;return _regenerator.default.wrap(function _callee23$(_context23) {while (1) {switch (_context23.prev = _context23.next) {case 0:if (!(this.loginType === Se.ANONYMOUS)) {_context23.next = 2;break;}throw new M({ message: "匿名用户不支持登出操作" });case 2:_this$_cache$keys10 = this._cache.keys, e = _this$_cache$keys10.refreshTokenKey, t = _this$_cache$keys10.accessTokenKey, n = _this$_cache$keys10.accessTokenExpireKey, s = this._cache.getStore(e);if (s) {_context23.next = 5;break;}return _context23.abrupt("return");case 5:_context23.next = 7;return this._request.send("auth.logout", { refresh_token: s });case 7:o = _context23.sent;return _context23.abrupt("return", (this._cache.removeStore(e), this._cache.removeStore(t), this._cache.removeStore(n), pe(ye), pe(we, { env: this.config.env, loginType: Se.NULL, persistence: this.config.persistence }), o));case 9:case "end":return _context23.stop();}}}, _callee23, this);}));function signOut() {return _signOut.apply(this, arguments);}return signOut;}() }, { key: "signUpWithEmailAndPassword", value: function () {var _signUpWithEmailAndPassword = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee24(e, t) {return _regenerator.default.wrap(function _callee24$(_context24) {while (1) {switch (_context24.prev = _context24.next) {case 0:return _context24.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", { email: e, password: t }));case 1:case "end":return _context24.stop();}}}, _callee24, this);}));function signUpWithEmailAndPassword(_x21, _x22) {return _signUpWithEmailAndPassword.apply(this, arguments);}return signUpWithEmailAndPassword;}() }, { key: "sendPasswordResetEmail", value: function () {var _sendPasswordResetEmail = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee25(e) {return _regenerator.default.wrap(function _callee25$(_context25) {while (1) {switch (_context25.prev = _context25.next) {case 0:return _context25.abrupt("return", this._request.send("auth.sendPasswordResetEmail", { email: e }));case 1:case "end":return _context25.stop();}}}, _callee25, this);}));function sendPasswordResetEmail(_x23) {return _sendPasswordResetEmail.apply(this, arguments);}return sendPasswordResetEmail;}() }, { key: "onLoginStateChanged", value: function onLoginStateChanged(e) {var _this10 = this;ge(ye, function () {var t = _this10.hasLoginState();e.call(_this10, t);});var t = this.hasLoginState();e.call(this, t);} }, { key: "onLoginStateExpired", value: function onLoginStateExpired(e) {ge(_e, e.bind(this));} }, { key: "onAccessTokenRefreshed", value: function onAccessTokenRefreshed(e) {ge(Te, e.bind(this));} }, { key: "onAnonymousConverted", value: function onAnonymousConverted(e) {ge(ke, e.bind(this));} }, { key: "onLoginTypeChanged", value: function onLoginTypeChanged(e) {var _this11 = this;ge(we, function () {var t = _this11.hasLoginState();e.call(_this11, t);});} }, { key: "getAccessToken", value: function () {var _getAccessToken2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee26() {return _regenerator.default.wrap(function _callee26$(_context26) {while (1) {switch (_context26.prev = _context26.next) {case 0:_context26.next = 2;return this._request.getAccessToken();case 2:_context26.t0 = _context26.sent.accessToken;_context26.t1 = this.config.env;return _context26.abrupt("return", { accessToken: _context26.t0, env: _context26.t1 });case 5:case "end":return _context26.stop();}}}, _callee26, this);}));function getAccessToken() {return _getAccessToken2.apply(this, arguments);}return getAccessToken;}() }, { key: "hasLoginState", value: function hasLoginState() {var e = this._cache.keys.refreshTokenKey;return this._cache.getStore(e) ? new Ue(this.config.env) : null;} }, { key: "isUsernameRegistered", value: function () {var _isUsernameRegistered = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee27(e) {var _yield$this$_request$5, t;return _regenerator.default.wrap(function _callee27$(_context27) {while (1) {switch (_context27.prev = _context27.next) {case 0:if (!("string" != typeof e)) {_context27.next = 2;break;}throw new M({ code: "PARAM_ERROR", message: "username must be a string" });case 2:_context27.next = 4;return this._request.send("auth.isUsernameRegistered", { username: e });case 4:_yield$this$_request$5 = _context27.sent;t = _yield$this$_request$5.data;return _context27.abrupt("return", t && t.isRegistered);case 7:case "end":return _context27.stop();}}}, _callee27, this);}));function isUsernameRegistered(_x24) {return _isUsernameRegistered.apply(this, arguments);}return isUsernameRegistered;}() }, { key: "getLoginState", value: function getLoginState() {return Promise.resolve(this.hasLoginState());} }, { key: "signInWithTicket", value: function () {var _signInWithTicket = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee28(e) {return _regenerator.default.wrap(function _callee28$(_context28) {while (1) {switch (_context28.prev = _context28.next) {case 0:return _context28.abrupt("return", new Le(this.config).signIn(e));case 1:case "end":return _context28.stop();}}}, _callee28, this);}));function signInWithTicket(_x25) {return _signInWithTicket.apply(this, arguments);}return signInWithTicket;}() }, { key: "shouldRefreshAccessToken", value: function shouldRefreshAccessToken(e) {this._request._shouldRefreshAccessTokenHook = e.bind(this);} }, { key: "getUserInfo", value: function getUserInfo() {return this._request.send("auth.getUserInfo", {}).then(function (e) {return e.code ? e : _objectSpread(_objectSpread({}, e.data), {}, { requestId: e.seqId });});} }, { key: "getAuthHeader", value: function getAuthHeader() {var _this$_cache$keys11 = this._cache.keys,e = _this$_cache$keys11.refreshTokenKey,t = _this$_cache$keys11.accessTokenKey,n = this._cache.getStore(e);return { "x-cloudbase-credentials": this._cache.getStore(t) + "/@@/" + n };} }, { key: "_onAnonymousConverted", value: function _onAnonymousConverted(e) {var t = e.data.env;t === this.config.env && this._cache.updatePersistence(this.config.persistence);} }, { key: "_onLoginTypeChanged", value: function _onLoginTypeChanged(e) {var _e$data = e.data,t = _e$data.loginType,n = _e$data.persistence,s = _e$data.env;s === this.config.env && (this._cache.updatePersistence(n), this._cache.setStore(this._cache.keys.loginTypeKey, t));} }, { key: "currentUser", get: function get() {var e = this.hasLoginState();return e && e.user || null;} }, { key: "loginType", get: function get() {return this._cache.getStore(this._cache.keys.loginTypeKey);} }]);return Ne;}();var Fe = function Fe(e, t) {t = t || Q();var n = Ce(this.config.env),s = e.cloudPath,o = e.filePath,r = e.onUploadProgress,_e$fileType = e.fileType,i = _e$fileType === void 0 ? "image" : _e$fileType;return n.send("storage.getUploadMetadata", { path: s }).then(function (e) {var _e$data2 = e.data,a = _e$data2.url,c = _e$data2.authorization,u = _e$data2.token,l = _e$data2.fileId,h = _e$data2.cosFileId,d = e.requestId,f = { key: s, signature: c, "x-cos-meta-fileid": h, success_action_status: "201", "x-cos-security-token": u };n.upload({ url: a, data: f, file: o, name: s, fileType: i, onUploadProgress: r }).then(function (e) {201 === e.statusCode ? t(null, { fileID: l, requestId: d }) : t(new M({ code: "STORAGE_REQUEST_FAIL", message: "STORAGE_REQUEST_FAIL: ".concat(e.data) }));}).catch(function (e) {t(e);});}).catch(function (e) {t(e);}), t.promise;},Me = function Me(e, t) {t = t || Q();var n = Ce(this.config.env),s = e.cloudPath;return n.send("storage.getUploadMetadata", { path: s }).then(function (e) {t(null, e);}).catch(function (e) {t(e);}), t.promise;},je = function je(_ref5, t) {var e = _ref5.fileList;if (t = t || Q(), !e || !Array.isArray(e)) return { code: "INVALID_PARAM", message: "fileList必须是非空的数组" };var _iterator3 = _createForOfIteratorHelper(e),_step3;try {for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {var _t7 = _step3.value;if (!_t7 || "string" != typeof _t7) return { code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" };}} catch (err) {_iterator3.e(err);} finally {_iterator3.f();}var n = { fileid_list: e };return Ce(this.config.env).send("storage.batchDeleteFile", n).then(function (e) {e.code ? t(null, e) : t(null, { fileList: e.data.delete_list, requestId: e.requestId });}).catch(function (e) {t(e);}), t.promise;},$e = function $e(_ref6, t) {var e = _ref6.fileList;t = t || Q(), e && Array.isArray(e) || t(null, { code: "INVALID_PARAM", message: "fileList必须是非空的数组" });var n = [];var _iterator4 = _createForOfIteratorHelper(e),_step4;try {for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {var _s7 = _step4.value;"object" == typeof _s7 ? (_s7.hasOwnProperty("fileID") && _s7.hasOwnProperty("maxAge") || t(null, { code: "INVALID_PARAM", message: "fileList的元素必须是包含fileID和maxAge的对象" }), n.push({ fileid: _s7.fileID, max_age: _s7.maxAge })) : "string" == typeof _s7 ? n.push({ fileid: _s7 }) : t(null, { code: "INVALID_PARAM", message: "fileList的元素必须是字符串" });}} catch (err) {_iterator4.e(err);} finally {_iterator4.f();}var s = { file_list: n };return Ce(this.config.env).send("storage.batchGetDownloadUrl", s).then(function (e) {e.code ? t(null, e) : t(null, { fileList: e.data.download_list, requestId: e.requestId });}).catch(function (e) {t(e);}), t.promise;},Ke = /*#__PURE__*/function () {var _ref8 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee29(_ref7, t) {var e, n, s, o;return _regenerator.default.wrap(function _callee29$(_context29) {while (1) {switch (_context29.prev = _context29.next) {case 0:e = _ref7.fileID;_context29.next = 3;return $e.call(this, { fileList: [{ fileID: e, maxAge: 600 }] });case 3:n = _context29.sent.fileList[0];if (!("SUCCESS" !== n.code)) {_context29.next = 6;break;}return _context29.abrupt("return", t ? t(n) : new Promise(function (e) {e(n);}));case 6:s = Ce(this.config.env);o = n.download_url;if (!(o = encodeURI(o), !t)) {_context29.next = 10;break;}return _context29.abrupt("return", s.download({ url: o }));case 10:_context29.t0 = t;_context29.next = 13;return s.download({ url: o });case 13:_context29.t1 = _context29.sent;(0, _context29.t0)(_context29.t1);case 15:case "end":return _context29.stop();}}}, _callee29, this);}));return function Ke(_x26, _x27) {return _ref8.apply(this, arguments);};}(),Be = function Be(_ref9, r) {var e = _ref9.name,t = _ref9.data,n = _ref9.query,s = _ref9.parse,o = _ref9.search;var i = r || Q();var a;try {a = t ? JSON.stringify(t) : "";} catch (e) {return Promise.reject(e);}if (!e) return Promise.reject(new M({ code: "PARAM_ERROR", message: "函数名不能为空" }));var c = { inQuery: n, parse: s, search: o, function_name: e, request_data: a };return Ce(this.config.env).send("functions.invokeFunction", c).then(function (e) {if (e.code) i(null, e);else {var _t8 = e.data.response_data;if (s) i(null, { result: _t8, requestId: e.requestId });else try {_t8 = JSON.parse(e.data.response_data), i(null, { result: _t8, requestId: e.requestId });} catch (e) {i(new M({ message: "response data must be json" }));}}return i.promise;}).catch(function (e) {i(e);}), i.promise;},He = { timeout: 15e3, persistence: "session" },We = {};var ze = /*#__PURE__*/function () {function ze(e) {_classCallCheck(this, ze);this.config = e || this.config, this.authObj = void 0;}_createClass(ze, [{ key: "init", value: function init(e) {switch (se.adapter || (this.requestClient = new se.adapter.reqClass({ timeout: e.timeout || 5e3, timeoutMsg: "\u8BF7\u6C42\u5728".concat((e.timeout || 5e3) / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD") })), this.config = _objectSpread(_objectSpread({}, He), e), !0) {case this.config.timeout > 6e5:console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;break;case this.config.timeout < 100:console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;}return new ze(this.config);} }, { key: "auth", value: function auth() {var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref10.persistence;if (this.authObj) return this.authObj;var t = e || se.adapter.primaryStorage || He.persistence;var n;return t !== this.config.persistence && (this.config.persistence = t), function (e) {var t = e.env;ce[t] = new ae(e), ue[t] = new ae(_objectSpread(_objectSpread({}, e), {}, { persistence: "local" }));}(this.config), n = this.config, Oe[n.env] = new be(n), this.authObj = new Ne(this.config), this.authObj;} }, { key: "on", value: function on(e, t) {return ge.apply(this, [e, t]);} }, { key: "off", value: function off(e, t) {return me.apply(this, [e, t]);} }, { key: "callFunction", value: function callFunction(e, t) {return Be.apply(this, [e, t]);} }, { key: "deleteFile", value: function deleteFile(e, t) {return je.apply(this, [e, t]);} }, { key: "getTempFileURL", value: function getTempFileURL(e, t) {return $e.apply(this, [e, t]);} }, { key: "downloadFile", value: function downloadFile(e, t) {return Ke.apply(this, [e, t]);} }, { key: "uploadFile", value: function uploadFile(e, t) {return Fe.apply(this, [e, t]);} }, { key: "getUploadMetadata", value: function getUploadMetadata(e, t) {return Me.apply(this, [e, t]);} }, { key: "registerExtension", value: function registerExtension(e) {We[e.name] = e;} }, { key: "invokeExtension", value: function () {var _invokeExtension = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee30(e, t) {var n;return _regenerator.default.wrap(function _callee30$(_context30) {while (1) {switch (_context30.prev = _context30.next) {case 0:n = We[e];if (n) {_context30.next = 3;break;}throw new M({ message: "\u6269\u5C55".concat(e, " \u5FC5\u987B\u5148\u6CE8\u518C") });case 3:_context30.next = 5;return n.invoke(t, this);case 5:return _context30.abrupt("return", _context30.sent);case 6:case "end":return _context30.stop();}}}, _callee30, this);}));function invokeExtension(_x28, _x29) {return _invokeExtension.apply(this, arguments);}return invokeExtension;}() }, { key: "useAdapters", value: function useAdapters(e) {var _ref11 = ne(e) || {},t = _ref11.adapter,n = _ref11.runtime;t && (se.adapter = t), n && (se.runtime = n);} }]);return ze;}();var Ve = new ze();function Je(e, t, n) {void 0 === n && (n = {});var s = /\?/.test(t),o = "";for (var r in n) {"" === o ? !s && (t += "?") : o += "&", o += r + "=" + encodeURIComponent(n[r]);}return /^http(s)?:\/\//.test(t += o) ? t : "" + e + t;}var Ye = /*#__PURE__*/function () {function Ye() {_classCallCheck(this, Ye);}_createClass(Ye, [{ key: "post", value: function post(e) {var t = e.url,n = e.data,s = e.headers;return new Promise(function (e, o) {H.request({ url: Je("https:", t), data: n, method: "POST", header: s, success: function success(t) {e(t);}, fail: function fail(e) {o(e);} });});} }, { key: "upload", value: function upload(e) {return new Promise(function (t, n) {var s = e.url,o = e.file,r = e.data,i = e.headers,a = e.fileType,c = H.uploadFile({ url: Je("https:", s), name: "file", formData: Object.assign({}, r), filePath: o, fileType: a, header: i, success: function success(e) {var n = { statusCode: e.statusCode, data: e.data || {} };200 === e.statusCode && r.success_action_status && (n.statusCode = parseInt(r.success_action_status, 10)), t(n);}, fail: function fail(e) {d && "mp-alipay" === g && console.warn("支付宝小程序开发工具上传腾讯云时无法准确判断是否上传成功,请使用真机测试"), n(new Error(e.errMsg || "uploadFile:fail"));} });"function" == typeof e.onUploadProgress && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (t) {e.onUploadProgress({ loaded: t.totalBytesSent, total: t.totalBytesExpectedToSend });});});} }]);return Ye;}();var Xe = { setItem: function setItem(e, t) {H.setStorageSync(e, t);}, getItem: function getItem(e) {return H.getStorageSync(e);}, removeItem: function removeItem(e) {H.removeStorageSync(e);}, clear: function clear() {H.clearStorageSync();} };var Ge = { genAdapter: function genAdapter() {return { root: {}, reqClass: Ye, localStorage: Xe, primaryStorage: "local" };}, isMatch: function isMatch() {return !0;}, runtime: "uni_app" };Ve.useAdapters(Ge);var Qe = Ve,Ze = Qe.init;Qe.init = function (e) {e.env = e.spaceId;var t = Ze.call(this, e);t.config.provider = "tencent", t.config.spaceId = e.spaceId;var n = t.auth;return t.auth = function (e) {var t = n.call(this, e);return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach(function (e) {t[e] = F(t[e]).bind(t);}), t;}, t.customAuth = t.auth, t;};var et = Qe;function tt() {return { token: H.getStorageSync("uni_id_token") || H.getStorageSync("uniIdToken"), tokenExpired: H.getStorageSync("uni_id_token_expired") };}function nt() {var _ref12 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref12.token,t = _ref12.tokenExpired;e && H.setStorageSync("uni_id_token", e), t && H.setStorageSync("uni_id_token_expired", t);}function st() {if (!d || "web" !== g) return;uni.getStorageSync("__LAST_DCLOUD_APPID") !== _ && (uni.setStorageSync("__LAST_DCLOUD_APPID", _), console.warn("检测到当前项目与上次运行到此端口的项目不一致,自动清理uni-id保存的token信息(仅开发调试时生效)"), H.removeStorageSync("uni_id_token"), H.removeStorageSync("uniIdToken"), H.removeStorageSync("uni_id_token_expired"));}var ot = /*#__PURE__*/function (_V) {_inherits(ot, _V);var _super8 = _createSuper(ot);function ot() {_classCallCheck(this, ot);return _super8.apply(this, arguments);}_createClass(ot, [{ key: "getAccessToken", value: function getAccessToken() {var _this12 = this;return new Promise(function (e, t) {var n = "Anonymous_Access_token";_this12.setAccessToken(n), e(n);});} }, { key: "setupRequest", value: function setupRequest(e, t) {var n = Object.assign({}, e, { spaceId: this.config.spaceId, timestamp: Date.now() }),s = { "Content-Type": "application/json" };"auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = B.sign(n, this.config.clientSecret);var o = K();s["x-client-info"] = JSON.stringify(o);var _tt = tt(),r = _tt.token;return s["x-client-token"] = r, { url: this.config.requestUrl, method: "POST", data: n, dataType: "json", header: JSON.parse(JSON.stringify(s)) };} }, { key: "uploadFileToOSS", value: function uploadFileToOSS(_ref13) {var _this13 = this;var e = _ref13.url,t = _ref13.formData,n = _ref13.name,s = _ref13.filePath,o = _ref13.fileType,r = _ref13.onUploadProgress;return new Promise(function (i, a) {var c = _this13.adapter.uploadFile({ url: e, formData: t, name: n, filePath: s, fileType: o, success: function success(e) {e && e.statusCode < 400 ? i(e) : a(new M({ code: "UPLOAD_FAILED", message: "文件上传失败" }));}, fail: function fail(e) {a(new M({ code: e.code || "UPLOAD_FAILED", message: e.message || e.errMsg || "文件上传失败" }));} });"function" == typeof r && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {r({ loaded: e.totalBytesSent, total: e.totalBytesExpectedToSend });});});} }, { key: "uploadFile", value: function uploadFile(_ref14) {var _this14 = this;var e = _ref14.filePath,t = _ref14.cloudPath,_ref14$fileType = _ref14.fileType,n = _ref14$fileType === void 0 ? "image" : _ref14$fileType,s = _ref14.onUploadProgress;if (!t) throw new M({ code: "CLOUDPATH_REQUIRED", message: "cloudPath不可为空" });var o;return this.getOSSUploadOptionsFromPath({ cloudPath: t }).then(function (t) {var _t$result = t.result,r = _t$result.url,i = _t$result.formData,a = _t$result.name;o = t.result.fileUrl;var c = { url: r, formData: i, name: a, filePath: e, fileType: n };return _this14.uploadFileToOSS(Object.assign({}, c, { onUploadProgress: s }));}).then(function () {return _this14.reportOSSUpload({ cloudPath: t });}).then(function (t) {return new Promise(function (n, s) {t.success ? n({ success: !0, filePath: e, fileID: o }) : s(new M({ code: "UPLOAD_FAILED", message: "文件上传失败" }));});});} }, { key: "deleteFile", value: function deleteFile(_ref15) {var e = _ref15.fileList;var t = { method: "serverless.file.resource.delete", params: JSON.stringify({ fileList: e }) };return this.request(this.setupRequest(t));} }, { key: "getTempFileURL", value: function getTempFileURL() {var _ref16 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref16.fileList;var t = { method: "serverless.file.resource.getTempFileURL", params: JSON.stringify({ fileList: e }) };return this.request(this.setupRequest(t));} }]);return ot;}(V);var rt = { init: function init(e) {var t = new ot(e),n = { signInAnonymously: function signInAnonymously() {return t.authorize();}, getLoginState: function getLoginState() {return Promise.resolve(!1);} };return t.auth = function () {return n;}, t.customAuth = t.auth, t;} };function it(_ref17) {var e = _ref17.data;var t;t = K();var n = JSON.parse(JSON.stringify(e || {}));if (Object.assign(n, { clientInfo: t }), !n.uniIdToken) {var _tt2 = tt(),_e19 = _tt2.token;_e19 && (n.uniIdToken = _e19);}return n;}function at(_ref18) {var _this15 = this;var e = _ref18.name,t = _ref18.data;var n = this.localAddress,s = this.localPort,o = { aliyun: "aliyun", tencent: "tcb" }[this.config.provider],r = this.config.spaceId,i = "http://".concat(n, ":").concat(s, "/system/check-function"),a = "http://".concat(n, ":").concat(s, "/cloudfunctions/").concat(e);return new Promise(function (t, n) {H.request({ method: "POST", url: i, data: { name: e, platform: g, provider: o, spaceId: r }, timeout: 3e3, success: function success(e) {t(e);}, fail: function fail() {t({ data: { code: "NETWORK_ERROR", message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。" } });} });}).then(function () {var _ref19 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref19.data;var _ref20 = e || {},t = _ref20.code,n = _ref20.message;return { code: 0 === t ? 0 : t || "SYS_ERR", message: n || "SYS_ERR" };}).then(function (_ref21) {var n = _ref21.code,s = _ref21.message;if (0 !== n) {switch (n) {case "MODULE_ENCRYPTED":console.error("\u6B64\u4E91\u51FD\u6570\uFF08".concat(e, "\uFF09\u4F9D\u8D56\u52A0\u5BC6\u516C\u5171\u6A21\u5757\u4E0D\u53EF\u672C\u5730\u8C03\u8BD5\uFF0C\u81EA\u52A8\u5207\u6362\u4E3A\u4E91\u7AEF\u5DF2\u90E8\u7F72\u7684\u4E91\u51FD\u6570"));break;case "FUNCTION_ENCRYPTED":console.error("\u6B64\u4E91\u51FD\u6570\uFF08".concat(e, "\uFF09\u5DF2\u52A0\u5BC6\u4E0D\u53EF\u672C\u5730\u8C03\u8BD5\uFF0C\u81EA\u52A8\u5207\u6362\u4E3A\u4E91\u7AEF\u5DF2\u90E8\u7F72\u7684\u4E91\u51FD\u6570"));break;case "ACTION_ENCRYPTED":console.error(s || "需要访问加密的uni-clientDB-action,自动切换为云端环境");break;case "NETWORK_ERROR":{var _e20 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";throw console.error(_e20), new Error(_e20);}case "SWITCH_TO_CLOUD":break;default:{var _e21 = "\u68C0\u6D4B\u672C\u5730\u8C03\u8BD5\u670D\u52A1\u51FA\u73B0\u9519\u8BEF\uFF1A".concat(s, "\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u73AF\u5883\u6216\u91CD\u542F\u5BA2\u6237\u7AEF\u518D\u8BD5");throw console.error(_e21), new Error(_e21);}}return _this15._originCallFunction({ name: e, data: t });}return new Promise(function (e, n) {var s = it.call(_this15, { data: t });H.request({ method: "POST", url: a, data: { provider: o, platform: g, param: s }, success: function success() {var _ref22 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},t = _ref22.statusCode,s = _ref22.data;return !t || t >= 400 ? n(new M({ code: s.code || "SYS_ERR", message: s.message || "request:fail" })) : e({ result: s });}, fail: function fail(e) {n(new M({ code: e.code || e.errCode || "SYS_ERR", message: e.message || e.errMsg || "request:fail" }));} });});});}var ct = [{ rule: /fc_function_not_found|FUNCTION_NOT_FOUND/, content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间", mode: "append" }];var ut = /[\\^$.*+?()[\]{}|]/g,lt = RegExp(ut.source);function ht(e, t, n) {return e.replace(new RegExp((s = t) && lt.test(s) ? s.replace(ut, "\\$&") : s, "g"), n);var s;}function dt(_ref23) {var e = _ref23.functionName,t = _ref23.result,n = _ref23.logPvd;if (this.config.debugLog && t && t.requestId) {var _s8 = JSON.stringify({ spaceId: this.config.spaceId, functionName: e, requestId: t.requestId });console.log("[".concat(n, "-request]").concat(_s8, "[/").concat(n, "-request]"));}}function ft(e) {var t = e.callFunction,n = function n(_n5) {var _this16 = this;var s = _n5.name;_n5.data = it.call(e, { data: _n5.data });var o = { aliyun: "aliyun", tencent: "tcb", tcb: "tcb" }[this.config.provider];return t.call(this, _n5).then(function (e) {return e.errCode = 0, dt.call(_this16, { functionName: s, result: e, logPvd: o }), Promise.resolve(e);}, function (e) {return dt.call(_this16, { functionName: s, result: e, logPvd: o }), e && e.message && (e.message = function () {var _ref24 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},_ref24$message = _ref24.message,e = _ref24$message === void 0 ? "" : _ref24$message,_ref24$extraInfo = _ref24.extraInfo,t = _ref24$extraInfo === void 0 ? {} : _ref24$extraInfo,_ref24$formatter = _ref24.formatter,n = _ref24$formatter === void 0 ? [] : _ref24$formatter;for (var _s9 = 0; _s9 < n.length; _s9++) {var _n$_s = n[_s9],_o3 = _n$_s.rule,_r2 = _n$_s.content,i = _n$_s.mode,_a = e.match(_o3);if (!_a) continue;var _c = _r2;for (var _e22 = 1; _e22 < _a.length; _e22++) {_c = ht(_c, "{$".concat(_e22, "}"), _a[_e22]);}for (var _e23 in t) {_c = ht(_c, "{".concat(_e23, "}"), t[_e23]);}return "replace" === i ? _c : e + _c;}return e;}({ message: "[".concat(_n5.name, "]: ").concat(e.message), formatter: ct, extraInfo: { functionName: s } })), Promise.reject(e);});};e.callFunction = function (t) {var s;return d && e.debugInfo && !e.debugInfo.forceRemote && m ? (e._originCallFunction || (e._originCallFunction = n), s = at.call(this, t)) : s = n.call(this, t), Object.defineProperty(s, "result", { get: function get() {return console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {};} }), s;};}var gt = Symbol("CLIENT_DB_INTERNAL");function pt(e, t) {return e.then = "DoNotReturnProxyWithAFunctionNamedThen", e._internalType = gt, e.__ob__ = void 0, new Proxy(e, { get: function get(e, n, s) {if ("_uniClient" === n) return null;if (n in e || "string" != typeof n) {var _t9 = e[n];return "function" == typeof _t9 ? _t9.bind(e) : _t9;}return t.get(e, n, s);} });}function mt(e) {return { on: function on(t, n) {e[t] = e[t] || [], e[t].indexOf(n) > -1 || e[t].push(n);}, off: function off(t, n) {e[t] = e[t] || [];var s = e[t].indexOf(n);-1 !== s && e[t].splice(s, 1);} };}var yt = ["db.Geo", "db.command", "command.aggregate"];function _t(e, t) {return yt.indexOf("".concat(e, ".").concat(t)) > -1;}function wt(e) {switch (u(e)) {case "array":return e.map(function (e) {return wt(e);});case "object":return e._internalType === gt || Object.keys(e).forEach(function (t) {e[t] = wt(e[t]);}), e;case "regexp":return { $regexp: { source: e.source, flags: e.flags } };case "date":return { $date: e.toISOString() };default:return e;}}var kt = /*#__PURE__*/function () {function kt(e, t, n) {_classCallCheck(this, kt);this.content = e, this.prevStage = t || null, this.udb = null, this._database = n;}_createClass(kt, [{ key: "toJSON", value: function toJSON() {var e = this;var t = [e.content];for (; e.prevStage;) {e = e.prevStage, t.push(e.content);}return { $db: t.reverse().map(function (e) {return { $method: e.$method, $param: wt(e.$param) };}) };} }, { key: "getAction", value: function getAction() {var e = this.toJSON().$db.find(function (e) {return "action" === e.$method;});return e && e.$param && e.$param[0];} }, { key: "getCommand", value: function getCommand() {return { $db: this.toJSON().$db.filter(function (e) {return "action" !== e.$method;}) };} }, { key: "get", value: function get() {return this._send("get", Array.from(arguments));} }, { key: "add", value: function add() {return this._send("add", Array.from(arguments));} }, { key: "remove", value: function remove() {return this._send("remove", Array.from(arguments));} }, { key: "update", value: function update() {return this._send("update", Array.from(arguments));} }, { key: "end", value: function end() {return this._send("end", Array.from(arguments));} }, { key: "set", value: function set() {throw new Error("clientDB禁止使用set方法");} }, { key: "_send", value: function _send(e, t) {var n = this.getAction(),s = this.getCommand();if (s.$db.push({ $method: e, $param: wt(t) }), d) {var _e24 = s.$db.find(function (e) {return "collection" === e.$method;}),_t10 = _e24 && _e24.$param;_t10 && 1 === _t10.length && "string" == typeof _e24.$param[0] && _e24.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");}return this._database._callCloudFunction({ action: n, command: s });} }, { key: "useAggregate", get: function get() {var e = this,t = !1;for (; e.prevStage;) {e = e.prevStage;var _n6 = e.content.$method;if ("aggregate" === _n6 || "pipeline" === _n6) {t = !0;break;}}return t;} }, { key: "count", get: function get() {if (!this.useAggregate) return function () {return this._send("count", Array.from(arguments));};var e = this;return function () {return Tt({ $method: "count", $param: wt(Array.from(arguments)) }, e, this._database);};} }]);return kt;}();function Tt(e, t, n) {return pt(new kt(e, t, n), { get: function get(e, t) {var s = "db";return e && e.content && (s = e.content.$method), _t(s, t) ? Tt({ $method: t }, e, n) : function () {return Tt({ $method: t, $param: wt(Array.from(arguments)) }, e, n);};} });}function St(_ref25) {var e = _ref25.path,t = _ref25.method;return /*#__PURE__*/function () {function _class2() {_classCallCheck(this, _class2);this.param = Array.from(arguments);}_createClass(_class2, [{ key: "toJSON", value: function toJSON() {return { $newDb: [].concat(_toConsumableArray(e.map(function (e) {return { $method: e };})), [{ $method: t, $param: this.param }]) };} }]);return _class2;}();}var vt = /*#__PURE__*/function (_ref26) {_inherits(vt, _ref26);var _super9 = _createSuper(vt);function vt() {_classCallCheck(this, vt);return _super9.apply(this, arguments);}_createClass(vt, [{ key: "_callCloudFunction", value: function _callCloudFunction(_ref27) {var _this17 = this;var e = _ref27.action,t = _ref27.command,n = _ref27.multiCommand,s = _ref27.queryList;function o(e, t) {if (n && s) for (var _n7 = 0; _n7 < s.length; _n7++) {var _o4 = s[_n7];_o4.udb && "function" == typeof _o4.udb.setResult && (t ? _o4.udb.setResult(t) : _o4.udb.setResult(e.result.dataList[_n7]));}}var r = this;function i(e) {return r._callback("error", [e]), A(I("database", "fail"), e).then(function () {return A(I("database", "complete"), e);}).then(function () {return o(null, e), N(O, { type: R, content: e }), Promise.reject(e);});}var a = A(I("database", "invoke")),u = this._uniClient;return a.then(function () {return u.callFunction({ name: "DCloud-clientDB", type: c, data: { action: e, command: t, multiCommand: n } });}).then(function (e) {var _e$result = e.result,t = _e$result.code,n = _e$result.message,s = _e$result.token,r = _e$result.tokenExpired,_e$result$systemInfo = _e$result.systemInfo,a = _e$result$systemInfo === void 0 ? [] : _e$result$systemInfo;if (a) for (var _e25 = 0; _e25 < a.length; _e25++) {var _a$_e = a[_e25],_t11 = _a$_e.level,_n8 = _a$_e.message,_s10 = _a$_e.detail,_o5 = console["app" === g && "warn" === _t11 ? "error" : _t11] || console.log;var _r3 = "[System Info]" + _n8;_s10 && (_r3 = "".concat(_r3, "\n\u8BE6\u7EC6\u4FE1\u606F\uFF1A").concat(_s10)), _o5(_r3);}if (t) {return i(new M({ code: t, message: n, requestId: e.requestId }));}e.result.errCode = e.result.code, e.result.errMsg = e.result.message, s && r && (nt({ token: s, tokenExpired: r }), _this17._callbackAuth("refreshToken", [{ token: s, tokenExpired: r }]), _this17._callback("refreshToken", [{ token: s, tokenExpired: r }]), N(E, { token: s, tokenExpired: r }));var c = [{ prop: "affectedDocs", tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代" }, { prop: "code", tips: "code不再推荐使用,请使用errCode替代" }, { prop: "message", tips: "message不再推荐使用,请使用errMsg替代" }];var _loop = function _loop(_t12) {var _c$_t = c[_t12],n = _c$_t.prop,s = _c$_t.tips;if (n in e.result) {var _t13 = e.result[n];Object.defineProperty(e.result, n, { get: function get() {return console.warn(s), _t13;} });}};for (var _t12 = 0; _t12 < c.length; _t12++) {_loop(_t12);}return function (e) {return A(I("database", "success"), e).then(function () {return A(I("database", "complete"), e);}).then(function () {return o(e, null), N(O, { type: R, content: e }), Promise.resolve(e);});}(e);}, function (e) {/fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");return i(new M({ code: e.code || "SYSTEM_ERROR", message: e.message, requestId: e.requestId }));});} }]);return vt;}( /*#__PURE__*/function () {function _class3() {var _ref28 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},_ref28$uniClient = _ref28.uniClient,e = _ref28$uniClient === void 0 ? {} : _ref28$uniClient;_classCallCheck(this, _class3);this._uniClient = e, this._authCallBacks = {}, this._dbCallBacks = {}, e.isDefault && (this._dbCallBacks = k("_globalUniCloudDatabaseCallback")), this.auth = mt(this._authCallBacks), Object.assign(this, mt(this._dbCallBacks)), this.env = pt({}, { get: function get(e, t) {return { $env: t };} }), this.Geo = pt({}, { get: function get(e, t) {return St({ path: ["Geo"], method: t });} }), this.serverDate = St({ path: [], method: "serverDate" }), this.RegExp = St({ path: [], method: "RegExp" });}_createClass(_class3, [{ key: "getCloudEnv", value: function getCloudEnv(e) {if ("string" != typeof e || !e.trim()) throw new Error("getCloudEnv参数错误");return { $env: e.replace("$cloudEnv_", "") };} }, { key: "_callback", value: function _callback(e, t) {var n = this._dbCallBacks;n[e] && n[e].forEach(function (e) {e.apply(void 0, _toConsumableArray(t));});} }, { key: "_callbackAuth", value: function _callbackAuth(e, t) {var n = this._authCallBacks;n[e] && n[e].forEach(function (e) {e.apply(void 0, _toConsumableArray(t));});} }, { key: "multiSend", value: function multiSend() {var e = Array.from(arguments),t = e.map(function (e) {var t = e.getAction(),n = e.getCommand();if ("getTemp" !== n.$db[n.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp");return { action: t, command: n };});return this._callCloudFunction({ multiCommand: t, queryList: e });} }]);return _class3;}());function Pt(e) {e.database = function (t) {if (t && Object.keys(t).length > 0) return e.init(t).database();if (this._database) return this._database;var n = function (e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};return pt(new e(t), { get: function get(e, t) {return _t("db", t) ? Tt({ $method: t }, null, e) : function () {return Tt({ $method: t, $param: wt(Array.from(arguments)) }, null, e);};} });}(vt, { uniClient: e });return this._database = n, n;};}var At = "token无效,跳转登录页面",It = "token过期,跳转登录页面",bt = { TOKEN_INVALID_TOKEN_EXPIRED: It, TOKEN_INVALID_INVALID_CLIENTID: At, TOKEN_INVALID: At, TOKEN_INVALID_WRONG_TOKEN: At, TOKEN_INVALID_ANONYMOUS_USER: At },Ot = { "uni-id-token-expired": It, "uni-id-check-token-failed": At, "uni-id-token-not-exist": At, "uni-id-check-device-feature-failed": At };function Ct(e, t) {var n = "";return n = e ? "".concat(e, "/").concat(t) : t, n.replace(/^\//, "");}function Et() {var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";var n = [],s = [];return e.forEach(function (e) {!0 === e.needLogin ? n.push(Ct(t, e.path)) : !1 === e.needLogin && s.push(Ct(t, e.path));}), { needLoginPage: n, notNeedLoginPage: s };}function Rt() {var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};if (!e) return !1;if (!(t && t.list && t.list.length)) return !1;var n = t.list,s = e.split("?")[0].replace(/^\//, "");return n.some(function (e) {return e.pagePath === s;});}var Ut = !!_pages.default.uniIdRouter;var _ref29 = function () {var _ref30 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pages.default,_ref30$pages = _ref30.pages,e = _ref30$pages === void 0 ? [] : _ref30$pages,_ref30$subPackages = _ref30.subPackages,n = _ref30$subPackages === void 0 ? [] : _ref30$subPackages,_ref30$uniIdRouter = _ref30.uniIdRouter,s = _ref30$uniIdRouter === void 0 ? {} : _ref30$uniIdRouter,_ref30$tabBar = _ref30.tabBar,o = _ref30$tabBar === void 0 ? {} : _ref30$tabBar;var r = s.loginPage,_s$needLogin = s.needLogin,i = _s$needLogin === void 0 ? [] : _s$needLogin,_s$resToLogin = s.resToLogin,a = _s$resToLogin === void 0 ? !0 : _s$resToLogin,_Et = Et(e),c = _Et.needLoginPage,u = _Et.notNeedLoginPage,_ref31 = function () {var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];var t = [],n = [];return e.forEach(function (e) {var s = e.root,_e$pages = e.pages,o = _e$pages === void 0 ? [] : _e$pages,_Et2 = Et(o, s),r = _Et2.needLoginPage,i = _Et2.notNeedLoginPage;t.push.apply(t, _toConsumableArray(r)), n.push.apply(n, _toConsumableArray(i));}), { needLoginPage: t, notNeedLoginPage: n };}(n),l = _ref31.needLoginPage,h = _ref31.notNeedLoginPage;return { loginPage: r, routerNeedLogin: i, resToLogin: a, needLoginPage: [].concat(_toConsumableArray(c), _toConsumableArray(l)), notNeedLoginPage: [].concat(_toConsumableArray(u), _toConsumableArray(h)), loginPageInTabBar: Rt(r, o) };}(),xt = _ref29.loginPage,Lt = _ref29.routerNeedLogin,Dt = _ref29.resToLogin,qt = _ref29.needLoginPage,Nt = _ref29.notNeedLoginPage,Ft = _ref29.loginPageInTabBar;function Mt(e) {var t = function (e) {var t = getCurrentPages(),n = t[t.length - 1].route,s = e.charAt(0),o = e.split("?")[0];if ("/" === s) return o;var r = o.replace(/^\//, "").split("/"),i = n.split("/");i.pop();for (var _e26 = 0; _e26 < r.length; _e26++) {var _t14 = r[_e26];".." === _t14 ? i.pop() : "." !== _t14 && i.push(_t14);}return "" === i[0] && i.shift(), i.join("/");}(e).replace(/^\//, "");return !(Nt.indexOf(t) > -1) && (qt.indexOf(t) > -1 || Lt.some(function (t) {return function (e, t) {return new RegExp(t).test(e);}(e, t);}));}function jt(e, t) {return "/" !== e.charAt(0) && (e = "/" + e), t ? e.indexOf("?") > -1 ? e + "&uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e + "?uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e;}function $t() {var e = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];var _loop2 = function _loop2(_t15) {var n = e[_t15];uni.addInterceptor(n, { invoke: function invoke(e) {var _tt3 = tt(),t = _tt3.token,s = _tt3.tokenExpired;var o;if (t) {if (s < Date.now()) {var _e27 = "uni-id-token-expired";o = { errCode: _e27, errMsg: Ot[_e27] };}} else {var _e28 = "uni-id-check-token-failed";o = { errCode: _e28, errMsg: Ot[_e28] };}if (Mt(e.url) && o) {o.uniIdRedirectUrl = e.url;if (L(C).length > 0) return setTimeout(function () {N(C, o);}, 0), e.url = "", !1;if (!xt) return e;var _t16 = jt(xt, o.uniIdRedirectUrl);if (Ft) {if ("navigateTo" === n || "redirectTo" === n) return setTimeout(function () {uni.switchTab({ url: _t16 });}), !1;} else if ("switchTab" === n) return setTimeout(function () {uni.navigateTo({ url: _t16 });}), !1;e.url = _t16;}return e;} });};for (var _t15 = 0; _t15 < e.length; _t15++) {_loop2(_t15);}}function Kt() {this.onResponse(function (e) {var t = e.type,n = e.content;var s = !1;switch (t) {case "cloudobject":s = function (e) {var t = e.errCode;return t in Ot;}(n);break;case "clientdb":s = function (e) {var t = e.errCode;return t in bt;}(n);}s && function () {var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var t = L(C),n = getCurrentPages(),s = n[n.length - 1],o = s && s.$page && s.$page.fullPath;if (t.length > 0) return N(C, Object.assign({ uniIdRedirectUrl: o }, e));xt && uni.navigateTo({ url: jt(xt, o) });}(n);});}function Bt(e) {e.onNeedLogin = function (e) {D(C, e);}, e.offNeedLogin = function (e) {q(C, e);}, Ut && (k("uni-cloud-status").needLoginInit || (k("uni-cloud-status").needLoginInit = !0, function t() {var n = getCurrentPages();n && n[0] ? $t.call(e) : setTimeout(function () {t();}, 30);}(), Dt && Kt.call(e)));}function Ht(e) {!function (e) {e.onResponse = function (e) {D(O, e);}, e.offResponse = function (e) {q(O, e);};}(e), Bt(e), function (e) {e.onRefreshToken = function (e) {D(E, e);}, e.offRefreshToken = function (e) {q(E, e);};}(e);}var Wt;var zt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Vt = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function Jt() {var e = tt().token || "",t = e.split(".");if (!e || 3 !== t.length) return { uid: null, role: [], permission: [], tokenExpired: 0 };var n;try {n = JSON.parse((s = t[1], decodeURIComponent(Wt(s).split("").map(function (e) {return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);}).join(""))));} catch (e) {throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message);}var s;return n.tokenExpired = 1e3 * n.exp, delete n.exp, delete n.iat, n;}Wt = "function" != typeof atob ? function (e) {if (e = String(e).replace(/[\t\n\f\r ]+/g, ""), !Vt.test(e)) throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var t;e += "==".slice(2 - (3 & e.length));for (var n, s, o = "", r = 0; r < e.length;) {t = zt.indexOf(e.charAt(r++)) << 18 | zt.indexOf(e.charAt(r++)) << 12 | (n = zt.indexOf(e.charAt(r++))) << 6 | (s = zt.indexOf(e.charAt(r++))), o += 64 === n ? String.fromCharCode(t >> 16 & 255) : 64 === s ? String.fromCharCode(t >> 16 & 255, t >> 8 & 255) : String.fromCharCode(t >> 16 & 255, t >> 8 & 255, 255 & t);}return o;} : atob;var Yt = s(function (e, t) {Object.defineProperty(t, "__esModule", { value: !0 });var n = "chooseAndUploadFile:ok",s = "chooseAndUploadFile:fail";function o(e, t) {return e.tempFiles.forEach(function (e, n) {e.name || (e.name = e.path.substring(e.path.lastIndexOf("/") + 1)), t && (e.fileType = t), e.cloudPath = Date.now() + "_" + n + e.name.substring(e.name.lastIndexOf("."));}), e.tempFilePaths || (e.tempFilePaths = e.tempFiles.map(function (e) {return e.path;})), e;}function r(e, t, _ref32) {var s = _ref32.onChooseFile,o = _ref32.onUploadProgress;return t.then(function (e) {if (s) {var _t17 = s(e);if (void 0 !== _t17) return Promise.resolve(_t17).then(function (t) {return void 0 === t ? e : t;});}return e;}).then(function (t) {return !1 === t ? { errMsg: n, tempFilePaths: [], tempFiles: [] } : function (e, t) {var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;var o = arguments.length > 3 ? arguments[3] : undefined;(t = Object.assign({}, t)).errMsg = n;var r = t.tempFiles,i = r.length;var a = 0;return new Promise(function (n) {for (; a < s;) {c();}function c() {var s = a++;if (s >= i) return void (!r.find(function (e) {return !e.url && !e.errMsg;}) && n(t));var u = r[s];e.uploadFile({ filePath: u.path, cloudPath: u.cloudPath, fileType: u.fileType, onUploadProgress: function onUploadProgress(e) {e.index = s, e.tempFile = u, e.tempFilePath = u.path, o && o(e);} }).then(function (e) {u.url = e.fileID, s < i && c();}).catch(function (e) {u.errMsg = e.errMsg || e.message, s < i && c();});}});}(e, t, 5, o);});}t.initChooseAndUploadFile = function (e) {return function () {var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { type: "all" };return "image" === t.type ? r(e, function (e) {var t = e.count,n = e.sizeType,_e$sourceType = e.sourceType,r = _e$sourceType === void 0 ? ["album", "camera"] : _e$sourceType,i = e.extension;return new Promise(function (e, a) {uni.chooseImage({ count: t, sizeType: n, sourceType: r, extension: i, success: function success(t) {e(o(t, "image"));}, fail: function fail(e) {a({ errMsg: e.errMsg.replace("chooseImage:fail", s) });} });});}(t), t) : "video" === t.type ? r(e, function (e) {var t = e.camera,n = e.compressed,r = e.maxDuration,_e$sourceType2 = e.sourceType,i = _e$sourceType2 === void 0 ? ["album", "camera"] : _e$sourceType2,a = e.extension;return new Promise(function (e, c) {uni.chooseVideo({ camera: t, compressed: n, maxDuration: r, sourceType: i, extension: a, success: function success(t) {var n = t.tempFilePath,s = t.duration,r = t.size,i = t.height,a = t.width;e(o({ errMsg: "chooseVideo:ok", tempFilePaths: [n], tempFiles: [{ name: t.tempFile && t.tempFile.name || "", path: n, size: r, type: t.tempFile && t.tempFile.type || "", width: a, height: i, duration: s, fileType: "video", cloudPath: "" }] }, "video"));}, fail: function fail(e) {c({ errMsg: e.errMsg.replace("chooseVideo:fail", s) });} });});}(t), t) : r(e, function (e) {var t = e.count,n = e.extension;return new Promise(function (e, r) {var i = uni.chooseFile;if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (i = wx.chooseMessageFile), "function" != typeof i) return r({ errMsg: s + " 请指定 type 类型,该平台仅支持选择 image 或 video。" });i({ type: "all", count: t, extension: n, success: function success(t) {e(o(t));}, fail: function fail(e) {r({ errMsg: e.errMsg.replace("chooseFile:fail", s) });} });});}(t), t);};};}),Xt = n(Yt);var Gt = "manual";function Qt(e) {return { props: { localdata: { type: Array, default: function _default() {return [];} }, options: { type: [Object, Array], default: function _default() {return {};} }, spaceInfo: { type: Object, default: function _default() {return {};} }, collection: { type: [String, Array], default: "" }, action: { type: String, default: "" }, field: { type: String, default: "" }, orderby: { type: String, default: "" }, where: { type: [String, Object], default: "" }, pageData: { type: String, default: "add" }, pageCurrent: { type: Number, default: 1 }, pageSize: { type: Number, default: 20 }, getcount: { type: [Boolean, String], default: !1 }, gettree: { type: [Boolean, String], default: !1 }, gettreepath: { type: [Boolean, String], default: !1 }, startwith: { type: String, default: "" }, limitlevel: { type: Number, default: 10 }, groupby: { type: String, default: "" }, groupField: { type: String, default: "" }, distinct: { type: [Boolean, String], default: !1 }, foreignKey: { type: String, default: "" }, loadtime: { type: String, default: "auto" }, manual: { type: Boolean, default: !1 } }, data: function data() {return { mixinDatacomLoading: !1, mixinDatacomHasMore: !1, mixinDatacomResData: [], mixinDatacomErrorMessage: "", mixinDatacomPage: {} };}, created: function created() {var _this18 = this;this.mixinDatacomPage = { current: this.pageCurrent, size: this.pageSize, count: 0 }, this.$watch(function () {var e = [];return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach(function (t) {e.push(_this18[t]);}), e;}, function (e, t) {if (_this18.loadtime === Gt) return;var n = !1;var s = [];for (var _o6 = 2; _o6 < e.length; _o6++) {e[_o6] !== t[_o6] && (s.push(e[_o6]), n = !0);}e[0] !== t[0] && (_this18.mixinDatacomPage.current = _this18.pageCurrent), _this18.mixinDatacomPage.size = _this18.pageSize, _this18.onMixinDatacomPropsChange(n, s);});}, methods: { onMixinDatacomPropsChange: function onMixinDatacomPropsChange(e, t) {}, mixinDatacomEasyGet: function mixinDatacomEasyGet() {var _this19 = this;var _ref33 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},_ref33$getone = _ref33.getone,e = _ref33$getone === void 0 ? !1 : _ref33$getone,t = _ref33.success,n = _ref33.fail;this.mixinDatacomLoading || (this.mixinDatacomLoading = !0, this.mixinDatacomErrorMessage = "", this.mixinDatacomGet().then(function (n) {_this19.mixinDatacomLoading = !1;var _n$result = n.result,s = _n$result.data,o = _n$result.count;_this19.getcount && (_this19.mixinDatacomPage.count = o), _this19.mixinDatacomHasMore = s.length < _this19.pageSize;var r = e ? s.length ? s[0] : void 0 : s;_this19.mixinDatacomResData = r, t && t(r);}).catch(function (e) {_this19.mixinDatacomLoading = !1, _this19.mixinDatacomErrorMessage = e, n && n(e);}));}, mixinDatacomGet: function mixinDatacomGet() {var _n9;var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var n = e.database(this.spaceInfo);var s = t.action || this.action;s && (n = n.action(s));var o = t.collection || this.collection;n = Array.isArray(o) ? (_n9 = n).collection.apply(_n9, _toConsumableArray(o)) : n.collection(o);var r = t.where || this.where;r && Object.keys(r).length && (n = n.where(r));var i = t.field || this.field;i && (n = n.field(i));var a = t.foreignKey || this.foreignKey;a && (n = n.foreignKey(a));var c = t.groupby || this.groupby;c && (n = n.groupBy(c));var u = t.groupField || this.groupField;u && (n = n.groupField(u));!0 === (void 0 !== t.distinct ? t.distinct : this.distinct) && (n = n.distinct());var l = t.orderby || this.orderby;l && (n = n.orderBy(l));var h = void 0 !== t.pageCurrent ? t.pageCurrent : this.mixinDatacomPage.current,d = void 0 !== t.pageSize ? t.pageSize : this.mixinDatacomPage.size,f = void 0 !== t.getcount ? t.getcount : this.getcount,g = void 0 !== t.gettree ? t.gettree : this.gettree,p = void 0 !== t.gettreepath ? t.gettreepath : this.gettreepath,m = { getCount: f },y = { limitLevel: void 0 !== t.limitlevel ? t.limitlevel : this.limitlevel, startWith: void 0 !== t.startwith ? t.startwith : this.startwith };return g && (m.getTree = y), p && (m.getTreePath = y), n = n.skip(d * (h - 1)).limit(d).get(m), n;} } };}function Zt(e) {return function (t) {var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};n = function (e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};return e.customUI = t.customUI || e.customUI, Object.assign(e.loadingOptions, t.loadingOptions), Object.assign(e.errorOptions, t.errorOptions), e;}({ customUI: !1, loadingOptions: { title: "加载中...", mask: !0 }, errorOptions: { type: "modal", retry: !1 } }, n);var _n10 = n,s = _n10.customUI,o = _n10.loadingOptions,r = _n10.errorOptions,i = !s;return new Proxy({}, { get: function get(n, s) {return /*#__PURE__*/function () {var _n11 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee32() {var u,_len,c,_key,_ref34,l,h,d,_yield,_e30,_e29,_args32 = arguments;return _regenerator.default.wrap(function _callee32$(_context32) {while (1) {switch (_context32.prev = _context32.next) {case 0:i && uni.showLoading({ title: o.title, mask: o.mask });for (_len = _args32.length, c = new Array(_len), _key = 0; _key < _len; _key++) {c[_key] = _args32[_key];}_context32.prev = 2;_context32.next = 5;return e.callFunction({ name: t, type: a, data: { method: s, params: c } });case 5:u = _context32.sent;_context32.next = 11;break;case 8:_context32.prev = 8;_context32.t0 = _context32["catch"](2);u = { result: _context32.t0 };case 11:_ref34 = u.result || {}, l = _ref34.errCode, h = _ref34.errMsg, d = _ref34.newToken;if (!(i && uni.hideLoading(), d && d.token && d.tokenExpired && (nt(d), N(E, _objectSpread({}, d))), l)) {_context32.next = 28;break;}if (!i) {_context32.next = 26;break;}if (!("toast" === r.type)) {_context32.next = 18;break;}uni.showToast({ title: h, icon: "none" });_context32.next = 26;break;case 18:if (!("modal" !== r.type)) {_context32.next = 20;break;}throw new Error("Invalid errorOptions.type: ".concat(r.type));case 20:_context32.next = 22;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee31() {var _ref36,e,t,n,s,o,_args31 = arguments;return _regenerator.default.wrap(function _callee31$(_context31) {while (1) {switch (_context31.prev = _context31.next) {case 0:_ref36 = _args31.length > 0 && _args31[0] !== undefined ? _args31[0] : {}, e = _ref36.title, t = _ref36.content, n = _ref36.showCancel, s = _ref36.cancelText, o = _ref36.confirmText;return _context31.abrupt("return", new Promise(function (r, i) {uni.showModal({ title: e, content: t, showCancel: n, cancelText: s, confirmText: o, success: function success(e) {r(e);}, fail: function fail() {r({ confirm: !1, cancel: !0 });} });}));case 2:case "end":return _context31.stop();}}}, _callee31);}))({ title: "提示", content: h, showCancel: r.retry, cancelText: "取消", confirmText: r.retry ? "重试" : "确定" });case 22:_yield = _context32.sent;_e30 = _yield.confirm;if (!(r.retry && _e30)) {_context32.next = 26;break;}return _context32.abrupt("return", n.apply(void 0, c));case 26:_e29 = new M({ code: l, message: h, requestId: u.requestId });throw _e29.detail = u.result, N(O, { type: x, content: _e29 }), _e29;case 28:return _context32.abrupt("return", (N(O, { type: x, content: u.result }), u.result));case 29:case "end":return _context32.stop();}}}, _callee32, null, [[2, 8]]);}));function n() {return _n11.apply(this, arguments);}return n;}();} });};}function en(_x30, _x31) {return _en.apply(this, arguments);}function _en() {_en = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee34(e, t) {var n, _e34, s;return _regenerator.default.wrap(function _callee34$(_context34) {while (1) {switch (_context34.prev = _context34.next) {case 0:n = "http://".concat(e, ":").concat(t, "/system/ping");_context34.prev = 1;_context34.next = 4;return s = { url: n, timeout: 500 }, new Promise(function (e, t) {H.request(_objectSpread(_objectSpread({}, s), {}, { success: function success(t) {e(t);}, fail: function fail(e) {t(e);} }));});case 4:_e34 = _context34.sent;return _context34.abrupt("return", !(!_e34.data || 0 !== _e34.data.code));case 8:_context34.prev = 8;_context34.t0 = _context34["catch"](1);return _context34.abrupt("return", !1);case 11:case "end":return _context34.stop();}}}, _callee34, null, [[1, 8]]);}));return _en.apply(this, arguments);}function tn(e) {if (e.initUniCloudStatus && "rejected" !== e.initUniCloudStatus) return;var t = Promise.resolve();var n;n = 1, t = new Promise(function (e, t) {setTimeout(function () {e();}, n);}), e.isReady = !1, e.isDefault = !1;var s = e.auth();e.initUniCloudStatus = "pending", e.initUniCloud = t.then(function () {return s.getLoginState();}).then(function (e) {return e ? Promise.resolve() : s.signInAnonymously();}).then(function () {if (!d) return Promise.resolve();if ("app" === g && "ios" === uni.getSystemInfoSync().osName) {var _uni$getSystemInfoSyn = uni.getSystemInfoSync(),_e31 = _uni$getSystemInfoSyn.osName,_t18 = _uni$getSystemInfoSyn.osVersion;"ios" === _e31 && function (e) {if (!e || "string" != typeof e) return 0;var t = e.match(/^(\d+)./);return t && t[1] ? parseInt(t[1]) : 0;}(_t18) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发模式生效,发行模式会连接uniCloud云端服务)");}if (d && e.debugInfo) {var _e$debugInfo = e.debugInfo,_t19 = _e$debugInfo.address,_n12 = _e$debugInfo.servePort;return function () {var _ref37 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee33(e, t) {var n, _s11, _o7;return _regenerator.default.wrap(function _callee33$(_context33) {while (1) {switch (_context33.prev = _context33.next) {case 0:_s11 = 0;case 1:if (!(_s11 < e.length)) {_context33.next = 11;break;}_o7 = e[_s11];_context33.next = 5;return en(_o7, t);case 5:if (!_context33.sent) {_context33.next = 8;break;}n = _o7;return _context33.abrupt("break", 11);case 8:_s11++;_context33.next = 1;break;case 11:return _context33.abrupt("return", { address: n, port: t });case 12:case "end":return _context33.stop();}}}, _callee33);}));return function (_x32, _x33) {return _ref37.apply(this, arguments);};}()(_t19, _n12);}}).then(function () {var _ref38 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},t = _ref38.address,n = _ref38.port;if (!d) return Promise.resolve();var s = console["app" === g ? "error" : "warn"];if (t) e.localAddress = t, e.localPort = n;else if (e.debugInfo) {var _t20 = "";"remote" === e.debugInfo.initialLaunchType ? (e.debugInfo.forceRemote = !0, _t20 = "当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs") : _t20 = "无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs", "web" === g && (_t20 += "\n- 部分浏览器开启节流模式之后访问本地地址受限,请检查是否启用了节流模式"), 0 === g.indexOf("mp-") && (_t20 += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), s(_t20);}}).then(function () {st(), e.isReady = !0, e.initUniCloudStatus = "fulfilled";}).catch(function (t) {console.error(t), e.initUniCloudStatus = "rejected";});}var nn = new ( /*#__PURE__*/function () {function _class4() {_classCallCheck(this, _class4);}_createClass(_class4, [{ key: "init", value: function init(e) {var t = {};var n = d && ("web" === g && navigator.userAgent.indexOf("HBuilderX") > 0 || "app" === g);switch (e.provider) {case "tcb":case "tencent":t = et.init(Object.assign(e, { debugLog: n }));break;case "aliyun":t = J.init(Object.assign(e, { debugLog: n }));break;case "private":t = rt.init(Object.assign(e, { debugLog: n }));break;default:throw new Error("未提供正确的provider参数");}var s = p;d && s && !s.code && (t.debugInfo = s), tn(t), t.reInit = function () {tn(this);}, ft(t), function (e) {var t = e.uploadFile;e.uploadFile = function (e) {return t.call(this, e);};}(t), Pt(t), function (e) {e.getCurrentUserInfo = Jt, e.chooseAndUploadFile = Xt.initChooseAndUploadFile(e), Object.assign(e, { get mixinDatacom() {return Qt(e);} }), e.importObject = Zt(e);}(t);return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach(function (e) {if (!t[e]) return;var n = t[e];t[e] = function () {return t.reInit(), n.apply(t, Array.from(arguments));}, t[e] = F(t[e], e).bind(t);}), t.init = this.init, t;} }]);return _class4;}())();(function () {{var e = m;var _t21 = {};if (1 === e.length) _t21 = e[0], nn = nn.init(_t21), nn.isDefault = !0;else {var _t22 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];var _n13;_n13 = e && e.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : y ? "应用未关联服务空间,请在uniCloud目录右键关联服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", _t22.forEach(function (e) {nn[e] = function () {return console.error(_n13), Promise.reject(new M({ code: "SYS_ERR", message: _n13 }));};});}Object.assign(nn, { get mixinDatacom() {return Qt(nn);} }), Ht(nn), nn.addInterceptor = v, nn.removeInterceptor = P, d && "web" === g && (window.uniCloud = nn);}})();var sn = nn;exports.default = sn;
  4412. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2), __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  4413. /***/ }),
  4414. /***/ 299:
  4415. /*!*****************************************************************!*\
  4416. !*** F:/工作项目/pingpu_H5/pages.json?{"type":"origin-pages-json"} ***!
  4417. \*****************************************************************/
  4418. /*! no static exports found */
  4419. /***/ (function(module, exports, __webpack_require__) {
  4420. "use strict";
  4421. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { "pages": [{ "path": "pages/index/index", "style": { "navigationBarTitleText": "迁安智慧乡村" } }, { "path": "pages/weather/index", "style": { "navigationBarTitleText": "环境检测", "enablePullDownRefresh": true } }, { "path": "pages/weather/details", "style": { "navigationBarTitleText": "设备详情", "enablePullDownRefresh": false } }, { "path": "pages/weather/history", "style": { "navigationBarTitleText": "历史数据", "enablePullDownRefresh": false } }, { "path": "pages/worm/index", "style": { "navigationBarTitleText": "虫情监测", "enablePullDownRefresh": true } }, { "path": "pages/worm/details", "style": { "navigationBarTitleText": "详情", "enablePullDownRefresh": false } }, { "path": "pages/worm/image", "style": { "navigationBarTitleText": "查看图片", "enablePullDownRefresh": false } }, { "path": "pages/worm/analyse", "style": { "navigationBarTitleText": "虫害分析", "enablePullDownRefresh": false } }, { "path": "pages/worm/history", "style": { "navigationBarTitleText": "历史数据", "enablePullDownRefresh": false } }, { "path": "pages/camera/index", "style": { "navigationBarTitleText": "监控列表", "enablePullDownRefresh": false } }, { "path": "pages/camera/details", "style": { "navigationBarTitleText": "监控画面", "enablePullDownRefresh": false } }, { "path": "pages/pest/index", "style": { "navigationBarTitleText": "病虫害百科", "enablePullDownRefresh": false } }, { "path": "pages/pest/details", "style": { "navigationBarTitleText": "病害百科", "enablePullDownRefresh": false } }, { "path": "pages/pest/discern", "style": { "navigationBarTitleText": "识别功能", "enablePullDownRefresh": false } }, { "path": "pages/fault/index", "style": { "navigationBarTitleText": "故障上报", "enablePullDownRefresh": false } }, { "path": "pages/warn/index", "style": { "navigationBarTitleText": "预警消息", "enablePullDownRefresh": false } }, { "path": "pages/pest/discern-result", "style": { "navigationBarTitleText": "识别结果", "enablePullDownRefresh": false } }], "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "迁安智慧乡村", "navigationBarBackgroundColor": "#ffffff", "backgroundColor": "#f3f5f9" }, "uniIDRouter": {} };exports.default = _default;
  4422. /***/ }),
  4423. /***/ 3:
  4424. /*!*************************************************************!*\
  4425. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  4426. \*************************************************************/
  4427. /*! no static exports found */
  4428. /***/ (function(module, exports, __webpack_require__) {
  4429. "use strict";
  4430. /* WEBPACK VAR INJECTION */(function(uni, global) {Object.defineProperty(exports, "__esModule", { value: true });exports.compileI18nJsonStr = compileI18nJsonStr;exports.hasI18nJson = hasI18nJson;exports.initVueI18n = initVueI18n;exports.isI18nStr = isI18nStr;exports.normalizeLocale = normalizeLocale;exports.parseI18nJson = parseI18nJson;exports.resolveLocale = resolveLocale;exports.isString = exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var isArray = Array.isArray;
  4431. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  4432. var defaultDelimiters = ['{', '}'];var
  4433. BaseFormatter = /*#__PURE__*/function () {
  4434. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  4435. this._caches = Object.create(null);
  4436. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  4437. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  4438. if (!values) {
  4439. return [message];
  4440. }
  4441. var tokens = this._caches[message];
  4442. if (!tokens) {
  4443. tokens = parse(message, delimiters);
  4444. this._caches[message] = tokens;
  4445. }
  4446. return compile(tokens, values);
  4447. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  4448. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  4449. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  4450. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  4451. var tokens = [];
  4452. var position = 0;
  4453. var text = '';
  4454. while (position < format.length) {
  4455. var char = format[position++];
  4456. if (char === startDelimiter) {
  4457. if (text) {
  4458. tokens.push({ type: 'text', value: text });
  4459. }
  4460. text = '';
  4461. var sub = '';
  4462. char = format[position++];
  4463. while (char !== undefined && char !== endDelimiter) {
  4464. sub += char;
  4465. char = format[position++];
  4466. }
  4467. var isClosed = char === endDelimiter;
  4468. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  4469. 'list' :
  4470. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  4471. 'named' :
  4472. 'unknown';
  4473. tokens.push({ value: sub, type: type });
  4474. }
  4475. // else if (char === '%') {
  4476. // // when found rails i18n syntax, skip text capture
  4477. // if (format[position] !== '{') {
  4478. // text += char
  4479. // }
  4480. // }
  4481. else {
  4482. text += char;
  4483. }
  4484. }
  4485. text && tokens.push({ type: 'text', value: text });
  4486. return tokens;
  4487. }
  4488. function compile(tokens, values) {
  4489. var compiled = [];
  4490. var index = 0;
  4491. var mode = isArray(values) ?
  4492. 'list' :
  4493. isObject(values) ?
  4494. 'named' :
  4495. 'unknown';
  4496. if (mode === 'unknown') {
  4497. return compiled;
  4498. }
  4499. while (index < tokens.length) {
  4500. var token = tokens[index];
  4501. switch (token.type) {
  4502. case 'text':
  4503. compiled.push(token.value);
  4504. break;
  4505. case 'list':
  4506. compiled.push(values[parseInt(token.value, 10)]);
  4507. break;
  4508. case 'named':
  4509. if (mode === 'named') {
  4510. compiled.push(values[token.value]);
  4511. } else
  4512. {
  4513. if (true) {
  4514. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  4515. }
  4516. }
  4517. break;
  4518. case 'unknown':
  4519. if (true) {
  4520. console.warn("Detect 'unknown' type of token!");
  4521. }
  4522. break;}
  4523. index++;
  4524. }
  4525. return compiled;
  4526. }
  4527. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  4528. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  4529. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  4530. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  4531. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  4532. var hasOwnProperty = Object.prototype.hasOwnProperty;
  4533. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  4534. var defaultFormatter = new BaseFormatter();
  4535. function include(str, parts) {
  4536. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  4537. }
  4538. function startsWith(str, parts) {
  4539. return parts.find(function (part) {return str.indexOf(part) === 0;});
  4540. }
  4541. function normalizeLocale(locale, messages) {
  4542. if (!locale) {
  4543. return;
  4544. }
  4545. locale = locale.trim().replace(/_/g, '-');
  4546. if (messages && messages[locale]) {
  4547. return locale;
  4548. }
  4549. locale = locale.toLowerCase();
  4550. if (locale.indexOf('zh') === 0) {
  4551. if (locale.indexOf('-hans') > -1) {
  4552. return LOCALE_ZH_HANS;
  4553. }
  4554. if (locale.indexOf('-hant') > -1) {
  4555. return LOCALE_ZH_HANT;
  4556. }
  4557. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  4558. return LOCALE_ZH_HANT;
  4559. }
  4560. return LOCALE_ZH_HANS;
  4561. }
  4562. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  4563. if (lang) {
  4564. return lang;
  4565. }
  4566. }var
  4567. I18n = /*#__PURE__*/function () {
  4568. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  4569. this.locale = LOCALE_EN;
  4570. this.fallbackLocale = LOCALE_EN;
  4571. this.message = {};
  4572. this.messages = {};
  4573. this.watchers = [];
  4574. if (fallbackLocale) {
  4575. this.fallbackLocale = fallbackLocale;
  4576. }
  4577. this.formater = formater || defaultFormatter;
  4578. this.messages = messages || {};
  4579. this.setLocale(locale || LOCALE_EN);
  4580. if (watcher) {
  4581. this.watchLocale(watcher);
  4582. }
  4583. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  4584. locale) {var _this = this;
  4585. var oldLocale = this.locale;
  4586. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  4587. if (!this.messages[this.locale]) {
  4588. // 可能初始化时不存在
  4589. this.messages[this.locale] = {};
  4590. }
  4591. this.message = this.messages[this.locale];
  4592. // 仅发生变化时,通知
  4593. if (oldLocale !== this.locale) {
  4594. this.watchers.forEach(function (watcher) {
  4595. watcher(_this.locale, oldLocale);
  4596. });
  4597. }
  4598. } }, { key: "getLocale", value: function getLocale()
  4599. {
  4600. return this.locale;
  4601. } }, { key: "watchLocale", value: function watchLocale(
  4602. fn) {var _this2 = this;
  4603. var index = this.watchers.push(fn) - 1;
  4604. return function () {
  4605. _this2.watchers.splice(index, 1);
  4606. };
  4607. } }, { key: "add", value: function add(
  4608. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  4609. var curMessages = this.messages[locale];
  4610. if (curMessages) {
  4611. if (override) {
  4612. Object.assign(curMessages, message);
  4613. } else
  4614. {
  4615. Object.keys(message).forEach(function (key) {
  4616. if (!hasOwn(curMessages, key)) {
  4617. curMessages[key] = message[key];
  4618. }
  4619. });
  4620. }
  4621. } else
  4622. {
  4623. this.messages[locale] = message;
  4624. }
  4625. } }, { key: "f", value: function f(
  4626. message, values, delimiters) {
  4627. return this.formater.interpolate(message, values, delimiters).join('');
  4628. } }, { key: "t", value: function t(
  4629. key, locale, values) {
  4630. var message = this.message;
  4631. if (typeof locale === 'string') {
  4632. locale = normalizeLocale(locale, this.messages);
  4633. locale && (message = this.messages[locale]);
  4634. } else
  4635. {
  4636. values = locale;
  4637. }
  4638. if (!hasOwn(message, key)) {
  4639. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  4640. return key;
  4641. }
  4642. return this.formater.interpolate(message[key], values).join('');
  4643. } }]);return I18n;}();exports.I18n = I18n;
  4644. function watchAppLocale(appVm, i18n) {
  4645. // 需要保证 watch 的触发在组件渲染之前
  4646. if (appVm.$watchLocale) {
  4647. // vue2
  4648. appVm.$watchLocale(function (newLocale) {
  4649. i18n.setLocale(newLocale);
  4650. });
  4651. } else
  4652. {
  4653. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  4654. i18n.setLocale(newLocale);
  4655. });
  4656. }
  4657. }
  4658. function getDefaultLocale() {
  4659. if (typeof uni !== 'undefined' && uni.getLocale) {
  4660. return uni.getLocale();
  4661. }
  4662. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  4663. if (typeof global !== 'undefined' && global.getLocale) {
  4664. return global.getLocale();
  4665. }
  4666. return LOCALE_EN;
  4667. }
  4668. function initVueI18n(locale) {var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;var watcher = arguments.length > 3 ? arguments[3] : undefined;
  4669. // 兼容旧版本入参
  4670. if (typeof locale !== 'string') {var _ref4 =
  4671. [
  4672. messages,
  4673. locale];locale = _ref4[0];messages = _ref4[1];
  4674. }
  4675. if (typeof locale !== 'string') {
  4676. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  4677. locale = getDefaultLocale();
  4678. }
  4679. if (typeof fallbackLocale !== 'string') {
  4680. fallbackLocale =
  4681. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  4682. LOCALE_EN;
  4683. }
  4684. var i18n = new I18n({
  4685. locale: locale,
  4686. fallbackLocale: fallbackLocale,
  4687. messages: messages,
  4688. watcher: watcher });
  4689. var _t = function t(key, values) {
  4690. if (typeof getApp !== 'function') {
  4691. // app view
  4692. /* eslint-disable no-func-assign */
  4693. _t = function t(key, values) {
  4694. return i18n.t(key, values);
  4695. };
  4696. } else
  4697. {
  4698. var isWatchedAppLocale = false;
  4699. _t = function t(key, values) {
  4700. var appVm = getApp().$vm;
  4701. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  4702. // options: {
  4703. // type: Array,
  4704. // default () {
  4705. // return [{
  4706. // icon: 'shop',
  4707. // text: t("uni-goods-nav.options.shop"),
  4708. // }, {
  4709. // icon: 'cart',
  4710. // text: t("uni-goods-nav.options.cart")
  4711. // }]
  4712. // }
  4713. // },
  4714. if (appVm) {
  4715. // 触发响应式
  4716. appVm.$locale;
  4717. if (!isWatchedAppLocale) {
  4718. isWatchedAppLocale = true;
  4719. watchAppLocale(appVm, i18n);
  4720. }
  4721. }
  4722. return i18n.t(key, values);
  4723. };
  4724. }
  4725. return _t(key, values);
  4726. };
  4727. return {
  4728. i18n: i18n,
  4729. f: function f(message, values, delimiters) {
  4730. return i18n.f(message, values, delimiters);
  4731. },
  4732. t: function t(key, values) {
  4733. return _t(key, values);
  4734. },
  4735. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  4736. return i18n.add(locale, message, override);
  4737. },
  4738. watch: function watch(fn) {
  4739. return i18n.watchLocale(fn);
  4740. },
  4741. getLocale: function getLocale() {
  4742. return i18n.getLocale();
  4743. },
  4744. setLocale: function setLocale(newLocale) {
  4745. return i18n.setLocale(newLocale);
  4746. } };
  4747. }
  4748. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  4749. var formater;
  4750. function hasI18nJson(jsonObj, delimiters) {
  4751. if (!formater) {
  4752. formater = new BaseFormatter();
  4753. }
  4754. return walkJsonObj(jsonObj, function (jsonObj, key) {
  4755. var value = jsonObj[key];
  4756. if (isString(value)) {
  4757. if (isI18nStr(value, delimiters)) {
  4758. return true;
  4759. }
  4760. } else
  4761. {
  4762. return hasI18nJson(value, delimiters);
  4763. }
  4764. });
  4765. }
  4766. function parseI18nJson(jsonObj, values, delimiters) {
  4767. if (!formater) {
  4768. formater = new BaseFormatter();
  4769. }
  4770. walkJsonObj(jsonObj, function (jsonObj, key) {
  4771. var value = jsonObj[key];
  4772. if (isString(value)) {
  4773. if (isI18nStr(value, delimiters)) {
  4774. jsonObj[key] = compileStr(value, values, delimiters);
  4775. }
  4776. } else
  4777. {
  4778. parseI18nJson(value, values, delimiters);
  4779. }
  4780. });
  4781. return jsonObj;
  4782. }
  4783. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  4784. if (!isI18nStr(jsonStr, delimiters)) {
  4785. return jsonStr;
  4786. }
  4787. if (!formater) {
  4788. formater = new BaseFormatter();
  4789. }
  4790. var localeValues = [];
  4791. Object.keys(locales).forEach(function (name) {
  4792. if (name !== locale) {
  4793. localeValues.push({
  4794. locale: name,
  4795. values: locales[name] });
  4796. }
  4797. });
  4798. localeValues.unshift({ locale: locale, values: locales[locale] });
  4799. try {
  4800. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  4801. }
  4802. catch (e) {}
  4803. return jsonStr;
  4804. }
  4805. function isI18nStr(value, delimiters) {
  4806. return value.indexOf(delimiters[0]) > -1;
  4807. }
  4808. function compileStr(value, values, delimiters) {
  4809. return formater.interpolate(value, values, delimiters).join('');
  4810. }
  4811. function compileValue(jsonObj, key, localeValues, delimiters) {
  4812. var value = jsonObj[key];
  4813. if (isString(value)) {
  4814. // 存在国际化
  4815. if (isI18nStr(value, delimiters)) {
  4816. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  4817. if (localeValues.length > 1) {
  4818. // 格式化国际化语言
  4819. var valueLocales = jsonObj[key + 'Locales'] = {};
  4820. localeValues.forEach(function (localValue) {
  4821. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  4822. });
  4823. }
  4824. }
  4825. } else
  4826. {
  4827. compileJsonObj(value, localeValues, delimiters);
  4828. }
  4829. }
  4830. function compileJsonObj(jsonObj, localeValues, delimiters) {
  4831. walkJsonObj(jsonObj, function (jsonObj, key) {
  4832. compileValue(jsonObj, key, localeValues, delimiters);
  4833. });
  4834. return jsonObj;
  4835. }
  4836. function walkJsonObj(jsonObj, walk) {
  4837. if (isArray(jsonObj)) {
  4838. for (var i = 0; i < jsonObj.length; i++) {
  4839. if (walk(jsonObj, i)) {
  4840. return true;
  4841. }
  4842. }
  4843. } else
  4844. if (isObject(jsonObj)) {
  4845. for (var key in jsonObj) {
  4846. if (walk(jsonObj, key)) {
  4847. return true;
  4848. }
  4849. }
  4850. }
  4851. return false;
  4852. }
  4853. function resolveLocale(locales) {
  4854. return function (locale) {
  4855. if (!locale) {
  4856. return locale;
  4857. }
  4858. locale = normalizeLocale(locale) || locale;
  4859. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  4860. };
  4861. }
  4862. function resolveLocaleChain(locale) {
  4863. var chain = [];
  4864. var tokens = locale.split('-');
  4865. while (tokens.length) {
  4866. chain.push(tokens.join('-'));
  4867. tokens.pop();
  4868. }
  4869. return chain;
  4870. }
  4871. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  4872. /***/ }),
  4873. /***/ 300:
  4874. /*!****************************************************!*\
  4875. !*** F:/工作项目/pingpu_H5/pages.json?{"type":"stat"} ***!
  4876. \****************************************************/
  4877. /*! no static exports found */
  4878. /***/ (function(module, exports, __webpack_require__) {
  4879. "use strict";
  4880. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { "appid": "__UNI__EDAB3EB" };exports.default = _default;
  4881. /***/ }),
  4882. /***/ 301:
  4883. /*!***************************************************************************!*\
  4884. !*** F:/工作项目/pingpu_H5/uni_modules/ui-charts/js_sdk/u-charts/u-charts.js ***!
  4885. \***************************************************************************/
  4886. /*! no static exports found */
  4887. /***/ (function(module, exports, __webpack_require__) {
  4888. "use strict";
  4889. /*
  4890. * uCharts (R)
  4891. * 高性能跨平台图表库,支持H5、APP、小程序(微信/支付宝/百度/头条/QQ/360/快手)、Vue、Taro等支持canvas的框架平台
  4892. * Copyright (C) 2018-2022 QIUN (R) 秋云 https://www.ucharts.cn All rights reserved.
  4893. * Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  4894. * 复制使用请保留本段注释,感谢支持开源!
  4895. *
  4896. * uCharts (R) 官方网站
  4897. * https://www.uCharts.cn
  4898. *
  4899. * 开源地址:
  4900. * https://gitee.com/uCharts/uCharts
  4901. *
  4902. * uni-app插件市场地址:
  4903. * http://ext.dcloud.net.cn/plugin?id=271
  4904. *
  4905. */
  4906. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}
  4907. var config = {
  4908. version: 'v2.4.3-20220505',
  4909. yAxisWidth: 15,
  4910. xAxisHeight: 22,
  4911. xAxisTextPadding: 3,
  4912. padding: [10, 10, 10, 10],
  4913. pixelRatio: 1,
  4914. rotate: false,
  4915. fontSize: 13,
  4916. fontColor: '#666666',
  4917. dataPointShape: ['circle', 'circle', 'circle', 'circle'],
  4918. color: ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc'],
  4919. linearColor: ['#0EE2F8', '#2BDCA8', '#FA7D8D', '#EB88E2', '#2AE3A0', '#0EE2F8', '#EB88E2', '#6773E3', '#F78A85'],
  4920. pieChartLinePadding: 15,
  4921. pieChartTextPadding: 5,
  4922. titleFontSize: 20,
  4923. subtitleFontSize: 15,
  4924. toolTipPadding: 3,
  4925. toolTipBackground: '#000000',
  4926. toolTipOpacity: 0.7,
  4927. toolTipLineHeight: 20,
  4928. radarLabelTextMargin: 13 };
  4929. var assign = function assign(target) {for (var _len2 = arguments.length, varArgs = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {varArgs[_key2 - 1] = arguments[_key2];}
  4930. if (target == null) {
  4931. throw new TypeError('[uCharts] Cannot convert undefined or null to object');
  4932. }
  4933. if (!varArgs || varArgs.length <= 0) {
  4934. return target;
  4935. }
  4936. // 深度合并对象
  4937. function deepAssign(obj1, obj2) {
  4938. for (var key in obj2) {
  4939. obj1[key] = obj1[key] && obj1[key].toString() === "[object Object]" ?
  4940. deepAssign(obj1[key], obj2[key]) : obj1[key] = obj2[key];
  4941. }
  4942. return obj1;
  4943. }
  4944. varArgs.forEach(function (val) {
  4945. target = deepAssign(target, val);
  4946. });
  4947. return target;
  4948. };
  4949. var util = {
  4950. toFixed: function toFixed(num, limit) {
  4951. limit = limit || 2;
  4952. if (this.isFloat(num)) {
  4953. num = num.toFixed(limit);
  4954. }
  4955. return num;
  4956. },
  4957. isFloat: function isFloat(num) {
  4958. return num % 1 !== 0;
  4959. },
  4960. approximatelyEqual: function approximatelyEqual(num1, num2) {
  4961. return Math.abs(num1 - num2) < 1e-10;
  4962. },
  4963. isSameSign: function isSameSign(num1, num2) {
  4964. return Math.abs(num1) === num1 && Math.abs(num2) === num2 || Math.abs(num1) !== num1 && Math.abs(num2) !== num2;
  4965. },
  4966. isSameXCoordinateArea: function isSameXCoordinateArea(p1, p2) {
  4967. return this.isSameSign(p1.x, p2.x);
  4968. },
  4969. isCollision: function isCollision(obj1, obj2) {
  4970. obj1.end = {};
  4971. obj1.end.x = obj1.start.x + obj1.width;
  4972. obj1.end.y = obj1.start.y - obj1.height;
  4973. obj2.end = {};
  4974. obj2.end.x = obj2.start.x + obj2.width;
  4975. obj2.end.y = obj2.start.y - obj2.height;
  4976. var flag = obj2.start.x > obj1.end.x || obj2.end.x < obj1.start.x || obj2.end.y > obj1.start.y || obj2.start.y < obj1.end.y;
  4977. return !flag;
  4978. } };
  4979. //兼容H5点击事件
  4980. function getH5Offset(e) {
  4981. e.mp = {
  4982. changedTouches: [] };
  4983. e.mp.changedTouches.push({
  4984. x: e.offsetX,
  4985. y: e.offsetY });
  4986. return e;
  4987. }
  4988. // hex 转 rgba
  4989. function hexToRgb(hexValue, opc) {
  4990. var rgx = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
  4991. var hex = hexValue.replace(rgx, function (m, r, g, b) {
  4992. return r + r + g + g + b + b;
  4993. });
  4994. var rgb = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
  4995. var r = parseInt(rgb[1], 16);
  4996. var g = parseInt(rgb[2], 16);
  4997. var b = parseInt(rgb[3], 16);
  4998. return 'rgba(' + r + ',' + g + ',' + b + ',' + opc + ')';
  4999. }
  5000. function findRange(num, type, limit) {
  5001. if (isNaN(num)) {
  5002. throw new Error('[uCharts] series数据需为Number格式');
  5003. }
  5004. limit = limit || 10;
  5005. type = type ? type : 'upper';
  5006. var multiple = 1;
  5007. while (limit < 1) {
  5008. limit *= 10;
  5009. multiple *= 10;
  5010. }
  5011. if (type === 'upper') {
  5012. num = Math.ceil(num * multiple);
  5013. } else {
  5014. num = Math.floor(num * multiple);
  5015. }
  5016. while (num % limit !== 0) {
  5017. if (type === 'upper') {
  5018. if (num == num + 1) {//修复数据值过大num++无效的bug by 向日葵 @xrk_jy
  5019. break;
  5020. }
  5021. num++;
  5022. } else {
  5023. num--;
  5024. }
  5025. }
  5026. return num / multiple;
  5027. }
  5028. function calCandleMA(dayArr, nameArr, colorArr, kdata) {
  5029. var seriesTemp = [];
  5030. for (var k = 0; k < dayArr.length; k++) {
  5031. var seriesItem = {
  5032. data: [],
  5033. name: nameArr[k],
  5034. color: colorArr[k] };
  5035. for (var i = 0, len = kdata.length; i < len; i++) {
  5036. if (i < dayArr[k]) {
  5037. seriesItem.data.push(null);
  5038. continue;
  5039. }
  5040. var sum = 0;
  5041. for (var j = 0; j < dayArr[k]; j++) {
  5042. sum += kdata[i - j][1];
  5043. }
  5044. seriesItem.data.push(+(sum / dayArr[k]).toFixed(3));
  5045. }
  5046. seriesTemp.push(seriesItem);
  5047. }
  5048. return seriesTemp;
  5049. }
  5050. function calValidDistance(self, distance, chartData, config, opts) {
  5051. var dataChartAreaWidth = opts.width - opts.area[1] - opts.area[3];
  5052. var dataChartWidth = chartData.eachSpacing * (opts.chartData.xAxisData.xAxisPoints.length - 1);
  5053. if (opts.type == 'mount' && opts.extra && opts.extra.mount && opts.extra.mount.widthRatio && opts.extra.mount.widthRatio > 1) {
  5054. if (opts.extra.mount.widthRatio > 2) opts.extra.mount.widthRatio = 2;
  5055. dataChartWidth += (opts.extra.mount.widthRatio - 1) * chartData.eachSpacing;
  5056. }
  5057. var validDistance = distance;
  5058. if (distance >= 0) {
  5059. validDistance = 0;
  5060. self.uevent.trigger('scrollLeft');
  5061. self.scrollOption.position = 'left';
  5062. opts.xAxis.scrollPosition = 'left';
  5063. } else if (Math.abs(distance) >= dataChartWidth - dataChartAreaWidth) {
  5064. validDistance = dataChartAreaWidth - dataChartWidth;
  5065. self.uevent.trigger('scrollRight');
  5066. self.scrollOption.position = 'right';
  5067. opts.xAxis.scrollPosition = 'right';
  5068. } else {
  5069. self.scrollOption.position = distance;
  5070. opts.xAxis.scrollPosition = distance;
  5071. }
  5072. return validDistance;
  5073. }
  5074. function isInAngleRange(angle, startAngle, endAngle) {
  5075. function adjust(angle) {
  5076. while (angle < 0) {
  5077. angle += 2 * Math.PI;
  5078. }
  5079. while (angle > 2 * Math.PI) {
  5080. angle -= 2 * Math.PI;
  5081. }
  5082. return angle;
  5083. }
  5084. angle = adjust(angle);
  5085. startAngle = adjust(startAngle);
  5086. endAngle = adjust(endAngle);
  5087. if (startAngle > endAngle) {
  5088. endAngle += 2 * Math.PI;
  5089. if (angle < startAngle) {
  5090. angle += 2 * Math.PI;
  5091. }
  5092. }
  5093. return angle >= startAngle && angle <= endAngle;
  5094. }
  5095. function createCurveControlPoints(points, i) {
  5096. function isNotMiddlePoint(points, i) {
  5097. if (points[i - 1] && points[i + 1]) {
  5098. return points[i].y >= Math.max(points[i - 1].y, points[i + 1].y) || points[i].y <= Math.min(points[i - 1].y,
  5099. points[i + 1].y);
  5100. } else {
  5101. return false;
  5102. }
  5103. }
  5104. function isNotMiddlePointX(points, i) {
  5105. if (points[i - 1] && points[i + 1]) {
  5106. return points[i].x >= Math.max(points[i - 1].x, points[i + 1].x) || points[i].x <= Math.min(points[i - 1].x,
  5107. points[i + 1].x);
  5108. } else {
  5109. return false;
  5110. }
  5111. }
  5112. var a = 0.2;
  5113. var b = 0.2;
  5114. var pAx = null;
  5115. var pAy = null;
  5116. var pBx = null;
  5117. var pBy = null;
  5118. if (i < 1) {
  5119. pAx = points[0].x + (points[1].x - points[0].x) * a;
  5120. pAy = points[0].y + (points[1].y - points[0].y) * a;
  5121. } else {
  5122. pAx = points[i].x + (points[i + 1].x - points[i - 1].x) * a;
  5123. pAy = points[i].y + (points[i + 1].y - points[i - 1].y) * a;
  5124. }
  5125. if (i > points.length - 3) {
  5126. var last = points.length - 1;
  5127. pBx = points[last].x - (points[last].x - points[last - 1].x) * b;
  5128. pBy = points[last].y - (points[last].y - points[last - 1].y) * b;
  5129. } else {
  5130. pBx = points[i + 1].x - (points[i + 2].x - points[i].x) * b;
  5131. pBy = points[i + 1].y - (points[i + 2].y - points[i].y) * b;
  5132. }
  5133. if (isNotMiddlePoint(points, i + 1)) {
  5134. pBy = points[i + 1].y;
  5135. }
  5136. if (isNotMiddlePoint(points, i)) {
  5137. pAy = points[i].y;
  5138. }
  5139. if (isNotMiddlePointX(points, i + 1)) {
  5140. pBx = points[i + 1].x;
  5141. }
  5142. if (isNotMiddlePointX(points, i)) {
  5143. pAx = points[i].x;
  5144. }
  5145. if (pAy >= Math.max(points[i].y, points[i + 1].y) || pAy <= Math.min(points[i].y, points[i + 1].y)) {
  5146. pAy = points[i].y;
  5147. }
  5148. if (pBy >= Math.max(points[i].y, points[i + 1].y) || pBy <= Math.min(points[i].y, points[i + 1].y)) {
  5149. pBy = points[i + 1].y;
  5150. }
  5151. if (pAx >= Math.max(points[i].x, points[i + 1].x) || pAx <= Math.min(points[i].x, points[i + 1].x)) {
  5152. pAx = points[i].x;
  5153. }
  5154. if (pBx >= Math.max(points[i].x, points[i + 1].x) || pBx <= Math.min(points[i].x, points[i + 1].x)) {
  5155. pBx = points[i + 1].x;
  5156. }
  5157. return {
  5158. ctrA: {
  5159. x: pAx,
  5160. y: pAy },
  5161. ctrB: {
  5162. x: pBx,
  5163. y: pBy } };
  5164. }
  5165. function convertCoordinateOrigin(x, y, center) {
  5166. return {
  5167. x: center.x + x,
  5168. y: center.y - y };
  5169. }
  5170. function avoidCollision(obj, target) {
  5171. if (target) {
  5172. // is collision test
  5173. while (util.isCollision(obj, target)) {
  5174. if (obj.start.x > 0) {
  5175. obj.start.y--;
  5176. } else if (obj.start.x < 0) {
  5177. obj.start.y++;
  5178. } else {
  5179. if (obj.start.y > 0) {
  5180. obj.start.y++;
  5181. } else {
  5182. obj.start.y--;
  5183. }
  5184. }
  5185. }
  5186. }
  5187. return obj;
  5188. }
  5189. function fixPieSeries(series, opts, config) {
  5190. var pieSeriesArr = [];
  5191. if (series.length > 0 && series[0].data.constructor.toString().indexOf('Array') > -1) {
  5192. opts._pieSeries_ = series;
  5193. var oldseries = series[0].data;
  5194. for (var i = 0; i < oldseries.length; i++) {
  5195. oldseries[i].formatter = series[0].formatter;
  5196. oldseries[i].data = oldseries[i].value;
  5197. pieSeriesArr.push(oldseries[i]);
  5198. }
  5199. opts.series = pieSeriesArr;
  5200. } else {
  5201. pieSeriesArr = series;
  5202. }
  5203. return pieSeriesArr;
  5204. }
  5205. function fillSeries(series, opts, config) {
  5206. var index = 0;
  5207. for (var i = 0; i < series.length; i++) {
  5208. var item = series[i];
  5209. if (!item.color) {
  5210. item.color = config.color[index];
  5211. index = (index + 1) % config.color.length;
  5212. }
  5213. if (!item.linearIndex) {
  5214. item.linearIndex = i;
  5215. }
  5216. if (!item.index) {
  5217. item.index = 0;
  5218. }
  5219. if (!item.type) {
  5220. item.type = opts.type;
  5221. }
  5222. if (typeof item.show == "undefined") {
  5223. item.show = true;
  5224. }
  5225. if (!item.type) {
  5226. item.type = opts.type;
  5227. }
  5228. if (!item.pointShape) {
  5229. item.pointShape = "circle";
  5230. }
  5231. if (!item.legendShape) {
  5232. switch (item.type) {
  5233. case 'line':
  5234. item.legendShape = "line";
  5235. break;
  5236. case 'column':
  5237. case 'bar':
  5238. item.legendShape = "rect";
  5239. break;
  5240. case 'area':
  5241. case 'mount':
  5242. item.legendShape = "triangle";
  5243. break;
  5244. default:
  5245. item.legendShape = "circle";}
  5246. }
  5247. }
  5248. return series;
  5249. }
  5250. function fillCustomColor(linearType, customColor, series, config) {
  5251. var newcolor = customColor || [];
  5252. if (linearType == 'custom' && newcolor.length == 0) {
  5253. newcolor = config.linearColor;
  5254. }
  5255. if (linearType == 'custom' && newcolor.length < series.length) {
  5256. var chazhi = series.length - newcolor.length;
  5257. for (var i = 0; i < chazhi; i++) {
  5258. newcolor.push(config.linearColor[(i + 1) % config.linearColor.length]);
  5259. }
  5260. }
  5261. return newcolor;
  5262. }
  5263. function getDataRange(minData, maxData) {
  5264. var limit = 0;
  5265. var range = maxData - minData;
  5266. if (range >= 10000) {
  5267. limit = 1000;
  5268. } else if (range >= 1000) {
  5269. limit = 100;
  5270. } else if (range >= 100) {
  5271. limit = 10;
  5272. } else if (range >= 10) {
  5273. limit = 5;
  5274. } else if (range >= 1) {
  5275. limit = 1;
  5276. } else if (range >= 0.1) {
  5277. limit = 0.1;
  5278. } else if (range >= 0.01) {
  5279. limit = 0.01;
  5280. } else if (range >= 0.001) {
  5281. limit = 0.001;
  5282. } else if (range >= 0.0001) {
  5283. limit = 0.0001;
  5284. } else if (range >= 0.00001) {
  5285. limit = 0.00001;
  5286. } else {
  5287. limit = 0.000001;
  5288. }
  5289. return {
  5290. minRange: findRange(minData, 'lower', limit),
  5291. maxRange: findRange(maxData, 'upper', limit) };
  5292. }
  5293. function measureText(text, fontSize, context) {
  5294. var width = 0;
  5295. text = String(text);
  5296. if (context !== false && context !== undefined && context.setFontSize && context.measureText) {
  5297. context.setFontSize(fontSize);
  5298. return context.measureText(text).width;
  5299. } else {
  5300. var text = text.split('');
  5301. for (var i = 0; i < text.length; i++) {
  5302. var item = text[i];
  5303. if (/[a-zA-Z]/.test(item)) {
  5304. width += 7;
  5305. } else if (/[0-9]/.test(item)) {
  5306. width += 5.5;
  5307. } else if (/\./.test(item)) {
  5308. width += 2.7;
  5309. } else if (/-/.test(item)) {
  5310. width += 3.25;
  5311. } else if (/:/.test(item)) {
  5312. width += 2.5;
  5313. } else if (/[\u4e00-\u9fa5]/.test(item)) {
  5314. width += 10;
  5315. } else if (/\(|\)/.test(item)) {
  5316. width += 3.73;
  5317. } else if (/\s/.test(item)) {
  5318. width += 2.5;
  5319. } else if (/%/.test(item)) {
  5320. width += 8;
  5321. } else {
  5322. width += 10;
  5323. }
  5324. }
  5325. return width * fontSize / 10;
  5326. }
  5327. }
  5328. function dataCombine(series) {
  5329. return series.reduce(function (a, b) {
  5330. return (a.data ? a.data : a).concat(b.data);
  5331. }, []);
  5332. }
  5333. function dataCombineStack(series, len) {
  5334. var sum = new Array(len);
  5335. for (var j = 0; j < sum.length; j++) {
  5336. sum[j] = 0;
  5337. }
  5338. for (var i = 0; i < series.length; i++) {
  5339. for (var j = 0; j < sum.length; j++) {
  5340. sum[j] += series[i].data[j];
  5341. }
  5342. }
  5343. return series.reduce(function (a, b) {
  5344. return (a.data ? a.data : a).concat(b.data).concat(sum);
  5345. }, []);
  5346. }
  5347. function getTouches(touches, opts, e) {
  5348. var x, y;
  5349. if (touches.clientX) {
  5350. if (opts.rotate) {
  5351. y = opts.height - touches.clientX * opts.pix;
  5352. x = (touches.pageY - e.currentTarget.offsetTop - opts.height / opts.pix / 2 * (opts.pix - 1)) * opts.pix;
  5353. } else {
  5354. x = touches.clientX * opts.pix;
  5355. y = (touches.pageY - e.currentTarget.offsetTop - opts.height / opts.pix / 2 * (opts.pix - 1)) * opts.pix;
  5356. }
  5357. } else {
  5358. if (opts.rotate) {
  5359. y = opts.height - touches.x * opts.pix;
  5360. x = touches.y * opts.pix;
  5361. } else {
  5362. x = touches.x * opts.pix;
  5363. y = touches.y * opts.pix;
  5364. }
  5365. }
  5366. return {
  5367. x: x,
  5368. y: y };
  5369. }
  5370. function getSeriesDataItem(series, index, group) {
  5371. var data = [];
  5372. var newSeries = [];
  5373. var indexIsArr = index.constructor.toString().indexOf('Array') > -1;
  5374. if (indexIsArr) {
  5375. var tempSeries = filterSeries(series);
  5376. for (var i = 0; i < group.length; i++) {
  5377. newSeries.push(tempSeries[group[i]]);
  5378. }
  5379. } else {
  5380. newSeries = series;
  5381. };
  5382. for (var _i = 0; _i < newSeries.length; _i++) {
  5383. var item = newSeries[_i];
  5384. var tmpindex = -1;
  5385. if (indexIsArr) {
  5386. tmpindex = index[_i];
  5387. } else {
  5388. tmpindex = index;
  5389. }
  5390. if (item.data[tmpindex] !== null && typeof item.data[tmpindex] !== 'undefined' && item.show) {
  5391. var seriesItem = {};
  5392. seriesItem.color = item.color;
  5393. seriesItem.type = item.type;
  5394. seriesItem.style = item.style;
  5395. seriesItem.pointShape = item.pointShape;
  5396. seriesItem.disableLegend = item.disableLegend;
  5397. seriesItem.name = item.name;
  5398. seriesItem.show = item.show;
  5399. seriesItem.data = item.formatter ? item.formatter(item.data[tmpindex]) : item.data[tmpindex];
  5400. data.push(seriesItem);
  5401. }
  5402. }
  5403. return data;
  5404. }
  5405. function getMaxTextListLength(list, fontSize, context) {
  5406. var lengthList = list.map(function (item) {
  5407. return measureText(item, fontSize, context);
  5408. });
  5409. return Math.max.apply(null, lengthList);
  5410. }
  5411. function getRadarCoordinateSeries(length) {
  5412. var eachAngle = 2 * Math.PI / length;
  5413. var CoordinateSeries = [];
  5414. for (var i = 0; i < length; i++) {
  5415. CoordinateSeries.push(eachAngle * i);
  5416. }
  5417. return CoordinateSeries.map(function (item) {
  5418. return -1 * item + Math.PI / 2;
  5419. });
  5420. }
  5421. function getToolTipData(seriesData, opts, index, group, categories) {
  5422. var option = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
  5423. var calPoints = opts.chartData.calPoints ? opts.chartData.calPoints : [];
  5424. var points = {};
  5425. if (group.length > 0) {
  5426. var filterPoints = [];
  5427. for (var i = 0; i < group.length; i++) {
  5428. filterPoints.push(calPoints[group[i]]);
  5429. }
  5430. points = filterPoints[0][index[0]];
  5431. } else {
  5432. for (var _i2 = 0; _i2 < calPoints.length; _i2++) {
  5433. if (calPoints[_i2][index]) {
  5434. points = calPoints[_i2][index];
  5435. break;
  5436. }
  5437. }
  5438. };
  5439. var textList = seriesData.map(function (item) {
  5440. var titleText = null;
  5441. if (opts.categories && opts.categories.length > 0) {
  5442. titleText = categories[index];
  5443. };
  5444. return {
  5445. text: option.formatter ? option.formatter(item, titleText, index, opts) : item.name + ': ' + item.data,
  5446. color: item.color };
  5447. });
  5448. var offset = {
  5449. x: Math.round(points.x),
  5450. y: Math.round(points.y) };
  5451. return {
  5452. textList: textList,
  5453. offset: offset };
  5454. }
  5455. function getMixToolTipData(seriesData, opts, index, categories) {
  5456. var option = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
  5457. var points = opts.chartData.xAxisPoints[index] + opts.chartData.eachSpacing / 2;
  5458. var textList = seriesData.map(function (item) {
  5459. return {
  5460. text: option.formatter ? option.formatter(item, categories[index], index, opts) : item.name + ': ' + item.data,
  5461. color: item.color,
  5462. disableLegend: item.disableLegend ? true : false };
  5463. });
  5464. textList = textList.filter(function (item) {
  5465. if (item.disableLegend !== true) {
  5466. return item;
  5467. }
  5468. });
  5469. var offset = {
  5470. x: Math.round(points),
  5471. y: 0 };
  5472. return {
  5473. textList: textList,
  5474. offset: offset };
  5475. }
  5476. function getCandleToolTipData(series, seriesData, opts, index, categories, extra) {
  5477. var option = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
  5478. var calPoints = opts.chartData.calPoints;
  5479. var upColor = extra.color.upFill;
  5480. var downColor = extra.color.downFill;
  5481. //颜色顺序为开盘,收盘,最低,最高
  5482. var color = [upColor, upColor, downColor, upColor];
  5483. var textList = [];
  5484. seriesData.map(function (item) {
  5485. if (index == 0) {
  5486. if (item.data[1] - item.data[0] < 0) {
  5487. color[1] = downColor;
  5488. } else {
  5489. color[1] = upColor;
  5490. }
  5491. } else {
  5492. if (item.data[0] < series[index - 1][1]) {
  5493. color[0] = downColor;
  5494. }
  5495. if (item.data[1] < item.data[0]) {
  5496. color[1] = downColor;
  5497. }
  5498. if (item.data[2] > series[index - 1][1]) {
  5499. color[2] = upColor;
  5500. }
  5501. if (item.data[3] < series[index - 1][1]) {
  5502. color[3] = downColor;
  5503. }
  5504. }
  5505. var text1 = {
  5506. text: '开盘:' + item.data[0],
  5507. color: color[0] };
  5508. var text2 = {
  5509. text: '收盘:' + item.data[1],
  5510. color: color[1] };
  5511. var text3 = {
  5512. text: '最低:' + item.data[2],
  5513. color: color[2] };
  5514. var text4 = {
  5515. text: '最高:' + item.data[3],
  5516. color: color[3] };
  5517. textList.push(text1, text2, text3, text4);
  5518. });
  5519. var validCalPoints = [];
  5520. var offset = {
  5521. x: 0,
  5522. y: 0 };
  5523. for (var i = 0; i < calPoints.length; i++) {
  5524. var points = calPoints[i];
  5525. if (typeof points[index] !== 'undefined' && points[index] !== null) {
  5526. validCalPoints.push(points[index]);
  5527. }
  5528. }
  5529. offset.x = Math.round(validCalPoints[0][0].x);
  5530. return {
  5531. textList: textList,
  5532. offset: offset };
  5533. }
  5534. function filterSeries(series) {
  5535. var tempSeries = [];
  5536. for (var i = 0; i < series.length; i++) {
  5537. if (series[i].show == true) {
  5538. tempSeries.push(series[i]);
  5539. }
  5540. }
  5541. return tempSeries;
  5542. }
  5543. function findCurrentIndex(currentPoints, calPoints, opts, config) {
  5544. var offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
  5545. var current = { index: -1, group: [] };
  5546. var spacing = opts.chartData.eachSpacing / 2;
  5547. var xAxisPoints = [];
  5548. if (calPoints && calPoints.length > 0) {
  5549. if (!opts.categories) {
  5550. spacing = 0;
  5551. } else {
  5552. for (var i = 1; i < opts.chartData.xAxisPoints.length; i++) {
  5553. xAxisPoints.push(opts.chartData.xAxisPoints[i] - spacing);
  5554. }
  5555. if ((opts.type == 'line' || opts.type == 'area') && opts.xAxis.boundaryGap == 'justify') {
  5556. xAxisPoints = opts.chartData.xAxisPoints;
  5557. }
  5558. }
  5559. if (isInExactChartArea(currentPoints, opts, config)) {
  5560. if (!opts.categories) {
  5561. var timePoints = Array(calPoints.length);
  5562. for (var _i3 = 0; _i3 < calPoints.length; _i3++) {
  5563. timePoints[_i3] = Array(calPoints[_i3].length);
  5564. for (var j = 0; j < calPoints[_i3].length; j++) {
  5565. timePoints[_i3][j] = Math.abs(calPoints[_i3][j].x - currentPoints.x);
  5566. }
  5567. };
  5568. var pointValue = Array(timePoints.length);
  5569. var pointIndex = Array(timePoints.length);
  5570. for (var _i4 = 0; _i4 < timePoints.length; _i4++) {
  5571. pointValue[_i4] = Math.min.apply(null, timePoints[_i4]);
  5572. pointIndex[_i4] = timePoints[_i4].indexOf(pointValue[_i4]);
  5573. }
  5574. var minValue = Math.min.apply(null, pointValue);
  5575. current.index = [];
  5576. for (var _i5 = 0; _i5 < pointValue.length; _i5++) {
  5577. if (pointValue[_i5] == minValue) {
  5578. current.group.push(_i5);
  5579. current.index.push(pointIndex[_i5]);
  5580. }
  5581. };
  5582. } else {
  5583. xAxisPoints.forEach(function (item, index) {
  5584. if (currentPoints.x + offset + spacing > item) {
  5585. current.index = index;
  5586. }
  5587. });
  5588. }
  5589. }
  5590. }
  5591. return current;
  5592. }
  5593. function findBarChartCurrentIndex(currentPoints, calPoints, opts, config) {
  5594. var offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
  5595. var current = { index: -1, group: [] };
  5596. var spacing = opts.chartData.eachSpacing / 2;
  5597. var yAxisPoints = opts.chartData.yAxisPoints;
  5598. if (calPoints && calPoints.length > 0) {
  5599. if (isInExactChartArea(currentPoints, opts, config)) {
  5600. yAxisPoints.forEach(function (item, index) {
  5601. if (currentPoints.y + offset + spacing > item) {
  5602. current.index = index;
  5603. }
  5604. });
  5605. }
  5606. }
  5607. return current;
  5608. }
  5609. function findLegendIndex(currentPoints, legendData, opts) {
  5610. var currentIndex = -1;
  5611. var gap = 0;
  5612. if (isInExactLegendArea(currentPoints, legendData.area)) {
  5613. var points = legendData.points;
  5614. var index = -1;
  5615. for (var i = 0, len = points.length; i < len; i++) {
  5616. var item = points[i];
  5617. for (var j = 0; j < item.length; j++) {
  5618. index += 1;
  5619. var area = item[j]['area'];
  5620. if (area && currentPoints.x > area[0] - gap && currentPoints.x < area[2] + gap && currentPoints.y > area[1] - gap && currentPoints.y < area[3] + gap) {
  5621. currentIndex = index;
  5622. break;
  5623. }
  5624. }
  5625. }
  5626. return currentIndex;
  5627. }
  5628. return currentIndex;
  5629. }
  5630. function isInExactLegendArea(currentPoints, area) {
  5631. return currentPoints.x > area.start.x && currentPoints.x < area.end.x && currentPoints.y > area.start.y && currentPoints.y < area.end.y;
  5632. }
  5633. function isInExactChartArea(currentPoints, opts, config) {
  5634. return currentPoints.x <= opts.width - opts.area[1] + 10 && currentPoints.x >= opts.area[3] - 10 && currentPoints.y >= opts.area[0] && currentPoints.y <= opts.height - opts.area[2];
  5635. }
  5636. function findRadarChartCurrentIndex(currentPoints, radarData, count) {
  5637. var eachAngleArea = 2 * Math.PI / count;
  5638. var currentIndex = -1;
  5639. if (isInExactPieChartArea(currentPoints, radarData.center, radarData.radius)) {
  5640. var fixAngle = function fixAngle(angle) {
  5641. if (angle < 0) {
  5642. angle += 2 * Math.PI;
  5643. }
  5644. if (angle > 2 * Math.PI) {
  5645. angle -= 2 * Math.PI;
  5646. }
  5647. return angle;
  5648. };
  5649. var angle = Math.atan2(radarData.center.y - currentPoints.y, currentPoints.x - radarData.center.x);
  5650. angle = -1 * angle;
  5651. if (angle < 0) {
  5652. angle += 2 * Math.PI;
  5653. }
  5654. var angleList = radarData.angleList.map(function (item) {
  5655. item = fixAngle(-1 * item);
  5656. return item;
  5657. });
  5658. angleList.forEach(function (item, index) {
  5659. var rangeStart = fixAngle(item - eachAngleArea / 2);
  5660. var rangeEnd = fixAngle(item + eachAngleArea / 2);
  5661. if (rangeEnd < rangeStart) {
  5662. rangeEnd += 2 * Math.PI;
  5663. }
  5664. if (angle >= rangeStart && angle <= rangeEnd || angle + 2 * Math.PI >= rangeStart && angle + 2 * Math.PI <= rangeEnd) {
  5665. currentIndex = index;
  5666. }
  5667. });
  5668. }
  5669. return currentIndex;
  5670. }
  5671. function findFunnelChartCurrentIndex(currentPoints, funnelData) {
  5672. var currentIndex = -1;
  5673. for (var i = 0, len = funnelData.series.length; i < len; i++) {
  5674. var item = funnelData.series[i];
  5675. if (currentPoints.x > item.funnelArea[0] && currentPoints.x < item.funnelArea[2] && currentPoints.y > item.funnelArea[1] && currentPoints.y < item.funnelArea[3]) {
  5676. currentIndex = i;
  5677. break;
  5678. }
  5679. }
  5680. return currentIndex;
  5681. }
  5682. function findWordChartCurrentIndex(currentPoints, wordData) {
  5683. var currentIndex = -1;
  5684. for (var i = 0, len = wordData.length; i < len; i++) {
  5685. var item = wordData[i];
  5686. if (currentPoints.x > item.area[0] && currentPoints.x < item.area[2] && currentPoints.y > item.area[1] && currentPoints.y < item.area[3]) {
  5687. currentIndex = i;
  5688. break;
  5689. }
  5690. }
  5691. return currentIndex;
  5692. }
  5693. function findMapChartCurrentIndex(currentPoints, opts) {
  5694. var currentIndex = -1;
  5695. var cData = opts.chartData.mapData;
  5696. var data = opts.series;
  5697. var tmp = pointToCoordinate(currentPoints.y, currentPoints.x, cData.bounds, cData.scale, cData.xoffset, cData.yoffset);
  5698. var poi = [tmp.x, tmp.y];
  5699. for (var i = 0, len = data.length; i < len; i++) {
  5700. var item = data[i].geometry.coordinates;
  5701. if (isPoiWithinPoly(poi, item, opts.chartData.mapData.mercator)) {
  5702. currentIndex = i;
  5703. break;
  5704. }
  5705. }
  5706. return currentIndex;
  5707. }
  5708. function findRoseChartCurrentIndex(currentPoints, pieData, opts) {
  5709. var currentIndex = -1;
  5710. var series = getRoseDataPoints(opts._series_, opts.extra.rose.type, pieData.radius, pieData.radius);
  5711. if (pieData && pieData.center && isInExactPieChartArea(currentPoints, pieData.center, pieData.radius)) {
  5712. var angle = Math.atan2(pieData.center.y - currentPoints.y, currentPoints.x - pieData.center.x);
  5713. angle = -angle;
  5714. if (opts.extra.rose && opts.extra.rose.offsetAngle) {
  5715. angle = angle - opts.extra.rose.offsetAngle * Math.PI / 180;
  5716. }
  5717. for (var i = 0, len = series.length; i < len; i++) {
  5718. if (isInAngleRange(angle, series[i]._start_, series[i]._start_ + series[i]._rose_proportion_ * 2 * Math.PI)) {
  5719. currentIndex = i;
  5720. break;
  5721. }
  5722. }
  5723. }
  5724. return currentIndex;
  5725. }
  5726. function findPieChartCurrentIndex(currentPoints, pieData, opts) {
  5727. var currentIndex = -1;
  5728. var series = getPieDataPoints(pieData.series);
  5729. if (pieData && pieData.center && isInExactPieChartArea(currentPoints, pieData.center, pieData.radius)) {
  5730. var angle = Math.atan2(pieData.center.y - currentPoints.y, currentPoints.x - pieData.center.x);
  5731. angle = -angle;
  5732. if (opts.extra.pie && opts.extra.pie.offsetAngle) {
  5733. angle = angle - opts.extra.pie.offsetAngle * Math.PI / 180;
  5734. }
  5735. if (opts.extra.ring && opts.extra.ring.offsetAngle) {
  5736. angle = angle - opts.extra.ring.offsetAngle * Math.PI / 180;
  5737. }
  5738. for (var i = 0, len = series.length; i < len; i++) {
  5739. if (isInAngleRange(angle, series[i]._start_, series[i]._start_ + series[i]._proportion_ * 2 * Math.PI)) {
  5740. currentIndex = i;
  5741. break;
  5742. }
  5743. }
  5744. }
  5745. return currentIndex;
  5746. }
  5747. function isInExactPieChartArea(currentPoints, center, radius) {
  5748. return Math.pow(currentPoints.x - center.x, 2) + Math.pow(currentPoints.y - center.y, 2) <= Math.pow(radius, 2);
  5749. }
  5750. function splitPoints(points, eachSeries) {
  5751. var newPoints = [];
  5752. var items = [];
  5753. points.forEach(function (item, index) {
  5754. if (eachSeries.connectNulls) {
  5755. if (item !== null) {
  5756. items.push(item);
  5757. }
  5758. } else {
  5759. if (item !== null) {
  5760. items.push(item);
  5761. } else {
  5762. if (items.length) {
  5763. newPoints.push(items);
  5764. }
  5765. items = [];
  5766. }
  5767. }
  5768. });
  5769. if (items.length) {
  5770. newPoints.push(items);
  5771. }
  5772. return newPoints;
  5773. }
  5774. function calLegendData(series, opts, config, chartData, context) {
  5775. var legendData = {
  5776. area: {
  5777. start: {
  5778. x: 0,
  5779. y: 0 },
  5780. end: {
  5781. x: 0,
  5782. y: 0 },
  5783. width: 0,
  5784. height: 0,
  5785. wholeWidth: 0,
  5786. wholeHeight: 0 },
  5787. points: [],
  5788. widthArr: [],
  5789. heightArr: [] };
  5790. if (opts.legend.show === false) {
  5791. chartData.legendData = legendData;
  5792. return legendData;
  5793. }
  5794. var padding = opts.legend.padding * opts.pix;
  5795. var margin = opts.legend.margin * opts.pix;
  5796. var fontSize = opts.legend.fontSize ? opts.legend.fontSize * opts.pix : config.fontSize;
  5797. var shapeWidth = 15 * opts.pix;
  5798. var shapeRight = 5 * opts.pix;
  5799. var lineHeight = Math.max(opts.legend.lineHeight * opts.pix, fontSize);
  5800. if (opts.legend.position == 'top' || opts.legend.position == 'bottom') {
  5801. var legendList = [];
  5802. var widthCount = 0;
  5803. var widthCountArr = [];
  5804. var currentRow = [];
  5805. for (var i = 0; i < series.length; i++) {
  5806. var item = series[i];
  5807. var legendText = item.legendText ? item.legendText : item.name;
  5808. var itemWidth = shapeWidth + shapeRight + measureText(legendText || 'undefined', fontSize, context) + opts.legend.itemGap * opts.pix;
  5809. if (widthCount + itemWidth > opts.width - opts.area[1] - opts.area[3]) {
  5810. legendList.push(currentRow);
  5811. widthCountArr.push(widthCount - opts.legend.itemGap * opts.pix);
  5812. widthCount = itemWidth;
  5813. currentRow = [item];
  5814. } else {
  5815. widthCount += itemWidth;
  5816. currentRow.push(item);
  5817. }
  5818. }
  5819. if (currentRow.length) {
  5820. legendList.push(currentRow);
  5821. widthCountArr.push(widthCount - opts.legend.itemGap * opts.pix);
  5822. legendData.widthArr = widthCountArr;
  5823. var legendWidth = Math.max.apply(null, widthCountArr);
  5824. switch (opts.legend.float) {
  5825. case 'left':
  5826. legendData.area.start.x = opts.area[3];
  5827. legendData.area.end.x = opts.area[3] + legendWidth + 2 * padding;
  5828. break;
  5829. case 'right':
  5830. legendData.area.start.x = opts.width - opts.area[1] - legendWidth - 2 * padding;
  5831. legendData.area.end.x = opts.width - opts.area[1];
  5832. break;
  5833. default:
  5834. legendData.area.start.x = (opts.width - legendWidth) / 2 - padding;
  5835. legendData.area.end.x = (opts.width + legendWidth) / 2 + padding;}
  5836. legendData.area.width = legendWidth + 2 * padding;
  5837. legendData.area.wholeWidth = legendWidth + 2 * padding;
  5838. legendData.area.height = legendList.length * lineHeight + 2 * padding;
  5839. legendData.area.wholeHeight = legendList.length * lineHeight + 2 * padding + 2 * margin;
  5840. legendData.points = legendList;
  5841. }
  5842. } else {
  5843. var len = series.length;
  5844. var maxHeight = opts.height - opts.area[0] - opts.area[2] - 2 * margin - 2 * padding;
  5845. var maxLength = Math.min(Math.floor(maxHeight / lineHeight), len);
  5846. legendData.area.height = maxLength * lineHeight + padding * 2;
  5847. legendData.area.wholeHeight = maxLength * lineHeight + padding * 2;
  5848. switch (opts.legend.float) {
  5849. case 'top':
  5850. legendData.area.start.y = opts.area[0] + margin;
  5851. legendData.area.end.y = opts.area[0] + margin + legendData.area.height;
  5852. break;
  5853. case 'bottom':
  5854. legendData.area.start.y = opts.height - opts.area[2] - margin - legendData.area.height;
  5855. legendData.area.end.y = opts.height - opts.area[2] - margin;
  5856. break;
  5857. default:
  5858. legendData.area.start.y = (opts.height - legendData.area.height) / 2;
  5859. legendData.area.end.y = (opts.height + legendData.area.height) / 2;}
  5860. var lineNum = len % maxLength === 0 ? len / maxLength : Math.floor(len / maxLength + 1);
  5861. var _currentRow = [];
  5862. for (var _i6 = 0; _i6 < lineNum; _i6++) {
  5863. var temp = series.slice(_i6 * maxLength, _i6 * maxLength + maxLength);
  5864. _currentRow.push(temp);
  5865. }
  5866. legendData.points = _currentRow;
  5867. if (_currentRow.length) {
  5868. for (var _i7 = 0; _i7 < _currentRow.length; _i7++) {
  5869. var _item = _currentRow[_i7];
  5870. var maxWidth = 0;
  5871. for (var j = 0; j < _item.length; j++) {
  5872. var _itemWidth = shapeWidth + shapeRight + measureText(_item[j].name || 'undefined', fontSize, context) + opts.legend.itemGap * opts.pix;
  5873. if (_itemWidth > maxWidth) {
  5874. maxWidth = _itemWidth;
  5875. }
  5876. }
  5877. legendData.widthArr.push(maxWidth);
  5878. legendData.heightArr.push(_item.length * lineHeight + padding * 2);
  5879. }
  5880. var _legendWidth = 0;
  5881. for (var _i8 = 0; _i8 < legendData.widthArr.length; _i8++) {
  5882. _legendWidth += legendData.widthArr[_i8];
  5883. }
  5884. legendData.area.width = _legendWidth - opts.legend.itemGap * opts.pix + 2 * padding;
  5885. legendData.area.wholeWidth = legendData.area.width + padding;
  5886. }
  5887. }
  5888. switch (opts.legend.position) {
  5889. case 'top':
  5890. legendData.area.start.y = opts.area[0] + margin;
  5891. legendData.area.end.y = opts.area[0] + margin + legendData.area.height;
  5892. break;
  5893. case 'bottom':
  5894. legendData.area.start.y = opts.height - opts.area[2] - legendData.area.height - margin;
  5895. legendData.area.end.y = opts.height - opts.area[2] - margin;
  5896. break;
  5897. case 'left':
  5898. legendData.area.start.x = opts.area[3];
  5899. legendData.area.end.x = opts.area[3] + legendData.area.width;
  5900. break;
  5901. case 'right':
  5902. legendData.area.start.x = opts.width - opts.area[1] - legendData.area.width;
  5903. legendData.area.end.x = opts.width - opts.area[1];
  5904. break;}
  5905. chartData.legendData = legendData;
  5906. return legendData;
  5907. }
  5908. function calCategoriesData(categories, opts, config, eachSpacing, context) {
  5909. var result = {
  5910. angle: 0,
  5911. xAxisHeight: config.xAxisHeight };
  5912. var fontSize = opts.xAxis.fontSize * opts.pix || config.fontSize;
  5913. var categoriesTextLenth = categories.map(function (item, index) {
  5914. var xitem = opts.xAxis.formatter ? opts.xAxis.formatter(item, index, opts) : item;
  5915. return measureText(String(xitem), fontSize, context);
  5916. });
  5917. var maxTextLength = Math.max.apply(this, categoriesTextLenth);
  5918. if (opts.xAxis.rotateLabel == true) {
  5919. result.angle = opts.xAxis.rotateAngle * Math.PI / 180;
  5920. var tempHeight = 2 * config.xAxisTextPadding + Math.abs(maxTextLength * Math.sin(result.angle));
  5921. tempHeight = tempHeight < fontSize + 2 * config.xAxisTextPadding ? tempHeight + 2 * config.xAxisTextPadding : tempHeight;
  5922. if (opts.enableScroll == true && opts.xAxis.scrollShow == true) {
  5923. tempHeight += 12 * opts.pix;
  5924. }
  5925. result.xAxisHeight = tempHeight;
  5926. }
  5927. if (opts.xAxis.disabled) {
  5928. result.xAxisHeight = 0;
  5929. }
  5930. return result;
  5931. }
  5932. function getXAxisTextList(series, opts, config, stack) {
  5933. var index = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : -1;
  5934. var data;
  5935. if (stack == 'stack') {
  5936. data = dataCombineStack(series, opts.categories.length);
  5937. } else {
  5938. data = dataCombine(series);
  5939. }
  5940. var sorted = [];
  5941. // remove null from data
  5942. data = data.filter(function (item) {
  5943. //return item !== null;
  5944. if (typeof item === 'object' && item !== null) {
  5945. if (item.constructor.toString().indexOf('Array') > -1) {
  5946. return item !== null;
  5947. } else {
  5948. return item.value !== null;
  5949. }
  5950. } else {
  5951. return item !== null;
  5952. }
  5953. });
  5954. data.map(function (item) {
  5955. if (typeof item === 'object') {
  5956. if (item.constructor.toString().indexOf('Array') > -1) {
  5957. if (opts.type == 'candle') {
  5958. item.map(function (subitem) {
  5959. sorted.push(subitem);
  5960. });
  5961. } else {
  5962. sorted.push(item[0]);
  5963. }
  5964. } else {
  5965. sorted.push(item.value);
  5966. }
  5967. } else {
  5968. sorted.push(item);
  5969. }
  5970. });
  5971. var minData = 0;
  5972. var maxData = 0;
  5973. if (sorted.length > 0) {
  5974. minData = Math.min.apply(this, sorted);
  5975. maxData = Math.max.apply(this, sorted);
  5976. }
  5977. //为了兼容v1.9.0之前的项目
  5978. if (index > -1) {
  5979. if (typeof opts.xAxis.data[index].min === 'number') {
  5980. minData = Math.min(opts.xAxis.data[index].min, minData);
  5981. }
  5982. if (typeof opts.xAxis.data[index].max === 'number') {
  5983. maxData = Math.max(opts.xAxis.data[index].max, maxData);
  5984. }
  5985. } else {
  5986. if (typeof opts.xAxis.min === 'number') {
  5987. minData = Math.min(opts.xAxis.min, minData);
  5988. }
  5989. if (typeof opts.xAxis.max === 'number') {
  5990. maxData = Math.max(opts.xAxis.max, maxData);
  5991. }
  5992. }
  5993. if (minData === maxData) {
  5994. var rangeSpan = maxData || 10;
  5995. maxData += rangeSpan;
  5996. }
  5997. //var dataRange = getDataRange(minData, maxData);
  5998. var minRange = minData;
  5999. var maxRange = maxData;
  6000. var range = [];
  6001. var eachRange = (maxRange - minRange) / opts.xAxis.splitNumber;
  6002. for (var i = 0; i <= opts.xAxis.splitNumber; i++) {
  6003. range.push(minRange + eachRange * i);
  6004. }
  6005. return range;
  6006. }
  6007. function calXAxisData(series, opts, config, context) {
  6008. //堆叠图重算Y轴
  6009. var columnstyle = assign({}, {
  6010. type: "" },
  6011. opts.extra.bar);
  6012. var result = {
  6013. angle: 0,
  6014. xAxisHeight: config.xAxisHeight };
  6015. result.ranges = getXAxisTextList(series, opts, config, columnstyle.type);
  6016. result.rangesFormat = result.ranges.map(function (item) {
  6017. //item = opts.xAxis.formatter ? opts.xAxis.formatter(item) : util.toFixed(item, 2);
  6018. item = util.toFixed(item, 2);
  6019. return item;
  6020. });
  6021. var xAxisScaleValues = result.ranges.map(function (item) {
  6022. // 如果刻度值是浮点数,则保留两位小数
  6023. item = util.toFixed(item, 2);
  6024. // 若有自定义格式则调用自定义的格式化函数
  6025. //item = opts.xAxis.formatter ? opts.xAxis.formatter(Number(item)) : item;
  6026. return item;
  6027. });
  6028. result = Object.assign(result, getXAxisPoints(xAxisScaleValues, opts, config));
  6029. // 计算X轴刻度的属性譬如每个刻度的间隔,刻度的起始点\结束点以及总长
  6030. var eachSpacing = result.eachSpacing;
  6031. var textLength = xAxisScaleValues.map(function (item) {
  6032. return measureText(item, opts.xAxis.fontSize * opts.pix || config.fontSize, context);
  6033. });
  6034. // get max length of categories text
  6035. var maxTextLength = Math.max.apply(this, textLength);
  6036. // 如果刻度值文本内容过长,则将其逆时针旋转45°
  6037. if (maxTextLength + 2 * config.xAxisTextPadding > eachSpacing) {
  6038. result.angle = 45 * Math.PI / 180;
  6039. result.xAxisHeight = 2 * config.xAxisTextPadding + maxTextLength * Math.sin(result.angle);
  6040. }
  6041. if (opts.xAxis.disabled === true) {
  6042. result.xAxisHeight = 0;
  6043. }
  6044. return result;
  6045. }
  6046. function getRadarDataPoints(angleList, center, radius, series, opts) {
  6047. var process = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
  6048. var radarOption = opts.extra.radar || {};
  6049. radarOption.max = radarOption.max || 0;
  6050. var maxData = Math.max(radarOption.max, Math.max.apply(null, dataCombine(series)));
  6051. var data = [];var _loop2 = function _loop2(
  6052. i) {
  6053. var each = series[i];
  6054. var listItem = {};
  6055. listItem.color = each.color;
  6056. listItem.legendShape = each.legendShape;
  6057. listItem.pointShape = each.pointShape;
  6058. listItem.data = [];
  6059. each.data.forEach(function (item, index) {
  6060. var tmp = {};
  6061. tmp.angle = angleList[index];
  6062. tmp.proportion = item / maxData;
  6063. tmp.value = item;
  6064. tmp.position = convertCoordinateOrigin(radius * tmp.proportion * process * Math.cos(tmp.angle), radius * tmp.proportion * process * Math.sin(tmp.angle), center);
  6065. listItem.data.push(tmp);
  6066. });
  6067. data.push(listItem);};for (var i = 0; i < series.length; i++) {_loop2(i);
  6068. }
  6069. return data;
  6070. }
  6071. function getPieDataPoints(series, radius) {
  6072. var process = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
  6073. var count = 0;
  6074. var _start_ = 0;
  6075. for (var i = 0; i < series.length; i++) {
  6076. var item = series[i];
  6077. item.data = item.data === null ? 0 : item.data;
  6078. count += item.data;
  6079. }
  6080. for (var _i9 = 0; _i9 < series.length; _i9++) {
  6081. var _item2 = series[_i9];
  6082. _item2.data = _item2.data === null ? 0 : _item2.data;
  6083. if (count === 0) {
  6084. _item2._proportion_ = 1 / series.length * process;
  6085. } else {
  6086. _item2._proportion_ = _item2.data / count * process;
  6087. }
  6088. _item2._radius_ = radius;
  6089. }
  6090. for (var _i10 = 0; _i10 < series.length; _i10++) {
  6091. var _item3 = series[_i10];
  6092. _item3._start_ = _start_;
  6093. _start_ += 2 * _item3._proportion_ * Math.PI;
  6094. }
  6095. return series;
  6096. }
  6097. function getFunnelDataPoints(series, radius, type, eachSpacing) {
  6098. var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
  6099. series = series.sort(function (a, b) {
  6100. return parseInt(b.data) - parseInt(a.data);
  6101. });
  6102. for (var i = 0; i < series.length; i++) {
  6103. if (type == 'funnel') {
  6104. series[i].radius = series[i].data / series[0].data * radius * process;
  6105. } else {
  6106. series[i].radius = eachSpacing * (series.length - i) / (eachSpacing * series.length) * radius * process;
  6107. }
  6108. series[i]._proportion_ = series[i].data / series[0].data;
  6109. }
  6110. if (type !== 'pyramid') {
  6111. series.reverse();
  6112. }
  6113. return series;
  6114. }
  6115. function getRoseDataPoints(series, type, minRadius, radius) {
  6116. var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
  6117. var count = 0;
  6118. var _start_ = 0;
  6119. var dataArr = [];
  6120. for (var i = 0; i < series.length; i++) {
  6121. var item = series[i];
  6122. item.data = item.data === null ? 0 : item.data;
  6123. count += item.data;
  6124. dataArr.push(item.data);
  6125. }
  6126. var minData = Math.min.apply(null, dataArr);
  6127. var maxData = Math.max.apply(null, dataArr);
  6128. var radiusLength = radius - minRadius;
  6129. for (var _i11 = 0; _i11 < series.length; _i11++) {
  6130. var _item4 = series[_i11];
  6131. _item4.data = _item4.data === null ? 0 : _item4.data;
  6132. if (count === 0) {
  6133. _item4._proportion_ = 1 / series.length * process;
  6134. _item4._rose_proportion_ = 1 / series.length * process;
  6135. } else {
  6136. _item4._proportion_ = _item4.data / count * process;
  6137. if (type == 'area') {
  6138. _item4._rose_proportion_ = 1 / series.length * process;
  6139. } else {
  6140. _item4._rose_proportion_ = _item4.data / count * process;
  6141. }
  6142. }
  6143. _item4._radius_ = minRadius + radiusLength * ((_item4.data - minData) / (maxData - minData)) || radius;
  6144. }
  6145. for (var _i12 = 0; _i12 < series.length; _i12++) {
  6146. var _item5 = series[_i12];
  6147. _item5._start_ = _start_;
  6148. _start_ += 2 * _item5._rose_proportion_ * Math.PI;
  6149. }
  6150. return series;
  6151. }
  6152. function getArcbarDataPoints(series, arcbarOption) {
  6153. var process = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
  6154. if (process == 1) {
  6155. process = 0.999999;
  6156. }
  6157. for (var i = 0; i < series.length; i++) {
  6158. var item = series[i];
  6159. item.data = item.data === null ? 0 : item.data;
  6160. var totalAngle = void 0;
  6161. if (arcbarOption.type == 'circle') {
  6162. totalAngle = 2;
  6163. } else {
  6164. if (arcbarOption.endAngle < arcbarOption.startAngle) {
  6165. totalAngle = 2 + arcbarOption.endAngle - arcbarOption.startAngle;
  6166. } else {
  6167. totalAngle = arcbarOption.startAngle - arcbarOption.endAngle;
  6168. }
  6169. }
  6170. item._proportion_ = totalAngle * item.data * process + arcbarOption.startAngle;
  6171. if (item._proportion_ >= 2) {
  6172. item._proportion_ = item._proportion_ % 2;
  6173. }
  6174. }
  6175. return series;
  6176. }
  6177. function getGaugeArcbarDataPoints(series, arcbarOption) {
  6178. var process = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
  6179. if (process == 1) {
  6180. process = 0.999999;
  6181. }
  6182. for (var i = 0; i < series.length; i++) {
  6183. var item = series[i];
  6184. item.data = item.data === null ? 0 : item.data;
  6185. var totalAngle = void 0;
  6186. if (arcbarOption.type == 'circle') {
  6187. totalAngle = 2;
  6188. } else {
  6189. if (arcbarOption.endAngle < arcbarOption.startAngle) {
  6190. totalAngle = 2 + arcbarOption.endAngle - arcbarOption.startAngle;
  6191. } else {
  6192. totalAngle = arcbarOption.startAngle - arcbarOption.endAngle;
  6193. }
  6194. }
  6195. item._proportion_ = totalAngle * item.data * process + arcbarOption.startAngle;
  6196. if (item._proportion_ >= 2) {
  6197. item._proportion_ = item._proportion_ % 2;
  6198. }
  6199. }
  6200. return series;
  6201. }
  6202. function getGaugeAxisPoints(categories, startAngle, endAngle) {
  6203. var totalAngle = startAngle - endAngle + 1;
  6204. var tempStartAngle = startAngle;
  6205. for (var i = 0; i < categories.length; i++) {
  6206. categories[i].value = categories[i].value === null ? 0 : categories[i].value;
  6207. categories[i]._startAngle_ = tempStartAngle;
  6208. categories[i]._endAngle_ = totalAngle * categories[i].value + startAngle;
  6209. if (categories[i]._endAngle_ >= 2) {
  6210. categories[i]._endAngle_ = categories[i]._endAngle_ % 2;
  6211. }
  6212. tempStartAngle = categories[i]._endAngle_;
  6213. }
  6214. return categories;
  6215. }
  6216. function getGaugeDataPoints(series, categories, gaugeOption) {
  6217. var process = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
  6218. for (var i = 0; i < series.length; i++) {
  6219. var item = series[i];
  6220. item.data = item.data === null ? 0 : item.data;
  6221. if (gaugeOption.pointer.color == 'auto') {
  6222. for (var _i13 = 0; _i13 < categories.length; _i13++) {
  6223. if (item.data <= categories[_i13].value) {
  6224. item.color = categories[_i13].color;
  6225. break;
  6226. }
  6227. }
  6228. } else {
  6229. item.color = gaugeOption.pointer.color;
  6230. }
  6231. var totalAngle = gaugeOption.startAngle - gaugeOption.endAngle + 1;
  6232. item._endAngle_ = totalAngle * item.data + gaugeOption.startAngle;
  6233. item._oldAngle_ = gaugeOption.oldAngle;
  6234. if (gaugeOption.oldAngle < gaugeOption.endAngle) {
  6235. item._oldAngle_ += 2;
  6236. }
  6237. if (item.data >= gaugeOption.oldData) {
  6238. item._proportion_ = (item._endAngle_ - item._oldAngle_) * process + gaugeOption.oldAngle;
  6239. } else {
  6240. item._proportion_ = item._oldAngle_ - (item._oldAngle_ - item._endAngle_) * process;
  6241. }
  6242. if (item._proportion_ >= 2) {
  6243. item._proportion_ = item._proportion_ % 2;
  6244. }
  6245. }
  6246. return series;
  6247. }
  6248. function getPieTextMaxLength(series, config, context, opts) {
  6249. series = getPieDataPoints(series);
  6250. var maxLength = 0;
  6251. for (var i = 0; i < series.length; i++) {
  6252. var item = series[i];
  6253. var text = item.formatter ? item.formatter(+item._proportion_.toFixed(2)) : util.toFixed(item._proportion_ * 100) + '%';
  6254. maxLength = Math.max(maxLength, measureText(text, item.textSize * opts.pix || config.fontSize, context));
  6255. }
  6256. return maxLength;
  6257. }
  6258. function fixColumeData(points, eachSpacing, columnLen, index, config, opts) {
  6259. return points.map(function (item) {
  6260. if (item === null) {
  6261. return null;
  6262. }
  6263. var seriesGap = 0;
  6264. var categoryGap = 0;
  6265. if (opts.type == 'mix') {
  6266. seriesGap = opts.extra.mix.column.seriesGap * opts.pix || 0;
  6267. categoryGap = opts.extra.mix.column.categoryGap * opts.pix || 0;
  6268. } else {
  6269. seriesGap = opts.extra.column.seriesGap * opts.pix || 0;
  6270. categoryGap = opts.extra.column.categoryGap * opts.pix || 0;
  6271. }
  6272. seriesGap = Math.min(seriesGap, eachSpacing / columnLen);
  6273. categoryGap = Math.min(categoryGap, eachSpacing / columnLen);
  6274. item.width = Math.ceil((eachSpacing - 2 * categoryGap - seriesGap * (columnLen - 1)) / columnLen);
  6275. if (opts.extra.mix && opts.extra.mix.column.width && +opts.extra.mix.column.width > 0) {
  6276. item.width = Math.min(item.width, +opts.extra.mix.column.width * opts.pix);
  6277. }
  6278. if (opts.extra.column && opts.extra.column.width && +opts.extra.column.width > 0) {
  6279. item.width = Math.min(item.width, +opts.extra.column.width * opts.pix);
  6280. }
  6281. if (item.width <= 0) {
  6282. item.width = 1;
  6283. }
  6284. item.x += (index + 0.5 - columnLen / 2) * (item.width + seriesGap);
  6285. return item;
  6286. });
  6287. }
  6288. function fixBarData(points, eachSpacing, columnLen, index, config, opts) {
  6289. return points.map(function (item) {
  6290. if (item === null) {
  6291. return null;
  6292. }
  6293. var seriesGap = 0;
  6294. var categoryGap = 0;
  6295. seriesGap = opts.extra.bar.seriesGap * opts.pix || 0;
  6296. categoryGap = opts.extra.bar.categoryGap * opts.pix || 0;
  6297. seriesGap = Math.min(seriesGap, eachSpacing / columnLen);
  6298. categoryGap = Math.min(categoryGap, eachSpacing / columnLen);
  6299. item.width = Math.ceil((eachSpacing - 2 * categoryGap - seriesGap * (columnLen - 1)) / columnLen);
  6300. if (opts.extra.bar && opts.extra.bar.width && +opts.extra.bar.width > 0) {
  6301. item.width = Math.min(item.width, +opts.extra.bar.width * opts.pix);
  6302. }
  6303. if (item.width <= 0) {
  6304. item.width = 1;
  6305. }
  6306. item.y += (index + 0.5 - columnLen / 2) * (item.width + seriesGap);
  6307. return item;
  6308. });
  6309. }
  6310. function fixColumeMeterData(points, eachSpacing, columnLen, index, config, opts, border) {
  6311. var categoryGap = opts.extra.column.categoryGap * opts.pix || 0;
  6312. return points.map(function (item) {
  6313. if (item === null) {
  6314. return null;
  6315. }
  6316. item.width = eachSpacing - 2 * categoryGap;
  6317. if (opts.extra.column && opts.extra.column.width && +opts.extra.column.width > 0) {
  6318. item.width = Math.min(item.width, +opts.extra.column.width * opts.pix);
  6319. }
  6320. if (index > 0) {
  6321. item.width -= border;
  6322. }
  6323. return item;
  6324. });
  6325. }
  6326. function fixColumeStackData(points, eachSpacing, columnLen, index, config, opts, series) {
  6327. var categoryGap = opts.extra.column.categoryGap * opts.pix || 0;
  6328. return points.map(function (item, indexn) {
  6329. if (item === null) {
  6330. return null;
  6331. }
  6332. item.width = Math.ceil(eachSpacing - 2 * categoryGap);
  6333. if (opts.extra.column && opts.extra.column.width && +opts.extra.column.width > 0) {
  6334. item.width = Math.min(item.width, +opts.extra.column.width * opts.pix);
  6335. }
  6336. if (item.width <= 0) {
  6337. item.width = 1;
  6338. }
  6339. return item;
  6340. });
  6341. }
  6342. function fixBarStackData(points, eachSpacing, columnLen, index, config, opts, series) {
  6343. var categoryGap = opts.extra.bar.categoryGap * opts.pix || 0;
  6344. return points.map(function (item, indexn) {
  6345. if (item === null) {
  6346. return null;
  6347. }
  6348. item.width = Math.ceil(eachSpacing - 2 * categoryGap);
  6349. if (opts.extra.bar && opts.extra.bar.width && +opts.extra.bar.width > 0) {
  6350. item.width = Math.min(item.width, +opts.extra.bar.width * opts.pix);
  6351. }
  6352. if (item.width <= 0) {
  6353. item.width = 1;
  6354. }
  6355. return item;
  6356. });
  6357. }
  6358. function getXAxisPoints(categories, opts, config) {
  6359. var spacingValid = opts.width - opts.area[1] - opts.area[3];
  6360. var dataCount = opts.enableScroll ? Math.min(opts.xAxis.itemCount, categories.length) : categories.length;
  6361. if ((opts.type == 'line' || opts.type == 'area' || opts.type == 'scatter' || opts.type == 'bubble' || opts.type == 'bar') && dataCount > 1 && opts.xAxis.boundaryGap == 'justify') {
  6362. dataCount -= 1;
  6363. }
  6364. var widthRatio = 0;
  6365. if (opts.type == 'mount' && opts.extra && opts.extra.mount && opts.extra.mount.widthRatio && opts.extra.mount.widthRatio > 1) {
  6366. if (opts.extra.mount.widthRatio > 2) opts.extra.mount.widthRatio = 2;
  6367. widthRatio = opts.extra.mount.widthRatio - 1;
  6368. dataCount += widthRatio;
  6369. }
  6370. var eachSpacing = spacingValid / dataCount;
  6371. var xAxisPoints = [];
  6372. var startX = opts.area[3];
  6373. var endX = opts.width - opts.area[1];
  6374. categories.forEach(function (item, index) {
  6375. xAxisPoints.push(startX + widthRatio / 2 * eachSpacing + index * eachSpacing);
  6376. });
  6377. if (opts.xAxis.boundaryGap !== 'justify') {
  6378. if (opts.enableScroll === true) {
  6379. xAxisPoints.push(startX + widthRatio * eachSpacing + categories.length * eachSpacing);
  6380. } else {
  6381. xAxisPoints.push(endX);
  6382. }
  6383. }
  6384. return {
  6385. xAxisPoints: xAxisPoints,
  6386. startX: startX,
  6387. endX: endX,
  6388. eachSpacing: eachSpacing };
  6389. }
  6390. function getCandleDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config) {
  6391. var process = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 1;
  6392. var points = [];
  6393. var validHeight = opts.height - opts.area[0] - opts.area[2];
  6394. data.forEach(function (item, index) {
  6395. if (item === null) {
  6396. points.push(null);
  6397. } else {
  6398. var cPoints = [];
  6399. item.forEach(function (items, indexs) {
  6400. var point = {};
  6401. point.x = xAxisPoints[index] + Math.round(eachSpacing / 2);
  6402. var value = items.value || items;
  6403. var height = validHeight * (value - minRange) / (maxRange - minRange);
  6404. height *= process;
  6405. point.y = opts.height - Math.round(height) - opts.area[2];
  6406. cPoints.push(point);
  6407. });
  6408. points.push(cPoints);
  6409. }
  6410. });
  6411. return points;
  6412. }
  6413. function getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config) {
  6414. var process = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 1;
  6415. var boundaryGap = 'center';
  6416. if (opts.type == 'line' || opts.type == 'area' || opts.type == 'scatter' || opts.type == 'bubble') {
  6417. boundaryGap = opts.xAxis.boundaryGap;
  6418. }
  6419. var points = [];
  6420. var validHeight = opts.height - opts.area[0] - opts.area[2];
  6421. var validWidth = opts.width - opts.area[1] - opts.area[3];
  6422. data.forEach(function (item, index) {
  6423. if (item === null) {
  6424. points.push(null);
  6425. } else {
  6426. var point = {};
  6427. point.color = item.color;
  6428. point.x = xAxisPoints[index];
  6429. var value = item;
  6430. if (typeof item === 'object' && item !== null) {
  6431. if (item.constructor.toString().indexOf('Array') > -1) {
  6432. var xranges, xminRange, xmaxRange;
  6433. xranges = [].concat(opts.chartData.xAxisData.ranges);
  6434. xminRange = xranges.shift();
  6435. xmaxRange = xranges.pop();
  6436. value = item[1];
  6437. point.x = opts.area[3] + validWidth * (item[0] - xminRange) / (xmaxRange - xminRange);
  6438. if (opts.type == 'bubble') {
  6439. point.r = item[2];
  6440. point.t = item[3];
  6441. }
  6442. } else {
  6443. value = item.value;
  6444. }
  6445. }
  6446. if (boundaryGap == 'center') {
  6447. point.x += eachSpacing / 2;
  6448. }
  6449. var height = validHeight * (value - minRange) / (maxRange - minRange);
  6450. height *= process;
  6451. point.y = opts.height - height - opts.area[2];
  6452. points.push(point);
  6453. }
  6454. });
  6455. return points;
  6456. }
  6457. function getMountDataPoints(series, minRange, maxRange, xAxisPoints, eachSpacing, opts, mountOption) {
  6458. var process = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 1;
  6459. var points = [];
  6460. var validHeight = opts.height - opts.area[0] - opts.area[2];
  6461. var validWidth = opts.width - opts.area[1] - opts.area[3];
  6462. var mountWidth = eachSpacing * mountOption.widthRatio;
  6463. series.forEach(function (item, index) {
  6464. if (item === null) {
  6465. points.push(null);
  6466. } else {
  6467. var point = {};
  6468. point.color = item.color;
  6469. point.x = xAxisPoints[index];
  6470. point.x += eachSpacing / 2;
  6471. var value = item.data;
  6472. var height = validHeight * (value - minRange) / (maxRange - minRange);
  6473. height *= process;
  6474. point.y = opts.height - height - opts.area[2];
  6475. point.value = value;
  6476. point.width = mountWidth;
  6477. points.push(point);
  6478. }
  6479. });
  6480. return points;
  6481. }
  6482. function getBarDataPoints(data, minRange, maxRange, yAxisPoints, eachSpacing, opts, config) {
  6483. var process = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 1;
  6484. var points = [];
  6485. var validHeight = opts.height - opts.area[0] - opts.area[2];
  6486. var validWidth = opts.width - opts.area[1] - opts.area[3];
  6487. data.forEach(function (item, index) {
  6488. if (item === null) {
  6489. points.push(null);
  6490. } else {
  6491. var point = {};
  6492. point.color = item.color;
  6493. point.y = yAxisPoints[index];
  6494. var value = item;
  6495. if (typeof item === 'object' && item !== null) {
  6496. value = item.value;
  6497. }
  6498. var height = validWidth * (value - minRange) / (maxRange - minRange);
  6499. height *= process;
  6500. point.height = height;
  6501. point.value = value;
  6502. point.x = height + opts.area[3];
  6503. points.push(point);
  6504. }
  6505. });
  6506. return points;
  6507. }
  6508. function getStackDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, seriesIndex, stackSeries) {
  6509. var process = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : 1;
  6510. var points = [];
  6511. var validHeight = opts.height - opts.area[0] - opts.area[2];
  6512. data.forEach(function (item, index) {
  6513. if (item === null) {
  6514. points.push(null);
  6515. } else {
  6516. var point = {};
  6517. point.color = item.color;
  6518. point.x = xAxisPoints[index] + Math.round(eachSpacing / 2);
  6519. if (seriesIndex > 0) {
  6520. var value = 0;
  6521. for (var i = 0; i <= seriesIndex; i++) {
  6522. value += stackSeries[i].data[index];
  6523. }
  6524. var value0 = value - item;
  6525. var height = validHeight * (value - minRange) / (maxRange - minRange);
  6526. var height0 = validHeight * (value0 - minRange) / (maxRange - minRange);
  6527. } else {
  6528. var value = item;
  6529. var height = validHeight * (value - minRange) / (maxRange - minRange);
  6530. var height0 = 0;
  6531. }
  6532. var heightc = height0;
  6533. height *= process;
  6534. heightc *= process;
  6535. point.y = opts.height - Math.round(height) - opts.area[2];
  6536. point.y0 = opts.height - Math.round(heightc) - opts.area[2];
  6537. points.push(point);
  6538. }
  6539. });
  6540. return points;
  6541. }
  6542. function getBarStackDataPoints(data, minRange, maxRange, yAxisPoints, eachSpacing, opts, config, seriesIndex, stackSeries) {
  6543. var process = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : 1;
  6544. var points = [];
  6545. var validHeight = opts.width - opts.area[1] - opts.area[3];
  6546. data.forEach(function (item, index) {
  6547. if (item === null) {
  6548. points.push(null);
  6549. } else {
  6550. var point = {};
  6551. point.color = item.color;
  6552. point.y = yAxisPoints[index];
  6553. if (seriesIndex > 0) {
  6554. var value = 0;
  6555. for (var i = 0; i <= seriesIndex; i++) {
  6556. value += stackSeries[i].data[index];
  6557. }
  6558. var value0 = value - item;
  6559. var height = validHeight * (value - minRange) / (maxRange - minRange);
  6560. var height0 = validHeight * (value0 - minRange) / (maxRange - minRange);
  6561. } else {
  6562. var value = item;
  6563. var height = validHeight * (value - minRange) / (maxRange - minRange);
  6564. var height0 = 0;
  6565. }
  6566. var heightc = height0;
  6567. height *= process;
  6568. heightc *= process;
  6569. point.height = height - heightc;
  6570. point.x = opts.area[3] + height;
  6571. point.x0 = opts.area[3] + heightc;
  6572. points.push(point);
  6573. }
  6574. });
  6575. return points;
  6576. }
  6577. function getYAxisTextList(series, opts, config, stack, yData) {
  6578. var index = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : -1;
  6579. var data;
  6580. if (stack == 'stack') {
  6581. data = dataCombineStack(series, opts.categories.length);
  6582. } else {
  6583. data = dataCombine(series);
  6584. }
  6585. var sorted = [];
  6586. // remove null from data
  6587. data = data.filter(function (item) {
  6588. //return item !== null;
  6589. if (typeof item === 'object' && item !== null) {
  6590. if (item.constructor.toString().indexOf('Array') > -1) {
  6591. return item !== null;
  6592. } else {
  6593. return item.value !== null;
  6594. }
  6595. } else {
  6596. return item !== null;
  6597. }
  6598. });
  6599. data.map(function (item) {
  6600. if (typeof item === 'object') {
  6601. if (item.constructor.toString().indexOf('Array') > -1) {
  6602. if (opts.type == 'candle') {
  6603. item.map(function (subitem) {
  6604. sorted.push(subitem);
  6605. });
  6606. } else {
  6607. sorted.push(item[1]);
  6608. }
  6609. } else {
  6610. sorted.push(item.value);
  6611. }
  6612. } else {
  6613. sorted.push(item);
  6614. }
  6615. });
  6616. var minData = yData.min || 0;
  6617. var maxData = yData.max || 0;
  6618. if (sorted.length > 0) {
  6619. minData = Math.min.apply(this, sorted);
  6620. maxData = Math.max.apply(this, sorted);
  6621. }
  6622. if (minData === maxData) {
  6623. // var rangeSpan = maxData || 10;
  6624. // maxData += rangeSpan;
  6625. if (maxData == 0) {
  6626. maxData = 10;
  6627. } else {
  6628. minData = 0;
  6629. }
  6630. }
  6631. var dataRange = getDataRange(minData, maxData);
  6632. var minRange = yData.min === undefined || yData.min === null ? dataRange.minRange : yData.min;
  6633. var maxRange = yData.max === undefined || yData.max === null ? dataRange.maxRange : yData.max;
  6634. var range = [];
  6635. var eachRange = (maxRange - minRange) / opts.yAxis.splitNumber;
  6636. for (var i = 0; i <= opts.yAxis.splitNumber; i++) {
  6637. range.push(minRange + eachRange * i);
  6638. }
  6639. return range.reverse();
  6640. }
  6641. function calYAxisData(series, opts, config, context) {
  6642. //堆叠图重算Y轴
  6643. var columnstyle = assign({}, {
  6644. type: "" },
  6645. opts.extra.column);
  6646. //如果是多Y轴,重新计算
  6647. var YLength = opts.yAxis.data.length;
  6648. var newSeries = new Array(YLength);
  6649. if (YLength > 0) {
  6650. for (var i = 0; i < YLength; i++) {
  6651. newSeries[i] = [];
  6652. for (var j = 0; j < series.length; j++) {
  6653. if (series[j].index == i) {
  6654. newSeries[i].push(series[j]);
  6655. }
  6656. }
  6657. }
  6658. var rangesArr = new Array(YLength);
  6659. var rangesFormatArr = new Array(YLength);
  6660. var yAxisWidthArr = new Array(YLength);var _loop3 = function _loop3(
  6661. _i14) {
  6662. var yData = opts.yAxis.data[_i14];
  6663. //如果总开关不显示,强制每个Y轴为不显示
  6664. if (opts.yAxis.disabled == true) {
  6665. yData.disabled = true;
  6666. }
  6667. if (yData.type === 'categories') {
  6668. if (!yData.formatter) {
  6669. yData.formatter = function (val, index, opts) {return val + (yData.unit || '');};
  6670. }
  6671. yData.categories = yData.categories || opts.categories;
  6672. rangesArr[_i14] = yData.categories;
  6673. } else {
  6674. if (!yData.formatter) {
  6675. yData.formatter = function (val, index, opts) {return val.toFixed(yData.tofix) + (yData.unit || '');};
  6676. }
  6677. rangesArr[_i14] = getYAxisTextList(newSeries[_i14], opts, config, columnstyle.type, yData, _i14);
  6678. }
  6679. var yAxisFontSizes = yData.fontSize * opts.pix || config.fontSize;
  6680. yAxisWidthArr[_i14] = {
  6681. position: yData.position ? yData.position : 'left',
  6682. width: 0 };
  6683. rangesFormatArr[_i14] = rangesArr[_i14].map(function (items, index) {
  6684. items = yData.formatter(items, index, opts);
  6685. yAxisWidthArr[_i14].width = Math.max(yAxisWidthArr[_i14].width, measureText(items, yAxisFontSizes, context) + 5);
  6686. return items;
  6687. });
  6688. var calibration = yData.calibration ? 4 * opts.pix : 0;
  6689. yAxisWidthArr[_i14].width += calibration + 3 * opts.pix;
  6690. if (yData.disabled === true) {
  6691. yAxisWidthArr[_i14].width = 0;
  6692. }};for (var _i14 = 0; _i14 < YLength; _i14++) {_loop3(_i14);
  6693. }
  6694. } else {
  6695. var rangesArr = new Array(1);
  6696. var rangesFormatArr = new Array(1);
  6697. var yAxisWidthArr = new Array(1);
  6698. if (opts.type === 'bar') {
  6699. rangesArr[0] = opts.categories;
  6700. if (!opts.yAxis.formatter) {
  6701. opts.yAxis.formatter = function (val, index, opts) {return val + (opts.yAxis.unit || '');};
  6702. }
  6703. } else {
  6704. if (!opts.yAxis.formatter) {
  6705. opts.yAxis.formatter = function (val, index, opts) {return val.toFixed(opts.yAxis.tofix) + (opts.yAxis.unit || '');};
  6706. }
  6707. rangesArr[0] = getYAxisTextList(series, opts, config, columnstyle.type, {});
  6708. }
  6709. yAxisWidthArr[0] = {
  6710. position: 'left',
  6711. width: 0 };
  6712. var yAxisFontSize = opts.yAxis.fontSize * opts.pix || config.fontSize;
  6713. rangesFormatArr[0] = rangesArr[0].map(function (item, index) {
  6714. item = opts.yAxis.formatter(item, index, opts);
  6715. yAxisWidthArr[0].width = Math.max(yAxisWidthArr[0].width, measureText(item, yAxisFontSize, context) + 5);
  6716. return item;
  6717. });
  6718. yAxisWidthArr[0].width += 3 * opts.pix;
  6719. if (opts.yAxis.disabled === true) {
  6720. yAxisWidthArr[0] = {
  6721. position: 'left',
  6722. width: 0 };
  6723. opts.yAxis.data[0] = {
  6724. disabled: true };
  6725. } else {
  6726. opts.yAxis.data[0] = {
  6727. disabled: false,
  6728. position: 'left',
  6729. max: opts.yAxis.max,
  6730. min: opts.yAxis.min,
  6731. formatter: opts.yAxis.formatter };
  6732. if (opts.type === 'bar') {
  6733. opts.yAxis.data[0].categories = opts.categories;
  6734. opts.yAxis.data[0].type = 'categories';
  6735. }
  6736. }
  6737. }
  6738. return {
  6739. rangesFormat: rangesFormatArr,
  6740. ranges: rangesArr,
  6741. yAxisWidth: yAxisWidthArr };
  6742. }
  6743. function calTooltipYAxisData(point, series, opts, config, eachSpacing) {
  6744. var ranges = [].concat(opts.chartData.yAxisData.ranges);
  6745. var spacingValid = opts.height - opts.area[0] - opts.area[2];
  6746. var minAxis = opts.area[0];
  6747. var items = [];
  6748. for (var i = 0; i < ranges.length; i++) {
  6749. var maxVal = ranges[i].shift();
  6750. var minVal = ranges[i].pop();
  6751. var item = maxVal - (maxVal - minVal) * (point - minAxis) / spacingValid;
  6752. item = opts.yAxis.data[i].formatter ? opts.yAxis.data[i].formatter(item) : item.toFixed(0);
  6753. items.push(String(item));
  6754. }
  6755. return items;
  6756. }
  6757. function calMarkLineData(points, opts) {
  6758. var minRange, maxRange;
  6759. var spacingValid = opts.height - opts.area[0] - opts.area[2];
  6760. for (var i = 0; i < points.length; i++) {
  6761. points[i].yAxisIndex = points[i].yAxisIndex ? points[i].yAxisIndex : 0;
  6762. var range = [].concat(opts.chartData.yAxisData.ranges[points[i].yAxisIndex]);
  6763. minRange = range.pop();
  6764. maxRange = range.shift();
  6765. var height = spacingValid * (points[i].value - minRange) / (maxRange - minRange);
  6766. points[i].y = opts.height - Math.round(height) - opts.area[2];
  6767. }
  6768. return points;
  6769. }
  6770. function contextRotate(context, opts) {
  6771. if (opts.rotateLock !== true) {
  6772. context.translate(opts.height, 0);
  6773. context.rotate(90 * Math.PI / 180);
  6774. } else if (opts._rotate_ !== true) {
  6775. context.translate(opts.height, 0);
  6776. context.rotate(90 * Math.PI / 180);
  6777. opts._rotate_ = true;
  6778. }
  6779. }
  6780. function drawPointShape(points, color, shape, context, opts) {
  6781. context.beginPath();
  6782. if (opts.dataPointShapeType == 'hollow') {
  6783. context.setStrokeStyle(color);
  6784. context.setFillStyle(opts.background);
  6785. context.setLineWidth(2 * opts.pix);
  6786. } else {
  6787. context.setStrokeStyle("#ffffff");
  6788. context.setFillStyle(color);
  6789. context.setLineWidth(1 * opts.pix);
  6790. }
  6791. if (shape === 'diamond') {
  6792. points.forEach(function (item, index) {
  6793. if (item !== null) {
  6794. context.moveTo(item.x, item.y - 4.5);
  6795. context.lineTo(item.x - 4.5, item.y);
  6796. context.lineTo(item.x, item.y + 4.5);
  6797. context.lineTo(item.x + 4.5, item.y);
  6798. context.lineTo(item.x, item.y - 4.5);
  6799. }
  6800. });
  6801. } else if (shape === 'circle') {
  6802. points.forEach(function (item, index) {
  6803. if (item !== null) {
  6804. context.moveTo(item.x + 2.5 * opts.pix, item.y);
  6805. context.arc(item.x, item.y, 3 * opts.pix, 0, 2 * Math.PI, false);
  6806. }
  6807. });
  6808. } else if (shape === 'square') {
  6809. points.forEach(function (item, index) {
  6810. if (item !== null) {
  6811. context.moveTo(item.x - 3.5, item.y - 3.5);
  6812. context.rect(item.x - 3.5, item.y - 3.5, 7, 7);
  6813. }
  6814. });
  6815. } else if (shape === 'triangle') {
  6816. points.forEach(function (item, index) {
  6817. if (item !== null) {
  6818. context.moveTo(item.x, item.y - 4.5);
  6819. context.lineTo(item.x - 4.5, item.y + 4.5);
  6820. context.lineTo(item.x + 4.5, item.y + 4.5);
  6821. context.lineTo(item.x, item.y - 4.5);
  6822. }
  6823. });
  6824. } else if (shape === 'triangle') {
  6825. return;
  6826. }
  6827. context.closePath();
  6828. context.fill();
  6829. context.stroke();
  6830. }
  6831. function drawRingTitle(opts, config, context, center) {
  6832. var titlefontSize = opts.title.fontSize || config.titleFontSize;
  6833. var subtitlefontSize = opts.subtitle.fontSize || config.subtitleFontSize;
  6834. var title = opts.title.name || '';
  6835. var subtitle = opts.subtitle.name || '';
  6836. var titleFontColor = opts.title.color || opts.fontColor;
  6837. var subtitleFontColor = opts.subtitle.color || opts.fontColor;
  6838. var titleHeight = title ? titlefontSize : 0;
  6839. var subtitleHeight = subtitle ? subtitlefontSize : 0;
  6840. var margin = 5;
  6841. if (subtitle) {
  6842. var textWidth = measureText(subtitle, subtitlefontSize * opts.pix, context);
  6843. var startX = center.x - textWidth / 2 + (opts.subtitle.offsetX || 0) * opts.pix;
  6844. var startY = center.y + subtitlefontSize * opts.pix / 2 + (opts.subtitle.offsetY || 0) * opts.pix;
  6845. if (title) {
  6846. startY += (titleHeight * opts.pix + margin) / 2;
  6847. }
  6848. context.beginPath();
  6849. context.setFontSize(subtitlefontSize * opts.pix);
  6850. context.setFillStyle(subtitleFontColor);
  6851. context.fillText(subtitle, startX, startY);
  6852. context.closePath();
  6853. context.stroke();
  6854. }
  6855. if (title) {
  6856. var _textWidth = measureText(title, titlefontSize * opts.pix, context);
  6857. var _startX = center.x - _textWidth / 2 + (opts.title.offsetX || 0);
  6858. var _startY = center.y + titlefontSize * opts.pix / 2 + (opts.title.offsetY || 0) * opts.pix;
  6859. if (subtitle) {
  6860. _startY -= (subtitleHeight * opts.pix + margin) / 2;
  6861. }
  6862. context.beginPath();
  6863. context.setFontSize(titlefontSize * opts.pix);
  6864. context.setFillStyle(titleFontColor);
  6865. context.fillText(title, _startX, _startY);
  6866. context.closePath();
  6867. context.stroke();
  6868. }
  6869. }
  6870. function drawPointText(points, series, config, context, opts) {
  6871. // 绘制数据文案
  6872. var data = series.data;
  6873. var textOffset = series.textOffset ? series.textOffset : 0;
  6874. points.forEach(function (item, index) {
  6875. if (item !== null) {
  6876. context.beginPath();
  6877. var fontSize = series.textSize ? series.textSize * opts.pix : config.fontSize;
  6878. context.setFontSize(fontSize);
  6879. context.setFillStyle(series.textColor || opts.fontColor);
  6880. var value = data[index];
  6881. if (typeof data[index] === 'object' && data[index] !== null) {
  6882. if (data[index].constructor.toString().indexOf('Array') > -1) {
  6883. value = data[index][1];
  6884. } else {
  6885. value = data[index].value;
  6886. }
  6887. }
  6888. var formatVal = series.formatter ? series.formatter(value, index, series, opts) : value;
  6889. context.setTextAlign('center');
  6890. context.fillText(String(formatVal), item.x, item.y - 4 + textOffset * opts.pix);
  6891. context.closePath();
  6892. context.stroke();
  6893. context.setTextAlign('left');
  6894. }
  6895. });
  6896. }
  6897. function drawMountPointText(points, series, config, context, opts) {
  6898. // 绘制数据文案
  6899. var data = series.data;
  6900. var textOffset = series.textOffset ? series.textOffset : 0;
  6901. points.forEach(function (item, index) {
  6902. if (item !== null) {
  6903. context.beginPath();
  6904. var fontSize = series[index].textSize ? series[index].textSize * opts.pix : config.fontSize;
  6905. context.setFontSize(fontSize);
  6906. context.setFillStyle(series[index].textColor || opts.fontColor);
  6907. var value = item.value;
  6908. var formatVal = series[index].formatter ? series[index].formatter(value, index, series, opts) : value;
  6909. context.setTextAlign('center');
  6910. context.fillText(String(formatVal), item.x, item.y - 4 + textOffset * opts.pix);
  6911. context.closePath();
  6912. context.stroke();
  6913. context.setTextAlign('left');
  6914. }
  6915. });
  6916. }
  6917. function drawBarPointText(points, series, config, context, opts) {
  6918. // 绘制数据文案
  6919. var data = series.data;
  6920. var textOffset = series.textOffset ? series.textOffset : 0;
  6921. points.forEach(function (item, index) {
  6922. if (item !== null) {
  6923. context.beginPath();
  6924. var fontSize = series.textSize ? series.textSize * opts.pix : config.fontSize;
  6925. context.setFontSize(fontSize);
  6926. context.setFillStyle(series.textColor || opts.fontColor);
  6927. var value = data[index];
  6928. if (typeof data[index] === 'object' && data[index] !== null) {
  6929. value = data[index].value;
  6930. }
  6931. var formatVal = series.formatter ? series.formatter(value, index, series, opts) : value;
  6932. context.setTextAlign('left');
  6933. context.fillText(String(formatVal), item.x + 4 * opts.pix, item.y + fontSize / 2 - 3);
  6934. context.closePath();
  6935. context.stroke();
  6936. }
  6937. });
  6938. }
  6939. function drawGaugeLabel(gaugeOption, radius, centerPosition, opts, config, context) {
  6940. radius -= gaugeOption.width / 2 + gaugeOption.labelOffset * opts.pix;
  6941. radius = radius < 10 ? 10 : radius;
  6942. var totalAngle = gaugeOption.startAngle - gaugeOption.endAngle + 1;
  6943. var splitAngle = totalAngle / gaugeOption.splitLine.splitNumber;
  6944. var totalNumber = gaugeOption.endNumber - gaugeOption.startNumber;
  6945. var splitNumber = totalNumber / gaugeOption.splitLine.splitNumber;
  6946. var nowAngle = gaugeOption.startAngle;
  6947. var nowNumber = gaugeOption.startNumber;
  6948. for (var i = 0; i < gaugeOption.splitLine.splitNumber + 1; i++) {
  6949. var pos = {
  6950. x: radius * Math.cos(nowAngle * Math.PI),
  6951. y: radius * Math.sin(nowAngle * Math.PI) };
  6952. var labelText = gaugeOption.formatter ? gaugeOption.formatter(nowNumber, i, opts) : nowNumber;
  6953. pos.x += centerPosition.x - measureText(labelText, config.fontSize, context) / 2;
  6954. pos.y += centerPosition.y;
  6955. var startX = pos.x;
  6956. var startY = pos.y;
  6957. context.beginPath();
  6958. context.setFontSize(config.fontSize);
  6959. context.setFillStyle(gaugeOption.labelColor || opts.fontColor);
  6960. context.fillText(labelText, startX, startY + config.fontSize / 2);
  6961. context.closePath();
  6962. context.stroke();
  6963. nowAngle += splitAngle;
  6964. if (nowAngle >= 2) {
  6965. nowAngle = nowAngle % 2;
  6966. }
  6967. nowNumber += splitNumber;
  6968. }
  6969. }
  6970. function drawRadarLabel(angleList, radius, centerPosition, opts, config, context) {
  6971. var radarOption = opts.extra.radar || {};
  6972. angleList.forEach(function (angle, index) {
  6973. if (radarOption.labelPointShow === true && opts.categories[index] !== '') {
  6974. var posPoint = {
  6975. x: radius * Math.cos(angle),
  6976. y: radius * Math.sin(angle) };
  6977. var posPointAxis = convertCoordinateOrigin(posPoint.x, posPoint.y, centerPosition);
  6978. context.setFillStyle(radarOption.labelPointColor);
  6979. context.beginPath();
  6980. context.arc(posPointAxis.x, posPointAxis.y, radarOption.labelPointRadius * opts.pix, 0, 2 * Math.PI, false);
  6981. context.closePath();
  6982. context.fill();
  6983. }
  6984. var pos = {
  6985. x: (radius + config.radarLabelTextMargin * opts.pix) * Math.cos(angle),
  6986. y: (radius + config.radarLabelTextMargin * opts.pix) * Math.sin(angle) };
  6987. var posRelativeCanvas = convertCoordinateOrigin(pos.x, pos.y, centerPosition);
  6988. var startX = posRelativeCanvas.x;
  6989. var startY = posRelativeCanvas.y;
  6990. if (util.approximatelyEqual(pos.x, 0)) {
  6991. startX -= measureText(opts.categories[index] || '', config.fontSize, context) / 2;
  6992. } else if (pos.x < 0) {
  6993. startX -= measureText(opts.categories[index] || '', config.fontSize, context);
  6994. }
  6995. context.beginPath();
  6996. context.setFontSize(config.fontSize);
  6997. context.setFillStyle(radarOption.labelColor || opts.fontColor);
  6998. context.fillText(opts.categories[index] || '', startX, startY + config.fontSize / 2);
  6999. context.closePath();
  7000. context.stroke();
  7001. });
  7002. }
  7003. function drawPieText(series, opts, config, context, radius, center) {
  7004. var lineRadius = config.pieChartLinePadding;
  7005. var textObjectCollection = [];
  7006. var lastTextObject = null;
  7007. var seriesConvert = series.map(function (item, index) {
  7008. var text = item.formatter ? item.formatter(item, index, series, opts) : util.toFixed(item._proportion_.toFixed(4) * 100) + '%';
  7009. text = item.labelText ? item.labelText : text;
  7010. var arc = 2 * Math.PI - (item._start_ + 2 * Math.PI * item._proportion_ / 2);
  7011. if (item._rose_proportion_) {
  7012. arc = 2 * Math.PI - (item._start_ + 2 * Math.PI * item._rose_proportion_ / 2);
  7013. }
  7014. var color = item.color;
  7015. var radius = item._radius_;
  7016. return {
  7017. arc: arc,
  7018. text: text,
  7019. color: color,
  7020. radius: radius,
  7021. textColor: item.textColor,
  7022. textSize: item.textSize,
  7023. labelShow: item.labelShow };
  7024. });
  7025. for (var i = 0; i < seriesConvert.length; i++) {
  7026. var item = seriesConvert[i];
  7027. // line end
  7028. var orginX1 = Math.cos(item.arc) * (item.radius + lineRadius);
  7029. var orginY1 = Math.sin(item.arc) * (item.radius + lineRadius);
  7030. // line start
  7031. var orginX2 = Math.cos(item.arc) * item.radius;
  7032. var orginY2 = Math.sin(item.arc) * item.radius;
  7033. // text start
  7034. var orginX3 = orginX1 >= 0 ? orginX1 + config.pieChartTextPadding : orginX1 - config.pieChartTextPadding;
  7035. var orginY3 = orginY1;
  7036. var textWidth = measureText(item.text, item.textSize * opts.pix || config.fontSize, context);
  7037. var startY = orginY3;
  7038. if (lastTextObject && util.isSameXCoordinateArea(lastTextObject.start, {
  7039. x: orginX3 }))
  7040. {
  7041. if (orginX3 > 0) {
  7042. startY = Math.min(orginY3, lastTextObject.start.y);
  7043. } else if (orginX1 < 0) {
  7044. startY = Math.max(orginY3, lastTextObject.start.y);
  7045. } else {
  7046. if (orginY3 > 0) {
  7047. startY = Math.max(orginY3, lastTextObject.start.y);
  7048. } else {
  7049. startY = Math.min(orginY3, lastTextObject.start.y);
  7050. }
  7051. }
  7052. }
  7053. if (orginX3 < 0) {
  7054. orginX3 -= textWidth;
  7055. }
  7056. var textObject = {
  7057. lineStart: {
  7058. x: orginX2,
  7059. y: orginY2 },
  7060. lineEnd: {
  7061. x: orginX1,
  7062. y: orginY1 },
  7063. start: {
  7064. x: orginX3,
  7065. y: startY },
  7066. width: textWidth,
  7067. height: config.fontSize,
  7068. text: item.text,
  7069. color: item.color,
  7070. textColor: item.textColor,
  7071. textSize: item.textSize };
  7072. lastTextObject = avoidCollision(textObject, lastTextObject);
  7073. textObjectCollection.push(lastTextObject);
  7074. }
  7075. for (var _i15 = 0; _i15 < textObjectCollection.length; _i15++) {
  7076. if (seriesConvert[_i15].labelShow === false) {
  7077. continue;
  7078. }
  7079. var _item6 = textObjectCollection[_i15];
  7080. var lineStartPoistion = convertCoordinateOrigin(_item6.lineStart.x, _item6.lineStart.y, center);
  7081. var lineEndPoistion = convertCoordinateOrigin(_item6.lineEnd.x, _item6.lineEnd.y, center);
  7082. var textPosition = convertCoordinateOrigin(_item6.start.x, _item6.start.y, center);
  7083. context.setLineWidth(1 * opts.pix);
  7084. context.setFontSize(_item6.textSize * opts.pix || config.fontSize);
  7085. context.beginPath();
  7086. context.setStrokeStyle(_item6.color);
  7087. context.setFillStyle(_item6.color);
  7088. context.moveTo(lineStartPoistion.x, lineStartPoistion.y);
  7089. var curveStartX = _item6.start.x < 0 ? textPosition.x + _item6.width : textPosition.x;
  7090. var textStartX = _item6.start.x < 0 ? textPosition.x - 5 : textPosition.x + 5;
  7091. context.quadraticCurveTo(lineEndPoistion.x, lineEndPoistion.y, curveStartX, textPosition.y);
  7092. context.moveTo(lineStartPoistion.x, lineStartPoistion.y);
  7093. context.stroke();
  7094. context.closePath();
  7095. context.beginPath();
  7096. context.moveTo(textPosition.x + _item6.width, textPosition.y);
  7097. context.arc(curveStartX, textPosition.y, 2 * opts.pix, 0, 2 * Math.PI);
  7098. context.closePath();
  7099. context.fill();
  7100. context.beginPath();
  7101. context.setFontSize(_item6.textSize * opts.pix || config.fontSize);
  7102. context.setFillStyle(_item6.textColor || opts.fontColor);
  7103. context.fillText(_item6.text, textStartX, textPosition.y + 3);
  7104. context.closePath();
  7105. context.stroke();
  7106. context.closePath();
  7107. }
  7108. }
  7109. function drawToolTipSplitLine(offsetX, opts, config, context) {
  7110. var toolTipOption = opts.extra.tooltip || {};
  7111. toolTipOption.gridType = toolTipOption.gridType == undefined ? 'solid' : toolTipOption.gridType;
  7112. toolTipOption.dashLength = toolTipOption.dashLength == undefined ? 4 : toolTipOption.dashLength;
  7113. var startY = opts.area[0];
  7114. var endY = opts.height - opts.area[2];
  7115. if (toolTipOption.gridType == 'dash') {
  7116. context.setLineDash([toolTipOption.dashLength, toolTipOption.dashLength]);
  7117. }
  7118. context.setStrokeStyle(toolTipOption.gridColor || '#cccccc');
  7119. context.setLineWidth(1 * opts.pix);
  7120. context.beginPath();
  7121. context.moveTo(offsetX, startY);
  7122. context.lineTo(offsetX, endY);
  7123. context.stroke();
  7124. context.setLineDash([]);
  7125. if (toolTipOption.xAxisLabel) {
  7126. var labelText = opts.categories[opts.tooltip.index];
  7127. context.setFontSize(config.fontSize);
  7128. var textWidth = measureText(labelText, config.fontSize, context);
  7129. var textX = offsetX - 0.5 * textWidth;
  7130. var textY = endY;
  7131. context.beginPath();
  7132. context.setFillStyle(hexToRgb(toolTipOption.labelBgColor || config.toolTipBackground, toolTipOption.labelBgOpacity || config.toolTipOpacity));
  7133. context.setStrokeStyle(toolTipOption.labelBgColor || config.toolTipBackground);
  7134. context.setLineWidth(1 * opts.pix);
  7135. context.rect(textX - config.toolTipPadding, textY, textWidth + 2 * config.toolTipPadding, config.fontSize + 2 * config.toolTipPadding);
  7136. context.closePath();
  7137. context.stroke();
  7138. context.fill();
  7139. context.beginPath();
  7140. context.setFontSize(config.fontSize);
  7141. context.setFillStyle(toolTipOption.labelFontColor || opts.fontColor);
  7142. context.fillText(String(labelText), textX, textY + config.toolTipPadding + config.fontSize);
  7143. context.closePath();
  7144. context.stroke();
  7145. }
  7146. }
  7147. function drawMarkLine(opts, config, context) {
  7148. var markLineOption = assign({}, {
  7149. type: 'solid',
  7150. dashLength: 4,
  7151. data: [] },
  7152. opts.extra.markLine);
  7153. var startX = opts.area[3];
  7154. var endX = opts.width - opts.area[1];
  7155. var points = calMarkLineData(markLineOption.data, opts);
  7156. for (var i = 0; i < points.length; i++) {
  7157. var item = assign({}, {
  7158. lineColor: '#DE4A42',
  7159. showLabel: false,
  7160. labelFontColor: '#666666',
  7161. labelBgColor: '#DFE8FF',
  7162. labelBgOpacity: 0.8,
  7163. labelAlign: 'left',
  7164. labelOffsetX: 0,
  7165. labelOffsetY: 0 },
  7166. points[i]);
  7167. if (markLineOption.type == 'dash') {
  7168. context.setLineDash([markLineOption.dashLength, markLineOption.dashLength]);
  7169. }
  7170. context.setStrokeStyle(item.lineColor);
  7171. context.setLineWidth(1 * opts.pix);
  7172. context.beginPath();
  7173. context.moveTo(startX, item.y);
  7174. context.lineTo(endX, item.y);
  7175. context.stroke();
  7176. context.setLineDash([]);
  7177. if (item.showLabel) {
  7178. var labelText = item.labelText ? item.labelText : item.value;
  7179. context.setFontSize(config.fontSize);
  7180. var textWidth = measureText(labelText, config.fontSize, context);
  7181. var bgWidth = textWidth + config.toolTipPadding * 2;
  7182. var bgStartX = item.labelAlign == 'left' ? opts.area[3] - bgWidth : opts.width - opts.area[1];
  7183. bgStartX += item.labelOffsetX;
  7184. var bgStartY = item.y - 0.5 * config.fontSize - config.toolTipPadding;
  7185. bgStartY += item.labelOffsetY;
  7186. var textX = bgStartX + config.toolTipPadding;
  7187. var textY = item.y;
  7188. context.setFillStyle(hexToRgb(item.labelBgColor, item.labelBgOpacity));
  7189. context.setStrokeStyle(item.labelBgColor);
  7190. context.setLineWidth(1 * opts.pix);
  7191. context.beginPath();
  7192. context.rect(bgStartX, bgStartY, bgWidth, config.fontSize + 2 * config.toolTipPadding);
  7193. context.closePath();
  7194. context.stroke();
  7195. context.fill();
  7196. context.setFontSize(config.fontSize);
  7197. context.setTextAlign('left');
  7198. context.setFillStyle(item.labelFontColor);
  7199. context.fillText(String(labelText), textX, bgStartY + config.fontSize + config.toolTipPadding / 2);
  7200. context.stroke();
  7201. context.setTextAlign('left');
  7202. }
  7203. }
  7204. }
  7205. function drawToolTipHorizentalLine(opts, config, context, eachSpacing, xAxisPoints) {
  7206. var toolTipOption = assign({}, {
  7207. gridType: 'solid',
  7208. dashLength: 4 },
  7209. opts.extra.tooltip);
  7210. var startX = opts.area[3];
  7211. var endX = opts.width - opts.area[1];
  7212. if (toolTipOption.gridType == 'dash') {
  7213. context.setLineDash([toolTipOption.dashLength, toolTipOption.dashLength]);
  7214. }
  7215. context.setStrokeStyle(toolTipOption.gridColor || '#cccccc');
  7216. context.setLineWidth(1 * opts.pix);
  7217. context.beginPath();
  7218. context.moveTo(startX, opts.tooltip.offset.y);
  7219. context.lineTo(endX, opts.tooltip.offset.y);
  7220. context.stroke();
  7221. context.setLineDash([]);
  7222. if (toolTipOption.yAxisLabel) {
  7223. var labelText = calTooltipYAxisData(opts.tooltip.offset.y, opts.series, opts, config, eachSpacing);
  7224. var widthArr = opts.chartData.yAxisData.yAxisWidth;
  7225. var tStartLeft = opts.area[3];
  7226. var tStartRight = opts.width - opts.area[1];
  7227. for (var i = 0; i < labelText.length; i++) {
  7228. context.setFontSize(config.fontSize);
  7229. var textWidth = measureText(labelText[i], config.fontSize, context);
  7230. var bgStartX = void 0,bgEndX = void 0,bgWidth = void 0;
  7231. if (widthArr[i].position == 'left') {
  7232. bgStartX = tStartLeft - widthArr[i].width;
  7233. bgEndX = Math.max(bgStartX, bgStartX + textWidth + config.toolTipPadding * 2);
  7234. } else {
  7235. bgStartX = tStartRight;
  7236. bgEndX = Math.max(bgStartX + widthArr[i].width, bgStartX + textWidth + config.toolTipPadding * 2);
  7237. }
  7238. bgWidth = bgEndX - bgStartX;
  7239. var textX = bgStartX + (bgWidth - textWidth) / 2;
  7240. var textY = opts.tooltip.offset.y;
  7241. context.beginPath();
  7242. context.setFillStyle(hexToRgb(toolTipOption.labelBgColor || config.toolTipBackground, toolTipOption.labelBgOpacity || config.toolTipOpacity));
  7243. context.setStrokeStyle(toolTipOption.labelBgColor || config.toolTipBackground);
  7244. context.setLineWidth(1 * opts.pix);
  7245. context.rect(bgStartX, textY - 0.5 * config.fontSize - config.toolTipPadding, bgWidth, config.fontSize + 2 *
  7246. config.toolTipPadding);
  7247. context.closePath();
  7248. context.stroke();
  7249. context.fill();
  7250. context.beginPath();
  7251. context.setFontSize(config.fontSize);
  7252. context.setFillStyle(toolTipOption.labelFontColor || opts.fontColor);
  7253. context.fillText(labelText[i], textX, textY + 0.5 * config.fontSize);
  7254. context.closePath();
  7255. context.stroke();
  7256. if (widthArr[i].position == 'left') {
  7257. tStartLeft -= widthArr[i].width + opts.yAxis.padding * opts.pix;
  7258. } else {
  7259. tStartRight += widthArr[i].width + opts.yAxis.padding * opts.pix;
  7260. }
  7261. }
  7262. }
  7263. }
  7264. function drawToolTipSplitArea(offsetX, opts, config, context, eachSpacing) {
  7265. var toolTipOption = assign({}, {
  7266. activeBgColor: '#000000',
  7267. activeBgOpacity: 0.08,
  7268. activeWidth: eachSpacing },
  7269. opts.extra.column);
  7270. toolTipOption.activeWidth = toolTipOption.activeWidth > eachSpacing ? eachSpacing : toolTipOption.activeWidth;
  7271. var startY = opts.area[0];
  7272. var endY = opts.height - opts.area[2];
  7273. context.beginPath();
  7274. context.setFillStyle(hexToRgb(toolTipOption.activeBgColor, toolTipOption.activeBgOpacity));
  7275. context.rect(offsetX - toolTipOption.activeWidth / 2, startY, toolTipOption.activeWidth, endY - startY);
  7276. context.closePath();
  7277. context.fill();
  7278. context.setFillStyle("#FFFFFF");
  7279. }
  7280. function drawBarToolTipSplitArea(offsetX, opts, config, context, eachSpacing) {
  7281. var toolTipOption = assign({}, {
  7282. activeBgColor: '#000000',
  7283. activeBgOpacity: 0.08 },
  7284. opts.extra.bar);
  7285. var startX = opts.area[3];
  7286. var endX = opts.width - opts.area[1];
  7287. context.beginPath();
  7288. context.setFillStyle(hexToRgb(toolTipOption.activeBgColor, toolTipOption.activeBgOpacity));
  7289. context.rect(startX, offsetX - eachSpacing / 2, endX - startX, eachSpacing);
  7290. context.closePath();
  7291. context.fill();
  7292. context.setFillStyle("#FFFFFF");
  7293. }
  7294. function drawToolTip(textList, offset, opts, config, context, eachSpacing, xAxisPoints) {
  7295. var toolTipOption = assign({}, {
  7296. showBox: true,
  7297. showArrow: true,
  7298. showCategory: false,
  7299. bgColor: '#000000',
  7300. bgOpacity: 0.7,
  7301. borderColor: '#000000',
  7302. borderWidth: 0,
  7303. borderRadius: 0,
  7304. borderOpacity: 0.7,
  7305. fontColor: '#FFFFFF',
  7306. splitLine: true },
  7307. opts.extra.tooltip);
  7308. if (toolTipOption.showCategory == true && opts.categories) {
  7309. textList.unshift({ text: opts.categories[opts.tooltip.index], color: null });
  7310. }
  7311. var legendWidth = 4 * opts.pix;
  7312. var legendMarginRight = 5 * opts.pix;
  7313. var arrowWidth = toolTipOption.showArrow ? 8 * opts.pix : 0;
  7314. var isOverRightBorder = false;
  7315. if (opts.type == 'line' || opts.type == 'mount' || opts.type == 'area' || opts.type == 'candle' || opts.type == 'mix') {
  7316. if (toolTipOption.splitLine == true) {
  7317. drawToolTipSplitLine(opts.tooltip.offset.x, opts, config, context);
  7318. }
  7319. }
  7320. offset = assign({
  7321. x: 0,
  7322. y: 0 },
  7323. offset);
  7324. offset.y -= 8 * opts.pix;
  7325. var textWidth = textList.map(function (item) {
  7326. return measureText(item.text, config.fontSize, context);
  7327. });
  7328. var toolTipWidth = legendWidth + legendMarginRight + 4 * config.toolTipPadding + Math.max.apply(null, textWidth);
  7329. var toolTipHeight = 2 * config.toolTipPadding + textList.length * config.toolTipLineHeight;
  7330. if (toolTipOption.showBox == false) {
  7331. return;
  7332. }
  7333. // if beyond the right border
  7334. if (offset.x - Math.abs(opts._scrollDistance_ || 0) + arrowWidth + toolTipWidth > opts.width) {
  7335. isOverRightBorder = true;
  7336. }
  7337. if (toolTipHeight + offset.y > opts.height) {
  7338. offset.y = opts.height - toolTipHeight;
  7339. }
  7340. // draw background rect
  7341. context.beginPath();
  7342. context.setFillStyle(hexToRgb(toolTipOption.bgColor || config.toolTipBackground, toolTipOption.bgOpacity || config.toolTipOpacity));
  7343. context.setLineWidth(toolTipOption.borderWidth * opts.pix);
  7344. context.setStrokeStyle(hexToRgb(toolTipOption.borderColor, toolTipOption.borderOpacity));
  7345. var radius = toolTipOption.borderRadius;
  7346. if (isOverRightBorder) {
  7347. if (toolTipOption.showArrow) {
  7348. context.moveTo(offset.x, offset.y + 10 * opts.pix);
  7349. context.lineTo(offset.x - arrowWidth, offset.y + 10 * opts.pix + 5 * opts.pix);
  7350. }
  7351. context.arc(offset.x - arrowWidth - radius, offset.y + toolTipHeight - radius, radius, 0, Math.PI / 2, false);
  7352. context.arc(offset.x - arrowWidth - Math.round(toolTipWidth) + radius, offset.y + toolTipHeight - radius, radius,
  7353. Math.PI / 2, Math.PI, false);
  7354. context.arc(offset.x - arrowWidth - Math.round(toolTipWidth) + radius, offset.y + radius, radius, -Math.PI, -Math.PI / 2, false);
  7355. context.arc(offset.x - arrowWidth - radius, offset.y + radius, radius, -Math.PI / 2, 0, false);
  7356. if (toolTipOption.showArrow) {
  7357. context.lineTo(offset.x - arrowWidth, offset.y + 10 * opts.pix - 5 * opts.pix);
  7358. context.lineTo(offset.x, offset.y + 10 * opts.pix);
  7359. }
  7360. } else {
  7361. if (toolTipOption.showArrow) {
  7362. context.moveTo(offset.x, offset.y + 10 * opts.pix);
  7363. context.lineTo(offset.x + arrowWidth, offset.y + 10 * opts.pix - 5 * opts.pix);
  7364. }
  7365. context.arc(offset.x + arrowWidth + radius, offset.y + radius, radius, -Math.PI, -Math.PI / 2, false);
  7366. context.arc(offset.x + arrowWidth + Math.round(toolTipWidth) - radius, offset.y + radius, radius, -Math.PI / 2, 0,
  7367. false);
  7368. context.arc(offset.x + arrowWidth + Math.round(toolTipWidth) - radius, offset.y + toolTipHeight - radius, radius, 0,
  7369. Math.PI / 2, false);
  7370. context.arc(offset.x + arrowWidth + radius, offset.y + toolTipHeight - radius, radius, Math.PI / 2, Math.PI, false);
  7371. if (toolTipOption.showArrow) {
  7372. context.lineTo(offset.x + arrowWidth, offset.y + 10 * opts.pix + 5 * opts.pix);
  7373. context.lineTo(offset.x, offset.y + 10 * opts.pix);
  7374. }
  7375. }
  7376. context.closePath();
  7377. context.fill();
  7378. if (toolTipOption.borderWidth > 0) {
  7379. context.stroke();
  7380. }
  7381. // draw legend
  7382. textList.forEach(function (item, index) {
  7383. if (item.color !== null) {
  7384. context.beginPath();
  7385. context.setFillStyle(item.color);
  7386. var startX = offset.x + arrowWidth + 2 * config.toolTipPadding;
  7387. var startY = offset.y + (config.toolTipLineHeight - config.fontSize) / 2 + config.toolTipLineHeight * index + config.toolTipPadding + 1;
  7388. if (isOverRightBorder) {
  7389. startX = offset.x - toolTipWidth - arrowWidth + 2 * config.toolTipPadding;
  7390. }
  7391. context.fillRect(startX, startY, legendWidth, config.fontSize);
  7392. context.closePath();
  7393. }
  7394. });
  7395. // draw text list
  7396. textList.forEach(function (item, index) {
  7397. var startX = offset.x + arrowWidth + 2 * config.toolTipPadding + legendWidth + legendMarginRight;
  7398. if (isOverRightBorder) {
  7399. startX = offset.x - toolTipWidth - arrowWidth + 2 * config.toolTipPadding + +legendWidth + legendMarginRight;
  7400. }
  7401. var startY = offset.y + (config.toolTipLineHeight - config.fontSize) / 2 + config.toolTipLineHeight * index + config.toolTipPadding;
  7402. context.beginPath();
  7403. context.setFontSize(config.fontSize);
  7404. context.setFillStyle(toolTipOption.fontColor);
  7405. context.fillText(item.text, startX, startY + config.fontSize);
  7406. context.closePath();
  7407. context.stroke();
  7408. });
  7409. }
  7410. function drawColumnDataPoints(series, opts, config, context) {
  7411. var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
  7412. var xAxisData = opts.chartData.xAxisData,
  7413. xAxisPoints = xAxisData.xAxisPoints,
  7414. eachSpacing = xAxisData.eachSpacing;
  7415. var columnOption = assign({}, {
  7416. type: 'group',
  7417. width: eachSpacing / 2,
  7418. meterBorder: 4,
  7419. meterFillColor: '#FFFFFF',
  7420. barBorderCircle: false,
  7421. barBorderRadius: [],
  7422. seriesGap: 2,
  7423. linearType: 'none',
  7424. linearOpacity: 1,
  7425. customColor: [],
  7426. colorStop: 0 },
  7427. opts.extra.column);
  7428. var calPoints = [];
  7429. context.save();
  7430. var leftNum = -2;
  7431. var rightNum = xAxisPoints.length + 2;
  7432. if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) {
  7433. context.translate(opts._scrollDistance_, 0);
  7434. leftNum = Math.floor(-opts._scrollDistance_ / eachSpacing) - 2;
  7435. rightNum = leftNum + opts.xAxis.itemCount + 4;
  7436. }
  7437. if (opts.tooltip && opts.tooltip.textList && opts.tooltip.textList.length && process === 1) {
  7438. drawToolTipSplitArea(opts.tooltip.offset.x, opts, config, context, eachSpacing);
  7439. }
  7440. columnOption.customColor = fillCustomColor(columnOption.linearType, columnOption.customColor, series, config);
  7441. series.forEach(function (eachSeries, seriesIndex) {
  7442. var ranges, minRange, maxRange;
  7443. ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
  7444. minRange = ranges.pop();
  7445. maxRange = ranges.shift();
  7446. var data = eachSeries.data;
  7447. switch (columnOption.type) {
  7448. case 'group':
  7449. var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
  7450. var tooltipPoints = getStackDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, seriesIndex, series, process);
  7451. calPoints.push(tooltipPoints);
  7452. points = fixColumeData(points, eachSpacing, series.length, seriesIndex, config, opts);
  7453. for (var i = 0; i < points.length; i++) {
  7454. var item = points[i];
  7455. //fix issues/I27B1N yyoinge & Joeshu
  7456. if (item !== null && i > leftNum && i < rightNum) {
  7457. var startX = item.x - item.width / 2;
  7458. var height = opts.height - item.y - opts.area[2];
  7459. context.beginPath();
  7460. var fillColor = item.color || eachSeries.color;
  7461. var strokeColor = item.color || eachSeries.color;
  7462. if (columnOption.linearType !== 'none') {
  7463. var grd = context.createLinearGradient(startX, item.y, startX, opts.height - opts.area[2]);
  7464. //透明渐变
  7465. if (columnOption.linearType == 'opacity') {
  7466. grd.addColorStop(0, hexToRgb(fillColor, columnOption.linearOpacity));
  7467. grd.addColorStop(1, hexToRgb(fillColor, 1));
  7468. } else {
  7469. grd.addColorStop(0, hexToRgb(columnOption.customColor[eachSeries.linearIndex], columnOption.linearOpacity));
  7470. grd.addColorStop(columnOption.colorStop, hexToRgb(columnOption.customColor[eachSeries.linearIndex], columnOption.linearOpacity));
  7471. grd.addColorStop(1, hexToRgb(fillColor, 1));
  7472. }
  7473. fillColor = grd;
  7474. }
  7475. // 圆角边框
  7476. if (columnOption.barBorderRadius && columnOption.barBorderRadius.length === 4 || columnOption.barBorderCircle === true) {
  7477. var left = startX;
  7478. var top = item.y;
  7479. var width = item.width;
  7480. var _height = opts.height - opts.area[2] - item.y;
  7481. if (columnOption.barBorderCircle) {
  7482. columnOption.barBorderRadius = [width / 2, width / 2, 0, 0];
  7483. }var _columnOption$barBord = _slicedToArray(
  7484. columnOption.barBorderRadius, 4),r0 = _columnOption$barBord[0],r1 = _columnOption$barBord[1],r2 = _columnOption$barBord[2],r3 = _columnOption$barBord[3];
  7485. var minRadius = Math.min(width / 2, _height / 2);
  7486. r0 = r0 > minRadius ? minRadius : r0;
  7487. r1 = r1 > minRadius ? minRadius : r1;
  7488. r2 = r2 > minRadius ? minRadius : r2;
  7489. r3 = r3 > minRadius ? minRadius : r3;
  7490. r0 = r0 < 0 ? 0 : r0;
  7491. r1 = r1 < 0 ? 0 : r1;
  7492. r2 = r2 < 0 ? 0 : r2;
  7493. r3 = r3 < 0 ? 0 : r3;
  7494. context.arc(left + r0, top + r0, r0, -Math.PI, -Math.PI / 2);
  7495. context.arc(left + width - r1, top + r1, r1, -Math.PI / 2, 0);
  7496. context.arc(left + width - r2, top + _height - r2, r2, 0, Math.PI / 2);
  7497. context.arc(left + r3, top + _height - r3, r3, Math.PI / 2, Math.PI);
  7498. } else {
  7499. context.moveTo(startX, item.y);
  7500. context.lineTo(startX + item.width, item.y);
  7501. context.lineTo(startX + item.width, opts.height - opts.area[2]);
  7502. context.lineTo(startX, opts.height - opts.area[2]);
  7503. context.lineTo(startX, item.y);
  7504. context.setLineWidth(1);
  7505. context.setStrokeStyle(strokeColor);
  7506. }
  7507. context.setFillStyle(fillColor);
  7508. context.closePath();
  7509. //context.stroke();
  7510. context.fill();
  7511. }
  7512. };
  7513. break;
  7514. case 'stack':
  7515. // 绘制堆叠数据图
  7516. var points = getStackDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, seriesIndex, series, process);
  7517. calPoints.push(points);
  7518. points = fixColumeStackData(points, eachSpacing, series.length, seriesIndex, config, opts, series);
  7519. for (var _i16 = 0; _i16 < points.length; _i16++) {
  7520. var _item7 = points[_i16];
  7521. if (_item7 !== null && _i16 > leftNum && _i16 < rightNum) {
  7522. context.beginPath();
  7523. var fillColor = _item7.color || eachSeries.color;
  7524. var startX = _item7.x - _item7.width / 2 + 1;
  7525. var height = opts.height - _item7.y - opts.area[2];
  7526. var height0 = opts.height - _item7.y0 - opts.area[2];
  7527. if (seriesIndex > 0) {
  7528. height -= height0;
  7529. }
  7530. context.setFillStyle(fillColor);
  7531. context.moveTo(startX, _item7.y);
  7532. context.fillRect(startX, _item7.y, _item7.width, height);
  7533. context.closePath();
  7534. context.fill();
  7535. }
  7536. };
  7537. break;
  7538. case 'meter':
  7539. // 绘制温度计数据图
  7540. var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
  7541. calPoints.push(points);
  7542. points = fixColumeMeterData(points, eachSpacing, series.length, seriesIndex, config, opts, columnOption.meterBorder);
  7543. for (var _i17 = 0; _i17 < points.length; _i17++) {
  7544. var _item8 = points[_i17];
  7545. if (_item8 !== null && _i17 > leftNum && _i17 < rightNum) {
  7546. //画背景颜色
  7547. context.beginPath();
  7548. if (seriesIndex == 0 && columnOption.meterBorder > 0) {
  7549. context.setStrokeStyle(eachSeries.color);
  7550. context.setLineWidth(columnOption.meterBorder * opts.pix);
  7551. }
  7552. if (seriesIndex == 0) {
  7553. context.setFillStyle(columnOption.meterFillColor);
  7554. } else {
  7555. context.setFillStyle(_item8.color || eachSeries.color);
  7556. }
  7557. var startX = _item8.x - _item8.width / 2;
  7558. var height = opts.height - _item8.y - opts.area[2];
  7559. if (columnOption.barBorderRadius && columnOption.barBorderRadius.length === 4 || columnOption.barBorderCircle === true) {
  7560. var _left = startX;
  7561. var _top = _item8.y;
  7562. var _width = _item8.width;
  7563. var _height2 = opts.height - opts.area[2] - _item8.y;
  7564. if (columnOption.barBorderCircle) {
  7565. columnOption.barBorderRadius = [_width / 2, _width / 2, 0, 0];
  7566. }var _columnOption$barBord2 = _slicedToArray(
  7567. columnOption.barBorderRadius, 4),_r = _columnOption$barBord2[0],_r2 = _columnOption$barBord2[1],_r3 = _columnOption$barBord2[2],_r4 = _columnOption$barBord2[3];
  7568. var _minRadius = Math.min(_width / 2, _height2 / 2);
  7569. _r = _r > _minRadius ? _minRadius : _r;
  7570. _r2 = _r2 > _minRadius ? _minRadius : _r2;
  7571. _r3 = _r3 > _minRadius ? _minRadius : _r3;
  7572. _r4 = _r4 > _minRadius ? _minRadius : _r4;
  7573. _r = _r < 0 ? 0 : _r;
  7574. _r2 = _r2 < 0 ? 0 : _r2;
  7575. _r3 = _r3 < 0 ? 0 : _r3;
  7576. _r4 = _r4 < 0 ? 0 : _r4;
  7577. context.arc(_left + _r, _top + _r, _r, -Math.PI, -Math.PI / 2);
  7578. context.arc(_left + _width - _r2, _top + _r2, _r2, -Math.PI / 2, 0);
  7579. context.arc(_left + _width - _r3, _top + _height2 - _r3, _r3, 0, Math.PI / 2);
  7580. context.arc(_left + _r4, _top + _height2 - _r4, _r4, Math.PI / 2, Math.PI);
  7581. context.fill();
  7582. } else {
  7583. context.moveTo(startX, _item8.y);
  7584. context.lineTo(startX + _item8.width, _item8.y);
  7585. context.lineTo(startX + _item8.width, opts.height - opts.area[2]);
  7586. context.lineTo(startX, opts.height - opts.area[2]);
  7587. context.lineTo(startX, _item8.y);
  7588. context.fill();
  7589. }
  7590. if (seriesIndex == 0 && columnOption.meterBorder > 0) {
  7591. context.closePath();
  7592. context.stroke();
  7593. }
  7594. }
  7595. }
  7596. break;}
  7597. });
  7598. if (opts.dataLabel !== false && process === 1) {
  7599. series.forEach(function (eachSeries, seriesIndex) {
  7600. var ranges, minRange, maxRange;
  7601. ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
  7602. minRange = ranges.pop();
  7603. maxRange = ranges.shift();
  7604. var data = eachSeries.data;
  7605. switch (columnOption.type) {
  7606. case 'group':
  7607. var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
  7608. points = fixColumeData(points, eachSpacing, series.length, seriesIndex, config, opts);
  7609. drawPointText(points, eachSeries, config, context, opts);
  7610. break;
  7611. case 'stack':
  7612. var points = getStackDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, seriesIndex, series, process);
  7613. drawPointText(points, eachSeries, config, context, opts);
  7614. break;
  7615. case 'meter':
  7616. var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
  7617. drawPointText(points, eachSeries, config, context, opts);
  7618. break;}
  7619. });
  7620. }
  7621. context.restore();
  7622. return {
  7623. xAxisPoints: xAxisPoints,
  7624. calPoints: calPoints,
  7625. eachSpacing: eachSpacing };
  7626. }
  7627. function drawMountDataPoints(series, opts, config, context) {
  7628. var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
  7629. var xAxisData = opts.chartData.xAxisData,
  7630. xAxisPoints = xAxisData.xAxisPoints,
  7631. eachSpacing = xAxisData.eachSpacing;
  7632. var mountOption = assign({}, {
  7633. type: 'mount',
  7634. widthRatio: 1,
  7635. borderWidth: 1,
  7636. barBorderCircle: false,
  7637. barBorderRadius: [],
  7638. linearType: 'none',
  7639. linearOpacity: 1,
  7640. customColor: [],
  7641. colorStop: 0 },
  7642. opts.extra.mount);
  7643. mountOption.widthRatio = mountOption.widthRatio <= 0 ? 0 : mountOption.widthRatio;
  7644. mountOption.widthRatio = mountOption.widthRatio >= 2 ? 2 : mountOption.widthRatio;
  7645. var calPoints = [];
  7646. context.save();
  7647. var leftNum = -2;
  7648. var rightNum = xAxisPoints.length + 2;
  7649. if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) {
  7650. context.translate(opts._scrollDistance_, 0);
  7651. leftNum = Math.floor(-opts._scrollDistance_ / eachSpacing) - 2;
  7652. rightNum = leftNum + opts.xAxis.itemCount + 4;
  7653. }
  7654. mountOption.customColor = fillCustomColor(mountOption.linearType, mountOption.customColor, series, config);
  7655. var ranges, minRange, maxRange;
  7656. ranges = [].concat(opts.chartData.yAxisData.ranges[0]);
  7657. minRange = ranges.pop();
  7658. maxRange = ranges.shift();
  7659. var points = getMountDataPoints(series, minRange, maxRange, xAxisPoints, eachSpacing, opts, mountOption, process);
  7660. switch (mountOption.type) {
  7661. case 'bar':
  7662. for (var i = 0; i < points.length; i++) {
  7663. var item = points[i];
  7664. if (item !== null && i > leftNum && i < rightNum) {
  7665. var startX = item.x - eachSpacing * mountOption.widthRatio / 2;
  7666. var height = opts.height - item.y - opts.area[2];
  7667. context.beginPath();
  7668. var fillColor = item.color || series[i].color;
  7669. var strokeColor = item.color || series[i].color;
  7670. if (mountOption.linearType !== 'none') {
  7671. var grd = context.createLinearGradient(startX, item.y, startX, opts.height - opts.area[2]);
  7672. //透明渐变
  7673. if (mountOption.linearType == 'opacity') {
  7674. grd.addColorStop(0, hexToRgb(fillColor, mountOption.linearOpacity));
  7675. grd.addColorStop(1, hexToRgb(fillColor, 1));
  7676. } else {
  7677. grd.addColorStop(0, hexToRgb(mountOption.customColor[series[i].linearIndex], mountOption.linearOpacity));
  7678. grd.addColorStop(mountOption.colorStop, hexToRgb(mountOption.customColor[series[i].linearIndex], mountOption.linearOpacity));
  7679. grd.addColorStop(1, hexToRgb(fillColor, 1));
  7680. }
  7681. fillColor = grd;
  7682. }
  7683. // 圆角边框
  7684. if (mountOption.barBorderRadius && mountOption.barBorderRadius.length === 4 || mountOption.barBorderCircle === true) {
  7685. var left = startX;
  7686. var top = item.y;
  7687. var width = item.width;
  7688. var _height3 = opts.height - opts.area[2] - item.y - mountOption.borderWidth * opts.pix / 2;
  7689. if (mountOption.barBorderCircle) {
  7690. mountOption.barBorderRadius = [width / 2, width / 2, 0, 0];
  7691. }var _mountOption$barBorde = _slicedToArray(
  7692. mountOption.barBorderRadius, 4),r0 = _mountOption$barBorde[0],r1 = _mountOption$barBorde[1],r2 = _mountOption$barBorde[2],r3 = _mountOption$barBorde[3];
  7693. var minRadius = Math.min(width / 2, _height3 / 2);
  7694. r0 = r0 > minRadius ? minRadius : r0;
  7695. r1 = r1 > minRadius ? minRadius : r1;
  7696. r2 = r2 > minRadius ? minRadius : r2;
  7697. r3 = r3 > minRadius ? minRadius : r3;
  7698. r0 = r0 < 0 ? 0 : r0;
  7699. r1 = r1 < 0 ? 0 : r1;
  7700. r2 = r2 < 0 ? 0 : r2;
  7701. r3 = r3 < 0 ? 0 : r3;
  7702. context.arc(left + r0, top + r0, r0, -Math.PI, -Math.PI / 2);
  7703. context.arc(left + width - r1, top + r1, r1, -Math.PI / 2, 0);
  7704. context.arc(left + width - r2, top + _height3 - r2, r2, 0, Math.PI / 2);
  7705. context.arc(left + r3, top + _height3 - r3, r3, Math.PI / 2, Math.PI);
  7706. } else {
  7707. context.moveTo(startX, item.y);
  7708. context.lineTo(startX + item.width, item.y);
  7709. context.lineTo(startX + item.width, opts.height - opts.area[2]);
  7710. context.lineTo(startX, opts.height - opts.area[2]);
  7711. context.lineTo(startX, item.y);
  7712. }
  7713. context.setStrokeStyle(strokeColor);
  7714. context.setFillStyle(fillColor);
  7715. if (mountOption.borderWidth > 0) {
  7716. context.setLineWidth(mountOption.borderWidth * opts.pix);
  7717. context.closePath();
  7718. context.stroke();
  7719. }
  7720. context.fill();
  7721. }
  7722. };
  7723. break;
  7724. case 'triangle':
  7725. for (var _i18 = 0; _i18 < points.length; _i18++) {
  7726. var _item9 = points[_i18];
  7727. if (_item9 !== null && _i18 > leftNum && _i18 < rightNum) {
  7728. var startX = _item9.x - eachSpacing * mountOption.widthRatio / 2;
  7729. var height = opts.height - _item9.y - opts.area[2];
  7730. context.beginPath();
  7731. var fillColor = _item9.color || series[_i18].color;
  7732. var strokeColor = _item9.color || series[_i18].color;
  7733. if (mountOption.linearType !== 'none') {
  7734. var grd = context.createLinearGradient(startX, _item9.y, startX, opts.height - opts.area[2]);
  7735. //透明渐变
  7736. if (mountOption.linearType == 'opacity') {
  7737. grd.addColorStop(0, hexToRgb(fillColor, mountOption.linearOpacity));
  7738. grd.addColorStop(1, hexToRgb(fillColor, 1));
  7739. } else {
  7740. grd.addColorStop(0, hexToRgb(mountOption.customColor[series[_i18].linearIndex], mountOption.linearOpacity));
  7741. grd.addColorStop(mountOption.colorStop, hexToRgb(mountOption.customColor[series[_i18].linearIndex], mountOption.linearOpacity));
  7742. grd.addColorStop(1, hexToRgb(fillColor, 1));
  7743. }
  7744. fillColor = grd;
  7745. }
  7746. context.moveTo(startX, opts.height - opts.area[2]);
  7747. context.lineTo(_item9.x, _item9.y);
  7748. context.lineTo(startX + _item9.width, opts.height - opts.area[2]);
  7749. context.setStrokeStyle(strokeColor);
  7750. context.setFillStyle(fillColor);
  7751. if (mountOption.borderWidth > 0) {
  7752. context.setLineWidth(mountOption.borderWidth * opts.pix);
  7753. context.stroke();
  7754. }
  7755. context.fill();
  7756. }
  7757. };
  7758. break;
  7759. case 'mount':
  7760. for (var _i19 = 0; _i19 < points.length; _i19++) {
  7761. var _item10 = points[_i19];
  7762. if (_item10 !== null && _i19 > leftNum && _i19 < rightNum) {
  7763. var startX = _item10.x - eachSpacing * mountOption.widthRatio / 2;
  7764. var height = opts.height - _item10.y - opts.area[2];
  7765. context.beginPath();
  7766. var fillColor = _item10.color || series[_i19].color;
  7767. var strokeColor = _item10.color || series[_i19].color;
  7768. if (mountOption.linearType !== 'none') {
  7769. var grd = context.createLinearGradient(startX, _item10.y, startX, opts.height - opts.area[2]);
  7770. //透明渐变
  7771. if (mountOption.linearType == 'opacity') {
  7772. grd.addColorStop(0, hexToRgb(fillColor, mountOption.linearOpacity));
  7773. grd.addColorStop(1, hexToRgb(fillColor, 1));
  7774. } else {
  7775. grd.addColorStop(0, hexToRgb(mountOption.customColor[series[_i19].linearIndex], mountOption.linearOpacity));
  7776. grd.addColorStop(mountOption.colorStop, hexToRgb(mountOption.customColor[series[_i19].linearIndex], mountOption.linearOpacity));
  7777. grd.addColorStop(1, hexToRgb(fillColor, 1));
  7778. }
  7779. fillColor = grd;
  7780. }
  7781. context.moveTo(startX, opts.height - opts.area[2]);
  7782. context.bezierCurveTo(_item10.x - _item10.width / 4, opts.height - opts.area[2], _item10.x - _item10.width / 4, _item10.y, _item10.x, _item10.y);
  7783. context.bezierCurveTo(_item10.x + _item10.width / 4, _item10.y, _item10.x + _item10.width / 4, opts.height - opts.area[2], startX + _item10.width, opts.height - opts.area[2]);
  7784. context.setStrokeStyle(strokeColor);
  7785. context.setFillStyle(fillColor);
  7786. if (mountOption.borderWidth > 0) {
  7787. context.setLineWidth(mountOption.borderWidth * opts.pix);
  7788. context.stroke();
  7789. }
  7790. context.fill();
  7791. }
  7792. };
  7793. break;
  7794. case 'sharp':
  7795. for (var _i20 = 0; _i20 < points.length; _i20++) {
  7796. var _item11 = points[_i20];
  7797. if (_item11 !== null && _i20 > leftNum && _i20 < rightNum) {
  7798. var startX = _item11.x - eachSpacing * mountOption.widthRatio / 2;
  7799. var height = opts.height - _item11.y - opts.area[2];
  7800. context.beginPath();
  7801. var fillColor = _item11.color || series[_i20].color;
  7802. var strokeColor = _item11.color || series[_i20].color;
  7803. if (mountOption.linearType !== 'none') {
  7804. var grd = context.createLinearGradient(startX, _item11.y, startX, opts.height - opts.area[2]);
  7805. //透明渐变
  7806. if (mountOption.linearType == 'opacity') {
  7807. grd.addColorStop(0, hexToRgb(fillColor, mountOption.linearOpacity));
  7808. grd.addColorStop(1, hexToRgb(fillColor, 1));
  7809. } else {
  7810. grd.addColorStop(0, hexToRgb(mountOption.customColor[series[_i20].linearIndex], mountOption.linearOpacity));
  7811. grd.addColorStop(mountOption.colorStop, hexToRgb(mountOption.customColor[series[_i20].linearIndex], mountOption.linearOpacity));
  7812. grd.addColorStop(1, hexToRgb(fillColor, 1));
  7813. }
  7814. fillColor = grd;
  7815. }
  7816. context.moveTo(startX, opts.height - opts.area[2]);
  7817. context.quadraticCurveTo(_item11.x - 0, opts.height - opts.area[2] - height / 4, _item11.x, _item11.y);
  7818. context.quadraticCurveTo(_item11.x + 0, opts.height - opts.area[2] - height / 4, startX + _item11.width, opts.height - opts.area[2]);
  7819. context.setStrokeStyle(strokeColor);
  7820. context.setFillStyle(fillColor);
  7821. if (mountOption.borderWidth > 0) {
  7822. context.setLineWidth(mountOption.borderWidth * opts.pix);
  7823. context.stroke();
  7824. }
  7825. context.fill();
  7826. }
  7827. };
  7828. break;}
  7829. if (opts.dataLabel !== false && process === 1) {
  7830. var _ranges, _minRange, _maxRange;
  7831. _ranges = [].concat(opts.chartData.yAxisData.ranges[0]);
  7832. _minRange = _ranges.pop();
  7833. _maxRange = _ranges.shift();
  7834. var points = getMountDataPoints(series, _minRange, _maxRange, xAxisPoints, eachSpacing, opts, mountOption, process);
  7835. drawMountPointText(points, series, config, context, opts);
  7836. }
  7837. context.restore();
  7838. return {
  7839. xAxisPoints: xAxisPoints,
  7840. calPoints: points,
  7841. eachSpacing: eachSpacing };
  7842. }
  7843. function drawBarDataPoints(series, opts, config, context) {
  7844. var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
  7845. var yAxisPoints = [];
  7846. var eachSpacing = (opts.height - opts.area[0] - opts.area[2]) / opts.categories.length;
  7847. for (var i = 0; i < opts.categories.length; i++) {
  7848. yAxisPoints.push(opts.area[0] + eachSpacing / 2 + eachSpacing * i);
  7849. }
  7850. var columnOption = assign({}, {
  7851. type: 'group',
  7852. width: eachSpacing / 2,
  7853. meterBorder: 4,
  7854. meterFillColor: '#FFFFFF',
  7855. barBorderCircle: false,
  7856. barBorderRadius: [],
  7857. seriesGap: 2,
  7858. linearType: 'none',
  7859. linearOpacity: 1,
  7860. customColor: [],
  7861. colorStop: 0 },
  7862. opts.extra.bar);
  7863. var calPoints = [];
  7864. context.save();
  7865. var leftNum = -2;
  7866. var rightNum = yAxisPoints.length + 2;
  7867. if (opts.tooltip && opts.tooltip.textList && opts.tooltip.textList.length && process === 1) {
  7868. drawBarToolTipSplitArea(opts.tooltip.offset.y, opts, config, context, eachSpacing);
  7869. }
  7870. columnOption.customColor = fillCustomColor(columnOption.linearType, columnOption.customColor, series, config);
  7871. series.forEach(function (eachSeries, seriesIndex) {
  7872. var ranges, minRange, maxRange;
  7873. ranges = [].concat(opts.chartData.xAxisData.ranges);
  7874. maxRange = ranges.pop();
  7875. minRange = ranges.shift();
  7876. var data = eachSeries.data;
  7877. switch (columnOption.type) {
  7878. case 'group':
  7879. var points = getBarDataPoints(data, minRange, maxRange, yAxisPoints, eachSpacing, opts, config, process);
  7880. var tooltipPoints = getBarStackDataPoints(data, minRange, maxRange, yAxisPoints, eachSpacing, opts, config, seriesIndex, series, process);
  7881. calPoints.push(tooltipPoints);
  7882. points = fixBarData(points, eachSpacing, series.length, seriesIndex, config, opts);
  7883. for (var _i21 = 0; _i21 < points.length; _i21++) {
  7884. var item = points[_i21];
  7885. //fix issues/I27B1N yyoinge & Joeshu
  7886. if (item !== null && _i21 > leftNum && _i21 < rightNum) {
  7887. //var startX = item.x - item.width / 2;
  7888. var startX = opts.area[3];
  7889. var startY = item.y - item.width / 2;
  7890. var height = item.height;
  7891. context.beginPath();
  7892. var fillColor = item.color || eachSeries.color;
  7893. var strokeColor = item.color || eachSeries.color;
  7894. if (columnOption.linearType !== 'none') {
  7895. var grd = context.createLinearGradient(startX, item.y, item.x, item.y);
  7896. //透明渐变
  7897. if (columnOption.linearType == 'opacity') {
  7898. grd.addColorStop(0, hexToRgb(fillColor, columnOption.linearOpacity));
  7899. grd.addColorStop(1, hexToRgb(fillColor, 1));
  7900. } else {
  7901. grd.addColorStop(0, hexToRgb(columnOption.customColor[eachSeries.linearIndex], columnOption.linearOpacity));
  7902. grd.addColorStop(columnOption.colorStop, hexToRgb(columnOption.customColor[eachSeries.linearIndex], columnOption.linearOpacity));
  7903. grd.addColorStop(1, hexToRgb(fillColor, 1));
  7904. }
  7905. fillColor = grd;
  7906. }
  7907. // 圆角边框
  7908. if (columnOption.barBorderRadius && columnOption.barBorderRadius.length === 4 || columnOption.barBorderCircle === true) {
  7909. var left = startX;
  7910. var width = item.width;
  7911. var top = item.y - item.width / 2;
  7912. var _height4 = item.height;
  7913. if (columnOption.barBorderCircle) {
  7914. columnOption.barBorderRadius = [width / 2, width / 2, 0, 0];
  7915. }var _columnOption$barBord3 = _slicedToArray(
  7916. columnOption.barBorderRadius, 4),r0 = _columnOption$barBord3[0],r1 = _columnOption$barBord3[1],r2 = _columnOption$barBord3[2],r3 = _columnOption$barBord3[3];
  7917. var minRadius = Math.min(width / 2, _height4 / 2);
  7918. r0 = r0 > minRadius ? minRadius : r0;
  7919. r1 = r1 > minRadius ? minRadius : r1;
  7920. r2 = r2 > minRadius ? minRadius : r2;
  7921. r3 = r3 > minRadius ? minRadius : r3;
  7922. r0 = r0 < 0 ? 0 : r0;
  7923. r1 = r1 < 0 ? 0 : r1;
  7924. r2 = r2 < 0 ? 0 : r2;
  7925. r3 = r3 < 0 ? 0 : r3;
  7926. context.arc(left + r3, top + r3, r3, -Math.PI, -Math.PI / 2);
  7927. context.arc(item.x - r0, top + r0, r0, -Math.PI / 2, 0);
  7928. context.arc(item.x - r1, top + width - r1, r1, 0, Math.PI / 2);
  7929. context.arc(left + r2, top + width - r2, r2, Math.PI / 2, Math.PI);
  7930. } else {
  7931. context.moveTo(startX, startY);
  7932. context.lineTo(item.x, startY);
  7933. context.lineTo(item.x, startY + item.width);
  7934. context.lineTo(startX, startY + item.width);
  7935. context.lineTo(startX, startY);
  7936. context.setLineWidth(1);
  7937. context.setStrokeStyle(strokeColor);
  7938. }
  7939. context.setFillStyle(fillColor);
  7940. context.closePath();
  7941. //context.stroke();
  7942. context.fill();
  7943. }
  7944. };
  7945. break;
  7946. case 'stack':
  7947. // 绘制堆叠数据图
  7948. var points = getBarStackDataPoints(data, minRange, maxRange, yAxisPoints, eachSpacing, opts, config, seriesIndex, series, process);
  7949. calPoints.push(points);
  7950. points = fixBarStackData(points, eachSpacing, series.length, seriesIndex, config, opts, series);
  7951. for (var _i22 = 0; _i22 < points.length; _i22++) {
  7952. var _item12 = points[_i22];
  7953. if (_item12 !== null && _i22 > leftNum && _i22 < rightNum) {
  7954. context.beginPath();
  7955. var fillColor = _item12.color || eachSeries.color;
  7956. var startX = _item12.x0;
  7957. context.setFillStyle(fillColor);
  7958. context.moveTo(startX, _item12.y - _item12.width / 2);
  7959. context.fillRect(startX, _item12.y - _item12.width / 2, _item12.height, _item12.width);
  7960. context.closePath();
  7961. context.fill();
  7962. }
  7963. };
  7964. break;}
  7965. });
  7966. if (opts.dataLabel !== false && process === 1) {
  7967. series.forEach(function (eachSeries, seriesIndex) {
  7968. var ranges, minRange, maxRange;
  7969. ranges = [].concat(opts.chartData.xAxisData.ranges);
  7970. maxRange = ranges.pop();
  7971. minRange = ranges.shift();
  7972. var data = eachSeries.data;
  7973. switch (columnOption.type) {
  7974. case 'group':
  7975. var points = getBarDataPoints(data, minRange, maxRange, yAxisPoints, eachSpacing, opts, config, process);
  7976. points = fixBarData(points, eachSpacing, series.length, seriesIndex, config, opts);
  7977. drawBarPointText(points, eachSeries, config, context, opts);
  7978. break;
  7979. case 'stack':
  7980. var points = getBarStackDataPoints(data, minRange, maxRange, yAxisPoints, eachSpacing, opts, config, seriesIndex, series, process);
  7981. drawBarPointText(points, eachSeries, config, context, opts);
  7982. break;}
  7983. });
  7984. }
  7985. return {
  7986. yAxisPoints: yAxisPoints,
  7987. calPoints: calPoints,
  7988. eachSpacing: eachSpacing };
  7989. }
  7990. function drawCandleDataPoints(series, seriesMA, opts, config, context) {
  7991. var process = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
  7992. var candleOption = assign({}, {
  7993. color: {},
  7994. average: {} },
  7995. opts.extra.candle);
  7996. candleOption.color = assign({}, {
  7997. upLine: '#f04864',
  7998. upFill: '#f04864',
  7999. downLine: '#2fc25b',
  8000. downFill: '#2fc25b' },
  8001. candleOption.color);
  8002. candleOption.average = assign({}, {
  8003. show: false,
  8004. name: [],
  8005. day: [],
  8006. color: config.color },
  8007. candleOption.average);
  8008. opts.extra.candle = candleOption;
  8009. var xAxisData = opts.chartData.xAxisData,
  8010. xAxisPoints = xAxisData.xAxisPoints,
  8011. eachSpacing = xAxisData.eachSpacing;
  8012. var calPoints = [];
  8013. context.save();
  8014. var leftNum = -2;
  8015. var rightNum = xAxisPoints.length + 2;
  8016. var leftSpace = 0;
  8017. var rightSpace = opts.width + eachSpacing;
  8018. if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) {
  8019. context.translate(opts._scrollDistance_, 0);
  8020. leftNum = Math.floor(-opts._scrollDistance_ / eachSpacing) - 2;
  8021. rightNum = leftNum + opts.xAxis.itemCount + 4;
  8022. leftSpace = -opts._scrollDistance_ - eachSpacing * 2 + opts.area[3];
  8023. rightSpace = leftSpace + (opts.xAxis.itemCount + 4) * eachSpacing;
  8024. }
  8025. //画均线
  8026. if (candleOption.average.show || seriesMA) {//Merge pull request !12 from 邱贵翔
  8027. seriesMA.forEach(function (eachSeries, seriesIndex) {
  8028. var ranges, minRange, maxRange;
  8029. ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
  8030. minRange = ranges.pop();
  8031. maxRange = ranges.shift();
  8032. var data = eachSeries.data;
  8033. var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
  8034. var splitPointList = splitPoints(points, eachSeries);
  8035. for (var i = 0; i < splitPointList.length; i++) {
  8036. var _points = splitPointList[i];
  8037. context.beginPath();
  8038. context.setStrokeStyle(eachSeries.color);
  8039. context.setLineWidth(1);
  8040. if (_points.length === 1) {
  8041. context.moveTo(_points[0].x, _points[0].y);
  8042. context.arc(_points[0].x, _points[0].y, 1, 0, 2 * Math.PI);
  8043. } else {
  8044. context.moveTo(_points[0].x, _points[0].y);
  8045. var startPoint = 0;
  8046. for (var j = 0; j < _points.length; j++) {
  8047. var item = _points[j];
  8048. if (startPoint == 0 && item.x > leftSpace) {
  8049. context.moveTo(item.x, item.y);
  8050. startPoint = 1;
  8051. }
  8052. if (j > 0 && item.x > leftSpace && item.x < rightSpace) {
  8053. var ctrlPoint = createCurveControlPoints(_points, j - 1);
  8054. context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y, item.x,
  8055. item.y);
  8056. }
  8057. }
  8058. context.moveTo(_points[0].x, _points[0].y);
  8059. }
  8060. context.closePath();
  8061. context.stroke();
  8062. }
  8063. });
  8064. }
  8065. //画K线
  8066. series.forEach(function (eachSeries, seriesIndex) {
  8067. var ranges, minRange, maxRange;
  8068. ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
  8069. minRange = ranges.pop();
  8070. maxRange = ranges.shift();
  8071. var data = eachSeries.data;
  8072. var points = getCandleDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
  8073. calPoints.push(points);
  8074. var splitPointList = splitPoints(points, eachSeries);
  8075. for (var i = 0; i < splitPointList[0].length; i++) {
  8076. if (i > leftNum && i < rightNum) {
  8077. var item = splitPointList[0][i];
  8078. context.beginPath();
  8079. //如果上涨
  8080. if (data[i][1] - data[i][0] > 0) {
  8081. context.setStrokeStyle(candleOption.color.upLine);
  8082. context.setFillStyle(candleOption.color.upFill);
  8083. context.setLineWidth(1 * opts.pix);
  8084. context.moveTo(item[3].x, item[3].y); //顶点
  8085. context.lineTo(item[1].x, item[1].y); //收盘中间点
  8086. context.lineTo(item[1].x - eachSpacing / 4, item[1].y); //收盘左侧点
  8087. context.lineTo(item[0].x - eachSpacing / 4, item[0].y); //开盘左侧点
  8088. context.lineTo(item[0].x, item[0].y); //开盘中间点
  8089. context.lineTo(item[2].x, item[2].y); //底点
  8090. context.lineTo(item[0].x, item[0].y); //开盘中间点
  8091. context.lineTo(item[0].x + eachSpacing / 4, item[0].y); //开盘右侧点
  8092. context.lineTo(item[1].x + eachSpacing / 4, item[1].y); //收盘右侧点
  8093. context.lineTo(item[1].x, item[1].y); //收盘中间点
  8094. context.moveTo(item[3].x, item[3].y); //顶点
  8095. } else {
  8096. context.setStrokeStyle(candleOption.color.downLine);
  8097. context.setFillStyle(candleOption.color.downFill);
  8098. context.setLineWidth(1 * opts.pix);
  8099. context.moveTo(item[3].x, item[3].y); //顶点
  8100. context.lineTo(item[0].x, item[0].y); //开盘中间点
  8101. context.lineTo(item[0].x - eachSpacing / 4, item[0].y); //开盘左侧点
  8102. context.lineTo(item[1].x - eachSpacing / 4, item[1].y); //收盘左侧点
  8103. context.lineTo(item[1].x, item[1].y); //收盘中间点
  8104. context.lineTo(item[2].x, item[2].y); //底点
  8105. context.lineTo(item[1].x, item[1].y); //收盘中间点
  8106. context.lineTo(item[1].x + eachSpacing / 4, item[1].y); //收盘右侧点
  8107. context.lineTo(item[0].x + eachSpacing / 4, item[0].y); //开盘右侧点
  8108. context.lineTo(item[0].x, item[0].y); //开盘中间点
  8109. context.moveTo(item[3].x, item[3].y); //顶点
  8110. }
  8111. context.closePath();
  8112. context.fill();
  8113. context.stroke();
  8114. }
  8115. }
  8116. });
  8117. context.restore();
  8118. return {
  8119. xAxisPoints: xAxisPoints,
  8120. calPoints: calPoints,
  8121. eachSpacing: eachSpacing };
  8122. }
  8123. function drawAreaDataPoints(series, opts, config, context) {
  8124. var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
  8125. var areaOption = assign({}, {
  8126. type: 'straight',
  8127. opacity: 0.2,
  8128. addLine: false,
  8129. width: 2,
  8130. gradient: false },
  8131. opts.extra.area);
  8132. var xAxisData = opts.chartData.xAxisData,
  8133. xAxisPoints = xAxisData.xAxisPoints,
  8134. eachSpacing = xAxisData.eachSpacing;
  8135. var endY = opts.height - opts.area[2];
  8136. var calPoints = [];
  8137. context.save();
  8138. var leftSpace = 0;
  8139. var rightSpace = opts.width + eachSpacing;
  8140. if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) {
  8141. context.translate(opts._scrollDistance_, 0);
  8142. leftSpace = -opts._scrollDistance_ - eachSpacing * 2 + opts.area[3];
  8143. rightSpace = leftSpace + (opts.xAxis.itemCount + 4) * eachSpacing;
  8144. }
  8145. series.forEach(function (eachSeries, seriesIndex) {
  8146. var ranges, minRange, maxRange;
  8147. ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
  8148. minRange = ranges.pop();
  8149. maxRange = ranges.shift();
  8150. var data = eachSeries.data;
  8151. var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
  8152. calPoints.push(points);
  8153. var splitPointList = splitPoints(points, eachSeries);
  8154. for (var i = 0; i < splitPointList.length; i++) {
  8155. var _points2 = splitPointList[i];
  8156. // 绘制区域数
  8157. context.beginPath();
  8158. context.setStrokeStyle(hexToRgb(eachSeries.color, areaOption.opacity));
  8159. if (areaOption.gradient) {
  8160. var gradient = context.createLinearGradient(0, opts.area[0], 0, opts.height - opts.area[2]);
  8161. gradient.addColorStop('0', hexToRgb(eachSeries.color, areaOption.opacity));
  8162. gradient.addColorStop('1.0', hexToRgb("#FFFFFF", 0.1));
  8163. context.setFillStyle(gradient);
  8164. } else {
  8165. context.setFillStyle(hexToRgb(eachSeries.color, areaOption.opacity));
  8166. }
  8167. context.setLineWidth(areaOption.width * opts.pix);
  8168. if (_points2.length > 1) {
  8169. var firstPoint = _points2[0];
  8170. var lastPoint = _points2[_points2.length - 1];
  8171. context.moveTo(firstPoint.x, firstPoint.y);
  8172. var startPoint = 0;
  8173. if (areaOption.type === 'curve') {
  8174. for (var j = 0; j < _points2.length; j++) {
  8175. var item = _points2[j];
  8176. if (startPoint == 0 && item.x > leftSpace) {
  8177. context.moveTo(item.x, item.y);
  8178. startPoint = 1;
  8179. }
  8180. if (j > 0 && item.x > leftSpace && item.x < rightSpace) {
  8181. var ctrlPoint = createCurveControlPoints(_points2, j - 1);
  8182. context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y, item.x, item.y);
  8183. }
  8184. };
  8185. }
  8186. if (areaOption.type === 'straight') {
  8187. for (var _j = 0; _j < _points2.length; _j++) {
  8188. var _item13 = _points2[_j];
  8189. if (startPoint == 0 && _item13.x > leftSpace) {
  8190. context.moveTo(_item13.x, _item13.y);
  8191. startPoint = 1;
  8192. }
  8193. if (_j > 0 && _item13.x > leftSpace && _item13.x < rightSpace) {
  8194. context.lineTo(_item13.x, _item13.y);
  8195. }
  8196. };
  8197. }
  8198. if (areaOption.type === 'step') {
  8199. for (var _j2 = 0; _j2 < _points2.length; _j2++) {
  8200. var _item14 = _points2[_j2];
  8201. if (startPoint == 0 && _item14.x > leftSpace) {
  8202. context.moveTo(_item14.x, _item14.y);
  8203. startPoint = 1;
  8204. }
  8205. if (_j2 > 0 && _item14.x > leftSpace && _item14.x < rightSpace) {
  8206. context.lineTo(_item14.x, _points2[_j2 - 1].y);
  8207. context.lineTo(_item14.x, _item14.y);
  8208. }
  8209. };
  8210. }
  8211. context.lineTo(lastPoint.x, endY);
  8212. context.lineTo(firstPoint.x, endY);
  8213. context.lineTo(firstPoint.x, firstPoint.y);
  8214. } else {
  8215. var _item15 = _points2[0];
  8216. context.moveTo(_item15.x - eachSpacing / 2, _item15.y);
  8217. context.lineTo(_item15.x + eachSpacing / 2, _item15.y);
  8218. context.lineTo(_item15.x + eachSpacing / 2, endY);
  8219. context.lineTo(_item15.x - eachSpacing / 2, endY);
  8220. context.moveTo(_item15.x - eachSpacing / 2, _item15.y);
  8221. }
  8222. context.closePath();
  8223. context.fill();
  8224. //画连线
  8225. if (areaOption.addLine) {
  8226. if (eachSeries.lineType == 'dash') {
  8227. var dashLength = eachSeries.dashLength ? eachSeries.dashLength : 8;
  8228. dashLength *= opts.pix;
  8229. context.setLineDash([dashLength, dashLength]);
  8230. }
  8231. context.beginPath();
  8232. context.setStrokeStyle(eachSeries.color);
  8233. context.setLineWidth(areaOption.width * opts.pix);
  8234. if (_points2.length === 1) {
  8235. context.moveTo(_points2[0].x, _points2[0].y);
  8236. context.arc(_points2[0].x, _points2[0].y, 1, 0, 2 * Math.PI);
  8237. } else {
  8238. context.moveTo(_points2[0].x, _points2[0].y);
  8239. var _startPoint = 0;
  8240. if (areaOption.type === 'curve') {
  8241. for (var _j3 = 0; _j3 < _points2.length; _j3++) {
  8242. var _item16 = _points2[_j3];
  8243. if (_startPoint == 0 && _item16.x > leftSpace) {
  8244. context.moveTo(_item16.x, _item16.y);
  8245. _startPoint = 1;
  8246. }
  8247. if (_j3 > 0 && _item16.x > leftSpace && _item16.x < rightSpace) {
  8248. var _ctrlPoint = createCurveControlPoints(_points2, _j3 - 1);
  8249. context.bezierCurveTo(_ctrlPoint.ctrA.x, _ctrlPoint.ctrA.y, _ctrlPoint.ctrB.x, _ctrlPoint.ctrB.y, _item16.x, _item16.y);
  8250. }
  8251. };
  8252. }
  8253. if (areaOption.type === 'straight') {
  8254. for (var _j4 = 0; _j4 < _points2.length; _j4++) {
  8255. var _item17 = _points2[_j4];
  8256. if (_startPoint == 0 && _item17.x > leftSpace) {
  8257. context.moveTo(_item17.x, _item17.y);
  8258. _startPoint = 1;
  8259. }
  8260. if (_j4 > 0 && _item17.x > leftSpace && _item17.x < rightSpace) {
  8261. context.lineTo(_item17.x, _item17.y);
  8262. }
  8263. };
  8264. }
  8265. if (areaOption.type === 'step') {
  8266. for (var _j5 = 0; _j5 < _points2.length; _j5++) {
  8267. var _item18 = _points2[_j5];
  8268. if (_startPoint == 0 && _item18.x > leftSpace) {
  8269. context.moveTo(_item18.x, _item18.y);
  8270. _startPoint = 1;
  8271. }
  8272. if (_j5 > 0 && _item18.x > leftSpace && _item18.x < rightSpace) {
  8273. context.lineTo(_item18.x, _points2[_j5 - 1].y);
  8274. context.lineTo(_item18.x, _item18.y);
  8275. }
  8276. };
  8277. }
  8278. context.moveTo(_points2[0].x, _points2[0].y);
  8279. }
  8280. context.stroke();
  8281. context.setLineDash([]);
  8282. }
  8283. }
  8284. //画点
  8285. if (opts.dataPointShape !== false) {
  8286. drawPointShape(points, eachSeries.color, eachSeries.pointShape, context, opts);
  8287. }
  8288. });
  8289. if (opts.dataLabel !== false && process === 1) {
  8290. series.forEach(function (eachSeries, seriesIndex) {
  8291. var ranges, minRange, maxRange;
  8292. ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
  8293. minRange = ranges.pop();
  8294. maxRange = ranges.shift();
  8295. var data = eachSeries.data;
  8296. var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
  8297. drawPointText(points, eachSeries, config, context, opts);
  8298. });
  8299. }
  8300. context.restore();
  8301. return {
  8302. xAxisPoints: xAxisPoints,
  8303. calPoints: calPoints,
  8304. eachSpacing: eachSpacing };
  8305. }
  8306. function drawScatterDataPoints(series, opts, config, context) {
  8307. var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
  8308. var scatterOption = assign({}, {
  8309. type: 'circle' },
  8310. opts.extra.scatter);
  8311. var xAxisData = opts.chartData.xAxisData,
  8312. xAxisPoints = xAxisData.xAxisPoints,
  8313. eachSpacing = xAxisData.eachSpacing;
  8314. var calPoints = [];
  8315. context.save();
  8316. var leftSpace = 0;
  8317. var rightSpace = opts.width + eachSpacing;
  8318. if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) {
  8319. context.translate(opts._scrollDistance_, 0);
  8320. leftSpace = -opts._scrollDistance_ - eachSpacing * 2 + opts.area[3];
  8321. rightSpace = leftSpace + (opts.xAxis.itemCount + 4) * eachSpacing;
  8322. }
  8323. series.forEach(function (eachSeries, seriesIndex) {
  8324. var ranges, minRange, maxRange;
  8325. ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
  8326. minRange = ranges.pop();
  8327. maxRange = ranges.shift();
  8328. var data = eachSeries.data;
  8329. var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
  8330. context.beginPath();
  8331. context.setStrokeStyle(eachSeries.color);
  8332. context.setFillStyle(eachSeries.color);
  8333. context.setLineWidth(1 * opts.pix);
  8334. var shape = eachSeries.pointShape;
  8335. if (shape === 'diamond') {
  8336. points.forEach(function (item, index) {
  8337. if (item !== null) {
  8338. context.moveTo(item.x, item.y - 4.5);
  8339. context.lineTo(item.x - 4.5, item.y);
  8340. context.lineTo(item.x, item.y + 4.5);
  8341. context.lineTo(item.x + 4.5, item.y);
  8342. context.lineTo(item.x, item.y - 4.5);
  8343. }
  8344. });
  8345. } else if (shape === 'circle') {
  8346. points.forEach(function (item, index) {
  8347. if (item !== null) {
  8348. context.moveTo(item.x + 2.5 * opts.pix, item.y);
  8349. context.arc(item.x, item.y, 3 * opts.pix, 0, 2 * Math.PI, false);
  8350. }
  8351. });
  8352. } else if (shape === 'square') {
  8353. points.forEach(function (item, index) {
  8354. if (item !== null) {
  8355. context.moveTo(item.x - 3.5, item.y - 3.5);
  8356. context.rect(item.x - 3.5, item.y - 3.5, 7, 7);
  8357. }
  8358. });
  8359. } else if (shape === 'triangle') {
  8360. points.forEach(function (item, index) {
  8361. if (item !== null) {
  8362. context.moveTo(item.x, item.y - 4.5);
  8363. context.lineTo(item.x - 4.5, item.y + 4.5);
  8364. context.lineTo(item.x + 4.5, item.y + 4.5);
  8365. context.lineTo(item.x, item.y - 4.5);
  8366. }
  8367. });
  8368. } else if (shape === 'triangle') {
  8369. return;
  8370. }
  8371. context.closePath();
  8372. context.fill();
  8373. context.stroke();
  8374. });
  8375. if (opts.dataLabel !== false && process === 1) {
  8376. series.forEach(function (eachSeries, seriesIndex) {
  8377. var ranges, minRange, maxRange;
  8378. ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
  8379. minRange = ranges.pop();
  8380. maxRange = ranges.shift();
  8381. var data = eachSeries.data;
  8382. var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
  8383. drawPointText(points, eachSeries, config, context, opts);
  8384. });
  8385. }
  8386. context.restore();
  8387. return {
  8388. xAxisPoints: xAxisPoints,
  8389. calPoints: calPoints,
  8390. eachSpacing: eachSpacing };
  8391. }
  8392. function drawBubbleDataPoints(series, opts, config, context) {
  8393. var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
  8394. var bubbleOption = assign({}, {
  8395. opacity: 1,
  8396. border: 2 },
  8397. opts.extra.bubble);
  8398. var xAxisData = opts.chartData.xAxisData,
  8399. xAxisPoints = xAxisData.xAxisPoints,
  8400. eachSpacing = xAxisData.eachSpacing;
  8401. var calPoints = [];
  8402. context.save();
  8403. var leftSpace = 0;
  8404. var rightSpace = opts.width + eachSpacing;
  8405. if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) {
  8406. context.translate(opts._scrollDistance_, 0);
  8407. leftSpace = -opts._scrollDistance_ - eachSpacing * 2 + opts.area[3];
  8408. rightSpace = leftSpace + (opts.xAxis.itemCount + 4) * eachSpacing;
  8409. }
  8410. series.forEach(function (eachSeries, seriesIndex) {
  8411. var ranges, minRange, maxRange;
  8412. ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
  8413. minRange = ranges.pop();
  8414. maxRange = ranges.shift();
  8415. var data = eachSeries.data;
  8416. var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
  8417. context.beginPath();
  8418. context.setStrokeStyle(eachSeries.color);
  8419. context.setLineWidth(bubbleOption.border * opts.pix);
  8420. context.setFillStyle(hexToRgb(eachSeries.color, bubbleOption.opacity));
  8421. points.forEach(function (item, index) {
  8422. context.moveTo(item.x + item.r, item.y);
  8423. context.arc(item.x, item.y, item.r * opts.pix, 0, 2 * Math.PI, false);
  8424. });
  8425. context.closePath();
  8426. context.fill();
  8427. context.stroke();
  8428. if (opts.dataLabel !== false && process === 1) {
  8429. points.forEach(function (item, index) {
  8430. context.beginPath();
  8431. var fontSize = series.textSize * opts.pix || config.fontSize;
  8432. context.setFontSize(fontSize);
  8433. context.setFillStyle(series.textColor || "#FFFFFF");
  8434. context.setTextAlign('center');
  8435. context.fillText(String(item.t), item.x, item.y + fontSize / 2);
  8436. context.closePath();
  8437. context.stroke();
  8438. context.setTextAlign('left');
  8439. });
  8440. }
  8441. });
  8442. context.restore();
  8443. return {
  8444. xAxisPoints: xAxisPoints,
  8445. calPoints: calPoints,
  8446. eachSpacing: eachSpacing };
  8447. }
  8448. function drawLineDataPoints(series, opts, config, context) {
  8449. var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
  8450. var lineOption = assign({}, {
  8451. type: 'straight',
  8452. width: 2 },
  8453. opts.extra.line);
  8454. lineOption.width *= opts.pix;
  8455. var xAxisData = opts.chartData.xAxisData,
  8456. xAxisPoints = xAxisData.xAxisPoints,
  8457. eachSpacing = xAxisData.eachSpacing;
  8458. var calPoints = [];
  8459. context.save();
  8460. var leftSpace = 0;
  8461. var rightSpace = opts.width + eachSpacing;
  8462. if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) {
  8463. context.translate(opts._scrollDistance_, 0);
  8464. leftSpace = -opts._scrollDistance_ - eachSpacing * 2 + opts.area[3];
  8465. rightSpace = leftSpace + (opts.xAxis.itemCount + 4) * eachSpacing;
  8466. }
  8467. series.forEach(function (eachSeries, seriesIndex) {
  8468. var ranges, minRange, maxRange;
  8469. ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
  8470. minRange = ranges.pop();
  8471. maxRange = ranges.shift();
  8472. var data = eachSeries.data;
  8473. var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
  8474. calPoints.push(points);
  8475. var splitPointList = splitPoints(points, eachSeries);
  8476. if (eachSeries.lineType == 'dash') {
  8477. var dashLength = eachSeries.dashLength ? eachSeries.dashLength : 8;
  8478. dashLength *= opts.pix;
  8479. context.setLineDash([dashLength, dashLength]);
  8480. }
  8481. context.beginPath();
  8482. context.setStrokeStyle(eachSeries.color);
  8483. context.setLineWidth(lineOption.width);
  8484. splitPointList.forEach(function (points, index) {
  8485. if (points.length === 1) {
  8486. context.moveTo(points[0].x, points[0].y);
  8487. context.arc(points[0].x, points[0].y, 1, 0, 2 * Math.PI);
  8488. } else {
  8489. context.moveTo(points[0].x, points[0].y);
  8490. var startPoint = 0;
  8491. if (lineOption.type === 'curve') {
  8492. for (var j = 0; j < points.length; j++) {
  8493. var item = points[j];
  8494. if (startPoint == 0 && item.x > leftSpace) {
  8495. context.moveTo(item.x, item.y);
  8496. startPoint = 1;
  8497. }
  8498. if (j > 0 && item.x > leftSpace && item.x < rightSpace) {
  8499. var ctrlPoint = createCurveControlPoints(points, j - 1);
  8500. context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y, item.x, item.y);
  8501. }
  8502. };
  8503. }
  8504. if (lineOption.type === 'straight') {
  8505. for (var _j6 = 0; _j6 < points.length; _j6++) {
  8506. var _item19 = points[_j6];
  8507. if (startPoint == 0 && _item19.x > leftSpace) {
  8508. context.moveTo(_item19.x, _item19.y);
  8509. startPoint = 1;
  8510. }
  8511. if (_j6 > 0 && _item19.x > leftSpace && _item19.x < rightSpace) {
  8512. context.lineTo(_item19.x, _item19.y);
  8513. }
  8514. };
  8515. }
  8516. if (lineOption.type === 'step') {
  8517. for (var _j7 = 0; _j7 < points.length; _j7++) {
  8518. var _item20 = points[_j7];
  8519. if (startPoint == 0 && _item20.x > leftSpace) {
  8520. context.moveTo(_item20.x, _item20.y);
  8521. startPoint = 1;
  8522. }
  8523. if (_j7 > 0 && _item20.x > leftSpace && _item20.x < rightSpace) {
  8524. context.lineTo(_item20.x, points[_j7 - 1].y);
  8525. context.lineTo(_item20.x, _item20.y);
  8526. }
  8527. };
  8528. }
  8529. context.moveTo(points[0].x, points[0].y);
  8530. }
  8531. });
  8532. context.stroke();
  8533. context.setLineDash([]);
  8534. if (opts.dataPointShape !== false) {
  8535. drawPointShape(points, eachSeries.color, eachSeries.pointShape, context, opts);
  8536. }
  8537. });
  8538. if (opts.dataLabel !== false && process === 1) {
  8539. series.forEach(function (eachSeries, seriesIndex) {
  8540. var ranges, minRange, maxRange;
  8541. ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
  8542. minRange = ranges.pop();
  8543. maxRange = ranges.shift();
  8544. var data = eachSeries.data;
  8545. var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
  8546. drawPointText(points, eachSeries, config, context, opts);
  8547. });
  8548. }
  8549. context.restore();
  8550. return {
  8551. xAxisPoints: xAxisPoints,
  8552. calPoints: calPoints,
  8553. eachSpacing: eachSpacing };
  8554. }
  8555. function drawMixDataPoints(series, opts, config, context) {
  8556. var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
  8557. var xAxisData = opts.chartData.xAxisData,
  8558. xAxisPoints = xAxisData.xAxisPoints,
  8559. eachSpacing = xAxisData.eachSpacing;
  8560. var columnOption = assign({}, {
  8561. width: eachSpacing / 2,
  8562. barBorderCircle: false,
  8563. barBorderRadius: [],
  8564. seriesGap: 2,
  8565. linearType: 'none',
  8566. linearOpacity: 1,
  8567. customColor: [],
  8568. colorStop: 0 },
  8569. opts.extra.mix.column);
  8570. var areaOption = assign({}, {
  8571. opacity: 0.2,
  8572. gradient: false },
  8573. opts.extra.mix.area);
  8574. var endY = opts.height - opts.area[2];
  8575. var calPoints = [];
  8576. var columnIndex = 0;
  8577. var columnLength = 0;
  8578. series.forEach(function (eachSeries, seriesIndex) {
  8579. if (eachSeries.type == 'column') {
  8580. columnLength += 1;
  8581. }
  8582. });
  8583. context.save();
  8584. var leftNum = -2;
  8585. var rightNum = xAxisPoints.length + 2;
  8586. var leftSpace = 0;
  8587. var rightSpace = opts.width + eachSpacing;
  8588. if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) {
  8589. context.translate(opts._scrollDistance_, 0);
  8590. leftNum = Math.floor(-opts._scrollDistance_ / eachSpacing) - 2;
  8591. rightNum = leftNum + opts.xAxis.itemCount + 4;
  8592. leftSpace = -opts._scrollDistance_ - eachSpacing * 2 + opts.area[3];
  8593. rightSpace = leftSpace + (opts.xAxis.itemCount + 4) * eachSpacing;
  8594. }
  8595. columnOption.customColor = fillCustomColor(columnOption.linearType, columnOption.customColor, series, config);
  8596. series.forEach(function (eachSeries, seriesIndex) {
  8597. var ranges, minRange, maxRange;
  8598. ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
  8599. minRange = ranges.pop();
  8600. maxRange = ranges.shift();
  8601. var data = eachSeries.data;
  8602. var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
  8603. calPoints.push(points);
  8604. // 绘制柱状数据图
  8605. if (eachSeries.type == 'column') {
  8606. points = fixColumeData(points, eachSpacing, columnLength, columnIndex, config, opts);
  8607. for (var i = 0; i < points.length; i++) {
  8608. var item = points[i];
  8609. if (item !== null && i > leftNum && i < rightNum) {
  8610. var startX = item.x - item.width / 2;
  8611. var height = opts.height - item.y - opts.area[2];
  8612. context.beginPath();
  8613. var fillColor = item.color || eachSeries.color;
  8614. var strokeColor = item.color || eachSeries.color;
  8615. if (columnOption.linearType !== 'none') {
  8616. var grd = context.createLinearGradient(startX, item.y, startX, opts.height - opts.area[2]);
  8617. //透明渐变
  8618. if (columnOption.linearType == 'opacity') {
  8619. grd.addColorStop(0, hexToRgb(fillColor, columnOption.linearOpacity));
  8620. grd.addColorStop(1, hexToRgb(fillColor, 1));
  8621. } else {
  8622. grd.addColorStop(0, hexToRgb(columnOption.customColor[eachSeries.linearIndex], columnOption.linearOpacity));
  8623. grd.addColorStop(columnOption.colorStop, hexToRgb(columnOption.customColor[eachSeries.linearIndex], columnOption.linearOpacity));
  8624. grd.addColorStop(1, hexToRgb(fillColor, 1));
  8625. }
  8626. fillColor = grd;
  8627. }
  8628. // 圆角边框
  8629. if (columnOption.barBorderRadius && columnOption.barBorderRadius.length === 4 || columnOption.barBorderCircle) {
  8630. var left = startX;
  8631. var top = item.y;
  8632. var width = item.width;
  8633. var _height5 = opts.height - opts.area[2] - item.y;
  8634. if (columnOption.barBorderCircle) {
  8635. columnOption.barBorderRadius = [width / 2, width / 2, 0, 0];
  8636. }var _columnOption$barBord4 = _slicedToArray(
  8637. columnOption.barBorderRadius, 4),r0 = _columnOption$barBord4[0],r1 = _columnOption$barBord4[1],r2 = _columnOption$barBord4[2],r3 = _columnOption$barBord4[3];
  8638. var minRadius = Math.min(width / 2, _height5 / 2);
  8639. r0 = r0 > minRadius ? minRadius : r0;
  8640. r1 = r1 > minRadius ? minRadius : r1;
  8641. r2 = r2 > minRadius ? minRadius : r2;
  8642. r3 = r3 > minRadius ? minRadius : r3;
  8643. r0 = r0 < 0 ? 0 : r0;
  8644. r1 = r1 < 0 ? 0 : r1;
  8645. r2 = r2 < 0 ? 0 : r2;
  8646. r3 = r3 < 0 ? 0 : r3;
  8647. context.arc(left + r0, top + r0, r0, -Math.PI, -Math.PI / 2);
  8648. context.arc(left + width - r1, top + r1, r1, -Math.PI / 2, 0);
  8649. context.arc(left + width - r2, top + _height5 - r2, r2, 0, Math.PI / 2);
  8650. context.arc(left + r3, top + _height5 - r3, r3, Math.PI / 2, Math.PI);
  8651. } else {
  8652. context.moveTo(startX, item.y);
  8653. context.lineTo(startX + item.width, item.y);
  8654. context.lineTo(startX + item.width, opts.height - opts.area[2]);
  8655. context.lineTo(startX, opts.height - opts.area[2]);
  8656. context.lineTo(startX, item.y);
  8657. context.setLineWidth(1);
  8658. context.setStrokeStyle(strokeColor);
  8659. }
  8660. context.setFillStyle(fillColor);
  8661. context.closePath();
  8662. context.fill();
  8663. }
  8664. }
  8665. columnIndex += 1;
  8666. }
  8667. //绘制区域图数据
  8668. if (eachSeries.type == 'area') {
  8669. var _splitPointList = splitPoints(points, eachSeries);
  8670. for (var _i23 = 0; _i23 < _splitPointList.length; _i23++) {
  8671. var _points3 = _splitPointList[_i23];
  8672. // 绘制区域数据
  8673. context.beginPath();
  8674. context.setStrokeStyle(eachSeries.color);
  8675. context.setStrokeStyle(hexToRgb(eachSeries.color, areaOption.opacity));
  8676. if (areaOption.gradient) {
  8677. var gradient = context.createLinearGradient(0, opts.area[0], 0, opts.height - opts.area[2]);
  8678. gradient.addColorStop('0', hexToRgb(eachSeries.color, areaOption.opacity));
  8679. gradient.addColorStop('1.0', hexToRgb("#FFFFFF", 0.1));
  8680. context.setFillStyle(gradient);
  8681. } else {
  8682. context.setFillStyle(hexToRgb(eachSeries.color, areaOption.opacity));
  8683. }
  8684. context.setLineWidth(2 * opts.pix);
  8685. if (_points3.length > 1) {
  8686. var firstPoint = _points3[0];
  8687. var lastPoint = _points3[_points3.length - 1];
  8688. context.moveTo(firstPoint.x, firstPoint.y);
  8689. var startPoint = 0;
  8690. if (eachSeries.style === 'curve') {
  8691. for (var j = 0; j < _points3.length; j++) {
  8692. var _item21 = _points3[j];
  8693. if (startPoint == 0 && _item21.x > leftSpace) {
  8694. context.moveTo(_item21.x, _item21.y);
  8695. startPoint = 1;
  8696. }
  8697. if (j > 0 && _item21.x > leftSpace && _item21.x < rightSpace) {
  8698. var ctrlPoint = createCurveControlPoints(_points3, j - 1);
  8699. context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y, _item21.x, _item21.y);
  8700. }
  8701. };
  8702. } else {
  8703. for (var _j8 = 0; _j8 < _points3.length; _j8++) {
  8704. var _item22 = _points3[_j8];
  8705. if (startPoint == 0 && _item22.x > leftSpace) {
  8706. context.moveTo(_item22.x, _item22.y);
  8707. startPoint = 1;
  8708. }
  8709. if (_j8 > 0 && _item22.x > leftSpace && _item22.x < rightSpace) {
  8710. context.lineTo(_item22.x, _item22.y);
  8711. }
  8712. };
  8713. }
  8714. context.lineTo(lastPoint.x, endY);
  8715. context.lineTo(firstPoint.x, endY);
  8716. context.lineTo(firstPoint.x, firstPoint.y);
  8717. } else {
  8718. var _item23 = _points3[0];
  8719. context.moveTo(_item23.x - eachSpacing / 2, _item23.y);
  8720. context.lineTo(_item23.x + eachSpacing / 2, _item23.y);
  8721. context.lineTo(_item23.x + eachSpacing / 2, endY);
  8722. context.lineTo(_item23.x - eachSpacing / 2, endY);
  8723. context.moveTo(_item23.x - eachSpacing / 2, _item23.y);
  8724. }
  8725. context.closePath();
  8726. context.fill();
  8727. }
  8728. }
  8729. // 绘制折线数据图
  8730. if (eachSeries.type == 'line') {
  8731. var splitPointList = splitPoints(points, eachSeries);
  8732. splitPointList.forEach(function (points, index) {
  8733. if (eachSeries.lineType == 'dash') {
  8734. var dashLength = eachSeries.dashLength ? eachSeries.dashLength : 8;
  8735. dashLength *= opts.pix;
  8736. context.setLineDash([dashLength, dashLength]);
  8737. }
  8738. context.beginPath();
  8739. context.setStrokeStyle(eachSeries.color);
  8740. context.setLineWidth(2 * opts.pix);
  8741. if (points.length === 1) {
  8742. context.moveTo(points[0].x, points[0].y);
  8743. context.arc(points[0].x, points[0].y, 1, 0, 2 * Math.PI);
  8744. } else {
  8745. context.moveTo(points[0].x, points[0].y);
  8746. var _startPoint2 = 0;
  8747. if (eachSeries.style == 'curve') {
  8748. for (var _j9 = 0; _j9 < points.length; _j9++) {
  8749. var _item24 = points[_j9];
  8750. if (_startPoint2 == 0 && _item24.x > leftSpace) {
  8751. context.moveTo(_item24.x, _item24.y);
  8752. _startPoint2 = 1;
  8753. }
  8754. if (_j9 > 0 && _item24.x > leftSpace && _item24.x < rightSpace) {
  8755. var ctrlPoint = createCurveControlPoints(points, _j9 - 1);
  8756. context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y,
  8757. _item24.x, _item24.y);
  8758. }
  8759. }
  8760. } else {
  8761. for (var _j10 = 0; _j10 < points.length; _j10++) {
  8762. var _item25 = points[_j10];
  8763. if (_startPoint2 == 0 && _item25.x > leftSpace) {
  8764. context.moveTo(_item25.x, _item25.y);
  8765. _startPoint2 = 1;
  8766. }
  8767. if (_j10 > 0 && _item25.x > leftSpace && _item25.x < rightSpace) {
  8768. context.lineTo(_item25.x, _item25.y);
  8769. }
  8770. }
  8771. }
  8772. context.moveTo(points[0].x, points[0].y);
  8773. }
  8774. context.stroke();
  8775. context.setLineDash([]);
  8776. });
  8777. }
  8778. // 绘制点数据图
  8779. if (eachSeries.type == 'point') {
  8780. eachSeries.addPoint = true;
  8781. }
  8782. if (eachSeries.addPoint == true && eachSeries.type !== 'column') {
  8783. drawPointShape(points, eachSeries.color, eachSeries.pointShape, context, opts);
  8784. }
  8785. });
  8786. if (opts.dataLabel !== false && process === 1) {
  8787. var columnIndex = 0;
  8788. series.forEach(function (eachSeries, seriesIndex) {
  8789. var ranges, minRange, maxRange;
  8790. ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]);
  8791. minRange = ranges.pop();
  8792. maxRange = ranges.shift();
  8793. var data = eachSeries.data;
  8794. var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process);
  8795. if (eachSeries.type !== 'column') {
  8796. drawPointText(points, eachSeries, config, context, opts);
  8797. } else {
  8798. points = fixColumeData(points, eachSpacing, columnLength, columnIndex, config, opts);
  8799. drawPointText(points, eachSeries, config, context, opts);
  8800. columnIndex += 1;
  8801. }
  8802. });
  8803. }
  8804. context.restore();
  8805. return {
  8806. xAxisPoints: xAxisPoints,
  8807. calPoints: calPoints,
  8808. eachSpacing: eachSpacing };
  8809. }
  8810. function drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints) {
  8811. var toolTipOption = opts.extra.tooltip || {};
  8812. if (toolTipOption.horizentalLine && opts.tooltip && process === 1 && (opts.type == 'line' || opts.type == 'area' || opts.type == 'column' || opts.type == 'mount' || opts.type == 'candle' || opts.type == 'mix')) {
  8813. drawToolTipHorizentalLine(opts, config, context, eachSpacing, xAxisPoints);
  8814. }
  8815. context.save();
  8816. if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) {
  8817. context.translate(opts._scrollDistance_, 0);
  8818. }
  8819. if (opts.tooltip && opts.tooltip.textList && opts.tooltip.textList.length && process === 1) {
  8820. drawToolTip(opts.tooltip.textList, opts.tooltip.offset, opts, config, context, eachSpacing, xAxisPoints);
  8821. }
  8822. context.restore();
  8823. }
  8824. function drawXAxis(categories, opts, config, context) {
  8825. var xAxisData = opts.chartData.xAxisData,
  8826. xAxisPoints = xAxisData.xAxisPoints,
  8827. startX = xAxisData.startX,
  8828. endX = xAxisData.endX,
  8829. eachSpacing = xAxisData.eachSpacing;
  8830. var boundaryGap = 'center';
  8831. if (opts.type == 'bar' || opts.type == 'line' || opts.type == 'area' || opts.type == 'scatter' || opts.type == 'bubble') {
  8832. boundaryGap = opts.xAxis.boundaryGap;
  8833. }
  8834. var startY = opts.height - opts.area[2];
  8835. var endY = opts.area[0];
  8836. //绘制滚动条
  8837. if (opts.enableScroll && opts.xAxis.scrollShow) {
  8838. var scrollY = opts.height - opts.area[2] + config.xAxisHeight;
  8839. var scrollScreenWidth = endX - startX;
  8840. var scrollTotalWidth = eachSpacing * (xAxisPoints.length - 1);
  8841. if (opts.type == 'mount' && opts.extra && opts.extra.mount && opts.extra.mount.widthRatio && opts.extra.mount.widthRatio > 1) {
  8842. if (opts.extra.mount.widthRatio > 2) opts.extra.mount.widthRatio = 2;
  8843. scrollTotalWidth += (opts.extra.mount.widthRatio - 1) * eachSpacing;
  8844. }
  8845. var scrollWidth = scrollScreenWidth * scrollScreenWidth / scrollTotalWidth;
  8846. var scrollLeft = 0;
  8847. if (opts._scrollDistance_) {
  8848. scrollLeft = -opts._scrollDistance_ * scrollScreenWidth / scrollTotalWidth;
  8849. }
  8850. context.beginPath();
  8851. context.setLineCap('round');
  8852. context.setLineWidth(6 * opts.pix);
  8853. context.setStrokeStyle(opts.xAxis.scrollBackgroundColor || "#EFEBEF");
  8854. context.moveTo(startX, scrollY);
  8855. context.lineTo(endX, scrollY);
  8856. context.stroke();
  8857. context.closePath();
  8858. context.beginPath();
  8859. context.setLineCap('round');
  8860. context.setLineWidth(6 * opts.pix);
  8861. context.setStrokeStyle(opts.xAxis.scrollColor || "#A6A6A6");
  8862. context.moveTo(startX + scrollLeft, scrollY);
  8863. context.lineTo(startX + scrollLeft + scrollWidth, scrollY);
  8864. context.stroke();
  8865. context.closePath();
  8866. context.setLineCap('butt');
  8867. }
  8868. context.save();
  8869. if (opts._scrollDistance_ && opts._scrollDistance_ !== 0) {
  8870. context.translate(opts._scrollDistance_, 0);
  8871. }
  8872. //绘制X轴刻度线
  8873. if (opts.xAxis.calibration === true) {
  8874. context.setStrokeStyle(opts.xAxis.gridColor || "#cccccc");
  8875. context.setLineCap('butt');
  8876. context.setLineWidth(1 * opts.pix);
  8877. xAxisPoints.forEach(function (item, index) {
  8878. if (index > 0) {
  8879. context.beginPath();
  8880. context.moveTo(item - eachSpacing / 2, startY);
  8881. context.lineTo(item - eachSpacing / 2, startY + 3 * opts.pix);
  8882. context.closePath();
  8883. context.stroke();
  8884. }
  8885. });
  8886. }
  8887. //绘制X轴网格
  8888. if (opts.xAxis.disableGrid !== true) {
  8889. context.setStrokeStyle(opts.xAxis.gridColor || "#cccccc");
  8890. context.setLineCap('butt');
  8891. context.setLineWidth(1 * opts.pix);
  8892. if (opts.xAxis.gridType == 'dash') {
  8893. context.setLineDash([opts.xAxis.dashLength * opts.pix, opts.xAxis.dashLength * opts.pix]);
  8894. }
  8895. opts.xAxis.gridEval = opts.xAxis.gridEval || 1;
  8896. xAxisPoints.forEach(function (item, index) {
  8897. if (index % opts.xAxis.gridEval == 0) {
  8898. context.beginPath();
  8899. context.moveTo(item, startY);
  8900. context.lineTo(item, endY);
  8901. context.stroke();
  8902. }
  8903. });
  8904. context.setLineDash([]);
  8905. }
  8906. //绘制X轴文案
  8907. if (opts.xAxis.disabled !== true) {
  8908. // 对X轴列表做抽稀处理
  8909. //默认全部显示X轴标签
  8910. var maxXAxisListLength = categories.length;
  8911. //如果设置了X轴单屏数量
  8912. if (opts.xAxis.labelCount) {
  8913. //如果设置X轴密度
  8914. if (opts.xAxis.itemCount) {
  8915. maxXAxisListLength = Math.ceil(categories.length / opts.xAxis.itemCount * opts.xAxis.labelCount);
  8916. } else {
  8917. maxXAxisListLength = opts.xAxis.labelCount;
  8918. }
  8919. maxXAxisListLength -= 1;
  8920. }
  8921. var ratio = Math.ceil(categories.length / maxXAxisListLength);
  8922. var newCategories = [];
  8923. var cgLength = categories.length;
  8924. for (var i = 0; i < cgLength; i++) {
  8925. if (i % ratio !== 0) {
  8926. newCategories.push("");
  8927. } else {
  8928. newCategories.push(categories[i]);
  8929. }
  8930. }
  8931. newCategories[cgLength - 1] = categories[cgLength - 1];
  8932. var xAxisFontSize = opts.xAxis.fontSize * opts.pix || config.fontSize;
  8933. if (config._xAxisTextAngle_ === 0) {
  8934. newCategories.forEach(function (item, index) {
  8935. var xitem = opts.xAxis.formatter ? opts.xAxis.formatter(item, index, opts) : item;
  8936. var offset = -measureText(String(xitem), xAxisFontSize, context) / 2;
  8937. if (boundaryGap == 'center') {
  8938. offset += eachSpacing / 2;
  8939. }
  8940. var scrollHeight = 0;
  8941. if (opts.xAxis.scrollShow) {
  8942. scrollHeight = 6 * opts.pix;
  8943. }
  8944. context.beginPath();
  8945. context.setFontSize(xAxisFontSize);
  8946. context.setFillStyle(opts.xAxis.fontColor || opts.fontColor);
  8947. context.fillText(String(xitem), xAxisPoints[index] + offset, startY + xAxisFontSize + (config.xAxisHeight - scrollHeight - xAxisFontSize) / 2);
  8948. context.closePath();
  8949. context.stroke();
  8950. });
  8951. } else {
  8952. newCategories.forEach(function (item, index) {
  8953. var xitem = opts.xAxis.formatter ? opts.xAxis.formatter(item) : item;
  8954. context.save();
  8955. context.beginPath();
  8956. context.setFontSize(xAxisFontSize);
  8957. context.setFillStyle(opts.xAxis.fontColor || opts.fontColor);
  8958. var textWidth = measureText(String(xitem), xAxisFontSize, context);
  8959. var offsetX = xAxisPoints[index];
  8960. if (boundaryGap == 'center') {
  8961. offsetX = xAxisPoints[index] + eachSpacing / 2;
  8962. }
  8963. var scrollHeight = 0;
  8964. if (opts.xAxis.scrollShow) {
  8965. scrollHeight = 6 * opts.pix;
  8966. }
  8967. var offsetY = startY + 6 * opts.pix + xAxisFontSize - xAxisFontSize * Math.abs(Math.sin(config._xAxisTextAngle_));
  8968. if (opts.xAxis.rotateAngle < 0) {
  8969. offsetX -= xAxisFontSize / 2;
  8970. textWidth = 0;
  8971. } else {
  8972. offsetX += xAxisFontSize / 2;
  8973. textWidth = -textWidth;
  8974. }
  8975. context.translate(offsetX, offsetY);
  8976. context.rotate(-1 * config._xAxisTextAngle_);
  8977. context.fillText(String(xitem), textWidth, 0);
  8978. context.closePath();
  8979. context.stroke();
  8980. context.restore();
  8981. });
  8982. }
  8983. }
  8984. context.restore();
  8985. //绘制X轴轴线
  8986. if (opts.xAxis.axisLine) {
  8987. context.beginPath();
  8988. context.setStrokeStyle(opts.xAxis.axisLineColor);
  8989. context.setLineWidth(1 * opts.pix);
  8990. context.moveTo(startX, opts.height - opts.area[2]);
  8991. context.lineTo(endX, opts.height - opts.area[2]);
  8992. context.stroke();
  8993. }
  8994. }
  8995. function drawYAxisGrid(categories, opts, config, context) {
  8996. if (opts.yAxis.disableGrid === true) {
  8997. return;
  8998. }
  8999. var spacingValid = opts.height - opts.area[0] - opts.area[2];
  9000. var eachSpacing = spacingValid / opts.yAxis.splitNumber;
  9001. var startX = opts.area[3];
  9002. var xAxisPoints = opts.chartData.xAxisData.xAxisPoints,
  9003. xAxiseachSpacing = opts.chartData.xAxisData.eachSpacing;
  9004. var TotalWidth = xAxiseachSpacing * (xAxisPoints.length - 1);
  9005. if (opts.type == 'mount' && opts.extra && opts.extra.mount && opts.extra.mount.widthRatio && opts.extra.mount.widthRatio > 1) {
  9006. if (opts.extra.mount.widthRatio > 2) opts.extra.mount.widthRatio = 2;
  9007. TotalWidth += (opts.extra.mount.widthRatio - 1) * xAxiseachSpacing;
  9008. }
  9009. var endX = startX + TotalWidth;
  9010. var points = [];
  9011. var startY = 1;
  9012. if (opts.xAxis.axisLine === false) {
  9013. startY = 0;
  9014. }
  9015. for (var i = startY; i < opts.yAxis.splitNumber + 1; i++) {
  9016. points.push(opts.height - opts.area[2] - eachSpacing * i);
  9017. }
  9018. context.save();
  9019. if (opts._scrollDistance_ && opts._scrollDistance_ !== 0) {
  9020. context.translate(opts._scrollDistance_, 0);
  9021. }
  9022. if (opts.yAxis.gridType == 'dash') {
  9023. context.setLineDash([opts.yAxis.dashLength * opts.pix, opts.yAxis.dashLength * opts.pix]);
  9024. }
  9025. context.setStrokeStyle(opts.yAxis.gridColor);
  9026. context.setLineWidth(1 * opts.pix);
  9027. points.forEach(function (item, index) {
  9028. context.beginPath();
  9029. context.moveTo(startX, item);
  9030. context.lineTo(endX, item);
  9031. context.stroke();
  9032. });
  9033. context.setLineDash([]);
  9034. context.restore();
  9035. }
  9036. function drawYAxis(series, opts, config, context) {
  9037. if (opts.yAxis.disabled === true) {
  9038. return;
  9039. }
  9040. var spacingValid = opts.height - opts.area[0] - opts.area[2];
  9041. var eachSpacing = spacingValid / opts.yAxis.splitNumber;
  9042. var startX = opts.area[3];
  9043. var endX = opts.width - opts.area[1];
  9044. var endY = opts.height - opts.area[2];
  9045. var fillEndY = endY + config.xAxisHeight;
  9046. if (opts.xAxis.scrollShow) {
  9047. fillEndY -= 3 * opts.pix;
  9048. }
  9049. if (opts.xAxis.rotateLabel) {
  9050. fillEndY = opts.height - opts.area[2] + opts.fontSize * opts.pix / 2;
  9051. }
  9052. // set YAxis background
  9053. context.beginPath();
  9054. context.setFillStyle(opts.background);
  9055. if (opts.enableScroll == true && opts.xAxis.scrollPosition && opts.xAxis.scrollPosition !== 'left') {
  9056. context.fillRect(0, 0, startX, fillEndY);
  9057. }
  9058. if (opts.enableScroll == true && opts.xAxis.scrollPosition && opts.xAxis.scrollPosition !== 'right') {
  9059. context.fillRect(endX, 0, opts.width, fillEndY);
  9060. }
  9061. context.closePath();
  9062. context.stroke();
  9063. var tStartLeft = opts.area[3];
  9064. var tStartRight = opts.width - opts.area[1];
  9065. var tStartCenter = opts.area[3] + (opts.width - opts.area[1] - opts.area[3]) / 2;
  9066. if (opts.yAxis.data) {var _loop4 = function _loop4(
  9067. i) {
  9068. var yData = opts.yAxis.data[i];
  9069. points = [];
  9070. if (yData.type === 'categories') {
  9071. for (var _i24 = 0; _i24 <= yData.categories.length; _i24++) {
  9072. points.push(opts.area[0] + spacingValid / yData.categories.length / 2 + spacingValid / yData.categories.length * _i24);
  9073. }
  9074. } else {
  9075. for (var _i25 = 0; _i25 <= opts.yAxis.splitNumber; _i25++) {
  9076. points.push(opts.area[0] + eachSpacing * _i25);
  9077. }
  9078. }
  9079. if (yData.disabled !== true) {
  9080. var rangesFormat = opts.chartData.yAxisData.rangesFormat[i];
  9081. var yAxisFontSize = yData.fontSize ? yData.fontSize * opts.pix : config.fontSize;
  9082. var yAxisWidth = opts.chartData.yAxisData.yAxisWidth[i];
  9083. var textAlign = yData.textAlign || "right";
  9084. //画Y轴刻度及文案
  9085. rangesFormat.forEach(function (item, index) {
  9086. var pos = points[index];
  9087. context.beginPath();
  9088. context.setFontSize(yAxisFontSize);
  9089. context.setLineWidth(1 * opts.pix);
  9090. context.setStrokeStyle(yData.axisLineColor || '#cccccc');
  9091. context.setFillStyle(yData.fontColor || opts.fontColor);
  9092. var tmpstrat = 0;
  9093. var gapwidth = 4 * opts.pix;
  9094. if (yAxisWidth.position == 'left') {
  9095. //画刻度线
  9096. if (yData.calibration == true) {
  9097. context.moveTo(tStartLeft, pos);
  9098. context.lineTo(tStartLeft - 3 * opts.pix, pos);
  9099. gapwidth += 3 * opts.pix;
  9100. }
  9101. //画文字
  9102. switch (textAlign) {
  9103. case "left":
  9104. context.setTextAlign('left');
  9105. tmpstrat = tStartLeft - yAxisWidth.width;
  9106. break;
  9107. case "right":
  9108. context.setTextAlign('right');
  9109. tmpstrat = tStartLeft - gapwidth;
  9110. break;
  9111. default:
  9112. context.setTextAlign('center');
  9113. tmpstrat = tStartLeft - yAxisWidth.width / 2;}
  9114. context.fillText(String(item), tmpstrat, pos + yAxisFontSize / 2 - 3 * opts.pix);
  9115. } else if (yAxisWidth.position == 'right') {
  9116. //画刻度线
  9117. if (yData.calibration == true) {
  9118. context.moveTo(tStartRight, pos);
  9119. context.lineTo(tStartRight + 3 * opts.pix, pos);
  9120. gapwidth += 3 * opts.pix;
  9121. }
  9122. switch (textAlign) {
  9123. case "left":
  9124. context.setTextAlign('left');
  9125. tmpstrat = tStartRight + gapwidth;
  9126. break;
  9127. case "right":
  9128. context.setTextAlign('right');
  9129. tmpstrat = tStartRight + yAxisWidth.width;
  9130. break;
  9131. default:
  9132. context.setTextAlign('center');
  9133. tmpstrat = tStartRight + yAxisWidth.width / 2;}
  9134. context.fillText(String(item), tmpstrat, pos + yAxisFontSize / 2 - 3 * opts.pix);
  9135. } else if (yAxisWidth.position == 'center') {
  9136. //画刻度线
  9137. if (yData.calibration == true) {
  9138. context.moveTo(tStartCenter, pos);
  9139. context.lineTo(tStartCenter - 3 * opts.pix, pos);
  9140. gapwidth += 3 * opts.pix;
  9141. }
  9142. //画文字
  9143. switch (textAlign) {
  9144. case "left":
  9145. context.setTextAlign('left');
  9146. tmpstrat = tStartCenter - yAxisWidth.width;
  9147. break;
  9148. case "right":
  9149. context.setTextAlign('right');
  9150. tmpstrat = tStartCenter - gapwidth;
  9151. break;
  9152. default:
  9153. context.setTextAlign('center');
  9154. tmpstrat = tStartCenter - yAxisWidth.width / 2;}
  9155. context.fillText(String(item), tmpstrat, pos + yAxisFontSize / 2 - 3 * opts.pix);
  9156. }
  9157. context.closePath();
  9158. context.stroke();
  9159. context.setTextAlign('left');
  9160. });
  9161. //画Y轴轴线
  9162. if (yData.axisLine !== false) {
  9163. context.beginPath();
  9164. context.setStrokeStyle(yData.axisLineColor || '#cccccc');
  9165. context.setLineWidth(1 * opts.pix);
  9166. if (yAxisWidth.position == 'left') {
  9167. context.moveTo(tStartLeft, opts.height - opts.area[2]);
  9168. context.lineTo(tStartLeft, opts.area[0]);
  9169. } else if (yAxisWidth.position == 'right') {
  9170. context.moveTo(tStartRight, opts.height - opts.area[2]);
  9171. context.lineTo(tStartRight, opts.area[0]);
  9172. } else if (yAxisWidth.position == 'center') {
  9173. context.moveTo(tStartCenter, opts.height - opts.area[2]);
  9174. context.lineTo(tStartCenter, opts.area[0]);
  9175. }
  9176. context.stroke();
  9177. }
  9178. //画Y轴标题
  9179. if (opts.yAxis.showTitle) {
  9180. var titleFontSize = yData.titleFontSize * opts.pix || config.fontSize;
  9181. var title = yData.title;
  9182. context.beginPath();
  9183. context.setFontSize(titleFontSize);
  9184. context.setFillStyle(yData.titleFontColor || opts.fontColor);
  9185. if (yAxisWidth.position == 'left') {
  9186. context.fillText(title, tStartLeft - measureText(title, titleFontSize, context) / 2 + (yData.titleOffsetX || 0), opts.area[0] - (10 - (yData.titleOffsetY || 0)) * opts.pix);
  9187. } else if (yAxisWidth.position == 'right') {
  9188. context.fillText(title, tStartRight - measureText(title, titleFontSize, context) / 2 + (yData.titleOffsetX || 0), opts.area[0] - (10 - (yData.titleOffsetY || 0)) * opts.pix);
  9189. } else if (yAxisWidth.position == 'center') {
  9190. context.fillText(title, tStartCenter - measureText(title, titleFontSize, context) / 2 + (yData.titleOffsetX || 0), opts.area[0] - (10 - (yData.titleOffsetY || 0)) * opts.pix);
  9191. }
  9192. context.closePath();
  9193. context.stroke();
  9194. }
  9195. if (yAxisWidth.position == 'left') {
  9196. tStartLeft -= yAxisWidth.width + opts.yAxis.padding * opts.pix;
  9197. } else {
  9198. tStartRight += yAxisWidth.width + opts.yAxis.padding * opts.pix;
  9199. }
  9200. }};for (var i = 0; i < opts.yAxis.data.length; i++) {var points;_loop4(i);
  9201. }
  9202. }
  9203. }
  9204. function drawLegend(series, opts, config, context, chartData) {
  9205. if (opts.legend.show === false) {
  9206. return;
  9207. }
  9208. var legendData = chartData.legendData;
  9209. var legendList = legendData.points;
  9210. var legendArea = legendData.area;
  9211. var padding = opts.legend.padding * opts.pix;
  9212. var fontSize = opts.legend.fontSize * opts.pix;
  9213. var shapeWidth = 15 * opts.pix;
  9214. var shapeRight = 5 * opts.pix;
  9215. var itemGap = opts.legend.itemGap * opts.pix;
  9216. var lineHeight = Math.max(opts.legend.lineHeight * opts.pix, fontSize);
  9217. //画背景及边框
  9218. context.beginPath();
  9219. context.setLineWidth(opts.legend.borderWidth * opts.pix);
  9220. context.setStrokeStyle(opts.legend.borderColor);
  9221. context.setFillStyle(opts.legend.backgroundColor);
  9222. context.moveTo(legendArea.start.x, legendArea.start.y);
  9223. context.rect(legendArea.start.x, legendArea.start.y, legendArea.width, legendArea.height);
  9224. context.closePath();
  9225. context.fill();
  9226. context.stroke();
  9227. legendList.forEach(function (itemList, listIndex) {
  9228. var width = 0;
  9229. var height = 0;
  9230. width = legendData.widthArr[listIndex];
  9231. height = legendData.heightArr[listIndex];
  9232. var startX = 0;
  9233. var startY = 0;
  9234. if (opts.legend.position == 'top' || opts.legend.position == 'bottom') {
  9235. switch (opts.legend.float) {
  9236. case 'left':
  9237. startX = legendArea.start.x + padding;
  9238. break;
  9239. case 'right':
  9240. startX = legendArea.start.x + legendArea.width - width;
  9241. break;
  9242. default:
  9243. startX = legendArea.start.x + (legendArea.width - width) / 2;}
  9244. startY = legendArea.start.y + padding + listIndex * lineHeight;
  9245. } else {
  9246. if (listIndex == 0) {
  9247. width = 0;
  9248. } else {
  9249. width = legendData.widthArr[listIndex - 1];
  9250. }
  9251. startX = legendArea.start.x + padding + width;
  9252. startY = legendArea.start.y + padding + (legendArea.height - height) / 2;
  9253. }
  9254. context.setFontSize(config.fontSize);
  9255. for (var i = 0; i < itemList.length; i++) {
  9256. var item = itemList[i];
  9257. item.area = [0, 0, 0, 0];
  9258. item.area[0] = startX;
  9259. item.area[1] = startY;
  9260. item.area[3] = startY + lineHeight;
  9261. context.beginPath();
  9262. context.setLineWidth(1 * opts.pix);
  9263. context.setStrokeStyle(item.show ? item.color : opts.legend.hiddenColor);
  9264. context.setFillStyle(item.show ? item.color : opts.legend.hiddenColor);
  9265. switch (item.legendShape) {
  9266. case 'line':
  9267. context.moveTo(startX, startY + 0.5 * lineHeight - 2 * opts.pix);
  9268. context.fillRect(startX, startY + 0.5 * lineHeight - 2 * opts.pix, 15 * opts.pix, 4 * opts.pix);
  9269. break;
  9270. case 'triangle':
  9271. context.moveTo(startX + 7.5 * opts.pix, startY + 0.5 * lineHeight - 5 * opts.pix);
  9272. context.lineTo(startX + 2.5 * opts.pix, startY + 0.5 * lineHeight + 5 * opts.pix);
  9273. context.lineTo(startX + 12.5 * opts.pix, startY + 0.5 * lineHeight + 5 * opts.pix);
  9274. context.lineTo(startX + 7.5 * opts.pix, startY + 0.5 * lineHeight - 5 * opts.pix);
  9275. break;
  9276. case 'diamond':
  9277. context.moveTo(startX + 7.5 * opts.pix, startY + 0.5 * lineHeight - 5 * opts.pix);
  9278. context.lineTo(startX + 2.5 * opts.pix, startY + 0.5 * lineHeight);
  9279. context.lineTo(startX + 7.5 * opts.pix, startY + 0.5 * lineHeight + 5 * opts.pix);
  9280. context.lineTo(startX + 12.5 * opts.pix, startY + 0.5 * lineHeight);
  9281. context.lineTo(startX + 7.5 * opts.pix, startY + 0.5 * lineHeight - 5 * opts.pix);
  9282. break;
  9283. case 'circle':
  9284. context.moveTo(startX + 7.5 * opts.pix, startY + 0.5 * lineHeight);
  9285. context.arc(startX + 7.5 * opts.pix, startY + 0.5 * lineHeight, 5 * opts.pix, 0, 2 * Math.PI);
  9286. break;
  9287. case 'rect':
  9288. context.moveTo(startX, startY + 0.5 * lineHeight - 5 * opts.pix);
  9289. context.fillRect(startX, startY + 0.5 * lineHeight - 5 * opts.pix, 15 * opts.pix, 10 * opts.pix);
  9290. break;
  9291. case 'square':
  9292. context.moveTo(startX + 5 * opts.pix, startY + 0.5 * lineHeight - 5 * opts.pix);
  9293. context.fillRect(startX + 5 * opts.pix, startY + 0.5 * lineHeight - 5 * opts.pix, 10 * opts.pix, 10 * opts.pix);
  9294. break;
  9295. case 'none':
  9296. break;
  9297. default:
  9298. context.moveTo(startX, startY + 0.5 * lineHeight - 5 * opts.pix);
  9299. context.fillRect(startX, startY + 0.5 * lineHeight - 5 * opts.pix, 15 * opts.pix, 10 * opts.pix);}
  9300. context.closePath();
  9301. context.fill();
  9302. context.stroke();
  9303. startX += shapeWidth + shapeRight;
  9304. var fontTrans = 0.5 * lineHeight + 0.5 * fontSize - 2;
  9305. var legendText = item.legendText ? item.legendText : item.name;
  9306. context.beginPath();
  9307. context.setFontSize(fontSize);
  9308. context.setFillStyle(item.show ? opts.legend.fontColor : opts.legend.hiddenColor);
  9309. context.fillText(legendText, startX, startY + fontTrans);
  9310. context.closePath();
  9311. context.stroke();
  9312. if (opts.legend.position == 'top' || opts.legend.position == 'bottom') {
  9313. startX += measureText(legendText, fontSize, context) + itemGap;
  9314. item.area[2] = startX;
  9315. } else {
  9316. item.area[2] = startX + measureText(legendText, fontSize, context) + itemGap;;
  9317. startX -= shapeWidth + shapeRight;
  9318. startY += lineHeight;
  9319. }
  9320. }
  9321. });
  9322. }
  9323. function drawPieDataPoints(series, opts, config, context) {
  9324. var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
  9325. var pieOption = assign({}, {
  9326. activeOpacity: 0.5,
  9327. activeRadius: 10,
  9328. offsetAngle: 0,
  9329. labelWidth: 15,
  9330. ringWidth: 30,
  9331. customRadius: 0,
  9332. border: false,
  9333. borderWidth: 2,
  9334. borderColor: '#FFFFFF',
  9335. centerColor: '#FFFFFF',
  9336. linearType: 'none',
  9337. customColor: [] },
  9338. opts.type == "pie" ? opts.extra.pie : opts.extra.ring);
  9339. var centerPosition = {
  9340. x: opts.area[3] + (opts.width - opts.area[1] - opts.area[3]) / 2,
  9341. y: opts.area[0] + (opts.height - opts.area[0] - opts.area[2]) / 2 };
  9342. if (config.pieChartLinePadding == 0) {
  9343. config.pieChartLinePadding = pieOption.activeRadius * opts.pix;
  9344. }
  9345. var radius = Math.min((opts.width - opts.area[1] - opts.area[3]) / 2 - config.pieChartLinePadding - config.pieChartTextPadding - config._pieTextMaxLength_, (opts.height - opts.area[0] - opts.area[2]) / 2 - config.pieChartLinePadding - config.pieChartTextPadding);
  9346. radius = radius < 10 ? 10 : radius;
  9347. if (pieOption.customRadius > 0) {
  9348. radius = pieOption.customRadius * opts.pix;
  9349. }
  9350. series = getPieDataPoints(series, radius, process);
  9351. var activeRadius = pieOption.activeRadius * opts.pix;
  9352. pieOption.customColor = fillCustomColor(pieOption.linearType, pieOption.customColor, series, config);
  9353. series = series.map(function (eachSeries) {
  9354. eachSeries._start_ += pieOption.offsetAngle * Math.PI / 180;
  9355. return eachSeries;
  9356. });
  9357. series.forEach(function (eachSeries, seriesIndex) {
  9358. if (opts.tooltip) {
  9359. if (opts.tooltip.index == seriesIndex) {
  9360. context.beginPath();
  9361. context.setFillStyle(hexToRgb(eachSeries.color, pieOption.activeOpacity || 0.5));
  9362. context.moveTo(centerPosition.x, centerPosition.y);
  9363. context.arc(centerPosition.x, centerPosition.y, eachSeries._radius_ + activeRadius, eachSeries._start_, eachSeries._start_ + 2 * eachSeries._proportion_ * Math.PI);
  9364. context.closePath();
  9365. context.fill();
  9366. }
  9367. }
  9368. context.beginPath();
  9369. context.setLineWidth(pieOption.borderWidth * opts.pix);
  9370. context.lineJoin = "round";
  9371. context.setStrokeStyle(pieOption.borderColor);
  9372. var fillcolor = eachSeries.color;
  9373. if (pieOption.linearType == 'custom') {
  9374. var grd;
  9375. if (context.createCircularGradient) {
  9376. grd = context.createCircularGradient(centerPosition.x, centerPosition.y, eachSeries._radius_);
  9377. } else {
  9378. grd = context.createRadialGradient(centerPosition.x, centerPosition.y, 0, centerPosition.x, centerPosition.y, eachSeries._radius_);
  9379. }
  9380. grd.addColorStop(0, hexToRgb(pieOption.customColor[eachSeries.linearIndex], 1));
  9381. grd.addColorStop(1, hexToRgb(eachSeries.color, 1));
  9382. fillcolor = grd;
  9383. }
  9384. context.setFillStyle(fillcolor);
  9385. context.moveTo(centerPosition.x, centerPosition.y);
  9386. context.arc(centerPosition.x, centerPosition.y, eachSeries._radius_, eachSeries._start_, eachSeries._start_ + 2 * eachSeries._proportion_ * Math.PI);
  9387. context.closePath();
  9388. context.fill();
  9389. if (pieOption.border == true) {
  9390. context.stroke();
  9391. }
  9392. });
  9393. if (opts.type === 'ring') {
  9394. var innerPieWidth = radius * 0.6;
  9395. if (typeof pieOption.ringWidth === 'number' && pieOption.ringWidth > 0) {
  9396. innerPieWidth = Math.max(0, radius - pieOption.ringWidth * opts.pix);
  9397. }
  9398. context.beginPath();
  9399. context.setFillStyle(pieOption.centerColor);
  9400. context.moveTo(centerPosition.x, centerPosition.y);
  9401. context.arc(centerPosition.x, centerPosition.y, innerPieWidth, 0, 2 * Math.PI);
  9402. context.closePath();
  9403. context.fill();
  9404. }
  9405. if (opts.dataLabel !== false && process === 1) {
  9406. drawPieText(series, opts, config, context, radius, centerPosition);
  9407. }
  9408. if (process === 1 && opts.type === 'ring') {
  9409. drawRingTitle(opts, config, context, centerPosition);
  9410. }
  9411. return {
  9412. center: centerPosition,
  9413. radius: radius,
  9414. series: series };
  9415. }
  9416. function drawRoseDataPoints(series, opts, config, context) {
  9417. var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
  9418. var roseOption = assign({}, {
  9419. type: 'area',
  9420. activeOpacity: 0.5,
  9421. activeRadius: 10,
  9422. offsetAngle: 0,
  9423. labelWidth: 15,
  9424. border: false,
  9425. borderWidth: 2,
  9426. borderColor: '#FFFFFF',
  9427. linearType: 'none',
  9428. customColor: [] },
  9429. opts.extra.rose);
  9430. if (config.pieChartLinePadding == 0) {
  9431. config.pieChartLinePadding = roseOption.activeRadius * opts.pix;
  9432. }
  9433. var centerPosition = {
  9434. x: opts.area[3] + (opts.width - opts.area[1] - opts.area[3]) / 2,
  9435. y: opts.area[0] + (opts.height - opts.area[0] - opts.area[2]) / 2 };
  9436. var radius = Math.min((opts.width - opts.area[1] - opts.area[3]) / 2 - config.pieChartLinePadding - config.pieChartTextPadding - config._pieTextMaxLength_, (opts.height - opts.area[0] - opts.area[2]) / 2 - config.pieChartLinePadding - config.pieChartTextPadding);
  9437. radius = radius < 10 ? 10 : radius;
  9438. var minRadius = roseOption.minRadius || radius * 0.5;
  9439. series = getRoseDataPoints(series, roseOption.type, minRadius, radius, process);
  9440. var activeRadius = roseOption.activeRadius * opts.pix;
  9441. roseOption.customColor = fillCustomColor(roseOption.linearType, roseOption.customColor, series, config);
  9442. series = series.map(function (eachSeries) {
  9443. eachSeries._start_ += (roseOption.offsetAngle || 0) * Math.PI / 180;
  9444. return eachSeries;
  9445. });
  9446. series.forEach(function (eachSeries, seriesIndex) {
  9447. if (opts.tooltip) {
  9448. if (opts.tooltip.index == seriesIndex) {
  9449. context.beginPath();
  9450. context.setFillStyle(hexToRgb(eachSeries.color, roseOption.activeOpacity || 0.5));
  9451. context.moveTo(centerPosition.x, centerPosition.y);
  9452. context.arc(centerPosition.x, centerPosition.y, activeRadius + eachSeries._radius_, eachSeries._start_, eachSeries._start_ + 2 * eachSeries._rose_proportion_ * Math.PI);
  9453. context.closePath();
  9454. context.fill();
  9455. }
  9456. }
  9457. context.beginPath();
  9458. context.setLineWidth(roseOption.borderWidth * opts.pix);
  9459. context.lineJoin = "round";
  9460. context.setStrokeStyle(roseOption.borderColor);
  9461. var fillcolor = eachSeries.color;
  9462. if (roseOption.linearType == 'custom') {
  9463. var grd;
  9464. if (context.createCircularGradient) {
  9465. grd = context.createCircularGradient(centerPosition.x, centerPosition.y, eachSeries._radius_);
  9466. } else {
  9467. grd = context.createRadialGradient(centerPosition.x, centerPosition.y, 0, centerPosition.x, centerPosition.y, eachSeries._radius_);
  9468. }
  9469. grd.addColorStop(0, hexToRgb(roseOption.customColor[eachSeries.linearIndex], 1));
  9470. grd.addColorStop(1, hexToRgb(eachSeries.color, 1));
  9471. fillcolor = grd;
  9472. }
  9473. context.setFillStyle(fillcolor);
  9474. context.moveTo(centerPosition.x, centerPosition.y);
  9475. context.arc(centerPosition.x, centerPosition.y, eachSeries._radius_, eachSeries._start_, eachSeries._start_ + 2 * eachSeries._rose_proportion_ * Math.PI);
  9476. context.closePath();
  9477. context.fill();
  9478. if (roseOption.border == true) {
  9479. context.stroke();
  9480. }
  9481. });
  9482. if (opts.dataLabel !== false && process === 1) {
  9483. drawPieText(series, opts, config, context, radius, centerPosition);
  9484. }
  9485. return {
  9486. center: centerPosition,
  9487. radius: radius,
  9488. series: series };
  9489. }
  9490. function drawArcbarDataPoints(series, opts, config, context) {
  9491. var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
  9492. var arcbarOption = assign({}, {
  9493. startAngle: 0.75,
  9494. endAngle: 0.25,
  9495. type: 'default',
  9496. lineCap: 'round',
  9497. width: 12,
  9498. gap: 2,
  9499. linearType: 'none',
  9500. customColor: [] },
  9501. opts.extra.arcbar);
  9502. series = getArcbarDataPoints(series, arcbarOption, process);
  9503. var centerPosition;
  9504. if (arcbarOption.centerX || arcbarOption.centerY) {
  9505. centerPosition = {
  9506. x: arcbarOption.centerX ? arcbarOption.centerX : opts.width / 2,
  9507. y: arcbarOption.centerY ? arcbarOption.centerY : opts.height / 2 };
  9508. } else {
  9509. centerPosition = {
  9510. x: opts.width / 2,
  9511. y: opts.height / 2 };
  9512. }
  9513. var radius;
  9514. if (arcbarOption.radius) {
  9515. radius = arcbarOption.radius;
  9516. } else {
  9517. radius = Math.min(centerPosition.x, centerPosition.y);
  9518. radius -= 5 * opts.pix;
  9519. radius -= arcbarOption.width / 2;
  9520. }
  9521. radius = radius < 10 ? 10 : radius;
  9522. arcbarOption.customColor = fillCustomColor(arcbarOption.linearType, arcbarOption.customColor, series, config);
  9523. for (var i = 0; i < series.length; i++) {
  9524. var eachSeries = series[i];
  9525. //背景颜色
  9526. context.setLineWidth(arcbarOption.width * opts.pix);
  9527. context.setStrokeStyle(arcbarOption.backgroundColor || '#E9E9E9');
  9528. context.setLineCap(arcbarOption.lineCap);
  9529. context.beginPath();
  9530. if (arcbarOption.type == 'default') {
  9531. context.arc(centerPosition.x, centerPosition.y, radius - (arcbarOption.width * opts.pix + arcbarOption.gap * opts.pix) * i, arcbarOption.startAngle * Math.PI, arcbarOption.endAngle * Math.PI, false);
  9532. } else {
  9533. context.arc(centerPosition.x, centerPosition.y, radius - (arcbarOption.width * opts.pix + arcbarOption.gap * opts.pix) * i, 0, 2 * Math.PI, false);
  9534. }
  9535. context.stroke();
  9536. //进度条
  9537. var fillColor = eachSeries.color;
  9538. if (arcbarOption.linearType == 'custom') {
  9539. var grd = context.createLinearGradient(centerPosition.x - radius, centerPosition.y, centerPosition.x + radius, centerPosition.y);
  9540. grd.addColorStop(1, hexToRgb(arcbarOption.customColor[eachSeries.linearIndex], 1));
  9541. grd.addColorStop(0, hexToRgb(eachSeries.color, 1));
  9542. fillColor = grd;
  9543. }
  9544. context.setLineWidth(arcbarOption.width * opts.pix);
  9545. context.setStrokeStyle(fillColor);
  9546. context.setLineCap(arcbarOption.lineCap);
  9547. context.beginPath();
  9548. context.arc(centerPosition.x, centerPosition.y, radius - (arcbarOption.width * opts.pix + arcbarOption.gap * opts.pix) * i, arcbarOption.startAngle * Math.PI, eachSeries._proportion_ * Math.PI, false);
  9549. context.stroke();
  9550. }
  9551. drawRingTitle(opts, config, context, centerPosition);
  9552. return {
  9553. center: centerPosition,
  9554. radius: radius,
  9555. series: series };
  9556. }
  9557. function drawGaugeDataPoints(categories, series, opts, config, context) {
  9558. var process = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
  9559. var gaugeOption = assign({}, {
  9560. type: 'default',
  9561. startAngle: 0.75,
  9562. endAngle: 0.25,
  9563. width: 15,
  9564. labelOffset: 13,
  9565. splitLine: {
  9566. fixRadius: 0,
  9567. splitNumber: 10,
  9568. width: 15,
  9569. color: '#FFFFFF',
  9570. childNumber: 5,
  9571. childWidth: 5 },
  9572. pointer: {
  9573. width: 15,
  9574. color: 'auto' } },
  9575. opts.extra.gauge);
  9576. if (gaugeOption.oldAngle == undefined) {
  9577. gaugeOption.oldAngle = gaugeOption.startAngle;
  9578. }
  9579. if (gaugeOption.oldData == undefined) {
  9580. gaugeOption.oldData = 0;
  9581. }
  9582. categories = getGaugeAxisPoints(categories, gaugeOption.startAngle, gaugeOption.endAngle);
  9583. var centerPosition = {
  9584. x: opts.width / 2,
  9585. y: opts.height / 2 };
  9586. var radius = Math.min(centerPosition.x, centerPosition.y);
  9587. radius -= 5 * opts.pix;
  9588. radius -= gaugeOption.width / 2;
  9589. radius = radius < 10 ? 10 : radius;
  9590. var innerRadius = radius - gaugeOption.width;
  9591. var totalAngle = 0;
  9592. //判断仪表盘的样式:default百度样式,progress新样式
  9593. if (gaugeOption.type == 'progress') {
  9594. //## 第一步画中心圆形背景和进度条背景
  9595. //中心圆形背景
  9596. var pieRadius = radius - gaugeOption.width * 3;
  9597. context.beginPath();
  9598. var gradient = context.createLinearGradient(centerPosition.x, centerPosition.y - pieRadius, centerPosition.x, centerPosition.y + pieRadius);
  9599. //配置渐变填充(起点:中心点向上减半径;结束点中心点向下加半径)
  9600. gradient.addColorStop('0', hexToRgb(series[0].color, 0.3));
  9601. gradient.addColorStop('1.0', hexToRgb("#FFFFFF", 0.1));
  9602. context.setFillStyle(gradient);
  9603. context.arc(centerPosition.x, centerPosition.y, pieRadius, 0, 2 * Math.PI, false);
  9604. context.fill();
  9605. //画进度条背景
  9606. context.setLineWidth(gaugeOption.width);
  9607. context.setStrokeStyle(hexToRgb(series[0].color, 0.3));
  9608. context.setLineCap('round');
  9609. context.beginPath();
  9610. context.arc(centerPosition.x, centerPosition.y, innerRadius, gaugeOption.startAngle * Math.PI, gaugeOption.endAngle * Math.PI, false);
  9611. context.stroke();
  9612. //## 第二步画刻度线
  9613. totalAngle = gaugeOption.startAngle - gaugeOption.endAngle + 1;
  9614. var splitAngle = totalAngle / gaugeOption.splitLine.splitNumber;
  9615. var childAngle = totalAngle / gaugeOption.splitLine.splitNumber / gaugeOption.splitLine.childNumber;
  9616. var startX = -radius - gaugeOption.width * 0.5 - gaugeOption.splitLine.fixRadius;
  9617. var endX = -radius - gaugeOption.width - gaugeOption.splitLine.fixRadius + gaugeOption.splitLine.width;
  9618. context.save();
  9619. context.translate(centerPosition.x, centerPosition.y);
  9620. context.rotate((gaugeOption.startAngle - 1) * Math.PI);
  9621. var len = gaugeOption.splitLine.splitNumber * gaugeOption.splitLine.childNumber + 1;
  9622. var proc = series[0].data * process;
  9623. for (var i = 0; i < len; i++) {
  9624. context.beginPath();
  9625. //刻度线随进度变色
  9626. if (proc > i / len) {
  9627. context.setStrokeStyle(hexToRgb(series[0].color, 1));
  9628. } else {
  9629. context.setStrokeStyle(hexToRgb(series[0].color, 0.3));
  9630. }
  9631. context.setLineWidth(3 * opts.pix);
  9632. context.moveTo(startX, 0);
  9633. context.lineTo(endX, 0);
  9634. context.stroke();
  9635. context.rotate(childAngle * Math.PI);
  9636. }
  9637. context.restore();
  9638. //## 第三步画进度条
  9639. series = getGaugeArcbarDataPoints(series, gaugeOption, process);
  9640. context.setLineWidth(gaugeOption.width);
  9641. context.setStrokeStyle(series[0].color);
  9642. context.setLineCap('round');
  9643. context.beginPath();
  9644. context.arc(centerPosition.x, centerPosition.y, innerRadius, gaugeOption.startAngle * Math.PI, series[0]._proportion_ * Math.PI, false);
  9645. context.stroke();
  9646. //## 第四步画指针
  9647. var pointerRadius = radius - gaugeOption.width * 2.5;
  9648. context.save();
  9649. context.translate(centerPosition.x, centerPosition.y);
  9650. context.rotate((series[0]._proportion_ - 1) * Math.PI);
  9651. context.beginPath();
  9652. context.setLineWidth(gaugeOption.width / 3);
  9653. var gradient3 = context.createLinearGradient(0, -pointerRadius * 0.6, 0, pointerRadius * 0.6);
  9654. gradient3.addColorStop('0', hexToRgb('#FFFFFF', 0));
  9655. gradient3.addColorStop('0.5', hexToRgb(series[0].color, 1));
  9656. gradient3.addColorStop('1.0', hexToRgb('#FFFFFF', 0));
  9657. context.setStrokeStyle(gradient3);
  9658. context.arc(0, 0, pointerRadius, 0.85 * Math.PI, 1.15 * Math.PI, false);
  9659. context.stroke();
  9660. context.beginPath();
  9661. context.setLineWidth(1);
  9662. context.setStrokeStyle(series[0].color);
  9663. context.setFillStyle(series[0].color);
  9664. context.moveTo(-pointerRadius - gaugeOption.width / 3 / 2, -4);
  9665. context.lineTo(-pointerRadius - gaugeOption.width / 3 / 2 - 4, 0);
  9666. context.lineTo(-pointerRadius - gaugeOption.width / 3 / 2, 4);
  9667. context.lineTo(-pointerRadius - gaugeOption.width / 3 / 2, -4);
  9668. context.stroke();
  9669. context.fill();
  9670. context.restore();
  9671. //default百度样式
  9672. } else {
  9673. //画背景
  9674. context.setLineWidth(gaugeOption.width);
  9675. context.setLineCap('butt');
  9676. for (var _i26 = 0; _i26 < categories.length; _i26++) {
  9677. var eachCategories = categories[_i26];
  9678. context.beginPath();
  9679. context.setStrokeStyle(eachCategories.color);
  9680. context.arc(centerPosition.x, centerPosition.y, radius, eachCategories._startAngle_ * Math.PI, eachCategories._endAngle_ * Math.PI, false);
  9681. context.stroke();
  9682. }
  9683. context.save();
  9684. //画刻度线
  9685. totalAngle = gaugeOption.startAngle - gaugeOption.endAngle + 1;
  9686. var _splitAngle = totalAngle / gaugeOption.splitLine.splitNumber;
  9687. var _childAngle = totalAngle / gaugeOption.splitLine.splitNumber / gaugeOption.splitLine.childNumber;
  9688. var _startX2 = -radius - gaugeOption.width * 0.5 - gaugeOption.splitLine.fixRadius;
  9689. var _endX = -radius - gaugeOption.width * 0.5 - gaugeOption.splitLine.fixRadius + gaugeOption.splitLine.width;
  9690. var childendX = -radius - gaugeOption.width * 0.5 - gaugeOption.splitLine.fixRadius + gaugeOption.splitLine.childWidth;
  9691. context.translate(centerPosition.x, centerPosition.y);
  9692. context.rotate((gaugeOption.startAngle - 1) * Math.PI);
  9693. for (var _i27 = 0; _i27 < gaugeOption.splitLine.splitNumber + 1; _i27++) {
  9694. context.beginPath();
  9695. context.setStrokeStyle(gaugeOption.splitLine.color);
  9696. context.setLineWidth(2 * opts.pix);
  9697. context.moveTo(_startX2, 0);
  9698. context.lineTo(_endX, 0);
  9699. context.stroke();
  9700. context.rotate(_splitAngle * Math.PI);
  9701. }
  9702. context.restore();
  9703. context.save();
  9704. context.translate(centerPosition.x, centerPosition.y);
  9705. context.rotate((gaugeOption.startAngle - 1) * Math.PI);
  9706. for (var _i28 = 0; _i28 < gaugeOption.splitLine.splitNumber * gaugeOption.splitLine.childNumber + 1; _i28++) {
  9707. context.beginPath();
  9708. context.setStrokeStyle(gaugeOption.splitLine.color);
  9709. context.setLineWidth(1 * opts.pix);
  9710. context.moveTo(_startX2, 0);
  9711. context.lineTo(childendX, 0);
  9712. context.stroke();
  9713. context.rotate(_childAngle * Math.PI);
  9714. }
  9715. context.restore();
  9716. //画指针
  9717. series = getGaugeDataPoints(series, categories, gaugeOption, process);
  9718. for (var _i29 = 0; _i29 < series.length; _i29++) {
  9719. var eachSeries = series[_i29];
  9720. context.save();
  9721. context.translate(centerPosition.x, centerPosition.y);
  9722. context.rotate((eachSeries._proportion_ - 1) * Math.PI);
  9723. context.beginPath();
  9724. context.setFillStyle(eachSeries.color);
  9725. context.moveTo(gaugeOption.pointer.width, 0);
  9726. context.lineTo(0, -gaugeOption.pointer.width / 2);
  9727. context.lineTo(-innerRadius, 0);
  9728. context.lineTo(0, gaugeOption.pointer.width / 2);
  9729. context.lineTo(gaugeOption.pointer.width, 0);
  9730. context.closePath();
  9731. context.fill();
  9732. context.beginPath();
  9733. context.setFillStyle('#FFFFFF');
  9734. context.arc(0, 0, gaugeOption.pointer.width / 6, 0, 2 * Math.PI, false);
  9735. context.fill();
  9736. context.restore();
  9737. }
  9738. if (opts.dataLabel !== false) {
  9739. drawGaugeLabel(gaugeOption, radius, centerPosition, opts, config, context);
  9740. }
  9741. }
  9742. //画仪表盘标题,副标题
  9743. drawRingTitle(opts, config, context, centerPosition);
  9744. if (process === 1 && opts.type === 'gauge') {
  9745. opts.extra.gauge.oldAngle = series[0]._proportion_;
  9746. opts.extra.gauge.oldData = series[0].data;
  9747. }
  9748. return {
  9749. center: centerPosition,
  9750. radius: radius,
  9751. innerRadius: innerRadius,
  9752. categories: categories,
  9753. totalAngle: totalAngle };
  9754. }
  9755. function drawRadarDataPoints(series, opts, config, context) {
  9756. var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
  9757. var radarOption = assign({}, {
  9758. gridColor: '#cccccc',
  9759. gridType: 'radar',
  9760. gridEval: 1,
  9761. axisLabel: false,
  9762. axisLabelTofix: 0,
  9763. labelColor: '#666666',
  9764. labelPointShow: false,
  9765. labelPointRadius: 3,
  9766. labelPointColor: '#cccccc',
  9767. opacity: 0.2,
  9768. gridCount: 3,
  9769. border: false,
  9770. borderWidth: 2,
  9771. linearType: 'none',
  9772. customColor: [] },
  9773. opts.extra.radar);
  9774. var coordinateAngle = getRadarCoordinateSeries(opts.categories.length);
  9775. var centerPosition = {
  9776. x: opts.area[3] + (opts.width - opts.area[1] - opts.area[3]) / 2,
  9777. y: opts.area[0] + (opts.height - opts.area[0] - opts.area[2]) / 2 };
  9778. var xr = (opts.width - opts.area[1] - opts.area[3]) / 2;
  9779. var yr = (opts.height - opts.area[0] - opts.area[2]) / 2;
  9780. var radius = Math.min(xr - (getMaxTextListLength(opts.categories, config.fontSize, context) + config.radarLabelTextMargin), yr - config.radarLabelTextMargin);
  9781. radius -= config.radarLabelTextMargin * opts.pix;
  9782. radius = radius < 10 ? 10 : radius;
  9783. // 画分割线
  9784. context.beginPath();
  9785. context.setLineWidth(1 * opts.pix);
  9786. context.setStrokeStyle(radarOption.gridColor);
  9787. coordinateAngle.forEach(function (angle, index) {
  9788. var pos = convertCoordinateOrigin(radius * Math.cos(angle), radius * Math.sin(angle), centerPosition);
  9789. context.moveTo(centerPosition.x, centerPosition.y);
  9790. if (index % radarOption.gridEval == 0) {
  9791. context.lineTo(pos.x, pos.y);
  9792. }
  9793. });
  9794. context.stroke();
  9795. context.closePath();
  9796. // 画背景网格
  9797. var _loop = function _loop(i) {
  9798. var startPos = {};
  9799. context.beginPath();
  9800. context.setLineWidth(1 * opts.pix);
  9801. context.setStrokeStyle(radarOption.gridColor);
  9802. if (radarOption.gridType == 'radar') {
  9803. coordinateAngle.forEach(function (angle, index) {
  9804. var pos = convertCoordinateOrigin(radius / radarOption.gridCount * i * Math.cos(angle), radius /
  9805. radarOption.gridCount * i * Math.sin(angle), centerPosition);
  9806. if (index === 0) {
  9807. startPos = pos;
  9808. context.moveTo(pos.x, pos.y);
  9809. } else {
  9810. context.lineTo(pos.x, pos.y);
  9811. }
  9812. });
  9813. context.lineTo(startPos.x, startPos.y);
  9814. } else {
  9815. var pos = convertCoordinateOrigin(radius / radarOption.gridCount * i * Math.cos(1.5), radius / radarOption.gridCount * i * Math.sin(1.5), centerPosition);
  9816. context.arc(centerPosition.x, centerPosition.y, centerPosition.y - pos.y, 0, 2 * Math.PI, false);
  9817. }
  9818. context.stroke();
  9819. context.closePath();
  9820. };
  9821. for (var i = 1; i <= radarOption.gridCount; i++) {
  9822. _loop(i);
  9823. }
  9824. radarOption.customColor = fillCustomColor(radarOption.linearType, radarOption.customColor, series, config);
  9825. var radarDataPoints = getRadarDataPoints(coordinateAngle, centerPosition, radius, series, opts, process);
  9826. radarDataPoints.forEach(function (eachSeries, seriesIndex) {
  9827. // 绘制区域数据
  9828. context.beginPath();
  9829. context.setLineWidth(radarOption.borderWidth * opts.pix);
  9830. context.setStrokeStyle(eachSeries.color);
  9831. var fillcolor = hexToRgb(eachSeries.color, radarOption.opacity);
  9832. if (radarOption.linearType == 'custom') {
  9833. var grd;
  9834. if (context.createCircularGradient) {
  9835. grd = context.createCircularGradient(centerPosition.x, centerPosition.y, radius);
  9836. } else {
  9837. grd = context.createRadialGradient(centerPosition.x, centerPosition.y, 0, centerPosition.x, centerPosition.y, radius);
  9838. }
  9839. grd.addColorStop(0, hexToRgb(radarOption.customColor[series[seriesIndex].linearIndex], radarOption.opacity));
  9840. grd.addColorStop(1, hexToRgb(eachSeries.color, radarOption.opacity));
  9841. fillcolor = grd;
  9842. }
  9843. context.setFillStyle(fillcolor);
  9844. eachSeries.data.forEach(function (item, index) {
  9845. if (index === 0) {
  9846. context.moveTo(item.position.x, item.position.y);
  9847. } else {
  9848. context.lineTo(item.position.x, item.position.y);
  9849. }
  9850. });
  9851. context.closePath();
  9852. context.fill();
  9853. if (radarOption.border === true) {
  9854. context.stroke();
  9855. }
  9856. context.closePath();
  9857. if (opts.dataPointShape !== false) {
  9858. var points = eachSeries.data.map(function (item) {
  9859. return item.position;
  9860. });
  9861. drawPointShape(points, eachSeries.color, eachSeries.pointShape, context, opts);
  9862. }
  9863. });
  9864. // 画刻度值
  9865. if (radarOption.axisLabel === true) {
  9866. var maxData = Math.max(radarOption.max, Math.max.apply(null, dataCombine(series)));
  9867. var stepLength = radius / radarOption.gridCount;
  9868. var fontSize = opts.fontSize * opts.pix;
  9869. context.setFontSize(fontSize);
  9870. context.setFillStyle(opts.fontColor);
  9871. context.setTextAlign('left');
  9872. for (var i = 0; i < radarOption.gridCount + 1; i++) {
  9873. var label = i * maxData / radarOption.gridCount;
  9874. label = label.toFixed(radarOption.axisLabelTofix);
  9875. context.fillText(String(label), centerPosition.x + 3 * opts.pix, centerPosition.y - i * stepLength + fontSize / 2);
  9876. }
  9877. }
  9878. // draw label text
  9879. drawRadarLabel(coordinateAngle, radius, centerPosition, opts, config, context);
  9880. // draw dataLabel
  9881. if (opts.dataLabel !== false && process === 1) {
  9882. radarDataPoints.forEach(function (eachSeries, seriesIndex) {
  9883. context.beginPath();
  9884. var fontSize = eachSeries.textSize * opts.pix || config.fontSize;
  9885. context.setFontSize(fontSize);
  9886. context.setFillStyle(eachSeries.textColor || opts.fontColor);
  9887. eachSeries.data.forEach(function (item, index) {
  9888. //如果是中心点垂直的上下点位
  9889. if (Math.abs(item.position.x - centerPosition.x) < 2) {
  9890. //如果在上面
  9891. if (item.position.y < centerPosition.y) {
  9892. context.setTextAlign('center');
  9893. context.fillText(item.value, item.position.x, item.position.y - 4);
  9894. } else {
  9895. context.setTextAlign('center');
  9896. context.fillText(item.value, item.position.x, item.position.y + fontSize + 2);
  9897. }
  9898. } else {
  9899. //如果在左侧
  9900. if (item.position.x < centerPosition.x) {
  9901. context.setTextAlign('right');
  9902. context.fillText(item.value, item.position.x - 4, item.position.y + fontSize / 2 - 2);
  9903. } else {
  9904. context.setTextAlign('left');
  9905. context.fillText(item.value, item.position.x + 4, item.position.y + fontSize / 2 - 2);
  9906. }
  9907. }
  9908. });
  9909. context.closePath();
  9910. context.stroke();
  9911. });
  9912. context.setTextAlign('left');
  9913. }
  9914. return {
  9915. center: centerPosition,
  9916. radius: radius,
  9917. angleList: coordinateAngle };
  9918. }
  9919. // 经纬度转墨卡托
  9920. function lonlat2mercator(longitude, latitude) {
  9921. var mercator = Array(2);
  9922. var x = longitude * 20037508.34 / 180;
  9923. var y = Math.log(Math.tan((90 + latitude) * Math.PI / 360)) / (Math.PI / 180);
  9924. y = y * 20037508.34 / 180;
  9925. mercator[0] = x;
  9926. mercator[1] = y;
  9927. return mercator;
  9928. }
  9929. // 墨卡托转经纬度
  9930. function mercator2lonlat(longitude, latitude) {
  9931. var lonlat = Array(2);
  9932. var x = longitude / 20037508.34 * 180;
  9933. var y = latitude / 20037508.34 * 180;
  9934. y = 180 / Math.PI * (2 * Math.atan(Math.exp(y * Math.PI / 180)) - Math.PI / 2);
  9935. lonlat[0] = x;
  9936. lonlat[1] = y;
  9937. return lonlat;
  9938. }
  9939. function getBoundingBox(data) {
  9940. var bounds = {},coords;
  9941. bounds.xMin = 180;
  9942. bounds.xMax = 0;
  9943. bounds.yMin = 90;
  9944. bounds.yMax = 0;
  9945. for (var i = 0; i < data.length; i++) {
  9946. var coorda = data[i].geometry.coordinates;
  9947. for (var k = 0; k < coorda.length; k++) {
  9948. coords = coorda[k];
  9949. if (coords.length == 1) {
  9950. coords = coords[0];
  9951. }
  9952. for (var j = 0; j < coords.length; j++) {
  9953. var longitude = coords[j][0];
  9954. var latitude = coords[j][1];
  9955. var point = {
  9956. x: longitude,
  9957. y: latitude };
  9958. bounds.xMin = bounds.xMin < point.x ? bounds.xMin : point.x;
  9959. bounds.xMax = bounds.xMax > point.x ? bounds.xMax : point.x;
  9960. bounds.yMin = bounds.yMin < point.y ? bounds.yMin : point.y;
  9961. bounds.yMax = bounds.yMax > point.y ? bounds.yMax : point.y;
  9962. }
  9963. }
  9964. }
  9965. return bounds;
  9966. }
  9967. function coordinateToPoint(latitude, longitude, bounds, scale, xoffset, yoffset) {
  9968. return {
  9969. x: (longitude - bounds.xMin) * scale + xoffset,
  9970. y: (bounds.yMax - latitude) * scale + yoffset };
  9971. }
  9972. function pointToCoordinate(pointY, pointX, bounds, scale, xoffset, yoffset) {
  9973. return {
  9974. x: (pointX - xoffset) / scale + bounds.xMin,
  9975. y: bounds.yMax - (pointY - yoffset) / scale };
  9976. }
  9977. function isRayIntersectsSegment(poi, s_poi, e_poi) {
  9978. if (s_poi[1] == e_poi[1]) {
  9979. return false;
  9980. }
  9981. if (s_poi[1] > poi[1] && e_poi[1] > poi[1]) {
  9982. return false;
  9983. }
  9984. if (s_poi[1] < poi[1] && e_poi[1] < poi[1]) {
  9985. return false;
  9986. }
  9987. if (s_poi[1] == poi[1] && e_poi[1] > poi[1]) {
  9988. return false;
  9989. }
  9990. if (e_poi[1] == poi[1] && s_poi[1] > poi[1]) {
  9991. return false;
  9992. }
  9993. if (s_poi[0] < poi[0] && e_poi[1] < poi[1]) {
  9994. return false;
  9995. }
  9996. var xseg = e_poi[0] - (e_poi[0] - s_poi[0]) * (e_poi[1] - poi[1]) / (e_poi[1] - s_poi[1]);
  9997. if (xseg < poi[0]) {
  9998. return false;
  9999. } else {
  10000. return true;
  10001. }
  10002. }
  10003. function isPoiWithinPoly(poi, poly, mercator) {
  10004. var sinsc = 0;
  10005. for (var i = 0; i < poly.length; i++) {
  10006. var epoly = poly[i][0];
  10007. if (poly.length == 1) {
  10008. epoly = poly[i][0];
  10009. }
  10010. for (var j = 0; j < epoly.length - 1; j++) {
  10011. var s_poi = epoly[j];
  10012. var e_poi = epoly[j + 1];
  10013. if (mercator) {
  10014. s_poi = lonlat2mercator(epoly[j][0], epoly[j][1]);
  10015. e_poi = lonlat2mercator(epoly[j + 1][0], epoly[j + 1][1]);
  10016. }
  10017. if (isRayIntersectsSegment(poi, s_poi, e_poi)) {
  10018. sinsc += 1;
  10019. }
  10020. }
  10021. }
  10022. if (sinsc % 2 == 1) {
  10023. return true;
  10024. } else {
  10025. return false;
  10026. }
  10027. }
  10028. function drawMapDataPoints(series, opts, config, context) {
  10029. var mapOption = assign({}, {
  10030. border: true,
  10031. mercator: false,
  10032. borderWidth: 1,
  10033. borderColor: '#666666',
  10034. fillOpacity: 0.6,
  10035. activeBorderColor: '#f04864',
  10036. activeFillColor: '#facc14',
  10037. activeFillOpacity: 1 },
  10038. opts.extra.map);
  10039. var coords, point;
  10040. var data = series;
  10041. var bounds = getBoundingBox(data);
  10042. if (mapOption.mercator) {
  10043. var max = lonlat2mercator(bounds.xMax, bounds.yMax);
  10044. var min = lonlat2mercator(bounds.xMin, bounds.yMin);
  10045. bounds.xMax = max[0];
  10046. bounds.yMax = max[1];
  10047. bounds.xMin = min[0];
  10048. bounds.yMin = min[1];
  10049. }
  10050. var xScale = opts.width / Math.abs(bounds.xMax - bounds.xMin);
  10051. var yScale = opts.height / Math.abs(bounds.yMax - bounds.yMin);
  10052. var scale = xScale < yScale ? xScale : yScale;
  10053. var xoffset = opts.width / 2 - Math.abs(bounds.xMax - bounds.xMin) / 2 * scale;
  10054. var yoffset = opts.height / 2 - Math.abs(bounds.yMax - bounds.yMin) / 2 * scale;
  10055. for (var i = 0; i < data.length; i++) {
  10056. context.beginPath();
  10057. context.setLineWidth(mapOption.borderWidth * opts.pix);
  10058. context.setStrokeStyle(mapOption.borderColor);
  10059. context.setFillStyle(hexToRgb(series[i].color, mapOption.fillOpacity));
  10060. if (opts.tooltip) {
  10061. if (opts.tooltip.index == i) {
  10062. context.setStrokeStyle(mapOption.activeBorderColor);
  10063. context.setFillStyle(hexToRgb(mapOption.activeFillColor, mapOption.activeFillOpacity));
  10064. }
  10065. }
  10066. var coorda = data[i].geometry.coordinates;
  10067. for (var k = 0; k < coorda.length; k++) {
  10068. coords = coorda[k];
  10069. if (coords.length == 1) {
  10070. coords = coords[0];
  10071. }
  10072. for (var j = 0; j < coords.length; j++) {
  10073. var gaosi = Array(2);
  10074. if (mapOption.mercator) {
  10075. gaosi = lonlat2mercator(coords[j][0], coords[j][1]);
  10076. } else {
  10077. gaosi = coords[j];
  10078. }
  10079. point = coordinateToPoint(gaosi[1], gaosi[0], bounds, scale, xoffset, yoffset);
  10080. if (j === 0) {
  10081. context.beginPath();
  10082. context.moveTo(point.x, point.y);
  10083. } else {
  10084. context.lineTo(point.x, point.y);
  10085. }
  10086. }
  10087. context.fill();
  10088. if (mapOption.border == true) {
  10089. context.stroke();
  10090. }
  10091. }
  10092. }
  10093. if (opts.dataLabel == true) {
  10094. for (var i = 0; i < data.length; i++) {
  10095. var centerPoint = data[i].properties.centroid;
  10096. if (centerPoint) {
  10097. if (mapOption.mercator) {
  10098. centerPoint = lonlat2mercator(data[i].properties.centroid[0], data[i].properties.centroid[1]);
  10099. }
  10100. point = coordinateToPoint(centerPoint[1], centerPoint[0], bounds, scale, xoffset, yoffset);
  10101. var fontSize = data[i].textSize * opts.pix || config.fontSize;
  10102. var text = data[i].properties.name;
  10103. context.beginPath();
  10104. context.setFontSize(fontSize);
  10105. context.setFillStyle(data[i].textColor || opts.fontColor);
  10106. context.fillText(text, point.x - measureText(text, fontSize, context) / 2, point.y + fontSize / 2);
  10107. context.closePath();
  10108. context.stroke();
  10109. }
  10110. }
  10111. }
  10112. opts.chartData.mapData = {
  10113. bounds: bounds,
  10114. scale: scale,
  10115. xoffset: xoffset,
  10116. yoffset: yoffset,
  10117. mercator: mapOption.mercator };
  10118. drawToolTipBridge(opts, config, context, 1);
  10119. context.draw();
  10120. }
  10121. function normalInt(min, max, iter) {
  10122. iter = iter == 0 ? 1 : iter;
  10123. var arr = [];
  10124. for (var i = 0; i < iter; i++) {
  10125. arr[i] = Math.random();
  10126. };
  10127. return Math.floor(arr.reduce(function (i, j) {
  10128. return i + j;
  10129. }) / iter * (max - min)) + min;
  10130. };
  10131. function collisionNew(area, points, width, height) {
  10132. var isIn = false;
  10133. for (var i = 0; i < points.length; i++) {
  10134. if (points[i].area) {
  10135. if (area[3] < points[i].area[1] || area[0] > points[i].area[2] || area[1] > points[i].area[3] || area[2] < points[i].area[0]) {
  10136. if (area[0] < 0 || area[1] < 0 || area[2] > width || area[3] > height) {
  10137. isIn = true;
  10138. break;
  10139. } else {
  10140. isIn = false;
  10141. }
  10142. } else {
  10143. isIn = true;
  10144. break;
  10145. }
  10146. }
  10147. }
  10148. return isIn;
  10149. };
  10150. function getWordCloudPoint(opts, type, context) {
  10151. var points = opts.series;
  10152. switch (type) {
  10153. case 'normal':
  10154. for (var i = 0; i < points.length; i++) {
  10155. var text = points[i].name;
  10156. var tHeight = points[i].textSize * opts.pix;
  10157. var tWidth = measureText(text, tHeight, context);
  10158. var x = void 0,y = void 0;
  10159. var area = void 0;
  10160. var breaknum = 0;
  10161. while (true) {
  10162. breaknum++;
  10163. x = normalInt(-opts.width / 2, opts.width / 2, 5) - tWidth / 2;
  10164. y = normalInt(-opts.height / 2, opts.height / 2, 5) + tHeight / 2;
  10165. area = [x - 5 + opts.width / 2, y - 5 - tHeight + opts.height / 2, x + tWidth + 5 + opts.width / 2, y + 5 +
  10166. opts.height / 2];
  10167. var isCollision = collisionNew(area, points, opts.width, opts.height);
  10168. if (!isCollision) break;
  10169. if (breaknum == 1000) {
  10170. area = [-100, -100, -100, -100];
  10171. break;
  10172. }
  10173. };
  10174. points[i].area = area;
  10175. }
  10176. break;
  10177. case 'vertical':var
  10178. Spin = function Spin() {
  10179. //获取均匀随机值,是否旋转,旋转的概率为(1-0.5)
  10180. if (Math.random() > 0.7) {
  10181. return true;
  10182. } else {
  10183. return false;
  10184. };
  10185. };;
  10186. for (var _i30 = 0; _i30 < points.length; _i30++) {
  10187. var _text = points[_i30].name;
  10188. var _tHeight = points[_i30].textSize * opts.pix;
  10189. var _tWidth = measureText(_text, _tHeight, context);
  10190. var isSpin = Spin();
  10191. var _x = void 0,_y = void 0,_area = void 0,areav = void 0;
  10192. var _breaknum = 0;
  10193. while (true) {
  10194. _breaknum++;
  10195. var _isCollision = void 0;
  10196. if (isSpin) {
  10197. _x = normalInt(-opts.width / 2, opts.width / 2, 5) - _tWidth / 2;
  10198. _y = normalInt(-opts.height / 2, opts.height / 2, 5) + _tHeight / 2;
  10199. _area = [_y - 5 - _tWidth + opts.width / 2, -_x - 5 + opts.height / 2, _y + 5 + opts.width / 2, -_x + _tHeight + 5 + opts.height / 2];
  10200. areav = [opts.width - (opts.width / 2 - opts.height / 2) - (-_x + _tHeight + 5 + opts.height / 2) - 5, opts.height / 2 - opts.width / 2 + (_y - 5 - _tWidth + opts.width / 2) - 5, opts.width - (opts.width / 2 - opts.height / 2) - (-_x + _tHeight + 5 + opts.height / 2) + _tHeight, opts.height / 2 - opts.width / 2 + (_y - 5 - _tWidth + opts.width / 2) + _tWidth + 5];
  10201. _isCollision = collisionNew(areav, points, opts.height, opts.width);
  10202. } else {
  10203. _x = normalInt(-opts.width / 2, opts.width / 2, 5) - _tWidth / 2;
  10204. _y = normalInt(-opts.height / 2, opts.height / 2, 5) + _tHeight / 2;
  10205. _area = [_x - 5 + opts.width / 2, _y - 5 - _tHeight + opts.height / 2, _x + _tWidth + 5 + opts.width / 2, _y + 5 + opts.height / 2];
  10206. _isCollision = collisionNew(_area, points, opts.width, opts.height);
  10207. }
  10208. if (!_isCollision) break;
  10209. if (_breaknum == 1000) {
  10210. _area = [-1000, -1000, -1000, -1000];
  10211. break;
  10212. }
  10213. };
  10214. if (isSpin) {
  10215. points[_i30].area = areav;
  10216. points[_i30].areav = _area;
  10217. } else {
  10218. points[_i30].area = _area;
  10219. }
  10220. points[_i30].rotate = isSpin;
  10221. };
  10222. break;}
  10223. return points;
  10224. }
  10225. function drawWordCloudDataPoints(series, opts, config, context) {
  10226. var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
  10227. var wordOption = assign({}, {
  10228. type: 'normal',
  10229. autoColors: true },
  10230. opts.extra.word);
  10231. if (!opts.chartData.wordCloudData) {
  10232. opts.chartData.wordCloudData = getWordCloudPoint(opts, wordOption.type, context);
  10233. }
  10234. context.beginPath();
  10235. context.setFillStyle(opts.background);
  10236. context.rect(0, 0, opts.width, opts.height);
  10237. context.fill();
  10238. context.save();
  10239. var points = opts.chartData.wordCloudData;
  10240. context.translate(opts.width / 2, opts.height / 2);
  10241. for (var i = 0; i < points.length; i++) {
  10242. context.save();
  10243. if (points[i].rotate) {
  10244. context.rotate(90 * Math.PI / 180);
  10245. }
  10246. var text = points[i].name;
  10247. var tHeight = points[i].textSize * opts.pix;
  10248. var tWidth = measureText(text, tHeight, context);
  10249. context.beginPath();
  10250. context.setStrokeStyle(points[i].color);
  10251. context.setFillStyle(points[i].color);
  10252. context.setFontSize(tHeight);
  10253. if (points[i].rotate) {
  10254. if (points[i].areav[0] > 0) {
  10255. if (opts.tooltip) {
  10256. if (opts.tooltip.index == i) {
  10257. context.strokeText(text, (points[i].areav[0] + 5 - opts.width / 2) * process - tWidth * (1 - process) / 2, (points[i].areav[1] + 5 + tHeight - opts.height / 2) * process);
  10258. } else {
  10259. context.fillText(text, (points[i].areav[0] + 5 - opts.width / 2) * process - tWidth * (1 - process) / 2, (points[i].areav[1] + 5 + tHeight - opts.height / 2) * process);
  10260. }
  10261. } else {
  10262. context.fillText(text, (points[i].areav[0] + 5 - opts.width / 2) * process - tWidth * (1 - process) / 2, (points[i].areav[1] + 5 + tHeight - opts.height / 2) * process);
  10263. }
  10264. }
  10265. } else {
  10266. if (points[i].area[0] > 0) {
  10267. if (opts.tooltip) {
  10268. if (opts.tooltip.index == i) {
  10269. context.strokeText(text, (points[i].area[0] + 5 - opts.width / 2) * process - tWidth * (1 - process) / 2, (points[i].area[1] + 5 + tHeight - opts.height / 2) * process);
  10270. } else {
  10271. context.fillText(text, (points[i].area[0] + 5 - opts.width / 2) * process - tWidth * (1 - process) / 2, (points[i].area[1] + 5 + tHeight - opts.height / 2) * process);
  10272. }
  10273. } else {
  10274. context.fillText(text, (points[i].area[0] + 5 - opts.width / 2) * process - tWidth * (1 - process) / 2, (points[i].area[1] + 5 + tHeight - opts.height / 2) * process);
  10275. }
  10276. }
  10277. }
  10278. context.stroke();
  10279. context.restore();
  10280. }
  10281. context.restore();
  10282. }
  10283. function drawFunnelDataPoints(series, opts, config, context) {
  10284. var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
  10285. var funnelOption = assign({}, {
  10286. type: 'funnel',
  10287. activeWidth: 10,
  10288. activeOpacity: 0.3,
  10289. border: false,
  10290. borderWidth: 2,
  10291. borderColor: '#FFFFFF',
  10292. fillOpacity: 1,
  10293. labelAlign: 'right',
  10294. linearType: 'none',
  10295. customColor: [] },
  10296. opts.extra.funnel);
  10297. var eachSpacing = (opts.height - opts.area[0] - opts.area[2]) / series.length;
  10298. var centerPosition = {
  10299. x: opts.area[3] + (opts.width - opts.area[1] - opts.area[3]) / 2,
  10300. y: opts.height - opts.area[2] };
  10301. var activeWidth = funnelOption.activeWidth * opts.pix;
  10302. var radius = Math.min((opts.width - opts.area[1] - opts.area[3]) / 2 - activeWidth, (opts.height - opts.area[0] - opts.area[2]) / 2 - activeWidth);
  10303. series = getFunnelDataPoints(series, radius, funnelOption.type, eachSpacing, process);
  10304. context.save();
  10305. context.translate(centerPosition.x, centerPosition.y);
  10306. funnelOption.customColor = fillCustomColor(funnelOption.linearType, funnelOption.customColor, series, config);
  10307. if (funnelOption.type == 'pyramid') {
  10308. for (var i = 0; i < series.length; i++) {
  10309. if (i == series.length - 1) {
  10310. if (opts.tooltip) {
  10311. if (opts.tooltip.index == i) {
  10312. context.beginPath();
  10313. context.setFillStyle(hexToRgb(series[i].color, funnelOption.activeOpacity));
  10314. context.moveTo(-activeWidth, -eachSpacing);
  10315. context.lineTo(-series[i].radius - activeWidth, 0);
  10316. context.lineTo(series[i].radius + activeWidth, 0);
  10317. context.lineTo(activeWidth, -eachSpacing);
  10318. context.lineTo(-activeWidth, -eachSpacing);
  10319. context.closePath();
  10320. context.fill();
  10321. }
  10322. }
  10323. series[i].funnelArea = [centerPosition.x - series[i].radius, centerPosition.y - eachSpacing * (i + 1), centerPosition.x + series[i].radius, centerPosition.y - eachSpacing * i];
  10324. context.beginPath();
  10325. context.setLineWidth(funnelOption.borderWidth * opts.pix);
  10326. context.setStrokeStyle(funnelOption.borderColor);
  10327. var fillColor = hexToRgb(series[i].color, funnelOption.fillOpacity);
  10328. if (funnelOption.linearType == 'custom') {
  10329. var grd = context.createLinearGradient(series[i].radius, -eachSpacing, -series[i].radius, -eachSpacing);
  10330. grd.addColorStop(0, hexToRgb(series[i].color, funnelOption.fillOpacity));
  10331. grd.addColorStop(0.5, hexToRgb(funnelOption.customColor[series[i].linearIndex], funnelOption.fillOpacity));
  10332. grd.addColorStop(1, hexToRgb(series[i].color, funnelOption.fillOpacity));
  10333. fillColor = grd;
  10334. }
  10335. context.setFillStyle(fillColor);
  10336. context.moveTo(0, -eachSpacing);
  10337. context.lineTo(-series[i].radius, 0);
  10338. context.lineTo(series[i].radius, 0);
  10339. context.lineTo(0, -eachSpacing);
  10340. context.closePath();
  10341. context.fill();
  10342. if (funnelOption.border == true) {
  10343. context.stroke();
  10344. }
  10345. } else {
  10346. if (opts.tooltip) {
  10347. if (opts.tooltip.index == i) {
  10348. context.beginPath();
  10349. context.setFillStyle(hexToRgb(series[i].color, funnelOption.activeOpacity));
  10350. context.moveTo(0, 0);
  10351. context.lineTo(-series[i].radius - activeWidth, 0);
  10352. context.lineTo(-series[i + 1].radius - activeWidth, -eachSpacing);
  10353. context.lineTo(series[i + 1].radius + activeWidth, -eachSpacing);
  10354. context.lineTo(series[i].radius + activeWidth, 0);
  10355. context.lineTo(0, 0);
  10356. context.closePath();
  10357. context.fill();
  10358. }
  10359. }
  10360. series[i].funnelArea = [centerPosition.x - series[i].radius, centerPosition.y - eachSpacing * (i + 1), centerPosition.x + series[i].radius, centerPosition.y - eachSpacing * i];
  10361. context.beginPath();
  10362. context.setLineWidth(funnelOption.borderWidth * opts.pix);
  10363. context.setStrokeStyle(funnelOption.borderColor);
  10364. var fillColor = hexToRgb(series[i].color, funnelOption.fillOpacity);
  10365. if (funnelOption.linearType == 'custom') {
  10366. var grd = context.createLinearGradient(series[i].radius, -eachSpacing, -series[i].radius, -eachSpacing);
  10367. grd.addColorStop(0, hexToRgb(series[i].color, funnelOption.fillOpacity));
  10368. grd.addColorStop(0.5, hexToRgb(funnelOption.customColor[series[i].linearIndex], funnelOption.fillOpacity));
  10369. grd.addColorStop(1, hexToRgb(series[i].color, funnelOption.fillOpacity));
  10370. fillColor = grd;
  10371. }
  10372. context.setFillStyle(fillColor);
  10373. context.moveTo(0, 0);
  10374. context.lineTo(-series[i].radius, 0);
  10375. context.lineTo(-series[i + 1].radius, -eachSpacing);
  10376. context.lineTo(series[i + 1].radius, -eachSpacing);
  10377. context.lineTo(series[i].radius, 0);
  10378. context.lineTo(0, 0);
  10379. context.closePath();
  10380. context.fill();
  10381. if (funnelOption.border == true) {
  10382. context.stroke();
  10383. }
  10384. }
  10385. context.translate(0, -eachSpacing);
  10386. }
  10387. } else {
  10388. for (var _i31 = 0; _i31 < series.length; _i31++) {
  10389. if (_i31 == 0) {
  10390. if (opts.tooltip) {
  10391. if (opts.tooltip.index == _i31) {
  10392. context.beginPath();
  10393. context.setFillStyle(hexToRgb(series[_i31].color, funnelOption.activeOpacity));
  10394. context.moveTo(-activeWidth, 0);
  10395. context.lineTo(-series[_i31].radius - activeWidth, -eachSpacing);
  10396. context.lineTo(series[_i31].radius + activeWidth, -eachSpacing);
  10397. context.lineTo(activeWidth, 0);
  10398. context.lineTo(-activeWidth, 0);
  10399. context.closePath();
  10400. context.fill();
  10401. }
  10402. }
  10403. series[_i31].funnelArea = [centerPosition.x - series[_i31].radius, centerPosition.y - eachSpacing, centerPosition.x + series[_i31].radius, centerPosition.y];
  10404. context.beginPath();
  10405. context.setLineWidth(funnelOption.borderWidth * opts.pix);
  10406. context.setStrokeStyle(funnelOption.borderColor);
  10407. var fillColor = hexToRgb(series[_i31].color, funnelOption.fillOpacity);
  10408. if (funnelOption.linearType == 'custom') {
  10409. var grd = context.createLinearGradient(series[_i31].radius, -eachSpacing, -series[_i31].radius, -eachSpacing);
  10410. grd.addColorStop(0, hexToRgb(series[_i31].color, funnelOption.fillOpacity));
  10411. grd.addColorStop(0.5, hexToRgb(funnelOption.customColor[series[_i31].linearIndex], funnelOption.fillOpacity));
  10412. grd.addColorStop(1, hexToRgb(series[_i31].color, funnelOption.fillOpacity));
  10413. fillColor = grd;
  10414. }
  10415. context.setFillStyle(fillColor);
  10416. context.moveTo(0, 0);
  10417. context.lineTo(-series[_i31].radius, -eachSpacing);
  10418. context.lineTo(series[_i31].radius, -eachSpacing);
  10419. context.lineTo(0, 0);
  10420. context.closePath();
  10421. context.fill();
  10422. if (funnelOption.border == true) {
  10423. context.stroke();
  10424. }
  10425. } else {
  10426. if (opts.tooltip) {
  10427. if (opts.tooltip.index == _i31) {
  10428. context.beginPath();
  10429. context.setFillStyle(hexToRgb(series[_i31].color, funnelOption.activeOpacity));
  10430. context.moveTo(0, 0);
  10431. context.lineTo(-series[_i31 - 1].radius - activeWidth, 0);
  10432. context.lineTo(-series[_i31].radius - activeWidth, -eachSpacing);
  10433. context.lineTo(series[_i31].radius + activeWidth, -eachSpacing);
  10434. context.lineTo(series[_i31 - 1].radius + activeWidth, 0);
  10435. context.lineTo(0, 0);
  10436. context.closePath();
  10437. context.fill();
  10438. }
  10439. }
  10440. series[_i31].funnelArea = [centerPosition.x - series[_i31].radius, centerPosition.y - eachSpacing * (_i31 + 1), centerPosition.x + series[_i31].radius, centerPosition.y - eachSpacing * _i31];
  10441. context.beginPath();
  10442. context.setLineWidth(funnelOption.borderWidth * opts.pix);
  10443. context.setStrokeStyle(funnelOption.borderColor);
  10444. var fillColor = hexToRgb(series[_i31].color, funnelOption.fillOpacity);
  10445. if (funnelOption.linearType == 'custom') {
  10446. var grd = context.createLinearGradient(series[_i31].radius, -eachSpacing, -series[_i31].radius, -eachSpacing);
  10447. grd.addColorStop(0, hexToRgb(series[_i31].color, funnelOption.fillOpacity));
  10448. grd.addColorStop(0.5, hexToRgb(funnelOption.customColor[series[_i31].linearIndex], funnelOption.fillOpacity));
  10449. grd.addColorStop(1, hexToRgb(series[_i31].color, funnelOption.fillOpacity));
  10450. fillColor = grd;
  10451. }
  10452. context.setFillStyle(fillColor);
  10453. context.moveTo(0, 0);
  10454. context.lineTo(-series[_i31 - 1].radius, 0);
  10455. context.lineTo(-series[_i31].radius, -eachSpacing);
  10456. context.lineTo(series[_i31].radius, -eachSpacing);
  10457. context.lineTo(series[_i31 - 1].radius, 0);
  10458. context.lineTo(0, 0);
  10459. context.closePath();
  10460. context.fill();
  10461. if (funnelOption.border == true) {
  10462. context.stroke();
  10463. }
  10464. }
  10465. context.translate(0, -eachSpacing);
  10466. }
  10467. }
  10468. context.restore();
  10469. if (opts.dataLabel !== false && process === 1) {
  10470. drawFunnelText(series, opts, context, eachSpacing, funnelOption.labelAlign, activeWidth, centerPosition);
  10471. }
  10472. return {
  10473. center: centerPosition,
  10474. radius: radius,
  10475. series: series };
  10476. }
  10477. function drawFunnelText(series, opts, context, eachSpacing, labelAlign, activeWidth, centerPosition) {
  10478. for (var i = 0; i < series.length; i++) {
  10479. var item = series[i];
  10480. if (item.labelShow === false) {
  10481. continue;
  10482. }
  10483. var startX = void 0,endX = void 0,startY = void 0,fontSize = void 0;
  10484. var text = item.formatter ? item.formatter(item, i, series, opts) : util.toFixed(item._proportion_ * 100) + '%';
  10485. text = item.labelText ? item.labelText : text;
  10486. if (labelAlign == 'right') {
  10487. if (opts.extra.funnel.type === 'pyramid') {
  10488. if (i == series.length - 1) {
  10489. startX = (item.funnelArea[2] + centerPosition.x) / 2;
  10490. } else {
  10491. startX = (item.funnelArea[2] + series[i + 1].funnelArea[2]) / 2;
  10492. }
  10493. } else {
  10494. if (i == 0) {
  10495. startX = (item.funnelArea[2] + centerPosition.x) / 2;
  10496. } else {
  10497. startX = (item.funnelArea[2] + series[i - 1].funnelArea[2]) / 2;
  10498. }
  10499. }
  10500. endX = startX + activeWidth * 2;
  10501. startY = item.funnelArea[1] + eachSpacing / 2;
  10502. fontSize = item.textSize * opts.pix || opts.fontSize * opts.pix;
  10503. context.setLineWidth(1 * opts.pix);
  10504. context.setStrokeStyle(item.color);
  10505. context.setFillStyle(item.color);
  10506. context.beginPath();
  10507. context.moveTo(startX, startY);
  10508. context.lineTo(endX, startY);
  10509. context.stroke();
  10510. context.closePath();
  10511. context.beginPath();
  10512. context.moveTo(endX, startY);
  10513. context.arc(endX, startY, 2 * opts.pix, 0, 2 * Math.PI);
  10514. context.closePath();
  10515. context.fill();
  10516. context.beginPath();
  10517. context.setFontSize(fontSize);
  10518. context.setFillStyle(item.textColor || opts.fontColor);
  10519. context.fillText(text, endX + 5, startY + fontSize / 2 - 2);
  10520. context.closePath();
  10521. context.stroke();
  10522. context.closePath();
  10523. } else {
  10524. if (opts.extra.funnel.type === 'pyramid') {
  10525. if (i == series.length - 1) {
  10526. startX = (item.funnelArea[0] + centerPosition.x) / 2;
  10527. } else {
  10528. startX = (item.funnelArea[0] + series[i + 1].funnelArea[0]) / 2;
  10529. }
  10530. } else {
  10531. if (i == 0) {
  10532. startX = (item.funnelArea[0] + centerPosition.x) / 2;
  10533. } else {
  10534. startX = (item.funnelArea[0] + series[i - 1].funnelArea[0]) / 2;
  10535. }
  10536. }
  10537. endX = startX - activeWidth * 2;
  10538. startY = item.funnelArea[1] + eachSpacing / 2;
  10539. fontSize = item.textSize * opts.pix || opts.fontSize * opts.pix;
  10540. context.setLineWidth(1 * opts.pix);
  10541. context.setStrokeStyle(item.color);
  10542. context.setFillStyle(item.color);
  10543. context.beginPath();
  10544. context.moveTo(startX, startY);
  10545. context.lineTo(endX, startY);
  10546. context.stroke();
  10547. context.closePath();
  10548. context.beginPath();
  10549. context.moveTo(endX, startY);
  10550. context.arc(endX, startY, 2, 0, 2 * Math.PI);
  10551. context.closePath();
  10552. context.fill();
  10553. context.beginPath();
  10554. context.setFontSize(fontSize);
  10555. context.setFillStyle(item.textColor || opts.fontColor);
  10556. context.fillText(text, endX - 5 - measureText(text, fontSize, context), startY + fontSize / 2 - 2);
  10557. context.closePath();
  10558. context.stroke();
  10559. context.closePath();
  10560. }
  10561. }
  10562. }
  10563. function drawCanvas(opts, context) {
  10564. context.draw();
  10565. }
  10566. var Timing = {
  10567. easeIn: function easeIn(pos) {
  10568. return Math.pow(pos, 3);
  10569. },
  10570. easeOut: function easeOut(pos) {
  10571. return Math.pow(pos - 1, 3) + 1;
  10572. },
  10573. easeInOut: function easeInOut(pos) {
  10574. if ((pos /= 0.5) < 1) {
  10575. return 0.5 * Math.pow(pos, 3);
  10576. } else {
  10577. return 0.5 * (Math.pow(pos - 2, 3) + 2);
  10578. }
  10579. },
  10580. linear: function linear(pos) {
  10581. return pos;
  10582. } };
  10583. function Animation(opts) {
  10584. this.isStop = false;
  10585. opts.duration = typeof opts.duration === 'undefined' ? 1000 : opts.duration;
  10586. opts.timing = opts.timing || 'easeInOut';
  10587. var delay = 17;
  10588. function createAnimationFrame() {
  10589. if (typeof setTimeout !== 'undefined') {
  10590. return function (step, delay) {
  10591. setTimeout(function () {
  10592. var timeStamp = +new Date();
  10593. step(timeStamp);
  10594. }, delay);
  10595. };
  10596. } else if (typeof requestAnimationFrame !== 'undefined') {
  10597. return requestAnimationFrame;
  10598. } else {
  10599. return function (step) {
  10600. step(null);
  10601. };
  10602. }
  10603. };
  10604. var animationFrame = createAnimationFrame();
  10605. var startTimeStamp = null;
  10606. var _step = function step(timestamp) {
  10607. if (timestamp === null || this.isStop === true) {
  10608. opts.onProcess && opts.onProcess(1);
  10609. opts.onAnimationFinish && opts.onAnimationFinish();
  10610. return;
  10611. }
  10612. if (startTimeStamp === null) {
  10613. startTimeStamp = timestamp;
  10614. }
  10615. if (timestamp - startTimeStamp < opts.duration) {
  10616. var process = (timestamp - startTimeStamp) / opts.duration;
  10617. var timingFunction = Timing[opts.timing];
  10618. process = timingFunction(process);
  10619. opts.onProcess && opts.onProcess(process);
  10620. animationFrame(_step, delay);
  10621. } else {
  10622. opts.onProcess && opts.onProcess(1);
  10623. opts.onAnimationFinish && opts.onAnimationFinish();
  10624. }
  10625. };
  10626. _step = _step.bind(this);
  10627. animationFrame(_step, delay);
  10628. }
  10629. Animation.prototype.stop = function () {
  10630. this.isStop = true;
  10631. };
  10632. function drawCharts(type, opts, config, context) {
  10633. var _this = this;
  10634. var series = opts.series;
  10635. //兼容ECharts饼图类数据格式
  10636. if (type === 'pie' || type === 'ring' || type === 'mount' || type === 'rose' || type === 'funnel') {
  10637. series = fixPieSeries(series, opts, config);
  10638. }
  10639. var categories = opts.categories;
  10640. if (type === 'mount') {
  10641. categories = [];
  10642. for (var j = 0; j < series.length; j++) {
  10643. if (series[j].show !== false) categories.push(series[j].name);
  10644. }
  10645. opts.categories = categories;
  10646. }
  10647. series = fillSeries(series, opts, config);
  10648. var duration = opts.animation ? opts.duration : 0;
  10649. _this.animationInstance && _this.animationInstance.stop();
  10650. var seriesMA = null;
  10651. if (type == 'candle') {
  10652. var average = assign({}, opts.extra.candle.average);
  10653. if (average.show) {
  10654. seriesMA = calCandleMA(average.day, average.name, average.color, series[0].data);
  10655. seriesMA = fillSeries(seriesMA, opts, config);
  10656. opts.seriesMA = seriesMA;
  10657. } else if (opts.seriesMA) {
  10658. seriesMA = opts.seriesMA = fillSeries(opts.seriesMA, opts, config);
  10659. } else {
  10660. seriesMA = series;
  10661. }
  10662. } else {
  10663. seriesMA = series;
  10664. }
  10665. /* 过滤掉show=false的series */
  10666. opts._series_ = series = filterSeries(series);
  10667. //重新计算图表区域
  10668. opts.area = new Array(4);
  10669. //复位绘图区域
  10670. for (var _j11 = 0; _j11 < 4; _j11++) {
  10671. opts.area[_j11] = opts.padding[_j11] * opts.pix;
  10672. }
  10673. //通过计算三大区域:图例、X轴、Y轴的大小,确定绘图区域
  10674. var _calLegendData = calLegendData(seriesMA, opts, config, opts.chartData, context),
  10675. legendHeight = _calLegendData.area.wholeHeight,
  10676. legendWidth = _calLegendData.area.wholeWidth;
  10677. switch (opts.legend.position) {
  10678. case 'top':
  10679. opts.area[0] += legendHeight;
  10680. break;
  10681. case 'bottom':
  10682. opts.area[2] += legendHeight;
  10683. break;
  10684. case 'left':
  10685. opts.area[3] += legendWidth;
  10686. break;
  10687. case 'right':
  10688. opts.area[1] += legendWidth;
  10689. break;}
  10690. var _calYAxisData = {},
  10691. yAxisWidth = 0;
  10692. if (opts.type === 'line' || opts.type === 'column' || opts.type === 'mount' || opts.type === 'area' || opts.type === 'mix' || opts.type === 'candle' || opts.type === 'scatter' || opts.type === 'bubble' || opts.type === 'bar') {
  10693. _calYAxisData = calYAxisData(series, opts, config, context);
  10694. yAxisWidth = _calYAxisData.yAxisWidth;
  10695. //如果显示Y轴标题
  10696. if (opts.yAxis.showTitle) {
  10697. var maxTitleHeight = 0;
  10698. for (var i = 0; i < opts.yAxis.data.length; i++) {
  10699. maxTitleHeight = Math.max(maxTitleHeight, opts.yAxis.data[i].titleFontSize ? opts.yAxis.data[i].titleFontSize * opts.pix : config.fontSize);
  10700. }
  10701. opts.area[0] += maxTitleHeight;
  10702. }
  10703. var rightIndex = 0,
  10704. leftIndex = 0;
  10705. //计算主绘图区域左右位置
  10706. for (var _i32 = 0; _i32 < yAxisWidth.length; _i32++) {
  10707. if (yAxisWidth[_i32].position == 'left') {
  10708. if (leftIndex > 0) {
  10709. opts.area[3] += yAxisWidth[_i32].width + opts.yAxis.padding * opts.pix;
  10710. } else {
  10711. opts.area[3] += yAxisWidth[_i32].width;
  10712. }
  10713. leftIndex += 1;
  10714. } else if (yAxisWidth[_i32].position == 'right') {
  10715. if (rightIndex > 0) {
  10716. opts.area[1] += yAxisWidth[_i32].width + opts.yAxis.padding * opts.pix;
  10717. } else {
  10718. opts.area[1] += yAxisWidth[_i32].width;
  10719. }
  10720. rightIndex += 1;
  10721. }
  10722. }
  10723. } else {
  10724. config.yAxisWidth = yAxisWidth;
  10725. }
  10726. opts.chartData.yAxisData = _calYAxisData;
  10727. if (opts.categories && opts.categories.length && opts.type !== 'radar' && opts.type !== 'gauge' && opts.type !== 'bar') {
  10728. opts.chartData.xAxisData = getXAxisPoints(opts.categories, opts, config);
  10729. var _calCategoriesData = calCategoriesData(opts.categories, opts, config, opts.chartData.xAxisData.eachSpacing, context),
  10730. xAxisHeight = _calCategoriesData.xAxisHeight,
  10731. angle = _calCategoriesData.angle;
  10732. config.xAxisHeight = xAxisHeight;
  10733. config._xAxisTextAngle_ = angle;
  10734. opts.area[2] += xAxisHeight;
  10735. opts.chartData.categoriesData = _calCategoriesData;
  10736. } else {
  10737. if (opts.type === 'line' || opts.type === 'area' || opts.type === 'scatter' || opts.type === 'bubble' || opts.type === 'bar') {
  10738. opts.chartData.xAxisData = calXAxisData(series, opts, config, context);
  10739. categories = opts.chartData.xAxisData.rangesFormat;
  10740. var _calCategoriesData2 = calCategoriesData(categories, opts, config, opts.chartData.xAxisData.eachSpacing, context),
  10741. _xAxisHeight = _calCategoriesData2.xAxisHeight,
  10742. _angle = _calCategoriesData2.angle;
  10743. config.xAxisHeight = _xAxisHeight;
  10744. config._xAxisTextAngle_ = _angle;
  10745. opts.area[2] += _xAxisHeight;
  10746. opts.chartData.categoriesData = _calCategoriesData2;
  10747. } else {
  10748. opts.chartData.xAxisData = {
  10749. xAxisPoints: [] };
  10750. }
  10751. }
  10752. //计算右对齐偏移距离
  10753. if (opts.enableScroll && opts.xAxis.scrollAlign == 'right' && opts._scrollDistance_ === undefined) {
  10754. var offsetLeft = 0,
  10755. xAxisPoints = opts.chartData.xAxisData.xAxisPoints,
  10756. startX = opts.chartData.xAxisData.startX,
  10757. endX = opts.chartData.xAxisData.endX,
  10758. eachSpacing = opts.chartData.xAxisData.eachSpacing;
  10759. var totalWidth = eachSpacing * (xAxisPoints.length - 1);
  10760. var screenWidth = endX - startX;
  10761. offsetLeft = screenWidth - totalWidth;
  10762. _this.scrollOption.currentOffset = offsetLeft;
  10763. _this.scrollOption.startTouchX = offsetLeft;
  10764. _this.scrollOption.distance = 0;
  10765. _this.scrollOption.lastMoveTime = 0;
  10766. opts._scrollDistance_ = offsetLeft;
  10767. }
  10768. if (type === 'pie' || type === 'ring' || type === 'rose') {
  10769. config._pieTextMaxLength_ = opts.dataLabel === false ? 0 : getPieTextMaxLength(seriesMA, config, context, opts);
  10770. }
  10771. switch (type) {
  10772. case 'word':
  10773. this.animationInstance = new Animation({
  10774. timing: opts.timing,
  10775. duration: duration,
  10776. onProcess: function onProcess(process) {
  10777. context.clearRect(0, 0, opts.width, opts.height);
  10778. if (opts.rotate) {
  10779. contextRotate(context, opts);
  10780. }
  10781. drawWordCloudDataPoints(series, opts, config, context, process);
  10782. drawCanvas(opts, context);
  10783. },
  10784. onAnimationFinish: function onAnimationFinish() {
  10785. _this.uevent.trigger('renderComplete');
  10786. } });
  10787. break;
  10788. case 'map':
  10789. context.clearRect(0, 0, opts.width, opts.height);
  10790. drawMapDataPoints(series, opts, config, context);
  10791. break;
  10792. case 'funnel':
  10793. this.animationInstance = new Animation({
  10794. timing: opts.timing,
  10795. duration: duration,
  10796. onProcess: function onProcess(process) {
  10797. context.clearRect(0, 0, opts.width, opts.height);
  10798. if (opts.rotate) {
  10799. contextRotate(context, opts);
  10800. }
  10801. opts.chartData.funnelData = drawFunnelDataPoints(series, opts, config, context, process);
  10802. drawLegend(opts.series, opts, config, context, opts.chartData);
  10803. drawToolTipBridge(opts, config, context, process);
  10804. drawCanvas(opts, context);
  10805. },
  10806. onAnimationFinish: function onAnimationFinish() {
  10807. _this.uevent.trigger('renderComplete');
  10808. } });
  10809. break;
  10810. case 'line':
  10811. this.animationInstance = new Animation({
  10812. timing: opts.timing,
  10813. duration: duration,
  10814. onProcess: function onProcess(process) {
  10815. context.clearRect(0, 0, opts.width, opts.height);
  10816. if (opts.rotate) {
  10817. contextRotate(context, opts);
  10818. }
  10819. drawYAxisGrid(categories, opts, config, context);
  10820. drawXAxis(categories, opts, config, context);
  10821. var _drawLineDataPoints = drawLineDataPoints(series, opts, config, context, process),
  10822. xAxisPoints = _drawLineDataPoints.xAxisPoints,
  10823. calPoints = _drawLineDataPoints.calPoints,
  10824. eachSpacing = _drawLineDataPoints.eachSpacing;
  10825. opts.chartData.xAxisPoints = xAxisPoints;
  10826. opts.chartData.calPoints = calPoints;
  10827. opts.chartData.eachSpacing = eachSpacing;
  10828. drawYAxis(series, opts, config, context);
  10829. if (opts.enableMarkLine !== false && process === 1) {
  10830. drawMarkLine(opts, config, context);
  10831. }
  10832. drawLegend(opts.series, opts, config, context, opts.chartData);
  10833. drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints);
  10834. drawCanvas(opts, context);
  10835. },
  10836. onAnimationFinish: function onAnimationFinish() {
  10837. _this.uevent.trigger('renderComplete');
  10838. } });
  10839. break;
  10840. case 'scatter':
  10841. this.animationInstance = new Animation({
  10842. timing: opts.timing,
  10843. duration: duration,
  10844. onProcess: function onProcess(process) {
  10845. context.clearRect(0, 0, opts.width, opts.height);
  10846. if (opts.rotate) {
  10847. contextRotate(context, opts);
  10848. }
  10849. drawYAxisGrid(categories, opts, config, context);
  10850. drawXAxis(categories, opts, config, context);
  10851. var _drawScatterDataPoints = drawScatterDataPoints(series, opts, config, context, process),
  10852. xAxisPoints = _drawScatterDataPoints.xAxisPoints,
  10853. calPoints = _drawScatterDataPoints.calPoints,
  10854. eachSpacing = _drawScatterDataPoints.eachSpacing;
  10855. opts.chartData.xAxisPoints = xAxisPoints;
  10856. opts.chartData.calPoints = calPoints;
  10857. opts.chartData.eachSpacing = eachSpacing;
  10858. drawYAxis(series, opts, config, context);
  10859. if (opts.enableMarkLine !== false && process === 1) {
  10860. drawMarkLine(opts, config, context);
  10861. }
  10862. drawLegend(opts.series, opts, config, context, opts.chartData);
  10863. drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints);
  10864. drawCanvas(opts, context);
  10865. },
  10866. onAnimationFinish: function onAnimationFinish() {
  10867. _this.uevent.trigger('renderComplete');
  10868. } });
  10869. break;
  10870. case 'bubble':
  10871. this.animationInstance = new Animation({
  10872. timing: opts.timing,
  10873. duration: duration,
  10874. onProcess: function onProcess(process) {
  10875. context.clearRect(0, 0, opts.width, opts.height);
  10876. if (opts.rotate) {
  10877. contextRotate(context, opts);
  10878. }
  10879. drawYAxisGrid(categories, opts, config, context);
  10880. drawXAxis(categories, opts, config, context);
  10881. var _drawBubbleDataPoints = drawBubbleDataPoints(series, opts, config, context, process),
  10882. xAxisPoints = _drawBubbleDataPoints.xAxisPoints,
  10883. calPoints = _drawBubbleDataPoints.calPoints,
  10884. eachSpacing = _drawBubbleDataPoints.eachSpacing;
  10885. opts.chartData.xAxisPoints = xAxisPoints;
  10886. opts.chartData.calPoints = calPoints;
  10887. opts.chartData.eachSpacing = eachSpacing;
  10888. drawYAxis(series, opts, config, context);
  10889. if (opts.enableMarkLine !== false && process === 1) {
  10890. drawMarkLine(opts, config, context);
  10891. }
  10892. drawLegend(opts.series, opts, config, context, opts.chartData);
  10893. drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints);
  10894. drawCanvas(opts, context);
  10895. },
  10896. onAnimationFinish: function onAnimationFinish() {
  10897. _this.uevent.trigger('renderComplete');
  10898. } });
  10899. break;
  10900. case 'mix':
  10901. this.animationInstance = new Animation({
  10902. timing: opts.timing,
  10903. duration: duration,
  10904. onProcess: function onProcess(process) {
  10905. context.clearRect(0, 0, opts.width, opts.height);
  10906. if (opts.rotate) {
  10907. contextRotate(context, opts);
  10908. }
  10909. drawYAxisGrid(categories, opts, config, context);
  10910. drawXAxis(categories, opts, config, context);
  10911. var _drawMixDataPoints = drawMixDataPoints(series, opts, config, context, process),
  10912. xAxisPoints = _drawMixDataPoints.xAxisPoints,
  10913. calPoints = _drawMixDataPoints.calPoints,
  10914. eachSpacing = _drawMixDataPoints.eachSpacing;
  10915. opts.chartData.xAxisPoints = xAxisPoints;
  10916. opts.chartData.calPoints = calPoints;
  10917. opts.chartData.eachSpacing = eachSpacing;
  10918. drawYAxis(series, opts, config, context);
  10919. if (opts.enableMarkLine !== false && process === 1) {
  10920. drawMarkLine(opts, config, context);
  10921. }
  10922. drawLegend(opts.series, opts, config, context, opts.chartData);
  10923. drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints);
  10924. drawCanvas(opts, context);
  10925. },
  10926. onAnimationFinish: function onAnimationFinish() {
  10927. _this.uevent.trigger('renderComplete');
  10928. } });
  10929. break;
  10930. case 'column':
  10931. this.animationInstance = new Animation({
  10932. timing: opts.timing,
  10933. duration: duration,
  10934. onProcess: function onProcess(process) {
  10935. context.clearRect(0, 0, opts.width, opts.height);
  10936. if (opts.rotate) {
  10937. contextRotate(context, opts);
  10938. }
  10939. drawYAxisGrid(categories, opts, config, context);
  10940. drawXAxis(categories, opts, config, context);
  10941. var _drawColumnDataPoints = drawColumnDataPoints(series, opts, config, context, process),
  10942. xAxisPoints = _drawColumnDataPoints.xAxisPoints,
  10943. calPoints = _drawColumnDataPoints.calPoints,
  10944. eachSpacing = _drawColumnDataPoints.eachSpacing;
  10945. opts.chartData.xAxisPoints = xAxisPoints;
  10946. opts.chartData.calPoints = calPoints;
  10947. opts.chartData.eachSpacing = eachSpacing;
  10948. drawYAxis(series, opts, config, context);
  10949. if (opts.enableMarkLine !== false && process === 1) {
  10950. drawMarkLine(opts, config, context);
  10951. }
  10952. drawLegend(opts.series, opts, config, context, opts.chartData);
  10953. drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints);
  10954. drawCanvas(opts, context);
  10955. },
  10956. onAnimationFinish: function onAnimationFinish() {
  10957. _this.uevent.trigger('renderComplete');
  10958. } });
  10959. break;
  10960. case 'mount':
  10961. this.animationInstance = new Animation({
  10962. timing: opts.timing,
  10963. duration: duration,
  10964. onProcess: function onProcess(process) {
  10965. context.clearRect(0, 0, opts.width, opts.height);
  10966. if (opts.rotate) {
  10967. contextRotate(context, opts);
  10968. }
  10969. drawYAxisGrid(categories, opts, config, context);
  10970. drawXAxis(categories, opts, config, context);
  10971. var _drawMountDataPoints = drawMountDataPoints(series, opts, config, context, process),
  10972. xAxisPoints = _drawMountDataPoints.xAxisPoints,
  10973. calPoints = _drawMountDataPoints.calPoints,
  10974. eachSpacing = _drawMountDataPoints.eachSpacing;
  10975. opts.chartData.xAxisPoints = xAxisPoints;
  10976. opts.chartData.calPoints = calPoints;
  10977. opts.chartData.eachSpacing = eachSpacing;
  10978. drawYAxis(series, opts, config, context);
  10979. if (opts.enableMarkLine !== false && process === 1) {
  10980. drawMarkLine(opts, config, context);
  10981. }
  10982. drawLegend(opts.series, opts, config, context, opts.chartData);
  10983. drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints);
  10984. drawCanvas(opts, context);
  10985. },
  10986. onAnimationFinish: function onAnimationFinish() {
  10987. _this.uevent.trigger('renderComplete');
  10988. } });
  10989. break;
  10990. case 'bar':
  10991. this.animationInstance = new Animation({
  10992. timing: opts.timing,
  10993. duration: duration,
  10994. onProcess: function onProcess(process) {
  10995. context.clearRect(0, 0, opts.width, opts.height);
  10996. if (opts.rotate) {
  10997. contextRotate(context, opts);
  10998. }
  10999. drawXAxis(categories, opts, config, context);
  11000. var _drawBarDataPoints = drawBarDataPoints(series, opts, config, context, process),
  11001. yAxisPoints = _drawBarDataPoints.yAxisPoints,
  11002. calPoints = _drawBarDataPoints.calPoints,
  11003. eachSpacing = _drawBarDataPoints.eachSpacing;
  11004. opts.chartData.yAxisPoints = yAxisPoints;
  11005. opts.chartData.xAxisPoints = opts.chartData.xAxisData.xAxisPoints;
  11006. opts.chartData.calPoints = calPoints;
  11007. opts.chartData.eachSpacing = eachSpacing;
  11008. drawYAxis(series, opts, config, context);
  11009. if (opts.enableMarkLine !== false && process === 1) {
  11010. drawMarkLine(opts, config, context);
  11011. }
  11012. drawLegend(opts.series, opts, config, context, opts.chartData);
  11013. drawToolTipBridge(opts, config, context, process, eachSpacing, yAxisPoints);
  11014. drawCanvas(opts, context);
  11015. },
  11016. onAnimationFinish: function onAnimationFinish() {
  11017. _this.uevent.trigger('renderComplete');
  11018. } });
  11019. break;
  11020. case 'area':
  11021. this.animationInstance = new Animation({
  11022. timing: opts.timing,
  11023. duration: duration,
  11024. onProcess: function onProcess(process) {
  11025. context.clearRect(0, 0, opts.width, opts.height);
  11026. if (opts.rotate) {
  11027. contextRotate(context, opts);
  11028. }
  11029. drawYAxisGrid(categories, opts, config, context);
  11030. drawXAxis(categories, opts, config, context);
  11031. var _drawAreaDataPoints = drawAreaDataPoints(series, opts, config, context, process),
  11032. xAxisPoints = _drawAreaDataPoints.xAxisPoints,
  11033. calPoints = _drawAreaDataPoints.calPoints,
  11034. eachSpacing = _drawAreaDataPoints.eachSpacing;
  11035. opts.chartData.xAxisPoints = xAxisPoints;
  11036. opts.chartData.calPoints = calPoints;
  11037. opts.chartData.eachSpacing = eachSpacing;
  11038. drawYAxis(series, opts, config, context);
  11039. if (opts.enableMarkLine !== false && process === 1) {
  11040. drawMarkLine(opts, config, context);
  11041. }
  11042. drawLegend(opts.series, opts, config, context, opts.chartData);
  11043. drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints);
  11044. drawCanvas(opts, context);
  11045. },
  11046. onAnimationFinish: function onAnimationFinish() {
  11047. _this.uevent.trigger('renderComplete');
  11048. } });
  11049. break;
  11050. case 'ring':
  11051. this.animationInstance = new Animation({
  11052. timing: opts.timing,
  11053. duration: duration,
  11054. onProcess: function onProcess(process) {
  11055. context.clearRect(0, 0, opts.width, opts.height);
  11056. if (opts.rotate) {
  11057. contextRotate(context, opts);
  11058. }
  11059. opts.chartData.pieData = drawPieDataPoints(series, opts, config, context, process);
  11060. drawLegend(opts.series, opts, config, context, opts.chartData);
  11061. drawToolTipBridge(opts, config, context, process);
  11062. drawCanvas(opts, context);
  11063. },
  11064. onAnimationFinish: function onAnimationFinish() {
  11065. _this.uevent.trigger('renderComplete');
  11066. } });
  11067. break;
  11068. case 'pie':
  11069. this.animationInstance = new Animation({
  11070. timing: opts.timing,
  11071. duration: duration,
  11072. onProcess: function onProcess(process) {
  11073. context.clearRect(0, 0, opts.width, opts.height);
  11074. if (opts.rotate) {
  11075. contextRotate(context, opts);
  11076. }
  11077. opts.chartData.pieData = drawPieDataPoints(series, opts, config, context, process);
  11078. drawLegend(opts.series, opts, config, context, opts.chartData);
  11079. drawToolTipBridge(opts, config, context, process);
  11080. drawCanvas(opts, context);
  11081. },
  11082. onAnimationFinish: function onAnimationFinish() {
  11083. _this.uevent.trigger('renderComplete');
  11084. } });
  11085. break;
  11086. case 'rose':
  11087. this.animationInstance = new Animation({
  11088. timing: opts.timing,
  11089. duration: duration,
  11090. onProcess: function onProcess(process) {
  11091. context.clearRect(0, 0, opts.width, opts.height);
  11092. if (opts.rotate) {
  11093. contextRotate(context, opts);
  11094. }
  11095. opts.chartData.pieData = drawRoseDataPoints(series, opts, config, context, process);
  11096. drawLegend(opts.series, opts, config, context, opts.chartData);
  11097. drawToolTipBridge(opts, config, context, process);
  11098. drawCanvas(opts, context);
  11099. },
  11100. onAnimationFinish: function onAnimationFinish() {
  11101. _this.uevent.trigger('renderComplete');
  11102. } });
  11103. break;
  11104. case 'radar':
  11105. this.animationInstance = new Animation({
  11106. timing: opts.timing,
  11107. duration: duration,
  11108. onProcess: function onProcess(process) {
  11109. context.clearRect(0, 0, opts.width, opts.height);
  11110. if (opts.rotate) {
  11111. contextRotate(context, opts);
  11112. }
  11113. opts.chartData.radarData = drawRadarDataPoints(series, opts, config, context, process);
  11114. drawLegend(opts.series, opts, config, context, opts.chartData);
  11115. drawToolTipBridge(opts, config, context, process);
  11116. drawCanvas(opts, context);
  11117. },
  11118. onAnimationFinish: function onAnimationFinish() {
  11119. _this.uevent.trigger('renderComplete');
  11120. } });
  11121. break;
  11122. case 'arcbar':
  11123. this.animationInstance = new Animation({
  11124. timing: opts.timing,
  11125. duration: duration,
  11126. onProcess: function onProcess(process) {
  11127. context.clearRect(0, 0, opts.width, opts.height);
  11128. if (opts.rotate) {
  11129. contextRotate(context, opts);
  11130. }
  11131. opts.chartData.arcbarData = drawArcbarDataPoints(series, opts, config, context, process);
  11132. drawCanvas(opts, context);
  11133. },
  11134. onAnimationFinish: function onAnimationFinish() {
  11135. _this.uevent.trigger('renderComplete');
  11136. } });
  11137. break;
  11138. case 'gauge':
  11139. this.animationInstance = new Animation({
  11140. timing: opts.timing,
  11141. duration: duration,
  11142. onProcess: function onProcess(process) {
  11143. context.clearRect(0, 0, opts.width, opts.height);
  11144. if (opts.rotate) {
  11145. contextRotate(context, opts);
  11146. }
  11147. opts.chartData.gaugeData = drawGaugeDataPoints(categories, series, opts, config, context, process);
  11148. drawCanvas(opts, context);
  11149. },
  11150. onAnimationFinish: function onAnimationFinish() {
  11151. _this.uevent.trigger('renderComplete');
  11152. } });
  11153. break;
  11154. case 'candle':
  11155. this.animationInstance = new Animation({
  11156. timing: opts.timing,
  11157. duration: duration,
  11158. onProcess: function onProcess(process) {
  11159. context.clearRect(0, 0, opts.width, opts.height);
  11160. if (opts.rotate) {
  11161. contextRotate(context, opts);
  11162. }
  11163. drawYAxisGrid(categories, opts, config, context);
  11164. drawXAxis(categories, opts, config, context);
  11165. var _drawCandleDataPoints = drawCandleDataPoints(series, seriesMA, opts, config, context, process),
  11166. xAxisPoints = _drawCandleDataPoints.xAxisPoints,
  11167. calPoints = _drawCandleDataPoints.calPoints,
  11168. eachSpacing = _drawCandleDataPoints.eachSpacing;
  11169. opts.chartData.xAxisPoints = xAxisPoints;
  11170. opts.chartData.calPoints = calPoints;
  11171. opts.chartData.eachSpacing = eachSpacing;
  11172. drawYAxis(series, opts, config, context);
  11173. if (opts.enableMarkLine !== false && process === 1) {
  11174. drawMarkLine(opts, config, context);
  11175. }
  11176. if (seriesMA) {
  11177. drawLegend(seriesMA, opts, config, context, opts.chartData);
  11178. } else {
  11179. drawLegend(opts.series, opts, config, context, opts.chartData);
  11180. }
  11181. drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints);
  11182. drawCanvas(opts, context);
  11183. },
  11184. onAnimationFinish: function onAnimationFinish() {
  11185. _this.uevent.trigger('renderComplete');
  11186. } });
  11187. break;}
  11188. }
  11189. function uChartsEvent() {
  11190. this.events = {};
  11191. }
  11192. uChartsEvent.prototype.addEventListener = function (type, listener) {
  11193. this.events[type] = this.events[type] || [];
  11194. this.events[type].push(listener);
  11195. };
  11196. uChartsEvent.prototype.delEventListener = function (type) {
  11197. this.events[type] = [];
  11198. };
  11199. uChartsEvent.prototype.trigger = function () {
  11200. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  11201. args[_key] = arguments[_key];
  11202. }
  11203. var type = args[0];
  11204. var params = args.slice(1);
  11205. if (!!this.events[type]) {
  11206. this.events[type].forEach(function (listener) {
  11207. try {
  11208. listener.apply(null, params);
  11209. } catch (e) {
  11210. //console.log('[uCharts] '+e);
  11211. }
  11212. });
  11213. }
  11214. };
  11215. var uCharts = function uCharts(opts) {
  11216. opts.pix = opts.pixelRatio ? opts.pixelRatio : 1;
  11217. opts.fontSize = opts.fontSize ? opts.fontSize : 13;
  11218. opts.fontColor = opts.fontColor ? opts.fontColor : config.fontColor;
  11219. if (opts.background == "" || opts.background == "none") {
  11220. opts.background = "#FFFFFF";
  11221. }
  11222. opts.title = assign({}, opts.title);
  11223. opts.subtitle = assign({}, opts.subtitle);
  11224. opts.duration = opts.duration ? opts.duration : 1000;
  11225. opts.yAxis = assign({}, {
  11226. data: [],
  11227. showTitle: false,
  11228. disabled: false,
  11229. disableGrid: false,
  11230. splitNumber: 5,
  11231. gridType: 'solid',
  11232. dashLength: 4 * opts.pix,
  11233. gridColor: '#cccccc',
  11234. padding: 10,
  11235. fontColor: '#666666' },
  11236. opts.yAxis);
  11237. opts.xAxis = assign({}, {
  11238. rotateLabel: false,
  11239. rotateAngle: 45,
  11240. disabled: false,
  11241. disableGrid: false,
  11242. splitNumber: 5,
  11243. calibration: false,
  11244. gridType: 'solid',
  11245. dashLength: 4,
  11246. scrollAlign: 'left',
  11247. boundaryGap: 'center',
  11248. axisLine: true,
  11249. axisLineColor: '#cccccc' },
  11250. opts.xAxis);
  11251. opts.xAxis.scrollPosition = opts.xAxis.scrollAlign;
  11252. opts.legend = assign({}, {
  11253. show: true,
  11254. position: 'bottom',
  11255. float: 'center',
  11256. backgroundColor: 'rgba(0,0,0,0)',
  11257. borderColor: 'rgba(0,0,0,0)',
  11258. borderWidth: 0,
  11259. padding: 5,
  11260. margin: 5,
  11261. itemGap: 10,
  11262. fontSize: opts.fontSize,
  11263. lineHeight: opts.fontSize,
  11264. fontColor: opts.fontColor,
  11265. formatter: {},
  11266. hiddenColor: '#CECECE' },
  11267. opts.legend);
  11268. opts.extra = assign({}, opts.extra);
  11269. opts.rotate = opts.rotate ? true : false;
  11270. opts.animation = opts.animation ? true : false;
  11271. opts.rotate = opts.rotate ? true : false;
  11272. opts.canvas2d = opts.canvas2d ? true : false;
  11273. var config$$1 = assign({}, config);
  11274. config$$1.color = opts.color ? opts.color : config$$1.color;
  11275. if (opts.type == 'pie') {
  11276. config$$1.pieChartLinePadding = opts.dataLabel === false ? 0 : opts.extra.pie.labelWidth * opts.pix || config$$1.pieChartLinePadding * opts.pix;
  11277. }
  11278. if (opts.type == 'ring') {
  11279. config$$1.pieChartLinePadding = opts.dataLabel === false ? 0 : opts.extra.ring.labelWidth * opts.pix || config$$1.pieChartLinePadding * opts.pix;
  11280. }
  11281. if (opts.type == 'rose') {
  11282. config$$1.pieChartLinePadding = opts.dataLabel === false ? 0 : opts.extra.rose.labelWidth * opts.pix || config$$1.pieChartLinePadding * opts.pix;
  11283. }
  11284. config$$1.pieChartTextPadding = opts.dataLabel === false ? 0 : config$$1.pieChartTextPadding * opts.pix;
  11285. //屏幕旋转
  11286. config$$1.rotate = opts.rotate;
  11287. if (opts.rotate) {
  11288. var tempWidth = opts.width;
  11289. var tempHeight = opts.height;
  11290. opts.width = tempHeight;
  11291. opts.height = tempWidth;
  11292. }
  11293. //适配高分屏
  11294. opts.padding = opts.padding ? opts.padding : config$$1.padding;
  11295. config$$1.yAxisWidth = config.yAxisWidth * opts.pix;
  11296. config$$1.xAxisHeight = config.xAxisHeight * opts.pix;
  11297. if (opts.enableScroll && opts.xAxis.scrollShow) {
  11298. config$$1.xAxisHeight += 6 * opts.pix;
  11299. }
  11300. config$$1.fontSize = opts.fontSize * opts.pix;
  11301. config$$1.titleFontSize = config.titleFontSize * opts.pix;
  11302. config$$1.subtitleFontSize = config.subtitleFontSize * opts.pix;
  11303. config$$1.toolTipPadding = config.toolTipPadding * opts.pix;
  11304. config$$1.toolTipLineHeight = config.toolTipLineHeight * opts.pix;
  11305. if (!opts.context) {
  11306. throw new Error('[uCharts] 未获取到context!注意:v2.0版本后,需要自行获取canvas的绘图上下文并传入opts.context!');
  11307. }
  11308. this.context = opts.context;
  11309. if (!this.context.setTextAlign) {
  11310. this.context.setStrokeStyle = function (e) {
  11311. return this.strokeStyle = e;
  11312. };
  11313. this.context.setLineWidth = function (e) {
  11314. return this.lineWidth = e;
  11315. };
  11316. this.context.setLineCap = function (e) {
  11317. return this.lineCap = e;
  11318. };
  11319. this.context.setFontSize = function (e) {
  11320. return this.font = e + "px sans-serif";
  11321. };
  11322. this.context.setFillStyle = function (e) {
  11323. return this.fillStyle = e;
  11324. };
  11325. this.context.setTextAlign = function (e) {
  11326. return this.textAlign = e;
  11327. };
  11328. this.context.draw = function () {};
  11329. }
  11330. //兼容NVUEsetLineDash
  11331. if (!this.context.setLineDash) {
  11332. this.context.setLineDash = function (e) {};
  11333. }
  11334. opts.chartData = {};
  11335. this.uevent = new uChartsEvent();
  11336. this.scrollOption = {
  11337. currentOffset: 0,
  11338. startTouchX: 0,
  11339. distance: 0,
  11340. lastMoveTime: 0 };
  11341. this.opts = opts;
  11342. this.config = config$$1;
  11343. drawCharts.call(this, opts.type, opts, config$$1, this.context);
  11344. };
  11345. uCharts.prototype.updateData = function () {
  11346. var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11347. this.opts = assign({}, this.opts, data);
  11348. this.opts.updateData = true;
  11349. var scrollPosition = data.scrollPosition || 'current';
  11350. switch (scrollPosition) {
  11351. case 'current':
  11352. this.opts._scrollDistance_ = this.scrollOption.currentOffset;
  11353. break;
  11354. case 'left':
  11355. this.opts._scrollDistance_ = 0;
  11356. this.scrollOption = {
  11357. currentOffset: 0,
  11358. startTouchX: 0,
  11359. distance: 0,
  11360. lastMoveTime: 0 };
  11361. break;
  11362. case 'right':
  11363. var _calYAxisData = calYAxisData(this.opts.series, this.opts, this.config, this.context),yAxisWidth = _calYAxisData.yAxisWidth;
  11364. this.config.yAxisWidth = yAxisWidth;
  11365. var offsetLeft = 0;
  11366. var _getXAxisPoints0 = getXAxisPoints(this.opts.categories, this.opts, this.config),xAxisPoints = _getXAxisPoints0.xAxisPoints,
  11367. startX = _getXAxisPoints0.startX,
  11368. endX = _getXAxisPoints0.endX,
  11369. eachSpacing = _getXAxisPoints0.eachSpacing;
  11370. var totalWidth = eachSpacing * (xAxisPoints.length - 1);
  11371. var screenWidth = endX - startX;
  11372. offsetLeft = screenWidth - totalWidth;
  11373. this.scrollOption = {
  11374. currentOffset: offsetLeft,
  11375. startTouchX: offsetLeft,
  11376. distance: 0,
  11377. lastMoveTime: 0 };
  11378. this.opts._scrollDistance_ = offsetLeft;
  11379. break;}
  11380. drawCharts.call(this, this.opts.type, this.opts, this.config, this.context);
  11381. };
  11382. uCharts.prototype.zoom = function () {
  11383. var val = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.opts.xAxis.itemCount;
  11384. if (this.opts.enableScroll !== true) {
  11385. console.log('[uCharts] 请启用滚动条后使用');
  11386. return;
  11387. }
  11388. //当前屏幕中间点
  11389. var centerPoint = Math.round(Math.abs(this.scrollOption.currentOffset) / this.opts.chartData.eachSpacing) + Math.round(this.opts.xAxis.itemCount / 2);
  11390. this.opts.animation = false;
  11391. this.opts.xAxis.itemCount = val.itemCount;
  11392. //重新计算x轴偏移距离
  11393. var _calYAxisData = calYAxisData(this.opts.series, this.opts, this.config, this.context),
  11394. yAxisWidth = _calYAxisData.yAxisWidth;
  11395. this.config.yAxisWidth = yAxisWidth;
  11396. var offsetLeft = 0;
  11397. var _getXAxisPoints0 = getXAxisPoints(this.opts.categories, this.opts, this.config),
  11398. xAxisPoints = _getXAxisPoints0.xAxisPoints,
  11399. startX = _getXAxisPoints0.startX,
  11400. endX = _getXAxisPoints0.endX,
  11401. eachSpacing = _getXAxisPoints0.eachSpacing;
  11402. var centerLeft = eachSpacing * centerPoint;
  11403. var screenWidth = endX - startX;
  11404. var MaxLeft = screenWidth - eachSpacing * (xAxisPoints.length - 1);
  11405. offsetLeft = screenWidth / 2 - centerLeft;
  11406. if (offsetLeft > 0) {
  11407. offsetLeft = 0;
  11408. }
  11409. if (offsetLeft < MaxLeft) {
  11410. offsetLeft = MaxLeft;
  11411. }
  11412. this.scrollOption = {
  11413. currentOffset: offsetLeft,
  11414. startTouchX: 0,
  11415. distance: 0,
  11416. lastMoveTime: 0 };
  11417. calValidDistance(this, offsetLeft, this.opts.chartData, this.config, this.opts);
  11418. this.opts._scrollDistance_ = offsetLeft;
  11419. drawCharts.call(this, this.opts.type, this.opts, this.config, this.context);
  11420. };
  11421. uCharts.prototype.dobuleZoom = function (e) {
  11422. if (this.opts.enableScroll !== true) {
  11423. console.log('[uCharts] 请启用滚动条后使用');
  11424. return;
  11425. }
  11426. var tcs = e.changedTouches;
  11427. if (tcs.length < 2) {
  11428. return;
  11429. }
  11430. for (var i = 0; i < tcs.length; i++) {
  11431. tcs[i].x = tcs[i].x ? tcs[i].x : tcs[i].clientX;
  11432. tcs[i].y = tcs[i].y ? tcs[i].y : tcs[i].clientY;
  11433. }
  11434. var ntcs = [getTouches(tcs[0], this.opts, e), getTouches(tcs[1], this.opts, e)];
  11435. var xlength = Math.abs(ntcs[0].x - ntcs[1].x);
  11436. // 记录初始的两指之间的数据
  11437. if (!this.scrollOption.moveCount) {
  11438. var cts0 = { changedTouches: [{ x: tcs[0].x, y: this.opts.area[0] / this.opts.pix + 2 }] };
  11439. var cts1 = { changedTouches: [{ x: tcs[1].x, y: this.opts.area[0] / this.opts.pix + 2 }] };
  11440. if (this.opts.rotate) {
  11441. cts0 = { changedTouches: [{ x: this.opts.height / this.opts.pix - this.opts.area[0] / this.opts.pix - 2, y: tcs[0].y }] };
  11442. cts1 = { changedTouches: [{ x: this.opts.height / this.opts.pix - this.opts.area[0] / this.opts.pix - 2, y: tcs[1].y }] };
  11443. }
  11444. var moveCurrent1 = this.getCurrentDataIndex(cts0).index;
  11445. var moveCurrent2 = this.getCurrentDataIndex(cts1).index;
  11446. var moveCount = Math.abs(moveCurrent1 - moveCurrent2);
  11447. this.scrollOption.moveCount = moveCount;
  11448. this.scrollOption.moveCurrent1 = Math.min(moveCurrent1, moveCurrent2);
  11449. this.scrollOption.moveCurrent2 = Math.max(moveCurrent1, moveCurrent2);
  11450. return;
  11451. }
  11452. var currentEachSpacing = xlength / this.scrollOption.moveCount;
  11453. var itemCount = (this.opts.width - this.opts.area[1] - this.opts.area[3]) / currentEachSpacing;
  11454. itemCount = itemCount <= 2 ? 2 : itemCount;
  11455. itemCount = itemCount >= this.opts.categories.length ? this.opts.categories.length : itemCount;
  11456. this.opts.animation = false;
  11457. this.opts.xAxis.itemCount = itemCount;
  11458. // 重新计算滚动条偏移距离
  11459. var offsetLeft = 0;
  11460. var _getXAxisPoints0 = getXAxisPoints(this.opts.categories, this.opts, this.config),
  11461. xAxisPoints = _getXAxisPoints0.xAxisPoints,
  11462. startX = _getXAxisPoints0.startX,
  11463. endX = _getXAxisPoints0.endX,
  11464. eachSpacing = _getXAxisPoints0.eachSpacing;
  11465. var currentLeft = eachSpacing * this.scrollOption.moveCurrent1;
  11466. var screenWidth = endX - startX;
  11467. var MaxLeft = screenWidth - eachSpacing * (xAxisPoints.length - 1);
  11468. offsetLeft = -currentLeft + Math.min(ntcs[0].x, ntcs[1].x) - this.opts.area[3] - eachSpacing;
  11469. if (offsetLeft > 0) {
  11470. offsetLeft = 0;
  11471. }
  11472. if (offsetLeft < MaxLeft) {
  11473. offsetLeft = MaxLeft;
  11474. }
  11475. this.scrollOption.currentOffset = offsetLeft;
  11476. this.scrollOption.startTouchX = 0;
  11477. this.scrollOption.distance = 0;
  11478. calValidDistance(this, offsetLeft, this.opts.chartData, this.config, this.opts);
  11479. this.opts._scrollDistance_ = offsetLeft;
  11480. drawCharts.call(this, this.opts.type, this.opts, this.config, this.context);
  11481. };
  11482. uCharts.prototype.stopAnimation = function () {
  11483. this.animationInstance && this.animationInstance.stop();
  11484. };
  11485. uCharts.prototype.addEventListener = function (type, listener) {
  11486. this.uevent.addEventListener(type, listener);
  11487. };
  11488. uCharts.prototype.delEventListener = function (type) {
  11489. this.uevent.delEventListener(type);
  11490. };
  11491. uCharts.prototype.getCurrentDataIndex = function (e) {
  11492. var touches = null;
  11493. if (e.changedTouches) {
  11494. touches = e.changedTouches[0];
  11495. } else {
  11496. touches = e.mp.changedTouches[0];
  11497. }
  11498. if (touches) {
  11499. var _touches$ = getTouches(touches, this.opts, e);
  11500. if (this.opts.type === 'pie' || this.opts.type === 'ring') {
  11501. return findPieChartCurrentIndex({
  11502. x: _touches$.x,
  11503. y: _touches$.y },
  11504. this.opts.chartData.pieData, this.opts);
  11505. } else if (this.opts.type === 'rose') {
  11506. return findRoseChartCurrentIndex({
  11507. x: _touches$.x,
  11508. y: _touches$.y },
  11509. this.opts.chartData.pieData, this.opts);
  11510. } else if (this.opts.type === 'radar') {
  11511. return findRadarChartCurrentIndex({
  11512. x: _touches$.x,
  11513. y: _touches$.y },
  11514. this.opts.chartData.radarData, this.opts.categories.length);
  11515. } else if (this.opts.type === 'funnel') {
  11516. return findFunnelChartCurrentIndex({
  11517. x: _touches$.x,
  11518. y: _touches$.y },
  11519. this.opts.chartData.funnelData);
  11520. } else if (this.opts.type === 'map') {
  11521. return findMapChartCurrentIndex({
  11522. x: _touches$.x,
  11523. y: _touches$.y },
  11524. this.opts);
  11525. } else if (this.opts.type === 'word') {
  11526. return findWordChartCurrentIndex({
  11527. x: _touches$.x,
  11528. y: _touches$.y },
  11529. this.opts.chartData.wordCloudData);
  11530. } else if (this.opts.type === 'bar') {
  11531. return findBarChartCurrentIndex({
  11532. x: _touches$.x,
  11533. y: _touches$.y },
  11534. this.opts.chartData.calPoints, this.opts, this.config, Math.abs(this.scrollOption.currentOffset));
  11535. } else {
  11536. return findCurrentIndex({
  11537. x: _touches$.x,
  11538. y: _touches$.y },
  11539. this.opts.chartData.calPoints, this.opts, this.config, Math.abs(this.scrollOption.currentOffset));
  11540. }
  11541. }
  11542. return -1;
  11543. };
  11544. uCharts.prototype.getLegendDataIndex = function (e) {
  11545. var touches = null;
  11546. if (e.changedTouches) {
  11547. touches = e.changedTouches[0];
  11548. } else {
  11549. touches = e.mp.changedTouches[0];
  11550. }
  11551. if (touches) {
  11552. var _touches$ = getTouches(touches, this.opts, e);
  11553. return findLegendIndex({
  11554. x: _touches$.x,
  11555. y: _touches$.y },
  11556. this.opts.chartData.legendData);
  11557. }
  11558. return -1;
  11559. };
  11560. uCharts.prototype.touchLegend = function (e) {
  11561. var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11562. var touches = null;
  11563. if (e.changedTouches) {
  11564. touches = e.changedTouches[0];
  11565. } else {
  11566. touches = e.mp.changedTouches[0];
  11567. }
  11568. if (touches) {
  11569. var _touches$ = getTouches(touches, this.opts, e);
  11570. var index = this.getLegendDataIndex(e);
  11571. if (index >= 0) {
  11572. if (this.opts.type == 'candle') {
  11573. this.opts.seriesMA[index].show = !this.opts.seriesMA[index].show;
  11574. } else {
  11575. this.opts.series[index].show = !this.opts.series[index].show;
  11576. }
  11577. this.opts.animation = option.animation ? true : false;
  11578. this.opts._scrollDistance_ = this.scrollOption.currentOffset;
  11579. drawCharts.call(this, this.opts.type, this.opts, this.config, this.context);
  11580. }
  11581. }
  11582. };
  11583. uCharts.prototype.showToolTip = function (e) {var _this2 = this;
  11584. var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11585. var touches = null;
  11586. if (e.changedTouches) {
  11587. touches = e.changedTouches[0];
  11588. } else {
  11589. touches = e.mp.changedTouches[0];
  11590. }
  11591. if (!touches) {
  11592. console.log("[uCharts] 未获取到event坐标信息");
  11593. }
  11594. var _touches$ = getTouches(touches, this.opts, e);
  11595. var currentOffset = this.scrollOption.currentOffset;
  11596. var opts = assign({}, this.opts, {
  11597. _scrollDistance_: currentOffset,
  11598. animation: false });
  11599. if (this.opts.type === 'line' || this.opts.type === 'area' || this.opts.type === 'column' || this.opts.type === 'scatter' || this.opts.type === 'bubble') {
  11600. var current = this.getCurrentDataIndex(e);
  11601. var index = option.index == undefined ? current.index : option.index;
  11602. if (index > -1 || index.length > 0) {
  11603. var seriesData = getSeriesDataItem(this.opts.series, index, current.group);
  11604. if (seriesData.length !== 0) {
  11605. var _getToolTipData = getToolTipData(seriesData, this.opts, index, current.group, this.opts.categories, option),
  11606. textList = _getToolTipData.textList,
  11607. offset = _getToolTipData.offset;
  11608. offset.y = _touches$.y;
  11609. opts.tooltip = {
  11610. textList: option.textList !== undefined ? option.textList : textList,
  11611. offset: option.offset !== undefined ? option.offset : offset,
  11612. option: option,
  11613. index: index };
  11614. }
  11615. }
  11616. drawCharts.call(this, opts.type, opts, this.config, this.context);
  11617. }
  11618. if (this.opts.type === 'mount') {
  11619. var index = option.index == undefined ? this.getCurrentDataIndex(e).index : option.index;
  11620. if (index > -1) {
  11621. var opts = assign({}, this.opts, { animation: false });
  11622. var seriesData = assign({}, opts._series_[index]);
  11623. var textList = [{
  11624. text: option.formatter ? option.formatter(seriesData, undefined, index, opts) : seriesData.name + ': ' + seriesData.data,
  11625. color: seriesData.color }];
  11626. var offset = {
  11627. x: opts.chartData.calPoints[index].x,
  11628. y: _touches$.y };
  11629. opts.tooltip = {
  11630. textList: option.textList ? option.textList : textList,
  11631. offset: option.offset !== undefined ? option.offset : offset,
  11632. option: option,
  11633. index: index };
  11634. }
  11635. drawCharts.call(this, opts.type, opts, this.config, this.context);
  11636. }
  11637. if (this.opts.type === 'bar') {
  11638. var current = this.getCurrentDataIndex(e);
  11639. var index = option.index == undefined ? current.index : option.index;
  11640. if (index > -1 || index.length > 0) {
  11641. var seriesData = getSeriesDataItem(this.opts.series, index, current.group);
  11642. if (seriesData.length !== 0) {
  11643. var _getToolTipData = getToolTipData(seriesData, this.opts, index, current.group, this.opts.categories, option),
  11644. textList = _getToolTipData.textList,
  11645. offset = _getToolTipData.offset;
  11646. offset.x = _touches$.x;
  11647. opts.tooltip = {
  11648. textList: option.textList !== undefined ? option.textList : textList,
  11649. offset: option.offset !== undefined ? option.offset : offset,
  11650. option: option,
  11651. index: index };
  11652. }
  11653. }
  11654. drawCharts.call(this, opts.type, opts, this.config, this.context);
  11655. }
  11656. if (this.opts.type === 'mix') {
  11657. var current = this.getCurrentDataIndex(e);
  11658. var index = option.index == undefined ? current.index : option.index;
  11659. if (index > -1) {
  11660. var currentOffset = this.scrollOption.currentOffset;
  11661. var opts = assign({}, this.opts, {
  11662. _scrollDistance_: currentOffset,
  11663. animation: false });
  11664. var seriesData = getSeriesDataItem(this.opts.series, index);
  11665. if (seriesData.length !== 0) {
  11666. var _getMixToolTipData = getMixToolTipData(seriesData, this.opts, index, this.opts.categories, option),
  11667. textList = _getMixToolTipData.textList,
  11668. offset = _getMixToolTipData.offset;
  11669. offset.y = _touches$.y;
  11670. opts.tooltip = {
  11671. textList: option.textList ? option.textList : textList,
  11672. offset: option.offset !== undefined ? option.offset : offset,
  11673. option: option,
  11674. index: index };
  11675. }
  11676. }
  11677. drawCharts.call(this, opts.type, opts, this.config, this.context);
  11678. }
  11679. if (this.opts.type === 'candle') {
  11680. var current = this.getCurrentDataIndex(e);
  11681. var index = option.index == undefined ? current.index : option.index;
  11682. if (index > -1) {
  11683. var currentOffset = this.scrollOption.currentOffset;
  11684. var opts = assign({}, this.opts, {
  11685. _scrollDistance_: currentOffset,
  11686. animation: false });
  11687. var seriesData = getSeriesDataItem(this.opts.series, index);
  11688. if (seriesData.length !== 0) {
  11689. var _getToolTipData = getCandleToolTipData(this.opts.series[0].data, seriesData, this.opts, index, this.opts.categories, this.opts.extra.candle, option),
  11690. textList = _getToolTipData.textList,
  11691. offset = _getToolTipData.offset;
  11692. offset.y = _touches$.y;
  11693. opts.tooltip = {
  11694. textList: option.textList ? option.textList : textList,
  11695. offset: option.offset !== undefined ? option.offset : offset,
  11696. option: option,
  11697. index: index };
  11698. }
  11699. }
  11700. drawCharts.call(this, opts.type, opts, this.config, this.context);
  11701. }
  11702. if (this.opts.type === 'pie' || this.opts.type === 'ring' || this.opts.type === 'rose' || this.opts.type === 'funnel') {
  11703. var index = option.index == undefined ? this.getCurrentDataIndex(e) : option.index;
  11704. if (index > -1) {
  11705. var opts = assign({}, this.opts, { animation: false });
  11706. var seriesData = assign({}, opts._series_[index]);
  11707. var textList = [{
  11708. text: option.formatter ? option.formatter(seriesData, undefined, index, opts) : seriesData.name + ': ' + seriesData.data,
  11709. color: seriesData.color }];
  11710. var offset = {
  11711. x: _touches$.x,
  11712. y: _touches$.y };
  11713. opts.tooltip = {
  11714. textList: option.textList ? option.textList : textList,
  11715. offset: option.offset !== undefined ? option.offset : offset,
  11716. option: option,
  11717. index: index };
  11718. }
  11719. drawCharts.call(this, opts.type, opts, this.config, this.context);
  11720. }
  11721. if (this.opts.type === 'map') {
  11722. var index = option.index == undefined ? this.getCurrentDataIndex(e) : option.index;
  11723. if (index > -1) {
  11724. var opts = assign({}, this.opts, { animation: false });
  11725. var seriesData = assign({}, this.opts.series[index]);
  11726. seriesData.name = seriesData.properties.name;
  11727. var textList = [{
  11728. text: option.formatter ? option.formatter(seriesData, undefined, index, this.opts) : seriesData.name,
  11729. color: seriesData.color }];
  11730. var offset = {
  11731. x: _touches$.x,
  11732. y: _touches$.y };
  11733. opts.tooltip = {
  11734. textList: option.textList ? option.textList : textList,
  11735. offset: option.offset !== undefined ? option.offset : offset,
  11736. option: option,
  11737. index: index };
  11738. }
  11739. opts.updateData = false;
  11740. drawCharts.call(this, opts.type, opts, this.config, this.context);
  11741. }
  11742. if (this.opts.type === 'word') {
  11743. var index = option.index == undefined ? this.getCurrentDataIndex(e) : option.index;
  11744. if (index > -1) {
  11745. var opts = assign({}, this.opts, { animation: false });
  11746. var seriesData = assign({}, this.opts.series[index]);
  11747. var textList = [{
  11748. text: option.formatter ? option.formatter(seriesData, undefined, index, this.opts) : seriesData.name,
  11749. color: seriesData.color }];
  11750. var offset = {
  11751. x: _touches$.x,
  11752. y: _touches$.y };
  11753. opts.tooltip = {
  11754. textList: option.textList ? option.textList : textList,
  11755. offset: option.offset !== undefined ? option.offset : offset,
  11756. option: option,
  11757. index: index };
  11758. }
  11759. opts.updateData = false;
  11760. drawCharts.call(this, opts.type, opts, this.config, this.context);
  11761. }
  11762. if (this.opts.type === 'radar') {
  11763. var index = option.index == undefined ? this.getCurrentDataIndex(e) : option.index;
  11764. if (index > -1) {
  11765. var opts = assign({}, this.opts, { animation: false });
  11766. var seriesData = getSeriesDataItem(this.opts.series, index);
  11767. if (seriesData.length !== 0) {
  11768. var textList = seriesData.map(function (item) {
  11769. return {
  11770. text: option.formatter ? option.formatter(item, _this2.opts.categories[index], index, _this2.opts) : item.name + ': ' + item.data,
  11771. color: item.color };
  11772. });
  11773. var offset = {
  11774. x: _touches$.x,
  11775. y: _touches$.y };
  11776. opts.tooltip = {
  11777. textList: option.textList ? option.textList : textList,
  11778. offset: option.offset !== undefined ? option.offset : offset,
  11779. option: option,
  11780. index: index };
  11781. }
  11782. }
  11783. drawCharts.call(this, opts.type, opts, this.config, this.context);
  11784. }
  11785. };
  11786. uCharts.prototype.translate = function (distance) {
  11787. this.scrollOption = {
  11788. currentOffset: distance,
  11789. startTouchX: distance,
  11790. distance: 0,
  11791. lastMoveTime: 0 };
  11792. var opts = assign({}, this.opts, {
  11793. _scrollDistance_: distance,
  11794. animation: false });
  11795. drawCharts.call(this, this.opts.type, opts, this.config, this.context);
  11796. };
  11797. uCharts.prototype.scrollStart = function (e) {
  11798. var touches = null;
  11799. if (e.changedTouches) {
  11800. touches = e.changedTouches[0];
  11801. } else {
  11802. touches = e.mp.changedTouches[0];
  11803. }
  11804. var _touches$ = getTouches(touches, this.opts, e);
  11805. if (touches && this.opts.enableScroll === true) {
  11806. this.scrollOption.startTouchX = _touches$.x;
  11807. }
  11808. };
  11809. uCharts.prototype.scroll = function (e) {
  11810. if (this.scrollOption.lastMoveTime === 0) {
  11811. this.scrollOption.lastMoveTime = Date.now();
  11812. }
  11813. var Limit = this.opts.touchMoveLimit || 60;
  11814. var currMoveTime = Date.now();
  11815. var duration = currMoveTime - this.scrollOption.lastMoveTime;
  11816. if (duration < Math.floor(1000 / Limit)) return;
  11817. if (this.scrollOption.startTouchX == 0) return;
  11818. this.scrollOption.lastMoveTime = currMoveTime;
  11819. var touches = null;
  11820. if (e.changedTouches) {
  11821. touches = e.changedTouches[0];
  11822. } else {
  11823. touches = e.mp.changedTouches[0];
  11824. }
  11825. if (touches && this.opts.enableScroll === true) {
  11826. var _touches$ = getTouches(touches, this.opts, e);
  11827. var _distance;
  11828. _distance = _touches$.x - this.scrollOption.startTouchX;
  11829. var currentOffset = this.scrollOption.currentOffset;
  11830. var validDistance = calValidDistance(this, currentOffset + _distance, this.opts.chartData, this.config, this.opts);
  11831. this.scrollOption.distance = _distance = validDistance - currentOffset;
  11832. var opts = assign({}, this.opts, {
  11833. _scrollDistance_: currentOffset + _distance,
  11834. animation: false });
  11835. this.opts = opts;
  11836. drawCharts.call(this, opts.type, opts, this.config, this.context);
  11837. return currentOffset + _distance;
  11838. }
  11839. };
  11840. uCharts.prototype.scrollEnd = function (e) {
  11841. if (this.opts.enableScroll === true) {
  11842. var _scrollOption = this.scrollOption,
  11843. currentOffset = _scrollOption.currentOffset,
  11844. distance = _scrollOption.distance;
  11845. this.scrollOption.currentOffset = currentOffset + distance;
  11846. this.scrollOption.distance = 0;
  11847. this.scrollOption.moveCount = 0;
  11848. }
  11849. };var _default =
  11850. uCharts;exports.default = _default;
  11851. /***/ }),
  11852. /***/ 302:
  11853. /*!*********************************************************************************!*\
  11854. !*** F:/工作项目/pingpu_H5/uni_modules/ui-charts/js_sdk/u-charts/config-ucharts.js ***!
  11855. \*********************************************************************************/
  11856. /*! no static exports found */
  11857. /***/ (function(module, exports, __webpack_require__) {
  11858. "use strict";
  11859. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /*
  11860. * uCharts®
  11861. * 高性能跨平台图表库,支持H5、APP、小程序(微信/支付宝/百度/头条/QQ/360)、Vue、Taro等支持canvas的框架平台
  11862. * Copyright (c) 2021 QIUN®秋云 https://www.ucharts.cn All rights reserved.
  11863. * Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  11864. * 复制使用请保留本段注释,感谢支持开源!
  11865. *
  11866. * uCharts®官方网站
  11867. * https://www.uCharts.cn
  11868. *
  11869. * 开源地址:
  11870. * https://gitee.com/uCharts/uCharts
  11871. *
  11872. * uni-app插件市场地址:
  11873. * http://ext.dcloud.net.cn/plugin?id=271
  11874. *
  11875. */
  11876. // 主题颜色配置:如每个图表类型需要不同主题,请在对应图表类型上更改color属性
  11877. var color = ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc'];
  11878. //事件转换函数,主要用作格式化x轴为时间轴,根据需求自行修改
  11879. var formatDateTime = function formatDateTime(timeStamp, returnType) {
  11880. var date = new Date();
  11881. date.setTime(timeStamp * 1000);
  11882. var y = date.getFullYear();
  11883. var m = date.getMonth() + 1;
  11884. m = m < 10 ? '0' + m : m;
  11885. var d = date.getDate();
  11886. d = d < 10 ? '0' + d : d;
  11887. var h = date.getHours();
  11888. h = h < 10 ? '0' + h : h;
  11889. var minute = date.getMinutes();
  11890. var second = date.getSeconds();
  11891. minute = minute < 10 ? '0' + minute : minute;
  11892. second = second < 10 ? '0' + second : second;
  11893. if (returnType == 'full') {return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;}
  11894. if (returnType == 'y-m-d') {return y + '-' + m + '-' + d;}
  11895. if (returnType == 'h:m') {return h + ':' + minute;}
  11896. if (returnType == 'h:m:s') {return h + ':' + minute + ':' + second;}
  11897. return [y, m, d, h, minute, second];
  11898. };
  11899. var cfu = {
  11900. //demotype为自定义图表类型,一般不需要自定义图表类型,只需要改根节点上对应的类型即可
  11901. "type": ["pie", "ring", "rose", "word", "funnel", "map", "arcbar", "line", "column", "mount", "bar", "area", "radar", "gauge", "candle", "mix", "tline", "tarea", "scatter", "bubble", "demotype"],
  11902. "range": ["饼状图", "圆环图", "玫瑰图", "词云图", "漏斗图", "地图", "圆弧进度条", "折线图", "柱状图", "山峰图", "条状图", "区域图", "雷达图", "仪表盘", "K线图", "混合图", "时间轴折线", "时间轴区域", "散点图", "气泡图", "自定义类型"],
  11903. //增加自定义图表类型,如果需要categories,请在这里加入您的图表类型,例如最后的"demotype"
  11904. //自定义类型时需要注意"tline","tarea","scatter","bubble"等时间轴(矢量x轴)类图表,没有categories,不需要加入categories
  11905. "categories": ["line", "column", "mount", "bar", "area", "radar", "gauge", "candle", "mix", "demotype"],
  11906. //instance为实例变量承载属性,不要删除
  11907. "instance": {},
  11908. //option为opts及eopts承载属性,不要删除
  11909. "option": {},
  11910. //下面是自定义format配置,因除H5端外的其他端无法通过props传递函数,只能通过此属性对应下标的方式来替换
  11911. "formatter": {
  11912. "yAxisDemo1": function yAxisDemo1(val, index, opts) {return val + '元';},
  11913. "yAxisDemo2": function yAxisDemo2(val, index, opts) {return val.toFixed(2);},
  11914. "xAxisDemo1": function xAxisDemo1(val, index, opts) {return val + '年';},
  11915. "xAxisDemo2": function xAxisDemo2(val, index, opts) {return formatDateTime(val, 'h:m');},
  11916. "seriesDemo1": function seriesDemo1(val, index, series, opts) {return val + '元';},
  11917. "tooltipDemo1": function tooltipDemo1(item, category, index, opts) {
  11918. if (index == 0) {
  11919. return '随便用' + item.data + '年';
  11920. } else {
  11921. return '其他我没改' + item.data + '天';
  11922. }
  11923. },
  11924. "pieDemo": function pieDemo(val, index, series, opts) {
  11925. if (index !== undefined) {
  11926. return series[index].name + ':' + series[index].data + '元';
  11927. }
  11928. } },
  11929. //这里演示了自定义您的图表类型的option,可以随意命名,之后在组件上 type="demotype" 后,组件会调用这个花括号里的option,如果组件上还存在opts参数,会将demotype与opts中option合并后渲染图表。
  11930. "demotype": {
  11931. //我这里把曲线图当做了自定义图表类型,您可以根据需要随意指定类型或配置
  11932. "type": "line",
  11933. "color": color,
  11934. "padding": [15, 10, 0, 15],
  11935. "xAxis": {
  11936. "disableGrid": true },
  11937. "yAxis": {
  11938. "gridType": "dash",
  11939. "dashLength": 2 },
  11940. "legend": {},
  11941. "extra": {
  11942. "line": {
  11943. "type": "curve",
  11944. "width": 2 } } },
  11945. //下面是自定义配置,请添加项目所需的通用配置
  11946. "pie": {
  11947. "type": "pie",
  11948. "color": color,
  11949. "padding": [5, 5, 5, 5],
  11950. "extra": {
  11951. "pie": {
  11952. "activeOpacity": 0.5,
  11953. "activeRadius": 10,
  11954. "offsetAngle": 0,
  11955. "labelWidth": 15,
  11956. "border": true,
  11957. "borderWidth": 3,
  11958. "borderColor": "#FFFFFF" } } },
  11959. "ring": {
  11960. "type": "ring",
  11961. "color": color,
  11962. "padding": [5, 5, 5, 5],
  11963. "rotate": false,
  11964. "dataLabel": true,
  11965. "legend": {
  11966. "show": true,
  11967. "position": "right",
  11968. "lineHeight": 25 },
  11969. "title": {
  11970. "name": "收益率",
  11971. "fontSize": 15,
  11972. "color": "#666666" },
  11973. "subtitle": {
  11974. "name": "70%",
  11975. "fontSize": 25,
  11976. "color": "#7cb5ec" },
  11977. "extra": {
  11978. "ring": {
  11979. "ringWidth": 30,
  11980. "activeOpacity": 0.5,
  11981. "activeRadius": 10,
  11982. "offsetAngle": 0,
  11983. "labelWidth": 15,
  11984. "border": true,
  11985. "borderWidth": 3,
  11986. "borderColor": "#FFFFFF" } } },
  11987. "rose": {
  11988. "type": "rose",
  11989. "color": color,
  11990. "padding": [5, 5, 5, 5],
  11991. "legend": {
  11992. "show": true,
  11993. "position": "left",
  11994. "lineHeight": 25 },
  11995. "extra": {
  11996. "rose": {
  11997. "type": "area",
  11998. "minRadius": 50,
  11999. "activeOpacity": 0.5,
  12000. "activeRadius": 10,
  12001. "offsetAngle": 0,
  12002. "labelWidth": 15,
  12003. "border": false,
  12004. "borderWidth": 2,
  12005. "borderColor": "#FFFFFF" } } },
  12006. "word": {
  12007. "type": "word",
  12008. "color": color,
  12009. "extra": {
  12010. "word": {
  12011. "type": "normal",
  12012. "autoColors": false } } },
  12013. "funnel": {
  12014. "type": "funnel",
  12015. "color": color,
  12016. "padding": [15, 15, 0, 15],
  12017. "extra": {
  12018. "funnel": {
  12019. "activeOpacity": 0.3,
  12020. "activeWidth": 10,
  12021. "border": true,
  12022. "borderWidth": 2,
  12023. "borderColor": "#FFFFFF",
  12024. "fillOpacity": 1,
  12025. "labelAlign": "right" } } },
  12026. "map": {
  12027. "type": "map",
  12028. "color": color,
  12029. "padding": [0, 0, 0, 0],
  12030. "dataLabel": true,
  12031. "extra": {
  12032. "map": {
  12033. "border": true,
  12034. "borderWidth": 1,
  12035. "borderColor": "#666666",
  12036. "fillOpacity": 0.6,
  12037. "activeBorderColor": "#F04864",
  12038. "activeFillColor": "#FACC14",
  12039. "activeFillOpacity": 1 } } },
  12040. "arcbar": {
  12041. "type": "arcbar",
  12042. "color": color,
  12043. "title": {
  12044. "name": "百分比",
  12045. "fontSize": 25,
  12046. "color": "#00FF00" },
  12047. "subtitle": {
  12048. "name": "默认标题",
  12049. "fontSize": 15,
  12050. "color": "#666666" },
  12051. "extra": {
  12052. "arcbar": {
  12053. "type": "default",
  12054. "width": 12,
  12055. "backgroundColor": "#E9E9E9",
  12056. "startAngle": 0.75,
  12057. "endAngle": 0.25,
  12058. "gap": 2 } } },
  12059. "line": {
  12060. "type": "line",
  12061. "color": color,
  12062. "padding": [15, 10, 0, 15],
  12063. "xAxis": {
  12064. "disableGrid": true },
  12065. "yAxis": {
  12066. "gridType": "dash",
  12067. "dashLength": 2 },
  12068. "legend": {},
  12069. "extra": {
  12070. "line": {
  12071. "type": "straight",
  12072. "width": 2 } } },
  12073. "tline": {
  12074. "type": "line",
  12075. "color": color,
  12076. "padding": [15, 10, 0, 15],
  12077. "xAxis": {
  12078. "disableGrid": false,
  12079. "boundaryGap": "justify" },
  12080. "yAxis": {
  12081. "gridType": "dash",
  12082. "dashLength": 2,
  12083. "data": [
  12084. {
  12085. "min": 0,
  12086. "max": 80 }] },
  12087. "legend": {},
  12088. "extra": {
  12089. "line": {
  12090. "type": "curve",
  12091. "width": 2 } } },
  12092. "tarea": {
  12093. "type": "area",
  12094. "color": color,
  12095. "padding": [15, 10, 0, 15],
  12096. "xAxis": {
  12097. "disableGrid": true,
  12098. "boundaryGap": "justify" },
  12099. "yAxis": {
  12100. "gridType": "dash",
  12101. "dashLength": 2,
  12102. "data": [
  12103. {
  12104. "min": 0,
  12105. "max": 80 }] },
  12106. "legend": {},
  12107. "extra": {
  12108. "area": {
  12109. "type": "curve",
  12110. "opacity": 0.2,
  12111. "addLine": true,
  12112. "width": 2,
  12113. "gradient": true } } },
  12114. "column": {
  12115. "type": "column",
  12116. "color": color,
  12117. "padding": [15, 15, 0, 5],
  12118. "xAxis": {
  12119. "disableGrid": true },
  12120. "yAxis": {
  12121. "data": [{ "min": 0 }] },
  12122. "legend": {},
  12123. "extra": {
  12124. "column": {
  12125. "type": "group",
  12126. "width": 30,
  12127. "activeBgColor": "#000000",
  12128. "activeBgOpacity": 0.08 } } },
  12129. "mount": {
  12130. "type": "mount",
  12131. "color": color,
  12132. "padding": [15, 15, 0, 5],
  12133. "xAxis": {
  12134. "disableGrid": true },
  12135. "yAxis": {
  12136. "data": [{ "min": 0 }] },
  12137. "legend": {},
  12138. "extra": {
  12139. "mount": {
  12140. "type": "mount",
  12141. "widthRatio": 1.5 } } },
  12142. "bar": {
  12143. "type": "bar",
  12144. "color": color,
  12145. "padding": [15, 30, 0, 5],
  12146. "xAxis": {
  12147. "boundaryGap": "justify",
  12148. "disableGrid": false,
  12149. "min": 0,
  12150. "axisLine": false },
  12151. "yAxis": {},
  12152. "legend": {},
  12153. "extra": {
  12154. "bar": {
  12155. "type": "group",
  12156. "width": 30,
  12157. "meterBorde": 1,
  12158. "meterFillColor": "#FFFFFF",
  12159. "activeBgColor": "#000000",
  12160. "activeBgOpacity": 0.08 } } },
  12161. "area": {
  12162. "type": "area",
  12163. "color": color,
  12164. "padding": [15, 15, 0, 15],
  12165. "xAxis": {
  12166. "disableGrid": true },
  12167. "yAxis": {
  12168. "gridType": "dash",
  12169. "dashLength": 2 },
  12170. "legend": {},
  12171. "extra": {
  12172. "area": {
  12173. "type": "straight",
  12174. "opacity": 0.2,
  12175. "addLine": true,
  12176. "width": 2,
  12177. "gradient": false } } },
  12178. "radar": {
  12179. "type": "radar",
  12180. "color": color,
  12181. "padding": [5, 5, 5, 5],
  12182. "dataLabel": false,
  12183. "legend": {
  12184. "show": true,
  12185. "position": "right",
  12186. "lineHeight": 25 },
  12187. "extra": {
  12188. "radar": {
  12189. "gridType": "radar",
  12190. "gridColor": "#CCCCCC",
  12191. "gridCount": 3,
  12192. "opacity": 0.2,
  12193. "max": 200 } } },
  12194. "gauge": {
  12195. "type": "gauge",
  12196. "color": color,
  12197. "title": {
  12198. "name": "66Km/H",
  12199. "fontSize": 25,
  12200. "color": "#2fc25b",
  12201. "offsetY": 50 },
  12202. "subtitle": {
  12203. "name": "实时速度",
  12204. "fontSize": 15,
  12205. "color": "#1890ff",
  12206. "offsetY": -50 },
  12207. "extra": {
  12208. "gauge": {
  12209. "type": "default",
  12210. "width": 30,
  12211. "labelColor": "#666666",
  12212. "startAngle": 0.75,
  12213. "endAngle": 0.25,
  12214. "startNumber": 0,
  12215. "endNumber": 100,
  12216. "labelFormat": "",
  12217. "splitLine": {
  12218. "fixRadius": 0,
  12219. "splitNumber": 10,
  12220. "width": 30,
  12221. "color": "#FFFFFF",
  12222. "childNumber": 5,
  12223. "childWidth": 12 },
  12224. "pointer": {
  12225. "width": 24,
  12226. "color": "auto" } } } },
  12227. "candle": {
  12228. "type": "candle",
  12229. "color": color,
  12230. "padding": [15, 15, 0, 15],
  12231. "enableScroll": true,
  12232. "enableMarkLine": true,
  12233. "dataLabel": false,
  12234. "xAxis": {
  12235. "labelCount": 4,
  12236. "itemCount": 40,
  12237. "disableGrid": true,
  12238. "gridColor": "#CCCCCC",
  12239. "gridType": "solid",
  12240. "dashLength": 4,
  12241. "scrollShow": true,
  12242. "scrollAlign": "left",
  12243. "scrollColor": "#A6A6A6",
  12244. "scrollBackgroundColor": "#EFEBEF" },
  12245. "yAxis": {},
  12246. "legend": {},
  12247. "extra": {
  12248. "candle": {
  12249. "color": {
  12250. "upLine": "#f04864",
  12251. "upFill": "#f04864",
  12252. "downLine": "#2fc25b",
  12253. "downFill": "#2fc25b" },
  12254. "average": {
  12255. "show": true,
  12256. "name": ["MA5", "MA10", "MA30"],
  12257. "day": [5, 10, 20],
  12258. "color": ["#1890ff", "#2fc25b", "#facc14"] } },
  12259. "markLine": {
  12260. "type": "dash",
  12261. "dashLength": 5,
  12262. "data": [
  12263. {
  12264. "value": 2150,
  12265. "lineColor": "#f04864",
  12266. "showLabel": true },
  12267. {
  12268. "value": 2350,
  12269. "lineColor": "#f04864",
  12270. "showLabel": true }] } } },
  12271. "mix": {
  12272. "type": "mix",
  12273. "color": color,
  12274. "padding": [15, 15, 0, 15],
  12275. "xAxis": {
  12276. "disableGrid": true },
  12277. "yAxis": {
  12278. "disabled": false,
  12279. "disableGrid": false,
  12280. "splitNumber": 5,
  12281. "gridType": "dash",
  12282. "dashLength": 4,
  12283. "gridColor": "#CCCCCC",
  12284. "padding": 10,
  12285. "showTitle": true,
  12286. "data": [] },
  12287. "legend": {},
  12288. "extra": {
  12289. "mix": {
  12290. "column": {
  12291. "width": 20 } } } },
  12292. "scatter": {
  12293. "type": "scatter",
  12294. "color": color,
  12295. "padding": [15, 15, 0, 15],
  12296. "dataLabel": false,
  12297. "xAxis": {
  12298. "disableGrid": false,
  12299. "gridType": "dash",
  12300. "splitNumber": 5,
  12301. "boundaryGap": "justify",
  12302. "min": 0 },
  12303. "yAxis": {
  12304. "disableGrid": false,
  12305. "gridType": "dash" },
  12306. "legend": {},
  12307. "extra": {
  12308. "scatter": {} } },
  12309. "bubble": {
  12310. "type": "bubble",
  12311. "color": color,
  12312. "padding": [15, 15, 0, 15],
  12313. "xAxis": {
  12314. "disableGrid": false,
  12315. "gridType": "dash",
  12316. "splitNumber": 5,
  12317. "boundaryGap": "justify",
  12318. "min": 0,
  12319. "max": 250 },
  12320. "yAxis": {
  12321. "disableGrid": false,
  12322. "gridType": "dash",
  12323. "data": [{
  12324. "min": 0,
  12325. "max": 150 }] },
  12326. "legend": {},
  12327. "extra": {
  12328. "bubble": {
  12329. "border": 2,
  12330. "opacity": 0.5 } } } };var _default =
  12331. cfu;exports.default = _default;
  12332. /***/ }),
  12333. /***/ 310:
  12334. /*!************************************************************************************************!*\
  12335. !*** F:/工作项目/pingpu_H5/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js ***!
  12336. \************************************************************************************************/
  12337. /*! no static exports found */
  12338. /***/ (function(module, exports, __webpack_require__) {
  12339. "use strict";
  12340. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var Calendar = /*#__PURE__*/function () {
  12341. function Calendar()
  12342. {var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},date = _ref.date,selected = _ref.selected,startDate = _ref.startDate,endDate = _ref.endDate,range = _ref.range;_classCallCheck(this, Calendar);
  12343. // 当前日期
  12344. this.date = this.getDate(new Date()); // 当前初入日期
  12345. // 打点信息
  12346. this.selected = selected || [];
  12347. // 范围开始
  12348. this.startDate = startDate;
  12349. // 范围结束
  12350. this.endDate = endDate;
  12351. this.range = range;
  12352. // 多选状态
  12353. this.cleanMultipleStatus();
  12354. // 每周日期
  12355. this.weeks = {};
  12356. // this._getWeek(this.date.fullDate)
  12357. // this.multipleStatus = multipleStatus
  12358. this.lastHover = false;
  12359. }
  12360. /**
  12361. * 设置日期
  12362. * @param {Object} date
  12363. */_createClass(Calendar, [{ key: "setDate", value: function setDate(
  12364. date) {
  12365. this.selectDate = this.getDate(date);
  12366. this._getWeek(this.selectDate.fullDate);
  12367. }
  12368. /**
  12369. * 清理多选状态
  12370. */ }, { key: "cleanMultipleStatus", value: function cleanMultipleStatus()
  12371. {
  12372. this.multipleStatus = {
  12373. before: '',
  12374. after: '',
  12375. data: [] };
  12376. }
  12377. /**
  12378. * 重置开始日期
  12379. */ }, { key: "resetSatrtDate", value: function resetSatrtDate(
  12380. startDate) {
  12381. // 范围开始
  12382. this.startDate = startDate;
  12383. }
  12384. /**
  12385. * 重置结束日期
  12386. */ }, { key: "resetEndDate", value: function resetEndDate(
  12387. endDate) {
  12388. // 范围结束
  12389. this.endDate = endDate;
  12390. }
  12391. /**
  12392. * 获取任意时间
  12393. */ }, { key: "getDate", value: function getDate(
  12394. date) {var AddDayCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;var str = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'day';
  12395. if (!date) {
  12396. date = new Date();
  12397. }
  12398. if (typeof date !== 'object') {
  12399. date = date.replace(/-/g, '/');
  12400. }
  12401. var dd = new Date(date);
  12402. switch (str) {
  12403. case 'day':
  12404. dd.setDate(dd.getDate() + AddDayCount); // 获取AddDayCount天后的日期
  12405. break;
  12406. case 'month':
  12407. if (dd.getDate() === 31) {
  12408. dd.setDate(dd.getDate() + AddDayCount);
  12409. } else {
  12410. dd.setMonth(dd.getMonth() + AddDayCount); // 获取AddDayCount天后的日期
  12411. }
  12412. break;
  12413. case 'year':
  12414. dd.setFullYear(dd.getFullYear() + AddDayCount); // 获取AddDayCount天后的日期
  12415. break;}
  12416. var y = dd.getFullYear();
  12417. var m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1; // 获取当前月份的日期,不足10补0
  12418. var d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate(); // 获取当前几号,不足10补0
  12419. return {
  12420. fullDate: y + '-' + m + '-' + d,
  12421. year: y,
  12422. month: m,
  12423. date: d,
  12424. day: dd.getDay() };
  12425. }
  12426. /**
  12427. * 获取上月剩余天数
  12428. */ }, { key: "_getLastMonthDays", value: function _getLastMonthDays(
  12429. firstDay, full) {
  12430. var dateArr = [];
  12431. for (var i = firstDay; i > 0; i--) {
  12432. var beforeDate = new Date(full.year, full.month - 1, -i + 1).getDate();
  12433. dateArr.push({
  12434. date: beforeDate,
  12435. month: full.month - 1,
  12436. disable: true });
  12437. }
  12438. return dateArr;
  12439. }
  12440. /**
  12441. * 获取本月天数
  12442. */ }, { key: "_currentMonthDys", value: function _currentMonthDys(
  12443. dateData, full) {var _this = this;
  12444. var dateArr = [];
  12445. var fullDate = this.date.fullDate;var _loop = function _loop(
  12446. i) {
  12447. var isinfo = false;
  12448. var nowDate = full.year + '-' + (full.month < 10 ?
  12449. full.month : full.month) + '-' + (i < 10 ?
  12450. '0' + i : i);
  12451. // 是否今天
  12452. var isDay = fullDate === nowDate;
  12453. // 获取打点信息
  12454. var info = _this.selected && _this.selected.find(function (item) {
  12455. if (_this.dateEqual(nowDate, item.date)) {
  12456. return item;
  12457. }
  12458. });
  12459. // 日期禁用
  12460. var disableBefore = true;
  12461. var disableAfter = true;
  12462. if (_this.startDate) {
  12463. // let dateCompBefore = this.dateCompare(this.startDate, fullDate)
  12464. // disableBefore = this.dateCompare(dateCompBefore ? this.startDate : fullDate, nowDate)
  12465. disableBefore = _this.dateCompare(_this.startDate, nowDate);
  12466. }
  12467. if (_this.endDate) {
  12468. // let dateCompAfter = this.dateCompare(fullDate, this.endDate)
  12469. // disableAfter = this.dateCompare(nowDate, dateCompAfter ? this.endDate : fullDate)
  12470. disableAfter = _this.dateCompare(nowDate, _this.endDate);
  12471. }
  12472. var multiples = _this.multipleStatus.data;
  12473. var checked = false;
  12474. var multiplesStatus = -1;
  12475. if (_this.range) {
  12476. if (multiples) {
  12477. multiplesStatus = multiples.findIndex(function (item) {
  12478. return _this.dateEqual(item, nowDate);
  12479. });
  12480. }
  12481. if (multiplesStatus !== -1) {
  12482. checked = true;
  12483. }
  12484. }
  12485. var data = {
  12486. fullDate: nowDate,
  12487. year: full.year,
  12488. date: i,
  12489. multiple: _this.range ? checked : false,
  12490. beforeMultiple: _this.isLogicBefore(nowDate, _this.multipleStatus.before, _this.multipleStatus.after),
  12491. afterMultiple: _this.isLogicAfter(nowDate, _this.multipleStatus.before, _this.multipleStatus.after),
  12492. month: full.month,
  12493. disable: !(disableBefore && disableAfter),
  12494. isDay: isDay,
  12495. userChecked: false };
  12496. if (info) {
  12497. data.extraInfo = info;
  12498. }
  12499. dateArr.push(data);};for (var i = 1; i <= dateData; i++) {_loop(i);
  12500. }
  12501. return dateArr;
  12502. }
  12503. /**
  12504. * 获取下月天数
  12505. */ }, { key: "_getNextMonthDays", value: function _getNextMonthDays(
  12506. surplus, full) {
  12507. var dateArr = [];
  12508. for (var i = 1; i < surplus + 1; i++) {
  12509. dateArr.push({
  12510. date: i,
  12511. month: Number(full.month) + 1,
  12512. disable: true });
  12513. }
  12514. return dateArr;
  12515. }
  12516. /**
  12517. * 获取当前日期详情
  12518. * @param {Object} date
  12519. */ }, { key: "getInfo", value: function getInfo(
  12520. date) {var _this2 = this;
  12521. if (!date) {
  12522. date = new Date();
  12523. }
  12524. var dateInfo = this.canlender.find(function (item) {return item.fullDate === _this2.getDate(date).fullDate;});
  12525. return dateInfo;
  12526. }
  12527. /**
  12528. * 比较时间大小
  12529. */ }, { key: "dateCompare", value: function dateCompare(
  12530. startDate, endDate) {
  12531. // 计算截止时间
  12532. startDate = new Date(startDate.replace('-', '/').replace('-', '/'));
  12533. // 计算详细项的截止时间
  12534. endDate = new Date(endDate.replace('-', '/').replace('-', '/'));
  12535. if (startDate <= endDate) {
  12536. return true;
  12537. } else {
  12538. return false;
  12539. }
  12540. }
  12541. /**
  12542. * 比较时间是否相等
  12543. */ }, { key: "dateEqual", value: function dateEqual(
  12544. before, after) {
  12545. // 计算截止时间
  12546. before = new Date(before.replace('-', '/').replace('-', '/'));
  12547. // 计算详细项的截止时间
  12548. after = new Date(after.replace('-', '/').replace('-', '/'));
  12549. if (before.getTime() - after.getTime() === 0) {
  12550. return true;
  12551. } else {
  12552. return false;
  12553. }
  12554. }
  12555. /**
  12556. * 比较真实起始日期
  12557. */ }, { key: "isLogicBefore", value: function isLogicBefore(
  12558. currentDay, before, after) {
  12559. var logicBefore = before;
  12560. if (before && after) {
  12561. logicBefore = this.dateCompare(before, after) ? before : after;
  12562. }
  12563. return this.dateEqual(logicBefore, currentDay);
  12564. } }, { key: "isLogicAfter", value: function isLogicAfter(
  12565. currentDay, before, after) {
  12566. var logicAfter = after;
  12567. if (before && after) {
  12568. logicAfter = this.dateCompare(before, after) ? after : before;
  12569. }
  12570. return this.dateEqual(logicAfter, currentDay);
  12571. }
  12572. /**
  12573. * 获取日期范围内所有日期
  12574. * @param {Object} begin
  12575. * @param {Object} end
  12576. */ }, { key: "geDateAll", value: function geDateAll(
  12577. begin, end) {
  12578. var arr = [];
  12579. var ab = begin.split('-');
  12580. var ae = end.split('-');
  12581. var db = new Date();
  12582. db.setFullYear(ab[0], ab[1] - 1, ab[2]);
  12583. var de = new Date();
  12584. de.setFullYear(ae[0], ae[1] - 1, ae[2]);
  12585. var unixDb = db.getTime() - 24 * 60 * 60 * 1000;
  12586. var unixDe = de.getTime() - 24 * 60 * 60 * 1000;
  12587. for (var k = unixDb; k <= unixDe;) {
  12588. k = k + 24 * 60 * 60 * 1000;
  12589. arr.push(this.getDate(new Date(parseInt(k))).fullDate);
  12590. }
  12591. return arr;
  12592. }
  12593. /**
  12594. * 获取多选状态
  12595. */ }, { key: "setMultiple", value: function setMultiple(
  12596. fullDate) {var _this$multipleStatus =
  12597. this.multipleStatus,before = _this$multipleStatus.before,after = _this$multipleStatus.after;
  12598. if (!this.range) return;
  12599. if (before && after) {
  12600. if (!this.lastHover) {
  12601. this.lastHover = true;
  12602. return;
  12603. }
  12604. this.multipleStatus.before = fullDate;
  12605. this.multipleStatus.after = '';
  12606. this.multipleStatus.data = [];
  12607. this.multipleStatus.fulldate = '';
  12608. this.lastHover = false;
  12609. } else {
  12610. if (!before) {
  12611. this.multipleStatus.before = fullDate;
  12612. this.lastHover = false;
  12613. } else {
  12614. this.multipleStatus.after = fullDate;
  12615. if (this.dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
  12616. this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.
  12617. after);
  12618. } else {
  12619. this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.
  12620. before);
  12621. }
  12622. this.lastHover = true;
  12623. }
  12624. }
  12625. this._getWeek(fullDate);
  12626. }
  12627. /**
  12628. * 鼠标 hover 更新多选状态
  12629. */ }, { key: "setHoverMultiple", value: function setHoverMultiple(
  12630. fullDate) {var _this$multipleStatus2 =
  12631. this.multipleStatus,before = _this$multipleStatus2.before,after = _this$multipleStatus2.after;
  12632. if (!this.range) return;
  12633. if (this.lastHover) return;
  12634. if (!before) {
  12635. this.multipleStatus.before = fullDate;
  12636. } else {
  12637. this.multipleStatus.after = fullDate;
  12638. if (this.dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
  12639. this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
  12640. } else {
  12641. this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
  12642. }
  12643. }
  12644. this._getWeek(fullDate);
  12645. }
  12646. /**
  12647. * 更新默认值多选状态
  12648. */ }, { key: "setDefaultMultiple", value: function setDefaultMultiple(
  12649. before, after) {
  12650. this.multipleStatus.before = before;
  12651. this.multipleStatus.after = after;
  12652. if (before && after) {
  12653. if (this.dateCompare(before, after)) {
  12654. this.multipleStatus.data = this.geDateAll(before, after);
  12655. this._getWeek(after);
  12656. } else {
  12657. this.multipleStatus.data = this.geDateAll(after, before);
  12658. this._getWeek(before);
  12659. }
  12660. }
  12661. }
  12662. /**
  12663. * 获取每周数据
  12664. * @param {Object} dateData
  12665. */ }, { key: "_getWeek", value: function _getWeek(
  12666. dateData) {var _this$getDate =
  12667. this.getDate(dateData),fullDate = _this$getDate.fullDate,year = _this$getDate.year,month = _this$getDate.month,date = _this$getDate.date,day = _this$getDate.day;
  12668. var firstDay = new Date(year, month - 1, 1).getDay();
  12669. var currentDay = new Date(year, month, 0).getDate();
  12670. var dates = {
  12671. lastMonthDays: this._getLastMonthDays(firstDay, this.getDate(dateData)), // 上个月末尾几天
  12672. currentMonthDys: this._currentMonthDys(currentDay, this.getDate(dateData)), // 本月天数
  12673. nextMonthDays: [], // 下个月开始几天
  12674. weeks: [] };
  12675. var canlender = [];
  12676. var surplus = 42 - (dates.lastMonthDays.length + dates.currentMonthDys.length);
  12677. dates.nextMonthDays = this._getNextMonthDays(surplus, this.getDate(dateData));
  12678. canlender = canlender.concat(dates.lastMonthDays, dates.currentMonthDys, dates.nextMonthDays);
  12679. var weeks = {};
  12680. // 拼接数组 上个月开始几天 + 本月天数+ 下个月开始几天
  12681. for (var i = 0; i < canlender.length; i++) {
  12682. if (i % 7 === 0) {
  12683. weeks[parseInt(i / 7)] = new Array(7);
  12684. }
  12685. weeks[parseInt(i / 7)][i % 7] = canlender[i];
  12686. }
  12687. this.canlender = canlender;
  12688. this.weeks = weeks;
  12689. }
  12690. //静态方法
  12691. // static init(date) {
  12692. // if (!this.instance) {
  12693. // this.instance = new Calendar(date);
  12694. // }
  12695. // return this.instance;
  12696. // }
  12697. }]);return Calendar;}();var _default =
  12698. Calendar;exports.default = _default;
  12699. /***/ }),
  12700. /***/ 32:
  12701. /*!****************************************!*\
  12702. !*** F:/工作项目/pingpu_H5/api/weather.js ***!
  12703. \****************************************/
  12704. /*! no static exports found */
  12705. /***/ (function(module, exports, __webpack_require__) {
  12706. "use strict";
  12707. Object.defineProperty(exports, "__esModule", { value: true });exports.getWeatherWarning = exports.getWeatherDayData = exports.getWeatherChart = exports.getWeatherHistory = exports.getWeatherDeviceDetail = exports.getWeatherDeviceList = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 13));var _index = _interopRequireDefault(__webpack_require__(/*! @/utils/request/index.js */ 33));
  12708. var _utils = __webpack_require__(/*! @/utils/utils.js */ 16);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  12709. /**
  12710. * 气象墒情模块
  12711. */
  12712. // 气象墒情数据请求父类函数
  12713. var weatherRequest = /*#__PURE__*/function () {var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(url, data) {var res;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.next = 2;return (
  12714. _index.default.post("api/api_gateway?method=weather.weather.".concat(url), data));case 2:res = _context.sent;return _context.abrupt("return",
  12715. res === null || res === void 0 ? void 0 : res.data);case 4:case "end":return _context.stop();}}}, _callee);}));return function weatherRequest(_x, _x2) {return _ref.apply(this, arguments);};}();
  12716. // 气象站、墒情站设备列表
  12717. var getWeatherDeviceList = function getWeatherDeviceList(data) {return weatherRequest('qxz_page', data);};
  12718. // 气象站、墒情站设备详情
  12719. exports.getWeatherDeviceList = getWeatherDeviceList;var getWeatherDeviceDetail = /*#__PURE__*/function () {var _ref2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2(params) {var _yield$weatherRequest, dat, conf, result, key, datArray, confArray;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:_context2.next = 2;return (
  12720. weatherRequest('qxz_status', params));case 2:_yield$weatherRequest = _context2.sent;dat = _yield$weatherRequest.dat;conf = _yield$weatherRequest.conf;
  12721. result = [];
  12722. for (key in dat) {
  12723. if (dat[key] && key != 'uptime') {
  12724. console.log(dat[key]);
  12725. datArray = dat[key].split('#');
  12726. confArray = conf[key].split('#');
  12727. result.push({
  12728. el: key, // 通道
  12729. markId: confArray[1], // 标识
  12730. text: "".concat(confArray[0], " ").concat(confArray[1]), // 标题
  12731. value: "".concat(datArray[0]) });
  12732. }
  12733. }return _context2.abrupt("return",
  12734. result);case 8:case "end":return _context2.stop();}}}, _callee2);}));return function getWeatherDeviceDetail(_x3) {return _ref2.apply(this, arguments);};}();
  12735. /**
  12736. * 气象站、墒情站历史数据
  12737. * @param {*} params
  12738. */exports.getWeatherDeviceDetail = getWeatherDeviceDetail;
  12739. var getWeatherHistory = /*#__PURE__*/function () {var _ref3 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3(params) {var _yield$weatherRequest2, data, nums, conf, rainFall, headers, key, confArray, list, i, listItem, _key, datArray;return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:_context3.next = 2;return (
  12740. weatherRequest('qxz_detail', params));case 2:_yield$weatherRequest2 = _context3.sent;data = _yield$weatherRequest2.data;nums = _yield$weatherRequest2.nums;conf = _yield$weatherRequest2.conf;rainFall = _yield$weatherRequest2.rainFall;
  12741. headers = [{
  12742. text: '日期',
  12743. value: 'date' }];
  12744. // 组装数据头部列表
  12745. for (key in conf) {
  12746. if (conf[key]) {
  12747. confArray = conf[key].split('#');
  12748. headers.push({
  12749. text: confArray[0] + confArray[1],
  12750. value: key });
  12751. }
  12752. }
  12753. list = []; //历史列表数据 数据项格式 {date:日期,e1:'',e2:'',e3:'',e4:'',}
  12754. for (i = 0; i < data.length; i++) {
  12755. listItem = {
  12756. date: (0, _utils.timeFormat)(data[i].time, 'yyyy-mm-dd hh:MM:ss') };
  12757. for (_key in data[i].dat) {
  12758. if (data[i].dat[_key]) {
  12759. datArray = data[i].dat[_key].split('#');
  12760. listItem[_key] = datArray[0];
  12761. }
  12762. }
  12763. list.push(listItem);
  12764. }return _context3.abrupt("return",
  12765. {
  12766. headers: headers, //历史数据表头数据
  12767. list: list, // 历史列表数据
  12768. nums: nums, // 数据总数
  12769. rainFall: rainFall //气象设备是否具有日雨量累计因子,有返回1,无返回0
  12770. });case 12:case "end":return _context3.stop();}}}, _callee3);}));return function getWeatherHistory(_x4) {return _ref3.apply(this, arguments);};}();
  12771. // 气象站、墒情站折线图
  12772. exports.getWeatherHistory = getWeatherHistory;var getWeatherChart = /*#__PURE__*/function () {var _ref4 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee4(params) {var _yield$weatherRequest3, data, conf, times, pickes, charts, i, key, dat, num;return _regenerator.default.wrap(function _callee4$(_context4) {while (1) {switch (_context4.prev = _context4.next) {case 0:_context4.next = 2;return (
  12773. weatherRequest('qxz_data_chart', params));case 2:_yield$weatherRequest3 = _context4.sent;data = _yield$weatherRequest3.data;conf = _yield$weatherRequest3.conf;if (
  12774. data) {_context4.next = 7;break;}return _context4.abrupt("return");case 7:
  12775. times = []; // 时间数组
  12776. // 下拉框数据
  12777. pickes = [];
  12778. charts = {};
  12779. Object.keys(conf).forEach(function (key) {
  12780. if (conf[key]) {
  12781. pickes.push({
  12782. text: conf[key].split('#').join(' '),
  12783. value: key });
  12784. charts[key] = []; //统计图
  12785. }
  12786. });
  12787. // 处理统计图数据 格式:通道号:列表 {e1:list,e2:list,e3:list}
  12788. // if(data.length = 10;)
  12789. for (i = 0; i < data.length; i++) {
  12790. for (key in charts) {
  12791. dat = data[i].dat[key];
  12792. if (dat) {
  12793. num = dat.split('#')[0];
  12794. charts[key].push(parseFloat(num));
  12795. }
  12796. }
  12797. times.push((0, _utils.timeFormat)(data[i].time, 'mm月dd日'));
  12798. }return _context4.abrupt("return",
  12799. {
  12800. times: times, // 日期列表
  12801. pickes: pickes, // 下拉框列表
  12802. charts: charts // 统计数据
  12803. });case 13:case "end":return _context4.stop();}}}, _callee4);}));return function getWeatherChart(_x5) {return _ref4.apply(this, arguments);};}();
  12804. /**
  12805. * 气象站、墒情站24小时数据
  12806. * @param {*} data
  12807. */exports.getWeatherChart = getWeatherChart;
  12808. var getWeatherDayData = /*#__PURE__*/function () {var _ref5 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee5(data) {var res;return _regenerator.default.wrap(function _callee5$(_context5) {while (1) {switch (_context5.prev = _context5.next) {case 0:_context5.next = 2;return (
  12809. weatherRequest('qxz_day_data', data));case 2:res = _context5.sent;return _context5.abrupt("return",
  12810. res);case 4:case "end":return _context5.stop();}}}, _callee5);}));return function getWeatherDayData(_x6) {return _ref5.apply(this, arguments);};}();
  12811. // 气象站、墒情站预警
  12812. exports.getWeatherDayData = getWeatherDayData;var getWeatherWarning = function getWeatherWarning(data) {return weatherRequest('qxz_warning', data);};exports.getWeatherWarning = getWeatherWarning;
  12813. /***/ }),
  12814. /***/ 33:
  12815. /*!************************************************!*\
  12816. !*** F:/工作项目/pingpu_H5/utils/request/index.js ***!
  12817. \************************************************/
  12818. /*! no static exports found */
  12819. /***/ (function(module, exports, __webpack_require__) {
  12820. "use strict";
  12821. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 13));var _request = _interopRequireDefault(__webpack_require__(/*! ./request.js */ 34));
  12822. var _config = _interopRequireDefault(__webpack_require__(/*! @/config/config.js */ 35));
  12823. var _cache = _interopRequireDefault(__webpack_require__(/*! @/utils/cache */ 36));
  12824. var _cache2 = __webpack_require__(/*! @/config/cache */ 37);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  12825. // 创建request实例
  12826. var service = (0, _request.default)({
  12827. baseURL: _config.default.baseUrl,
  12828. timeout: 5000, // 请求超时,
  12829. header: {
  12830. 'Content-Type': 'application/x-www-form-urlencoded',
  12831. 'Accept': 'application/json' } });
  12832. // 请求拦截器
  12833. service.interceptors.request.use( /*#__PURE__*/function () {var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(config) {return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:
  12834. // // 判断token是否存在
  12835. // let token = cache.get(LOGIN_TOKEN) || '';
  12836. // // token为空已过期 刷新token
  12837. // if (token) {
  12838. // config.body.token = token;
  12839. // }
  12840. config.body.token = '1LghTlDdt7dBVyRIyadh2lmA3y9JmD9Cbtc3e57GUic=';return _context.abrupt("return",
  12841. config);case 2:case "end":return _context.stop();}}}, _callee);}));return function (_x) {return _ref.apply(this, arguments);};}());
  12842. // response interceptor
  12843. service.interceptors.response.use(function (response) {// 响应拦截器(可以设置多个, 同时可以也可以使用异步方法)
  12844. if (response.data.message) {
  12845. uni.showToast({
  12846. title: response.data.message,
  12847. duration: 1500,
  12848. mask: true,
  12849. icon: 'none' });
  12850. }
  12851. return response;
  12852. });var _default =
  12853. service;
  12854. // export const myRequest = (options) => {
  12855. // let BASE_URL = 请求地址
  12856. // console.log(BASE_URL)
  12857. // var session_key = ""
  12858. // session_key = uni.getStorageSync('session_key')
  12859. // let url = ""
  12860. // let data = options.data || {}
  12861. // if (options.url.split('=')[1]) {
  12862. // url = options.url.split('=')[1]
  12863. // } else {
  12864. // url = options.url.split('api/')[1]
  12865. // }
  12866. // console.log(url)
  12867. // if (url != 'user.login.login_user') {
  12868. // data.token = session_key
  12869. // }
  12870. // return new Promise((resolve, reject) => {
  12871. // uni.request({
  12872. // url: BASE_URL + options.url,
  12873. // method: options.method || 'POST',
  12874. // header: {
  12875. // "Content-Type": "application/x-www-form-urlencoded",
  12876. // },
  12877. // data: data,
  12878. // success: (res) => {
  12879. // if (res.data.message != "") {
  12880. // if (res.data.message == "识别无结果") {
  12881. // resolve(res.data.data)
  12882. // } else {
  12883. // return uni.showToast({
  12884. // title: res.data.message,
  12885. // icon: "none"
  12886. // })
  12887. // }
  12888. // }
  12889. // resolve(res.data.data)
  12890. // },
  12891. // fail: (err) => {
  12892. // uni.showToast({
  12893. // title: '请求接口失败'
  12894. // })
  12895. // reject(err)
  12896. // }
  12897. // })
  12898. // })
  12899. // }
  12900. exports.default = _default;
  12901. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  12902. /***/ }),
  12903. /***/ 34:
  12904. /*!**************************************************!*\
  12905. !*** F:/工作项目/pingpu_H5/utils/request/request.js ***!
  12906. \**************************************************/
  12907. /*! no static exports found */
  12908. /***/ (function(module, exports, __webpack_require__) {
  12909. "use strict";
  12910. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = _default;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 13));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _default(_ref)
  12911. {var baseURL = _ref.baseURL,_ref$timeout = _ref.timeout,timeout = _ref$timeout === void 0 ? 56 * 1000 : _ref$timeout,headers = _ref.header;
  12912. return {
  12913. get: function get(url, data, header) {for (var _len = arguments.length, args = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {args[_key - 3] = arguments[_key];}
  12914. return this.request.apply(this, ['GET', url, data, _objectSpread(_objectSpread({},
  12915. headers),
  12916. header)].concat(
  12917. args));
  12918. },
  12919. post: function post(url, data, header) {for (var _len2 = arguments.length, args = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {args[_key2 - 3] = arguments[_key2];}
  12920. return this.request.apply(this, ['POST', url, data, _objectSpread(_objectSpread({},
  12921. headers),
  12922. header)].concat(
  12923. args));
  12924. },
  12925. put: function put(url, data, header) {for (var _len3 = arguments.length, args = new Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) {args[_key3 - 3] = arguments[_key3];}
  12926. return this.request.apply(this, ['PUT', url, data, _objectSpread(_objectSpread({},
  12927. headers),
  12928. header)].concat(
  12929. args));
  12930. },
  12931. delete: function _delete(url, data, header) {for (var _len4 = arguments.length, args = new Array(_len4 > 3 ? _len4 - 3 : 0), _key4 = 3; _key4 < _len4; _key4++) {args[_key4 - 3] = arguments[_key4];}
  12932. return this.request.apply(this, ['DELETE', url, data, _objectSpread(_objectSpread({},
  12933. headers),
  12934. header)].concat(
  12935. args));
  12936. },
  12937. connect: function connect(url, data, header) {for (var _len5 = arguments.length, args = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {args[_key5 - 3] = arguments[_key5];}
  12938. return this.request.apply(this, ['CONNECT', url, data, _objectSpread(_objectSpread({},
  12939. headers),
  12940. header)].concat(
  12941. args));
  12942. },
  12943. head: function head(url, data, header) {for (var _len6 = arguments.length, args = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {args[_key6 - 3] = arguments[_key6];}
  12944. return this.request.apply(this, ['HEAD', url, data, _objectSpread(_objectSpread({},
  12945. headers),
  12946. header)].concat(
  12947. args));
  12948. },
  12949. options: function options(url, data, header) {for (var _len7 = arguments.length, args = new Array(_len7 > 3 ? _len7 - 3 : 0), _key7 = 3; _key7 < _len7; _key7++) {args[_key7 - 3] = arguments[_key7];}
  12950. return this.request.apply(this, ['OPTIONS', url, data, _objectSpread(_objectSpread({},
  12951. headers),
  12952. header)].concat(
  12953. args));
  12954. },
  12955. reace: function reace(url, data, header) {for (var _len8 = arguments.length, args = new Array(_len8 > 3 ? _len8 - 3 : 0), _key8 = 3; _key8 < _len8; _key8++) {args[_key8 - 3] = arguments[_key8];}
  12956. return this.request.apply(this, ['TRACE', url, data, _objectSpread(_objectSpread({},
  12957. headers),
  12958. header)].concat(
  12959. args));
  12960. },
  12961. uploadFile: function uploadFile(url, data, header) {for (var _len9 = arguments.length, args = new Array(_len9 > 3 ? _len9 - 3 : 0), _key9 = 3; _key9 < _len9; _key9++) {args[_key9 - 3] = arguments[_key9];}
  12962. return this.file.apply(this, ['uploadFile', url, data || {}, _objectSpread(_objectSpread({},
  12963. header),
  12964. headers)].concat(
  12965. args));
  12966. },
  12967. downloadFile: function downloadFile(url, data, header) {for (var _len10 = arguments.length, args = new Array(_len10 > 3 ? _len10 - 3 : 0), _key10 = 3; _key10 < _len10; _key10++) {args[_key10 - 3] = arguments[_key10];}
  12968. return this.file.apply(this, ['downloadFile', url, data || {}, _objectSpread(_objectSpread({},
  12969. header),
  12970. headers)].concat(
  12971. args));
  12972. },
  12973. onerror: function onerror() {}, // 请求错误钩子函数集合
  12974. file: function file(method, url, data, header, reqIntercept, resIntercept) {var _this = this;
  12975. var timer, // timer 检测超时定时器
  12976. requestTask, // requestTask 网络请求 task 对象
  12977. aborted = false, // aborted 请求是否已被取消
  12978. overtime = false, // overtime 请求是否超时
  12979. abort = function abort() {// abort 取消请求方法
  12980. aborted = true; // 将请求状态标记为已取消
  12981. requestTask ? requestTask.abort() : ''; // 执行取消请求方法
  12982. },
  12983. progressUpdateHandle,
  12984. onProgressUpdate = function onProgressUpdate(e) {return progressUpdateHandle =
  12985. e;}; // progressUpdateHandle 监听上传进度变化回调,onProgressUpdate 监听上传进度变化方法
  12986. return new Proxy(new Promise(function (resolve,
  12987. reject) {// 返回经过 Proxy 后的 Promise 对象使其可以监听到是否调用 abort 和 onProgressUpdate 方法
  12988. _this.interceptors.request.intercept({
  12989. header: header || {},
  12990. body: data.formData || {} },
  12991. method, url, data, reqIntercept).then( /*#__PURE__*/function () {var _ref3 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee4(_ref2) {var header, body, cancel;return _regenerator.default.wrap(function _callee4$(_context4) {while (1) {switch (_context4.prev = _context4.next) {case 0:
  12992. header = _ref2.header,
  12993. body = _ref2.body,
  12994. cancel = _ref2.cancel;if (!(
  12995. aborted || cancel)) {_context4.next = 5;break;}_context4.next = 4;return (
  12996. _this.onerror(method, url, data, '网络请求失败:主动取消'));case 4:return _context4.abrupt("return",
  12997. reject('网络请求失败:主动取消'));case 5:
  12998. requestTask = uni[method]({
  12999. url: url[0] === '/' ? baseURL + url : url,
  13000. name: data.name,
  13001. header: header,
  13002. filePath: data.filePath,
  13003. formData: body,
  13004. success: function () {var _success = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(res) {return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:
  13005. clearTimeout(timer);
  13006. _this.interceptors.response.intercept(resolve, _objectSpread({
  13007. success: true },
  13008. res),
  13009. method, url, data, reject,
  13010. resIntercept); // 执行响应拦截器
  13011. case 2:case "end":return _context.stop();}}}, _callee);}));function success(_x2) {return _success.apply(this, arguments);}return success;}(),
  13012. fail: function () {var _fail = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2(res) {return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:
  13013. clearTimeout(timer);_context2.t0 =
  13014. !overtime;if (!_context2.t0) {_context2.next = 5;break;}_context2.next = 5;return _this.onerror(
  13015. method, url, data, aborted ? '网络请求失败:主动取消' :
  13016. '网络请求失败:(URL无效|无网络|DNS解析失败)');case 5:
  13017. aborted ? reject('网络请求失败:主动取消') : reject(
  13018. '网络请求失败:(URL无效|无网络|DNS解析失败)');case 6:case "end":return _context2.stop();}}}, _callee2);}));function fail(_x3) {return _fail.apply(this, arguments);}return fail;}() });
  13019. requestTask.onProgressUpdate(progressUpdateHandle); // 监听下载进度变化
  13020. timer = setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3() {return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0: // 请求超时执行方法
  13021. overtime = true; // 将状态标记为超时,不会被 fail 中的 onerror 重复执行
  13022. requestTask.abort(); // 执行取消请求方法
  13023. _context3.next = 4;return _this.onerror(method, url, data, '网络请求失败:超时取消');case 4:
  13024. reject('网络请求时间超时'); // reject 原因
  13025. case 5:case "end":return _context3.stop();}}}, _callee3);})), timeout); // 设定检测超时定时器
  13026. case 8:case "end":return _context4.stop();}}}, _callee4);}));return function (_x) {return _ref3.apply(this, arguments);};}());
  13027. }), {
  13028. get: function get(target, prop) {
  13029. if (prop === 'abort') {
  13030. return abort;
  13031. } else {
  13032. if (Reflect.get(target, prop) && Reflect.get(target, prop).bind) {
  13033. return Reflect.get(target, prop).bind(target);
  13034. } else {
  13035. return Reflect.get(target, prop);
  13036. }
  13037. }
  13038. } });
  13039. // 如果调用 cancel 方法,返回 _watcher.cancel 方法
  13040. },
  13041. request: function request(method, url, data, header) {var _this2 = this;var reqIntercept = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;var resIntercept = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
  13042. var timer, // timer 检测超时定时器
  13043. requestTask, // requestTask 网络请求 task 对象
  13044. aborted = false, // aborted 请求是否已被取消
  13045. overtime = false, // overtime 请求是否超时
  13046. abort = function abort() {// timer 检测超时定时器,requestTask 网络请求 task 对象,aborted 请求是否已被取消,abort 取消请求方法
  13047. aborted = true; // 将请求状态标记为已取消
  13048. requestTask ? requestTask.abort() : ''; // 执行取消请求方法
  13049. };
  13050. return new Proxy(new Promise(function (resolve, reject) {// 返回经过 Proxy 后的 Promise 对象使其可以监听到是否调用 abort 方法
  13051. _this2.interceptors.request.intercept({
  13052. header: header || {},
  13053. body: data || {} },
  13054. method, url, data, reqIntercept).then( /*#__PURE__*/function () {var _ref6 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee8(_ref5) {var header, data, cancel;return _regenerator.default.wrap(function _callee8$(_context8) {while (1) {switch (_context8.prev = _context8.next) {case 0:
  13055. header = _ref5.header,
  13056. data = _ref5.body,
  13057. cancel = _ref5.cancel;if (!(
  13058. aborted || cancel)) {_context8.next = 5;break;}_context8.next = 4;return (
  13059. _this2.onerror(method, url, data, '网络请求失败:主动取消'));case 4:return _context8.abrupt("return",
  13060. reject('网络请求失败:主动取消'));case 5:
  13061. requestTask = uni.request({
  13062. url: baseURL + url,
  13063. data: data,
  13064. method: method,
  13065. header: header,
  13066. success: function () {var _success2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee5(res) {return _regenerator.default.wrap(function _callee5$(_context5) {while (1) {switch (_context5.prev = _context5.next) {case 0: // 网络请求成功
  13067. // console.log(res,'code....')
  13068. // if(res.statusCode == "401"){
  13069. // this.onerror(method,url,data)
  13070. // }
  13071. clearTimeout(timer); // 清除检测超时定时器
  13072. _this2.interceptors.response.intercept(resolve, _objectSpread({
  13073. success: true },
  13074. res),
  13075. method, url, data, reject,
  13076. resIntercept); // 执行响应拦截器
  13077. case 2:case "end":return _context5.stop();}}}, _callee5);}));function success(_x5) {return _success2.apply(this, arguments);}return success;}(),
  13078. fail: function () {var _fail2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee6(res) {return _regenerator.default.wrap(function _callee6$(_context6) {while (1) {switch (_context6.prev = _context6.next) {case 0: // 网络请求失败
  13079. clearTimeout(timer); // 清除检测超时定时器
  13080. _context6.t0 = !overtime;if (!_context6.t0) {_context6.next = 5;break;}_context6.next = 5;return _this2.onerror(method, url, data,
  13081. aborted ? '网络请求失败:主动取消' :
  13082. '网络请求失败:(URL无效|无网络|DNS解析失败)');case 5:
  13083. aborted ? reject('网络请求失败:主动取消') : reject(
  13084. '网络请求失败:(URL无效|无网络|DNS解析失败)');case 6:case "end":return _context6.stop();}}}, _callee6);}));function fail(_x6) {return _fail2.apply(this, arguments);}return fail;}() });
  13085. timer = setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee7() {return _regenerator.default.wrap(function _callee7$(_context7) {while (1) {switch (_context7.prev = _context7.next) {case 0: // 请求超时执行方法
  13086. overtime = true; // 将状态标记为超时,不会被 fail 中的 onerror 重复执行
  13087. requestTask.abort(); // 执行取消请求方法
  13088. _context7.next = 4;return _this2.onerror(method, url, data, '网络请求失败:超时取消');case 4:
  13089. reject('网络请求时间超时'); // reject 原因
  13090. case 5:case "end":return _context7.stop();}}}, _callee7);})), timeout || 12345); // 设定检测超时定时器
  13091. case 7:case "end":return _context8.stop();}}}, _callee8);}));return function (_x4) {return _ref6.apply(this, arguments);};}());
  13092. }), {
  13093. get: function get(target, prop) {
  13094. if (prop === 'abort') {
  13095. return abort;
  13096. } else {
  13097. if (Reflect.get(target, prop) && Reflect.get(target, prop).bind) {
  13098. return Reflect.get(target, prop).bind(target);
  13099. } else {
  13100. return Reflect.get(target, prop);
  13101. }
  13102. }
  13103. } });
  13104. // 如果调用 abort 方法,返回 abort 方法
  13105. },
  13106. interceptors: { // 拦截器
  13107. request: {
  13108. interceptors: [],
  13109. use: function use(fun) {
  13110. this.interceptors.push(fun);
  13111. },
  13112. intercept: function intercept(config, method, url, data, reqIntercept) {var _this3 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee9() {var i;return _regenerator.default.wrap(function _callee9$(_context9) {while (1) {switch (_context9.prev = _context9.next) {case 0:if (!
  13113. reqIntercept) {_context9.next = 9;break;}
  13114. i = 0;case 2:if (!(i < _this3.interceptors.length)) {_context9.next = 9;break;}_context9.next = 5;return (
  13115. _this3.interceptors[i](config, method, url, data));case 5:config = _context9.sent;case 6:i++;_context9.next = 2;break;case 9:return _context9.abrupt("return",
  13116. config);case 10:case "end":return _context9.stop();}}}, _callee9);}))();
  13117. } },
  13118. response: {
  13119. interceptors: [],
  13120. use: function use(fun) {
  13121. this.interceptors.push(fun);
  13122. },
  13123. intercept: function intercept(STATUS, response, method, url, data, reject, resIntercept) {var _this4 = this;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee10() {var i;return _regenerator.default.wrap(function _callee10$(_context10) {while (1) {switch (_context10.prev = _context10.next) {case 0:_context10.prev = 0;if (!
  13124. resIntercept) {_context10.next = 10;break;}
  13125. i = 0;case 3:if (!(i < _this4.interceptors.length)) {_context10.next = 10;break;}_context10.next = 6;return (
  13126. _this4.interceptors[i](response, method, url, data));case 6:response = _context10.sent;case 7:i++;_context10.next = 3;break;case 10:if (!
  13127. response.success) {_context10.next = 14;break;}return _context10.abrupt("return",
  13128. STATUS(typeof response.data === 'string' ? JSON.parse(response.data) : response.
  13129. data));case 14:
  13130. delete response.success;return _context10.abrupt("return",
  13131. STATUS(response, method, url, data));case 16:_context10.next = 21;break;case 18:_context10.prev = 18;_context10.t0 = _context10["catch"](0);
  13132. reject(_context10.t0);case 21:case "end":return _context10.stop();}}}, _callee10, null, [[0, 18]]);}))();
  13133. } } } };
  13134. }
  13135. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  13136. /***/ }),
  13137. /***/ 35:
  13138. /*!******************************************!*\
  13139. !*** F:/工作项目/pingpu_H5/config/config.js ***!
  13140. \******************************************/
  13141. /*! no static exports found */
  13142. /***/ (function(module, exports, __webpack_require__) {
  13143. "use strict";
  13144. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _cache = _interopRequireDefault(__webpack_require__(/*! @/utils/cache */ 36));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
  13145. var params = {
  13146. // 请求根目录地址
  13147. baseUrl: 'http://106.119.196.18:10005/' };
  13148. // 配置信息
  13149. var _default = _objectSpread({},
  13150. params);exports.default = _default;
  13151. /***/ }),
  13152. /***/ 36:
  13153. /*!****************************************!*\
  13154. !*** F:/工作项目/pingpu_H5/utils/cache.js ***!
  13155. \****************************************/
  13156. /*! no static exports found */
  13157. /***/ (function(module, exports, __webpack_require__) {
  13158. "use strict";
  13159. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var Cache = {
  13160. // 设置缓存(expire为缓存时效,单位秒)
  13161. set: function set(key, value) {var expire = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 7200;
  13162. console.log(expire);
  13163. var data = {
  13164. expire: expire ? this.time() + expire : this.time() + 7200,
  13165. value: value };
  13166. if (typeof data === 'object')
  13167. data = JSON.stringify(data);
  13168. try {
  13169. uni.setStorageSync(key, data);
  13170. } catch (e) {
  13171. return;
  13172. }
  13173. },
  13174. get: function get(key) {
  13175. try {
  13176. var data = uni.getStorageSync(key);var _JSON$parse =
  13177. JSON.parse(data),value = _JSON$parse.value,expire = _JSON$parse.expire;
  13178. if (expire && expire < this.time()) {
  13179. uni.removeStorageSync(key);
  13180. return;
  13181. } else {
  13182. return value;
  13183. }
  13184. } catch (e) {
  13185. return;
  13186. }
  13187. },
  13188. //获取当前时间
  13189. time: function time() {
  13190. return Math.round(new Date() / 1000);
  13191. },
  13192. remove: function remove(key) {
  13193. if (key) {
  13194. uni.removeStorageSync(key);
  13195. }
  13196. } };var _default =
  13197. Cache;exports.default = _default;
  13198. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  13199. /***/ }),
  13200. /***/ 37:
  13201. /*!*****************************************!*\
  13202. !*** F:/工作项目/pingpu_H5/config/cache.js ***!
  13203. \*****************************************/
  13204. /*! no static exports found */
  13205. /***/ (function(module, exports) {
  13206. // 缓存名称
  13207. module.exports = {
  13208. //token
  13209. LOGIN_TOKEN: 'LOGIN_STATUS_TOKEN' };
  13210. /***/ }),
  13211. /***/ 4:
  13212. /*!******************************************************************************************!*\
  13213. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  13214. \******************************************************************************************/
  13215. /*! exports provided: default */
  13216. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13217. "use strict";
  13218. __webpack_require__.r(__webpack_exports__);
  13219. /* WEBPACK VAR INJECTION */(function(global) {/*!
  13220. * Vue.js v2.6.11
  13221. * (c) 2014-2022 Evan You
  13222. * Released under the MIT License.
  13223. */
  13224. /* */
  13225. var emptyObject = Object.freeze({});
  13226. // These helpers produce better VM code in JS engines due to their
  13227. // explicitness and function inlining.
  13228. function isUndef (v) {
  13229. return v === undefined || v === null
  13230. }
  13231. function isDef (v) {
  13232. return v !== undefined && v !== null
  13233. }
  13234. function isTrue (v) {
  13235. return v === true
  13236. }
  13237. function isFalse (v) {
  13238. return v === false
  13239. }
  13240. /**
  13241. * Check if value is primitive.
  13242. */
  13243. function isPrimitive (value) {
  13244. return (
  13245. typeof value === 'string' ||
  13246. typeof value === 'number' ||
  13247. // $flow-disable-line
  13248. typeof value === 'symbol' ||
  13249. typeof value === 'boolean'
  13250. )
  13251. }
  13252. /**
  13253. * Quick object check - this is primarily used to tell
  13254. * Objects from primitive values when we know the value
  13255. * is a JSON-compliant type.
  13256. */
  13257. function isObject (obj) {
  13258. return obj !== null && typeof obj === 'object'
  13259. }
  13260. /**
  13261. * Get the raw type string of a value, e.g., [object Object].
  13262. */
  13263. var _toString = Object.prototype.toString;
  13264. function toRawType (value) {
  13265. return _toString.call(value).slice(8, -1)
  13266. }
  13267. /**
  13268. * Strict object type check. Only returns true
  13269. * for plain JavaScript objects.
  13270. */
  13271. function isPlainObject (obj) {
  13272. return _toString.call(obj) === '[object Object]'
  13273. }
  13274. function isRegExp (v) {
  13275. return _toString.call(v) === '[object RegExp]'
  13276. }
  13277. /**
  13278. * Check if val is a valid array index.
  13279. */
  13280. function isValidArrayIndex (val) {
  13281. var n = parseFloat(String(val));
  13282. return n >= 0 && Math.floor(n) === n && isFinite(val)
  13283. }
  13284. function isPromise (val) {
  13285. return (
  13286. isDef(val) &&
  13287. typeof val.then === 'function' &&
  13288. typeof val.catch === 'function'
  13289. )
  13290. }
  13291. /**
  13292. * Convert a value to a string that is actually rendered.
  13293. */
  13294. function toString (val) {
  13295. return val == null
  13296. ? ''
  13297. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  13298. ? JSON.stringify(val, null, 2)
  13299. : String(val)
  13300. }
  13301. /**
  13302. * Convert an input value to a number for persistence.
  13303. * If the conversion fails, return original string.
  13304. */
  13305. function toNumber (val) {
  13306. var n = parseFloat(val);
  13307. return isNaN(n) ? val : n
  13308. }
  13309. /**
  13310. * Make a map and return a function for checking if a key
  13311. * is in that map.
  13312. */
  13313. function makeMap (
  13314. str,
  13315. expectsLowerCase
  13316. ) {
  13317. var map = Object.create(null);
  13318. var list = str.split(',');
  13319. for (var i = 0; i < list.length; i++) {
  13320. map[list[i]] = true;
  13321. }
  13322. return expectsLowerCase
  13323. ? function (val) { return map[val.toLowerCase()]; }
  13324. : function (val) { return map[val]; }
  13325. }
  13326. /**
  13327. * Check if a tag is a built-in tag.
  13328. */
  13329. var isBuiltInTag = makeMap('slot,component', true);
  13330. /**
  13331. * Check if an attribute is a reserved attribute.
  13332. */
  13333. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  13334. /**
  13335. * Remove an item from an array.
  13336. */
  13337. function remove (arr, item) {
  13338. if (arr.length) {
  13339. var index = arr.indexOf(item);
  13340. if (index > -1) {
  13341. return arr.splice(index, 1)
  13342. }
  13343. }
  13344. }
  13345. /**
  13346. * Check whether an object has the property.
  13347. */
  13348. var hasOwnProperty = Object.prototype.hasOwnProperty;
  13349. function hasOwn (obj, key) {
  13350. return hasOwnProperty.call(obj, key)
  13351. }
  13352. /**
  13353. * Create a cached version of a pure function.
  13354. */
  13355. function cached (fn) {
  13356. var cache = Object.create(null);
  13357. return (function cachedFn (str) {
  13358. var hit = cache[str];
  13359. return hit || (cache[str] = fn(str))
  13360. })
  13361. }
  13362. /**
  13363. * Camelize a hyphen-delimited string.
  13364. */
  13365. var camelizeRE = /-(\w)/g;
  13366. var camelize = cached(function (str) {
  13367. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  13368. });
  13369. /**
  13370. * Capitalize a string.
  13371. */
  13372. var capitalize = cached(function (str) {
  13373. return str.charAt(0).toUpperCase() + str.slice(1)
  13374. });
  13375. /**
  13376. * Hyphenate a camelCase string.
  13377. */
  13378. var hyphenateRE = /\B([A-Z])/g;
  13379. var hyphenate = cached(function (str) {
  13380. return str.replace(hyphenateRE, '-$1').toLowerCase()
  13381. });
  13382. /**
  13383. * Simple bind polyfill for environments that do not support it,
  13384. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  13385. * since native bind is now performant enough in most browsers.
  13386. * But removing it would mean breaking code that was able to run in
  13387. * PhantomJS 1.x, so this must be kept for backward compatibility.
  13388. */
  13389. /* istanbul ignore next */
  13390. function polyfillBind (fn, ctx) {
  13391. function boundFn (a) {
  13392. var l = arguments.length;
  13393. return l
  13394. ? l > 1
  13395. ? fn.apply(ctx, arguments)
  13396. : fn.call(ctx, a)
  13397. : fn.call(ctx)
  13398. }
  13399. boundFn._length = fn.length;
  13400. return boundFn
  13401. }
  13402. function nativeBind (fn, ctx) {
  13403. return fn.bind(ctx)
  13404. }
  13405. var bind = Function.prototype.bind
  13406. ? nativeBind
  13407. : polyfillBind;
  13408. /**
  13409. * Convert an Array-like object to a real Array.
  13410. */
  13411. function toArray (list, start) {
  13412. start = start || 0;
  13413. var i = list.length - start;
  13414. var ret = new Array(i);
  13415. while (i--) {
  13416. ret[i] = list[i + start];
  13417. }
  13418. return ret
  13419. }
  13420. /**
  13421. * Mix properties into target object.
  13422. */
  13423. function extend (to, _from) {
  13424. for (var key in _from) {
  13425. to[key] = _from[key];
  13426. }
  13427. return to
  13428. }
  13429. /**
  13430. * Merge an Array of Objects into a single Object.
  13431. */
  13432. function toObject (arr) {
  13433. var res = {};
  13434. for (var i = 0; i < arr.length; i++) {
  13435. if (arr[i]) {
  13436. extend(res, arr[i]);
  13437. }
  13438. }
  13439. return res
  13440. }
  13441. /* eslint-disable no-unused-vars */
  13442. /**
  13443. * Perform no operation.
  13444. * Stubbing args to make Flow happy without leaving useless transpiled code
  13445. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  13446. */
  13447. function noop (a, b, c) {}
  13448. /**
  13449. * Always return false.
  13450. */
  13451. var no = function (a, b, c) { return false; };
  13452. /* eslint-enable no-unused-vars */
  13453. /**
  13454. * Return the same value.
  13455. */
  13456. var identity = function (_) { return _; };
  13457. /**
  13458. * Check if two values are loosely equal - that is,
  13459. * if they are plain objects, do they have the same shape?
  13460. */
  13461. function looseEqual (a, b) {
  13462. if (a === b) { return true }
  13463. var isObjectA = isObject(a);
  13464. var isObjectB = isObject(b);
  13465. if (isObjectA && isObjectB) {
  13466. try {
  13467. var isArrayA = Array.isArray(a);
  13468. var isArrayB = Array.isArray(b);
  13469. if (isArrayA && isArrayB) {
  13470. return a.length === b.length && a.every(function (e, i) {
  13471. return looseEqual(e, b[i])
  13472. })
  13473. } else if (a instanceof Date && b instanceof Date) {
  13474. return a.getTime() === b.getTime()
  13475. } else if (!isArrayA && !isArrayB) {
  13476. var keysA = Object.keys(a);
  13477. var keysB = Object.keys(b);
  13478. return keysA.length === keysB.length && keysA.every(function (key) {
  13479. return looseEqual(a[key], b[key])
  13480. })
  13481. } else {
  13482. /* istanbul ignore next */
  13483. return false
  13484. }
  13485. } catch (e) {
  13486. /* istanbul ignore next */
  13487. return false
  13488. }
  13489. } else if (!isObjectA && !isObjectB) {
  13490. return String(a) === String(b)
  13491. } else {
  13492. return false
  13493. }
  13494. }
  13495. /**
  13496. * Return the first index at which a loosely equal value can be
  13497. * found in the array (if value is a plain object, the array must
  13498. * contain an object of the same shape), or -1 if it is not present.
  13499. */
  13500. function looseIndexOf (arr, val) {
  13501. for (var i = 0; i < arr.length; i++) {
  13502. if (looseEqual(arr[i], val)) { return i }
  13503. }
  13504. return -1
  13505. }
  13506. /**
  13507. * Ensure a function is called only once.
  13508. */
  13509. function once (fn) {
  13510. var called = false;
  13511. return function () {
  13512. if (!called) {
  13513. called = true;
  13514. fn.apply(this, arguments);
  13515. }
  13516. }
  13517. }
  13518. var ASSET_TYPES = [
  13519. 'component',
  13520. 'directive',
  13521. 'filter'
  13522. ];
  13523. var LIFECYCLE_HOOKS = [
  13524. 'beforeCreate',
  13525. 'created',
  13526. 'beforeMount',
  13527. 'mounted',
  13528. 'beforeUpdate',
  13529. 'updated',
  13530. 'beforeDestroy',
  13531. 'destroyed',
  13532. 'activated',
  13533. 'deactivated',
  13534. 'errorCaptured',
  13535. 'serverPrefetch'
  13536. ];
  13537. /* */
  13538. var config = ({
  13539. /**
  13540. * Option merge strategies (used in core/util/options)
  13541. */
  13542. // $flow-disable-line
  13543. optionMergeStrategies: Object.create(null),
  13544. /**
  13545. * Whether to suppress warnings.
  13546. */
  13547. silent: false,
  13548. /**
  13549. * Show production mode tip message on boot?
  13550. */
  13551. productionTip: "development" !== 'production',
  13552. /**
  13553. * Whether to enable devtools
  13554. */
  13555. devtools: "development" !== 'production',
  13556. /**
  13557. * Whether to record perf
  13558. */
  13559. performance: false,
  13560. /**
  13561. * Error handler for watcher errors
  13562. */
  13563. errorHandler: null,
  13564. /**
  13565. * Warn handler for watcher warns
  13566. */
  13567. warnHandler: null,
  13568. /**
  13569. * Ignore certain custom elements
  13570. */
  13571. ignoredElements: [],
  13572. /**
  13573. * Custom user key aliases for v-on
  13574. */
  13575. // $flow-disable-line
  13576. keyCodes: Object.create(null),
  13577. /**
  13578. * Check if a tag is reserved so that it cannot be registered as a
  13579. * component. This is platform-dependent and may be overwritten.
  13580. */
  13581. isReservedTag: no,
  13582. /**
  13583. * Check if an attribute is reserved so that it cannot be used as a component
  13584. * prop. This is platform-dependent and may be overwritten.
  13585. */
  13586. isReservedAttr: no,
  13587. /**
  13588. * Check if a tag is an unknown element.
  13589. * Platform-dependent.
  13590. */
  13591. isUnknownElement: no,
  13592. /**
  13593. * Get the namespace of an element
  13594. */
  13595. getTagNamespace: noop,
  13596. /**
  13597. * Parse the real tag name for the specific platform.
  13598. */
  13599. parsePlatformTagName: identity,
  13600. /**
  13601. * Check if an attribute must be bound using property, e.g. value
  13602. * Platform-dependent.
  13603. */
  13604. mustUseProp: no,
  13605. /**
  13606. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  13607. * This will significantly reduce performance if set to false.
  13608. */
  13609. async: true,
  13610. /**
  13611. * Exposed for legacy reasons
  13612. */
  13613. _lifecycleHooks: LIFECYCLE_HOOKS
  13614. });
  13615. /* */
  13616. /**
  13617. * unicode letters used for parsing html tags, component names and property paths.
  13618. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  13619. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  13620. */
  13621. var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
  13622. /**
  13623. * Check if a string starts with $ or _
  13624. */
  13625. function isReserved (str) {
  13626. var c = (str + '').charCodeAt(0);
  13627. return c === 0x24 || c === 0x5F
  13628. }
  13629. /**
  13630. * Define a property.
  13631. */
  13632. function def (obj, key, val, enumerable) {
  13633. Object.defineProperty(obj, key, {
  13634. value: val,
  13635. enumerable: !!enumerable,
  13636. writable: true,
  13637. configurable: true
  13638. });
  13639. }
  13640. /**
  13641. * Parse simple path.
  13642. */
  13643. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  13644. function parsePath (path) {
  13645. if (bailRE.test(path)) {
  13646. return
  13647. }
  13648. var segments = path.split('.');
  13649. return function (obj) {
  13650. for (var i = 0; i < segments.length; i++) {
  13651. if (!obj) { return }
  13652. obj = obj[segments[i]];
  13653. }
  13654. return obj
  13655. }
  13656. }
  13657. /* */
  13658. // can we use __proto__?
  13659. var hasProto = '__proto__' in {};
  13660. // Browser environment sniffing
  13661. var inBrowser = typeof window !== 'undefined';
  13662. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  13663. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  13664. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  13665. var isIE = UA && /msie|trident/.test(UA);
  13666. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  13667. var isEdge = UA && UA.indexOf('edge/') > 0;
  13668. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  13669. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  13670. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  13671. var isPhantomJS = UA && /phantomjs/.test(UA);
  13672. var isFF = UA && UA.match(/firefox\/(\d+)/);
  13673. // Firefox has a "watch" function on Object.prototype...
  13674. var nativeWatch = ({}).watch;
  13675. if (inBrowser) {
  13676. try {
  13677. var opts = {};
  13678. Object.defineProperty(opts, 'passive', ({
  13679. get: function get () {
  13680. }
  13681. })); // https://github.com/facebook/flow/issues/285
  13682. window.addEventListener('test-passive', null, opts);
  13683. } catch (e) {}
  13684. }
  13685. // this needs to be lazy-evaled because vue may be required before
  13686. // vue-server-renderer can set VUE_ENV
  13687. var _isServer;
  13688. var isServerRendering = function () {
  13689. if (_isServer === undefined) {
  13690. /* istanbul ignore if */
  13691. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  13692. // detect presence of vue-server-renderer and avoid
  13693. // Webpack shimming the process
  13694. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  13695. } else {
  13696. _isServer = false;
  13697. }
  13698. }
  13699. return _isServer
  13700. };
  13701. // detect devtools
  13702. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  13703. /* istanbul ignore next */
  13704. function isNative (Ctor) {
  13705. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  13706. }
  13707. var hasSymbol =
  13708. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  13709. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  13710. var _Set;
  13711. /* istanbul ignore if */ // $flow-disable-line
  13712. if (typeof Set !== 'undefined' && isNative(Set)) {
  13713. // use native Set when available.
  13714. _Set = Set;
  13715. } else {
  13716. // a non-standard Set polyfill that only works with primitive keys.
  13717. _Set = /*@__PURE__*/(function () {
  13718. function Set () {
  13719. this.set = Object.create(null);
  13720. }
  13721. Set.prototype.has = function has (key) {
  13722. return this.set[key] === true
  13723. };
  13724. Set.prototype.add = function add (key) {
  13725. this.set[key] = true;
  13726. };
  13727. Set.prototype.clear = function clear () {
  13728. this.set = Object.create(null);
  13729. };
  13730. return Set;
  13731. }());
  13732. }
  13733. /* */
  13734. var warn = noop;
  13735. var tip = noop;
  13736. var generateComponentTrace = (noop); // work around flow check
  13737. var formatComponentName = (noop);
  13738. if (true) {
  13739. var hasConsole = typeof console !== 'undefined';
  13740. var classifyRE = /(?:^|[-_])(\w)/g;
  13741. var classify = function (str) { return str
  13742. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  13743. .replace(/[-_]/g, ''); };
  13744. warn = function (msg, vm) {
  13745. var trace = vm ? generateComponentTrace(vm) : '';
  13746. if (config.warnHandler) {
  13747. config.warnHandler.call(null, msg, vm, trace);
  13748. } else if (hasConsole && (!config.silent)) {
  13749. console.error(("[Vue warn]: " + msg + trace));
  13750. }
  13751. };
  13752. tip = function (msg, vm) {
  13753. if (hasConsole && (!config.silent)) {
  13754. console.warn("[Vue tip]: " + msg + (
  13755. vm ? generateComponentTrace(vm) : ''
  13756. ));
  13757. }
  13758. };
  13759. formatComponentName = function (vm, includeFile) {
  13760. if (vm.$root === vm) {
  13761. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  13762. return ('') + vm.$options.__file
  13763. }
  13764. return '<Root>'
  13765. }
  13766. var options = typeof vm === 'function' && vm.cid != null
  13767. ? vm.options
  13768. : vm._isVue
  13769. ? vm.$options || vm.constructor.options
  13770. : vm;
  13771. var name = options.name || options._componentTag;
  13772. var file = options.__file;
  13773. if (!name && file) {
  13774. var match = file.match(/([^/\\]+)\.vue$/);
  13775. name = match && match[1];
  13776. }
  13777. return (
  13778. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  13779. (file && includeFile !== false ? (" at " + file) : '')
  13780. )
  13781. };
  13782. var repeat = function (str, n) {
  13783. var res = '';
  13784. while (n) {
  13785. if (n % 2 === 1) { res += str; }
  13786. if (n > 1) { str += str; }
  13787. n >>= 1;
  13788. }
  13789. return res
  13790. };
  13791. generateComponentTrace = function (vm) {
  13792. if (vm._isVue && vm.$parent) {
  13793. var tree = [];
  13794. var currentRecursiveSequence = 0;
  13795. while (vm && vm.$options.name !== 'PageBody') {
  13796. if (tree.length > 0) {
  13797. var last = tree[tree.length - 1];
  13798. if (last.constructor === vm.constructor) {
  13799. currentRecursiveSequence++;
  13800. vm = vm.$parent;
  13801. continue
  13802. } else if (currentRecursiveSequence > 0) {
  13803. tree[tree.length - 1] = [last, currentRecursiveSequence];
  13804. currentRecursiveSequence = 0;
  13805. }
  13806. }
  13807. !vm.$options.isReserved && tree.push(vm);
  13808. vm = vm.$parent;
  13809. }
  13810. return '\n\nfound in\n\n' + tree
  13811. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  13812. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  13813. : formatComponentName(vm))); })
  13814. .join('\n')
  13815. } else {
  13816. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  13817. }
  13818. };
  13819. }
  13820. /* */
  13821. var uid = 0;
  13822. /**
  13823. * A dep is an observable that can have multiple
  13824. * directives subscribing to it.
  13825. */
  13826. var Dep = function Dep () {
  13827. this.id = uid++;
  13828. this.subs = [];
  13829. };
  13830. Dep.prototype.addSub = function addSub (sub) {
  13831. this.subs.push(sub);
  13832. };
  13833. Dep.prototype.removeSub = function removeSub (sub) {
  13834. remove(this.subs, sub);
  13835. };
  13836. Dep.prototype.depend = function depend () {
  13837. if (Dep.SharedObject.target) {
  13838. Dep.SharedObject.target.addDep(this);
  13839. }
  13840. };
  13841. Dep.prototype.notify = function notify () {
  13842. // stabilize the subscriber list first
  13843. var subs = this.subs.slice();
  13844. if ( true && !config.async) {
  13845. // subs aren't sorted in scheduler if not running async
  13846. // we need to sort them now to make sure they fire in correct
  13847. // order
  13848. subs.sort(function (a, b) { return a.id - b.id; });
  13849. }
  13850. for (var i = 0, l = subs.length; i < l; i++) {
  13851. subs[i].update();
  13852. }
  13853. };
  13854. // The current target watcher being evaluated.
  13855. // This is globally unique because only one watcher
  13856. // can be evaluated at a time.
  13857. // fixed by xxxxxx (nvue shared vuex)
  13858. /* eslint-disable no-undef */
  13859. Dep.SharedObject = {};
  13860. Dep.SharedObject.target = null;
  13861. Dep.SharedObject.targetStack = [];
  13862. function pushTarget (target) {
  13863. Dep.SharedObject.targetStack.push(target);
  13864. Dep.SharedObject.target = target;
  13865. Dep.target = target;
  13866. }
  13867. function popTarget () {
  13868. Dep.SharedObject.targetStack.pop();
  13869. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  13870. Dep.target = Dep.SharedObject.target;
  13871. }
  13872. /* */
  13873. var VNode = function VNode (
  13874. tag,
  13875. data,
  13876. children,
  13877. text,
  13878. elm,
  13879. context,
  13880. componentOptions,
  13881. asyncFactory
  13882. ) {
  13883. this.tag = tag;
  13884. this.data = data;
  13885. this.children = children;
  13886. this.text = text;
  13887. this.elm = elm;
  13888. this.ns = undefined;
  13889. this.context = context;
  13890. this.fnContext = undefined;
  13891. this.fnOptions = undefined;
  13892. this.fnScopeId = undefined;
  13893. this.key = data && data.key;
  13894. this.componentOptions = componentOptions;
  13895. this.componentInstance = undefined;
  13896. this.parent = undefined;
  13897. this.raw = false;
  13898. this.isStatic = false;
  13899. this.isRootInsert = true;
  13900. this.isComment = false;
  13901. this.isCloned = false;
  13902. this.isOnce = false;
  13903. this.asyncFactory = asyncFactory;
  13904. this.asyncMeta = undefined;
  13905. this.isAsyncPlaceholder = false;
  13906. };
  13907. var prototypeAccessors = { child: { configurable: true } };
  13908. // DEPRECATED: alias for componentInstance for backwards compat.
  13909. /* istanbul ignore next */
  13910. prototypeAccessors.child.get = function () {
  13911. return this.componentInstance
  13912. };
  13913. Object.defineProperties( VNode.prototype, prototypeAccessors );
  13914. var createEmptyVNode = function (text) {
  13915. if ( text === void 0 ) text = '';
  13916. var node = new VNode();
  13917. node.text = text;
  13918. node.isComment = true;
  13919. return node
  13920. };
  13921. function createTextVNode (val) {
  13922. return new VNode(undefined, undefined, undefined, String(val))
  13923. }
  13924. // optimized shallow clone
  13925. // used for static nodes and slot nodes because they may be reused across
  13926. // multiple renders, cloning them avoids errors when DOM manipulations rely
  13927. // on their elm reference.
  13928. function cloneVNode (vnode) {
  13929. var cloned = new VNode(
  13930. vnode.tag,
  13931. vnode.data,
  13932. // #7975
  13933. // clone children array to avoid mutating original in case of cloning
  13934. // a child.
  13935. vnode.children && vnode.children.slice(),
  13936. vnode.text,
  13937. vnode.elm,
  13938. vnode.context,
  13939. vnode.componentOptions,
  13940. vnode.asyncFactory
  13941. );
  13942. cloned.ns = vnode.ns;
  13943. cloned.isStatic = vnode.isStatic;
  13944. cloned.key = vnode.key;
  13945. cloned.isComment = vnode.isComment;
  13946. cloned.fnContext = vnode.fnContext;
  13947. cloned.fnOptions = vnode.fnOptions;
  13948. cloned.fnScopeId = vnode.fnScopeId;
  13949. cloned.asyncMeta = vnode.asyncMeta;
  13950. cloned.isCloned = true;
  13951. return cloned
  13952. }
  13953. /*
  13954. * not type checking this file because flow doesn't play well with
  13955. * dynamically accessing methods on Array prototype
  13956. */
  13957. var arrayProto = Array.prototype;
  13958. var arrayMethods = Object.create(arrayProto);
  13959. var methodsToPatch = [
  13960. 'push',
  13961. 'pop',
  13962. 'shift',
  13963. 'unshift',
  13964. 'splice',
  13965. 'sort',
  13966. 'reverse'
  13967. ];
  13968. /**
  13969. * Intercept mutating methods and emit events
  13970. */
  13971. methodsToPatch.forEach(function (method) {
  13972. // cache original method
  13973. var original = arrayProto[method];
  13974. def(arrayMethods, method, function mutator () {
  13975. var args = [], len = arguments.length;
  13976. while ( len-- ) args[ len ] = arguments[ len ];
  13977. var result = original.apply(this, args);
  13978. var ob = this.__ob__;
  13979. var inserted;
  13980. switch (method) {
  13981. case 'push':
  13982. case 'unshift':
  13983. inserted = args;
  13984. break
  13985. case 'splice':
  13986. inserted = args.slice(2);
  13987. break
  13988. }
  13989. if (inserted) { ob.observeArray(inserted); }
  13990. // notify change
  13991. ob.dep.notify();
  13992. return result
  13993. });
  13994. });
  13995. /* */
  13996. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  13997. /**
  13998. * In some cases we may want to disable observation inside a component's
  13999. * update computation.
  14000. */
  14001. var shouldObserve = true;
  14002. function toggleObserving (value) {
  14003. shouldObserve = value;
  14004. }
  14005. /**
  14006. * Observer class that is attached to each observed
  14007. * object. Once attached, the observer converts the target
  14008. * object's property keys into getter/setters that
  14009. * collect dependencies and dispatch updates.
  14010. */
  14011. var Observer = function Observer (value) {
  14012. this.value = value;
  14013. this.dep = new Dep();
  14014. this.vmCount = 0;
  14015. def(value, '__ob__', this);
  14016. if (Array.isArray(value)) {
  14017. if (hasProto) {
  14018. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  14019. if(value.push !== value.__proto__.push){
  14020. copyAugment(value, arrayMethods, arrayKeys);
  14021. } else {
  14022. protoAugment(value, arrayMethods);
  14023. }
  14024. }
  14025. } else {
  14026. copyAugment(value, arrayMethods, arrayKeys);
  14027. }
  14028. this.observeArray(value);
  14029. } else {
  14030. this.walk(value);
  14031. }
  14032. };
  14033. /**
  14034. * Walk through all properties and convert them into
  14035. * getter/setters. This method should only be called when
  14036. * value type is Object.
  14037. */
  14038. Observer.prototype.walk = function walk (obj) {
  14039. var keys = Object.keys(obj);
  14040. for (var i = 0; i < keys.length; i++) {
  14041. defineReactive$$1(obj, keys[i]);
  14042. }
  14043. };
  14044. /**
  14045. * Observe a list of Array items.
  14046. */
  14047. Observer.prototype.observeArray = function observeArray (items) {
  14048. for (var i = 0, l = items.length; i < l; i++) {
  14049. observe(items[i]);
  14050. }
  14051. };
  14052. // helpers
  14053. /**
  14054. * Augment a target Object or Array by intercepting
  14055. * the prototype chain using __proto__
  14056. */
  14057. function protoAugment (target, src) {
  14058. /* eslint-disable no-proto */
  14059. target.__proto__ = src;
  14060. /* eslint-enable no-proto */
  14061. }
  14062. /**
  14063. * Augment a target Object or Array by defining
  14064. * hidden properties.
  14065. */
  14066. /* istanbul ignore next */
  14067. function copyAugment (target, src, keys) {
  14068. for (var i = 0, l = keys.length; i < l; i++) {
  14069. var key = keys[i];
  14070. def(target, key, src[key]);
  14071. }
  14072. }
  14073. /**
  14074. * Attempt to create an observer instance for a value,
  14075. * returns the new observer if successfully observed,
  14076. * or the existing observer if the value already has one.
  14077. */
  14078. function observe (value, asRootData) {
  14079. if (!isObject(value) || value instanceof VNode) {
  14080. return
  14081. }
  14082. var ob;
  14083. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  14084. ob = value.__ob__;
  14085. } else if (
  14086. shouldObserve &&
  14087. !isServerRendering() &&
  14088. (Array.isArray(value) || isPlainObject(value)) &&
  14089. Object.isExtensible(value) &&
  14090. !value._isVue
  14091. ) {
  14092. ob = new Observer(value);
  14093. }
  14094. if (asRootData && ob) {
  14095. ob.vmCount++;
  14096. }
  14097. return ob
  14098. }
  14099. /**
  14100. * Define a reactive property on an Object.
  14101. */
  14102. function defineReactive$$1 (
  14103. obj,
  14104. key,
  14105. val,
  14106. customSetter,
  14107. shallow
  14108. ) {
  14109. var dep = new Dep();
  14110. var property = Object.getOwnPropertyDescriptor(obj, key);
  14111. if (property && property.configurable === false) {
  14112. return
  14113. }
  14114. // cater for pre-defined getter/setters
  14115. var getter = property && property.get;
  14116. var setter = property && property.set;
  14117. if ((!getter || setter) && arguments.length === 2) {
  14118. val = obj[key];
  14119. }
  14120. var childOb = !shallow && observe(val);
  14121. Object.defineProperty(obj, key, {
  14122. enumerable: true,
  14123. configurable: true,
  14124. get: function reactiveGetter () {
  14125. var value = getter ? getter.call(obj) : val;
  14126. if (Dep.SharedObject.target) { // fixed by xxxxxx
  14127. dep.depend();
  14128. if (childOb) {
  14129. childOb.dep.depend();
  14130. if (Array.isArray(value)) {
  14131. dependArray(value);
  14132. }
  14133. }
  14134. }
  14135. return value
  14136. },
  14137. set: function reactiveSetter (newVal) {
  14138. var value = getter ? getter.call(obj) : val;
  14139. /* eslint-disable no-self-compare */
  14140. if (newVal === value || (newVal !== newVal && value !== value)) {
  14141. return
  14142. }
  14143. /* eslint-enable no-self-compare */
  14144. if ( true && customSetter) {
  14145. customSetter();
  14146. }
  14147. // #7981: for accessor properties without setter
  14148. if (getter && !setter) { return }
  14149. if (setter) {
  14150. setter.call(obj, newVal);
  14151. } else {
  14152. val = newVal;
  14153. }
  14154. childOb = !shallow && observe(newVal);
  14155. dep.notify();
  14156. }
  14157. });
  14158. }
  14159. /**
  14160. * Set a property on an object. Adds the new property and
  14161. * triggers change notification if the property doesn't
  14162. * already exist.
  14163. */
  14164. function set (target, key, val) {
  14165. if ( true &&
  14166. (isUndef(target) || isPrimitive(target))
  14167. ) {
  14168. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  14169. }
  14170. if (Array.isArray(target) && isValidArrayIndex(key)) {
  14171. target.length = Math.max(target.length, key);
  14172. target.splice(key, 1, val);
  14173. return val
  14174. }
  14175. if (key in target && !(key in Object.prototype)) {
  14176. target[key] = val;
  14177. return val
  14178. }
  14179. var ob = (target).__ob__;
  14180. if (target._isVue || (ob && ob.vmCount)) {
  14181. true && warn(
  14182. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  14183. 'at runtime - declare it upfront in the data option.'
  14184. );
  14185. return val
  14186. }
  14187. if (!ob) {
  14188. target[key] = val;
  14189. return val
  14190. }
  14191. defineReactive$$1(ob.value, key, val);
  14192. ob.dep.notify();
  14193. return val
  14194. }
  14195. /**
  14196. * Delete a property and trigger change if necessary.
  14197. */
  14198. function del (target, key) {
  14199. if ( true &&
  14200. (isUndef(target) || isPrimitive(target))
  14201. ) {
  14202. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  14203. }
  14204. if (Array.isArray(target) && isValidArrayIndex(key)) {
  14205. target.splice(key, 1);
  14206. return
  14207. }
  14208. var ob = (target).__ob__;
  14209. if (target._isVue || (ob && ob.vmCount)) {
  14210. true && warn(
  14211. 'Avoid deleting properties on a Vue instance or its root $data ' +
  14212. '- just set it to null.'
  14213. );
  14214. return
  14215. }
  14216. if (!hasOwn(target, key)) {
  14217. return
  14218. }
  14219. delete target[key];
  14220. if (!ob) {
  14221. return
  14222. }
  14223. ob.dep.notify();
  14224. }
  14225. /**
  14226. * Collect dependencies on array elements when the array is touched, since
  14227. * we cannot intercept array element access like property getters.
  14228. */
  14229. function dependArray (value) {
  14230. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  14231. e = value[i];
  14232. e && e.__ob__ && e.__ob__.dep.depend();
  14233. if (Array.isArray(e)) {
  14234. dependArray(e);
  14235. }
  14236. }
  14237. }
  14238. /* */
  14239. /**
  14240. * Option overwriting strategies are functions that handle
  14241. * how to merge a parent option value and a child option
  14242. * value into the final value.
  14243. */
  14244. var strats = config.optionMergeStrategies;
  14245. /**
  14246. * Options with restrictions
  14247. */
  14248. if (true) {
  14249. strats.el = strats.propsData = function (parent, child, vm, key) {
  14250. if (!vm) {
  14251. warn(
  14252. "option \"" + key + "\" can only be used during instance " +
  14253. 'creation with the `new` keyword.'
  14254. );
  14255. }
  14256. return defaultStrat(parent, child)
  14257. };
  14258. }
  14259. /**
  14260. * Helper that recursively merges two data objects together.
  14261. */
  14262. function mergeData (to, from) {
  14263. if (!from) { return to }
  14264. var key, toVal, fromVal;
  14265. var keys = hasSymbol
  14266. ? Reflect.ownKeys(from)
  14267. : Object.keys(from);
  14268. for (var i = 0; i < keys.length; i++) {
  14269. key = keys[i];
  14270. // in case the object is already observed...
  14271. if (key === '__ob__') { continue }
  14272. toVal = to[key];
  14273. fromVal = from[key];
  14274. if (!hasOwn(to, key)) {
  14275. set(to, key, fromVal);
  14276. } else if (
  14277. toVal !== fromVal &&
  14278. isPlainObject(toVal) &&
  14279. isPlainObject(fromVal)
  14280. ) {
  14281. mergeData(toVal, fromVal);
  14282. }
  14283. }
  14284. return to
  14285. }
  14286. /**
  14287. * Data
  14288. */
  14289. function mergeDataOrFn (
  14290. parentVal,
  14291. childVal,
  14292. vm
  14293. ) {
  14294. if (!vm) {
  14295. // in a Vue.extend merge, both should be functions
  14296. if (!childVal) {
  14297. return parentVal
  14298. }
  14299. if (!parentVal) {
  14300. return childVal
  14301. }
  14302. // when parentVal & childVal are both present,
  14303. // we need to return a function that returns the
  14304. // merged result of both functions... no need to
  14305. // check if parentVal is a function here because
  14306. // it has to be a function to pass previous merges.
  14307. return function mergedDataFn () {
  14308. return mergeData(
  14309. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  14310. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  14311. )
  14312. }
  14313. } else {
  14314. return function mergedInstanceDataFn () {
  14315. // instance merge
  14316. var instanceData = typeof childVal === 'function'
  14317. ? childVal.call(vm, vm)
  14318. : childVal;
  14319. var defaultData = typeof parentVal === 'function'
  14320. ? parentVal.call(vm, vm)
  14321. : parentVal;
  14322. if (instanceData) {
  14323. return mergeData(instanceData, defaultData)
  14324. } else {
  14325. return defaultData
  14326. }
  14327. }
  14328. }
  14329. }
  14330. strats.data = function (
  14331. parentVal,
  14332. childVal,
  14333. vm
  14334. ) {
  14335. if (!vm) {
  14336. if (childVal && typeof childVal !== 'function') {
  14337. true && warn(
  14338. 'The "data" option should be a function ' +
  14339. 'that returns a per-instance value in component ' +
  14340. 'definitions.',
  14341. vm
  14342. );
  14343. return parentVal
  14344. }
  14345. return mergeDataOrFn(parentVal, childVal)
  14346. }
  14347. return mergeDataOrFn(parentVal, childVal, vm)
  14348. };
  14349. /**
  14350. * Hooks and props are merged as arrays.
  14351. */
  14352. function mergeHook (
  14353. parentVal,
  14354. childVal
  14355. ) {
  14356. var res = childVal
  14357. ? parentVal
  14358. ? parentVal.concat(childVal)
  14359. : Array.isArray(childVal)
  14360. ? childVal
  14361. : [childVal]
  14362. : parentVal;
  14363. return res
  14364. ? dedupeHooks(res)
  14365. : res
  14366. }
  14367. function dedupeHooks (hooks) {
  14368. var res = [];
  14369. for (var i = 0; i < hooks.length; i++) {
  14370. if (res.indexOf(hooks[i]) === -1) {
  14371. res.push(hooks[i]);
  14372. }
  14373. }
  14374. return res
  14375. }
  14376. LIFECYCLE_HOOKS.forEach(function (hook) {
  14377. strats[hook] = mergeHook;
  14378. });
  14379. /**
  14380. * Assets
  14381. *
  14382. * When a vm is present (instance creation), we need to do
  14383. * a three-way merge between constructor options, instance
  14384. * options and parent options.
  14385. */
  14386. function mergeAssets (
  14387. parentVal,
  14388. childVal,
  14389. vm,
  14390. key
  14391. ) {
  14392. var res = Object.create(parentVal || null);
  14393. if (childVal) {
  14394. true && assertObjectType(key, childVal, vm);
  14395. return extend(res, childVal)
  14396. } else {
  14397. return res
  14398. }
  14399. }
  14400. ASSET_TYPES.forEach(function (type) {
  14401. strats[type + 's'] = mergeAssets;
  14402. });
  14403. /**
  14404. * Watchers.
  14405. *
  14406. * Watchers hashes should not overwrite one
  14407. * another, so we merge them as arrays.
  14408. */
  14409. strats.watch = function (
  14410. parentVal,
  14411. childVal,
  14412. vm,
  14413. key
  14414. ) {
  14415. // work around Firefox's Object.prototype.watch...
  14416. if (parentVal === nativeWatch) { parentVal = undefined; }
  14417. if (childVal === nativeWatch) { childVal = undefined; }
  14418. /* istanbul ignore if */
  14419. if (!childVal) { return Object.create(parentVal || null) }
  14420. if (true) {
  14421. assertObjectType(key, childVal, vm);
  14422. }
  14423. if (!parentVal) { return childVal }
  14424. var ret = {};
  14425. extend(ret, parentVal);
  14426. for (var key$1 in childVal) {
  14427. var parent = ret[key$1];
  14428. var child = childVal[key$1];
  14429. if (parent && !Array.isArray(parent)) {
  14430. parent = [parent];
  14431. }
  14432. ret[key$1] = parent
  14433. ? parent.concat(child)
  14434. : Array.isArray(child) ? child : [child];
  14435. }
  14436. return ret
  14437. };
  14438. /**
  14439. * Other object hashes.
  14440. */
  14441. strats.props =
  14442. strats.methods =
  14443. strats.inject =
  14444. strats.computed = function (
  14445. parentVal,
  14446. childVal,
  14447. vm,
  14448. key
  14449. ) {
  14450. if (childVal && "development" !== 'production') {
  14451. assertObjectType(key, childVal, vm);
  14452. }
  14453. if (!parentVal) { return childVal }
  14454. var ret = Object.create(null);
  14455. extend(ret, parentVal);
  14456. if (childVal) { extend(ret, childVal); }
  14457. return ret
  14458. };
  14459. strats.provide = mergeDataOrFn;
  14460. /**
  14461. * Default strategy.
  14462. */
  14463. var defaultStrat = function (parentVal, childVal) {
  14464. return childVal === undefined
  14465. ? parentVal
  14466. : childVal
  14467. };
  14468. /**
  14469. * Validate component names
  14470. */
  14471. function checkComponents (options) {
  14472. for (var key in options.components) {
  14473. validateComponentName(key);
  14474. }
  14475. }
  14476. function validateComponentName (name) {
  14477. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  14478. warn(
  14479. 'Invalid component name: "' + name + '". Component names ' +
  14480. 'should conform to valid custom element name in html5 specification.'
  14481. );
  14482. }
  14483. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  14484. warn(
  14485. 'Do not use built-in or reserved HTML elements as component ' +
  14486. 'id: ' + name
  14487. );
  14488. }
  14489. }
  14490. /**
  14491. * Ensure all props option syntax are normalized into the
  14492. * Object-based format.
  14493. */
  14494. function normalizeProps (options, vm) {
  14495. var props = options.props;
  14496. if (!props) { return }
  14497. var res = {};
  14498. var i, val, name;
  14499. if (Array.isArray(props)) {
  14500. i = props.length;
  14501. while (i--) {
  14502. val = props[i];
  14503. if (typeof val === 'string') {
  14504. name = camelize(val);
  14505. res[name] = { type: null };
  14506. } else if (true) {
  14507. warn('props must be strings when using array syntax.');
  14508. }
  14509. }
  14510. } else if (isPlainObject(props)) {
  14511. for (var key in props) {
  14512. val = props[key];
  14513. name = camelize(key);
  14514. res[name] = isPlainObject(val)
  14515. ? val
  14516. : { type: val };
  14517. }
  14518. } else if (true) {
  14519. warn(
  14520. "Invalid value for option \"props\": expected an Array or an Object, " +
  14521. "but got " + (toRawType(props)) + ".",
  14522. vm
  14523. );
  14524. }
  14525. options.props = res;
  14526. }
  14527. /**
  14528. * Normalize all injections into Object-based format
  14529. */
  14530. function normalizeInject (options, vm) {
  14531. var inject = options.inject;
  14532. if (!inject) { return }
  14533. var normalized = options.inject = {};
  14534. if (Array.isArray(inject)) {
  14535. for (var i = 0; i < inject.length; i++) {
  14536. normalized[inject[i]] = { from: inject[i] };
  14537. }
  14538. } else if (isPlainObject(inject)) {
  14539. for (var key in inject) {
  14540. var val = inject[key];
  14541. normalized[key] = isPlainObject(val)
  14542. ? extend({ from: key }, val)
  14543. : { from: val };
  14544. }
  14545. } else if (true) {
  14546. warn(
  14547. "Invalid value for option \"inject\": expected an Array or an Object, " +
  14548. "but got " + (toRawType(inject)) + ".",
  14549. vm
  14550. );
  14551. }
  14552. }
  14553. /**
  14554. * Normalize raw function directives into object format.
  14555. */
  14556. function normalizeDirectives (options) {
  14557. var dirs = options.directives;
  14558. if (dirs) {
  14559. for (var key in dirs) {
  14560. var def$$1 = dirs[key];
  14561. if (typeof def$$1 === 'function') {
  14562. dirs[key] = { bind: def$$1, update: def$$1 };
  14563. }
  14564. }
  14565. }
  14566. }
  14567. function assertObjectType (name, value, vm) {
  14568. if (!isPlainObject(value)) {
  14569. warn(
  14570. "Invalid value for option \"" + name + "\": expected an Object, " +
  14571. "but got " + (toRawType(value)) + ".",
  14572. vm
  14573. );
  14574. }
  14575. }
  14576. /**
  14577. * Merge two option objects into a new one.
  14578. * Core utility used in both instantiation and inheritance.
  14579. */
  14580. function mergeOptions (
  14581. parent,
  14582. child,
  14583. vm
  14584. ) {
  14585. if (true) {
  14586. checkComponents(child);
  14587. }
  14588. if (typeof child === 'function') {
  14589. child = child.options;
  14590. }
  14591. normalizeProps(child, vm);
  14592. normalizeInject(child, vm);
  14593. normalizeDirectives(child);
  14594. // Apply extends and mixins on the child options,
  14595. // but only if it is a raw options object that isn't
  14596. // the result of another mergeOptions call.
  14597. // Only merged options has the _base property.
  14598. if (!child._base) {
  14599. if (child.extends) {
  14600. parent = mergeOptions(parent, child.extends, vm);
  14601. }
  14602. if (child.mixins) {
  14603. for (var i = 0, l = child.mixins.length; i < l; i++) {
  14604. parent = mergeOptions(parent, child.mixins[i], vm);
  14605. }
  14606. }
  14607. }
  14608. var options = {};
  14609. var key;
  14610. for (key in parent) {
  14611. mergeField(key);
  14612. }
  14613. for (key in child) {
  14614. if (!hasOwn(parent, key)) {
  14615. mergeField(key);
  14616. }
  14617. }
  14618. function mergeField (key) {
  14619. var strat = strats[key] || defaultStrat;
  14620. options[key] = strat(parent[key], child[key], vm, key);
  14621. }
  14622. return options
  14623. }
  14624. /**
  14625. * Resolve an asset.
  14626. * This function is used because child instances need access
  14627. * to assets defined in its ancestor chain.
  14628. */
  14629. function resolveAsset (
  14630. options,
  14631. type,
  14632. id,
  14633. warnMissing
  14634. ) {
  14635. /* istanbul ignore if */
  14636. if (typeof id !== 'string') {
  14637. return
  14638. }
  14639. var assets = options[type];
  14640. // check local registration variations first
  14641. if (hasOwn(assets, id)) { return assets[id] }
  14642. var camelizedId = camelize(id);
  14643. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  14644. var PascalCaseId = capitalize(camelizedId);
  14645. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  14646. // fallback to prototype chain
  14647. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  14648. if ( true && warnMissing && !res) {
  14649. warn(
  14650. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  14651. options
  14652. );
  14653. }
  14654. return res
  14655. }
  14656. /* */
  14657. function validateProp (
  14658. key,
  14659. propOptions,
  14660. propsData,
  14661. vm
  14662. ) {
  14663. var prop = propOptions[key];
  14664. var absent = !hasOwn(propsData, key);
  14665. var value = propsData[key];
  14666. // boolean casting
  14667. var booleanIndex = getTypeIndex(Boolean, prop.type);
  14668. if (booleanIndex > -1) {
  14669. if (absent && !hasOwn(prop, 'default')) {
  14670. value = false;
  14671. } else if (value === '' || value === hyphenate(key)) {
  14672. // only cast empty string / same name to boolean if
  14673. // boolean has higher priority
  14674. var stringIndex = getTypeIndex(String, prop.type);
  14675. if (stringIndex < 0 || booleanIndex < stringIndex) {
  14676. value = true;
  14677. }
  14678. }
  14679. }
  14680. // check default value
  14681. if (value === undefined) {
  14682. value = getPropDefaultValue(vm, prop, key);
  14683. // since the default value is a fresh copy,
  14684. // make sure to observe it.
  14685. var prevShouldObserve = shouldObserve;
  14686. toggleObserving(true);
  14687. observe(value);
  14688. toggleObserving(prevShouldObserve);
  14689. }
  14690. if (
  14691. true
  14692. ) {
  14693. assertProp(prop, key, value, vm, absent);
  14694. }
  14695. return value
  14696. }
  14697. /**
  14698. * Get the default value of a prop.
  14699. */
  14700. function getPropDefaultValue (vm, prop, key) {
  14701. // no default, return undefined
  14702. if (!hasOwn(prop, 'default')) {
  14703. return undefined
  14704. }
  14705. var def = prop.default;
  14706. // warn against non-factory defaults for Object & Array
  14707. if ( true && isObject(def)) {
  14708. warn(
  14709. 'Invalid default value for prop "' + key + '": ' +
  14710. 'Props with type Object/Array must use a factory function ' +
  14711. 'to return the default value.',
  14712. vm
  14713. );
  14714. }
  14715. // the raw prop value was also undefined from previous render,
  14716. // return previous default value to avoid unnecessary watcher trigger
  14717. if (vm && vm.$options.propsData &&
  14718. vm.$options.propsData[key] === undefined &&
  14719. vm._props[key] !== undefined
  14720. ) {
  14721. return vm._props[key]
  14722. }
  14723. // call factory function for non-Function types
  14724. // a value is Function if its prototype is function even across different execution context
  14725. return typeof def === 'function' && getType(prop.type) !== 'Function'
  14726. ? def.call(vm)
  14727. : def
  14728. }
  14729. /**
  14730. * Assert whether a prop is valid.
  14731. */
  14732. function assertProp (
  14733. prop,
  14734. name,
  14735. value,
  14736. vm,
  14737. absent
  14738. ) {
  14739. if (prop.required && absent) {
  14740. warn(
  14741. 'Missing required prop: "' + name + '"',
  14742. vm
  14743. );
  14744. return
  14745. }
  14746. if (value == null && !prop.required) {
  14747. return
  14748. }
  14749. var type = prop.type;
  14750. var valid = !type || type === true;
  14751. var expectedTypes = [];
  14752. if (type) {
  14753. if (!Array.isArray(type)) {
  14754. type = [type];
  14755. }
  14756. for (var i = 0; i < type.length && !valid; i++) {
  14757. var assertedType = assertType(value, type[i]);
  14758. expectedTypes.push(assertedType.expectedType || '');
  14759. valid = assertedType.valid;
  14760. }
  14761. }
  14762. if (!valid) {
  14763. warn(
  14764. getInvalidTypeMessage(name, value, expectedTypes),
  14765. vm
  14766. );
  14767. return
  14768. }
  14769. var validator = prop.validator;
  14770. if (validator) {
  14771. if (!validator(value)) {
  14772. warn(
  14773. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  14774. vm
  14775. );
  14776. }
  14777. }
  14778. }
  14779. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  14780. function assertType (value, type) {
  14781. var valid;
  14782. var expectedType = getType(type);
  14783. if (simpleCheckRE.test(expectedType)) {
  14784. var t = typeof value;
  14785. valid = t === expectedType.toLowerCase();
  14786. // for primitive wrapper objects
  14787. if (!valid && t === 'object') {
  14788. valid = value instanceof type;
  14789. }
  14790. } else if (expectedType === 'Object') {
  14791. valid = isPlainObject(value);
  14792. } else if (expectedType === 'Array') {
  14793. valid = Array.isArray(value);
  14794. } else {
  14795. valid = value instanceof type;
  14796. }
  14797. return {
  14798. valid: valid,
  14799. expectedType: expectedType
  14800. }
  14801. }
  14802. /**
  14803. * Use function string name to check built-in types,
  14804. * because a simple equality check will fail when running
  14805. * across different vms / iframes.
  14806. */
  14807. function getType (fn) {
  14808. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  14809. return match ? match[1] : ''
  14810. }
  14811. function isSameType (a, b) {
  14812. return getType(a) === getType(b)
  14813. }
  14814. function getTypeIndex (type, expectedTypes) {
  14815. if (!Array.isArray(expectedTypes)) {
  14816. return isSameType(expectedTypes, type) ? 0 : -1
  14817. }
  14818. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  14819. if (isSameType(expectedTypes[i], type)) {
  14820. return i
  14821. }
  14822. }
  14823. return -1
  14824. }
  14825. function getInvalidTypeMessage (name, value, expectedTypes) {
  14826. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  14827. " Expected " + (expectedTypes.map(capitalize).join(', '));
  14828. var expectedType = expectedTypes[0];
  14829. var receivedType = toRawType(value);
  14830. var expectedValue = styleValue(value, expectedType);
  14831. var receivedValue = styleValue(value, receivedType);
  14832. // check if we need to specify expected value
  14833. if (expectedTypes.length === 1 &&
  14834. isExplicable(expectedType) &&
  14835. !isBoolean(expectedType, receivedType)) {
  14836. message += " with value " + expectedValue;
  14837. }
  14838. message += ", got " + receivedType + " ";
  14839. // check if we need to specify received value
  14840. if (isExplicable(receivedType)) {
  14841. message += "with value " + receivedValue + ".";
  14842. }
  14843. return message
  14844. }
  14845. function styleValue (value, type) {
  14846. if (type === 'String') {
  14847. return ("\"" + value + "\"")
  14848. } else if (type === 'Number') {
  14849. return ("" + (Number(value)))
  14850. } else {
  14851. return ("" + value)
  14852. }
  14853. }
  14854. function isExplicable (value) {
  14855. var explicitTypes = ['string', 'number', 'boolean'];
  14856. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  14857. }
  14858. function isBoolean () {
  14859. var args = [], len = arguments.length;
  14860. while ( len-- ) args[ len ] = arguments[ len ];
  14861. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  14862. }
  14863. /* */
  14864. function handleError (err, vm, info) {
  14865. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  14866. // See: https://github.com/vuejs/vuex/issues/1505
  14867. pushTarget();
  14868. try {
  14869. if (vm) {
  14870. var cur = vm;
  14871. while ((cur = cur.$parent)) {
  14872. var hooks = cur.$options.errorCaptured;
  14873. if (hooks) {
  14874. for (var i = 0; i < hooks.length; i++) {
  14875. try {
  14876. var capture = hooks[i].call(cur, err, vm, info) === false;
  14877. if (capture) { return }
  14878. } catch (e) {
  14879. globalHandleError(e, cur, 'errorCaptured hook');
  14880. }
  14881. }
  14882. }
  14883. }
  14884. }
  14885. globalHandleError(err, vm, info);
  14886. } finally {
  14887. popTarget();
  14888. }
  14889. }
  14890. function invokeWithErrorHandling (
  14891. handler,
  14892. context,
  14893. args,
  14894. vm,
  14895. info
  14896. ) {
  14897. var res;
  14898. try {
  14899. res = args ? handler.apply(context, args) : handler.call(context);
  14900. if (res && !res._isVue && isPromise(res) && !res._handled) {
  14901. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  14902. // issue #9511
  14903. // avoid catch triggering multiple times when nested calls
  14904. res._handled = true;
  14905. }
  14906. } catch (e) {
  14907. handleError(e, vm, info);
  14908. }
  14909. return res
  14910. }
  14911. function globalHandleError (err, vm, info) {
  14912. if (config.errorHandler) {
  14913. try {
  14914. return config.errorHandler.call(null, err, vm, info)
  14915. } catch (e) {
  14916. // if the user intentionally throws the original error in the handler,
  14917. // do not log it twice
  14918. if (e !== err) {
  14919. logError(e, null, 'config.errorHandler');
  14920. }
  14921. }
  14922. }
  14923. logError(err, vm, info);
  14924. }
  14925. function logError (err, vm, info) {
  14926. if (true) {
  14927. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  14928. }
  14929. /* istanbul ignore else */
  14930. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  14931. console.error(err);
  14932. } else {
  14933. throw err
  14934. }
  14935. }
  14936. /* */
  14937. var callbacks = [];
  14938. var pending = false;
  14939. function flushCallbacks () {
  14940. pending = false;
  14941. var copies = callbacks.slice(0);
  14942. callbacks.length = 0;
  14943. for (var i = 0; i < copies.length; i++) {
  14944. copies[i]();
  14945. }
  14946. }
  14947. // Here we have async deferring wrappers using microtasks.
  14948. // In 2.5 we used (macro) tasks (in combination with microtasks).
  14949. // However, it has subtle problems when state is changed right before repaint
  14950. // (e.g. #6813, out-in transitions).
  14951. // Also, using (macro) tasks in event handler would cause some weird behaviors
  14952. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  14953. // So we now use microtasks everywhere, again.
  14954. // A major drawback of this tradeoff is that there are some scenarios
  14955. // where microtasks have too high a priority and fire in between supposedly
  14956. // sequential events (e.g. #4521, #6690, which have workarounds)
  14957. // or even between bubbling of the same event (#6566).
  14958. var timerFunc;
  14959. // The nextTick behavior leverages the microtask queue, which can be accessed
  14960. // via either native Promise.then or MutationObserver.
  14961. // MutationObserver has wider support, however it is seriously bugged in
  14962. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  14963. // completely stops working after triggering a few times... so, if native
  14964. // Promise is available, we will use it:
  14965. /* istanbul ignore next, $flow-disable-line */
  14966. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  14967. var p = Promise.resolve();
  14968. timerFunc = function () {
  14969. p.then(flushCallbacks);
  14970. // In problematic UIWebViews, Promise.then doesn't completely break, but
  14971. // it can get stuck in a weird state where callbacks are pushed into the
  14972. // microtask queue but the queue isn't being flushed, until the browser
  14973. // needs to do some other work, e.g. handle a timer. Therefore we can
  14974. // "force" the microtask queue to be flushed by adding an empty timer.
  14975. if (isIOS) { setTimeout(noop); }
  14976. };
  14977. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  14978. isNative(MutationObserver) ||
  14979. // PhantomJS and iOS 7.x
  14980. MutationObserver.toString() === '[object MutationObserverConstructor]'
  14981. )) {
  14982. // Use MutationObserver where native Promise is not available,
  14983. // e.g. PhantomJS, iOS7, Android 4.4
  14984. // (#6466 MutationObserver is unreliable in IE11)
  14985. var counter = 1;
  14986. var observer = new MutationObserver(flushCallbacks);
  14987. var textNode = document.createTextNode(String(counter));
  14988. observer.observe(textNode, {
  14989. characterData: true
  14990. });
  14991. timerFunc = function () {
  14992. counter = (counter + 1) % 2;
  14993. textNode.data = String(counter);
  14994. };
  14995. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  14996. // Fallback to setImmediate.
  14997. // Technically it leverages the (macro) task queue,
  14998. // but it is still a better choice than setTimeout.
  14999. timerFunc = function () {
  15000. setImmediate(flushCallbacks);
  15001. };
  15002. } else {
  15003. // Fallback to setTimeout.
  15004. timerFunc = function () {
  15005. setTimeout(flushCallbacks, 0);
  15006. };
  15007. }
  15008. function nextTick (cb, ctx) {
  15009. var _resolve;
  15010. callbacks.push(function () {
  15011. if (cb) {
  15012. try {
  15013. cb.call(ctx);
  15014. } catch (e) {
  15015. handleError(e, ctx, 'nextTick');
  15016. }
  15017. } else if (_resolve) {
  15018. _resolve(ctx);
  15019. }
  15020. });
  15021. if (!pending) {
  15022. pending = true;
  15023. timerFunc();
  15024. }
  15025. // $flow-disable-line
  15026. if (!cb && typeof Promise !== 'undefined') {
  15027. return new Promise(function (resolve) {
  15028. _resolve = resolve;
  15029. })
  15030. }
  15031. }
  15032. /* */
  15033. /* not type checking this file because flow doesn't play well with Proxy */
  15034. var initProxy;
  15035. if (true) {
  15036. var allowedGlobals = makeMap(
  15037. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  15038. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  15039. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  15040. 'require' // for Webpack/Browserify
  15041. );
  15042. var warnNonPresent = function (target, key) {
  15043. warn(
  15044. "Property or method \"" + key + "\" is not defined on the instance but " +
  15045. 'referenced during render. Make sure that this property is reactive, ' +
  15046. 'either in the data option, or for class-based components, by ' +
  15047. 'initializing the property. ' +
  15048. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  15049. target
  15050. );
  15051. };
  15052. var warnReservedPrefix = function (target, key) {
  15053. warn(
  15054. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  15055. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  15056. 'prevent conflicts with Vue internals. ' +
  15057. 'See: https://vuejs.org/v2/api/#data',
  15058. target
  15059. );
  15060. };
  15061. var hasProxy =
  15062. typeof Proxy !== 'undefined' && isNative(Proxy);
  15063. if (hasProxy) {
  15064. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  15065. config.keyCodes = new Proxy(config.keyCodes, {
  15066. set: function set (target, key, value) {
  15067. if (isBuiltInModifier(key)) {
  15068. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  15069. return false
  15070. } else {
  15071. target[key] = value;
  15072. return true
  15073. }
  15074. }
  15075. });
  15076. }
  15077. var hasHandler = {
  15078. has: function has (target, key) {
  15079. var has = key in target;
  15080. var isAllowed = allowedGlobals(key) ||
  15081. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  15082. if (!has && !isAllowed) {
  15083. if (key in target.$data) { warnReservedPrefix(target, key); }
  15084. else { warnNonPresent(target, key); }
  15085. }
  15086. return has || !isAllowed
  15087. }
  15088. };
  15089. var getHandler = {
  15090. get: function get (target, key) {
  15091. if (typeof key === 'string' && !(key in target)) {
  15092. if (key in target.$data) { warnReservedPrefix(target, key); }
  15093. else { warnNonPresent(target, key); }
  15094. }
  15095. return target[key]
  15096. }
  15097. };
  15098. initProxy = function initProxy (vm) {
  15099. if (hasProxy) {
  15100. // determine which proxy handler to use
  15101. var options = vm.$options;
  15102. var handlers = options.render && options.render._withStripped
  15103. ? getHandler
  15104. : hasHandler;
  15105. vm._renderProxy = new Proxy(vm, handlers);
  15106. } else {
  15107. vm._renderProxy = vm;
  15108. }
  15109. };
  15110. }
  15111. /* */
  15112. var seenObjects = new _Set();
  15113. /**
  15114. * Recursively traverse an object to evoke all converted
  15115. * getters, so that every nested property inside the object
  15116. * is collected as a "deep" dependency.
  15117. */
  15118. function traverse (val) {
  15119. _traverse(val, seenObjects);
  15120. seenObjects.clear();
  15121. }
  15122. function _traverse (val, seen) {
  15123. var i, keys;
  15124. var isA = Array.isArray(val);
  15125. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  15126. return
  15127. }
  15128. if (val.__ob__) {
  15129. var depId = val.__ob__.dep.id;
  15130. if (seen.has(depId)) {
  15131. return
  15132. }
  15133. seen.add(depId);
  15134. }
  15135. if (isA) {
  15136. i = val.length;
  15137. while (i--) { _traverse(val[i], seen); }
  15138. } else {
  15139. keys = Object.keys(val);
  15140. i = keys.length;
  15141. while (i--) { _traverse(val[keys[i]], seen); }
  15142. }
  15143. }
  15144. var mark;
  15145. var measure;
  15146. if (true) {
  15147. var perf = inBrowser && window.performance;
  15148. /* istanbul ignore if */
  15149. if (
  15150. perf &&
  15151. perf.mark &&
  15152. perf.measure &&
  15153. perf.clearMarks &&
  15154. perf.clearMeasures
  15155. ) {
  15156. mark = function (tag) { return perf.mark(tag); };
  15157. measure = function (name, startTag, endTag) {
  15158. perf.measure(name, startTag, endTag);
  15159. perf.clearMarks(startTag);
  15160. perf.clearMarks(endTag);
  15161. // perf.clearMeasures(name)
  15162. };
  15163. }
  15164. }
  15165. /* */
  15166. var normalizeEvent = cached(function (name) {
  15167. var passive = name.charAt(0) === '&';
  15168. name = passive ? name.slice(1) : name;
  15169. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  15170. name = once$$1 ? name.slice(1) : name;
  15171. var capture = name.charAt(0) === '!';
  15172. name = capture ? name.slice(1) : name;
  15173. return {
  15174. name: name,
  15175. once: once$$1,
  15176. capture: capture,
  15177. passive: passive
  15178. }
  15179. });
  15180. function createFnInvoker (fns, vm) {
  15181. function invoker () {
  15182. var arguments$1 = arguments;
  15183. var fns = invoker.fns;
  15184. if (Array.isArray(fns)) {
  15185. var cloned = fns.slice();
  15186. for (var i = 0; i < cloned.length; i++) {
  15187. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  15188. }
  15189. } else {
  15190. // return handler return value for single handlers
  15191. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  15192. }
  15193. }
  15194. invoker.fns = fns;
  15195. return invoker
  15196. }
  15197. function updateListeners (
  15198. on,
  15199. oldOn,
  15200. add,
  15201. remove$$1,
  15202. createOnceHandler,
  15203. vm
  15204. ) {
  15205. var name, def$$1, cur, old, event;
  15206. for (name in on) {
  15207. def$$1 = cur = on[name];
  15208. old = oldOn[name];
  15209. event = normalizeEvent(name);
  15210. if (isUndef(cur)) {
  15211. true && warn(
  15212. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  15213. vm
  15214. );
  15215. } else if (isUndef(old)) {
  15216. if (isUndef(cur.fns)) {
  15217. cur = on[name] = createFnInvoker(cur, vm);
  15218. }
  15219. if (isTrue(event.once)) {
  15220. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  15221. }
  15222. add(event.name, cur, event.capture, event.passive, event.params);
  15223. } else if (cur !== old) {
  15224. old.fns = cur;
  15225. on[name] = old;
  15226. }
  15227. }
  15228. for (name in oldOn) {
  15229. if (isUndef(on[name])) {
  15230. event = normalizeEvent(name);
  15231. remove$$1(event.name, oldOn[name], event.capture);
  15232. }
  15233. }
  15234. }
  15235. /* */
  15236. /* */
  15237. // fixed by xxxxxx (mp properties)
  15238. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  15239. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  15240. if (isUndef(propOptions)) {
  15241. return res
  15242. }
  15243. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  15244. var attrs = data.attrs;
  15245. var props = data.props;
  15246. if (isDef(attrs) || isDef(props)) {
  15247. for (var key in propOptions) {
  15248. var altKey = hyphenate(key);
  15249. var result = checkProp(res, props, key, altKey, true) ||
  15250. checkProp(res, attrs, key, altKey, false);
  15251. // externalClass
  15252. if (
  15253. result &&
  15254. res[key] &&
  15255. externalClasses.indexOf(altKey) !== -1 &&
  15256. context[camelize(res[key])]
  15257. ) {
  15258. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  15259. res[key] = context[camelize(res[key])];
  15260. }
  15261. }
  15262. }
  15263. return res
  15264. }
  15265. function extractPropsFromVNodeData (
  15266. data,
  15267. Ctor,
  15268. tag,
  15269. context// fixed by xxxxxx
  15270. ) {
  15271. // we are only extracting raw values here.
  15272. // validation and default values are handled in the child
  15273. // component itself.
  15274. var propOptions = Ctor.options.props;
  15275. if (isUndef(propOptions)) {
  15276. // fixed by xxxxxx
  15277. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  15278. }
  15279. var res = {};
  15280. var attrs = data.attrs;
  15281. var props = data.props;
  15282. if (isDef(attrs) || isDef(props)) {
  15283. for (var key in propOptions) {
  15284. var altKey = hyphenate(key);
  15285. if (true) {
  15286. var keyInLowerCase = key.toLowerCase();
  15287. if (
  15288. key !== keyInLowerCase &&
  15289. attrs && hasOwn(attrs, keyInLowerCase)
  15290. ) {
  15291. tip(
  15292. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  15293. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  15294. " \"" + key + "\". " +
  15295. "Note that HTML attributes are case-insensitive and camelCased " +
  15296. "props need to use their kebab-case equivalents when using in-DOM " +
  15297. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  15298. );
  15299. }
  15300. }
  15301. checkProp(res, props, key, altKey, true) ||
  15302. checkProp(res, attrs, key, altKey, false);
  15303. }
  15304. }
  15305. // fixed by xxxxxx
  15306. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  15307. }
  15308. function checkProp (
  15309. res,
  15310. hash,
  15311. key,
  15312. altKey,
  15313. preserve
  15314. ) {
  15315. if (isDef(hash)) {
  15316. if (hasOwn(hash, key)) {
  15317. res[key] = hash[key];
  15318. if (!preserve) {
  15319. delete hash[key];
  15320. }
  15321. return true
  15322. } else if (hasOwn(hash, altKey)) {
  15323. res[key] = hash[altKey];
  15324. if (!preserve) {
  15325. delete hash[altKey];
  15326. }
  15327. return true
  15328. }
  15329. }
  15330. return false
  15331. }
  15332. /* */
  15333. // The template compiler attempts to minimize the need for normalization by
  15334. // statically analyzing the template at compile time.
  15335. //
  15336. // For plain HTML markup, normalization can be completely skipped because the
  15337. // generated render function is guaranteed to return Array<VNode>. There are
  15338. // two cases where extra normalization is needed:
  15339. // 1. When the children contains components - because a functional component
  15340. // may return an Array instead of a single root. In this case, just a simple
  15341. // normalization is needed - if any child is an Array, we flatten the whole
  15342. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  15343. // because functional components already normalize their own children.
  15344. function simpleNormalizeChildren (children) {
  15345. for (var i = 0; i < children.length; i++) {
  15346. if (Array.isArray(children[i])) {
  15347. return Array.prototype.concat.apply([], children)
  15348. }
  15349. }
  15350. return children
  15351. }
  15352. // 2. When the children contains constructs that always generated nested Arrays,
  15353. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  15354. // with hand-written render functions / JSX. In such cases a full normalization
  15355. // is needed to cater to all possible types of children values.
  15356. function normalizeChildren (children) {
  15357. return isPrimitive(children)
  15358. ? [createTextVNode(children)]
  15359. : Array.isArray(children)
  15360. ? normalizeArrayChildren(children)
  15361. : undefined
  15362. }
  15363. function isTextNode (node) {
  15364. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  15365. }
  15366. function normalizeArrayChildren (children, nestedIndex) {
  15367. var res = [];
  15368. var i, c, lastIndex, last;
  15369. for (i = 0; i < children.length; i++) {
  15370. c = children[i];
  15371. if (isUndef(c) || typeof c === 'boolean') { continue }
  15372. lastIndex = res.length - 1;
  15373. last = res[lastIndex];
  15374. // nested
  15375. if (Array.isArray(c)) {
  15376. if (c.length > 0) {
  15377. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  15378. // merge adjacent text nodes
  15379. if (isTextNode(c[0]) && isTextNode(last)) {
  15380. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  15381. c.shift();
  15382. }
  15383. res.push.apply(res, c);
  15384. }
  15385. } else if (isPrimitive(c)) {
  15386. if (isTextNode(last)) {
  15387. // merge adjacent text nodes
  15388. // this is necessary for SSR hydration because text nodes are
  15389. // essentially merged when rendered to HTML strings
  15390. res[lastIndex] = createTextVNode(last.text + c);
  15391. } else if (c !== '') {
  15392. // convert primitive to vnode
  15393. res.push(createTextVNode(c));
  15394. }
  15395. } else {
  15396. if (isTextNode(c) && isTextNode(last)) {
  15397. // merge adjacent text nodes
  15398. res[lastIndex] = createTextVNode(last.text + c.text);
  15399. } else {
  15400. // default key for nested array children (likely generated by v-for)
  15401. if (isTrue(children._isVList) &&
  15402. isDef(c.tag) &&
  15403. isUndef(c.key) &&
  15404. isDef(nestedIndex)) {
  15405. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  15406. }
  15407. res.push(c);
  15408. }
  15409. }
  15410. }
  15411. return res
  15412. }
  15413. /* */
  15414. function initProvide (vm) {
  15415. var provide = vm.$options.provide;
  15416. if (provide) {
  15417. vm._provided = typeof provide === 'function'
  15418. ? provide.call(vm)
  15419. : provide;
  15420. }
  15421. }
  15422. function initInjections (vm) {
  15423. var result = resolveInject(vm.$options.inject, vm);
  15424. if (result) {
  15425. toggleObserving(false);
  15426. Object.keys(result).forEach(function (key) {
  15427. /* istanbul ignore else */
  15428. if (true) {
  15429. defineReactive$$1(vm, key, result[key], function () {
  15430. warn(
  15431. "Avoid mutating an injected value directly since the changes will be " +
  15432. "overwritten whenever the provided component re-renders. " +
  15433. "injection being mutated: \"" + key + "\"",
  15434. vm
  15435. );
  15436. });
  15437. } else {}
  15438. });
  15439. toggleObserving(true);
  15440. }
  15441. }
  15442. function resolveInject (inject, vm) {
  15443. if (inject) {
  15444. // inject is :any because flow is not smart enough to figure out cached
  15445. var result = Object.create(null);
  15446. var keys = hasSymbol
  15447. ? Reflect.ownKeys(inject)
  15448. : Object.keys(inject);
  15449. for (var i = 0; i < keys.length; i++) {
  15450. var key = keys[i];
  15451. // #6574 in case the inject object is observed...
  15452. if (key === '__ob__') { continue }
  15453. var provideKey = inject[key].from;
  15454. var source = vm;
  15455. while (source) {
  15456. if (source._provided && hasOwn(source._provided, provideKey)) {
  15457. result[key] = source._provided[provideKey];
  15458. break
  15459. }
  15460. source = source.$parent;
  15461. }
  15462. if (!source) {
  15463. if ('default' in inject[key]) {
  15464. var provideDefault = inject[key].default;
  15465. result[key] = typeof provideDefault === 'function'
  15466. ? provideDefault.call(vm)
  15467. : provideDefault;
  15468. } else if (true) {
  15469. warn(("Injection \"" + key + "\" not found"), vm);
  15470. }
  15471. }
  15472. }
  15473. return result
  15474. }
  15475. }
  15476. /* */
  15477. /**
  15478. * Runtime helper for resolving raw children VNodes into a slot object.
  15479. */
  15480. function resolveSlots (
  15481. children,
  15482. context
  15483. ) {
  15484. if (!children || !children.length) {
  15485. return {}
  15486. }
  15487. var slots = {};
  15488. for (var i = 0, l = children.length; i < l; i++) {
  15489. var child = children[i];
  15490. var data = child.data;
  15491. // remove slot attribute if the node is resolved as a Vue slot node
  15492. if (data && data.attrs && data.attrs.slot) {
  15493. delete data.attrs.slot;
  15494. }
  15495. // named slots should only be respected if the vnode was rendered in the
  15496. // same context.
  15497. if ((child.context === context || child.fnContext === context) &&
  15498. data && data.slot != null
  15499. ) {
  15500. var name = data.slot;
  15501. var slot = (slots[name] || (slots[name] = []));
  15502. if (child.tag === 'template') {
  15503. slot.push.apply(slot, child.children || []);
  15504. } else {
  15505. slot.push(child);
  15506. }
  15507. } else {
  15508. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  15509. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  15510. (slots['page'] || (slots['page'] = [])).push(child);
  15511. }else{
  15512. (slots.default || (slots.default = [])).push(child);
  15513. }
  15514. }
  15515. }
  15516. // ignore slots that contains only whitespace
  15517. for (var name$1 in slots) {
  15518. if (slots[name$1].every(isWhitespace)) {
  15519. delete slots[name$1];
  15520. }
  15521. }
  15522. return slots
  15523. }
  15524. function isWhitespace (node) {
  15525. return (node.isComment && !node.asyncFactory) || node.text === ' '
  15526. }
  15527. /* */
  15528. function normalizeScopedSlots (
  15529. slots,
  15530. normalSlots,
  15531. prevSlots
  15532. ) {
  15533. var res;
  15534. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  15535. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  15536. var key = slots && slots.$key;
  15537. if (!slots) {
  15538. res = {};
  15539. } else if (slots._normalized) {
  15540. // fast path 1: child component re-render only, parent did not change
  15541. return slots._normalized
  15542. } else if (
  15543. isStable &&
  15544. prevSlots &&
  15545. prevSlots !== emptyObject &&
  15546. key === prevSlots.$key &&
  15547. !hasNormalSlots &&
  15548. !prevSlots.$hasNormal
  15549. ) {
  15550. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  15551. // only need to normalize once
  15552. return prevSlots
  15553. } else {
  15554. res = {};
  15555. for (var key$1 in slots) {
  15556. if (slots[key$1] && key$1[0] !== '$') {
  15557. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  15558. }
  15559. }
  15560. }
  15561. // expose normal slots on scopedSlots
  15562. for (var key$2 in normalSlots) {
  15563. if (!(key$2 in res)) {
  15564. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  15565. }
  15566. }
  15567. // avoriaz seems to mock a non-extensible $scopedSlots object
  15568. // and when that is passed down this would cause an error
  15569. if (slots && Object.isExtensible(slots)) {
  15570. (slots)._normalized = res;
  15571. }
  15572. def(res, '$stable', isStable);
  15573. def(res, '$key', key);
  15574. def(res, '$hasNormal', hasNormalSlots);
  15575. return res
  15576. }
  15577. function normalizeScopedSlot(normalSlots, key, fn) {
  15578. var normalized = function () {
  15579. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  15580. res = res && typeof res === 'object' && !Array.isArray(res)
  15581. ? [res] // single vnode
  15582. : normalizeChildren(res);
  15583. return res && (
  15584. res.length === 0 ||
  15585. (res.length === 1 && res[0].isComment) // #9658
  15586. ) ? undefined
  15587. : res
  15588. };
  15589. // this is a slot using the new v-slot syntax without scope. although it is
  15590. // compiled as a scoped slot, render fn users would expect it to be present
  15591. // on this.$slots because the usage is semantically a normal slot.
  15592. if (fn.proxy) {
  15593. Object.defineProperty(normalSlots, key, {
  15594. get: normalized,
  15595. enumerable: true,
  15596. configurable: true
  15597. });
  15598. }
  15599. return normalized
  15600. }
  15601. function proxyNormalSlot(slots, key) {
  15602. return function () { return slots[key]; }
  15603. }
  15604. /* */
  15605. /**
  15606. * Runtime helper for rendering v-for lists.
  15607. */
  15608. function renderList (
  15609. val,
  15610. render
  15611. ) {
  15612. var ret, i, l, keys, key;
  15613. if (Array.isArray(val) || typeof val === 'string') {
  15614. ret = new Array(val.length);
  15615. for (i = 0, l = val.length; i < l; i++) {
  15616. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  15617. }
  15618. } else if (typeof val === 'number') {
  15619. ret = new Array(val);
  15620. for (i = 0; i < val; i++) {
  15621. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  15622. }
  15623. } else if (isObject(val)) {
  15624. if (hasSymbol && val[Symbol.iterator]) {
  15625. ret = [];
  15626. var iterator = val[Symbol.iterator]();
  15627. var result = iterator.next();
  15628. while (!result.done) {
  15629. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  15630. result = iterator.next();
  15631. }
  15632. } else {
  15633. keys = Object.keys(val);
  15634. ret = new Array(keys.length);
  15635. for (i = 0, l = keys.length; i < l; i++) {
  15636. key = keys[i];
  15637. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  15638. }
  15639. }
  15640. }
  15641. if (!isDef(ret)) {
  15642. ret = [];
  15643. }
  15644. (ret)._isVList = true;
  15645. return ret
  15646. }
  15647. /* */
  15648. /**
  15649. * Runtime helper for rendering <slot>
  15650. */
  15651. function renderSlot (
  15652. name,
  15653. fallback,
  15654. props,
  15655. bindObject
  15656. ) {
  15657. var scopedSlotFn = this.$scopedSlots[name];
  15658. var nodes;
  15659. if (scopedSlotFn) { // scoped slot
  15660. props = props || {};
  15661. if (bindObject) {
  15662. if ( true && !isObject(bindObject)) {
  15663. warn(
  15664. 'slot v-bind without argument expects an Object',
  15665. this
  15666. );
  15667. }
  15668. props = extend(extend({}, bindObject), props);
  15669. }
  15670. // fixed by xxxxxx app-plus scopedSlot
  15671. nodes = scopedSlotFn(props, this, props._i) || fallback;
  15672. } else {
  15673. nodes = this.$slots[name] || fallback;
  15674. }
  15675. var target = props && props.slot;
  15676. if (target) {
  15677. return this.$createElement('template', { slot: target }, nodes)
  15678. } else {
  15679. return nodes
  15680. }
  15681. }
  15682. /* */
  15683. /**
  15684. * Runtime helper for resolving filters
  15685. */
  15686. function resolveFilter (id) {
  15687. return resolveAsset(this.$options, 'filters', id, true) || identity
  15688. }
  15689. /* */
  15690. function isKeyNotMatch (expect, actual) {
  15691. if (Array.isArray(expect)) {
  15692. return expect.indexOf(actual) === -1
  15693. } else {
  15694. return expect !== actual
  15695. }
  15696. }
  15697. /**
  15698. * Runtime helper for checking keyCodes from config.
  15699. * exposed as Vue.prototype._k
  15700. * passing in eventKeyName as last argument separately for backwards compat
  15701. */
  15702. function checkKeyCodes (
  15703. eventKeyCode,
  15704. key,
  15705. builtInKeyCode,
  15706. eventKeyName,
  15707. builtInKeyName
  15708. ) {
  15709. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  15710. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  15711. return isKeyNotMatch(builtInKeyName, eventKeyName)
  15712. } else if (mappedKeyCode) {
  15713. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  15714. } else if (eventKeyName) {
  15715. return hyphenate(eventKeyName) !== key
  15716. }
  15717. }
  15718. /* */
  15719. /**
  15720. * Runtime helper for merging v-bind="object" into a VNode's data.
  15721. */
  15722. function bindObjectProps (
  15723. data,
  15724. tag,
  15725. value,
  15726. asProp,
  15727. isSync
  15728. ) {
  15729. if (value) {
  15730. if (!isObject(value)) {
  15731. true && warn(
  15732. 'v-bind without argument expects an Object or Array value',
  15733. this
  15734. );
  15735. } else {
  15736. if (Array.isArray(value)) {
  15737. value = toObject(value);
  15738. }
  15739. var hash;
  15740. var loop = function ( key ) {
  15741. if (
  15742. key === 'class' ||
  15743. key === 'style' ||
  15744. isReservedAttribute(key)
  15745. ) {
  15746. hash = data;
  15747. } else {
  15748. var type = data.attrs && data.attrs.type;
  15749. hash = asProp || config.mustUseProp(tag, type, key)
  15750. ? data.domProps || (data.domProps = {})
  15751. : data.attrs || (data.attrs = {});
  15752. }
  15753. var camelizedKey = camelize(key);
  15754. var hyphenatedKey = hyphenate(key);
  15755. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  15756. hash[key] = value[key];
  15757. if (isSync) {
  15758. var on = data.on || (data.on = {});
  15759. on[("update:" + key)] = function ($event) {
  15760. value[key] = $event;
  15761. };
  15762. }
  15763. }
  15764. };
  15765. for (var key in value) loop( key );
  15766. }
  15767. }
  15768. return data
  15769. }
  15770. /* */
  15771. /**
  15772. * Runtime helper for rendering static trees.
  15773. */
  15774. function renderStatic (
  15775. index,
  15776. isInFor
  15777. ) {
  15778. var cached = this._staticTrees || (this._staticTrees = []);
  15779. var tree = cached[index];
  15780. // if has already-rendered static tree and not inside v-for,
  15781. // we can reuse the same tree.
  15782. if (tree && !isInFor) {
  15783. return tree
  15784. }
  15785. // otherwise, render a fresh tree.
  15786. tree = cached[index] = this.$options.staticRenderFns[index].call(
  15787. this._renderProxy,
  15788. null,
  15789. this // for render fns generated for functional component templates
  15790. );
  15791. markStatic(tree, ("__static__" + index), false);
  15792. return tree
  15793. }
  15794. /**
  15795. * Runtime helper for v-once.
  15796. * Effectively it means marking the node as static with a unique key.
  15797. */
  15798. function markOnce (
  15799. tree,
  15800. index,
  15801. key
  15802. ) {
  15803. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  15804. return tree
  15805. }
  15806. function markStatic (
  15807. tree,
  15808. key,
  15809. isOnce
  15810. ) {
  15811. if (Array.isArray(tree)) {
  15812. for (var i = 0; i < tree.length; i++) {
  15813. if (tree[i] && typeof tree[i] !== 'string') {
  15814. markStaticNode(tree[i], (key + "_" + i), isOnce);
  15815. }
  15816. }
  15817. } else {
  15818. markStaticNode(tree, key, isOnce);
  15819. }
  15820. }
  15821. function markStaticNode (node, key, isOnce) {
  15822. node.isStatic = true;
  15823. node.key = key;
  15824. node.isOnce = isOnce;
  15825. }
  15826. /* */
  15827. function bindObjectListeners (data, value) {
  15828. if (value) {
  15829. if (!isPlainObject(value)) {
  15830. true && warn(
  15831. 'v-on without argument expects an Object value',
  15832. this
  15833. );
  15834. } else {
  15835. var on = data.on = data.on ? extend({}, data.on) : {};
  15836. for (var key in value) {
  15837. var existing = on[key];
  15838. var ours = value[key];
  15839. on[key] = existing ? [].concat(existing, ours) : ours;
  15840. }
  15841. }
  15842. }
  15843. return data
  15844. }
  15845. /* */
  15846. function resolveScopedSlots (
  15847. fns, // see flow/vnode
  15848. res,
  15849. // the following are added in 2.6
  15850. hasDynamicKeys,
  15851. contentHashKey
  15852. ) {
  15853. res = res || { $stable: !hasDynamicKeys };
  15854. for (var i = 0; i < fns.length; i++) {
  15855. var slot = fns[i];
  15856. if (Array.isArray(slot)) {
  15857. resolveScopedSlots(slot, res, hasDynamicKeys);
  15858. } else if (slot) {
  15859. // marker for reverse proxying v-slot without scope on this.$slots
  15860. if (slot.proxy) {
  15861. slot.fn.proxy = true;
  15862. }
  15863. res[slot.key] = slot.fn;
  15864. }
  15865. }
  15866. if (contentHashKey) {
  15867. (res).$key = contentHashKey;
  15868. }
  15869. return res
  15870. }
  15871. /* */
  15872. function bindDynamicKeys (baseObj, values) {
  15873. for (var i = 0; i < values.length; i += 2) {
  15874. var key = values[i];
  15875. if (typeof key === 'string' && key) {
  15876. baseObj[values[i]] = values[i + 1];
  15877. } else if ( true && key !== '' && key !== null) {
  15878. // null is a special value for explicitly removing a binding
  15879. warn(
  15880. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  15881. this
  15882. );
  15883. }
  15884. }
  15885. return baseObj
  15886. }
  15887. // helper to dynamically append modifier runtime markers to event names.
  15888. // ensure only append when value is already string, otherwise it will be cast
  15889. // to string and cause the type check to miss.
  15890. function prependModifier (value, symbol) {
  15891. return typeof value === 'string' ? symbol + value : value
  15892. }
  15893. /* */
  15894. function installRenderHelpers (target) {
  15895. target._o = markOnce;
  15896. target._n = toNumber;
  15897. target._s = toString;
  15898. target._l = renderList;
  15899. target._t = renderSlot;
  15900. target._q = looseEqual;
  15901. target._i = looseIndexOf;
  15902. target._m = renderStatic;
  15903. target._f = resolveFilter;
  15904. target._k = checkKeyCodes;
  15905. target._b = bindObjectProps;
  15906. target._v = createTextVNode;
  15907. target._e = createEmptyVNode;
  15908. target._u = resolveScopedSlots;
  15909. target._g = bindObjectListeners;
  15910. target._d = bindDynamicKeys;
  15911. target._p = prependModifier;
  15912. }
  15913. /* */
  15914. function FunctionalRenderContext (
  15915. data,
  15916. props,
  15917. children,
  15918. parent,
  15919. Ctor
  15920. ) {
  15921. var this$1 = this;
  15922. var options = Ctor.options;
  15923. // ensure the createElement function in functional components
  15924. // gets a unique context - this is necessary for correct named slot check
  15925. var contextVm;
  15926. if (hasOwn(parent, '_uid')) {
  15927. contextVm = Object.create(parent);
  15928. // $flow-disable-line
  15929. contextVm._original = parent;
  15930. } else {
  15931. // the context vm passed in is a functional context as well.
  15932. // in this case we want to make sure we are able to get a hold to the
  15933. // real context instance.
  15934. contextVm = parent;
  15935. // $flow-disable-line
  15936. parent = parent._original;
  15937. }
  15938. var isCompiled = isTrue(options._compiled);
  15939. var needNormalization = !isCompiled;
  15940. this.data = data;
  15941. this.props = props;
  15942. this.children = children;
  15943. this.parent = parent;
  15944. this.listeners = data.on || emptyObject;
  15945. this.injections = resolveInject(options.inject, parent);
  15946. this.slots = function () {
  15947. if (!this$1.$slots) {
  15948. normalizeScopedSlots(
  15949. data.scopedSlots,
  15950. this$1.$slots = resolveSlots(children, parent)
  15951. );
  15952. }
  15953. return this$1.$slots
  15954. };
  15955. Object.defineProperty(this, 'scopedSlots', ({
  15956. enumerable: true,
  15957. get: function get () {
  15958. return normalizeScopedSlots(data.scopedSlots, this.slots())
  15959. }
  15960. }));
  15961. // support for compiled functional template
  15962. if (isCompiled) {
  15963. // exposing $options for renderStatic()
  15964. this.$options = options;
  15965. // pre-resolve slots for renderSlot()
  15966. this.$slots = this.slots();
  15967. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  15968. }
  15969. if (options._scopeId) {
  15970. this._c = function (a, b, c, d) {
  15971. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  15972. if (vnode && !Array.isArray(vnode)) {
  15973. vnode.fnScopeId = options._scopeId;
  15974. vnode.fnContext = parent;
  15975. }
  15976. return vnode
  15977. };
  15978. } else {
  15979. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  15980. }
  15981. }
  15982. installRenderHelpers(FunctionalRenderContext.prototype);
  15983. function createFunctionalComponent (
  15984. Ctor,
  15985. propsData,
  15986. data,
  15987. contextVm,
  15988. children
  15989. ) {
  15990. var options = Ctor.options;
  15991. var props = {};
  15992. var propOptions = options.props;
  15993. if (isDef(propOptions)) {
  15994. for (var key in propOptions) {
  15995. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  15996. }
  15997. } else {
  15998. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  15999. if (isDef(data.props)) { mergeProps(props, data.props); }
  16000. }
  16001. var renderContext = new FunctionalRenderContext(
  16002. data,
  16003. props,
  16004. children,
  16005. contextVm,
  16006. Ctor
  16007. );
  16008. var vnode = options.render.call(null, renderContext._c, renderContext);
  16009. if (vnode instanceof VNode) {
  16010. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  16011. } else if (Array.isArray(vnode)) {
  16012. var vnodes = normalizeChildren(vnode) || [];
  16013. var res = new Array(vnodes.length);
  16014. for (var i = 0; i < vnodes.length; i++) {
  16015. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  16016. }
  16017. return res
  16018. }
  16019. }
  16020. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  16021. // #7817 clone node before setting fnContext, otherwise if the node is reused
  16022. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  16023. // that should not be matched to match.
  16024. var clone = cloneVNode(vnode);
  16025. clone.fnContext = contextVm;
  16026. clone.fnOptions = options;
  16027. if (true) {
  16028. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  16029. }
  16030. if (data.slot) {
  16031. (clone.data || (clone.data = {})).slot = data.slot;
  16032. }
  16033. return clone
  16034. }
  16035. function mergeProps (to, from) {
  16036. for (var key in from) {
  16037. to[camelize(key)] = from[key];
  16038. }
  16039. }
  16040. /* */
  16041. /* */
  16042. /* */
  16043. /* */
  16044. // inline hooks to be invoked on component VNodes during patch
  16045. var componentVNodeHooks = {
  16046. init: function init (vnode, hydrating) {
  16047. if (
  16048. vnode.componentInstance &&
  16049. !vnode.componentInstance._isDestroyed &&
  16050. vnode.data.keepAlive
  16051. ) {
  16052. // kept-alive components, treat as a patch
  16053. var mountedNode = vnode; // work around flow
  16054. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  16055. } else {
  16056. var child = vnode.componentInstance = createComponentInstanceForVnode(
  16057. vnode,
  16058. activeInstance
  16059. );
  16060. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  16061. }
  16062. },
  16063. prepatch: function prepatch (oldVnode, vnode) {
  16064. var options = vnode.componentOptions;
  16065. var child = vnode.componentInstance = oldVnode.componentInstance;
  16066. updateChildComponent(
  16067. child,
  16068. options.propsData, // updated props
  16069. options.listeners, // updated listeners
  16070. vnode, // new parent vnode
  16071. options.children // new children
  16072. );
  16073. },
  16074. insert: function insert (vnode) {
  16075. var context = vnode.context;
  16076. var componentInstance = vnode.componentInstance;
  16077. if (!componentInstance._isMounted) {
  16078. callHook(componentInstance, 'onServiceCreated');
  16079. callHook(componentInstance, 'onServiceAttached');
  16080. componentInstance._isMounted = true;
  16081. callHook(componentInstance, 'mounted');
  16082. }
  16083. if (vnode.data.keepAlive) {
  16084. if (context._isMounted) {
  16085. // vue-router#1212
  16086. // During updates, a kept-alive component's child components may
  16087. // change, so directly walking the tree here may call activated hooks
  16088. // on incorrect children. Instead we push them into a queue which will
  16089. // be processed after the whole patch process ended.
  16090. queueActivatedComponent(componentInstance);
  16091. } else {
  16092. activateChildComponent(componentInstance, true /* direct */);
  16093. }
  16094. }
  16095. },
  16096. destroy: function destroy (vnode) {
  16097. var componentInstance = vnode.componentInstance;
  16098. if (!componentInstance._isDestroyed) {
  16099. if (!vnode.data.keepAlive) {
  16100. componentInstance.$destroy();
  16101. } else {
  16102. deactivateChildComponent(componentInstance, true /* direct */);
  16103. }
  16104. }
  16105. }
  16106. };
  16107. var hooksToMerge = Object.keys(componentVNodeHooks);
  16108. function createComponent (
  16109. Ctor,
  16110. data,
  16111. context,
  16112. children,
  16113. tag
  16114. ) {
  16115. if (isUndef(Ctor)) {
  16116. return
  16117. }
  16118. var baseCtor = context.$options._base;
  16119. // plain options object: turn it into a constructor
  16120. if (isObject(Ctor)) {
  16121. Ctor = baseCtor.extend(Ctor);
  16122. }
  16123. // if at this stage it's not a constructor or an async component factory,
  16124. // reject.
  16125. if (typeof Ctor !== 'function') {
  16126. if (true) {
  16127. warn(("Invalid Component definition: " + (String(Ctor))), context);
  16128. }
  16129. return
  16130. }
  16131. // async component
  16132. var asyncFactory;
  16133. if (isUndef(Ctor.cid)) {
  16134. asyncFactory = Ctor;
  16135. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  16136. if (Ctor === undefined) {
  16137. // return a placeholder node for async component, which is rendered
  16138. // as a comment node but preserves all the raw information for the node.
  16139. // the information will be used for async server-rendering and hydration.
  16140. return createAsyncPlaceholder(
  16141. asyncFactory,
  16142. data,
  16143. context,
  16144. children,
  16145. tag
  16146. )
  16147. }
  16148. }
  16149. data = data || {};
  16150. // resolve constructor options in case global mixins are applied after
  16151. // component constructor creation
  16152. resolveConstructorOptions(Ctor);
  16153. // transform component v-model data into props & events
  16154. if (isDef(data.model)) {
  16155. transformModel(Ctor.options, data);
  16156. }
  16157. // extract props
  16158. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  16159. // functional component
  16160. if (isTrue(Ctor.options.functional)) {
  16161. return createFunctionalComponent(Ctor, propsData, data, context, children)
  16162. }
  16163. // extract listeners, since these needs to be treated as
  16164. // child component listeners instead of DOM listeners
  16165. var listeners = data.on;
  16166. // replace with listeners with .native modifier
  16167. // so it gets processed during parent component patch.
  16168. data.on = data.nativeOn;
  16169. if (isTrue(Ctor.options.abstract)) {
  16170. // abstract components do not keep anything
  16171. // other than props & listeners & slot
  16172. // work around flow
  16173. var slot = data.slot;
  16174. data = {};
  16175. if (slot) {
  16176. data.slot = slot;
  16177. }
  16178. }
  16179. // install component management hooks onto the placeholder node
  16180. installComponentHooks(data);
  16181. // return a placeholder vnode
  16182. var name = Ctor.options.name || tag;
  16183. var vnode = new VNode(
  16184. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  16185. data, undefined, undefined, undefined, context,
  16186. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  16187. asyncFactory
  16188. );
  16189. return vnode
  16190. }
  16191. function createComponentInstanceForVnode (
  16192. vnode, // we know it's MountedComponentVNode but flow doesn't
  16193. parent // activeInstance in lifecycle state
  16194. ) {
  16195. var options = {
  16196. _isComponent: true,
  16197. _parentVnode: vnode,
  16198. parent: parent
  16199. };
  16200. // check inline-template render functions
  16201. var inlineTemplate = vnode.data.inlineTemplate;
  16202. if (isDef(inlineTemplate)) {
  16203. options.render = inlineTemplate.render;
  16204. options.staticRenderFns = inlineTemplate.staticRenderFns;
  16205. }
  16206. return new vnode.componentOptions.Ctor(options)
  16207. }
  16208. function installComponentHooks (data) {
  16209. var hooks = data.hook || (data.hook = {});
  16210. for (var i = 0; i < hooksToMerge.length; i++) {
  16211. var key = hooksToMerge[i];
  16212. var existing = hooks[key];
  16213. var toMerge = componentVNodeHooks[key];
  16214. if (existing !== toMerge && !(existing && existing._merged)) {
  16215. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  16216. }
  16217. }
  16218. }
  16219. function mergeHook$1 (f1, f2) {
  16220. var merged = function (a, b) {
  16221. // flow complains about extra args which is why we use any
  16222. f1(a, b);
  16223. f2(a, b);
  16224. };
  16225. merged._merged = true;
  16226. return merged
  16227. }
  16228. // transform component v-model info (value and callback) into
  16229. // prop and event handler respectively.
  16230. function transformModel (options, data) {
  16231. var prop = (options.model && options.model.prop) || 'value';
  16232. var event = (options.model && options.model.event) || 'input'
  16233. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  16234. var on = data.on || (data.on = {});
  16235. var existing = on[event];
  16236. var callback = data.model.callback;
  16237. if (isDef(existing)) {
  16238. if (
  16239. Array.isArray(existing)
  16240. ? existing.indexOf(callback) === -1
  16241. : existing !== callback
  16242. ) {
  16243. on[event] = [callback].concat(existing);
  16244. }
  16245. } else {
  16246. on[event] = callback;
  16247. }
  16248. }
  16249. /* */
  16250. var SIMPLE_NORMALIZE = 1;
  16251. var ALWAYS_NORMALIZE = 2;
  16252. // wrapper function for providing a more flexible interface
  16253. // without getting yelled at by flow
  16254. function createElement (
  16255. context,
  16256. tag,
  16257. data,
  16258. children,
  16259. normalizationType,
  16260. alwaysNormalize
  16261. ) {
  16262. if (Array.isArray(data) || isPrimitive(data)) {
  16263. normalizationType = children;
  16264. children = data;
  16265. data = undefined;
  16266. }
  16267. if (isTrue(alwaysNormalize)) {
  16268. normalizationType = ALWAYS_NORMALIZE;
  16269. }
  16270. return _createElement(context, tag, data, children, normalizationType)
  16271. }
  16272. function _createElement (
  16273. context,
  16274. tag,
  16275. data,
  16276. children,
  16277. normalizationType
  16278. ) {
  16279. if (isDef(data) && isDef((data).__ob__)) {
  16280. true && warn(
  16281. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  16282. 'Always create fresh vnode data objects in each render!',
  16283. context
  16284. );
  16285. return createEmptyVNode()
  16286. }
  16287. // object syntax in v-bind
  16288. if (isDef(data) && isDef(data.is)) {
  16289. tag = data.is;
  16290. }
  16291. if (!tag) {
  16292. // in case of component :is set to falsy value
  16293. return createEmptyVNode()
  16294. }
  16295. // warn against non-primitive key
  16296. if ( true &&
  16297. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  16298. ) {
  16299. {
  16300. warn(
  16301. 'Avoid using non-primitive value as key, ' +
  16302. 'use string/number value instead.',
  16303. context
  16304. );
  16305. }
  16306. }
  16307. // support single function children as default scoped slot
  16308. if (Array.isArray(children) &&
  16309. typeof children[0] === 'function'
  16310. ) {
  16311. data = data || {};
  16312. data.scopedSlots = { default: children[0] };
  16313. children.length = 0;
  16314. }
  16315. if (normalizationType === ALWAYS_NORMALIZE) {
  16316. children = normalizeChildren(children);
  16317. } else if (normalizationType === SIMPLE_NORMALIZE) {
  16318. children = simpleNormalizeChildren(children);
  16319. }
  16320. var vnode, ns;
  16321. if (typeof tag === 'string') {
  16322. var Ctor;
  16323. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  16324. if (config.isReservedTag(tag)) {
  16325. // platform built-in elements
  16326. if ( true && isDef(data) && isDef(data.nativeOn)) {
  16327. warn(
  16328. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  16329. context
  16330. );
  16331. }
  16332. vnode = new VNode(
  16333. config.parsePlatformTagName(tag), data, children,
  16334. undefined, undefined, context
  16335. );
  16336. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  16337. // component
  16338. vnode = createComponent(Ctor, data, context, children, tag);
  16339. } else {
  16340. // unknown or unlisted namespaced elements
  16341. // check at runtime because it may get assigned a namespace when its
  16342. // parent normalizes children
  16343. vnode = new VNode(
  16344. tag, data, children,
  16345. undefined, undefined, context
  16346. );
  16347. }
  16348. } else {
  16349. // direct component options / constructor
  16350. vnode = createComponent(tag, data, context, children);
  16351. }
  16352. if (Array.isArray(vnode)) {
  16353. return vnode
  16354. } else if (isDef(vnode)) {
  16355. if (isDef(ns)) { applyNS(vnode, ns); }
  16356. if (isDef(data)) { registerDeepBindings(data); }
  16357. return vnode
  16358. } else {
  16359. return createEmptyVNode()
  16360. }
  16361. }
  16362. function applyNS (vnode, ns, force) {
  16363. vnode.ns = ns;
  16364. if (vnode.tag === 'foreignObject') {
  16365. // use default namespace inside foreignObject
  16366. ns = undefined;
  16367. force = true;
  16368. }
  16369. if (isDef(vnode.children)) {
  16370. for (var i = 0, l = vnode.children.length; i < l; i++) {
  16371. var child = vnode.children[i];
  16372. if (isDef(child.tag) && (
  16373. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  16374. applyNS(child, ns, force);
  16375. }
  16376. }
  16377. }
  16378. }
  16379. // ref #5318
  16380. // necessary to ensure parent re-render when deep bindings like :style and
  16381. // :class are used on slot nodes
  16382. function registerDeepBindings (data) {
  16383. if (isObject(data.style)) {
  16384. traverse(data.style);
  16385. }
  16386. if (isObject(data.class)) {
  16387. traverse(data.class);
  16388. }
  16389. }
  16390. /* */
  16391. function initRender (vm) {
  16392. vm._vnode = null; // the root of the child tree
  16393. vm._staticTrees = null; // v-once cached trees
  16394. var options = vm.$options;
  16395. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  16396. var renderContext = parentVnode && parentVnode.context;
  16397. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  16398. vm.$scopedSlots = emptyObject;
  16399. // bind the createElement fn to this instance
  16400. // so that we get proper render context inside it.
  16401. // args order: tag, data, children, normalizationType, alwaysNormalize
  16402. // internal version is used by render functions compiled from templates
  16403. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  16404. // normalization is always applied for the public version, used in
  16405. // user-written render functions.
  16406. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  16407. // $attrs & $listeners are exposed for easier HOC creation.
  16408. // they need to be reactive so that HOCs using them are always updated
  16409. var parentData = parentVnode && parentVnode.data;
  16410. /* istanbul ignore else */
  16411. if (true) {
  16412. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  16413. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  16414. }, true);
  16415. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  16416. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  16417. }, true);
  16418. } else {}
  16419. }
  16420. var currentRenderingInstance = null;
  16421. function renderMixin (Vue) {
  16422. // install runtime convenience helpers
  16423. installRenderHelpers(Vue.prototype);
  16424. Vue.prototype.$nextTick = function (fn) {
  16425. return nextTick(fn, this)
  16426. };
  16427. Vue.prototype._render = function () {
  16428. var vm = this;
  16429. var ref = vm.$options;
  16430. var render = ref.render;
  16431. var _parentVnode = ref._parentVnode;
  16432. if (_parentVnode) {
  16433. vm.$scopedSlots = normalizeScopedSlots(
  16434. _parentVnode.data.scopedSlots,
  16435. vm.$slots,
  16436. vm.$scopedSlots
  16437. );
  16438. }
  16439. // set parent vnode. this allows render functions to have access
  16440. // to the data on the placeholder node.
  16441. vm.$vnode = _parentVnode;
  16442. // render self
  16443. var vnode;
  16444. try {
  16445. // There's no need to maintain a stack because all render fns are called
  16446. // separately from one another. Nested component's render fns are called
  16447. // when parent component is patched.
  16448. currentRenderingInstance = vm;
  16449. vnode = render.call(vm._renderProxy, vm.$createElement);
  16450. } catch (e) {
  16451. handleError(e, vm, "render");
  16452. // return error render result,
  16453. // or previous vnode to prevent render error causing blank component
  16454. /* istanbul ignore else */
  16455. if ( true && vm.$options.renderError) {
  16456. try {
  16457. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  16458. } catch (e) {
  16459. handleError(e, vm, "renderError");
  16460. vnode = vm._vnode;
  16461. }
  16462. } else {
  16463. vnode = vm._vnode;
  16464. }
  16465. } finally {
  16466. currentRenderingInstance = null;
  16467. }
  16468. // if the returned array contains only a single node, allow it
  16469. if (Array.isArray(vnode) && vnode.length === 1) {
  16470. vnode = vnode[0];
  16471. }
  16472. // return empty vnode in case the render function errored out
  16473. if (!(vnode instanceof VNode)) {
  16474. if ( true && Array.isArray(vnode)) {
  16475. warn(
  16476. 'Multiple root nodes returned from render function. Render function ' +
  16477. 'should return a single root node.',
  16478. vm
  16479. );
  16480. }
  16481. vnode = createEmptyVNode();
  16482. }
  16483. // set parent
  16484. vnode.parent = _parentVnode;
  16485. return vnode
  16486. };
  16487. }
  16488. /* */
  16489. function ensureCtor (comp, base) {
  16490. if (
  16491. comp.__esModule ||
  16492. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  16493. ) {
  16494. comp = comp.default;
  16495. }
  16496. return isObject(comp)
  16497. ? base.extend(comp)
  16498. : comp
  16499. }
  16500. function createAsyncPlaceholder (
  16501. factory,
  16502. data,
  16503. context,
  16504. children,
  16505. tag
  16506. ) {
  16507. var node = createEmptyVNode();
  16508. node.asyncFactory = factory;
  16509. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  16510. return node
  16511. }
  16512. function resolveAsyncComponent (
  16513. factory,
  16514. baseCtor
  16515. ) {
  16516. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  16517. return factory.errorComp
  16518. }
  16519. if (isDef(factory.resolved)) {
  16520. return factory.resolved
  16521. }
  16522. var owner = currentRenderingInstance;
  16523. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  16524. // already pending
  16525. factory.owners.push(owner);
  16526. }
  16527. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  16528. return factory.loadingComp
  16529. }
  16530. if (owner && !isDef(factory.owners)) {
  16531. var owners = factory.owners = [owner];
  16532. var sync = true;
  16533. var timerLoading = null;
  16534. var timerTimeout = null
  16535. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  16536. var forceRender = function (renderCompleted) {
  16537. for (var i = 0, l = owners.length; i < l; i++) {
  16538. (owners[i]).$forceUpdate();
  16539. }
  16540. if (renderCompleted) {
  16541. owners.length = 0;
  16542. if (timerLoading !== null) {
  16543. clearTimeout(timerLoading);
  16544. timerLoading = null;
  16545. }
  16546. if (timerTimeout !== null) {
  16547. clearTimeout(timerTimeout);
  16548. timerTimeout = null;
  16549. }
  16550. }
  16551. };
  16552. var resolve = once(function (res) {
  16553. // cache resolved
  16554. factory.resolved = ensureCtor(res, baseCtor);
  16555. // invoke callbacks only if this is not a synchronous resolve
  16556. // (async resolves are shimmed as synchronous during SSR)
  16557. if (!sync) {
  16558. forceRender(true);
  16559. } else {
  16560. owners.length = 0;
  16561. }
  16562. });
  16563. var reject = once(function (reason) {
  16564. true && warn(
  16565. "Failed to resolve async component: " + (String(factory)) +
  16566. (reason ? ("\nReason: " + reason) : '')
  16567. );
  16568. if (isDef(factory.errorComp)) {
  16569. factory.error = true;
  16570. forceRender(true);
  16571. }
  16572. });
  16573. var res = factory(resolve, reject);
  16574. if (isObject(res)) {
  16575. if (isPromise(res)) {
  16576. // () => Promise
  16577. if (isUndef(factory.resolved)) {
  16578. res.then(resolve, reject);
  16579. }
  16580. } else if (isPromise(res.component)) {
  16581. res.component.then(resolve, reject);
  16582. if (isDef(res.error)) {
  16583. factory.errorComp = ensureCtor(res.error, baseCtor);
  16584. }
  16585. if (isDef(res.loading)) {
  16586. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  16587. if (res.delay === 0) {
  16588. factory.loading = true;
  16589. } else {
  16590. timerLoading = setTimeout(function () {
  16591. timerLoading = null;
  16592. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  16593. factory.loading = true;
  16594. forceRender(false);
  16595. }
  16596. }, res.delay || 200);
  16597. }
  16598. }
  16599. if (isDef(res.timeout)) {
  16600. timerTimeout = setTimeout(function () {
  16601. timerTimeout = null;
  16602. if (isUndef(factory.resolved)) {
  16603. reject(
  16604. true
  16605. ? ("timeout (" + (res.timeout) + "ms)")
  16606. : undefined
  16607. );
  16608. }
  16609. }, res.timeout);
  16610. }
  16611. }
  16612. }
  16613. sync = false;
  16614. // return in case resolved synchronously
  16615. return factory.loading
  16616. ? factory.loadingComp
  16617. : factory.resolved
  16618. }
  16619. }
  16620. /* */
  16621. function isAsyncPlaceholder (node) {
  16622. return node.isComment && node.asyncFactory
  16623. }
  16624. /* */
  16625. function getFirstComponentChild (children) {
  16626. if (Array.isArray(children)) {
  16627. for (var i = 0; i < children.length; i++) {
  16628. var c = children[i];
  16629. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  16630. return c
  16631. }
  16632. }
  16633. }
  16634. }
  16635. /* */
  16636. /* */
  16637. function initEvents (vm) {
  16638. vm._events = Object.create(null);
  16639. vm._hasHookEvent = false;
  16640. // init parent attached events
  16641. var listeners = vm.$options._parentListeners;
  16642. if (listeners) {
  16643. updateComponentListeners(vm, listeners);
  16644. }
  16645. }
  16646. var target;
  16647. function add (event, fn) {
  16648. target.$on(event, fn);
  16649. }
  16650. function remove$1 (event, fn) {
  16651. target.$off(event, fn);
  16652. }
  16653. function createOnceHandler (event, fn) {
  16654. var _target = target;
  16655. return function onceHandler () {
  16656. var res = fn.apply(null, arguments);
  16657. if (res !== null) {
  16658. _target.$off(event, onceHandler);
  16659. }
  16660. }
  16661. }
  16662. function updateComponentListeners (
  16663. vm,
  16664. listeners,
  16665. oldListeners
  16666. ) {
  16667. target = vm;
  16668. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  16669. target = undefined;
  16670. }
  16671. function eventsMixin (Vue) {
  16672. var hookRE = /^hook:/;
  16673. Vue.prototype.$on = function (event, fn) {
  16674. var vm = this;
  16675. if (Array.isArray(event)) {
  16676. for (var i = 0, l = event.length; i < l; i++) {
  16677. vm.$on(event[i], fn);
  16678. }
  16679. } else {
  16680. (vm._events[event] || (vm._events[event] = [])).push(fn);
  16681. // optimize hook:event cost by using a boolean flag marked at registration
  16682. // instead of a hash lookup
  16683. if (hookRE.test(event)) {
  16684. vm._hasHookEvent = true;
  16685. }
  16686. }
  16687. return vm
  16688. };
  16689. Vue.prototype.$once = function (event, fn) {
  16690. var vm = this;
  16691. function on () {
  16692. vm.$off(event, on);
  16693. fn.apply(vm, arguments);
  16694. }
  16695. on.fn = fn;
  16696. vm.$on(event, on);
  16697. return vm
  16698. };
  16699. Vue.prototype.$off = function (event, fn) {
  16700. var vm = this;
  16701. // all
  16702. if (!arguments.length) {
  16703. vm._events = Object.create(null);
  16704. return vm
  16705. }
  16706. // array of events
  16707. if (Array.isArray(event)) {
  16708. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  16709. vm.$off(event[i$1], fn);
  16710. }
  16711. return vm
  16712. }
  16713. // specific event
  16714. var cbs = vm._events[event];
  16715. if (!cbs) {
  16716. return vm
  16717. }
  16718. if (!fn) {
  16719. vm._events[event] = null;
  16720. return vm
  16721. }
  16722. // specific handler
  16723. var cb;
  16724. var i = cbs.length;
  16725. while (i--) {
  16726. cb = cbs[i];
  16727. if (cb === fn || cb.fn === fn) {
  16728. cbs.splice(i, 1);
  16729. break
  16730. }
  16731. }
  16732. return vm
  16733. };
  16734. Vue.prototype.$emit = function (event) {
  16735. var vm = this;
  16736. if (true) {
  16737. var lowerCaseEvent = event.toLowerCase();
  16738. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  16739. tip(
  16740. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  16741. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  16742. "Note that HTML attributes are case-insensitive and you cannot use " +
  16743. "v-on to listen to camelCase events when using in-DOM templates. " +
  16744. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  16745. );
  16746. }
  16747. }
  16748. var cbs = vm._events[event];
  16749. if (cbs) {
  16750. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  16751. var args = toArray(arguments, 1);
  16752. var info = "event handler for \"" + event + "\"";
  16753. for (var i = 0, l = cbs.length; i < l; i++) {
  16754. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  16755. }
  16756. }
  16757. return vm
  16758. };
  16759. }
  16760. /* */
  16761. var activeInstance = null;
  16762. var isUpdatingChildComponent = false;
  16763. function setActiveInstance(vm) {
  16764. var prevActiveInstance = activeInstance;
  16765. activeInstance = vm;
  16766. return function () {
  16767. activeInstance = prevActiveInstance;
  16768. }
  16769. }
  16770. function initLifecycle (vm) {
  16771. var options = vm.$options;
  16772. // locate first non-abstract parent
  16773. var parent = options.parent;
  16774. if (parent && !options.abstract) {
  16775. while (parent.$options.abstract && parent.$parent) {
  16776. parent = parent.$parent;
  16777. }
  16778. parent.$children.push(vm);
  16779. }
  16780. vm.$parent = parent;
  16781. vm.$root = parent ? parent.$root : vm;
  16782. vm.$children = [];
  16783. vm.$refs = {};
  16784. vm._watcher = null;
  16785. vm._inactive = null;
  16786. vm._directInactive = false;
  16787. vm._isMounted = false;
  16788. vm._isDestroyed = false;
  16789. vm._isBeingDestroyed = false;
  16790. }
  16791. function lifecycleMixin (Vue) {
  16792. Vue.prototype._update = function (vnode, hydrating) {
  16793. var vm = this;
  16794. var prevEl = vm.$el;
  16795. var prevVnode = vm._vnode;
  16796. var restoreActiveInstance = setActiveInstance(vm);
  16797. vm._vnode = vnode;
  16798. // Vue.prototype.__patch__ is injected in entry points
  16799. // based on the rendering backend used.
  16800. if (!prevVnode) {
  16801. // initial render
  16802. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  16803. } else {
  16804. // updates
  16805. vm.$el = vm.__patch__(prevVnode, vnode);
  16806. }
  16807. restoreActiveInstance();
  16808. // update __vue__ reference
  16809. if (prevEl) {
  16810. prevEl.__vue__ = null;
  16811. }
  16812. if (vm.$el) {
  16813. vm.$el.__vue__ = vm;
  16814. }
  16815. // if parent is an HOC, update its $el as well
  16816. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  16817. vm.$parent.$el = vm.$el;
  16818. }
  16819. // updated hook is called by the scheduler to ensure that children are
  16820. // updated in a parent's updated hook.
  16821. };
  16822. Vue.prototype.$forceUpdate = function () {
  16823. var vm = this;
  16824. if (vm._watcher) {
  16825. vm._watcher.update();
  16826. }
  16827. };
  16828. Vue.prototype.$destroy = function () {
  16829. var vm = this;
  16830. if (vm._isBeingDestroyed) {
  16831. return
  16832. }
  16833. callHook(vm, 'beforeDestroy');
  16834. vm._isBeingDestroyed = true;
  16835. // remove self from parent
  16836. var parent = vm.$parent;
  16837. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  16838. remove(parent.$children, vm);
  16839. }
  16840. // teardown watchers
  16841. if (vm._watcher) {
  16842. vm._watcher.teardown();
  16843. }
  16844. var i = vm._watchers.length;
  16845. while (i--) {
  16846. vm._watchers[i].teardown();
  16847. }
  16848. // remove reference from data ob
  16849. // frozen object may not have observer.
  16850. if (vm._data.__ob__) {
  16851. vm._data.__ob__.vmCount--;
  16852. }
  16853. // call the last hook...
  16854. vm._isDestroyed = true;
  16855. // invoke destroy hooks on current rendered tree
  16856. vm.__patch__(vm._vnode, null);
  16857. // fire destroyed hook
  16858. callHook(vm, 'destroyed');
  16859. // turn off all instance listeners.
  16860. vm.$off();
  16861. // remove __vue__ reference
  16862. if (vm.$el) {
  16863. vm.$el.__vue__ = null;
  16864. }
  16865. // release circular reference (#6759)
  16866. if (vm.$vnode) {
  16867. vm.$vnode.parent = null;
  16868. }
  16869. };
  16870. }
  16871. function updateChildComponent (
  16872. vm,
  16873. propsData,
  16874. listeners,
  16875. parentVnode,
  16876. renderChildren
  16877. ) {
  16878. if (true) {
  16879. isUpdatingChildComponent = true;
  16880. }
  16881. // determine whether component has slot children
  16882. // we need to do this before overwriting $options._renderChildren.
  16883. // check if there are dynamic scopedSlots (hand-written or compiled but with
  16884. // dynamic slot names). Static scoped slots compiled from template has the
  16885. // "$stable" marker.
  16886. var newScopedSlots = parentVnode.data.scopedSlots;
  16887. var oldScopedSlots = vm.$scopedSlots;
  16888. var hasDynamicScopedSlot = !!(
  16889. (newScopedSlots && !newScopedSlots.$stable) ||
  16890. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  16891. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  16892. );
  16893. // Any static slot children from the parent may have changed during parent's
  16894. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  16895. // update is necessary to ensure correctness.
  16896. var needsForceUpdate = !!(
  16897. renderChildren || // has new static slots
  16898. vm.$options._renderChildren || // has old static slots
  16899. hasDynamicScopedSlot
  16900. );
  16901. vm.$options._parentVnode = parentVnode;
  16902. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  16903. if (vm._vnode) { // update child tree's parent
  16904. vm._vnode.parent = parentVnode;
  16905. }
  16906. vm.$options._renderChildren = renderChildren;
  16907. // update $attrs and $listeners hash
  16908. // these are also reactive so they may trigger child update if the child
  16909. // used them during render
  16910. vm.$attrs = parentVnode.data.attrs || emptyObject;
  16911. vm.$listeners = listeners || emptyObject;
  16912. // update props
  16913. if (propsData && vm.$options.props) {
  16914. toggleObserving(false);
  16915. var props = vm._props;
  16916. var propKeys = vm.$options._propKeys || [];
  16917. for (var i = 0; i < propKeys.length; i++) {
  16918. var key = propKeys[i];
  16919. var propOptions = vm.$options.props; // wtf flow?
  16920. props[key] = validateProp(key, propOptions, propsData, vm);
  16921. }
  16922. toggleObserving(true);
  16923. // keep a copy of raw propsData
  16924. vm.$options.propsData = propsData;
  16925. }
  16926. // fixed by xxxxxx update properties(mp runtime)
  16927. vm._$updateProperties && vm._$updateProperties(vm);
  16928. // update listeners
  16929. listeners = listeners || emptyObject;
  16930. var oldListeners = vm.$options._parentListeners;
  16931. vm.$options._parentListeners = listeners;
  16932. updateComponentListeners(vm, listeners, oldListeners);
  16933. // resolve slots + force update if has children
  16934. if (needsForceUpdate) {
  16935. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  16936. vm.$forceUpdate();
  16937. }
  16938. if (true) {
  16939. isUpdatingChildComponent = false;
  16940. }
  16941. }
  16942. function isInInactiveTree (vm) {
  16943. while (vm && (vm = vm.$parent)) {
  16944. if (vm._inactive) { return true }
  16945. }
  16946. return false
  16947. }
  16948. function activateChildComponent (vm, direct) {
  16949. if (direct) {
  16950. vm._directInactive = false;
  16951. if (isInInactiveTree(vm)) {
  16952. return
  16953. }
  16954. } else if (vm._directInactive) {
  16955. return
  16956. }
  16957. if (vm._inactive || vm._inactive === null) {
  16958. vm._inactive = false;
  16959. for (var i = 0; i < vm.$children.length; i++) {
  16960. activateChildComponent(vm.$children[i]);
  16961. }
  16962. callHook(vm, 'activated');
  16963. }
  16964. }
  16965. function deactivateChildComponent (vm, direct) {
  16966. if (direct) {
  16967. vm._directInactive = true;
  16968. if (isInInactiveTree(vm)) {
  16969. return
  16970. }
  16971. }
  16972. if (!vm._inactive) {
  16973. vm._inactive = true;
  16974. for (var i = 0; i < vm.$children.length; i++) {
  16975. deactivateChildComponent(vm.$children[i]);
  16976. }
  16977. callHook(vm, 'deactivated');
  16978. }
  16979. }
  16980. function callHook (vm, hook) {
  16981. // #7573 disable dep collection when invoking lifecycle hooks
  16982. pushTarget();
  16983. var handlers = vm.$options[hook];
  16984. var info = hook + " hook";
  16985. if (handlers) {
  16986. for (var i = 0, j = handlers.length; i < j; i++) {
  16987. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  16988. }
  16989. }
  16990. if (vm._hasHookEvent) {
  16991. vm.$emit('hook:' + hook);
  16992. }
  16993. popTarget();
  16994. }
  16995. /* */
  16996. var MAX_UPDATE_COUNT = 100;
  16997. var queue = [];
  16998. var activatedChildren = [];
  16999. var has = {};
  17000. var circular = {};
  17001. var waiting = false;
  17002. var flushing = false;
  17003. var index = 0;
  17004. /**
  17005. * Reset the scheduler's state.
  17006. */
  17007. function resetSchedulerState () {
  17008. index = queue.length = activatedChildren.length = 0;
  17009. has = {};
  17010. if (true) {
  17011. circular = {};
  17012. }
  17013. waiting = flushing = false;
  17014. }
  17015. // Async edge case #6566 requires saving the timestamp when event listeners are
  17016. // attached. However, calling performance.now() has a perf overhead especially
  17017. // if the page has thousands of event listeners. Instead, we take a timestamp
  17018. // every time the scheduler flushes and use that for all event listeners
  17019. // attached during that flush.
  17020. var currentFlushTimestamp = 0;
  17021. // Async edge case fix requires storing an event listener's attach timestamp.
  17022. var getNow = Date.now;
  17023. // Determine what event timestamp the browser is using. Annoyingly, the
  17024. // timestamp can either be hi-res (relative to page load) or low-res
  17025. // (relative to UNIX epoch), so in order to compare time we have to use the
  17026. // same timestamp type when saving the flush timestamp.
  17027. // All IE versions use low-res event timestamps, and have problematic clock
  17028. // implementations (#9632)
  17029. if (inBrowser && !isIE) {
  17030. var performance = window.performance;
  17031. if (
  17032. performance &&
  17033. typeof performance.now === 'function' &&
  17034. getNow() > document.createEvent('Event').timeStamp
  17035. ) {
  17036. // if the event timestamp, although evaluated AFTER the Date.now(), is
  17037. // smaller than it, it means the event is using a hi-res timestamp,
  17038. // and we need to use the hi-res version for event listener timestamps as
  17039. // well.
  17040. getNow = function () { return performance.now(); };
  17041. }
  17042. }
  17043. /**
  17044. * Flush both queues and run the watchers.
  17045. */
  17046. function flushSchedulerQueue () {
  17047. currentFlushTimestamp = getNow();
  17048. flushing = true;
  17049. var watcher, id;
  17050. // Sort queue before flush.
  17051. // This ensures that:
  17052. // 1. Components are updated from parent to child. (because parent is always
  17053. // created before the child)
  17054. // 2. A component's user watchers are run before its render watcher (because
  17055. // user watchers are created before the render watcher)
  17056. // 3. If a component is destroyed during a parent component's watcher run,
  17057. // its watchers can be skipped.
  17058. queue.sort(function (a, b) { return a.id - b.id; });
  17059. // do not cache length because more watchers might be pushed
  17060. // as we run existing watchers
  17061. for (index = 0; index < queue.length; index++) {
  17062. watcher = queue[index];
  17063. if (watcher.before) {
  17064. watcher.before();
  17065. }
  17066. id = watcher.id;
  17067. has[id] = null;
  17068. watcher.run();
  17069. // in dev build, check and stop circular updates.
  17070. if ( true && has[id] != null) {
  17071. circular[id] = (circular[id] || 0) + 1;
  17072. if (circular[id] > MAX_UPDATE_COUNT) {
  17073. warn(
  17074. 'You may have an infinite update loop ' + (
  17075. watcher.user
  17076. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  17077. : "in a component render function."
  17078. ),
  17079. watcher.vm
  17080. );
  17081. break
  17082. }
  17083. }
  17084. }
  17085. // keep copies of post queues before resetting state
  17086. var activatedQueue = activatedChildren.slice();
  17087. var updatedQueue = queue.slice();
  17088. resetSchedulerState();
  17089. // call component updated and activated hooks
  17090. callActivatedHooks(activatedQueue);
  17091. callUpdatedHooks(updatedQueue);
  17092. // devtool hook
  17093. /* istanbul ignore if */
  17094. if (devtools && config.devtools) {
  17095. devtools.emit('flush');
  17096. }
  17097. }
  17098. function callUpdatedHooks (queue) {
  17099. var i = queue.length;
  17100. while (i--) {
  17101. var watcher = queue[i];
  17102. var vm = watcher.vm;
  17103. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  17104. callHook(vm, 'updated');
  17105. }
  17106. }
  17107. }
  17108. /**
  17109. * Queue a kept-alive component that was activated during patch.
  17110. * The queue will be processed after the entire tree has been patched.
  17111. */
  17112. function queueActivatedComponent (vm) {
  17113. // setting _inactive to false here so that a render function can
  17114. // rely on checking whether it's in an inactive tree (e.g. router-view)
  17115. vm._inactive = false;
  17116. activatedChildren.push(vm);
  17117. }
  17118. function callActivatedHooks (queue) {
  17119. for (var i = 0; i < queue.length; i++) {
  17120. queue[i]._inactive = true;
  17121. activateChildComponent(queue[i], true /* true */);
  17122. }
  17123. }
  17124. /**
  17125. * Push a watcher into the watcher queue.
  17126. * Jobs with duplicate IDs will be skipped unless it's
  17127. * pushed when the queue is being flushed.
  17128. */
  17129. function queueWatcher (watcher) {
  17130. var id = watcher.id;
  17131. if (has[id] == null) {
  17132. has[id] = true;
  17133. if (!flushing) {
  17134. queue.push(watcher);
  17135. } else {
  17136. // if already flushing, splice the watcher based on its id
  17137. // if already past its id, it will be run next immediately.
  17138. var i = queue.length - 1;
  17139. while (i > index && queue[i].id > watcher.id) {
  17140. i--;
  17141. }
  17142. queue.splice(i + 1, 0, watcher);
  17143. }
  17144. // queue the flush
  17145. if (!waiting) {
  17146. waiting = true;
  17147. if ( true && !config.async) {
  17148. flushSchedulerQueue();
  17149. return
  17150. }
  17151. nextTick(flushSchedulerQueue);
  17152. }
  17153. }
  17154. }
  17155. /* */
  17156. var uid$2 = 0;
  17157. /**
  17158. * A watcher parses an expression, collects dependencies,
  17159. * and fires callback when the expression value changes.
  17160. * This is used for both the $watch() api and directives.
  17161. */
  17162. var Watcher = function Watcher (
  17163. vm,
  17164. expOrFn,
  17165. cb,
  17166. options,
  17167. isRenderWatcher
  17168. ) {
  17169. this.vm = vm;
  17170. if (isRenderWatcher) {
  17171. vm._watcher = this;
  17172. }
  17173. vm._watchers.push(this);
  17174. // options
  17175. if (options) {
  17176. this.deep = !!options.deep;
  17177. this.user = !!options.user;
  17178. this.lazy = !!options.lazy;
  17179. this.sync = !!options.sync;
  17180. this.before = options.before;
  17181. } else {
  17182. this.deep = this.user = this.lazy = this.sync = false;
  17183. }
  17184. this.cb = cb;
  17185. this.id = ++uid$2; // uid for batching
  17186. this.active = true;
  17187. this.dirty = this.lazy; // for lazy watchers
  17188. this.deps = [];
  17189. this.newDeps = [];
  17190. this.depIds = new _Set();
  17191. this.newDepIds = new _Set();
  17192. this.expression = true
  17193. ? expOrFn.toString()
  17194. : undefined;
  17195. // parse expression for getter
  17196. if (typeof expOrFn === 'function') {
  17197. this.getter = expOrFn;
  17198. } else {
  17199. this.getter = parsePath(expOrFn);
  17200. if (!this.getter) {
  17201. this.getter = noop;
  17202. true && warn(
  17203. "Failed watching path: \"" + expOrFn + "\" " +
  17204. 'Watcher only accepts simple dot-delimited paths. ' +
  17205. 'For full control, use a function instead.',
  17206. vm
  17207. );
  17208. }
  17209. }
  17210. this.value = this.lazy
  17211. ? undefined
  17212. : this.get();
  17213. };
  17214. /**
  17215. * Evaluate the getter, and re-collect dependencies.
  17216. */
  17217. Watcher.prototype.get = function get () {
  17218. pushTarget(this);
  17219. var value;
  17220. var vm = this.vm;
  17221. try {
  17222. value = this.getter.call(vm, vm);
  17223. } catch (e) {
  17224. if (this.user) {
  17225. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  17226. } else {
  17227. throw e
  17228. }
  17229. } finally {
  17230. // "touch" every property so they are all tracked as
  17231. // dependencies for deep watching
  17232. if (this.deep) {
  17233. traverse(value);
  17234. }
  17235. popTarget();
  17236. this.cleanupDeps();
  17237. }
  17238. return value
  17239. };
  17240. /**
  17241. * Add a dependency to this directive.
  17242. */
  17243. Watcher.prototype.addDep = function addDep (dep) {
  17244. var id = dep.id;
  17245. if (!this.newDepIds.has(id)) {
  17246. this.newDepIds.add(id);
  17247. this.newDeps.push(dep);
  17248. if (!this.depIds.has(id)) {
  17249. dep.addSub(this);
  17250. }
  17251. }
  17252. };
  17253. /**
  17254. * Clean up for dependency collection.
  17255. */
  17256. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  17257. var i = this.deps.length;
  17258. while (i--) {
  17259. var dep = this.deps[i];
  17260. if (!this.newDepIds.has(dep.id)) {
  17261. dep.removeSub(this);
  17262. }
  17263. }
  17264. var tmp = this.depIds;
  17265. this.depIds = this.newDepIds;
  17266. this.newDepIds = tmp;
  17267. this.newDepIds.clear();
  17268. tmp = this.deps;
  17269. this.deps = this.newDeps;
  17270. this.newDeps = tmp;
  17271. this.newDeps.length = 0;
  17272. };
  17273. /**
  17274. * Subscriber interface.
  17275. * Will be called when a dependency changes.
  17276. */
  17277. Watcher.prototype.update = function update () {
  17278. /* istanbul ignore else */
  17279. if (this.lazy) {
  17280. this.dirty = true;
  17281. } else if (this.sync) {
  17282. this.run();
  17283. } else {
  17284. queueWatcher(this);
  17285. }
  17286. };
  17287. /**
  17288. * Scheduler job interface.
  17289. * Will be called by the scheduler.
  17290. */
  17291. Watcher.prototype.run = function run () {
  17292. if (this.active) {
  17293. var value = this.get();
  17294. if (
  17295. value !== this.value ||
  17296. // Deep watchers and watchers on Object/Arrays should fire even
  17297. // when the value is the same, because the value may
  17298. // have mutated.
  17299. isObject(value) ||
  17300. this.deep
  17301. ) {
  17302. // set new value
  17303. var oldValue = this.value;
  17304. this.value = value;
  17305. if (this.user) {
  17306. try {
  17307. this.cb.call(this.vm, value, oldValue);
  17308. } catch (e) {
  17309. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  17310. }
  17311. } else {
  17312. this.cb.call(this.vm, value, oldValue);
  17313. }
  17314. }
  17315. }
  17316. };
  17317. /**
  17318. * Evaluate the value of the watcher.
  17319. * This only gets called for lazy watchers.
  17320. */
  17321. Watcher.prototype.evaluate = function evaluate () {
  17322. this.value = this.get();
  17323. this.dirty = false;
  17324. };
  17325. /**
  17326. * Depend on all deps collected by this watcher.
  17327. */
  17328. Watcher.prototype.depend = function depend () {
  17329. var i = this.deps.length;
  17330. while (i--) {
  17331. this.deps[i].depend();
  17332. }
  17333. };
  17334. /**
  17335. * Remove self from all dependencies' subscriber list.
  17336. */
  17337. Watcher.prototype.teardown = function teardown () {
  17338. if (this.active) {
  17339. // remove self from vm's watcher list
  17340. // this is a somewhat expensive operation so we skip it
  17341. // if the vm is being destroyed.
  17342. if (!this.vm._isBeingDestroyed) {
  17343. remove(this.vm._watchers, this);
  17344. }
  17345. var i = this.deps.length;
  17346. while (i--) {
  17347. this.deps[i].removeSub(this);
  17348. }
  17349. this.active = false;
  17350. }
  17351. };
  17352. /* */
  17353. var sharedPropertyDefinition = {
  17354. enumerable: true,
  17355. configurable: true,
  17356. get: noop,
  17357. set: noop
  17358. };
  17359. function proxy (target, sourceKey, key) {
  17360. sharedPropertyDefinition.get = function proxyGetter () {
  17361. return this[sourceKey][key]
  17362. };
  17363. sharedPropertyDefinition.set = function proxySetter (val) {
  17364. this[sourceKey][key] = val;
  17365. };
  17366. Object.defineProperty(target, key, sharedPropertyDefinition);
  17367. }
  17368. function initState (vm) {
  17369. vm._watchers = [];
  17370. var opts = vm.$options;
  17371. if (opts.props) { initProps(vm, opts.props); }
  17372. if (opts.methods) { initMethods(vm, opts.methods); }
  17373. if (opts.data) {
  17374. initData(vm);
  17375. } else {
  17376. observe(vm._data = {}, true /* asRootData */);
  17377. }
  17378. if (opts.computed) { initComputed(vm, opts.computed); }
  17379. if (opts.watch && opts.watch !== nativeWatch) {
  17380. initWatch(vm, opts.watch);
  17381. }
  17382. }
  17383. function initProps (vm, propsOptions) {
  17384. var propsData = vm.$options.propsData || {};
  17385. var props = vm._props = {};
  17386. // cache prop keys so that future props updates can iterate using Array
  17387. // instead of dynamic object key enumeration.
  17388. var keys = vm.$options._propKeys = [];
  17389. var isRoot = !vm.$parent;
  17390. // root instance props should be converted
  17391. if (!isRoot) {
  17392. toggleObserving(false);
  17393. }
  17394. var loop = function ( key ) {
  17395. keys.push(key);
  17396. var value = validateProp(key, propsOptions, propsData, vm);
  17397. /* istanbul ignore else */
  17398. if (true) {
  17399. var hyphenatedKey = hyphenate(key);
  17400. if (isReservedAttribute(hyphenatedKey) ||
  17401. config.isReservedAttr(hyphenatedKey)) {
  17402. warn(
  17403. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  17404. vm
  17405. );
  17406. }
  17407. defineReactive$$1(props, key, value, function () {
  17408. if (!isRoot && !isUpdatingChildComponent) {
  17409. {
  17410. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  17411. return
  17412. }
  17413. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  17414. if(
  17415. key === 'value' &&
  17416. Array.isArray(vm.$options.behaviors) &&
  17417. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  17418. ){
  17419. return
  17420. }
  17421. if(vm._getFormData){
  17422. return
  17423. }
  17424. var $parent = vm.$parent;
  17425. while($parent){
  17426. if($parent.__next_tick_pending){
  17427. return
  17428. }
  17429. $parent = $parent.$parent;
  17430. }
  17431. }
  17432. warn(
  17433. "Avoid mutating a prop directly since the value will be " +
  17434. "overwritten whenever the parent component re-renders. " +
  17435. "Instead, use a data or computed property based on the prop's " +
  17436. "value. Prop being mutated: \"" + key + "\"",
  17437. vm
  17438. );
  17439. }
  17440. });
  17441. } else {}
  17442. // static props are already proxied on the component's prototype
  17443. // during Vue.extend(). We only need to proxy props defined at
  17444. // instantiation here.
  17445. if (!(key in vm)) {
  17446. proxy(vm, "_props", key);
  17447. }
  17448. };
  17449. for (var key in propsOptions) loop( key );
  17450. toggleObserving(true);
  17451. }
  17452. function initData (vm) {
  17453. var data = vm.$options.data;
  17454. data = vm._data = typeof data === 'function'
  17455. ? getData(data, vm)
  17456. : data || {};
  17457. if (!isPlainObject(data)) {
  17458. data = {};
  17459. true && warn(
  17460. 'data functions should return an object:\n' +
  17461. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  17462. vm
  17463. );
  17464. }
  17465. // proxy data on instance
  17466. var keys = Object.keys(data);
  17467. var props = vm.$options.props;
  17468. var methods = vm.$options.methods;
  17469. var i = keys.length;
  17470. while (i--) {
  17471. var key = keys[i];
  17472. if (true) {
  17473. if (methods && hasOwn(methods, key)) {
  17474. warn(
  17475. ("Method \"" + key + "\" has already been defined as a data property."),
  17476. vm
  17477. );
  17478. }
  17479. }
  17480. if (props && hasOwn(props, key)) {
  17481. true && warn(
  17482. "The data property \"" + key + "\" is already declared as a prop. " +
  17483. "Use prop default value instead.",
  17484. vm
  17485. );
  17486. } else if (!isReserved(key)) {
  17487. proxy(vm, "_data", key);
  17488. }
  17489. }
  17490. // observe data
  17491. observe(data, true /* asRootData */);
  17492. }
  17493. function getData (data, vm) {
  17494. // #7573 disable dep collection when invoking data getters
  17495. pushTarget();
  17496. try {
  17497. return data.call(vm, vm)
  17498. } catch (e) {
  17499. handleError(e, vm, "data()");
  17500. return {}
  17501. } finally {
  17502. popTarget();
  17503. }
  17504. }
  17505. var computedWatcherOptions = { lazy: true };
  17506. function initComputed (vm, computed) {
  17507. // $flow-disable-line
  17508. var watchers = vm._computedWatchers = Object.create(null);
  17509. // computed properties are just getters during SSR
  17510. var isSSR = isServerRendering();
  17511. for (var key in computed) {
  17512. var userDef = computed[key];
  17513. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  17514. if ( true && getter == null) {
  17515. warn(
  17516. ("Getter is missing for computed property \"" + key + "\"."),
  17517. vm
  17518. );
  17519. }
  17520. if (!isSSR) {
  17521. // create internal watcher for the computed property.
  17522. watchers[key] = new Watcher(
  17523. vm,
  17524. getter || noop,
  17525. noop,
  17526. computedWatcherOptions
  17527. );
  17528. }
  17529. // component-defined computed properties are already defined on the
  17530. // component prototype. We only need to define computed properties defined
  17531. // at instantiation here.
  17532. if (!(key in vm)) {
  17533. defineComputed(vm, key, userDef);
  17534. } else if (true) {
  17535. if (key in vm.$data) {
  17536. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  17537. } else if (vm.$options.props && key in vm.$options.props) {
  17538. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  17539. }
  17540. }
  17541. }
  17542. }
  17543. function defineComputed (
  17544. target,
  17545. key,
  17546. userDef
  17547. ) {
  17548. var shouldCache = !isServerRendering();
  17549. if (typeof userDef === 'function') {
  17550. sharedPropertyDefinition.get = shouldCache
  17551. ? createComputedGetter(key)
  17552. : createGetterInvoker(userDef);
  17553. sharedPropertyDefinition.set = noop;
  17554. } else {
  17555. sharedPropertyDefinition.get = userDef.get
  17556. ? shouldCache && userDef.cache !== false
  17557. ? createComputedGetter(key)
  17558. : createGetterInvoker(userDef.get)
  17559. : noop;
  17560. sharedPropertyDefinition.set = userDef.set || noop;
  17561. }
  17562. if ( true &&
  17563. sharedPropertyDefinition.set === noop) {
  17564. sharedPropertyDefinition.set = function () {
  17565. warn(
  17566. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  17567. this
  17568. );
  17569. };
  17570. }
  17571. Object.defineProperty(target, key, sharedPropertyDefinition);
  17572. }
  17573. function createComputedGetter (key) {
  17574. return function computedGetter () {
  17575. var watcher = this._computedWatchers && this._computedWatchers[key];
  17576. if (watcher) {
  17577. if (watcher.dirty) {
  17578. watcher.evaluate();
  17579. }
  17580. if (Dep.SharedObject.target) {// fixed by xxxxxx
  17581. watcher.depend();
  17582. }
  17583. return watcher.value
  17584. }
  17585. }
  17586. }
  17587. function createGetterInvoker(fn) {
  17588. return function computedGetter () {
  17589. return fn.call(this, this)
  17590. }
  17591. }
  17592. function initMethods (vm, methods) {
  17593. var props = vm.$options.props;
  17594. for (var key in methods) {
  17595. if (true) {
  17596. if (typeof methods[key] !== 'function') {
  17597. warn(
  17598. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  17599. "Did you reference the function correctly?",
  17600. vm
  17601. );
  17602. }
  17603. if (props && hasOwn(props, key)) {
  17604. warn(
  17605. ("Method \"" + key + "\" has already been defined as a prop."),
  17606. vm
  17607. );
  17608. }
  17609. if ((key in vm) && isReserved(key)) {
  17610. warn(
  17611. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  17612. "Avoid defining component methods that start with _ or $."
  17613. );
  17614. }
  17615. }
  17616. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  17617. }
  17618. }
  17619. function initWatch (vm, watch) {
  17620. for (var key in watch) {
  17621. var handler = watch[key];
  17622. if (Array.isArray(handler)) {
  17623. for (var i = 0; i < handler.length; i++) {
  17624. createWatcher(vm, key, handler[i]);
  17625. }
  17626. } else {
  17627. createWatcher(vm, key, handler);
  17628. }
  17629. }
  17630. }
  17631. function createWatcher (
  17632. vm,
  17633. expOrFn,
  17634. handler,
  17635. options
  17636. ) {
  17637. if (isPlainObject(handler)) {
  17638. options = handler;
  17639. handler = handler.handler;
  17640. }
  17641. if (typeof handler === 'string') {
  17642. handler = vm[handler];
  17643. }
  17644. return vm.$watch(expOrFn, handler, options)
  17645. }
  17646. function stateMixin (Vue) {
  17647. // flow somehow has problems with directly declared definition object
  17648. // when using Object.defineProperty, so we have to procedurally build up
  17649. // the object here.
  17650. var dataDef = {};
  17651. dataDef.get = function () { return this._data };
  17652. var propsDef = {};
  17653. propsDef.get = function () { return this._props };
  17654. if (true) {
  17655. dataDef.set = function () {
  17656. warn(
  17657. 'Avoid replacing instance root $data. ' +
  17658. 'Use nested data properties instead.',
  17659. this
  17660. );
  17661. };
  17662. propsDef.set = function () {
  17663. warn("$props is readonly.", this);
  17664. };
  17665. }
  17666. Object.defineProperty(Vue.prototype, '$data', dataDef);
  17667. Object.defineProperty(Vue.prototype, '$props', propsDef);
  17668. Vue.prototype.$set = set;
  17669. Vue.prototype.$delete = del;
  17670. Vue.prototype.$watch = function (
  17671. expOrFn,
  17672. cb,
  17673. options
  17674. ) {
  17675. var vm = this;
  17676. if (isPlainObject(cb)) {
  17677. return createWatcher(vm, expOrFn, cb, options)
  17678. }
  17679. options = options || {};
  17680. options.user = true;
  17681. var watcher = new Watcher(vm, expOrFn, cb, options);
  17682. if (options.immediate) {
  17683. try {
  17684. cb.call(vm, watcher.value);
  17685. } catch (error) {
  17686. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  17687. }
  17688. }
  17689. return function unwatchFn () {
  17690. watcher.teardown();
  17691. }
  17692. };
  17693. }
  17694. /* */
  17695. var uid$3 = 0;
  17696. function initMixin (Vue) {
  17697. Vue.prototype._init = function (options) {
  17698. var vm = this;
  17699. // a uid
  17700. vm._uid = uid$3++;
  17701. var startTag, endTag;
  17702. /* istanbul ignore if */
  17703. if ( true && config.performance && mark) {
  17704. startTag = "vue-perf-start:" + (vm._uid);
  17705. endTag = "vue-perf-end:" + (vm._uid);
  17706. mark(startTag);
  17707. }
  17708. // a flag to avoid this being observed
  17709. vm._isVue = true;
  17710. // merge options
  17711. if (options && options._isComponent) {
  17712. // optimize internal component instantiation
  17713. // since dynamic options merging is pretty slow, and none of the
  17714. // internal component options needs special treatment.
  17715. initInternalComponent(vm, options);
  17716. } else {
  17717. vm.$options = mergeOptions(
  17718. resolveConstructorOptions(vm.constructor),
  17719. options || {},
  17720. vm
  17721. );
  17722. }
  17723. /* istanbul ignore else */
  17724. if (true) {
  17725. initProxy(vm);
  17726. } else {}
  17727. // expose real self
  17728. vm._self = vm;
  17729. initLifecycle(vm);
  17730. initEvents(vm);
  17731. initRender(vm);
  17732. callHook(vm, 'beforeCreate');
  17733. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  17734. initState(vm);
  17735. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  17736. !vm._$fallback && callHook(vm, 'created');
  17737. /* istanbul ignore if */
  17738. if ( true && config.performance && mark) {
  17739. vm._name = formatComponentName(vm, false);
  17740. mark(endTag);
  17741. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  17742. }
  17743. if (vm.$options.el) {
  17744. vm.$mount(vm.$options.el);
  17745. }
  17746. };
  17747. }
  17748. function initInternalComponent (vm, options) {
  17749. var opts = vm.$options = Object.create(vm.constructor.options);
  17750. // doing this because it's faster than dynamic enumeration.
  17751. var parentVnode = options._parentVnode;
  17752. opts.parent = options.parent;
  17753. opts._parentVnode = parentVnode;
  17754. var vnodeComponentOptions = parentVnode.componentOptions;
  17755. opts.propsData = vnodeComponentOptions.propsData;
  17756. opts._parentListeners = vnodeComponentOptions.listeners;
  17757. opts._renderChildren = vnodeComponentOptions.children;
  17758. opts._componentTag = vnodeComponentOptions.tag;
  17759. if (options.render) {
  17760. opts.render = options.render;
  17761. opts.staticRenderFns = options.staticRenderFns;
  17762. }
  17763. }
  17764. function resolveConstructorOptions (Ctor) {
  17765. var options = Ctor.options;
  17766. if (Ctor.super) {
  17767. var superOptions = resolveConstructorOptions(Ctor.super);
  17768. var cachedSuperOptions = Ctor.superOptions;
  17769. if (superOptions !== cachedSuperOptions) {
  17770. // super option changed,
  17771. // need to resolve new options.
  17772. Ctor.superOptions = superOptions;
  17773. // check if there are any late-modified/attached options (#4976)
  17774. var modifiedOptions = resolveModifiedOptions(Ctor);
  17775. // update base extend options
  17776. if (modifiedOptions) {
  17777. extend(Ctor.extendOptions, modifiedOptions);
  17778. }
  17779. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  17780. if (options.name) {
  17781. options.components[options.name] = Ctor;
  17782. }
  17783. }
  17784. }
  17785. return options
  17786. }
  17787. function resolveModifiedOptions (Ctor) {
  17788. var modified;
  17789. var latest = Ctor.options;
  17790. var sealed = Ctor.sealedOptions;
  17791. for (var key in latest) {
  17792. if (latest[key] !== sealed[key]) {
  17793. if (!modified) { modified = {}; }
  17794. modified[key] = latest[key];
  17795. }
  17796. }
  17797. return modified
  17798. }
  17799. function Vue (options) {
  17800. if ( true &&
  17801. !(this instanceof Vue)
  17802. ) {
  17803. warn('Vue is a constructor and should be called with the `new` keyword');
  17804. }
  17805. this._init(options);
  17806. }
  17807. initMixin(Vue);
  17808. stateMixin(Vue);
  17809. eventsMixin(Vue);
  17810. lifecycleMixin(Vue);
  17811. renderMixin(Vue);
  17812. /* */
  17813. function initUse (Vue) {
  17814. Vue.use = function (plugin) {
  17815. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  17816. if (installedPlugins.indexOf(plugin) > -1) {
  17817. return this
  17818. }
  17819. // additional parameters
  17820. var args = toArray(arguments, 1);
  17821. args.unshift(this);
  17822. if (typeof plugin.install === 'function') {
  17823. plugin.install.apply(plugin, args);
  17824. } else if (typeof plugin === 'function') {
  17825. plugin.apply(null, args);
  17826. }
  17827. installedPlugins.push(plugin);
  17828. return this
  17829. };
  17830. }
  17831. /* */
  17832. function initMixin$1 (Vue) {
  17833. Vue.mixin = function (mixin) {
  17834. this.options = mergeOptions(this.options, mixin);
  17835. return this
  17836. };
  17837. }
  17838. /* */
  17839. function initExtend (Vue) {
  17840. /**
  17841. * Each instance constructor, including Vue, has a unique
  17842. * cid. This enables us to create wrapped "child
  17843. * constructors" for prototypal inheritance and cache them.
  17844. */
  17845. Vue.cid = 0;
  17846. var cid = 1;
  17847. /**
  17848. * Class inheritance
  17849. */
  17850. Vue.extend = function (extendOptions) {
  17851. extendOptions = extendOptions || {};
  17852. var Super = this;
  17853. var SuperId = Super.cid;
  17854. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  17855. if (cachedCtors[SuperId]) {
  17856. return cachedCtors[SuperId]
  17857. }
  17858. var name = extendOptions.name || Super.options.name;
  17859. if ( true && name) {
  17860. validateComponentName(name);
  17861. }
  17862. var Sub = function VueComponent (options) {
  17863. this._init(options);
  17864. };
  17865. Sub.prototype = Object.create(Super.prototype);
  17866. Sub.prototype.constructor = Sub;
  17867. Sub.cid = cid++;
  17868. Sub.options = mergeOptions(
  17869. Super.options,
  17870. extendOptions
  17871. );
  17872. Sub['super'] = Super;
  17873. // For props and computed properties, we define the proxy getters on
  17874. // the Vue instances at extension time, on the extended prototype. This
  17875. // avoids Object.defineProperty calls for each instance created.
  17876. if (Sub.options.props) {
  17877. initProps$1(Sub);
  17878. }
  17879. if (Sub.options.computed) {
  17880. initComputed$1(Sub);
  17881. }
  17882. // allow further extension/mixin/plugin usage
  17883. Sub.extend = Super.extend;
  17884. Sub.mixin = Super.mixin;
  17885. Sub.use = Super.use;
  17886. // create asset registers, so extended classes
  17887. // can have their private assets too.
  17888. ASSET_TYPES.forEach(function (type) {
  17889. Sub[type] = Super[type];
  17890. });
  17891. // enable recursive self-lookup
  17892. if (name) {
  17893. Sub.options.components[name] = Sub;
  17894. }
  17895. // keep a reference to the super options at extension time.
  17896. // later at instantiation we can check if Super's options have
  17897. // been updated.
  17898. Sub.superOptions = Super.options;
  17899. Sub.extendOptions = extendOptions;
  17900. Sub.sealedOptions = extend({}, Sub.options);
  17901. // cache constructor
  17902. cachedCtors[SuperId] = Sub;
  17903. return Sub
  17904. };
  17905. }
  17906. function initProps$1 (Comp) {
  17907. var props = Comp.options.props;
  17908. for (var key in props) {
  17909. proxy(Comp.prototype, "_props", key);
  17910. }
  17911. }
  17912. function initComputed$1 (Comp) {
  17913. var computed = Comp.options.computed;
  17914. for (var key in computed) {
  17915. defineComputed(Comp.prototype, key, computed[key]);
  17916. }
  17917. }
  17918. /* */
  17919. function initAssetRegisters (Vue) {
  17920. /**
  17921. * Create asset registration methods.
  17922. */
  17923. ASSET_TYPES.forEach(function (type) {
  17924. Vue[type] = function (
  17925. id,
  17926. definition
  17927. ) {
  17928. if (!definition) {
  17929. return this.options[type + 's'][id]
  17930. } else {
  17931. /* istanbul ignore if */
  17932. if ( true && type === 'component') {
  17933. validateComponentName(id);
  17934. }
  17935. if (type === 'component' && isPlainObject(definition)) {
  17936. definition.name = definition.name || id;
  17937. definition = this.options._base.extend(definition);
  17938. }
  17939. if (type === 'directive' && typeof definition === 'function') {
  17940. definition = { bind: definition, update: definition };
  17941. }
  17942. this.options[type + 's'][id] = definition;
  17943. return definition
  17944. }
  17945. };
  17946. });
  17947. }
  17948. /* */
  17949. function getComponentName (opts) {
  17950. return opts && (opts.Ctor.options.name || opts.tag)
  17951. }
  17952. function matches (pattern, name) {
  17953. if (Array.isArray(pattern)) {
  17954. return pattern.indexOf(name) > -1
  17955. } else if (typeof pattern === 'string') {
  17956. return pattern.split(',').indexOf(name) > -1
  17957. } else if (isRegExp(pattern)) {
  17958. return pattern.test(name)
  17959. }
  17960. /* istanbul ignore next */
  17961. return false
  17962. }
  17963. function pruneCache (keepAliveInstance, filter) {
  17964. var cache = keepAliveInstance.cache;
  17965. var keys = keepAliveInstance.keys;
  17966. var _vnode = keepAliveInstance._vnode;
  17967. for (var key in cache) {
  17968. var cachedNode = cache[key];
  17969. if (cachedNode) {
  17970. var name = getComponentName(cachedNode.componentOptions);
  17971. if (name && !filter(name)) {
  17972. pruneCacheEntry(cache, key, keys, _vnode);
  17973. }
  17974. }
  17975. }
  17976. }
  17977. function pruneCacheEntry (
  17978. cache,
  17979. key,
  17980. keys,
  17981. current
  17982. ) {
  17983. var cached$$1 = cache[key];
  17984. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  17985. cached$$1.componentInstance.$destroy();
  17986. }
  17987. cache[key] = null;
  17988. remove(keys, key);
  17989. }
  17990. var patternTypes = [String, RegExp, Array];
  17991. var KeepAlive = {
  17992. name: 'keep-alive',
  17993. abstract: true,
  17994. props: {
  17995. include: patternTypes,
  17996. exclude: patternTypes,
  17997. max: [String, Number]
  17998. },
  17999. created: function created () {
  18000. this.cache = Object.create(null);
  18001. this.keys = [];
  18002. },
  18003. destroyed: function destroyed () {
  18004. for (var key in this.cache) {
  18005. pruneCacheEntry(this.cache, key, this.keys);
  18006. }
  18007. },
  18008. mounted: function mounted () {
  18009. var this$1 = this;
  18010. this.$watch('include', function (val) {
  18011. pruneCache(this$1, function (name) { return matches(val, name); });
  18012. });
  18013. this.$watch('exclude', function (val) {
  18014. pruneCache(this$1, function (name) { return !matches(val, name); });
  18015. });
  18016. },
  18017. render: function render () {
  18018. var slot = this.$slots.default;
  18019. var vnode = getFirstComponentChild(slot);
  18020. var componentOptions = vnode && vnode.componentOptions;
  18021. if (componentOptions) {
  18022. // check pattern
  18023. var name = getComponentName(componentOptions);
  18024. var ref = this;
  18025. var include = ref.include;
  18026. var exclude = ref.exclude;
  18027. if (
  18028. // not included
  18029. (include && (!name || !matches(include, name))) ||
  18030. // excluded
  18031. (exclude && name && matches(exclude, name))
  18032. ) {
  18033. return vnode
  18034. }
  18035. var ref$1 = this;
  18036. var cache = ref$1.cache;
  18037. var keys = ref$1.keys;
  18038. var key = vnode.key == null
  18039. // same constructor may get registered as different local components
  18040. // so cid alone is not enough (#3269)
  18041. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  18042. : vnode.key;
  18043. if (cache[key]) {
  18044. vnode.componentInstance = cache[key].componentInstance;
  18045. // make current key freshest
  18046. remove(keys, key);
  18047. keys.push(key);
  18048. } else {
  18049. cache[key] = vnode;
  18050. keys.push(key);
  18051. // prune oldest entry
  18052. if (this.max && keys.length > parseInt(this.max)) {
  18053. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  18054. }
  18055. }
  18056. vnode.data.keepAlive = true;
  18057. }
  18058. return vnode || (slot && slot[0])
  18059. }
  18060. };
  18061. var builtInComponents = {
  18062. KeepAlive: KeepAlive
  18063. };
  18064. /* */
  18065. function initGlobalAPI (Vue) {
  18066. // config
  18067. var configDef = {};
  18068. configDef.get = function () { return config; };
  18069. if (true) {
  18070. configDef.set = function () {
  18071. warn(
  18072. 'Do not replace the Vue.config object, set individual fields instead.'
  18073. );
  18074. };
  18075. }
  18076. Object.defineProperty(Vue, 'config', configDef);
  18077. // exposed util methods.
  18078. // NOTE: these are not considered part of the public API - avoid relying on
  18079. // them unless you are aware of the risk.
  18080. Vue.util = {
  18081. warn: warn,
  18082. extend: extend,
  18083. mergeOptions: mergeOptions,
  18084. defineReactive: defineReactive$$1
  18085. };
  18086. Vue.set = set;
  18087. Vue.delete = del;
  18088. Vue.nextTick = nextTick;
  18089. // 2.6 explicit observable API
  18090. Vue.observable = function (obj) {
  18091. observe(obj);
  18092. return obj
  18093. };
  18094. Vue.options = Object.create(null);
  18095. ASSET_TYPES.forEach(function (type) {
  18096. Vue.options[type + 's'] = Object.create(null);
  18097. });
  18098. // this is used to identify the "base" constructor to extend all plain-object
  18099. // components with in Weex's multi-instance scenarios.
  18100. Vue.options._base = Vue;
  18101. extend(Vue.options.components, builtInComponents);
  18102. initUse(Vue);
  18103. initMixin$1(Vue);
  18104. initExtend(Vue);
  18105. initAssetRegisters(Vue);
  18106. }
  18107. initGlobalAPI(Vue);
  18108. Object.defineProperty(Vue.prototype, '$isServer', {
  18109. get: isServerRendering
  18110. });
  18111. Object.defineProperty(Vue.prototype, '$ssrContext', {
  18112. get: function get () {
  18113. /* istanbul ignore next */
  18114. return this.$vnode && this.$vnode.ssrContext
  18115. }
  18116. });
  18117. // expose FunctionalRenderContext for ssr runtime helper installation
  18118. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  18119. value: FunctionalRenderContext
  18120. });
  18121. Vue.version = '2.6.11';
  18122. /**
  18123. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  18124. */
  18125. var ARRAYTYPE = '[object Array]';
  18126. var OBJECTTYPE = '[object Object]';
  18127. // const FUNCTIONTYPE = '[object Function]'
  18128. function diff(current, pre) {
  18129. var result = {};
  18130. syncKeys(current, pre);
  18131. _diff(current, pre, '', result);
  18132. return result
  18133. }
  18134. function syncKeys(current, pre) {
  18135. if (current === pre) { return }
  18136. var rootCurrentType = type(current);
  18137. var rootPreType = type(pre);
  18138. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  18139. if(Object.keys(current).length >= Object.keys(pre).length){
  18140. for (var key in pre) {
  18141. var currentValue = current[key];
  18142. if (currentValue === undefined) {
  18143. current[key] = null;
  18144. } else {
  18145. syncKeys(currentValue, pre[key]);
  18146. }
  18147. }
  18148. }
  18149. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  18150. if (current.length >= pre.length) {
  18151. pre.forEach(function (item, index) {
  18152. syncKeys(current[index], item);
  18153. });
  18154. }
  18155. }
  18156. }
  18157. function _diff(current, pre, path, result) {
  18158. if (current === pre) { return }
  18159. var rootCurrentType = type(current);
  18160. var rootPreType = type(pre);
  18161. if (rootCurrentType == OBJECTTYPE) {
  18162. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  18163. setResult(result, path, current);
  18164. } else {
  18165. var loop = function ( key ) {
  18166. var currentValue = current[key];
  18167. var preValue = pre[key];
  18168. var currentType = type(currentValue);
  18169. var preType = type(preValue);
  18170. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  18171. if (currentValue !== pre[key]) {
  18172. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  18173. }
  18174. } else if (currentType == ARRAYTYPE) {
  18175. if (preType != ARRAYTYPE) {
  18176. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  18177. } else {
  18178. if (currentValue.length < preValue.length) {
  18179. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  18180. } else {
  18181. currentValue.forEach(function (item, index) {
  18182. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  18183. });
  18184. }
  18185. }
  18186. } else if (currentType == OBJECTTYPE) {
  18187. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  18188. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  18189. } else {
  18190. for (var subKey in currentValue) {
  18191. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  18192. }
  18193. }
  18194. }
  18195. };
  18196. for (var key in current) loop( key );
  18197. }
  18198. } else if (rootCurrentType == ARRAYTYPE) {
  18199. if (rootPreType != ARRAYTYPE) {
  18200. setResult(result, path, current);
  18201. } else {
  18202. if (current.length < pre.length) {
  18203. setResult(result, path, current);
  18204. } else {
  18205. current.forEach(function (item, index) {
  18206. _diff(item, pre[index], path + '[' + index + ']', result);
  18207. });
  18208. }
  18209. }
  18210. } else {
  18211. setResult(result, path, current);
  18212. }
  18213. }
  18214. function setResult(result, k, v) {
  18215. // if (type(v) != FUNCTIONTYPE) {
  18216. result[k] = v;
  18217. // }
  18218. }
  18219. function type(obj) {
  18220. return Object.prototype.toString.call(obj)
  18221. }
  18222. /* */
  18223. function flushCallbacks$1(vm) {
  18224. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  18225. if (Object({"VUE_APP_NAME":"agriculture","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  18226. var mpInstance = vm.$scope;
  18227. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  18228. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  18229. }
  18230. var copies = vm.__next_tick_callbacks.slice(0);
  18231. vm.__next_tick_callbacks.length = 0;
  18232. for (var i = 0; i < copies.length; i++) {
  18233. copies[i]();
  18234. }
  18235. }
  18236. }
  18237. function hasRenderWatcher(vm) {
  18238. return queue.find(function (watcher) { return vm._watcher === watcher; })
  18239. }
  18240. function nextTick$1(vm, cb) {
  18241. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  18242. //2.nextTick 之前存在 render watcher
  18243. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  18244. if(Object({"VUE_APP_NAME":"agriculture","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  18245. var mpInstance = vm.$scope;
  18246. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  18247. ']:nextVueTick');
  18248. }
  18249. return nextTick(cb, vm)
  18250. }else{
  18251. if(Object({"VUE_APP_NAME":"agriculture","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  18252. var mpInstance$1 = vm.$scope;
  18253. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  18254. ']:nextMPTick');
  18255. }
  18256. }
  18257. var _resolve;
  18258. if (!vm.__next_tick_callbacks) {
  18259. vm.__next_tick_callbacks = [];
  18260. }
  18261. vm.__next_tick_callbacks.push(function () {
  18262. if (cb) {
  18263. try {
  18264. cb.call(vm);
  18265. } catch (e) {
  18266. handleError(e, vm, 'nextTick');
  18267. }
  18268. } else if (_resolve) {
  18269. _resolve(vm);
  18270. }
  18271. });
  18272. // $flow-disable-line
  18273. if (!cb && typeof Promise !== 'undefined') {
  18274. return new Promise(function (resolve) {
  18275. _resolve = resolve;
  18276. })
  18277. }
  18278. }
  18279. /* */
  18280. function cloneWithData(vm) {
  18281. // 确保当前 vm 所有数据被同步
  18282. var ret = Object.create(null);
  18283. var dataKeys = [].concat(
  18284. Object.keys(vm._data || {}),
  18285. Object.keys(vm._computedWatchers || {}));
  18286. dataKeys.reduce(function(ret, key) {
  18287. ret[key] = vm[key];
  18288. return ret
  18289. }, ret);
  18290. // vue-composition-api
  18291. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  18292. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  18293. if (rawBindings) {
  18294. Object.keys(rawBindings).forEach(function (key) {
  18295. ret[key] = vm[key];
  18296. });
  18297. }
  18298. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  18299. Object.assign(ret, vm.$mp.data || {});
  18300. if (
  18301. Array.isArray(vm.$options.behaviors) &&
  18302. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  18303. ) { //form-field
  18304. ret['name'] = vm.name;
  18305. ret['value'] = vm.value;
  18306. }
  18307. return JSON.parse(JSON.stringify(ret))
  18308. }
  18309. var patch = function(oldVnode, vnode) {
  18310. var this$1 = this;
  18311. if (vnode === null) { //destroy
  18312. return
  18313. }
  18314. if (this.mpType === 'page' || this.mpType === 'component') {
  18315. var mpInstance = this.$scope;
  18316. var data = Object.create(null);
  18317. try {
  18318. data = cloneWithData(this);
  18319. } catch (err) {
  18320. console.error(err);
  18321. }
  18322. data.__webviewId__ = mpInstance.data.__webviewId__;
  18323. var mpData = Object.create(null);
  18324. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  18325. mpData[key] = mpInstance.data[key];
  18326. });
  18327. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  18328. if (Object.keys(diffData).length) {
  18329. if (Object({"VUE_APP_NAME":"agriculture","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  18330. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  18331. ']差量更新',
  18332. JSON.stringify(diffData));
  18333. }
  18334. this.__next_tick_pending = true;
  18335. mpInstance.setData(diffData, function () {
  18336. this$1.__next_tick_pending = false;
  18337. flushCallbacks$1(this$1);
  18338. });
  18339. } else {
  18340. flushCallbacks$1(this);
  18341. }
  18342. }
  18343. };
  18344. /* */
  18345. function createEmptyRender() {
  18346. }
  18347. function mountComponent$1(
  18348. vm,
  18349. el,
  18350. hydrating
  18351. ) {
  18352. if (!vm.mpType) {//main.js 中的 new Vue
  18353. return vm
  18354. }
  18355. if (vm.mpType === 'app') {
  18356. vm.$options.render = createEmptyRender;
  18357. }
  18358. if (!vm.$options.render) {
  18359. vm.$options.render = createEmptyRender;
  18360. if (true) {
  18361. /* istanbul ignore if */
  18362. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  18363. vm.$options.el || el) {
  18364. warn(
  18365. 'You are using the runtime-only build of Vue where the template ' +
  18366. 'compiler is not available. Either pre-compile the templates into ' +
  18367. 'render functions, or use the compiler-included build.',
  18368. vm
  18369. );
  18370. } else {
  18371. warn(
  18372. 'Failed to mount component: template or render function not defined.',
  18373. vm
  18374. );
  18375. }
  18376. }
  18377. }
  18378. !vm._$fallback && callHook(vm, 'beforeMount');
  18379. var updateComponent = function () {
  18380. vm._update(vm._render(), hydrating);
  18381. };
  18382. // we set this to vm._watcher inside the watcher's constructor
  18383. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  18384. // component's mounted hook), which relies on vm._watcher being already defined
  18385. new Watcher(vm, updateComponent, noop, {
  18386. before: function before() {
  18387. if (vm._isMounted && !vm._isDestroyed) {
  18388. callHook(vm, 'beforeUpdate');
  18389. }
  18390. }
  18391. }, true /* isRenderWatcher */);
  18392. hydrating = false;
  18393. return vm
  18394. }
  18395. /* */
  18396. function renderClass (
  18397. staticClass,
  18398. dynamicClass
  18399. ) {
  18400. if (isDef(staticClass) || isDef(dynamicClass)) {
  18401. return concat(staticClass, stringifyClass(dynamicClass))
  18402. }
  18403. /* istanbul ignore next */
  18404. return ''
  18405. }
  18406. function concat (a, b) {
  18407. return a ? b ? (a + ' ' + b) : a : (b || '')
  18408. }
  18409. function stringifyClass (value) {
  18410. if (Array.isArray(value)) {
  18411. return stringifyArray(value)
  18412. }
  18413. if (isObject(value)) {
  18414. return stringifyObject(value)
  18415. }
  18416. if (typeof value === 'string') {
  18417. return value
  18418. }
  18419. /* istanbul ignore next */
  18420. return ''
  18421. }
  18422. function stringifyArray (value) {
  18423. var res = '';
  18424. var stringified;
  18425. for (var i = 0, l = value.length; i < l; i++) {
  18426. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  18427. if (res) { res += ' '; }
  18428. res += stringified;
  18429. }
  18430. }
  18431. return res
  18432. }
  18433. function stringifyObject (value) {
  18434. var res = '';
  18435. for (var key in value) {
  18436. if (value[key]) {
  18437. if (res) { res += ' '; }
  18438. res += key;
  18439. }
  18440. }
  18441. return res
  18442. }
  18443. /* */
  18444. var parseStyleText = cached(function (cssText) {
  18445. var res = {};
  18446. var listDelimiter = /;(?![^(]*\))/g;
  18447. var propertyDelimiter = /:(.+)/;
  18448. cssText.split(listDelimiter).forEach(function (item) {
  18449. if (item) {
  18450. var tmp = item.split(propertyDelimiter);
  18451. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  18452. }
  18453. });
  18454. return res
  18455. });
  18456. // normalize possible array / string values into Object
  18457. function normalizeStyleBinding (bindingStyle) {
  18458. if (Array.isArray(bindingStyle)) {
  18459. return toObject(bindingStyle)
  18460. }
  18461. if (typeof bindingStyle === 'string') {
  18462. return parseStyleText(bindingStyle)
  18463. }
  18464. return bindingStyle
  18465. }
  18466. /* */
  18467. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  18468. function getTarget(obj, path) {
  18469. var parts = path.split('.');
  18470. var key = parts[0];
  18471. if (key.indexOf('__$n') === 0) { //number index
  18472. key = parseInt(key.replace('__$n', ''));
  18473. }
  18474. if (parts.length === 1) {
  18475. return obj[key]
  18476. }
  18477. return getTarget(obj[key], parts.slice(1).join('.'))
  18478. }
  18479. function internalMixin(Vue) {
  18480. Vue.config.errorHandler = function(err, vm, info) {
  18481. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  18482. console.error(err);
  18483. /* eslint-disable no-undef */
  18484. var app = typeof getApp === 'function' && getApp();
  18485. if (app && app.onError) {
  18486. app.onError(err);
  18487. }
  18488. };
  18489. var oldEmit = Vue.prototype.$emit;
  18490. Vue.prototype.$emit = function(event) {
  18491. if (this.$scope && event) {
  18492. (this.$scope['_triggerEvent'] || this.$scope['triggerEvent']).call(this.$scope, event, {
  18493. __args__: toArray(arguments, 1)
  18494. });
  18495. }
  18496. return oldEmit.apply(this, arguments)
  18497. };
  18498. Vue.prototype.$nextTick = function(fn) {
  18499. return nextTick$1(this, fn)
  18500. };
  18501. MP_METHODS.forEach(function (method) {
  18502. Vue.prototype[method] = function(args) {
  18503. if (this.$scope && this.$scope[method]) {
  18504. return this.$scope[method](args)
  18505. }
  18506. // mp-alipay
  18507. if (typeof my === 'undefined') {
  18508. return
  18509. }
  18510. if (method === 'createSelectorQuery') {
  18511. /* eslint-disable no-undef */
  18512. return my.createSelectorQuery(args)
  18513. } else if (method === 'createIntersectionObserver') {
  18514. /* eslint-disable no-undef */
  18515. return my.createIntersectionObserver(args)
  18516. }
  18517. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  18518. };
  18519. });
  18520. Vue.prototype.__init_provide = initProvide;
  18521. Vue.prototype.__init_injections = initInjections;
  18522. Vue.prototype.__call_hook = function(hook, args) {
  18523. var vm = this;
  18524. // #7573 disable dep collection when invoking lifecycle hooks
  18525. pushTarget();
  18526. var handlers = vm.$options[hook];
  18527. var info = hook + " hook";
  18528. var ret;
  18529. if (handlers) {
  18530. for (var i = 0, j = handlers.length; i < j; i++) {
  18531. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  18532. }
  18533. }
  18534. if (vm._hasHookEvent) {
  18535. vm.$emit('hook:' + hook, args);
  18536. }
  18537. popTarget();
  18538. return ret
  18539. };
  18540. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  18541. if (Array.isArray(modifiers)) {
  18542. if (modifiers.indexOf('trim') !== -1) {
  18543. value = value.trim();
  18544. }
  18545. if (modifiers.indexOf('number') !== -1) {
  18546. value = this._n(value);
  18547. }
  18548. }
  18549. if (!target) {
  18550. target = this;
  18551. }
  18552. // 解决动态属性添加
  18553. Vue.set(target, key, value);
  18554. };
  18555. Vue.prototype.__set_sync = function(target, key, value) {
  18556. if (!target) {
  18557. target = this;
  18558. }
  18559. // 解决动态属性添加
  18560. Vue.set(target, key, value);
  18561. };
  18562. Vue.prototype.__get_orig = function(item) {
  18563. if (isPlainObject(item)) {
  18564. return item['$orig'] || item
  18565. }
  18566. return item
  18567. };
  18568. Vue.prototype.__get_value = function(dataPath, target) {
  18569. return getTarget(target || this, dataPath)
  18570. };
  18571. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  18572. return renderClass(staticClass, dynamicClass)
  18573. };
  18574. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  18575. if (!dynamicStyle && !staticStyle) {
  18576. return ''
  18577. }
  18578. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  18579. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  18580. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  18581. };
  18582. Vue.prototype.__map = function(val, iteratee) {
  18583. //TODO 暂不考虑 string
  18584. var ret, i, l, keys, key;
  18585. if (Array.isArray(val)) {
  18586. ret = new Array(val.length);
  18587. for (i = 0, l = val.length; i < l; i++) {
  18588. ret[i] = iteratee(val[i], i);
  18589. }
  18590. return ret
  18591. } else if (isObject(val)) {
  18592. keys = Object.keys(val);
  18593. ret = Object.create(null);
  18594. for (i = 0, l = keys.length; i < l; i++) {
  18595. key = keys[i];
  18596. ret[key] = iteratee(val[key], key, i);
  18597. }
  18598. return ret
  18599. } else if (typeof val === 'number') {
  18600. ret = new Array(val);
  18601. for (i = 0, l = val; i < l; i++) {
  18602. // 第一个参数暂时仍和小程序一致
  18603. ret[i] = iteratee(i, i);
  18604. }
  18605. return ret
  18606. }
  18607. return []
  18608. };
  18609. }
  18610. /* */
  18611. var LIFECYCLE_HOOKS$1 = [
  18612. //App
  18613. 'onLaunch',
  18614. 'onShow',
  18615. 'onHide',
  18616. 'onUniNViewMessage',
  18617. 'onPageNotFound',
  18618. 'onThemeChange',
  18619. 'onError',
  18620. 'onUnhandledRejection',
  18621. //Page
  18622. 'onInit',
  18623. 'onLoad',
  18624. // 'onShow',
  18625. 'onReady',
  18626. // 'onHide',
  18627. 'onUnload',
  18628. 'onPullDownRefresh',
  18629. 'onReachBottom',
  18630. 'onTabItemTap',
  18631. 'onAddToFavorites',
  18632. 'onShareTimeline',
  18633. 'onShareAppMessage',
  18634. 'onResize',
  18635. 'onPageScroll',
  18636. 'onNavigationBarButtonTap',
  18637. 'onBackPress',
  18638. 'onNavigationBarSearchInputChanged',
  18639. 'onNavigationBarSearchInputConfirmed',
  18640. 'onNavigationBarSearchInputClicked',
  18641. //Component
  18642. // 'onReady', // 兼容旧版本,应该移除该事件
  18643. 'onPageShow',
  18644. 'onPageHide',
  18645. 'onPageResize'
  18646. ];
  18647. function lifecycleMixin$1(Vue) {
  18648. //fixed vue-class-component
  18649. var oldExtend = Vue.extend;
  18650. Vue.extend = function(extendOptions) {
  18651. extendOptions = extendOptions || {};
  18652. var methods = extendOptions.methods;
  18653. if (methods) {
  18654. Object.keys(methods).forEach(function (methodName) {
  18655. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  18656. extendOptions[methodName] = methods[methodName];
  18657. delete methods[methodName];
  18658. }
  18659. });
  18660. }
  18661. return oldExtend.call(this, extendOptions)
  18662. };
  18663. var strategies = Vue.config.optionMergeStrategies;
  18664. var mergeHook = strategies.created;
  18665. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  18666. strategies[hook] = mergeHook;
  18667. });
  18668. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  18669. }
  18670. /* */
  18671. // install platform patch function
  18672. Vue.prototype.__patch__ = patch;
  18673. // public mount method
  18674. Vue.prototype.$mount = function(
  18675. el ,
  18676. hydrating
  18677. ) {
  18678. return mountComponent$1(this, el, hydrating)
  18679. };
  18680. lifecycleMixin$1(Vue);
  18681. internalMixin(Vue);
  18682. /* */
  18683. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  18684. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  18685. /***/ }),
  18686. /***/ 5:
  18687. /*!************************************!*\
  18688. !*** F:/工作项目/pingpu_H5/pages.json ***!
  18689. \************************************/
  18690. /*! no static exports found */
  18691. /***/ (function(module, exports) {
  18692. /***/ }),
  18693. /***/ 60:
  18694. /*!*************************************!*\
  18695. !*** F:/工作项目/pingpu_H5/api/worm.js ***!
  18696. \*************************************/
  18697. /*! no static exports found */
  18698. /***/ (function(module, exports, __webpack_require__) {
  18699. "use strict";
  18700. Object.defineProperty(exports, "__esModule", { value: true });exports.getWormLampHistory = exports.getPestBaseData = exports.getPestImageSource = exports.getPestStatisticsChart = exports.getPestRaiseInfo = exports.getWormDetails = exports.getWormImageList = exports.getPestWarningList = exports.getWormLampDetails = exports.getWormLampList = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 13));var _index = _interopRequireDefault(__webpack_require__(/*! @/utils/request/index.js */ 33));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  18701. /**
  18702. * 虫情监测模块
  18703. */
  18704. // 虫情监测模块请求父类函数
  18705. var wormRequest = /*#__PURE__*/function () {var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(url, data) {var res;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.next = 2;return (
  18706. _index.default.post("api/api_gateway?method=forecast.worm_lamp.".concat(url), data));case 2:res = _context.sent;return _context.abrupt("return",
  18707. res === null || res === void 0 ? void 0 : res.data);case 4:case "end":return _context.stop();}}}, _callee);}));return function wormRequest(_x, _x2) {return _ref.apply(this, arguments);};}();
  18708. // 测报灯列表
  18709. var getWormLampList = function getWormLampList(params) {return wormRequest('lamp_list', params);};
  18710. // 测报灯详情
  18711. exports.getWormLampList = getWormLampList;var getWormLampDetails = function getWormLampDetails(params) {return wormRequest('device_status_data', params);};
  18712. // 害虫预警
  18713. exports.getWormLampDetails = getWormLampDetails;var getPestWarningList = function getPestWarningList(params) {return wormRequest('cbd_pest_warning', params);};
  18714. // 图片列表
  18715. exports.getPestWarningList = getPestWarningList;var getWormImageList = /*#__PURE__*/function () {var _ref2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2(params) {var res;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:_context2.next = 2;return (
  18716. _index.default.post("api/api_gateway?method=forecast.forecast_system.device_photo_list", params));case 2:res = _context2.sent;return _context2.abrupt("return",
  18717. res === null || res === void 0 ? void 0 : res.data);case 4:case "end":return _context2.stop();}}}, _callee2);}));return function getWormImageList(_x3) {return _ref2.apply(this, arguments);};}();
  18718. // 害虫数据详情
  18719. exports.getWormImageList = getWormImageList;var getWormDetails = function getWormDetails(params) {return wormRequest('worm_list', params);};
  18720. // 虫情分析-始见期
  18721. exports.getWormDetails = getWormDetails;var getPestRaiseInfo = function getPestRaiseInfo(params) {return wormRequest('pest_raise_info', params);};
  18722. // 虫情分析-折线图
  18723. exports.getPestRaiseInfo = getPestRaiseInfo;var getPestStatisticsChart = function getPestStatisticsChart(params) {return wormRequest('pest_statistics_char_new', params);};
  18724. // 虫情分析-害虫图片溯源
  18725. exports.getPestStatisticsChart = getPestStatisticsChart;var getPestImageSource = function getPestImageSource(params) {return wormRequest('pest_image_source', params);};
  18726. // 虫情分析-害虫基础信息溯源
  18727. exports.getPestImageSource = getPestImageSource;var getPestBaseData = function getPestBaseData(params) {return wormRequest('pest_base_data', params);};
  18728. // 历史数据
  18729. exports.getPestBaseData = getPestBaseData;var getWormLampHistory = function getWormLampHistory(params) {return wormRequest('device_history_data', params);};exports.getWormLampHistory = getWormLampHistory;
  18730. /***/ }),
  18731. /***/ 99:
  18732. /*!***************************************!*\
  18733. !*** F:/工作项目/pingpu_H5/api/camera.js ***!
  18734. \***************************************/
  18735. /*! no static exports found */
  18736. /***/ (function(module, exports, __webpack_require__) {
  18737. "use strict";
  18738. Object.defineProperty(exports, "__esModule", { value: true });exports.controlCamera = exports.getCameraAddress = exports.getCameraList = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 13));var _index = _interopRequireDefault(__webpack_require__(/*! @/utils/request/index.js */ 33));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  18739. /**
  18740. * 可视监控模块
  18741. */
  18742. // 可视监控数据请求父类函数
  18743. var cameraRequest = /*#__PURE__*/function () {var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(url, data) {var res;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.next = 2;return (
  18744. _index.default.post("api/api_gateway?method=camera.camera_manage.".concat(url), data));case 2:res = _context.sent;return _context.abrupt("return",
  18745. res === null || res === void 0 ? void 0 : res.data);case 4:case "end":return _context.stop();}}}, _callee);}));return function cameraRequest(_x, _x2) {return _ref.apply(this, arguments);};}();
  18746. // 监控列表
  18747. var getCameraList = function getCameraList(data) {return cameraRequest('list_camera', data);};
  18748. // 播放地址
  18749. exports.getCameraList = getCameraList;var getCameraAddress = function getCameraAddress(data) {return cameraRequest('addr_camera', data);};
  18750. // 监控控制
  18751. exports.getCameraAddress = getCameraAddress;var controlCamera = function controlCamera(data) {return cameraRequest('ctrl_camera', data);};exports.controlCamera = controlCamera;
  18752. /***/ })
  18753. }]);
  18754. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map