1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864 |
- 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,
- typeAheadDelay: 1,
- queryDelay: 1,
- };
- 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;
- //# sourceMappingURL=Api.js.map
- /**
- * 对比两个列 是否存在不一致
- */
- 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();
- }
- //# sourceMappingURL=init.js.map
- 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
|