2
0

n925code.json 661 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112
  1. [
  2. {
  3. "id": "config_tWYTe8AA5E",
  4. "name": "基础框架后台服务",
  5. "type": "config",
  6. "props": {
  7. "style": {}
  8. }
  9. },
  10. {
  11. "id": "front_ctkTrCwYCZ",
  12. "name": "前台",
  13. "type": "front",
  14. "props": {
  15. "style": {
  16. "width": "100%",
  17. "height": "100%",
  18. "display": "flex",
  19. "overflow": "hidden auto",
  20. "alignItems": "flex-start",
  21. "flexDirection": "column",
  22. "backgroundColor": "#ffffff"
  23. }
  24. }
  25. },
  26. {
  27. "id": "backend_jzdPReGsSz",
  28. "name": "后台",
  29. "type": "backend",
  30. "props": {
  31. "style": {
  32. "height": "200px",
  33. "backgroundColor": "red"
  34. }
  35. },
  36. "children": [
  37. {
  38. "id": "state_j8WNn5AEbC",
  39. "type": "state",
  40. "children": [
  41. {
  42. "id": "group_MwjTCbYw43",
  43. "name": "cos配置相关",
  44. "type": "group",
  45. "props": {},
  46. "children": [
  47. {
  48. "id": "variable_AfFA3mx7bR",
  49. "name": "cos SecretId",
  50. "type": "variable",
  51. "props": {
  52. "value": "AKID73j9IAl7fwwf7ICpCI7e2A2ez5uSjjSv"
  53. }
  54. },
  55. {
  56. "id": "variable_KKzzykcBtS",
  57. "name": "cos SecretKey",
  58. "type": "variable",
  59. "props": {
  60. "value": "DArHQIuGL9hyzjDRO4TcU5PTIrADJ7eu"
  61. }
  62. },
  63. {
  64. "id": "variable_5Fder6BiDX",
  65. "name": "cos region",
  66. "type": "variable",
  67. "props": {
  68. "value": "ap-beijing"
  69. }
  70. },
  71. {
  72. "id": "variable_cs76GrPQBS",
  73. "name": "cos bucket",
  74. "type": "variable",
  75. "props": {
  76. "value": "ivx-1256799882"
  77. }
  78. }
  79. ]
  80. }
  81. ]
  82. },
  83. {
  84. "id": "services_cwPd4skP8D",
  85. "type": "services",
  86. "children": [
  87. {
  88. "id": "group_fMQ4Zx2Siy",
  89. "name": "缓存相关",
  90. "type": "group",
  91. "props": {},
  92. "children": [
  93. {
  94. "id": "bCache_5Zik8bAEj5",
  95. "type": "bCache",
  96. "props": {}
  97. },
  98. {
  99. "id": "service_7w8aDmK8DS",
  100. "name": "获取及设置缓存",
  101. "type": "service",
  102. "props": {
  103. "jsCode": "const emitter = new events.EventEmitter();\r\n\r\nlet inParam = param;\r\n\r\nconst 缓存名称 = param.缓存名称;\r\nconst 缓存参数 = param.查询参数;\r\nconst 缓存时间 = param.缓存时间 || 60;\r\n\r\nif(缓存参数?.token)delete 缓存参数.token;\r\n\r\nconst 缓存Key = `${缓存名称}_${encodeURI(JSON.stringify(缓存参数))}`;\r\n\r\nconsole.log('缓存Key',`${缓存名称}_${JSON.stringify(缓存参数)}`);\r\n\r\nemitter.on('getCache', async () => {\r\n //缓存获取\r\n const cacheRes = await _F('bCache_5Zik8bAEj5').callMethod('get', {\r\n key: 缓存Key\r\n }).catch((error) => {\r\n console.log('获取缓存失败',error.toString());\r\n emitter.emit('getDb');\r\n });\r\n\r\n try {\r\n if(cacheRes){\r\n console.log('获取缓存成功', cacheRes);\r\n const cacheVal = JSON.parse(cacheRes);\r\n _funcCb(cacheVal);\r\n }else{\r\n console.log('缓存不存在');\r\n emitter.emit('getDb');\r\n }\r\n \r\n } catch (error) {\r\n console.log('获取缓存失败',error.toString());\r\n emitter.emit('getDb');\r\n }\r\n\r\n});\r\n\r\nemitter.on('setCache', async (cacheVal) => {\r\n //设置缓存\r\n await _F('bCache_5Zik8bAEj5').callMethod('set', {\r\n key: 缓存Key,\r\n value: JSON.stringify(cacheVal),\r\n expire: 缓存时间\r\n }).catch((error) => {\r\n console.log('设置缓存失败');\r\n });\r\n});\r\n\r\nemitter.on('getDb', ()=>{\r\n const setCache = (data) => {\r\n emitter.emit('setCache',data);\r\n _funcCb(data);\r\n }\r\n if(typeof param.查询回调 === 'function')param.查询回调(setCache);\r\n else _funcCb(null);\r\n});\r\n\r\nemitter.emit('getCache');",
  104. "inParams": [
  105. "缓存名称",
  106. "查询参数",
  107. "查询回调",
  108. "缓存时间"
  109. ],
  110. "inParamsDebug": {
  111. "查询参数": "",
  112. "查询回调": "",
  113. "缓存名称": "",
  114. "缓存时间": ""
  115. }
  116. }
  117. }
  118. ]
  119. },
  120. {
  121. "id": "group_drzhDzmzBS",
  122. "name": "请求频率控制相关",
  123. "type": "group",
  124. "props": {},
  125. "children": [
  126. {
  127. "id": "bCache_PBAxP5t5SD",
  128. "name": "请求控制缓存",
  129. "type": "bCache",
  130. "props": {}
  131. },
  132. {
  133. "id": "service_7Xb7XyFRTb",
  134. "name": "请求频率控制",
  135. "type": "service",
  136. "props": {
  137. "isOpen": false,
  138. "isSync": true,
  139. "jsCode": "const emitter = new events.EventEmitter();\r\n\r\nconsole.log('请求控制.param',param);\r\n\r\nconst 请求控制秒数 = param.请求控制秒数 ? param.请求控制秒数 : 5;\r\nconst 控制服务标识 = param.控制服务标识 ? param.控制服务标识 : '';\r\nconst 用户ID = param.用户ID ? param.用户ID : '';\r\nconst 请求控制缓存Key = `userReqLimit_${控制服务标识}_${用户ID}`;\r\n\r\nconsole.log('请求控制缓存Key',请求控制缓存Key);\r\n\r\n//缓存获取\r\nconst cacheRes = await _F('bCache_PBAxP5t5SD').callMethod('get', {\r\n key: 请求控制缓存Key\r\n}).catch((error) => {\r\n console.log('获取缓存失败');\r\n _funcCb({ code: 0, errMsg: '获取缓存失败', result: {} })\r\n});\r\n\r\nif (cacheRes) _funcCb({ code: 0, errMsg: '操作太频繁', result: {} });\r\nelse {\r\n //设置缓存\r\n await _F('bCache_PBAxP5t5SD').callMethod('set', {\r\n key: 请求控制缓存Key,\r\n value: 控制服务标识,\r\n expire: parseInt(请求控制秒数)\r\n }).catch((error) => {\r\n console.log('设置缓存失败');\r\n _funcCb({ code: 0, errMsg: '设置缓存失败', result: {} })\r\n });\r\n\r\n _funcCb({ code: 200, errMsg: '请求控制缓存设置成功', result: {} });\r\n}\r\n\r\n",
  140. "inParams": [
  141. "请求控制秒数",
  142. "控制服务标识",
  143. "用户ID"
  144. ],
  145. "isMiddle": false,
  146. "inParamsDebug": {
  147. "用户ID": "2",
  148. "控制服务标识": "xxx",
  149. "请求控制秒数": "3"
  150. }
  151. }
  152. },
  153. {
  154. "id": "service_ZpjSybt7r2",
  155. "name": "请求控制测试服务",
  156. "type": "service",
  157. "props": {
  158. "isOpen": true,
  159. "isSync": true,
  160. "jsCode": "const reqRes = await _F('service_7Xb7XyFRTb').call({\r\n \"请求控制秒数\": \"15\",\r\n \"控制服务标识\": \"service_ZpjSybt7r2\",\r\n \"用户ID\": 33,\r\n})\r\n\r\n_funcCb(reqRes);",
  161. "openApiPath": "req/limit/test"
  162. }
  163. }
  164. ]
  165. },
  166. {
  167. "id": "group_6eFT4QWGKS",
  168. "name": "中间件相关",
  169. "type": "group",
  170. "props": {
  171. "devId": "group_6eFT4QWGKS"
  172. },
  173. "children": [
  174. {
  175. "id": "service_iGm76di4Ky",
  176. "name": "员工登录检测中间件",
  177. "type": "service",
  178. "props": {
  179. "devId": "service_iGm76di4Ky",
  180. "isOpen": false,
  181. "jsCode": "const emitter = new events.EventEmitter(); \r\nlet condition = {};\r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('service_Skm27cT882').call({\r\n token: param.token,\r\n },(res)=>{\r\n //console.log('getUserInfo',res);\r\n if(res.code == 200){\r\n _F('middle_func').callMethod('next',res.result);\r\n }\r\n else _funcCb(res);\r\n })\r\n});\r\n\r\n\r\n\r\nemitter.emit('getUserInfo');",
  182. "inParams": [
  183. "token"
  184. ],
  185. "isMiddle": true,
  186. "outParams": [],
  187. "middlePath": "v1/admin",
  188. "openApiPath": "",
  189. "inParamsDebug": {}
  190. }
  191. },
  192. {
  193. "id": "service_zkYrj5fZGA",
  194. "name": "用户小程序登录检测中间件",
  195. "type": "service",
  196. "props": {
  197. "devId": "service_zkYrj5fZGA",
  198. "isOpen": false,
  199. "jsCode": "const emitter = new events.EventEmitter(); \r\nlet condition = {};\r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('service_Ym7XyfYNkf').call({\r\n token: param.token,\r\n },(res)=>{\r\n //console.log('getUserInfo',res);\r\n if(res.code == 200){\r\n _F('middle_func').callMethod('next',res.result);\r\n }\r\n else _funcCb(res);\r\n })\r\n});\r\n\r\n\r\n\r\nemitter.emit('getUserInfo');",
  200. "inParams": [
  201. "token"
  202. ],
  203. "isMiddle": true,
  204. "outParams": [],
  205. "middlePath": "v1/mini/user",
  206. "openApiPath": "",
  207. "inParamsDebug": {
  208. "token": "o3eT3rBB1UiWGH7Mm0HboplLIYE6KSCD"
  209. }
  210. }
  211. }
  212. ]
  213. },
  214. {
  215. "id": "group_2ZJb6TyeKk",
  216. "name": "管理后台框架相关",
  217. "type": "group",
  218. "props": {
  219. "devId": "group_2ZJb6TyeKk"
  220. },
  221. "children": [
  222. {
  223. "id": "group_kMTbkKi8iK",
  224. "name": "员工中台相关",
  225. "type": "group",
  226. "props": {
  227. "devId": "group_kMTbkKi8iK"
  228. },
  229. "children": [
  230. {
  231. "id": "bComponent_ixwS77E2Mw",
  232. "name": "员工中台组件",
  233. "type": "bComponent",
  234. "props": {
  235. "attr": [
  236. {
  237. "attrId": "variable_GP2sBWntRd",
  238. "attrType": "string",
  239. "attrValue": "n925_staff_",
  240. "attrJsCode": ""
  241. }
  242. ],
  243. "devId": "bComponent_ixwS77E2Mw",
  244. "moduleId": "module_SQHw2mER25",
  245. "dbConnect": [
  246. {
  247. "tempId": "dbTableTemp_6xG6thEJQS",
  248. "tableId": "dbTable_hdbHcrwH23"
  249. },
  250. {
  251. "tempId": "dbViewTemp_R34dNixksn",
  252. "tableId": "dbView_3i5A4HYEaS"
  253. }
  254. ],
  255. "bCacheConnect": [
  256. {
  257. "tempId": "bCacheTemp_wJfaNQwj3d",
  258. "bCacheId": "bCache_H2Ey7Dih53"
  259. }
  260. ]
  261. }
  262. },
  263. {
  264. "id": "group_4RXZiyttzj",
  265. "name": "api相关",
  266. "type": "group",
  267. "props": {
  268. "devId": "group_4RXZiyttzj"
  269. },
  270. "children": [
  271. {
  272. "id": "service_s5y2wckW6G",
  273. "name": "员工关键字搜索服务",
  274. "type": "service",
  275. "props": {
  276. "devId": "service_s5y2wckW6G",
  277. "isOpen": true,
  278. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(用户名==用户名)\r\nconst emitter = new events.EventEmitter(); \r\n\r\nparam.显示关联 = 1;\r\n\r\nemitter.on('getUserList', ()=>{\r\n _F('bComponent_ixwS77E2Mw').callMethod('service_JT4zdxjSc6',{\r\n inParam:param,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getUserList');",
  279. "inParams": [
  280. "pageNum",
  281. "pageSize",
  282. "部门ID",
  283. "角色ID",
  284. "关键字",
  285. "是否删除"
  286. ],
  287. "outParams": [],
  288. "openApiPath": "v1/admin/staff/search",
  289. "inParamsDebug": {
  290. "关键字": "xxx.com",
  291. "是否删除": ""
  292. }
  293. }
  294. },
  295. {
  296. "id": "service_mXRwwYDWQz",
  297. "name": "禁用员工",
  298. "type": "service",
  299. "props": {
  300. "devId": "service_mXRwwYDWQz",
  301. "isOpen": true,
  302. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('editUser', (userId)=>{\r\n _F('bComponent_ixwS77E2Mw').callMethod('service_bazaCNCCK3',{\r\n inParam:param,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\n//let userInfo = _F('middle_func').callMethod('last');\r\nemitter.emit('editUser',param.用户ID);",
  303. "inParams": [
  304. "员工ID",
  305. "是否禁用"
  306. ],
  307. "outParams": [],
  308. "openApiPath": "v1/admin/staff/stop",
  309. "inParamsDebug": {
  310. "员工ID": "1",
  311. "是否禁用": "0"
  312. }
  313. }
  314. },
  315. {
  316. "id": "service_HJ7dGEJNYz",
  317. "name": "删除员工",
  318. "type": "service",
  319. "props": {
  320. "devId": "service_HJ7dGEJNYz",
  321. "isOpen": true,
  322. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('editUser', (userId)=>{\r\n _F('bComponent_ixwS77E2Mw').callMethod('service_PQd7Zr4nK6',{\r\n inParam:param,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\n//let userInfo = _F('middle_func').callMethod('last');\r\nemitter.emit('editUser',param.用户ID);",
  323. "inParams": [
  324. "员工ID",
  325. "是否删除"
  326. ],
  327. "outParams": [],
  328. "openApiPath": "v1/admin/staff/del",
  329. "inParamsDebug": {
  330. "员工ID": "1",
  331. "是否删除": "0"
  332. }
  333. }
  334. },
  335. {
  336. "id": "service_CkhyA3FBeF",
  337. "name": "编辑员工信息",
  338. "type": "service",
  339. "props": {
  340. "devId": "service_CkhyA3FBeF",
  341. "isOpen": true,
  342. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('editUser', (userId)=>{\r\n _F('bComponent_ixwS77E2Mw').callMethod('service_7PnxyXDPAT',{\r\n inParam:param,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\n//let userInfo = _F('middle_func').callMethod('last');\r\nemitter.emit('editUser',param.用户ID);",
  343. "inParams": [
  344. "员工ID",
  345. "姓名",
  346. "角色ID",
  347. "部门ID",
  348. "邮箱",
  349. "手机号",
  350. "用户名"
  351. ],
  352. "outParams": [],
  353. "openApiPath": "v1/admin/staff/edit",
  354. "inParamsDebug": {
  355. "姓名": "",
  356. "邮箱": "",
  357. "员工ID": "1",
  358. "角色ID": "1",
  359. "部门ID": "1",
  360. "手机号": "",
  361. "用户名": ""
  362. }
  363. }
  364. },
  365. {
  366. "id": "service_z7BMJtSeRG",
  367. "name": "员工用户名密码登录",
  368. "type": "service",
  369. "props": {
  370. "devId": "service_z7BMJtSeRG",
  371. "isOpen": true,
  372. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(用户名==用户名)\r\nconst emitter = new events.EventEmitter(); \r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('bComponent_ixwS77E2Mw').callMethod('service_DE3rN7bad6',{\r\n inParam:{\r\n 用户名: param.用户名,\r\n 密码: param.密码,\r\n\t\t\t\t使用cookie:param.使用cookie==false?0:1,\r\n\t\t\t\tcookie域名:param.cookie域名,\r\n 登录有效时长:3600 * 24,\r\n\t\t\t\t允许多端登录:1,\r\n },\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getUserInfo');",
  373. "inParams": [
  374. "用户名",
  375. "密码",
  376. "cookie域名",
  377. "使用cookie"
  378. ],
  379. "outParams": [
  380. "code",
  381. "errMsg",
  382. "result"
  383. ],
  384. "openApiPath": "v1/staff/login",
  385. "inParamsDebug": {
  386. "密码": "123123",
  387. "用户名": "张学友",
  388. "cookie域名": ".devstudio.aliyuncs.com",
  389. "使用cookie": "1"
  390. }
  391. }
  392. },
  393. {
  394. "id": "service_WjjfcXy7h2",
  395. "name": "员工用户名密码注册",
  396. "type": "service",
  397. "props": {
  398. "devId": "service_WjjfcXy7h2",
  399. "isOpen": true,
  400. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(用户名==用户名)\r\nconst emitter = new events.EventEmitter(); \r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('bComponent_ixwS77E2Mw').callMethod('service_5xT7BspmbA',{\r\n inParam:param,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getUserInfo');",
  401. "inParams": [
  402. "用户名",
  403. "密码",
  404. "姓名",
  405. "角色ID",
  406. "部门ID",
  407. "邮箱",
  408. "手机号"
  409. ],
  410. "outParams": [
  411. "code",
  412. "errMsg",
  413. "result"
  414. ],
  415. "openApiPath": "v1/admin/staff/reg",
  416. "inParamsDebug": {
  417. "姓名": "超级管理员",
  418. "密码": "123123",
  419. "用户名": "超级管理员"
  420. }
  421. }
  422. },
  423. {
  424. "id": "service_Skm27cT882",
  425. "name": "获取员工登录信息",
  426. "type": "service",
  427. "props": {
  428. "devId": "service_Skm27cT882",
  429. "isOpen": true,
  430. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(用户名==用户名)\r\nconst emitter = new events.EventEmitter(); \r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('bComponent_ixwS77E2Mw').callMethod('service_8rNTjXTpbf',{\r\n inParam:{\r\n token: param.token,\r\n },\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getUserInfo');",
  431. "inParams": [
  432. "token"
  433. ],
  434. "outParams": [
  435. "code",
  436. "errMsg",
  437. "result"
  438. ],
  439. "openApiPath": "v1/admin/staff/logined/info",
  440. "inParamsDebug": {
  441. "token": "zrlHaNgH4nMb9HXk2XlJtGv4aBRQ3hrw"
  442. }
  443. }
  444. },
  445. {
  446. "id": "service_SdiRyy5Tz6",
  447. "name": "员工退出登录",
  448. "type": "service",
  449. "props": {
  450. "devId": "service_SdiRyy5Tz6",
  451. "isOpen": true,
  452. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('delUserInfo', ()=>{\r\n _F('bComponent_ixwS77E2Mw').callMethod('service_hB82nRtmDR',{\r\n inParam:{\r\n token: param.token,\r\n\t\t\t\tcookie域名:'.devstudio.aliyuncs.com',\r\n },\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('delUserInfo');",
  453. "inParams": [
  454. "token"
  455. ],
  456. "outParams": [
  457. "code",
  458. "errMsg",
  459. "result"
  460. ],
  461. "openApiPath": "v1/admin/staff/logout",
  462. "inParamsDebug": {}
  463. }
  464. }
  465. ]
  466. },
  467. {
  468. "id": "group_Rr8kThAAic",
  469. "name": "数据库相关",
  470. "type": "group",
  471. "props": {
  472. "devId": "group_Rr8kThAAic"
  473. },
  474. "children": [
  475. {
  476. "id": "dbTable_hdbHcrwH23",
  477. "name": "员工表",
  478. "type": "dbTable",
  479. "props": {
  480. "devId": "dbTable_hdbHcrwH23",
  481. "fields": [
  482. {
  483. "columnName": "_id",
  484. "columnType": "int unsigned"
  485. },
  486. {
  487. "columnName": "用户名",
  488. "columnType": "text"
  489. },
  490. {
  491. "columnName": "手机号",
  492. "columnType": "text"
  493. },
  494. {
  495. "columnName": "邮箱",
  496. "columnType": "text"
  497. },
  498. {
  499. "columnName": "昵称",
  500. "columnType": "text"
  501. },
  502. {
  503. "columnName": "姓名",
  504. "columnType": "text"
  505. },
  506. {
  507. "columnName": "密码",
  508. "columnType": "text"
  509. },
  510. {
  511. "columnName": "角色ID",
  512. "columnType": "int"
  513. },
  514. {
  515. "columnName": "部门ID",
  516. "columnType": "int"
  517. },
  518. {
  519. "columnName": "是否禁用",
  520. "columnType": "int"
  521. },
  522. {
  523. "columnName": "是否删除",
  524. "columnType": "int"
  525. },
  526. {
  527. "columnName": "_create",
  528. "columnType": "bigint unsigned"
  529. },
  530. {
  531. "columnName": "_update",
  532. "columnType": "bigint unsigned"
  533. }
  534. ]
  535. }
  536. },
  537. {
  538. "id": "bCache_H2Ey7Dih53",
  539. "name": "用户登录信息缓存",
  540. "type": "bCache",
  541. "props": {
  542. "devId": "bCache_H2Ey7Dih53"
  543. }
  544. },
  545. {
  546. "id": "dbView_3i5A4HYEaS",
  547. "name": "员工列表视图",
  548. "type": "dbView",
  549. "props": {
  550. "devId": "dbView_3i5A4HYEaS",
  551. "columns": [
  552. {
  553. "joinParam": {
  554. "lTName": "",
  555. "rTName": "",
  556. "lTField": "",
  557. "rTField": "",
  558. "condition": []
  559. },
  560. "columnName": "*",
  561. "columnType": "field",
  562. "fieldParam": {
  563. "tName": "dbTable_hdbHcrwH23",
  564. "tField": "*"
  565. }
  566. },
  567. {
  568. "joinParam": {
  569. "lTName": "",
  570. "rTName": "",
  571. "lTField": "",
  572. "rTField": "",
  573. "condition": []
  574. },
  575. "columnName": "部门名称",
  576. "columnType": "field",
  577. "fieldParam": {
  578. "tName": "dbTable_27HfwMiSTt",
  579. "tField": "部门名称"
  580. }
  581. },
  582. {
  583. "joinParam": {
  584. "lTName": "dbTable_hdbHcrwH23",
  585. "rTName": "dbTable_27HfwMiSTt",
  586. "lTField": "部门ID",
  587. "rTField": "_id",
  588. "condition": []
  589. },
  590. "columnName": "部门ID关联",
  591. "columnType": "join",
  592. "fieldParam": {
  593. "tName": "",
  594. "tField": ""
  595. }
  596. },
  597. {
  598. "joinParam": {
  599. "lTName": "dbTable_hdbHcrwH23",
  600. "rTName": "dbTable_iHj2cMawrr",
  601. "lTField": "角色ID",
  602. "rTField": "_id",
  603. "condition": []
  604. },
  605. "columnName": "角色ID关联",
  606. "columnType": "join",
  607. "fieldParam": {
  608. "tName": "",
  609. "tField": ""
  610. }
  611. },
  612. {
  613. "joinParam": {
  614. "lTName": "",
  615. "rTName": "",
  616. "lTField": "",
  617. "rTField": "",
  618. "condition": []
  619. },
  620. "columnName": "角色名称",
  621. "columnType": "field",
  622. "fieldParam": {
  623. "tName": "dbTable_iHj2cMawrr",
  624. "tField": "角色名称"
  625. }
  626. }
  627. ]
  628. }
  629. }
  630. ]
  631. }
  632. ]
  633. },
  634. {
  635. "id": "group_Xw6QKB744N",
  636. "name": "菜单中台相关",
  637. "type": "group",
  638. "props": {
  639. "devId": "group_Xw6QKB744N"
  640. },
  641. "children": [
  642. {
  643. "id": "bComponent_bJiEYkYtPn",
  644. "name": "菜单管理后台组件",
  645. "type": "bComponent",
  646. "props": {
  647. "devId": "bComponent_bJiEYkYtPn",
  648. "moduleId": "module_FBsbDYPT8B",
  649. "dbConnect": [
  650. {
  651. "tempId": "dbTableTemp_nr37DhHs56",
  652. "tableId": "dbTable_EtNEzKsaYk"
  653. }
  654. ]
  655. }
  656. },
  657. {
  658. "id": "group_Pt2JYJmKTN",
  659. "name": "api相关",
  660. "type": "group",
  661. "props": {
  662. "devId": "group_Pt2JYJmKTN"
  663. },
  664. "children": [
  665. {
  666. "id": "service_3t5ecYRD7J",
  667. "name": "菜单关键字搜索服务",
  668. "type": "service",
  669. "props": {
  670. "devId": "service_3t5ecYRD7J",
  671. "isOpen": true,
  672. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = {};\r\nif(param.hasOwnProperty('菜单名称'))inParam['菜单名称'] = param.菜单名称;\r\nif(param.hasOwnProperty('上级菜单ID'))inParam['上级菜单ID'] = param.上级菜单ID;\r\nif(param.hasOwnProperty('当前页码'))inParam['当前页码'] = param.当前页码;\r\nif(param.hasOwnProperty('每页大小'))inParam['每页大小'] = param.每页大小;\r\nif(param.hasOwnProperty('是否删除'))inParam['是否删除'] = param.是否删除;\r\n\r\nemitter.on('getList', ()=>{\r\n _F('bComponent_bJiEYkYtPn').callMethod('service_zYN6Kpynpy',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getList');",
  673. "inParams": [
  674. "菜单名称",
  675. "上级菜单ID",
  676. "当前页码",
  677. "每页大小",
  678. "是否删除"
  679. ],
  680. "outParams": [],
  681. "openApiPath": "v1/admin/menu/search",
  682. "inParamsDebug": {
  683. "上级菜单ID": "all"
  684. }
  685. }
  686. },
  687. {
  688. "id": "service_6JPfXkCpiH",
  689. "name": "菜单删除服务",
  690. "type": "service",
  691. "props": {
  692. "devId": "service_6JPfXkCpiH",
  693. "isOpen": true,
  694. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = {};\r\nif(param.hasOwnProperty('菜单ID'))inParam['菜单ID'] = param.菜单ID;\r\nif(param.hasOwnProperty('是否删除'))inParam['是否删除'] = param.是否删除 == 1?1:0;\r\n\r\nemitter.on('delDept', ()=>{\r\n _F('bComponent_bJiEYkYtPn').callMethod('service_FHxSD7RYtT',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('delDept');",
  695. "inParams": [
  696. "菜单ID",
  697. "是否删除"
  698. ],
  699. "outParams": [],
  700. "openApiPath": "v1/admin/menu/del",
  701. "inParamsDebug": {
  702. "部门ID": "1",
  703. "是否删除": "0",
  704. "是否禁用": "0",
  705. "部门名称": "多八多总部2",
  706. "上级部门ID": "0"
  707. }
  708. }
  709. },
  710. {
  711. "id": "service_FtdGdw5G5Z",
  712. "name": "菜单新增服务",
  713. "type": "service",
  714. "props": {
  715. "devId": "service_FtdGdw5G5Z",
  716. "isOpen": true,
  717. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('appDept', ()=>{\r\n _F('bComponent_bJiEYkYtPn').callMethod('service_jQ4AEAwPSy',{\r\n inParam:param,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('appDept');",
  718. "inParams": [
  719. "菜单名称",
  720. "上级菜单ID",
  721. "类型",
  722. "排序",
  723. "页面路径",
  724. "接口路径",
  725. "key"
  726. ],
  727. "outParams": [],
  728. "openApiPath": "v1/admin/menu/add",
  729. "inParamsDebug": {
  730. "key": "system_menu",
  731. "排序": "600",
  732. "类型": "页面",
  733. "菜单名称": "菜单管理",
  734. "部门名称": "多八多总部",
  735. "页面路径": "/admin/system/menu",
  736. "上级菜单ID": "1",
  737. "上级部门ID": "0"
  738. }
  739. }
  740. },
  741. {
  742. "id": "service_r7fD7G6dwQ",
  743. "name": "菜单编辑服务",
  744. "type": "service",
  745. "props": {
  746. "devId": "service_r7fD7G6dwQ",
  747. "isOpen": true,
  748. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = param;\r\n\r\nemitter.on('editDept', ()=>{\r\n _F('bComponent_bJiEYkYtPn').callMethod('service_cF6TRXP68X',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('editDept');",
  749. "inParams": [
  750. "菜单ID",
  751. "菜单名称",
  752. "上级菜单ID",
  753. "是否禁用",
  754. "是否删除",
  755. "类型",
  756. "排序",
  757. "页面路径",
  758. "接口路径",
  759. "key"
  760. ],
  761. "outParams": [],
  762. "openApiPath": "v1/admin/menu/edit",
  763. "inParamsDebug": {
  764. "菜单ID": "6",
  765. "部门ID": "1",
  766. "是否删除": "",
  767. "是否禁用": "",
  768. "部门名称": "多八多总部2",
  769. "上级菜单ID": "0",
  770. "上级部门ID": "0"
  771. }
  772. }
  773. }
  774. ]
  775. },
  776. {
  777. "id": "group_G53bPSRtKQ",
  778. "name": "数据库相关",
  779. "type": "group",
  780. "props": {
  781. "devId": "group_G53bPSRtKQ"
  782. },
  783. "children": [
  784. {
  785. "id": "dbTable_EtNEzKsaYk",
  786. "name": "菜单表",
  787. "type": "dbTable",
  788. "props": {
  789. "devId": "dbTable_EtNEzKsaYk",
  790. "fields": [
  791. {
  792. "columnName": "_id",
  793. "columnType": "int unsigned"
  794. },
  795. {
  796. "columnName": "key",
  797. "columnType": "text"
  798. },
  799. {
  800. "columnName": "菜单名称",
  801. "columnType": "text"
  802. },
  803. {
  804. "columnName": "上级菜单ID",
  805. "columnType": "text"
  806. },
  807. {
  808. "columnName": "类型",
  809. "columnType": "text"
  810. },
  811. {
  812. "columnName": "排序",
  813. "columnType": "int"
  814. },
  815. {
  816. "columnName": "页面路径",
  817. "columnType": "text"
  818. },
  819. {
  820. "columnName": "接口路径",
  821. "columnType": "text"
  822. },
  823. {
  824. "columnName": "是否禁用",
  825. "columnType": "text"
  826. },
  827. {
  828. "columnName": "是否删除",
  829. "columnType": "text"
  830. },
  831. {
  832. "columnName": "_create",
  833. "columnType": "bigint unsigned"
  834. },
  835. {
  836. "columnName": "_update",
  837. "columnType": "bigint unsigned"
  838. }
  839. ]
  840. }
  841. }
  842. ]
  843. }
  844. ]
  845. },
  846. {
  847. "id": "group_3RnxpS8ibY",
  848. "name": "角色中台相关",
  849. "type": "group",
  850. "props": {
  851. "devId": "group_3RnxpS8ibY"
  852. },
  853. "children": [
  854. {
  855. "id": "bComponent_A5KPDe2K5M",
  856. "name": "角色管理后台组件",
  857. "type": "bComponent",
  858. "props": {
  859. "devId": "bComponent_A5KPDe2K5M",
  860. "moduleId": "module_fNRWBJ426W",
  861. "dbConnect": [
  862. {
  863. "tempId": "dbTableTemp_nr37DhHs56",
  864. "tableId": "dbTable_iHj2cMawrr"
  865. }
  866. ]
  867. }
  868. },
  869. {
  870. "id": "group_7rBcrQX748",
  871. "name": "api相关",
  872. "type": "group",
  873. "props": {
  874. "devId": "group_7rBcrQX748"
  875. },
  876. "children": [
  877. {
  878. "id": "service_XcwkicXF2d",
  879. "name": "角色关键字搜索服务",
  880. "type": "service",
  881. "props": {
  882. "devId": "service_XcwkicXF2d",
  883. "isOpen": true,
  884. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = {};\r\nif(param.hasOwnProperty('角色名称'))inParam['角色名称'] = param.角色名称;\r\nif(param.hasOwnProperty('当前页码'))inParam['当前页码'] = param.当前页码;\r\nif(param.hasOwnProperty('每页大小'))inParam['每页大小'] = param.每页大小;\r\nif(param.hasOwnProperty('是否删除'))inParam['是否删除'] = param.是否删除;\r\n\r\nemitter.on('getList', ()=>{\r\n _F('bComponent_A5KPDe2K5M').callMethod('service_zYN6Kpynpy',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getList');",
  885. "inParams": [
  886. "角色名称",
  887. "当前页码",
  888. "每页大小",
  889. "是否删除"
  890. ],
  891. "outParams": [],
  892. "openApiPath": "v1/admin/role/search",
  893. "inParamsDebug": {
  894. "上级菜单ID": "all"
  895. }
  896. }
  897. },
  898. {
  899. "id": "service_J6ciGBd2kf",
  900. "name": "角色删除服务",
  901. "type": "service",
  902. "props": {
  903. "devId": "service_J6ciGBd2kf",
  904. "isOpen": true,
  905. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = {};\r\nif(param.hasOwnProperty('角色ID'))inParam['角色ID'] = param.角色ID;\r\nif(param.hasOwnProperty('是否删除'))inParam['是否删除'] = param.是否删除 == 1?1:0;\r\n\r\nemitter.on('delDept', ()=>{\r\n _F('bComponent_A5KPDe2K5M').callMethod('service_FHxSD7RYtT',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('delDept');",
  906. "inParams": [
  907. "角色ID",
  908. "是否删除"
  909. ],
  910. "outParams": [],
  911. "openApiPath": "v1/admin/role/del",
  912. "inParamsDebug": {
  913. "部门ID": "1",
  914. "是否删除": "0",
  915. "是否禁用": "0",
  916. "部门名称": "多八多总部2",
  917. "上级部门ID": "0"
  918. }
  919. }
  920. },
  921. {
  922. "id": "service_Ty8QksQJaE",
  923. "name": "角色新增服务",
  924. "type": "service",
  925. "props": {
  926. "devId": "service_Ty8QksQJaE",
  927. "isOpen": true,
  928. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('appDept', ()=>{\r\n _F('bComponent_A5KPDe2K5M').callMethod('service_jQ4AEAwPSy',{\r\n inParam:param,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('appDept');",
  929. "inParams": [
  930. "角色名称",
  931. "菜单IDs"
  932. ],
  933. "outParams": [],
  934. "openApiPath": "v1/admin/role/add",
  935. "inParamsDebug": {
  936. "部门名称": "多八多总部",
  937. "上级部门ID": "0"
  938. }
  939. }
  940. },
  941. {
  942. "id": "service_jD3Myn6WHG",
  943. "name": "角色编辑服务",
  944. "type": "service",
  945. "props": {
  946. "devId": "service_jD3Myn6WHG",
  947. "isOpen": true,
  948. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = param;\r\n\r\nemitter.on('editDept', ()=>{\r\n _F('bComponent_A5KPDe2K5M').callMethod('service_cF6TRXP68X',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('editDept');",
  949. "inParams": [
  950. "角色ID",
  951. "角色名称",
  952. "菜单IDs",
  953. "是否禁用"
  954. ],
  955. "outParams": [],
  956. "openApiPath": "v1/admin/role/edit",
  957. "inParamsDebug": {
  958. "菜单ID": "6",
  959. "部门ID": "1",
  960. "是否删除": "",
  961. "是否禁用": "",
  962. "部门名称": "多八多总部2",
  963. "上级菜单ID": "0",
  964. "上级部门ID": "0"
  965. }
  966. }
  967. }
  968. ]
  969. },
  970. {
  971. "id": "group_NBcdD4mHhM",
  972. "name": "数据库相关",
  973. "type": "group",
  974. "props": {
  975. "devId": "group_NBcdD4mHhM"
  976. },
  977. "children": [
  978. {
  979. "id": "dbTable_iHj2cMawrr",
  980. "name": "角色表",
  981. "type": "dbTable",
  982. "props": {
  983. "devId": "dbTable_iHj2cMawrr",
  984. "fields": [
  985. {
  986. "columnName": "_id",
  987. "columnType": "int unsigned"
  988. },
  989. {
  990. "columnName": "角色名称",
  991. "columnType": "text"
  992. },
  993. {
  994. "columnName": "菜单IDs",
  995. "columnType": "json"
  996. },
  997. {
  998. "columnName": "是否禁用",
  999. "columnType": "text"
  1000. },
  1001. {
  1002. "columnName": "是否删除",
  1003. "columnType": "text"
  1004. },
  1005. {
  1006. "columnName": "_create",
  1007. "columnType": "bigint unsigned"
  1008. },
  1009. {
  1010. "columnName": "_update",
  1011. "columnType": "bigint unsigned"
  1012. }
  1013. ]
  1014. }
  1015. }
  1016. ]
  1017. }
  1018. ]
  1019. },
  1020. {
  1021. "id": "group_b587tD2T78",
  1022. "name": "部门中台相关",
  1023. "type": "group",
  1024. "props": {
  1025. "devId": "group_b587tD2T78"
  1026. },
  1027. "children": [
  1028. {
  1029. "id": "bComponent_nQ8HKdd4cT",
  1030. "name": "部门编辑后台组件",
  1031. "type": "bComponent",
  1032. "props": {
  1033. "devId": "bComponent_nQ8HKdd4cT",
  1034. "moduleId": "module_C8GjKaaHBs",
  1035. "dbConnect": [
  1036. {
  1037. "tempId": "dbTableTemp_nr37DhHs56",
  1038. "tableId": "dbTable_27HfwMiSTt"
  1039. }
  1040. ]
  1041. }
  1042. },
  1043. {
  1044. "id": "group_7sNkDzW5BS",
  1045. "name": "api相关",
  1046. "type": "group",
  1047. "props": {
  1048. "devId": "group_7sNkDzW5BS"
  1049. },
  1050. "children": [
  1051. {
  1052. "id": "service_eymdXAJHNA",
  1053. "name": "部门关键字搜索服务",
  1054. "type": "service",
  1055. "props": {
  1056. "devId": "service_eymdXAJHNA",
  1057. "isOpen": true,
  1058. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = {};\r\nif(param.hasOwnProperty('部门名称'))inParam['部门名称'] = param.部门名称;\r\nif(param.hasOwnProperty('上级部门ID'))inParam['上级部门ID'] = param.上级部门ID;\r\nif(param.hasOwnProperty('当前页码'))inParam['当前页码'] = param.当前页码;\r\nif(param.hasOwnProperty('每页大小'))inParam['每页大小'] = param.每页大小;\r\nif(param.hasOwnProperty('是否删除'))inParam['是否删除'] = param.是否删除;\r\n\r\nemitter.on('getList', ()=>{\r\n _F('bComponent_nQ8HKdd4cT').callMethod('service_zYN6Kpynpy',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getList');",
  1059. "inParams": [
  1060. "部门名称",
  1061. "上级部门ID",
  1062. "当前页码",
  1063. "每页大小",
  1064. "是否删除"
  1065. ],
  1066. "outParams": [],
  1067. "openApiPath": "v1/admin/dept/search",
  1068. "inParamsDebug": {}
  1069. }
  1070. },
  1071. {
  1072. "id": "service_abRrAnRzSD",
  1073. "name": "部门删除服务",
  1074. "type": "service",
  1075. "props": {
  1076. "devId": "service_abRrAnRzSD",
  1077. "isOpen": true,
  1078. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = {};\r\nif(param.hasOwnProperty('部门ID'))inParam['部门ID'] = param.部门ID;\r\nif(param.hasOwnProperty('是否删除'))inParam['是否删除'] = param.是否删除 == 1?1:0;\r\n\r\nemitter.on('delDept', ()=>{\r\n _F('bComponent_nQ8HKdd4cT').callMethod('service_FHxSD7RYtT',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('delDept');",
  1079. "inParams": [
  1080. "部门ID",
  1081. "是否删除"
  1082. ],
  1083. "outParams": [],
  1084. "openApiPath": "v1/admin/dept/del",
  1085. "inParamsDebug": {
  1086. "部门ID": "1",
  1087. "是否删除": "0",
  1088. "是否禁用": "0",
  1089. "部门名称": "多八多总部2",
  1090. "上级部门ID": "0"
  1091. }
  1092. }
  1093. },
  1094. {
  1095. "id": "service_BBajpw3kXs",
  1096. "name": "部门新增服务",
  1097. "type": "service",
  1098. "props": {
  1099. "devId": "service_BBajpw3kXs",
  1100. "isOpen": true,
  1101. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('appDept', ()=>{\r\n _F('bComponent_nQ8HKdd4cT').callMethod('service_jQ4AEAwPSy',{\r\n inParam:{\r\n 部门名称: param.部门名称,\r\n 上级部门ID: param.上级部门ID,\r\n },\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('appDept');",
  1102. "inParams": [
  1103. "部门名称",
  1104. "上级部门ID"
  1105. ],
  1106. "outParams": [],
  1107. "openApiPath": "v1/admin/dept/add",
  1108. "inParamsDebug": {
  1109. "部门名称": "多八多总部",
  1110. "上级部门ID": "0"
  1111. }
  1112. }
  1113. },
  1114. {
  1115. "id": "service_SkW7dYZHe2",
  1116. "name": "部门编辑服务",
  1117. "type": "service",
  1118. "props": {
  1119. "devId": "service_SkW7dYZHe2",
  1120. "isOpen": true,
  1121. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = {};\r\nif(param.hasOwnProperty('部门ID'))inParam['部门ID'] = param.部门ID;\r\nif(param.hasOwnProperty('部门名称'))inParam['部门名称'] = param.部门名称;\r\nif(param.hasOwnProperty('上级部门ID'))inParam['上级部门ID'] = param.上级部门ID;\r\nif(param.hasOwnProperty('是否禁用'))inParam['是否禁用'] = param.是否禁用 == 1?1:0;\r\nif(param.hasOwnProperty('是否删除'))inParam['是否删除'] = param.是否删除 == 1?1:0;\r\n\r\nemitter.on('editDept', ()=>{\r\n _F('bComponent_nQ8HKdd4cT').callMethod('service_cF6TRXP68X',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('editDept');",
  1122. "inParams": [
  1123. "部门ID",
  1124. "部门名称",
  1125. "上级部门ID",
  1126. "是否禁用",
  1127. "是否删除"
  1128. ],
  1129. "outParams": [],
  1130. "openApiPath": "v1/admin/dept/edit",
  1131. "inParamsDebug": {
  1132. "部门ID": "1",
  1133. "是否删除": "0",
  1134. "是否禁用": "0",
  1135. "部门名称": "总部",
  1136. "上级部门ID": "0"
  1137. }
  1138. }
  1139. }
  1140. ]
  1141. },
  1142. {
  1143. "id": "group_w38DGdWw6H",
  1144. "name": "数据库相关",
  1145. "type": "group",
  1146. "props": {
  1147. "devId": "group_w38DGdWw6H"
  1148. },
  1149. "children": [
  1150. {
  1151. "id": "dbTable_27HfwMiSTt",
  1152. "name": "部门表",
  1153. "type": "dbTable",
  1154. "props": {
  1155. "devId": "dbTable_27HfwMiSTt",
  1156. "fields": [
  1157. {
  1158. "columnName": "_id",
  1159. "columnType": "int unsigned"
  1160. },
  1161. {
  1162. "columnName": "部门名称",
  1163. "columnType": "text"
  1164. },
  1165. {
  1166. "columnName": "上级部门ID",
  1167. "columnType": "text"
  1168. },
  1169. {
  1170. "columnName": "是否禁用",
  1171. "columnType": "text"
  1172. },
  1173. {
  1174. "columnName": "是否删除",
  1175. "columnType": "text"
  1176. },
  1177. {
  1178. "columnName": "_create",
  1179. "columnType": "bigint unsigned"
  1180. },
  1181. {
  1182. "columnName": "_update",
  1183. "columnType": "bigint unsigned"
  1184. }
  1185. ]
  1186. }
  1187. }
  1188. ]
  1189. }
  1190. ]
  1191. },
  1192. {
  1193. "id": "group_2BEJfDwNxw",
  1194. "name": "用户中台相关",
  1195. "type": "group",
  1196. "props": {
  1197. "devId": "group_2BEJfDwNxw"
  1198. },
  1199. "children": [
  1200. {
  1201. "id": "bComponent_dbwbpXWs3P",
  1202. "name": "用户中台组件",
  1203. "type": "bComponent",
  1204. "props": {
  1205. "devId": "bComponent_dbwbpXWs3P",
  1206. "moduleId": "module_Rn2saN62Y8",
  1207. "dbConnect": [
  1208. {
  1209. "tempId": "dbTableTemp_6xG6thEJQS",
  1210. "tableId": "dbTable_nhr7fMnmKE"
  1211. }
  1212. ],
  1213. "bCacheConnect": [
  1214. {
  1215. "tempId": "bCacheTemp_wJfaNQwj3d",
  1216. "bCacheId": "bCache_mZzh8THMJd"
  1217. }
  1218. ]
  1219. }
  1220. },
  1221. {
  1222. "id": "group_xZZbaimRkc",
  1223. "name": "前台api",
  1224. "type": "group",
  1225. "props": {
  1226. "devId": "group_xZZbaimRkc"
  1227. },
  1228. "children": [
  1229. {
  1230. "id": "service_ZkhdCsahs4",
  1231. "name": "组件用户密码登录",
  1232. "type": "service",
  1233. "props": {
  1234. "devId": "service_ZkhdCsahs4",
  1235. "isOpen": true,
  1236. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(用户名==用户名)\r\nconst emitter = new events.EventEmitter(); \r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('bComponent_dbwbpXWs3P').callMethod('service_DE3rN7bad6',{\r\n inParam:{\r\n 用户名: param.用户名,\r\n 密码: param.密码,\r\n\t\t\t\t使用cookie:param.使用cookie==false?0:1,\r\n\t\t\t\tcookie域名:param.cookie域名,\r\n 登录有效时长:3600 * 24,\r\n\t\t\t\t允许多端登录:1,\r\n },\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getUserInfo');",
  1237. "inParams": [
  1238. "用户名",
  1239. "密码",
  1240. "cookie域名",
  1241. "使用cookie"
  1242. ],
  1243. "outParams": [
  1244. "code",
  1245. "errMsg",
  1246. "result"
  1247. ],
  1248. "openApiPath": "v1/user/login",
  1249. "inParamsDebug": {
  1250. "密码": "123123",
  1251. "用户名": "13800138000",
  1252. "cookie域名": ".devstudio.aliyuncs.com",
  1253. "使用cookie": "1"
  1254. }
  1255. }
  1256. },
  1257. {
  1258. "id": "service_T3wf7xG4wN",
  1259. "name": "组件用户密码注册",
  1260. "type": "service",
  1261. "props": {
  1262. "devId": "service_T3wf7xG4wN",
  1263. "isOpen": true,
  1264. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(用户名==用户名)\r\nconst emitter = new events.EventEmitter(); \r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('bComponent_dbwbpXWs3P').callMethod('service_5xT7BspmbA',{\r\n inParam:{\r\n 用户名: param.用户名,\r\n 密码: param.密码,\r\n },\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getUserInfo');",
  1265. "inParams": [
  1266. "用户名",
  1267. "密码"
  1268. ],
  1269. "outParams": [
  1270. "code",
  1271. "errMsg",
  1272. "result"
  1273. ],
  1274. "openApiPath": "v1/user/reg",
  1275. "inParamsDebug": {
  1276. "密码": "123123",
  1277. "用户名": "13800138000"
  1278. }
  1279. }
  1280. },
  1281. {
  1282. "id": "service_s8WQ4km4c3",
  1283. "name": "组件获取用户登录信息",
  1284. "type": "service",
  1285. "props": {
  1286. "devId": "service_s8WQ4km4c3",
  1287. "isOpen": true,
  1288. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(用户名==用户名)\r\nconst emitter = new events.EventEmitter(); \r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('bComponent_dbwbpXWs3P').callMethod('service_8rNTjXTpbf',{\r\n inParam:{\r\n token: param.token,\r\n },\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getUserInfo');",
  1289. "inParams": [
  1290. "token"
  1291. ],
  1292. "outParams": [
  1293. "code",
  1294. "errMsg",
  1295. "result"
  1296. ],
  1297. "openApiPath": "v1/user/logined/info",
  1298. "inParamsDebug": {
  1299. "token": "zrlHaNgH4nMb9HXk2XlJtGv4aBRQ3hrw"
  1300. }
  1301. }
  1302. },
  1303. {
  1304. "id": "service_GjMdGAeYR8",
  1305. "name": "组件用户退出登录",
  1306. "type": "service",
  1307. "props": {
  1308. "devId": "service_GjMdGAeYR8",
  1309. "isOpen": true,
  1310. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('delUserInfo', ()=>{\r\n _F('bComponent_dbwbpXWs3P').callMethod('service_hB82nRtmDR',{\r\n inParam:{\r\n token: param.token,\r\n\t\t\t\tcookie域名:'.devstudio.aliyuncs.com',\r\n },\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('delUserInfo');",
  1311. "inParams": [
  1312. "token"
  1313. ],
  1314. "outParams": [
  1315. "code",
  1316. "errMsg",
  1317. "result"
  1318. ],
  1319. "openApiPath": "v1/user/logout",
  1320. "inParamsDebug": {}
  1321. }
  1322. },
  1323. {
  1324. "id": "service_zz8PfZQRQG",
  1325. "name": "编辑用户信息",
  1326. "type": "service",
  1327. "props": {
  1328. "devId": "service_zz8PfZQRQG",
  1329. "isOpen": true,
  1330. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('editUser', (userId)=>{\r\n _F('bComponent_dbwbpXWs3P').callMethod('service_amBQpHZ56h',{\r\n inParam:{\r\n 用户ID: userId,\r\n 昵称: param.昵称,\r\n },\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nlet userInfo = _F('middle_func').callMethod('last');\r\nemitter.emit('editUser',userInfo._id);",
  1331. "inParams": [
  1332. "昵称"
  1333. ],
  1334. "outParams": [
  1335. "code",
  1336. "errMsg",
  1337. "result"
  1338. ],
  1339. "openApiPath": "v1/mine/user/edit",
  1340. "inParamsDebug": {}
  1341. }
  1342. }
  1343. ]
  1344. },
  1345. {
  1346. "id": "group_Bxrmyp7RKj",
  1347. "name": "数据库相关",
  1348. "type": "group",
  1349. "props": {
  1350. "devId": "group_Bxrmyp7RKj"
  1351. },
  1352. "children": [
  1353. {
  1354. "id": "dbTable_nhr7fMnmKE",
  1355. "name": "用户表",
  1356. "type": "dbTable",
  1357. "props": {
  1358. "devId": "dbTable_nhr7fMnmKE",
  1359. "fields": [
  1360. {
  1361. "columnName": "_id",
  1362. "columnType": "int unsigned"
  1363. },
  1364. {
  1365. "columnName": "用户名",
  1366. "columnType": "text"
  1367. },
  1368. {
  1369. "columnName": "手机号",
  1370. "columnType": "text"
  1371. },
  1372. {
  1373. "columnName": "昵称",
  1374. "columnType": "text"
  1375. },
  1376. {
  1377. "columnName": "密码",
  1378. "columnType": "text"
  1379. },
  1380. {
  1381. "columnName": "_create",
  1382. "columnType": "bigint unsigned"
  1383. },
  1384. {
  1385. "columnName": "_update",
  1386. "columnType": "bigint unsigned"
  1387. }
  1388. ]
  1389. }
  1390. },
  1391. {
  1392. "id": "bCache_mZzh8THMJd",
  1393. "name": "用户登录信息缓存",
  1394. "type": "bCache",
  1395. "props": {
  1396. "devId": "bCache_mZzh8THMJd"
  1397. }
  1398. }
  1399. ]
  1400. }
  1401. ]
  1402. },
  1403. {
  1404. "id": "group_ZMjZ54ZwwS",
  1405. "name": "分类中台相关",
  1406. "type": "group",
  1407. "props": {
  1408. "devId": "group_ZMjZ54ZwwS"
  1409. },
  1410. "children": [
  1411. {
  1412. "id": "bComponent_DeYT3tRNET",
  1413. "name": "分类编辑后台组件",
  1414. "type": "bComponent",
  1415. "props": {
  1416. "devId": "bComponent_DeYT3tRNET",
  1417. "moduleId": "module_iCEhkHXdGz",
  1418. "dbConnect": [
  1419. {
  1420. "tempId": "dbTableTemp_nr37DhHs56",
  1421. "tableId": ""
  1422. }
  1423. ]
  1424. }
  1425. },
  1426. {
  1427. "id": "group_e25HaBcAA8",
  1428. "name": "api相关",
  1429. "type": "group",
  1430. "props": {
  1431. "devId": "group_e25HaBcAA8"
  1432. },
  1433. "children": [
  1434. {
  1435. "id": "service_E34TDiwH6m",
  1436. "name": "分类关键字搜索服务",
  1437. "type": "service",
  1438. "props": {
  1439. "devId": "service_E34TDiwH6m",
  1440. "isOpen": true,
  1441. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = {};\r\nif(param.hasOwnProperty('分类名称'))inParam['分类名称'] = param.分类名称;\r\nif(param.hasOwnProperty('上级分类ID'))inParam['上级分类ID'] = param.上级分类ID;\r\nif(param.hasOwnProperty('当前页码'))inParam['当前页码'] = param.当前页码;\r\nif(param.hasOwnProperty('每页大小'))inParam['每页大小'] = param.每页大小;\r\nif(param.hasOwnProperty('是否删除'))inParam['是否删除'] = param.是否删除;\r\n\r\nemitter.on('getList', ()=>{\r\n _F('bComponent_DeYT3tRNET').callMethod('service_zYN6Kpynpy',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getList');",
  1442. "inParams": [
  1443. "分类名称",
  1444. "上级分类ID",
  1445. "当前页码",
  1446. "每页大小",
  1447. "是否删除"
  1448. ],
  1449. "outParams": [],
  1450. "openApiPath": "v1/admin/point_class/search",
  1451. "inParamsDebug": {}
  1452. }
  1453. },
  1454. {
  1455. "id": "service_zz2Ha87iS4",
  1456. "name": "分类删除服务",
  1457. "type": "service",
  1458. "props": {
  1459. "devId": "service_zz2Ha87iS4",
  1460. "isOpen": true,
  1461. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = {};\r\nif(param.hasOwnProperty('分类ID'))inParam['分类ID'] = param.分类ID;\r\nif(param.hasOwnProperty('是否删除'))inParam['是否删除'] = param.是否删除 == 1?1:0;\r\n\r\nemitter.on('delDept', ()=>{\r\n _F('bComponent_DeYT3tRNET').callMethod('service_FHxSD7RYtT',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('delDept');",
  1462. "inParams": [
  1463. "分类ID",
  1464. "是否删除"
  1465. ],
  1466. "outParams": [],
  1467. "openApiPath": "v1/admin/point_class/del",
  1468. "inParamsDebug": {
  1469. "分类ID": "1",
  1470. "部门ID": "1",
  1471. "是否删除": "0",
  1472. "是否禁用": "0",
  1473. "部门名称": "多八多总部2",
  1474. "上级部门ID": "0"
  1475. }
  1476. }
  1477. },
  1478. {
  1479. "id": "service_BraRYbRnRY",
  1480. "name": "分类新增服务",
  1481. "type": "service",
  1482. "props": {
  1483. "devId": "service_BraRYbRnRY",
  1484. "isOpen": true,
  1485. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('appDept', ()=>{\r\n _F('bComponent_DeYT3tRNET').callMethod('service_jQ4AEAwPSy',{\r\n inParam:{\r\n 分类名称: param.分类名称,\r\n 上级分类ID: param.上级分类ID,\r\n },\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('appDept');",
  1486. "inParams": [
  1487. "分类名称",
  1488. "上级分类ID"
  1489. ],
  1490. "outParams": [],
  1491. "openApiPath": "v1/admin/point_class/add",
  1492. "inParamsDebug": {
  1493. "分类名称": "安全积分",
  1494. "部门名称": "多八多总部",
  1495. "上级分类ID": "0",
  1496. "上级部门ID": "0"
  1497. }
  1498. }
  1499. },
  1500. {
  1501. "id": "service_X85AxF2pZw",
  1502. "name": "分类编辑服务",
  1503. "type": "service",
  1504. "props": {
  1505. "devId": "service_X85AxF2pZw",
  1506. "isOpen": true,
  1507. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = param;\r\n\r\nemitter.on('editDept', ()=>{\r\n _F('bComponent_DeYT3tRNET').callMethod('service_cF6TRXP68X',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('editDept');",
  1508. "inParams": [
  1509. "分类ID",
  1510. "分类名称",
  1511. "上级分类ID",
  1512. "是否禁用",
  1513. "是否删除"
  1514. ],
  1515. "outParams": [],
  1516. "openApiPath": "v1/admin/point_class/edit",
  1517. "inParamsDebug": {
  1518. "分类ID": "1",
  1519. "部门ID": "1",
  1520. "分类名称": "临时积分",
  1521. "是否删除": "0",
  1522. "是否禁用": "0",
  1523. "部门名称": "多八多总部2",
  1524. "上级分类ID": "0",
  1525. "上级部门ID": "0"
  1526. }
  1527. }
  1528. }
  1529. ]
  1530. },
  1531. {
  1532. "id": "group_cfFd2CMdNz",
  1533. "name": "数据库相关",
  1534. "type": "group",
  1535. "props": {
  1536. "devId": "group_cfFd2CMdNz"
  1537. },
  1538. "children": [
  1539. {
  1540. "id": "dbTable_7FS4dn5YHj",
  1541. "name": "分类表",
  1542. "type": "dbTable",
  1543. "props": {
  1544. "devId": "dbTable_7FS4dn5YHj",
  1545. "fields": [
  1546. {
  1547. "columnName": "_id",
  1548. "columnType": "int unsigned"
  1549. },
  1550. {
  1551. "columnName": "分类名称",
  1552. "columnType": "text"
  1553. },
  1554. {
  1555. "columnName": "上级分类ID",
  1556. "columnType": "text"
  1557. },
  1558. {
  1559. "columnName": "是否禁用",
  1560. "columnType": "text"
  1561. },
  1562. {
  1563. "columnName": "是否删除",
  1564. "columnType": "text"
  1565. },
  1566. {
  1567. "columnName": "_create",
  1568. "columnType": "bigint unsigned"
  1569. },
  1570. {
  1571. "columnName": "_update",
  1572. "columnType": "bigint unsigned"
  1573. }
  1574. ]
  1575. }
  1576. }
  1577. ]
  1578. }
  1579. ]
  1580. },
  1581. {
  1582. "id": "group_7xHpR4TAk2",
  1583. "name": "广告中台相关",
  1584. "type": "group",
  1585. "props": {
  1586. "devId": "group_7xHpR4TAk2"
  1587. },
  1588. "children": [
  1589. {
  1590. "id": "bComponent_QPh7NtTCfp",
  1591. "name": "广告管理后台组件",
  1592. "type": "bComponent",
  1593. "props": {
  1594. "devId": "bComponent_QPh7NtTCfp",
  1595. "moduleId": "module_3GdzS7iAEJ",
  1596. "dbConnect": [
  1597. {
  1598. "tempId": "dbTableTemp_nr37DhHs56",
  1599. "tableId": "dbTable_kTF3TXAEEB"
  1600. },
  1601. {
  1602. "tempId": "dbTableTemp_DeEzJeMkjd",
  1603. "tableId": "dbTable_xSTwEQ32HH"
  1604. },
  1605. {
  1606. "tempId": "dbTableTemp_pTM2d2xs45",
  1607. "tableId": "dbTable_XdneF2SM7h"
  1608. },
  1609. {
  1610. "tempId": "dbTableTemp_Gf83SMhtNs",
  1611. "tableId": "dbTable_DywGDZA3mJ"
  1612. }
  1613. ]
  1614. }
  1615. },
  1616. {
  1617. "id": "group_fcC4GjwW2i",
  1618. "name": "小程序api相关",
  1619. "type": "group",
  1620. "props": {},
  1621. "children": [
  1622. {
  1623. "id": "service_4NACTMSGWk",
  1624. "name": "广告关键字搜索服务",
  1625. "type": "service",
  1626. "props": {
  1627. "devId": "service_4NACTMSGWk",
  1628. "isOpen": true,
  1629. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = param;\r\n\r\nemitter.on('getList', ()=>{\r\n _F('bComponent_QPh7NtTCfp').callMethod('service_nwS5JzCrxZ',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getList');",
  1630. "inParams": [
  1631. "搜索条件对象",
  1632. "当前页码",
  1633. "每页大小"
  1634. ],
  1635. "outParams": [],
  1636. "openApiPath": "v1/mini/user/ad/search",
  1637. "inParamsDebug": {
  1638. "批次号": "",
  1639. "当前页码": "",
  1640. "批次名称": "",
  1641. "是否删除": "",
  1642. "每页大小": ""
  1643. }
  1644. }
  1645. }
  1646. ]
  1647. },
  1648. {
  1649. "id": "group_nzrcQkRXFX",
  1650. "name": "管理后台api相关",
  1651. "type": "group",
  1652. "props": {
  1653. "devId": "group_nzrcQkRXFX"
  1654. },
  1655. "children": [
  1656. {
  1657. "id": "service_DG2zNxTXyD",
  1658. "name": "广告关键字搜索服务",
  1659. "type": "service",
  1660. "props": {
  1661. "devId": "service_DG2zNxTXyD",
  1662. "isOpen": true,
  1663. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = param;\r\n\r\nemitter.on('getList', ()=>{\r\n _F('bComponent_QPh7NtTCfp').callMethod('service_nwS5JzCrxZ',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getList');",
  1664. "inParams": [
  1665. "搜索条件对象",
  1666. "当前页码",
  1667. "每页大小"
  1668. ],
  1669. "outParams": [],
  1670. "openApiPath": "v1/admin/ad/search",
  1671. "inParamsDebug": {
  1672. "批次号": "",
  1673. "当前页码": "",
  1674. "批次名称": "",
  1675. "是否删除": "",
  1676. "每页大小": ""
  1677. }
  1678. }
  1679. },
  1680. {
  1681. "id": "service_D2SxEJ7Fkc",
  1682. "name": "角色删除服务",
  1683. "type": "service",
  1684. "props": {
  1685. "devId": "service_D2SxEJ7Fkc",
  1686. "isOpen": true,
  1687. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = {};\r\nif(param.hasOwnProperty('角色ID'))inParam['角色ID'] = param.角色ID;\r\nif(param.hasOwnProperty('是否删除'))inParam['是否删除'] = param.是否删除 == 1?1:0;\r\n\r\nemitter.on('delDept', ()=>{\r\n _F('bComponent_QPh7NtTCfp').callMethod('service_FHxSD7RYtT',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('delDept');",
  1688. "inParams": [
  1689. "角色ID",
  1690. "是否删除"
  1691. ],
  1692. "outParams": [],
  1693. "openApiPath": "v1/admin/role/del",
  1694. "inParamsDebug": {
  1695. "部门ID": "1",
  1696. "是否删除": "0",
  1697. "是否禁用": "0",
  1698. "部门名称": "多八多总部2",
  1699. "上级部门ID": "0"
  1700. }
  1701. }
  1702. },
  1703. {
  1704. "id": "service_tyKb8rdTk2",
  1705. "name": "广告编辑服务",
  1706. "type": "service",
  1707. "props": {
  1708. "devId": "service_tyKb8rdTk2",
  1709. "isOpen": true,
  1710. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = param;\r\n\r\nemitter.on('editDept', ()=>{\r\n _F('bComponent_QPh7NtTCfp').callMethod('service_MjCiFc8xna',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('editDept');",
  1711. "inParams": [
  1712. "广告ID",
  1713. "广告位ID",
  1714. "链接地址",
  1715. "图片地址"
  1716. ],
  1717. "outParams": [],
  1718. "openApiPath": "v1/admin/ad/edit",
  1719. "inParamsDebug": {
  1720. "广告ID": "",
  1721. "广告位ID": "",
  1722. "图片地址": "",
  1723. "链接地址": ""
  1724. }
  1725. }
  1726. },
  1727. {
  1728. "id": "service_mRpFsiidkY",
  1729. "name": "广告新增服务",
  1730. "type": "service",
  1731. "props": {
  1732. "devId": "service_mRpFsiidkY",
  1733. "isOpen": true,
  1734. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('appDept', ()=>{\r\n _F('bComponent_QPh7NtTCfp').callMethod('service_PeFDMcznnm',{\r\n inParam:param,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('appDept');\r\n",
  1735. "inParams": [
  1736. "广告位ID",
  1737. "链接地址",
  1738. "图片地址"
  1739. ],
  1740. "outParams": [],
  1741. "openApiPath": "v1/admin/ad/add",
  1742. "inParamsDebug": {
  1743. "广告位ID": "",
  1744. "图片地址": "",
  1745. "链接地址": ""
  1746. }
  1747. }
  1748. }
  1749. ]
  1750. },
  1751. {
  1752. "id": "group_x7daMiQxNQ",
  1753. "name": "数据表相关",
  1754. "type": "group",
  1755. "props": {},
  1756. "children": [
  1757. {
  1758. "id": "dbTable_DywGDZA3mJ",
  1759. "name": "广告表",
  1760. "type": "dbTable",
  1761. "props": {
  1762. "fields": [
  1763. {
  1764. "columnName": "_id",
  1765. "columnType": "int unsigned"
  1766. },
  1767. {
  1768. "columnName": "广告位ID",
  1769. "columnType": "int"
  1770. },
  1771. {
  1772. "columnName": "链接地址",
  1773. "columnType": "text"
  1774. },
  1775. {
  1776. "columnName": "图片地址",
  1777. "columnType": "text"
  1778. },
  1779. {
  1780. "columnName": "是否删除",
  1781. "columnType": "int"
  1782. },
  1783. {
  1784. "columnName": "_create",
  1785. "columnType": "bigint unsigned"
  1786. },
  1787. {
  1788. "columnName": "_update",
  1789. "columnType": "bigint unsigned"
  1790. }
  1791. ]
  1792. }
  1793. }
  1794. ]
  1795. }
  1796. ]
  1797. }
  1798. ]
  1799. },
  1800. {
  1801. "id": "group_zjbGj4Qi2c",
  1802. "name": "用户相关",
  1803. "type": "group",
  1804. "props": {},
  1805. "children": [
  1806. {
  1807. "id": "bComponent_3QDpwPzfJh",
  1808. "name": "用户中台组件",
  1809. "type": "bComponent",
  1810. "props": {
  1811. "moduleId": "module_Rn2saN62Y8",
  1812. "dbConnect": [
  1813. {
  1814. "tempId": "dbTableTemp_6xG6thEJQS",
  1815. "tableId": "dbTable_54DZwzihAy"
  1816. }
  1817. ],
  1818. "bCacheConnect": [
  1819. {
  1820. "tempId": "bCacheTemp_wJfaNQwj3d",
  1821. "bCacheId": "bCache_E43WZB3276"
  1822. }
  1823. ]
  1824. }
  1825. },
  1826. {
  1827. "id": "group_8TSZCyFfPd",
  1828. "name": "小程序api",
  1829. "type": "group",
  1830. "props": {},
  1831. "children": [
  1832. {
  1833. "id": "service_2xday3FbFe",
  1834. "name": "用户openid密码注册及登录",
  1835. "type": "service",
  1836. "props": {
  1837. "devId": "service_2xday3FbFe",
  1838. "isOpen": false,
  1839. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(用户名==用户名)\r\nconst emitter = new events.EventEmitter(); \r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('bComponent_3QDpwPzfJh').callMethod('service_DTz27rE4GR',{\r\n inParam:param,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getUserInfo');",
  1840. "inParams": [
  1841. "openid",
  1842. "密码"
  1843. ],
  1844. "outParams": [
  1845. "code",
  1846. "errMsg",
  1847. "result"
  1848. ],
  1849. "openApiPath": "service_2xday3FbFe",
  1850. "inParamsDebug": {
  1851. "openid": "oPC5r5bZArKsVFeH4I7fO1p1y4yk",
  1852. "姓名": "超级管理员",
  1853. "密码": "123123",
  1854. "用户名": "超级管理员"
  1855. }
  1856. }
  1857. },
  1858. {
  1859. "id": "service_kp2PEdfefX",
  1860. "name": "openid登录",
  1861. "type": "service",
  1862. "props": {
  1863. "devId": "service_kp2PEdfefX",
  1864. "isOpen": false,
  1865. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(用户名==用户名)\r\nconst emitter = new events.EventEmitter(); \r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('bComponent_3QDpwPzfJh').callMethod('service_edcBYDzKcE',{\r\n inParam:{\r\n openid: param.openid,\r\n\t\t\t\t使用cookie:param.使用cookie==false?0:1,\r\n\t\t\t\tcookie域名:param.cookie域名,\r\n 登录有效时长:3600 * 24 * 10,\r\n\t\t\t\t允许多端登录:1,\r\n },\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getUserInfo');",
  1866. "inParams": [
  1867. "openid",
  1868. "cookie域名",
  1869. "使用cookie"
  1870. ],
  1871. "outParams": [
  1872. "code",
  1873. "errMsg",
  1874. "result"
  1875. ],
  1876. "openApiPath": "service_kp2PEdfefX",
  1877. "inParamsDebug": {
  1878. "openid": "oPC5r5bZArKsVFeH4I7fO1p1y4yk",
  1879. "密码": "123123",
  1880. "用户名": "13800138000",
  1881. "cookie域名": ".devstudio.aliyuncs.com",
  1882. "使用cookie": "0"
  1883. }
  1884. }
  1885. },
  1886. {
  1887. "id": "service_Ym7XyfYNkf",
  1888. "name": "获取用户登录信息",
  1889. "type": "service",
  1890. "props": {
  1891. "devId": "service_Ym7XyfYNkf",
  1892. "isOpen": true,
  1893. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(用户名==用户名)\r\nconst emitter = new events.EventEmitter(); \r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('bComponent_3QDpwPzfJh').callMethod('service_8rNTjXTpbf',{\r\n inParam:{\r\n token: param.token,\r\n },\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getUserInfo');",
  1894. "inParams": [
  1895. "token"
  1896. ],
  1897. "outParams": [
  1898. "code",
  1899. "errMsg",
  1900. "result"
  1901. ],
  1902. "openApiPath": "v1/mini/logined/info",
  1903. "inParamsDebug": {
  1904. "token": "HBINJdWdXUoszV46BES0tdcWJD2Gru17"
  1905. }
  1906. }
  1907. },
  1908. {
  1909. "id": "service_nkWQS65mJQ",
  1910. "name": "更新用户手机号",
  1911. "type": "service",
  1912. "props": {
  1913. "devId": "service_nkWQS65mJQ",
  1914. "isOpen": false,
  1915. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(用户名==用户名)\r\nconst emitter = new events.EventEmitter(); \r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('bComponent_3QDpwPzfJh').callMethod('service_amBQpHZ56h',{\r\n inParam:param,\r\n callback:(data)=>{\r\n //_funcCb(data);\r\n emitter.emit('mobileLogin');\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.on('mobileLogin', () => {\r\n _F('service_wS7EfNXKyH').call({ 手机号:param.手机号 }, (data) => {\r\n _funcCb(data);\r\n });\r\n});\r\n\r\nemitter.emit('getUserInfo');",
  1916. "inParams": [
  1917. "用户ID",
  1918. "手机号"
  1919. ],
  1920. "outParams": [
  1921. "code",
  1922. "errMsg",
  1923. "result"
  1924. ],
  1925. "openApiPath": "service_nkWQS65mJQ",
  1926. "inParamsDebug": {
  1927. "用户ID": "1",
  1928. "手机号": "13900139000"
  1929. }
  1930. }
  1931. },
  1932. {
  1933. "id": "service_wS7EfNXKyH",
  1934. "name": "手机号登录",
  1935. "type": "service",
  1936. "props": {
  1937. "devId": "service_wS7EfNXKyH",
  1938. "isOpen": false,
  1939. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(用户名==用户名)\r\nconst emitter = new events.EventEmitter(); \r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('bComponent_3QDpwPzfJh').callMethod('service_c2SDBJeYBs',{\r\n inParam:{\r\n 手机号: param.手机号,\r\n\t\t\t\t使用cookie:0,\r\n\t\t\t\tcookie域名:param.cookie域名,\r\n 登录有效时长:3600 * 24 * 10,\r\n\t\t\t\t允许多端登录:0,\r\n },\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getUserInfo');",
  1940. "inParams": [
  1941. "手机号",
  1942. "cookie域名",
  1943. "使用cookie"
  1944. ],
  1945. "outParams": [
  1946. "code",
  1947. "errMsg",
  1948. "result"
  1949. ],
  1950. "openApiPath": "service_wS7EfNXKyH",
  1951. "inParamsDebug": {
  1952. "openid": "oPC5r5bZArKsVFeH4I7fO1p1y4yk",
  1953. "密码": "123123",
  1954. "用户名": "13800138000",
  1955. "cookie域名": ".devstudio.aliyuncs.com",
  1956. "使用cookie": "0"
  1957. }
  1958. }
  1959. }
  1960. ]
  1961. },
  1962. {
  1963. "id": "group_TPtW7z3Xbn",
  1964. "name": "数据表",
  1965. "type": "group",
  1966. "props": {},
  1967. "children": [
  1968. {
  1969. "id": "bCache_E43WZB3276",
  1970. "name": "用户登录信息缓存",
  1971. "type": "bCache",
  1972. "props": {}
  1973. },
  1974. {
  1975. "id": "dbTable_54DZwzihAy",
  1976. "name": "用户表",
  1977. "type": "dbTable",
  1978. "props": {
  1979. "fields": [
  1980. {
  1981. "columnName": "_id",
  1982. "columnType": "int unsigned"
  1983. },
  1984. {
  1985. "columnName": "用户名",
  1986. "columnType": "text"
  1987. },
  1988. {
  1989. "columnName": "手机号",
  1990. "columnType": "text"
  1991. },
  1992. {
  1993. "columnName": "openid",
  1994. "columnType": "text"
  1995. },
  1996. {
  1997. "columnName": "昵称",
  1998. "columnType": "text"
  1999. },
  2000. {
  2001. "columnName": "密码",
  2002. "columnType": "text"
  2003. },
  2004. {
  2005. "columnName": "_create",
  2006. "columnType": "bigint unsigned"
  2007. },
  2008. {
  2009. "columnName": "_update",
  2010. "columnType": "bigint unsigned"
  2011. }
  2012. ]
  2013. }
  2014. }
  2015. ]
  2016. }
  2017. ]
  2018. },
  2019. {
  2020. "id": "group_yrdDCNCXHZ",
  2021. "name": "微信小程序相关",
  2022. "type": "group",
  2023. "props": {
  2024. "devId": "group_yrdDCNCXHZ"
  2025. },
  2026. "children": [
  2027. {
  2028. "id": "bComponent_3XnF6CPCPb",
  2029. "name": "微信小程序后台服务组件",
  2030. "type": "bComponent",
  2031. "props": {
  2032. "attr": [
  2033. {
  2034. "attrId": "variable_hQPh5XXb7r",
  2035. "attrType": "string",
  2036. "attrValue": "wxfea9bdc8104eede9",
  2037. "attrJsCode": ""
  2038. },
  2039. {
  2040. "attrId": "variable_FS858Nw8zp",
  2041. "attrType": "string",
  2042. "attrValue": "a397f38085dad044f1309921e0ea3d3c",
  2043. "attrJsCode": ""
  2044. },
  2045. {
  2046. "attrId": "variable_rdHsEMsaxT",
  2047. "attrType": "string",
  2048. "attrValue": "a397f38085dad044f1309921e0ea3d3c",
  2049. "attrJsCode": ""
  2050. },
  2051. {
  2052. "attrId": "variable_PW6x3zcJxP",
  2053. "attrType": "string",
  2054. "attrValue": "wxfea9bdc8104eede9",
  2055. "attrJsCode": ""
  2056. },
  2057. {
  2058. "attrId": "variable_f2dzhTjDPA",
  2059. "attrType": "string",
  2060. "attrValue": "a397f38085dad044f1309921e0ea3d3c",
  2061. "attrJsCode": ""
  2062. },
  2063. {
  2064. "attrId": "variable_y3XJtNPm74",
  2065. "attrType": "string",
  2066. "attrValue": "wxfea9bdc8104eede9",
  2067. "attrJsCode": ""
  2068. }
  2069. ],
  2070. "devId": "bComponent_3XnF6CPCPb",
  2071. "moduleId": "module_Pj3CGzPFxA",
  2072. "bCacheConnect": [
  2073. {
  2074. "tempId": "bCacheTemp_i326Wbnmrd",
  2075. "bCacheId": "bCache_2kyhtca3jC"
  2076. },
  2077. {
  2078. "tempId": "bCacheTemp_ij3SB8mrTY",
  2079. "bCacheId": "bCache_2kyhtca3jC"
  2080. },
  2081. {
  2082. "tempId": "bCacheTemp_QcXEkT3pzc",
  2083. "bCacheId": "bCache_2kyhtca3jC"
  2084. }
  2085. ]
  2086. }
  2087. },
  2088. {
  2089. "id": "group_eh8tpZxmZc",
  2090. "name": "缓存相关",
  2091. "type": "group",
  2092. "props": {
  2093. "devId": "group_eh8tpZxmZc"
  2094. },
  2095. "children": [
  2096. {
  2097. "id": "bCache_2kyhtca3jC",
  2098. "name": "accessToken缓存",
  2099. "type": "bCache",
  2100. "props": {
  2101. "devId": "bCache_2kyhtca3jC"
  2102. }
  2103. }
  2104. ]
  2105. },
  2106. {
  2107. "id": "group_z25ayMZw33",
  2108. "name": "前台api",
  2109. "type": "group",
  2110. "props": {
  2111. "devId": "group_z25ayMZw33"
  2112. },
  2113. "children": [
  2114. {
  2115. "id": "service_sCwn6DRDGK",
  2116. "name": "获取accessToken服务",
  2117. "type": "service",
  2118. "props": {
  2119. "devId": "service_sCwn6DRDGK",
  2120. "isOpen": true,
  2121. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(用户名==用户名)\r\nconst emitter = new events.EventEmitter(); \r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('bComponent_3XnF6CPCPb').callMethod('service_x42XREiaWn',{\r\n inParam:{\r\n },\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getUserInfo');",
  2122. "inParams": [],
  2123. "outParams": [
  2124. "code",
  2125. "errMsg",
  2126. "result"
  2127. ],
  2128. "openApiPath": "v1/mp/accessToken/get",
  2129. "inParamsDebug": {
  2130. "token": "zrlHaNgH4nMb9HXk2XlJtGv4aBRQ3hrw"
  2131. }
  2132. }
  2133. },
  2134. {
  2135. "id": "service_7He7S6Fk2H",
  2136. "name": "授权code获取用户信息服务",
  2137. "type": "service",
  2138. "props": {
  2139. "devId": "service_7He7S6Fk2H",
  2140. "isOpen": true,
  2141. "jsCode": "const emitter = new events.EventEmitter();\r\n\r\nemitter.on('getUserInfo', () => {\r\n _F('bComponent_3XnF6CPCPb').callMethod('service_ffMzCYBtWN', {\r\n inParam: param,\r\n callback: (data) => {\r\n //_funcCb(data);\r\n //{\"code\":200,\"errMsg\":\"ok\",\"result\":{\"session_key\":\"VExp4nwNepCObV6ZPJlTsA==\",\"openid\":\"oPC5r5bZArKsVFeH4I7fO1p1y4yk\",\"unionid\":\"omirgwqtCDxC86lIzhTT-hilzdRg\"}}\r\n if(data.code === 200){\r\n emitter.emit('openidLogin',data.result.openid);\r\n }else{\r\n _funcCb(data);\r\n }\r\n \r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.on('openidLogin', (openid) => {\r\n _F('service_2xday3FbFe').call({ openid,密码:'123123' }, (data) => {\r\n _funcCb(data);\r\n });\r\n});\r\n\r\nif (param.code === '0e3taN000kdktQ1ACf400pOFkc2taN0p') {\r\n emitter.emit('openidLogin', 'oPC5r5bZArKsVFeH4I7fO1p1y4yk');\r\n} else {\r\n emitter.emit('getUserInfo');\r\n}",
  2142. "inParams": [
  2143. "code"
  2144. ],
  2145. "outParams": [
  2146. "code",
  2147. "errMsg",
  2148. "result"
  2149. ],
  2150. "openApiPath": "v1/mp/user_session_key/get",
  2151. "inParamsDebug": {
  2152. "code": "0f3XwN100wIF8Q1rIU100R4jaC4XwN1W",
  2153. "token": "zrlHaNgH4nMb9HXk2XlJtGv4aBRQ3hrw"
  2154. }
  2155. }
  2156. },
  2157. {
  2158. "id": "service_wGCW8CDH45",
  2159. "name": "通过 access_token 和 openid 获取用户信息服务",
  2160. "type": "service",
  2161. "props": {
  2162. "devId": "service_wGCW8CDH45",
  2163. "isOpen": true,
  2164. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('bComponent_3XnF6CPCPb').callMethod('service_SRpWwwnwb7',{\r\n inParam:param,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getUserInfo');",
  2165. "inParams": [
  2166. "access_token",
  2167. "openid"
  2168. ],
  2169. "outParams": [
  2170. "code",
  2171. "errMsg",
  2172. "result"
  2173. ],
  2174. "openApiPath": "v1/mp/userInfo/get",
  2175. "inParamsDebug": {
  2176. "code": "011dvB1w3vIbq03REA3w3kfT4N3dvB1v",
  2177. "token": "zrlHaNgH4nMb9HXk2XlJtGv4aBRQ3hrw",
  2178. "openid": "o2B665mTctpylJVEB1FgdmM9wW6M",
  2179. "access_token": "67_3tjQFT5aIjf_MKYiQzZ3pXXNNKGq3Bb46K82fZ_C80SpzP0Y23juCa4KQW4uY4pvKFTSibyAvcLJORgWGVScJ6-LQKEVcyxJ1b4f0WLdF5g"
  2180. }
  2181. }
  2182. },
  2183. {
  2184. "id": "service_CABr63B7C5",
  2185. "name": "通过 access_token 和 code 获取用户手机号服务",
  2186. "type": "service",
  2187. "props": {
  2188. "devId": "service_CABr63B7C5",
  2189. "isOpen": true,
  2190. "jsCode": "const emitter = new events.EventEmitter();\r\nconst USER_INFO = _F('middle_func').callMethod('last');\r\n\r\nemitter.on('getMobile', () => {\r\n _F('bComponent_3XnF6CPCPb').callMethod('service_d8m3KpwS7X', {\r\n inParam: param,\r\n callback: (data) => {\r\n emitter.emit('updateMobile', data);\r\n //_funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.on('updateMobile', (data) => {\r\n\r\n /* {\r\n \"code\": 200,\r\n \"errMsg\": \"ok\",\r\n \"result\": {\r\n \"phoneNumber\": \"xxxxxx\",\r\n \"purePhoneNumber\": \"xxxxxx\",\r\n \"countryCode\": 86,\r\n \"watermark\": {\r\n \"timestamp\": 1637744274,\r\n \"appid\": \"xxxx\"\r\n }\r\n }\r\n } */\r\n if (data.code === 200) {\r\n const phoneNumber = data.result.phoneNumber;\r\n _F('service_nkWQS65mJQ').call({ 用户ID: USER_INFO._id, 手机号: phoneNumber }, (data) => {\r\n _funcCb(data);\r\n });\r\n } else {\r\n _funcCb(data);\r\n }\r\n});\r\n\r\nemitter.emit('getMobile');",
  2191. "inParams": [
  2192. "code",
  2193. "access_token"
  2194. ],
  2195. "outParams": [
  2196. "code",
  2197. "errMsg",
  2198. "result"
  2199. ],
  2200. "openApiPath": "v1/mini/user/mobile/get",
  2201. "inParamsDebug": {
  2202. "code": "011dvB1w3vIbq03REA3w3kfT4N3dvB1v",
  2203. "access_token": ""
  2204. }
  2205. }
  2206. }
  2207. ]
  2208. }
  2209. ]
  2210. },
  2211. {
  2212. "id": "group_5dc6xxFH3Z",
  2213. "name": "发券小程序相关",
  2214. "type": "group",
  2215. "props": {},
  2216. "children": [
  2217. {
  2218. "id": "group_irHRC3jS5y",
  2219. "name": "领券日志后台通用",
  2220. "type": "group",
  2221. "props": {
  2222. "devId": "group_irHRC3jS5y"
  2223. },
  2224. "children": [
  2225. {
  2226. "id": "bComponent_jC2BPFSDrf",
  2227. "name": "领券日志后台组件",
  2228. "type": "bComponent",
  2229. "props": {
  2230. "attr": [
  2231. {
  2232. "attrId": "variable_QcWhAZe56c",
  2233. "attrType": "js",
  2234. "attrJsCode": "[\r\n {\r\n \"dataIndex\": \"兑换码\",\r\n \"operate\": \"search|filter|add\",\r\n },\r\n {\r\n \"dataIndex\": \"批次分类名称\",\r\n \"operate\": \"search|filter|add\",\r\n },\r\n {\r\n \"dataIndex\": \"批次名称\",\r\n \"operate\": \"search|filter|add\",\r\n },\r\n {\r\n \"dataIndex\": \"批次号\",\r\n \"operate\": \"search|filter|add\",\r\n },\r\n]"
  2235. }
  2236. ],
  2237. "moduleId": "module_remk87B6S2",
  2238. "dbConnect": [
  2239. {
  2240. "tempId": "dbTableTemp_xiMSY5yJNc",
  2241. "tableId": "dbTable_8kcPFkQWna"
  2242. },
  2243. {
  2244. "tempId": "dbViewTemp_wfrWwAbZJe",
  2245. "tableId": "dbView_hCk5mDhapb"
  2246. }
  2247. ],
  2248. "bCacheConnect": []
  2249. }
  2250. },
  2251. {
  2252. "id": "group_hz47PJxmdc",
  2253. "name": "管理后台api相关",
  2254. "type": "group",
  2255. "props": {
  2256. "devId": "group_hz47PJxmdc"
  2257. },
  2258. "children": [
  2259. {
  2260. "id": "service_esnaP2CWPh",
  2261. "name": "领券日志关键字搜索服务",
  2262. "type": "service",
  2263. "props": {
  2264. "devId": "service_esnaP2CWPh",
  2265. "isOpen": true,
  2266. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = param;\r\n\r\nemitter.on('getList', ()=>{\r\n _F('bComponent_jC2BPFSDrf').callMethod('service_HnxkCD6Ys7',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getList');",
  2267. "inParams": [
  2268. {
  2269. "name": "搜索条件对象",
  2270. "default": null
  2271. },
  2272. {
  2273. "name": "当前页码",
  2274. "default": ""
  2275. },
  2276. {
  2277. "name": "每页大小",
  2278. "default": ""
  2279. }
  2280. ],
  2281. "babelCode": "const emitter = new events.EventEmitter();\nlet inParam = param;\nemitter.on('getList', () => {\n _F('bComponent_jC2BPFSDrf').callMethod('service_HnxkCD6Ys7', {\n inParam,\n callback: data => {\n _funcCb(data);\n }\n });\n});\nemitter.emit('getList');",
  2282. "outParams": [],
  2283. "openApiPath": "v1/admin/stock_log/search"
  2284. }
  2285. }
  2286. ]
  2287. }
  2288. ]
  2289. },
  2290. {
  2291. "id": "group_cEwpRePMaE",
  2292. "name": "领券服务",
  2293. "type": "group",
  2294. "props": {},
  2295. "children": [
  2296. {
  2297. "id": "service_bTTHWhKCNi",
  2298. "name": "活动批次领券服务",
  2299. "type": "service",
  2300. "props": {
  2301. "devId": "service_bTTHWhKCNi",
  2302. "isOpen": true,
  2303. "jsCode": "const emitter = new events.EventEmitter();\r\nconst USER_INFO = _F('middle_func').callMethod('last');\r\n\r\nif (!param.hasOwnProperty('批次号')) {\r\n _funcCb({ code: 0, errMsg: '请传入批次号', result: {} });\r\n return;\r\n}\r\n\r\nlet 批次对象 = {};\r\nlet 批次分类对象 = {};\r\n\r\nemitter.on('checkReqLimit', async () => {\r\n const reqRes = await _F('service_7Xb7XyFRTb').call({\r\n \"请求控制秒数\": 15,\r\n \"控制服务标识\": \"service_bTTHWhKCNi\",\r\n \"用户ID\": USER_INFO._id\r\n });\r\n\r\n if (reqRes.code === 200) emitter.emit('getStock');\r\n else _funcCb(reqRes);\r\n})\r\n\r\nemitter.on('getStock', async () => {\r\n const reqRes = await _F('service_4e5RspbZSR').call({\r\n \"搜索条件\": { 批次号: param.批次号 }\r\n });\r\n\r\n if (reqRes.code === 200) {\r\n 批次对象 = reqRes.result;\r\n emitter.emit('getStockCate');\r\n }\r\n else _funcCb(reqRes);\r\n\r\n});\r\n\r\nemitter.on('getStockCate', async () => {\r\n const { 批次分类ID } = 批次对象;\r\n const reqRes = await _F('service_FMa6CiY2fs').call({\r\n \"搜索条件\": { 批次分类ID }\r\n });\r\n\r\n if (reqRes.code === 200) {\r\n 批次分类对象 = reqRes.result;\r\n emitter.emit('getStockLogCount');\r\n }\r\n else _funcCb(reqRes);\r\n\r\n});\r\n\r\nemitter.on('getStockLogCount', async () => {\r\n const {最大领取次数} = 批次分类对象;\r\n if (最大领取次数 > 0) {\r\n\r\n const inParam = {\r\n 搜索条件: {\r\n 批次分类ID: param.批次分类ID,\r\n 用户ID: USER_INFO._id,\r\n 领取结果: 1\r\n },\r\n 当前页码: 1,\r\n 每页大小: 最大领取次数,\r\n };\r\n const logRes = await _F('bComponent_tPxP4ADSGy').callMethod('service_AcidSxppYx', { inParam });\r\n\r\n console.log('getStockLogCount',logRes);\r\n \r\n if (logRes.code === 200) {\r\n if (Array.isArray(logRes.result) && logRes.result.length >= 最大领取次数) {\r\n _funcCb({ code: 0, errMsg: '已领取', result: logRes.result });\r\n } else {\r\n emitter.emit('getCoupon');\r\n }\r\n } else {\r\n _funcCb(logRes);\r\n }\r\n\r\n } else {\r\n emitter.emit('getCoupon');\r\n }\r\n\r\n});\r\n\r\n\r\nemitter.on('getCoupon', async () => {\r\n const { 批次号, 制券商户号 } = 批次对象;\r\n const inParam = {\r\n openid: USER_INFO.openid,\r\n // openid: 'oP-y45xbf7hrhC6yeabpjXzIhUWg',\r\n stock_id: 批次号,\r\n out_request_no: Math.floor(new Date()).toString(),\r\n stock_creator_mchid: 制券商户号,\r\n };\r\n const signRes = await _F('bComponent_67ky8TZdD7').callMethod('service_FFZCEpzHrA', { inParam });\r\n emitter.emit('appLog', signRes);\r\n});\r\n\r\nfunction getActivityStatus(失败原因) {\r\n const currentHour = new Date().getUTCHours();\r\n const currentMinute = new Date().getUTCMinutes();\r\n\r\n console.log('currentHour', currentHour, currentHour + 8, currentMinute);\r\n\r\n if (失败原因 === '批次预算耗尽') {\r\n // if (currentHour + 8 < 18 || (currentHour + 8 === 18 && currentMinute < 10)) {\r\n // return '活动未开始';\r\n // } else {\r\n // return '抢光了';\r\n // }\r\n return '抢光了';\r\n } else if (失败原因 === '用户已达最大领券次数') {\r\n return '已领取';\r\n } else {\r\n return '活动未开始或抢光了';\r\n }\r\n}\r\n\r\nemitter.on('appLog', async (getRes) => {\r\n try {\r\n getRes = JSON.parse(getRes);\r\n } catch (e) {\r\n getRes = {};\r\n }\r\n console.log('appLog.getRes', getRes, typeof getRes);\r\n const { 批次号, 批次分类ID } = 批次对象;\r\n const inParam = {\r\n 批次号,\r\n 用户ID: USER_INFO._id,\r\n 批次分类ID,\r\n // \"券ID\": \"\",\r\n // \"失败原因\": \"\",\r\n }\r\n if (getRes.coupon_id) {\r\n inParam.券ID = getRes.coupon_id;\r\n inParam.领取结果 = 1;\r\n } else {\r\n inParam.领取结果 = 0;\r\n inParam.失败原因 = getRes.message || '';\r\n }\r\n\r\n const reqRes = await _F('service_7XsamdHEpE').call(inParam);\r\n\r\n if (inParam.领取结果 === 1) {\r\n _funcCb({ code: 200, errMsg: '领取成功', result: {} });\r\n } else {\r\n const 显示失败原因 = getActivityStatus(inParam.失败原因);\r\n\r\n _funcCb({ code: 0, errMsg: 显示失败原因, result: inParam.失败原因 });\r\n }\r\n});\r\n\r\nemitter.emit('checkReqLimit');\r\n\r\n",
  2304. "inParams": [
  2305. {
  2306. "name": "批次号",
  2307. "default": "17615961"
  2308. }
  2309. ],
  2310. "outParams": [],
  2311. "openApiPath": "v1/mini/user/stock/cate_get"
  2312. }
  2313. },
  2314. {
  2315. "id": "service_YbfbZ477tr",
  2316. "name": "单批次领券服务",
  2317. "type": "service",
  2318. "props": {
  2319. "devId": "service_YbfbZ477tr",
  2320. "isOpen": true,
  2321. "jsCode": "const emitter = new events.EventEmitter();\r\nconst USER_INFO = _F('middle_func').callMethod('last');\r\n\r\nif (!param.hasOwnProperty('批次号')) {\r\n _funcCb({ code: 0, errMsg: '请传入批次号', result: {} });\r\n return;\r\n}\r\n\r\nlet 批次对象 = {};\r\n\r\nemitter.on('checkReqLimit', async () => {\r\n const reqRes = await _F('service_7Xb7XyFRTb').call({\r\n \"请求控制秒数\": 15,\r\n \"控制服务标识\": \"service_YbfbZ477tr\",\r\n \"用户ID\": USER_INFO._id\r\n });\r\n\r\n if (reqRes.code === 200) emitter.emit('getStock');\r\n else _funcCb(reqRes);\r\n})\r\n\r\nemitter.on('getStock', async () => {\r\n const reqRes = await _F('service_4e5RspbZSR').call({\r\n \"搜索条件\": {批次号:param.批次号}\r\n });\r\n\r\n if (reqRes.code === 200) {\r\n 批次对象 = reqRes.result;\r\n emitter.emit('getCoupon');\r\n }\r\n else _funcCb(reqRes);\r\n\r\n});\r\n\r\n\r\nemitter.on('getCoupon', async () => {\r\n const { 批次号, 制券商户号 } = 批次对象;\r\n const inParam = {\r\n openid: USER_INFO.openid,\r\n // openid: 'oP-y45xbf7hrhC6yeabpjXzIhUWg',\r\n stock_id: 批次号,\r\n out_request_no: Math.floor(new Date()).toString(),\r\n stock_creator_mchid: 制券商户号,\r\n };\r\n const signRes = await _F('bComponent_67ky8TZdD7').callMethod('service_FFZCEpzHrA', { inParam });\r\n emitter.emit('appLog', signRes);\r\n});\r\n\r\nfunction getActivityStatus(失败原因) {\r\n const currentHour = new Date().getUTCHours();\r\n const currentMinute = new Date().getUTCMinutes();\r\n\r\n console.log('currentHour', currentHour, currentHour + 8, currentMinute);\r\n\r\n if (失败原因 === '批次预算耗尽') {\r\n // if (currentHour + 8 < 18 || (currentHour + 8 === 18 && currentMinute < 10)) {\r\n // return '活动未开始';\r\n // } else {\r\n // return '抢光了';\r\n // }\r\n return '抢光了';\r\n } else if (失败原因 === '用户已达最大领券次数') {\r\n return '已领取';\r\n } else {\r\n return '活动未开始或抢光了';\r\n }\r\n}\r\n\r\nemitter.on('appLog', async (getRes) => {\r\n try {\r\n getRes = JSON.parse(getRes);\r\n } catch (e) {\r\n getRes = {};\r\n }\r\n console.log('appLog.getRes', getRes, typeof getRes);\r\n const { 批次号, 批次分类ID } = 批次对象;\r\n const inParam = {\r\n 批次号,\r\n 用户ID: USER_INFO._id,\r\n 批次分类ID,\r\n // \"券ID\": \"\",\r\n // \"失败原因\": \"\",\r\n }\r\n if (getRes.coupon_id) {\r\n inParam.券ID = getRes.coupon_id;\r\n inParam.领取结果 = 1;\r\n } else {\r\n inParam.领取结果 = 0;\r\n inParam.失败原因 = getRes.message || '';\r\n }\r\n \r\n const reqRes = await _F('service_7XsamdHEpE').call(inParam);\r\n\r\n if (inParam.领取结果 === 1) {\r\n _funcCb({ code: 200, errMsg: '领取成功', result: {} });\r\n } else {\r\n const 显示失败原因 = getActivityStatus(inParam.失败原因);\r\n\r\n _funcCb({ code: 0, errMsg: 显示失败原因, result: inParam.失败原因 });\r\n }\r\n});\r\n\r\nemitter.emit('checkReqLimit');\r\n\r\n",
  2322. "inParams": [
  2323. {
  2324. "name": "批次号",
  2325. "default": "17615961"
  2326. }
  2327. ],
  2328. "outParams": [],
  2329. "openApiPath": "v1/mini/user/stock/single_get"
  2330. }
  2331. },
  2332. {
  2333. "id": "service_XfHAfxafTt",
  2334. "name": "兑换码领券服务",
  2335. "type": "service",
  2336. "props": {
  2337. "devId": "service_XfHAfxafTt",
  2338. "isOpen": true,
  2339. "jsCode": "// const emitter = new events.EventEmitter();\r\n// const USER_INFO = _F('middle_func').callMethod('last');\r\n\r\n// if (!param.hasOwnProperty('兑换码')) {\r\n// _funcCb({ code: 0, errMsg: '请传入兑换码', result: {} });\r\n// return;\r\n// }\r\n\r\n// let 批次对象 = {};\r\n\r\n// //检查有效期\r\n// emitter.on('checkValidDate', () => {\r\n// if (批次对象.有效期) {\r\n// const 当前时间 = Date.now() / 1000;\r\n// if (批次对象.有效期 < 当前时间) {\r\n// _funcCb({ code: 0, errMsg: '兑换码已过期' });\r\n// return;\r\n// }\r\n// }\r\n// else if (批次对象.是否删除) {\r\n// _funcCb({ code: 0, errMsg: '兑换码已删除' });\r\n// return;\r\n// }\r\n\r\n// emitter.emit('getStockLogCount');\r\n// })\r\n\r\n// emitter.on('checkReqLimit', async () => {\r\n// const reqRes = await _F('service_7Xb7XyFRTb').call({\r\n// \"请求控制秒数\": 15,\r\n// \"控制服务标识\": \"service_XfHAfxafTt\",\r\n// \"用户ID\": USER_INFO._id\r\n// });\r\n\r\n// if (reqRes.code === 200) emitter.emit('getStock');\r\n// else _funcCb(reqRes);\r\n// })\r\n\r\n// emitter.on('getStock', async () => {\r\n// const reqRes = await _F('service_kzW2y2e246').call({\r\n// \"搜索条件\": { 兑换码: param.兑换码 }\r\n// });\r\n\r\n// if (reqRes.code === 200) {\r\n// 批次对象 = reqRes.result;\r\n// emitter.emit('checkValidDate');\r\n// }\r\n// else _funcCb(reqRes);\r\n\r\n// });\r\n\r\n// emitter.on('exchangeDone', () => {\r\n// const { _id: 行ID } = 批次对象;\r\n// const inParam = {\r\n// 行ID,\r\n// 兑换状态: 1\r\n// }\r\n// console.log('exchangeDoneInParam', inParam)\r\n\r\n// _F('bComponent_7aiWDzEFX5').callMethod('service_SmQXCDGN2Z', {\r\n// inParam,\r\n// callback: (data) => {\r\n// // _funcCb(data);\r\n// console.log('exchangeDoneResult', data)\r\n// }\r\n// });\r\n// });\r\n\r\n\r\n// emitter.on('getStockLogCount', async () => {\r\n// const { _id: 兑换码ID, 兑换状态 } = 批次对象;\r\n// if (兑换状态 === 0) {\r\n// const 最大领取次数 = 1;\r\n// const inParam = {\r\n// 搜索条件: {\r\n// 兑换码ID,\r\n// // 用户ID: USER_INFO._id,\r\n// 领取结果: 1\r\n// },\r\n// 当前页码: 1,\r\n// 每页大小: 最大领取次数,\r\n// };\r\n// const logRes = await _F('bComponent_tPxP4ADSGy').callMethod('service_AcidSxppYx', { inParam });\r\n\r\n// console.log('getStockLogCount', logRes);\r\n\r\n// if (logRes.code === 200) {\r\n// if (Array.isArray(logRes.result) && logRes.result.length >= 最大领取次数) {\r\n// _funcCb({ code: 0, errMsg: '已领取', result: logRes.result });\r\n// } else {\r\n// emitter.emit('getCoupon');\r\n// }\r\n// } else {\r\n// _funcCb(logRes);\r\n// }\r\n\r\n// } else {\r\n// _funcCb({ code: 0, errMsg: '已领取', result: 批次对象 });\r\n\r\n// }\r\n\r\n// });\r\n\r\n// emitter.on('getCoupon', async () => {\r\n// const { 批次号, 制券商户号 } = 批次对象;\r\n// const inParam = {\r\n// openid: USER_INFO.openid,\r\n// // openid: 'oP-y45xbf7hrhC6yeabpjXzIhUWg',\r\n// stock_id: 批次号,\r\n// out_request_no: Math.floor(new Date()).toString(),\r\n// stock_creator_mchid: 制券商户号,\r\n// };\r\n// let signRes = await _F('bComponent_67ky8TZdD7').callMethod('service_FFZCEpzHrA', { inParam });\r\n\r\n// try {\r\n// signRes = JSON.parse(signRes);\r\n// } catch (e) {\r\n// signRes = {};\r\n// }\r\n// console.log('getCoupon.signRes', signRes, typeof signRes);\r\n\r\n// if (signRes?.coupon_id) {\r\n// //更新兑换状态为已兑换\r\n// emitter.emit('exchangeDone');\r\n// }\r\n// emitter.emit('appLog', signRes);\r\n// });\r\n\r\n// function getActivityStatus(失败原因) {\r\n// const currentHour = new Date().getUTCHours();\r\n// const currentMinute = new Date().getUTCMinutes();\r\n\r\n// console.log('currentHour', currentHour, currentHour + 8, currentMinute);\r\n\r\n// if (失败原因 === '批次预算耗尽') {\r\n// // if (currentHour + 8 < 18 || (currentHour + 8 === 18 && currentMinute < 10)) {\r\n// // return '活动未开始';\r\n// // } else {\r\n// // return '抢光了';\r\n// // }\r\n// return '抢光了';\r\n// } else if (失败原因 === '用户已达最大领券次数') {\r\n// return '已领取';\r\n// } else {\r\n// return '活动未开始或抢光了';\r\n// }\r\n// }\r\n\r\n// emitter.on('appLog', async (getRes) => {\r\n// console.log('appLog.getRes', getRes, typeof getRes);\r\n// const { _id: 兑换码ID, 批次号, 批次分类ID } = 批次对象;\r\n// const inParam = {\r\n// 批次号,\r\n// 用户ID: USER_INFO._id,\r\n// 批次分类ID,\r\n// 兑换码ID,\r\n// // \"失败原因\": \"\",\r\n// }\r\n// if (getRes.coupon_id) {\r\n// inParam.券ID = getRes.coupon_id;\r\n// inParam.领取结果 = 1;\r\n// } else {\r\n// inParam.领取结果 = 0;\r\n// inParam.失败原因 = getRes.message || '';\r\n// }\r\n\r\n// const reqRes = await _F('service_7XsamdHEpE').call(inParam);\r\n\r\n// if (inParam.领取结果 === 1) {\r\n// _funcCb({ code: 200, errMsg: '领取成功', result: {} });\r\n// } else {\r\n// const 显示失败原因 = getActivityStatus(inParam.失败原因);\r\n\r\n// _funcCb({ code: 0, errMsg: 显示失败原因, result: inParam.失败原因 });\r\n// }\r\n// });\r\n\r\n// emitter.emit('checkReqLimit');\r\n\r\n\r\nconst USER_INFO = _F('middle_func').callMethod('last');\r\n\r\nif (!param.hasOwnProperty('兑换码')) {\r\n _funcCb({ code: 0, errMsg: '请传入兑换码', result: {} });\r\n return;\r\n}\r\n\r\nlet 批次对象 = {};\r\n\r\nasync function checkValidDate() {\r\n if (批次对象.有效期) {\r\n const 当前时间 = Date.now() / 1000;\r\n if (批次对象.有效期 < 当前时间) {\r\n _funcCb({ code: 0, errMsg: '兑换码已过期' });\r\n return;\r\n }\r\n } else if (批次对象.是否删除) {\r\n _funcCb({ code: 0, errMsg: '兑换码已删除' });\r\n return;\r\n }\r\n\r\n await getStockLogCount();\r\n}\r\n\r\nasync function checkReqLimit() {\r\n const reqRes = await _F('service_7Xb7XyFRTb').call({\r\n \"请求控制秒数\": 15,\r\n \"控制服务标识\": \"service_XfHAfxafTt\",\r\n \"用户ID\": USER_INFO._id\r\n });\r\n\r\n if (reqRes.code === 200) {\r\n await getStock();\r\n } else {\r\n _funcCb(reqRes);\r\n }\r\n}\r\n\r\nasync function getStock() {\r\n const reqRes = await _F('service_kzW2y2e246').call({\r\n \"搜索条件\": { 兑换码: param.兑换码 }\r\n });\r\n\r\n if (reqRes.code === 200) {\r\n 批次对象 = reqRes.result;\r\n await checkValidDate();\r\n } else {\r\n _funcCb(reqRes);\r\n }\r\n}\r\n\r\nasync function exchangeDone() {\r\n const { _id: 行ID } = 批次对象;\r\n const inParam = {\r\n 行ID,\r\n 兑换状态: 1\r\n }\r\n console.log('exchangeDoneInParam', inParam)\r\n\r\n const data = await _F('bComponent_7aiWDzEFX5').callMethod('service_SmQXCDGN2Z', {\r\n inParam,\r\n });\r\n console.log('exchangeDoneResult', data)\r\n}\r\n\r\nasync function getStockLogCount() {\r\n const { _id: 兑换码ID, 兑换状态 } = 批次对象;\r\n if (兑换状态 === 0) {\r\n const 最大领取次数 = 1;\r\n const inParam = {\r\n 搜索条件: {\r\n 兑换码ID,\r\n 领取结果: 1\r\n },\r\n 当前页码: 1,\r\n 每页大小: 最大领取次数,\r\n };\r\n const logRes = await _F('bComponent_tPxP4ADSGy').callMethod('service_AcidSxppYx', { inParam });\r\n\r\n console.log('getStockLogCount', logRes);\r\n\r\n if (logRes.code === 200) {\r\n if (Array.isArray(logRes.result) && logRes.result.length >= 最大领取次数) {\r\n _funcCb({ code: 0, errMsg: '已领取', result: logRes.result });\r\n } else {\r\n await getCoupon();\r\n }\r\n } else {\r\n _funcCb(logRes);\r\n }\r\n } else {\r\n _funcCb({ code: 0, errMsg: '已领取', result: 批次对象 });\r\n }\r\n}\r\n\r\nasync function getCoupon() {\r\n const { 批次号, 制券商户号 } = 批次对象;\r\n const inParam = {\r\n openid: USER_INFO.openid,\r\n stock_id: 批次号,\r\n out_request_no: Math.floor(new Date()).toString(),\r\n stock_creator_mchid: 制券商户号,\r\n };\r\n let signRes = await _F('bComponent_67ky8TZdD7').callMethod('service_FFZCEpzHrA', { inParam });\r\n\r\n try {\r\n signRes = JSON.parse(signRes);\r\n } catch (e) {\r\n signRes = {};\r\n }\r\n console.log('getCoupon.signRes', signRes, typeof signRes);\r\n\r\n if (signRes?.coupon_id) {\r\n await exchangeDone();\r\n }\r\n await appLog(signRes);\r\n}\r\n\r\nfunction getActivityStatus(失败原因) {\r\n const currentHour = new Date().getUTCHours();\r\n const currentMinute = new Date().getUTCMinutes();\r\n\r\n console.log('currentHour', currentHour, currentHour + 8, currentMinute);\r\n\r\n if (失败原因 === '批次预算耗尽') {\r\n // if (currentHour + 8 < 18 || (currentHour + 8 === 18 && currentMinute < 10)) {\r\n // return '活动未开始';\r\n // } else {\r\n // return '抢光了';\r\n // }\r\n return '抢光了';\r\n } else if (失败原因 === '用户已达最大领券次数') {\r\n return '已领取';\r\n } else {\r\n return '活动未开始或抢光了';\r\n }\r\n}\r\n\r\nasync function appLog(getRes) {\r\n console.log('appLog.getRes', getRes, typeof getRes);\r\n const { _id: 兑换码ID, 批次号, 批次分类ID } = 批次对象;\r\n const inParam = {\r\n 批次号,\r\n 用户ID: USER_INFO._id,\r\n 批次分类ID,\r\n 兑换码ID,\r\n };\r\n\r\n if (getRes.coupon_id) {\r\n inParam.券ID = getRes.coupon_id;\r\n inParam.领取结果 = 1;\r\n } else {\r\n inParam.领取结果 = 0;\r\n inParam.失败原因 = getRes.message || '';\r\n }\r\n\r\n const reqRes = await _F('service_7XsamdHEpE').call(inParam);\r\n\r\n if (inParam.领取结果 === 1) {\r\n _funcCb({ code: 200, errMsg: '领取成功', result: {} });\r\n } else {\r\n const 显示失败原因 = getActivityStatus(inParam.失败原因);\r\n _funcCb({ code: 0, errMsg: 显示失败原因, result: inParam.失败原因 });\r\n }\r\n}\r\n\r\n// 启动流程\r\ncheckReqLimit();\r\n",
  2340. "inParams": [
  2341. {
  2342. "name": "兑换码",
  2343. "default": ""
  2344. }
  2345. ],
  2346. "babelCode": "// const emitter = new events.EventEmitter();\r\n// const USER_INFO = _F('middle_func').callMethod('last');\r\n\r\n// if (!param.hasOwnProperty('兑换码')) {\r\n// _funcCb({ code: 0, errMsg: '请传入兑换码', result: {} });\r\n// return;\r\n// }\r\n\r\n// let 批次对象 = {};\r\n\r\n// //检查有效期\r\n// emitter.on('checkValidDate', () => {\r\n// if (批次对象.有效期) {\r\n// const 当前时间 = Date.now() / 1000;\r\n// if (批次对象.有效期 < 当前时间) {\r\n// _funcCb({ code: 0, errMsg: '兑换码已过期' });\r\n// return;\r\n// }\r\n// }\r\n// else if (批次对象.是否删除) {\r\n// _funcCb({ code: 0, errMsg: '兑换码已删除' });\r\n// return;\r\n// }\r\n\r\n// emitter.emit('getStockLogCount');\r\n// })\r\n\r\n// emitter.on('checkReqLimit', async () => {\r\n// const reqRes = await _F('service_7Xb7XyFRTb').call({\r\n// \"请求控制秒数\": 15,\r\n// \"控制服务标识\": \"service_XfHAfxafTt\",\r\n// \"用户ID\": USER_INFO._id\r\n// });\r\n\r\n// if (reqRes.code === 200) emitter.emit('getStock');\r\n// else _funcCb(reqRes);\r\n// })\r\n\r\n// emitter.on('getStock', async () => {\r\n// const reqRes = await _F('service_kzW2y2e246').call({\r\n// \"搜索条件\": { 兑换码: param.兑换码 }\r\n// });\r\n\r\n// if (reqRes.code === 200) {\r\n// 批次对象 = reqRes.result;\r\n// emitter.emit('checkValidDate');\r\n// }\r\n// else _funcCb(reqRes);\r\n\r\n// });\r\n\r\n// emitter.on('exchangeDone', () => {\r\n// const { _id: 行ID } = 批次对象;\r\n// const inParam = {\r\n// 行ID,\r\n// 兑换状态: 1\r\n// }\r\n// console.log('exchangeDoneInParam', inParam)\r\n\r\n// _F('bComponent_7aiWDzEFX5').callMethod('service_SmQXCDGN2Z', {\r\n// inParam,\r\n// callback: (data) => {\r\n// // _funcCb(data);\r\n// console.log('exchangeDoneResult', data)\r\n// }\r\n// });\r\n// });\r\n\r\n\r\n// emitter.on('getStockLogCount', async () => {\r\n// const { _id: 兑换码ID, 兑换状态 } = 批次对象;\r\n// if (兑换状态 === 0) {\r\n// const 最大领取次数 = 1;\r\n// const inParam = {\r\n// 搜索条件: {\r\n// 兑换码ID,\r\n// // 用户ID: USER_INFO._id,\r\n// 领取结果: 1\r\n// },\r\n// 当前页码: 1,\r\n// 每页大小: 最大领取次数,\r\n// };\r\n// const logRes = await _F('bComponent_tPxP4ADSGy').callMethod('service_AcidSxppYx', { inParam });\r\n\r\n// console.log('getStockLogCount', logRes);\r\n\r\n// if (logRes.code === 200) {\r\n// if (Array.isArray(logRes.result) && logRes.result.length >= 最大领取次数) {\r\n// _funcCb({ code: 0, errMsg: '已领取', result: logRes.result });\r\n// } else {\r\n// emitter.emit('getCoupon');\r\n// }\r\n// } else {\r\n// _funcCb(logRes);\r\n// }\r\n\r\n// } else {\r\n// _funcCb({ code: 0, errMsg: '已领取', result: 批次对象 });\r\n\r\n// }\r\n\r\n// });\r\n\r\n// emitter.on('getCoupon', async () => {\r\n// const { 批次号, 制券商户号 } = 批次对象;\r\n// const inParam = {\r\n// openid: USER_INFO.openid,\r\n// // openid: 'oP-y45xbf7hrhC6yeabpjXzIhUWg',\r\n// stock_id: 批次号,\r\n// out_request_no: Math.floor(new Date()).toString(),\r\n// stock_creator_mchid: 制券商户号,\r\n// };\r\n// let signRes = await _F('bComponent_67ky8TZdD7').callMethod('service_FFZCEpzHrA', { inParam });\r\n\r\n// try {\r\n// signRes = JSON.parse(signRes);\r\n// } catch (e) {\r\n// signRes = {};\r\n// }\r\n// console.log('getCoupon.signRes', signRes, typeof signRes);\r\n\r\n// if (signRes?.coupon_id) {\r\n// //更新兑换状态为已兑换\r\n// emitter.emit('exchangeDone');\r\n// }\r\n// emitter.emit('appLog', signRes);\r\n// });\r\n\r\n// function getActivityStatus(失败原因) {\r\n// const currentHour = new Date().getUTCHours();\r\n// const currentMinute = new Date().getUTCMinutes();\r\n\r\n// console.log('currentHour', currentHour, currentHour + 8, currentMinute);\r\n\r\n// if (失败原因 === '批次预算耗尽') {\r\n// // if (currentHour + 8 < 18 || (currentHour + 8 === 18 && currentMinute < 10)) {\r\n// // return '活动未开始';\r\n// // } else {\r\n// // return '抢光了';\r\n// // }\r\n// return '抢光了';\r\n// } else if (失败原因 === '用户已达最大领券次数') {\r\n// return '已领取';\r\n// } else {\r\n// return '活动未开始或抢光了';\r\n// }\r\n// }\r\n\r\n// emitter.on('appLog', async (getRes) => {\r\n// console.log('appLog.getRes', getRes, typeof getRes);\r\n// const { _id: 兑换码ID, 批次号, 批次分类ID } = 批次对象;\r\n// const inParam = {\r\n// 批次号,\r\n// 用户ID: USER_INFO._id,\r\n// 批次分类ID,\r\n// 兑换码ID,\r\n// // \"失败原因\": \"\",\r\n// }\r\n// if (getRes.coupon_id) {\r\n// inParam.券ID = getRes.coupon_id;\r\n// inParam.领取结果 = 1;\r\n// } else {\r\n// inParam.领取结果 = 0;\r\n// inParam.失败原因 = getRes.message || '';\r\n// }\r\n\r\n// const reqRes = await _F('service_7XsamdHEpE').call(inParam);\r\n\r\n// if (inParam.领取结果 === 1) {\r\n// _funcCb({ code: 200, errMsg: '领取成功', result: {} });\r\n// } else {\r\n// const 显示失败原因 = getActivityStatus(inParam.失败原因);\r\n\r\n// _funcCb({ code: 0, errMsg: 显示失败原因, result: inParam.失败原因 });\r\n// }\r\n// });\r\n\r\n// emitter.emit('checkReqLimit');\r\n\r\n\r\nconst USER_INFO = _F('middle_func').callMethod('last');\r\n\r\nif (!param.hasOwnProperty('兑换码')) {\r\n _funcCb({ code: 0, errMsg: '请传入兑换码', result: {} });\r\n return;\r\n}\r\n\r\nlet 批次对象 = {};\r\n\r\nasync function checkValidDate() {\r\n if (批次对象.有效期) {\r\n const 当前时间 = Date.now() / 1000;\r\n if (批次对象.有效期 < 当前时间) {\r\n _funcCb({ code: 0, errMsg: '兑换码已过期' });\r\n return;\r\n }\r\n } else if (批次对象.是否删除) {\r\n _funcCb({ code: 0, errMsg: '兑换码已删除' });\r\n return;\r\n }\r\n\r\n await getStockLogCount();\r\n}\r\n\r\nasync function checkReqLimit() {\r\n const reqRes = await _F('service_7Xb7XyFRTb').call({\r\n \"请求控制秒数\": 15,\r\n \"控制服务标识\": \"service_XfHAfxafTt\",\r\n \"用户ID\": USER_INFO._id\r\n });\r\n\r\n if (reqRes.code === 200) {\r\n await getStock();\r\n } else {\r\n _funcCb(reqRes);\r\n }\r\n}\r\n\r\nasync function getStock() {\r\n const reqRes = await _F('service_kzW2y2e246').call({\r\n \"搜索条件\": { 兑换码: param.兑换码 }\r\n });\r\n\r\n if (reqRes.code === 200) {\r\n 批次对象 = reqRes.result;\r\n await checkValidDate();\r\n } else {\r\n _funcCb(reqRes);\r\n }\r\n}\r\n\r\nasync function exchangeDone() {\r\n const { _id: 行ID } = 批次对象;\r\n const inParam = {\r\n 行ID,\r\n 兑换状态: 1\r\n }\r\n console.log('exchangeDoneInParam', inParam)\r\n\r\n const data = await _F('bComponent_7aiWDzEFX5').callMethod('service_SmQXCDGN2Z', {\r\n inParam,\r\n });\r\n console.log('exchangeDoneResult', data)\r\n}\r\n\r\nasync function getStockLogCount() {\r\n const { _id: 兑换码ID, 兑换状态 } = 批次对象;\r\n if (兑换状态 === 0) {\r\n const 最大领取次数 = 1;\r\n const inParam = {\r\n 搜索条件: {\r\n 兑换码ID,\r\n 领取结果: 1\r\n },\r\n 当前页码: 1,\r\n 每页大小: 最大领取次数,\r\n };\r\n const logRes = await _F('bComponent_tPxP4ADSGy').callMethod('service_AcidSxppYx', { inParam });\r\n\r\n console.log('getStockLogCount', logRes);\r\n\r\n if (logRes.code === 200) {\r\n if (Array.isArray(logRes.result) && logRes.result.length >= 最大领取次数) {\r\n _funcCb({ code: 0, errMsg: '已领取', result: logRes.result });\r\n } else {\r\n await getCoupon();\r\n }\r\n } else {\r\n _funcCb(logRes);\r\n }\r\n } else {\r\n _funcCb({ code: 0, errMsg: '已领取', result: 批次对象 });\r\n }\r\n}\r\n\r\nasync function getCoupon() {\r\n const { 批次号, 制券商户号 } = 批次对象;\r\n const inParam = {\r\n openid: USER_INFO.openid,\r\n stock_id: 批次号,\r\n out_request_no: Math.floor(new Date()).toString(),\r\n stock_creator_mchid: 制券商户号,\r\n };\r\n let signRes = await _F('bComponent_67ky8TZdD7').callMethod('service_FFZCEpzHrA', { inParam });\r\n\r\n try {\r\n signRes = JSON.parse(signRes);\r\n } catch (e) {\r\n signRes = {};\r\n }\r\n console.log('getCoupon.signRes', signRes, typeof signRes);\r\n\r\n if (signRes?.coupon_id) {\r\n await exchangeDone();\r\n }\r\n await appLog(signRes);\r\n}\r\n\r\nfunction getActivityStatus(失败原因) {\r\n const currentHour = new Date().getUTCHours();\r\n const currentMinute = new Date().getUTCMinutes();\r\n\r\n console.log('currentHour', currentHour, currentHour + 8, currentMinute);\r\n\r\n if (失败原因 === '批次预算耗尽') {\r\n // if (currentHour + 8 < 18 || (currentHour + 8 === 18 && currentMinute < 10)) {\r\n // return '活动未开始';\r\n // } else {\r\n // return '抢光了';\r\n // }\r\n return '抢光了';\r\n } else if (失败原因 === '用户已达最大领券次数') {\r\n return '已领取';\r\n } else {\r\n return '活动未开始或抢光了';\r\n }\r\n}\r\n\r\nasync function appLog(getRes) {\r\n console.log('appLog.getRes', getRes, typeof getRes);\r\n const { _id: 兑换码ID, 批次号, 批次分类ID } = 批次对象;\r\n const inParam = {\r\n 批次号,\r\n 用户ID: USER_INFO._id,\r\n 批次分类ID,\r\n 兑换码ID,\r\n };\r\n\r\n if (getRes.coupon_id) {\r\n inParam.券ID = getRes.coupon_id;\r\n inParam.领取结果 = 1;\r\n } else {\r\n inParam.领取结果 = 0;\r\n inParam.失败原因 = getRes.message || '';\r\n }\r\n\r\n const reqRes = await _F('service_7XsamdHEpE').call(inParam);\r\n\r\n if (inParam.领取结果 === 1) {\r\n _funcCb({ code: 200, errMsg: '领取成功', result: {} });\r\n } else {\r\n const 显示失败原因 = getActivityStatus(inParam.失败原因);\r\n _funcCb({ code: 0, errMsg: 显示失败原因, result: inParam.失败原因 });\r\n }\r\n}\r\n\r\n// 启动流程\r\ncheckReqLimit();\r\n",
  2347. "outParams": [],
  2348. "openApiPath": "v1/mini/user/stock/exc_get"
  2349. }
  2350. },
  2351. {
  2352. "id": "service_5r86tnDYKf",
  2353. "name": "小程序发券生成V2签名",
  2354. "type": "service",
  2355. "props": {
  2356. "isOpen": true,
  2357. "isSync": true,
  2358. "jsCode": "const crypto = await Import('crypto');\r\nconst emitter = new events.EventEmitter();\r\n\r\nconst key = 'flying123456flying123456flying12';\r\n\r\nfunction signV2(outParams, key) {\r\n const basestring = Object.keys(outParams)\r\n .filter(k => ['sign', 'key'].indexOf(k) === -1)\r\n .sort()\r\n .map(k => `${k}=${outParams[k]}`)\r\n .join('&');\r\n\r\n const stringSignTemp = `${basestring}&key=${key}`;\r\n\r\n console.log('stringSignTemp', stringSignTemp);\r\n\r\n const sign = crypto.createHmac('sha256', key).update(stringSignTemp).digest('hex').toUpperCase();\r\n\r\n return sign;\r\n}\r\n\r\nemitter.on('signStock', async (批次对象) => {\r\n const { 批次号, 制券商户号,发券商户号 } = 批次对象;\r\n\r\n // 使用示例\r\n // const outParams = {\r\n // create_coupon_merchant0: '10016226',\r\n // out_request_no0: 'abc123',\r\n // send_coupon_merchant: '10016226',\r\n // stock_id0: '1234567'\r\n // };\r\n const outParams = {\r\n stock_id0:批次号,\r\n create_coupon_merchant0:制券商户号,\r\n send_coupon_merchant:发券商户号,\r\n out_request_no0 : Math.floor(new Date()).toString(),\r\n };\r\n\r\n const sign = signV2(outParams, key);\r\n\r\n outParams.sign = sign;\r\n\r\n console.log('outParams', outParams);\r\n\r\n _funcCb({ code: 200, errMsg: 'ok', result: outParams });\r\n\r\n});\r\n\r\nemitter.on('getStock', async () => {\r\n const reqRes = await _F('service_4e5RspbZSR').call({\r\n \"搜索条件\": { 批次号: param.批次号 }\r\n });\r\n\r\n if (reqRes.code === 200) {\r\n const 批次对象 = reqRes.result;\r\n emitter.emit('signStock', 批次对象);\r\n }\r\n else _funcCb(reqRes);\r\n\r\n});\r\n\r\nemitter.emit('getStock');\r\n\r\n",
  2359. "inParams": [
  2360. {
  2361. "name": "批次号",
  2362. "default": null
  2363. }
  2364. ],
  2365. "openApiPath": "v1/mini/user/send_coupon/v2_sign_create"
  2366. }
  2367. }
  2368. ]
  2369. },
  2370. {
  2371. "id": "group_tbTZFkMj8J",
  2372. "name": "批次中台相关",
  2373. "type": "group",
  2374. "props": {
  2375. "devId": "group_tbTZFkMj8J"
  2376. },
  2377. "children": [
  2378. {
  2379. "id": "bComponent_ysQh4njDJ3",
  2380. "name": "代金券批次管理后台组件",
  2381. "type": "bComponent",
  2382. "props": {
  2383. "devId": "bComponent_ysQh4njDJ3",
  2384. "moduleId": "module_ByNbsAd5hD",
  2385. "dbConnect": [
  2386. {
  2387. "tempId": "dbTableTemp_nr37DhHs56",
  2388. "tableId": "dbTable_kTF3TXAEEB"
  2389. },
  2390. {
  2391. "tempId": "dbTableTemp_DeEzJeMkjd",
  2392. "tableId": "dbTable_xSTwEQ32HH"
  2393. },
  2394. {
  2395. "tempId": "dbViewTemp_AJyyXTd2RD",
  2396. "tableId": "dbView_pCr5F7ic8p"
  2397. }
  2398. ]
  2399. }
  2400. },
  2401. {
  2402. "id": "group_5e3F3szz67",
  2403. "name": "内置服务",
  2404. "type": "group",
  2405. "props": {},
  2406. "children": [
  2407. {
  2408. "id": "service_4e5RspbZSR",
  2409. "name": "批次号搜索服务",
  2410. "type": "service",
  2411. "props": {
  2412. "devId": "service_4e5RspbZSR",
  2413. "isOpen": false,
  2414. "jsCode": "const emitter = new events.EventEmitter();\r\n\r\nlet inParam = param || {};\r\ninParam.当前页码 = 1;\r\ninParam.每页大小 = 1;\r\n\r\nconst getList = (setCache) => {\r\n _F('bComponent_ysQh4njDJ3').callMethod('service_twyCJwfKE8', {\r\n inParam,\r\n callback: (resp) => {\r\n console.log('getList',resp);\r\n if(resp?.code === 200 && Array.isArray(resp?.result) && resp.result?.length > 0){\r\n setCache(resp?.result[0]);\r\n }else{\r\n // setCache({});\r\n _funcCb(resp)\r\n }\r\n \r\n }\r\n }\r\n );\r\n}\r\n\r\nemitter.on('getCache', async () => {\r\n const reqRes = await _F('service_7w8aDmK8DS').call({\r\n \"缓存名称\": \"stock_no\",\r\n \"查询参数\": inParam,\r\n \"缓存时间\": 60,\r\n \"查询回调\": getList\r\n });\r\n\r\n _funcCb({code:200,errMsg:'ok',result:reqRes});\r\n});\r\n\r\n\r\nemitter.emit('getCache');",
  2415. "inParams": [
  2416. "搜索条件",
  2417. "当前页码",
  2418. "每页大小"
  2419. ],
  2420. "outParams": [],
  2421. "openApiPath": "v1/2mini/user/stock/stock_no/search",
  2422. "inParamsDebug": {
  2423. "当前页码": 1,
  2424. "搜索条件": {
  2425. "批次号": "17645669"
  2426. },
  2427. "每页大小": 1
  2428. }
  2429. }
  2430. }
  2431. ]
  2432. },
  2433. {
  2434. "id": "group_d7Gxxwwkhr",
  2435. "name": "小程序api相关",
  2436. "type": "group",
  2437. "props": {},
  2438. "children": [
  2439. {
  2440. "id": "service_BhnBYHEAKP",
  2441. "name": "批次关键字搜索服务",
  2442. "type": "service",
  2443. "props": {
  2444. "devId": "service_BhnBYHEAKP",
  2445. "isOpen": true,
  2446. "jsCode": "const emitter = new events.EventEmitter();\r\n\r\nlet inParam = param || {};\r\n\r\nconst getList = (setCache) => {\r\n _F('bComponent_ysQh4njDJ3').callMethod('service_twyCJwfKE8', {\r\n inParam,\r\n callback: (resp) => {\r\n console.log('getList',resp);\r\n if(resp?.code === 200 && Array.isArray(resp?.result)){\r\n setCache(resp?.result);\r\n }else{\r\n // setCache({});\r\n _funcCb(resp)\r\n }\r\n \r\n }\r\n }\r\n );\r\n}\r\n\r\nemitter.on('getCache', async () => {\r\n const reqRes = await _F('service_7w8aDmK8DS').call({\r\n \"缓存名称\": \"stock_list\",\r\n \"查询参数\": inParam,\r\n \"缓存时间\": 60,\r\n \"查询回调\": getList\r\n });\r\n\r\n _funcCb({code:200,errMsg:'ok',result:reqRes});\r\n});\r\n\r\n\r\nemitter.emit('getCache');",
  2447. "inParams": [
  2448. "搜索条件",
  2449. "当前页码",
  2450. "每页大小"
  2451. ],
  2452. "outParams": [],
  2453. "openApiPath": "v1/mini/user/stock/search",
  2454. "inParamsDebug": {
  2455. "批次号": "",
  2456. "当前页码": "",
  2457. "批次名称": "",
  2458. "是否删除": "",
  2459. "每页大小": ""
  2460. }
  2461. }
  2462. }
  2463. ]
  2464. },
  2465. {
  2466. "id": "group_QFBjFjt4bX",
  2467. "name": "管理后台api相关",
  2468. "type": "group",
  2469. "props": {
  2470. "devId": "group_QFBjFjt4bX"
  2471. },
  2472. "children": [
  2473. {
  2474. "id": "service_kZy3r6xS6Q",
  2475. "name": "批次关键字搜索服务",
  2476. "type": "service",
  2477. "props": {
  2478. "devId": "service_kZy3r6xS6Q",
  2479. "isOpen": true,
  2480. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = param;\r\n\r\nemitter.on('getList', ()=>{\r\n _F('bComponent_ysQh4njDJ3').callMethod('service_twyCJwfKE8',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getList');",
  2481. "inParams": [
  2482. {
  2483. "name": "搜索条件对象",
  2484. "default": null
  2485. },
  2486. {
  2487. "name": "当前页码",
  2488. "default": ""
  2489. },
  2490. {
  2491. "name": "每页大小",
  2492. "default": ""
  2493. }
  2494. ],
  2495. "outParams": [],
  2496. "openApiPath": "v1/admin/stock/search"
  2497. }
  2498. },
  2499. {
  2500. "id": "service_Gra7cAFWww",
  2501. "name": "角色删除服务",
  2502. "type": "service",
  2503. "props": {
  2504. "devId": "service_Gra7cAFWww",
  2505. "isOpen": true,
  2506. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = {};\r\nif(param.hasOwnProperty('角色ID'))inParam['角色ID'] = param.角色ID;\r\nif(param.hasOwnProperty('是否删除'))inParam['是否删除'] = param.是否删除 == 1?1:0;\r\n\r\nemitter.on('delDept', ()=>{\r\n _F('bComponent_ysQh4njDJ3').callMethod('service_FHxSD7RYtT',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('delDept');",
  2507. "inParams": [
  2508. "角色ID",
  2509. "是否删除"
  2510. ],
  2511. "outParams": [],
  2512. "openApiPath": "v1/admin/role/del",
  2513. "inParamsDebug": {
  2514. "部门ID": "1",
  2515. "是否删除": "0",
  2516. "是否禁用": "0",
  2517. "部门名称": "多八多总部2",
  2518. "上级部门ID": "0"
  2519. }
  2520. }
  2521. },
  2522. {
  2523. "id": "service_Ctn5PCa6GP",
  2524. "name": "批次新增服务",
  2525. "type": "service",
  2526. "props": {
  2527. "devId": "service_Ctn5PCa6GP",
  2528. "isOpen": true,
  2529. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('appDept', ()=>{\r\n _F('bComponent_ysQh4njDJ3').callMethod('service_6CQ846mkJ2',{\r\n inParam:param,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('appDept');\r\n",
  2530. "inParams": [
  2531. "批次分类ID",
  2532. "批次号",
  2533. "制券商户号",
  2534. "发券商户号",
  2535. "批次名称",
  2536. "批次简介",
  2537. "图片链接",
  2538. "是否首页展示"
  2539. ],
  2540. "outParams": [],
  2541. "openApiPath": "v1/admin/stock/add",
  2542. "inParamsDebug": {
  2543. "批次号": "17615961",
  2544. "图片链接": "",
  2545. "批次名称": "微信支付代金券批次",
  2546. "批次简介": "满2元减1元",
  2547. "批次分类ID": "1",
  2548. "制券商户号": "1524075161",
  2549. "发券商户号": "1524075161",
  2550. "是否首页展示": "1"
  2551. }
  2552. }
  2553. },
  2554. {
  2555. "id": "service_YSMBMwmHRE",
  2556. "name": "批次编辑服务",
  2557. "type": "service",
  2558. "props": {
  2559. "devId": "service_YSMBMwmHRE",
  2560. "isOpen": true,
  2561. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = param;\r\n\r\nemitter.on('editDept', ()=>{\r\n _F('bComponent_ysQh4njDJ3').callMethod('service_bWAJYa85dp',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('editDept');",
  2562. "inParams": [
  2563. "批次ID",
  2564. "批次分类ID",
  2565. "批次号",
  2566. "制券商户号",
  2567. "发券商户号",
  2568. "批次名称",
  2569. "批次简介",
  2570. "图片链接",
  2571. "是否首页展示",
  2572. "是否上架",
  2573. "上架时间",
  2574. "下架时间"
  2575. ],
  2576. "outParams": [],
  2577. "openApiPath": "v1/admin/stock/edit",
  2578. "inParamsDebug": {
  2579. "批次ID": "1",
  2580. "批次号": "",
  2581. "上架时间": "",
  2582. "下架时间": "",
  2583. "图片链接": "",
  2584. "批次名称": "",
  2585. "批次简介": "",
  2586. "是否上架": "",
  2587. "批次分类ID": "2",
  2588. "制券商户号": "",
  2589. "发券商户号": "",
  2590. "是否首页展示": ""
  2591. }
  2592. }
  2593. }
  2594. ]
  2595. },
  2596. {
  2597. "id": "group_mmYxnieDY2",
  2598. "name": "数据表相关",
  2599. "type": "group",
  2600. "props": {},
  2601. "children": [
  2602. {
  2603. "id": "bCache_5mJ3s8hfBQ",
  2604. "name": "批次列表缓存",
  2605. "type": "bCache",
  2606. "props": {}
  2607. },
  2608. {
  2609. "id": "dbTable_xSTwEQ32HH",
  2610. "name": "代金券批次列表",
  2611. "type": "dbTable",
  2612. "props": {
  2613. "fields": [
  2614. {
  2615. "columnName": "_id",
  2616. "columnType": "int unsigned"
  2617. },
  2618. {
  2619. "columnName": "批次分类ID",
  2620. "columnType": "int"
  2621. },
  2622. {
  2623. "columnName": "批次号",
  2624. "columnType": "text"
  2625. },
  2626. {
  2627. "columnName": "制券商户号",
  2628. "columnType": "text"
  2629. },
  2630. {
  2631. "columnName": "发券商户号",
  2632. "columnType": "text"
  2633. },
  2634. {
  2635. "columnName": "批次名称",
  2636. "columnType": "text"
  2637. },
  2638. {
  2639. "columnName": "批次简介",
  2640. "columnType": "text"
  2641. },
  2642. {
  2643. "columnName": "图片链接",
  2644. "columnType": "text"
  2645. },
  2646. {
  2647. "columnName": "是否首页展示",
  2648. "columnType": "int"
  2649. },
  2650. {
  2651. "columnName": "是否上架",
  2652. "columnType": "int"
  2653. },
  2654. {
  2655. "columnName": "上架时间",
  2656. "columnType": "int"
  2657. },
  2658. {
  2659. "columnName": "下架时间",
  2660. "columnType": "int"
  2661. },
  2662. {
  2663. "columnName": "是否删除",
  2664. "columnType": "int"
  2665. },
  2666. {
  2667. "columnName": "_create",
  2668. "columnType": "bigint unsigned"
  2669. },
  2670. {
  2671. "columnName": "_update",
  2672. "columnType": "bigint unsigned"
  2673. }
  2674. ]
  2675. }
  2676. },
  2677. {
  2678. "id": "dbView_pCr5F7ic8p",
  2679. "name": "批次表+分类表视图",
  2680. "type": "dbView",
  2681. "props": {
  2682. "fields": [
  2683. {
  2684. "columnName": "_id",
  2685. "columnType": "int unsigned"
  2686. },
  2687. {
  2688. "columnName": "批次分类ID",
  2689. "columnType": "int"
  2690. },
  2691. {
  2692. "columnName": "批次号",
  2693. "columnType": "text"
  2694. },
  2695. {
  2696. "columnName": "制券商户号",
  2697. "columnType": "text"
  2698. },
  2699. {
  2700. "columnName": "发券商户号",
  2701. "columnType": "text"
  2702. },
  2703. {
  2704. "columnName": "批次名称",
  2705. "columnType": "text"
  2706. },
  2707. {
  2708. "columnName": "批次简介",
  2709. "columnType": "text"
  2710. },
  2711. {
  2712. "columnName": "图片链接",
  2713. "columnType": "text"
  2714. },
  2715. {
  2716. "columnName": "是否首页展示",
  2717. "columnType": "int"
  2718. },
  2719. {
  2720. "columnName": "是否上架",
  2721. "columnType": "int"
  2722. },
  2723. {
  2724. "columnName": "上架时间",
  2725. "columnType": "int"
  2726. },
  2727. {
  2728. "columnName": "下架时间",
  2729. "columnType": "int"
  2730. },
  2731. {
  2732. "columnName": "是否删除",
  2733. "columnType": "int"
  2734. },
  2735. {
  2736. "columnName": "_create",
  2737. "columnType": "bigint unsigned"
  2738. },
  2739. {
  2740. "columnName": "_update",
  2741. "columnType": "bigint unsigned"
  2742. },
  2743. {
  2744. "columnName": "批次分类名称",
  2745. "columnType": "text"
  2746. }
  2747. ],
  2748. "columns": [
  2749. {
  2750. "field": "",
  2751. "direction": "",
  2752. "joinParam": {
  2753. "lTName": "",
  2754. "rTName": "",
  2755. "lTField": "",
  2756. "rTField": "",
  2757. "joinType": "inner join",
  2758. "condition": []
  2759. },
  2760. "columnName": "*",
  2761. "columnType": "field",
  2762. "fieldParam": {
  2763. "tName": "dbTable_xSTwEQ32HH",
  2764. "tField": "*"
  2765. }
  2766. },
  2767. {
  2768. "field": "",
  2769. "direction": "",
  2770. "joinParam": {
  2771. "lTName": "dbTable_xSTwEQ32HH",
  2772. "rTName": "dbTable_XdneF2SM7h",
  2773. "lTField": "批次分类ID",
  2774. "rTField": "_id",
  2775. "joinType": "left join",
  2776. "condition": []
  2777. },
  2778. "columnName": "分类表关联",
  2779. "columnType": "join",
  2780. "fieldParam": {
  2781. "tName": "",
  2782. "tField": ""
  2783. }
  2784. },
  2785. {
  2786. "field": "",
  2787. "direction": "",
  2788. "joinParam": {
  2789. "lTName": "",
  2790. "rTName": "",
  2791. "lTField": "",
  2792. "rTField": "",
  2793. "joinType": "inner join",
  2794. "condition": []
  2795. },
  2796. "columnName": "批次分类名称",
  2797. "columnType": "field",
  2798. "fieldParam": {
  2799. "tName": "dbTable_XdneF2SM7h",
  2800. "tField": "分类名称"
  2801. }
  2802. }
  2803. ]
  2804. }
  2805. }
  2806. ]
  2807. }
  2808. ]
  2809. },
  2810. {
  2811. "id": "group_jwhQmpxbZw",
  2812. "name": "领券日志中台相关",
  2813. "type": "group",
  2814. "props": {
  2815. "devId": "group_jwhQmpxbZw"
  2816. },
  2817. "children": [
  2818. {
  2819. "id": "bComponent_tPxP4ADSGy",
  2820. "name": "领券日志后台组件",
  2821. "type": "bComponent",
  2822. "props": {
  2823. "devId": "bComponent_tPxP4ADSGy",
  2824. "moduleId": "module_fE35nbENiD",
  2825. "dbConnect": [
  2826. {
  2827. "tempId": "dbTableTemp_nr37DhHs56",
  2828. "tableId": "dbTable_kTF3TXAEEB"
  2829. },
  2830. {
  2831. "tempId": "dbTableTemp_DeEzJeMkjd",
  2832. "tableId": "dbTable_xSTwEQ32HH"
  2833. },
  2834. {
  2835. "tempId": "dbTableTemp_aGxy3Zp8YK",
  2836. "tableId": "dbTable_8kcPFkQWna"
  2837. },
  2838. {
  2839. "tempId": "dbViewTemp_ySBFNYEzPe",
  2840. "tableId": "dbView_hCk5mDhapb"
  2841. }
  2842. ]
  2843. }
  2844. },
  2845. {
  2846. "id": "group_CekT6rbaaS",
  2847. "name": "内置服务",
  2848. "type": "group",
  2849. "props": {},
  2850. "children": [
  2851. {
  2852. "id": "service_7XsamdHEpE",
  2853. "name": "领券日志新增内置服务",
  2854. "type": "service",
  2855. "props": {
  2856. "devId": "service_7XsamdHEpE",
  2857. "isOpen": false,
  2858. "jsCode": "const emitter = new events.EventEmitter();\r\n\r\nemitter.on('appLog', () => {\r\n // { \"coupon_id\": \"45774000359\" }\r\n\r\n // let inParam = {\r\n // 批次分类ID: param.批次分类ID,\r\n // 批次号: param.批次号,\r\n // 用户ID: param.用户ID,\r\n // }\r\n // if (param.券ID) {\r\n // inParam.券ID = param.券ID;\r\n // inParam.领取结果 = 1;\r\n // } else {\r\n // inParam.领取结果 = 0;\r\n // inParam.失败原因 = param.失败原因 || '';\r\n // }\r\n\r\n console.log('领券日志新增内置服务',param)\r\n\r\n _F('bComponent_tPxP4ADSGy').callMethod('service_azwnbpdzmE', {\r\n inParam: param,\r\n callback: (data) => {\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\n\r\nemitter.emit('appLog');\r\n\r\n",
  2859. "inParams": [
  2860. {
  2861. "name": "批次号",
  2862. "default": "17615961"
  2863. },
  2864. {
  2865. "name": "批次分类ID",
  2866. "default": "1"
  2867. },
  2868. {
  2869. "name": "券ID",
  2870. "default": ""
  2871. },
  2872. {
  2873. "name": "失败原因",
  2874. "default": ""
  2875. },
  2876. {
  2877. "name": "用户ID",
  2878. "default": ""
  2879. }
  2880. ],
  2881. "outParams": [],
  2882. "openApiPath": "v1/mini/user/stock_log/add"
  2883. }
  2884. }
  2885. ]
  2886. },
  2887. {
  2888. "id": "group_SCbEdYTSmW",
  2889. "name": "小程序api相关",
  2890. "type": "group",
  2891. "props": {},
  2892. "children": [
  2893. {
  2894. "id": "service_wKXCKeyhw8",
  2895. "name": "领券日志关键字搜索服务",
  2896. "type": "service",
  2897. "props": {
  2898. "devId": "service_wKXCKeyhw8",
  2899. "isOpen": true,
  2900. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = param;\r\n\r\nemitter.on('getList', ()=>{\r\n _F('bComponent_tPxP4ADSGy').callMethod('service_twyCJwfKE8',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getList');",
  2901. "inParams": [
  2902. "搜索条件对象",
  2903. "当前页码",
  2904. "每页大小"
  2905. ],
  2906. "outParams": [],
  2907. "openApiPath": "v1/mini/user/stock_log/search",
  2908. "inParamsDebug": {
  2909. "批次号": "",
  2910. "当前页码": "",
  2911. "批次名称": "",
  2912. "是否删除": "",
  2913. "每页大小": ""
  2914. }
  2915. }
  2916. },
  2917. {
  2918. "id": "service_jmnfMfardd",
  2919. "name": "工行活动领券+领券日志新增服务",
  2920. "type": "service",
  2921. "props": {
  2922. "devId": "service_jmnfMfardd",
  2923. "isOpen": true,
  2924. "jsCode": "const emitter = new events.EventEmitter();\r\nconst USER_INFO = _F('middle_func').callMethod('last');\r\n\r\nif (!param.hasOwnProperty('批次号')) {\r\n _funcCb({ code: 0, errMsg: '请传入批次号', result: {} });\r\n return;\r\n}\r\nif (!param.hasOwnProperty('最大领取次数')) {\r\n _funcCb({ code: 0, errMsg: '请传入最大领取次数', result: {} });\r\n return;\r\n}\r\nif (!param.hasOwnProperty('制券商户号')) {\r\n _funcCb({ code: 0, errMsg: '请传入制券商户号', result: {} });\r\n return;\r\n}\r\nif (!param.hasOwnProperty('批次分类ID')) {\r\n _funcCb({ code: 0, errMsg: '请传入批次分类ID', result: {} });\r\n return;\r\n}\r\n\r\nemitter.on('checkReqLimit', async () => {\r\n const reqRes = await _F('service_7Xb7XyFRTb').call({\r\n \"请求控制秒数\": 15,\r\n \"控制服务标识\": \"service_jmnfMfardd\",\r\n \"用户ID\": USER_INFO._id\r\n });\r\n\r\n if (reqRes.code === 200) emitter.emit('checkWhiteList');\r\n else _funcCb(reqRes);\r\n})\r\n\r\nemitter.on('checkWhiteList', async () => {\r\n const reqRes = await _F('service_KpBW3riiDd').call({\r\n 批次分类ID: param.批次分类ID,\r\n });\r\n\r\n if (reqRes.code === 200) emitter.emit('getStockCateCache');\r\n else _funcCb(reqRes);\r\n\r\n // _funcCb(reqRes);\r\n})\r\n\r\n\r\n\r\nemitter.on('getStockCateCache', async () => {\r\n const 批次分类ID = param.批次分类ID;\r\n const 批次分类缓存Key = `stock_cate_detail_${批次分类ID}`;\r\n //缓存获取\r\n const cacheRes = await _F('bCache_jwAY7zpBCk').callMethod('get', {\r\n key: 批次分类缓存Key\r\n }).catch((error) => {\r\n console.log('获取分类缓存失败');\r\n emitter.emit('getList');\r\n });\r\n\r\n try {\r\n const stockCateCache = JSON.parse(cacheRes);\r\n if (stockCateCache) {\r\n console.log('获取分类缓存成功', stockCateCache);\r\n const 最大领取次数 = stockCateCache.result[0].最大领取次数;\r\n emitter.emit('getStockLogCount', 最大领取次数);\r\n } else {\r\n emitter.emit('getStockLogCount', param.最大领取次数);\r\n }\r\n } catch (error) {\r\n emitter.emit('getStockLogCount', param.最大领取次数);\r\n }\r\n\r\n});\r\n\r\nemitter.on('getStockLogCount', async (最大领取次数) => {\r\n if (最大领取次数 > 0) {\r\n\r\n const inParam = {\r\n 搜索条件对象: {\r\n 批次分类ID: param.批次分类ID,\r\n // 批次号: param.批次号,\r\n 用户ID: USER_INFO._id,\r\n 领取结果: 1\r\n },\r\n 当前页码: 1,\r\n 每页大小: 最大领取次数,\r\n };\r\n const logRes = await _F('bComponent_tPxP4ADSGy').callMethod('service_AcidSxppYx', { inParam });\r\n\r\n if (logRes.code === 200) {\r\n if (Array.isArray(logRes.result) && logRes.result.length >= 最大领取次数) {\r\n _funcCb({ code: 0, errMsg: '已领取', result: logRes.result });\r\n } else {\r\n emitter.emit('getCoupon');\r\n }\r\n } else {\r\n _funcCb(logRes);\r\n }\r\n\r\n } else {\r\n emitter.emit('getCoupon');\r\n }\r\n\r\n});\r\n\r\nemitter.on('getCoupon', async () => {\r\n const inParam = {\r\n openid: USER_INFO.openid,\r\n // openid: 'oP-y45xbf7hrhC6yeabpjXzIhUWg',\r\n stock_id: param.批次号,\r\n out_request_no: Math.floor(new Date()).toString(),\r\n stock_creator_mchid: param.制券商户号,\r\n };\r\n const signRes = await _F('bComponent_67ky8TZdD7').callMethod('service_FFZCEpzHrA', { inParam });\r\n emitter.emit('appLog', signRes);\r\n});\r\n\r\n// function getActivityStatus(失败原因) {\r\n// const currentHour = new Date().getUTCHours();\r\n\r\n// console.log('currentHour',currentHour,currentHour + 8);\r\n\r\n// if (失败原因 === '批次预算耗尽') {\r\n// if (currentHour + 8 < 19) {\r\n// return '活动未开始';\r\n// } else {\r\n// return '抢光了';\r\n// }\r\n// }\r\n// else if (失败原因 === '用户已达最大领券次数') {\r\n// return '已领取';\r\n// }else{\r\n// return '活动未开始或抢光了';\r\n// }\r\n\r\n \r\n// }\r\n\r\nfunction getActivityStatus(失败原因) {\r\n const currentHour = new Date().getUTCHours();\r\n const currentMinute = new Date().getUTCMinutes();\r\n\r\n console.log('currentHour', currentHour, currentHour + 8, currentMinute);\r\n\r\n if (失败原因 === '批次预算耗尽') {\r\n if (currentHour + 8 < 18 || (currentHour + 8 === 18 && currentMinute < 10)) {\r\n return '活动未开始';\r\n } else {\r\n return '抢光了';\r\n }\r\n } else if (失败原因 === '用户已达最大领券次数') {\r\n return '已领取';\r\n } else {\r\n return '活动未开始或抢光了';\r\n }\r\n}\r\n\r\nemitter.on('appLog', (getRes) => {\r\n // { \"coupon_id\": \"45774000359\" }\r\n\r\n try {\r\n getRes = JSON.parse(getRes);\r\n } catch (e) {\r\n getRes = {};\r\n }\r\n console.log('appLog.getRes', getRes, typeof getRes);\r\n\r\n let inParam = {\r\n 批次分类ID: param.批次分类ID,\r\n 批次号: param.批次号,\r\n 用户ID: USER_INFO._id,\r\n }\r\n if (getRes.coupon_id) {\r\n inParam.券ID = getRes.coupon_id;\r\n inParam.领取结果 = 1;\r\n } else {\r\n inParam.领取结果 = 0;\r\n inParam.失败原因 = getRes.message || '';\r\n }\r\n\r\n _F('bComponent_tPxP4ADSGy').callMethod('service_azwnbpdzmE', {\r\n inParam: inParam,\r\n callback: (data) => {\r\n if (inParam.领取结果 === 1) {\r\n _funcCb({ code: 200, errMsg: '领取成功', result: {} });\r\n } else {\r\n const 显示失败原因 = getActivityStatus(inParam.失败原因);\r\n\r\n _funcCb({ code: 0, errMsg: 显示失败原因, result: inParam.失败原因 });\r\n }\r\n\r\n }\r\n }\r\n );\r\n});\r\n\r\n\r\nemitter.emit('checkReqLimit');\r\n\r\n",
  2925. "inParams": [
  2926. "批次号",
  2927. "最大领取次数",
  2928. "批次分类ID",
  2929. "制券商户号"
  2930. ],
  2931. "outParams": [],
  2932. "openApiPath": "v1/mini/user/stock_log/add",
  2933. "inParamsDebug": {
  2934. "批次号": "17615961",
  2935. "图片链接": "",
  2936. "批次名称": "微信支付代金券批次",
  2937. "批次简介": "满2元减1元",
  2938. "批次分类ID": "1",
  2939. "制券商户号": "1524075161",
  2940. "发券商户号": "1524075161",
  2941. "是否首页展示": "1"
  2942. }
  2943. }
  2944. }
  2945. ]
  2946. },
  2947. {
  2948. "id": "group_wF7FxadfKT",
  2949. "name": "数据表相关",
  2950. "type": "group",
  2951. "props": {},
  2952. "children": [
  2953. {
  2954. "id": "dbTable_8kcPFkQWna",
  2955. "name": "领券日志表",
  2956. "type": "dbTable",
  2957. "props": {
  2958. "fields": [
  2959. {
  2960. "columnName": "_id",
  2961. "columnType": "int unsigned"
  2962. },
  2963. {
  2964. "columnName": "兑换码ID",
  2965. "columnType": "int"
  2966. },
  2967. {
  2968. "columnName": "批次分类ID",
  2969. "columnType": "int"
  2970. },
  2971. {
  2972. "columnName": "批次号",
  2973. "columnType": "text"
  2974. },
  2975. {
  2976. "columnName": "用户ID",
  2977. "columnType": "int"
  2978. },
  2979. {
  2980. "columnName": "领取结果",
  2981. "columnType": "int"
  2982. },
  2983. {
  2984. "columnName": "券ID",
  2985. "columnType": "text"
  2986. },
  2987. {
  2988. "columnName": "失败原因",
  2989. "columnType": "text"
  2990. },
  2991. {
  2992. "columnName": "_create",
  2993. "columnType": "bigint unsigned"
  2994. },
  2995. {
  2996. "columnName": "_update",
  2997. "columnType": "bigint unsigned"
  2998. }
  2999. ]
  3000. }
  3001. },
  3002. {
  3003. "id": "dbView_hCk5mDhapb",
  3004. "name": "领券日志+批次分类+兑换码视图",
  3005. "type": "dbView",
  3006. "props": {
  3007. "fields": [
  3008. {
  3009. "columnName": "_id",
  3010. "columnType": "int unsigned"
  3011. },
  3012. {
  3013. "columnName": "兑换码ID",
  3014. "columnType": "int"
  3015. },
  3016. {
  3017. "columnName": "批次分类ID",
  3018. "columnType": "int"
  3019. },
  3020. {
  3021. "columnName": "批次号",
  3022. "columnType": "text"
  3023. },
  3024. {
  3025. "columnName": "用户ID",
  3026. "columnType": "int"
  3027. },
  3028. {
  3029. "columnName": "领取结果",
  3030. "columnType": "int"
  3031. },
  3032. {
  3033. "columnName": "券ID",
  3034. "columnType": "text"
  3035. },
  3036. {
  3037. "columnName": "失败原因",
  3038. "columnType": "text"
  3039. },
  3040. {
  3041. "columnName": "_create",
  3042. "columnType": "bigint unsigned"
  3043. },
  3044. {
  3045. "columnName": "_update",
  3046. "columnType": "bigint unsigned"
  3047. },
  3048. {
  3049. "columnName": "批次名称",
  3050. "columnType": "text"
  3051. },
  3052. {
  3053. "columnName": "批次简介",
  3054. "columnType": "text"
  3055. },
  3056. {
  3057. "columnName": "批次分类名称",
  3058. "columnType": "text"
  3059. },
  3060. {
  3061. "columnName": "兑换码",
  3062. "columnType": "varchar(100)"
  3063. }
  3064. ],
  3065. "columns": [
  3066. {
  3067. "field": "",
  3068. "direction": "",
  3069. "joinParam": {
  3070. "lTName": "",
  3071. "rTName": "",
  3072. "lTField": "",
  3073. "rTField": "",
  3074. "joinType": "inner join",
  3075. "condition": []
  3076. },
  3077. "columnName": "*",
  3078. "columnType": "field",
  3079. "fieldParam": {
  3080. "tName": "dbTable_8kcPFkQWna",
  3081. "tField": "*"
  3082. }
  3083. },
  3084. {
  3085. "field": "",
  3086. "direction": "",
  3087. "joinParam": {
  3088. "lTName": "dbTable_8kcPFkQWna",
  3089. "rTName": "dbTable_xSTwEQ32HH",
  3090. "lTField": "批次号",
  3091. "rTField": "批次号",
  3092. "joinType": "left join",
  3093. "condition": []
  3094. },
  3095. "columnName": "批次关联",
  3096. "columnType": "join",
  3097. "fieldParam": {
  3098. "tName": "",
  3099. "tField": "批次关联"
  3100. }
  3101. },
  3102. {
  3103. "field": "",
  3104. "direction": "",
  3105. "joinParam": {
  3106. "lTName": "",
  3107. "rTName": "",
  3108. "lTField": "",
  3109. "rTField": "",
  3110. "joinType": "inner join",
  3111. "condition": []
  3112. },
  3113. "columnName": "批次名称",
  3114. "columnType": "field",
  3115. "fieldParam": {
  3116. "tName": "dbTable_xSTwEQ32HH",
  3117. "tField": "批次名称"
  3118. }
  3119. },
  3120. {
  3121. "field": "",
  3122. "direction": "",
  3123. "joinParam": {
  3124. "lTName": "",
  3125. "rTName": "",
  3126. "lTField": "",
  3127. "rTField": "",
  3128. "joinType": "inner join",
  3129. "condition": []
  3130. },
  3131. "columnName": "批次简介",
  3132. "columnType": "field",
  3133. "fieldParam": {
  3134. "tName": "dbTable_xSTwEQ32HH",
  3135. "tField": "批次简介"
  3136. }
  3137. },
  3138. {
  3139. "field": "",
  3140. "direction": "",
  3141. "joinParam": {
  3142. "lTName": "dbTable_8kcPFkQWna",
  3143. "rTName": "dbTable_XdneF2SM7h",
  3144. "lTField": "批次分类ID",
  3145. "rTField": "_id",
  3146. "joinType": "left join",
  3147. "condition": []
  3148. },
  3149. "columnName": "批次分类关联",
  3150. "columnType": "join",
  3151. "fieldParam": {
  3152. "tName": "",
  3153. "tField": ""
  3154. }
  3155. },
  3156. {
  3157. "field": "",
  3158. "direction": "",
  3159. "joinParam": {
  3160. "lTName": "",
  3161. "rTName": "",
  3162. "lTField": "",
  3163. "rTField": "",
  3164. "joinType": "inner join",
  3165. "condition": []
  3166. },
  3167. "columnName": "批次分类名称",
  3168. "columnType": "field",
  3169. "fieldParam": {
  3170. "tName": "dbTable_XdneF2SM7h",
  3171. "tField": "分类名称"
  3172. }
  3173. },
  3174. {
  3175. "field": "",
  3176. "direction": "",
  3177. "joinParam": {
  3178. "lTName": "dbTable_8kcPFkQWna",
  3179. "rTName": "dbTable_QZcxeDYPsz",
  3180. "lTField": "兑换码ID",
  3181. "rTField": "_id",
  3182. "joinType": "left join",
  3183. "condition": []
  3184. },
  3185. "columnName": "兑换码关联",
  3186. "columnType": "join",
  3187. "fieldParam": {
  3188. "tName": "",
  3189. "tField": ""
  3190. }
  3191. },
  3192. {
  3193. "field": "",
  3194. "direction": "",
  3195. "joinParam": {
  3196. "lTName": "",
  3197. "rTName": "",
  3198. "lTField": "",
  3199. "rTField": "",
  3200. "joinType": "inner join",
  3201. "condition": []
  3202. },
  3203. "columnName": "兑换码",
  3204. "columnType": "field",
  3205. "fieldParam": {
  3206. "tName": "dbTable_QZcxeDYPsz",
  3207. "tField": "兑换码"
  3208. }
  3209. }
  3210. ]
  3211. }
  3212. }
  3213. ]
  3214. }
  3215. ]
  3216. },
  3217. {
  3218. "id": "group_3NFzCAWJae",
  3219. "name": "活动分类中台相关",
  3220. "type": "group",
  3221. "props": {
  3222. "devId": "group_3NFzCAWJae"
  3223. },
  3224. "children": [
  3225. {
  3226. "id": "bComponent_GiWSTHw8Xe",
  3227. "name": "活动分类管理后台组件",
  3228. "type": "bComponent",
  3229. "props": {
  3230. "devId": "bComponent_GiWSTHw8Xe",
  3231. "moduleId": "module_KQRf23H6p8",
  3232. "dbConnect": [
  3233. {
  3234. "tempId": "dbTableTemp_nr37DhHs56",
  3235. "tableId": "dbTable_kTF3TXAEEB"
  3236. },
  3237. {
  3238. "tempId": "dbTableTemp_DeEzJeMkjd",
  3239. "tableId": "dbTable_xSTwEQ32HH"
  3240. },
  3241. {
  3242. "tempId": "dbTableTemp_pTM2d2xs45",
  3243. "tableId": "dbTable_XdneF2SM7h"
  3244. }
  3245. ]
  3246. }
  3247. },
  3248. {
  3249. "id": "group_hdZjHsBKe5",
  3250. "name": "小程序api相关",
  3251. "type": "group",
  3252. "props": {},
  3253. "children": [
  3254. {
  3255. "id": "service_KpBW3riiDd",
  3256. "name": "活动分类白名单核验服务",
  3257. "type": "service",
  3258. "props": {
  3259. "devId": "service_KpBW3riiDd",
  3260. "isOpen": true,
  3261. "jsCode": "const emitter = new events.EventEmitter();\r\nconst USER_INFO = _F('middle_func').callMethod('last');\r\nconst 用户ID = USER_INFO._id;\r\nconst 手机号 = USER_INFO.手机号;\r\n\r\n\r\nif (!param.hasOwnProperty('批次分类ID')) {\r\n _funcCb({ code: 0, errMsg: '请传入批次分类ID', result: {} });\r\n return;\r\n}\r\n\r\nif (!手机号) {\r\n _funcCb({ code: 0, errMsg: '请先认证手机号', result: {} });\r\n return;\r\n}\r\n\r\nlet inParam = param;\r\n\r\nconst 批次分类ID = param.批次分类ID;\r\nconst 批次分类白名单缓存Key = `stock_cate_whitelist_${批次分类ID}_${用户ID}`;\r\n\r\nemitter.on('getDetailCache', async () => {\r\n //缓存获取\r\n const cacheRes = await _F('bCache_YEHcswD6ad').callMethod('get', {\r\n key: 批次分类白名单缓存Key\r\n }).catch((error) => {\r\n console.log('获取缓存失败');\r\n emitter.emit('checkWhiteList');\r\n });\r\n\r\n try {\r\n if (JSON.parse(cacheRes)) {\r\n console.log('获取缓存成功', cacheRes);\r\n _funcCb({ code: 200, errMsg: '有资格', result: JSON.parse(cacheRes) });\r\n } else {\r\n emitter.emit('checkWhiteList');\r\n }\r\n } catch (error) {\r\n emitter.emit('checkWhiteList');\r\n }\r\n\r\n});\r\n\r\nemitter.on('setDetailCache', async (cacheVal) => {\r\n //设置缓存\r\n await _F('bCache_YEHcswD6ad').callMethod('set', {\r\n key: 批次分类白名单缓存Key,\r\n value: JSON.stringify(cacheVal),\r\n expire: 3600 * 24 * 30\r\n }).catch((error) => {\r\n console.log('设置缓存失败');\r\n });\r\n});\r\n\r\nemitter.on('checkWhiteList', async () => {\r\n const urllib = (await _F('module_func').callMethod('import', 'urllib')).default;\r\n\r\n const url = `https://fwptgzh.sygh.org/wxapi/staffmobile/staffManager/checkPhone?phone=${手机号}`;\r\n\r\n urllib.request(url, {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json'\r\n },\r\n data: {\r\n },\r\n dataType: 'json'\r\n }).then((response) => {\r\n const checkInfo = response.data;\r\n\r\n console.log('checkWhiteList',checkInfo);\r\n\r\n if (checkInfo.code === 200) {\r\n const flag = checkInfo.data.data.flag;\r\n if (!flag ) {\r\n //if (!flag && 手机号 !== '18675866207') {\r\n _funcCb({ code: 0, errMsg: '请实名认证并申领电子会员服务卡', result: checkInfo });\r\n } else {\r\n emitter.emit('setDetailCache', checkInfo);\r\n _funcCb({ code: 200, errMsg: '有资格', result: checkInfo });\r\n }\r\n\r\n } else {\r\n _funcCb({ code: 0, errMsg: '会员资格获取失败,请稍后再试', result: checkInfo });\r\n }\r\n }).catch(err => {\r\n _funcCb({ code: 0, errMsg: '会员资格获取失败,请稍后再试', result: err });\r\n });\r\n\r\n});\r\n\r\n\r\nemitter.emit('getDetailCache');",
  3262. "inParams": [
  3263. "批次分类ID"
  3264. ],
  3265. "outParams": [],
  3266. "openApiPath": "v1/mini/user/stock_cate/whitelist",
  3267. "inParamsDebug": {
  3268. "批次分类ID": ""
  3269. }
  3270. }
  3271. },
  3272. {
  3273. "id": "service_CzHiAYYY7c",
  3274. "name": "活动分类关键字搜索服务",
  3275. "type": "service",
  3276. "props": {
  3277. "devId": "service_CzHiAYYY7c",
  3278. "isOpen": true,
  3279. "jsCode": "const emitter = new events.EventEmitter();\r\n\r\nlet inParam = param || {};\r\n\r\nconst getList = (setCache) => {\r\n _F('bComponent_GiWSTHw8Xe').callMethod('service_MeJ5kQx5GB', {\r\n inParam,\r\n callback: (resp) => {\r\n console.log('getList',resp);\r\n if(resp?.code === 200 && Array.isArray(resp?.result)){\r\n setCache(resp?.result);\r\n }else{\r\n _funcCb(resp)\r\n }\r\n \r\n }\r\n }\r\n );\r\n}\r\n\r\nemitter.on('getCache', async () => {\r\n const reqRes = await _F('service_7w8aDmK8DS').call({\r\n \"缓存名称\": \"stock_cate\",\r\n \"查询参数\": inParam,\r\n \"缓存时间\": 60,\r\n \"查询回调\": getList\r\n });\r\n\r\n _funcCb({code:200,errMsg:'ok',result:reqRes});\r\n});\r\n\r\n\r\nemitter.emit('getCache');",
  3280. "inParams": [
  3281. "搜索条件",
  3282. "当前页码",
  3283. "每页大小"
  3284. ],
  3285. "outParams": [],
  3286. "openApiPath": "v1/mini/user/stock_cate/search",
  3287. "inParamsDebug": {
  3288. "批次号": "",
  3289. "当前页码": "",
  3290. "批次名称": "",
  3291. "是否删除": "",
  3292. "每页大小": ""
  3293. }
  3294. }
  3295. },
  3296. {
  3297. "id": "service_FMa6CiY2fs",
  3298. "name": "活动分类详情服务",
  3299. "type": "service",
  3300. "props": {
  3301. "devId": "service_FMa6CiY2fs",
  3302. "isOpen": true,
  3303. "jsCode": "const emitter = new events.EventEmitter();\r\n\r\nlet inParam = param || {};\r\ninParam.当前页码 = 1;\r\ninParam.每页大小 = 1;\r\n\r\nconst getList = (setCache) => {\r\n _F('bComponent_GiWSTHw8Xe').callMethod('service_MeJ5kQx5GB', {\r\n inParam,\r\n callback: (resp) => {\r\n console.log('getList',resp);\r\n if(resp?.code === 200 && Array.isArray(resp?.result) && resp?.result?.length > 0){\r\n setCache(resp?.result[0]);\r\n }else{\r\n _funcCb(resp)\r\n }\r\n \r\n }\r\n }\r\n );\r\n}\r\n\r\nemitter.on('getCache', async () => {\r\n const reqRes = await _F('service_7w8aDmK8DS').call({\r\n \"缓存名称\": \"stock_cate_detail\",\r\n \"查询参数\": inParam,\r\n \"缓存时间\": 60,\r\n \"查询回调\": getList\r\n });\r\n\r\n _funcCb({code:200,errMsg:'ok',result:reqRes});\r\n});\r\n\r\n\r\nemitter.emit('getCache');",
  3304. "inParams": [
  3305. "搜索条件",
  3306. "当前页码",
  3307. "每页大小"
  3308. ],
  3309. "outParams": [],
  3310. "openApiPath": "v1/mini/user/stock_cate/detail",
  3311. "inParamsDebug": {
  3312. "批次号": "",
  3313. "当前页码": "",
  3314. "批次名称": "",
  3315. "是否删除": "",
  3316. "每页大小": ""
  3317. }
  3318. }
  3319. }
  3320. ]
  3321. },
  3322. {
  3323. "id": "group_PGpJ8Kc2ey",
  3324. "name": "管理后台api相关",
  3325. "type": "group",
  3326. "props": {
  3327. "devId": "group_PGpJ8Kc2ey"
  3328. },
  3329. "children": [
  3330. {
  3331. "id": "service_zwDhc7S3fX",
  3332. "name": "活动分类关键字搜索服务",
  3333. "type": "service",
  3334. "props": {
  3335. "devId": "service_zwDhc7S3fX",
  3336. "isOpen": true,
  3337. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = param;\r\n\r\nemitter.on('getList', ()=>{\r\n _F('bComponent_GiWSTHw8Xe').callMethod('service_MeJ5kQx5GB',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('getList');",
  3338. "inParams": [
  3339. "搜索条件对象",
  3340. "当前页码",
  3341. "每页大小"
  3342. ],
  3343. "outParams": [],
  3344. "openApiPath": "v1/admin/stock_cate/search",
  3345. "inParamsDebug": {
  3346. "批次号": "",
  3347. "当前页码": "",
  3348. "批次名称": "",
  3349. "是否删除": "",
  3350. "每页大小": ""
  3351. }
  3352. }
  3353. },
  3354. {
  3355. "id": "service_3QwFcaxic7",
  3356. "name": "角色删除服务",
  3357. "type": "service",
  3358. "props": {
  3359. "devId": "service_3QwFcaxic7",
  3360. "isOpen": true,
  3361. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = {};\r\nif(param.hasOwnProperty('角色ID'))inParam['角色ID'] = param.角色ID;\r\nif(param.hasOwnProperty('是否删除'))inParam['是否删除'] = param.是否删除 == 1?1:0;\r\n\r\nemitter.on('delDept', ()=>{\r\n _F('bComponent_GiWSTHw8Xe').callMethod('service_FHxSD7RYtT',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('delDept');",
  3362. "inParams": [
  3363. "角色ID",
  3364. "是否删除"
  3365. ],
  3366. "outParams": [],
  3367. "openApiPath": "v1/admin/role/del",
  3368. "inParamsDebug": {
  3369. "部门ID": "1",
  3370. "是否删除": "0",
  3371. "是否禁用": "0",
  3372. "部门名称": "多八多总部2",
  3373. "上级部门ID": "0"
  3374. }
  3375. }
  3376. },
  3377. {
  3378. "id": "service_DCZHEkZa4t",
  3379. "name": "活动分类编辑服务",
  3380. "type": "service",
  3381. "props": {
  3382. "devId": "service_DCZHEkZa4t",
  3383. "isOpen": true,
  3384. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet inParam = param;\r\n\r\nemitter.on('editDept', ()=>{\r\n _F('bComponent_GiWSTHw8Xe').callMethod('service_64NNTKrwb3',{\r\n inParam,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('editDept');",
  3385. "inParams": [
  3386. "批次分类ID",
  3387. "批次分类",
  3388. "分类名称",
  3389. "图片地址"
  3390. ],
  3391. "outParams": [],
  3392. "openApiPath": "v1/admin/stock_cate/edit",
  3393. "inParamsDebug": {
  3394. "分类名称": "",
  3395. "图片地址": "",
  3396. "批次分类": "",
  3397. "批次分类ID": "1"
  3398. }
  3399. }
  3400. },
  3401. {
  3402. "id": "service_r2NnswehMM",
  3403. "name": "活动分类新增服务",
  3404. "type": "service",
  3405. "props": {
  3406. "devId": "service_r2NnswehMM",
  3407. "isOpen": true,
  3408. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('appDept', ()=>{\r\n _F('bComponent_GiWSTHw8Xe').callMethod('service_7nGTY6s3nQ',{\r\n inParam:param,\r\n callback:(data)=>{\r\n _funcCb(data);\r\n }\r\n }\r\n );\r\n});\r\n\r\nemitter.emit('appDept');\r\n",
  3409. "inParams": [
  3410. "批次分类",
  3411. "分类名称",
  3412. "图片地址"
  3413. ],
  3414. "outParams": [],
  3415. "openApiPath": "v1/admin/stock_cate/add",
  3416. "inParamsDebug": {
  3417. "分类名称": "",
  3418. "图片地址": "",
  3419. "批次分类": ""
  3420. }
  3421. }
  3422. }
  3423. ]
  3424. },
  3425. {
  3426. "id": "group_W7FSSXWth7",
  3427. "name": "数据表相关",
  3428. "type": "group",
  3429. "props": {},
  3430. "children": [
  3431. {
  3432. "id": "bCache_YEHcswD6ad",
  3433. "name": "批次分类参加资格白名单缓存",
  3434. "type": "bCache",
  3435. "props": {}
  3436. },
  3437. {
  3438. "id": "bCache_jwAY7zpBCk",
  3439. "name": "批次分类缓存",
  3440. "type": "bCache",
  3441. "props": {}
  3442. },
  3443. {
  3444. "id": "dbTable_XdneF2SM7h",
  3445. "name": "活动分类表",
  3446. "type": "dbTable",
  3447. "props": {
  3448. "fields": [
  3449. {
  3450. "columnName": "_id",
  3451. "columnType": "int unsigned"
  3452. },
  3453. {
  3454. "columnName": "批次分类",
  3455. "columnType": "text"
  3456. },
  3457. {
  3458. "columnName": "分类名称",
  3459. "columnType": "text"
  3460. },
  3461. {
  3462. "columnName": "图片地址",
  3463. "columnType": "json"
  3464. },
  3465. {
  3466. "columnName": "最大领取次数",
  3467. "columnType": "int"
  3468. },
  3469. {
  3470. "columnName": "是否删除",
  3471. "columnType": "int"
  3472. },
  3473. {
  3474. "columnName": "_create",
  3475. "columnType": "bigint unsigned"
  3476. },
  3477. {
  3478. "columnName": "_update",
  3479. "columnType": "bigint unsigned"
  3480. }
  3481. ]
  3482. }
  3483. }
  3484. ]
  3485. }
  3486. ]
  3487. },
  3488. {
  3489. "id": "group_W7cFFPWANW",
  3490. "name": "兑换码中台相关",
  3491. "type": "group",
  3492. "props": null,
  3493. "children": [
  3494. {
  3495. "id": "bComponent_7aiWDzEFX5",
  3496. "name": "兑换码管理后台组件",
  3497. "type": "bComponent",
  3498. "props": {
  3499. "attr": [
  3500. {
  3501. "attrId": "variable_QcWhAZe56c",
  3502. "attrType": "js",
  3503. "attrJsCode": "[\r\n {\r\n dataIndex: \"兑换码\",\r\n operate: \"search|filter|add|eKey\"\r\n },\r\n {\r\n dataIndex: \"兑换状态\",\r\n operate: \"filter|add|edit\",\r\n default:0\r\n },\r\n {\r\n dataIndex: \"批次ID\",\r\n operate: \"add|edit\"\r\n },\r\n {\r\n dataIndex: \"有效期\",\r\n operate: \"add|edit\",\r\n },\r\n {\r\n dataIndex: \"是否删除\",\r\n operate: \"filter|add|edit\",\r\n default:0\r\n },\r\n]"
  3504. }
  3505. ],
  3506. "moduleId": "module_remk87B6S2",
  3507. "dbConnect": [
  3508. {
  3509. "tempId": "dbTableTemp_xiMSY5yJNc",
  3510. "tableId": "dbTable_QZcxeDYPsz"
  3511. },
  3512. {
  3513. "tempId": "dbViewTemp_wfrWwAbZJe",
  3514. "tableId": "dbView_KQNTWsCCSk"
  3515. }
  3516. ]
  3517. }
  3518. },
  3519. {
  3520. "id": "group_Z8ZsXezbJ7",
  3521. "name": "小程序api相关",
  3522. "type": "group",
  3523. "props": {},
  3524. "children": [
  3525. {
  3526. "id": "service_7ezJdf5WMc",
  3527. "name": "编辑兑换码服务",
  3528. "type": "service",
  3529. "props": {
  3530. "devId": "service_编辑兑换码",
  3531. "isOpen": true,
  3532. "jsCode": "\n// 调用组件中的编辑服务\nconst emitter = new events.EventEmitter();\n\nemitter.on('edit', () => {\n _F('bComponent_7aiWDzEFX5').callMethod('service_SmQXCDGN2Z', {\n inParam: param,\n callback: (data) => {\n _funcCb(data);\n }\n });\n});\n\nemitter.emit('edit');\n",
  3533. "inParams": [
  3534. {
  3535. "name": "行ID",
  3536. "default": null
  3537. },
  3538. {
  3539. "name": "兑换码",
  3540. "default": ""
  3541. },
  3542. {
  3543. "name": "兑换状态",
  3544. "default": ""
  3545. },
  3546. {
  3547. "name": "批次ID",
  3548. "default": ""
  3549. },
  3550. {
  3551. "name": "兑换结果",
  3552. "default": ""
  3553. }
  3554. ],
  3555. "outParams": [],
  3556. "openApiPath": "v1/mini/exchange/edit"
  3557. }
  3558. },
  3559. {
  3560. "id": "service_m5wsx5sjia",
  3561. "name": "搜索兑换码服务",
  3562. "type": "service",
  3563. "props": {
  3564. "devId": "service_搜索兑换码",
  3565. "isOpen": true,
  3566. "jsCode": "\n// 调用组件中的搜索服务\nconst emitter = new events.EventEmitter();\n\nemitter.on('search', () => {\n _F('bComponent_7aiWDzEFX5').callMethod('service_HnxkCD6Ys7', {\n inParam: param,\n callback: (data) => {\n _funcCb(data);\n }\n });\n});\n\nemitter.emit('search');\n",
  3567. "inParams": [
  3568. "当前页码",
  3569. "每页大小",
  3570. "搜索条件"
  3571. ],
  3572. "outParams": [],
  3573. "openApiPath": "v1/mini/exchange/search",
  3574. "inParamsDebug": {
  3575. "当前页码": "",
  3576. "搜索条件": {
  3577. "关键字": ""
  3578. },
  3579. "每页大小": ""
  3580. }
  3581. }
  3582. },
  3583. {
  3584. "id": "service_kzW2y2e246",
  3585. "name": "兑换码详情服务",
  3586. "type": "service",
  3587. "props": {
  3588. "devId": "service_kzW2y2e246",
  3589. "isOpen": true,
  3590. "jsCode": "const emitter = new events.EventEmitter();\r\n\r\nlet inParam = param || {};\r\ninParam.当前页码 = 1;\r\ninParam.每页大小 = 1;\r\n\r\nconst getList = (setCache) => {\r\n _F('bComponent_7aiWDzEFX5').callMethod('service_HnxkCD6Ys7', {\r\n inParam,\r\n callback: (resp) => {\r\n console.log('getList', resp);\r\n if (resp?.code === 200 && Array.isArray(resp?.result) && resp?.result?.length > 0) {\r\n setCache(resp?.result[0]);\r\n } else {\r\n _funcCb(resp)\r\n }\r\n\r\n }\r\n }\r\n );\r\n}\r\n\r\nemitter.on('getCache', async () => {\r\n const reqRes = await _F('service_7w8aDmK8DS').call({\r\n \"缓存名称\": \"stock_cate_detail\",\r\n \"查询参数\": inParam,\r\n \"缓存时间\": 60,\r\n \"查询回调\": getList\r\n });\r\n\r\n _funcCb({ code: 200, errMsg: 'ok', result: reqRes });\r\n});\r\n\r\n\r\nemitter.emit('getCache');",
  3591. "inParams": [
  3592. {
  3593. "name": "搜索条件",
  3594. "default": null
  3595. },
  3596. {
  3597. "name": "当前页码",
  3598. "default": ""
  3599. },
  3600. {
  3601. "name": "每页大小",
  3602. "default": ""
  3603. }
  3604. ],
  3605. "outParams": [],
  3606. "openApiPath": "v1/mini/user/exchange/detail"
  3607. }
  3608. }
  3609. ]
  3610. },
  3611. {
  3612. "id": "group_ryxiQZTJmz",
  3613. "name": "管理后台api相关",
  3614. "type": "group",
  3615. "props": null,
  3616. "children": [
  3617. {
  3618. "id": "service_ssSCay8jKM",
  3619. "name": "新增兑换码服务",
  3620. "type": "service",
  3621. "props": {
  3622. "devId": "service_新增兑换码",
  3623. "isOpen": true,
  3624. "jsCode": "\n// 调用组件中的新增服务\nconst emitter = new events.EventEmitter();\n\nemitter.on('add', () => {\n _F('bComponent_7aiWDzEFX5').callMethod('service_8BYpSxRD3x', {\n inParam: param,\n callback: (data) => {\n _funcCb(data);\n }\n });\n});\n\nemitter.emit('add');\n",
  3625. "inParams": [
  3626. {
  3627. "name": "兑换码",
  3628. "default": ""
  3629. },
  3630. {
  3631. "name": "兑换状态",
  3632. "default": ""
  3633. },
  3634. {
  3635. "name": "批次ID",
  3636. "default": ""
  3637. },
  3638. {
  3639. "name": "兑换结果",
  3640. "default": ""
  3641. }
  3642. ],
  3643. "outParams": [],
  3644. "openApiPath": "v1/admin/exchange/add"
  3645. }
  3646. },
  3647. {
  3648. "id": "service_DJXRMdKMad",
  3649. "name": "编辑兑换码服务",
  3650. "type": "service",
  3651. "props": {
  3652. "devId": "service_编辑兑换码",
  3653. "isOpen": true,
  3654. "jsCode": "\n// 调用组件中的编辑服务\nconst emitter = new events.EventEmitter();\n\nemitter.on('edit', () => {\n _F('bComponent_7aiWDzEFX5').callMethod('service_SmQXCDGN2Z', {\n inParam: param,\n callback: (data) => {\n _funcCb(data);\n }\n });\n});\n\nemitter.emit('edit');\n",
  3655. "inParams": [
  3656. {
  3657. "name": "行ID",
  3658. "default": null
  3659. },
  3660. {
  3661. "name": "兑换码",
  3662. "default": ""
  3663. },
  3664. {
  3665. "name": "兑换状态",
  3666. "default": ""
  3667. },
  3668. {
  3669. "name": "批次ID",
  3670. "default": ""
  3671. },
  3672. {
  3673. "name": "兑换结果",
  3674. "default": ""
  3675. }
  3676. ],
  3677. "outParams": [],
  3678. "openApiPath": "v1/admin/exchange/edit"
  3679. }
  3680. },
  3681. {
  3682. "id": "service_Wn8trXc46c",
  3683. "name": "获取兑换码列表服务",
  3684. "type": "service",
  3685. "props": {
  3686. "devId": "service_获取兑换码列表",
  3687. "isOpen": true,
  3688. "jsCode": "\n// 调用组件中的获取列表服务\nconst emitter = new events.EventEmitter();\n\nemitter.on('list', () => {\n _F('bComponent_7aiWDzEFX5').callMethod('service_HnxkCD6Ys7', {\n inParam: param,\n callback: (data) => {\n _funcCb(data);\n }\n });\n});\n\nemitter.emit('list');\n",
  3689. "inParams": [
  3690. {
  3691. "name": "当前页码",
  3692. "default": 1
  3693. },
  3694. {
  3695. "name": "每页大小",
  3696. "default": 10
  3697. },
  3698. {
  3699. "name": "搜索条件",
  3700. "default": {
  3701. "关键字": ""
  3702. }
  3703. }
  3704. ],
  3705. "outParams": [],
  3706. "openApiPath": "v1/admin/exchange/search"
  3707. }
  3708. },
  3709. {
  3710. "id": "service_i28cQzDQe4",
  3711. "name": "批量新增兑换码服务",
  3712. "type": "service",
  3713. "props": {
  3714. "devId": "service_新增兑换码",
  3715. "isOpen": true,
  3716. "jsCode": "// 调用组件中的新增服务\nconst emitter = new events.EventEmitter();\n\nfunction 生成不重复随机数(位数, 个数) {\n // 输入校验\n if (位数 < 1) return '位数必须大于0';\n if (个数 < 1) return '个数必须大于0';\n\n // 最大组合数校验\n if (个数 > Math.pow(10, 位数) - 1) {\n return '个数超过最大组合数'; \n }\n\n // 生成不重复随机数\n let 数组 = [];\n while (数组.length < 个数) {\n let 数字 = Math.floor(Math.random() * Math.pow(10, 位数)).toString().padStart(位数, '0');\n if (!数组.includes(数字)) {\n 数组.push(数字);\n }\n }\n\n return 数组;\n}\nconst 行数组 = [];\nconst 生成数量 = param.生成数量 > 1000 ? 1000 : (param.生成数量 || 1);\nconst 随机数长 = param.随机数长 || 4;\nconst 兑换码 = param.兑换码 || '';\nconst 兑换状态 = param.兑换状态 || 0;\nconst 批次ID = param.批次ID;\nconst 有效期 = param.有效期;\n\n// 使用示例\nlet 不重复随机数数组 = 生成不重复随机数(随机数长, 生成数量);\n\nif (typeof 不重复随机数数组 === 'string') {\n console.log(不重复随机数数组)\n _funcCb({ code: 0, errMsg: 不重复随机数数组, result: {} });\n return;\n} else {\n console.log(不重复随机数数组);\n}\n\nfor (let i = 0; i < 生成数量; i++) {\n\n 行数组.push({\n 兑换码: 兑换码 + 不重复随机数数组[i],\n 兑换状态,\n 批次ID,\n 有效期,\n })\n}\n\nconst inParam = {\n 行数组\n}\n\n\nemitter.on('add', () => {\n _F('bComponent_7aiWDzEFX5').callMethod('service_Fz8RK7rnPj', {\n inParam: inParam,\n callback: (data) => {\n _funcCb(data);\n }\n });\n});\n\nemitter.emit('add');\n",
  3717. "inParams": [
  3718. {
  3719. "name": "兑换码",
  3720. "default": ""
  3721. },
  3722. {
  3723. "name": "兑换状态",
  3724. "default": ""
  3725. },
  3726. {
  3727. "name": "批次ID",
  3728. "default": ""
  3729. },
  3730. {
  3731. "name": "兑换结果",
  3732. "default": ""
  3733. }
  3734. ],
  3735. "outParams": [],
  3736. "openApiPath": "v1/admin/exchange/batch_add"
  3737. }
  3738. },
  3739. {
  3740. "id": "service_y3jTKFCKQd",
  3741. "name": "编辑兑换码服务",
  3742. "type": "service",
  3743. "props": {
  3744. "devId": "service_编辑兑换码",
  3745. "isOpen": true,
  3746. "jsCode": "\n// 调用组件中的编辑服务\nconst emitter = new events.EventEmitter();\n\nemitter.on('edit', () => {\n _F('bComponent_7aiWDzEFX5').callMethod('service_ERbTR6esDz', {\n inParam: param,\n callback: (data) => {\n _funcCb(data);\n }\n });\n});\n\nemitter.emit('edit');\n",
  3747. "inParams": [
  3748. {
  3749. "name": "行ID",
  3750. "default": null
  3751. },
  3752. {
  3753. "name": "是否删除",
  3754. "default": ""
  3755. }
  3756. ],
  3757. "babelCode": "// 调用组件中的编辑服务\nconst emitter = new events.EventEmitter();\nemitter.on('edit', () => {\n _F('bComponent_7aiWDzEFX5').callMethod('service_ERbTR6esDz', {\n inParam: param,\n callback: data => {\n _funcCb(data);\n }\n });\n});\nemitter.emit('edit');",
  3758. "outParams": [],
  3759. "openApiPath": "v1/admin/exchange/del"
  3760. }
  3761. }
  3762. ]
  3763. },
  3764. {
  3765. "id": "group_7Ni8hd6BhC",
  3766. "name": "数据表相关",
  3767. "type": "group",
  3768. "props": {},
  3769. "children": [
  3770. {
  3771. "id": "dbTable_QZcxeDYPsz",
  3772. "name": "兑换码表",
  3773. "type": "dbTable",
  3774. "props": {
  3775. "fields": [
  3776. {
  3777. "columnName": "_id",
  3778. "columnType": "int unsigned"
  3779. },
  3780. {
  3781. "columnName": "兑换码",
  3782. "columnType": "varchar(100)"
  3783. },
  3784. {
  3785. "columnName": "兑换状态",
  3786. "columnType": "int"
  3787. },
  3788. {
  3789. "columnName": "批次ID",
  3790. "columnType": "int"
  3791. },
  3792. {
  3793. "columnName": "有效期",
  3794. "columnType": "int"
  3795. },
  3796. {
  3797. "columnName": "兑换结果",
  3798. "columnType": "text"
  3799. },
  3800. {
  3801. "columnName": "是否删除",
  3802. "columnType": "int"
  3803. },
  3804. {
  3805. "columnName": "_create",
  3806. "columnType": "bigint unsigned"
  3807. },
  3808. {
  3809. "columnName": "_update",
  3810. "columnType": "bigint unsigned"
  3811. }
  3812. ]
  3813. }
  3814. },
  3815. {
  3816. "id": "dbView_KQNTWsCCSk",
  3817. "name": "兑换码+批次视图",
  3818. "type": "dbView",
  3819. "props": {
  3820. "fields": [
  3821. {
  3822. "columnName": "_id",
  3823. "columnType": "int unsigned"
  3824. },
  3825. {
  3826. "columnName": "兑换码",
  3827. "columnType": "varchar(100)"
  3828. },
  3829. {
  3830. "columnName": "兑换状态",
  3831. "columnType": "int"
  3832. },
  3833. {
  3834. "columnName": "批次ID",
  3835. "columnType": "int"
  3836. },
  3837. {
  3838. "columnName": "有效期",
  3839. "columnType": "int"
  3840. },
  3841. {
  3842. "columnName": "兑换结果",
  3843. "columnType": "text"
  3844. },
  3845. {
  3846. "columnName": "是否删除",
  3847. "columnType": "int"
  3848. },
  3849. {
  3850. "columnName": "_create",
  3851. "columnType": "bigint unsigned"
  3852. },
  3853. {
  3854. "columnName": "_update",
  3855. "columnType": "bigint unsigned"
  3856. },
  3857. {
  3858. "columnName": "批次简介",
  3859. "columnType": "text"
  3860. },
  3861. {
  3862. "columnName": "批次名称",
  3863. "columnType": "text"
  3864. },
  3865. {
  3866. "columnName": "批次号",
  3867. "columnType": "text"
  3868. },
  3869. {
  3870. "columnName": "是否上架",
  3871. "columnType": "int"
  3872. },
  3873. {
  3874. "columnName": "制券商户号",
  3875. "columnType": "text"
  3876. }
  3877. ],
  3878. "columns": [
  3879. {
  3880. "field": "",
  3881. "direction": "",
  3882. "joinParam": {
  3883. "lTName": "",
  3884. "rTName": "",
  3885. "lTField": "",
  3886. "rTField": "",
  3887. "joinType": "inner join",
  3888. "condition": []
  3889. },
  3890. "columnName": "*",
  3891. "columnType": "field",
  3892. "fieldParam": {
  3893. "tName": "dbTable_QZcxeDYPsz",
  3894. "tField": "*"
  3895. }
  3896. },
  3897. {
  3898. "field": "",
  3899. "direction": "",
  3900. "joinParam": {
  3901. "lTName": "dbTable_QZcxeDYPsz",
  3902. "rTName": "dbTable_xSTwEQ32HH",
  3903. "lTField": "批次ID",
  3904. "rTField": "_id",
  3905. "joinType": "left join",
  3906. "condition": []
  3907. },
  3908. "columnName": "批次关联",
  3909. "columnType": "join",
  3910. "fieldParam": {
  3911. "tName": "",
  3912. "tField": ""
  3913. }
  3914. },
  3915. {
  3916. "field": "",
  3917. "direction": "",
  3918. "joinParam": {
  3919. "lTName": "",
  3920. "rTName": "",
  3921. "lTField": "",
  3922. "rTField": "",
  3923. "joinType": "inner join",
  3924. "condition": []
  3925. },
  3926. "columnName": "批次简介",
  3927. "columnType": "field",
  3928. "fieldParam": {
  3929. "tName": "dbTable_xSTwEQ32HH",
  3930. "tField": "批次简介"
  3931. }
  3932. },
  3933. {
  3934. "field": "",
  3935. "direction": "",
  3936. "joinParam": {
  3937. "lTName": "",
  3938. "rTName": "",
  3939. "lTField": "",
  3940. "rTField": "",
  3941. "joinType": "inner join",
  3942. "condition": []
  3943. },
  3944. "columnName": "批次名称",
  3945. "columnType": "field",
  3946. "fieldParam": {
  3947. "tName": "dbTable_xSTwEQ32HH",
  3948. "tField": "批次名称"
  3949. }
  3950. },
  3951. {
  3952. "field": "",
  3953. "direction": "",
  3954. "joinParam": {
  3955. "lTName": "",
  3956. "rTName": "",
  3957. "lTField": "",
  3958. "rTField": "",
  3959. "joinType": "inner join",
  3960. "condition": []
  3961. },
  3962. "columnName": "批次号",
  3963. "columnType": "field",
  3964. "fieldParam": {
  3965. "tName": "dbTable_xSTwEQ32HH",
  3966. "tField": "批次号"
  3967. }
  3968. },
  3969. {
  3970. "field": "",
  3971. "direction": "",
  3972. "joinParam": {
  3973. "lTName": "",
  3974. "rTName": "",
  3975. "lTField": "",
  3976. "rTField": "",
  3977. "joinType": "inner join",
  3978. "condition": []
  3979. },
  3980. "columnName": "是否上架",
  3981. "columnType": "field",
  3982. "fieldParam": {
  3983. "tName": "dbTable_xSTwEQ32HH",
  3984. "tField": "是否上架"
  3985. }
  3986. },
  3987. {
  3988. "field": "",
  3989. "direction": "",
  3990. "joinParam": {
  3991. "lTName": "",
  3992. "rTName": "",
  3993. "lTField": "",
  3994. "rTField": "",
  3995. "joinType": "inner join",
  3996. "condition": []
  3997. },
  3998. "columnName": "制券商户号",
  3999. "columnType": "field",
  4000. "fieldParam": {
  4001. "tName": "dbTable_xSTwEQ32HH",
  4002. "tField": "制券商户号"
  4003. }
  4004. }
  4005. ]
  4006. }
  4007. }
  4008. ]
  4009. }
  4010. ]
  4011. }
  4012. ]
  4013. },
  4014. {
  4015. "id": "group_tNcDmx76ti",
  4016. "name": "微信代金券相关",
  4017. "type": "group",
  4018. "props": {},
  4019. "children": [
  4020. {
  4021. "id": "bComponent_67ky8TZdD7",
  4022. "name": "微信支付代金券SDK组件",
  4023. "type": "bComponent",
  4024. "props": {
  4025. "attr": [
  4026. {
  4027. "attrId": "variable_bhTzna4CiM",
  4028. "attrType": "string",
  4029. "attrValue": "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCm9tzs4HJHJCcw rzCzFf9u0Qmr3gdr9WwKqxzQ4n33fOHCE/AYCX+h7j/VtOaZM+YA0G1oyu0ra1xv 2akal8hIDo+d/8LESvxNy0yJBRmtviQge2Elu6dQh9P0bGp5Ozy8Ac9PyoC+PpPa uuHdupIOx8jqLWUR4s8YN9jLbpzRqqtHazrt5eOZcaq5N2xqagjnkcLEm3sgfCQ3 oOBDuwm2eJas/udrZ42v2X0n7cpjqKihHiwUJJVf6KryM7olvdpP4hwYqlf5KsxS Ou0w2P8TrNg5YWEMgZiJfgZrM4sNNkNnCqpirdYJZqojXSR0XB31RjJvr6HUOsBZ 6pMWgJpFAgMBAAECggEAFyUvmRLAJMaJPEF88caB413NBmtAAiJCePQhiX9sUOuZ 7CqRZPOkItGBPeHW+bPtFX3PPPCskhFO/h5hR9N0qzCBjjiPSmDOuwYMtQ3k8mXi YjJYVD/AQPSjWEXTOL0SfUmO8JO05yqLmo2/k9oyNyRQ4M2sLh+P796GCiVqTdIu eyU3ERBPLjUqzITQ341L3Mzs1BjU63QdY80QCggh4gQsCS40aWfdsRXBSdDWz1s4 UnIgRTVyrilH6WZ6t1WESYX4Z1Z0V6EFaVXW5ksX1PHnmByTnVnIiLoixIIkKDZa /fQ5nQEQTFeeYloXoDU1mn+5SmHTWHrWDB/3Gwe1wQKBgQDdHETA/GGk3TaEJRxk s1LEx1hP3OtYsoQ9sMqz9mxOMPN3Oo04Rc6NofmO4BIo8v6zy7E/k94YgbONqeDD fYqneAWT9mwZCulUQfz68Xdr2ANK8fFMbl6sqOuTL5oGSN/iSfQIjW2Uw02rlS+S LdNJBs2QXuu96HNSKrfZtT7BFQKBgQDBT141AuuRbI+oQ5UzRL0OPwd/yCqDL5Sh +KLWL7cp64YiwxygFRsDIIQku7k8RkEyzqZqZHFvRNWA2HH01KioEFoKQKbL4FNO AugUkKXKkv6M9/hbzFZvQiJ71lRSdWx3I+37qLXOb4zfDYfTwOOvGKUauNh32TuJ 1BGxUi/gcQKBgE2z3HmRd+MPFlR0EjlVR3X9tAxEz7QY8B4Z3fJGXCNSUo0I1436 Ai+Fx4StO9SGKHoY0A5OsZMdKXNUSreIi8x0gklQJQbb7cl9cyDg8J3GiMmyoqDA fKbiqf7MkK06uOr2IDtNMEBCLi5pPBF75y9Xo6/jm6beZIBwoLFyXz5NAoGBAJ45 YnitfTc4zpUBTDv8hWoFuROkOPfLmDLDGjWKNLfBKbeGUAXPgJ6cnMycQs/NCUyW zKvErvxOMRsXDp9A+RMm3ywJIv05DbaKtn8uriUTD/s+dDBfHlhOn38RPU+JAVC7 Pe2Ad98SexGPN5/g//uvhmRK7BOc4Ri9VgX3qWxhAoGAc3vcDqXCOdSHJGghBTQC RCBbEYgB27v0nIyeKZCT0HFkAPQHYNJ5Mu9XNkhzl76VYbjhthnf0PeFQSC2+bLa u204zhvdpnwNfnaLA6Re+H7iS11If1zV5SGiauAyH4T7gWSm//cdhkxdaEDxHj7a /BN9q7r60busY4eAkM+Q73w=",
  4030. "attrJsCode": ""
  4031. },
  4032. {
  4033. "attrId": "variable_F6Pac3TGrQ",
  4034. "attrType": "string",
  4035. "attrValue": "1524075161",
  4036. "attrJsCode": ""
  4037. },
  4038. {
  4039. "attrId": "variable_64jPC6yNCs",
  4040. "attrType": "string",
  4041. "attrValue": "5FD0E925D16E68FC5F74F9DF30F9923080520FF2",
  4042. "attrJsCode": ""
  4043. },
  4044. {
  4045. "attrId": "variable_ZZKxrnEpKw",
  4046. "attrType": "string",
  4047. "attrValue": "wx90d230c69b82b4c0",
  4048. "attrJsCode": ""
  4049. },
  4050. {
  4051. "attrId": "variable_CECZhxwhdG",
  4052. "attrType": "string",
  4053. "attrValue": "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCgLrTMgT2iemi5 i1E6foYRKDYhqpd+7QkLajRvaA0wQOyhj63tEZfSFZnlLBGenLVFA/EW3rS2ThtJ g2lQDJ7q7Z5CmYVIfubM0jUKa4Raa7XumRVNnSCA4y4NSY0mkn/fVULs37KoUhwO fFXteKzC7BvLuieYlkbeEnnaZIU/+SXLHINFi5+n84q0zFfOAh5BsiQnaSyCdZgH 1NVGtadspKzZfXFUpOSxhvmTvpePgHtsnxWly1xjhtKIzFZAmo+bM0nxOGPU6q6g c5KmJ1ftGqcejI/3MNOwffhuObLGMsyJGSAK3AQL6TTAtwHj98LIeOPhATVwKnhC xSYpU0ZXAgMBAAECggEAbogsPF4GUOLU9wvarll2W8p6p/qWdYBNWHId4q5TQ3PZ lZaWttsH/3DmdAxX0DJkp04UA+sDmjUFgVHLzvAWjRgQt/ZF0YO38agv75PHjbl7 njxGRfth3W5mbcbOPsqisFKeTuQB3UJjl99WT/qQhCT2/Trkbdds6XqoWPo6NKy5 RN8QBZGopojs3XascpIUstAk0k6Ut1084AEjjqxZmp0DBu3WjVe7xLDf3hpeLLBY cNV8ZJ/YarBwJszGle1f+GKeDpW/pkcC34DziVsSrezlURlXHfuAhRw9eXctFGgs iAgD6V/3xapeWG7HwXwMqA5WAex+jh8al72Z0Ls5SQKBgQDP79E5UTyX4tPOcINx g1sW/5BfG8tyO21WHq6W2pjQv9eYpjiYsM01XmR5DU2sAtRdlUvRvOCnLSrxJAS7 shNAlIXT1jlwAyVewyeKKuPbSFljafcg6sSweEOqxN7lBg63NFJQb1SQQicxC9Zd +QVxzwg2iFxg3TW1LtPz934dfQKBgQDFNSKmfQrYJmQPN+sfZwQS8WGHn2yHeMY3 f8RmFUxwYNRFLCjhBc6thyGvCONYwJuJBbpAZ7fcq8bcHc323qQT4Jrp+GXhz+kG fFsuabv16mn3pAn+rdlWgk6LD4YBDpwqwCdm8qIRl3dZFZvx6ruHqcIdEp3RzWrg gmxyQaeLYwKBgGvoTjFqgQFpSvWE2hGcUzcaJPfWWrvLLzBT99J9WnRqOh4TlKdY iQW7GHThfH9ZcI+oHJKZbBQVkoVVZcdp4CfRa6nFMEV6vHfy2qAPJfP0Fb9LjF3e t3fE0YjbZbiAbj6Qvm7Td5TtX51KQVK/Gh43jFGQbjAuW+LMjF29AAuZAoGBAI0v IFJ/PO9IdOQsTWla8CC7rO5SpXlLbuU21J2c6++ccvvexJls9e1nzCaqv1C/+9oa PqBzYL9cP29A6z6tYFxWtbGBwzbqCVM6XnEZA5boLts7Fmi9f9aeTari/zXshsNY dB0Q4hSkEq61eMK2IXHbh/wWYuRcIwL+fLND67YvAoGBAJdrQzE5c9uoxN8/5QIL t2D/lOAVDoxm3whXllB0Zc633iE9oAg+HBTPcg/XfO12bb9PXitWNNjZmox8roYW Kp52vN7kGkNiw1L/h801pxWat4Giaf1BSq1JeEG/Y7qmI8Oz3aXLbGTT6cb4dCJQ 4jn00sOMnuevyziwnmaU7AtD",
  4054. "attrJsCode": ""
  4055. },
  4056. {
  4057. "attrId": "variable_WGWwxWXhtP",
  4058. "attrType": "string",
  4059. "attrValue": "1395928102",
  4060. "attrJsCode": ""
  4061. },
  4062. {
  4063. "attrId": "variable_Ye37GiY7pQ",
  4064. "attrType": "string",
  4065. "attrValue": "2DD0F3A8FEB0197E85C7B681EB8A135E1D0F181B",
  4066. "attrJsCode": ""
  4067. },
  4068. {
  4069. "attrId": "variable_TKQnZxySr4",
  4070. "attrType": "string",
  4071. "attrValue": "wxfea9bdc8104eede9",
  4072. "attrJsCode": ""
  4073. }
  4074. ],
  4075. "moduleId": "module_PEK2CxS7xC"
  4076. }
  4077. },
  4078. {
  4079. "id": "service_iHnrcE62Mz",
  4080. "name": "查询代金券批次详情服务",
  4081. "type": "service",
  4082. "props": {
  4083. "isSync": true,
  4084. "jsCode": "const inParam = {\r\n openid: 'oPC5r5bZArKsVFeH4I7fO1p1y4yk',\r\n couponId: '31829742841'\r\n};\r\nconst signRes = await _F('bComponent_67ky8TZdD7').callMethod('service_7cSwKHSNyz', { inParam });\r\n\r\n_funcCb(signRes);"
  4085. }
  4086. },
  4087. {
  4088. "id": "service_SW2Max85Rd",
  4089. "name": "发放代金券批次服务",
  4090. "type": "service",
  4091. "props": {
  4092. "isSync": true,
  4093. "jsCode": "const inParam = {\r\n openid: 'oP-y45xbf7hrhC6yeabpjXzIhUWg',\r\n stock_id: '17615961-',\r\n out_request_no: '65436353535435',\r\n stock_creator_mchid: '1524075161',\r\n};\r\nconst signRes = await _F('bComponent_67ky8TZdD7').callMethod('service_FFZCEpzHrA', { inParam });\r\n\r\n_funcCb(signRes);"
  4094. }
  4095. },
  4096. {
  4097. "id": "service_e4PWFA4NzR",
  4098. "name": "条件查询批次列表服务",
  4099. "type": "service",
  4100. "props": {
  4101. "isSync": true,
  4102. "jsCode": "const inParam = {\r\n offset: 1,\r\n limit: 10,\r\n stock_creator_mchid: '1395928102',\r\n // status: 'stoped',\r\n};\r\nconst signRes = await _F('bComponent_67ky8TZdD7').callMethod('service_x7kn8sGBdy', { inParam });\r\n\r\n_funcCb(signRes);"
  4103. }
  4104. },
  4105. {
  4106. "id": "service_QYBtQypeiF",
  4107. "name": "创建代金券批次服务",
  4108. "type": "service",
  4109. "props": {
  4110. "isSync": true,
  4111. "jsCode": "const inParam = {\r\n body: {\r\n \"stock_name\": \"微信支付代金券批次\",\r\n \"comment\": \"零售批次\",\r\n \"belong_merchant\": \"1524075161\",\r\n \"available_begin_time\": \"2023-06-08T15:10:35+08:00\",\r\n \"available_end_time\": \"2023-06-18T13:29:35+08:00\",\r\n \"stock_use_rule\": {\r\n \"max_coupons\": 100,\r\n \"max_amount\": 1000,\r\n \"max_amount_by_day\": 400,\r\n \"max_coupons_per_user\": 3,\r\n \"natural_person_limit\": false,\r\n \"prevent_api_abuse\": false\r\n },\r\n \"pattern_info\": {\r\n \"description\": \"微信支付营销代金券\",\r\n \"merchant_logo\": \"https://qpic.cn/xxx\",\r\n \"merchant_name\": \"微信支付\",\r\n \"background_color\": \"COLOR020\",\r\n \"coupon_image\": \"https://qpic.cn/xxx\"\r\n },\r\n \"coupon_use_rule\": {\r\n\r\n \"fixed_normal_coupon\": {\r\n \"coupon_amount\": 10,\r\n \"transaction_minimum\": 20\r\n },\r\n\r\n \"goods_tag\": [\r\n \"123321\",\r\n \"123322\"\r\n ],\r\n \"trade_type\": [\"OTHER\", \"APPPAY\"],\r\n \"combine_use\": false,\r\n \"available_items\": [\r\n \"123321\",\r\n \"123322\"\r\n ],\r\n \"available_merchants\": [\r\n \"1524075161\",\r\n ]\r\n },\r\n \"no_cash\": true,\r\n \"stock_type\": \"NORMAL\",\r\n \"out_request_no\": \"895600020176543\"\r\n }\r\n};\r\nconst signRes = await _F('bComponent_67ky8TZdD7').callMethod('service_z8227dt5h3', { inParam });\r\n\r\n_funcCb(signRes);"
  4112. }
  4113. },
  4114. {
  4115. "id": "service_aPTkBiZjQD",
  4116. "name": "激活代金券批次服务",
  4117. "type": "service",
  4118. "props": {
  4119. "isSync": true,
  4120. "jsCode": "const inParam = {\r\n stock_id: '17615961',\r\n stock_creator_mchid: '1524075161',\r\n};\r\nconst signRes = await _F('bComponent_67ky8TZdD7').callMethod('service_kx2ADaXesE', { inParam });\r\n\r\n_funcCb(signRes);"
  4121. }
  4122. },
  4123. {
  4124. "id": "group_FAX5mWD7dd",
  4125. "name": "回收站",
  4126. "type": "group",
  4127. "props": {},
  4128. "children": [
  4129. {
  4130. "id": "state_M8JDM7k7NM",
  4131. "type": "state",
  4132. "children": [
  4133. {
  4134. "id": "variable_MyfrJ3SPZ5",
  4135. "type": "variable",
  4136. "props": {}
  4137. },
  4138. {
  4139. "id": "variable_CTPr2AxBiA",
  4140. "name": "apiV3私钥",
  4141. "type": "variable",
  4142. "props": {
  4143. "value": ""
  4144. }
  4145. }
  4146. ]
  4147. },
  4148. {
  4149. "id": "service_G7wKRyHE4w",
  4150. "name": "计算微信支付V3签名串服务",
  4151. "type": "service",
  4152. "props": {
  4153. "isSync": true,
  4154. "jsCode": "const inParam = {\r\n httpMethod:'GET',\r\n url:'https://api.mch.weixin.qq.com/v3/marketing/favor/users/oP-y45xbf7hrhC6yeabpjXzIhUWg/coupons/31829742841?appid=wx90d230c69b82b4c0',\r\n body:''\r\n};\r\nconst signRes = await _F('bComponent_67ky8TZdD7').callMethod('service_nmMHiZNT3M',{inParam});\r\n\r\n_funcCb(signRes);"
  4155. }
  4156. },
  4157. {
  4158. "id": "service_B87a2TQtA8",
  4159. "name": "生成一个16位的随机串2",
  4160. "type": "service",
  4161. "props": {
  4162. "isSync": false,
  4163. "jsCode": "function generateNonceStr(length = 32) {\r\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r\n const maxPos = chars.length;\r\n let nonceStr = '';\r\n for (let i = 0; i < length; i++) {\r\n nonceStr += chars.charAt(Math.floor(Math.random() * maxPos));\r\n }\r\n return nonceStr;\r\n}\r\n\r\nconst str = generateNonceStr(16)\r\n\r\nconsole.log(str); // 生成一个16位的随机串\r\n\r\n_funcCb(str)"
  4164. }
  4165. },
  4166. {
  4167. "id": "service_5rabdPZ3zm",
  4168. "name": "计算微信支付V3签名串服务7",
  4169. "type": "service",
  4170. "props": {
  4171. "isSync": true,
  4172. "jsCode": "const crypto = await Import('crypto');\r\nconst urllib = await Import('urllib');\r\nconst { URL } = await Import('url');\r\n\r\nfunction generateWechatPayV3Signature(httpMethod, url, body, mch_private_key, merchant_id, serial_no, nonce) {\r\n \r\n const privateKey = `-----BEGIN PRIVATE KEY-----\\n${mch_private_key}\\n-----END PRIVATE KEY-----`;\r\n\r\n const timestamp = Math.floor(Date.now() / 1000);\r\n\r\n const urlParts = new URL(url);\r\n const canonicalUrl = urlParts.pathname + (urlParts.search || '');\r\n\r\n const message = `${httpMethod}\\n${canonicalUrl}\\n${timestamp}\\n${nonce}\\n${body}\\n`;\r\n //const message = `GET\\n/v3/marketing/favor/users/oP-y45xbf7hrhC6yeabpjXzIhUWg/coupons/31829742841?appid=wx90d230c69b82b4c0\\n1686129065\\nrl6KrYyF6Zx5nAPeqOJSqLoTJs3gBzkk\\n\\n`;\r\n console.log('message',JSON.stringify(message));\r\n\r\n const sign = crypto.createSign('RSA-SHA256');\r\n sign.write(message);\r\n sign.end();\r\n const rawSign = sign.sign(privateKey, 'base64');\r\n\r\n const schema = 'WECHATPAY2-SHA256-RSA2048';\r\n const token = `${schema} mchid=\"${merchant_id}\",nonce_str=\"${nonce}\",timestamp=\"${timestamp}\",serial_no=\"${serial_no}\",signature=\"${rawSign}\"`;\r\n\r\n return token;\r\n}\r\nfunction generateNonceStr(length = 32) {\r\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r\n const maxPos = chars.length;\r\n let nonceStr = '';\r\n for (let i = 0; i < length; i++) {\r\n nonceStr += chars.charAt(Math.floor(Math.random() * maxPos));\r\n }\r\n return nonceStr;\r\n}\r\n\r\nconsole.log('param',param);\r\n\r\n// 调用示例\r\nconst httpMethod = param.httpMethod;\r\n//const url = param.url;\r\n//const body = JSON.stringify(param.body) || '';\r\nconst body = '';\r\n// const mch_private_key = _F('variable_bhTzna4CiM').callMethod('get');\r\n// const merchant_id = _F('variable_F6Pac3TGrQ').callMethod('get');\r\n// const serial_no = _F('variable_64jPC6yNCs').callMethod('get');\r\n\r\nconst mch_private_key = _F('variable_CTPr2AxBiA').callMethod('get');\r\nconst merchant_id = '1524075161';\r\nconst serial_no = '5FD0E925D16E68FC5F74F9DF30F9923080520FF2';\r\nconst nonce = generateNonceStr(16);\r\n\r\nconst openid = 'oP-y45xbf7hrhC6yeabpjXzIhUWg';\r\nconst couponId = '31829742841';\r\nconst appid = 'wx90d230c69b82b4c0';\r\nconst url = `https://api.mch.weixin.qq.com/v3/marketing/favor/users/${openid}/coupons/${couponId}?appid=${appid}`;\r\n\r\nconst signature = generateWechatPayV3Signature(httpMethod, url, body, mch_private_key, merchant_id, serial_no, nonce);\r\nconsole.log(signature);\r\n\r\n// 发送请求\r\n//\r\n\r\nconsole.log(urllib);\r\n\r\nconst reqRes = await urllib.request(url, {\r\n method: httpMethod,\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Authorization': signature,\r\n 'Accept': 'application/json',\r\n 'User-Agent': 'Your User Agent'\r\n },\r\n});\r\n\r\n_funcCb(reqRes.data.toString());\r\n",
  4173. "inParams": [
  4174. "httpMethod",
  4175. "url",
  4176. "body"
  4177. ],
  4178. "inParamsDebug": {
  4179. "url": "https://api.mch.weixin.qq.com/v3/certificates",
  4180. "body": "",
  4181. "httpMethod": "GET"
  4182. }
  4183. }
  4184. },
  4185. {
  4186. "id": "service_dGZdbA7Mmi",
  4187. "name": "读取私钥base64",
  4188. "type": "service",
  4189. "props": {
  4190. "isSync": true,
  4191. "jsCode": "const crypto = await Import('crypto');\r\n\r\nfunction readPrivateKey() {\r\n const privateKeyData = `-----BEGIN PRIVATE KEY-----\r\n${_F('variable_CTPr2AxBiA').callMethod('get')}\r\n-----END PRIVATE KEY-----`;\r\n const privateKey = crypto.createPrivateKey({\r\n key: privateKeyData,\r\n format: 'pem',\r\n passphrase: 'your_passphrase' // 如果私钥有密码,请提供密码,否则可以省略此行\r\n });\r\n\r\n return privateKey;\r\n}\r\n\r\n// 使用示例\r\nconst privateKey = readPrivateKey();\r\n\r\nconsole.log('privateKey',privateKey);\r\n\r\n_funcCb('234242');\r\n"
  4192. }
  4193. }
  4194. ]
  4195. }
  4196. ]
  4197. },
  4198. {
  4199. "id": "group_abFAbG8Csp",
  4200. "name": "腾讯云sts相关",
  4201. "type": "group",
  4202. "props": {},
  4203. "children": [
  4204. {
  4205. "id": "service_s5zkfwxdXE",
  4206. "name": "获取cos sts",
  4207. "type": "service",
  4208. "props": {
  4209. "isSync": true,
  4210. "jsCode": "const tencentcloud = await Import(\"tencentcloud-sdk-nodejs\");\r\n\r\n\r\nconst StsClient = tencentcloud.sts.v20180813.Client;\r\n\r\nconst Bucket = _F('variable_cs76GrPQBS').callMethod('get');\r\nconst Region = _F('variable_5Fder6BiDX').callMethod('get');\r\nconst SecretId = _F('variable_AfFA3mx7bR').callMethod('get');\r\nconst SecretKey = _F('variable_KKzzykcBtS').callMethod('get');\r\nconst BucketName = Bucket?.split('-')[0];\r\nconst BucketUid = Bucket?.split('-')[1];\r\nconst Policy = {\r\n \"version\": \"2.0\",\r\n \"statement\": [\r\n {\r\n \"action\": [\r\n // \"name/cos:PutObject\",\r\n \"name/cos:PostObject\",\r\n // \"name/cos:InitiateMultipartUpload\",\r\n // \"name/cos:ListMultipartUploads\",\r\n // \"name/cos:ListParts\",\r\n // \"name/cos:UploadPart\",\r\n // \"name/cos:CompleteMultipartUpload\"\r\n ],\r\n \"effect\": \"allow\",\r\n \"resource\": [\r\n `qcs::cos:${Region}:uid/${BucketUid}:prefix//${BucketUid}/${BucketName}/*`\r\n ]\r\n }\r\n ]\r\n}\r\n\r\nconst clientConfig = {\r\n\tcredential: {\r\n\t\tsecretId:SecretId,\r\n\t\tsecretKey: SecretKey,\r\n\t},\r\n\tregion: Region,\r\n\tprofile: {\r\n\t\thttpProfile: {\r\n\t\t\tendpoint: \"sts.tencentcloudapi.com\",\r\n\t\t},\r\n\t},\r\n};\r\n\r\nconst client = new StsClient(clientConfig);\r\nconst params = {\r\n\t\"Name\": BucketName,\r\n\t\"Policy\": encodeURIComponent(JSON.stringify(Policy)),\r\n\t\"DurationSeconds\": 600\r\n};\r\nclient.GetFederationToken(params).then(\r\n\t(data) => {\r\n\t\tconsole.log(data);\r\n\t\t//return data;\r\n\t\t_funcCb({code:200,errMsg:'ok',result:data});\r\n\t},\r\n\t(err) => {\r\n\t\tconsole.error(\"error\", err);\r\n\t\t//return err;\r\n\t\t_funcCb({code:0,errMsg:'fail',result:err});\r\n\t}\r\n);\r\n"
  4211. }
  4212. },
  4213. {
  4214. "id": "service_H5ynAy5GEG",
  4215. "name": "sts 混合",
  4216. "type": "service",
  4217. "props": {
  4218. "isOpen": false,
  4219. "isSync": true,
  4220. "jsCode": "var COS = await Import('cos-nodejs-sdk-v5');\r\n\r\n\r\nvar Bucket = _F('variable_cs76GrPQBS').callMethod('get');\r\nvar Region = _F('variable_5Fder6BiDX').callMethod('get');\r\nvar Key = param.name;\r\nvar protocol = 'https:';\r\nvar url = protocol + '//' + Bucket + '.cos.' + Region + '.myqcloud.com/';\r\n\r\n\r\n_F('service_s5zkfwxdXE').call(param, (result) => {\r\n\r\n if (result.code === 200) {\r\n\r\n const Credentials = result.result.Credentials;\r\n\r\n var cosAuth = COS.getAuthorization({\r\n SecretId: Credentials.TmpSecretId,\r\n SecretKey: Credentials.TmpSecretKey,\r\n Pathname:'/',\r\n Key,\r\n Method: param.method,\r\n })\r\n\r\n _funcCb({\r\n code: 200, errMsg: 'ok', result: {\r\n url,\r\n fields: {\r\n key: Key,\r\n signature: cosAuth,\r\n 'x-cos-security-token': Credentials.Token,\r\n 'Content-Type': ''\r\n }\r\n }\r\n });\r\n }else{\r\n _funcCb(result);\r\n }\r\n\r\n})\r\n\r\n",
  4221. "inParams": [
  4222. "name",
  4223. "method"
  4224. ],
  4225. "openApiPath": "v1/admin/cos_sts/presign",
  4226. "inParamsDebug": {
  4227. "name": "abc.jpg",
  4228. "method": "post"
  4229. }
  4230. }
  4231. },
  4232. {
  4233. "id": "service_atYdTsxFTW",
  4234. "name": "获取cos 预签名 小程序",
  4235. "type": "service",
  4236. "props": {
  4237. "isOpen": true,
  4238. "jsCode": "_F('service_H5ynAy5GEG').call(param,(result)=>{\r\n _funcCb(result);\r\n})\r\n\r\n",
  4239. "openApiPath": "v1/mini/user/cos_sts/presign"
  4240. }
  4241. },
  4242. {
  4243. "id": "service_wTZ2cytRNj",
  4244. "name": "获取cos 预签名 管理后台",
  4245. "type": "service",
  4246. "props": {
  4247. "isOpen": true,
  4248. "jsCode": "_F('service_H5ynAy5GEG').call(param,(result)=>{\r\n _funcCb(result);\r\n})\r\n\r\n",
  4249. "openApiPath": "v1/admin/cos_sts/presign"
  4250. }
  4251. }
  4252. ]
  4253. }
  4254. ]
  4255. }
  4256. ]
  4257. },
  4258. {
  4259. "id": "modules_xmCxQ8xRQA",
  4260. "name": "模块",
  4261. "type": "modules",
  4262. "props": {},
  4263. "children": [
  4264. {
  4265. "id": "module_Rn2saN62Y8",
  4266. "name": "用户中台模块",
  4267. "type": "module",
  4268. "props": {
  4269. "devId": "module_Rn2saN62Y8",
  4270. "appModuleId": "7",
  4271. "appModuleVersion": 76
  4272. },
  4273. "children": [
  4274. {
  4275. "id": "config_DrYAQPCmzh",
  4276. "name": "用户中台模块",
  4277. "type": "config",
  4278. "props": {
  4279. "style": {}
  4280. }
  4281. },
  4282. {
  4283. "id": "front_EzBatPxrZJ",
  4284. "name": "前台",
  4285. "type": "front",
  4286. "props": {
  4287. "style": {
  4288. "width": "100%",
  4289. "height": "100%",
  4290. "display": "flex",
  4291. "overflow": "hidden auto",
  4292. "alignItems": "flex-start",
  4293. "flexDirection": "column",
  4294. "backgroundColor": "#ffffff"
  4295. }
  4296. },
  4297. "children": [
  4298. {
  4299. "id": "props_fsQ2FEWfrQ",
  4300. "type": "props",
  4301. "children": [
  4302. {
  4303. "id": "fPAttr_3tfS7BQT3t",
  4304. "type": "fPAttr",
  4305. "children": []
  4306. },
  4307. {
  4308. "id": "fPMethod_J72YiPd38d",
  4309. "type": "fPMethod",
  4310. "children": []
  4311. },
  4312. {
  4313. "id": "fPEvent_tC3XrhNzXP",
  4314. "type": "fPEvent",
  4315. "children": []
  4316. }
  4317. ]
  4318. },
  4319. {
  4320. "id": "state_kZGeEDT6hf",
  4321. "type": "state",
  4322. "children": []
  4323. },
  4324. {
  4325. "id": "method_ip6fsHjBhe",
  4326. "type": "method",
  4327. "children": []
  4328. },
  4329. {
  4330. "id": "dom_xm6yMC3fPC",
  4331. "type": "dom",
  4332. "children": []
  4333. }
  4334. ]
  4335. },
  4336. {
  4337. "id": "backend_hMYYB26yzB",
  4338. "name": "后台",
  4339. "type": "backend",
  4340. "props": {
  4341. "style": {
  4342. "height": "200px",
  4343. "backgroundColor": "red"
  4344. }
  4345. },
  4346. "children": [
  4347. {
  4348. "id": "props_XDTzsbpzzF",
  4349. "type": "props",
  4350. "children": [
  4351. {
  4352. "id": "bPAttr_jZjJ5nRTdX",
  4353. "type": "bPAttr",
  4354. "children": []
  4355. },
  4356. {
  4357. "id": "bPMethod_5Af6az6k6J",
  4358. "type": "bPMethod",
  4359. "children": [
  4360. {
  4361. "id": "service_amBQpHZ56h",
  4362. "name": "编辑用户信息",
  4363. "type": "service",
  4364. "props": {
  4365. "devId": "service_amBQpHZ56h",
  4366. "isOpen": false,
  4367. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(!param.用户ID){\r\n _funcCb({code:0,errMsg:'请传入用户ID',result:{}});\r\n return;\r\n}\r\n\r\nlet editObj = {};\r\nif(param.昵称)editObj.昵称 = param.昵称;\r\nif(param.手机号)editObj.手机号 = param.手机号;\r\n\r\nemitter.on('editUser', ()=>{\r\n _F('dbTableTemp_6xG6thEJQS').callMethod('editRow',{\r\n row:editObj,\r\n condition:{\r\n _id:param.用户ID,\r\n },\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'编辑用户成功',result:data});\r\n },\r\n fail:(err)=>{\r\n _funcCb({code:0,errMsg:'编辑用户失败',result:err});\r\n }\r\n });\r\n});\r\n\r\nemitter.emit('editUser');",
  4368. "inParams": [
  4369. "用户ID",
  4370. "昵称",
  4371. "手机号"
  4372. ],
  4373. "outParams": [],
  4374. "openApiPath": "",
  4375. "inParamsDebug": {}
  4376. }
  4377. },
  4378. {
  4379. "id": "service_DE3rN7bad6",
  4380. "name": "用户名密码登录",
  4381. "type": "service",
  4382. "props": {
  4383. "devId": "service_DE3rN7bad6",
  4384. "isOpen": false,
  4385. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(用户名==用户名,密码 == 密码)\r\nconst emitter = new events.EventEmitter(); \r\nlet userInfo = null;\r\nlet userToken = null;\r\nlet userLoginTokenKey = 'userLoginToken';//用户登录串缓存key\r\nlet userLoginTokenSetKey = 'userLoginTokenSet';//用户登录串缓存集合key \r\nlet userTokenSet = [];//用户登录串缓存key集合\r\nlet multLogin = param.允许多端登录?true:false;\r\nlet useCookie = param.使用cookie?true:false;\r\nlet cookieHost = param.cookie域名?param.cookie域名:'';\r\nlet loginExpire = param.登录有效时长 > 0?param.登录有效时长:3600;\r\n\r\nemitter.on('showError',(errMsg,result)=>{\r\n\t_funcCb({code:0,errMsg,result:result || {}});\r\n});\r\n\r\nif(!param.用户名){\r\n _funcCb({code:0,errMsg:'请传入用户名',result:{}});\r\n return;\r\n}\r\n\r\nif(!param.密码){\r\n _funcCb({code:0,errMsg:'请传入密码',result:{}});\r\n return;\r\n}\r\n\r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('dbTableTemp_6xG6thEJQS').callMethod('getRow',{\r\n condition:{\r\n 用户名: param.用户名,\r\n 密码: param.密码,\r\n },\r\n success:(data)=>{\r\n if(Array.isArray(data) && data.length <= 0 ) \r\n \temitter.emit('noUserInfo');\r\n else{\r\n\t\t\t\tuserInfo = data[0];\r\n\t\t\t\temitter.emit('getUserToken');\r\n\t\t\t\temitter.emit('setUserLoginTokenKey');\r\n\t\t\t\temitter.emit('getUserTokenSet');\r\n\t\t\t}\r\n \t\r\n },\r\n fail:(err)=>{\r\n emitter.emit('showError','获取用户信息失败',err);\r\n }\r\n });\r\n});\r\n\r\nemitter.on('noUserInfo',()=>{\r\n\t_funcCb({code:0,errMsg:'用户名或密码不正确',result:{}});\r\n});\r\n\r\nemitter.on('setUserLoginTokenKey',()=>{\r\n\tuserLoginTokenKey = `${userLoginTokenKey}:${userToken}`;\r\n\tuserLoginTokenSetKey = `${userLoginTokenSetKey}:${userInfo._id}`;\r\n});\r\n\r\nemitter.on('getUserToken',()=>{\r\n\t_F('service_xk6eian5Dd').call({},(data)=>{\r\n\t\tuserToken = data.result;\r\n\t});\r\n\t\r\n});\r\n\r\nemitter.on('getUserTokenSet',()=>{\r\n\t_F('bCacheTemp_wJfaNQwj3d').callMethod('get',{\r\n\t\t\tkey:userLoginTokenSetKey,\r\n\t\t\tsuccess:(data)=>{\r\n\t\t\t\tif(data)\r\n\t\t\t\t\tuserTokenSet = JSON.parse(data);\r\n\t\t\t\t\r\n\t\t\t\temitter.emit('checkMultLogin');\r\n\t\t\t\temitter.emit('checkUseCookie');\r\n\t\t\t},\r\n\t\t\tfail:()=>{\r\n\t\t\t}\r\n\t\t});\r\n\t\r\n});\r\n\r\nemitter.on('delUserToken',(token)=>{\r\n\t//调用 后台缓存redis组件.缓存删除(用户登录串缓存key)\r\n\t\t_F('bCacheTemp_wJfaNQwj3d').callMethod('del',{\r\n\t\t\tkey:`userLoginToken:${token}`,\r\n\t\t\tsuccess:(data)=>{\r\n\t\t\t},\r\n\t\t\tfail:()=>{\r\n\t\t\t}\r\n\t\t});\r\n});\r\n\r\nemitter.on('setUserToken',()=>{\r\n\t\t_F('bCacheTemp_wJfaNQwj3d').callMethod('set',{\r\n\t\t\tkey:userLoginTokenKey,\r\n\t\t\tvalue:JSON.stringify(userInfo),\r\n\t\t\texpire:loginExpire,\r\n\t\t\tsuccess:(data)=>{\r\n\t\t\t},\r\n\t\t\tfail:()=>{\r\n\t\t\t}\r\n\t\t});\r\n});\r\n\r\nemitter.on('setCookie',()=>{\r\n\t\t_F('cookie_func').callMethod('set',{\r\n\t\t\tname:'userLoginToken',\r\n\t\t\tvalue:userToken,\r\n\t\t\texpire:loginExpire,\r\n\t\t\tpath:'/',\r\n\t\t\tdomain: cookieHost,\r\n\t\t\t//sameSite: 'None'\r\n\t\t});\r\n});\r\n\r\nemitter.on('setUserTokenSet',()=>{\r\n\t\t_F('bCacheTemp_wJfaNQwj3d').callMethod('set',{\r\n\t\t\tkey:userLoginTokenSetKey,\r\n\t\t\tvalue:JSON.stringify(userTokenSet),\r\n\t\t\texpire:3600,\r\n\t\t\tsuccess:(data)=>{\r\n\t\t\t},\r\n\t\t\tfail:()=>{\r\n\t\t\t}\r\n\t\t});\r\n});\r\n\r\nemitter.on('checkMultLogin',()=>{\r\n\tuserInfo.multLogin = multLogin;\r\n\tconsole.log('checkMultLogin',userTokenSet,!multLogin);\r\n\tif(!multLogin){\r\n\t\tuserTokenSet.map(item => {\r\n\t\t\temitter.emit('delUserToken',item);\r\n\t\t});\r\n\t\tuserTokenSet = [];\r\n\t}\r\n\tuserTokenSet.push(userToken);\r\n\t//调用 后台缓存redis组件.缓存设置(用户登录串缓存key集合,tokenSet,登录有效时长)\r\n\temitter.emit('setUserTokenSet');\r\n\t//调用 后台缓存redis组件.缓存设置(用户登录串缓存key:token,用户信息对象,登录有效时长)\r\n\temitter.emit('setUserToken');\r\n});\r\n\r\nemitter.on('checkUseCookie',()=>{\r\n\tif(useCookie){\r\n\t\t//调用 后台cookie组件.cookie设置(用户登录串缓存key,token,登录有效时长)\r\n\t\temitter.emit('setCookie');\r\n\t}else{\r\n\t\tuserInfo.token = userToken;\r\n\t}\r\n\t\r\n\t_funcCb({code:200,errMsg:'ok',result:userInfo});\r\n});\r\n\r\nemitter.emit('getUserInfo');",
  4386. "inParams": [
  4387. "用户名",
  4388. "密码",
  4389. "登录有效时长",
  4390. "使用cookie",
  4391. "允许多端登录",
  4392. "cookie域名"
  4393. ],
  4394. "outParams": [
  4395. "code",
  4396. "errMsg",
  4397. "result"
  4398. ],
  4399. "openApiPath": "",
  4400. "inParamsDebug": {}
  4401. }
  4402. },
  4403. {
  4404. "id": "service_5xT7BspmbA",
  4405. "name": "用户名密码注册",
  4406. "type": "service",
  4407. "props": {
  4408. "devId": "service_5xT7BspmbA",
  4409. "isOpen": false,
  4410. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(用户名==用户名)\r\nconst emitter = new events.EventEmitter(); \r\n\r\nif(!param.用户名){\r\n _funcCb({code:0,errMsg:'请传入用户名',result:{}});\r\n return;\r\n}\r\n\r\nif(!param.密码){\r\n _funcCb({code:0,errMsg:'请传入密码',result:{}});\r\n return;\r\n}\r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('dbTableTemp_6xG6thEJQS').callMethod('getRow',{\r\n condition:{\r\n 用户名: param.用户名,\r\n 密码: param.密码,\r\n },\r\n success:(data)=>{\r\n if(Array.isArray(data) && data.length <= 0 ) \r\n \temitter.emit('addUser');\r\n else\r\n \temitter.emit('hadUser');\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n});\r\n\r\nemitter.on('hadUser',()=>{\r\n\t_funcCb({code:0,errMsg:'用户已注册,请直接登录',result:{}});\r\n});\r\n \r\nemitter.on('addUser',()=>{\r\n \tlet userInfo = {};\r\n _F('dbTableTemp_6xG6thEJQS').callMethod('addRow',{\r\n row:{\r\n 用户名: param.用户名,\r\n 密码: param.密码,\r\n },\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'注册成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n\t\r\n});\r\n\r\nemitter.emit('getUserInfo');",
  4411. "inParams": [
  4412. "用户名",
  4413. "密码"
  4414. ],
  4415. "outParams": [
  4416. "code",
  4417. "errMsg",
  4418. "result"
  4419. ],
  4420. "openApiPath": "",
  4421. "inParamsDebug": {
  4422. "密码": "123123",
  4423. "用户名": "13800138000"
  4424. }
  4425. }
  4426. },
  4427. {
  4428. "id": "service_8rNTjXTpbf",
  4429. "name": "获取当前登录用户信息",
  4430. "type": "service",
  4431. "props": {
  4432. "devId": "service_8rNTjXTpbf",
  4433. "isOpen": false,
  4434. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet userToken = param.token;\r\nlet userLoginTokenKey = 'userLoginToken';//用户登录串缓存key \r\nlet userInfo = null;\r\n\r\n\r\nemitter.on('getUserInfo',()=>{\r\n\tif(userToken){\r\n\t\tuserLoginTokenKey = `${userLoginTokenKey}:${userToken}`;\r\n\t\t_F('bCacheTemp_wJfaNQwj3d').callMethod('get',{\r\n\t\t\t\tkey:userLoginTokenKey,\r\n\t\t\t\tsuccess:(data)=>{\r\n\t\t\t\t\tconsole.log('getUserInfo.success',data);\r\n\t\t\t\t\tif(data){\r\n\t\t\t\t\t\tuserInfo = JSON.parse(data);\r\n\t\t\t\t\t\t_funcCb({code:200,errMsg:'已登录',result:userInfo});\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse \r\n\t\t\t\t\t\temitter.emit('noUserInfo');\r\n\t\t\t\t},\r\n\t\t\t\tfail:(err)=>{\r\n\t\t\t\t\t_funcCb({code:0,errMsg:'获取登录信息缓存失败',result:err});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\r\n\t}\r\n\telse \r\n\t\temitter.emit('noUserInfo');\r\n});\r\n\r\nemitter.on('getUserTokenCookie',()=>{\r\n\t\tuserToken = _F('cookie_func').callMethod('get',{\r\n\t\t\tname:userLoginTokenKey\r\n\t\t});\r\n});\r\n\r\nemitter.on('noUserInfo',()=>{\r\n\t_funcCb({code:0,errMsg:'请先登录',result:{}});\r\n});\r\n\r\nif(!userToken)\r\n\temitter.emit('getUserTokenCookie');\r\n\r\nemitter.emit('getUserInfo');",
  4435. "inParams": [
  4436. "token"
  4437. ],
  4438. "outParams": [
  4439. "code",
  4440. "errMsg",
  4441. "result"
  4442. ],
  4443. "openApiPath": "",
  4444. "inParamsDebug": {}
  4445. }
  4446. },
  4447. {
  4448. "id": "service_hB82nRtmDR",
  4449. "name": "退出登录",
  4450. "type": "service",
  4451. "props": {
  4452. "devId": "service_hB82nRtmDR",
  4453. "isOpen": false,
  4454. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet userToken = param.token;\r\nlet cookieHost = param.cookie域名?param.cookie域名:'';\r\nlet userLoginTokenKey = 'userLoginToken';//用户登录串缓存key \r\nlet userInfo = null;\r\n\r\n\r\nemitter.on('getUserInfo',()=>{\r\n\tif(userToken){\r\n\t\tlet userLoginTokenCacheKey = `${userLoginTokenKey}:${userToken}`;\r\n\t\t _F('bCacheTemp_wJfaNQwj3d').callMethod('get',{\r\n\t\t\t\tkey:userLoginTokenCacheKey,\r\n\t\t\t\tsuccess:(data)=>{\r\n\t\t\t\t\tconsole.log('getUserInfo.success',data);\r\n\t\t\t\t\tif(data){\r\n\t\t\t\t\t\temitter.emit('delUserTokenCache',userLoginTokenCacheKey);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse \r\n\t\t\t\t\t\temitter.emit('noUserInfo');\r\n\t\t\t\t},\r\n\t\t\t\tfail:(err)=>{\r\n\t\t\t\t\t_funcCb({code:0,errMsg:'获取登录信息缓存失败',result:err});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\r\n\t}\r\n\telse \r\n\t\temitter.emit('noUserInfo');\r\n});\r\n\r\nemitter.on('getUserTokenCookie',()=>{\r\n\t\tuserToken = _F('cookie_func').callMethod('get',{\r\n\t\t\tname:userLoginTokenKey\r\n\t\t});\r\n});\r\n\r\nemitter.on('noUserInfo',()=>{\r\n\t_funcCb({code:0,errMsg:'请先登录',result:{}});\r\n});\r\n\r\nemitter.on('delUserTokenCookie',()=>{\r\n\t_F('cookie_func').callMethod('del',{\r\n name:userLoginTokenKey,\r\n\t\texpire:-3600,\r\n\t\tpath:'/',\r\n\t\tdomain: cookieHost,\r\n });\r\n _funcCb({code:200,errMsg:'退出登录成功',result:{}});\r\n});\r\n\r\nemitter.on('delUserTokenCache',(userLoginTokenCacheKey)=>{\r\n\t_F('bCacheTemp_wJfaNQwj3d').callMethod('del',{\r\n key:userLoginTokenCacheKey,\r\n success:(data)=>{\r\n emitter.emit('delUserTokenCookie');\r\n },\r\n fail:(err)=>{\r\n _funcCb({code:0,errMsg:'删除登录信息缓存失败',result:err});\r\n }\r\n });\r\n});\r\n\r\nif(!userToken)\r\n\temitter.emit('getUserTokenCookie');\r\n\r\nemitter.emit('getUserInfo');",
  4455. "inParams": [
  4456. "token",
  4457. "cookie域名"
  4458. ],
  4459. "outParams": [],
  4460. "openApiPath": "",
  4461. "inParamsDebug": {}
  4462. }
  4463. },
  4464. {
  4465. "id": "service_DTz27rE4GR",
  4466. "name": "openid密码注册及登录",
  4467. "type": "service",
  4468. "props": {
  4469. "devId": "service_DTz27rE4GR",
  4470. "isOpen": false,
  4471. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(用户名==用户名)\r\nconst emitter = new events.EventEmitter();\r\n\r\nif (!param.openid) {\r\n _funcCb({ code: 0, errMsg: '请传入openid', result: {} });\r\n return;\r\n}\r\n\r\nif (!param.密码) {\r\n _funcCb({ code: 0, errMsg: '请传入密码', result: {} });\r\n return;\r\n}\r\n\r\nemitter.on('getUserInfo', () => {\r\n _F('dbTableTemp_6xG6thEJQS').callMethod('getRow', {\r\n condition: {\r\n openid: param.openid,\r\n 密码: param.密码,\r\n },\r\n success: (data) => {\r\n if (Array.isArray(data) && data.length <= 0)\r\n emitter.emit('addUser');\r\n else\r\n emitter.emit('hadUser');\r\n },\r\n fail: () => {\r\n }\r\n });\r\n});\r\n\r\nemitter.on('hadUser', () => {\r\n //_funcCb({code:0,errMsg:'openid已注册,请直接登录',result:{}});\r\n emitter.emit('openidLogin');\r\n});\r\n\r\nemitter.on('openidLogin', () => {\r\n _F('service_edcBYDzKcE').call({ openid: param.openid, 使用cookie: 0 }, (data) => {\r\n _funcCb(data);\r\n });\r\n});\r\n\r\nemitter.on('addUser', () => {\r\n let userInfo = {};\r\n _F('dbTableTemp_6xG6thEJQS').callMethod('addRow', {\r\n row: {\r\n openid: param.openid,\r\n 密码: param.密码,\r\n },\r\n success: (data) => {\r\n //_funcCb({ code: 200, errMsg: '注册成功', result: data });\r\n emitter.emit('openidLogin');\r\n },\r\n fail: () => {\r\n }\r\n });\r\n\r\n});\r\n\r\nemitter.emit('getUserInfo');",
  4472. "inParams": [
  4473. "openid",
  4474. "密码"
  4475. ],
  4476. "outParams": [
  4477. "code",
  4478. "errMsg",
  4479. "result"
  4480. ],
  4481. "openApiPath": "",
  4482. "inParamsDebug": {
  4483. "openid": "",
  4484. "密码": "123123"
  4485. }
  4486. }
  4487. },
  4488. {
  4489. "id": "service_edcBYDzKcE",
  4490. "name": "openid登录",
  4491. "type": "service",
  4492. "props": {
  4493. "devId": "service_edcBYDzKcE",
  4494. "isOpen": false,
  4495. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(openid==openid,密码 == 密码)\r\nconst emitter = new events.EventEmitter(); \r\nlet userInfo = null;\r\nlet userToken = null;\r\nlet userLoginTokenKey = 'userLoginToken';//用户登录串缓存key\r\nlet userLoginTokenSetKey = 'userLoginTokenSet';//用户登录串缓存集合key \r\nlet userTokenSet = [];//用户登录串缓存key集合\r\nlet multLogin = param.允许多端登录?true:false;\r\nlet useCookie = param.使用cookie?true:false;\r\nlet cookieHost = param.cookie域名?param.cookie域名:'';\r\nlet loginExpire = param.登录有效时长 > 0?param.登录有效时长:3600;\r\n\r\nemitter.on('showError',(errMsg,result)=>{\r\n\t_funcCb({code:0,errMsg,result:result || {}});\r\n});\r\n\r\nif(!param.openid){\r\n _funcCb({code:0,errMsg:'请传入openid',result:{}});\r\n return;\r\n}\r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('dbTableTemp_6xG6thEJQS').callMethod('getRow',{\r\n condition:{\r\n openid: param.openid,\r\n },\r\n success:(data)=>{\r\n if(Array.isArray(data) && data.length <= 0 ) \r\n \temitter.emit('noUserInfo');\r\n else{\r\n\t\t\t\tuserInfo = data[0];\r\n\t\t\t\temitter.emit('getUserToken');\r\n\t\t\t\temitter.emit('setUserLoginTokenKey');\r\n\t\t\t\temitter.emit('getUserTokenSet');\r\n\t\t\t}\r\n \t\r\n },\r\n fail:(err)=>{\r\n emitter.emit('showError','获取用户信息失败',err);\r\n }\r\n });\r\n});\r\n\r\nemitter.on('noUserInfo',()=>{\r\n\t_funcCb({code:0,errMsg:'openid不正确',result:{}});\r\n});\r\n\r\nemitter.on('setUserLoginTokenKey',()=>{\r\n\tuserLoginTokenKey = `${userLoginTokenKey}:${userToken}`;\r\n\tuserLoginTokenSetKey = `${userLoginTokenSetKey}:${userInfo._id}`;\r\n});\r\n\r\nemitter.on('getUserToken',()=>{\r\n\t_F('service_xk6eian5Dd').call({},(data)=>{\r\n\t\tuserToken = data.result;\r\n\t});\r\n\t\r\n});\r\n\r\nemitter.on('getUserTokenSet',()=>{\r\n\t_F('bCacheTemp_wJfaNQwj3d').callMethod('get',{\r\n\t\t\tkey:userLoginTokenSetKey,\r\n\t\t\tsuccess:(data)=>{\r\n\t\t\t\tif(data)\r\n\t\t\t\t\tuserTokenSet = JSON.parse(data);\r\n\t\t\t\t\r\n\t\t\t\temitter.emit('checkMultLogin');\r\n\t\t\t\temitter.emit('checkUseCookie');\r\n\t\t\t},\r\n\t\t\tfail:()=>{\r\n\t\t\t}\r\n\t\t});\r\n\t\r\n});\r\n\r\nemitter.on('delUserToken',(token)=>{\r\n\t//调用 后台缓存redis组件.缓存删除(用户登录串缓存key)\r\n\t\t_F('bCacheTemp_wJfaNQwj3d').callMethod('del',{\r\n\t\t\tkey:`userLoginToken:${token}`,\r\n\t\t\tsuccess:(data)=>{\r\n\t\t\t},\r\n\t\t\tfail:()=>{\r\n\t\t\t}\r\n\t\t});\r\n});\r\n\r\nemitter.on('setUserToken',()=>{\r\n\t\t_F('bCacheTemp_wJfaNQwj3d').callMethod('set',{\r\n\t\t\tkey:userLoginTokenKey,\r\n\t\t\tvalue:JSON.stringify(userInfo),\r\n\t\t\texpire:loginExpire,\r\n\t\t\tsuccess:(data)=>{\r\n\t\t\t},\r\n\t\t\tfail:()=>{\r\n\t\t\t}\r\n\t\t});\r\n});\r\n\r\nemitter.on('setCookie',()=>{\r\n\t\t_F('cookie_func').callMethod('set',{\r\n\t\t\tname:'userLoginToken',\r\n\t\t\tvalue:userToken,\r\n\t\t\texpire:loginExpire,\r\n\t\t\tpath:'/',\r\n\t\t\tdomain: cookieHost,\r\n\t\t\t//sameSite: 'None'\r\n\t\t});\r\n});\r\n\r\nemitter.on('setUserTokenSet',()=>{\r\n\t\t_F('bCacheTemp_wJfaNQwj3d').callMethod('set',{\r\n\t\t\tkey:userLoginTokenSetKey,\r\n\t\t\tvalue:JSON.stringify(userTokenSet),\r\n\t\t\texpire:3600,\r\n\t\t\tsuccess:(data)=>{\r\n\t\t\t},\r\n\t\t\tfail:()=>{\r\n\t\t\t}\r\n\t\t});\r\n});\r\n\r\nemitter.on('checkMultLogin',()=>{\r\n\tuserInfo.multLogin = multLogin;\r\n\tconsole.log('checkMultLogin',userTokenSet,!multLogin);\r\n\tif(!multLogin){\r\n\t\tuserTokenSet.map(item => {\r\n\t\t\temitter.emit('delUserToken',item);\r\n\t\t});\r\n\t\tuserTokenSet = [];\r\n\t}\r\n\tuserTokenSet.push(userToken);\r\n\t//调用 后台缓存redis组件.缓存设置(用户登录串缓存key集合,tokenSet,登录有效时长)\r\n\temitter.emit('setUserTokenSet');\r\n\t//调用 后台缓存redis组件.缓存设置(用户登录串缓存key:token,用户信息对象,登录有效时长)\r\n\temitter.emit('setUserToken');\r\n});\r\n\r\nemitter.on('checkUseCookie',()=>{\r\n\tif(useCookie){\r\n\t\t//调用 后台cookie组件.cookie设置(用户登录串缓存key,token,登录有效时长)\r\n\t\temitter.emit('setCookie');\r\n\t}else{\r\n\t\tuserInfo.token = userToken;\r\n\t}\r\n\t\r\n\t_funcCb({code:200,errMsg:'ok',result:userInfo});\r\n});\r\n\r\nemitter.emit('getUserInfo');",
  4496. "inParams": [
  4497. "openid",
  4498. "登录有效时长",
  4499. "使用cookie",
  4500. "允许多端登录",
  4501. "cookie域名"
  4502. ],
  4503. "outParams": [
  4504. "code",
  4505. "errMsg",
  4506. "result"
  4507. ],
  4508. "openApiPath": "",
  4509. "inParamsDebug": {}
  4510. }
  4511. },
  4512. {
  4513. "id": "service_c2SDBJeYBs",
  4514. "name": "手机号登录",
  4515. "type": "service",
  4516. "props": {
  4517. "devId": "service_c2SDBJeYBs",
  4518. "isOpen": false,
  4519. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(openid==openid,密码 == 密码)\r\nconst emitter = new events.EventEmitter(); \r\nlet userInfo = null;\r\nlet userToken = null;\r\nlet userLoginTokenKey = 'userLoginToken';//用户登录串缓存key\r\nlet userLoginTokenSetKey = 'userLoginTokenSet';//用户登录串缓存集合key \r\nlet userTokenSet = [];//用户登录串缓存key集合\r\nlet multLogin = param.允许多端登录?true:false;\r\nlet useCookie = param.使用cookie?true:false;\r\nlet cookieHost = param.cookie域名?param.cookie域名:'';\r\nlet loginExpire = param.登录有效时长 > 0?param.登录有效时长:3600;\r\n\r\nemitter.on('showError',(errMsg,result)=>{\r\n\t_funcCb({code:0,errMsg,result:result || {}});\r\n});\r\n\r\nif(!param.手机号){\r\n _funcCb({code:0,errMsg:'请传入手机号',result:{}});\r\n return;\r\n}\r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('dbTableTemp_6xG6thEJQS').callMethod('getRow',{\r\n condition:{\r\n 手机号: param.手机号,\r\n },\r\n success:(data)=>{\r\n if(Array.isArray(data) && data.length <= 0 ) \r\n \temitter.emit('noUserInfo');\r\n else{\r\n\t\t\t\tuserInfo = data[0];\r\n\t\t\t\temitter.emit('getUserToken');\r\n\t\t\t\temitter.emit('setUserLoginTokenKey');\r\n\t\t\t\temitter.emit('getUserTokenSet');\r\n\t\t\t}\r\n \t\r\n },\r\n fail:(err)=>{\r\n emitter.emit('showError','获取用户信息失败',err);\r\n }\r\n });\r\n});\r\n\r\nemitter.on('noUserInfo',()=>{\r\n\t_funcCb({code:0,errMsg:'手机号不正确',result:{}});\r\n});\r\n\r\nemitter.on('setUserLoginTokenKey',()=>{\r\n\tuserLoginTokenKey = `${userLoginTokenKey}:${userToken}`;\r\n\tuserLoginTokenSetKey = `${userLoginTokenSetKey}:${userInfo._id}`;\r\n});\r\n\r\nemitter.on('getUserToken',()=>{\r\n\t_F('service_xk6eian5Dd').call({},(data)=>{\r\n\t\tuserToken = data.result;\r\n\t});\r\n\t\r\n});\r\n\r\nemitter.on('getUserTokenSet',()=>{\r\n\t_F('bCacheTemp_wJfaNQwj3d').callMethod('get',{\r\n\t\t\tkey:userLoginTokenSetKey,\r\n\t\t\tsuccess:(data)=>{\r\n\t\t\t\tif(data)\r\n\t\t\t\t\tuserTokenSet = JSON.parse(data);\r\n\t\t\t\t\r\n\t\t\t\temitter.emit('checkMultLogin');\r\n\t\t\t\temitter.emit('checkUseCookie');\r\n\t\t\t},\r\n\t\t\tfail:()=>{\r\n\t\t\t}\r\n\t\t});\r\n\t\r\n});\r\n\r\nemitter.on('delUserToken',(token)=>{\r\n\t//调用 后台缓存redis组件.缓存删除(用户登录串缓存key)\r\n\t\t_F('bCacheTemp_wJfaNQwj3d').callMethod('del',{\r\n\t\t\tkey:`userLoginToken:${token}`,\r\n\t\t\tsuccess:(data)=>{\r\n\t\t\t},\r\n\t\t\tfail:()=>{\r\n\t\t\t}\r\n\t\t});\r\n});\r\n\r\nemitter.on('setUserToken',()=>{\r\n\t\t_F('bCacheTemp_wJfaNQwj3d').callMethod('set',{\r\n\t\t\tkey:userLoginTokenKey,\r\n\t\t\tvalue:JSON.stringify(userInfo),\r\n\t\t\texpire:loginExpire,\r\n\t\t\tsuccess:(data)=>{\r\n\t\t\t},\r\n\t\t\tfail:()=>{\r\n\t\t\t}\r\n\t\t});\r\n});\r\n\r\nemitter.on('setCookie',()=>{\r\n\t\t_F('cookie_func').callMethod('set',{\r\n\t\t\tname:'userLoginToken',\r\n\t\t\tvalue:userToken,\r\n\t\t\texpire:loginExpire,\r\n\t\t\tpath:'/',\r\n\t\t\tdomain: cookieHost,\r\n\t\t\t//sameSite: 'None'\r\n\t\t});\r\n});\r\n\r\nemitter.on('setUserTokenSet',()=>{\r\n\t\t_F('bCacheTemp_wJfaNQwj3d').callMethod('set',{\r\n\t\t\tkey:userLoginTokenSetKey,\r\n\t\t\tvalue:JSON.stringify(userTokenSet),\r\n\t\t\texpire:3600,\r\n\t\t\tsuccess:(data)=>{\r\n\t\t\t},\r\n\t\t\tfail:()=>{\r\n\t\t\t}\r\n\t\t});\r\n});\r\n\r\nemitter.on('checkMultLogin',()=>{\r\n\tuserInfo.multLogin = multLogin;\r\n\tconsole.log('checkMultLogin',userTokenSet,!multLogin);\r\n\tif(!multLogin){\r\n\t\tuserTokenSet.map(item => {\r\n\t\t\temitter.emit('delUserToken',item);\r\n\t\t});\r\n\t\tuserTokenSet = [];\r\n\t}\r\n\tuserTokenSet.push(userToken);\r\n\t//调用 后台缓存redis组件.缓存设置(用户登录串缓存key集合,tokenSet,登录有效时长)\r\n\temitter.emit('setUserTokenSet');\r\n\t//调用 后台缓存redis组件.缓存设置(用户登录串缓存key:token,用户信息对象,登录有效时长)\r\n\temitter.emit('setUserToken');\r\n});\r\n\r\nemitter.on('checkUseCookie',()=>{\r\n\tif(useCookie){\r\n\t\t//调用 后台cookie组件.cookie设置(用户登录串缓存key,token,登录有效时长)\r\n\t\temitter.emit('setCookie');\r\n\t}else{\r\n\t\tuserInfo.token = userToken;\r\n\t}\r\n\t\r\n\t_funcCb({code:200,errMsg:'ok',result:userInfo});\r\n});\r\n\r\nemitter.emit('getUserInfo');",
  4520. "inParams": [
  4521. "手机号",
  4522. "登录有效时长",
  4523. "使用cookie",
  4524. "允许多端登录",
  4525. "cookie域名"
  4526. ],
  4527. "outParams": [
  4528. "code",
  4529. "errMsg",
  4530. "result"
  4531. ],
  4532. "openApiPath": "",
  4533. "inParamsDebug": {}
  4534. }
  4535. }
  4536. ]
  4537. }
  4538. ]
  4539. },
  4540. {
  4541. "id": "state_brktiPxPbp",
  4542. "type": "state",
  4543. "children": []
  4544. },
  4545. {
  4546. "id": "services_AkMYeYdYhZ",
  4547. "type": "services",
  4548. "children": [
  4549. {
  4550. "id": "group_ZY7j4rRFaE",
  4551. "name": "数据表相关",
  4552. "type": "group",
  4553. "props": {
  4554. "devId": "group_ZY7j4rRFaE"
  4555. },
  4556. "children": [
  4557. {
  4558. "id": "dbTableTemp_6xG6thEJQS",
  4559. "name": "用户表",
  4560. "type": "dbTableTemp",
  4561. "props": {
  4562. "devId": "dbTableTemp_6xG6thEJQS",
  4563. "fields": [
  4564. {
  4565. "columnName": "_id",
  4566. "columnType": "int"
  4567. },
  4568. {
  4569. "columnName": "用户名",
  4570. "columnType": "text"
  4571. },
  4572. {
  4573. "columnName": "openid",
  4574. "columnType": "text"
  4575. },
  4576. {
  4577. "columnName": "手机号",
  4578. "columnType": "text"
  4579. },
  4580. {
  4581. "columnName": "昵称",
  4582. "columnType": "text"
  4583. },
  4584. {
  4585. "columnName": "密码",
  4586. "columnType": "text"
  4587. },
  4588. {
  4589. "columnName": "_create",
  4590. "columnType": "int"
  4591. },
  4592. {
  4593. "columnName": "_update",
  4594. "columnType": "int"
  4595. }
  4596. ]
  4597. }
  4598. },
  4599. {
  4600. "id": "bCacheTemp_wJfaNQwj3d",
  4601. "name": "用户登录信息缓存",
  4602. "type": "bCacheTemp",
  4603. "props": {
  4604. "devId": "bCacheTemp_wJfaNQwj3d"
  4605. }
  4606. }
  4607. ]
  4608. },
  4609. {
  4610. "id": "group_rTsCTAeH2W",
  4611. "name": "内部方法",
  4612. "type": "group",
  4613. "props": {
  4614. "devId": "group_rTsCTAeH2W"
  4615. },
  4616. "children": [
  4617. {
  4618. "id": "service_xk6eian5Dd",
  4619. "name": "用户token生成",
  4620. "type": "service",
  4621. "props": {
  4622. "devId": "service_xk6eian5Dd",
  4623. "isOpen": false,
  4624. "jsCode": "let token = _F('string_func').callMethod('randomString',{length:32});\n\n_funcCb({code:200,errMsg:'ok',result:token});",
  4625. "inParams": [],
  4626. "outParams": [
  4627. "code",
  4628. "errMsg",
  4629. "result"
  4630. ],
  4631. "openApiPath": "",
  4632. "inParamsDebug": {}
  4633. }
  4634. }
  4635. ]
  4636. }
  4637. ]
  4638. }
  4639. ]
  4640. },
  4641. {
  4642. "id": "modules_ZQQHbsTjXz",
  4643. "name": "模块",
  4644. "type": "modules",
  4645. "props": {}
  4646. }
  4647. ]
  4648. },
  4649. {
  4650. "id": "module_SQHw2mER25",
  4651. "name": "员工中台模块",
  4652. "type": "module",
  4653. "props": {
  4654. "devId": "module_SQHw2mER25",
  4655. "appModuleId": "41",
  4656. "appModuleVersion": 33
  4657. },
  4658. "children": [
  4659. {
  4660. "id": "modules_44CNb58X25",
  4661. "name": "模块",
  4662. "type": "modules",
  4663. "props": {}
  4664. },
  4665. {
  4666. "id": "backend_ETyiYpGrJ5",
  4667. "name": "后台",
  4668. "type": "backend",
  4669. "props": {
  4670. "style": {
  4671. "height": "200px",
  4672. "backgroundColor": "red"
  4673. }
  4674. },
  4675. "children": [
  4676. {
  4677. "id": "props_XShGG2Bmac",
  4678. "type": "props",
  4679. "children": [
  4680. {
  4681. "id": "bPAttr_WNrMDDM3ZM",
  4682. "type": "bPAttr",
  4683. "children": [
  4684. {
  4685. "id": "variable_GP2sBWntRd",
  4686. "name": "用户登录串CookieKey前缀",
  4687. "type": "variable",
  4688. "props": {
  4689. "devId": "variable_GP2sBWntRd",
  4690. "value": null
  4691. }
  4692. }
  4693. ]
  4694. },
  4695. {
  4696. "id": "bPMethod_JsDhk6mGAG",
  4697. "type": "bPMethod",
  4698. "children": [
  4699. {
  4700. "id": "service_JT4zdxjSc6",
  4701. "name": "获取员工列表",
  4702. "type": "service",
  4703. "props": {
  4704. "devId": "service_JT4zdxjSc6",
  4705. "isOpen": false,
  4706. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet condition = {};\r\n\r\nlet field;\r\nif(param.显示关联)\r\n field = [\r\n \"_id\",\r\n \"用户名\",\r\n \"手机号\",\r\n \"邮箱\",\r\n \"昵称\",\r\n \"姓名\",\r\n \"角色ID\",\r\n \"角色名称\",\r\n \"部门ID\",\r\n \"部门名称\",\r\n \"是否删除\",\r\n \"_create\",\r\n \"_update\"\r\n ];\r\nelse\r\n field = [\r\n \"_id\",\r\n \"用户名\",\r\n \"手机号\",\r\n \"邮箱\",\r\n \"昵称\",\r\n \"姓名\",\r\n \"角色ID\",\r\n \"部门ID\",\r\n \"是否删除\",\r\n \"_create\",\r\n \"_update\"\r\n ];\r\n\r\n\r\nemitter.on('showError',(errMsg,result)=>{\r\n\t_funcCb({code:0,errMsg,result:result || {},total:0});\r\n});\r\n\r\nemitter.on('setCondition', ()=>{\r\n condition = {};\r\n if(param.部门ID)condition.部门ID = param.部门ID;\r\n if(param.角色ID)condition.角色ID = param.角色ID;\r\n if(param.是否删除)condition.是否删除 = param.是否删除;\r\n if(param.关键字){\r\n condition.or = {\r\n 用户名: ['like',param.关键字],\r\n 手机号: ['like',param.关键字],\r\n 邮箱: ['like',param.关键字],\r\n 姓名: ['like',param.关键字],\r\n };\r\n }\r\n});\r\n\r\nemitter.on('getTotal', ()=>{\r\n _F('dbViewTemp_R34dNixksn').callMethod('getCount',{\r\n condition,\r\n success:(res)=>{\r\n emitter.emit('getList',res[0].count);\r\n },\r\n fail:(err)=>{\r\n emitter.emit('showError','获取列表总数失败',err);\r\n },\r\n \r\n });\r\n});\r\n\r\n\r\nemitter.on('getList', (total)=>{\r\n _F('dbViewTemp_R34dNixksn').callMethod('getRows',{\r\n condition,\r\n field,\r\n pageNum: param.pageNum?param.pageNum:1,\r\n pageSize: param.pageSize?param.pageSize:10,\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'ok',result:data,total});\r\n },\r\n fail:(err)=>{\r\n emitter.emit('showError','获取员工列表',err);\r\n }\r\n });\r\n});\r\n\r\nemitter.emit('setCondition');\r\nemitter.emit('getTotal');\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n",
  4707. "inParams": [
  4708. "pageNum",
  4709. "pageSize",
  4710. "部门ID",
  4711. "角色ID",
  4712. "关键字",
  4713. "是否删除",
  4714. "显示关联"
  4715. ],
  4716. "outParams": [],
  4717. "openApiPath": "",
  4718. "inParamsDebug": {}
  4719. }
  4720. },
  4721. {
  4722. "id": "service_PQd7Zr4nK6",
  4723. "name": "删除员工",
  4724. "type": "service",
  4725. "props": {
  4726. "devId": "service_PQd7Zr4nK6",
  4727. "isOpen": false,
  4728. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(!param.员工ID){\r\n _funcCb({code:0,errMsg:'请传入员工ID',result:{}});\r\n return;\r\n}\r\n\r\nlet editObj = {};\r\neditObj.是否删除 = param.是否删除?param.是否删除:0;\r\n\r\nemitter.on('editUser', ()=>{\r\n _F('dbTableTemp_6xG6thEJQS').callMethod('editRow',{\r\n row:editObj,\r\n condition:{\r\n _id:param.员工ID,\r\n },\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'删除员工成功',result:data});\r\n },\r\n fail:(err)=>{\r\n _funcCb({code:0,errMsg:'删除员工失败',result:err});\r\n }\r\n });\r\n});\r\n\r\nemitter.emit('editUser');",
  4729. "inParams": [
  4730. "员工ID",
  4731. "是否删除"
  4732. ],
  4733. "outParams": [],
  4734. "openApiPath": "",
  4735. "inParamsDebug": {}
  4736. }
  4737. },
  4738. {
  4739. "id": "service_bazaCNCCK3",
  4740. "name": "禁用员工",
  4741. "type": "service",
  4742. "props": {
  4743. "devId": "service_bazaCNCCK3",
  4744. "isOpen": false,
  4745. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(!param.员工ID){\r\n _funcCb({code:0,errMsg:'请传入员工ID',result:{}});\r\n return;\r\n}\r\n\r\nlet editObj = {};\r\neditObj.是否禁用 = param.是否禁用?param.是否禁用:0;\r\n\r\nemitter.on('editUser', ()=>{\r\n _F('dbTableTemp_6xG6thEJQS').callMethod('editRow',{\r\n row:editObj,\r\n condition:{\r\n _id:param.员工ID,\r\n },\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'禁用员工成功',result:data});\r\n },\r\n fail:(err)=>{\r\n _funcCb({code:0,errMsg:'禁用员工失败',result:err});\r\n }\r\n });\r\n});\r\n\r\nemitter.emit('editUser');",
  4746. "inParams": [
  4747. "员工ID",
  4748. "是否禁用"
  4749. ],
  4750. "outParams": [],
  4751. "openApiPath": "",
  4752. "inParamsDebug": {}
  4753. }
  4754. },
  4755. {
  4756. "id": "service_7PnxyXDPAT",
  4757. "name": "编辑员工信息",
  4758. "type": "service",
  4759. "props": {
  4760. "devId": "service_7PnxyXDPAT",
  4761. "isOpen": false,
  4762. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(!param.员工ID){\r\n _funcCb({code:0,errMsg:'请传入员工ID',result:{}});\r\n return;\r\n}\r\n\r\nlet editObj = {};\r\nif(param.用户名)editObj.用户名 = param.用户名;\r\nif(param.姓名)editObj.姓名 = param.姓名;\r\nif(param.角色ID)editObj.角色ID = param.角色ID;\r\nif(param.部门ID)editObj.部门ID = param.部门ID;\r\nif(param.邮箱)editObj.邮箱 = param.邮箱;\r\nif(param.手机号)editObj.手机号 = param.手机号;\r\n\r\nemitter.on('editUser', ()=>{\r\n _F('dbTableTemp_6xG6thEJQS').callMethod('editRow',{\r\n row:editObj,\r\n condition:{\r\n _id:param.员工ID,\r\n },\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'编辑员工成功',result:data});\r\n },\r\n fail:(err)=>{\r\n _funcCb({code:0,errMsg:'编辑员工失败',result:err});\r\n }\r\n });\r\n});\r\n\r\nemitter.emit('editUser');",
  4763. "inParams": [
  4764. "员工ID",
  4765. "姓名",
  4766. "角色ID",
  4767. "部门ID",
  4768. "邮箱",
  4769. "手机号",
  4770. "用户名"
  4771. ],
  4772. "outParams": [],
  4773. "openApiPath": "",
  4774. "inParamsDebug": {}
  4775. }
  4776. },
  4777. {
  4778. "id": "service_DE3rN7bad6",
  4779. "name": "用户名密码登录",
  4780. "type": "service",
  4781. "props": {
  4782. "devId": "service_DE3rN7bad6",
  4783. "isOpen": false,
  4784. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(用户名==用户名,密码 == 密码)\nconst emitter = new events.EventEmitter(); \nlet userInfo = null;\nlet userToken = null;\nlet userLoginTokenKey = 'userLoginToken';//用户登录串缓存key\nlet userLoginTokenSetKey = 'userLoginTokenSet';//用户登录串缓存集合key \nlet cookieKeyPrefix = _F('variable_GP2sBWntRd').callMethod('get');\nlet cookieKey = cookieKeyPrefix + userLoginTokenKey;//用户登录串CookieKey\nlet userTokenSet = [];//用户登录串缓存key集合\nlet multLogin = param.允许多端登录?true:false;\nlet useCookie = param.使用cookie?true:false;\nlet cookieHost = param.cookie域名?param.cookie域名:'';\nlet loginExpire = param.登录有效时长 > 0?param.登录有效时长:3600;\n\nconsole.log('用户名密码登录.cookieKey',cookieKey);\n\nemitter.on('getUserInfo', ()=>{\n _F('dbTableTemp_6xG6thEJQS').callMethod('getRow',{\n condition:{\n 用户名: param.用户名,\n 密码: param.密码,\n },\n success:(data)=>{\n if(Array.isArray(data) && data.length <= 0 ) \n \temitter.emit('noUserInfo');\n else{\n\t\t\t\tuserInfo = data[0];\n\t\t\t\temitter.emit('getUserToken');\n\t\t\t\temitter.emit('setUserLoginTokenKey');\n\t\t\t\temitter.emit('getUserTokenSet');\n\t\t\t}\n \t\n },\n fail:()=>{\n }\n });\n});\n\nemitter.on('noUserInfo',()=>{\n\t_funcCb({code:0,errMsg:'用户名或密码不正确',result:{}});\n});\n\nemitter.on('setUserLoginTokenKey',()=>{\n\tuserLoginTokenKey = `${userLoginTokenKey}:${userToken}`;\n\tuserLoginTokenSetKey = `${userLoginTokenSetKey}:${userInfo._id}`;\n});\n\nemitter.on('getUserToken',()=>{\n\t_F('service_xk6eian5Dd').call({},(data)=>{\n\t\tuserToken = data.result;\n\t});\n\t\n});\n\nemitter.on('getUserTokenSet',()=>{\n\t_F('bCacheTemp_wJfaNQwj3d').callMethod('get',{\n\t\t\tkey:userLoginTokenSetKey,\n\t\t\tsuccess:(data)=>{\n\t\t\t\tif(data)\n\t\t\t\t\tuserTokenSet = JSON.parse(data);\n\t\t\t\t\n\t\t\t\temitter.emit('checkMultLogin');\n\t\t\t\temitter.emit('checkUseCookie');\n\t\t\t},\n\t\t\tfail:()=>{\n\t\t\t}\n\t\t});\n\t\n});\n\nemitter.on('delUserToken',(token)=>{\n\t//调用 后台缓存redis组件.缓存删除(用户登录串缓存key)\n\t\t_F('bCacheTemp_wJfaNQwj3d').callMethod('del',{\n\t\t\tkey:`userLoginToken:${token}`,\n\t\t\tsuccess:(data)=>{\n\t\t\t},\n\t\t\tfail:()=>{\n\t\t\t}\n\t\t});\n});\n\nemitter.on('setUserToken',()=>{\n\t\t_F('bCacheTemp_wJfaNQwj3d').callMethod('set',{\n\t\t\tkey:userLoginTokenKey,\n\t\t\tvalue:JSON.stringify(userInfo),\n\t\t\texpire:loginExpire,\n\t\t\tsuccess:(data)=>{\n\t\t\t},\n\t\t\tfail:()=>{\n\t\t\t}\n\t\t});\n});\n\nemitter.on('setCookie',()=>{\n\t\t_F('cookie_func').callMethod('set',{\n\t\t\tname: cookieKey,\n\t\t\tvalue:userToken,\n\t\t\texpire:loginExpire,\n\t\t\tpath:'/',\n\t\t\tdomain: cookieHost,\n\t\t\t//sameSite: 'None'\n\t\t});\n});\n\nemitter.on('setUserTokenSet',()=>{\n\t\t_F('bCacheTemp_wJfaNQwj3d').callMethod('set',{\n\t\t\tkey:userLoginTokenSetKey,\n\t\t\tvalue:JSON.stringify(userTokenSet),\n\t\t\texpire:3600,\n\t\t\tsuccess:(data)=>{\n\t\t\t},\n\t\t\tfail:()=>{\n\t\t\t}\n\t\t});\n});\n\nemitter.on('checkMultLogin',()=>{\n\tuserInfo.multLogin = multLogin;\n\tconsole.log('checkMultLogin',userTokenSet,!multLogin);\n\tif(!multLogin){\n\t\tuserTokenSet.map(item => {\n\t\t\temitter.emit('delUserToken',item);\n\t\t});\n\t\tuserTokenSet = [];\n\t}\n\tuserTokenSet.push(userToken);\n\t//调用 后台缓存redis组件.缓存设置(用户登录串缓存key集合,tokenSet,登录有效时长)\n\temitter.emit('setUserTokenSet');\n\t//调用 后台缓存redis组件.缓存设置(用户登录串缓存key:token,用户信息对象,登录有效时长)\n\temitter.emit('setUserToken');\n});\n\nemitter.on('checkUseCookie',()=>{\n\tif(useCookie){\n\t\t//调用 后台cookie组件.cookie设置(用户登录串缓存key,token,登录有效时长)\n\t\temitter.emit('setCookie');\n\t}else{\n\t\tuserInfo.token = userToken;\n\t}\n\t\n\t_funcCb({code:200,errMsg:'ok',result:userInfo});\n});\n\nemitter.emit('getUserInfo');",
  4785. "inParams": [
  4786. "用户名",
  4787. "密码",
  4788. "登录有效时长",
  4789. "使用cookie",
  4790. "允许多端登录",
  4791. "cookie域名"
  4792. ],
  4793. "outParams": [
  4794. "code",
  4795. "errMsg",
  4796. "result"
  4797. ],
  4798. "openApiPath": "",
  4799. "inParamsDebug": {}
  4800. }
  4801. },
  4802. {
  4803. "id": "service_5xT7BspmbA",
  4804. "name": "用户名密码注册",
  4805. "type": "service",
  4806. "props": {
  4807. "devId": "service_5xT7BspmbA",
  4808. "isOpen": false,
  4809. "jsCode": "//let 用户信息对象 = 调用 数据表.数据表查询(用户名==用户名)\r\nconst emitter = new events.EventEmitter(); \r\n\r\nemitter.on('getUserInfo', ()=>{\r\n _F('dbTableTemp_6xG6thEJQS').callMethod('getRow',{\r\n condition:{\r\n 用户名: param.用户名,\r\n },\r\n success:(data)=>{\r\n if(Array.isArray(data) && data.length <= 0 ) \r\n \temitter.emit('addUser');\r\n else\r\n \temitter.emit('hadUser');\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n});\r\n\r\nemitter.on('hadUser',()=>{\r\n\t_funcCb({code:0,errMsg:'用户已注册,请直接登录',result:{}});\r\n});\r\n \r\nemitter.on('addUser',()=>{\r\n \tlet userInfo = {};\r\n _F('dbTableTemp_6xG6thEJQS').callMethod('addRow',{\r\n row:{\r\n 用户名: param.用户名,\r\n 密码: param.密码,\r\n 姓名: param.姓名,\r\n 角色ID: param.角色ID,\r\n 部门ID: param.部门ID,\r\n 邮箱: param.邮箱,\r\n 手机号: param.手机号,\r\n },\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'注册成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n\t\r\n});\r\n\r\nemitter.emit('getUserInfo');",
  4810. "inParams": [
  4811. "用户名",
  4812. "密码",
  4813. "姓名",
  4814. "角色ID",
  4815. "部门ID",
  4816. "邮箱",
  4817. "手机号"
  4818. ],
  4819. "outParams": [
  4820. "code",
  4821. "errMsg",
  4822. "result"
  4823. ],
  4824. "openApiPath": "",
  4825. "inParamsDebug": {
  4826. "密码": "123123",
  4827. "用户名": "13800138000"
  4828. }
  4829. }
  4830. },
  4831. {
  4832. "id": "service_8rNTjXTpbf",
  4833. "name": "获取当前登录用户信息",
  4834. "type": "service",
  4835. "props": {
  4836. "devId": "service_8rNTjXTpbf",
  4837. "isOpen": false,
  4838. "jsCode": "const emitter = new events.EventEmitter(); \n\nlet userToken = param.token;\nlet userLoginTokenKey = 'userLoginToken';//用户登录串缓存key \nlet cookieKeyPrefix = _F('variable_GP2sBWntRd').callMethod('get');\nlet cookieKey = cookieKeyPrefix + userLoginTokenKey;//用户登录串CookieKey\nlet userInfo = null;\n\n\nemitter.on('getUserInfo',()=>{\n\tif(userToken){\n\t\tuserLoginTokenKey = `${userLoginTokenKey}:${userToken}`;\n\t\t_F('bCacheTemp_wJfaNQwj3d').callMethod('get',{\n\t\t\t\tkey:userLoginTokenKey,\n\t\t\t\tsuccess:(data)=>{\n\t\t\t\t\tconsole.log('getUserInfo.success',data);\n\t\t\t\t\tif(data){\n\t\t\t\t\t\tuserInfo = JSON.parse(data);\n\t\t\t\t\t\t_funcCb({code:200,errMsg:'已登录',result:userInfo});\n\t\t\t\t\t}\n\t\t\t\t\telse \n\t\t\t\t\t\temitter.emit('noUserInfo');\n\t\t\t\t},\n\t\t\t\tfail:(err)=>{\n\t\t\t\t\t_funcCb({code:0,errMsg:'获取登录信息缓存失败',result:err});\n\t\t\t\t}\n\t\t\t});\n\t\t\n\t}\n\telse \n\t\temitter.emit('noUserInfo');\n});\n\nemitter.on('getUserTokenCookie',()=>{\n\t\tuserToken = _F('cookie_func').callMethod('get',{\n\t\t\tname:cookieKey\n\t\t});\n});\n\nemitter.on('noUserInfo',()=>{\n\t_funcCb({code:0,errMsg:'请先登录',result:{}});\n});\n\nif(!userToken)\n\temitter.emit('getUserTokenCookie');\n\nemitter.emit('getUserInfo');",
  4839. "inParams": [
  4840. "token"
  4841. ],
  4842. "outParams": [
  4843. "code",
  4844. "errMsg",
  4845. "result"
  4846. ],
  4847. "openApiPath": "",
  4848. "inParamsDebug": {}
  4849. }
  4850. },
  4851. {
  4852. "id": "service_hB82nRtmDR",
  4853. "name": "退出登录",
  4854. "type": "service",
  4855. "props": {
  4856. "devId": "service_hB82nRtmDR",
  4857. "isOpen": false,
  4858. "jsCode": "const emitter = new events.EventEmitter(); \n\nlet userToken = param.token;\nlet cookieHost = param.cookie域名?param.cookie域名:'';\nlet userLoginTokenKey = 'userLoginToken';//用户登录串缓存key \nlet cookieKeyPrefix = _F('variable_GP2sBWntRd').callMethod('get');\nlet cookieKey = cookieKeyPrefix + userLoginTokenKey;//用户登录串CookieKey\nlet userInfo = null;\n\n\nemitter.on('getUserInfo',()=>{\n\tif(userToken){\n\t\tlet userLoginTokenCacheKey = `${userLoginTokenKey}:${userToken}`;\n\t\t _F('bCacheTemp_wJfaNQwj3d').callMethod('get',{\n\t\t\t\tkey:userLoginTokenCacheKey,\n\t\t\t\tsuccess:(data)=>{\n\t\t\t\t\tconsole.log('getUserInfo.success',data);\n\t\t\t\t\tif(data){\n\t\t\t\t\t\temitter.emit('delUserTokenCache',userLoginTokenCacheKey);\n\t\t\t\t\t}\n\t\t\t\t\telse \n\t\t\t\t\t\temitter.emit('noUserInfo');\n\t\t\t\t},\n\t\t\t\tfail:(err)=>{\n\t\t\t\t\t_funcCb({code:0,errMsg:'获取登录信息缓存失败',result:err});\n\t\t\t\t}\n\t\t\t});\n\t\t\n\t}\n\telse \n\t\temitter.emit('noUserInfo');\n});\n\nemitter.on('getUserTokenCookie',()=>{\n\t\tuserToken = _F('cookie_func').callMethod('get',{\n\t\t\tname:cookieKey\n\t\t});\n});\n\nemitter.on('noUserInfo',()=>{\n\t_funcCb({code:0,errMsg:'请先登录',result:{}});\n});\n\nemitter.on('delUserTokenCookie',()=>{\n\t_F('cookie_func').callMethod('del',{\n name:cookieKey,\n\t\texpire:-3600,\n\t\tpath:'/',\n\t\tdomain: cookieHost,\n });\n _funcCb({code:200,errMsg:'退出登录成功',result:{}});\n});\n\nemitter.on('delUserTokenCache',(userLoginTokenCacheKey)=>{\n\t_F('bCacheTemp_wJfaNQwj3d').callMethod('del',{\n key:userLoginTokenCacheKey,\n success:(data)=>{\n emitter.emit('delUserTokenCookie');\n },\n fail:(err)=>{\n _funcCb({code:0,errMsg:'删除登录信息缓存失败',result:err});\n }\n });\n});\n\nif(!userToken)\n\temitter.emit('getUserTokenCookie');\n\nemitter.emit('getUserInfo');",
  4859. "inParams": [
  4860. "token",
  4861. "cookie域名"
  4862. ],
  4863. "outParams": [],
  4864. "openApiPath": "",
  4865. "inParamsDebug": {}
  4866. }
  4867. }
  4868. ]
  4869. }
  4870. ]
  4871. },
  4872. {
  4873. "id": "state_d7R7cMwF2P",
  4874. "type": "state",
  4875. "children": []
  4876. },
  4877. {
  4878. "id": "services_EF2fNWmFBW",
  4879. "type": "services",
  4880. "children": [
  4881. {
  4882. "id": "group_ZY7j4rRFaE",
  4883. "name": "数据表相关",
  4884. "type": "group",
  4885. "props": {
  4886. "devId": "group_ZY7j4rRFaE"
  4887. },
  4888. "children": [
  4889. {
  4890. "id": "dbViewTemp_R34dNixksn",
  4891. "name": "用户表_角色表_部门表视图",
  4892. "type": "dbViewTemp",
  4893. "props": {
  4894. "devId": "dbViewTemp_R34dNixksn"
  4895. }
  4896. },
  4897. {
  4898. "id": "dbTableTemp_6xG6thEJQS",
  4899. "name": "用户表",
  4900. "type": "dbTableTemp",
  4901. "props": {
  4902. "devId": "dbTableTemp_6xG6thEJQS",
  4903. "fields": [
  4904. {
  4905. "columnName": "_id",
  4906. "columnType": "int"
  4907. },
  4908. {
  4909. "columnName": "用户名",
  4910. "columnType": "text"
  4911. },
  4912. {
  4913. "columnName": "手机号",
  4914. "columnType": "text"
  4915. },
  4916. {
  4917. "columnName": "邮箱",
  4918. "columnType": "text"
  4919. },
  4920. {
  4921. "columnName": "昵称",
  4922. "columnType": "text"
  4923. },
  4924. {
  4925. "columnName": "姓名",
  4926. "columnType": "text"
  4927. },
  4928. {
  4929. "columnName": "密码",
  4930. "columnType": "text"
  4931. },
  4932. {
  4933. "columnName": "角色ID",
  4934. "columnType": "int"
  4935. },
  4936. {
  4937. "columnName": "部门ID",
  4938. "columnType": "int"
  4939. },
  4940. {
  4941. "columnName": "是否禁用",
  4942. "columnType": "int"
  4943. },
  4944. {
  4945. "columnName": "是否删除",
  4946. "columnType": "int"
  4947. },
  4948. {
  4949. "columnName": "_create",
  4950. "columnType": "int"
  4951. },
  4952. {
  4953. "columnName": "_update",
  4954. "columnType": "int"
  4955. }
  4956. ]
  4957. }
  4958. },
  4959. {
  4960. "id": "bCacheTemp_wJfaNQwj3d",
  4961. "name": "用户登录信息缓存",
  4962. "type": "bCacheTemp",
  4963. "props": {
  4964. "devId": "bCacheTemp_wJfaNQwj3d"
  4965. }
  4966. }
  4967. ]
  4968. },
  4969. {
  4970. "id": "group_rTsCTAeH2W",
  4971. "name": "内部方法",
  4972. "type": "group",
  4973. "props": {
  4974. "devId": "group_rTsCTAeH2W"
  4975. },
  4976. "children": [
  4977. {
  4978. "id": "service_xk6eian5Dd",
  4979. "name": "用户token生成",
  4980. "type": "service",
  4981. "props": {
  4982. "devId": "service_xk6eian5Dd",
  4983. "isOpen": false,
  4984. "jsCode": "let token = _F('string_func').callMethod('randomString',{length:32});\n\n_funcCb({code:200,errMsg:'ok',result:token});",
  4985. "inParams": [],
  4986. "outParams": [
  4987. "code",
  4988. "errMsg",
  4989. "result"
  4990. ],
  4991. "openApiPath": "",
  4992. "inParamsDebug": {}
  4993. }
  4994. }
  4995. ]
  4996. }
  4997. ]
  4998. }
  4999. ]
  5000. },
  5001. {
  5002. "id": "front_kef7tp26Qn",
  5003. "name": "前台",
  5004. "type": "front",
  5005. "props": {
  5006. "style": {
  5007. "width": "100%",
  5008. "height": "100%",
  5009. "display": "flex",
  5010. "overflow": "hidden auto",
  5011. "alignItems": "flex-start",
  5012. "flexDirection": "column",
  5013. "backgroundColor": "#ffffff"
  5014. }
  5015. },
  5016. "children": [
  5017. {
  5018. "id": "props_RPMa4r7Zhn",
  5019. "type": "props",
  5020. "children": [
  5021. {
  5022. "id": "fPAttr_KBYXNxe27H",
  5023. "type": "fPAttr",
  5024. "children": []
  5025. },
  5026. {
  5027. "id": "fPMethod_5SiWyamj8E",
  5028. "type": "fPMethod",
  5029. "children": []
  5030. },
  5031. {
  5032. "id": "fPEvent_j4csRMZc7X",
  5033. "type": "fPEvent",
  5034. "children": []
  5035. }
  5036. ]
  5037. },
  5038. {
  5039. "id": "state_5nzE7DabXz",
  5040. "type": "state",
  5041. "children": []
  5042. },
  5043. {
  5044. "id": "method_FSJADG5KbG",
  5045. "type": "method",
  5046. "children": []
  5047. },
  5048. {
  5049. "id": "dom_nhmXymtpyy",
  5050. "type": "dom",
  5051. "children": []
  5052. }
  5053. ]
  5054. },
  5055. {
  5056. "id": "config_hZ3XAC6B2n",
  5057. "name": "员工中台模块",
  5058. "type": "config",
  5059. "props": {
  5060. "style": {}
  5061. }
  5062. }
  5063. ]
  5064. },
  5065. {
  5066. "id": "module_FBsbDYPT8B",
  5067. "name": "菜单管理后台组件",
  5068. "type": "module",
  5069. "props": {
  5070. "devId": "module_FBsbDYPT8B",
  5071. "appModuleId": "62",
  5072. "appModuleVersion": 19
  5073. },
  5074. "children": [
  5075. {
  5076. "id": "modules_eGGWa3zPdy",
  5077. "name": "模块",
  5078. "type": "modules",
  5079. "props": {}
  5080. },
  5081. {
  5082. "id": "backend_A3a5KkSC5Y",
  5083. "name": "后台",
  5084. "type": "backend",
  5085. "props": {
  5086. "style": {
  5087. "height": "200px",
  5088. "backgroundColor": "red"
  5089. }
  5090. },
  5091. "children": [
  5092. {
  5093. "id": "props_wctBdy7F2d",
  5094. "type": "props",
  5095. "children": [
  5096. {
  5097. "id": "bPAttr_yhKfrEfrSc",
  5098. "type": "bPAttr",
  5099. "children": []
  5100. },
  5101. {
  5102. "id": "bPMethod_HbFJKkNY5J",
  5103. "type": "bPMethod",
  5104. "children": [
  5105. {
  5106. "id": "service_zYN6Kpynpy",
  5107. "name": "菜单关键字搜索服务",
  5108. "type": "service",
  5109. "props": {
  5110. "devId": "service_zYN6Kpynpy",
  5111. "isOpen": false,
  5112. "jsCode": "const emitter = new events.EventEmitter(); \r\nlet condition = {};\r\n\r\nlet pageNum = param.hasOwnProperty('当前页码') && param.当前页码 > 0?parseInt(param.当前页码):1;\r\nlet pageSize = param.hasOwnProperty('每页大小') && param.每页大小 > 0?parseInt(param.每页大小):10;\r\nlet deptTotal = 0;\r\nlet deptList = [];\r\n\r\n\r\nemitter.on('output', (parentNames)=>{\r\n\r\n deptList = deptList.map(item => {\r\n let pInfo = parentNames.find(tmp => item.上级菜单ID == tmp._id);\r\n item.上级菜单名称 = pInfo?pInfo.菜单名称:'';\r\n return item;\r\n })\r\n\r\n _funcCb({\r\n code:200,\r\n errMsg:'ok',\r\n result:deptList,\r\n total:deptTotal\r\n });\r\n})\r\n\r\nemitter.on('setCondition', ()=>{\r\n if(param.hasOwnProperty('菜单名称'))condition['菜单名称'] = ['like',param.菜单名称];\r\n if(param.hasOwnProperty('上级菜单ID') && param.上级菜单ID != 'all')condition['上级菜单ID'] = param.上级菜单ID;\r\n if(param.hasOwnProperty('是否删除'))condition['是否删除'] = param.是否删除;\r\n if(param.hasOwnProperty('是否禁用'))condition['是否禁用'] = param.是否禁用;\r\n});\r\n\r\nemitter.on('getTotal', ()=>{\r\n\r\n _F('dbTableTemp_nr37DhHs56').callMethod('getCount',{\r\n condition,\r\n success:(res)=>{\r\n emitter.emit('getList',res[0].count);\r\n },\r\n fail:(err)=>{\r\n _funcCb({\r\n code:0,\r\n errMsg:'获取列表总数失败',\r\n result:err,\r\n total:0\r\n });\r\n },\r\n \r\n });\r\n});\r\n\r\nemitter.on('getList', (total)=>{\r\n\r\n _F('dbTableTemp_nr37DhHs56').callMethod('getRows',{\r\n condition,\r\n pageNum,\r\n pageSize,\r\n orderby:'排序',\r\n sort:'desc',\r\n success:(res)=>{\r\n deptTotal = total;\r\n deptList = res;\r\n emitter.emit('getPids');\r\n },\r\n fail:(err)=>{\r\n _funcCb({\r\n code:0,\r\n errMsg:'获取列表失败',\r\n result:err,\r\n total:0\r\n });\r\n },\r\n \r\n });\r\n});\r\n\r\nemitter.on('getPids', ()=>{\r\n let pids = [];\r\n deptList.map(item => pids.push(item.上级菜单ID));\r\n emitter.emit('getParentNames',pids);\r\n})\r\n\r\nemitter.on('getParentNames', (pids)=>{\r\n _F('dbTableTemp_nr37DhHs56').callMethod('getRows',{\r\n condition:{\r\n _id:['in',pids]\r\n },\r\n pageNum:1,\r\n pageSize:100,\r\n orderby:'_update',\r\n sort:'desc',\r\n success:(res)=>{\r\n emitter.emit('output',res);\r\n },\r\n fail:(err)=>{\r\n _funcCb({\r\n code:0,\r\n errMsg:'获取上级菜单列表失败',\r\n result:err,\r\n });\r\n },\r\n \r\n });\r\n});\r\n\r\nemitter.emit('setCondition');\r\nemitter.emit('getTotal');",
  5113. "inParams": [
  5114. "菜单名称",
  5115. "上级菜单ID",
  5116. "当前页码",
  5117. "每页大小",
  5118. "是否删除",
  5119. "是否禁用"
  5120. ],
  5121. "outParams": [],
  5122. "openApiPath": "",
  5123. "inParamsDebug": {}
  5124. }
  5125. },
  5126. {
  5127. "id": "service_FHxSD7RYtT",
  5128. "name": "菜单删除服务",
  5129. "type": "service",
  5130. "props": {
  5131. "devId": "service_FHxSD7RYtT",
  5132. "isOpen": false,
  5133. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(param.hasOwnProperty('菜单ID') && param['菜单ID'] > 0)emitter.emit('editDept');\r\nelse emitter.emit('noDeptID');\r\n\r\n\r\nemitter.on('noDeptID', ()=>{\r\n _funcCb({code:0,errMsg:'请传入菜单ID',result:{}});\r\n})\r\n\r\nemitter.on('editDept', ()=>{\r\n let condition = {};\r\n condition['_id'] = param.菜单ID;\r\n\r\n let editObj = {};\r\n if(param.hasOwnProperty('是否删除'))editObj['是否删除'] = param.是否删除 == 1?1:0;\r\n\r\n _F('dbTableTemp_nr37DhHs56').callMethod('editRow',{\r\n row:editObj,\r\n condition,\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'操作成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('editDept');",
  5134. "inParams": [
  5135. "菜单ID",
  5136. "是否删除"
  5137. ],
  5138. "outParams": [],
  5139. "openApiPath": "",
  5140. "inParamsDebug": {}
  5141. }
  5142. },
  5143. {
  5144. "id": "service_cF6TRXP68X",
  5145. "name": "菜单编辑服务",
  5146. "type": "service",
  5147. "props": {
  5148. "devId": "service_cF6TRXP68X",
  5149. "isOpen": false,
  5150. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(param.hasOwnProperty('菜单ID') && param['菜单ID'] > 0)emitter.emit('editDept');\r\nelse emitter.emit('noDeptID');\r\n\r\n\r\nemitter.on('noDeptID', ()=>{\r\n _funcCb({code:0,errMsg:'请传入菜单ID',result:{}});\r\n})\r\n\r\nemitter.on('editDept', ()=>{\r\n let condition = {};\r\n condition['_id'] = param.菜单ID;\r\n\r\n let editObj = {};\r\n if(param.hasOwnProperty('key'))editObj['key'] = param.key;\r\n if(param.hasOwnProperty('菜单名称'))editObj['菜单名称'] = param.菜单名称;\r\n if(param.hasOwnProperty('上级菜单ID'))editObj['上级菜单ID'] = param.上级菜单ID;\r\n if(param.hasOwnProperty('类型'))editObj['类型'] = param.类型;\r\n if(param.hasOwnProperty('排序'))editObj['排序'] = param.排序;\r\n if(param.hasOwnProperty('页面路径'))editObj['页面路径'] = param.页面路径;\r\n if(param.hasOwnProperty('接口路径'))editObj['接口路径'] = param.接口路径;\r\n if(param.hasOwnProperty('是否禁用'))editObj['是否禁用'] = param.是否禁用 == 1?1:0;\r\n\r\n _F('dbTableTemp_nr37DhHs56').callMethod('editRow',{\r\n row:editObj,\r\n condition,\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'编辑成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('editDept');",
  5151. "inParams": [
  5152. "菜单ID",
  5153. "菜单名称",
  5154. "上级菜单ID",
  5155. "是否禁用",
  5156. "类型",
  5157. "排序",
  5158. "页面路径",
  5159. "接口路径",
  5160. "key"
  5161. ],
  5162. "outParams": [],
  5163. "openApiPath": "",
  5164. "inParamsDebug": {}
  5165. }
  5166. },
  5167. {
  5168. "id": "service_jQ4AEAwPSy",
  5169. "name": "菜单新增服务",
  5170. "type": "service",
  5171. "props": {
  5172. "devId": "service_jQ4AEAwPSy",
  5173. "isOpen": false,
  5174. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nlet 上级菜单ID= param.上级菜单ID?param.上级菜单ID:0;\r\n\r\nemitter.on('addDept', ()=>{\r\n _F('dbTableTemp_nr37DhHs56').callMethod('addRow',{\r\n row:{\r\n key: param.key,\r\n 菜单名称: param.菜单名称,\r\n 上级菜单ID,\r\n 类型: param.类型,\r\n 排序: param.排序,\r\n 页面路径: param.页面路径,\r\n 接口路径: param.接口路径,\r\n 是否禁用:0,\r\n 是否删除:0\r\n },\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'新增成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('addDept');",
  5175. "inParams": [
  5176. "菜单名称",
  5177. "上级菜单ID",
  5178. "类型",
  5179. "排序",
  5180. "页面路径",
  5181. "接口路径",
  5182. "key"
  5183. ],
  5184. "outParams": [],
  5185. "openApiPath": "",
  5186. "inParamsDebug": {}
  5187. }
  5188. }
  5189. ]
  5190. }
  5191. ]
  5192. },
  5193. {
  5194. "id": "state_4BtzhprQ6m",
  5195. "type": "state",
  5196. "children": []
  5197. },
  5198. {
  5199. "id": "services_ZYjkDm6kcb",
  5200. "type": "services",
  5201. "children": [
  5202. {
  5203. "id": "group_NrSDpMdKGr",
  5204. "name": "数据表",
  5205. "type": "group",
  5206. "props": {
  5207. "devId": "group_NrSDpMdKGr"
  5208. },
  5209. "children": [
  5210. {
  5211. "id": "dbTableTemp_nr37DhHs56",
  5212. "name": "菜单表",
  5213. "type": "dbTableTemp",
  5214. "props": {
  5215. "devId": "dbTableTemp_nr37DhHs56",
  5216. "fields": [
  5217. {
  5218. "columnName": "_id",
  5219. "columnType": "int"
  5220. },
  5221. {
  5222. "columnName": "key",
  5223. "columnType": "text"
  5224. },
  5225. {
  5226. "columnName": "菜单名称",
  5227. "columnType": "text"
  5228. },
  5229. {
  5230. "columnName": "上级菜单ID",
  5231. "columnType": "text"
  5232. },
  5233. {
  5234. "columnName": "类型",
  5235. "columnType": "text"
  5236. },
  5237. {
  5238. "columnName": "排序",
  5239. "columnType": "int"
  5240. },
  5241. {
  5242. "columnName": "页面路径",
  5243. "columnType": "text"
  5244. },
  5245. {
  5246. "columnName": "接口路径",
  5247. "columnType": "text"
  5248. },
  5249. {
  5250. "columnName": "是否禁用",
  5251. "columnType": "text"
  5252. },
  5253. {
  5254. "columnName": "是否删除",
  5255. "columnType": "text"
  5256. },
  5257. {
  5258. "columnName": "_create",
  5259. "columnType": "int"
  5260. },
  5261. {
  5262. "columnName": "_update",
  5263. "columnType": "int"
  5264. }
  5265. ]
  5266. }
  5267. }
  5268. ]
  5269. },
  5270. {
  5271. "id": "group_EyYxZ6nFyk",
  5272. "name": "中台服务",
  5273. "type": "group",
  5274. "props": {
  5275. "devId": "group_EyYxZ6nFyk"
  5276. }
  5277. }
  5278. ]
  5279. }
  5280. ]
  5281. },
  5282. {
  5283. "id": "front_nBw4mS8TiS",
  5284. "name": "前台",
  5285. "type": "front",
  5286. "props": {
  5287. "style": {
  5288. "width": "100%",
  5289. "height": "100%",
  5290. "display": "flex",
  5291. "overflow": "hidden auto",
  5292. "alignItems": "flex-start",
  5293. "flexDirection": "column",
  5294. "backgroundColor": "#ffffff"
  5295. }
  5296. },
  5297. "children": [
  5298. {
  5299. "id": "props_JmBY4ZjeRG",
  5300. "type": "props",
  5301. "children": [
  5302. {
  5303. "id": "fPAttr_NyATkW28nD",
  5304. "type": "fPAttr",
  5305. "children": []
  5306. },
  5307. {
  5308. "id": "fPMethod_cephaF7hEm",
  5309. "type": "fPMethod",
  5310. "children": []
  5311. },
  5312. {
  5313. "id": "fPEvent_8AZirsM2z2",
  5314. "type": "fPEvent",
  5315. "children": []
  5316. }
  5317. ]
  5318. },
  5319. {
  5320. "id": "state_dCkEFF82en",
  5321. "type": "state",
  5322. "children": []
  5323. },
  5324. {
  5325. "id": "method_h8N5JjfPzx",
  5326. "type": "method",
  5327. "children": []
  5328. },
  5329. {
  5330. "id": "dom_PCTeGz3GWn",
  5331. "type": "dom",
  5332. "children": []
  5333. }
  5334. ]
  5335. },
  5336. {
  5337. "id": "config_PXxWFjM5Ne",
  5338. "name": "菜单管理后台组件",
  5339. "type": "config",
  5340. "props": {
  5341. "style": {}
  5342. }
  5343. }
  5344. ]
  5345. },
  5346. {
  5347. "id": "module_C8GjKaaHBs",
  5348. "name": "部门编辑后台组件",
  5349. "type": "module",
  5350. "props": {
  5351. "devId": "module_C8GjKaaHBs",
  5352. "appModuleId": "26",
  5353. "appModuleVersion": 29
  5354. },
  5355. "children": [
  5356. {
  5357. "id": "modules_xy4ffTyG4B",
  5358. "name": "模块",
  5359. "type": "modules",
  5360. "props": {}
  5361. },
  5362. {
  5363. "id": "backend_mSBKMWR8BJ",
  5364. "name": "后台",
  5365. "type": "backend",
  5366. "props": {
  5367. "style": {
  5368. "height": "200px",
  5369. "backgroundColor": "red"
  5370. }
  5371. },
  5372. "children": [
  5373. {
  5374. "id": "props_N8CBWDrmnK",
  5375. "type": "props",
  5376. "children": [
  5377. {
  5378. "id": "bPAttr_4zQkaDaSwn",
  5379. "type": "bPAttr",
  5380. "children": []
  5381. },
  5382. {
  5383. "id": "bPMethod_DZnrsmfJGF",
  5384. "type": "bPMethod",
  5385. "children": [
  5386. {
  5387. "id": "service_zYN6Kpynpy",
  5388. "name": "部门关键字搜索服务",
  5389. "type": "service",
  5390. "props": {
  5391. "devId": "service_zYN6Kpynpy",
  5392. "isOpen": false,
  5393. "jsCode": "const emitter = new events.EventEmitter(); \r\nlet condition = {};\r\n\r\nlet pageNum = param.hasOwnProperty('当前页码') && param.当前页码 > 0?parseInt(param.当前页码):1;\r\nlet pageSize = param.hasOwnProperty('每页大小') && param.每页大小 > 0?parseInt(param.每页大小):10;\r\nlet deptTotal = 0;\r\nlet deptList = [];\r\n\r\n\r\nemitter.on('output', (parentNames)=>{\r\n\r\n deptList = deptList.map(item => {\r\n let pInfo = parentNames.find(tmp => item.上级部门ID == tmp._id);\r\n item.上级部门名称 = pInfo?pInfo.部门名称:'';\r\n return item;\r\n })\r\n\r\n _funcCb({\r\n code:200,\r\n errMsg:'ok',\r\n result:deptList,\r\n total:deptTotal\r\n });\r\n})\r\n\r\nemitter.on('setCondition', ()=>{\r\n if(param.hasOwnProperty('部门名称'))condition['部门名称'] = ['like',param.部门名称];\r\n if(param.hasOwnProperty('上级部门ID'))condition['上级部门ID'] = param.上级部门ID;\r\n if(param.hasOwnProperty('是否删除'))condition['是否删除'] = param.是否删除;\r\n if(param.hasOwnProperty('是否禁用'))condition['是否禁用'] = param.是否禁用;\r\n});\r\n\r\nemitter.on('getTotal', ()=>{\r\n\r\n _F('dbTableTemp_nr37DhHs56').callMethod('getCount',{\r\n condition,\r\n success:(res)=>{\r\n emitter.emit('getList',res[0].count);\r\n },\r\n fail:(err)=>{\r\n _funcCb({\r\n code:0,\r\n errMsg:'获取列表总数失败',\r\n result:err,\r\n total:0\r\n });\r\n },\r\n \r\n });\r\n});\r\n\r\nemitter.on('getList', (total)=>{\r\n\r\n _F('dbTableTemp_nr37DhHs56').callMethod('getRows',{\r\n condition,\r\n pageNum,\r\n pageSize,\r\n orderby:'_update',\r\n sort:'desc',\r\n success:(res)=>{\r\n deptTotal = total;\r\n deptList = res;\r\n emitter.emit('getPids');\r\n },\r\n fail:(err)=>{\r\n _funcCb({\r\n code:0,\r\n errMsg:'获取列表失败',\r\n result:err,\r\n total:0\r\n });\r\n },\r\n \r\n });\r\n});\r\n\r\nemitter.on('getPids', ()=>{\r\n let pids = [];\r\n deptList.map(item => pids.push(item.上级部门ID));\r\n emitter.emit('getParentNames',pids);\r\n})\r\n\r\nemitter.on('getParentNames', (pids)=>{\r\n _F('dbTableTemp_nr37DhHs56').callMethod('getRows',{\r\n condition:{\r\n _id:['in',pids]\r\n },\r\n pageNum:1,\r\n pageSize:100,\r\n orderby:'_update',\r\n sort:'desc',\r\n success:(res)=>{\r\n emitter.emit('output',res);\r\n },\r\n fail:(err)=>{\r\n _funcCb({\r\n code:0,\r\n errMsg:'获取上级部门列表失败',\r\n result:err,\r\n });\r\n },\r\n \r\n });\r\n});\r\n\r\nemitter.emit('setCondition');\r\nemitter.emit('getTotal');",
  5394. "inParams": [
  5395. "部门名称",
  5396. "上级部门ID",
  5397. "当前页码",
  5398. "每页大小",
  5399. "是否删除",
  5400. "是否禁用"
  5401. ],
  5402. "outParams": [],
  5403. "openApiPath": "",
  5404. "inParamsDebug": {}
  5405. }
  5406. },
  5407. {
  5408. "id": "service_FHxSD7RYtT",
  5409. "name": "部门删除服务",
  5410. "type": "service",
  5411. "props": {
  5412. "devId": "service_FHxSD7RYtT",
  5413. "isOpen": false,
  5414. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(param.hasOwnProperty('部门ID') && param['部门ID'] > 0)emitter.emit('editDept');\r\nelse emitter.emit('noDeptID');\r\n\r\n\r\nemitter.on('noDeptID', ()=>{\r\n _funcCb({code:0,errMsg:'请传入部门ID',result:{}});\r\n})\r\n\r\nemitter.on('editDept', ()=>{\r\n let condition = {};\r\n condition['_id'] = param.部门ID;\r\n\r\n let editObj = {};\r\n if(param.hasOwnProperty('是否删除'))editObj['是否删除'] = param.是否删除 == 1?1:0;\r\n\r\n _F('dbTableTemp_nr37DhHs56').callMethod('editRow',{\r\n row:editObj,\r\n condition,\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'操作成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('editDept');",
  5415. "inParams": [
  5416. "部门ID",
  5417. "是否删除"
  5418. ],
  5419. "outParams": [],
  5420. "openApiPath": "",
  5421. "inParamsDebug": {}
  5422. }
  5423. },
  5424. {
  5425. "id": "service_cF6TRXP68X",
  5426. "name": "部门编辑服务",
  5427. "type": "service",
  5428. "props": {
  5429. "devId": "service_cF6TRXP68X",
  5430. "isOpen": false,
  5431. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(param.hasOwnProperty('部门ID') && param['部门ID'] > 0)emitter.emit('editDept');\r\nelse emitter.emit('noDeptID');\r\n\r\n\r\nemitter.on('noDeptID', ()=>{\r\n _funcCb({code:0,errMsg:'请传入部门ID',result:{}});\r\n})\r\n\r\nemitter.on('editDept', ()=>{\r\n let condition = {};\r\n condition['_id'] = param.部门ID;\r\n\r\n let editObj = {};\r\n if(param.hasOwnProperty('部门名称'))editObj['部门名称'] = param.部门名称;\r\n if(param.hasOwnProperty('上级部门ID'))editObj['上级部门ID'] = param.上级部门ID;\r\n if(param.hasOwnProperty('是否禁用'))editObj['是否禁用'] = param.是否禁用 == 1?1:0;\r\n\r\n _F('dbTableTemp_nr37DhHs56').callMethod('editRow',{\r\n row:editObj,\r\n condition,\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'编辑成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('editDept');",
  5432. "inParams": [
  5433. "部门ID",
  5434. "部门名称",
  5435. "上级部门ID",
  5436. "是否禁用"
  5437. ],
  5438. "outParams": [],
  5439. "openApiPath": "",
  5440. "inParamsDebug": {}
  5441. }
  5442. },
  5443. {
  5444. "id": "service_jQ4AEAwPSy",
  5445. "name": "部门新增服务",
  5446. "type": "service",
  5447. "props": {
  5448. "devId": "service_jQ4AEAwPSy",
  5449. "isOpen": false,
  5450. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('addDept', ()=>{\r\n _F('dbTableTemp_nr37DhHs56').callMethod('addRow',{\r\n row:{\r\n 部门名称: param.部门名称,\r\n 上级部门ID: param.上级部门ID,\r\n 是否禁用:0,\r\n 是否删除:0\r\n },\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'新增成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('addDept');",
  5451. "inParams": [
  5452. "部门名称",
  5453. "上级部门ID"
  5454. ],
  5455. "outParams": [],
  5456. "openApiPath": "",
  5457. "inParamsDebug": {}
  5458. }
  5459. }
  5460. ]
  5461. }
  5462. ]
  5463. },
  5464. {
  5465. "id": "state_TaetSk3sXr",
  5466. "type": "state",
  5467. "children": []
  5468. },
  5469. {
  5470. "id": "services_8ySS6cizZX",
  5471. "type": "services",
  5472. "children": [
  5473. {
  5474. "id": "group_NrSDpMdKGr",
  5475. "name": "数据表",
  5476. "type": "group",
  5477. "props": {
  5478. "devId": "group_NrSDpMdKGr"
  5479. },
  5480. "children": [
  5481. {
  5482. "id": "dbTableTemp_nr37DhHs56",
  5483. "name": "部门表",
  5484. "type": "dbTableTemp",
  5485. "props": {
  5486. "devId": "dbTableTemp_nr37DhHs56",
  5487. "fields": [
  5488. {
  5489. "columnName": "_id",
  5490. "columnType": "int"
  5491. },
  5492. {
  5493. "columnName": "部门名称",
  5494. "columnType": "text"
  5495. },
  5496. {
  5497. "columnName": "上级部门ID",
  5498. "columnType": "text"
  5499. },
  5500. {
  5501. "columnName": "是否禁用",
  5502. "columnType": "text"
  5503. },
  5504. {
  5505. "columnName": "是否删除",
  5506. "columnType": "text"
  5507. },
  5508. {
  5509. "columnName": "_create",
  5510. "columnType": "int"
  5511. },
  5512. {
  5513. "columnName": "_update",
  5514. "columnType": "int"
  5515. }
  5516. ]
  5517. }
  5518. }
  5519. ]
  5520. },
  5521. {
  5522. "id": "group_EyYxZ6nFyk",
  5523. "name": "中台服务",
  5524. "type": "group",
  5525. "props": {
  5526. "devId": "group_EyYxZ6nFyk"
  5527. }
  5528. }
  5529. ]
  5530. }
  5531. ]
  5532. },
  5533. {
  5534. "id": "front_K4Xe5AWCMH",
  5535. "name": "前台",
  5536. "type": "front",
  5537. "props": {
  5538. "style": {
  5539. "width": "100%",
  5540. "height": "100%",
  5541. "display": "flex",
  5542. "overflow": "hidden auto",
  5543. "alignItems": "flex-start",
  5544. "flexDirection": "column",
  5545. "backgroundColor": "#ffffff"
  5546. }
  5547. },
  5548. "children": [
  5549. {
  5550. "id": "props_BAKYscBfHn",
  5551. "type": "props",
  5552. "children": [
  5553. {
  5554. "id": "fPAttr_xjDs75sKS6",
  5555. "type": "fPAttr",
  5556. "children": []
  5557. },
  5558. {
  5559. "id": "fPMethod_6hdT5CzeXJ",
  5560. "type": "fPMethod",
  5561. "children": []
  5562. },
  5563. {
  5564. "id": "fPEvent_C4ai7WmPsa",
  5565. "type": "fPEvent",
  5566. "children": []
  5567. }
  5568. ]
  5569. },
  5570. {
  5571. "id": "state_D2pYjjJcQT",
  5572. "type": "state",
  5573. "children": []
  5574. },
  5575. {
  5576. "id": "method_ASGZDsmDaP",
  5577. "type": "method",
  5578. "children": []
  5579. },
  5580. {
  5581. "id": "dom_EGb6rjBaJj",
  5582. "type": "dom",
  5583. "children": []
  5584. }
  5585. ]
  5586. },
  5587. {
  5588. "id": "config_BjQ3ZjDD2h",
  5589. "name": "部门编辑后台组件",
  5590. "type": "config",
  5591. "props": {
  5592. "style": {}
  5593. }
  5594. }
  5595. ]
  5596. },
  5597. {
  5598. "id": "module_fNRWBJ426W",
  5599. "name": "角色管理后台组件",
  5600. "type": "module",
  5601. "props": {
  5602. "devId": "module_fNRWBJ426W",
  5603. "appModuleId": "74",
  5604. "appModuleVersion": 14
  5605. },
  5606. "children": [
  5607. {
  5608. "id": "modules_bYE8ZiwMpJ",
  5609. "name": "模块",
  5610. "type": "modules",
  5611. "props": {}
  5612. },
  5613. {
  5614. "id": "backend_mA7jikxK7d",
  5615. "name": "后台",
  5616. "type": "backend",
  5617. "props": {
  5618. "style": {
  5619. "height": "200px",
  5620. "backgroundColor": "red"
  5621. }
  5622. },
  5623. "children": [
  5624. {
  5625. "id": "props_f448H8f2JX",
  5626. "type": "props",
  5627. "children": [
  5628. {
  5629. "id": "bPAttr_Cpz8hcFEri",
  5630. "type": "bPAttr",
  5631. "children": []
  5632. },
  5633. {
  5634. "id": "bPMethod_MmYYheCTAE",
  5635. "type": "bPMethod",
  5636. "children": [
  5637. {
  5638. "id": "service_zYN6Kpynpy",
  5639. "name": "角色关键字搜索服务",
  5640. "type": "service",
  5641. "props": {
  5642. "devId": "service_zYN6Kpynpy",
  5643. "isOpen": false,
  5644. "jsCode": "const emitter = new events.EventEmitter(); \r\nlet condition = {};\r\n\r\nlet pageNum = param.hasOwnProperty('当前页码') && param.当前页码 > 0?parseInt(param.当前页码):1;\r\nlet pageSize = param.hasOwnProperty('每页大小') && param.每页大小 > 0?parseInt(param.每页大小):10;\r\nlet deptTotal = 0;\r\nlet deptList = [];\r\n\r\n\r\nemitter.on('output', ()=>{\r\n\r\n deptList = deptList.map(item => {\r\n if(item.菜单IDs)\r\n item.菜单IDs = JSON.parse(item.菜单IDs);\r\n \r\n return item;\r\n })\r\n\r\n _funcCb({\r\n code:200,\r\n errMsg:'ok',\r\n result:deptList,\r\n total:deptTotal\r\n });\r\n})\r\n\r\nemitter.on('setCondition', ()=>{\r\n if(param.hasOwnProperty('角色名称'))condition['角色名称'] = ['like',param.角色名称];\r\n if(param.hasOwnProperty('是否删除'))condition['是否删除'] = param.是否删除;\r\n if(param.hasOwnProperty('是否禁用'))condition['是否禁用'] = param.是否禁用;\r\n});\r\n\r\nemitter.on('getTotal', ()=>{\r\n\r\n _F('dbTableTemp_nr37DhHs56').callMethod('getCount',{\r\n condition,\r\n success:(res)=>{\r\n emitter.emit('getList',res[0].count);\r\n },\r\n fail:(err)=>{\r\n _funcCb({\r\n code:0,\r\n errMsg:'获取列表总数失败',\r\n result:err,\r\n total:0\r\n });\r\n },\r\n \r\n });\r\n});\r\n\r\nemitter.on('getList', (total)=>{\r\n\r\n _F('dbTableTemp_nr37DhHs56').callMethod('getRows',{\r\n condition,\r\n pageNum,\r\n pageSize,\r\n orderby:'_update',\r\n sort:'desc',\r\n success:(res)=>{\r\n deptTotal = total;\r\n deptList = res;\r\n emitter.emit('output');\r\n },\r\n fail:(err)=>{\r\n _funcCb({\r\n code:0,\r\n errMsg:'获取列表失败',\r\n result:err,\r\n total:0\r\n });\r\n },\r\n \r\n });\r\n});\r\n\r\n\r\nemitter.emit('setCondition');\r\nemitter.emit('getTotal');",
  5645. "inParams": [
  5646. "角色名称",
  5647. "当前页码",
  5648. "每页大小",
  5649. "是否删除",
  5650. "是否禁用"
  5651. ],
  5652. "outParams": [],
  5653. "openApiPath": "",
  5654. "inParamsDebug": {}
  5655. }
  5656. },
  5657. {
  5658. "id": "service_FHxSD7RYtT",
  5659. "name": "角色删除服务",
  5660. "type": "service",
  5661. "props": {
  5662. "devId": "service_FHxSD7RYtT",
  5663. "isOpen": false,
  5664. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(param.hasOwnProperty('角色ID') && param['角色ID'] > 0)emitter.emit('editDept');\r\nelse emitter.emit('noDeptID');\r\n\r\n\r\nemitter.on('noDeptID', ()=>{\r\n _funcCb({code:0,errMsg:'请传入角色ID',result:{}});\r\n})\r\n\r\nemitter.on('editDept', ()=>{\r\n let condition = {};\r\n condition['_id'] = param.角色ID;\r\n\r\n let editObj = {};\r\n if(param.hasOwnProperty('是否删除'))editObj['是否删除'] = param.是否删除 == 1?1:0;\r\n\r\n _F('dbTableTemp_nr37DhHs56').callMethod('editRow',{\r\n row:editObj,\r\n condition,\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'操作成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('editDept');",
  5665. "inParams": [
  5666. "角色ID",
  5667. "是否删除"
  5668. ],
  5669. "outParams": [],
  5670. "openApiPath": "",
  5671. "inParamsDebug": {}
  5672. }
  5673. },
  5674. {
  5675. "id": "service_cF6TRXP68X",
  5676. "name": "角色编辑服务",
  5677. "type": "service",
  5678. "props": {
  5679. "devId": "service_cF6TRXP68X",
  5680. "isOpen": false,
  5681. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(param.hasOwnProperty('角色ID') && param['角色ID'] > 0)emitter.emit('editDept');\r\nelse emitter.emit('noDeptID');\r\n\r\n\r\nemitter.on('noDeptID', ()=>{\r\n _funcCb({code:0,errMsg:'请传入角色ID',result:{}});\r\n})\r\n\r\nemitter.on('editDept', ()=>{\r\n let condition = {};\r\n condition['_id'] = param.角色ID;\r\n\r\n let editObj = {};\r\n if(param.hasOwnProperty('角色名称'))editObj['角色名称'] = param.角色名称;\r\n if(param.hasOwnProperty('菜单IDs'))editObj['菜单IDs'] = JSON.stringify(param.菜单IDs);\r\n if(param.hasOwnProperty('是否禁用'))editObj['是否禁用'] = param.是否禁用 == 1?1:0;\r\n\r\n _F('dbTableTemp_nr37DhHs56').callMethod('editRow',{\r\n row:editObj,\r\n condition,\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'编辑成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('editDept');",
  5682. "inParams": [
  5683. "角色ID",
  5684. "角色名称",
  5685. "菜单IDs",
  5686. "是否禁用"
  5687. ],
  5688. "outParams": [],
  5689. "openApiPath": "",
  5690. "inParamsDebug": {}
  5691. }
  5692. },
  5693. {
  5694. "id": "service_jQ4AEAwPSy",
  5695. "name": "角色新增服务",
  5696. "type": "service",
  5697. "props": {
  5698. "devId": "service_jQ4AEAwPSy",
  5699. "isOpen": false,
  5700. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('addDept', ()=>{\r\n _F('dbTableTemp_nr37DhHs56').callMethod('addRow',{\r\n row:{\r\n 角色名称: param.角色名称,\r\n 菜单IDs: JSON.stringify(param.菜单IDs),\r\n 是否禁用:0,\r\n 是否删除:0\r\n },\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'新增成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('addDept');",
  5701. "inParams": [
  5702. "角色名称",
  5703. "菜单IDs"
  5704. ],
  5705. "outParams": [],
  5706. "openApiPath": "",
  5707. "inParamsDebug": {}
  5708. }
  5709. }
  5710. ]
  5711. }
  5712. ]
  5713. },
  5714. {
  5715. "id": "state_2zA8fGATNB",
  5716. "type": "state",
  5717. "children": []
  5718. },
  5719. {
  5720. "id": "services_zSCRm43KkY",
  5721. "type": "services",
  5722. "children": [
  5723. {
  5724. "id": "group_NrSDpMdKGr",
  5725. "name": "数据表",
  5726. "type": "group",
  5727. "props": {
  5728. "devId": "group_NrSDpMdKGr"
  5729. },
  5730. "children": [
  5731. {
  5732. "id": "dbTableTemp_nr37DhHs56",
  5733. "name": "角色表",
  5734. "type": "dbTableTemp",
  5735. "props": {
  5736. "devId": "dbTableTemp_nr37DhHs56",
  5737. "fields": [
  5738. {
  5739. "columnName": "_id",
  5740. "columnType": "int"
  5741. },
  5742. {
  5743. "columnName": "角色名称",
  5744. "columnType": "text"
  5745. },
  5746. {
  5747. "columnName": "菜单IDs",
  5748. "columnType": "json"
  5749. },
  5750. {
  5751. "columnName": "是否禁用",
  5752. "columnType": "text"
  5753. },
  5754. {
  5755. "columnName": "是否删除",
  5756. "columnType": "text"
  5757. },
  5758. {
  5759. "columnName": "_create",
  5760. "columnType": "int"
  5761. },
  5762. {
  5763. "columnName": "_update",
  5764. "columnType": "int"
  5765. }
  5766. ]
  5767. }
  5768. }
  5769. ]
  5770. },
  5771. {
  5772. "id": "group_EyYxZ6nFyk",
  5773. "name": "中台服务",
  5774. "type": "group",
  5775. "props": {
  5776. "devId": "group_EyYxZ6nFyk"
  5777. }
  5778. }
  5779. ]
  5780. }
  5781. ]
  5782. },
  5783. {
  5784. "id": "front_RSEDbaGaei",
  5785. "name": "前台",
  5786. "type": "front",
  5787. "props": {
  5788. "style": {
  5789. "width": "100%",
  5790. "height": "100%",
  5791. "display": "flex",
  5792. "overflow": "hidden auto",
  5793. "alignItems": "flex-start",
  5794. "flexDirection": "column",
  5795. "backgroundColor": "#ffffff"
  5796. }
  5797. },
  5798. "children": [
  5799. {
  5800. "id": "props_xmbZQeKcxw",
  5801. "type": "props",
  5802. "children": [
  5803. {
  5804. "id": "fPAttr_3t3RexJZYm",
  5805. "type": "fPAttr",
  5806. "children": []
  5807. },
  5808. {
  5809. "id": "fPMethod_xFW5AJcNx2",
  5810. "type": "fPMethod",
  5811. "children": []
  5812. },
  5813. {
  5814. "id": "fPEvent_sFSeEFkRSz",
  5815. "type": "fPEvent",
  5816. "children": []
  5817. }
  5818. ]
  5819. },
  5820. {
  5821. "id": "state_B3ciDxXQ8Y",
  5822. "type": "state",
  5823. "children": []
  5824. },
  5825. {
  5826. "id": "method_DyDF7SCeFd",
  5827. "type": "method",
  5828. "children": []
  5829. },
  5830. {
  5831. "id": "dom_syf5aeScmy",
  5832. "type": "dom",
  5833. "children": []
  5834. }
  5835. ]
  5836. },
  5837. {
  5838. "id": "config_py35XxFsrX",
  5839. "name": "角色管理后台组件",
  5840. "type": "config",
  5841. "props": {
  5842. "style": {}
  5843. }
  5844. }
  5845. ]
  5846. },
  5847. {
  5848. "id": "module_iCEhkHXdGz",
  5849. "name": "分类编辑后台组件",
  5850. "type": "module",
  5851. "props": {
  5852. "devId": "module_iCEhkHXdGz",
  5853. "appModuleId": "90",
  5854. "appModuleVersion": 6
  5855. },
  5856. "children": [
  5857. {
  5858. "id": "modules_StipNdQ8ms",
  5859. "name": "模块",
  5860. "type": "modules",
  5861. "props": {}
  5862. },
  5863. {
  5864. "id": "backend_WnP7TD48at",
  5865. "name": "后台",
  5866. "type": "backend",
  5867. "props": {
  5868. "style": {
  5869. "height": "200px",
  5870. "backgroundColor": "red"
  5871. }
  5872. },
  5873. "children": [
  5874. {
  5875. "id": "props_KskWJxWz4w",
  5876. "type": "props",
  5877. "children": [
  5878. {
  5879. "id": "bPAttr_RKAHea5Swf",
  5880. "type": "bPAttr",
  5881. "children": []
  5882. },
  5883. {
  5884. "id": "bPMethod_rjpe8mB6CD",
  5885. "type": "bPMethod",
  5886. "children": [
  5887. {
  5888. "id": "service_zYN6Kpynpy",
  5889. "name": "分类关键字搜索服务",
  5890. "type": "service",
  5891. "props": {
  5892. "devId": "service_zYN6Kpynpy",
  5893. "isOpen": false,
  5894. "jsCode": "const emitter = new events.EventEmitter(); \r\nlet condition = {};\r\n\r\nlet pageNum = param.hasOwnProperty('当前页码') && param.当前页码 > 0?parseInt(param.当前页码):1;\r\nlet pageSize = param.hasOwnProperty('每页大小') && param.每页大小 > 0?parseInt(param.每页大小):10;\r\nlet deptTotal = 0;\r\nlet deptList = [];\r\n\r\n\r\nemitter.on('output', (parentNames)=>{\r\n\r\n deptList = deptList.map(item => {\r\n let pInfo = parentNames.find(tmp => item.上级分类ID == tmp._id);\r\n item.上级分类名称 = pInfo?pInfo.分类名称:'';\r\n return item;\r\n })\r\n\r\n _funcCb({\r\n code:200,\r\n errMsg:'ok',\r\n result:deptList,\r\n total:deptTotal\r\n });\r\n})\r\n\r\nemitter.on('setCondition', ()=>{\r\n if(param.hasOwnProperty('分类名称'))condition['分类名称'] = ['like',param.分类名称];\r\n if(param.hasOwnProperty('上级分类ID'))condition['上级分类ID'] = param.上级分类ID;\r\n if(param.hasOwnProperty('是否删除'))condition['是否删除'] = param.是否删除;\r\n if(param.hasOwnProperty('是否禁用'))condition['是否禁用'] = param.是否禁用;\r\n});\r\n\r\nemitter.on('getTotal', ()=>{\r\n\r\n _F('dbTableTemp_nr37DhHs56').callMethod('getCount',{\r\n condition,\r\n success:(res)=>{\r\n emitter.emit('getList',res[0].count);\r\n },\r\n fail:(err)=>{\r\n _funcCb({\r\n code:0,\r\n errMsg:'获取列表总数失败',\r\n result:err,\r\n total:0\r\n });\r\n },\r\n \r\n });\r\n});\r\n\r\nemitter.on('getList', (total)=>{\r\n\r\n _F('dbTableTemp_nr37DhHs56').callMethod('getRows',{\r\n condition,\r\n pageNum,\r\n pageSize,\r\n orderby:'_update',\r\n sort:'desc',\r\n success:(res)=>{\r\n deptTotal = total;\r\n deptList = res;\r\n emitter.emit('getPids');\r\n },\r\n fail:(err)=>{\r\n _funcCb({\r\n code:0,\r\n errMsg:'获取列表失败',\r\n result:err,\r\n total:0\r\n });\r\n },\r\n \r\n });\r\n});\r\n\r\nemitter.on('getPids', ()=>{\r\n let pids = [];\r\n deptList.map(item => pids.push(item.上级分类ID));\r\n emitter.emit('getParentNames',pids);\r\n})\r\n\r\nemitter.on('getParentNames', (pids)=>{\r\n _F('dbTableTemp_nr37DhHs56').callMethod('getRows',{\r\n condition:{\r\n _id:['in',pids]\r\n },\r\n pageNum:1,\r\n pageSize:100,\r\n orderby:'_update',\r\n sort:'desc',\r\n success:(res)=>{\r\n emitter.emit('output',res);\r\n },\r\n fail:(err)=>{\r\n _funcCb({\r\n code:0,\r\n errMsg:'获取上级分类列表失败',\r\n result:err,\r\n });\r\n },\r\n \r\n });\r\n});\r\n\r\nemitter.emit('setCondition');\r\nemitter.emit('getTotal');",
  5895. "inParams": [
  5896. "分类名称",
  5897. "上级分类ID",
  5898. "当前页码",
  5899. "每页大小",
  5900. "是否删除",
  5901. "是否禁用"
  5902. ],
  5903. "outParams": [],
  5904. "openApiPath": "",
  5905. "inParamsDebug": {}
  5906. }
  5907. },
  5908. {
  5909. "id": "service_FHxSD7RYtT",
  5910. "name": "分类删除服务",
  5911. "type": "service",
  5912. "props": {
  5913. "devId": "service_FHxSD7RYtT",
  5914. "isOpen": false,
  5915. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(param.hasOwnProperty('分类ID') && param['分类ID'] > 0)emitter.emit('editDept');\r\nelse emitter.emit('noDeptID');\r\n\r\n\r\nemitter.on('noDeptID', ()=>{\r\n _funcCb({code:0,errMsg:'请传入分类ID',result:{}});\r\n})\r\n\r\nemitter.on('editDept', ()=>{\r\n let condition = {};\r\n condition['_id'] = param.分类ID;\r\n\r\n let editObj = {};\r\n if(param.hasOwnProperty('是否删除'))editObj['是否删除'] = param.是否删除 == 1?1:0;\r\n\r\n _F('dbTableTemp_nr37DhHs56').callMethod('editRow',{\r\n row:editObj,\r\n condition,\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'操作成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('editDept');",
  5916. "inParams": [
  5917. "分类ID",
  5918. "是否删除"
  5919. ],
  5920. "outParams": [],
  5921. "openApiPath": "",
  5922. "inParamsDebug": {}
  5923. }
  5924. },
  5925. {
  5926. "id": "service_cF6TRXP68X",
  5927. "name": "分类编辑服务",
  5928. "type": "service",
  5929. "props": {
  5930. "devId": "service_cF6TRXP68X",
  5931. "isOpen": false,
  5932. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(param.hasOwnProperty('分类ID') && param['分类ID'] > 0)emitter.emit('editDept');\r\nelse emitter.emit('noDeptID');\r\n\r\n\r\nemitter.on('noDeptID', ()=>{\r\n _funcCb({code:0,errMsg:'请传入分类ID',result:{}});\r\n})\r\n\r\nemitter.on('editDept', ()=>{\r\n let condition = {};\r\n condition['_id'] = param.分类ID;\r\n\r\n let editObj = {};\r\n if(param.hasOwnProperty('分类名称'))editObj['分类名称'] = param.分类名称;\r\n if(param.hasOwnProperty('上级分类ID'))editObj['上级分类ID'] = param.上级分类ID;\r\n if(param.hasOwnProperty('是否禁用'))editObj['是否禁用'] = param.是否禁用 == 1?1:0;\r\n\r\n _F('dbTableTemp_nr37DhHs56').callMethod('editRow',{\r\n row:editObj,\r\n condition,\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'编辑成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('editDept');",
  5933. "inParams": [
  5934. "分类ID",
  5935. "分类名称",
  5936. "上级分类ID",
  5937. "是否禁用"
  5938. ],
  5939. "outParams": [],
  5940. "openApiPath": "",
  5941. "inParamsDebug": {}
  5942. }
  5943. },
  5944. {
  5945. "id": "service_jQ4AEAwPSy",
  5946. "name": "分类新增服务",
  5947. "type": "service",
  5948. "props": {
  5949. "devId": "service_jQ4AEAwPSy",
  5950. "isOpen": false,
  5951. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('addDept', ()=>{\r\n _F('dbTableTemp_nr37DhHs56').callMethod('addRow',{\r\n row:{\r\n 分类名称: param.分类名称,\r\n 上级分类ID: param.上级分类ID,\r\n 是否禁用:0,\r\n 是否删除:0\r\n },\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'新增成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('addDept');",
  5952. "inParams": [
  5953. "分类名称",
  5954. "上级分类D"
  5955. ],
  5956. "outParams": [],
  5957. "openApiPath": "",
  5958. "inParamsDebug": {}
  5959. }
  5960. }
  5961. ]
  5962. }
  5963. ]
  5964. },
  5965. {
  5966. "id": "state_NbeQnQbKX7",
  5967. "type": "state",
  5968. "children": []
  5969. },
  5970. {
  5971. "id": "services_ZGk27b25Zn",
  5972. "type": "services",
  5973. "children": [
  5974. {
  5975. "id": "group_NrSDpMdKGr",
  5976. "name": "数据表",
  5977. "type": "group",
  5978. "props": {
  5979. "devId": "group_NrSDpMdKGr"
  5980. },
  5981. "children": [
  5982. {
  5983. "id": "dbTableTemp_nr37DhHs56",
  5984. "name": "积分分类表",
  5985. "type": "dbTableTemp",
  5986. "props": {
  5987. "devId": "dbTableTemp_nr37DhHs56",
  5988. "fields": [
  5989. {
  5990. "columnName": "_id",
  5991. "columnType": "int"
  5992. },
  5993. {
  5994. "columnName": "分类名称",
  5995. "columnType": "text"
  5996. },
  5997. {
  5998. "columnName": "上级分类ID",
  5999. "columnType": "text"
  6000. },
  6001. {
  6002. "columnName": "是否禁用",
  6003. "columnType": "text"
  6004. },
  6005. {
  6006. "columnName": "是否删除",
  6007. "columnType": "text"
  6008. },
  6009. {
  6010. "columnName": "_create",
  6011. "columnType": "int"
  6012. },
  6013. {
  6014. "columnName": "_update",
  6015. "columnType": "int"
  6016. }
  6017. ]
  6018. }
  6019. }
  6020. ]
  6021. },
  6022. {
  6023. "id": "group_EyYxZ6nFyk",
  6024. "name": "中台服务",
  6025. "type": "group",
  6026. "props": {
  6027. "devId": "group_EyYxZ6nFyk"
  6028. }
  6029. }
  6030. ]
  6031. }
  6032. ]
  6033. },
  6034. {
  6035. "id": "front_mcftY8knak",
  6036. "name": "前台",
  6037. "type": "front",
  6038. "props": {
  6039. "style": {
  6040. "width": "100%",
  6041. "height": "100%",
  6042. "display": "flex",
  6043. "overflow": "hidden auto",
  6044. "alignItems": "flex-start",
  6045. "flexDirection": "column",
  6046. "backgroundColor": "#ffffff"
  6047. }
  6048. },
  6049. "children": [
  6050. {
  6051. "id": "props_7RBrYSekBZ",
  6052. "type": "props",
  6053. "children": [
  6054. {
  6055. "id": "fPAttr_BpJBrieFbm",
  6056. "type": "fPAttr",
  6057. "children": []
  6058. },
  6059. {
  6060. "id": "fPMethod_Wfmi8NEiAk",
  6061. "type": "fPMethod",
  6062. "children": []
  6063. },
  6064. {
  6065. "id": "fPEvent_c8SHxfyxFe",
  6066. "type": "fPEvent",
  6067. "children": []
  6068. }
  6069. ]
  6070. },
  6071. {
  6072. "id": "state_zxdpkFrz8h",
  6073. "type": "state",
  6074. "children": []
  6075. },
  6076. {
  6077. "id": "method_Gi5W6mY3tB",
  6078. "type": "method",
  6079. "children": []
  6080. },
  6081. {
  6082. "id": "dom_eYiMsQ4mpG",
  6083. "type": "dom",
  6084. "children": []
  6085. }
  6086. ]
  6087. },
  6088. {
  6089. "id": "config_WAfs4TBySe",
  6090. "name": "积分分类编辑后台组件",
  6091. "type": "config",
  6092. "props": {
  6093. "style": {}
  6094. }
  6095. }
  6096. ]
  6097. },
  6098. {
  6099. "id": "module_Pj3CGzPFxA",
  6100. "name": "微信小程序后台服务组件",
  6101. "type": "module",
  6102. "props": {
  6103. "devId": "module_Pj3CGzPFxA",
  6104. "appModuleId": "936",
  6105. "appModuleVersion": 2
  6106. },
  6107. "children": [
  6108. {
  6109. "id": "modules_yetYBZE6iG",
  6110. "name": "模块",
  6111. "type": "modules",
  6112. "props": {}
  6113. },
  6114. {
  6115. "id": "backend_YT65iwRANC",
  6116. "name": "后台",
  6117. "type": "backend",
  6118. "props": {
  6119. "style": {
  6120. "height": "200px",
  6121. "backgroundColor": "red"
  6122. }
  6123. },
  6124. "children": [
  6125. {
  6126. "id": "props_b5mtR6C282",
  6127. "type": "props",
  6128. "children": [
  6129. {
  6130. "id": "bPAttr_3jNjrtWnrp",
  6131. "type": "bPAttr",
  6132. "children": [
  6133. {
  6134. "id": "variable_FS858Nw8zp",
  6135. "name": "APPSECRET",
  6136. "type": "variable",
  6137. "props": {
  6138. "devId": "variable_FS858Nw8zp",
  6139. "value": null
  6140. }
  6141. },
  6142. {
  6143. "id": "variable_hQPh5XXb7r",
  6144. "name": "APPID",
  6145. "type": "variable",
  6146. "props": {
  6147. "devId": "variable_hQPh5XXb7r",
  6148. "value": null
  6149. }
  6150. }
  6151. ]
  6152. },
  6153. {
  6154. "id": "bPMethod_G2jMcGcfdh",
  6155. "type": "bPMethod",
  6156. "children": [
  6157. {
  6158. "id": "service_x42XREiaWn",
  6159. "name": "获取accessToken服务",
  6160. "type": "service",
  6161. "props": {
  6162. "devId": "service_x42XREiaWn",
  6163. "isOpen": false,
  6164. "jsCode": "const emitter = new events.EventEmitter();\r\n\r\nconst APPID = _F('variable_hQPh5XXb7r').callMethod('get');\r\nconst APPSECRET = _F('variable_FS858Nw8zp').callMethod('get');\r\nconst cacheKey = 'wx_mp_access_token_' + APPID;\r\n\r\nconsole.log('APPID',APPID)\r\nconsole.log('APPSECRET',APPSECRET)\r\n\r\nemitter.on('getAccessTokenFromCache', async () => {\r\n _F('bCacheTemp_i326Wbnmrd').callMethod('get', {\r\n key: cacheKey,\r\n success: (data) => {\r\n if (data) {\r\n console.log('从缓存中获取 access_token');\r\n const accessToken = JSON.parse(data);\r\n emitter.emit('accessTokenObtained', accessToken);\r\n } else {\r\n emitter.emit('getAccessTokenFromServer');\r\n }\r\n },\r\n fail: () => {\r\n emitter.emit('accessTokenObtainFailed', '获取缓存失败');\r\n }\r\n });\r\n});\r\n\r\nemitter.on('getAccessTokenFromServer', async () => {\r\n \r\n const urllib = (await _F('module_func').callMethod('import', 'urllib')).default;\r\n const url = `https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=${APPID}&secret=${APPSECRET}`;\r\n urllib.request(url, { method: 'GET', dataType: 'json' }).then((response) => {\r\n \r\n console.log('access_token response',response.data);\r\n\r\n const { access_token, expires_in } = response.data;\r\n\r\n if(!access_token){\r\n emitter.emit('accessTokenObtainFailed', response.data.errmsg);\r\n return;\r\n }\r\n\r\n // 将 access_token 存入缓存中,缓存时间为 2 小时(注意:微信服务器返回的 expires_in 为秒)\r\n _F('bCacheTemp_i326Wbnmrd').callMethod('set', {\r\n key: cacheKey,\r\n value: JSON.stringify(access_token),\r\n expire: expires_in,\r\n success: () => {\r\n console.log('access_token 缓存设置成功');\r\n },\r\n fail: () => {\r\n console.log('access_token 缓存设置失败');\r\n }\r\n });\r\n emitter.emit('accessTokenObtained', access_token);\r\n }).catch(err => {\r\n emitter.emit('accessTokenObtainFailed', err);\r\n });\r\n});\r\n\r\n// 事件监听:accessTokenObtained\r\nemitter.on('accessTokenObtained', async (accessToken) => {\r\n _funcCb({code:200,errMsg:'ok',result:accessToken});\r\n});\r\n\r\n// 事件监听:accessTokenObtainFailed\r\nemitter.on('accessTokenObtainFailed', async (error) => {\r\n _funcCb({code:0,errMsg:'fail',result:error});\r\n});\r\n\r\n// 开始执行\r\nemitter.emit('getAccessTokenFromCache');\r\n",
  6165. "inParams": [],
  6166. "outParams": [],
  6167. "openApiPath": "",
  6168. "inParamsDebug": {}
  6169. }
  6170. },
  6171. {
  6172. "id": "service_ffMzCYBtWN",
  6173. "name": "授权code获取用户信息服务",
  6174. "type": "service",
  6175. "props": {
  6176. "devId": "service_ffMzCYBtWN",
  6177. "isOpen": false,
  6178. "jsCode": "const emitter = new events.EventEmitter();\r\n\r\nconst code = param.code;\r\nconst APPID = _F('variable_hQPh5XXb7r').callMethod('get');\r\nconst APPSECRET = _F('variable_FS858Nw8zp').callMethod('get');\r\nconst cacheKey = 'wx_mp_user_session_key_';\r\n\r\nif (!code) {\r\n _funcCb({ code: 0, errMsg: '请传入code', result: {} });\r\n return;\r\n}\r\n\r\n// 调用获取 accessToken 的服务\r\n// _F('service_x42XREiaWn').call({}, (res) => {\r\n// if(res.code === 200){\r\n// // 在这里可以继续发出下一个事件,获取用户信息\r\n// let accessToken = res.result;\r\n// emitter.emit('getUserInfo', accessToken);\r\n// }else{\r\n// _funcCb(res);\r\n// }\r\n\r\n// });\r\n\r\n\r\n\r\nemitter.on('getUserInfo', async () => {\r\n const urllib = (await _F('module_func').callMethod('import', 'urllib')).default;\r\n // 在这里可以使用 accessToken,调用获取用户信息的 API\r\n\r\n const url = `https://api.weixin.qq.com/sns/jscode2session?appid=${APPID}&secret=${APPSECRET}&js_code=${code}&grant_type=authorization_code`;\r\n urllib.request(url, { method: 'GET', dataType: 'json' }).then((response) => {\r\n // 在这里处理获取到的用户信息\r\n const { openid, session_key, unionid } = response.data;\r\n\r\n if (!session_key) {\r\n console.log('获取session_key出错:', response.data);\r\n _funcCb({ code: 0, errMsg: '获取session_key出错', result: response.data.errmsg });\r\n return;\r\n }\r\n\r\n\r\n // _F('bCacheTemp_i326Wbnmrd').callMethod('set', {\r\n // key: cacheKey + openid,\r\n // value: JSON.stringify(session_key),\r\n // expire: expires_in,\r\n // success: () => {\r\n // console.log('session_key 缓存设置成功');\r\n // },\r\n // fail: () => {\r\n // console.log('session_key 缓存设置失败');\r\n // }\r\n // });\r\n\r\n _funcCb({ code: 200, errMsg: 'ok', result: response.data });\r\n }).catch(err => {\r\n _funcCb({ code: 0, errMsg: 'fail', result: err });\r\n });\r\n\r\n})\r\n\r\nemitter.emit('getUserInfo');",
  6179. "inParams": [
  6180. "code"
  6181. ],
  6182. "outParams": [],
  6183. "openApiPath": "",
  6184. "inParamsDebug": {}
  6185. }
  6186. },
  6187. {
  6188. "id": "service_SRpWwwnwb7",
  6189. "name": "通过 access_token 和 openid 获取用户信息服务",
  6190. "type": "service",
  6191. "props": {
  6192. "devId": "service_SRpWwwnwb7",
  6193. "isOpen": false,
  6194. "jsCode": "const emitter = new events.EventEmitter();\r\n\r\n\r\nconst access_token = param.access_token;\r\nconst openid = param.openid;\r\n\r\nif (!access_token) {\r\n _funcCb({ code: 0, errMsg: '请传入access_token', result: {} });\r\n return;\r\n}\r\n\r\nif (!openid) {\r\n _funcCb({ code: 0, errMsg: '请传入openid', result: {} });\r\n return;\r\n}\r\n\r\n//通过 access_token 和 openid 获取用户信息\r\nemitter.on('fetchUserInfo', async () => {\r\n const urllib = (await _F('module_func').callMethod('import', 'urllib')).default;\r\n\r\n const url = `https://api.weixin.qq.com/sns/userinfo?access_token=${access_token}&openid=${openid}&lang=zh_CN`;\r\n\r\n urllib.request(url, { method: 'GET', dataType: 'json' }).then((response) => {\r\n const userInfo = response.data;\r\n\r\n console.log(userInfo);\r\n\r\n if (userInfo.errMsg) {\r\n _funcCb({ code: 0, errMsg: 'fail', result: userInfo.errMsg });\r\n } else {\r\n _funcCb({ code: 200, errMsg: 'ok', result: userInfo });\r\n }\r\n }).catch(err => {\r\n _funcCb({ code: 0, errMsg: 'fail', result: err });\r\n });\r\n\r\n});\r\n\r\nemitter.emit('fetchUserInfo');",
  6195. "inParams": [
  6196. "access_token",
  6197. "openid"
  6198. ],
  6199. "outParams": [],
  6200. "openApiPath": "",
  6201. "inParamsDebug": {}
  6202. }
  6203. },
  6204. {
  6205. "id": "service_d8m3KpwS7X",
  6206. "name": "通过 access_token 和 code 获取用户手机号服务",
  6207. "type": "service",
  6208. "props": {
  6209. "devId": "service_d8m3KpwS7X",
  6210. "isOpen": false,
  6211. "isSync": true,
  6212. "jsCode": "const emitter = new events.EventEmitter();\r\n\r\n\r\nlet access_token = param.access_token;\r\nconst code = param.code;\r\n\r\nif (!access_token) {\r\n\r\n const atRes = await _F('service_x42XREiaWn').call({});\r\n\r\n if(atRes.code === 200){\r\n access_token = atRes.result;\r\n }else{\r\n _funcCb({ code: 0, errMsg: '请传入access_token', result: {} });\r\n return;\r\n }\r\n\r\n \r\n}\r\n\r\nif (!code) {\r\n _funcCb({ code: 0, errMsg: '请传入code', result: {} });\r\n return;\r\n}\r\n\r\n//通过 access_token 和 code 获取用户信息\r\nemitter.on('fetchUserInfo', async () => {\r\n const urllib = (await _F('module_func').callMethod('import', 'urllib')).default;\r\n\r\n const url = `https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=${access_token}`;\r\n\r\n urllib.request(url, {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json'\r\n },\r\n data: {\r\n code\r\n },\r\n dataType: 'json'\r\n }).then((response) => {\r\n const userInfo = response.data;\r\n\r\n console.log(userInfo);\r\n\r\n if (userInfo.errcode === 0) {\r\n _funcCb({ code: 200, errMsg: 'ok', result: userInfo.phone_info });\r\n } else {\r\n _funcCb({ code: 0, errMsg: userInfo.errmsg , result: userInfo });\r\n }\r\n }).catch(err => {\r\n _funcCb({ code: 0, errMsg: 'fail', result: err });\r\n });\r\n\r\n});\r\n\r\nemitter.emit('fetchUserInfo');",
  6213. "inParams": [
  6214. "access_token",
  6215. "code"
  6216. ],
  6217. "outParams": [],
  6218. "openApiPath": "",
  6219. "inParamsDebug": {}
  6220. }
  6221. }
  6222. ]
  6223. }
  6224. ]
  6225. },
  6226. {
  6227. "id": "state_R48XmRjFyt",
  6228. "type": "state",
  6229. "children": []
  6230. },
  6231. {
  6232. "id": "services_ywWwbMM8mT",
  6233. "type": "services",
  6234. "children": [
  6235. {
  6236. "id": "bCacheTemp_i326Wbnmrd",
  6237. "name": "accessToken缓存",
  6238. "type": "bCacheTemp",
  6239. "props": {
  6240. "devId": "bCacheTemp_i326Wbnmrd"
  6241. }
  6242. }
  6243. ]
  6244. }
  6245. ]
  6246. },
  6247. {
  6248. "id": "front_rwHYJt8YEF",
  6249. "name": "前台",
  6250. "type": "front",
  6251. "props": {
  6252. "style": {
  6253. "width": "100%",
  6254. "height": "100%",
  6255. "overflow": "hidden auto",
  6256. "backgroundColor": "#ffffff"
  6257. }
  6258. },
  6259. "children": [
  6260. {
  6261. "id": "props_TYs3ZXKwiF",
  6262. "type": "props",
  6263. "children": [
  6264. {
  6265. "id": "fPAttr_3jmCs3ZQmJ",
  6266. "type": "fPAttr",
  6267. "children": []
  6268. },
  6269. {
  6270. "id": "fPMethod_kMxY7XkdBK",
  6271. "type": "fPMethod",
  6272. "children": []
  6273. },
  6274. {
  6275. "id": "fPEvent_j4wx78ZtKD",
  6276. "type": "fPEvent",
  6277. "children": []
  6278. }
  6279. ]
  6280. },
  6281. {
  6282. "id": "state_Ec8zzBTDis",
  6283. "type": "state",
  6284. "children": []
  6285. },
  6286. {
  6287. "id": "method_EJtmBC5tiB",
  6288. "type": "method",
  6289. "children": []
  6290. },
  6291. {
  6292. "id": "dom_JTW8MjsZaC",
  6293. "type": "dom",
  6294. "children": []
  6295. }
  6296. ]
  6297. },
  6298. {
  6299. "id": "config_kN3aWJXmiy",
  6300. "name": "微信公众平台后台服务组件",
  6301. "type": "config",
  6302. "props": {
  6303. "style": {}
  6304. }
  6305. }
  6306. ]
  6307. },
  6308. {
  6309. "id": "module_PEK2CxS7xC",
  6310. "name": "微信支付代金券SDK模块",
  6311. "type": "module",
  6312. "props": {},
  6313. "children": [
  6314. {
  6315. "id": "front_cSXPhYbDkb",
  6316. "type": "front",
  6317. "children": [
  6318. {
  6319. "id": "props_smxAswpEAT",
  6320. "type": "props",
  6321. "children": [
  6322. {
  6323. "id": "fPAttr_zSJzdpak86",
  6324. "type": "fPAttr",
  6325. "children": []
  6326. },
  6327. {
  6328. "id": "fPMethod_TQ6KhNapCP",
  6329. "type": "fPMethod",
  6330. "children": []
  6331. },
  6332. {
  6333. "id": "fPEvent_nwX8Gmz5TB",
  6334. "type": "fPEvent",
  6335. "children": []
  6336. }
  6337. ]
  6338. },
  6339. {
  6340. "id": "state_2FK5whd58k",
  6341. "type": "state",
  6342. "children": []
  6343. },
  6344. {
  6345. "id": "method_Nc7c8Wtnx8",
  6346. "type": "method",
  6347. "children": []
  6348. },
  6349. {
  6350. "id": "dom_Fpf8QfeRjd",
  6351. "type": "dom",
  6352. "children": []
  6353. }
  6354. ]
  6355. },
  6356. {
  6357. "id": "backend_xAHiPcNRxM",
  6358. "type": "backend",
  6359. "children": [
  6360. {
  6361. "id": "props_5mzA8NhJSp",
  6362. "type": "props",
  6363. "children": [
  6364. {
  6365. "id": "bPAttr_jpE2w4EJCK",
  6366. "type": "bPAttr",
  6367. "children": [
  6368. {
  6369. "id": "variable_CECZhxwhdG",
  6370. "name": "商户私钥",
  6371. "type": "variable",
  6372. "props": {}
  6373. },
  6374. {
  6375. "id": "variable_WGWwxWXhtP",
  6376. "name": "商户号",
  6377. "type": "variable",
  6378. "props": {}
  6379. },
  6380. {
  6381. "id": "variable_Ye37GiY7pQ",
  6382. "name": "证书序列号",
  6383. "type": "variable",
  6384. "props": {}
  6385. },
  6386. {
  6387. "id": "variable_TKQnZxySr4",
  6388. "name": "AppId",
  6389. "type": "variable",
  6390. "props": {
  6391. "value": ""
  6392. }
  6393. }
  6394. ]
  6395. },
  6396. {
  6397. "id": "bPMethod_FXzCaAM23b",
  6398. "type": "bPMethod",
  6399. "children": [
  6400. {
  6401. "id": "service_iibHYYjx5m",
  6402. "name": "计算V3签名串",
  6403. "type": "service",
  6404. "props": {
  6405. "isSync": true,
  6406. "jsCode": "const crypto = await Import('crypto');\r\nconst { URL } = await Import('url');\r\n\r\nfunction generateWechatPayV3Signature(httpMethod, url, body, mch_private_key, merchant_id, serial_no, nonce) {\r\n \r\n const privateKey = `-----BEGIN PRIVATE KEY-----\\n${mch_private_key}\\n-----END PRIVATE KEY-----`;\r\n\r\n const timestamp = Math.floor(Date.now() / 1000);\r\n\r\n const urlParts = new URL(url);\r\n const canonicalUrl = urlParts.pathname + (urlParts.search || '');\r\n\r\n const message = `${httpMethod}\\n${canonicalUrl}\\n${timestamp}\\n${nonce}\\n${body}\\n`;\r\n //const message = `GET\\n/v3/marketing/favor/users/oP-y45xbf7hrhC6yeabpjXzIhUWg/coupons/31829742841?appid=wx90d230c69b82b4c0\\n1686129065\\nrl6KrYyF6Zx5nAPeqOJSqLoTJs3gBzkk\\n\\n`;\r\n console.log('message',JSON.stringify(message));\r\n\r\n const sign = crypto.createSign('RSA-SHA256');\r\n sign.write(message);\r\n sign.end();\r\n const rawSign = sign.sign(privateKey, 'base64');\r\n\r\n const schema = 'WECHATPAY2-SHA256-RSA2048';\r\n const token = `${schema} mchid=\"${merchant_id}\",nonce_str=\"${nonce}\",timestamp=\"${timestamp}\",serial_no=\"${serial_no}\",signature=\"${rawSign}\"`;\r\n\r\n return token;\r\n}\r\nfunction generateNonceStr(length = 32) {\r\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r\n const maxPos = chars.length;\r\n let nonceStr = '';\r\n for (let i = 0; i < length; i++) {\r\n nonceStr += chars.charAt(Math.floor(Math.random() * maxPos));\r\n }\r\n return nonceStr;\r\n}\r\n\r\nconsole.log('param',param);\r\n\r\n// 调用示例\r\nconst httpMethod = param.httpMethod;\r\nconst url = param.url;\r\nconst body = param.body ? JSON.stringify(param.body) : '';\r\nconst mch_private_key = _F('variable_CECZhxwhdG').callMethod('get');\r\nconst merchant_id = _F('variable_WGWwxWXhtP').callMethod('get');\r\nconst serial_no = _F('variable_Ye37GiY7pQ').callMethod('get');\r\n\r\nconst nonce = generateNonceStr(16);\r\n\r\nconst signature = generateWechatPayV3Signature(httpMethod, url, body, mch_private_key, merchant_id, serial_no, nonce);\r\nconsole.log(signature);\r\n\r\n_funcCb(signature);\r\n",
  6407. "inParams": [
  6408. "httpMethod",
  6409. "url",
  6410. "body"
  6411. ]
  6412. }
  6413. },
  6414. {
  6415. "id": "service_iyScbpEKBk",
  6416. "name": "发起请求API",
  6417. "type": "service",
  6418. "props": {
  6419. "isSync": true,
  6420. "jsCode": "const urllib = await Import('urllib');\r\n\r\nconsole.log('param', param);\r\n\r\n// 调用示例\r\nconst httpMethod = param.httpMethod;\r\nconst body = param.body;\r\nconst url = param.url;\r\n\r\nconst signature = await _F('service_iibHYYjx5m').call({ httpMethod, url, body });\r\nconsole.log(signature);\r\n\r\n// 发送请求\r\nconst reqRes = await urllib.request(url, {\r\n method: httpMethod,\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Authorization': signature,\r\n 'Accept': 'application/json',\r\n //'User-Agent': 'Your User Agent'\r\n },\r\n data:body\r\n});\r\n\r\n_funcCb(reqRes.data.toString());\r\n",
  6421. "inParams": [
  6422. "httpMethod",
  6423. "url",
  6424. "body"
  6425. ]
  6426. }
  6427. },
  6428. {
  6429. "id": "service_7cSwKHSNyz",
  6430. "name": "查询代金券详情API",
  6431. "type": "service",
  6432. "props": {
  6433. "isSync": true,
  6434. "jsCode": "const urllib = await Import('urllib');\r\n\r\nconsole.log('param', param);\r\n\r\n// 调用示例\r\nconst httpMethod = 'GET';\r\nconst body = '';\r\nconst openid = param.openid;\r\nconst couponId = param.couponId;\r\nconst appid = _F('variable_TKQnZxySr4').callMethod('get');\r\nconst url = `https://api.mch.weixin.qq.com/v3/marketing/favor/users/${openid}/coupons/${couponId}?appid=${appid}`;\r\n\r\nconst reqRes = await _F('service_iyScbpEKBk').call({ httpMethod, url, body });\r\n\r\nconsole.log(reqRes);\r\n\r\n_funcCb(reqRes);\r\n\r\n// const signature = await _F('service_iibHYYjx5m').call({ httpMethod, url, body });\r\n// console.log(signature);\r\n\r\n// // 发送请求\r\n// //\r\n\r\n// console.log(urllib);\r\n\r\n// const reqRes = await urllib.request(url, {\r\n// method: httpMethod,\r\n// headers: {\r\n// 'Content-Type': 'application/json',\r\n// 'Authorization': signature,\r\n// 'Accept': 'application/json',\r\n// 'User-Agent': 'Your User Agent'\r\n// },\r\n// });\r\n\r\n// _funcCb(reqRes.data.toString());\r\n",
  6435. "inParams": [
  6436. "openid",
  6437. "couponId"
  6438. ]
  6439. }
  6440. },
  6441. {
  6442. "id": "service_FFZCEpzHrA",
  6443. "name": "发放代金券批次API",
  6444. "type": "service",
  6445. "props": {
  6446. "isSync": true,
  6447. "jsCode": "const urllib = await Import('urllib');\r\n\r\nconsole.log('param', param);\r\n\r\n// 调用示例\r\nconst httpMethod = 'POST';\r\nconst openid = param.openid;\r\nconst appid = _F('variable_TKQnZxySr4').callMethod('get');\r\nconst url = `https://api.mch.weixin.qq.com/v3/marketing/favor/users/${openid}/coupons`;\r\n\r\nconst body = {\r\n \"stock_id\": param.stock_id,\r\n \"out_request_no\": param.out_request_no,\r\n \"appid\": appid,\r\n \"stock_creator_mchid\": param.stock_creator_mchid\r\n};\r\nconst reqRes = await _F('service_iyScbpEKBk').call({ httpMethod, url, body });\r\n\r\nconsole.log(reqRes);\r\n\r\n_funcCb(reqRes);\r\n\r\n",
  6448. "inParams": [
  6449. "openid",
  6450. "stock_id",
  6451. "out_request_no",
  6452. "stock_creator_mchid"
  6453. ]
  6454. }
  6455. },
  6456. {
  6457. "id": "service_x7kn8sGBdy",
  6458. "name": "条件查询批次列表API",
  6459. "type": "service",
  6460. "props": {
  6461. "isSync": true,
  6462. "jsCode": "const urllib = await Import('urllib');\r\n\r\nconsole.log('param', param);\r\n\r\n// 调用示例\r\nconst httpMethod = 'GET';\r\nconst body = '';\r\nconst offset = param.offset;\r\nconst limit = param.limit;\r\nconst stock_creator_mchid = param.stock_creator_mchid;\r\nconst status = param.status;\r\nconst appid = _F('variable_TKQnZxySr4').callMethod('get');\r\nlet url = `https://api.mch.weixin.qq.com/v3/marketing/favor/stocks?offset=${offset}&limit=${limit}&stock_creator_mchid=${stock_creator_mchid}`;\r\n\r\nif(status)url += `&status=${status}`;\r\n\r\nconst reqRes = await _F('service_iyScbpEKBk').call({ httpMethod, url, body });\r\n\r\nconsole.log(reqRes);\r\n\r\n_funcCb(reqRes);\r\n",
  6463. "inParams": [
  6464. "offset",
  6465. "limit",
  6466. "stock_creator_mchid",
  6467. "status"
  6468. ]
  6469. }
  6470. },
  6471. {
  6472. "id": "service_z8227dt5h3",
  6473. "name": "创建代金券批次API",
  6474. "type": "service",
  6475. "props": {
  6476. "isSync": true,
  6477. "jsCode": "const urllib = await Import('urllib');\r\n\r\nconsole.log('param', param);\r\n\r\n// 调用示例\r\nconst httpMethod = 'POST';\r\nconst openid = param.openid;\r\nconst url = `https://api.mch.weixin.qq.com/v3/marketing/favor/coupon-stocks`;\r\n\r\nconst body = param.body;\r\nconst reqRes = await _F('service_iyScbpEKBk').call({ httpMethod, url, body });\r\n\r\nconsole.log(reqRes);\r\n\r\n_funcCb(reqRes);\r\n\r\n",
  6478. "inParams": [
  6479. "body"
  6480. ]
  6481. }
  6482. },
  6483. {
  6484. "id": "service_kx2ADaXesE",
  6485. "name": "激活代金券批次API",
  6486. "type": "service",
  6487. "props": {
  6488. "isSync": true,
  6489. "jsCode": "const urllib = await Import('urllib');\r\n\r\nconsole.log('param', param);\r\n\r\n// 调用示例\r\nconst httpMethod = 'POST';\r\nconst body = {\r\n stock_creator_mchid: param.stock_creator_mchid\r\n};\r\nconst stock_id = param.stock_id;\r\nconst url = `https://api.mch.weixin.qq.com/v3/marketing/favor/stocks/${stock_id}/start`;\r\n\r\nconst reqRes = await _F('service_iyScbpEKBk').call({ httpMethod, url, body });\r\n\r\nconsole.log(reqRes);\r\n\r\n_funcCb(reqRes);\r\n\r\n",
  6490. "inParams": [
  6491. "stock_creator_mchid",
  6492. "stock_id"
  6493. ]
  6494. }
  6495. }
  6496. ]
  6497. }
  6498. ]
  6499. },
  6500. {
  6501. "id": "state_Hn26xE86s3",
  6502. "type": "state",
  6503. "children": []
  6504. },
  6505. {
  6506. "id": "services_jG7AyHGwYh",
  6507. "type": "services",
  6508. "children": [
  6509. {
  6510. "id": "group_Pkn8kmsMyQ",
  6511. "name": "回收站",
  6512. "type": "group",
  6513. "props": {},
  6514. "children": [
  6515. {
  6516. "id": "service_2zXSYKzNfr",
  6517. "name": "计算微信支付V3签名串服务",
  6518. "type": "service",
  6519. "props": {
  6520. "isSync": true,
  6521. "jsCode": "const crypto = await Import('crypto');\r\nconst { URL } = await Import('url');\r\n\r\nfunction generateWechatPayV3Signature(httpMethod, url, body, mch_private_key, merchant_id, serial_no, nonce) {\r\n \r\n\r\n const privateKey = `-----BEGIN PRIVATE KEY-----\r\n ${mch_private_key}\r\n -----END PRIVATE KEY-----`;\r\n\r\n const timestamp = Math.floor(Date.now() / 1000);\r\n\r\n const urlParts = new URL(url);\r\n const canonicalUrl = urlParts.pathname + (urlParts.search || '');\r\n\r\n const message = `${httpMethod}\\n${canonicalUrl}\\n${timestamp}\\n${nonce}\\n${body}\\n`;\r\n\r\nconsole.log('message',message);\r\n\r\n // const sign = crypto.createSign('RSA-SHA256');\r\n // sign.write(message);\r\n // sign.end();\r\n // const rawSign = sign.sign(privateKey, 'base64');\r\n\r\n // const schema = 'WECHATPAY2-SHA256-RSA2048';\r\n // const token = `mchid=\"${merchant_id}\",nonce_str=\"${nonce}\",timestamp=\"${timestamp}\",serial_no=\"${serial_no}\",signature=\"${rawSign}\"`;\r\n\r\n // return token;\r\n return '';\r\n}\r\n\r\nconsole.log('param',param);\r\n\r\n// 调用示例\r\nconst httpMethod = param.httpMethod;\r\nconst url = param.url;\r\nconst body = JSON.stringify(param.body);\r\nconst mch_private_key = _F('variable_CECZhxwhdG').callMethod('get');\r\nconst merchant_id = _F('variable_WGWwxWXhtP').callMethod('get');\r\nconst serial_no = _F('variable_Ye37GiY7pQ').callMethod('get');\r\nconst nonce = 'nonce';\r\n\r\nconst signature = generateWechatPayV3Signature(httpMethod, url, body, mch_private_key, merchant_id, serial_no, nonce);\r\nconsole.log(signature);\r\n\r\n_funcCb(signature);",
  6522. "inParams": [
  6523. "httpMethod",
  6524. "url",
  6525. "body"
  6526. ]
  6527. }
  6528. }
  6529. ]
  6530. }
  6531. ]
  6532. }
  6533. ]
  6534. },
  6535. {
  6536. "id": "modules_Hx4fGfEQP3",
  6537. "type": "modules",
  6538. "children": []
  6539. }
  6540. ]
  6541. },
  6542. {
  6543. "id": "module_ByNbsAd5hD",
  6544. "name": "代金券管理后台组件",
  6545. "type": "module",
  6546. "props": {
  6547. "devId": "module_ByNbsAd5hD",
  6548. "appModuleId": "",
  6549. "appModuleVersion": 14
  6550. },
  6551. "children": [
  6552. {
  6553. "id": "modules_b4NiAAEBP5",
  6554. "name": "模块",
  6555. "type": "modules",
  6556. "props": {}
  6557. },
  6558. {
  6559. "id": "backend_sww7YXfce4",
  6560. "name": "后台",
  6561. "type": "backend",
  6562. "props": {
  6563. "style": {
  6564. "height": "200px",
  6565. "backgroundColor": "red"
  6566. }
  6567. },
  6568. "children": [
  6569. {
  6570. "id": "props_i5NC3DS6Q6",
  6571. "type": "props",
  6572. "children": [
  6573. {
  6574. "id": "bPAttr_XbXBmfcErS",
  6575. "type": "bPAttr",
  6576. "children": []
  6577. },
  6578. {
  6579. "id": "bPMethod_sJTYpzpd65",
  6580. "type": "bPMethod",
  6581. "children": [
  6582. {
  6583. "id": "service_twyCJwfKE8",
  6584. "name": "代金券批次关键字搜索服务",
  6585. "type": "service",
  6586. "props": {
  6587. "devId": "service_twyCJwfKE8",
  6588. "isOpen": false,
  6589. "jsCode": "const emitter = new events.EventEmitter();\r\nlet condition = {};\r\n\r\nlet pageNum = param.hasOwnProperty('当前页码') && param.当前页码 > 0 ? parseInt(param.当前页码) : 1;\r\nlet pageSize = param.hasOwnProperty('每页大小') && param.每页大小 > 0 ? parseInt(param.每页大小) : 10;\r\nlet deptTotal = 0;\r\nlet deptList = [];\r\n\r\n\r\nemitter.on('output', () => {\r\n\r\n deptList = deptList.map(item => {\r\n\r\n return item;\r\n })\r\n\r\n _funcCb({\r\n code: 200,\r\n errMsg: 'ok',\r\n result: deptList,\r\n total: deptTotal\r\n });\r\n})\r\n\r\nemitter.on('setCondition', () => {\r\n let 搜索条件 = param.搜索条件 || {};\r\n if (搜索条件.hasOwnProperty('批次名称') && 搜索条件.批次名称) condition['批次名称'] = ['like', 搜索条件.批次名称];\r\n if (搜索条件.hasOwnProperty('批次号') && 搜索条件.批次号) condition['批次号'] = ['like', 搜索条件.批次号];\r\n if (搜索条件.hasOwnProperty('批次分类ID')) condition['批次分类ID'] = 搜索条件.批次分类ID;\r\n if (搜索条件.hasOwnProperty('是否首页展示')) condition['是否首页展示'] = 搜索条件.是否首页展示;\r\n if (搜索条件.hasOwnProperty('是否上架')) condition['是否上架'] = 搜索条件.是否上架;\r\n if (搜索条件.hasOwnProperty('是否删除')) condition['是否删除'] = 搜索条件.是否删除;\r\n\r\n console.log('搜索条件condition',condition);\r\n});\r\n\r\nemitter.on('getTotal', () => {\r\n\r\n _F('dbViewTemp_AJyyXTd2RD').callMethod('getCount', {\r\n condition,\r\n success: (res) => {\r\n emitter.emit('getList', res[0].count);\r\n },\r\n fail: (err) => {\r\n _funcCb({\r\n code: 0,\r\n errMsg: '获取列表总数失败',\r\n result: err,\r\n total: 0\r\n });\r\n },\r\n\r\n });\r\n});\r\n\r\nemitter.on('getList', (total) => {\r\n\r\n _F('dbViewTemp_AJyyXTd2RD').callMethod('getRows', {\r\n condition,\r\n pageNum,\r\n pageSize,\r\n orderby: '_update',\r\n sort: 'desc',\r\n success: (res) => {\r\n deptTotal = total;\r\n deptList = res;\r\n emitter.emit('output');\r\n },\r\n fail: (err) => {\r\n _funcCb({\r\n code: 0,\r\n errMsg: '获取列表失败',\r\n result: err,\r\n total: 0\r\n });\r\n },\r\n\r\n });\r\n});\r\n\r\n\r\nemitter.emit('setCondition');\r\nemitter.emit('getTotal');",
  6590. "inParams": [
  6591. "搜索条件",
  6592. "当前页码",
  6593. "每页大小"
  6594. ],
  6595. "outParams": [],
  6596. "openApiPath": "",
  6597. "inParamsDebug": {}
  6598. }
  6599. },
  6600. {
  6601. "id": "service_A4myyJ8cfF",
  6602. "name": "批次删除服务",
  6603. "type": "service",
  6604. "props": {
  6605. "devId": "service_A4myyJ8cfF",
  6606. "isOpen": false,
  6607. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(param.hasOwnProperty('批次ID') && param['批次ID'] > 0)emitter.emit('editDept');\r\nelse emitter.emit('noDeptID');\r\n\r\n\r\nemitter.on('noDeptID', ()=>{\r\n _funcCb({code:0,errMsg:'请传入批次ID',result:{}});\r\n})\r\n\r\nemitter.on('editDept', ()=>{\r\n let condition = {};\r\n condition['_id'] = param.批次ID;\r\n\r\n let editObj = {};\r\n if(param.hasOwnProperty('是否删除'))editObj['是否删除'] = param.是否删除 == 1?1:0;\r\n\r\n _F('dbTableTemp_DeEzJeMkjd').callMethod('editRow',{\r\n row:editObj,\r\n condition,\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'操作成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('editDept');",
  6608. "inParams": [
  6609. "批次ID",
  6610. "是否删除"
  6611. ],
  6612. "outParams": [],
  6613. "openApiPath": "",
  6614. "inParamsDebug": {}
  6615. }
  6616. },
  6617. {
  6618. "id": "service_bWAJYa85dp",
  6619. "name": "批次编辑服务",
  6620. "type": "service",
  6621. "props": {
  6622. "devId": "service_bWAJYa85dp",
  6623. "isOpen": false,
  6624. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(param.hasOwnProperty('行ID') && param['行ID'] > 0)emitter.emit('editDept');\r\nelse emitter.emit('noDeptID');\r\n\r\n\r\nemitter.on('noDeptID', ()=>{\r\n _funcCb({code:0,errMsg:'请传入行ID',result:{}});\r\n})\r\n\r\nemitter.on('editDept', ()=>{\r\n let condition = {};\r\n condition['_id'] = param.行ID;\r\n\r\n let editObj = {};\r\n if(param.hasOwnProperty('批次分类ID'))editObj['批次分类ID'] = param.批次分类ID;\r\n if(param.hasOwnProperty('批次名称'))editObj['批次名称'] = param.批次名称;\r\n if(param.hasOwnProperty('批次号'))editObj['批次号'] = param.批次号;\r\n if(param.hasOwnProperty('制券商户号'))editObj['制券商户号'] = param.制券商户号;\r\n if(param.hasOwnProperty('发券商户号'))editObj['发券商户号'] = param.发券商户号;\r\n if(param.hasOwnProperty('是否首页展示'))editObj['是否首页展示'] = param.是否首页展示;\r\n if(param.hasOwnProperty('批次简介'))editObj['批次简介'] = param.批次简介;\r\n if(param.hasOwnProperty('是否上架'))editObj['是否上架'] = param.是否上架 == 1?1:0;\r\n\r\n _F('dbTableTemp_DeEzJeMkjd').callMethod('editRow',{\r\n row:editObj,\r\n condition,\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'编辑成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('editDept');",
  6625. "inParams": [
  6626. "行ID",
  6627. "批次号",
  6628. "上架时间",
  6629. "下架时间",
  6630. "图片链接",
  6631. "批次名称",
  6632. "批次简介",
  6633. "是否上架",
  6634. "批次分类ID",
  6635. "制券商户号",
  6636. "发券商户号",
  6637. "是否首页展示"
  6638. ],
  6639. "outParams": [],
  6640. "openApiPath": "",
  6641. "inParamsDebug": {
  6642. "行ID": "",
  6643. "批次号": "",
  6644. "上架时间": "",
  6645. "下架时间": "",
  6646. "图片链接": "",
  6647. "批次名称": "",
  6648. "批次简介": "",
  6649. "是否上架": "",
  6650. "批次分类ID": "",
  6651. "制券商户号": "",
  6652. "发券商户号": "",
  6653. "是否首页展示": ""
  6654. }
  6655. }
  6656. },
  6657. {
  6658. "id": "service_6CQ846mkJ2",
  6659. "name": "批次新增服务",
  6660. "type": "service",
  6661. "props": {
  6662. "devId": "service_6CQ846mkJ2",
  6663. "isOpen": false,
  6664. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('addDept', ()=>{\r\n _F('dbTableTemp_DeEzJeMkjd').callMethod('addRow',{\r\n row:{\r\n ...param,\r\n 是否删除:0\r\n },\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'新增成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('addDept');",
  6665. "inParams": [
  6666. "批次分类ID",
  6667. "批次号",
  6668. "制券商户号",
  6669. "发券商户号",
  6670. "批次名称",
  6671. "批次简介",
  6672. "图片链接",
  6673. "是否首页展示"
  6674. ],
  6675. "outParams": [],
  6676. "openApiPath": "",
  6677. "inParamsDebug": {
  6678. "批次号": "",
  6679. "图片链接": "",
  6680. "批次名称": "",
  6681. "批次简介": "",
  6682. "批次分类ID": "",
  6683. "制券商户号": "",
  6684. "发券商户号": "",
  6685. "是否首页展示": ""
  6686. }
  6687. }
  6688. }
  6689. ]
  6690. }
  6691. ]
  6692. },
  6693. {
  6694. "id": "state_jdABxjd4ts",
  6695. "type": "state",
  6696. "children": []
  6697. },
  6698. {
  6699. "id": "services_NY8G3hzB7Q",
  6700. "type": "services",
  6701. "children": [
  6702. {
  6703. "id": "group_TSzxhRhprz",
  6704. "name": "数据表",
  6705. "type": "group",
  6706. "props": {
  6707. "devId": "group_TSzxhRhprz"
  6708. },
  6709. "children": [
  6710. {
  6711. "id": "dbTableTemp_DeEzJeMkjd",
  6712. "name": "代金券批次列表",
  6713. "type": "dbTableTemp",
  6714. "props": {
  6715. "devId": "dbTableTemp_DeEzJeMkjd",
  6716. "fields": [
  6717. {
  6718. "columnName": "_id",
  6719. "columnType": "int unsigned"
  6720. },
  6721. {
  6722. "columnName": "批次分类ID",
  6723. "columnType": "int"
  6724. },
  6725. {
  6726. "columnName": "批次号",
  6727. "columnType": "text"
  6728. },
  6729. {
  6730. "columnName": "制券商户号",
  6731. "columnType": "text"
  6732. },
  6733. {
  6734. "columnName": "发券商户号",
  6735. "columnType": "text"
  6736. },
  6737. {
  6738. "columnName": "批次名称",
  6739. "columnType": "text"
  6740. },
  6741. {
  6742. "columnName": "批次简介",
  6743. "columnType": "text"
  6744. },
  6745. {
  6746. "columnName": "图片链接",
  6747. "columnType": "text"
  6748. },
  6749. {
  6750. "columnName": "是否首页展示",
  6751. "columnType": "int"
  6752. },
  6753. {
  6754. "columnName": "是否上架",
  6755. "columnType": "int"
  6756. },
  6757. {
  6758. "columnName": "上架时间",
  6759. "columnType": "int"
  6760. },
  6761. {
  6762. "columnName": "下架时间",
  6763. "columnType": "int"
  6764. },
  6765. {
  6766. "columnName": "是否删除",
  6767. "columnType": "int"
  6768. },
  6769. {
  6770. "columnName": "_create",
  6771. "columnType": "bigint unsigned"
  6772. },
  6773. {
  6774. "columnName": "_update",
  6775. "columnType": "bigint unsigned"
  6776. }
  6777. ]
  6778. }
  6779. },
  6780. {
  6781. "id": "dbViewTemp_AJyyXTd2RD",
  6782. "name": "批次表+分类表视图",
  6783. "type": "dbViewTemp",
  6784. "props": {}
  6785. }
  6786. ]
  6787. },
  6788. {
  6789. "id": "group_KkEhGCkAbW",
  6790. "name": "中台服务",
  6791. "type": "group",
  6792. "props": {
  6793. "devId": "group_KkEhGCkAbW"
  6794. }
  6795. }
  6796. ]
  6797. }
  6798. ]
  6799. },
  6800. {
  6801. "id": "front_sWWJCwh5Qx",
  6802. "name": "前台",
  6803. "type": "front",
  6804. "props": {
  6805. "style": {
  6806. "width": "100%",
  6807. "height": "100%",
  6808. "display": "flex",
  6809. "overflow": "hidden auto",
  6810. "alignItems": "flex-start",
  6811. "flexDirection": "column",
  6812. "backgroundColor": "#ffffff"
  6813. }
  6814. },
  6815. "children": [
  6816. {
  6817. "id": "props_hAdRtKdkbY",
  6818. "type": "props",
  6819. "children": [
  6820. {
  6821. "id": "fPAttr_kee5k3EaQa",
  6822. "type": "fPAttr",
  6823. "children": []
  6824. },
  6825. {
  6826. "id": "fPMethod_c46hPfWMZE",
  6827. "type": "fPMethod",
  6828. "children": []
  6829. },
  6830. {
  6831. "id": "fPEvent_a84xYdMpY5",
  6832. "type": "fPEvent",
  6833. "children": []
  6834. }
  6835. ]
  6836. },
  6837. {
  6838. "id": "state_SQyjPwSp74",
  6839. "type": "state",
  6840. "children": []
  6841. },
  6842. {
  6843. "id": "method_sDbxC8w4n2",
  6844. "type": "method",
  6845. "children": []
  6846. },
  6847. {
  6848. "id": "dom_5AieJpRH3Z",
  6849. "type": "dom",
  6850. "children": []
  6851. }
  6852. ]
  6853. },
  6854. {
  6855. "id": "config_7jGGckwm63",
  6856. "name": "角色管理后台组件",
  6857. "type": "config",
  6858. "props": {
  6859. "style": {}
  6860. }
  6861. }
  6862. ]
  6863. },
  6864. {
  6865. "id": "module_fE35nbENiD",
  6866. "name": "领券日志后台组件",
  6867. "type": "module",
  6868. "props": {
  6869. "devId": "module_fE35nbENiD",
  6870. "appModuleId": "",
  6871. "appModuleVersion": 14
  6872. },
  6873. "children": [
  6874. {
  6875. "id": "config_FEeRx8knhJ",
  6876. "name": "角色管理后台组件",
  6877. "type": "config",
  6878. "props": {
  6879. "style": {}
  6880. }
  6881. },
  6882. {
  6883. "id": "front_zC73MhsdrJ",
  6884. "name": "前台",
  6885. "type": "front",
  6886. "props": {
  6887. "style": {
  6888. "width": "100%",
  6889. "height": "100%",
  6890. "display": "flex",
  6891. "overflow": "hidden auto",
  6892. "alignItems": "flex-start",
  6893. "flexDirection": "column",
  6894. "backgroundColor": "#ffffff"
  6895. }
  6896. },
  6897. "children": [
  6898. {
  6899. "id": "props_rdfFtj6dJc",
  6900. "type": "props",
  6901. "children": [
  6902. {
  6903. "id": "fPAttr_7PryRzyW83",
  6904. "type": "fPAttr",
  6905. "children": []
  6906. },
  6907. {
  6908. "id": "fPMethod_MmbmtZ4kYa",
  6909. "type": "fPMethod",
  6910. "children": []
  6911. },
  6912. {
  6913. "id": "fPEvent_ENTC52tHDB",
  6914. "type": "fPEvent",
  6915. "children": []
  6916. }
  6917. ]
  6918. },
  6919. {
  6920. "id": "state_pCcKtNH85E",
  6921. "type": "state",
  6922. "children": []
  6923. },
  6924. {
  6925. "id": "method_nCjTGemYXr",
  6926. "type": "method",
  6927. "children": []
  6928. },
  6929. {
  6930. "id": "dom_sxidiX6Bj8",
  6931. "type": "dom",
  6932. "children": []
  6933. }
  6934. ]
  6935. },
  6936. {
  6937. "id": "backend_JJW5X6ZbEE",
  6938. "name": "后台",
  6939. "type": "backend",
  6940. "props": {
  6941. "style": {
  6942. "height": "200px",
  6943. "backgroundColor": "red"
  6944. }
  6945. },
  6946. "children": [
  6947. {
  6948. "id": "props_JATSbPKZBJ",
  6949. "type": "props",
  6950. "children": [
  6951. {
  6952. "id": "bPAttr_pr5GTEsZ2n",
  6953. "type": "bPAttr",
  6954. "children": []
  6955. },
  6956. {
  6957. "id": "bPMethod_wheC6d8TEp",
  6958. "type": "bPMethod",
  6959. "children": [
  6960. {
  6961. "id": "service_AcidSxppYx",
  6962. "name": "领券日志关键字搜索服务",
  6963. "type": "service",
  6964. "props": {
  6965. "devId": "service_AcidSxppYx",
  6966. "isOpen": false,
  6967. "jsCode": "const emitter = new events.EventEmitter();\r\nlet condition = {};\r\n\r\nlet pageNum = param.hasOwnProperty('当前页码') && param.当前页码 > 0 ? parseInt(param.当前页码) : 1;\r\nlet pageSize = param.hasOwnProperty('每页大小') && param.每页大小 > 0 ? parseInt(param.每页大小) : 10;\r\nlet deptTotal = 0;\r\nlet deptList = [];\r\n\r\n\r\nemitter.on('output', () => {\r\n\r\n deptList = deptList.map(item => {\r\n\r\n return item;\r\n })\r\n\r\n _funcCb({\r\n code: 200,\r\n errMsg: 'ok',\r\n result: deptList,\r\n total: deptTotal\r\n });\r\n})\r\n\r\nemitter.on('setCondition', () => {\r\n let 搜索条件 = param.搜索条件 || {};\r\n if (搜索条件.hasOwnProperty('批次分类ID') && 搜索条件.批次分类ID) condition['批次分类ID'] = 搜索条件.批次分类ID;\r\n if (搜索条件.hasOwnProperty('批次名称') && 搜索条件.批次名称) condition['批次名称'] = ['like', 搜索条件.批次名称];\r\n if (搜索条件.hasOwnProperty('批次号') && 搜索条件.批次号) condition['批次号'] = ['like', 搜索条件.批次号];\r\n if (搜索条件.hasOwnProperty('领取结果')) condition['领取结果'] = 搜索条件.领取结果;\r\n if (搜索条件.hasOwnProperty('用户ID')) condition['用户ID'] = 搜索条件.用户ID;\r\n if (搜索条件.hasOwnProperty('兑换码ID')) condition['兑换码ID'] = 搜索条件.兑换码ID;\r\n if (搜索条件.hasOwnProperty('是否删除')) condition['是否删除'] = 搜索条件.是否删除;\r\n\r\n console.log('领券日志关键字搜索服务.condition',condition);\r\n});\r\n\r\nemitter.on('getTotal', () => {\r\n\r\n _F('dbViewTemp_ySBFNYEzPe').callMethod('getCount', {\r\n condition,\r\n success: (res) => {\r\n emitter.emit('getList', res[0].count);\r\n },\r\n fail: (err) => {\r\n _funcCb({\r\n code: 0,\r\n errMsg: '获取列表总数失败',\r\n result: err,\r\n total: 0\r\n });\r\n },\r\n\r\n });\r\n});\r\n\r\nemitter.on('getList', (total) => {\r\n\r\n _F('dbViewTemp_ySBFNYEzPe').callMethod('getRows', {\r\n condition,\r\n pageNum,\r\n pageSize,\r\n orderby: '_update',\r\n sort: 'desc',\r\n success: (res) => {\r\n deptTotal = total;\r\n deptList = res;\r\n emitter.emit('output');\r\n },\r\n fail: (err) => {\r\n _funcCb({\r\n code: 0,\r\n errMsg: '获取列表失败',\r\n result: err,\r\n total: 0\r\n });\r\n },\r\n\r\n });\r\n});\r\n\r\n\r\nemitter.emit('setCondition');\r\nemitter.emit('getTotal');",
  6968. "inParams": [
  6969. "搜索条件对象",
  6970. "当前页码",
  6971. "每页大小"
  6972. ],
  6973. "outParams": [],
  6974. "openApiPath": "",
  6975. "inParamsDebug": {}
  6976. }
  6977. },
  6978. {
  6979. "id": "service_m6jj8rdeSp",
  6980. "name": "批次删除服务",
  6981. "type": "service",
  6982. "props": {
  6983. "devId": "service_m6jj8rdeSp",
  6984. "isOpen": false,
  6985. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(param.hasOwnProperty('批次ID') && param['批次ID'] > 0)emitter.emit('editDept');\r\nelse emitter.emit('noDeptID');\r\n\r\n\r\nemitter.on('noDeptID', ()=>{\r\n _funcCb({code:0,errMsg:'请传入批次ID',result:{}});\r\n})\r\n\r\nemitter.on('editDept', ()=>{\r\n let condition = {};\r\n condition['_id'] = param.批次ID;\r\n\r\n let editObj = {};\r\n if(param.hasOwnProperty('是否删除'))editObj['是否删除'] = param.是否删除 == 1?1:0;\r\n\r\n _F('dbTableTemp_aGxy3Zp8YK').callMethod('editRow',{\r\n row:editObj,\r\n condition,\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'操作成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('editDept');",
  6986. "inParams": [
  6987. "批次ID",
  6988. "是否删除"
  6989. ],
  6990. "outParams": [],
  6991. "openApiPath": "",
  6992. "inParamsDebug": {}
  6993. }
  6994. },
  6995. {
  6996. "id": "service_Di2yTiEnB3",
  6997. "name": "批次编辑服务",
  6998. "type": "service",
  6999. "props": {
  7000. "devId": "service_Di2yTiEnB3",
  7001. "isOpen": false,
  7002. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(param.hasOwnProperty('批次ID') && param['批次ID'] > 0)emitter.emit('editDept');\r\nelse emitter.emit('noDeptID');\r\n\r\n\r\nemitter.on('noDeptID', ()=>{\r\n _funcCb({code:0,errMsg:'请传入批次ID',result:{}});\r\n})\r\n\r\nemitter.on('editDept', ()=>{\r\n let condition = {};\r\n condition['_id'] = param.批次ID;\r\n\r\n let editObj = {};\r\n if(param.hasOwnProperty('批次分类ID'))editObj['批次分类ID'] = param.批次分类ID;\r\n if(param.hasOwnProperty('批次名称'))editObj['批次名称'] = param.批次名称;\r\n if(param.hasOwnProperty('是否上架'))editObj['是否上架'] = param.是否上架 == 1?1:0;\r\n\r\n _F('dbTableTemp_aGxy3Zp8YK').callMethod('editRow',{\r\n row:editObj,\r\n condition,\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'编辑成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('editDept');",
  7003. "inParams": [
  7004. "批次ID",
  7005. "批次分类ID",
  7006. "批次号",
  7007. "制券商户号",
  7008. "发券商户号",
  7009. "批次名称",
  7010. "批次简介",
  7011. "图片链接",
  7012. "是否首页展示",
  7013. "是否上架",
  7014. "上架时间",
  7015. "下架时间"
  7016. ],
  7017. "outParams": [],
  7018. "openApiPath": "",
  7019. "inParamsDebug": {
  7020. "批次ID": "",
  7021. "批次号": "",
  7022. "上架时间": "",
  7023. "下架时间": "",
  7024. "图片链接": "",
  7025. "批次名称": "",
  7026. "批次简介": "",
  7027. "是否上架": "",
  7028. "批次分类ID": "",
  7029. "制券商户号": "",
  7030. "发券商户号": "",
  7031. "是否首页展示": ""
  7032. }
  7033. }
  7034. },
  7035. {
  7036. "id": "service_azwnbpdzmE",
  7037. "name": "领券日志新增服务",
  7038. "type": "service",
  7039. "props": {
  7040. "devId": "service_azwnbpdzmE",
  7041. "isOpen": false,
  7042. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('addDept', ()=>{\r\n _F('dbTableTemp_aGxy3Zp8YK').callMethod('addRow',{\r\n row:{\r\n ...param,\r\n //是否删除:0\r\n },\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'新增成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('addDept');",
  7043. "inParams": [
  7044. "批次分类ID",
  7045. "批次号",
  7046. "用户ID",
  7047. "领取结果",
  7048. "券ID",
  7049. "失败原因"
  7050. ],
  7051. "outParams": [],
  7052. "openApiPath": "",
  7053. "inParamsDebug": {
  7054. "券ID": "",
  7055. "用户ID": "",
  7056. "批次号": "",
  7057. "失败原因": "",
  7058. "领取结果": "",
  7059. "批次分类ID": ""
  7060. }
  7061. }
  7062. }
  7063. ]
  7064. }
  7065. ]
  7066. },
  7067. {
  7068. "id": "state_5P2FPzFXCY",
  7069. "type": "state",
  7070. "children": []
  7071. },
  7072. {
  7073. "id": "services_TtnrzQsZC4",
  7074. "type": "services",
  7075. "children": [
  7076. {
  7077. "id": "group_c5PKsWN3nS",
  7078. "name": "数据表",
  7079. "type": "group",
  7080. "props": {
  7081. "devId": "group_c5PKsWN3nS"
  7082. },
  7083. "children": [
  7084. {
  7085. "id": "dbTableTemp_aGxy3Zp8YK",
  7086. "name": "领券日志列表",
  7087. "type": "dbTableTemp",
  7088. "props": {
  7089. "devId": "dbTableTemp_aGxy3Zp8YK",
  7090. "fields": [
  7091. {
  7092. "columnName": "_id",
  7093. "columnType": "int unsigned"
  7094. },
  7095. {
  7096. "columnName": "兑换码ID",
  7097. "columnType": "int"
  7098. },
  7099. {
  7100. "columnName": "批次分类ID",
  7101. "columnType": "int"
  7102. },
  7103. {
  7104. "columnName": "批次号",
  7105. "columnType": "text"
  7106. },
  7107. {
  7108. "columnName": "用户ID",
  7109. "columnType": "int"
  7110. },
  7111. {
  7112. "columnName": "领取结果",
  7113. "columnType": "int"
  7114. },
  7115. {
  7116. "columnName": "券ID",
  7117. "columnType": "text"
  7118. },
  7119. {
  7120. "columnName": "失败原因",
  7121. "columnType": "text"
  7122. },
  7123. {
  7124. "columnName": "_create",
  7125. "columnType": "bigint unsigned"
  7126. },
  7127. {
  7128. "columnName": "_update",
  7129. "columnType": "bigint unsigned"
  7130. }
  7131. ]
  7132. }
  7133. },
  7134. {
  7135. "id": "dbViewTemp_ySBFNYEzPe",
  7136. "name": "领券日志+批次分类+兑换码视图",
  7137. "type": "dbViewTemp",
  7138. "props": {}
  7139. }
  7140. ]
  7141. }
  7142. ]
  7143. }
  7144. ]
  7145. },
  7146. {
  7147. "id": "modules_x85zWT6y3T",
  7148. "name": "模块",
  7149. "type": "modules",
  7150. "props": {}
  7151. }
  7152. ]
  7153. },
  7154. {
  7155. "id": "module_KQRf23H6p8",
  7156. "name": "活动分类管理后台组件",
  7157. "type": "module",
  7158. "props": {
  7159. "devId": "module_KQRf23H6p8",
  7160. "appModuleId": "",
  7161. "appModuleVersion": 14
  7162. },
  7163. "children": [
  7164. {
  7165. "id": "config_hywwdAkckw",
  7166. "name": "角色管理后台组件",
  7167. "type": "config",
  7168. "props": {
  7169. "style": {}
  7170. }
  7171. },
  7172. {
  7173. "id": "front_scGiAkrp88",
  7174. "name": "前台",
  7175. "type": "front",
  7176. "props": {
  7177. "style": {
  7178. "width": "100%",
  7179. "height": "100%",
  7180. "display": "flex",
  7181. "overflow": "hidden auto",
  7182. "alignItems": "flex-start",
  7183. "flexDirection": "column",
  7184. "backgroundColor": "#ffffff"
  7185. }
  7186. },
  7187. "children": [
  7188. {
  7189. "id": "props_N3R2Y6eSDE",
  7190. "type": "props",
  7191. "children": [
  7192. {
  7193. "id": "fPAttr_ShYp3RhM43",
  7194. "type": "fPAttr",
  7195. "children": []
  7196. },
  7197. {
  7198. "id": "fPMethod_nsbfjJG3bW",
  7199. "type": "fPMethod",
  7200. "children": []
  7201. },
  7202. {
  7203. "id": "fPEvent_XjyPDZiCxF",
  7204. "type": "fPEvent",
  7205. "children": []
  7206. }
  7207. ]
  7208. },
  7209. {
  7210. "id": "state_EW84sDKHtd",
  7211. "type": "state",
  7212. "children": []
  7213. },
  7214. {
  7215. "id": "method_wspZHY8GiN",
  7216. "type": "method",
  7217. "children": []
  7218. },
  7219. {
  7220. "id": "dom_QPdXaT7BsW",
  7221. "type": "dom",
  7222. "children": []
  7223. }
  7224. ]
  7225. },
  7226. {
  7227. "id": "backend_72rEaNwNR2",
  7228. "name": "后台",
  7229. "type": "backend",
  7230. "props": {
  7231. "style": {
  7232. "height": "200px",
  7233. "backgroundColor": "red"
  7234. }
  7235. },
  7236. "children": [
  7237. {
  7238. "id": "props_t2b8Hzf2Ej",
  7239. "type": "props",
  7240. "children": [
  7241. {
  7242. "id": "bPAttr_XGmWhQt57t",
  7243. "type": "bPAttr",
  7244. "children": []
  7245. },
  7246. {
  7247. "id": "bPMethod_YrAcTPAbkY",
  7248. "type": "bPMethod",
  7249. "children": [
  7250. {
  7251. "id": "service_MeJ5kQx5GB",
  7252. "name": "活动分类关键字搜索服务",
  7253. "type": "service",
  7254. "props": {
  7255. "devId": "service_MeJ5kQx5GB",
  7256. "isOpen": false,
  7257. "jsCode": "const emitter = new events.EventEmitter();\r\nlet condition = {};\r\n\r\nlet pageNum = param.hasOwnProperty('当前页码') && param.当前页码 > 0 ? parseInt(param.当前页码) : 1;\r\nlet pageSize = param.hasOwnProperty('每页大小') && param.每页大小 > 0 ? parseInt(param.每页大小) : 10;\r\nlet deptTotal = 0;\r\nlet deptList = [];\r\n\r\n\r\nemitter.on('output', () => {\r\n\r\n deptList = deptList.map(item => {\r\n\r\n return item;\r\n })\r\n\r\n _funcCb({\r\n code: 200,\r\n errMsg: 'ok',\r\n result: deptList,\r\n total: deptTotal\r\n });\r\n})\r\n\r\nemitter.on('setCondition', () => {\r\n let 搜索条件 = param.搜索条件 || {};\r\n if (搜索条件.hasOwnProperty('批次分类ID') && 搜索条件.批次分类ID) condition['_id'] = 搜索条件.批次分类ID;\r\n if (搜索条件.hasOwnProperty('分类名称') && 搜索条件.分类名称) condition['分类名称'] = ['like', 搜索条件.分类名称];\r\n if (搜索条件.hasOwnProperty('批次分类') && 搜索条件.批次分类) condition['批次分类'] = ['like', 搜索条件.批次分类];\r\n if (搜索条件.hasOwnProperty('是否删除')) condition['是否删除'] = 搜索条件.是否删除;\r\n});\r\n\r\nemitter.on('getTotal', () => {\r\n\r\n _F('dbTableTemp_pTM2d2xs45').callMethod('getCount', {\r\n condition,\r\n success: (res) => {\r\n emitter.emit('getList', res[0].count);\r\n },\r\n fail: (err) => {\r\n _funcCb({\r\n code: 0,\r\n errMsg: '获取列表总数失败',\r\n result: err,\r\n total: 0\r\n });\r\n },\r\n\r\n });\r\n});\r\n\r\nemitter.on('getList', (total) => {\r\n\r\n _F('dbTableTemp_pTM2d2xs45').callMethod('getRows', {\r\n condition,\r\n pageNum,\r\n pageSize,\r\n orderby: '_update',\r\n sort: 'desc',\r\n success: (res) => {\r\n deptTotal = total;\r\n deptList = res;\r\n emitter.emit('output');\r\n },\r\n fail: (err) => {\r\n _funcCb({\r\n code: 0,\r\n errMsg: '获取列表失败',\r\n result: err,\r\n total: 0\r\n });\r\n },\r\n\r\n });\r\n});\r\n\r\n\r\nemitter.emit('setCondition');\r\nemitter.emit('getTotal');",
  7258. "inParams": [
  7259. "搜索条件对象",
  7260. "当前页码",
  7261. "每页大小"
  7262. ],
  7263. "outParams": [],
  7264. "openApiPath": "",
  7265. "inParamsDebug": {}
  7266. }
  7267. },
  7268. {
  7269. "id": "service_zAxmdNYtSs",
  7270. "name": "活动分类删除服务",
  7271. "type": "service",
  7272. "props": {
  7273. "devId": "service_zAxmdNYtSs",
  7274. "isOpen": false,
  7275. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(param.hasOwnProperty('批次分类ID') && param['批次分类ID'] > 0)emitter.emit('editDept');\r\nelse emitter.emit('noDeptID');\r\n\r\n\r\nemitter.on('noDeptID', ()=>{\r\n _funcCb({code:0,errMsg:'请传入批次分类ID',result:{}});\r\n})\r\n\r\nemitter.on('editDept', ()=>{\r\n let condition = {};\r\n condition['_id'] = param.批次分类ID;\r\n\r\n let editObj = {};\r\n if(param.hasOwnProperty('是否删除'))editObj['是否删除'] = param.是否删除 == 1?1:0;\r\n\r\n _F('dbTableTemp_pTM2d2xs45').callMethod('editRow',{\r\n row:editObj,\r\n condition,\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'操作成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('editDept');",
  7276. "inParams": [
  7277. "批次分类ID",
  7278. "是否删除"
  7279. ],
  7280. "outParams": [],
  7281. "openApiPath": "",
  7282. "inParamsDebug": {}
  7283. }
  7284. },
  7285. {
  7286. "id": "service_64NNTKrwb3",
  7287. "name": "活动分类编辑服务",
  7288. "type": "service",
  7289. "props": {
  7290. "devId": "service_64NNTKrwb3",
  7291. "isOpen": false,
  7292. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(param.hasOwnProperty('行ID') && param['行ID'] > 0)emitter.emit('editDept');\r\nelse emitter.emit('noDeptID');\r\n\r\n\r\nemitter.on('noDeptID', ()=>{\r\n _funcCb({code:0,errMsg:'请传入行ID',result:{}});\r\n})\r\n\r\nemitter.on('editDept', ()=>{\r\n let condition = {};\r\n condition['_id'] = param.行ID;\r\n\r\n let editObj = {};\r\n if(param.hasOwnProperty('批次分类'))editObj['批次分类'] = param.批次分类;\r\n if(param.hasOwnProperty('分类名称'))editObj['分类名称'] = param.分类名称;\r\n if(param.hasOwnProperty('最大领取次数'))editObj['最大领取次数'] = param.最大领取次数;\r\n if(param.hasOwnProperty('图片地址'))editObj['图片地址'] = typeof param.图片地址 === 'object'?JSON.stringify(param.图片地址):param.图片地址;\r\n\r\n _F('dbTableTemp_pTM2d2xs45').callMethod('editRow',{\r\n row:editObj,\r\n condition,\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'编辑成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('editDept');",
  7293. "inParams": [
  7294. "行ID",
  7295. "分类名称",
  7296. "图片地址",
  7297. "批次分类",
  7298. "最大领取次数"
  7299. ],
  7300. "outParams": [],
  7301. "openApiPath": "",
  7302. "inParamsDebug": {
  7303. "行ID": "",
  7304. "分类名称": "",
  7305. "图片地址": "",
  7306. "批次分类": "",
  7307. "最大领取次数": ""
  7308. }
  7309. }
  7310. },
  7311. {
  7312. "id": "service_7nGTY6s3nQ",
  7313. "name": "活动分类新增服务",
  7314. "type": "service",
  7315. "props": {
  7316. "devId": "service_7nGTY6s3nQ",
  7317. "isOpen": false,
  7318. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('addDept', ()=>{\r\n _F('dbTableTemp_pTM2d2xs45').callMethod('addRow',{\r\n row:{\r\n ...param,\r\n 是否删除:0\r\n },\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'新增成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('addDept');",
  7319. "inParams": [
  7320. "分类名称",
  7321. "图片地址",
  7322. "批次分类",
  7323. "最大领取次数"
  7324. ],
  7325. "outParams": [],
  7326. "openApiPath": "",
  7327. "inParamsDebug": {
  7328. "分类名称": "",
  7329. "图片地址": "",
  7330. "批次分类": "",
  7331. "最大领取次数": ""
  7332. }
  7333. }
  7334. }
  7335. ]
  7336. }
  7337. ]
  7338. },
  7339. {
  7340. "id": "state_4pBQZFEN2h",
  7341. "type": "state",
  7342. "children": []
  7343. },
  7344. {
  7345. "id": "services_DfAWB5FNNp",
  7346. "type": "services",
  7347. "children": [
  7348. {
  7349. "id": "group_rHDfDzjx3r",
  7350. "name": "数据表",
  7351. "type": "group",
  7352. "props": {
  7353. "devId": "group_rHDfDzjx3r"
  7354. },
  7355. "children": [
  7356. {
  7357. "id": "dbTableTemp_pTM2d2xs45",
  7358. "name": "活动分类表",
  7359. "type": "dbTableTemp",
  7360. "props": {
  7361. "devId": "dbTableTemp_pTM2d2xs45",
  7362. "fields": [
  7363. {
  7364. "columnName": "_id",
  7365. "columnType": "int unsigned"
  7366. },
  7367. {
  7368. "columnName": "批次分类",
  7369. "columnType": "text"
  7370. },
  7371. {
  7372. "columnName": "分类名称",
  7373. "columnType": "text"
  7374. },
  7375. {
  7376. "columnName": "图片地址",
  7377. "columnType": "json"
  7378. },
  7379. {
  7380. "columnName": "最大领取次数",
  7381. "columnType": "int"
  7382. },
  7383. {
  7384. "columnName": "是否删除",
  7385. "columnType": "int"
  7386. },
  7387. {
  7388. "columnName": "_create",
  7389. "columnType": "bigint unsigned"
  7390. },
  7391. {
  7392. "columnName": "_update",
  7393. "columnType": "bigint unsigned"
  7394. }
  7395. ]
  7396. }
  7397. }
  7398. ]
  7399. },
  7400. {
  7401. "id": "group_BbcQDQhknr",
  7402. "name": "中台服务",
  7403. "type": "group",
  7404. "props": {
  7405. "devId": "group_BbcQDQhknr"
  7406. }
  7407. }
  7408. ]
  7409. }
  7410. ]
  7411. },
  7412. {
  7413. "id": "modules_W8ZkM2KcfC",
  7414. "name": "模块",
  7415. "type": "modules",
  7416. "props": {}
  7417. }
  7418. ]
  7419. },
  7420. {
  7421. "id": "module_3GdzS7iAEJ",
  7422. "name": "广告管理后台组件",
  7423. "type": "module",
  7424. "props": {
  7425. "devId": "module_3GdzS7iAEJ",
  7426. "appModuleId": "",
  7427. "appModuleVersion": 14
  7428. },
  7429. "children": [
  7430. {
  7431. "id": "config_tZnAKbdXQQ",
  7432. "name": "角色管理后台组件",
  7433. "type": "config",
  7434. "props": {
  7435. "style": {}
  7436. }
  7437. },
  7438. {
  7439. "id": "front_EDwBCQXGay",
  7440. "name": "前台",
  7441. "type": "front",
  7442. "props": {
  7443. "style": {
  7444. "width": "100%",
  7445. "height": "100%",
  7446. "display": "flex",
  7447. "overflow": "hidden auto",
  7448. "alignItems": "flex-start",
  7449. "flexDirection": "column",
  7450. "backgroundColor": "#ffffff"
  7451. }
  7452. },
  7453. "children": [
  7454. {
  7455. "id": "props_5FFQ88SCwi",
  7456. "type": "props",
  7457. "children": [
  7458. {
  7459. "id": "fPAttr_AzSnXW2ZMG",
  7460. "type": "fPAttr",
  7461. "children": []
  7462. },
  7463. {
  7464. "id": "fPMethod_PRfeh2f4TE",
  7465. "type": "fPMethod",
  7466. "children": []
  7467. },
  7468. {
  7469. "id": "fPEvent_J2AArbjZ63",
  7470. "type": "fPEvent",
  7471. "children": []
  7472. }
  7473. ]
  7474. },
  7475. {
  7476. "id": "state_wjFmzkmXJ4",
  7477. "type": "state",
  7478. "children": []
  7479. },
  7480. {
  7481. "id": "method_6DP5hXDJEH",
  7482. "type": "method",
  7483. "children": []
  7484. },
  7485. {
  7486. "id": "dom_BZ4AdFFCFJ",
  7487. "type": "dom",
  7488. "children": []
  7489. }
  7490. ]
  7491. },
  7492. {
  7493. "id": "backend_nk8YMFyiba",
  7494. "name": "后台",
  7495. "type": "backend",
  7496. "props": {
  7497. "style": {
  7498. "height": "200px",
  7499. "backgroundColor": "red"
  7500. }
  7501. },
  7502. "children": [
  7503. {
  7504. "id": "props_sAZihzGFS6",
  7505. "type": "props",
  7506. "children": [
  7507. {
  7508. "id": "bPAttr_7ra575ttC8",
  7509. "type": "bPAttr",
  7510. "children": []
  7511. },
  7512. {
  7513. "id": "bPMethod_cazTnGfGsG",
  7514. "type": "bPMethod",
  7515. "children": [
  7516. {
  7517. "id": "service_nwS5JzCrxZ",
  7518. "name": "广告关键字搜索服务",
  7519. "type": "service",
  7520. "props": {
  7521. "devId": "service_nwS5JzCrxZ",
  7522. "isOpen": false,
  7523. "jsCode": "const emitter = new events.EventEmitter();\r\nlet condition = {};\r\n\r\nlet pageNum = param.hasOwnProperty('当前页码') && param.当前页码 > 0 ? parseInt(param.当前页码) : 1;\r\nlet pageSize = param.hasOwnProperty('每页大小') && param.每页大小 > 0 ? parseInt(param.每页大小) : 10;\r\nlet deptTotal = 0;\r\nlet deptList = [];\r\n\r\n\r\nemitter.on('output', () => {\r\n\r\n deptList = deptList.map(item => {\r\n\r\n return item;\r\n })\r\n\r\n _funcCb({\r\n code: 200,\r\n errMsg: 'ok',\r\n result: deptList,\r\n total: deptTotal\r\n });\r\n})\r\n\r\nemitter.on('setCondition', () => {\r\n let 搜索条件对象 = param.搜索条件对象 || {};\r\n if (搜索条件对象.hasOwnProperty('广告位ID') && 搜索条件对象.广告位ID) condition['广告位ID'] = 搜索条件对象.广告位ID;\r\n // if (搜索条件对象.hasOwnProperty('批次分类') && 搜索条件对象.批次分类) condition['批次分类'] = ['like', 搜索条件对象.批次分类];\r\n if (搜索条件对象.hasOwnProperty('是否删除')) condition['是否删除'] = 搜索条件对象.是否删除;\r\n});\r\n\r\nemitter.on('getTotal', () => {\r\n\r\n _F('dbTableTemp_Gf83SMhtNs').callMethod('getCount', {\r\n condition,\r\n success: (res) => {\r\n emitter.emit('getList', res[0].count);\r\n },\r\n fail: (err) => {\r\n _funcCb({\r\n code: 0,\r\n errMsg: '获取列表总数失败',\r\n result: err,\r\n total: 0\r\n });\r\n },\r\n\r\n });\r\n});\r\n\r\nemitter.on('getList', (total) => {\r\n\r\n _F('dbTableTemp_Gf83SMhtNs').callMethod('getRows', {\r\n condition,\r\n pageNum,\r\n pageSize,\r\n orderby: '_update',\r\n sort: 'desc',\r\n success: (res) => {\r\n deptTotal = total;\r\n deptList = res;\r\n emitter.emit('output');\r\n },\r\n fail: (err) => {\r\n _funcCb({\r\n code: 0,\r\n errMsg: '获取列表失败',\r\n result: err,\r\n total: 0\r\n });\r\n },\r\n\r\n });\r\n});\r\n\r\n\r\nemitter.emit('setCondition');\r\nemitter.emit('getTotal');",
  7524. "inParams": [
  7525. "搜索条件对象",
  7526. "当前页码",
  7527. "每页大小"
  7528. ],
  7529. "outParams": [],
  7530. "openApiPath": "",
  7531. "inParamsDebug": {}
  7532. }
  7533. },
  7534. {
  7535. "id": "service_JpDz6Yr5WS",
  7536. "name": "广告删除服务",
  7537. "type": "service",
  7538. "props": {
  7539. "devId": "service_JpDz6Yr5WS",
  7540. "isOpen": false,
  7541. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(param.hasOwnProperty('广告ID') && param['广告ID'] > 0)emitter.emit('editDept');\r\nelse emitter.emit('noDeptID');\r\n\r\n\r\nemitter.on('noDeptID', ()=>{\r\n _funcCb({code:0,errMsg:'请传入广告ID',result:{}});\r\n})\r\n\r\nemitter.on('editDept', ()=>{\r\n let condition = {};\r\n condition['_id'] = param.广告ID;\r\n\r\n let editObj = {};\r\n if(param.hasOwnProperty('是否删除'))editObj['是否删除'] = param.是否删除 == 1?1:0;\r\n\r\n _F('dbTableTemp_Gf83SMhtNs').callMethod('editRow',{\r\n row:editObj,\r\n condition,\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'操作成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('editDept');",
  7542. "inParams": [
  7543. "广告ID",
  7544. "是否删除"
  7545. ],
  7546. "outParams": [],
  7547. "openApiPath": "",
  7548. "inParamsDebug": {}
  7549. }
  7550. },
  7551. {
  7552. "id": "service_MjCiFc8xna",
  7553. "name": "广告编辑服务",
  7554. "type": "service",
  7555. "props": {
  7556. "devId": "service_MjCiFc8xna",
  7557. "isOpen": false,
  7558. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nif(param.hasOwnProperty('行ID') && param['行ID'] > 0)emitter.emit('editDept');\r\nelse emitter.emit('noDeptID');\r\n\r\n\r\nemitter.on('noDeptID', ()=>{\r\n _funcCb({code:0,errMsg:'请传入行ID',result:{}});\r\n})\r\n\r\nemitter.on('editDept', ()=>{\r\n let condition = {};\r\n condition['_id'] = param.行ID;\r\n\r\n let editObj = {};\r\n if(param.hasOwnProperty('广告位ID'))editObj['广告位ID'] = param.广告位ID;\r\n if(param.hasOwnProperty('链接地址'))editObj['链接地址'] = param.链接地址;\r\n if(param.hasOwnProperty('图片地址'))editObj['图片地址'] = param.图片地址;\r\n\r\n _F('dbTableTemp_Gf83SMhtNs').callMethod('editRow',{\r\n row:editObj,\r\n condition,\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'编辑成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('editDept');",
  7559. "inParams": [
  7560. "行ID",
  7561. "广告位ID",
  7562. "链接地址",
  7563. "图片地址"
  7564. ],
  7565. "outParams": [],
  7566. "openApiPath": "",
  7567. "inParamsDebug": {
  7568. "广告ID": "",
  7569. "广告位ID": "",
  7570. "图片地址": "",
  7571. "链接地址": ""
  7572. }
  7573. }
  7574. },
  7575. {
  7576. "id": "service_PeFDMcznnm",
  7577. "name": "广告新增服务",
  7578. "type": "service",
  7579. "props": {
  7580. "devId": "service_PeFDMcznnm",
  7581. "isOpen": false,
  7582. "jsCode": "const emitter = new events.EventEmitter(); \r\n\r\nemitter.on('addDept', ()=>{\r\n _F('dbTableTemp_Gf83SMhtNs').callMethod('addRow',{\r\n row:{\r\n ...param,\r\n 是否删除:0\r\n },\r\n success:(data)=>{\r\n _funcCb({code:200,errMsg:'新增成功',result:data});\r\n },\r\n fail:()=>{\r\n }\r\n });\r\n})\r\n\r\nemitter.emit('addDept');",
  7583. "inParams": [
  7584. "广告位ID",
  7585. "链接地址",
  7586. "图片地址"
  7587. ],
  7588. "outParams": [],
  7589. "openApiPath": "",
  7590. "inParamsDebug": {
  7591. "广告位ID": "",
  7592. "图片地址": "",
  7593. "链接地址": ""
  7594. }
  7595. }
  7596. }
  7597. ]
  7598. }
  7599. ]
  7600. },
  7601. {
  7602. "id": "state_NYRHDyMSGi",
  7603. "type": "state",
  7604. "children": []
  7605. },
  7606. {
  7607. "id": "services_PBX2CiEpTT",
  7608. "type": "services",
  7609. "children": [
  7610. {
  7611. "id": "group_TPp8aS7e5i",
  7612. "name": "数据表",
  7613. "type": "group",
  7614. "props": {
  7615. "devId": "group_TPp8aS7e5i"
  7616. },
  7617. "children": [
  7618. {
  7619. "id": "dbTableTemp_Gf83SMhtNs",
  7620. "name": "广告表",
  7621. "type": "dbTableTemp",
  7622. "props": {
  7623. "devId": "dbTableTemp_Gf83SMhtNs",
  7624. "fields": [
  7625. {
  7626. "columnName": "_id",
  7627. "columnType": "int unsigned"
  7628. },
  7629. {
  7630. "columnName": "广告位ID",
  7631. "columnType": "int"
  7632. },
  7633. {
  7634. "columnName": "链接地址",
  7635. "columnType": "text"
  7636. },
  7637. {
  7638. "columnName": "图片地址",
  7639. "columnType": "text"
  7640. },
  7641. {
  7642. "columnName": "是否删除",
  7643. "columnType": "int"
  7644. },
  7645. {
  7646. "columnName": "_create",
  7647. "columnType": "bigint unsigned"
  7648. },
  7649. {
  7650. "columnName": "_update",
  7651. "columnType": "bigint unsigned"
  7652. }
  7653. ]
  7654. }
  7655. }
  7656. ]
  7657. },
  7658. {
  7659. "id": "group_dHSeAbZkDa",
  7660. "name": "中台服务",
  7661. "type": "group",
  7662. "props": {
  7663. "devId": "group_dHSeAbZkDa"
  7664. }
  7665. }
  7666. ]
  7667. }
  7668. ]
  7669. },
  7670. {
  7671. "id": "modules_CPmWnMHXfB",
  7672. "name": "模块",
  7673. "type": "modules",
  7674. "props": {}
  7675. }
  7676. ]
  7677. },
  7678. {
  7679. "id": "module_asYA84dpEi",
  7680. "name": "兑换码后台组件",
  7681. "type": "module",
  7682. "props": {
  7683. "expandedKeys": [
  7684. "backend_PDahQ77wBZ",
  7685. "props_Z33ebPNASi",
  7686. "bPMethod_TykwkDH7RS",
  7687. "services_HNYwNKEH3w",
  7688. "group_wxnJzZy4aj"
  7689. ]
  7690. },
  7691. "children": [
  7692. {
  7693. "id": "backend_PDahQ77wBZ",
  7694. "name": "后台",
  7695. "type": "backend",
  7696. "props": {},
  7697. "children": [
  7698. {
  7699. "id": "props_Z33ebPNASi",
  7700. "type": "props",
  7701. "children": [
  7702. {
  7703. "id": "bPAttr_Yx5jwB8krp",
  7704. "type": "bPAttr",
  7705. "children": []
  7706. },
  7707. {
  7708. "id": "bPMethod_TykwkDH7RS",
  7709. "type": "bPMethod",
  7710. "children": [
  7711. {
  7712. "id": "service_7XJCaaNJiy",
  7713. "name": "兑换码搜索服务",
  7714. "type": "service",
  7715. "props": {
  7716. "devId": "service_7XJCaaNJiy",
  7717. "isOpen": false,
  7718. "jsCode": "// 搜索服务\n\nconst emitter = new events.EventEmitter();\n\n\nlet condition = {};\n\n\nlet pageNum = param.hasOwnProperty('当前页码') && param.当前页码 > 0\n? parseInt(param.当前页码) : 1;\n\nlet pageSize = param.hasOwnProperty('每页大小') && param.每页大小\n> 0 ? parseInt(param.每页大小) : 10;\n\nlet list = [];\n\nlet total = 0;\n\n\nemitter.on('output', () => {\n \n list = list.map(item => {\n return item;\n })\n \n _funcCb({\n code: 200, \n errMsg: 'ok',\n result: list, \n total: total\n });\n})\n\n\nemitter.on('setCondition', () => {\n let 搜索条件 = param.搜索条件 || {};\n \n if(搜索条件.关键字) {\n condition['兑换码'] = ['like', `%${搜索条件.关键字}%`]; \n }\n \n if (搜索条件.hasOwnProperty('兑换状态')) {\n condition['兑换状态'] = 搜索条件.兑换状态;\n }\n \n if (搜索条件.hasOwnProperty('兑换码')) {\n condition['兑换码'] = 搜索条件.兑换码;\n }\n \n});\n\n\nemitter.on('getTotal', () => {\n \n _F('dbViewTemp_BjKtp3Di7c').callMethod('getCount', {\n condition,\n success: (res) => {\n emitter.emit('getList', res[0].count); \n },\n fail: (err) => {\n _funcCb({\n code: 0,\n errMsg: '获取总数失败',\n result: err,\n total: 0\n });\n }\n });\n \n});\n\n\nemitter.on('getList', (total) => {\n \n _F('dbViewTemp_BjKtp3Di7c').callMethod('getRows', {\n condition,\n pageNum,\n pageSize,\n orderby: '_update',\n sort: 'desc',\n success: (res) => {\n list = res;\n total = total;\n emitter.emit('output');\n },\n fail: (err) => {\n _funcCb({\n code: 0,\n errMsg: '获取列表失败',\n result: err,\n total: 0\n });\n }\n });\n \n});\n\n\nemitter.emit('setCondition');\n\nemitter.emit('getTotal');\n",
  7719. "inParams": [
  7720. "搜索条件",
  7721. "当前页码",
  7722. "每页大小"
  7723. ],
  7724. "outParams": [],
  7725. "openApiPath": "",
  7726. "inParamsDebug": {}
  7727. }
  7728. },
  7729. {
  7730. "id": "service_HEyriYsYDd",
  7731. "name": "兑换码编辑服务",
  7732. "type": "service",
  7733. "props": {
  7734. "devId": "service_HEyriYsYDd",
  7735. "isOpen": false,
  7736. "jsCode": "// 编辑服务\nconst emitter = new events.EventEmitter();\n\nif (param.hasOwnProperty('行ID') && param['行ID'] > 0) {\n emitter.emit('edit');\n} else {\n emitter.emit('noId'); \n return;\n}\n\nemitter.on('noId', () => {\n _funcCb({code: 0, errMsg: '请传入行ID', result: {}});\n});\n\nemitter.on('edit', () => {\n \n let condition = {};\n condition['_id'] = param.行ID;\n \n let updateObj = {};\n \n if(param.hasOwnProperty('兑换码')) {\n updateObj['兑换码'] = param.兑换码; \n }\n \n if(param.hasOwnProperty('兑换状态')) {\n updateObj['兑换状态'] = param.兑换状态; \n }\n \n if(param.hasOwnProperty('批次ID')) {\n updateObj['批次ID'] = param.批次ID; \n }\n \n if(param.hasOwnProperty('兑换结果')) {\n updateObj['兑换结果'] = param.兑换结果; \n }\n \n _F('dbTableTemp_cryyss64wp').callMethod('editRow', {\n row: updateObj,\n condition,\n success: () => {\n _funcCb({code: 200, errMsg: '编辑成功', result: {}});\n },\n fail: (err) => {\n // 编辑失败\n _funcCb({code: 0, errMsg: '编辑失败', result: err});\n }\n });\n \n});\n\nemitter.emit('edit');\n",
  7737. "inParams": [
  7738. "兑换码",
  7739. "兑换状态",
  7740. "批次ID",
  7741. "兑换结果"
  7742. ],
  7743. "outParams": [],
  7744. "openApiPath": "",
  7745. "inParamsDebug": {
  7746. "批次ID": "",
  7747. "兑换码": "",
  7748. "兑换状态": "",
  7749. "兑换结果": ""
  7750. }
  7751. }
  7752. },
  7753. {
  7754. "id": "service_8BYpSxRD3x",
  7755. "name": "兑换码新增服务",
  7756. "type": "service",
  7757. "props": {
  7758. "devId": "service_8BYpSxRD3x",
  7759. "isOpen": false,
  7760. "jsCode": "// 新增服务\nconst emitter = new events.EventEmitter();\n\nemitter.on('add', () => {\n \n let insertObj = {\n 兑换码:param.兑换码, \n 兑换状态:0, \n 批次ID:param.批次ID, \n 兑换结果:param.兑换结果, \n };\n \n _F('dbTableTemp_cryyss64wp').callMethod('addRow', {\n row: insertObj,\n success: () => {\n _funcCb({code: 200, errMsg: '新增成功', result: {}});\n },\n fail: (err) => {\n // 新增失败\n _funcCb({code: 0, errMsg: '新增失败', result: err});\n }\n });\n \n});\n\nemitter.emit('add');\n",
  7761. "inParams": [
  7762. "兑换码",
  7763. "兑换状态",
  7764. "批次ID",
  7765. "兑换结果"
  7766. ],
  7767. "outParams": [],
  7768. "openApiPath": "",
  7769. "inParamsDebug": {
  7770. "批次ID": "",
  7771. "兑换码": "",
  7772. "兑换状态": "",
  7773. "兑换结果": ""
  7774. }
  7775. }
  7776. }
  7777. ]
  7778. }
  7779. ]
  7780. },
  7781. {
  7782. "id": "state_NQxscsS2EP",
  7783. "type": "state",
  7784. "children": []
  7785. },
  7786. {
  7787. "id": "services_HNYwNKEH3w",
  7788. "type": "services",
  7789. "children": [
  7790. {
  7791. "id": "group_wxnJzZy4aj",
  7792. "name": "数据表",
  7793. "type": "group",
  7794. "props": {
  7795. "devId": "group_wxnJzZy4aj"
  7796. },
  7797. "children": [
  7798. {
  7799. "id": "dbTableTemp_cryyss64wp",
  7800. "name": "兑换码表",
  7801. "type": "dbTableTemp",
  7802. "props": {
  7803. "devId": "dbTableTemp_cryyss64wp",
  7804. "fields": [
  7805. {
  7806. "columnName": "_id",
  7807. "columnType": "int unsigned"
  7808. },
  7809. {
  7810. "columnName": "兑换码",
  7811. "columnType": "varchar(100)"
  7812. },
  7813. {
  7814. "columnName": "兑换状态",
  7815. "columnType": "int"
  7816. },
  7817. {
  7818. "columnName": "批次ID",
  7819. "columnType": "int"
  7820. },
  7821. {
  7822. "columnName": "兑换结果",
  7823. "columnType": "varchar(500)"
  7824. },
  7825. {
  7826. "columnName": "_create",
  7827. "columnType": "bigint unsigned"
  7828. },
  7829. {
  7830. "columnName": "_update",
  7831. "columnType": "bigint unsigned"
  7832. }
  7833. ]
  7834. }
  7835. },
  7836. {
  7837. "id": "dbViewTemp_BjKtp3Di7c",
  7838. "name": "兑换码+批次视图",
  7839. "type": "dbViewTemp",
  7840. "props": {}
  7841. }
  7842. ]
  7843. }
  7844. ]
  7845. }
  7846. ]
  7847. },
  7848. {
  7849. "id": "modules_RydscackjD",
  7850. "type": "modules",
  7851. "children": []
  7852. }
  7853. ]
  7854. },
  7855. {
  7856. "id": "module_remk87B6S2",
  7857. "name": "通用后台组件",
  7858. "type": "module",
  7859. "props": {
  7860. "appModuleId": "1003",
  7861. "expandedKeys": [
  7862. "backend_NahAfpsQQ4",
  7863. "services_dwCPAntfce",
  7864. "group_XwdWSEiFX4"
  7865. ],
  7866. "appModuleVersion": 25
  7867. },
  7868. "children": [
  7869. {
  7870. "id": "front_RDjfT7s2G7",
  7871. "type": "front",
  7872. "children": [
  7873. {
  7874. "id": "props_mchDrMtD2Z",
  7875. "type": "props",
  7876. "children": [
  7877. {
  7878. "id": "fPAttr_rP8EJjK7jX",
  7879. "type": "fPAttr",
  7880. "children": []
  7881. },
  7882. {
  7883. "id": "fPMethod_WRGYSxt4Cp",
  7884. "type": "fPMethod",
  7885. "children": []
  7886. },
  7887. {
  7888. "id": "fPEvent_bd3XzQSixC",
  7889. "type": "fPEvent",
  7890. "children": []
  7891. }
  7892. ]
  7893. },
  7894. {
  7895. "id": "state_EbzKKjdwJ2",
  7896. "type": "state",
  7897. "children": []
  7898. },
  7899. {
  7900. "id": "method_Antnkr3Ji4",
  7901. "type": "method",
  7902. "children": []
  7903. },
  7904. {
  7905. "id": "dom_k4b7p3iFXx",
  7906. "type": "dom",
  7907. "children": []
  7908. }
  7909. ]
  7910. },
  7911. {
  7912. "id": "backend_NahAfpsQQ4",
  7913. "type": "backend",
  7914. "children": [
  7915. {
  7916. "id": "props_nezD2bWSix",
  7917. "type": "props",
  7918. "children": [
  7919. {
  7920. "id": "bPAttr_XhZpRRZR87",
  7921. "type": "bPAttr",
  7922. "children": [
  7923. {
  7924. "id": "variable_QcWhAZe56c",
  7925. "name": "数据表字段",
  7926. "type": "variable",
  7927. "props": {
  7928. "memo": "<pre><code class=\"language-javascript\">[\r\n {\r\n \"dataIndex\": \"用户名\",\r\n \"operate\": \"search|filter|add|edit\",\r\n },\r\n {\r\n \"dataIndex\": \"密码\",\r\n \"operate\": \"filter|add|edit\",\r\n },\r\n]</code></pre><pre><code >\r 字段名: `dataIndex`\r\n 字段操作权限(多个以|分隔): `operate` (\r\n `search`: 关键字搜索,\r\n `filter`: 精确匹配,\r\n `add`: 新增,\r\n `edit`: 编辑,\r\n )\r\n 匹配类型:`filterType` (\r\n `between`: 范围\r\n )</code></pre><p><br></p>",
  7929. "devId": "variable_QcWhAZe56c"
  7930. }
  7931. }
  7932. ]
  7933. },
  7934. {
  7935. "id": "bPMethod_eNXrCFdpcQ",
  7936. "type": "bPMethod",
  7937. "children": [
  7938. {
  7939. "id": "service_ZX7EkSNxjR",
  7940. "name": "新增服务",
  7941. "type": "service",
  7942. "props": {
  7943. "isSync": true,
  7944. "jsCode": "const emitter = new events.EventEmitter();\n\nconst 新增操作字段 = await _F('service_S6zwFPhEp5').call({ 操作: 'add' });\n\nemitter.on('add', () => {\n\n let data = {};\n 新增操作字段.map(field => {\n const defVal = typeof field?.default === 'function' ? field.default() : field?.default;\n data[field.dataIndex] = param[field.dataIndex] === undefined? defVal : param[field.dataIndex]\n })\n\n _F('dbTableTemp_xiMSY5yJNc').callMethod('addRow', {\n row: data,\n success: (res) => {\n // console.log('新增服务结果',{res})\n data._id = res.insertId;\n _funcCb({ code: 200, errMsg: '新增成功',result: data});\n },\n fail: (err) => {\n _funcCb({ code: 0, errMsg: '新增失败',result: err});\n }\n });\n\n});\n\nemitter.emit('add');\n",
  7945. "inParams": [],
  7946. "outParams": []
  7947. }
  7948. },
  7949. {
  7950. "id": "service_SmQXCDGN2Z",
  7951. "name": "编辑服务",
  7952. "type": "service",
  7953. "props": {
  7954. "isOpen": false,
  7955. "isSync": true,
  7956. "jsCode": "const emitter = new events.EventEmitter();\n\nemitter.on('noId', () => {\n _funcCb({ code: 0, errMsg: '请提供行ID' });\n});\n\nconst 编辑条件字段 = await _F('service_S6zwFPhEp5').call({ 操作: 'eKey' });\nconst 编辑操作字段 = await _F('service_S6zwFPhEp5').call({ 操作: 'edit' });\n\n\nlet condition = {};\n编辑条件字段.map(field => {\n if (param.hasOwnProperty(field.dataIndex)) {\n condition[field.dataIndex] = param[field.dataIndex];\n }\n})\n\nif (Object.keys(condition)?.length === 0) {\n\n if (param.行ID !== undefined) {\n condition = { _id: param.行ID };\n } else {\n emitter.emit('noId');\n return;\n }\n}\n\nemitter.on('edit', () => {\n\n\n\n\n let updateData = {};\n\n 编辑操作字段.map(field => {\n\n if (param.hasOwnProperty(field.dataIndex)) {\n updateData[field.dataIndex] = param[field.dataIndex];\n }\n })\n\n _F('dbTableTemp_xiMSY5yJNc').callMethod('editRow', {\n condition,\n row: updateData,\n success: () => {\n _funcCb({ code: 200, errMsg: '修改成功' });\n },\n fail: (err) => {\n _funcCb({ code: 0, errMsg: '修改失败', result: err });\n }\n });\n\n});\n\nemitter.emit('edit');\n",
  7957. "inParams": [
  7958. "行ID"
  7959. ],
  7960. "outParams": []
  7961. }
  7962. },
  7963. {
  7964. "id": "service_HnxkCD6Ys7",
  7965. "name": "搜索服务",
  7966. "type": "service",
  7967. "props": {
  7968. "isOpen": false,
  7969. "isSync": true,
  7970. "jsCode": "\nconst emitter = new events.EventEmitter();\n\nlet pageNum = 1;\nlet pageSize = 10;\nlet condition = {};\n\nif (param.当前页码) {\n pageNum = param.当前页码;\n}\n\nif (param.每页大小) {\n pageSize = param.每页大小;\n}\n\nconst 筛选操作字段 = await _F('service_S6zwFPhEp5').call({ 操作: 'filter' });\nconst 搜索操作字段 = await _F('service_S6zwFPhEp5').call({ 操作: 'search' });\nconst 总和操作字段 = await _F('service_S6zwFPhEp5').call({ 操作: 'sum' });\nconst 总数操作字段 = await _F('service_S6zwFPhEp5').call({ 操作: 'count' });\n\n\nif (param.搜索条件 !== undefined && Object.keys(param.搜索条件).length) {\n\n let 搜索条件 = param.搜索条件;\n condition['and'] = [];\n\n if (搜索条件.关键字 && 搜索操作字段?.length > 0) {\n // condition['通道参数'] = ['like', `%${搜索条件.关键字}%`];\n let search = {\n 'or': []\n };\n 搜索操作字段.map(field => {\n search['or'].push({\n [field.dataIndex] : ['like', `%${搜索条件.关键字}%`]\n });\n })\n condition['and'].push(search);\n }\n\n if (筛选操作字段?.length > 0) {\n let filter = {\n 'and': []\n };\n 筛选操作字段.map(field => {\n\n if (搜索条件[field.dataIndex] !== undefined) {\n if (Array.isArray(搜索条件[field.dataIndex])) {\n if (field?.filterType === 'between' && 搜索条件[field.dataIndex]?.length === 2) {\n\n filter.and.push({\n 'and': [\n { [field.dataIndex]: ['>=', 搜索条件[field.dataIndex][0]] },\n { [field.dataIndex]: ['<=', 搜索条件[field.dataIndex][1]] }\n ]\n })\n } else {\n filter.and.push({\n [field.dataIndex]: ['in', 搜索条件[field.dataIndex]]\n })\n }\n } else {\n filter.and.push({\n [field.dataIndex]: 搜索条件[field.dataIndex]\n })\n }\n\n }\n })\n if(filter.and?.length > 0)\n condition['and'].push(filter);\n }\n\n if(condition['and']?.length === 1){\n condition = condition['and'][0];\n }\n\n}\n\nif (param.固定条件 !== undefined && Object.keys(param.固定条件).length) {\n\n let 固定条件 = param.固定条件;\n if(condition?.and){\n condition['and'].push(固定条件);\n }else{\n condition = {\n ...condition,\n 固定条件\n }\n }\n \n}\n\nlet total = 0;\nlet list = [];\nlet tongji = {};\n\nemitter.on('output', () => {\n\n let result = {\n code: 200,\n errMsg: 'ok',\n result: list,\n total: total,\n tongji: tongji,\n // condition\n };\n\n _funcCb(result);\n\n});\n\nemitter.on('error', (error) => {\n\n let result = {\n code: 0,\n errMsg: '查询失败',\n result: error\n };\n\n _funcCb(result);\n\n});\n\nemitter.on('getCount', (field) => {\n\n _F('dbViewTemp_wfrWwAbZJe').callMethod('getCount', {\n condition,\n field,\n success: (res) => {\n tongji[field] = res[0].count;\n },\n fail: (error) => {\n\n emitter.emit('output', error);\n }\n });\n\n});\n\nemitter.on('getSum', (field) => {\n\n _F('dbViewTemp_wfrWwAbZJe').callMethod('getSum', {\n condition,\n field,\n success: (res) => {\n const result = res[0] || {};\n Object.keys(result).map(field => tongji[field] = result[field]);\n\n },\n fail: (error) => {\n\n emitter.emit('output', error);\n }\n });\n\n});\n\nemitter.on('getTotal', () => {\n\n _F('dbViewTemp_wfrWwAbZJe').callMethod('getCount', {\n condition,\n success: (res) => {\n total = res[0].count;\n emitter.emit('getList');\n },\n fail: (error) => {\n emitter.emit('output', error);\n }\n });\n\n});\n\nemitter.on('getList', () => {\n\n _F('dbViewTemp_wfrWwAbZJe').callMethod('getRows', {\n condition,\n pageNum,\n pageSize,\n orderby: '_update',\n sort: 'desc',\n success: (res) => {\n list = res;\n emitter.emit('output');\n },\n fail: (error) => {\n\n emitter.emit('output', error);\n }\n });\n\n});\n\nif (param?.统计字段?.length) {\n\n let 统计字段 = param.统计字段;\n\n\n let 总和字段 = 统计字段?.filter(field => 总和操作字段?.find(opField => opField.dataIndex === field)) || [];\n let 总数字段 = 统计字段?.filter(field => 总数操作字段?.find(opField => opField.dataIndex === field)) || [];\n\n if (总数字段?.length > 0)\n 总数字段?.map(field => emitter.emit('getCount', field))\n\n if (总和字段?.length > 0)\n emitter.emit('getSum', 总和字段);\n}\n\n\n\nemitter.emit('getTotal');\n",
  7971. "inParams": [
  7972. {
  7973. "name": "当前页码",
  7974. "default": null
  7975. },
  7976. {
  7977. "name": "每页大小",
  7978. "default": null
  7979. },
  7980. {
  7981. "name": "搜索条件",
  7982. "default": null
  7983. },
  7984. {
  7985. "name": "固定条件"
  7986. }
  7987. ],
  7988. "outParams": [],
  7989. "inParamsDebug": null
  7990. }
  7991. },
  7992. {
  7993. "id": "service_ERbTR6esDz",
  7994. "name": "逻辑删除服务",
  7995. "type": "service",
  7996. "props": {
  7997. "isOpen": false,
  7998. "jsCode": "\nconst emitter = new events.EventEmitter();\n\nif(param.hasOwnProperty('行ID')) {\n emitter.emit('delete');\n} else {\n emitter.emit('noId');\n}\n\nemitter.on('noId', () => {\n _funcCb({code: 0, errMsg: '请提供行ID'});\n});\n\nemitter.on('delete', () => {\n\n let condition = {_id: param.行ID};\n let updateData = {\n 是否删除: 1\n };\n\n _F('dbTableTemp_xiMSY5yJNc').callMethod('editRow', {\n condition,\n row: updateData,\n success: () => {\n _funcCb({code: 200, errMsg:'删除成功'});\n },\n fail: (err) => {\n _funcCb({ code: 0, errMsg: '删除失败',result: err});\n }\n });\n\n});\n\nemitter.emit('delete');\n",
  7999. "inParams": [
  8000. "行ID"
  8001. ],
  8002. "outParams": []
  8003. }
  8004. },
  8005. {
  8006. "id": "service_Fz8RK7rnPj",
  8007. "name": "批量新增服务",
  8008. "type": "service",
  8009. "props": {
  8010. "isSync": true,
  8011. "jsCode": "const emitter = new events.EventEmitter();\n\nconst 行数组 = param.行数组 || [];\n\nconst 新增操作字段 = await _F('service_S6zwFPhEp5').call({ 操作: 'add' });\n\nemitter.on('add', () => {\n\n const rows = [];\n 行数组.map((row) => {\n let data = {};\n 新增操作字段.map(field => {\n const defVal = typeof field?.default === 'function' ? field.default() : field?.default;\n data[field.dataIndex] = row[field.dataIndex] || defVal\n })\n rows.push(data)\n })\n\n\n _F('dbTableTemp_xiMSY5yJNc').callMethod('addRows', {\n rows,\n success: () => {\n _funcCb({ code: 200, errMsg: '新增成功', result: {} });\n },\n fail: (err) => {\n _funcCb({ code: 0, errMsg: '新增失败', result: err });\n }\n });\n\n});\n\nemitter.emit('add');\n",
  8012. "inParams": [
  8013. {
  8014. "name": "行数组",
  8015. "default": null
  8016. }
  8017. ],
  8018. "outParams": []
  8019. }
  8020. }
  8021. ]
  8022. }
  8023. ]
  8024. },
  8025. {
  8026. "id": "state_chH5de2tQB",
  8027. "type": "state",
  8028. "children": []
  8029. },
  8030. {
  8031. "id": "services_dwCPAntfce",
  8032. "type": "services",
  8033. "children": [
  8034. {
  8035. "id": "group_r3zcZErBYX",
  8036. "name": "内部方法",
  8037. "type": "group",
  8038. "props": {},
  8039. "children": [
  8040. {
  8041. "id": "service_S6zwFPhEp5",
  8042. "name": "字段配置处理",
  8043. "type": "service",
  8044. "props": {
  8045. "jsCode": "let 数据表字段 = _F('variable_QcWhAZe56c').callMethod('get') || [];\nconst 操作 = param.操作;\n\n数据表字段 = 数据表字段.filter(item => item?.operate.split('|').includes(操作));\n\n_funcCb(数据表字段);",
  8046. "inParams": [
  8047. {
  8048. "name": "操作",
  8049. "default": null
  8050. }
  8051. ]
  8052. }
  8053. }
  8054. ]
  8055. },
  8056. {
  8057. "id": "group_XwdWSEiFX4",
  8058. "name": "数据表",
  8059. "type": "group",
  8060. "props": {
  8061. "devId": "group_XwdWSEiFX4"
  8062. },
  8063. "children": [
  8064. {
  8065. "id": "dbTableTemp_xiMSY5yJNc",
  8066. "name": "数据表",
  8067. "type": "dbTableTemp",
  8068. "props": {
  8069. "devId": "dbTableTemp_xiMSY5yJNc",
  8070. "fields": [
  8071. {
  8072. "columnName": "_id",
  8073. "columnType": "int unsigned"
  8074. },
  8075. {
  8076. "columnName": "是否删除",
  8077. "columnType": "int"
  8078. },
  8079. {
  8080. "columnName": "_create",
  8081. "columnType": "bigint unsigned"
  8082. },
  8083. {
  8084. "columnName": "_update",
  8085. "columnType": "bigint unsigned"
  8086. }
  8087. ]
  8088. }
  8089. },
  8090. {
  8091. "id": "dbViewTemp_wfrWwAbZJe",
  8092. "name": "视图",
  8093. "type": "dbViewTemp",
  8094. "props": {}
  8095. }
  8096. ]
  8097. }
  8098. ]
  8099. }
  8100. ]
  8101. },
  8102. {
  8103. "id": "modules_Q43pJDCHSZ",
  8104. "type": "modules",
  8105. "children": []
  8106. }
  8107. ],
  8108. "appModuleVersion": 25
  8109. }
  8110. ]
  8111. }
  8112. ]