index.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065
  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'" @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. active:'',
  190. restime:'',
  191. monitorHCFD:false,
  192. footerShow:true,
  193. headMenu_2Show:false,
  194. elodingfalse:false,
  195. numsteps:'',
  196. logs: "欢迎来到adi平台",
  197. newlog:'',
  198. toollist:[
  199. { icon:tl1, titlie:'坐标轴'},
  200. { icon:tl2, titlie:'缩放'},
  201. ],
  202. toollist2:[
  203. { icon:tl3, titlie:'默认鼠标控制'},
  204. { icon:tl4, titlie:'缩小到窗口'},
  205. { icon:tl5, titlie:'轨道'},
  206. { icon:tl6, titlie:'pan'},
  207. { icon:tl7, titlie:'zoom'},
  208. ],
  209. toollist3:[
  210. { icon:tl8, titlie:'点击选择'},
  211. { icon:tl9, titlie:'点击选择窗口'},
  212. ],
  213. toollist4:[
  214. { icon:tl10, titlie:'前'},
  215. { icon:tl11, titlie:'后'},
  216. { icon:tl12, titlie:'上'},
  217. { icon:tl13, titlie:'底'},
  218. { icon:tl14, titlie:'左'},
  219. { icon:tl15, titlie:'右'},
  220. { icon:tl16, titlie:'等角'},
  221. ],
  222. data: [{
  223. label: '几何(33)',
  224. children: [{
  225. label: '几何点(17)',
  226. children: [{
  227. label: '三级 1-1-1'
  228. }]
  229. },
  230. {
  231. label: '曲线(17)',
  232. children: [{
  233. label: '三级 1-1-1'
  234. }]
  235. },
  236. ]
  237. }, {
  238. label: '网格(20)',
  239. children: [{
  240. label: '节点',
  241. }, {
  242. label: '表格',
  243. }]
  244. }, {
  245. label: '材料',
  246. },
  247. {
  248. label: '接触体',
  249. },
  250. {
  251. label: '接触关系',
  252. },
  253. ],
  254. defaultProps: {
  255. children: 'children',
  256. label: 'label'
  257. },
  258. // current:0,
  259. pid:'',
  260. solverConfigid:'',
  261. activeName: 'one',
  262. activeName1:'first',
  263. objopp:'',
  264. femnum:'',
  265. tab:[
  266. {index:0,name:"几何建模"},
  267. {index:1,name:"网格划分"},
  268. {index:2,name:"几何与单元属性"},
  269. {index:3,name:"材料属性"},
  270. {index:4,name:"接触与连接"},
  271. {index:5,name:"初始条件"},
  272. {index:6,name:" 边界条件"},
  273. {index:7,name:"网格自适应"},
  274. {index:8,name:"载荷工况"},
  275. {index:9,name:"作业任务"},
  276. {index:10,name:"结果查看"},
  277. {index:11,name:" 工具箱"},
  278. ],
  279. tabPosition: 'top',
  280. showtrue:true,
  281. drawer: true,
  282. direction: 'rtl',
  283. options:[
  284. {value: '0',label: 'FEMLab(结构力学)'},
  285. { value: '1',label: 'MPMLab(结构力学)'},
  286. { value: '3',label: 'Bladesign(结构力学)'},
  287. {value: '4',label: 'Marc(结构力学)'},
  288. { value: '5',label: 'Abaqus(结构力学)'},
  289. { value: '6',label: 'Natran(结构力学)'},
  290. { value: '7', label: 'ANSYS-FLUENT(结构力学)'},
  291. {value: '8',label: 'STAR_CCM(流体力学)'},
  292. {value: '9', label: 'Pointwise(流体力学)' },
  293. {value: '10',label: 'ANSYS_ICEMCFD(流体力学)' }
  294. ],
  295. options1:[
  296. {value: '0',label: '结构分析'},
  297. { value: '1',label: '传热分析'},
  298. {value: '2',label: '热/电耦合'},
  299. { value: '3',label: '电/热耦合'},
  300. {value: '4',label: '电/热/力耦合'},
  301. { value: '5',label: '静电场分析'},
  302. {value: '6',label: '静电场/结构耦合'},
  303. { value: '7',label: '压力分析'},
  304. {value: '8',label: '热/压力'},
  305. { value: '9',label: '声场分析'},
  306. {value: '10',label: '声场/结构耦合'},
  307. { value: '11',label: '静磁场分析'},
  308. {value: '12',label: '静磁/热'},
  309. { value: '13',label: '静磁/结构'},
  310. {value: '14',label: '电磁场分析'},
  311. { value: '15',label: '电磁/热'},
  312. {value: '16',label: '电磁/热/结构'},
  313. { value: '17',label: '流体分析'},
  314. {value: '18',label: '流体/传热'},
  315. { value: '19',label: '流固耦合分析'},
  316. {value: '20',label: '流体/传热/结构耦合分析'},
  317. { value: '21',label: '轴承分析'},
  318. {value: '22',label: '扩散分析'},
  319. { value: '23',label: '扩散/热分析'},
  320. {value: '24',label: '扩散结构分析'},
  321. { value: '25',label: '土壤分析'},
  322. ],
  323. value1:'0',
  324. options0:[
  325. {value: 'ADI.SimWork',label: 'ADI.SimWork'},
  326. ],
  327. value0:'ADI.SimWork',
  328. options2:[
  329. {value: 'HCFDLab',label: 'HCFDLab'},
  330. { value: 'FEMLab(结构力学)',label: 'FEMLab(结构力学)'},
  331. { value: 'FEMLab(结构力学)版本2',label: 'FEMLab(结构力学)版本2'},
  332. { value: 'adi',label: 'adi'},
  333. ],
  334. value2:'HCFDLab',
  335. zjhlist:[
  336. {value: '0',label: '全部'},
  337. { value: '1',label: '表格'},
  338. { value: '2',label: '几何特征'},
  339. { value: '3',label: '材料'},
  340. {value: '4',label: '接触体'},
  341. { value: '5',label: '接触关系'},
  342. { value: '6',label: '接触表'},
  343. { value: '7',label: '焊接路径'},
  344. { value: '8',label: '焊缝'},
  345. { value: '9',label: '初始条件'},
  346. {value: '10',label: '边界条件'},
  347. { value: '11',label: '分工情况'},
  348. { value: '12',label: '分析任务'},
  349. { value: '13',label: '集合'}
  350. ],
  351. zjhval:'0',
  352. zjhlist1:[
  353. {value: '0',label: '全部'},
  354. { value: '1',label: '表格1'},
  355. { value: '2',label: '表格2'},
  356. ],
  357. zjhval1:'0',
  358. input3:"",
  359. }
  360. },
  361. created(){
  362. this.pid=this.$route.query.pid;
  363. this.init();
  364. },
  365. mounted(){
  366. let curcolor = this.$store.state.themecolor;
  367. this.classH2 = 'custome-' + curcolor;
  368. },
  369. methods:{
  370. //折线图
  371. changelines(val){
  372. let _this=this;
  373. let vals=JSON.parse(val)
  374. console.log(vals)
  375. if(vals.lineType=='Line'){
  376. this.$set( this.$refs.monitor.option, "type",'Line' );
  377. this.linezhexian(vals.linevalue);
  378. }else{
  379. this.$set( this.$refs.monitor.option, "type","Point" );
  380. this.linezhexian(vals.pointvalue);
  381. }
  382. },
  383. //
  384. linezhexian(num){
  385. this.$set( this.$refs.monitor.option.plotOptions.series, "lineWidth", Number(num));
  386. this.$refs.monitor.newHighcharts("highcharts",this.$refs.monitor.option);
  387. },
  388. meshclick(e,index,key){
  389. let that=this;
  390. that.active=key;
  391. console.log(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. console.log(data);
  432. },
  433. hide(){
  434. this.showtrue=!this.showtrue;
  435. },
  436. handleClick(tab, event) {
  437. },
  438. init(){
  439. this.pid=this.$route.query.pid;
  440. // this.pid='31f117acb7e74232a3267b091391eab2';
  441. this.solverchange1('HCFDLab');
  442. },
  443. //项目求解查询
  444. pojectquery(){
  445. },
  446. solverchange1(val){
  447. console.log(val)
  448. let that=this;
  449. this.femnum=val;
  450. const params = {
  451. transCode: 'C00003',
  452. pid:this.pid,
  453. company:this.value0,
  454. solverModel:this.value2
  455. }
  456. sessionStorage.setItem('params',JSON.stringify(params))
  457. request(params)
  458. .then((res) => {
  459. if(res.returnCode=='000000000'){
  460. this.objopp=res.parameterObj;
  461. let datas=res;
  462. if(val=='HCFDLab'){
  463. this.$nextTick(()=>{
  464. this.logs='HCFDLab';
  465. this.$refs.hcfd.hcfdchange(this.objopp,res.solverConfigid,datas);
  466. this.solverConfigid=res.solverConfigid;
  467. let data= JSON.parse(this.objopp);
  468. this.numsteps=data.nmlParam.steps;
  469. this.state=datas.state;
  470. setTimeout(function(){
  471. that.initWebSocket();
  472. },500)
  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. // }
  481. }else{
  482. }
  483. }else{
  484. }
  485. })
  486. .catch((err) => {
  487. })
  488. },
  489. solverchange(val){
  490. let that=this;
  491. this.femnum=val;
  492. const params = {
  493. transCode: 'C00003',
  494. pid:this.pid,
  495. company:this.value0,
  496. solverModel:this.value2
  497. }
  498. sessionStorage.setItem('params',JSON.stringify(params))
  499. request(params)
  500. .then((res) => {
  501. if(res.returnCode=='000000000'){
  502. let datas=res;
  503. this.objopp=res.parameterObj;
  504. if(val=='HCFDLab'){
  505. this.$nextTick(()=>{
  506. this.logs='HCFDLab'
  507. this.state=datas.state;
  508. this.$refs.hcfd.hcfdchange(this.objopp,res.solverConfigid,datas.state);
  509. this.solverConfigid=res.solverConfigid;
  510. let data= JSON.parse(this.objopp);
  511. this.numsteps=data.nmlParam.steps;
  512. this.exlodingfalse(false)
  513. that.$refs.TFileStream.imgtupian=true;
  514. that.$refs.monitor.container_show=true;
  515. })
  516. }else if(val=='FEMLab(结构力学)'){
  517. let data=res;
  518. this.logs='FEMLab(结构力学)';
  519. this.$refs.fem.femchange(res.parameterObj,res.solverConfigid,data);
  520. that.$refs.TFileStream.imgtupian=false;
  521. that.$refs.monitor.container_show=false;
  522. }else{
  523. }
  524. }else{
  525. console.log(2222)
  526. }
  527. })
  528. .catch((err) => {
  529. })
  530. },
  531. // 调用求解过程日志
  532. fun(){
  533. if( this.state=='1'){
  534. this.$refs.monitor.getwebsocket();
  535. }else{
  536. this.$refs.hcfd.hcfdrun();
  537. }
  538. this.$refs.monitor.container_show=true;
  539. this.monitorHCFD=this.$refs.monitor.container_show
  540. this.$refs.TFileStream.imgtupian=false;
  541. },
  542. // 工具栏的显示隐藏
  543. changehcfd(pare){
  544. this.$refs.monitor.getwebsocket();
  545. this.$refs.TFileStream.imgtupian=false;
  546. this.$refs.monitor.container_show=pare;
  547. },
  548. // 日志的文本框
  549. footerShows(evt) {
  550. if(evt=='claer'){
  551. this.logs='';
  552. }else{
  553. this.footerShow=!this.footerShow
  554. }
  555. },
  556. //日志
  557. getthislog(log){
  558. this.newlog = log+"\n"+this.newlog;
  559. this.logs=this.newlog;
  560. if ( this.logs.indexOf("newSolver end") >= 0) {
  561. this.elodingfalse=false;
  562. this.isSolverEnd = true;
  563. }
  564. },
  565. // 剩余时间
  566. restimeyear(time){
  567. this.restime=time;
  568. },
  569. //开起loading
  570. loadingopen(){
  571. const loading = this.$loading({
  572. lock: true,
  573. text: 'Loading',
  574. spinner: 'el-icon-loading',
  575. background: 'rgba(0, 0, 0, 0.7)'
  576. });
  577. return loading;
  578. },
  579. // 关闭lodind
  580. loadingend(loading){
  581. loading.close()
  582. },
  583. // 文件渲染之前的动作
  584. startimg(action,action2){
  585. let params = {
  586. transCode: "AFT001",// 服务器渲染实例接口创建推流
  587. pid:this.pid,
  588. solverConfigId: this.solverConfigid,
  589. action:action,
  590. paramJson:"",
  591. };
  592. this.loading = true;
  593. request(params)
  594. .then((res) => {
  595. if(res.returnCode=='000000000'){
  596. this.startimgloaddata(action2)
  597. }else{
  598. }
  599. })
  600. .catch((err) => {
  601. this.loadingend(this.loadingopen());
  602. });
  603. },
  604. startimgloaddata(action){
  605. let that=this;
  606. let params = {
  607. transCode: "AFT001",// 服务器渲染实例接口创建推流
  608. pid:this.pid,
  609. solverConfigId: this.solverConfigid,
  610. action:action,
  611. paramJson:"",
  612. };
  613. this.loading = true;
  614. request(params)
  615. .then((res) => {
  616. })
  617. .catch((err) => {
  618. this.loadingend(this.loadingopen());
  619. });
  620. },
  621. // // 文件渲染websoket图片的渲染
  622. initWebSocket(){ //初始化weosocket
  623. const wsuri = "ws://192.168.0.43:8087//websocket?projectId="+this.pid;
  624. this.websock = new WebSocket(wsuri);
  625. this.websock.onmessage = this.websocketonmessage;
  626. this.websock.onopen = this.websocketonopen;
  627. this.websock.onerror = this.websocketonerror;
  628. this.websock.onclose = this.websocketclose;
  629. },
  630. websocketonopen(e){ //连接建立之后执行send方法发送数据
  631. this.startimg("init",'loaddata');
  632. },
  633. websocketonerror(){//连接建立失败重连
  634. this.websock.close()
  635. },
  636. websocketonmessage(e){ //数据接收
  637. // this.loadingopen();
  638. console.log(e);
  639. // setTimeout(() => {
  640. // this.loadingend(this.loadingopen());
  641. // // loading.close();
  642. // }, 30000);
  643. try{
  644. const redata = JSON.parse(e.data);
  645. if(redata.hasOwnProperty("img")){
  646. this.$refs.TFileStream.imgtupian=true;
  647. this.$refs.TFileStream.fetchData(redata);
  648. this.$refs.monitor.container_show=false;
  649. }
  650. // 云图的参数返回 存储
  651. console.log(redata);
  652. if(redata.action=='ResultImport'){
  653. let data=JSON.parse(redata.paramJson);
  654. if(data.msgType=="contour_param"){
  655. sessionStorage.setItem("ytdata",JSON.stringify(data));
  656. this.ytdata=redata;
  657. }
  658. if(data.msgType=='line_param'){
  659. sessionStorage.setItem("ytdata",JSON.stringify(data));
  660. this.ytdata=redata;
  661. }
  662. if(data.msgType=='vector_param'){
  663. sessionStorage.setItem("vectorparam",JSON.stringify(data));
  664. this.vectorparam=redata;
  665. }
  666. if(data.msgType=='stream_param'){
  667. this.$refs.hcfd.streamdata(JSON.stringify(data))
  668. }
  669. }else if(redata.action=='LineDisplay'){
  670. console.log(redata)
  671. this.ytdata=redata;
  672. }else if(redata.action=='SliceDisplayAdd'){
  673. let dataslicedisplay=JSON.parse(redata.paramJson);
  674. if(dataslicedisplay==null||JSON.stringify(dataslicedisplay)=='{}'){
  675. }else{
  676. if(dataslicedisplay.msgType=='addPage_slice_param'){
  677. sessionStorage.setItem("dataslicedisplay",JSON.stringify(redata.paramJson));
  678. this.$refs.hcfd.addparam();
  679. }
  680. }
  681. }else if(redata.action=='SliceDisplayUpdate'){
  682. let datadisplayupdate=JSON.parse(redata.paramJson);
  683. console.log(datadisplayupdate)
  684. if(datadisplayupdate==null||JSON.stringify(datadisplayupdate)=='{}'){
  685. }else{
  686. sessionStorage.setItem("updateparam",JSON.stringify(redata.paramJson));
  687. this.$refs.hcfd.updataparam();
  688. }
  689. }else if(redata.action=='StreamDisplayCreate'){
  690. let streamError=JSON.parse(redata.paramJson)
  691. if(streamError.hasOwnProperty('Error')){
  692. this.loadingend(this.loadingopen());
  693. }
  694. }
  695. return true;
  696. }catch(error){
  697. this.loadingend(this.loadingopen());
  698. return false;
  699. }
  700. },
  701. websocketsend(Data){//数据发送
  702. this.websock.send(Data);
  703. },
  704. websocketclose(e){ //关闭
  705. Message({
  706. type: "error",
  707. message: "websock断开连接",
  708. });
  709. },
  710. }
  711. }
  712. </script>
  713. <style lang="scss">
  714. @import '@/styles/variables.scss';
  715. @import '@/styles/mixin.scss';
  716. .scal{
  717. .toolbar-part-detail{
  718. // background-color: #757070;
  719. .toolbar-content{
  720. padding: 5px;
  721. border-top:1px solid #999;
  722. // border-bottom:1px solid #999;
  723. .imgcontent{
  724. display: flex;
  725. .item{
  726. padding-right: 5px;
  727. }
  728. }
  729. }
  730. }
  731. .toolmain{
  732. width: 100%;
  733. height:32px;
  734. overflow: hidden;
  735. }
  736. html,body{
  737. width: 100%;
  738. height: 100%;
  739. }
  740. .el-tabs__content{
  741. padding: 0 5px;
  742. }
  743. .content{
  744. display: flex;
  745. height: 100%;
  746. position: relative;
  747. .left{
  748. width: 200px;
  749. height: 100%;
  750. flex-direction: column;
  751. padding: 15px;
  752. position: relative;
  753. height: 88vh;
  754. z-index: 10;
  755. }
  756. .part-panel-collapse-handle {
  757. position: absolute;
  758. // right: -56px;
  759. left: -38px;
  760. top: 44%;
  761. width: 94px;
  762. height: 0;
  763. cursor: pointer;
  764. text-align: center;
  765. border-width: 0 20px 18px;
  766. line-height: 18px;
  767. border-style: none solid solid;
  768. transform: rotateZ(
  769. 90deg);
  770. font-size: 19px;
  771. }
  772. .lbg_color3 i:before{
  773. transform: rotateZ(
  774. 0);
  775. }
  776. .right{
  777. padding:0;
  778. flex: 1;
  779. // height: 100%;
  780. position: relative;
  781. }
  782. .imgcontent img{
  783. font-size: 16px;
  784. }
  785. .slide-fade-enter-active {
  786. transition: all .3s ease;
  787. }
  788. }
  789. .tablist{
  790. border-bottom:1px solid #999;
  791. padding: 3px 0;
  792. }
  793. .tablist .tabitem{
  794. color: #b6b6b6;
  795. font-size: 16px;
  796. padding-right: 5px;
  797. cursor: pointer;
  798. &.current{
  799. color: #Fff ;
  800. }
  801. }
  802. .el-tabs--bottom .el-tabs__header.is-bottom{
  803. margin: 0;
  804. }
  805. .el-tabs__header{
  806. margin: 0;
  807. }
  808. .imgcontent{
  809. padding: 0 15px;
  810. }
  811. .el-tabs__item{
  812. height: 30px;
  813. line-height: 30px;
  814. padding: 0 8px;
  815. font-size: 12px;
  816. }
  817. // .imgzong{
  818. // display: flex;
  819. // padding-top: 4px;
  820. // flex-wrap:wrap;
  821. // .el-image{
  822. // width: 30px;
  823. // }
  824. // }
  825. .toolmain .imgzong .item1{
  826. padding-right: 4px;
  827. padding: 0px 4px ;
  828. }
  829. .imgzong .item1{
  830. padding-right: 4px;
  831. padding: 4px 4px ;
  832. }
  833. .shu{
  834. padding: 4px 10px;
  835. color: #666;
  836. }
  837. .el-tabs__item{
  838. height: 30px;
  839. line-height: 30px;
  840. padding: 0 6px;
  841. color:#b6b6b6;
  842. font-size:15px;
  843. }
  844. }
  845. .maxh221{
  846. max-height: calc(100vh - 76px);
  847. }
  848. .maxh400{
  849. max-height: calc(100vh - 410px);
  850. }
  851. .beij-container {
  852. width: 100%;
  853. height: 100%;
  854. background-color: #fff;
  855. // background: linear-gradient(180deg, #ccd3e2 0%, rgba(255, 255, 255, 0) 100%);
  856. }
  857. .el-footer {
  858. padding: 0;
  859. height: 149px;
  860. overflow-y: auto;
  861. }
  862. .footerTitle {
  863. display: flex;
  864. justify-content: space-between;
  865. padding: 5px 20px;
  866. font-size: 20px;
  867. height: 30px !important;
  868. z-index: 99;
  869. }
  870. .footerTitle div {
  871. display: flex;
  872. justify-content: space-around;
  873. align-items: center;
  874. }
  875. .footerTitle p {
  876. margin: 0;
  877. }
  878. .footerTitle span {
  879. padding: 5px 10px;
  880. cursor: default;
  881. }
  882. .femFooter{
  883. height: 135px !important;
  884. padding: 0;
  885. position: relative;
  886. }
  887. .footerText .el-textarea__inner{
  888. width: 100%;
  889. height: 135px !important;
  890. border: 0;
  891. font-size: 12px;
  892. color: #333;
  893. padding: 2px;
  894. }
  895. </style>
  896. <style>
  897. .selecr .el-form-item__label{
  898. line-height: 36px;
  899. }
  900. .item1 .el-image{
  901. width: 30px;
  902. cursor: pointer;
  903. }
  904. .el-tabs--border-card{
  905. background-color: none;
  906. }
  907. .baoshi{
  908. margin-top: 4px;
  909. color: #b6b6b6;
  910. }
  911. .el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{
  912. background-color: #757070;
  913. }
  914. .el-tabs--card>.el-tabs__header .el-tabs__item.is-active{
  915. border-top:1px solid #757070;
  916. border-bottom:none;
  917. border-top: 1px solid transparent;
  918. }
  919. .part-panel-collapse-handle {
  920. border-color: transparent transparent #6f6f6f;
  921. }
  922. .el-dialog__header{
  923. padding: 15px 20px 10px;
  924. background: #757070;
  925. color: #fff
  926. }
  927. .el-button--primary{
  928. background: #757070;
  929. border-color: #757070;
  930. }
  931. .textselsect{
  932. position: absolute;
  933. z-index: 9;
  934. top: 0;
  935. right: 7px;
  936. z-index: 9;
  937. height: 30px;
  938. overflow: hidden;
  939. }
  940. .dialoglocation{
  941. position: absolute;
  942. top: -15vh;
  943. }
  944. .el-dialog__wrapper{
  945. top: 15vh;
  946. }
  947. .el-tree,.dongtia{
  948. background: none;
  949. color: #b6b6b6;
  950. margin-top: 15px;
  951. }
  952. .itemimg1{
  953. padding: 4px;
  954. }
  955. .itemimg1 .item1 .el-image{
  956. width: 20px;
  957. height: 20px;
  958. }
  959. </style>
  960. <style lang="scss" scoped>
  961. /deep/.toolbar-part-detail{
  962. position: relative;
  963. }
  964. .el-form-item{
  965. margin-bottom: 5px;
  966. }
  967. /deep/.left .el-tabs__item{
  968. padding: 0 19.4px !important;
  969. // box-shadow: 0 8px 0 0 #479a48,0 10px 5px 0 rgba(0,0,0,0.5);
  970. box-shadow: 0 10px 5px 0 rgba(0,0,0,0.2);
  971. }
  972. /deep/.left .is-scrollable {
  973. padding:0;
  974. }
  975. /deep/ .left .el-tabs__nav-next,.left .el-tabs__nav-prev{
  976. display: none;
  977. }
  978. /deep/ .left .el-tabs__nav-prev{
  979. display: none;
  980. }
  981. // /deep/ .el-radio+.el-radio{
  982. // margin: 0;
  983. // }
  984. // /deep/ .el-checkbox+.el-checkbox{
  985. // margin: 0;
  986. // }
  987. /deep/.leftsearch .el-button {
  988. background-color: #fff;
  989. }
  990. </style>