index.vue 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163
  1. <template>
  2. <div class="scal">
  3. <div class="toolbar-part-detail lbg_color1 el-tag--primary">
  4. <!-- <div class="toolbar-content"> -->
  5. <!-- <div class="imgcontent">
  6. </div> -->
  7. <div v-if="value2=='HCFDLab'">
  8. <hcfd ref="hcfd" :objopp="objopp" :ytdata="ytdata" :vectorparam="vectorparam" :pid="pid" @fun="fun()" @changelines="changelines()" @linezhexian="linezhexian()" :elodingfalse="elodingfalse" @exlodingfalse="exlodingfalse" :femnum="femnum"></hcfd>
  9. </div>
  10. <div v-else-if="value2=='FEMLab(结构力学)'">
  11. <fem ref="fem" :femnum="femnum" :logs='logs' @getthislog='getthislog' :pid="pid" @exlodingfalse="exlodingfalse" ></fem>
  12. </div>
  13. <div v-else-if="value2=='FEMLab(结构力学)版本2'">
  14. <fem2 ref="fem2" :femnum="femnum" :logs='logs' :pid="pid" ></fem2>
  15. </div>
  16. <div class="adi" v-else>
  17. <el-tabs :tab-position="tabPosition" v-model="activeName" type="card" @tab-click="handleClick">
  18. <el-tab-pane label="几何建模" name="one"><geometry></geometry></el-tab-pane>
  19. <el-tab-pane label="网格划分" name="two"> <meshindex></meshindex></el-tab-pane>
  20. <el-tab-pane label="几何与单元属性" name="three"> <Geometryandclass></Geometryandclass></el-tab-pane>
  21. <el-tab-pane label="材料属性" name="four"> <Materials></Materials></el-tab-pane>
  22. <el-tab-pane label="接触与连接" name="five"><touch></touch></el-tab-pane>
  23. <el-tab-pane label="初始条件" name="six"> <initial></initial></el-tab-pane>
  24. <el-tab-pane label="边界条件" name="seven"> <boundary></boundary></el-tab-pane>
  25. <el-tab-pane label="网格自适应" name="eight"> <Meshauto></Meshauto> </el-tab-pane>
  26. <el-tab-pane label="载荷工况" name="nine"> <loadcase></loadcase></el-tab-pane>
  27. <el-tab-pane label="作业任务" name="ten"> <zuoye></zuoye></el-tab-pane>
  28. <el-tab-pane label="结果查看" name="eleven"> <result></result></el-tab-pane>
  29. <el-tab-pane label="工具箱" name="twelve"><toolindex></toolindex></el-tab-pane>
  30. <el-tab-pane label="操作" name="thirteen"><caozuo ></caozuo></el-tab-pane>
  31. </el-tabs>
  32. </div>
  33. <div class="textselsect">
  34. <el-select v-model="value0" placeholder="请选择">
  35. <el-option
  36. v-for="item in options0"
  37. :key="item.value"
  38. :label="item.label"
  39. :value="item.value">
  40. </el-option>
  41. </el-select>
  42. <el-select v-model="value2" placeholder="请选择" @change="solverchange">
  43. <el-option
  44. v-for="item in options2"
  45. :key="item.value"
  46. :label="item.label"
  47. :value="item.value">
  48. </el-option>
  49. </el-select>
  50. </div>
  51. </div>
  52. <div class="content">
  53. <transition name="slide-fade">
  54. <div class="left lbg_color3 el-menu" v-show="showtrue" style="padding:0;">
  55. <el-tabs v-model="activeName1" type="card" @tab-click="handleClick">
  56. <el-tab-pane label="模型导航" name="first">
  57. <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
  58. </el-tab-pane>
  59. <el-tab-pane label="动态菜单" name="second">
  60. <div class="dongtia dialog_color selecr">
  61. <el-form>
  62. <el-form-item >
  63. <el-select v-model="zjhval" placeholder="请选择">
  64. <el-option
  65. v-for="item in zjhlist"
  66. :key="item.value"
  67. :label="item.label"
  68. :value="item.value"
  69. >
  70. </el-option>
  71. </el-select>
  72. </el-form-item>
  73. <el-form-item>
  74. <el-select v-model="zjhval1" placeholder="请选择">
  75. <el-option
  76. v-for="item in zjhlist1"
  77. :key="item.value"
  78. :label="item.label"
  79. :value="item.value"
  80. >
  81. </el-option>
  82. </el-select>
  83. </el-form-item>
  84. <div class="leftsearch">
  85. <el-input placeholder="请输入内容" v-model="input3" class="input-with-select">
  86. <el-button slot="append" icon="el-icon-search"></el-button>
  87. </el-input>
  88. </div>
  89. </el-form>
  90. </div>
  91. </el-tab-pane>
  92. </el-tabs>
  93. </div>
  94. </transition>
  95. <div class="right lbg_color2 ">
  96. <!-- <div class="part-panel-collapse-handle lbg_color3 el-tag--primary " @click="showtrue=!showtrue">
  97. <i class="el-icon-arrow-down"></i>
  98. </div> -->
  99. <el-container class="beij-container">
  100. <el-container>
  101. <el-main ref="main3d" :class="headMenu_2Show?'maxh400':'maxh221'" style="padding:0;">
  102. <tool1 @startimg="startimg" :monitorHCFD="monitorHCFD" @changehcfd="changehcfd"></tool1>
  103. <!-- 加载折线图 -->
  104. <echartsHFCD ref="monitor" v-if="femnum=='HCFDLab'" @statechange='statechange' @getthislog='getthislog' @restimeyear='restimeyear' :projectId='pid' :nmlsteps="Number(numsteps)"></echartsHFCD>
  105. <!-- 加载图片 -->
  106. <TFileStream :projectId='pid' ref="TFileStream" ></TFileStream>
  107. </el-main>
  108. <div class="footerTitle el-tag--primary">
  109. <div>{{ $t("FEM.other.console") }}
  110. <p class="restime" v-show="elodingfalse" style=" margin-left: 50px; font-size:14px">剩余时长:{{restime}}</p>
  111. </div>
  112. <div>
  113. <li class="exloadbox" v-show="elodingfalse" >
  114. <span>正在求解中</span>
  115. <i class="el-icon-loading"></i>
  116. </li>
  117. <li>
  118. <span @click="footerShows('claer')">清空</span>
  119. </li>
  120. <li>
  121. <span @click="footerShows('foot')">&#9650;&#9660;</span>
  122. </li>
  123. </div>
  124. </div>
  125. <el-footer class="femFooter" v-if="footerShow">
  126. <div class="footerTextBox">
  127. <el-input
  128. class="footerText"
  129. type="textarea"
  130. v-model="logs"
  131. ></el-input>
  132. </div>
  133. </el-footer>
  134. </el-container>
  135. </el-container>
  136. </div>
  137. </div>
  138. </div>
  139. </template>
  140. <script>
  141. //图片引入
  142. import tl1 from '@/assets/icon/axislegend.png'
  143. import tl2 from '@/assets/icon/zoomtowindow.png'
  144. import tl3 from '@/assets/icon/defaultmousecontrol.png'
  145. import tl4 from '@/assets/icon/u3884.png'
  146. import tl5 from '@/assets/icon/16.png'
  147. import tl6 from '@/assets/icon/pan.png'
  148. import tl7 from '@/assets/icon/u3871.png'
  149. import tl8 from '@/assets/icon/u3879.png'
  150. import tl9 from '@/assets/icon/u9872.png'
  151. import tl10 from '@/assets/icon/view_front.png'
  152. import tl11 from '@/assets/icon/view_back.png'
  153. import tl12 from '@/assets/icon/view_top.png'
  154. import tl13 from '@/assets/icon/view_bottom.png'
  155. import tl14 from '@/assets/icon/view_left.png'
  156. import tl15 from '@/assets/icon/view_right.png'
  157. import tl16 from '@/assets/icon/view_isometric.png'
  158. // 引入组件
  159. import { request, getImage } from '@/utils/request'
  160. import { Message, MessageBox } from "element-ui";
  161. import geometry from './geometry/index.vue'
  162. import meshindex from './meshindex/index.vue'
  163. import Geometryandclass from './Geometryandclass/index.vue'
  164. import Materials from './Materials/index.vue'
  165. import touch from './touch/index.vue'
  166. import initial from './initial/index.vue'
  167. import boundary from './boundary/index.vue'
  168. import Meshauto from './Meshauto/index.vue'
  169. import loadcase from './loadcase/index.vue'
  170. import zuoye from './zuoye/index.vue'
  171. import result from './result/index.vue'
  172. import toolindex from './tool/index.vue'
  173. import caozuo from './caozuo/index.vue'
  174. import hcfd from './HCFDLab/index.vue'
  175. import fem from './FEMLab/fem.vue'
  176. import fem2 from './FemLab2_0/index.vue'
  177. import echartsHFCD from "./HCFDLab/echartsHFCD.vue";
  178. import { number } from 'echarts/lib/export'
  179. import TFileStream from "./compoents/TFileStreamhcfd.vue";
  180. import tool1 from "./compoents/tool1.vue";
  181. export default {
  182. components:{geometry,meshindex,Geometryandclass,Materials,touch,initial,boundary,Meshauto,loadcase,zuoye,echartsHFCD,result,caozuo,toolindex,hcfd,fem,TFileStream,tool1,fem2},
  183. data() {
  184. return {
  185. tl1,tl2,tl3,tl4,tl5,tl6,tl7,tl8,tl9,tl10,
  186. tl11,tl12,tl13,tl14,tl15,tl16,
  187. ytdata:{},
  188. vectorparam:{},
  189. selectval:'HCFDLab',
  190. statecustom:'0',//自定义求解状态
  191. active:'',
  192. restime:'',
  193. monitorHCFD:false,
  194. footerShow:true,
  195. headMenu_2Show:false,
  196. elodingfalse:false,
  197. numsteps:'',
  198. logs: "欢迎来到adi平台",
  199. newlog:'',
  200. toollist:[
  201. { icon:tl1, titlie:'坐标轴'},
  202. { icon:tl2, titlie:'缩放'},
  203. ],
  204. toollist2:[
  205. { icon:tl3, titlie:'默认鼠标控制'},
  206. { icon:tl4, titlie:'缩小到窗口'},
  207. { icon:tl5, titlie:'轨道'},
  208. { icon:tl6, titlie:'pan'},
  209. { icon:tl7, titlie:'zoom'},
  210. ],
  211. toollist3:[
  212. { icon:tl8, titlie:'点击选择'},
  213. { icon:tl9, titlie:'点击选择窗口'},
  214. ],
  215. toollist4:[
  216. { icon:tl10, titlie:'前'},
  217. { icon:tl11, titlie:'后'},
  218. { icon:tl12, titlie:'上'},
  219. { icon:tl13, titlie:'底'},
  220. { icon:tl14, titlie:'左'},
  221. { icon:tl15, titlie:'右'},
  222. { icon:tl16, titlie:'等角'},
  223. ],
  224. data: [{
  225. label: '几何(33)',
  226. children: [{
  227. label: '几何点(17)',
  228. children: [{
  229. label: '三级 1-1-1'
  230. }]
  231. },
  232. {
  233. label: '曲线(17)',
  234. children: [{
  235. label: '三级 1-1-1'
  236. }]
  237. },
  238. ]
  239. }, {
  240. label: '网格(20)',
  241. children: [{
  242. label: '节点',
  243. }, {
  244. label: '表格',
  245. }]
  246. }, {
  247. label: '材料',
  248. },
  249. {
  250. label: '接触体',
  251. },
  252. {
  253. label: '接触关系',
  254. },
  255. ],
  256. defaultProps: {
  257. children: 'children',
  258. label: 'label'
  259. },
  260. // current:0,
  261. pid:'',
  262. solverConfigid:'',
  263. activeName: 'one',
  264. activeName1:'first',
  265. objopp:'',
  266. femnum:'',
  267. tab:[
  268. {index:0,name:"几何建模"},
  269. {index:1,name:"网格划分"},
  270. {index:2,name:"几何与单元属性"},
  271. {index:3,name:"材料属性"},
  272. {index:4,name:"接触与连接"},
  273. {index:5,name:"初始条件"},
  274. {index:6,name:" 边界条件"},
  275. {index:7,name:"网格自适应"},
  276. {index:8,name:"载荷工况"},
  277. {index:9,name:"作业任务"},
  278. {index:10,name:"结果查看"},
  279. {index:11,name:" 工具箱"},
  280. ],
  281. tabPosition: 'top',
  282. showtrue:true,
  283. drawer: true,
  284. direction: 'rtl',
  285. options:[
  286. {value: '0',label: 'FEMLab(结构力学)'},
  287. { value: '1',label: 'MPMLab(结构力学)'},
  288. { value: '3',label: 'Bladesign(结构力学)'},
  289. {value: '4',label: 'Marc(结构力学)'},
  290. { value: '5',label: 'Abaqus(结构力学)'},
  291. { value: '6',label: 'Natran(结构力学)'},
  292. { value: '7', label: 'ANSYS-FLUENT(结构力学)'},
  293. {value: '8',label: 'STAR_CCM(流体力学)'},
  294. {value: '9', label: 'Pointwise(流体力学)' },
  295. {value: '10',label: 'ANSYS_ICEMCFD(流体力学)' }
  296. ],
  297. options1:[
  298. {value: '0',label: '结构分析'},
  299. { value: '1',label: '传热分析'},
  300. {value: '2',label: '热/电耦合'},
  301. { value: '3',label: '电/热耦合'},
  302. {value: '4',label: '电/热/力耦合'},
  303. { value: '5',label: '静电场分析'},
  304. {value: '6',label: '静电场/结构耦合'},
  305. { value: '7',label: '压力分析'},
  306. {value: '8',label: '热/压力'},
  307. { value: '9',label: '声场分析'},
  308. {value: '10',label: '声场/结构耦合'},
  309. { value: '11',label: '静磁场分析'},
  310. {value: '12',label: '静磁/热'},
  311. { value: '13',label: '静磁/结构'},
  312. {value: '14',label: '电磁场分析'},
  313. { value: '15',label: '电磁/热'},
  314. {value: '16',label: '电磁/热/结构'},
  315. { value: '17',label: '流体分析'},
  316. {value: '18',label: '流体/传热'},
  317. { value: '19',label: '流固耦合分析'},
  318. {value: '20',label: '流体/传热/结构耦合分析'},
  319. { value: '21',label: '轴承分析'},
  320. {value: '22',label: '扩散分析'},
  321. { value: '23',label: '扩散/热分析'},
  322. {value: '24',label: '扩散结构分析'},
  323. { value: '25',label: '土壤分析'},
  324. ],
  325. value1:'0',
  326. options0:[
  327. {value: 'ADI.SimWork',label: 'ADI.SimWork'},
  328. ],
  329. value0:'ADI.SimWork',
  330. options2:[
  331. {value: 'HCFDLab',label: 'HCFDLab'},
  332. { value: 'FEMLab(结构力学)',label: 'FEMLab(结构力学)'},
  333. { value: 'FEMLab(结构力学)版本2',label: 'FEMLab(结构力学)版本2'},
  334. { value: 'adi',label: 'adi'},
  335. ],
  336. value2:'HCFDLab',
  337. zjhlist:[
  338. {value: '0',label: '全部'},
  339. { value: '1',label: '表格'},
  340. { value: '2',label: '几何特征'},
  341. { value: '3',label: '材料'},
  342. {value: '4',label: '接触体'},
  343. { value: '5',label: '接触关系'},
  344. { value: '6',label: '接触表'},
  345. { value: '7',label: '焊接路径'},
  346. { value: '8',label: '焊缝'},
  347. { value: '9',label: '初始条件'},
  348. {value: '10',label: '边界条件'},
  349. { value: '11',label: '分工情况'},
  350. { value: '12',label: '分析任务'},
  351. { value: '13',label: '集合'}
  352. ],
  353. zjhval:'0',
  354. zjhlist1:[
  355. {value: '0',label: '全部'},
  356. { value: '1',label: '表格1'},
  357. { value: '2',label: '表格2'},
  358. ],
  359. zjhval1:'0',
  360. input3:"",
  361. }
  362. },
  363. created(){
  364. this.pid=this.$route.query.pid;
  365. this.init();
  366. },
  367. mounted(){
  368. let curcolor = this.$store.state.themecolor;
  369. this.classH2 = 'custome-' + curcolor;
  370. },
  371. methods:{
  372. //折线图
  373. changelines(val){
  374. let _this=this;
  375. let vals=JSON.parse(val)
  376. if(vals.lineType=='Line'){
  377. this.$set( this.$refs.monitor.option, "type",'Line' );
  378. this.linezhexian(vals.linevalue);
  379. }else{
  380. this.$set( this.$refs.monitor.option, "type","Point" );
  381. this.linezhexian(vals.pointvalue);
  382. }
  383. },
  384. //
  385. linezhexian(num){
  386. this.$set( this.$refs.monitor.option.plotOptions.series, "lineWidth", Number(num));
  387. this.$refs.monitor.newHighcharts("highcharts",this.$refs.monitor.option);
  388. },
  389. meshclick(e,index,key){
  390. let that=this;
  391. that.active=key;
  392. switch(key){
  393. case 'tl1-0':
  394. break;
  395. case 'tl1-1':
  396. break;
  397. case 'tl2-0':
  398. break;
  399. case 'tl2-1':
  400. break;
  401. case 'tl2-2':
  402. break;
  403. case 'tl2-3':
  404. break;
  405. case 'tl2-4':
  406. break;
  407. case'tl3-0':
  408. break;
  409. case'tl3-1':
  410. break;
  411. case'tl4-0':
  412. break;
  413. case'tl4-1':
  414. break;
  415. case'tl4-2':
  416. break;
  417. case'tl4-3':
  418. break;
  419. case'tl4-4':
  420. break;
  421. case'tl4-5':
  422. break;
  423. case'tl4-6':
  424. break;
  425. }
  426. },
  427. exlodingfalse(res){
  428. this.elodingfalse=res;
  429. },
  430. handleNodeClick(data) {
  431. },
  432. hide(){
  433. this.showtrue=!this.showtrue;
  434. },
  435. handleClick(tab, event) {
  436. },
  437. init(){
  438. this.pid=this.$route.query.pid;
  439. // this.pid='31f117acb7e74232a3267b091391eab2';
  440. this.solverchange1('HCFDLab','');
  441. },
  442. //项目求解查询
  443. pojectquery(){
  444. },
  445. solverchange1(val,canshu){
  446. let that=this;
  447. this.femnum=val;
  448. const params = {
  449. transCode: 'C00003',
  450. pid:this.pid,
  451. company:this.value0,
  452. solverModel:this.value2
  453. }
  454. sessionStorage.setItem('params',JSON.stringify(params))
  455. request(params)
  456. .then((res) => {
  457. if(res.returnCode=='000000000'){
  458. this.objopp=res.parameterObj;
  459. let datas=res;
  460. if(val=='HCFDLab'){
  461. this.$nextTick(()=>{
  462. this.logs='HCFDLab';
  463. this.$refs.hcfd.hcfdchange(this.objopp,res.solverConfigid,datas);
  464. this.solverConfigid=res.solverConfigid;
  465. let data= JSON.parse(this.objopp);
  466. this.numsteps=data.nmlParam.steps;
  467. this.state=datas.state;
  468. if(canshu==''){
  469. setTimeout(function(){
  470. that.initWebSocket();
  471. },500)
  472. }
  473. })
  474. }else if(val=='FEMLab(结构力学)'){
  475. let data=res;
  476. this.logs='FEMLab(结构力学)';
  477. this.$refs.fem.femchange(res.parameterObj,res.solverConfigid,data);
  478. this.$refs.TFileStream.imgtupian=false;
  479. this.$refs.monitor.container_show=false;
  480. this.solverConfigid=res.solverConfigid;
  481. if(canshu==''){
  482. this.startimg("init",'loaddata');
  483. }
  484. }else{
  485. }
  486. }else{
  487. }
  488. })
  489. .catch((err) => {
  490. })
  491. },
  492. solverchange(val){
  493. let that=this;
  494. this.femnum=val;
  495. this.selectval=val;
  496. const params = {
  497. transCode: 'C00003',
  498. pid:this.pid,
  499. company:this.value0,
  500. solverModel:this.value2
  501. }
  502. sessionStorage.setItem('params',JSON.stringify(params))
  503. request(params)
  504. .then((res) => {
  505. if(res.returnCode=='000000000'){
  506. let datas=res;
  507. this.objopp=res.parameterObj;
  508. if(val=='HCFDLab'){
  509. this.$nextTick(()=>{
  510. this.logs='HCFDLab'
  511. this.state=datas.state;
  512. this.$refs.hcfd.hcfdchange(this.objopp,res.solverConfigid,datas.state);
  513. this.solverConfigid=res.solverConfigid;
  514. let data= JSON.parse(this.objopp);
  515. this.numsteps=data.nmlParam.steps;
  516. this.exlodingfalse(false)
  517. this.startimg("init",'loaddata');
  518. that.$refs.monitor.container_show=true;
  519. })
  520. }else if(val=='FEMLab(结构力学)'){
  521. let data=res;
  522. this.$refs.fem.femchange(res.parameterObj,res.solverConfigid,data);
  523. this.solverConfigid=res.solverConfigid;
  524. this.logs='FEMLab(结构力学)';
  525. this.startimg("init",'loaddata');
  526. that.$refs.monitor.container_show=false;
  527. }else{
  528. }
  529. }else{
  530. }
  531. })
  532. .catch((err) => {
  533. })
  534. },
  535. // 状态
  536. statechange(val){
  537. this.statecustom=val;
  538. },
  539. // 调用求解过程日志
  540. fun(){
  541. this.logs='';
  542. this.newlog='';
  543. if( this.statecustom=='1'){
  544. Message({
  545. type: "warning",
  546. message: "运行中不能点击",
  547. });
  548. }else{
  549. if( this.state=='1'){
  550. this.$refs.monitor.getwebsocket();
  551. }else{
  552. this.$refs.hcfd.hcfdrun();
  553. }
  554. this.$refs.monitor.container_show=true;
  555. this.monitorHCFD=this.$refs.monitor.container_show
  556. this.$refs.TFileStream.imgtupian=false;
  557. }
  558. },
  559. funagain(){
  560. if( this.statecustom=='1'){
  561. Message({
  562. type: "warning",
  563. message: "运行中不能点击",
  564. });
  565. }else{
  566. this.$refs.monitor.getwebsocket();
  567. this.$refs.monitor.container_show=true;
  568. this.monitorHCFD=this.$refs.monitor.container_show
  569. this.$refs.TFileStream.imgtupian=false;
  570. }
  571. },
  572. // 工具栏的显示隐藏
  573. changehcfd(pare){
  574. this.logs='';
  575. this.newlog='';
  576. if( this.statecustom=='1'){
  577. Message({
  578. type: "warning",
  579. message: "运行中不能点击",
  580. });
  581. }else{
  582. this.$refs.monitor.getwebsocket();
  583. this.$refs.TFileStream.imgtupian=false;
  584. this.$refs.monitor.container_show=pare;
  585. }
  586. },
  587. // 日志的文本框
  588. footerShows(evt) {
  589. if(evt=='claer'){
  590. this.logs='';
  591. this.newlog='';
  592. }else{
  593. this.footerShow=!this.footerShow
  594. }
  595. },
  596. //日志
  597. getthislog(log){
  598. this.newlog = log+"\n"+this.newlog;
  599. this.logs=this.newlog;
  600. let logs=this.logs;
  601. if ( this.logs.indexOf("newSolver end") >= 0) {
  602. this.elodingfalse=false;
  603. this.isSolverEnd = true;
  604. this.statecustom='0';
  605. }
  606. if( logs.includes("oldSolver end")){
  607. this.statecustom='0';
  608. }
  609. },
  610. // 剩余时间
  611. restimeyear(time){
  612. this.restime=time;
  613. },
  614. //开起loading
  615. loadingopen(){
  616. const loading = this.$loading({
  617. lock: true,
  618. text: 'Loading',
  619. spinner: 'el-icon-loading',
  620. background: 'rgba(0, 0, 0, 0.7)'
  621. });
  622. return loading;
  623. },
  624. // 关闭lodind
  625. loadingend(loading){
  626. loading.close()
  627. },
  628. startimg(action,action2){
  629. let params = {
  630. transCode: "AFT001",// 服务器渲染实例接口创建推流
  631. pid:this.pid,
  632. solverConfigId: this.solverConfigid,
  633. action:action,
  634. paramJson:"",
  635. };
  636. this.loading = true;
  637. request(params)
  638. .then((res) => {
  639. if(res.returnCode=='000000000'){
  640. this.startimgloaddata(action2)
  641. }else{
  642. }
  643. })
  644. .catch((err) => {
  645. this.loadingend(this.loadingopen());
  646. });
  647. },
  648. startimgloaddata(action){
  649. let that=this;
  650. let params = {
  651. transCode: "AFT001",// 服务器渲染实例接口创建推流
  652. pid:this.pid,
  653. solverConfigId: this.solverConfigid,
  654. action:action,
  655. paramJson:"",
  656. };
  657. this.loading = true;
  658. request(params)
  659. .then((res) => {
  660. })
  661. .catch((err) => {
  662. this.loadingend(this.loadingopen());
  663. });
  664. },
  665. // // 文件渲染websoket图片的渲染
  666. initWebSocket(){ //初始化weosocket
  667. // const wsuri = "ws://192.168.0.43:8087//websocket?projectId="+this.pid;
  668. const wsuri = "ws://"+process.env.VUE_APP_BASE_websokt+"//websocket?projectId="+this.pid;
  669. this.websock = new WebSocket(wsuri);
  670. this.websock.onmessage = this.websocketonmessage;
  671. this.websock.onopen = this.websocketonopen;
  672. this.websock.onerror = this.websocketonerror;
  673. this.websock.onclose = this.websocketclose;
  674. console.log(wsuri)
  675. },
  676. websocketonopen(e){ //连接建立之后执行send方法发送数据
  677. this.startimg("init",'loaddata');
  678. },
  679. websocketonerror(){//连接建立失败重连
  680. this.websock.close()
  681. },
  682. websocketonmessage(e){ //数据接收
  683. this.loadingopen();
  684. try{
  685. let eadata=e.data
  686. var rdata=JSON.parse(e.data)
  687. if(rdata.hasOwnProperty("img")){
  688. this.$refs.TFileStream.imgtupian=true;
  689. this.$refs.TFileStream.fetchData(rdata);
  690. this.$refs.monitor.container_show=false;
  691. }
  692. // HCFD云图的参数返回 存储
  693. console.log(rdata);
  694. let rdataparamJson =JSON.parse(rdata.paramJson);
  695. if(rdataparamJson.hasOwnProperty('Error')){
  696. Message({
  697. type: "Error",
  698. message:"Error:"+rdataparamJson.Error,
  699. });
  700. this.loadingend(this.loadingopen());
  701. }
  702. if(this.selectval=='HCFDLab'){
  703. if(rdata.action=='ResultImport'){
  704. let data=JSON.parse(rdata.paramJson);
  705. if(data.msgType=="contour_param"){
  706. //sessionStorage.setItem("ytdata",JSON.stringify(data));
  707. this.$refs.hcfd.outlinedata(JSON.stringify(data))
  708. this.ytdata=rdata;
  709. }
  710. if(data.msgType=='line_param'){
  711. this.$refs.hcfd.outlinedata(JSON.stringify(data))
  712. }
  713. if(data.msgType=='vector_param'){
  714. sessionStorage.setItem("vectorparam",JSON.stringify(data));
  715. this.vectorparam=rdata;
  716. this.$refs.hcfd.vectordata(JSON.stringify(data))
  717. }
  718. if(data.msgType=='stream_param'){
  719. this.$refs.hcfd.streamdata(JSON.stringify(data))
  720. }
  721. if(data.msgType=='solidsurface_param'){
  722. //this.$refs.hcfd.colorval(JSON.stringify(data))
  723. }
  724. }else if(rdata.action=='LineDisplay'){
  725. this.ytdata=rdata;
  726. }else if(rdata.action=='SliceDisplayAdd'){
  727. let dataslicedisplay=JSON.parse(rdata.paramJson);
  728. if(dataslicedisplay==null||JSON.stringify(dataslicedisplay)=='{}'){
  729. }else{
  730. if(dataslicedisplay.msgType=='addPage_slice_param'){
  731. sessionStorage.setItem("dataslicedisplay",JSON.stringify(rdata.paramJson));
  732. this.$refs.hcfd.addparam();
  733. }
  734. }
  735. }else if(rdata.action=='SliceDisplayUpdate'){
  736. let datadisplayupdate=JSON.parse(rdata.paramJson);
  737. if(datadisplayupdate==null||JSON.stringify(datadisplayupdate)=='{}'){
  738. }else{
  739. sessionStorage.setItem("updateparam",JSON.stringify(rdata.paramJson));
  740. this.$refs.hcfd.updataparam();
  741. }
  742. }else{
  743. }
  744. }else if(this.selectval=='FEMLab(结构力学)'){
  745. if(rdata.action=='ResultImport'){
  746. let data=JSON.parse(rdata.paramJson);
  747. if(data.msgType=="contour_param"){
  748. this.$refs.fem.outlinedata(JSON.stringify(data))
  749. }
  750. if(data.msgType=='line_param'){
  751. this.$refs.fem.outlinedata(JSON.stringify(data))
  752. }
  753. if(data.msgType=='vector_param'){
  754. sessionStorage.setItem("vectorparam",JSON.stringify(data));
  755. this.vectorparam=rdata;
  756. }
  757. if(data.msgType=='stream_param'){
  758. this.$refs.fem.streamdata(JSON.stringify(data))
  759. }
  760. if(data.msgType=='solidsurface_param'){
  761. this.$refs.fem.colorval(JSON.stringify(data))
  762. }
  763. }else if(rdata.action=='LineDisplay'){
  764. this.ytdata=rdata;
  765. }else if(rdata.action=='SliceDisplayAdd'){
  766. let dataslicedisplay=JSON.parse(rdata.paramJson);
  767. if(dataslicedisplay==null||JSON.stringify(dataslicedisplay)=='{}'){
  768. }else{
  769. if(dataslicedisplay.msgType=='addPage_slice_param'){
  770. sessionStorage.setItem("dataslicedisplay",JSON.stringify(rdata.paramJson));
  771. this.$refs.fem.femaddparam();
  772. }
  773. }
  774. }else if(rdata.action=='SliceDisplayUpdate'){
  775. let datadisplayupdate=JSON.parse(rdata.paramJson);
  776. if(datadisplayupdate==null||JSON.stringify(datadisplayupdate)=='{}'){
  777. }else{
  778. this.$refs.fem.updataparam(JSON.stringify(rdata.paramJson));
  779. }
  780. }else{
  781. }
  782. }else{
  783. console.log(rdataparamJson);
  784. }
  785. return true;
  786. }catch(error){
  787. this.loadingend(this.loadingopen());
  788. return false;
  789. }
  790. },
  791. websocketsend(Data){//数据发送
  792. this.websock.send(Data);
  793. },
  794. websocketclose(e){ //关闭
  795. this.websock.close();
  796. Message({
  797. type: "error",
  798. message: "websock断开连接",
  799. });
  800. this.loadingend(this.loadingopen());
  801. },
  802. }
  803. }
  804. </script>
  805. <style lang="scss">
  806. @import '@/styles/variables.scss';
  807. @import '@/styles/mixin.scss';
  808. .scal{
  809. .toolbar-part-detail{
  810. // background-color: #757070;
  811. .toolbar-content{
  812. padding: 5px;
  813. border-top:1px solid #999;
  814. // border-bottom:1px solid #999;
  815. .imgcontent{
  816. display: flex;
  817. .item{
  818. padding-right: 5px;
  819. }
  820. }
  821. }
  822. }
  823. .toolmain{
  824. width: 100%;
  825. height:32px;
  826. overflow: hidden;
  827. }
  828. html,body{
  829. width: 100%;
  830. height: 100%;
  831. }
  832. .el-tabs__content{
  833. padding: 0 5px;
  834. }
  835. .content{
  836. display: flex;
  837. height: 100%;
  838. position: relative;
  839. .left{
  840. width: 200px;
  841. height: 100%;
  842. flex-direction: column;
  843. padding: 15px;
  844. position: relative;
  845. height: 88vh;
  846. z-index: 10;
  847. }
  848. .part-panel-collapse-handle {
  849. position: absolute;
  850. // right: -56px;
  851. left: -38px;
  852. top: 44%;
  853. width: 94px;
  854. height: 0;
  855. cursor: pointer;
  856. text-align: center;
  857. border-width: 0 20px 18px;
  858. line-height: 18px;
  859. border-style: none solid solid;
  860. transform: rotateZ(
  861. 90deg);
  862. font-size: 19px;
  863. }
  864. .lbg_color3 i:before{
  865. transform: rotateZ(
  866. 0);
  867. }
  868. .right{
  869. padding:0;
  870. flex: 1;
  871. // height: 100%;
  872. position: relative;
  873. }
  874. .imgcontent img{
  875. font-size: 16px;
  876. }
  877. .slide-fade-enter-active {
  878. transition: all .3s ease;
  879. }
  880. }
  881. .tablist{
  882. border-bottom:1px solid #999;
  883. padding: 3px 0;
  884. }
  885. .tablist .tabitem{
  886. color: #b6b6b6;
  887. font-size: 16px;
  888. padding-right: 5px;
  889. cursor: pointer;
  890. &.current{
  891. color: #Fff ;
  892. }
  893. }
  894. .el-tabs--bottom .el-tabs__header.is-bottom{
  895. margin: 0;
  896. }
  897. .el-tabs__header{
  898. margin: 0;
  899. }
  900. .imgcontent{
  901. padding: 0 15px;
  902. }
  903. .el-tabs__item{
  904. height: 30px;
  905. line-height: 30px;
  906. padding: 0 8px;
  907. font-size: 12px;
  908. }
  909. // .imgzong{
  910. // display: flex;
  911. // padding-top: 4px;
  912. // flex-wrap:wrap;
  913. // .el-image{
  914. // width: 30px;
  915. // }
  916. // }
  917. .toolmain .imgzong .item1{
  918. padding-right: 4px;
  919. padding: 0px 4px ;
  920. }
  921. .imgzong .item1{
  922. padding-right: 4px;
  923. padding: 4px 4px ;
  924. }
  925. .shu{
  926. padding: 4px 10px;
  927. color: #666;
  928. }
  929. .el-tabs__item{
  930. height: 30px;
  931. line-height: 30px;
  932. padding: 0 6px;
  933. color:#b6b6b6;
  934. font-size:15px;
  935. }
  936. }
  937. .maxh221{
  938. max-height: calc(100vh - 76px);
  939. }
  940. .maxh400{
  941. max-height: calc(100vh - 410px);
  942. }
  943. .beij-container {
  944. width: 100%;
  945. height: 100%;
  946. background-color: #fff;
  947. // background: linear-gradient(180deg, #ccd3e2 0%, rgba(255, 255, 255, 0) 100%);
  948. }
  949. .el-footer {
  950. padding: 0;
  951. height: 149px;
  952. overflow-y: auto;
  953. }
  954. .footerTitle {
  955. display: flex;
  956. justify-content: space-between;
  957. padding: 5px 20px;
  958. font-size: 20px;
  959. height: 30px !important;
  960. z-index: 99;
  961. }
  962. .footerTitle div {
  963. display: flex;
  964. justify-content: space-around;
  965. align-items: center;
  966. }
  967. .footerTitle p {
  968. margin: 0;
  969. }
  970. .footerTitle span {
  971. padding: 5px 10px;
  972. cursor: default;
  973. }
  974. .femFooter{
  975. height: 135px !important;
  976. padding: 0;
  977. position: relative;
  978. }
  979. .footerText .el-textarea__inner{
  980. width: 100%;
  981. height: 135px !important;
  982. border: 0;
  983. font-size: 12px;
  984. color: #333;
  985. padding: 2px;
  986. }
  987. </style>
  988. <style>
  989. .left{
  990. display: none;
  991. }
  992. .selecr .el-form-item__label{
  993. line-height: 36px;
  994. }
  995. .item1 .el-image{
  996. width: 30px;
  997. cursor: pointer;
  998. }
  999. .el-tabs--border-card{
  1000. background-color: none;
  1001. }
  1002. .baoshi{
  1003. margin-top: 4px;
  1004. color: #b6b6b6;
  1005. }
  1006. .el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{
  1007. background-color: #757070;
  1008. }
  1009. .el-tabs--card>.el-tabs__header .el-tabs__item.is-active{
  1010. border-top:1px solid #757070;
  1011. border-bottom:none;
  1012. border-top: 1px solid transparent;
  1013. }
  1014. .part-panel-collapse-handle {
  1015. border-color: transparent transparent #6f6f6f;
  1016. }
  1017. .el-dialog__header{
  1018. padding: 15px 20px 10px;
  1019. background: #757070;
  1020. color: #fff
  1021. }
  1022. .el-button--primary{
  1023. background: #757070;
  1024. border-color: #757070;
  1025. }
  1026. .textselsect{
  1027. position: absolute;
  1028. z-index: 9;
  1029. top: 0;
  1030. right: 7px;
  1031. z-index: 9;
  1032. height: 30px;
  1033. overflow: hidden;
  1034. }
  1035. .dialoglocation{
  1036. position: absolute;
  1037. top: -15vh;
  1038. }
  1039. .el-dialog__wrapper{
  1040. top: 15vh;
  1041. }
  1042. .el-tree,.dongtia{
  1043. background: none;
  1044. color: #b6b6b6;
  1045. margin-top: 15px;
  1046. }
  1047. .itemimg1{
  1048. padding: 4px;
  1049. }
  1050. .itemimg1 .item1 .el-image{
  1051. width: 20px;
  1052. height: 20px;
  1053. }
  1054. </style>
  1055. <style lang="scss" scoped>
  1056. /deep/.toolbar-part-detail{
  1057. position: relative;
  1058. }
  1059. .el-form-item{
  1060. margin-bottom: 5px;
  1061. }
  1062. /deep/.left .el-tabs__item{
  1063. padding: 0 19.4px !important;
  1064. // box-shadow: 0 8px 0 0 #479a48,0 10px 5px 0 rgba(0,0,0,0.5);
  1065. box-shadow: 0 10px 5px 0 rgba(0,0,0,0.2);
  1066. }
  1067. /deep/.left .is-scrollable {
  1068. padding:0;
  1069. }
  1070. /deep/ .left .el-tabs__nav-next,.left .el-tabs__nav-prev{
  1071. display: none;
  1072. }
  1073. /deep/ .left .el-tabs__nav-prev{
  1074. display: none;
  1075. }
  1076. // /deep/ .el-radio+.el-radio{
  1077. // margin: 0;
  1078. // }
  1079. // /deep/ .el-checkbox+.el-checkbox{
  1080. // margin: 0;
  1081. // }
  1082. /deep/.leftsearch .el-button {
  1083. background-color: #fff;
  1084. }
  1085. </style>