design-graph1.vue 226 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904
  1. <template>
  2. <div class="mod-demo-echarts">
  3. <el-breadcrumb class="divi2" separator-class="el-icon-arrow-right">
  4. <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
  5. <el-breadcrumb-item :to="{ path: '/visi-design' }"
  6. >可视化设计</el-breadcrumb-item
  7. >
  8. <el-breadcrumb-item>实验设置</el-breadcrumb-item>
  9. </el-breadcrumb>
  10. <el-divider class="divi"></el-divider>
  11. <!-- <design-graph></design-graph> -->
  12. <!-- <design-graph-1 :visible.sync="designgraphvisi" v-if="designgraphvisi" ref="designgraph"></design-graph-1> -->
  13. <a-layout id="components-layout-demo-responsive">
  14. <!-- 左侧组件栏 default-expand-all-->
  15. <a-layout-sider
  16. breakpoint="lg"
  17. collapsed-width="0"
  18. @collapse="onCollapse"
  19. @breakpoint="onBreakpoint"
  20. theme="light"
  21. v-model="collapsed"
  22. collapsible
  23. >
  24. <div>
  25. <a-tree
  26. show-line
  27. show-icon
  28. :tree-data="treeData"
  29. :default-selected-keys="['0-0-0']"
  30. @select="onSelect"
  31. >
  32. <a-icon slot="icon" type="carry-out" />
  33. </a-tree>
  34. </div>
  35. </a-layout-sider>
  36. <!-- <div class="box" ref="box"> -->
  37. <!-- <div class="left"> -->
  38. <!-- 右侧画布 -->
  39. <div class="content">
  40. <div class="app-content">
  41. <div class="box" ref="box">
  42. <div class="left">
  43. <!-- <a-layout style="width:'100%',height:'100%',display:'flex'"> -->
  44. <el-form class="boxform">
  45. <el-form-item class="boxformitem">
  46. <!-- 画布上方按钮 undo redo-->
  47. <el-row>
  48. <el-tooltip
  49. content="提交"
  50. placement="bottom-end"
  51. effect="dark"
  52. >
  53. <i
  54. @click="onRun"
  55. style="
  56. height: 50px;
  57. width: 50px;
  58. margin: 10px 5px 10px 10px;
  59. font-size: 23px;
  60. "
  61. class="iconfont icon-yunXang"
  62. ></i>
  63. </el-tooltip>
  64. <el-tooltip
  65. content="保存"
  66. placement="bottom-end"
  67. effect="dark"
  68. >
  69. <i
  70. @click="onPrimary"
  71. style="
  72. height: 25px;
  73. width: 25px;
  74. margin: 10px 5px 10px 10px;
  75. font-size: 23px;
  76. "
  77. class="el-icon-document-checked"
  78. >
  79. </i>
  80. </el-tooltip>
  81. <el-tooltip content="取消" effect="dark">
  82. <i
  83. @click="onCancel"
  84. style="
  85. height: 25px;
  86. width: 25px;
  87. margin: 10px 5px 10px 10px;
  88. font-size: 23px;
  89. "
  90. class="el-icon-error"
  91. >
  92. </i>
  93. </el-tooltip>
  94. <el-tooltip content="<" effect="dark">
  95. <i
  96. @click="onUndo"
  97. style="
  98. height: 25px;
  99. width: 25px;
  100. margin: 10px 5px 10px 10px;
  101. font-size: 23px;
  102. "
  103. class="el-icon-arrow-left"
  104. >
  105. </i>
  106. </el-tooltip>
  107. <el-tooltip content=">" effect="dark">
  108. <i
  109. @click="onRedo"
  110. style="
  111. height: 25px;
  112. width: 25px;
  113. margin: 10px 5px 10px 10px;
  114. font-size: 23px;
  115. "
  116. class="el-icon-arrow-right"
  117. >
  118. </i>
  119. </el-tooltip>
  120. <el-tooltip content="示例" effect="dark">
  121. <i
  122. @click="onGetcontour"
  123. style="
  124. height: 25px;
  125. width: 25px;
  126. margin: 10px 5px 10px 10px;
  127. font-size: 23px;
  128. "
  129. class="el-icon-notebook-2"
  130. >
  131. </i>
  132. </el-tooltip>
  133. <el-tooltip content="清空" effect="dark">
  134. <i
  135. @click="onCleargraph"
  136. style="
  137. height: 25px;
  138. width: 25px;
  139. margin: 10px 5px 10px 10px;
  140. font-size: 23px;
  141. "
  142. class="el-icon-delete"
  143. >
  144. </i>
  145. </el-tooltip>
  146. <el-tooltip content="获取代码模板" effect="dark">
  147. <i
  148. @click="getParaTemp()"
  149. style="
  150. height: 25px;
  151. width: 25px;
  152. margin: 10px 5px 10px 10px;
  153. font-size: 23px;
  154. "
  155. class="el-icon-tickets"
  156. >
  157. </i>
  158. </el-tooltip>
  159. <el-tooltip content="日志" effect="dark">
  160. <i
  161. @click="getworkflowContent"
  162. style="
  163. height: 25px;
  164. width: 25px;
  165. margin: 10px 5px 10px 10px;
  166. font-size: 23px;
  167. "
  168. class="el-icon-document"
  169. >
  170. </i>
  171. </el-tooltip>
  172. <el-tooltip content="节点居中" effect="dark">
  173. <i
  174. @click="getgraphContentcenter"
  175. style="
  176. height: 25px;
  177. width: 25px;
  178. margin: 10px 5px 10px 10px;
  179. font-size: 23px;
  180. "
  181. class="iconfont icon-tishi"
  182. >
  183. </i>
  184. </el-tooltip>
  185. <el-tag
  186. :key="workflowstatustag.name"
  187. :type="workflowstatustag.type"
  188. @click="getWorkflowStatus"
  189. >{{ workflowstatustag.name }}</el-tag
  190. >
  191. </el-row>
  192. </el-form-item>
  193. <el-form-item class="boxformitem">
  194. <!-- 画布具体位置 -->
  195. <!-- <a-layout-content :style="{ margin: '0px 0px 0' }"> -->
  196. <!-- <div :style="{ padding: '24px', background: '#fff', minHeight: '360px' }"> -->
  197. <div
  198. style="width: 100%; height: 100%; display: flex"
  199. :style="{
  200. padding: '0px',
  201. background: '#fff',
  202. minHeight: '800px',
  203. }"
  204. >
  205. <!-- content -->
  206. <!-- 画布 style="width: 100%; height: 100%" class="app-content"-->
  207. <div id="container" style="flex: 1"></div>
  208. </div>
  209. <!-- </a-layout-content> -->
  210. </el-form-item>
  211. </el-form>
  212. <!-- </a-layout> -->
  213. </div>
  214. <div class="resize" title="收缩侧边栏"></div>
  215. <div class="right">
  216. <!-- 右侧组件栏 width="290px" style="width: 100%" width="239px" 309px-->
  217. <ExperimentConfig
  218. v-show="experimentVisi"
  219. ref="experConfig"
  220. @primaryExperimentclick="primaryExperimentConfig(arguments)"
  221. ></ExperimentConfig>
  222. <NodeConfig
  223. v-show="nodeConfigVisi"
  224. ref="newNodeConfig"
  225. @primaryNodeclick="primaryNodeConfig(arguments)"
  226. ></NodeConfig>
  227. <ConNodeConfig
  228. v-show="conNodeConfigVisi"
  229. ref="newConNodeConfig"
  230. @primaryclick="primaryConNodeConfig(arguments)"
  231. ></ConNodeConfig>
  232. <!-- <a-layout-sider
  233. breakpoint="lg"
  234. theme="light"
  235. width="100%"
  236. height="100%"
  237. collapsed-width="2"
  238. @collapse="onCollapse"
  239. @breakpoint="onBreakpoint"
  240. >
  241. <ExperimentConfig
  242. v-show="experimentVisi"
  243. ref="experConfig"
  244. ></ExperimentConfig>
  245. <NodeConfig
  246. v-show="nodeConfigVisi"
  247. ref="newNodeConfig"
  248. @primaryNodeclick="primaryNodeConfig(arguments)"
  249. ></NodeConfig>
  250. <ConNodeConfig
  251. v-show="conNodeConfigVisi"
  252. ref="newConNodeConfig"
  253. @primaryclick="primaryConNodeConfig(arguments)"
  254. ></ConNodeConfig>
  255. </a-layout-sider> -->
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. <NodeParaTemp v-if="paraTempVisible" ref="paraTemp"></NodeParaTemp>
  261. <InputNodeConfig
  262. v-if="inputNodeConVisible"
  263. ref="inputNodeConfig"
  264. @refreshinputnode="primaryInputnodeConfig(arguments)"
  265. ></InputNodeConfig>
  266. <OutputNodeConfig
  267. v-if="outputNodeConVisible"
  268. ref="outputNodeConfig"
  269. ></OutputNodeConfig>
  270. <Workflowlog
  271. v-if="workflowContentVisi"
  272. ref="getworkflowlog"
  273. ></Workflowlog>
  274. </a-layout>
  275. <!-- 弹窗 -->
  276. <!-- <ConWatch v-if="newWatchVisible" ref="newWatch" @refreshDataList="getDataList"></ConWatch> -->
  277. </div>
  278. </template>
  279. <script>
  280. import { Cell, Graph, Model, Node } from "@antv/x6";
  281. import { Shape } from "@antv/x6";
  282. import { Addon } from "@antv/x6";
  283. import { Path } from "@antv/x6";
  284. // import { X6Splitbox } from "x6-vue-components";
  285. // import { SplitBox } from "@antv/x6";
  286. // import { X6Splitbox } from "@antv/x6-vue-shape";
  287. import { Rect } from "@antv/x6/lib/shape/basic";
  288. // import ConWatch from "./condition-watch.vue";
  289. // import StencilTree from "./stencil-tree.vue";
  290. import NodeConfig from "./design-node-config.vue";
  291. import ConNodeConfig from "./design-connode-config.vue";
  292. import ExperimentConfig from "./design-experconfig.vue";
  293. import NodeParaTemp from "./design-para-temp.vue";
  294. import InputNodeConfig from "./design-inputnode-config1.vue";
  295. import OutputNodeConfig from "./design-outputnode-config.vue";
  296. import Workflowlog from "./design-workflowlog.vue";
  297. import "@/ant-design-vue";
  298. import { Message } from "element-ui";
  299. import { MessageBox } from "element-ui";
  300. export default {
  301. data() {
  302. return {
  303. pregraphdata: "",
  304. dnd: null,
  305. // newConWatchVisible: false, //条件弹窗
  306. conNodeConfigVisi: false, //条件节点配置
  307. nodeConfigVisi: false, //普通节点配置
  308. experimentVisi: true, //实验配置
  309. paraTempVisible: false, //20211111 算法节点输入输出参数代码模板
  310. inputNodeConVisible: false, //输入节点配置
  311. outputNodeConVisible: false, //输出节点配置
  312. //右侧参数设置组件栏
  313. formLayout: "horizontal",
  314. form: this.$form.createForm(this, { name: "coordinated" }),
  315. collapsed: false, //设置左侧侧边栏可收起
  316. addorupdate: true,//true表示update,新增 false表示add
  317. workflowId: null,//当前工作流id
  318. experimentName: "",//当前实验名称
  319. workflowName: "", //当前画布工作流名称
  320. workflowContent: { main: "", wait: "", init: "" }, //当前画布工作流整个日志
  321. workflowContentlog: "",
  322. workflowContentVisi: false,
  323. podlogs: null, //当前节点与workflow pod对应情况
  324. idTemplateNameMap: null, //id与templatename
  325. containertype: "main",
  326. workflowStatus: "uncommitted", //提交后的状态
  327. workflowstatustag: {
  328. name: "未提交",
  329. type: "info",
  330. },
  331. workflowdataList: [], //获取已经生成的画布列表, workflow列表
  332. algorithmdataList: [], //获取左侧树形组件栏,所有算法模块节点列表
  333. //20210926 树形组件
  334. treeData: [
  335. {
  336. title: "parent 1",
  337. key: "0-0",
  338. slots: {
  339. icon: "smile",
  340. },
  341. children: [
  342. // {
  343. // title: "consume_artifact",
  344. // key: "consume_artifact",
  345. // slots: { icon: "meh" },
  346. // },
  347. // {
  348. // title: "generate_artifact",
  349. // key: "generate_artifact",
  350. // scopedSlots: { icon: "custom" },
  351. // },
  352. // {
  353. // title: "zdockertest",
  354. // key: "zdockertest",
  355. // scopedSlots: { icon: "custom" },
  356. // },
  357. {
  358. title: "条件节点",
  359. key: "条件节点",
  360. scopedSlots: { icon: "custom" },
  361. },
  362. {
  363. title: "输入节点",
  364. key: "dataInputnode",
  365. scopedSlots: { icon: "custom" },
  366. },
  367. {
  368. title: "输出节点",
  369. key: "dataOutputnode",
  370. scopedSlots: { icon: "custom" },
  371. },
  372. ],
  373. },
  374. {
  375. title: "轮廓识别",
  376. key: "0-1",
  377. slots: {
  378. icon: "smile",
  379. },
  380. children: [
  381. {
  382. title: "contourTask1",
  383. key: "contourTask1",
  384. scopedSlots: { icon: "custom" },
  385. },
  386. {
  387. title: "contourTask2",
  388. key: "contourTask2",
  389. scopedSlots: { icon: "custom" },
  390. },
  391. {
  392. title: "contourTask3",
  393. key: "contourTask3",
  394. scopedSlots: { icon: "custom" },
  395. },
  396. {
  397. title: "contourApproximate1",
  398. key: "contourApproximate1",
  399. scopedSlots: { icon: "custom" },
  400. },
  401. {
  402. title: "contourApproximate2",
  403. key: "contourApproximate2",
  404. scopedSlots: { icon: "custom" },
  405. },
  406. {
  407. title: "contourRect1",
  408. key: "contourRect1",
  409. scopedSlots: { icon: "custom" },
  410. },
  411. {
  412. title: "contourCircle2",
  413. key: "contourCircle2",
  414. scopedSlots: { icon: "custom" },
  415. },
  416. ],
  417. },
  418. ],
  419. showLine: true,
  420. showIcon: false,
  421. nodedata: [],
  422. imageurl: require("@/assets/img/cnnmnist.svg"),
  423. };
  424. },
  425. components: {
  426. NodeConfig: NodeConfig,
  427. ConNodeConfig: ConNodeConfig,
  428. ExperimentConfig: ExperimentConfig,
  429. NodeParaTemp: NodeParaTemp,
  430. InputNodeConfig: InputNodeConfig,
  431. OutputNodeConfig: OutputNodeConfig,
  432. Workflowlog: Workflowlog,
  433. // X6Splitbox: X6Splitbox,
  434. // SplitBox: splitbox,
  435. },
  436. activated() {
  437. this.getalgorithmDataList();
  438. this.onCleargraph();
  439. this.addorupdate = this.$route.query.update;
  440. console.log("addorupdate")
  441. console.log(this.addorupdate)
  442. //路由跳转--如果是修改,则加载画布信息;如果为新建,则不加载
  443. if(this.$route.query.update==true){
  444. this.initGraph(this.$route.query.winfo);
  445. }
  446. // this.createGraph();
  447. // this.addalgorithmdata();
  448. },
  449. // mounted() {
  450. mounted() {
  451. //为测试artifact 重新定义设置节点 保留之前的普通参数方式
  452. //将inputparameters 等参数[] 设置初始化为空
  453. // 定义节点
  454. Graph.registerNode("template-node", {
  455. inherit: "rect",
  456. width: 90,
  457. height: 80,
  458. attrs: {
  459. body: {
  460. strokeWidth: 1,
  461. stroke: "#d3e3ee",
  462. // fill: "#d3ebf3",
  463. fill: "#1891ec",
  464. rx: 8,
  465. ry: 8,
  466. },
  467. //设置内部添加图片
  468. image: {
  469. width: 36,
  470. height: 36,
  471. refX: 30,
  472. refY: 16,
  473. // "xlink:href":
  474. // "https://gw.alipayobjects.com/zos/bmw-prod/c55d7ae1-8d20-4585-bd8f-ca23653a4489.svg",
  475. },
  476. // label: {
  477. // refX: 3,
  478. // refY: 2,
  479. // textAnchor: "left",
  480. // textVerticalAnchor: "top",
  481. // fontSize: 12,
  482. // fill: "#fff",
  483. // },
  484. //删除功能
  485. //设置可通过backspace 删除,注释此部分
  486. // btn: {
  487. // refX: "100%",
  488. // refX2: -28,
  489. // // y: 4,
  490. // width: 24,
  491. // height: 18,
  492. // rx: 5,
  493. // ry: 5,
  494. // fill: "rgba(255,255,0,0.01)",
  495. // stroke: "white",
  496. // cursor: "pointer",
  497. // event: "node:delete",
  498. // },
  499. // btnText: {
  500. // fontSize: 14,
  501. // fill: "white",
  502. // text: "x",
  503. // refX: "100%",
  504. // refX2: -19,
  505. // // y: 17,
  506. // cursor: "pointer",
  507. // pointerEvent: "none",
  508. // },
  509. label: {
  510. // refX: 3,
  511. // refY: 2,
  512. refX: 0.5,
  513. refY: 0.85,
  514. fill: "#333",
  515. fontSize: 11,
  516. // fontWeight: "bold",
  517. fontVariant: "small-caps",
  518. },
  519. },
  520. ports: {
  521. groups: {
  522. // 输入链接桩群组定义
  523. in: {
  524. position: "left",
  525. attrs: {
  526. circle: {
  527. r: 2.5,
  528. magnet: true,
  529. stroke: "black",
  530. strokeWidth: 1,
  531. fill: "#fff",
  532. style: {
  533. visibility: true, //默认隐藏,不显示。定位到节点, 才展示
  534. },
  535. },
  536. },
  537. },
  538. // 输出链接桩群组定义
  539. out: {
  540. position: "right",
  541. attrs: {
  542. circle: {
  543. r: 2.5,
  544. magnet: true,
  545. stroke: "black",
  546. // stroke: "#fff",
  547. strokeWidth: 1,
  548. fill: "#fff",
  549. // style: {
  550. // visibility: "hidden", //默认隐藏,不显示。定位到节点, 才展示
  551. // },
  552. },
  553. },
  554. },
  555. },
  556. items: [
  557. {
  558. id: "inport1",
  559. group: "in",
  560. },
  561. {
  562. id: "inport2",
  563. group: "in",
  564. },
  565. {
  566. id: "outport1",
  567. group: "out",
  568. },
  569. {
  570. id: "outport2",
  571. group: "out",
  572. },
  573. ],
  574. },
  575. markup: [
  576. {
  577. tagName: "rect",
  578. selector: "body",
  579. attrs: {
  580. fill: "#fff",
  581. stroke: "#000",
  582. strokeWidth: 2,
  583. },
  584. },
  585. {
  586. tagName: "image",
  587. selector: "image",
  588. },
  589. {
  590. tagName: "text",
  591. selector: "label",
  592. attrs: {
  593. fill: "#333",
  594. textAnchor: "middle",
  595. textVerticalAnchor: "middle",
  596. },
  597. },
  598. // {
  599. // tagName: "g",
  600. // children: [
  601. // {
  602. // tagName: "text",
  603. // selector: "btnText",
  604. // },
  605. // {
  606. // tagName: "rect",
  607. // selector: "btn",
  608. // },
  609. // ],
  610. // },
  611. ],
  612. data: {
  613. nodeName: "",
  614. algonodeId: null,
  615. templateName: "",
  616. templateImage: "",
  617. templateCommand: {
  618. // 1: "echo",
  619. // 2: "{{inputs.parameters.message}}",
  620. // // 2:"\"{{inputs.parameters.message}}\""
  621. },
  622. //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
  623. // templateCommand2: [
  624. // {
  625. // 1:"echo"
  626. // },
  627. // {
  628. // 2:"{{inputs.parameters.message}}"
  629. // },
  630. // ],
  631. templateArgs: {
  632. // 1: "echo",
  633. },
  634. //20211116 新增 根据输入输出模板获取到的输入输出参数名称,类型,描述等
  635. algoparaInput: {
  636. userInput: [],
  637. getInput: [],
  638. }, //包括 userInput [] 和getInput[]
  639. algoparaOutput: [],
  640. //保存输入
  641. algoparaInputargu: {
  642. userInput: [],
  643. getInput: [],
  644. }, //包括 userInput [] 和getInput[]
  645. // algoparaOutAddress: "", //已改为description 无用
  646. algonodeSource: [],
  647. inputsparameters: [
  648. // //此container 需要输入的参数,固定
  649. // {
  650. // name: "message",
  651. // },
  652. // {
  653. // name: "message1",
  654. // },
  655. ],
  656. inputsartifacts: [
  657. // //此container 需要输入的参数,固定
  658. // {
  659. // name: "message",
  660. // path: "",
  661. // },
  662. ],
  663. argumentsparameters: [
  664. // {
  665. // name: "message",
  666. // value: "A",
  667. // },
  668. // //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
  669. // {
  670. // name: "message1",
  671. // value: "A",
  672. // },
  673. ],
  674. argumentsartifacts: [
  675. // //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
  676. // {
  677. // name: "message",
  678. // valuefrom: "A",
  679. // },
  680. ],
  681. outputsparameters: [
  682. // {
  683. // name: "message",
  684. // },
  685. // //此container 输出的参数,固定
  686. // // {
  687. // // name: "message1",
  688. // // },
  689. // // {
  690. // // name: "message2",
  691. // // },
  692. ],
  693. outputsartifacts: [
  694. // //此container 输出的参数,固定
  695. // {
  696. // name: "message",
  697. // path: "",
  698. // },
  699. ],
  700. //获取到的连接线源的数据 连接线的源的输出数据
  701. sourcedatalist: [
  702. // {
  703. // name: "source1",
  704. // from: "", // {{tasks.nodename.outputs.parameters.参数名}}
  705. // },
  706. // {
  707. // name: "source2",
  708. // from: "",
  709. // },
  710. ],
  711. sourceartilist: [
  712. // {
  713. // name: "source2",
  714. // from: "", //{{tasks.nodename.outputs.artifacts.参数名}}
  715. // },
  716. ],
  717. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  718. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  719. },
  720. });
  721. // // 定义边
  722. // Graph.registerConnector(
  723. // "algo-edge",
  724. // (source, target) => {
  725. // const offset = 4;
  726. // const control = 80;
  727. // const v1 = { x: source.x, y: source.y + offset + control };
  728. // const v2 = { x: target.x, y: target.y - offset - control };
  729. // return `M ${source.x} ${source.y}
  730. // L ${source.x} ${source.y + offset}
  731. // C ${v1.x} ${v1.y} ${v2.x} ${v2.y} ${target.x} ${target.y - offset}
  732. // L ${target.x} ${target.y}
  733. // `;
  734. // },
  735. // true
  736. // );
  737. //定义输入节点
  738. Graph.registerNode("template-input", {
  739. inherit: "rect",
  740. width: 90,
  741. height: 80,
  742. attrs: {
  743. body: {
  744. strokeWidth: 1,
  745. stroke: "#d3e3ee",
  746. fill: "#e2c3a0",
  747. rx: 8,
  748. ry: 8,
  749. },
  750. //设置内部添加图片
  751. image: {
  752. width: 36,
  753. height: 36,
  754. refX: 30,
  755. refY: 16,
  756. "xlink:href":
  757. "https://gw.alipayobjects.com/zos/bmw-prod/c55d7ae1-8d20-4585-bd8f-ca23653a4489.svg",
  758. },
  759. label: {
  760. refX: 0.5,
  761. refY: 0.85,
  762. fill: "#333",
  763. fontSize: 11,
  764. // fontWeight: "bold",
  765. fontVariant: "small-caps",
  766. },
  767. },
  768. ports: {
  769. groups: {
  770. // 输入链接桩群组定义
  771. in: {
  772. position: "left",
  773. attrs: {
  774. circle: {
  775. r: 2.5,
  776. magnet: true,
  777. stroke: "black",
  778. strokeWidth: 1,
  779. fill: "#fff",
  780. style: {
  781. visibility: true, //默认隐藏,不显示。定位到节点, 才展示
  782. },
  783. },
  784. },
  785. },
  786. // 输出链接桩群组定义
  787. out: {
  788. position: "right",
  789. attrs: {
  790. circle: {
  791. r: 2.5,
  792. magnet: true,
  793. stroke: "black",
  794. // stroke: "#fff",
  795. strokeWidth: 1,
  796. fill: "#fff",
  797. // style: {
  798. // visibility: "hidden", //默认隐藏,不显示。定位到节点, 才展示
  799. // },
  800. },
  801. },
  802. },
  803. },
  804. items: [
  805. {
  806. id: "inport1",
  807. group: "in",
  808. },
  809. {
  810. id: "inport2",
  811. group: "in",
  812. },
  813. {
  814. id: "outport1",
  815. group: "out",
  816. },
  817. {
  818. id: "outport2",
  819. group: "out",
  820. },
  821. ],
  822. },
  823. markup: [
  824. {
  825. tagName: "rect",
  826. selector: "body",
  827. attrs: {
  828. fill: "#fff",
  829. stroke: "#000",
  830. strokeWidth: 2,
  831. },
  832. },
  833. {
  834. tagName: "image",
  835. selector: "image",
  836. },
  837. {
  838. tagName: "text",
  839. selector: "label",
  840. attrs: {
  841. fill: "#333",
  842. textAnchor: "middle",
  843. textVerticalAnchor: "middle",
  844. },
  845. },
  846. ],
  847. data: {
  848. nodeName: "",
  849. algonodeId: null,
  850. st_dataListvalue: [], //静态数据集选中 文件对应value
  851. dy_dataListvalue: [], //动态数据集选中 文件对应value
  852. fileList: [], //外部上传 文件
  853. allfilemap: [{}], //选中的文件对应的名称及url
  854. },
  855. });
  856. //定义输出节点
  857. Graph.registerNode("template-output", {
  858. inherit: "rect",
  859. width: 90,
  860. height: 80,
  861. attrs: {
  862. body: {
  863. strokeWidth: 1,
  864. stroke: "#d3e3ee",
  865. fill: "#e2c3a0",
  866. rx: 8,
  867. ry: 8,
  868. },
  869. //设置内部添加图片
  870. image: {
  871. width: 36,
  872. height: 36,
  873. refX: 30,
  874. refY: 16,
  875. "xlink:href":
  876. "https://gw.alipayobjects.com/zos/bmw-prod/c55d7ae1-8d20-4585-bd8f-ca23653a4489.svg",
  877. },
  878. label: {
  879. refX: 0.5,
  880. refY: 0.85,
  881. fill: "#333",
  882. fontSize: 11,
  883. // fontWeight: "bold",
  884. fontVariant: "small-caps",
  885. },
  886. },
  887. ports: {
  888. groups: {
  889. // 输入链接桩群组定义
  890. in: {
  891. position: "left",
  892. attrs: {
  893. circle: {
  894. r: 2.5,
  895. magnet: true,
  896. stroke: "black",
  897. strokeWidth: 1,
  898. fill: "#fff",
  899. style: {
  900. visibility: true, //默认隐藏,不显示。定位到节点, 才展示
  901. },
  902. },
  903. },
  904. },
  905. // 输出链接桩群组定义
  906. out: {
  907. position: "right",
  908. attrs: {
  909. circle: {
  910. r: 2.5,
  911. magnet: true,
  912. stroke: "black",
  913. // stroke: "#fff",
  914. strokeWidth: 1,
  915. fill: "#fff",
  916. // style: {
  917. // visibility: "hidden", //默认隐藏,不显示。定位到节点, 才展示
  918. // },
  919. },
  920. },
  921. },
  922. },
  923. items: [
  924. {
  925. id: "inport1",
  926. group: "in",
  927. },
  928. {
  929. id: "inport2",
  930. group: "in",
  931. },
  932. {
  933. id: "outport1",
  934. group: "out",
  935. },
  936. {
  937. id: "outport2",
  938. group: "out",
  939. },
  940. ],
  941. },
  942. markup: [
  943. {
  944. tagName: "rect",
  945. selector: "body",
  946. attrs: {
  947. fill: "#fff",
  948. stroke: "#000",
  949. strokeWidth: 2,
  950. },
  951. },
  952. {
  953. tagName: "image",
  954. selector: "image",
  955. },
  956. {
  957. tagName: "text",
  958. selector: "label",
  959. attrs: {
  960. fill: "#333",
  961. textAnchor: "middle",
  962. textVerticalAnchor: "middle",
  963. },
  964. },
  965. ],
  966. data: {
  967. nodeName: "",
  968. algonodeId: null,
  969. sourcealgocell: null,
  970. },
  971. });
  972. // 初始化画布
  973. const graph = new Graph({
  974. grid: true,
  975. container: document.getElementById("container"),
  976. // width: 1270,
  977. // width: 1200,
  978. // height: 750,
  979. autoResize: true,
  980. panning: {
  981. enabled: true,
  982. },
  983. resizing: {
  984. enabled: true,
  985. },
  986. // model: {},
  987. history: true, //uodo和redo
  988. highlighting: {
  989. nodeAvailable: {
  990. //连线过程中,节点可以被链接时被使用。
  991. name: "className",
  992. args: {
  993. className: "available",
  994. },
  995. },
  996. magnetAvailable: {
  997. //连线过程中,链接桩可以被链接时被使用。
  998. name: "className",
  999. args: {
  1000. className: "available",
  1001. },
  1002. },
  1003. magnetAdsorbed: {
  1004. //连线过程中,自动吸附到链接桩时被使用。
  1005. name: "className",
  1006. args: {
  1007. className: "adsorbed",
  1008. },
  1009. },
  1010. },
  1011. scroller: {
  1012. enabled: true,
  1013. pannable: true,
  1014. minVisibleHeight: 800,
  1015. minVisibleWidth: 800,
  1016. autoResize: true,
  1017. height: 800,
  1018. className: "x6-graph-scroller",
  1019. },
  1020. mousewheel: {
  1021. enabled: true,
  1022. modifiers: ["ctrl", "meta"],
  1023. },
  1024. clipboard: {
  1025. enabled: true,
  1026. useLocalStorage: true,
  1027. },
  1028. keyboard: {
  1029. enabled: true,
  1030. global: true,
  1031. }, //快捷键
  1032. selecting: {
  1033. enabled: true,
  1034. showNodeSelectionBox: true,
  1035. // showEdgeSelectionBox: true,
  1036. }, //选中 ,框选
  1037. //节点与边交互
  1038. translating: {
  1039. restrict: true, //限制节点不能移动超出画布区域
  1040. },
  1041. connecting: {
  1042. snap: true, //连线距离节点或者连接桩 50px 时会触发自动吸附
  1043. allowBlank: false,
  1044. allowLoop: false,
  1045. highlight: true,
  1046. sourceAnchor: {
  1047. //指定源节点的锚点
  1048. name: "bottom",
  1049. },
  1050. targetAnchor: {
  1051. //指定目标节点的锚点
  1052. name: "center",
  1053. },
  1054. connectionPoint: "anchor",
  1055. // connector: "algo-edge",
  1056. createEdge() {
  1057. return graph.createEdge({
  1058. //更新连接边edge样式
  1059. router: {
  1060. // name: "orth",
  1061. name: "er",
  1062. args: {
  1063. offset: "center",
  1064. },
  1065. },
  1066. attrs: {
  1067. line: {
  1068. // strokeDasharray: "5 5", //虚线
  1069. stroke: "#808080",
  1070. strokeWidth: 1,
  1071. targetMarker: {
  1072. name: "block",
  1073. args: {
  1074. size: "6",
  1075. },
  1076. },
  1077. },
  1078. },
  1079. //在指定的位置处,渲染一个删除按钮,点击时删除对应的边。
  1080. tools: {
  1081. name: "button-remove",
  1082. args: { distance: -40 },
  1083. },
  1084. });
  1085. },
  1086. validateMagnet({ magnet }) {
  1087. return magnet.getAttribute("port-group") !== "in";
  1088. },
  1089. validateConnection({
  1090. sourceView,
  1091. targetView,
  1092. sourceMagnet,
  1093. targetMagnet,
  1094. }) {
  1095. // 只能从输出链接桩创建连接
  1096. if (
  1097. !sourceMagnet ||
  1098. sourceMagnet.getAttribute("port-group") === "in"
  1099. ) {
  1100. return false;
  1101. }
  1102. // 只能连接到输入链接桩
  1103. if (
  1104. !targetMagnet ||
  1105. targetMagnet.getAttribute("port-group") !== "in"
  1106. ) {
  1107. return false;
  1108. }
  1109. // 判断目标链接桩是否可连接
  1110. const portId = targetMagnet.getAttribute("port");
  1111. const node = targetView.cell;
  1112. const port = node.getPort(portId);
  1113. if (port && port.connected) {
  1114. // if (port && port.connected) {
  1115. return false;
  1116. }
  1117. return true;
  1118. },
  1119. },
  1120. });
  1121. // 创建 Graph 的实例
  1122. // const graph = new Graph({
  1123. // container: document.getElementById("container"),
  1124. // width: 1380,
  1125. // height: 750,
  1126. // background: {
  1127. // // color: "#f7f7f4", //设置画布背景颜色
  1128. // color: "#ffffff",
  1129. // },
  1130. // grid: {
  1131. // size: 8,
  1132. // visible: true,
  1133. // }, //网格
  1134. // history: true, //uodo和redo
  1135. // //滚动条
  1136. // // scroller: {
  1137. // // enabled: true,
  1138. // // // pannable: true,
  1139. // // // pageVisible: true,
  1140. // // // pageBreak: false,
  1141. // // },
  1142. // mousewheel: {
  1143. // enabled: true,
  1144. // modifiers: ["ctrl", "meta"],
  1145. // },
  1146. // // clipboard: true, //剪切板
  1147. // clipboard: {
  1148. // enabled: true,
  1149. // useLocalStorage: true,
  1150. // },
  1151. // keyboard: {
  1152. // enabled: true,
  1153. // global: true,
  1154. // }, //快捷键
  1155. // selecting: {
  1156. // enabled: true,
  1157. // showNodeSelectionBox: true,
  1158. // // showEdgeSelectionBox: true,
  1159. // }, //选中 ,框选
  1160. // //节点与边交互
  1161. // translating: {
  1162. // restrict: true, //限制节点不能移动超出画布区域
  1163. // },
  1164. // //连线规则
  1165. // connecting: {
  1166. // snap: true,
  1167. // allowBlank: false, //不允许连接到画布空白位置
  1168. // allowMulti: false, //不允许在相同节点之间创建多条边
  1169. // },
  1170. // });
  1171. this.graph = graph;
  1172. this.history = graph.history; //Redo Undo
  1173. // this.graph.toJSON()
  1174. // const dnd = new Addon.Dnd({
  1175. // target: this.graph,
  1176. // scaled: false,
  1177. // animation: true,
  1178. // getDragNode(node) {
  1179. // // 这里返回一个新的节点作为拖拽节点
  1180. // return graph.createNode({
  1181. // width: 60,
  1182. // height: 20,
  1183. // attrs: {
  1184. // label: {
  1185. // text: "Rect",
  1186. // fill: "#6a6c8a",
  1187. // },
  1188. // body: {
  1189. // stroke: "#31d0c6",
  1190. // strokeWidth: 2,
  1191. // },
  1192. // },
  1193. // });
  1194. // },
  1195. // getDropNode(node) {
  1196. // const { width, height } = node.size();
  1197. // // 返回一个新的节点作为实际放置到画布上的节点
  1198. // return node.clone().size(width * 3, height * 3);
  1199. // },
  1200. // });
  1201. // this.dnd = dnd;
  1202. // // console.log("this.dnd");
  1203. // // console.log(this.dnd);
  1204. //绑定快捷键 ctrl+c ctrl+v
  1205. this.graph.bindKey("ctrl+c", () => {
  1206. const cells = this.graph.getSelectedCells();
  1207. if (cells.length) {
  1208. this.graph.copy(cells);
  1209. }
  1210. return false;
  1211. });
  1212. this.graph.bindKey("ctrl+v", () => {
  1213. if (!this.graph.isClipboardEmpty()) {
  1214. const cells = this.graph.paste({ offset: 32 });
  1215. this.graph.cleanSelection();
  1216. this.graph.select(cells);
  1217. }
  1218. return false;
  1219. });
  1220. this.graph.bindKey("backspace", () => {
  1221. const cells = graph.getSelectedCells();
  1222. if (cells.length) {
  1223. graph.removeCells(cells);
  1224. }
  1225. });
  1226. //节点删除 边未完成
  1227. graph.on("node:delete", ({ view, e }) => {
  1228. e.stopPropagation();
  1229. view.cell.remove();
  1230. console.log("node:delete");
  1231. });
  1232. //删除边
  1233. graph.on("edge:delete", ({ view, e }) => {
  1234. e.stopPropagation();
  1235. view.cell.remove();
  1236. });
  1237. //delete
  1238. graph.bindKey("backspace", () => {
  1239. const cells = graph.getSelectedCells();
  1240. if (cells.length) {
  1241. graph.removeCells(cells);
  1242. }
  1243. });
  1244. //20210804 涉及到一些通过 边连接 时传递的参数 及赋值行为,在边取消是要进行及时更改
  1245. graph.on("cell:click", ({ e, cell, view }) => {
  1246. // reset();
  1247. // node.attr("body/stroke", "orange");
  1248. console.log("单击节点成功");
  1249. this.cell = cell;
  1250. //条件节点;
  1251. if (cell.shape == "polygon") {
  1252. // this.newConWatchVisible = true;
  1253. // this.conNodeConfigVisi = true;
  1254. this.$nextTick(() => {
  1255. this.conNodeConfigVisi = true;
  1256. this.experimentVisi = false;
  1257. this.nodeConfigVisi = false;
  1258. this.$refs.newConNodeConfig.init(
  1259. cell.getData().sourcedatalist,
  1260. cell.getData().sourceartilist,
  1261. cell.getData().inputcondition,
  1262. cell
  1263. );
  1264. // this.$refs.newConWatch.init(
  1265. // cell.getData().sourcedatalist,
  1266. // cell.getData().inputcondition
  1267. // );
  1268. });
  1269. } else if (cell.shape == "template-node") {
  1270. // console.log(cell.getData());
  1271. // console.log(this.workflowName);
  1272. // console.log(cell.id);
  1273. this.$nextTick(() => {
  1274. this.nodeConfigVisi = true;
  1275. this.conNodeConfigVisi = false;
  1276. this.experimentVisi = false;
  1277. this.$refs.newNodeConfig.init1(
  1278. cell.getData(),
  1279. cell,
  1280. this.workflowName,
  1281. this.idTemplateNameMap,
  1282. this.workflowStatus
  1283. );
  1284. // if (this.$refs.newNodeConfig) {
  1285. // // console.log("出现了");
  1286. // this.$refs.newNodeConfig.init1(cell.getData(), cell);
  1287. // }
  1288. });
  1289. } else if (cell.shape == "template-input") {
  1290. // console.log(cell);
  1291. // console.log(cell.getData());
  1292. // console.log(this.workflowName);
  1293. // console.log(cell.id);
  1294. this.inputNodeConVisible = true;
  1295. this.$nextTick(() => {
  1296. this.$refs.inputNodeConfig.init(cell);
  1297. });
  1298. // addOrUpdateHandle(id) {
  1299. // this.addOrUpdateVisible = true;
  1300. // this.$nextTick(() => {
  1301. // this.$refs.addOrUpdate.init(id);
  1302. // });
  1303. // },
  1304. } else if (cell.shape == "template-output") {
  1305. // console.log(cell.getData());
  1306. // console.log(this.workflowName);
  1307. // console.log(cell.id);\
  1308. this.outputNodeConVisible = true;
  1309. if (cell.getData().sourcealgocell != null) {
  1310. //当前输出节点有 前序 算法节点
  1311. this.$nextTick(() => {
  1312. this.$refs.outputNodeConfig.init(
  1313. cell,
  1314. cell.getData(),
  1315. cell.getData().sourcealgocell.getData(),
  1316. this.workflowName,
  1317. this.workflowStatus
  1318. );
  1319. });
  1320. } else {
  1321. this.$nextTick(() => {
  1322. this.$refs.outputNodeConfig.init1(
  1323. cell,
  1324. cell.getData(),
  1325. this.workflowName
  1326. );
  1327. });
  1328. }
  1329. }
  1330. });
  1331. //20211008 blank 画布空白区域
  1332. graph.on("blank:click", ({ e, x, y }) => {
  1333. // reset();
  1334. // node.attr("body/stroke", "orange");
  1335. console.log("单击空白区域成功");
  1336. this.$nextTick(() => {
  1337. this.conNodeConfigVisi = false;
  1338. this.experimentVisi = true;
  1339. this.nodeConfigVisi = false;
  1340. this.$refs.experConfig.init();
  1341. // this.visible = true;
  1342. // this.$refs.experConfig.init();
  1343. });
  1344. });
  1345. //双击节点 弹窗
  1346. // graph.on("cell:dblclick", ({ e, cell, view }) => {
  1347. // //条件节点
  1348. // if (cell.shape == "polygon") {
  1349. // // this.newConWatchVisible = true;
  1350. // this.$nextTick(() => {
  1351. // this.newConWatchVisible = true;
  1352. // this.$refs.newConWatch.init(
  1353. // cell.getData().sourcedatalist,
  1354. // cell.getData().inputcondition
  1355. // );
  1356. // });
  1357. // console.log("双击成功");
  1358. // }
  1359. // //普通rect节点
  1360. // });
  1361. //20210730
  1362. //边发生连接 条件节点
  1363. graph.on(
  1364. "edge:connected",
  1365. ({ isNew, edge, previousCell, previousPort, currentCell }) => {
  1366. if (isNew) {
  1367. // 对新创建的边进行插入数据库等持久化操作
  1368. console.log("新建边:" + edge.id);
  1369. const source = edge.getSourceCell();
  1370. console.log(edge);
  1371. console.log(edge.getSourceCell());
  1372. console.log(edge.getTargetCell());
  1373. console.log(currentCell);
  1374. //添加任意一条边后,都需要获取源节点的输出参数列表,并将其写入到目标节点中
  1375. //源节点为 rect,目标节点为rect
  1376. if (
  1377. source.shape == "template-node" &&
  1378. currentCell.shape == "template-node"
  1379. ) {
  1380. //20211118
  1381. var salgonodeSource = currentCell.getData().algonodeSource;
  1382. var flag = 0;
  1383. for (var i = 0; i < salgonodeSource.length; i++) {
  1384. // if (salgonodeSource[i].cellId == source.cellId) {
  1385. // flag = 1;
  1386. // }
  1387. if (salgonodeSource[i].id == source.id) {
  1388. flag = 1;
  1389. }
  1390. }
  1391. console.log("flag " + flag);
  1392. if (flag == 0) {
  1393. currentCell.setData({
  1394. algonodeSource: salgonodeSource.concat(source),
  1395. });
  1396. }
  1397. console.log(currentCell.getData().algonodeSource);
  1398. //20210922 更改并保存 注释
  1399. // const sourcedata = source.getData();
  1400. // currentCell.setData({
  1401. // sourcedatalist: sourcedata.outputsparameters,
  1402. // });
  1403. // //此处已更改
  1404. // console.log("源节点为 template-node,目标节点为template-node");
  1405. // console.log(edge.shape);
  1406. // //仅为传递到 节点参数设置栏便于展示
  1407. // //20210819 是否可以根据 nodeConfigVisi 来选择是否刷新
  1408. // this.$nextTick(() => {
  1409. // // this.nodeConfigVisi = true;
  1410. // // this.conNodeConfigVisi = false;
  1411. // // this.experimentVisi = false;
  1412. // this.$refs.newNodeConfig.changeSourcedata(
  1413. // currentCell.getData(),
  1414. // currentCell
  1415. // );
  1416. // });
  1417. // console.log(
  1418. // "源节点为 template-node,目标节点为template-node 222"
  1419. // );
  1420. // const sourcedata = source.getData();
  1421. // var soutputsparameters = sourcedata.outputsparameters;
  1422. // var soutputsartifacts = sourcedata.outputsartifacts;
  1423. // for (var i = 0; i < soutputsparameters.length; i++) {
  1424. // soutputsparameters[i].from =
  1425. // "{{tasks." +
  1426. // sourcedata.nodeName +
  1427. // ".outputs.parameters." +
  1428. // soutputsparameters[i].name +
  1429. // "}}";
  1430. // }
  1431. // for (var i = 0; i < soutputsartifacts.length; i++) {
  1432. // soutputsartifacts[i].from =
  1433. // "{{tasks." +
  1434. // sourcedata.nodeName +
  1435. // ".outputs.artifacts." +
  1436. // soutputsartifacts[i].name +
  1437. // "}}";
  1438. // }
  1439. // console.log("soutputsparameters,soutputsartifacts");
  1440. // console.log(soutputsparameters);
  1441. // console.log(soutputsartifacts);
  1442. // //添加数据的方式 ---追加
  1443. // //var newArr = arr.concat(arr2); concat()方法生成了一个新的数组,并不改变原来的数组。
  1444. // const currsourcedatalist = currentCell.getData().sourcedatalist;
  1445. // const currsourceartilist = currentCell.getData().sourceartilist;
  1446. // currentCell.setData({
  1447. // sourcedatalist: currsourcedatalist.concat(soutputsparameters),
  1448. // sourceartilist: currsourceartilist.concat(soutputsartifacts),
  1449. // });
  1450. //此处已更改
  1451. console.log("源节点为 template-node,目标节点为template-node");
  1452. console.log(edge.shape);
  1453. //仅为传递到 节点参数设置栏便于展示
  1454. //20210819 是否可以根据 nodeConfigVisi 来选择是否刷新
  1455. this.$nextTick(() => {
  1456. // this.nodeConfigVisi = true;
  1457. // this.conNodeConfigVisi = false;
  1458. // this.experimentVisi = false;
  1459. this.$refs.newNodeConfig.changeSourcedata(
  1460. currentCell.getData(),
  1461. currentCell
  1462. );
  1463. });
  1464. }
  1465. //源节点为 rect,目标节点为 polygon
  1466. if (
  1467. source.shape == "template-node" &&
  1468. currentCell.shape == "polygon"
  1469. ) {
  1470. const sourcedata = source.getData();
  1471. // currentCell.setData({
  1472. // sourcedatalist: sourcedata.outputsparameters,
  1473. // });
  1474. var soutputsparameters = sourcedata.outputsparameters;
  1475. var soutputsartifacts = sourcedata.outputsartifacts;
  1476. for (var i = 0; i < soutputsparameters.length; i++) {
  1477. soutputsparameters[i].from =
  1478. "{{tasks." +
  1479. sourcedata.nodeName +
  1480. ".outputs.parameters." +
  1481. soutputsparameters[i].paraname +
  1482. "}}";
  1483. }
  1484. for (var i = 0; i < soutputsartifacts.length; i++) {
  1485. soutputsartifacts[i].from =
  1486. "{{tasks." +
  1487. sourcedata.nodeName +
  1488. ".outputs.partifacts." +
  1489. soutputsartifacts[i].paraname +
  1490. "}}";
  1491. }
  1492. currentCell.setData({
  1493. sourcedatalist: currentCell
  1494. .getData()
  1495. .sourcedatalist.concat(soutputsparameters),
  1496. });
  1497. currentCell.setData({
  1498. sourceartilist: currentCell
  1499. .getData()
  1500. .sourceartilist.concat(soutputsartifacts),
  1501. });
  1502. // console.log(currentCell.getData());
  1503. // console.log("源节点为 template-node,目标节点为polygon");
  1504. this.$nextTick(() => {
  1505. // this.nodeConfigVisi = true;
  1506. // this.conNodeConfigVisi = false;
  1507. // this.experimentVisi = false;
  1508. this.$refs.newConNodeConfig.changeSourcedata(
  1509. currentCell.getData(),
  1510. currentCell
  1511. );
  1512. });
  1513. // console.log("源节点为 template-node,目标节点为polygon");
  1514. }
  1515. //源节点为 polygon,目标节点为 polygon
  1516. //20210802 此处进行条件节点连接条件节点 ,改变目标节点的条件,与原条件进行 && 。可先进行判断目标节点的条件是否为空,若为空,直接复制,若不为空 ,则&&
  1517. //取反等 均为字符串拼接
  1518. //那么在用户输入条件语句时,也要判断节点条件是否为空,若为空,赋值,若不为空,&&
  1519. //源节点为 polygon
  1520. if (source.shape == "polygon") {
  1521. //边的起始节点类型为条件节点
  1522. if (edge.source.port == "righttrue") {
  1523. // if(edge.getSourcePortId=="righttrue"){
  1524. // source.data("truetargetid",currentCell.id);
  1525. //20210730 zhang 赋值成功
  1526. source.setData({ truetargetid: currentCell.id });
  1527. //还需确定删除连接边之后 回复空值
  1528. } else if (edge.source.port == "bottomfalse") {
  1529. //边的目标节点为条件节点
  1530. source.setData({ falsetargetid: currentCell.id });
  1531. }
  1532. }
  1533. //如果源节点为输入节点,目的节点为 算法节点
  1534. if (
  1535. source.shape == "template-input" &&
  1536. currentCell.shape == "template-node"
  1537. ) {
  1538. console.log("源节点为 template-input,目标节点为template-node");
  1539. console.log(edge.shape);
  1540. //仅为传递到 节点参数设置栏便于展示
  1541. //20210819 是否可以根据 nodeConfigVisi 来选择是否刷新
  1542. console.log(source);
  1543. console.log(source.allfilemap);
  1544. // currentCell.setData({inputnodefilemap:source.getData().allfilemap});
  1545. this.$nextTick(() => {
  1546. // this.nodeConfigVisi = true;
  1547. // this.conNodeConfigVisi = false;
  1548. // this.experimentVisi = false;
  1549. this.$refs.newNodeConfig.changeinputnodemap(
  1550. currentCell.getData(),
  1551. currentCell,
  1552. source.getData().allfilemap
  1553. );
  1554. });
  1555. }
  1556. //如果源节点为算法节点,目的节点为输入节点
  1557. if (
  1558. source.shape == "template-node" &&
  1559. currentCell.shape == "template-output"
  1560. ) {
  1561. console.log("源节点为 template-node,目标节点为template-output");
  1562. var curcelldata = currentCell.getData();
  1563. curcelldata.sourcealgocell = source;
  1564. this.graph.getCellById(currentCell.id).setData(curcelldata);
  1565. this.$nextTick(() => {
  1566. // this.nodeConfigVisi = true;
  1567. // this.conNodeConfigVisi = false;
  1568. // this.experimentVisi = false;
  1569. this.$refs.outputNodeConfig.changeoutputsourcealgo(
  1570. currentCell,
  1571. currentCell.getData(),
  1572. source,
  1573. source.getData()
  1574. );
  1575. });
  1576. }
  1577. }
  1578. }
  1579. );
  1580. //依据条件判断的 赋值修改操作
  1581. //20210922
  1582. //边被移除 -----?
  1583. graph.on(
  1584. "edge:removed",
  1585. ({ edge, previousCell, previousPort, currentCell, index }) => {
  1586. console.log("edge:removed");
  1587. // //20210923 将edge.getSourceCell() 以及previousCell 替换为edge.source,将currentCell替换为edge.target
  1588. // //20210923 edge.source以及edge.target获取到的cell 并非为template-node 类型节点,修改为先回去源及目标节点Id,根据节点Id获取节点信息
  1589. // //previousCell, currentCell 均为undefined
  1590. // //edge.getSourceCell() 以及 edge.getTargetCell() 均为null
  1591. // // console.log(previousCell);//undefined
  1592. // // const source = edge.getSourceCell();
  1593. // // const source = edge.source;
  1594. // // const target = edge.target;
  1595. // const sourceId = edge.getSourceCellId();
  1596. // const source = graph.getCellById(sourceId);
  1597. // const cellId = edge.getTargetCellId();
  1598. // const target = graph.getCellById(cellId);
  1599. // console.log(edge.source);
  1600. // console.log(source.shape);
  1601. // console.log(target.shape);
  1602. // //删除边时,获取源节点的输出参数列表,匹配目标节点的sourcedatalist及sourceartilist
  1603. // //源节点为 rect,目标节点为rect
  1604. // if (
  1605. // source.shape == "template-node" &&
  1606. // target.shape == "template-node"
  1607. // ) {
  1608. // const sourcedata = source.getData();
  1609. // //获取目标节点当前 sourcedatalist及sourceartilist
  1610. // var targetsourpara = target.getData().sourcedatalist;
  1611. // var targetsourarti = target.getData().sourceartilist;
  1612. // //获取源节点的输出参数outputsparameters outputsartifacts
  1613. // const soutputsparameters = sourcedata.outputsparameters;
  1614. // const soutputsartifacts = sourcedata.outputsartifacts;
  1615. // //遍历源节点的输出参数,在目标节点的 中删除对应的参数
  1616. // for (var i = 0; i < soutputsparameters.length; i++) {
  1617. // let strfrom =
  1618. // "{{tasks." +
  1619. // sourcedata.nodeName +
  1620. // ".outputs.parameters." +
  1621. // soutputsparameters[i].name +
  1622. // "}}";
  1623. // //acData.find(x => x.sid == id);
  1624. // let index = targetsourpara.find((item) => item.from === strfrom);
  1625. // targetsourpara.splice(index, 1);
  1626. // }
  1627. // for (var i = 0; i < soutputsartifacts.length; i++) {
  1628. // let strfrom =
  1629. // "{{tasks." +
  1630. // sourcedata.nodeName +
  1631. // ".outputs.partifacts." +
  1632. // soutputsartifacts[i].name +
  1633. // "}}";
  1634. // let index = targetsourarti.find((item) => item.from === strfrom);
  1635. // targetsourarti.splice(index, 1);
  1636. // }
  1637. // target.setData({
  1638. // sourcedatalist: targetsourpara,
  1639. // sourceartilist: targetsourarti,
  1640. // });
  1641. // //此处已更改
  1642. // console.log("源节点为 template-node,目标节点为template-node");
  1643. // console.log(edge.shape);
  1644. // //仅为传递到 节点参数设置栏便于展示
  1645. // //20210819 是否可以根据 nodeConfigVisi 来选择是否刷新
  1646. // this.$nextTick(() => {
  1647. // // this.nodeConfigVisi = true;
  1648. // // this.conNodeConfigVisi = false;
  1649. // // this.experimentVisi = false;
  1650. // this.$refs.newNodeConfig.changeSourcedata(target.getData(), target);
  1651. // });
  1652. // console.log("源节点为 template-node,目标节点为template-node 222");
  1653. // }
  1654. // //源节点为 rect,目标节点为 polygon
  1655. // if (source.shape == "template-node" && target.shape == "polygon") {
  1656. // console.log("源节点为 rect,目标节点为 polygon");
  1657. // const sourcedata = source.getData();
  1658. // //获取目标节点当前 sourcedatalist及sourceartilist
  1659. // var targetsourpara = target.getData().sourcedatalist;
  1660. // var targetsourarti = target.getData().sourceartilist;
  1661. // //获取源节点的输出参数outputsparameters outputsartifacts
  1662. // const soutputsparameters = sourcedata.outputsparameters;
  1663. // const soutputsartifacts = sourcedata.outputsartifacts;
  1664. // //遍历源节点的输出参数,在目标节点的 中删除对应的参数
  1665. // for (var i = 0; i < soutputsparameters.length; i++) {
  1666. // let strfrom =
  1667. // "{{tasks." +
  1668. // sourcedata.nodeName +
  1669. // ".outputs.parameters." +
  1670. // soutputsparameters[i].name +
  1671. // "}}";
  1672. // //acData.find(x => x.sid == id);
  1673. // console.log("strfrom:" + strfrom);
  1674. // let index = targetsourpara.find((item) => item.from === strfrom);
  1675. // console.log("index" + index);
  1676. // targetsourpara.splice(index, 1);
  1677. // }
  1678. // for (var i = 0; i < soutputsartifacts.length; i++) {
  1679. // let strfrom =
  1680. // "{{tasks." +
  1681. // sourcedata.nodeName +
  1682. // ".outputs.partifacts." +
  1683. // soutputsartifacts[i].name +
  1684. // "}}";
  1685. // console.log("strfrom:" + strfrom);
  1686. // // let index = targetsourarti.find(item => item.from == strfrom);
  1687. // let index = targetsourarti.findIndex(
  1688. // (item) => item.from == strfrom
  1689. // );
  1690. // console.log("index");
  1691. // console.log(index);
  1692. // console.log(targetsourarti);
  1693. // targetsourarti.splice(index, 1);
  1694. // }
  1695. // target.setData({
  1696. // sourcedatalist: targetsourpara,
  1697. // sourceartilist: targetsourarti,
  1698. // });
  1699. // console.log(target.getData());
  1700. // console.log("源节点为 template-node,目标节点为polygon");
  1701. // this.$nextTick(() => {
  1702. // // this.nodeConfigVisi = true;
  1703. // // this.conNodeConfigVisi = false;
  1704. // // this.experimentVisi = false;
  1705. // this.$refs.newConNodeConfig.changeSourcedata(
  1706. // target.getData(),
  1707. // target
  1708. // );
  1709. // });
  1710. // console.log("源节点为 template-node,目标节点为polygon");
  1711. // }
  1712. // //源节点为 polygon,目标节点为 polygon
  1713. // //20210802 此处进行条件节点连接条件节点 ,改变目标节点的条件,与原条件进行 && 。可先进行判断目标节点的条件是否为空,若为空,直接复制,若不为空 ,则&&
  1714. // //取反等 均为字符串拼接
  1715. // //那么在用户输入条件语句时,也要判断节点条件是否为空,若为空,赋值,若不为空,&&
  1716. // //源节点为 polygon
  1717. // if (source.shape == "polygon") {
  1718. // //边的起始节点类型为条件节点
  1719. // if (edge.source.port == "righttrue") {
  1720. // // if(edge.getSourcePortId=="righttrue"){
  1721. // // source.data("truetargetid",currentCell.id);
  1722. // //20210730 zhang 赋值成功
  1723. // source.setData({ truetargetid: target.id });
  1724. // //还需确定删除连接边之后 回复空值
  1725. // } else if (edge.source.port == "bottomfalse") {
  1726. // //边的目标节点为条件节点
  1727. // source.setData({ falsetargetid: target.id });
  1728. // }
  1729. // }
  1730. }
  1731. );
  1732. //20210803 边 可删
  1733. Graph.registerConnector(
  1734. "curve",
  1735. (sourcePoint, targetPoint) => {
  1736. const path = new Path();
  1737. path.appendSegment(Path.createSegment("M", sourcePoint));
  1738. path.appendSegment(
  1739. Path.createSegment(
  1740. "C",
  1741. sourcePoint.x,
  1742. sourcePoint.y + 180,
  1743. targetPoint.x,
  1744. targetPoint.y - 180,
  1745. targetPoint.x,
  1746. targetPoint.y
  1747. )
  1748. );
  1749. return path.serialize();
  1750. },
  1751. true
  1752. );
  1753. //20210715 zhang 该圆角矩形大小 及颜色合适
  1754. const rect1 = new Shape.Rect({
  1755. id: "node3",
  1756. x: 60,
  1757. y: 60,
  1758. width: 140,
  1759. height: 40,
  1760. label: "rect",
  1761. zIndex: 3,
  1762. data: {
  1763. templateName: "echo1",
  1764. templateImage: "alpine:3.7",
  1765. templateCommand: {
  1766. 1: "echo",
  1767. 2: "{{inputs.parameters.message}}",
  1768. // 2:"\"{{inputs.parameters.message}}\""
  1769. },
  1770. //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
  1771. // templateCommand2: [
  1772. // {
  1773. // 1:"echo"
  1774. // },
  1775. // {
  1776. // 2:"{{inputs.parameters.message}}"
  1777. // },
  1778. // ],
  1779. templateArgs: {
  1780. // 1: "echo",
  1781. },
  1782. inputsparameters: [
  1783. //此container 需要输入的参数,固定
  1784. {
  1785. name: "message",
  1786. },
  1787. ],
  1788. argumentsparameters: [
  1789. //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
  1790. {
  1791. name: "message",
  1792. value: "A",
  1793. },
  1794. ],
  1795. outputsparameters: [
  1796. //此container 输出的参数,固定
  1797. {
  1798. name: "message",
  1799. },
  1800. {
  1801. name: "message1",
  1802. },
  1803. ],
  1804. },
  1805. markup: [
  1806. {
  1807. tagName: "rect",
  1808. selector: "body",
  1809. },
  1810. {
  1811. tagName: "text",
  1812. selector: "label",
  1813. },
  1814. {
  1815. tagName: "g",
  1816. children: [
  1817. {
  1818. tagName: "text",
  1819. selector: "btnText",
  1820. },
  1821. {
  1822. tagName: "rect",
  1823. selector: "btn",
  1824. },
  1825. ],
  1826. },
  1827. ],
  1828. attrs: {
  1829. body: {
  1830. fill: "#ffffff",
  1831. // stroke: '#5dc3fd',
  1832. stroke: "#5dc3fd",
  1833. rx: 16,
  1834. ry: 16,
  1835. },
  1836. //20210729 删除功能
  1837. btn: {
  1838. refX: "100%",
  1839. refX2: -28,
  1840. // y: 4,
  1841. width: 24,
  1842. height: 18,
  1843. rx: 10,
  1844. ry: 10,
  1845. fill: "rgba(255,255,0,0.01)",
  1846. stroke: "red",
  1847. cursor: "pointer",
  1848. event: "node:delete",
  1849. },
  1850. btnText: {
  1851. fontSize: 14,
  1852. fill: "red",
  1853. text: "x",
  1854. refX: "100%",
  1855. refX2: -19,
  1856. // y: 17,
  1857. cursor: "pointer",
  1858. pointerEvent: "none",
  1859. },
  1860. label: {
  1861. text: "World",
  1862. fill: "#333",
  1863. fontSize: 18,
  1864. fontWeight: "bold",
  1865. fontVariant: "small-caps",
  1866. },
  1867. },
  1868. ports: {
  1869. groups: {
  1870. // 输入链接桩群组定义
  1871. in: {
  1872. position: "left",
  1873. attrs: {
  1874. circle: {
  1875. r: 4,
  1876. magnet: true,
  1877. stroke: "#31d0c6",
  1878. strokeWidth: 2,
  1879. fill: "#fff",
  1880. },
  1881. },
  1882. },
  1883. // 输出链接桩群组定义
  1884. out: {
  1885. position: "right",
  1886. attrs: {
  1887. circle: {
  1888. r: 4,
  1889. magnet: true,
  1890. stroke: "#31d0c6",
  1891. strokeWidth: 2,
  1892. fill: "#fff",
  1893. },
  1894. },
  1895. },
  1896. },
  1897. items: [
  1898. {
  1899. id: "port1",
  1900. group: "in",
  1901. },
  1902. {
  1903. id: "port2",
  1904. group: "out",
  1905. },
  1906. ],
  1907. },
  1908. });
  1909. const condition = new Shape.Polygon({
  1910. width: 120,
  1911. height: 120,
  1912. attrs: {
  1913. text: { text: "条件节点", fill: "condition" },
  1914. body: {
  1915. // fill: "#b6e3e7",
  1916. stroke: "#b6e3e7",
  1917. refPoints: "0,10 10,0 20,10 10,20",
  1918. // refY: 0.3,
  1919. },
  1920. label: {
  1921. fontSize: 16,
  1922. fill: "#333",
  1923. fontWeight: 800,
  1924. // refY: 0.8,
  1925. },
  1926. },
  1927. data: {
  1928. nodeName: "condition1",
  1929. truetargetid: "",
  1930. falsetargetid: "",
  1931. inputcondition: "true",
  1932. sourcedatalist: [
  1933. // {
  1934. // name: "source1",
  1935. // from: "",
  1936. // },
  1937. // {
  1938. // name: "source2",
  1939. // from: "",
  1940. // },
  1941. ],
  1942. sourceartilist: [
  1943. // {
  1944. // name: "source1",
  1945. // from: "",
  1946. // },
  1947. // {
  1948. // name: "source2",
  1949. // from: "",
  1950. // },
  1951. ],
  1952. },
  1953. ports: {
  1954. groups: {
  1955. in: {
  1956. position: "top",
  1957. attrs: {
  1958. circle: {
  1959. r: 4,
  1960. magnet: true,
  1961. stroke: "#5F95FF",
  1962. strokeWidth: 2,
  1963. fill: "#fff",
  1964. // style: {
  1965. // visibility: "hidden",
  1966. // },
  1967. },
  1968. },
  1969. },
  1970. right: {
  1971. position: "right",
  1972. label: {
  1973. position: "top",
  1974. },
  1975. attrs: {
  1976. circle: {
  1977. r: 4,
  1978. magnet: true,
  1979. stroke: "#5F95FF",
  1980. strokeWidth: 2,
  1981. fill: "#fff",
  1982. // style: {
  1983. // visibility: "hidden",
  1984. // },
  1985. },
  1986. },
  1987. },
  1988. bottom: {
  1989. position: "bottom",
  1990. label: {
  1991. position: "right",
  1992. },
  1993. attrs: {
  1994. circle: {
  1995. r: 4,
  1996. magnet: true,
  1997. stroke: "#5F95FF",
  1998. strokeWidth: 2,
  1999. fill: "#fff",
  2000. // style: {
  2001. // visibility: "hidden",
  2002. // },
  2003. },
  2004. },
  2005. },
  2006. left: {
  2007. position: "left",
  2008. attrs: {
  2009. circle: {
  2010. r: 4,
  2011. magnet: true,
  2012. stroke: "#5F95FF",
  2013. strokeWidth: 2,
  2014. fill: "#fff",
  2015. // style: {
  2016. // visibility: "hidden",
  2017. // },
  2018. },
  2019. },
  2020. },
  2021. },
  2022. items: [
  2023. {
  2024. //通过id辨别
  2025. group: "in",
  2026. },
  2027. {
  2028. id: "righttrue",
  2029. group: "right",
  2030. attrs: {
  2031. text: { text: "是" },
  2032. },
  2033. },
  2034. {
  2035. id: "bottomfalse",
  2036. group: "bottom",
  2037. attrs: {
  2038. text: { text: "否" },
  2039. },
  2040. },
  2041. {
  2042. group: "left",
  2043. },
  2044. ],
  2045. },
  2046. });
  2047. //条件节点
  2048. const conditionnode = new Shape.Polygon({
  2049. width: 80,
  2050. height: 80,
  2051. attrs: {
  2052. text: { text: "条件节点", fill: "condition" },
  2053. body: {
  2054. // fill: "#b6e3e7",
  2055. stroke: "#b6e3e7",
  2056. refPoints: "0,10 10,0 20,10 10,20",
  2057. // refY: 0.3,
  2058. },
  2059. label: {
  2060. text: "条件节点",
  2061. fontSize: 8,
  2062. fill: "#333",
  2063. fontWeight: 800,
  2064. // refY: 0.8,
  2065. },
  2066. },
  2067. data: {
  2068. truetargetid: "",
  2069. falsetargetid: "",
  2070. inputcondition: "true",
  2071. sourcedatalist: [
  2072. {
  2073. // name: "source1",
  2074. // from: "",
  2075. },
  2076. ],
  2077. sourceartilist: [
  2078. {
  2079. // name: "source1",
  2080. // from: "",
  2081. },
  2082. ],
  2083. },
  2084. ports: {
  2085. groups: {
  2086. in: {
  2087. position: "top",
  2088. attrs: {
  2089. circle: {
  2090. r: 2,
  2091. magnet: true,
  2092. stroke: "#5F95FF",
  2093. strokeWidth: 2,
  2094. fill: "#fff",
  2095. // style: {
  2096. // visibility: "hidden",
  2097. // },
  2098. },
  2099. },
  2100. },
  2101. out: {
  2102. position: "right",
  2103. label: {
  2104. position: "top",
  2105. },
  2106. attrs: {
  2107. circle: {
  2108. r: 2,
  2109. magnet: true,
  2110. stroke: "#5F95FF",
  2111. strokeWidth: 2,
  2112. fill: "#fff",
  2113. // style: {
  2114. // visibility: "hidden",
  2115. // },
  2116. },
  2117. },
  2118. },
  2119. out1: {
  2120. position: "bottom",
  2121. label: {
  2122. position: "right",
  2123. },
  2124. attrs: {
  2125. circle: {
  2126. r: 2,
  2127. magnet: true,
  2128. stroke: "#5F95FF",
  2129. strokeWidth: 2,
  2130. fill: "#fff",
  2131. // style: {
  2132. // visibility: "hidden",
  2133. // },
  2134. },
  2135. },
  2136. },
  2137. left: {
  2138. position: "left",
  2139. attrs: {
  2140. circle: {
  2141. r: 2,
  2142. magnet: true,
  2143. stroke: "#5F95FF",
  2144. strokeWidth: 2,
  2145. fill: "#fff",
  2146. // style: {
  2147. // visibility: "hidden",
  2148. // },
  2149. },
  2150. },
  2151. },
  2152. },
  2153. items: [
  2154. {
  2155. //通过id辨别
  2156. id: "top",
  2157. group: "in",
  2158. },
  2159. {
  2160. id: "righttrue",
  2161. group: "out",
  2162. attrs: {
  2163. text: { text: "是" },
  2164. },
  2165. },
  2166. {
  2167. id: "bottomfalse",
  2168. group: "out1",
  2169. attrs: {
  2170. text: { text: "否" },
  2171. },
  2172. },
  2173. {
  2174. group: "left",
  2175. },
  2176. ],
  2177. },
  2178. });
  2179. this.nodedata.push(conditionnode);
  2180. //20210727 zhang 自定義中文
  2181. // Graph.registerNode("selectnode", Rect);
  2182. // //20211012 注释
  2183. // ///20210720 zhang 左侧ui栏及拖拽 -----已变为左侧组件点击后画布生成
  2184. // const stencil = new Addon.Stencil({
  2185. // title: "组件库",
  2186. // target: graph,
  2187. // search(cell, keyword) {
  2188. // return cell.shape.indexOf(keyword) !== -1;
  2189. // },
  2190. // placeholder: "Search by shape name",
  2191. // notFoundText: "Not Found",
  2192. // collapsable: true,
  2193. // stencilGraphWidth: 240,
  2194. // stencilGraphHeight: 600,
  2195. // layoutOptions: {
  2196. // columns: 1,
  2197. // center: true,
  2198. // dx: 30,
  2199. // dy: 5,
  2200. // },
  2201. // groups: [
  2202. // {
  2203. // name: "group1",
  2204. // title: "分类1",
  2205. // },
  2206. // {
  2207. // name: "group2",
  2208. // title: "分类2",
  2209. // // collapsable: false,
  2210. // },
  2211. // ],
  2212. // });
  2213. // this.$refs.stencilContainer.appendChild(stencil.container);
  2214. //20210907 zhang 左侧组件栏设置节点信息 从数据库读入时需要设置节点包含的相关pod 信息
  2215. // stencil.load([c2.clone(), r2, r3, c3], "group2");
  2216. // //20211012 注释
  2217. // stencil.load(
  2218. // [
  2219. // cellz3,
  2220. // generate_artifact,
  2221. // consume_artifact,
  2222. // cellz3.clone(),
  2223. // cellz3.clone(),
  2224. // ],
  2225. // "group1"
  2226. // );
  2227. // stencil.load(
  2228. // [
  2229. // cellz3.clone(),
  2230. // cellz3.clone(),
  2231. // cellz3.clone(),
  2232. // cellz3.clone(),
  2233. // cellz3.clone(),
  2234. // condition,
  2235. // ],
  2236. // "group2"
  2237. // );
  2238. // stencil.load([c2.clone(), r2, r3, c3, c3.clone()], "group2");
  2239. // stencil.load([c2.clone(), r2, r3, c3], "group2");
  2240. //创建节点
  2241. const consume_artifact = this.graph.createNode({
  2242. // width: 170,
  2243. // height: 30,
  2244. shape: "template-node",
  2245. // label: "consume_artifact",
  2246. attrs: {
  2247. label: {
  2248. text: "consume_artifact",
  2249. },
  2250. body: {
  2251. // stroke: "#2CB9FF",
  2252. // fill: "#2CB9FF",
  2253. fill: "#d3ebf3",
  2254. },
  2255. // body: {
  2256. // stroke: "#DA2625",
  2257. // fill: "#DA2625",
  2258. // },
  2259. image: {
  2260. "xlink:href":
  2261. "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
  2262. // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
  2263. //可放图标
  2264. },
  2265. },
  2266. data: {
  2267. nodeName: "zhang_consume_artifac",
  2268. templateName: "print-message",
  2269. templateImage: "alpine:latest",
  2270. templateCommand: {
  2271. 1: "sh",
  2272. 2: "-c",
  2273. // 2:"\"{{inputs.parameters.message}}\""
  2274. },
  2275. //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
  2276. // templateCommand2: [
  2277. // {
  2278. // 1:"echo"
  2279. // },
  2280. // {
  2281. // 2:"{{inputs.parameters.message}}"
  2282. // },
  2283. // ],
  2284. templateArgs: {
  2285. 1: "cat /tmp/message",
  2286. },
  2287. inputsparameters: [],
  2288. inputsartifacts: [
  2289. //此container 需要输入的参数,固定
  2290. {
  2291. name: "message",
  2292. path: "/tmp/message",
  2293. },
  2294. ],
  2295. //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
  2296. //应对应input中的各项参数设置对应参数
  2297. argumentsparameters: [],
  2298. argumentsartifacts: [
  2299. //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
  2300. {
  2301. name: "message",
  2302. valuefrom: "{{tasks.whalesay.outputs.artifacts.hello-art}}",
  2303. },
  2304. ],
  2305. outputsparameters: [],
  2306. outputsartifacts: [],
  2307. //获取到的连接线源的数据 连接线的源的输出数据
  2308. sourcedatalist: [
  2309. // {
  2310. // name: "source1",
  2311. // },
  2312. // {
  2313. // name: "source2",
  2314. // },
  2315. ],
  2316. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  2317. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  2318. },
  2319. });
  2320. // cellz4.setData({ templateName: "zhang" });
  2321. const generate_artifact = graph.createNode({
  2322. // width: 170,
  2323. // height: 30,
  2324. shape: "template-node",
  2325. attrs: {
  2326. label: {
  2327. text: "generate_artifact",
  2328. },
  2329. image: {
  2330. "xlink:href":
  2331. "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
  2332. },
  2333. },
  2334. data: {
  2335. nodeName: "zhang_generate_artifact",
  2336. templateName: "whalesay",
  2337. templateImage: "docker/whalesay:latest",
  2338. templateCommand: {
  2339. 1: "sh",
  2340. 2: "-c",
  2341. // 2:"\"{{inputs.parameters.message}}\""
  2342. },
  2343. //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
  2344. // templateCommand2: [
  2345. // {
  2346. // 1:"echo"
  2347. // },
  2348. // {
  2349. // 2:"{{inputs.parameters.message}}"
  2350. // },
  2351. // ],
  2352. templateArgs: {
  2353. 1: "sleep 1; cowsay hello world | tee /tmp/hello_world.txt",
  2354. },
  2355. inputsparameters: [],
  2356. inputsartifacts: [],
  2357. //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
  2358. //应对应input中的各项参数设置对应参数
  2359. argumentsparameters: [],
  2360. argumentsartifacts: [],
  2361. outputsparameters: [],
  2362. outputsartifacts: [
  2363. //此container 输出的参数,固定
  2364. {
  2365. name: "hello-art",
  2366. path: "/tmp/hello_world.txt",
  2367. },
  2368. ],
  2369. //获取到的连接线源的数据 连接线的源的输出数据
  2370. sourcedatalist: [
  2371. // {
  2372. // name: "source1",
  2373. // },
  2374. // {
  2375. // name: "source2",
  2376. // },
  2377. ],
  2378. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  2379. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  2380. },
  2381. });
  2382. // 轮廓识别代码示例,需重新更改节点数据格式
  2383. const zdocker_test = this.graph.createNode({
  2384. // width: 170,
  2385. // height: 30,
  2386. shape: "template-node",
  2387. // label: "consume_artifact",
  2388. attrs: {
  2389. label: {
  2390. text: "zdockertest",
  2391. },
  2392. body: {
  2393. // stroke: "#2CB9FF",
  2394. // fill: "#2CB9FF",
  2395. fill: "#d3ebf3",
  2396. },
  2397. // body: {
  2398. // stroke: "#DA2625",
  2399. // fill: "#DA2625",
  2400. // },
  2401. image: {
  2402. "xlink:href":
  2403. "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
  2404. // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
  2405. //可放图标
  2406. },
  2407. },
  2408. data: {
  2409. nodeName: "zdockertest",
  2410. templateName: "print-message",
  2411. templateImage: "zvinjodocker/zdockertest1:20211011",
  2412. templateCommand: {
  2413. // 1: "sh",
  2414. // 2: "-c",
  2415. // 2:"\"{{inputs.parameters.message}}\""
  2416. },
  2417. //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
  2418. // templateCommand2: [
  2419. // {
  2420. // 1:"echo"
  2421. // },
  2422. // {
  2423. // 2:"{{inputs.parameters.message}}"
  2424. // },
  2425. // ],
  2426. templateArgs: {
  2427. // 1: "cat /tmp/message",
  2428. },
  2429. inputsparameters: [],
  2430. inputsartifacts: [
  2431. //此container 需要输入的参数,固定
  2432. // {
  2433. // name: "message",
  2434. // path: "/tmp/message",
  2435. // },
  2436. ],
  2437. //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
  2438. //应对应input中的各项参数设置对应参数
  2439. argumentsparameters: [],
  2440. argumentsartifacts: [
  2441. //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
  2442. // {
  2443. // name: "message",
  2444. // valuefrom: "{{tasks.whalesay.outputs.artifacts.hello-art}}",
  2445. // },
  2446. ],
  2447. outputsparameters: [],
  2448. outputsartifacts: [],
  2449. //获取到的连接线源的数据 连接线的源的输出数据
  2450. sourcedatalist: [
  2451. // {
  2452. // name: "source1",
  2453. // },
  2454. // {
  2455. // name: "source2",
  2456. // },
  2457. ],
  2458. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  2459. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  2460. },
  2461. });
  2462. const contourTask1 = this.graph.createNode({
  2463. // width: 170,
  2464. // height: 30,
  2465. shape: "template-node",
  2466. // label: "consume_artifact",
  2467. attrs: {
  2468. label: {
  2469. text: "contourTask1",
  2470. },
  2471. body: {
  2472. // stroke: "#2CB9FF",
  2473. // fill: "#2CB9FF",
  2474. fill: "#d3ebf3",
  2475. },
  2476. // body: {
  2477. // stroke: "#DA2625",
  2478. // fill: "#DA2625",
  2479. // },
  2480. image: {
  2481. "xlink:href":
  2482. "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
  2483. // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
  2484. //可放图标
  2485. },
  2486. },
  2487. data: {
  2488. nodeName: "contourTask1",
  2489. templateName: "contourTask1",
  2490. templateImage: "zvinjodocker/contous_task1:20211014",
  2491. templateCommand: {
  2492. // 1: "sh",
  2493. // 2: "-c",
  2494. // 2:"\"{{inputs.parameters.message}}\""
  2495. },
  2496. //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
  2497. // templateCommand2: [
  2498. // {
  2499. // 1:"echo"
  2500. // },
  2501. // {
  2502. // 2:"{{inputs.parameters.message}}"
  2503. // },
  2504. // ],
  2505. templateArgs: {
  2506. // 1: "cat /tmp/message",
  2507. },
  2508. inputsparameters: [],
  2509. inputsartifacts: [
  2510. //此container 需要输入的参数,固定
  2511. // {
  2512. // name: "message",
  2513. // path: "/tmp/message",
  2514. // },
  2515. ],
  2516. //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
  2517. //应对应input中的各项参数设置对应参数
  2518. argumentsparameters: [],
  2519. argumentsartifacts: [
  2520. //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
  2521. // {
  2522. // name: "message",
  2523. // valuefrom: "{{tasks.whalesay.outputs.artifacts.hello-art}}",
  2524. // },
  2525. ],
  2526. outputsparameters: [],
  2527. outputsartifacts: [
  2528. {
  2529. paraname: "thresh",
  2530. paradesc: "",
  2531. paratype: "",
  2532. // path: "/myapps/thresh1.png",
  2533. valuefrom: "/myapps/thresh1.png",
  2534. },
  2535. {
  2536. paraname: "contours",
  2537. // path: "/myapps/contours.png",
  2538. paradesc: "",
  2539. paratype: "",
  2540. valuefrom: "/myapps/contours.png",
  2541. },
  2542. ],
  2543. //获取到的连接线源的数据 连接线的源的输出数据
  2544. sourcedatalist: [
  2545. // {
  2546. // name: "source1",
  2547. // },
  2548. // {
  2549. // name: "source2",
  2550. // },
  2551. ],
  2552. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  2553. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  2554. },
  2555. });
  2556. const contourTask2 = this.graph.createNode({
  2557. // width: 170,
  2558. // height: 30,
  2559. shape: "template-node",
  2560. attrs: {
  2561. label: {
  2562. text: "contourTask2",
  2563. },
  2564. body: {
  2565. // stroke: "#2CB9FF",
  2566. // fill: "#2CB9FF",
  2567. fill: "#d3ebf3",
  2568. },
  2569. image: {
  2570. "xlink:href":
  2571. "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
  2572. // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
  2573. //可放图标
  2574. },
  2575. },
  2576. data: {
  2577. nodeName: "contourTask2",
  2578. templateName: "contourTask2",
  2579. templateImage: "zvinjodocker/contours_task2:20211014",
  2580. templateCommand: {},
  2581. templateArgs: {},
  2582. inputsparameters: [],
  2583. inputsartifacts: [
  2584. {
  2585. paraname: "thresh",
  2586. parapath: "/myapps/thresh1.png",
  2587. paradesc: "",
  2588. },
  2589. {
  2590. paraname: "contours",
  2591. parapath: "/myapps/contours.png",
  2592. paradesc: "",
  2593. },
  2594. ],
  2595. //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
  2596. //应对应input中的各项参数设置对应参数
  2597. argumentsparameters: [],
  2598. argumentsartifacts: [
  2599. {
  2600. paraname: "thresh",
  2601. valuefrom: "{{tasks.contourTask1.outputs.artifacts.thresh}}",
  2602. fileurls: [],
  2603. },
  2604. {
  2605. paraname: "contours",
  2606. valuefrom: "{{tasks.contourTask1.outputs.artifacts.contours}}",
  2607. fileurls: [],
  2608. },
  2609. ],
  2610. outputsparameters: [],
  2611. outputsartifacts: [
  2612. {
  2613. paraname: "contours0",
  2614. // path: "/myapps/contours[0].npy",
  2615. valuefrom: "/myapps/contours[0].npy",
  2616. paradesc: "",
  2617. paratype: "",
  2618. },
  2619. {
  2620. paraname: "res",
  2621. // path: "/myapps/res1.png",
  2622. valuefrom: "/myapps/res1.png",
  2623. paradesc: "",
  2624. paratype: "",
  2625. },
  2626. ],
  2627. //获取到的连接线源的数据 连接线的源的输出数据
  2628. sourcedatalist: [],
  2629. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  2630. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  2631. },
  2632. });
  2633. const contourTask3 = this.graph.createNode({
  2634. // width: 170,
  2635. // height: 30,
  2636. shape: "template-node",
  2637. // label: "consume_artifact",
  2638. attrs: {
  2639. label: {
  2640. text: "contourTask3",
  2641. },
  2642. body: {
  2643. // stroke: "#2CB9FF",
  2644. // fill: "#2CB9FF",
  2645. fill: "#d3ebf3",
  2646. },
  2647. image: {
  2648. "xlink:href":
  2649. "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
  2650. // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
  2651. //可放图标
  2652. },
  2653. },
  2654. data: {
  2655. nodeName: "contourTask3",
  2656. templateName: "contourTask3",
  2657. templateImage: "zvinjodocker/contours_task3:20211015",
  2658. templateCommand: {},
  2659. templateArgs: {},
  2660. inputsparameters: [],
  2661. inputsartifacts: [
  2662. {
  2663. paraname: "contours0",
  2664. parapath: "/myapps/contours[0].npy",
  2665. paradesc: "",
  2666. },
  2667. ],
  2668. //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
  2669. //应对应input中的各项参数设置对应参数
  2670. argumentsparameters: [],
  2671. argumentsartifacts: [
  2672. {
  2673. paraname: "contours0",
  2674. valuefrom: "{{tasks.contourTask2.outputs.artifacts.contours0}}",
  2675. fileurls: [],
  2676. },
  2677. ],
  2678. outputsparameters: [],
  2679. outputsartifacts: [],
  2680. //获取到的连接线源的数据 连接线的源的输出数据
  2681. sourcedatalist: [],
  2682. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  2683. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  2684. },
  2685. });
  2686. const contourApproximate1 = this.graph.createNode({
  2687. // width: 170,
  2688. // height: 30,
  2689. shape: "template-node",
  2690. // label: "consume_artifact",
  2691. attrs: {
  2692. label: {
  2693. text: "contourApproximate1",
  2694. },
  2695. body: {
  2696. // stroke: "#2CB9FF",
  2697. // fill: "#2CB9FF",
  2698. fill: "#d3ebf3",
  2699. },
  2700. image: {
  2701. "xlink:href":
  2702. "https://gw.alipayobjects.com/zos/bmw-prod/c36fe7cb-dc24-4854-aeb5-88d8dc36d52e.svg",
  2703. // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
  2704. //可放图标
  2705. },
  2706. },
  2707. data: {
  2708. nodeName: "contourApproximate1",
  2709. templateName: "contourApproximate1",
  2710. templateImage: "zvinjodocker/contour_approximate1:20211015",
  2711. templateCommand: {},
  2712. templateArgs: {},
  2713. inputsparameters: [],
  2714. inputsartifacts: [],
  2715. //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
  2716. //应对应input中的各项参数设置对应参数
  2717. argumentsparameters: [],
  2718. argumentsartifacts: [],
  2719. outputsparameters: [],
  2720. outputsartifacts: [
  2721. {
  2722. paraname: "approxCnt",
  2723. // path: "/myapps/approx_cnt.npy",
  2724. valuefrom: "/myapps/approx_cnt.npy",
  2725. paradesc: "",
  2726. paratype: "",
  2727. },
  2728. {
  2729. paraname: "approxRes",
  2730. // path: "/myapps/approx_res.png",
  2731. valuefrom: "/myapps/approx_res.png",
  2732. paradesc: "",
  2733. paratype: "",
  2734. },
  2735. ],
  2736. //获取到的连接线源的数据 连接线的源的输出数据
  2737. sourcedatalist: [],
  2738. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  2739. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  2740. },
  2741. });
  2742. console.log("创建节点 contour_approximate1成功");
  2743. const contourApproximate2 = this.graph.createNode({
  2744. // width: 170,
  2745. // height: 30,
  2746. shape: "template-node",
  2747. // label: "consume_artifact",
  2748. attrs: {
  2749. label: {
  2750. text: "contourApproximate2",
  2751. },
  2752. body: {
  2753. // stroke: "#2CB9FF",
  2754. // fill: "#2CB9FF",
  2755. fill: "#d3ebf3",
  2756. },
  2757. // body: {
  2758. // stroke: "#DA2625",
  2759. // fill: "#DA2625",
  2760. // },
  2761. image: {
  2762. "xlink:href":
  2763. "https://gw.alipayobjects.com/zos/bmw-prod/c55d7ae1-8d20-4585-bd8f-ca23653a4489.svg",
  2764. // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
  2765. //可放图标
  2766. },
  2767. },
  2768. data: {
  2769. nodeName: "contourApproximate2",
  2770. templateName: "contourApproximate2",
  2771. templateImage: "zvinjodocker/contour_approximate2:20211015",
  2772. templateCommand: {
  2773. // 1: "sh",
  2774. // 2: "-c",
  2775. // 2:"\"{{inputs.parameters.message}}\""
  2776. },
  2777. //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
  2778. // templateCommand2: [
  2779. // {
  2780. // 1:"echo"
  2781. // },
  2782. // {
  2783. // 2:"{{inputs.parameters.message}}"
  2784. // },
  2785. // ],
  2786. templateArgs: {
  2787. // 1: "cat /tmp/message",
  2788. },
  2789. inputsparameters: [],
  2790. inputsartifacts: [
  2791. //此container 需要输入的参数,固定
  2792. // {
  2793. // name: "message",
  2794. // path: "/tmp/message",
  2795. // },
  2796. {
  2797. paraname: "approxCnt",
  2798. parapath: "/myapps/approx_cnt.npy",
  2799. paradesc: "",
  2800. },
  2801. ],
  2802. //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
  2803. //应对应input中的各项参数设置对应参数
  2804. argumentsparameters: [],
  2805. argumentsartifacts: [
  2806. //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
  2807. // {
  2808. // name: "message",
  2809. // valuefrom: "{{tasks.whalesay.outputs.artifacts.hello-art}}",
  2810. // },
  2811. {
  2812. paraname: "approxCnt",
  2813. valuefrom:
  2814. "{{tasks.contourApproximate1.outputs.artifacts.approxCnt}}",
  2815. fileurls: [],
  2816. },
  2817. ],
  2818. outputsparameters: [],
  2819. outputsartifacts: [
  2820. // {
  2821. // name: "thresh",
  2822. // path: "/myapps/thresh1.png",
  2823. // },
  2824. // {
  2825. // name: "contours",
  2826. // path: "/myapps/contours.png",
  2827. // },
  2828. {
  2829. paraname: "approxRes2",
  2830. // path: "/myapps/approx_res2.png",
  2831. valuefrom: "/myapps/approx_res2.png",
  2832. paradesc: "",
  2833. paratype: "",
  2834. },
  2835. ],
  2836. //获取到的连接线源的数据 连接线的源的输出数据
  2837. sourcedatalist: [
  2838. // {
  2839. // name: "source1",
  2840. // },
  2841. // {
  2842. // name: "source2",
  2843. // },
  2844. ],
  2845. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  2846. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  2847. },
  2848. });
  2849. console.log("创建节点 contour_approximate2成功");
  2850. const contourRect1 = this.graph.createNode({
  2851. // width: 170,
  2852. // height: 30,
  2853. shape: "template-node",
  2854. // label: "consume_artifact",
  2855. attrs: {
  2856. label: {
  2857. text: "contourRect1",
  2858. },
  2859. body: {
  2860. // stroke: "#2CB9FF",
  2861. // fill: "#2CB9FF",
  2862. fill: "#d3ebf3",
  2863. },
  2864. // body: {
  2865. // stroke: "#DA2625",
  2866. // fill: "#DA2625",
  2867. // },
  2868. image: {
  2869. "xlink:href":
  2870. "https://gw.alipayobjects.com/zos/bmw-prod/dc1ced06-417d-466f-927b-b4a4d3265791.svg",
  2871. // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
  2872. //可放图标
  2873. },
  2874. },
  2875. data: {
  2876. nodeName: "contourRect1",
  2877. templateName: "contourRect1",
  2878. templateImage: "zvinjodocker/contours_rect1:20211015",
  2879. templateCommand: {
  2880. // 1: "sh",
  2881. // 2: "-c",
  2882. // 2:"\"{{inputs.parameters.message}}\""
  2883. },
  2884. //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
  2885. // templateCommand2: [
  2886. // {
  2887. // 1:"echo"
  2888. // },
  2889. // {
  2890. // 2:"{{inputs.parameters.message}}"
  2891. // },
  2892. // ],
  2893. templateArgs: {
  2894. // 1: "cat /tmp/message",
  2895. },
  2896. inputsparameters: [],
  2897. inputsartifacts: [
  2898. //此container 需要输入的参数,固定
  2899. // {
  2900. // name: "message",
  2901. // path: "/tmp/message",
  2902. // },
  2903. ],
  2904. //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
  2905. //应对应input中的各项参数设置对应参数
  2906. argumentsparameters: [],
  2907. argumentsartifacts: [
  2908. //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
  2909. // {
  2910. // name: "message",
  2911. // valuefrom: "{{tasks.whalesay.outputs.artifacts.hello-art}}",
  2912. // },
  2913. ],
  2914. outputsparameters: [],
  2915. outputsartifacts: [
  2916. // {
  2917. // name: "thresh",
  2918. // path: "/myapps/thresh1.png",
  2919. // },
  2920. // {
  2921. // name: "contours",
  2922. // path: "/myapps/contours.png",
  2923. // },
  2924. {
  2925. paraname: "cnt",
  2926. // path: "/myapps/contour_rect_cnt.npy",
  2927. valuefrom: "/myapps/contour_rect_cnt.npy",
  2928. paradesc: "",
  2929. paratype: "",
  2930. },
  2931. {
  2932. paraname: "contourRect",
  2933. // path: "/myapps/contour_rect.png",
  2934. valuefrom: "/myapps/contour_rect.png",
  2935. paradesc: "",
  2936. paratype: "",
  2937. },
  2938. ],
  2939. //获取到的连接线源的数据 连接线的源的输出数据
  2940. sourcedatalist: [
  2941. // {
  2942. // name: "source1",
  2943. // },
  2944. // {
  2945. // name: "source2",
  2946. // },
  2947. ],
  2948. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  2949. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  2950. },
  2951. });
  2952. console.log("创建节点 contour_rect1成功");
  2953. const contourCircle2 = this.graph.createNode({
  2954. // width: 170,
  2955. // height: 30,
  2956. shape: "template-node",
  2957. // label: "consume_artifact",
  2958. attrs: {
  2959. label: {
  2960. text: "contourCircle2",
  2961. },
  2962. body: {
  2963. // stroke: "#2CB9FF",
  2964. // fill: "#2CB9FF",
  2965. fill: "#d3ebf3",
  2966. },
  2967. // body: {
  2968. // stroke: "#DA2625",
  2969. // fill: "#DA2625",
  2970. // },
  2971. image: {
  2972. "xlink:href":
  2973. "https://gw.alipayobjects.com/zos/bmw-prod/687b6cb9-4b97-42a6-96d0-34b3099133ac.svg",
  2974. // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
  2975. //可放图标
  2976. },
  2977. },
  2978. data: {
  2979. nodeName: "contourCircle2",
  2980. templateName: "contourCircle2",
  2981. templateImage: "zvinjodocker/contours_circle2:20211015",
  2982. templateCommand: {
  2983. // 1: "sh",
  2984. // 2: "-c",
  2985. // 2:"\"{{inputs.parameters.message}}\""
  2986. },
  2987. //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
  2988. // templateCommand2: [
  2989. // {
  2990. // 1:"echo"
  2991. // },
  2992. // {
  2993. // 2:"{{inputs.parameters.message}}"
  2994. // },
  2995. // ],
  2996. templateArgs: {
  2997. // 1: "cat /tmp/message",
  2998. },
  2999. inputsparameters: [],
  3000. inputsartifacts: [
  3001. //此container 需要输入的参数,固定
  3002. // {
  3003. // name: "message",
  3004. // path: "/tmp/message",
  3005. // },
  3006. {
  3007. paraname: "contourRect",
  3008. parapath: "/myapps/contour_rect.png",
  3009. paradesc: "",
  3010. },
  3011. {
  3012. paraname: "cnt",
  3013. parapath: "/myapps/contour_rect_cnt.npy",
  3014. paradesc: "",
  3015. },
  3016. ],
  3017. //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
  3018. //应对应input中的各项参数设置对应参数
  3019. argumentsparameters: [],
  3020. argumentsartifacts: [
  3021. //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
  3022. // {
  3023. // name: "message",
  3024. // valuefrom: "{{tasks.whalesay.outputs.artifacts.hello-art}}",
  3025. // },
  3026. {
  3027. paraname: "contourRect",
  3028. valuefrom: "{{tasks.contourRect1.outputs.artifacts.contourRect}}",
  3029. fileurls: [],
  3030. },
  3031. {
  3032. paraname: "cnt",
  3033. valuefrom: "{{tasks.contourRect1.outputs.artifacts.cnt}}",
  3034. fileurls: [],
  3035. },
  3036. ],
  3037. outputsparameters: [],
  3038. outputsartifacts: [
  3039. // {
  3040. // name: "thresh",
  3041. // path: "/myapps/thresh1.png",
  3042. // },
  3043. // {
  3044. // name: "contours",
  3045. // path: "/myapps/contours.png",
  3046. // },
  3047. {
  3048. paraname: "contourCircle",
  3049. valuefrom: "contour_circle.png",
  3050. // path: "contour_circle.png",
  3051. paradesc: "",
  3052. paratype: "",
  3053. },
  3054. ],
  3055. //获取到的连接线源的数据 连接线的源的输出数据
  3056. sourcedatalist: [
  3057. // {
  3058. // name: "source1",
  3059. // },
  3060. // {
  3061. // name: "source2",
  3062. // },
  3063. ],
  3064. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  3065. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  3066. },
  3067. });
  3068. // console.log("创建节点 contour_circle2成功");
  3069. console.log("创建节点 algoinputnode");
  3070. const dataInputnode = this.graph.createNode({
  3071. // width: 170,
  3072. // height: 30,
  3073. shape: "template-input",
  3074. // label: "consume_artifact",
  3075. attrs: {
  3076. label: {
  3077. text: "dataInputnode",
  3078. },
  3079. body: {
  3080. // stroke: "#2CB9FF",
  3081. // fill: "#2CB9FF",
  3082. fill: "#e2c3a0",
  3083. },
  3084. // body: {
  3085. // stroke: "#DA2625",
  3086. // fill: "#DA2625",
  3087. // },
  3088. image: {
  3089. "xlink:href":
  3090. "https://gw.alipayobjects.com/zos/bmw-prod/687b6cb9-4b97-42a6-96d0-34b3099133ac.svg",
  3091. // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
  3092. //可放图标
  3093. },
  3094. },
  3095. data: {
  3096. nodeName: "dataInputnode",
  3097. templateName: "dataInputnode",
  3098. st_dataListvalue: [], //静态数据集选中 文件对应value
  3099. dy_dataListvalue: [], //动态数据集选中 文件对应value
  3100. fileList: [], //外部上传 文件
  3101. allfilemap: null, //选中的文件对应的名称及url
  3102. },
  3103. });
  3104. const dataOutputnode = this.graph.createNode({
  3105. // width: 170,
  3106. // height: 30,
  3107. shape: "template-output",
  3108. // label: "consume_artifact",
  3109. attrs: {
  3110. label: {
  3111. text: "dataOutputnode",
  3112. },
  3113. body: {
  3114. // stroke: "#2CB9FF",
  3115. // fill: "#2CB9FF",
  3116. fill: "#e2c3a0",
  3117. },
  3118. // body: {
  3119. // stroke: "#DA2625",
  3120. // fill: "#DA2625",
  3121. // },
  3122. image: {
  3123. "xlink:href":
  3124. "https://gw.alipayobjects.com/zos/bmw-prod/687b6cb9-4b97-42a6-96d0-34b3099133ac.svg",
  3125. // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
  3126. //可放图标
  3127. },
  3128. },
  3129. data: {
  3130. nodeName: "dataOutputnode",
  3131. templateName: "dataOutputnode",
  3132. sourcealgocell: null, //输出节点的前一个节点的结果
  3133. },
  3134. });
  3135. //20211012 zhang
  3136. console.log("nodedata");
  3137. // console.log(this.nodedata)
  3138. this.nodedata.push(consume_artifact);
  3139. this.nodedata.push(generate_artifact);
  3140. this.nodedata.push(zdocker_test);
  3141. this.nodedata.push(contourTask1);
  3142. this.nodedata.push(contourTask2);
  3143. this.nodedata.push(contourTask3);
  3144. this.nodedata.push(contourApproximate1);
  3145. this.nodedata.push(contourApproximate2);
  3146. this.nodedata.push(contourRect1);
  3147. this.nodedata.push(contourCircle2);
  3148. //数据输入 和 结果输出节点
  3149. this.nodedata.push(dataInputnode);
  3150. this.nodedata.push(dataOutputnode);
  3151. console.log(this.nodedata);
  3152. //设置布局左右可拖动
  3153. let me = this;
  3154. me.dragControllerDiv();
  3155. console.log("yu");
  3156. },
  3157. methods: {
  3158. initGraph(info) {
  3159. //修改当前画布
  3160. //查询画布数据,导入画布
  3161. this.workflowId = info.workflowId;
  3162. this.graph.fromJSON(JSON.parse(info.graphJson).cells);
  3163. console.log("fromJson"+info.graphJson)
  3164. console.log(JSON.parse(info.graphJson).cells)
  3165. },
  3166. createGraph() {
  3167. const graph = new Graph({
  3168. grid: true,
  3169. container: document.getElementById("container"),
  3170. // width: 1270,
  3171. // width: 1200,
  3172. // height: 750,
  3173. autoResize: true,
  3174. // panning: {
  3175. // enabled: true,
  3176. // },
  3177. resizing: {
  3178. enabled: true,
  3179. },
  3180. // model: {},
  3181. history: true, //uodo和redo
  3182. highlighting: {
  3183. nodeAvailable: {
  3184. //连线过程中,节点可以被链接时被使用。
  3185. name: "className",
  3186. args: {
  3187. className: "available",
  3188. },
  3189. },
  3190. magnetAvailable: {
  3191. //连线过程中,链接桩可以被链接时被使用。
  3192. name: "className",
  3193. args: {
  3194. className: "available",
  3195. },
  3196. },
  3197. magnetAdsorbed: {
  3198. //连线过程中,自动吸附到链接桩时被使用。
  3199. name: "className",
  3200. args: {
  3201. className: "adsorbed",
  3202. },
  3203. },
  3204. },
  3205. scroller: {
  3206. enabled: true,
  3207. pannable: true,
  3208. },
  3209. mousewheel: {
  3210. enabled: true,
  3211. modifiers: ["ctrl", "meta"],
  3212. },
  3213. clipboard: {
  3214. enabled: true,
  3215. useLocalStorage: true,
  3216. },
  3217. keyboard: {
  3218. enabled: true,
  3219. global: true,
  3220. }, //快捷键
  3221. selecting: {
  3222. enabled: true,
  3223. showNodeSelectionBox: true,
  3224. // showEdgeSelectionBox: true,
  3225. }, //选中 ,框选
  3226. //节点与边交互
  3227. translating: {
  3228. restrict: true, //限制节点不能移动超出画布区域
  3229. },
  3230. connecting: {
  3231. snap: true, //连线距离节点或者连接桩 50px 时会触发自动吸附
  3232. allowBlank: false,
  3233. allowLoop: false,
  3234. highlight: true,
  3235. sourceAnchor: {
  3236. //指定源节点的锚点
  3237. name: "bottom",
  3238. },
  3239. targetAnchor: {
  3240. //指定目标节点的锚点
  3241. name: "center",
  3242. },
  3243. connectionPoint: "anchor",
  3244. // connector: "algo-edge",
  3245. createEdge() {
  3246. return graph.createEdge({
  3247. //更新连接边edge样式
  3248. router: {
  3249. // name: "orth",
  3250. name: "er",
  3251. args: {
  3252. offset: "center",
  3253. },
  3254. },
  3255. attrs: {
  3256. line: {
  3257. // strokeDasharray: "5 5", //虚线
  3258. stroke: "#808080",
  3259. strokeWidth: 1,
  3260. targetMarker: {
  3261. name: "block",
  3262. args: {
  3263. size: "6",
  3264. },
  3265. },
  3266. },
  3267. },
  3268. //在指定的位置处,渲染一个删除按钮,点击时删除对应的边。
  3269. tools: {
  3270. name: "button-remove",
  3271. args: { distance: -40 },
  3272. },
  3273. });
  3274. },
  3275. validateMagnet({ magnet }) {
  3276. return magnet.getAttribute("port-group") !== "in";
  3277. },
  3278. validateConnection({
  3279. sourceView,
  3280. targetView,
  3281. sourceMagnet,
  3282. targetMagnet,
  3283. }) {
  3284. // 只能从输出链接桩创建连接
  3285. if (
  3286. !sourceMagnet ||
  3287. sourceMagnet.getAttribute("port-group") === "in"
  3288. ) {
  3289. return false;
  3290. }
  3291. // 只能连接到输入链接桩
  3292. if (
  3293. !targetMagnet ||
  3294. targetMagnet.getAttribute("port-group") !== "in"
  3295. ) {
  3296. return false;
  3297. }
  3298. // 判断目标链接桩是否可连接
  3299. const portId = targetMagnet.getAttribute("port");
  3300. const node = targetView.cell;
  3301. const port = node.getPort(portId);
  3302. if (port && port.connected) {
  3303. // if (port && port.connected) {
  3304. return false;
  3305. }
  3306. return true;
  3307. },
  3308. },
  3309. });
  3310. // 创建 Graph 的实例
  3311. // const graph = new Graph({
  3312. // container: document.getElementById("container"),
  3313. // width: 1380,
  3314. // height: 750,
  3315. // background: {
  3316. // // color: "#f7f7f4", //设置画布背景颜色
  3317. // color: "#ffffff",
  3318. // },
  3319. // grid: {
  3320. // size: 8,
  3321. // visible: true,
  3322. // }, //网格
  3323. // history: true, //uodo和redo
  3324. // //滚动条
  3325. // // scroller: {
  3326. // // enabled: true,
  3327. // // // pannable: true,
  3328. // // // pageVisible: true,
  3329. // // // pageBreak: false,
  3330. // // },
  3331. // mousewheel: {
  3332. // enabled: true,
  3333. // modifiers: ["ctrl", "meta"],
  3334. // },
  3335. // // clipboard: true, //剪切板
  3336. // clipboard: {
  3337. // enabled: true,
  3338. // useLocalStorage: true,
  3339. // },
  3340. // keyboard: {
  3341. // enabled: true,
  3342. // global: true,
  3343. // }, //快捷键
  3344. // selecting: {
  3345. // enabled: true,
  3346. // showNodeSelectionBox: true,
  3347. // // showEdgeSelectionBox: true,
  3348. // }, //选中 ,框选
  3349. // //节点与边交互
  3350. // translating: {
  3351. // restrict: true, //限制节点不能移动超出画布区域
  3352. // },
  3353. // //连线规则
  3354. // connecting: {
  3355. // snap: true,
  3356. // allowBlank: false, //不允许连接到画布空白位置
  3357. // allowMulti: false, //不允许在相同节点之间创建多条边
  3358. // },
  3359. // });
  3360. this.graph = graph;
  3361. this.history = graph.history; //Redo Undo
  3362. },
  3363. onCollapse(collapsed, type) {
  3364. console.log(collapsed, type);
  3365. },
  3366. onBreakpoint(broken) {
  3367. console.log(broken);
  3368. },
  3369. onUndo() {
  3370. this.history.undo();
  3371. console.log("undo");
  3372. },
  3373. onRedo() {
  3374. this.history.redo();
  3375. console.log("redo");
  3376. },
  3377. onCancel() {
  3378. MessageBox.confirm(`确定进行[退出]操作?`, "提示", {
  3379. confirmButtonText: "确定",
  3380. cancelButtonText: "取消",
  3381. type: "warning",
  3382. })
  3383. .then(() => {
  3384. console.log("任务取消")
  3385. console.log(this.workflowName);
  3386. //确定取消任务后的操作
  3387. if(this.workflowstatustag.name == "Running" && this.workflowName!=""){
  3388. this.$http({
  3389. url: this.$http.adornUrl("/visi/visiworkflow/stopworkflow"),
  3390. method: "post",
  3391. data: this.$http.adornData({workflowName: this.workflowName}),
  3392. }).then(({ data }) => {
  3393. if (data && data.code === 0) {
  3394. this.workflowStatus = data.statusPhase;
  3395. if(this.workflowStatus == "Failed"){
  3396. Message.success("任务已取消");
  3397. }
  3398. console.log("任务已取消")
  3399. }
  3400. });
  3401. }
  3402. })
  3403. .catch(() => {});
  3404. },
  3405. onRun() {
  3406. console.log("graph.toJSON()");
  3407. console.log(this.graph.toJSON());
  3408. // console.log(JSON.stringify(this.graph.toJSON()));
  3409. MessageBox.confirm(`确定进行[提交]操作?`, "提示", {
  3410. confirmButtonText: "确定",
  3411. cancelButtonText: "取消",
  3412. type: "warning",
  3413. })
  3414. .then(() => {
  3415. this.$http({
  3416. url: this.$http.adornUrl("/visi/visiworkflow/submit"),
  3417. method: "post",
  3418. data: this.$http.adornData({
  3419. graphJson: JSON.stringify(this.graph.toJSON()),
  3420. workflowId: this.workflowId,
  3421. experimentName: this.experimentName,
  3422. addorupdate: this.addorupdate,
  3423. }
  3424. ),
  3425. }).then(({ data }) => {
  3426. if (data && data.code === 0) {
  3427. this.workflowName = data.workflowName;
  3428. this.idTemplateNameMap = data.idTemplateNameMap; //节点id与 DAG中task和Template 的对应关系
  3429. this.workflowId = data.workflowId;//若为新增,返回新增的主键ID workflowId
  3430. // 迭代属性名称:
  3431. for (let nodeid of Object.keys(this.idTemplateNameMap)) {
  3432. var tempname = this.idTemplateNameMap[nodeid];
  3433. this.graph
  3434. .getCellById(nodeid)
  3435. .setData({ wftempname: tempname }); //temp后端已向末尾添加随机数
  3436. }
  3437. Message.success("提交成功");
  3438. // this.$message({
  3439. // message: "提交成功",
  3440. // type: "success",
  3441. // });
  3442. this.workflowstatustag.name = "Running";
  3443. this.workflowstatustag.type = "";
  3444. //查询运行状态
  3445. // this.getWorkflowStatus();
  3446. var intervalID = window.setInterval(() => {
  3447. this.getWorkflowStatus();
  3448. // 取消该定时设置
  3449. if (
  3450. this.workflowStatus == "Succeeded" ||
  3451. this.workflowStatus == "Error" ||
  3452. this.workflowStatus == "Failed"
  3453. ) {
  3454. if (this.workflowStatus == "Succeeded") {
  3455. this.workflowstatustag.name = "Succeeded";
  3456. this.workflowstatustag.type = "success";
  3457. } else if (
  3458. this.workflowStatus == "Error" ||
  3459. this.workflowStatus == "Failed"
  3460. ) {
  3461. this.workflowstatustag.name = "Failed";
  3462. this.workflowstatustag.type = "danger";
  3463. }
  3464. window.clearInterval(intervalID);
  3465. }
  3466. }, 5000);
  3467. } else {
  3468. Message.error("提交失败");
  3469. }
  3470. });
  3471. })
  3472. .catch(() => {});
  3473. // // 上方添加 按钮提示框
  3474. // this.$http({
  3475. // url: this.$http.adornUrl("/visi/visiworkflow/submit"),
  3476. // method: "post",
  3477. // data: this.$http.adornData(this.graph.toJSON()),
  3478. // }).then(({ data }) => {
  3479. // if (data && data.code === 0) {
  3480. // this.workflowName = data.workflowName;
  3481. // this.idTemplateNameMap = data.idTemplateNameMap; //节点id与 DAG中task和Template 的对应关系
  3482. // // 迭代属性名称:
  3483. // for (let nodeid of Object.keys(this.idTemplateNameMap)) {
  3484. // var tempname = this.idTemplateNameMap[nodeid];
  3485. // this.graph.getCellById(nodeid).setData({ wftempname: tempname }); //temp后端已向末尾添加随机数
  3486. // }
  3487. // Message.success("提交成功");
  3488. // // this.$message({
  3489. // // message: "提交成功",
  3490. // // type: "success",
  3491. // // });
  3492. // this.workflowstatustag.name = "Running";
  3493. // this.workflowstatustag.type = "";
  3494. // //查询运行状态
  3495. // // this.getWorkflowStatus();
  3496. // var intervalID = window.setInterval(() => {
  3497. // this.getWorkflowStatus();
  3498. // // 取消该定时设置
  3499. // if (
  3500. // this.workflowStatus == "Succeeded" ||
  3501. // this.workflowStatus == "Error" ||
  3502. // this.workflowStatus == "Failed"
  3503. // ) {
  3504. // if (this.workflowStatus == "Succeeded") {
  3505. // this.workflowstatustag.name = "Succeeded";
  3506. // this.workflowstatustag.type = "success";
  3507. // } else if (
  3508. // this.workflowStatus == "Error" ||
  3509. // this.workflowStatus == "Failed"
  3510. // ) {
  3511. // this.workflowstatustag.name = "Failed";
  3512. // this.workflowstatustag.type = "danger";
  3513. // }
  3514. // window.clearInterval(intervalID);
  3515. // }
  3516. // }, 5000);
  3517. // // // 取消该定时设置
  3518. // // if (
  3519. // // this.workflowStatus == "Succeeded" ||
  3520. // // this.workflowStatus == "Error" ||
  3521. // // this.workflowStatus == "Failed"
  3522. // // ) {
  3523. // // if (this.workflowStatus == "Succeeded") {
  3524. // // this.workflowstatustag.name = "Succeeded";
  3525. // // this.workflowstatustag.type = "success";
  3526. // // } else if (
  3527. // // this.workflowStatus == "Error" ||
  3528. // // this.workflowStatus == "Failed"
  3529. // // ) {
  3530. // // this.workflowstatustag.name = "Failed";
  3531. // // this.workflowstatustag.type = "danger";
  3532. // // }
  3533. // // window.clearInterval(intervalID);
  3534. // // }
  3535. // } else {
  3536. // Message.error("提交失败");
  3537. // // this.$message.error("提交失败");
  3538. // // this.$message.error(data.msg);
  3539. // }
  3540. // });
  3541. },
  3542. //20211109 测试 能否保存至数据库
  3543. onPrimary() {
  3544. MessageBox.confirm(`确定进行[保存]操作?`, "提示", {
  3545. confirmButtonText: "确定",
  3546. cancelButtonText: "取消",
  3547. type: "warning",
  3548. })
  3549. .then(() => {
  3550. this.$http({
  3551. url: this.$http.adornUrl("/visi/visiworkflow/save"),
  3552. method: "post",
  3553. data: this.$http.adornData({
  3554. userId: this.$store.state.user.id,
  3555. workflowId: undefined,
  3556. experimentName: this.experimentName,
  3557. workflowtempName: "",
  3558. workflowName: "",
  3559. graphJson: JSON.stringify(this.graph.toJSON()),
  3560. }),
  3561. }).then(({ data }) => {
  3562. if (data && data.code === 0) {
  3563. Message.success("操作成功");
  3564. // this.$message({
  3565. // message: "操作成功",
  3566. // type: "success",
  3567. // duration: 1500,
  3568. // onClose: () => {
  3569. // this.getDataList();
  3570. // },
  3571. // });
  3572. } else {
  3573. // Message.error();
  3574. // this.$message.error(data.msg);
  3575. }
  3576. });
  3577. })
  3578. .catch(() => {});
  3579. console.log(JSON.stringify(this.graph.toJSON()).length);
  3580. console.log(JSON.stringify(this.graph.toJSON()));
  3581. // this.$http({
  3582. // url: this.$http.adornUrl("/visi/visiworkflow/save"),
  3583. // method: "post",
  3584. // data: this.$http.adornData({
  3585. // userId: this.$store.state.user.id,
  3586. // workflowId: undefined,
  3587. // experimentName: "实验1",
  3588. // workflowtempName: "",
  3589. // workflowName: "",
  3590. // graphJson: JSON.stringify(this.graph.toJSON()),
  3591. // }),
  3592. // }).then(({ data }) => {
  3593. // if (data && data.code === 0) {
  3594. // Message.success("操作成功");
  3595. // // this.$message({
  3596. // // message: "操作成功",
  3597. // // type: "success",
  3598. // // duration: 1500,
  3599. // // onClose: () => {
  3600. // // this.getDataList();
  3601. // // },
  3602. // // });
  3603. // } else {
  3604. // // Message.error();
  3605. // // this.$message.error(data.msg);
  3606. // }
  3607. // });
  3608. },
  3609. //查询状态
  3610. getWorkflowStatus() {
  3611. this.$http({
  3612. url: this.$http.adornUrl("/visi/visiworkflow/getworkflowstatus"),
  3613. method: "get",
  3614. params: this.$http.adornParams({
  3615. workflowName: this.workflowName,
  3616. }),
  3617. }).then(({ data }) => {
  3618. this.workflowStatus = data.statusPhase;
  3619. console.log(this.workflowStatus);
  3620. if (this.workflowStatus == "Succeeded") {
  3621. this.workflowstatustag.name = "Succeeded";
  3622. this.workflowstatustag.type = "success";
  3623. } else if (
  3624. this.workflowStatus == "Error" ||
  3625. this.workflowStatus == "Failed"
  3626. ) {
  3627. this.workflowstatustag.name = "Failed";
  3628. this.workflowstatustag.type = "danger";
  3629. } else {
  3630. this.workflowstatustag.name = "Running";
  3631. this.workflowstatustag.type = "";
  3632. }
  3633. //Pending, Running, Succeeded, Skipped, Failed, Error
  3634. });
  3635. },
  3636. //20211111 添加设置每个算法节点 的输入输出设置模板
  3637. //获取代码模板
  3638. getParaTemp() {
  3639. this.paraTempVisible = true;
  3640. this.$nextTick(() => {
  3641. // this.$refs.paraTemp.init(this.measurepoint.join());
  3642. this.$refs.paraTemp.init();
  3643. });
  3644. },
  3645. // 清空当前画布
  3646. onCleargraph() {
  3647. this.graph.clearCells();
  3648. },
  3649. //画布内容居中
  3650. getgraphContentcenter() {
  3651. this.graph.centerContent();
  3652. },
  3653. //获取工作流完整日志
  3654. getworkflowContent() {
  3655. // console.log("graph.toJSON()");
  3656. // console.log(this.graph.toJSON());
  3657. // console.log(JSON.stringify(this.graph.toJSON()));
  3658. // this.$http({
  3659. // url: this.$http.adornUrl("/visi/visiworkflow/getpodlog"),
  3660. // method: "get",
  3661. // data: this.$http.adornData(this.workflowName,this.idTemplateNameMap),
  3662. // }).then(({ data }) => {
  3663. // if (data && data.code === 0) {
  3664. // this.workflowName = data.workflowName;
  3665. // this.workflowContentlog = data.workflowContent;
  3666. // this.podlogs = data.podlogs;
  3667. // console.log("workflowname");
  3668. // console.log(this.workflowName);
  3669. // console.log("workflowcontent")
  3670. // console.log(this.workflowContentlog);
  3671. // console.log("podlogs")
  3672. // console.log(this.podlogs);
  3673. // this.$message({
  3674. // message: "操作成功",
  3675. // type: "success",
  3676. // duration: 1500,
  3677. // onClose: () => {
  3678. // // this.getDataList(); //20211115 待更改 未应用,且不是该函数
  3679. // },
  3680. // });
  3681. // } else {
  3682. // this.$message.error(data.msg);
  3683. // }
  3684. // });
  3685. //获取日志正确代码,现改为弹窗显示
  3686. // if (this.workflowContentVisi) {
  3687. // this.workflowContentVisi = false;
  3688. // } else {
  3689. // this.workflowContentVisi = true;
  3690. // this.$http({
  3691. // url: this.$http.adornUrl("/visi/visiworkflow/getworkflowlog"),
  3692. // method: "get",
  3693. // params: this.$http.adornParams({
  3694. // workflowName: this.workflowName,
  3695. // }),
  3696. // })
  3697. // .then(({ data }) => {
  3698. // this.workflowContent = data.workflowContent;
  3699. // // this.podlogs = data.podlogs;
  3700. // console.log("workflowcontent");
  3701. // console.log(this.workflowContent);
  3702. // console.log(this.workflowContent.main);
  3703. // console.log(this.workflowContent.init);
  3704. // console.log(this.workflowContent.wait);
  3705. // // console.log("podlogs")
  3706. // // console.log(this.podlogs);
  3707. // })
  3708. // .then(() => {
  3709. // // this.visible = true
  3710. // // this.$nextTick(() => {
  3711. // // this.$refs['dataForm'].resetFields()
  3712. // // })
  3713. // });
  3714. // }
  3715. this.workflowContentVisi = true;
  3716. if (this.workflowName != "") {
  3717. this.$nextTick(() => {
  3718. this.$refs.getworkflowlog.init(this.workflowName);
  3719. });
  3720. } else {
  3721. this.$nextTick(() => {
  3722. this.$refs.getworkflowlog.init1();
  3723. });
  3724. }
  3725. },
  3726. //获取单个节点 日志
  3727. getnodepodContent() {
  3728. this.$http({
  3729. url: this.$http.adornUrl("/visi/visiworkflow/getpodlog"),
  3730. method: "get",
  3731. params: this.$http.adornParams({
  3732. workflowName: this.workflowName,
  3733. idTemplateNameMap: this.idTemplateNameMap,
  3734. nodeId: "",
  3735. }),
  3736. })
  3737. .then(({ data }) => {
  3738. // this.workflowContentlog = data.workflowContent;
  3739. // this.podlogs = data.podlogs;
  3740. // console.log("workflowcontent")
  3741. // console.log(this.workflowContentlog);
  3742. // console.log("podlogs")
  3743. // console.log(this.podlogs);
  3744. })
  3745. .then(() => {
  3746. // this.visible = true
  3747. // this.$nextTick(() => {
  3748. // this.$refs['dataForm'].resetFields()
  3749. // })
  3750. });
  3751. },
  3752. //单选控制 日志类型 main init wait
  3753. workflowcontainerchange(e) {
  3754. if (this.containertype == "main") {
  3755. this.workflowContentlog = this.workflowContent.main;
  3756. }
  3757. if (this.containertype == "init") {
  3758. this.workflowContentlog = this.workflowContent.init;
  3759. }
  3760. if (this.containertype == "wait") {
  3761. this.workflowContentlog = this.workflowContent.wait;
  3762. }
  3763. },
  3764. //获取代码示例---轮廓识别
  3765. onGetcontour() {
  3766. //20211129 暂时先注释,为轮廓识别案例
  3767. this.graph.fromJSON([
  3768. {
  3769. position: { x: 60, y: 280 },
  3770. size: { width: 90, height: 80 },
  3771. attrs: {
  3772. image: {
  3773. "xlink:href":
  3774. "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
  3775. },
  3776. label: { text: "contourTask1" },
  3777. },
  3778. shape: "template-node",
  3779. data: {
  3780. nodeName: "contourTask1",
  3781. templateName: "contourTask1",
  3782. templateImage: "zvinjodocker/contous_task1:20211014",
  3783. templateCommand: {},
  3784. templateArgs: {},
  3785. algoparaInput: { userInput: [], getInput: [] },
  3786. algoparaOutput: [],
  3787. algoparaInputargu: { userInput: [], getInput: [] },
  3788. algonodeSource: [],
  3789. inputsparameters: [],
  3790. inputsartifacts: [],
  3791. argumentsparameters: [],
  3792. argumentsartifacts: [],
  3793. outputsparameters: [],
  3794. outputsartifacts: [
  3795. {
  3796. paraname: "thresh",
  3797. paradesc: "",
  3798. paratype: "",
  3799. valuefrom: "/myapps/thresh1.png",
  3800. },
  3801. {
  3802. paraname: "contours",
  3803. paradesc: "",
  3804. paratype: "",
  3805. valuefrom: "/myapps/contours.png",
  3806. },
  3807. ],
  3808. sourcedatalist: [],
  3809. sourceartilist: [],
  3810. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  3811. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  3812. },
  3813. ports: {
  3814. groups: {
  3815. in: {
  3816. position: "left",
  3817. attrs: {
  3818. circle: {
  3819. r: 2.5,
  3820. magnet: true,
  3821. stroke: "black",
  3822. strokeWidth: 1,
  3823. fill: "#fff",
  3824. style: { visibility: true },
  3825. },
  3826. },
  3827. },
  3828. out: {
  3829. position: "right",
  3830. attrs: {
  3831. circle: {
  3832. r: 2.5,
  3833. magnet: true,
  3834. stroke: "black",
  3835. strokeWidth: 1,
  3836. fill: "#fff",
  3837. },
  3838. },
  3839. },
  3840. },
  3841. items: [
  3842. { id: "inport1", group: "in" },
  3843. { id: "inport2", group: "in" },
  3844. { id: "outport1", group: "out" },
  3845. { id: "outport2", group: "out" },
  3846. ],
  3847. },
  3848. id: "fadef8ac-8dcd-4d8e-8968-d156ffd941c5",
  3849. zIndex: 1,
  3850. },
  3851. {
  3852. position: { x: 370, y: 140 },
  3853. size: { width: 90, height: 80 },
  3854. attrs: {
  3855. image: {
  3856. "xlink:href":
  3857. "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
  3858. },
  3859. label: { text: "contourTask2" },
  3860. },
  3861. shape: "template-node",
  3862. data: {
  3863. nodeName: "contourTask2",
  3864. templateName: "contourTask2",
  3865. templateImage: "zvinjodocker/contours_task2:20211014",
  3866. templateCommand: {},
  3867. templateArgs: {},
  3868. algoparaInput: { userInput: [], getInput: [] },
  3869. algoparaOutput: [],
  3870. algoparaInputargu: { userInput: [], getInput: [] },
  3871. algonodeSource: [
  3872. {
  3873. position: { x: 60, y: 280 },
  3874. size: { width: 90, height: 80 },
  3875. attrs: {
  3876. image: {
  3877. "xlink:href":
  3878. "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
  3879. },
  3880. label: { text: "contourTask1" },
  3881. },
  3882. shape: "template-node",
  3883. data: {
  3884. nodeName: "contourTask1",
  3885. templateName: "contourTask1",
  3886. templateImage: "zvinjodocker/contous_task1:20211014",
  3887. templateCommand: {},
  3888. templateArgs: {},
  3889. algoparaInput: { userInput: [], getInput: [] },
  3890. algoparaOutput: [],
  3891. algoparaInputargu: { userInput: [], getInput: [] },
  3892. algonodeSource: [],
  3893. inputsparameters: [],
  3894. inputsartifacts: [],
  3895. argumentsparameters: [],
  3896. argumentsartifacts: [],
  3897. outputsparameters: [],
  3898. outputsartifacts: [
  3899. {
  3900. paraname: "thresh",
  3901. paradesc: "",
  3902. paratype: "",
  3903. valuefrom: "/myapps/thresh1.png",
  3904. },
  3905. {
  3906. paraname: "contours",
  3907. paradesc: "",
  3908. paratype: "",
  3909. valuefrom: "/myapps/contours.png",
  3910. },
  3911. ],
  3912. sourcedatalist: [],
  3913. sourceartilist: [],
  3914. },
  3915. ports: {
  3916. groups: {
  3917. in: {
  3918. position: "left",
  3919. attrs: {
  3920. circle: {
  3921. r: 2.5,
  3922. magnet: true,
  3923. stroke: "black",
  3924. strokeWidth: 1,
  3925. fill: "#fff",
  3926. style: { visibility: true },
  3927. },
  3928. },
  3929. },
  3930. out: {
  3931. position: "right",
  3932. attrs: {
  3933. circle: {
  3934. r: 2.5,
  3935. magnet: true,
  3936. stroke: "black",
  3937. strokeWidth: 1,
  3938. fill: "#fff",
  3939. },
  3940. },
  3941. },
  3942. },
  3943. items: [
  3944. { id: "inport1", group: "in" },
  3945. { id: "inport2", group: "in" },
  3946. { id: "outport1", group: "out" },
  3947. { id: "outport2", group: "out" },
  3948. ],
  3949. },
  3950. id: "fadef8ac-8dcd-4d8e-8968-d156ffd941c5",
  3951. zIndex: 1,
  3952. },
  3953. ],
  3954. inputsparameters: [],
  3955. inputsartifacts: [
  3956. {
  3957. paraname: "thresh",
  3958. parapath: "/myapps/thresh1.png",
  3959. paradesc: "",
  3960. },
  3961. {
  3962. paraname: "contours",
  3963. parapath: "/myapps/contours.png",
  3964. paradesc: "",
  3965. },
  3966. ],
  3967. argumentsparameters: [],
  3968. argumentsartifacts: [
  3969. {
  3970. paraname: "thresh",
  3971. valuefrom: "{{tasks.contourTask1.outputs.artifacts.thresh}}",
  3972. fileurls: [],
  3973. filelist: [],
  3974. value: ["contourTask1", "thresh"],
  3975. },
  3976. {
  3977. paraname: "contours",
  3978. valuefrom: "{{tasks.contourTask1.outputs.artifacts.contours}}",
  3979. fileurls: [],
  3980. filelist: [],
  3981. value: ["contourTask1", "contours"],
  3982. },
  3983. ],
  3984. outputsparameters: [],
  3985. outputsartifacts: [
  3986. {
  3987. paraname: "contours0",
  3988. valuefrom: "/myapps/contours[0].npy",
  3989. paradesc: "",
  3990. paratype: "",
  3991. },
  3992. {
  3993. paraname: "res",
  3994. valuefrom: "/myapps/res1.png",
  3995. paradesc: "",
  3996. paratype: "",
  3997. },
  3998. ],
  3999. sourcedatalist: [],
  4000. sourceartilist: [],
  4001. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  4002. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  4003. },
  4004. ports: {
  4005. groups: {
  4006. in: {
  4007. position: "left",
  4008. attrs: {
  4009. circle: {
  4010. r: 2.5,
  4011. magnet: true,
  4012. stroke: "black",
  4013. strokeWidth: 1,
  4014. fill: "#fff",
  4015. style: { visibility: true },
  4016. },
  4017. },
  4018. },
  4019. out: {
  4020. position: "right",
  4021. attrs: {
  4022. circle: {
  4023. r: 2.5,
  4024. magnet: true,
  4025. stroke: "black",
  4026. strokeWidth: 1,
  4027. fill: "#fff",
  4028. },
  4029. },
  4030. },
  4031. },
  4032. items: [
  4033. { id: "inport1", group: "in" },
  4034. { id: "inport2", group: "in" },
  4035. { id: "outport1", group: "out" },
  4036. { id: "outport2", group: "out" },
  4037. ],
  4038. },
  4039. id: "7d572837-a22b-4dab-a196-8ea411ba868e",
  4040. zIndex: 2,
  4041. },
  4042. {
  4043. shape: "edge",
  4044. attrs: {
  4045. line: {
  4046. stroke: "#808080",
  4047. strokeWidth: 1,
  4048. targetMarker: { name: "block", args: { size: "6" } },
  4049. },
  4050. },
  4051. id: "3b752ac7-2c5f-4596-adf3-ad10dd3718b0",
  4052. router: { name: "er", args: { offset: "center" } },
  4053. tools: {
  4054. items: [{ name: "button-remove", args: { distance: -40 } }],
  4055. },
  4056. source: {
  4057. cell: "fadef8ac-8dcd-4d8e-8968-d156ffd941c5",
  4058. port: "outport1",
  4059. },
  4060. target: {
  4061. cell: "7d572837-a22b-4dab-a196-8ea411ba868e",
  4062. port: "inport1",
  4063. },
  4064. zIndex: 3,
  4065. },
  4066. {
  4067. position: { x: 650, y: 140 },
  4068. size: { width: 90, height: 80 },
  4069. attrs: {
  4070. image: {
  4071. "xlink:href":
  4072. "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
  4073. },
  4074. label: { text: "contourTask3" },
  4075. },
  4076. shape: "template-node",
  4077. data: {
  4078. nodeName: "contourTask3",
  4079. templateName: "contourTask3",
  4080. templateImage: "zvinjodocker/contours_task3:20211015",
  4081. templateCommand: {},
  4082. templateArgs: {},
  4083. algoparaInput: { userInput: [], getInput: [] },
  4084. algoparaOutput: [],
  4085. algoparaInputargu: { userInput: [], getInput: [] },
  4086. algonodeSource: [
  4087. {
  4088. position: { x: 370, y: 140 },
  4089. size: { width: 90, height: 80 },
  4090. attrs: {
  4091. image: {
  4092. "xlink:href":
  4093. "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
  4094. },
  4095. label: { text: "contourTask2" },
  4096. },
  4097. shape: "template-node",
  4098. data: {
  4099. nodeName: "contourTask2",
  4100. templateName: "contourTask2",
  4101. templateImage: "zvinjodocker/contours_task2:20211014",
  4102. templateCommand: {},
  4103. templateArgs: {},
  4104. algoparaInput: { userInput: [], getInput: [] },
  4105. algoparaOutput: [],
  4106. algoparaInputargu: { userInput: [], getInput: [] },
  4107. algonodeSource: [
  4108. {
  4109. position: { x: 60, y: 280 },
  4110. size: { width: 90, height: 80 },
  4111. attrs: {
  4112. image: {
  4113. "xlink:href":
  4114. "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
  4115. },
  4116. label: { text: "contourTask1" },
  4117. },
  4118. shape: "template-node",
  4119. data: {
  4120. nodeName: "contourTask1",
  4121. templateName: "contourTask1",
  4122. templateImage: "zvinjodocker/contous_task1:20211014",
  4123. templateCommand: {},
  4124. templateArgs: {},
  4125. algoparaInput: { userInput: [], getInput: [] },
  4126. algoparaOutput: [],
  4127. algoparaInputargu: { userInput: [], getInput: [] },
  4128. algonodeSource: [],
  4129. inputsparameters: [],
  4130. inputsartifacts: [],
  4131. argumentsparameters: [],
  4132. argumentsartifacts: [],
  4133. outputsparameters: [],
  4134. outputsartifacts: [
  4135. {
  4136. paraname: "thresh",
  4137. paradesc: "",
  4138. paratype: "",
  4139. valuefrom: "/myapps/thresh1.png",
  4140. },
  4141. {
  4142. paraname: "contours",
  4143. paradesc: "",
  4144. paratype: "",
  4145. valuefrom: "/myapps/contours.png",
  4146. },
  4147. ],
  4148. sourcedatalist: [],
  4149. sourceartilist: [],
  4150. },
  4151. ports: {
  4152. groups: {
  4153. in: {
  4154. position: "left",
  4155. attrs: {
  4156. circle: {
  4157. r: 2.5,
  4158. magnet: true,
  4159. stroke: "black",
  4160. strokeWidth: 1,
  4161. fill: "#fff",
  4162. style: { visibility: true },
  4163. },
  4164. },
  4165. },
  4166. out: {
  4167. position: "right",
  4168. attrs: {
  4169. circle: {
  4170. r: 2.5,
  4171. magnet: true,
  4172. stroke: "black",
  4173. strokeWidth: 1,
  4174. fill: "#fff",
  4175. },
  4176. },
  4177. },
  4178. },
  4179. items: [
  4180. { id: "inport1", group: "in" },
  4181. { id: "inport2", group: "in" },
  4182. { id: "outport1", group: "out" },
  4183. { id: "outport2", group: "out" },
  4184. ],
  4185. },
  4186. id: "fadef8ac-8dcd-4d8e-8968-d156ffd941c5",
  4187. zIndex: 1,
  4188. },
  4189. ],
  4190. inputsparameters: [],
  4191. inputsartifacts: [
  4192. {
  4193. paraname: "thresh",
  4194. parapath: "/myapps/thresh1.png",
  4195. paradesc: "",
  4196. },
  4197. {
  4198. paraname: "contours",
  4199. parapath: "/myapps/contours.png",
  4200. paradesc: "",
  4201. },
  4202. ],
  4203. argumentsparameters: [],
  4204. argumentsartifacts: [
  4205. {
  4206. paraname: "thresh",
  4207. valuefrom:
  4208. "{{tasks.contourTask1.outputs.artifacts.thresh}}",
  4209. fileurls: [],
  4210. filelist: [],
  4211. value: ["contourTask1", "thresh"],
  4212. },
  4213. {
  4214. paraname: "contours",
  4215. valuefrom:
  4216. "{{tasks.contourTask1.outputs.artifacts.contours}}",
  4217. fileurls: [],
  4218. filelist: [],
  4219. value: ["contourTask1", "contours"],
  4220. },
  4221. ],
  4222. outputsparameters: [],
  4223. outputsartifacts: [
  4224. {
  4225. paraname: "contours0",
  4226. valuefrom: "/myapps/contours[0].npy",
  4227. paradesc: "",
  4228. paratype: "",
  4229. },
  4230. {
  4231. paraname: "res",
  4232. valuefrom: "/myapps/res1.png",
  4233. paradesc: "",
  4234. paratype: "",
  4235. },
  4236. ],
  4237. sourcedatalist: [],
  4238. sourceartilist: [],
  4239. },
  4240. ports: {
  4241. groups: {
  4242. in: {
  4243. position: "left",
  4244. attrs: {
  4245. circle: {
  4246. r: 2.5,
  4247. magnet: true,
  4248. stroke: "black",
  4249. strokeWidth: 1,
  4250. fill: "#fff",
  4251. style: { visibility: true },
  4252. },
  4253. },
  4254. },
  4255. out: {
  4256. position: "right",
  4257. attrs: {
  4258. circle: {
  4259. r: 2.5,
  4260. magnet: true,
  4261. stroke: "black",
  4262. strokeWidth: 1,
  4263. fill: "#fff",
  4264. },
  4265. },
  4266. },
  4267. },
  4268. items: [
  4269. { id: "inport1", group: "in" },
  4270. { id: "inport2", group: "in" },
  4271. { id: "outport1", group: "out" },
  4272. { id: "outport2", group: "out" },
  4273. ],
  4274. },
  4275. id: "7d572837-a22b-4dab-a196-8ea411ba868e",
  4276. zIndex: 2,
  4277. },
  4278. ],
  4279. inputsparameters: [],
  4280. inputsartifacts: [
  4281. {
  4282. paraname: "contours0",
  4283. parapath: "/myapps/contours[0].npy",
  4284. paradesc: "",
  4285. },
  4286. ],
  4287. argumentsparameters: [],
  4288. argumentsartifacts: [
  4289. {
  4290. paraname: "contours0",
  4291. valuefrom: "{{tasks.contourTask2.outputs.artifacts.contours0}}",
  4292. fileurls: [],
  4293. filelist: [],
  4294. value: ["contourTask2", "contours0"],
  4295. },
  4296. ],
  4297. outputsparameters: [],
  4298. outputsartifacts: [],
  4299. sourcedatalist: [],
  4300. sourceartilist: [],
  4301. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  4302. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  4303. },
  4304. ports: {
  4305. groups: {
  4306. in: {
  4307. position: "left",
  4308. attrs: {
  4309. circle: {
  4310. r: 2.5,
  4311. magnet: true,
  4312. stroke: "black",
  4313. strokeWidth: 1,
  4314. fill: "#fff",
  4315. style: { visibility: true },
  4316. },
  4317. },
  4318. },
  4319. out: {
  4320. position: "right",
  4321. attrs: {
  4322. circle: {
  4323. r: 2.5,
  4324. magnet: true,
  4325. stroke: "black",
  4326. strokeWidth: 1,
  4327. fill: "#fff",
  4328. },
  4329. },
  4330. },
  4331. },
  4332. items: [
  4333. { id: "inport1", group: "in" },
  4334. { id: "inport2", group: "in" },
  4335. { id: "outport1", group: "out" },
  4336. { id: "outport2", group: "out" },
  4337. ],
  4338. },
  4339. id: "a40a3ff3-da4c-463c-ab58-bd9735fb57fe",
  4340. zIndex: 4,
  4341. },
  4342. {
  4343. shape: "edge",
  4344. attrs: {
  4345. line: {
  4346. stroke: "#808080",
  4347. strokeWidth: 1,
  4348. targetMarker: { name: "block", args: { size: "6" } },
  4349. },
  4350. },
  4351. id: "e30fefd7-b50a-4152-96a5-a6403f990cf7",
  4352. router: { name: "er", args: { offset: "center" } },
  4353. tools: {
  4354. items: [{ name: "button-remove", args: { distance: -40 } }],
  4355. },
  4356. source: {
  4357. cell: "7d572837-a22b-4dab-a196-8ea411ba868e",
  4358. port: "outport1",
  4359. },
  4360. target: {
  4361. cell: "a40a3ff3-da4c-463c-ab58-bd9735fb57fe",
  4362. port: "inport1",
  4363. },
  4364. zIndex: 5,
  4365. },
  4366. {
  4367. position: { x: 360, y: 390 },
  4368. size: { width: 90, height: 80 },
  4369. attrs: {
  4370. image: {
  4371. "xlink:href":
  4372. "https://gw.alipayobjects.com/zos/bmw-prod/c36fe7cb-dc24-4854-aeb5-88d8dc36d52e.svg",
  4373. },
  4374. label: { text: "contourApproximate1" },
  4375. },
  4376. shape: "template-node",
  4377. data: {
  4378. nodeName: "contourApproximate1",
  4379. templateName: "contourApproximate1",
  4380. templateImage: "zvinjodocker/contour_approximate1:20211015",
  4381. templateCommand: {},
  4382. templateArgs: {},
  4383. algoparaInput: { userInput: [], getInput: [] },
  4384. algoparaOutput: [],
  4385. algoparaInputargu: { userInput: [], getInput: [] },
  4386. algonodeSource: [
  4387. {
  4388. position: { x: 60, y: 280 },
  4389. size: { width: 90, height: 80 },
  4390. attrs: {
  4391. image: {
  4392. "xlink:href":
  4393. "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
  4394. },
  4395. label: { text: "contourTask1" },
  4396. },
  4397. shape: "template-node",
  4398. data: {
  4399. nodeName: "contourTask1",
  4400. templateName: "contourTask1",
  4401. templateImage: "zvinjodocker/contous_task1:20211014",
  4402. templateCommand: {},
  4403. templateArgs: {},
  4404. algoparaInput: { userInput: [], getInput: [] },
  4405. algoparaOutput: [],
  4406. algoparaInputargu: { userInput: [], getInput: [] },
  4407. algonodeSource: [],
  4408. inputsparameters: [],
  4409. inputsartifacts: [],
  4410. argumentsparameters: [],
  4411. argumentsartifacts: [],
  4412. outputsparameters: [],
  4413. outputsartifacts: [
  4414. {
  4415. paraname: "thresh",
  4416. paradesc: "",
  4417. paratype: "",
  4418. valuefrom: "/myapps/thresh1.png",
  4419. },
  4420. {
  4421. paraname: "contours",
  4422. paradesc: "",
  4423. paratype: "",
  4424. valuefrom: "/myapps/contours.png",
  4425. },
  4426. ],
  4427. sourcedatalist: [],
  4428. sourceartilist: [],
  4429. },
  4430. ports: {
  4431. groups: {
  4432. in: {
  4433. position: "left",
  4434. attrs: {
  4435. circle: {
  4436. r: 2.5,
  4437. magnet: true,
  4438. stroke: "black",
  4439. strokeWidth: 1,
  4440. fill: "#fff",
  4441. style: { visibility: true },
  4442. },
  4443. },
  4444. },
  4445. out: {
  4446. position: "right",
  4447. attrs: {
  4448. circle: {
  4449. r: 2.5,
  4450. magnet: true,
  4451. stroke: "black",
  4452. strokeWidth: 1,
  4453. fill: "#fff",
  4454. },
  4455. },
  4456. },
  4457. },
  4458. items: [
  4459. { id: "inport1", group: "in" },
  4460. { id: "inport2", group: "in" },
  4461. { id: "outport1", group: "out" },
  4462. { id: "outport2", group: "out" },
  4463. ],
  4464. },
  4465. id: "fadef8ac-8dcd-4d8e-8968-d156ffd941c5",
  4466. zIndex: 1,
  4467. },
  4468. ],
  4469. inputsparameters: [],
  4470. inputsartifacts: [],
  4471. argumentsparameters: [],
  4472. argumentsartifacts: [],
  4473. outputsparameters: [],
  4474. outputsartifacts: [
  4475. {
  4476. paraname: "approxCnt",
  4477. valuefrom: "/myapps/approx_cnt.npy",
  4478. paradesc: "",
  4479. paratype: "",
  4480. },
  4481. {
  4482. paraname: "approxRes",
  4483. valuefrom: "/myapps/approx_res.png",
  4484. paradesc: "",
  4485. paratype: "",
  4486. },
  4487. ],
  4488. sourcedatalist: [],
  4489. sourceartilist: [],
  4490. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  4491. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  4492. },
  4493. ports: {
  4494. groups: {
  4495. in: {
  4496. position: "left",
  4497. attrs: {
  4498. circle: {
  4499. r: 2.5,
  4500. magnet: true,
  4501. stroke: "black",
  4502. strokeWidth: 1,
  4503. fill: "#fff",
  4504. style: { visibility: true },
  4505. },
  4506. },
  4507. },
  4508. out: {
  4509. position: "right",
  4510. attrs: {
  4511. circle: {
  4512. r: 2.5,
  4513. magnet: true,
  4514. stroke: "black",
  4515. strokeWidth: 1,
  4516. fill: "#fff",
  4517. },
  4518. },
  4519. },
  4520. },
  4521. items: [
  4522. { id: "inport1", group: "in" },
  4523. { id: "inport2", group: "in" },
  4524. { id: "outport1", group: "out" },
  4525. { id: "outport2", group: "out" },
  4526. ],
  4527. },
  4528. id: "2d3ccc77-be7c-4fa0-ae37-a9af4fdf6730",
  4529. zIndex: 6,
  4530. },
  4531. {
  4532. position: { x: 660, y: 390 },
  4533. size: { width: 90, height: 80 },
  4534. attrs: {
  4535. image: {
  4536. "xlink:href":
  4537. "https://gw.alipayobjects.com/zos/bmw-prod/c55d7ae1-8d20-4585-bd8f-ca23653a4489.svg",
  4538. },
  4539. label: { text: "contourApproximate2" },
  4540. },
  4541. shape: "template-node",
  4542. data: {
  4543. nodeName: "contourApproximate2",
  4544. templateName: "contourApproximate2",
  4545. templateImage: "zvinjodocker/contour_approximate2:20211015",
  4546. templateCommand: {},
  4547. templateArgs: {},
  4548. algoparaInput: { userInput: [], getInput: [] },
  4549. algoparaOutput: [],
  4550. algoparaInputargu: { userInput: [], getInput: [] },
  4551. algonodeSource: [
  4552. {
  4553. position: { x: 360, y: 390 },
  4554. size: { width: 90, height: 80 },
  4555. attrs: {
  4556. image: {
  4557. "xlink:href":
  4558. "https://gw.alipayobjects.com/zos/bmw-prod/c36fe7cb-dc24-4854-aeb5-88d8dc36d52e.svg",
  4559. },
  4560. label: { text: "contourApproximate1" },
  4561. },
  4562. shape: "template-node",
  4563. data: {
  4564. nodeName: "contourApproximate1",
  4565. templateName: "contourApproximate1",
  4566. templateImage: "zvinjodocker/contour_approximate1:20211015",
  4567. templateCommand: {},
  4568. templateArgs: {},
  4569. algoparaInput: { userInput: [], getInput: [] },
  4570. algoparaOutput: [],
  4571. algoparaInputargu: { userInput: [], getInput: [] },
  4572. algonodeSource: [
  4573. {
  4574. position: { x: 60, y: 280 },
  4575. size: { width: 90, height: 80 },
  4576. attrs: {
  4577. image: {
  4578. "xlink:href":
  4579. "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
  4580. },
  4581. label: { text: "contourTask1" },
  4582. },
  4583. shape: "template-node",
  4584. data: {
  4585. nodeName: "contourTask1",
  4586. templateName: "contourTask1",
  4587. templateImage: "zvinjodocker/contous_task1:20211014",
  4588. templateCommand: {},
  4589. templateArgs: {},
  4590. algoparaInput: { userInput: [], getInput: [] },
  4591. algoparaOutput: [],
  4592. algoparaInputargu: { userInput: [], getInput: [] },
  4593. algonodeSource: [],
  4594. inputsparameters: [],
  4595. inputsartifacts: [],
  4596. argumentsparameters: [],
  4597. argumentsartifacts: [],
  4598. outputsparameters: [],
  4599. outputsartifacts: [
  4600. {
  4601. paraname: "thresh",
  4602. paradesc: "",
  4603. paratype: "",
  4604. valuefrom: "/myapps/thresh1.png",
  4605. },
  4606. {
  4607. paraname: "contours",
  4608. paradesc: "",
  4609. paratype: "",
  4610. valuefrom: "/myapps/contours.png",
  4611. },
  4612. ],
  4613. sourcedatalist: [],
  4614. sourceartilist: [],
  4615. },
  4616. ports: {
  4617. groups: {
  4618. in: {
  4619. position: "left",
  4620. attrs: {
  4621. circle: {
  4622. r: 2.5,
  4623. magnet: true,
  4624. stroke: "black",
  4625. strokeWidth: 1,
  4626. fill: "#fff",
  4627. style: { visibility: true },
  4628. },
  4629. },
  4630. },
  4631. out: {
  4632. position: "right",
  4633. attrs: {
  4634. circle: {
  4635. r: 2.5,
  4636. magnet: true,
  4637. stroke: "black",
  4638. strokeWidth: 1,
  4639. fill: "#fff",
  4640. },
  4641. },
  4642. },
  4643. },
  4644. items: [
  4645. { id: "inport1", group: "in" },
  4646. { id: "inport2", group: "in" },
  4647. { id: "outport1", group: "out" },
  4648. { id: "outport2", group: "out" },
  4649. ],
  4650. },
  4651. id: "fadef8ac-8dcd-4d8e-8968-d156ffd941c5",
  4652. zIndex: 1,
  4653. },
  4654. ],
  4655. inputsparameters: [],
  4656. inputsartifacts: [],
  4657. argumentsparameters: [],
  4658. argumentsartifacts: [],
  4659. outputsparameters: [],
  4660. outputsartifacts: [
  4661. {
  4662. paraname: "approxCnt",
  4663. valuefrom: "/myapps/approx_cnt.npy",
  4664. paradesc: "",
  4665. paratype: "",
  4666. },
  4667. {
  4668. paraname: "approxRes",
  4669. valuefrom: "/myapps/approx_res.png",
  4670. paradesc: "",
  4671. paratype: "",
  4672. },
  4673. ],
  4674. sourcedatalist: [],
  4675. sourceartilist: [],
  4676. },
  4677. ports: {
  4678. groups: {
  4679. in: {
  4680. position: "left",
  4681. attrs: {
  4682. circle: {
  4683. r: 2.5,
  4684. magnet: true,
  4685. stroke: "black",
  4686. strokeWidth: 1,
  4687. fill: "#fff",
  4688. style: { visibility: true },
  4689. },
  4690. },
  4691. },
  4692. out: {
  4693. position: "right",
  4694. attrs: {
  4695. circle: {
  4696. r: 2.5,
  4697. magnet: true,
  4698. stroke: "black",
  4699. strokeWidth: 1,
  4700. fill: "#fff",
  4701. },
  4702. },
  4703. },
  4704. },
  4705. items: [
  4706. { id: "inport1", group: "in" },
  4707. { id: "inport2", group: "in" },
  4708. { id: "outport1", group: "out" },
  4709. { id: "outport2", group: "out" },
  4710. ],
  4711. },
  4712. id: "2d3ccc77-be7c-4fa0-ae37-a9af4fdf6730",
  4713. zIndex: 6,
  4714. },
  4715. ],
  4716. inputsparameters: [],
  4717. inputsartifacts: [
  4718. {
  4719. paraname: "approxCnt",
  4720. parapath: "/myapps/approx_cnt.npy",
  4721. paradesc: "",
  4722. },
  4723. ],
  4724. argumentsparameters: [],
  4725. argumentsartifacts: [
  4726. {
  4727. paraname: "approxCnt",
  4728. valuefrom:
  4729. "{{tasks.contourApproximate1.outputs.artifacts.approxCnt}}",
  4730. fileurls: [],
  4731. filelist: [],
  4732. value: ["contourApproximate1", "approxCnt"],
  4733. },
  4734. ],
  4735. outputsparameters: [],
  4736. outputsartifacts: [
  4737. {
  4738. paraname: "approxRes2",
  4739. valuefrom: "/myapps/approx_res2.png",
  4740. paradesc: "",
  4741. paratype: "",
  4742. },
  4743. ],
  4744. sourcedatalist: [],
  4745. sourceartilist: [],
  4746. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  4747. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  4748. },
  4749. ports: {
  4750. groups: {
  4751. in: {
  4752. position: "left",
  4753. attrs: {
  4754. circle: {
  4755. r: 2.5,
  4756. magnet: true,
  4757. stroke: "black",
  4758. strokeWidth: 1,
  4759. fill: "#fff",
  4760. style: { visibility: true },
  4761. },
  4762. },
  4763. },
  4764. out: {
  4765. position: "right",
  4766. attrs: {
  4767. circle: {
  4768. r: 2.5,
  4769. magnet: true,
  4770. stroke: "black",
  4771. strokeWidth: 1,
  4772. fill: "#fff",
  4773. },
  4774. },
  4775. },
  4776. },
  4777. items: [
  4778. { id: "inport1", group: "in" },
  4779. { id: "inport2", group: "in" },
  4780. { id: "outport1", group: "out" },
  4781. { id: "outport2", group: "out" },
  4782. ],
  4783. },
  4784. id: "1e868699-e31f-4daf-a07b-7e903c861fba",
  4785. zIndex: 7,
  4786. },
  4787. {
  4788. shape: "edge",
  4789. attrs: {
  4790. line: {
  4791. stroke: "#808080",
  4792. strokeWidth: 1,
  4793. targetMarker: { name: "block", args: { size: "6" } },
  4794. },
  4795. },
  4796. id: "77d0d40f-d287-4223-abfc-0fd17651bb69",
  4797. router: { name: "er", args: { offset: "center" } },
  4798. tools: {
  4799. items: [{ name: "button-remove", args: { distance: -40 } }],
  4800. },
  4801. source: {
  4802. cell: "2d3ccc77-be7c-4fa0-ae37-a9af4fdf6730",
  4803. port: "outport1",
  4804. },
  4805. target: {
  4806. cell: "1e868699-e31f-4daf-a07b-7e903c861fba",
  4807. port: "inport1",
  4808. },
  4809. zIndex: 8,
  4810. },
  4811. {
  4812. shape: "edge",
  4813. attrs: {
  4814. line: {
  4815. stroke: "#808080",
  4816. strokeWidth: 1,
  4817. targetMarker: { name: "block", args: { size: "6" } },
  4818. },
  4819. },
  4820. id: "f46b0a77-d34c-4ec8-8bfd-7b48e412669e",
  4821. router: { name: "er", args: { offset: "center" } },
  4822. tools: {
  4823. items: [{ name: "button-remove", args: { distance: -40 } }],
  4824. },
  4825. source: {
  4826. cell: "fadef8ac-8dcd-4d8e-8968-d156ffd941c5",
  4827. port: "outport2",
  4828. },
  4829. target: {
  4830. cell: "2d3ccc77-be7c-4fa0-ae37-a9af4fdf6730",
  4831. port: "inport1",
  4832. },
  4833. zIndex: 9,
  4834. },
  4835. {
  4836. position: { x: 660, y: 600 },
  4837. size: { width: 90, height: 80 },
  4838. attrs: {
  4839. image: {
  4840. "xlink:href":
  4841. "https://gw.alipayobjects.com/zos/bmw-prod/dc1ced06-417d-466f-927b-b4a4d3265791.svg",
  4842. },
  4843. label: { text: "contourRect1" },
  4844. },
  4845. shape: "template-node",
  4846. data: {
  4847. nodeName: "contourRect1",
  4848. templateName: "contourRect1",
  4849. templateImage: "zvinjodocker/contours_rect1:20211015",
  4850. templateCommand: {},
  4851. templateArgs: {},
  4852. algoparaInput: { userInput: [], getInput: [] },
  4853. algoparaOutput: [],
  4854. algoparaInputargu: { userInput: [], getInput: [] },
  4855. algonodeSource: [
  4856. {
  4857. position: { x: 360, y: 390 },
  4858. size: { width: 90, height: 80 },
  4859. attrs: {
  4860. image: {
  4861. "xlink:href":
  4862. "https://gw.alipayobjects.com/zos/bmw-prod/c36fe7cb-dc24-4854-aeb5-88d8dc36d52e.svg",
  4863. },
  4864. label: { text: "contourApproximate1" },
  4865. },
  4866. shape: "template-node",
  4867. data: {
  4868. nodeName: "contourApproximate1",
  4869. templateName: "contourApproximate1",
  4870. templateImage: "zvinjodocker/contour_approximate1:20211015",
  4871. templateCommand: {},
  4872. templateArgs: {},
  4873. algoparaInput: { userInput: [], getInput: [] },
  4874. algoparaOutput: [],
  4875. algoparaInputargu: { userInput: [], getInput: [] },
  4876. algonodeSource: [
  4877. {
  4878. position: { x: 60, y: 280 },
  4879. size: { width: 90, height: 80 },
  4880. attrs: {
  4881. image: {
  4882. "xlink:href":
  4883. "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
  4884. },
  4885. label: { text: "contourTask1" },
  4886. },
  4887. shape: "template-node",
  4888. data: {
  4889. nodeName: "contourTask1",
  4890. templateName: "contourTask1",
  4891. templateImage: "zvinjodocker/contous_task1:20211014",
  4892. templateCommand: {},
  4893. templateArgs: {},
  4894. algoparaInput: { userInput: [], getInput: [] },
  4895. algoparaOutput: [],
  4896. algoparaInputargu: { userInput: [], getInput: [] },
  4897. algonodeSource: [],
  4898. inputsparameters: [],
  4899. inputsartifacts: [],
  4900. argumentsparameters: [],
  4901. argumentsartifacts: [],
  4902. outputsparameters: [],
  4903. outputsartifacts: [
  4904. {
  4905. paraname: "thresh",
  4906. paradesc: "",
  4907. paratype: "",
  4908. valuefrom: "/myapps/thresh1.png",
  4909. },
  4910. {
  4911. paraname: "contours",
  4912. paradesc: "",
  4913. paratype: "",
  4914. valuefrom: "/myapps/contours.png",
  4915. },
  4916. ],
  4917. sourcedatalist: [],
  4918. sourceartilist: [],
  4919. },
  4920. ports: {
  4921. groups: {
  4922. in: {
  4923. position: "left",
  4924. attrs: {
  4925. circle: {
  4926. r: 2.5,
  4927. magnet: true,
  4928. stroke: "black",
  4929. strokeWidth: 1,
  4930. fill: "#fff",
  4931. style: { visibility: true },
  4932. },
  4933. },
  4934. },
  4935. out: {
  4936. position: "right",
  4937. attrs: {
  4938. circle: {
  4939. r: 2.5,
  4940. magnet: true,
  4941. stroke: "black",
  4942. strokeWidth: 1,
  4943. fill: "#fff",
  4944. },
  4945. },
  4946. },
  4947. },
  4948. items: [
  4949. { id: "inport1", group: "in" },
  4950. { id: "inport2", group: "in" },
  4951. { id: "outport1", group: "out" },
  4952. { id: "outport2", group: "out" },
  4953. ],
  4954. },
  4955. id: "fadef8ac-8dcd-4d8e-8968-d156ffd941c5",
  4956. zIndex: 1,
  4957. },
  4958. ],
  4959. inputsparameters: [],
  4960. inputsartifacts: [],
  4961. argumentsparameters: [],
  4962. argumentsartifacts: [],
  4963. outputsparameters: [],
  4964. outputsartifacts: [
  4965. {
  4966. paraname: "approxCnt",
  4967. valuefrom: "/myapps/approx_cnt.npy",
  4968. paradesc: "",
  4969. paratype: "",
  4970. },
  4971. {
  4972. paraname: "approxRes",
  4973. valuefrom: "/myapps/approx_res.png",
  4974. paradesc: "",
  4975. paratype: "",
  4976. },
  4977. ],
  4978. sourcedatalist: [],
  4979. sourceartilist: [],
  4980. },
  4981. ports: {
  4982. groups: {
  4983. in: {
  4984. position: "left",
  4985. attrs: {
  4986. circle: {
  4987. r: 2.5,
  4988. magnet: true,
  4989. stroke: "black",
  4990. strokeWidth: 1,
  4991. fill: "#fff",
  4992. style: { visibility: true },
  4993. },
  4994. },
  4995. },
  4996. out: {
  4997. position: "right",
  4998. attrs: {
  4999. circle: {
  5000. r: 2.5,
  5001. magnet: true,
  5002. stroke: "black",
  5003. strokeWidth: 1,
  5004. fill: "#fff",
  5005. },
  5006. },
  5007. },
  5008. },
  5009. items: [
  5010. { id: "inport1", group: "in" },
  5011. { id: "inport2", group: "in" },
  5012. { id: "outport1", group: "out" },
  5013. { id: "outport2", group: "out" },
  5014. ],
  5015. },
  5016. id: "2d3ccc77-be7c-4fa0-ae37-a9af4fdf6730",
  5017. zIndex: 6,
  5018. },
  5019. ],
  5020. inputsparameters: [],
  5021. inputsartifacts: [],
  5022. argumentsparameters: [],
  5023. argumentsartifacts: [],
  5024. outputsparameters: [],
  5025. outputsartifacts: [
  5026. {
  5027. paraname: "cnt",
  5028. valuefrom: "/myapps/contour_rect_cnt.npy",
  5029. paradesc: "",
  5030. paratype: "",
  5031. },
  5032. {
  5033. paraname: "contourRect",
  5034. valuefrom: "/myapps/contour_rect.png",
  5035. paradesc: "",
  5036. paratype: "",
  5037. },
  5038. ],
  5039. sourcedatalist: [],
  5040. sourceartilist: [],
  5041. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  5042. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  5043. },
  5044. ports: {
  5045. groups: {
  5046. in: {
  5047. position: "left",
  5048. attrs: {
  5049. circle: {
  5050. r: 2.5,
  5051. magnet: true,
  5052. stroke: "black",
  5053. strokeWidth: 1,
  5054. fill: "#fff",
  5055. style: { visibility: true },
  5056. },
  5057. },
  5058. },
  5059. out: {
  5060. position: "right",
  5061. attrs: {
  5062. circle: {
  5063. r: 2.5,
  5064. magnet: true,
  5065. stroke: "black",
  5066. strokeWidth: 1,
  5067. fill: "#fff",
  5068. },
  5069. },
  5070. },
  5071. },
  5072. items: [
  5073. { id: "inport1", group: "in" },
  5074. { id: "inport2", group: "in" },
  5075. { id: "outport1", group: "out" },
  5076. { id: "outport2", group: "out" },
  5077. ],
  5078. },
  5079. id: "6d787d4a-a68d-4a8c-a3b9-559eb5d4e231",
  5080. zIndex: 10,
  5081. },
  5082. {
  5083. position: { x: 910, y: 600 },
  5084. size: { width: 90, height: 80 },
  5085. attrs: {
  5086. image: {
  5087. "xlink:href":
  5088. "https://gw.alipayobjects.com/zos/bmw-prod/687b6cb9-4b97-42a6-96d0-34b3099133ac.svg",
  5089. },
  5090. label: { text: "contourCircle2" },
  5091. },
  5092. shape: "template-node",
  5093. data: {
  5094. nodeName: "contourCircle2",
  5095. templateName: "contourCircle2",
  5096. templateImage: "zvinjodocker/contours_circle2:20211015",
  5097. templateCommand: {},
  5098. templateArgs: {},
  5099. algoparaInput: { userInput: [], getInput: [] },
  5100. algoparaOutput: [],
  5101. algoparaInputargu: { userInput: [], getInput: [] },
  5102. algonodeSource: [
  5103. {
  5104. position: { x: 660, y: 600 },
  5105. size: { width: 90, height: 80 },
  5106. attrs: {
  5107. image: {
  5108. "xlink:href":
  5109. "https://gw.alipayobjects.com/zos/bmw-prod/dc1ced06-417d-466f-927b-b4a4d3265791.svg",
  5110. },
  5111. label: { text: "contourRect1" },
  5112. },
  5113. shape: "template-node",
  5114. data: {
  5115. nodeName: "contourRect1",
  5116. templateName: "contourRect1",
  5117. templateImage: "zvinjodocker/contours_rect1:20211015",
  5118. templateCommand: {},
  5119. templateArgs: {},
  5120. algoparaInput: { userInput: [], getInput: [] },
  5121. algoparaOutput: [],
  5122. algoparaInputargu: { userInput: [], getInput: [] },
  5123. algonodeSource: [
  5124. {
  5125. position: { x: 360, y: 390 },
  5126. size: { width: 90, height: 80 },
  5127. attrs: {
  5128. image: {
  5129. "xlink:href":
  5130. "https://gw.alipayobjects.com/zos/bmw-prod/c36fe7cb-dc24-4854-aeb5-88d8dc36d52e.svg",
  5131. },
  5132. label: { text: "contourApproximate1" },
  5133. },
  5134. shape: "template-node",
  5135. data: {
  5136. nodeName: "contourApproximate1",
  5137. templateName: "contourApproximate1",
  5138. templateImage:
  5139. "zvinjodocker/contour_approximate1:20211015",
  5140. templateCommand: {},
  5141. templateArgs: {},
  5142. algoparaInput: { userInput: [], getInput: [] },
  5143. algoparaOutput: [],
  5144. algoparaInputargu: { userInput: [], getInput: [] },
  5145. algonodeSource: [
  5146. {
  5147. position: { x: 60, y: 280 },
  5148. size: { width: 90, height: 80 },
  5149. attrs: {
  5150. image: {
  5151. "xlink:href":
  5152. "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
  5153. },
  5154. label: { text: "contourTask1" },
  5155. },
  5156. shape: "template-node",
  5157. data: {
  5158. nodeName: "contourTask1",
  5159. templateName: "contourTask1",
  5160. templateImage:
  5161. "zvinjodocker/contous_task1:20211014",
  5162. templateCommand: {},
  5163. templateArgs: {},
  5164. algoparaInput: { userInput: [], getInput: [] },
  5165. algoparaOutput: [],
  5166. algoparaInputargu: {
  5167. userInput: [],
  5168. getInput: [],
  5169. },
  5170. algonodeSource: [],
  5171. inputsparameters: [],
  5172. inputsartifacts: [],
  5173. argumentsparameters: [],
  5174. argumentsartifacts: [],
  5175. outputsparameters: [],
  5176. outputsartifacts: [
  5177. {
  5178. paraname: "thresh",
  5179. paradesc: "",
  5180. paratype: "",
  5181. valuefrom: "/myapps/thresh1.png",
  5182. },
  5183. {
  5184. paraname: "contours",
  5185. paradesc: "",
  5186. paratype: "",
  5187. valuefrom: "/myapps/contours.png",
  5188. },
  5189. ],
  5190. sourcedatalist: [],
  5191. sourceartilist: [],
  5192. },
  5193. ports: {
  5194. groups: {
  5195. in: {
  5196. position: "left",
  5197. attrs: {
  5198. circle: {
  5199. r: 2.5,
  5200. magnet: true,
  5201. stroke: "black",
  5202. strokeWidth: 1,
  5203. fill: "#fff",
  5204. style: { visibility: true },
  5205. },
  5206. },
  5207. },
  5208. out: {
  5209. position: "right",
  5210. attrs: {
  5211. circle: {
  5212. r: 2.5,
  5213. magnet: true,
  5214. stroke: "black",
  5215. strokeWidth: 1,
  5216. fill: "#fff",
  5217. },
  5218. },
  5219. },
  5220. },
  5221. items: [
  5222. { id: "inport1", group: "in" },
  5223. { id: "inport2", group: "in" },
  5224. { id: "outport1", group: "out" },
  5225. { id: "outport2", group: "out" },
  5226. ],
  5227. },
  5228. id: "fadef8ac-8dcd-4d8e-8968-d156ffd941c5",
  5229. zIndex: 1,
  5230. },
  5231. ],
  5232. inputsparameters: [],
  5233. inputsartifacts: [],
  5234. argumentsparameters: [],
  5235. argumentsartifacts: [],
  5236. outputsparameters: [],
  5237. outputsartifacts: [
  5238. {
  5239. paraname: "approxCnt",
  5240. valuefrom: "/myapps/approx_cnt.npy",
  5241. paradesc: "",
  5242. paratype: "",
  5243. },
  5244. {
  5245. paraname: "approxRes",
  5246. valuefrom: "/myapps/approx_res.png",
  5247. paradesc: "",
  5248. paratype: "",
  5249. },
  5250. ],
  5251. sourcedatalist: [],
  5252. sourceartilist: [],
  5253. },
  5254. ports: {
  5255. groups: {
  5256. in: {
  5257. position: "left",
  5258. attrs: {
  5259. circle: {
  5260. r: 2.5,
  5261. magnet: true,
  5262. stroke: "black",
  5263. strokeWidth: 1,
  5264. fill: "#fff",
  5265. style: { visibility: true },
  5266. },
  5267. },
  5268. },
  5269. out: {
  5270. position: "right",
  5271. attrs: {
  5272. circle: {
  5273. r: 2.5,
  5274. magnet: true,
  5275. stroke: "black",
  5276. strokeWidth: 1,
  5277. fill: "#fff",
  5278. },
  5279. },
  5280. },
  5281. },
  5282. items: [
  5283. { id: "inport1", group: "in" },
  5284. { id: "inport2", group: "in" },
  5285. { id: "outport1", group: "out" },
  5286. { id: "outport2", group: "out" },
  5287. ],
  5288. },
  5289. id: "2d3ccc77-be7c-4fa0-ae37-a9af4fdf6730",
  5290. zIndex: 6,
  5291. },
  5292. ],
  5293. inputsparameters: [],
  5294. inputsartifacts: [],
  5295. argumentsparameters: [],
  5296. argumentsartifacts: [],
  5297. outputsparameters: [],
  5298. outputsartifacts: [
  5299. {
  5300. paraname: "cnt",
  5301. valuefrom: "/myapps/contour_rect_cnt.npy",
  5302. paradesc: "",
  5303. paratype: "",
  5304. },
  5305. {
  5306. paraname: "contourRect",
  5307. valuefrom: "/myapps/contour_rect.png",
  5308. paradesc: "",
  5309. paratype: "",
  5310. },
  5311. ],
  5312. sourcedatalist: [],
  5313. sourceartilist: [],
  5314. },
  5315. ports: {
  5316. groups: {
  5317. in: {
  5318. position: "left",
  5319. attrs: {
  5320. circle: {
  5321. r: 2.5,
  5322. magnet: true,
  5323. stroke: "black",
  5324. strokeWidth: 1,
  5325. fill: "#fff",
  5326. style: { visibility: true },
  5327. },
  5328. },
  5329. },
  5330. out: {
  5331. position: "right",
  5332. attrs: {
  5333. circle: {
  5334. r: 2.5,
  5335. magnet: true,
  5336. stroke: "black",
  5337. strokeWidth: 1,
  5338. fill: "#fff",
  5339. },
  5340. },
  5341. },
  5342. },
  5343. items: [
  5344. { id: "inport1", group: "in" },
  5345. { id: "inport2", group: "in" },
  5346. { id: "outport1", group: "out" },
  5347. { id: "outport2", group: "out" },
  5348. ],
  5349. },
  5350. id: "6d787d4a-a68d-4a8c-a3b9-559eb5d4e231",
  5351. zIndex: 10,
  5352. },
  5353. ],
  5354. inputsparameters: [],
  5355. inputsartifacts: [
  5356. {
  5357. paraname: "contourRect",
  5358. parapath: "/myapps/contour_rect.png",
  5359. paradesc: "",
  5360. },
  5361. {
  5362. paraname: "cnt",
  5363. parapath: "/myapps/contour_rect_cnt.npy",
  5364. paradesc: "",
  5365. },
  5366. ],
  5367. argumentsparameters: [],
  5368. argumentsartifacts: [
  5369. {
  5370. paraname: "contourRect",
  5371. valuefrom:
  5372. "{{tasks.contourRect1.outputs.artifacts.contourRect}}",
  5373. fileurls: [],
  5374. filelist: [],
  5375. value: ["contourRect1", "contourRect"],
  5376. },
  5377. {
  5378. paraname: "cnt",
  5379. valuefrom: "{{tasks.contourRect1.outputs.artifacts.cnt}}",
  5380. fileurls: [],
  5381. filelist: [],
  5382. value: ["contourRect1", "cnt"],
  5383. },
  5384. ],
  5385. outputsparameters: [],
  5386. outputsartifacts: [
  5387. {
  5388. paraname: "contourCircle",
  5389. valuefrom: "contour_circle.png",
  5390. paradesc: "",
  5391. paratype: "",
  5392. },
  5393. ],
  5394. sourcedatalist: [],
  5395. sourceartilist: [],
  5396. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  5397. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  5398. },
  5399. ports: {
  5400. groups: {
  5401. in: {
  5402. position: "left",
  5403. attrs: {
  5404. circle: {
  5405. r: 2.5,
  5406. magnet: true,
  5407. stroke: "black",
  5408. strokeWidth: 1,
  5409. fill: "#fff",
  5410. style: { visibility: true },
  5411. },
  5412. },
  5413. },
  5414. out: {
  5415. position: "right",
  5416. attrs: {
  5417. circle: {
  5418. r: 2.5,
  5419. magnet: true,
  5420. stroke: "black",
  5421. strokeWidth: 1,
  5422. fill: "#fff",
  5423. },
  5424. },
  5425. },
  5426. },
  5427. items: [
  5428. { id: "inport1", group: "in" },
  5429. { id: "inport2", group: "in" },
  5430. { id: "outport1", group: "out" },
  5431. { id: "outport2", group: "out" },
  5432. ],
  5433. },
  5434. id: "283ddff1-40c9-43aa-b581-b99706e65fb3",
  5435. zIndex: 11,
  5436. },
  5437. {
  5438. shape: "edge",
  5439. attrs: {
  5440. line: {
  5441. stroke: "#808080",
  5442. strokeWidth: 1,
  5443. targetMarker: { name: "block", args: { size: "6" } },
  5444. },
  5445. },
  5446. id: "5f83bef7-8f4c-4b6a-ac51-b076c1e03042",
  5447. router: { name: "er", args: { offset: "center" } },
  5448. tools: {
  5449. items: [{ name: "button-remove", args: { distance: -40 } }],
  5450. },
  5451. source: {
  5452. cell: "2d3ccc77-be7c-4fa0-ae37-a9af4fdf6730",
  5453. port: "outport2",
  5454. },
  5455. target: {
  5456. cell: "6d787d4a-a68d-4a8c-a3b9-559eb5d4e231",
  5457. port: "inport1",
  5458. },
  5459. zIndex: 12,
  5460. },
  5461. {
  5462. shape: "edge",
  5463. attrs: {
  5464. line: {
  5465. stroke: "#808080",
  5466. strokeWidth: 1,
  5467. targetMarker: { name: "block", args: { size: "6" } },
  5468. },
  5469. },
  5470. id: "9017467c-167e-4f01-97dd-37d2d42bd0ed",
  5471. router: { name: "er", args: { offset: "center" } },
  5472. tools: {
  5473. items: [{ name: "button-remove", args: { distance: -40 } }],
  5474. },
  5475. source: {
  5476. cell: "6d787d4a-a68d-4a8c-a3b9-559eb5d4e231",
  5477. port: "outport1",
  5478. },
  5479. target: {
  5480. cell: "283ddff1-40c9-43aa-b581-b99706e65fb3",
  5481. port: "inport1",
  5482. },
  5483. zIndex: 13,
  5484. },
  5485. ]);
  5486. console.log("fromJson");
  5487. },
  5488. //20211110
  5489. // 获取数据列表------------------20211115 可能后续需要将 其改为workflowdatalist
  5490. getDataList() {
  5491. this.dataListLoading = true;
  5492. this.$http({
  5493. url: this.$http.adornUrl("/sys/visiworkflow/list"),
  5494. method: "get",
  5495. params: this.$http.adornParams({
  5496. page: 1,
  5497. limit: 100,
  5498. key: "",
  5499. // page: this.pageIndex,
  5500. // limit: this.pageSize,
  5501. // key: this.dataForm.key,
  5502. }),
  5503. }).then(({ data }) => {
  5504. if (data && data.code === 0) {
  5505. this.workflowdataList = data.page.list;
  5506. this.workflowtotalPage = data.page.totalCount;
  5507. } else {
  5508. this.workflowdataList = [];
  5509. this.workflowtotalPage = 0;
  5510. }
  5511. this.dataListLoading = false;
  5512. });
  5513. },
  5514. // 每页数 ---避免与其他函数冲突,可能需要改参数 1115
  5515. sizeChangeHandle(val) {
  5516. this.pageSize = val;
  5517. this.pageIndex = 1;
  5518. this.getDataList();
  5519. },
  5520. // 当前页
  5521. currentChangeHandle(val) {
  5522. this.pageIndex = val;
  5523. this.getDataList();
  5524. },
  5525. // 多选
  5526. selectionChangeHandle(val) {
  5527. this.dataListSelections = val;
  5528. },
  5529. //20210805 zhang 右侧参数设置栏 design-panel
  5530. handleFormLayoutChange(e) {
  5531. this.formLayout = e.target.value;
  5532. },
  5533. callback(key) {
  5534. console.log(key);
  5535. },
  5536. //20211115 获取左侧树形组件栏 算法模块节点列表
  5537. // 获取数据列表
  5538. getalgorithmDataList() {
  5539. this.dataListLoading = true;
  5540. this.$http({
  5541. url: this.$http.adornUrl("/sys/visialgorithmnode/list"),
  5542. method: "get",
  5543. params: this.$http.adornParams({
  5544. page: 1,
  5545. limit: 100,
  5546. // key: "",
  5547. }),
  5548. }).then(({ data }) => {
  5549. if (data && data.code === 0) {
  5550. this.algorithmdataList = data.page.list;
  5551. this.algorithmtotalPage = data.page.totalCount;
  5552. //20211115 已成功
  5553. console.log("20211115 左侧节点栏数据");
  5554. console.log(this.algorithmdataList);
  5555. this.createAlgorithmNode();
  5556. } else {
  5557. this.algorithmdataList = [];
  5558. this.totalPage = 0;
  5559. console.log("20211115 左侧节点栏数据 为空");
  5560. console.log(this.algorithmdataList);
  5561. }
  5562. this.dataListLoading = false;
  5563. });
  5564. },
  5565. //添加函数 ----根据数据库中的数据来创建画布中的节点, ----树形组件中的数据包括键
  5566. // 左侧树形组件栏读取数据库表visi_algorithmnode中数据,添加至树形组件treedata中,并创建对应画布节点后添加至nodedata中,可通过点击树形组件栏在画布中创建对应节点的克隆。------已成功
  5567. createAlgorithmNode() {
  5568. this.treeData = [
  5569. {
  5570. title: "操作节点",
  5571. key: "0-0",
  5572. slots: {
  5573. icon: "smile",
  5574. },
  5575. children: [
  5576. // {
  5577. // title: "consume_artifact",
  5578. // key: "consume_artifact",
  5579. // slots: { icon: "meh" },
  5580. // },
  5581. // {
  5582. // title: "generate_artifact",
  5583. // key: "generate_artifact",
  5584. // scopedSlots: { icon: "custom" },
  5585. // },
  5586. // {
  5587. // title: "zdockertest",
  5588. // key: "zdockertest",
  5589. // scopedSlots: { icon: "custom" },
  5590. // },
  5591. {
  5592. title: "条件节点",
  5593. key: "条件节点",
  5594. scopedSlots: { icon: "custom" },
  5595. },
  5596. {
  5597. title: "输入节点",
  5598. key: "dataInputnode",
  5599. scopedSlots: { icon: "custom" },
  5600. },
  5601. {
  5602. title: "输出节点",
  5603. key: "dataOutputnode",
  5604. scopedSlots: { icon: "custom" },
  5605. },
  5606. ],
  5607. },
  5608. {
  5609. title: "轮廓识别",
  5610. key: "0-1",
  5611. slots: {
  5612. icon: "smile",
  5613. },
  5614. children: [
  5615. {
  5616. title: "contourTask1",
  5617. key: "contourTask1",
  5618. scopedSlots: { icon: "custom" },
  5619. },
  5620. {
  5621. title: "contourTask2",
  5622. key: "contourTask2",
  5623. scopedSlots: { icon: "custom" },
  5624. },
  5625. {
  5626. title: "contourTask3",
  5627. key: "contourTask3",
  5628. scopedSlots: { icon: "custom" },
  5629. },
  5630. {
  5631. title: "contourApproximate1",
  5632. key: "contourApproximate1",
  5633. scopedSlots: { icon: "custom" },
  5634. },
  5635. {
  5636. title: "contourApproximate2",
  5637. key: "contourApproximate2",
  5638. scopedSlots: { icon: "custom" },
  5639. },
  5640. {
  5641. title: "contourRect1",
  5642. key: "contourRect1",
  5643. scopedSlots: { icon: "custom" },
  5644. },
  5645. {
  5646. title: "contourCircle2",
  5647. key: "contourCircle2",
  5648. scopedSlots: { icon: "custom" },
  5649. },
  5650. ],
  5651. },
  5652. ];
  5653. for (var i = 0; i < this.algorithmdataList.length; i++) {
  5654. // //遍历数组
  5655. // console.log(i);
  5656. // console.log(this.algorithmdataList[i].algonodeName);
  5657. // console.log(this.algorithmdataList[i].algonodeImage);
  5658. // console.log(JSON.parse(this.algorithmdataList[i].algoparatempJson)); //将string转化为Json
  5659. // console.log(
  5660. // JSON.parse(this.algorithmdataList[i].algoparatempJson).Input
  5661. // );
  5662. // console.log(
  5663. // JSON.parse(this.algorithmdataList[i].algoparatempJson).Output
  5664. // );
  5665. // console.log("treeData");
  5666. // console.log(this.treeData);
  5667. // this.treeData[1].children.addNode({
  5668. // title: "this.algorithmdataList[i].algonodeName",
  5669. // key: "this.algorithmdataList[i].algonodeName",
  5670. // scopedSlots: { icon: "custom" },
  5671. // })
  5672. var addalgotree = false; //标志 目录树是否已添加该节点
  5673. for (var j = 0; j < this.treeData.length; j++) {
  5674. if (
  5675. this.treeData[j].title == this.algorithmdataList[i].algotreetype
  5676. ) {
  5677. // //判断是否已有该节点
  5678. // for (var k = 0; k < this.treeData.children.length; k++) {
  5679. // if (
  5680. // this.treeData.children[k].key ==
  5681. // this.algorithmdataList[i].algonodeName
  5682. // ) {
  5683. // addalgotree = true;
  5684. // break;
  5685. // }
  5686. // }
  5687. // if (!addalgotree) {
  5688. this.treeData[j].children.push({
  5689. title: this.algorithmdataList[i].algonodeName,
  5690. key: this.algorithmdataList[i].algonodeName,
  5691. scopedSlots: { icon: "custom" },
  5692. });
  5693. addalgotree = true;
  5694. // break;
  5695. // }
  5696. }
  5697. }
  5698. if (!addalgotree) {
  5699. this.treeData.push({
  5700. title: this.algorithmdataList[i].algotreetype,
  5701. key: this.algorithmdataList[i].algotreetype,
  5702. scopedSlots: { icon: "custom" },
  5703. children: [
  5704. {
  5705. title: this.algorithmdataList[i].algonodeName,
  5706. key: this.algorithmdataList[i].algonodeName,
  5707. scopedSlots: { icon: "custom" },
  5708. },
  5709. ],
  5710. });
  5711. }
  5712. // this.treeData[1].children.push({
  5713. // title: this.algorithmdataList[i].algonodeName,
  5714. // key: this.algorithmdataList[i].algonodeName,
  5715. // scopedSlots: { icon: "custom" },
  5716. // });
  5717. console.log(this.treeData);
  5718. // var imageurl =
  5719. // "/src/assets/img/" + this.algorithmdataList[i].algonodeName + ".svg";
  5720. //节点名称后跟随机参数
  5721. if (
  5722. this.algorithmdataList[i].algotreetype != "传统算法" &&
  5723. this.algorithmdataList[i].algotreetype != "智能应用"
  5724. ) {
  5725. this.imageurl = require("@/assets/img/visisvg/" +
  5726. this.algorithmdataList[i].algonodeName +
  5727. ".svg");
  5728. }
  5729. var newalgonode = this.graph.createNode({
  5730. x: 0,
  5731. y: 0,
  5732. // width: 170,
  5733. // height: 30,
  5734. shape: "template-node",
  5735. // label: "consume_artifact",
  5736. attrs: {
  5737. label: {
  5738. text: this.algorithmdataList[i].algonodeName, //"contour_task1",
  5739. // text: this.algorithmdataList[i].algonodeName, //"contour_task1",
  5740. },
  5741. body: {
  5742. // stroke: "#2CB9FF",
  5743. // fill: "#2CB9FF",
  5744. fill: "#d3ebf3",
  5745. },
  5746. // body: {
  5747. // stroke: "#DA2625",
  5748. // fill: "#DA2625",
  5749. // },
  5750. image: {
  5751. "xlink:href": this.imageurl,
  5752. // "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
  5753. // "src/views/modules/visi/visisvg/算法.svg", /src/assets/img/ ../../../assets/img/
  5754. //可放图标
  5755. },
  5756. },
  5757. data: {
  5758. algonodeId: this.algorithmdataList[i].algonodeId,
  5759. nodeName: this.algorithmdataList[i].algonodeName,
  5760. templateName: this.algorithmdataList[i].algonodeName,
  5761. templateImage: this.algorithmdataList[i].algonodeImage,
  5762. templateCommand: {
  5763. // 1: "sh",
  5764. // 2: "-c",
  5765. // 2:"\"{{inputs.parameters.message}}\""
  5766. },
  5767. //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
  5768. // templateCommand2: [
  5769. // {
  5770. // 1:"echo"
  5771. // },
  5772. // {
  5773. // 2:"{{inputs.parameters.message}}"
  5774. // },
  5775. // ],
  5776. templateArgs: {
  5777. // 1: "cat /tmp/message",
  5778. },
  5779. algoparaInput: JSON.parse(
  5780. this.algorithmdataList[i].algoparatempJson
  5781. ).Input,
  5782. algoparaOutput: JSON.parse(
  5783. this.algorithmdataList[i].algoparatempJson
  5784. ).Output,
  5785. algoparaOutAddress: this.algorithmdataList[i].algoparaoutputAddress,
  5786. algonodeSource: [],
  5787. inputsparameters: JSON.parse(
  5788. this.algorithmdataList[i].algoparatempJson
  5789. ).Input.ParameterInput,
  5790. inputsartifacts: JSON.parse(
  5791. this.algorithmdataList[i].algoparatempJson
  5792. ).Input.FileInput,
  5793. //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
  5794. //应对应input中的各项参数设置对应参数
  5795. argumentsparameters: JSON.parse(
  5796. this.algorithmdataList[i].algoparatempJson
  5797. ).Input.ParameterInput,
  5798. argumentsartifacts: JSON.parse(
  5799. this.algorithmdataList[i].algoparatempJson
  5800. ).Input.FileInput,
  5801. outputsparameters: JSON.parse(
  5802. this.algorithmdataList[i].algoparatempJson
  5803. ).Output.ParameterOutput,
  5804. outputsartifacts: JSON.parse(
  5805. this.algorithmdataList[i].algoparatempJson
  5806. ).Output.FileOutput,
  5807. //获取到的连接线源的数据 连接线的源的输出数据
  5808. sourcedatalist: [],
  5809. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  5810. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  5811. wftempname: "", //保存Template name
  5812. },
  5813. });
  5814. this.nodedata.push(newalgonode);
  5815. console.log(newalgonode.getData());
  5816. }
  5817. },
  5818. //20211115 左侧栏新增节点测试,未完成 ---------仅测试通过,可存入,需结合新增前端页面重新配置
  5819. addalgorithmdata() {
  5820. this.$http({
  5821. url: this.$http.adornUrl("/sys/visialgorithmnode/save"),
  5822. method: "post",
  5823. data: this.$http.adornData({
  5824. userId: this.$store.state.user.id,
  5825. algonodeId: undefined,
  5826. algonodeName: "contourCircle2",
  5827. algonodeImage: "zvinjodocker/contours_circle2:20211015",
  5828. algoparatempJson: JSON.stringify({
  5829. Input: [
  5830. { paraname: " cnt", paratype: " ", paradesc: " " },
  5831. { paraname: "contour", paratype: " ", paradesc: " " },
  5832. ],
  5833. Output: [
  5834. { paraname: " ", paratype: " ", paradesc: " " },
  5835. { paraname: "", paratype: " ", paradesc: " " },
  5836. ],
  5837. }),
  5838. algoparaoutputAddress: "", //this.dataForm.algoparaoutputAddress
  5839. // userId: this.dataForm.userId,
  5840. // algonodeId: this.dataForm.algonodeId || undefined,
  5841. // algonodeName: this.dataForm.algonodeName,
  5842. // algonodeImage: this.dataForm.algonodeImage,
  5843. // algoparatempJson: this.dataForm.algoparatempJson,
  5844. }),
  5845. }).then(({ data }) => {
  5846. if (data && data.code === 0) {
  5847. Message.success("操作成功");
  5848. // this.$message({
  5849. // message: "操作成功",
  5850. // type: "success",
  5851. // duration: 1500,
  5852. // onClose: () => {
  5853. // this.visible = false;
  5854. // this.$emit("refreshDataList");
  5855. // },
  5856. // });
  5857. } else {
  5858. Message.error(data.msg);
  5859. // this.$message.error(data.msg);
  5860. }
  5861. });
  5862. // this.$refs['dataForm'].validate((valid) => {
  5863. // if (valid) {
  5864. // this.$http({
  5865. // url: this.$http.adornUrl(`/generator/visialgorithmnode/${!this.dataForm.algonodeId ? 'save' : 'update'}`),
  5866. // method: 'post',
  5867. // data: this.$http.adornData({
  5868. // 'userId': this.dataForm.userId,
  5869. // 'algonodeId': this.dataForm.algonodeId || undefined,
  5870. // 'algonodeName': this.dataForm.algonodeName,
  5871. // 'algonodeImage': this.dataForm.algonodeImage,
  5872. // 'algoparatempJson': this.dataForm.algoparatempJson
  5873. // })
  5874. // }).then(({data}) => {
  5875. // if (data && data.code === 0) {
  5876. // this.$message({
  5877. // message: '操作成功',
  5878. // type: 'success',
  5879. // duration: 1500,
  5880. // onClose: () => {
  5881. // this.visible = false
  5882. // this.$emit('refreshDataList')
  5883. // }
  5884. // })
  5885. // } else {
  5886. // this.$message.error(data.msg)
  5887. // }
  5888. // })
  5889. // }
  5890. // })
  5891. },
  5892. //保存实验名称
  5893. primaryExperimentConfig(args) {
  5894. console.log("保存实验名称");
  5895. console.log(args);
  5896. this.experimentName = args[0];
  5897. console.log(this.experimentName);
  5898. },
  5899. //20210810 保存条件节点设置
  5900. primaryConNodeConfig(args) {
  5901. this.graph
  5902. .getCellById(args[1].id)
  5903. .setData({ inputcondition: args[1].getData().inputcondition });
  5904. this.graph
  5905. .getCellById(args[1].id)
  5906. .setData({ nodeName: args[1].getData().nodeName });
  5907. //20210811 测试用
  5908. // //model 获取节点信息
  5909. // //遍历节点信息, 比对节点id 然后赋值
  5910. // console.log("cell:"+args[1]);
  5911. // console.log("cell:"+args[1].id);
  5912. // //返回 [Object,Object ]
  5913. // console.log("对应id的node:"+this.graph.getCellById(args[1]));
  5914. // console.log("更改过的inputcondition:"+args[1].getData("inputcondition"));
  5915. // console.log(args[1].getData().inputcondition);
  5916. // const condition = args[1].getData().inputcondition;
  5917. // this.graph.getCellById(args[1].id).setData({inputcondition: condition});
  5918. // console.log(args[1])
  5919. // console.log("graph node:"+this.graph.getNodes());
  5920. },
  5921. //20210811 保存templateNode节点设置 仅参数设置
  5922. primaryNodeConfig(args) {
  5923. var primarydata = args[1].getData();
  5924. //先保存一遍,做处理在保存一遍
  5925. console.log("更改前");
  5926. console.log(this.graph.getCellById(args[1].id));
  5927. //此部分应该只是展示,不可更改
  5928. // this.graph.getCellById(args[1].id).setData({templateName:primarydata.templateName});
  5929. // this.graph.getCellById(args[1].id).setData({templateImage: primarydata.templateImage});
  5930. // this.graph.getCellById(args[1].id).setData({templateCommand: primarydata.templateCommand});
  5931. // this.graph.getCellById(args[1].id).setData({templateArgs: primarydata.templateArgs});
  5932. // this.graph.getCellById(args[1].id).setData({inputsparameters: primarydata.inputsparameters}); //应该是不变的
  5933. // this.graph.getCellById(args[1].id).setData({outputsparameters: primarydata.outputsparameters}); //应该是不变的
  5934. //仅可更改argumentsparameters 具体对接 还需实现后端
  5935. //20211124 primarydata
  5936. //保存参数类型
  5937. for (var i = 0; i < primarydata.argumentsparameters.length; i++) {
  5938. if (primarydata.argumentsparameters[i].hasOwnProperty("quotevalue")) {
  5939. //成功
  5940. // if (primarydata.argumentsparameters[i].quotevalue && primarydata.argumentsparameters[i].quotevalue.length == 2) {
  5941. // primarydata.argumentsparameters[i].valuefrom =
  5942. // "{{tasks." +
  5943. // primarydata.argumentsparameters[i].quotevalue[0] +
  5944. // ".outputs.parameters." +
  5945. // primarydata.argumentsparameters[i].quotevalue[1] +
  5946. // "}}";
  5947. // console.log(primarydata.argumentsparameters[i].valuefrom)
  5948. // }
  5949. // 引用其他算法节点参数类型输入改为多选节点之后
  5950. primarydata.argumentsparameters[i].valuefrom = [];
  5951. if (
  5952. primarydata.argumentsparameters[i].quotevalue &&
  5953. primarydata.argumentsparameters[i].quotevalue.length != 0
  5954. ) {
  5955. // primarydata.argumentsparameters[i].valuefrom = [];
  5956. for (
  5957. var j = 0;
  5958. j < primarydata.argumentsparameters[i].quotevalue.length;
  5959. j++
  5960. ) {
  5961. console.log(
  5962. " quotevalue.length " +
  5963. primarydata.argumentsparameters[i].quotevalue.length
  5964. );
  5965. primarydata.argumentsparameters[i].valuefrom.push(
  5966. "{{tasks." +
  5967. primarydata.argumentsparameters[i].quotevalue[j][0] +
  5968. ".outputs.parameters." +
  5969. primarydata.argumentsparameters[i].quotevalue[j][1] +
  5970. "}}"
  5971. );
  5972. }
  5973. console.log(primarydata.argumentsparameters[i].valuefrom);
  5974. }
  5975. }
  5976. }
  5977. //保存文件类型
  5978. // const curfilelist = [];
  5979. let filedata = new FormData(); //保存文件内容,传递给后端---遍历完所有的argumentartifact之后统一上传
  5980. for (var i = 0; i < primarydata.argumentsartifacts.length; i++) {
  5981. if (primarydata.argumentsartifacts[i].hasOwnProperty("quotevalue")) {
  5982. if (
  5983. primarydata.argumentsartifacts[i].quotevalue &&
  5984. primarydata.argumentsartifacts[i].quotevalue.length == 2
  5985. ) {
  5986. primarydata.argumentsartifacts[i].valuefrom =
  5987. "{{tasks." +
  5988. primarydata.argumentsartifacts[i].quotevalue[0] +
  5989. ".outputs.artifacts." +
  5990. primarydata.argumentsartifacts[i].quotevalue[1] +
  5991. "}}";
  5992. }
  5993. }
  5994. //1125 需后端保存至 minio 中,返回地址 -----或者在画布提交之后,上传,在应用具体地址信息
  5995. if (primarydata.argumentsartifacts[i].hasOwnProperty("filelist")) {
  5996. if (primarydata.argumentsartifacts[i].filelist.length != 0) {
  5997. const curfilelist = [];
  5998. // const curfileurl = []; //设定一次只能传一个
  5999. // let filedata = new FormData(); //保存文件内容,传递给后端
  6000. for (
  6001. var j = 0;
  6002. j < primarydata.argumentsartifacts[i].filelist.length;
  6003. j++
  6004. ) {
  6005. curfilelist.push(
  6006. primarydata.argumentsartifacts[i].filelist[j].raw
  6007. );
  6008. // filedata.append("file",primarydata.argumentsartifacts[i].filelist[j].raw);
  6009. }
  6010. primarydata.argumentsartifacts[i].filelist = curfilelist;
  6011. // filedata.append("file"+primarydata.argumentsartifacts[i].paraname,primarydata.argumentsartifacts[i].filelist[0].raw);//每个参数仅可输入一个文件
  6012. filedata.append(
  6013. primarydata.argumentsartifacts[i].paraname,
  6014. curfilelist[0]
  6015. ); //每个参数仅可输入一个文件
  6016. // console.log(filedata.get(primarydata.argumentsartifacts[i].paraname));
  6017. }
  6018. }
  6019. }
  6020. if (filedata != null) {
  6021. var jsonfileurl = {};
  6022. this.$http({
  6023. url: this.$http.adornUrl("/visi/visiworkflow/savefile"),
  6024. method: "post",
  6025. data: filedata,
  6026. }).then(({ data }) => {
  6027. if (data && data.code === 0) {
  6028. jsonfileurl = data.jsonfileurl;
  6029. for (var i = 0; i < primarydata.argumentsartifacts.length; i++) {
  6030. if (
  6031. jsonfileurl.hasOwnProperty(
  6032. primarydata.argumentsartifacts[i].paraname
  6033. )
  6034. ) {
  6035. console.log(
  6036. jsonfileurl[primarydata.argumentsartifacts[i].paraname]
  6037. );
  6038. primarydata.argumentsartifacts[i].fileurls.push(
  6039. jsonfileurl[primarydata.argumentsartifacts[i].paraname]
  6040. );
  6041. this.graph.getCellById(args[1].id).setData(primarydata); //终于好了 20211130
  6042. }
  6043. }
  6044. // console.log(data.jsonfileurl)
  6045. // fileurls = data.fileurls;
  6046. // curfileurl.push(data.fileurls);
  6047. /////设置的都是 i,为什么无论怎样都会赋值给 0
  6048. // primarydata.argumentsartifacts[i].fileurls=data.fileurls;
  6049. // console.log("i")
  6050. // this.graph.getCellById(args[1].id).setData(primarydata); //成功成功
  6051. // this.$message({
  6052. // message: "操作成功",
  6053. // type: "success",
  6054. // duration: 1500,
  6055. // onClose: () => {
  6056. // // this.getDataList();
  6057. // },
  6058. // });
  6059. } else {
  6060. Message.error(data.msg);
  6061. // this.$message.error(data.msg);
  6062. }
  6063. });
  6064. }
  6065. // this.graph.getCellById(args[1].id).setData(primarydata); //对应input 保存相应输入的值
  6066. this.graph
  6067. .getCellById(args[1].id)
  6068. .setData({ argumentsparameters: primarydata.argumentsparameters }); //对应input 保存相应输入的值
  6069. this.graph
  6070. .getCellById(args[1].id)
  6071. .setData({ argumentsartifacts: primarydata.argumentsartifacts }); //对应input 保存相应输入的值
  6072. console.log("当前节点值");
  6073. console.log(this.graph.getCellById(args[1].id).getData());
  6074. console.log(
  6075. this.graph.getCellById(args[1].id).getData().argumentsartifacts
  6076. );
  6077. this.graph
  6078. .getCellById(args[1].id)
  6079. .setData({ nodeName: primarydata.nodeName }); //对应input 保存相应输入的值
  6080. console.log("cell:" + args[1].id);
  6081. console.log("对应id的node:" + this.graph.getCellById(args[1]).toString());
  6082. console.log(this.graph.getCellById(args[1].id));
  6083. //20211119
  6084. this.graph
  6085. .getCellById(args[1].id)
  6086. .setData({ algoparaInput: primarydata.algoparaInput }); //对应input 保存相应输入的值
  6087. this.graph
  6088. .getCellById(args[1].id)
  6089. .setData({ algonodeSource: primarydata.algonodeSource });
  6090. // console.log("primary-------------");
  6091. // console.log(this.graph.getCellById(args[1].id).getData().algoparaInput);
  6092. // console.log(this.graph.getCellById(args[1].id).getData().algoparaOutput);
  6093. // 遍历algoparaInput中algoparaGetInput中的数据,添加文件地址,后保存到映射关系数据库中
  6094. const curalgoparaInput = primarydata.algoparaInput;
  6095. for (var i = 0; i < curalgoparaInput.getInput.length; i++) {
  6096. for (var j = 0; j < primarydata.algonodeSource.length; j++) {
  6097. if (curalgoparaInput.getInput[i].paravalue != null) {
  6098. if (
  6099. curalgoparaInput.getInput[i].paravalue[0] ==
  6100. primarydata.algonodeSource[j].getData().nodeName
  6101. ) {
  6102. curalgoparaInput.getInput[i].paravalue.push(
  6103. primarydata.algonodeSource[j].getData().algoparaOutAddress
  6104. );
  6105. }
  6106. }
  6107. }
  6108. }
  6109. //202111123 保存在 节点数据中 将curalgoparaInput 保存为 algoparaInput
  6110. // console.log("this.graph.getCellById(args[1].id).getData().algoparaInput");
  6111. this.graph
  6112. .getCellById(args[1].id)
  6113. .setData({ algoparaInput: curalgoparaInput }); //对应input 保存相应输入的值
  6114. // console.log(this.graph.getCellById(args[1].id).getData().algoparaInput);
  6115. // console.log(
  6116. // "遍历algoparaInput中algoparaGetInput中的数据,添加文件地址,后保存到映射关系数据库中"
  6117. // );
  6118. // console.log(curalgoparaInput);
  6119. // 20211123 该部分代码每次保存都会在数据库中添加新的记录
  6120. // this.$http({
  6121. // url: this.$http.adornUrl("/sys/visiworkflowparamap/save"),
  6122. // method: "post",
  6123. // data: this.$http.adornData({
  6124. // paramapId: undefined,
  6125. // userId: this.$store.state.user.id,
  6126. // workflowId: "",
  6127. // inputparaNodename: this.graph.getCellById(args[1].id).getData()
  6128. // .nodeName,
  6129. // inputparaJson: JSON.stringify(curalgoparaInput),
  6130. // }),
  6131. // }).then(({ data }) => {
  6132. // if (data && data.code === 0) {
  6133. // this.$message({
  6134. // message: "操作成功",
  6135. // type: "success",
  6136. // duration: 1500,
  6137. // onClose: () => {
  6138. // this.visible = false;
  6139. // // this.$emit('refreshDataList')
  6140. // },
  6141. // });
  6142. // } else {
  6143. // this.$message.error(data.msg);
  6144. // }
  6145. // });
  6146. },
  6147. //20210812 左侧树形组件
  6148. handleDragStart(node, ev) {
  6149. console.log("drag start", node);
  6150. },
  6151. handleDragEnter(draggingNode, dropNode, ev) {
  6152. console.log("tree drag enter: ", dropNode.label);
  6153. },
  6154. handleDragLeave(draggingNode, dropNode, ev) {
  6155. console.log("tree drag leave: ", dropNode.label);
  6156. },
  6157. handleDragOver(draggingNode, dropNode, ev) {
  6158. console.log("tree drag over: ", dropNode.label);
  6159. },
  6160. handleDragEnd(draggingNode, dropNode, dropType, ev) {
  6161. console.log("tree drag end: ", dropNode && dropNode.label, dropType);
  6162. },
  6163. handleDrop(draggingNode, dropNode, dropType, ev) {
  6164. console.log("tree drop: ", dropNode.label, dropType);
  6165. },
  6166. allowDrop(draggingNode, dropNode, type) {
  6167. if (dropNode.data.label === "二级 3-1") {
  6168. return type !== "inner";
  6169. } else {
  6170. return true;
  6171. }
  6172. },
  6173. allowDrag(draggingNode) {
  6174. return draggingNode.data.label.indexOf("三级 3-2-2") === -1;
  6175. },
  6176. //20210813
  6177. onSelect(selectedKeys, info) {
  6178. console.log("selected", selectedKeys, info);
  6179. },
  6180. //20210813 dnd
  6181. startDrag(e) {
  6182. console.log("拖拽前");
  6183. // const target = this.currentTarget
  6184. const target = e.currentTarget;
  6185. const type = target.getAttribute("data-type");
  6186. const node = this.graph.createNode({
  6187. width: 100,
  6188. height: 40,
  6189. attrs: {
  6190. label: {
  6191. text: "circle",
  6192. fill: "#6a6c8a",
  6193. },
  6194. body: {
  6195. stroke: "#31d0c6",
  6196. strokeWidth: 2,
  6197. },
  6198. },
  6199. });
  6200. console.log("拖拽");
  6201. this.dnd.start(node, e);
  6202. //删除.nativeEvent 前会出错
  6203. // this.dnd.start(node, e.nativeEvent);
  6204. },
  6205. //20210926 树形组件
  6206. onSelect(selectedKeys, info) {
  6207. // console.log("selected", selectedKeys, info);
  6208. // console.log(selectedKeys);
  6209. // console.log(info);
  6210. const zdocker_test = this.graph.createNode({
  6211. // width: 170,
  6212. // height: 30,
  6213. shape: "template-node",
  6214. // label: "consume_artifact",
  6215. attrs: {
  6216. label: {
  6217. text: "zdockertest",
  6218. },
  6219. body: {
  6220. // stroke: "#2CB9FF",
  6221. // fill: "#2CB9FF",
  6222. fill: "#d3ebf3",
  6223. },
  6224. // body: {
  6225. // stroke: "#DA2625",
  6226. // fill: "#DA2625",
  6227. // },
  6228. image: {
  6229. "xlink:href":
  6230. "https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg",
  6231. // "xlink:href": "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg",
  6232. //可放图标
  6233. },
  6234. },
  6235. data: {
  6236. nodeName: "zdockertest",
  6237. templateName: "print-message",
  6238. templateImage: "zvinjodocker/zdockertest1:20211011",
  6239. templateCommand: {
  6240. // 1: "sh",
  6241. // 2: "-c",
  6242. // 2:"\"{{inputs.parameters.message}}\""
  6243. },
  6244. //不确定命令暂时用哪种方式 如果添加属性的话哪一种好添加 ; 考虑动态添加属性和值,此处key为何值都行,主要是value较为重要
  6245. // templateCommand2: [
  6246. // {
  6247. // 1:"echo"
  6248. // },
  6249. // {
  6250. // 2:"{{inputs.parameters.message}}"
  6251. // },
  6252. // ],
  6253. templateArgs: {
  6254. // 1: "cat /tmp/message",
  6255. },
  6256. inputsparameters: [],
  6257. inputsartifacts: [
  6258. //此container 需要输入的参数,固定
  6259. // {
  6260. // name: "message",
  6261. // path: "/tmp/message",
  6262. // },
  6263. ],
  6264. //20210916 argument(parameters以及arguments)均 应是在调用的过程中填写具体值
  6265. //应对应input中的各项参数设置对应参数
  6266. argumentsparameters: [],
  6267. argumentsartifacts: [
  6268. //调用container(该template)输入的参数,后续会变(根据输入弹窗变)
  6269. // {
  6270. // name: "message",
  6271. // valuefrom: "{{tasks.whalesay.outputs.artifacts.hello-art}}",
  6272. // },
  6273. ],
  6274. outputsparameters: [],
  6275. outputsartifacts: [],
  6276. //获取到的连接线源的数据 连接线的源的输出数据
  6277. sourcedatalist: [
  6278. // {
  6279. // name: "source1",
  6280. // },
  6281. // {
  6282. // name: "source2",
  6283. // },
  6284. ],
  6285. inputnodefilemap: [], //引用输入节点的 文件列表,包含文件名和url
  6286. inputnodefilevalue: [], //用户选择的输入节点的文件,存储文件url,后端调用
  6287. },
  6288. });
  6289. //20211012
  6290. // 将树形节点的键与 节点名称对应起来。
  6291. // this.graph.addNode(zdocker_test);
  6292. // this.nodedata.addNode(consume_artifact);
  6293. // this.nodedata.appendChild(consume_artifact);
  6294. // this.nodedata.push(consume_artifact);
  6295. // console.log("nodedata");
  6296. // console.log(this.nodedata);
  6297. // console.log(this.nodedata[0])
  6298. //通过遍历节点列表nodedata中键 selectedKeys与节点中attrs.label.text相匹配,生成对应的节点
  6299. //先将所有的节点创建成功后保存在this.nodedata中,点击对应节点后 匹配正确后将节点加入到画布中
  6300. // console.log(this.nodedata[0].attrs.label.text)
  6301. // this.graph.addNode(this.nodedata[0])
  6302. console.log(this.nodedata);
  6303. var nodenamenum = Math.floor(Math.random() * 1000); //1000以内随机整数
  6304. for (var i = 0; i < this.nodedata.length; i++) {
  6305. //遍历数组
  6306. if (selectedKeys.toString() === this.nodedata[i].attrs.label.text) {
  6307. // console.log(selectedKeys.toString());
  6308. var clonenode = this.nodedata[i].clone();
  6309. // clonenode.getElementById
  6310. //更改nodeName 及templateName 后添加随机数
  6311. clonenode.setData({
  6312. nodeName: clonenode.getData().nodeName + nodenamenum,
  6313. });
  6314. clonenode.setData({
  6315. templateName: clonenode.getData().templateName + nodenamenum,
  6316. });
  6317. this.graph.addNode(clonenode);
  6318. // this.graph.addNode(this.nodedata[i].clone());
  6319. } else {
  6320. // console.log(selectedKeys.toString());
  6321. }
  6322. // console.log(i);
  6323. }
  6324. },
  6325. onCheck(checkedKeys, info) {
  6326. console.log("onCheck", checkedKeys, info);
  6327. },
  6328. //设置布局可拖动改变大小
  6329. dragControllerDiv: function () {
  6330. // var resize = document.getElementsByClassName("resize");
  6331. // var left = document.getElementsByClassName("left");
  6332. // var mid = document.getElementsByClassName("right");
  6333. // var box = document.getElementsByClassName("box");
  6334. // for (let i = 0; i < resize.length; i++) {
  6335. // // 鼠标按下事件
  6336. // resize[i].onmousedown = function (e) {
  6337. // //颜色改变提醒
  6338. // resize[i].style.background = "#818181";
  6339. // var startX = e.clientX;
  6340. // console.log("拖动改变两侧大小")
  6341. // console.log("startx");
  6342. // console.log(startX);
  6343. // // 鼠标拖动事件
  6344. // document.onmousemove = function (e) {
  6345. // resize[i].left = startX;
  6346. // var endX = e.clientX;
  6347. // var moveLen = resize[i].left + (endX - startX); // (endx-startx)=移动的距离。resize[i].left+移动的距离=左边区域最后的宽度
  6348. // console.log("movelen");
  6349. // console.log(moveLen);
  6350. // var maxT = box[i].clientWidth - resize[i].offsetWidth; // 容器宽度 - 左边区域的宽度 = 右边区域的宽度
  6351. // console.log("maxt ");
  6352. // console.log(maxT);
  6353. // if (moveLen < 800) moveLen = 800; // 左边区域的最小宽度为32px
  6354. // if (moveLen > maxT - 150) moveLen = maxT - 150; //右边区域最小宽度为150px
  6355. // resize[i].style.left = moveLen; // 设置左侧区域的宽度
  6356. // for (let j = 0; j < left.length; j++) {
  6357. // left[j].style.width =(moveLen / document.body.clientWidth) * 100 + "%";
  6358. // mid[j].style.width = ((box[i].clientWidth - moveLen) / document.body.clientWidth -0.008) *100 +"%";
  6359. // }
  6360. // };
  6361. // // 鼠标松开事件
  6362. // document.onmouseup = function (evt) {
  6363. // //颜色恢复
  6364. // resize[i].style.background = "#d6d6d6";
  6365. // document.onmousemove = null;
  6366. // document.onmouseup = null;
  6367. // resize[i].releaseCapture && resize[i].releaseCapture(); //当你不在需要继续获得鼠标消息就要应该调用ReleaseCapture()释放掉
  6368. // };
  6369. // resize[i].setCapture && resize[i].setCapture(); //该函数在属于当前线程的指定窗口里设置鼠标捕获
  6370. // return false;
  6371. // };
  6372. // }
  6373. var resize = document.getElementsByClassName("resize");
  6374. var left = document.getElementsByClassName("left");
  6375. var mid = document.getElementsByClassName("right");
  6376. var box = document.getElementsByClassName("box");
  6377. for (let i = 0; i < resize.length; i++) {
  6378. // 鼠标按下事件
  6379. resize[i].onmousedown = function (e) {
  6380. //颜色改变提醒
  6381. resize[i].style.background = "#818181";
  6382. var startX = e.clientX;
  6383. resize[i].left = resize[i].offsetLeft;
  6384. // 鼠标拖动事件
  6385. document.onmousemove = function (e) {
  6386. var endX = e.clientX;
  6387. var moveLen = resize[i].left + (endX - startX); // (endx-startx)=移动的距离。resize[i].left+移动的距离=左边区域最后的宽度
  6388. var maxT = box[i].clientWidth - resize[i].offsetWidth; // 容器宽度 - 左边区域的宽度 = 右边区域的宽度
  6389. if (moveLen < 800) moveLen = 800; // 左边区域的最小宽度为32px
  6390. if (moveLen > maxT - 300) moveLen = maxT - 300; //右边区域最小宽度为150px
  6391. resize[i].style.left = moveLen; // 设置左侧区域的宽度
  6392. for (let j = 0; j < left.length; j++) {
  6393. left[j].style.width = moveLen + "px";
  6394. mid[j].style.width = box[i].clientWidth - moveLen - 10 + "px";
  6395. }
  6396. };
  6397. // 鼠标松开事件
  6398. document.onmouseup = function (evt) {
  6399. //颜色恢复
  6400. resize[i].style.background = "#d6d6d6";
  6401. document.onmousemove = null;
  6402. document.onmouseup = null;
  6403. resize[i].releaseCapture && resize[i].releaseCapture(); //当你不在需要继续获得鼠标消息就要应该调用ReleaseCapture()释放掉
  6404. };
  6405. resize[i].setCapture && resize[i].setCapture(); //该函数在属于当前线程的指定窗口里设置鼠标捕获
  6406. return false;
  6407. };
  6408. }
  6409. },
  6410. //保存输入节点内容
  6411. primaryInputnodeConfig(args) {
  6412. console.log("保存输入节点");
  6413. console.log(args[0].id);
  6414. // // this.$emit("refreshDataList",this.cell,this.st_dataListvalue,this.dy_dataListvalue,this.fileList,this.allfilemap);//各个参数
  6415. // this.graph.getCellById(args[0].id).setData({ st_dataListvalue: args[1] });
  6416. // this.graph.getCellById(args[0].id).setData({ dy_dataListvalue: args[2] });
  6417. // this.graph.getCellById(args[0].id).setData({ fileList: args[3] });
  6418. // this.graph.getCellById(args[0].id).setData({ allfilemap: args[4] });
  6419. // this.$emit("refreshinputnode",this.cell,celldata);
  6420. console.log(args[1].allfilemap);
  6421. // this.graph.getCellById(args[0].id).setData(args[1]);
  6422. //以该方式 福赋值字符串型可以,数组类型不可以
  6423. // this.graph.getCellById(args[0].id).setData({allfilemap: this.graph.getCellById(args[0].id).getData().allfilemap.concat(args[1].allfilemap)})
  6424. this.graph.getCellById(args[0].id).replaceData(args[1]); /////成功成功
  6425. console.log(this.graph.getCellById(args[0]));
  6426. },
  6427. },
  6428. computed: {
  6429. formItemLayout() {
  6430. const { formLayout } = this;
  6431. return formLayout === "horizontal"
  6432. ? {
  6433. labelCol: { span: 4 },
  6434. wrapperCol: { span: 14 },
  6435. }
  6436. : {};
  6437. },
  6438. buttonItemLayout() {
  6439. const { formLayout } = this;
  6440. return formLayout === "horizontal"
  6441. ? {
  6442. wrapperCol: { span: 14, offset: 4 },
  6443. }
  6444. : {};
  6445. },
  6446. },
  6447. };
  6448. </script>
  6449. <style lang="scss">
  6450. // 20210715 zhang 添加 布局
  6451. #components-layout-demo-responsive .logo {
  6452. height: 32px;
  6453. // background: rgba(255, 255, 255, 0.959);
  6454. margin: 16px;
  6455. display: block;
  6456. background: #dcdfe6;
  6457. }
  6458. .dividesign {
  6459. height: 32px;
  6460. // background: rgba(255, 255, 255, 0.959);
  6461. margin: 16px;
  6462. display: block;
  6463. // background: #dcdfe6;
  6464. // display: block;
  6465. // height: 1px;
  6466. // width: 100%;
  6467. // margin: 24px 0;
  6468. background-color: #dcdfe6;
  6469. // position: relative;
  6470. }
  6471. // .app-stencil {
  6472. // width: 250px;
  6473. // height: 100%;
  6474. // border: 1px solid #f0f0f0;
  6475. // position: relative;
  6476. // }
  6477. .content {
  6478. font-family: sans-serif;
  6479. // display: flex;
  6480. width: 100%;
  6481. background: #dcdfe6;
  6482. }
  6483. // .app-stencil {
  6484. // width: 250px;
  6485. // border: 1px solid #f0f0f0;
  6486. // position: relative;
  6487. // }
  6488. .app-content {
  6489. // flex: 1;
  6490. // height: 520px;
  6491. height: 100%;
  6492. width: 100%;
  6493. margin-left: 8px;
  6494. margin-right: 8px;
  6495. box-shadow: 0 0 10px 1px #e9e9e9;
  6496. // background: #dcdfe6;
  6497. }
  6498. .divi {
  6499. margin: 1px 0;
  6500. }
  6501. .x6-node [magnet="true"] {
  6502. cursor: crosshair;
  6503. transition: none;
  6504. }
  6505. .x6-node [magnet="true"]:hover {
  6506. opacity: 1;
  6507. }
  6508. .x6-node [magnet="true"][port-group="in"] {
  6509. cursor: move;
  6510. }
  6511. .my-port {
  6512. width: 100%;
  6513. height: 100%;
  6514. border: 1px solid #808080;
  6515. border-radius: 100%;
  6516. background: #eee;
  6517. }
  6518. .my-port.connected {
  6519. width: 0;
  6520. height: 0;
  6521. margin-top: 5px;
  6522. margin-left: 1px;
  6523. border-width: 5px 4px 0;
  6524. border-style: solid;
  6525. border-color: #808080 transparent transparent;
  6526. border-radius: 0;
  6527. background-color: transparent;
  6528. }
  6529. .x6-port-body.available {
  6530. overflow: visible;
  6531. }
  6532. .x6-port-body.available body {
  6533. overflow: visible;
  6534. }
  6535. .x6-port-body.available body > div::before {
  6536. content: " ";
  6537. float: left;
  6538. width: 20px;
  6539. height: 20px;
  6540. margin-top: -5px;
  6541. margin-left: -5px;
  6542. border-radius: 50%;
  6543. background-color: rgba(57, 202, 116, 0.6);
  6544. box-sizing: border-box;
  6545. }
  6546. .x6-port-body.available body > div::after {
  6547. content: " ";
  6548. float: left;
  6549. clear: both;
  6550. width: 10px;
  6551. height: 10px;
  6552. margin-top: -15px;
  6553. border-radius: 50%;
  6554. background-color: #fff;
  6555. border: 1px solid #39ca74;
  6556. position: relative;
  6557. z-index: 10;
  6558. box-sizing: border-box;
  6559. }
  6560. .x6-port-body.adsorbed {
  6561. overflow: visible;
  6562. }
  6563. .x6-port-body.adsorbed body {
  6564. overflow: visible;
  6565. }
  6566. .x6-port-body.adsorbed body > div::before {
  6567. content: " ";
  6568. float: left;
  6569. width: 28px;
  6570. height: 28px;
  6571. margin-top: -9px;
  6572. margin-left: -9px;
  6573. border-radius: 50%;
  6574. background-color: rgba(57, 202, 116, 0.6);
  6575. box-sizing: border-box;
  6576. }
  6577. .x6-port-body.adsorbed body > div::after {
  6578. content: " ";
  6579. float: left;
  6580. clear: both;
  6581. width: 10px;
  6582. height: 10px;
  6583. margin-top: -19px;
  6584. border-radius: 50%;
  6585. background-color: #fff;
  6586. border: 1px solid #39ca74;
  6587. position: relative;
  6588. z-index: 10;
  6589. box-sizing: border-box;
  6590. }
  6591. //20210805 design-panel
  6592. .form {
  6593. height: calc(100vh - 100px);
  6594. flex-grow: 1;
  6595. overflow-x: hidden;
  6596. overflow-y: auto;
  6597. background: #fff;
  6598. }
  6599. .ant-tabs-tabpane {
  6600. background: #fff;
  6601. padding: 5px;
  6602. }
  6603. //20210812 zhang 左侧树形组件栏
  6604. .leftDivTree {
  6605. width: 100%;
  6606. height: 93.7%;
  6607. // padding: 10 0px;
  6608. // border:0.2px solid #000;
  6609. // overflow: scroll;
  6610. }
  6611. .leftDivTree ::v-deep .iconfont {
  6612. margin-right: 8px;
  6613. }
  6614. .leftDivTree ::v-deep .el-tree-node {
  6615. display: table;
  6616. min-width: 100%;
  6617. }
  6618. // .leftDivTitle {
  6619. // color: #fff;
  6620. // border-color: #409eff;
  6621. // font-size: 14px;
  6622. // }
  6623. //20210813 左侧组件
  6624. .dnd-rect {
  6625. width: 80px;
  6626. height: 20px;
  6627. border: 2px solid #31d0c6;
  6628. text-align: center;
  6629. line-height: 40px;
  6630. margin: 16px;
  6631. cursor: move;
  6632. }
  6633. //设置布局 可拖动改变大小
  6634. .left {
  6635. width: 69.2%;
  6636. // width: 100%;
  6637. height: 100%;
  6638. overflow-y: auto;
  6639. overflow-x: hidden;
  6640. float: left;
  6641. display: flex;
  6642. }
  6643. .resize {
  6644. cursor: col-resize;
  6645. float: left;
  6646. position: relative;
  6647. top: 10%;
  6648. background-color: #d6d6d6;
  6649. border-radius: 5px;
  6650. margin-top: -10px;
  6651. width: 10px;
  6652. // height: 50px;
  6653. height: 70%;
  6654. line-height: 50px;
  6655. // line-height: 100%;
  6656. // text-align: center;
  6657. background-size: cover;
  6658. background-position: center;
  6659. font-size: 32px;
  6660. color: white;
  6661. }
  6662. /*拖拽区鼠标悬停样式*/
  6663. .resize:hover {
  6664. color: #444444;
  6665. }
  6666. .right {
  6667. // height: 7.8rem;
  6668. height: 100%;
  6669. float: left;
  6670. width: 30%;
  6671. display: flex;
  6672. }
  6673. .box {
  6674. width: 100%;
  6675. // height: 7.8rem;
  6676. height: 100%;
  6677. }
  6678. .boxform {
  6679. width: 100%;
  6680. height: 100%;
  6681. flex: 1;
  6682. background-color: #fff;
  6683. }
  6684. .boxformitem {
  6685. border-style: solid;
  6686. border-width: 1px;
  6687. border-color: #dcdfe6;
  6688. }
  6689. // .el-icon-video-play:before {
  6690. // content: "提交";
  6691. // }
  6692. .mod-demo-echarts {
  6693. > .el-alert {
  6694. margin-bottom: 10px;
  6695. }
  6696. > .el-row {
  6697. margin-top: -10px;
  6698. margin-bottom: -10px;
  6699. .el-col {
  6700. padding-top: 10px;
  6701. padding-bottom: 10px;
  6702. }
  6703. }
  6704. .chart-box {
  6705. min-height: 400px;
  6706. }
  6707. }
  6708. .divi {
  6709. display: block;
  6710. height: 1px;
  6711. width: 100%;
  6712. margin: 24px 0;
  6713. background-color: #dcdfe6;
  6714. position: relative;
  6715. }
  6716. .divi2 {
  6717. display: block;
  6718. height: 1px;
  6719. width: 100%;
  6720. position: relative;
  6721. }
  6722. .x6-graph-scroller {
  6723. min-height: 800px;
  6724. }
  6725. </style>