123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650 |
- <template>
- <div class="scal">
- <div class="toolbar-part-detail lbg_color1 el-tag--primary">
- <!-- <div class="toolbar-content"> -->
- <!-- <div class="imgcontent">
-
-
- </div> -->
- <div v-if="value2=='HCFDLab'">
- <hcfd
- ref="hcfd"
- :objopp="objopp"
- :ytdata="ytdata"
- :vectorparam="vectorparam"
- :pid="pid"
- :objcheck="objcheck"
- @fun="fun()"
- @chaild='chaild()'
- @changelines="changelines()"
- @linezhexian="linezhexian()"
- :elodingfalse="elodingfalse"
- @exlodingfalse="exlodingfalse"
- :femnum="femnum"
- ></hcfd>
- </div>
- <div v-else-if="value2=='FEMLab(结构力学)'">
- <fem
- ref="fem"
- :femnum="femnum"
- :logs='logs'
- @getthislog='getthislog'
- :pid="pid"
- @exlodingfalse="exlodingfalse"
- :objcheck="objcheck"
- ></fem>
- </div>
- <div v-else-if="value2=='FEMLab(结构力学)版本2'">
- <fem2
- ref="fem2"
- :femnum="femnum"
- :logs='logs'
- :pid="pid"
- ></fem2>
- </div>
- <div
- class="adi"
- v-else
- >
- <el-tabs
- :tab-position="tabPosition"
- v-model="activeName"
- type="card"
- @tab-click="handleClick"
- >
- <el-tab-pane
- label="几何建模"
- name="one"
- >
- <geometry></geometry>
- </el-tab-pane>
- <el-tab-pane
- label="网格划分"
- name="two"
- >
- <meshindex></meshindex>
- </el-tab-pane>
- <el-tab-pane
- label="几何与单元属性"
- name="three"
- >
- <Geometryandclass></Geometryandclass>
- </el-tab-pane>
- <el-tab-pane
- label="材料属性"
- name="four"
- >
- <Materials></Materials>
- </el-tab-pane>
- <el-tab-pane
- label="接触与连接"
- name="five"
- >
- <touch></touch>
- </el-tab-pane>
- <el-tab-pane
- label="初始条件"
- name="six"
- >
- <initial></initial>
- </el-tab-pane>
- <el-tab-pane
- label="边界条件"
- name="seven"
- >
- <boundary></boundary>
- </el-tab-pane>
- <el-tab-pane
- label="网格自适应"
- name="eight"
- >
- <Meshauto></Meshauto>
- </el-tab-pane>
- <el-tab-pane
- label="载荷工况"
- name="nine"
- >
- <loadcase></loadcase>
- </el-tab-pane>
- <el-tab-pane
- label="作业任务"
- name="ten"
- >
- <zuoye></zuoye>
- </el-tab-pane>
- <el-tab-pane
- label="结果查看"
- name="eleven"
- >
- <result></result>
- </el-tab-pane>
- <el-tab-pane
- label="工具箱"
- name="twelve"
- >
- <toolindex></toolindex>
- </el-tab-pane>
- <el-tab-pane
- label="操作"
- name="thirteen"
- >
- <caozuo></caozuo>
- </el-tab-pane>
- </el-tabs>
- </div>
- <div class="textselsect">
- <el-select
- v-model="value0"
- placeholder="请选择"
- >
- <el-option
- v-for="item in options0"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- <el-select
- v-model="value2"
- placeholder="请选择"
- @change="solverchange"
- >
- <el-option
- v-for="item in options2"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </div>
- </div>
- <div class="content">
- <transition name="slide-fade">
- <div
- class="left lbg_color3 el-menu"
- v-show="showtrue"
- style="padding:0;"
- >
- <el-tabs
- v-model="activeName1"
- type="card"
- @tab-click="handleClick"
- >
- <el-tab-pane
- label="模型导航"
- name="first"
- >
- <!-- @node-click="handleNodeClick1" -->
- <el-tree
- :data="data"
- class="my-tree"
- show-checkbox
- node-key="id"
- :default-expanded-keys="[1,2]"
- :default-checked-keys="[13]"
- :props="defaultProps"
- @check="handleNodeClick"
- ref="tree"
-
- ></el-tree>
- </el-tab-pane>
- <el-tab-pane
- label="动态菜单"
- name="second"
- >
- <div class="dongtia dialog_color selecr">
- <el-form>
- <el-form-item>
- <el-select
- v-model="zjhval"
- placeholder="请选择"
- >
- <el-option
- v-for="item in zjhlist"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select
- v-model="zjhval1"
- placeholder="请选择"
- >
- <el-option
- v-for="item in zjhlist1"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <div class="leftsearch">
- <el-input
- placeholder="请输入内容"
- v-model="input3"
- class="input-with-select"
- >
- <el-button
- slot="append"
- icon="el-icon-search"
- ></el-button>
- </el-input>
- </div>
- </el-form>
- </div>
- </el-tab-pane>
- </el-tabs>
- </div>
- </transition>
- <div class="right lbg_color2 ">
- <!-- <div class="part-panel-collapse-handle lbg_color3 el-tag--primary " @click="showtrue=!showtrue">
- <i class="el-icon-arrow-down"></i>
- </div> -->
- <el-container class="beij-container">
- <el-container>
- <el-main
- ref="main3d"
- :class="headMenu_2Show?'maxh400':'maxh221'"
- style="padding:0;"
- >
- <tool1
- @startimg="startimg"
- @fun="fun"
- :monitorHCFD="monitorHCFD"
- @changehcfd="changehcfd"
- ></tool1>
- <!-- 加载折线图 -->
- <echartsHFCD
- ref="monitor"
- v-if="femnum=='HCFDLab'"
- @statechange='statechange'
- @getthislog='getthislog'
- @restimeyear='restimeyear'
- :projectId='pid'
- :nmlsteps="Number(numsteps)"
- ></echartsHFCD>
- <!-- 加载图片 -->
- <TFileStream
- :projectId='pid'
- ref="TFileStream"
- ></TFileStream>
- </el-main>
- <!-- <div class="kongzhit"> -->
- <div class="footerTitle el-tag--primary">
- <div>{{ $t("FEM.other.console") }}
- <p
- class="restime"
- v-show="elodingfalse"
- style=" margin-left: 50px; font-size:14px"
- >剩余时长:{{restime}}</p>
- </div>
- <div>
- <li
- class="exloadbox"
- v-show="elodingfalse"
- >
- <span>正在求解中</span>
- <i class="el-icon-loading"></i>
- </li>
- <li>
- <span @click="footerShows('claer')">清空</span>
- </li>
- <!-- <li>
- <span @click="exlodingfalse(false)">按钮</span>
- </li> -->
- <li>
- <span @click="footerShows('foot')">▲▼</span>
- </li>
- </div>
- </div>
- <el-footer
- class="femFooter"
- v-if="footerShow"
- >
- <div class="footerTextBox">
- <el-input
- class="footerText"
- type="textarea"
- id="textarea_id"
- v-model="logs"
- ></el-input>
- </div>
- </el-footer>
- <!-- </div> -->
- </el-container>
- </el-container>
- </div>
- </div>
- </div>
- </template>
- <script>
- //图片引入
- import tl1 from "@/assets/icon/axislegend.png";
- import tl2 from "@/assets/icon/zoomtowindow.png";
- import tl3 from "@/assets/icon/defaultmousecontrol.png";
- import tl4 from "@/assets/icon/u3884.png";
- import tl5 from "@/assets/icon/16.png";
- import tl6 from "@/assets/icon/pan.png";
- import tl7 from "@/assets/icon/u3871.png";
- import tl8 from "@/assets/icon/u3879.png";
- import tl9 from "@/assets/icon/u9872.png";
- import tl10 from "@/assets/icon/view_front.png";
- import tl11 from "@/assets/icon/view_back.png";
- import tl12 from "@/assets/icon/view_top.png";
- import tl13 from "@/assets/icon/view_bottom.png";
- import tl14 from "@/assets/icon/view_left.png";
- import tl15 from "@/assets/icon/view_right.png";
- import tl16 from "@/assets/icon/view_isometric.png";
- // 引入组件
- import { request, getImage } from "@/utils/request";
- import { Message, MessageBox } from "element-ui";
- import geometry from "./geometry/index.vue";
- import meshindex from "./meshindex/index.vue";
- import Geometryandclass from "./Geometryandclass/index.vue";
- import Materials from "./Materials/index.vue";
- import touch from "./touch/index.vue";
- import initial from "./initial/index.vue";
- import boundary from "./boundary/index.vue";
- import Meshauto from "./Meshauto/index.vue";
- import loadcase from "./loadcase/index.vue";
- import zuoye from "./zuoye/index.vue";
- import result from "./result/index.vue";
- import toolindex from "./tool/index.vue";
- import caozuo from "./caozuo/index.vue";
- import hcfd from "./HCFDLab/index.vue";
- import fem from "./FEMLab/fem.vue";
- import fem2 from "./FemLab2_0/index.vue";
- import echartsHFCD from "./HCFDLab/echartsHFCD.vue";
- import { number } from "echarts/lib/export";
- import TFileStream from "./compoents/TFileStreamhcfd.vue";
- import tool1 from "./compoents/tool1.vue";
- import { clear } from "echarts/lib/util/throttle";
- export default {
- components: {
- geometry,
- meshindex,
- Geometryandclass,
- Materials,
- touch,
- initial,
- boundary,
- Meshauto,
- loadcase,
- zuoye,
- echartsHFCD,
- result,
- caozuo,
- toolindex,
- hcfd,
- fem,
- TFileStream,
- tool1,
- fem2,
- },
- data() {
- return {
- //几何参数
- checkIdArr:[],
- objcheck:{
- pointsFlag:false,
- curvesFlag:true,
- surFacesFlag:false,
- },
- checkkey:[],
- // 心跳包的参数
- websock: null, //建立连接
- lockReconnect: false, //是否真正建立连接
- timeout: 28 * 1000, //30秒一次心跳
- timeoutObj: null, //心跳倒计时
- serverTimeout0bj: null, //
- timeoutnum: null, //断开重连倒计时
- tl1,
- tl2,
- tl3,
- tl4,
- tl5,
- tl6,
- tl7,
- tl8,
- tl9,
- tl10,
- tl11,
- tl12,
- tl13,
- tl14,
- tl15,
- tl16,
- ytdata: {},
- vectorparam: {},
- selectval: "HCFDLab",
- statecustom: "0", //自定义求解状态
- active: "",
- restime: "",
- logmatter:'',
- monitorHCFD: false,
- footerShow: true,
- headMenu_2Show: false,
- elodingfalse: false,
- numsteps: "",
- logs: "欢迎来到adi平台",
- newlog: "",
- toollist: [
- { icon: tl1, titlie: "坐标轴" },
- { icon: tl2, titlie: "缩放" },
- ],
- toollist2: [
- { icon: tl3, titlie: "默认鼠标控制" },
- { icon: tl4, titlie: "缩小到窗口" },
- { icon: tl5, titlie: "轨道" },
- { icon: tl6, titlie: "pan" },
- { icon: tl7, titlie: "zoom" },
- ],
- toollist3: [
- { icon: tl8, titlie: "点击选择" },
- { icon: tl9, titlie: "点击选择窗口" },
- ],
- toollist4: [
- { icon: tl10, titlie: "前" },
- { icon: tl11, titlie: "后" },
- { icon: tl12, titlie: "上" },
- { icon: tl13, titlie: "底" },
- { icon: tl14, titlie: "左" },
- { icon: tl15, titlie: "右" },
- { icon: tl16, titlie: "等角" },
- ],
- data: [
- {
- id: 1,
- label: "HCFDLab",
- children: [
- {
- id: 4,
- label: "Geometry",
- children: [{
- id: 12,
- label: 'points'
- }, {
- id: 13,
- label: 'Curves'
- }, {
- id: 14,
- label: 'Surfaces'
- }
- ],
- },
- {
- id: 5,
- label: "Mesh",
-
- },
- {
- id: 6,
- label: "Parts",
-
- },
- {
- id: 7,
- label: "Custom Control",
- children: [
- {
- id: 15,
- label: "Surface Control",
- },
- {
- id: 16,
- label: "Curves Control",
- },
- {
- id: 17,
- label: "Volume Control",
- },
- ],
- },
- {
- id: 8,
- label: "Physics",
-
- },
- {
- id: 9,
- label: "Solution",
-
- },
- {
- id: 10,
- label: "Jobs",
-
- },
- { id: 11,
- label: "Results",
-
- },
- ],
- },
- {
- label: "网格(20)",
- children: [
- {
- label: "节点",
- },
- {
- label: "表格",
- },
- ],
- },
- {
- label: "材料",
- },
- {
- label: "接触体",
- },
- {
- label: "接触关系",
- },
- ],
- defaultProps: {
- children: "children",
- label: "label",
- },
- // current:0,
- pid: "",
- solverConfigid: "",
- activeName: "one",
- activeName1: "first",
- objopp: "",
- femnum: "",
- tab: [
- { index: 0, name: "几何建模" },
- { index: 1, name: "网格划分" },
- { index: 2, name: "几何与单元属性" },
- { index: 3, name: "材料属性" },
- { index: 4, name: "接触与连接" },
- { index: 5, name: "初始条件" },
- { index: 6, name: " 边界条件" },
- { index: 7, name: "网格自适应" },
- { index: 8, name: "载荷工况" },
- { index: 9, name: "作业任务" },
- { index: 10, name: "结果查看" },
- { index: 11, name: " 工具箱" },
- ],
- tabPosition: "top",
- showtrue: true,
- drawer: true,
- direction: "rtl",
- options: [
- { value: "0", label: "FEMLab(结构力学)" },
- { value: "1", label: "MPMLab(结构力学)" },
- { value: "3", label: "Bladesign(结构力学)" },
- { value: "4", label: "Marc(结构力学)" },
- { value: "5", label: "Abaqus(结构力学)" },
- { value: "6", label: "Natran(结构力学)" },
- { value: "7", label: "ANSYS-FLUENT(结构力学)" },
- { value: "8", label: "STAR_CCM(流体力学)" },
- { value: "9", label: "Pointwise(流体力学)" },
- { value: "10", label: "ANSYS_ICEMCFD(流体力学)" },
- ],
- options1: [
- { value: "0", label: "结构分析" },
- { value: "1", label: "传热分析" },
- { value: "2", label: "热/电耦合" },
- { value: "3", label: "电/热耦合" },
- { value: "4", label: "电/热/力耦合" },
- { value: "5", label: "静电场分析" },
- { value: "6", label: "静电场/结构耦合" },
- { value: "7", label: "压力分析" },
- { value: "8", label: "热/压力" },
- { value: "9", label: "声场分析" },
- { value: "10", label: "声场/结构耦合" },
- { value: "11", label: "静磁场分析" },
- { value: "12", label: "静磁/热" },
- { value: "13", label: "静磁/结构" },
- { value: "14", label: "电磁场分析" },
- { value: "15", label: "电磁/热" },
- { value: "16", label: "电磁/热/结构" },
- { value: "17", label: "流体分析" },
- { value: "18", label: "流体/传热" },
- { value: "19", label: "流固耦合分析" },
- { value: "20", label: "流体/传热/结构耦合分析" },
- { value: "21", label: "轴承分析" },
- { value: "22", label: "扩散分析" },
- { value: "23", label: "扩散/热分析" },
- { value: "24", label: "扩散结构分析" },
- { value: "25", label: "土壤分析" },
- ],
- value1: "0",
- options0: [{ value: "ADI.SimWork", label: "ADI.SimWork" }],
- value0: "ADI.SimWork",
- options2: [
- { value: "HCFDLab", label: "HCFDLab" },
- { value: "FEMLab(结构力学)", label: "FEMLab(结构力学)" },
- { value: "FEMLab(结构力学)版本2", label: "FEMLab(结构力学)版本2" },
- { value: "adi", label: "adi" },
- ],
- value2: "HCFDLab",
- zjhlist: [
- { value: "0", label: "全部" },
- { value: "1", label: "表格" },
- { value: "2", label: "几何特征" },
- { value: "3", label: "材料" },
- { value: "4", label: "接触体" },
- { value: "5", label: "接触关系" },
- { value: "6", label: "接触表" },
- { value: "7", label: "焊接路径" },
- { value: "8", label: "焊缝" },
- { value: "9", label: "初始条件" },
- { value: "10", label: "边界条件" },
- { value: "11", label: "分工情况" },
- { value: "12", label: "分析任务" },
- { value: "13", label: "集合" },
- ],
- zjhval: "0",
- zjhlist1: [
- { value: "0", label: "全部" },
- { value: "1", label: "表格1" },
- { value: "2", label: "表格2" },
- ],
- zjhval1: "0",
- input3: "",
- };
- },
- created() {
- this.pid = this.$route.query.pid;
- this.init();
- },
- beforeDestroy() {
- this.websock.close();
- // 清除时间
- clearTimeout(this.timeoutObj);
- clearTimeout(this.serverTimeoutObj);
- },
- // destroyed() {
- // this.websock.close();
- // //this.websock=null;
- // //console.log( this.websock.close());
- // // 清除时间
- // clearTimeout(this.timeoutObj);
- // clearTimeout(this.serverTimeoutObj);
- // },
- destroyed() {
- if(this.websock!=null){
- this.websock.close();
- clearTimeout(this.timeoutObj);
- clearTimeout(this.serverTimeoutObj);
- console.log("关闭了websocket")
- }
- },
- mounted() {
- let curcolor = this.$store.state.themecolor;
- this.classH2 = "custome-" + curcolor;
- },
- methods: {
- // 子组件调用子组件的方法
- chaild(img) {
- this.$refs.TFileStream.fetchData(img, "1");
- },
- //折线图
- changelines(val) {
- let _this = this;
- let vals = JSON.parse(val);
- if (vals.lineType == "Line") {
- this.$set(this.$refs.monitor.option, "type", "Line");
- this.linezhexian(vals.linevalue);
- } else {
- this.$set(this.$refs.monitor.option, "type", "Point");
- this.linezhexian(vals.pointvalue);
- }
- },
- //
- linezhexian(num) {
- this.$set(
- this.$refs.monitor.option.plotOptions.series,
- "lineWidth",
- Number(num)
- );
- this.$refs.monitor.newHighcharts("highcharts", this.$refs.monitor.option);
- },
- meshclick(e, index, key) {
- let that = this;
- that.active = key;
- switch (key) {
- case "tl1-0":
- break;
- case "tl1-1":
- break;
- case "tl2-0":
- break;
- case "tl2-1":
- break;
- case "tl2-2":
- break;
- case "tl2-3":
- break;
- case "tl2-4":
- break;
- case "tl3-0":
- break;
- case "tl3-1":
- break;
- case "tl4-0":
- break;
- case "tl4-1":
- break;
- case "tl4-2":
- break;
- case "tl4-3":
- break;
- case "tl4-4":
- break;
- case "tl4-5":
- break;
- case "tl4-6":
- break;
- }
- },
- exlodingfalse(res) {
- this.footerShows("claer");
- this.elodingfalse =res;
- console.log(this.elodingfalse)
- },
- hide() {
- this.showtrue = !this.showtrue;
- },
- handleClick(tab, event) {},
- init() {
- this.pid = this.$route.query.pid;
- // this.pid='31f117acb7e74232a3267b091391eab2';
- this.solverchange1("HCFDLab", "");
- },
- //项目求解查询
- pojectquery() {},
- solverchange1(val, canshu) {
- let that = this;
- this.femnum = val;
- const params = {
- transCode: "C00003",
- pid: this.pid,
- company: this.value0,
- solverModel: this.value2,
- };
- sessionStorage.setItem("params", JSON.stringify(params));
- request(params).then((res) => {
- if (res.returnCode == "000000000") {
- this.objopp = res.parameterObj;
- let datas = res;
- if (val == "HCFDLab") {
- this.$nextTick(() => {
- this.logs = "HCFDLab";
- this.$refs.hcfd.hcfdchange(
- this.objopp,
- res.solverConfigid,
- datas
- );
- this.solverConfigid = res.solverConfigid;
- let data = JSON.parse(this.objopp);
- this.numsteps = data.nmlParam.steps;
- this.state = datas.state;
- if (canshu == "") {
- setTimeout(function () {
- that.initWebSocket();
- // this.startimg("init",'loaddata');
- }, 300);
- setTimeout(function () {
- that.startimg("init", "loaddata");
- }, 1000);
- }
- });
- } else if (val == "FEMLab(结构力学)") {
- let data = res;
- this.logs = "FEMLab(结构力学)";
- this.$refs.fem.femchange(
- res.parameterObj,
- res.solverConfigid,
- data
- );
- this.$refs.TFileStream.imgtupian = false;
- this.$refs.monitor.container_show = false;
- this.solverConfigid = res.solverConfigid;
- if (canshu == "") {
- this.startimg("init", "loaddata");
- }
- }
- }
- });
- },
- solverchange(val) {
- let that = this;
- this.femnum = val;
- this.selectval = val;
- const params = {
- transCode: "C00003",
- pid: this.pid,
- company: this.value0,
- solverModel: this.value2,
- };
- sessionStorage.setItem("params", JSON.stringify(params));
- request(params)
- .then((res) => {
- if (res.returnCode == "000000000") {
- let datas = res;
- this.objopp = res.parameterObj;
- if (val == "HCFDLab") {
- this.$nextTick(() => {
- this.logs = "HCFDLab";
- this.state = datas.state;
- this.$refs.hcfd.hcfdchange(
- this.objopp,
- res.solverConfigid,
- datas.state
- );
- this.solverConfigid = res.solverConfigid;
- let data = JSON.parse(this.objopp);
- this.numsteps = data.nmlParam.steps;
- this.exlodingfalse(false);
- this.startimg("init", "loaddata");
- that.$refs.monitor.container_show = true;
- });
- } else if (val == "FEMLab(结构力学)") {
- let data = res;
- this.$refs.fem.femchange(
- res.parameterObj,
- res.solverConfigid,
- data
- );
- this.solverConfigid = res.solverConfigid;
- this.logs = "FEMLab(结构力学)";
- this.startimg("init", "loaddata");
- this.$refs.monitor.container_show = false;
- this.$refs.TFileStream.imgtupian = false;
- } else {
- }
- } else {
- }
- })
- .catch((err) => {});
- },
- // 状态
- statechange(val) {
- this.statecustom = val;
- },
- // 调用求解过程日志
- fun() {
- this.logs = "";
- this.newlog = "";
- let funbool= this.$refs.hcfd.funbool;
- if(funbool==true){
- this.$refs.hcfd.funbool=false;
- this.$refs.monitor.getwebsocket();
- }
- this.$refs.monitor.container_show = true;
- this.monitorHCFD = this.$refs.monitor.container_show;
- this.$refs.TFileStream.imgtupian = false;
- // if (this.statecustom == "1") {
- // Message({
- // type: "warning",
- // message: "运行中不能点击",
- // });
- // } else {
- // if (this.state == "1") {
- // //this.$refs.monitor.getwebsocket();
- // } else {
- // // this.$refs.hcfd.hcfdrun();
- // }
- // this.$refs.monitor.container_show = true;
- // this.monitorHCFD = this.$refs.monitor.container_show;
- // this.$refs.TFileStream.imgtupian = false;
- // }
- },
- funagain() {
- // if (this.elodingfalse == true) {
- // Message({
- // type: "warning",
- // message: "运行中不能点击",
- // });
- // } else {
- this.$refs.monitor.getwebsocket();
- this.$refs.monitor.container_show = true;
- this.monitorHCFD = this.$refs.monitor.container_show;
- this.$refs.TFileStream.imgtupian = false;
- // }
- },
- // 工具栏的显示隐藏
- changehcfd(pare) {
- this.logs = "";
- this.newlog = "";
- if (this.statecustom == "1") {
- Message({
- type: "warning",
- message: "运行中不能点击",
- });
- } else {
- this.$refs.monitor.getwebsocket();
- this.$refs.TFileStream.imgtupian = false;
- this.$refs.monitor.container_show = pare;
- }
- },
- // 日志的文本框
- footerShows(evt) {
- if (evt == "claer") {
- this.logs = "";
- this.newlog = "";
- } else {
- this.footerShow = !this.footerShow;
- }
- },
- //日志
- getthislog(log,newoldSolver) {
- this.newlog =this.newlog + "\n" +log ;
- this.logs = this.newlog;
- let logs = this.logs;
- this.$nextTick(() => {
- let textarea=document.getElementById("textarea_id");
- textarea.scrollTop=textarea.scrollHeight;
- })
- if (logs.indexOf('Solver end') >= 0) {
- this.elodingfalse = false;
- this.isSolverEnd = true;
- this.statecustom = "0";
- }
- // if (endvew.includes("oldSolver end")){//newoldSolver.includes("oldSolver end"
- // this.statecustom = "0";
- // }
- },
- // 剩余时间
- restimeyear(time) {
- this.restime = time;
- },
- //开起loading
- loadingopen() {
- const loading = this.$loading({
- lock: true,
- text: "Loading",
- spinner: "el-icon-loading",
- background: "rgba(0, 0, 0, 0.7)",
- });
- return loading;
- },
- // 关闭lodind
- loadingend(loading) {
- loading.close();
- },
- startimg(action, action2) {
- let params = {
- transCode: "AFT001", // 服务器渲染实例接口创建推流
- pid: this.pid,
- solverConfigId: this.solverConfigid,
- action: action,
- paramJson: "",
- };
- this.loading = true;
- request(params)
- .then((res) => {
- if (res.returnCode == "000000000") {
- this.startimgloaddata(action2);
- } else {
- }
- })
- .catch((err) => {
- this.loadingend(this.loadingopen());
- });
- },
- startimgloaddata(action) {
- let that = this;
- let params = {
- transCode: "AFT001", // 服务器渲染实例接口创建推流
- pid: this.pid,
- solverConfigId: this.solverConfigid,
- action: action,
- paramJson: "",
- };
- this.loading = true;
- request(params)
- .then((res) => {})
- .catch((err) => {
- this.loadingend(this.loadingopen());
- });
- },
- // 心跳包
- reconnect() {
- var that = this;
- if (that.lockReconnect) return;
- that.lockReconnect = true;
- //没连接上会一直重连,设置延迟避免请求过多
- that.timeoutnum && clearTimeout(that.timeoutnum);
- that.timeoutnum = setTimeout(function () {
- //新连接
- that.initWebSocket();
- that.lockReconnect = false;
- }, 10000);
- },
- reset() {
- //重置心跳
- var that = this;
- clearTimeout(this.timeoutObj);
- clearTimeout(this.serverTimeoutObj);
- that.start();
- },
- start() {
- //开启心跳
- var self = this;
- self.timeoutObj && clearTimeout(self.timeoutObj);
- self.serverTimeoutObj && clearTimeout(self.serverTimeoutObj);
- self.timeoutObj = setTimeout(function () {
- //这里发送一个心跳,后端收到后,返回一个心跳消息
- if (self.websock.readyState == 1) {
- //如果连接正常
- self.websock.send("heartCheck");
- } else {
- //否则重连
- self.reconnect();
- }
- self.serverTimeoutObj = setTimeout(function () {
- // 超时关闭
- self.websock.close(); //如果onclose会执行reconnect,我们执行ws.close()就行了.如果直接执行reconnect 会触发onclose导致重连两次
- }, self.timeout);
- }, this.timeout);
- },
- // },
- // // 文件渲染websoket图片的渲染
- initWebSocket() {
- //初始化weosocket
- // const wsuri = "ws://192.168.0.43:8087//websocket?projectId="+this.pid;
- const wsuri =
- "ws://" +
- process.env.VUE_APP_BASE_websokt +
- "/websocket?projectId=" +
- this.pid;
- this.websock = new WebSocket(wsuri);
- this.websock.onmessage = this.websocketonmessage;
- this.websock.onopen = this.websocketonopen;
- this.websock.onerror = this.websocketonerror;
- this.websock.onclose = this.websocketclose;
- },
- websocketonopen(e) {
- //连接建立之后执行send方法发送数据
- // this.startimg("init",'loaddata');
- this.start();
- },
- websocketonerror() {
- //连接建立失败重连
- this.websock.close();
- this.reconnect();
- },
- websocketonmessage(e) {
- //数据接收
- this.reset();
- try {
- let eadata = e.data;
- if (eadata.indexOf("heartCheck") != -1) {
- } else if (JSON.parse(e.data).action == "animation") {
- let rdata = JSON.parse(e.data);
- let srtpnum = Number(rdata.step) / 10;
- if (this.selectval == "HCFDLab") {
- this.$refs.hcfd.percentage = srtpnum;
- } else {
- this.$refs.fem.percentage = srtpnum;
- }
- } else {
- // this.loadingopen();
- // let eadata=e.data
-
- var rdata = JSON.parse(e.data);
- console.log(rdata);
- if(rdata.action== "meshSplit"){
- this.logmatter=this.logmatter+"\n" +rdata.log
- this.logs=this.logmatter;
- this.$nextTick(() => {
- let textarea=document.getElementById("textarea_id");
- textarea.scrollTop=textarea.scrollHeight;
- })
- }else{
- this.loadingopen();
- if (rdata.hasOwnProperty("img")) {
- //this.loadingopen();
- this.$refs.TFileStream.imgtupian = true;
- this.$refs.TFileStream.fetchData(rdata, null);
- this.$refs.monitor.container_show = false;
- this.loadingend(this.loadingopen());
- }
-
- // HCFD云图的参数返回 存储
- let rdataparamJson = JSON.parse(rdata.paramJson);
- if (rdataparamJson.hasOwnProperty("Error")) {
- Message({
- type: "Error",
- message: "Error:" + rdataparamJson.Error,
- });
- this.loadingend(this.loadingopen());
- }
- if (this.selectval == "HCFDLab") {
- if (rdata.action == "ResultImport") {
- let data = JSON.parse(rdata.paramJson);
- if (data.msgType == "contour_param") {
- //sessionStorage.setItem("ytdata",JSON.stringify(data));
- this.$refs.hcfd.outlinedata(JSON.stringify(data));
- this.ytdata = rdata;
- }
- if (data.msgType == "line_param") {
- this.$refs.hcfd.outlinedata(JSON.stringify(data));
- }
- if (data.msgType == "vector_param") {
- sessionStorage.setItem("vectorparam", JSON.stringify(data));
- this.vectorparam = rdata;
- this.$refs.hcfd.vectordata(JSON.stringify(data));
- }
- if (data.msgType == "stream_param") {
- this.$refs.hcfd.streamdata(JSON.stringify(data));
- }
- if (data.msgType == "solidsurface_param") {
- }
- if (data.msgType == "animation_param") {
- this.$refs.hcfd.zoomanimation(JSON.stringify(data));
- }
- } else if (rdata.action == "LineDisplay") {
- this.ytdata = rdata;
- } else if (rdata.action == "SliceDisplayAdd") {
- let dataslicedisplay = JSON.parse(rdata.paramJson);
- if (
- dataslicedisplay == null ||
- JSON.stringify(dataslicedisplay) == "{}"
- ) {
- } else {
- if (dataslicedisplay.msgType == "addPage_slice_param") {
- sessionStorage.setItem(
- "dataslicedisplay",
- JSON.stringify(rdata.paramJson)
- );
- this.$refs.hcfd.addparam();
- }
- }
- } else if (rdata.action == "SliceDisplayUpdate") {
- let datadisplayupdate = JSON.parse(rdata.paramJson);
- if (
- datadisplayupdate == null ||
- JSON.stringify(datadisplayupdate) == "{}"
- ) {
- } else {
- sessionStorage.setItem(
- "updateparam",
- JSON.stringify(rdata.paramJson)
- );
- this.$refs.hcfd.updataparam();
- }
- } else {
- }
- } else if (this.selectval == "FEMLab(结构力学)") {
- if (rdata.action == "ResultImport") {
- let data = JSON.parse(rdata.paramJson);
- if (data.msgType == "contour_param") {
- this.$refs.fem.outlinedata(JSON.stringify(data));
- }
- if (data.msgType == "line_param") {
- this.$refs.fem.outlinedata(JSON.stringify(data));
- }
- if (data.msgType == "vector_param") {
- sessionStorage.setItem("vectorparam", JSON.stringify(data));
- this.vectorparam = rdata;
- }
- if (data.msgType == "stream_param") {
- this.$refs.fem.streamdata(JSON.stringify(data));
- }
- if (data.msgType == "solidsurface_param") {
- this.$refs.fem.colorval(JSON.stringify(data));
- }
- if (data.msgType == "animation_param") {
- this.$refs.fem.zoomanimation(JSON.stringify(data));
- }
- } else if (rdata.action == "LineDisplay") {
- this.ytdata = rdata;
- } else if (rdata.action == "SliceDisplayAdd") {
- let dataslicedisplay = JSON.parse(rdata.paramJson);
- if (
- dataslicedisplay == null ||
- JSON.stringify(dataslicedisplay) == "{}"
- ) {
- } else {
- if (dataslicedisplay.msgType == "addPage_slice_param") {
- sessionStorage.setItem(
- "dataslicedisplay",
- JSON.stringify(rdata.paramJson)
- );
- this.$refs.fem.femaddparam();
- }
- }
- } else if (rdata.action == "SliceDisplayUpdate") {
- let datadisplayupdate = JSON.parse(rdata.paramJson);
- if (
- datadisplayupdate == null ||
- JSON.stringify(datadisplayupdate) == "{}"
- ) {
- } else {
- this.$refs.fem.updataparam(JSON.stringify(rdata.paramJson));
- }
- } else {
- }
- } else {
- console.log(rdataparamJson);
- }
- return true;
- }
- }
- }catch (error) {
- // this.loadingend(this.loadingopen());
- return false;
- }
- },
- websocketsend(Data) {
- //数据发送
- this.websock.send(Data);
- },
- websocketclose(e) {
- //关闭
- ///this.websock.close();
- //this.loadingend(this.loadingopen());
- //this.reconnect();
- },
- getafl(action,paramJson){
- let that = this;
- let params = {
- transCode: "AFT001", // 服务器渲染实例接口创建推流
- pid: this.pid,
- solverConfigId: this.solverConfigid,
- action: action,
- paramJson: paramJson
- };
- request(params)
- .then((res) => {})
- .catch((err) => {
- // Message({
- // type: "info",
- // message: "请上传文件",
- // });
- });
- },
- handleNodeClick(data, checked, indeterminate){
- this.checkIdArr = this.$refs.tree.getCheckedKeys();
- if(this.checkIdArr.includes(12)){
- this.objcheck.pointsFlag=true;
- }else {
- this.objcheck.pointsFlag=false;
- }
- if(this.checkIdArr.includes(13)){
- this.objcheck.curvesFlag=true;
- }else{
- this.objcheck.curvesFlag=false;
- }
- if(this.checkIdArr.includes(14)){
- this.objcheck.surFacesFlag=true;
- }else {
- this.objcheck.surFacesFlag=false;
- }
- this.getafl('geometryFileShow',JSON.stringify(this.objcheck));
- },
- getCheckedNodes(obj,a){
- // console.log(this.$refs.tree.setCheckedKeys([3]))
- },
- // getMenuAllCheckedKeys(){
- // let checkedKeys=this.$refs.tree.getMenuAllCheckedKeys();
- // console.log(checkedKeys);
- // }
- },
- };
- </script>
- <style lang="scss">
- @import "@/styles/variables.scss";
- @import "@/styles/mixin.scss";
- .scal {
- .toolbar-part-detail {
- // background-color: #757070;
- .toolbar-content {
- padding: 5px;
- border-top: 1px solid #999;
- // border-bottom:1px solid #999;
- .imgcontent {
- display: flex;
- .item {
- padding-right: 5px;
- }
- }
- }
- }
- .toolmain {
- width: 100%;
- height: 32px;
- overflow: hidden;
- }
- html,
- body {
- width: 100%;
- height: 100%;
- }
- .el-tabs__content {
- padding: 0 5px;
- }
- .content {
- display: flex;
- height: 100%;
- position: relative;
- .left {
- width: 200px;
- height: 100%;
- flex-direction: column;
- padding: 15px;
- position: relative;
- height: calc(100vh - 179px);
- z-index: 10;
- }
- .part-panel-collapse-handle {
- position: absolute;
- // right: -56px;
- left: -38px;
- top: 44%;
- width: 94px;
- height: 0;
- cursor: pointer;
- text-align: center;
- border-width: 0 20px 18px;
- line-height: 18px;
- border-style: none solid solid;
- transform: rotateZ(90deg);
- font-size: 19px;
- }
- .lbg_color3 i:before {
- transform: rotateZ(0);
- }
- .right {
- padding: 0;
- flex: 1;
- // height: 100%;
- position: relative;
- }
- .imgcontent img {
- font-size: 16px;
- }
- .slide-fade-enter-active {
- transition: all 0.3s ease;
- }
- }
- .tablist {
- border-bottom: 1px solid #999;
- padding: 3px 0;
- }
- .tablist .tabitem {
- color: #b6b6b6;
- font-size: 16px;
- padding-right: 5px;
- cursor: pointer;
- &.current {
- color: #fff;
- }
- }
- .el-tabs--bottom .el-tabs__header.is-bottom {
- margin: 0;
- }
- .el-tabs__header {
- margin: 0;
- }
- .imgcontent {
- padding: 0 15px;
- }
- .el-tabs__item {
- height: 30px;
- line-height: 30px;
- padding: 0 8px;
- font-size: 12px;
- }
- // .imgzong{
- // display: flex;
- // padding-top: 4px;
- // flex-wrap:wrap;
- // .el-image{
- // width: 30px;
- // }
- // }
- .toolmain .imgzong .item1 {
- padding-right: 4px;
- padding: 0px 4px;
- }
- .imgzong .item1 {
- padding-right: 4px;
- padding: 4px 4px;
- }
- .shu {
- padding: 4px 10px;
- color: #666;
- }
- .el-tabs__item {
- height: 30px;
- line-height: 30px;
- padding: 0 6px;
- color: #b6b6b6;
- font-size: 15px;
- }
- }
- .maxh221 {
- max-height: calc(100vh - 76px);
- }
- .maxh400 {
- max-height: calc(100vh - 410px);
- }
- .beij-container {
- width: 100%;
- height: 100%;
- background-color: #fff;
- // background: linear-gradient(180deg, #ccd3e2 0%, rgba(255, 255, 255, 0) 100%);
- }
- .el-footer {
- padding: 0;
- height: 149px;
- overflow-y: auto;
- }
- .footerTitle {
- display: flex;
- justify-content: space-between;
- padding: 5px 20px;
- font-size: 20px;
- height: 25px !important;
- z-index: 99;
- }
- .footerTitle div {
- display: flex;
- justify-content: space-around;
- align-items: center;
- font-size: 14px;
- }
- .kongzhit{
- position: absolute;
- bottom: 0;
- width: 100%;
- }
- .footerTitle p {
- margin: 0;
- }
- .footerTitle span {
- padding: 5px 10px;
- cursor: default;
- }
- .femFooter {
- height: 160px !important;
- padding: 0;
- position: relative;
- }
- .footerText .el-textarea__inner {
- width: 100%;
- height: 160px !important;
- border: 0;
- font-size: 12px;
- color: #333;
- padding: 2px;
- padding-bottom: 20px;
- }
- </style>
- <style>
- /* .left {
- display: none;
- } */
- .selecr .el-form-item__label {
- line-height: 36px;
- }
- .item1 .el-image {
- width: 30px;
- cursor: pointer;
- }
- .el-tabs--border-card {
- background-color: none;
- }
- .baoshi {
- margin-top: 4px;
- color: #b6b6b6;
- }
- .el-tabs--border-card > .el-tabs__header .el-tabs__item.is-active {
- background-color: #757070;
- }
- .el-tabs--card > .el-tabs__header .el-tabs__item.is-active {
- border-top: 1px solid #757070;
- border-bottom: none;
- border-top: 1px solid transparent;
- }
- .part-panel-collapse-handle {
- border-color: transparent transparent #6f6f6f;
- }
- .el-dialog__header {
- padding: 15px 20px 10px;
- background: #757070;
- color: #fff;
- }
- .el-button--primary {
- background: #757070;
- border-color: #757070;
- }
- .textselsect {
- position: absolute;
- z-index: 9;
- top: 0;
- right: 7px;
- z-index: 9;
- height: 30px;
- overflow: hidden;
- }
- .dialoglocation {
- position: absolute;
- top: -15vh;
- }
- .el-dialog__wrapper {
- top: 15vh;
- }
- .el-tree,
- .dongtia {
- background: none;
- color: #b6b6b6;
- margin-top: 15px;
- }
- .itemimg1 {
- padding: 4px;
- }
- .itemimg1 .item1 .el-image {
- width: 20px;
- height: 20px;
- }
- /* .my-tree .el-tree-node__children .el-tree-node__content .el-checkbox{
- display: inline-block;
- } */
-
- /* .my-tree .el-tree-node__content label.el-checkbox,.my-tree .el-tree-node__children .el-checkbox .el-checkbox__inner,
- .my-tree .el-tree-node__content .el-checkbox .el-checkbox__inner
- {
- display: none;
- }
- .my-tree .el-tree-node__children label.el-checkbox{
- display: inline-block;
- margin-left: -17px;
- }
- .my-tree .el-tree-node__children label.el-checkbox {
- display: inline-block;
- margin-left: -5px;
- }
- .my-tree .el-tree-node__children .el-tree-node .is-leaf + .el-checkbox .el-checkbox__inner {
- display: inline-block;
- }
- .my-tree .el-checkbox .el-checkbox__inner{
- display: inline-block;
- } */
- .el-tree .el-tree-node .el-tree-node__children .el-tree-node:first-of-type .el-tree-node__children .el-tree-node .el-tree-node__content label.el-checkbox{
- display: inline-block;
- }
- </style>
- <style lang="scss" scoped>
- /deep/.my-tree {
- .el-tree-node__content label.el-checkbox {
- display: none;
- }
- .el-tree-node__children label.el-checkbox {
- margin-left: -5px;
- }
- .el-tree-node {
- .is-leaf + .el-checkbox .el-checkbox__inner {
- display: inline-block;
- }
- .el-checkbox .el-checkbox__inner {
- display: none;
- }
- }
- }
- /deep/.toolbar-part-detail {
- position: relative;
- }
- .el-form-item {
- margin-bottom: 5px;
- }
- /deep/.left .el-tabs__item {
- padding: 0 19.4px !important;
- // box-shadow: 0 8px 0 0 #479a48,0 10px 5px 0 rgba(0,0,0,0.5);
- box-shadow: 0 10px 5px 0 rgba(0, 0, 0, 0.2);
- }
- /deep/.left .is-scrollable {
- padding: 0;
- }
- /deep/ .left .el-tabs__nav-next,
- .left .el-tabs__nav-prev {
- display: none;
- }
- /deep/ .left .el-tabs__nav-prev {
- display: none;
- }
- // /deep/ .el-radio+.el-radio{
- // margin: 0;
- // }
- // /deep/ .el-checkbox+.el-checkbox{
- // margin: 0;
- // }
- /deep/.leftsearch .el-button {
- background-color: #fff;
- }
- </style>
|