12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860 |
- define(['exports', 'axios', 'qs', 'lodash', 'jquery', 'moment', 'recast', 'xlsx', 'localforage', 'modeler', 'bpmn-js-properties-panel', 'lay-excel', 'handlebars', 'xterm', 'xterm-addon-fit', 'sql-formatter'], function (exports, axios, Qs, _$2, $$2, moment$1, recast, XLSX, localforage, BpmnModeler, bpmnJsPropertiesPanel, LAY_EXCEL, handlebars, xterm, xtermAddonFit, sqlFormat) { 'use strict';
- var axios__default = 'default' in axios ? axios['default'] : axios;
- Qs = Qs && Object.prototype.hasOwnProperty.call(Qs, 'default') ? Qs['default'] : Qs;
- _$2 = _$2 && Object.prototype.hasOwnProperty.call(_$2, 'default') ? _$2['default'] : _$2;
- $$2 = $$2 && Object.prototype.hasOwnProperty.call($$2, 'default') ? $$2['default'] : $$2;
- moment$1 = moment$1 && Object.prototype.hasOwnProperty.call(moment$1, 'default') ? moment$1['default'] : moment$1;
- XLSX = XLSX && Object.prototype.hasOwnProperty.call(XLSX, 'default') ? XLSX['default'] : XLSX;
- localforage = localforage && Object.prototype.hasOwnProperty.call(localforage, 'default') ? localforage['default'] : localforage;
- BpmnModeler = BpmnModeler && Object.prototype.hasOwnProperty.call(BpmnModeler, 'default') ? BpmnModeler['default'] : BpmnModeler;
- LAY_EXCEL = LAY_EXCEL && Object.prototype.hasOwnProperty.call(LAY_EXCEL, 'default') ? LAY_EXCEL['default'] : LAY_EXCEL;
- handlebars = handlebars && Object.prototype.hasOwnProperty.call(handlebars, 'default') ? handlebars['default'] : handlebars;
- sqlFormat = sqlFormat && Object.prototype.hasOwnProperty.call(sqlFormat, 'default') ? sqlFormat['default'] : sqlFormat;
- var labelWidth = 80;
- var windows = {
- modal: true,
- width: 900,
- height: 600,
- maximizable: true,
- constrain: true,
- shadow: false,
- };
- var date = {
- labelAlign: 'right',
- labelWidth: labelWidth,
- };
- var tagfield = {
- labelAlign: 'right',
- labelWidth: labelWidth,
- valueField: 'id',
- displayField: 'text',
- autoLoad: true,
- mode: 'local',
- forceSelection: true,
- triggerAction: 'all',
- enableKeyEvents: true,
- queryMode: 'local',
- filterPickList: true,
- };
- var combo = {
- labelAlign: 'right',
- labelWidth: labelWidth,
- valueField: 'id',
- displayField: 'text',
- autoLoad: true,
- mode: 'local',
- forceSelection: true,
- triggerAction: 'all',
- enableKeyEvents: true,
- };
- var comboGrid = {
- selectOnTab: true,
- pickerHeight: 500,
- pickerWidth: 850,
- editEnable: null,
- };
- var comboGridPicker = {
- xtype: 'yvgrid',
- layout: 'fit',
- selModel: {
- selType: 'rowmodel',
- mode: 'SINGLE'
- },
- };
- var comboGridMulti = {
- selectOnTab: true,
- pickerHeight: 500,
- pickerWidth: 850,
- editEnable: null,
- splitChar: ',',
- displayField: 'text',
- valueField: 'id',
- autoLoad: true,
- };
- var comboGridMultiPicker = {
- selType: 'checkboxmodel',
- selModel: {
- type: 'checkboxmodel',
- checkOnly: false
- },
- };
- var numberfield = {
- labelAlign: 'right',
- decimalPrecision: 6,
- labelWidth: labelWidth,
- };
- var checkbox = {
- labelAlign: 'right',
- labelWidth: labelWidth,
- checkedValue: true,
- uncheckedValue: false,
- };
- var checkboxgroup = {
- labelAlign: 'right',
- labelWidth: labelWidth,
- };
- var radio = {
- labelAlign: 'right',
- labelWidth: labelWidth,
- };
- var radiogroup = {
- labelAlign: 'right',
- labelWidth: labelWidth,
- simpleValue: true,
- layout: 'hbox',
- defaults: {
- xtype: 'radio',
- name: 'type',
- margin: '0 15 0 0'
- },
- };
- var form = {
- margin: '5 5 0 0',
- border: false,
- defaults: {
- margin: '0 0 5 0',
- border: false,
- },
- };
- var column = {
- filter: { type: 'string' },
- };
- var grid = {
- border: true,
- columnLines: true,
- rowLines: true,
- plugins: {
- cellediting: {
- clicksToEdit: 1,
- },
- gridfilters: true
- },
- multiColumnSort: true,
- viewConfig: {
- enableTextSelection: true,
- sortOnClick: false,
- emptyText: '没有数据'
- },
- selModel: {
- type: 'checkboxmodel',
- checkOnly: false
- },
- pagination: true,
- pageSize: 50,
- pageSizeOption: ['20', '50', '100', '200', '300', '500', '1000'],
- hideFootbar: false,
- hideRefresh: false,
- hideExport: false,
- hideAutoSize: false,
- hideClearFilter: false,
- hideSaveGridUIConfig: false,
- hideClearGridUIConfig: false,
- autoLoad: true,
- remoteSort: false,
- remoteFilter: false,
- enableLocking: true,
- syncRowHeight: false,
- enableColumnMove: true,
- enableColumnHide: true,
- enableColumnResize: true,
- hidden: false,
- disabled: false,
- exportExcelPageSize: 100,
- exportExcelCurrentPage: 1,
- exportExcelTotal: 0,
- cellTip: false,
- };
- var fieldContainer = {
- labelAlign: 'right',
- labelWidth: labelWidth,
- layout: 'hbox',
- defaults: {
- flex: 1,
- }
- };
- var tree = {
- autoLoad: true,
- hideFilter: false,
- hideToolbar: false,
- hideRefresh: false,
- hideExpand: false,
- hideCollapse: false,
- root: [],
- rootVisible: false,
- };
- var search = {
- labelAlign: 'right',
- labelWidth: labelWidth,
- };
- var text = {
- labelAlign: 'right',
- labelWidth: labelWidth,
- msgTarget: 'qtip',
- };
- var toolbar = {
- overflowHandler: 'menu',
- };
- var tbfill = {};
- var tbseparator = {};
- var button = {};
- var fieldSet = {
- margin: '5 5 0 0',
- border: false,
- defaults: {
- margin: '0 0 5 0',
- border: false,
- },
- };
- var storeAjax = {
- timeout: 60000
- };
- var panel = {};
- var splitter = {};
- var maintab = {};
- var rows = {};
- var cols = {
- defaults: {
- flex: 1
- },
- };
- var bpmn = {
- hideRefresh: false,
- autoLoad: true,
- dataSource: '',
- bpmnConfig: {}
- };
- //# sourceMappingURL=Defaults.js.map
- var Defaults = /*#__PURE__*/Object.freeze({
- __proto__: null,
- windows: windows,
- date: date,
- tagfield: tagfield,
- combo: combo,
- comboGrid: comboGrid,
- comboGridPicker: comboGridPicker,
- comboGridMulti: comboGridMulti,
- comboGridMultiPicker: comboGridMultiPicker,
- numberfield: numberfield,
- checkbox: checkbox,
- checkboxgroup: checkboxgroup,
- radio: radio,
- radiogroup: radiogroup,
- form: form,
- column: column,
- grid: grid,
- fieldContainer: fieldContainer,
- tree: tree,
- search: search,
- text: text,
- toolbar: toolbar,
- tbfill: tbfill,
- tbseparator: tbseparator,
- button: button,
- fieldSet: fieldSet,
- storeAjax: storeAjax,
- panel: panel,
- splitter: splitter,
- maintab: maintab,
- rows: rows,
- cols: cols,
- bpmn: bpmn
- });
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
- function createCommonjsModule(fn, module) {
- return module = { exports: {} }, fn(module, module.exports), module.exports;
- }
- var dist = createCommonjsModule(function (module, exports) {
- (function (global, factory) {
- module.exports = factory() ;
- }(commonjsGlobal, (function () {
- function createCommonjsModule(fn, module) {
- return module = { exports: {} }, fn(module, module.exports), module.exports;
- }
- var _global = createCommonjsModule(function (module) {
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
- var global = module.exports = typeof window != 'undefined' && window.Math == Math
- ? window : typeof self != 'undefined' && self.Math == Math ? self
- // eslint-disable-next-line no-new-func
- : Function('return this')();
- if (typeof __g == 'number') { __g = global; } // eslint-disable-line no-undef
- });
- var _core = createCommonjsModule(function (module) {
- var core = module.exports = { version: '2.6.5' };
- if (typeof __e == 'number') { __e = core; } // eslint-disable-line no-undef
- });
- var _core_1 = _core.version;
- var _isObject = function (it) {
- return typeof it === 'object' ? it !== null : typeof it === 'function';
- };
- var _anObject = function (it) {
- if (!_isObject(it)) { throw TypeError(it + ' is not an object!'); }
- return it;
- };
- var _fails = function (exec) {
- try {
- return !!exec();
- } catch (e) {
- return true;
- }
- };
- // Thank's IE8 for his funny defineProperty
- var _descriptors = !_fails(function () {
- return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
- });
- var document = _global.document;
- // typeof document.createElement is 'object' in old IE
- var is = _isObject(document) && _isObject(document.createElement);
- var _domCreate = function (it) {
- return is ? document.createElement(it) : {};
- };
- var _ie8DomDefine = !_descriptors && !_fails(function () {
- return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;
- });
- // 7.1.1 ToPrimitive(input [, PreferredType])
- // instead of the ES6 spec version, we didn't implement @@toPrimitive case
- // and the second argument - flag - preferred type is a string
- var _toPrimitive = function (it, S) {
- if (!_isObject(it)) { return it; }
- var fn, val;
- if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) { return val; }
- if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) { return val; }
- if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) { return val; }
- throw TypeError("Can't convert object to primitive value");
- };
- var dP = Object.defineProperty;
- var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
- _anObject(O);
- P = _toPrimitive(P, true);
- _anObject(Attributes);
- if (_ie8DomDefine) { try {
- return dP(O, P, Attributes);
- } catch (e) { /* empty */ } }
- if ('get' in Attributes || 'set' in Attributes) { throw TypeError('Accessors not supported!'); }
- if ('value' in Attributes) { O[P] = Attributes.value; }
- return O;
- };
- var _objectDp = {
- f: f
- };
- var _propertyDesc = function (bitmap, value) {
- return {
- enumerable: !(bitmap & 1),
- configurable: !(bitmap & 2),
- writable: !(bitmap & 4),
- value: value
- };
- };
- var _hide = _descriptors ? function (object, key, value) {
- return _objectDp.f(object, key, _propertyDesc(1, value));
- } : function (object, key, value) {
- object[key] = value;
- return object;
- };
- var hasOwnProperty = {}.hasOwnProperty;
- var _has = function (it, key) {
- return hasOwnProperty.call(it, key);
- };
- var id = 0;
- var px = Math.random();
- var _uid = function (key) {
- return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
- };
- var _shared = createCommonjsModule(function (module) {
- var SHARED = '__core-js_shared__';
- var store = _global[SHARED] || (_global[SHARED] = {});
- (module.exports = function (key, value) {
- return store[key] || (store[key] = value !== undefined ? value : {});
- })('versions', []).push({
- version: _core.version,
- mode: 'global',
- copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
- });
- });
- var _functionToString = _shared('native-function-to-string', Function.toString);
- var _redefine = createCommonjsModule(function (module) {
- var SRC = _uid('src');
- var TO_STRING = 'toString';
- var TPL = ('' + _functionToString).split(TO_STRING);
- _core.inspectSource = function (it) {
- return _functionToString.call(it);
- };
- (module.exports = function (O, key, val, safe) {
- var isFunction = typeof val == 'function';
- if (isFunction) { _has(val, 'name') || _hide(val, 'name', key); }
- if (O[key] === val) { return; }
- if (isFunction) { _has(val, SRC) || _hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); }
- if (O === _global) {
- O[key] = val;
- } else if (!safe) {
- delete O[key];
- _hide(O, key, val);
- } else if (O[key]) {
- O[key] = val;
- } else {
- _hide(O, key, val);
- }
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
- })(Function.prototype, TO_STRING, function toString() {
- return typeof this == 'function' && this[SRC] || _functionToString.call(this);
- });
- });
- var _aFunction = function (it) {
- if (typeof it != 'function') { throw TypeError(it + ' is not a function!'); }
- return it;
- };
- // optional / simple context binding
- var _ctx = function (fn, that, length) {
- _aFunction(fn);
- if (that === undefined) { return fn; }
- switch (length) {
- case 1: return function (a) {
- return fn.call(that, a);
- };
- case 2: return function (a, b) {
- return fn.call(that, a, b);
- };
- case 3: return function (a, b, c) {
- return fn.call(that, a, b, c);
- };
- }
- return function (/* ...args */) {
- return fn.apply(that, arguments);
- };
- };
- var PROTOTYPE = 'prototype';
- var $export = function (type, name, source) {
- var IS_FORCED = type & $export.F;
- var IS_GLOBAL = type & $export.G;
- var IS_STATIC = type & $export.S;
- var IS_PROTO = type & $export.P;
- var IS_BIND = type & $export.B;
- var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] || (_global[name] = {}) : (_global[name] || {})[PROTOTYPE];
- var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});
- var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
- var key, own, out, exp;
- if (IS_GLOBAL) { source = name; }
- for (key in source) {
- // contains in native
- own = !IS_FORCED && target && target[key] !== undefined;
- // export native or passed
- out = (own ? target : source)[key];
- // bind timers to global for call from export context
- exp = IS_BIND && own ? _ctx(out, _global) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;
- // extend global
- if (target) { _redefine(target, key, out, type & $export.U); }
- // export
- if (exports[key] != out) { _hide(exports, key, exp); }
- if (IS_PROTO && expProto[key] != out) { expProto[key] = out; }
- }
- };
- _global.core = _core;
- // type bitmap
- $export.F = 1; // forced
- $export.G = 2; // global
- $export.S = 4; // static
- $export.P = 8; // proto
- $export.B = 16; // bind
- $export.W = 32; // wrap
- $export.U = 64; // safe
- $export.R = 128; // real proto method for `library`
- var _export = $export;
- // 7.1.4 ToInteger
- var ceil = Math.ceil;
- var floor = Math.floor;
- var _toInteger = function (it) {
- return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
- };
- // 7.2.1 RequireObjectCoercible(argument)
- var _defined = function (it) {
- if (it == undefined) { throw TypeError("Can't call method on " + it); }
- return it;
- };
- // true -> String#at
- // false -> String#codePointAt
- var _stringAt = function (TO_STRING) {
- return function (that, pos) {
- var s = String(_defined(that));
- var i = _toInteger(pos);
- var l = s.length;
- var a, b;
- if (i < 0 || i >= l) { return TO_STRING ? '' : undefined; }
- a = s.charCodeAt(i);
- return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
- ? TO_STRING ? s.charAt(i) : a
- : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
- };
- };
- var $at = _stringAt(false);
- _export(_export.P, 'String', {
- // 21.1.3.3 String.prototype.codePointAt(pos)
- codePointAt: function codePointAt(pos) {
- return $at(this, pos);
- }
- });
- var codePointAt = _core.String.codePointAt;
- var max = Math.max;
- var min = Math.min;
- var _toAbsoluteIndex = function (index, length) {
- index = _toInteger(index);
- return index < 0 ? max(index + length, 0) : min(index, length);
- };
- var fromCharCode = String.fromCharCode;
- var $fromCodePoint = String.fromCodePoint;
- // length should be 1, old FF problem
- _export(_export.S + _export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
- // 21.1.2.2 String.fromCodePoint(...codePoints)
- fromCodePoint: function fromCodePoint(x) {
- var arguments$1 = arguments;
- // eslint-disable-line no-unused-vars
- var res = [];
- var aLen = arguments.length;
- var i = 0;
- var code;
- while (aLen > i) {
- code = +arguments$1[i++];
- if (_toAbsoluteIndex(code, 0x10ffff) !== code) { throw RangeError(code + ' is not a valid code point'); }
- res.push(code < 0x10000
- ? fromCharCode(code)
- : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
- );
- } return res.join('');
- }
- });
- var fromCodePoint = _core.String.fromCodePoint;
- // This is a generated file. Do not edit.
- var Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
- var ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
- var ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
- var unicode = {
- Space_Separator: Space_Separator,
- ID_Start: ID_Start,
- ID_Continue: ID_Continue
- };
- var util = {
- isSpaceSeparator: function isSpaceSeparator (c) {
- return typeof c === 'string' && unicode.Space_Separator.test(c)
- },
- isIdStartChar: function isIdStartChar (c) {
- return typeof c === 'string' && (
- (c >= 'a' && c <= 'z') ||
- (c >= 'A' && c <= 'Z') ||
- (c === '$') || (c === '_') ||
- unicode.ID_Start.test(c)
- )
- },
- isIdContinueChar: function isIdContinueChar (c) {
- return typeof c === 'string' && (
- (c >= 'a' && c <= 'z') ||
- (c >= 'A' && c <= 'Z') ||
- (c >= '0' && c <= '9') ||
- (c === '$') || (c === '_') ||
- (c === '\u200C') || (c === '\u200D') ||
- unicode.ID_Continue.test(c)
- )
- },
- isDigit: function isDigit (c) {
- return typeof c === 'string' && /[0-9]/.test(c)
- },
- isHexDigit: function isHexDigit (c) {
- return typeof c === 'string' && /[0-9A-Fa-f]/.test(c)
- },
- };
- var source;
- var parseState;
- var stack;
- var pos;
- var line;
- var column;
- var token;
- var key;
- var root;
- var parse = function parse (text, reviver) {
- source = String(text);
- parseState = 'start';
- stack = [];
- pos = 0;
- line = 1;
- column = 0;
- token = undefined;
- key = undefined;
- root = undefined;
- do {
- token = lex();
- // This code is unreachable.
- // if (!parseStates[parseState]) {
- // throw invalidParseState()
- // }
- parseStates[parseState]();
- } while (token.type !== 'eof')
- if (typeof reviver === 'function') {
- return internalize({'': root}, '', reviver)
- }
- return root
- };
- function internalize (holder, name, reviver) {
- var value = holder[name];
- if (value != null && typeof value === 'object') {
- for (var key in value) {
- var replacement = internalize(value, key, reviver);
- if (replacement === undefined) {
- delete value[key];
- } else {
- value[key] = replacement;
- }
- }
- }
- return reviver.call(holder, name, value)
- }
- var lexState;
- var buffer;
- var doubleQuote;
- var sign;
- var c;
- function lex () {
- lexState = 'default';
- buffer = '';
- doubleQuote = false;
- sign = 1;
- for (;;) {
- c = peek();
- // This code is unreachable.
- // if (!lexStates[lexState]) {
- // throw invalidLexState(lexState)
- // }
- var token = lexStates[lexState]();
- if (token) {
- return token
- }
- }
- }
- function peek () {
- if (source[pos]) {
- return String.fromCodePoint(source.codePointAt(pos))
- }
- }
- function read () {
- var c = peek();
- if (c === '\n') {
- line++;
- column = 0;
- } else if (c) {
- column += c.length;
- } else {
- column++;
- }
- if (c) {
- pos += c.length;
- }
- return c
- }
- var lexStates = {
- default: function default$1 () {
- switch (c) {
- case '\t':
- case '\v':
- case '\f':
- case ' ':
- case '\u00A0':
- case '\uFEFF':
- case '\n':
- case '\r':
- case '\u2028':
- case '\u2029':
- read();
- return
- case '/':
- read();
- lexState = 'comment';
- return
- case undefined:
- read();
- return newToken('eof')
- }
- if (util.isSpaceSeparator(c)) {
- read();
- return
- }
- // This code is unreachable.
- // if (!lexStates[parseState]) {
- // throw invalidLexState(parseState)
- // }
- return lexStates[parseState]()
- },
- comment: function comment () {
- switch (c) {
- case '*':
- read();
- lexState = 'multiLineComment';
- return
- case '/':
- read();
- lexState = 'singleLineComment';
- return
- }
- throw invalidChar(read())
- },
- multiLineComment: function multiLineComment () {
- switch (c) {
- case '*':
- read();
- lexState = 'multiLineCommentAsterisk';
- return
- case undefined:
- throw invalidChar(read())
- }
- read();
- },
- multiLineCommentAsterisk: function multiLineCommentAsterisk () {
- switch (c) {
- case '*':
- read();
- return
- case '/':
- read();
- lexState = 'default';
- return
- case undefined:
- throw invalidChar(read())
- }
- read();
- lexState = 'multiLineComment';
- },
- singleLineComment: function singleLineComment () {
- switch (c) {
- case '\n':
- case '\r':
- case '\u2028':
- case '\u2029':
- read();
- lexState = 'default';
- return
- case undefined:
- read();
- return newToken('eof')
- }
- read();
- },
- value: function value () {
- switch (c) {
- case '{':
- case '[':
- return newToken('punctuator', read())
- case 'n':
- read();
- literal('ull');
- return newToken('null', null)
- case 't':
- read();
- literal('rue');
- return newToken('boolean', true)
- case 'f':
- read();
- literal('alse');
- return newToken('boolean', false)
- case '-':
- case '+':
- if (read() === '-') {
- sign = -1;
- }
- lexState = 'sign';
- return
- case '.':
- buffer = read();
- lexState = 'decimalPointLeading';
- return
- case '0':
- buffer = read();
- lexState = 'zero';
- return
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- buffer = read();
- lexState = 'decimalInteger';
- return
- case 'I':
- read();
- literal('nfinity');
- return newToken('numeric', Infinity)
- case 'N':
- read();
- literal('aN');
- return newToken('numeric', NaN)
- case '"':
- case "'":
- doubleQuote = (read() === '"');
- buffer = '';
- lexState = 'string';
- return
- }
- throw invalidChar(read())
- },
- identifierNameStartEscape: function identifierNameStartEscape () {
- if (c !== 'u') {
- throw invalidChar(read())
- }
- read();
- var u = unicodeEscape();
- switch (u) {
- case '$':
- case '_':
- break
- default:
- if (!util.isIdStartChar(u)) {
- throw invalidIdentifier()
- }
- break
- }
- buffer += u;
- lexState = 'identifierName';
- },
- identifierName: function identifierName () {
- switch (c) {
- case '$':
- case '_':
- case '\u200C':
- case '\u200D':
- buffer += read();
- return
- case '\\':
- read();
- lexState = 'identifierNameEscape';
- return
- }
- if (util.isIdContinueChar(c)) {
- buffer += read();
- return
- }
- return newToken('identifier', buffer)
- },
- identifierNameEscape: function identifierNameEscape () {
- if (c !== 'u') {
- throw invalidChar(read())
- }
- read();
- var u = unicodeEscape();
- switch (u) {
- case '$':
- case '_':
- case '\u200C':
- case '\u200D':
- break
- default:
- if (!util.isIdContinueChar(u)) {
- throw invalidIdentifier()
- }
- break
- }
- buffer += u;
- lexState = 'identifierName';
- },
- sign: function sign$1 () {
- switch (c) {
- case '.':
- buffer = read();
- lexState = 'decimalPointLeading';
- return
- case '0':
- buffer = read();
- lexState = 'zero';
- return
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- buffer = read();
- lexState = 'decimalInteger';
- return
- case 'I':
- read();
- literal('nfinity');
- return newToken('numeric', sign * Infinity)
- case 'N':
- read();
- literal('aN');
- return newToken('numeric', NaN)
- }
- throw invalidChar(read())
- },
- zero: function zero () {
- switch (c) {
- case '.':
- buffer += read();
- lexState = 'decimalPoint';
- return
- case 'e':
- case 'E':
- buffer += read();
- lexState = 'decimalExponent';
- return
- case 'x':
- case 'X':
- buffer += read();
- lexState = 'hexadecimal';
- return
- }
- return newToken('numeric', sign * 0)
- },
- decimalInteger: function decimalInteger () {
- switch (c) {
- case '.':
- buffer += read();
- lexState = 'decimalPoint';
- return
- case 'e':
- case 'E':
- buffer += read();
- lexState = 'decimalExponent';
- return
- }
- if (util.isDigit(c)) {
- buffer += read();
- return
- }
- return newToken('numeric', sign * Number(buffer))
- },
- decimalPointLeading: function decimalPointLeading () {
- if (util.isDigit(c)) {
- buffer += read();
- lexState = 'decimalFraction';
- return
- }
- throw invalidChar(read())
- },
- decimalPoint: function decimalPoint () {
- switch (c) {
- case 'e':
- case 'E':
- buffer += read();
- lexState = 'decimalExponent';
- return
- }
- if (util.isDigit(c)) {
- buffer += read();
- lexState = 'decimalFraction';
- return
- }
- return newToken('numeric', sign * Number(buffer))
- },
- decimalFraction: function decimalFraction () {
- switch (c) {
- case 'e':
- case 'E':
- buffer += read();
- lexState = 'decimalExponent';
- return
- }
- if (util.isDigit(c)) {
- buffer += read();
- return
- }
- return newToken('numeric', sign * Number(buffer))
- },
- decimalExponent: function decimalExponent () {
- switch (c) {
- case '+':
- case '-':
- buffer += read();
- lexState = 'decimalExponentSign';
- return
- }
- if (util.isDigit(c)) {
- buffer += read();
- lexState = 'decimalExponentInteger';
- return
- }
- throw invalidChar(read())
- },
- decimalExponentSign: function decimalExponentSign () {
- if (util.isDigit(c)) {
- buffer += read();
- lexState = 'decimalExponentInteger';
- return
- }
- throw invalidChar(read())
- },
- decimalExponentInteger: function decimalExponentInteger () {
- if (util.isDigit(c)) {
- buffer += read();
- return
- }
- return newToken('numeric', sign * Number(buffer))
- },
- hexadecimal: function hexadecimal () {
- if (util.isHexDigit(c)) {
- buffer += read();
- lexState = 'hexadecimalInteger';
- return
- }
- throw invalidChar(read())
- },
- hexadecimalInteger: function hexadecimalInteger () {
- if (util.isHexDigit(c)) {
- buffer += read();
- return
- }
- return newToken('numeric', sign * Number(buffer))
- },
- string: function string () {
- switch (c) {
- case '\\':
- read();
- buffer += escape();
- return
- case '"':
- if (doubleQuote) {
- read();
- return newToken('string', buffer)
- }
- buffer += read();
- return
- case "'":
- if (!doubleQuote) {
- read();
- return newToken('string', buffer)
- }
- buffer += read();
- return
- case '\n':
- case '\r':
- throw invalidChar(read())
- case '\u2028':
- case '\u2029':
- separatorChar(c);
- break
- case undefined:
- throw invalidChar(read())
- }
- buffer += read();
- },
- start: function start () {
- switch (c) {
- case '{':
- case '[':
- return newToken('punctuator', read())
- // This code is unreachable since the default lexState handles eof.
- // case undefined:
- // return newToken('eof')
- }
- lexState = 'value';
- },
- beforePropertyName: function beforePropertyName () {
- switch (c) {
- case '$':
- case '_':
- buffer = read();
- lexState = 'identifierName';
- return
- case '\\':
- read();
- lexState = 'identifierNameStartEscape';
- return
- case '}':
- return newToken('punctuator', read())
- case '"':
- case "'":
- doubleQuote = (read() === '"');
- lexState = 'string';
- return
- }
- if (util.isIdStartChar(c)) {
- buffer += read();
- lexState = 'identifierName';
- return
- }
- throw invalidChar(read())
- },
- afterPropertyName: function afterPropertyName () {
- if (c === ':') {
- return newToken('punctuator', read())
- }
- throw invalidChar(read())
- },
- beforePropertyValue: function beforePropertyValue () {
- lexState = 'value';
- },
- afterPropertyValue: function afterPropertyValue () {
- switch (c) {
- case ',':
- case '}':
- return newToken('punctuator', read())
- }
- throw invalidChar(read())
- },
- beforeArrayValue: function beforeArrayValue () {
- if (c === ']') {
- return newToken('punctuator', read())
- }
- lexState = 'value';
- },
- afterArrayValue: function afterArrayValue () {
- switch (c) {
- case ',':
- case ']':
- return newToken('punctuator', read())
- }
- throw invalidChar(read())
- },
- end: function end () {
- // This code is unreachable since it's handled by the default lexState.
- // if (c === undefined) {
- // read()
- // return newToken('eof')
- // }
- throw invalidChar(read())
- },
- };
- function newToken (type, value) {
- return {
- type: type,
- value: value,
- line: line,
- column: column,
- }
- }
- function literal (s) {
- for (var i = 0, list = s; i < list.length; i += 1) {
- var c = list[i];
- var p = peek();
- if (p !== c) {
- throw invalidChar(read())
- }
- read();
- }
- }
- function escape () {
- var c = peek();
- switch (c) {
- case 'b':
- read();
- return '\b'
- case 'f':
- read();
- return '\f'
- case 'n':
- read();
- return '\n'
- case 'r':
- read();
- return '\r'
- case 't':
- read();
- return '\t'
- case 'v':
- read();
- return '\v'
- case '0':
- read();
- if (util.isDigit(peek())) {
- throw invalidChar(read())
- }
- return '\0'
- case 'x':
- read();
- return hexEscape()
- case 'u':
- read();
- return unicodeEscape()
- case '\n':
- case '\u2028':
- case '\u2029':
- read();
- return ''
- case '\r':
- read();
- if (peek() === '\n') {
- read();
- }
- return ''
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- throw invalidChar(read())
- case undefined:
- throw invalidChar(read())
- }
- return read()
- }
- function hexEscape () {
- var buffer = '';
- var c = peek();
- if (!util.isHexDigit(c)) {
- throw invalidChar(read())
- }
- buffer += read();
- c = peek();
- if (!util.isHexDigit(c)) {
- throw invalidChar(read())
- }
- buffer += read();
- return String.fromCodePoint(parseInt(buffer, 16))
- }
- function unicodeEscape () {
- var buffer = '';
- var count = 4;
- while (count-- > 0) {
- var c = peek();
- if (!util.isHexDigit(c)) {
- throw invalidChar(read())
- }
- buffer += read();
- }
- return String.fromCodePoint(parseInt(buffer, 16))
- }
- var parseStates = {
- start: function start () {
- if (token.type === 'eof') {
- throw invalidEOF()
- }
- push();
- },
- beforePropertyName: function beforePropertyName () {
- switch (token.type) {
- case 'identifier':
- case 'string':
- key = token.value;
- parseState = 'afterPropertyName';
- return
- case 'punctuator':
- // This code is unreachable since it's handled by the lexState.
- // if (token.value !== '}') {
- // throw invalidToken()
- // }
- pop();
- return
- case 'eof':
- throw invalidEOF()
- }
- // This code is unreachable since it's handled by the lexState.
- // throw invalidToken()
- },
- afterPropertyName: function afterPropertyName () {
- // This code is unreachable since it's handled by the lexState.
- // if (token.type !== 'punctuator' || token.value !== ':') {
- // throw invalidToken()
- // }
- if (token.type === 'eof') {
- throw invalidEOF()
- }
- parseState = 'beforePropertyValue';
- },
- beforePropertyValue: function beforePropertyValue () {
- if (token.type === 'eof') {
- throw invalidEOF()
- }
- push();
- },
- beforeArrayValue: function beforeArrayValue () {
- if (token.type === 'eof') {
- throw invalidEOF()
- }
- if (token.type === 'punctuator' && token.value === ']') {
- pop();
- return
- }
- push();
- },
- afterPropertyValue: function afterPropertyValue () {
- // This code is unreachable since it's handled by the lexState.
- // if (token.type !== 'punctuator') {
- // throw invalidToken()
- // }
- if (token.type === 'eof') {
- throw invalidEOF()
- }
- switch (token.value) {
- case ',':
- parseState = 'beforePropertyName';
- return
- case '}':
- pop();
- }
- // This code is unreachable since it's handled by the lexState.
- // throw invalidToken()
- },
- afterArrayValue: function afterArrayValue () {
- // This code is unreachable since it's handled by the lexState.
- // if (token.type !== 'punctuator') {
- // throw invalidToken()
- // }
- if (token.type === 'eof') {
- throw invalidEOF()
- }
- switch (token.value) {
- case ',':
- parseState = 'beforeArrayValue';
- return
- case ']':
- pop();
- }
- // This code is unreachable since it's handled by the lexState.
- // throw invalidToken()
- },
- end: function end () {
- // This code is unreachable since it's handled by the lexState.
- // if (token.type !== 'eof') {
- // throw invalidToken()
- // }
- },
- };
- function push () {
- var value;
- switch (token.type) {
- case 'punctuator':
- switch (token.value) {
- case '{':
- value = {};
- break
- case '[':
- value = [];
- break
- }
- break
- case 'null':
- case 'boolean':
- case 'numeric':
- case 'string':
- value = token.value;
- break
- // This code is unreachable.
- // default:
- // throw invalidToken()
- }
- if (root === undefined) {
- root = value;
- } else {
- var parent = stack[stack.length - 1];
- if (Array.isArray(parent)) {
- parent.push(value);
- } else {
- parent[key] = value;
- }
- }
- if (value !== null && typeof value === 'object') {
- stack.push(value);
- if (Array.isArray(value)) {
- parseState = 'beforeArrayValue';
- } else {
- parseState = 'beforePropertyName';
- }
- } else {
- var current = stack[stack.length - 1];
- if (current == null) {
- parseState = 'end';
- } else if (Array.isArray(current)) {
- parseState = 'afterArrayValue';
- } else {
- parseState = 'afterPropertyValue';
- }
- }
- }
- function pop () {
- stack.pop();
- var current = stack[stack.length - 1];
- if (current == null) {
- parseState = 'end';
- } else if (Array.isArray(current)) {
- parseState = 'afterArrayValue';
- } else {
- parseState = 'afterPropertyValue';
- }
- }
- // This code is unreachable.
- // function invalidParseState () {
- // return new Error(`JSON5: invalid parse state '${parseState}'`)
- // }
- // This code is unreachable.
- // function invalidLexState (state) {
- // return new Error(`JSON5: invalid lex state '${state}'`)
- // }
- function invalidChar (c) {
- if (c === undefined) {
- return syntaxError(("JSON5: invalid end of input at " + line + ":" + column))
- }
- return syntaxError(("JSON5: invalid character '" + (formatChar(c)) + "' at " + line + ":" + column))
- }
- function invalidEOF () {
- return syntaxError(("JSON5: invalid end of input at " + line + ":" + column))
- }
- // This code is unreachable.
- // function invalidToken () {
- // if (token.type === 'eof') {
- // return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)
- // }
- // const c = String.fromCodePoint(token.value.codePointAt(0))
- // return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`)
- // }
- function invalidIdentifier () {
- column -= 5;
- return syntaxError(("JSON5: invalid identifier character at " + line + ":" + column))
- }
- function separatorChar (c) {
- console.warn(("JSON5: '" + (formatChar(c)) + "' in strings is not valid ECMAScript; consider escaping"));
- }
- function formatChar (c) {
- var replacements = {
- "'": "\\'",
- '"': '\\"',
- '\\': '\\\\',
- '\b': '\\b',
- '\f': '\\f',
- '\n': '\\n',
- '\r': '\\r',
- '\t': '\\t',
- '\v': '\\v',
- '\0': '\\0',
- '\u2028': '\\u2028',
- '\u2029': '\\u2029',
- };
- if (replacements[c]) {
- return replacements[c]
- }
- if (c < ' ') {
- var hexString = c.charCodeAt(0).toString(16);
- return '\\x' + ('00' + hexString).substring(hexString.length)
- }
- return c
- }
- function syntaxError (message) {
- var err = new SyntaxError(message);
- err.lineNumber = line;
- err.columnNumber = column;
- return err
- }
- var stringify = function stringify (value, replacer, space) {
- var stack = [];
- var indent = '';
- var propertyList;
- var replacerFunc;
- var gap = '';
- var quote;
- if (
- replacer != null &&
- typeof replacer === 'object' &&
- !Array.isArray(replacer)
- ) {
- space = replacer.space;
- quote = replacer.quote;
- replacer = replacer.replacer;
- }
- if (typeof replacer === 'function') {
- replacerFunc = replacer;
- } else if (Array.isArray(replacer)) {
- propertyList = [];
- for (var i = 0, list = replacer; i < list.length; i += 1) {
- var v = list[i];
- var item = (void 0);
- if (typeof v === 'string') {
- item = v;
- } else if (
- typeof v === 'number' ||
- v instanceof String ||
- v instanceof Number
- ) {
- item = String(v);
- }
- if (item !== undefined && propertyList.indexOf(item) < 0) {
- propertyList.push(item);
- }
- }
- }
- if (space instanceof Number) {
- space = Number(space);
- } else if (space instanceof String) {
- space = String(space);
- }
- if (typeof space === 'number') {
- if (space > 0) {
- space = Math.min(10, Math.floor(space));
- gap = ' '.substr(0, space);
- }
- } else if (typeof space === 'string') {
- gap = space.substr(0, 10);
- }
- return serializeProperty('', {'': value})
- function serializeProperty (key, holder) {
- var value = holder[key];
- if (value != null) {
- if (typeof value.toJSON5 === 'function') {
- value = value.toJSON5(key);
- } else if (typeof value.toJSON === 'function') {
- value = value.toJSON(key);
- }
- }
- if (replacerFunc) {
- value = replacerFunc.call(holder, key, value);
- }
- if (value instanceof Number) {
- value = Number(value);
- } else if (value instanceof String) {
- value = String(value);
- } else if (value instanceof Boolean) {
- value = value.valueOf();
- }
- switch (value) {
- case null: return 'null'
- case true: return 'true'
- case false: return 'false'
- }
- if (typeof value === 'string') {
- return quoteString(value)
- }
- if (typeof value === 'number') {
- return String(value)
- }
- if (typeof value === 'object') {
- return Array.isArray(value) ? serializeArray(value) : serializeObject(value)
- }
- return undefined
- }
- function quoteString (value) {
- var quotes = {
- "'": 0.1,
- '"': 0.2,
- };
- var replacements = {
- "'": "\\'",
- '"': '\\"',
- '\\': '\\\\',
- '\b': '\\b',
- '\f': '\\f',
- '\n': '\\n',
- '\r': '\\r',
- '\t': '\\t',
- '\v': '\\v',
- '\0': '\\0',
- '\u2028': '\\u2028',
- '\u2029': '\\u2029',
- };
- var product = '';
- for (var i = 0; i < value.length; i++) {
- var c = value[i];
- switch (c) {
- case "'":
- case '"':
- quotes[c]++;
- product += c;
- continue
- case '\0':
- if (util.isDigit(value[i + 1])) {
- product += '\\x00';
- continue
- }
- }
- if (replacements[c]) {
- product += replacements[c];
- continue
- }
- if (c < ' ') {
- var hexString = c.charCodeAt(0).toString(16);
- product += '\\x' + ('00' + hexString).substring(hexString.length);
- continue
- }
- product += c;
- }
- var quoteChar = quote || Object.keys(quotes).reduce(function (a, b) { return (quotes[a] < quotes[b]) ? a : b; });
- product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]);
- return quoteChar + product + quoteChar
- }
- function serializeObject (value) {
- if (stack.indexOf(value) >= 0) {
- throw TypeError('Converting circular structure to JSON5')
- }
- stack.push(value);
- var stepback = indent;
- indent = indent + gap;
- var keys = propertyList || Object.keys(value);
- var partial = [];
- for (var i = 0, list = keys; i < list.length; i += 1) {
- var key = list[i];
- var propertyString = serializeProperty(key, value);
- if (propertyString !== undefined) {
- var member = serializeKey(key) + ':';
- if (gap !== '') {
- member += ' ';
- }
- member += propertyString;
- partial.push(member);
- }
- }
- var final;
- if (partial.length === 0) {
- final = '{}';
- } else {
- var properties;
- if (gap === '') {
- properties = partial.join(',');
- final = '{' + properties + '}';
- } else {
- var separator = ',\n' + indent;
- properties = partial.join(separator);
- final = '{\n' + indent + properties + ',\n' + stepback + '}';
- }
- }
- stack.pop();
- indent = stepback;
- return final
- }
- function serializeKey (key) {
- if (key.length === 0) {
- return quoteString(key)
- }
- var firstChar = String.fromCodePoint(key.codePointAt(0));
- if (!util.isIdStartChar(firstChar)) {
- return quoteString(key)
- }
- for (var i = firstChar.length; i < key.length; i++) {
- if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
- return quoteString(key)
- }
- }
- return key
- }
- function serializeArray (value) {
- if (stack.indexOf(value) >= 0) {
- throw TypeError('Converting circular structure to JSON5')
- }
- stack.push(value);
- var stepback = indent;
- indent = indent + gap;
- var partial = [];
- for (var i = 0; i < value.length; i++) {
- var propertyString = serializeProperty(String(i), value);
- partial.push((propertyString !== undefined) ? propertyString : 'null');
- }
- var final;
- if (partial.length === 0) {
- final = '[]';
- } else {
- if (gap === '') {
- var properties = partial.join(',');
- final = '[' + properties + ']';
- } else {
- var separator = ',\n' + indent;
- var properties$1 = partial.join(separator);
- final = '[\n' + indent + properties$1 + ',\n' + stepback + ']';
- }
- }
- stack.pop();
- indent = stepback;
- return final
- }
- };
- var JSON5 = {
- parse: parse,
- stringify: stringify,
- };
- var lib = JSON5;
- var es5 = lib;
- return es5;
- })));
- });
- /*! *****************************************************************************
- Copyright (c) Microsoft Corporation.
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted.
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
- ***************************************************************************** */
- /* global Reflect, Promise */
- var extendStatics = function(d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
- function __extends(d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- }
- var __assign = function() {
- __assign = Object.assign || function __assign(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
- }
- return t;
- };
- return __assign.apply(this, arguments);
- };
- function __decorate(decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
- }
- function __param(paramIndex, decorator) {
- return function (target, key) { decorator(target, key, paramIndex); }
- }
- function __metadata(metadataKey, metadataValue) {
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
- }
- function __values(o) {
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
- if (m) return m.call(o);
- if (o && typeof o.length === "number") return {
- next: function () {
- if (o && i >= o.length) o = void 0;
- return { value: o && o[i++], done: !o };
- }
- };
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
- }
- function __read(o, n) {
- var m = typeof Symbol === "function" && o[Symbol.iterator];
- if (!m) return o;
- var i = m.call(o), r, ar = [], e;
- try {
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
- }
- catch (error) { e = { error: error }; }
- finally {
- try {
- if (r && !r.done && (m = i["return"])) m.call(i);
- }
- finally { if (e) throw e.error; }
- }
- return ar;
- }
- function __spread() {
- for (var ar = [], i = 0; i < arguments.length; i++)
- ar = ar.concat(__read(arguments[i]));
- return ar;
- }
- var PropertyDescription = /** @class */ (function () {
- function PropertyDescription() {
- var _this = this;
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- this.propertyes = {
- props: [],
- events: []
- };
- _$2.each(args, function (arg) {
- _this.merge(arg);
- });
- }
- PropertyDescription.prototype.merge = function (pd) {
- this.propertyes.props = (_$2.uniqBy(__spread(this.propertyes.props, pd.props), 'name'));
- if (pd.events) {
- if (this.propertyes.events) {
- this.propertyes.events = (_$2.uniqBy(__spread(this.propertyes.events, pd.events), 'name'));
- }
- else {
- this.propertyes.events = _$2.uniqBy(__spread(pd.events), 'name');
- }
- }
- };
- /**
- * 根据分组名 获取属性定义
- */
- PropertyDescription.prototype.getPropsByGroup = function (name) {
- return _$2.filter(this.propertyes.props, function (i) { return i.group === name; });
- };
- /**
- * 获取全部事件
- */
- PropertyDescription.prototype.getEvents = function () {
- return this.propertyes.events;
- };
- return PropertyDescription;
- }());
- //# sourceMappingURL=PropertyDescription.js.map
- var PropertyDescriptionTable = new Map();
- var width = {
- name: 'width',
- default: '',
- group: 'common',
- desc: '宽',
- type: 'string'
- };
- var height = {
- name: 'height',
- default: '',
- group: 'common',
- desc: '高',
- type: 'string'
- };
- var fieldLabel = {
- name: 'fieldLabel',
- default: '',
- group: 'common',
- desc: '文本描述',
- type: 'string',
- expr: true,
- };
- var text$1 = {
- name: 'text',
- default: '',
- group: 'common',
- desc: '文本描述',
- type: 'string',
- expr: true,
- };
- var iconCls = {
- name: 'iconCls',
- default: '',
- group: 'common',
- desc: '图标',
- type: 'string',
- expr: true,
- };
- var disabled = {
- name: 'disabled',
- default: false,
- group: 'common',
- desc: '禁用',
- type: 'boolean',
- expr: true,
- };
- var value = {
- name: 'value',
- default: '',
- group: 'common',
- desc: '字段值',
- type: 'string',
- expr: true,
- };
- var template = {
- name: 'template',
- default: '',
- group: 'common',
- desc: 'HTML内容',
- type: 'string',
- expr: true,
- };
- var reference = {
- name: 'reference',
- default: '',
- group: 'common',
- desc: '组件句柄',
- type: 'string',
- expr: true,
- };
- var tooltip = {
- name: 'tooltip',
- default: '',
- group: 'common',
- desc: '悬停提示',
- type: 'string'
- };
- // =============事件 ==============
- var click = {
- name: 'click',
- default: '',
- group: 'listeners',
- desc: '点击事件',
- eventParamter: [
- 'sender',
- 'e: any'
- ],
- type: 'listeners'
- };
- var change = {
- name: 'change',
- default: '',
- group: 'listeners',
- desc: 'value change事件',
- eventParamter: [
- 'sender',
- 'e: any'
- ],
- type: 'listeners'
- };
- var keyup = {
- name: 'keyup',
- default: '',
- group: 'listeners',
- desc: '键盘按键抬起事件',
- eventParamter: [
- 'sender',
- 'e'
- ],
- type: 'listeners'
- };
- var afterrender = {
- name: 'afterrender',
- default: '',
- group: 'listeners',
- desc: '控件渲染后触发',
- eventParamter: [
- 'sender',
- 'e'
- ],
- type: 'listeners'
- };
- // =============特性 ==============
- var fix = {
- name: 'fix',
- default: '',
- group: 'fix',
- desc: '特性',
- type: 'fix',
- expr: true,
- };
- PropertyDescriptionTable.set('cols', new PropertyDescription({
- props: [
- height
- ]
- }));
- PropertyDescriptionTable.set('layout', new PropertyDescription({
- props: [
- {
- name: 'borderless',
- default: true,
- group: 'css',
- desc: '有无边框',
- type: 'boolean'
- },
- {
- name: 'type',
- default: '',
- group: 'css',
- desc: '布局类型',
- type: ['line', 'clean', 'wide', 'space', 'form']
- },
- {
- name: '_designMode',
- default: 'module',
- group: 'common',
- desc: '设计类型',
- type: ['none', 'module', 'scroll-module']
- }
- ]
- }));
- var YvBase = {
- props: [
- width, height, reference, afterrender, fix
- ],
- events: [
- // {name: 'onRender', desc: '第一次控件被渲染时触发'}
- ]
- };
- PropertyDescriptionTable.set('template', new PropertyDescription(YvBase, {
- props: [
- template
- ]
- }));
- PropertyDescriptionTable.set('fieldset', new PropertyDescription(YvBase, {
- props: [
- {
- name: 'label',
- default: '',
- group: 'common',
- desc: '字段组标题',
- type: 'string'
- }
- ]
- }));
- PropertyDescriptionTable.set('iframe', new PropertyDescription(YvBase, {
- props: [
- {
- name: 'src',
- default: '',
- group: 'common',
- desc: '地址路径',
- type: 'string'
- }
- ]
- }));
- PropertyDescriptionTable.set('uploader', new PropertyDescription(YvBase, {
- props: [
- width, height,
- {
- name: 'value',
- default: '上传',
- group: 'common',
- desc: '文本描述',
- type: 'string'
- },
- {
- name: 'upload',
- default: '/upload',
- group: 'common',
- desc: '上传地址',
- type: 'string'
- },
- ],
- events: [
- { name: 'onFileUpload', desc: '文件上传成功结束时触发' },
- { name: 'onFileUploadError', desc: '在上传过程中发生服务器端错误时触发' },
- ]
- }));
- PropertyDescriptionTable.set('viewer', new PropertyDescription(YvBase, {
- props: [
- value,
- {
- name: 'imgWidth',
- default: '',
- group: 'common',
- desc: '图片宽',
- type: 'string'
- },
- {
- name: 'imgHeight',
- default: '',
- group: 'common',
- desc: '图片高',
- type: 'string'
- }
- ]
- }));
- PropertyDescriptionTable.set('image', new PropertyDescription(YvBase, {
- props: [
- value,
- {
- name: 'imgWidth',
- default: '',
- group: 'common',
- desc: '图片宽',
- type: 'string'
- },
- {
- name: 'imgHeight',
- default: '',
- group: 'common',
- desc: '图片高',
- type: 'string'
- }
- ]
- }));
- PropertyDescriptionTable.set('button', new PropertyDescription(YvBase, {
- props: [text$1, disabled, height, width, iconCls, click, afterrender],
- }));
- PropertyDescriptionTable.set('fieldSet', new PropertyDescription(YvBase, {
- props: [
- fieldLabel, value, disabled,
- tooltip, width, height
- ],
- }));
- PropertyDescriptionTable.set('textfield', new PropertyDescription(YvBase, {
- props: [
- fieldLabel, value, disabled,
- tooltip, width, height, keyup, afterrender, change
- ],
- }));
- PropertyDescriptionTable.set('searchfield', new PropertyDescription(YvBase, {
- props: [
- fieldLabel, value, disabled,
- tooltip, width, height, keyup, afterrender, change
- ],
- }));
- PropertyDescriptionTable.set('radiogroup', new PropertyDescription(YvBase, {
- props: [
- fieldLabel, value, disabled,
- tooltip, width, height, keyup, afterrender, change
- ],
- }));
- PropertyDescriptionTable.set('radio', new PropertyDescription(YvBase, {
- props: [
- fieldLabel, value, disabled,
- tooltip, width, height, keyup, afterrender, change
- ],
- }));
- PropertyDescriptionTable.set('numberfield', new PropertyDescription(YvBase, {
- props: [
- fieldLabel, value, disabled,
- tooltip, width, height, keyup, afterrender, change
- ],
- }));
- PropertyDescriptionTable.set('datetimepicker', new PropertyDescription(YvBase, {
- props: [
- fieldLabel, value, disabled,
- tooltip, width, height, keyup, afterrender, change
- ],
- }));
- PropertyDescriptionTable.set('datetimefield', new PropertyDescription(YvBase, {
- props: [
- fieldLabel, value, disabled,
- tooltip, width, height, keyup, afterrender, change
- ],
- }));
- PropertyDescriptionTable.set('datefield', new PropertyDescription(YvBase, {
- props: [
- fieldLabel, value, disabled,
- tooltip, width, height, keyup, afterrender, change
- ],
- }));
- PropertyDescriptionTable.set('combogrid', new PropertyDescription(YvBase, {
- props: [
- fieldLabel, value, disabled,
- tooltip, width, height
- ],
- }));
- PropertyDescriptionTable.set('combo', new PropertyDescription(YvBase, {
- props: [
- fieldLabel, value, disabled,
- tooltip, width, height, keyup, afterrender, change
- ],
- }));
- PropertyDescriptionTable.set('checkboxgroup', new PropertyDescription(YvBase, {
- props: [
- fieldLabel, value, disabled,
- tooltip, width, height, keyup, afterrender, change
- ],
- }));
- PropertyDescriptionTable.set('checkbox', new PropertyDescription(YvBase, {
- props: [
- fieldLabel, value, disabled,
- tooltip, width, height, keyup, afterrender, change
- ],
- }));
- PropertyDescriptionTable.set('yvgrid', new PropertyDescription(YvBase, {
- props: [
- fieldLabel, value, disabled,
- tooltip, width, height, afterrender, change
- ],
- }));
- //# sourceMappingURL=PropertyDescriptionTable.js.map
- /**
- * 弹出输入框,输入文字
- * @param message 提示文字
- * @param defaultValue 默认值
- * @param multiLine 是否多行输入
- */
- function prompt$1(message, defaultValue, multiLine) {
- if (defaultValue === void 0) { defaultValue = ""; }
- if (multiLine === void 0) { multiLine = false; }
- return new Promise(function (resolve) {
- Ext.MessageBox.prompt('请输入', message, function (button, value) {
- if (button === 'ok') {
- resolve(value);
- }
- }, null, multiLine, defaultValue);
- });
- }
- /**
- * 显示错误异常信息
- * @param msg 错误内容
- * @param sender 发送者按钮(可以为空)
- */
- function showErrorDialog(msg, sender) {
- console.error(msg);
- Ext.MessageBox.show({
- title: '错误',
- msg: msg,
- buttons: Ext.MessageBox.OK,
- animateTarget: sender,
- icon: 'error',
- cls: 'show-icon-messagebox',
- });
- }
- /**
- * 显示错误异常信息
- * @param msg 错误内容
- * @param sender 发送者按钮(可以为空)
- */
- function showInfoDialogSimple(msg, sender) {
- console.info(msg);
- Ext.MessageBox.show({
- title: '提示',
- msg: msg,
- buttons: Ext.MessageBox.OK,
- animateTarget: sender,
- icon: 'info',
- cls: 'show-icon-messagebox',
- });
- }
- function msgError(msg, sender) {
- showErrorDialog(msg, sender);
- }
- /**
- * 中间灰底白字提示
- */
- function msg(message) {
- console.log(message);
- var t = { message: message };
- var WMSTranslate = window["WMSTranslate"];
- if (WMSTranslate) {
- if (typeof window['viewTranslate'] === 'function') {
- window['viewTranslate'](t, message, "message");
- }
- }
- var $body = $$2('body');
- $body.find('[xtype=tooltip]').remove();
- var $w = $$2('<div xtype="tooltip" class="yvan-msg yvan-anim yvan-anim-00">' +
- ' <div class="yvan-msg-content">' +
- _$2.escape(t.message) +
- '</div></div>');
- $body.append($w);
- var iframeWidth = $w.parent().width();
- var iframeHeight = $w.parent().height();
- var windowWidth = $w.width();
- var windowHeight = $w.height();
- var setWidth = (iframeWidth - windowWidth) / 2;
- var setHeight = (iframeHeight - windowHeight) / 2;
- if (iframeHeight < windowHeight || setHeight < 0) {
- setHeight = 0;
- }
- if (iframeWidth < windowWidth || setWidth < 0) {
- setWidth = 0;
- }
- $w.css({ left: setWidth, top: setHeight });
- setTimeout(function () {
- $w.remove();
- }, 3000);
- }
- //# sourceMappingURL=message.js.map
- localforage.config({
- name: "studio",
- storeName: "item",
- });
- function getItem(key, callback) {
- localforage.getItem(key).then(function (value) {
- if (callback) {
- callback(value);
- }
- });
- }
- function setItem(key, value, callback) {
- localforage.setItem(key, value).then(function (val) {
- if (callback) {
- callback();
- }
- });
- }
- var native = {
- /**
- * 读取文件
- */
- loadFile: function (fileName, callback) {
- console.log('loadFile', fileName);
- getItem('NATIVE_' + fileName, callback);
- },
- /**
- * 保存文件
- */
- saveFile: function (fileName, content) {
- console.log('saveFile', fileName, content);
- setItem('NATIVE_' + fileName, content);
- },
- openInIdea: function (path) {
- msg(path);
- },
- /**
- * 初始化 native 工具类
- */
- init: function () {
- var ClipboardJS = window['ClipboardJS'];
- if (!ClipboardJS) {
- msg('没有引入 ClipboardJS');
- return;
- }
- $(document.body).append("\n<button class=\"__btnClipboard\" style=\"display: none\" data-clipboard-text=\"Just Clipboard.js\">\n Copy to clipboard\n</button> \n ");
- var clipboard = new ClipboardJS('.__btnClipboard');
- },
- /**
- * 设置剪切板
- */
- clipboardSet: function (c) {
- var $btn = $('.__btnClipboard');
- $btn.attr('data-clipboard-text', c);
- $btn.trigger("click");
- },
- };
- /**
- * 判断变量是否有值 value === null || value === undefined
- * @param value 目标变量
- */
- var noValue = function (value) {
- return value === null || value === undefined;
- };
- //# sourceMappingURL=Utils.js.map
- function initStateTree () {
- Ext.define('com.yvan.studio.StateTree', {
- extend: 'Ext.tree.Panel',
- _saveStateFlag: true,
- _filterText: '',
- fbar: [
- {
- xtype: 'textfield',
- flex: 1,
- emptyText: '搜索过滤',
- enableKeyEvents: true,
- listeners: {
- change: function (sender) {
- var tree = sender.up("treepanel");
- tree.filterByText(this.getRawValue());
- },
- keyup: function (sender, e) {
- var tree = sender.up("treepanel");
- if (e.ESC === e.getKey()) {
- sender.setValue('');
- tree.filterByText('');
- }
- }
- }
- },
- ],
- getStateFilename: function () {
- throw Error('没有实现这个函数');
- },
- initComponent: function () {
- var me = this;
- this.on({
- afterrender: function () {
- var _this = this;
- // 回车后打开节点
- $(me.el.dom).keydown(function (event) {
- if (event.keyCode === 13) {
- event.preventDefault();
- _this.fireEvent('itemverify');
- return;
- }
- });
- },
- afteritemexpand: {
- fn: function (node, index, item, eOpts) {
- this.saveState();
- },
- buffer: 100,
- },
- afteritemcollapse: {
- fn: function (node, index, item, eOpts) {
- this.saveState();
- },
- buffer: 100,
- },
- itemdblclick: function (sender, record) {
- this.fireEvent('itemverify');
- },
- itemclick: {
- fn: function (node, index, item, eOpts) {
- this.saveState();
- },
- buffer: 100,
- }
- });
- this.superclass.superclass.initComponent.apply(this, arguments);
- },
- restoreState: function () {
- var _this = this;
- native.loadFile(this.getStateFilename(), function (content) {
- if (!content)
- return;
- var expands = content.expands, selections = content.selections, scrollPosition = content.scrollPosition, scrollSize = content.scrollSize;
- _this._saveStateFlag = false;
- if (_.isArray(expands)) {
- _.forEach(expands, function (p) {
- _this.expandPath(p);
- });
- }
- if (_.isArray(selections) && selections[0]) {
- try {
- _this.selectPath(selections[0]);
- }
- catch (e) {
- }
- }
- if (scrollPosition && scrollSize) {
- var size = _this.scrollable.getSize();
- if (size.x === scrollSize.x && size.y === scrollSize.y) {
- try {
- _this.scrollable.doScrollTo(scrollPosition.x, scrollPosition.y);
- }
- catch (e) {
- }
- }
- }
- setTimeout(function () {
- _this._saveStateFlag = true;
- }, 200);
- });
- },
- saveState: function () {
- if (!this._saveStateFlag) {
- return;
- }
- if (this._filterText) {
- // 有筛选,不保存展开状态
- return;
- }
- var expands = [];
- var selections = [];
- var selection = this.getSelection();
- _.forEach(selection, function (item) {
- selections.push(item.getPath());
- });
- var data = this.getStore().data;
- _.forEach(data.items, function (item) {
- if (item.data.expanded === true) {
- expands.push(item.getPath());
- }
- });
- var scrollPosition = this.scrollable.position;
- var scrollSize = this.scrollable.getSize();
- native.saveFile(this.getStateFilename(), {
- selections: selections,
- expands: expands,
- scrollPosition: scrollPosition,
- scrollSize: scrollSize
- });
- },
- filterByText: function (text) {
- this._filterText = text;
- this._filterBy(this, text, 'text');
- },
- _filterBy: _.debounce(function (me, text, by) {
- var view = me.getView();
- me.store.clearFilter();
- if (!me._filterText) {
- // 没有筛选内容,还原状态
- var selections = me.getSelection();
- var selectionPaths_1 = [];
- _.forEach(me.getSelection(), function (item) {
- selectionPaths_1.push(item.getPath());
- });
- me.collapseAll();
- me.restoreState();
- _.forEach(selectionPaths_1, function (path) {
- me.expandPath(path);
- });
- me.setSelection(selections);
- return;
- }
- // 递归查找所有需要可见的节点 id 数组
- var nodesAndParents = [];
- var expandPaths = [];
- me.getRootNode().cascadeBy(function (tree, view) {
- var currNode = this;
- currNode.collapse();
- if (currNode && currNode.data[by] &&
- currNode.data[by].toString().toLowerCase().indexOf(text.toLowerCase()) > -1) {
- // 展开到匹配的路径
- // me.expandPath(currNode.getPath());
- expandPaths.push(currNode.getPath());
- // 沿途父节点全部设定为可见
- while (currNode.parentNode) {
- nodesAndParents.push(currNode.id);
- currNode = currNode.parentNode;
- }
- }
- }, null, [me, view]);
- me.store.filterBy(function (r) {
- return Ext.Array.contains(nodesAndParents, r.get('id'));
- });
- _.forEach(expandPaths, function (path) {
- me.expandPath(path);
- });
- }, 1000),
- });
- }
- //# sourceMappingURL=StateTree.js.map
- function initDashboard () {
- Ext.define('com.yvan.studio.Dashboard', {
- extend: 'Ext.panel.Panel',
- alias: 'widget.dashboard',
- xtype: 'dashboard',
- html: ''
- });
- }
- //# sourceMappingURL=dashboard.js.map
- var handles$1 = {
- mainWindow: undefined,
- fileTree: undefined,
- dbTree: undefined,
- viewoutlinetree: undefined,
- statusbar: undefined,
- dictTree: undefined,
- property: undefined,
- dbcode: undefined,
- report: undefined,
- widget: undefined,
- whLayout: undefined,
- };
- window['handles'] = handles$1;
- function setDictTree(value) {
- handles$1.dictTree = value;
- }
- function setMainWindow(value) {
- handles$1.mainWindow = value;
- }
- function setReport(value) {
- handles$1.report = value;
- }
- function setStatusbar(statusbar) {
- handles$1.statusbar = statusbar;
- }
- function setFileTree(value) {
- handles$1.fileTree = value;
- }
- function setDbTree(value) {
- handles$1.dbTree = value;
- }
- function setWidget(value) {
- handles$1.widget = value;
- }
- function setWhLayout(value) {
- handles$1.whLayout = value;
- }
- function setViewoutlinetree(value) {
- handles$1.viewoutlinetree = value;
- }
- function setPropertyPanel(value) {
- handles$1.property = value;
- }
- function setDbCode(value) {
- handles$1.dbcode = value;
- }
- //# sourceMappingURL=Handles.js.map
- /**
- * 调用方法
- */
- function invokeMethod(fn, sender, args) {
- if (typeof fn === 'function') {
- fn.apply.apply(fn, __spread([sender], args));
- }
- }
- /**
- * 判断事件是否为有效的输入字符
- * @param e
- */
- function isChartEvent(e) {
- if (e.key === 'Shift' ||
- e.key === 'Control' ||
- e.key === 'Alt' ||
- e.key === 'Escape' ||
- e.key === 'ArrowRight' ||
- e.key === 'Tab' ||
- e.key === 'ArrowLeft') {
- return false;
- }
- if (e.keyCode >= 48 && e.keyCode <= 57) {
- // 0-9
- return true;
- }
- if (e.keyCode >= 65 && e.keyCode <= 90) {
- // a-z
- return true;
- }
- if (e.keyCode >= 96 && e.keyCode <= 111 && e.keyCode !== 108) {
- // 小键盘 0-9
- return true;
- }
- return false;
- }
- if (!window["time_offset"]) {
- window["time_offset"] = 0;
- }
- function syncDate(date) {
- if (date && date.setTime && date.getTime) {
- date.setTime(date.getTime() + window["time_offset"]);
- }
- return date;
- }
- //# sourceMappingURL=utils.js.map
- function isDesignMode(control, config) {
- var _a, _b;
- if (window["IS_DESIGN_MODE"]) {
- return true;
- }
- if ((control === null || control === void 0 ? void 0 : control.designMode) === true) {
- return true;
- }
- if (((_a = config === null || config === void 0 ? void 0 : config.yvanScope) === null || _a === void 0 ? void 0 : _a.IS_DESIGN_MODE) === true) {
- return true;
- }
- if ((control === null || control === void 0 ? void 0 : control.IS_DESIGN_MODE) === true) {
- return true;
- }
- if (((_b = config === null || config === void 0 ? void 0 : config.session) === null || _b === void 0 ? void 0 : _b.IS_DESIGN_MODE) === true) {
- return true;
- }
- return false;
- }
- function toString(value) {
- if (typeof value === 'undefined' || value === null) {
- return "";
- }
- if (typeof value === 'number' && isNaN(value)) {
- return "";
- }
- if (value == 'N/A') {
- return "";
- }
- return ("" + value);
- }
- function isEmpty(value) {
- if (typeof value === 'undefined' || value === null) {
- return true;
- }
- if (typeof value === 'number' && isNaN(value)) {
- return true;
- }
- if (value == 'N/A') {
- return true;
- }
- return ("" + value).trim().length <= 0;
- }
- function createUUID() {
- //@ts-ignore
- return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, function (c) {
- return (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16);
- });
- }
- function getRegList() {
- var regList = _$2.get(window, 'yvanLib.regList');
- if (!regList) {
- regList = [];
- _$2.set(window, 'yvanLib.regList', regList);
- }
- return regList;
- }
- function getRegParamList(methodName) {
- var regParamList = _$2.get(window, 'yvanLib.regParamList');
- if (!regParamList) {
- regParamList = {};
- _$2.set(window, 'yvanLib.regParamList', regParamList);
- }
- if (!_$2.has(regParamList, methodName)) {
- regParamList[methodName] = [];
- }
- return regParamList[methodName];
- }
- /**
- * 模拟点击按钮
- */
- function raiseClick(buttonHandle) {
- if (!buttonHandle) {
- return false;
- }
- if (buttonHandle.disabled) {
- // 按钮是禁止状态
- return false;
- }
- if (buttonHandle.hidden) {
- // 按钮是隐藏状态
- return false;
- }
- // 按钮点击
- buttonHandle.click();
- return true;
- }
- /**
- * 标注系统全局函数的参数
- * @param title 函数名称
- * @param type 函数类型
- * @param allowEmpty 可否为空
- */
- function LibParam(title, type, allowEmpty) {
- if (allowEmpty === void 0) { allowEmpty = false; }
- return function (target, methodName, paramsIndex) {
- var systemFnArgs = getRegParamList(methodName);
- systemFnArgs[paramsIndex] = {
- type: type,
- title: title,
- name: methodName,
- allowEmpty: allowEmpty,
- };
- };
- }
- /**
- * 标注函数变成"系统全局函数"
- */
- function Lib(registe) {
- return function (target, propertyKey, descriptor) {
- var libList = getRegList();
- libList.push(__assign(__assign({}, registe), { name: propertyKey, target: target[propertyKey] }));
- if (registe.type === 'system') {
- _$2.set(window, 'yvanLib.system.' + propertyKey, target[propertyKey]);
- }
- else if (registe.type === 'format') {
- _$2.set(window, 'yvanLib.format.' + propertyKey, target[propertyKey]);
- }
- return target;
- };
- }
- /**
- * 解析事件
- * 'scope.私有方法名'
- * 'system.系统函数名'
- * 'format.格式化名'
- */
- function lookupFn(scope, event, errorWho) {
- if (isDesignMode(scope, undefined)) {
- return Ext.emptyFn;
- }
- if (!_$2.startsWith(event, 'scope.') &&
- !_$2.startsWith(event, 'system.') &&
- !_$2.startsWith(event, 'format.')) {
- console.error('无法识别的事件响应类型', event);
- throw new TypeError('无法识别的事件响应类型');
- }
- // 为 eval 准备环境
- var _a = window['yvanLib'], system = _a.system, format = _a.format;
- var data = scope.viewModel.data;
- var keys = [];
- var values = [];
- _$2.forOwn(data, function (value, key) {
- var idxKey = key.indexOf('//');
- if (idxKey >= 0) {
- keys.push(key.substr(0, idxKey));
- }
- else {
- keys.push(key);
- }
- values.push(value);
- });
- var func = Function.apply(void 0, __spread(['scope', 'system', 'format'], keys, ['return ' + event]));
- var funcResult = func.apply(void 0, __spread([scope, system, format], values));
- if (typeof funcResult !== 'function') {
- console.error('无法识别的事件响应类型', event, func, errorWho);
- throw new TypeError('无法识别的事件响应类型');
- }
- return funcResult;
- }
- /**
- * 从 ext.element 获取 scope 对象
- */
- function lookupScope(extHandle) {
- if (!extHandle) {
- // @ts-ignore
- return;
- }
- if (extHandle.isScope) {
- return extHandle;
- }
- if (extHandle.column) {
- // 列上的组件
- return extHandle.column.lookupReferenceHolder().yvanScope;
- }
- if (_$2.get(extHandle, 'alias[0]') === 'widget.button') ;
- if (typeof extHandle.lookupViewModel === 'function') {
- var vm = extHandle.lookupViewModel();
- return vm.yvanScope;
- }
- return;
- }
- //# sourceMappingURL=lib.js.map
- /**
- * 全局 ajax 方法
- */
- var ajax = {};
- /**
- * 计算拼音的函数
- */
- var pinyinFunc = function (str) { return (str); };
- exports.scopeOnLoad = null;
- exports.apiConvert = undefined;
- var baseConfigProcessList = [];
- /**
- * 在基类添加 Config 的处理方法
- */
- function baseConfigProcess(option) {
- return function (target, propertyKey) {
- baseConfigProcessList.push(target[propertyKey]);
- };
- }
- // let designMode: boolean = false
- //
- // export function isDesignMode(): boolean {
- // return designMode
- // }
- //
- // export function setDesignMode(v: boolean) {
- // designMode = v
- // }
- /**
- * 将业务定义的 url 转换为调用服务端 groovy 的 url
- */
- function serverInvokeUrlTransform(url, option) {
- return _$2.get(window, '_YvanUI_serverInvokePrefix')(url, option);
- }
- /**
- * 将业务定义的 url 转换为调用服务端 sql 的 Url
- */
- function sqlUrlTransform(url) {
- return _$2.get(window, '_YvanUI_sqlPrefix')(url);
- }
- /**
- * YvanUI 全局扩展配置
- */
- function extend(option) {
- if (option.ajax) {
- ajax.func = option.ajax;
- }
- if (option.serverInvokeUrlTransform) {
- _$2.extend(window, { _YvanUI_serverInvokePrefix: option.serverInvokeUrlTransform });
- }
- if (option.sqlUrlTransform) {
- _$2.extend(window, { _YvanUI_sqlPrefix: option.sqlUrlTransform });
- }
- if (option.pinyinFunction) {
- pinyinFunc = option.pinyinFunction;
- }
- if (option.scopeOnLoad) {
- exports.scopeOnLoad = option.scopeOnLoad;
- }
- if (option.scopeOnCreate) {
- exports.scopeOnCreate = option.scopeOnCreate;
- }
- if (option.apiConvert) {
- exports.apiConvert = option.apiConvert;
- }
- // if (typeof option.designMode !== 'undefined') {
- // setDesignMode(option.designMode)
- // }
- }
- function getApiConvert() {
- return exports.apiConvert;
- }
- function getScopeOnCreate() {
- return exports.scopeOnCreate;
- }
- function getPinyin(v) {
- return pinyinFunc(v);
- }
- /**
- * 适用于 Select / Tree 等,作筛选的通用方法.
- * 1.首字母模糊匹配(不区分大小写)
- * 2.标识的模糊匹配(不区分大小写)
- * 3.名称的模糊匹配,且支持以逗号(全角或半角)隔开的字词匹配,并自动去空格,如“南京, 物流 ”可以匹配出“南京九州通物流技术开发有限公司”
- */
- function keywordFilter(keyword, label, value) {
- if (!keyword) {
- return true;
- }
- var ws = _$2.trim(keyword).split(/\s+|\.|,|\)|\(|,|。|-|—/g);
- // const labelPy = _.toLower(getPinyin(label))
- //@ts-ignore
- var labelPy = _$2.toLower(getFirstPinyin2(label));
- value = _$2.toLower(_$2.trim(value));
- var found = 0;
- _$2.some(ws, function (word) {
- if (labelPy.indexOf(word.toLowerCase()) >= 0 || label.indexOf(word) >= 0) {
- found++;
- return;
- }
- if (value && value.indexOf(word.toLowerCase()) >= 0) {
- found++;
- return;
- }
- });
- return found >= ws.length;
- }
- //# sourceMappingURL=config.js.map
- var idPrefix = "_ds_";
- var colsContainerArr = ['toolbar', 'col', 'form', 'fieldset']; //"design_cols_container"
- var rowsContainerArr = ['form', 'fieldset']; //"design_rows_container"
- var colItemCmpArr = ['label', 'textfield', 'textareafield', 'numberfield', 'combo', 'combobox', "datefield", 'searchfield', 'combotree', 'combogrid', 'button', 'checkbox', 'checkboxgroup', "radio", "radiogroup", "container"];
- var canMoveCmpArr = __spread(colItemCmpArr, ["cols"]);
- var layoutOrXtypeNameMap = {
- fit: 'fit布局',
- border: 'border布局',
- center: '中部',
- north: '上部',
- south: '下部',
- west: '左部',
- east: '右部',
- yvgrid: '表格',
- tree: '树',
- tabpanel: '标签页',
- form: '表单',
- fieldset: '字段组',
- tbar: '顶部工具栏',
- fbar: '底部工具栏',
- toolbar: '工具栏',
- cols: '列容器',
- rows: '行容器',
- textfield: '文本框',
- textareafield: '长文本框',
- numberfield: '数字框',
- label: "文本",
- combo: "下拉框",
- combobox: "下拉框",
- combotree: "下拉树",
- combogrid: "下拉表",
- datefield: "日期框",
- searchfield: "搜索框",
- button: "按钮",
- checkbox: "勾选",
- checkboxgroup: "勾选组",
- radio: "点选",
- radiogroup: "点选组",
- container: "占位"
- };
- /**
- * 从 VJSON 中找到 rows/cols 的数组
- */
- function findArrayContainer(vjson, id) {
- var parentVJson = getSuperVjson(vjson, id);
- if (_$2.isArray(parentVJson)) {
- return parentVJson;
- }
- if (parentVJson.hasOwnProperty('items')) {
- return parentVJson.items;
- }
- }
- /**
- * 根据id查找上级vjson
- * @param vjson 原始 vjson 视图
- * @param targetId 子元素的id
- */
- function getSuperVjson(vjson, targetId) {
- return deepTravFindSuper(vjson, vjson, targetId);
- }
- /**
- * 根据id查找上级vjson id
- * @param vjson 原始 vjson 视图
- * @param targetId 子元素的id
- */
- function getSuperVjsonId(vjson, targetId) {
- var vj = getSuperVjson(vjson, targetId);
- return vj.id;
- }
- function deepTravFindSuper(superVjson, vjson, targetId) {
- var rObj = null;
- _$2.forOwn(vjson, function (value, key) {
- if (rObj) {
- return;
- }
- if (typeof value !== "object") {
- return;
- }
- if (_$2.has(vjson, 'xtype') && vjson.xtype === 'toolbar') {
- if (key !== 'items') {
- return;
- }
- }
- else {
- // 模型、数据、数据源不扫描
- if (key === 'data' ||
- key === 'dataSource' ||
- key === 'suggest' ||
- key === 'options' ||
- key === 'config' ||
- key === 'columns' ||
- key === 'viewModel' ||
- key === 'store') {
- return;
- }
- }
- //事件不扫描
- if (key === "on" && _$2.isObject(value)) {
- return;
- }
- if (key.startsWith("on") && _$2.size(key) > 2) {
- return;
- }
- if (value.id === targetId) {
- if (_$2.isArray(vjson)) {
- rObj = superVjson;
- }
- else {
- rObj = vjson;
- }
- return;
- }
- rObj = deepTravFindSuper(vjson, value, targetId);
- });
- return rObj;
- }
- /**
- * 深度遍历 vjson
- * @param vjson 视图JSON
- * @param resolver 分析函数
- * @return 记录 resolver 方法返回 true 时,对象的访问路径
- */
- function deepTravVJson(vjson, resolver, propDeep) {
- if (propDeep === void 0) { propDeep = false; }
- var markerList = [];
- deepTrav1(vjson, resolver, markerList, propDeep);
- return markerList;
- }
- function deepTrav1(obj, resolver, marker, propDeep) {
- if (propDeep === void 0) { propDeep = false; }
- var isMarker = resolver(obj);
- if (marker && isMarker === true) {
- marker.unshift({ id: 0, keyName: '', object: obj });
- }
- _$2.forOwn(obj, function (value, key) {
- if (typeof value !== 'object') {
- return;
- }
- if (_$2.has(obj, 'xtype') && obj.xtype === 'toolbar') {
- if (key !== 'items' && key !== 'children') {
- return;
- }
- }
- else {
- // 模型、数据、数据源不扫描
- if (key === 'data' || key === 'dataSource' || key === 'viewModel' || key === 'store') {
- return;
- }
- if (!propDeep &&
- (key === 'suggest' || key === 'options' || key === 'config' || key === 'columns' ||
- key === 'listeners' || key === 'bind')) {
- return;
- }
- }
- //事件不扫描
- if (key === 'on' && _$2.isObject(value)) {
- return;
- }
- if (_$2.startsWith(key, 'on') && _$2.size(key) > 2) {
- return;
- }
- var isMarkerChild = deepTrav1(value, resolver, marker, propDeep);
- if (marker && isMarkerChild === true) {
- isMarker = true;
- marker.unshift({ id: obj.id, keyName: key, object: value });
- }
- });
- // @ts-ignore 删除作废对象
- _$2.remove(obj, function (v) { return v && v.isFiltered; });
- return isMarker;
- }
- /**
- * 在代码中找到 reference 对应的对象
- */
- function findInCode(code, id) {
- try {
- deepTravVJson(code, function (child) {
- if (child.id === id) {
- throw child;
- }
- });
- return undefined;
- }
- catch (err) {
- return err;
- }
- }
- function replaceVjsonById(vjson, itemVjson, itemId) {
- if (!itemVjson || (!itemVjson.id && !itemId)) {
- msgError('无法定位组件!');
- debugger;
- return;
- }
- var id = itemId || itemVjson.id;
- deepTravVJson(vjson, function (obj) {
- if (obj.id == id) {
- _$2.assign(obj, itemVjson, { id: id });
- }
- });
- }
- function deepTravDeleteVjson(obj, targetId) {
- var isDelete = false;
- _$2.forOwn(obj, function (value, key) {
- if (isDelete) {
- return;
- }
- if (typeof value !== 'object') {
- return;
- }
- if (_$2.has(obj, 'xtype') && obj.xtype === 'toolbar') {
- if (key !== 'items') {
- return;
- }
- }
- else {
- // 模型、数据、数据源不扫描
- if (key === 'data' ||
- key === 'dataSource' ||
- key === 'suggest' ||
- key === 'options' ||
- key === 'config' ||
- key === 'columns' ||
- key === 'viewModel' ||
- key === 'store') {
- return;
- }
- }
- //事件不扫描
- if (key === 'on' && _$2.isObject(value)) {
- return;
- }
- if (_$2.startsWith(key, 'on') && _$2.size(key) > 2) {
- return;
- }
- if (value.id === targetId) {
- isDelete = true;
- /** 如果是数组的元素*/
- if (_$2.isArray(obj)) {
- obj.splice(key, 1);
- }
- else {
- delete obj[key];
- }
- return;
- }
- isDelete = deepTravDeleteVjson(value, targetId);
- });
- return isDelete;
- }
- /**
- * 根据id删除Vjson 会删除因删除元素造成的空对象
- * @param obj 原始 vjson 视图
- * @param targetId 子元素的id
- */
- function deletVjsonById(vjson, targetId) {
- var isDeleted = deepTravDeleteVjson(vjson, targetId);
- // if (_.isArray(obj)) {
- // if (obj.length <= 0) {
- // let T: any = {
- // view: "template",
- // template: "拖动任何组件到此处",
- // role: "placeholder",
- // id: webix.uid()
- // }
- // obj.push(T);
- // }
- // }
- return isDeleted;
- }
- function removeDesignProp(vjson) {
- deepTravVJson(vjson, function (obj) {
- if (obj.hasOwnProperty('id')) {
- delete obj.id;
- }
- if (obj.hasOwnProperty("designMode")) {
- delete obj.designMode;
- }
- });
- if (vjson.hasOwnProperty("cls")) {
- delete vjson.cls;
- }
- if (vjson.hasOwnProperty("viewModel")) {
- delete vjson.viewModel;
- }
- if (vjson.hasOwnProperty("store")) {
- delete vjson.store;
- }
- }
- function getLayoutOutline(vjson) {
- deepTravVJson(vjson, function (obj) {
- if (!Array.isArray(obj)) {
- _$2.forOwn(obj, function (value, key) {
- if (key === 'id' || key === 'region' || key === 'layoutName'
- || key === 'text' || key === 'fieldLabel' || key === 'title'
- || key === 'layout' || key === 'xtype' || key === 'layoutNameDesc') {
- if (key === 'region'
- || (key === 'xtype' && !_$2.has(obj, 'region'))
- || (key === 'layout' && !_$2.has(obj, 'region') && !_$2.has(obj, 'xtype'))) {
- if (!_$2.has(obj, 'layoutName')) {
- obj.layoutName = obj.title || obj.text || obj.fieldLabel || obj[key];
- obj.layoutNameDesc = layoutOrXtypeNameMap[obj.layoutName] || obj.layoutName;
- // console.log(obj.layoutName, obj.layoutNameDesc)
- }
- }
- }
- else {
- if (key === 'items') {
- obj.children = obj[key];
- }
- if (key === 'tbar') {
- var t = obj[key];
- t.layoutName = key;
- t.layoutNameDesc = layoutOrXtypeNameMap[t.layoutName] || t.layoutName;
- // console.log(t.layoutName, t.layoutNameDesc)
- if (_$2.has(obj, "items")) {
- obj.items.splice(0, 0, t);
- }
- else if (_$2.has(obj, "children")) {
- obj.children.splice(0, 0, t);
- }
- else {
- obj.children = [t];
- }
- }
- if (key === 'fbar') {
- var t = obj[key];
- t.layoutName = key;
- t.layoutNameDesc = layoutOrXtypeNameMap[t.layoutName] || t.layoutName;
- // console.log(t.layoutName, t.layoutNameDesc)
- if (_$2.has(obj, "items")) {
- obj.items.push(t);
- }
- else if (_$2.has(obj, "children")) {
- obj.children.push(t);
- }
- else {
- obj.children = [t];
- }
- }
- delete obj[key];
- }
- });
- if (!obj.hasOwnProperty("children")) {
- obj.leaf = true;
- }
- if (!obj.hasOwnProperty("expanded")) {
- obj.expanded = true;
- }
- }
- });
- return vjson;
- }
- //# sourceMappingURL=ViewHelper.js.map
- var Scope = /** @class */ (function () {
- function Scope(args) {
- /**
- * 业务模块的唯一编号
- */
- this.id = _$2.uniqueId('scope_');
- this.IS_DESIGN_MODE = false;
- /**
- * onload 运行完成之后才会设置本标记为 true
- */
- this.isLoadFinish = false;
- this._isLoading = false;
- var model = args.model, vjson = args.vjson, i18n = args.i18n;
- this.model = model;
- if (typeof vjson.layout === 'undefined') {
- // 没有定义布局的情况下,走 buildPlus 重新定义简写版布局
- var ret = buildPlus({ model: model, vjson: vjson });
- model = ret.model;
- vjson = ret.vjson;
- }
- this.originalVjson = _$2.cloneDeep(vjson);
- this.vjson = this.originalVjson; // this.buildVjson()
- var WMSTranslate = window["WMSTranslate"];
- if (WMSTranslate) {
- var i18nPath_1 = this.constructor.name;
- if (i18n) {
- WMSTranslate[i18nPath_1] = i18n;
- }
- this.vjson.i18nPath = i18nPath_1;
- deepTravVJson(this.vjson, function (obj) {
- if (Array.isArray(obj) || !obj || (!obj.xtype && !obj.layout) || (!obj.xtype && !obj.header)) {
- return;
- }
- obj.i18nPath = i18nPath_1;
- });
- }
- var extScope = getScopeOnCreate();
- if (typeof extScope === 'function') {
- extScope({ vjson: vjson, model: model }, this);
- }
- }
- Scope.prototype._addWatch = function (tplExpress, fn) {
- if (!this._watchList) {
- this._watchList = [];
- }
- this._watchList.push({ watch: tplExpress, fn: fn });
- };
- Scope.prototype._applyWatchList = function () {
- var _this = this;
- _$2.forEach(this._watchList, function (item) {
- _this.viewModel.bind(item.watch, item.fn.bind(_this));
- });
- };
- Object.defineProperty(Scope.prototype, "isScope", {
- get: function () {
- return true;
- },
- enumerable: true,
- configurable: true
- });
- /**
- * 产生一个当前模块有效的唯一id
- * @param key 唯一编号
- */
- Scope.prototype.uid = function (key) {
- return this.id + key;
- };
- /**
- * 对话框"保存"成功.
- * 关闭对话框,并响应 success 方法
- * @param data 要傳回的數據(可以為空)
- */
- Scope.prototype.dialogSuccess = function (data) {
- this._handle.fireEvent('success', this, data);
- var sender = this._handle.config.animateTarget;
- var scope = lookupScope(sender);
- if (typeof this['success'] === 'function') {
- this['success'].call(scope, sender, data);
- }
- this.close();
- };
- /**
- * 设置等待状态
- * @param value
- * @param msg
- */
- Scope.prototype.setLoading = function (value) {
- var _a;
- var scope = this;
- this._isLoading = value;
- (_a = scope._handle) === null || _a === void 0 ? void 0 : _a.setLoading(value);
- };
- Scope.prototype.getLoading = function () {
- return this._isLoading;
- };
- /**
- * 以对话框模式打开当前模块
- * @param sender 发送者(按钮或Scope对象)
- * @param vjsonOption 界面覆盖选项(可以为空)
- * @param dataOption 数据覆盖选项(可以为空)
- */
- Scope.prototype.showDialog = function (sender, vjsonOption, dataOption) {
- var _a;
- var that = this;
- var vmodel = _$2.defaultsDeep({
- //
- }, dataOption, that.model);
- this.viewModel = new Ext.app.ViewModel(vmodel);
- this.viewModel.yvanScope = this;
- this._applyWatchList();
- this["scopeKey"] = "dialog-" + getVjsonHash(JSON.stringify(this.vjson) + JSON.stringify(vjsonOption));
- var config = _$2.defaultsDeep({
- animateTarget: sender,
- viewModel: this.viewModel,
- yvanScope: this,
- referenceHolder: true,
- }, vjsonOption, that.vjson, windows);
- if (config.height === 'unset') {
- delete config.height;
- }
- if (config.width === 'unset') {
- delete config.width;
- }
- // const holder = sender?.lookupReferenceHolder()
- // delete config.constrain
- var topScope = (_a = lookupScope(sender)) === null || _a === void 0 ? void 0 : _a.topScope;
- if (topScope) {
- config.constrain = true;
- this.topScope = topScope;
- }
- var win = new Ext.Window(config);
- // if (holder) {
- // holder.add(win)
- // }
- if (topScope) {
- topScope._handle.add(win);
- }
- win.addListener('beforerender', function (sender) {
- // 记录句柄
- if (sender && !that._handle) {
- that._handle = sender;
- }
- });
- win.addListener('afterrender', function (sender) {
- // 调用onLoad回调
- try {
- that._onLoad();
- }
- catch (e) {
- console.error('errorAt onLoad', e);
- }
- window['cw'] = that;
- });
- win.addListener('destroy', this._destroy.bind(this));
- win.show();
- };
- /**
- * 以标签模式打开当前模块
- * @param vjsonOption 界面覆盖选项(可以为空)
- * @param dataOption 数据覆盖选项(可以为空)
- */
- Scope.prototype.showPage = function (vjsonOption, dataOption) {
- var _this = this;
- var that = this;
- this._vjsonOption = vjsonOption;
- this._dataOption = dataOption;
- var vmodel = _$2.defaultsDeep({
- data: {}
- }, dataOption, that.model);
- this.viewModel = new Ext.app.ViewModel(vmodel);
- this.viewModel.yvanScope = this;
- this._applyWatchList();
- this["scopeKey"] = "page-" + getVjsonHash(JSON.stringify(this.vjson) + JSON.stringify(vjsonOption));
- // 根级不能设置id
- delete that.vjson.id;
- var config = _$2.defaultsDeep({
- viewModel: this.viewModel,
- yvanScope: this,
- referenceHolder: true,
- }, vjsonOption, that.vjson);
- var tt = Ext.getCmp('TT');
- var handle = tt.addScope(this, config, function (handle) {
- handle.addListener('added', function (sender) {
- // 记录句柄
- if (sender && !that._handle) {
- that._handle = sender;
- }
- });
- handle.addListener('afterrender', function (sender) {
- // 调用onLoad回调
- try {
- that._onLoad();
- }
- catch (e) {
- console.error('errorAt onLoad', e);
- }
- });
- handle.addListener('destroy', _this._destroy.bind(_this));
- });
- return handle;
- };
- /**
- * 直接渲染到元素
- * @param element 渲染目标
- * @param vjsonOption 界面覆盖选项(可以为空)
- * @param dataOption 数据覆盖选项(可以为空)
- */
- Scope.prototype.renderTo = function (element, vjsonOption, dataOption) {
- var that = this;
- this._vjsonOption = vjsonOption;
- this._dataOption = dataOption;
- var vmodel = _$2.defaultsDeep({
- data: {}
- }, that.model, dataOption);
- this["scopeKey"] = "render-" + getVjsonHash(JSON.stringify(this.vjson) + JSON.stringify(vjsonOption));
- this.viewModel = new Ext.app.ViewModel(vmodel);
- this.viewModel.yvanScope = this;
- this._applyWatchList();
- var config = _$2.defaultsDeep({
- viewModel: this.viewModel,
- yvanScope: this,
- referenceHolder: true,
- renderTo: element,
- listeners: {
- afterrender: function (sender) {
- var _a;
- // 记录句柄
- if (sender && !that._handle) {
- that._handle = sender;
- }
- // 调用onLoad回调
- that._onLoad();
- // 如果vjson中配置了 afterrender ,需要恢复状态
- invokeMethod((_a = that.vjson.listeners) === null || _a === void 0 ? void 0 : _a.afterrender, that, arguments);
- },
- },
- }, vjsonOption, that.vjson);
- new Ext.container.Viewport(config);
- };
- Scope.prototype.showDesigner = function (designer, option) {
- var that = this;
- var vmodel = _$2.defaultsDeep({
- data: {
- IS_DESIGN_MODE: true,
- }
- }, that.model);
- this.IS_DESIGN_MODE = true;
- this["scopeKey"] = "render-" + getVjsonHash(JSON.stringify(this.vjson));
- this.viewModel = new Ext.app.ViewModel(vmodel);
- this.viewModel.yvanScope = this;
- this._applyWatchList();
- var config = _$2.defaultsDeep({
- viewModel: this.viewModel,
- yvanScope: this,
- referenceHolder: true,
- listeners: {
- afterrender: function (sender) {
- var _a;
- // 记录句柄
- if (sender && !that._handle) {
- that._handle = sender;
- }
- // 调用onLoad回调
- that._onLoad();
- // 如果vjson中配置了 afterrender ,需要恢复状态
- invokeMethod((_a = that.vjson.listeners) === null || _a === void 0 ? void 0 : _a.afterrender, that, arguments);
- },
- },
- }, that.vjson);
- designer.removeAll(true);
- designer.add(config);
- };
- /**
- * 关闭对话框(或标签页)
- */
- Scope.prototype.close = function () {
- this._handle.close();
- };
- Object.defineProperty(Scope.prototype, "data", {
- /**
- * 获取 viewModel 里包含的数据(只读)
- */
- get: function () {
- return this.viewModel.getData();
- },
- enumerable: true,
- configurable: true
- });
- /**
- * 设置 viewModel 中的数据
- * 可以是 key, value 模式
- * 也可以是 {key:value} 模式
- */
- Scope.prototype.set = function (path, value) {
- return this.viewModel.set(path, value);
- };
- /**
- * 寻找模块内所有的 xtype 对应的对象
- * @param xtypeKey
- */
- Scope.prototype.down = function (xtypeKey) {
- return this._handle.down(xtypeKey);
- };
- Object.defineProperty(Scope.prototype, "refs", {
- /**
- * 获取所有设置过 Reference 名称的组件
- */
- get: function () {
- var _a, _b;
- return (_b = (_a = this._handle) === null || _a === void 0 ? void 0 : _a.getReferences()) !== null && _b !== void 0 ? _b : {};
- },
- enumerable: true,
- configurable: true
- });
- Scope.prototype._destroy = function () {
- var that = this;
- that.onDestroy();
- delete that._watchList;
- delete that._handle;
- this.isLoadFinish = false;
- };
- /**
- * 私有渲染完成后的回调
- */
- Scope.prototype._onLoad = function () {
- var _this = this;
- if (exports.scopeOnLoad && typeof exports.scopeOnLoad === 'function') {
- exports.scopeOnLoad(this);
- }
- this.onLoad();
- _$2.defer(function () {
- _this.isLoadFinish = true;
- });
- };
- /**
- * 默认 渲染完成之后调用的函数
- */
- Scope.prototype.onLoad = function () {
- };
- /**
- * 组件卸载之后的回调
- */
- Scope.prototype.onDestroy = function () {
- };
- return Scope;
- }());
- /**
- * 观察装饰器,viewModel 属性更改时触发成员方法
- * @param tplExpress tpl表达式,例如 "{form.f1}"
- */
- function watch(tplExpress, deep) {
- if (deep === void 0) { deep = false; }
- return function (target, propertyKey, pd) {
- target._addWatch({ bindTo: tplExpress, deep: deep }, target[propertyKey]);
- return target[propertyKey];
- };
- }
- // 获取vjson的hash值
- function getVjsonHash(str) {
- var hash = 3465217896, i, ch;
- for (i = str.length - 1; i >= 0; i--) {
- ch = str.charCodeAt(i);
- hash ^= ((hash << 5) + ch + (hash >> 2));
- }
- return (hash & 0x7FFFFFFF) + "";
- }
- function buildPlus(_a) {
- var model = _a.model, vjson = _a.vjson;
- var vjsonNew = __assign(__assign({}, vjson), { layout: 'fit', referenceHolder: true, items: [
- {
- layout: 'border',
- // tbar: vjson.action,
- items: vjson.items,
- },
- ] });
- if (_$2.isArray(vjson.action)) {
- vjsonNew.items[0].tbar = vjson.action;
- }
- return { model: model, vjson: vjsonNew };
- }
- //# sourceMappingURL=Scope.js.map
- var model = {
- data: {
- leftTabTitle: ''
- }
- };
- //# sourceMappingURL=Workbench.model.js.map
- var vjson = {
- frame: false,
- layout: 'border',
- width: '100%',
- height: '100%',
- border: false,
- defaults: {
- border: false
- },
- items: [
- {
- region: 'north',
- height: 60,
- cls: 'main-header',
- reference: 'mainTop',
- layout: 'hbox',
- items: [
- {
- html: '<div style="height:60px"><img src="/static/images/logo1.png" alt="" style="margin-top: 3px"></div>',
- flex: 1,
- border: false
- },
- {
- xtype: 'button', text: '配置工具', iconCls: 'fa fa-cogs', cls: 'header-menu', height: 60,
- menu: [
- {
- text: '通用数据设置', iconCls: 'x-fa fa-cog',
- reference: 'commonSetting'
- },
- {
- text: '录制测试脚本', iconCls: 'x-fa fa-check', reference: 'record_ready_api',
- listeners: {
- // click: 'scope.ready_api_click'
- }
- },
- ]
- },
- {
- xtype: 'button', tooltip: "开发者", iconCls: 'x-fa fa-user-circle', height: 60,
- cls: 'header-menu',
- menu: [
- { text: '退出登录', iconCls: 'x-fa fa-power-off', href: "/logout" },
- ]
- },
- ]
- },
- {
- region: 'west',
- bind: {
- title: '{leftTabTitle}',
- },
- titleAlign: 'center',
- border: true, split: true, width: 340, collapsible: true,
- reference: 'leftTab',
- xtype: 'tabpanel',
- tabPosition: 'left',
- tabRotation: 0,
- tabBar: {
- border: false
- },
- listeners: {
- tabchange: 'scope.leftTabChange',
- },
- items: [
- { tooltip: '首页', iconCls: 'x-fa fa-tachometer', xtype: "hometree" },
- { tooltip: '文件', iconCls: 'x-fa fa-file', xtype: 'filetree' },
- { tooltip: '数据模型', iconCls: 'x-fa fa-database', xtype: 'dbtree' },
- // {tooltip: '表单转换', iconCls: 'x-fa fa-exchange',},
- { tooltip: '查询报表', iconCls: 'x-fa fa-binoculars', xtype: 'reportGrid' },
- { tooltip: '字典', iconCls: 'x-fa fa-book', xtype: 'dicttree' },
- { tooltip: '仓库布局设计', iconCls: 'x-fa fa-building-o', xtype: "whlayout" },
- { tooltip: '检索窗口', iconCls: 'x-fa fa-search', xtype: 'widgetgrid' },
- { tooltip: '工作流', iconCls: 'x-fa fa-random', xtype: 'bpmntree' },
- { tooltip: '接口平台', iconCls: 'x-fa fa-plug', xtype: "apigrid" },
- { tooltip: '日志查询', iconCls: 'x-fa fa-hdd-o', xtype: "logstree" },
- { tooltip: '计划任务', iconCls: 'x-fa fa-calendar', xtype: "tasktree" },
- { tooltip: '工具窗口', iconCls: 'x-fa fa-suitcase', xtype: "toolbox" },
- { tooltip: '文档大纲', iconCls: 'x-fa fa-list', xtype: "viewoutlinetree" },
- { tooltip: 'DevOps', iconCls: 'x-fa fa-terminal', xtype: "devopsgrid" },
- { tooltip: '监控', iconCls: 'x-fa fa-bar-chart', xtype: "monitortree" },
- ]
- },
- {
- region: 'east',
- border: true, split: true, width: 340, collapsible: true, collapsed: true,
- title: '属性', iconCls: 'x-fa fa-newspaper-o', xtype: "propertydesign"
- },
- {
- region: 'center',
- split: true, border: true,
- xtype: 'maintab', reference: 'tt', id: 'TT',
- plain: true,
- listeners: {
- restorypage: 'scope.openScope',
- tabchange: 'scope.tabchange'
- },
- items: []
- },
- ],
- };
- //# sourceMappingURL=Workbench.view.js.map
- /**
- * 获取当前打开的项目资料
- */
- function getCurrentProject() {
- // const value = sessionStorage.getItem('CurrentProject');
- // if (value) {
- // project = JSON.parse(value)
- // if (!project.url) {
- // project = undefined
- // }
- // }
- // return project
- return {
- uuid: '00000000',
- name: '本服项目',
- url: '',
- };
- }
- /**
- * 设置当前打开的项目资料(全局)
- */
- function setCurrentProject(value) {
- sessionStorage.setItem('CurrentProject', JSON.stringify(value));
- }
- //# sourceMappingURL=Project.js.map
- // ------------------------------------------------------------------------------------------ types
- /** 订阅消息key类型 */
- var EventType;
- (function (EventType) {
- /** FileTree打开Module */
- EventType["ModuleOpen"] = "ModuleOpen";
- /** ModulePage 创建 */
- EventType["ModulePageCreate"] = "ModulePageCreate";
- /** ModuleItem内容变化 */
- EventType["ModuleItemChange"] = "ModuleItemChange";
- /** ModuleItem的 jsView 内容变化 */
- EventType["ModuleItemChangeViewJsChange"] = "ModuleItemChangeViewJsChange";
- /** 设置 vjson */
- EventType["SetVjson"] = "SetVjson";
- /** 更新 vjson */
- EventType["UpdateVjson"] = "UpdateVjson";
- /** 更新 组件vjson */
- EventType["UpdateComponentVjson"] = "UpdateComponentVjson";
- /** Component 选中内容变化 */
- EventType["ComponentSelectionChange"] = "ComponentSelectionChange";
- /** Component 选中内容变化 */
- EventType["ComponentContextmenu"] = "ComponentContextmenu";
- /** Component 删除事件 */
- EventType["ComponentDelete"] = "ComponentDelete";
- /** MainTab 选中改变事件 */
- EventType["MainTabChange"] = "MainTabChange";
- /** ModuleTab 选中改变事件 */
- EventType["ModuleTabChange"] = "ModuleTabChange";
- /** 保存事件 */
- EventType["SaveCall"] = "SaveCall";
- /** 撤销 */
- EventType["Undo"] = "Undo";
- /** 还原 */
- EventType["Redo"] = "Redo";
- /** 剪切 */
- EventType["Cut"] = "Cut";
- /** 复制 */
- EventType["Copy"] = "Copy";
- /** 粘贴 */
- EventType["Paste"] = "Paste";
- /** 全选 */
- EventType["SelectAll"] = "SelectAll";
- /** 读取剪切板 */
- EventType["ClipboardRead"] = "ClipboardRead";
- /** 检查模块更新 */
- EventType["RunCheckModule"] = "RunCheckModule";
- /** 停止检查模块更新 */
- EventType["StopCheckModule"] = "StopCheckModule";
- })(EventType || (EventType = {}));
- // ------------------------------------------------------------------------------------------ impls
- var EventBus = /** @class */ (function () {
- function EventBus() {
- /** 事件数据 */
- this.store = {};
- /** 事件订阅者注册表 */
- this.observeStoreTable = {};
- this.init();
- }
- EventBus.prototype.init = function () {
- var _this = this;
- // 更改store值就会自动publish消息 - 实现
- this.store = new Proxy({}, {
- get: function (target, key) {
- return target[key];
- },
- // 代理object赋值操作,设置值的时候,触发订阅时的回调函数
- set: function (target, key, data) {
- if (noValue(key))
- return false;
- target[key] = data;
- // 消息通知订阅者
- var observerArr = _this.observeStoreTable[key];
- if (noValue(observerArr) || observerArr.length <= 0)
- return true;
- observerArr.forEach(function (handler) {
- //try {
- handler(data, key);
- // } catch (err) {
- // console.error("消息通知函数执行失败,EventType=", key, " | EventData=", data, " | handler=", handler);
- // }
- });
- return true;
- },
- });
- };
- /** 取消注册订阅者 */
- EventBus.prototype.unregisterObserver = function (key, handler) {
- var _this = this;
- var observerArr = this.observeStoreTable[key];
- if (noValue(observerArr) || observerArr.length <= 0)
- return;
- if (noValue(handler)) {
- this.observeStoreTable[key] = [];
- }
- else {
- observerArr.forEach(function (obsHandler, index) {
- if (obsHandler !== handler)
- return;
- _this.observeStoreTable[key].splice(index, 1);
- });
- }
- };
- /** 注册订阅者 */
- EventBus.prototype.registerObserver = function (key, handler) {
- var observerArr = this.observeStoreTable[key];
- if (noValue(observerArr) || observerArr.length <= 0) {
- observerArr = [];
- this.observeStoreTable[key] = observerArr;
- }
- observerArr.push(handler);
- // if (noValue(key)) return;
- // const sourceValue = this.store[key];
- // if (noValue(sourceValue)) return;
- // handler(sourceValue, key);
- };
- /** 获取存储对象,修改这个对象属性即可publish消息 */
- EventBus.prototype.getStore = function () {
- return this.store;
- };
- /**
- * 取消订阅
- * @param key 订阅的消息key
- * @param handler 指定取消的监听函数
- */
- EventBus.prototype.unsubscribe = function (key, handler) {
- var _this = this;
- if (key instanceof Array) {
- key.forEach(function (k) { return _this.unregisterObserver(k, handler); });
- }
- else {
- this.unregisterObserver(key, handler);
- }
- };
- /**
- * 消息订阅
- * @param key 订阅的消息key
- * @param handler 监听函数
- */
- EventBus.prototype.subscribe = function (key, handler) {
- var _this = this;
- var cancelSubscribe = {
- key: key,
- cancel: function () {
- },
- };
- if (key instanceof Array) {
- key.forEach(function (k) { return _this.registerObserver(k, handler); });
- cancelSubscribe.cancel = function () { return key.forEach(function (k) { return _this.unsubscribe(k, handler); }); };
- }
- else {
- this.registerObserver(key, handler);
- cancelSubscribe.cancel = function () { return _this.unsubscribe(key, handler); };
- }
- return cancelSubscribe;
- };
- /**
- * 消息订阅(只订阅一次)
- * @param key 订阅的消息key
- * @param handler 监听函数
- */
- EventBus.prototype.subscribeOnce = function (key, handler) {
- var cancelSubscribe = this.subscribe(key, function (data) {
- // try {
- handler(data, key);
- // } catch (err) {
- // console.error("消息通知函数执行失败,EventType=", key, " | EventData=", data, " | handler=", handler);
- // }
- cancelSubscribe.cancel();
- });
- };
- /**
- * 发送消息(触发订阅监听函数)
- * @param key 消息key
- * @param eventData 消息值
- */
- EventBus.prototype.publish = function (key, eventData) {
- var _this = this;
- if (key instanceof Array) {
- key.forEach(function (k) { return _this.store[k] = eventData; });
- }
- else {
- this.store[key] = eventData;
- }
- };
- return EventBus;
- }());
- // ------------------------------------------------------------------------------------------ use
- var eventBus = new EventBus();
- //# sourceMappingURL=EventBus.js.map
- var model$1 = {
- data: {
- dataSync_isStart: false,
- dataSync: {
- skipError: false,
- clearData: false,
- tables: []
- },
- dataSyncResult: {
- jobId: ''
- },
- dataSource1: '',
- dataSource2: '',
- schema1: '',
- schema2: '',
- hasDiff: false,
- }
- };
- //# sourceMappingURL=DbSync.model.js.map
- var vjson$1 = {
- title: '数据库同步',
- layout: 'fit',
- items: [
- {
- reference: 'wizard1',
- layout: 'card',
- items: [
- {
- reference: 'first',
- layout: 'fit',
- bbar: [
- '->',
- {
- xtype: 'button',
- iconCls: 'x-fa fa-road',
- text: '结构同步 »',
- bind: {
- disabled: '{!hasDiff}'
- },
- listeners: {
- click: 'scope.structCopyTo',
- }
- },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-files-o',
- text: '数据同步 »',
- bind: {
- disabled: '{!hasDiff}'
- },
- listeners: {
- click: 'scope.dataCopyTo',
- }
- },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-sort-alpha-desc',
- text: '索引同步 »',
- bind: {
- disabled: '{!hasDiff}'
- },
- listeners: {
- click: 'scope.indexCopyTo',
- }
- },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-product-hunt',
- text: '存储过程同步 »',
- bind: {
- disabled: '{!hasDiff}'
- },
- listeners: {
- click: 'scope.procedureCopyTo',
- }
- },
- ],
- items: [
- {
- title: '数据库对比',
- reference: 'grid1',
- xtype: 'yvgrid',
- pagination: false,
- border: false,
- cellTip: true,
- selModel: {
- type: 'checkboxmodel',
- mode: 'MULTI',
- },
- tbar: {
- xtype: 'toolbar',
- items: [
- {
- xtype: 'combo',
- fieldLabel: '源数据库',
- bind: {
- value: '{dataSource1}'
- },
- dataSource: 'scope.getDataBaseName'
- },
- {
- xtype: 'combo',
- fieldLabel: '目标数据库',
- bind: {
- value: '{dataSource2}'
- },
- dataSource: 'scope.getDataBaseName'
- },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-flash',
- text: '对比',
- bind: {
- disabled: '{!dataSource1 || !dataSource2}'
- },
- listeners: {
- click: 'scope.diff',
- }
- },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-cloud-download',
- text: '重新拉取结构(耗时!)',
- bind: {
- disabled: '{!dataSource1 || !dataSource2}'
- },
- listeners: {
- click: 'scope.dbToMeta',
- }
- },
- ]
- },
- columns: [
- {
- dataIndex: 'table_name1',
- header: '源表',
- width: 300,
- },
- {
- dataIndex: 'table_name2',
- header: '目标表',
- width: 300,
- },
- {
- dataIndex: 'diff',
- header: '对比结果',
- width: 100,
- },
- {
- xtype: 'actioncolumn',
- width: 30,
- sortable: false,
- menuDisabled: true,
- items: [
- {
- iconCls: 'x-fa fa-bars',
- text: '打开',
- handler: 'scope.showDetail',
- }
- ]
- },
- {
- dataIndex: 'remark',
- header: '详情',
- width: 200,
- sortable: true,
- },
- ],
- },
- ]
- },
- {
- reference: 'ddl',
- layout: {
- type: 'vbox',
- pack: 'start',
- align: 'stretch'
- },
- items: [
- {
- xtype: 'sqleditor',
- reference: 'ddleditor',
- flex: 1,
- },
- {
- xtype: 'toolbar',
- items: [
- '->',
- {
- xtype: 'button',
- text: '« 上一步',
- listeners: {
- click: 'scope.back'
- }
- },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-flash',
- text: '执行',
- listeners: {
- click: 'scope.executeDDL'
- }
- },
- ]
- }
- ]
- },
- {
- reference: 'ddl_idx',
- layout: {
- type: 'vbox',
- pack: 'start',
- align: 'stretch'
- },
- items: [
- {
- xtype: 'sqleditor',
- reference: 'ddleditor_idx',
- flex: 1,
- },
- {
- xtype: 'toolbar',
- items: [
- '->',
- {
- xtype: 'button',
- text: '« 上一步',
- listeners: {
- click: 'scope.back'
- }
- },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-flash',
- text: '执行',
- listeners: {
- click: 'scope.executeDDLIdx'
- }
- },
- ]
- }
- ]
- },
- {
- reference: 'ddl_procedure',
- layout: {
- type: 'vbox',
- pack: 'start',
- align: 'stretch'
- },
- items: [
- {
- xtype: 'sqleditor',
- reference: 'ddleditor_procedure',
- flex: 1,
- },
- {
- xtype: 'toolbar',
- items: [
- '->',
- {
- xtype: 'button',
- text: '« 上一步',
- listeners: {
- click: 'scope.back'
- }
- },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-flash',
- text: '执行',
- listeners: {
- click: 'scope.executeProcedureSQL'
- }
- },
- ]
- }
- ]
- },
- {
- reference: 'datacopy',
- xtype: 'yvgrid',
- pagination: false,
- tbar: {
- xtype: 'toolbar',
- items: [
- {
- xtype: 'checkbox',
- fieldLabel: '忽略错误',
- bind: {
- value: '{dataSync.skipError}'
- },
- },
- {
- xtype: 'checkbox',
- fieldLabel: '清空数据',
- bind: {
- value: '{dataSync.clearData}'
- },
- },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-play-circle',
- text: '开始',
- bind: {
- disabled: '{dataSync_isStart}'
- },
- listeners: { click: 'scope.dataSync_start' }
- },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-stop-circle',
- text: '停止',
- bind: {
- disabled: '{!dataSync_isStart}'
- },
- listeners: { click: 'scope.dataSync_stop' }
- },
- ]
- },
- columns: [
- {
- dataIndex: 'tableName', header: '表名',
- width: 300,
- },
- {
- dataIndex: 'dataCount', header: '总记录数',
- width: 150,
- },
- {
- dataIndex: 'currentIdx', header: '当前记录数',
- width: 150,
- },
- {
- dataIndex: 'syncCount', header: '同步数',
- width: 150,
- },
- {
- dataIndex: 'deleteCount', header: '删除',
- width: 150,
- },
- {
- dataIndex: 'syncProgress', header: '进度',
- width: 150, dataType: 'int', formatter: 'percentRenderer'
- },
- ]
- }
- ]
- }
- ]
- };
- //# sourceMappingURL=DbSync.view.js.map
- var GLOBAL_NAMESPACE_PREFIX = 'com/galaxis/wms';
- function createEmptyModule(path, filename) {
- return request.post(getBaseUrl() + "@createModule", { args: [{ path: path, filename: filename }] });
- }
- function createFolder(parentPath, filename) {
- return request.post(getBaseUrl() + "@createFolder", { args: [{ parentPath: parentPath, filename: filename }] });
- }
- function getModuleFileContent(module) {
- return request.post(getBaseUrl() + "@getModuleFileContent", { args: [module] });
- }
- function saveFile(fileFullPath, fileContent) {
- return request.post(getBaseUrl() + "@saveFile", { args: [{ fileFullPath: fileFullPath, fileContent: fileContent }] }).then(function (res) {
- // @ts-ignore
- system.msg("保存成功");
- return res;
- });
- }
- function getQueryDslInfo(tableName) {
- return request.post(getBaseUrl() + "@getQueryDslInfo", {
- args: [
- { tableName: tableName }
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'getQueryDslInfo ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function invokeServer(url, param) {
- url = getCurrentProject().url + "/api/com/galaxis/wms" + url;
- return request.post(url, {
- args: [
- param
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'invokeServer ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function parseSqlApi(sql) {
- return request.post(getBaseUrl() + "@parseSqlApi", {
- args: [sql]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'parseSqlApi ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function saveModuleFiles(param) {
- return request.post(getBaseUrl() + "@saveModuleFiles", {
- args: [
- param
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'saveModuleFiles ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function createQueryDSLFile(_a) {
- var schema_name = _a.schema_name, table_name = _a.table_name;
- return request.post(getBaseUrl() + "@createQueryDSLFile", {
- args: [{ schema_name: schema_name, table_name: table_name }]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'createQueryDSLFile ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function dbToMeta(param) {
- if (typeof param === 'undefined') {
- param = { datasource: 'master' };
- }
- else if (typeof param.datasource === 'undefined') {
- param.datasource = 'master';
- }
- return request.post(getBaseUrl() + "@dbToMeta", {
- args: [
- param
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'dbToMeta ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function getColumnDomainApi(param) {
- if (typeof param === 'undefined') {
- param = { datasource: 'master' };
- }
- else if (typeof param.datasource === 'undefined') {
- param.datasource = 'master';
- }
- return request.post(getBaseUrl() + "@getColumnDomain", {
- args: [
- param
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'getColumnDomainApi ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function getMateData(param) {
- if (typeof param === 'undefined') {
- param = { datasource: 'master' };
- }
- else if (typeof param.datasource === 'undefined') {
- param.datasource = 'master';
- }
- return request.post(getBaseUrl() + "@getMateData", {
- args: [
- param
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'getMateData ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function getMateDataByTableName(param) {
- if (typeof param === 'undefined') {
- param = { datasource: 'master' };
- }
- else if (typeof param.datasource === 'undefined') {
- param.datasource = 'master';
- }
- return request.post(getBaseUrl() + "@getMateDataByTableName", {
- args: [
- param
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'getMateDataByTableName ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function saveMetaTableChanges(param) {
- if (typeof param === 'undefined') {
- param = { datasource: 'master' };
- }
- else if (typeof param.datasource === 'undefined') {
- param.datasource = 'master';
- }
- return request.post(getBaseUrl() + "@saveMetaTableChanges", {
- args: [
- param
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'saveMetaTableChanges ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function getModifyTableDDL(param) {
- if (typeof param === 'undefined') {
- param = { datasource: 'master' };
- }
- else if (typeof param.datasource === 'undefined') {
- param.datasource = 'master';
- }
- return request.post(getBaseUrl() + "@getModifyTableDDL", {
- args: [
- param
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'getModifyTableDDL ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function pushToDbCommitApi(param) {
- if (typeof param === 'undefined') {
- param = { datasource: 'master' };
- }
- else if (typeof param.datasource === 'undefined') {
- param.datasource = 'master';
- }
- return request.post(getBaseUrl() + "@pushToDbCommit", {
- args: [
- param
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'pushToDbCommitApi ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- /**
- * 保存 元数据Ex,并构建与数据库差别的 DDL 语句
- */
- function saveMetaExBuildDDL(param) {
- if (typeof param === 'undefined') {
- param = { datasource: 'master' };
- }
- else if (typeof param.datasource === 'undefined') {
- param.datasource = 'master';
- }
- return request.post(getBaseUrl() + "@saveMetaExBuildDDL", {
- args: [
- param
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'saveMetaExBuildDDL ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function registerResource(params) {
- return request.post(getBaseUrl() + "@registerResource", {
- args: [params]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'registerResource ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function getMenuTree(params) {
- return request.post(getBaseUrl() + "@getMenuTree", {
- args: [params]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'getMenuTree ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function moduleTree() {
- return request.post(getBaseUrl() + "@moduleTree")
- .catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'getMenuTree ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function dropTableDDL(schemaName, tableName) {
- return request.post(getBaseUrl() + "@dropTableDDL", {
- args: [
- { schemaName: schemaName, tableName: tableName },
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'dropTableDDL ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function renameTableDDL(schemaName, tableName, reTableName) {
- return request.post(getBaseUrl() + "@renameTableDDL", {
- args: [{ schemaName: schemaName, tableName: tableName, reTableName: reTableName }]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'renameTableDDL ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function executeModifyProcedureSQL(param) {
- return request.post(getBaseUrl() + "@executeModifyProcedureSQL", {
- args: [
- param,
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'getModifyProcedureSQL ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function parseDynamicSqlApi(sql, dataSource) {
- return request.post(getBaseUrl() + "@parseDynamicSql", {
- args: [
- { sql: sql, dataSource: dataSource },
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'parseDynamicSqlApi ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function exporerList() {
- return request.post(getBaseUrl() + "@exporerList", {
- args: [{}]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'exporerList ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function reportListApi() {
- return request.post(getBaseUrl() + "@reportList", {
- args: []
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'reportList ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function reportByIdApi(reportId) {
- return request.post(getBaseUrl() + "@reportById", {
- args: [
- { reportId: reportId },
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'reportById ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function createReportApi(reportName) {
- return request.post(getBaseUrl() + "@createReport", {
- args: [
- { reportName: reportName },
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'createReport ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function saveReportApi(param) {
- return request.post(getBaseUrl() + "@saveReport", {
- args: [
- param,
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'saveReport ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function delReportApi(report_id) {
- return request.post(getBaseUrl() + "@delReport", {
- args: [{ report_id: report_id },]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'delReport ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function getDict(param) {
- if (typeof param === 'undefined') {
- param = { datasource: 'master' };
- }
- else if (typeof param.datasource === 'undefined') {
- param.datasource = 'master';
- }
- return request.post(getBaseUrl() + "@getDict", {
- args: [
- param
- ]
- });
- }
- function saveDictApi(param) {
- if (typeof param === 'undefined') {
- param = { datasource: 'master' };
- }
- else if (typeof param.datasource === 'undefined') {
- param.datasource = 'master';
- }
- return request.post(getBaseUrl() + "@saveDict", {
- args: [
- param
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'saveDictApi ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function saveDictItemsApi(param) {
- if (typeof param === 'undefined') {
- param = { datasource: 'master' };
- }
- else if (typeof param.datasource === 'undefined') {
- param.datasource = 'master';
- }
- return request.post(getCurrentProject().url + "/api/com/galaxis/wms/sys/dict/Dict@saveItems", {
- args: [
- param
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'saveDictItemsApi ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function createDictEnum(param) {
- return request.post(getBaseUrl() + "@createDictEnum", {
- args: [
- param
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'createDictEnum ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function loadSqlContentApi(url) {
- return request.post(getBaseUrl() + "@loadSqlContent", {
- args: [
- {
- url: GLOBAL_NAMESPACE_PREFIX + url,
- }
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'loadSqlContentApi ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function saveSqlContentApi(url, content) {
- return request.post(getBaseUrl() + "@saveSqlContent", {
- args: [
- {
- url: GLOBAL_NAMESPACE_PREFIX + url,
- content: content,
- }
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'saveSqlContentApi ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function readBpmn(param) {
- return request.post(getBaseUrl() + "@readBpmn", {
- args: [param]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'exporerList ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function createBpmn(path, filename) {
- return request.post(getBaseUrl() + "@createBpmn", { args: [{ path: path, filename: filename }] }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'createBpmn ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function saveBpmn(fileFullPath, fileContent) {
- return request.post(getBaseUrl() + "@saveBpmn", { args: [{ fileFullPath: fileFullPath, fileContent: fileContent }] }).then(function (res) {
- // @ts-ignore
- system.msg("保存成功");
- return res;
- });
- }
- function deleteBpmn(path, filename) {
- return request.post(getBaseUrl() + "@deleteBpmn", { args: [{ path: path, filename: filename }] }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'deleteBpmn ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function createDevForm(param) {
- return request.post(getBaseUrl() + "@createDevForm", {
- args: [param]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'exporerList ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function readDevForm(param) {
- return request.post(getBaseUrl() + "@readDevForm", {
- args: [param]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'exporerList ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function calcColumnForm(param) {
- return request.post(getBaseUrl() + "@calcColumnForm", {
- args: [param]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'calcColumnForm ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function widgetListApi(param) {
- return request.post(getBaseUrl() + "@widgetListApi", {
- args: [param]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'widgetListApi ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function readWidget(param) {
- return request.post(getBaseUrl() + "@readWidget", {
- args: [param]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'readWidget ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function saveWidget(param) {
- return request.post(getBaseUrl() + "@saveWidget", {
- args: [param]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'saveWidget ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function deleteWidget(param) {
- return request.post(getBaseUrl() + "@deleteWidget", {
- args: [param]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'deleteWidget ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function getDataBaseNameApi() {
- return request.post(getBaseUrl() + "@getDataBaseName", {
- args: []
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'readWidget ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function getDiffDDLApi(param) {
- return request.post(getBaseUrl() + "@getDiffDDL", {
- args: [
- param
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'getDiffDDLApi ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function dataSyncApi(param) {
- return request.post(getBaseUrl() + "@dataSync", {
- args: [
- param
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'dataSyncApi ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function dataSyncInfoApi(param) {
- return request.post(getBaseUrl() + "@dataSyncInfo", {
- args: [
- param
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'dataSyncInfoApi ERROR!';
- showErrorDialog(msg);
- console.error(msg, e);
- });
- }
- function saveColumnDomain(param) {
- if (typeof param === 'undefined') {
- param = { datasource: 'master' };
- }
- else if (typeof param.datasource === 'undefined') {
- param.datasource = 'master';
- }
- return request.post(getBaseUrl() + "@saveColumnDomain", {
- args: [
- param
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'saveColumnDomain ERROR!';
- showErrorDialog('发生错误:' + msg);
- console.error(msg, e);
- });
- }
- function devOpsList() {
- return request.post(getBaseUrl() + "@devOpsList", {
- args: [{}]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'devOpsList ERROR!';
- showErrorDialog('发生错误:' + msg);
- console.error(msg, e);
- });
- }
- function devOpsById(opsId) {
- return request.post(getBaseUrl() + "@devOpsById", {
- args: [{ opsId: opsId }]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'devOpsById ERROR!';
- showErrorDialog('发生错误:' + msg);
- console.error(msg, e);
- });
- }
- function metricsRequestApi() {
- return request.get("/api/metrics/request")
- .catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'metricsRequestApi ERROR!';
- showErrorDialog('发生错误:' + msg);
- console.error(msg, e);
- });
- }
- function metricsJdbcApi() {
- return request.get("/api/metrics/jdbc")
- .catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'metricsJdbcApi ERROR!';
- showErrorDialog('发生错误:' + msg);
- console.error(msg, e);
- });
- }
- function executeDDL(param) {
- return request.post(getBaseUrl() + "@executeDDL", {
- args: [
- param,
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'executeDDL ERROR!';
- showErrorDialog('发生错误:' + msg);
- console.error(msg, e);
- });
- }
- function getModifyIdxDDL(param) {
- return request.post(getBaseUrl() + "@getModifyIdxDDL", {
- args: [
- param,
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'getModifyIdxDDL ERROR!';
- showErrorDialog('发生错误:' + msg);
- console.error(msg, e);
- });
- }
- function getModifyProcedureSQL(param) {
- return request.post(getBaseUrl() + "@getModifyProcedureSQL", {
- args: [
- param,
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'getModifyProcedureSQL ERROR!';
- showErrorDialog('发生错误:' + msg);
- console.error(msg, e);
- });
- }
- function saveWhLayout(param) {
- return request.post(getLayoutUrl() + "@saveWhLayout", {
- args: [
- param,
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'saveWhLayout ERROR!';
- showErrorDialog('发生错误:' + msg);
- console.error(msg, e);
- });
- }
- function deleteWhLayout(param) {
- return request.post(getLayoutUrl() + "@deleteWhLayout", {
- args: [
- param,
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'deleteWhLayout ERROR!';
- showErrorDialog('发生错误:' + msg);
- console.error(msg, e);
- });
- }
- function loadWhLayoutAll() {
- return request.post(getLayoutUrl() + "@loadWhLayoutAll", {
- args: []
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'loadWhLayoutAll ERROR!';
- showErrorDialog('发生错误:' + msg);
- console.error(msg, e);
- });
- }
- function loadWhLayout(param) {
- return request.post(getLayoutUrl() + "@loadWhLayout", {
- args: [
- param,
- ]
- }).catch(function (e) {
- var _a, _b;
- var msg = ((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || 'loadWhLayout ERROR!';
- showErrorDialog('发生错误:' + msg);
- console.error(msg, e);
- });
- }
- var baseUrl = "/api/com/yvan/studio/FileManager";
- var layoutUrl = "/api/com/yvan/studio/LayoutManager";
- function getBaseUrl() {
- // return getCurrentProject().url + baseUrl
- return baseUrl;
- }
- function getLayoutUrl() {
- // return getCurrentProject().url + baseUrl
- return layoutUrl;
- }
- var Request = /** @class */ (function () {
- function Request(axiosInstance) {
- this.axiosInstance = axiosInstance;
- }
- // 全局响应数据转换处理
- Request.transformResponse = function (response) {
- var _a;
- return (_a = response.data) !== null && _a !== void 0 ? _a : null;
- };
- Request.prototype.get = function (url, config) {
- return this.axiosInstance.get(url, config).then(function (response) { return Request.transformResponse(response); });
- };
- Request.prototype.delete = function (url, config) {
- return this.axiosInstance.delete(url, config).then(function (response) { return Request.transformResponse(response); });
- };
- Request.prototype.head = function (url, config) {
- return this.axiosInstance.head(url, config).then(function (response) { return Request.transformResponse(response); });
- };
- Request.prototype.options = function (url, config) {
- return this.axiosInstance.options(url, config).then(function (response) { return Request.transformResponse(response); });
- };
- Request.prototype.post = function (url, data, config) {
- return this.axiosInstance.post(url, data, config).then(function (response) { return Request.transformResponse(response); });
- };
- Request.prototype.put = function (url, data, config) {
- return this.axiosInstance.put(url, data, config).then(function (response) { return Request.transformResponse(response); });
- };
- Request.prototype.patch = function (url, data, config) {
- return this.axiosInstance.patch(url, data, config).then(function (response) { return Request.transformResponse(response); });
- };
- Request.prototype.request = function (config) {
- return this.axiosInstance.request(config).then(function (response) { return Request.transformResponse(response); });
- };
- return Request;
- }());
- /** 创建一个axios实例对象 */
- function axiosCreate(config) {
- return window['axios'].default.create(__assign({ validateStatus: function () { return true; } }, config));
- }
- var axiosInstance;
- function init() {
- axiosInstance = axiosCreate({
- validateStatus: function (status) { return (status >= 200 && status < 400); },
- });
- request = new Request(axiosInstance);
- }
- var request;
- /**
- * 对比两个列 是否存在不一致
- */
- function compareColumn(t1, c1, t2, c2) {
- if (typeof c2 === 'undefined') {
- return 'column_name';
- }
- if (c1.column_name !== c2.column_name) {
- return 'column_name';
- }
- if (toString(c1.default_value).trim() !== toString(c2.default_value).trim()) {
- return 'default_value';
- }
- if (toString(c1.column_comment) !== toString(c2.column_comment)) {
- return 'column_comment';
- }
- if (c1.is_primary_key !== c2.is_primary_key) {
- return 'is_primary_key';
- }
- if (c1.not_null !== c2.not_null) {
- return 'not_null';
- }
- var symbol1 = getDataTypeSymbol(t1, c1);
- var symbol2 = getDataTypeSymbol(t2, c2);
- if (symbol1 !== symbol2) {
- console.log(t1.table_name + "." + c1.column_name + ".dataType \u4E0D\u76F8\u7B49 [" + symbol1 + "," + symbol2 + "]");
- return 'data_type';
- }
- if (_$2.includes(['integer', 'long', 'timestamp', 'clob', 'blob'], symbol1)) ;
- else if (!_$2.includes(['char', 'varchar'], symbol1)) {
- // 只关注长度
- if (c1.column_size != c2.column_size) {
- return 'column_size';
- }
- }
- else {
- // 其他情况,长度和精度都要关注
- if (c1.column_size != c2.column_size) {
- return 'column_size';
- }
- if (c1.decimal_digits !== c2.decimal_digits) {
- return 'decimal_digits';
- }
- }
- }
- function compareDomainApply(tableInfo, column, domain, is_fix_size) {
- var symbol1 = getDataTypeSymbol(tableInfo, column);
- var symbol2 = getDataTypeSymbol(tableInfo, domain);
- if (symbol1 !== symbol2) {
- console.log(tableInfo.table_name + "." + column.column_name + ".dataType \u4E0D\u76F8\u7B49 [" + symbol1 + "," + symbol2 + "]");
- return 'data_type';
- }
- if (is_fix_size) {
- // 字段域吧大小限制住了
- if (_$2.includes(['integer', 'long', 'timestamp', 'clob', 'blob'], symbol1)) ;
- else if (_$2.includes(['char', 'varchar'], symbol1)) {
- // 只关注长度
- if (column.column_size != domain.column_size) {
- return 'column_size';
- }
- }
- else {
- // 其他情况,长度和精度都要关注
- if (column.column_size != domain.column_size) {
- return 'column_size';
- }
- if (column.decimal_digits !== domain.decimal_digits) {
- return 'decimal_digits';
- }
- }
- }
- }
- function checkColumn(table, col) {
- if (isEmpty(col.column_name)) {
- return "\u5B57\u6BB5\u540D\u4E0D\u80FD\u4E3A\u7A7A";
- }
- if (isKeyword(col.column_name)) {
- return "\"" + col.column_name + "\" \u662F\u5173\u952E\u5B57, \u4E0D\u80FD\u4F7F\u7528!";
- }
- if (!/^[a-zA-Z\_][a-zA-Z0-9\_]*$/.test(col.column_name)) {
- return "\u5B57\u6BB5\u540D\u975E\u6CD5";
- }
- return undefined;
- }
- function applyDomain(dbType, domain) {
- var editRow = {
- data_type: domain[dbType + '_datatype'],
- };
- domain = _$2.cloneDeep(domain);
- if (!editRow.data_type) {
- throw Error('字段域没有定义数据类型!');
- }
- // NUMBER(19) => data_type:NUMBER, column_size:19, decimal_digits:0
- var match = editRow.data_type.match(/^(.+)\((\d+)\)$/);
- if (match) {
- // 类型里面包含括号
- var sz = parseInt(match[2]);
- if (isNaN(sz)) {
- throw Error('字段域的定义错误:' + editRow.data_type);
- }
- domain.is_fix_size = true;
- editRow.data_type = match[1];
- domain.column_size = sz;
- domain.decimal_digits = 0;
- }
- else {
- // NUMBER(20,8) => data_type:NUMBER, column_size:20, decimal_digits:8
- var match2 = editRow.data_type.match(/^(.+)\((\d+)\,(\d+)\)$/);
- if (match2) {
- // 类型里面包含括号
- var sz = parseInt(match2[2]);
- if (isNaN(sz)) {
- throw Error('字段域的定义错误:' + editRow.data_type);
- }
- var dg = parseInt(match2[3]);
- if (isNaN(dg)) {
- throw Error('字段域的定义错误:' + editRow.data_type);
- }
- domain.is_fix_size = true;
- editRow.data_type = match[1];
- domain.column_size = sz;
- domain.decimal_digits = dg;
- }
- }
- if (domain.domain_column_ui) {
- _$2.extend(editRow, {
- column_ui: domain.domain_column_ui,
- });
- }
- if (domain.domain_column_dict) {
- _$2.extend(editRow, {
- column_dict: domain.domain_column_dict,
- });
- }
- if (domain.is_fix_size) {
- _$2.extend(editRow, {
- column_size: domain.column_size,
- decimal_digits: domain.decimal_digits
- });
- }
- if (domain.is_fix_default_value) {
- _$2.extend(editRow, {
- default_value: domain.default_value,
- });
- }
- return editRow;
- }
- /**
- * 获取字段类型代号(用于做跨数据库数据类型对比)
- */
- function getDataTypeSymbol(table, col) {
- if (table.db_type === 'oracle') {
- switch (col.data_type) {
- case 'number':
- if (col.column_size <= 10 && !col.decimal_digits) {
- return 'integer';
- }
- else if (col.column_size <= 19 && !col.decimal_digits) {
- return 'long';
- }
- return 'bigdecimal';
- case 'char':
- if (col.column_size > 3000) {
- return 'clob';
- }
- return 'char';
- case 'integer':
- return 'integer';
- case 'varchar':
- case 'varchar2':
- if (col.column_size > 3000) {
- return 'clob';
- }
- return 'varchar';
- case 'clob':
- return 'clob';
- case 'blob':
- return 'blob';
- case 'date':
- case 'timestamp':
- case 'timestamp(6)':
- case 'timestamp with local time zone':
- case 'timestamp(6) with local time zone':
- case 'timestamp(6) with time zone':
- return 'timestamp';
- }
- return "undefined";
- // throw Error('未知 Oracle 数据类型:' + col.data_type)
- }
- if (table.db_type === 'pgsql') {
- switch (col.data_type) {
- case 'int4':
- return 'integer';
- case 'int8':
- return 'long';
- case 'char':
- return 'char';
- case 'varchar':
- case 'varchar2':
- if (col.column_size > 3000) {
- return 'clob';
- }
- return 'varchar';
- case 'numeric':
- if (col.column_size <= 10 && !col.decimal_digits) {
- return 'integer';
- }
- else if (col.column_size <= 19 && !col.decimal_digits) {
- return 'long';
- }
- return 'bigdecimal';
- case 'timestamp':
- case 'timestamptz':
- return 'timestamp';
- case 'bytea':
- return 'blob';
- }
- return "undefined";
- // throw Error('未知 PostgreSQL 数据类型:' + col.data_type)
- }
- throw Error('未知数据库类型:' + table.db_type);
- }
- /**
- * 判断对象名称是不是数据库关键字(保留字)
- */
- function isKeyword(word) {
- if (!word || typeof word !== 'string') {
- return false;
- }
- var kk = ['access',
- 'add',
- 'all',
- 'alter',
- 'and',
- 'any',
- 'as',
- 'asc',
- 'audit',
- 'between',
- 'by',
- 'char',
- 'check',
- 'cluster',
- 'column',
- 'comment',
- 'compress',
- 'connect',
- 'create',
- 'current',
- 'date',
- 'decimal',
- 'default',
- 'delete',
- 'desc',
- 'distinct',
- 'drop',
- 'else',
- 'exclusive',
- 'exists',
- 'file',
- 'float',
- 'for',
- 'from',
- 'grant',
- 'group',
- 'having',
- 'identified',
- 'immediate',
- 'in',
- 'increment',
- 'index',
- 'initial',
- 'insert',
- 'integer',
- 'intersect',
- 'into',
- 'is',
- 'level',
- 'like',
- 'lock',
- 'long',
- 'maxextents',
- 'minus',
- 'mlslabel',
- 'mode',
- 'modify',
- 'noaudit',
- 'nocompress',
- 'not',
- 'nowait',
- 'null',
- 'number',
- 'of',
- 'offline',
- 'on',
- 'online',
- 'option',
- 'or',
- 'order',
- 'p',
- 'ctfree',
- 'prior',
- 'privileges',
- 'public',
- 'raw',
- 'rename',
- 'resource',
- 'revoke',
- 'row',
- 'rowid',
- 'rownum',
- 'rows',
- 'select',
- 'session',
- 'set',
- 'share',
- 'size',
- 'smallint',
- 'start',
- 'successful',
- 'synonym',
- 'sysdate',
- 'table',
- 'then',
- 'to',
- 'trigger',
- 'uid',
- 'union',
- 'unique',
- 'update',
- 'user',
- 'validate',
- 'values',
- 'varchar',
- 'varchar2',
- 'view',
- 'whenever',
- 'where',
- 'with'];
- return _$2.includes(kk, word.toLowerCase());
- }
- //# sourceMappingURL=DbUtils.js.map
- var DbSync = /** @class */ (function (_super) {
- __extends(DbSync, _super);
- function DbSync() {
- return _super.call(this, { model: model$1, vjson: vjson$1 }) || this;
- }
- DbSync.prototype.onLoad = function () {
- };
- DbSync.prototype.getDataBaseName = function (sender, _a) {
- var successCallback = _a.successCallback, failCallback = _a.failCallback;
- getDataBaseNameApi().then(function (res) {
- successCallback(res.data.map(function (name) {
- return {
- id: name, text: name
- };
- }));
- });
- };
- DbSync.prototype.showDetail = function (sender, row, col, btn, event, record) {
- showInfoDialog(record.get('remark'));
- };
- DbSync.prototype.diff = function () {
- var _this = this;
- var promise1 = getMateData({
- datasource: this.viewModel.get('dataSource1')
- });
- var promise2 = getMateData({
- datasource: this.viewModel.get('dataSource2')
- });
- this.viewModel.set('schema1', '');
- this.viewModel.set('schema2', '');
- this.refs.grid1.setLoading(true);
- Promise.all([promise1, promise2]).then(function (_a) {
- var _b = __read(_a, 2), res1 = _b[0], res2 = _b[1];
- var rows = [];
- if (_$2.size(res1) > 0) {
- // res1 起码有一个 schema
- _this.viewModel.set('schema1', res1[0].schema_name);
- _this.viewModel.set('schema2', res2[0].schema_name);
- if (!_this.viewModel.get('schema1')) {
- msg$1('datasource1 最起码需要一张表');
- return;
- }
- if (!_this.viewModel.get('schema2')) {
- msg$1('datasource2 最起码需要一张表');
- return;
- }
- _$2.forEach(res1[0].table_list, function (table1) {
- var _a;
- var table2 = _$2.find((_a = res2[0]) === null || _a === void 0 ? void 0 : _a.table_list, function (r) { return r.table_name === table1.table_name; });
- if (table1.schema_name) {
- _this.viewModel.set('schema1', table1.schema_name);
- }
- if (table2 === null || table2 === void 0 ? void 0 : table2.schema_name) {
- _this.viewModel.set('schema2', table2 === null || table2 === void 0 ? void 0 : table2.schema_name);
- }
- var row = {
- table_name1: table1.table_name,
- table_name2: table2 === null || table2 === void 0 ? void 0 : table2.table_name,
- table_info: table1
- };
- if (!table2) {
- row.diff = '不一致';
- row.remark = '目标表缺失';
- }
- else if (table1.column_list.length !== table2.column_list.length) {
- row.diff = '不一致';
- row.remark = "\u5B57\u6BB5\u6570\u91CF\u4E0D\u4E00\u6837 source=" + table1.column_list.length + " target=" + table2.column_list.length;
- }
- else {
- row.diff = '一致';
- var remark_1 = [];
- _$2.forEach(table1.column_list, function (col1) {
- var col2 = _$2.find(table2.column_list, function (c) { return c.column_name === col1.column_name; });
- if (!col2) {
- row.diff = '不一致';
- remark_1.push("\u5B57\u6BB5\u7F3A\u5931[" + col1.column_name + "]");
- }
- else {
- var colDiff = compareColumn(table1, col1, table2, col2);
- if (colDiff) {
- row.diff = '不一致';
- remark_1.push(col1.column_name + "." + colDiff + "=[" + col1[colDiff] + "," + col2[colDiff] + "]");
- }
- }
- });
- row.remark = remark_1.join('\n');
- }
- rows.push(row);
- });
- }
- _this.refs.grid1.setData(rows);
- _this.viewModel.set('hasDiff', true);
- }).finally(function () {
- _this.refs.grid1.setLoading(false);
- });
- };
- DbSync.prototype.structCopyTo = function () {
- var _this = this;
- if (!this.viewModel.get('dataSource1') || !this.viewModel.get('dataSource2')) {
- msg$1('选择数据源!');
- return;
- }
- var recordList = this.refs.grid1.getSelection();
- var tableNameList = _$2.map(recordList, function (r) { return r.get('table_name1'); });
- if (_$2.size(tableNameList) <= 0) {
- msg$1('请选择要同步的表');
- return;
- }
- var error = undefined;
- _$2.forEach(tableNameList, function (tableInfo) {
- _$2.forEach(tableInfo.column_list, function (col) {
- error = checkColumn(tableInfo, col);
- return false;
- });
- if (error) {
- return false;
- }
- });
- if (error) {
- msg$1(error);
- return;
- }
- var schema1 = this.viewModel.get('schema1');
- var schema2 = this.viewModel.get('schema2');
- if (!schema1 || !schema2) {
- msg$1('无法识别 schema 名称');
- return;
- }
- this.refs.grid1.setLoading(true);
- getDiffDDLApi({
- datasource1: this.viewModel.get('dataSource1'),
- datasource2: this.viewModel.get('dataSource2'),
- schema1: this.viewModel.get('schema1'),
- schema2: this.viewModel.get('schema2'),
- tables: tableNameList,
- }).then(function (res) {
- if (res.success) {
- _this.refs.ddleditor.setCode(res.data);
- _this.refs.wizard1.getLayout().setActiveItem(_this.refs.ddl);
- }
- }).finally(function () {
- _this.refs.grid1.setLoading(false);
- });
- };
- DbSync.prototype.indexCopyTo = function () {
- var _this = this;
- if (!this.viewModel.get('dataSource1') || !this.viewModel.get('dataSource2')) {
- msg$1('选择数据源!');
- return;
- }
- var recordList = this.refs.grid1.getSelection();
- var tableNameList = _$2.map(recordList, function (r) { return r.get('table_name1'); });
- if (_$2.size(tableNameList) <= 0) {
- msg$1('请选择要同步的表');
- return;
- }
- var schema1 = this.viewModel.get('schema1');
- var schema2 = this.viewModel.get('schema2');
- if (!schema1 || !schema2) {
- msg$1('无法识别 schema 名称');
- return;
- }
- this.refs.grid1.setLoading(true);
- getModifyIdxDDL({
- datasource1: this.viewModel.get('dataSource1'),
- datasource2: this.viewModel.get('dataSource2'),
- schema1: this.viewModel.get('schema1'),
- schema2: this.viewModel.get('schema2'),
- tables: tableNameList,
- }).then(function (res) {
- if (res.success) {
- _this.refs.ddleditor_idx.setCode(res.data);
- _this.refs.wizard1.getLayout().setActiveItem(_this.refs.ddl_idx);
- }
- }).finally(function () {
- _this.refs.grid1.setLoading(false);
- });
- };
- DbSync.prototype.procedureCopyTo = function () {
- var _this = this;
- if (!this.viewModel.get('dataSource1') || !this.viewModel.get('dataSource2')) {
- msg$1('选择数据源!');
- return;
- }
- var schema1 = this.viewModel.get('schema1');
- var schema2 = this.viewModel.get('schema2');
- if (!schema1 || !schema2) {
- msg$1('无法识别 schema 名称');
- return;
- }
- this.refs.grid1.setLoading(true);
- getModifyProcedureSQL({
- datasource1: this.viewModel.get('dataSource1'),
- datasource2: this.viewModel.get('dataSource2'),
- schema1: this.viewModel.get('schema1'),
- schema2: this.viewModel.get('schema2'),
- }).then(function (res) {
- if (res.success) {
- _this.refs.ddleditor_procedure.setCode(res.data);
- _this.refs.ddleditor_procedure.updateOptions({ readOnly: true });
- _this.refs.wizard1.getLayout().setActiveItem(_this.refs.ddl_procedure);
- }
- }).finally(function () {
- _this.refs.grid1.setLoading(false);
- });
- };
- DbSync.prototype.dataSync_start = function () {
- var _this = this;
- this.viewModel.set('dataSync_isStart', true);
- var dataSync = __assign({ datasource1: this.viewModel.get('dataSource1'), datasource2: this.viewModel.get('dataSource2') }, this.viewModel.get('dataSync'));
- this.refs.datacopy.setLoading(true);
- dataSyncApi(dataSync)
- .then(function (res) {
- mergeViewModel(_this.viewModel, "dataSyncResult", res, false);
- _this.dataSyncInterval = setInterval(_this.dataSync_process.bind(_this), 1000);
- })
- .finally(function () {
- _this.refs.datacopy.setLoading(false);
- });
- };
- DbSync.prototype.dataSync_process = function () {
- var _this = this;
- var jobId = this.viewModel.get('dataSyncResult.jobId');
- dataSyncInfoApi({ jobId: jobId })
- .then(function (res) {
- if (_$2.isArray(res.tableSyncInfos)) {
- var scrollPosition = _this.refs.datacopy.scrollable.position;
- _this.refs.datacopy.setData(res.tableSyncInfos);
- try {
- _this.refs.datacopy.scrollable.doScrollTo(scrollPosition.x, scrollPosition.y);
- }
- catch (e) {
- }
- }
- if (res.endTime) {
- // 已经结束
- var cost = ((res.endTime - res.startTime) / 1000).toFixed(0);
- if (res.success) {
- showInfoDialog("\u540C\u6B65\u5DF2\u5B8C\u6210\uFF0C\u8017\u65F6 " + cost + " \u79D2!");
- }
- else {
- showErrorDialog$1("\u540C\u6B65\u51FA\u9519\uFF0C\u8017\u65F6 " + cost + " \u79D2!");
- }
- _this.dataSync_stop();
- }
- })
- .catch(function (e) {
- showErrorDialog$1("dataSyncInfoApi \u63A5\u53E3\u5F02\u5E38!");
- console.error(e);
- // this.dataSync_stop()
- })
- .finally(function () {
- _this.refs.datacopy.setLoading(false);
- });
- };
- DbSync.prototype.dataSync_stop = function () {
- this.viewModel.set('dataSync_isStart', false);
- clearInterval(this.dataSyncInterval);
- delete this.dataSyncInterval;
- };
- DbSync.prototype.dataCopyTo = function () {
- if (!this.viewModel.get('dataSource1') || !this.viewModel.get('dataSource2')) {
- msg$1('选择数据源!');
- return;
- }
- var recordList = this.refs.grid1.getSelection();
- var tableNameList = _$2.map(recordList, function (r) { return r.get('table_name1'); });
- if (_$2.size(tableNameList) <= 0) {
- msg$1('请选择要同步的表');
- return;
- }
- var diffRec = _$2.find(recordList, function (r) { return r.get('diff') !== '一致'; });
- this.viewModel.set('dataSync.tables', tableNameList);
- this.refs.wizard1.getLayout().setActiveItem(this.refs.datacopy);
- };
- DbSync.prototype.next = function () {
- this.refs.wizard1.getLayout().setActiveItem(this.refs.ddl);
- };
- DbSync.prototype.back = function () {
- this.refs.wizard1.getLayout().setActiveItem(this.refs.first);
- };
- DbSync.prototype.dbToMeta = function () {
- var _this = this;
- var dataSource1 = this.viewModel.get('dataSource1');
- var dataSource2 = this.viewModel.get('dataSource2');
- confirm('真的要重新拉取元数据吗?可能耗时 10~30秒左右').then(function (res) {
- var promise1 = dbToMeta({ datasource: dataSource1 });
- var promise2 = dbToMeta({ datasource: dataSource2 });
- _this.refs.grid1.setLoading(true);
- Promise.all([promise1, promise2]).then(function (_a) {
- var _b = __read(_a, 2), res1 = _b[0], res2 = _b[1];
- _this.diff();
- }).catch(function (res) {
- _this.refs.grid1.setLoading(false);
- showErrorDialog$1(res);
- });
- });
- };
- DbSync.prototype.executeDDL = function () {
- var _this = this;
- var code = this.refs.ddleditor.getValue();
- var dataSource2 = this.viewModel.get('dataSource2');
- var target_schema_name = this.viewModel.get('schema2');
- var recordList = this.refs.grid1.getSelection();
- var table_infos = _$2.map(recordList, function (r) {
- return r.get('table_info');
- });
- this.setLoading(true);
- pushToDbCommitApi({
- datasource: dataSource2,
- ddl: code,
- table_infos: table_infos,
- target_schema_name: target_schema_name,
- }).then(function (res) {
- if (res === null || res === void 0 ? void 0 : res.success) {
- msg$1('执行成功');
- _this.back();
- _this.diff();
- return;
- }
- showErrorDialog$1('发生错误:' + (res === null || res === void 0 ? void 0 : res.msg));
- }).finally(function () {
- _this.setLoading(false);
- });
- };
- DbSync.prototype.executeDDLIdx = function () {
- var _this = this;
- var code = this.refs.ddleditor_idx.getValue();
- var dataSource2 = this.viewModel.get('dataSource2');
- this.setLoading(true);
- executeDDL({
- datasource: dataSource2,
- ddl: code,
- }).then(function (res) {
- if (res === null || res === void 0 ? void 0 : res.success) {
- msg$1('执行成功');
- _this.back();
- return;
- }
- showErrorDialog$1('发生错误:' + (res === null || res === void 0 ? void 0 : res.msg));
- }).finally(function () {
- _this.setLoading(false);
- });
- };
- DbSync.prototype.executeProcedureSQL = function () {
- var _this = this;
- this.setLoading(true);
- executeModifyProcedureSQL({
- datasource1: this.viewModel.get('dataSource1'),
- datasource2: this.viewModel.get('dataSource2'),
- schema1: this.viewModel.get('schema1'),
- schema2: this.viewModel.get('schema2'),
- }).then(function (res) {
- if (res === null || res === void 0 ? void 0 : res.success) {
- msg$1('执行成功');
- _this.back();
- return;
- }
- showErrorDialog$1('发生错误:' + (res === null || res === void 0 ? void 0 : res.msg));
- }).finally(function () {
- _this.setLoading(false);
- });
- };
- return DbSync;
- }(Scope));
- //# sourceMappingURL=DbSync.js.map
- var model$2 = {
- data: {}
- };
- //# sourceMappingURL=DbCodeTemplate.model.js.map
- var vjson$2 = {
- title: '示例代码',
- layout: 'fit',
- items: [
- {
- layout: 'border',
- items: [
- {
- region: 'north',
- split: true,
- height: 200,
- title: '表格数据',
- reference: 'dataeditor',
- xtype: 'jsoneditor',
- listeners: {
- change: 'scope.dataChanged'
- },
- },
- {
- region: 'west',
- split: true,
- width: 230,
- title: '模板',
- reference: 'tree1',
- xtype: 'treepanel',
- rootVisible: false,
- useArrows: true,
- colspan: 2,
- lines: true,
- multiSelect: false,
- listeners: {
- itemclick: 'scope.templateChange',
- },
- },
- {
- region: 'center',
- title: '参考代码',
- reference: 'preview',
- xtype: 'jsoneditor',
- },
- ]
- }
- ]
- };
- //# sourceMappingURL=DbCodeTemplate.view.js.map
- var rootNode = {
- id: 'ROOT',
- type: "ROOT",
- path: "",
- expanded: true,
- leaf: false,
- children: [
- { id: 'form', url: 'form.js', text: 'PC表单', leaf: true },
- { id: 'yvgrid_columns', url: 'yvgrid_columns.js', text: 'PC表格列', leaf: true },
- { id: 'dsl_select', url: 'dsl_select.js', text: 'QueryDSL查询', leaf: true },
- { id: 'dsl_update', url: 'dsl_update.js', text: 'QueryDSL更新', leaf: true },
- { id: 'dsl_insert', url: 'dsl_insert.js', text: 'QueryDSL插入', leaf: true },
- { id: 'dsl_delete', url: 'dsl_delete.js', text: 'QueryDSL删除', leaf: true },
- ],
- };
- var TemplateDev = /** @class */ (function (_super) {
- __extends(TemplateDev, _super);
- function TemplateDev() {
- var _this = _super.call(this, { model: model$2, vjson: vjson$2 }) || this;
- _this.dataChanged = _$2.debounce(function () {
- var me = _this;
- if (me.refs.tree1.selection) {
- me.templateChange(me.refs.tree1, me.refs.tree1.selection);
- }
- }, 50);
- return _this;
- }
- TemplateDev.prototype.onDestroy = function () {
- setDbCode(undefined);
- handles$1.dbTree.removeListener('selectionchange', this.dbTreeNodeChange);
- };
- TemplateDev.prototype.onLoad = function () {
- setDbCode(this);
- handles$1.dbTree.on('selectionchange', this.dbTreeNodeChange);
- this.refs.tree1.setRootNode(rootNode);
- getColumnDomainApi({}).then(function (_a) {
- var data = _a.data;
- return window['dev_column_domain'] = data;
- });
- };
- TemplateDev.prototype.dbTreeNodeChange = function () {
- var me = handles$1.dbcode;
- var tables = [];
- _$2.forEach(handles$1.dbTree.getSelection(), function (r) {
- var raw = _$2.cloneDeep(r.get('raw'));
- raw.id = r.get('id');
- if (r.get('type') === 'table') {
- tables.push(raw);
- return;
- }
- if (r.get('type') === 'column') {
- var tableInfo = _$2.find(tables, function (t) { return t.table_name === r.get('raw').table_name; });
- if (!tableInfo) {
- tableInfo = _$2.cloneDeep(r.parentNode.get('raw'));
- tables.push(tableInfo);
- }
- if (!tableInfo.column_list) {
- tableInfo.column_list = [raw];
- }
- else {
- tableInfo.column_list.push(raw);
- }
- }
- });
- // 对于没有选择列的表格,默认加上所有列
- _$2.forEach(tables, function (tableInfo) {
- if (typeof tableInfo.column_list === 'undefined') {
- tableInfo.column_list = [];
- handles$1.dbTree.store.getById(tableInfo.id).childNodes.forEach(function (r) {
- tableInfo.column_list.push(_$2.cloneDeep(r.get('raw')));
- });
- }
- });
- var code = JSON.stringify(tables, null, ' ');
- me.refs.dataeditor.setCode(code);
- };
- TemplateDev.prototype.templateChange = function (sender, record, item, index, e, eOpts) {
- var url = record.data.url;
- var rd = _$2.uniqueId('db_code_request');
- if (url) {
- var data = void 0;
- try {
- data = JSON.parse(this.refs.dataeditor.getCode());
- }
- catch (e) {
- return;
- }
- // require(['../../dist/studio/database/template/' + url + '.js?t=' + rd + '&ext='], (node) => {
- // if (typeof node.default === "function") {
- // const v = toString(node.default(data))
- // // this.refs.preview.setLanguage(record?.raw?.language ?? "plaintext")
- // this.refs.preview.setLanguage("plaintext")
- // this.refs.preview.setCode(v)
- // }
- // })
- showErrorDialog$1('没做这里');
- }
- };
- return TemplateDev;
- }(Scope));
- //# sourceMappingURL=DbCodeTemplate.js.map
- var model$3 = {
- data: {
- hasChanged: false,
- }
- };
- //# sourceMappingURL=DbDomain.model.js.map
- var vjson$3 = {
- bind: {
- title: '字段域{grid1.ischanged?" *":""}',
- },
- layout: 'fit',
- items: [
- {
- layout: 'border',
- items: [
- {
- region: 'center',
- xtype: 'yvgrid',
- selModel: {
- type: 'spreadsheet',
- columnSelect: true,
- pruneRemoved: false,
- extensible: 'y'
- },
- plugins: {
- clipboard: true,
- selectionreplicator: true
- },
- reference: 'grid1',
- pagination: false,
- tbar: {
- xtype: 'toolbar',
- items: [
- {
- xtype: 'button',
- text: '添加',
- iconCls: 'x-fa fa-plus-circle',
- listeners: {
- click: 'scope.addField'
- }
- },
- {
- xtype: 'button',
- text: '删除',
- iconCls: 'x-fa fa-minus-circle',
- listeners: {
- click: 'scope.removeField'
- }
- },
- {
- xtype: 'button',
- text: '保存',
- iconCls: 'x-fa fa-save',
- bind: {
- disabled: '{!grid1.ischanged}'
- },
- listeners: {
- click: 'scope.save'
- }
- },
- ]
- },
- listeners: {
- editfinish: 'scope.gridEditFinish',
- },
- columns: [
- {
- text: '字段域名称', dataIndex: 'domain_name',
- sortable: false,
- menuDisabled: true,
- locked: true,
- editor: {
- selectOnFocus: true
- }
- },
- {
- text: 'PgSQL类型', dataIndex: 'pgsql_datatype',
- sortable: false, menuDisabled: true,
- editor: {
- selectOnFocus: true
- }
- },
- {
- text: 'MySQL类型', dataIndex: 'mysql_datatype',
- sortable: false, menuDisabled: true,
- editor: {
- selectOnFocus: true
- }
- },
- {
- text: 'Oracle类型', dataIndex: 'oracle_datatype',
- sortable: false, menuDisabled: true,
- editor: {
- selectOnFocus: true
- }
- },
- {
- text: 'SqlServer类型', dataIndex: 'sqlserver_datatype',
- sortable: false, menuDisabled: true,
- editor: {
- selectOnFocus: true
- }
- },
- {
- text: 'Java类型', dataIndex: 'java_datatype',
- sortable: false, menuDisabled: true,
- editor: {
- selectOnFocus: true
- }
- },
- {
- text: '固定长度', dataIndex: 'is_fix_size',
- xtype: 'checkcolumn', sortable: false, menuDisabled: true,
- width: 88, resizable: false,
- },
- {
- text: '长度', dataIndex: 'column_size',
- sortable: false, menuDisabled: true, dataType: 'int',
- xtype: 'numbercolumn', format: '0',
- editor: { selectOnFocus: true }
- },
- {
- text: '小数位', dataIndex: 'decimal_digits',
- sortable: false, menuDisabled: true, dataType: 'int',
- xtype: 'numbercolumn', format: '0',
- editor: { selectOnFocus: true }
- },
- {
- text: '字典', dataIndex: 'domain_column_dict',
- sortable: false, menuDisabled: true,
- // fix: ['system.getDict("DICT")'],
- width: 200,
- editor: {
- xtype: 'combo',
- listConfig: {
- minWidth: 350
- },
- }
- },
- {
- text: '固定默认值', dataIndex: 'is_fix_default_value',
- xtype: 'checkcolumn', sortable: false, menuDisabled: true,
- width: 88, resizable: false,
- },
- {
- text: '默认值', dataIndex: 'default_value',
- sortable: false, menuDisabled: true,
- editor: {
- selectOnFocus: true
- }
- },
- {
- text: 'UI建议', dataIndex: 'domain_column_ui',
- sortable: false, menuDisabled: true,
- // fix: ['system.getDict("column_ui")'],
- editor: {
- xtype: 'combo',
- allowBlank: true,
- listConfig: {
- minWidth: 200
- },
- }
- },
- {
- text: '详细描述', dataIndex: 'domain_note',
- sortable: false, menuDisabled: true,
- editor: {}
- },
- {
- text: '责任人', dataIndex: 'domain_person',
- sortable: false, menuDisabled: true,
- editor: {
- selectOnFocus: true
- }
- },
- {
- text: '版本', dataIndex: 'domain_version',
- sortable: false, menuDisabled: true,
- editor: {
- selectOnFocus: true
- }
- },
- ]
- }
- ]
- },
- ]
- };
- //# sourceMappingURL=DbDomain.view.js.map
- var CacheStore = /** @class */ (function () {
- function CacheStore() {
- // 订阅
- this.subscribeList = [];
- this.apiResponse = undefined;
- }
- /**
- * 订阅结果集
- */
- CacheStore.prototype.registe = function (fn) {
- this.subscribeList.push(fn);
- };
- /**
- * 取消订阅
- */
- CacheStore.prototype.unregiste = function (fn) {
- _$2.remove(this.subscribeList, function (item) { return item === fn; });
- };
- /**
- * 尝试取数据(先读缓存)
- */
- CacheStore.prototype.reloadIfNeed = function (param) {
- var _this = this;
- if (typeof this.apiResponse === 'undefined') {
- // 从未有获取过值
- var cacheKey = this.getCacheKey(param);
- if (cacheKey) {
- // 可以从缓存读
- var fileName = getCurrentProject().uuid + "/" + cacheKey;
- native.loadFile(fileName, function (res) {
- if (res) {
- // 缓存有值
- _this.apiResponse = res;
- _this.notifyRefresh();
- }
- else {
- // 缓存没值
- _this.reloadForce(param).then(function (res) {
- });
- }
- });
- }
- else {
- // 不能从缓存读
- this.reloadForce(param).then(function (res) {
- });
- }
- return true;
- }
- return false;
- };
- /**
- * 尝试取数据(先读缓存), 并以异步方法返回 apiResponse
- */
- CacheStore.prototype.reloadIfNeedPromise = function (param) {
- var _this = this;
- return new Promise(function (resolve, reject) {
- if (typeof _this.apiResponse === 'undefined') {
- // 从未有获取过值
- var cacheKey = _this.getCacheKey(param);
- if (cacheKey) {
- // 可以从缓存读
- var fileName = getCurrentProject().uuid + "/" + cacheKey;
- native.loadFile(fileName, function (res) {
- if (res) {
- // 缓存有值
- _this.apiResponse = res;
- _this.notifyRefresh();
- resolve(_this.apiResponse);
- }
- else {
- // 缓存没值
- _this.reloadForce(param).then(function (res) {
- resolve(_this.apiResponse);
- });
- }
- });
- }
- else {
- // 不能从缓存读
- _this.reloadForce(param).then(function (res) {
- resolve(_this.apiResponse);
- });
- }
- }
- else {
- // 有值,获取过
- resolve(_this.apiResponse);
- }
- });
- };
- /**
- * 强制完全刷新, 不管之前有没有取过数据,都强制再取一遍
- */
- CacheStore.prototype.reloadForce = function (param) {
- var _this = this;
- _$2.forEach(this.subscribeList, function (fn) {
- fn(true);
- });
- return this.invokeApi(param)
- .then(function (res) {
- _this.apiResponse = res;
- var cacheKey = _this.getCacheKey(param);
- if (cacheKey) {
- // 可以保存到缓存
- var fileName = getCurrentProject().uuid + '/' + cacheKey;
- native.saveFile(fileName, res);
- }
- // 通知订阅者刷新
- _this.notifyRefresh();
- })
- .finally(function () {
- _$2.forEach(_this.subscribeList, function (fn) {
- fn(false);
- });
- });
- };
- /**
- * 通知组件,isLoading状态被更改
- */
- CacheStore.prototype.notifyLoading = function (isLoading) {
- var _this = this;
- _$2.forEach(this.subscribeList, function (fn) {
- fn(_this.apiResponse);
- });
- };
- /**
- * 通知数据更改,需要刷新
- */
- CacheStore.prototype.notifyRefresh = function () {
- var _this = this;
- _$2.forEach(this.subscribeList, function (fn) {
- fn(_this.apiResponse);
- });
- };
- return CacheStore;
- }());
- //# sourceMappingURL=CacheStore.js.map
- // 字段域数据
- var columnDomain = undefined;
- var DomainStore = /** @class */ (function (_super) {
- __extends(DomainStore, _super);
- function DomainStore() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- DomainStore.prototype.getCacheKey = function (param) {
- return "domain_data.json";
- };
- DomainStore.prototype.invokeApi = function (param) {
- return getColumnDomainApi();
- };
- /**
- * 设置全局可访问的 字段域数据
- */
- DomainStore.prototype.getColumnDomainComboData = function () {
- var _this = this;
- return new Promise(function (resolve) {
- _this.reloadIfNeedPromise(undefined).then(function (res) {
- resolve(_this.apiResponse.data.map(function (v) {
- return { id: v.domain_id, text: v.domain_name };
- }));
- });
- });
- };
- /**
- * 设置全局可访问的 字段域数据
- */
- DomainStore.prototype.getColumnDomainById = function (value) {
- return _$2.find(this.apiResponse.data, function (v) { return v.domain_id === value; });
- };
- DomainStore.prototype.getAllDomain = function () {
- return new Promise(function (resolve, reject) {
- getColumnDomainApi()
- .then(function (res) {
- if (res.success) {
- if (res.success) {
- var tt = _$2.map(res.data, function (row) {
- return {
- text: row.domain_name,
- id: row.domain_id,
- };
- });
- _$2.set(window, 'DICT_CACHE.column_domain', tt);
- }
- columnDomain = res.data;
- resolve(res.data);
- }
- else {
- window['showErrorDialog']('getColumnDomain error!\n' + res.msg);
- console.error('getColumnDomain', res.msg);
- }
- })
- .catch(function (e) {
- window['showErrorDialog']('getColumnDomain error!');
- console.error('getColumnDomain', e);
- reject(e);
- });
- });
- };
- return DomainStore;
- }(CacheStore));
- var instance = new DomainStore();
- //# sourceMappingURL=DomainStore.js.map
- var DbDomain = /** @class */ (function (_super) {
- __extends(DbDomain, _super);
- function DbDomain() {
- return _super.call(this, { model: model$3, vjson: vjson$3 }) || this;
- }
- DbDomain.prototype.onLoad = function () {
- var _this = this;
- instance.getAllDomain().then(function (data) {
- _this.refs.grid1.setData(data);
- });
- };
- DbDomain.prototype.gridEditFinish = function () {
- this.viewModel.set('hasChanged', true);
- };
- DbDomain.prototype.addField = function () {
- this.refs.grid1.appendEditRow({
- domainName: '',
- pgSqlDataType: '',
- mysqlDataType: '',
- oracleDataType: '',
- sqlserverDataType: '',
- javaDataType: '',
- isFixSize: true,
- size: '',
- decimalDigits: '',
- isFixDefaultValue: false,
- defaultValue: null,
- domainColumnDict: '',
- domainColumnUI: '',
- note: '',
- domainPerson: '',
- domainVersion: '',
- }, 0);
- };
- DbDomain.prototype.removeField = function () {
- var _this = this;
- var rows = [];
- this.refs.grid1.getSelectionModel().getSelected().eachRow(function (r) {
- rows.push(r);
- });
- _.forEach(rows, function (r) {
- _this.refs.grid1.getStore().remove(r);
- });
- };
- DbDomain.prototype.save = function () {
- var _this = this;
- // 提取表格中,所有的 新行(newRows) / 修改过的行(modifyRows) / 删除过的行(removeRecords) / 全部行(rows) / 异常(err)
- var _a = system.getGridEditRows(this.refs.grid1), newRows = _a.newRows, modifyRows = _a.modifyRows, removeRecords = _a.removeRecords, rows = _a.rows, err = _a.err;
- if (err) {
- // 如果有异常就不保存
- return;
- }
- // 进行业务上的逻辑校验,比如说必填校验等等
- var hasError = false;
- _.forEach(rows, function (row, i) {
- if (isEmpty(row.domain_name)) {
- system.msg("\u5B57\u6BB5\u57DF\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A!");
- hasError = true;
- return false;
- }
- if (isEmpty(row.pgsql_datatype) ||
- isEmpty(row.mysql_datatype) ||
- isEmpty(row.oracle_datatype) ||
- isEmpty(row.sqlserver_datatype)) {
- system.msg("datatype \u4E0D\u80FD\u4E3A\u7A7A!");
- hasError = true;
- return false;
- }
- });
- if (hasError) {
- return;
- }
- // 设置当前界面为 "保存中..." 状态
- this.setLoading(true);
- saveColumnDomain({
- // 吧 newRows / modifyRows / removeRecords 再外加一些需要附带的数据,一并提交给后台,进行一次性事务提交
- newRows: newRows,
- modifyRows: modifyRows,
- removeRecords: removeRecords,
- }).then(function (res) {
- // 保存成功就提示一下,并重新载入数据 (根据 dataSource 的设置)
- system.msg(res.msg);
- instance.reloadForce({}).then(function () {
- instance.getAllDomain().then(function (data) {
- _this.refs.grid1.setData(data);
- });
- }).finally(function () {
- // 无论正常异常,关闭 "保存中..." 状态
- _this.setLoading(false);
- });
- }).catch(function (e) {
- // 无论正常异常,关闭 "保存中..." 状态
- _this.setLoading(false);
- });
- };
- return DbDomain;
- }(Scope));
- //# sourceMappingURL=DbDomain.js.map
- var model$4 = {
- data: {
- report_id: '',
- report_name: '',
- report_enable: false,
- report: {
- dataSource: '',
- grid: {
- pagination: true,
- },
- query: [],
- columns: [],
- summary: [],
- },
- querySql: '',
- summarySql: '',
- createAt: '',
- createBy: '',
- updateAt: '',
- updateBy: '',
- }
- };
- //# sourceMappingURL=ReportDesign.model.js.map
- var vjson$4 = {
- bind: {
- title: '报表-{report_name}',
- },
- layout: 'fit',
- items: [
- {
- layout: 'border',
- items: [
- {
- region: 'north',
- items: [
- {
- xtype: 'toolbar',
- border: false,
- items: [
- {
- xtype: 'button',
- text: '刷新',
- iconCls: 'x-fa fa-refresh',
- listeners: {
- click: 'scope.load'
- }
- },
- {
- xtype: 'button',
- text: '保存',
- iconCls: 'x-fa fa-save',
- listeners: {
- click: 'scope.save'
- }
- },
- {
- xtype: 'button',
- text: '预览',
- iconCls: 'x-fa fa-play-circle-o',
- listeners: {
- click: 'scope.preview'
- }
- },
- {
- xtype: 'textfield',
- fieldLabel: '报表名称',
- flex: 1,
- bind: {
- value: '{report_name}'
- }
- },
- {
- xtype: 'checkbox',
- fieldLabel: '启用报表',
- checkedValue: 1,
- uncheckedValue: 0,
- bind: {
- value: '{report_enable}'
- }
- },
- {
- xtype: 'checkbox',
- fieldLabel: '启用分页',
- bind: {
- value: '{report.grid.pagination}'
- }
- },
- {
- xtype: 'textfield',
- fieldLabel: '数据源',
- flex: 1,
- bind: {
- value: '{report.dataSource}'
- }
- },
- ]
- }
- ]
- },
- {
- xtype: 'tabpanel', region: 'center', plain: true, border: false,
- items: [
- {
- title: 'SQL和查询条件',
- layout: 'border',
- border: false,
- items: [
- {
- region: 'north',
- height: 200,
- border: false,
- split: true,
- xtype: 'yvgrid',
- reference: 'gridCondition',
- pagination: false,
- hideFootbar: true,
- plugins: {
- clipboard: true,
- selectionreplicator: true
- },
- selModel: {
- type: 'spreadsheet',
- columnSelect: false,
- pruneRemoved: false,
- extensible: 'y'
- },
- tbar: {
- xtype: 'toolbar',
- border: false,
- items: [
- {
- xtype: 'button',
- text: '添加条件',
- iconCls: 'x-fa fa-plus-circle',
- listeners: {
- click: 'scope.addCondition'
- }
- },
- {
- xtype: 'button',
- text: '删除条件',
- iconCls: 'x-fa fa-minus-circle',
- listeners: {
- click: 'scope.removeCondition'
- }
- },
- '-',
- {
- xtype: 'button',
- text: '自动分析条件变量',
- iconCls: 'x-fa fa-code-fork',
- listeners: {
- click: 'scope.calcCondition'
- }
- },
- {
- xtype: 'button',
- text: '上移',
- iconCls: 'x-fa fa-arrow-up',
- listeners: {
- click: 'scope.moveUp'
- }
- },
- {
- xtype: 'button',
- text: '下移',
- iconCls: 'x-fa fa-arrow-down',
- listeners: {
- click: 'scope.moveDown'
- }
- },
- ]
- },
- columns: [
- {
- text: '条件变量',
- dataIndex: 'conditionFieldBind',
- width: 140,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: true
- },
- },
- {
- text: '中文标题',
- dataIndex: 'conditionFieldLabel',
- width: 120,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: true
- },
- },
- {
- text: '编辑类型',
- dataIndex: 'conditionFieldXtype',
- width: 80,
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'combo',
- typeAhead: true,
- triggerAction: 'all',
- selectOnFocus: true,
- store: [
- ['textfield', 'textfield'],
- ['combo', 'combo'],
- ['datefield', 'datefield'],
- ['datetimefield', 'datetimefield'],
- ['numberfield', 'numberfield'],
- ['multiplesearch', 'multiplesearch'],
- ]
- }
- },
- {
- text: '权重',
- dataIndex: 'conditionFieldFlex',
- align: 'right',
- width: 60,
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'numberfield',
- selectOnFocus: false,
- minValue: 0,
- maxValue: 10
- },
- },
- {
- text: '字典',
- dataIndex: 'conditionFieldDict',
- width: 160,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: false
- },
- },
- {
- xtype: 'checkcolumn',
- dataIndex: "conditionFieldWrap", header: "换行",
- width: 65,
- sortable: false,
- menuDisabled: true,
- },
- {
- text: '扩展参数',
- dataIndex: 'conditionFieldExtend',
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: false
- },
- },
- ]
- },
- {
- region: 'center',
- xtype: 'sqleditor',
- layout: 'fit',
- reference: 'sqlEditor',
- split: true,
- },
- ]
- },
- {
- title: '查询结果字段',
- xtype: 'yvgrid',
- reference: 'gridColumn',
- pagination: false,
- hideFootbar: true,
- border: false,
- plugins: {
- clipboard: true,
- selectionreplicator: true
- },
- selModel: {
- type: 'spreadsheet',
- columnSelect: false,
- pruneRemoved: false,
- extensible: 'y'
- },
- tbar: {
- xtype: 'toolbar',
- items: [
- {
- xtype: 'button',
- text: '添加',
- iconCls: 'x-fa fa-plus-circle',
- listeners: {
- click: 'scope.addColumn'
- }
- },
- {
- xtype: 'button',
- text: '删除',
- iconCls: 'x-fa fa-minus-circle',
- listeners: {
- click: 'scope.removeColumn'
- }
- },
- '-',
- {
- xtype: 'button',
- text: '自动分析',
- iconCls: 'x-fa fa-code-fork',
- listeners: {
- click: 'scope.calcColumn'
- }
- },
- {
- xtype: 'button',
- text: '上移',
- iconCls: 'x-fa fa-arrow-up',
- listeners: {
- click: 'scope.moveUp'
- }
- },
- {
- xtype: 'button',
- text: '下移',
- iconCls: 'x-fa fa-arrow-down',
- listeners: {
- click: 'scope.moveDown'
- }
- },
- ]
- },
- columns: [
- { xtype: 'rownumberer' },
- {
- text: '字段',
- dataIndex: 'dataIndex',
- width: 140,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: true
- },
- },
- {
- text: '标题',
- dataIndex: 'header',
- width: 120,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: true
- },
- },
- {
- text: '显示类型',
- dataIndex: 'xtype',
- width: 90,
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'combo',
- typeAhead: true,
- triggerAction: 'all',
- selectOnFocus: true,
- store: [
- ['', ''],
- ['rownum', 'rownum'],
- ['button', 'button'],
- ['checkbox', 'checkbox'],
- ['progres', 'progres'],
- ]
- }
- },
- {
- text: '数据类型',
- dataIndex: 'dataType',
- width: 90,
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'combo',
- typeAhead: true,
- triggerAction: 'all',
- selectOnFocus: true,
- store: [
- ['', ''],
- ['string', 'string'],
- ['number', 'number'],
- ['date', 'date'],
- ]
- }
- },
- {
- text: '宽度',
- dataIndex: 'width',
- align: 'right',
- width: 60,
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'numberfield',
- selectOnFocus: true,
- minValue: 0,
- maxValue: 1000
- },
- },
- {
- text: '权重',
- dataIndex: 'flex',
- align: 'right',
- width: 60,
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'numberfield',
- selectOnFocus: true,
- minValue: 0,
- maxValue: 10
- },
- },
- {
- text: '字典',
- dataIndex: 'dict',
- sortable: false,
- menuDisabled: true,
- width: 120,
- editor: {
- selectOnFocus: true,
- },
- },
- {
- text: '对齐',
- dataIndex: 'align',
- width: 60,
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'combo',
- typeAhead: true,
- triggerAction: 'all',
- selectOnFocus: false,
- store: [
- ['', ''],
- ['start', 'start'],
- ['center', 'center'],
- ['end', 'end'],
- ]
- },
- },
- {
- text: '过滤',
- dataIndex: 'filterable',
- xtype: 'checkcolumn',
- width: 50,
- resizable: false,
- sortable: false,
- menuDisabled: true,
- },
- {
- text: '隐藏',
- dataIndex: 'hidden',
- xtype: 'checkcolumn',
- width: 50,
- resizable: false,
- sortable: false,
- menuDisabled: true,
- },
- {
- text: '排序',
- dataIndex: 'sortable',
- xtype: 'checkcolumn',
- width: 50,
- resizable: false,
- sortable: false,
- menuDisabled: true,
- },
- {
- text: '扩展参数',
- dataIndex: 'fieldExtend',
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: false
- },
- },
- ],
- },
- {
- title: '汇总和汇总逻辑',
- layout: 'border',
- border: false,
- items: [
- {
- xtype: 'yvgrid', region: 'north', layout: 'fit',
- reference: 'gridSum',
- pagination: false,
- hideFootbar: true,
- height: 200,
- split: true,
- border: false,
- plugins: {
- clipboard: true,
- selectionreplicator: true
- },
- selModel: {
- type: 'spreadsheet',
- columnSelect: false,
- pruneRemoved: false,
- extensible: 'y'
- },
- tbar: {
- xtype: 'toolbar',
- border: false,
- items: [
- {
- xtype: 'button',
- text: '添加',
- iconCls: 'x-fa fa-plus-circle',
- listeners: {
- click: 'scope.addSum'
- }
- },
- {
- xtype: 'button',
- text: '删除',
- iconCls: 'x-fa fa-minus-circle',
- listeners: {
- click: 'scope.removeSum'
- }
- },
- '-',
- {
- xtype: 'button',
- text: '自动分析',
- iconCls: 'x-fa fa-code-fork',
- listeners: {
- click: 'scope.calcSum'
- }
- },
- {
- xtype: 'button',
- text: '上移',
- iconCls: 'x-fa fa-arrow-up',
- listeners: {
- click: 'scope.moveUp'
- }
- },
- {
- xtype: 'button',
- text: '下移',
- iconCls: 'x-fa fa-arrow-down',
- listeners: {
- click: 'scope.moveDown'
- }
- },
- ]
- },
- columns: [
- {
- text: '字段名',
- dataIndex: 'sumFieldBind',
- width: 140,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: true
- },
- },
- {
- text: '标题',
- dataIndex: 'sumFieldLabel',
- width: 120,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: true
- },
- },
- {
- text: '权重',
- dataIndex: 'sumFieldFlex',
- align: 'right',
- width: 60,
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'numberfield',
- selectOnFocus: false,
- allowBlank: true,
- minValue: 0,
- maxValue: 10
- },
- },
- {
- xtype: 'checkcolumn',
- dataIndex: "sumFieldWrap", header: "换行",
- sortable: false,
- menuDisabled: true,
- width: 65,
- },
- {
- text: '扩展参数',
- dataIndex: 'sumFieldExtend',
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: false
- },
- },
- ]
- },
- {
- region: 'center',
- xtype: 'sqleditor',
- layout: 'fit',
- reference: 'sqlSumEditor',
- },
- ]
- },
- ]
- }
- ]
- }
- ]
- }; //
- //
- //# sourceMappingURL=ReportDesign.view.js.map
- var DbStore = /** @class */ (function (_super) {
- __extends(DbStore, _super);
- function DbStore() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- DbStore.prototype.getCacheKey = function (param) {
- return "db_data.json";
- };
- DbStore.prototype.invokeApi = function (param) {
- return getMateData(param);
- };
- /**
- * 保存 元数据Ex,并构建与数据库差别的 DDL 语句
- */
- DbStore.prototype.saveMetaExBuildDDLPromise = function (schema_name, table_name, tableInfo, column_list) {
- return new Promise(function (resolve, reject) {
- saveMetaExBuildDDL({ schema_name: schema_name, table_name: table_name, tableInfo: tableInfo, column_list: column_list }).then(function (res1) {
- resolve(res1);
- // TODO 好像不需要,先跳过
- // reloadByTableName(schema_name, table_name).then(res2 => {
- // resolve(res1)
- // }).catch(e => {
- // reject(e)
- // })
- }).catch(function (e) {
- reject(e);
- });
- });
- };
- /**
- * 保存元数据至表格
- */
- DbStore.prototype.saveMetaTable = function (schema_name, table_name, tableInfo, fieldChanges, ddl) {
- var _this = this;
- return new Promise(function (resolve, reject) {
- saveMetaTableChanges({ schema_name: schema_name, table_name: table_name, tableInfo: tableInfo, fieldChanges: fieldChanges, ddl: ddl }).then(function (res1) {
- // 保存后重新刷新
- _this.reloadByTableName(schema_name, table_name).then(function (res2) {
- resolve({
- data: res2,
- msg: res1.msg
- });
- }).catch(function (e) {
- reject(e);
- });
- }).catch(function (e) {
- reject(e);
- });
- });
- };
- /**
- * 预览生成的 DDL 语句
- */
- DbStore.prototype.previewColumnChangeDDL = function (schema_name, table_name, tableInfo, fieldChanges, column_list) {
- return new Promise(function (resolve, reject) {
- getModifyTableDDL({ schema_name: schema_name, table_name: table_name, tableInfo: tableInfo, fieldChanges: fieldChanges, column_list: column_list })
- .then(function (res) {
- resolve(res);
- });
- });
- };
- /**
- * 执行 DDL
- */
- DbStore.prototype.pushToDbCommit = function (arg) {
- return new Promise(function (resolve, reject) {
- pushToDbCommitApi(arg).then(function (res) {
- resolve(res);
- }).catch(function (e) {
- reject(e);
- });
- });
- };
- /**
- * 重读某一个表格的 meta 元数据
- */
- DbStore.prototype.reloadByTableName = function (schema_name, table_name) {
- var _this = this;
- return new Promise(function (resolve, reject) {
- getMateDataByTableName({ schema_name: schema_name, table_name: table_name }).then(function (res) {
- if (!res[0] || !res[0].table_list[0]) {
- showErrorDialog$1('获取表格元数据数据失败,' + schema_name + '.' + table_name);
- return;
- }
- var tableRow = _this.getTableByName(schema_name, table_name);
- if (!tableRow) {
- // 没有找到这个表格,就添加一个表格到对应的 schemaRow
- var schemaRow = _$2.find(_this.apiResponse, function (i) { return (i.schema_name === schema_name); });
- if (!schemaRow) {
- showErrorDialog$1('没有找到 schema:' + schema_name);
- return;
- }
- schemaRow.table_list.push(res[0].table_list[0]);
- }
- else {
- // 找到了目标表格,就吧 table 所有属性都赋值过去
- Object.assign(tableRow, res[0].table_list[0]);
- }
- // 所有界面通知一遍刷新
- _this.notifyRefresh();
- resolve(res);
- }).catch(function (e) {
- reject(e);
- });
- });
- };
- DbStore.prototype.getColumnByTableNameColumnName = function (table_name, column_name) {
- var result = undefined;
- _$2.forEach(this.apiResponse, function (schemaRow) {
- var tableRow = _$2.find(schemaRow.table_list, function (i) { return (i.table_name === table_name); });
- if (tableRow) {
- var columnRow = _$2.find(tableRow.column_list, function (i) { return (i.column_name === column_name); });
- if (columnRow) {
- result = columnRow;
- return false;
- }
- }
- });
- return result;
- };
- DbStore.prototype.getTableByName = function (schemaName, tableName) {
- var schemaRow = _$2.find(this.apiResponse, function (i) { return (i.schema_name === schemaName); });
- if (!schemaRow) {
- showErrorDialog$1('没有找到 schema:' + schemaName);
- return;
- }
- var tableRow = _$2.find(schemaRow.table_list, function (i) { return (i.table_name === tableName); });
- if (!schemaRow) {
- showErrorDialog$1('没有找到 table:' + tableName);
- return;
- }
- return tableRow;
- };
- /**
- * 添加一个新表格
- */
- DbStore.prototype.appendNewTable = function (tableInfo) {
- var schemaRow = _$2.find(this.apiResponse, function (i) { return (i.schema_name === tableInfo.schema_name); });
- if (!schemaRow) {
- showErrorDialog$1('没有找到 schema:' + tableInfo.schema_name);
- return;
- }
- schemaRow.table_list.push(tableInfo);
- };
- /**
- * 从数据库结构重新生成元数据
- */
- DbStore.prototype.dbToMetaAndReload = function () {
- var _this = this;
- this.notifyLoading(true);
- dbToMeta().then(function () {
- _this.reloadForce(undefined);
- }).catch(function (e) {
- _this.notifyLoading(false);
- });
- };
- DbStore.prototype.getSchemaDbType = function (schemaName) {
- var dbType = undefined;
- _$2.forEach(this.apiResponse, function (schemaRow) {
- if (schemaRow.schema_name === schemaName) {
- dbType = schemaRow.db_type;
- return false;
- }
- });
- return dbType;
- };
- return DbStore;
- }(CacheStore));
- function syncQueryDSL(_a) {
- var schema_name = _a.schema_name, table_name = _a.table_name;
- return createQueryDSLFile({ schema_name: schema_name, table_name: table_name });
- }
- var instance$1 = new DbStore();
- // // 字段域数据
- // let columnDomain = undefined
- // // 元数据
- // let apiResponse = []
- //
- // // 订阅
- // const subscribeList = []
- // /**
- // * 获取全部元数据
- // */
- // export function getApiResponse() {
- // return apiResponse
- // }
- //
- // export function getColumnDomain() {
- // return columnDomain
- // }
- // window['getApiResponse'] = getApiResponse
- // window['getColumnDomain'] = getColumnDomain
- // window['getDbTreeStore'] = function () {
- // return apiResponse
- // }
- //
- // /**
- // * 订阅结果集
- // */
- // export function subscribe(fn) {
- // subscribeList.push(fn)
- // }
- //
- // /**
- // * 取消订阅
- // */
- // export function describe(fn) {
- // _.remove(subscribeList, item => item === fn)
- // }
- //
- // /**
- // * 刷新,如果前端从来没有取到过结果的话
- // * 如果强制刷新成功,就返回 true
- // * 如果没有被强制刷新,返回 false
- // */
- // export function reloadIfNeed() {
- // if (_.size(apiResponse) <= 0) {
- // reloadForce()
- // return true
- // }
- // return false
- // }
- //
- // export function reloadIfNeedPromise() {
- // return new Promise((resolve, reject) => {
- // if (_.size(apiResponse) <= 0) {
- // // 从未有获取过值
- // reloadForce().then(res => {
- // resolve(apiResponse)
- // })
- // return
- // }
- // resolve(apiResponse)
- // return
- // })
- // }
- //
- // /**
- // * 强制完全刷新, 不管之前有没有取过数据,都强制再取一遍
- // */
- // export function reloadForce() {
- // _.forEach(subscribeList, fn => {
- // fn(true)
- // })
- //
- // return getMateData().then((content) => {
- // apiResponse = content
- // _.forEach(subscribeList, fn => {
- // fn(apiResponse)
- // })
- // }).finally(() => {
- // _.forEach(subscribeList, fn => {
- // fn(false)
- // })
- // })
- // }
- //
- // /**
- // * 通知刷新元数据
- // */
- // export function notifyRefresh() {
- // _.forEach(subscribeList, fn => {
- // fn(apiResponse)
- // })
- // }
- // export function getAllDomain() {
- // return new Promise((resolve, reject) => {
- // getColumnDomainApi()
- // .then(res => {
- // if (res.success) {
- // columnDomain = res.data
- // resolve(res.data)
- // } else {
- // showErrorDialog('getColumnDomain error!\n' + res.msg)
- // console.error('getColumnDomain', res.msg)
- // }
- //
- // })
- // .catch(e => {
- // showErrorDialog('getColumnDomain error!')
- // console.error('getColumnDomain', e)
- // reject(e)
- // })
- // })
- // }
- //# sourceMappingURL=DbStore.js.map
- var PROJECT_DICT_CACHE = {};
- window['PROJECT_DICT_CACHE'] = PROJECT_DICT_CACHE;
- /**
- *项目运行时构建
- **/
- function createRuntime() {
- {
- // 已经构建过了
- return new Promise(function (resolve) {
- resolve();
- });
- }
- }
- //# sourceMappingURL=ProjectRuntime.js.map
- function ReportRunner(reportId, setLoadingFn) {
- return new Promise(function (resolve) {
- setLoadingFn(true);
- Promise.all([reportByIdApi(reportId), createRuntime()]).then(function (_a) {
- // const {model, vjson, report} = buildVjson(res.data)
- // const ret = new ReportScope({model, vjson})
- // ret.report_id = reportId
- // ret.report = report
- // resolve(ret)
- var _b = __read(_a, 1), res = _b[0];
- var ret = buildReportScope(res.data, reportId, invokeServer, "getProjectDict");
- resolve(ret);
- }).finally(function () {
- setLoadingFn(false);
- });
- });
- }
- //# sourceMappingURL=ReportRunner.js.map
- //gridCondition
- //gridColumn
- //gridSum
- //sqlSumEditor
- //sqlEditor
- var ReportDesign = /** @class */ (function (_super) {
- __extends(ReportDesign, _super);
- function ReportDesign() {
- return _super.call(this, { model: model$4, vjson: vjson$4 }) || this;
- }
- ReportDesign.prototype.onLoad = function () {
- this.load();
- };
- ReportDesign.prototype.save = function (sender) {
- var _this = this;
- this.viewModel.set('querySql', this.refs.sqlEditor.getCode());
- this.viewModel.set('summarySql', this.refs.sqlSumEditor.getCode());
- this.viewModel.set('report.query', this.refs.gridCondition.getDataRowsOnlyData());
- this.viewModel.set('report.columns', this.refs.gridColumn.getDataRowsOnlyData());
- this.viewModel.set('report.summary', this.refs.gridSum.getDataRowsOnlyData());
- var report = this.viewModel.get('report');
- var data = {
- report_id: this.viewModel.get('report_id'),
- report_name: this.viewModel.get('report_name'),
- report_enable: this.viewModel.get('report_enable'),
- query_sql: this.viewModel.get('querySql'),
- summary_sql: this.viewModel.get('summarySql'),
- report: json5.stringify(report, null, ' '),
- };
- sender.setLoading(true);
- saveReportApi(data).then(function (res) {
- if (res.success) {
- msg$1('保存成功');
- _this.dialogSuccess(data);
- _this.load();
- }
- }).finally(function () {
- sender.setLoading(false);
- });
- };
- ReportDesign.prototype.preview = function (sender) {
- var reportId = this.viewModel.get('report_id');
- ReportRunner(reportId, sender.setLoading.bind(sender)).then(function (scope) {
- handles.mainWindow.showReportPreview(reportId, scope);
- });
- };
- ReportDesign.prototype.load = function () {
- var _this = this;
- var reportId = this.viewModel.get('report_id');
- this.setLoading(true);
- reportByIdApi(reportId).then(function (res) {
- var _a = res.data, query_sql = _a.query_sql, report = _a.report, report_enable = _a.report_enable, report_name = _a.report_name, summary_sql = _a.summary_sql;
- if (report) {
- report = json5.parse(report);
- }
- else {
- report = {};
- }
- _this.viewModel.set('report_enable', report_enable);
- _this.viewModel.set('report_name', report_name);
- _this.viewModel.set('querySql', query_sql || '');
- _this.viewModel.set('summarySql', summary_sql || '');
- system.mergeViewModel(_this.viewModel, 'report', report, false);
- var query = _this.viewModel.get('report.query') || [];
- var columns = _this.viewModel.get('report.columns') || [];
- var summary = _this.viewModel.get('report.summary') || [];
- var querySql = _this.viewModel.get('querySql');
- var summarySql = _this.viewModel.get('summarySql');
- _this.refs.gridCondition.setData(query);
- _this.refs.gridColumn.setData(columns);
- _this.refs.gridSum.setData(summary);
- _this.refs.sqlEditor.setCode(querySql);
- _this.refs.sqlSumEditor.setCode(summarySql);
- }).finally(function () {
- _this.setLoading(false);
- });
- };
- ReportDesign.prototype.addCondition = function () {
- this.refs.gridCondition.appendEditRow({
- conditionFieldBind: '',
- conditionFieldLabel: '',
- conditionFieldXtype: 'textfield',
- conditionFieldFlex: 1,
- conditionFieldDict: '',
- conditionFieldWrap: false,
- conditionFieldExtend: '{}',
- }, 'conditionFieldBind');
- };
- ReportDesign.prototype.removeCondition = function () {
- var _this = this;
- var rows = [];
- this.refs.gridCondition.getSelectionModel().getSelected().eachRow(function (r) {
- rows.push(r);
- });
- _.forEach(rows, function (r) {
- _this.refs.gridCondition.getStore().remove(r);
- });
- };
- ReportDesign.prototype.moveUp = function (sender) {
- var grid = sender.up('grid');
- grid.rowMoveUp();
- };
- ReportDesign.prototype.moveDown = function (sender) {
- var grid = sender.up('grid');
- grid.rowMoveDown();
- };
- ReportDesign.prototype.calcCondition = function () {
- var _this = this;
- var sql = this.refs.sqlEditor.getCode();
- var re = sql.matchAll(/#{(.+?)}/gi);
- var rows = this.refs.gridCondition.getDataRows();
- this.refs.gridCondition.setLoading(true);
- Promise.all([
- parseDynamicSqlApi(sql),
- instance$1.reloadIfNeedPromise(),
- ]).then(function (_a) {
- var e_1, _b;
- var _c = __read(_a, 1), res1 = _c[0];
- if (res1.success) {
- var tables_1 = [];
- _.forEach(res1.data, function (parseItem) {
- var tableName = parseItem.tableName, columnName = parseItem.columnName;
- if (tableName && !_.includes(tables_1, tableName)) {
- tables_1.push(tableName);
- }
- });
- var _loop_1 = function (m) {
- var e_2, _a;
- var columnName = m[1];
- // 没有这个列才添加
- if (!_.find(rows, function (r) { return r.conditionFieldBind === columnName; })) {
- var meta = undefined;
- try {
- for (var tables_2 = (e_2 = void 0, __values(tables_1)), tables_2_1 = tables_2.next(); !tables_2_1.done; tables_2_1 = tables_2.next()) {
- var tableName = tables_2_1.value;
- meta = instance$1.getColumnByTableNameColumnName(tableName, columnName);
- if (meta) {
- break;
- }
- }
- }
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
- finally {
- try {
- if (tables_2_1 && !tables_2_1.done && (_a = tables_2.return)) _a.call(tables_2);
- }
- finally { if (e_2) throw e_2.error; }
- }
- if (meta) {
- // 找到元数据
- var r = {
- conditionFieldBind: meta.column_name,
- conditionFieldLabel: meta.column_comment,
- conditionFieldXtype: 'textfield',
- conditionFieldFlex: 1,
- conditionFieldDict: '',
- conditionFieldWrap: false,
- conditionFieldExtend: '{}',
- };
- if (meta.column_ui === 'combo' && meta.column_dict) {
- r.conditionFieldXtype = 'combo';
- r.conditionFieldDict = meta.column_dict;
- }
- else if (meta.column_ui === "checkbox") {
- r.conditionFieldXtype = 'checkbox';
- }
- else if (meta.data_type === 'number' && !meta.column_dict && meta.column_size <= 10) {
- r.conditionFieldXtype = 'numberfield';
- }
- _this.refs.gridCondition.appendEditRow(r);
- }
- else {
- // 没找到元数据,直接添加
- _this.refs.gridCondition.appendEditRow({
- conditionFieldBind: columnName,
- conditionFieldLabel: '',
- conditionFieldXtype: 'textfield',
- conditionFieldFlex: 1,
- conditionFieldDict: '',
- conditionFieldWrap: false,
- conditionFieldExtend: '{}',
- });
- }
- }
- };
- try {
- for (var re_1 = __values(re), re_1_1 = re_1.next(); !re_1_1.done; re_1_1 = re_1.next()) {
- var m = re_1_1.value;
- _loop_1(m);
- }
- }
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
- finally {
- try {
- if (re_1_1 && !re_1_1.done && (_b = re_1.return)) _b.call(re_1);
- }
- finally { if (e_1) throw e_1.error; }
- }
- }
- }).finally(function () {
- _this.refs.gridCondition.setLoading(false);
- });
- };
- ReportDesign.prototype.addColumn = function () {
- this.refs.gridColumn.appendEditRow({
- dataIndex: '',
- header: '',
- xtype: '',
- dataType: '',
- width: '',
- dict: '',
- align: '',
- filterable: true,
- hidden: false,
- sortable: true,
- fieldExtend: '{}',
- }, 'header');
- };
- ReportDesign.prototype.removeColumn = function () {
- var _this = this;
- var rows = [];
- this.refs.gridColumn.getSelectionModel().getSelected().eachRow(function (r) {
- rows.push(r);
- });
- _.forEach(rows, function (r) {
- _this.refs.gridColumn.getStore().remove(r);
- });
- };
- ReportDesign.prototype.calcColumn = function () {
- var _this = this;
- var sql = this.refs.sqlEditor.getCode();
- this.refs.gridColumn.setLoading(true);
- var rows = this.refs.gridColumn.getDataRows();
- Promise.all([
- parseDynamicSqlApi(sql),
- instance$1.reloadIfNeedPromise(),
- ]).then(function (_a) {
- var _b = __read(_a, 1), res1 = _b[0];
- if (res1.success) {
- _.forEach(res1.data, function (parseItem) {
- var tableName = parseItem.tableName, columnName = parseItem.columnName, columnTypeName = parseItem.columnTypeName;
- // 是否找到重复字段
- var exists = _.find(rows, function (r) { return r.dataIndex === columnName; });
- if (exists) {
- if ((columnTypeName || "").toLowerCase() === "number") {
- var record = _this.refs.gridColumn.store.getAt(_.findIndex(rows, function (r) { return r.dataIndex === columnName; }));
- if (record) {
- record.set("dataType", "number");
- record.set("align", "end");
- }
- }
- return;
- }
- if (tableName) {
- // 解出表格名和字段名
- var meta = instance$1.getColumnByTableNameColumnName(tableName, columnName);
- if (meta) {
- // 找到了元数据
- var r = {
- dataIndex: meta.column_name,
- header: meta.column_comment,
- xtype: '',
- dataType: '',
- width: '',
- dict: '',
- align: '',
- filterable: true,
- hidden: false,
- sortable: true,
- fieldExtend: '{}',
- };
- if (meta.column_ui === 'combo' && meta.column_dict) {
- r.dict = meta.column_dict;
- }
- else if (meta.column_ui === "checkbox") {
- r.xtype = 'checkbox';
- }
- else if (meta.data_type === 'number' && !meta.column_dict && meta.column_size <= 10) {
- r.dataType = meta.data_type;
- r.align = 'end';
- }
- if ((columnTypeName || "").toLowerCase() === "number") {
- r.dataType = "number";
- r.align = 'end';
- }
- _this.refs.gridColumn.appendEditRow(r);
- return;
- }
- }
- if (columnName) {
- // 解出字段名
- var r = {
- dataIndex: columnName,
- header: columnName,
- xtype: '',
- dataType: '',
- width: '',
- dict: '',
- align: '',
- filterable: true,
- hidden: false,
- sortable: true,
- fieldExtend: '{}',
- };
- if ((columnTypeName || "").toLowerCase() === "number") {
- r.dataType = "number";
- r.align = 'end';
- }
- _this.refs.gridColumn.appendEditRow(r);
- }
- });
- }
- }).finally(function () {
- _this.refs.gridColumn.setLoading(false);
- });
- };
- ReportDesign.prototype.addSum = function () {
- this.refs.gridSum.appendEditRow({
- sumFieldBind: '',
- sumFieldLabel: '',
- sumFieldFlex: 1,
- sumFieldWrap: false,
- sumFieldExtend: '{}',
- }, 'sumFieldBind');
- };
- ReportDesign.prototype.removeSum = function () {
- var _this = this;
- var rows = [];
- this.refs.gridSum.getSelectionModel().getSelected().eachRow(function (r) {
- rows.push(r);
- });
- _.forEach(rows, function (r) {
- _this.refs.gridSum.getStore().remove(r);
- });
- };
- ReportDesign.prototype.calcSum = function () {
- var _this = this;
- var sql = this.refs.sqlSumEditor.getCode();
- var rows = this.refs.gridSum.getDataRows();
- this.refs.gridSum.setLoading(true);
- parseDynamicSqlApi(sql).then(function (res1) {
- if (res1.success) {
- _.forEach(res1.data, function (parseItem) {
- var tableName = parseItem.tableName, columnName = parseItem.columnName;
- // 是否找到重复字段
- if (_.find(rows, function (r) { return r.sumFieldBind === columnName; })) {
- return;
- }
- if (columnName) {
- // 解出字段名
- _this.refs.gridSum.appendEditRow({
- sumFieldBind: columnName,
- sumFieldLabel: columnName,
- sumFieldFlex: 1,
- sumFieldWrap: false,
- sumFieldExtend: '{}',
- });
- }
- });
- }
- }).finally(function () {
- _this.refs.gridSum.setLoading(false);
- });
- };
- Object.defineProperty(ReportDesign.prototype, "reportId", {
- get: function () {
- return this.viewModel.get('report_id');
- },
- enumerable: true,
- configurable: true
- });
- return ReportDesign;
- }(Scope));
- //# sourceMappingURL=ReportDesign.js.map
- var model$5 = {
- data: {
- originalTableInfo: {
- table_name: '',
- description: '',
- },
- hasChanged: false,
- schema_name: undefined,
- table_name: undefined,
- column_name: undefined,
- tableInfo: {
- schema_name: '',
- table_name: '',
- description: '',
- biz_category: '',
- note: '',
- archive_enable: false,
- archive_cron: '',
- archive_condition: '',
- column_list: []
- },
- },
- formulas: {
- shouldSave: function (get) {
- // console.log("-->", get('grid1.ischanged'))
- return get('grid1.ischanged')
- || _.trim(get('originalTableInfo.table_name')) !== _.trim(get('tableInfo.table_name'))
- || _.trim(get('originalTableInfo.description')) !== _.trim(get('tableInfo.description'));
- },
- },
- };
- //# sourceMappingURL=DbColumn.model.js.map
- var vjson$5 = {
- bind: {
- title: '{tableName}{shouldSave?" *":""}',
- },
- layout: 'fit',
- items: [
- {
- layout: 'border',
- tbar: {
- xtype: 'toolbar',
- items: [
- // {
- // xtype: 'button',
- // text: '拉取库结构',
- // iconCls: 'x-fa fa-cloud-download',
- // listeners: {
- // click: 'scope.pullFromDb'
- // }
- // },
- {
- xtype: 'button',
- text: '保存至数据库',
- iconCls: 'x-fa fa-save',
- bind: {
- disabled: '{!shouldSave}'
- },
- listeners: {
- click: 'scope.pushToDb'
- }
- },
- '-',
- {
- xtype: 'button',
- text: '刷新 QueryDSL',
- iconCls: 'x-fa fa-refresh',
- listeners: {
- click: 'scope.syncQueryDSL'
- }
- },
- {
- xtype: 'button',
- text: '生成 DDL',
- iconCls: 'x-fa fa-file-text',
- listeners: {
- click: 'scope.buildDDL'
- }
- }
- ]
- },
- items: [
- {
- region: 'center',
- xtype: 'tabpanel',
- items: [
- {
- title: '字段',
- xtype: 'yvgrid',
- selModel: {
- type: 'spreadsheet',
- columnSelect: true,
- pruneRemoved: false,
- extensible: 'y'
- },
- enableLocking: false,
- idField: 'column_name',
- plugins: {
- clipboard: true,
- selectionreplicator: true
- },
- reference: 'grid1',
- pagination: false,
- // hideFootbar: true,
- tbar: {
- xtype: 'form',
- items: [
- {
- xtype: 'cols',
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '表格名',
- reference: 'text_table_name',
- readOnly: true,
- bind: {
- value: '{tableInfo.table_name}'
- }
- },
- {
- xtype: 'textfield',
- fieldLabel: '描述',
- // readOnly: true,
- bind: {
- value: '{tableInfo.description}'
- }
- },
- ]
- },
- {
- xtype: 'toolbar',
- items: [
- {
- xtype: 'button',
- text: '添加',
- iconCls: 'x-fa fa-plus-circle',
- listeners: {
- click: 'scope.addField'
- }
- },
- {
- xtype: 'button',
- text: '删除',
- iconCls: 'x-fa fa-minus-circle',
- listeners: {
- click: 'scope.removeField'
- }
- },
- ]
- },
- ]
- },
- listeners: {
- editbefore: 'scope.gridEditBefore'
- },
- columns: [
- {
- text: '字段名', dataIndex: 'column_name',
- sortable: false,
- menuDisabled: true,
- width: 120,
- editor: {
- allowBlank: true,
- selectOnFocus: false
- }
- },
- {
- text: '字段中文', dataIndex: 'column_comment',
- width: 130,
- sortable: false,
- menuDisabled: true,
- editor: {
- allowBlank: true,
- selectOnFocus: false
- }
- },
- {
- text: '主键', dataIndex: 'is_primary_key',
- xtype: 'checkcolumn', sortable: false, menuDisabled: true,
- width: 48, resizable: false,
- },
- {
- text: '必填', dataIndex: 'not_null',
- xtype: 'checkcolumn', sortable: false, menuDisabled: true,
- width: 48, resizable: false,
- },
- {
- text: '字段域', dataIndex: 'column_domain',
- sortable: false, menuDisabled: true,
- width: 148,
- dict: 'column_domain',
- editor: {
- xtype: 'combo',
- allowBlank: true,
- selectOnFocus: true,
- // fix: ['system.getDict("column_domain")'],
- dict: 'column_domain',
- listConfig: {
- minWidth: 200
- },
- listeners: {
- change: 'scope.columnDomainChange',
- }
- }
- },
- {
- text: '数据类型', dataIndex: 'data_type',
- sortable: false, menuDisabled: true,
- editor: { allowBlank: true, selectOnFocus: true }
- },
- {
- text: '长度', dataIndex: 'column_size',
- sortable: false, menuDisabled: true,
- xtype: 'numbercolumn', format: '0',
- editor: { allowBlank: true, selectOnFocus: true }
- },
- {
- text: '小数位', dataIndex: 'decimal_digits',
- sortable: false, menuDisabled: true,
- xtype: 'numbercolumn', format: '0',
- editor: { allowBlank: true, selectOnFocus: true }
- },
- {
- text: '默认值', dataIndex: 'default_value',
- sortable: false, menuDisabled: true,
- editor: { allowBlank: true, selectOnFocus: true }
- },
- {
- text: '字典', dataIndex: 'column_dict',
- sortable: false, menuDisabled: true,
- // fix: ['system.getDict("DICT")'],
- width: 200,
- editor: {
- xtype: 'combo',
- allowBlank: true,
- listConfig: {
- minWidth: 350
- },
- }
- },
- {
- text: 'UI建议', dataIndex: 'column_ui',
- sortable: false, menuDisabled: true,
- // fix: ['system.getDict("column_ui")'],
- editor: {
- xtype: 'combo',
- allowBlank: true,
- listConfig: {
- minWidth: 200
- },
- }
- },
- {
- text: '详细描述', dataIndex: 'column_note',
- sortable: false, menuDisabled: true,
- editor: { allowBlank: true, }
- },
- ]
- },
- {
- title: '高级属性',
- xtype: 'form',
- items: [
- // {
- // xtype: 'textfield',
- // fieldLabel: '表格名',
- // bind: {
- // value: '{tableName}'
- // }
- // },
- // {
- // xtype: 'textfield',
- // fieldLabel: '中文含义',
- // bind: {
- // value: '{tableInfo.description}'
- // }
- // },
- {
- xtype: 'combo',
- fieldLabel: '业务类型',
- bind: {
- value: '{tableInfo.biz_category}'
- },
- store: [
- '基础资料',
- '系统',
- '账目与库存',
- '单据',
- '指令',
- '规则与流程',
- '开发辅助',
- ]
- },
- {
- xtype: 'textfield',
- fieldLabel: '详细描述',
- bind: {
- value: '{tableInfo.note}'
- },
- },
- {
- xtype: 'checkbox',
- fieldLabel: '允许归档',
- bind: "{tableInfo.archive_enable}",
- },
- {
- xtype: 'textfield',
- fieldLabel: '归档周期',
- bind: {
- value: '{tableInfo.archive_cron}',
- hidden: '{!tableInfo.archive_enable}',
- }
- },
- {
- xtype: 'textfield',
- fieldLabel: '归档条件',
- bind: {
- value: '{tableInfo.archive_condition}',
- hidden: '{!tableInfo.archive_enable}',
- }
- },
- ]
- },
- ]
- }
- ]
- },
- ]
- };
- //# sourceMappingURL=DbColumn.view.js.map
- var DbColumn = /** @class */ (function (_super) {
- __extends(DbColumn, _super);
- function DbColumn(schemaName, tableName, columnName, isCreateTable, isCreate) {
- var _this = _super.call(this, {
- model: getModel(model$5, schemaName, tableName, columnName, isCreateTable),
- vjson: vjson$5
- }) || this;
- _this.isCreate = false;
- _this.isCreate = isCreate !== null && isCreate !== void 0 ? isCreate : false;
- return _this;
- }
- DbColumn.prototype.onLoad = function () {
- var _this = this;
- var _a, _b, _c, _d, _e, _f, _g, _h;
- console.log('me', this);
- this.refs.grid1.setData(this.viewModel.data.tableInfo.column_list);
- this.refs.grid1.autoSizeColumns();
- // this.refs.grid1.columns[0].hide()
- // 自动定位到选定的列
- if (this.viewModel.get('column_name')) {
- for (var i = 0; i < this.refs.grid1.store.data.items.length; i++) {
- if (this.refs.grid1.store.data.items[i].get('column_name') === this.viewModel.get('column_name')) {
- this.refs.grid1.setSelection(this.refs.grid1.store.data.items[i]);
- return;
- }
- }
- }
- instance.getColumnDomainComboData().then(function () {
- _this.checkDomain();
- });
- this.viewModel.set('originalTableInfo.table_name', (_c = (_b = (_a = this.viewModel.data) === null || _a === void 0 ? void 0 : _a.tableInfo) === null || _b === void 0 ? void 0 : _b.table_name) !== null && _c !== void 0 ? _c : "");
- this.viewModel.set('originalTableInfo.description', (_f = (_e = (_d = this.viewModel.data) === null || _d === void 0 ? void 0 : _d.tableInfo) === null || _e === void 0 ? void 0 : _e.description) !== null && _f !== void 0 ? _f : "");
- if (this.isCreate)
- (_h = (_g = this.refs) === null || _g === void 0 ? void 0 : _g.text_table_name) === null || _h === void 0 ? void 0 : _h.setReadOnly(false);
- };
- DbColumn.prototype.checkDomain = function () {
- // 走查一遍 domain
- // 获取到数据类型 mysql_datatype / oracle_datatype / pgsql_datatype / sqlserver_datatype
- var dbType = this.viewModel.get('tableInfo.db_type');
- var diffColumnName = [];
- var tableInfo = this.viewModel.get('tableInfo');
- this.refs.grid1.store.data.items.forEach(function (record) {
- var data = record.data;
- var column_domain = data.column_domain;
- var domain = instance.getColumnDomainById(column_domain);
- if (!domain) {
- // 没有找到 domain
- return;
- }
- var editRow = applyDomain(dbType, domain);
- // 字段跟领域做对比
- var compareResult = compareDomainApply(tableInfo, data, editRow, domain.is_fix_size);
- if (typeof compareResult === 'string') {
- // 不一样的情况下,要改成一致
- _$2.forOwn(editRow, function (value, key) {
- // 改成与 domain 一致
- record.set(key, value);
- });
- diffColumnName.push(data.column_name + '.' + compareResult);
- }
- });
- if (diffColumnName.length > 0) {
- showErrorDialog$1("\u6709" + diffColumnName.length + " \u4E2A\u5B57\u6BB5\u7684\u5B57\u6BB5\u57DF\u4E0D\u4E00\u81F4:<br /> " + diffColumnName.join('<br />'));
- }
- };
- DbColumn.prototype.addField = function () {
- this.refs.grid1.appendEditRow({
- column_name: '',
- column_comment: '',
- is_primary_key: false,
- not_null: true,
- column_domain: '',
- data_type: '',
- column_size: 0,
- decimal_digits: 0,
- default_value: '',
- column_dict: '',
- column_ui: '',
- column_note: '',
- }, 'column_name');
- };
- DbColumn.prototype.removeField = function () {
- var _this = this;
- var rows = [];
- this.refs.grid1.getSelectionModel().getSelected().eachRow(function (r) {
- rows.push(r);
- });
- _$2.forEach(rows, function (r) {
- _this.refs.grid1.getStore().remove(r);
- });
- };
- DbColumn.prototype.gridEditBefore = function (sender, editor, context, eOpts) {
- instance.getColumnDomainComboData().then(function (data) {
- editor.cmp.columns[5].getEditor().setStore({ data: data });
- });
- // 被字段域锁定的内容,不允许修改
- var record = context.record, field = context.field;
- var domainId = record.get('column_domain');
- if (!domainId) {
- return;
- }
- var domain = instance.getColumnDomainById(domainId);
- if (!domain) {
- msg$1('没有找到字段域' + domainId);
- return;
- }
- if (field === "data_type") {
- // 字段类型不允许修改
- context.cancel = true;
- return;
- }
- if (domain.is_fix_size &&
- (field === "column_size" ||
- field === "decimal_digits")) {
- // 锁定长度的情况下,大小不允许修改
- context.cancel = true;
- return;
- }
- if (domain.is_fix_default_value && field === "default_value") {
- // 锁定默认值的情况下,默认值不允许修改
- context.cancel = true;
- return;
- }
- };
- DbColumn.prototype.columnDomainChange = function (editor, newValue, oldValue, event) {
- if (!newValue) {
- return;
- }
- var grid = editor.up('grid').ownerGrid;
- var domain = instance.getColumnDomainById(newValue);
- if (!domain) {
- msg$1('没有找到 domain:' + newValue);
- return;
- }
- // 获取到数据类型 mysql_datatype / oracle_datatype / pgsql_datatype / sqlserver_datatype
- var dbType = this.viewModel.get('tableInfo.db_type');
- var editRow = applyDomain(dbType, domain);
- grid.setEditRow(editRow);
- };
- DbColumn.prototype.pullFromDb = function () {
- };
- DbColumn.prototype.pushToDb = function (sender) {
- var _this = this;
- // 设置当前界面为 "保存中..." 状态
- var me = this;
- var _a = this.viewModel.data.tableInfo, table_name = _a.table_name, schema_name = _a.schema_name;
- this.viewModel.set('tableInfo.table_name', table_name);
- this.viewModel.set('tableInfo.schema_name', schema_name);
- var tableInfo = this.viewModel.get('tableInfo');
- var column_list = this.refs.grid1.getDataRows();
- var hasError = false;
- if (column_list.length <= 0) {
- msg$1("\u81F3\u5C11\u8981\u6709\u4E00\u4E2A\u5B57\u6BB5\uFF01");
- hasError = true;
- }
- var columnNameExistsCheck = {};
- _$2.forEach(column_list, function (row, i) {
- var checkResult = checkColumn(tableInfo, row);
- if (typeof checkResult !== 'undefined') {
- msg$1(checkResult);
- hasError = true;
- _this.refs.grid1.beginEdit(i, 'column_name');
- return false;
- }
- if (!row.column_domain || row.column_domain === '0') {
- msg$1("\u5B57\u6BB5\u57DF\u4E0D\u80FD\u4E3A\u7A7A\uFF01");
- hasError = true;
- _this.refs.grid1.beginEdit(i, 'column_domain');
- return false;
- }
- if (isEmpty(row.data_type)) {
- msg$1("\u5B57\u6BB5\u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A");
- hasError = true;
- _this.refs.grid1.beginEdit(i, 'data_type');
- return false;
- }
- if (_$2.has(columnNameExistsCheck, row.column_name)) {
- // 列名已存在
- msg$1("\u5B57\u6BB5\u540D" + row.column_name + " \u5DF2\u5B58\u5728!");
- hasError = true;
- _this.refs.grid1.beginEdit(i, 'column_name');
- return false;
- }
- columnNameExistsCheck[row.column_name] = true;
- });
- if (hasError)
- return;
- // 保存 Ex 数据,并生成 DDL 让用户决策是否执行 DDL
- me.setLoading(true);
- instance$1.saveMetaExBuildDDLPromise(schema_name, table_name, tableInfo, column_list)
- .then(function (res) {
- var _a;
- if (typeof ((_a = res.data) === null || _a === void 0 ? void 0 : _a.ddl) === 'string') {
- // 返回 DDL 就要显示出来
- var window_1 = Ext.create('Ext.window.Window', {
- title: 'SQL 预览',
- height: 400,
- width: 600,
- modal: true,
- animateTarget: sender,
- maximizable: true,
- layout: 'fit',
- items: {
- xtype: 'sqleditor',
- value: res.data.ddl
- },
- buttons: [
- {
- xtype: 'button',
- text: '执行',
- iconCls: 'x-fa fa-save',
- handler: function (sender) {
- var editor = sender.up('window').down('sqleditor');
- var ddl = editor.getValue();
- me.pushToDbCommit(schema_name, table_name, ddl, window_1);
- }
- },
- {
- xtype: 'button',
- text: '取消',
- iconCls: 'x-fa fa-times',
- handler: function () {
- window_1.close();
- }
- }
- ]
- }).show();
- return;
- }
- var tableInfo = _$2.cloneDeep(res.data[0].table_list[0]);
- var tableRow = instance$1.getTableByName(schema_name, table_name);
- if (!tableRow) {
- // throw Error('没有找到 table', schemaName, tableName, columnName)
- console.log('这是一个新 table');
- instance$1.appendNewTable(tableInfo);
- }
- _this.viewModel.set('schema_name', schema_name);
- _this.viewModel.set('table_name', table_name);
- _this.viewModel.set('tableInfo', tableInfo);
- _this.refs.grid1.setData(tableInfo.column_list);
- if (tableRow)
- Object.assign(tableRow, tableInfo);
- msg$1('保存成功');
- _this.viewModel.set('hasChanged', false);
- })
- .finally(function () {
- me.setLoading(false);
- });
- };
- DbColumn.prototype.pushToDbCommit = function (schema_name, table_name, ddl, window) {
- var _this = this;
- window.setLoading(true);
- instance$1.pushToDbCommit({ schema_name: schema_name, table_name: table_name, ddl: ddl })
- .then(function (res) {
- var _a, _b, _c, _d;
- var tableInfo = _$2.cloneDeep(res.data[0].table_list[0]);
- // 保存成功就提示一下,并重新载入数据
- msg$1(res.msg);
- instance$1.reloadForce(undefined);
- var tableRow = instance$1.getTableByName(schema_name, table_name);
- if (!tableRow) {
- // throw Error('没有找到 table', schemaName, tableName, columnName)
- console.log('这是一个新 table');
- instance$1.appendNewTable(tableInfo);
- }
- _this.viewModel.set('schema_name', schema_name);
- _this.viewModel.set('table_name', table_name);
- _this.viewModel.set('tableInfo', tableInfo);
- _this.refs.grid1.setData(tableInfo.column_list);
- if (tableRow)
- Object.assign(tableRow, tableInfo);
- instance$1.notifyRefresh();
- window.close();
- _this.viewModel.set('hasChanged', false);
- _this.viewModel.set('originalTableInfo.table_name', (_a = tableInfo === null || tableInfo === void 0 ? void 0 : tableInfo.table_name) !== null && _a !== void 0 ? _a : "");
- _this.viewModel.set('originalTableInfo.description', (_b = tableInfo === null || tableInfo === void 0 ? void 0 : tableInfo.description) !== null && _b !== void 0 ? _b : "");
- (_d = (_c = _this.refs) === null || _c === void 0 ? void 0 : _c.text_table_name) === null || _d === void 0 ? void 0 : _d.setReadOnly(true);
- })
- .finally(function () {
- // 无论正常异常,关闭 "保存中..." 状态
- window.setLoading(false);
- });
- };
- DbColumn.prototype.syncQueryDSL = function () {
- var _this = this;
- var tableInfo = this.viewModel.get("tableInfo");
- this.setLoading(true);
- syncQueryDSL({ schema_name: tableInfo.schema_name, table_name: tableInfo.table_name })
- .then(function () {
- msg$1("\u5237\u65B0 QueryDSL\u6210\u529F!");
- })
- .finally(function () {
- _this.setLoading(false);
- });
- };
- DbColumn.prototype.buildDDL = function () {
- };
- return DbColumn;
- }(Scope));
- function getModel(model, schemaName, tableName, columnName, isCreateTable) {
- model.data.schema_name = schemaName;
- model.data.table_name = tableName;
- model.data.column_name = columnName;
- if (isCreateTable) {
- var dbType = instance$1.getSchemaDbType(schemaName);
- if (!dbType) {
- throw Error('无法识别数据库类型' + schemaName);
- }
- model.data.tableInfo.schema_name = model.data.schema_name;
- model.data.tableInfo.table_name = model.data.table_name;
- model.data.tableInfo.db_type = dbType;
- model.data.tableInfo.column_list = [];
- model.data.tableInfo.is_create = true;
- return model;
- }
- var tableRow = instance$1.getTableByName(schemaName, tableName);
- if (!tableRow) {
- throw Error('没有找到 table' + schemaName + tableName + columnName);
- }
- model.data.tableInfo = _$2.cloneDeep(tableRow);
- model.data.tableInfo.is_create = false;
- // model.data.tableInfo.attributes = JSON.parse(tableRow.attributes)
- return model;
- }
- //# sourceMappingURL=DbColumn.js.map
- var model$6 = {
- data: {
- id: '',
- path: '',
- form: {
- title: '',
- sqlId: '',
- }
- }
- };
- //# sourceMappingURL=WidgetDesign.model.js.map
- var vjson$6 = {
- bind: {
- title: '{title}',
- },
- layout: 'fit',
- items: [
- {
- layout: 'border',
- items: [
- {
- region: 'center',
- layout: 'border',
- items: [
- {
- region: 'north',
- items: [
- {
- xtype: 'toolbar',
- border: false,
- items: [
- {
- xtype: 'button',
- text: '刷新',
- iconCls: 'x-fa fa-refresh',
- listeners: {
- click: 'scope.load'
- }
- },
- {
- xtype: 'button',
- text: '保存',
- iconCls: 'x-fa fa-save',
- listeners: {
- click: 'scope.widgetSave'
- }
- },
- {
- xtype: 'button',
- text: '预览',
- iconCls: 'x-fa fa-play-circle-o',
- listeners: {
- //click: 'scope.preview'
- }
- },
- {
- xtype: 'textfield',
- fieldLabel: '弹窗文件',
- reference: "wPath",
- labelWidth: 80,
- //width: 200,
- bind: {
- value: '{widgetPath}',
- },
- readOnly: true,
- },
- {
- xtype: 'textfield',
- fieldLabel: '弹窗名称',
- reference: "wTitle",
- labelWidth: 80,
- //width: 200,
- bind: {
- value: '{form.title}',
- },
- readOnly: true,
- },
- {
- xtype: 'textfield',
- fieldLabel: 'sqlId',
- bind: {
- value: '{form.sqlId}',
- },
- readOnly: true,
- },
- ]
- },
- ]
- },
- {
- xtype: 'tabpanel', region: 'center', plain: true, border: false,
- items: [
- {
- title: "SQL和条件",
- layout: 'border',
- border: false,
- items: [
- {
- region: 'north',
- height: 200,
- xtype: 'yvgrid',
- reference: "grid2",
- split: true,
- selModel: {
- selType: 'rowmodel',
- mode: 'SINGLE',
- },
- store: {},
- pagination: false,
- hideFootbar: true,
- tbar: {
- xtype: 'toolbar',
- items: [
- {
- xtype: 'button',
- text: '添加',
- iconCls: 'x-fa fa-plus-circle',
- listeners: {}
- },
- {
- xtype: 'button',
- text: '删除',
- iconCls: 'x-fa fa-minus-circle',
- listeners: {
- click: 'scope.delCondition'
- }
- },
- '-',
- {
- xtype: 'button',
- text: '上移',
- iconCls: 'x-fa fa-refresh',
- listeners: {
- //click: 'scope.saveAll'
- }
- },
- {
- xtype: 'button',
- text: '下移',
- iconCls: 'x-fa fa-refresh',
- listeners: {
- //click: 'scope.saveAll'
- }
- },
- '-',
- {
- xtype: 'button',
- text: '自动分析',
- iconCls: 'x-fa fa-refresh',
- listeners: {
- click: 'scope.calcCondition'
- }
- },
- ]
- },
- columns: [
- {
- text: '条件变量',
- dataIndex: 'conditionFieldBind',
- width: 140,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: true
- },
- },
- {
- text: '中文标题',
- dataIndex: 'conditionFieldLabel',
- width: 120,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: true
- },
- },
- {
- text: '编辑类型',
- dataIndex: 'xtype',
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'combo',
- typeAhead: true,
- triggerAction: 'all',
- selectOnFocus: true,
- store: [
- ['textfield', 'textfield'],
- ['combo', 'combo'],
- ['datefield', 'datefield'],
- ['datetimefield', 'datetimefield'],
- ['numberfield', 'numberfield'],
- ['multiplesearch', 'multiplesearch'],
- ]
- }
- },
- {
- text: '权重',
- dataIndex: 'conditionFieldFlex',
- align: 'right',
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'numberfield',
- selectOnFocus: false,
- minValue: 0,
- maxValue: 10
- },
- },
- {
- text: '字典',
- dataIndex: 'conditionFieldDict',
- width: 160,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: false
- },
- },
- {
- xtype: 'checkcolumn',
- dataIndex: "conditionFieldWrap", header: "换行",
- width: 65,
- sortable: false,
- menuDisabled: true,
- },
- ]
- },
- {
- region: 'center',
- xtype: 'sqleditor',
- layout: 'fit',
- reference: 'sqlEditor',
- split: true,
- bind: {
- value: "{form.sql}"
- },
- },
- ]
- },
- {
- title: "结果字段定义",
- border: false,
- xtype: 'yvgrid',
- reference: "grid3",
- selModel: {
- selType: 'rowmodel',
- mode: 'SINGLE',
- },
- store: {},
- pagination: false,
- hideFootbar: true,
- tbar: {
- xtype: 'toolbar',
- items: [
- {
- xtype: 'button',
- text: '添加',
- iconCls: 'x-fa fa-plus-circle',
- listeners: {}
- },
- {
- xtype: 'button',
- text: '删除',
- iconCls: 'x-fa fa-minus-circle',
- listeners: {
- click: 'scope.delColumn'
- }
- },
- '-',
- {
- xtype: 'button',
- text: '上移',
- iconCls: 'x-fa fa-refresh',
- listeners: {
- //click: 'scope.saveAll'
- }
- },
- {
- xtype: 'button',
- text: '下移',
- iconCls: 'x-fa fa-refresh',
- listeners: {
- //click: 'scope.saveAll'
- }
- },
- '-',
- {
- xtype: 'button',
- text: '自动分析',
- iconCls: 'x-fa fa-refresh',
- listeners: {
- click: 'scope.calcColumn'
- }
- },
- ]
- },
- columns: [
- { xtype: 'rownumberer' },
- {
- text: '字段',
- dataIndex: 'dataIndex',
- width: 140,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: true
- },
- },
- {
- text: '标题',
- dataIndex: 'header',
- width: 120,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: true
- },
- },
- {
- text: '显示类型',
- dataIndex: 'xtype',
- width: 90,
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'combo',
- typeAhead: true,
- triggerAction: 'all',
- selectOnFocus: true,
- store: [
- ['', ''],
- ['rownum', 'rownum'],
- ['button', 'button'],
- ['checkbox', 'checkbox'],
- ['progres', 'progres'],
- ]
- }
- },
- {
- text: '数据类型',
- dataIndex: 'dataType',
- width: 90,
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'combo',
- typeAhead: true,
- triggerAction: 'all',
- selectOnFocus: true,
- store: [
- ['', ''],
- ['string', 'string'],
- ['number', 'number'],
- ['date', 'date'],
- ]
- }
- },
- {
- text: '数据字典',
- dataIndex: 'dict',
- sortable: false,
- menuDisabled: true,
- width: 120,
- editor: {
- selectOnFocus: true,
- },
- },
- ],
- },
- ]
- },
- ]
- },
- ]
- }
- ]
- }; //
- //
- //# sourceMappingURL=WidgetDesign.view.js.map
- var WidgetDesign = /** @class */ (function (_super) {
- __extends(WidgetDesign, _super);
- function WidgetDesign(widgetPath, widgetName) {
- var _this = _super.call(this, { model: model$6, vjson: vjson$6 }) || this;
- _this.widgetPath = widgetPath;
- _this.widgetName = widgetName;
- return _this;
- }
- WidgetDesign.prototype.onLoad = function () {
- if (this.widgetPath) {
- this.loadForm(this.widgetPath);
- this.viewModel.set("widgetPath", this.widgetPath);
- this.refs.wTitle.setReadOnly(true);
- this.refs.wPath.setReadOnly(true);
- }
- else {
- this.refs.wTitle.setReadOnly(false);
- this.refs.wPath.setReadOnly(false);
- }
- };
- WidgetDesign.prototype.load = function () {
- var widgetPath = this.viewModel.get("widgetPath");
- if (widgetPath) {
- this.loadForm(widgetPath);
- }
- };
- WidgetDesign.prototype.loadForm = function (widgetPath) {
- var _this = this;
- var me = this;
- me.setLoading(true);
- readWidget({ widgetPath: widgetPath }).then(function (res) {
- msg$1(res.msg);
- if (res.success) {
- _this.viewModel.set("widgetPath", widgetPath);
- me.refs.grid3.getStore().removeAll();
- if (res.data.form.columns) {
- me.refs.grid3.getStore().add(res.data.form.columns.filter(function (r) { return r != null; }));
- }
- _this.viewModel.set("form.title", res.data.form.title);
- _this.viewModel.set("form.sqlId", res.data.form.dataSource.params.sqlId);
- // set sql
- _this.refs.sqlEditor.setCode(res.data.sql);
- }
- }).finally(function () {
- me.setLoading(false);
- });
- };
- WidgetDesign.prototype.widgetAdd = function (sender) {
- var _this = this;
- var title = this.viewModel.get("form.title");
- if (title) {
- Ext.Msg.confirm('提示', "是否保存【" + title + "】后再新增弹框?", function (btn) {
- if (btn == 'yes') {
- alert(1);
- }
- else {
- alert(2);
- }
- });
- }
- else {
- var me_1 = this;
- var win_1 = new Ext.Window({
- autoDestroy: true,
- title: "新建弹框",
- width: 400,
- height: 220,
- resizable: true,
- closable: true,
- maximizable: true,
- minimizable: true,
- plain: true,
- // constrainHeader: true,
- constrain: true,
- layout: 'fit',
- animateTarget: sender,
- buttonAlign: 'center',
- items: [
- {
- xtype: "form",
- layout: "hbox",
- margin: '10px 20px',
- border: 0,
- items: [
- {
- flex: 1,
- layout: 'vbox',
- items: [
- {
- xtype: "textfield",
- name: "widgetcode",
- fieldLabel: "弹框编号",
- flex: 1,
- allowBlank: false,
- regex: /^[a-zA-Z][a-zA-Z0-9]*$/,
- regexText: "编号名只能以英文字母开头,且只包含英文字母、数字",
- labelWidth: 50,
- width: "100%",
- },
- {
- xtype: "textfield",
- name: "widgetname",
- fieldLabel: "弹框名称",
- flex: 1,
- allowBlank: false,
- labelWidth: 50,
- width: "100%",
- },
- ]
- },
- ]
- }
- ],
- //窗口按钮
- buttons: [
- {
- xtype: 'button', text: '保存', handler: function (btn) {
- //窗口获取表单
- var form = win_1.down('form');
- var vaildSuccess = form.isValid();
- if (!vaildSuccess) {
- return;
- }
- var title = form.down('textfield[name="widgetname"]').getValue();
- var widgetPath = form.down('textfield[name="widgetcode"]').getValue();
- me_1.viewModel.set("form.title", title);
- me_1.viewModel.set("widgetPath", widgetPath);
- var formdata = _this.viewModel.get("form");
- saveWidget({ widgetPath: widgetPath, form: formdata }).then(function (res) {
- if (res.success) {
- msg$1('添加成功');
- }
- me_1.loadForm(widgetPath);
- win_1.close();
- });
- }
- },
- {
- xtype: 'button', text: '取消', handler: function (btn) {
- //窗口关闭
- win_1.close();
- }
- }
- ]
- });
- win_1.show();
- }
- };
- WidgetDesign.prototype.widgetSave = function () {
- var _this = this;
- var _a, _b;
- var widgetPath = this.viewModel.get("widgetPath");
- if (!widgetPath) {
- msg$1("请选择或添加弹框后再保存!");
- return;
- }
- var title = this.viewModel.get("form.title");
- if (!title) {
- msg$1("请选择或添加弹框后再保存!");
- return;
- }
- // 获取条件
- var conditions = (_a = this.refs.grid2.getStore().getData().items) === null || _a === void 0 ? void 0 : _a.map(function (r) { return r.data; }).map(function (r) {
- delete r.id;
- return r;
- });
- this.viewModel.set("form.conditions", conditions);
- // 获取查询列
- var columns = (_b = this.refs.grid3.getStore().getData().items) === null || _b === void 0 ? void 0 : _b.map(function (r) { return r.data; }).map(function (r) {
- delete r.id;
- if (r.dict) {
- r.fix = ["system.getDict('" + r.dict.toUpperCase() + "')"];
- }
- return r;
- });
- this.viewModel.set("form.columns", columns);
- // sql
- var sql = this.refs.sqlEditor.getCode();
- this.viewModel.set("form.sql", sql);
- var form = this.viewModel.get("form");
- saveWidget({ widgetPath: widgetPath, form: form }).then(function (res) {
- msg$1(res.msg);
- if (res.success) {
- msg$1('保存成功');
- _this.loadForm(widgetPath);
- }
- }).catch(function (res) {
- });
- };
- WidgetDesign.prototype.delCondition = function () {
- var _a;
- this.refs.grid2.getStore().remove((_a = this.refs.grid2.selModel.selected) === null || _a === void 0 ? void 0 : _a.items);
- };
- WidgetDesign.prototype.delColumn = function () {
- var _a;
- this.refs.grid3.getStore().remove((_a = this.refs.grid3.selModel.selected) === null || _a === void 0 ? void 0 : _a.items);
- };
- WidgetDesign.prototype.calcCondition = function () {
- var _this = this;
- var sql = this.refs.sqlEditor.getCode();
- var re = sql.matchAll(/#{(.+?)}/gi);
- var rows = this.refs.grid2.getDataRows();
- this.refs.grid2.setLoading(true);
- parseDynamicSqlApi(sql).then(function (res) {
- var e_1, _a;
- if (res.success) {
- var tables_1 = [];
- _.forEach(res.data, function (parseItem) {
- var tableName = parseItem.tableName, columnName = parseItem.columnName;
- if (tableName && !_.includes(tables_1, tableName)) {
- tables_1.push(tableName);
- }
- });
- var _loop_1 = function (m) {
- var e_2, _a;
- var columnName = m[1];
- // 没有这个列才添加
- if (!_.find(rows, function (r) { return r.conditionFieldBind === columnName; })) {
- var meta = undefined;
- try {
- for (var tables_2 = (e_2 = void 0, __values(tables_1)), tables_2_1 = tables_2.next(); !tables_2_1.done; tables_2_1 = tables_2.next()) {
- var tableName = tables_2_1.value;
- meta = instance$1.getColumnByTableNameColumnName(tableName, columnName);
- if (meta) {
- break;
- }
- }
- }
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
- finally {
- try {
- if (tables_2_1 && !tables_2_1.done && (_a = tables_2.return)) _a.call(tables_2);
- }
- finally { if (e_2) throw e_2.error; }
- }
- if (meta) {
- // 没找到元数据,直接添加
- _this.refs.grid2.appendEditRow({
- conditionFieldBind: columnName,
- conditionFieldLabel: meta.column_comment,
- conditionFieldXtype: 'textfield',
- conditionFieldFlex: 1,
- conditionFieldDict: '',
- conditionFieldWrap: false,
- });
- }
- else {
- _this.refs.grid2.appendEditRow({
- conditionFieldBind: columnName,
- conditionFieldLabel: '',
- conditionFieldXtype: 'textfield',
- conditionFieldFlex: 1,
- conditionFieldDict: '',
- conditionFieldWrap: false,
- });
- }
- }
- };
- try {
- for (var re_1 = __values(re), re_1_1 = re_1.next(); !re_1_1.done; re_1_1 = re_1.next()) {
- var m = re_1_1.value;
- _loop_1(m);
- }
- }
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
- finally {
- try {
- if (re_1_1 && !re_1_1.done && (_a = re_1.return)) _a.call(re_1);
- }
- finally { if (e_1) throw e_1.error; }
- }
- }
- }).finally(function () {
- _this.refs.grid2.setLoading(false);
- });
- };
- WidgetDesign.prototype.calcColumn = function () {
- var _this = this;
- var sql = this.refs.sqlEditor.getCode();
- var rows = this.refs.grid3.getDataRows();
- this.refs.grid3.setLoading(true);
- parseDynamicSqlApi(sql).then(function (res) {
- _.forEach(res.data, function (parseItem) {
- var tableName = parseItem.tableName, columnName = parseItem.columnName, columnTypeName = parseItem.columnTypeName;
- // 是否找到重复字段
- var exists = _.find(rows, function (r) { return r.dataIndex === columnName; });
- if (exists) {
- return;
- }
- if (tableName) {
- // 解出表格名和字段名
- var meta = instance$1.getColumnByTableNameColumnName(tableName, columnName);
- if (meta) {
- // 找到了元数据
- var r = {
- dataIndex: meta.column_name,
- header: meta.column_comment,
- xtype: '',
- dataType: 'string',
- dict: '',
- };
- if (meta.column_ui === 'combo' && meta.column_dict) {
- r.dict = meta.column_dict;
- }
- else if (meta.column_ui === "checkbox") {
- r.xtype = 'checkbox';
- }
- else if (meta.data_type === 'number' && !meta.column_dict && meta.column_size <= 10) {
- r.dataType = meta.data_type;
- }
- _this.refs.grid3.appendEditRow(r);
- return;
- }
- }
- if (columnName) {
- // 解出字段名
- var r = {
- dataIndex: columnName,
- header: columnName,
- xtype: '',
- dataType: 'string',
- dict: '',
- };
- _this.refs.grid3.appendEditRow(r);
- }
- });
- }).finally(function () {
- _this.refs.grid3.setLoading(false);
- });
- };
- return WidgetDesign;
- }(Scope));
- //# sourceMappingURL=WidgetDesign.js.map
- var model$7 = {
- data: {
- // spreadsheet: false,
- // multSelect: false,
- // showCheckColumn: false,
- // checkColumncheckOnly: false,
- // disableSelection: false,
- vjson: {
- reference: '',
- pagination: false,
- pageSize: false,
- pageSizeOption: false,
- hideFootbar: false,
- hideRefresh: false,
- hideExport: false,
- hideAutoSize: false,
- hideClearFilter: false,
- hideSaveGridUIConfig: false,
- hideClearGridUIConfig: false,
- selectMode: '',
- cellediting_clicksToEdit: 1,
- columnLines: false,
- rowLines: false,
- border: false,
- autoLoad: false,
- remoteSort: false,
- remoteFilter: false,
- enableLocking: false,
- enableColumnHide: false,
- enableColumnMove: false,
- gridfilters: false,
- enableColumnResize: false,
- sortOnClick: false,
- hidden: false,
- cls: '',
- dataSource: {
- url: '',
- params: {
- formData: '{form}',
- },
- },
- listeners: {
- beforeselect: '',
- selectionchange: '',
- itemclick: '',
- itemdblclick: '',
- cellClick: '',
- celldblclick: '',
- afterrender: '',
- destory: '',
- }
- },
- }
- };
- //# sourceMappingURL=YvgridDesign.model.js.map
- var vjson$7 = {
- title: '表格-高级',
- height: 450,
- width: 970,
- layout: 'fit',
- modal: true,
- items: [
- {
- xtype: 'tabpanel',
- items: [
- {
- title: '属性',
- xtype: 'form',
- scrollable: true,
- items: [
- {
- xtype: 'cols',
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '引用名',
- tooltip: 'reference',
- bind: '{vjson.reference}',
- },
- ]
- },
- {
- xtype: 'cols',
- border: false,
- items: [
- // 允许分页、页大小、页大小选项
- // 隐藏底部小工具、隐藏刷新、隐藏导出、隐藏自动调整列宽
- // 多选、显示勾选、自动勾选、
- // 单击编辑、列分割线、行分割线、边框
- // 数据源自动加载、后端排序、后端过滤
- // 自定义锁定、自定义隐藏、自定义顺序、自定义筛选
- {
- xtype: 'checkbox',
- fieldLabel: '允许分页',
- bind: {
- value: "{vjson.pagination}"
- }
- },
- {
- xtype: 'numberfield',
- fieldLabel: '页大小',
- bind: '{vjson.pageSize}',
- },
- {
- xtype: 'textfield',
- fieldLabel: '页大小选项',
- flex: 2,
- bind: '{vjson.pageSizeOption}',
- },
- ]
- },
- {
- layout: 'hbox',
- border: false,
- items: [
- {
- xtype: 'combo',
- fieldLabel: '选择模式',
- flex: 4,
- data: [
- { id: 'spreadsheet', text: 'Excel模式' },
- { id: 'onlyCheckColumn', text: '勾选框-只用勾选框多选' },
- { id: 'checkColumn', text: '勾选框' },
- { id: 'row_mulity', text: '行选择-允许多选' },
- { id: 'row_single', text: '行选择-单选' },
- { id: 'disableSelection', text: '禁用' },
- ],
- bind: {
- value: '{vjson.selectMode}'
- }
- }
- ]
- },
- {
- layout: 'hbox',
- border: false,
- defaults: {
- xtype: 'checkbox',
- margin: '0 15 0 0',
- },
- items: [
- {
- xtype: 'container',
- margin: '3',
- border: false,
- width: 80,
- },
- {
- boxLabel: '隐藏底部',
- bind: {
- value: "{vjson.hideFootbar}"
- }
- },
- {
- boxLabel: '隐藏刷新',
- bind: {
- value: "{vjson.hideRefresh}"
- }
- },
- {
- boxLabel: '隐藏导出',
- bind: {
- value: "{vjson.hideExport}"
- }
- },
- {
- boxLabel: '隐藏自动调宽',
- bind: {
- value: "{vjson.hideAutoSize}"
- }
- },
- {
- boxLabel: '隐藏清空筛选',
- bind: {
- value: "{vjson.hideClearFilter}"
- }
- },
- {
- boxLabel: '隐藏保存布局',
- bind: {
- value: "{vjson.hideSaveGridUIConfig}"
- }
- },
- {
- boxLabel: '隐藏重置布局',
- bind: {
- value: "{vjson.hideClearGridUIConfig}"
- }
- },
- ]
- },
- {
- layout: 'hbox',
- border: false,
- defaults: {
- xtype: 'checkbox',
- margin: '0 15 0 0',
- },
- items: [
- {
- xtype: 'container',
- margin: '3',
- border: false,
- width: 80
- },
- {
- boxLabel: '单击编辑',
- bind: {
- value: "{vjson.cellediting_clicksToEdit}"
- }
- },
- {
- boxLabel: '列分隔线',
- bind: {
- value: "{vjson.columnLines}"
- }
- },
- {
- boxLabel: '行分隔线',
- bind: {
- value: "{vjson.rowLines}"
- }
- },
- {
- boxLabel: '边框',
- bind: {
- value: "{vjson.border}"
- }
- },
- ]
- },
- {
- layout: 'hbox',
- border: false,
- defaults: {
- xtype: 'checkbox',
- margin: '0 15 0 0',
- },
- items: [
- {
- xtype: 'container',
- margin: '3',
- border: false,
- width: 80
- },
- {
- boxLabel: '数据源自动加载',
- bind: {
- value: "{vjson.autoLoad}"
- }
- },
- {
- boxLabel: '后端排序',
- bind: {
- value: "{vjson.remoteSort}"
- }
- },
- {
- boxLabel: '后端过滤',
- bind: {
- value: "{vjson.remoteFilter}"
- }
- },
- ]
- },
- {
- layout: 'hbox',
- border: false,
- defaults: {
- xtype: 'checkbox',
- margin: '0 15 0 0',
- },
- items: [
- {
- xtype: 'container',
- margin: '3',
- border: false,
- width: 80
- },
- {
- boxLabel: '自定义锁定',
- bind: {
- value: "{vjson.enableLocking}"
- }
- },
- {
- boxLabel: '自定义隐藏',
- bind: {
- value: "{vjson.enableColumnHide}"
- }
- },
- {
- boxLabel: '用户拖拽字段',
- bind: {
- value: "{vjson.enableColumnMove}"
- }
- },
- {
- boxLabel: '自定义筛选',
- bind: {
- value: "{vjson.gridfilters}"
- }
- },
- {
- boxLabel: '用户拖拽字段宽度',
- bind: {
- value: "{vjson.enableColumnResize}"
- }
- },
- {
- boxLabel: '点击列头排序',
- bind: {
- value: "{vjson.sortOnClick}"
- }
- },
- {
- xtype: 'checkbox',
- boxLabel: '隐藏',
- bind: {
- value: "{vjson.hidden}"
- }
- },
- ]
- },
- {
- xtype: 'cols',
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '样式',
- bind: '{vjson.cls}',
- flex: 4
- },
- ]
- },
- ]
- },
- {
- title: '字段',
- xtype: 'yvgrid',
- reference: 'grid1',
- pagination: false,
- hideFootbar: true,
- plugins: {
- clipboard: true,
- selectionreplicator: true
- },
- selModel: {
- type: 'spreadsheet',
- columnSelect: true,
- pruneRemoved: false,
- extensible: 'y'
- },
- listeners: {
- editfinish: 'scope.gridEditFinish',
- },
- tbar: {
- xtype: 'toolbar',
- items: [
- {
- xtype: 'button',
- text: '添加',
- iconCls: 'x-fa fa-plus-circle',
- listeners: {
- click: 'scope.addColumn'
- }
- },
- {
- xtype: 'button',
- text: '删除',
- iconCls: 'x-fa fa-minus-circle',
- listeners: {
- click: 'scope.removeColumn'
- }
- },
- '-',
- {
- xtype: 'button',
- text: '自动分析',
- iconCls: 'x-fa fa-code-fork',
- listeners: {
- click: 'scope.calcColumn'
- }
- },
- {
- xtype: 'button',
- text: '上移',
- iconCls: 'x-fa fa-arrow-up',
- listeners: {
- click: 'scope.moveUp'
- }
- },
- {
- xtype: 'button',
- text: '下移',
- iconCls: 'x-fa fa-arrow-down',
- listeners: {
- click: 'scope.moveDown'
- }
- },
- ]
- },
- columns: [
- { xtype: 'rownumberer' },
- {
- text: '字段',
- dataIndex: 'dataIndex',
- width: 140,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: true,
- },
- },
- {
- text: '标题',
- dataIndex: 'header',
- width: 120,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: true,
- },
- },
- {
- text: '类型',
- dataIndex: 'xtype',
- width: 100,
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'combo',
- typeAhead: true,
- triggerAction: 'all',
- selectOnFocus: false,
- listConfig: {
- minWidth: 200
- },
- store: [
- ['', '默认'],
- ['rownum', 'rownum'],
- ['checkcolumn', 'checkcolumn'],
- ]
- },
- },
- {
- text: '数据类型',
- dataIndex: 'dataType',
- width: 100,
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'combo',
- selectOnFocus: true,
- listConfig: {
- minWidth: 200
- },
- store: [
- ['', '默认'],
- ['string', 'string'],
- ['number', 'number'],
- ['date', 'date'],
- ]
- },
- },
- {
- text: '编辑模式',
- dataIndex: 'editor',
- width: 100,
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'combo',
- selectOnFocus: true,
- listConfig: {
- minWidth: 200
- },
- store: [
- ['', ''],
- ['textfield', 'textfield'],
- ['numberfield', 'numberfield'],
- ['combo', 'combo'],
- ['combogrid', 'combogrid'],
- ['datefield', 'datefield'],
- ]
- },
- },
- {
- text: '宽度',
- dataIndex: 'width',
- align: 'right',
- width: 100,
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'numberfield',
- selectOnFocus: true,
- minValue: 0,
- maxValue: 1000
- },
- },
- {
- text: '权重',
- dataIndex: 'flex',
- align: 'right',
- width: 90,
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'numberfield',
- selectOnFocus: true,
- minValue: 0,
- maxValue: 10
- },
- },
- {
- text: '字典',
- dataIndex: 'dict',
- sortable: false,
- menuDisabled: true,
- width: 210,
- editor: {
- selectOnFocus: true,
- },
- },
- {
- text: '对齐',
- dataIndex: 'align',
- width: 90,
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'combo',
- selectOnFocus: true,
- listConfig: {
- minWidth: 120
- },
- store: [
- ['start', 'start'],
- ['center', 'center'],
- ['end', 'end'],
- ]
- },
- },
- {
- text: '必填',
- dataIndex: 'notAllowBlank',
- width: 50,
- resizable: false,
- sortable: false,
- menuDisabled: true,
- xtype: 'checkcolumn',
- },
- {
- text: '禁用',
- dataIndex: 'disabled',
- width: 50,
- resizable: false,
- sortable: false,
- menuDisabled: true,
- xtype: 'checkcolumn',
- },
- {
- text: '禁菜',
- dataIndex: 'menuDisabled',
- width: 50,
- resizable: false,
- sortable: false,
- menuDisabled: true,
- xtype: 'checkcolumn',
- },
- {
- text: '过滤',
- dataIndex: 'filterable',
- xtype: 'checkcolumn',
- width: 50,
- resizable: false,
- sortable: false,
- menuDisabled: true,
- },
- {
- text: '隐藏',
- dataIndex: 'hidden',
- xtype: 'checkcolumn',
- width: 50,
- resizable: false,
- sortable: false,
- menuDisabled: true,
- },
- {
- text: '可隐',
- dataIndex: 'hideable',
- xtype: 'checkcolumn',
- width: 50,
- resizable: false,
- sortable: false,
- menuDisabled: true,
- },
- {
- text: '调宽',
- dataIndex: 'resizable',
- xtype: 'checkcolumn',
- width: 50,
- resizable: false,
- sortable: false,
- menuDisabled: true,
- },
- {
- text: '排序',
- dataIndex: 'sortable',
- xtype: 'checkcolumn',
- width: 50,
- resizable: false,
- sortable: false,
- menuDisabled: true,
- },
- {
- text: '适宽',
- dataIndex: 'autoSize',
- xtype: 'checkcolumn',
- width: 50,
- resizable: false,
- sortable: false,
- menuDisabled: true,
- },
- ],
- },
- {
- title: '数据源',
- layout: 'border',
- listeners: {
- activate: 'scope.dataSourceActivate'
- },
- items: [
- {
- region: 'north',
- xtype: 'toolbar',
- border: false,
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '数据源',
- flex: 1,
- bind: {
- value: '{vjson.dataSource.url}'
- }
- },
- {
- xtype: 'button',
- text: '保存',
- iconCls: 'x-fa fa-save',
- listeners: {
- click: 'scope.dataSourceSave'
- }
- },
- {
- xtype: 'button',
- text: '读取',
- iconCls: 'x-fa fa-folder-open',
- listeners: {
- click: 'scope.reloadSqlContent'
- }
- },
- ]
- },
- {
- region: 'center',
- xtype: 'sqleditor',
- layout: 'fit',
- reference: 'sqlEditor',
- },
- {
- region: 'south',
- xtype: 'jsoneditor',
- height: 200,
- split: true,
- collapsible: true,
- title: '参数',
- reference: 'sqlParams',
- }
- ]
- },
- {
- title: '事件',
- xtype: 'form',
- scrollable: true,
- margin: '10',
- defaults: {
- width: '100%',
- labelAlign: 'top',
- },
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '选中前触发 beforeSelect',
- bind: {
- value: '{vjson.listeners.beforeselect}'
- },
- },
- {
- xtype: 'textfield',
- fieldLabel: '选择范围改变 selectionChange',
- bind: {
- value: '{vjson.listeners.selectionchange}'
- },
- },
- {
- xtype: 'textfield',
- fieldLabel: '行点击 itemClick',
- bind: {
- value: '{vjson.listeners.itemclick}'
- },
- },
- {
- xtype: 'textfield',
- fieldLabel: '行双击 itemDblClick',
- bind: {
- value: '{vjson.listeners.itemdblclick}'
- },
- },
- {
- xtype: 'textfield',
- fieldLabel: '单元格点击 cellClick',
- bind: {
- value: '{vjson.listeners.cellClick}'
- },
- },
- {
- xtype: 'textfield',
- fieldLabel: '单元格双击 cellDblClick',
- bind: {
- value: '{vjson.listeners.celldblclick}'
- },
- },
- {
- xtype: 'textfield',
- fieldLabel: '渲染后触发 afterrender',
- bind: {
- value: '{vjson.listeners.afterrender}'
- },
- },
- {
- xtype: 'textfield',
- fieldLabel: '销毁后触发 destory',
- bind: {
- value: '{vjson.listeners.destory}'
- },
- },
- ]
- },
- ],
- }
- ],
- fbar: [
- {
- text: '应用', iconCls: 'x-fa fa-save',
- listeners: {
- click: 'scope.save'
- }
- },
- '-',
- {
- text: '确定', iconCls: 'x-fa fa-check-circle',
- listeners: {
- click: 'scope.saveClose'
- }
- },
- {
- text: '取消', iconCls: 'x-fa fa-times-circle',
- listeners: {
- click: 'system.closeMe()'
- }
- },
- ]
- };
- //# sourceMappingURL=YvgridDesign.view.js.map
- var checkFlags = {};
- // ------------------------------------------------------------------------------------------ impls
- function jsViewToVJson(modulePage, jsView) {
- if (!jsView)
- return {};
- jsView = jsView.replace(/^\s*export\s+default/, "");
- jsView = _$2.trim(jsView) || "{}";
- try {
- var json = dist.parse(jsView);
- return modulePage.addViewId(json);
- }
- catch (e) {
- //@ts-ignore
- Ext.Msg.alert(modulePage.module.name + '界面文件加载异常', e, Ext.emptyFn);
- }
- }
- function stringToJsonObj(jsonStr) {
- if (!jsonStr)
- return {};
- try {
- return dist.parse(jsonStr);
- }
- catch (e) {
- return {};
- }
- }
- /**
- * 获取view.js 文件 string
- */
- function vjsonTojsView(vjson) {
- var reVjson = _$2.cloneDeep(vjson);
- removeDesignProp(reVjson);
- return "export default " + dist.stringify(__assign({}, reVjson), null, ' ');
- }
- var ModuleStore = /** @class */ (function (_super) {
- __extends(ModuleStore, _super);
- function ModuleStore() {
- var _this = _super.call(this) || this;
- _this.store = {};
- eventBus.subscribe(EventType.ModulePageCreate, function (_a) {
- var id = _a.id, module = _a.module, modulePage = _a.modulePage;
- _this.addModule(id, module, modulePage);
- });
- eventBus.subscribe(EventType.MainTabChange, function (_a) {
- var moduleId = _a.moduleId, oldModuleId = _a.oldModuleId, from = _a.from;
- _this.onMainTabChange(moduleId, oldModuleId, from);
- });
- return _this;
- }
- ModuleStore.prototype.getCacheKey = function (param) {
- return "filetree_data.json";
- };
- ModuleStore.prototype.invokeApi = function (param) {
- return moduleTree();
- };
- ModuleStore.prototype.reloadModule = function (id) {
- var moduleObject = this.store[id];
- if (!moduleObject)
- return;
- var module = moduleObject.module;
- getModuleFileContent(module).then(function (_a) {
- var _b = _a.data, jsController = _b.jsController, jsView = _b.jsView, jsModel = _b.jsModel, groovy = _b.groovy, mybatis = _b.mybatis, lastModifyTime = _b.lastModifyTime;
- moduleObject.fileContent = { jsController: jsController, jsView: jsView, jsModel: jsModel, groovy: groovy, mybatis: mybatis };
- moduleObject.lastModifyTime = lastModifyTime;
- moduleObject.moduleObj = { vjson: jsViewToVJson(moduleObject.modulePage, jsView) };
- // 触发事件 ModuleItemChange
- moduleObject.moduleEventBus.publish(EventType.ModuleItemChange, moduleObject);
- moduleObject.moduleEventBus.publish(EventType.SetVjson, {
- vjson: moduleObject.moduleObj.vjson,
- from: "reloadModule"
- });
- eventBus.publish(EventType.SetVjson, { moduleId: id, from: "reloadModule" });
- });
- };
- ModuleStore.prototype.addModule = function (id, module, modulePage) {
- var _this = this;
- window['mainWindow'].setLoading(true);
- getModuleFileContent(module)
- .then(function (_a) {
- var _b = _a.data, jsController = _b.jsController, jsView = _b.jsView, jsModel = _b.jsModel, groovy = _b.groovy, mybatis = _b.mybatis, lastModifyTime = _b.lastModifyTime;
- var moduleObject = {
- id: id, module: module,
- fileContent: { jsController: jsController, jsView: jsView, jsModel: jsModel, groovy: groovy, mybatis: mybatis },
- lastModifyTime: lastModifyTime,
- moduleObj: { vjson: jsViewToVJson(modulePage, jsView) },
- modulePage: modulePage,
- moduleEventBus: modulePage.moduleEventBus
- };
- _this.store[id] = moduleObject;
- // 触发事件 ModuleItemChange
- moduleObject.moduleEventBus.publish(EventType.ModuleItemChange, moduleObject);
- // moduleObject.moduleEventBus.publish(EventType.SetVjson, {moduleId: id, from: "addModule"})
- eventBus.publish(EventType.SetVjson, { moduleId: id, from: "addModule" });
- })
- .finally(function () {
- window['mainWindow'].setLoading(false);
- });
- };
- ModuleStore.prototype.onMainTabChange = function (moduleId, oldModuleId, from) {
- if (this.store[moduleId]) {
- eventBus.publish(EventType.SetVjson, { moduleId: moduleId, from: from });
- }
- };
- ModuleStore.prototype.updateJsController = function (id, codeValue, from) {
- var moduleObject = this.store[id];
- moduleObject.fileContent.jsController = codeValue;
- };
- ModuleStore.prototype.updateJsView = function (id, codeValue, from) {
- var moduleObject = this.store[id];
- moduleObject.fileContent.jsView = codeValue;
- moduleObject.moduleObj.vjson = jsViewToVJson(moduleObject.modulePage, codeValue);
- handles$1.mainWindow.activeModulePage.moduleEventBus.publish(EventType.SetVjson, {
- vjson: moduleObject.moduleObj.vjson,
- from: from
- });
- eventBus.publish(EventType.SetVjson, { moduleId: id, from: from });
- };
- ModuleStore.prototype.updateJsModel = function (id, codeValue, from) {
- var moduleObject = this.store[id];
- moduleObject.fileContent.jsModel = codeValue;
- };
- ModuleStore.prototype.updateGroovy = function (id, codeValue, from) {
- var moduleObject = this.store[id];
- moduleObject.fileContent.groovy = codeValue;
- };
- ModuleStore.prototype.updateMybatis = function (id, codeValue, from) {
- var moduleObject = this.store[id];
- moduleObject.fileContent.mybatis = codeValue;
- };
- ModuleStore.prototype.getModuleObject = function (id) {
- return this.store[id];
- };
- ModuleStore.prototype.saveFile = function (moduleId, fileType) {
- if (checkFlags[moduleId] === 1) {
- // @ts-ignore
- system.msg("正在检测文件是否有外部修改,请稍后操作");
- }
- eventBus.publish(EventType.StopCheckModule, {});
- var fileFullPath = moduleStore.getModuleObject(moduleId).module[fileType + "File"].absolutePath;
- var fileContent = moduleStore.getModuleObject(moduleId).fileContent[fileType];
- saveFile(fileFullPath, fileContent).then(function (res) {
- if (res.data && res.data.lastModified) {
- moduleStore.getModuleObject(moduleId).module[fileType + "File"].lastModified = res.data.lastModified;
- }
- }).finally(function () {
- eventBus.publish(EventType.RunCheckModule, {});
- });
- };
- ModuleStore.prototype.check = function (moduleId) {
- {
- return;
- }
- };
- return ModuleStore;
- }(CacheStore));
- // ------------------------------------------------------------------------------------------ use
- var moduleStore = new ModuleStore();
- //# sourceMappingURL=ModuleStore.js.map
- var VjsonExchange = /** @class */ (function () {
- function VjsonExchange(vjson) {
- this.pendingSet = true;
- this.vjsonOrigin = _$2.cloneDeep(vjson);
- this.vjson = _$2.cloneDeep(this.vjsonOrigin);
- }
- /**
- * 设值某个 viewModel 属性发生变化时, vjson 应该做出的变化
- * @param propName
- * @param value
- */
- VjsonExchange.prototype.setPropValue = function (propName, value) {
- if (this.pendingSet) {
- return;
- }
- // selectMode
- // pageSizeOption
- // cellediting_clicksToEdit
- msg$1('' + propName + '=' + value);
- _$2.set(this.vjson, propName, value);
- };
- /**
- * 字段编辑表格中,某字段属性发生变化,函数返回属性变化对应的 vjson.column 所需变化
- */
- VjsonExchange.prototype.setColumnValue = function (propName, value, record, rowIdx) {
- var _a, _b, _c;
- if (this.pendingSet) {
- return;
- }
- // 默认属性对照表 vs, 如果要设定的值与默认值相等,就删除这个属性
- // 如果不使用默认属性,就直接设定 undefined
- var vs = {
- dataIndex: undefined,
- header: undefined,
- xtype: '',
- width: undefined,
- flex: undefined,
- align: 'start',
- editor: undefined,
- dataType: 'string',
- dict: undefined,
- disabled: false,
- menuDisabled: false,
- notAllowBlank: false,
- filterable: true,
- hidden: false,
- hideable: true,
- resizable: true,
- sortable: true,
- autoSize: true,
- };
- var raw = record.get('raw');
- if (raw === undefined || raw == null) {
- raw = {};
- record.set('raw', raw);
- }
- var setRaw = function (propName, value) {
- if (typeof value === 'undefined' || value == null) {
- msg$1("delete columns[" + rowIdx + "]." + propName);
- delete raw[propName];
- return;
- }
- var defaultValue = vs[propName];
- if (typeof defaultValue !== 'undefined' && value === defaultValue) {
- // 要设的值,与默认值相同,就直接删除这个属性
- msg$1("delete columns[" + rowIdx + "]." + propName);
- delete raw[propName];
- return;
- }
- msg$1("set columns[" + rowIdx + "]." + propName + "=" + value);
- _$2.set(raw, propName, value);
- };
- if (!vs.hasOwnProperty(propName)) {
- msg$1("\u4E0D\u652F\u6301\u7684\u7F16\u8F91\u5C5E\u6027 columns[" + rowIdx + "]." + propName);
- return;
- }
- else if (propName === 'dict') {
- if (value) {
- setRaw('fix', ["system.getDict(\"" + value + "\")"]);
- if (((_a = raw.editor) === null || _a === void 0 ? void 0 : _a.xtype) === 'combo') {
- setRaw('editor.fix', ["system.getDict(\"" + value + "\")"]);
- }
- }
- else {
- setRaw('fix', undefined);
- if (_$2.isArray((_b = raw.editor) === null || _b === void 0 ? void 0 : _b.fix)) {
- msg$1("delete columns[" + rowIdx + "].editor.fix");
- delete raw.editor.fix;
- }
- }
- }
- else if (propName === 'xtype') {
- if (!value) {
- setRaw('xtype', undefined);
- }
- else {
- setRaw('xtype', value);
- }
- }
- else if (propName === 'notAllowBlank') {
- setRaw('editor.allowBlank', !value);
- }
- else if (propName === 'editor') {
- if (value && !_$2.includes(['numberfield', 'datefield', 'combo', 'combogrid', 'textfield'], value)) {
- showErrorDialog$1("\u4E0D\u53EF\u8BC6\u522B\u7684 columns[" + rowIdx + "].editor.xtype=" + value);
- value = undefined;
- }
- // editor.xtype
- if (!value) {
- // 不需要编辑器
- if ((_c = raw.editor) === null || _c === void 0 ? void 0 : _c.xtype) {
- msg$1("delete columns[" + rowIdx + "].editor");
- delete raw.editor;
- record.set('notAllowBlank', false);
- }
- }
- else {
- setRaw('editor.xtype', value);
- var dict = record.get('dict');
- if (value === 'combo' && dict) {
- setRaw('editor.fix', ["system.getDict(\"" + dict + "\")"]);
- }
- }
- }
- else if (propName === 'width') {
- var width = value;
- var flex = record.get('flex');
- if (!width && !flex) {
- setRaw('width', undefined);
- setRaw('flex', undefined);
- record.set('flex', undefined);
- record.set('width', undefined);
- return;
- }
- else if (!!width) {
- setRaw('flex', undefined);
- record.set('flex', undefined);
- setRaw('width', width);
- return;
- }
- }
- else if (propName === 'flex') {
- var width = record.get('width');
- var flex = value;
- if (!width && !flex) {
- setRaw('width', undefined);
- setRaw('flex', undefined);
- record.set('flex', undefined);
- record.set('width', undefined);
- return;
- }
- else if (!!flex) {
- setRaw('width', undefined);
- record.set('width', undefined);
- setRaw('flex', flex);
- return;
- }
- }
- else {
- // 其他属性,作为同名属性,与 raw 同步
- setRaw(propName, value);
- }
- };
- /**
- * 观察 viewModel 中的属性值变化,如果变化,将会改变 vjson 中相对应的属性
- */
- VjsonExchange.prototype.attachViewModel = function (viewModel) {
- var _this = this;
- var vs = [
- 'reference', 'pagination', 'pageSize',
- 'hideFootbar', 'hideRefresh', 'hideExport', 'hideAutoSize', 'hideClearFilter', 'hideSaveGridUIConfig', 'hideClearGridUIConfig',
- 'columnLines', 'rowLines', 'border', 'autoLoad', 'remoteSort', 'remoteFilter', 'enableLocking', 'enableColumnHide',
- 'enableColumnMove', 'gridfilters', 'enableColumnResize', 'sortOnClick', 'hidden', 'cls',
- 'listeners.beforeselect',
- 'listeners.selectionchange',
- 'listeners.itemclick',
- 'listeners.itemdblclick',
- 'listeners.cellClick',
- 'listeners.celldblclick',
- 'listeners.afterrender',
- 'listeners.destory',
- ];
- _$2.forEach(vs, function (v) {
- viewModel.bind('{vjson.' + v + '}', _this.bindChangeProp(v));
- });
- };
- VjsonExchange.prototype.bindChangeProp = function (propName) {
- var me = this;
- return function (value) {
- me.setPropValue(propName, value);
- };
- };
- VjsonExchange.prototype.parseModel = function () {
- var _this = this;
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14;
- //@ts-ignore
- var df = YvanUI.Defaults.grid;
- var vjson = _$2.assign({}, df, this.vjson);
- var model = {
- reference: (_a = vjson.reference) !== null && _a !== void 0 ? _a : '',
- pagination: (_b = vjson.pagination) !== null && _b !== void 0 ? _b : true,
- pageSize: (_c = vjson.pageSize) !== null && _c !== void 0 ? _c : 50,
- pageSizeOption: '["20", "50", "100", "200", "300"]',
- hideFootbar: (_d = vjson.hideFootbar) !== null && _d !== void 0 ? _d : false,
- hideRefresh: (_e = vjson.hideRefresh) !== null && _e !== void 0 ? _e : false,
- hideExport: (_f = vjson.hideExport) !== null && _f !== void 0 ? _f : false,
- hideAutoSize: (_g = vjson.hideAutoSize) !== null && _g !== void 0 ? _g : false,
- hideClearFilter: (_h = vjson.hideClearFilter) !== null && _h !== void 0 ? _h : false,
- hideSaveGridUIConfig: (_j = vjson.hideSaveGridUIConfig) !== null && _j !== void 0 ? _j : false,
- hideClearGridUIConfig: (_k = vjson.hideClearGridUIConfig) !== null && _k !== void 0 ? _k : false,
- selectMode: 'spreadsheet',
- cellediting_clicksToEdit: true,
- columnLines: (_l = vjson.columnLines) !== null && _l !== void 0 ? _l : true,
- rowLines: (_m = vjson.rowLines) !== null && _m !== void 0 ? _m : true,
- border: (_o = vjson.border) !== null && _o !== void 0 ? _o : true,
- autoLoad: (_p = vjson.autoLoad) !== null && _p !== void 0 ? _p : true,
- remoteSort: (_q = vjson.remoteSort) !== null && _q !== void 0 ? _q : false,
- remoteFilter: (_r = vjson.remoteFilter) !== null && _r !== void 0 ? _r : false,
- enableLocking: (_s = vjson.enableLocking) !== null && _s !== void 0 ? _s : false,
- enableColumnHide: (_t = vjson.enableColumnHide) !== null && _t !== void 0 ? _t : true,
- enableColumnMove: (_u = vjson.enableColumnMove) !== null && _u !== void 0 ? _u : true,
- gridfilters: true,
- enableColumnResize: (_v = vjson.enableColumnResize) !== null && _v !== void 0 ? _v : true,
- sortOnClick: (_w = vjson.sortOnClick) !== null && _w !== void 0 ? _w : true,
- hidden: (_x = vjson.hidden) !== null && _x !== void 0 ? _x : false,
- cls: (_y = vjson.cls) !== null && _y !== void 0 ? _y : '',
- columns: [],
- listeners: {
- beforeselect: (_0 = (_z = vjson.listeners) === null || _z === void 0 ? void 0 : _z.beforeselect) !== null && _0 !== void 0 ? _0 : '',
- selectionchange: (_2 = (_1 = vjson.listeners) === null || _1 === void 0 ? void 0 : _1.selectionchange) !== null && _2 !== void 0 ? _2 : '',
- itemclick: (_4 = (_3 = vjson.listeners) === null || _3 === void 0 ? void 0 : _3.itemclick) !== null && _4 !== void 0 ? _4 : '',
- itemdblclick: (_6 = (_5 = vjson.listeners) === null || _5 === void 0 ? void 0 : _5.itemdblclick) !== null && _6 !== void 0 ? _6 : '',
- cellClick: (_8 = (_7 = vjson.listeners) === null || _7 === void 0 ? void 0 : _7.cellClick) !== null && _8 !== void 0 ? _8 : '',
- celldblclick: (_10 = (_9 = vjson.listeners) === null || _9 === void 0 ? void 0 : _9.celldblclick) !== null && _10 !== void 0 ? _10 : '',
- afterrender: (_12 = (_11 = vjson.listeners) === null || _11 === void 0 ? void 0 : _11.afterrender) !== null && _12 !== void 0 ? _12 : '',
- destory: (_14 = (_13 = vjson.listeners) === null || _13 === void 0 ? void 0 : _13.destory) !== null && _14 !== void 0 ? _14 : '',
- }
- };
- if (_$2.isArray(this.vjson.pageSizeOption)) {
- model.pageSizeOption = JSON.stringify(this.vjson.pageSizeOption);
- }
- model.gridfilters = _$2.get(this.vjson, 'plugins.gridfilters');
- if (_$2.get(vjson, 'disableSelection') == true) {
- model.selectMode = 'disableSelection';
- }
- else if (_$2.get(vjson, 'selModel.type') == 'spreadsheet') {
- model.selectMode = 'spreadsheet';
- }
- else if (_$2.get(vjson, 'selModel.type') == 'checkboxmodel' && _$2.get(this.vjson, 'selModel.checkOnly') == true) {
- model.selectMode = 'onlyCheckColumn';
- }
- else if (_$2.get(vjson, 'selModel.type') == 'checkboxmodel') {
- model.selectMode = 'checkColumn';
- }
- else if (_$2.get(vjson, 'selModel.type') == 'rowmodel' && _$2.get(this.vjson, 'selModel.mode') == 'MULTI') {
- model.selectMode = 'row_mulity';
- }
- else if (_$2.get(vjson, 'selModel.type') == 'rowmodel') {
- model.selectMode = 'row_single';
- }
- else {
- model.selectMode = 'row_single';
- }
- model.cellediting_clicksToEdit = (_$2.get(vjson, 'plugins.cellediting.clicksToEdit') > 0);
- if (_$2.get(vjson, 'dataSource.method') === 'invoke') {
- model.dataSource = {
- url: _$2.get(vjson, 'dataSource.url'),
- //@ts-ignore
- params: _$2.get(vjson, 'dataSource.params')
- };
- }
- _$2.forEach(vjson.columns, function (column) {
- model.columns.push(_this.parseColumn(column));
- });
- return model;
- };
- VjsonExchange.prototype.parseColumn = function (column) {
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
- var model = {
- dataIndex: (_a = column.dataIndex) !== null && _a !== void 0 ? _a : '',
- header: (_b = column.header) !== null && _b !== void 0 ? _b : '',
- xtype: (_c = column.xtype) !== null && _c !== void 0 ? _c : '',
- width: (_d = column.width) !== null && _d !== void 0 ? _d : 0,
- flex: (_e = column.flex) !== null && _e !== void 0 ? _e : 0,
- align: (_f = column.align) !== null && _f !== void 0 ? _f : 'start',
- editor: '',
- editParam: '',
- dict: '',
- disabled: (_g = column.disabled) !== null && _g !== void 0 ? _g : false,
- menuDisabled: (_h = column.menuDisabled) !== null && _h !== void 0 ? _h : false,
- notAllowBlank: (_j = column.notAllowBlank) !== null && _j !== void 0 ? _j : false,
- filterable: (_k = column.filterable) !== null && _k !== void 0 ? _k : true,
- hidden: (_l = column.hidden) !== null && _l !== void 0 ? _l : false,
- hideable: (_m = column.hideable) !== null && _m !== void 0 ? _m : true,
- resizable: (_o = column.resizable) !== null && _o !== void 0 ? _o : true,
- sortable: (_p = column.sortable) !== null && _p !== void 0 ? _p : true,
- locked: (_q = column.locked) !== null && _q !== void 0 ? _q : false,
- lockable: (_r = column.lockable) !== null && _r !== void 0 ? _r : false,
- autoSize: (_s = column.autoSize) !== null && _s !== void 0 ? _s : true,
- raw: _$2.cloneDeep(column),
- };
- // width / flex 只能留一个属性, 或者全不留
- if (model.width <= 0 && model.flex <= 0) {
- delete model.width;
- delete model.flex;
- }
- else if (model.width > 0) {
- delete model.flex;
- }
- else {
- delete model.width;
- }
- // editor
- if (_$2.isObject(_$2.get(column, 'editor'))) {
- model.editor = _$2.get(column, 'editor.xtype');
- // model.editParam = window['YvanUI'].json5.stringify(column.editor)
- if (!model.editor) {
- // 有 editor 属性,但没有 editor.xtype 属性,默认是文本输入框
- model.editor = 'textfield';
- }
- else if (!_$2.includes(['numberfield', 'datefield', 'combo', 'combogrid', 'textfield'], model.editor)) {
- msg$1('不可识别的 editor.xtype=' + model.editor);
- console.error('不可识别的 editor.xtype', column);
- }
- if (_$2.get(column, 'editor.allowBlank') === false) {
- model.notAllowBlank = true;
- }
- }
- // dict -> { fix: ['system.getDict("AREA_CLASSIFY")'], }
- if (_$2.isString(_$2.get(column, 'fix[0]'))) {
- var match = _$2.get(column, 'fix[0]').match(/^system.getDict\(\"(.*?)\"\)$/);
- if (match && match[1]) {
- model.dict = match[1];
- }
- }
- return model;
- };
- return VjsonExchange;
- }());
- //
- //# sourceMappingURL=YvgridExchange.js.map
- var YvgridDesign = /** @class */ (function (_super) {
- __extends(YvgridDesign, _super);
- function YvgridDesign(moduleId) {
- var _this = _super.call(this, { model: model$7, vjson: vjson$7 }) || this;
- _this.moduleId = '';
- _this.name = 'YvgridDesign';
- _this.dataSourceIsActived = false;
- _this.setModuleId(moduleId);
- return _this;
- }
- YvgridDesign.prototype.setModuleId = function (moduleId) {
- var _this = this;
- this.moduleId = moduleId;
- if (this.componentSelectionChangeSubscribe) {
- this.componentSelectionChangeSubscribe.cancel();
- this.componentSelectionChangeSubscribe = null;
- }
- this.componentSelectionChangeSubscribe = moduleStore.getModuleObject(this.moduleId).moduleEventBus.subscribe(EventType.ComponentSelectionChange, function (_a) {
- var id = _a.id, from = _a.from;
- _this.onComponentSelectionChange(id, from);
- });
- var id = moduleStore.getModuleObject(this.moduleId).modulePage.currentComponentSelectId;
- var vj = findInCode(moduleStore.getModuleObject(this.moduleId).moduleObj.vjson, id);
- if (vj.xtype !== 'yvgrid') {
- throw Error('非 yvgrid 组件');
- }
- this.vjsonExchange = new VjsonExchange(vj);
- };
- YvgridDesign.prototype.onLoad = function () {
- var _this = this;
- var model = this.vjsonExchange.parseModel();
- this.vjsonExchange.pendingSet = true;
- mergeViewModel(this.viewModel, "vjson", model, false);
- this.refs.grid1.setData(model.columns);
- this.vjsonExchange.attachViewModel(this.viewModel);
- _$2.defer(function () {
- _this.vjsonExchange.pendingSet = false;
- });
- };
- YvgridDesign.prototype.moveUp = function (sender) {
- var grid = sender.up('grid');
- grid.rowMoveUp();
- };
- YvgridDesign.prototype.moveDown = function (sender) {
- var grid = sender.up('grid');
- grid.rowMoveDown();
- };
- YvgridDesign.prototype.gridEditFinish = function (sender, editor, context, eOpts) {
- this.vjsonExchange.setColumnValue(context.field, context.value, context.record, context.rowIdx);
- };
- YvgridDesign.prototype.reloadSqlContent = function () {
- var _this = this;
- var url = this.viewModel.get('vjson.dataSource.url');
- if (url) {
- loadSqlContentApi(url).then(function (res) {
- _this.refs.sqlEditor.setCode('');
- if (res.success) {
- _this.refs.sqlEditor.setCode(res.data.content);
- }
- }).catch(function () {
- _this.refs.sqlEditor.setCode('');
- });
- }
- };
- YvgridDesign.prototype.dataSourceSave = function () {
- var url = this.viewModel.get('vjson.dataSource.url');
- if (!url) {
- msg$1('必须填写 groovy/SQL 模块路径');
- return;
- }
- var content = this.refs.sqlEditor.getCode();
- saveSqlContentApi(url, content).then(function (res) {
- if (res.success) {
- msg$1('保存成功');
- }
- else {
- msg$1(res.msg);
- }
- });
- };
- YvgridDesign.prototype.dataSourceActivate = function () {
- if (!this.dataSourceIsActived) {
- // 激活
- this.reloadSqlContent();
- var params = this.viewModel.get('vjson.dataSource.params');
- if (_$2.isObject(params)) {
- this.refs.sqlParams.setCode(window['YvanUI'].json5.stringify(params, null, ' '));
- }
- this.dataSourceIsActived = true;
- }
- };
- // 外部控件选择发生改变
- YvgridDesign.prototype.onComponentSelectionChange = function (id, from) {
- if (!id || from === this.name) {
- return;
- }
- this.setVjson(id);
- };
- YvgridDesign.prototype.setVjson = function (id) {
- // 找到对应的组件 判断是不是表格
- };
- YvgridDesign.prototype.save = function () {
- var columns = this.refs.grid1.getDataRowsOnlyData().map(function (r) { return r.raw; });
- if (this.dataSourceIsActived) {
- var url = this.viewModel.get('vjson.dataSource.url');
- // 解析 params
- var paramsString = this.refs.sqlParams.getCode('');
- var params = undefined;
- if (paramsString) {
- try {
- params = window['YvanUI'].json5.parse(paramsString);
- }
- catch (e) {
- msg$1('dataSource.params 格式非法,请检查');
- return;
- }
- }
- if (typeof params === 'undefined') {
- params = this.viewModel.get('vjson.dataSource.params');
- }
- if (url) {
- _$2.set(this.vjsonExchange.vjson, 'dataSource.url', url);
- _$2.set(this.vjsonExchange.vjson, 'dataSource.method', 'invoke');
- _$2.set(this.vjsonExchange.vjson, 'dataSource.params', params);
- }
- else {
- delete this.vjsonExchange.vjson['dataSource'];
- }
- }
- moduleStore.getModuleObject(this.moduleId).moduleEventBus.publish(EventType.UpdateComponentVjson, {
- cmpVjson: __assign(__assign({}, this.vjsonExchange.vjson), { columns: columns }),
- from: this.name,
- ignoreRenderUI: false
- });
- };
- YvgridDesign.prototype.saveClose = function () {
- this.save();
- this.close();
- };
- YvgridDesign.prototype.addColumn = function () {
- this.refs.grid1.appendEditRow({
- dataIndex: '',
- header: '',
- xtype: '',
- width: 80,
- align: '',
- editor: '',
- editParam: '',
- dict: '',
- disabled: false,
- notAllowBlank: false,
- menuDisabled: false,
- filterable: false,
- hidden: false,
- hideable: true,
- resizable: true,
- sortable: true,
- locked: false,
- lockable: false,
- autoSize: true,
- raw: undefined,
- }, 'header');
- };
- YvgridDesign.prototype.removeColumn = function () {
- var _this = this;
- var rows = [];
- this.refs.grid1.getSelectionModel().getSelected().eachRow(function (r) {
- rows.push(r);
- });
- _$2.forEach(rows, function (r) {
- _this.refs.grid1.getStore().remove(r);
- });
- };
- YvgridDesign.prototype.calcColumn = function () {
- msg$1('暂未实现');
- };
- YvgridDesign.prototype.onDestroy = function () {
- if (this.componentSelectionChangeSubscribe) {
- this.componentSelectionChangeSubscribe.cancel();
- this.componentSelectionChangeSubscribe = null;
- }
- };
- return YvgridDesign;
- }(Scope));
- //# sourceMappingURL=YvgridDesign.js.map
- // export const idPrefix = "_ds_"
- var _designInstance;
- function setDesignInstance(instance) {
- _designInstance = instance;
- }
- function getDesignInstance() {
- return _designInstance;
- }
- function delegateDragmove(node, source, info) {
- if (_designInstance && typeof _designInstance.dragmove === 'function') {
- //@ts-ignore
- _designInstance.dragmove(node, source, info);
- }
- }
- function delegateDragend(node, source, info) {
- if (_designInstance && typeof _designInstance.dragend === 'function') {
- //@ts-ignore
- _designInstance.dragend(node, source, info);
- }
- }
- //# sourceMappingURL=DropHelper.js.map
- var YvanUI$1 = window['YvanUI'];
- var _$1 = window["_"];
- var Ext$1 = window['Ext'];
- var $$1 = window["$"];
- var historySize = 100;
- var ViewDesign = /** @class */ (function () {
- function ViewDesign(moduleId, reference) {
- var _this = this;
- this.name = "ViewDesign";
- this.expandedVjsonObjArray = [];
- // 编辑历史
- this.undoVjsonList = [];
- // 撤销历史
- this.redoVjsonList = [];
- // 订阅事件列表
- this.subscribeList = [];
- // private getOuterCopyValueTimer: any = null
- /**
- * 唯一编号
- */
- this.id = _$1.uniqueId("_dv");
- this.moduleId = moduleId;
- this.moduleObject = moduleStore.getModuleObject(moduleId);
- this.$overlay = $$1('<div id = "' + this.id + '"class="yvan_designer_overlay" style="z-index: 99" tabindex="0"></div>');
- this.designReference = reference;
- this.designElement = reference.ariaEl.dom;
- this.$overlay.appendTo(this.designElement);
- this.vjson = moduleStore.getModuleObject(moduleId).moduleObj.vjson;
- // 添加到撤销
- this.lastVjson = _$1.cloneDeep(this.vjson);
- this.$overlay.on('contextmenu', '.studio_mask', function (event) {
- event.stopPropagation();
- event.preventDefault();
- eventBus.publish(EventType.ComponentContextmenu, { id: "", from: _this.name });
- });
- this.$overlay.on('click', '.studio_mask', function (event) {
- event.stopPropagation();
- event.preventDefault();
- _this.clearSelection();
- _this.moduleObject.moduleEventBus.publish(EventType.ComponentSelectionChange, { id: "", from: _this.name });
- _$1.defer(function () {
- _this.$overlay.focus();
- });
- });
- this.$overlay.on('click', this.overlayClickFunction.bind(this));
- this.$overlay.on('keyup', this.onKeyPress.bind(this));
- this.$overlay.on('copy', this.onCopy.bind(this));
- this.$overlay.on('paste', this.onPaste.bind(this));
- this.$overlay.on('focus', this.onfocus.bind(this));
- // this.$overlay.on('mouseenter', ()=>{
- // clearTimeout(this.getOuterCopyValueTimer);
- // this.getOuterCopyValueTimer = setTimeout(()=>{this.$overlay.focus()}, 500)
- // })
- this.$overlay.on('mousemove', _$1.debounce(function (event) {
- _this.onMousemove(event);
- }, 300, { maxWait: 500 }).bind(this));
- window.addEventListener('message', this.onMessageEvent.bind(this));
- this.subscribe();
- setDesignInstance(this);
- }
- // todo ======== 方法 ==========
- ViewDesign.prototype.subscribe = function () {
- var _this = this;
- this.setSelection(this.moduleObject.modulePage.currentComponentSelectId);
- this.subscribeList.push(this.moduleObject.moduleEventBus.subscribe(EventType.SetVjson, function (_a) {
- var vjson = _a.vjson, from = _a.from, ignoreRenderUI = _a.ignoreRenderUI;
- _this.setVjson(vjson, from, ignoreRenderUI);
- }));
- this.subscribeList.push(this.moduleObject.moduleEventBus.subscribe(EventType.ComponentSelectionChange, function (_a) {
- var id = _a.id, from = _a.from;
- _this.onComponentSelectionChange(id, from);
- }));
- this.subscribeList.push(this.moduleObject.moduleEventBus.subscribe(EventType.ComponentDelete, function (_a) {
- var id = _a.id, from = _a.from;
- _this.onComponentDelete(id, from);
- }));
- };
- ViewDesign.prototype.setVjson = function (vjson, from, ignoreRenderUI) {
- if (vjson === void 0) { vjson = this.vjson; }
- if (from === void 0) { from = this.name; }
- this.vjson = vjson;
- if (from !== "undo" && from !== "redo") {
- if (this.undoVjsonList.length >= 100) {
- this.undoVjsonList.splice(0, this.undoVjsonList.length - historySize + 1);
- }
- this.undoVjsonList.push(this.lastVjson);
- }
- this.lastVjson = _$1.cloneDeep(vjson);
- this.setSelection(this.moduleObject.modulePage.currentComponentSelectId);
- };
- /**
- * 覆盖层点击事件
- */
- ViewDesign.prototype.overlayClickFunction = function (event) {
- if (!event.altKey && !event.shiftKey) {
- var target = this.findElByXY(event.clientX, event.clientY);
- if (target) {
- var rect = target === null || target === void 0 ? void 0 : target.getBoundingClientRect();
- var extHandle = Ext$1.get(target).component;
- var position = this.getPosition({ x: rect.x, y: rect.y }, "main", "overlay");
- rect.x = position.x;
- rect.y = position.y;
- this.clearSelection();
- this.appendMaskbox(rect, extHandle.id);
- }
- }
- };
- ViewDesign.prototype.findElByXY = function (x, y, dragType) {
- if (dragType === void 0) { dragType = ""; }
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
- var ele = document.elementsFromPoint(x, y);
- if (ele.length <= 1) {
- return;
- }
- var target = null;
- for (var i = 0; i < ele.length; i++) {
- // 包含设计样式 并且有 id 并且 id 不包含被动生成id (有效id是设计器生成的, 不包含 '-' )
- if (((_a = ele[i].getAttribute("class")) === null || _a === void 0 ? void 0 : _a.indexOf("yvan_design ")) >= 0 && ele[i].id && ele[i].id.indexOf('-') < 0) {
- switch (dragType) {
- case "cols-container":
- if (((_b = ele[i].getAttribute("class")) === null || _b === void 0 ? void 0 : _b.indexOf("design_rows_container")) >= 0
- || ((_c = ele[i].getAttribute("class")) === null || _c === void 0 ? void 0 : _c.indexOf("design_cols_container")) >= 0) {
- target = ele[i];
- }
- break;
- case "col-item":
- if (((_d = ele[i].getAttribute("class")) === null || _d === void 0 ? void 0 : _d.indexOf("design_cols_container")) >= 0
- || ((_e = ele[i].getAttribute("class")) === null || _e === void 0 ? void 0 : _e.indexOf("design_col_item")) >= 0) {
- target = ele[i];
- }
- break;
- case "rows-container":
- if (((_f = ele[i].getAttribute("class")) === null || _f === void 0 ? void 0 : _f.indexOf("design_cols_container")) >= 0
- || ((_g = ele[i].getAttribute("class")) === null || _g === void 0 ? void 0 : _g.indexOf("design_rows_container")) >= 0) {
- target = ele[i];
- }
- break;
- case "row-item":
- if (((_h = ele[i].getAttribute("class")) === null || _h === void 0 ? void 0 : _h.indexOf("design_row_item")) >= 0
- || ((_j = ele[i].getAttribute("class")) === null || _j === void 0 ? void 0 : _j.indexOf("design_rows_container")) >= 0) {
- target = ele[i];
- }
- break;
- default:
- target = ele[i];
- break;
- }
- if (target) {
- break;
- }
- }
- }
- return target;
- };
- /**
- * 清空选择项
- */
- ViewDesign.prototype.clearSelection = function () {
- // $(this.designElement).removeClass('selected');
- // // $(this.designElement).find('.selected').removeClass('selected')
- // $(this.designElement).find('.ds_mask')
- // .not('.mask_not_hide')
- // .remove();
- $$1('.studio_mask').remove();
- // $(this.designElement).find('.selected').each(function () {
- // $(this).removeClass('selected');
- // // const extHandle = Ext.get(this).component
- // // if (extHandle) {
- // // extHandle.removeCls('selected')
- // // }
- // })
- };
- /**
- * 添加遮罩层
- */
- ViewDesign.prototype.appendMaskbox = function (rect, vjsonId) {
- var that = this;
- if (vjsonId) {
- this.moduleObject.modulePage.currentComponentSelectId = vjsonId;
- }
- // = cj.hasOwnProperty("xtype") && _.findIndex(ViewHelper.canMoveCmpArr, (item) => {
- // return item === cj.xtype
- // }) >= 0
- var top = rect.top, left = rect.left, width = rect.width, height = rect.height;
- this.$mask = $$1("\n<div class=\"studio_mask\" tabindex=\"0\">\n <span style=\"display: none\">dsMain.BILL_DATE</span>\n <i class=\"fa fa-trash-o ds_del\"></i>\n <i class=\"fa fa-angle-double-up ds_parent\"></i>\n</div>");
- // ${canMove ? '<i class="fa fa-arrows"></i>' : ''}
- this.$mask.css({
- position: 'absolute',
- top: top, left: left, width: width, height: height,
- border: '2px dashed #1890ff',
- zIndex: 100,
- });
- this.$mask.appendTo(this.$overlay);
- this.$mask.on("click", ".ds_del", function (e) {
- e.stopPropagation();
- e.preventDefault();
- that.deleteComponent(vjsonId);
- });
- // 点击选中父级
- this.$mask.on('click', '.ds_parent', function (e) {
- e.stopPropagation();
- e.preventDefault();
- that.selectParent(vjsonId);
- });
- var sel = document.getElementById(vjsonId);
- var sVjosn = findInCode(this.vjson, vjsonId);
- // 限制可以拖动的组件
- if ( canMoveCmpArr.indexOf(sVjosn.xtype) >= 0) {
- var dragType = colItemCmpArr.indexOf(sVjosn.xtype) >= 0 ? "col-item" : sVjosn.xtype === 'cols' ? 'cols-container' : '';
- this.dragSource = new Ext$1.drag.Source({
- element: this.$mask[0],
- constrain: this.$overlay[0],
- listeners: {
- dragmove: this.dragmove.bind(that, this.vjson),
- dragend: this.dragend.bind(that, this.vjson)
- },
- startRect: rect,
- sourceVjson: findInCode(this.vjson, vjsonId),
- sourceVjsonId: vjsonId,
- dragType: dragType
- });
- }
- this.moduleObject.moduleEventBus.publish(EventType.ComponentSelectionChange, { id: vjsonId, from: this.name });
- };
- /**
- * 选中某个选项
- */
- ViewDesign.prototype.setSelection = function (id) {
- var _a, _b;
- if (!this.designElement) {
- return;
- }
- // 清空选中内容
- this.clearSelection();
- if (!id) {
- return;
- }
- var rect = (_b = (_a = Ext$1.get(id)) === null || _a === void 0 ? void 0 : _a.dom) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
- var position = this.getPosition({ x: rect.x, y: rect.y }, "main", "overlay");
- rect.x = position.x;
- rect.y = position.y;
- this.appendMaskbox(rect, id);
- };
- /**
- * 删除组件
- * @param id
- */
- ViewDesign.prototype.deleteComponent = function (id) {
- deletVjsonById(this.vjson, id);
- this.moduleObject.modulePage.currentComponentSelectId = null;
- this.setVjson();
- this.moduleObject.moduleEventBus.publish(EventType.UpdateVjson, { vjson: this.vjson, from: this.name });
- this.clearSelection();
- };
- ViewDesign.prototype.selectParent = function (id) {
- var pid = getSuperVjsonId(this.vjson, id);
- this.moduleObject.modulePage.currentComponentSelectId = pid;
- this.setSelection(pid);
- };
- // todo ====== 拖拽事件 ======
- ViewDesign.prototype.dragmove = function (node, source, info) {
- var target = this.findElByXY(info.cursor.current.x, info.cursor.current.y, source.dragType);
- if (!target) {
- return;
- }
- var rect = target.getBoundingClientRect();
- var position = this.getPosition({ x: rect.x, y: rect.y }, "main", "overlay");
- var extHandle = Ext$1.get(target).component;
- if (!extHandle) {
- return;
- }
- var direction = this.getDirection(info.cursor.current.x, info.cursor.current.y, rect, source.dragType);
- rect.x = position.x;
- rect.y = position.y;
- this.appendDirection(rect, extHandle.id, direction);
- };
- ViewDesign.prototype.dragend = function (node, source, info) {
- var target = this.findElByXY(info.cursor.current.x, info.cursor.current.y, source.dragType);
- if (!target) {
- return;
- }
- var rect = target.getBoundingClientRect();
- var extHandle = Ext$1.get(target).component;
- var direction = this.getDirection(info.cursor.current.x, info.cursor.current.y, rect, source.dragType);
- if (!extHandle) {
- return;
- }
- this.putVjosn(source.sourceVjsonId, source.sourceVjson, extHandle.id, direction, source.dragType);
- this.removeDirection();
- };
- ViewDesign.prototype.appendDirection = function (rect, vjsonId, direction) {
- var top = rect.top, left = rect.left, width = rect.width, height = rect.height;
- var cv = findInCode(this.vjson, vjsonId);
- if (this.$direction) {
- $$1('#direction' + this.id).remove();
- }
- // if (_.findIndex(colsContainerArr, it => it === cv.xtype) >= 0) {
- //
- // } else if (_.findIndex(colItemCmpArr, it => it === cv.xtype) >= 0) {
- if (direction) {
- if (direction === "top") {
- // direction = 'center'
- height = height / 4;
- }
- else if (direction === "bottom") {
- // direction = 'center'
- top = top + height / 4 * 3;
- height = height / 4;
- }
- else if (direction === "left") {
- width = width / 4;
- }
- else if (direction === "right") {
- left = left + width / 4 * 3;
- width = width / 4;
- }
- this.$direction = $$1("<div id='direction" + this.id + "'>");
- this.$direction.css({
- position: 'absolute',
- top: top, left: left, width: width, height: height,
- // border: '2px dashed #1890ff',
- background: 'rgba(40,224,218,0.75)',
- zIndex: 100,
- });
- this.$direction.appendTo(this.$overlay);
- // }
- }
- };
- ViewDesign.prototype.removeDirection = function () {
- if (this.$direction) {
- this.$direction.remove();
- this.$direction = null;
- }
- };
- ViewDesign.prototype.putVjosn = function (sourceVjId, sourceVjson, targetVjId, direction, dragType) {
- var arrS;
- if (sourceVjId) {
- arrS = findArrayContainer(this.vjson, sourceVjId);
- sourceVjson = _$1.cloneDeep(findInCode(this.vjson, sourceVjId));
- var indexS = _$1.findIndex(arrS, function (v) {
- return v.id === sourceVjId;
- });
- if (indexS < 0) {
- return;
- }
- }
- delete sourceVjson.id;
- var vjsonT = findInCode(this.vjson, targetVjId);
- var arrT = findArrayContainer(this.vjson, targetVjId);
- var indexT = _$1.findIndex(arrT, function (v) {
- return v.id === targetVjId;
- });
- if (indexT < 0) {
- return;
- }
- switch (direction) {
- case 'top':
- case 'left':
- if ((dragType === "col-item" && colsContainerArr.indexOf(vjsonT.xtype) >= 0)
- || (dragType === "row-item" && rowsContainerArr.indexOf(vjsonT.xtype) >= 0)) {
- vjsonT.items.splice(0, 0, sourceVjson);
- }
- else {
- arrT.splice(indexT, 0, sourceVjson);
- }
- break;
- case 'bottom':
- case 'right':
- if ((dragType === "col-item" && colsContainerArr.indexOf(vjsonT.xtype) >= 0)
- || (dragType === "row-item" && rowsContainerArr.indexOf(vjsonT.xtype) >= 0)) {
- vjsonT.items.push(sourceVjson);
- }
- else {
- arrT.splice(indexT + 1, 0, sourceVjson);
- }
- break;
- case 'center':
- if ((dragType === "col-item" && colsContainerArr.indexOf(vjsonT.xtype) >= 0)
- || (dragType === "row-item" && rowsContainerArr.indexOf(vjsonT.xtype) >= 0)) {
- vjsonT.items.push(sourceVjson);
- }
- else {
- arrT.splice(indexT, 1, sourceVjson);
- }
- break;
- }
- if (sourceVjId) {
- deletVjsonById(this.vjson, sourceVjId);
- sourceVjson.id = sourceVjId;
- }
- this.moduleObject.moduleEventBus.publish(EventType.UpdateVjson, { vjson: this.vjson });
- };
- // todo ======== 事件 ==========
- // 接收 postMessage 事件分发
- ViewDesign.prototype.onMessageEvent = function (event) {
- var _a, _b;
- var fucName = (_a = event === null || event === void 0 ? void 0 : event.data) === null || _a === void 0 ? void 0 : _a.method;
- if (fucName && typeof this[fucName] === 'function') {
- this[fucName](((_b = event === null || event === void 0 ? void 0 : event.data) === null || _b === void 0 ? void 0 : _b.args) || null);
- }
- };
- // 接收外部选中组件事件
- ViewDesign.prototype.onComponentSelectionChange = function (id, from) {
- if (from !== this.name) {
- this.setSelection(id);
- }
- };
- // 接收外部组件删除事件
- ViewDesign.prototype.onComponentDelete = function (id, from) {
- if (from !== this.name) {
- this.deleteComponent(id);
- }
- };
- // 组件被选中
- ViewDesign.prototype.onComponentSelect = function (args) {
- if (args[2] != this.moduleId) {
- return;
- }
- if (args[0]) {
- var rect = args[0];
- var position = this.getPosition({ x: rect.x, y: rect.y }, "overlay", "main", this.$overlay[0]);
- rect.x = position.x;
- rect.y = position.y;
- this.clearSelection();
- this.appendMaskbox(rect, args[1]);
- this.moduleObject.moduleEventBus.publish(EventType.ComponentSelectionChange, { id: args[1], from: this.name });
- }
- };
- ViewDesign.prototype.onComponentInfo = function (_a) {
- var _b = __read(_a, 4), rect = _b[0], vjsonId = _b[1], moduleId = _b[2], direction = _b[3];
- if (moduleId != this.moduleId) {
- return;
- }
- if (rect) {
- var position = this.getPosition({ x: rect.x, y: rect.y }, "overlay", "main", this.$overlay[0]);
- rect.x = position.x;
- rect.y = position.y;
- var top = rect.top, left = rect.left, width = rect.width, height = rect.height;
- var cv_1 = findInCode(this.vjson, vjsonId);
- if (this.$direction) {
- $$1('#direction' + this.id).remove();
- }
- if (_$1.findIndex(colsContainerArr, function (it) { return it === cv_1.xtype; }) >= 0) ;
- else if (_$1.findIndex(colItemCmpArr, function (it) { return it === cv_1.xtype; }) >= 0) {
- if (direction) {
- if (direction === "top") {
- direction = 'center';
- //height = height/3
- }
- else if (direction === "bottom") {
- direction = 'center';
- // top=top+height/3*2
- // height = height/3
- }
- else if (direction === "left") {
- width = width / 3;
- }
- else if (direction === "right") {
- left = left + width / 3 * 2;
- width = width / 3;
- }
- this.$direction = $$1("<div id='direction" + this.id + "'>");
- this.$direction.css({
- position: 'absolute',
- top: top, left: left, width: width, height: height,
- // border: '2px dashed #1890ff',
- background: 'rgba(74,106,201,0.42)',
- zIndex: 100,
- });
- this.$direction.appendTo(this.$overlay);
- }
- }
- console.log("direction", direction);
- // const position = this.getPosition({x: rect.x, y: rect.y}, "iframe", "main", this.$overlay[0])
- // rect.x = position.x
- // rect.y = position.y
- // this.clearSelection()
- // this.appendMaskbox(rect, args[1])
- // this.moduleObject.moduleEventBus.publish(EventType.ComponentSelectionChange, {id: args[1], from: this.name})
- }
- };
- ViewDesign.prototype.onUndo = function () {
- if (this.undoVjsonList.length > 0) {
- if (this.redoVjsonList.length >= 100) {
- this.redoVjsonList.splice(0, this.redoVjsonList.length - historySize + 1);
- }
- this.redoVjsonList.push(_$1.cloneDeep(this.lastVjson));
- this.vjson = this.undoVjsonList.pop();
- // this.setVjson(this.vjson, "", false, "undo")
- this.moduleObject.moduleEventBus.publish(EventType.UpdateVjson, { vjson: this.vjson, from: "undo" });
- }
- };
- ViewDesign.prototype.onRedo = function () {
- if (this.redoVjsonList.length > 0) {
- if (this.undoVjsonList.length >= 100) {
- this.undoVjsonList.splice(0, this.undoVjsonList.length - historySize + 1);
- }
- this.undoVjsonList.push(_$1.cloneDeep(this.lastVjson));
- this.vjson = this.redoVjsonList.pop();
- // this.setVjson(this.vjson, "", false, "redo")
- this.moduleObject.moduleEventBus.publish(EventType.UpdateVjson, { vjson: this.vjson, from: "redo" });
- }
- };
- ViewDesign.prototype.onKeyPress = function (event) {
- // if ((event.ctrlKey && _.upperCase(event.key) === "Z") || (event.metaKey && (!event.shiftKey) && _.upperCase(event.key) === "Z")) {
- // if (this.backStep()) {
- // event.stopPropagation()
- // event.preventDefault()
- // return
- // }
- // }
- //
- // if ((event.ctrlKey && _.upperCase(event.key) === "Y") || (event.metaKey && event.shiftKey && _.upperCase(event.key) === "Z")) {
- // if (this.recoverStep()) {
- // event.stopPropagation()
- // event.preventDefault()
- // return
- // }
- // }
- // if (event.key === 'ArrowUp') {
- // if (this.selectParent()) {
- // event.stopPropagation()
- // event.preventDefault()
- // return;
- // }
- // }
- if (!event.ctrlKey && !event.metaKey && (event.key === "Delete" || event.key === 'Backspace')) {
- this.deleteComponent(this.moduleObject.modulePage.currentComponentSelectId);
- event.stopPropagation();
- event.preventDefault();
- return;
- }
- // if ((event.ctrlKey && _.upperCase(event.key) === "C") || (event.metaKey && _.upperCase(event.key) === "C")) {
- // if (this.copyView()) {
- // event.stopPropagation()
- // event.preventDefault()
- // return;
- // }
- // }
- // if ((event.ctrlKey && _.upperCase(event.key) === "X") || (event.metaKey && _.upperCase(event.key) === "X")) {
- // if (this.copyView(true)) {
- // event.stopPropagation()
- // event.preventDefault()
- // return;
- // }
- // }
- //
- // if ((event.ctrlKey && _.upperCase(event.key) === "A") || (event.metaKey && _.upperCase(event.key) === "A")) {
- // if (this.selectRoot()) {
- // event.stopPropagation()
- // event.preventDefault()
- // return;
- // }
- //
- };
- ViewDesign.prototype.onCopy = function (event) {
- if (this.moduleObject.modulePage.currentComponentSelectId) {
- var copyVjson = findInCode(this.vjson, this.moduleObject.modulePage.currentComponentSelectId);
- if (copyVjson) {
- removeDesignProp(copyVjson);
- this.moduleObject.modulePage.currentCopyVjson = copyVjson;
- native.clipboardSet(YvanUI$1.json5.stringify(copyVjson, null, ' '));
- }
- }
- };
- ViewDesign.prototype.onPaste = function (event) {
- debugger;
- };
- ViewDesign.prototype.onfocus = function () {
- console.log("getCopy");
- console.log("document.activeElement", document.activeElement.id);
- // clearTimeout(this.getOuterCopyValueTimer);
- // native.clipboardRead()
- };
- ViewDesign.prototype.onMousemove = function (event) {
- var _a;
- if (document.activeElement.id === this.$overlay[0].id) {
- // console.log(event.clientX, event.clientY)
- if ((_a = this.moduleObject.modulePage.currentCopyVjson) === null || _a === void 0 ? void 0 : _a.hasOwnProperty("xtype")) {
- var position = this.getPosition({ x: event.clientX, y: event.clientY }, "main", "overlay");
- // this.iframeWindow.postMessage({
- // method: 'overlayGetInfo',
- // args: [position, this.moduleId]
- // }, '*')
- }
- }
- };
- ViewDesign.prototype.onDestroy = function () {
- window.removeEventListener('message', this.onMessageEvent.bind(this));
- for (var i = 0; i < this.subscribeList.length; i++) {
- this.subscribeList[i].cancel();
- }
- };
- // todo ======== 工具方法 ==========
- ViewDesign.prototype.getPosition = function (pos, from, to, relative) {
- if (relative === void 0) { relative = null; }
- if (from === "main" && to === "overlay") {
- var overlayRect = this.$overlay[0].getBoundingClientRect();
- var x = overlayRect.x;
- var y = overlayRect.y;
- if (relative) {
- var relativeRect = relative.getBoundingClientRect();
- console.log("main->", relativeRect.x, relativeRect.y);
- x = x - relativeRect.x;
- y = y - relativeRect.y;
- }
- pos.x = pos.x - x;
- pos.y = pos.y - y;
- }
- else if (from === "overlay" && to === "main") {
- var overlayRect = this.$overlay[0].getBoundingClientRect();
- var x = overlayRect.x;
- var y = overlayRect.y;
- if (relative) {
- var relativeRect = relative.getBoundingClientRect();
- console.log("iframe->", relativeRect.x, relativeRect.y);
- x = x - relativeRect.x;
- y = y - relativeRect.y;
- }
- pos.x = pos.x + x;
- pos.y = pos.y + y;
- }
- return pos;
- };
- ViewDesign.prototype.getDirection = function (x, y, rect, dragType) {
- if (x > rect.x + rect.width / 3 && x < rect.x + (rect.width / 3 * 2)
- && y > rect.y + rect.height / 3 && y < rect.y + (rect.height / 3 * 2)) {
- return "center";
- }
- // col-item 只能放左右
- if (dragType === "col-item" || dragType === "") {
- if (y > rect.y + rect.height / 4 && y < rect.y + (rect.height / 4 * 3)) {
- if (x > rect.x && x < rect.x + rect.width / 3) {
- return "left";
- }
- else if (x < rect.x + rect.width && x > rect.x + (rect.width / 3 * 2)) {
- return "right";
- }
- }
- }
- // cols-container 只能放上下
- if (dragType === "cols-container" || dragType === "") {
- if (x > rect.x + rect.width / 4 && x < rect.x + (rect.width / 4 * 3)) {
- if (y > rect.y && y < rect.y + rect.height / 3) {
- return "top";
- }
- else if (y < rect.y + rect.height && y > rect.y + (rect.height / 3 * 2)) {
- return "bottom";
- }
- }
- }
- return "";
- };
- return ViewDesign;
- }());
- //
- //# sourceMappingURL=ViewDesign.js.map
- var model$8 = {
- data: {
- iframeSrc: ''
- }
- };
- //# sourceMappingURL=ModulePage.model.js.map
- var vjson$8 = {
- layout: 'fit',
- border: false,
- iconCls: 'x-fa fa-newspaper-o',
- referenceHolder: true,
- items: [
- {
- layout: 'border',
- border: false,
- items: [
- {
- region: 'center',
- xtype: 'tabpanel',
- border: false,
- tabPosition: 'bottom',
- reference: 'tabPanel',
- listeners: {
- tabchange: 'scope.tabchange'
- },
- defaults: {
- border: false,
- },
- items: [
- {
- title: 'controller.js',
- xtype: 'jseditor',
- reference: 'controllerEditor',
- },
- {
- title: 'view.design',
- xtype: 'designer',
- reference: 'designer',
- listeners: {
- afterrender: 'scope.previewRender'
- },
- },
- {
- title: 'view.js',
- xtype: 'jseditor',
- reference: 'viewEditor',
- },
- {
- title: 'model.js',
- xtype: 'jseditor',
- reference: 'modelEditor',
- },
- {
- title: 'groovy',
- xtype: 'groovyeditor',
- reference: 'groovyEditor',
- },
- {
- title: 'SQL',
- xtype: 'sqleditor',
- reference: 'sqlEditor',
- }
- ]
- }
- ]
- }
- ]
- };
- //# sourceMappingURL=ModulePage.view.js.map
- var ModulePage = /** @class */ (function (_super) {
- __extends(ModulePage, _super);
- function ModulePage(moduleId, module) {
- var _this = _super.call(this, { model: model$8, vjson: vjson$8 }) || this;
- _this.name = "ModulePage";
- _this.viewDesign = null;
- _this.maxViewId = 0;
- _this.moduleEventBus = new EventBus();
- _this.codeChange = _$2.debounce(function (code, from, e) {
- try {
- switch (from) {
- case _this.refs.controllerEditor.name:
- moduleStore.updateJsController(_this.moduleId, code, from);
- break;
- case _this.refs.viewEditor.name:
- moduleStore.updateJsView(_this.moduleId, code, from);
- break;
- case _this.refs.modelEditor.name:
- moduleStore.updateJsModel(_this.moduleId, code, from);
- break;
- case _this.refs.groovyEditor.name:
- moduleStore.updateGroovy(_this.moduleId, code, from);
- break;
- case _this.refs.sqlEditor.name:
- moduleStore.updateMybatis(_this.moduleId, code, from);
- break;
- }
- }
- catch (e) {
- }
- }, 500, { maxWait: 10000 });
- _this.moduleId = moduleId;
- _this.module = module;
- _this.cancelSubscribe = [];
- _this.cancelSubscribe.push(_this.moduleEventBus.subscribe(EventType.ModuleItemChange, function (moduleItem) {
- _this.initEditor(moduleItem);
- }));
- _this.cancelSubscribe.push(_this.moduleEventBus.subscribe(EventType.SetVjson, function (_a) {
- var vjson = _a.vjson, from = _a.from, ignoreRenderUI = _a.ignoreRenderUI;
- _this.previewReRender();
- }));
- _this.cancelSubscribe.push(_this.moduleEventBus.subscribe(EventType.UpdateVjson, function (_a) {
- var vjson = _a.vjson, from = _a.from, ignoreRenderUI = _a.ignoreRenderUI;
- _this.updateVjson(vjson, from, ignoreRenderUI);
- }));
- _this.cancelSubscribe.push(_this.moduleEventBus.subscribe(EventType.UpdateComponentVjson, function (_a) {
- var cmpVjson = _a.cmpVjson, from = _a.from, ignoreRenderUI = _a.ignoreRenderUI;
- _this.updateComponentVjson(cmpVjson, from, ignoreRenderUI);
- }));
- _this.cancelSubscribe.push(_this.moduleEventBus.subscribe(EventType.ComponentSelectionChange, function (_a) {
- var id = _a.id, from = _a.from;
- _this.onComponentSelectionChange(id, from);
- }));
- _this.cancelSubscribe.push(_this.moduleEventBus.subscribe(EventType.Undo, function () {
- _this.onUndo();
- }));
- _this.cancelSubscribe.push(_this.moduleEventBus.subscribe(EventType.Redo, function () {
- _this.onRedo();
- }));
- _this.cancelSubscribe.push(eventBus.subscribe(EventType.ClipboardRead, function (value) {
- _this.currentCopyVjson = stringToJsonObj(value);
- }));
- return _this;
- }
- ModulePage.prototype.onLoad = function () {
- var _this = this;
- // this.refs.preview.src = href
- // eventBus.subscribe(EventType.SetVjson, ({vjson, from, ignoreRenderUI}) => this.setVjson(vjson, from, ignoreRenderUI));
- this.cancelSubscribe.push(eventBus.subscribe(EventType.SaveCall, function () {
- _this.saveCall();
- }));
- this.activeEditor = this.refs.controllerEditor;
- this.refs.controllerEditor.modulePage = this;
- this.refs.viewEditor.modulePage = this;
- this.refs.modelEditor.modulePage = this;
- this.refs.groovyEditor.modulePage = this;
- this.refs.sqlEditor.modulePage = this;
- this.refs.controllerEditor.name = "controllerEditor";
- this.refs.viewEditor.name = "viewEditor";
- this.refs.modelEditor.name = "modelEditor";
- this.refs.groovyEditor.name = "groovyEditor";
- this.refs.sqlEditor.name = "sqlEditor";
- this.refs.controllerEditor.codeChange = this.codeChange;
- this.refs.viewEditor.codeChange = this.codeChange;
- this.refs.modelEditor.codeChange = this.codeChange;
- this.refs.groovyEditor.codeChange = this.codeChange;
- this.refs.sqlEditor.codeChange = this.codeChange;
- };
- ModulePage.prototype.updateComponentVjson = function (cmpVjson, from, ignoreRenderUI) {
- if (!cmpVjson || from === this.name) {
- return;
- }
- var vj = moduleStore.getModuleObject(this.moduleId).moduleObj.vjson;
- replaceVjsonById(vj, cmpVjson);
- this.updateVjson(vj, from, ignoreRenderUI);
- };
- ModulePage.prototype.updateVjson = function (vjson, from, ignoreRenderUI) {
- var _this = this;
- var _a, _b;
- if (!vjson || from === this.name) {
- return;
- }
- this.addViewId(vjson);
- moduleStore.getModuleObject(this.moduleId).moduleObj.vjson = vjson;
- moduleStore.getModuleObject(this.moduleId).fileContent.jsView = vjsonTojsView(vjson);
- (_a = this.refs.viewEditor) === null || _a === void 0 ? void 0 : _a.setCode((_b = moduleStore.getModuleObject(this.moduleId).fileContent) === null || _b === void 0 ? void 0 : _b.jsView);
- this.previewReRender();
- _$2.defer(function () {
- _this.moduleEventBus.publish(EventType.SetVjson, { vjson: vjson, from: from });
- });
- };
- ModulePage.prototype.previewRender = function (sender) {
- var _this = this;
- var vjson = moduleStore.getModuleObject(this.moduleId).moduleObj.vjson;
- if (!this.designScope) {
- this.designScope = new Scope({
- vjson: vjson,
- model: {
- data: {}
- }
- });
- }
- else {
- this.designScope.vjson = vjson;
- }
- this.designScope.showDesigner(sender, {
- moduleId: this.moduleId,
- });
- if (this.viewDesign) {
- return;
- }
- _$2.defer(function () {
- _this.viewDesign = new ViewDesign(_this.moduleId, _this.refs.designer);
- handles$1.mainWindow.setLoading(false);
- });
- };
- ModulePage.prototype.previewReRender = function () {
- var designer = this.refs.designer;
- this.previewRender(designer);
- };
- ModulePage.prototype.initEditor = function (moduleItem) {
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
- if (!(moduleItem === null || moduleItem === void 0 ? void 0 : moduleItem.fileContent))
- return;
- (_a = this.refs.controllerEditor) === null || _a === void 0 ? void 0 : _a.setCode((_b = moduleItem === null || moduleItem === void 0 ? void 0 : moduleItem.fileContent) === null || _b === void 0 ? void 0 : _b.jsController);
- (_c = this.refs.viewEditor) === null || _c === void 0 ? void 0 : _c.setCode((_d = moduleItem === null || moduleItem === void 0 ? void 0 : moduleItem.fileContent) === null || _d === void 0 ? void 0 : _d.jsView);
- (_e = this.refs.modelEditor) === null || _e === void 0 ? void 0 : _e.setCode((_f = moduleItem === null || moduleItem === void 0 ? void 0 : moduleItem.fileContent) === null || _f === void 0 ? void 0 : _f.jsModel);
- (_g = this.refs.groovyEditor) === null || _g === void 0 ? void 0 : _g.setCode((_h = moduleItem === null || moduleItem === void 0 ? void 0 : moduleItem.fileContent) === null || _h === void 0 ? void 0 : _h.groovy);
- (_j = this.refs.sqlEditor) === null || _j === void 0 ? void 0 : _j.setCode((_k = moduleItem === null || moduleItem === void 0 ? void 0 : moduleItem.fileContent) === null || _k === void 0 ? void 0 : _k.mybatis);
- };
- ModulePage.prototype.onComponentSelectionChange = function (id, from) {
- this.currentComponentSelectId = id;
- };
- ModulePage.prototype.onUndo = function () {
- if (this.activeEditor === this.refs.designer && this.viewDesign) {
- this.viewDesign.onUndo();
- }
- };
- ModulePage.prototype.onRedo = function () {
- if (this.activeEditor === this.refs.designer && this.viewDesign) {
- this.viewDesign.onRedo();
- }
- };
- ModulePage.prototype.tabchange = function (tabPanel, newCard, oldCard, eOpts) {
- this.activeEditor = newCard;
- eventBus.publish(EventType.ModuleTabChange, { newCard: newCard, oldCard: oldCard, eOpts: eOpts });
- };
- ModulePage.prototype.saveCall = function () {
- if (this.activeEditor === this.refs.designer || this.activeEditor === this.refs.viewEditor) {
- moduleStore.saveFile(this.moduleId, "jsView");
- }
- else if (this.activeEditor === this.refs.controllerEditor) {
- moduleStore.saveFile(this.moduleId, "jsController");
- }
- else if (this.activeEditor === this.refs.modelEditor) {
- moduleStore.saveFile(this.moduleId, "jsModel");
- }
- else if (this.activeEditor === this.refs.groovyEditor) {
- moduleStore.saveFile(this.moduleId, "groovy");
- }
- else if (this.activeEditor === this.refs.sqlEditor) {
- moduleStore.saveFile(this.moduleId, "mybatis");
- }
- };
- ModulePage.prototype.check = function () {
- moduleStore.check(this.moduleId);
- };
- /**
- * 为vjson添加id
- * @param vjson
- * @param isAll
- */
- ModulePage.prototype.addViewId = function (vjson, isAll) {
- var _this = this;
- if (isAll === void 0) { isAll = false; }
- var maxIdTag = 0;
- // 先提取当前的最大id
- deepTravVJson(vjson, function (obj) {
- if (Array.isArray(obj) || !obj || (!obj.xtype && !obj.layout)) {
- return;
- }
- if (obj.id && obj.id.indexOf(idPrefix)) {
- var sutr = obj.id.substring(obj.id.indexOf(idPrefix));
- if (sutr.length > 0) {
- var tid = sutr.replace(idPrefix, "");
- var idNum = parseInt(tid);
- if (idNum && maxIdTag < idNum) {
- maxIdTag = idNum;
- }
- }
- }
- });
- // 标记最大的id号,避免重复
- this.maxViewId = maxIdTag;
- deepTravVJson(vjson, function (obj) {
- if (Array.isArray(obj) || !obj || (!obj.xtype && !obj.layout)) {
- return;
- }
- if (!obj.hasOwnProperty('id')) {
- obj.id = _this.createViewId();
- }
- if (!obj.hasOwnProperty('designMode')) {
- obj.designMode = true;
- }
- // if (obj.xtype == "tabview" && obj.activeTab) {
- // // 设置默认的选项
- // if (obj.activeTab && !this._tabViewSelect.hasOwnProperty(obj.id)) {
- // if (typeof obj.activeTab === 'number') {
- // this._tabViewSelect[obj.id] = obj.items[obj.activeTab].id
- // } else if (typeof obj.activeTab === 'string') {
- // this._tabViewSelect[obj.id] = obj.activeTab
- // }
- //
- // }
- // }
- if (isAll && obj.hasOwnProperty("view")) ;
- });
- return vjson;
- };
- /**
- * 为组件创建 ID
- */
- ModulePage.prototype.createViewId = function () {
- this.maxViewId++;
- return this.id + idPrefix + this.maxViewId;
- };
- ModulePage.prototype.onDestroy = function () {
- for (var i = 0; i < this.cancelSubscribe.length; i++) {
- this.cancelSubscribe[i].cancel();
- }
- _super.prototype.onDestroy.call(this);
- };
- return ModulePage;
- }(Scope));
- //# sourceMappingURL=ModulePage.js.map
- var camundaModdleDescriptor = {
- "name": "Camunda",
- "uri": "http://camunda.org/schema/1.0/bpmn",
- "prefix": "camunda",
- "xml": {
- "tagAlias": "lowerCase"
- },
- "associations": [],
- "types": [
- {
- "name": "Definitions",
- "isAbstract": true,
- "extends": [
- "bpmn:Definitions"
- ],
- "properties": [
- {
- "name": "diagramRelationId",
- "isAttr": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "InOutBinding",
- "superClass": [
- "Element"
- ],
- "isAbstract": true,
- "properties": [
- {
- "name": "source",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "sourceExpression",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "target",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "businessKey",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "local",
- "isAttr": true,
- "type": "Boolean",
- "default": false
- },
- {
- "name": "variables",
- "isAttr": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "In",
- "superClass": [
- "InOutBinding"
- ],
- "meta": {
- "allowedIn": [
- "bpmn:CallActivity",
- "bpmn:SignalEventDefinition"
- ]
- }
- },
- {
- "name": "Out",
- "superClass": [
- "InOutBinding"
- ],
- "meta": {
- "allowedIn": [
- "bpmn:CallActivity"
- ]
- }
- },
- {
- "name": "AsyncCapable",
- "isAbstract": true,
- "extends": [
- "bpmn:Activity",
- "bpmn:Gateway",
- "bpmn:Event"
- ],
- "properties": [
- {
- "name": "async",
- "isAttr": true,
- "type": "Boolean",
- "default": false
- },
- {
- "name": "asyncBefore",
- "isAttr": true,
- "type": "Boolean",
- "default": false
- },
- {
- "name": "asyncAfter",
- "isAttr": true,
- "type": "Boolean",
- "default": false
- },
- {
- "name": "exclusive",
- "isAttr": true,
- "type": "Boolean",
- "default": true
- }
- ]
- },
- {
- "name": "JobPriorized",
- "isAbstract": true,
- "extends": [
- "bpmn:Process",
- "camunda:AsyncCapable"
- ],
- "properties": [
- {
- "name": "jobPriority",
- "isAttr": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "SignalEventDefinitionExtension",
- "isAbstract": true,
- "extends": [
- "bpmn:SignalEventDefinition"
- ],
- "properties": [
- {
- "name": "async",
- "isAttr": true,
- "type": "Boolean",
- "default": false
- }
- ]
- },
- {
- "name": "ErrorEventDefinitionExtension",
- "isAbstract": true,
- "extends": [
- "bpmn:ErrorEventDefinition"
- ],
- "properties": [
- {
- "name": "errorCodeVariable",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "errorMessageVariable",
- "isAttr": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "ErrorEventDefinition",
- "superClass": [
- "bpmn:ErrorEventDefinition",
- "Element"
- ],
- "properties": [
- {
- "name": "expression",
- "isAttr": true,
- "type": "String"
- }
- ],
- "meta": {
- "allowedIn": ["bpmn:ServiceTask"]
- }
- },
- {
- "name": "Error",
- "isAbstract": true,
- "extends": [
- "bpmn:Error"
- ],
- "properties": [
- {
- "name": "camunda:errorMessage",
- "isAttr": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "PotentialStarter",
- "superClass": [
- "Element"
- ],
- "properties": [
- {
- "name": "resourceAssignmentExpression",
- "type": "bpmn:ResourceAssignmentExpression"
- }
- ]
- },
- {
- "name": "FormSupported",
- "isAbstract": true,
- "extends": [
- "bpmn:StartEvent",
- "bpmn:UserTask"
- ],
- "properties": [
- {
- "name": "formHandlerClass",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "formKey",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "formRef",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "formRefBinding",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "formRefVersion",
- "isAttr": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "TemplateSupported",
- "isAbstract": true,
- "extends": [
- "bpmn:Collaboration",
- "bpmn:Process",
- "bpmn:FlowElement"
- ],
- "properties": [
- {
- "name": "modelerTemplate",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "modelerTemplateVersion",
- "isAttr": true,
- "type": "Integer"
- }
- ]
- },
- {
- "name": "Initiator",
- "isAbstract": true,
- "extends": ["bpmn:StartEvent"],
- "properties": [
- {
- "name": "initiator",
- "isAttr": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "ScriptTask",
- "isAbstract": true,
- "extends": [
- "bpmn:ScriptTask"
- ],
- "properties": [
- {
- "name": "resultVariable",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "resource",
- "isAttr": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "Process",
- "isAbstract": true,
- "extends": [
- "bpmn:Process"
- ],
- "properties": [
- {
- "name": "candidateStarterGroups",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "candidateStarterUsers",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "versionTag",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "historyTimeToLive",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "isStartableInTasklist",
- "isAttr": true,
- "type": "Boolean",
- "default": true
- }
- ]
- },
- {
- "name": "EscalationEventDefinitionExtension",
- "isAbstract": true,
- "extends": [
- "bpmn:EscalationEventDefinition"
- ],
- "properties": [
- {
- "name": "escalationCodeVariable",
- "isAttr": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "FormalExpression",
- "isAbstract": true,
- "extends": [
- "bpmn:FormalExpression"
- ],
- "properties": [
- {
- "name": "resource",
- "isAttr": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "Assignable",
- "extends": ["bpmn:UserTask"],
- "properties": [
- {
- "name": "assignee",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "candidateUsers",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "candidateGroups",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "dueDate",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "followUpDate",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "priority",
- "isAttr": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "CallActivity",
- "extends": ["bpmn:CallActivity"],
- "properties": [
- {
- "name": "calledElementBinding",
- "isAttr": true,
- "type": "String",
- "default": "latest"
- },
- {
- "name": "calledElementVersion",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "calledElementVersionTag",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "calledElementTenantId",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "caseRef",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "caseBinding",
- "isAttr": true,
- "type": "String",
- "default": "latest"
- },
- {
- "name": "caseVersion",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "caseTenantId",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "variableMappingClass",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "variableMappingDelegateExpression",
- "isAttr": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "ServiceTaskLike",
- "extends": [
- "bpmn:ServiceTask",
- "bpmn:BusinessRuleTask",
- "bpmn:SendTask",
- "bpmn:MessageEventDefinition"
- ],
- "properties": [
- {
- "name": "expression",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "class",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "delegateExpression",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "resultVariable",
- "isAttr": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "DmnCapable",
- "extends": [
- "bpmn:BusinessRuleTask"
- ],
- "properties": [
- {
- "name": "decisionRef",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "decisionRefBinding",
- "isAttr": true,
- "type": "String",
- "default": "latest"
- },
- {
- "name": "decisionRefVersion",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "mapDecisionResult",
- "isAttr": true,
- "type": "String",
- "default": "resultList"
- },
- {
- "name": "decisionRefTenantId",
- "isAttr": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "ExternalCapable",
- "extends": [
- "camunda:ServiceTaskLike"
- ],
- "properties": [
- {
- "name": "type",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "topic",
- "isAttr": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "TaskPriorized",
- "extends": [
- "bpmn:Process",
- "camunda:ExternalCapable"
- ],
- "properties": [
- {
- "name": "taskPriority",
- "isAttr": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "Properties",
- "superClass": [
- "Element"
- ],
- "meta": {
- "allowedIn": ["*"]
- },
- "properties": [
- {
- "name": "values",
- "type": "Property",
- "isMany": true
- }
- ]
- },
- {
- "name": "Property",
- "superClass": [
- "Element"
- ],
- "properties": [
- {
- "name": "id",
- "type": "String",
- "isAttr": true
- },
- {
- "name": "name",
- "type": "String",
- "isAttr": true
- },
- {
- "name": "value",
- "type": "String",
- "isAttr": true
- }
- ]
- },
- {
- "name": "Connector",
- "superClass": [
- "Element"
- ],
- "meta": {
- "allowedIn": [
- "camunda:ServiceTaskLike"
- ]
- },
- "properties": [
- {
- "name": "inputOutput",
- "type": "InputOutput"
- },
- {
- "name": "connectorId",
- "type": "String"
- }
- ]
- },
- {
- "name": "InputOutput",
- "superClass": [
- "Element"
- ],
- "meta": {
- "allowedIn": [
- "bpmn:FlowNode",
- "camunda:Connector"
- ]
- },
- "properties": [
- {
- "name": "inputOutput",
- "type": "InputOutput"
- },
- {
- "name": "connectorId",
- "type": "String"
- },
- {
- "name": "inputParameters",
- "isMany": true,
- "type": "InputParameter"
- },
- {
- "name": "outputParameters",
- "isMany": true,
- "type": "OutputParameter"
- }
- ]
- },
- {
- "name": "InputOutputParameter",
- "properties": [
- {
- "name": "name",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "value",
- "isBody": true,
- "type": "String"
- },
- {
- "name": "definition",
- "type": "InputOutputParameterDefinition"
- }
- ]
- },
- {
- "name": "InputOutputParameterDefinition",
- "isAbstract": true
- },
- {
- "name": "List",
- "superClass": ["InputOutputParameterDefinition"],
- "properties": [
- {
- "name": "items",
- "isMany": true,
- "type": "InputOutputParameterDefinition"
- }
- ]
- },
- {
- "name": "Map",
- "superClass": ["InputOutputParameterDefinition"],
- "properties": [
- {
- "name": "entries",
- "isMany": true,
- "type": "Entry"
- }
- ]
- },
- {
- "name": "Entry",
- "properties": [
- {
- "name": "key",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "value",
- "isBody": true,
- "type": "String"
- },
- {
- "name": "definition",
- "type": "InputOutputParameterDefinition"
- }
- ]
- },
- {
- "name": "Value",
- "superClass": [
- "InputOutputParameterDefinition"
- ],
- "properties": [
- {
- "name": "id",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "name",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "value",
- "isBody": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "Script",
- "superClass": ["InputOutputParameterDefinition"],
- "properties": [
- {
- "name": "scriptFormat",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "resource",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "value",
- "isBody": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "Field",
- "superClass": ["Element"],
- "meta": {
- "allowedIn": [
- "camunda:ServiceTaskLike",
- "camunda:ExecutionListener",
- "camunda:TaskListener"
- ]
- },
- "properties": [
- {
- "name": "name",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "expression",
- "type": "String"
- },
- {
- "name": "stringValue",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "string",
- "type": "String"
- }
- ]
- },
- {
- "name": "InputParameter",
- "superClass": ["InputOutputParameter"]
- },
- {
- "name": "OutputParameter",
- "superClass": ["InputOutputParameter"]
- },
- {
- "name": "Collectable",
- "isAbstract": true,
- "extends": ["bpmn:MultiInstanceLoopCharacteristics"],
- "superClass": ["camunda:AsyncCapable"],
- "properties": [
- {
- "name": "collection",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "elementVariable",
- "isAttr": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "FailedJobRetryTimeCycle",
- "superClass": ["Element"],
- "meta": {
- "allowedIn": [
- "camunda:AsyncCapable",
- "bpmn:MultiInstanceLoopCharacteristics"
- ]
- },
- "properties": [
- {
- "name": "body",
- "isBody": true,
- "type": "String"
- }
- ]
- },
- {
- "name": "ExecutionListener",
- "superClass": ["Element"],
- "meta": {
- "allowedIn": [
- "bpmn:Task",
- "bpmn:ServiceTask",
- "bpmn:UserTask",
- "bpmn:BusinessRuleTask",
- "bpmn:ScriptTask",
- "bpmn:ReceiveTask",
- "bpmn:ManualTask",
- "bpmn:ExclusiveGateway",
- "bpmn:SequenceFlow",
- "bpmn:ParallelGateway",
- "bpmn:InclusiveGateway",
- "bpmn:EventBasedGateway",
- "bpmn:StartEvent",
- "bpmn:IntermediateCatchEvent",
- "bpmn:IntermediateThrowEvent",
- "bpmn:EndEvent",
- "bpmn:BoundaryEvent",
- "bpmn:CallActivity",
- "bpmn:SubProcess",
- "bpmn:Process"
- ]
- },
- "properties": [
- {
- "name": "expression",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "class",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "delegateExpression",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "event",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "script",
- "type": "Script"
- },
- {
- "name": "fields",
- "type": "Field",
- "isMany": true
- }
- ]
- },
- {
- "name": "TaskListener",
- "superClass": ["Element"],
- "meta": {
- "allowedIn": [
- "bpmn:UserTask"
- ]
- },
- "properties": [
- {
- "name": "expression",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "class",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "delegateExpression",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "event",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "script",
- "type": "Script"
- },
- {
- "name": "fields",
- "type": "Field",
- "isMany": true
- },
- {
- "name": "id",
- "type": "String",
- "isAttr": true
- },
- {
- "name": "eventDefinitions",
- "type": "bpmn:TimerEventDefinition",
- "isMany": true
- }
- ]
- },
- {
- "name": "FormProperty",
- "superClass": ["Element"],
- "meta": {
- "allowedIn": [
- "bpmn:StartEvent",
- "bpmn:UserTask"
- ]
- },
- "properties": [
- {
- "name": "id",
- "type": "String",
- "isAttr": true
- },
- {
- "name": "name",
- "type": "String",
- "isAttr": true
- },
- {
- "name": "type",
- "type": "String",
- "isAttr": true
- },
- {
- "name": "required",
- "type": "String",
- "isAttr": true
- },
- {
- "name": "readable",
- "type": "String",
- "isAttr": true
- },
- {
- "name": "writable",
- "type": "String",
- "isAttr": true
- },
- {
- "name": "variable",
- "type": "String",
- "isAttr": true
- },
- {
- "name": "expression",
- "type": "String",
- "isAttr": true
- },
- {
- "name": "datePattern",
- "type": "String",
- "isAttr": true
- },
- {
- "name": "default",
- "type": "String",
- "isAttr": true
- },
- {
- "name": "values",
- "type": "Value",
- "isMany": true
- }
- ]
- },
- {
- "name": "FormData",
- "superClass": ["Element"],
- "meta": {
- "allowedIn": [
- "bpmn:StartEvent",
- "bpmn:UserTask"
- ]
- },
- "properties": [
- {
- "name": "fields",
- "type": "FormField",
- "isMany": true
- },
- {
- "name": "businessKey",
- "type": "String",
- "isAttr": true
- }
- ]
- },
- {
- "name": "FormField",
- "superClass": ["Element"],
- "properties": [
- {
- "name": "id",
- "type": "String",
- "isAttr": true
- },
- {
- "name": "label",
- "type": "String",
- "isAttr": true
- },
- {
- "name": "type",
- "type": "String",
- "isAttr": true
- },
- {
- "name": "datePattern",
- "type": "String",
- "isAttr": true
- },
- {
- "name": "defaultValue",
- "type": "String",
- "isAttr": true
- },
- {
- "name": "properties",
- "type": "Properties"
- },
- {
- "name": "validation",
- "type": "Validation"
- },
- {
- "name": "values",
- "type": "Value",
- "isMany": true
- }
- ]
- },
- {
- "name": "Validation",
- "superClass": ["Element"],
- "properties": [
- {
- "name": "constraints",
- "type": "Constraint",
- "isMany": true
- }
- ]
- },
- {
- "name": "Constraint",
- "superClass": ["Element"],
- "properties": [
- {
- "name": "name",
- "type": "String",
- "isAttr": true
- },
- {
- "name": "config",
- "type": "String",
- "isAttr": true
- }
- ]
- },
- {
- "name": "ConditionalEventDefinitionExtension",
- "isAbstract": true,
- "extends": [
- "bpmn:ConditionalEventDefinition"
- ],
- "properties": [
- {
- "name": "variableName",
- "isAttr": true,
- "type": "String"
- },
- {
- "name": "variableEvents",
- "isAttr": true,
- "type": "String"
- }
- ]
- }
- ],
- "emumerations": []
- };
- //# sourceMappingURL=camundaModdleDescriptor.js.map
- /**
- * This is a sample file that should be replaced with the actual translation.
- *
- * Checkout https://github.com/bpmn-io/bpmn-js-i18n for a list of available
- * translations and labels to translate.
- */
- var translations = {
- // Labels
- 'Activate the global connect tool': '激活全局连接工具',
- 'Append {type}': '追加 {type}',
- 'Append EndEvent': '追加 结束事件 ',
- 'Append Task': '追加 任务',
- 'Append Gateway': '追加 网关',
- 'Append Intermediate/Boundary Event': '追加 中间/边界 事件',
- 'Add Lane above': '在上面添加道',
- 'Divide into two Lanes': '分割成两个道',
- 'Divide into three Lanes': '分割成三个道',
- 'Add Lane below': '在下面添加道',
- 'Append compensation activity': '追加补偿活动',
- 'Change type': '修改类型',
- 'Connect using Association': '使用关联连接',
- 'Connect using Sequence/MessageFlow or Association': '使用顺序/消息流或者关联连接',
- 'Connect using DataInputAssociation': '使用数据输入关联连接',
- 'Remove': '移除',
- 'Activate the hand tool': '激活抓手工具',
- 'Activate the lasso tool': '激活套索工具',
- 'Activate the create/remove space tool': '激活创建/删除空间工具',
- 'Create expanded SubProcess': '创建扩展子过程',
- 'Create IntermediateThrowEvent/BoundaryEvent': '创建中间抛出事件/边界事件',
- 'Create Pool/Participant': '创建池/参与者',
- 'Parallel Multi Instance': '并行多重事件',
- 'Sequential Multi Instance': '时序多重事件',
- 'DataObjectReference': '数据对象参考',
- 'DataStoreReference': '数据存储参考',
- 'Loop': '循环',
- 'Ad-hoc': '即席',
- 'Create {type}': '创建 {type}',
- 'Create Task': '创建任务',
- 'Create StartEvent': '创建开始事件',
- 'Create EndEvent': '创建结束事件',
- 'Create Group': '创建组',
- 'Task': '任务',
- 'Send Task': '发送任务',
- 'Receive Task': '接收任务',
- 'User Task': '用户任务',
- 'Manual Task': '手工任务',
- 'Business Rule Task': '业务规则任务',
- 'Service Task': '服务任务',
- 'Script Task': '脚本任务',
- 'Call Activity': '调用活动',
- 'Sub Process (collapsed)': '子流程(折叠的)',
- 'Sub Process (expanded)': '子流程(展开的)',
- 'Start Event': '开始事件',
- 'StartEvent': '开始事件',
- 'Intermediate Throw Event': '中间事件',
- 'End Event': '结束事件',
- 'EndEvent': '结束事件',
- 'Create Gateway': '创建网关',
- 'GateWay': '网关',
- 'Create Intermediate/Boundary Event': '创建中间/边界事件',
- 'Message Start Event': '消息开始事件',
- 'Timer Start Event': '定时开始事件',
- 'Conditional Start Event': '条件开始事件',
- 'Signal Start Event': '信号开始事件',
- 'Error Start Event': '错误开始事件',
- 'Escalation Start Event': '升级开始事件',
- 'Compensation Start Event': '补偿开始事件',
- 'Message Start Event (non-interrupting)': '消息开始事件(非中断)',
- 'Timer Start Event (non-interrupting)': '定时开始事件(非中断)',
- 'Conditional Start Event (non-interrupting)': '条件开始事件(非中断)',
- 'Signal Start Event (non-interrupting)': '信号开始事件(非中断)',
- 'Escalation Start Event (non-interrupting)': '升级开始事件(非中断)',
- 'Message Intermediate Catch Event': '消息中间捕获事件',
- 'Message Intermediate Throw Event': '消息中间抛出事件',
- 'Timer Intermediate Catch Event': '定时中间捕获事件',
- 'Escalation Intermediate Throw Event': '升级中间抛出事件',
- 'Conditional Intermediate Catch Event': '条件中间捕获事件',
- 'Link Intermediate Catch Event': '链接中间捕获事件',
- 'Link Intermediate Throw Event': '链接中间抛出事件',
- 'Compensation Intermediate Throw Event': '补偿中间抛出事件',
- 'Signal Intermediate Catch Event': '信号中间捕获事件',
- 'Signal Intermediate Throw Event': '信号中间抛出事件',
- 'Message End Event': '消息结束事件',
- 'Escalation End Event': '定时结束事件',
- 'Error End Event': '错误结束事件',
- 'Cancel End Event': '取消结束事件',
- 'Compensation End Event': '补偿结束事件',
- 'Signal End Event': '信号结束事件',
- 'Terminate End Event': '终止结束事件',
- 'Message Boundary Event': '消息边界事件',
- 'Message Boundary Event (non-interrupting)': '消息边界事件(非中断)',
- 'Timer Boundary Event': '定时边界事件',
- 'Timer Boundary Event (non-interrupting)': '定时边界事件(非中断)',
- 'Escalation Boundary Event': '升级边界事件',
- 'Escalation Boundary Event (non-interrupting)': '升级边界事件(非中断)',
- 'Conditional Boundary Event': '条件边界事件',
- 'Conditional Boundary Event (non-interrupting)': '条件边界事件(非中断)',
- 'Error Boundary Event': '错误边界事件',
- 'Cancel Boundary Event': '取消边界事件',
- 'Signal Boundary Event': '信号边界事件',
- 'Signal Boundary Event (non-interrupting)': '信号边界事件(非中断)',
- 'Compensation Boundary Event': '补偿边界事件',
- 'Exclusive Gateway': '互斥网关',
- 'Parallel Gateway': '并行网关',
- 'Inclusive Gateway': '相容网关',
- 'Complex Gateway': '复杂网关',
- 'Event based Gateway': '事件网关',
- 'Transaction': '转运',
- 'Sub Process': '子流程',
- 'Event Sub Process': '事件子流程',
- 'Collapsed Pool': '折叠池',
- 'Expanded Pool': '展开池',
- // Errors
- 'no parent for {element} in {parent}': '在{parent}里,{element}没有父类',
- 'no shape type specified': '没有指定的形状类型',
- 'flow elements must be children of pools/participants': '流元素必须是池/参与者的子类',
- 'out of bounds release': 'out of bounds release',
- 'more than {count} child lanes': '子道大于{count} ',
- 'element required': '元素不能为空',
- 'diagram not part of bpmn:Definitions': '流程图不符合bpmn规范',
- 'no diagram to display': '没有可展示的流程图',
- 'no process or collaboration to display': '没有可展示的流程/协作',
- 'element {element} referenced by {referenced}#{property} not yet drawn': '由{referenced}#{property}引用的{element}元素仍未绘制',
- 'already rendered {element}': '{element} 已被渲染',
- 'failed to import {element}': '导入{element}失败',
- // 属性面板的参数
- 'Id': '编号',
- 'Name': '名称',
- 'General': '常规',
- 'Details': '详情',
- 'Message Name': '消息名称',
- 'Message': '消息',
- 'Initiator': '创建者',
- 'Asynchronous Continuations': '持续异步',
- 'Asynchronous Before': '异步前',
- 'Asynchronous After': '异步后',
- 'Job Configuration': '工作配置',
- 'Exclusive': '排除',
- 'Job Priority': '工作优先级',
- 'Retry Time Cycle': '重试时间周期',
- 'Documentation': '文档',
- 'Element Documentation': '元素文档',
- 'History Configuration': '历史配置',
- 'History Time To Live': '历史的生存时间',
- 'Forms': '表单',
- 'Form Key': '表单key',
- 'Form Fields': '表单字段',
- 'Business Key': '业务key',
- 'Form Field': '表单字段',
- 'ID': '编号',
- 'Type': '类型',
- 'Label': '名称',
- 'Default Value': '默认值',
- 'Validation': '校验',
- 'Add Constraint': '添加约束',
- 'Config': '配置',
- 'Properties': '属性',
- 'Add Property': '添加属性',
- 'Value': '值',
- 'Add': '添加',
- 'Values': '值',
- 'Add Value': '添加值',
- 'Listeners': '监听器',
- 'Execution Listener': '执行监听',
- 'Event Type': '事件类型',
- 'Listener Type': '监听器类型',
- 'Java Class': 'Java类',
- 'Expression': '表达式',
- 'Must provide a value': '必须提供一个值',
- 'Delegate Expression': '代理表达式',
- 'Script': '脚本',
- 'Script Format': '脚本格式',
- 'Script Type': '脚本类型',
- 'Inline Script': '内联脚本',
- 'External Script': '外部脚本',
- 'Resource': '资源',
- 'Field Injection': '字段注入',
- 'Extensions': '扩展',
- 'Input/Output': '输入/输出',
- 'Input Parameters': '输入参数',
- 'Output Parameters': '输出参数',
- 'Parameters': '参数',
- 'Output Parameter': '输出参数',
- 'Timer Definition Type': '定时器定义类型',
- 'Timer Definition': '定时器定义',
- 'Date': '日期',
- 'Duration': '持续',
- 'Cycle': '循环',
- 'Signal': '信号',
- 'Signal Name': '信号名称',
- 'Escalation': '升级',
- 'Error': '错误',
- 'Link Name': '链接名称',
- 'Condition': '条件名称',
- 'Variable Name': '变量名称',
- 'Variable Event': '变量事件',
- 'Specify more than one variable change event as a comma separated list.': '多个变量事件以逗号隔开',
- 'Wait for Completion': '等待完成',
- 'Activity Ref': '活动参考',
- 'Version Tag': '版本标签',
- 'Executable': '可执行文件',
- 'External Task Configuration': '扩展任务配置',
- 'Task Priority': '任务优先级',
- 'External': '外部',
- 'Connector': '连接器',
- 'Must configure Connector': '必须配置连接器',
- 'Connector Id': '连接器编号',
- 'Implementation': '实现方式',
- 'Field Injections': '字段注入',
- 'Fields': '字段',
- 'Result Variable': '结果变量',
- 'Topic': '主题',
- 'Configure Connector': '配置连接器',
- 'Input Parameter': '输入参数',
- 'Assignee': '代理人',
- 'Candidate Users': '候选用户',
- 'Candidate Groups': '候选组',
- 'Due Date': '到期时间',
- 'Follow Up Date': '跟踪日期',
- 'Priority': '优先级',
- // eslint-disable-next-line no-template-curly-in-string
- 'The follow up date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)': '跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00',
- // eslint-disable-next-line no-template-curly-in-string
- 'The due date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)': '跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00',
- 'Variables': '变量',
- 'Candidate Starter Configuration': '候选开始配置',
- 'Task Listener': '任务监听器',
- 'Candidate Starter Groups': '候选开始组',
- 'Candidate Starter Users': '候选开始用户',
- 'Tasklist Configuration': '任务列表配置',
- 'Startable': '启动',
- 'Specify more than one group as a comma separated list.': '指定多个组,用逗号分隔',
- 'Specify more than one user as a comma separated list.': '指定多个用户,用逗号分隔',
- 'This maps to the process definition key.': '这会映射为流程定义的键',
- 'CallActivity Type': '调用活动类型',
- 'Condition Type': '条件类型',
- 'Create UserTask': '创建用户任务',
- 'Create CallActivity': '创建调用活动',
- 'Called Element': '调用元素',
- 'Create DataObjectReference': '创建数据对象引用',
- 'Create DataStoreReference': '创建数据存储引用',
- 'Multi Instance': '多实例',
- 'Loop Cardinality': '实例数量',
- Collection: '任务参与人列表',
- 'Element Variable': '元素变量',
- 'Completion Condition': '完成条件'
- };
- //# sourceMappingURL=translations.js.map
- function customTranslate(template, replacements) {
- replacements = replacements || {};
- // Translate
- template = translations[template] || template;
- // Replace
- return template.replace(/{([^}]+)}/g, function (_, key) {
- return replacements[key] || '{' + key + '}';
- });
- }
- //# sourceMappingURL=customTranslate.js.map
- var vjson$9 = {
- title: '导入流程',
- layout: 'fit',
- width: 400,
- height: 400,
- items: [
- {
- layout: 'border',
- items: [
- {
- xtype: 'form',
- items: [
- // {
- // xtype: 'cols',
- // items: [
- // {
- // xtype: 'textfield',
- // allowBlank: false,
- // fieldLabel: '流程名称',
- // bind: '{name}'
- // },
- // ],
- // },
- {
- xtype: 'cols',
- items: [
- {
- xtype: 'filefield',
- name: 'deployFile',
- fieldLabel: '文件名称',
- // labelWidth: '100%',
- msgTarget: 'side',
- reference: 'MOBANB_FILE',
- fileUpload: true,
- allowBlank: false,
- // flex: 1,
- // width: '100%',
- buttonText: '请选择文件位置',
- listeners: {
- change: 'scope.fileChange'
- }
- // bind: '{FILE}'
- },
- ]
- }
- ],
- region: 'center',
- split: true,
- },
- ],
- },
- ],
- fbar: {
- xtype: 'toolbar',
- items: [
- {
- xtype: 'button',
- text: '保存',
- iconCls: 'x-fa fa-save',
- listeners: {
- click: 'scope.save',
- },
- }
- ],
- },
- };
- //# sourceMappingURL=ImportBpmn.view.js.map
- var model$9 = {
- data: {
- name: '',
- file_content: ''
- }
- };
- //# sourceMappingURL=ImportBpmn.model.js.map
- var ImportBpmn = /** @class */ (function (_super) {
- __extends(ImportBpmn, _super);
- function ImportBpmn() {
- return _super.call(this, { model: model$9, vjson: vjson$9 }) || this;
- }
- ImportBpmn.prototype.onLoad = function () {
- };
- ImportBpmn.prototype.save = function (sender) {
- if (this.data.file_content) {
- this.dialogSuccess(this.data);
- }
- else {
- Ext.Msg.alert('提示', "请先上传文件");
- }
- };
- ImportBpmn.prototype.fileChange = function (e) {
- var _this = this;
- // this.data.MOBANB_FILE = e.fileInputEl.dom.files[0]
- var file = e.fileInputEl.dom.files[0]; //获取文件
- var reader = new FileReader();
- reader.readAsText(file, "UTF-8");
- reader.onload = function () {
- _this.data.file_content = reader.result;
- };
- };
- return ImportBpmn;
- }(Scope));
- //# sourceMappingURL=ImportBpmn.js.map
- var model$a = {
- data: {
- form_id: '',
- form_name: '',
- save_dir_path: '',
- absolute_path: '',
- form: {
- id: '',
- code: '',
- name: '',
- table: '',
- controller: '',
- groovy: '',
- fields: [],
- buttons: [],
- },
- }
- };
- //# sourceMappingURL=ConfigStrategy.model.js.map
- var vjson$a = {
- title: '配置适配策略',
- layout: 'fit',
- items: [
- {
- layout: 'border',
- items: [
- {
- region: 'center',
- xtype: 'yvgrid',
- pagination: false,
- hideFootbar: true,
- plugins: {
- clipboard: true,
- selectionreplicator: true
- },
- tbar: {
- xtype: 'toolbar',
- items: [
- {
- xtype: 'button',
- text: '添加策略',
- iconCls: 'x-fa fa-plus-circle',
- listeners: {
- click: 'scope.addStrategy'
- }
- },
- {
- xtype: 'button',
- text: '删除',
- iconCls: 'x-fa fa-minus-circle',
- listeners: {}
- },
- '-',
- {
- xtype: 'button',
- text: '上移',
- iconCls: 'x-fa fa-arrow-up',
- listeners: {}
- },
- {
- xtype: 'button',
- text: '下移',
- iconCls: 'x-fa fa-arrow-down',
- listeners: {}
- },
- ]
- },
- columns: [
- { xtype: 'rownumberer' },
- {
- header: '优先级',
- dataIndex: 'priority',
- width: 140,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: true
- },
- },
- {
- header: '策略编号',
- dataIndex: 'strategy_code',
- width: 140,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: true
- },
- },
- {
- header: '策略名称',
- dataIndex: 'strategy_name',
- width: 140,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: true
- },
- },
- {
- header: "条件表达式",
- dataIndex: "strategy_exp",
- },
- ],
- },
- {
- title: '适配条件',
- region: 'south',
- height: '50%',
- xtype: 'form',
- items: [
- {
- xtype: 'cols',
- items: [
- {
- xtype: 'rows',
- items: [
- {
- xtype: 'textfield',
- fieldLabel: "仓库",
- },
- {
- xtype: 'textfield',
- fieldLabel: "货主",
- },
- {
- xtype: 'textfield',
- fieldLabel: "项目",
- },
- {
- xtype: 'textfield',
- fieldLabel: "行政区划",
- },
- {
- xtype: 'textfield',
- fieldLabel: "客户",
- },
- {
- xtype: 'textfield',
- fieldLabel: "商品",
- }
- ]
- },
- {
- xtype: 'rows',
- margin: '8 0 0 10',
- items: [
- {
- xtype: 'label',
- html: '自定义表达式',
- },
- {
- xtype: 'textarea',
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- };
- //
- //# sourceMappingURL=ConfigStrategy.view.js.map
- // import {parseDynamicSqlApi, reportByIdApi, saveReportApi} from "../utils/Request";
- // import {getColumnByTableNameColumnName, reloadIfNeedPromise} from "../database/DbTreeStore";
- // import ReportRunner from "./ReportRunner";
- var ConfigStrategy = /** @class */ (function (_super) {
- __extends(ConfigStrategy, _super);
- function ConfigStrategy() {
- return _super.call(this, { model: model$a, vjson: vjson$a }) || this;
- }
- ConfigStrategy.prototype.onLoad = function () {
- this.load();
- };
- ConfigStrategy.prototype.load = function () {
- var _this = this;
- var form_id = this.viewModel.get("form_id");
- var absolute_path = this.viewModel.get("absolute_path");
- var save_dir_path = this.viewModel.get("save_dir_path");
- if (absolute_path && form_id) {
- this.setLoading(true);
- readDevForm({ absolute_path: absolute_path, form_id: form_id }).then(function (res) {
- if (res.success) {
- // 基础属性
- _this.viewModel.set('form', res.data.form);
- // 字段定义
- _this.refs.gridColumn.getStore().add(_this.viewModel.get('form.fields'));
- // 按钮
- _this.refs.gridButton.getStore().add(_this.viewModel.get('form.buttons'));
- }
- }).finally(function () {
- _this.setLoading(false);
- });
- }
- };
- ConfigStrategy.prototype.saveAll = function () {
- var _this = this;
- var save_dir_path = this.viewModel.get("save_dir_path");
- if (!save_dir_path) {
- msg("save_dir_path error");
- return;
- }
- var form_id = this.viewModel.get("form_id");
- var absolute_path = this.viewModel.get("absolute_path");
- // 表格校验
- if (!this.refs.form1.isValid()) {
- msg("请检查表单必填项!");
- return;
- }
- // 字段数据
- var gridColumnRows = this.refs.gridColumn.getDataRows().map(function (item) {
- delete item.id;
- if (item.hide) {
- delete item.hide_text;
- }
- else {
- item.hide = item.hide_text;
- delete item.hide_text;
- }
- if (item.readonly) {
- delete item.readonly_text;
- }
- else {
- item.readonly = item.readonly_text;
- delete item.readonly_text;
- }
- if (item.disabled) {
- delete item.disabled_text;
- }
- else {
- item.disabled = item.disabled_text;
- delete item.disabled_text;
- }
- if (item.required) {
- delete item.required_text;
- }
- else {
- item.required = item.required_text;
- delete item.required_text;
- }
- return item;
- });
- this.viewModel.set("form.fields", gridColumnRows);
- // 按钮数据
- var gridBtnRows = this.refs.gridButton.getDataRows().map(function (item) {
- delete item.id;
- return item;
- });
- this.viewModel.set("form.buttons", gridBtnRows);
- // 查询条件
- // 策略
- var form = this.viewModel.get("form");
- this.setLoading(true);
- createDevForm({ save_dir_path: save_dir_path, absolute_path: absolute_path, form_id: form_id, form: form }).then(function (res) {
- if (res.success) {
- msg('保存成功');
- handles$1.mainWindow.refs['exporerTree'].reload();
- }
- }).finally(function () {
- _this.setLoading(false);
- });
- };
- ConfigStrategy.prototype.addColumn = function () {
- this.refs.gridColumn.getStore().add({});
- };
- ConfigStrategy.prototype.removeColumn = function () {
- this.refs.gridColumn.getStore().remove(this.refs.gridColumn.getSelection());
- };
- ConfigStrategy.prototype.calcColumn = function (sender) {
- var _this = this;
- var table = this.viewModel.get("form.table");
- if (!table) {
- msg("表名不存在!");
- return;
- }
- this.setLoading(true);
- calcColumnForm({ table: table }).then(function (res) {
- if (res.success) {
- msg(res.msg);
- if (res.data.columns.length > 0) {
- _$2.forEach(res.data.columns, function (it) {
- _this.refs.gridColumn.getStore().add({ column_desc: it.columnComment, column_name: it.columnName });
- });
- }
- }
- }).finally(function () {
- _this.setLoading(false);
- });
- };
- ConfigStrategy.prototype.addButton = function () {
- this.refs.gridButton.getStore().add({});
- };
- ConfigStrategy.prototype.moveUp = function (sender) {
- var grid = sender.up('grid');
- grid.rowMoveUp();
- };
- ConfigStrategy.prototype.moveDown = function (sender) {
- var grid = sender.up('grid');
- grid.rowMoveDown();
- };
- ConfigStrategy.prototype.addStrategy = function (sender, path) {
- var win = new Ext.Window({
- autoDestroy: true,
- title: "添加(编辑)策略",
- width: 400,
- height: 300,
- resizable: true,
- closable: true,
- maximizable: true,
- minimizable: true,
- plain: true,
- // constrainHeader: true,
- constrain: true,
- layout: 'fit',
- animateTarget: sender,
- buttonAlign: 'center',
- items: [
- {
- xtype: "form",
- layout: "hbox",
- margin: '10px 20px',
- border: 0,
- items: [
- {
- flex: 1,
- layout: 'vbox',
- items: [
- {
- xtype: "numberfield",
- fieldLabel: "优先级",
- flex: 1,
- allowBlank: false,
- labelWidth: 50,
- width: "100%",
- },
- {
- xtype: "textfield",
- fieldLabel: "策略名称",
- flex: 1,
- allowBlank: false,
- labelWidth: 50,
- width: "100%",
- },
- {
- xtype: "textfield",
- fieldLabel: "策略编号",
- flex: 1,
- allowBlank: false,
- regex: /^[a-zA-Z][a-zA-Z0-9]*$/,
- regexText: "文件名只能以英文字母开头,且只包含英文字母、数字",
- labelWidth: 50,
- width: "100%",
- },
- {
- xtype: "textfield",
- fieldLabel: "仓库ID",
- flex: 1,
- allowBlank: false,
- regex: /^[a-zA-Z][a-zA-Z0-9]*$/,
- regexText: "文件名只能以英文字母开头,且只包含英文字母、数字",
- labelWidth: 50,
- width: "100%",
- },
- ]
- },
- ]
- }
- ],
- //窗口按钮
- buttons: [
- {
- xtype: 'button', text: '保存', handler: function (btn) {
- //窗口获取表单
- var form = win.down('form');
- var vaildSuccess = form.isValid();
- if (!vaildSuccess) {
- return;
- }
- var filename = form.down('textfield[name="filename"]').getValue();
- }
- },
- {
- xtype: 'button', text: '取消', handler: function (btn) {
- //窗口关闭
- win.close();
- }
- }
- ]
- });
- win.show();
- };
- return ConfigStrategy;
- }(Scope));
- //# sourceMappingURL=ConfigStrategy.js.map
- var buildVjson = function () {
- return {
- bind: {
- title: '流程编辑-{text}',
- },
- layout: 'fit',
- items: [{
- layout: 'border',
- tbar: {
- xtype: 'toolbar',
- items: [
- {
- xtype: 'button',
- text: '撤销',
- listeners: {
- click: "scope.undo"
- }
- },
- {
- xtype: 'button',
- text: '还原',
- listeners: {
- click: "scope.redo"
- }
- },
- {
- xtype: 'button',
- text: '保存',
- listeners: {
- click: "scope.save"
- }
- },
- {
- xtype: 'button',
- text: '导入BPM',
- listeners: {
- click: "scope.importBpm"
- }
- },
- {
- xtype: 'button',
- text: '配置适配策略',
- listeners: {
- click: "scope.configStrategy"
- }
- },
- {
- fieldLabel: '选择配置分支',
- xtype: 'combogrid',
- },
- ]
- },
- items: [
- {
- xtype: "panel",
- region: 'center',
- reference: "bpmn_view",
- html: "<div class=\"bpmn_view\" style=\"width: 100%; height: 100%\"/>",
- },
- {
- split: true,
- xtype: "panel",
- region: 'east',
- width: '30%',
- reference: "bpmn_properties",
- html: "<div class=\"bpmn_properties\" style=\"width: 100%; height: 100%\"/>",
- }
- ],
- }],
- listeners: {
- afterrender: 'scope.onViewRender'
- }
- };
- };
- var BpmnDesign = /** @class */ (function (_super) {
- __extends(BpmnDesign, _super);
- function BpmnDesign() {
- var _this = _super.call(this, { model: {}, vjson: buildVjson() }) || this;
- _this.bpmnModeler = null;
- _this.bpmnModelerName = "";
- return _this;
- }
- BpmnDesign.prototype.onLoad = function () {
- var _this = this;
- _super.prototype.onLoad.call(this);
- this.setLoading(true);
- this.bpmnModelerName = this.data.text.substring(0, this.data.text.indexOf(".bpmn"));
- readBpmn({ absolute_path: this.data.absolutePath }).then(function (res) {
- if (res && res.success && res.data && res.data.bpmn) {
- var diagramXML = res.data.bpmn;
- _this.bpmnModeler.importXML(diagramXML).then(function (res) {
- var elements = _this.bpmnModeler._definitions.rootElements;
- if (Array.isArray(elements) && elements.length > 0) {
- elements[0].name = _this.bpmnModelerName;
- }
- }).catch(function (err) {
- msgError(err);
- });
- }
- else {
- msgError(res.msg);
- }
- }).finally(function () {
- _this.setLoading(false);
- });
- };
- BpmnDesign.prototype.onViewRender = function (sender) {
- var customTranslateModule = {
- translate: ['value', customTranslate]
- };
- this.bpmnModeler = new BpmnModeler({
- container: $(this.refs.bpmn_view.body.dom).find(".bpmn_view")[0],
- propertiesPanel: {
- parent: $(this.refs.bpmn_properties.body.dom).find(".bpmn_properties")[0],
- },
- additionalModules: [
- bpmnJsPropertiesPanel.BpmnPropertiesPanelModule,
- bpmnJsPropertiesPanel.BpmnPropertiesProviderModule,
- bpmnJsPropertiesPanel.CamundaPlatformPropertiesProviderModule,
- bpmnJsPropertiesPanel.CloudElementTemplatesPropertiesProviderModule,
- bpmnJsPropertiesPanel.CloudElementTemplatesValidator,
- bpmnJsPropertiesPanel.ElementTemplatesPropertiesProviderModule,
- bpmnJsPropertiesPanel.ZeebeDescriptionProvider,
- bpmnJsPropertiesPanel.ZeebePropertiesProviderModule,
- customTranslateModule,
- ],
- moddleExtensions: {
- camunda: camundaModdleDescriptor
- },
- keyboard: { bindTo: document } // 使用键盘快捷键
- });
- };
- //开启快捷键
- //modeler.get('keyboard').bind(document);
- //关闭快捷键
- //modeler.get('keyboard').unbind();
- BpmnDesign.prototype.undo = function (sender) {
- this.bpmnModeler.get('commandStack').undo();
- };
- BpmnDesign.prototype.redo = function (sender) {
- this.bpmnModeler.get('commandStack').redo();
- };
- BpmnDesign.prototype.save = function (sender) {
- var _this = this;
- this.setLoading(true);
- this.bpmnModeler.saveXML().then(function (resBpm) {
- saveBpmn(_this.data.absolutePath, resBpm.xml).then(function (res) {
- if (res.success) {
- msg$1("保存成功");
- }
- else {
- msgError(res.msg);
- }
- }).catch(function (e) {
- var _a, _b;
- var msg = (_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg;
- msgError(msg);
- }).finally(function () {
- _this.setLoading(false);
- });
- }).catch(function (e) {
- msgError(e);
- _this.setLoading(false);
- });
- };
- BpmnDesign.prototype.importBpm = function (sender) {
- var _this = this;
- var dlg = new ImportBpmn();
- //@ts-ignore
- dlg.success = function (sen, data) {
- _this.bpmnModeler.importXML(data.file_content).then(function (res) {
- var elements = _this.bpmnModeler._definitions.rootElements;
- if (Array.isArray(elements) && elements.length > 0) {
- elements[0].name = _this.bpmnModelerName;
- }
- }).catch(function (err) {
- msgError(err);
- });
- };
- dlg.showDialog(sender, {}, {});
- // this.bpmnModeler.importXML()
- };
- BpmnDesign.prototype.configStrategy = function (sender) {
- var configStrategy = new ConfigStrategy();
- configStrategy.showDialog(sender, {}, {});
- };
- return BpmnDesign;
- }(Scope));
- //# sourceMappingURL=BpmnDesign.js.map
- var model$b = {
- data: {
- id: '',
- path: '',
- form: {
- title: '',
- sqlId: '',
- }
- }
- };
- //# sourceMappingURL=WhLayoutDesign.model.js.map
- var vjson$b = {
- bind: {
- title: '{title}',
- },
- layout: 'fit',
- items: [
- {
- layout: 'border',
- items: [
- {
- region: 'center',
- reference: 'editor',
- border: true,
- // html: '<div class="geEditor"></div>',
- // listeners: {
- // afterrender: 'scope.editorInit'
- // }
- html: '<iframe style="height:100%;width:100%;border:border: 1px solid #d4d4d5;border-top: none;" src="/assets/mxgraph-editor/index.html"></iframe>',
- listeners: {
- afterrender: 'scope.iframeRender'
- }
- },
- ]
- }
- ]
- }; //
- //
- //# sourceMappingURL=WhLayoutDesign.view.js.map
- var WidgetDesign$1 = /** @class */ (function (_super) {
- __extends(WidgetDesign, _super);
- function WidgetDesign(layoutCode, layoutName) {
- var _this = _super.call(this, { model: model$b, vjson: vjson$b }) || this;
- _this.layoutCode = layoutCode;
- _this.layoutName = layoutName;
- return _this;
- }
- WidgetDesign.prototype.onLoad = function () {
- this.viewModel.set('layoutCode', this.layoutCode);
- this.viewModel.set('layoutName', this.layoutName);
- if (this.layoutCode) {
- this.viewModel.set('title', this.layoutName + ' [' + this.layoutCode + ']');
- }
- else {
- this.viewModel.set('title', '新建图纸');
- }
- };
- WidgetDesign.prototype.reload = function () {
- var _this = this;
- this.setLoading(true);
- loadWhLayout({
- layoutCode: this.layoutCode,
- layoutName: this.layoutName,
- }).then(function (res) {
- if (res.success) {
- var xml = res.data.layoutContent;
- var doc = _this.mxUtils.parseXml(xml);
- var graph = _this.editorUi.editor.graph;
- graph.setSelectionCells(graph.importGraphModel(doc.documentElement));
- }
- }).finally(function () {
- _this.setLoading(false);
- });
- };
- WidgetDesign.prototype.editorInit = function (sender) {
- var that = this;
- var dom = $(sender.el.dom).find('.geEditor')[0];
- //@ts-ignore
- require(['mxgraph'], function () {
- var editorUiInit = EditorUi.prototype.init;
- EditorUi.prototype.init = function () {
- editorUiInit.apply(this, arguments);
- this.actions.get('save').funct = that.onFileSave.bind(that);
- this.actions.get('saveAs').funct = that.onFileSaveAs.bind(that);
- this.actions.get('open').visible = false;
- this.actions.get('new').visible = false;
- this.actions.get('preview').visible = false;
- this.actions.get('print').visible = false;
- this.actions.get('pageSetup').visible = false;
- this.actions.get('help').visible = false;
- this.actions.get('export').visible = false;
- this.actions.get('about').visible = false;
- this.menus.menus.help.setEnabled(false);
- that.editorUi = this;
- if (that.layoutCode) {
- that.reload();
- }
- };
- var RESOURCE_BASE = '/assets/mxgraph-editor/resources/grapheditor';
- var mxLanguage = 'zh';
- mxResources.loadDefaultBundle = false;
- var bundle = mxResources.getDefaultBundle(RESOURCE_BASE, mxLanguage) ||
- mxResources.getSpecialBundle(RESOURCE_BASE, mxLanguage);
- var STYLE_PATH = '/assets/mxgraph-editor/styles';
- // Fixes possible asynchronous requests
- mxUtils.getAll([bundle, STYLE_PATH + '/default.xml'], function (xhr) {
- // Adds bundle text to resources
- mxResources.parse(xhr[0].getText());
- // Configures the default graph theme
- var themes = new Object();
- themes[Graph.prototype.defaultThemeName] = xhr[1].getDocumentElement();
- // Main
- new EditorUi(new Editor(false, themes), dom);
- }, function () {
- dom.innerHTML = '<center style="margin-top:10%;">Error loading resource files. Please check browser console.</center>';
- });
- });
- };
- WidgetDesign.prototype.iframeRender = function (sender) {
- var that = this;
- var iframe = $(sender.el.dom).find('iframe')[0];
- iframe.contentWindow['designer'] = that;
- iframe.contentWindow['editorInitFn'] = function (editorUi) {
- editorUi.actions.get('save').funct = that.onFileSave.bind(that);
- editorUi.actions.get('saveAs').funct = that.onFileSaveAs.bind(that);
- editorUi.actions.get('open').visible = false;
- editorUi.actions.get('new').visible = false;
- editorUi.actions.get('preview').visible = false;
- editorUi.actions.get('print').visible = false;
- editorUi.actions.get('pageSetup').visible = false;
- editorUi.actions.get('help').visible = false;
- editorUi.actions.get('export').visible = false;
- editorUi.actions.get('about').visible = false;
- editorUi.menus.menus.help.setEnabled(false);
- that.editorUi = editorUi;
- that.mxUtils = iframe.contentWindow['mxUtils'];
- if (that.layoutCode) {
- that.reload();
- }
- };
- };
- WidgetDesign.prototype.onDestroy = function () {
- var _a;
- try {
- (_a = this.editorUi) === null || _a === void 0 ? void 0 : _a.destroy();
- }
- catch (e) {
- }
- };
- WidgetDesign.prototype.onFileSaveAs = function () {
- var _this = this;
- this.showSaveAsDlg({ code: this.layoutCode, name: this.layoutName })
- .then(function (_a) {
- var code = _a.code, name = _a.name;
- _this.layoutCode = code;
- _this.layoutName = name;
- _this.onSave();
- });
- };
- WidgetDesign.prototype.onSave = function () {
- var _this = this;
- var layoutContent = this.editorUi.getEditBlankXml();
- var layoutCode = this.layoutCode;
- var layoutName = this.layoutName;
- if (!layoutCode || !layoutName) {
- msg$1('图形编号和图形名称必填');
- return;
- }
- this.viewModel.set('title', this.layoutName + ' [' + this.layoutCode + ']');
- this.setLoading(true);
- saveWhLayout({
- layoutCode: layoutCode, layoutName: layoutName, layoutContent: layoutContent
- }).then(function (res) {
- msg$1(res.msg);
- handles$1.whLayout.reload();
- }).finally(function () {
- _this.setLoading(false);
- });
- };
- WidgetDesign.prototype.onFileSave = function () {
- if (!this.layoutCode || !this.layoutName) {
- this.onFileSaveAs();
- }
- else {
- this.onSave();
- }
- };
- WidgetDesign.prototype.showSaveAsDlg = function (_a) {
- var code = _a.code, name = _a.name;
- return new Promise(function (resolve, reject) {
- var viewModel = new Ext.app.ViewModel({
- data: {
- code: code !== null && code !== void 0 ? code : '',
- name: name !== null && name !== void 0 ? name : '',
- }
- });
- var dlg = Ext.create('Ext.window.Window', {
- title: '保存',
- viewModel: viewModel,
- layout: {
- type: "vbox",
- pack: "start",
- align: "stretch"
- },
- items: [
- {
- xtype: 'textfield', fieldLabel: '图编号', margin: '0 15 15 0',
- bind: '{code}'
- },
- {
- xtype: 'textfield', fieldLabel: '图名称', margin: '0 15 15 0',
- bind: '{name}'
- }
- ],
- fbar: [
- {
- xtype: 'button', text: '保存', iconCls: 'x-fa fa-save', listeners: {
- click: function () {
- var code = viewModel.get('code');
- var name = viewModel.get('name');
- resolve({ code: code, name: name });
- dlg.close();
- }
- }
- },
- {
- xtype: 'button', text: '取消', iconCls: 'x-fa fa-times', listeners: {
- click: function () {
- dlg.close();
- }
- }
- },
- ]
- });
- dlg.show();
- });
- };
- return WidgetDesign;
- }(Scope));
- //# sourceMappingURL=WhLayoutDesign.js.map
- // init()
- var Workbench = /** @class */ (function (_super) {
- __extends(Workbench, _super);
- // activeModulePage: ModulePage = null
- function Workbench() {
- var _this = _super.call(this, { model: model, vjson: vjson }) || this;
- _this.name = "MainWindow";
- _this.modules = [];
- _this.yvgridDesign = null;
- return _this;
- }
- Workbench.prototype.leftTabChange = function (tabPanel, newCard, oldCard) {
- if (newCard) {
- this.viewModel.set('leftTabTitle', newCard.tooltip);
- }
- else {
- this.viewModel.set('leftTabTitle', '未选中');
- }
- };
- Object.defineProperty(Workbench.prototype, "activeModulePage", {
- get: function () {
- var _a;
- return ((_a = window['mainWindow'].refs.tt.getActiveTab()) === null || _a === void 0 ? void 0 : _a.yvanScope) || undefined;
- },
- enumerable: true,
- configurable: true
- });
- Workbench.prototype.documentKeydown = function (event) {
- if (event.ctrlKey || event.metaKey) {
- if (event.key.toLowerCase() === 's') {
- eventBus.publish(EventType.SaveCall, {});
- event.stopPropagation();
- event.preventDefault();
- }
- else if (event.key.toLowerCase() === 'z') {
- if (event.shiftKey) {
- eventBus.publish(EventType.Redo, {});
- event.stopPropagation();
- event.preventDefault();
- }
- else {
- eventBus.publish(EventType.Undo, {});
- event.stopPropagation();
- event.preventDefault();
- }
- }
- }
- };
- Workbench.prototype.onLoad = function () {
- var _this = this;
- window["tt"] = this.refs['tt'];
- window["vm"] = this.viewModel;
- $('#loading').remove();
- setMainWindow(this);
- setStatusbar(this.down('statusbar'));
- document.addEventListener('keydown', this.documentKeydown.bind(this));
- var currentProject = getCurrentProject();
- this.viewModel.set("currentProject", (currentProject === null || currentProject === void 0 ? void 0 : currentProject.url) + "(" + (currentProject === null || currentProject === void 0 ? void 0 : currentProject.name) + ")");
- // handles.fileTree.reload()
- eventBus.subscribe(EventType.ModuleOpen, function (rawData) {
- _this.showModule(rawData);
- });
- eventBus.subscribe(EventType.Undo, function () {
- _this.onUndo();
- });
- eventBus.subscribe(EventType.Redo, function () {
- _this.onRedo();
- });
- eventBus.subscribe(EventType.Cut, function (_a) {
- var a = _a.a, b = _a.b, c = _a.c, d = _a.d;
- _this.onCut(a, b, c, d);
- });
- eventBus.subscribe(EventType.Copy, function (_a) {
- var a = _a.a, b = _a.b, c = _a.c, d = _a.d;
- _this.onCopy(a, b, c, d);
- });
- eventBus.subscribe(EventType.Paste, function (_a) {
- var a = _a.a, b = _a.b, c = _a.c, d = _a.d;
- _this.onPaste(a, b, c, d);
- });
- eventBus.subscribe(EventType.SelectAll, function () {
- _this.onSelectAll();
- });
- eventBus.subscribe(EventType.SelectAll, function () {
- _this.onSelectAll();
- });
- eventBus.subscribe(EventType.RunCheckModule, function () {
- _this.runCheckModule();
- });
- eventBus.subscribe(EventType.StopCheckModule, function () {
- _this.stopCheckModule();
- });
- eventBus.subscribe(EventType.ComponentContextmenu, function (args) {
- _this.onCompoentContextMenu(args);
- });
- this.runCheckModule();
- };
- Workbench.prototype.onCompoentContextMenu = function (args) {
- var _this = this;
- if (!this.yvgridDesign) {
- this.yvgridDesign = new YvgridDesign(this.activeModulePage.moduleId);
- this.yvgridDesign.showDialog(null, {}, {});
- var fn_1 = this.yvgridDesign.onDestroy.bind(this.yvgridDesign);
- this.yvgridDesign.onDestroy = function () {
- fn_1();
- _this.yvgridDesign = null;
- };
- }
- };
- Workbench.prototype.runCheckModule = function () {
- var _this = this;
- if (this.checkTimer) {
- return;
- }
- this.checkTimer = setInterval(function () {
- var _a;
- if ((_a = _this.activeModulePage) === null || _a === void 0 ? void 0 : _a.check) {
- _this.activeModulePage.check();
- }
- }, 5000);
- };
- Workbench.prototype.showWidget = function (widgetPath, widgetName, successCallback) {
- var dlg = new WidgetDesign(widgetPath, widgetName);
- dlg.showPage({
- id: 'widget_' + widgetPath,
- path: 'widget_' + widgetPath,
- }, {
- data: {
- title: widgetPath ? '检索框:' + widgetName : '新建检索框',
- }
- });
- dlg.dialogSuccess = successCallback;
- };
- Workbench.prototype.stopCheckModule = function () {
- clearInterval(this.checkTimer);
- this.checkTimer = null;
- };
- Workbench.prototype.showDataSync = function () {
- var ins = new DbSync();
- ins.showPage({
- id: 'db_sync__',
- path: 'db_sync__',
- }, {
- data: {}
- });
- };
- /**
- * 打开一个项目
- */
- Workbench.prototype.openProject = function (project) {
- setCurrentProject(project);
- this.viewModel.set("currentProject", (project === null || project === void 0 ? void 0 : project.url) + "(" + (project === null || project === void 0 ? void 0 : project.name) + ")");
- handles$1.fileTree.reload();
- };
- /**
- * 打开模板开发面板
- */
- Workbench.prototype.showTemplateDev = function () {
- var ins = new TemplateDev();
- ins.showPage({
- id: 'template_dev__',
- path: 'template_dev__',
- }, {
- data: {}
- });
- };
- Workbench.prototype.openScope = function () {
- };
- /**
- * 显示字段域管理器
- */
- Workbench.prototype.showColumnDomain = function () {
- var instance = new DbDomain();
- instance.showPage({
- id: 'domain__',
- path: 'domain__',
- }, {
- data: {}
- });
- };
- /**
- * 显示性能统计
- */
- Workbench.prototype.showPerform = function () {
- // const instance = new PerformStats()
- // instance.showPage({
- // id: 'perform__',
- // path: 'perform__',
- //
- // }, {
- // data: {}
- // })
- };
- /**
- * 显示数据库代码模板库
- */
- Workbench.prototype.showDbCodeTemplate = function () {
- // const instance = new DbCodeTemplate()
- // instance.showPage({
- // id: 'dbcode__',
- // path: 'dbcode__',
- //
- // }, {
- // data: {}
- // })
- };
- /**
- * 显示数据库代码模板库
- */
- Workbench.prototype.showReport = function (report_id, report_name, success) {
- var instance = new ReportDesign();
- instance.showPage({
- id: 'report_' + report_id,
- path: 'report_' + report_id,
- }, {
- data: {
- report_id: report_id,
- report_name: report_name,
- }
- });
- instance.dialogSuccess = success;
- };
- /**
- * 显示报表
- */
- Workbench.prototype.showReportPreview = function (report_id, instance) {
- instance.showPage({
- id: 'REPORT__' + report_id,
- path: 'REPORT__' + report_id,
- }, {
- data: {
- report_id: report_id,
- }
- });
- var reportName = instance.viewModel.get('report_name');
- instance.viewModel.set('report_name', '[预览]-' + reportName);
- };
- /**
- * 显示运维页面
- */
- Workbench.prototype.showDevOpsTerminal = function (opsId, name, success) {
- // const instance = new DevOpsTerminal()
- // instance.showPage({
- // id: 'ops_' + opsId,
- // path: 'ops_' + opsId,
- //
- // }, {
- // data: {
- // opsId: opsId,
- // name: name,
- // }
- // })
- // instance.dialogSuccess = success
- };
- /**
- * 显示表结构
- * tableName 为空的情况就是新建表,否则就是要编辑的表
- * columnName 可以为空
- */
- Workbench.prototype.showTableColumn = function (schemaName, tableName, columnName, isCreate) {
- var id = 'tableColumn_' + tableName;
- var isCreateTable = false;
- // /ROOT/schema$public/schema$public$bas_location_group_rel
- var locatPath = "/ROOT/schema$" + schemaName + "/schema$" + schemaName + "$" + tableName;
- if (!tableName) {
- id = _$2.uniqueId('new_table');
- tableName = id;
- isCreateTable = true;
- }
- var instance = new DbColumn(schemaName, tableName, columnName, isCreateTable, isCreate);
- instance.showPage({
- id: id,
- path: id,
- locatPath: locatPath
- }, {
- data: {
- tableName: tableName,
- columnName: columnName
- }
- });
- };
- /**
- * 打开某个模块
- * 例如: com/galaxis/wms/inbound/cmd_in/CmdIn
- */
- Workbench.prototype.showModule = function (rawData) {
- var id = rawData.id, path = rawData.path;
- var separator = '/';
- var idx = _$2.findIndex(this.modules, function (item) { return item.path + separator + item.name === path; });
- var module = this.modules[idx];
- var pageId = path.replaceAll('/', '_');
- console.log('open module', module);
- var instance = new ModulePage(id, module);
- eventBus.publish(EventType.ModulePageCreate, __assign(__assign({}, rawData), { modulePage: instance }));
- instance.showPage({
- id: 'module_' + pageId,
- path: path,
- title: module.name
- }, {
- data: {}
- });
- };
- Workbench.prototype.showBmpnDesign = function (absolutePath, id, text) {
- var bpmnDesign = new BpmnDesign();
- bpmnDesign.showPage({}, {
- data: {
- absolutePath: absolutePath,
- id: id,
- text: text
- }
- });
- };
- Workbench.prototype.showLayoutDesign = function (layoutCode, layoutName) {
- var id = layoutCode !== null && layoutCode !== void 0 ? layoutCode : _$2.uniqueId('new_layout');
- var layoutDesign = new WidgetDesign$1(layoutCode, layoutName);
- layoutDesign.showPage({
- id: id,
- path: id,
- }, {
- data: {}
- });
- };
- Workbench.prototype.tabchange = function (tabPanel, newCard, oldCard, eOpts) {
- var _a;
- // this.activeModulePage = newCard.yvanScope
- handles$1.viewoutlinetree.moduleId = newCard.yvanScope.moduleId;
- handles$1.property.moduleId = newCard.yvanScope.moduleId;
- // handles.dbTree.moduleId = newCard.yvanScope.moduleId
- // handles.dictTree.moduleId = newCard.yvanScope.moduleId
- // handles.fileTree.moduleId = newCard.yvanScope.moduleId
- // handles.statusbar.moduleId = newCard.yvanScope.moduleId
- eventBus.publish(EventType.MainTabChange, {
- moduleId: newCard.yvanScope.moduleId,
- oldModuleId: (_a = oldCard === null || oldCard === void 0 ? void 0 : oldCard.yvanScope) === null || _a === void 0 ? void 0 : _a.moduleId,
- from: this.name
- });
- };
- Workbench.prototype.onUndo = function () {
- var _a;
- (_a = this.activeModulePage) === null || _a === void 0 ? void 0 : _a.moduleEventBus.publish(EventType.Undo, {});
- };
- Workbench.prototype.onRedo = function () {
- var _a;
- (_a = this.activeModulePage) === null || _a === void 0 ? void 0 : _a.moduleEventBus.publish(EventType.Redo, {});
- };
- Workbench.prototype.onCut = function (a, b, c, d) {
- var _a;
- (_a = this.activeModulePage) === null || _a === void 0 ? void 0 : _a.moduleEventBus.publish(EventType.Cut, {});
- };
- Workbench.prototype.onCopy = function (a, b, c, d) {
- var _a;
- (_a = this.activeModulePage) === null || _a === void 0 ? void 0 : _a.moduleEventBus.publish(EventType.Copy, {});
- };
- Workbench.prototype.onPaste = function (a, b, c, d) {
- var _a;
- (_a = this.activeModulePage) === null || _a === void 0 ? void 0 : _a.moduleEventBus.publish(EventType.Paste, {});
- };
- Workbench.prototype.onSelectAll = function () {
- var _a;
- (_a = this.activeModulePage) === null || _a === void 0 ? void 0 : _a.moduleEventBus.publish(EventType.SelectAll, {});
- };
- return Workbench;
- }(Scope));
- //# sourceMappingURL=Workbench.js.map
- (function (FuncDomain) {
- FuncDomain["SCOPE"] = "scope";
- FuncDomain["SYSTEM"] = "system";
- })(exports.FuncDomain || (exports.FuncDomain = {}));
- (function (BizMode) {
- //mode : 1, '仅查询' 2, '表单+表格编辑' 3, '仅表单编辑' 4, '仅表格编辑'
- BizMode[BizMode["query"] = 1] = "query";
- BizMode[BizMode["formAndGridEdit"] = 2] = "formAndGridEdit";
- BizMode[BizMode["formEditOnly"] = 3] = "formEditOnly";
- BizMode[BizMode["gridEditOnly"] = 4] = "gridEditOnly";
- })(exports.BizMode || (exports.BizMode = {}));
- (function (BizFormat) {
- // "format" : 1, button 2 progres 3 date 4 datetime 5 percentage
- BizFormat[BizFormat["button"] = 1] = "button";
- BizFormat[BizFormat["progress"] = 2] = "progress";
- BizFormat[BizFormat["date"] = 3] = "date";
- BizFormat[BizFormat["datetime"] = 4] = "datetime";
- BizFormat[BizFormat["percentage"] = 5] = "percentage";
- })(exports.BizFormat || (exports.BizFormat = {}));
- (function (BizUnique) {
- // "unique" : 1主键(全局唯一) 2仓库唯一 3货主唯一 4项目唯一 5单据唯一 6仓库+货主+项目唯一
- BizUnique[BizUnique["u_a"] = 1] = "u_a";
- BizUnique[BizUnique["u_wh"] = 2] = "u_wh";
- BizUnique[BizUnique["u_ow"] = 3] = "u_ow";
- BizUnique[BizUnique["u_pj"] = 4] = "u_pj";
- BizUnique[BizUnique["u_od"] = 5] = "u_od";
- BizUnique[BizUnique["u_wh_ow_pj"] = 6] = "u_wh_ow_pj";
- })(exports.BizUnique || (exports.BizUnique = {}));
- var ScopeEngine = /** @class */ (function () {
- function ScopeEngine() {
- }
- ScopeEngine.getBizFile = function (director) {
- return new Promise(function (resolve, reject) {
- debugger;
- });
- };
- ScopeEngine.buildScopeFromBillFile = function (billFile) {
- return new Promise(function (resolve, reject) {
- var requireArr = [];
- var requireKeyArr = [];
- _$2.forOwn(billFile.domains, function (v, k) {
- requireArr.push(v.domain);
- requireKeyArr.push(k);
- if (v.layout) {
- requireArr.push(v.layout);
- requireKeyArr.push(k + "_layout");
- }
- });
- requireArr.push(billFile.layout);
- requireKeyArr.push("layout");
- requireArr.push(billFile.converter);
- requireKeyArr.push("converter");
- // @ts-ignore
- require(requireArr, function () {
- var requireReArr = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- requireReArr[_i] = arguments[_i];
- }
- if (requireReArr.length <= 0) {
- reject(new Error("没有加载到相关的文件!"));
- }
- var domains = {};
- for (var i = 0; i < requireReArr.length - 2; i++) {
- if (requireKeyArr[i].endsWith("_layout")) {
- var key_d = requireKeyArr[i].substr(0, requireKeyArr[i].indexOf("_layout"));
- domains[key_d].layout = requireReArr[i].default;
- }
- else {
- domains[requireKeyArr[i]] = requireReArr[i].default;
- domains[requireKeyArr[i]].type = billFile.domains[requireKeyArr[i]].type;
- domains[requireKeyArr[i]].mode = billFile.domains[requireKeyArr[i]].mode;
- }
- }
- var bizFile = {
- bill: billFile,
- domains: domains,
- layout: requireReArr[requireReArr.length - 2].default,
- converter: requireReArr[requireReArr.length - 1].default,
- };
- var scope = ScopeEngine.buildScopeFromBizFile(bizFile);
- scope.billSetting = bizFile;
- resolve(scope);
- });
- });
- };
- ScopeEngine.buildScopeFromPath = function (path) {
- return new Promise(function (resolve, reject) {
- // @ts-ignore
- require([path], function (bill) {
- bill = bill.default;
- ScopeEngine.buildScopeFromBillFile(bill).then(function (scope) {
- resolve(scope);
- }).catch(function (e) {
- reject(e);
- });
- });
- });
- };
- ScopeEngine.buildScopeFromBizFile = function (bizFile) {
- var controller = {};
- var vjson = {
- layout: 'fit',
- title: bizFile.bill.name,
- items: []
- };
- var model = {};
- if (bizFile.layout.layout === "fit") {
- vjson.items = bizFile.layout.items;
- }
- else if (bizFile.layout.layout === "border") {
- vjson.items = [bizFile.layout];
- }
- var domainsVjson = {};
- _$2.forOwn(bizFile.domains, function (v, k) {
- var domainVjson = null;
- var buttons = bizFile.domains[k].buttons;
- if (bizFile.bill.domains[k].mode === "form") {
- domainVjson = ScopeEngine.buildForm(controller, model, bizFile, k);
- if (Array.isArray(buttons) && buttons.length > 0) {
- if (bizFile.bill.domains[k].type === "header") {
- vjson.tbar = {
- xtype: 'toolbar',
- items: ScopeEngine.buildButton(controller, buttons)
- };
- }
- else {
- domainVjson.items.push({
- xtype: "cols",
- items: ScopeEngine.buildButton(controller, buttons)
- });
- }
- }
- }
- else if (bizFile.bill.domains[k].mode === "table") {
- domainVjson = ScopeEngine.buildGrid(controller, model, bizFile, k);
- if (Array.isArray(buttons) && buttons.length > 0) {
- if (bizFile.bill.domains[k].type === "header") {
- vjson.tbar = {
- xtype: 'toolbar',
- items: ScopeEngine.buildButton(controller, buttons)
- };
- }
- else {
- domainVjson.tbar = {
- xtype: 'toolbar',
- items: ScopeEngine.buildButton(controller, buttons)
- };
- }
- }
- }
- if (domainVjson) {
- domainsVjson[k] = domainVjson;
- }
- });
- ScopeEngine.deepTravVJsonReplaceDomain(vjson, domainsVjson);
- var scope = new Scope({ model: model, vjson: vjson });
- scope['bill_define'] = bizFile;
- _$2.merge(scope, controller);
- console.log('bill_define', vjson, scope, scope['bill_define']);
- return scope;
- };
- ScopeEngine.buildForm = function (controller, model, bizFile, domainKey) {
- var fieldGroups = {};
- for (var i = 0; i < bizFile.domains[domainKey].fields.length; i++) {
- var field = bizFile.domains[domainKey].fields[i];
- var item = { sort: field.form_sort };
- item.xtype = field.xtype;
- item.fieldLabel = field.column_desc;
- item.bind = {
- value: "{" + domainKey + "." + field.column_name + "}",
- };
- _$2.set(model, "data." + domainKey + "." + field.column_name, null);
- // if (field.disabled !== "true" && field.disabled !== "false") {
- // item.bind.disabled = eval(field.disabled)
- // } else {
- // item.disabled = (field.disabled === "true")
- // }
- // if (field.readonly !== "true" && field.readonly !== "false") {
- // item.bind.disabled = eval(field.readonly)
- // } else {
- // item.readonly = (field.readonly === "true")
- // }
- // if (field.required !== "true" && field.required !== "false") {
- // item.bind.required = eval(field.required)
- // } else {
- // item.required = (field.required === "true")
- // }
- // if (field.hide !== "true" && field.hide !== "false") {
- // item.bind.hidden = eval(field.hide)
- // } else {
- // item.hidden = (field.hide === "true")
- // }
- // item.flex = field.
- if (field.dict) {
- item.fix = eval(field.dict);
- }
- // _.set(formModel, "", "")
- item.field = field;
- if (field.form_group) {
- if (!fieldGroups.hasOwnProperty(field.form_group)) {
- fieldGroups[field.form_group] = [item];
- }
- else {
- fieldGroups[field.form_group].push(item);
- }
- }
- }
- var formVjson = {
- xtype: "form",
- title: bizFile.domains[domainKey].name,
- items: []
- };
- _$2.forOwn(fieldGroups, function (fieldGroup, k) {
- var items = ScopeEngine.buildFieldSet(fieldGroup);
- if (items) {
- var fieldsetVjson = {
- xtype: "fieldset",
- title: k,
- items: items
- };
- formVjson.items.push(fieldsetVjson);
- }
- });
- return formVjson;
- };
- ScopeEngine.buildGrid = function (controller, model, bizFile, domainKey) {
- // const vjson = { xtype: "grid", items: []}
- var gridVjson = {
- xtype: "yvgrid",
- columns: [],
- split: true,
- reference: domainKey,
- listeners: {
- itemdblclick: function () {
- },
- },
- };
- for (var i = 0; i < bizFile.domains[domainKey].fields.length; i++) {
- var field = bizFile.domains[domainKey].fields[i];
- gridVjson.columns.push({
- dataIndex: field.column_name,
- header: field.column_desc,
- });
- }
- return gridVjson;
- };
- ScopeEngine.buildFieldSet = function (fieldGroup) {
- var colGroups = [{
- xtype: "cols",
- items: []
- }];
- var colGroup = colGroups[0];
- _$2.sortBy(fieldGroup, function (item) { return item.sort; });
- for (var i = 0; i < fieldGroup.length; i++) {
- var field = fieldGroup[i];
- if (field.field.form_newline === "true") {
- if (colGroup.items.length > 0) {
- colGroup = {
- xtype: "cols",
- items: [field]
- };
- colGroups.push(colGroup);
- }
- }
- else {
- colGroup.items.push(field);
- }
- delete field.field;
- }
- return colGroups;
- };
- ScopeEngine.buildButton = function (controller, buttons) {
- var buttonsVjson = [];
- var _loop_1 = function (i) {
- var item = buttons[i];
- var button = {
- xtype: "button",
- text: item.btn_name,
- iconCls: item.icon
- };
- if (item.hidden === "true" || item.hidden === "false") {
- button.hidden = (item.hidden === "true");
- }
- if (item.listeners) {
- var listeners_1 = {};
- _$2.forOwn(item.listeners, function (v, k) {
- if (v.startsWith(exports.FuncDomain.SCOPE + ".") || v.startsWith(exports.FuncDomain.SYSTEM + ".")) {
- listeners_1[k] = v;
- }
- else {
- try {
- listeners_1[k] = eval(v);
- }
- catch (e) {
- throw e;
- }
- }
- });
- button.listeners = listeners_1;
- }
- buttonsVjson.push(button);
- };
- for (var i = 0; i < buttons.length; i++) {
- _loop_1(i);
- }
- return buttonsVjson;
- };
- ScopeEngine.buildListeners = function (controller, item) {
- if (!item.hasOwnProperty("listeners")) {
- return;
- }
- _$2.forOwn(item.listeners, function (v, k) {
- if (v && typeof v === "string") {
- if (v.indexOf(".") > -1) {
- var strArr = v.split(".");
- if (strArr.length != 2) {
- console.error(item.listeners, "语法解析错误,请检查!");
- }
- var _a = __read(strArr, 2), funcDomain = _a[0], funcName = _a[1];
- switch (funcDomain) {
- case exports.FuncDomain.SCOPE:
- controller[k] = findCustFunc(item, k);
- break;
- case exports.FuncDomain.SYSTEM:
- break;
- default:
- throw new Error("错误的函数域定义");
- }
- }
- else {
- var func = eval(v);
- if (typeof func === 'function') {
- controller[k] = func;
- }
- throw new Error("解析自定义函数出错");
- }
- }
- });
- var findCustFunc = function (item, funcName) {
- if (!item.hasOwnProperty("funcs") || !item[funcName]) {
- throw new Error("没有找到相关的函数定义");
- }
- var func = eval(item[funcName]);
- if (typeof func === 'function') {
- return func;
- }
- throw new Error("解析自定义函数出错");
- };
- };
- /**
- * 只检索 items 的模式,深度遍历 vjson
- */
- ScopeEngine.deepTravVJsonReplaceDomain = function (vjson, domainsVjson) {
- if (Array.isArray(vjson)) {
- for (var i = 0; i < vjson.length; i++) {
- ScopeEngine.deepTravVJsonReplaceDomain(vjson[i], domainsVjson);
- }
- }
- else {
- _$2.forOwn(vjson, function (v, k) {
- if (k !== "domain") {
- if (Array.isArray(v) || Object.prototype.toString.call(v) === "[object Object]") {
- ScopeEngine.deepTravVJsonReplaceDomain(v, domainsVjson);
- }
- }
- else {
- delete vjson.domain;
- _$2.merge(vjson, domainsVjson[v]);
- }
- });
- }
- };
- return ScopeEngine;
- }());
- //# sourceMappingURL=ScopeEngine.js.map
- function initComponent () {
- var ct = Ext.Component.prototype.constructor;
- Ext.Component.override({
- constructor: function (config) {
- var _a, _b;
- if (!isDesignMode(this, config)) {
- var me_1 = this;
- // 任意组件 Ext.Component 构造时调用的方法, 可以用来在渲染之前加工处理 VJSON
- _$2.each(baseConfigProcessList, function (process) {
- process.call(me_1, me_1, config);
- });
- }
- if (config) {
- if (!config.i18nPath && ((_a = config.$initParent) === null || _a === void 0 ? void 0 : _a.i18nPath)) {
- config.i18nPath = config.$initParent.i18nPath;
- }
- if ((_b = config.$initParent) === null || _b === void 0 ? void 0 : _b.setTitle) {
- var setTitle_1 = config.$initParent.setTitle;
- var handel_1 = config.$initParent;
- config.$initParent.setTitle = function (title) {
- var t = { title: title };
- var WMSTranslate = window["WMSTranslate"];
- if (WMSTranslate) {
- if (typeof window['viewTranslate'] === 'function') {
- window['viewTranslate'](t, title, "title");
- }
- }
- setTitle_1.call(handel_1, t.title);
- }.bind(config.$initParent);
- }
- var WMSTranslate = window["WMSTranslate"];
- if (WMSTranslate) {
- if (typeof window['viewTranslate'] === 'function') {
- window['viewTranslate'](config, config.text, "text");
- window['viewTranslate'](config, config.title, "title");
- window['viewTranslate'](config, config.header, "header");
- window['viewTranslate'](config, config.fieldLabel, "fieldLabel");
- window['viewTranslate'](config, config.emptyText, "emptyText");
- }
- }
- }
- ct.call(this, config);
- }
- });
- var _initComponent = Ext.picker.Date.prototype.initComponent;
- Ext.picker.Date.override({
- initComponent: function () {
- var me = this;
- me.defaultValue = Ext.isDate(me.defaultValue) ? me.defaultValue : syncDate(new Date());
- _initComponent.call(me);
- },
- selectToday: function () {
- var me = this, btn = me.todayBtn, handler = me.handler;
- if (btn && !btn.disabled) {
- me.setValue(Ext.Date.clearTime(syncDate(new Date())));
- me.fireEvent('select', me, me.value);
- if (handler) {
- Ext.callback(handler, me.scope, [me, me.value], null, me, me);
- }
- me.onSelect();
- }
- return me;
- },
- });
- }
- //# sourceMappingURL=component.js.map
- function initMainTab () {
- Ext.define('Yvan.MainTab', {
- extend: 'Ext.tab.Panel',
- xtype: 'maintab',
- plugins: Ext.create('Ext.ux.TabCloseMenu', {
- closeTabText: '关闭',
- closeOthersTabsText: '关闭其他',
- closeAllTabsText: '关闭所有'
- }),
- constructor: function (config) {
- var me = this;
- var newConfig = _$2.defaultsDeep({
- // 强制属性
- }, config);
- this.superclass.constructor.call(me, newConfig);
- },
- initComponent: function () {
- var me = this;
- this.on({
- tabchange: function (tabPanel, newCard, oldCard, eOpts) {
- _$2.defer(function () {
- me.changeHash(newCard.id);
- window['cp'] = newCard.yvanScope;
- });
- $$2(window).trigger('tabChange', {
- tabPanel: tabPanel, newCard: newCard, oldCard: oldCard, eOpts: eOpts
- });
- },
- afterrender: function () {
- _$2.defer(function () {
- me.tryRestoryPage();
- });
- }
- });
- this.superclass.initComponent.call(me);
- },
- tryRestoryPage: function () {
- var me = this;
- var hash = '' + window.location.hash;
- if (hash && hash.indexOf('page=') > 0) {
- if (hash.startsWith('#')) {
- hash = hash.substr(1);
- }
- if (hash) {
- var page = Qs.parse(hash).page;
- if (page) {
- // this.openScope(page)
- me.fireEvent('restorypage', page);
- }
- }
- }
- },
- changeHash: function (id) {
- window.location.hash = Qs.stringify({ page: id });
- },
- /**
- * 添加一个业务模块实例到选项卡
- * @param scopeInstance 业务对象实例
- * @param config ExtJS配置对象
- * @param panelInitCallback panel初始化之后会调用函数进行构造前的加工
- */
- addScope: function (scopeInstance, config, panelInitCallback) {
- scopeInstance.topScope = scopeInstance;
- var me = this;
- if (config.path) {
- for (var i = 0; i < this.items.items.length; i++) {
- // 找到当前 tabs 里有没有已经打开过
- var tab = this.items.items[i];
- if (_$2.isEqual(tab.path, config.path)) {
- // 激活
- this.setActiveTab(tab);
- return tab;
- }
- }
- }
- var newPanel = new Ext.panel.Panel(__assign({ closable: true }, config));
- if (typeof panelInitCallback === 'function') {
- panelInitCallback(newPanel);
- }
- // 添加业务模块
- var newTab = this.add(newPanel);
- this.setActiveTab(newTab);
- newTab.on({
- destroy: function (sender) {
- me.changeHash('');
- delete window['cp'];
- }
- });
- return newTab;
- }
- });
- }
- //# sourceMappingURL=MainTab.js.map
- /**
- * 构建所有组件的公共属性
- * @param config 原始config
- * @param dragType 组件模式
- * 不填,代表不能在设计时被拖拽
- * row-container 是一个rows容器
- * col-container 是一个cols容器
- * col-item cols中的一个格子(非容器),比如 textfield / combofield 等等
- * row-item rows中的一行,比如 tree / grid / panel 等等
- */
- function baseConfig(config, dragType) {
- // if (isDesignMode(config, undefined) && dragType) {
- if (typeof config === 'object') {
- var cc = '';
- switch (dragType) {
- case "cols-container":
- cc = 'design_cols_container';
- break;
- case "col-item":
- cc = 'design_col_item';
- break;
- case "rows-container":
- cc = 'design_rows_container';
- break;
- case "row-item":
- cc = 'design_row_item';
- break;
- }
- if (typeof config.cls === 'string') {
- _$2.extend(config, {
- cls: [config.cls, 'yvan_design', cc]
- });
- }
- else if (_$2.isArray(config.cls)) {
- _$2.extend(config, {
- cls: __spread(config.cls, ['yvan_design', cc])
- });
- }
- else {
- _$2.extend(config, {
- cls: ['yvan_design', cc]
- });
- }
- }
- return config;
- }
- //# sourceMappingURL=base.js.map
- function initPanel () {
- /**
- *
- */
- var ct = Ext.panel.Panel.prototype.constructor;
- Ext.panel.Panel.override({
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({}, config, baseConfig(config, "rows-container"), panel);
- ct.call(this, newConfig);
- }
- });
- var ss = Ext.form.FieldContainer.prototype;
- Ext.form.FieldContainer.override({
- config: __assign({}, fieldContainer)
- });
- }
- //# sourceMappingURL=panel.js.map
- function initGridColumn () {
- var ct = Ext.grid.column.Column.prototype.constructor;
- Ext.grid.column.Column.override({
- constructor: function (config) {
- var scope = lookupScope(config.$initParent.$initParent);
- var newConfig = _$2.defaults({}, config, column);
- if (typeof newConfig.summaryRenderer === 'string') {
- newConfig.summaryRenderer = lookupFn(scope, config.summaryRenderer);
- if (typeof newConfig.summaryRenderer === 'function') {
- newConfig.summaryRenderer = newConfig.summaryRenderer.bind(scope);
- }
- }
- if (config.formatter === 'datetime') {
- newConfig.fix = ['system.formatDate()'];
- delete newConfig.formatter;
- }
- // 在 grid.constructor 已经转换过了
- // if (typeof newConfig.renderer === 'string') {
- // newConfig.renderer = lookupFn(scope, config.renderer)
- // if (typeof newConfig.renderer === 'function') {
- // newConfig.renderer = newConfig.renderer.bind(scope)
- // }
- // }
- ct.call(this, newConfig);
- }
- });
- var ctAction = Ext.grid.column.Action.prototype.constructor;
- Ext.grid.column.Action.override({
- constructor: function (config) {
- var scope = lookupScope(config.$initParent.$initParent);
- _$2.forEach(config.items, function (item) {
- if (typeof item.handler === 'string') {
- item.handler = lookupFn(scope, item.handler);
- if (typeof item.handler === 'function') {
- item.handler = item.handler.bind(scope);
- }
- }
- });
- ctAction.call(this, config);
- }
- });
- var ck = Ext.grid.column.Check.prototype.constructor;
- Ext.grid.column.Check.override({
- constructor: function (config) {
- _$2.set(config, 'listeners.checkchange', function (sender, rowIndex, checked, record, e, eOpts) {
- var grid = sender.view.grid.ownerGrid;
- var column = grid.getColumns()[sender.fullColumnIndex];
- var context = {
- event: e,
- column: column,
- field: sender.dataIndex,
- value: checked,
- record: record,
- rowIdx: rowIndex
- };
- grid.fireEvent('editfinish', grid, sender, context, eOpts);
- });
- ck.call(this, config);
- }
- });
- // 227573
- // const {onTitleElClick} = Ext.grid.column.Column.prototype
- // Ext.define('Yvan.ColumnOverride', {
- // override: 'Ext.grid.column.Column',
- //
- // config: {
- // enableSortOnClick: false,
- // },
- //
- // // /**@Overrides*/
- // onTitleElClick: function (e, t, sortOnClick) {
- // // return this.callParent([e, t, this.enableSortOnClick && sortOnClick]);
- // if (!$(e.target).is('.x-column-header-trigger')) {
- // // 不是点击菜单的情况下,让列自适应宽度
- // this.autoSize()
- // }
- // return onTitleElClick.call(this, e, t, false)
- // }
- // });
- }
- //# sourceMappingURL=gridcolumn.js.map
- var SIMPLE_RE = /^(?:\{(?:(\d+)|([a-z_][\w\.]*))\})$/i;
- /**
- * 判断目标字符串与关键字是否重叠
- * @param target 目标字符串
- * @param keyword 搜索关键字
- */
- function pinyinMatch(target, keyword) {
- if (typeof target != 'string' || typeof keyword != 'string') {
- return false;
- }
- if (!keyword || !target) {
- return false;
- }
- var pyzh = _$2.toLower(window['getFirstPinyin2'](target));
- keyword = _$2.toLower(keyword);
- var pos1 = _$2.toLower(target).indexOf(keyword);
- if (pos1 >= 0) {
- return true;
- }
- var len = _$2.intersection(keyword.split('')).length;
- if (_$2.intersection(pyzh.split(''), keyword.split('')).length === len) {
- return true;
- }
- return false;
- }
- /**
- * 对某个表达式进行求值
- * a:{query.a},b:{query.b} -> a:aValue,b:bValue
- *
- * @example
- * calcExpress(cc.viewModel.data, "WH_ID:{query.WH_ID},C:{theGrid.selection.data.WH_ID}")
- * 计算出来的值是: "WH_ID:queryWhId,C:JH000000001"
- *
- * @param data 数据环境对象
- * @param express 表达式对象
- */
- function calcExpress(data, express) {
- var result = express;
- if (SIMPLE_RE.test(express)) {
- // '{foo}' 简单表达式
- var path = express.substring(1, express.length - 1);
- var ret = _$2.get(data, path);
- return (ret === null || ret === void 0 ? void 0 : ret.isModel) ? ret.data : ret;
- }
- while (true) {
- var mlist = result.match(/{(.*?)}/);
- if (!mlist) {
- break;
- }
- var pathC = mlist[0]; // {query.a}
- var path = mlist[1]; // query.a
- var value = _$2.get(data, path);
- result = result.replaceAll(pathC, value || '');
- }
- return result;
- }
- /**
- * 对个对象进行表达式求值,不用回调
- * @example
- * calcObjectFlat({query:{a:'aValue',b1:'b1Value',b2:'b2Value',d1:1,d2:2}}, { a:'{query.a}', b:{b1:'{query.b1}', b2:'{query.b2}'},c:'aa',d:['{query.d1}','{query.d2}'] })
- *
- * {
- * a: '{query.a}',
- * b: {
- * b1: '{query.b1}',
- * b2: '{query.b2}',
- * },
- * c: 'aa',
- * d: [
- * '{query.d1}',
- * '{query.d2}'
- * ]
- * }
- *
- * 计算结果为
- * {
- * a: 'aValue',
- * b: {
- * b1: 'b1Value',
- * b2: 'b2Value'
- * },
- * c: 'aa'
- * d: [
- * '1',
- * '2'
- * ]
- * }
- *
- * @param data
- * @param paramObject
- */
- function calcObjectFlat(data, paramObject) {
- var result = _$2.cloneDeep(paramObject);
- if (typeof paramObject === 'string') {
- return calcExpress(data, paramObject);
- }
- var trav = function (param) {
- _$2.forOwn(param, function (value, key) {
- if (_$2.isPlainObject(value)) {
- // 深度递归,对子对象进行求解
- trav(value);
- }
- else if (_$2.isString(value)) {
- // 字符串直接用 calcExpress 表达式求解
- param[key] = calcExpress(data, param[key]);
- }
- else if (_$2.isArray(value)) {
- // 数组求解
- _$2.each(value, function (v, idx) {
- value[idx] = calcExpress(data, v);
- });
- }
- });
- };
- trav(result);
- return result;
- }
- /**
- * 合併 data 到當前的 ViewModel 對象
- */
- function mergeViewModel(viewModel, propertyName, data, isFlat) {
- var newRow = {};
- if (isFlat == false) {
- newRow = data;
- }
- else {
- flatObject(newRow, '', data);
- }
- if (!propertyName) {
- _$2.forOwn(newRow, function (value, key) {
- viewModel.set(key, value);
- });
- }
- else {
- _$2.forOwn(newRow, function (value, key) {
- viewModel.set(propertyName + "." + key, value);
- });
- }
- }
- /**
- * 转换内联结构的行,到平面结构
- * company: { name:'公司1', id:'编号1' } => { company_id:'编号1', company_name:'公司1' }
- *
- * @param array
- * @param flatOption
- * @return {[]}
- */
- function flatRow(array) {
- var ret = [];
- _$2.forEach(array, function (row) {
- var newRow = {};
- flatObject(newRow, '', row);
- ret.push(newRow);
- });
- return ret;
- }
- function flatObject(parentObj, parentProp, obj) {
- _$2.forOwn(obj, function (value, key) {
- var fullKey = parentProp ? parentProp + '_' + key : key;
- if (_$2.isArray(value)) {
- parentObj[fullKey] = _$2.map(value, function (row) {
- var newRow = {};
- flatObject(newRow, '', row);
- return newRow;
- });
- }
- else {
- if (typeof value === 'object') {
- flatObject(parentObj, fullKey, value);
- }
- else {
- parentObj[fullKey] = value;
- }
- }
- });
- }
- /**
- * 替换内部结构中,所有 N/A
- */
- function replaceNA(obj) {
- if (obj === 'N/A') {
- return '';
- }
- if (_$2.isArray(obj)) {
- _$2.forEach(obj, function (value, idx) {
- if (value === 'N/A') {
- obj[idx] = '';
- }
- else {
- replaceNA(value);
- }
- });
- }
- else if (_$2.isPlainObject(obj)) {
- _$2.forOwn(obj, function (value, key) {
- if (value === 'N/A') {
- obj[key] = '';
- }
- else {
- replaceNA(value);
- }
- });
- }
- }
- function deepTravJson(obj, resolver) {
- if (_$2.isArray(obj)) {
- _$2.forEach(obj, function (value, idx) {
- if (typeof value === 'string') {
- resolver(obj, value, idx);
- }
- else {
- deepTravJson(value, resolver);
- }
- });
- }
- else if (_$2.isPlainObject(obj)) {
- _$2.forOwn(obj, function (value, key) {
- if (typeof value === 'string') {
- resolver(obj, value, key);
- }
- else {
- deepTravJson(value, resolver);
- }
- });
- }
- }
- /**
- * 根据表达式进入写值
- * express="{query.a}" 写值就是 viewModel.set('query.a', value)
- * express="test-{query.a}" 写值就会失败
- *
- * @example
- * tryWriteByExpress(cc.viewModel, "{query.WH_ID}", "111")
- * 写值成功
- *
- * tryWriteByExpress(cc.viewModel, "test-{query.WH_ID}", "111")
- * 写值失败
- *
- * @param viewModel VM对象
- * @param express 表达式对象
- * @param value 目标值
- */
- function tryWriteByExpress(viewModel, express, value) {
- if (SIMPLE_RE.test(express)) {
- // '{foo}' 简单表达式
- express = express.substring(1, express.length - 1);
- viewModel.set(express, value);
- }
- }
- /**
- * 尝试根据含表达式的对象回写, calcObjectFlat 的逆向方法
- * @example
- * tryWriteObject({ a:'{query.a}', b:{b1:'{query.b1}', b2:'{query.b2}'},c:'aa',d:['{query.d1}','{query.d2}']}, {a:'aValue', b:{b1:'b1Value', b2:'b2Value'}, c:'aa', d:[1,2]})
- *
- * expressObject:
- * {
- * a: '{query.a}',
- * b: {
- * b1: '{query.b1}',
- * b2: '{query.b2}',
- * },
- * c: 'aa',
- * d: [
- * '{query.a}',
- * '{query.b2}'
- * ]
- * }
- *
- * valueObject:
- * {
- * a: 'aValue',
- * b: {
- * b1: 'b1Value',
- * b2: 'b2Value'
- * },
- * c: 'aa'
- * c: [
- * 'aValue',
- * 'b2Value'
- * ]
- * }
- *
- * 系统会尝试回写
- * viewModel.set('query.a', 'aValue')
- * viewModel.set('query.b1', 'b1Value')
- * viewModel.set('query.b2', 'b2Value')
- *
- * @param expressObject 含表达式的对象
- * @param valueObject 表达式计算完成之后的结果对象
- * @param writeFn 写入的方法 (path, value)=>void
- */
- function tryWriteObject(expressObject, valueObject, writeFn) {
- var trav = function (pathPrefix) {
- var parent = expressObject;
- if (_$2.size(pathPrefix) > 1) {
- parent = _$2.get(parent, pathPrefix.substring(1));
- }
- _$2.forOwn(parent, function (value, key) {
- if (_$2.isPlainObject(value)) {
- // 深度递归,对子对象进行求解
- trav(pathPrefix + "." + key);
- }
- else if (_$2.isString(value)) {
- // 字符串直接用 calcExpress 表达式求解
- if (SIMPLE_RE.test(value)) {
- // If we have '{foo}' alone it is a literal 简单表达式
- var targetPath = value.substring(1, value.length - 1);
- var targetValue = _$2.get(valueObject, (pathPrefix + "." + key).substr(1));
- if (!writeFn) {
- console.log("viewModel.set('" + targetPath + "', '" + targetValue + "')");
- }
- else {
- writeFn(targetPath, targetValue);
- }
- }
- }
- else if (_$2.isArray(value)) {
- _$2.each(value, function (v, idx) {
- if (SIMPLE_RE.test(v)) {
- var targetPath = (pathPrefix + "." + key).substr(1) + "[" + idx + "]";
- var targetValue = _$2.get(valueObject, (pathPrefix + "." + key).substr(1) + "[" + idx + "]");
- if (!writeFn) {
- console.log("viewModel.set('" + targetPath + "', '" + targetValue + "')");
- }
- else {
- writeFn(targetPath, targetValue);
- }
- }
- });
- }
- });
- };
- trav("");
- }
- /**
- * 尝试去掉变量两边括号
- * {a} => a
- * a => a
- */
- function tryVarSimple(value) {
- if (SIMPLE_RE.test(value)) {
- // If we have '{foo}' alone it is a literal 简单表达式
- return value.substring(1, value.length - 1);
- }
- return value;
- }
- /**
- * 对多个表达式进行求值. 异步回调的方式返回
- * {
- * a: 1,
- * b: '{someBind}',
- * c: ['a', 'b', 'c'],
- * d: ['a', 'b', '{someBind}'],
- * e: {
- * y: 1,
- * z: 2
- * },
- * f: {
- * y: 1,
- * z: '{someBind}'
- * }
- * }
- *
- * // Will produce
- * {
- * b: value,
- * d: ['a', 'b', value],
- * f: {
- * y: 1,
- * z: value
- * }
- * }
- * @param viewModel scope.viewModel对象
- * @param paramObject 求值对象
- */
- function calcObject(viewModel, paramObject) {
- // new Ext.app.bind.Multi({a:'1',b:'ddd{query.WH_ID}'},currentScope.viewModel,function(v){console.log(v)},currentScope, {single: true})
- return new Promise(function (resolve) {
- var schedule = new Ext.app.bind.Multi(paramObject, viewModel, function (ret) {
- schedule.destroy();
- // 从 Ext.data.Model 对象转换为 js-object 对象
- ret = toPlainObject(ret);
- resolve(ret);
- }, viewModel, { single: true });
- });
- }
- /**
- * 用于任意组件 Ext.Component 构造时,获取当前组件对应的表格(如果不是 grid.columns 对象就会返回 undefined)
- * @param config 组件构造函数传入的 config 配置文件
- */
- function getParentGrid(config) {
- var _a;
- return (_a = config.$initParent) === null || _a === void 0 ? void 0 : _a.grid;
- }
- /**
- * 解析
- * {
- * condition: "{skuId}",
- * errorMsg: "无法编辑",
- * notice: 'msg'
- * }
- */
- function tryEnable(data, enableSetting) {
- if (!enableSetting) {
- // 没有这一段配置,可以编辑
- return true;
- }
- var condition = enableSetting.condition, errorMsg = enableSetting.errorMsg, notice = enableSetting.notice;
- if (!evalFunction(data, condition)) {
- // 没有达成 condition 条件
- // 计算 msg 消息内容
- var msgContent = calcExpress(data, errorMsg);
- if (msgContent) {
- if (!notice || notice === 'msg') {
- // 进行提示
- msg$1(msgContent);
- }
- }
- return false;
- }
- return true;
- }
- /**
- * 动态的为 combo 或 columns.combo 设置下拉框的值
- * @param sender 目标对象
- * @param config 目标对象的配置(在构造函数之前也可以)
- * @param getDictFn 获取字典的方法
- * @param bizKey 传入字典的参数
- * @param multiValueSeparator 多个字典值的分割符号
- */
- function setComboStore(sender, config, getDictFn, bizKey, multiValueSeparator) {
- if (multiValueSeparator === void 0) { multiValueSeparator = ""; }
- // sender 和 config为空的时候获取值、
- if (_$2.isArray(getDictFn)) {
- // 如果 getDictFn 是直接给定的值,就造一个异步回调的方法
- var realArray_1 = getDictFn;
- getDictFn = function () {
- return realArray_1;
- };
- }
- if (!sender) {
- return new Promise(function (resolve, reject) {
- getDictFn(bizKey, function (r) {
- resolve({ config: config, r: r });
- });
- });
- }
- if (sender.xtype === 'combotree') {
- getDictFn(bizKey, function (r) {
- if (sender.store) {
- // 异步回传
- sender.setStore(new Ext.data.TreeStore({ root: r }));
- }
- else {
- // 同步回传
- config.store = new Ext.data.TreeStore({ root: r });
- }
- });
- return;
- }
- else if (sender.$className === 'Ext.form.field.ComboBox' || sender.$className === 'Ext.form.field.Tag') {
- getDictFn(bizKey, function (r) {
- var _a, _b;
- if (sender.store) {
- // 异步回传
- sender.setStore(new Ext.data.Store(r));
- // 这里有个bug, 异步回传完毕之后, 需要强制刷新一下
- // 否则在 forceSelection 的模式下。displayField 不会强制做变更
- var realValue = (_b = (_a = sender.bind) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.getValue();
- if (typeof realValue !== 'undefined') {
- sender.setValue(realValue);
- }
- }
- else {
- // 同步回传
- config.store = new Ext.data.Store(r);
- }
- });
- return;
- }
- else if (sender.xtype === 'gridcolumn') {
- var grid = getParentGrid(config);
- var editor_1 = config.editor, renderer = config.renderer;
- getDictFn(bizKey, function (r) {
- if (sender.store) {
- // 已经渲染出来了, 用方法进行修改
- var editor_2 = sender.getEditor();
- if (editor_2 && editor_2.xtype === 'combo') {
- var valueField_1 = r.field[0];
- var displayField_1 = r.field[1];
- editor_2.valueField = valueField_1;
- editor_2.setDisplayField(displayField_1);
- editor_2.setStore(new Ext.data.Store(r));
- }
- sender.setFilter({
- type: 'list',
- options: _$2.map(r.data, function (r) { return ({
- id: '' + r.id,
- text: r.text,
- }); })
- });
- }
- else {
- // 没有渲染之前,修改 config 即可
- if (editor_1 && editor_1.xtype === 'combo') {
- // 带编辑模式
- editor_1.store = new Ext.data.Store(r);
- }
- config.filter = {
- type: 'list',
- options: _$2.map(r.data, function (r) { return ({
- id: '' + r.id,
- text: r.text,
- }); })
- };
- }
- // 当 metaData === true 表示反向取字典 (根据字典显示值获取id值)
- var renderer = function (value, metaData) {
- if (metaData === void 0) { metaData = false; }
- if (!value && value != 0) {
- return '';
- }
- var valueField = r.field[metaData === true ? 1 : 0];
- var displayField = r.field[metaData === true ? 0 : 1];
- var separator = multiValueSeparator;
- if (separator) {
- var arr = value.split(separator);
- var displayValue_1 = "";
- var _loop_1 = function (i) {
- var itv = arr[i];
- if (i > 0) {
- displayValue_1 += separator;
- }
- _$2.each(r.data, function (row) {
- // 从 valueField 找到要显示的 displayField
- if (row[valueField] == itv) {
- displayValue_1 += row[displayField];
- return false;
- }
- else {
- if (i >= r.data.length - 1) {
- displayValue_1 += itv;
- }
- }
- });
- };
- for (var i = 0; i < arr.length; i++) {
- _loop_1(i);
- }
- return displayValue_1;
- }
- _$2.each(r.data, function (row) {
- // 从 valueField 找到要显示的 displayField
- if (row[valueField] == value) {
- value = row[displayField];
- return false;
- }
- });
- return value;
- };
- var dictForExcel = {};
- var valueField = r.field[0];
- var displayField = r.field[1];
- _$2.each(r.data, function (row) {
- // 从 valueField 找到要显示的 displayField
- var key = row[valueField];
- if (key != '' && typeof key != "undefined" && key != null) {
- dictForExcel[key] = row[displayField];
- }
- });
- if (sender.rendered) {
- // 已经渲染出来了, 对列进行渲染
- sender.renderer = renderer;
- sender.dictForExcel = dictForExcel;
- sender.getView().refresh();
- }
- else {
- sender.renderer = renderer;
- sender.dictForExcel = dictForExcel;
- config.renderer = renderer;
- config.dictForExcel = dictForExcel;
- }
- });
- return;
- }
- throw new TypeError("无法识别的组件类型");
- }
- /**
- * 调用服务器 Ajax
- */
- function invokeServer$1(url) {
- var args = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- args[_i - 1] = arguments[_i];
- }
- // @ts-ignore
- return ajax.func({
- url: url,
- method: 'invoke',
- args: args
- });
- }
- function clearViewModelValues(viewModel, propertyName) {
- if (!propertyName) {
- var dd_1 = viewModel.getData();
- _$2.forOwn(dd_1, function (value, key) {
- viewModel.set(key, '');
- });
- return;
- }
- var dd = _$2.get(viewModel.getData(), propertyName);
- _$2.forOwn(dd, function (value, key) {
- viewModel.set(propertyName + '.' + key, '');
- });
- }
- function reloadGrid(scope, gridRefName) {
- var _a;
- (_a = scope.refs[gridRefName]) === null || _a === void 0 ? void 0 : _a.reload();
- }
- /**
- * 将 Ext.data.Model 对象 (及子属性) 转换为 js.object 对象
- */
- function toPlainObject(obj) {
- if (obj.isModel) {
- obj = obj.data;
- }
- _$2.forOwn(obj, function (v, k) {
- // Ext.data.Model.constructor
- if (!v) {
- return;
- }
- if (v.isModel) {
- v = v.data;
- }
- if (typeof v === 'object') {
- obj[k] = toPlainObject(v);
- }
- else {
- obj[k] = v;
- }
- });
- return obj;
- }
- function confirm(msg, sender) {
- return new Promise(function (resolve) {
- var _a, _b;
- var scope = (_a = lookupScope(sender)) === null || _a === void 0 ? void 0 : _a.topScope;
- var t = { msg: msg };
- var WMSTranslate = window["WMSTranslate"];
- if (WMSTranslate) {
- if (typeof window['viewTranslate'] === 'function') {
- window['viewTranslate'](t, msg, "msg");
- }
- }
- var config = {
- title: '请确认',
- modal: true,
- animateTarget: sender,
- // resizable: false,
- // constrainHeader: true,
- // constrain: true,
- // constrainTo: scope._handle?.el?.dom || Ext.getBody(),
- layout: {
- type: 'hbox',
- pack: 'start',
- align: 'stretch'
- },
- items: [
- {
- html: '<i class="x-fa fa-question-circle" style="font:normal normal normal 40px/1 FontAwesome;color: #31708f;"></i>',
- border: false,
- },
- {
- flex: 1,
- border: false,
- html: "<div style=\"min-width: 170px;min-height: 25px;max-width: 400px;\">" + _$2.escape(t.msg) + "</div>"
- }
- ],
- buttons: [
- {
- xtype: 'button', text: '确定', iconCls: 'x-fa fa-check-circle',
- handler: function () {
- resolve();
- win.close();
- }
- },
- {
- xtype: 'button', text: '取消', iconCls: 'x-fa fa-power-off',
- handler: function () {
- win.close();
- }
- }
- ],
- keyMapEnabled: true,
- keyMap: {
- ENTER: function () {
- resolve();
- win.close();
- }
- }
- };
- if (scope === null || scope === void 0 ? void 0 : scope._handle) {
- config.constrain = true;
- }
- var win = new Ext.Window(config);
- if (scope === null || scope === void 0 ? void 0 : scope._handle) {
- (_b = scope === null || scope === void 0 ? void 0 : scope._handle) === null || _b === void 0 ? void 0 : _b.add(win);
- }
- win.show();
- });
- }
- /**
- * 任何符号字符串都替换成下换线
- */
- function normId(value) {
- return _$2.replace(value, /[^\w]/g, '_');
- }
- /**
- *
- * @param sender
- * @param propertyName
- * @param gridRefName
- */
- function clearViewModelReloadGrid(sender, propertyName, gridRefName) {
- var _a, _b;
- var scope = lookupScope(sender);
- clearViewModelValues(scope.viewModel, propertyName);
- if (!gridRefName) {
- (_a = scope.down('grid')) === null || _a === void 0 ? void 0 : _a.reload();
- }
- else {
- (_b = scope.refs[gridRefName]) === null || _b === void 0 ? void 0 : _b.reload();
- }
- }
- var keydown_fun_item = _$2.debounce(function (sender, event, eOpts) {
- if ([10, 13, 20, 40].includes(event.keyCode)) {
- // 获取读码器读取的内容,最好不要从 viewModel 中取值,而是从 sender.rawValue 中取值
- var value = _$2.trim(sender.rawValue);
- raiseClick(eOpts.handle);
- }
- }, 150);
- function saveGridRow(grid1) {
- var _a;
- var config = grid1.config;
- var scope = lookupScope(grid1);
- var saveRowValues = (_a = _$2.get(config, 'behavior.saveRowValues')) !== null && _a !== void 0 ? _a : {};
- saveRowValues = calcObjectFlat(scope.viewModel.data, saveRowValues);
- // "表格保存"的相关配置
- var dbSaveConfig = {
- columns: [],
- dbTableName: _$2.get(config, 'behavior.dbTableName'),
- saveRowValues: saveRowValues,
- path: scope.originalVjson.__custom_path,
- };
- var _b = getGridEditRows(grid1), newRows = _b.newRows, modifyRows = _b.modifyRows, removeRecords = _b.removeRecords, rows = _b.rows, err = _b.err;
- if (err) {
- // 如果有异常就不保存
- return;
- }
- // 构建"表格保存"的相关配置
- for (var i = 0; i < config.columns.length; i++) {
- var c = config.columns[i];
- var v = {
- dataIndex: c.dataIndex,
- header: c.header,
- dbColumn: c.dbColumn,
- serverCreateValue: c.serverCreateValue,
- dbIsDeleteKey: c.dbIsDeleteKey,
- dbIsUpdateKey: c.dbIsUpdateKey,
- dbUpdateEnable: c.dbUpdateEnable,
- serverValueConvert: c.dbUpdateEnable,
- };
- if (c.editor) {
- v.editor = {
- xtype: c.editor.xtype,
- required: c.editor.required,
- };
- }
- dbSaveConfig.columns.push(v);
- }
- // 进行业务上的逻辑校验
- var hasError = false;
- _$2.forEach(rows, function (row, i) {
- for (var i_1 = 0; i_1 < config.columns.length; i_1++) {
- var c = config.columns[i_1];
- var value = row[c.dataIndex];
- if (_$2.get(c, 'editor.required') === true && isEmpty(value)) {
- msg$1("\"" + c.header + "\" \u4E0D\u80FD\u4E3A\u7A7A!");
- hasError = true;
- return false;
- }
- if (c.xtype === 'checkcolumn') {
- if (value === false && typeof c.uncheckedValue !== 'undefined') {
- row[c.dataIndex] = c.uncheckedValue;
- }
- if (value === true && typeof c.checkedValue !== 'undefined') {
- row[c.dataIndex] = c.checkedValue;
- }
- }
- }
- });
- if (hasError) {
- return;
- }
- // 设置当前界面为 "保存中..." 状态
- grid1.setLoading(true);
- invokeServer$1('/Dev@batchSave', {
- newRows: newRows,
- modifyRows: modifyRows,
- removeRecords: removeRecords,
- config: dbSaveConfig,
- }).then(function (res) {
- // 保存成功就提示一下,并重新载入数据 (根据 dataSource 的设置)
- msg$1(res.msg);
- grid1.reload();
- }).catch(function (e) {
- console.error(e);
- showErrorDialog$1(_$2.toString(e));
- }).finally(function () {
- // 无论正常异常,关闭 "保存中..." 状态
- grid1.setLoading(false);
- });
- }
- function insertGridRow(grid1) {
- var config = grid1.config;
- var focusColumnAfterInsert = _$2.get(config, 'behavior.focusColumnAfterInsert');
- var insertRow = {};
- _$2.forEach(config.columns, function (c) {
- var fn = c.createValue;
- if (_$2.startsWith(fn, 'scope.') ||
- _$2.startsWith(fn, 'system.')) {
- var scope = lookupScope(grid1);
- var fn2 = lookupFn(scope, fn, c);
- if (_$2.isFunction(fn2)) {
- var newValue = fn2();
- if (!_$2.isUndefined(newValue)) {
- insertRow[c.dataIndex] = newValue;
- }
- }
- }
- else if (_$2.isString(fn) && fn) {
- insertRow[c.dataIndex] = fn;
- }
- });
- grid1.appendEditRow(insertRow, focusColumnAfterInsert);
- }
- function commitMe(sender) {
- var window = sender.up('window');
- var scope = lookupScope(sender);
- if (typeof scope['commit'] === 'function') {
- scope['commit']().then(function (res) {
- window.close();
- });
- }
- }
- function removeGridRow(grid1) {
- var _a;
- var config = grid1.config;
- var rows = [];
- if (grid1.selModel.selType === "rowmodel") {
- rows.push(grid1.selection);
- }
- else {
- (_a = grid1.getSelectionModel().getSelected()) === null || _a === void 0 ? void 0 : _a.eachRow(function (r) {
- rows.push(r);
- });
- }
- if (rows.length > 1) {
- var batchRemoveConfirm = _$2.get(config, 'behavior.batchRemoveConfirm');
- if (_$2.isUndefined(batchRemoveConfirm)) {
- //不需要提示
- _$2.forEach(rows, function (r) {
- grid1.getStore().remove(r);
- });
- }
- else {
- var tip = _$2.replace(batchRemoveConfirm, '{count}', '' + rows.length);
- confirm(tip).then(function () {
- _$2.forEach(rows, function (r) {
- grid1.getStore().remove(r);
- });
- });
- }
- }
- else if (rows.length === 1) {
- var singleRemoveConfirm = _$2.get(config, 'behavior.singleRemoveConfirm');
- if (_$2.isUndefined(singleRemoveConfirm)) {
- //不需要提示
- grid1.getStore().remove(rows[0]);
- }
- else {
- var tip_1 = _$2.replace(singleRemoveConfirm, '{count}', '' + rows.length);
- _$2.forEach(config.columns, function (c) {
- tip_1 = _$2.replace(tip_1, "{" + c.dataIndex + "}", rows[0].get(c.dataIndex));
- });
- confirm(tip_1).then(function () {
- grid1.getStore().remove(rows[0]);
- });
- }
- }
- else {
- msg$1('请选择要删除的数据!');
- }
- }
- function moveUpGridRow(grid) {
- grid.rowMoveUp();
- }
- function moveDownGridRow(grid) {
- grid.rowMoveDown();
- }
- var SystemEventFu = /** @class */ (function () {
- function SystemEventFu() {
- }
- SystemEventFu.prototype.moveUpGridRow = function () {
- return function (sender) {
- var grid1 = sender.up('yvgrid');
- moveUpGridRow(grid1);
- };
- };
- SystemEventFu.prototype.commitMe = function () {
- return function (sender) {
- commitMe(sender);
- };
- };
- SystemEventFu.prototype.moveDownGridRow = function () {
- return function (sender) {
- var grid1 = sender.up('yvgrid');
- moveDownGridRow(grid1);
- };
- };
- SystemEventFu.prototype.saveGridRow = function () {
- return function (sender) {
- var grid1 = sender.up('yvgrid');
- saveGridRow(grid1);
- };
- };
- SystemEventFu.prototype.insertGridRow = function () {
- return function (sender) {
- var grid1 = sender.up('yvgrid');
- insertGridRow(grid1);
- };
- };
- SystemEventFu.prototype.removeGridRow = function () {
- return function (sender) {
- var grid1 = sender.up('yvgrid');
- removeGridRow(grid1);
- };
- };
- SystemEventFu.prototype.enterToClick = function (btnReferenceName) {
- return function (sender, config) {
- if (!config.listeners) {
- config.listeners = {};
- }
- config.listeners.afterrender = function (sender) {
- var scope = lookupScope(sender);
- // $(sender.el.dom).on('keydown', (e) => {
- // const xtype = Ext.fly(e.target).component.xtype
- // if (xtype === 'textfield' && e.keyCode === 13) {
- // Ext.defer(() => {
- // raiseClick(scope.refs[btnReferenceName])
- // })
- // e.preventDefault()
- // e.stopPropagation()
- // return false
- // }
- // })
- $(sender.el.dom).on('keyup', function (e) {
- var tt = Ext.fly(e.target).component;
- var xtype = tt === null || tt === void 0 ? void 0 : tt.xtype;
- if ((xtype !== 'textfield' && xtype !== 'numberfield') ||
- ![10, 13, 20, 40].includes(e.keyCode)) {
- return;
- }
- e.preventDefault();
- e.stopPropagation();
- keydown_fun_item(tt, e, { handle: scope.refs[btnReferenceName] });
- return;
- });
- };
- };
- };
- SystemEventFu.prototype.confirm = function (text, fn) {
- return function (sender) {
- var scope = lookupScope(sender);
- var msg = calcExpress(scope.viewModel.data, text);
- confirm(msg, sender).then(function () {
- fn.call(scope, sender);
- });
- };
- };
- SystemEventFu.prototype.gridRemoveCurrentRow = function (gridRefName) {
- return function (sender) {
- var scope = lookupScope(sender);
- var grid = scope.refs[gridRefName];
- if (grid) {
- var records = grid.getSelectionModel().getLastSelected();
- grid.store.remove(records);
- }
- };
- };
- SystemEventFu.prototype.loadForm = function (invokeUrl, invokeParam,
- //可以是 scope.XX / system.XX / string / lookup表达式
- writeTarget) {
- return function (sender) {
- if (!invokeUrl) {
- return;
- }
- var scope = lookupScope(sender);
- scope.setLoading(true);
- var data = scope.viewModel.data;
- if (invokeParam) {
- data = calcObjectFlat(data, invokeParam);
- }
- invokeServer$1(invokeUrl, data).then(function (res) {
- if (res.success) {
- if (typeof writeTarget === "string") {
- _$2.forOwn(res.data, function (v, k) {
- scope.viewModel.set(writeTarget + "." + k, v);
- });
- }
- else if (typeof writeTarget === 'function') {
- writeTarget.call(scope, res.data);
- }
- else if (typeof writeTarget === 'object') {
- var ret = calcObjectFlat(res.data, writeTarget);
- _$2.forOwn(ret, function (v, k) {
- scope.viewModel.set(k, v);
- });
- }
- }
- else {
- showErrorDialog$1(res.msg || '未知错误', sender);
- }
- }).catch(function (e) {
- var _a, _b;
- var msg = (_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg;
- showErrorDialog$1(msg || e.toString(), sender);
- }).finally(function () {
- scope.setLoading(false);
- });
- };
- };
- SystemEventFu.prototype.commit = function (groovyUrl, arg0, successCallback) {
- return function (sender) {
- var scope = lookupScope(sender);
- scope.setLoading(true);
- var data = scope.viewModel.data;
- if (arg0) {
- data = calcObjectFlat(data, arg0);
- }
- invokeServer$1(groovyUrl, data).then(function (res) {
- if (res.success) {
- if (res.msg) {
- msg(res.msg);
- }
- if (typeof successCallback === 'function') {
- successCallback.call(scope, sender, res.data);
- }
- }
- else {
- showErrorDialog$1(res.msg || '未知错误', sender);
- }
- }).catch(function (e) {
- var _a, _b;
- var msg = (_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg;
- showErrorDialog$1(msg || e.toString(), sender);
- }).finally(function () {
- scope.setLoading(false);
- });
- };
- };
- SystemEventFu.prototype.formCommit = function (groovyUrl, arg0) {
- return function (sender) {
- var scope = lookupScope(sender);
- var form = scope.down('form');
- if (form) {
- // 如果下级有表单,就做表单校验
- var valid = form.isValid();
- if (!valid) {
- return;
- }
- }
- scope.setLoading(true);
- var data = scope.viewModel.data;
- if (arg0) {
- data = calcObjectFlat(data, arg0);
- }
- invokeServer$1(groovyUrl, data).then(function (res) {
- if (res.success) {
- if (res.msg) {
- msg(res.msg);
- }
- scope.dialogSuccess(res);
- }
- else {
- showErrorDialog$1(res.msg || '未知错误', sender);
- }
- }).catch(function (e) {
- var _a, _b;
- var msg = (_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg;
- showErrorDialog$1(msg || e.toString(), sender);
- }).finally(function () {
- scope.setLoading(false);
- });
- };
- };
- SystemEventFu.prototype.dialogSuccess = function (lookupObject) {
- return function (sender) {
- var scope = lookupScope(sender);
- if (lookupObject) {
- scope.dialogSuccess(calcObjectFlat(scope.viewModel.data, lookupObject));
- }
- else {
- scope.dialogSuccess();
- }
- };
- };
- SystemEventFu.prototype.clearViewModelValues = function (propertyName) {
- return function (sender) {
- var scope = lookupScope(sender);
- clearViewModelValues(scope.viewModel, propertyName);
- };
- };
- SystemEventFu.prototype.getGrid = function (url) {
- return function (sender, config) {
- if (config.xtype == "combogridmulti") {
- // @ts-ignore
- require([url], function (grid) {
- _$2.forOwn(grid.default, function (v, k) {
- sender[k] = v;
- sender.config[k] = v;
- if (sender.rendered) {
- // 已经渲染出来了,重新调用 reload 强制刷新
- sender.reload();
- }
- });
- });
- }
- else {
- // @ts-ignore
- require([url], function (grid) {
- sender.grid = grid.default;
- config.grid = grid.default;
- });
- }
- };
- };
- SystemEventFu.prototype.clearViewModelReloadGrid = function (propertyName, gridRefName) {
- return function (sender) {
- clearViewModelReloadGrid(sender, propertyName, gridRefName);
- };
- };
- SystemEventFu.prototype.reloadGrid = function (gridRefName) {
- return function (sender) {
- var _a, _b;
- var scope = lookupScope(sender);
- if (!gridRefName) {
- (_a = scope.down('grid')) === null || _a === void 0 ? void 0 : _a.reload();
- }
- else {
- (_b = scope.refs[gridRefName]) === null || _b === void 0 ? void 0 : _b.reload();
- }
- };
- };
- SystemEventFu.prototype.showDialog = function (url, lookupForData, successCallback) {
- return function (sender) {
- var scope = lookupScope(sender);
- var data = scope.viewModel.data;
- var param = calcObjectFlat(data, lookupForData);
- // @ts-ignore
- require([url], function (module) {
- var ScopeClass = module.default;
- var scope = new ScopeClass();
- scope.success = successCallback;
- scope.showDialog(sender, {}, { data: param });
- });
- };
- };
- SystemEventFu.prototype.showWidget = function (widgetUrl, lookup) {
- return function (sender, queryValue) {
- showWidget(widgetUrl, lookup, sender, queryValue);
- };
- };
- SystemEventFu.prototype.clearViewModelByLookup = function (lookup) {
- return function (sender) {
- clearViewModelByLookup(sender, lookup);
- };
- };
- SystemEventFu.prototype.closeMe = function (callBack) {
- return function (sender) {
- var scope = lookupScope(sender);
- scope.close();
- if (callBack) {
- callBack.call(sender);
- }
- };
- };
- // 未完成
- SystemEventFu.prototype.showDialogAndFillData = function (url, lookupForData, map) {
- return function (sender) {
- var scope = lookupScope(sender);
- var data = scope.viewModel.data;
- var billSetting = scope.billSetting;
- var param = calcObjectFlat(data, lookupForData);
- return new Promise(function (resolve, reject) {
- var sf = function (scope) {
- scope.success = function (dlgScope, dlgSender, reData) {
- };
- scope.showDialog(sender, {}, { data: param });
- };
- // @ts-ignore
- require([url], function (module) {
- // 业务描述文件
- if (url.endsWith(".bill")) {
- ScopeEngine.buildScopeFromBillFile(module.default).then(function (scope) {
- sf(scope);
- });
- }
- else { //原生yvanui文件
- var ScopeClass = module.default;
- var scope_1 = new ScopeClass();
- sf(scope_1);
- }
- });
- });
- };
- };
- __decorate([
- Lib({
- title: '为某个表格,上移行',
- author: '罗一帆', createAt: '2022-07-19', updateAt: '2022-07-19', type: 'system', category: '表格',
- }),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", []),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "moveUpGridRow", null);
- __decorate([
- Lib({
- title: '为某个表格,上移行',
- author: '罗一帆', createAt: '2022-07-19', updateAt: '2022-07-19', type: 'system', category: '表格',
- }),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", []),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "commitMe", null);
- __decorate([
- Lib({
- title: '为某个表格,下移行',
- author: '罗一帆', createAt: '2022-07-19', updateAt: '2022-07-19', type: 'system', category: '表格',
- }),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", []),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "moveDownGridRow", null);
- __decorate([
- Lib({
- title: '为某个表格,批量保存至数据库',
- author: '罗一帆',
- createAt: '2022-07-19',
- updateAt: '2022-07-19',
- type: 'system',
- category: '表格',
- }),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", []),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "saveGridRow", null);
- __decorate([
- Lib({
- title: '为某个表格插入数据行',
- author: '罗一帆',
- createAt: '2022-07-19',
- updateAt: '2022-07-19',
- type: 'system',
- category: '表格',
- }),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", []),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "insertGridRow", null);
- __decorate([
- Lib({
- title: '为某个表格删除所选数据行',
- author: '罗一帆',
- createAt: '2022-07-19',
- updateAt: '2022-07-19',
- type: 'system',
- category: '表格',
- }),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", []),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "removeGridRow", null);
- __decorate([
- Lib({
- title: '按下回车键之后默认是否按下某个按钮',
- author: '罗一帆',
- createAt: '2021-07-02',
- updateAt: '2021-07-02',
- type: 'system',
- category: '字典',
- }),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [Object]),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "enterToClick", null);
- __decorate([
- Lib({
- title: '弹出确认对话框,回答 YES 之后调用某方法',
- author: '罗一帆',
- createAt: '2021-07-06',
- updateAt: '2021-07-06',
- type: 'system',
- category: '对话框',
- }),
- __param(0, LibParam('对话框的确认文字', 'string')),
- __param(1, LibParam('确认之后的调用的方法', 'event')),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [Object, Object]),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "confirm", null);
- __decorate([
- Lib({
- title: '删除表格当前的选中行(前端删除)',
- author: '罗一帆',
- createAt: '2021-07-08',
- updateAt: '2021-07-08',
- type: 'system',
- category: '表格',
- }),
- __param(0, LibParam('表格引用名', 'refs')),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [Object]),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "gridRemoveCurrentRow", null);
- __decorate([
- Lib({
- title: '查询表单,如果 url 为空值,就取消查询',
- author: '罗一帆',
- createAt: '2021-07-06',
- updateAt: '2021-07-06',
- type: 'system',
- category: '表单',
- }),
- __param(0, LibParam('后端服务路径', 'string')),
- __param(1, LibParam('后端需要的数据,默认情况提交所有', 'lookup', true)),
- __param(2, LibParam('提交成功后的回调', 'viewModel', true)),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [String, Object, Object]),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "loadForm", null);
- __decorate([
- Lib({
- title: '提交(不做校验、不关闭窗体)',
- author: '罗一帆',
- createAt: '2021-07-02',
- updateAt: '2021-07-02',
- type: 'system',
- category: '表单',
- }),
- __param(0, LibParam('后端服务路径', 'string')),
- __param(1, LibParam('后端需要的数据,默认情况提交所有', 'lookup', true)),
- __param(2, LibParam('提交成功后的回调', 'event', true)),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [String, Object, Object]),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "commit", null);
- __decorate([
- Lib({
- title: '提交表单',
- author: '罗一帆',
- createAt: '2021-07-02',
- updateAt: '2021-07-02',
- type: 'system',
- category: '表单',
- }),
- __param(0, LibParam('后端服务路径', 'string')),
- __param(1, LibParam('后端需要的参数,默认情况提交所有', 'lookup', true)),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [String, Object]),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "formCommit", null);
- __decorate([
- Lib({
- title: '对话框成功回调',
- author: '罗一帆',
- createAt: '2021-07-02',
- updateAt: '2021-07-02',
- type: 'system',
- category: '对话框',
- }),
- __param(0, LibParam('传回给父窗口的成功参数对象', 'lookup', true)),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [Object]),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "dialogSuccess", null);
- __decorate([
- Lib({
- title: '清空 viewModel 某个属性',
- author: '罗一帆',
- createAt: '2021-07-02',
- updateAt: '2021-07-02',
- type: 'system',
- category: '表单',
- }),
- __param(0, LibParam('属性路径', 'viewModel', true)),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [String]),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "clearViewModelValues", null);
- __decorate([
- Lib({
- title: '从其他资源获取表格设置',
- author: '罗一帆',
- createAt: '2021-07-02',
- updateAt: '2021-07-02',
- type: 'system',
- category: '表单',
- }),
- __param(0, LibParam('定义文件', 'module')),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [Object]),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "getGrid", null);
- __decorate([
- Lib({
- title: '清空 viewModel 某个属性,并刷新表格',
- author: '罗一帆',
- createAt: '2021-07-02',
- updateAt: '2021-07-02',
- type: 'system',
- category: '表单',
- }),
- __param(0, LibParam('清空的属性', 'viewModel')),
- __param(1, LibParam('要刷新的表格', 'refs', true)),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [String, String]),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "clearViewModelReloadGrid", null);
- __decorate([
- Lib({
- title: '刷新表格',
- author: '罗一帆',
- createAt: '2021-07-02',
- updateAt: '2021-07-02',
- type: 'system',
- category: '表单',
- }),
- __param(0, LibParam('表格对象,不填的情况下就是第一个表格', 'refs', true)),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [String]),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "reloadGrid", null);
- __decorate([
- Lib({
- title: '显示对话框',
- author: '罗一帆',
- createAt: '2021-07-02',
- updateAt: '2021-07-02',
- type: 'system',
- category: '对话框',
- }),
- __param(0, LibParam('业务模块名', 'module')),
- __param(1, LibParam('参数数据 lookup 表达式', 'lookup', true)),
- __param(2, LibParam('成功回调(对话框成功结束后的回调方法)', 'event', true)),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [String, Object, Object]),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "showDialog", null);
- __decorate([
- Lib({
- title: '弹出查找框(不借助 search)',
- author: '罗一帆',
- createAt: '2021-07-02',
- updateAt: '2021-07-02',
- type: 'system',
- category: '对话框',
- }),
- __param(0, LibParam('模块名 (WidgetDialog)', 'module')),
- __param(1, LibParam('lookup 映射关系', 'lookup', true)),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [Object, Object]),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "showWidget", null);
- __decorate([
- Lib({
- title: '根据 lookup 清空 viewModel',
- author: '罗一帆',
- createAt: '2021-07-05',
- updateAt: '2021-07-05',
- type: 'system',
- category: '表单',
- }),
- __param(0, LibParam('设值表达式', 'lookup')),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [Object]),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "clearViewModelByLookup", null);
- __decorate([
- Lib({
- title: '关闭对话框',
- author: '罗一帆',
- createAt: '2021-07-05',
- updateAt: '2021-07-05',
- type: 'system',
- category: '对话框',
- }),
- __param(0, LibParam('对话框的返回值回调', 'event', true)),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [Object]),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "closeMe", null);
- __decorate([
- Lib({
- title: '打开对话框并返回数据',
- author: '余亮',
- createAt: '2022-07-07',
- updateAt: '2022-07-07',
- type: 'system',
- category: '对话框',
- }),
- __param(0, LibParam('业务模块名', 'module')),
- __param(1, LibParam('参数数据 lookup 表达式', 'lookup', true)),
- __param(2, LibParam('结果映射关系', 'string', true)),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [String, Object, Object]),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "showDialogAndFillData", null);
- return SystemEventFu;
- }());
- /**
- * 清空 viewmodel 里下属的所有属性
- * @param viewModel VM对象
- * @param propertyKey 要清空的属性,可以是 "a.b.c" 这种表达模式
- * @param ignoreProps 要忽略清空的属性名集合, 比如 ["a.b","b"]
- */
- function clearViewModel(viewModel, propertyKey, ignoreProps) {
- var data = viewModel.data;
- if (propertyKey) {
- data = _$2.get(data, propertyKey);
- }
- _$2.forOwn(data, function (value, key) {
- var targetKey = propertyKey ? propertyKey + "." + key : key;
- if (ignoreProps && _$2.indexOf(ignoreProps, targetKey) >= 0) {
- return;
- }
- viewModel.set(targetKey, '');
- });
- }
- function clearViewModelByLookup(sender, lookup) {
- if (_$2.isPlainObject(lookup)) {
- var parentScope_1 = lookupScope(sender);
- _$2.forOwn(lookup, function (value, key) {
- if (SIMPLE_RE.test(value)) {
- // '{foo}' 简单表达式
- var path = value.substring(1, value.length - 1);
- if (path !== 'queryValue') {
- parentScope_1.viewModel.set(path, '');
- }
- }
- });
- }
- }
- function showWidget(widgetUrl, lookup, sender, queryValue, vjson) {
- if (vjson === void 0) { vjson = {}; }
- var parentScope = lookupScope(sender);
- var me = sender;
- // @ts-ignore
- require([widgetUrl], function (widgetScope) {
- var WidgetScopeClass = widgetScope.default;
- widgetScope = new WidgetScopeClass();
- // 传递进 widget.model 的数据
- var widgetDialogData = calcObjectFlat(__assign({ queryValue: queryValue }, parentScope.viewModel.data), lookup);
- widgetScope.parentScope = parentScope;
- widgetScope.searchWidgetSuccess = function (data) {
- if (typeof lookup === 'string') {
- // lookup 是字符串的情况下,就是取某个列作为 value 值
- me.setValue(data[lookup]);
- return;
- }
- /**
- * lookup: {
- * // 扩展到 viewModel 的值做更改
- * WH_CODE: "{queryValue}",
- * WH_NAME: "{query.WH_NAME}",
- * }
- */
- if (_$2.isPlainObject(lookup)) {
- var parentScope_2 = lookupScope(sender);
- tryWriteObject(lookup, data, function (path, value) {
- if (path === 'queryValue') {
- me.setValue(value);
- }
- else {
- parentScope_2.viewModel.set(path, value);
- }
- });
- }
- return true;
- };
- widgetScope.showDialog(sender, vjson, { data: widgetDialogData });
- });
- }
- /**
- * 停止事件的默认行为
- * @param e
- */
- function stopEvent(e) {
- e.preventDefault();
- e.stopPropagation();
- // @ts-ignore
- window.event.cancelBubble = true;
- e.returnValue = false;
- e.cancelBubble = true;
- }
- /**
- * 屏幕中央显示一个黑框提示
- */
- function msg$1(content) {
- msg(content);
- }
- /**
- * 错误对话框的强提醒
- */
- function showErrorDialog$1(msg, sender) {
- showErrorDialog(msg, sender);
- }
- /**
- * 错误对话框的强提醒
- */
- function showInfoDialog(msg, sender) {
- showInfoDialogSimple(msg, sender);
- }
- /**
- * 错误对话框的强提醒
- */
- function prompt$2(message, defaultValue, multiLine) {
- if (defaultValue === void 0) { defaultValue = ""; }
- if (multiLine === void 0) { multiLine = false; }
- return prompt$1(message, defaultValue, multiLine);
- }
- /**
- * 用于计算 express 表达式
- */
- function evalFunction(data, express) {
- var keys = [];
- var values = [];
- _$2.forOwn(data, function (value, key) {
- var match = key.match(/\-|\*|\\|\/|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)/i);
- if (match) {
- key = key.substring(0, match.index);
- }
- keys.push(key);
- values.push(value);
- });
- var func = Function.apply(void 0, __spread(keys, ['return ' + express]));
- try {
- return func.apply(void 0, __spread(values));
- }
- catch (e) {
- return;
- }
- }
- /**
- * 获取表格编辑的行数据
- */
- function getGridEditRows(grid) {
- return grid.getGridEditRows();
- }
- //# sourceMappingURL=systemLib.js.map
- var SystemLib = /*#__PURE__*/Object.freeze({
- __proto__: null,
- SIMPLE_RE: SIMPLE_RE,
- pinyinMatch: pinyinMatch,
- calcExpress: calcExpress,
- calcObjectFlat: calcObjectFlat,
- mergeViewModel: mergeViewModel,
- flatRow: flatRow,
- replaceNA: replaceNA,
- deepTravJson: deepTravJson,
- tryWriteByExpress: tryWriteByExpress,
- tryWriteObject: tryWriteObject,
- tryVarSimple: tryVarSimple,
- calcObject: calcObject,
- getParentGrid: getParentGrid,
- tryEnable: tryEnable,
- setComboStore: setComboStore,
- invokeServer: invokeServer$1,
- clearViewModelValues: clearViewModelValues,
- reloadGrid: reloadGrid,
- toPlainObject: toPlainObject,
- confirm: confirm,
- normId: normId,
- clearViewModelReloadGrid: clearViewModelReloadGrid,
- saveGridRow: saveGridRow,
- insertGridRow: insertGridRow,
- commitMe: commitMe,
- removeGridRow: removeGridRow,
- moveUpGridRow: moveUpGridRow,
- moveDownGridRow: moveDownGridRow,
- SystemEventFu: SystemEventFu,
- clearViewModel: clearViewModel,
- clearViewModelByLookup: clearViewModelByLookup,
- showWidget: showWidget,
- stopEvent: stopEvent,
- msg: msg$1,
- showErrorDialog: showErrorDialog$1,
- showInfoDialog: showInfoDialog,
- prompt: prompt$2,
- evalFunction: evalFunction,
- getGridEditRows: getGridEditRows
- });
- function initTree () {
- Ext.define('Yvan.Tree', {
- extend: 'Ext.tree.Panel',
- alias: 'widget.yvtree',
- xtype: 'yvtree',
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({
- // 强制性属性
- }, baseConfig(config, 'row-item'), config, tree);
- _$2.assign(newConfig, {
- tbar: [
- {
- xtype: 'textfield',
- // triggerCls: 'x-form-clear-trigger',
- flex: 1,
- emptyText: '搜索过滤',
- enableKeyEvents: true,
- listeners: {
- change: function (sender) {
- var tree = sender.up("treepanel");
- tree.filterByText(this.getRawValue());
- },
- keyup: function (sender, e) {
- var tree = sender.up("treepanel");
- if (e.ESC === e.getKey()) {
- sender.setValue('');
- tree.filterByText('');
- }
- }
- }
- },
- ],
- });
- if (!newConfig.hideRefresh) {
- newConfig.tbar.push({
- xtype: 'button', iconCls: 'x-fa fa-refresh', tooltip: '刷新',
- listeners: {
- click: function (sender) {
- var scope = sender.up("yvtree");
- scope.reload();
- }
- }
- });
- }
- if (!newConfig.hideExpand) {
- newConfig.tbar.push({
- xtype: 'button', iconCls: 'x-fa fa-plus-square-o', tooltip: '全部展开',
- listeners: {
- click: function (sender) {
- var scope = sender.up("yvtree");
- scope.expandAll();
- }
- }
- });
- }
- if (!newConfig.hideCollapse) {
- newConfig.tbar.push({
- xtype: 'button', iconCls: 'x-fa fa-minus-square-o', tooltip: '全部收起',
- listeners: {
- click: function (sender) {
- var scope = sender.up("yvtree");
- scope.collapseAll();
- }
- }
- });
- }
- this.superclass.constructor.call(this, newConfig);
- },
- /**
- * 在根节点上增加一个节点,会触发 addNode 事件
- * @param props
- */
- addRoot: function (props) {
- var me = this;
- var tableNode = me.getRootNode();
- var fieldNode = tableNode.createNode(new Ext.data.NodeInterface({}));
- if (_$2.isFunction(props)) {
- props = props.call(this, parent);
- }
- _$2.forOwn(props, function (value, key) {
- fieldNode.set(key, value);
- });
- var node = tableNode.appendChild(fieldNode);
- me.ensureVisible(node);
- me.setSelection(node);
- me.fireEvent('addNode', me, {
- parent: tableNode,
- node: node,
- });
- },
- addLast: function (props) {
- var me = this;
- var sel = me.selModel.getSelection();
- if (!sel || sel.length <= 0) {
- msg('请选择一个要添加的同级节点路径');
- return;
- }
- var parent = sel[0].parentNode ? sel[0].parentNode : me.getRootNode();
- var fieldNode = parent.createNode(new Ext.data.NodeInterface({}));
- if (_$2.isFunction(props)) {
- props = props.call(this, parent);
- }
- _$2.forOwn(props, function (value, key) {
- fieldNode.set(key, value);
- });
- var node = parent.appendChild(fieldNode);
- me.ensureVisible(node);
- me.setSelection(node);
- me.fireEvent('addNode', me, {
- parent: parent,
- node: node,
- });
- },
- addChildren: function (props) {
- var me = this;
- var sel = me.selModel.getSelection();
- if (!sel || sel.length <= 0) {
- msg('请选择一个要添加子节点的路径');
- return;
- }
- var parent = sel[0];
- if (_$2.isFunction(props)) {
- props = props.call(this, parent);
- }
- var fieldNode = parent.createNode(new Ext.data.NodeInterface({}));
- _$2.forOwn(props, function (value, key) {
- fieldNode.set(key, value);
- });
- var node = parent.appendChild(fieldNode);
- parent.expand();
- me.ensureVisible(node);
- me.setSelection(node);
- me.fireEvent('addNode', me, {
- parent: parent,
- node: node,
- });
- },
- initComponent: function () {
- var me = this;
- var config = me.config;
- var scope = lookupScope(this);
- if (!isDesignMode(scope, config)) {
- // 转换 dataSource 属性
- convertDataSource(me, scope, config);
- }
- this.superclass.initComponent.call(this);
- this.on({
- afterrender: function (sender) {
- var me = this;
- var config = this.config;
- var dataSource = config.dataSource;
- if (config.autoLoad) {
- if (config.dataSourceCallbackFn) {
- me.reload();
- }
- else if (_$2.isPlainObject(dataSource) && dataSource.method === 'invoke') {
- me.reload();
- }
- }
- }
- });
- },
- _setDataReal: function (value) {
- var me = this;
- // me.setStore(new Ext.data.TreeStore({
- // root: {
- // expanded: true,
- // // children: value
- // children: [
- // {
- // id: '1', text: 'A',
- // children: [
- // {id: '1', text: 'A',},
- // {id: '2', text: 'B'},
- // ]
- // },
- // {id: '2', text: 'B'},
- // ]
- // }
- // }))
- me.store.setRoot({
- expanded: true,
- children: value
- });
- // me.store = new Ext.data.TreeStore({
- // root: {
- // expanded: true,
- // // children: value
- // children: [
- // {
- // id: '1', text: 'A',
- // children: [
- // {id: '1', text: 'A',},
- // {id: '2', text: 'B'},
- // ]
- // },
- // {id: '2', text: 'B'},
- // ]
- // }
- // })
- },
- /**
- * 重新载入数据(重新计算参数)
- */
- reload: function (reloadParams) {
- if (reloadParams === void 0) { reloadParams = {}; }
- var me = this;
- var config = me.config;
- if (config.dataSourceCallbackFn) {
- // 函数请求刷新
- var scope_1 = lookupScope(this);
- // me.setLoading(true)
- config.dataSourceCallbackFn.call(scope_1, me, {
- successCallback: function (value) {
- me._setDataReal(value);
- // me.setLoading(false)
- me.fireEvent('dataLoadComplete', me, true, value);
- },
- failCallback: function (error) {
- // me.setLoading(false)
- me.fireEvent('dataLoadComplete', me, false, error);
- }
- });
- return;
- }
- var scope = lookupScope(me);
- var dataSource = config.dataSource;
- if (_$2.isPlainObject(dataSource) && dataSource.method === 'invoke' && !isDesignMode(scope, config)) {
- var params = calcObjectFlat(scope.viewModel.data, _$2.defaultsDeep({}, reloadParams, dataSource.params));
- me.setLoading(true);
- invokeServer$1(dataSource.url, params)
- .then(function (res) {
- me._setDataReal(res.data);
- me.fireEvent('dataLoadComplete', me, res);
- })
- .finally(function () {
- me.setLoading(false);
- });
- }
- },
- filterByText: function (text) {
- this._filterText = text;
- this._filterBy(this, text, 'text');
- },
- _filterBy: _$2.debounce(function (me, text, by) {
- var view = me.getView();
- me.store.clearFilter();
- if (!me._filterText) {
- // 没有筛选内容,还原状态
- var selections = me.getSelection();
- var selectionPaths_1 = [];
- _$2.forEach(me.getSelection(), function (item) {
- selectionPaths_1.push(item.getPath());
- });
- me.collapseAll();
- _$2.forEach(selectionPaths_1, function (path) {
- me.expandPath(path);
- });
- me.setSelection(selections);
- return;
- }
- // 递归查找所有需要可见的节点 id 数组
- var nodesAndParents = [];
- var expandPaths = [];
- me.getRootNode().cascadeBy(function (tree, view) {
- var currNode = this;
- currNode.collapse();
- if (currNode && currNode.data[by] && pinyinMatch(currNode.data[by].toString(), text)) {
- // 展开到匹配的路径
- // me.expandPath(currNode.getPath());
- expandPaths.push(currNode.getPath());
- // 沿途父节点全部设定为可见
- while (currNode.parentNode) {
- nodesAndParents.push(currNode.id);
- currNode = currNode.parentNode;
- }
- }
- }, null, [me, view]);
- me.store.filterBy(function (r) {
- return Ext.Array.contains(nodesAndParents, r.get('id'));
- });
- _$2.forEach(expandPaths, function (path) {
- me.expandPath(path);
- });
- }, 1000),
- });
- }
- function convertDataSource(sender, scope, newConfig) {
- if (typeof newConfig.store !== 'undefined') {
- // 有 store 属性的情况下,不做任何事
- return;
- }
- if (typeof newConfig.dataSource === 'undefined') {
- // 没有定义 dataSource 的情况下,不做任何事
- return;
- }
- var dataSource = newConfig.dataSource;
- if (typeof dataSource === 'string') {
- // dataSource 是字符串的情况下,找到成员函数
- dataSource = lookupFn(scope, dataSource);
- }
- if (typeof dataSource === 'function') {
- // dataSource 是函数的情况下,在 afterrender 之后进行回调
- newConfig.store = new Ext.data.TreeStore({
- root: {
- expanded: true,
- children: []
- }
- });
- newConfig.dataSourceCallbackFn = dataSource;
- return;
- }
- // throw new TypeError('无法识别的调用方法')
- }
- //# sourceMappingURL=yvtree.js.map
- /**
- * 构建一个 grid 支持的 dataSource
- */
- function gridInvokeBuild(scope, grid, config, dataSource, reloadParams, isExcelExport, excelExportCallBack) {
- if (reloadParams === void 0) { reloadParams = {}; }
- if (isExcelExport === void 0) { isExcelExport = false; }
- if (excelExportCallBack === void 0) { excelExportCallBack = null; }
- var _a;
- var me = grid;
- var params = calcObjectFlat(scope.viewModel.data, dataSource.params);
- var storeOption = {};
- if (dataSource.method === 'invoke' || dataSource.sqlId) {
- if (dataSource.sqlId) {
- dataSource.method = 'invoke';
- dataSource.url = '/Dev@executeSQL';
- if (_$2.startsWith(dataSource.sqlId, '@')) {
- // sqlId 是 @ 开头,代表直接带中文名
- var scope_1 = lookupScope(grid);
- params.path = sqlUrlTransform(_$2.get(scope_1, 'originalVjson.__custom_path'));
- params.sqlId = dataSource.sqlId.substring(1);
- }
- else {
- // sqlId 是 aa/bb/cc@dd 模式,代表直接带中文名
- var _b = __read(dataSource.sqlId.split('@'), 2), path = _b[0], sqlId = _b[1];
- params.path = path;
- params.sqlId = sqlId;
- }
- params.pagination = (_a = config.pagination) !== null && _a !== void 0 ? _a : true;
- }
- var fields_1 = [];
- _$2.forEach(grid.columns, function (col) {
- var c = {};
- if (col.dataIndex) {
- c.name = col.dataIndex;
- fields_1.push(c);
- }
- if (col.dataType) {
- c.type = col.dataType;
- }
- });
- // 默认支持 gridInvoke
- var extraParams = _$2.defaultsDeep({}, reloadParams, params);
- //@ts-ignore
- storeOption = {
- fields: fields_1,
- remoteSort: config.remoteSort,
- remoteFilter: config.remoteFilter,
- autoLoad: true,
- pageSize: me.store.pageSize || config.pageSize,
- proxy: {
- type: 'jsonAjax',
- $owner: me,
- url: serverInvokeUrlTransform(dataSource.url, { scope: scope, grid: grid, isExcelExport: isExcelExport, excelExportCallBack: excelExportCallBack }),
- extraParams: extraParams,
- reader: {
- type: 'json',
- rootProperty: 'data',
- totalProperty: 'pagination.total',
- successProperty: 'success',
- messageProperty: 'msg',
- transform: function (data) {
- if (typeof window['ajaxProcess'] === 'function') {
- window['ajaxProcess'](data);
- }
- if (typeof window['apiTranslate'] === 'function') {
- window['apiTranslate'](data, dataSource.url);
- }
- if (typeof grid._transform === 'function') {
- // 系统转换函数
- grid._transform(data.data);
- }
- if (grid.dataTransform) {
- if (typeof grid.dataTransform === 'string') {
- grid.dataTransform = lookupFn(lookupScope(grid), grid.dataTransform);
- }
- return grid.dataTransform.call(scope, grid, data);
- }
- return data;
- }
- }
- },
- listeners: {
- load: function (store, records, successful, operation) {
- var _a, _b, _c;
- var rep = (_a = operation.getResponse()) === null || _a === void 0 ? void 0 : _a.responseJson;
- if (rep.pagination) {
- grid.dbInfo = rep.pagination.dbInfo;
- grid.exportDataSql = rep.pagination.exportDataSql;
- grid.exportDataSqlParams = rep.pagination.exportDataSqlParams;
- }
- me.exportExcelTotal = ((_b = rep === null || rep === void 0 ? void 0 : rep.pagination) === null || _b === void 0 ? void 0 : _b.total) || ((_c = rep === null || rep === void 0 ? void 0 : rep.data) === null || _c === void 0 ? void 0 : _c.length) || 0;
- if (isExcelExport) {
- if (typeof excelExportCallBack === 'function') {
- excelExportCallBack(rep);
- }
- else if (excelExportCallBack) {
- console.error("导出回调方法错误!");
- }
- me.fireEvent('excelDataLoadComplete', me, successful, records);
- }
- else {
- if (_$2.get(config, 'behavior.autoSelectFirst')) {
- // 自动选中第一行
- var data = grid.getStore().data;
- if (data.length > 0) {
- grid.setSelection(data.items[0]);
- }
- }
- me.fireEvent('dataLoadComplete', me, successful, records);
- }
- }
- }
- };
- }
- else if (exports.apiConvert) {
- // 外部扩展的 apiConvert
- //@ts-ignore
- storeOption = exports.apiConvert.gridInvokeBuild(scope, grid, config, dataSource, params, reloadParams, isExcelExport, excelExportCallBack);
- }
- else {
- throw new TypeError("不支持的 API 请求方式");
- }
- if (isExcelExport) {
- var excelStore = new Ext.data.Store(storeOption);
- excelStore.load();
- }
- else {
- if (me.groupField) {
- console.log('groupField', storeOption.groupField);
- storeOption.groupField = me.groupField;
- }
- me.setStore(new Ext.data.Store(storeOption));
- }
- }
- function initStores () {
- Ext.define('Yvan.JsonAjaxProxy', {
- extend: 'Ext.data.proxy.Ajax',
- alias: 'proxy.jsonAjax',
- actionMethods: {
- create: "POST",
- read: "POST",
- update: "POST",
- destroy: "POST"
- },
- timeout: storeAjax.timeout,
- buildRequest: function (operation) {
- // 参考源码 ext-all-debug.js:71468 method:buildRequest
- var me = this;
- var $owner = me.$owner; // 在 grid.initComponent 中赋值 $owner
- var scope = lookupScope($owner);
- var gridParam = me.getParams(operation);
- var customParam = {};
- // 提取 srot 元素
- if (gridParam.sort) {
- var sort = JSON.parse(gridParam.sort);
- // 字符串 [{"property":"BRANCHID","direction":"ASC"}]
- // 转换为对象 [{colId: "BRANCHID", sort: "asc"}]
- customParam.sortModel = [];
- _$2.forEach(sort, function (s) {
- customParam.sortModel.push({
- colId: s.property,
- sort: _$2.toLower(s.direction)
- });
- });
- delete gridParam.sort;
- }
- // 提取筛选元素
- if (gridParam.filter) {
- var filter = JSON.parse(gridParam.filter);
- console.log('gridParam.filter', gridParam.filter);
- // "[{"operator":"like","value":"1","property":"id"}]"
- // 转换为 filterModel: {BRANCHID: {filterType: "text", type: "contains", filter: "12"}}
- customParam.filterModel = {};
- _$2.forEach(filter, function (s) {
- var newFilterItem = {};
- if (s.operator === 'like') {
- newFilterItem.filterType = 'text';
- newFilterItem.type = 'contains';
- newFilterItem.filter = s.value;
- }
- else {
- // 无法识别的筛选类型
- newFilterItem.filterType = 'dict';
- newFilterItem.type = 'in';
- newFilterItem.filter = s.value;
- }
- customParam.filterModel[s.property] = newFilterItem;
- });
- delete gridParam.filter;
- }
- // 被 grid.constructor 作为方法存在
- var extraParams = _$2.cloneDeep(me.getExtraParams());
- var params = _$2.defaultsDeep(gridParam, extraParams);
- // var request = this.superclass.buildRequest.apply(this, arguments);
- var request = new Ext.data.Request({
- params: {},
- action: operation.getAction(),
- records: operation.getRecords(),
- url: me.buildUrl(),
- jsonData: __assign({ args: [
- params
- ] }, customParam),
- proxy: me
- });
- operation.setRequest(request);
- return request;
- },
- afterRequest: function (req, res) {
- // Extend.afterExtRequest(req, res)
- }
- });
- Ext.define('Ext.ux.data.MyReader', {
- extend: 'Ext.data.reader.Json',
- xtype: 'yvgridreader',
- useSimpleAccessors: false,
- });
- }
- //# sourceMappingURL=stores.js.map
- function initBehaviorEdit(config) {
- var _a, _b, _c;
- var dbTableName = _$2.get(config, 'behavior.dbTableName');
- var addButtonConfig = (_a = _$2.get(config, 'behavior.addButtonConfig')) !== null && _a !== void 0 ? _a : {};
- var deleteButtonConfig = (_b = _$2.get(config, 'behavior.deleteButtonConfig')) !== null && _b !== void 0 ? _b : {};
- var saveButtonConfig = (_c = _$2.get(config, 'behavior.saveButtonConfig')) !== null && _c !== void 0 ? _c : {};
- if (dbTableName) {
- // 生成增删查改
- var tbar = [
- __assign({ xtype: 'button', text: '保存', iconCls: 'x-fa fa-save', cls: 'ext-btn-primary', listeners: {
- click: 'system.saveGridRow()'
- }, bind: {
- disabled: '{!' + config.reference + '.ischanged}'
- } }, saveButtonConfig),
- '-',
- __assign({ xtype: 'button', text: '添加', iconCls: 'x-fa fa-plus-circle', listeners: {
- click: 'system.insertGridRow()'
- } }, addButtonConfig),
- __assign({ xtype: 'button', text: '删除', iconCls: 'x-fa fa-minus-circle', cls: 'ext-btn-danger', listeners: {
- click: 'system.removeGridRow()'
- } }, deleteButtonConfig),
- ];
- if (_$2.isArray(config.tbar)) {
- config.tbar = __spread(tbar, [
- '-'
- ], config.tbar);
- }
- else if (_$2.isPlainObject(config.tbar)) {
- config.tbar = {
- border: false,
- layout: {
- type: 'vbox',
- align: 'stretch'
- },
- items: [
- {
- xtype: 'toolbar',
- border: false,
- items: tbar
- },
- config.tbar,
- ]
- };
- }
- else if (_$2.isUndefined(config.tbar)) {
- config.tbar = tbar;
- }
- else {
- console.error("can't build tbar property!", config.tbar);
- }
- }
- }
- //# sourceMappingURL=grid_behavior.js.map
- function initGridDialog(config) {
- var detailDialog = _$2.get(config, 'detailDialog');
- var detailButtonConfig = _$2.get(config, 'behavior.detailButtonConfig');
- if (_$2.isPlainObject(detailDialog)) {
- var tbar = [
- __assign({ xtype: 'button', text: '详情', iconCls: 'x-fa fa-id-card-o', listeners: {
- click: 'system.showGridRowDetail()',
- }, bind: {
- disabled: '{!' + config.reference + '.selection}'
- } }, detailButtonConfig)
- ];
- if (_$2.isArray(config.tbar)) {
- config.tbar = __spread(config.tbar, [
- '-'
- ], tbar);
- }
- else if (_$2.isPlainObject(config.tbar)) {
- if (_$2.get(config.tbar, 'layout.type') === 'vbox' || _$2.get(config.tbar, 'layout') === 'vbox') {
- config.tbar.items = __spread(config.tbar.items);
- var toolbar = _$2.find(config.tbar.items, function (item) { return item.xtype === 'toolbar'; });
- if (!toolbar) {
- config.tbar.items = __spread(config.tbar.items, [
- {
- xtype: 'toolbar',
- border: false,
- items: tbar
- },
- ]);
- }
- else {
- toolbar.items = __spread(toolbar.items, [
- '-'
- ], tbar);
- }
- }
- else {
- config.tbar = {
- border: false,
- layout: {
- type: 'vbox',
- align: 'stretch'
- },
- items: [
- {
- xtype: 'toolbar',
- border: false,
- items: tbar
- },
- config.tbar,
- ]
- };
- }
- }
- else if (_$2.isUndefined(config.tbar)) {
- config.tbar = tbar;
- }
- else {
- console.error("can't build tbar property!", config.tbar);
- }
- }
- }
- var SystemEventFu$1 = /** @class */ (function () {
- function SystemEventFu() {
- }
- SystemEventFu.prototype.showGridRowDetail = function () {
- return function (sender) {
- var grid1 = sender.up('yvgrid');
- showGridRowDetail(grid1);
- };
- };
- __decorate([
- Lib({
- title: '为某个表格所选数据行, 显示其对话框',
- author: '罗一帆',
- createAt: '2022-07-27',
- updateAt: '2022-07-27',
- type: 'system',
- category: '表格',
- }),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", []),
- __metadata("design:returntype", void 0)
- ], SystemEventFu.prototype, "showGridRowDetail", null);
- return SystemEventFu;
- }());
- function showGridRowDetail(grid1, isEdit) {
- if (isEdit === void 0) { isEdit = true; }
- var _a, _b, _c;
- if (!grid1.selection) {
- msg$1('请选中要展示的数据行!');
- return;
- }
- var record = grid1.selection;
- if (_$2.isArray(record)) {
- record = record[0];
- }
- if (!record) {
- msg$1('请选中要展示的数据行!');
- return;
- }
- var config = grid1._originVJson;
- var detailDialog = config.detailDialog;
- var vjson = {};
- var parentScope = lookupScope(grid1);
- var __custom_path = _$2.get(parentScope, 'originalVjson.__custom_path');
- var __custom_version = _$2.get(parentScope, 'originalVjson.__custom_version');
- _$2.defaultsDeep(vjson, {
- // 强制属性
- layout: 'fit',
- __custom_path: __custom_path,
- __custom_version: __custom_version,
- fbar: __spread([
- { xtype: 'button', iconCls: 'x-fa fa-save', text: '确定', listeners: { click: 'system.commitMe()' } },
- { xtype: 'button', iconCls: 'x-fa fa-times', text: '取消', listeners: { click: 'system.closeMe()' } }
- ], ((_a = detailDialog.fbar) !== null && _a !== void 0 ? _a : [])),
- items: (_b = detailDialog.items) !== null && _b !== void 0 ? _b : [],
- }, detailDialog, {
- // 默认属性
- width: 800,
- height: 450,
- bind: __assign({ title: '{_editType}' }, ((_c = detailDialog.bind) !== null && _c !== void 0 ? _c : {})),
- });
- if (_$2.isPlainObject(detailDialog.tabpanel)) {
- var tabpanel = __assign({ xtype: 'tabpanel' }, _$2.cloneDeep(detailDialog.tabpanel));
- vjson.items.push(tabpanel);
- if (tabpanel) {
- // 有多个选项卡,按每个选项卡进行过滤
- _$2.forEach(tabpanel.items, function (tab) {
- var tabColumns = _$2.filter(config.columns, function (c) { var _a; return ((_a = c.form) === null || _a === void 0 ? void 0 : _a.tab) === tab.title; });
- if (tabColumns.length > 0) {
- var tabVjson = buildForm(tabColumns, undefined, detailDialog);
- _$2.extend(tab, tabVjson);
- }
- });
- }
- }
- else {
- vjson.items.push(buildForm(config.columns, undefined, detailDialog));
- }
- var model = {
- data: {
- _edit: isEdit,
- _editType: isEdit ? '编辑' : '添加',
- }
- };
- _$2.forOwn(record.data, function (value, key) {
- if (key === 'id') {
- // 忽略 ID 属性
- return;
- }
- if (_$2.startsWith(key, '_')) {
- // 忽略 _ 开头的所有属性
- return;
- }
- model.data[key] = value;
- });
- console.log(vjson);
- var scope = new Scope({ vjson: vjson, model: model, });
- //@ts-ignore
- scope.commit = function () {
- return new Promise(function (resolve) {
- _$2.forOwn(scope.viewModel.data, function (value, key) {
- if (_$2.startsWith(key, '_')) {
- // _origin 等属性可以被忽略
- return;
- }
- if (key === 'id') {
- // id 属性被忽略
- return;
- }
- record.set(key, value);
- });
- resolve();
- });
- };
- scope.showDialog(grid1, {}, {});
- }
- function buildForm(columns, tabpanel, detailDialog) {
- var vjson = __assign({ border: false, layout: {
- type: 'vbox',
- pack: 'start',
- align: 'stretch'
- }, defaults: {
- border: false,
- anchor: '100%',
- margin: '5',
- }, scrollable: true, items: [] }, detailDialog.form);
- var emptyFieldset = [];
- var fieldsetList = [];
- columns = _$2.sortBy(columns, function (c) { var _a; return (_a = _$2.get(c, 'form.order')) !== null && _a !== void 0 ? _a : 1; });
- _$2.forEach(columns, function (c) {
- var fieldset = _$2.get(c, 'form.fieldset');
- if (fieldset) {
- var idx = _$2.findIndex(fieldsetList, function (t) { return t.fieldset === fieldset; });
- if (idx < 0) {
- fieldsetList.push({
- fieldset: fieldset,
- columns: [c]
- });
- }
- else {
- fieldsetList[idx].columns.push(c);
- }
- }
- else {
- emptyFieldset.push(c);
- }
- });
- _$2.forEach(fieldsetList, function (fs) {
- var fieldSetVjson = {
- xtype: 'fieldset',
- title: fs.fieldset,
- items: []
- };
- buildFieldItems(fieldSetVjson.items, fs.columns);
- vjson.items.push(fieldSetVjson);
- });
- buildFieldItems(vjson.items, emptyFieldset);
- return vjson;
- }
- // 构建字段组
- function buildFieldItems(items, columns) {
- var _a, _b, _c, _d, _e;
- var row = {
- xtype: 'cols',
- items: []
- };
- for (var i = 0; i < columns.length; i++) {
- var column = columns[i];
- if ((_a = column.form) === null || _a === void 0 ? void 0 : _a.rowlayout) {
- delete row.xtype;
- row.layout = column.form.rowlayout;
- }
- if ((_b = column.form) === null || _b === void 0 ? void 0 : _b.prefix) {
- row.items.push({ border: false, flex: column.form.prefix });
- }
- var fieldVjson = buildField(column, row.items.length);
- if (!fieldVjson) {
- continue;
- }
- row.items.push(fieldVjson);
- if ((_c = column.form) === null || _c === void 0 ? void 0 : _c.suffix) {
- row.items.push({ border: false, flex: (_d = column.form) === null || _d === void 0 ? void 0 : _d.suffix });
- }
- if ((_e = column.form) === null || _e === void 0 ? void 0 : _e.wrap) {
- items.push(row);
- row = {
- xtype: 'cols',
- items: []
- };
- }
- }
- if (row.items.length > 0) {
- items.push(row);
- }
- }
- // 构建字段
- function buildField(column, colIdx) {
- var ret;
- if (column.xtype === 'checkcolumn') {
- ret = _$2.defaultsDeep({
- xtype: 'checkbox',
- uncheckedValue: column.uncheckedValue,
- checkedValue: column.checkedValue,
- boxLabel: column.header,
- bind: {
- value: '{' + column.dataIndex + '}'
- }
- }, column.form);
- if (colIdx == 0) {
- // 第一列的checkbox, 要向左空出 85 像素, 预留出 labelWidth
- ret.margin = '0 0 0 85';
- }
- }
- else {
- ret = _$2.defaultsDeep({}, column.form, column.editor, {
- fieldLabel: column.header,
- bind: {
- value: '{' + column.dataIndex + '}'
- },
- });
- }
- if (!ret.xtype) {
- return;
- }
- if (!ret.dict && ret.xtype === 'combo') {
- ret.dict = column.dict;
- }
- // 删除辅助属性
- delete ret.order;
- delete ret.wrap;
- return ret;
- }
- //# sourceMappingURL=grid_dialog.js.map
- var model$c = {
- data: {}
- };
- //# sourceMappingURL=GridColumnCustom.model.js.map
- var vjson$c = {
- title: '自定义表格属性',
- layout: 'fit',
- width: 980,
- height: 500,
- fbar: [
- {
- xtype: "button",
- text: "保存",
- iconCls: 'x-fa fa-save',
- listeners: {
- click: 'scope.commit',
- }
- },
- {
- xtype: "button",
- text: "关闭",
- iconCls: 'x-fa fa-times',
- listeners: {
- click: 'system.closeMe()',
- }
- },
- ],
- items: [
- {
- region: 'center',
- xtype: 'tabpanel',
- items: [
- {
- title: '基本信息', reference: 'basic',
- layout: {
- type: 'vbox',
- pack: 'start',
- align: 'stretch'
- },
- defaults: {
- border: false,
- anchor: '100%',
- margin: '5',
- },
- scrollable: true,
- items: [
- {
- xtype: 'cols',
- items: [
- {
- fieldLabel: '路径',
- bind: { value: '{__custom_path}' },
- xtype: 'textfield',
- flex: 2,
- },
- {
- fieldLabel: '版本',
- bind: { value: '{__custom_version}' },
- xtype: 'textfield',
- },
- ]
- },
- {
- xtype: 'cols',
- items: [
- {
- fieldLabel: '配置点',
- bind: { value: '{__custom_point}' },
- xtype: 'textfield',
- },
- {
- fieldLabel: 'reference',
- bind: { value: '{reference}' },
- xtype: 'textfield',
- },
- {
- fieldLabel: '编辑模式',
- bind: { value: '{_mode}' },
- xtype: 'combo',
- dict: 'GRID_MODE',
- },
- ]
- },
- {
- layout: 'hbox',
- defaults: {
- margin: '0 0 0 15',
- },
- items: [
- {
- boxLabel: '隐藏底部工具栏', margin: '0 0 0 85', xtype: 'checkbox',
- bind: {
- value: "{hideFootbar}"
- }
- },
- {
- boxLabel: '隐藏刷新', xtype: 'checkbox',
- bind: {
- value: "{hideRefresh}"
- }
- },
- {
- boxLabel: '隐藏导出', xtype: 'checkbox',
- bind: {
- value: "{hideExport}"
- }
- },
- {
- boxLabel: '隐藏自动调宽', xtype: 'checkbox',
- bind: {
- value: "{hideAutoSize}"
- }
- },
- {
- boxLabel: '隐藏清空筛选', xtype: 'checkbox',
- bind: {
- value: "{hideClearFilter}"
- }
- },
- {
- boxLabel: '隐藏保存布局', xtype: 'checkbox',
- bind: {
- value: "{hideSaveGridUIConfig}"
- }
- },
- {
- boxLabel: '隐藏重置布局', xtype: 'checkbox',
- bind: {
- value: "{hideClearGridUIConfig}"
- }
- },
- ]
- },
- {
- layout: 'hbox',
- defaults: {
- margin: '0 0 0 15',
- },
- items: [
- {
- boxLabel: '自动载入数据源', xtype: 'checkbox',
- bind: { value: '{autoLoad}' },
- margin: '0 0 0 85',
- },
- {
- boxLabel: '分页模式', xtype: 'checkbox',
- bind: { value: '{pagination}' },
- },
- {
- boxLabel: '显示行序号', xtype: 'checkbox',
- bind: { value: '{show_rownum}' },
- },
- {
- boxLabel: '后端排序', xtype: 'checkbox',
- bind: {
- value: "{remoteSort}"
- }
- },
- {
- boxLabel: '后端过滤', xtype: 'checkbox',
- bind: {
- value: "{remoteFilter}"
- }
- },
- {
- boxLabel: '隐藏', xtype: 'checkbox',
- bind: {
- value: "{hidden}"
- }
- },
- ]
- },
- {
- layout: 'hbox',
- defaults: {
- margin: '0 0 0 15',
- },
- items: [
- {
- boxLabel: '自定义隐藏', xtype: 'checkbox', margin: '0 0 0 85',
- bind: {
- value: "{enableColumnHide}"
- }
- },
- {
- boxLabel: '用户拖拽字段', xtype: 'checkbox',
- bind: {
- value: "{enableColumnMove}"
- }
- },
- {
- boxLabel: '自定义筛选', xtype: 'checkbox',
- bind: {
- value: "{gridfilters}"
- }
- },
- {
- boxLabel: '用户拖拽字段宽度', xtype: 'checkbox',
- bind: {
- value: "{enableColumnResize}"
- }
- },
- {
- boxLabel: '点击列头排序', xtype: 'checkbox',
- bind: {
- value: "{sortOnClick}"
- }
- },
- ]
- },
- {
- xtype: 'cols',
- items: [
- {
- fieldLabel: 'dbTableName',
- labelWidth: 110,
- bind: { value: '{behavior.dbTableName}' },
- xtype: 'textfield',
- },
- {
- fieldLabel: 'theid',
- bind: { value: '{theid}' },
- xtype: 'textfield',
- },
- {
- fieldLabel: '添加行聚焦',
- bind: { value: '{behavior.focusColumnAfterInsert}' },
- xtype: 'textfield',
- },
- ]
- },
- {
- xtype: 'cols',
- items: [
- {
- fieldLabel: '批量删除提示',
- labelWidth: 110,
- bind: { value: '{behavior.batchRemoveConfirm}' },
- xtype: 'textfield',
- },
- {
- fieldLabel: '删除提示',
- bind: { value: '{behavior.singleRemoveConfirm}' },
- xtype: 'textfield',
- },
- {
- fieldLabel: '触发刷新',
- labelWidth: 110,
- bind: { value: '{behavior.selectToReload}' },
- xtype: 'textfield',
- },
- ]
- },
- ]
- },
- {
- title: '字段', reference: 'grid1',
- xtype: 'yvgrid',
- pagination: false,
- _mode: 'edit',
- listeners: {
- buttonclick: 'scope.grid1Buttonclick',
- },
- hideFootbar: true,
- tbar: [
- {
- xtype: 'button',
- text: '添加',
- iconCls: 'x-fa fa-plus-circle',
- listeners: {
- click: 'scope.addField'
- }
- },
- {
- xtype: 'button',
- text: '删除',
- iconCls: 'x-fa fa-minus-circle',
- listeners: {
- click: 'scope.removeField'
- }
- },
- '-',
- {
- xtype: 'button',
- text: '自动分析',
- iconCls: 'x-fa fa-code-fork',
- listeners: {
- click: 'scope.calcField'
- }
- },
- {
- xtype: 'button',
- text: '上移',
- iconCls: 'x-fa fa-arrow-up',
- listeners: {
- click: 'scope.moveUp'
- }
- },
- {
- xtype: 'button',
- text: '下移',
- iconCls: 'x-fa fa-arrow-down',
- listeners: {
- click: 'scope.moveDown'
- }
- },
- ],
- store: {},
- columns: [
- {
- dataIndex: 'dataIndex', header: "字段名", width: 140,
- editor: { xtype: 'textfield' }
- },
- {
- dataIndex: 'dbColumn', header: "数据库字段", width: 140,
- editor: { xtype: 'textfield' }
- },
- {
- dataIndex: 'header', header: '中文', width: 140,
- editor: { xtype: 'textfield' }
- },
- {
- dataIndex: 'dict', header: '字典', width: 110,
- editor: { xtype: 'combogrid' }
- },
- {
- dataIndex: 'editor_widget', header: '下拉表', width: 110,
- editor: { xtype: 'combogrid' }, hidden: true,
- },
- {
- dataIndex: 'width', header: '宽度', width: 80,
- editor: { xtype: 'numberfield' }, hidden: true,
- },
- {
- dataIndex: 'editor_xtype', header: '编辑器', width: 170,
- editor: { xtype: 'combo' }, dict: 'GRID_XTYPE'
- },
- {
- dataIndex: 'serverCreateValue', header: '服务端创建值',
- editor: { xtype: 'textfield' },
- },
- {
- dataIndex: 'createValue', text: '客户端新创建值',
- editor: { xtype: 'textfield' },
- },
- {
- dataIndex: 'dbIsDeleteKey', text: '删除键', xtype: 'checkcolumn', width: 60,
- resizable: false, sortable: false, menuDisabled: true,
- checkedValue: true, uncheckedValue: false,
- },
- {
- dataIndex: 'dbIsUpdateKey', text: '更新键', xtype: 'checkcolumn', width: 60,
- resizable: false, sortable: false, menuDisabled: true,
- checkedValue: true, uncheckedValue: false,
- },
- {
- dataIndex: 'dbUpdateDisable', text: '禁更新', xtype: 'checkcolumn', width: 60,
- resizable: false, sortable: false, menuDisabled: true,
- checkedValue: true, uncheckedValue: false,
- },
- {
- dataIndex: 'formatter', header: '格式化', width: 110,
- editor: { xtype: 'combo' }, dict: 'GRID_FORMATTER', hidden: true,
- },
- {
- dataIndex: 'resizable', text: '调整宽', xtype: 'checkcolumn', width: 60,
- resizable: false, sortable: false, menuDisabled: true,
- checkedValue: true, uncheckedValue: false, hidden: true,
- },
- {
- dataIndex: 'editor_required', text: '必填', xtype: 'checkcolumn', width: 50,
- resizable: false, sortable: false, menuDisabled: true,
- hidden: true,
- },
- {
- dataIndex: 'filterable', text: '过滤', xtype: 'checkcolumn', width: 50,
- resizable: false, sortable: false, menuDisabled: true,
- checkedValue: true, uncheckedValue: false, hidden: true,
- },
- {
- dataIndex: 'hidden', text: '隐藏', xtype: 'checkcolumn', width: 50,
- resizable: false, sortable: false, menuDisabled: true,
- },
- {
- dataIndex: 'sortable', text: '排序', xtype: 'checkcolumn', width: 50,
- resizable: false, sortable: false, menuDisabled: true,
- checkedValue: true, uncheckedValue: false, hidden: true,
- },
- {
- dataIndex: 'form_order', text: '对话框序号',
- editor: { xtype: 'numberfield' },
- },
- {
- dataIndex: 'form_xtype', text: '框换行', xtype: 'checkcolumn', width: 60,
- resizable: false, sortable: false, menuDisabled: true,
- checkedValue: true, uncheckedValue: false,
- },
- {
- dataIndex: 'form_xtype', text: '对话框编辑器',
- editor: { xtype: 'combo' }, dict: 'FORM_XTYPE', hidden: true,
- },
- {
- dataIndex: 'form_fieldset', text: '对话框字段组',
- editor: { xtype: 'textfield' }, hidden: true,
- },
- {
- dataIndex: 'form_tab', text: '对话框选项卡',
- editor: { xtype: 'textfield' }, hidden: true,
- },
- {
- dataIndex: 'form_readonly', text: '框只读', xtype: 'checkcolumn', width: 60,
- resizable: false, sortable: false, menuDisabled: true,
- checkedValue: true, uncheckedValue: false, hidden: true,
- },
- ],
- },
- {
- title: 'SQL和查询条件', reference: 'sql',
- layout: 'border',
- border: false,
- items: [
- {
- region: 'north',
- height: 200,
- border: false,
- split: true,
- xtype: 'yvgrid',
- reference: 'gridCondition',
- pagination: false,
- hideFootbar: true,
- _mode: 'edit',
- listeners: {
- buttonclick: 'scope.conditionButtonclick',
- },
- store: {},
- tbar: {
- xtype: 'toolbar',
- border: false,
- items: [
- {
- xtype: 'button',
- text: '添加条件',
- iconCls: 'x-fa fa-plus-circle',
- listeners: {
- click: 'scope.addCondition'
- }
- },
- {
- xtype: 'button',
- text: '删除条件',
- iconCls: 'x-fa fa-minus-circle',
- listeners: {
- click: 'scope.removeCondition'
- }
- },
- '-',
- {
- xtype: 'button',
- text: '自动分析条件变量',
- iconCls: 'x-fa fa-code-fork',
- listeners: {
- click: 'scope.calcCondition'
- }
- },
- {
- xtype: 'button',
- text: '上移',
- iconCls: 'x-fa fa-arrow-up',
- listeners: {
- click: 'scope.moveUpCondition'
- }
- },
- {
- xtype: 'button',
- text: '下移',
- iconCls: 'x-fa fa-arrow-down',
- listeners: {
- click: 'scope.moveDownCondition'
- }
- },
- ]
- },
- columns: [
- {
- text: '条件变量',
- dataIndex: 'param_name',
- width: 140,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: true
- },
- },
- {
- text: '中文标题',
- dataIndex: 'fieldLabel',
- width: 120,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: true
- },
- },
- {
- text: '编辑类型',
- dataIndex: 'xtype',
- width: 80,
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'combo',
- typeAhead: true,
- triggerAction: 'all',
- selectOnFocus: true,
- store: [
- ['textfield', 'textfield'],
- ['combo', 'combo'],
- ['datefield', 'datefield'],
- ['datetimefield', 'datetimefield'],
- ['numberfield', 'numberfield'],
- ['multiplesearch', 'multiplesearch'],
- ]
- }
- },
- {
- text: '权重',
- dataIndex: 'conditionFieldFlex',
- align: 'right',
- width: 60,
- sortable: false,
- menuDisabled: true,
- editor: {
- xtype: 'numberfield',
- selectOnFocus: false,
- minValue: 0,
- maxValue: 10
- },
- },
- {
- text: '字典',
- dataIndex: 'conditionFieldDict',
- width: 160,
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: false
- },
- },
- {
- xtype: 'checkcolumn',
- dataIndex: "conditionFieldWrap", header: "换行",
- width: 65,
- sortable: false,
- menuDisabled: true,
- },
- {
- text: '扩展参数',
- dataIndex: 'conditionFieldExtend',
- sortable: false,
- menuDisabled: true,
- editor: {
- selectOnFocus: false
- },
- },
- ]
- },
- {
- region: 'center',
- xtype: 'sqleditor',
- layout: 'fit',
- reference: 'sqlEditor',
- split: true,
- },
- ]
- },
- {
- title: '详情对话框',
- layout: {
- type: 'vbox',
- pack: 'start',
- align: 'stretch'
- },
- defaults: {
- border: false,
- anchor: '100%',
- margin: '5',
- },
- scrollable: true,
- items: [
- {
- xtype: 'cols',
- items: [
- {
- fieldLabel: '对话框标题',
- bind: { value: '{detailDialog.title}' },
- xtype: 'textfield',
- flex: 2,
- },
- {
- fieldLabel: '宽度',
- bind: { value: '{detailDialog.width}' },
- xtype: 'numberfield',
- },
- {
- fieldLabel: '高度',
- bind: { value: '{detailDialog.height}' },
- xtype: 'numberfield',
- },
- ]
- },
- ]
- },
- {
- title: '界面源码',
- xtype: 'jseditor',
- reference: 'jseditor'
- }
- ]
- }
- ]
- };
- //# sourceMappingURL=GridColumnCustom.view.js.map
- var GridColumnCustom = /** @class */ (function (_super) {
- __extends(GridColumnCustom, _super);
- function GridColumnCustom() {
- return _super.call(this, { model: model$c, vjson: vjson$c }) || this;
- }
- GridColumnCustom.prototype.commit = function () {
- };
- GridColumnCustom.prototype.grid1Buttonclick = function () {
- };
- GridColumnCustom.prototype.conditionButtonclick = function () {
- };
- GridColumnCustom.prototype.addField = function () {
- };
- GridColumnCustom.prototype.removeField = function () {
- };
- GridColumnCustom.prototype.calcField = function () {
- };
- GridColumnCustom.prototype.moveUp = function () {
- };
- GridColumnCustom.prototype.moveDown = function () {
- };
- GridColumnCustom.prototype.addCondition = function () {
- };
- GridColumnCustom.prototype.removeCondition = function () {
- };
- GridColumnCustom.prototype.calcCondition = function () {
- };
- GridColumnCustom.prototype.moveUpCondition = function () {
- };
- GridColumnCustom.prototype.moveDownCondition = function () {
- };
- return GridColumnCustom;
- }(Scope));
- //# sourceMappingURL=GridColumnCustom.js.map
- function initGridCode(grid, newConfig, buttons) {
- if (typeof newConfig.__custom_point === "string" && newConfig.__custom_point) {
- buttons.push({
- xtype: 'button',
- tooltip: '定义表格属性',
- iconCls: 'x-fa fa-codepen',
- handler: function (btn) {
- var customWindow = new GridColumnCustom();
- customWindow.showDialog(btn, {}, {});
- }
- });
- buttons.push({
- xtype: 'button',
- tooltip: '定义表格数据源',
- iconCls: 'x-fa fa-database',
- handler: function () {
- // showCustomGridDataSource(grid)
- }
- });
- }
- }
- //# sourceMappingURL=grid_code.js.map
- window["EXPORT_DATA_HOST"] = "http://127.0.0.1:30000/exportData";
- var hexToString = function (hex) {
- var arr = hex.split("");
- var out = "";
- for (var i = 0; i < arr.length / 2; i++) {
- var tmp = "0x" + arr[i * 2] + arr[i * 2 + 1];
- // @ts-ignore
- var charValue = String.fromCharCode(tmp);
- out += charValue;
- }
- return out;
- };
- var defaultGrid = grid;
- function initGrid () {
- Ext.define('Yvan.Grid', {
- extend: 'Ext.grid.Panel',
- xtype: 'yvgrid',
- __suspendReload: false,
- _originVJson: {},
- constructor: function (config) {
- var _this = this;
- var _a, _b, _c, _d, _e, _f;
- var me = this;
- var dataSource = config.dataSource;
- var scope = ((_a = config.$initParent) === null || _a === void 0 ? void 0 : _a.yvanScope) || ((_c = (_b = config.$initParent) === null || _b === void 0 ? void 0 : _b.lookupReferenceHolder()) === null || _c === void 0 ? void 0 : _c.yvanScope) || ((_d = config.$vmParent) === null || _d === void 0 ? void 0 : _d.yvanScope) || ((_f = (_e = config.$vmParent) === null || _e === void 0 ? void 0 : _e._parent) === null || _f === void 0 ? void 0 : _f.yvanScope);
- me._originVJson = config;
- if (!isDesignMode(scope, config)) {
- this.columnConfigCacheKey = this.makeColumnConfigCacheKey(config);
- if (Array.isArray(config.columns) && config.columns.length > 0) {
- var cacheData = this.getColumnConfigCache();
- if (Array.isArray(cacheData) && cacheData.length > 0) {
- var newColumns = [];
- for (var j = 0; j < cacheData.length; j++) {
- var itData = cacheData[j];
- for (var i = 0; i < config.columns.length; i++) {
- var column = config.columns[i];
- if (itData.dataIndex === column.dataIndex) {
- if (itData.width) {
- column.width = itData.width;
- }
- column.hidden = itData.hidden;
- column.locked = itData.locked;
- newColumns.push(column);
- break;
- }
- }
- }
- config.columns = newColumns;
- }
- }
- }
- var newConfig = _$2.defaultsDeep({
- // 强制性属性 bug.
- // lock 属性会造成 Cannot read properties of undefined (reading 'els')
- // enableLocking: false,
- // syncRowHeight: false,
- }, baseConfig(config, 'row-item'), config, grid);
- // 在面板上的组件
- // const scope = newConfig.$initParent?.yvanScope ||
- // newConfig.$initParent?.lookupReferenceHolder()?.yvanScope ||
- // config.$vmParent?.yvanScope ||
- // newConfig.$vmParent?._parent?.yvanScope;
- var buttons = [];
- var getRowClass = newConfig.getRowClass;
- if (typeof getRowClass === 'string' && (_$2.startsWith(getRowClass, "scope.") ||
- _$2.startsWith(getRowClass, "system."))) {
- var fn = lookupFn(scope, getRowClass);
- _$2.set(newConfig, 'viewConfig.getRowClass', fn);
- }
- if (!newConfig.hideExport) {
- buttons.push({
- xtype: 'button',
- tooltip: '导出Excel',
- iconCls: 'x-fa fa-download',
- listeners: {
- click: this.exportExcel
- },
- });
- }
- if (!newConfig.hideAutoSize) {
- buttons.push({
- xtype: 'button',
- iconCls: 'x-fa fa-text-width',
- tooltip: '自适应宽度',
- listeners: {
- click: this.autoSizeColumns
- }
- });
- }
- if (!newConfig.hideClearFilter) {
- buttons.push({
- xtype: 'button',
- tooltip: '清空筛选',
- iconCls: 'x-fa fa-filter',
- handler: this.clearFilter
- });
- }
- if (!newConfig.hideSaveGridUIConfig) {
- buttons.push({
- xtype: 'button',
- tooltip: '保存布局',
- iconCls: 'x-fa fa-cogs',
- handler: this.saveGridUIConfig
- });
- }
- if (!newConfig.hideClearGridUIConfig) {
- buttons.push({
- xtype: 'button',
- tooltip: '还原布局',
- iconCls: 'x-fa fa-reply-all',
- handler: this.clearGridUIConfig
- });
- }
- initGridCode(me, newConfig, buttons);
- if (!newConfig.hideFootbar) {
- if (newConfig.pagination) {
- newConfig.bbar = new Ext.PagingToolbar({
- // pageSize: newConfig.pageSize, 这个值是无效的
- displayInfo: true,
- store: this.store,
- emptyMsg: '没有记录',
- cls: 'grid-bbar',
- items: __spread([
- {
- xtype: 'combobox',
- tooltip: '分页',
- queryMode: 'local',
- editable: false,
- allowBlank: true,
- labelAlign: 'right',
- width: 90,
- // labelWidth: 30,
- listConfig: {
- minWidth: null
- },
- value: 50,
- valueField: undefined,
- displayField: undefined,
- hideClear: true,
- store: newConfig.pageSizeOption,
- listeners: {
- change: function (sender, nv, ov) {
- _this.store.pageSize = nv;
- _this.store.loadPage(1);
- }
- }
- }
- ], buttons),
- doRefresh: function () {
- me.reload();
- }
- });
- }
- else {
- newConfig.bbar = {
- xtype: 'toolbar', overflowHandler: 'menu',
- cls: 'grid-bbar',
- items: __spread([
- {
- xtype: 'button',
- tooltip: '刷新',
- iconCls: 'x-fa fa-refresh',
- handler: function () {
- _this.reload();
- }
- },
- '-'
- ], buttons)
- };
- if (newConfig.hideRefresh) {
- newConfig.bbar.items.splice(0, 1);
- }
- }
- }
- if (_$2.isArray(newConfig.condition)) {
- // 带查询条件
- var conditionRows_1 = [];
- var newRow_1 = false;
- var currentRow_1 = { xtype: 'cols', items: [], };
- conditionRows_1.push(currentRow_1);
- _$2.forEach(newConfig.condition, function (item) {
- var _a;
- if (newRow_1) {
- currentRow_1 = { xtype: 'cols', items: [], };
- conditionRows_1.push(currentRow_1);
- }
- var vj = _$2.cloneDeep(item);
- if (vj.xtype) {
- if (item.xtype === 'combo' && item.dict) {
- vj.fix = ['system.getDict("' + item.dict + '")'];
- }
- if (item.xtype === 'datetimefield') {
- _$2.defer(function () {
- //@ts-ignore
- scope.viewModel.set(item.param_name, moment(window.getServerTime()).format('YYYY-MM-DD HH:mm:ss'));
- });
- }
- else if (item.xtype === 'datefield') {
- _$2.defer(function () {
- //@ts-ignore
- scope.viewModel.set(item.param_name, moment(window.getServerTime()).format('YYYY-MM-DD'));
- });
- }
- else {
- scope.viewModel.set(item.param_name, '');
- }
- }
- else {
- // 没有组件类型,是个空占位符
- vj.border = false;
- }
- if (item.param_name) {
- vj.bind = {
- value: '{' + item.param_name + '}'
- };
- _$2.set(newConfig.dataSource, 'params.' + item.param_name, '{' + item.param_name + '}');
- _$2.set(dataSource, 'params.' + item.param_name, '{' + item.param_name + '}');
- }
- newRow_1 = (_a = item.wrap) !== null && _a !== void 0 ? _a : false;
- currentRow_1.items.push(vj);
- });
- newConfig.tbar = {
- xtype: 'form',
- border: false,
- items: conditionRows_1,
- defaults: {
- margin: '8 0 8 0'
- },
- };
- console.log('newConfig', newConfig);
- }
- _$2.each(newConfig.columns, function (c) {
- var renderer = c.renderer, formatter = c.formatter;
- if (typeof renderer === 'string' && (_$2.startsWith(renderer, "scope.") ||
- _$2.startsWith(renderer, "system."))) {
- if (newConfig.$initParent) {
- if (scope) {
- var rendererFn = lookupFn(scope, renderer);
- c.renderer = rendererFn.bind(scope);
- }
- }
- }
- if (c.dict) {
- c.fix = ['system.getDict("' + c.dict + '")'];
- if (c.editor && c.editor.xtype === 'combo') {
- c.editor.fix = ['system.getDict("' + c.dict + '")'];
- c.editor.typeAhead = true;
- c.editor.triggerAction = 'all';
- c.editor.selectOnFocus = false;
- c.editor.listConfig = {
- minWidth: 200
- };
- }
- }
- if (formatter === 'button') {
- c.tdCls = 'td-btn';
- if (!c.listeners) {
- c.listeners = {};
- }
- c.listeners.click = function (sender, td, rowIdx, colIdx, event, record) {
- if ($(event.target).is('input')) {
- me.fireEvent('buttonclick', me, this, record);
- }
- };
- }
- else if (formatter === 'percentRenderer') {
- c.tdCls = 'td-percent';
- }
- });
- if (newConfig._mode === 'edit' || newConfig._mode === 'edit1' || newConfig._mode === 'edit2') {
- // 强制为编辑模式
- newConfig.selModel = {
- type: 'spreadsheet',
- columnSelect: true,
- pruneRemoved: false,
- extensible: 'y'
- };
- newConfig.plugins = __assign(__assign({}, newConfig.plugins), { clipboard: true, selectionreplicator: true });
- if (newConfig._mode === 'edit2' || newConfig._mode === 'edit') {
- _$2.set(newConfig, 'plugins.cellediting.clicksToEdit', 2);
- }
- else {
- _$2.set(newConfig, 'plugins.cellediting.clicksToEdit', 1);
- }
- }
- else if (newConfig._mode === 'checkbox' || newConfig._mode === 'check') {
- // 强制为勾选模式
- newConfig.selModel = {
- type: 'checkboxmodel',
- mode: 'MULTI',
- };
- }
- else if (newConfig._mode === 'checkonly') {
- newConfig.selModel = {
- type: 'checkboxmodel',
- mode: 'MULTI',
- checkOnly: true,
- };
- }
- else if (newConfig._mode === 'select') {
- // 强制为选择模式
- newConfig.selModel = {
- selType: 'rowmodel',
- mode: 'SINGLE',
- };
- if (typeof _$2.get(newConfig, 'plugins.cellediting.clicksToEdit') === 'number') {
- _$2.set(newConfig, 'plugins.cellediting.clicksToEdit', 2);
- }
- }
- initBehaviorEdit(newConfig);
- initGridDialog(newConfig);
- this.superclass.constructor.call(this, newConfig);
- this.store.pageSize = newConfig.pageSize;
- },
- setData: function (value) {
- var me = this;
- me._setDataReal(value);
- },
- /**
- * 添加行,并进入编辑状态
- * @param record 新行的属性集
- * @param editRowCol 要编辑的列序号,或 dataIndex 的名称
- */
- appendEditRow: function (record, editRowCol) {
- var records = this.getStore().add(record);
- var recNew = records[0];
- this.setSelection(records);
- if (typeof editRowCol === 'string' && editRowCol) {
- editRowCol = this.columns.findIndex(function (c) { return c.dataIndex === editRowCol; });
- }
- if (typeof editRowCol === 'number') {
- var ce = this.findPlugin('cellediting');
- this.editingPlugin = ce;
- ce.startEdit(recNew, editRowCol);
- }
- },
- beginEdit: function (record, editRowCol) {
- if (typeof record === 'number') {
- record = this.store.data.getAt(record);
- }
- if (record.isEntity === true) {
- this.setSelection([record]);
- if (typeof editRowCol === 'string' && editRowCol) {
- editRowCol = this.columns.findIndex(function (c) { return c.dataIndex === editRowCol; });
- }
- if (typeof editRowCol === 'number') {
- var ce = this.findPlugin('cellediting');
- this.editingPlugin = ce;
- ce.startEdit(record, editRowCol);
- }
- }
- },
- /**
- * 移除行
- * @param record 如果记录传空,就是当前选中的行
- */
- removeEditRow: function (record) {
- if (!record) {
- record = this.selection;
- }
- if (!record) {
- msg('请选中要删除的行');
- return;
- }
- this.getStore().remove(record);
- },
- /**
- * 获取全部原始数据
- */
- getDataRows: function () {
- return this.getStore().data.items.map(function (r) { return r.data; });
- },
- /**
- * 获取全部原始数据, 不带 id/ 不带 origin
- */
- getDataRowsOnlyData: function () {
- return _$2.map(_$2.cloneDeep(this.getDataRows()), function (r) {
- delete r.id;
- delete r._origin;
- return r;
- });
- },
- rowMoveUp: function () {
- var grid = this;
- if (!grid.selection) {
- msg('无法对多行进行移动');
- return;
- }
- var record = grid.selection;
- if (_$2.isArray(record)) {
- record = record[0];
- }
- if (!record) {
- msg('无法对多行进行移动');
- return;
- }
- // const records = grid.selModel.getSelection()
- // if (records.length !== 1) {
- // msg('无法对多行进行移动')
- // return
- // }
- //
- // const [record] = records
- var index = grid.store.indexOf(record);
- if (index > 0) {
- grid.store.removeAt(index);
- grid.store.insert(index - 1, record);
- grid.getView().refresh();
- grid.selModel.select([record]);
- }
- },
- rowMoveDown: function () {
- var grid = this;
- // const records = grid.selModel.getSelection()
- // if (records.length !== 1) {
- // msg('无法对多行进行移动')
- // return
- // }
- if (!grid.selection) {
- msg('无法对多行进行移动');
- return;
- }
- var record = grid.selection;
- if (_$2.isArray(record)) {
- record = record[0];
- }
- if (!record) {
- msg('无法对多行进行移动');
- return;
- }
- var index = grid.store.indexOf(record);
- if (index < grid.store.getCount() - 1) {
- grid.store.removeAt(index);
- grid.store.insert(index + 1, record);
- grid.getView().refresh();
- grid.selModel.select([record]);
- }
- },
- getEditRecord: function () {
- var _a, _b;
- var me = this;
- var editingPlugin = me.editingPlugin || me.ownerGrid.editingPlugin;
- var rowIdx = (_b = (_a = editingPlugin === null || editingPlugin === void 0 ? void 0 : editingPlugin.activeEditor) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.rowIdx;
- var record;
- if (typeof rowIdx === 'undefined') {
- record = me.getSelectionModel().getLastSelected();
- }
- else {
- record = me.store.getAt(rowIdx);
- }
- return record;
- },
- getEditRow: function () {
- var _a;
- var me = this;
- return (_a = me.getEditRecord()) === null || _a === void 0 ? void 0 : _a.data;
- },
- setEditRow: function (rowValues) {
- var me = this;
- var record = me.getEditRecord();
- if (record) {
- _$2.forOwn(rowValues, function (v, k) {
- record.set(k, v);
- });
- }
- },
- _transform: function (data) {
- // 无论是 grid._setDataReal 还是 stores.gridInvokeBuild 都会走这个函数,设值前都可以改变表格值
- _$2.forEach(data, function (row) {
- row._origin = _$2.clone(row);
- });
- },
- _setDataReal: function (value) {
- var me = this;
- this._transform(value);
- var storeOpt = {
- fields: getFileds(this),
- data: value,
- };
- if (this.groupField) {
- storeOpt.groupField = this.groupField;
- }
- var store = new Ext.data.Store(storeOpt);
- me.setStore(store);
- },
- setStore: function (store) {
- var me = this;
- if (_$2.isArray(store)) {
- var value = store;
- this._transform(value);
- var storeOpt = {
- fields: getFileds(this),
- data: value,
- };
- if (this.groupField) {
- storeOpt.groupField = this.groupField;
- }
- store = new Ext.data.Store(storeOpt);
- }
- me.superclass.setStore.call(this, store);
- var reference = this.reference;
- if (reference) {
- var scope = lookupScope(this);
- scope.viewModel.set(reference + '.ischanged', false);
- scope.viewModel.set(reference + '.theid', null);
- scope.viewModel.set(reference + '.theid2', null);
- scope.viewModel.set(reference + '.theid3', null);
- }
- if (store) {
- store.on({
- add: function (store, records, index, eOpts) {
- me._raiseChange(store, 'add');
- },
- remove: function (store, records, index, isMove, eOpts) {
- me._raiseChange(store, 'remove');
- },
- datachanged: function (sender, opt) {
- me._raiseChange(store, 'datachanged');
- }
- });
- }
- },
- _raiseChange: function (store, type) {
- var _a, _b;
- var reference = this.reference;
- if (reference && store) {
- var ischanged = false;
- if (store.getModifiedRecords().length > 0 ||
- store.getNewRecords().length > 0 ||
- store.getRemovedRecords().length > 0) {
- ischanged = true;
- }
- else {
- ischanged = false;
- }
- (_b = (_a = lookupScope(this)) === null || _a === void 0 ? void 0 : _a.viewModel) === null || _b === void 0 ? void 0 : _b.set(reference + '.ischanged', ischanged);
- }
- },
- /**
- * 轻量级刷新
- */
- refreshData: function () {
- var store = this.getStore();
- if (store) {
- store.reload();
- }
- },
- /**
- * 为表格强制设置焦点
- * @param seq 顺序号
- */
- focusRow: function (seq) {
- this.setSelection(this.store.getAt(seq));
- this.getView().focusRow(seq);
- },
- /**
- * 重新载入数据(重新计算参数)
- */
- reload: function (reloadParams) {
- if (reloadParams === void 0) { reloadParams = {}; }
- var me = this;
- var config = me.config;
- if (config.dataSourceCallbackFn) {
- // 函数请求刷新
- var scope_1 = lookupScope(this);
- _$2.defer(function () {
- me.setLoading(true);
- });
- config.dataSourceCallbackFn.call(scope_1, me, {
- successCallback: function (value) {
- me._setDataReal(value);
- _$2.defer(function () {
- me.setLoading(false);
- });
- // 自动选中第一行
- var data = me.getStore().data;
- if (data.length > 0) {
- me.setSelection(data.items[0]);
- }
- me.fireEvent('dataLoadComplete', me, true, value);
- },
- failCallback: function (error) {
- _$2.defer(function () {
- me.setLoading(false);
- });
- me.fireEvent('dataLoadComplete', me, false, error);
- }
- });
- return;
- }
- // if (this.store) {
- // this.store.reload({aaaa: 1, bbbb: 2})
- // }
- var dataSource = config.dataSource;
- var scope = lookupScope(me);
- if (_$2.isPlainObject(dataSource) && !isDesignMode(scope, config)) {
- gridInvokeBuild(scope, me, config, dataSource, reloadParams);
- }
- },
- exportCurrentExcelClick: function () {
- var _a;
- var me = this;
- var config = me.config;
- var scope = lookupScope(me);
- var excelFileName = config.excelFileName || scope.vjson.title || _$2.uniqueId("excel-");
- if (excelFileName.endsWith(".xlsx")) {
- excelFileName = excelFileName.split(".xlsx")[0];
- }
- excelFileName += ".xlsx";
- var rowsAll = (_a = this.getStore().getData().items) === null || _a === void 0 ? void 0 : _a.map(function (r) { return r.data; });
- var excelData = me.makeExcelData(rowsAll);
- LAY_EXCEL.exportExcel(excelData, excelFileName, 'xlsx');
- },
- exportExcelClick: function (excelExportParams) {
- var me = this;
- var config = me.config;
- excelExportParams.isExcelExport = true;
- var scope = lookupScope(me);
- var dataSource = config.dataSource;
- scope.setLoading(true);
- var excelFileName = config.excelFileName || scope.vjson.title || _$2.uniqueId("excel-");
- gridInvokeBuild(scope, me, config, dataSource, excelExportParams, true, function (responseData) {
- var _a, _b, _c, _d;
- var page = parseInt((_a = responseData.pagination) === null || _a === void 0 ? void 0 : _a.current) || 1;
- var size = parseInt((_b = responseData.pagination) === null || _b === void 0 ? void 0 : _b.size) || me.exportExcelPageSize;
- var total = parseInt((_c = responseData.pagination) === null || _c === void 0 ? void 0 : _c.total) || ((_d = responseData.data) === null || _d === void 0 ? void 0 : _d.length) || 0;
- me.exportExcelCurrentPage = page;
- me.exportExcelPageSize = size;
- me.exportExcelTotal = total;
- if (excelFileName.endsWith(".xlsx")) {
- excelFileName = excelFileName.split(".xlsx")[0];
- }
- excelFileName += "(第" + me.exportExcelCurrentPage + "页,共" + Math.ceil(total / size) + "页、" + total + "条)";
- excelFileName += ".xlsx";
- var excelData = me.makeExcelData(responseData.data);
- LAY_EXCEL.exportExcel(excelData, excelFileName, 'xlsx');
- if (page < total / size) {
- page++;
- me.exportExcelCurrentPage = page;
- }
- scope.setLoading(false);
- });
- },
- exportBigExcelClick: function () {
- var _a;
- var me = this;
- if (!((_a = me.dbInfo) === null || _a === void 0 ? void 0 : _a.jdbcurl) || !me.exportDataSql) {
- showErrorDialog('当前表格不支持大批量导出');
- return;
- }
- var config = me.config;
- var scope = lookupScope(me);
- var excelFileName = config.excelFileName || scope.vjson.title || _$2.uniqueId("excel-");
- var head = [];
- var dict = {};
- _$2.forEach(me.columns, function (column) {
- if (column.isHidden())
- return;
- if (!column.dataIndex)
- return;
- if (!column.text)
- return;
- head.push({ field: column.dataIndex, name: column.text });
- if (column.dictForExcel) {
- dict[column.dataIndex] = column.dictForExcel;
- }
- });
- // 判断是否需要解密
- if (me.dbInfo.jdbcurl.indexOf("jdbc") < 0) {
- me.dbInfo.jdbcurl = hexToString(me.dbInfo.jdbcurl);
- me.dbInfo.password = hexToString(me.dbInfo.password);
- me.dbInfo.username = hexToString(me.dbInfo.username);
- }
- scope.setLoading(true);
- Ext.Ajax.request({
- timeout: 15000,
- url: window["EXPORT_DATA_HOST"],
- method: "POST",
- jsonData: {
- file: excelFileName,
- dbInfo: me.dbInfo,
- exportDataSql: me.exportDataSql,
- exportDataSqlParams: me.exportDataSqlParams,
- head: head,
- dict: dict,
- },
- }).then(function () {
- scope.setLoading(false);
- msg('请求成功');
- }).catch(function () {
- scope.setLoading(false);
- showErrorDialog('请求失败,请确认是否已安装客户端');
- });
- },
- makeExcelData: function (jsonData) {
- var me = this;
- me.fireEvent('onExcelDataLoadCompleted', me, jsonData);
- if (!Array.isArray(jsonData) || jsonData.length === 0) {
- return;
- }
- var data = [];
- // 获取表格的列定义
- var headerTextArr = [];
- var headers = [];
- for (var i = 0; i < me.headerCt.getGridColumns().length; i++) {
- var header = me.headerCt.getGridColumns()[i];
- if (!header.isHidden()) {
- var textStr = _$2.trim(header.text);
- var dataIndexStr = _$2.trim(header.dataIndex);
- if (dataIndexStr) {
- if (textStr === '') {
- headerTextArr.push(dataIndexStr);
- }
- else {
- headerTextArr.push(textStr);
- }
- headers.push(header);
- }
- }
- }
- if (headers.length === 0) {
- return;
- }
- data.push(headerTextArr);
- for (var i = 0; i < jsonData.length; i++) {
- var dataRow = jsonData[i];
- var row = [];
- for (var j = 0; j < headers.length; j++) {
- var key = headers[j].dataIndex;
- var value = dataRow[key];
- if (!value && value !== 0) {
- value = '';
- }
- var oValue = value;
- // todo 导出处理字典日期等数据,如果有特殊的单元格渲染也可能出现导出的数据有特殊标记需要特殊处理一下
- if (typeof headers[j].renderer === 'function' && (!headers[j].config.formatter)) {
- try {
- value = headers[j].renderer(value);
- if (!value && value !== 0) {
- value = oValue;
- }
- }
- catch (e) {
- value = oValue;
- }
- }
- row.push(value);
- }
- data.push(row);
- }
- return data;
- },
- initComponent: function () {
- var _this = this;
- var _a;
- var me = this;
- var config = me.config;
- var scope = lookupScope(this);
- if (isDesignMode(scope, config)) {
- this.superclass.initComponent.call(this);
- return;
- }
- // 转换 dataSource 属性
- convertDataSource$1(me, scope, config);
- this.on({
- afterrender: function (sender) {
- var me = this;
- var config = this.config;
- var dataSource = config.dataSource;
- if (config.autoLoad) {
- if (config.dataSourceCallbackFn) {
- me.reload();
- }
- else if (_$2.isPlainObject(dataSource)) {
- me.reload();
- }
- }
- if (config.contextMenu === true && _$2.isArray(config.tbar)) {
- var vm = this.lookupViewModel();
- this.contextMenu = this.add(new Ext.menu.Menu({
- viewModel: vm,
- items: _$2.map(config.tbar, function (item) {
- var menuItem = __assign({}, item);
- if (menuItem.xtype === 'button') {
- delete menuItem.xtype;
- }
- return menuItem;
- })
- }));
- }
- else if (_$2.isPlainObject(config.contextMenu)) {
- this.contextMenu = this.add(config.contextMenu);
- }
- var $dom = $(sender.el.dom);
- $dom.on('keydown', function (e) {
- me.fireEvent('keydown', me, e);
- }).on('keyup', function (e) {
- me.fireEvent('keyup', me, e);
- });
- // 默认显示提示
- if (this.cellTip) {
- this.tip = Ext.create('Ext.tip.ToolTip', {
- target: this.el,
- delegate: '.x-grid-cell-inner',
- trackMouse: true,
- ancor: 'top',
- style: 'background-color: #0D6EFD;',
- listeners: {
- beforeshow: function (tip) {
- var tipText = (tip.triggerElement.innerText || tip.triggerElement.textContent);
- if (Ext.isEmpty(tipText) || Ext.isEmpty(tipText.trim())) {
- return false;
- }
- tip.update(tipText);
- }
- }
- });
- }
- },
- itemcontextmenu: function (view, rec, node, index, e) {
- if (this.contextMenu) {
- e.stopEvent();
- this.contextMenu.show().setLocalXY(e.getXY());
- return false;
- }
- },
- // columnmove(sender, column, fromIndex, toIndex, eOpts) {
- // this.setColumnConfigCache()
- // },
- // columnhide(sender, column, eOpts) {
- // this.setColumnConfigCache()
- // },
- // columnshow(sender, column, eOpts) {
- // this.setColumnConfigCache()
- // },
- // columnresize(sender, column, width, eOpts) {
- // this.setColumnConfigCache()
- // },
- destory: function () {
- },
- selectionchange: function (sender, param) {
- var record = undefined;
- if (_$2.isArray(param)) {
- record = param[0];
- }
- else if (_$2.isObject(param)) {
- record = _$2.get(param, 'endCell.record');
- }
- itemselectFun(this, sender, record);
- },
- itemclick: function (sender, record) {
- itemselectFun(this, sender, record);
- },
- show: function (sender) {
- if (sender.__suspendReload) {
- sender.__suspendReload = false;
- sender.reload();
- }
- }
- });
- _$2.defer(function () {
- var ce = _this.findPlugin('cellediting');
- ce.on({
- beforeedit: function (editor, context, eOpts) {
- me.fireEvent('editbefore', me, editor, context, eOpts);
- },
- canceledit: function (editor, context, eOpts) {
- me.fireEvent('editcancel', me, editor, context, eOpts);
- },
- edit: function (editor, context, eOpts) {
- me.fireEvent('editfinish', me, editor, context, eOpts);
- },
- validateedit: function (editor, context, eOpts) {
- me.fireEvent('editvalidate', me, editor, context, eOpts);
- },
- });
- });
- var itemselectFun = _$2.debounce(function (me, sender, record) {
- var reference = me.reference;
- var scope = lookupScope(me);
- var theid = _$2.get(config, 'behavior.theid');
- if (theid && reference) {
- if (!record) {
- scope.viewModel.set(reference + '.theid', null);
- }
- else {
- scope.viewModel.set(reference + '.theid', record.get(theid));
- }
- }
- var theid2 = _$2.get(config, 'behavior.theid2');
- if (theid2 && reference) {
- if (!record) {
- scope.viewModel.set(reference + '.theid2', null);
- }
- else {
- scope.viewModel.set(reference + '.theid2', record.get(theid2));
- }
- }
- var theid3 = _$2.get(config, 'behavior.theid3');
- if (theid3 && reference) {
- if (!record) {
- scope.viewModel.set(reference + '.theid3', null);
- }
- else {
- scope.viewModel.set(reference + '.theid3', record.get(theid3));
- }
- }
- me.fireEvent('itemselect', sender, record);
- }, 50);
- if ((_a = this.store) === null || _a === void 0 ? void 0 : _a.proxy) {
- // 为 stores.proxy.buildRequest 做准备
- this.store.proxy.$owner = this;
- }
- var selectToReload = _$2.get(config, 'behavior.selectToReload');
- if (selectToReload) {
- // 点击后触发某个目标表格刷新
- this.on({
- itemselect: function (sender) {
- if (_$2.isArray(selectToReload)) {
- _$2.forEach(selectToReload, function (ref) {
- if (ref) {
- var ctlTarget = scope.refs[ref];
- if (ctlTarget && typeof ctlTarget.reload === 'function') {
- if (ctlTarget.isVisible()) {
- ctlTarget.reload();
- }
- else {
- ctlTarget.__suspendReload = true;
- }
- }
- }
- });
- }
- else if (_$2.isString(selectToReload)) {
- var ctlTarget = scope.refs[selectToReload];
- if (ctlTarget && typeof ctlTarget.reload === 'function') {
- ctlTarget.reload();
- }
- }
- }
- });
- }
- this.superclass.initComponent.call(this);
- },
- // 生成列自定义的缓存key
- makeColumnConfigCacheKey: function (config) {
- var _a, _b, _c, _d, _e, _f;
- var scope = ((_a = config.$initParent) === null || _a === void 0 ? void 0 : _a.yvanScope) || ((_c = (_b = config.$initParent) === null || _b === void 0 ? void 0 : _b.lookupReferenceHolder()) === null || _c === void 0 ? void 0 : _c.yvanScope) || ((_d = config.$vmParent) === null || _d === void 0 ? void 0 : _d.yvanScope) || ((_f = (_e = config.$vmParent) === null || _e === void 0 ? void 0 : _e._parent) === null || _f === void 0 ? void 0 : _f.yvanScope);
- var key = "gridColumnCache-" + scope.scopeKey + "-";
- if (config.reference) {
- key += config.reference;
- }
- else {
- var subKey = "";
- for (var i = 0; i < config.columns.length; i++) {
- var column = config.columns[i];
- if (column.dataIndex) {
- subKey += column.dataIndex;
- }
- }
- key += subKey;
- }
- return key;
- },
- getColumnConfigCache: function () {
- var key = this.columnConfigCacheKey;
- var dataStr = localStorage.getItem(key);
- if (dataStr) {
- return JSON.parse(dataStr);
- }
- return "";
- },
- setColumnConfigCache: function () {
- var key = this.columnConfigCacheKey;
- var cacheData = [];
- var columns = this.headerCt.getGridColumns();
- var index = 0;
- for (var i = 0; i < columns.length; i++) {
- var column = columns[i];
- if (column.dataIndex) {
- cacheData.push({
- dataIndex: column.dataIndex,
- width: column.width,
- hidden: column.hidden,
- locked: column.locked,
- index: index
- });
- index++;
- }
- }
- localStorage.setItem(key, JSON.stringify(cacheData));
- },
- autoSizeColumns: function (sender) {
- var grid = sender ? sender.up('grid') : this;
- // const columns = grid.columns;
- // for (let i = 0; i < columns.length; i++) {
- // const column = columns[i];
- // grid.getView().autoSizeColumn(column);
- // column.setWidth(column.getWidth() + 5);
- // }
- for (var i = 1; i < grid.headerCt.getColumnCount(); i++) {
- grid.headerCt.getGridColumns()[i].autoSize(i);
- grid.headerCt.getGridColumns()[i].setWidth(grid.headerCt.getGridColumns()[i].getWidth() + 15);
- }
- },
- clearFilter: function (sender) {
- var grid = sender.up('grid');
- grid.filters.clearFilters();
- grid.getStore().sorters.removeAll();
- // grid.getStore().reload()
- },
- saveGridUIConfig: function (sender) {
- var grid = sender.up('grid');
- grid.setColumnConfigCache();
- msg('保存设置成功!');
- },
- clearGridUIConfig: function (sender) {
- var grid = sender.up('grid');
- var key = grid.columnConfigCacheKey;
- localStorage.setItem(key, "");
- msg('清空设置成功,重新打开后生效!');
- },
- setLoading: function (value) {
- if (value) {
- this.mask('读取中');
- }
- else {
- this.unmask();
- }
- },
- exportExcel: function (sender) {
- var rect = sender.btnEl.dom.getBoundingClientRect();
- var scope = lookupScope(this);
- var grid = sender.up('grid');
- var menuItems = [];
- if (grid.dataSource.method === 'invoke' || grid.dataSource.sqlId) {
- menuItems.push({
- text: '大批量导出 (需要客户端支持!)',
- iconCls: 'x-fa fa-download',
- listeners: {
- click: function (sender, value) {
- // @ts-ignore
- YvanUI.confirm('大批量数据导出会占用大量服务器资源和带宽资源,您真的要导出吗?')
- .then(function (res) {
- grid.exportBigExcelClick();
- });
- }
- }
- });
- menuItems.push('-');
- }
- menuItems.push({
- text: '导出当前数据',
- iconCls: 'x-fa fa-download',
- listeners: {
- click: function (sender, value) {
- grid.exportCurrentExcelClick();
- }
- }
- }, {
- xtype: "textfield",
- fieldLabel: '当前导出页',
- maskRe: /[0-9]/,
- value: grid.exportExcelCurrentPage,
- listeners: {
- render: function (sender) {
- grid.exportExcelCurrentPageCmp = sender;
- },
- change: function (sender, value) {
- var v = parseInt(value);
- if (isNaN(v) || v === 0) {
- window['system'].msg("页码不能为0");
- v = 1;
- sender.setValue(v);
- }
- var size = parseInt(grid.exportExcelPageSize);
- var total = parseInt(grid.exportExcelTotal);
- if (v > total / size) {
- v = parseInt(total / size + "");
- }
- grid.exportExcelCurrentPage = v + "";
- }
- }
- }, {
- xtype: "textfield",
- fieldLabel: '导出页大小',
- maskRe: /[0-9]/,
- value: grid.exportExcelPageSize,
- listeners: {
- render: function (sender) {
- grid.exportExcelPageSizeCmp = sender;
- },
- change: function (sender, value) {
- var v = parseInt(value);
- if (isNaN(v) || v === 0) {
- window['system'].msg("导出页大小不能为0");
- v = defaultGrid.exportExcelPageSize;
- sender.setValue(v);
- }
- if (v > 10000) {
- window['system'].msg("导出页大小不能大于10000");
- v = 10000;
- sender.setValue(v);
- }
- var page = parseInt(grid.exportExcelCurrentPage);
- var total = parseInt(grid.exportExcelTotal);
- if (page > total / v) {
- page = parseInt(total / v + "") + 1;
- grid.exportExcelCurrentPageCmp.setValue(page);
- }
- grid.exportExcelPageSize = v + "";
- }
- }
- }, {
- xtype: "textfield",
- fieldLabel: '总条数',
- value: grid.exportExcelTotal,
- readOnly: true
- }, {
- text: '导出',
- iconCls: 'x-fa fa-download',
- listeners: {
- click: function (sender, value) {
- grid.exportExcelClick({
- exportExcelPageSize: grid.exportExcelPageSize,
- exportExcelCurrentPage: grid.exportExcelCurrentPage
- });
- }
- }
- });
- var treeMenu = new Ext.menu.Menu({
- xtype: 'menu',
- floated: false,
- width: 300,
- docked: 'left',
- items: menuItems
- });
- treeMenu.showAt(rect.left, rect.top - 120);
- // for (let i = 1; i < grid.headerCt.getColumnCount(); i++) {
- // grid.headerCt.getGridColumns()[i].autoSize(i);
- // grid.headerCt.getGridColumns()[i].setWidth(grid.headerCt.getGridColumns()[i].getWidth() + 15);
- // }
- },
- /**
- * 获取表格编辑的行数据
- */
- getGridEditRows: function () {
- var grid = this;
- var store = grid.getStore();
- var rows = [];
- var modifyRows = [];
- var newRows = [];
- var err = "";
- var records = store.getModifiedRecords();
- var newRecords = store.getNewRecords();
- var removeRecords = [];
- _$2.forEach(store.getRemovedRecords(), function (row) {
- removeRecords.push(row.data);
- });
- _$2.forEach(records, function (record) {
- var colums = grid.columns;
- var errFunc = undefined;
- _$2.forEach(colums, function (col) {
- var name = col.dataIndex;
- var value = record.data[name];
- var colIndex = col.getIndex(); //获得列号
- var rowIndex = store.indexOfId(record.id); //获得行号
- var editor = col.getEditor(); //使用的编辑器
- var tmpErrFunc = function () {
- var text = col.text || col.name;
- msg(text + ' 校验失败, 请确保输入的数据正确');
- grid.findPlugin('cellediting').startEdit(rowIndex, col); //如果不通过激活当前编辑状态
- };
- if (editor && !editor.allowBlank && isEmpty(value)) {
- errFunc = tmpErrFunc;
- return false;
- }
- if (editor && !isEmpty(value) && !editor.validateValue(value)) {
- errFunc = tmpErrFunc;
- return false;
- }
- });
- if (typeof errFunc === 'function') {
- err = "1";
- _$2.remove(rows, function (n) {
- return true;
- });
- //@ts-ignore
- errFunc();
- // Ext.Msg.alert('提示', '请确保输入的数据正确', errFunc)
- return false;
- }
- else {
- if (_$2.findIndex(newRecords, function (item) {
- return item === record;
- }) >= 0) {
- newRows.push(record.data);
- }
- else {
- modifyRows.push(record.data);
- }
- rows.push(record.data);
- }
- });
- return {
- rows: rows,
- newRows: newRows,
- modifyRows: modifyRows,
- removeRecords: removeRecords,
- err: err
- };
- }
- // reload() {
- // dataSourceReload(this)
- // },
- });
- }
- /**
- * 获取 columns 中所有的 dataIndex
- */
- function getFileds(newConfig) {
- var fields = [];
- _$2.forEach(newConfig.columns, function (c) {
- if (c.dataIndex) {
- fields.push(c.dataIndex);
- }
- });
- return fields;
- }
- function convertDataSource$1(sender, scope, newConfig) {
- if (typeof newConfig.store !== 'undefined') {
- // 有 store 属性的情况下,不做任何事
- return;
- }
- if (typeof newConfig.dataSource === 'undefined') {
- // 没有定义 dataSource 的情况下,不做任何事
- return;
- }
- if (_$2.isArray(newConfig.data)) {
- // 有 data 属性赋值的情况下
- newConfig.store = {
- fields: getFileds(newConfig),
- data: newConfig.data
- };
- delete newConfig.data;
- return;
- }
- var dataSource = newConfig.dataSource;
- if (typeof dataSource === 'string') {
- // dataSource 是字符串的情况下,找到成员函数
- dataSource = lookupFn(scope, dataSource);
- }
- if (typeof dataSource === 'function') {
- // dataSource 是函数的情况下,在 afterrender 之后进行回调
- newConfig.store = new Ext.data.Store({
- fields: getFileds(newConfig),
- // data: [],
- autoLoad: true,
- proxy: {
- type: 'memory',
- data: [],
- }
- });
- newConfig.dataSourceCallbackFn = dataSource;
- return;
- }
- // throw new TypeError('无法识别的调用方法')
- }
- //# sourceMappingURL=grid.js.map
- function initTextfield () {
- var cc = Ext.form.field.Text.prototype.constructor;
- var initComponent = Ext.form.field.Text.prototype.initComponent;
- Ext.form.field.Text.override({
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({
- // 强制属性
- triggers: {
- clear: {
- weight: -1,
- cls: Ext.baseCSSPrefix + 'form-clear-trigger',
- hidden: true,
- handler: 'onClearClick',
- },
- }
- }, baseConfig(config, 'col-item'), config, text);
- if (config === null || config === void 0 ? void 0 : config.nextFocus) {
- newConfig.enableKeyEvents = true;
- }
- cc.call(this, newConfig);
- },
- /**
- * 清空所有值
- */
- onClearClick: function (sender, e) {
- var me = this;
- me.setValue('');
- },
- /**
- * 尝试获取下一个要获取焦点的控件
- */
- _raiseNextFocus: function (sender) {
- var config = sender.config;
- var scope = lookupScope(sender);
- if (typeof config.nextFocus === 'function') {
- config.nextFocus(sender);
- }
- else if (typeof config.nextFocus === 'string' && _$2.size(config.nextFocus) > 0) {
- if (_$2.startsWith(config.nextFocus, 'scope.')) {
- var fn = lookupFn(scope, config.nextFocus);
- if (typeof fn === 'function') {
- var nextCtlReference = fn(sender);
- if (typeof nextCtlReference === 'string' && _$2.size(nextCtlReference) > 0) {
- var ctl = scope === null || scope === void 0 ? void 0 : scope.refs[nextCtlReference];
- if (ctl) {
- if (typeof ctl.focus2 === 'function') {
- ctl.focus2();
- }
- else {
- ctl.focus();
- }
- }
- }
- }
- }
- else {
- var ctl = scope === null || scope === void 0 ? void 0 : scope.refs[config.nextFocus];
- if (ctl) {
- if (typeof ctl.focus2 === 'function') {
- ctl.focus2();
- }
- else {
- ctl.focus();
- }
- }
- }
- }
- },
- initComponent: function () {
- /**
- * 改变必填项之前加星号
- */
- if (this.config.readOnly !== true && (this.allowBlank === false || this.validateBlank === true)) {
- // this.beforeLabelTextTpl = [
- // '<span style="color:red;font-weight:bold" data-qtip="必填选项">*</span>'
- // ];
- this.afterLabelTextTpl = [
- '<span style="color:red;font-weight:bold" data-qtip="必填选项">*</span>'
- ];
- }
- var me = this;
- this.on({
- change: function (sender, newVal) {
- var hideTrigger = sender.hideTrigger, disabled = sender.disabled, readOnly = sender.readOnly, hideClear = sender.hideClear;
- if (hideTrigger || disabled || readOnly || hideClear) {
- // 禁用、隐藏、只读、隐藏清空状态下,不需要显示清空按钮
- return;
- }
- var value = newVal;
- if (value) {
- me.getTrigger('clear').show();
- me.updateLayout();
- }
- else {
- me.getTrigger('clear').hide();
- me.updateLayout();
- }
- },
- afterrender: function (sender) {
- var _this = this;
- var _a;
- if ((_a = sender.inputEl) === null || _a === void 0 ? void 0 : _a.dom) {
- sender.inputEl.dom.setAttribute('spellcheck', "false");
- $$2(sender.inputEl.dom).on('click', function (e) {
- sender.fireEvent('click', _this, e);
- });
- $$2(sender.inputEl.dom).on('keydown', function (e) {
- var _a, _b, _c, _d;
- // 表格内编辑器,按上下键时,可以切换到下一行/上一行 进入编辑
- if (e.code === "ArrowDown" || e.code === 'ArrowUp') {
- if (sender.isExpanded === true) {
- // 弹开下拉框的基础上,不干预上下选择
- return;
- }
- if (((_a = sender.ownerCt) === null || _a === void 0 ? void 0 : _a.xtype) === 'celleditor') {
- var grid = sender.ownerCt.up('grid');
- var editingPlugin = grid.editingPlugin || grid.ownerGrid.editingPlugin;
- if (editingPlugin) {
- var rowIdx = (_c = (_b = editingPlugin === null || editingPlugin === void 0 ? void 0 : editingPlugin.activeEditor) === null || _b === void 0 ? void 0 : _b.context) === null || _c === void 0 ? void 0 : _c.rowIdx;
- var column = (_d = editingPlugin === null || editingPlugin === void 0 ? void 0 : editingPlugin.activeEditor) === null || _d === void 0 ? void 0 : _d.column;
- if (typeof rowIdx !== 'undefined' && typeof column !== 'undefined') {
- // editingPlugin
- var targetRecord = void 0;
- if (e.code === 'ArrowDown') {
- targetRecord = grid.store.data.getAt(rowIdx + 1);
- }
- else {
- targetRecord = grid.store.data.getAt(rowIdx - 1);
- }
- if (targetRecord) {
- grid.setSelection([targetRecord]);
- editingPlugin.startEdit(targetRecord, column);
- }
- e.stopPropagation();
- e.preventDefault();
- }
- }
- }
- }
- });
- }
- var config = sender.config;
- if (config.ff && config.ff > 0) {
- setTimeout(function () {
- if (typeof sender.focus2 === 'function') {
- sender.focus2();
- }
- else {
- sender.focus();
- }
- }, config.ff);
- }
- }
- });
- var config = this.config;
- if (config === null || config === void 0 ? void 0 : config.nextFocus) {
- this.on({
- keyup: function (sender, e) {
- if ([10, 13, 20, 40].includes(e.keyCode)) {
- sender._raiseNextFocus(sender);
- }
- }
- });
- }
- var that = this;
- this.on({
- keyup: function (sender, e, eOpts) {
- if (![10, 13, 20, 40].includes(e.keyCode)) {
- return;
- }
- that.keydown_fun_item(sender, e, eOpts);
- }
- });
- initComponent.call(this);
- },
- keydown_fun_item: _$2.debounce(function (sender, event, eOpts) {
- var that = sender;
- if ([10, 13, 20, 40].includes(event.keyCode)) {
- // 获取读码器读取的内容,最好不要从 viewModel 中取值,而是从 sender.rawValue 中取值
- var value = _$2.trim(sender.rawValue);
- var r = that.fireEvent('scancode', that, value, event);
- if (r === 'OK') {
- // 停止事件的默认处理程序,停止事件的冒泡
- // event.stopEvent();
- event.preventDefault();
- event.stopPropagation();
- }
- }
- }, 100)
- });
- }
- //# sourceMappingURL=textfield.js.map
- function initTbFill () {
- /**
- *
- */
- var ct = Ext.toolbar.Fill.prototype.constructor;
- Ext.toolbar.Fill.override({
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({}, config, baseConfig(config, "col-item"), tbfill);
- ct.call(this, newConfig);
- }
- });
- }
- //# sourceMappingURL=tbfill.js.map
- function initTbSeparator () {
- /**
- *
- */
- var ct = Ext.toolbar.Separator.prototype.constructor;
- Ext.toolbar.Separator.override({
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({}, config, baseConfig(config, "col-item"), tbseparator);
- ct.call(this, newConfig);
- }
- });
- }
- //# sourceMappingURL=tbseparator.js.map
- function initToolbar () {
- /**
- *
- */
- var ct = Ext.toolbar.Toolbar.prototype.constructor;
- Ext.toolbar.Toolbar.override({
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({
- // 强制性属性
- }, baseConfig(config, 'cols-container'), config, toolbar);
- ct.call(this, newConfig);
- }
- });
- initTbFill();
- initTbSeparator();
- }
- //# sourceMappingURL=toolbar.js.map
- function initSplitter () {
- var ct = Ext.resizer.Splitter.prototype.constructor;
- Ext.resizer.Splitter.override({
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({}, config, baseConfig(config, "row-item"), splitter);
- ct.call(this, newConfig);
- }
- });
- }
- //# sourceMappingURL=splitter.js.map
- /**
- * 通用 dataSource 解析,
- * Tree/Combo/Grid/PageList ... 都会从这里解析
- */
- function dataSourceReload(ctl, extraParam, _successCb, successCallback, failCallback) {
- var config = ctl.config;
- return new Promise(function (resolve, reject) {
- if (!config.dataSource) {
- // 没有设置数据源,直接置空
- return Promise.resolve();
- }
- var option = {
- extraParam: extraParam,
- _successCb: _successCb,
- successCallback: function (value) {
- if (typeof successCallback === "function") {
- successCallback(value);
- }
- else {
- ctl.setData(value);
- }
- ctl.fireEvent('dataLoadComplete', ctl, true, value);
- ctl.setLoading(false);
- resolve(value);
- },
- failCallback: function (error) {
- if (typeof failCallback === "function") {
- failCallback(error);
- }
- ctl.fireEvent('dataLoadComplete', ctl, false);
- ctl.setLoading(false);
- reject(error);
- }
- };
- // 请求前要求确认一下
- var isCanceled = false;
- ctl.fireEvent('dataBeforeLoad', ctl, __assign({ cancel: function () {
- isCanceled = true;
- } }, option));
- if (!isCanceled) {
- // 请求没有被取消
- // 调用异步接口返回 Promise
- return _innerReload(ctl, option);
- }
- return reject();
- });
- }
- function _innerReload(ctl, option) {
- var config = ctl.config;
- ctl.setLoading(true);
- var scope = lookupScope(ctl);
- var dataSource = config.dataSource;
- if (typeof dataSource == 'string') {
- dataSource = lookupFn(scope, config.dataSource);
- }
- if (typeof dataSource === 'function') {
- // @ts-ignore
- dataSource.call(scope, ctl, option);
- return;
- }
- else if (typeof (dataSource === null || dataSource === void 0 ? void 0 : dataSource.url) === 'string' || typeof (dataSource === null || dataSource === void 0 ? void 0 : dataSource.sqlId) === 'string') {
- if (!ajax.func) {
- console.error("没有配置 ajax");
- return;
- }
- var params_1 = {};
- var sortModel = null;
- var filterModel = null;
- if (option.extraParam && option.extraParam.filterModel) {
- filterModel = option.extraParam.filterModel;
- }
- if (option.extraParam && option.extraParam.sortModel) {
- sortModel = option.extraParam.sortModel;
- }
- _$2.forOwn(option.extraParam, function (v, key) {
- if (key != "filterModel" && key != "sortModel") {
- if (typeof v === 'function') {
- params_1[key] = v();
- }
- else {
- params_1[key] = v;
- }
- }
- });
- var ds = dataSource;
- _$2.forOwn(ds.params, function (v, key) {
- if (typeof v === 'function') {
- params_1[key] = v();
- }
- else {
- params_1[key] = v;
- }
- });
- if (typeof (dataSource === null || dataSource === void 0 ? void 0 : dataSource.url) === 'string') {
- // @ts-ignore
- ajax.func({
- method: dataSource.method,
- url: ds.url,
- data: params_1,
- filterModel: filterModel,
- sortModel: sortModel,
- }).then(function (res) {
- if (res.success) {
- option.successCallback(res.data);
- }
- else {
- option.failCallback(res.msg);
- }
- }).catch(function (e) {
- option.failCallback(e);
- });
- }
- else if (typeof (dataSource === null || dataSource === void 0 ? void 0 : dataSource.sqlId) === 'string') {
- var ds_1 = ctl.dataSource;
- // @ts-ignore
- Extend.ajax.func({
- url: ds_1.sqlId,
- data: params_1,
- db: ds_1.db,
- method: 'sql',
- filterModel: filterModel,
- sortModel: sortModel,
- }).then(function (res) {
- if (res.success) {
- option.successCallback(res.data);
- }
- else {
- option.failCallback(res.msg);
- }
- }).catch(function (e) {
- option.failCallback(e);
- }).finally(function () {
- ctl.loading = false;
- });
- return;
- }
- else {
- console.error("非法的 dataSource", ctl.dataSource);
- debugger;
- throw new Error("非法的 dataSource");
- }
- }
- }
- //# sourceMappingURL=DataSourceHelper.js.map
- function initCombo () {
- var cc = Ext.form.field.ComboBox.prototype.constructor;
- var _a = Ext.form.field.ComboBox.prototype, initComponent = _a.initComponent, setData = _a.setData, setStore = _a.setStore;
- Ext.form.field.ComboBox.override({
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({
- // 强制性属性
- }, baseConfig(config, 'col-item'), config, combo);
- if (typeof config.dict === 'string') {
- window['yvanLib'].system.getDict(config.dict)(this, newConfig);
- }
- else if (typeof newConfig.store == 'undefined') {
- if (_$2.isArray(newConfig.data)) {
- // ExtJS 无法直接接受数组模式
- newConfig.store = {
- fields: [newConfig.valueField, newConfig.displayField],
- data: newConfig.data
- };
- delete newConfig.data;
- }
- else if (typeof newConfig.data !== 'object') {
- newConfig.store = {
- fields: [newConfig.valueField, newConfig.displayField],
- data: []
- };
- delete newConfig.data;
- }
- }
- cc.call(this, newConfig);
- },
- setDict: function (bizKey) {
- window['yvanLib'].system.getDict(bizKey)(this, this.config);
- this.dict = bizKey;
- },
- getDict: function () {
- return this.dict;
- },
- setData: function (value) {
- if (!value) {
- return;
- }
- var config = value.config;
- if (!this.store) {
- this.store = new Ext.data.Store({
- fields: [config.valueField, config.displayField],
- data: value
- });
- }
- else {
- this.store.getProxy().setData(value);
- this.store.load();
- }
- },
- setLoading: function (value) {
- if (value) {
- if (!this.loadMask) {
- this.loadMask = new Ext.LoadMask(this, { msg: "loading..." });
- }
- }
- else {
- if (this.loadMask) {
- this.loadMask.destroy();
- delete this.loadMask;
- }
- }
- },
- reload: function () {
- dataSourceReload(this);
- },
- initComponent: function () {
- var that = this;
- var toggle = function (e) {
- var readOnly = that.readOnly, disabled = that.disabled;
- if (readOnly || disabled) {
- return;
- }
- if ($(e.target).is('.x-form-trigger')) {
- return;
- }
- // 点击后下拉
- if (that.isExpanded) {
- that.collapse();
- }
- else {
- that.expand();
- that.doQuery(that.allQuery, true);
- }
- };
- this.on({
- afterrender: function (sender) {
- var config = this.config;
- if (config.dataSource && config.autoLoad) {
- dataSourceReload(this);
- }
- // 点击后下拉
- $(this.el.dom).on('click', toggle.bind(this));
- },
- focusenter: function (sender, event, opt) {
- var _a;
- if (((_a = sender.ownerCt) === null || _a === void 0 ? void 0 : _a.xtype) === 'celleditor') {
- // 表格内编辑框,获取焦点后自动弹开
- toggle.call(this, event);
- }
- },
- destory: function () {
- $(this.el.dom).off('click', toggle.bind(this));
- },
- beforequery: function (context) {
- var cancel = context.cancel, forceAll = context.forceAll, lastQuery = context.lastQuery, query = context.query, rawQuery = context.rawQuery, combo = context.combo;
- // console.log('beforequery', query)
- if (!forceAll && query) {
- combo.store.clearFilter();
- combo.store.filterBy(function (record, id) {
- var text = record.get(combo.displayField);
- // 用拼音筛选的方式
- return keywordFilter(query, text, id);
- });
- combo.expand();
- return false;
- }
- combo.store.clearFilter();
- combo.expand();
- return false;
- },
- });
- initComponent.call(this);
- },
- focus2: function () {
- this.focus();
- var that = this;
- _$2.defer(function () {
- if (that.isExpanded) {
- that.collapse();
- }
- else {
- that.expand();
- that.doQuery(that.allQuery, true);
- }
- });
- }
- });
- }
- //# sourceMappingURL=combo.js.map
- /**
- xtype: 'tagfield',
- displayField: 'show',
- valueField: 'id',
- queryMode: 'local',
- filterPickList: true,
- store: {
- fields: ['id', 'show'],
- data: [
- {id: 0, show: 'Battlestar Galactica'},
- {id: 1, show: 'Doctor Who'},
- {id: 2, show: 'Farscape'},
- {id: 3, show: 'Firefly'},
- {id: 4, show: 'Star Trek'},
- {id: 5, show: 'Star Wars: Christmas Special'}
- ]
- }
- */
- function initTag () {
- var cc = Ext.form.field.Tag.prototype.constructor;
- var _a = Ext.form.field.Tag.prototype, initComponent = _a.initComponent, setData = _a.setData, setStore = _a.setStore;
- Ext.form.field.Tag.override({
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({
- // 强制性属性
- }, baseConfig(config, 'col-item'), config, tagfield);
- if (typeof config.dict === 'string') {
- window['yvanLib'].system.getDict(config.dict)(this, newConfig);
- }
- else if (typeof newConfig.store == 'undefined') {
- if (_$2.isArray(newConfig.data)) {
- // ExtJS 无法直接接受数组模式
- newConfig.store = {
- fields: [newConfig.valueField, newConfig.displayField],
- data: newConfig.data
- };
- delete newConfig.data;
- }
- else if (typeof newConfig.data !== 'object') {
- newConfig.store = {
- fields: [newConfig.valueField, newConfig.displayField],
- data: []
- };
- delete newConfig.data;
- }
- }
- cc.call(this, newConfig);
- },
- setDict: function (bizKey) {
- window['yvanLib'].system.getDict(bizKey)(this, this.config);
- this.dict = bizKey;
- },
- getDict: function () {
- return this.dict;
- },
- setData: function (value) {
- if (!value) {
- return;
- }
- var config = value.config;
- if (!this.store) {
- this.store = new Ext.data.Store({
- fields: [config.valueField, config.displayField],
- data: value
- });
- }
- else {
- this.store.getProxy().setData(value);
- this.store.load();
- }
- },
- setLoading: function (value) {
- if (value) {
- if (!this.loadMask) {
- this.loadMask = new Ext.LoadMask(this, { msg: "loading..." });
- }
- }
- else {
- if (this.loadMask) {
- this.loadMask.destroy();
- delete this.loadMask;
- }
- }
- },
- reload: function () {
- dataSourceReload(this);
- },
- initComponent: function () {
- var that = this;
- var toggle = function (e) {
- var readOnly = that.readOnly, disabled = that.disabled;
- if (readOnly || disabled) {
- return;
- }
- if ($(e.target).is('.x-form-trigger')) {
- return;
- }
- // 点击后下拉
- if (that.isExpanded) {
- that.collapse();
- }
- else {
- that.expand();
- that.doQuery(that.allQuery, true);
- }
- };
- this.on({
- afterrender: function (sender) {
- var config = this.config;
- if (config.dataSource && config.autoLoad) {
- dataSourceReload(this);
- }
- // 点击后下拉
- $(this.el.dom).on('click', toggle.bind(this));
- },
- focusenter: function (sender, event, opt) {
- var _a;
- if (((_a = sender.ownerCt) === null || _a === void 0 ? void 0 : _a.xtype) === 'celleditor') {
- // 表格内编辑框,获取焦点后自动弹开
- toggle.call(this, event);
- }
- },
- destory: function () {
- $(this.el.dom).off('click', toggle.bind(this));
- },
- });
- initComponent.call(this);
- },
- focus2: function () {
- this.focus();
- var that = this;
- _$2.defer(function () {
- if (that.isExpanded) {
- that.collapse();
- }
- else {
- that.expand();
- that.doQuery(that.allQuery, true);
- }
- });
- }
- });
- }
- //# sourceMappingURL=tagfield.js.map
- function initComboGridMulti () {
- Ext.define('Yvan.LocalComboGrid', {
- extend: 'Ext.form.field.Picker',
- // extend: 'Yvan.PickerAlignCenter',
- xtype: 'combogridmulti',
- triggerCls: Ext.baseCSSPrefix + 'form-arrow-trigger',
- config: __assign(__assign({}, comboGridMulti), { store: null, displayField: null, columns: null, selectOnTab: true, maxPickerHeight: 300, minPickerHeight: 100, minPickerWidth: 350, rootVisible: true }),
- editable: false,
- initComponent: function () {
- this.on({
- afterrender: function () {
- var config = this.config;
- if (config.dataSource && config.autoLoad) {
- dataSourceReload(this);
- }
- },
- });
- this.superclass.initComponent.apply(this, arguments);
- },
- setStore: function (store) {
- this.store = store;
- var me = this;
- if (me.store) {
- if (me.picker) {
- me.picker.setStore(store);
- if (me.isExpanded) {
- me.collapse();
- delete me.picker;
- me.expand();
- }
- }
- this.onLoad();
- me.mon(me.store, {
- scope: me,
- load: me.onLoad,
- update: me.onUpdate
- });
- }
- },
- reload: function () {
- dataSourceReload(this);
- },
- setData: function (value) {
- var me = this;
- var config = me.config;
- if (!value) {
- return;
- }
- if (!this.store) {
- this.store = new Ext.data.Store({
- fields: [config.valueField, config.displayField],
- data: value
- });
- }
- else {
- this.store.getProxy().setData(value);
- this.store.load();
- }
- this.onLoad();
- },
- createPicker: function () {
- var me = this;
- var picker = new Ext.grid.Panel(__assign(__assign({}, comboGridMultiPicker), { border: false, baseCls: Ext.baseCSSPrefix + 'boundlist', shrinkWrapDock: 2, store: me.store, floating: true, displayField: me.displayField, columns: me.columns, minHeight: me.minPickerHeight, maxHeight: me.maxPickerHeight, minWidth: me.minPickerWidth, manageHeight: false, shadow: false, scrollable: true, listeners: {
- scope: me,
- selectionchange: me.onSelectionChange,
- itemkeydown: me.onPickerKeyDown
- } })), view = picker.getView();
- if (Ext.isIE9 && Ext.isStrict) {
- view.on({
- scope: me,
- highlightitem: me.repaintPickerView,
- unhighlightitem: me.repaintPickerView,
- afteritemexpand: me.repaintPickerView,
- afteritemcollapse: me.repaintPickerView
- });
- }
- return picker;
- },
- repaintPickerView: function () {
- var style = this.picker.getView().getEl().dom.style;
- style.display = style.display;
- },
- onSelectionChange: function (view, record, node, rowIndex, e) {
- this.selectItem(view, record);
- },
- onPickerKeyDown: function (treeView, record, item, index, e) {
- var key = e.getKey();
- if (key === e.ENTER || (key === e.TAB && this.selectOnTab)) {
- this.selectItem(treeView, record);
- }
- },
- selectItem: function (sender, record) {
- var me = this;
- var ids = [];
- _$2.forEach(me.picker.getSelection(), function (record) {
- ids.push(record.get(me.valueField));
- });
- me.fireEvent('select', me, record);
- me.setValue(ids.join(me.splitChar));
- // me.collapse();
- },
- onExpand: function () {
- var me = this;
- var picker = this.picker;
- var value = this.value;
- if (!me.store) {
- msg('正在初始化数据,请稍后');
- me.collapse();
- return;
- }
- var vs = _$2.split(value, me.splitChar);
- var records = me.store.queryRecordsBy(function (r) { return _$2.findIndex(vs, function (i) { return r.get(me.valueField) === i; }) >= 0; });
- picker.setSelection(records);
- },
- setValue: function (value) {
- var me = this;
- console.log('setValue', value);
- me.value = value;
- if (!me.store || me.store.loading) {
- // Called while the Store is loading. Ensure it is processed by the onLoad method.
- return me.mixins.field.setValue.call(me, value);
- // return me;
- }
- var vs = _$2.split(value, me.splitChar);
- var displayValues = [];
- _$2.forEach(vs, function (v) {
- var _a;
- var record = me.store.queryRecordsBy(function (r) { return r.get(me.valueField) === v; });
- var dv = (_a = record[0]) === null || _a === void 0 ? void 0 : _a.get(me.displayField);
- if (dv) {
- displayValues.push(dv);
- }
- else {
- displayValues.push(v);
- }
- });
- // set the raw value to the record's display field if a record was found
- me.setRawValue(displayValues.join(me.splitChar));
- return me.mixins.field.setValue.call(me, value);
- },
- getSubmitValue: function () {
- return this.value;
- },
- getValue: function () {
- return this.value;
- },
- onLoad: function () {
- var value = this.value;
- if (value) {
- this.setValue(value);
- }
- },
- onUpdate: function (store, rec, type, modifiedFieldNames) {
- var display = this.displayField;
- var me = this;
- if (type === 'edit' && modifiedFieldNames &&
- Ext.Array.contains(modifiedFieldNames, display) &&
- this.value === rec.getId()) {
- me.mixins.field.setValue.call(me, this.value);
- this.setRawValue(rec.get(display));
- }
- }
- });
- }
- //# sourceMappingURL=combogridmulti.js.map
- function initSearch () {
- Ext.define('Yvan.Search', {
- extend: 'Ext.form.field.Text',
- alias: 'widget.searchfield',
- xtype: 'searchfield',
- constructor: function (config) {
- var self = this;
- var newConfig = _$2.defaultsDeep({
- // 强制性属性
- triggers: {
- clear: {
- weight: 0,
- cls: Ext.baseCSSPrefix + 'form-clear-trigger',
- hidden: true,
- handler: 'onClearClick',
- },
- search: {
- weight: 1,
- cls: Ext.baseCSSPrefix + 'form-search-trigger',
- handler: 'onSearchClick'
- },
- },
- listeners: {
- blur: function (sender, e) {
- this.revertOnblur();
- },
- specialkey: function (sender, e) {
- var _a;
- var me = this;
- if (e.getKey() === e.ENTER) {
- me.onSearchClick(sender, {}, e);
- return;
- }
- invokeMethod((_a = config.listeners) === null || _a === void 0 ? void 0 : _a.afterrender, sender, e);
- },
- afterrender: function (sender, e) {
- var _a;
- this.replaceRawInputEvent();
- invokeMethod((_a = config.listeners) === null || _a === void 0 ? void 0 : _a.afterrender, sender, e);
- }
- },
- }, baseConfig(config, 'col-item'), config, search);
- this.superclass.constructor.call(self, newConfig);
- },
- revertOnblur: function () {
- this.setRawValue(this.lastValue);
- },
- onSearchClick: function (sender, vv, e) {
- var me = this;
- var config = me.config;
- var widget = config.widget, vjson = config.vjson, lookup = config.lookup;
- if (e) {
- e.preventDefault();
- e.stopPropagation();
- }
- this.fireEvent('search', sender, e);
- if (!widget) {
- return;
- }
- showWidget(widget, lookup, sender, me.getRawValue(), vjson);
- },
- replaceRawInputEvent: function () {
- var me = this;
- var $dom = $(me.inputEl.dom);
- $dom.on('input', function (e) {
- stopEvent(e);
- // console.log('has input', e)
- });
- $dom.on('keyup', function (e) {
- if (e.key === "Enter") {
- me.onSearchClick(me, {}, e);
- return;
- }
- stopEvent(e);
- });
- $dom.on('change', function (e) {
- stopEvent(e);
- });
- },
- onChange: function (newVal, oldVal) {
- var me = this;
- var value = newVal;
- if (value) {
- me.getTrigger('clear').show();
- me.updateLayout();
- }
- else {
- me.getTrigger('clear').hide();
- me.updateLayout();
- }
- },
- /**
- * 清空所有值
- */
- onClearClick: function (sender, e) {
- var me = this;
- var config = me.config;
- var lookup = config.lookup;
- me.setValue('');
- clearViewModelByLookup(sender, lookup);
- }
- });
- }
- //# sourceMappingURL=search.js.map
- function initMultipleSearch () {
- Ext.define('Yvan.MultipleSearch', {
- extend: 'Ext.form.field.Text',
- xtype: 'multiplesearch',
- bindTargert: '',
- constructor: function (config) {
- var _a, _b, _c, _d;
- var self = this;
- var newConfig = _$2.defaultsDeep({
- // 强制性属性
- triggers: {
- clear: {
- weight: 0,
- cls: Ext.baseCSSPrefix + 'form-clear-trigger',
- hidden: true,
- handler: 'onClearClick',
- }
- },
- transformRawValue: function (o) {
- return o;
- },
- listeners: {
- specialkey: function (sender, e) {
- var me = this;
- if (e.getKey() === e.ENTER) {
- me.fireEvent('search', me, e);
- }
- },
- afterrender: function (sender, e) {
- var _a;
- this.replaceRawInputEvent();
- invokeMethod((_a = config.listeners) === null || _a === void 0 ? void 0 : _a.afterrender, sender, e);
- }
- },
- }, baseConfig(config, 'col-item'), config, search);
- this.superclass.constructor.call(self, newConfig);
- var vv = (_d = (((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.bind) === null || _b === void 0 ? void 0 : _b.value) || ((_c = this.config) === null || _c === void 0 ? void 0 : _c.bind))) !== null && _d !== void 0 ? _d : '';
- vv = _$2.replace(vv, "{", "");
- vv = _$2.replace(vv, "}", "");
- this.bindTargert = vv;
- this.bindTargert = _$2.trim(this.bindTargert);
- },
- setBindValue: function (arrValue) {
- if (this.bindTargert) {
- this.lookupViewModel().yvanScope.viewModel.set(this.bindTargert, arrValue);
- }
- },
- replaceRawInputEvent: function () {
- var me = this;
- var $dom = $(me.inputEl.dom);
- $dom.on('input', function (e) {
- var _a, _b, _c, _d, _e, _f;
- if ((_b = (_a = e.currentTarget) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.endsWith(" ")) {
- var a = _$2.trimEnd((_c = e.currentTarget) === null || _c === void 0 ? void 0 : _c.value);
- if (!a.endsWith(",") && a.length > 0) {
- e.currentTarget.value = a + ",";
- }
- else {
- e.currentTarget.value = a;
- }
- }
- e.currentTarget.value = (_d = e.currentTarget.value) === null || _d === void 0 ? void 0 : _d.replaceAll(",,", ",");
- var arr = (_f = (_e = e.currentTarget) === null || _e === void 0 ? void 0 : _e.value) === null || _f === void 0 ? void 0 : _f.split(",");
- _$2.remove(arr, function (it) {
- return !it;
- });
- me.setBindValue(arr);
- stopEvent(e);
- });
- $dom.on('keyup', function (e) {
- me.fireEvent('keyup', me, e);
- // invokeMethod(me.config.listeners?.keyup, me, e)
- stopEvent(e);
- });
- $dom.on('keydown', function (e) {
- me.fireEvent('keydown', me, e);
- // invokeMethod(me.config.listeners?.keydown, me, e)
- //stopEvent(e)
- });
- $dom.on('change', function (e) {
- stopEvent(e);
- });
- $dom.on('paste', function (e) {
- var _a;
- // @ts-ignore
- var clipdata = e.originalEvent.clipboardData || window.clipboardData;
- var text = clipdata.getData("text/plain");
- var spliter = ',';
- text = text.replaceAll("\r", "");
- text = text.replaceAll("\n", spliter);
- text = ((_a = e.currentTarget) === null || _a === void 0 ? void 0 : _a.value) + "," + text;
- var arr = text.split(spliter);
- if (arr && Array.isArray(arr)) {
- for (var i = 0; i < arr.length; i++) {
- arr[i] = _$2.trim(arr[i]);
- }
- }
- _$2.remove(arr, function (it) {
- return !it;
- });
- me.setBindValue(arr);
- stopEvent(e);
- });
- },
- onChange: function (newVal, oldVal) {
- var me = this;
- var value = newVal;
- if (value) {
- me.getTrigger('clear').show();
- me.updateLayout();
- }
- else {
- me.getTrigger('clear').hide();
- me.updateLayout();
- }
- },
- /**
- * 清空所有值
- */
- onClearClick: function (sender, e) {
- var me = this;
- var config = me.config;
- var lookup = config.lookup;
- me.setValue('');
- clearViewModelByLookup(sender, lookup);
- }
- });
- }
- //# sourceMappingURL=multiplesearch.js.map
- function initDate () {
- var cc = Ext.form.field.Date.prototype.constructor;
- var _a = Ext.form.field.Date.prototype, initComponent = _a.initComponent, getValue = _a.getValue, valueToRaw = _a.valueToRaw;
- Ext.form.field.Date.override({
- format: 'Y-m-d',
- altFormats: 'Y-m-d',
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({
- // 强制属性
- }, baseConfig(config, 'col-item'), config, date);
- cc.call(this, newConfig);
- },
- getValue: function () {
- var ov = getValue.call(this);
- var nv = Ext.util.Format.date(ov, 'Y-m-d');
- // console.log('cc:', nv, ov)
- return nv;
- },
- // focus2() {
- // const that = this
- // if (that.isExpanded) {
- // that.collapse()
- //
- // } else {
- // that.expand();
- // }
- // _.defer(() => {
- // that.focus()
- // })
- // },
- initComponent: function () {
- this.on({
- afterrender: function () {
- var config = this.config;
- // 日期框,不要默认弹出
- // $(this.el.dom).on('click', toggle.bind(this))
- },
- destory: function () {
- // 日期框,不要默认弹出
- // $(this.el.dom).off('click', toggle.bind(this))
- },
- change: {
- fn: function (sender) {
- if (sender.format === 'Y-m-d') {
- // 年月日格式
- var value = sender.getRawValue();
- if (/^\d{8}$/.test(value)) {
- // 8位数字,自动转换为 YYYY-MM-DD
- var newValue = [
- value.substr(0, 4),
- value.substr(4, 2),
- value.substr(6, 2)
- ].join('-');
- sender.setValue(newValue);
- }
- }
- },
- }
- // focus: {
- // // 获得焦点后自动下拉
- // fn(sender) {
- // sender.expand();
- // this.doQuery(this.allQuery, true);
- // },
- // },
- });
- initComponent.call(this);
- },
- createInitialDate: function (value) {
- var minValue = this.minValue, maxValue = this.maxValue;
- value = value || syncDate(new Date());
- if (minValue && minValue > value) {
- value = minValue;
- }
- else if (maxValue && maxValue < value) {
- value = maxValue;
- }
- return value;
- },
- });
- }
- //# sourceMappingURL=datefield.js.map
- function initDateTimePicker () {
- Ext.define('Yvan.DateTimePicker', {
- extend: 'Ext.picker.Date',
- alias: 'datetimepicker',
- alternateClassName: 'Ext.DateTimePicker',
- renderTpl: [
- '<div id="{id}-innerEl" data-ref="innerEl" role="presentation">',
- '<div class="{baseCls}-header">',
- '<div id="{id}-prevEl" data-ref="prevEl" class="{baseCls}-prev {baseCls}-arrow" role="presentation" title="{prevText}"></div>',
- '<div id="{id}-middleBtnEl" data-ref="middleBtnEl" class="{baseCls}-month" role="heading">{%this.renderMonthBtn(values, out)%}</div>',
- '<div id="{id}-nextEl" data-ref="nextEl" class="{baseCls}-next {baseCls}-arrow" role="presentation" title="{nextText}"></div>',
- '</div>',
- '<table role="grid" id="{id}-eventEl" data-ref="eventEl" class="{baseCls}-inner" cellspacing="0" tabindex="0" aria-readonly="true">',
- '<thead>',
- '<tr role="row">',
- '<tpl for="dayNames">',
- '<th role="columnheader" class="{parent.baseCls}-column-header" aria-label="{.}">',
- '<div role="presentation" class="{parent.baseCls}-column-header-inner">{.:this.firstInitial}</div>',
- '</th>',
- '</tpl>',
- '</tr>',
- '</thead>',
- '<tbody>',
- '<tr role="row">',
- '<tpl for="days">',
- '{#:this.isEndOfWeek}',
- '<td role="gridcell">',
- '<div hidefocus="on" class="{parent.baseCls}-date"></div>',
- '</td>',
- '</tpl>',
- '</tr>',
- '</tbody>',
- '</table>',
- '<tpl if="showToday">',
- '<div id="{id}-footerEl" data-ref="footerEl" role="presentation" class="{baseCls}-footer">{%this.renderTodayBtn(values, out)%}</div>',
- '</tpl>',
- // These elements are used with Assistive Technologies such as screen readers
- '<div id="{id}-todayText" class="' + Ext.baseCSSPrefix + 'hidden-clip">{todayText}.</div>',
- '<div id="{id}-ariaMinText" class="' + Ext.baseCSSPrefix + 'hidden-clip">{ariaMinText}.</div>',
- '<div id="{id}-ariaMaxText" class="' + Ext.baseCSSPrefix + 'hidden-clip">{ariaMaxText}.</div>',
- '<div id="{id}-ariaDisabledDaysText" class="' + Ext.baseCSSPrefix + 'hidden-clip">{ariaDisabledDaysText}.</div>',
- '<div id="{id}-ariaDisabledDatesText" class="' + Ext.baseCSSPrefix + 'hidden-clip">{ariaDisabledDatesText}.</div>',
- '</div>',
- {
- firstInitial: function (value) {
- return Ext.picker.Date.prototype.getDayInitial(value);
- },
- isEndOfWeek: function (value) {
- // convert from 1 based index to 0 based
- // by decrementing value once.
- value--;
- // eslint-disable-next-line vars-on-top
- var end = value % 7 === 0 && value !== 0;
- return end ? '</tr><tr role="row">' : '';
- },
- renderTodayBtn: function (values, out) {
- Ext.DomHelper.generateMarkup(values.$comp.todayBtn.getRenderTree(), out);
- },
- renderMonthBtn: function (values, out) {
- Ext.DomHelper.generateMarkup(values.$comp.monthBtn.getRenderTree(), out);
- }
- }
- ],
- beforeRender: function () {
- var me = this, today = Ext.Date.format(syncDate(new Date()), me.format);
- this.superclass.beforeRender.call(this);
- function handleInput(extHandle, $input) {
- var $dom = $(extHandle.el.dom);
- // const $up = $dom.find('.x-form-spinner-up')
- // const $down = $dom.find('.x-form-spinner-down')
- // debugger
- // $up.on('mousedown', () => {
- // debugger
- // });
- // $up.on('click', () => {
- // debugger
- // });
- extHandle.on('click', function (sender) {
- var hideBak = me.hide;
- me.hide = Ext.emptyFn;
- extHandle.focus();
- me.hide = hideBak;
- });
- var changeValue = function (delta) {
- if (_$2.trim(extHandle.getValue()) === '') {
- extHandle.setValue(extHandle.minValue);
- }
- else {
- var v = parseInt('' + extHandle.getValue());
- if (v + delta > extHandle.maxValue) {
- extHandle.setValue(extHandle.minValue);
- }
- else if (v + delta < extHandle.minValue) {
- extHandle.setValue(extHandle.maxValue);
- }
- else {
- extHandle.setValue(v + delta);
- }
- }
- };
- $input.on('mousewheel', function (e) {
- e.stopPropagation();
- var event = e.originalEvent;
- var eventDelta = event.wheelDelta || -event.deltaY + 40;
- // if (event.wheelDelta) {
- // delta = event.wheelDelta / 120;
- // } else if (event.detail) {
- // delta = -event.detail / 3;
- // }
- var zoomSize = Math.ceil(eventDelta / 120);
- changeValue(zoomSize);
- // console.log('delta', delta)
- // $input.focus()
- });
- }
- me.input1 = Ext.create('Ext.form.field.Number', {
- minValue: 0,
- maxValue: 23,
- flex: 1,
- enableKeyEvents: true,
- fieldLabel: '时',
- labelWidth: 20,
- hideLabel: true,
- spinDownEnabled: false,
- spinUpEnabled: false,
- style: {
- marginLeft: '5px',
- },
- listeners: {
- afterrender: function (sender) {
- var $input = $(sender.inputEl.dom);
- handleInput(me.input1, $input);
- },
- change: function (sender, e) {
- if (me.getValue()) {
- me.value.setHours(sender.getValue());
- }
- },
- }
- });
- me.input2 = Ext.create('Ext.form.field.Number', {
- minValue: 0,
- maxValue: 59,
- flex: 1,
- enableKeyEvents: true,
- fieldLabel: ' ',
- hideLabel: false,
- labelWidth: 8,
- spinDownEnabled: false,
- spinUpEnabled: false,
- listeners: {
- afterrender: function (sender) {
- var $input = $(sender.inputEl.dom);
- handleInput(me.input2, $input);
- },
- change: function (sender, e) {
- if (me.getValue()) {
- me.value.setMinutes(sender.getValue());
- }
- },
- }
- });
- me.input3 = Ext.create('Ext.form.field.Number', {
- minValue: 0,
- maxValue: 59,
- flex: 1,
- enableKeyEvents: true,
- fieldLabel: ' ',
- hideLabel: false,
- labelWidth: 8,
- spinDownEnabled: false,
- spinUpEnabled: false,
- style: {
- marginRight: '5px',
- },
- listeners: {
- afterrender: function (sender) {
- var $input = $(sender.inputEl.dom);
- handleInput(me.input3, $input);
- },
- change: function (sender, e) {
- if (me.getValue()) {
- me.value.setSeconds(sender.getValue());
- }
- },
- }
- });
- me.confirmBtn = new Ext.button.Button({
- text: '确认',
- handler: me.confirmClick,
- scope: me
- });
- me.tdBtn = new Ext.button.Button({
- text: '现在',
- handler: me.selectToday,
- scope: me
- });
- me.todayBtn = Ext.create('Ext.container.Container', {
- layout: 'anchor', border: false,
- defaults: {
- border: false, anchor: '100%',
- margin: '0 0 5 0',
- },
- items: [
- {
- layout: 'hbox',
- items: [
- me.input1,
- me.input2,
- me.input3,
- ]
- },
- {
- layout: 'hbox',
- items: [
- me.confirmBtn,
- me.tdBtn,
- ]
- }
- ]
- });
- },
- // finishRenderChildren() {
- // var me = this;
- //
- // this.superclass.finishRenderChildren.call(this);
- // //*
- // me.input1.finishRender();
- // me.input2.finishRender();
- // me.input3.finishRender();
- // //
- // me.tdBtn.finishRender();
- // me.confirmBtn.finishRender();
- // },
- setValue: function (value) {
- //this.value = Ext.Date.clearTime(value, true);
- this.value = value;
- this.input1.setValue(this.value.getHours());
- this.input2.setValue(this.value.getMinutes());
- this.input3.setValue(this.value.getSeconds());
- return this.update(this.value);
- },
- selectDate: function (value) {
- if (this.showTime) {
- value.setHours(this.input1.getValue());
- value.setMinutes(this.input2.getValue());
- value.setSeconds(this.input3.getValue());
- }
- this.value = value;
- return this.update(this.value);
- },
- setDisabledStatus: function (disabled) {
- var me = this;
- debugger;
- // me.callParent();
- if (me.showTime) {
- me.confirmBtn.setDisabled(disabled);
- }
- if (me.isShowFooter()) {
- me.footerContainer.setDisabled(disabled);
- }
- },
- handleDateClick: function (e, t) {
- var me = this, handler = me.handler;
- // e.stopEvent();
- if (!me.disabled && t.dateValue && !Ext.fly(t.parentNode).hasCls(me.disabledCellCls)) {
- me.doCancelFocus = me.focusOnSelect === false;
- me.selectDate(new Date(t.dateValue));
- delete me.doCancelFocus;
- /* 有时间输入时单击事件不退出选择,只移动光标 */
- if (me.showTime) {
- return;
- }
- me.fireEvent('select', me, me.value);
- if (handler) {
- handler.call(me.scope || me, me, me.value);
- }
- me.onSelect();
- }
- },
- selectToday: function () {
- var me = this, btn = me.todayBtn, handler = me.handler;
- if (btn && !btn.disabled) {
- me.value = syncDate(new Date());
- me.update(me.value);
- me.fireEvent('select', me, me.value);
- if (handler) {
- handler.call(me.scope || me, me, me.value);
- }
- me.onSelect();
- me.hide();
- }
- return me;
- },
- confirmClick: function () {
- var me = this, btn = me.confirmBtn, handler = me.handler;
- if (btn && !btn.disabled) {
- me.fireEvent('select', me, me.value);
- if (handler) {
- handler.call(me.scope || me, me, me.value);
- }
- me.onSelect();
- me.hide();
- }
- return me;
- },
- selectedUpdate: function (date) {
- var me = this,
- //t = date.getTime(),
- t = Ext.Date.clearTime(date, true).getTime(), cells = me.cells, cls = me.selectedCls, cellItems = cells.elements, c, cLen = cellItems.length, cell;
- cells.removeCls(cls);
- for (c = 0; c < cLen; c++) {
- cell = Ext.fly(cellItems[c]);
- if (cell.dom.firstChild.dateValue == t) {
- me.fireEvent('highlightitem', me, cell);
- cell.addCls(cls);
- if (me.isVisible() && !me.doCancelFocus) {
- Ext.fly(cell.dom.firstChild).focus(50);
- }
- break;
- }
- }
- },
- // private, inherit docs
- beforeDestroy: function () {
- var me = this;
- if (me.rendered) {
- Ext.destroy(me.input1, me.input2, me.input3, me.confirmBtn, me.tdBtn, me.todayBtn);
- }
- me.superclass.beforeDestroy.call(this);
- }
- });
- }
- //# sourceMappingURL=datetimepicker.js.map
- function initDateTime () {
- Ext.define('Yvan.DateTimeField', {
- extend: 'Ext.form.field.Date',
- xtype: 'datetimefield',
- alternateClassName: ['Ext.form.DateTimeField', 'Ext.form.DateTime'],
- triggerCls: Ext.baseCSSPrefix + 'form-arrow-trigger',
- showTime: true,
- format: "Y-m-d H:i:s",
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({
- // 强制属性
- }, baseConfig(config, 'col-item'), config, date);
- this.superclass.constructor.call(this, newConfig);
- },
- initComponent: function () {
- this.superclass.initComponent.call(this);
- var setInitValue = function () {
- var value = this.getRawValue();
- if (!value) {
- // 没填内容的时候,自动设置当前时间
- this.setValue(Ext.util.Format.date(syncDate(new Date()), this.format));
- }
- };
- this.on({
- afterrender: function () {
- var config = this.config;
- // 日期框,不要默认弹出
- $(this.el.dom).on('click', setInitValue.bind(this));
- },
- destory: function () {
- // 日期框,不要默认弹出
- $(this.el.dom).off('click', setInitValue.bind(this));
- },
- change: {
- fn: function (sender) {
- if (sender.format === "Y-m-d H:i:s") {
- // 年月日格式
- var value = sender.getRawValue();
- if (/^\d{14}$/.test(value)) {
- // 8位数字,自动转换为 YYYY-MM-DD
- var newValue = [
- value.substr(0, 4),
- '-',
- value.substr(4, 2),
- '-',
- value.substr(6, 2),
- ' ',
- value.substr(8, 2),
- ':',
- value.substr(10, 2),
- ':',
- value.substr(12, 2)
- ].join('');
- sender.setValue(newValue);
- }
- }
- },
- }
- });
- },
- getValue: function () {
- var ov = this.getRawValue(); //this.superclass.getValue.call(this)
- var nv = Ext.util.Format.date(ov, 'Y-m-d H:i:s');
- // console.log('cc:', nv, ov)
- return nv;
- },
- onExpand: function () {
- var strValue = this.getValue();
- var value;
- if (/^\d\d\d\d-\d\d-\d\d\s\d\d:\d\d:\d\d$/.test(strValue)) {
- value = new Date(parseInt(strValue.substr(0, 4)), parseInt(strValue.substr(5, 2)) - 1, parseInt(strValue.substr(8, 2)), parseInt(strValue.substr(11, 2)), parseInt(strValue.substr(14, 2)), parseInt(strValue.substr(17, 2)));
- }
- else if (/^\d\d\d\d-\d\d-\d\d$/.test(strValue)) {
- value = new Date(parseInt(strValue.substr(0, 4)), parseInt(strValue.substr(5, 2)) - 1, parseInt(strValue.substr(8, 2)));
- }
- else {
- value = syncDate(new Date());
- }
- this.picker.setValue(value);
- },
- createPicker: function () {
- var me = this, format = Ext.String.format;
- //@ts-ignore
- return new Yvan.DateTimePicker({
- pickerField: me,
- ownerCt: me.ownerCt,
- renderTo: document.body,
- floating: true,
- hidden: true,
- focusOnShow: true,
- minDate: me.minValue,
- maxDate: me.maxValue,
- disabledDatesRE: me.disabledDatesRE,
- disabledDatesText: me.disabledDatesText,
- disabledDays: me.disabledDays,
- disabledDaysText: me.disabledDaysText,
- format: me.format,
- showToday: me.showToday,
- showTime: me.showTime,
- startDay: me.startDay,
- minText: format(me.minText, me.formatDate(me.minValue)),
- maxText: format(me.maxText, me.formatDate(me.maxValue)),
- listeners: {
- scope: me,
- select: me.onSelect
- },
- keyNavConfig: {
- esc: function () {
- me.collapse();
- }
- }
- });
- },
- });
- }
- //# sourceMappingURL=datetimefield.js.map
- function initNumber () {
- var cc = Ext.form.field.Number.prototype.constructor;
- var initComponent = Ext.form.field.Number.prototype.initComponent;
- Ext.form.field.Number.override({
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({
- // 强制属性
- }, baseConfig(config, 'col-item'), config, numberfield);
- cc.call(this, newConfig);
- },
- initComponent: function () {
- this.on({
- afterrender: function (sender) {
- var _this = this;
- var _a;
- if ((_a = sender.inputEl) === null || _a === void 0 ? void 0 : _a.dom) {
- sender.inputEl.dom.setAttribute('spellcheck', "false");
- $$2(sender.inputEl.dom).on('click', function (e) {
- sender.fireEvent('click', _this, e);
- });
- }
- }
- });
- initComponent.call(this);
- },
- });
- }
- //# sourceMappingURL=numberfield.js.map
- function initCheckbox () {
- var cc = Ext.form.field.Checkbox.prototype.constructor;
- var _a = Ext.form.field.Checkbox.prototype, initComponent = _a.initComponent, getValue = _a.getValue, setValue = _a.setValue;
- Ext.form.field.Checkbox.override({
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({
- // 强制属性
- }, baseConfig(config, 'col-item'), config, checkbox);
- cc.call(this, newConfig);
- },
- getValue: function () {
- var _a = this, checkedValue = _a.checkedValue, uncheckedValue = _a.uncheckedValue;
- var ov = getValue.call(this);
- // const ov = this.getRawValue()
- return (ov ? checkedValue : uncheckedValue);
- },
- setValue: function (nv) {
- var _a = this, checkedValue = _a.checkedValue, uncheckedValue = _a.uncheckedValue;
- var value;
- if (nv === checkedValue) {
- value = true;
- }
- else if (nv === uncheckedValue) {
- value = false;
- }
- else {
- value = !!nv;
- }
- // me.setRawValue(value)
- // me.checked = value
- // return me.mixins.field.setValue.call(me, value);
- setValue.call(this, value);
- },
- updateCheckedCls: function (checked) {
- var me = this;
- var _a = this, uncheckedValue = _a.uncheckedValue, checkedValue = _a.checkedValue;
- checked = checked != null ? checked : me.getValue();
- if (checked === uncheckedValue) {
- checked = false;
- }
- else if (checked === checkedValue) {
- checked = true;
- }
- me[checked ? 'addCls' : 'removeCls'](me.checkedCls);
- },
- initComponent: function () {
- initComponent.call(this);
- },
- });
- }
- //# sourceMappingURL=checkbox.js.map
- function initCheckboxGroup () {
- var cc = Ext.form.CheckboxGroup.prototype.constructor;
- var initComponent = Ext.form.CheckboxGroup.prototype.initComponent;
- Ext.form.CheckboxGroup.override({
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({
- // 强制属性
- }, baseConfig(config, 'col-item'), config, checkboxgroup);
- cc.call(this, newConfig);
- },
- initComponent: function () {
- initComponent.call(this);
- },
- });
- }
- //# sourceMappingURL=checkboxgroup.js.map
- function initRadio () {
- var cc = Ext.form.field.Radio.prototype.constructor;
- var initComponent = Ext.form.field.Radio.prototype.initComponent;
- Ext.form.field.Radio.override({
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({
- // 强制属性
- }, baseConfig(config, 'col-item'), config, radio);
- cc.call(this, newConfig);
- },
- initComponent: function () {
- initComponent.call(this);
- },
- });
- }
- //# sourceMappingURL=radio.js.map
- function initRadioGroup () {
- var cc = Ext.form.RadioGroup.prototype.constructor;
- var initComponent = Ext.form.RadioGroup.prototype.initComponent;
- Ext.form.RadioGroup.override({
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({
- // 强制属性
- }, baseConfig(config, 'col-item'), config, radiogroup);
- cc.call(this, newConfig);
- },
- initComponent: function () {
- initComponent.call(this);
- },
- });
- }
- //# sourceMappingURL=radiogroup.js.map
- function initFieldset () {
- /**
- *
- */
- var ct = Ext.form.FieldSet.prototype.constructor;
- Ext.form.FieldSet.override({
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({}, config, baseConfig(config, "rows-container"), fieldSet);
- ct.call(this, newConfig);
- }
- });
- }
- //# sourceMappingURL=fieldset.js.map
- function initCombotree () {
- Ext.define('Yvan.ComboTree', {
- extend: 'Ext.form.field.Picker',
- xtype: 'combotree',
- triggerCls: Ext.baseCSSPrefix + 'form-arrow-trigger',
- config: {
- store: null,
- displayField: null,
- columns: null,
- selectOnTab: true,
- maxPickerHeight: 300,
- minPickerHeight: 100,
- minPickerWidth: 350,
- rootVisible: true,
- },
- editable: false,
- setStore: function (store) {
- this.store = store;
- var me = this;
- if (me.store) {
- if (me.picker) {
- me.picker.setStore(store);
- if (me.isExpanded) {
- me.collapse();
- delete me.picker;
- me.expand();
- }
- }
- this.onLoad();
- me.mon(me.store, {
- scope: me,
- load: me.onLoad,
- update: me.onUpdate
- });
- }
- },
- createPicker: function () {
- var me = this;
- var picker = new Ext.tree.Panel({
- border: false,
- baseCls: Ext.baseCSSPrefix + 'boundlist',
- shrinkWrapDock: 2,
- store: me.store,
- floating: true,
- rootVisible: me.rootVisible,
- displayField: me.displayField,
- columns: me.columns,
- minHeight: me.minPickerHeight,
- maxHeight: me.maxPickerHeight,
- minWidth: me.minPickerWidth,
- manageHeight: false,
- shadow: false,
- scrollable: true,
- // modal: true,
- // constrain: true,
- // constrainTo: topScope._handle.el.dom,
- // renderTo: topScope._handle.el.dom,
- // alignTarget: topScope._handle,
- listeners: {
- scope: me,
- itemclick: me.onItemClick,
- itemkeydown: me.onPickerKeyDown
- }
- }), view = picker.getView();
- if (Ext.isIE9 && Ext.isStrict) {
- view.on({
- scope: me,
- highlightitem: me.repaintPickerView,
- unhighlightitem: me.repaintPickerView,
- afteritemexpand: me.repaintPickerView,
- afteritemcollapse: me.repaintPickerView
- });
- }
- return picker;
- },
- repaintPickerView: function () {
- var style = this.picker.getView().getEl().dom.style;
- style.display = style.display;
- },
- onItemClick: function (view, record, node, rowIndex, e) {
- this.selectItem(view, record);
- },
- onPickerKeyDown: function (treeView, record, item, index, e) {
- var key = e.getKey();
- if (key === e.ENTER || (key === e.TAB && this.selectOnTab)) {
- this.selectItem(treeView, record);
- }
- },
- selectItem: function (sender, record) {
- var me = this;
- me.setValue(record.getId());
- me.fireEvent('select', me, record);
- me.collapse();
- },
- onExpand: function () {
- var picker = this.picker;
- var store = picker.store;
- var value = this.value;
- var node;
- if (value) {
- node = store.getNodeById(value);
- }
- if (!node) {
- node = store.getRoot();
- }
- picker.ensureVisible(node, {
- select: true,
- focus: true
- });
- },
- setValue: function (value) {
- var me = this;
- console.log('setValue', value);
- me.value = value;
- if (!me.store || me.store.loading) {
- // Called while the Store is loading. Ensure it is processed by the onLoad method.
- return me.mixins.field.setValue.call(me, value);
- // return me;
- }
- var record = value ? me.store.getNodeById(value) : me.store.getRoot();
- if (value === undefined) {
- record = me.store.getRoot();
- console.log('setValue', record.getId());
- me.value = record.getId();
- return me.mixins.field.setValue.call(me, value);
- }
- else {
- record = me.store.getNodeById(value);
- }
- // set the raw value to the record's display field if a record was found
- me.setRawValue(record ? record.get(me.displayField) : '');
- return me.mixins.field.setValue.call(me, value);
- },
- getSubmitValue: function () {
- return this.value;
- },
- getValue: function () {
- return this.value;
- },
- onLoad: function () {
- var value = this.value;
- if (value) {
- this.setValue(value);
- }
- },
- onUpdate: function (store, rec, type, modifiedFieldNames) {
- var display = this.displayField;
- var me = this;
- if (type === 'edit' && modifiedFieldNames &&
- Ext.Array.contains(modifiedFieldNames, display) &&
- this.value === rec.getId()) {
- me.mixins.field.setValue.call(me, this.value);
- this.setRawValue(rec.get(display));
- }
- }
- });
- }
- //# sourceMappingURL=combotree.js.map
- function initPickerPlus () {
- Ext.define('Yvan.PickerAlignCenter', {
- extend: 'Ext.form.field.Picker',
- /**
- * Performs the alignment on the picker using the class defaults
- * @private
- */
- doAlign: function () {
- // 不要挪动就好
- },
- });
- }
- //# sourceMappingURL=pickerplus.js.map
- function initCombogrid () {
- Ext.define('Yvan.ComboGrid', {
- extend: 'Ext.form.field.Picker',
- // extend: 'Yvan.PickerAlignCenter',
- xtype: 'combogrid',
- triggerCls: Ext.baseCSSPrefix + 'form-search-trigger',
- triggers: {
- clear: {
- weight: 0,
- cls: Ext.baseCSSPrefix + 'form-clear-trigger',
- hidden: true,
- handler: 'onClearClick',
- },
- },
- config: __assign({}, comboGrid),
- editable: true,
- _superBlur: false,
- allowCustomInput: false,
- pressEnterPopup: true,
- initComponent: function () {
- var that = this;
- var scope = lookupScope(that);
- var config = that.config;
- if (isDesignMode(scope, config)) {
- this.superclass.initComponent.call(this, arguments);
- return;
- }
- this.on({
- blur: function (sender, e) {
- if (this._superBlur) {
- // 挂起时不恢复内容
- return;
- }
- // 离开焦点时,恢复原来的值
- sender.setRawValue(sender.value);
- },
- afterrender: function (sender) {
- var $dom = $(sender.inputEl.dom);
- that.scope = lookupScope(sender);
- if (sender.column) {
- // 列模式,拦截 keydown
- $dom.on('keydown', function (e) {
- if (isChartEvent(e) && !that.tryEnable()) {
- // 没有达成 editEnable 条件,不用响应
- stopEvent(e);
- return;
- }
- if (that.pressEnterPopup !== false && e.key === 'Enter') {
- stopEvent(e);
- that.onTriggerClick(that, that.getPickerTrigger(), e);
- return;
- }
- });
- }
- else {
- // 常规模式,拦截 keyup
- $dom.on('keyup', function (e) {
- if (e.key === 'Escape' || e.key === 'ArrowRight' || e.key === 'ArrowLeft') {
- return;
- }
- if (isChartEvent(e) && !that.tryEnable()) {
- // 没有达成 editEnable 条件,不用响应
- stopEvent(e);
- return;
- }
- if (that.pressEnterPopup !== false && e.key === 'Enter') {
- stopEvent(e);
- that.onTriggerClick(that, that.getPickerTrigger(), e);
- return;
- }
- if (!that.allowCustomInput) {
- // 取消 keyup 事件,让 ext 不要吧当前输入的值记录到 value 中
- stopEvent(e);
- }
- });
- $dom.on('change', function (e) {
- // 这里注释掉,是因为 当鼠标点击触发弹出后,会导致取"e.target.value"值无效
- // if (that.isExpanded) {
- // that.filterChange(that, e.target.value)
- // }
- stopEvent(e);
- });
- }
- $dom.on('input', function (e) {
- stopEvent(e);
- });
- },
- });
- this.superclass.initComponent.apply(this, arguments);
- },
- createPicker: function () {
- var me = this;
- var cfg = {
- layout: 'fit',
- border: 0,
- // border: 5,
- style: {
- // borderColor: 'black',
- // borderWidth: '5px',
- // borderStyle: 'solid',
- boxShadow: '0px 2px 5px rgba(0,0,0,.5)'
- },
- shadow: 'side',
- shadowOffset: 100,
- baseCls: Ext.baseCSSPrefix + 'boundlist',
- shrinkWrapDock: 2,
- floating: true,
- width: me.pickerWidth,
- height: me.pickerHeight,
- minWidth: me.pickerWidth,
- minHeight: me.pickerHeight,
- maxWidth: me.pickerWidth,
- maxHeight: me.pickerHeight,
- items: [
- __assign(__assign(__assign({}, comboGridPicker), me.grid), { tbar: {
- xtype: 'toolbar',
- items: [
- { xtype: 'textfield', fieldLabel: '筛选' },
- {
- xtype: 'button',
- text: '查询',
- iconCls: 'x-fa fa-search',
- cssType: 'primary',
- listeners: {
- click: function () {
- me.reloadGrid();
- }
- }
- },
- ]
- }, autoLoad: false, listeners: {
- afterrender: function (grid) {
- me.grid = grid;
- grid.focus();
- grid.on({
- rowdblclick: function (sender, row) {
- me.selectItem(row);
- },
- dataLoadComplete: function (sender) {
- _$2.defer(function () {
- me.setFocus();
- });
- },
- keydown: function (sender, e) {
- if (me.column) {
- // 列模式,拦截 keydown
- me.processKey(e);
- }
- },
- keyup: function (sender, e) {
- if (!me.column) {
- // 常规模式,拦截 keyup
- me.processKey(e);
- }
- }
- });
- },
- } })
- ]
- };
- // @ts-ignore
- var picker = new Ext.container.Container(cfg);
- return picker;
- },
- setFocus: function () {
- if (this.grid.store.getCount() > 0) {
- this.grid.focusRow(0);
- }
- },
- processKey: function (e) {
- if (this.pressEnterPopup !== false && e.key === 'Enter') {
- this.selectItem(this.grid.selection);
- stopEvent(e);
- }
- else if (e.key === 'Escape') {
- this.collapse();
- }
- },
- repaintPickerView: function () {
- var style = this.picker.getView().getEl().dom.style;
- style.display = style.display;
- },
- onItemClick: function (view, record, node, rowIndex, e) {
- this.selectItem(record);
- },
- onPickerKeyDown: function (treeView, record, item, index, e) {
- var key = e.getKey();
- if ((this.pressEnterPopup !== false && key === e.ENTER) || (key === e.TAB && this.selectOnTab)) {
- this.selectItem(record);
- }
- },
- filterChange: _$2.debounce(function (sender, value) {
- sender.onExpand();
- }, 1000),
- selectItem: function (record) {
- var me = this;
- var lookup = this.lookup;
- var scope = lookupScope(this);
- me.fireEvent('select', me, record);
- if (record.isModel) {
- record = record.data;
- }
- tryWriteObject(lookup, record, function (path, value) {
- me._lookupSet(path, value);
- });
- // lookup
- // fromColumn: 'toTarget'
- // fromColumn: 'toTarget'
- // fromColumn: 'toTarget'
- _$2.forOwn(lookup, function (toTarget, fromColumn) {
- var value = _$2.get(record, fromColumn);
- me._lookupSet(toTarget, value);
- });
- // 选定之后不能做清空
- // const {lookupClearOnChange} = me
- // if (_.isArray(lookupClearOnChange)) {
- // _.each(lookupClearOnChange, item => {
- // me._lookupSet(item, '')
- // })
- // }
- me.collapse();
- // 触发 _raiseNextFocus
- me._raiseNextFocus(me);
- },
- onExpand: function () {
- // 展开时,根据 lookup 带入查询参数
- var expressData = this.getExpressData();
- var txtField = this.grid.down('toolbar').down('textfield');
- txtField.setValue(expressData.queryValue);
- this.reloadGrid();
- },
- reloadGrid: function () {
- // 展开时,根据 lookup 带入查询参数
- var expressData = this.getExpressData();
- var reloadParam = calcObjectFlat(expressData, this.param) || {};
- var txtField = this.grid.down('toolbar').down('textfield');
- // 每个 combogrid 默认带上 __queryValue 属性
- reloadParam["__queryValue"] = txtField.getValue();
- this.grid.reload(reloadParam);
- },
- onTriggerClick: function (sender) {
- var _a = this, isExpanded = _a.isExpanded, readOnly = _a.readOnly, disabled = _a.disabled, grid = _a.grid;
- if (!grid) {
- msg('正在初始化,请稍后');
- return;
- }
- if (!this.tryEnable()) {
- // 没有达成 editEnable 条件,不用弹出
- return;
- }
- if (isExpanded || readOnly || disabled) {
- // 已弹出、只读、禁用状态下,不允许弹出
- return;
- }
- this._superBlur = true;
- this.superclass.onTriggerClick.apply(this, arguments);
- this._superBlur = false;
- },
- onCollapse: function () {
- // 每次收回时,删除下拉组件
- // delete this.picker
- },
- /**
- * 本方法只会从 API 或外部调用,键盘输入的内容不会记录在内
- */
- setValue: function (value) {
- var me = this;
- // 设值用户看到的表面内容
- this.setRawValue(value);
- // 设值 setValue 调用链,正常触发 change 事件等
- return me.mixins.field.setValue.call(me, value);
- },
- _lookupSet: function (path, value) {
- var me = this;
- path = tryVarSimple(path);
- if (me.column) {
- // 判断写入目标,是否与自己绑定的属性相等
- if (path === 'queryValue' || me.column.dataIndex === path) {
- me.setValue(value);
- }
- // 列模式下,写当前编辑行
- var parentRecord = me._lookupEditorRecord();
- if (parentRecord) {
- // Ext.data.Record / Ext.data.Model
- parentRecord.set(path, value);
- }
- else {
- debugger;
- }
- }
- else {
- // 常规模式下,写 viewModel
- me.scope.viewModel.set(path, value);
- }
- },
- _lookupGrid: function () {
- return this.column.up('grid');
- },
- _lookupEditorRecord: function () {
- var _a, _b, _c, _d;
- // parentGrid.getSelectionModel().getLastSelected()
- var grid = this._lookupGrid();
- var editingPlugin = (_a = grid.editingPlugin) !== null && _a !== void 0 ? _a : (_b = grid.ownerGrid) === null || _b === void 0 ? void 0 : _b.editingPlugin;
- if (!editingPlugin) {
- return grid.getSelectionModel().getLastSelected();
- }
- var rowIdx = (_d = (_c = editingPlugin.activeEditor) === null || _c === void 0 ? void 0 : _c.context) === null || _d === void 0 ? void 0 : _d.rowIdx;
- if (_$2.isNumber(rowIdx)) {
- return grid.store.getAt(rowIdx);
- }
- else {
- return grid.getSelectionModel().getLastSelected();
- }
- },
- onChange: function (newVal, oldVal) {
- var me = this;
- var value = newVal;
- var hideTrigger = me.hideTrigger, disabled = me.disabled, readOnly = me.readOnly, hideClear = me.hideClear;
- if (hideTrigger || disabled || readOnly || hideClear) {
- // 禁用、隐藏、只读、隐藏清空状态下,不需要显示清空按钮
- return;
- }
- if (value) {
- me.getTrigger('clear').show();
- me.updateLayout();
- }
- else {
- me.getTrigger('clear').hide();
- me.updateLayout();
- }
- },
- /**
- * 得到能用于 express 表达式计算的上下文数据
- */
- getExpressData: function () {
- var queryValue = this.getRawValue();
- if (!queryValue) {
- // 父 combogrid 输入的内容为空的情况下,看看弹出框内部的输入框
- queryValue = this.getPicker().down('textfield').getRawValue();
- }
- if (this.column) {
- // 列模式, 准备好判断 editEnable 表达式用的数据
- var parentRecord = this._lookupEditorRecord();
- if (!parentRecord) {
- debugger;
- }
- return __assign(__assign(__assign({}, this.scope.viewModel.data), parentRecord.data), { queryValue: queryValue });
- }
- else {
- // 编辑模式,准备好判断用的数据
- return __assign(__assign({}, this.scope.viewModel.data), { queryValue: queryValue });
- }
- },
- tryEnable: function () {
- return tryEnable(this.getExpressData(), this.editEnable);
- },
- /**
- * 清空所有值
- */
- onClearClick: function (sender, e) {
- var me = this;
- var lookup = me.lookup, lookupClearOnChange = me.lookupClearOnChange;
- me.fireEvent('clear', sender, e);
- me.setValue('');
- _$2.forOwn(lookup, function (toTarget, fromColumn) {
- me._lookupSet(toTarget, '');
- });
- _$2.each(lookupClearOnChange, function (item) {
- me._lookupSet(item, '');
- });
- }
- });
- }
- //# sourceMappingURL=combogrid.js.map
- function initContainer () {
- var cc = Ext.container.Container.prototype.constructor;
- //const {initComponent} = Ext.container.Container.prototype
- Ext.container.Container.override({
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({}, baseConfig(config, 'col-item'), config);
- cc.call(this, newConfig);
- },
- });
- }
- //# sourceMappingURL=container.js.map
- function initRows () {
- Ext.define('Yvan.Rows', {
- extend: 'Ext.container.Container',
- xtype: 'rows',
- constructor: function (config) {
- var self = this;
- var newConfig = _$2.defaultsDeep({
- // 强制性属性
- layout: 'anchor', border: false,
- defaults: {
- border: false, anchor: '100%',
- margin: '0 0 5 0',
- },
- }, baseConfig(config, 'rows-container'), config, rows);
- this.superclass.constructor.call(self, newConfig);
- },
- });
- }
- //# sourceMappingURL=rows.js.map
- function initForm () {
- var ct = Ext.form.Panel.prototype.constructor;
- Ext.form.Panel.override({
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({}, config, baseConfig(config, "cols-container"), form);
- ct.call(this, newConfig);
- }
- });
- }
- //# sourceMappingURL=form.js.map
- function initCols () {
- Ext.define('Yvan.Cols', {
- extend: 'Ext.container.Container',
- xtype: 'cols',
- constructor: function (config) {
- var self = this;
- var newConfig = _$2.defaultsDeep({
- // 强制性属性
- layout: 'hbox',
- minHeight: config.designMode ? 32 : 0
- }, baseConfig(config, 'cols-container'), config, cols);
- this.superclass.constructor.call(self, newConfig);
- },
- });
- }
- //# sourceMappingURL=cols.js.map
- function initButton () {
- /**
- *
- */
- var ct = Ext.button.Button.prototype.constructor;
- Ext.button.Button.override({
- constructor: function (config) {
- var newConfig = _$2.defaultsDeep({}, config, baseConfig(config, "col-item"), button);
- ct.call(this, newConfig);
- },
- setLoading: function (value) {
- if (value) {
- if (this.iconCls !== 'x-fa fa-spinner fa-spin fa-fw') {
- this._originIconCls = this.iconCls;
- }
- this.setIconCls('x-fa fa-spinner fa-spin fa-fw');
- this.setDisabled(true);
- }
- else {
- this.setIconCls(this._originIconCls);
- this.setDisabled(false);
- }
- }
- });
- }
- //# sourceMappingURL=button.js.map
- function initIframe () {
- Ext.define('Ext.ux.IFrame', {
- extend: 'Ext.Component',
- alias: 'widget.uxiframe',
- loadMask: 'Loading...',
- src: 'about:blank',
- renderTpl: [
- '<iframe src="{src}" id="{id}-iframeEl" data-ref="iframeEl" name="{frameName}" width="100%" height="100%" frameborder="0"></iframe>'
- ],
- childEls: ['iframeEl'],
- initComponent: function () {
- this.superclass.initComponent.call(this);
- this.superclass.initEvents.call(this);
- this.frameName = this.frameName || this.id + '-frame';
- },
- initEvents: function () {
- var me = this;
- this.superclass.initEvents.call(this);
- me.iframeEl.on('load', me.onLoad, me);
- },
- initRenderData: function () {
- return Ext.apply(this.superclass.initRenderData.call(this), {
- src: this.src,
- frameName: this.frameName
- });
- },
- getBody: function () {
- var doc = this.getDoc();
- return doc.body || doc.documentElement;
- },
- getDoc: function () {
- try {
- return this.getWin().document;
- }
- catch (ex) {
- return null;
- }
- },
- getWin: function () {
- var me = this, name = me.frameName, win = Ext.isIE ? me.iframeEl.dom.contentWindow : window.frames[name];
- return win;
- },
- getFrame: function () {
- var me = this;
- return me.iframeEl.dom;
- },
- onLoad: function () {
- var me = this, doc = me.getDoc();
- if (doc) {
- this.el.unmask();
- this.fireEvent('load', this);
- }
- else if (me.src) {
- this.el.unmask();
- this.fireEvent('error', this);
- }
- },
- load: function (src) {
- var me = this, text = me.loadMask, frame = me.getFrame();
- if (me.fireEvent('beforeload', me, src) !== false) {
- if (text && me.el) {
- me.el.mask(text);
- }
- frame.src = me.src = (src || me.src);
- }
- }
- });
- }
- //# sourceMappingURL=iframe.js.map
- /**
- * 属性:
- * - autoLoad: true
- * - dataSource: ''
- * 方法:
- * - handleZoomBig
- * - handleZoomSmall
- * - handleZoomReset
- * - openDiagram
- * - getBpmn
- * - getBpmnCanvas
- * - getBpmnOverlays
- * - getBpmnZoomScroll
- * 事件:
- * - initFinish
- * - failed
- * - success
- * - itemHover
- * - itemOut
- * - itemClick
- * - itemDblclick
- * - itemMousedown
- * - itemMouseup
- */
- function initBpmn () {
- Ext.define('Yvan.Bpmn', {
- // extend: 'Ext.container.Container',
- extend: 'Ext.panel.Panel',
- alias: 'widget.bpmn',
- xtype: 'bpmn',
- constructor: function (config) {
- var self = this;
- var newConfig = _$2.defaultsDeep({
- // 强制性属性
- }, baseConfig(config, 'row-item'), config, bpmn);
- if (!newConfig.hideToolbar) {
- newConfig.tbar = [];
- newConfig.tbar.push({
- xtype: 'button', iconCls: 'x-fa fa-refresh', tooltip: '刷新',
- listeners: {
- click: function (sender) {
- self.reload();
- }
- }
- });
- newConfig.tbar.push({
- xtype: 'button', tooltip: "放大", iconCls: "x-fa fa-search-plus",
- listeners: {
- click: function (sender) {
- self.handleZoomBig();
- }
- },
- });
- newConfig.tbar.push({
- xtype: 'button', tooltip: "缩小", iconCls: "x-fa fa-search-minus",
- listeners: {
- click: function (sender) {
- self.handleZoomSmall();
- }
- },
- });
- newConfig.tbar.push({
- xtype: 'button', tooltip: "还原", iconCls: "x-fa fa-reply",
- listeners: {
- click: function (sender) {
- self.handleZoomReset();
- }
- },
- });
- }
- this.superclass.constructor.call(self, newConfig);
- },
- initComponent: function () {
- var _this = this;
- var me = this;
- var config = me.config;
- var scope = lookupScope(this);
- if (!isDesignMode(scope, config)) {
- //@ts-ignore
- require(['bpmn-modeler', 'bpmn-navigated', 'bpmn-viewer'], function (BpModeler, BpNavigated, BpmnViewer) {
- console.log('BpNavigated', me, BpNavigated);
- var dom = me.el.dom;
- var $dom = $(dom);
- var $container = $dom.find('.x-autocontainer-innerCt');
- var bpmn = new BpNavigated(__assign({ container: $container[0] }, config.bpmnConfig));
- _this._bpmn = bpmn;
- if (_this.autoLoad) {
- _this.reload();
- }
- _this.fireEvent('initFinish', _this);
- var eventBus = bpmn.get('eventBus');
- eventBus.on('element.hover', function (e) {
- // this.fireEvent('itemHover', this, e);
- });
- eventBus.on('element.out', function (e) {
- _this.fireEvent('itemOut', _this, e);
- });
- eventBus.on('element.click', function (e) {
- _this.fireEvent('itemClick', _this, e);
- });
- eventBus.on('element.dblclick', function (e) {
- _this.fireEvent('itemDblclick', _this, e);
- });
- eventBus.on('element.mousedown', function (e) {
- _this.fireEvent('itemMousedown', _this, e);
- });
- eventBus.on('element.mouseup', function (e) {
- _this.fireEvent('itemMouseup', _this, e);
- });
- });
- }
- this.superclass.initComponent.call(this);
- this.on({
- afterrender: function (sender) {
- }
- });
- },
- /**
- * 重新载入
- */
- reload: function () {
- var _this = this;
- var _a;
- if (typeof this.dataSource === 'string' && this.dataSource) {
- var scope = lookupScope(this);
- var fn = lookupFn(scope, this.dataSource);
- (_a = fn.call(scope, this)) === null || _a === void 0 ? void 0 : _a.then(function (res) {
- _this.openDiagram(res.data);
- });
- }
- },
- /**
- * 获取bpmn
- */
- getBpmn: function () {
- return this._bpmn;
- },
- getBpmnCanvas: function () {
- var _a;
- return (_a = this.getBpmn()) === null || _a === void 0 ? void 0 : _a.get('canvas');
- },
- getBpmnOverlays: function () {
- var _a;
- return (_a = this.getBpmn()) === null || _a === void 0 ? void 0 : _a.get('overlays');
- },
- getBpmnZoomScroll: function () {
- var _a;
- return (_a = this.getBpmn()) === null || _a === void 0 ? void 0 : _a.get('zoomScroll');
- },
- handleZoomBig: function () {
- var _a;
- (_a = this.getBpmnZoomScroll()) === null || _a === void 0 ? void 0 : _a.stepZoom(1);
- },
- handleZoomSmall: function () {
- var _a;
- (_a = this.getBpmnZoomScroll()) === null || _a === void 0 ? void 0 : _a.stepZoom(-1);
- },
- handleZoomReset: function () {
- var _a;
- (_a = this.getBpmnZoomScroll()) === null || _a === void 0 ? void 0 : _a.reset();
- },
- openDiagram: function (diagram) {
- var _this = this;
- if (!this.getBpmn()) {
- return;
- }
- this.getBpmn().importXML(diagram, function (err) {
- if (err) {
- // YvEventDispatch(this.onFailed, this, undefined);
- _this.fireEvent('failed', _this, err);
- return console.error('could not import BPMN 2.0 diagram', err);
- }
- // zoom to fit full viewport
- _this.getBpmnCanvas().zoom('fit-viewport');
- _this.fireEvent('success', _this);
- });
- },
- });
- }
- //# sourceMappingURL=bpmn.js.map
- function initSqlComplex () {
- Ext.define('Yvan.SqlComplex', {
- extend: 'Ext.panel.Panel',
- xtype: 'sqlcomplex',
- alias: 'widget.sqlcomplex',
- getSqlExpress: function () {
- },
- constructor: function (config) {
- var reference = config.reference;
- var me = this;
- var newConfig = __assign(__assign({}, config), { layout: 'border', items: [
- {
- region: 'west',
- width: 280,
- border: false,
- split: true,
- reference: reference + '_tree',
- xtype: 'yvtree',
- hideRefresh: true,
- hideExpand: true,
- hideCollapse: true,
- listeners: {
- itemdblclick: function (sender, record, item, index, e) {
- var field = record.get('field');
- var defaultValue = record.get('defaultValue');
- if (!field) {
- return;
- }
- var tabExpress = me.down('tabpanel');
- var sqleditor = me.down('sqleditor');
- var expressGrid = me.down('yvgrid');
- if (tabExpress.getActiveTab().key !== 'grid') {
- // SQL 模式
- sqleditor.insertText(field + '=');
- }
- else {
- // 表格模式
- expressGrid.appendEditRow({
- field: field,
- operator: '=',
- value: defaultValue,
- remark: '',
- });
- _$2.defer(function () {
- gridChanged(me, expressGrid);
- });
- }
- }
- },
- },
- {
- region: 'center',
- xtype: 'tabpanel',
- reference: reference + '_tab',
- tabPosition: 'bottom',
- listeners: {
- afterrender: function (sender) {
- var scope = lookupScope(me);
- var value = scope.viewModel.get(me.config.bindValue);
- // sql 转换为 grid
- try {
- var list_1 = parseSqlToGrid(value);
- _$2.defer(function () {
- var grid = me.down('yvgrid');
- grid.setData(list_1);
- });
- }
- catch (e) {
- console.error(e);
- msg$1('无法解析SQL语法! 目前只能以 SQL 模式打开,如果在表格中做修改,将会覆盖原语句!');
- var tabSql = sender.down('sqleditor');
- sender.setActiveTab(tabSql);
- }
- },
- beforetabchange: function (sender, newCard, oldCard, eOpts) {
- var scope = lookupScope(me);
- var value = scope.viewModel.get(me.config.bindValue);
- if (newCard.key === 'grid') {
- // sql 转换为 grid
- try {
- var list_2 = parseSqlToGrid(value);
- _$2.defer(function () {
- var grid = me.down('yvgrid');
- grid.setData(list_2);
- });
- return true;
- }
- catch (e) {
- msg$1('无法解析 SQL 语法! 表格模式只适用于简单语法');
- console.error(e);
- return false;
- }
- }
- else if (newCard.key === 'sql') {
- // grid 转换为 sql
- _$2.defer(function () {
- var editor = me.down('sqleditor');
- editor.setValue(value);
- });
- return true;
- }
- }
- },
- items: [
- {
- title: '表格模式',
- key: 'grid',
- xtype: 'yvgrid',
- _mode: 'select',
- reference: reference + '_grid',
- hideFootbar: true,
- pagination: false,
- tbar: [
- {
- xtype: 'button',
- text: '删除',
- iconCls: 'x-fa fa-minus-circle',
- cls: 'ext-btn-danger',
- bind: {
- disabled: '{!' + reference + '_grid.selection}',
- },
- listeners: {
- click: function (sender) {
- var grid = sender.up('yvgrid');
- removeGridRow(grid);
- gridChanged(me, grid);
- }
- },
- },
- ],
- store: {},
- listeners: {
- editfinish: function (sender) {
- gridChanged(me, sender);
- },
- },
- columns: [
- {
- dataIndex: 'field',
- header: '字段', sortable: false, menuDisabled: true,
- width: 190,
- renderer: function (value, context, record, rowIdx, colIdx, store, view) {
- var column = context.column;
- var propertyConfig = me.config.propertyConfig;
- // 找到 propertyConfig 对应 propertyName 名称的 dict 字典的 dict.text 值
- var field = record.get('field');
- if (field) {
- var idx = _$2.findIndex(propertyConfig, function (p) { return p.field === field; });
- if (idx >= 0) {
- var meta = propertyConfig[idx];
- return meta.text;
- }
- }
- return value;
- }
- },
- {
- dataIndex: 'operator',
- header: '运算符', sortable: false, menuDisabled: true,
- dict: 'operator',
- width: 65,
- editor: { xtype: 'combo' },
- },
- {
- dataIndex: 'value',
- header: '值', sortable: false, menuDisabled: true,
- flex: 1,
- getEditor: function (record) {
- var column = this;
- var grid = _$2.get(column, 'ownerCt.grid.ownerGrid');
- var propertyConfig = me.config.propertyConfig;
- var field = record.get('field');
- if (!field) {
- // 没有填 propertyName
- return;
- }
- var idx = _$2.findIndex(propertyConfig, function (p) { return p.field === field; });
- if (idx < 0) {
- console.error('没有找到 field=' + field + ". propertyConfig");
- return;
- }
- var meta = propertyConfig[idx];
- if ((record.get('operator') === 'in' || record.get('operator') === 'notIn') && meta.editor.xtype === 'combo') {
- return new Ext.grid.CellEditor({
- field: __assign(__assign({ dict: meta.dict }, meta.editor), { xtype: 'tagfield' })
- });
- }
- return new Ext.grid.CellEditor({
- field: __assign({ dict: meta.dict }, meta.editor)
- });
- },
- renderer: function (valueList, context, record, rowIdx, colIdx, store, view) {
- var column = context.column;
- var grid = _$2.get(view, 'ownerGrid');
- var propertyConfig = me.config.propertyConfig;
- // 找到 propertyConfig 对应 propertyName 名称的 dict 字典的 dict.text 值
- var field = record.get('field');
- if (field) {
- var idx = _$2.findIndex(propertyConfig, function (p) { return (p.field) === field; });
- if (idx >= 0) {
- var meta = propertyConfig[idx];
- var dictName = _$2.get(meta, 'dict');
- if (dictName && window['DICT_CACHE'][dictName]) {
- var dict_1 = window['DICT_CACHE'][dictName];
- var valueText_1 = [];
- _$2.forEach(_$2.split(valueList, ','), function (value) {
- var idxKv = _$2.findIndex(dict_1, function (kv) { return _$2.toString(kv.id) === _$2.toString(value); });
- if (idxKv >= 0) {
- valueText_1.push(dict_1[idxKv].text);
- }
- else {
- valueText_1.push(value);
- }
- });
- return valueText_1.join(',');
- }
- }
- }
- return valueList;
- },
- },
- ]
- },
- {
- title: 'SQL模式',
- key: 'sql',
- xtype: 'sqleditor',
- reference: reference + '_sql',
- listeners: {
- change: function (sender) {
- var scope = lookupScope(me);
- // 保存 editor 写入的值
- scope.viewModel.set(me.config.bindValue, sender.getValue());
- }
- }
- },
- ]
- }
- ] });
- this.superclass.constructor.call(this, newConfig);
- },
- initComponent: function () {
- // 货位条件树
- var me = this;
- me.superclass.initComponent.apply(this, arguments);
- var tree = this.down('yvtree');
- var config = me.config;
- tree.setRootNode(buildConfigTree(config.propertyConfig));
- },
- });
- function gridChanged(me, grid) {
- var data = grid.getDataRows();
- var propertyConfig = me.config.propertyConfig;
- var bindValue = me.config.bindValue;
- var scope = lookupScope(me);
- var sql = parseGridToSql(data);
- scope.viewModel.set(bindValue, sql);
- }
- /**
- * 用于从 propertyConfig 解析出树形结构
- * { text: '库别分类', field: 'loc_classify', operator: '=', category: '库位属性', editor: {xtype: 'combo'}, dict: 'AREA_CLASSIFY', },
- * ->
- * {text: '库别分类', field: 'loc_classify', operator: '=', leaf: true},
- */
- function buildConfigTree(propertyConfig) {
- var root = {
- expanded: true,
- leaf: false,
- children: []
- };
- var categoryObj = {};
- var cfgList = propertyConfig;
- _$2.forEach(cfgList, function (cfg) {
- var cateNode = categoryObj[cfg.category];
- if (!cateNode) {
- cateNode = {
- text: cfg.category, expanded: true, leaf: false,
- children: []
- };
- categoryObj[cfg.category] = cateNode;
- root.children.push(cateNode);
- }
- cateNode.children.push({
- text: cfg.text,
- field: cfg.field,
- operator: cfg.operator,
- defaultValue: cfg.defaultValue,
- leaf: true,
- });
- });
- return root;
- }
- /**
- * 将表格变成 SQL where语句 [
- * {field: 'f1', value: 1, operator: '='}
- * {field: 'f2', value: 2, operator: '='}
- * {field: 'f3', value: '3', operator: '>='}
- * {field: 'f4', value: 4, operator: '='}
- * ]
- * ->
- * f1=v1 and f2=v2
- */
- function parseGridToSql(list) {
- var sqls = [];
- _$2.forEach(list, function (i) {
- var _a;
- if (i.operator === 'in') {
- sqls.push(i.field + ' in (' + (i.value) + ')');
- }
- else if (i.operator === 'notIn') {
- sqls.push(i.field + ' not in (' + (i.value) + ')');
- }
- else {
- sqls.push(i.field + ' ' + i.operator + ' ' + ((_a = i.value) !== null && _a !== void 0 ? _a : 0));
- }
- });
- return sqls.join(' AND ');
- }
- /**
- * 将 SQL 语句的 where 片段变成表格
- * @param sql f1=1 and f2=2 and f3>="3" and f4=4
- * @return [
- {field: 'f1', value: 1, operator: '='}
- {field: 'f2', value: 2, operator: '='}
- {field: 'f3', value: '3', operator: '>='}
- {field: 'f4', value: 4, operator: '='}
- ]
- */
- function parseSqlToGrid(sql) {
- if (!sql || !_$2.trim(sql)) {
- return [];
- }
- var parser = new window['NodeSQLParser'].Parser();
- var ast = parser.astify('select * from dual where ' + sql);
- var ret = [];
- exp(ast.where, ret);
- return ret;
- }
- function exp(ast, ret) {
- if (ast.type === 'binary_expr') {
- if (_$2.toUpper(ast.operator) === 'AND') {
- if (ast.left.type === 'binary_expr') {
- exp(ast.left, ret);
- }
- if (ast.right.type === 'binary_expr') {
- exp(ast.right, ret);
- }
- }
- else if (['=', '>=', '>', '<=', '<', 'IN', 'NOT IN'].includes(_$2.toUpper(ast.operator))) {
- if (ast.left.type === 'column_ref') {
- if (ast.right.type === 'number' ||
- ast.right.type === 'single_quote_string' ||
- ast.right.type === 'double_quote_string') {
- // 具体值相等
- ret.push({ field: ast.left.column, value: ast.right.value, operator: ast.operator });
- }
- else if ((_$2.toUpper(ast.operator) === 'IN' || _$2.toUpper(ast.operator) === 'NOT IN')
- && ast.right.type === 'expr_list') {
- // in / not in
- var valueList_1 = [];
- _$2.forEach(ast.right.value, function (item) {
- valueList_1.push(item.value);
- });
- var operator = void 0;
- if (_$2.toUpper(ast.operator) === 'IN') {
- operator = 'in';
- }
- else if (_$2.toUpper(ast.operator) === 'NOT IN') {
- operator = 'notIn';
- }
- ret.push({
- field: ast.left.column, value: valueList_1.join(','),
- operator: operator
- });
- }
- else {
- throw new Error('ast.right must is value.');
- }
- }
- else {
- throw new Error('ast.left must is column_ref.');
- }
- }
- else {
- // 必须用 AND 条件符匹配
- throw new Error('ast.operator must is "AND / =".');
- }
- }
- else {
- throw new Error('ast.type must is "binary_expr".');
- }
- }
- /**
- * json5.stringify( new NodeSQLParser.Parser().astify("").where)
- * select * from aa where f1=1 and f2=2 and f3='3' and f4>=4 and f4<3
- {
- type: 'binary_expr',
- operator: 'AND',
- left: {
- type: 'binary_expr',
- operator: 'AND',
- left: {
- type: 'binary_expr',
- operator: 'AND',
- left: {
- type: 'binary_expr',
- operator: 'AND',
- left: {
- type: 'binary_expr',
- operator: '=',
- left: {
- type: 'column_ref',
- table: null,
- column: 'f1'
- },
- right: {
- type: 'number',
- value: 1
- }
- },
- right: {
- type: 'binary_expr',
- operator: '=',
- left: {
- type: 'column_ref',
- table: null,
- column: 'f2'
- },
- right: {
- type: 'number',
- value: 2
- }
- }
- },
- right: {
- type: 'binary_expr',
- operator: '=',
- left: {
- type: 'column_ref',
- table: null,
- column: 'f3'
- },
- right: {
- type: 'single_quote_string',
- value: '3'
- }
- }
- },
- right: {
- type: 'binary_expr',
- operator: '>=',
- left: {
- type: 'column_ref',
- table: null,
- column: 'f4'
- },
- right: {
- type: 'number',
- value: 4
- }
- }
- },
- right: {
- type: 'binary_expr',
- operator: '<',
- left: {
- type: 'column_ref',
- table: null,
- column: 'f4'
- },
- right: {
- type: 'number',
- value: 3
- }
- }
- }
- * */
- }
- //# sourceMappingURL=SqlComplex.js.map
- function initParamComplex () {
- Ext.define('Yvan.ParamComplex', {
- extend: 'Ext.panel.Panel',
- xtype: 'paramcomplex',
- alias: 'widget.paramcomplex',
- getSqlExpress: function () {
- },
- constructor: function (config) {
- var reference = config.reference;
- var me = this;
- var newConfig = __assign(__assign({}, config), { layout: 'border', items: [
- {
- region: 'west',
- width: 280,
- border: false,
- split: true,
- reference: reference + '_tree',
- xtype: 'yvtree',
- hideRefresh: true,
- hideExpand: true,
- hideCollapse: true,
- listeners: {
- itemdblclick: function (sender, record, item, index, e) {
- var field = record.get('field');
- var defaultValue = record.get('defaultValue');
- if (!field) {
- return;
- }
- var tabExpress = me.down('tabpanel');
- var sqleditor = me.down('sqleditor');
- var expressGrid = me.down('yvgrid');
- if (tabExpress.getActiveTab().key !== 'grid') {
- // SQL 模式
- sqleditor.insertText(field + '=');
- }
- else {
- // 表格模式
- expressGrid.appendEditRow({
- field: field,
- operator: '=',
- value: defaultValue,
- remark: '',
- });
- _$2.defer(function () {
- gridChanged(me, expressGrid);
- });
- }
- }
- },
- },
- {
- region: 'center',
- xtype: 'tabpanel',
- reference: reference + '_tab',
- tabPosition: 'bottom',
- listeners: {
- afterrender: function (sender) {
- var scope = lookupScope(me);
- var value = scope.viewModel.get(me.config.bindValue);
- // sql 转换为 grid
- try {
- var list_1 = parseParamToGrid(value);
- _$2.defer(function () {
- var grid = me.down('yvgrid');
- grid.setData(list_1);
- });
- }
- catch (e) {
- console.error(e);
- msg$1('无法解析SQL语法! 目前只能以 SQL 模式打开,如果在表格中做修改,将会覆盖原语句!');
- var tabSql = sender.down('sqleditor');
- sender.setActiveTab(tabSql);
- }
- },
- beforetabchange: function (sender, newCard, oldCard, eOpts) {
- var scope = lookupScope(me);
- var value = scope.viewModel.get(me.config.bindValue);
- if (newCard.key === 'grid') {
- // sql 转换为 grid
- try {
- var list_2 = parseParamToGrid(value);
- _$2.defer(function () {
- var grid = me.down('yvgrid');
- grid.setData(list_2);
- });
- return true;
- }
- catch (e) {
- msg$1('无法解析 SQL 语法! 表格模式只适用于简单语法');
- console.error(e);
- return false;
- }
- }
- else if (newCard.key === 'sql') {
- // grid 转换为 sql
- _$2.defer(function () {
- var editor = me.down('sqleditor');
- editor.setValue(value);
- });
- return true;
- }
- }
- },
- items: [
- {
- title: '表格模式',
- key: 'grid',
- xtype: 'yvgrid',
- _mode: 'select',
- reference: reference + '_grid',
- hideFootbar: true,
- pagination: false,
- tbar: [
- {
- xtype: 'button',
- text: '删除',
- iconCls: 'x-fa fa-minus-circle',
- cls: 'ext-btn-danger',
- bind: {
- disabled: '{!' + reference + '_grid.selection}',
- },
- listeners: {
- click: function (sender) {
- var grid = sender.up('yvgrid');
- removeGridRow(grid);
- gridChanged(me, grid);
- }
- },
- },
- ],
- store: {},
- listeners: {
- editfinish: function (sender) {
- gridChanged(me, sender);
- },
- },
- columns: [
- {
- dataIndex: 'field',
- header: '字段', sortable: false, menuDisabled: true,
- width: 190,
- renderer: function (value, context, record, rowIdx, colIdx, store, view) {
- var column = context.column;
- var propertyConfig = me.config.propertyConfig;
- // 找到 propertyConfig 对应 propertyName 名称的 dict 字典的 dict.text 值
- var field = record.get('field');
- if (field) {
- var idx = _$2.findIndex(propertyConfig, function (p) { return p.field === field; });
- if (idx >= 0) {
- var meta = propertyConfig[idx];
- return meta.text;
- }
- }
- return value;
- }
- },
- {
- dataIndex: 'value',
- header: '值', sortable: false, menuDisabled: true,
- flex: 1,
- getEditor: function (record) {
- var column = this;
- var grid = _$2.get(column, 'ownerCt.grid.ownerGrid');
- var propertyConfig = me.config.propertyConfig;
- var field = record.get('field');
- if (!field) {
- // 没有填 propertyName
- return;
- }
- var idx = _$2.findIndex(propertyConfig, function (p) { return p.field === field; });
- if (idx < 0) {
- console.error('没有找到 field=' + field + ". propertyConfig");
- return;
- }
- var meta = propertyConfig[idx];
- if ((record.get('operator') === 'in' || record.get('operator') === 'notIn') && meta.editor.xtype === 'combo') {
- return new Ext.grid.CellEditor({
- field: __assign(__assign({ dict: meta.dict }, meta.editor), { xtype: 'tagfield' })
- });
- }
- return new Ext.grid.CellEditor({
- field: __assign({ dict: meta.dict }, meta.editor)
- });
- },
- renderer: function (valueList, context, record, rowIdx, colIdx, store, view) {
- var column = context.column;
- var grid = _$2.get(view, 'ownerGrid');
- var propertyConfig = me.config.propertyConfig;
- // 找到 propertyConfig 对应 propertyName 名称的 dict 字典的 dict.text 值
- var field = record.get('field');
- if (field) {
- var idx = _$2.findIndex(propertyConfig, function (p) { return (p.field) === field; });
- if (idx >= 0) {
- var meta = propertyConfig[idx];
- var dictName = _$2.get(meta, 'dict');
- if (dictName && window['DICT_CACHE'][dictName]) {
- var dict_1 = window['DICT_CACHE'][dictName];
- var valueText_1 = [];
- _$2.forEach(_$2.split(valueList, ','), function (value) {
- var idxKv = _$2.findIndex(dict_1, function (kv) { return _$2.toString(kv.id) === _$2.toString(value); });
- if (idxKv >= 0) {
- valueText_1.push(dict_1[idxKv].text);
- }
- else {
- valueText_1.push(value);
- }
- });
- return valueText_1.join(',');
- }
- }
- }
- return valueList;
- },
- },
- ]
- },
- {
- title: '文本模式',
- key: 'sql',
- xtype: 'sqleditor',
- reference: reference + '_sql',
- listeners: {
- change: function (sender) {
- var scope = lookupScope(me);
- // 保存 editor 写入的值
- scope.viewModel.set(me.config.bindValue, sender.getValue());
- }
- }
- },
- ]
- }
- ] });
- this.superclass.constructor.call(this, newConfig);
- },
- initComponent: function () {
- // 货位条件树
- var me = this;
- me.superclass.initComponent.apply(this, arguments);
- var tree = this.down('yvtree');
- var config = me.config;
- tree.setRootNode(buildConfigTree(config.propertyConfig));
- },
- });
- function gridChanged(me, grid) {
- var data = grid.getDataRows();
- var propertyConfig = me.config.propertyConfig;
- var bindValue = me.config.bindValue;
- var scope = lookupScope(me);
- var sql = parseGridToParam(data);
- scope.viewModel.set(bindValue, sql);
- }
- /**
- * 用于从 propertyConfig 解析出树形结构
- * { text: '库别分类', field: 'loc_classify', operator: '=', category: '库位属性', editor: {xtype: 'combo'}, dict: 'AREA_CLASSIFY', },
- * ->
- * {text: '库别分类', field: 'loc_classify', operator: '=', leaf: true},
- */
- function buildConfigTree(propertyConfig) {
- var root = {
- expanded: true,
- leaf: false,
- children: []
- };
- var categoryObj = {};
- var cfgList = propertyConfig;
- _$2.forEach(cfgList, function (cfg) {
- var cateNode = categoryObj[cfg.category];
- if (!cateNode) {
- cateNode = {
- text: cfg.category, expanded: true, leaf: false,
- children: []
- };
- categoryObj[cfg.category] = cateNode;
- root.children.push(cateNode);
- }
- cateNode.children.push({
- text: cfg.text,
- field: cfg.field,
- operator: cfg.operator,
- defaultValue: cfg.defaultValue,
- leaf: true,
- });
- });
- return root;
- }
- /**
- * 将表格变成参数语句 [
- * {field: 'f1', value: 1}
- * {field: 'f2', value: 2}
- * {field: 'f3', value: '3'}
- * {field: 'f4', value: 4}
- * ]
- * ->
- * f1=v1, f2=v2
- */
- function parseGridToParam(list) {
- var sqls = [];
- _$2.forEach(list, function (i) {
- sqls.push(i.field + '=' + (i.value));
- });
- return sqls.join('; ');
- }
- /**
- * 将 分号分割的的参数设置 变成表格
- * @param param a=1; b=2; c='3'
- * @return [
- {field: 'a', value: 1}
- {field: 'b', value: 2}
- {field: 'c', value: '3'}
- ]
- */
- function parseParamToGrid(param) {
- if (!param || !_$2.trim(param)) {
- return [];
- }
- var ret = [];
- var sp = _$2.split(param, ';');
- _$2.forEach(sp, function (v) {
- var vi = _$2.indexOf(v, '=');
- var field = _$2.trim(v.substr(0, vi));
- var value = eval(v.substr(vi + 1));
- ret.push({ field: field, value: value });
- });
- return ret;
- }
- }
- //# sourceMappingURL=ParamComplex.js.map
- function initSqlEditor () {
- Ext.define('com.yvan.studio.SqlEditor', {
- extend: 'Ext.panel.Panel',
- alias: 'widget.sqleditor',
- xtype: 'sqleditor',
- layout: 'fit',
- border: false,
- html: "<div class=\"editor\"/>",
- config: {
- value: ''
- },
- codeChange: undefined,
- isChangeFromOuter: false,
- setCode: function (value) {
- var _this = this;
- this.code = value;
- this.value = value;
- _$2.defer(function () {
- _this.isChangeFromOuter = true;
- if (_this.editor) {
- _this.editor.setValue(value);
- }
- });
- },
- getCode: function () {
- return this.getValue();
- },
- updateOptions: function (options) {
- if (this.editor && options) {
- this.editor.updateOptions(options);
- }
- },
- getValue: function () {
- if (!this.editor) {
- return this.code;
- }
- return this.editor.getValue();
- },
- applyPosition: function () {
- var _this = this;
- if (this.autoFocusMethod) {
- if (this.editor) {
- _$2.defer(function () {
- if (_this.autoFocusStartLine) {
- _this.editor.setPosition({
- lineNumber: _this.autoFocusStartLine,
- column: _this.autoFocusStartColumn
- });
- _this.editor.revealLine(_this.autoFocusStartLine); //滚动到特定行
- }
- _this.editor.focus();
- });
- delete this.autoFocusMethod;
- }
- }
- this.editor.layout();
- },
- insertText: function (text) {
- var editor = this.editor;
- var position = editor.getPosition();
- editor.executeEdits('', [
- {
- range: {
- startLineNumber: position.lineNumber,
- startColumn: position.column,
- endLineNumber: position.lineNumber,
- endColumn: position.column
- },
- text: text
- }
- ]);
- },
- setValue: function (value, fromEditor) {
- this.setCode(value);
- var me = this;
- if (me.value === value) {
- // 值相等,不需要变化
- return;
- }
- if (fromEditor !== true && me.editor) {
- // 不是来源于编辑器的变化,才设置编辑器的值
- me.editor.setValue(value);
- }
- // 通知mixins setValue
- me.value = value;
- me.fireEvent('change', value);
- },
- initComponent: function () {
- var that = this;
- this.superclass.initComponent.call(this);
- that.on({
- resize: function () {
- if (that.editor) {
- that.editor.layout();
- }
- },
- destory: function () {
- if (that.editor) {
- that.editor.dispose();
- delete that.editor;
- }
- },
- afterrender: function (sender) {
- var $dom = $(that.el.dom).find('.editor');
- attach_2($dom[0], {
- value: that.code
- }).then(function (editor) {
- that.editor = editor;
- that.applyPosition();
- that.editor.onDidChangeModelContent(function (e) {
- that.fireEvent('change', that.editor, e);
- if (typeof that.codeChange === "function" && !that.isChangeFromOuter) {
- that.codeChange(that.editor.getValue(), that.name, e);
- }
- that.isChangeFromOuter = false;
- });
- });
- }
- });
- }
- });
- function attach_2(element, opts) {
- if (!window['monaco']) {
- return;
- }
- var monaco = window['monaco'];
- return new Promise(function (resolve) {
- var editor = monaco.editor.create(element, __assign(__assign({}, opts), { language: 'sql', minimap: {
- enabled: false
- } }));
- // editor.addCommand(monaco.KeyMod.Shift | monaco.KeyMod.Alt | monaco.KeyCode.KeyF, function () {
- // const sql = editor.getValue()
- // if (_.trim(sql).length > 0) {
- // editor.setValue(format(sql, {
- // indent: ' ',
- // uppercase: true,
- // }))
- // }
- // })
- editor.onKeyUp(function (e) {
- // console.log(e)
- if ( /*e.code === 'Enter'||*/e.code === 'Quote') {
- editor.trigger('随便写点儿啥', 'editor.action.triggerSuggest', {});
- }
- });
- resolve(editor);
- });
- }
- }
- //# sourceMappingURL=SqlEditor.js.map
- function initJsonEditor () {
- Ext.define('com.yvan.studio.JsonEditor', {
- extend: 'Ext.panel.Panel',
- alias: 'widget.jsoneditor',
- xtype: 'jsoneditor',
- layout: 'fit',
- border: false,
- html: "<div class=\"editor\"/>",
- autoFocusMethod: true,
- autoFocusStartLine: 0,
- autoFocusStartColumn: 0,
- codeChange: undefined,
- funcArr: [],
- modulePage: null,
- isChangeFromOuter: false,
- name: "",
- /**
- * 设置代码
- */
- setCode: function (value) {
- var _this = this;
- this.code = value;
- _$2.defer(function () {
- _this.isChangeFromOuter = true;
- if (_this.editor) {
- _this.editor.setValue(value);
- }
- });
- },
- updateOptions: function (options) {
- if (this.editor && options) {
- this.editor.updateOptions(options);
- }
- },
- setLanguage: function (lang) {
- if (!window['monaco']) {
- return;
- }
- var monaco = window['monaco'];
- if (this.editor && lang) {
- monaco.editor.setModelLanguage(this.editor.getModel(), lang);
- }
- },
- getCode: function () {
- var _a;
- return (_a = this.editor) === null || _a === void 0 ? void 0 : _a.getValue();
- },
- applyPosition: function () {
- var _this = this;
- if (this.autoFocusMethod) {
- if (this.editor) {
- _$2.defer(function () {
- if (_this.autoFocusStartLine) {
- _this.editor.setPosition({
- lineNumber: _this.autoFocusStartLine,
- column: _this.autoFocusStartColumn
- });
- _this.editor.revealLine(_this.autoFocusStartLine); //滚动到特定行
- }
- _this.editor.focus();
- });
- delete this.autoFocusMethod;
- }
- }
- this.editor.layout();
- },
- initComponent: function () {
- var that = this;
- this.superclass.initComponent.apply(this, arguments);
- this.on({
- resize: function (sender, width, height) {
- if (that.editor) {
- that.editor.layout();
- }
- },
- destory: function () {
- if (that.editor) {
- that.editor.dispose();
- delete that.editor;
- }
- },
- afterrender: function (sender) {
- var $dom = $(that.el.dom).find('.editor');
- attach_116($dom[0], {
- value: that.code
- }).then(function (editor) {
- that.editor = editor;
- that.applyPosition();
- that.editor.onDidChangeModelContent(function (e) {
- that.fireEvent('change', that.editor, e);
- if (typeof that.codeChange === "function" && !that.isChangeFromOuter) {
- that.codeChange(that.editor.getValue(), that.name, e);
- }
- that.isChangeFromOuter = false;
- });
- });
- }
- });
- },
- });
- function attach_116(element, opts) {
- if (!window['monaco']) {
- return;
- }
- var monaco = window['monaco'];
- return new Promise(function (resolve) {
- var editor = monaco.editor.create(element, __assign(__assign({}, opts), { language: 'json', minimap: {
- enabled: false
- } }));
- editor.onKeyUp(function (e) {
- // console.log(e)
- if ( /*e.code === 'Enter'||*/e.code === 'Quote') {
- editor.trigger('随便写点儿啥', 'editor.action.triggerSuggest', {});
- }
- });
- resolve(editor);
- });
- }
- }
- //# sourceMappingURL=JsonEditor.js.map
- function initJsEditor () {
- Ext.define('com.yvan.studio.JsEditor', {
- extend: 'Ext.panel.Panel',
- alias: 'widget.jseditor',
- xtype: 'jseditor',
- layout: 'fit',
- border: false,
- html: "<div class=\"editor\"/>",
- autoFocusMethod: true,
- autoFocusStartLine: 0,
- autoFocusStartColumn: 0,
- codeChange: undefined,
- funcArr: [],
- modulePage: null,
- isChangeFromOuter: false,
- name: "",
- /**
- * 设置代码
- */
- setCode: function (value) {
- var _this = this;
- this.code = value;
- _$2.defer(function () {
- _this.isChangeFromOuter = true;
- if (_this.editor) {
- _this.editor.setValue(value);
- if (_this.name === "controllerEditor") {
- _this.funcArr = _this.getAllFunction();
- }
- }
- });
- },
- getCode: function () {
- var _a;
- if (!this.editor) {
- return this.code;
- }
- return (_a = this.editor) === null || _a === void 0 ? void 0 : _a.getValue();
- },
- applyPosition: function () {
- var _this = this;
- if (this.autoFocusMethod) {
- if (this.editor) {
- _$2.defer(function () {
- if (_this.autoFocusStartLine) {
- _this.editor.setPosition({
- lineNumber: _this.autoFocusStartLine,
- column: _this.autoFocusStartColumn
- });
- _this.editor.revealLine(_this.autoFocusStartLine); //滚动到特定行
- }
- _this.editor.focus();
- });
- delete this.autoFocusMethod;
- }
- }
- this.editor.layout();
- },
- initComponent: function () {
- var that = this;
- this.superclass.initComponent.apply(this, arguments);
- this.on({
- resize: function (sender, width, height) {
- if (that.editor) {
- that.editor.layout();
- }
- },
- destory: function () {
- if (that.editor) {
- that.editor.dispose();
- delete that.editor;
- }
- },
- afterrender: function () {
- var $dom = $(that.el.dom).find('.editor');
- attach_1($dom[0], {
- value: that.code
- }).then(function (editor) {
- that.editor = editor;
- that.applyPosition();
- that.editor.onDidChangeModelContent(function (e) {
- that.fireEvent('change', that.editor, e);
- if (typeof that.codeChange === "function" && !that.isChangeFromOuter) {
- that.codeChange(that.editor.getValue(), that.name, e);
- }
- that.isChangeFromOuter = false;
- });
- });
- }
- });
- },
- getAllFunction: function () {
- var funcArr = [];
- var ast = window['YvanUI'].recast.parse(this.code);
- if (ast && ast.program && ast.program.body) {
- if (Array.isArray(ast.program.body)) {
- for (var i = 0; i < ast.program.body.length; i++) {
- var m = ast.program.body[i];
- if (m.type === "ExportDefaultDeclaration") {
- if (m.declaration.type === "ClassDeclaration") {
- if (m.declaration.body.type === "ClassBody") {
- if (Array.isArray(m.declaration.body.body)) {
- for (var j = 0; j < m.declaration.body.body.length; j++) {
- var ob = m.declaration.body.body[j];
- if (ob.type === "MethodDefinition" && ob.kind === "method") {
- var funcItem = { name: ob.key.name, args: [] };
- if (Array.isArray(ob.value.params)) {
- for (var k = 0; k < ob.value.params.length; k++) {
- var p = ob.value.params[k];
- funcItem.args.push(p.name);
- }
- }
- funcArr.push(funcItem);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return funcArr;
- }
- });
- var isInited = false;
- function attach_1(element, opts) {
- if (!window['monaco']) {
- return;
- }
- var monaco = window['monaco'];
- return new Promise(function (resolve) {
- if (!isInited) {
- isInited = true;
- monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
- noSemanticValidation: true,
- noSyntaxValidation: false
- });
- // compiler options
- monaco.languages.typescript.javascriptDefaults.setCompilerOptions({
- target: monaco.languages.typescript.ScriptTarget.ES2016,
- allowNonTsExtensions: true,
- });
- // extra libraries
- var libSource = [
- 'declare class Facts {',
- ' /**',
- ' * Returns the next fact',
- ' */',
- ' static next():string',
- ' static next222():string',
- '}',
- "\n declare namespace WotuUI {\n export class Text {\n label: string\n }\n\n export function wrapText(n1: string): Text\n export function render(element:HTMLElement, vjson:any): void\n }\n ",
- "\n declare module 'fs' {\n function readFileSync(path: string | number, options?: { encoding?: string; flag?: string; } | null): string;\n }\n "
- ].join('\n');
- var libUri = 'file:///index.d.ts';
- monaco.languages.typescript.javascriptDefaults.addExtraLib(libSource, libUri);
- // When resolving definitions and references, the editor will try to use created models.
- // Creating a model for the library allows "peek definition/references" commands to work with the library.
- monaco.editor.createModel(libSource, 'javascript', monaco.Uri.parse(libUri));
- }
- var editor = monaco.editor.create(element, __assign(__assign({}, opts), { language: 'javascript' }));
- resolve(editor);
- });
- }
- }
- //# sourceMappingURL=JsEditor.js.map
- function initClipboard () {
- var cc = Ext.grid.plugin.Clipboard.prototype.constructor;
- var initComponent = Ext.grid.plugin.Clipboard.prototype.initComponent;
- Ext.grid.plugin.Clipboard.override({
- getCellData: function (format, erase) {
- var cmp = this.getCmp(), selection = cmp.getSelectionModel().getSelected(), ret = [], isRaw = format === 'raw', isText = format === 'text', viewNode, cell, data, dataIndex, lastRecord, column, record, row, view;
- if (selection) {
- selection.eachCell(function (cellContext) {
- column = cellContext.column;
- view = cellContext.column.getView();
- record = cellContext.record;
- // Do not copy the check column or row numberer column
- if (column.ignoreExport && column.xtype !== "checkcolumn") {
- return;
- }
- if (lastRecord !== record) {
- lastRecord = record;
- ret.push(row = []);
- }
- dataIndex = column.dataIndex;
- // 记录原始数据
- var rData = record.data[dataIndex];
- if (isRaw) {
- data = record.data[dataIndex];
- }
- else {
- // Try to access the view node.
- viewNode = view.all.item(cellContext.rowIdx);
- // If we could not, it's because it's outside of the rendered block -
- // recreate it.
- if (!viewNode) {
- viewNode = Ext.fly(view.createRowElement(record, cellContext.rowIdx));
- }
- cell = viewNode.dom.querySelector(column.getCellInnerSelector());
- data = cell.innerHTML;
- if (isText) {
- data = Ext.util.Format.stripTags(data);
- }
- // 没有找到html text的数据时候给原数据, 主要针对column.xtype === "checkcolumn" 时无法copy到有效值
- data = data || rData;
- }
- row.push(data);
- if (erase && dataIndex) {
- record.set(dataIndex, null);
- }
- });
- }
- // See decode() comment below
- return Ext.util.TSV.encode(ret, undefined, null);
- },
- getCells: function (format, erase) {
- var cmp = this.getCmp(), selection = cmp.getSelectionModel().getSelected(), ret = [], dataIndex, lastRecord, record, row;
- if (selection) {
- selection.eachCell(function (cellContext) {
- record = cellContext.record;
- if (lastRecord !== record) {
- lastRecord = record;
- ret.push(row = {
- model: record.self,
- fields: []
- });
- }
- dataIndex = cellContext.column.dataIndex;
- row.fields.push({
- name: dataIndex,
- value: record.data[dataIndex]
- });
- if (erase && dataIndex) {
- record.set(dataIndex, null);
- }
- });
- }
- return ret;
- },
- getTextData: function (format, erase) {
- return this.getCellData(format, erase);
- },
- putCellData: function (data, format) {
- var _a;
- var values = Ext.util.TSV.decode(data, undefined, null), row, recCount = values.length, colCount = recCount ? values[0].length : 0, sourceRowIdx, sourceColIdx, view = this.getCmp().getView(), maxRowIdx = view.dataSource.getCount() - 1, maxColIdx = view.getVisibleColumnManager().getColumns().length - 1, selModel = view.getSelectionModel(), selected = selModel.getSelected(), navModel = view.getNavigationModel(), destination = selected.startCell || navModel.getPosition(), dataIndex, destinationStartColumn, dataObject = {};
- // If the view is not focused, use the first cell of the selection as the destination.
- if (!destination && selected) {
- selected.eachCell(function (c) {
- destination = c;
- return false;
- });
- }
- if (destination) {
- // Create a new Context based upon the outermost View.
- // NavigationModel works on local views.
- // TODO: remove this step when NavModel is fixed to use outermost view in locked grid.
- // At that point, we can use navModel.getPosition()
- destination = new Ext.grid.CellContext(view).setPosition(destination.record, destination.column);
- }
- else {
- destination = new Ext.grid.CellContext(view).setPosition(0, 0);
- }
- destinationStartColumn = destination.colIdx;
- for (sourceRowIdx = 0; sourceRowIdx < recCount; sourceRowIdx++) {
- row = values[sourceRowIdx];
- // Collect new values in dataObject
- for (sourceColIdx = 0; sourceColIdx < colCount; sourceColIdx++) {
- if (!destination.column.initialConfig.editor && destination.column.xtype !== "checkcolumn") {
- continue;
- }
- dataIndex = destination.column.dataIndex;
- var editorXtype = (_a = destination.column.editor) === null || _a === void 0 ? void 0 : _a.xtype;
- if (dataIndex) {
- switch (format) {
- // Raw field values
- case 'raw':
- dataObject[dataIndex] = row[sourceColIdx] === "false" ? false : row[sourceColIdx] === "true" ? true : row[sourceColIdx];
- break;
- // Textual data with HTML tags stripped
- case 'text':
- {
- if ((editorXtype === "combo" || editorXtype === "combobox") && (typeof destination.column.renderer === "function")) {
- // 获取字典原始的value
- dataObject[dataIndex] = destination.column.renderer(row[sourceColIdx], true);
- }
- else {
- dataObject[dataIndex] = row[sourceColIdx] === "false" ? false : row[sourceColIdx] === "true" ? true : row[sourceColIdx];
- }
- break;
- }
- }
- }
- // If we are at the end of the destination row, break the column loop.
- if (destination.colIdx === maxColIdx) {
- break;
- }
- destination.setColumn(destination.colIdx + 1);
- }
- // Update the record in one go.
- destination.record.set(dataObject);
- // If we are at the end of the destination store, break the row loop.
- if (destination.rowIdx === maxRowIdx) {
- break;
- }
- // Jump to next row in destination
- destination.setPosition(destination.rowIdx + 1, destinationStartColumn);
- }
- },
- putTextData: function (data, format) {
- var _a, _b, _c;
- var values = Ext.util.TSV.decode(data, undefined, null), view = this.getCmp().getView(), selModel = view.getSelectionModel(), selected = selModel.getSelected();
- // 根据复制的行数自动添加新的行
- var dataLength = ((_c = (_b = (_a = this.cmp.getStore()) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.items) === null || _c === void 0 ? void 0 : _c.length) || 0;
- if (selected.startCell.rowIdx + values.length >= dataLength) {
- for (var i = 0; i < selected.startCell.rowIdx + values.length - dataLength; i++) {
- this.cmp.getStore().add({});
- }
- }
- this.putCellData(data, format);
- },
- });
- }
- //# sourceMappingURL=clipboard.js.map
- function initDict () {
- var DICT_CACHE = window['DICT_CACHE'];
- if (!DICT_CACHE) {
- DICT_CACHE = {};
- window['DICT_CACHE'] = DICT_CACHE;
- }
- DICT_CACHE.XTYPE = [
- { id: 'datefield', text: '日期' },
- { id: 'datetimefield', text: '日期时间' },
- { id: 'textfield', text: '文本' },
- { id: 'numberfield', text: '数字' },
- { id: 'combo', text: '下拉框' },
- ];
- DICT_CACHE.operator = [
- { id: '=', text: '=' },
- { id: '>', text: '>' },
- { id: '<', text: '<' },
- { id: '>=', text: '>=' },
- { id: '<=', text: '<=' },
- { id: 'in', text: 'in' },
- { id: 'notIn', text: 'notIn' },
- ];
- DICT_CACHE.GRID_MODE = [
- { id: 'edit1', text: '单机编辑模式' },
- { id: 'edit2', text: '双击编辑模式' },
- { id: 'checkbox', text: '勾选' },
- { id: 'checkonly', text: '只勾选' },
- { id: 'select', text: '行选择模式' },
- ];
- DICT_CACHE.BOTH_SELECT = [
- { id: 'N/A', text: '<无>' },
- { id: 'textfield', text: '文本' },
- { id: 'numberfield', text: '数字框' },
- { id: 'datefield', text: '日期' },
- { id: 'datetimefield', text: '日期时间' },
- { id: 'combo', text: '下拉框' },
- { id: 'combogrid', text: '下拉表' },
- { id: 'checkbox', text: '勾选' },
- ];
- DICT_CACHE.ROW_LAYOUT = [
- { id: 'flex', text: '按权重摆放' },
- { id: 'hbox', text: '按宽度摆放' },
- ];
- DICT_CACHE.GRID_XTYPE = [
- { id: 'N/A', text: '<无>' },
- { id: 'textfield', text: '文本-textfield' },
- { id: 'numberfield', text: '数字框-numberfield' },
- { id: 'datefield', text: '日期-datefield' },
- { id: 'datetimefield', text: '日期时间-datetimefield' },
- { id: 'combo', text: '下拉框-combo' },
- { id: 'combogrid', text: '下拉表-combogrid' },
- { id: 'checkbox', text: '勾选-checkbox' },
- ];
- DICT_CACHE.FORM_XTYPE = [
- { id: 'N/A', text: '<无>' },
- { id: 'textfield', text: '文本-textfield' },
- { id: 'numberfield', text: '数字框-numberfield' },
- { id: 'datefield', text: '日期-datefield' },
- { id: 'datetimefield', text: '日期时间-datetimefield' },
- { id: 'combo', text: '下拉框-combo' },
- { id: 'combogrid', text: '下拉表-combogrid' },
- { id: 'checkbox', text: '勾选-checkbox' },
- { id: 'multiplesearch', text: '多段文本-multiplesearch' },
- ];
- DICT_CACHE.GRID_FORMATTER = [
- { id: 'N/A', text: '默认' },
- { id: 'rownum', text: '序号-rownum' },
- { id: 'button', text: '按钮-button' },
- { id: 'checkbox', text: '勾选-checkbox' },
- { id: 'progres', text: '进度条-progres' },
- ];
- }
- //# sourceMappingURL=dict.js.map
- function initDesigner () {
- Ext.define('com.yvan.studio.designer', {
- extend: 'Ext.panel.Panel',
- alias: 'widget.designer',
- xtype: 'designer',
- layout: 'fit',
- items: [],
- constructor: function (config) {
- var self = this;
- var newConfig = _$2.defaultsDeep({
- // 强制性属性
- }, config);
- this.superclass.constructor.call(self, newConfig);
- },
- initComponent: function () {
- var me = this;
- me.on({
- afterrender: function () {
- }
- });
- this.superclass.initComponent.call(me);
- }
- });
- }
- //# sourceMappingURL=designer.js.map
- var FixClass = /** @class */ (function () {
- function FixClass() {
- }
- FixClass.prototype.fix = function (me, config) {
- var _this = this;
- if (isDesignMode(me, config)) {
- return;
- }
- if (!config) {
- return;
- }
- var fix = config.fix;
- if (!fix) {
- return;
- }
- delete config.fix;
- // 这里有个 bug
- // 但凡是调用了 this.lookupViewModel() 就会出现绑定不了的情况
- // const scope = config.$initParent.lookupReferenceHolder().yvanScope //lookupScope(me)
- var scope;
- if (config.$initParent) {
- // 在面板上的组件
- scope = config.$initParent.lookupReferenceHolder().yvanScope; //lookupScope(me)
- }
- else if (config.column) {
- // 在列上的组件
- scope = config.column.lookupReferenceHolder().yvanScope; //lookupScope(me)
- }
- if (_$2.isArray(fix)) {
- _$2.each(fix, function (f) {
- var fn = lookupFn(scope, f);
- fn.call(_this, me, config);
- });
- }
- else if (_$2.isString(fix)) {
- var fn = lookupFn(scope, fix);
- fn.call(this, me, config);
- }
- };
- __decorate([
- baseConfigProcess(),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [Object, Object]),
- __metadata("design:returntype", void 0)
- ], FixClass.prototype, "fix", null);
- return FixClass;
- }());
- //# sourceMappingURL=fix.js.map
- function init$1() {
- // 引入 filters 过滤插件
- Ext.require([
- 'Ext.grid.filters.Filters'
- ]);
- // 启用 tooltip 快捷提示
- Ext.QuickTips.init();
- // 定义日期格式化方法
- if (Ext.util && Ext.util.Format) {
- Ext.apply(Ext.util.Format, {
- dateFormat: 'Y-m-d'
- });
- }
- Ext.form.field.Display.override({
- cls: 'yvan-display-field',
- labelAlign: 'right'
- });
- Ext.define("Ext.locale.zh_CN.picker.Date", {
- override: "Ext.picker.Date",
- format: "Y-m-d",
- });
- Ext.define("Ext.locale.zh_CN.form.field.Date", {
- override: "Ext.form.field.Date",
- format: "Y-m-d",
- });
- Ext.define("Ext.locale.zh_CN.grid.PropertyColumnModel", {
- override: "Ext.grid.PropertyColumnModel",
- format: "Y-m-d",
- });
- Ext.define("Ext.locale.zh_CN.view.AbstractView", {
- override: "Ext.view.AbstractView",
- loadingText: "读取中..."
- });
- Ext.LoadMask.prototype.msg = '请稍后...';
- Ext.define("Ext.locale.zh_CN.grid.header.Container", {
- override: "Ext.grid.header.Container",
- sortClearText: '不排序',
- sortAscText: "正序",
- sortDescText: "倒序",
- lockText: "锁定列",
- unlockText: "解除锁定",
- columnsText: "字段隐藏"
- });
- Ext.define("Ext.locale.zh_CN.grid.filters.filter.Date", {
- override: "Ext.grid.filters.filter.Date",
- fields: {
- lt: { text: '之前' },
- gt: { text: '之后' },
- eq: { text: '相等' },
- },
- // Defaults to Ext.Date.defaultFormat
- dateFormat: null
- });
- // Ext.grid.locking.Lockable.prototype.unlockText = '解锁'
- // Ext.grid.locking.Lockable.prototype.lockText = '锁定'
- // Ext.grid.filters.Filters.prototype.menuFilterText = "过滤"
- Ext.define("Ext.locale.zh_CN.grid.locking.Lockable", {
- override: "Ext.grid.locking.Lockable",
- lockText: "锁定",
- unlockText: '解锁',
- });
- Ext.define("Ext.locale.zh_CN.grid.filters.Filters", {
- override: "Ext.grid.filters.Filters",
- menuFilterText: "过滤"
- });
- Ext.define("Ext.locale.zh_CN.grid.filters.filter.Boolean", {
- override: "Ext.grid.filters.filter.Boolean",
- yesText: "已钩选",
- noText: "未勾选"
- });
- Ext.define("Ext.locale.zh_CN.grid.filters.filter.String", {
- override: "Ext.grid.filters.filter.String",
- emptyText: "输入过滤文本..."
- });
- Ext.define("Ext.locale.zh_CN.grid.filters.filter.Number", {
- override: "Ext.grid.filters.filter.Number",
- emptyText: "输入数字..."
- });
- Ext.define("Ext.locale.zh_CN.toolbar.Paging", {
- override: "Ext.PagingToolbar",
- beforePageText: "第",
- // update
- afterPageText: "/ {0} 页",
- // update
- firstText: "第一页",
- prevText: "上一页",
- // update
- nextText: "下一页",
- lastText: "最后页",
- refreshText: "刷新",
- displayMsg: "总共 {2} 条",
- // update
- emptyMsg: '没有数据'
- });
- /**
- * 改变事件的获取方式.
- * 具体见: ext-all-debug.js:23216 addListener
- * https://docs.sencha.com/extjs/6.6.0/classic/Ext.util.Observable.html#method-addListener
- * https://docs.sencha.com/extjs/6.6.0/classic/src/Observable.js.html#Ext.mixin.Observable-method-addListener
- */
- var _doAddListener = Ext.mixin.Observable.prototype.doAddListener;
- Ext.mixin.Observable.prototype.doAddListener = function (ename, fn, scope, options, order, caller, manager) {
- if (typeof fn === 'string' &&
- (_$2.startsWith(fn, 'scope.') ||
- _$2.startsWith(fn, 'system.') ||
- _$2.startsWith(fn, 'format.'))) {
- scope = lookupScope(this);
- if (isDesignMode(scope, undefined)) {
- fn = Ext.emptyFn;
- }
- else {
- // console.log('doAddListener', ename, fn, scope, options, order, caller, manager)
- // const vm = this.lookupViewModel()
- // if (vm && vm.yvanScope) {
- // scope = vm.yvanScope
- // fn = scope[fn.substr('scope.'.length)]
- // }
- fn = lookupFn(scope, fn, this);
- }
- }
- _doAddListener.call(this, ename, fn, scope, options, order, caller, manager);
- };
- // 将 SystemLib 扩展到 window.system 下
- if (!window['system']) {
- window['system'] = {};
- }
- _$2.extend(window['system'], SystemLib);
- _$2.extend(window['system'], {
- showGridRowDetail: showGridRowDetail
- });
- Ext.apply(Ext.util.Format, {
- // 百分比
- percentRenderer: function (v, rd, model) {
- if (!v) {
- v = 0;
- }
- if (typeof v === 'string') {
- v = parseInt(v);
- }
- var valueString = v.toFixed(2);
- var valueFixed = v > 100 ? 100 : v;
- valueFixed = valueFixed < 0 ? 0 : valueFixed;
- var cls = '';
- if (v < 90) {
- cls = 'danger';
- }
- else if (v < 100) {
- cls = 'warning';
- }
- else {
- cls = 'success';
- }
- return Ext.String
- .format(
- // '<div>'
- // + '<div style="float:left;width:100%; background:#ECECEC;border:none">'
- // + '<div style="float:left;text-align:center;width:100%;color:#fff;line-height:24px;font-size:13px;">{0}%</div>'
- // + '<div style="width:{1}%;height:24px;" class="progress-{2}"></div>'
- // + '</div></div>', valueString, valueFixed, cls);
- '<div class="x-progress x-progress-default x-widthed" style="width: 100%;"><div class="x-progress-text x-progress-text-back" style="width:100%;">{0}%</div><div class="x-progress-bar progress-{1}" style="width: {2}%;"><div class="x-progress-text" style="width: {3}%">{4}%</div></div></div>', valueString, cls, valueFixed, ((100 / valueFixed) * 100), valueString); // .format(
- // '<div>'
- // + '<div style="float:left;border:1px solid #008000;height:15px;width:100%;">'
- // + '<div style="float:left;text-align:center;width:100%;color:blue;">{0}%</div>'
- // + '<div style="background: #FAB2{2};width:{1}%;height:13px;"></div>'
- // + '</div></div>', v, valueFixed, valueString);
- },
- //button
- button: function (v, rd, model) {
- return "<input style=\"color:#fff\" type=\"button\" value=\"" + v + "\" class=\"area-tag\" />";
- }
- });
- initComponent();
- initPanel();
- initGridColumn();
- initTree();
- initGrid();
- initMainTab();
- initTextfield();
- initCombo();
- initTag();
- initContainer();
- initRows();
- initCols();
- initForm();
- initToolbar();
- initSplitter();
- initButton();
- initStores();
- initSearch();
- initMultipleSearch();
- initDate();
- initDateTimePicker();
- initDateTime();
- initNumber();
- initCheckbox();
- initCheckboxGroup();
- initRadio();
- initRadioGroup();
- initFieldset();
- initCombotree();
- initPickerPlus();
- initCombogrid();
- initComboGridMulti();
- initIframe();
- initBpmn();
- initSqlEditor();
- initJsonEditor();
- initJsEditor();
- initClipboard();
- initSqlComplex();
- initParamComplex();
- initDict();
- initDesigner();
- }
- //# sourceMappingURL=init.js.map
- /**
- * 创建一个 Ajax 客户端
- */
- function createAjax(createOption) {
- if (createOption.baseUrl) {
- axios__default.defaults.baseURL = createOption.baseUrl;
- axios__default.defaults.timeout = createOption.timeout;
- storeAjax.timeout = createOption.timeout;
- axios__default.defaults.timeoutErrorMessage = '网络超时';
- }
- return function (option) {
- //@ts-ignore
- option.method = (option.method || 'get').toLocaleLowerCase();
- //@ts-ignore
- var ax = __assign({}, option);
- switch (option.method) {
- case 'get':
- ax.method = 'GET';
- ax.params = option.param;
- ax.headers = __assign({}, option.headers);
- break;
- case 'post':
- ax.method = 'POST';
- ax.headers = __assign({ 'Content-Type': 'application/x-www-form-urlencoded' }, option.headers);
- ax.params = option.param;
- ax.data = Qs.stringify(option.data);
- break;
- case 'put':
- case 'patch':
- case 'delete':
- ax.method = option.method;
- ax.headers = option.headers;
- ax.params = option.param;
- ax.data = Qs.stringify(option.data);
- break;
- case 'download':
- downLoad(createOption.baseUrl + option.url, option.fileName || 'file', option.data, option.headers);
- return new Promise(function (resolver, reject) {
- });
- case "invoke":
- ax.url = serverInvokeUrlTransform(option.url, option);
- ax.method = 'POST';
- ax.headers = __assign({ 'Content-Type': 'application/json' }, option.headers);
- if (typeof option.args === 'object') {
- ax.data = JSON.stringify({
- args: option.args,
- });
- }
- else {
- ax.data = JSON.stringify({
- args: [
- __assign(__assign({}, option.data), option.param)
- ],
- filterModel: option.filterModel,
- sortModel: option.sortModel
- });
- }
- break;
- case 'post-json':
- ax.method = 'POST';
- ax.headers = __assign({ 'Content-Type': 'application/json' }, option.headers);
- ax.data = JSON.stringify(__assign(__assign({}, option.data), { filterModel: option.filterModel, sortModel: option.sortModel }));
- break;
- case 'post-file':
- //TODO 刘壮. 上传文件
- var forms = new FormData();
- ax.headers = __assign({ 'Content-Type': 'multipart/form-data' }, option.headers);
- _$2.forOwn(option.data, function (value, key) {
- if (key === 'files') {
- var i_1 = 0;
- _$2.each(value, function (f) {
- // @ts-ignore
- forms.append('file' + (++i_1), f);
- });
- }
- else {
- forms.append(key, value);
- }
- });
- ax.data = forms;
- ax.method = 'POST';
- break;
- case "sql":
- ax.url = sqlUrlTransform(option.url);
- ax.method = 'POST';
- ax.headers = __assign({ 'Content-Type': 'application/json' }, option.headers);
- ax.data = JSON.stringify({
- args: [option.data],
- db: option.db,
- filterModel: option.filterModel,
- sortModel: option.sortModel
- });
- break;
- default:
- throw new Error('not implements');
- }
- return new Promise(function (resolver, reject) {
- axios__default(ax).then(function (resolverRaw) {
- var apiResult = {
- rawData: resolverRaw.data,
- status: resolverRaw.status,
- success: (resolverRaw.data && resolverRaw.data.success),
- data: resolverRaw.data.data,
- pagination: resolverRaw.data.pagination,
- msg: (resolverRaw.data.msg),
- errors: resolverRaw.data.errors,
- headers: resolverRaw.headers
- };
- if (typeof window['apiTranslate'] === 'function') {
- window['apiTranslate'](apiResult.rawData, option.url);
- }
- resolver(apiResult);
- }).catch(function (reason) {
- reject(reason);
- });
- });
- };
- }
- function downLoad(downLoadUrl, filename, data, header, isJson) {
- if (isJson === void 0) { isJson = false; }
- var YvanUI = _$2.get(window, 'YvanUI');
- YvanUI.loading();
- var createObjectURL = function (object) {
- return (window.URL) ? window.URL.createObjectURL(object) : _$2.get(window, 'webkitURL').createObjectURL(object);
- };
- // const formData = new FormData();
- // _.forOwn(data, (v, k) => {
- // formData.append(k, v);
- // });
- var formData = '';
- var xhr = new XMLHttpRequest();
- xhr.open('POST', downLoadUrl);
- xhr.responseType = 'blob';
- // xhr.setRequestHeader('Authorization', $.cookie('auth'))
- if (isJson) {
- formData = data ? JSON.stringify(data) : '';
- xhr.setRequestHeader('Content-Type', 'application/json');
- }
- else {
- formData = data ? Qs.stringify(data) : '';
- xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- }
- //
- if (header) {
- _$2.forOwn(header, function (v, k) {
- xhr.setRequestHeader(k, v);
- });
- }
- xhr.onload = function (e) {
- if (this.status === 200) {
- var blob = this.response;
- if (_$2.hasIn(window, 'navigator.msSaveOrOpenBlob')) {
- navigator.msSaveBlob(blob, filename);
- YvanUI.clearLoading();
- }
- else {
- var a = document.createElement('a');
- var url = createObjectURL(blob);
- a.href = url;
- a.download = filename;
- document.append(a);
- a.click();
- a.remove();
- window.URL.revokeObjectURL(url);
- YvanUI.clearLoading();
- }
- }
- };
- xhr.send(formData);
- }
- //# sourceMappingURL=ajax.js.map
- function readExcel(file) {
- return new Promise(function (resolve, reject) {
- if (!file) {
- reject("文件读取失败!!!");
- return;
- }
- var reader = new FileReader();
- reader.onload = function (e) {
- if (e.target) {
- var data = e.target.result;
- var workbook = XLSX.read(data, { type: 'binary' });
- resolve(workbook);
- }
- else {
- reject("文件读取失败!!!");
- }
- };
- try {
- reader.readAsBinaryString(file);
- }
- catch (e) {
- reject(e);
- }
- });
- }
- function readExcelWithColumnsSet(topScope, file, columnsSet, dataStartRow, titleRowNumber, rowValidate, otherValidate, fieldValidate) {
- if (dataStartRow === void 0) { dataStartRow = 2; }
- if (titleRowNumber === void 0) { titleRowNumber = 1; }
- if (rowValidate === void 0) { rowValidate = undefined; }
- if (otherValidate === void 0) { otherValidate = undefined; }
- if (fieldValidate === void 0) { fieldValidate = undefined; }
- return new Promise(function (resolve, reject) {
- var promiseArr = [];
- for (var i = 0; i < columnsSet.length; i++) {
- var fix = columnsSet[i].fix;
- if (_$2.isArray(fix) && fix.length > 0) {
- var ss = fix[0].toLowerCase();
- if (ss.indexOf("date") > -1 || ss.indexOf("time") > -1) {
- columnsSet[i].importFormatter = function (vdata) {
- // @ts-ignore
- return window.moment(vdata.ov) - 0;
- };
- }
- else {
- var fn = lookupFn(topScope, fix[0]);
- promiseArr.push(fn(null, columnsSet[i]));
- delete columnsSet[i].fix;
- }
- }
- else if (_$2.isString(fix)) {
- var ss = fix.toLowerCase();
- if (ss.indexOf("date") > -1 || ss.indexOf("time") > -1) {
- columnsSet[i].importFormatter = function (vdata) {
- // @ts-ignore
- return window.moment(vdata.ov) - 0;
- };
- }
- else {
- var fn = lookupFn(topScope, fix);
- promiseArr.push(fn(null, columnsSet[i]));
- delete columnsSet[i].fix;
- }
- }
- }
- var read = function () {
- readExcel(file).then(function (workbook) {
- var sheetNames = workbook.SheetNames; // 工作表名称集合
- var worksheet = workbook.Sheets[sheetNames[0]]; // 这里我们只读取第一张sheet
- var titleRowValue = [];
- var titleRowKey = [];
- var needLoop = false; // 是否需要迭代
- var columns = [];
- if (worksheet && worksheet["!ref"]) {
- var t = worksheet["!ref"];
- var tempArr = t.split(':');
- if (tempArr.length >= 2) {
- var firstRowNumber = tempArr[0].replace(/[^0-9]/ig, "");
- // 选取title的行,删除之前的行
- if (titleRowNumber > firstRowNumber) {
- for (var i = firstRowNumber; i < titleRowNumber; i++) {
- for (var key in worksheet) {
- if (key.endsWith(i) && key.replace(/[^0-9]/ig, "") === i) {
- delete worksheet[key];
- }
- }
- }
- var fc = tempArr[0].replace(/[^a-z]/ig, "");
- firstRowNumber = titleRowNumber + '';
- worksheet["!ref"] = fc + firstRowNumber + ":" + tempArr[1];
- }
- var lastRowNumber = tempArr[1].replace(/[^0-9]/ig, "");
- // const firstColNumber = tempArr[0].split(''+firstRowNumber)[0];
- // const lastColNumber = tempArr[1].split(''+lastRowNumber)[0];
- for (var key in worksheet) {
- if (key.endsWith(firstRowNumber) && key.replace(/[^0-9]/ig, "") === firstRowNumber) {
- titleRowKey.push(key);
- titleRowValue.push(worksheet[key].v);
- }
- }
- if (columnsSet && columnsSet.length > 0) {
- var length = columnsSet.length;
- length = length <= titleRowKey.length ? length : titleRowKey.length;
- for (var i = 0; i < length; i++) {
- var vk = titleRowKey[i];
- var item = columnsSet[i];
- var column = {};
- if (typeof item === 'string') {
- column.dataIndex = item;
- column.header = worksheet[vk].v;
- worksheet[vk] = { t: "s", v: item, h: item, w: item };
- }
- else if (typeof item.dataIndex === "string") {
- column.dataIndex = item.dataIndex;
- column.header = worksheet[vk].v;
- worksheet[vk] = { t: "s", v: item.dataIndex, h: item.dataIndex, w: item.dataIndex };
- if (typeof item.validate === "function") {
- column.validate = item.validate;
- needLoop = true;
- }
- if (typeof item.importFormatter === "function") {
- column.importFormatter = item.importFormatter;
- needLoop = true;
- }
- if ((item.data instanceof Array && item.data.length > 0)
- || _$2.isPlainObject(item.data) && Object.keys(item.data).length > 0) {
- column.data = item.data;
- needLoop = true;
- }
- }
- columns.push(column);
- }
- }
- }
- }
- if (fieldValidate && typeof fieldValidate === "function") {
- if (fieldValidate(columns, titleRowValue) !== true) {
- reject("fields validate error");
- return;
- }
- }
- var allData = XLSX.utils.sheet_to_json(worksheet);
- var okData = [], errorData = [], errorMsgData = [];
- var needItemLoop = needLoop;
- if (rowValidate && typeof rowValidate === "function") {
- needLoop = true;
- }
- if (needLoop === true) {
- for (var index = 0; index < allData.length; index++) {
- var row = allData[index];
- var rowNumber = dataStartRow + index;
- row.__importID__ = rowNumber;
- var isRowOk = true;
- if (needItemLoop) {
- var _loop_1 = function (num) {
- var column = columns[num];
- var ov = row[column.dataIndex];
- var nv = ov;
- var hasError = false;
- var rowNumber_1 = dataStartRow + index;
- var ei = {
- errorId: rowNumber_1 + '_' + column.dataIndex,
- importID: rowNumber_1,
- dataIndex: column.dataIndex,
- header: column.header,
- value: ov,
- errormessage: ""
- };
- // 格式化
- if (column.data instanceof Array) {
- nv = undefined;
- ei.errormessage = "字典匹配失败";
- _$2.forEach(column.data, function (v, index) {
- if (v.text === ov) {
- nv = v.id;
- return;
- }
- });
- }
- else if (_$2.isPlainObject(column.data)) {
- nv = undefined;
- ei.errormessage = "字典匹配失败";
- _$2.forEach(column.data, function (value, key) {
- if (value === ov) {
- nv = key;
- return;
- }
- });
- }
- if (typeof column.importFormatter === 'function') {
- var vdata = {
- column: column,
- ov: ov,
- nv: nv,
- rowIndex: index,
- data: row,
- rowDatas: allData
- };
- nv = undefined;
- ei.errormessage = "格式化失败";
- nv = column.importFormatter(vdata);
- }
- if (!nv && nv != 0) {
- hasError = true;
- }
- else {
- row[column.dataIndex] = nv;
- ei.errormessage = "";
- }
- // 校验
- if (typeof column.validate === 'function') {
- var vdata = {
- column: column,
- ov: ov,
- nv: nv,
- rowIndex: index,
- data: row,
- rowDatas: allData
- };
- var errormessage = column.validate(vdata);
- if (errormessage === true) ;
- else {
- hasError = true;
- ei.errormessage = ei.errormessage + "/" + errormessage;
- }
- }
- if (hasError === true) {
- isRowOk = false;
- errorMsgData.push(ei);
- }
- };
- for (var num = 0; num < columns.length; num++) {
- _loop_1(num);
- }
- }
- if (rowValidate && typeof rowValidate === "function") {
- var errormessage = rowValidate({
- columns: columns,
- data: row,
- rowIndex: index,
- rowDatas: allData
- });
- if (errormessage === true) ;
- else {
- isRowOk = false;
- var ei = {
- errorId: rowNumber + '',
- dataIndex: "row",
- header: "数据行",
- value: "当前行的数据",
- importID: rowNumber,
- errormessage: errormessage
- };
- errorMsgData.push(ei);
- }
- }
- row.__hasError__ = !isRowOk;
- if (isRowOk === true) {
- okData.push(row);
- }
- else {
- errorData.push(row);
- }
- }
- }
- else {
- // 添加数据的唯一标识
- for (var index = 0; index < allData.length; index++) {
- var row = allData[index];
- var rowNumber = dataStartRow + index;
- row.__importID__ = rowNumber;
- row.__hasError__ = false;
- }
- okData = allData;
- }
- if (otherValidate && typeof otherValidate === "function") {
- otherValidate({ allData: allData, okData: okData, errorData: errorData, errorMsgData: errorMsgData }, resolve);
- }
- else {
- resolve({ allData: allData, okData: okData, errorData: errorData, errorMsgData: errorMsgData });
- }
- // clearLoading()
- }).catch(function (e) {
- reject(e);
- });
- };
- if (promiseArr.length > 0) {
- Promise.all(promiseArr).then(function (resArr) {
- for (var i = 0; i < resArr.length; i++) {
- var tmp = resArr[i];
- tmp.config.data = [];
- if (tmp && tmp.r && Array.isArray(tmp.r.field) && Array.isArray(tmp.r.data)) {
- if (tmp.r.field.length > 1) {
- var keyKey = tmp.r.field[0];
- var valueKey = tmp.r.field[1];
- for (var j = 0; j < tmp.r.data.length; j++) {
- var it = tmp.r.data[j];
- var newIt = {};
- newIt.id = it[keyKey];
- newIt.text = it[valueKey];
- tmp.config.data.push(newIt);
- }
- }
- }
- }
- read();
- });
- }
- else {
- setTimeout(read, 50);
- }
- });
- }
- //# sourceMappingURL=xlsx.js.map
- var ExcelImportDialog = /** @class */ (function (_super) {
- __extends(ExcelImportDialog, _super);
- function ExcelImportDialog(option) {
- var _this = this;
- var vjson = vjsonFunc(option);
- _this = _super.call(this, { model: model$d, vjson: vjson }) || this;
- _this.importExcelOption = option;
- return _this;
- }
- ExcelImportDialog.prototype.onLoad = function () {
- _super.prototype.onLoad.call(this);
- };
- ExcelImportDialog.prototype.fileChange = function (sender) {
- var _this = this;
- var file = sender.fileInputEl.dom.files[0];
- // const senderScope = lookupScope(sender)
- var topScope = this.topScope;
- var rowValidate = this.importExcelOption.rowValidate;
- if (this.importExcelOption.rowValidate && typeof this.importExcelOption.rowValidate === 'string') {
- rowValidate = lookupFn(topScope, this.importExcelOption.rowValidate).bind(topScope);
- }
- var afterClientValidate = this.importExcelOption.afterClientValidate;
- if (this.importExcelOption.afterClientValidate && typeof this.importExcelOption.afterClientValidate === 'string') {
- afterClientValidate = lookupFn(topScope, this.importExcelOption.afterClientValidate).bind(topScope);
- }
- var fieldValidate = this.importExcelOption.fieldValidate;
- if (this.importExcelOption.fieldValidate && typeof this.importExcelOption.fieldValidate === 'string') {
- fieldValidate = lookupFn(topScope, this.importExcelOption.fieldValidate).bind(topScope);
- }
- this.setLoading(true);
- readExcelWithColumnsSet(topScope, file, this.importExcelOption.columns, this.importExcelOption.dataStartRow, this.importExcelOption.titleRowNumber, rowValidate, afterClientValidate, fieldValidate).then(function (res) {
- _this.importData = res;
- _this.refs.dataGrid.setData(res.allData);
- _this.viewModel.set("dataCount", res.allData.length);
- _this.refs.errGrid.setData(res.errorMsgData);
- _this.viewModel.set("errMsgCount", res.errorMsgData.length);
- }).catch(function (e) {
- _this.importData = null;
- _this.refs.dataGrid.setData();
- _this.refs.errGrid.setData();
- msg(e.toString());
- }).finally(function () {
- _this.setLoading(false);
- });
- };
- ExcelImportDialog.prototype.getDataGridRowRecord = function (record, rowIndex, rowParams, store) {
- if (record.get('__hasError__')) {
- return "x-grid-record-bg-red";
- }
- };
- ExcelImportDialog.prototype.getErrGridRowRecord = function (record, rowIndex, rowParams, store) {
- return "x-grid-record-bg-red";
- };
- ExcelImportDialog.prototype.dataGridClick = function (sender, td, cellIndex, record, item, index, e, eOpts) {
- var _a;
- var id = record.data.__importID__;
- var subId = this.refs.dataGrid.headerCt.getGridColumns()[cellIndex].dataIndex;
- var selectRecord = null;
- var dataIndex = -1;
- var rows = (_a = this.refs.errGrid.getStore().getData().items) === null || _a === void 0 ? void 0 : _a.map(function (r) { return r.data; });
- for (var i = 0; i < rows.length; i++) {
- if (rows[i].importID === id) {
- selectRecord = this.refs.errGrid.getStore().getAt(i);
- dataIndex = i;
- }
- if (rows[i].errorId === id + "_" + subId) {
- selectRecord = this.refs.errGrid.getStore().getAt(i);
- dataIndex = i;
- break;
- }
- }
- if (selectRecord) {
- this.refs.errGrid.ensureVisible(selectRecord);
- this.refs.errGrid.selModel.select(dataIndex);
- // this.refs.errGrid.reload()
- }
- };
- ExcelImportDialog.prototype.errGridClick = function (sender, record, item, index, e, eOpts) {
- var _a;
- var id = record.data.importID;
- var rows = (_a = this.refs.dataGrid.getStore().getData().items) === null || _a === void 0 ? void 0 : _a.map(function (r) { return r.data; });
- var selectRecord = null;
- var dataIndex = -1;
- for (var i = 0; i < rows.length; i++) {
- if (rows[i].__importID__ === id) {
- selectRecord = this.refs.dataGrid.getStore().getAt(i);
- dataIndex = i;
- break;
- }
- }
- if (selectRecord) {
- this.refs.dataGrid.ensureVisible(selectRecord);
- this.refs.dataGrid.selModel.select(dataIndex);
- // this.refs.dataGrid.reload()
- }
- };
- ExcelImportDialog.prototype.filterData = function (sender, newValue, oldValue, eOpts) {
- this.viewModel.set("dataType", newValue);
- if (this.importData) {
- this.refs.dataGrid.setData(this.importData[newValue]);
- this.viewModel.set("dataCount", this.importData[newValue].length);
- }
- };
- ExcelImportDialog.prototype.downloadTemplate = function (sender) {
- if (this.importExcelOption.dowLoadUrl && this.importExcelOption.dowLoadUrl.length > 0) {
- window.location.href = this.importExcelOption.dowLoadUrl;
- return;
- }
- var xt = [];
- _$2.forEach(this.importExcelOption.columns, function (v) {
- xt.push(v.header);
- });
- var filename = this.importExcelOption.templateName ? this.importExcelOption.templateName : "模版"; //文件名称
- if (filename.endsWith(".xlsx")) {
- filename = filename.split(".xlsx")[0];
- }
- filename = filename + ".xlsx";
- var ws_name = "Sheet1"; //Excel第一个sheet的名称
- var wb = XLSX.utils.book_new(), ws = XLSX.utils.aoa_to_sheet([xt]);
- XLSX.utils.book_append_sheet(wb, ws, ws_name); //将数据添加到工作薄
- XLSX.writeFile(wb, filename); //导出Excel
- };
- ExcelImportDialog.prototype.getData = function (sender) {
- _$2.each(this.importData.okData, function (item) {
- delete item.id;
- delete item.__hasError__;
- delete item.__importID__;
- delete item._origin;
- });
- _$2.each(this.importData.allData, function (item) {
- delete item.id;
- delete item.__hasError__;
- delete item.__importID__;
- delete item._origin;
- });
- _$2.each(this.importData.errorData, function (item) {
- delete item.id;
- delete item.__hasError__;
- delete item.__importID__;
- delete item._origin;
- });
- this.dialogSuccess(this.importData);
- };
- return ExcelImportDialog;
- }(Scope));
- var model$d = {
- data: {
- dataType: "all",
- errMsgCount: 0,
- dataCount: 0
- }
- };
- var vjsonFunc = function (option) {
- return {
- title: option.title || 'excel导入',
- layout: 'fit',
- items: [
- {
- layout: 'border',
- tbar: {
- xtype: "form",
- items: [
- {
- xtype: "cols",
- items: [
- {
- xtype: "filefield",
- fieldLabel: 'excel文件',
- buttonText: '请选择excel文件',
- accept: ".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",
- flex: 3,
- listeners: {
- change: "scope.fileChange"
- }
- }, {
- xtype: "button",
- iconCls: "x-fa fa-download",
- text: "下载模版",
- listeners: {
- click: "scope.downloadTemplate"
- }
- }, {
- xtype: 'container',
- border: false,
- layout: 'hbox',
- }, {
- xtype: "button",
- iconCls: "x-fa fa-upload",
- text: option.tQButtonText || "提取数据",
- listeners: {
- click: "scope.getData"
- }
- }
- ]
- },
- ]
- },
- items: [
- {
- tbar: {
- xtype: "toolbar",
- title: "导入的数据",
- items: [{
- xtype: 'label',
- html: '<span style="font-size: 14px; font-weight: bold">导入的数据</span>',
- }, {
- xtype: 'radiogroup',
- items: [
- {
- boxLabel: '所有数据',
- checked: true,
- inputValue: 'allData',
- }, {
- boxLabel: '正确数据',
- inputValue: 'okData',
- }, {
- boxLabel: '错误数据',
- inputValue: 'errorData',
- }
- ],
- listeners: {
- change: 'scope.filterData',
- },
- }, {
- xtype: "textfield",
- readOnly: true,
- fieldLabel: "条目数",
- bind: "{dataCount}"
- }]
- },
- xtype: 'yvgrid',
- reference: 'dataGrid',
- layout: 'fit',
- pagination: false,
- // pageSize: 50,
- getRowClass: 'scope.getDataGridRowRecord',
- columns: option.columns,
- region: 'center',
- split: true,
- listeners: {
- cellclick: "scope.dataGridClick",
- },
- selModel: {
- // type: 'rowmodel',
- mode: 'SINGLE',
- },
- }, {
- tbar: {
- xtype: "toolbar", items: [
- {
- xtype: 'label',
- html: '<span style="font-size: 14px; font-weight: bold; color: red">错误信息</span>',
- }, {
- xtype: "textfield",
- readOnly: true,
- fieldLabel: "条目数",
- bind: "{errMsgCount}"
- }
- ]
- },
- xtype: 'yvgrid',
- reference: 'errGrid',
- layout: 'fit',
- pagination: false,
- getRowClass: 'scope.getErrGridRowRecord',
- height: "40%",
- columns: [
- { dataIndex: "errorId", header: "ID", hidden: true },
- { dataIndex: "importID", header: "行号", width: 80 },
- { dataIndex: "errormessage", header: "错误信息", width: 200 },
- { dataIndex: "value", header: "值", width: 120 },
- { dataIndex: "header", header: "字段名", width: 120 },
- { dataIndex: "dataIndex", header: "字段", width: 120 }
- ],
- region: 'south',
- split: true,
- listeners: {
- itemclick: "scope.errGridClick"
- },
- selModel: {
- // type: 'rowmodel',
- mode: 'SINGLE',
- },
- },
- ],
- },
- ],
- referenceHolder: true,
- };
- };
- //# sourceMappingURL=ExcelImportDialog.js.map
- function buildReportScope(config, reportId, invokeServerFn, getDictFnName) {
- var _a = buildVjson$1(config, invokeServerFn, getDictFnName), model = _a.model, vjson = _a.vjson, report = _a.report;
- var ret = new ReportScope({ model: model, vjson: vjson }, invokeServerFn);
- ret.report_id = reportId;
- ret.report = report;
- return ret;
- }
- function buildVjson$1(config, invokeServerFn, getDictFnName) {
- var e_1, _a, e_2, _b;
- var model = {
- data: {
- report_name: config.report_name,
- query: {},
- sum: {},
- }
- };
- var json5 = window['YvanUI'].json5;
- var report = config.report ? json5.parse(config.report) : {};
- var conditionRows = [];
- var sumRows = [];
- model.data.has_sum = _$2.size(report.summary) > 0;
- // query 查询条件
- var newRow = false;
- var currentRow = { xtype: 'cols', items: [], };
- conditionRows.push(currentRow);
- _$2.forEach(report.query, function (item) {
- if (newRow) {
- currentRow = { xtype: 'cols', items: [], };
- conditionRows.push(currentRow);
- }
- var vj = json5.parse(item.conditionFieldExtend);
- if (item.conditionFieldXtype) {
- vj.xtype = item.conditionFieldXtype;
- if (item.conditionFieldXtype === 'combo') {
- vj.fix = ['system.' + getDictFnName + '("' + item.conditionFieldDict + '")'];
- }
- if (item.conditionFieldXtype === 'datetimefield') {
- //@ts-ignore
- _$2.set(model.data.query, item.conditionFieldBind, moment(window.getServerTime()).format('YYYY-MM-DD HH:mm:ss'));
- }
- else if (item.conditionFieldXtype === 'datefield') {
- //@ts-ignore
- _$2.set(model.data.query, item.conditionFieldBind, moment(window.getServerTime()).format('YYYY-MM-DD'));
- }
- else {
- model.data.query[item.conditionFieldBind] = '';
- }
- }
- else {
- // 没有组件类型,是个空占位符
- vj.border = false;
- }
- if (item.conditionFieldBind) {
- vj.bind = {
- value: '{query.' + item.conditionFieldBind + '}'
- };
- }
- if (item.conditionFieldFlex) {
- vj.flex = item.conditionFieldFlex;
- }
- if (item.conditionFieldXtype) {
- vj.fieldLabel = item.conditionFieldLabel;
- }
- if (item.fieldLabel) {
- vj.fieldLabel = item.fieldLabel;
- }
- newRow = item.conditionFieldWrap || false;
- currentRow.items.push(vj);
- });
- if (currentRow) {
- currentRow.margin = '10 0 10 0';
- }
- // sum 汇总条件
- newRow = true;
- try {
- for (var _c = __values(report.summary), _d = _c.next(); !_d.done; _d = _c.next()) {
- var item = _d.value;
- if (newRow) {
- currentRow = {
- xtype: 'cols',
- defaultType: 'displayfield',
- defaults: {
- labelWidth: 70,
- },
- items: []
- };
- sumRows.push(currentRow);
- }
- var vj = __assign({}, json5.parse(item.sumFieldExtend));
- if (item.sumFieldBind) {
- vj.bind = '{sum.' + item.sumFieldBind + '}';
- model.data.sum[item.sumFieldBind] = '';
- }
- else {
- // 没有组件类型,是个空占位符
- vj.border = false;
- }
- if (item.sumFieldFlex) {
- vj.flex = item.sumFieldFlex;
- }
- if (item.sumFieldLabel) {
- vj.fieldLabel = item.sumFieldLabel;
- }
- // sumFieldBind: "zs"
- // sumFieldExtend: "{}"
- // sumFieldFlex: 1
- // sumFieldLabel: "总数"
- // sumFieldWrap: false
- newRow = item.sumFieldWrap || false;
- currentRow.items.push(vj);
- }
- }
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
- finally {
- try {
- if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
- }
- finally { if (e_1) throw e_1.error; }
- }
- if (currentRow) {
- currentRow.margin = '10 0 10 0';
- }
- // column 结果字段
- var columns = [];
- try {
- for (var _e = __values(report.columns), _f = _e.next(); !_f.done; _f = _e.next()) {
- var item = _f.value;
- var vj = __assign({ dataIndex: item.dataIndex, header: item.header, hidden: item.hidden, sortable: item.sortable, filterable: item.filterable }, json5.parse(item.fieldExtend));
- if (item.xtype) {
- if (item.xtype == 'checkbox') {
- vj.xtype = 'checkcolumn';
- vj.disabled = true;
- }
- else {
- vj.xtype = item.xtype;
- }
- }
- if (item.dataType) {
- vj.dataType = item.dataType;
- }
- if (item.align) {
- vj.align = item.align;
- }
- if (item.width) {
- vj.width = item.width;
- }
- if (item.dict) {
- vj.fix = ['system.' + getDictFnName + '("' + item.dict + '")'];
- }
- columns.push(vj);
- }
- }
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
- finally {
- try {
- if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
- }
- finally { if (e_2) throw e_2.error; }
- }
- var vjson = {
- bind: {
- title: '{report_name}',
- },
- layout: 'fit',
- referenceHolder: true,
- items: [
- {
- layout: 'border',
- border: false,
- items: [
- {
- region: 'north',
- border: false,
- tbar: {
- xtype: 'toolbar',
- border: false,
- items: [
- {
- xtype: 'button',
- text: '查询',
- reference: 'btnSearch',
- iconCls: 'x-fa fa-search',
- listeners: {
- click: 'scope.reload',
- },
- },
- {
- xtype: 'button',
- text: '关闭',
- iconCls: 'x-fa fa-times',
- listeners: {
- click: 'system.closeMe()',
- },
- },
- ],
- },
- defaults: {
- margin: '8 0 0 0'
- },
- items: __spread(conditionRows, sumRows),
- fix: ['system.enterToClick("btnSearch")'],
- },
- __assign({ region: 'center', xtype: 'yvgrid', reference: 'grid1', border: false, selModel: { selType: 'rowmodel', mode: 'SINGLE', }, autoLoad: false, dataSource: {
- method: 'invoke',
- url: '/report/Report@execute',
- params: {
- dataSource: report.dataSource,
- pagination: report.grid.pagination || true,
- report_id: config.report_id,
- query: '{query}',
- },
- }, columns: columns }, report.grid),
- ],
- },
- ],
- };
- return { model: model, vjson: vjson, report: report };
- }
- var ReportScope = /** @class */ (function (_super) {
- __extends(ReportScope, _super);
- function ReportScope(_a, invokeServerFn) {
- var model = _a.model, vjson = _a.vjson;
- var _this = _super.call(this, { model: model, vjson: vjson, i18n: null }) || this;
- _this.invokeServerFn = invokeServerFn;
- return _this;
- }
- ReportScope.prototype.onLoad = function () {
- // this.reload()
- };
- ReportScope.prototype.reload = function () {
- var _this = this;
- // http://127.0.0.1:8095/api/com/galaxis/wms/report/Report@executeSum
- if (this.viewModel.get('has_sum')) {
- this.invokeServerFn('/report/Report@executeSum', {
- dataSource: this.report.dataSource,
- report_id: this.report_id,
- query: this.viewModel.get('query'),
- }).then(function (res) {
- if (!res.success) {
- showErrorDialog$1(res.msg);
- }
- else {
- window['system'].mergeViewModel(_this.viewModel, 'sum', res.data, false);
- }
- });
- }
- this.refs.grid1.reload();
- };
- return ReportScope;
- }(Scope));
- //# sourceMappingURL=Report.js.map
- var model$e = {
- data: {
- form: {
- resource_parent: '',
- resource_name: '',
- resource_icon: '',
- scope_url: '',
- scope_params: '',
- resource_order: '',
- permission_code: '',
- },
- }
- };
- //# sourceMappingURL=RegisterModule.model.js.map
- var vjson$d = {
- title: '注册模块',
- layout: 'fit',
- width: "40%",
- height: "50%",
- fbar: {
- xtype: 'toolbar',
- items: [
- {
- xtype: "button",
- text: "确定",
- iconCls: 'x-fa fa-check',
- listeners: {
- click: 'scope.saveNode',
- }
- },
- {
- xtype: "button",
- text: "关闭",
- iconCls: 'x-fa fa-times',
- listeners: {
- click: 'system.closeMe()',
- }
- },
- ]
- },
- items: [
- {
- layout: 'border',
- items: [
- {
- region: 'west',
- layout: 'fit',
- xtype: 'tabpanel',
- reference: 'tabs',
- width: "50%",
- split: true,
- listeners: {
- tabchange: 'scope.tabchange',
- },
- items: [
- {
- region: 'center',
- layout: 'fit',
- title: 'PC菜单',
- key: "1",
- items: [
- {
- xtype: 'treepanel',
- layout: 'fit',
- region: 'west',
- rootVisible: false,
- useArrows: true,
- reference: 'tree1',
- listeners: {
- itemclick: "scope.tree1NodeClick",
- }
- },
- ]
- },
- {
- region: 'center',
- layout: 'fit',
- title: 'PDA菜单',
- key: "2",
- items: [
- {
- xtype: 'treepanel',
- layout: 'fit',
- region: 'west',
- reference: 'tree2',
- rootVisible: false,
- useArrows: true,
- listeners: {
- itemclick: "scope.tree1NodeClick",
- }
- },
- ]
- },
- ]
- },
- {
- region: 'center',
- xtype: 'form',
- margin: '0 0 0 0',
- split: true,
- width: '50%',
- items: [
- {
- xtype: 'cols',
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '上级资源ID',
- bind: {
- readOnly: true,
- disabled: true,
- value: '{form.resource_parent}'
- },
- },
- ],
- },
- {
- xtype: 'cols',
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '资源名称',
- bind: {
- value: '{form.resource_name}'
- },
- allowBlank: false,
- },
- ],
- },
- {
- xtype: 'cols',
- items: [
- {
- xtype: 'numberfield',
- fieldLabel: '资源排序',
- bind: {
- value: '{form.resource_order}'
- },
- allowBlank: false,
- },
- ],
- },
- {
- xtype: 'cols',
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '功能URL',
- bind: {
- disabled: true,
- value: '{form.scope_url}'
- },
- },
- ]
- },
- {
- xtype: 'cols',
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '权限编码',
- bind: {
- value: '{form.permission_code}'
- }
- },
- ],
- },
- {
- xtype: 'cols',
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '功能参数',
- bind: {
- value: '{form.scope_params}'
- }
- },
- ],
- },
- ],
- },
- ],
- },
- ],
- referenceHolder: true,
- };
- //# sourceMappingURL=RegisterModule.view.js.map
- var RegisterModule = /** @class */ (function (_super) {
- __extends(RegisterModule, _super);
- function RegisterModule() {
- return _super.call(this, { model: model$e, vjson: vjson$d }) || this;
- }
- RegisterModule.prototype.onLoad = function () {
- this.reloadTree("PC");
- };
- RegisterModule.prototype.tabchange = function (a, b, c, d) {
- var currTabKey = b.key;
- if (currTabKey === '1') {
- this.viewModel.set('form', '');
- this.reloadTree("PC");
- }
- else {
- this.viewModel.set('form', '');
- this.reloadTree("PDA");
- }
- };
- RegisterModule.prototype.reloadTree = function (type) {
- var _this = this;
- if ("PC" === type) {
- this.setLoading(true);
- getMenuTree({ type: "PC" }).then(function (res) {
- if (res.success) {
- _this.refs.tree1.store.setRootNode({
- expanded: true,
- children: res.data
- });
- }
- }).finally(function () {
- _this.setLoading(false);
- });
- }
- else {
- this.setLoading(true);
- getMenuTree({ type: "PDA" }).then(function (res) {
- if (res.success) {
- _this.refs.tree2.store.setRoot({
- expanded: true,
- children: res.data
- });
- }
- }).finally(function () {
- _this.setLoading(false);
- });
- }
- };
- RegisterModule.prototype.tree1NodeClick = function (tree, node) {
- var id = _$2.split(node.data.id, '_')[1];
- if (!id) {
- return;
- }
- this.viewModel.set('form.resource_parent', id);
- };
- RegisterModule.prototype.saveNode = function () {
- var _this = this;
- var tabKey = this.refs.tabs.activeTab.key;
- // 检验菜单数据
- var param = this.viewModel.get('form');
- if (!param.resource_parent) {
- msg('请选择一个父节点');
- return;
- }
- if (!param.resource_name) {
- msg('资源名称不能为空');
- return;
- }
- if (!param.scope_url) {
- msg('功能URL不能为空');
- return;
- }
- var type;
- if (tabKey === '1') {
- type = 'PC';
- }
- else {
- type = 'PDA';
- }
- this.setLoading(true);
- registerResource(__assign(__assign({}, param), { type: type })).then(function (res) {
- if (res.success) {
- msg("注册成功");
- _this.close();
- }
- }).finally(function () {
- _this.setLoading(false);
- });
- };
- return RegisterModule;
- }(Scope));
- //# sourceMappingURL=RegisterModule.js.map
- var model$f = {
- data: {
- title: "模板选择",
- // 1:单表查询; 2:主/明细查询; 3:树/明细查询; 4:卡片表单;5:主/详情查询
- moduleType: 1,
- // 当前模块包路径 "com/galaxis/wms/bas/area"
- packagePath: "",
- // 当前模块文件保存路径 "D:/SourceCode/jztd/wms8-bench/wms-biz/bundle/src/com/galaxis/wms/bas/area"
- fileSavePath: "",
- // 模块名称 "Dict"
- moduleName: "NewModule",
- // 页面标题 "字典维护"
- pageTitle: "新模块",
- // 单表查询
- singleTable: {
- sql: "select * from bas_dict",
- // 新增或者删除所用的表
- tableName: "",
- // 是否分页查询
- pagination: true,
- // 是否需要删除
- delete: true,
- // 删除条件字段
- deleteWhereColumn: "",
- // 删除提示语
- deleteTips: "确定要删除?",
- // 编辑类型: 1 不要新增和编辑; 2 表格内新增/编辑; 3对话框新增/编辑;
- editType: 2,
- },
- singleTableView: {
- tableNameList: [
- // { value: "aaa"},
- ],
- columnList: [
- // { value: "aaa"},
- ],
- }
- }
- };
- //# sourceMappingURL=CreateModule.model.js.map
- var vjson$e = {
- bind: {
- title: '新建模块-{title}',
- },
- width: "55%",
- height: "60%",
- minWidth: 500,
- minHeight: 400,
- modal: true,
- frame: true,
- layout: 'card',
- bbar: [
- '->',
- {
- itemId: 'card-prev',
- text: '« 上一步',
- disabled: true,
- listeners: {
- click: 'scope.showPrevious',
- },
- },
- {
- itemId: 'card-next',
- text: '下一步 »',
- listeners: {
- click: 'scope.showNext',
- },
- },
- {
- itemId: 'card-finish',
- text: '立刻执行',
- iconCls: 'x-fa fa-flash',
- hidden: true,
- listeners: {
- click: 'scope.finish',
- },
- },
- ],
- items: [
- {
- vtitle: '模板选择',
- reference: 'templateSelection',
- layout: {
- type: 'hbox',
- pack: 'start',
- align: 'stretch'
- },
- listeners: {
- cardEnter: 'scope.templateEnter',
- cardLevel: 'scope.templateLevel'
- },
- items: [
- {
- width: 150,
- xtype: 'form',
- border: false,
- layout: {
- type: 'vbox',
- align: 'stretch'
- },
- defaults: {
- border: false,
- anchor: '100%',
- margin: '5',
- },
- items: [
- {
- xtype: 'radiogroup',
- bind: {
- value: '{moduleType}'
- },
- layout: 'vbox',
- defaults: {
- border: false,
- anchor: '100%',
- margin: '5',
- },
- items: [
- { boxLabel: '单表查询', inputValue: 1 },
- { boxLabel: '主/明细查询', inputValue: 2 },
- { boxLabel: '树/明细查询', inputValue: 3 },
- { boxLabel: '卡片表单', inputValue: 4 },
- { boxLabel: '主/详情查询', inputValue: 5 },
- ]
- },
- ]
- },
- {
- flex: 1,
- region: 'center',
- xtype: "panel",
- border: false,
- frame: true,
- padding: "4px 8px",
- html: "描述...",
- }
- ]
- },
- {
- vtitle: '模块名称',
- reference: 'moduleName',
- layout: 'fit',
- listeners: {
- cardEnter: 'scope.moduleEnter',
- cardLevel: 'scope.moduleLevel'
- },
- items: [
- {
- xtype: 'form',
- border: false,
- layout: {
- type: 'vbox',
- align: 'stretch'
- },
- defaults: {
- border: false,
- anchor: '100%',
- margin: '5',
- },
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '包路径',
- allowBlank: false,
- bind: { value: '{packagePath}' },
- },
- {
- xtype: 'textfield',
- fieldLabel: '文件路径',
- allowBlank: false,
- bind: { value: '{fileSavePath}' },
- },
- {
- xtype: 'textfield',
- fieldLabel: '模块名',
- allowBlank: false,
- bind: { value: '{moduleName}' },
- },
- {
- xtype: 'textfield',
- fieldLabel: '菜单名',
- allowBlank: false,
- bind: { value: '{pageTitle}' },
- },
- ]
- },
- ]
- },
- {
- vtitle: '确认结果',
- reference: 'confirmResult',
- layout: 'fit',
- listeners: {
- cardEnter: 'scope.optionEnter',
- cardLevel: 'scope.optionLevel',
- },
- items: [
- {
- xtype: 'jsoneditor',
- reference: 'jsoneditor'
- }
- ]
- },
- // ---------------------------------------------------------------------------------- 单表查询
- {
- vtitle: '查询SQL',
- reference: 'singleTable_1',
- layout: 'fit',
- listeners: {
- cardEnter: 'scope.editorEnter',
- cardLevel: 'scope.editorLevel'
- },
- items: [
- {
- xtype: 'sqleditor',
- }
- ],
- },
- {
- vtitle: '字段选项',
- reference: 'singleTable_2',
- layout: 'fit',
- listeners: {
- cardEnter: 'scope.columnEnter',
- cardLevel: 'scope.columnLevel',
- },
- items: [
- {
- xtype: 'yvgrid',
- border: false,
- selModel: {
- type: 'spreadsheet',
- columnSelect: true,
- pruneRemoved: false,
- extensible: 'y'
- },
- plugins: {
- clipboard: true,
- selectionreplicator: true
- },
- reference: 'grid1',
- idField: 'column_name',
- hideFootbar: true,
- tbar: {
- xtype: 'toolbar',
- items: [
- {
- xtype: 'button',
- text: '添加',
- iconCls: 'x-fa fa-plus-circle',
- listeners: {
- click: 'scope.addField'
- }
- },
- {
- xtype: 'button',
- text: '删除',
- iconCls: 'x-fa fa-minus-circle',
- listeners: {
- click: 'scope.removeField'
- }
- },
- {
- xtype: 'button',
- text: '分析SQL',
- iconCls: 'x-fa fa-refresh',
- listeners: {
- click: 'scope.parseSQL'
- }
- },
- ]
- },
- columns: [
- {
- text: '字段名', dataIndex: 'column_name',
- sortable: false,
- menuDisabled: true,
- width: 150,
- editor: {
- allowBlank: true,
- selectOnFocus: false,
- }
- },
- {
- text: '字段中文', dataIndex: 'column_comment',
- width: 150,
- sortable: false,
- menuDisabled: true,
- editor: {
- allowBlank: true,
- selectOnFocus: false,
- }
- },
- {
- dataIndex: "column_useto",
- // fix: ['system.getDict("column_useto")'],
- header: "用途",
- editor: {
- xtype: 'combo',
- allowBlank: false,
- },
- },
- {
- text: '主键', dataIndex: 'is_primary_key',
- xtype: 'checkcolumn', sortable: false, menuDisabled: true,
- width: 48, resizable: false,
- },
- {
- text: '必填', dataIndex: 'not_null',
- xtype: 'checkcolumn', sortable: false, menuDisabled: true,
- width: 48, resizable: false,
- },
- {
- text: '长度', dataIndex: 'column_size',
- sortable: false, menuDisabled: true,
- xtype: 'numbercolumn', format: '0',
- editor: { allowBlank: true, selectOnFocus: true }
- },
- {
- text: '字典', dataIndex: 'column_dict',
- sortable: false, menuDisabled: true,
- width: 200,
- editor: {
- allowBlank: true,
- }
- },
- {
- text: 'UI组件', dataIndex: 'column_ui',
- sortable: false, menuDisabled: true,
- // fix: ['system.getDict("column_ui")'],
- width: 150,
- editor: {
- xtype: 'combo',
- allowBlank: true,
- }
- },
- {
- dataIndex: 'data_type',
- hidden: true,
- },
- ]
- }
- ],
- },
- {
- vtitle: '其他选项',
- reference: 'singleTable_3',
- isEnd: true,
- listeners: {
- cardEnter: 'scope.extendEnter',
- cardLevel: 'scope.extendLevel',
- },
- layout: 'fit',
- items: [
- {
- xtype: 'form',
- border: false,
- layout: {
- type: 'vbox',
- align: 'stretch'
- },
- defaults: {
- border: false,
- anchor: '100%',
- margin: '5',
- },
- items: [
- {
- xtype: 'checkbox',
- fieldLabel: '需要分页',
- labelWidth: 100,
- bind: {
- value: '{singleTable.pagination}',
- },
- },
- {
- xtype: 'combobox',
- fieldLabel: '操作数据库表',
- labelWidth: 100,
- publishes: 'singleTable.tableName',
- displayField: 'value',
- valueField: 'value',
- bind: {
- data: '{singleTableView.tableNameList}',
- value: '{singleTable.tableName}',
- },
- },
- {
- xtype: 'checkboxfield',
- fieldLabel: '需要删除',
- labelWidth: 100,
- bind: {
- value: '{singleTable.delete}',
- },
- },
- {
- xtype: 'combobox',
- fieldLabel: '删除条件字段',
- labelWidth: 100,
- publishes: 'singleTable.deleteWhereColumn',
- displayField: 'value',
- valueField: 'value',
- bind: {
- data: '{singleTableView.columnList}',
- hidden: '{!singleTable.delete}',
- value: '{singleTable.deleteWhereColumn}',
- },
- },
- {
- xtype: 'textfield',
- fieldLabel: '删除提示语句',
- labelWidth: 100,
- bind: {
- hidden: '{!singleTable.delete}',
- value: '{singleTable.deleteTips}',
- },
- },
- {
- fieldLabel: '新增与编辑',
- labelWidth: 100,
- xtype: 'radiogroup',
- bind: {
- value: '{singleTable.editType}'
- },
- layout: 'vbox',
- defaults: {
- border: false,
- anchor: '100%',
- margin: '5',
- },
- items: [
- { boxLabel: '不要新增和编辑', inputValue: 1 },
- { boxLabel: '表格内新增/编辑', inputValue: 2 },
- { boxLabel: '对话框新增/编辑', inputValue: 3 },
- ]
- },
- ]
- }
- ]
- },
- // ---------------------------------------------------------------------------------- 主/明细查询
- {
- vtitle: '主表查询SQL',
- reference: 'mainDetailTable_1',
- layout: 'fit',
- listeners: {},
- items: [],
- },
- {
- vtitle: '主表字段选项',
- reference: 'mainDetailTable_2',
- layout: 'fit',
- listeners: {},
- items: [],
- },
- {
- vtitle: '主表其他选项',
- reference: 'mainDetailTable_3',
- layout: 'fit',
- listeners: {},
- items: [],
- },
- {
- vtitle: '子表查询SQL',
- reference: 'mainDetailTable_4',
- layout: 'fit',
- listeners: {},
- items: [],
- },
- {
- vtitle: '子表字段选项',
- reference: 'mainDetailTable_5',
- layout: 'fit',
- listeners: {},
- items: [],
- },
- {
- vtitle: '子表其他选项',
- reference: 'mainDetailTable_6',
- isEnd: true,
- layout: 'fit',
- listeners: {},
- items: [],
- },
- // ---------------------------------------------------------------------------------- 树/明细查询
- // ---------------------------------------------------------------------------------- 卡片表单
- {
- vtitle: '表单字段',
- reference: 'cardForm_1',
- layout: 'fit',
- listeners: {},
- items: [],
- },
- {
- vtitle: '表单初始化',
- reference: 'cardForm_2',
- isEnd: true,
- layout: 'fit',
- listeners: {},
- items: [],
- },
- ]
- };
- //# sourceMappingURL=CreateModule.view.js.map
- // noinspection TypeScriptCheckImport
- function getSingleTableData(origin) {
- return getQueryDslInfo(origin.tableName).then(function (queryDslInfo) {
- var _a, _b, _c;
- var data = {
- pagination: (_a = origin.pagination) !== null && _a !== void 0 ? _a : true,
- package: _$2.replace(origin.packagePath, /\//g, "."),
- groovyClass: origin.moduleName,
- qClass: queryDslInfo.qClass,
- qClassTable: queryDslInfo.qClassTable,
- queryColumns: [],
- insertColumns: [],
- updateColumns: [],
- updateWheres: [],
- deleteWheres: [],
- gridColumns: [],
- sql: origin.sql,
- pageTitle: (_b = origin.pageTitle) !== null && _b !== void 0 ? _b : "新模块",
- addButton: origin.editType !== 1,
- saveButton: origin.editType === 2,
- deleteButton: true,
- deleteTips: (_c = origin.deleteTips) !== null && _c !== void 0 ? _c : "真的要删除?",
- invokeUrlPrefix: origin.packagePath.replace("com/galaxis/wms", "") + "/" + origin.moduleName,
- fileSavePath: origin.fileSavePath,
- };
- origin.columnList.forEach(function (column) {
- var column_name = column.column_name, column_comment = column.column_comment, is_primary_key = column.is_primary_key, column_dict = column.column_dict, column_ui = column.column_ui;
- var query = origin.queryColumns.indexOf(column_name) >= 0;
- var insert = origin.insertColumns.indexOf(column_name) >= 0;
- var update = origin.updateColumns.indexOf(column_name) >= 0;
- var grid = origin.gridColumns.indexOf(column_name) >= 0;
- var dslField = queryDslInfo.fields.find(function (field) { return column_name === field.columnName; });
- var qClassField = dslField.qClassField, dbConvMethod = dslField.dbConvMethod;
- if (query) {
- data.queryColumns.push({ column_name: column_name, column_dict: column_dict, column_ui: column_ui });
- }
- if (insert) {
- data.insertColumns.push({ qClassField: qClassField, paramField: column_name });
- }
- if (update) {
- data.updateColumns.push({ qClassField: qClassField, paramField: column_name });
- }
- if (grid) {
- var gridColumn = { dataIndex: column_name, header: column_comment, fix: undefined, editor: undefined };
- if (column_dict) {
- gridColumn.fix = { dictName: column_dict };
- }
- if (origin.editType == 2 && (insert || update)) {
- gridColumn.editor = { xtype: column_ui, fix: undefined };
- if (column_dict) {
- gridColumn.editor.fix = { dictName: column_dict };
- }
- }
- data.gridColumns.push(gridColumn);
- }
- if (is_primary_key) {
- data.updateWheres.push({ qClassField: qClassField, dbConvMethod: dbConvMethod, paramField: column_name });
- data.deleteWheres.push({ qClassField: qClassField, dbConvMethod: dbConvMethod, paramField: column_name });
- }
- });
- return data;
- });
- }
- // noinspection HttpUrlsUsage
- var urlPrefix = "/static/studio-template/single_table";
- function generateCode(data) {
- return Promise.all([
- request.get(urlPrefix + "/groovy.hbs", { responseType: 'text' }),
- request.get(urlPrefix + "/mybatis.hbs", { responseType: 'text' }),
- request.get(urlPrefix + "/controller.hbs", { responseType: 'text' }),
- request.get(urlPrefix + "/view.hbs", { responseType: 'text' }),
- request.get(urlPrefix + "/model.hbs", { responseType: 'text' }),
- ]).then(function (values) {
- var groovy = handlebars.compile(values[0]);
- var mybatis = handlebars.compile(values[1]);
- var controller = handlebars.compile(values[2]);
- var view = handlebars.compile(values[3]);
- var model = handlebars.compile(values[4]);
- var code = {
- groovy: groovy(data),
- mybatis: mybatis(data),
- controller: controller(data),
- view: view(data),
- model: model(data),
- };
- return code;
- });
- }
- //# sourceMappingURL=SingleTableCodegen.js.map
- var CreateModule = /** @class */ (function (_super) {
- __extends(CreateModule, _super);
- function CreateModule() {
- var _this = _super.call(this, { model: model$f, vjson: vjson$e }) || this;
- _this.columns = [];
- return _this;
- }
- CreateModule.prototype.onLoad = function () {
- this.refs.grid1.setData([]);
- };
- CreateModule.prototype.addField = function () {
- this.refs.grid1.appendEditRow({
- column_name: '',
- column_comment: '',
- is_primary_key: false,
- not_null: true,
- column_domain: '',
- data_type: '',
- column_size: 0,
- decimal_digits: 0,
- default_value: '',
- column_dict: '',
- column_ui: '',
- column_note: '',
- }, 0);
- };
- CreateModule.prototype.removeField = function () {
- var _this = this;
- var rows = [];
- this.refs.grid1.getSelectionModel().getSelected().eachRow(function (r) {
- rows.push(r);
- });
- _$2.forEach(rows, function (r) {
- _this.refs.grid1.getStore().remove(r);
- });
- };
- CreateModule.prototype.parseSQL = function (sender) {
- var _this = this;
- var sql = this.viewModel.get('singleTable.sql');
- sender.up('window').setLoading(true);
- instance$1.reloadIfNeedPromise(undefined).then(function (res) {
- parseSqlApi(sql).then(function (parseResult) {
- if (!parseResult.success) {
- msg(parseResult.msg);
- return;
- }
- var tableNameList = [];
- var columnList = [];
- var singleTableTableName;
- var singleTableDeleteWhereColumn;
- _this.refs.grid1.setData([]);
- var rows = _this.refs.grid1.getDataRows();
- _$2.forEach(parseResult.data, function (parseRetColumn) {
- var columnName = parseRetColumn.columnName, tableName = parseRetColumn.tableName;
- if (!columnName || _$2.indexOf(columnName, '?') >= 0) {
- return;
- }
- if (tableNameList.findIndex(function (row) { return tableName === row.value; }) < 0)
- tableNameList.push({ value: tableName });
- if (columnList.findIndex(function (row) { return columnName === row.value; }) < 0)
- columnList.push({ value: columnName });
- if (!singleTableTableName)
- singleTableTableName = tableName;
- if (!singleTableDeleteWhereColumn)
- singleTableDeleteWhereColumn = columnName;
- // 已经加过这个列了
- var rowExists = _$2.find(rows, function (row) { return row.column_name === columnName; });
- if (rowExists) {
- return;
- }
- var columnRow = instance$1.getColumnByTableNameColumnName(tableName, columnName);
- if (columnRow) {
- _this.refs.grid1.appendEditRow({
- table_name: tableName,
- column_name: columnRow.column_name,
- column_comment: columnRow.column_comment,
- column_useto: 2,
- is_primary_key: columnRow.is_primary_key,
- not_null: columnRow.not_null,
- column_size: columnRow.column_size,
- column_dict: columnRow.column_dict,
- column_ui: columnRow.column_ui,
- data_type: columnRow.data_type,
- });
- if (columnRow.is_primary_key)
- singleTableDeleteWhereColumn = columnName;
- }
- else {
- _this.refs.grid1.appendEditRow({
- table_name: tableName,
- column_name: columnName,
- column_useto: 2,
- });
- }
- });
- _this.viewModel.set("singleTableView.columnList", columnList);
- _this.viewModel.set("singleTableView.tableNameList", tableNameList);
- _this.viewModel.set("singleTable.tableName", singleTableTableName);
- _this.viewModel.set("singleTable.deleteWhereColumn", singleTableDeleteWhereColumn);
- }).finally(function () {
- sender.up('window').setLoading(false);
- });
- }).catch(function () {
- sender.up('window').setLoading(false);
- });
- };
- CreateModule.prototype.templateEnter = function (sender) {
- };
- CreateModule.prototype.templateLevel = function (sender, opt) {
- if (!this.viewModel.get('moduleType')) {
- msg('请选择模板类型');
- opt.cancel = true;
- return;
- }
- };
- CreateModule.prototype.moduleEnter = function (sender) {
- };
- CreateModule.prototype.moduleLevel = function (sender, opt) {
- if (!sender.down('form').isValid()) {
- opt.cancel = true;
- return;
- }
- };
- CreateModule.prototype.editorEnter = function (sender) {
- var editor = sender.down('sqleditor');
- editor.setValue(this.viewModel.get('singleTable.sql'));
- };
- CreateModule.prototype.editorLevel = function (sender, opt) {
- var editor = sender.down('sqleditor');
- var sql = editor.getValue();
- if (!sql) {
- msg('查询SQL语句必填');
- opt.cancel = true;
- return;
- }
- this.viewModel.set('singleTable.sql', sql);
- };
- CreateModule.prototype.columnEnter = function (sender) {
- };
- CreateModule.prototype.columnLevel = function (sender, opt) {
- };
- CreateModule.prototype.extendEnter = function (sender) {
- };
- CreateModule.prototype.extendLevel = function (sender, opt) {
- };
- // 确认结果 - Enter
- CreateModule.prototype.optionEnter = function (sender) {
- var _this = this;
- // 1:单表查询; 2:主/明细查询; 3:树/明细查询; 4:卡片表单;
- var moduleType = this.viewModel.get("moduleType");
- var data = this.viewModel.getData();
- var code = "";
- var origin = {};
- if (moduleType === 1) {
- var singleTable = data.singleTable;
- var editColumns = this.refs.grid1.getDataRows();
- origin.moduleType = data.moduleType;
- origin.packagePath = data.packagePath;
- origin.fileSavePath = data.fileSavePath;
- origin.moduleName = data.moduleName;
- origin.pageTitle = data.pageTitle;
- if (singleTable) {
- origin.sql = singleTable.sql;
- origin.tableName = singleTable.tableName;
- origin.pagination = singleTable.pagination;
- origin.delete = singleTable.delete;
- origin.deleteWhereColumn = singleTable.deleteWhereColumn;
- origin.deleteTips = singleTable.deleteTips;
- origin.editType = singleTable.editType;
- }
- origin.columnList = [];
- origin.queryColumns = [];
- origin.insertColumns = [];
- origin.updateColumns = [];
- origin.gridColumns = [];
- editColumns.forEach(function (column) {
- var row = {
- table_name: column.table_name,
- column_name: column.column_name,
- column_comment: column.column_comment,
- is_primary_key: column.is_primary_key,
- not_null: column.not_null,
- column_size: column.column_size,
- column_dict: column.column_dict,
- column_ui: column.column_ui,
- data_type: column.data_type,
- column_type: column.column_type,
- };
- origin.columnList.push(row);
- // 1:查询条件; 2:查询结果; 3:条件+结果;
- var column_name = column.column_name, column_useto = column.column_useto;
- switch (column_useto) {
- case 1:
- origin.queryColumns.push(column_name);
- break;
- case 2:
- origin.gridColumns.push(column_name);
- break;
- case 3:
- origin.queryColumns.push(column_name);
- origin.gridColumns.push(column_name);
- break;
- }
- origin.insertColumns.push(column_name);
- origin.updateColumns.push(column_name);
- });
- }
- this.setLoading(true);
- getSingleTableData(origin).then(function (data) {
- code = JSON.stringify(data, null, 4);
- window['lastTemplateData'] = code;
- var editor = _this.refs.jsoneditor;
- editor.setCode(code);
- }).finally(function () { return _this.setLoading(false); });
- };
- // 确认结果 - Level
- CreateModule.prototype.optionLevel = function (sender, opt) {
- };
- // 上一步
- CreateModule.prototype.showPrevious = function () {
- this.doCardNavigation(false);
- };
- // 下一步
- CreateModule.prototype.showNext = function () {
- this.doCardNavigation(true, true);
- };
- CreateModule.prototype.doCardNavigation = function (isNext, isCancelable) {
- if (isNext === void 0) { isNext = true; }
- if (isCancelable === void 0) { isCancelable = false; }
- var layout = this._handle.getLayout();
- var activeItem = layout.activeItem;
- var reference = activeItem.reference, isEnd = activeItem.isEnd;
- if (isNext)
- this.prevCard = reference;
- var activeCard;
- if (reference === "templateSelection") {
- if (isNext) {
- activeCard = this.refs['moduleName'];
- }
- }
- else if (reference === "moduleName") {
- if (isNext) {
- // 1:单表查询; 2:主/明细查询; 3:树/明细查询; 4:卡片表单;
- var moduleType = this.viewModel.get("moduleType");
- switch (moduleType) {
- case 1:
- activeCard = this.refs['singleTable_1'];
- break;
- case 2:
- activeCard = this.refs['mainDetailTable_1'];
- break;
- case 3:
- // activeCard =
- break;
- case 4:
- activeCard = this.refs['cardForm_1'];
- break;
- }
- }
- else {
- activeCard = this.refs['templateSelection'];
- }
- }
- else if (reference === "confirmResult") {
- if (!isNext) {
- activeCard = this.refs[this.prevCard];
- }
- }
- else {
- var name = reference.split('_')[0];
- var idx = parseInt(reference.split('_')[1], 10);
- if (isNext) {
- if (isEnd) {
- activeCard = this.refs['confirmResult'];
- }
- else {
- idx += 1;
- }
- }
- else {
- idx -= 1;
- }
- if (idx <= 0) {
- activeCard = this.refs['moduleName'];
- }
- else if (!activeCard) {
- activeCard = this.refs[name + "_" + idx];
- }
- }
- // 按钮状态
- this.down('#card-finish').setHidden(activeCard !== this.refs['confirmResult']);
- this.down('#card-prev').setDisabled(activeCard === this.refs['templateSelection']);
- this.down('#card-next').setHidden(activeCard === this.refs['confirmResult']);
- // 设置下一页显示
- if (activeCard) {
- var optCancel = { cancel: false };
- // 发出 cardLevel 事件
- layout.activeItem.fireEvent('cardLevel', activeItem, optCancel);
- if (isCancelable && optCancel.cancel) {
- // 取消了
- return;
- }
- layout.setActiveItem(activeCard);
- this.viewModel.set('title', layout.activeItem.vtitle);
- layout.activeItem.fireEvent('cardEnter', layout.activeItem);
- }
- };
- // 立刻执行
- CreateModule.prototype.finish = function (sender) {
- var _this = this;
- var parent = sender.up('window');
- var editor = this.refs.jsoneditor;
- var data = JSON.parse(editor.getCode());
- // 1:单表查询; 2:主/明细查询; 3:树/明细查询; 4:卡片表单;
- var moduleType = this.viewModel.get("moduleType");
- if (moduleType === 1) {
- this.setLoading(true);
- generateCode(data).then(function (code) {
- console.log("===> ", code);
- _this.setLoading(true);
- saveModuleFiles(__assign(__assign({}, code), { fileSavePath: data.fileSavePath, groovyClass: data.groovyClass }))
- .then(function () {
- msg("创建成功!");
- parent.close();
- handles$1.fileTree.reload();
- }).finally(function () { return _this.setLoading(false); });
- }).finally(function () { return _this.setLoading(false); });
- }
- };
- return CreateModule;
- }(Scope));
- //# sourceMappingURL=CreateModule.js.map
- function getModuleId(path) {
- var separator = "/";
- var sps = path.split(separator);
- var joinSps = sps.join('$');
- if (!joinSps) {
- return "ROOT";
- }
- return joinSps;
- }
- /**
- * Module数据转换成Tree数据
- */
- function modulesToTreeData(modules) {
- var separator = "/";
- var treeNodeMap = new Map();
- var root = {
- type: "Dir",
- path: "",
- expanded: true,
- leaf: false,
- children: [],
- };
- root.id = getModuleId(root.path);
- treeNodeMap.set(root.path, root);
- modules.forEach(function (module) {
- var _a;
- var paths = (_a = _$2.split(module.path, separator)) === null || _a === void 0 ? void 0 : _a.filter(function (path) { return path; });
- if (paths.length <= 0)
- return;
- var path = [];
- var parent = root;
- paths.forEach(function (dirName, idx) {
- var parentPath = path.join(separator);
- parent = treeNodeMap.get(parentPath);
- path.push(dirName);
- var currentPath = path.join(separator);
- var child = treeNodeMap.get(currentPath);
- if (child == null) {
- // 获取当前path 绝对路径
- var indexLength = module.absolutePath.indexOf(currentPath);
- var currentAbsolutePath = "";
- if (indexLength > 0) {
- currentAbsolutePath = module.absolutePath.substring(0, indexLength) + currentPath;
- }
- child = {
- type: "Dir",
- path: currentPath,
- absolutePath: currentAbsolutePath,
- leaf: false,
- children: [],
- text: dirName
- };
- child.id = getModuleId(child.path);
- parent.children.push(child);
- treeNodeMap.set(child.path, child);
- }
- if ((idx + 1) === paths.length && module.name && module.jsControllerFile) {
- var leaf = {
- type: "Module",
- path: module.path + separator + module.name,
- absolutePath: module.absolutePath,
- leaf: true,
- text: module.name,
- module: module,
- };
- leaf.id = getModuleId(leaf.path);
- child.children.push(leaf);
- treeNodeMap.set(leaf.path, leaf);
- }
- });
- });
- // 排序处理
- treeNodeMap.forEach(function (module) {
- if (module.children) {
- var children = _$2.sortBy(module.children, function (item) { return item.type + "_" + item.path; });
- module.children.length = 0;
- children.forEach(function (item) { return module.children.push(item); });
- }
- });
- return root;
- }
- function showDialog(sender, option) {
- var _a, _b;
- var win = new Ext.Window({
- autoDestroy: true,
- title: option.title,
- width: (_a = option.width) !== null && _a !== void 0 ? _a : 400,
- height: (_b = option.height) !== null && _b !== void 0 ? _b : 300,
- resizable: false,
- closable: true,
- modal: true,
- maximizable: false,
- minimizable: false,
- // constrainHeader: true,
- constrain: true,
- layout: 'fit',
- animateTarget: sender,
- buttonAlign: 'center',
- items: [
- {
- xtype: "form",
- layout: "hbox",
- margin: '10px 20px',
- border: 0,
- items: option.items
- }
- ],
- //窗口按钮
- fbar: [
- {
- xtype: 'button', text: '保存', handler: function (btn) {
- //窗口获取表单
- var form = win.down('form');
- var vaildSuccess = form.isValid();
- if (!vaildSuccess) {
- return;
- }
- option.submitFunc(form);
- }
- },
- {
- xtype: 'button', text: '取消', handler: function (btn) {
- //窗口关闭
- btn.up('window').close();
- }
- }
- ],
- });
- win.show();
- }
- function showCreateFolderWin(sender, parentPath) {
- showDialog(sender, {
- title: '新建文件夹',
- height: 150,
- items: [
- {
- xtype: "textfield",
- name: "filename",
- fieldLabel: "文件夹名称",
- allowBlank: false,
- selectOnFocus: true,
- regex: /^[a-zA-Z\_][a-zA-Z0-9\_]*$/,
- regexText: "文件夹只能以英文字母开头,且只包含英文字母、数字、及某些特殊符号",
- labelWidth: 80,
- width: "100%",
- listeners: {
- afterrender: function (sender) {
- _$2.defer(function () {
- sender.focus();
- });
- }
- }
- },
- ],
- submitFunc: function (form) {
- var filename = form.down('textfield[name="filename"]').getValue();
- createFolder(parentPath, filename).then(function (res) {
- if (res.success) {
- msg$1('创建成功');
- handles$1.fileTree.reload();
- form.up('window').close();
- }
- else {
- showErrorDialog$1(res.msg);
- }
- }).catch(function (e) {
- showErrorDialog$1(e.responseJSON.msg);
- });
- }
- });
- }
- function showCreateModuleCrudWin(sender, path, absolutePath) {
- var dlg = new CreateModule();
- dlg.showDialog(sender, {}, {
- data: {
- packagePath: path,
- fileSavePath: absolutePath,
- }
- });
- }
- function registerModule$1(sender, path, name, icon) {
- // 前缀 com/galaxis/wms 写死了
- var dlg = new RegisterModule();
- dlg.showDialog(sender, {}, {
- data: {
- form: {
- scope_url: path.replace("com/galaxis/wms", "."),
- resource_name: name,
- resource_icon: icon,
- }
- }
- });
- }
- function showCreateEmptyModule(sender, path) {
- var win = new Ext.Window({
- autoDestroy: true,
- title: "新建空模块",
- width: 400,
- height: 150,
- resizable: true,
- closable: true,
- maximizable: true,
- minimizable: true,
- plain: true,
- // constrainHeader: true,
- constrain: true,
- layout: 'fit',
- animateTarget: sender,
- buttonAlign: 'center',
- items: [
- {
- xtype: "form",
- layout: "hbox",
- margin: '10px 20px',
- border: 0,
- items: [
- {
- flex: 1,
- layout: 'vbox',
- items: [
- {
- xtype: "textfield",
- name: "filename",
- fieldLabel: "模块名",
- flex: 1,
- allowBlank: false,
- regex: /^[a-zA-Z][a-zA-Z0-9]*$/,
- regexText: "文件名只能以英文字母开头,且只包含英文字母、数字",
- labelWidth: 50,
- width: "100%",
- },
- ]
- },
- ]
- }
- ],
- //窗口按钮
- buttons: [
- {
- xtype: 'button', text: '保存', handler: function (btn) {
- //窗口获取表单
- var form = win.down('form');
- var vaildSuccess = form.isValid();
- if (!vaildSuccess) {
- return;
- }
- var filename = form.down('textfield[name="filename"]').getValue();
- createEmptyModule(path, filename).then(function (res) {
- if (res.success) {
- Ext.toast({ html: 'createModule', title: '提示', width: 200, align: 't' });
- handles$1.fileTree.reload();
- win.close();
- }
- else {
- Ext.toast({ html: res.msg, title: '提示', width: 200, align: 't' });
- }
- }).catch(function (e) {
- Ext.toast({ html: e.responseJSON.msg, title: '提示', width: 200, align: 't' });
- });
- }
- },
- {
- xtype: 'button', text: '取消', handler: function (btn) {
- //窗口关闭
- win.close();
- }
- }
- ]
- });
- win.show();
- }
- //# sourceMappingURL=FileHelp.js.map
- function initFileTree () {
- Ext.define('com.yvan.studio.FileTree', {
- extend: 'com.yvan.studio.StateTree',
- xtype: 'filetree',
- tooltip: '文件',
- iconCls: 'x-fa fa-file',
- rootVisible: false,
- useArrows: true,
- colspan: 2,
- lines: true,
- reference: 'filetree',
- multiSelect: true,
- getStateFilename: function () {
- return getCurrentProject().uuid + "/filetree.json";
- },
- openNode: function () {
- var selection = this.getSelection();
- var _a = __read(selection, 1), record = _a[0];
- if (!record) {
- return;
- }
- var raw = record.raw;
- if (raw.type === 'Dir') {
- return;
- }
- if (raw.type === "Module" && raw.module) {
- eventBus.publish(EventType.ModuleOpen, raw);
- }
- },
- openInIdea: function () {
- var _a = __read(this.getSelection(), 1), record = _a[0];
- if (record) {
- var data = record.data;
- if (data.type === "Module") {
- if (data.module.groovyFile && data.module.groovyFile.exists) {
- native.openInIdea(data.module.groovyFile.absolutePath);
- }
- else if (data.module.jsControllerFile && data.module.jsControllerFile.exists) {
- native.openInIdea(data.module.jsControllerFile.absolutePath);
- }
- else if (data.module.jsViewFile && data.module.jsViewFile.exists) {
- native.openInIdea(data.module.jsViewFile.absolutePath);
- }
- return;
- }
- msg$1('只有文件、模块类型才能在 IDEA 中打开.');
- }
- },
- deleteSelection: function () {
- var selection = this.getSelection();
- var pathList = [];
- _.forEach(selection, function (item) {
- if (item.data.type === "Dir") {
- pathList.push({ path: item.data.path, isFolder: true });
- }
- else {
- pathList.push({ path: item.data.path, isFolder: false });
- }
- });
- {
- return;
- }
- // const title = '您确定要删除(' + raw.path + ')及此目录下所有文件吗?'
- //
- // Ext.Msg.confirm('提示', title, (btn) => {
- // if (btn === 'yes') {
- // deleteFileOrFolder(raw.path, title, true)
- // }
- // })
- // const title = '您确定要删除(' + raw.path + ')吗?'
- // deleteFileOrFolder(raw.path, title, false)
- },
- listeners: {
- itemverify: function () {
- this.openNode();
- },
- afterrender: function (me) {
- console.log('filetree_afterrender', 'reloadIfNeed');
- moduleStore.registe(me.subscribeModule.bind(this));
- moduleStore.reloadIfNeed("PC");
- },
- destroy: function (me) {
- console.log('filetree_destroy');
- moduleStore.unregiste(me.subscribeModule.bind(this));
- },
- itemcontextmenu: function (sender, node, element, idx, e) {
- e.preventDefault();
- var raw = node.raw;
- var option = {};
- if (raw.type === 'Dir') {
- // 文件夹右键
- option = {
- shadow: 'frame', allowOtherMenus: true,
- items: [
- {
- text: '新建空模块',
- iconCls: 'x-fa fa-plus-circle',
- handler: function (sender) {
- showCreateEmptyModule(sender, raw.path);
- }
- },
- {
- text: '新建模块',
- iconCls: 'x-fa fa-plus-circle',
- handler: function (sender) {
- showCreateModuleCrudWin(sender, raw.path, raw.absolutePath);
- }
- },
- '-',
- {
- text: '新建文件夹',
- iconCls: 'x-fa fa-folder-o',
- handler: function (sender) {
- var parentPath = raw.path;
- showCreateFolderWin(sender, parentPath);
- }
- },
- {
- text: '复制路径',
- iconCls: 'x-fa fa-external-link',
- handler: function (sender) {
- native.clipboardSet(raw.path);
- }
- },
- ]
- };
- }
- else {
- // 文件右键
- option = {
- shadow: 'frame', allowOtherMenus: true,
- items: [
- // {
- // text: '重命名',
- // iconCls: 'x-fa fa-terminal',
- // handler(sender) {
- // const regex = /^[a-zA-Z0-9\_\-\+\=@#\$\%\^\&\(\)]+$/
- // const regexText = "文件名只能以英文字母开头,且只包含英文字母、数字"
- // showRenameWin(sender, raw.path, raw.text, regex, regexText, false)
- // }
- // },
- // {
- // text: '另存为',
- // iconCls: 'x-fa fa-exchange',
- // handler(sender) {
- // console.error('没做')
- // }
- // },
- {
- text: '复制路径',
- iconCls: 'x-fa fa-external-link',
- handler: function (sender) {
- native.clipboardSet(raw.path);
- }
- },
- '-',
- {
- text: '注册模块',
- iconCls: 'x-fa fa-sign-in',
- handler: function (sender) {
- registerModule$1(sender, raw.path);
- }
- },
- ]
- };
- }
- var treeMenu = new Ext.menu.Menu(option);
- treeMenu.showAt(e.getXY());
- },
- },
- tbar: [
- {
- xtype: 'button',
- iconCls: 'x-fa fa-crosshairs',
- tooltip: '选中当前打开的文件',
- handler: function (sender) {
- msg$1('没做');
- }
- },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-link',
- tooltip: '在IDEA中打开',
- handler: function (sender) {
- var scope = sender.up("filetree");
- scope.openInIdea();
- }
- },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-refresh',
- tooltip: '刷新',
- handler: function (sender) {
- var scope = sender.up("filetree");
- scope.reload();
- }
- },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-percent',
- tooltip: '监控',
- handler: function (sender) {
- // handles.mainWindow.showPerform()
- }
- },
- ],
- initComponent: function () {
- setFileTree(this);
- this.superclass.initComponent.apply(this, arguments);
- // super.initComponent.apply(this, arguments)
- },
- subscribeModule: function (res) {
- if (typeof res === 'object') {
- var rootNode = modulesToTreeData(res.data);
- this.setRootNode(rootNode);
- this.restoreState();
- handles$1.mainWindow.modules = res.data;
- }
- else if (typeof res === 'boolean') {
- this.setLoading(res);
- }
- },
- reload: function () {
- console.log('filetree_reloadForce');
- moduleStore.reloadForce("PC").then(function (res) {
- });
- }
- });
- }
- //# sourceMappingURL=FileTree.js.map
- function initDbTree () {
- var define = {
- extend: 'com.yvan.studio.StateTree',
- xtype: 'dbtree',
- tooltip: '数据库',
- iconCls: 'x-fa fa-database',
- rootVisible: false,
- useArrows: true,
- reference: 'dbtree',
- multiSelect: true,
- getStateFilename: function () {
- return getCurrentProject().uuid + "/dbtree.json";
- },
- tbar: [
- {
- xtype: 'button',
- iconCls: 'x-fa fa-crosshairs',
- tooltip: '选中当前打开的表',
- handler: function (sender) {
- var _a;
- // 获取当前选中的活动标签 tableColumn_bas_car
- var locatPath = (_a = handles$1.mainWindow.refs.tt.getActiveTab()) === null || _a === void 0 ? void 0 : _a.locatPath;
- if (!locatPath) {
- return;
- }
- handles$1.dbTree.selectPath(locatPath);
- }
- },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-refresh',
- tooltip: '刷新',
- handler: function (sender) {
- handles$1.dbTree.reload();
- }
- },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-cloud-download',
- tooltip: '重新拉取生成元数据(耗时很长!)',
- handler: function (sender) {
- handles$1.dbTree.dbToMetaAndReload(sender);
- }
- },
- // {
- // xtype: 'button',
- // iconCls: 'x-fa fa-files-o',
- // tooltip: '数据同步',
- // handler(sender) {
- //
- // }
- // },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-exchange',
- tooltip: '数据结构同步',
- handler: function (sender) {
- // handles.mainWindow.showDataSync(sender)
- }
- },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-window-maximize',
- tooltip: 'SQL查询分析器',
- handler: function (sender) {
- // handles.mainWindow.showDbCodeTemplate(sender)
- }
- },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-cubes',
- tooltip: '数据域管理',
- handler: function (sender) {
- // handles.mainWindow.showColumnDomain()
- }
- },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-edit',
- tooltip: '修改结构',
- handler: function (sender) {
- var tree = sender.up("treepanel");
- var selection = tree.getSelection();
- var _a = __read(selection, 1), node = _a[0];
- if (!node) {
- msg$1('请选择一个表');
- return;
- }
- var raw = node.data.raw;
- if (node.get('type') === 'table') ;
- else if (node.get('type') === 'column') ;
- }
- },
- ],
- listeners: {
- afterrender: function (me) {
- setDbTree(this);
- // 找管理器订阅刷新的事件
- instance$1.registe(this.refreshData.bind(this));
- instance$1.reloadIfNeed(undefined);
- },
- destory: function (me) {
- setDbTree(undefined);
- instance$1.unregiste(this.refreshData.bind(this));
- },
- itemcontextmenu: function (sender, node, element, idx, e) {
- var _this = this;
- e.preventDefault();
- var option = {};
- var raw = node.raw.raw;
- if (node.get('type') === 'column') {
- option = {
- shadow: 'frame', allowOtherMenus: true,
- items: [
- {
- text: '设计结构',
- iconCls: 'x-fa fa-edit',
- handler: function (sender) {
- handles$1.mainWindow.showTableColumn(raw.schema_name, raw.table_name, raw.column_name, false);
- }
- },
- ]
- };
- }
- else if (node.get('type') === 'table') {
- option = {
- shadow: 'frame', allowOtherMenus: true,
- items: [
- {
- text: '新建',
- iconCls: 'x-fa fa-plus',
- handler: function (sender) {
- handles$1.mainWindow.showTableColumn(raw.schema_name, null, null, true);
- }
- },
- {
- text: '设计结构',
- iconCls: 'x-fa fa-edit',
- handler: function (sender) {
- handles$1.mainWindow.showTableColumn(raw.schema_name, raw.table_name, null, false);
- }
- },
- {
- text: '重命名',
- iconCls: 'x-fa fa-pencil',
- handler: function (sender) {
- _this.renameTable(sender, node.data.raw);
- }
- },
- '-',
- {
- text: '删除',
- iconCls: 'x-fa fa-minus',
- handler: function (sender) {
- _this.removeTable(sender, node.data.raw);
- }
- },
- ]
- };
- }
- var treeMenu = new Ext.menu.Menu(option);
- treeMenu.showAt(e.getXY());
- }
- },
- // DbTreeStore 刷新时,会回调到这个方法
- refreshData: function (isLoadingState) {
- var me = this;
- if (typeof isLoadingState === 'boolean') {
- me.setLoading(isLoadingState);
- return;
- }
- var rootNode = getDbTree(instance$1.apiResponse);
- me.setRootNode(rootNode);
- this.restoreState();
- },
- renameTable: function (sender, tableRow) {
- window['YvanUI'].prompt('输入新表名', tableRow.table_name).then(function (name) {
- renameTableDDL(tableRow.schema_name, tableRow.table_name, name).then(function (res) {
- if (!res.data)
- return;
- var window = Ext.create('Ext.window.Window', {
- title: 'SQL 预览',
- height: 400,
- width: 600,
- modal: true,
- animateTarget: sender,
- maximizable: true,
- layout: 'fit',
- items: {
- xtype: 'sqleditor',
- value: res.data,
- },
- buttons: [
- {
- xtype: 'button',
- text: '执行',
- iconCls: 'x-fa fa-save',
- handler: function (sender) {
- var editor = sender.up('window').down('sqleditor');
- var ddl = editor.getValue();
- window.setLoading(true);
- instance$1.pushToDbCommit({
- schema_name: tableRow.schema_name,
- table_name: name,
- old_table_name: tableRow.table_name,
- ddl: ddl,
- }).then(function () {
- handles$1.dbTree.reload();
- window.close();
- }).finally(function () { return window.setLoading(false); });
- },
- },
- {
- xtype: 'button',
- text: '取消',
- iconCls: 'x-fa fa-times',
- handler: function () {
- window.close();
- }
- },
- ]
- }).show();
- });
- });
- },
- removeTable: function (sender, tableRow) {
- dropTableDDL(tableRow.schema_name, tableRow.table_name).then(function (res) {
- if (!res.data)
- return;
- var window = Ext.create('Ext.window.Window', {
- title: 'SQL 预览',
- height: 400,
- width: 600,
- modal: true,
- animateTarget: sender,
- maximizable: true,
- layout: 'fit',
- items: {
- xtype: 'sqleditor',
- value: res.data,
- },
- buttons: [
- {
- xtype: 'button',
- text: '执行',
- iconCls: 'x-fa fa-save',
- handler: function (sender) {
- var editor = sender.up('window').down('sqleditor');
- var ddl = editor.getValue();
- window.setLoading(true);
- instance$1.pushToDbCommit({
- schema_name: tableRow.schema_name,
- table_name: tableRow.table_name,
- ddl: ddl
- })
- .then(function () {
- handles$1.dbTree.reload();
- window.close();
- }).finally(function () { return window.setLoading(false); });
- }
- },
- {
- xtype: 'button',
- text: '取消',
- iconCls: 'x-fa fa-times',
- handler: function () {
- window.close();
- }
- }
- ]
- }).show();
- });
- },
- // hideHeaders: true,
- // columns: [
- // {
- // xtype: 'treecolumn',
- // text: '名称',
- // dataIndex: 'text',
- // flex: 2,
- // }, {
- // text: '描述',
- // dataIndex: 'comment',
- // flex: 1,
- // }
- // ],
- reload: function () {
- // 强制刷新 DbManager
- instance$1.reloadForce(undefined);
- },
- dbToMetaAndReload: function () {
- // 从数据库结构重新生成元数据
- instance$1.dbToMetaAndReload();
- }
- };
- Ext.define('com.yvan.studio.DbTree', define);
- }
- /**
- * 将数据构建成 dbTree 需要的格式
- */
- function getDbTree(apiResponse) {
- var rootNode = {
- children: [],
- expanded: true,
- id: "ROOT",
- leaf: false,
- };
- _$2.forEach(apiResponse, function (schemaRow) {
- var schemaNode = {
- id: 'schema$' + schemaRow.schema_name,
- type: "schema",
- expanded: true,
- leaf: false,
- iconCls: 'x-fa fa-th-large ',
- text: schemaRow.schema_name,
- raw: __assign({}, schemaRow),
- children: [],
- };
- delete schemaNode.raw.table_list;
- rootNode.children.push(schemaNode);
- _$2.forEach(schemaRow.table_list, function (tableRow) {
- var _a;
- var tableNode = {
- id: 'schema$' + schemaRow.schema_name + '$' + tableRow.table_name,
- text: _$2.trim((_a = tableRow.description) !== null && _a !== void 0 ? _a : "").length <= 0 ? tableRow.table_name : tableRow.table_name + "(" + tableRow.description + ")",
- comment: tableRow.description,
- type: "table",
- iconCls: 'x-fa fa-table',
- expanded: false,
- leaf: false,
- children: [],
- raw: __assign({}, tableRow)
- };
- delete tableNode.raw.column_list;
- schemaNode.children.push(tableNode);
- _$2.forEach(tableRow.column_list, function (columnRow) {
- var _a;
- var iconCls = 'x-fa fa-square-o';
- if (columnRow.is_primary_key) {
- iconCls = 'x-fa fa-key';
- }
- else if (columnRow.not_null) {
- iconCls = 'x-fa fa-check-square';
- }
- var columnNode = {
- id: 'schema$' + schemaRow.schema_name + '$' + tableRow.table_name + '$' + columnRow.column_name,
- type: "column",
- text: _$2.trim((_a = columnRow.column_comment) !== null && _a !== void 0 ? _a : "").length <= 0 ? columnRow.column_name : columnRow.column_name + "(" + columnRow.column_comment + ")",
- comment: columnRow.column_comment,
- leaf: true,
- iconCls: iconCls,
- raw: __assign({}, columnRow)
- };
- tableNode.children.push(columnNode);
- }); // column
- }); // table
- }); // schema
- return rootNode;
- }
- //# sourceMappingURL=DbTree.js.map
- var ReportGridController = /** @class */ (function () {
- function ReportGridController() {
- }
- ReportGridController.prototype.onLoad = function (sender) {
- this.reload();
- setReport(this);
- };
- ReportGridController.prototype.showSingle = function (sender) {
- var _this = this;
- var _a = __read(this.getView().getSelection(), 1), record = _a[0];
- if (record) {
- handles.mainWindow.showFormSingle(record.data, function () {
- _this.reload();
- });
- }
- };
- ReportGridController.prototype.filterChanged = function (sender, value) {
- console.log('filterChange', sender, value);
- this.view.store.clearFilter();
- if (value) {
- this.view.store.filterBy(function (record) {
- var code = _.lowerCase(record.get('report_name'));
- var dict_desc_py = _.lowerCase(pinyinUtil.getFirstLetter(code));
- return (code.includes(value) ||
- dict_desc_py.includes(value));
- });
- }
- };
- ReportGridController.prototype.onClearClick = function () {
- var _a, _b;
- (_b = (_a = this.getReferences()) === null || _a === void 0 ? void 0 : _a.txtFilter) === null || _b === void 0 ? void 0 : _b.setValue('');
- };
- ReportGridController.prototype.reload = function () {
- var me = this;
- me.getView().setLoading(true);
- reportListApi().then(function (res) {
- _.forEach(res.data, function (r) {
- r.report_enable = r.report_enable === 1;
- });
- me.getView().setStore(new Ext.data.Store({
- fields: ['report_id', 'report_name', 'report_enable'],
- data: res.data,
- }));
- }).finally(function () {
- me.getView().setLoading(false);
- });
- };
- ReportGridController.prototype.reportAdd = function () {
- var _this = this;
- prompt$2('请输入报表名称').then(function (name) {
- createReportApi(name).then(function (res) {
- if (res.success) {
- msg$1('添加成功');
- handles.mainWindow.showReport(res.data, name, function () {
- _this.reload();
- });
- }
- _this.reload();
- });
- });
- };
- ReportGridController.prototype.onGridContextMenu = function (sender, node, element, idx, e) {
- e.preventDefault();
- var me = sender.up('grid').ownerGrid.getController();
- var option = {
- shadow: 'frame', allowOtherMenus: true,
- items: [
- {
- text: '添加',
- iconCls: 'x-fa fa-plus-circle',
- handler: function (sender) {
- me.reportAdd();
- }
- },
- {
- text: '编辑',
- iconCls: 'x-fa fa-edit',
- handler: function (sender) {
- me.reportEdit();
- }
- },
- {
- text: '删除',
- iconCls: 'x-fa fa-minus-circle',
- handler: function (sender) {
- me.reportRemove();
- }
- },
- '-',
- {
- text: '注册(至菜单)',
- iconCls: 'x-fa fa-sign-in',
- handler: function (sender) {
- me.reportRegiste(sender);
- }
- },
- {
- text: '卸载',
- iconCls: 'x-fa fa-sign-out',
- handler: function (sender) {
- console.error('没做');
- }
- },
- ]
- };
- var treeMenu = new Ext.menu.Menu(option);
- treeMenu.showAt(e.getXY());
- };
- ReportGridController.prototype.reportRegiste = function (sender) {
- var _a = __read(this.getView().getSelection(), 1), record = _a[0];
- if (record) {
- var reportName = record.get('report_name');
- var reportId = record.get('report_id');
- registerModule$1(sender, 'REPORT__' + reportId, reportName, 'x-fa fa-search');
- }
- };
- ReportGridController.prototype.reportRemove = function () {
- var _this = this;
- var _a = __read(this.getView().getSelection(), 1), record = _a[0];
- if (record) {
- var reportName = record.get('report_name');
- var reportId_1 = record.get('report_id');
- YvanUI.confirm("\u771F\u7684\u8981\u5220\u9664 \"" + reportName + "\" ?").then(function () {
- delReportApi(reportId_1).then(function (res) {
- if (res.success) {
- msg$1('删除成功');
- _this.reload();
- }
- });
- });
- }
- };
- ReportGridController.prototype.reportEdit = function () {
- var _this = this;
- var _a = __read(this.getView().getSelection(), 1), record = _a[0];
- if (record) {
- var reportName = record.get('report_name');
- var reportId = record.get('report_id');
- handles.mainWindow.showReport(reportId, reportName, function () {
- _this.reload();
- });
- }
- };
- ReportGridController.prototype.onDblClick = function (sender) {
- this.reportEdit();
- };
- return ReportGridController;
- }());
- //# sourceMappingURL=ReportGridController.js.map
- function initReportGrid () {
- var controller = new ReportGridController();
- Ext.define('com.yvan.studio.ReportGrid', {
- extend: 'Ext.grid.Panel',
- xtype: 'reportGrid',
- controller: controller,
- scope: controller,
- referenceHolder: true,
- tooltip: '查询报表',
- iconCls: 'x-fa fa-bar-chart',
- useArrows: true,
- reference: 'reportgrid',
- selModel: { type: 'rowmodel', mode: 'SINGLE', },
- listeners: {
- itemdblclick: 'onDblClick',
- afterrender: 'onLoad',
- },
- viewConfig: {
- enableTextSelection: true,
- listeners: {
- itemcontextmenu: 'onGridContextMenu',
- },
- },
- tbar: {
- xtype: 'toolbar',
- items: [
- {
- xtype: 'button',
- tooltip: '测试',
- iconCls: 'x-fa fa-bars',
- listeners: {
- click: 'showSingle'
- }
- },
- {
- xtype: 'button',
- tooltip: '刷新',
- iconCls: 'x-fa fa-refresh',
- listeners: {
- click: 'reload'
- }
- },
- {
- xtype: 'button',
- tooltip: '添加',
- iconCls: 'x-fa fa-plus-circle',
- listeners: {
- click: 'reportAdd'
- }
- },
- {
- xtype: 'button',
- tooltip: '删除',
- iconCls: 'x-fa fa-minus-circle',
- listeners: {
- click: 'reportRemove'
- }
- },
- {
- xtype: 'textfield',
- flex: 1,
- reference: "txtFilter",
- emptyText: '搜索过滤',
- enableKeyEvents: true,
- listeners: {
- change: {
- fn: 'filterChanged',
- buffer: 50
- }
- }
- },
- ]
- },
- columns: [
- {
- text: 'ID', dataIndex: 'report_id',
- hidden: true,
- },
- {
- text: '报表名称', dataIndex: 'report_name',
- flex: 1,
- },
- ]
- });
- }
- //# sourceMappingURL=ReportGrid.js.map
- /** 所有变量类型 */
- var TypeEnum;
- (function (TypeEnum) {
- TypeEnum["string"] = "string";
- TypeEnum["number"] = "number";
- TypeEnum["object"] = "object";
- TypeEnum["array"] = "array";
- TypeEnum["function"] = "function";
- TypeEnum["null"] = "null";
- TypeEnum["boolean"] = "boolean";
- TypeEnum["symbol"] = "symbol";
- TypeEnum["json"] = "json";
- TypeEnum["math"] = "math";
- TypeEnum["regexp"] = "regexp";
- TypeEnum["date"] = "date";
- TypeEnum["undefined"] = "undefined";
- TypeEnum["nan"] = "nan";
- TypeEnum["reactNode"] = "react_node";
- })(TypeEnum || (TypeEnum = {}));
- /**
- * 判断对象类型
- * @param object 对象
- */
- var variableTypeOf = function (object) {
- var typeStr = Object.prototype.toString.call(object);
- var typeName;
- switch (("" + typeStr).toLowerCase()) {
- case '[object string]':
- typeName = TypeEnum.string;
- break;
- case '[object number]':
- if (Number.isNaN(object)) {
- return TypeEnum.nan;
- }
- typeName = TypeEnum.number;
- break;
- case '[object object]':
- if (object.$$typeof && object.props) {
- var type = variableTypeOf(object.$$typeof);
- if (type === TypeEnum.symbol || type === TypeEnum.reactNode) {
- return TypeEnum.reactNode;
- }
- }
- typeName = TypeEnum.object;
- break;
- case '[object array]':
- typeName = TypeEnum.array;
- break;
- case '[object function]':
- typeName = TypeEnum.function;
- break;
- case '[object null]':
- typeName = TypeEnum.null;
- break;
- case '[object boolean]':
- typeName = TypeEnum.boolean;
- break;
- case '[object date]':
- typeName = TypeEnum.date;
- break;
- // 不常用
- case '[object symbol]':
- typeName = TypeEnum.symbol;
- break;
- case '[object json]':
- typeName = TypeEnum.json;
- break;
- case '[object math]':
- typeName = TypeEnum.math;
- break;
- case '[object regexp]':
- typeName = TypeEnum.regexp;
- break;
- // 貌似不会走的分支
- case '[object undefined]':
- typeName = TypeEnum.undefined;
- break;
- // 无法识别
- default:
- if (object === undefined) {
- return TypeEnum.undefined;
- }
- console.log('varTypeOf -> ', object, ' | -> ', typeStr, ' | ', ("" + typeStr).toLowerCase());
- typeName = TypeEnum.object;
- }
- return typeName;
- };
- //# sourceMappingURL=typeof.js.map
- function initGroovyEditor () {
- Ext.define('com.yvan.studio.GroovyEditor', {
- extend: 'Ext.panel.Panel',
- alias: 'widget.groovyeditor',
- xtype: 'groovyeditor',
- layout: 'fit',
- border: false,
- html: "<div class=\"editor\"/>",
- config: {
- value: ''
- },
- codeChange: undefined,
- isChangeFromOuter: false,
- getCode: function () {
- if (this.editor) {
- return this.editor.getValue();
- }
- else {
- return this.code;
- }
- },
- setCode: function (value) {
- var _this = this;
- this.code = value;
- this.value = value;
- _$2.defer(function () {
- _this.isChangeFromOuter = true;
- if (_this.editor) {
- _this.editor.setValue(value);
- }
- });
- },
- applyPosition: function () {
- var _this = this;
- if (this.autoFocusMethod) {
- if (this.editor) {
- _$2.defer(function () {
- if (_this.autoFocusStartLine) {
- _this.editor.setPosition({
- lineNumber: _this.autoFocusStartLine,
- column: _this.autoFocusStartColumn
- });
- _this.editor.revealLine(_this.autoFocusStartLine); //滚动到特定行
- }
- _this.editor.focus();
- });
- delete this.autoFocusMethod;
- }
- }
- this.editor.layout();
- },
- getValue: function () {
- return this.value;
- },
- setValue: function (value, fromEditor) {
- var me = this;
- if (me.value === value) {
- // 值相等,不需要变化
- return;
- }
- if (fromEditor !== true && me.editor) {
- // 不是来源于编辑器的变化,才设置编辑器的值
- me.editor.setValue(value);
- }
- // 通知mixins setValue
- me.value = value;
- me.fireEvent('change', value);
- },
- initComponent: function () {
- var that = this;
- this.superclass.initComponent.call(this, arguments);
- that.on({
- resize: function () {
- if (that.editor) {
- that.editor.layout();
- }
- },
- destory: function () {
- if (that.editor) {
- that.editor.dispose();
- delete that.editor;
- }
- },
- afterrender: function (sender) {
- var $dom = $(that.el.dom).find('.editor');
- attach_3($dom[0], {
- value: that.code
- }).then(function (editor) {
- that.editor = editor;
- that.applyPosition();
- that.editor.onDidChangeModelContent(function (e) {
- that.fireEvent('change', that.editor, e);
- if (variableTypeOf(that.codeChange) === "function" /*&& !that.isChangeFromOuter*/) {
- that.codeChange(that.editor.getValue(), that.name, e);
- }
- that.isChangeFromOuter = false;
- });
- });
- }
- });
- }
- });
- }
- function attach_3(element, opts) {
- return new Promise(function (resolve) {
- var editor = window['monaco'].editor.create(element, __assign(__assign({}, opts), { language: 'java', minimap: {
- enabled: false
- } }));
- editor.onKeyUp(function (e) {
- // console.log(e)
- if ( /*e.code === 'Enter'||*/e.code === 'Quote') {
- editor.trigger('随便写点儿啥', 'editor.action.triggerSuggest', {});
- }
- });
- resolve(editor);
- });
- }
- //# sourceMappingURL=GroovyEditor.js.map
- function initJsEditor$1 () {
- Ext.define('com.yvan.studio.JsEditor', {
- extend: 'Ext.panel.Panel',
- alias: 'widget.jseditor',
- xtype: 'jseditor',
- layout: 'fit',
- border: false,
- html: "<div class=\"editor\"/>",
- autoFocusMethod: true,
- autoFocusStartLine: 0,
- autoFocusStartColumn: 0,
- codeChange: undefined,
- funcArr: [],
- modulePage: null,
- isChangeFromOuter: false,
- name: "",
- /**
- * 设置代码
- */
- setCode: function (value) {
- var _this = this;
- this.code = value;
- _$2.defer(function () {
- _this.isChangeFromOuter = true;
- if (_this.editor) {
- _this.editor.setValue(value);
- if (_this.name === "controllerEditor") {
- _this.funcArr = _this.getAllFunction();
- }
- }
- });
- },
- getCode: function () {
- var _a;
- if (!this.editor) {
- return this.code;
- }
- return (_a = this.editor) === null || _a === void 0 ? void 0 : _a.getValue();
- },
- applyPosition: function () {
- var _this = this;
- if (this.autoFocusMethod) {
- if (this.editor) {
- _$2.defer(function () {
- if (_this.autoFocusStartLine) {
- _this.editor.setPosition({
- lineNumber: _this.autoFocusStartLine,
- column: _this.autoFocusStartColumn
- });
- _this.editor.revealLine(_this.autoFocusStartLine); //滚动到特定行
- }
- _this.editor.focus();
- });
- delete this.autoFocusMethod;
- }
- }
- this.editor.layout();
- },
- initComponent: function () {
- var that = this;
- this.superclass.initComponent.apply(this, arguments);
- this.on({
- resize: function (sender, width, height) {
- if (that.editor) {
- that.editor.layout();
- }
- },
- destory: function () {
- if (that.editor) {
- that.editor.dispose();
- delete that.editor;
- }
- },
- afterrender: function () {
- var $dom = $(that.el.dom).find('.editor');
- attach_1($dom[0], {
- value: that.code
- }).then(function (editor) {
- that.editor = editor;
- that.applyPosition();
- that.editor.onDidChangeModelContent(function (e) {
- that.fireEvent('change', that.editor, e);
- if (typeof that.codeChange === "function" && !that.isChangeFromOuter) {
- that.codeChange(that.editor.getValue(), that.name, e);
- }
- that.isChangeFromOuter = false;
- });
- });
- }
- });
- },
- getAllFunction: function () {
- var funcArr = [];
- var ast = window['YvanUI'].recast.parse(this.code);
- if (ast && ast.program && ast.program.body) {
- if (Array.isArray(ast.program.body)) {
- for (var i = 0; i < ast.program.body.length; i++) {
- var m = ast.program.body[i];
- if (m.type === "ExportDefaultDeclaration") {
- if (m.declaration.type === "ClassDeclaration") {
- if (m.declaration.body.type === "ClassBody") {
- if (Array.isArray(m.declaration.body.body)) {
- for (var j = 0; j < m.declaration.body.body.length; j++) {
- var ob = m.declaration.body.body[j];
- if (ob.type === "MethodDefinition" && ob.kind === "method") {
- var funcItem = { name: ob.key.name, args: [] };
- if (Array.isArray(ob.value.params)) {
- for (var k = 0; k < ob.value.params.length; k++) {
- var p = ob.value.params[k];
- funcItem.args.push(p.name);
- }
- }
- funcArr.push(funcItem);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return funcArr;
- }
- });
- }
- var isInited = false;
- function attach_1(element, opts) {
- return new Promise(function (resolve) {
- var monaco = window['monaco'];
- if (!isInited) {
- isInited = true;
- monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
- noSemanticValidation: true,
- noSyntaxValidation: false
- });
- // compiler options
- monaco.languages.typescript.javascriptDefaults.setCompilerOptions({
- target: monaco.languages.typescript.ScriptTarget.ES2016,
- allowNonTsExtensions: true,
- });
- // extra libraries
- var libSource = [
- 'declare class Facts {',
- ' /**',
- ' * Returns the next fact',
- ' */',
- ' static next():string',
- ' static next222():string',
- '}',
- "\n declare namespace WotuUI {\n export class Text {\n label: string\n }\n\n export function wrapText(n1: string): Text\n export function render(element:HTMLElement, vjson:any): void\n }\n ",
- "\n declare module 'fs' {\n function readFileSync(path: string | number, options?: { encoding?: string; flag?: string; } | null): string;\n }\n "
- ].join('\n');
- var libUri = 'file:///index.d.ts';
- monaco.languages.typescript.javascriptDefaults.addExtraLib(libSource, libUri);
- // When resolving definitions and references, the editor will try to use created models.
- // Creating a model for the library allows "peek definition/references" commands to work with the library.
- monaco.editor.createModel(libSource, 'javascript', monaco.Uri.parse(libUri));
- }
- var editor = monaco.editor.create(element, __assign(__assign({}, opts), { language: 'javascript' }));
- resolve(editor);
- });
- }
- //# sourceMappingURL=JsEditor.js.map
- function initJsonEditor$1 () {
- Ext.define('com.yvan.studio.JsonEditor', {
- extend: 'Ext.panel.Panel',
- alias: 'widget.jsoneditor',
- xtype: 'jsoneditor',
- layout: 'fit',
- border: false,
- html: "<div class=\"editor\"/>",
- autoFocusMethod: true,
- autoFocusStartLine: 0,
- autoFocusStartColumn: 0,
- codeChange: undefined,
- funcArr: [],
- modulePage: null,
- isChangeFromOuter: false,
- name: "",
- /**
- * 设置代码
- */
- setCode: function (value) {
- var _this = this;
- this.code = value;
- _$2.defer(function () {
- _this.isChangeFromOuter = true;
- if (_this.editor) {
- _this.editor.setValue(value);
- }
- });
- },
- updateOptions: function (options) {
- if (this.editor && options) {
- this.editor.updateOptions(options);
- }
- },
- setLanguage: function (lang) {
- if (this.editor && lang) {
- window['monaco'].editor.setModelLanguage(this.editor.getModel(), lang);
- }
- },
- getCode: function () {
- var _a;
- return (_a = this.editor) === null || _a === void 0 ? void 0 : _a.getValue();
- },
- applyPosition: function () {
- var _this = this;
- if (this.autoFocusMethod) {
- if (this.editor) {
- _$2.defer(function () {
- if (_this.autoFocusStartLine) {
- _this.editor.setPosition({
- lineNumber: _this.autoFocusStartLine,
- column: _this.autoFocusStartColumn
- });
- _this.editor.revealLine(_this.autoFocusStartLine); //滚动到特定行
- }
- _this.editor.focus();
- });
- delete this.autoFocusMethod;
- }
- }
- this.editor.layout();
- },
- initComponent: function () {
- var that = this;
- this.superclass.initComponent.apply(this, arguments);
- this.on({
- resize: function (sender, width, height) {
- if (that.editor) {
- that.editor.layout();
- }
- },
- destory: function () {
- if (that.editor) {
- that.editor.dispose();
- delete that.editor;
- }
- },
- afterrender: function (sender) {
- var $dom = $(that.el.dom).find('.editor');
- attach_116($dom[0], {
- value: that.code
- }).then(function (editor) {
- that.editor = editor;
- that.applyPosition();
- that.editor.onDidChangeModelContent(function (e) {
- that.fireEvent('change', that.editor, e);
- if (typeof that.codeChange === "function" && !that.isChangeFromOuter) {
- that.codeChange(that.editor.getValue(), that.name, e);
- }
- that.isChangeFromOuter = false;
- });
- });
- }
- });
- },
- });
- }
- function attach_116(element, opts) {
- return new Promise(function (resolve) {
- var editor = window['monaco'].editor.create(element, __assign(__assign({}, opts), { language: 'json', minimap: {
- enabled: false
- } }));
- editor.onKeyUp(function (e) {
- // console.log(e)
- if ( /*e.code === 'Enter'||*/e.code === 'Quote') {
- editor.trigger('随便写点儿啥', 'editor.action.triggerSuggest', {});
- }
- });
- resolve(editor);
- });
- }
- //# sourceMappingURL=JsonEditor.js.map
- function initSqlEditor$1 () {
- Ext.define('com.yvan.studio.SqlEditor', {
- extend: 'Ext.panel.Panel',
- alias: 'widget.sqleditor',
- xtype: 'sqleditor',
- layout: 'fit',
- border: false,
- html: "<div class=\"editor\"/>",
- config: {
- value: ''
- },
- codeChange: undefined,
- isChangeFromOuter: false,
- setCode: function (value) {
- var _this = this;
- this.code = value;
- this.value = value;
- _$2.defer(function () {
- _this.isChangeFromOuter = true;
- if (_this.editor) {
- _this.editor.setValue(value);
- }
- });
- },
- getCode: function () {
- return this.getValue();
- },
- updateOptions: function (options) {
- if (this.editor && options) {
- this.editor.updateOptions(options);
- }
- },
- getValue: function () {
- if (!this.editor) {
- return this.code;
- }
- return this.editor.getValue();
- },
- applyPosition: function () {
- var _this = this;
- if (this.autoFocusMethod) {
- if (this.editor) {
- _$2.defer(function () {
- if (_this.autoFocusStartLine) {
- _this.editor.setPosition({
- lineNumber: _this.autoFocusStartLine,
- column: _this.autoFocusStartColumn
- });
- _this.editor.revealLine(_this.autoFocusStartLine); //滚动到特定行
- }
- _this.editor.focus();
- });
- delete this.autoFocusMethod;
- }
- }
- this.editor.layout();
- },
- setValue: function (value, fromEditor) {
- this.setCode(value);
- var me = this;
- if (me.value === value) {
- // 值相等,不需要变化
- return;
- }
- if (fromEditor !== true && me.editor) {
- // 不是来源于编辑器的变化,才设置编辑器的值
- me.editor.setValue(value);
- }
- // 通知mixins setValue
- me.value = value;
- me.fireEvent('change', value);
- },
- initComponent: function () {
- var that = this;
- this.superclass.initComponent.call(this);
- that.on({
- resize: function () {
- if (that.editor) {
- that.editor.layout();
- }
- },
- destory: function () {
- if (that.editor) {
- that.editor.dispose();
- delete that.editor;
- }
- },
- afterrender: function (sender) {
- var $dom = $(that.el.dom).find('.editor');
- attach_2($dom[0], {
- value: that.code
- }).then(function (editor) {
- that.editor = editor;
- that.applyPosition();
- that.editor.onDidChangeModelContent(function (e) {
- that.fireEvent('change', that.editor, e);
- if (typeof that.codeChange === "function" && !that.isChangeFromOuter) {
- that.codeChange(that.editor.getValue(), that.name, e);
- }
- that.isChangeFromOuter = false;
- });
- });
- }
- });
- }
- });
- }
- function attach_2(element, opts) {
- return new Promise(function (resolve) {
- var monaco = window['monaco'];
- var editor = monaco.editor.create(element, __assign(__assign({}, opts), { language: 'sql', minimap: {
- enabled: false
- } }));
- editor.addCommand(monaco.KeyMod.Shift | monaco.KeyMod.Alt | monaco.KeyCode.KeyF, function () {
- // const sql = editor.getValue()
- // if (_.trim(sql).length > 0) {
- // editor.setValue(format(sql, {
- // indent: ' ',
- // uppercase: true,
- // }))
- // }
- msg$1('没做');
- });
- editor.onKeyUp(function (e) {
- // console.log(e)
- if ( /*e.code === 'Enter'||*/e.code === 'Quote') {
- editor.trigger('随便写点儿啥', 'editor.action.triggerSuggest', {});
- }
- });
- resolve(editor);
- });
- }
- //# sourceMappingURL=SqlEditor.js.map
- function initTemplateEditor () {
- Ext.define('com.yvan.studio.TemplateEditor', {
- extend: 'Ext.panel.Panel',
- alias: 'widget.templateeditor',
- xtype: 'templateeditor',
- layout: 'fit',
- border: false,
- html: "<div class=\"editor\"/>",
- autoFocusMethod: true,
- autoFocusStartLine: 0,
- autoFocusStartColumn: 0,
- codeChange: undefined,
- funcArr: [],
- modulePage: null,
- isChangeFromOuter: false,
- name: "",
- /**
- * 设置代码
- */
- setCode: function (value) {
- var _this = this;
- this.code = value;
- _$2.defer(function () {
- _this.isChangeFromOuter = true;
- if (_this.editor) {
- _this.editor.setValue(value);
- }
- });
- },
- getCode: function () {
- var _a;
- return (_a = this.editor) === null || _a === void 0 ? void 0 : _a.getValue();
- },
- applyPosition: function () {
- var _this = this;
- if (this.autoFocusMethod) {
- if (this.editor) {
- _$2.defer(function () {
- if (_this.autoFocusStartLine) {
- _this.editor.setPosition({
- lineNumber: _this.autoFocusStartLine,
- column: _this.autoFocusStartColumn
- });
- _this.editor.revealLine(_this.autoFocusStartLine); //滚动到特定行
- }
- _this.editor.focus();
- });
- delete this.autoFocusMethod;
- }
- }
- this.editor.layout();
- },
- initComponent: function () {
- var that = this;
- this.superclass.initComponent.apply(this, arguments);
- this.on({
- resize: function (sender, width, height) {
- if (that.editor) {
- that.editor.layout();
- }
- },
- destory: function () {
- if (that.editor) {
- that.editor.dispose();
- delete that.editor;
- }
- },
- afterrender: function (sender) {
- var $dom = $(that.el.dom).find('.editor');
- attach_117($dom[0], {
- value: that.code
- }).then(function (editor) {
- that.editor = editor;
- that.applyPosition();
- that.editor.onDidChangeModelContent(function (e) {
- that.fireEvent('change', that.editor, e);
- if (typeof (that.codeChange) === "function" && !that.isChangeFromOuter) {
- that.codeChange(that.editor.getValue(), that.name, e);
- }
- that.isChangeFromOuter = false;
- });
- });
- }
- });
- },
- });
- }
- function attach_117(element, opts) {
- return new Promise(function (resolve) {
- var editor = window['monaco'].editor.create(element, __assign(__assign({}, opts), { language: 'handlebars', minimap: {
- enabled: false
- } }));
- editor.onKeyUp(function (e) {
- // console.log(e)
- if ( /*e.code === 'Enter'||*/e.code === 'Quote') {
- editor.trigger('随便写点儿啥', 'editor.action.triggerSuggest', {});
- }
- });
- resolve(editor);
- });
- }
- //# sourceMappingURL=TemplateEditor.js.map
- var DictStore = /** @class */ (function (_super) {
- __extends(DictStore, _super);
- function DictStore() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- DictStore.prototype.getCacheKey = function (param) {
- return "dict_data.json";
- };
- DictStore.prototype.invokeApi = function (param) {
- return getDict(param);
- };
- DictStore.prototype.getDicts = function () {
- return this.apiResponse.data.dict;
- };
- DictStore.prototype.getDictCodes = function () {
- return new Promise(function (resolve) {
- // reloadIfNeedPromise().then(() => {
- // const result = []
- // _.forEach(this.getDicts(), dictRow => {
- // result.push({
- // id: dictRow.dict_code,
- // text: dictRow.dict_code + ' (' + dictRow.dict_desc + ')',
- // })
- // })
- // resolve(result)
- // })
- });
- };
- DictStore.prototype.saveDict = function (param) {
- return saveDictApi(param);
- };
- DictStore.prototype.saveDictItems = function (param) {
- return saveDictItemsApi(param);
- };
- DictStore.prototype.getDictItemByDictcode = function (dict_code) {
- var results = [];
- _$2.forEach(this.apiResponse.data.dictItems, function (dictItemRow) {
- if (dictItemRow.dict_code === dict_code) {
- results.push(_$2.clone(dictItemRow));
- }
- });
- return results;
- };
- return DictStore;
- }(CacheStore));
- var instance$2 = new DictStore();
- //# sourceMappingURL=DictStore.js.map
- var DictTreeController = /** @class */ (function () {
- function DictTreeController() {
- this._saveStateFlag = true;
- }
- DictTreeController.prototype.dictSave = function () {
- var _this = this;
- // 提取表格中,所有的 新行(newRows) / 修改过的行(modifyRows) / 删除过的行(removeRecords) / 全部行(rows) / 异常(err)
- var _a = system.getGridEditRows(this.grid1), newRows = _a.newRows, modifyRows = _a.modifyRows, removeRecords = _a.removeRecords, rows = _a.rows, err = _a.err;
- if (err) {
- // 如果有异常就不保存
- return;
- }
- // 进行业务上的逻辑校验,比如说必填校验等等
- var hasError = false;
- _$2.forEach(rows, function (row, i) {
- if (isEmpty(row.dict_code)) {
- msg$1("\u5B57\u5178\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A!");
- hasError = true;
- return false;
- }
- });
- if (hasError) {
- return;
- }
- // 设置当前界面为 "保存中..." 状态
- this.view.setLoading(true);
- instance$2.saveDict({
- newRows: newRows,
- modifyRows: modifyRows,
- removeRecords: removeRecords,
- }).then(function (res) {
- // 保存成功就提示一下,并重新载入数据 (根据 dataSource 的设置)
- msg$1(res.msg);
- _this.reload();
- }).finally(function () {
- // 无论正常异常,关闭 "保存中..." 状态
- _this.view.setLoading(false);
- });
- };
- DictTreeController.prototype.dictItemSave = function () {
- var _this = this;
- var _a = __read(this.grid1.getSelection(), 1), record = _a[0];
- var currentDictCode = undefined;
- if (record) {
- currentDictCode = record.get('dict_code');
- }
- if (!currentDictCode) {
- msg$1('请选择一个字典');
- return;
- }
- // 提取表格中,所有的 新行(newRows) / 修改过的行(modifyRows) / 删除过的行(removeRecords) / 全部行(rows) / 异常(err)
- var _b = system.getGridEditRows(this.grid2), newRows = _b.newRows, modifyRows = _b.modifyRows, removeRecords = _b.removeRecords, rows = _b.rows, err = _b.err;
- if (err) {
- // 如果有异常就不保存
- return;
- }
- // 进行业务上的逻辑校验,比如说必填校验等等
- var hasError = false;
- _$2.forEach(rows, function (row, i) {
- if (!row.dict_value && row.dict_value !== 0) {
- msg$1("\u5B57\u5178\u503C\u4E0D\u80FD\u4E3A\u7A7A!");
- hasError = true;
- return false;
- }
- });
- if (hasError) {
- return;
- }
- // 设置当前界面为 "保存中..." 状态
- this.view.setLoading(true);
- instance$2.saveDictItems({
- // 吧 newRows / modifyRows / removeRecords 再外加一些需要附带的数据,一并提交给后台,进行一次性事务提交
- newRows: newRows,
- modifyRows: modifyRows,
- removeRecords: removeRecords,
- dict_code: currentDictCode
- }).then(function (res) {
- // 保存成功就提示一下,并重新载入数据 (根据 dataSource 的设置)
- msg$1(res.msg);
- _this.reload();
- }).finally(function () {
- // 无论正常异常,关闭 "保存中..." 状态
- _this.view.setLoading(false);
- });
- };
- DictTreeController.prototype.createDictEnum = function () {
- var _this = this;
- var _a = __read(this.grid1.getSelection(), 1), record = _a[0];
- var currentDictCode = undefined;
- if (record) {
- currentDictCode = record.get('dict_code');
- }
- if (!currentDictCode) {
- msg$1('请选择一个字典');
- return;
- }
- // 设置当前界面为 "保存中..." 状态
- this.view.setLoading(true);
- createDictEnum({ dictCode: currentDictCode })
- .then(function () { return _this.reload(); })
- .finally(function () { return _this.view.setLoading(false); });
- };
- DictTreeController.prototype.onLoad = function () {
- setDictTree(this);
- this.grid1 = this.view.lookupReference('grid1');
- this.grid2 = this.view.lookupReference('grid2');
- this.grid1.setData([]);
- this.grid2.setData([]);
- // this.grid1.columns[0].hide()
- this.grid2.columns[0].hide();
- // 找管理器订阅刷新的事件
- instance$2.registe(this.refreshData.bind(this));
- // 非强制性刷新 DbManager
- instance$2.reloadIfNeed(undefined);
- };
- DictTreeController.prototype.onDestory = function () {
- instance$2.unregiste(this.refreshData.bind(this));
- };
- // dictStore 刷新时,会回调到这个方法
- DictTreeController.prototype.refreshData = function (isLoadingState) {
- var me = this;
- if (typeof isLoadingState === 'boolean') {
- me.view.setLoading(isLoadingState);
- return;
- }
- this.grid1.setData(instance$2.getDicts());
- this.restoreState();
- };
- DictTreeController.prototype.grid1Selected = function (sender, record, event) {
- var _this = this;
- _$2.defer(function () {
- _this.saveState();
- });
- if (!record) {
- this.grid2.setData([]);
- return;
- }
- var dict_code = record.get('dict_code');
- var data = instance$2.getDictItemByDictcode(dict_code);
- this.grid2.setData(data);
- };
- DictTreeController.prototype.reload = function () {
- var _this = this;
- // 强制刷新 DbManager
- instance$2.reloadForce(undefined).then(function (res) {
- _this.search1(_this.getView().down('[emptyText=搜索过滤]'));
- });
- };
- DictTreeController.prototype.dictAdd = function () {
- this.grid1.appendEditRow({
- _createFlag: true,
- dict_code: '',
- dict_desc: '',
- }, 0);
- };
- DictTreeController.prototype.dictRemove = function () {
- this.grid1.removeEditRow();
- };
- DictTreeController.prototype.dictItemAdd = function () {
- var _a, _b;
- var dict_code = (_b = (_a = this.grid1.selection) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.dict_code;
- if (!dict_code) {
- msg$1('请先保存字典');
- return;
- }
- this.grid2.appendEditRow({
- dict_code: dict_code,
- dict_text: '',
- dict_value: '',
- }, 0);
- };
- DictTreeController.prototype.dictItemRemove = function () {
- var _this = this;
- var rows = [];
- this.grid2.getSelectionModel().getSelected().eachRow(function (r) {
- rows.push(r);
- });
- _$2.forEach(rows, function (r) {
- _this.grid2.getStore().remove(r);
- });
- };
- DictTreeController.prototype.clearSearch1 = function () {
- this.grid1.store.clearFilter();
- };
- DictTreeController.prototype.search1 = function (sender) {
- this.grid1.store.clearFilter();
- this.getViewModel().set('grid1.selection', null);
- this.grid1.fireEvent('itemselect');
- var value = _$2.lowerCase(sender.getRawValue()).trim();
- if (!value) {
- return;
- }
- this.grid1.store.filterBy(function (record) {
- if (record.get('_createFlag')) {
- return true;
- }
- var dict_code = _$2.lowerCase(record.get('dict_code'));
- var dict_desc = _$2.lowerCase(record.get('dict_desc'));
- var dict_desc_py = _$2.lowerCase(pinyinUtil.getFirstLetter(dict_desc));
- return (dict_code.includes(value) ||
- dict_desc.includes(value) ||
- dict_desc_py.includes(value));
- });
- };
- DictTreeController.prototype.clearSearch2 = function () {
- this.grid2.store.clearFilter();
- };
- DictTreeController.prototype.search2 = function (sender) {
- this.grid2.store.clearFilter();
- var value = _$2.lowerCase(sender.getRawValue()).trim();
- if (!value) {
- return;
- }
- this.grid2.store.filterBy(function (record) {
- var dict_text = _$2.lowerCase(record.get('dict_text'));
- var dict_value = _$2.lowerCase(record.get('dict_value'));
- var dict_text_py = _$2.lowerCase(pinyinUtil.getFirstLetter(dict_text));
- return (dict_text.includes(value) ||
- dict_value === value ||
- dict_text_py.includes(value));
- });
- };
- DictTreeController.prototype.getStateFilename = function () {
- return getCurrentProject().uuid + "/dicttree.json";
- };
- DictTreeController.prototype.restoreState = function () {
- var _this = this;
- var grid = this.grid1;
- native.loadFile(this.getStateFilename(), function (content) {
- if (!content)
- return;
- var selection = content.selection, scrollPosition = content.scrollPosition, scrollSize = content.scrollSize;
- _this._saveStateFlag = false;
- if (selection) {
- var idx = grid.store.findExact('dict_code', selection);
- if (idx >= 0) {
- var record = grid.store.getAt(idx);
- if (record) {
- grid.setSelection([record]);
- }
- }
- }
- if (scrollPosition && scrollSize) {
- var size = grid.scrollable.getSize();
- if (size.x === scrollSize.x && size.y === scrollSize.y) {
- grid.scrollable.doScrollTo(scrollPosition.x, scrollPosition.y);
- }
- }
- setTimeout(function () {
- _this._saveStateFlag = true;
- }, 200);
- });
- };
- DictTreeController.prototype.saveState = function () {
- if (!this._saveStateFlag) {
- return;
- }
- var _a = __read(this.grid1.getSelection(), 1), record = _a[0];
- var selection = undefined;
- if (record) {
- selection = record.get('dict_code');
- }
- var scrollPosition = this.grid1.scrollable.position;
- var scrollSize = this.grid1.scrollable.getSize();
- native.saveFile(this.getStateFilename(), {
- selection: selection,
- scrollPosition: scrollPosition,
- scrollSize: scrollSize
- });
- };
- return DictTreeController;
- }());
- //# sourceMappingURL=DictTreeController.js.map
- function initDict$1 () {
- var controller = new DictTreeController();
- Ext.define('com.yvan.studio.DictTree', {
- extend: 'Ext.panel.Panel',
- xtype: 'dicttree',
- controller: controller,
- scope: controller,
- referenceHolder: true,
- tooltip: '字典',
- iconCls: 'x-fa fa-book',
- rootVisible: false,
- useArrows: true,
- reference: 'dicttree',
- layout: 'border',
- listeners: {
- afterrender: 'onLoad',
- destory: 'onDestory',
- },
- items: [
- {
- region: 'center',
- xtype: 'yvgrid', hideFootbar: true, reference: 'grid1',
- _mode: 'select',
- tbar: [
- {
- xtype: 'button',
- tooltip: '刷新',
- iconCls: 'x-fa fa-refresh',
- listeners: {
- click: 'reload'
- }
- },
- {
- xtype: 'button',
- tooltip: '添加',
- iconCls: 'x-fa fa-plus-circle',
- listeners: {
- click: 'dictAdd'
- }
- },
- {
- xtype: 'button',
- tooltip: '删除',
- iconCls: 'x-fa fa-minus-circle',
- bind: {
- disabled: '{!grid1.selection}'
- },
- listeners: {
- click: 'dictRemove'
- }
- },
- {
- xtype: 'button',
- tooltip: '保存',
- iconCls: 'x-fa fa-save',
- bind: {
- disabled: '{!grid1.ischanged}'
- },
- listeners: {
- click: 'dictSave'
- }
- },
- {
- xtype: 'textfield',
- hideClear: true,
- triggers: {
- clear: {
- cls: 'x-form-clear-trigger',
- handler: 'clearSearch1'
- },
- },
- flex: 1,
- emptyText: '搜索过滤',
- enableKeyEvents: true,
- listeners: {
- keyup: {
- fn: 'search1',
- buffer: 50
- }
- }
- },
- ],
- listeners: {
- itemselect: 'grid1Selected',
- },
- idField: 'dict_code',
- columns: [
- {
- text: '字典编号', dataIndex: 'dict_code',
- menuDisabled: true, flex: 1,
- editor: {
- allowBlank: true,
- selectOnFocus: false
- }
- },
- {
- text: '中文描述', dataIndex: 'dict_desc',
- menuDisabled: true, flex: 1,
- editor: {
- allowBlank: true,
- selectOnFocus: false
- }
- },
- ]
- },
- {
- region: 'south', height: '50%',
- xtype: 'yvgrid', hideFootbar: true, reference: 'grid2',
- split: true,
- _mode: 'edit1',
- listeners: {},
- tbar: [
- {
- xtype: 'button',
- tooltip: '添加',
- iconCls: 'x-fa fa-plus-circle',
- bind: {
- disabled: '{!grid1.selection}'
- },
- listeners: {
- click: 'dictItemAdd'
- }
- },
- {
- xtype: 'button',
- tooltip: '删除',
- iconCls: 'x-fa fa-minus-circle',
- bind: {
- disabled: '{!grid1.selection}'
- },
- listeners: {
- click: 'dictItemRemove'
- }
- },
- {
- xtype: 'button',
- tooltip: '保存',
- iconCls: 'x-fa fa-save',
- bind: {
- disabled: '{!grid2.ischanged}'
- },
- listeners: {
- click: 'dictItemSave'
- }
- },
- {
- xtype: 'button',
- tooltip: '刷新代码',
- iconCls: 'x-fa fa-code',
- bind: {
- disabled: '{!grid1.selection}'
- },
- listeners: {
- click: 'createDictEnum'
- }
- },
- ],
- columns: [
- {
- text: '字典项', dataIndex: 'dict_text',
- menuDisabled: true, flex: 1,
- editor: {
- allowBlank: true,
- selectOnFocus: false
- }
- },
- {
- text: '字典值', dataIndex: 'dict_value',
- menuDisabled: true, flex: 1,
- dataType: 'int',
- editor: {
- xtype: 'numberfield',
- allowBlank: true,
- selectOnFocus: false
- }
- },
- {
- text: '激活', dataIndex: 'is_enable',
- xtype: 'checkcolumn', menuDisabled: true,
- },
- {
- text: '变量名', dataIndex: 'var_name',
- menuDisabled: true, flex: 1,
- editor: {
- allowBlank: true,
- selectOnFocus: false
- }
- },
- ]
- }
- ]
- });
- }
- //# sourceMappingURL=DictTree.js.map
- var model$g = {
- data: {
- form: {
- path: "",
- requestBody: "",
- responseBody: "",
- }
- }
- };
- var vjson$f = {
- title: '接口信息',
- layout: 'fit',
- width: 800,
- height: 500,
- items: [
- {
- xtype: 'form',
- layout: {
- type: 'vbox',
- pack: 'start',
- align: 'stretch'
- },
- defaults: {
- border: false,
- anchor: '100%',
- margin: '5',
- },
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '接口路径',
- bind: {
- value: "{form.path}",
- },
- },
- {
- xtype: 'textareafield',
- // height: 150,
- flex: 2,
- fieldLabel: '请求数据',
- bind: {
- value: "{form.requestBody}",
- },
- },
- {
- xtype: 'textareafield',
- // height: 150,
- flex: 5,
- fieldLabel: '响应数据',
- bind: {
- value: "{form.responseBody}",
- },
- },
- ]
- }
- ]
- };
- var ApiInfoDialog = /** @class */ (function (_super) {
- __extends(ApiInfoDialog, _super);
- function ApiInfoDialog() {
- return _super.call(this, { model: model$g, vjson: vjson$f }) || this;
- }
- return ApiInfoDialog;
- }(Scope));
- //# sourceMappingURL=apiInfoDialog.js.map
- var model$h = {
- data: {
- query: {
- role_id: '',
- resource_id: '',
- },
- form: {},
- form2: {
- key: "",
- start_at: "",
- end_at: "",
- }
- }
- };
- var vjson$g = {
- title: '接口信息',
- layout: 'fit',
- items: [
- {
- layout: 'border',
- border: false,
- items: [
- {
- region: 'center',
- layout: 'border',
- items: [
- {
- region: 'north',
- bind: {
- title: '{form.title}',
- },
- xtype: 'form',
- scrollable: true,
- layout: {
- type: 'vbox',
- pack: 'start',
- align: 'stretch'
- },
- defaults: {
- border: false,
- anchor: '100%',
- margin: '5',
- },
- tbar: {
- xtype: 'toolbar',
- items: [
- {
- xtype: 'button',
- text: '查询',
- iconCls: 'x-fa fa-search',
- listeners: {
- click: 'scope.requestLogs'
- },
- },
- {
- xtype: 'button',
- text: '保存',
- iconCls: 'x-fa fa-save',
- listeners: {},
- },
- {
- xtype: 'button',
- text: '禁用',
- iconCls: 'x-fa fa-stop-circle',
- bind: {},
- listeners: {},
- },
- {
- xtype: 'button',
- text: '启用',
- iconCls: 'x-fa fa-play-circle',
- bind: {},
- listeners: {},
- },
- ],
- },
- items: [
- {
- xtype: 'cols',
- defaults: { labelWidth: 120 },
- items: [
- {
- xtype: 'textfield',
- fieldLabel: 'URL',
- bind: {
- value: '{form.api_url}',
- },
- readOnly: true,
- },
- {
- xtype: 'textfield',
- fieldLabel: '名称',
- bind: {
- value: '{form.api_name}',
- },
- readOnly: true,
- },
- ],
- },
- {
- xtype: 'cols',
- defaults: { labelWidth: 120 },
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '实现类',
- bind: {
- value: '{form.api_class}',
- },
- readOnly: true,
- },
- {
- border: false,
- flex: 1
- },
- ]
- },
- {
- xtype: 'cols',
- defaults: { labelWidth: 120 },
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '超时时间',
- bind: {
- value: '{form.timeout}',
- },
- readOnly: true,
- },
- {
- border: false,
- flex: 1
- },
- ]
- },
- {
- xtype: 'cols',
- defaults: { labelWidth: 120 },
- items: [
- {
- xtype: 'textfield',
- fieldLabel: 'Remote IP',
- bind: {
- value: '{form.remote_ip}',
- },
- readOnly: true,
- },
- {
- border: false,
- flex: 1
- },
- ]
- },
- {
- xtype: 'cols',
- defaults: { labelWidth: 120 },
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '解析表单',
- bind: {
- value: '{form.chandi}',
- },
- readOnly: true,
- },
- {
- border: false,
- flex: 1
- },
- ]
- },
- ],
- },
- {
- region: 'center',
- // title: 'Request',
- layout: 'border',
- items: [
- {
- region: 'north',
- xtype: 'form',
- reference: 'form2',
- split: true,
- items: [
- {
- xtype: 'cols',
- width: 700,
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '关键字',
- bind: {
- value: "{form2.key}"
- },
- },
- {
- xtype: 'datefield',
- fieldLabel: '开始时间',
- bind: {
- value: "{form2.start_at}"
- },
- },
- {
- xtype: 'datefield',
- fieldLabel: '结束时间',
- bind: {
- value: "{form2.end_at}"
- },
- },
- ]
- }
- ]
- },
- {
- region: 'center',
- xtype: 'yvgrid',
- layout: 'fit',
- reference: 'grid1',
- pagination: true,
- autoLoad: false,
- selModel: {
- selType: 'rowmodel',
- mode: 'SINGLE',
- },
- dataSource: {
- method: 'invoke',
- url: '/sys/api/Api@requestLogs',
- params: {
- formData: '{form2}',
- path: '{form.api_url}',
- },
- },
- listeners: {
- rowdblclick: 'scope.showDialog',
- },
- columns: [
- { dataIndex: "@timestamp", header: "时间", width: 150 },
- { dataIndex: "remoteIP", header: "RemoteIP", width: 150 },
- { dataIndex: "cost", header: "耗时(毫秒)", width: 80 },
- { dataIndex: "size", header: "大小", width: 80 },
- { dataIndex: "path", header: "path", flex: 1 },
- { dataIndex: "requestBody", header: "requestBody", hidden: true },
- { dataIndex: "responseBody", header: "responseBody", hidden: true },
- ]
- }
- ]
- },
- ],
- },
- ],
- },
- ],
- referenceHolder: true,
- };
- var Api = /** @class */ (function (_super) {
- __extends(Api, _super);
- function Api() {
- return _super.call(this, { model: model$h, vjson: vjson$g }) || this;
- }
- Api.prototype.onLoad = function () {
- _super.prototype.onLoad.call(this);
- this.requestLogs();
- };
- Api.prototype.selectList = function (sender, selected, eOpts) {
- this.viewModel.set("form", selected.data);
- if (selected.data.api_type === '1') {
- this.viewModel.set("form.title", selected.data.api_name + "-(接收)");
- }
- else {
- this.viewModel.set("form.title", selected.data.api_name + "-(发送)");
- }
- };
- Api.prototype.methodDataLoadComplete = function (sender, success, records) {
- var sel = [];
- _$2.forEach(records, function (item) {
- if (item.data.flg === 'Y') {
- sel.push(item);
- }
- });
- this.refs.methodGrid.selModel.select(sel);
- };
- Api.prototype.saveAll = function () {
- var _this = this;
- var _a, _b, _c;
- var role_id = this.viewModel.get("query.role_id");
- if (!role_id) {
- msg$1("请先选择一个角色");
- return;
- }
- var wh_id = this.viewModel.get("form.wh_id");
- if (!wh_id) {
- msg$1("请先选择一个仓库");
- return;
- }
- var menus = this.refs.theTree.getChecked();
- var rowsMenus = [];
- _$2.forEach(menus, function (m) {
- if (m.data.resource_id) {
- rowsMenus.push(m.data.resource_id);
- }
- });
- var mm = (_a = this.refs.methodGrid.getStore().getData().items) === null || _a === void 0 ? void 0 : _a.map(function (r) { return r.data; });
- var methodsArry = (_c = (_b = this.refs.methodGrid.selModel.selected) === null || _b === void 0 ? void 0 : _b.items) === null || _c === void 0 ? void 0 : _c.map(function (r) { return r.data.resource_id; });
- _$2.remove(mm, function (x) {
- return methodsArry.includes(x.resource_id);
- });
- var rowsBtn = [];
- _$2.forEach(mm, function (m) {
- rowsBtn.push({ resource_id: m.resource_id });
- });
- this.setLoading(true);
- invokeServer$1('/sys/role/Role@saveAll', {
- wh_id: wh_id,
- role_id: role_id,
- rowsMenus: rowsMenus,
- rowsBtn: rowsBtn,
- }).then(function (res) {
- msg$1(res.msg);
- if (res.success) {
- _this.reloadTree();
- // this.viewModel.set('query.role_id', '')
- _this.viewModel.set('query.resource_id', '');
- _this.refs.methodGrid.reload();
- }
- }).finally(function () {
- _this.setLoading(false);
- });
- };
- Api.prototype.editRoleSuccess = function (sender, data) {
- if (data.success) {
- this.refs.roleGrid.reload();
- this.viewModel.set("query.JIAOS_ID", "");
- this.reloadTree();
- this.viewModel.set("query.CAID_ID", "");
- this.refs.methodGrid.reload();
- }
- };
- Api.prototype.deleteRole = function (sender) {
- var _this = this;
- var role_id = this.viewModel.get("query.role_id");
- if (!role_id) {
- msg$1("请先选择一个角色");
- return;
- }
- Ext.Msg.confirm('提示', "您确定要删除该角色吗?", function (btn) {
- if (btn === 'yes') {
- invokeServer$1('/sys/role/Role@deleteRole', {
- role_id: role_id,
- wh_id: window['whId']
- }).then(function (res) {
- msg$1(res.msg);
- if (res.success) {
- _this.refs.roleGrid.reload();
- _this.viewModel.set("query.role_id", "");
- _this.reloadTree();
- _this.refs.methodGrid.reload();
- }
- });
- }
- });
- };
- Api.prototype.reloadTree = function () {
- showErrorDialog$1('reloadTree 不存在');
- };
- Api.prototype.whChange = function (sender, value) {
- this.viewModel.set("form.wh_id", value);
- this.reloadTree();
- this.refs.methodGrid.reload();
- };
- Api.prototype.requestLogs = function () {
- var path = this.viewModel.get("form.api_url");
- if (!path)
- return;
- this.refs.grid1.reload();
- };
- Api.prototype.showDialog = function (sender) {
- var _a, _b;
- var rows = (_b = (_a = this.refs.grid1.selModel.selected) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.map(function (r) { return r.data; });
- if (!rows || rows.length <= 0)
- return;
- var dialog = new ApiInfoDialog();
- dialog.showDialog(null, {}, {
- data: {
- form: __assign({}, rows[0])
- }
- });
- };
- return Api;
- }(Scope));
- //# sourceMappingURL=ApiPage.js.map
- var Controller = /** @class */ (function () {
- function Controller() {
- }
- Controller.prototype.selectList = function (sender, selected, eOpts) {
- var _a, _b, _c, _d, _e, _f, _g, _h;
- // @ts-ignore
- var rows = (_b = (_a = this.getReferences()['roleGrid'].selModel.selected) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.map(function (r) { return r.data; });
- if (!rows || rows.length <= 0)
- return;
- var apiPage = new Api();
- apiPage.showPage({
- title: "API-" + ((_d = (_c = rows[0]) === null || _c === void 0 ? void 0 : _c.api_name) !== null && _d !== void 0 ? _d : ""),
- id: ("API_" + ((_f = (_e = rows[0]) === null || _e === void 0 ? void 0 : _e.api_url) !== null && _f !== void 0 ? _f : "")).replace(/[-/@]/g, "_"),
- path: ("API_" + ((_h = (_g = rows[0]) === null || _g === void 0 ? void 0 : _g.api_url) !== null && _h !== void 0 ? _h : "")).replace(/[-/@]/g, "_"),
- }, {
- data: {
- form: __assign({}, rows[0])
- }
- });
- };
- return Controller;
- }());
- var controller = new Controller();
- function initApiTree () {
- Ext.define('com.yvan.studio.ApiGrid', {
- extend: 'Ext.Panel',
- xtype: 'apigrid',
- controller: controller,
- scope: controller,
- referenceHolder: true,
- layout: 'fit',
- items: [
- {
- width: 400,
- split: true,
- xtype: 'yvgrid',
- reference: 'roleGrid',
- border: false,
- pagination: false,
- autoLoad: true,
- remoteFilter: false,
- selModel: {
- selType: 'rowmodel',
- mode: 'SINGLE',
- },
- tbar: {
- xtype: 'toolbar',
- items: [
- {
- xtype: 'button',
- text: '新增',
- iconCls: 'x-fa fa-plus-circle',
- listeners: {},
- },
- {
- xtype: 'button',
- text: '删除',
- iconCls: 'x-fa fa-trash',
- bind: {
- disabled: '{roleGrid.selection==null}',
- },
- listeners: {},
- },
- ],
- },
- dataSource: {
- url: '/sys/api/Api@getApiList',
- method: 'invoke',
- params: {},
- },
- listeners: {
- itemdblclick: "selectList",
- },
- columns: [
- {
- dataIndex: 'api_name',
- header: '接口名称',
- filter: { type: 'string' },
- flex: 1,
- },
- ],
- },
- ]
- });
- }
- //# sourceMappingURL=ApiTree.js.map
- var model$i = {
- data: {
- iframeSrc: ''
- }
- };
- var vjson$h = {
- layout: 'fit',
- border: false,
- iconCls: 'x-fa fa-newspaper-o',
- referenceHolder: true,
- items: [
- {
- // title: 'view.design',
- xtype: 'uxiframe',
- layout: 'fit',
- // cls: 'module_page_iframe',
- reference: 'iframe',
- listeners: {
- afterrender: 'scope.iframeRender'
- }
- },
- ]
- };
- var Iframe = /** @class */ (function (_super) {
- __extends(Iframe, _super);
- function Iframe(path) {
- var _this = _super.call(this, { model: model$i, vjson: vjson$h }) || this;
- _this.path = "";
- _this.path = path;
- return _this;
- }
- Iframe.prototype.iframeRender = function (sender) {
- var $dom = $(sender.el.dom).find('iframe');
- var iframe = $dom[0];
- iframe.src = getCurrentProject().url + this.path + "?xxl-job-token=m5nxz7UdeixzQyy5KiDckL0ne3GtNhvvCwPL47rEp5jR7eTOAK50QjvqHgZOxOStusSyB5jZViBuc0ysdT7M8IfjsVEgj7ATEL";
- iframe.onload = function () {
- iframe.contentWindow.postMessage("m5nxz7UdeixzQyy5KiDckL0ne3GtNhvvCwPL47rEp5jR7eTOAK50QjvqHgZOxOStusSyB5jZViBuc0ysdT7M8IfjsVEgj7ATEL", '*');
- };
- };
- return Iframe;
- }(Scope));
- //# sourceMappingURL=Iframe.js.map
- var Controller$1 = /** @class */ (function () {
- function Controller() {
- }
- Controller.prototype.onDblClick = function (sender, record) {
- var data = record.raw;
- if (data.text === "运行报表") {
- this.openIframe("/xxl-job/index", "运行报表");
- }
- else if (data.text === "任务管理") {
- this.openIframe("/xxl-job/jobinfo", "任务管理");
- }
- else if (data.text === "调度日志") {
- this.openIframe("/xxl-job/joblog", "调度日志");
- }
- else if (data.text === "执行器管理") {
- this.openIframe("/xxl-job/jobgroup", "执行器管理");
- }
- };
- Controller.prototype.openIframe = function (path, title) {
- var page = new Iframe(path);
- page.showPage({
- title: title,
- id: 'xxljob__' + path.replaceAll("/", "_"),
- path: 'xxljob__' + path.replaceAll("/", "_"),
- }, {});
- };
- Controller.prototype.onLoad = function () {
- var me = this;
- me.getView().setRootNode({
- expanded: true,
- leaf: false,
- children: [
- { leaf: true, text: '运行报表' },
- { leaf: true, text: '任务管理' },
- { leaf: true, text: '调度日志' },
- { leaf: true, text: '执行器管理' },
- ]
- });
- };
- return Controller;
- }());
- var controller$1 = new Controller$1();
- function initTaskTree () {
- Ext.define('com.yvan.studio.TaskTree', {
- extend: 'Ext.tree.Panel',
- xtype: 'tasktree',
- controller: controller$1,
- scope: controller$1,
- reference: 'roleGrid',
- tooltip: '表单定义',
- iconCls: 'x-fa fa-bar-chart',
- useArrows: true,
- rootVisible: false,
- colspan: 2,
- lines: true,
- multiSelect: false,
- referenceHolder: true,
- // openNode() {
- // const selection = this.getSelection()
- // const [record] = selection
- // if (!record) {
- // return
- // }
- //
- // const {raw} = record;
- // if (raw.type === 'Dir') {
- // return
- // }
- // if (raw.type === "Module" && raw.module) {
- // // eventBus.publish(EventType.ModuleOpen, raw)
- // }
- // },
- listeners: {
- itemdblclick: 'onDblClick',
- afterrender: "onLoad",
- },
- });
- }
- //# sourceMappingURL=TaskTree.js.map
- var model$j = {
- data: {
- form: {
- address: "",
- level: "",
- logger: "",
- message: "",
- nodeName: "",
- serverName: "",
- thread: "",
- whId: "",
- userId: "",
- }
- }
- };
- var vjson$i = {
- title: '接口信息',
- layout: 'fit',
- width: 800,
- height: 600,
- items: [
- {
- xtype: 'form',
- layout: {
- type: 'vbox',
- pack: 'start',
- align: 'stretch'
- },
- defaults: {
- border: false,
- anchor: '100%',
- margin: '5',
- },
- items: [
- { xtype: 'textfield', fieldLabel: '服务名', bind: { value: "{form.serverName}" } },
- { xtype: 'textfield', fieldLabel: '服务地址', bind: { value: "{form.address}" } },
- { xtype: 'textfield', fieldLabel: '节点名称', bind: { value: "{form.nodeName}" } },
- { xtype: 'textfield', fieldLabel: '日志级别', bind: { value: "{form.level}" } },
- { xtype: 'textfield', fieldLabel: '日志Logger', bind: { value: "{form.logger}" } },
- { xtype: 'textfield', fieldLabel: '线程号', bind: { value: "{form.thread}" } },
- { xtype: 'textfield', fieldLabel: '仓库ID', bind: { value: "{form.whId}" } },
- // {xtype: 'textfield', fieldLabel: '用户ID', bind: {value: "{form.userId}"}},
- {
- xtype: 'textareafield',
- flex: 5,
- fieldLabel: '响应数据',
- bind: {
- value: "{form.message}",
- },
- },
- ]
- }
- ]
- };
- var ApiInfoDialog$1 = /** @class */ (function (_super) {
- __extends(ApiInfoDialog, _super);
- function ApiInfoDialog() {
- return _super.call(this, { model: model$j, vjson: vjson$i }) || this;
- }
- return ApiInfoDialog;
- }(Scope));
- //# sourceMappingURL=LogPageDialog.js.map
- var model$k = {
- data: {
- form2: {}
- }
- };
- var vjson$j = {
- title: '日志查询',
- layout: 'fit',
- width: "70%",
- height: "80%",
- items: [
- {
- region: 'center',
- xtype: 'yvgrid',
- layout: 'fit',
- reference: 'grid1',
- pagination: false,
- autoLoad: false,
- selModel: {
- selType: 'rowmodel',
- mode: 'SINGLE',
- },
- dataSource: {
- method: 'invoke',
- url: '/sys/api/Api@aroundLogs',
- params: {
- formData: '{form2}',
- },
- },
- listeners: {
- rowdblclick: 'scope.showDialog2',
- },
- columns: [
- { dataIndex: "@timestamp", header: "时间", width: 150 },
- // {dataIndex: "nodeName", header: "nodeName", width: 80},
- { dataIndex: "thread", header: "thread", width: 150 },
- { dataIndex: "message", header: "message", flex: 1 },
- ]
- }
- ]
- };
- var AroundLog = /** @class */ (function (_super) {
- __extends(AroundLog, _super);
- function AroundLog() {
- return _super.call(this, { model: model$k, vjson: vjson$j }) || this;
- }
- AroundLog.prototype.onLoad = function () {
- _super.prototype.onLoad.call(this);
- this.queryLog();
- };
- AroundLog.prototype.queryLog = function () {
- this.refs.grid1.reload();
- };
- AroundLog.prototype.showDialog2 = function () {
- var _a, _b;
- var rows = (_b = (_a = this.refs.grid1.selModel.selected) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.map(function (r) { return r.data; });
- if (!rows || rows.length <= 0)
- return;
- var dialog = new ApiInfoDialog$1();
- dialog.showDialog(null, {}, {
- data: {
- form: __assign({}, rows[0])
- }
- });
- };
- return AroundLog;
- }(Scope));
- //# sourceMappingURL=AroundLog.js.map
- var model$l = {
- data: {
- form2: {
- key: "",
- start_at: "",
- end_at: "",
- }
- }
- };
- var vjson$k = {
- title: '日志查询',
- layout: 'fit',
- tbar: {
- xtype: 'toolbar',
- items: [
- {
- xtype: 'button',
- text: '刷新',
- listeners: {
- click: 'scope.queryLog'
- },
- },
- {
- xtype: 'button',
- text: '周围日志',
- bind: {},
- listeners: {
- click: 'scope.aroundLogs'
- },
- },
- ],
- },
- items: [
- {
- region: 'center',
- xtype: 'yvgrid',
- layout: 'fit',
- reference: 'grid1',
- pagination: true,
- autoLoad: false,
- selModel: {
- selType: 'rowmodel',
- mode: 'SINGLE',
- },
- dataSource: {
- method: 'invoke',
- url: '/sys/api/Api@queryLog',
- params: {
- formData: '{form2}',
- path: '{form.api_url}',
- },
- },
- listeners: {
- rowdblclick: 'scope.showDialog',
- },
- columns: [
- { dataIndex: "@timestamp", header: "时间", width: 150 },
- // {dataIndex: "nodeName", header: "nodeName", width: 80},
- { dataIndex: "thread", header: "thread", width: 150 },
- { dataIndex: "message", header: "message", flex: 1 },
- ]
- }
- ]
- };
- var LogPage = /** @class */ (function (_super) {
- __extends(LogPage, _super);
- function LogPage() {
- return _super.call(this, { model: model$l, vjson: vjson$k }) || this;
- }
- LogPage.prototype.onLoad = function () {
- _super.prototype.onLoad.call(this);
- this.queryLog();
- };
- LogPage.prototype.queryLog = function () {
- this.refs.grid1.reload();
- };
- LogPage.prototype.showDialog = function () {
- var _a, _b;
- var rows = (_b = (_a = this.refs.grid1.selModel.selected) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.map(function (r) { return r.data; });
- if (!rows || rows.length <= 0)
- return;
- var dialog = new ApiInfoDialog$1();
- dialog.showDialog(null, {}, {
- data: {
- form: __assign({}, rows[0])
- }
- });
- };
- LogPage.prototype.aroundLogs = function () {
- var _a, _b;
- var rows = (_b = (_a = this.refs.grid1.selModel.selected) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.map(function (r) { return r.data; });
- if (!rows || rows.length <= 0)
- return;
- var dialog = new AroundLog();
- dialog.showDialog(null, {}, {
- data: {
- form2: __assign({}, rows[0])
- }
- });
- };
- return LogPage;
- }(Scope));
- //# sourceMappingURL=LogPage.js.map
- var Controller$2 = /** @class */ (function () {
- function Controller() {
- }
- Controller.prototype.queryLog = function () {
- var form2 = this.getViewModel().get("form2");
- var logPage = new LogPage();
- logPage.showPage({}, {
- data: {
- form2: __assign({}, form2)
- }
- });
- };
- return Controller;
- }());
- var controller$2 = new Controller$2();
- function initLogsTree () {
- Ext.define('com.yvan.studio.LogsTree', {
- extend: 'Ext.panel.Panel',
- xtype: 'logstree',
- controller: controller$2,
- scope: controller$2,
- viewModel: {
- data: {
- form2: {
- key: "",
- start_at: "",
- end_at: "",
- }
- }
- },
- reference: 'logstree',
- tooltip: '表单定义',
- iconCls: 'x-fa fa-bar-chart',
- useArrows: true,
- rootVisible: false,
- colspan: 2,
- lines: true,
- multiSelect: false,
- referenceHolder: true,
- items: [
- {
- region: 'north',
- xtype: 'form',
- reference: 'form2',
- split: true,
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '关键字',
- bind: {
- value: "{form2.key}"
- },
- },
- {
- xtype: 'datefield',
- fieldLabel: '开始时间',
- bind: {
- value: "{form2.start_at}"
- },
- },
- {
- xtype: 'datefield',
- fieldLabel: '结束时间',
- bind: {
- value: "{form2.end_at}"
- },
- },
- ]
- },
- {
- xtype: "cols",
- items: [
- {
- xtype: "box",
- },
- {
- xtype: "button",
- text: '查询',
- listeners: {
- click: 'queryLog'
- },
- },
- {
- xtype: "box",
- },
- ]
- },
- ],
- });
- }
- //# sourceMappingURL=LogsTree.js.map
- var model$m = {
- data: {
- // opsId: "",
- // name: "",
- running: false,
- }
- };
- //# sourceMappingURL=DevOpsTerminal.model.js.map
- var vjson$l = {
- bind: {
- title: '运维-{name}',
- },
- layout: 'fit',
- items: [
- {
- layout: 'border',
- items: [
- {
- region: 'north',
- items: [
- {
- xtype: 'toolbar',
- border: false,
- items: [
- {
- xtype: 'button',
- text: '执行',
- iconCls: 'x-fa fa-play',
- bind: {
- hidden: "{running}",
- },
- listeners: {
- click: 'scope.start'
- }
- },
- {
- xtype: 'button',
- text: '停止',
- iconCls: 'x-fa fa-stop',
- bind: {
- hidden: "{!running}",
- },
- listeners: {
- click: 'scope.stop'
- }
- },
- ],
- },
- ]
- },
- {
- region: 'center',
- reference: 'terminal',
- xtype: 'terminal',
- },
- ],
- },
- ],
- };
- //# sourceMappingURL=DevOpsTerminal.view.js.map
- var DevOpsTerminal = /** @class */ (function (_super) {
- __extends(DevOpsTerminal, _super);
- function DevOpsTerminal() {
- var _this = _super.call(this, { model: model$m, vjson: vjson$l }) || this;
- _this.websocket = undefined;
- return _this;
- }
- DevOpsTerminal.prototype.onLoad = function () {
- this.load();
- };
- DevOpsTerminal.prototype.onDestroy = function () {
- if (this.websocket) {
- this.websocket.close();
- this.websocket = undefined;
- }
- };
- DevOpsTerminal.prototype.load = function () {
- var _this = this;
- var opsId = this.viewModel.get('opsId');
- this.setLoading(true);
- devOpsById(opsId).then(function (res) {
- _this.viewModel.set('devOps', res.data);
- }).finally(function () {
- _this.setLoading(false);
- });
- };
- DevOpsTerminal.prototype.start = function () {
- var me = this;
- var running = this.viewModel.get('running');
- var devOps = this.viewModel.get('devOps');
- if (running || !(devOps === null || devOps === void 0 ? void 0 : devOps.host) || !(devOps === null || devOps === void 0 ? void 0 : devOps.cmd_tpl))
- return;
- var devopsServer = "ws://122.9.140.63:9999";
- this.websocket = new WebSocket(devopsServer + "/ssh?token=b78f3e0ada722acb7a14ac1a4b19f10d03197eabac39ea92e511bb38b9e3a91f79a87e9699427b83c55591f79a55ca87479b259fc304");
- this.websocket.addEventListener('open', function () {
- me.viewModel.set('running', true);
- me.websocket.send(JSON.stringify({ host: devOps.host, cmd: devOps.cmd_tpl }));
- });
- this.websocket.addEventListener('message', function (event) {
- me.refs.terminal.write(event.data);
- });
- this.websocket.addEventListener('close', function () {
- me.stop();
- });
- this.websocket.addEventListener('error', function () {
- me.stop();
- });
- };
- DevOpsTerminal.prototype.stop = function () {
- if (this.websocket) {
- this.websocket.close();
- this.websocket = undefined;
- }
- this.viewModel.set('running', false);
- };
- return DevOpsTerminal;
- }(Scope));
- //# sourceMappingURL=DevOpsTerminal.js.map
- var Controller$3 = /** @class */ (function () {
- function Controller() {
- }
- Controller.prototype.onLoad = function (sender) {
- this.reload();
- };
- Controller.prototype.reload = function () {
- var me = this;
- // @ts-ignore
- var view = me.getView();
- view.setLoading(true);
- devOpsList().then(function (res) {
- view.setStore(new Ext.data.Store({
- fields: ['ops_id', 'host', 'name'],
- data: res.data,
- }));
- }).finally(function () {
- view.setLoading(false);
- });
- };
- Controller.prototype.onDblClick = function (sender) {
- this.devOpsTerminal();
- };
- Controller.prototype.devOpsTerminal = function () {
- // @ts-ignore
- var view = this.getView();
- var _a = __read(view.getSelection(), 1), record = _a[0];
- if (record) {
- var name = record.get('name');
- var opsId = record.get('ops_id');
- var instance = new DevOpsTerminal();
- instance.showPage({
- id: 'ops_' + opsId,
- path: 'ops_' + opsId,
- }, {
- data: {
- opsId: opsId,
- name: name,
- }
- });
- instance.dialogSuccess = function () {
- };
- }
- };
- return Controller;
- }());
- var controller$3 = new Controller$3();
- function initDevOpsTree () {
- Ext.define('com.yvan.studio.DevOpsGrid', {
- extend: 'Ext.grid.Panel',
- xtype: 'devopsgrid',
- controller: controller$3,
- scope: controller$3,
- referenceHolder: true,
- tooltip: '运维',
- iconCls: 'x-fa fa-terminal',
- useArrows: true,
- reference: 'devopsgrid',
- selModel: { type: 'rowmodel', mode: 'SINGLE', },
- listeners: {
- afterrender: 'onLoad',
- itemdblclick: 'onDblClick',
- },
- viewConfig: {
- // listeners: {
- // itemcontextmenu: 'onGridContextMenu',
- // },
- },
- tbar: {
- xtype: 'toolbar',
- items: [
- {
- xtype: 'button',
- tooltip: '刷新',
- iconCls: 'x-fa fa-refresh',
- listeners: {
- click: 'reload'
- }
- },
- {
- xtype: 'textfield',
- flex: 1,
- emptyText: '搜索过滤',
- enableKeyEvents: true,
- listeners: {
- change: {
- fn: 'filterChanged',
- buffer: 50
- }
- }
- },
- ]
- },
- columns: [
- {
- text: 'ID', dataIndex: 'report_id',
- hidden: true,
- },
- {
- text: '服务器',
- dataIndex: 'host',
- width: 100,
- menuDisabled: true,
- },
- {
- text: '操作名称',
- dataIndex: 'name',
- flex: 1,
- menuDisabled: true,
- },
- ]
- });
- }
- //# sourceMappingURL=DevOpsTree.js.map
- function initTerminal () {
- Ext.define('com.yvan.studio.Terminal', {
- extend: 'Ext.panel.Panel',
- alias: 'widget.terminal',
- xtype: 'terminal',
- layout: 'fit',
- border: false,
- html: "<div class=\"terminal\" style=\"height: 100%;\"/>",
- config: {},
- write: function (str) {
- if (this.term) {
- this.term.write(str);
- }
- },
- initComponent: function () {
- var that = this;
- this.superclass.initComponent.call(this, arguments);
- that.on({
- resize: function () {
- var _a;
- if ((_a = that.fitAddon) === null || _a === void 0 ? void 0 : _a.fit) {
- that.fitAddon.fit();
- }
- },
- destory: function () {
- if (that.term) {
- that.term.dispose();
- delete that.term;
- }
- if (that.fitAddon) {
- that.fitAddon.dispose();
- delete that.fitAddon;
- }
- },
- afterrender: function (sender) {
- _.defer(function () {
- var $dom = $(that.el.dom).find('.terminal');
- that.term = new xterm.Terminal({
- // cursorBlink: false,
- // cursorStyle: 'bar', // block underline bar
- // enableBold: false,
- // bellStyle: "sound",
- fontFamily: '"DejaVu Sans Mono", "Everson Mono", FreeMono, Menlo, Terminal, monospace, Consolas',
- // scrollback: 10000,
- // tabStopWidth: 4,
- disableStdin: true,
- theme: {
- // foreground: "#111",
- // background: "#fdfdfd",
- // background: "#fafafa",
- },
- });
- that.fitAddon = new xtermAddonFit.FitAddon();
- that.term.loadAddon(that.fitAddon);
- that.term.open($dom[0]);
- that.fitAddon.fit();
- // that.term.write('Hello from \x1B[1;3;31mxterm.js\x1B[0m $ ')
- });
- }
- });
- }
- });
- }
- //# sourceMappingURL=Terminal.js.map
- var vjson$m = {
- title: '接口统计',
- layout: 'fit',
- items: [
- {
- title: '接口统计',
- xtype: 'yvgrid',
- enableLocking: false,
- reference: 'grid1',
- pagination: false,
- selModel: { type: 'rowmodel', mode: 'SINGLE', },
- tbar: {
- xtype: 'form',
- items: [
- {
- xtype: 'cols',
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '搜索',
- listeners: {
- change: 'scope.requestFilterChange'
- }
- },
- ]
- },
- ]
- },
- columns: [
- { text: '地址', dataIndex: 'url', flex: 1 },
- { text: '数据库请求', dataIndex: 'jdbcCount', dataType: 'number' },
- { text: '次数', dataIndex: 'count', dataType: 'number' },
- { text: '总耗时', dataIndex: 'sumCost', dataType: 'number' },
- { text: '平均耗时', dataIndex: 'avgCost', dataType: 'number' },
- { text: '最大耗时', dataIndex: 'maxCost', dataType: 'number' },
- { text: '最小耗时', dataIndex: 'minCost', dataType: 'number' },
- { text: '直方图', dataIndex: 'histogram', width: 180 },
- ],
- leadingBufferZone: 8,
- trailingBufferZone: 8,
- viewConfig: {
- listeners: {
- expandbody: 'scope.onChildExpand'
- }
- },
- listeners: {
- itemdblclick: 'scope.itemClick1'
- },
- plugins: {
- rowwidget: {
- widget: {
- xtype: 'yvgrid',
- hideFootbar: true,
- selModel: { type: 'rowmodel', mode: 'SINGLE', },
- listeners: {
- itemdblclick: 'scope.itemClick1'
- },
- columns: [
- { text: 'SQL', dataIndex: 'sql', flex: 1 },
- { text: '次数', dataIndex: 'count', dataType: 'number' },
- { text: '总耗时', dataIndex: 'sumCost', dataType: 'number' },
- { text: '平均耗时', dataIndex: 'avgCost', dataType: 'number' },
- { text: '最大耗时', dataIndex: 'maxCost', dataType: 'number' },
- { text: '最小耗时', dataIndex: 'minCost', dataType: 'number' },
- { text: '直方图', dataIndex: 'histogram', width: 180 },
- ]
- }
- }
- }
- },
- ]
- };
- //# sourceMappingURL=InterfaceStatistics.view.js.map
- var model$n = {
- data: {
- count: 0,
- dataSourceName: '',
- sql: "",
- histogram: '',
- maxCost: 0,
- minCost: 0,
- avgCost: '',
- sumCost: 0,
- histogramInfos: [
- // count: 1
- // gteCost: 20
- // ltCost: 50
- // sql: "select sys_resource.resource_id, sys_resource.resource_name, sys_resource.resource_parent, sys_resource.resource_type, sys_resource.resource_icon, sys_resource.scope_url, sys_resource.scope_params, sys_resource.resource_order, sys_resource.permission_code, sys_resource.is_user_relation, sys_resource.is_role_relation, sys_resource.is_enable, sys_resource.create_by, sys_resource.create_at, sys_resource.update_by, sys_resource.update_at\nfrom sys_resource sys_resource\nwhere sys_resource.resource_type = ?\norder by sys_resource.resource_order asc"
- // topN: [
- // cost: 24
- // occurrenceTime: "1648004895171"
- // sql: "select sys_resource.resource_id, sys_resource.resource_name, sys_resource.resource_parent, sys_resource.resource_type, sys_resource.resource_icon, sys_resource.scope_url, sys_resource.scope_params, sys_resource.resource_order, sys_resource.permission_code, sys_resource.is_user_relation, sys_resource.is_role_relation, sys_resource.is_enable, sys_resource.create_by, sys_resource.create_at, sys_resource.update_by, sys_resource.update_at\nfrom sys_resource sys_resource\nwhere sys_resource.resource_type = 3\norder by sys_resource.resource_order asc"
- // ]
- ]
- }
- };
- //# sourceMappingURL=PerformDialog.model.js.map
- var vjson$n = {
- title: '性能统计详情',
- height: 400,
- width: 800,
- modal: true,
- layout: 'fit',
- items: [
- {
- xtype: 'tabpanel',
- items: [
- {
- title: '摘要',
- key: "1",
- layout: 'border',
- items: [
- {
- region: 'north',
- border: false,
- defaults: {
- margin: '8 0 0 0'
- },
- items: [
- {
- xtype: 'cols',
- defaultType: 'displayfield',
- defaults: {
- labelWidth: 70,
- },
- items: [
- {
- fieldLabel: 'count',
- bind: {
- value: '{count}'
- }
- },
- {
- fieldLabel: 'maxCost',
- bind: {
- value: '{maxCost}'
- }
- },
- {
- fieldLabel: 'minCost',
- bind: {
- value: '{minCost}'
- }
- },
- {
- fieldLabel: 'avgCost',
- bind: {
- value: '{avgCost}'
- }
- },
- {
- fieldLabel: 'sumCost',
- bind: {
- value: '{sumCost}'
- }
- },
- ]
- },
- {
- xtype: 'cols',
- items: [
- {
- flex: 5,
- border: false,
- items: [
- {
- xtype: 'segmentedbutton',
- reference: 'histogram',
- allowToggle: false,
- border: false,
- items: []
- }
- ]
- },
- ]
- },
- ],
- },
- {
- region: 'center',
- xtype: 'sqleditor',
- reference: 'sqlEditor',
- },
- ]
- },
- {
- title: '直方图',
- key: "2",
- }
- ]
- }
- ]
- };
- //# sourceMappingURL=PerformDialog.view.js.map
- var PerformDialog = /** @class */ (function (_super) {
- __extends(PerformDialog, _super);
- function PerformDialog() {
- return _super.call(this, { model: model$n, vjson: vjson$n }) || this;
- }
- PerformDialog.prototype.onLoad = function () {
- var _this = this;
- var sql = this.viewModel.get('sql');
- var sql2 = sqlFormat.format(sql, {
- indent: ' ',
- uppercase: true,
- });
- var histogramInfos = this.viewModel.get('histogramInfos');
- var vs = _$2.map(histogramInfos, function (v) {
- if (v.ltCost > 2100000000) {
- return {
- text: "[" + v.gteCost + ", \u221E):" + v.count
- };
- }
- return {
- text: "[" + v.gteCost + ", " + v.ltCost + "):" + v.count
- };
- });
- this.refs.sqlEditor.setCode(sql2);
- _$2.forEach(vs, function (v) {
- _this.refs.histogram.add(v);
- });
- };
- return PerformDialog;
- }(Scope));
- //# sourceMappingURL=PerformDialog.js.map
- var model$o = {
- data: {}
- };
- var PerformStats = /** @class */ (function (_super) {
- __extends(PerformStats, _super);
- function PerformStats() {
- var _this = _super.call(this, { model: model$o, vjson: vjson$m }) || this;
- _this.requestFilterChange = _.debounce(function (sender, value) {
- var store = _this.refs.grid1.store;
- store.clearFilter();
- if (value) {
- store.filterBy(function (record, id) {
- var text = toString(record.get('url'));
- // 用拼音筛选的方式
- return text.includes(value);
- });
- }
- }, 100);
- return _this;
- }
- PerformStats.prototype.onChildExpand = function (rowNode, record, expandRow, widget) {
- widget.setData(record.data.children);
- };
- PerformStats.prototype.itemClick1 = function (sender, record) {
- console.log('itemClick1', record.data);
- new PerformDialog().showDialog(sender, {}, {
- data: record.data
- });
- };
- PerformStats.prototype.onLoad = function () {
- var _this = this;
- Promise.all([metricsRequestApi(), metricsJdbcApi()])
- .then(function (_a) {
- var _b = __read(_a, 2), reqRes = _b[0], jdbcRes = _b[1];
- var resData = reqRes.data;
- var jdbcData = jdbcRes.data;
- _.forEach(jdbcData, function (item) {
- item.histogram = JSON.stringify(_.reverse(_.map(item === null || item === void 0 ? void 0 : item.histogramInfos, function (h) { return h.count; })));
- });
- _.forEach(resData, function (item) {
- item.histogram = JSON.stringify(_.reverse(_.map(item === null || item === void 0 ? void 0 : item.histogramInfos, function (h) { return h.count; })));
- if (_.isArray(item.sqls)) {
- item.children = _.map(item.sqls, function (sql) {
- return _.find(jdbcData, function (r) { return r.sql === sql; });
- }).filter(function (v) { return !!v; });
- }
- item.jdbcCount = _.size(item.children);
- });
- _this.refs.grid1.setData(resData);
- // this.refs.grid2.setData(jdbcData)
- });
- };
- return PerformStats;
- }(Scope));
- //# sourceMappingURL=InterfaceStatistics.js.map
- var vjson$o = {
- title: '性能统计',
- layout: 'fit',
- items: [
- {
- title: '数据库统计',
- xtype: 'yvgrid',
- enableLocking: false,
- reference: 'grid2',
- pagination: false,
- selModel: { type: 'rowmodel', mode: 'SINGLE', },
- tbar: {
- xtype: 'form',
- items: [
- {
- xtype: 'cols',
- items: [
- {
- fieldLabel: '搜索',
- listeners: {
- change: 'scope.jdbcFilterChange'
- }
- },
- ]
- },
- ]
- },
- listeners: {
- itemdblclick: 'scope.itemClick1'
- },
- columns: [
- { text: 'SQL', dataIndex: 'sql', flex: 1 },
- { text: '次数', dataIndex: 'count', dataType: 'number' },
- { text: '总耗时', dataIndex: 'sumCost', dataType: 'number' },
- { text: '平均耗时', dataIndex: 'avgCost', dataType: 'number' },
- { text: '最大耗时', dataIndex: 'maxCost', dataType: 'number' },
- { text: '最小耗时', dataIndex: 'minCost', dataType: 'number' },
- { text: '直方图', dataIndex: 'histogram', width: 180 },
- ]
- },
- ]
- };
- //# sourceMappingURL=DatabaseStatistics.view.js.map
- var model$p = {
- data: {}
- };
- var PerformStats$1 = /** @class */ (function (_super) {
- __extends(PerformStats, _super);
- function PerformStats() {
- var _this = _super.call(this, { model: model$p, vjson: vjson$o }) || this;
- _this.jdbcFilterChange = _.debounce(function (sender, value) {
- var store = _this.refs.grid2.store;
- store.clearFilter();
- if (value) {
- store.filterBy(function (record, id) {
- var text = toString(record.get('sql'));
- // 用拼音筛选的方式
- return text.includes(value);
- });
- }
- }, 100);
- return _this;
- }
- PerformStats.prototype.onChildExpand = function (rowNode, record, expandRow, widget) {
- widget.setData(record.data.children);
- };
- PerformStats.prototype.itemClick1 = function (sender, record) {
- console.log('itemClick1', record.data);
- new PerformDialog().showDialog(sender, {}, {
- data: record.data
- });
- };
- PerformStats.prototype.onLoad = function () {
- var _this = this;
- Promise.all([metricsRequestApi(), metricsJdbcApi()])
- .then(function (_a) {
- var _b = __read(_a, 2), reqRes = _b[0], jdbcRes = _b[1];
- var resData = reqRes.data;
- var jdbcData = jdbcRes.data;
- _.forEach(jdbcData, function (item) {
- item.histogram = JSON.stringify(_.reverse(_.map(item === null || item === void 0 ? void 0 : item.histogramInfos, function (h) { return h.count; })));
- });
- _.forEach(resData, function (item) {
- item.histogram = JSON.stringify(_.reverse(_.map(item === null || item === void 0 ? void 0 : item.histogramInfos, function (h) { return h.count; })));
- if (_.isArray(item.sqls)) {
- item.children = _.map(item.sqls, function (sql) {
- return _.find(jdbcData, function (r) { return r.sql === sql; });
- }).filter(function (v) { return !!v; });
- }
- item.jdbcCount = _.size(item.children);
- });
- _this.refs.grid2.setData(jdbcData);
- });
- };
- return PerformStats;
- }(Scope));
- //# sourceMappingURL=DatabaseStatistics.js.map
- var Controller$4 = /** @class */ (function () {
- function Controller() {
- }
- Controller.prototype.onDblClick = function (sender, record) {
- var data = record.raw;
- if (data.text === "接口统计") {
- var page = new PerformStats();
- page.showPage({
- title: "接口统计",
- id: '_InterfaceStatistics',
- path: '_InterfaceStatistics',
- }, {});
- }
- else if (data.text === "数据库统计") {
- var page = new PerformStats$1();
- page.showPage({
- title: "数据库统计",
- id: '_DatabaseStatistics',
- path: '_DatabaseStatistics',
- }, {});
- }
- };
- Controller.prototype.onLoad = function () {
- var me = this;
- //@ts-ignore
- var view = me.getView();
- view.setRootNode({
- expanded: true,
- leaf: false,
- children: [
- { leaf: true, text: '接口统计' },
- { leaf: true, text: '数据库统计' },
- ]
- });
- };
- return Controller;
- }());
- var controller$4 = new Controller$4();
- function initMonitorTree () {
- Ext.define('com.yvan.studio.MonitorTree', {
- extend: 'Ext.tree.Panel',
- xtype: 'monitortree',
- controller: controller$4,
- scope: controller$4,
- reference: 'roleGrid',
- tooltip: '表单定义',
- iconCls: 'x-fa fa-bar-chart',
- useArrows: true,
- rootVisible: false,
- colspan: 2,
- lines: true,
- multiSelect: false,
- referenceHolder: true,
- // openNode() {
- // const selection = this.getSelection()
- // const [record] = selection
- // if (!record) {
- // return
- // }
- //
- // const {raw} = record;
- // if (raw.type === 'Dir') {
- // return
- // }
- // if (raw.type === "Module" && raw.module) {
- // // eventBus.publish(EventType.ModuleOpen, raw)
- // }
- // },
- listeners: {
- itemdblclick: 'onDblClick',
- afterrender: "onLoad",
- },
- });
- }
- //# sourceMappingURL=MonitorTree.js.map
- var Controller$5 = /** @class */ (function () {
- function Controller() {
- }
- return Controller;
- }());
- var controller$5 = new Controller$5();
- function initHomeTree () {
- Ext.define('com.yvan.studio.HomeTree', {
- extend: 'Ext.Panel',
- xtype: 'hometree',
- controller: controller$5,
- scope: controller$5,
- referenceHolder: true,
- bodyCls: 'home',
- // layout: 'fit',
- tbar: {
- xtype: 'toolbar',
- items: [
- {
- xtype: 'button',
- iconCls: 'x-fa fa-exchange',
- text: '数据结构同步',
- handler: function (sender) {
- handles$1.mainWindow.showDataSync(sender);
- }
- },
- {
- xtype: 'button',
- iconCls: 'x-fa fa-cubes',
- text: '数据域管理',
- handler: function (sender) {
- handles$1.mainWindow.showColumnDomain();
- }
- },
- ],
- },
- // items: [
- //
- // ],
- layout: {
- type: 'vbox',
- pack: 'start',
- align: 'stretch',
- },
- items: [
- { html: '<div class="title">功能模块:</div><div class="subtitle">1134</div>' },
- { html: '<div class="title">查询模块:</div><div class="subtitle">4</div>' },
- { html: '<div class="title">数据表格:</div><div class="subtitle">265</div>' },
- { html: '<div class="title">字段域:</div><div class="subtitle">17</div>' },
- { html: '<div class="title">检索窗口:</div><div class="subtitle">38</div>' },
- { html: '<div class="title">接口平台:</div><div class="subtitle">16</div>' },
- { html: '<div class="title">计划任务:</div><div class="subtitle">0</div>' },
- { html: '<div class="title">工作流:</div><div class="subtitle">4</div>' },
- { html: '<div class="title">字典:</div><div class="subtitle">162</div>' },
- ],
- });
- }
- //# sourceMappingURL=HomeTree.js.map
- var WidgetStore = /** @class */ (function (_super) {
- __extends(WidgetStore, _super);
- function WidgetStore() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- WidgetStore.prototype.getCacheKey = function (param) {
- return "widget_data.json";
- };
- /*invokeApi(param: any): Promise<any> {
- return new Promise<any>(resolve => {
- //@ts-ignore
- require(["../../widget/all"], function (res) {
- const widgetList = res.default
- resolve(widgetList)
- })
- })
- }*/
- WidgetStore.prototype.invokeApi = function (param) {
- return widgetListApi(param);
- };
- return WidgetStore;
- }(CacheStore));
- var instance$3 = new WidgetStore();
- //# sourceMappingURL=WidgetStore.js.map
- var WidgetGridController = /** @class */ (function () {
- function WidgetGridController() {
- }
- WidgetGridController.prototype.onLoad = function (sender) {
- var me = this;
- setWidget(me);
- instance$3.registe(me.reloadData.bind(this));
- instance$3.reloadIfNeed(undefined);
- };
- WidgetGridController.prototype.widgetAdd = function (sender) {
- var me = this;
- var win = new Ext.Window({
- autoDestroy: true,
- title: "新建弹框",
- width: 400,
- height: 220,
- resizable: true,
- closable: true,
- maximizable: true,
- minimizable: true,
- plain: true,
- // constrainHeader: true,
- constrain: true,
- layout: 'fit',
- animateTarget: sender,
- buttonAlign: 'center',
- items: [
- {
- xtype: "form",
- layout: "hbox",
- margin: '10px 20px',
- border: 0,
- items: [
- {
- flex: 1,
- layout: 'vbox',
- items: [
- {
- xtype: "textfield",
- name: "widgetcode",
- fieldLabel: "弹窗文件",
- flex: 1,
- allowBlank: false,
- regex: /^[a-zA-Z][a-zA-Z0-9]*$/,
- regexText: "编号名只能以英文字母开头,且只包含英文字母、数字",
- labelWidth: 80,
- width: "100%",
- },
- {
- xtype: "textfield",
- name: "widgetname",
- fieldLabel: "弹窗名称",
- flex: 1,
- allowBlank: false,
- labelWidth: 80,
- width: "100%",
- },
- ]
- },
- ]
- }
- ],
- //窗口按钮
- buttons: [
- {
- xtype: 'button', text: '保存', handler: function (btn) {
- //窗口获取表单
- var form = win.down('form');
- var vaildSuccess = form.isValid();
- if (!vaildSuccess) {
- return;
- }
- var title = form.down('textfield[name="widgetname"]').getValue();
- var widgetPath = form.down('textfield[name="widgetcode"]').getValue();
- saveWidget({ widgetPath: widgetPath, form: { title: title } }).then(function (res) {
- if (res.success) {
- msg$1('添加成功');
- // 添加
- handles$1.mainWindow.showWidget(widgetPath, title, function () {
- me.reload();
- });
- win.close();
- }
- });
- }
- },
- {
- xtype: 'button', text: '取消', handler: function (btn) {
- //窗口关闭
- win.close();
- }
- }
- ]
- });
- win.show();
- };
- WidgetGridController.prototype.widgetRemove = function (sender) {
- var _this = this;
- //@ts-ignore
- var record = this.getView().selection.data;
- if (!record) {
- msg$1('请选择一行');
- return;
- }
- var widgetPath = record.widget_path;
- Ext.Msg.confirm('提示', "是否删除弹框:" + widgetPath + "?", function (btn) {
- if (btn === 'yes') {
- deleteWidget({ widgetPath: widgetPath }).then(function (res) {
- if (res.success) {
- msg$1(res.msg);
- _this.reload();
- }
- });
- }
- });
- };
- WidgetGridController.prototype.widgetEdit = function (record) {
- var _this = this;
- if (record) {
- var widgetPath = record.widget_path;
- var widgetName = record.widget_name;
- handles$1.mainWindow.showWidget(widgetPath, widgetName, function () {
- _this.reload();
- });
- }
- };
- WidgetGridController.prototype.onDestory = function (sender) {
- var me = this;
- setWidget(undefined);
- instance$3.unregiste(me.reloadData.bind(this));
- };
- WidgetGridController.prototype.reloadData = function (res) {
- var me = this;
- //@ts-ignore
- var view = me.getView();
- if (typeof res === 'object') {
- // const data = []
- // _.forOwn(res, (v, k) => {
- // data.push({
- // widget_path: k,
- // widget_name: v.title,
- // vjson : v
- // })
- // })
- view.setStore(new Ext.data.Store({
- fields: ['widget_path', 'widget_name'],
- data: res.data,
- }));
- }
- else if (typeof res === 'boolean') {
- view.setLoading(res);
- }
- };
- WidgetGridController.prototype.reload = function () {
- instance$3.reloadForce(undefined);
- };
- WidgetGridController.prototype.filterChanged = function (sender, value) {
- //@ts-ignore
- this.view.store.clearFilter();
- if (value) {
- //@ts-ignore
- this.view.store.filterBy(function (record) {
- var widget_path = record.get('widget_path');
- var widget_name = record.get('widget_name');
- return (window['system'].pinyinMatch(widget_name, value) ||
- _$2.includes(_$2.toLower(widget_path), _$2.toLower(value)));
- });
- }
- };
- WidgetGridController.prototype.onClearClick = function () {
- var _a, _b;
- //@ts-ignore
- (_b = (_a = this.getReferences()) === null || _a === void 0 ? void 0 : _a.txtFilter) === null || _b === void 0 ? void 0 : _b.setValue('');
- };
- WidgetGridController.prototype.onDblClick = function (sender, record) {
- this.widgetEdit(record.data);
- };
- return WidgetGridController;
- }());
- //# sourceMappingURL=WidgetGridController.js.map
- function initWidget () {
- var controller = new WidgetGridController();
- Ext.define('com.yvan.studio.WidgetGrid', {
- extend: 'Ext.grid.Panel',
- xtype: 'widgetgrid',
- controller: controller,
- scope: controller,
- referenceHolder: true,
- tooltip: '检索窗口',
- iconCls: 'x-fa fa-search',
- useArrows: true,
- reference: 'widgetgrid',
- selModel: { type: 'rowmodel', mode: 'SINGLE', },
- listeners: {
- itemdblclick: 'onDblClick',
- afterrender: 'onLoad',
- destory: 'onDestory',
- },
- viewConfig: {
- listeners: {
- itemcontextmenu: 'onGridContextMenu',
- },
- },
- tbar: [
- {
- xtype: 'button',
- tooltip: '刷新',
- iconCls: 'x-fa fa-refresh',
- listeners: {
- click: 'reload'
- }
- },
- {
- xtype: 'button',
- tooltip: '添加',
- iconCls: 'x-fa fa-plus-circle',
- listeners: {
- click: 'widgetAdd'
- }
- },
- {
- xtype: 'button',
- tooltip: '删除',
- iconCls: 'x-fa fa-minus-circle',
- listeners: {
- click: 'widgetRemove'
- }
- },
- ],
- fbar: [
- {
- xtype: 'textfield',
- flex: 1,
- reference: "txtFilter",
- emptyText: '搜索过滤',
- enableKeyEvents: true,
- listeners: {
- change: {
- fn: 'filterChanged',
- buffer: 50
- }
- }
- },
- ],
- columns: [
- {
- text: '弹窗文件', dataIndex: 'widget_path',
- menuDisabled: true, flex: 1,
- },
- {
- text: '弹窗名称', dataIndex: 'widget_name',
- menuDisabled: true, flex: 1,
- },
- ]
- });
- }
- //# sourceMappingURL=WidgetGrid.js.map
- var WhLayoutController = /** @class */ (function () {
- function WhLayoutController() {
- }
- WhLayoutController.prototype.onLoad = function (sender) {
- var _this = this;
- var me = this;
- setWhLayout(me);
- _$2.defer(function () {
- _this.reload();
- });
- };
- WhLayoutController.prototype.reload = function () {
- //@ts-ignore
- var view = this.getView();
- view.setLoading(true);
- loadWhLayoutAll().then(function (res) {
- view.setStore(new Ext.data.Store({
- fields: ['layout_code', 'layout_name'],
- data: res.data,
- }));
- }).finally(function () {
- view.setLoading(false);
- });
- };
- WhLayoutController.prototype.add = function () {
- handles$1.mainWindow.showLayoutDesign(undefined, undefined);
- };
- WhLayoutController.prototype.edit = function (data) {
- handles$1.mainWindow.showLayoutDesign(data.layout_code, data.layout_name);
- };
- WhLayoutController.prototype.remove = function () {
- var _this = this;
- var _a;
- //@ts-ignore
- var view = this.getView();
- var record = (_a = view.selection) === null || _a === void 0 ? void 0 : _a.data;
- if (!record) {
- msg$1('请选择一行数据');
- return;
- }
- var layoutCode = record.layout_code;
- Ext.Msg.confirm('提示', "是否删除图形:" + layoutCode + "?", function (btn) {
- if (btn === 'yes') {
- deleteWhLayout({ layoutCode: layoutCode }).then(function (res) {
- if (res.success) {
- msg$1(res.msg);
- _this.reload();
- }
- });
- }
- });
- };
- WhLayoutController.prototype.onDblClick = function () {
- var _a;
- //@ts-ignore
- var view = this.getView();
- var record = (_a = view.selection) === null || _a === void 0 ? void 0 : _a.data;
- if (!record) {
- msg$1('请选择一行数据');
- return;
- }
- this.edit(record);
- };
- WhLayoutController.prototype.filterChanged = function (sender, value) {
- //@ts-ignore
- this.view.store.clearFilter();
- if (value) {
- //@ts-ignore
- this.view.store.filterBy(function (record) {
- var widget_path = record.get('widget_path');
- var widget_name = record.get('widget_name');
- return (window['system'].pinyinMatch(widget_name, value) ||
- _$2.includes(_$2.toLower(widget_path), _$2.toLower(value)));
- });
- }
- };
- WhLayoutController.prototype.onClearClick = function () {
- var _a, _b;
- //@ts-ignore
- (_b = (_a = this.getReferences()) === null || _a === void 0 ? void 0 : _a.txtFilter) === null || _b === void 0 ? void 0 : _b.setValue('');
- };
- return WhLayoutController;
- }());
- //# sourceMappingURL=WhLayoutController.js.map
- function initWhLayout () {
- var controller = new WhLayoutController();
- Ext.define('com.yvan.studio.WhLayout', {
- extend: 'Ext.grid.Panel',
- xtype: 'whlayout',
- alias: 'widget.whlayout',
- controller: controller,
- scope: controller,
- referenceHolder: true,
- tooltip: '检索窗口',
- iconCls: 'x-fa fa-search',
- useArrows: true,
- reference: 'whlayout',
- selModel: { type: 'rowmodel', mode: 'SINGLE', },
- listeners: {
- itemdblclick: 'onDblClick',
- afterrender: 'onLoad',
- destory: 'onDestory',
- },
- viewConfig: {
- listeners: {
- itemcontextmenu: 'onGridContextMenu',
- },
- },
- tbar: [
- {
- xtype: 'button',
- tooltip: '刷新',
- iconCls: 'x-fa fa-refresh',
- listeners: {
- click: 'reload'
- }
- },
- {
- xtype: 'button',
- tooltip: '添加',
- iconCls: 'x-fa fa-plus-circle',
- listeners: {
- click: 'add'
- }
- },
- {
- xtype: 'button',
- tooltip: '删除',
- iconCls: 'x-fa fa-minus-circle',
- listeners: {
- click: 'remove'
- }
- },
- ],
- fbar: [
- {
- xtype: 'textfield',
- flex: 1,
- reference: "txtFilter",
- emptyText: '搜索过滤',
- enableKeyEvents: true,
- listeners: {
- change: {
- fn: 'filterChanged',
- buffer: 50
- }
- }
- },
- ],
- columns: [
- {
- text: '图编号', dataIndex: 'layout_code',
- menuDisabled: true, flex: 1,
- },
- {
- text: '图名称', dataIndex: 'layout_name',
- menuDisabled: true, flex: 1,
- },
- ]
- });
- }
- //# sourceMappingURL=WhLayout.js.map
- var BpmnTreeController = /** @class */ (function () {
- function BpmnTreeController() {
- }
- BpmnTreeController.prototype.onLoad = function (sender) {
- this.reload();
- };
- BpmnTreeController.prototype.reload = function () {
- var me = this;
- me.getView().setLoading(true);
- exporerList().then(function (res) {
- // handles.mainWindow.modules = res.data
- // const rootNode = modulesToTreeData(res.data)
- var rootNode = res.data.tree;
- me.getView().setRootNode({
- expanded: true,
- leaf: false,
- children: rootNode
- });
- // const lastId = window.location.hash.substring(1);
- // file.selectPath(lastId)
- // if (lastId) {
- // const node = getModuleById(rootNode, lastId)
- // if (node) {
- // showDesign(node.id, node.path, node.text, node.module)
- // }
- // }
- // this.restoreState()
- }).finally(function () {
- me.getView().setLoading(false);
- });
- };
- BpmnTreeController.prototype.onLisenContextMenu = function (sender, node, element, idx, e) {
- var _this = this;
- e.preventDefault();
- var raw = node.raw;
- //const me = sender.up("treepanel").scope
- var option;
- if (raw.exporerType === 1) ;
- else if (raw.exporerType === 21) {
- if (raw.type === 'Dir') {
- option = {
- shadow: 'frame', allowOtherMenus: true,
- items: [
- {
- text: '添加',
- iconCls: 'x-fa fa-plus-circle',
- handler: function (sender) {
- var dirPath = raw.dirPath;
- handles$1.mainWindow.showFormSingle(dirPath, "", "", "");
- }
- },
- '-',
- {
- text: '新建文件夹',
- iconCls: 'x-fa fa-folder-o',
- handler: function (sender) {
- }
- }
- ]
- };
- }
- else if (raw.type === 'Model') {
- option = {
- shadow: 'frame', allowOtherMenus: true,
- items: [
- {
- text: '编辑',
- iconCls: 'x-fa fa-edit',
- handler: function (sender) {
- }
- },
- {
- text: '删除',
- iconCls: 'x-fa fa-minus-circle',
- handler: function (sender) {
- }
- },
- '-',
- {
- text: '注册(至菜单)',
- iconCls: 'x-fa fa-sign-in',
- handler: function (sender) {
- }
- },
- {
- text: '新建文件夹',
- iconCls: 'x-fa fa-folder-o',
- handler: function (sender) {
- }
- }
- ]
- };
- }
- }
- else if (raw.exporerType === 22) {
- if (raw.type === 'Dir') {
- option = {
- shadow: 'frame', allowOtherMenus: true,
- items: [
- {
- text: '添加',
- iconCls: 'x-fa fa-plus-circle',
- handler: function (sender) {
- var dirPath = raw.dirPath;
- handles$1.mainWindow.showFormBill();
- }
- },
- '-',
- {
- text: '新建文件夹',
- iconCls: 'x-fa fa-folder-o',
- handler: function (sender) {
- }
- }
- ]
- };
- }
- else if (raw.type === 'Model') {
- option = {
- shadow: 'frame', allowOtherMenus: true,
- items: [
- {
- text: '编辑',
- iconCls: 'x-fa fa-edit',
- handler: function (sender) {
- }
- },
- {
- text: '删除',
- iconCls: 'x-fa fa-minus-circle',
- handler: function (sender) {
- }
- },
- '-',
- {
- text: '注册(至菜单)',
- iconCls: 'x-fa fa-sign-in',
- handler: function (sender) {
- }
- },
- {
- text: '新建文件夹',
- iconCls: 'x-fa fa-folder-o',
- handler: function (sender) {
- }
- }
- ]
- };
- }
- }
- else if (raw.exporerType === 3) ;
- else if (raw.exporerType === 50) {
- option = {
- shadow: 'frame', allowOtherMenus: true,
- items: [
- {
- text: '新建流程',
- iconCls: 'x-fa fa-new',
- handler: function (sender) {
- _this.bpmnAdd(sender);
- }
- },
- ]
- };
- }
- else if (raw.exporerType === 51) {
- option = {
- shadow: 'frame', allowOtherMenus: true,
- items: [
- {
- text: '新建流程',
- iconCls: 'x-fa fa-new',
- handler: function (sender) {
- _this.bpmnAdd(sender);
- }
- },
- {
- text: '删除',
- iconCls: 'x-fa fa-minus-circle',
- handler: function (sender) {
- _this.bpmnDelete(sender, raw);
- }
- },
- ]
- };
- }
- else {
- throw Error('暂时不支持!');
- }
- if (option) {
- var treeMenu = new Ext.menu.Menu(option);
- treeMenu.showAt(e.getXY());
- }
- };
- BpmnTreeController.prototype.bpmnAdd = function (sender) {
- var _this = this;
- prompt$2('输入工作流名称').then(function (name) {
- createBpmn("", name).then(function (res) {
- if (res.success) {
- msg$1('添加成功');
- }
- _this.reload();
- });
- });
- };
- BpmnTreeController.prototype.bpmnDelete = function (sender, raw) {
- var _this = this;
- YvanUI.confirm("\u771F\u7684\u8981\u5220\u9664 \"" + raw.text + "\" ?").then(function () {
- deleteBpmn(raw.absolutePath, raw.text).then(function (res) {
- if (res.success) {
- msg$1('添加成功');
- }
- _this.reload();
- });
- });
- };
- BpmnTreeController.prototype.reportAdd = function (sender) {
- var _this = this;
- prompt$2('请输入报表名称').then(function (name) {
- createReportApi(name).then(function (res) {
- if (res.success) {
- msg$1('添加成功');
- handles$1.mainWindow.showReport(res.data, name, function () {
- _this.reload();
- });
- }
- _this.reload();
- });
- });
- };
- BpmnTreeController.prototype.reportRegiste = function (sender, record) {
- if (record) {
- var reportName = record.get('report_name');
- var reportId = record.get('report_id');
- registerModule(sender, 'REPORT__' + reportId, reportName, 'x-fa fa-search');
- }
- };
- BpmnTreeController.prototype.reportRemove = function (sender, record) {
- var _this = this;
- if (record) {
- var reportName = record.get('report_name');
- var reportId_1 = record.get('report_id');
- YvanUI.confirm("\u771F\u7684\u8981\u5220\u9664 \"" + reportName + "\" ?").then(function () {
- delReportApi(reportId_1).then(function (res) {
- if (res.success) {
- msg$1('删除成功');
- _this.reload();
- }
- });
- });
- }
- };
- BpmnTreeController.prototype.reportEdit = function (sender, record) {
- var _this = this;
- if (!record || record.type !== 'Module') {
- return;
- }
- var reportName = record.text;
- var reportId = record.target;
- handles$1.mainWindow.showReport(reportId, reportName, function () {
- _this.reload();
- });
- };
- BpmnTreeController.prototype.onDblClick = function (sender, record, eOpts) {
- var data = record.raw;
- if (data.type !== 'Module' && data.type !== 'Dir') {
- return;
- }
- // TODO 10:查询报表, 20:表单,30:弹出框,40:字典,50:工作流,60:定时任务,70:系统参数
- if (data.exporerType === 10) { // 表单
- // this.reportEdit(sender, data)
- handles$1.mainWindow.showReport();
- }
- else if (data.exporerType === 21) {
- handles$1.mainWindow.showFormSingle(data.dirPath, data.absolutePath, data.id, data.id);
- }
- else if (data.exporerType === 22) {
- handles$1.mainWindow.showFormBill();
- }
- else if (data.exporerType === 30) {
- handles$1.mainWindow.showWidgetDesign();
- }
- else if (data.exporerType === 51) {
- handles$1.mainWindow.showBmpnDesign(data.absolutePath, data.id, data.text);
- }
- else {
- throw Error('暂时不支持!');
- }
- };
- return BpmnTreeController;
- }());
- var controller$6 = new BpmnTreeController();
- function initBpmnTree () {
- Ext.define('com.yvan.studio.BpmnTree', {
- extend: 'Ext.tree.Panel',
- //extend: 'com.yvan.studio.StateTree',
- xtype: 'bpmntree',
- controller: controller$6,
- scope: controller$6,
- tooltip: '表单定义',
- iconCls: 'x-fa fa-random',
- useArrows: true,
- rootVisible: false,
- colspan: 2,
- lines: true,
- multiSelect: true,
- reload: function () {
- this.controller.reload.call(this, arguments);
- },
- openNode: function () {
- var selection = this.getSelection();
- var _a = __read(selection, 1), record = _a[0];
- if (!record) {
- return;
- }
- var raw = record.raw;
- if (raw.type === 'Dir') {
- return;
- }
- if (raw.type === "Module" && raw.module) ;
- },
- listeners: {
- itemdblclick: 'onDblClick',
- afterrender: 'onLoad',
- // itemverify() {
- // this.openNode()
- // },
- itemcontextmenu: 'onLisenContextMenu'
- },
- tbar: {
- xtype: 'toolbar',
- items: [
- {
- xtype: 'button',
- tooltip: '刷新',
- iconCls: 'x-fa fa-refresh',
- listeners: {
- click: 'reload'
- }
- },
- /*{
- xtype: 'button',
- tooltip: '添加',
- iconCls: 'x-fa fa-plus-circle',
- menu: [
- {
- text: '类别',
- listeners: {
- click: 'classAdd'
- }
- },
- {
- text: '查询',
- listeners: {
- click: 'reportAdd'
- }
- },
- '-',
- {
- text: '单表定义',
- listeners: {
- click: 'singleTableAdd'
- }
- },
- {
- text: '多表定义',
- listeners: {
- click: 'complexTableAdd'
- }
- },
- {
- text: '查询窗口定义',
- listeners: {
- click: 'widgetAdd'
- }
- },
- ],
- },
- {
- xtype: 'button',
- tooltip: '删除',
- iconCls: 'x-fa fa-minus-circle',
- listeners: {
- click: 'reportRemove'
- }
- },*/
- {
- xtype: 'textfield',
- flex: 1,
- reference: "txtFilter",
- emptyText: '搜索过滤',
- enableKeyEvents: true,
- listeners: {
- change: {
- fn: 'filterChanged',
- buffer: 50
- }
- }
- },
- ]
- },
- });
- }
- //# sourceMappingURL=BpmnTree.js.map
- function initToolBox () {
- Ext.define('com.yvan.studio.ToolBox', {
- extend: 'Ext.panel.Panel',
- xtype: 'toolbox',
- tooltip: '工具箱',
- layout: 'fit',
- html: '<div role="component" style="height: 100%; width: 100%; display: flex; flex-direction: column"/>',
- border: false,
- beforeRender: function () {
- console.log('beforeRender', this);
- },
- afterRender: function () {
- var $dom = $(this.body.dom).children('div');
- $dom.append(createComponent());
- $dom.css("height", '100%');
- // @ts-ignore
- $('#_toolbox_list').find('li').each(function () {
- var id = $(this).children(':first').attr('drag_id');
- var node = _$2.find(codeLines, function (node) { return node.id === id; });
- setDrag(this, node);
- });
- }
- });
- }
- function setDrag(el, node) {
- new Ext.drag.Source({
- element: el,
- proxy: {
- type: 'placeholder',
- getElement: function (info) {
- var html = "<div style=\"border: 1px dashed #1890ff;width: 100px; height: 20px\">" + info.eventTarget.innerText + "</div>";
- return Ext.getBody().createChild({
- html: html
- });
- }
- },
- listeners: {
- dragmove: delegateDragmove.bind(getDesignInstance(), node),
- dragend: delegateDragend.bind(getDesignInstance(), node),
- },
- sourceVjson: node.code,
- dragType: node.dragType
- });
- }
- function createComponent() {
- var template = [];
- for (var i = 0; i < codeLines.length; i++) {
- var item = codeLines[i];
- if (!item.dragHtml) {
- continue;
- }
- var $ele = $("<li>" + item.dragHtml + "</li>");
- $ele.children(':first').attr('drag_id', item.id);
- $ele.children(':first').append("<div class=\"at_toolbox\"><i class=\"" + item.icon + "\"></i><span>" + item.value + "</span></div>");
- template.push("<li style=\"height: 30px; margin-bottom: 5px; border: blue; border-width: 1px\">" + $ele.html() + "</li>");
- }
- var html = "<div class=\"design_toolbox_list\"><ul id=\"_toolbox_list\" class=\"toolbox-list\">" + template.join('\n') + "</ul></div>";
- return html;
- }
- var codeLines = [
- {
- id: '$label',
- value: layoutOrXtypeNameMap.label + ' - label',
- icon: "fa fa-font",
- dragType: "col-item",
- dragHtml: "<div class=\"design_view \"><div class=\"design_control\"></div></div>",
- code: {
- xtype: 'label',
- text: '文本' + _$2.uniqueId('_l')
- }
- },
- {
- id: '$text',
- value: layoutOrXtypeNameMap.textfield + ' - textfield',
- icon: "fa fa-edit",
- dragType: "col-item",
- dragHtml: "<div class=\"design_view \"><div class=\"design_control\"></div></div>",
- code: {
- xtype: 'textfield',
- fieldLabel: '输入框' + _$2.uniqueId('_e')
- }
- },
- {
- id: '$textarea',
- value: layoutOrXtypeNameMap.textareafield + ' - textareafield',
- icon: "fa fa-edit",
- dragType: "col-item",
- dragHtml: "<div class=\"design_view \"><div class=\"design_control\"></div></div>",
- code: {
- xtype: 'textareafield',
- fieldLabel: '输入框' + _$2.uniqueId('_e')
- }
- },
- {
- id: '$number',
- value: layoutOrXtypeNameMap.numberfield + ' - numberfield',
- icon: "fa fa-edit",
- dragType: "col-item",
- dragHtml: "<div class=\"design_view \"><div class=\"design_control\"></div></div>",
- code: {
- xtype: 'numberfield',
- fieldLabel: '数字框' + _$2.uniqueId('_n')
- }
- },
- {
- id: '$combo',
- value: layoutOrXtypeNameMap.combo + ' - combo',
- icon: "fa fa-angle-double-down",
- dragType: "col-item",
- dragHtml: "<div class=\"design_view \"><div class=\"design_control\"></div></div>",
- code: {
- xtype: 'combo',
- fieldLabel: '请选择',
- data: [
- { id: 'id1', text: '选项1' },
- { id: 'id2', text: '选项2' },
- { id: 'id3', text: '选项3' },
- ],
- }
- },
- {
- id: '$datebox',
- value: layoutOrXtypeNameMap.datefield + ' - datefield',
- icon: "fa fa-calendar",
- dragType: "col-item",
- dragHtml: "<div class=\"design_view \"><div class=\"design_control\"></div></div>",
- code: {
- xtype: "datefield",
- fieldLabel: '日期',
- }
- },
- {
- id: '$searchbox',
- value: layoutOrXtypeNameMap.searchfield + ' - searchfield',
- icon: "fa fa-search",
- dragType: "col-item",
- dragHtml: "<div class=\"design_view \"><div class=\"design_control\"></div></div>",
- code: {
- xtype: 'searchfield',
- fieldLabel: '搜索框',
- }
- },
- {
- id: '$combogrid',
- value: layoutOrXtypeNameMap.combogrid + ' - combogrid',
- icon: "fa fa-table",
- dragType: "col-item",
- dragHtml: "<div class=\"design_view \"><div class=\"design_control\"></div></div>",
- code: {
- xtype: 'combogrid',
- fieldLabel: '下拉表'
- }
- },
- {
- id: '$combotree',
- value: layoutOrXtypeNameMap.combotree + ' - combotree',
- icon: "fa fa-tree",
- dragType: "col-item",
- dragHtml: "<div class=\"design_view \"><div class=\"design_control\"></div></div>",
- code: {
- xtype: 'combotree',
- fieldLabel: '下拉树',
- displayField: 'text',
- rootVisible: false
- }
- },
- {
- id: '$button',
- value: layoutOrXtypeNameMap.button + ' - button',
- icon: 'fa fa-sign-in',
- dragType: "col-item",
- dragHtml: "<div class=\"design_view \"><div class=\"design_control\"></div></div>",
- code: {
- text: '按钮',
- iconCls: 'x-fa fa-bars',
- xtype: 'button'
- }
- },
- {
- id: '$checkbox',
- value: layoutOrXtypeNameMap.checkbox + ' - checkbox',
- icon: 'fa fa-check-square',
- dragType: "col-item",
- dragHtml: "<div class=\"design_view \"><div class=\"design_control\"></div></div>",
- code: {
- xtype: 'checkbox',
- boxLabel: '勾选框',
- hideLabel: true,
- margin: '0 0 0 15',
- flex: 0,
- }
- },
- {
- id: '$checkboxgroup',
- value: layoutOrXtypeNameMap.checkboxgroup + ' - checkboxgroup',
- icon: 'fa fa-check-square',
- dragType: "col-item",
- dragHtml: "<div class=\"design_view \"><div class=\"design_control\"></div></div>",
- code: {
- xtype: 'checkboxgroup',
- fieldLabel: '勾选组',
- items: [
- { boxLabel: 'Item 1', name: 'rb', inputValue: '1' },
- { boxLabel: 'Item 2', name: 'rb', inputValue: '2', checked: true },
- { boxLabel: 'Item 3', name: 'rb', inputValue: '3' },
- { boxLabel: 'Item 4', name: 'rb', inputValue: '4' },
- { boxLabel: 'Item 5', name: 'rb', inputValue: '5' },
- { boxLabel: 'Item 6', name: 'rb', inputValue: '6' }
- ]
- }
- },
- {
- id: '$radio',
- value: layoutOrXtypeNameMap.radio + ' - radio',
- icon: 'fa fa-dot-circle-o',
- dragType: "col-item",
- dragHtml: "<div class=\"design_view \"><div class=\"design_control\"></div></div>",
- code: {
- xtype: "radio",
- fieldLabel: "请选择",
- }
- },
- {
- id: '$radiogroup',
- value: layoutOrXtypeNameMap.radiogroup + ' - radiogroup',
- icon: 'fa fa-dot-circle-o',
- dragType: "col-item",
- dragHtml: "<div class=\"design_view \"><div class=\"design_control\"></div></div>",
- code: {
- xtype: "radiogroup",
- fieldLabel: "请选择",
- items: [
- { boxLabel: 'Item 1', name: 'rb', inputValue: '1' },
- { boxLabel: 'Item 2', name: 'rb', inputValue: '2', checked: true },
- { boxLabel: 'Item 3', name: 'rb', inputValue: '3' },
- { boxLabel: 'Item 4', name: 'rb', inputValue: '4' },
- { boxLabel: 'Item 5', name: 'rb', inputValue: '5' },
- { boxLabel: 'Item 6', name: 'rb', inputValue: '6' }
- ]
- }
- },
- {
- id: '$cols',
- value: layoutOrXtypeNameMap.cols + ' - cols',
- icon: 'fa fa-list-alt',
- dragType: "cols-container",
- dragHtml: "<div class=\"design_view \"><div class=\"design_control\"></div></div>",
- code: {
- xtype: 'cols',
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '输入框',
- },
- ],
- }
- },
- {
- id: '$container',
- value: layoutOrXtypeNameMap.container + ' - container',
- icon: 'fa fa-flag',
- dragType: "col-item",
- dragHtml: "<div class=\"design_view \"><div class=\"design_control\"></div></div>",
- code: {
- xtype: 'container',
- border: false,
- layout: 'hbox',
- }
- },
- {
- id: '$fit',
- value: layoutOrXtypeNameMap.fit + ' - fit',
- icon: 'fa fa-flag',
- dragType: "rows-container",
- dragHtml: "<div class=\"design_view \"><div class=\"design_control\"></div></div>",
- code: {
- border: false,
- layout: 'fit',
- items: [
- {
- xtype: 'container',
- border: false,
- layout: 'hbox',
- }
- ]
- }
- },
- ];
- // @ts-ignore
- // export default ToolBoxCmp
- //# sourceMappingURL=ToolBox.js.map
- var that = undefined;
- function initPropertyDesign () {
- Ext.define('com.yvan.studio.PropertyDesign', {
- extend: 'Ext.panel.Panel',
- xtype: 'propertydesign',
- name: "PropertyDesign",
- tooltip: '属性',
- iconCls: 'x-fa fa-newspaper-o',
- reference: 'propertygrid',
- layout: 'border',
- border: false,
- moduleId: null,
- currentComponentVJson: null,
- currentComponentPropertyEditSource: null,
- vjson: null,
- propertyHandle: null,
- moduleSubscribe: null,
- items: [
- new Ext.grid.property.Grid({
- sortableColumns: false,
- region: 'center',
- listeners: {
- propertychange: function (source, propName, value, oldValue, eOpts) {
- value = _.trim(value);
- var a = _.find(that.currentComponentPropertyEditSource, function (item) {
- return item.label === propName;
- });
- if (a.type === 'listeners') {
- if (value) {
- if (that.currentComponentVJson.listeners) {
- that.currentComponentVJson.listeners[propName] = value;
- }
- else {
- var t = {};
- t[propName] = value;
- that.currentComponentVJson.listeners = t;
- }
- }
- else {
- _.forOwn(that.currentComponentVJson.listeners, function (value1, key) {
- if (!value1) {
- delete that.currentComponentVJson.listeners[key];
- }
- else if (key === propName) {
- delete that.currentComponentVJson.listeners[key];
- }
- });
- if (that.currentComponentVJson.listeners && Object.keys(that.currentComponentVJson.listeners).length <= 0) {
- delete that.currentComponentVJson.listeners;
- }
- }
- moduleStore.getModuleObject(that.moduleId).moduleEventBus.publish(EventType.UpdateVjson, {
- vjson: that.vjson,
- from: that.name,
- ignoreRenderUI: true
- });
- }
- else if (a.type === 'fix') {
- if (!value) {
- delete that.currentComponentVJson[propName];
- }
- else {
- that.currentComponentVJson[propName] = value.split("\r\n");
- }
- moduleStore.getModuleObject(that.moduleId).moduleEventBus.publish(EventType.UpdateVjson, {
- vjson: that.vjson,
- from: that.name,
- ignoreRenderUI: true
- });
- }
- else if (a.type === 'bind') {
- var bind_1 = that.currentComponentVJson.bind;
- if (typeof bind_1 === 'string' && a.id === "value") {
- if (value) {
- that.currentComponentVJson.bind = value;
- }
- else {
- delete that.currentComponentVJson.bind;
- }
- }
- else {
- // 转成bind对象
- if (typeof bind_1 === 'string') {
- bind_1 = that.currentComponentVJson.bind = { value: bind_1 };
- }
- if (value) {
- if (bind_1) {
- bind_1[a.id] = value;
- }
- else {
- var t = {};
- t[a.id] = value;
- that.currentComponentVJson.bind = t;
- }
- }
- else {
- _.forOwn(bind_1, function (value1, key) {
- if (!value1) {
- delete bind_1[key];
- }
- else if (key === a.id) {
- delete bind_1[key];
- }
- });
- if (Object.keys(bind_1).length <= 0) {
- delete that.currentComponentVJson.bind;
- }
- }
- }
- moduleStore.getModuleObject(that.moduleId).moduleEventBus.publish(EventType.UpdateVjson, {
- vjson: that.vjson,
- from: that.name,
- ignoreRenderUI: true
- });
- }
- else if (a.type === 'boolean') {
- if (!value) {
- delete that.currentComponentVJson[propName];
- }
- else if (value === 'false') {
- that.currentComponentVJson[propName] = false;
- }
- else if (value === 'true') {
- that.currentComponentVJson[propName] = true;
- }
- else {
- that.currentComponentVJson[propName] = value;
- }
- moduleStore.getModuleObject(that.moduleId).moduleEventBus.publish(EventType.UpdateVjson, {
- vjson: that.vjson,
- from: that.name
- });
- }
- else {
- that.currentComponentVJson[propName] = value;
- moduleStore.getModuleObject(that.moduleId).moduleEventBus.publish(EventType.UpdateVjson, {
- vjson: that.vjson,
- from: that.name
- });
- }
- console.log('修改属性 [' + propName + ']=' + value, that.currentComponentVJson);
- },
- }
- })
- ],
- listeners: {
- // afterrender() {
- // this.propertyHandle.setSource({
- // "(name)": "My Object",
- // "Created": Ext.Date.parse('10/15/2006', 'm/d/Y'), // date type
- // "Available": false, // boolean type
- // "Version": .01, // decimal type
- // "Description": "A test object"
- // });
- // }
- },
- initComponent: function () {
- var _this = this;
- this.propertyHandle = this.items[0];
- setPropertyPanel(this);
- that = this;
- eventBus.subscribe(EventType.SetVjson, function (_a) {
- var moduleId = _a.moduleId, from = _a.from, ignoreRenderUI = _a.ignoreRenderUI;
- _this.setVjson(moduleId, from, ignoreRenderUI);
- });
- return this.superclass.initComponent.apply(this, arguments);
- },
- setVjson: function (moduleId, from, ignoreRenderUI) {
- var _this = this;
- // if (this.moduleId === null && moduleId) {
- // this.moduleId = moduleId
- // }
- if (moduleId !== this.moduleId || from === this.name) {
- return;
- }
- var moduleObj = moduleStore.getModuleObject(this.moduleId);
- if (!moduleObj) {
- return;
- }
- this.vjson = moduleObj.moduleObj.vjson;
- this.setPropertyAndEventSource();
- if (this.componentSelectionChangeSubscribe) {
- this.componentSelectionChangeSubscribe.cancel();
- this.componentSelectionChangeSubscribe = null;
- }
- if (this.updateVjsonChangeSubscribe) {
- this.updateVjsonChangeSubscribe.cancel();
- this.updateVjsonChangeSubscribe = null;
- }
- this.componentSelectionChangeSubscribe = moduleStore.getModuleObject(this.moduleId).moduleEventBus.subscribe(EventType.ComponentSelectionChange, function (_a) {
- var id = _a.id, from = _a.from;
- _this.onComponentSelectionChange(id, from);
- });
- this.updateVjsonChangeSubscribe = moduleStore.getModuleObject(this.moduleId).moduleEventBus.subscribe(EventType.UpdateVjson, function (_a) {
- var vjson = _a.vjson, from = _a.from, ignoreRenderUI = _a.ignoreRenderUI;
- _this.updateVjson(vjson, from, ignoreRenderUI);
- });
- var id = moduleStore.getModuleObject(this.moduleId).modulePage.currentComponentSelectId;
- this.onComponentSelectionChange(id, from);
- },
- updateVjson: function (vjson, from, ignoreRenderUI) {
- if (!vjson || from === this.name) {
- return;
- }
- this.vjson = vjson;
- this.setPropertyAndEventSource();
- var id = moduleStore.getModuleObject(this.moduleId).modulePage.currentComponentSelectId;
- this.onComponentSelectionChange(id, from);
- },
- onComponentSelectionChange: function (id, from) {
- if (from !== this.name) {
- this.currentComponentVJson = findInCode(this.vjson, id);
- this.setPropertyAndEventSource();
- }
- },
- setPropertyAndEventSource: function () {
- var _this = this;
- this.propertyHandle.setSource({});
- if (!this.currentComponentVJson) {
- return;
- }
- var _a = this.currentComponentVJson, id = _a.id, xtype = _a.xtype;
- var v = xtype;
- // 选中的对象可能是组
- if (!v) {
- if (_.has(this.currentComponentVJson, "cols")) {
- v = "cols";
- }
- else if (_.has(this.currentComponentVJson, "rows")) {
- v = "rows";
- }
- }
- var pd = YvanUI.PropertyDescriptionTable.get(v);
- if (!pd) {
- // 这个组件没有属性
- this.propertyHandle.setSource({});
- return;
- }
- var funcArr = this.getAllfuncs();
- var createFuncEditor = function () { return new Ext.form.field.ComboBox({
- // disabled: true,
- displayField: 'name',
- valueField: 'name',
- store: funcArr,
- }); };
- // ====================== 属性
- var elements = [];
- var caption = ['通用', '样式', '绑定', '特性', '事件'];
- _.each(['common', 'css', 'common', 'fix', 'listeners'], function (group, i) {
- var props = pd.getPropsByGroup(group);
- if (props.length <= 0)
- return; //没有这一组属性
- // 显示 group 的中文名
- elements.push({ label: caption[i], editor: new Ext.form.field.Text({ disabled: true }) });
- if (caption[i] === '绑定') {
- _.each(props, function (prop) {
- elements.push({
- label: "_" + prop.name,
- type: "bind",
- id: prop.name,
- desc: prop.desc,
- editor: new Ext.form.field.Text()
- });
- });
- }
- else {
- _.each(props, function (prop) {
- if (_.isArray(prop.type)) {
- elements.push({
- label: prop.name,
- type: "combo",
- options: prop.type,
- id: prop.name,
- desc: prop.desc
- });
- return;
- }
- switch (prop.type) {
- case 'boolean': {
- elements.push({
- label: prop.name,
- id: prop.name,
- desc: prop.desc,
- type: 'boolean',
- editor: new Ext.form.field.ComboBox({
- displayField: 'text',
- valueField: 'id',
- store: new Ext.data.Store({
- field: ['id', 'text'],
- data: [
- { id: 'true', text: 'True' },
- { id: 'false', text: 'False' },
- ]
- })
- }),
- });
- break;
- }
- case 'number': {
- elements.push({
- label: prop.name,
- type: "number",
- id: prop.name,
- isNum: true,
- desc: prop.desc,
- editor: new Ext.form.field.Number()
- });
- break;
- }
- case 'string': {
- elements.push({
- label: prop.name,
- type: "string",
- id: prop.name,
- desc: prop.desc,
- editor: new Ext.form.field.Text()
- });
- break;
- }
- case 'listeners': {
- elements.push({
- label: prop.name,
- type: "listeners",
- id: prop.name,
- desc: prop.desc,
- editor: createFuncEditor()
- });
- break;
- }
- case 'fix': {
- elements.push({
- label: prop.name,
- type: "fix",
- id: prop.name,
- desc: prop.desc,
- editor: new Ext.form.field.Text()
- });
- break;
- }
- case 'object': {
- break;
- }
- // case 'dataSource' : {
- // break;
- // }
- case 'valid': {
- break;
- }
- default:
- elements.push({
- label: prop.name,
- type: prop.type,
- id: prop.name,
- desc: prop.desc,
- editor: new Ext.form.field.Text({ disabled: true })
- });
- console.error('不支持的编辑类型', prop);
- }
- });
- }
- });
- this.currentComponentPropertyEditSource = elements;
- var panel1Source = {};
- var panel1SourceConfig = {};
- _.each(elements, function (item) {
- var _a;
- if (item.type === "listeners") {
- var listeners = _this.currentComponentVJson.listeners;
- panel1Source[item.label] = listeners ? listeners[item.label] : '';
- }
- else if (item.type === "fix") {
- panel1Source[item.label] = (_a = _this.currentComponentVJson[item.label]) === null || _a === void 0 ? void 0 : _a.join("\r\n");
- }
- else if (item.type === "bind") {
- var bind = _this.currentComponentVJson.bind;
- if (typeof bind === 'string' && item.id === 'value') {
- panel1Source[item.label] = bind;
- }
- else {
- panel1Source[item.label] = bind ? bind[item.id] : '';
- }
- }
- else {
- panel1Source[item.label] = _this.currentComponentVJson[item.label];
- }
- panel1Source[item.label] = panel1Source[item.label] || '';
- panel1SourceConfig[item.label] = { editor: item.editor };
- });
- this.propertyHandle.setSource(panel1Source, panel1SourceConfig);
- },
- getAllfuncs: function () {
- var _a, _b;
- var arr = (_b = (_a = handles$1.mainWindow.activeModulePage.refs) === null || _a === void 0 ? void 0 : _a.controllerEditor) === null || _b === void 0 ? void 0 : _b.funcArr;
- var scopeFuncs = [];
- _.forEach(arr, function (item) {
- scopeFuncs.push({ name: "scope." + item.name });
- });
- return scopeFuncs;
- }
- });
- }
- //# sourceMappingURL=PropertyDesign.js.map
- function initViewOutlineTree () {
- Ext.define('com.yvan.studio.ViewOutlineTree', {
- extend: 'Ext.tree.Panel',
- xtype: 'viewoutlinetree',
- name: "ViewOutlineTree",
- tooltip: '设计大纲',
- iconCls: 'x-fa fa-list',
- rootVisible: false,
- useArrows: true,
- allowDeselect: true,
- colspan: 2,
- lines: false,
- reference: 'viewoutlinetree',
- multiSelect: true,
- _saveStateFlag: true,
- keyMapEnabled: true,
- moduleId: null,
- vjson: null,
- columns: [
- {
- xtype: 'treecolumn',
- text: '布局',
- dataIndex: 'layoutNameDesc',
- flex: 2,
- sortable: true
- }, {
- text: '组件',
- dataIndex: 'xtype',
- flex: 1,
- sortable: true,
- align: 'center',
- }
- ],
- listeners: {
- itemcontextmenu: function (sender, node, element, idx, e) {
- e.preventDefault();
- this.rightClickTreeNode(sender, node, element, idx, e);
- },
- select: function (sender, node, index, e) {
- moduleStore.getModuleObject(this.moduleId).moduleEventBus.publish(EventType.ComponentSelectionChange, { id: node.data.id, from: this.name });
- },
- rowkeydown: function (sender, node, element, rowIndex, e, eOpts) {
- if (e.keyCodes[e.keyCode] === 'DELETE' || e.keyCodes[e.keyCode] === 'BACKSPACE') {
- moduleStore.getModuleObject(this.moduleId).moduleEventBus.publish(EventType.ComponentDelete, { id: node.data.id, from: this.name });
- }
- }
- },
- initComponent: function () {
- var _this = this;
- setViewoutlinetree(this);
- eventBus.subscribe(EventType.SetVjson, function (_a) {
- var moduleId = _a.moduleId, from = _a.from, ignoreRenderUI = _a.ignoreRenderUI;
- return _this.setVjson(moduleId, from, ignoreRenderUI);
- });
- return this.superclass.initComponent.apply(this, arguments);
- },
- clear: function () {
- this.setRootNode(null);
- },
- onChangModule: function (moduleId, oldModuleId, from) {
- if (!moduleId || moduleId !== this.moduleId) {
- return;
- }
- if (moduleStore.getModuleObject(moduleId)) {
- this.setVjson(moduleId, from);
- }
- },
- setVjson: function (moduleId, from, ignoreRenderUI) {
- var _this = this;
- if (!moduleId || moduleId !== this.moduleId || from === this.name) {
- return;
- }
- this.moduleId = moduleId;
- // if (from === this.name) {
- // return
- // }
- this.vjson = moduleStore.getModuleObject(moduleId).moduleObj.vjson;
- this.setTreeValue();
- if (this.componentSelectionChangeSubscribe) {
- this.componentSelectionChangeSubscribe.cancel();
- this.componentSelectionChangeSubscribe = null;
- }
- if (this.setVjsonChangeSubscribe) {
- this.setVjsonChangeSubscribe.cancel();
- this.setVjsonChangeSubscribe = null;
- }
- this.componentSelectionChangeSubscribe = moduleStore.getModuleObject(this.moduleId).moduleEventBus.subscribe(EventType.ComponentSelectionChange, function (_a) {
- var id = _a.id, from = _a.from;
- return _this.onComponentSelectionChange(id, from);
- });
- this.setVjsonChangeSubscribe = moduleStore.getModuleObject(this.moduleId).moduleEventBus.subscribe(EventType.SetVjson, function (_a) {
- var vjson = _a.vjson, from = _a.from, ignoreRenderUI = _a.ignoreRenderUI;
- return _this.setModuleVjson(vjson, from, ignoreRenderUI);
- });
- },
- setModuleVjson: function (vjson, from, ignoreRenderUI) {
- if (!vjson || from === this.name) {
- return;
- }
- this.vjson = vjson;
- this.setTreeValue();
- var id = moduleStore.getModuleObject(this.moduleId).modulePage.currentComponentSelectId;
- if (id) {
- this.selectPath(id);
- }
- },
- onComponentSelectionChange: function (id, from) {
- if (from !== this.name) {
- if (id) {
- this.selectPath(id);
- }
- else {
- this.setTreeValue();
- }
- }
- },
- setTreeValue: function () {
- var outlineVj = {};
- _.forOwn(this.vjson, function (obj, key) {
- if (key !== 'viewModel' && key !== 'store') {
- outlineVj[key] = _.cloneDeep(obj);
- }
- });
- getLayoutOutline(outlineVj);
- this.setRootNode(outlineVj);
- },
- rightClickTreeNode: function (sender, node, element, idx, e) {
- var raw = node.data;
- var option = {};
- // 右键
- option = {
- shadow: 'frame',
- allowOtherMenus: true,
- items: []
- };
- var switchType = raw.layoutName;
- if (raw.layoutName === 'north' ||
- raw.layoutName === 'south' ||
- raw.layoutName === 'west' ||
- raw.layoutName === 'east' ||
- raw.layoutName === 'center' ||
- raw.layoutName === 'tbar' ||
- raw.layoutName === 'fbar') {
- switchType = raw.xtype || raw.layout;
- }
- var itemArr = [];
- var hasTbar = false, hasFbar = false, hasBody = false;
- if (raw.hasOwnProperty("children")) {
- _.forEach(raw.children, function (value) {
- if (value.layoutName === 'tbar') {
- hasTbar = true;
- }
- else if (value.layoutName === 'fbar') {
- hasFbar = true;
- }
- else {
- hasBody = true;
- }
- });
- }
- switch (switchType) {
- case 'fit':
- if (!hasTbar) {
- itemArr.push('tbar');
- }
- if (!hasFbar) {
- itemArr.push('fbar');
- }
- if (!hasBody) {
- itemArr.push('fit', 'border', 'yvgrid', 'tree', 'form', 'fieldset', 'tabpanel');
- }
- option.items = this.menuNew(itemArr, raw);
- break;
- case 'border':
- if (!hasTbar) {
- itemArr.push('tbar');
- }
- if (!hasFbar) {
- itemArr.push('fbar');
- }
- itemArr.push('cnsew');
- option.items = this.menuNew(itemArr, raw);
- break;
- // case 'tbar':
- // option.items = this.menuNew(['toolbar', 'form', 'tfbar'], raw)
- // break;
- // case 'fbar':
- // option.items = this.menuNew(['toolbar', 'form', 'fieldset'], raw)
- // break;
- case 'tabpanel':
- if (!hasTbar) {
- itemArr.push('tbar');
- }
- if (!hasFbar) {
- itemArr.push('fbar');
- }
- itemArr.push('border', 'yvgrid', 'tree', 'form', 'fieldset', 'tabpanel');
- option.items = this.menuNew(itemArr, raw);
- break;
- case 'yvgrid':
- if (!hasTbar) {
- itemArr.push('tbar');
- }
- option.items = this.menuNew(itemArr, raw);
- break;
- case 'tree':
- if (!hasTbar) {
- itemArr.push('tbar');
- }
- if (!hasFbar) {
- itemArr.push('fbar');
- }
- option.items = this.menuNew(itemArr, raw);
- break;
- case 'fieldset':
- option.items = this.menuNew(['form', 'fieldset', 'cols'], raw);
- break;
- case 'form':
- if (!hasTbar) {
- itemArr.push('tbar');
- }
- if (!hasFbar) {
- itemArr.push('fbar');
- }
- itemArr.push('form', 'fieldset', 'cols');
- option.items = this.menuNew(itemArr, raw);
- break;
- case 'toolbar':
- itemArr.push('button', 'textfield', 'label', 'combo');
- option.items = this.menuNew(itemArr, raw);
- break;
- // case 'fbar':
- // itemArr.push('button', 'textfield', 'label', 'combo')
- // option.items = this.menuNew(itemArr, raw)
- // break
- default:
- option.items = this.menuNew(itemArr, raw);
- break;
- }
- var treeMenu = new Ext.menu.Menu(option);
- treeMenu.showAt(e.getXY());
- },
- newItem: function (viewType, raw, region) {
- var itemVjson = {};
- switch (viewType) {
- case 'fit':
- itemVjson.layout = 'fit';
- itemVjson.items = [];
- break;
- case 'border':
- itemVjson.layout = 'border';
- itemVjson.items = [];
- break;
- case 'toolbar':
- itemVjson.xtype = 'toolbar';
- itemVjson.title = 'toolbar';
- itemVjson.items = [
- {
- xtype: 'button',
- text: 'button'
- }
- ];
- break;
- case 'tabpanel':
- itemVjson.xtype = 'tabpanel';
- itemVjson.layout = 'fit';
- itemVjson.items = [];
- break;
- case 'yvgrid':
- itemVjson.xtype = 'yvgrid';
- itemVjson.layout = 'fit';
- itemVjson.pagination = false;
- itemVjson.columns = [
- {
- dataIndex: "skuId",
- header: "SKU_ID",
- },
- ];
- break;
- case 'tree':
- itemVjson.xtype = 'treepanel';
- itemVjson.layout = 'fit';
- break;
- case 'fieldset':
- case 'form':
- itemVjson.xtype = viewType;
- itemVjson.title = viewType;
- itemVjson.items = [
- {
- xtype: 'cols',
- items: [
- {
- xtype: 'textfield',
- fieldLabel: '输入框'
- }
- ]
- }
- ];
- break;
- case 'cols':
- itemVjson.xtype = 'cols';
- itemVjson.items = [
- {
- xtype: 'textfield',
- fieldLabel: '输入框'
- }
- ];
- break;
- case 'button':
- itemVjson.xtype = 'button';
- itemVjson.text = '按钮';
- itemVjson.iconCls = 'x-fa fa-plus';
- break;
- case 'textfield':
- itemVjson.xtype = 'textfield';
- itemVjson.fieldLabel = '输入框';
- break;
- case 'combo':
- itemVjson.xtype = 'combo';
- itemVjson.fieldLabel = '下拉框';
- break;
- case 'label':
- itemVjson.xtype = 'label';
- itemVjson.text = '文本';
- break;
- }
- var target = findInCode(this.vjson, raw.id);
- if (region) {
- if (region === 'tbar' || region === 'fbar') {
- target[region] = itemVjson;
- }
- else {
- itemVjson.region = region;
- itemVjson.split = true;
- if (region === 'north' || region === 'south') {
- itemVjson.height = '30%';
- itemVjson.collapsible = true;
- }
- else if (region === 'west' || region === 'east') {
- itemVjson.width = '30%';
- itemVjson.collapsible = true;
- }
- target.items.push(itemVjson);
- }
- }
- else {
- if (target.xtype === 'tabpanel') {
- itemVjson.title = prompt("请输入标题", _.uniqueId("未命名"));
- }
- target.items.push(itemVjson);
- }
- moduleStore.getModuleObject(this.moduleId).moduleEventBus.publish(EventType.UpdateVjson, { vjson: this.vjson });
- },
- menuNew: function (typeArr, raw, region) {
- var that = this;
- var reArr = [];
- typeArr.forEach(function (value) {
- if (value === 'cnsew') {
- reArr.push.apply(reArr, __spread(that.menuNewCNSEW(raw)));
- }
- else if (value === 'tbar' || value === 'fbar') {
- reArr.push(that.menuNewTFBar(value, raw));
- }
- else {
- reArr.push({
- text: '新建' + layoutOrXtypeNameMap[value],
- iconCls: 'x-fa fa-plus',
- handler: function (sender) {
- that.newItem(value, raw, region);
- }
- });
- }
- reArr.push("-");
- });
- if (region) {
- reArr.pop();
- return reArr;
- }
- reArr.push({
- text: '高级属性',
- iconCls: 'x-fa fa-cog',
- handler: function (sender) {
- var vj = findInCode(that.vjson, raw.id);
- that.advancedSettingWindow(vj);
- }
- }, {
- text: '上移',
- iconCls: 'x-fa fa-trash',
- handler: function (sender) {
- that.moveCmp(raw.id, 'up');
- }
- }, {
- text: '置顶',
- iconCls: 'x-fa fa-trash',
- handler: function (sender) {
- that.moveCmp(raw.id, 'top');
- }
- }, {
- text: '置底',
- iconCls: 'x-fa fa-trash',
- handler: function (sender) {
- that.moveCmp(raw.id, 'bottom');
- }
- }, {
- text: '下移',
- iconCls: 'x-fa fa-trash',
- handler: function (sender) {
- that.moveCmp(raw.id, 'down');
- }
- }, {
- text: '删除',
- iconCls: 'x-fa fa-trash',
- handler: function (sender) {
- deletVjsonById(that.vjson, raw.id);
- moduleStore.getModuleObject(that.moduleId).moduleEventBus.publish(EventType.UpdateVjson, { vjson: that.vjson });
- }
- });
- return reArr;
- },
- menuNewCNSEW: function (raw) {
- var that = this;
- var arr = ['center', 'north', 'south', 'west', 'east'];
- if (raw.hasOwnProperty("children")) {
- _.forEach(raw.children, function (value) {
- _.remove(arr, function (it) {
- return it === value.layoutName;
- });
- });
- }
- var reArr = [];
- arr.forEach(function (value) {
- reArr.push({
- text: layoutOrXtypeNameMap[value],
- iconCls: 'x-fa fa-plus',
- menu: {
- showSeparator: true,
- items: that.menuNew(['fit', 'border', 'yvgrid', 'tree', 'form', 'fieldset', 'toolbar', 'tabpanel'], raw, value)
- }
- });
- reArr.push("-");
- });
- reArr.pop();
- return reArr;
- },
- menuNewTFBar: function (barType, raw) {
- var that = this;
- var reObj = {
- text: layoutOrXtypeNameMap[barType],
- iconCls: 'x-fa fa-plus',
- menu: {
- showSeparator: true,
- items: that.menuNew(['toolbar', 'form', 'fieldset'], raw, barType)
- }
- };
- return reObj;
- },
- moveCmp: function (id, moveType) {
- var arr = findArrayContainer(this.vjson, id);
- var index = _.findIndex(arr, function (v) { return v.id === id; });
- if (index < 0) {
- return;
- }
- switch (moveType) {
- case 'up':
- if (index > 0) {
- var o = arr[index];
- arr[index] = arr[index - 1];
- arr[index - 1] = o;
- }
- else {
- return;
- }
- break;
- case 'down':
- if (index < arr.length - 1) {
- var o = arr[index];
- arr[index] = arr[index + 1];
- arr[index + 1] = o;
- }
- else {
- return;
- }
- break;
- case 'top':
- if (index > 0) {
- var o = arr[index];
- arr[index] = arr[0];
- arr[0] = o;
- }
- else {
- return;
- }
- break;
- case 'bottom':
- if (index < arr.length - 1) {
- var o = arr[index];
- arr[index] = arr[arr.length - 1];
- arr[arr.length - 1] = o;
- }
- else {
- return;
- }
- break;
- }
- moduleStore.getModuleObject(this.moduleId).moduleEventBus.publish(EventType.UpdateVjson, { vjson: this.vjson });
- }
- });
- }
- //# sourceMappingURL=ViewOutlineTree.js.map
- function init$2 () {
- window['native'] = native;
- native.init();
- init();
- instance.getAllDomain().finally(function () {
- });
- initStateTree();
- initDashboard();
- initFileTree();
- initDbTree();
- initReportGrid();
- initGroovyEditor();
- initJsEditor$1();
- initJsonEditor$1();
- initSqlEditor$1();
- initTemplateEditor();
- initDict$1();
- initBpmnTree();
- initToolBox();
- initPropertyDesign();
- initViewOutlineTree();
- initWidget();
- initWhLayout();
- initApiTree();
- initTaskTree();
- initLogsTree();
- initDevOpsTree();
- initTerminal();
- initMonitorTree();
- initHomeTree();
- }
- var studio = {
- init: init$2,
- handles: handles$1,
- Workbench: Workbench
- };
- //# sourceMappingURL=index.js.map
- exports.axios = axios;
- exports.qs = Qs;
- exports.lodash = _$2;
- exports.jquery = $$2;
- exports.moment = moment$1;
- exports.recast = recast;
- exports.XLSX = XLSX;
- exports.Defaults = Defaults;
- exports.ExcelImportDialog = ExcelImportDialog;
- exports.Lib = Lib;
- exports.LibParam = LibParam;
- exports.PropertyDescriptionTable = PropertyDescriptionTable;
- exports.ReportScope = ReportScope;
- exports.SIMPLE_RE = SIMPLE_RE;
- exports.Scope = Scope;
- exports.ScopeEngine = ScopeEngine;
- exports.SystemEventFu = SystemEventFu;
- exports.ajax = ajax;
- exports.baseConfigProcess = baseConfigProcess;
- exports.baseConfigProcessList = baseConfigProcessList;
- exports.buildPlus = buildPlus;
- exports.buildReportScope = buildReportScope;
- exports.calcExpress = calcExpress;
- exports.calcObject = calcObject;
- exports.calcObjectFlat = calcObjectFlat;
- exports.clearViewModel = clearViewModel;
- exports.clearViewModelByLookup = clearViewModelByLookup;
- exports.clearViewModelReloadGrid = clearViewModelReloadGrid;
- exports.clearViewModelValues = clearViewModelValues;
- exports.commitMe = commitMe;
- exports.confirm = confirm;
- exports.createAjax = createAjax;
- exports.createUUID = createUUID;
- exports.deepTravJson = deepTravJson;
- exports.downLoad = downLoad;
- exports.evalFunction = evalFunction;
- exports.extend = extend;
- exports.flatRow = flatRow;
- exports.getApiConvert = getApiConvert;
- exports.getGridEditRows = getGridEditRows;
- exports.getParentGrid = getParentGrid;
- exports.getPinyin = getPinyin;
- exports.getRegList = getRegList;
- exports.getRegParamList = getRegParamList;
- exports.getScopeOnCreate = getScopeOnCreate;
- exports.init = init$1;
- exports.insertGridRow = insertGridRow;
- exports.invokeServer = invokeServer$1;
- exports.isDesignMode = isDesignMode;
- exports.isEmpty = isEmpty;
- exports.json5 = dist;
- exports.keywordFilter = keywordFilter;
- exports.lookupFn = lookupFn;
- exports.lookupScope = lookupScope;
- exports.mergeViewModel = mergeViewModel;
- exports.moveDownGridRow = moveDownGridRow;
- exports.moveUpGridRow = moveUpGridRow;
- exports.msg = msg$1;
- exports.msgError = msgError;
- exports.normId = normId;
- exports.pinyinMatch = pinyinMatch;
- exports.prompt = prompt$2;
- exports.raiseClick = raiseClick;
- exports.reloadGrid = reloadGrid;
- exports.removeGridRow = removeGridRow;
- exports.replaceNA = replaceNA;
- exports.saveGridRow = saveGridRow;
- exports.serverInvokeUrlTransform = serverInvokeUrlTransform;
- exports.setComboStore = setComboStore;
- exports.showErrorDialog = showErrorDialog$1;
- exports.showInfoDialog = showInfoDialog;
- exports.showWidget = showWidget;
- exports.sqlUrlTransform = sqlUrlTransform;
- exports.stopEvent = stopEvent;
- exports.studio = studio;
- exports.toPlainObject = toPlainObject;
- exports.toString = toString;
- exports.tryEnable = tryEnable;
- exports.tryVarSimple = tryVarSimple;
- exports.tryWriteByExpress = tryWriteByExpress;
- exports.tryWriteObject = tryWriteObject;
- exports.watch = watch;
- Object.defineProperty(exports, '__esModule', { value: true });
- });
- //# sourceMappingURL=yvan-ext.js.map
|