123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161 |
- <template>
- <div class="mod-demo-echarts">
- <el-breadcrumb class="divi2" separator-class="el-icon-arrow-right">
- <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
- <el-breadcrumb-item :to="{ path: '/visi-design' }"
- >可视化设计</el-breadcrumb-item
- >
- <el-breadcrumb-item>实验设置</el-breadcrumb-item>
- </el-breadcrumb>
- <el-divider class="divi"></el-divider>
- <!-- <design-graph></design-graph> -->
- <!-- <design-graph-1 :visible.sync="designgraphvisi" v-if="designgraphvisi" ref="designgraph"></design-graph-1> -->
- <a-layout id="components-layout-demo-responsive">
- <!-- 左侧组件栏 default-expand-all-->
- <a-layout-sider
- breakpoint="lg"
- collapsed-width="0"
- @collapse="onCollapse"
- @breakpoint="onBreakpoint"
- theme="light"
- v-model="collapsed"
- collapsible
- >
- <div>
- <a-tree
- show-line
- show-icon
- :tree-data="treeData"
- :default-selected-keys="['0-0-0']"
- @select="onSelect"
- >
- <a-icon slot="icon" type="carry-out" />
- </a-tree>
- </div>
- </a-layout-sider>
- <!-- <div class="box" ref="box"> -->
- <!-- <div class="left"> -->
- <!-- 右侧画布 -->
- <div class="content">
- <div class="app-content">
- <div class="box" ref="box">
- <div class="left">
- <!-- <a-layout style="width:'100%',height:'100%',display:'flex'"> -->
- <el-form class="boxform">
- <el-form-item class="boxformitem">
- <!-- 画布上方按钮 undo redo-->
- <el-row>
- <el-tooltip
- content="提交"
- placement="bottom-end"
- effect="dark"
- >
- <i
- @click="onRun"
- style="
- height: 50px;
- width: 50px;
- margin: 10px 5px 10px 10px;
- font-size: 23px;
- "
- class="iconfont icon-yunXang"
- ></i>
- </el-tooltip>
- <el-tooltip
- content="保存"
- placement="bottom-end"
- effect="dark"
- >
- <i
- @click="onPrimary"
- style="
- height: 25px;
- width: 25px;
- margin: 10px 5px 10px 10px;
- font-size: 23px;
- "
- class="el-icon-document-checked"
- >
- </i>
- </el-tooltip>
- <el-tooltip content="取消" effect="dark">
- <i
- @click="onCancel"
- style="
- height: 25px;
- width: 25px;
- margin: 10px 5px 10px 10px;
- font-size: 23px;
- "
- class="el-icon-error"
- >
- </i>
- </el-tooltip>
- <el-tooltip content="Undo" effect="dark">
- <i
- @click="onUndo"
- style="
- height: 25px;
- width: 25px;
- margin: 10px 5px 10px 10px;
- font-size: 23px;
- "
- class="el-icon-arrow-left"
- >
- </i>
- </el-tooltip>
- <el-tooltip content="Redo" effect="dark">
- <i
- @click="onRedo"
- style="
- height: 25px;
- width: 25px;
- margin: 10px 5px 10px 10px;
- font-size: 23px;
- "
- class="el-icon-arrow-right"
- >
- </i>
- </el-tooltip>
- <el-tooltip content="示例" effect="dark">
- <i
- @click="onGetcontour"
- style="
- height: 25px;
- width: 25px;
- margin: 10px 5px 10px 10px;
- font-size: 23px;
- "
- class="el-icon-notebook-2"
- >
- </i>
- </el-tooltip>
- <el-tooltip content="清空" effect="dark">
- <i
- @click="onCleargraph"
- style="
- height: 25px;
- width: 25px;
- margin: 10px 5px 10px 10px;
- font-size: 23px;
- "
- class="el-icon-delete"
- >
- </i>
- </el-tooltip>
- <el-tooltip content="获取代码模板" effect="dark">
- <i
- @click="getParaTemp()"
- style="
- height: 25px;
- width: 25px;
- margin: 10px 5px 10px 10px;
- font-size: 23px;
- "
- class="el-icon-tickets"
- >
- </i>
- </el-tooltip>
- <el-tooltip content="日志" effect="dark">
- <i
- @click="getworkflowContent"
- style="
- height: 25px;
- width: 25px;
- margin: 10px 5px 10px 10px;
- font-size: 23px;
- "
- class="el-icon-document"
- >
- </i>
- </el-tooltip>
- <el-tooltip content="节点居中" effect="dark">
- <i
- @click="getgraphContentcenter"
- style="
- height: 25px;
- width: 25px;
- margin: 10px 5px 10px 10px;
- font-size: 23px;
- "
- class="iconfont icon-tishi"
- >
- </i>
- </el-tooltip>
- <el-tag
- :key="workflowstatustag.name"
- :type="workflowstatustag.type"
- @click="getWorkflowStatus"
- >{{ workflowstatustag.name }}</el-tag
- >
- </el-row>
- </el-form-item>
- <el-form-item class="boxformitem">
- <!-- 画布具体位置 -->
- <!-- <a-layout-content :style="{ margin: '0px 0px 0' }"> -->
- <!-- <div :style="{ padding: '24px', background: '#fff', minHeight: '360px' }"> -->
- <div
- style="width: 100%; height: 100%; display: flex"
- :style="{
- padding: '0px',
- background: '#fff',
- minHeight: '800px',
- }"
- >
- <!-- content -->
- <!-- 画布 style="width: 100%; height: 100%" class="app-content"-->
- <div id="container" style="flex: 1"></div>
- </div>
- <!-- </a-layout-content> -->
- </el-form-item>
- </el-form>
- <!-- </a-layout> -->
- </div>
- <div class="resize" title="收缩侧边栏"></div>
- <div class="right">
- <!-- 右侧组件栏 width="290px" style="width: 100%" width="239px" 309px-->
- <ExperimentConfig
- v-show="experimentVisi"
- ref="experConfig"
- @primaryExperimentclick="primaryExperimentConfig(arguments)"
- ></ExperimentConfig>
- <NodeConfig
- v-show="nodeConfigVisi"
- ref="newNodeConfig"
- @primaryNodeclick="primaryNodeConfig(arguments)"
- ></NodeConfig>
- <ConNodeConfig
- v-show="conNodeConfigVisi"
- ref="newConNodeConfig"
- @primaryclick="primaryConNodeConfig(arguments)"
- ></ConNodeConfig>
- <CSVSelectNodeConfig v-show="csvselectNodeConVisible" ref="csvselectNodeConfig" @primaryCSVselectNodeclick="primaryCSVselectNodeconfig(arguments)"></CSVSelectNodeConfig>
- <!-- <a-layout-sider
- breakpoint="lg"
- theme="light"
- width="100%"
- height="100%"
- collapsed-width="2"
- @collapse="onCollapse"
- @breakpoint="onBreakpoint"
- >
- <ExperimentConfig
- v-show="experimentVisi"
- ref="experConfig"
- ></ExperimentConfig>
- <NodeConfig
- v-show="nodeConfigVisi"
- ref="newNodeConfig"
- @primaryNodeclick="primaryNodeConfig(arguments)"
- ></NodeConfig>
- <ConNodeConfig
- v-show="conNodeConfigVisi"
- ref="newConNodeConfig"
- @primaryclick="primaryConNodeConfig(arguments)"
- ></ConNodeConfig>
- </a-layout-sider> -->
- </div>
- </div>
- </div>
- </div>
- <NodeParaTemp v-if="paraTempVisible" ref="paraTemp"></NodeParaTemp>
- <InputNodeConfig
- v-if="inputNodeConVisible"
- ref="inputNodeConfig"
- @refreshinputnode="primaryInputnodeConfig(arguments)"
- ></InputNodeConfig>
- <OutputNodeConfig
- v-if="outputNodeConVisible"
- ref="outputNodeConfig"
- ></OutputNodeConfig>
- <Workflowlog
- v-if="workflowContentVisi"
- ref="getworkflowlog"
- ></Workflowlog>
- </a-layout>
- <!-- 弹窗 -->
- <!-- <ConWatch v-if="newWatchVisible" ref="newWatch" @refreshDataList="getDataList"></ConWatch> -->
- </div>
- </template>
- <script>
- import { Cell, Graph, Model, Node } from "@antv/x6";
- import { Shape } from "@antv/x6";
- import { Addon } from "@antv/x6";
- import { Path } from "@antv/x6";
- // import { X6Splitbox } from "x6-vue-components";
- // import { SplitBox } from "@antv/x6";
- // import { X6Splitbox } from "@antv/x6-vue-shape";
- import { Rect } from "@antv/x6/lib/shape/basic";
- // import ConWatch from "./condition-watch.vue";
- // import StencilTree from "./stencil-tree.vue";
- import NodeConfig from "./design-node-config.vue";
- import ConNodeConfig from "./design-connode-config.vue";
- import ExperimentConfig from "./design-experconfig.vue";
- import NodeParaTemp from "./design-para-temp.vue";
- import InputNodeConfig from "./design-inputnode-config1.vue";
- import OutputNodeConfig from "./design-outputnode-config.vue";
- import Workflowlog from "./design-workflowlog.vue";
- import CSVSelectNodeConfig from "./design-csvselect-config.vue";
- import "@/ant-design-vue";
- import { Message } from "element-ui";
- import { MessageBox } from "element-ui";
- export default {
- data() {
- return {
- pregraphdata: "",
- dnd: null,
- // newConWatchVisible: false, //条件弹窗
- conNodeConfigVisi: false, //条件节点配置
- nodeConfigVisi: false, //普通节点配置
- experimentVisi: true, //实验配置
- paraTempVisible: false, //20211111 算法节点输入输出参数代码模板
- inputNodeConVisible: false, //输入节点配置
- outputNodeConVisible: false, //输出节点配置
- csvselectNodeConVisible: false, //csv文件转换节点配置
- //右侧参数设置组件栏
- formLayout: "horizontal",
- form: this.$form.createForm(this, { name: "coordinated" }),
- collapsed: false, //设置左侧侧边栏可收起
- addorupdate: true,//true表示update,新增 false表示add
- workflowId: null,//当前工作流id
- experimentName: "",//当前实验名称
- workflowName: "", //当前画布工作流名称
- workflowContent: { main: "", wait: "", init: "" }, //当前画布工作流整个日志
- workflowContentlog: "",
- workflowContentVisi: false,
- podlogs: null, //当前节点与workflow pod对应情况
- idTemplateNameMap: null, //id与templatename
- containertype: "main",
- workflowStatus: "uncommitted", //提交后的状态
- workflowstatustag: {
- name: "未提交",
- type: "info",
- },
- workflowdataList: [], //获取已经生成的画布列表, workflow列表
- algorithmdataList: [], //获取左侧树形组件栏,所有算法模块节点列表
- //20210926 树形组件
- treeData: [
- {
- title: "parent 1",
- key: "0-0",
- slots: {
- icon: "smile",
- },
- children: [
- // {
- // title: "consume_artifact",
- // key: "consume_artifact",
- // slots: { icon: "meh" },
- // },
- // {
- // title: "generate_artifact",
- // key: "generate_artifact",
- // scopedSlots: { icon: "custom" },
- // },
- // {
- // title: "zdockertest",
- // key: "zdockertest",
- // scopedSlots: { icon: "custom" },
- // },
- {
- title: "条件节点",
- key: "条件节点",
- scopedSlots: { icon: "custom" },
- },
- {
- title: "输入节点",
- key: "dataInputnode",
- scopedSlots: { icon: "custom" },
- },
- {
- title: "输出节点",
- key: "dataOutputnode",
- scopedSlots: { icon: "custom" },
- },
- {
- title: "CSV文件转换节点",
- key: "CSVSelectnode",
- scopedSlots: { icon: "custom" },
- },
- ],
- },
- {
- title: "轮廓识别",
- key: "0-1",
- slots: {
- icon: "smile",
- },
- children: [
- {
- title: "contourTask1",
- key: "contourTask1",
- scopedSlots: { icon: "custom" },
- },
- {
- title: "contourTask2",
- key: "contourTask2",
- scopedSlots: { icon: "custom" },
- },
- {
- title: "contourTask3",
- key: "contourTask3",
- scopedSlots: { icon: "custom" },
- },
- {
- title: "contourApproximate1",
- key: "contourApproximate1",
- scopedSlots: { icon: "custom" },
- },
- {
- title: "contourApproximate2",
- key: "contourApproximate2",
- scopedSlots: { icon: "custom" },
- },
- {
- title: "contourRect1",
- key: "contourRect1",
- scopedSlots: { icon: "custom" },
- },
- {
- title: "contourCircle2",
- key: "contourCircle2",
- scopedSlots: { icon: "custom" },
- },
- ],
- },
- ],
- showLine: true,
- showIcon: false,
- nodedata: [],
- imageurl: require("@/assets/img/cnnmnist.svg"),
- };
- },
- components: {
- NodeConfig: NodeConfig,
- ConNodeConfig: ConNodeConfig,
- ExperimentConfig: ExperimentConfig,
- NodeParaTemp: NodeParaTemp,
- InputNodeConfig: InputNodeConfig,
- OutputNodeConfig: OutputNodeConfig,
- Workflowlog: Workflowlog,
- CSVSelectNodeConfig: CSVSelectNodeConfig,
- // X6Splitbox: X6Splitbox,
- // SplitBox: splitbox,
- },
- activated() {
- this.getalgorithmDataList();
- this.onCleargraph();
- this.addorupdate = this.$route.query.update;
- console.log("addorupdate")
- console.log(this.addorupdate)
- //路由跳转--如果是修改,则加载画布信息;如果为新建,则不加载
- if(this.$route.query.update==true){
- this.initGraph(this.$route.query.winfo);
-
- }
- // this.createGraph();
- // this.addalgorithmdata();
- },
- // mounted() {
- mounted() {
- //为测试artifact 重新定义设置节点 保留之前的普通参数方式
- //将inputparameters 等参数[] 设置初始化为空
- // 定义节点
- Graph.registerNode("template-node", {
- inherit: "rect",
- width: 90,
- height: 80,
- attrs: {
- body: {
- strokeWidth: 1,
- stroke: "#d3e3ee",
- // fill: "#d3ebf3",
- fill: "#1891ec",
- rx: 8,
- ry: 8,
- },
- //设置内部添加图片
- image: {
- width: 36,
- height: 36,
- refX: 30,
- refY: 16,
- // "xlink:href":
- // "https://gw.alipayobjects.com/zos/bmw-prod/c55d7ae1-8d20-4585-bd8f-ca23653a4489.svg",
- },
- // label: {
- // refX: 3,
- // refY: 2,
- // textAnchor: "left",
- // textVerticalAnchor: "top",
- // fontSize: 12,
- // fill: "#fff",
- // },
- //删除功能
- //设置可通过backspace 删除,注释此部分
- // btn: {
- // refX: "100%",
- // refX2: -28,
- // // y: 4,
- // width: 24,
- // height: 18,
- // rx: 5,
- // ry: 5,
- // fill: "rgba(255,255,0,0.01)",
- // stroke: "white",
- // cursor: "pointer",
- // event: "node:delete",
- // },
- // btnText: {
- // fontSize: 14,
- // fill: "white",
- // text: "x",
- // refX: "100%",
- // refX2: -19,
- // // y: 17,
- // cursor: "pointer",
- // pointerEvent: "none",
- // },
- label: {
- // refX: 3,
- // refY: 2,
- refX: 0.5,
- refY: 0.85,
- fill: "#333",
- fontSize: 11,
- // fontWeight: "bold",
- fontVariant: "small-caps",
- },
- },
- ports: {
- groups: {
- // 输入链接桩群组定义
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: {
- visibility: true, //默认隐藏,不显示。定位到节点, 才展示
- },
- },
- },
- },
- // 输出链接桩群组定义
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- // stroke: "#fff",
- strokeWidth: 1,
- fill: "#fff",
- // style: {
- // visibility: "hidden", //默认隐藏,不显示。定位到节点, 才展示
- // },
- },
- },
- },
- },
- items: [
- {
- id: "inport1",
- group: "in",
- },
- {
- id: "inport2",
- group: "in",
- },
- {
- id: "outport1",
- group: "out",
- },
- {
- id: "outport2",
- group: "out",
- },
- ],
- },
- markup: [
- {
- tagName: "rect",
- selector: "body",
- attrs: {
- fill: "#fff",
- stroke: "#000",
- strokeWidth: 2,
- },
- },
- {
- tagName: "image",
- selector: "image",
- },
- {
- tagName: "text",
- selector: "label",
- attrs: {
- fill: "#333",
- textAnchor: "middle",
- textVerticalAnchor: "middle",
- },
- },
- // {
- // tagName: "g",
- // children: [
- // {
- // tagName: "text",
- // selector: "btnText",
- // },
- // {
- // tagName: "rect",
- // selector: "btn",
- // },
- // ],
- // },
- ],
- data: {
- nodeName: "",
- algonodeId: null,
- templateName: "",
- templateImage: "",
- templateCommand: {
- // 1: "echo",
- // 2: "{{inputs.parameters.message}}",
- // // 2:"\"{{inputs.parameters.message}}\""
- },
- //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
- // templateCommand2: [
- // {
- // 1:"echo"
- // },
- // {
- // 2:"{{inputs.parameters.message}}"
- // },
- // ],
- templateArgs: {
- // 1: "echo",
- },
- //20211116 新增 根据输入输出模板获取到的输入输出参数名称,类型,描述等
- algoparaInput: {
- userInput: [],
- getInput: [],
- }, //包括 userInput [] 和getInput[]
- algoparaOutput: [],
- //保存输入
- algoparaInputargu: {
- userInput: [],
- getInput: [],
- }, //包括 userInput [] 和getInput[]
- // algoparaOutAddress: "", //已改为description 无用
- algonodeSource: [],
- inputsparameters: [
- // //此container 需要输入的参数,固定
- // {
- // name: "message",
- // },
- // {
- // name: "message1",
- // },
- ],
- inputsartifacts: [
- // //此container 需要输入的参数,固定
- // {
- // name: "message",
- // path: "",
- // },
- ],
- argumentsparameters: [
- // {
- // name: "message",
- // value: "A",
- // },
- // //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
- // {
- // name: "message1",
- // value: "A",
- // },
- ],
- argumentsartifacts: [
- // //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
- // {
- // name: "message",
- // valuefrom: "A",
- // },
- ],
- outputsparameters: [
- // {
- // name: "message",
- // },
- // //此container 输出的参数,固定
- // // {
- // // name: "message1",
- // // },
- // // {
- // // name: "message2",
- // // },
- ],
- outputsartifacts: [
- // //此container 输出的参数,固定
- // {
- // name: "message",
- // path: "",
- // },
- ],
- //获取到的连接线源的数据 连接线的源的输出数据
- sourcedatalist: [
- // {
- // name: "source1",
- // from: "", // {{tasks.nodename.outputs.parameters.参数名}}
- // },
- // {
- // name: "source2",
- // from: "",
- // },
- ],
- sourceartilist: [
- // {
- // name: "source2",
- // from: "", //{{tasks.nodename.outputs.artifacts.参数名}}
- // },
- ],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- },
- });
- // // 定义边
- // Graph.registerConnector(
- // "algo-edge",
- // (source, target) => {
- // const offset = 4;
- // const control = 80;
- // const v1 = { x: source.x, y: source.y + offset + control };
- // const v2 = { x: target.x, y: target.y - offset - control };
- // return `M ${source.x} ${source.y}
- // L ${source.x} ${source.y + offset}
- // C ${v1.x} ${v1.y} ${v2.x} ${v2.y} ${target.x} ${target.y - offset}
- // L ${target.x} ${target.y}
- // `;
- // },
- // true
- // );
- //定义输入节点
- Graph.registerNode("template-input", {
- inherit: "rect",
- width: 90,
- height: 80,
- attrs: {
- body: {
- strokeWidth: 1,
- stroke: "#d3e3ee",
- fill: "#e2c3a0",
- rx: 8,
- ry: 8,
- },
- //设置内部添加图片
- image: {
- width: 36,
- height: 36,
- refX: 30,
- refY: 16,
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/c55d7ae1-8d20-4585-bd8f-ca23653a4489.svg",
- },
- label: {
- refX: 0.5,
- refY: 0.85,
- fill: "#333",
- fontSize: 11,
- // fontWeight: "bold",
- fontVariant: "small-caps",
- },
- },
- ports: {
- groups: {
- // 输入链接桩群组定义
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: {
- visibility: true, //默认隐藏,不显示。定位到节点, 才展示
- },
- },
- },
- },
- // 输出链接桩群组定义
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- // stroke: "#fff",
- strokeWidth: 1,
- fill: "#fff",
- // style: {
- // visibility: "hidden", //默认隐藏,不显示。定位到节点, 才展示
- // },
- },
- },
- },
- },
- items: [
- {
- id: "inport1",
- group: "in",
- },
- {
- id: "inport2",
- group: "in",
- },
- {
- id: "outport1",
- group: "out",
- },
- {
- id: "outport2",
- group: "out",
- },
- ],
- },
- markup: [
- {
- tagName: "rect",
- selector: "body",
- attrs: {
- fill: "#fff",
- stroke: "#000",
- strokeWidth: 2,
- },
- },
- {
- tagName: "image",
- selector: "image",
- },
- {
- tagName: "text",
- selector: "label",
- attrs: {
- fill: "#333",
- textAnchor: "middle",
- textVerticalAnchor: "middle",
- },
- },
- ],
- data: {
- nodeName: "",
- algonodeId: null,
- st_dataListvalue: [], //静态数据集选中 文件对应value
- dy_dataListvalue: [], //动态数据集选中 文件对应value
- fileList: [], //外部上传 文件
- allfilemap: [{}], //选中的文件对应的名称及url
- },
- });
- //定义输出节点
- Graph.registerNode("template-output", {
- inherit: "rect",
- width: 90,
- height: 80,
- attrs: {
- body: {
- strokeWidth: 1,
- stroke: "#d3e3ee",
- fill: "#e2c3a0",
- rx: 8,
- ry: 8,
- },
- //设置内部添加图片
- image: {
- width: 36,
- height: 36,
- refX: 30,
- refY: 16,
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/c55d7ae1-8d20-4585-bd8f-ca23653a4489.svg",
- },
- label: {
- refX: 0.5,
- refY: 0.85,
- fill: "#333",
- fontSize: 11,
- // fontWeight: "bold",
- fontVariant: "small-caps",
- },
- },
- ports: {
- groups: {
- // 输入链接桩群组定义
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: {
- visibility: true, //默认隐藏,不显示。定位到节点, 才展示
- },
- },
- },
- },
- // 输出链接桩群组定义
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- // stroke: "#fff",
- strokeWidth: 1,
- fill: "#fff",
- // style: {
- // visibility: "hidden", //默认隐藏,不显示。定位到节点, 才展示
- // },
- },
- },
- },
- },
- items: [
- {
- id: "inport1",
- group: "in",
- },
- {
- id: "inport2",
- group: "in",
- },
- {
- id: "outport1",
- group: "out",
- },
- {
- id: "outport2",
- group: "out",
- },
- ],
- },
- markup: [
- {
- tagName: "rect",
- selector: "body",
- attrs: {
- fill: "#fff",
- stroke: "#000",
- strokeWidth: 2,
- },
- },
- {
- tagName: "image",
- selector: "image",
- },
- {
- tagName: "text",
- selector: "label",
- attrs: {
- fill: "#333",
- textAnchor: "middle",
- textVerticalAnchor: "middle",
- },
- },
- ],
- data: {
- nodeName: "",
- algonodeId: null,
- sourcealgocell: null,
- },
- });
- //定义输出节点
- Graph.registerNode("template-csvselect", {
- inherit: "rect",
- width: 90,
- height: 80,
- attrs: {
- body: {
- strokeWidth: 1,
- stroke: "#d3e3ee",
- fill: "#e2c3a0",
- rx: 8,
- ry: 8,
- },
- //设置内部添加图片
- image: {
- width: 36,
- height: 36,
- refX: 30,
- refY: 16,
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/c55d7ae1-8d20-4585-bd8f-ca23653a4489.svg",
- },
- label: {
- refX: 0.5,
- refY: 0.85,
- fill: "#333",
- fontSize: 11,
- // fontWeight: "bold",
- fontVariant: "small-caps",
- },
- },
- ports: {
- groups: {
- // 输入链接桩群组定义
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: {
- visibility: true, //默认隐藏,不显示。定位到节点, 才展示
- },
- },
- },
- },
- // 输出链接桩群组定义
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- // stroke: "#fff",
- strokeWidth: 1,
- fill: "#fff",
- // style: {
- // visibility: "hidden", //默认隐藏,不显示。定位到节点, 才展示
- // },
- },
- },
- },
- },
- items: [
- {
- id: "inport1",
- group: "in",
- },
- {
- id: "inport2",
- group: "in",
- },
- {
- id: "outport1",
- group: "out",
- },
- {
- id: "outport2",
- group: "out",
- },
- ],
- },
- markup: [
- {
- tagName: "rect",
- selector: "body",
- attrs: {
- fill: "#fff",
- stroke: "#000",
- strokeWidth: 2,
- },
- },
- {
- tagName: "image",
- selector: "image",
- },
- {
- tagName: "text",
- selector: "label",
- attrs: {
- fill: "#333",
- textAnchor: "middle",
- textVerticalAnchor: "middle",
- },
- },
- ],
- data: {
- nodeName: "",
- algonodeId: null,
- st_dataListvalue: [], //静态数据集选中 文件对应value
- dy_dataListvalue: [], //动态数据集选中 文件对应value
- fileList: [], //外部上传 文件
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用 ---与算法节点的不同,存储文件名,桶名称,url
- allfilemap: [{}], //选中的文件对应的名称及url
- isMakenewfile: false,
- },
- });
- // 初始化画布
- const graph = new Graph({
- grid: true,
- container: document.getElementById("container"),
- // width: 1270,
- // width: 1200,
- // height: 750,
- autoResize: true,
- panning: {
- enabled: true,
- },
- //调节节点大小
- resizing: {
- enabled: false,
- },
- // model: {},
- history: true, //uodo和redo
- highlighting: {
- nodeAvailable: {
- //连线过程中,节点可以被链接时被使用。
- name: "className",
- args: {
- className: "available",
- },
- },
- magnetAvailable: {
- //连线过程中,链接桩可以被链接时被使用。
- name: "className",
- args: {
- className: "available",
- },
- },
- magnetAdsorbed: {
- //连线过程中,自动吸附到链接桩时被使用。
- name: "className",
- args: {
- className: "adsorbed",
- },
- },
- },
- scroller: {
- enabled: true,
- pannable: true,
- minVisibleHeight: 800,
- minVisibleWidth: 800,
- autoResize: true,
- height: 800,
- className: "x6-graph-scroller",
- },
- mousewheel: {
- enabled: true,
- modifiers: ["ctrl", "meta"],
- },
- clipboard: {
- enabled: true,
- useLocalStorage: true,
- },
- keyboard: {
- enabled: true,
- global: true,
- }, //快捷键
- selecting: {
- enabled: true,
- showNodeSelectionBox: true,
- // showEdgeSelectionBox: true,
- }, //选中 ,框选
- //节点与边交互
- translating: {
- restrict: true, //限制节点不能移动超出画布区域
- },
- connecting: {
- snap: true, //连线距离节点或者连接桩 50px 时会触发自动吸附
- allowBlank: false,
- allowLoop: false,
- highlight: true,
- sourceAnchor: {
- //指定源节点的锚点
- name: "bottom",
- },
- targetAnchor: {
- //指定目标节点的锚点
- name: "center",
- },
- connectionPoint: "anchor",
- // connector: "algo-edge",
- createEdge() {
- return graph.createEdge({
- //更新连接边edge样式
- router: {
- // name: "orth",
- name: "er",
- args: {
- offset: "center",
- },
- },
- attrs: {
- line: {
- // strokeDasharray: "5 5", //虚线
- stroke: "#808080",
- strokeWidth: 1,
- targetMarker: {
- name: "block",
- args: {
- size: "6",
- },
- },
- },
- },
- //在指定的位置处,渲染一个删除按钮,点击时删除对应的边。
- tools: {
- name: "button-remove",
- args: { distance: -40 },
- },
- });
- },
- validateMagnet({ magnet }) {
- return magnet.getAttribute("port-group") !== "in";
- },
- validateConnection({
- sourceView,
- targetView,
- sourceMagnet,
- targetMagnet,
- }) {
- // 只能从输出链接桩创建连接
- if (
- !sourceMagnet ||
- sourceMagnet.getAttribute("port-group") === "in"
- ) {
- return false;
- }
- // 只能连接到输入链接桩
- if (
- !targetMagnet ||
- targetMagnet.getAttribute("port-group") !== "in"
- ) {
- return false;
- }
- // 判断目标链接桩是否可连接
- const portId = targetMagnet.getAttribute("port");
- const node = targetView.cell;
- const port = node.getPort(portId);
- if (port && port.connected) {
- // if (port && port.connected) {
- return false;
- }
- return true;
- },
- },
- });
- // 创建 Graph 的实例
- // const graph = new Graph({
- // container: document.getElementById("container"),
- // width: 1380,
- // height: 750,
- // background: {
- // // color: "#f7f7f4", //设置画布背景颜色
- // color: "#ffffff",
- // },
- // grid: {
- // size: 8,
- // visible: true,
- // }, //网格
- // history: true, //uodo和redo
- // //滚动条
- // // scroller: {
- // // enabled: true,
- // // // pannable: true,
- // // // pageVisible: true,
- // // // pageBreak: false,
- // // },
- // mousewheel: {
- // enabled: true,
- // modifiers: ["ctrl", "meta"],
- // },
- // // clipboard: true, //剪切板
- // clipboard: {
- // enabled: true,
- // useLocalStorage: true,
- // },
- // keyboard: {
- // enabled: true,
- // global: true,
- // }, //快捷键
- // selecting: {
- // enabled: true,
- // showNodeSelectionBox: true,
- // // showEdgeSelectionBox: true,
- // }, //选中 ,框选
- // //节点与边交互
- // translating: {
- // restrict: true, //限制节点不能移动超出画布区域
- // },
- // //连线规则
- // connecting: {
- // snap: true,
- // allowBlank: false, //不允许连接到画布空白位置
- // allowMulti: false, //不允许在相同节点之间创建多条边
- // },
- // });
- this.graph = graph;
- this.history = graph.history; //Redo Undo
- // this.graph.toJSON()
- // const dnd = new Addon.Dnd({
- // target: this.graph,
- // scaled: false,
- // animation: true,
- // getDragNode(node) {
- // // 这里返回一个新的节点作为拖拽节点
- // return graph.createNode({
- // width: 60,
- // height: 20,
- // attrs: {
- // label: {
- // text: "Rect",
- // fill: "#6a6c8a",
- // },
- // body: {
- // stroke: "#31d0c6",
- // strokeWidth: 2,
- // },
- // },
- // });
- // },
- // getDropNode(node) {
- // const { width, height } = node.size();
- // // 返回一个新的节点作为实际放置到画布上的节点
- // return node.clone().size(width * 3, height * 3);
- // },
- // });
- // this.dnd = dnd;
- // // console.log("this.dnd");
- // // console.log(this.dnd);
- //绑定快捷键 ctrl+c ctrl+v
- this.graph.bindKey("ctrl+c", () => {
- const cells = this.graph.getSelectedCells();
- if (cells.length) {
- this.graph.copy(cells);
- }
- return false;
- });
- this.graph.bindKey("ctrl+v", () => {
- if (!this.graph.isClipboardEmpty()) {
- const cells = this.graph.paste({ offset: 32 });
- this.graph.cleanSelection();
- this.graph.select(cells);
- }
- return false;
- });
- this.graph.bindKey("backspace", () => {
- const cells = graph.getSelectedCells();
- if (cells.length) {
- graph.removeCells(cells);
- }
- });
- //节点删除 边未完成
- graph.on("node:delete", ({ view, e }) => {
- e.stopPropagation();
- view.cell.remove();
- console.log("node:delete");
- });
- //删除边
- graph.on("edge:delete", ({ view, e }) => {
- e.stopPropagation();
- view.cell.remove();
- });
- //delete
- graph.bindKey("backspace", () => {
- const cells = graph.getSelectedCells();
- if (cells.length) {
- graph.removeCells(cells);
- }
- });
- //20210804 涉及到一些通过 边连接 时传递的参数 及赋值行为,在边取消是要进行及时更改
- graph.on("cell:click", ({ e, cell, view }) => {
- // reset();
- // node.attr("body/stroke", "orange");
- console.log("单击节点成功");
- this.cell = cell;
- //条件节点;
- if (cell.shape == "polygon") {
- // this.newConWatchVisible = true;
- // this.conNodeConfigVisi = true;
- this.$nextTick(() => {
- this.conNodeConfigVisi = true;
- this.experimentVisi = false;
- this.nodeConfigVisi = false;
- this.csvselectNodeConVisible = false;
- this.$refs.newConNodeConfig.init(
- cell.getData().sourcedatalist,
- cell.getData().sourceartilist,
- cell.getData().inputcondition,
- cell
- );
- // this.$refs.newConWatch.init(
- // cell.getData().sourcedatalist,
- // cell.getData().inputcondition
- // );
- });
- } else if (cell.shape == "template-node") {
- // console.log(cell.getData());
- // console.log(this.workflowName);
- // console.log(cell.id);
- this.$nextTick(() => {
- this.nodeConfigVisi = true;
- this.conNodeConfigVisi = false;
- this.experimentVisi = false;
- this.csvselectNodeConVisible = false;
- this.$refs.newNodeConfig.init1(
- cell.getData(),
- cell,
- this.workflowName,
- this.idTemplateNameMap,
- this.workflowStatus
- );
- // if (this.$refs.newNodeConfig) {
- // // console.log("出现了");
- // this.$refs.newNodeConfig.init1(cell.getData(), cell);
- // }
- });
- } else if (cell.shape == "template-input") {
- // console.log(cell);
- // console.log(cell.getData());
- // console.log(this.workflowName);
- // console.log(cell.id);
- this.inputNodeConVisible = true;
- this.$nextTick(() => {
- this.$refs.inputNodeConfig.init(cell);
- });
- // addOrUpdateHandle(id) {
- // this.addOrUpdateVisible = true;
- // this.$nextTick(() => {
- // this.$refs.addOrUpdate.init(id);
- // });
- // },
- } else if (cell.shape == "template-output") {
- // console.log(cell.getData());
- // console.log(this.workflowName);
- // console.log(cell.id);\
- this.outputNodeConVisible = true;
- if (cell.getData().sourcealgocell != null) {
- //当前输出节点有 前序 算法节点
- this.$nextTick(() => {
- this.$refs.outputNodeConfig.init(
- cell,
- cell.getData(),
- cell.getData().sourcealgocell.getData(),
- this.workflowName,
- this.workflowStatus
- );
- });
- } else {
- this.$nextTick(() => {
- this.$refs.outputNodeConfig.init1(
- cell,
- cell.getData(),
- this.workflowName
- );
- });
- }
- }else if (cell.shape == "template-csvselect") {
- // console.log(cell.getData());
- // console.log(this.workflowName);
- // console.log(cell.id);
- this.$nextTick(() => {
- this.csvselectNodeConVisible = true;
- this.nodeConfigVisi = false;
- this.conNodeConfigVisi = false;
- this.experimentVisi = false;
- this.$refs.csvselectNodeConfig.init1(
- cell.getData(),cell
- );
-
- // if (this.$refs.newNodeConfig) {
- // // console.log("出现了");
- // this.$refs.newNodeConfig.init1(cell.getData(), cell);
- // }
- });
- }
- });
- //20211008 blank 画布空白区域
- graph.on("blank:click", ({ e, x, y }) => {
- // reset();
- // node.attr("body/stroke", "orange");
- console.log("单击空白区域成功");
- this.$nextTick(() => {
- this.conNodeConfigVisi = false;
- this.experimentVisi = true;
- this.nodeConfigVisi = false;
- this.csvselectNodeConVisible = false;
- this.$refs.experConfig.init();
- // this.visible = true;
- // this.$refs.experConfig.init();
- });
- });
- //双击节点 弹窗
- // graph.on("cell:dblclick", ({ e, cell, view }) => {
- // //条件节点
- // if (cell.shape == "polygon") {
- // // this.newConWatchVisible = true;
- // this.$nextTick(() => {
- // this.newConWatchVisible = true;
- // this.$refs.newConWatch.init(
- // cell.getData().sourcedatalist,
- // cell.getData().inputcondition
- // );
- // });
- // console.log("双击成功");
- // }
- // //普通rect节点
- // });
- //20210730
- //边发生连接 条件节点
- graph.on(
- "edge:connected",
- ({ isNew, edge, previousCell, previousPort, currentCell }) => {
- if (isNew) {
- // 对新创建的边进行插入数据库等持久化操作
- console.log("新建边:" + edge.id);
- const source = edge.getSourceCell();
- // console.log(edge);
- // console.log(edge.getSourceCell());
- // console.log(edge.getTargetCell());
- // console.log(currentCell);
- //添加任意一条边后,都需要获取源节点的输出参数列表,并将其写入到目标节点中
- //源节点为 rect,目标节点为rect
- if (
- source.shape == "template-node" &&
- currentCell.shape == "template-node"
- ) {
- //20211118
- var salgonodeSource = currentCell.getData().algonodeSource;
- var flag = 0;
- for (var i = 0; i < salgonodeSource.length; i++) {
- // if (salgonodeSource[i].cellId == source.cellId) {
- // flag = 1;
- // }
- if (salgonodeSource[i].id == source.id) {
- flag = 1;
- }
- }
- console.log("flag " + flag);
- if (flag == 0) {
- currentCell.setData({
- algonodeSource: salgonodeSource.concat(source),
- });
- }
- console.log(currentCell.getData().algonodeSource);
- //20210922 更改并保存 注释
- // const sourcedata = source.getData();
- // currentCell.setData({
- // sourcedatalist: sourcedata.outputsparameters,
- // });
- // //此处已更改
- // console.log("源节点为 template-node,目标节点为template-node");
- // console.log(edge.shape);
- // //仅为传递到 节点参数设置栏便于展示
- // //20210819 是否可以根据 nodeConfigVisi 来选择是否刷新
- // this.$nextTick(() => {
- // // this.nodeConfigVisi = true;
- // // this.conNodeConfigVisi = false;
- // // this.experimentVisi = false;
- // this.$refs.newNodeConfig.changeSourcedata(
- // currentCell.getData(),
- // currentCell
- // );
- // });
- // console.log(
- // "源节点为 template-node,目标节点为template-node 222"
- // );
- // const sourcedata = source.getData();
- // var soutputsparameters = sourcedata.outputsparameters;
- // var soutputsartifacts = sourcedata.outputsartifacts;
- // for (var i = 0; i < soutputsparameters.length; i++) {
- // soutputsparameters[i].from =
- // "{{tasks." +
- // sourcedata.nodeName +
- // ".outputs.parameters." +
- // soutputsparameters[i].name +
- // "}}";
- // }
- // for (var i = 0; i < soutputsartifacts.length; i++) {
- // soutputsartifacts[i].from =
- // "{{tasks." +
- // sourcedata.nodeName +
- // ".outputs.artifacts." +
- // soutputsartifacts[i].name +
- // "}}";
- // }
- // console.log("soutputsparameters,soutputsartifacts");
- // console.log(soutputsparameters);
- // console.log(soutputsartifacts);
- // //添加数据的方式 ---追加
- // //var newArr = arr.concat(arr2); concat()方法生成了一个新的数组,并不改变原来的数组。
- // const currsourcedatalist = currentCell.getData().sourcedatalist;
- // const currsourceartilist = currentCell.getData().sourceartilist;
- // currentCell.setData({
- // sourcedatalist: currsourcedatalist.concat(soutputsparameters),
- // sourceartilist: currsourceartilist.concat(soutputsartifacts),
- // });
- //此处已更改
- console.log("源节点为 template-node,目标节点为template-node");
- console.log(edge.shape);
- //仅为传递到 节点参数设置栏便于展示
- //20210819 是否可以根据 nodeConfigVisi 来选择是否刷新
- this.$nextTick(() => {
- // this.nodeConfigVisi = true;
- // this.conNodeConfigVisi = false;
- // this.experimentVisi = false;
- this.$refs.newNodeConfig.changeSourcedata(
- currentCell.getData(),
- currentCell
- );
- });
- }
- //源节点为 rect,目标节点为 polygon
- if (
- source.shape == "template-node" &&
- currentCell.shape == "polygon"
- ) {
- const sourcedata = source.getData();
- // currentCell.setData({
- // sourcedatalist: sourcedata.outputsparameters,
- // });
- var soutputsparameters = sourcedata.outputsparameters;
- var soutputsartifacts = sourcedata.outputsartifacts;
- for (var i = 0; i < soutputsparameters.length; i++) {
- soutputsparameters[i].from =
- "{{tasks." +
- sourcedata.nodeName +
- ".outputs.parameters." +
- soutputsparameters[i].paraname +
- "}}";
- }
- for (var i = 0; i < soutputsartifacts.length; i++) {
- soutputsartifacts[i].from =
- "{{tasks." +
- sourcedata.nodeName +
- ".outputs.partifacts." +
- soutputsartifacts[i].paraname +
- "}}";
- }
- currentCell.setData({
- sourcedatalist: currentCell
- .getData()
- .sourcedatalist.concat(soutputsparameters),
- });
- currentCell.setData({
- sourceartilist: currentCell
- .getData()
- .sourceartilist.concat(soutputsartifacts),
- });
- // console.log(currentCell.getData());
- // console.log("源节点为 template-node,目标节点为polygon");
- this.$nextTick(() => {
- // this.nodeConfigVisi = true;
- // this.conNodeConfigVisi = false;
- // this.experimentVisi = false;
- this.$refs.newConNodeConfig.changeSourcedata(
- currentCell.getData(),
- currentCell
- );
- });
- // console.log("源节点为 template-node,目标节点为polygon");
- }
- //源节点为 polygon,目标节点为 polygon
- //20210802 此处进行条件节点连接条件节点 ,改变目标节点的条件,与原条件进行 && 。可先进行判断目标节点的条件是否为空,若为空,直接复制,若不为空 ,则&&
- //取反等 均为字符串拼接
- //那么在用户输入条件语句时,也要判断节点条件是否为空,若为空,赋值,若不为空,&&
- //源节点为 polygon
- if (source.shape == "polygon") {
- //边的起始节点类型为条件节点
- if (edge.source.port == "righttrue") {
- // if(edge.getSourcePortId=="righttrue"){
- // source.data("truetargetid",currentCell.id);
- //20210730 zhang 赋值成功
- source.setData({ truetargetid: currentCell.id });
- //还需确定删除连接边之后 回复空值
- } else if (edge.source.port == "bottomfalse") {
- //边的目标节点为条件节点
- source.setData({ falsetargetid: currentCell.id });
- }
- }
- //如果源节点为输入节点,目的节点为 算法节点
- if (
- source.shape == "template-input" &&
- currentCell.shape == "template-node"
- ) {
- console.log("源节点为 template-input,目标节点为template-node");
- console.log(edge.shape);
- //仅为传递到 节点参数设置栏便于展示
- //20210819 是否可以根据 nodeConfigVisi 来选择是否刷新
- console.log(source);
- console.log(source.allfilemap);
- // currentCell.setData({inputnodefilemap:source.getData().allfilemap});
- this.$nextTick(() => {
- // this.nodeConfigVisi = true;
- // this.conNodeConfigVisi = false;
- // this.experimentVisi = false;
- this.$refs.newNodeConfig.changeinputnodemap(
- currentCell.getData(),
- currentCell,
- source.getData().allfilemap
- );
- });
- }
- //如果源节点为算法节点,目的节点为输入节点
- if (
- source.shape == "template-node" &&
- currentCell.shape == "template-output"
- ) {
- console.log("源节点为 template-node,目标节点为template-output");
- var curcelldata = currentCell.getData();
- curcelldata.sourcealgocell = source;
- this.graph.getCellById(currentCell.id).setData(curcelldata);
- this.$nextTick(() => {
- // this.nodeConfigVisi = true;
- // this.conNodeConfigVisi = false;
- // this.experimentVisi = false;
- this.$refs.outputNodeConfig.changeoutputsourcealgo(
- currentCell,
- currentCell.getData(),
- source,
- source.getData()
- );
- });
- }
- //如果源节点为输入节点,目的节点为CSV转换节点
- if (
- source.shape == "template-input" &&
- currentCell.shape == "template-csvselect"
- ) {
- console.log("源节点为 template-input,目标节点为template-csvselect");
- console.log(edge.shape);
- //仅为传递到 节点参数设置栏便于展示
- //20210819 是否可以根据 nodeConfigVisi 来选择是否刷新
- console.log(source);
- console.log(source.allfilemap);
- // currentCell.setData({inputnodefilemap:source.getData().allfilemap});
- this.$nextTick(() => {
- // this.nodeConfigVisi = true;
- // this.conNodeConfigVisi = false;
- // this.experimentVisi = false;
- this.$refs.csvselectNodeConfig.changeinputnodemap(
- currentCell.getData(),
- currentCell,
- source.getData().allfilemap
- );
- //待更改0722
- });
- }
- //如果源节点为输入节点,目的节点为 算法节点
- if (
- source.shape == "template-csvselect" &&
- currentCell.shape == "template-node"
- ) {
- console.log("源节点为 template-csvselect,目标节点为template-node");
- console.log(edge.shape);
- //仅为传递到 节点参数设置栏便于展示
- //20210819 是否可以根据 nodeConfigVisi 来选择是否刷新
- console.log(source);
- console.log(source.allfilemap);
- // currentCell.setData({inputnodefilemap:source.getData().allfilemap});
- this.$nextTick(() => {
- // this.nodeConfigVisi = true;
- // this.conNodeConfigVisi = false;
- // this.experimentVisi = false;
- this.$refs.newNodeConfig.changeinputnodemap(
- currentCell.getData(),
- currentCell,
- source.getData().allfilemap
- );
- });
- }
- }
- }
- );
- //依据条件判断的 赋值修改操作
- //20210922
- //边被移除 -----?
- graph.on(
- "edge:removed",
- ({ edge, previousCell, previousPort, currentCell, index }) => {
- console.log("edge:removed");
- // //20210923 将edge.getSourceCell() 以及previousCell 替换为edge.source,将currentCell替换为edge.target
- // //20210923 edge.source以及edge.target获取到的cell 并非为template-node 类型节点,修改为先回去源及目标节点Id,根据节点Id获取节点信息
- // //previousCell, currentCell 均为undefined
- // //edge.getSourceCell() 以及 edge.getTargetCell() 均为null
- // // console.log(previousCell);//undefined
- // // const source = edge.getSourceCell();
- // // const source = edge.source;
- // // const target = edge.target;
- // const sourceId = edge.getSourceCellId();
- // const source = graph.getCellById(sourceId);
- // const cellId = edge.getTargetCellId();
- // const target = graph.getCellById(cellId);
- // console.log(edge.source);
- // console.log(source.shape);
- // console.log(target.shape);
- // //删除边时,获取源节点的输出参数列表,匹配目标节点的sourcedatalist及sourceartilist
- // //源节点为 rect,目标节点为rect
- // if (
- // source.shape == "template-node" &&
- // target.shape == "template-node"
- // ) {
- // const sourcedata = source.getData();
- // //获取目标节点当前 sourcedatalist及sourceartilist
- // var targetsourpara = target.getData().sourcedatalist;
- // var targetsourarti = target.getData().sourceartilist;
- // //获取源节点的输出参数outputsparameters outputsartifacts
- // const soutputsparameters = sourcedata.outputsparameters;
- // const soutputsartifacts = sourcedata.outputsartifacts;
- // //遍历源节点的输出参数,在目标节点的 中删除对应的参数
- // for (var i = 0; i < soutputsparameters.length; i++) {
- // let strfrom =
- // "{{tasks." +
- // sourcedata.nodeName +
- // ".outputs.parameters." +
- // soutputsparameters[i].name +
- // "}}";
- // //acData.find(x => x.sid == id);
- // let index = targetsourpara.find((item) => item.from === strfrom);
- // targetsourpara.splice(index, 1);
- // }
- // for (var i = 0; i < soutputsartifacts.length; i++) {
- // let strfrom =
- // "{{tasks." +
- // sourcedata.nodeName +
- // ".outputs.partifacts." +
- // soutputsartifacts[i].name +
- // "}}";
- // let index = targetsourarti.find((item) => item.from === strfrom);
- // targetsourarti.splice(index, 1);
- // }
- // target.setData({
- // sourcedatalist: targetsourpara,
- // sourceartilist: targetsourarti,
- // });
- // //此处已更改
- // console.log("源节点为 template-node,目标节点为template-node");
- // console.log(edge.shape);
- // //仅为传递到 节点参数设置栏便于展示
- // //20210819 是否可以根据 nodeConfigVisi 来选择是否刷新
- // this.$nextTick(() => {
- // // this.nodeConfigVisi = true;
- // // this.conNodeConfigVisi = false;
- // // this.experimentVisi = false;
- // this.$refs.newNodeConfig.changeSourcedata(target.getData(), target);
- // });
- // console.log("源节点为 template-node,目标节点为template-node 222");
- // }
- // //源节点为 rect,目标节点为 polygon
- // if (source.shape == "template-node" && target.shape == "polygon") {
- // console.log("源节点为 rect,目标节点为 polygon");
- // const sourcedata = source.getData();
- // //获取目标节点当前 sourcedatalist及sourceartilist
- // var targetsourpara = target.getData().sourcedatalist;
- // var targetsourarti = target.getData().sourceartilist;
- // //获取源节点的输出参数outputsparameters outputsartifacts
- // const soutputsparameters = sourcedata.outputsparameters;
- // const soutputsartifacts = sourcedata.outputsartifacts;
- // //遍历源节点的输出参数,在目标节点的 中删除对应的参数
- // for (var i = 0; i < soutputsparameters.length; i++) {
- // let strfrom =
- // "{{tasks." +
- // sourcedata.nodeName +
- // ".outputs.parameters." +
- // soutputsparameters[i].name +
- // "}}";
- // //acData.find(x => x.sid == id);
- // console.log("strfrom:" + strfrom);
- // let index = targetsourpara.find((item) => item.from === strfrom);
- // console.log("index" + index);
- // targetsourpara.splice(index, 1);
- // }
- // for (var i = 0; i < soutputsartifacts.length; i++) {
- // let strfrom =
- // "{{tasks." +
- // sourcedata.nodeName +
- // ".outputs.partifacts." +
- // soutputsartifacts[i].name +
- // "}}";
- // console.log("strfrom:" + strfrom);
- // // let index = targetsourarti.find(item => item.from == strfrom);
- // let index = targetsourarti.findIndex(
- // (item) => item.from == strfrom
- // );
- // console.log("index");
- // console.log(index);
- // console.log(targetsourarti);
- // targetsourarti.splice(index, 1);
- // }
- // target.setData({
- // sourcedatalist: targetsourpara,
- // sourceartilist: targetsourarti,
- // });
- // console.log(target.getData());
- // console.log("源节点为 template-node,目标节点为polygon");
- // this.$nextTick(() => {
- // // this.nodeConfigVisi = true;
- // // this.conNodeConfigVisi = false;
- // // this.experimentVisi = false;
- // this.$refs.newConNodeConfig.changeSourcedata(
- // target.getData(),
- // target
- // );
- // });
- // console.log("源节点为 template-node,目标节点为polygon");
- // }
- // //源节点为 polygon,目标节点为 polygon
- // //20210802 此处进行条件节点连接条件节点 ,改变目标节点的条件,与原条件进行 && 。可先进行判断目标节点的条件是否为空,若为空,直接复制,若不为空 ,则&&
- // //取反等 均为字符串拼接
- // //那么在用户输入条件语句时,也要判断节点条件是否为空,若为空,赋值,若不为空,&&
- // //源节点为 polygon
- // if (source.shape == "polygon") {
- // //边的起始节点类型为条件节点
- // if (edge.source.port == "righttrue") {
- // // if(edge.getSourcePortId=="righttrue"){
- // // source.data("truetargetid",currentCell.id);
- // //20210730 zhang 赋值成功
- // source.setData({ truetargetid: target.id });
- // //还需确定删除连接边之后 回复空值
- // } else if (edge.source.port == "bottomfalse") {
- // //边的目标节点为条件节点
- // source.setData({ falsetargetid: target.id });
- // }
- // }
- }
- );
- //20210803 边 可删
- Graph.registerConnector(
- "curve",
- (sourcePoint, targetPoint) => {
- const path = new Path();
- path.appendSegment(Path.createSegment("M", sourcePoint));
- path.appendSegment(
- Path.createSegment(
- "C",
- sourcePoint.x,
- sourcePoint.y + 180,
- targetPoint.x,
- targetPoint.y - 180,
- targetPoint.x,
- targetPoint.y
- )
- );
- return path.serialize();
- },
- true
- );
- //20210715 zhang 该圆角矩形大小 及颜色合适
- const rect1 = new Shape.Rect({
- id: "node3",
- x: 60,
- y: 60,
- width: 140,
- height: 40,
- label: "rect",
- zIndex: 3,
- data: {
- templateName: "echo1",
- templateImage: "alpine:3.7",
- templateCommand: {
- 1: "echo",
- 2: "{{inputs.parameters.message}}",
- // 2:"\"{{inputs.parameters.message}}\""
- },
- //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
- // templateCommand2: [
- // {
- // 1:"echo"
- // },
- // {
- // 2:"{{inputs.parameters.message}}"
- // },
- // ],
- templateArgs: {
- // 1: "echo",
- },
- inputsparameters: [
- //此container 需要输入的参数,固定
- {
- name: "message",
- },
- ],
- argumentsparameters: [
- //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
- {
- name: "message",
- value: "A",
- },
- ],
- outputsparameters: [
- //此container 输出的参数,固定
- {
- name: "message",
- },
- {
- name: "message1",
- },
- ],
- },
- markup: [
- {
- tagName: "rect",
- selector: "body",
- },
- {
- tagName: "text",
- selector: "label",
- },
- {
- tagName: "g",
- children: [
- {
- tagName: "text",
- selector: "btnText",
- },
- {
- tagName: "rect",
- selector: "btn",
- },
- ],
- },
- ],
- attrs: {
- body: {
- fill: "#ffffff",
- // stroke: '#5dc3fd',
- stroke: "#5dc3fd",
- rx: 16,
- ry: 16,
- },
- //20210729 删除功能
- btn: {
- refX: "100%",
- refX2: -28,
- // y: 4,
- width: 24,
- height: 18,
- rx: 10,
- ry: 10,
- fill: "rgba(255,255,0,0.01)",
- stroke: "red",
- cursor: "pointer",
- event: "node:delete",
- },
- btnText: {
- fontSize: 14,
- fill: "red",
- text: "x",
- refX: "100%",
- refX2: -19,
- // y: 17,
- cursor: "pointer",
- pointerEvent: "none",
- },
- label: {
- text: "World",
- fill: "#333",
- fontSize: 18,
- fontWeight: "bold",
- fontVariant: "small-caps",
- },
- },
- ports: {
- groups: {
- // 输入链接桩群组定义
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 4,
- magnet: true,
- stroke: "#31d0c6",
- strokeWidth: 2,
- fill: "#fff",
- },
- },
- },
- // 输出链接桩群组定义
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 4,
- magnet: true,
- stroke: "#31d0c6",
- strokeWidth: 2,
- fill: "#fff",
- },
- },
- },
- },
- items: [
- {
- id: "port1",
- group: "in",
- },
- {
- id: "port2",
- group: "out",
- },
- ],
- },
- });
- const condition = new Shape.Polygon({
- width: 120,
- height: 120,
- attrs: {
- text: { text: "条件节点", fill: "condition" },
- body: {
- // fill: "#b6e3e7",
- stroke: "#b6e3e7",
- refPoints: "0,10 10,0 20,10 10,20",
- // refY: 0.3,
- },
- label: {
- fontSize: 16,
- fill: "#333",
- fontWeight: 800,
- // refY: 0.8,
- },
- },
- data: {
- nodeName: "condition1",
- truetargetid: "",
- falsetargetid: "",
- inputcondition: "true",
- sourcedatalist: [
- // {
- // name: "source1",
- // from: "",
- // },
- // {
- // name: "source2",
- // from: "",
- // },
- ],
- sourceartilist: [
- // {
- // name: "source1",
- // from: "",
- // },
- // {
- // name: "source2",
- // from: "",
- // },
- ],
- },
- ports: {
- groups: {
- in: {
- position: "top",
- attrs: {
- circle: {
- r: 4,
- magnet: true,
- stroke: "#5F95FF",
- strokeWidth: 2,
- fill: "#fff",
- // style: {
- // visibility: "hidden",
- // },
- },
- },
- },
- right: {
- position: "right",
- label: {
- position: "top",
- },
- attrs: {
- circle: {
- r: 4,
- magnet: true,
- stroke: "#5F95FF",
- strokeWidth: 2,
- fill: "#fff",
- // style: {
- // visibility: "hidden",
- // },
- },
- },
- },
- bottom: {
- position: "bottom",
- label: {
- position: "right",
- },
- attrs: {
- circle: {
- r: 4,
- magnet: true,
- stroke: "#5F95FF",
- strokeWidth: 2,
- fill: "#fff",
- // style: {
- // visibility: "hidden",
- // },
- },
- },
- },
- left: {
- position: "left",
- attrs: {
- circle: {
- r: 4,
- magnet: true,
- stroke: "#5F95FF",
- strokeWidth: 2,
- fill: "#fff",
- // style: {
- // visibility: "hidden",
- // },
- },
- },
- },
- },
- items: [
- {
- //通过id辨别
- group: "in",
- },
- {
- id: "righttrue",
- group: "right",
- attrs: {
- text: { text: "是" },
- },
- },
- {
- id: "bottomfalse",
- group: "bottom",
- attrs: {
- text: { text: "否" },
- },
- },
- {
- group: "left",
- },
- ],
- },
- });
- //条件节点
- const conditionnode = new Shape.Polygon({
- width: 80,
- height: 80,
- attrs: {
- text: { text: "条件节点", fill: "condition" },
- body: {
- // fill: "#b6e3e7",
- stroke: "#b6e3e7",
- refPoints: "0,10 10,0 20,10 10,20",
- // refY: 0.3,
- },
- label: {
- text: "条件节点",
- fontSize: 8,
- fill: "#333",
- fontWeight: 800,
- // refY: 0.8,
- },
- },
- data: {
- truetargetid: "",
- falsetargetid: "",
- inputcondition: "true",
- sourcedatalist: [
- {
- // name: "source1",
- // from: "",
- },
- ],
- sourceartilist: [
- {
- // name: "source1",
- // from: "",
- },
- ],
- },
- ports: {
- groups: {
- in: {
- position: "top",
- attrs: {
- circle: {
- r: 2,
- magnet: true,
- stroke: "#5F95FF",
- strokeWidth: 2,
- fill: "#fff",
- // style: {
- // visibility: "hidden",
- // },
- },
- },
- },
- out: {
- position: "right",
- label: {
- position: "top",
- },
- attrs: {
- circle: {
- r: 2,
- magnet: true,
- stroke: "#5F95FF",
- strokeWidth: 2,
- fill: "#fff",
- // style: {
- // visibility: "hidden",
- // },
- },
- },
- },
- out1: {
- position: "bottom",
- label: {
- position: "right",
- },
- attrs: {
- circle: {
- r: 2,
- magnet: true,
- stroke: "#5F95FF",
- strokeWidth: 2,
- fill: "#fff",
- // style: {
- // visibility: "hidden",
- // },
- },
- },
- },
- left: {
- position: "left",
- attrs: {
- circle: {
- r: 2,
- magnet: true,
- stroke: "#5F95FF",
- strokeWidth: 2,
- fill: "#fff",
- // style: {
- // visibility: "hidden",
- // },
- },
- },
- },
- },
- items: [
- {
- //通过id辨别
- id: "top",
- group: "in",
- },
- {
- id: "righttrue",
- group: "out",
- attrs: {
- text: { text: "是" },
- },
- },
- {
- id: "bottomfalse",
- group: "out1",
- attrs: {
- text: { text: "否" },
- },
- },
- {
- group: "left",
- },
- ],
- },
- });
- this.nodedata.push(conditionnode);
- //20210727 zhang 自定義中文
- // Graph.registerNode("selectnode", Rect);
- // //20211012 注释
- // ///20210720 zhang 左侧ui栏及拖拽 -----已变为左侧组件点击后画布生成
- // const stencil = new Addon.Stencil({
- // title: "组件库",
- // target: graph,
- // search(cell, keyword) {
- // return cell.shape.indexOf(keyword) !== -1;
- // },
- // placeholder: "Search by shape name",
- // notFoundText: "Not Found",
- // collapsable: true,
- // stencilGraphWidth: 240,
- // stencilGraphHeight: 600,
- // layoutOptions: {
- // columns: 1,
- // center: true,
- // dx: 30,
- // dy: 5,
- // },
- // groups: [
- // {
- // name: "group1",
- // title: "分类1",
- // },
- // {
- // name: "group2",
- // title: "分类2",
- // // collapsable: false,
- // },
- // ],
- // });
- // this.$refs.stencilContainer.appendChild(stencil.container);
- //20210907 zhang 左侧组件栏设置节点信息 从数据库读入时需要设置节点包含的相关pod 信息
- // stencil.load([c2.clone(), r2, r3, c3], "group2");
- // //20211012 注释
- // stencil.load(
- // [
- // cellz3,
- // generate_artifact,
- // consume_artifact,
- // cellz3.clone(),
- // cellz3.clone(),
- // ],
- // "group1"
- // );
- // stencil.load(
- // [
- // cellz3.clone(),
- // cellz3.clone(),
- // cellz3.clone(),
- // cellz3.clone(),
- // cellz3.clone(),
- // condition,
- // ],
- // "group2"
- // );
- // stencil.load([c2.clone(), r2, r3, c3, c3.clone()], "group2");
- // stencil.load([c2.clone(), r2, r3, c3], "group2");
- //创建节点
- const consume_artifact = this.graph.createNode({
- // width: 170,
- // height: 30,
- shape: "template-node",
- // label: "consume_artifact",
- attrs: {
- label: {
- text: "consume_artifact",
- },
- body: {
- // stroke: "#2CB9FF",
- // fill: "#2CB9FF",
- fill: "#d3ebf3",
- },
- // body: {
- // stroke: "#DA2625",
- // fill: "#DA2625",
- // },
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
- // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
- //可放图标
- },
- },
- data: {
- nodeName: "zhang_consume_artifac",
- templateName: "print-message",
- templateImage: "alpine:latest",
- templateCommand: {
- 1: "sh",
- 2: "-c",
- // 2:"\"{{inputs.parameters.message}}\""
- },
- //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
- // templateCommand2: [
- // {
- // 1:"echo"
- // },
- // {
- // 2:"{{inputs.parameters.message}}"
- // },
- // ],
- templateArgs: {
- 1: "cat /tmp/message",
- },
- inputsparameters: [],
- inputsartifacts: [
- //此container 需要输入的参数,固定
- {
- name: "message",
- path: "/tmp/message",
- },
- ],
- //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
- //应对应input中的各项参数设置对应参数
- argumentsparameters: [],
- argumentsartifacts: [
- //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
- {
- name: "message",
- valuefrom: "{{tasks.whalesay.outputs.artifacts.hello-art}}",
- },
- ],
- outputsparameters: [],
- outputsartifacts: [],
- //获取到的连接线源的数据 连接线的源的输出数据
- sourcedatalist: [
- // {
- // name: "source1",
- // },
- // {
- // name: "source2",
- // },
- ],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- },
- });
- // cellz4.setData({ templateName: "zhang" });
- const generate_artifact = graph.createNode({
- // width: 170,
- // height: 30,
- shape: "template-node",
- attrs: {
- label: {
- text: "generate_artifact",
- },
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
- },
- },
- data: {
- nodeName: "zhang_generate_artifact",
- templateName: "whalesay",
- templateImage: "docker/whalesay:latest",
- templateCommand: {
- 1: "sh",
- 2: "-c",
- // 2:"\"{{inputs.parameters.message}}\""
- },
- //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
- // templateCommand2: [
- // {
- // 1:"echo"
- // },
- // {
- // 2:"{{inputs.parameters.message}}"
- // },
- // ],
- templateArgs: {
- 1: "sleep 1; cowsay hello world | tee /tmp/hello_world.txt",
- },
- inputsparameters: [],
- inputsartifacts: [],
- //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
- //应对应input中的各项参数设置对应参数
- argumentsparameters: [],
- argumentsartifacts: [],
- outputsparameters: [],
- outputsartifacts: [
- //此container 输出的参数,固定
- {
- name: "hello-art",
- path: "/tmp/hello_world.txt",
- },
- ],
- //获取到的连接线源的数据 连接线的源的输出数据
- sourcedatalist: [
- // {
- // name: "source1",
- // },
- // {
- // name: "source2",
- // },
- ],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- },
- });
- // 轮廓识别代码示例,需重新更改节点数据格式
- const zdocker_test = this.graph.createNode({
- // width: 170,
- // height: 30,
- shape: "template-node",
- // label: "consume_artifact",
- attrs: {
- label: {
- text: "zdockertest",
- },
- body: {
- // stroke: "#2CB9FF",
- // fill: "#2CB9FF",
- fill: "#d3ebf3",
- },
- // body: {
- // stroke: "#DA2625",
- // fill: "#DA2625",
- // },
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
- // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
- //可放图标
- },
- },
- data: {
- nodeName: "zdockertest",
- templateName: "print-message",
- templateImage: "zvinjodocker/zdockertest1:20211011",
- templateCommand: {
- // 1: "sh",
- // 2: "-c",
- // 2:"\"{{inputs.parameters.message}}\""
- },
- //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
- // templateCommand2: [
- // {
- // 1:"echo"
- // },
- // {
- // 2:"{{inputs.parameters.message}}"
- // },
- // ],
- templateArgs: {
- // 1: "cat /tmp/message",
- },
- inputsparameters: [],
- inputsartifacts: [
- //此container 需要输入的参数,固定
- // {
- // name: "message",
- // path: "/tmp/message",
- // },
- ],
- //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
- //应对应input中的各项参数设置对应参数
- argumentsparameters: [],
- argumentsartifacts: [
- //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
- // {
- // name: "message",
- // valuefrom: "{{tasks.whalesay.outputs.artifacts.hello-art}}",
- // },
- ],
- outputsparameters: [],
- outputsartifacts: [],
- //获取到的连接线源的数据 连接线的源的输出数据
- sourcedatalist: [
- // {
- // name: "source1",
- // },
- // {
- // name: "source2",
- // },
- ],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- },
- });
- const contourTask1 = this.graph.createNode({
- // width: 170,
- // height: 30,
- shape: "template-node",
- // label: "consume_artifact",
- attrs: {
- label: {
- text: "contourTask1",
- },
- body: {
- // stroke: "#2CB9FF",
- // fill: "#2CB9FF",
- fill: "#d3ebf3",
- },
- // body: {
- // stroke: "#DA2625",
- // fill: "#DA2625",
- // },
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
- // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
- //可放图标
- },
- },
- data: {
- nodeName: "contourTask1",
- templateName: "contourTask1",
- templateImage: "zvinjodocker/contous_task1:20211014",
- templateCommand: {
- // 1: "sh",
- // 2: "-c",
- // 2:"\"{{inputs.parameters.message}}\""
- },
- //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
- // templateCommand2: [
- // {
- // 1:"echo"
- // },
- // {
- // 2:"{{inputs.parameters.message}}"
- // },
- // ],
- templateArgs: {
- // 1: "cat /tmp/message",
- },
- inputsparameters: [],
- inputsartifacts: [
- //此container 需要输入的参数,固定
- // {
- // name: "message",
- // path: "/tmp/message",
- // },
- ],
- //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
- //应对应input中的各项参数设置对应参数
- argumentsparameters: [],
- argumentsartifacts: [
- //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
- // {
- // name: "message",
- // valuefrom: "{{tasks.whalesay.outputs.artifacts.hello-art}}",
- // },
- ],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "thresh",
- paradesc: "",
- paratype: "",
- // path: "/myapps/thresh1.png",
- valuefrom: "/myapps/thresh1.png",
- },
- {
- paraname: "contours",
- // path: "/myapps/contours.png",
- paradesc: "",
- paratype: "",
- valuefrom: "/myapps/contours.png",
- },
- ],
- //获取到的连接线源的数据 连接线的源的输出数据
- sourcedatalist: [
- // {
- // name: "source1",
- // },
- // {
- // name: "source2",
- // },
- ],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- },
- });
- const contourTask2 = this.graph.createNode({
- // width: 170,
- // height: 30,
- shape: "template-node",
- attrs: {
- label: {
- text: "contourTask2",
- },
- body: {
- // stroke: "#2CB9FF",
- // fill: "#2CB9FF",
- fill: "#d3ebf3",
- },
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
- // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
- //可放图标
- },
- },
- data: {
- nodeName: "contourTask2",
- templateName: "contourTask2",
- templateImage: "zvinjodocker/contours_task2:20211014",
- templateCommand: {},
- templateArgs: {},
- inputsparameters: [],
- inputsartifacts: [
- {
- paraname: "thresh",
- parapath: "/myapps/thresh1.png",
- paradesc: "",
- },
- {
- paraname: "contours",
- parapath: "/myapps/contours.png",
- paradesc: "",
- },
- ],
- //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
- //应对应input中的各项参数设置对应参数
- argumentsparameters: [],
- argumentsartifacts: [
- {
- paraname: "thresh",
- valuefrom: "{{tasks.contourTask1.outputs.artifacts.thresh}}",
- fileurls: [],
- },
- {
- paraname: "contours",
- valuefrom: "{{tasks.contourTask1.outputs.artifacts.contours}}",
- fileurls: [],
- },
- ],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "contours0",
- // path: "/myapps/contours[0].npy",
- valuefrom: "/myapps/contours[0].npy",
- paradesc: "",
- paratype: "",
- },
- {
- paraname: "res",
- // path: "/myapps/res1.png",
- valuefrom: "/myapps/res1.png",
- paradesc: "",
- paratype: "",
- },
- ],
- //获取到的连接线源的数据 连接线的源的输出数据
- sourcedatalist: [],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- },
- });
- const contourTask3 = this.graph.createNode({
- // width: 170,
- // height: 30,
- shape: "template-node",
- // label: "consume_artifact",
- attrs: {
- label: {
- text: "contourTask3",
- },
- body: {
- // stroke: "#2CB9FF",
- // fill: "#2CB9FF",
- fill: "#d3ebf3",
- },
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
- // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
- //可放图标
- },
- },
- data: {
- nodeName: "contourTask3",
- templateName: "contourTask3",
- templateImage: "zvinjodocker/contours_task3:20211015",
- templateCommand: {},
- templateArgs: {},
- inputsparameters: [],
- inputsartifacts: [
- {
- paraname: "contours0",
- parapath: "/myapps/contours[0].npy",
- paradesc: "",
- },
- ],
- //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
- //应对应input中的各项参数设置对应参数
- argumentsparameters: [],
- argumentsartifacts: [
- {
- paraname: "contours0",
- valuefrom: "{{tasks.contourTask2.outputs.artifacts.contours0}}",
- fileurls: [],
- },
- ],
- outputsparameters: [],
- outputsartifacts: [],
- //获取到的连接线源的数据 连接线的源的输出数据
- sourcedatalist: [],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- },
- });
- const contourApproximate1 = this.graph.createNode({
- // width: 170,
- // height: 30,
- shape: "template-node",
- // label: "consume_artifact",
- attrs: {
- label: {
- text: "contourApproximate1",
- },
- body: {
- // stroke: "#2CB9FF",
- // fill: "#2CB9FF",
- fill: "#d3ebf3",
- },
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/c36fe7cb-dc24-4854-aeb5-88d8dc36d52e.svg",
- // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
- //可放图标
- },
- },
- data: {
- nodeName: "contourApproximate1",
- templateName: "contourApproximate1",
- templateImage: "zvinjodocker/contour_approximate1:20211015",
- templateCommand: {},
- templateArgs: {},
- inputsparameters: [],
- inputsartifacts: [],
- //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
- //应对应input中的各项参数设置对应参数
- argumentsparameters: [],
- argumentsartifacts: [],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "approxCnt",
- // path: "/myapps/approx_cnt.npy",
- valuefrom: "/myapps/approx_cnt.npy",
- paradesc: "",
- paratype: "",
- },
- {
- paraname: "approxRes",
- // path: "/myapps/approx_res.png",
- valuefrom: "/myapps/approx_res.png",
- paradesc: "",
- paratype: "",
- },
- ],
- //获取到的连接线源的数据 连接线的源的输出数据
- sourcedatalist: [],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- },
- });
- console.log("创建节点 contour_approximate1成功");
- const contourApproximate2 = this.graph.createNode({
- // width: 170,
- // height: 30,
- shape: "template-node",
- // label: "consume_artifact",
- attrs: {
- label: {
- text: "contourApproximate2",
- },
- body: {
- // stroke: "#2CB9FF",
- // fill: "#2CB9FF",
- fill: "#d3ebf3",
- },
- // body: {
- // stroke: "#DA2625",
- // fill: "#DA2625",
- // },
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/c55d7ae1-8d20-4585-bd8f-ca23653a4489.svg",
- // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
- //可放图标
- },
- },
- data: {
- nodeName: "contourApproximate2",
- templateName: "contourApproximate2",
- templateImage: "zvinjodocker/contour_approximate2:20211015",
- templateCommand: {
- // 1: "sh",
- // 2: "-c",
- // 2:"\"{{inputs.parameters.message}}\""
- },
- //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
- // templateCommand2: [
- // {
- // 1:"echo"
- // },
- // {
- // 2:"{{inputs.parameters.message}}"
- // },
- // ],
- templateArgs: {
- // 1: "cat /tmp/message",
- },
- inputsparameters: [],
- inputsartifacts: [
- //此container 需要输入的参数,固定
- // {
- // name: "message",
- // path: "/tmp/message",
- // },
- {
- paraname: "approxCnt",
- parapath: "/myapps/approx_cnt.npy",
- paradesc: "",
- },
- ],
- //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
- //应对应input中的各项参数设置对应参数
- argumentsparameters: [],
- argumentsartifacts: [
- //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
- // {
- // name: "message",
- // valuefrom: "{{tasks.whalesay.outputs.artifacts.hello-art}}",
- // },
- {
- paraname: "approxCnt",
- valuefrom:
- "{{tasks.contourApproximate1.outputs.artifacts.approxCnt}}",
- fileurls: [],
- },
- ],
- outputsparameters: [],
- outputsartifacts: [
- // {
- // name: "thresh",
- // path: "/myapps/thresh1.png",
- // },
- // {
- // name: "contours",
- // path: "/myapps/contours.png",
- // },
- {
- paraname: "approxRes2",
- // path: "/myapps/approx_res2.png",
- valuefrom: "/myapps/approx_res2.png",
- paradesc: "",
- paratype: "",
- },
- ],
- //获取到的连接线源的数据 连接线的源的输出数据
- sourcedatalist: [
- // {
- // name: "source1",
- // },
- // {
- // name: "source2",
- // },
- ],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- },
- });
- console.log("创建节点 contour_approximate2成功");
- const contourRect1 = this.graph.createNode({
- // width: 170,
- // height: 30,
- shape: "template-node",
- // label: "consume_artifact",
- attrs: {
- label: {
- text: "contourRect1",
- },
- body: {
- // stroke: "#2CB9FF",
- // fill: "#2CB9FF",
- fill: "#d3ebf3",
- },
- // body: {
- // stroke: "#DA2625",
- // fill: "#DA2625",
- // },
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/dc1ced06-417d-466f-927b-b4a4d3265791.svg",
- // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
- //可放图标
- },
- },
- data: {
- nodeName: "contourRect1",
- templateName: "contourRect1",
- templateImage: "zvinjodocker/contours_rect1:20211015",
- templateCommand: {
- // 1: "sh",
- // 2: "-c",
- // 2:"\"{{inputs.parameters.message}}\""
- },
- //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
- // templateCommand2: [
- // {
- // 1:"echo"
- // },
- // {
- // 2:"{{inputs.parameters.message}}"
- // },
- // ],
- templateArgs: {
- // 1: "cat /tmp/message",
- },
- inputsparameters: [],
- inputsartifacts: [
- //此container 需要输入的参数,固定
- // {
- // name: "message",
- // path: "/tmp/message",
- // },
- ],
- //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
- //应对应input中的各项参数设置对应参数
- argumentsparameters: [],
- argumentsartifacts: [
- //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
- // {
- // name: "message",
- // valuefrom: "{{tasks.whalesay.outputs.artifacts.hello-art}}",
- // },
- ],
- outputsparameters: [],
- outputsartifacts: [
- // {
- // name: "thresh",
- // path: "/myapps/thresh1.png",
- // },
- // {
- // name: "contours",
- // path: "/myapps/contours.png",
- // },
- {
- paraname: "cnt",
- // path: "/myapps/contour_rect_cnt.npy",
- valuefrom: "/myapps/contour_rect_cnt.npy",
- paradesc: "",
- paratype: "",
- },
- {
- paraname: "contourRect",
- // path: "/myapps/contour_rect.png",
- valuefrom: "/myapps/contour_rect.png",
- paradesc: "",
- paratype: "",
- },
- ],
- //获取到的连接线源的数据 连接线的源的输出数据
- sourcedatalist: [
- // {
- // name: "source1",
- // },
- // {
- // name: "source2",
- // },
- ],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- },
- });
- console.log("创建节点 contour_rect1成功");
- const contourCircle2 = this.graph.createNode({
- // width: 170,
- // height: 30,
- shape: "template-node",
- // label: "consume_artifact",
- attrs: {
- label: {
- text: "contourCircle2",
- },
- body: {
- // stroke: "#2CB9FF",
- // fill: "#2CB9FF",
- fill: "#d3ebf3",
- },
- // body: {
- // stroke: "#DA2625",
- // fill: "#DA2625",
- // },
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/687b6cb9-4b97-42a6-96d0-34b3099133ac.svg",
- // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logogetworkflowlog-with-text-73b8a.svg",
- //可放图标
- },
- },
- data: {
- nodeName: "contourCircle2",
- templateName: "contourCircle2",
- templateImage: "zvinjodocker/contours_circle2:20211015",
- templateCommand: {
- // 1: "sh",
- // 2: "-c",
- // 2:"\"{{inputs.parameters.message}}\""
- },
- //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
- // templateCommand2: [
- // {
- // 1:"echo"
- // },
- // {
- // 2:"{{inputs.parameters.message}}"
- // },
- // ],
- templateArgs: {
- // 1: "cat /tmp/message",
- },
- inputsparameters: [],
- inputsartifacts: [
- //此container 需要输入的参数,固定
- // {
- // name: "message",
- // path: "/tmp/message",
- // },
- {
- paraname: "contourRect",
- parapath: "/myapps/contour_rect.png",
- paradesc: "",
- },
- {
- paraname: "cnt",
- parapath: "/myapps/contour_rect_cnt.npy",
- paradesc: "",
- },
- ],
- //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
- //应对应input中的各项参数设置对应参数
- argumentsparameters: [],
- argumentsartifacts: [
- //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
- // {
- // name: "message",
- // valuefrom: "{{tasks.whalesay.outputs.artifacts.hello-art}}",
- // },
- {
- paraname: "contourRect",
- valuefrom: "{{tasks.contourRect1.outputs.artifacts.contourRect}}",
- fileurls: [],
- },
- {
- paraname: "cnt",
- valuefrom: "{{tasks.contourRect1.outputs.artifacts.cnt}}",
- fileurls: [],
- },
- ],
- outputsparameters: [],
- outputsartifacts: [
- // {
- // name: "thresh",
- // path: "/myapps/thresh1.png",
- // },
- // {
- // name: "contours",
- // path: "/myapps/contours.png",
- // },
- {
- paraname: "contourCircle",
- valuefrom: "contour_circle.png",
- // path: "contour_circle.png",
- paradesc: "",
- paratype: "",
- },
- ],
- //获取到的连接线源的数据 连接线的源的输出数据
- sourcedatalist: [
- // {
- // name: "source1",
- // },
- // {
- // name: "source2",
- // },
- ],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- },
- });
- // console.log("创建节点 contour_circle2成功");
- console.log("创建节点 algoinputnode");
- const dataInputnode = this.graph.createNode({
- // width: 170,
- // height: 30,
- shape: "template-input",
- // label: "consume_artifact",
- attrs: {
- label: {
- text: "dataInputnode",
- },
- body: {
- // stroke: "#2CB9FF",
- // fill: "#2CB9FF",
- fill: "#e2c3a0",
- },
- // body: {
- // stroke: "#DA2625",
- // fill: "#DA2625",
- // },
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/687b6cb9-4b97-42a6-96d0-34b3099133ac.svg",
- // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
- //可放图标
- },
- },
- data: {
- nodeName: "dataInputnode",
- templateName: "dataInputnode",
- st_dataListvalue: [], //静态数据集选中 文件对应value
- dy_dataListvalue: [], //动态数据集选中 文件对应value
- fileList: [], //外部上传 文件
- allfilemap: null, //选中的文件对应的名称及url
- },
- });
- const dataOutputnode = this.graph.createNode({
- // width: 170,
- // height: 30,
- shape: "template-output",
- // label: "consume_artifact",
- attrs: {
- label: {
- text: "dataOutputnode",
- },
- body: {
- // stroke: "#2CB9FF",
- // fill: "#2CB9FF",
- fill: "#e2c3a0",
- },
- // body: {
- // stroke: "#DA2625",
- // fill: "#DA2625",
- // },
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/687b6cb9-4b97-42a6-96d0-34b3099133ac.svg",
- // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
- //可放图标
- },
- },
- data: {
- nodeName: "dataOutputnode",
- templateName: "dataOutputnode",
- sourcealgocell: null, //输出节点的前一个节点的结果
- },
- });
- //创建CSV文件转换节点
- const CSVConversionnode = this.graph.createNode({
- // width: 170,
- // height: 30,
- shape: "template-csvselect",
- // label: "consume_artifact",
- attrs: {
- label: {
- text: "CSVConversionnode",
- },
- body: {
- // stroke: "#2CB9FF",
- // fill: "#2CB9FF",
- fill: "#e2c3a0",
- },
- // body: {
- // stroke: "#DA2625",
- // fill: "#DA2625",
- // },
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/687b6cb9-4b97-42a6-96d0-34b3099133ac.svg",
- // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
- //可放图标
- },
- },
- data: {
- nodeName: "CSVConversionnode",
- templateName: "CSVConversionnode",
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- allfilemap: null, //选中的文件对应的名称及url
- },
- });
- //20211012 zhang
- console.log("nodedata");
- // console.log(this.nodedata)
- this.nodedata.push(consume_artifact);
- this.nodedata.push(generate_artifact);
- this.nodedata.push(zdocker_test);
- this.nodedata.push(contourTask1);
- this.nodedata.push(contourTask2);
- this.nodedata.push(contourTask3);
- this.nodedata.push(contourApproximate1);
- this.nodedata.push(contourApproximate2);
- this.nodedata.push(contourRect1);
- this.nodedata.push(contourCircle2);
- //数据输入 和 结果输出节点
- this.nodedata.push(dataInputnode);
- this.nodedata.push(dataOutputnode);
- this.nodedata.push(CSVConversionnode);
- console.log(this.nodedata);
- //设置布局左右可拖动
- let me = this;
- me.dragControllerDiv();
- console.log("yu");
- },
- methods: {
- initGraph(info) {
- //修改当前画布
- //查询画布数据,导入画布
- this.workflowId = info.workflowId;
- this.graph.fromJSON(JSON.parse(info.graphJson).cells);
- console.log("fromJson"+info.graphJson)
-
-
- console.log(JSON.parse(info.graphJson).cells)
- },
- createGraph() {
- const graph = new Graph({
- grid: true,
- container: document.getElementById("container"),
- // width: 1270,
- // width: 1200,
- // height: 750,
- autoResize: true,
- // panning: {
- // enabled: true,
- // },
- resizing: {
- enabled: true,
- },
- // model: {},
- history: true, //uodo和redo
- highlighting: {
- nodeAvailable: {
- //连线过程中,节点可以被链接时被使用。
- name: "className",
- args: {
- className: "available",
- },
- },
- magnetAvailable: {
- //连线过程中,链接桩可以被链接时被使用。
- name: "className",
- args: {
- className: "available",
- },
- },
- magnetAdsorbed: {
- //连线过程中,自动吸附到链接桩时被使用。
- name: "className",
- args: {
- className: "adsorbed",
- },
- },
- },
- scroller: {
- enabled: true,
- pannable: true,
- },
- mousewheel: {
- enabled: true,
- modifiers: ["ctrl", "meta"],
- },
- clipboard: {
- enabled: true,
- useLocalStorage: true,
- },
- keyboard: {
- enabled: true,
- global: true,
- }, //快捷键
- selecting: {
- enabled: true,
- showNodeSelectionBox: true,
- // showEdgeSelectionBox: true,
- }, //选中 ,框选
- //节点与边交互
- translating: {
- restrict: true, //限制节点不能移动超出画布区域
- },
- connecting: {
- snap: true, //连线距离节点或者连接桩 50px 时会触发自动吸附
- allowBlank: false,
- allowLoop: false,
- highlight: true,
- sourceAnchor: {
- //指定源节点的锚点
- name: "bottom",
- },
- targetAnchor: {
- //指定目标节点的锚点
- name: "center",
- },
- connectionPoint: "anchor",
- // connector: "algo-edge",
- createEdge() {
- return graph.createEdge({
- //更新连接边edge样式
- router: {
- // name: "orth",
- name: "er",
- args: {
- offset: "center",
- },
- },
- attrs: {
- line: {
- // strokeDasharray: "5 5", //虚线
- stroke: "#808080",
- strokeWidth: 1,
- targetMarker: {
- name: "block",
- args: {
- size: "6",
- },
- },
- },
- },
- //在指定的位置处,渲染一个删除按钮,点击时删除对应的边。
- tools: {
- name: "button-remove",
- args: { distance: -40 },
- },
- });
- },
- validateMagnet({ magnet }) {
- return magnet.getAttribute("port-group") !== "in";
- },
- validateConnection({
- sourceView,
- targetView,
- sourceMagnet,
- targetMagnet,
- }) {
- // 只能从输出链接桩创建连接
- if (
- !sourceMagnet ||
- sourceMagnet.getAttribute("port-group") === "in"
- ) {
- return false;
- }
- // 只能连接到输入链接桩
- if (
- !targetMagnet ||
- targetMagnet.getAttribute("port-group") !== "in"
- ) {
- return false;
- }
- // 判断目标链接桩是否可连接
- const portId = targetMagnet.getAttribute("port");
- const node = targetView.cell;
- const port = node.getPort(portId);
- if (port && port.connected) {
- // if (port && port.connected) {
- return false;
- }
- return true;
- },
- },
- });
- // 创建 Graph 的实例
- // const graph = new Graph({
- // container: document.getElementById("container"),
- // width: 1380,
- // height: 750,
- // background: {
- // // color: "#f7f7f4", //设置画布背景颜色
- // color: "#ffffff",
- // },
- // grid: {
- // size: 8,
- // visible: true,
- // }, //网格
- // history: true, //uodo和redo
- // //滚动条
- // // scroller: {
- // // enabled: true,
- // // // pannable: true,
- // // // pageVisible: true,
- // // // pageBreak: false,
- // // },
- // mousewheel: {
- // enabled: true,
- // modifiers: ["ctrl", "meta"],
- // },
- // // clipboard: true, //剪切板
- // clipboard: {
- // enabled: true,
- // useLocalStorage: true,
- // },
- // keyboard: {
- // enabled: true,
- // global: true,
- // }, //快捷键
- // selecting: {
- // enabled: true,
- // showNodeSelectionBox: true,
- // // showEdgeSelectionBox: true,
- // }, //选中 ,框选
- // //节点与边交互
- // translating: {
- // restrict: true, //限制节点不能移动超出画布区域
- // },
- // //连线规则
- // connecting: {
- // snap: true,
- // allowBlank: false, //不允许连接到画布空白位置
- // allowMulti: false, //不允许在相同节点之间创建多条边
- // },
- // });
- this.graph = graph;
- this.history = graph.history; //Redo Undo
- },
- onCollapse(collapsed, type) {
- console.log(collapsed, type);
- },
- onBreakpoint(broken) {
- console.log(broken);
- },
- onUndo() {
- this.history.undo();
- console.log("undo");
- },
- onRedo() {
- this.history.redo();
- console.log("redo");
- },
- onCancel() {
- MessageBox.confirm(`确定进行[退出]操作?`, "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- console.log("任务取消")
- console.log(this.workflowName);
- //确定取消任务后的操作
- if(this.workflowstatustag.name == "Running" && this.workflowName!=""){
- this.$http({
- url: this.$http.adornUrl("/visi/visiworkflow/stopworkflow"),
- method: "post",
- data: this.$http.adornData({workflowName: this.workflowName}),
- }).then(({ data }) => {
- if (data && data.code === 0) {
- this.workflowStatus = data.statusPhase;
- if(this.workflowStatus == "Failed"){
- Message.success("任务已取消");
- }
- console.log("任务已取消")
- }
- });
- }
- })
- .catch(() => {});
- },
- onRun() {
- console.log("graph.toJSON()");
- console.log(this.graph.toJSON());
- // console.log(JSON.stringify(this.graph.toJSON()));
- MessageBox.confirm(`确定进行[提交]操作?`, "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- this.$http({
- url: this.$http.adornUrl("/visi/visiworkflow/submit"),
- method: "post",
- data: this.$http.adornData({
- graphJson: JSON.stringify(this.graph.toJSON()),
- workflowId: this.workflowId,
- experimentName: this.experimentName,
- addorupdate: this.addorupdate,
- }
- ),
- }).then(({ data }) => {
- if (data && data.code === 0) {
- this.workflowName = data.workflowName;
- this.idTemplateNameMap = data.idTemplateNameMap; //节点id与 DAG中task和Template 的对应关系
- this.workflowId = data.workflowId;//若为新增,返回新增的主键ID workflowId
- // 迭代属性名称:
- for (let nodeid of Object.keys(this.idTemplateNameMap)) {
- var tempname = this.idTemplateNameMap[nodeid];
- this.graph
- .getCellById(nodeid)
- .setData({ wftempname: tempname }); //temp后端已向末尾添加随机数
- }
- Message.success("提交成功");
- // this.$message({
- // message: "提交成功",
- // type: "success",
- // });
- this.workflowstatustag.name = "Running";
- this.workflowstatustag.type = "";
- //查询运行状态
- // this.getWorkflowStatus();
- var intervalID = window.setInterval(() => {
- this.getWorkflowStatus();
- // 取消该定时设置
- if (
- this.workflowStatus == "Succeeded" ||
- this.workflowStatus == "Error" ||
- this.workflowStatus == "Failed"
- ) {
- if (this.workflowStatus == "Succeeded") {
- this.workflowstatustag.name = "Succeeded";
- this.workflowstatustag.type = "success";
- } else if (
- this.workflowStatus == "Error" ||
- this.workflowStatus == "Failed"
- ) {
- this.workflowstatustag.name = "Failed";
- this.workflowstatustag.type = "danger";
- }
- window.clearInterval(intervalID);
- }
- }, 5000);
- } else {
- Message.error("提交失败");
- }
- });
- })
- .catch(() => {});
- // // 上方添加 按钮提示框
- // this.$http({
- // url: this.$http.adornUrl("/visi/visiworkflow/submit"),
- // method: "post",
- // data: this.$http.adornData(this.graph.toJSON()),
- // }).then(({ data }) => {
- // if (data && data.code === 0) {
- // this.workflowName = data.workflowName;
- // this.idTemplateNameMap = data.idTemplateNameMap; //节点id与 DAG中task和Template 的对应关系
- // // 迭代属性名称:
- // for (let nodeid of Object.keys(this.idTemplateNameMap)) {
- // var tempname = this.idTemplateNameMap[nodeid];
- // this.graph.getCellById(nodeid).setData({ wftempname: tempname }); //temp后端已向末尾添加随机数
- // }
- // Message.success("提交成功");
- // // this.$message({
- // // message: "提交成功",
- // // type: "success",
- // // });
- // this.workflowstatustag.name = "Running";
- // this.workflowstatustag.type = "";
- // //查询运行状态
- // // this.getWorkflowStatus();
- // var intervalID = window.setInterval(() => {
- // this.getWorkflowStatus();
- // // 取消该定时设置
- // if (
- // this.workflowStatus == "Succeeded" ||
- // this.workflowStatus == "Error" ||
- // this.workflowStatus == "Failed"
- // ) {
- // if (this.workflowStatus == "Succeeded") {
- // this.workflowstatustag.name = "Succeeded";
- // this.workflowstatustag.type = "success";
- // } else if (
- // this.workflowStatus == "Error" ||
- // this.workflowStatus == "Failed"
- // ) {
- // this.workflowstatustag.name = "Failed";
- // this.workflowstatustag.type = "danger";
- // }
- // window.clearInterval(intervalID);
- // }
- // }, 5000);
- // // // 取消该定时设置
- // // if (
- // // this.workflowStatus == "Succeeded" ||
- // // this.workflowStatus == "Error" ||
- // // this.workflowStatus == "Failed"
- // // ) {
- // // if (this.workflowStatus == "Succeeded") {
- // // this.workflowstatustag.name = "Succeeded";
- // // this.workflowstatustag.type = "success";
- // // } else if (
- // // this.workflowStatus == "Error" ||
- // // this.workflowStatus == "Failed"
- // // ) {
- // // this.workflowstatustag.name = "Failed";
- // // this.workflowstatustag.type = "danger";
- // // }
- // // window.clearInterval(intervalID);
- // // }
- // } else {
- // Message.error("提交失败");
- // // this.$message.error("提交失败");
- // // this.$message.error(data.msg);
- // }
- // });
- },
- //20211109 测试 能否保存至数据库
- onPrimary() {
- MessageBox.confirm(`确定进行[保存]操作?`, "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- this.$http({
- url: this.$http.adornUrl("/visi/visiworkflow/save"),
- method: "post",
- data: this.$http.adornData({
- userId: this.$store.state.user.id,
- workflowId: undefined,
- experimentName: this.experimentName,
- workflowtempName: "",
- workflowName: "",
- graphJson: JSON.stringify(this.graph.toJSON()),
- }),
- }).then(({ data }) => {
- if (data && data.code === 0) {
- Message.success("操作成功");
- // this.$message({
- // message: "操作成功",
- // type: "success",
- // duration: 1500,
- // onClose: () => {
- // this.getDataList();
- // },
- // });
- } else {
- // Message.error();
- // this.$message.error(data.msg);
- }
- });
- })
- .catch(() => {});
- console.log(JSON.stringify(this.graph.toJSON()).length);
- console.log(JSON.stringify(this.graph.toJSON()));
- // this.$http({
- // url: this.$http.adornUrl("/visi/visiworkflow/save"),
- // method: "post",
- // data: this.$http.adornData({
- // userId: this.$store.state.user.id,
- // workflowId: undefined,
- // experimentName: "实验1",
- // workflowtempName: "",
- // workflowName: "",
- // graphJson: JSON.stringify(this.graph.toJSON()),
- // }),
- // }).then(({ data }) => {
- // if (data && data.code === 0) {
- // Message.success("操作成功");
- // // this.$message({
- // // message: "操作成功",
- // // type: "success",
- // // duration: 1500,
- // // onClose: () => {
- // // this.getDataList();
- // // },
- // // });
- // } else {
- // // Message.error();
- // // this.$message.error(data.msg);
- // }
- // });
- },
- //查询状态
- getWorkflowStatus() {
- this.$http({
- url: this.$http.adornUrl("/visi/visiworkflow/getworkflowstatus"),
- method: "get",
- params: this.$http.adornParams({
- workflowName: this.workflowName,
- }),
- }).then(({ data }) => {
- this.workflowStatus = data.statusPhase;
- console.log(this.workflowStatus);
- if (this.workflowStatus == "Succeeded") {
- this.workflowstatustag.name = "Succeeded";
- this.workflowstatustag.type = "success";
- } else if (
- this.workflowStatus == "Error" ||
- this.workflowStatus == "Failed"
- ) {
- this.workflowstatustag.name = "Failed";
- this.workflowstatustag.type = "danger";
- } else {
- this.workflowstatustag.name = "Running";
- this.workflowstatustag.type = "";
- }
- //Pending, Running, Succeeded, Skipped, Failed, Error
- });
- },
- //20211111 添加设置每个算法节点 的输入输出设置模板
- //获取代码模板
- getParaTemp() {
- this.paraTempVisible = true;
- this.$nextTick(() => {
- // this.$refs.paraTemp.init(this.measurepoint.join());
- this.$refs.paraTemp.init();
- });
- },
- // 清空当前画布
- onCleargraph() {
- this.graph.clearCells();
- },
- //画布内容居中
- getgraphContentcenter() {
- this.graph.centerContent();
- },
- //获取工作流完整日志
- getworkflowContent() {
- // console.log("graph.toJSON()");
- // console.log(this.graph.toJSON());
- // console.log(JSON.stringify(this.graph.toJSON()));
- // this.$http({
- // url: this.$http.adornUrl("/visi/visiworkflow/getpodlog"),
- // method: "get",
- // data: this.$http.adornData(this.workflowName,this.idTemplateNameMap),
- // }).then(({ data }) => {
- // if (data && data.code === 0) {
- // this.workflowName = data.workflowName;
- // this.workflowContentlog = data.workflowContent;
- // this.podlogs = data.podlogs;
- // console.log("workflowname");
- // console.log(this.workflowName);
- // console.log("workflowcontent")
- // console.log(this.workflowContentlog);
- // console.log("podlogs")
- // console.log(this.podlogs);
- // this.$message({
- // message: "操作成功",
- // type: "success",
- // duration: 1500,
- // onClose: () => {
- // // this.getDataList(); //20211115 待更改 未应用,且不是该函数
- // },
- // });
- // } else {
- // this.$message.error(data.msg);
- // }
- // });
- //获取日志正确代码,现改为弹窗显示
- // if (this.workflowContentVisi) {
- // this.workflowContentVisi = false;
- // } else {
- // this.workflowContentVisi = true;
- // this.$http({
- // url: this.$http.adornUrl("/visi/visiworkflow/getworkflowlog"),
- // method: "get",
- // params: this.$http.adornParams({
- // workflowName: this.workflowName,
- // }),
- // })
- // .then(({ data }) => {
- // this.workflowContent = data.workflowContent;
- // // this.podlogs = data.podlogs;
- // console.log("workflowcontent");
- // console.log(this.workflowContent);
- // console.log(this.workflowContent.main);
- // console.log(this.workflowContent.init);
- // console.log(this.workflowContent.wait);
- // // console.log("podlogs")
- // // console.log(this.podlogs);
- // })
- // .then(() => {
- // // this.visible = true
- // // this.$nextTick(() => {
- // // this.$refs['dataForm'].resetFields()
- // // })
- // });
- // }
- this.workflowContentVisi = true;
- if (this.workflowName != "") {
- this.$nextTick(() => {
- this.$refs.getworkflowlog.init(this.workflowName);
- });
- } else {
- this.$nextTick(() => {
- this.$refs.getworkflowlog.init1();
- });
- }
- },
- //获取单个节点 日志
- getnodepodContent() {
- this.$http({
- url: this.$http.adornUrl("/visi/visiworkflow/getpodlog"),
- method: "get",
- params: this.$http.adornParams({
- workflowName: this.workflowName,
- idTemplateNameMap: this.idTemplateNameMap,
- nodeId: "",
- }),
- })
- .then(({ data }) => {
- // this.workflowContentlog = data.workflowContent;
- // this.podlogs = data.podlogs;
- // console.log("workflowcontent")
- // console.log(this.workflowContentlog);
- // console.log("podlogs")
- // console.log(this.podlogs);
- })
- .then(() => {
- // this.visible = true
- // this.$nextTick(() => {
- // this.$refs['dataForm'].resetFields()
- // })
- });
- },
- //单选控制 日志类型 main init wait
- workflowcontainerchange(e) {
- if (this.containertype == "main") {
- this.workflowContentlog = this.workflowContent.main;
- }
- if (this.containertype == "init") {
- this.workflowContentlog = this.workflowContent.init;
- }
- if (this.containertype == "wait") {
- this.workflowContentlog = this.workflowContent.wait;
- }
- },
- //获取代码示例---轮廓识别
- onGetcontour() {
- //20211129 暂时先注释,为轮廓识别案例
- this.graph.fromJSON([
- {
- position: { x: 60, y: 280 },
- size: { width: 90, height: 80 },
- attrs: {
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
- },
- label: { text: "contourTask1" },
- },
- shape: "template-node",
- data: {
- nodeName: "contourTask1",
- templateName: "contourTask1",
- templateImage: "zvinjodocker/contous_task1:20211014",
- templateCommand: {},
- templateArgs: {},
- algoparaInput: { userInput: [], getInput: [] },
- algoparaOutput: [],
- algoparaInputargu: { userInput: [], getInput: [] },
- algonodeSource: [],
- inputsparameters: [],
- inputsartifacts: [],
- argumentsparameters: [],
- argumentsartifacts: [],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "thresh",
- paradesc: "",
- paratype: "",
- valuefrom: "/myapps/thresh1.png",
- },
- {
- paraname: "contours",
- paradesc: "",
- paratype: "",
- valuefrom: "/myapps/contours.png",
- },
- ],
- sourcedatalist: [],
- sourceartilist: [],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- },
- ports: {
- groups: {
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: { visibility: true },
- },
- },
- },
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- },
- },
- },
- },
- items: [
- { id: "inport1", group: "in" },
- { id: "inport2", group: "in" },
- { id: "outport1", group: "out" },
- { id: "outport2", group: "out" },
- ],
- },
- id: "fadef8ac-8dcd-4d8e-8968-d156ffd941c5",
- zIndex: 1,
- },
- {
- position: { x: 370, y: 140 },
- size: { width: 90, height: 80 },
- attrs: {
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
- },
- label: { text: "contourTask2" },
- },
- shape: "template-node",
- data: {
- nodeName: "contourTask2",
- templateName: "contourTask2",
- templateImage: "zvinjodocker/contours_task2:20211014",
- templateCommand: {},
- templateArgs: {},
- algoparaInput: { userInput: [], getInput: [] },
- algoparaOutput: [],
- algoparaInputargu: { userInput: [], getInput: [] },
- algonodeSource: [
- {
- position: { x: 60, y: 280 },
- size: { width: 90, height: 80 },
- attrs: {
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
- },
- label: { text: "contourTask1" },
- },
- shape: "template-node",
- data: {
- nodeName: "contourTask1",
- templateName: "contourTask1",
- templateImage: "zvinjodocker/contous_task1:20211014",
- templateCommand: {},
- templateArgs: {},
- algoparaInput: { userInput: [], getInput: [] },
- algoparaOutput: [],
- algoparaInputargu: { userInput: [], getInput: [] },
- algonodeSource: [],
- inputsparameters: [],
- inputsartifacts: [],
- argumentsparameters: [],
- argumentsartifacts: [],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "thresh",
- paradesc: "",
- paratype: "",
- valuefrom: "/myapps/thresh1.png",
- },
- {
- paraname: "contours",
- paradesc: "",
- paratype: "",
- valuefrom: "/myapps/contours.png",
- },
- ],
- sourcedatalist: [],
- sourceartilist: [],
- },
- ports: {
- groups: {
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: { visibility: true },
- },
- },
- },
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- },
- },
- },
- },
- items: [
- { id: "inport1", group: "in" },
- { id: "inport2", group: "in" },
- { id: "outport1", group: "out" },
- { id: "outport2", group: "out" },
- ],
- },
- id: "fadef8ac-8dcd-4d8e-8968-d156ffd941c5",
- zIndex: 1,
- },
- ],
- inputsparameters: [],
- inputsartifacts: [
- {
- paraname: "thresh",
- parapath: "/myapps/thresh1.png",
- paradesc: "",
- },
- {
- paraname: "contours",
- parapath: "/myapps/contours.png",
- paradesc: "",
- },
- ],
- argumentsparameters: [],
- argumentsartifacts: [
- {
- paraname: "thresh",
- valuefrom: "{{tasks.contourTask1.outputs.artifacts.thresh}}",
- fileurls: [],
- filelist: [],
- value: ["contourTask1", "thresh"],
- },
- {
- paraname: "contours",
- valuefrom: "{{tasks.contourTask1.outputs.artifacts.contours}}",
- fileurls: [],
- filelist: [],
- value: ["contourTask1", "contours"],
- },
- ],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "contours0",
- valuefrom: "/myapps/contours[0].npy",
- paradesc: "",
- paratype: "",
- },
- {
- paraname: "res",
- valuefrom: "/myapps/res1.png",
- paradesc: "",
- paratype: "",
- },
- ],
- sourcedatalist: [],
- sourceartilist: [],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- },
- ports: {
- groups: {
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: { visibility: true },
- },
- },
- },
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- },
- },
- },
- },
- items: [
- { id: "inport1", group: "in" },
- { id: "inport2", group: "in" },
- { id: "outport1", group: "out" },
- { id: "outport2", group: "out" },
- ],
- },
- id: "7d572837-a22b-4dab-a196-8ea411ba868e",
- zIndex: 2,
- },
- {
- shape: "edge",
- attrs: {
- line: {
- stroke: "#808080",
- strokeWidth: 1,
- targetMarker: { name: "block", args: { size: "6" } },
- },
- },
- id: "3b752ac7-2c5f-4596-adf3-ad10dd3718b0",
- router: { name: "er", args: { offset: "center" } },
- tools: {
- items: [{ name: "button-remove", args: { distance: -40 } }],
- },
- source: {
- cell: "fadef8ac-8dcd-4d8e-8968-d156ffd941c5",
- port: "outport1",
- },
- target: {
- cell: "7d572837-a22b-4dab-a196-8ea411ba868e",
- port: "inport1",
- },
- zIndex: 3,
- },
- {
- position: { x: 650, y: 140 },
- size: { width: 90, height: 80 },
- attrs: {
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
- },
- label: { text: "contourTask3" },
- },
- shape: "template-node",
- data: {
- nodeName: "contourTask3",
- templateName: "contourTask3",
- templateImage: "zvinjodocker/contours_task3:20211015",
- templateCommand: {},
- templateArgs: {},
- algoparaInput: { userInput: [], getInput: [] },
- algoparaOutput: [],
- algoparaInputargu: { userInput: [], getInput: [] },
- algonodeSource: [
- {
- position: { x: 370, y: 140 },
- size: { width: 90, height: 80 },
- attrs: {
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
- },
- label: { text: "contourTask2" },
- },
- shape: "template-node",
- data: {
- nodeName: "contourTask2",
- templateName: "contourTask2",
- templateImage: "zvinjodocker/contours_task2:20211014",
- templateCommand: {},
- templateArgs: {},
- algoparaInput: { userInput: [], getInput: [] },
- algoparaOutput: [],
- algoparaInputargu: { userInput: [], getInput: [] },
- algonodeSource: [
- {
- position: { x: 60, y: 280 },
- size: { width: 90, height: 80 },
- attrs: {
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
- },
- label: { text: "contourTask1" },
- },
- shape: "template-node",
- data: {
- nodeName: "contourTask1",
- templateName: "contourTask1",
- templateImage: "zvinjodocker/contous_task1:20211014",
- templateCommand: {},
- templateArgs: {},
- algoparaInput: { userInput: [], getInput: [] },
- algoparaOutput: [],
- algoparaInputargu: { userInput: [], getInput: [] },
- algonodeSource: [],
- inputsparameters: [],
- inputsartifacts: [],
- argumentsparameters: [],
- argumentsartifacts: [],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "thresh",
- paradesc: "",
- paratype: "",
- valuefrom: "/myapps/thresh1.png",
- },
- {
- paraname: "contours",
- paradesc: "",
- paratype: "",
- valuefrom: "/myapps/contours.png",
- },
- ],
- sourcedatalist: [],
- sourceartilist: [],
- },
- ports: {
- groups: {
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: { visibility: true },
- },
- },
- },
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- },
- },
- },
- },
- items: [
- { id: "inport1", group: "in" },
- { id: "inport2", group: "in" },
- { id: "outport1", group: "out" },
- { id: "outport2", group: "out" },
- ],
- },
- id: "fadef8ac-8dcd-4d8e-8968-d156ffd941c5",
- zIndex: 1,
- },
- ],
- inputsparameters: [],
- inputsartifacts: [
- {
- paraname: "thresh",
- parapath: "/myapps/thresh1.png",
- paradesc: "",
- },
- {
- paraname: "contours",
- parapath: "/myapps/contours.png",
- paradesc: "",
- },
- ],
- argumentsparameters: [],
- argumentsartifacts: [
- {
- paraname: "thresh",
- valuefrom:
- "{{tasks.contourTask1.outputs.artifacts.thresh}}",
- fileurls: [],
- filelist: [],
- value: ["contourTask1", "thresh"],
- },
- {
- paraname: "contours",
- valuefrom:
- "{{tasks.contourTask1.outputs.artifacts.contours}}",
- fileurls: [],
- filelist: [],
- value: ["contourTask1", "contours"],
- },
- ],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "contours0",
- valuefrom: "/myapps/contours[0].npy",
- paradesc: "",
- paratype: "",
- },
- {
- paraname: "res",
- valuefrom: "/myapps/res1.png",
- paradesc: "",
- paratype: "",
- },
- ],
- sourcedatalist: [],
- sourceartilist: [],
- },
- ports: {
- groups: {
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: { visibility: true },
- },
- },
- },
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- },
- },
- },
- },
- items: [
- { id: "inport1", group: "in" },
- { id: "inport2", group: "in" },
- { id: "outport1", group: "out" },
- { id: "outport2", group: "out" },
- ],
- },
- id: "7d572837-a22b-4dab-a196-8ea411ba868e",
- zIndex: 2,
- },
- ],
- inputsparameters: [],
- inputsartifacts: [
- {
- paraname: "contours0",
- parapath: "/myapps/contours[0].npy",
- paradesc: "",
- },
- ],
- argumentsparameters: [],
- argumentsartifacts: [
- {
- paraname: "contours0",
- valuefrom: "{{tasks.contourTask2.outputs.artifacts.contours0}}",
- fileurls: [],
- filelist: [],
- value: ["contourTask2", "contours0"],
- },
- ],
- outputsparameters: [],
- outputsartifacts: [],
- sourcedatalist: [],
- sourceartilist: [],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- },
- ports: {
- groups: {
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: { visibility: true },
- },
- },
- },
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- },
- },
- },
- },
- items: [
- { id: "inport1", group: "in" },
- { id: "inport2", group: "in" },
- { id: "outport1", group: "out" },
- { id: "outport2", group: "out" },
- ],
- },
- id: "a40a3ff3-da4c-463c-ab58-bd9735fb57fe",
- zIndex: 4,
- },
- {
- shape: "edge",
- attrs: {
- line: {
- stroke: "#808080",
- strokeWidth: 1,
- targetMarker: { name: "block", args: { size: "6" } },
- },
- },
- id: "e30fefd7-b50a-4152-96a5-a6403f990cf7",
- router: { name: "er", args: { offset: "center" } },
- tools: {
- items: [{ name: "button-remove", args: { distance: -40 } }],
- },
- source: {
- cell: "7d572837-a22b-4dab-a196-8ea411ba868e",
- port: "outport1",
- },
- target: {
- cell: "a40a3ff3-da4c-463c-ab58-bd9735fb57fe",
- port: "inport1",
- },
- zIndex: 5,
- },
- {
- position: { x: 360, y: 390 },
- size: { width: 90, height: 80 },
- attrs: {
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/c36fe7cb-dc24-4854-aeb5-88d8dc36d52e.svg",
- },
- label: { text: "contourApproximate1" },
- },
- shape: "template-node",
- data: {
- nodeName: "contourApproximate1",
- templateName: "contourApproximate1",
- templateImage: "zvinjodocker/contour_approximate1:20211015",
- templateCommand: {},
- templateArgs: {},
- algoparaInput: { userInput: [], getInput: [] },
- algoparaOutput: [],
- algoparaInputargu: { userInput: [], getInput: [] },
- algonodeSource: [
- {
- position: { x: 60, y: 280 },
- size: { width: 90, height: 80 },
- attrs: {
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
- },
- label: { text: "contourTask1" },
- },
- shape: "template-node",
- data: {
- nodeName: "contourTask1",
- templateName: "contourTask1",
- templateImage: "zvinjodocker/contous_task1:20211014",
- templateCommand: {},
- templateArgs: {},
- algoparaInput: { userInput: [], getInput: [] },
- algoparaOutput: [],
- algoparaInputargu: { userInput: [], getInput: [] },
- algonodeSource: [],
- inputsparameters: [],
- inputsartifacts: [],
- argumentsparameters: [],
- argumentsartifacts: [],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "thresh",
- paradesc: "",
- paratype: "",
- valuefrom: "/myapps/thresh1.png",
- },
- {
- paraname: "contours",
- paradesc: "",
- paratype: "",
- valuefrom: "/myapps/contours.png",
- },
- ],
- sourcedatalist: [],
- sourceartilist: [],
- },
- ports: {
- groups: {
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: { visibility: true },
- },
- },
- },
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- },
- },
- },
- },
- items: [
- { id: "inport1", group: "in" },
- { id: "inport2", group: "in" },
- { id: "outport1", group: "out" },
- { id: "outport2", group: "out" },
- ],
- },
- id: "fadef8ac-8dcd-4d8e-8968-d156ffd941c5",
- zIndex: 1,
- },
- ],
- inputsparameters: [],
- inputsartifacts: [],
- argumentsparameters: [],
- argumentsartifacts: [],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "approxCnt",
- valuefrom: "/myapps/approx_cnt.npy",
- paradesc: "",
- paratype: "",
- },
- {
- paraname: "approxRes",
- valuefrom: "/myapps/approx_res.png",
- paradesc: "",
- paratype: "",
- },
- ],
- sourcedatalist: [],
- sourceartilist: [],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- },
- ports: {
- groups: {
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: { visibility: true },
- },
- },
- },
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- },
- },
- },
- },
- items: [
- { id: "inport1", group: "in" },
- { id: "inport2", group: "in" },
- { id: "outport1", group: "out" },
- { id: "outport2", group: "out" },
- ],
- },
- id: "2d3ccc77-be7c-4fa0-ae37-a9af4fdf6730",
- zIndex: 6,
- },
- {
- position: { x: 660, y: 390 },
- size: { width: 90, height: 80 },
- attrs: {
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/c55d7ae1-8d20-4585-bd8f-ca23653a4489.svg",
- },
- label: { text: "contourApproximate2" },
- },
- shape: "template-node",
- data: {
- nodeName: "contourApproximate2",
- templateName: "contourApproximate2",
- templateImage: "zvinjodocker/contour_approximate2:20211015",
- templateCommand: {},
- templateArgs: {},
- algoparaInput: { userInput: [], getInput: [] },
- algoparaOutput: [],
- algoparaInputargu: { userInput: [], getInput: [] },
- algonodeSource: [
- {
- position: { x: 360, y: 390 },
- size: { width: 90, height: 80 },
- attrs: {
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/c36fe7cb-dc24-4854-aeb5-88d8dc36d52e.svg",
- },
- label: { text: "contourApproximate1" },
- },
- shape: "template-node",
- data: {
- nodeName: "contourApproximate1",
- templateName: "contourApproximate1",
- templateImage: "zvinjodocker/contour_approximate1:20211015",
- templateCommand: {},
- templateArgs: {},
- algoparaInput: { userInput: [], getInput: [] },
- algoparaOutput: [],
- algoparaInputargu: { userInput: [], getInput: [] },
- algonodeSource: [
- {
- position: { x: 60, y: 280 },
- size: { width: 90, height: 80 },
- attrs: {
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
- },
- label: { text: "contourTask1" },
- },
- shape: "template-node",
- data: {
- nodeName: "contourTask1",
- templateName: "contourTask1",
- templateImage: "zvinjodocker/contous_task1:20211014",
- templateCommand: {},
- templateArgs: {},
- algoparaInput: { userInput: [], getInput: [] },
- algoparaOutput: [],
- algoparaInputargu: { userInput: [], getInput: [] },
- algonodeSource: [],
- inputsparameters: [],
- inputsartifacts: [],
- argumentsparameters: [],
- argumentsartifacts: [],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "thresh",
- paradesc: "",
- paratype: "",
- valuefrom: "/myapps/thresh1.png",
- },
- {
- paraname: "contours",
- paradesc: "",
- paratype: "",
- valuefrom: "/myapps/contours.png",
- },
- ],
- sourcedatalist: [],
- sourceartilist: [],
- },
- ports: {
- groups: {
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: { visibility: true },
- },
- },
- },
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- },
- },
- },
- },
- items: [
- { id: "inport1", group: "in" },
- { id: "inport2", group: "in" },
- { id: "outport1", group: "out" },
- { id: "outport2", group: "out" },
- ],
- },
- id: "fadef8ac-8dcd-4d8e-8968-d156ffd941c5",
- zIndex: 1,
- },
- ],
- inputsparameters: [],
- inputsartifacts: [],
- argumentsparameters: [],
- argumentsartifacts: [],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "approxCnt",
- valuefrom: "/myapps/approx_cnt.npy",
- paradesc: "",
- paratype: "",
- },
- {
- paraname: "approxRes",
- valuefrom: "/myapps/approx_res.png",
- paradesc: "",
- paratype: "",
- },
- ],
- sourcedatalist: [],
- sourceartilist: [],
- },
- ports: {
- groups: {
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: { visibility: true },
- },
- },
- },
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- },
- },
- },
- },
- items: [
- { id: "inport1", group: "in" },
- { id: "inport2", group: "in" },
- { id: "outport1", group: "out" },
- { id: "outport2", group: "out" },
- ],
- },
- id: "2d3ccc77-be7c-4fa0-ae37-a9af4fdf6730",
- zIndex: 6,
- },
- ],
- inputsparameters: [],
- inputsartifacts: [
- {
- paraname: "approxCnt",
- parapath: "/myapps/approx_cnt.npy",
- paradesc: "",
- },
- ],
- argumentsparameters: [],
- argumentsartifacts: [
- {
- paraname: "approxCnt",
- valuefrom:
- "{{tasks.contourApproximate1.outputs.artifacts.approxCnt}}",
- fileurls: [],
- filelist: [],
- value: ["contourApproximate1", "approxCnt"],
- },
- ],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "approxRes2",
- valuefrom: "/myapps/approx_res2.png",
- paradesc: "",
- paratype: "",
- },
- ],
- sourcedatalist: [],
- sourceartilist: [],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- },
- ports: {
- groups: {
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: { visibility: true },
- },
- },
- },
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- },
- },
- },
- },
- items: [
- { id: "inport1", group: "in" },
- { id: "inport2", group: "in" },
- { id: "outport1", group: "out" },
- { id: "outport2", group: "out" },
- ],
- },
- id: "1e868699-e31f-4daf-a07b-7e903c861fba",
- zIndex: 7,
- },
- {
- shape: "edge",
- attrs: {
- line: {
- stroke: "#808080",
- strokeWidth: 1,
- targetMarker: { name: "block", args: { size: "6" } },
- },
- },
- id: "77d0d40f-d287-4223-abfc-0fd17651bb69",
- router: { name: "er", args: { offset: "center" } },
- tools: {
- items: [{ name: "button-remove", args: { distance: -40 } }],
- },
- source: {
- cell: "2d3ccc77-be7c-4fa0-ae37-a9af4fdf6730",
- port: "outport1",
- },
- target: {
- cell: "1e868699-e31f-4daf-a07b-7e903c861fba",
- port: "inport1",
- },
- zIndex: 8,
- },
- {
- shape: "edge",
- attrs: {
- line: {
- stroke: "#808080",
- strokeWidth: 1,
- targetMarker: { name: "block", args: { size: "6" } },
- },
- },
- id: "f46b0a77-d34c-4ec8-8bfd-7b48e412669e",
- router: { name: "er", args: { offset: "center" } },
- tools: {
- items: [{ name: "button-remove", args: { distance: -40 } }],
- },
- source: {
- cell: "fadef8ac-8dcd-4d8e-8968-d156ffd941c5",
- port: "outport2",
- },
- target: {
- cell: "2d3ccc77-be7c-4fa0-ae37-a9af4fdf6730",
- port: "inport1",
- },
- zIndex: 9,
- },
- {
- position: { x: 660, y: 600 },
- size: { width: 90, height: 80 },
- attrs: {
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/dc1ced06-417d-466f-927b-b4a4d3265791.svg",
- },
- label: { text: "contourRect1" },
- },
- shape: "template-node",
- data: {
- nodeName: "contourRect1",
- templateName: "contourRect1",
- templateImage: "zvinjodocker/contours_rect1:20211015",
- templateCommand: {},
- templateArgs: {},
- algoparaInput: { userInput: [], getInput: [] },
- algoparaOutput: [],
- algoparaInputargu: { userInput: [], getInput: [] },
- algonodeSource: [
- {
- position: { x: 360, y: 390 },
- size: { width: 90, height: 80 },
- attrs: {
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/c36fe7cb-dc24-4854-aeb5-88d8dc36d52e.svg",
- },
- label: { text: "contourApproximate1" },
- },
- shape: "template-node",
- data: {
- nodeName: "contourApproximate1",
- templateName: "contourApproximate1",
- templateImage: "zvinjodocker/contour_approximate1:20211015",
- templateCommand: {},
- templateArgs: {},
- algoparaInput: { userInput: [], getInput: [] },
- algoparaOutput: [],
- algoparaInputargu: { userInput: [], getInput: [] },
- algonodeSource: [
- {
- position: { x: 60, y: 280 },
- size: { width: 90, height: 80 },
- attrs: {
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
- },
- label: { text: "contourTask1" },
- },
- shape: "template-node",
- data: {
- nodeName: "contourTask1",
- templateName: "contourTask1",
- templateImage: "zvinjodocker/contous_task1:20211014",
- templateCommand: {},
- templateArgs: {},
- algoparaInput: { userInput: [], getInput: [] },
- algoparaOutput: [],
- algoparaInputargu: { userInput: [], getInput: [] },
- algonodeSource: [],
- inputsparameters: [],
- inputsartifacts: [],
- argumentsparameters: [],
- argumentsartifacts: [],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "thresh",
- paradesc: "",
- paratype: "",
- valuefrom: "/myapps/thresh1.png",
- },
- {
- paraname: "contours",
- paradesc: "",
- paratype: "",
- valuefrom: "/myapps/contours.png",
- },
- ],
- sourcedatalist: [],
- sourceartilist: [],
- },
- ports: {
- groups: {
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: { visibility: true },
- },
- },
- },
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- },
- },
- },
- },
- items: [
- { id: "inport1", group: "in" },
- { id: "inport2", group: "in" },
- { id: "outport1", group: "out" },
- { id: "outport2", group: "out" },
- ],
- },
- id: "fadef8ac-8dcd-4d8e-8968-d156ffd941c5",
- zIndex: 1,
- },
- ],
- inputsparameters: [],
- inputsartifacts: [],
- argumentsparameters: [],
- argumentsartifacts: [],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "approxCnt",
- valuefrom: "/myapps/approx_cnt.npy",
- paradesc: "",
- paratype: "",
- },
- {
- paraname: "approxRes",
- valuefrom: "/myapps/approx_res.png",
- paradesc: "",
- paratype: "",
- },
- ],
- sourcedatalist: [],
- sourceartilist: [],
- },
- ports: {
- groups: {
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: { visibility: true },
- },
- },
- },
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- },
- },
- },
- },
- items: [
- { id: "inport1", group: "in" },
- { id: "inport2", group: "in" },
- { id: "outport1", group: "out" },
- { id: "outport2", group: "out" },
- ],
- },
- id: "2d3ccc77-be7c-4fa0-ae37-a9af4fdf6730",
- zIndex: 6,
- },
- ],
- inputsparameters: [],
- inputsartifacts: [],
- argumentsparameters: [],
- argumentsartifacts: [],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "cnt",
- valuefrom: "/myapps/contour_rect_cnt.npy",
- paradesc: "",
- paratype: "",
- },
- {
- paraname: "contourRect",
- valuefrom: "/myapps/contour_rect.png",
- paradesc: "",
- paratype: "",
- },
- ],
- sourcedatalist: [],
- sourceartilist: [],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- },
- ports: {
- groups: {
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: { visibility: true },
- },
- },
- },
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- },
- },
- },
- },
- items: [
- { id: "inport1", group: "in" },
- { id: "inport2", group: "in" },
- { id: "outport1", group: "out" },
- { id: "outport2", group: "out" },
- ],
- },
- id: "6d787d4a-a68d-4a8c-a3b9-559eb5d4e231",
- zIndex: 10,
- },
- {
- position: { x: 910, y: 600 },
- size: { width: 90, height: 80 },
- attrs: {
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/687b6cb9-4b97-42a6-96d0-34b3099133ac.svg",
- },
- label: { text: "contourCircle2" },
- },
- shape: "template-node",
- data: {
- nodeName: "contourCircle2",
- templateName: "contourCircle2",
- templateImage: "zvinjodocker/contours_circle2:20211015",
- templateCommand: {},
- templateArgs: {},
- algoparaInput: { userInput: [], getInput: [] },
- algoparaOutput: [],
- algoparaInputargu: { userInput: [], getInput: [] },
- algonodeSource: [
- {
- position: { x: 660, y: 600 },
- size: { width: 90, height: 80 },
- attrs: {
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/dc1ced06-417d-466f-927b-b4a4d3265791.svg",
- },
- label: { text: "contourRect1" },
- },
- shape: "template-node",
- data: {
- nodeName: "contourRect1",
- templateName: "contourRect1",
- templateImage: "zvinjodocker/contours_rect1:20211015",
- templateCommand: {},
- templateArgs: {},
- algoparaInput: { userInput: [], getInput: [] },
- algoparaOutput: [],
- algoparaInputargu: { userInput: [], getInput: [] },
- algonodeSource: [
- {
- position: { x: 360, y: 390 },
- size: { width: 90, height: 80 },
- attrs: {
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/c36fe7cb-dc24-4854-aeb5-88d8dc36d52e.svg",
- },
- label: { text: "contourApproximate1" },
- },
- shape: "template-node",
- data: {
- nodeName: "contourApproximate1",
- templateName: "contourApproximate1",
- templateImage:
- "zvinjodocker/contour_approximate1:20211015",
- templateCommand: {},
- templateArgs: {},
- algoparaInput: { userInput: [], getInput: [] },
- algoparaOutput: [],
- algoparaInputargu: { userInput: [], getInput: [] },
- algonodeSource: [
- {
- position: { x: 60, y: 280 },
- size: { width: 90, height: 80 },
- attrs: {
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
- },
- label: { text: "contourTask1" },
- },
- shape: "template-node",
- data: {
- nodeName: "contourTask1",
- templateName: "contourTask1",
- templateImage:
- "zvinjodocker/contous_task1:20211014",
- templateCommand: {},
- templateArgs: {},
- algoparaInput: { userInput: [], getInput: [] },
- algoparaOutput: [],
- algoparaInputargu: {
- userInput: [],
- getInput: [],
- },
- algonodeSource: [],
- inputsparameters: [],
- inputsartifacts: [],
- argumentsparameters: [],
- argumentsartifacts: [],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "thresh",
- paradesc: "",
- paratype: "",
- valuefrom: "/myapps/thresh1.png",
- },
- {
- paraname: "contours",
- paradesc: "",
- paratype: "",
- valuefrom: "/myapps/contours.png",
- },
- ],
- sourcedatalist: [],
- sourceartilist: [],
- },
- ports: {
- groups: {
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: { visibility: true },
- },
- },
- },
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- },
- },
- },
- },
- items: [
- { id: "inport1", group: "in" },
- { id: "inport2", group: "in" },
- { id: "outport1", group: "out" },
- { id: "outport2", group: "out" },
- ],
- },
- id: "fadef8ac-8dcd-4d8e-8968-d156ffd941c5",
- zIndex: 1,
- },
- ],
- inputsparameters: [],
- inputsartifacts: [],
- argumentsparameters: [],
- argumentsartifacts: [],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "approxCnt",
- valuefrom: "/myapps/approx_cnt.npy",
- paradesc: "",
- paratype: "",
- },
- {
- paraname: "approxRes",
- valuefrom: "/myapps/approx_res.png",
- paradesc: "",
- paratype: "",
- },
- ],
- sourcedatalist: [],
- sourceartilist: [],
- },
- ports: {
- groups: {
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: { visibility: true },
- },
- },
- },
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- },
- },
- },
- },
- items: [
- { id: "inport1", group: "in" },
- { id: "inport2", group: "in" },
- { id: "outport1", group: "out" },
- { id: "outport2", group: "out" },
- ],
- },
- id: "2d3ccc77-be7c-4fa0-ae37-a9af4fdf6730",
- zIndex: 6,
- },
- ],
- inputsparameters: [],
- inputsartifacts: [],
- argumentsparameters: [],
- argumentsartifacts: [],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "cnt",
- valuefrom: "/myapps/contour_rect_cnt.npy",
- paradesc: "",
- paratype: "",
- },
- {
- paraname: "contourRect",
- valuefrom: "/myapps/contour_rect.png",
- paradesc: "",
- paratype: "",
- },
- ],
- sourcedatalist: [],
- sourceartilist: [],
- },
- ports: {
- groups: {
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: { visibility: true },
- },
- },
- },
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- },
- },
- },
- },
- items: [
- { id: "inport1", group: "in" },
- { id: "inport2", group: "in" },
- { id: "outport1", group: "out" },
- { id: "outport2", group: "out" },
- ],
- },
- id: "6d787d4a-a68d-4a8c-a3b9-559eb5d4e231",
- zIndex: 10,
- },
- ],
- inputsparameters: [],
- inputsartifacts: [
- {
- paraname: "contourRect",
- parapath: "/myapps/contour_rect.png",
- paradesc: "",
- },
- {
- paraname: "cnt",
- parapath: "/myapps/contour_rect_cnt.npy",
- paradesc: "",
- },
- ],
- argumentsparameters: [],
- argumentsartifacts: [
- {
- paraname: "contourRect",
- valuefrom:
- "{{tasks.contourRect1.outputs.artifacts.contourRect}}",
- fileurls: [],
- filelist: [],
- value: ["contourRect1", "contourRect"],
- },
- {
- paraname: "cnt",
- valuefrom: "{{tasks.contourRect1.outputs.artifacts.cnt}}",
- fileurls: [],
- filelist: [],
- value: ["contourRect1", "cnt"],
- },
- ],
- outputsparameters: [],
- outputsartifacts: [
- {
- paraname: "contourCircle",
- valuefrom: "contour_circle.png",
- paradesc: "",
- paratype: "",
- },
- ],
- sourcedatalist: [],
- sourceartilist: [],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- },
- ports: {
- groups: {
- in: {
- position: "left",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- style: { visibility: true },
- },
- },
- },
- out: {
- position: "right",
- attrs: {
- circle: {
- r: 2.5,
- magnet: true,
- stroke: "black",
- strokeWidth: 1,
- fill: "#fff",
- },
- },
- },
- },
- items: [
- { id: "inport1", group: "in" },
- { id: "inport2", group: "in" },
- { id: "outport1", group: "out" },
- { id: "outport2", group: "out" },
- ],
- },
- id: "283ddff1-40c9-43aa-b581-b99706e65fb3",
- zIndex: 11,
- },
- {
- shape: "edge",
- attrs: {
- line: {
- stroke: "#808080",
- strokeWidth: 1,
- targetMarker: { name: "block", args: { size: "6" } },
- },
- },
- id: "5f83bef7-8f4c-4b6a-ac51-b076c1e03042",
- router: { name: "er", args: { offset: "center" } },
- tools: {
- items: [{ name: "button-remove", args: { distance: -40 } }],
- },
- source: {
- cell: "2d3ccc77-be7c-4fa0-ae37-a9af4fdf6730",
- port: "outport2",
- },
- target: {
- cell: "6d787d4a-a68d-4a8c-a3b9-559eb5d4e231",
- port: "inport1",
- },
- zIndex: 12,
- },
- {
- shape: "edge",
- attrs: {
- line: {
- stroke: "#808080",
- strokeWidth: 1,
- targetMarker: { name: "block", args: { size: "6" } },
- },
- },
- id: "9017467c-167e-4f01-97dd-37d2d42bd0ed",
- router: { name: "er", args: { offset: "center" } },
- tools: {
- items: [{ name: "button-remove", args: { distance: -40 } }],
- },
- source: {
- cell: "6d787d4a-a68d-4a8c-a3b9-559eb5d4e231",
- port: "outport1",
- },
- target: {
- cell: "283ddff1-40c9-43aa-b581-b99706e65fb3",
- port: "inport1",
- },
- zIndex: 13,
- },
- ]);
- console.log("fromJson");
- },
- //20211110
- // 获取数据列表------------------20211115 可能后续需要将 其改为workflowdatalist
- getDataList() {
- this.dataListLoading = true;
- this.$http({
- url: this.$http.adornUrl("/sys/visiworkflow/list"),
- method: "get",
- params: this.$http.adornParams({
- page: 1,
- limit: 100,
- key: "",
- // page: this.pageIndex,
- // limit: this.pageSize,
- // key: this.dataForm.key,
- }),
- }).then(({ data }) => {
- if (data && data.code === 0) {
- this.workflowdataList = data.page.list;
- this.workflowtotalPage = data.page.totalCount;
- } else {
- this.workflowdataList = [];
- this.workflowtotalPage = 0;
- }
- this.dataListLoading = false;
- });
- },
- // 每页数 ---避免与其他函数冲突,可能需要改参数 1115
- sizeChangeHandle(val) {
- this.pageSize = val;
- this.pageIndex = 1;
- this.getDataList();
- },
- // 当前页
- currentChangeHandle(val) {
- this.pageIndex = val;
- this.getDataList();
- },
- // 多选
- selectionChangeHandle(val) {
- this.dataListSelections = val;
- },
- //20210805 zhang 右侧参数设置栏 design-panel
- handleFormLayoutChange(e) {
- this.formLayout = e.target.value;
- },
- callback(key) {
- console.log(key);
- },
- //20211115 获取左侧树形组件栏 算法模块节点列表
- // 获取数据列表
- getalgorithmDataList() {
- this.dataListLoading = true;
- this.$http({
- url: this.$http.adornUrl("/sys/visialgorithmnode/list"),
- method: "get",
- params: this.$http.adornParams({
- page: 1,
- limit: 100,
- // key: "",
- }),
- }).then(({ data }) => {
- if (data && data.code === 0) {
- this.algorithmdataList = data.page.list;
- this.algorithmtotalPage = data.page.totalCount;
- //20211115 已成功
- console.log("20211115 左侧节点栏数据");
- console.log(this.algorithmdataList);
- this.createAlgorithmNode();
- } else {
- this.algorithmdataList = [];
- this.totalPage = 0;
- console.log("20211115 左侧节点栏数据 为空");
- console.log(this.algorithmdataList);
- }
- this.dataListLoading = false;
- });
- },
- //添加函数 ----根据数据库中的数据来创建画布中的节点, ----树形组件中的数据包括键
- // 左侧树形组件栏读取数据库表visi_algorithmnode中数据,添加至树形组件treedata中,并创建对应画布节点后添加至nodedata中,可通过点击树形组件栏在画布中创建对应节点的克隆。------已成功
- createAlgorithmNode() {
- this.treeData = [
- {
- title: "操作节点",
- key: "0-0",
- slots: {
- icon: "smile",
- },
- children: [
- // {
- // title: "consume_artifact",
- // key: "consume_artifact",
- // slots: { icon: "meh" },
- // },
- // {
- // title: "generate_artifact",
- // key: "generate_artifact",
- // scopedSlots: { icon: "custom" },
- // },
- // {
- // title: "zdockertest",
- // key: "zdockertest",
- // scopedSlots: { icon: "custom" },
- // },
- {
- title: "条件节点",
- key: "条件节点",
- scopedSlots: { icon: "custom" },
- },
- {
- title: "输入节点",
- key: "dataInputnode",
- scopedSlots: { icon: "custom" },
- },
- {
- title: "输出节点",
- key: "dataOutputnode",
- scopedSlots: { icon: "custom" },
- },
- {
- title: "CSV文件转换节点",
- key: "CSVConversionnode",
- scopedSlots: { icon: "custom" },
- },
- ],
- },
- {
- title: "轮廓识别",
- key: "0-1",
- slots: {
- icon: "smile",
- },
- children: [
- {
- title: "contourTask1",
- key: "contourTask1",
- scopedSlots: { icon: "custom" },
- },
- {
- title: "contourTask2",
- key: "contourTask2",
- scopedSlots: { icon: "custom" },
- },
- {
- title: "contourTask3",
- key: "contourTask3",
- scopedSlots: { icon: "custom" },
- },
- {
- title: "contourApproximate1",
- key: "contourApproximate1",
- scopedSlots: { icon: "custom" },
- },
- {
- title: "contourApproximate2",
- key: "contourApproximate2",
- scopedSlots: { icon: "custom" },
- },
- {
- title: "contourRect1",
- key: "contourRect1",
- scopedSlots: { icon: "custom" },
- },
- {
- title: "contourCircle2",
- key: "contourCircle2",
- scopedSlots: { icon: "custom" },
- },
- ],
- },
- ];
- for (var i = 0; i < this.algorithmdataList.length; i++) {
- // //遍历数组
- // console.log(i);
- // console.log(this.algorithmdataList[i].algonodeName);
- // console.log(this.algorithmdataList[i].algonodeImage);
- // console.log(JSON.parse(this.algorithmdataList[i].algoparatempJson)); //将string转化为Json
- // console.log(
- // JSON.parse(this.algorithmdataList[i].algoparatempJson).Input
- // );
- // console.log(
- // JSON.parse(this.algorithmdataList[i].algoparatempJson).Output
- // );
- // console.log("treeData");
- // console.log(this.treeData);
- // this.treeData[1].children.addNode({
- // title: "this.algorithmdataList[i].algonodeName",
- // key: "this.algorithmdataList[i].algonodeName",
- // scopedSlots: { icon: "custom" },
- // })
- var addalgotree = false; //标志 目录树是否已添加该节点
- for (var j = 0; j < this.treeData.length; j++) {
- if (
- this.treeData[j].title == this.algorithmdataList[i].algotreetype
- ) {
- // //判断是否已有该节点
- // for (var k = 0; k < this.treeData.children.length; k++) {
- // if (
- // this.treeData.children[k].key ==
- // this.algorithmdataList[i].algonodeName
- // ) {
- // addalgotree = true;
- // break;
- // }
- // }
- // if (!addalgotree) {
- this.treeData[j].children.push({
- title: this.algorithmdataList[i].algonodeName,
- key: this.algorithmdataList[i].algonodeName,
- scopedSlots: { icon: "custom" },
- });
- addalgotree = true;
- // break;
- // }
- }
- }
- if (!addalgotree) {
- this.treeData.push({
- title: this.algorithmdataList[i].algotreetype,
- key: this.algorithmdataList[i].algotreetype,
- scopedSlots: { icon: "custom" },
- children: [
- {
- title: this.algorithmdataList[i].algonodeName,
- key: this.algorithmdataList[i].algonodeName,
- scopedSlots: { icon: "custom" },
- },
- ],
- });
- }
- // this.treeData[1].children.push({
- // title: this.algorithmdataList[i].algonodeName,
- // key: this.algorithmdataList[i].algonodeName,
- // scopedSlots: { icon: "custom" },
- // });
- console.log(this.treeData);
- // var imageurl =
- // "/src/assets/img/" + this.algorithmdataList[i].algonodeName + ".svg";
- //节点名称后跟随机参数
- if (
- this.algorithmdataList[i].algotreetype != "传统算法" &&
- this.algorithmdataList[i].algotreetype != "智能应用"
- ) {
- this.imageurl = require("@/assets/img/visisvg/" +
- this.algorithmdataList[i].algonodeName +
- ".svg");
- }
- var newalgonode = this.graph.createNode({
- x: 0,
- y: 0,
- // width: 170,
- // height: 30,
- shape: "template-node",
- // label: "consume_artifact",
- attrs: {
- label: {
- text: this.algorithmdataList[i].algonodeName, //"contour_task1",
- // text: this.algorithmdataList[i].algonodeName, //"contour_task1",
- },
- body: {
- // stroke: "#2CB9FF",
- // fill: "#2CB9FF",
- fill: "#d3ebf3",
- },
- // body: {
- // stroke: "#DA2625",
- // fill: "#DA2625",
- // },
- image: {
- "xlink:href": this.imageurl,
- // "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
- // "src/views/modules/visi/visisvg/算法.svg", /src/assets/img/ ../../../assets/img/
- //可放图标
- },
- },
- data: {
- algonodeId: this.algorithmdataList[i].algonodeId,
- nodeName: this.algorithmdataList[i].algonodeName,
- templateName: this.algorithmdataList[i].algonodeName,
- templateImage: this.algorithmdataList[i].algonodeImage,
- templateCommand: {
- // 1: "sh",
- // 2: "-c",
- // 2:"\"{{inputs.parameters.message}}\""
- },
- //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
- // templateCommand2: [
- // {
- // 1:"echo"
- // },
- // {
- // 2:"{{inputs.parameters.message}}"
- // },
- // ],
- templateArgs: {
- // 1: "cat /tmp/message",
- },
- algoparaInput: JSON.parse(
- this.algorithmdataList[i].algoparatempJson
- ).Input,
- algoparaOutput: JSON.parse(
- this.algorithmdataList[i].algoparatempJson
- ).Output,
- algoparaOutAddress: this.algorithmdataList[i].algoparaoutputAddress,
- algonodeSource: [],
- inputsparameters: JSON.parse(
- this.algorithmdataList[i].algoparatempJson
- ).Input.ParameterInput,
- inputsartifacts: JSON.parse(
- this.algorithmdataList[i].algoparatempJson
- ).Input.FileInput,
- //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
- //应对应input中的各项参数设置对应参数
- argumentsparameters: JSON.parse(
- this.algorithmdataList[i].algoparatempJson
- ).Input.ParameterInput,
- argumentsartifacts: JSON.parse(
- this.algorithmdataList[i].algoparatempJson
- ).Input.FileInput,
- outputsparameters: JSON.parse(
- this.algorithmdataList[i].algoparatempJson
- ).Output.ParameterOutput,
- outputsartifacts: JSON.parse(
- this.algorithmdataList[i].algoparatempJson
- ).Output.FileOutput,
- //获取到的连接线源的数据 连接线的源的输出数据
- sourcedatalist: [],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- wftempname: "", //保存Template name
- },
- });
- this.nodedata.push(newalgonode);
- console.log(newalgonode.getData());
- }
- },
- //20211115 左侧栏新增节点测试,未完成 ---------仅测试通过,可存入,需结合新增前端页面重新配置
- addalgorithmdata() {
- this.$http({
- url: this.$http.adornUrl("/sys/visialgorithmnode/save"),
- method: "post",
- data: this.$http.adornData({
- userId: this.$store.state.user.id,
- algonodeId: undefined,
- algonodeName: "contourCircle2",
- algonodeImage: "zvinjodocker/contours_circle2:20211015",
- algoparatempJson: JSON.stringify({
- Input: [
- { paraname: " cnt", paratype: " ", paradesc: " " },
- { paraname: "contour", paratype: " ", paradesc: " " },
- ],
- Output: [
- { paraname: " ", paratype: " ", paradesc: " " },
- { paraname: "", paratype: " ", paradesc: " " },
- ],
- }),
- algoparaoutputAddress: "", //this.dataForm.algoparaoutputAddress
- // userId: this.dataForm.userId,
- // algonodeId: this.dataForm.algonodeId || undefined,
- // algonodeName: this.dataForm.algonodeName,
- // algonodeImage: this.dataForm.algonodeImage,
- // algoparatempJson: this.dataForm.algoparatempJson,
- }),
- }).then(({ data }) => {
- if (data && data.code === 0) {
- Message.success("操作成功");
- // this.$message({
- // message: "操作成功",
- // type: "success",
- // duration: 1500,
- // onClose: () => {
- // this.visible = false;
- // this.$emit("refreshDataList");
- // },
- // });
- } else {
- Message.error(data.msg);
- // this.$message.error(data.msg);
- }
- });
- // this.$refs['dataForm'].validate((valid) => {
- // if (valid) {
- // this.$http({
- // url: this.$http.adornUrl(`/generator/visialgorithmnode/${!this.dataForm.algonodeId ? 'save' : 'update'}`),
- // method: 'post',
- // data: this.$http.adornData({
- // 'userId': this.dataForm.userId,
- // 'algonodeId': this.dataForm.algonodeId || undefined,
- // 'algonodeName': this.dataForm.algonodeName,
- // 'algonodeImage': this.dataForm.algonodeImage,
- // 'algoparatempJson': this.dataForm.algoparatempJson
- // })
- // }).then(({data}) => {
- // if (data && data.code === 0) {
- // this.$message({
- // message: '操作成功',
- // type: 'success',
- // duration: 1500,
- // onClose: () => {
- // this.visible = false
- // this.$emit('refreshDataList')
- // }
- // })
- // } else {
- // this.$message.error(data.msg)
- // }
- // })
- // }
- // })
- },
- //保存实验名称
- primaryExperimentConfig(args) {
- console.log("保存实验名称");
- console.log(args);
- this.experimentName = args[0];
- console.log(this.experimentName);
- },
- //20210810 保存条件节点设置
- primaryConNodeConfig(args) {
- this.graph
- .getCellById(args[1].id)
- .setData({ inputcondition: args[1].getData().inputcondition });
- this.graph
- .getCellById(args[1].id)
- .setData({ nodeName: args[1].getData().nodeName });
- //20210811 测试用
- // //model 获取节点信息
- // //遍历节点信息, 比对节点id 然后赋值
- // console.log("cell:"+args[1]);
- // console.log("cell:"+args[1].id);
- // //返回 [Object,Object ]
- // console.log("对应id的node:"+this.graph.getCellById(args[1]));
- // console.log("更改过的inputcondition:"+args[1].getData("inputcondition"));
- // console.log(args[1].getData().inputcondition);
- // const condition = args[1].getData().inputcondition;
- // this.graph.getCellById(args[1].id).setData({inputcondition: condition});
- // console.log(args[1])
- // console.log("graph node:"+this.graph.getNodes());
- },
- //20210811 保存templateNode节点设置 仅参数设置
- primaryNodeConfig(args) {
- var primarydata = args[1].getData();
- //先保存一遍,做处理在保存一遍
- console.log("更改前");
- console.log(this.graph.getCellById(args[1].id));
- //此部分应该只是展示,不可更改
- // this.graph.getCellById(args[1].id).setData({templateName:primarydata.templateName});
- // this.graph.getCellById(args[1].id).setData({templateImage: primarydata.templateImage});
- // this.graph.getCellById(args[1].id).setData({templateCommand: primarydata.templateCommand});
- // this.graph.getCellById(args[1].id).setData({templateArgs: primarydata.templateArgs});
- // this.graph.getCellById(args[1].id).setData({inputsparameters: primarydata.inputsparameters}); //应该是不变的
- // this.graph.getCellById(args[1].id).setData({outputsparameters: primarydata.outputsparameters}); //应该是不变的
- //仅可更改argumentsparameters 具体对接 还需实现后端
- //20211124 primarydata
- //保存参数类型
- for (var i = 0; i < primarydata.argumentsparameters.length; i++) {
- if (primarydata.argumentsparameters[i].hasOwnProperty("quotevalue")) {
- //成功
- // if (primarydata.argumentsparameters[i].quotevalue && primarydata.argumentsparameters[i].quotevalue.length == 2) {
- // primarydata.argumentsparameters[i].valuefrom =
- // "{{tasks." +
- // primarydata.argumentsparameters[i].quotevalue[0] +
- // ".outputs.parameters." +
- // primarydata.argumentsparameters[i].quotevalue[1] +
- // "}}";
- // console.log(primarydata.argumentsparameters[i].valuefrom)
- // }
- // 引用其他算法节点参数类型输入改为多选节点之后
- primarydata.argumentsparameters[i].valuefrom = [];
- if (
- primarydata.argumentsparameters[i].quotevalue &&
- primarydata.argumentsparameters[i].quotevalue.length != 0
- ) {
- // primarydata.argumentsparameters[i].valuefrom = [];
- for (
- var j = 0;
- j < primarydata.argumentsparameters[i].quotevalue.length;
- j++
- ) {
- console.log(
- " quotevalue.length " +
- primarydata.argumentsparameters[i].quotevalue.length
- );
- primarydata.argumentsparameters[i].valuefrom.push(
- "{{tasks." +
- primarydata.argumentsparameters[i].quotevalue[j][0] +
- ".outputs.parameters." +
- primarydata.argumentsparameters[i].quotevalue[j][1] +
- "}}"
- );
- }
- console.log(primarydata.argumentsparameters[i].valuefrom);
- }
- }
- }
- //保存文件类型
- // const curfilelist = [];
- let filedata = new FormData(); //保存文件内容,传递给后端---遍历完所有的argumentartifact之后统一上传
- for (var i = 0; i < primarydata.argumentsartifacts.length; i++) {
- if (primarydata.argumentsartifacts[i].hasOwnProperty("quotevalue")) {
- if (
- primarydata.argumentsartifacts[i].quotevalue &&
- primarydata.argumentsartifacts[i].quotevalue.length == 2
- ) {
- primarydata.argumentsartifacts[i].valuefrom =
- "{{tasks." +
- primarydata.argumentsartifacts[i].quotevalue[0] +
- ".outputs.artifacts." +
- primarydata.argumentsartifacts[i].quotevalue[1] +
- "}}";
- }
- }
- //1125 需后端保存至 minio 中,返回地址 -----或者在画布提交之后,上传,在应用具体地址信息
- if (primarydata.argumentsartifacts[i].hasOwnProperty("filelist")) {
- if (primarydata.argumentsartifacts[i].filelist.length != 0) {
- const curfilelist = [];
- // const curfileurl = []; //设定一次只能传一个
- // let filedata = new FormData(); //保存文件内容,传递给后端
- for (
- var j = 0;
- j < primarydata.argumentsartifacts[i].filelist.length;
- j++
- ) {
- curfilelist.push(
- primarydata.argumentsartifacts[i].filelist[j].raw
- );
- // filedata.append("file",primarydata.argumentsartifacts[i].filelist[j].raw);
- }
- primarydata.argumentsartifacts[i].filelist = curfilelist;
- // filedata.append("file"+primarydata.argumentsartifacts[i].paraname,primarydata.argumentsartifacts[i].filelist[0].raw);//每个参数仅可输入一个文件
- filedata.append(
- primarydata.argumentsartifacts[i].paraname,
- curfilelist[0]
- ); //每个参数仅可输入一个文件
- // console.log(filedata.get(primarydata.argumentsartifacts[i].paraname));
- }
- }
- }
- if (filedata != null) {
- var jsonfileurl = {};
- this.$http({
- url: this.$http.adornUrl("/visi/visiworkflow/savefile"),
- method: "post",
- data: filedata,
- }).then(({ data }) => {
- if (data && data.code === 0) {
- jsonfileurl = data.jsonfileurl;
- for (var i = 0; i < primarydata.argumentsartifacts.length; i++) {
- if (
- jsonfileurl.hasOwnProperty(
- primarydata.argumentsartifacts[i].paraname
- )
- ) {
- // console.log(
- // jsonfileurl[primarydata.argumentsartifacts[i].paraname]
- // );
- primarydata.argumentsartifacts[i].fileurls.push(
- jsonfileurl[primarydata.argumentsartifacts[i].paraname]
- );
- this.graph.getCellById(args[1].id).setData(primarydata); //终于好了 20211130
- }
- }
- // console.log(data.jsonfileurl)
- // fileurls = data.fileurls;
- // curfileurl.push(data.fileurls);
- /////设置的都是 i,为什么无论怎样都会赋值给 0
- // primarydata.argumentsartifacts[i].fileurls=data.fileurls;
- // console.log("i")
- // this.graph.getCellById(args[1].id).setData(primarydata); //成功成功
- // this.$message({
- // message: "操作成功",
- // type: "success",
- // duration: 1500,
- // onClose: () => {
- // // this.getDataList();
- // },
- // });
- } else {
- Message.error(data.msg);
- // this.$message.error(data.msg);
- }
- });
- }
- // this.graph.getCellById(args[1].id).setData(primarydata); //对应input 保存相应输入的值
- this.graph
- .getCellById(args[1].id)
- .setData({ argumentsparameters: primarydata.argumentsparameters }); //对应input 保存相应输入的值
- this.graph
- .getCellById(args[1].id)
- .setData({ argumentsartifacts: primarydata.argumentsartifacts }); //对应input 保存相应输入的值
- // console.log("当前节点值");
- // console.log(this.graph.getCellById(args[1].id).getData());
- // console.log(
- // this.graph.getCellById(args[1].id).getData().argumentsartifacts
- // );
- this.graph
- .getCellById(args[1].id)
- .setData({ nodeName: primarydata.nodeName }); //对应input 保存相应输入的值
- // console.log("cell:" + args[1].id);
- // console.log("对应id的node:" + this.graph.getCellById(args[1]).toString());
- // console.log(this.graph.getCellById(args[1].id));
- //20211119
- this.graph
- .getCellById(args[1].id)
- .setData({ algoparaInput: primarydata.algoparaInput }); //对应input 保存相应输入的值
- this.graph
- .getCellById(args[1].id)
- .setData({ algonodeSource: primarydata.algonodeSource });
- // console.log("primary-------------");
- // console.log(this.graph.getCellById(args[1].id).getData().algoparaInput);
- // console.log(this.graph.getCellById(args[1].id).getData().algoparaOutput);
- // 遍历algoparaInput中algoparaGetInput中的数据,添加文件地址,后保存到映射关系数据库中
- const curalgoparaInput = primarydata.algoparaInput;
- for (var i = 0; i < curalgoparaInput.getInput.length; i++) {
- for (var j = 0; j < primarydata.algonodeSource.length; j++) {
- if (curalgoparaInput.getInput[i].paravalue != null) {
- if (
- curalgoparaInput.getInput[i].paravalue[0] ==
- primarydata.algonodeSource[j].getData().nodeName
- ) {
- curalgoparaInput.getInput[i].paravalue.push(
- primarydata.algonodeSource[j].getData().algoparaOutAddress
- );
- }
- }
- }
- }
- //202111123 保存在 节点数据中 将curalgoparaInput 保存为 algoparaInput
- // console.log("this.graph.getCellById(args[1].id).getData().algoparaInput");
- this.graph
- .getCellById(args[1].id)
- .setData({ algoparaInput: curalgoparaInput }); //对应input 保存相应输入的值
- // console.log(this.graph.getCellById(args[1].id).getData().algoparaInput);
- // console.log(
- // "遍历algoparaInput中algoparaGetInput中的数据,添加文件地址,后保存到映射关系数据库中"
- // );
- // console.log(curalgoparaInput);
- // 20211123 该部分代码每次保存都会在数据库中添加新的记录
- // this.$http({
- // url: this.$http.adornUrl("/sys/visiworkflowparamap/save"),
- // method: "post",
- // data: this.$http.adornData({
- // paramapId: undefined,
- // userId: this.$store.state.user.id,
- // workflowId: "",
- // inputparaNodename: this.graph.getCellById(args[1].id).getData()
- // .nodeName,
- // inputparaJson: JSON.stringify(curalgoparaInput),
- // }),
- // }).then(({ data }) => {
- // if (data && data.code === 0) {
- // this.$message({
- // message: "操作成功",
- // type: "success",
- // duration: 1500,
- // onClose: () => {
- // this.visible = false;
- // // this.$emit('refreshDataList')
- // },
- // });
- // } else {
- // this.$message.error(data.msg);
- // }
- // });
- },
- primaryCSVselectNodeconfig(args){
-
-
- var primarydata = args[1].getData();
- this.graph.getCellById(args[1].id).setData(primarydata);
- // console.log("转换节点新数据")
- // console.log(args[1].getData())
- // console.log(this.graph.getCellById(args[1].id).getData())
- },
- //20210812 左侧树形组件
- handleDragStart(node, ev) {
- console.log("drag start", node);
- },
- handleDragEnter(draggingNode, dropNode, ev) {
- console.log("tree drag enter: ", dropNode.label);
- },
- handleDragLeave(draggingNode, dropNode, ev) {
- console.log("tree drag leave: ", dropNode.label);
- },
- handleDragOver(draggingNode, dropNode, ev) {
- console.log("tree drag over: ", dropNode.label);
- },
- handleDragEnd(draggingNode, dropNode, dropType, ev) {
- console.log("tree drag end: ", dropNode && dropNode.label, dropType);
- },
- handleDrop(draggingNode, dropNode, dropType, ev) {
- console.log("tree drop: ", dropNode.label, dropType);
- },
- allowDrop(draggingNode, dropNode, type) {
- if (dropNode.data.label === "二级 3-1") {
- return type !== "inner";
- } else {
- return true;
- }
- },
- allowDrag(draggingNode) {
- return draggingNode.data.label.indexOf("三级 3-2-2") === -1;
- },
- //20210813
- onSelect(selectedKeys, info) {
- console.log("selected", selectedKeys, info);
- },
- //20210813 dnd
- startDrag(e) {
- // console.log("拖拽前");
- // const target = this.currentTarget
- const target = e.currentTarget;
- const type = target.getAttribute("data-type");
- const node = this.graph.createNode({
- width: 100,
- height: 40,
- attrs: {
- label: {
- text: "circle",
- fill: "#6a6c8a",
- },
- body: {
- stroke: "#31d0c6",
- strokeWidth: 2,
- },
- },
- });
- // console.log("拖拽");
- this.dnd.start(node, e);
- //删除.nativeEvent 前会出错
- // this.dnd.start(node, e.nativeEvent);
- },
- //20210926 树形组件
- onSelect(selectedKeys, info) {
- // console.log("selected", selectedKeys, info);
- // console.log(selectedKeys);
- // console.log(info);
- const zdocker_test = this.graph.createNode({
- // width: 170,
- // height: 30,
- shape: "template-node",
- // label: "consume_artifact",
- attrs: {
- label: {
- text: "zdockertest",
- },
- body: {
- // stroke: "#2CB9FF",
- // fill: "#2CB9FF",
- fill: "#d3ebf3",
- },
- // body: {
- // stroke: "#DA2625",
- // fill: "#DA2625",
- // },
- image: {
- "xlink:href":
- "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
- // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
- //可放图标
- },
- },
- data: {
- nodeName: "zdockertest",
- templateName: "print-message",
- templateImage: "zvinjodocker/zdockertest1:20211011",
- templateCommand: {
- // 1: "sh",
- // 2: "-c",
- // 2:"\"{{inputs.parameters.message}}\""
- },
- //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
- // templateCommand2: [
- // {
- // 1:"echo"
- // },
- // {
- // 2:"{{inputs.parameters.message}}"
- // },
- // ],
- templateArgs: {
- // 1: "cat /tmp/message",
- },
- inputsparameters: [],
- inputsartifacts: [
- //此container 需要输入的参数,固定
- // {
- // name: "message",
- // path: "/tmp/message",
- // },
- ],
- //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
- //应对应input中的各项参数设置对应参数
- argumentsparameters: [],
- argumentsartifacts: [
- //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
- // {
- // name: "message",
- // valuefrom: "{{tasks.whalesay.outputs.artifacts.hello-art}}",
- // },
- ],
- outputsparameters: [],
- outputsartifacts: [],
- //获取到的连接线源的数据 连接线的源的输出数据
- sourcedatalist: [
- // {
- // name: "source1",
- // },
- // {
- // name: "source2",
- // },
- ],
- inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
- inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
- },
- });
- //20211012
- // 将树形节点的键与 节点名称对应起来。
- // this.graph.addNode(zdocker_test);
- // this.nodedata.addNode(consume_artifact);
- // this.nodedata.appendChild(consume_artifact);
- // this.nodedata.push(consume_artifact);
- // console.log("nodedata");
- // console.log(this.nodedata);
- // console.log(this.nodedata[0])
- //通过遍历节点列表nodedata中键 selectedKeys与节点中attrs.label.text相匹配,生成对应的节点
- //先将所有的节点创建成功后保存在this.nodedata中,点击对应节点后 匹配正确后将节点加入到画布中
- // console.log(this.nodedata[0].attrs.label.text)
- // this.graph.addNode(this.nodedata[0])
- // console.log(this.nodedata);
- var nodenamenum = Math.floor(Math.random() * 1000); //1000以内随机整数
- for (var i = 0; i < this.nodedata.length; i++) {
- //遍历数组
- if (selectedKeys.toString() === this.nodedata[i].attrs.label.text) {
- // console.log(selectedKeys.toString());
- var clonenode = this.nodedata[i].clone();
- // clonenode.getElementById
- //更改nodeName 及templateName 后添加随机数
- clonenode.setData({
- nodeName: clonenode.getData().nodeName + nodenamenum,
- });
- clonenode.setData({
- templateName: clonenode.getData().templateName + nodenamenum,
- });
- this.graph.addNode(clonenode);
- // this.graph.addNode(this.nodedata[i].clone());
- } else {
- // console.log(selectedKeys.toString());
- }
- // console.log(i);
- }
- },
- onCheck(checkedKeys, info) {
- console.log("onCheck", checkedKeys, info);
- },
- //设置布局可拖动改变大小
- dragControllerDiv: function () {
- // var resize = document.getElementsByClassName("resize");
- // var left = document.getElementsByClassName("left");
- // var mid = document.getElementsByClassName("right");
- // var box = document.getElementsByClassName("box");
- // for (let i = 0; i < resize.length; i++) {
- // // 鼠标按下事件
- // resize[i].onmousedown = function (e) {
- // //颜色改变提醒
- // resize[i].style.background = "#818181";
- // var startX = e.clientX;
- // console.log("拖动改变两侧大小")
- // console.log("startx");
- // console.log(startX);
- // // 鼠标拖动事件
- // document.onmousemove = function (e) {
- // resize[i].left = startX;
- // var endX = e.clientX;
- // var moveLen = resize[i].left + (endX - startX); // (endx-startx)=移动的距离。resize[i].left+移动的距离=左边区域最后的宽度
- // console.log("movelen");
- // console.log(moveLen);
- // var maxT = box[i].clientWidth - resize[i].offsetWidth; // 容器宽度 - 左边区域的宽度 = 右边区域的宽度
- // console.log("maxt ");
- // console.log(maxT);
- // if (moveLen < 800) moveLen = 800; // 左边区域的最小宽度为32px
- // if (moveLen > maxT - 150) moveLen = maxT - 150; //右边区域最小宽度为150px
- // resize[i].style.left = moveLen; // 设置左侧区域的宽度
- // for (let j = 0; j < left.length; j++) {
- // left[j].style.width =(moveLen / document.body.clientWidth) * 100 + "%";
- // mid[j].style.width = ((box[i].clientWidth - moveLen) / document.body.clientWidth -0.008) *100 +"%";
- // }
- // };
- // // 鼠标松开事件
- // document.onmouseup = function (evt) {
- // //颜色恢复
- // resize[i].style.background = "#d6d6d6";
- // document.onmousemove = null;
- // document.onmouseup = null;
- // resize[i].releaseCapture && resize[i].releaseCapture(); //当你不在需要继续获得鼠标消息就要应该调用ReleaseCapture()释放掉
- // };
- // resize[i].setCapture && resize[i].setCapture(); //该函数在属于当前线程的指定窗口里设置鼠标捕获
- // return false;
- // };
- // }
- var resize = document.getElementsByClassName("resize");
- var left = document.getElementsByClassName("left");
- var mid = document.getElementsByClassName("right");
- var box = document.getElementsByClassName("box");
- for (let i = 0; i < resize.length; i++) {
- // 鼠标按下事件
- resize[i].onmousedown = function (e) {
- //颜色改变提醒
- resize[i].style.background = "#818181";
- var startX = e.clientX;
- resize[i].left = resize[i].offsetLeft;
- // 鼠标拖动事件
- document.onmousemove = function (e) {
- var endX = e.clientX;
- var moveLen = resize[i].left + (endX - startX); // (endx-startx)=移动的距离。resize[i].left+移动的距离=左边区域最后的宽度
- var maxT = box[i].clientWidth - resize[i].offsetWidth; // 容器宽度 - 左边区域的宽度 = 右边区域的宽度
- if (moveLen < 800) moveLen = 800; // 左边区域的最小宽度为32px
- if (moveLen > maxT - 300) moveLen = maxT - 300; //右边区域最小宽度为150px
- resize[i].style.left = moveLen; // 设置左侧区域的宽度
- for (let j = 0; j < left.length; j++) {
- left[j].style.width = moveLen + "px";
- mid[j].style.width = box[i].clientWidth - moveLen - 10 + "px";
- }
- };
- // 鼠标松开事件
- document.onmouseup = function (evt) {
- //颜色恢复
- resize[i].style.background = "#d6d6d6";
- document.onmousemove = null;
- document.onmouseup = null;
- resize[i].releaseCapture && resize[i].releaseCapture(); //当你不在需要继续获得鼠标消息就要应该调用ReleaseCapture()释放掉
- };
- resize[i].setCapture && resize[i].setCapture(); //该函数在属于当前线程的指定窗口里设置鼠标捕获
- return false;
- };
- }
- },
- //保存输入节点内容
- primaryInputnodeConfig(args) {
- // console.log("保存输入节点");
- // console.log(args[0].id);
- // // this.$emit("refreshDataList",this.cell,this.st_dataListvalue,this.dy_dataListvalue,this.fileList,this.allfilemap);//各个参数
- // this.graph.getCellById(args[0].id).setData({ st_dataListvalue: args[1] });
- // this.graph.getCellById(args[0].id).setData({ dy_dataListvalue: args[2] });
- // this.graph.getCellById(args[0].id).setData({ fileList: args[3] });
- // this.graph.getCellById(args[0].id).setData({ allfilemap: args[4] });
- // this.$emit("refreshinputnode",this.cell,celldata);
- // console.log(args[1].allfilemap);
- // this.graph.getCellById(args[0].id).setData(args[1]);
- //以该方式 福赋值字符串型可以,数组类型不可以
- // this.graph.getCellById(args[0].id).setData({allfilemap: this.graph.getCellById(args[0].id).getData().allfilemap.concat(args[1].allfilemap)})
- this.graph.getCellById(args[0].id).replaceData(args[1]); /////成功成功
- console.log(this.graph.getCellById(args[0]));
- },
- },
- computed: {
- formItemLayout() {
- const { formLayout } = this;
- return formLayout === "horizontal"
- ? {
- labelCol: { span: 4 },
- wrapperCol: { span: 14 },
- }
- : {};
- },
- buttonItemLayout() {
- const { formLayout } = this;
- return formLayout === "horizontal"
- ? {
- wrapperCol: { span: 14, offset: 4 },
- }
- : {};
- },
- },
- };
- </script>
- <style lang="scss">
- // 20210715 zhang 添加 布局
- #components-layout-demo-responsive .logo {
- height: 32px;
- // background: rgba(255, 255, 255, 0.959);
- margin: 16px;
- display: block;
- background: #dcdfe6;
- }
- .dividesign {
- height: 32px;
- // background: rgba(255, 255, 255, 0.959);
- margin: 16px;
- display: block;
- // background: #dcdfe6;
- // display: block;
- // height: 1px;
- // width: 100%;
- // margin: 24px 0;
- background-color: #dcdfe6;
- // position: relative;
- }
- // .app-stencil {
- // width: 250px;
- // height: 100%;
- // border: 1px solid #f0f0f0;
- // position: relative;
- // }
- .content {
- font-family: sans-serif;
- // display: flex;
- width: 100%;
- background: #dcdfe6;
- }
- // .app-stencil {
- // width: 250px;
- // border: 1px solid #f0f0f0;
- // position: relative;
- // }
- .app-content {
- // flex: 1;
- // height: 520px;
- height: 100%;
- width: 100%;
- margin-left: 8px;
- margin-right: 8px;
- box-shadow: 0 0 10px 1px #e9e9e9;
- // background: #dcdfe6;
- }
- .divi {
- margin: 1px 0;
- }
- .x6-node [magnet="true"] {
- cursor: crosshair;
- transition: none;
- }
- .x6-node [magnet="true"]:hover {
- opacity: 1;
- }
- .x6-node [magnet="true"][port-group="in"] {
- cursor: move;
- }
- .my-port {
- width: 100%;
- height: 100%;
- border: 1px solid #808080;
- border-radius: 100%;
- background: #eee;
- }
- .my-port.connected {
- width: 0;
- height: 0;
- margin-top: 5px;
- margin-left: 1px;
- border-width: 5px 4px 0;
- border-style: solid;
- border-color: #808080 transparent transparent;
- border-radius: 0;
- background-color: transparent;
- }
- .x6-port-body.available {
- overflow: visible;
- }
- .x6-port-body.available body {
- overflow: visible;
- }
- .x6-port-body.available body > div::before {
- content: " ";
- float: left;
- width: 20px;
- height: 20px;
- margin-top: -5px;
- margin-left: -5px;
- border-radius: 50%;
- background-color: rgba(57, 202, 116, 0.6);
- box-sizing: border-box;
- }
- .x6-port-body.available body > div::after {
- content: " ";
- float: left;
- clear: both;
- width: 10px;
- height: 10px;
- margin-top: -15px;
- border-radius: 50%;
- background-color: #fff;
- border: 1px solid #39ca74;
- position: relative;
- z-index: 10;
- box-sizing: border-box;
- }
- .x6-port-body.adsorbed {
- overflow: visible;
- }
- .x6-port-body.adsorbed body {
- overflow: visible;
- }
- .x6-port-body.adsorbed body > div::before {
- content: " ";
- float: left;
- width: 28px;
- height: 28px;
- margin-top: -9px;
- margin-left: -9px;
- border-radius: 50%;
- background-color: rgba(57, 202, 116, 0.6);
- box-sizing: border-box;
- }
- .x6-port-body.adsorbed body > div::after {
- content: " ";
- float: left;
- clear: both;
- width: 10px;
- height: 10px;
- margin-top: -19px;
- border-radius: 50%;
- background-color: #fff;
- border: 1px solid #39ca74;
- position: relative;
- z-index: 10;
- box-sizing: border-box;
- }
- //20210805 design-panel
- .form {
- height: calc(100vh - 100px);
- flex-grow: 1;
- overflow-x: hidden;
- overflow-y: auto;
- background: #fff;
- }
- .ant-tabs-tabpane {
- background: #fff;
- padding: 5px;
- }
- //20210812 zhang 左侧树形组件栏
- .leftDivTree {
- width: 100%;
- height: 93.7%;
- // padding: 10 0px;
- // border:0.2px solid #000;
- // overflow: scroll;
- }
- .leftDivTree ::v-deep .iconfont {
- margin-right: 8px;
- }
- .leftDivTree ::v-deep .el-tree-node {
- display: table;
- min-width: 100%;
- }
- // .leftDivTitle {
- // color: #fff;
- // border-color: #409eff;
- // font-size: 14px;
- // }
- //20210813 左侧组件
- .dnd-rect {
- width: 80px;
- height: 20px;
- border: 2px solid #31d0c6;
- text-align: center;
- line-height: 40px;
- margin: 16px;
- cursor: move;
- }
- //设置布局 可拖动改变大小
- .left {
- width: 69.2%;
- // width: 100%;
- height: 100%;
- overflow-y: auto;
- overflow-x: hidden;
- float: left;
- display: flex;
- }
- .resize {
- cursor: col-resize;
- float: left;
- position: relative;
- top: 10%;
- background-color: #d6d6d6;
- border-radius: 5px;
- margin-top: -10px;
- width: 10px;
- // height: 50px;
- height: 70%;
- line-height: 50px;
- // line-height: 100%;
- // text-align: center;
- background-size: cover;
- background-position: center;
- font-size: 32px;
- color: white;
- }
- /*拖拽区鼠标悬停样式*/
- .resize:hover {
- color: #444444;
- }
- .right {
- // height: 7.8rem;
- height: 100%;
- float: left;
- width: 30%;
- display: flex;
- }
- .box {
- width: 100%;
- // height: 7.8rem;
- height: 100%;
- }
- .boxform {
- width: 100%;
- height: 100%;
- flex: 1;
- background-color: #fff;
- }
- .boxformitem {
- border-style: solid;
- border-width: 1px;
- border-color: #dcdfe6;
- }
- // .el-icon-video-play:before {
- // content: "提交";
- // }
- .mod-demo-echarts {
- > .el-alert {
- margin-bottom: 10px;
- }
- > .el-row {
- margin-top: -10px;
- margin-bottom: -10px;
- .el-col {
- padding-top: 10px;
- padding-bottom: 10px;
- }
- }
- .chart-box {
- min-height: 400px;
- }
- }
- .divi {
- display: block;
- height: 1px;
- width: 100%;
- margin: 24px 0;
- background-color: #dcdfe6;
- position: relative;
- }
- .divi2 {
- display: block;
- height: 1px;
- width: 100%;
- position: relative;
- }
- .x6-graph-scroller {
- min-height: 800px;
- }
- </style>
|