home.vue 159 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688
  1. <template>
  2. <div class="common-layout">
  3. <el-container>
  4. <el-header>
  5. <myheader />
  6. </el-header>
  7. <el-main>
  8. <div class="main_container padding_gg">
  9. <div class="heder_tabs">
  10. <el-tabs v-model="activeName" type="card" class="demo-tabs" @tab-click="handleClick">
  11. <!-- 开始 -->
  12. <el-tab-pane label="首页" name="User">
  13. <!-- <router-link to="/"> </router-link> -->
  14. </el-tab-pane>
  15. <el-tab-pane label="问题设定" name="Role">
  16. <div class="imgzong Role">
  17. <!-- <div class="listitem lbg_color3 bkcolor3 ">
  18. <div class="threelist">
  19. <div class="item2 floatitem wentsd" v-for="(item, index) in Rolelist" :key="'Role' + index"
  20. :class="{ activeOrange: active == 'Role' + index }"
  21. @click="clickgeometry($event, index, 'Role' + index, item.titlie)">
  22. <el-image :src="getImgPath(item.url)" fit="cover" />
  23. <span>{{ item.titlie }}</span>
  24. </div>
  25. </div>
  26. </div> -->
  27. <!-- <div class="item2 margr" @click="clickgeometry($event, index, 'Role-' + '2', undmodel)">
  28. <el-image :src="getImgPath('tow1.png')" fit="cover" />
  29. <span>{{ f4ce }}</span>
  30. <el-select v-model="f4ce" class="no-border headersele" :suffix-icon="CaretBottom">
  31. <el-option v-for="item in optiongroup1" :key="item.value" :label="item.label" :value="item.value">
  32. </el-option>
  33. </el-select>
  34. </div> -->
  35. <div class="listitem lbg_color3 bkcolor3 threelist">
  36. <div class="item2 margr" @click="clickgeometry($event, index, 'Role-' + '2', undmodel)">
  37. <el-image :src="getImgPath('tow1.png')" fit="cover" />
  38. <span>{{ f4ce }}</span>
  39. <el-select v-model="f4ce" class="no-border headersele" :suffix-icon="CaretBottom">
  40. <el-option v-for="item in optiongroup1" :key="item.value" :label="item.label" :value="item.value">
  41. </el-option>
  42. </el-select>
  43. </div>
  44. <div class="item2 margr" @click="clickgeometry($event, index, 'Role-' + '1', modelban)">
  45. <el-image :src="getImgPath('tow2.png')" fit="cover" />
  46. <span>{{ modelban }}</span>
  47. <el-select v-model="modelban" class="no-border headersele" :suffix-icon="CaretBottom">
  48. <el-option-group v-for="group in optiongroup" :key="group.label" :label="group.label">
  49. <el-option v-for="item in group.options" :key="item.value" :label="item.label"
  50. :value="item.value" />
  51. </el-option-group>
  52. </el-select>
  53. </div>
  54. <div class="item2 margr" @click="clickgeometry($event, index, 'Role-' + '2', undmodel)">
  55. <el-image :src="getImgPath('tow3.png')" fit="cover" />
  56. <span>{{ undmodel }}</span>
  57. <el-select v-model="undmodel" class="no-border headersele" :suffix-icon="CaretBottom">
  58. <el-option v-for="item in options4" :key="item.value" :label="item.label" :value="item.value">
  59. <div style="display: flex; align-items: center;">
  60. <img :src="item.icon" style="width: 20px; height: 20px; margin-right: 10px;" />
  61. <span>{{ item.label }}</span>
  62. </div>
  63. </el-option>
  64. </el-select>
  65. </div>
  66. </div>
  67. <!-- -->
  68. <div class="listitem lbg_color3 bkcolor3 ">
  69. <div class="threelist">
  70. <div class="item2 floatitem wentsd" v-for="(item, index) in Rolelist1" :key="'Role1' + index"
  71. :class="{ activeOrange: active == 'Role1' + index }"
  72. @click="clickgeometry($event, index, 'Role1' + index, item.titlie)">
  73. <el-image :src="getImgPath(item.url)" fit="cover" />
  74. <span>{{ item.titlie }}</span>
  75. </div>
  76. <div class="item2 floatitem wentsd" v-for="(item, index) in Rolelist11" :key="'Role11' + index"
  77. :class="{ activeOrange: active == 'Role11' + index }"
  78. @click="clickgeometry($event, index, 'Role11' + index, item.titlie)">
  79. <el-image :src="getImgPath(item.url)" fit="cover" />
  80. <el-color-picker v-model="color1" @change="colorpicker()"
  81. :class="{ 'is-show-panel': showTrigger }" />
  82. <span>{{ item.titlie }}</span>
  83. </div>
  84. </div>
  85. </div>
  86. <!-- -->
  87. <div class="listitem lbg_color3 bkcolor3 ">
  88. <div class="threelist">
  89. <div class="item2 floatitem wentsd" v-for="(item, index) in Rolelist2" :key="'Role2' + index"
  90. :class="{ activeOrange: active == 'Role2' + index }"
  91. @click="clickgeometry($event, index, 'Role2' + index, item.titlie)">
  92. <el-image :src="getImgPath(item.url)" fit="cover" />
  93. <span>{{ item.titlie }}</span>
  94. </div>
  95. <div class="item2 floatitem wentsd" v-for="(item, index) in Rolelist22" :key="'Role22' + index"
  96. :class="{ activeOrange: active == 'Role22' + index }"
  97. @click="clickgeometry($event, index, 'Role22' + index, item.titlie)">
  98. <el-image :src="getImgPath(item.url)" fit="cover" />
  99. <el-color-picker v-model="colortier" color-format="rgba" show-alpha @change="colorpickertier()"
  100. :class="{ 'is-show-panel': showTrigger }" />
  101. <span>{{ item.titlie }}</span>
  102. </div>
  103. </div>
  104. </div>
  105. <!-- -->
  106. <div class="listitem lbg_color3 bkcolor3 ">
  107. <div class="threelist">
  108. <div class="item2 floatitem wentsd" v-for="(item, index) in Rolelist3" :key="'Role3' + index"
  109. :class="{ activeOrange: active == 'Role3' + index }"
  110. @click="clickgeometry($event, index, 'Role3' + index, item.titlie)">
  111. <el-image :src="getImgPath(item.url)" fit="cover" />
  112. <span>{{ item.titlie }}</span>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. </el-tab-pane>
  118. <el-tab-pane label="优化运行" name="Three">
  119. <div class="imgzong">
  120. <div class="listitem lbg_color3 bkcolor3 threelist">
  121. <div class="item2 floatitem" v-for="(item, index) in Threelist" :key="'Three-' + index"
  122. :class="{ activeOrange: active == 'Three-' + index }"
  123. @click="clickgeometry($event, index, 'Three-' + index, item.titlie)">
  124. <el-image :src="getImgPath(item.url)" fit="cover" />
  125. <span>{{ item.titlie }}</span>
  126. </div>
  127. </div>
  128. <!-- <div class="listitem lbg_color3 bkcolor3" v-for="(item, index) in Threelist1" :key="'Three1-' + index"
  129. :class="{ activeOrange: active == 'Three1' + index }"
  130. @click="clickgeometry($event, index, 'Three1' + index,item.titlie )">
  131. <div class="item2 ">
  132. <el-image :src="getImgPath(item.url)" fit="cover" />
  133. <span>{{ item.titlie }}</span>
  134. </div>
  135. </div> -->
  136. <div class="listitem lbg_color3 bkcolor3 ">
  137. <div class="threelist">
  138. <div class="item2 floatitem wentsd1" v-for="(item, index) in Threelist1" :key="'Three1' + index"
  139. :class="{ activeOrange: active == 'Three1' + index }"
  140. @click="clickgeometry($event, index, 'Three1' + index, item.titlie)">
  141. <el-image :src="getImgPath(item.url)" fit="cover" />
  142. <span>{{ item.titlie }}</span>
  143. </div>
  144. </div>
  145. </div>
  146. </div>
  147. </el-tab-pane>
  148. <el-tab-pane label="可视化" name="Config">
  149. <div class="imgzong">
  150. <!-- <button @click="etImgPath()"></button> -->
  151. <div class="listitem lbg_color3 bkcolor3 threelist" v-for="(item, index) in question" :key="'Config-' + index"
  152. :class="{ activeOrange: active == 'Config-' + index }"
  153. @click="clickgeometry($event, index, 'Config-' + index, item.titlie)">
  154. <div class="item2 ">
  155. <el-image :src="getImgPath(item.url)" fit="cover" />
  156. <span>{{ item.titlie }}</span>
  157. </div>
  158. </div>
  159. </div>
  160. </el-tab-pane>
  161. <el-tab-pane label="数据库管理" name="Seven">
  162. <div class="imgzong">
  163. <div class="listitem lbg_color3 bkcolor3 threelist" v-for="(item, index) in Sevenlist" :key="'Seven' + index"
  164. :class="{ activeOrange: active == 'Seven' + index }"
  165. @click="clickgeometry($event, index, 'Seven' + index, item.titlie)">
  166. <div class="item2 ">
  167. <el-image :src="getImgPath(item.url)" fit="cover" />
  168. <span>{{ item.titlie }}</span>
  169. </div>
  170. </div>
  171. </div>
  172. </el-tab-pane>
  173. <el-tab-pane label="帮助" name="eight">
  174. <div class="imgzong">
  175. <div class="listitem lbg_color3 bkcolor3 threelist" v-for="(item, index) in eightlist" :key="'eight' + index"
  176. :class="{ activeOrange: active == 'eight' + index }"
  177. @click="clickgeometry($event, index, 'eight' + index, item.titlie)">
  178. <div class="item2 ">
  179. <el-image :src="getImgPath(item.url)" fit="cover" />
  180. <span>{{ item.titlie }}</span>
  181. </div>
  182. </div>
  183. </div>
  184. </el-tab-pane>
  185. </el-tabs>
  186. </div>
  187. <!-- 新建任务 -->
  188. <el-dialog v-model="dialog.newdialog" v-if="tabactive == '新建任务'" align-center :modal="false"
  189. :close-on-click-modal="true" :append-to-body="true" draggable :fullscreen="false"
  190. :modal-append-to-body="false" modal-class="summary-dlg" :before-close="handleClose" width="480"
  191. class="dialog_class bgcolor tianjia">
  192. <template #header="{ titleId, titleClass }">
  193. <div class="my-header ">
  194. <el-image :src="getImgPath('s0.png')" fit="contain"></el-image>
  195. <h4 :id="titleId" :class="titleClass">新建任务</h4>
  196. </div>
  197. </template>
  198. <div>
  199. <el-form>
  200. <el-form-item label="任务编号:" :label-width="formLabelWidth6">
  201. <el-input v-model="name" maxlength="18"
  202. oninput="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" class="w-50 m-2"
  203. placeholder="请输入" />
  204. </el-form-item>
  205. <el-form-item label="任务名称:" :label-width="formLabelWidth6">
  206. <el-input v-model="name" maxlength="18"
  207. oninput="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" class="w-50 m-2"
  208. placeholder="请输入" />
  209. </el-form-item>
  210. <el-form-item label="任务类型:" :label-width="formLabelWidth6">
  211. <el-input v-model="name" maxlength="18"
  212. oninput="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" class="w-50 m-2"
  213. placeholder="请输入" />
  214. </el-form-item>
  215. <el-form-item label="备注:" :label-width="formLabelWidth6">
  216. <el-input v-model="name" maxlength="18" type="textarea"
  217. oninput="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" class="w-50 m-2"
  218. placeholder="请输入" />
  219. </el-form-item>
  220. </el-form>
  221. </div>
  222. <template #footer>
  223. <div class="dialog-footer">
  224. <el-button @click="dialog.newdialog = false">取消</el-button>
  225. <el-button type="primary" @click="dialog.newdialog = false">
  226. 确定
  227. </el-button>
  228. </div>
  229. </template>
  230. </el-dialog>
  231. <!-- 问题设定 -->
  232. <el-dialog v-model="dialog.setdialog" v-if="tabactive == '问题设定'" align-center :modal="false"
  233. :close-on-click-modal="true" :append-to-body="true" draggable :fullscreen="false"
  234. :modal-append-to-body="false" modal-class="summary-dlg" :before-close="handleClose" width="480"
  235. class="dialog_class bgcolor tianjia">
  236. <template #header="{ titleId, titleClass }">
  237. <div class="my-header ">
  238. <el-image :src="getImgPath('q0.png')" fit="contain"></el-image>
  239. <h4 :id="titleId" :class="titleClass">问题设定</h4>
  240. </div>
  241. </template>
  242. <div class="numberinput">
  243. <el-form>
  244. <el-form-item label="目标函数个数:" :label-width="formLabelWidth1">
  245. <el-input-number v-model="num" :min="1" :max="10" controls-position="right" />
  246. </el-form-item>
  247. <el-form-item label="建立代理模型约束个数:" :label-width="formLabelWidth1">
  248. <el-input-number v-model="num" :min="1" :max="10" controls-position="right" />
  249. </el-form-item>
  250. <el-form-item label="不建立代理模型约束个数:" :label-width="formLabelWidth1">
  251. <el-input-number v-model="num" :min="1" :max="10" controls-position="right" />
  252. </el-form-item>
  253. </el-form>
  254. </div>
  255. <template #footer>
  256. <div class="dialog-footer">
  257. <el-button @click="dialog.setdialog = false">取消</el-button>
  258. <el-button type="primary" @click="dialog.setdialog = false">
  259. 确定
  260. </el-button>
  261. </div>
  262. </template>
  263. </el-dialog>
  264. <!-- 外形参数化 -->
  265. <el-dialog v-model="dialog.parameter" v-if="tabactive == 'Task-11'" align-center :modal="false"
  266. :close-on-click-modal="true" :append-to-body="true" draggable :fullscreen="false"
  267. :modal-append-to-body="false" modal-class="summary-dlg" :before-close="handleClose" width="480"
  268. class="dialog_class bgcolor tianjia sel">
  269. <template #header="{ titleId, titleClass }">
  270. <div class="my-header ">
  271. <el-image :src="getImgPath('t0.png')" fit="contain"></el-image>
  272. <h4 :id="titleId" :class="titleClass">外形参数化</h4>
  273. </div>
  274. </template>
  275. <div class="numberinput">
  276. <el-form>
  277. <el-form-item label="参数化方法:" :label-width="formLabelWidth6">
  278. <el-select v-model="canshu" :suffix-icon="CaretBottom" placeholder="请选择">
  279. <el-option v-for="item in canshulist" :key="item.value" :label="item.label" :value="item.value">
  280. </el-option>
  281. </el-select>
  282. </el-form-item>
  283. </el-form>
  284. </div>
  285. <template #footer>
  286. <div class="dialog-footer">
  287. <el-button @click="dialog.parameter = false">取消</el-button>
  288. <el-button type="primary" @click="dialog.parameter = false">
  289. 确定
  290. </el-button>
  291. </div>
  292. </template>
  293. </el-dialog>
  294. <!-- 代理模型 -->
  295. <el-dialog v-model="dialog.agency" v-if="tabactive == '代理模型'" align-center :modal="false"
  296. :close-on-click-modal="true" :append-to-body="true" draggable :fullscreen="false"
  297. :modal-append-to-body="false" modal-class="summary-dlg" :before-close="handleClose" width="480"
  298. class="dialog_class bgcolor tianjia sel">
  299. <template #header="{ titleId, titleClass }">
  300. <div class="my-header ">
  301. <el-image :src="getImgPath('t2.png')" fit="contain"></el-image>
  302. <h4 :id="titleId" :class="titleClass">代理模型</h4>
  303. </div>
  304. </template>
  305. <div class="numberinput">
  306. <el-form>
  307. <el-form-item label="代理模型类型:" :label-width="formLabelWidth2">
  308. <el-select v-model="agval" :suffix-icon="CaretBottom" placeholder="请选择">
  309. <el-option v-for="item in agelist" :key="item.value" :label="item.label" :value="item.value">
  310. </el-option>
  311. </el-select>
  312. </el-form-item>
  313. <el-form-item label="设计空间类型:" :label-width="formLabelWidth2">
  314. <el-select v-model="agval1" :suffix-icon="CaretBottom" placeholder="请选择">
  315. <el-option v-for="item in agelist1" :key="item.value" :label="item.label" :value="item.value">
  316. </el-option>
  317. </el-select>
  318. </el-form-item>
  319. <el-form-item label="试验设计方法:" :label-width="formLabelWidth2">
  320. <el-select v-model="agval2" :suffix-icon="CaretBottom" placeholder="请选择">
  321. <el-option v-for="item in agelist2" :key="item.value" :label="item.label" :value="item.value">
  322. </el-option>
  323. </el-select>
  324. </el-form-item>
  325. <el-form-item label="初始样本点数:" :label-width="formLabelWidth2">
  326. <el-input-number v-model="num" :min="1" :max="10" controls-position="right" />
  327. </el-form-item>
  328. </el-form>
  329. </div>
  330. <template #footer>
  331. <div class="dialog-footer">
  332. <el-button @click="dialog.agency = false">取消</el-button>
  333. <el-button type="primary" @click="dialog.agency = false">
  334. 确定
  335. </el-button>
  336. </div>
  337. </template>
  338. </el-dialog>
  339. <!-- 终止条件 -->
  340. <el-dialog v-model="dialog.enddialog" v-if="tabactive == '终止条件 '" align-center :modal="false"
  341. :close-on-click-modal="true" :append-to-body="true" draggable :fullscreen="false"
  342. :modal-append-to-body="false" modal-class="summary-dlg" :before-close="handleClose" width="480"
  343. class="dialog_class bgcolor tianjia sel">
  344. <template #header="{ titleId, titleClass }">
  345. <div class="my-header ">
  346. <el-image :src="getImgPath('t4.png')" fit="contain"></el-image>
  347. <h4 :id="titleId" :class="titleClass">终止条件</h4>
  348. </div>
  349. </template>
  350. <div class="numberinput">
  351. <el-form>
  352. <el-form-item label="EI最小值:" :label-width="formLabelWidth1">
  353. <el-input v-model="name" maxlength="18"
  354. oninput="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" class="w-50 m-2"
  355. placeholder="请输入" />
  356. </el-form-item>
  357. <el-form-item label="目标函数收敛误差:" :label-width="formLabelWidth1">
  358. <el-input v-model="name" maxlength="18"
  359. oninput="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" class="w-50 m-2"
  360. placeholder="请输入" />
  361. </el-form-item>
  362. <el-form-item label="优化解收敛精度:" :label-width="formLabelWidth1">
  363. <el-input v-model="name" maxlength="18"
  364. oninput="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" class="w-50 m-2"
  365. placeholder="请输入" />
  366. </el-form-item>
  367. <el-form-item label="真实函数约束精度:" :label-width="formLabelWidth1">
  368. <el-input v-model="name" maxlength="18"
  369. oninput="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" class="w-50 m-2"
  370. placeholder="请输入" />
  371. </el-form-item>
  372. <el-form-item label="代理模型约束精度:" :label-width="formLabelWidth1">
  373. <el-input v-model="name" maxlength="18"
  374. oninput="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" class="w-50 m-2"
  375. placeholder="请输入" />
  376. </el-form-item>
  377. </el-form>
  378. </div>
  379. <template #footer>
  380. <div class="dialog-footer">
  381. <el-button @click="dialog.enddialog = false">取消</el-button>
  382. <el-button type="primary" @click="dialog.enddialog = false">
  383. 确定
  384. </el-button>
  385. </div>
  386. </template>
  387. </el-dialog>
  388. <!-- 优化算法 -->
  389. <!-- <el-dialog v-model="dialog.sufun" v-if="tabactive == '优化算法'" align-center :modal="false"
  390. :close-on-click-modal="true" :append-to-body="true" draggable :fullscreen="false"
  391. :modal-append-to-body="false" modal-class="summary-dlg" :before-close="handleClose" width="480"
  392. class="dialog_class sel bgcolor tianjia sel">
  393. <template #header="{ titleId, titleClass }">
  394. <div class="my-header ">
  395. <el-image :src="getImgPath('Framem.png')" fit="contain"></el-image>
  396. <h4 :id="titleId" :class="titleClass">优化算法</h4>
  397. </div>
  398. </template>
  399. <div class="numberinput">
  400. <div>
  401. <el-form-item label="优化算法" :label-width="formLabelWidth1">
  402. <el-select v-model="youhua.algorithm" :suffix-icon="CaretBottom" placeholder="请选择">
  403. <el-option v-for="item in yslist" :key="item.value" :label="item.label" :value="item.value">
  404. </el-option>
  405. </el-select>
  406. </el-form-item>
  407. <el-form-item label="种群规模:" :label-width="formLabelWidth1">
  408. <el-input-number v-model="youhua.popsize" :min="1" :max="10" controls-position="right" />
  409. </el-form-item>
  410. <el-form-item label="进化代数:" :label-width="formLabelWidth1">
  411. <el-input-number v-model="youhua.epoch" :min="1" :max="10" controls-position="right" />
  412. </el-form-item>
  413. <el-form-item label="交叉概率:" :label-width="formLabelWidth1">
  414. <el-input-number v-model="youhua.probcrossover" :min="1" :max="10" controls-position="right" />
  415. </el-form-item>
  416. <el-form-item label="变异概率:" :label-width="formLabelWidth1">
  417. <el-input-number v-model="youhua.probmut" :min="1" :max="10" controls-position="right" />
  418. </el-form-item>
  419. <el-form-item label="交叉算子:" :label-width="formLabelWidth1">
  420. <el-select v-model="youhua.proboperator" :suffix-icon="CaretBottom" placeholder="请选择">
  421. <el-option v-for="item in addlist2" :key="item.value" :label="item.label" :value="item.value">
  422. </el-option>
  423. </el-select>
  424. </el-form-item>
  425. <el-form-item label="竞赛规模:" :label-width="formLabelWidth1">
  426. <el-input-number v-model="youhua.probscale" :min="1" :max="10" controls-position="right" />
  427. </el-form-item>
  428. <el-form-item label="保留优选策略:" :label-width="formLabelWidth1">
  429. <el-select v-model="youhua.strategy" :suffix-icon="CaretBottom" placeholder="请选择">
  430. <el-option v-for="item in addlist3" :key="item.value" :label="item.label" :value="item.value">
  431. </el-option>
  432. </el-select>
  433. </el-form-item>
  434. <el-form-item label="变异算子选择:" :label-width="formLabelWidth1">
  435. <el-select v-model="youhua.operator" :suffix-icon="CaretBottom" placeholder="请选择">
  436. <el-option v-for="item in addlist4" :key="item.value" :label="item.label" :value="item.value">
  437. </el-option>
  438. </el-select>
  439. </el-form-item>
  440. <el-form-item label="GPU" :label-width="formLabelWidth1">
  441. <el-select v-model="youhua.gpu" :suffix-icon="CaretBottom" placeholder="请选择">
  442. <el-option v-for="item in addlist8" :key="item.value" :label="item.label" :value="item.value">
  443. </el-option>
  444. </el-select>
  445. </el-form-item>
  446. </div>
  447. </div>
  448. <template #footer>
  449. <div class="dialog-footer">
  450. <el-button @click="dialog.sufun = false">取消</el-button>
  451. <el-button type="primary" @click="dialog.sufun = false">
  452. 确定
  453. </el-button>
  454. </div>
  455. </template>
  456. </el-dialog> -->
  457. <!-- 加点方法 -->
  458. <el-dialog v-model="dialog.addfun" v-if="tabactive == '加点方法'" align-center :modal="false"
  459. :close-on-click-modal="true" :append-to-body="true" draggable :fullscreen="false"
  460. :modal-append-to-body="false" modal-class="summary-dlg" :before-close="handleClose" width="480"
  461. class="dialog_class sel bgcolor tianjia sel">
  462. <template #header="{ titleId, titleClass }">
  463. <div class="my-header ">
  464. <el-image :src="getImgPath('t3.png')" fit="contain"></el-image>
  465. <h4 :id="titleId" :class="titleClass">加点方法</h4>
  466. </div>
  467. </template>
  468. <div class="numberinput">
  469. <el-form>
  470. <el-form-item label="最大样本点数:" :label-width="formLabelWidth1">
  471. <el-input-number v-model="num" :min="1" :max="10" controls-position="right" />
  472. </el-form-item>
  473. <el-form-item label="加点准则:" :label-width="formLabelWidth1">
  474. <el-select v-model="addval" :suffix-icon="CaretBottom" placeholder="请选择">
  475. <el-option v-for="item in addlist" :key="item.value" :label="item.label" :value="item.value">
  476. </el-option>
  477. </el-select>
  478. </el-form-item>
  479. <el-form-item label="单次迭代新增样本点数:" :label-width="formLabelWidth1">
  480. <el-input-number v-model="num" :min="1" :max="10" controls-position="right" />
  481. </el-form-item>
  482. <el-form-item label="约束处理方法:" :label-width="formLabelWidth1">
  483. <el-select v-model="addval1" :suffix-icon="CaretBottom" placeholder="请选择">
  484. <el-option v-for="item in addlist1" :key="item.value" :label="item.label" :value="item.value">
  485. </el-option>
  486. </el-select>
  487. </el-form-item>
  488. </el-form>
  489. </div>
  490. <template #footer>
  491. <div class="dialog-footer">
  492. <el-button @click="dialog.addfun = false">取消</el-button>
  493. <el-button type="primary" @click="dialog.addfun = false">
  494. 确定
  495. </el-button>
  496. </div>
  497. </template>
  498. </el-dialog>
  499. <!-- 任务管理 -->
  500. <el-dialog v-model="dialog.task" v-if="tabactive == '任务管理'" align-center :modal="false"
  501. :close-on-click-modal="true" :append-to-body="true" draggable :fullscreen="false"
  502. :modal-append-to-body="false" modal-class="summary-dlg" :before-close="handleClose" width="800px"
  503. class="dialog_class bgcolor tianjia">
  504. <template #header="{ titleId, titleClass }">
  505. <div class="my-header ">
  506. <el-image :src="getImgPath('s11.png')" fit="contain"></el-image>
  507. <h4 :id="titleId" :class="titleClass">任务管理</h4>
  508. </div>
  509. </template>
  510. <div>
  511. <el-table :data="tasktable" stripe style="width: 100%">
  512. <el-table-column prop="id" label="任务编号" />
  513. <el-table-column prop="name" label="任务名称" />
  514. <el-table-column prop="state" label="任务类型" />
  515. <el-table-column prop="time" label="备注" />
  516. </el-table>
  517. <div class="sev_ruwu sev">
  518. <div class="disflex">
  519. <el-form-item label="关键字:">
  520. <el-select v-model="seval4" :suffix-icon="CaretBottom" placeholder="请选择">
  521. <el-option v-for="item in sevlist" :key="item.value" :label="item.label" :value="item.value">
  522. </el-option>
  523. </el-select>
  524. </el-form-item>
  525. <el-input v-model="name" maxlength="18"
  526. oninput="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" class="w-50 m-2"
  527. placeholder="请输入" />
  528. <el-button class="btncolor">查询</el-button>
  529. <el-button class="btncolor">添加</el-button>
  530. <el-button class="btncolor">删除</el-button>
  531. <el-button class="btncolor">提交</el-button>
  532. </div>
  533. </div>
  534. </div>
  535. <template #footer>
  536. <div class="dialog-footer">
  537. <el-button @click="dialog.task = false">取消</el-button>
  538. <el-button type="primary" @click="dialog.task = false">
  539. 确定
  540. </el-button>
  541. </div>
  542. </template>
  543. </el-dialog>
  544. <!-- 任务检索 -->
  545. <el-dialog v-model="dialog.guanli" v-if="tabactive == '任务检索'" align-center :modal="false"
  546. :close-on-click-modal="true" :append-to-body="true" draggable :fullscreen="false"
  547. :modal-append-to-body="false" modal-class="summary-dlg" :before-close="handleClose" width="800px"
  548. class="dialog_class bgcolor tianjia">
  549. <template #header="{ titleId, titleClass }">
  550. <div class="my-header ">
  551. <el-image :src="getImgPath('s11.png')" fit="contain"></el-image>
  552. <h4 :id="titleId" :class="titleClass">任务检索</h4>
  553. </div>
  554. </template>
  555. <div>
  556. <div class="sev_ruwu">
  557. <div class="disflex">
  558. <el-form-item label="关键字:">
  559. <el-select v-model="seval4" :suffix-icon="CaretBottom" placeholder="请选择">
  560. <el-option v-for="item in sevlist" :key="item.value" :label="item.label" :value="item.value">
  561. </el-option>
  562. </el-select>
  563. </el-form-item>
  564. <el-input v-model="name" maxlength="18"
  565. oninput="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" class="w-50 m-2"
  566. placeholder="请输入关键字" />
  567. <el-checkbox class="magright" label="范围" v-model="checkbox" />
  568. <el-button class="btncolor">查询</el-button>
  569. </div>
  570. </div>
  571. <el-table :data="tasktable" stripe style="width: 100%">
  572. <el-table-column prop="id" label="任务编号" />
  573. <el-table-column prop="name" label="任务名称" />
  574. <el-table-column prop="state" label="任务类型" />
  575. <el-table-column prop="time" label="备注" />
  576. </el-table>
  577. </div>
  578. <template #footer>
  579. <div class="dialog-footer">
  580. <el-button @click="dialog.guanli = false">取消</el-button>
  581. <el-button type="primary" @click="dialog.guanli = false">
  582. 确定
  583. </el-button>
  584. </div>
  585. </template>
  586. </el-dialog>
  587. <!-- 优化器 -->
  588. <el-dialog v-model="dialog.optimizer" align-center :modal="false" :close-on-click-modal="false"
  589. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  590. :before-close="handleClose" width="430" class="dialog_class bgcolor tianjia sel">
  591. <template #header="{ titleId, titleClass }">
  592. <div class="my-header ">
  593. <el-image :src="getImgPath('t2.png')" fit="contain"></el-image>
  594. <h4 :id="titleId" :class="titleClass">优化器</h4>
  595. </div>
  596. </template>
  597. <div class="numberinput lefttext">
  598. <el-form>
  599. <span>代理模型</span>
  600. <el-form-item label="代理模型类型:" :label-width="formLabelWidth1">
  601. <el-select v-model="agval" :suffix-icon="CaretBottom" placeholder="请选择">
  602. <el-option v-for="item in agelist" :key="item.value" :label="item.label" :value="item.value">
  603. </el-option>
  604. </el-select>
  605. </el-form-item>
  606. <el-form-item label="设计空间类型:" :label-width="formLabelWidth1">
  607. <el-select v-model="agval1" :suffix-icon="CaretBottom" placeholder="请选择">
  608. <el-option v-for="item in agelist1" :key="item.value" :label="item.label" :value="item.value">
  609. </el-option>
  610. </el-select>
  611. </el-form-item>
  612. <el-form-item label="试验设计方法:" :label-width="formLabelWidth1">
  613. <el-select v-model="agval2" :suffix-icon="CaretBottom" placeholder="请选择">
  614. <el-option v-for="item in agelist2" :key="item.value" :label="item.label" :value="item.value">
  615. </el-option>
  616. </el-select>
  617. </el-form-item>
  618. <el-form-item label="初始样本点数:" :label-width="formLabelWidth1">
  619. <el-input-number v-model="num" :min="1" :max="10" controls-position="right" />
  620. </el-form-item>
  621. <span>加点准则</span>
  622. <el-form-item label="最大样本点数:" :label-width="formLabelWidth1">
  623. <el-input-number v-model="num" :min="1" :max="10" controls-position="right" />
  624. </el-form-item>
  625. <el-form-item label="加点准则:" :label-width="formLabelWidth1">
  626. <el-select v-model="addval" :suffix-icon="CaretBottom" placeholder="请选择">
  627. <el-option v-for="item in addlist" :key="item.value" :label="item.label" :value="item.value">
  628. </el-option>
  629. </el-select>
  630. </el-form-item>
  631. <el-form-item label="单次迭代新增样本点数:" :label-width="formLabelWidth1">
  632. <el-input-number v-model="num" :min="1" :max="10" controls-position="right" />
  633. </el-form-item>
  634. <el-form-item label="约束处理方法:" :label-width="formLabelWidth1">
  635. <el-select v-model="addval1" :suffix-icon="CaretBottom" placeholder="请选择">
  636. <el-option v-for="item in addlist1" :key="item.value" :label="item.label" :value="item.value">
  637. </el-option>
  638. </el-select>
  639. </el-form-item>
  640. <span>优化算法</span>
  641. <el-form-item label="优化算法:" :label-width="formLabelWidth1">
  642. <el-select v-model="ys" :suffix-icon="CaretBottom" placeholder="请选择">
  643. <el-option v-for="item in yslist" :key="item.value" :label="item.label" :value="item.value">
  644. </el-option>
  645. </el-select>
  646. </el-form-item>
  647. <el-form-item label="种群规模:" :label-width="formLabelWidth1">
  648. <el-input-number v-model="num" :min="1" :max="10" controls-position="right" />
  649. </el-form-item>
  650. <el-form-item label="最大迭代次数:" :label-width="formLabelWidth1">
  651. <el-input-number v-model="num" :min="1" :max="10" controls-position="right" />
  652. </el-form-item>
  653. <el-form-item label="交叉概率:" :label-width="formLabelWidth1">
  654. <el-input-number v-model="num" :min="1" :max="10" controls-position="right" />
  655. </el-form-item>
  656. <el-form-item label="变异概率:" :label-width="formLabelWidth1">
  657. <el-input-number v-model="num" :min="1" :max="10" controls-position="right" />
  658. </el-form-item>
  659. <el-form-item label="交叉算子:" :label-width="formLabelWidth1">
  660. <el-select v-model="addval2" :suffix-icon="CaretBottom" placeholder="请选择">
  661. <el-option v-for="item in addlist2" :key="item.value" :label="item.label" :value="item.value">
  662. </el-option>
  663. </el-select>
  664. </el-form-item>
  665. <el-form-item label="竞赛规模:" :label-width="formLabelWidth1">
  666. <el-input-number v-model="num" :min="1" :max="10" controls-position="right" />
  667. </el-form-item>
  668. <el-form-item label="保留优选策略:" :label-width="formLabelWidth1">
  669. <el-select v-model="addval3" :suffix-icon="CaretBottom" placeholder="请选择">
  670. <el-option v-for="item in addlist3" :key="item.value" :label="item.label" :value="item.value">
  671. </el-option>
  672. </el-select>
  673. </el-form-item>
  674. <el-form-item label="变异算子选择:" :label-width="formLabelWidth1">
  675. <el-select v-model="addval4" :suffix-icon="CaretBottom" placeholder="请选择">
  676. <el-option v-for="item in addlist4" :key="item.value" :label="item.label" :value="item.value">
  677. </el-option>
  678. </el-select>
  679. </el-form-item>
  680. <el-form-item label="precision:" :label-width="formLabelWidth1">
  681. <el-select v-model="addval7" :suffix-icon="CaretBottom" placeholder="请选择">
  682. <el-option v-for="item in addlist7" :key="item.value" :label="item.label" :value="item.value">
  683. </el-option>
  684. </el-select>
  685. </el-form-item>
  686. <el-form-item label="GPU" :label-width="formLabelWidth1">
  687. <el-select v-model="addval8" :suffix-icon="CaretBottom" placeholder="请选择">
  688. <el-option v-for="item in addlist8" :key="item.value" :label="item.label" :value="item.value">
  689. </el-option>
  690. </el-select>
  691. </el-form-item>
  692. </el-form>
  693. </div>
  694. <template #footer>
  695. <div class="dialog-footer">
  696. <el-button @click="dialog.optimizer = false">取消</el-button>
  697. <el-button type="primary" @click="dialog.optimizer = false">
  698. 确定
  699. </el-button>
  700. </div>
  701. </template>
  702. </el-dialog>
  703. <!-- Xfiol改版后的 -->
  704. <el-dialog v-model="dialog.Xfiol" align-center :modal="false" :close-on-click-modal="false"
  705. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false"
  706. modal-class="summary-dlg2 summary-dlg" :before-close="handleClose" width="540"
  707. class="dialog_class bgcolor tianjia colortext sel">
  708. <template #header="{ titleId, titleClass }">
  709. <div class="my-header ">
  710. <el-image :src="getImgPath('xuek9.png')" fit="contain"></el-image>
  711. <h4 :id="titleId" :class="titleClass">Xfoil</h4>
  712. </div>
  713. </template>
  714. <Xfoil ref="Xfoilref"/>
  715. <template #footer>
  716. <div class="dialog-footer">
  717. <!-- <el-button type="info" @click="newxfoil">新建 </el-button> -->
  718. <el-button type="info" @click="dialog.Xfiol = false">取消</el-button>
  719. <el-button type="primary" @click="xfoilok();dialog.Xfiol = false">
  720. 确定
  721. </el-button>
  722. </div>
  723. </template>
  724. </el-dialog>
  725. <!-- 列表 -->
  726. <el-dialog v-model="dialog.listdialog" align-center :modal="false" :close-on-click-modal="false"
  727. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  728. :before-close="handleClose" width="537" class="dialog_style sel" style="max-height: 70%;">
  729. <template #header="{ titleId, titleClass }">
  730. <div class="my-header ">
  731. <h4 :id="titleId" :class="titleClass">列表</h4>
  732. </div>
  733. </template>
  734. <div>
  735. <ListSE @update="handleUpdate"/>
  736. <!-- <el-form>
  737. <el-form-item label="设计集:" >
  738. <el-select v-model="listval" :suffix-icon="CaretBottom" placeholder="请选择">
  739. <el-option v-for="item in listoptions" :key="item.value" :label="item.label" :value="item.value">
  740. </el-option>
  741. </el-select>
  742. </el-form-item>
  743. <el-form-item label="选择要在表中显示的一个或者多个变量和响应" >
  744. </el-form-item>
  745. <el-card shadow="hover" style="width: 100%">
  746. <el-checkbox-group v-model="listcbval">
  747. <el-checkbox v-for="item in Listcheckbox" :key="item.value" :label="item.value" style="display: block">{{ item.label }}</el-checkbox>
  748. </el-checkbox-group>
  749. </el-card>
  750. </el-form> -->
  751. </div>
  752. <template #footer>
  753. <div class="dialog-footer">
  754. <el-button @click="dialog.listdialog = false">取消</el-button>
  755. <el-button type="primary" @click="dialog.listdialog = false">
  756. 确定
  757. </el-button>
  758. </div>
  759. </template>
  760. </el-dialog>
  761. <!-- 散点图 -->
  762. <el-dialog v-model="dialog.scatterdialog" align-center :modal="false" :close-on-click-modal="false"
  763. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  764. :before-close="handleClose" width="500" class="dialog_style bgcolor tianjia sel" style="max-height: 70%;">
  765. <template #header="{ titleId, titleClass }">
  766. <div class="my-header ">
  767. <h4 :id="titleId" :class="titleClass">散点图</h4>
  768. </div>
  769. </template>
  770. <div>
  771. <ListSE @update="handleUpdate"/>
  772. </div>
  773. <template #footer>
  774. <div class="dialog-footer">
  775. <el-button @click="dialog.scatterdialog = false">取消</el-button>
  776. <el-button type="primary" @click="selectshujuto();dialog.scatterdialog = false">
  777. 确定
  778. </el-button>
  779. </div>
  780. </template>
  781. </el-dialog>
  782. <!-- 折线图 -->
  783. <el-dialog v-model="dialog.echartLinedialog" align-center :modal="false" :close-on-click-modal="false"
  784. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  785. :before-close="handleClose" width="500" class="dialog_style bgcolor tianjia sel" style="max-height: 70%;">
  786. <template #header="{ titleId, titleClass }">
  787. <div class="my-header ">
  788. <h4 :id="titleId" :class="titleClass">折线图</h4>
  789. </div>
  790. </template>
  791. <div>
  792. <ListSE @update="handleUpdate"/>
  793. </div>
  794. <template #footer>
  795. <div class="dialog-footer">
  796. <el-button @click="dialog.echartLinedialog = false">取消</el-button>
  797. <el-button type="primary" @click="selectshujuto();dialog.echartLinedialog = false">
  798. 确定
  799. </el-button>
  800. </div>
  801. </template>
  802. </el-dialog>
  803. <!-- 帕雷托图 -->
  804. <el-dialog v-model="dialog.paretodialog" align-center :modal="false" :close-on-click-modal="false"
  805. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  806. :before-close="handleClose" width="500" class="dialog_style bgcolor tianjia sel" style="max-height: 70%;">
  807. <template #header="{ titleId, titleClass }">
  808. <div class="my-header ">
  809. <h4 :id="titleId" :class="titleClass">帕雷托图</h4>
  810. </div>
  811. </template>
  812. <div>
  813. <el-form>
  814. <el-form-item label="选择在X轴显示的一个变量和响应" >
  815. </el-form-item>
  816. <el-card>
  817. <el-checkbox-group v-model="paretocbval">
  818. <el-checkbox v-for="item in paretocheckbox" :key="item.value" :label="item.value" style="display: block">{{ item.label }}</el-checkbox>
  819. </el-checkbox-group>
  820. </el-card>
  821. <el-form-item label="选择在Y轴显示的一个变量和响应" >
  822. </el-form-item>
  823. <el-card shadow="hover" style="width: 100%">
  824. <el-checkbox-group v-model="paretocbval">
  825. <el-checkbox v-for="item in paretocheckbox" :key="item.value" :label="item.value" style="display: block">{{ item.label }}</el-checkbox>
  826. </el-checkbox-group>
  827. </el-card>
  828. </el-form>
  829. </div>
  830. <template #footer>
  831. <div class="dialog-footer">
  832. <el-button @click="dialog.paretodialog = false">取消</el-button>
  833. <el-button type="primary" @click="dialog.paretodialog = false">
  834. 确定
  835. </el-button>
  836. </div>
  837. </template>
  838. </el-dialog>
  839. <!-- 云图/等值线图 -->
  840. <el-dialog v-model="dialog.clouddialog" align-center :modal="false" :close-on-click-modal="false"
  841. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  842. :before-close="handleClose" width="700" class="dialog_style bgcolor tianjia sel cloudChart" style="height: 500px;overflow: auto;">
  843. <template #header="{ titleId, titleClass }">
  844. <div class="my-header ">
  845. <h4 :id="titleId" :class="titleClass">云图/等值线显示</h4>
  846. </div>
  847. </template>
  848. <div>
  849. <div class="cloudbox">
  850. <el-row gutter="20">
  851. <el-col :span="2"></el-col>
  852. <el-col v-for="(item,index) in cloudbtnbox" :key="index" :span="4">
  853. <el-button style="width: 100%;" @click="openSeconddialog(item.btnname)">
  854. <el-image :src="getImgPath(item.url)" alt="img" fit="cover" style="width: 20px;margin-right: 4px;" />
  855. {{ item.btnname }}
  856. </el-button>
  857. </el-col>
  858. </el-row>
  859. </div>
  860. <div style="height: 400px;overflow: auto;">
  861. <cloudChart/>
  862. </div>
  863. </div>
  864. </el-dialog>
  865. <!-- 云图二级弹窗 -->
  866. <el-dialog v-model="seconddialogshow"
  867. align-center
  868. :modal="false"
  869. :close-on-click-modal="false"
  870. :append-to-body="true"
  871. draggable
  872. :fullscreen="false"
  873. :modal-append-to-body="false"
  874. modal-class="summary-dlg"
  875. :before-close="handleClose"
  876. width="500"
  877. class="dialog_class bgcolor tianjia "
  878. >
  879. <template #header="{ titleId, titleClass }">
  880. <div class="my-header">
  881. <h4 :id="titleId" :class="titleClass">{{ cloudsedtitle }}</h4>
  882. </div>
  883. </template>
  884. <cloudsecond :activesd="activesd"/>
  885. <template #footer>
  886. <div class="dialog-footer">
  887. <el-button @click="seconddialogshow = false">取消</el-button>
  888. <el-button type="primary" @click="seconddialogshow = false">
  889. 确定
  890. </el-button>
  891. </div>
  892. </template>
  893. </el-dialog>
  894. <!-- 查看报告 -->
  895. <el-dialog v-model="dialog.lookover" align-center :modal="false" :close-on-click-modal="false"
  896. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlgPdf"
  897. :before-close="handleClose" width="580px" height="800px">
  898. <template #header="{ titleId, titleClass }">
  899. <div class="my-header ">
  900. <el-image :src="getImgPath('k8.png')" fit="contain"></el-image>
  901. <h4 :id="titleId" :class="titleClass">查看报告:</h4>
  902. </div>
  903. </template>
  904. <pdfReportView/>
  905. <!-- <div class="numberinput lefttext">
  906. <el-form>
  907. <el-image :src="getImgPath('baog.png')" fit="contain"></el-image>
  908. </el-form>
  909. </div> -->
  910. <template #footer>
  911. <div class="dialog-footer">
  912. <el-button @click="dialog.lookover = false">取消</el-button>
  913. <el-button type="primary" @click="dialog.lookover = false">
  914. 确定
  915. </el-button>
  916. </div>
  917. </template>
  918. </el-dialog>
  919. <!-- 导出报告 -->
  920. <el-dialog v-model="dialog.exportreport" align-center :modal="false" :close-on-click-modal="false"
  921. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  922. :before-close="handleClose" width="600" class="dialog_class bgcolor tianjia sel" style="max-height: 70%;">
  923. <template #header="{ titleId, titleClass }">
  924. <div class="my-header ">
  925. <h4 :id="titleId" :class="titleClass">导出报告:</h4>
  926. </div>
  927. </template>
  928. <Exreport />
  929. <template #footer>
  930. <div class="dialog-footer">
  931. <el-button @click="dialog.exportreport = false">取消</el-button>
  932. <el-button type="primary" @click="dialog.exportreport = false">
  933. 确定
  934. </el-button>
  935. </div>
  936. </template>
  937. </el-dialog>
  938. <!-- 气动分析Xfoil、ADflow -->
  939. <el-dialog v-model="dialog.XfAD" align-center :modal="false" :close-on-click-modal="false"
  940. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  941. :before-close="handleClose" width="700" class="dialog_class bgcolor tianjia sel colortext">
  942. <template #header="{ titleId, titleClass }">
  943. <div class="my-header ">
  944. <!-- <el-image :src="getImgPath('xuek0.png')" fit="contain"></el-image> -->
  945. <h4 :id="titleId" :class="titleClass">气动分析</h4>
  946. </div>
  947. </template>
  948. <div class="numberinput lefttext ">
  949. <el-form>
  950. <el-tabs tab-position="left" class="demo-tabs" v-model="activeadf" @tab-click="adfhandleClick3">
  951. <el-tab-pane label="Xfoil" name="Xfoil">
  952. <Xfoil ref="Xfoilref"/>
  953. </el-tab-pane>
  954. <!-- ADflow -->
  955. <el-tab-pane label="ADflow" name="ADflow">
  956. <ADflow ref="ADflowref"/>
  957. </el-tab-pane>
  958. </el-tabs>
  959. </el-form>
  960. </div>
  961. <template #footer>
  962. <div class="dialog-footer">
  963. <el-button @click="dialog.XfAD = false">取消</el-button>
  964. <el-button type="primary" @click="getXfoilAdflowsave(activeadf);dialog.XfAD = false;">
  965. 确定
  966. </el-button>
  967. </div>
  968. </template>
  969. </el-dialog>
  970. <!-- CST -->
  971. <el-dialog v-model="dialog.CSTt" align-center :modal="false" :close-on-click-modal="false"
  972. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  973. :before-close="handleClose" width="730" class="dialog_class bgcolor colortext tianjia sel">
  974. <template #header="{ titleId, titleClass }">
  975. <div class="my-header ">
  976. <el-image :src="getImgPath('xuek0.png')" fit="contain"></el-image>
  977. <h4 :id="titleId" :class="titleClass">CST</h4>
  978. </div>
  979. </template>
  980. <csts ref="Cstref"/>
  981. <template #footer>
  982. <div class="dialog-footer">
  983. <el-button @click="dialog.CSTt = false">取消</el-button>
  984. <el-button type="primary" @click="cstok()">
  985. 确定
  986. </el-button>
  987. </div>
  988. </template>
  989. </el-dialog>
  990. <!-- FFD -->
  991. <el-dialog v-model="dialog.ffdt" align-center :modal="false" :close-on-click-modal="false"
  992. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  993. :before-close="handleClose" width="730" class="dialog_class bgcolor colortext tianjia sel">
  994. <template #header="{ titleId, titleClass }">
  995. <div class="my-header ">
  996. <el-image :src="getImgPath('ffd.png')" fit="contain"></el-image>
  997. <h4 :id="titleId" :class="titleClass">FFD</h4>
  998. </div>
  999. </template>
  1000. <ffds ref="Ffdref"/>
  1001. <template #footer>
  1002. <div class="dialog-footer">
  1003. <el-button @click="dialog.ffdt = false">取消</el-button>
  1004. <el-button type="primary" @click="ffdok()">
  1005. 确定
  1006. </el-button>
  1007. </div>
  1008. </template>
  1009. </el-dialog>
  1010. <!-- 气动分析CST、FFD -->
  1011. <el-dialog v-model="dialog.cstffd" align-center :modal="false" :close-on-click-modal="false"
  1012. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  1013. :before-close="handleClose" width="900" class="dialog_class bgcolor tianjia sel colortext">
  1014. <template #header="{ titleId, titleClass }">
  1015. <div class="my-header ">
  1016. <h4 :id="titleId" :class="titleClass">参数化</h4>
  1017. </div>
  1018. </template>
  1019. <div class="numberinput lefttext ">
  1020. <el-form>
  1021. <!-- CST -->
  1022. <el-tabs tab-position="left" class="demo-tabs" v-model="activeadf" @tab-click="adfhandleClick2">
  1023. <el-tab-pane label="CST" name="CST">
  1024. <csts ref="Cstref"/>
  1025. </el-tab-pane>
  1026. <!-- FFD -->
  1027. <el-tab-pane label="FFD" name="FFD">
  1028. <ffds ref="Ffdref"/>
  1029. </el-tab-pane>
  1030. </el-tabs>
  1031. </el-form>
  1032. </div>
  1033. <template #footer>
  1034. <div class="dialog-footer">
  1035. <el-button @click="dialog.cstffd = false">取消</el-button>
  1036. <el-button type="primary" @click="getCstFfdsave(activeadf);dialog.cstffd = false">
  1037. 确定
  1038. </el-button>
  1039. </div>
  1040. </template>
  1041. </el-dialog>
  1042. <!-- TACS -->
  1043. <el-dialog v-model="dialog.Taxs" align-center :modal="false" :close-on-click-modal="false"
  1044. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  1045. :before-close="handleClose" width="700" class="dialog_class bgcolor tianjia sel colortext ">
  1046. <template #header="{ titleId, titleClass }">
  1047. <div class="my-header ">
  1048. <!-- <el-image :src="getImgPath('xuek0.png')" fit="contain"></el-image> -->
  1049. <h4 :id="titleId" :class="titleClass">TACS</h4>
  1050. </div>
  1051. </template>
  1052. <TACS />
  1053. <template #footer>
  1054. <div class="dialog-footer">
  1055. <el-button @click="dialog.Taxs = false">取消</el-button>
  1056. <el-button type="primary" @click="dialog.Taxs = false">
  1057. 确定
  1058. </el-button>
  1059. </div>
  1060. </template>
  1061. </el-dialog>
  1062. <!-- 优化器 -->
  1063. <el-dialog v-model="dialog.optgroup" align-center :modal="false" :close-on-click-modal="false"
  1064. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  1065. :before-close="handleClose" width="700" class="dialog_class bgcolor tianjia sel colortext">
  1066. <template #header="{ titleId, titleClass }">
  1067. <div class="my-header ">
  1068. <h4 :id="titleId" :class="titleClass">优化器</h4>
  1069. </div>
  1070. </template>
  1071. <div class="numberinput lefttext ">
  1072. <el-form>
  1073. <el-tabs tab-position="left" class="demo-tabs" v-model="activeadf" @tab-click="adfhandleClick">
  1074. <!-- 代理优化器 -->
  1075. <el-tab-pane label="代理优化器" name="代理优化器">
  1076. <Doptimize ref='Doptimizeref'/>
  1077. </el-tab-pane>
  1078. <!-- 进步优化器 -->
  1079. <el-tab-pane label="进化优化器" name="进化优化器">
  1080. <Joptimize ref='Joptimizeref'/>
  1081. </el-tab-pane>
  1082. <!-- 梯度优化器 -->
  1083. <el-tab-pane label="梯度优化器" name="梯度优化器">
  1084. <Toptimize ref='Toptimizeref'/>
  1085. </el-tab-pane>
  1086. </el-tabs>
  1087. </el-form>
  1088. </div>
  1089. <template #footer>
  1090. <div class="dialog-footer">
  1091. <el-button @click="dialog.optgroup = false">取消</el-button>
  1092. <el-button type="primary" @click="getSave(activeadf);dialog.optgroup = false">
  1093. 确定
  1094. </el-button>
  1095. </div>
  1096. </template>
  1097. </el-dialog>
  1098. <!-- 单独的进步优化器 -->
  1099. <el-dialog v-model="dialog.jboptimizer" align-center :modal="false" :close-on-click-modal="false"
  1100. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  1101. :before-close="handleClose" width="430" class="dialog_class bgcolor tianjia sel colortext">
  1102. <template #header="{ titleId, titleClass }">
  1103. <div class="my-header ">
  1104. <el-image :src="getImgPath('t2.png')" fit="contain"></el-image>
  1105. <h4 :id="titleId" :class="titleClass">优化算法:</h4>
  1106. </div>
  1107. </template>
  1108. <Joptimize ref='Joptimizeref'/>
  1109. <template #footer>
  1110. <div class="dialog-footer">
  1111. <el-button @click="dialog.jboptimizer = false">取消</el-button>
  1112. <el-button type="primary" @click="getaddsave(); dialog.jboptimizer = false">
  1113. 确定
  1114. </el-button>
  1115. </div>
  1116. </template>
  1117. </el-dialog>
  1118. <!-- 单独的代理优化器 -->
  1119. <el-dialog v-model="dialog.dboptimizer" align-center :modal="false" :close-on-click-modal="false"
  1120. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  1121. :before-close="handleClose" width="530" class="dialog_class bgcolor tianjia sel colortext">
  1122. <template #header="{ titleId, titleClass }">
  1123. <div class="my-header ">
  1124. <!-- <el-image :src="getImgPath('t2.png')" fit="contain"></el-image> -->
  1125. <h4 :id="titleId" :class="titleClass">代理优化器</h4>
  1126. </div>
  1127. </template>
  1128. <Doptimize ref="Doptimizeref"/>
  1129. <template #footer>
  1130. <div class="dialog-footer">
  1131. <el-button @click="dialog.dboptimizer = false">取消</el-button>
  1132. <el-button type="primary" @click="getDaddsave(); dialog.dboptimizer = false">
  1133. 确定
  1134. </el-button>
  1135. </div>
  1136. </template>
  1137. </el-dialog>
  1138. <!-- 单独的梯度优化器 -->
  1139. <el-dialog v-model="dialog.tboptimizer" align-center :modal="false" :close-on-click-modal="false"
  1140. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  1141. :before-close="handleClose" width="430" class="dialog_class bgcolor tianjia sel colortext">
  1142. <template #header="{ titleId, titleClass }">
  1143. <div class="my-header ">
  1144. <!-- <el-image :src="getImgPath('t2.png')" fit="contain"></el-image> -->
  1145. <h4 :id="titleId" :class="titleClass">梯度优化器:</h4>
  1146. </div>
  1147. </template>
  1148. <Toptimize ref="Toptimizeref"/>
  1149. <template #footer>
  1150. <div class="dialog-footer">
  1151. <el-button @click="dialog.tboptimizer = false">取消</el-button>
  1152. <el-button type="primary" @click="getTaddsave(); dialog.tboptimizer = false">
  1153. 确定
  1154. </el-button>
  1155. </div>
  1156. </template>
  1157. </el-dialog>
  1158. <!-- 单独的ADflow -->
  1159. <el-dialog v-model="dialog.isADflow" align-center :modal="false" :close-on-click-modal="false"
  1160. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  1161. :before-close="handleClose" width="540" class="dialog_class bgcolor tianjia sel colortext">
  1162. <template #header="{ titleId, titleClass }">
  1163. <div class="my-header ">
  1164. <!-- <el-image :src="getImgPath('t2.png')" fit="contain"></el-image> -->
  1165. <h4 :id="titleId" :class="titleClass">ADflow</h4>
  1166. </div>
  1167. </template>
  1168. <ADflow ref="ADflowref"/>
  1169. <template #footer>
  1170. <div class="dialog-footer">
  1171. <el-button @click="dialog.isADflow = false">取消</el-button>
  1172. <el-button type="primary" @click=" adflowok();dialog.isADflow = false">
  1173. 确定
  1174. </el-button>
  1175. </div>
  1176. </template>
  1177. </el-dialog>
  1178. <!-- Python -->
  1179. <el-dialog v-model="dialog.Pythonshow" align-center :modal="false" :close-on-click-modal="false"
  1180. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  1181. :before-close="handleClose" width="700" class="dialog_class bgcolor colortext tianjia sel">
  1182. <template #header="{ titleId, titleClass }">
  1183. <div class="my-header ">
  1184. <!-- <el-image :src="getImgPath('xuek0.png')" fit="contain"></el-image> -->
  1185. <h4 :id="titleId" :class="titleClass">Python</h4>
  1186. </div>
  1187. </template>
  1188. <div class="footerp" style="height:525px;padding:15px">
  1189. <div>
  1190. <!-- <el-input
  1191. v-model="textarea1"
  1192. style="width: 100%"
  1193. :autosize="{ minRows: 2, maxRows: 4 }"
  1194. type="textarea"
  1195. placeholder="Please input"
  1196. /> -->
  1197. <PythonEdit :value="textarea1" language="python" @change="handleEditorChange"/>
  1198. </div>
  1199. <div class="pythfoter">
  1200. <div class="span active" >
  1201. <el-image :src="xin" style="width: 25px;height: 25px;margin-right: 5px;"></el-image>
  1202. <span>信息栏 </span>
  1203. </div>
  1204. <el-input
  1205. v-model="textarea2"
  1206. style="width: 100%"
  1207. :autosize="{ minRows: 2, maxRows: 4 }"
  1208. type="textarea"
  1209. placeholder=""
  1210. />
  1211. </div>
  1212. </div>
  1213. <template #footer>
  1214. <div class="dialog-footer">
  1215. <el-button @click="dialog.Pythonshow = false">检查</el-button>
  1216. <el-button type="primary" @click="pythonSubmit(); dialog.Pythonshow = false">
  1217. 保存
  1218. </el-button>
  1219. </div>
  1220. </template>
  1221. </el-dialog>
  1222. <!-- FSI -->
  1223. <el-dialog v-model="dialog.fsidialog" align-center :modal="false" :close-on-click-modal="false"
  1224. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  1225. :before-close="handleClose" width="670" class="dialog_class bgcolor tianjia sel colortext">
  1226. <template #header="{ titleId, titleClass }">
  1227. <div class="my-header ">
  1228. <!-- <el-image :src="getImgPath('xuek0.png')" fit="contain"></el-image> -->
  1229. <h4 :id="titleId" :class="titleClass">FUM to FEM</h4>
  1230. </div>
  1231. </template>
  1232. <FSI ref="Fsiref"/>
  1233. <template #footer>
  1234. <div class="dialog-footer">
  1235. <el-button @click="dialog.fsidialog = false">取消</el-button>
  1236. <el-button type="primary" @click=" dialog.fsidialog = false">
  1237. 确定
  1238. </el-button>
  1239. </div>
  1240. </template>
  1241. </el-dialog>
  1242. <!-- Flight -->
  1243. <el-dialog v-model="dialog.flightdialog" align-center :modal="false" :close-on-click-modal="false"
  1244. :append-to-body="true" draggable :fullscreen="false" :modal-append-to-body="false" modal-class="summary-dlg"
  1245. :before-close="handleClose" width="630" class="dialog_class bgcolor tianjia sel colortext">
  1246. <template #header="{ titleId, titleClass }">
  1247. <div class="my-header ">
  1248. <!-- <el-image :src="getImgPath('xuek0.png')" fit="contain"></el-image> -->
  1249. <h4 :id="titleId" :class="titleClass">Flight</h4>
  1250. </div>
  1251. </template>
  1252. <Flight ref="Flightref"/>
  1253. <template #footer>
  1254. <div class="dialog-footer">
  1255. <el-button @click="dialog.flightdialog = false">取消</el-button>
  1256. <el-button type="primary" @click=" dialog.flightdialog = false">
  1257. 确定
  1258. </el-button>
  1259. </div>
  1260. </template>
  1261. </el-dialog>
  1262. <!-- 内容区 -->
  1263. <div class="main mianflex">
  1264. <!--left菜单栏 -->
  1265. <Sidebar ref="Sidebarref" />
  1266. <!-- 放图形 -->
  1267. <div class="main_container">
  1268. <div class="main_model">
  1269. <div class="jindutiao" v-show="progressshow">
  1270. <span style="width: 150px;">运行进度</span>
  1271. <!-- <el-progress :text-inside="true" :stroke-width="26" :percentage="70" /> -->
  1272. <div class="demo-progress">
  1273. <el-progress :percentage="percentage" :color="customColor">
  1274. <!-- <template #default="{ percentage }">
  1275. <span class="percentage-value">当前进度:{{ percentage }}%</span>
  1276. </template> -->
  1277. </el-progress>
  1278. <!-- <button @click="tbn">点我</button> -->
  1279. </div>
  1280. </div>
  1281. <div class="main_model" v-show='flowshow'>
  1282. <vuefindex ref="vuefval" @optimizerfalse="optimizerfalse($event)"></vuefindex>
  1283. </div>
  1284. <div class="maxh221">
  1285. <!-- 中间部分 -->
  1286. <!-- 列表监控 -->
  1287. <div class="conter_mian classtable " v-show="jiankong" style="width:100%; height: 100%;">
  1288. <el-table :data="tableDatalieb"
  1289. border
  1290. style=" overflow: auto; height: 100%;"
  1291. :header-cell-class-name="lbjkheaderCellClassName"
  1292. :key="tableKey"
  1293. >
  1294. <el-table-column type="index" label="编号" width="100"></el-table-column>
  1295. <el-table-column v-for="(header, index) in tableHeaders" :key="index" :prop="header.prop" show-overflow-tooltip
  1296. :label="header.label" >
  1297. </el-table-column>
  1298. </el-table>
  1299. </div>
  1300. <!-- 曲线监控 -->
  1301. <div class="conter_mian classtable " v-if="echartshow" style="width:100%; height: 100%;">
  1302. <!-- <el-form-item label="" >
  1303. <el-select v-model="quval" :suffix-icon="CaretBottom" placeholder="请选择">
  1304. <el-option v-for="item in quxian" :key="item.value" :label="item.label" :value="item.value">
  1305. </el-option>
  1306. </el-select>
  1307. </el-form-item> -->
  1308. <optmonitor ref="optmonitor1" :echartdata="echartdata" :selval="quval" :curvedata="curvedata" />
  1309. </div>
  1310. <!-- 过程监控 -->
  1311. <div class="conter_mian classtable conter_flex" v-if="echartshow2" style="width:100%; height: 100%;">
  1312. <div class="echart_left ech">
  1313. <processMonitor1 ref="processMonitor1ref" :echartdata="echartdata" :selval="quval" :curvedata="curvedata"/>
  1314. </div>
  1315. <div class="echart_right ech">
  1316. <processMonitor2 ref="processMonitor2ref" :echartdata="echartdata" :selval="quval" :curvedata="curvedata"/>
  1317. </div>
  1318. </div>
  1319. <!-- 可视化开始 -->
  1320. <div class="conter_mian classtable echartcont" v-show="echartzongshow">
  1321. <tablelist ref="tablelistref" v-show="tablelistshow" :tablelistshow="tablelistshow"
  1322. :tabledataliebiao="datatotabledata" :tableHeaders="datatotableheader"/>
  1323. <echartarea ref="arearef" v-show="areashow" :areashow="areashow"/>
  1324. <bargraph ref="bargraphref" v-show="bargraphshow" :bargraphshow="bargraphshow"/>
  1325. <echartLine ref="echartLineref" v-show="echartLineshow" :echartLineshow="echartLineshow"/>
  1326. <BarChart ref="BarChartref" v-show="BarChartshow" :BarChartshow="BarChartshow"/>
  1327. <scatter ref="scatterref" v-show="scattershow" :scattershow="scattershow"/>
  1328. <radar ref="radarref" v-show="radarshow" :radarshow="radarshow"/>
  1329. <pie ref="pieref" v-show="pieshow" :pieshow="pieshow" />
  1330. <pareto ref="paretoref" v-show="paretoshow" :paretoshow="paretoshow" />
  1331. </div>
  1332. <!-- 可视化结束 -->
  1333. <!-- 右侧边栏开始 -->
  1334. <!-- 结束 -->
  1335. </div>
  1336. <el-footer class="femFooter">
  1337. <div class="gooterpading">
  1338. <div class="footerTitle el-tag--primary">
  1339. <div>
  1340. <div class="span" v-for="(tab, index) in tabs" :key="index" :class="{ 'active': activeIndex === index }"
  1341. @click="xxclick(index)">
  1342. <el-image :src="tab.img" fit="contain"></el-image>
  1343. <span>{{ tab.name }} </span></div>
  1344. </div>
  1345. <div>
  1346. <!-- <li
  1347. class="exloadbox"
  1348. v-show="elodingfalse"
  1349. >
  1350. <span>正在求解中</span>
  1351. <i class="el-icon-loading"></i>
  1352. </li> -->
  1353. <!-- <li>
  1354. <span >清空</span>
  1355. </li> -->
  1356. <li>
  1357. <span @click="footerShows('foot')">&#9650;&#9660;</span>
  1358. </li>
  1359. </div>
  1360. </div>
  1361. <div v-if="footerShow">
  1362. <div class="footerTextBox" v-if="activeIndex == 0">
  1363. <el-input class="footerText" type="textarea" id="textarea_id" v-model="logs"></el-input>
  1364. </div>
  1365. <div class="youhualog" v-if="activeIndex == 1">
  1366. <ul>
  1367. <template v-for="(tab, index) in listli" :key="index">
  1368. <el-divider v-if="index !== 0" direction="vertical" class="custom-divider"></el-divider>
  1369. <li @click="issueclick(index)" :class="{ 'active2': activeIndex2 === index }">
  1370. <el-image v-if="activeIndex2 === index" :src="tab.isimg" fit="contain"></el-image>
  1371. <el-image v-else :src="tab.noimg" fit="contain"></el-image>
  1372. <span>{{ tab.name }}</span>
  1373. </li>
  1374. </template>
  1375. </ul>
  1376. <div class="footer-content">
  1377. <div class="eldesign classtable" v-if="activeIndex2 == 0">
  1378. <el-table :data="designtable" border style="width: 100%" height="100">
  1379. <el-table-column type="index" label="编号" width="70" />
  1380. <el-table-column prop="name" label="变量名称">
  1381. <template #default="{ row }">
  1382. <el-input v-model="row.name" @change="handleEdit(row)" />
  1383. </template>
  1384. </el-table-column>
  1385. <el-table-column prop="upper" label="上限值">
  1386. <template #default="{ row }">
  1387. <el-input type="text" v-model="row.upper"
  1388. @change="handleEdit(row)" />
  1389. </template>
  1390. </el-table-column>
  1391. <el-table-column prop="lower" label="下限值">
  1392. <template #default="{ row }">
  1393. <el-input v-model="row.lower"
  1394. @change="handleEdit(row)" />
  1395. </template>
  1396. </el-table-column>
  1397. <el-table-column prop="reference" label="基准值" >
  1398. <template #default="{ row }">
  1399. <el-input v-model="row.reference"
  1400. @change="handleEdit(row)" />
  1401. </template>
  1402. </el-table-column>
  1403. <el-table-column prop="remark" label="说明">
  1404. <template #default="{ row }">
  1405. <el-input v-model="row.remark" @change="handleEdit(row)" />
  1406. </template>
  1407. </el-table-column>
  1408. <!-- <el-table-column label="操作" width="140">
  1409. <template #default="scope">
  1410. <el-button size="small" type="danger"
  1411. @click.stop="sjdelete(scope.$index, scope.row)">删除</el-button>
  1412. </template>
  1413. </el-table-column> -->
  1414. </el-table>
  1415. </div>
  1416. <div class="elconstraint classtable" v-if="activeIndex2 == 1">
  1417. <el-table :data="tableData" border style="width: 100%" height="100">
  1418. <el-table-column type="index" label="编号" width="100" />
  1419. <el-table-column prop="name" label="约束名称">
  1420. <template #default="{ row }">
  1421. <el-input v-model="row.name" @change="handleEdit(row)" />
  1422. </template>
  1423. </el-table-column>
  1424. <!-- <el-table-column prop="con" label="约束关系">
  1425. <template v-slot="scope">
  1426. <el-select class="no-border " v-model.number="scope.row.con" :suffix-icon="CaretBottom"
  1427. placeholder="请选择">
  1428. <el-option v-for="item in options3" :key="item.value" :label="item.label"
  1429. :value="item.value">
  1430. </el-option>
  1431. </el-select>
  1432. </template>
  1433. </el-table-column> -->
  1434. <el-table-column prop="reference" label="约束基准值">
  1435. <template #default="{ row }">
  1436. <el-input v-model="row.reference"
  1437. @change="handleEdit(row)" />
  1438. </template>
  1439. </el-table-column>
  1440. <el-table-column prop="upper" label="上限值">
  1441. <template #default="{ row }">
  1442. <el-input v-model="row.upper"
  1443. @change="handleEdit(row)" />
  1444. </template>
  1445. </el-table-column>
  1446. <el-table-column prop="lower" label="下限值">
  1447. <template #default="{ row }">
  1448. <el-input v-model="row.lower"
  1449. @change="handleEdit(row)" />
  1450. </template>
  1451. </el-table-column>
  1452. <!-- <el-table-column label="操作" width="140">
  1453. <template #default="scope">
  1454. <el-button size="small" type="danger"
  1455. @click.stop="ysdelete(scope.$index, scope.row)">删除</el-button>
  1456. </template>
  1457. </el-table-column> -->
  1458. </el-table>
  1459. </div>
  1460. <div class="eloptimize classtable" v-if="activeIndex2 == 2">
  1461. <el-table :data="eloptimize" border style="width: 100%" height="100">
  1462. <el-table-column type="index" label="编号" width="70" />
  1463. <el-table-column prop="name" label="目标名称">
  1464. <template #default="{ row }">
  1465. <el-input v-model="row.name" />
  1466. </template>
  1467. </el-table-column>
  1468. <el-table-column prop="optdir" label="优化方向">
  1469. <template v-slot="scope">
  1470. <el-select class="no-border " v-model="scope.row.optdir" :suffix-icon="CaretBottom"
  1471. placeholder="请选择">
  1472. <el-option v-for="item in options1" :key="item.value" :label="item.label"
  1473. :value="item.value">
  1474. </el-option>
  1475. </el-select>
  1476. </template>
  1477. </el-table-column>
  1478. <el-table-column prop="weight" label="权重系数">
  1479. <template #default="{ row }">
  1480. <el-input v-model="row.weight"
  1481. @change="handleEdit(row)" />
  1482. </template>
  1483. </el-table-column>
  1484. <!-- <el-table-column prop="scaling" label="数据缩放">
  1485. <template v-slot="scope">
  1486. <el-checkbox :false-label="0" :true-label="1" v-model="scope.row.scaling" />
  1487. </template>
  1488. </el-table-column>
  1489. <el-table-column prop="factor" label="缩放因子">
  1490. <template #default="{ row }">
  1491. <el-input v-model.number="row.factor" oninput="value=value.replace(/^|[^0-9]/g,'')"
  1492. @change="handleEdit(row)" />
  1493. </template>
  1494. </el-table-column> -->
  1495. <el-table-column prop="reference" label="约束基准值">
  1496. <template #default="{ row }">
  1497. <el-input v-model="row.reference"
  1498. @change="handleEdit(row)" />
  1499. </template>
  1500. </el-table-column>
  1501. <el-table-column prop="remark" label="说明">
  1502. <template #default="{ row }">
  1503. <el-input v-model="row.remark" @change="handleEdit(row)" />
  1504. </template>
  1505. </el-table-column>
  1506. <!-- <el-table-column label="操作" width="140">
  1507. <template #default="scope">
  1508. <el-button size="small" type="danger"
  1509. @click.stop="mbdelete(scope.$index, scope.row)">删除</el-button>
  1510. </template>
  1511. </el-table-column> -->
  1512. </el-table>
  1513. </div>
  1514. </div>
  1515. <div class="dibu">
  1516. <div class="footer-add">
  1517. <div class="sev_ruwu">
  1518. <div class="disflex flexend">
  1519. <el-form-item label="新增变量数:" v-if="activeIndex2 === 0">
  1520. <el-input v-model="tableval" maxlength="6"
  1521. oninput="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" class="w-50 m-2"
  1522. />
  1523. </el-form-item>
  1524. <el-button class="btncolor" v-if="activeIndex2 === 0">导入</el-button>
  1525. <el-button class="btncolor" @click="onAddItem">新建</el-button>
  1526. <el-button class="btncolor" @click="onokItem">确定</el-button>
  1527. </div>
  1528. </div>
  1529. </div>
  1530. </div>
  1531. </div>
  1532. </div>
  1533. <div class="pading_foter">
  1534. </div>
  1535. </div>
  1536. </el-footer>
  1537. </div>
  1538. </div>
  1539. </div>
  1540. </div>
  1541. </el-main>
  1542. </el-container>
  1543. </div>
  1544. </template>
  1545. <script setup>
  1546. import { ref, onMounted, reactive, provide, nextTick } from "vue";
  1547. import { RouterView, RouterLink, useRouter, useRoute } from "vue-router"
  1548. import myheader from "@/components/header.vue"
  1549. import { request, uploadFile } from "@/utils/request";
  1550. import { ElMessage, ElButton, ElDialog, ElSelect } from 'element-plus'
  1551. import { Edit, CaretBottom } from '@element-plus/icons-vue'
  1552. // import '@/utils/flexible'
  1553. import s0 from "@/assets/img/s0.png"
  1554. import gc1 from "@/assets/img/gc1.png"
  1555. import gc2 from "@/assets/img/gc2.png"
  1556. import gc3 from "@/assets/img/gc3.png"
  1557. import wen from "@/assets/img/wen.png"
  1558. import q2 from "@/assets/img/q2.png"
  1559. import f21 from "@/assets/img/f21.png"
  1560. import f22 from "@/assets/img/f22.png"
  1561. import f41 from "@/assets/img/f41.png"
  1562. import xin from "@/assets/img/xin.png"
  1563. import xin2 from "@/assets/img/xin2.png"
  1564. import s from "@/assets/img/s.png"
  1565. import y from "@/assets/img/y.png"
  1566. import y2 from "@/assets/img/y2.png"
  1567. import nos from "@/assets/img/nos.png"
  1568. import zy from "@/assets/img/zy.png"
  1569. import zy2 from "@/assets/img/zy2.png"
  1570. import xuek10 from '@/assets/flowimg/xuek10.png'
  1571. import xuek11 from '@/assets/flowimg/xuek11.png'
  1572. import xuek12 from '@/assets/flowimg/xuek12.png'
  1573. import optmonitor from './echart/optimize_monitor.vue'
  1574. import processMonitor1 from "./echart/process-monitor1.vue"
  1575. import processMonitor2 from "./echart/process-monitor2.vue"
  1576. import echartindex from './echart/index.vue'
  1577. import sixtop from './echart/six_top.vue'
  1578. import sixbottom from './echart/six_bottom.vue'
  1579. import sixindex from './demo/index.vue'
  1580. import sixchine from './demo/chine.vue'
  1581. import vuefindex from './vuetree/index.vue'
  1582. import Sidebar from './vuetree/Sidebar.vue'
  1583. // 可视化echart
  1584. import tablelist from './echart/tablelist.vue'
  1585. import echartarea from './echart/area.vue'
  1586. import bargraph from './echart/bargraph.vue'
  1587. import echartLine from './echart/echartLine.vue'
  1588. import BarChart from './echart/BarChart.vue'
  1589. import scatter from './echart/scatter.vue'
  1590. import radar from './echart/radar.vue'
  1591. import pie from './echart/pie.vue'
  1592. import pareto from './echart/pareto.vue'
  1593. import Doptimize from './titlecomponent/Doptimize.vue'
  1594. import Joptimize from './titlecomponent/Joptimize.vue'
  1595. import Toptimize from './titlecomponent/Toptimize.vue'
  1596. import ADflow from './titlecomponent/ADflow.vue'
  1597. import Xfoil from './titlecomponent/Xfoil.vue'
  1598. import csts from './titlecomponent/csts.vue'
  1599. import ffds from './titlecomponent/ffds.vue'
  1600. import cloudsecond from "./titlecomponent/Cloudsecond.vue";
  1601. import FSI from './titlecomponent/FSI.vue'
  1602. import Flight from './titlecomponent/Flight.vue'
  1603. import ListSE from "./titlecomponent/ListSE.vue";
  1604. import TACS from "./titlecomponent/TACS.vue";
  1605. import fileUploads from './components/fileuploads.vue'
  1606. import Exreport from "./titlecomponent/Exreport.vue";
  1607. import PythonEdit from '@/components/PythonEditor/index.vue'; // python编辑器
  1608. import pdfReportView from '@/components/pdfReportView/index.vue'; //报告查看
  1609. import cloudChart from './threejsView/index.vue'; // 云图
  1610. import emitter from "@/utils/emitter";
  1611. let Sidebarref = ref();
  1612. let resource=ref(0);
  1613. let cstnum=ref('');
  1614. let textarea2=ref()
  1615. let textarea1 = ref(`import os
  1616. import numpy as np
  1617. from surromdao.solver import BaseSolver
  1618. class Branin(BaseSolver):
  1619. def __init__(self, filename=os.path):
  1620. super().__init__(filename)
  1621. def compute(self, xdict):
  1622. x = np.zeros(2)
  1623. # x[0] = xdict['x1']
  1624. # x[1] = xdict['x2']`);
  1625. let Cstref = ref();
  1626. let Ffdref = ref();
  1627. let Xfoilref = ref();
  1628. let ADflowref = ref();
  1629. let Joptimizeref=ref();
  1630. let Doptimizeref=ref();
  1631. let Toptimizeref=ref();
  1632. let Fsiref=ref();
  1633. let Flightref=ref();
  1634. let f4ce = ref("优化问题组件");
  1635. let modelban = ref("学科分析组件");
  1636. let undmodel=ref('优化器组件');
  1637. let optiongroup1 = ref([
  1638. { label: '优化问题', value: '优化问题' }
  1639. ])
  1640. let options4 = ref([
  1641. { label: '进化优化器', value: '进化优化器', icon:xuek10 },
  1642. { label: '代理优化器', value: '代理优化器', icon:xuek11 },
  1643. { label: '梯度优化器', value: '梯度优化器', icon:xuek12 },
  1644. ])
  1645. let formLabelWidth3=ref(100)
  1646. let formLabelWidth200=ref(200)
  1647. let tablecstHeaders=ref([]);
  1648. let treeitem = ref({});
  1649. let treeitem2 = ref({});
  1650. let treeitem3 = ref({});
  1651. let percentage = ref(70);
  1652. let progressshow = ref(false);
  1653. let flowshow = ref(true);
  1654. let jiankong = ref(false);
  1655. let echartshow = ref(false);
  1656. let echartshow2 = ref(false);
  1657. let tablelistshow = ref(false);
  1658. let areashow = ref(false);
  1659. let echartLineshow = ref(false);
  1660. let BarChartshow = ref(false);
  1661. let bargraphshow = ref(false);
  1662. let scattershow = ref(false);
  1663. let radarshow = ref(false);
  1664. let pieshow = ref(false);
  1665. let paretoshow = ref(false);
  1666. let bargraphref = ref();
  1667. let echartLineref = ref();
  1668. let BarChartref = ref();
  1669. let radarref = ref();
  1670. let pieref = ref();
  1671. let paretoref = ref();
  1672. let scatterref = ref();
  1673. let echartzongshow = ref(false);
  1674. const router = useRouter();
  1675. const route = useRoute();
  1676. let tablelistref = ref();
  1677. let echartdata = ref(null);
  1678. let optmonitor1 = ref();
  1679. let processMonitor1ref = ref()
  1680. let processMonitor2ref = ref()
  1681. let arearef = ref();
  1682. let tableHeaders = ref([
  1683. { label: '参数1', prop: 'value1' },
  1684. { label: '参数2', prop: 'value2' },
  1685. { label: '参数3', prop: 'value3' },
  1686. { label: '参数4', prop: 'value4' },
  1687. { label: '参数5', prop: 'value5' },
  1688. ])
  1689. let varsobj = ref({});
  1690. let valsobj = ref({});
  1691. let tabarr = ref([]);
  1692. let arrobj = ref([]);
  1693. let tableDatalieb = ref([
  1694. { value1: '0.00', value2: '0.00', value3:'0.00', value4:'0.00', value5:'0.00'},
  1695. { value1: '0.00', value2: '0.00', value3:'0.00', value4:'0.00', value5:'0.00'},
  1696. { value1: '0.00', value2: '0.00', value3:'0.00', value4:'0.00', value5:'0.00'},
  1697. { value1: '0.00', value2: '0.00', value3:'0.00', value4:'0.00', value5:'0.00'},
  1698. { value1: '0.00', value2: '0.00', value3:'0.00', value4:'0.00', value5:'0.00'},
  1699. ])
  1700. let curvedata = ref('');
  1701. let websock = ref(null);
  1702. let times = ref({
  1703. lockReconnect: false, //是否真正建立连接
  1704. timeout: 28 * 1000, //30秒一次心跳
  1705. timeoutObj: null, //心跳倒计时
  1706. serverTimeoutObj: null, //
  1707. timeoutnum: null, //断开重连倒计时
  1708. })
  1709. let input3=ref()
  1710. let eid = ref('');//进步优化器的eid
  1711. let logs = ref("");
  1712. let pid = ref("");
  1713. let pythonwid = ref();
  1714. let youhuaqiwid = ref();
  1715. let canshuhuawid = ref();
  1716. let qidongyouhuawid = ref();
  1717. let fid = ref('');
  1718. let conid = ref('');
  1719. let tableval = ref();
  1720. let vuefval = ref();
  1721. let elodingfalse = ref(false);
  1722. let footerShow = ref(true);
  1723. let zhixing = ref('Rosenbrock');
  1724. let tabName = ref("one")
  1725. const tabs = [{
  1726. name:'信息栏',
  1727. img:xin,
  1728. },{
  1729. name:'优化问题',
  1730. img:xin2,
  1731. }]
  1732. const listli=[{
  1733. name:'设计变量',
  1734. noimg:nos,
  1735. isimg:s
  1736. },{
  1737. name:'约束条件',
  1738. noimg:y2,
  1739. isimg:zy2
  1740. },
  1741. {
  1742. name:'优化目标',
  1743. noimg:y,
  1744. isimg:zy
  1745. }
  1746. ]
  1747. const xfoil = ['输入', '执行', '输出'];
  1748. const newxfoil = ['输入参数', '输出参数', '中间参数'];
  1749. let srtable = ref([]);
  1750. let radio1=ref(0);
  1751. let srnewtable = ref([
  1752. {
  1753. date: '2016-05-04',
  1754. name: 'Aleyna Kutzner',
  1755. },
  1756. {
  1757. date: '2016-05-03',
  1758. name: 'Helen Jacobi',
  1759. },
  1760. ]);
  1761. let scnewtable = ref([
  1762. {
  1763. date: '2016-05-04',
  1764. name: 'Aleyna Kutzner',
  1765. con:-1
  1766. },
  1767. {
  1768. date: '2016-05-03',
  1769. name: 'Helen Jacobi',
  1770. con:1
  1771. },
  1772. ]);
  1773. let sctable = ref([]);
  1774. // let quxian=ref([{
  1775. // val:'1',name:"设计变量",
  1776. // val:'2',name:"约束条件",
  1777. // val:'3',name:"约束条件",
  1778. // }])
  1779. // let quval=ref('1')
  1780. let currentTab=ref(0);
  1781. // let tabslist = ref([
  1782. // { id: '0', name: '来流参数' },
  1783. // { id: '1', name: '设置参数' },
  1784. // { id: '2', name: '分析参数' },
  1785. // ])
  1786. let yslist = ref([
  1787. { label: 'GA', value: 'GA' },
  1788. { label: 'PSO', value: 'PSO' },
  1789. { label: 'NSGA2', value: 'NSGA2' },
  1790. ])
  1791. let lailiutable=ref([
  1792. {
  1793. data: 1,
  1794. name: '结构质量',
  1795. con:-1
  1796. },
  1797. {
  1798. data: 23,
  1799. name: 'KS失效',
  1800. con:1
  1801. },
  1802. {
  1803. data: 0.0,
  1804. name: '最大变形',
  1805. con: -1
  1806. }
  1807. ])
  1808. let quxian = ref([
  1809. { label: '设计变量', value: '设计变量' },
  1810. { label: '约束条件', value: '约束条件' },
  1811. { label: '目标函数', value: '目标函数' },
  1812. ])
  1813. let quval = ref("")
  1814. const activeIndex = ref(0);
  1815. const activeIndex2 = ref(0);
  1816. const activeIndex3 = ref(0);
  1817. const color1 = ref('');
  1818. const colortier = ref('rgba(16, 185, 129, 0.5)');
  1819. let showTrigger = ref(false);
  1820. let activeadf=ref('Xfoil');
  1821. const datatree = ref([
  1822. {
  1823. id: 1,
  1824. label: '工程',
  1825. children: [
  1826. {
  1827. id: '1-1',
  1828. label: '优化问题',
  1829. img: gc1,
  1830. },
  1831. {
  1832. id: '1-2',
  1833. label: '分析流程',
  1834. img: gc2,
  1835. },
  1836. {
  1837. id: '1-3',
  1838. label: '优化器',
  1839. img: gc3
  1840. },
  1841. ],
  1842. },
  1843. ])
  1844. let options1 = ref([
  1845. { label: '最大化', value: "-1" },
  1846. { label: '最小化', value: "1" },
  1847. ])
  1848. let options2 = ref([
  1849. { label: '升力系数', value: '升力系数' },
  1850. { label: '翼型面积', value: '翼型面积' },
  1851. ])
  1852. let options3 = ref([
  1853. { label: '大于', value: -1 },
  1854. { label: '小于', value: 1 },
  1855. ])
  1856. let shuxingopt = ref([
  1857. { label: '约束条件', value: -1 },
  1858. { label: '优化目标', value: 1 },
  1859. ])
  1860. let defaultExpandedArr = ref([]);
  1861. const defaultProps = {
  1862. children: 'children',
  1863. label: 'label',
  1864. }
  1865. let svarlist = ref('');
  1866. let conlist = ref('');
  1867. let funlist = ref('');
  1868. let looktext=ref('');
  1869. // treeData.value.forEach((item) => {
  1870. // defaultExpandedArr.value.push(item.id);
  1871. // });
  1872. const activeName = ref('Role')
  1873. const activeName1 = ref('message')
  1874. let active = ref('');
  1875. let tabactive = ref("");
  1876. let checkbox = ref(false)
  1877. let formLabelWidth6 = ref(100)
  1878. let formLabelWidth1 = ref(170)
  1879. let formLabelWidth2 = ref(130)
  1880. let canshu = ref();
  1881. let question = ref([
  1882. { url: 'kk1.png', titlie: "列表" },
  1883. { url: 'kk2.png', titlie: "散点图" },
  1884. { url: 'kk4.png', titlie: "折线图" },
  1885. { url: 'kk8.png', titlie: "帕雷托图" },
  1886. { url: 'kk3.png', titlie: "面积图" },
  1887. { url: 'kk5.png', titlie: "柱状图" },
  1888. { url: 'k3.png', titlie: "饼状图" },
  1889. { url: 'kk6.png', titlie: "横条图" },
  1890. { url: 'kk7.png', titlie: "雷达图" },
  1891. { url: 'kk9.png', titlie: "云图/等值线" },
  1892. { url: 'kk10.png', titlie: "查看报告" },
  1893. { url: 'kk11.png', titlie: "导出报告" },
  1894. ])
  1895. let roletion = ref([
  1896. { url: 'f41.png', titlie: "测试函数模板" },
  1897. { url: 'r1.png', titlie: "工程优化模板" },
  1898. { url: 'r2.png', titlie: "自定义" },
  1899. ])
  1900. let tasktion = ref([
  1901. { url: 't0.png', titlie: "外形参数化" },
  1902. ])
  1903. let Rolelist = ref([
  1904. { url: 'tow1.png', titlie: "优化问题组件" },
  1905. { url: 'tow2.png', titlie: "学科分析组件" },
  1906. { url: 'tow3.png', titlie: "优化器组件" },
  1907. ])
  1908. let Rolelist1 = ref([
  1909. { url: 'l1.png', titlie: "逻辑流连线" },
  1910. { url: 'l2.png', titlie: "数据流连线" },
  1911. ])
  1912. let Rolelist11 = ref([{ url: 'w6.png', titlie: "选择连线颜色" }])
  1913. let Rolelist2 = ref([
  1914. { url: 'cai1.png', titlie: "模块组合" },
  1915. { url: 'cai2.png', titlie: "模块拆分" },
  1916. ])
  1917. let Rolelist22 = ref([{ url: 'w9.png', titlie: "选择图框颜色" }])
  1918. let Rolelist3 = ref([
  1919. { url: 'w10.png', titlie: "添加注释" },
  1920. ])
  1921. let Threelist = ref([
  1922. { url: 'you1.png', titlie: "开始" },
  1923. { url: 'you2.png', titlie: "暂停" },
  1924. { url: 'you3.png', titlie: "续算" },
  1925. { url: 'tts.png', titlie: "结束" },
  1926. ])
  1927. let Threelist1 = ref([
  1928. { url: 'yh1.png', titlie: "列表监控" },
  1929. { url: 'yh2.png', titlie: "曲线监控" },
  1930. { url: 'yh3.png', titlie: "过程监控" },
  1931. ])
  1932. let Sevenlist = ref([
  1933. { url: 'rr2.png', titlie: '任务检索' },
  1934. { url: 'rr1.png', titlie: '任务管理' },
  1935. { url: 'rr3.png', titlie: '备份' },
  1936. ])
  1937. let eightlist = ref([
  1938. { url: 'e1.png', titlie: '用户手册' },
  1939. { url: 'e2.png', titlie: '帮助文档' },
  1940. { url: 'e3.png', titlie: '关于软件' },
  1941. ])
  1942. let canshulist = ref([
  1943. { label: 'CST参数化', value: 'CST参数化' },
  1944. { label: 'FFD参数化', value: 'FFD参数化' },
  1945. ])
  1946. let sevlist = ref([
  1947. { label: '任务编号', value: '任务编号' },
  1948. { label: '任务名称', value: '任务名称' },
  1949. { label: '任务类型', value: '任务类型' },
  1950. { label: '创建时间', value: '创建时间' },
  1951. ])
  1952. let seval4 = ref('任务名称');
  1953. let agelist = ref([
  1954. { label: 'Kriging模型', value: 'Kriging模型' },
  1955. { label: '相关函数类型', value: '相关函数类型' },
  1956. { label: '超参数优化方法', value: '超参数优化方法' },
  1957. { label: 'Hooke Jeeves方法循环次数', value: 'Hooke Jeeves方法循环次数' },
  1958. ])
  1959. let agval = ref("Kriging模型")
  1960. let agval1 = ref("固定设计空间")
  1961. let agval2 = ref("拉丁超立方")
  1962. let agelist1 = ref([
  1963. { label: '固定设计空间', value: '固定设计空间' },
  1964. ])
  1965. let agelist2 = ref([
  1966. { label: '拉丁超立方', value: '拉丁超立方' },
  1967. ])
  1968. let addval = ref("EI + MSP")
  1969. let addlist = ref([
  1970. { label: 'EI + MSP', value: 'EI + MSP' },
  1971. ])
  1972. let addval1 = ref("概率相乘法")
  1973. let addlist1 = ref([
  1974. { label: '概率相乘法', value: '概率相乘法' },
  1975. ])
  1976. let addval2 = ref("SBX交叉")
  1977. let addlist2 = ref([
  1978. { label: 'SBX交叉', value: 'SBX交叉' },
  1979. ])
  1980. let addval3 = ref("最佳保留策略")
  1981. let ys = ref("GA")
  1982. let addlist3 = ref([
  1983. { label: '最佳保留策略', value: '最佳保留策略' },
  1984. ])
  1985. let addval4 = ref("倒位变异")
  1986. let addlist4 = ref([
  1987. { label: '倒位变异', value: '倒位变异' },
  1988. ])
  1989. let addval7 = ref("1e-7")
  1990. let addlist7 = ref([
  1991. { label: '1e-7', value: '1e-7' },
  1992. ])
  1993. let addval8 = ref("NO")
  1994. let addlist8 = ref([
  1995. { label: 'YES', value: 'YES' },
  1996. { label: 'NO', value: 'NO' },
  1997. ])
  1998. let paretocbval = ref([])
  1999. let paretocheckbox = ref([
  2000. {label:'-cl',value:'-cl'},
  2001. {label:'cd',value:'cd'},
  2002. ])
  2003. let cloudbtnbox = ref([
  2004. {url:'meshFile.png',btnname:'文件选择'},
  2005. {url:'yu.png',btnname:'域'},
  2006. {url:'kk9.png',btnname:'云图'},
  2007. {url:'seka.png',btnname:'色卡'},
  2008. {url:'dengzx.png',btnname:'等值线'},
  2009. ])
  2010. let dialog = ref({
  2011. newdialog: false,
  2012. setdialog: false,
  2013. targetdialog: false,
  2014. design: false,
  2015. constraint: false,
  2016. parameter: false,
  2017. agency: false,
  2018. optimizer: false,
  2019. jboptimizer: false,
  2020. dboptimizer: false,
  2021. tboptimizer: false,
  2022. isADflow:false,
  2023. lookover:false,
  2024. exportreport:false,
  2025. Xfiol: false,
  2026. tidu:false,
  2027. CSTt:false,
  2028. ffdt:false,
  2029. XfAD:false,
  2030. cstffd:false,
  2031. Taxs:false,
  2032. enddialog: false,
  2033. addfun: false,
  2034. sufun: false,
  2035. task: false,
  2036. guanli: false,
  2037. optgroup:false,
  2038. Pythonshow:false,
  2039. listdialog:false,
  2040. scatterdialog:false,
  2041. echartLinedialog:false,
  2042. paretodialog:false,
  2043. clouddialog:false,
  2044. fsidialog:false,
  2045. flightdialog:false,
  2046. })
  2047. // let columns=ref[{
  2048. // columns: [
  2049. // { label: '上表面', prop: 'sbiao' },
  2050. // { label: '下表面', prop: 'xbiao' },
  2051. // // 动态添加更多列
  2052. // ]
  2053. // }]
  2054. let options = ref([
  2055. { label: '升阻比', value: '升阻比' },
  2056. { label: 'RCS', value: 'RCS' },
  2057. ])
  2058. let tasklist = ref([
  2059. { label: '气动', value: '气动' },
  2060. { label: '结构', value: '结构' },
  2061. { label: '隐身', value: '隐身' },
  2062. { label: '噪声', value: '噪声' },
  2063. ])
  2064. const optiongroup = [
  2065. {
  2066. label: '大飞机',
  2067. options: [
  2068. {
  2069. value: '气动优化',
  2070. label: '气动优化',
  2071. },
  2072. {
  2073. value: '气弹优化',
  2074. label: '气弹优化',
  2075. },
  2076. ],
  2077. },
  2078. {
  2079. label: '直升机',
  2080. options: [
  2081. {
  2082. value: '气动优化1',
  2083. label: '气动优化',
  2084. },
  2085. {
  2086. value: '气弹优化2',
  2087. label: '气弹优化',
  2088. },
  2089. {
  2090. value: '气动噪声优化',
  2091. label: '气动噪声优化',
  2092. },
  2093. ],
  2094. },
  2095. ]
  2096. const eloptimize = ref([])
  2097. const tableData = ref([])
  2098. const designtable = ref([])
  2099. const tasktable = ref([
  2100. // {
  2101. // id: "01",
  2102. // time: '2016-05-03',
  2103. // name: '升阻比',
  2104. // state: '增大',
  2105. // },
  2106. // {
  2107. // id: "02",
  2108. // time: '2016-05-03',
  2109. // name: '升阻比',
  2110. // state: '增大',
  2111. // },
  2112. ])
  2113. const customColor = ref('#2267B1')
  2114. const customColors = [
  2115. { color: '#f56c6c', percentage: 20 },
  2116. { color: '#f56c6c', percentage: 40 },
  2117. { color: '#5cb87a', percentage: 60 },
  2118. { color: '#5cb87a', percentage: 80 },
  2119. { color: '#5cb87a', percentage: 100 },
  2120. ]
  2121. let name = ref("1")
  2122. let num = ref(1)
  2123. const getImgPath = (url) => {
  2124. return new URL(`../assets/img/${url}`, import.meta.url).href
  2125. }
  2126. onMounted(() => {
  2127. //console.log( Sidebarref.value.datatree);
  2128. setTimeout(function () {
  2129. init();
  2130. initWebSocket();
  2131. logsget();
  2132. // vuefval.value.getroter()
  2133. }, 1500);
  2134. // childfun();
  2135. });
  2136. const sjdelete = (index, row) => {
  2137. console.log(index);
  2138. designtable.value.splice(index, 1)
  2139. }
  2140. const ysdelete = (index, row) => {
  2141. tableData.value.splice(index, 1)
  2142. }
  2143. const mbdelete = (index, row) => {
  2144. eloptimize.value.splice(index, 1)
  2145. }
  2146. // 初始值
  2147. const init = () => {
  2148. pid.value = route.query.pid;
  2149. console.log(route.query.pid);
  2150. }
  2151. const handleClick = (tab, event) => {
  2152. console.log('标签页:',tab.props.name);
  2153. tabactive.value = tab.props.name;
  2154. if (tabactive.value == 'User') {
  2155. vuefval.value.logToObject1();
  2156. router.replace({ path: '/' })
  2157. } else {
  2158. }
  2159. if (tabactive.value == 'Role') {
  2160. flowshow.value = true;
  2161. console.log(11111)
  2162. } else {
  2163. flowshow.value = false;
  2164. console.log(flowshow.value)
  2165. }
  2166. ifjiankong();
  2167. dialogcolse()
  2168. // 可视化标签页
  2169. if (tabactive.value == 'Config') {
  2170. echartzongshow.value = true;
  2171. curveLine4();
  2172. } else {
  2173. echartzongshow.value = false;
  2174. }
  2175. }
  2176. const validateInput = (row) => {
  2177. // 允许输入 None / none / 负数 / 小数
  2178. if (/^(none|None|-?\d*\.?\d*)$/.test(row.upper)) {
  2179. row.upper = row.upper; // 允许输入
  2180. } else {
  2181. row.upper = row.upper.slice(0, -1); // 删除最后输入的非法字符
  2182. }
  2183. }
  2184. const validateInput1 = (row) => {
  2185. // 允许输入 None / none / 小数
  2186. if (/^(none|None|\d*\.?\d*)$/.test(row.upper)) {
  2187. row.upper = row.upper; // 允许输入
  2188. } else {
  2189. row.upper = row.upper.slice(0, -1); // 删除最后输入的非法字符
  2190. }
  2191. }
  2192. //表格点击事件
  2193. const handleEdit = (row) => {
  2194. // console.log('编辑后的数据:', row);
  2195. // 在这里处理数据保存逻辑,例如发送请求到后端更新数据
  2196. };
  2197. const footerClick = (tab, event) => {
  2198. }
  2199. // 关闭所有弹窗
  2200. const dialogcolse = () => {
  2201. dialog.value.newdialog = false;
  2202. dialog.value.setdialog = false;
  2203. dialog.value.targetdialog = false;
  2204. dialog.value.design = false;
  2205. dialog.value.constraint = false;
  2206. dialog.value.parameter = false;
  2207. dialog.value.agency = false;
  2208. dialog.value.addfun = false;
  2209. dialog.value.sufun = false;
  2210. dialog.value.enddialog = false;
  2211. dialog.value.task = false;
  2212. dialog.value.guanli = false;
  2213. }
  2214. // Tree的点击事件
  2215. const handleNodeClick = (data) => {
  2216. console.log(data)
  2217. tabactive.value = data.label;
  2218. dialogbolen();
  2219. }
  2220. const optimizerfalse = (val) => {
  2221. console.log('双击',val);
  2222. const name = val.name;
  2223. const wid = val.wid;
  2224. if (name == '优化器') {
  2225. // dialog.value.optimizer = true;
  2226. activeadf.value='代理优化器';
  2227. initoptimize(wid);
  2228. dialog.value.optgroup = true;
  2229. } else if (name == '参数化') {
  2230. activeadf.value='CST';
  2231. initcstffds(wid);
  2232. dialog.value.cstffd = true;
  2233. }else if (name == '气动分析') {
  2234. activeadf.value='Xfoil'
  2235. intxfoiladflow(wid);
  2236. dialog.value.XfAD = true;
  2237. } else if (name == '进化优化器') {
  2238. activeadf.value='进化优化器';
  2239. dialog.value.jboptimizer = true;
  2240. nextTick(() => {
  2241. // 确保 ref 已经初始化
  2242. if (Joptimizeref.value) {
  2243. // 调用 Joptimize 的 getoptimize 方法
  2244. Joptimizeref.value.getoptimize(pid.value,wid);
  2245. }
  2246. });
  2247. } else if (name == '代理优化器') {
  2248. activeadf.value='代理优化器';
  2249. // dialog.value.optgroup = true;
  2250. dialog.value.dboptimizer = true;
  2251. nextTick(() => {
  2252. // 确保 ref 已经初始化
  2253. if (Doptimizeref.value) {
  2254. Doptimizeref.value.getDoptimize(pid.value,wid);
  2255. }
  2256. });
  2257. }
  2258. // else if (val == 'Xfiol' || val == 'Rosenbrock') {
  2259. // importget();
  2260. // dialog.value.Xfiol = true;
  2261. // }
  2262. else if(name == '梯度优化器'){
  2263. activeadf.value='梯度优化器';
  2264. dialog.value.tboptimizer = true;
  2265. nextTick(() => {
  2266. // 确保 ref 已经初始化
  2267. if (Toptimizeref.value) {
  2268. Toptimizeref.value.getToptimize(pid.value,wid);
  2269. }
  2270. });
  2271. }else if(name == 'CST'){
  2272. /// dialog.value.CSTt = true;
  2273. activeadf.value='CST';
  2274. dialog.value.CSTt = true;
  2275. nextTick(() => {
  2276. // 确保 ref 已经初始化
  2277. if (Cstref.value) {
  2278. Cstref.value.getcst(pid.value,wid);
  2279. }
  2280. });
  2281. }else if(name == 'FFD'){
  2282. /// dialog.value.CSTt = true;
  2283. activeadf.value='FFD';
  2284. dialog.value.ffdt = true;
  2285. nextTick(() => {
  2286. // 确保 ref 已经初始化
  2287. if (Ffdref.value) {
  2288. Ffdref.value.getffds(pid.value,wid);
  2289. }
  2290. });
  2291. }
  2292. else if(name == 'ADflow'){
  2293. // adfhandleClick();
  2294. activeadf.value='ADflow';
  2295. dialog.value.isADflow = true;
  2296. nextTick(() => {
  2297. // 确保 ref 已经初始化
  2298. if (ADflowref.value) {
  2299. ADflowref.value.getadflow(pid.value,wid);
  2300. }
  2301. });
  2302. }else if(name == 'Xfoil'){
  2303. // activeadf.value='Xfiol';
  2304. dialog.value.Xfiol = true;
  2305. nextTick(() => {
  2306. // 确保 ref 已经初始化
  2307. if (Xfoilref.value) {
  2308. Xfoilref.value.getxfoil(pid.value,wid);
  2309. }
  2310. });
  2311. }else if(name == 'TACS'){
  2312. dialog.value.Taxs = true;
  2313. }else if(name == '模版'){
  2314. dialog.value.optgroup = true;
  2315. activeadf.value='代理优化器';
  2316. }else if(name == 'Python'){
  2317. dialog.value.Pythonshow = true;
  2318. initPython(wid);
  2319. }else if(name == 'FUM to FEM'){
  2320. dialog.value.fsidialog = true;
  2321. }else if(name == 'Flight'){
  2322. dialog.value.flightdialog = true;
  2323. }
  2324. else {
  2325. dialog.value.optimizer = false;
  2326. dialog.value.jboptimizer = false;
  2327. dialog.value.Xfiol = false;
  2328. dialog.value.lookover = false;
  2329. dialog.value.tidu = false;
  2330. dialog.value.CSTt = false;
  2331. dialog.value.XfAD = false;
  2332. dialog.value.cstffd = false;
  2333. dialog.value.Pythonshow = false;
  2334. dialog.value.fsidialog = false;
  2335. dialog.value.flightdialog = false;
  2336. }
  2337. }
  2338. // 优化器窗口初始化
  2339. const initoptimize = (nowid) => {
  2340. youhuaqiwid.value = nowid;
  2341. const params1 = {
  2342. transCode:'MDO0018',
  2343. pid: pid.value,
  2344. wid: youhuaqiwid.value
  2345. }
  2346. const params2 = {
  2347. transCode:'MDO0031',
  2348. pid: pid.value,
  2349. wid: youhuaqiwid.value
  2350. }
  2351. const params3 = {
  2352. transCode:'MDO0033',
  2353. pid: pid.value,
  2354. wid: youhuaqiwid.value
  2355. }
  2356. Promise.all([
  2357. request(params1),
  2358. request(params2),
  2359. request(params3)
  2360. ]).then(([res1, res2, res3]) => {
  2361. console.log('1:', res1.checked);
  2362. console.log('2:', res2.checked);
  2363. console.log('3:', res3.checked);
  2364. if(res1.hasOwnProperty('eid')){
  2365. Joptimizeref.value.getoptimizeAssign(res1);
  2366. console.log('fuz1:');
  2367. }
  2368. if(res3.hasOwnProperty('grid')){
  2369. Toptimizeref.value.getToptimizeAssign(res3);
  2370. console.log('fuz2:');
  2371. }
  2372. if(res2.hasOwnProperty('suid')){
  2373. Doptimizeref.value.getDoptimizeAssign(res2);
  2374. console.log('fuz3:');
  2375. }
  2376. // 根据返回值来设置 activeadf
  2377. if (res1.checked === 1) {
  2378. activeadf.value = '进化优化器';
  2379. } else if (res2.checked === 1) {
  2380. activeadf.value = '代理优化器';
  2381. } else if (res3.checked === 1) {
  2382. activeadf.value = '梯度优化器';
  2383. }
  2384. console.log('Updated activeadf:', activeadf.value);
  2385. }).catch((err) => {
  2386. console.error('请求失败:', err);
  2387. });
  2388. }
  2389. // CST/FFD窗口初始化
  2390. const initcstffds = (nowid) => {
  2391. canshuhuawid.value = nowid;
  2392. const params1 = {
  2393. transCode:'MDO0040',
  2394. pid: pid.value,
  2395. wid: canshuhuawid.value
  2396. }
  2397. const params2 = {
  2398. transCode:'MDO0043',
  2399. pid: pid.value,
  2400. wid: canshuhuawid.value
  2401. }
  2402. Promise.all([
  2403. request(params1),
  2404. request(params2),
  2405. ]).then(([res1, res2]) => {
  2406. console.log('1:', res1.checked);
  2407. console.log('2:', res2.checked);
  2408. if(res1.hasOwnProperty('cstid')){
  2409. Cstref.value.getcstAssign(res1);
  2410. }else if(res2.hasOwnProperty("ffdid")){
  2411. Ffdref.value.getffdsAssign(res2);
  2412. }
  2413. // 根据返回值来设置 activeadf
  2414. if (res1.checked === 1) {
  2415. activeadf.value = 'CST';
  2416. } else if (res2.checked === 1) {
  2417. activeadf.value = 'FFD';
  2418. }
  2419. console.log('Updated activeadf:', activeadf.value);
  2420. }).catch((err) => {
  2421. console.error('请求失败:', err);
  2422. });
  2423. }
  2424. // Xfoil/ADflow窗口初始化
  2425. const intxfoiladflow = (nowid) => {
  2426. qidongyouhuawid.value = nowid;
  2427. const params1 = {
  2428. transCode:'MDO0046',
  2429. pid: pid.value,
  2430. wid: qidongyouhuawid.value
  2431. }
  2432. const params2 = {
  2433. transCode:'MDO0049',
  2434. pid: pid.value,
  2435. wid: qidongyouhuawid.value
  2436. }
  2437. Promise.all([
  2438. request(params1),
  2439. request(params2),
  2440. ]).then(([res1, res2]) => {
  2441. console.log('1:', res1.checked);
  2442. console.log('2:', res2.checked);
  2443. if(res1.hasOwnProperty("xfid")){
  2444. Xfoilref.value.getxfoilAssign(res1);
  2445. }else if(res2.hasOwnProperty("adid")){
  2446. ADflowref.value.getadflowAssign(res2);
  2447. }
  2448. // 根据返回值来设置 activeadf
  2449. if (res1.checked === 1) {
  2450. activeadf.value = 'Xfoil';
  2451. } else if (res2.checked === 1) {
  2452. activeadf.value = 'ADflow';
  2453. }
  2454. console.log('Updated activeadf:', activeadf.value);
  2455. }).catch((err) => {
  2456. console.error('请求失败:', err);
  2457. });
  2458. }
  2459. // Python窗口初始化
  2460. const initPython = (nowid) => {
  2461. console.log('Pythonchushihua');
  2462. pythonwid.value = nowid;
  2463. const param = {
  2464. transCode: 'MDO0036',
  2465. pid: pid.value,
  2466. wid: pythonwid.value
  2467. };
  2468. request(param).then((res) => {
  2469. console.log('Python:', res);
  2470. // 判断 res.ptython 是否为空,若不为空则赋值
  2471. if (res.ptython) {
  2472. textarea1.value = res.ptython;
  2473. }
  2474. }).catch((err) => {
  2475. console.error('Python内容初始化失败');
  2476. });
  2477. };
  2478. // Python确认按钮提交
  2479. const pythonSubmit = () => {
  2480. console.log('Python确认按钮提交');
  2481. const param = {
  2482. transCode:'MDO0037',
  2483. pid: pid.value,
  2484. wid: pythonwid.value,
  2485. python: textarea1.value,
  2486. }
  2487. request(param).then((res) => {
  2488. ElMessage({
  2489. message: '保存成功',
  2490. type: 'success',
  2491. })
  2492. }).catch((err) => {
  2493. ElMessage.error('保存失败')
  2494. });
  2495. }
  2496. // python处理编辑器内容变化的方法
  2497. const handleEditorChange = (value) => {
  2498. console.log('Editor content changed in parent component:', value);
  2499. };
  2500. // 模块选择
  2501. const clickgeometry = (e, index, key, name) => {
  2502. console.log(key);
  2503. console.log('模块选择:',name);
  2504. tabactive.value = name;
  2505. dialogbolen();
  2506. }
  2507. const dialogbolen = () => {
  2508. switch (tabactive.value) {
  2509. case "新建任务":
  2510. dialog.value.newdialog = true;
  2511. break;
  2512. case "问题设定":
  2513. dialog.value.setdialog = true;
  2514. break;
  2515. case "优化目标":
  2516. dialog.value.targetdialog = true;
  2517. break;
  2518. case "设计变量":
  2519. dialog.value.design = true;
  2520. break;
  2521. case "约束条件":
  2522. dialog.value.constraint = true;
  2523. break;
  2524. case "外形参数化":
  2525. dialog.value.parameter = true;
  2526. break;
  2527. case "代理模型":
  2528. dialog.value.agency = true;
  2529. break;
  2530. case "加点方法":
  2531. dialog.value.addfun = true;
  2532. break;
  2533. case "优化算法":
  2534. dialog.value.sufun = true;
  2535. break;
  2536. case "终止条件":
  2537. dialog.value.enddialog = true;
  2538. break;
  2539. case "任务管理":
  2540. dialog.value.task = true;
  2541. break;
  2542. case "任务检索":
  2543. dialog.value.guanli = true;
  2544. break;
  2545. case "选择连线颜色":
  2546. showTrigger.value = true;
  2547. break;
  2548. case "逻辑流连线":
  2549. vuefval.value.linestrokeWidth(1);
  2550. break;
  2551. case "数据流连线":
  2552. vuefval.value.linestrokeWidth(3);
  2553. break;
  2554. case "模块组合":
  2555. vuefval.value.bgcolorfunc(colortier.value);
  2556. vuefval.value.onSelection();
  2557. break;
  2558. case "开始":
  2559. // optmonitor1.value.echatinit();
  2560. // processMonitor1ref.value.echatinit();
  2561. // processMonitor1ref.value.echatinit();
  2562. runok();
  2563. break;
  2564. case "列表监控":
  2565. ifjiankong();
  2566. listtableInit();
  2567. break;
  2568. case "曲线监控":
  2569. ifjiankong()
  2570. curveLine();
  2571. break;
  2572. case "过程监控":
  2573. ifjiankong()
  2574. curveLine2();
  2575. curveLine3();
  2576. break;
  2577. case "列表":
  2578. echatsfunc();
  2579. dialog.value.listdialog = true;
  2580. break;
  2581. case "面积图":
  2582. echatsfunc();
  2583. // curveLine4();
  2584. break;
  2585. case "饼状图":
  2586. echatsfunc();
  2587. break;
  2588. case "柱状图":
  2589. echatsfunc();
  2590. break;
  2591. case "折线图":
  2592. dialog.value.echartLinedialog = true;
  2593. echatsfunc();
  2594. // curveLine4();
  2595. nextTick(() => {
  2596. initListSe();
  2597. });
  2598. break;
  2599. case "散点图":
  2600. // logsget();
  2601. dialog.value.scatterdialog = true;
  2602. echatsfunc();
  2603. // curveLine4();
  2604. nextTick(() => {
  2605. initListSe();
  2606. });
  2607. break;
  2608. case "横条图":
  2609. echatsfunc();
  2610. break;
  2611. case "雷达图":
  2612. //logsget();
  2613. echatsfunc();
  2614. break;
  2615. case "帕雷托图":
  2616. dialog.value.paretodialog = true;
  2617. echatsfunc();
  2618. break;
  2619. case "云图/等值线":
  2620. dialog.value.clouddialog = true;
  2621. break;
  2622. case "查看报告":
  2623. echatsfunc();
  2624. dialog.value.lookover = true;
  2625. break;
  2626. case "导出报告":
  2627. dialog.value.exportreport = true;
  2628. break;
  2629. default:
  2630. }
  2631. }
  2632. // 可视化清空
  2633. const echartclear = () => {
  2634. arearef.value.echatinit();
  2635. bargraphref.value.echatinit();
  2636. echartLineref.value.echatinit();
  2637. BarChartref.value.echatinit();
  2638. radarref.value.echatinit();
  2639. scatterref.value.echatinit();
  2640. pieref.value.echatinit();
  2641. paretoref.value.echatinit();
  2642. }
  2643. const echatsfunc = () => {
  2644. //echartzongshow.value=true;
  2645. // echartclear();
  2646. switch (tabactive.value) {
  2647. case "列表":
  2648. tablelistshow.value = true;
  2649. areashow.value = false;
  2650. bargraphshow.value = false;
  2651. echartLineshow.value = false;
  2652. BarChartshow.value = false;
  2653. radarshow.value = false;
  2654. scattershow.value = false;
  2655. pieshow = false;
  2656. paretoshow =false;
  2657. break;
  2658. case "面积图":
  2659. tablelistshow.value = false;
  2660. areashow.value = true;
  2661. bargraphshow.value = false;
  2662. echartLineshow.value = false;
  2663. BarChartshow.value = false;
  2664. radarshow.value = false;
  2665. scattershow.value = false;
  2666. pieshow = false;
  2667. paretoshow =false;
  2668. break;
  2669. case "柱状图":
  2670. tablelistshow.value = false;
  2671. areashow.value = false;
  2672. bargraphshow.value = true;
  2673. echartLineshow.value = false;
  2674. BarChartshow.value = false;
  2675. radarshow.value = false;
  2676. scattershow.value = false;
  2677. pieshow = false;
  2678. paretoshow = false;
  2679. break;
  2680. case "饼状图":
  2681. tablelistshow.value = false;
  2682. areashow.value = false;
  2683. bargraphshow.value = false;
  2684. echartLineshow.value = false;
  2685. BarChartshow.value = false;
  2686. radarshow.value = false;
  2687. scattershow.value = false;
  2688. pieshow = true;
  2689. paretoshow = false;
  2690. break;
  2691. case "折线图":
  2692. tablelistshow.value = false;
  2693. areashow.value = false;
  2694. bargraphshow.value = false;
  2695. echartLineshow.value = true;
  2696. BarChartshow.value = false;
  2697. radarshow.value = false;
  2698. scattershow.value = false;
  2699. pieshow = false;
  2700. paretoshow = false;
  2701. break;
  2702. case "散点图":
  2703. tablelistshow.value = false;
  2704. areashow.value = false;
  2705. bargraphshow.value = false;
  2706. echartLineshow.value = false;
  2707. BarChartshow.value = false;
  2708. radarshow.value = false;
  2709. scattershow.value = true;
  2710. pieshow = false;
  2711. paretoshow = false;
  2712. break
  2713. case "横条图":
  2714. tablelistshow.value = false;
  2715. areashow.value = false;
  2716. bargraphshow.value = false;
  2717. echartLineshow.value = false;
  2718. BarChartshow.value = true;
  2719. radarshow.value = false;
  2720. scattershow.value = false;
  2721. pieshow = false;
  2722. paretoshow = false;
  2723. break
  2724. case "雷达图":
  2725. tablelistshow.value = false;
  2726. areashow.value = false;
  2727. bargraphshow.value = false;
  2728. echartLineshow.value = false;
  2729. BarChartshow.value = false;
  2730. radarshow.value = true;
  2731. scattershow.value = false;
  2732. pieshow = false;
  2733. paretoshow = false;
  2734. break
  2735. case "帕雷托图":
  2736. tablelistshow.value = false;
  2737. areashow.value = false;
  2738. bargraphshow.value = false;
  2739. echartLineshow.value = false;
  2740. BarChartshow.value = false;
  2741. radarshow.value = false;
  2742. scattershow.value = false;
  2743. pieshow = false;
  2744. paretoshow = true;
  2745. break
  2746. default:
  2747. tablelistshow.value = false;
  2748. areashow.value = false;
  2749. bargraphshow.value = false;
  2750. echartLineshow.value = false;
  2751. BarChartshow.value = false;
  2752. radarshow.value = false;
  2753. scattershow.value = false;
  2754. pieshow = false;
  2755. paretoshow = false;
  2756. break
  2757. }
  2758. }
  2759. // 可视化结束
  2760. // ||activeName.value=='Three'&&tabactive.value=='开始'
  2761. const ifjiankong = () => {
  2762. if (activeName.value == 'Three' && tabactive.value == '列表监控' || activeName.value == 'Three' && tabactive.value == '开始') {
  2763. jiankong.value = true;
  2764. } else {
  2765. jiankong.value = false;
  2766. }
  2767. if (activeName.value == 'Three' && tabactive.value == '曲线监控' ) {
  2768. echartshow.value = true;
  2769. } else {
  2770. echartshow.value = false;
  2771. }
  2772. if (activeName.value == 'Three' && tabactive.value == '过程监控' ) {
  2773. echartshow2.value = true;
  2774. } else {
  2775. echartshow2.value = false;
  2776. }
  2777. }
  2778. // 求解
  2779. const runok = () => {
  2780. if(echartshow.value){
  2781. optmonitor1.value.echatinit();
  2782. }else if(echartshow2.value){
  2783. processMonitor1ref.value.echatinit();
  2784. processMonitor2ref.value.echatinit();
  2785. }
  2786. const params = {
  2787. transCode: 'MDO0039',
  2788. pid: pid.value,
  2789. }
  2790. request(params)
  2791. .then((res) => {
  2792. logs.value = '';
  2793. arrobj.value = [];
  2794. tabarr.value = [];
  2795. tableDatalieb.value = [];
  2796. tableHeaders.value = [];
  2797. ElMessage({
  2798. message: "开始运行",
  2799. type: 'success',
  2800. })
  2801. })
  2802. .catch((err) => {
  2803. ElMessage.error(err.returnMsg)
  2804. })
  2805. }
  2806. const tableKey = ref(0);
  2807. const listtableInit = () => {
  2808. const params = {
  2809. transCode: 'MDO0021',
  2810. pid: pid.value,
  2811. type: 1,
  2812. }
  2813. request(params)
  2814. .then((res) => {
  2815. tableDatalieb.value = [];
  2816. tableKey.value++;
  2817. if (res.rows && res.rows.length > 0) {
  2818. // 遍历所有返回的条目
  2819. res.rows.forEach((row) => {
  2820. const { vars, vals } = row; // 获取每一行的 vars 和 vals
  2821. // 调用 tablefun 函数更新表格
  2822. tablefun1(vars, vals);
  2823. });
  2824. }
  2825. })
  2826. .catch((err) => {
  2827. ElMessage.error(err.returnMsg)
  2828. })
  2829. }
  2830. /**
  2831. * 解析 vals 数据,将 [ ] 解析成数组,其他数据保持原样
  2832. */
  2833. function parseVals(vals) {
  2834. let result = [];
  2835. let temp = "";
  2836. let inArray = false;
  2837. for (let char of vals) {
  2838. if (char === "[") {
  2839. inArray = true;
  2840. temp += char;
  2841. } else if (char === "]") {
  2842. inArray = false;
  2843. temp += char;
  2844. result.push(JSON.parse(temp.trim())); // 确保去除首尾空格后转换
  2845. temp = "";
  2846. } else if (char === " " && !inArray) {
  2847. if (temp.trim() !== "") { // 避免空字符串被加入
  2848. result.push(temp.trim());
  2849. }
  2850. temp = "";
  2851. } else {
  2852. temp += char;
  2853. }
  2854. }
  2855. if (temp.trim() !== "") {
  2856. result.push(temp.trim());
  2857. }
  2858. return result.filter(item => item !== ""); // 过滤掉空字符串
  2859. }
  2860. //曲线监控
  2861. const curveLine = () => {
  2862. const params = {
  2863. transCode: 'MDO0021',
  2864. pid: pid.value,
  2865. type: 1,
  2866. }
  2867. request(params)
  2868. .then((res) => {
  2869. curvedata.value = JSON.stringify(res.rows);
  2870. // console.log(curvedata.value);
  2871. optmonitor1.value.getshuju(curvedata.value);
  2872. // optmonitor1.value.getsockechart();
  2873. // arearef.value.getsockechart(curvedata.value);
  2874. // bargraphref.value.getsockechart(curvedata.value);
  2875. // echartLineref.value.getsockechart(curvedata.value);
  2876. // BarChartref.value.getsockechart(curvedata.value);
  2877. // radarref.value.getsockechart(curvedata.value);
  2878. // scatterref.value.getsockechart(curvedata.value);
  2879. // pieref.value.getsockechart(curvedata.value);
  2880. // paretoref.value.getsockechart(curvedata.value);
  2881. // optmonitor1.value.getecharts();
  2882. })
  2883. .catch((err) => {
  2884. ElMessage.error(err.returnMsg)
  2885. })
  2886. }
  2887. const curveLine2 = () => {
  2888. const params = {
  2889. transCode: 'MDO0021',
  2890. pid: pid.value,
  2891. type: 2,
  2892. }
  2893. request(params)
  2894. .then((res) => {
  2895. if (res.rows && res.rows.length > 0) {
  2896. curvedata.value = JSON.stringify(res.rows);
  2897. // console.log(curvedata.value);
  2898. processMonitor1ref.value.getshuju(curvedata.value);
  2899. }
  2900. })
  2901. .catch((err) => {
  2902. ElMessage.error(err.returnMsg)
  2903. })
  2904. }
  2905. const curveLine3 = () => {
  2906. const params = {
  2907. transCode: 'MDO0021',
  2908. pid: pid.value,
  2909. type: 3,
  2910. }
  2911. request(params)
  2912. .then((res) => {
  2913. // 检查返回的数据是否为空
  2914. if (res.rows && res.rows.length > 0) {
  2915. curvedata.value = JSON.stringify(res.rows);
  2916. // console.log(curvedata.value);
  2917. processMonitor2ref.value.getshuju(curvedata.value);
  2918. }
  2919. })
  2920. .catch((err) => {
  2921. // 错误处理
  2922. ElMessage.error(err.returnMsg);
  2923. })
  2924. }
  2925. const curveLine4 = () => {
  2926. const params = {
  2927. transCode: 'MDO0021',
  2928. pid: pid.value,
  2929. type: 1,
  2930. }
  2931. request(params)
  2932. .then((res) => {
  2933. // curvedata.value = JSON.stringify(res.rows);
  2934. // console.log('数据形式:',curvedata.value);
  2935. // echartLineref.value.getshuju(curvedata.value);
  2936. // scatterref.value.getshuju(curvedata.value);
  2937. if (res.rows && res.rows.length > 0) {
  2938. // 清空数据
  2939. datatotabledata.value = [];
  2940. datatotableheader.value = [];
  2941. // 遍历返回的所有行数据
  2942. res.rows.forEach((row) => {
  2943. const { vars, vals } = row; // 解析 vars 和 vals
  2944. datatotable(vars, vals);
  2945. });
  2946. }
  2947. console.log("表格数据:", datatotabledata.value);
  2948. console.log("表头数据:", datatotableheader.value);
  2949. // emitter.emit('update:datatotableheader', datatotableheader.value);
  2950. // emitter.emit('update:datatotabledata', datatotabledata.value);
  2951. // scatterref.value.getshuju(datatotableheader.value,datatotabledata.value);
  2952. // echartLineref.value.getshuju(datatotableheader.value,datatotabledata.value);
  2953. })
  2954. .catch((err) => {
  2955. ElMessage.error(err.returnMsg)
  2956. })
  2957. }
  2958. const initListSe = () => {
  2959. emitter.emit('update:datatotableheader', datatotableheader.value);
  2960. emitter.emit('update:datatotabledata', datatotabledata.value);
  2961. }
  2962. let datatotableheader = ref([]);
  2963. let datatotabledata = ref([]);
  2964. // 解析数据到表格
  2965. const datatotable = (vars, vals) => {
  2966. console.log("表格更新");
  2967. // 解析列名,vars 以空格分隔
  2968. let headers = vars.split(" ");
  2969. // 解析 vals 数据
  2970. let values = vals.split(" ");
  2971. // 构造表格数据对象
  2972. let rowData = {};
  2973. let newHeaders = [];
  2974. headers.forEach((key, index) => {
  2975. let val = values[index];
  2976. // 处理数组数据,解析为 JSON 或直接填充
  2977. if (val.startsWith("[") && val.endsWith("]")) {
  2978. try {
  2979. let parsedArray = JSON.parse(val); // 解析数组
  2980. // 解析数组数据并拆分为多个列
  2981. parsedArray.forEach((item, subIndex) => {
  2982. let newKey = `${key}_${subIndex + 1}`; // 生成列名:原列名_1, _2, _3...
  2983. rowData[newKey] = item;
  2984. // 只在第一次时添加新列
  2985. if (
  2986. datatotableheader.value.length === 0 ||
  2987. !datatotableheader.value.some((h) => h.prop === newKey)
  2988. ) {
  2989. newHeaders.push({ label: newKey, prop: newKey });
  2990. }
  2991. });
  2992. } catch (e) {
  2993. rowData[key] = val; // 解析失败,保留原始字符串
  2994. }
  2995. } else {
  2996. rowData[key] = val !== undefined ? val : ""; // 处理数据长度不匹配情况
  2997. // 只在第一次时添加原始列
  2998. if (
  2999. datatotableheader.value.length === 0 ||
  3000. !datatotableheader.value.some((h) => h.prop === key)
  3001. ) {
  3002. newHeaders.push({ label: key, prop: key });
  3003. }
  3004. }
  3005. });
  3006. // 更新表头:防止重复添加
  3007. if (datatotableheader.value.length === 0) {
  3008. datatotableheader.value = newHeaders;
  3009. } else {
  3010. newHeaders.forEach((header) => {
  3011. if (!datatotableheader.value.some((h) => h.prop === header.prop)) {
  3012. datatotableheader.value.push(header);
  3013. }
  3014. });
  3015. }
  3016. // 更新表格数据
  3017. datatotabledata.value.push(rowData);
  3018. };
  3019. let listcbval = ref([]);
  3020. let listcbval2 = ref([]);
  3021. // 选择框值更新
  3022. const handleUpdate = (name, value) => {
  3023. if (name === 'listcbval') {
  3024. listcbval.value = value;
  3025. console.log("listcbval:",listcbval.value);
  3026. } else if (name === 'listcbval2') {
  3027. listcbval2.value = value;
  3028. console.log("listcbval2:",listcbval2.value);
  3029. }
  3030. };
  3031. // 列表,散点,折线图选择数据==>曲线绘制
  3032. const selectshujuto = () => {
  3033. console.log("确认:",tabactive.value);
  3034. if(tabactive.value === '散点图'){
  3035. scatterref.value.selectshuju(listcbval.value,listcbval2.value,datatotableheader.value,datatotabledata.value);
  3036. }else if(tabactive.value === '折线图'){
  3037. echartLineref.value.selectshuju(listcbval.value,listcbval2.value,datatotableheader.value,datatotabledata.value);
  3038. }
  3039. }
  3040. //选择颜色改变线的颜色
  3041. const colorpicker = (e) => {
  3042. console.log("color change:",vuefval.value);
  3043. vuefval.value.changeAllEdgesColor(color1.value);
  3044. }
  3045. //选择颜色改变tuceng的颜色
  3046. const colorpickertier = (e) => {
  3047. //vuefval.value.changeAllEdgesColor(color1.value);
  3048. vuefval.value.bgcolorfunc(colortier.value);
  3049. }
  3050. const deviceSelectChange = () => {
  3051. }
  3052. const handleClose = (done) => {
  3053. console.log(111)
  3054. dialog.value.newdialog = false;
  3055. done();
  3056. };
  3057. const targetclick = () => {
  3058. console.log(tableData.value)
  3059. }
  3060. // 模块组合
  3061. const modelgroup=()=>{
  3062. }
  3063. //新增
  3064. const onAddItem = () => {
  3065. let tablevalnum = Number(tableval.value) > 1 ? Number(tableval.value) : 1
  3066. if (activeIndex2.value == 0) {
  3067. for (let i = 0; i < tablevalnum; i++) {
  3068. designtable.value.push({
  3069. name: `x${i + 1}`,
  3070. upper: null,
  3071. lower: null,
  3072. reference: null,
  3073. remark: ''
  3074. })
  3075. }
  3076. } else if (activeIndex2.value == 1) {
  3077. for (let i = 0; i < tablevalnum; i++) {
  3078. tableData.value.push({
  3079. name: `g${i + 1}`,
  3080. con: -1,
  3081. reference: null,
  3082. upper: 0,
  3083. lower: 0,
  3084. })
  3085. }
  3086. } else if (activeIndex2.value == 2) {
  3087. for (let i = 0; i < tablevalnum; i++) {
  3088. eloptimize.value.push({
  3089. name: `c${i + 1}`,
  3090. optdir: '1',
  3091. weight: 0,
  3092. scaling: 0,
  3093. factor: 0,
  3094. reference: null,
  3095. remark: '',
  3096. })
  3097. }
  3098. }
  3099. }
  3100. const xxclick = (index) => {
  3101. activeIndex.value = index
  3102. if (activeIndex.value == 0) {
  3103. } else if (activeIndex.value == 1) {
  3104. getissue();
  3105. }
  3106. }
  3107. //底部优化问题
  3108. const issueclick = (index) => {
  3109. activeIndex2.value = index;
  3110. if (activeIndex2.value == 0) {
  3111. getissue();
  3112. } else if (activeIndex2.value == 1) {
  3113. getyueshu();
  3114. } else if (activeIndex2.value == 2) {
  3115. getmub();
  3116. }
  3117. }
  3118. //设计变量查询
  3119. const getissue = () => {
  3120. //let childernarr=[];
  3121. const params = {
  3122. transCode: 'MDO0022',
  3123. pid: pid.value,
  3124. }
  3125. request(params)
  3126. .then((res) => {
  3127. if (res.rows.length === 0) {
  3128. } else {
  3129. let item1 = {
  3130. id: "1-1-" + 1,
  3131. label: '设计变量',
  3132. img: q2,
  3133. children: []
  3134. }
  3135. let arr = Sidebarref.value.datatree[0].children[0].children;
  3136. let result = arr.find(element => element.id === item1.id);
  3137. console.log(result);
  3138. if (!result) {
  3139. Sidebarref.value.datatree[0].children[0].children.push(item1);
  3140. }
  3141. let childernarr=Sidebarref.value.datatree[0].children[0].children
  3142. Sidebarref.value.datatree[0].children[0].children.forEach((item,index)=>{
  3143. if(item.label=='设计变量'){
  3144. Sidebarref.value.datatree[0].children[0].children[index].children=[];
  3145. }
  3146. })
  3147. res.rows = res.rows.map((item, index) => {
  3148. item.lower = item.lower ?? 'none'
  3149. item.upper = item.upper ?? 'none'
  3150. item.reference = item.reference ?? 'none'
  3151. item.name = item.name ?? 'none'
  3152. item.remark = item.remark ?? 'none'
  3153. treeitem.value = {
  3154. id: "1-1-1-" + index,
  3155. label: item.name,
  3156. img: f21,
  3157. }
  3158. // console.log(Sidebarref.value.datatree[0].children[0].children[0].children)
  3159. childernarr.forEach((item,index)=>{
  3160. if(item.label=='设计变量'){
  3161. let addnode = Sidebarref.value.datatree[0].children[0].children[index].children.push(treeitem.value);
  3162. }
  3163. })
  3164. return item;
  3165. })
  3166. designtable.value = res.rows;
  3167. }
  3168. })
  3169. .catch((err) => {
  3170. ElMessage.error(err.returnMsg)
  3171. })
  3172. // }
  3173. // })
  3174. }
  3175. //约束条件查询
  3176. const getyueshu = () => {
  3177. const params = {
  3178. transCode: 'MDO0023',
  3179. pid: pid.value,
  3180. }
  3181. request(params)
  3182. .then((res) => {
  3183. if (res.rows.length === 0) {
  3184. } else {
  3185. let item2 = {
  3186. id: "1-2-" + 2,
  3187. label: '约束条件',
  3188. img: f22,
  3189. children: []
  3190. }
  3191. let arr = Sidebarref.value.datatree[0].children[0].children;
  3192. let result = arr.find(element => element.id === item2.id);
  3193. if (!result) {
  3194. Sidebarref.value.datatree[0].children[0].children.push(item2);
  3195. }
  3196. Sidebarref.value.datatree[0].children[0].children.forEach((item, index) => {
  3197. if (item.label == '约束条件') {
  3198. Sidebarref.value.datatree[0].children[0].children[index].children = [];
  3199. }
  3200. });
  3201. let childernarr = Sidebarref.value.datatree[0].children[0].children;
  3202. res.rows = res.rows.map((item, index) => {
  3203. // 确保转换为数字
  3204. item.con = item.con ?? 'none';
  3205. item.reference = item.reference ?? 'none';
  3206. item.upper =item.upper ?? 'none';
  3207. item.lower = item.lower ?? 'none';
  3208. console.log('item:', item);
  3209. treeitem2.value = {
  3210. id: "1-2-2-" + index,
  3211. label: item.name,
  3212. img: f21,
  3213. }
  3214. childernarr.forEach((item, index) => {
  3215. if (item.label == '约束条件') {
  3216. let addnode = Sidebarref.value.datatree[0].children[0].children[index].children.push(treeitem2.value);
  3217. }
  3218. });
  3219. return item;
  3220. });
  3221. tableData.value = res.rows; // 更新表格数据
  3222. }
  3223. })
  3224. .catch((err) => {
  3225. ElMessage.error(err.returnMsg);
  3226. })
  3227. }
  3228. //目标函数查询
  3229. const getmub = () => {
  3230. const params = {
  3231. transCode: 'MDO0024',
  3232. pid: pid.value,
  3233. }
  3234. request(params)
  3235. .then((res) => {
  3236. if (res.rows.length === 0) {
  3237. } else {
  3238. let item2 = {
  3239. id: "1-3-" + 3,
  3240. label: '目标函数',
  3241. img: f41,
  3242. children: []
  3243. }
  3244. let arr = Sidebarref.value.datatree[0].children[0].children;
  3245. let result = arr.find(element => element.id === item2.id);
  3246. if (!result) {
  3247. Sidebarref.value.datatree[0].children[0].children.push(item2);
  3248. }
  3249. Sidebarref.value.datatree[0].children[0].children.forEach((item,index)=>{
  3250. if(item.label=='目标函数'){
  3251. Sidebarref.value.datatree[0].children[0].children[index].children=[];
  3252. }
  3253. })
  3254. let childernarr=Sidebarref.value.datatree[0].children[0].children
  3255. res.rows = res.rows.map((item, index) => {
  3256. item.optdir = item.optdir ?? 'none';
  3257. item.weight = item.weight ?? 'none';
  3258. item.scaling = item.scaling ?? 'none';
  3259. item.factor = item.factor ?? 'none';
  3260. item.reference = item.reference ?? 'none';
  3261. item.remark = item.remark ?? 'none';
  3262. item.name = item.name ?? 'none';
  3263. treeitem3.value = {
  3264. id: "1-3-3-" + index,
  3265. label: item.name,
  3266. img: f21,
  3267. }
  3268. childernarr.forEach((item,index)=>{
  3269. if(item.label=='目标函数'){
  3270. let addnode = Sidebarref.value.datatree[0].children[0].children[index].children.push(treeitem3.value);
  3271. }
  3272. })
  3273. // console.log(11111)
  3274. // let addnode = Sidebarref.value.datatree[0].children[0].children[3].children.push(treeitem3.value);
  3275. return item;
  3276. })
  3277. eloptimize.value = res.rows;
  3278. }
  3279. })
  3280. .catch((err) => {
  3281. ElMessage.error(err.returnMsg)
  3282. })
  3283. }
  3284. //对象数组转化字符串
  3285. const getarr = (name, arrays) => {
  3286. console.log(arrays)
  3287. for (let i = 0; i < arrays.length; i++) {
  3288. let arr = [];
  3289. let att = [];
  3290. for (const key in arrays[i]) {
  3291. if (arrays[i].hasOwnProperty(key)) {
  3292. arr.push(arrays[i][key]);
  3293. }
  3294. }
  3295. for (let j = 0; j < arr.length; j++) {
  3296. if (typeof arr[j] === 'string' && arr[j] == "") {
  3297. console.log(11111)
  3298. arr[j] = " ";
  3299. }
  3300. }
  3301. if (arrays[i].hasOwnProperty('pid') == true) {
  3302. att = arr.slice(1, -1);
  3303. } else {
  3304. att = arr;
  3305. }
  3306. const valuesWithSemiColons = att.join(',');
  3307. name += valuesWithSemiColons + ';';
  3308. }
  3309. console.log('conlist',name)
  3310. return name;
  3311. }
  3312. const convertToStringArray = (result, Data) => {
  3313. console.log('Data:', Data);
  3314. result = Data.map(row => {
  3315. const vid = row.vid || ' ';
  3316. const name = row.name || ' ';
  3317. const upper = row.upper ?? ' ';
  3318. const lower = row.lower ?? ' ';
  3319. const reference = row.reference ?? ' ';
  3320. const remark = row.remark || ' ';
  3321. // 将字段连接为一个以逗号分隔的字符串
  3322. return `${vid},${name},${upper},${lower},${reference},${remark}`;
  3323. }).join(';'); // 每行之间用分号分隔
  3324. return result;
  3325. }
  3326. const convertToStringArray1 = (result, Data) => {
  3327. console.log('Data:', Data);
  3328. result = Data.map(row => {
  3329. const conid = row.conid || ' ';
  3330. const name = row.name || ' ';
  3331. const upper = row.upper ?? ' ';
  3332. const lower = row.lower ?? ' ';
  3333. const reference = row.reference ?? ' ';
  3334. // 将字段连接为一个以逗号分隔的字符串
  3335. return `${conid},${name},${reference},${upper},${lower}`;
  3336. }).join(';'); // 每行之间用分号分隔
  3337. return result;
  3338. }
  3339. const convertToStringArray2 = (result, Data) => {
  3340. console.log('Data:', Data);
  3341. result = Data.map(row => {
  3342. const fid = row.fid || ' ';
  3343. const name = row.name || ' ';
  3344. const optdir = row.optdir ?? ' ';
  3345. const weight = row.weight ?? ' ';
  3346. const reference = row.reference ?? ' ';
  3347. const remark = row.remark || ' ';
  3348. // 将字段连接为一个以逗号分隔的字符串
  3349. return `${fid},${name},${optdir},${weight},${reference},${remark}`;
  3350. }).join(';'); // 每行之间用分号分隔
  3351. return result;
  3352. }
  3353. //保存优化问题
  3354. const onokItem = () => {
  3355. console.log(activeIndex2.value);
  3356. if (activeIndex2.value == 0) {
  3357. svarlist.value = '';
  3358. console.log("designtable:",designtable.value)
  3359. svarlist.value = convertToStringArray(svarlist.value, designtable.value)
  3360. devise();
  3361. } else if (activeIndex2.value == 1) {
  3362. conlist.value = '';
  3363. console.log("tabledata:",tableData.value)
  3364. conlist.value = convertToStringArray1(conlist.value, tableData.value)
  3365. restrain();
  3366. } else if (activeIndex2.value == 2) {
  3367. funlist.value = '';
  3368. console.log("eloptimize:",eloptimize.value)
  3369. funlist.value = convertToStringArray2(funlist.value, eloptimize.value)
  3370. funlistaa();
  3371. }
  3372. }
  3373. //设计变量的添加
  3374. const devise = () => {
  3375. const params = {
  3376. transCode: 'MDO0054',
  3377. pid: pid.value,
  3378. vartr: svarlist.value
  3379. }
  3380. request(params)
  3381. .then((res) => {
  3382. ElMessage({
  3383. message: '设计变量保存成功',
  3384. type: 'success',
  3385. })
  3386. getissue();
  3387. })
  3388. .catch((err) => {
  3389. ElMessage.error('设计变量保存失败')
  3390. })
  3391. }
  3392. //约束的添加restrain
  3393. const restrain = () => {
  3394. const params = {
  3395. transCode: 'MDO0055',
  3396. pid: pid.value,
  3397. vartr: conlist.value
  3398. }
  3399. request(params)
  3400. .then((res) => {
  3401. ElMessage({
  3402. message: '约束条件保存成功',
  3403. type: 'success',
  3404. })
  3405. getyueshu();
  3406. })
  3407. .catch((err) => {
  3408. ElMessage.error('约束条件保存失败')
  3409. })
  3410. }
  3411. //优化目标接口
  3412. const funlistaa = () => {
  3413. const params = {
  3414. transCode: 'MDO0056',
  3415. pid: pid.value,
  3416. vartr: funlist.value
  3417. }
  3418. request(params)
  3419. .then((res) => {
  3420. ElMessage({
  3421. message: '优化目标保存成功',
  3422. type: 'success',
  3423. })
  3424. getmub();
  3425. })
  3426. .catch((err) => {
  3427. ElMessage.error('优化目标保存失败')
  3428. })
  3429. }
  3430. //初始化
  3431. const initialize = () => {
  3432. const params = {
  3433. transCode: 'MDO0011',
  3434. pid: pid.value,
  3435. }
  3436. request(params)
  3437. .then((res) => {
  3438. // ElMessage({
  3439. // message: res.returnMsg,
  3440. // type: 'success',
  3441. // })
  3442. importget();
  3443. })
  3444. .catch((err) => {
  3445. ElMessage.error(err.returnMsg)
  3446. })
  3447. }
  3448. // new输入参数
  3449. const changecheck = (val,row) => {
  3450. console.log(val);
  3451. console.log(row);
  3452. }
  3453. //输入参数查询
  3454. const importget = () => {
  3455. const params = {
  3456. transCode: 'MDO0012',
  3457. pid: pid.value,
  3458. }
  3459. request(params)
  3460. .then((res) => {
  3461. srtable.value = res.rows;
  3462. })
  3463. .catch((err) => {
  3464. ElMessage.error(err.returnMsg)
  3465. })
  3466. }
  3467. //输入保存
  3468. const susave = (index, row) => {
  3469. console.log(row);
  3470. const params = {
  3471. transCode: 'MDO0013',
  3472. pid: pid.value,
  3473. inid: row.inid,
  3474. vid: row.vid,
  3475. enable: row.enable,
  3476. name: row.name,
  3477. v1: row.v1,
  3478. v2: row.v2
  3479. }
  3480. request(params)
  3481. .then((res) => {
  3482. ElMessage({
  3483. message: '保存成功',
  3484. type: 'success',
  3485. })
  3486. })
  3487. .catch((err) => {
  3488. ElMessage.error(err.returnMsg)
  3489. })
  3490. }
  3491. // 输入的删除
  3492. const sudelete = (index, row) => {
  3493. if (row.hasOwnProperty('outid') == false) {
  3494. srtable.value.splice(index, 1)
  3495. } else {
  3496. const params = {
  3497. transCode: 'MDO0014',
  3498. inid: row.inid,
  3499. }
  3500. request(params)
  3501. .then((res) => {
  3502. importget();
  3503. ElMessage({
  3504. message: " 删除成功",
  3505. type: 'success',
  3506. })
  3507. })
  3508. .catch((err) => {
  3509. ElMessage.error(err.returnMsg)
  3510. })
  3511. }
  3512. }
  3513. //输入输出的新建
  3514. const newxfiol = () => {
  3515. if (activeIndex3.value == 0) {
  3516. srtable.value.push({
  3517. name: "",
  3518. v1: '0',
  3519. v2: '0',
  3520. enable: '0'
  3521. })
  3522. } else if (activeIndex3.value == 2) {
  3523. sctable.value.push({
  3524. name: "",
  3525. v1: '',
  3526. v2: '',
  3527. enable: '0'
  3528. })
  3529. }
  3530. }
  3531. // 点击掉查询接口
  3532. const dianjia = (index) => {
  3533. activeIndex3.value = index;
  3534. if (activeIndex3.value == 0) {
  3535. importget()
  3536. } else if (activeIndex3.value == 2) {
  3537. console.log(11111)
  3538. exportget();
  3539. }
  3540. }
  3541. //输出参数查询
  3542. const exportget = () => {
  3543. const params = {
  3544. transCode: 'MDO0015',
  3545. pid: pid.value,
  3546. }
  3547. request(params)
  3548. .then((res) => {
  3549. sctable.value = res.rows;
  3550. })
  3551. .catch((err) => {
  3552. ElMessage.error(err.returnMsg)
  3553. })
  3554. }
  3555. // 输出保存
  3556. const scsave = (index, row) => {
  3557. if (row.hasOwnProperty('fid') == true) {
  3558. fid.value = row.fid;
  3559. }
  3560. if (row.hasOwnProperty('conid') == true) {
  3561. conid.value = row.conid;
  3562. }
  3563. const params = {
  3564. transCode: 'MDO0016',
  3565. pid: pid.value,
  3566. outid: row.outid,
  3567. fid: fid.value,
  3568. conid: conid.value,
  3569. enable: row.enable,
  3570. name: row.name,
  3571. v1: row.v1,
  3572. v2: row.v2
  3573. }
  3574. request(params)
  3575. .then((res) => {
  3576. ElMessage({
  3577. message: '保存成功',
  3578. type: 'success',
  3579. })
  3580. exportget();
  3581. })
  3582. .catch((err) => {
  3583. ElMessage.error(err.returnMsg)
  3584. })
  3585. }
  3586. //输出删除scdelete
  3587. const scdelete = (index, row) => {
  3588. console.log(row);
  3589. if (row.hasOwnProperty('outid') == false) {
  3590. sctable.value.splice(index, 1)
  3591. } else {
  3592. const params = {
  3593. transCode: 'MDO0017',
  3594. outid: row.outid,
  3595. }
  3596. request(params)
  3597. .then((res) => {
  3598. exportget();
  3599. ElMessage({
  3600. message: " 删除成功",
  3601. type: 'success',
  3602. })
  3603. })
  3604. .catch((err) => {
  3605. ElMessage.error(err.returnMsg)
  3606. })
  3607. }
  3608. }
  3609. // 用于实时更新表格数据
  3610. function tablefun(vars, vals) {
  3611. console.log('表格更新');
  3612. // 解析列名,vars 以空格分隔
  3613. let headers = vars.split(" ");
  3614. // 更新表头
  3615. tableHeaders.value = headers.map(item => ({ label: item, prop: item }));
  3616. // 构造表格数据对象
  3617. let rowData = {};
  3618. headers.forEach((key, index) => {
  3619. rowData[key] = vals[index] !== undefined ? vals[index] : ""; // 处理数据长度不匹配情况
  3620. });
  3621. // 更新表格数据
  3622. tableDatalieb.value.push(rowData);
  3623. }
  3624. // 用于更新表格数据
  3625. const tablefun1 = (vars, vals) => {
  3626. console.log('表格更新');
  3627. // 解析列名,vars 以空格分隔
  3628. let headers = vars.split(" ");
  3629. // 更新表头
  3630. tableHeaders.value = headers.map(item => ({ label: item, prop: item }));
  3631. // 解析 vals 为数组(假设 vals 是一个字符串)
  3632. let values = vals.split(" ");
  3633. // 构造表格数据对象
  3634. let rowData = {};
  3635. headers.forEach((key, index) => {
  3636. rowData[key] = values[index] !== undefined ? values[index] : ""; // 处理数据长度不匹配情况
  3637. });
  3638. // 更新表格数据
  3639. tableDatalieb.value.push(rowData);
  3640. };
  3641. //获取日志
  3642. const logsget = () => {
  3643. const params = {
  3644. transCode: 'MDO0025',
  3645. pid: pid.value,
  3646. }
  3647. request(params)
  3648. .then((res) => {
  3649. // 去除空行
  3650. console.log('日志接口赋值')
  3651. logs.value = res.logs.split('\n').filter(line => line.trim() !== '').join('\n');
  3652. const results = extractBracesContent(logs.value);
  3653. for (let i = 0; i < results.length; i++) {
  3654. arrobj.value.push(results[i]);
  3655. let vals = (results[i].vals).split(" ");
  3656. tablefun(vals);
  3657. let echarr = [];
  3658. echarr.push(results[i])
  3659. optmonitor1.value.getsockechart(echarr);
  3660. processMonitor1ref.value.getsockechart(echarr);
  3661. processMonitor2ref.value.getsockechart(echarr);
  3662. // arearef.value.getsockechart(echarr);
  3663. // bargraphref.value.getsockechart(echarr);
  3664. // echartLineref.value.getsockechart(echarr);
  3665. // BarChartref.value.getsockechart(echarr);
  3666. // radarref.value.getsockechart(echarr);
  3667. // scatterref.value.getsockechart(echarr);
  3668. }
  3669. })
  3670. .catch((err) => {
  3671. ElMessage.error(err.returnMsg)
  3672. })
  3673. }
  3674. // 字符串截取
  3675. function extractBracesContent(str) {
  3676. const objectRegex = /\{[^}]+\}/g; // 匹配大括号对象
  3677. const matches = str.match(objectRegex);
  3678. if (!matches) return [];
  3679. return matches.map(match => {
  3680. try {
  3681. return JSON.parse(match);
  3682. } catch (e) {
  3683. console.error('Failed to parse object:', match);
  3684. return null;
  3685. }
  3686. }).filter(Boolean); // 过滤掉解析失败的对象
  3687. }
  3688. function convertToPercentage(number) {
  3689. return (number * 100);
  3690. }
  3691. //websockct的连接
  3692. function initWebSocket() {
  3693. //初始化weosocket
  3694. // const wsuri = "ws://192.168.0.43:8087//websocket?projectId="+this.pid; ws://192.168.0.131/diswebsocket?projectId=5
  3695. // const wsurl = "ws://192.168.108:8188//websocket?projectId=" + pid.value;
  3696. const wsurl = import.meta.env.VITE_WEBSOCKET_URL + pid.value;
  3697. // const wsurl =
  3698. // "ws://" +
  3699. // process.env.VUE_APP_BASE_websokt +
  3700. // "/diswebsocket?projectId=" +'5'
  3701. // aid.value;
  3702. websock = new WebSocket(wsurl);
  3703. websock.onopen = websocketonopen;
  3704. websock.onmessage = websocketonmessage;
  3705. websock.onerror = websocketonerror;
  3706. websock.onclose = websocketclose;
  3707. }
  3708. // Websoket连接成功事件
  3709. const websocketonopen = (res) => {
  3710. console.log("WebSocket连接成功", res);
  3711. console.log()
  3712. start();
  3713. };
  3714. // Websoket接收消息事件
  3715. const websocketonmessage = (res) => {
  3716. // console.log('websocket接受消息:',res.data)
  3717. arrobj.value = [];
  3718. if (res.data.indexOf('{') !== -1) {
  3719. progressshow.value = true;
  3720. console.log('websocket接受消息:',res.data)
  3721. // 解析 WebSocket 接收到的消息数据
  3722. let parsedData = JSON.parse(res.data);
  3723. let step = Number(parsedData.step);
  3724. if(parsedData.type === 1){
  3725. percentage.value = Math.round((step / 30) * 100);
  3726. }
  3727. console.log("进度:", percentage.value);
  3728. echartdata.value = res.data;
  3729. arrobj.value.push(parsedData);
  3730. console.log('tabactive:',tabactive.value)
  3731. if(jiankong.value && parsedData.type === 1){
  3732. console.log('列表监控')
  3733. tablefun1(parsedData.vars, parsedData.vals); // 传递 vars 和 vals 更新表格
  3734. }else if(echartshow.value&&parsedData.type === 1){
  3735. optmonitor1.value.getsockechart(arrobj.value);
  3736. }else if(echartshow2.value&&parsedData.type === 2){
  3737. processMonitor1ref.value.getsockechart(arrobj.value);
  3738. }else if(echartshow2.value&&parsedData.type === 3){
  3739. processMonitor2ref.value.getsockechart(arrobj.value);
  3740. }
  3741. // optmonitor1.value.getsockechart(arrobj.value);
  3742. // processMonitor1ref.getsockechart(arrobj.value);
  3743. // processMonitor2ref.getsockechart(arrobj.value);
  3744. // arearef.value.getsockechart(arrobj.value);
  3745. // bargraphref.value.getsockechart(arrobj.value);
  3746. // echartLineref.value.getsockechart(arrobj.value);
  3747. // BarChartref.value.getsockechart(arrobj.value);
  3748. // radarref.value.getsockechart(arrobj.value);
  3749. // scatterref.value.getsockechart(arrobj.value);
  3750. // pieref.value.getsockechart(arrobj.value);
  3751. // paretoref.value.getsockechart(arrobj.value);
  3752. } else {
  3753. if (res.data.indexOf('——成功') !== -1) {
  3754. const timer = setTimeout(function () {
  3755. progressshow.value = false;
  3756. console.log('关闭定时器')
  3757. }, 10000)
  3758. // console.log(22222)
  3759. // clearTimeout(timer);
  3760. }
  3761. if (res.data.indexOf('msg=heartChec') == -1) {
  3762. // 去除空行
  3763. const cleanedLog = res.data.split('\n').filter(line => line.trim() !== '').join('\n');
  3764. logs.value = logs.value + '\n' + cleanedLog;
  3765. let textarea = document.getElementById("textarea_id");
  3766. textarea.scrollTop = textarea.scrollHeight;
  3767. }
  3768. }
  3769. reset();
  3770. };
  3771. // Websoket连接错误事件
  3772. const websocketonerror = (res) => {
  3773. console.log("连接错误", res);
  3774. websock.close();
  3775. reconnect();
  3776. };
  3777. // Websoket断开事件
  3778. const websocketclose = (res) => {
  3779. console.log("断开连接", res);
  3780. };
  3781. // 创建 websocket 的实例
  3782. // 心跳包
  3783. const reconnect = () => {
  3784. if (times.value.lockReconnect) return;
  3785. times.value.lockReconnect = true;
  3786. //没连接上会一直重连,设置延迟避免请求过多
  3787. times.value.timeoutnum && clearTimeout(times.value.timeoutnum);
  3788. times.value.timeoutnum = setTimeout(function () {
  3789. //新连接
  3790. initWebSocket();
  3791. times.value.lockReconnect = false;
  3792. }, 10000);
  3793. }
  3794. const reset = () => {
  3795. //重置心跳
  3796. clearTimeout(times.value.timeoutObj);
  3797. clearTimeout(times.value.serverTimeoutObj);
  3798. start();
  3799. }
  3800. const start = () => {
  3801. //开启心跳
  3802. times.value.timeoutObj && clearTimeout(times.value.timeoutObj);
  3803. times.value.serverTimeoutObj && clearTimeout(times.value.serverTimeoutObj);
  3804. times.value.timeoutObj = setTimeout(function () {
  3805. //这里发送一个心跳,后端收到后,返回一个心跳消息
  3806. if (websock.readyState == 1) {
  3807. //如果连接正常
  3808. websock.send("heartCheck");
  3809. } else {
  3810. //否则重连
  3811. reconnect();
  3812. }
  3813. times.value.serverTimeoutObj = setTimeout(function () {
  3814. // 超时关闭
  3815. websock.close(); //如果onclose会执行reconnect,我们执行ws.close()就行了.如果直接执行reconnect 会触发onclose导致重连两次
  3816. }, times.value.timeout);
  3817. }, times.value.timeout);
  3818. }
  3819. // 日志框
  3820. // 日志的文本框
  3821. const footerShows = (evt) => {
  3822. if (evt == "claer") {
  3823. logs.value = "";
  3824. } else {
  3825. footerShow.value = !footerShow.value;
  3826. }
  3827. }
  3828. // watch(() =>echartdata.value, (newValue, oldValue) => {
  3829. // // 这里处理 echartData 变化的逻辑
  3830. // console.log('echartData changed:', newValue);
  3831. // // console.log(optmonitor1.value);
  3832. // });
  3833. // 选项卡
  3834. const selectTab=(index)=>{
  3835. currentTab.value = index;
  3836. }
  3837. const adfhandleClick=(tab,event)=>{
  3838. console.log('表单切换',tab.props.label);
  3839. activeadf.value=tab.props.label;
  3840. if(tab.props.name === '进化优化器'){
  3841. nextTick(() => {
  3842. // 确保 ref 已经初始化
  3843. if (Joptimizeref.value) {
  3844. // 调用 Joptimize 的 getoptimize 方法
  3845. Joptimizeref.value.getoptimize(pid.value,youhuaqiwid.value);
  3846. }
  3847. });
  3848. }else if(tab.props.name === '代理优化器'){
  3849. nextTick(() => {
  3850. // 确保 ref 已经初始化
  3851. if (Doptimizeref.value) {
  3852. Doptimizeref.value.getDoptimize(pid.value,youhuaqiwid.value);
  3853. }
  3854. });
  3855. }else if(tab.props.name === '梯度优化器'){
  3856. nextTick(() => {
  3857. // 确保 ref 已经初始化
  3858. if (Toptimizeref.value) {
  3859. Toptimizeref.value.getToptimize(pid.value,youhuaqiwid.value);
  3860. }
  3861. });
  3862. }
  3863. }
  3864. const getaddsave = (nowid) => {
  3865. if (Joptimizeref.value && typeof Joptimizeref.value.getaddsave === 'function') {
  3866. if(nowid){
  3867. Joptimizeref.value.getaddsave(pid.value,nowid);
  3868. }else{
  3869. Joptimizeref.value.getaddsave(pid.value);
  3870. }
  3871. }
  3872. }
  3873. const getDaddsave = (nowid) => {
  3874. if (Doptimizeref.value && typeof Doptimizeref.value.getaddDsave === 'function') {
  3875. if(nowid){
  3876. Doptimizeref.value.getaddDsave(pid.value,nowid);
  3877. }else{
  3878. Doptimizeref.value.getaddDsave(pid.value);
  3879. }
  3880. }
  3881. }
  3882. const getTaddsave = (nowid) => {
  3883. if (Toptimizeref.value && typeof Toptimizeref.value.getaddTsave === 'function') {
  3884. if(nowid){
  3885. Toptimizeref.value.getaddTsave(pid.value,nowid);
  3886. }else{
  3887. Toptimizeref.value.getaddTsave(pid.value);
  3888. }
  3889. }
  3890. }
  3891. const getSave = (ref) => {
  3892. if (ref == '进化优化器'){
  3893. getaddsave(youhuaqiwid.value);
  3894. }else if(ref == '代理优化器'){
  3895. getDaddsave(youhuaqiwid.value);
  3896. }else if(ref == '梯度优化器'){
  3897. getTaddsave(youhuaqiwid.value);
  3898. }
  3899. }
  3900. // 参数化
  3901. const adfhandleClick2=(tab,event)=>{
  3902. console.log('表单切换',tab.props.label);
  3903. activeadf.value=tab.props.label;
  3904. if(tab.props.name === 'CST'){
  3905. nextTick(() => {
  3906. // 确保 ref 已经初始化
  3907. if (Cstref.value) {
  3908. Cstref.value.getcst(pid.value,canshuhuawid.value);
  3909. }
  3910. });
  3911. }else if(tab.props.name === 'FFD'){
  3912. nextTick(() => {
  3913. // 确保 ref 已经初始化
  3914. if (Ffdref.value) {
  3915. Ffdref.value.getffds(pid.value,canshuhuawid.value);
  3916. }
  3917. });
  3918. }
  3919. }
  3920. // 单独cst保存
  3921. const cstok=(nowid)=>{
  3922. // cstnum.value='';
  3923. if(Cstref.value){
  3924. if(nowid){
  3925. Cstref.value.getcstsave(pid.value,nowid);
  3926. }else{
  3927. Cstref.value.getcstsave(pid.value);
  3928. }
  3929. }
  3930. dialog.value.CSTt = false;
  3931. }
  3932. // 单独ffd保存
  3933. const ffdok=(nowid)=>{
  3934. if(Ffdref.value){
  3935. if(nowid){
  3936. Ffdref.value.getffdsave(pid.value,nowid);
  3937. }else{
  3938. Ffdref.value.getffdsave(pid.value);
  3939. }
  3940. }
  3941. dialog.value.ffdt = false;
  3942. }
  3943. // cstffd保存
  3944. const getCstFfdsave = (activeadf) => {
  3945. if (activeadf == 'CST') {
  3946. cstok(canshuhuawid.value);
  3947. } else if (activeadf == 'FFD') {
  3948. ffdok(canshuhuawid.value);
  3949. }
  3950. }
  3951. const adfhandleClick3=(tab,event)=>{
  3952. console.log('表单切换',tab.props.label);
  3953. activeadf.value=tab.props.label;
  3954. if(tab.props.name === 'Xfoil'){
  3955. nextTick(() => {
  3956. // 确保 ref 已经初始化
  3957. if (Xfoilref.value) {
  3958. Xfoilref.value.getxfoil(pid.value,qidongyouhuawid.value);
  3959. }
  3960. });
  3961. }else if(tab.props.name === 'ADflow'){
  3962. nextTick(() => {
  3963. // 确保 ref 已经初始化
  3964. if (ADflowref.value) {
  3965. ADflowref.value.getadflow(pid.value,qidongyouhuawid.value);
  3966. }
  3967. });
  3968. }
  3969. }
  3970. // xfoil保存
  3971. const xfoilok=(nowid)=>{
  3972. if(Xfoilref.value){
  3973. if(nowid){
  3974. Xfoilref.value.getxfoilsave(pid.value,nowid);
  3975. }else{
  3976. Xfoilref.value.getxfoilsave(pid.value);
  3977. }
  3978. }
  3979. }
  3980. // adflow保存
  3981. const adflowok=(nowid)=>{
  3982. if(ADflowref.value){
  3983. if(nowid){
  3984. ADflowref.value.getadflowsave(pid.value,nowid);
  3985. }else{
  3986. ADflowref.value.getadflowsave(pid.value);
  3987. }
  3988. }
  3989. }
  3990. // xfoiladflow保存
  3991. const getXfoilAdflowsave = (activeadf) => {
  3992. if (activeadf == 'Xfoil') {
  3993. xfoilok(qidongyouhuawid.value);
  3994. } else if (activeadf == 'ADflow') {
  3995. adflowok(qidongyouhuawid.value);
  3996. }
  3997. }
  3998. // 云图打开二级弹窗
  3999. let seconddialogshow = ref(false)
  4000. let activesd = ref ({
  4001. fileselect:false,
  4002. domain:false,
  4003. cloud:false,
  4004. colorchart:false,
  4005. isoline:false
  4006. })
  4007. let cloudsedtitle = ref('')
  4008. const openSeconddialog = (name) => {
  4009. // 设置 activesd 中的值来控制不同内容的显示
  4010. activesd.value.fileselect = false;
  4011. activesd.value.domain = false;
  4012. activesd.value.cloud = false;
  4013. activesd.value.colorchart = false;
  4014. activesd.value.isoline = false;
  4015. switch (name) {
  4016. case '文件选择':
  4017. activesd.value.fileselect = true;
  4018. cloudsedtitle.value = "文件选择";
  4019. break;
  4020. case '域':
  4021. activesd.value.domain = true;
  4022. cloudsedtitle.value = "域";
  4023. break;
  4024. case '云图':
  4025. activesd.value.cloud = true;
  4026. cloudsedtitle.value = "云图";
  4027. break;
  4028. case '色卡':
  4029. activesd.value.colorchart = true;
  4030. cloudsedtitle.value = "色卡";
  4031. break;
  4032. case '等值线':
  4033. activesd.value.isoline = true;
  4034. cloudsedtitle.value = "等值线";
  4035. break;
  4036. default:
  4037. break;
  4038. }
  4039. seconddialogshow.value = true
  4040. };
  4041. const lbjkheaderCellClassName = ({ columnIndex }) => {
  4042. if( columnIndex === 0 ) return '';
  4043. let dynamicColumnIndex = columnIndex - 1;
  4044. let totalColumns = tableHeaders.value.length;
  4045. let partsize = Math.ceil( totalColumns/3 );
  4046. if( dynamicColumnIndex < partsize ) {
  4047. return 'header-first';
  4048. }else if( dynamicColumnIndex < partsize*2 ) {
  4049. return 'header-second';
  4050. }else {
  4051. return 'header-third';
  4052. }
  4053. }
  4054. </script>
  4055. <style lang="scss" scoped>
  4056. .conter_flex {
  4057. display: flex;
  4058. .ech {
  4059. flex: 1;
  4060. }
  4061. }
  4062. //有子节点 且未展开
  4063. .left_main_content :deep(.el-icon svg) {
  4064. display: block;
  4065. }
  4066. .footerTitle {
  4067. display: flex;
  4068. justify-content: space-between;
  4069. padding: 5px 0px;
  4070. font-size: 20px;
  4071. height: 32px !important;
  4072. z-index: 99;;
  4073. // border-radius: 5px 5px 0px 0px;
  4074. // overflow: hidden;
  4075. border-top: 1px solid #B3B3B3;
  4076. border-bottom: 1px solid #B3B3B3;
  4077. }
  4078. .footerTitle .el-image{
  4079. width:24px;
  4080. }
  4081. .footerTitle div {
  4082. display: flex;
  4083. // justify-content:center ;
  4084. align-items: center;
  4085. font-size: 14px;
  4086. }
  4087. .kongzhit {
  4088. position: absolute;
  4089. bottom: 0;
  4090. width: 100%;
  4091. }
  4092. .footerTitle p {
  4093. margin: 0;
  4094. }
  4095. .footerTitle .span {
  4096. width: 130px;
  4097. height: 32px;
  4098. line-height: 40px;
  4099. padding: 0 10px;
  4100. box-sizing: border-box;
  4101. cursor: default;
  4102. position: relative;
  4103. font-size: 14px;
  4104. color: #333333;
  4105. font-family: 'Microsoft YaHei';
  4106. }
  4107. .footerTitle .span .el-image {
  4108. margin-left: 10px;
  4109. }
  4110. .footerTitle .span span{
  4111. padding-left:10px;
  4112. }
  4113. .footerText .el-textarea__inner {
  4114. width: 100%;
  4115. height: 178px !important;
  4116. border: 0;
  4117. font-size: 12px;
  4118. color: #333;
  4119. padding: 2px;
  4120. box-shadow:none;
  4121. }
  4122. .custom-button{
  4123. color: #333333;
  4124. background-color: #DCEAFF;
  4125. border: 1px solid #2267B1 ;
  4126. }
  4127. //没有子节点
  4128. </style>
  4129. <style>
  4130. .wentsd {
  4131. padding: 0 8px;
  4132. }
  4133. /* .el-treeicon .el-tree-node__expand-icon.is-leaf{
  4134. display: none !important;
  4135. } */
  4136. .custom-text {
  4137. font-family: 'Microsoft YaHei';
  4138. font-size: 16px;
  4139. color: rgba(51, 51, 51, 1);
  4140. line-height: 24px;
  4141. text-align: left;
  4142. font-style: normal;
  4143. text-transform: none;
  4144. padding-left: 8px;
  4145. }
  4146. .el-tree .el-tree-node__children .custom-text {
  4147. font-family: 'Microsoft YaHei';
  4148. font-size: 14px;
  4149. /* 这里设置为20px,你可以根据需求调整大小 */
  4150. color: rgba(51, 51, 51, 0.8);
  4151. }
  4152. /* .el-tree .el-tree-node.is-current>.el-tree-node__content img{
  4153. display: none;
  4154. } */
  4155. .custom-tree {
  4156. overflow: auto;
  4157. }
  4158. .custom-tree1>.el-tree-node>.el-tree-node__content>div img {
  4159. display: none;
  4160. /* 隐藏一级节点复选框 */
  4161. }
  4162. .footerTitle {
  4163. background: #eee;
  4164. border-radius: 0px 0px 0px 0px;
  4165. }
  4166. .footer-tab .el-tabs__item {
  4167. color: #333333;
  4168. }
  4169. .footerTitle .active {
  4170. background-color: #fff;
  4171. border-left:1px solid #B3B3B3;
  4172. border-right:1px solid #B3B3B3;
  4173. /* border-bottom:4px solid #fff; */
  4174. }
  4175. .footerTitle .active::before{
  4176. content: "";
  4177. display: block;
  4178. width: 100%;
  4179. height: 2px;
  4180. background: #2267B1;
  4181. border-radius: 0px 0px 0px 0px;
  4182. top: 0px;
  4183. left:0px;
  4184. position: absolute;
  4185. }
  4186. .footerTitle .active::after{
  4187. content: "";
  4188. display: block;
  4189. width: 100%;
  4190. height:4px;
  4191. background: #fff;
  4192. border-radius: 0px 0px 0px 0px;
  4193. bottom: 0px;
  4194. left:0px;
  4195. position: absolute;
  4196. }
  4197. .youhualog {
  4198. width: 100%;
  4199. height: 195px;
  4200. overflow-y: auto;
  4201. background: #fff;
  4202. }
  4203. .youhualog .active2 {
  4204. color: #2267B1;
  4205. }
  4206. .youhualog ul {
  4207. /* width:482px; */
  4208. display: flex;
  4209. align-items: center;
  4210. }
  4211. .youhualog ul li {
  4212. font-family: 'Microsoft YaHei';
  4213. /* flex: 1; */
  4214. /* border-left: 1px solid #B3B3B3; */
  4215. font-size: 14px;
  4216. height: 32px;
  4217. /* line-height: 40px; */
  4218. width: 120px;
  4219. display: flex;
  4220. /* justify-content: center; */
  4221. align-items: center;
  4222. padding:0 10px;
  4223. cursor: default;
  4224. }
  4225. .youhualog ul li span {
  4226. margin-left: 10px;
  4227. }
  4228. .footer-content {
  4229. /* // padding: 15px 24px; */
  4230. padding: 5px;
  4231. border: 1px solid #B3B3B3;
  4232. /* margin-right: 119px; */
  4233. }
  4234. .footer-add {
  4235. width: 600px;
  4236. }
  4237. .flexend {
  4238. display: flex;
  4239. justify-content: flex-end;
  4240. }
  4241. .dibu {
  4242. margin-top: 5px;
  4243. display: flex;
  4244. justify-content: flex-end;
  4245. height: 35px;
  4246. overflow: hidden;
  4247. }
  4248. .dibu .el-input__wrapper {
  4249. width: 226px;
  4250. }
  4251. .dibu .el-form-item_label {
  4252. color: #333333;
  4253. font-size: 14px;
  4254. font-family: 'Microsoft YaHei';
  4255. }
  4256. .dibu .btncolor {
  4257. margin-top: 2px;
  4258. height: 27px;
  4259. width: 70px;
  4260. background: #FFFFFF;
  4261. box-shadow: 0px 2px 2px 0px #B3B3B3;
  4262. border-radius: 0px 0px 0px 0px;
  4263. border: 1px solid #B3B3B3;
  4264. }
  4265. .classtable .el-table td.el-table__cell div .el-input__wrapper {
  4266. box-shadow: none !important;
  4267. padding: 0;
  4268. }
  4269. .classtable .el-table .el-table__cell {
  4270. padding: 0;
  4271. }
  4272. .gooterpading {
  4273. /* border: 1px solid #2267B1; */
  4274. }
  4275. .classtable .el-table th .cell {
  4276. /* background: #fff; */
  4277. /* line-height: 31px; */
  4278. }
  4279. .classtable .el-table td.el-table__cell, .classtable .el-table th.el-table__cell{
  4280. color: #333333;
  4281. font-size: 14px;
  4282. font-family: 'Microsoft YaHei';
  4283. }
  4284. .footer-content .classtable .el-table td.el-table__cell,.footer-content .classtable .el-table th.el-table__cell {
  4285. color: #333333;
  4286. font-size: 14px;
  4287. font-family: 'Microsoft YaHei';
  4288. }
  4289. .classtable .el-table td.el-table__cell div {
  4290. height: 31px;
  4291. overflow: hidden;
  4292. display: flex;
  4293. align-items: center; /* 垂直居中 */
  4294. justify-content: center; /* 水平居中 */
  4295. }
  4296. .classtable .el-table td.el-table__cell,
  4297. .el-table th.el-table__cell.is-leaf,
  4298. .eldesign {
  4299. /* border: 1px solid #000000; */
  4300. }
  4301. /* .el-color-picker__trigger {
  4302. //display: none;
  4303. } */
  4304. /* 使颜色选择器的触发器可点击,但不显示 */
  4305. .el-color-picker__trigger.is-show-panel {
  4306. display: block;
  4307. }
  4308. .conter_mian {
  4309. padding: 1px;
  4310. }
  4311. .summary-dlg2 .el-dialog__body {
  4312. padding: 0;
  4313. }
  4314. .summary-dlg .el-dialog__wrapper {
  4315. pointer-events: none;
  4316. }
  4317. .summary-dlg .el-dialog {
  4318. pointer-events: auto;
  4319. }
  4320. .summary-dlgPdf .el-dialog__body{
  4321. padding: 5px;
  4322. }
  4323. .el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell {
  4324. background-color: #fff;
  4325. }
  4326. .youhualog1 {
  4327. position: relative;
  4328. }
  4329. .chushij {
  4330. position: absolute;
  4331. right: 13px;
  4332. top: 5px;
  4333. }
  4334. .jindutiao {
  4335. margin: 20px;
  4336. width: 60%;
  4337. padding: 0 0 2px 0px;
  4338. /* background: #9FCDFF; */
  4339. display: flex;
  4340. justify-content: center;
  4341. align-items: center;
  4342. }
  4343. .jindutiao .demo-progress {
  4344. width: 100%;
  4345. }
  4346. .jindutiao .demo-progress .el-progress__text {
  4347. font-size: 13px;
  4348. color: #333333;
  4349. font-family: 'Microsoft YaHei';
  4350. }
  4351. .jindutiao .percentage-value {
  4352. font-size: 13px;
  4353. color: #333333;
  4354. font-family: 'Microsoft YaHei';
  4355. }
  4356. .cstleft{
  4357. width:50%;
  4358. flex: 1;
  4359. }
  4360. .XFpdding{
  4361. /* height: 425px; */
  4362. }
  4363. .dialog_class {
  4364. color: #333333;
  4365. font-size: 16px;
  4366. font-family: 'Microsoft YaHei';
  4367. }
  4368. </style>