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