In03.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768
  1. <template>
  2. <!--这是印花模块的模块展示内容-->
  3. <div for="IN03" id="top" class="top top03" @click="switchIndex">
  4. <div title="返回主视图"
  5. style="cursor: pointer;position: absolute;right: 40px;top: 32px;height: 38px;width: 38px;text-align: center;"
  6. @click.stop="backMasterViewByFac"><img src="../../assets/image/view.png"></div>
  7. </div>
  8. <div class="bg20"></div>
  9. <template v-if="showIndexData=='index'">
  10. <div class="abs" style="left:50%;top:10%;width: 210px;margin-left:-105px;text-align: center;">
  11. <div>请选择要查看的产线</div>
  12. <div class="cx">
  13. <span @click="switchCX(item.index)" :class="item.active?'btn active':'btn'" v-for="item in cxList" :style="{backgroundImage: item.active?`url(${btnFrontBg})`:''}">{{ item.name }}</span>
  14. <div @click="switchCX(0)" :class="currentCXNo==0?'btn active':'btn'" :style="{width:'94%', backgroundImage: currentCXNo==0 ?`url(${btnFrontBg})`:''}">全部</div>
  15. </div>
  16. </div>
  17. <div class="abs title_row" style="left: 3%;top:6%;font-weight: normal;">
  18. <div class="title_left_line"></div><span>产线状态</span><span style="color:#27e6ff">(今日)</span>
  19. </div>
  20. <div class="abs data_row" style="left: 3%;top:8%;font-weight: normal;">
  21. <div style="margin-left: 10px;"><table cellspacing="0">
  22. <tbody>
  23. <tr style="background-color:transparent">
  24. <td style="border:0">
  25. <div class="littleFont">产线<span style="color:#27e6ff">(开动)</span></div>
  26. <div style="font-size: 32px;">{{ deviceStatData.status.openProd||'-' }}<span style="font-size: 12px;">条</span></div>
  27. </td>
  28. <td style="border:0;padding-left: 40px;">
  29. <div class="littleFont">设备<span style="color:#27e6ff">(开机)</span></div>
  30. <div style="font-size:24px;height: 38px;line-height: 48px;color: #27e6ff;">{{ deviceStatData.status.open||'-' }}<span style="font-size: 12px;"> 台</span></div>
  31. </td>
  32. <td style="border:0;padding-left: 40px;">
  33. <div class="littleFont">设备<span style="color:#27e6ff">(总数)</span></div>
  34. <div style="font-size:24px;height: 38px;line-height: 48px;color: #27e6ff;">{{ deviceStatData.status.total||'-' }}<span style="font-size: 12px;"> 台</span></div>
  35. </td>
  36. </tr>
  37. </tbody>
  38. </table></div>
  39. </div>
  40. <div class="abs title_row" style="left: auto;top:6%;font-weight: normal;right: 14%;"><div class="title_left_line"></div><span>生产情况</span><span style="color:#27e6ff">(今日)</span></div>
  41. <div class="abs data_row" style="left: auto;top:8%;font-weight: normal;right: 3%;">
  42. <div style="margin-left: 10px;"><table cellspacing="0">
  43. <tbody>
  44. <tr style="background-color:transparent">
  45. <td style="border:0">
  46. <div class="littleFont">白坯<span style="color:#27e6ff">(投放量)</span></div>
  47. <div style="font-size: 32px;">{{ deviceStatData.status.baiPei||'-' }}<span style="font-size: 12px;">米</span></div>
  48. </td>
  49. <td style="border:0;padding-left: 40px;">
  50. <div class="littleFont">产量<span style="color:#27e6ff">(米数)</span></div>
  51. <div style="font-size:24px;height: 38px;line-height: 48px;color: #27e6ff;">{{ deviceStatData.status.length||'-' }}<span style="font-size: 12px;"> 米</span></div>
  52. </td>
  53. <td style="border:0;padding-left: 40px;">
  54. <div class="littleFont">产量<span style="color:#27e6ff">(重量)</span></div>
  55. <div style="font-size:24px;height: 38px;line-height: 48px;color: #27e6ff;">{{ deviceStatData.status.weight||'-' }}<span style="font-size: 12px;"> 吨</span></div>
  56. </td>
  57. </tr>
  58. </tbody>
  59. </table></div>
  60. </div>
  61. <div class="abs bottompanel">
  62. <div style="width: 15%;height:calc(184px*var(--hRate));display: flex;">
  63. <div style="width: 70%;height: 100%;border-right: 1px solid #1a7c90;">
  64. <div class="title_row" style="font-weight: normal;margin-top: 10px;"><span style="font-size: 48px;letter-spacing: 5px;margin-right: 20%;">{{currentCXNo==0?'全部':currentCXNo+'号'}}</span><span style="color:#fff;line-height: 48px;">产线</span></div>
  65. <div style="padding-left: 5px;color: #27e6ff;margin-top: calc(52px*var(--hRate));width: 88%;">
  66. <div style="color: #fff;"><span>开机数</span><span style="float: right;">总数</span></div>
  67. <div style="font-size: 22px;margin-top: calc(16px*var(--hRate));"><span>{{ effInfo.open }}<span class="littleFont">台</span></span>
  68. <span style="float: right;">{{ effInfo.total }}<span class="littleFont">台</span></span>
  69. </div>
  70. <div style="position: relative;margin-top: calc(16px*var(--hRate));">
  71. <div class="abs fac_progress_value" :style="{width:(effInfo.open/effInfo.total*100)+'%'}"></div>
  72. <div class="abs fac_progress" style="background-color: #5f686e;"></div>
  73. </div>
  74. </div>
  75. </div>
  76. <div style="width: 30%;height: 100%;margin-left: 4%;">
  77. <div style="color: #fff;"><span>单位能耗</span></div>
  78. <div style="font-size: 22px;margin-top: calc(16px*var(--hRate));;color: red;">
  79. <span>{{ effInfo.energy }}<span class="littleFont">元/米</span></span>
  80. </div>
  81. <div style="color: #fff;margin-top: calc(26px*var(--hRate));"><span>开机率</span></div>
  82. <div style="font-size: 22px;margin-top: calc(16px*var(--hRate));color:#27e6ff ;">
  83. <span>{{ effInfo.ratio }}<span class="littleFont">%</span></span>
  84. </div>
  85. </div>
  86. </div>
  87. <div :style="{width: '26%',marginLeft:'1%',marginRight: isFullScreen?'2%':'0'}">
  88. <div class="title_row" style="font-weight: normal;line-height: 30px;"><div class="title_left_line" style="margin-top: 7px;"></div><span>生产效率</span><span style="color:#27e6ff">(今日)</span></div>
  89. <div class="data_row scxl_block">
  90. <div :style="{padding: '10px',width: isFullScreen?'96%':'89%'}"><table cellspacing="0" style="width: 100%;font-size: 14px;text-align: center;">
  91. <thead>
  92. <tr style="font-weight:normal;color: #1fc1d7;background-color: #2dbcd436;">
  93. <td style="border:0">班组</td>
  94. <td style="border:0">生产时间(H)</td>
  95. <td style="border:0">已生产数(米)</td>
  96. <td style="border:0">总重量(吨)</td>
  97. <td style="border:0">稼动率(%)</td>
  98. </tr>
  99. </thead>
  100. <tbody>
  101. <tr style="font-weight:normal;background-color:transparent;color: #ffffff;font-size: 14px;">
  102. <td style="border:0">A班</td>
  103. <td style="border:0">{{ effInfo.timeA ||'-' }}</td>
  104. <td style="border:0">{{ effInfo.lengthA ||'-' }}</td>
  105. <td style="border:0">{{ effInfo.weightA ||'-' }}</td>
  106. <td style="border:0">{{ (effInfo.effA*100).toFixed(0) ||'-' }}%</td>
  107. </tr>
  108. <tr style="font-weight:normal;background-color:transparent;color: #ffffff;background-color: #2dbcd436;font-size: 14px;">
  109. <td style="border:0">B班</td>
  110. <td style="border:0">{{ effInfo.timeB ||'-' }}</td>
  111. <td style="border:0">{{ effInfo.lengthB ||'-' }}</td>
  112. <td style="border:0">{{ effInfo.weightB ||'-' }}</td>
  113. <td style="border:0">{{ (effInfo.effB*100).toFixed(0) ||'-' }}%</td>
  114. </tr>
  115. </tbody>
  116. </table>
  117. <div style="width: 100%;display: flex;margin-top: calc(42px*var(--hRate));font-size: 14px;justify-content: center;text-align: center;" >
  118. <div style="width: 50%;">
  119. <div style="color: #fff;"><span>米数</span></div>
  120. <div style="font-size: 22px;color:#27e6ff">
  121. <span>{{ effInfo.length }}<span class="littleFont">米</span></span>
  122. </div>
  123. </div>
  124. <div style="width: 50%;">
  125. <div style="color: #fff;"><span>重量</span></div>
  126. <div style="font-size: 22px;color:#27e6ff">
  127. <span>{{ effInfo.weight }}<span class="littleFont">吨</span></span>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. <div style="width: 26%;margin-right: 2%;">
  135. <div class="title_row" style="line-height: 30px;"><div class="title_left_line" style="margin-top: 7px;"></div>
  136. <span>生产趋势</span><span style="color:#27e6ff">(30天)</span>
  137. <span style="margin-left: auto !important;">
  138. <span :class="buttonCode1=='Length'?'fac_btn active':'fac_btn'" @click="LoadSCLine('Length')">米数</span>
  139. <span :class="buttonCode1=='Weight'?'fac_btn active':'fac_btn'" @click="LoadSCLine('Weight')">重量</span>
  140. </span>
  141. </div>
  142. <div :class="isFullScreen?'data_row sc_qushi_block_full':'data_row sc_qushi_block'" ref="echarts_sc_qushi"></div>
  143. </div>
  144. <div style="width: 26%;">
  145. <div class="title_row" style="line-height: 30px;"><div class="title_left_line" style="margin-top: 7px;"></div>
  146. <span>能耗趋势</span><span style="color:#27e6ff">(30天)</span>
  147. <span style="margin-left: auto !important;">
  148. <span :class="buttonCode2=='price'?'fac_btn active':'fac_btn'" @click="LoadUsedLine('price')">折算</span>
  149. <span :class="buttonCode2=='electricity'?'fac_btn active':'fac_btn'" @click="LoadUsedLine('electricity')">电</span>
  150. <span :class="buttonCode2=='steam'?'fac_btn active':'fac_btn'" @click="LoadUsedLine('steam')">气</span>
  151. <span :class="buttonCode2=='water'?'fac_btn active':'fac_btn'" @click="LoadUsedLine('water')">水</span>
  152. </span>
  153. </div>
  154. <div :class="isFullScreen?'data_row used_qushi_block_full':'data_row used_qushi_block'" ref="echarts_used_qushi"></div>
  155. </div>
  156. </div>
  157. </template>
  158. </template>
  159. <script>
  160. import { ref ,watch,onUnmounted,onMounted} from 'vue';
  161. import {useRouter} from 'vue-router';
  162. import api from "@/api/system";
  163. import * as echarts from 'echarts';
  164. export default {
  165. props:{
  166. clickEvent:{
  167. type:Object,
  168. required: true,
  169. default:{}
  170. },
  171. in03ModelLoadState:{
  172. type:Boolean
  173. },
  174. userTimeout:{
  175. type:Boolean
  176. },
  177. userRole:{
  178. type:String
  179. }
  180. },
  181. setup(props,{emit}) {
  182. const router = useRouter();
  183. let lines={};
  184. let oldLineState={};
  185. let deviceStatData=ref({'status':{},'eff':[]});
  186. const effInfo = ref({});
  187. const dataTypeUnit={
  188. 'Length':'米',
  189. 'Weight':'吨',
  190. 'price':'元/米',
  191. 'electricity':'kwh',
  192. 'steam':'GJ',
  193. 'water':'m³',
  194. };
  195. let updateLineStateTimer = null;
  196. const showIndexData=ref('');
  197. const currentCXNo = ref(0);
  198. const buttonCode1=ref('');
  199. const buttonCode2 = ref('');
  200. const echarts_sc_qushi = ref(null);
  201. const echarts_used_qushi = ref(null);
  202. let echartsEleIns_1=null;
  203. let echartsEleIns_0=null;
  204. const isFullScreen = ref(false); //是否全屏模式
  205. let getDataTimer = null;
  206. const cxList=ref([
  207. {"name":1,active:false,index:1},
  208. {"name":2,active:false,index:2},
  209. {"name":3,active:false,index:3},
  210. {"name":4,active:false,index:4},
  211. {"name":5,active:false,index:5},
  212. {"name":6,active:false,index:6},
  213. {"name":7,active:false,index:7},
  214. {"name":8,active:false,index:8},
  215. ])
  216. const btnFrontBg = require('@/assets/image/nav_btn_front.png');
  217. watch(() => props.clickEvent, newVal=> {
  218. if(newVal==null){
  219. return;
  220. }
  221. //console.log('印花模型点击:',newVal)
  222. },{deep:true,immediate:true})
  223. watch(() => props.in03ModelLoadState, newVal=> {
  224. if(newVal){
  225. console.log('印花模型加载状态:',newVal)
  226. clearTimeout(getDataTimer);
  227. setTimeout(() => {
  228. DataFull.GetData();
  229. init();
  230. }, 1000);
  231. }
  232. },{deep:true,immediate:true})
  233. watch(() => props.userTimeout, newVal=> {
  234. console.log('userTimeout value:',newVal)
  235. if(newVal){
  236. //if (!AutoPlayer.value && window.CurrentTargetType=='IN02') switchAutoPlayer(); //开启自动漫游
  237. }
  238. },{deep:true,immediate:true})
  239. watch(() => props.userRole, newVal=> {
  240. showIndexData.value = newVal;
  241. },{deep:true,immediate:true})
  242. let DataFull={
  243. GetData:function(){
  244. getDataTimer = setTimeout(function () {
  245. //每1分钟主动查询一次数据
  246. DataFull.GetData();
  247. }, 60*1000);
  248. api.Get03Data().then((res)=>{
  249. if(window.CurrentTargetType!='IN03') return;
  250. if (res == null || player.Native==null) {
  251. return
  252. }
  253. if(res.code!=200){
  254. return;
  255. }
  256. deviceStatData.value = res.data;
  257. effInfo.value = res.data.eff[currentCXNo.value]; //产线信息
  258. LoadSCLine('Length');
  259. LoadUsedLine('price');
  260. });
  261. }
  262. }
  263. async function init(){
  264. backMasterViewByFac();
  265. if(window.LINELIST==null){
  266. var rootItem = await player.Native.ModelTree.getRootItems();
  267. var rootObj=null;
  268. for (var i = 0; i < rootItem.length; i++) {
  269. if(rootItem[i].name=="T_03"){
  270. rootObj = rootItem[i]
  271. break;
  272. }
  273. }
  274. if(rootObj==null){
  275. console.log('未找到该模型的根节点')
  276. window.location.reload();
  277. return;
  278. }
  279. var items = await player.Native.ModelTree.getSubItems(rootObj.item)
  280. if(items.length==1 && items[0].name=='RootNode') rootObj = items[0];
  281. //获取产线列表
  282. items = await player.Native.ModelTree.getSubItems(rootObj.item);
  283. items.forEach(ele=>{
  284. if(ele.name.indexOf('#线')>-1) lines[ele.name] = ele.item;
  285. })
  286. window.LINELIST = lines;
  287. }
  288. updateLineState();
  289. if(window.IN03Markers==null){
  290. window.IN03Markers = [];
  291. //初始化产线名称标记
  292. var rootItem = await player.Native.ModelTree.getRootItems();
  293. var rootObj=null;
  294. for (var i = 0; i < rootItem.length; i++) {
  295. if(rootItem[i].name=="T_03"){
  296. rootObj = rootItem[i]
  297. break;
  298. }
  299. }
  300. if(rootObj==null){
  301. console.log('未找到该模型的根节点')
  302. return;
  303. }
  304. return;
  305. let t1 = new Date().getTime();
  306. var items = await player.Native.ModelTree.getSubItems(rootObj.item)
  307. if(items.length==1 && items[0].name=='RootNode') rootObj = items[0];
  308. //获取产线列表
  309. items = await player.Native.ModelTree.getSubItems(rootObj.item);
  310. let markersDef = IN345MARKERS['IN03'];
  311. for(let i=0; i<items.length; i++){
  312. if(items[i].name.indexOf('#线')==-1) continue;
  313. let curLineDef = markersDef[items[i].name];
  314. if(curLineDef==null ||curLineDef.length==0) continue;
  315. var findName = curLineDef[curLineDef.length-1];
  316. let object = await player.Native.ModelTree.findItemByName(findName, items[i].item,true,3);
  317. if( object!=null ){
  318. var xyz = await player.Native.ModelTree.getItemShapeInfo(object.item);
  319. var xyz2 = [(xyz.aabb[0][0]) , (xyz.aabb[0][1] ) , (xyz.aabb[0][2]) ];
  320. // 创建设备编号标记
  321. var options = {
  322. "text": items[i].name,
  323. "visible": true,
  324. //"maxLod": 110,
  325. //"minLod": 0.1,
  326. "textFontSize": 15,
  327. "textColor": parseInt("0x000fffff"),
  328. "userData":"IN03"
  329. };
  330. options.pos = [xyz2[0]-7, xyz2[1]+2, 15]
  331. var markPtr = await player.Native.GisMarker.create(options);
  332. player.Native.GisMarker.update(markPtr, options);
  333. window.IN03Markers.push(markPtr);
  334. }
  335. }
  336. console.log('--------创建标记总耗时:',new Date().getTime()-t1)
  337. }
  338. }
  339. //更新产线状态颜色
  340. async function updateLineState(){
  341. updateLineStateTimer = setTimeout(() => {
  342. updateLineState();
  343. }, 1000*60);
  344. if(window.LINELIST==null || player==null || player.Native==null) return;
  345. for(let name in window.LINELIST){
  346. if(oldLineState[name]==window.IN345LINE[name]) continue;
  347. if(!window.IN345LINE[name]){
  348. //产线未开
  349. await player.Native.ModelTree.setItemColor(window.LINELIST[name], parseInt("0x666666ff"), true)
  350. }else{
  351. //await player.Native.ModelTree.restoreItemColor(window.LINELIST[name]);//这句有BUG,会导致API调用失败,重而导致ws断开国家利益.暂时不用
  352. }
  353. }
  354. oldLineState = JSON.parse(JSON.stringify(window.IN345LINE));
  355. }
  356. function switchIndex(){
  357. if(showIndexData.value=='index'){
  358. router.push('/datamain');
  359. }else{
  360. router.push('/main');
  361. }
  362. }
  363. function switchCX(ind){
  364. currentCXNo.value = ind;
  365. let tmp=cxList.value;
  366. for (let index = 0; index < tmp.length; index++) {
  367. const element = tmp[index];
  368. if(element.index==ind) tmp[index].active = true;
  369. else tmp[index].active = false;
  370. }
  371. cxList.value = tmp;
  372. if(ind==0){
  373. emit('OpenIframeWin',{class:'newwin in03Win',src:'/in03-all-data',title:'染整段(产线数据)'});
  374. }
  375. effInfo.value = deviceStatData.value.eff[ind]; //产线信息
  376. LoadSCLine(buttonCode1.value);
  377. LoadUsedLine(buttonCode2.value);
  378. }
  379. function LoadSCLine(dataType) {
  380. buttonCode1.value = dataType;
  381. let data = deviceStatData.value.prodTrade;
  382. //生产趋势
  383. //获取数据中weight、aweight、bweight
  384. var t = echarts_sc_qushi.value;
  385. var dataLine = [];
  386. var times = [];
  387. var v_series = [];
  388. for (var i = 0; i < data.length; i++) {
  389. var tv = data[i]['date'];
  390. times.push([tv,data[i].tips]);
  391. let line = data[i].line[currentCXNo.value];
  392. if(dataType=='Length'){
  393. dataLine.push({value:line['length'],type:'Length'});
  394. }else{
  395. dataLine.push({value:line['weight'],type:'Weight'});
  396. }
  397. }
  398. if (dataLine.length == 0) {
  399. return
  400. }
  401. v_series.push({
  402. name: currentCXNo.value==0?"全部产线":currentCXNo.value+'号产线', type: 'line', //symbol: 'none',
  403. data: dataLine,
  404. itemStyle: {
  405. normal: {
  406. color: '#fbc16b', // 这里设置折线的颜色
  407. lineStyle: {
  408. color: '#fbc16b' // 这里同时设置线头的颜色
  409. }
  410. }
  411. }
  412. });
  413. var opt = {
  414. title: {
  415. show: false, //不显示标题
  416. text: '',
  417. textStyle: {
  418. color: "rgb(89, 151, 229)",
  419. fontWeight: "bold"
  420. },
  421. top: "0px",
  422. left: "30px"
  423. },
  424. legend: {
  425. show: true, //不显示图例
  426. inactiveColor: "#04417A",
  427. data: "",
  428. icon:"circle",
  429. textStyle: {color: "#fff"},
  430. top: "5",
  431. left: "10px",
  432. },
  433. tooltip: {
  434. trigger: 'axis',
  435. backgroundColor: '#fff',
  436. textStyle: {
  437. color: '#5c6c7c'
  438. },
  439. padding: [10, 10],
  440. extraCssText: 'box-shadow: 1px 0 2px 0 rgba(163,163,163,0.5)',
  441. formatter: function (params) {
  442. let xv='';
  443. let result = '';
  444. params.forEach(function (item) {
  445. xv=`${item.name}`;
  446. xv = xv.split(',')[1]+'<br>';
  447. result += ` ${item.marker} ${item.seriesName}: ${item.value}(`+dataTypeUnit[item.data.type]+`)<br/>`;
  448. });
  449. return xv+result;
  450. }
  451. },
  452. grid: {
  453. left: '5%',
  454. right: '5%',
  455. bottom: '0',
  456. top: '15%',
  457. containLabel: true
  458. },
  459. xAxis: {
  460. type: 'category',
  461. boundaryGap: true,
  462. axisLabel: {
  463. rotate: 45,
  464. color: "#26e2fb",
  465. formatter:function(v){
  466. return v.split(',')[0]
  467. }
  468. },
  469. axisTick:{
  470. show:false
  471. },
  472. data: times
  473. },
  474. yAxis: {
  475. type: 'value',
  476. nameTextStyle: {
  477. color: "#26e2fb"
  478. },
  479. axisLine:{
  480. show:true
  481. },
  482. axisLabel: {
  483. color: "#26e2fb"
  484. },
  485. splitLine: {
  486. lineStyle: {
  487. color: "#7DA7CD",
  488. type: "dashed",
  489. width: 1
  490. }
  491. }
  492. },
  493. series: v_series
  494. };
  495. if(echartsEleIns_1!=null){
  496. echartsEleIns_1.dispose();
  497. }
  498. echartsEleIns_1 = echarts.init(t);
  499. echartsEleIns_1.setOption(opt);
  500. }
  501. function LoadUsedLine(dataType){
  502. buttonCode2.value = dataType;
  503. let data = deviceStatData.value.energyTrade;
  504. //能耗趋势
  505. var t = echarts_used_qushi.value;
  506. var times = [];
  507. var v_series = [];
  508. var week_aefficiency = [];
  509. for (var i = 0; i < data.length; i++) {
  510. times.push([data[i]['date'],data[i].tips]);
  511. let line = data[i].line[currentCXNo.value];
  512. if(line[dataType]!=null) week_aefficiency.push({value:line[dataType],type:dataType});
  513. }
  514. if (week_aefficiency.length> 0) {
  515. v_series.push({
  516. name: currentCXNo.value==0?"全部产线":currentCXNo.value+'号产线', type: 'line', //symbol: 'none',
  517. data: week_aefficiency,
  518. symbol: 'circle', // 使用圆作为折点标记
  519. symbolSize: 6,
  520. itemStyle: {
  521. normal: {
  522. color: '#fbc16b', // 这里设置折线的颜色
  523. lineStyle: {
  524. color: '#fbc16b' // 这里同时设置线头的颜色
  525. }
  526. }
  527. },
  528. });
  529. }
  530. var opt = {
  531. title: {
  532. show: false, //不显示标题
  533. text: '',
  534. textStyle: {
  535. color: "rgb(89, 151, 229)",
  536. fontWeight: "bold"
  537. },
  538. top: "0px",
  539. left: "30px"
  540. },
  541. tooltip: {
  542. trigger: 'axis',
  543. formatter: function (params) {
  544. let xv='';
  545. let result = '';
  546. params.forEach(function (item) {
  547. xv=`${item.name}`;
  548. xv = xv.split(',')[1]+'<br>';
  549. result += ` ${item.marker} ${item.seriesName}: ${item.value}(`+dataTypeUnit[item.data.type]+`)<br/>`;
  550. });
  551. return xv+result;
  552. }
  553. },
  554. legend: {
  555. show: true, //不显示图例
  556. inactiveColor: "#04417A",
  557. data: "",
  558. textStyle: {color: "#fff"},
  559. top: "5",
  560. left:"10px",
  561. icon:"circle",
  562. },
  563. grid: {
  564. left: '3%',
  565. right: '1%',
  566. bottom: '0',
  567. top: '15%',
  568. containLabel: true
  569. },
  570. xAxis: {
  571. type: 'category',
  572. boundaryGap: false,
  573. axisLabel: {
  574. rotate: 45,
  575. color: "#26e2fb",
  576. formatter:function(v){
  577. return v.split(',')[0]
  578. }
  579. },
  580. axisLine:{
  581. show:true
  582. },
  583. axisTick:{
  584. show:false,
  585. },
  586. data: times
  587. },
  588. yAxis: {
  589. type: 'value',
  590. nameTextStyle: {
  591. color: "#26e2fb"
  592. },
  593. axisLine:{
  594. show:true
  595. },
  596. axisTick:{
  597. show:false,
  598. },
  599. axisLabel: {
  600. color: "#26e2fb"
  601. },
  602. splitLine: {
  603. lineStyle: {
  604. color: "#7DA7CD",
  605. type: "dashed",
  606. width: 1
  607. }
  608. }
  609. },
  610. series: v_series
  611. };
  612. if(echartsEleIns_0!=null){
  613. echartsEleIns_0.dispose();
  614. }
  615. echartsEleIns_0 = echarts.init(t);
  616. echartsEleIns_0.setOption(opt);
  617. }
  618. function backMasterViewByFac(){
  619. if(player==null || player.Native==null) return;
  620. if(BODY_H_RATE>0.9){
  621. //全屏模式下的视角
  622. player.Native.Camera.moveTo([-91.64839019242504, -186.23753805841608, 166.78946395819892],
  623. [-90.82528929434541, 136.7362546068112, -54.52457853422797],
  624. [0.0014405644117746175, 0.5652582237894268, 0.8249127621831281], 1);
  625. }else{
  626. //非全屏模式下的视角
  627. player.Native.Camera.moveTo([-90.4534875451608, -201.60779996809177, 156.1529830648182],
  628. [-89.63620356422999, 119.08351214395233, -52.22443982968761],
  629. [0.001388561848385436, 0.544853112866498, 0.838530355619688], 1);
  630. }
  631. // 使用异步函数
  632. (async () => {
  633. setTimeout(function() {
  634. player.Native.Camera.setAnchorPos([-80.69618225097656,21.59876251220703,11.815500259399414]);
  635. }, 3000);
  636. })();
  637. }
  638. onMounted(()=>{
  639. if(BODY_H_RATE>0.9) isFullScreen.value=true;
  640. else isFullScreen.value=false;
  641. oldLineState = window.IN345LINE;//初始化产线初始状态
  642. })
  643. onUnmounted(()=>{
  644. clearTimeout(getDataTimer);
  645. clearTimeout(updateLineStateTimer);
  646. if(player!=null && player.Native!=null && window.IN03Markers!=null){
  647. window.IN03Markers.forEach(async ele=>{
  648. await player.Native.GisMarker.destroy(ele);
  649. })
  650. }
  651. window.IN03Markers=null;
  652. })
  653. return{
  654. switchIndex,
  655. echarts_sc_qushi,
  656. echarts_used_qushi,
  657. showIndexData,
  658. deviceStatData,
  659. effInfo,
  660. btnFrontBg,
  661. cxList,
  662. currentCXNo,
  663. switchCX,
  664. buttonCode1,
  665. buttonCode2,
  666. isFullScreen,
  667. LoadUsedLine,
  668. LoadSCLine,
  669. backMasterViewByFac,
  670. }
  671. }
  672. }
  673. </script>
  674. <style scope="IN03">
  675. .bg20{
  676. z-index: 1; pointer-events: none;position: absolute;
  677. top: calc(22px * var(--hRate));
  678. left: 0;
  679. width: 1877.54px;
  680. height: 96%;
  681. margin-left: 19px;
  682. border: 2px solid #17666e;
  683. border-top: 0px;
  684. background:url('../../assets/image/bg.png');
  685. -webkit-mask-image: linear-gradient(to top, #0b313de5 10%, transparent 20%,transparent 50%, #0b313de5 100%);
  686. mask-image: linear-gradient(to top, #0b313de5 10%,transparent 20%,transparent 50%, #0b313de5 100%);
  687. /*
  688. background:url('../../assets/image/000.png');
  689. -webkit-mask-image:radial-gradient(circle, transparent 26%, #95afc5 54%);
  690. background:
  691. repeating-linear-gradient(
  692. 45deg,
  693. #ccc 0, #ccc 10px,
  694. transparent 10px, transparent 20px
  695. ),
  696. repeating-linear-gradient(
  697. -45deg,
  698. #ccc 0, #ccc 10px,
  699. transparent 10px, transparent 20px
  700. );
  701. background-size: 20px 20px;
  702. */
  703. }
  704. .bottompanel{
  705. display: flex;
  706. left: 3% !important;
  707. top: calc(728px * var(--hRate)) !important;
  708. width: 96%;
  709. height: calc(360px * var(--hRate));
  710. }
  711. .cx{
  712. width: 100%;
  713. margin-top: 20px;
  714. height: 110px;
  715. color: #27e6ff;
  716. font-size: 16px;
  717. }
  718. .cx .btn{
  719. width: 40px;
  720. height: 40px;
  721. border: 1px solid #008899;
  722. line-height: 40px;
  723. text-align: center;
  724. display: inline-block;
  725. float: left;
  726. margin: 5px;
  727. border-radius: 5px;
  728. cursor: pointer;
  729. background-size: cover;
  730. background-repeat: no-repeat;
  731. background-position: center;
  732. }
  733. .cx .btn:hover,.cx .btn.active{
  734. color: #ffffff;
  735. border-color: #0cd7f0 !important;
  736. }
  737. .scxl_block{
  738. font-weight: normal;
  739. background-image: url('../../assets/image/t03_sc_bg.png');
  740. height: calc(250px*var(--hRate));
  741. width: auto;
  742. background-size: contain;
  743. background-repeat: no-repeat;
  744. font-weight: normal !important;
  745. }
  746. .used_qushi_block,.sc_qushi_block{
  747. height: calc(250px*var(--hRate));
  748. width: 100%;
  749. border: 1px solid #008899;
  750. background: rgb(0 85 102 / 40%);
  751. }
  752. .used_qushi_block_full,.sc_qushi_block_full{
  753. height: calc(230px*var(--hRate));
  754. width: 100%;
  755. border: 1px solid #008899;
  756. background: rgb(0 85 102 / 40%);
  757. }
  758. </style>