12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160 |
- <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,后端调用
- },
- });
- //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>
|