Fac.vue 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195
  1. <template>
  2. <!--这是全厂模块的模块展示内容-->
  3. <div for="FAC" id="top" class="top topfac">
  4. <div title="返回主视图"
  5. style="cursor: pointer;position: absolute;right: 40px;top: 25px;height: 38px;width: 38px;text-align: center;"
  6. @click="backMasterViewByFac"><img src="../../assets/image/view.png"></div>
  7. </div>
  8. <div class="bg1"></div>
  9. <div class="abs leftPanel">
  10. <div class="title_row"><div class="title_left_line"></div><span>平均值</span><span style="color:#27e6ff">(本月)</span></div>
  11. <div class="data_row"><img src="../../assets/image/icon_00.png">
  12. <div style="margin-left: 10px;"><table>
  13. <tbody>
  14. <tr style="background-color:transparent">
  15. <td style="border:0">
  16. <div class="littleFont">成本<span style="color:#27e6ff">(总能耗)</span></div>
  17. <div style="font-size: 32px;font-weight: bold;">{{ deviceStatData.avgMonth.costTotal }}<span style="font-size: 12px;"> 元/日</span></div>
  18. </td>
  19. <td style="border:0;padding-left: 40px;">
  20. <div class="littleFont">经编<span style="color:#27e6ff">(单位能耗)</span></div>
  21. <div style="font-size:24px;font-weight:bold;height: 38px;line-height: 48px;color: #fbc16b;">{{ deviceStatData.avgMonth.costJb }}<span style="font-size: 12px;"> 元/米</span></div>
  22. </td>
  23. <td style="border:0;padding-left: 40px;">
  24. <div class="littleFont">染整<span style="color:#27e6ff">(单位能耗)</span></div>
  25. <div style="font-size:24px;font-weight:bold;height: 38px;line-height: 48px;color: #fbc16b;">{{ deviceStatData.avgMonth.costRz }}<span style="font-size: 12px;"> 元/米</span></div>
  26. </td>
  27. <td style="border-bottom: 0;border-right: 1px solid #146c86;padding-left: 20px;">&nbsp;</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;font-weight:bold;height: 38px;line-height: 48px;color: #27e6ff;">{{ deviceStatData.avgMonth.yieldJb }}<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;font-weight:bold;height: 38px;line-height: 48px;color: #27e6ff;">{{ deviceStatData.avgMonth.jdl }}<span style="font-size: 12px;"> %</span></div>
  35. </td>
  36. <td style="border:0;padding-left: 40px;">
  37. <div class="littleFont">染整<span style="color:#27e6ff">(产出)</span></div>
  38. <div style="font-size:24px;font-weight:bold;height: 38px;line-height: 48px;color: #27e6ff;">{{ deviceStatData.avgMonth.yieldRz }}<span style="font-size: 12px;"> 米/日</span></div>
  39. </td>
  40. </tr>
  41. </tbody>
  42. </table></div>
  43. </div>
  44. <div class="title_row" style="margin-top: 3%;"><div class="title_left_line"></div><span>经编</span><span style="color:#27e6ff">(生产情况)</span></div>
  45. <div class="data_row" style="width: 300px;display: block;margin-top:0;">
  46. <div style="display: flex;">
  47. <div ref="echarts1" class="fac_pie"></div>
  48. <div ref="echarts2" class="fac_pie"></div>
  49. </div>
  50. <div style="padding-left: 25px;color: #27e6ff;width: 100%;">
  51. <div class="littleFont">产量(今日)</div>
  52. <div style="font-size: 22px;font-weight: bold;">{{ deviceStatData.currYield.jb.yield }}<span class="littleFont">米</span></div>
  53. <div style="position: relative;margin-top: 5px;">
  54. <div class="abs fac_progress_value" :style="{width:(deviceStatData.currYield.jb.yield/deviceStatData.currYield.jb.yieldMax*100)+'%',backgroundColor: '#008899'}"></div>
  55. <div class="abs fac_progress" style="background-color: #072e47;"></div>
  56. </div>
  57. </div>
  58. <div style="padding-left: 25px;color: #27e6ff;margin-top: 25px;width: 100%;">
  59. <div class="littleFont"><span>开机数(今日)</span><span style="float: right;">总数</span></div>
  60. <div style="font-size: 22px;"><b>{{ deviceStatData.currYield.jb.openNum }}<span class="littleFont">台</span></b>
  61. <b style="float: right;">{{ deviceStatData.currYield.jb.totalNum }}<span class="littleFont">台</span></b>
  62. </div>
  63. <div style="position: relative;margin-top: 5px;">
  64. <div class="abs fac_progress_value" :style="{width:deviceStatData.currYield.jb.openRatio+'%',backgroundColor: '#008899'}"></div>
  65. <div class="abs fac_progress" style="background-color: #072e47;"></div>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="title_row" style="margin-top: 3%;"><div class="title_left_line"></div><span>染整</span><span style="color:#27e6ff">(生产情况)</span></div>
  70. <div class="data_row" style="width: 300px;display: block;margin-top:0;">
  71. <div style="display: flex;">
  72. <div ref="echarts3" class="fac_pie"></div>
  73. <div ref="echarts4" class="fac_pie"></div>
  74. </div>
  75. <div style="padding-left: 25px;color: #27e6ff;width: 100%;">
  76. <div class="littleFont">印染(今日)</div>
  77. <div style="font-size: 22px;font-weight: bold;">{{ deviceStatData.currYield.rz.yield }}<span class="littleFont">米</span></div>
  78. <div style="position: relative;margin-top: 5px;">
  79. <div class="abs fac_progress_value" :style="{width:(deviceStatData.currYield.rz.yield/deviceStatData.currYield.rz.yieldMax*100)+'%'}"></div>
  80. <div class="abs fac_progress"></div>
  81. </div>
  82. </div>
  83. <div style="padding-left: 25px;color: #27e6ff;margin-top: 25px;width: 100%;">
  84. <div class="littleFont"><span>开机数(今日)</span><span style="float: right;">总数</span></div>
  85. <div style="font-size: 22px;"><b>{{ deviceStatData.currYield.rz.openNum }}<span class="littleFont">台</span></b>
  86. <b style="float: right;">{{ deviceStatData.currYield.rz.totalNum }}<span class="littleFont">台</span></b>
  87. </div>
  88. <div style="position: relative;margin-top: 5px;">
  89. <div class="abs fac_progress_value" :style="{width:deviceStatData.currYield.rz.openRatio+'%'}"></div>
  90. <div class="abs fac_progress"></div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="abs rightPanel">
  96. <div class="title_row" style="line-height: 30px;"><div class="title_left_line" style="margin-top: 7px;"></div>
  97. <span>生产趋势</span><span style="color:#27e6ff">(7天)</span>
  98. <span style="margin-left: auto !important;">
  99. <span :class="buttonCode1=='Length'?'fac_btn active':'fac_btn'" @click="LoadSCLine('Length')">米数</span>
  100. <span :class="buttonCode1=='Weight'?'fac_btn active':'fac_btn'" @click="LoadSCLine('Weight')">重量</span>
  101. </span>
  102. </div>
  103. <div class="data_row" ref="echarts_sc_qushi" style="width: 100%;height: 42%;border: 1px solid #008899;"></div>
  104. <div class="title_row" style="line-height: 30px;margin-top: 8%;"><div class="title_left_line" style="margin-top: 7px;"></div>
  105. <span>能耗趋势</span><span style="color:#27e6ff">(30天)</span>
  106. <span style="margin-left: auto !important;">
  107. <span :class="buttonCode2=='price'?'fac_btn active':'fac_btn'" @click="LoadUsedLine('price')">折算</span>
  108. <span :class="buttonCode2=='electricity'?'fac_btn active':'fac_btn'" @click="LoadUsedLine('electricity')">电</span>
  109. <span :class="buttonCode2=='steam'?'fac_btn active':'fac_btn'" @click="LoadUsedLine('steam')">气</span>
  110. <span :class="buttonCode2=='water'?'fac_btn active':'fac_btn'" @click="LoadUsedLine('water')">水</span>
  111. </span>
  112. </div>
  113. <div class="data_row" ref="echarts_used_qushi" style="width: 100%;height: 42%;border: 1px solid #008899;"></div>
  114. </div>
  115. <div id="iframeWin" v-if="isShowIframeWin" :class="iframeWinData.class">
  116. <div class="title"><img src="../../assets/image/title_icon.png" style="margin: 7px;float: left;"><span class="text">{{ iframeWinData.title }}</span><img src="../../assets/image/Close.png" style="margin: 7px;float: right;cursor: pointer;" @click="CloseIframeWin"></div>
  117. <div class="content"><iframe id="ifrm" :src="iframeWinData.src" class=""></iframe></div>
  118. </div>
  119. </template>
  120. <script>
  121. import { ref,onMounted,watch,emit,onUnmounted } from 'vue';
  122. import api from "@/api/system";
  123. import * as echarts from 'echarts';
  124. export default {
  125. props:{
  126. facModelLoadState:{
  127. type:Boolean,
  128. required: true
  129. }
  130. },
  131. setup(props,{emit}) {
  132. const isShowIframeWin=ref(false);
  133. const iframeWinData = ref({});
  134. const echarts1 = ref(null);
  135. const echarts2 = ref(null);
  136. const echarts3 = ref(null);
  137. const echarts4 = ref(null);
  138. const echarts_sc_qushi = ref(null);
  139. const echarts_used_qushi = ref(null);
  140. let buttonCode1 = ref('');
  141. let buttonCode2 = ref('');
  142. let deviceStatData=ref({"avgMonth":{},"currYield":{"jb":{},"rz":{}}});
  143. let typeUnitName = '';
  144. const dataTypeUnit={
  145. 'Length':'米',
  146. 'Weight':'吨',
  147. 'price':'元/米',
  148. 'electricity':'kwh',
  149. 'steam':'GJ',
  150. 'water':'m³',
  151. };
  152. let getDataTimer=null;
  153. let getDataTimer1 = null;
  154. let getDataTimer2 = null;
  155. let getDataTimer3 = null;
  156. let getDataTimer4 = null;
  157. let MarkerMapFac={};
  158. let FacStockData={};
  159. let markerLClickObj = null;
  160. let echartsEleIns_0=null;
  161. let echartsEleIns_1=null;
  162. watch(() => props.facModelLoadState, newVal=> {
  163. if(newVal){
  164. //模型加载完成
  165. console.log('全厂模型加载完成')
  166. clearTimeout(getDataTimer);
  167. try{
  168. if(MarkerMapFac["FAC"]==null) loadmarkers();
  169. backMasterViewByFac();
  170. }catch(e){
  171. window.location.reload();
  172. }
  173. }
  174. },{deep:true,immediate:true})
  175. let DataFull={
  176. GetFacData:function(){
  177. api.GetFacData().then((res)=>{
  178. if(window.CurrentTargetType!='FAC') return;
  179. getDataTimer = setTimeout(function () {
  180. //每1分钟主动查询一次数据
  181. DataFull.GetFacData()
  182. }, 60*1000);
  183. FacStockData = res||{};
  184. if (res == null || player.Native==null || window.CurrentTargetType!='FAC') {
  185. return
  186. }
  187. for (var key in MarkerMapFac) {
  188. if(key=="FAC"){
  189. for (var marker in MarkerMapFac[key]) {
  190. var opt = MarkerMapFac[key][marker];
  191. var dataType = opt["userData"];
  192. if(dataType==null) continue;
  193. dataType = dataType.split("|");
  194. var dataMap = res[dataType[0]];//从返回结果中获取到当前数据类型对应的统计结果
  195. if(dataMap==null) continue;
  196. var dataTpl = dataType[1]; //从拆分结果中获取数据模板
  197. var dataText = dataTpl;
  198. //将模板中的属性替换成数据值
  199. for (var attr in dataMap) {
  200. /*
  201. if(attr=="fdy" || attr=="poy"){
  202. for (var yclattr in dataMap[attr]) {
  203. dataText = dataText.replace("{"+attr+"."+yclattr+"}",dataMap[attr][yclattr].toString().padEnd(6," "));
  204. }
  205. continue
  206. }
  207. */
  208. dataText = dataText.replace("{"+attr+"}",dataMap[attr].toString().padEnd(6," "));
  209. }
  210. //更新GIS标记内容
  211. opt["text"]=dataText;
  212. player.Native.GisMarker.update(marker, opt);
  213. }
  214. break;
  215. }
  216. }
  217. });
  218. },
  219. GetDeviceStat:function(){
  220. api.GetFacDeviceStat().then(res=>{
  221. if(window.CurrentTargetType!='FAC') return;
  222. getDataTimer1 = setTimeout(function () {
  223. //每1分钟主动查询一次数据
  224. DataFull.GetDeviceStat()
  225. }, 60*1000);
  226. if (res == null || player.Native==null || window.CurrentTargetType!='FAC') {
  227. return
  228. }
  229. if(res.code!=200){
  230. /*
  231. let msg = ElMessage({
  232. message:"正在加载数据",
  233. type:"info",
  234. duration:0,
  235. })
  236. */
  237. return;
  238. }
  239. deviceStatData.value = res.data;
  240. LoadSCLine('Length');
  241. LoadUsedLine('price');
  242. LoadJBPie();
  243. LoadRZPie();
  244. })
  245. }
  246. }
  247. //全局厂房最佳视图
  248. function backMasterViewByFac(){
  249. // player.Native.Camera.moveTo([235.678127000173, 13.38107286701451, 74.13573809425804], [-1248.3191825020908, -262.59031050373517, -409.93944372657353], [-0.30023176822741604, -0.055832565112502126, 0.9522308596238611], 1);
  250. player.Native.Camera.moveTo([230.81374612743963, -478.03486595784244, 397.44713298891566],
  251. [-1191.7422834310603, 2397.473667672639, -1974.2218082537938],
  252. [-0.2635955199415324, 0.5328234187400651, 0.8041247454897171], 1);
  253. // 使用异步函数
  254. (async () => {
  255. setTimeout(function() {
  256. player.Native.Camera.setAnchorPos([-45.87571144104003, -44.632896423339844, 43.90447044372559]);
  257. }, 3000);
  258. })();
  259. }
  260. async function loadmarkers(){
  261. //获取4号楼顶对象
  262. var obj02 = await player.Native.ModelTree.findItemByName("Box013",0,true,1);
  263. var imgid = await player.Native.GisMarker.loadImage("data://icon/qietu/tip2.png");
  264. var options = {
  265. "text": "白坯布("+StockTypeUnit['bpb']+")\r\r当前库存:-\r统计时间:7点至次日7点\r当日入库:- 出库:-\r当月入库:- 出库:-\r",
  266. "visible": true,
  267. //"maxLod": 130,
  268. "minLod": 0,
  269. "textFontSize":16,
  270. "textColor": parseInt("0xffffffff"),
  271. "contentPadding":[10,10,10,10],
  272. "userData":"bpb|白坯布("+StockTypeUnit['bpb']+")\r\r当前库存:{curr}\r统计时间:7点至次日7点\r当日入库:{d-in} 出库:{d-out}\r当月入库:{m-in} 出库:{m-out}\r"
  273. };
  274. var obj02Aabb = await player.Native.ModelTree.getItemShapeInfo(obj02.item);
  275. options.pos = [obj02Aabb.aabb[0][0]-40, obj02Aabb.aabb[0][1]-10, obj02Aabb.aabb[0][2]+115];
  276. //options.parentNode=tmp.item;
  277. options.imgId = imgid
  278. options.imgSize = [0, 140];
  279. var markPtr = await player.Native.GisMarker.create(options);
  280. //await player.Native.GisMarker.update(markPtr, options);
  281. MarkerMapFac["FAC"]={};
  282. MarkerMapFac["FAC"][markPtr]=options;
  283. //获取盘头仓对象
  284. var pantou = await player.Native.ModelTree.findItemByName("Object023",0,true,1);
  285. //var imgid = await player.Native.GisMarker.loadImage("rgba:255,0,255,255");
  286. var options = {
  287. "text": "盘头("+StockTypeUnit['pt']+")\r\r当前库存:-\r统计时间:7点至次日7点\r当日入库:- 出库:-\r当月入库:- 出库:-",
  288. "visible": true,
  289. //"maxLod": 130,
  290. "minLod": 0,
  291. "textFontSize":16,
  292. "textColor": parseInt("0xffffffff"),
  293. "contentPadding":[10,10,10,10],
  294. "userData":"pt|盘头("+StockTypeUnit['pt']+")\r\r当前库存:{curr}\r统计时间:7点至次日7点\r当日入库:{d-in} 出库:{d-out}\r当月入库:{m-in} 出库:{m-out}\r"
  295. };
  296. var obj02Aabb = await player.Native.ModelTree.getItemShapeInfo(pantou.item);
  297. options.pos = [obj02Aabb.aabb[0][0], obj02Aabb.aabb[0][1]-30, obj02Aabb.aabb[0][2]+45];
  298. //options.parentNode=tmp.item;
  299. options.imgId = imgid
  300. options.imgSize = [240, 140];
  301. var markPtr = await player.Native.GisMarker.create(options);
  302. MarkerMapFac["FAC"][markPtr]=options;
  303. //await player.Native.GisMarker.update(markPtr, options);
  304. //获取原材料仓对象
  305. var pantou = await player.Native.ModelTree.findItemByName("B412",0,true,1);
  306. //var imgid = await player.Native.GisMarker.loadImage("rgba:255,0,255,255");
  307. var options = {
  308. "text": "原材料("+StockTypeUnit['ycl']+")\r\r当前库存:-\r统计时间:7点至次日7点\r当日入库:- 出库:-\r当月入库:- 出库:-\r",
  309. "visible": true,
  310. //"maxLod": 130,
  311. "minLod": 0,
  312. "textFontSize":16,
  313. "textColor": parseInt("0xffffffff"),
  314. "contentPadding":[10,10,10,10],
  315. "userData":"ycl|原材料("+StockTypeUnit['ycl']+")\r\r当前库存:{curr}\r统计时间:7点至次日7点\r当日入库:{d-in} 出库:{d-out}\r当月入库:{m-in} 出库:{m-out}\r"
  316. };
  317. var obj02Aabb = await player.Native.ModelTree.getItemShapeInfo(pantou.item);
  318. options.pos = [obj02Aabb.aabb[0][0]-50, obj02Aabb.aabb[0][1]-10, obj02Aabb.aabb[0][2]+60];
  319. //options.parentNode=tmp.item;
  320. options.imgId = imgid
  321. options.imgSize = [0, 140];
  322. var markPtr = await player.Native.GisMarker.create(options);
  323. MarkerMapFac["FAC"][markPtr]=options;
  324. //await player.Native.GisMarker.update(markPtr, options);
  325. //var imgid = await player.Native.GisMarker.loadImage("rgba:255,0,255,255");
  326. var options = {
  327. "text": "成品("+StockTypeUnit['cp']+")\r\r当前库存:-\r统计时间:7点至次日7点\r当日入库:- 出库:-\r当月入库:- 出库:-",
  328. "visible": true,
  329. //"maxLod": 130,
  330. "minLod": 0,
  331. "textFontSize":16,
  332. "textColor": parseInt("0xffffffff"),
  333. "contentPadding":[10,10,10,10],
  334. "userData":"cp|成品("+StockTypeUnit['cp']+")\r\r当前库存:{curr}\r统计时间:7点至次日7点\r当日入库:{d-in} 出库:{d-out}\r当月入库:{m-in} 出库:{m-out}\r"
  335. };
  336. options.pos = [obj02Aabb.aabb[0][0]+100, obj02Aabb.aabb[0][1]+10, obj02Aabb.aabb[0][2]+75];
  337. //options.parentNode=tmp.item;
  338. options.imgId = imgid
  339. options.imgSize = [250, 140];
  340. var markPtr = await player.Native.GisMarker.create(options);
  341. MarkerMapFac["FAC"][markPtr]=options;
  342. //await player.Native.GisMarker.update(markPtr, options);
  343. //标记点击
  344. player.Native.GisMarker.EventGisMarkerLClick.connect((event) => {
  345. markerLClickObj = MarkerMapFac["FAC"][event.markerId];
  346. if(markerLClickObj==null || FacStockData==null){
  347. emit('markerLClick',{});
  348. return;
  349. }
  350. setTimeout(function(dataType){
  351. if(dataType==null) return;
  352. dataType = dataType.split("|");
  353. //打开库存趋势窗口
  354. showStockTrend(dataType[0]);
  355. },100,markerLClickObj["userData"]);
  356. emit('markerLClick',markerLClickObj);
  357. });
  358. DataFull.GetFacData();
  359. DataFull.GetDeviceStat();
  360. /*
  361. DataFull.GetFacProduction();
  362. DataFull.GetScLine();
  363. DataFull.GetUsedLine();
  364. LoadJBPie();
  365. LoadRZPie();
  366. */
  367. }
  368. function LoadSCLine(dataType) {
  369. buttonCode1.value = dataType;
  370. typeUnitName = dataTypeUnit[dataType];
  371. let data = deviceStatData.value.prodTrade;
  372. //生产趋势
  373. //获取数据中weight、aweight、bweight
  374. var t = echarts_sc_qushi.value;
  375. var week_efficiency = [];
  376. var week_aefficiency = [];
  377. var week_befficiency = [];
  378. var times = [];
  379. var v_series = [];
  380. for (var i = 0; i < data.length; i++) {
  381. var tv = data[i]['date'];
  382. times.push(tv);
  383. if(dataType=='Length'){
  384. week_aefficiency.push(data[i]['jbLength'])
  385. week_befficiency.push(data[i]['rzLength'])
  386. }else{
  387. week_aefficiency.push(data[i]['jbWeight'])
  388. week_befficiency.push(data[i]['rzWeight'])
  389. }
  390. }
  391. if (week_aefficiency.length == 0 && week_befficiency.length==0) {
  392. return
  393. }
  394. v_series.push({
  395. name: "经编", type: 'bar', smooth: true, //symbol: 'none',
  396. data: week_aefficiency, itemStyle: {
  397. normal: {
  398. color: '#1EFFFF', // 这里设置折线的颜色
  399. lineStyle: {
  400. color: '#1EFFFF' // 这里同时设置线头的颜色
  401. }
  402. }
  403. },
  404. barWidth: "8",
  405. itemStyle: {
  406. barBorderRadius: [3, 3, 0, 0,],
  407. color: new echarts.graphic.LinearGradient(
  408. 0, 0, 0, 1, // 这四个参数分别表示渐变的起点 (x1, y1) 与终点 (x2, y2)
  409. [
  410. {offset: 0, color: '#fbc16b'}, // 0% 处的颜色
  411. {offset: 1, color: '#fbc16b70'} // 100% 处的颜色
  412. ]
  413. )
  414. }
  415. });
  416. v_series.push({
  417. name: "染整", type: 'bar', smooth: true, //symbol: 'none',
  418. data: week_befficiency, itemStyle: {
  419. normal: {
  420. color: '#295589', // 这里设置折线的颜色
  421. lineStyle: {
  422. color: '#295589' // 这里同时设置线头的颜色
  423. }
  424. }
  425. },
  426. barWidth: "8",
  427. itemStyle: {
  428. barBorderRadius: [3, 3, 0, 0,],
  429. color: new echarts.graphic.LinearGradient(
  430. 0, 0, 0, 1, // 这四个参数分别表示渐变的起点 (x1, y1) 与终点 (x2, y2)
  431. [
  432. {offset: 0, color: '#fc4850'}, // 0% 处的颜色
  433. {offset: 1, color: '#fc485070'} // 100% 处的颜色
  434. ]
  435. )
  436. }
  437. });
  438. var opt = {
  439. title: {
  440. show: false, //不显示标题
  441. text: '',
  442. textStyle: {
  443. color: "rgb(89, 151, 229)",
  444. fontWeight: "bold"
  445. },
  446. top: "0px",
  447. left: "30px"
  448. },
  449. legend: {
  450. show: true, //不显示图例
  451. inactiveColor: "#04417A",
  452. data: "",
  453. icon:"circle",
  454. textStyle: {color: "#fff"},
  455. top: "5",
  456. left: "10px",
  457. },
  458. tooltip: {
  459. trigger: 'axis',
  460. axisPointer: {
  461. label: {
  462. show: true,
  463. backgroundColor: '#fff',
  464. color: '#556677',
  465. borderColor: 'rgba(0,0,0,0)',
  466. shadowColor: 'rgba(0,0,0,0)',
  467. shadowOffsetY: 0
  468. },
  469. lineStyle: {
  470. width: 0
  471. }
  472. },
  473. backgroundColor: '#fff',
  474. textStyle: {
  475. color: '#5c6c7c'
  476. },
  477. padding: [10, 10],
  478. extraCssText: 'box-shadow: 1px 0 2px 0 rgba(163,163,163,0.5)',
  479. formatter: function (params) {
  480. let xv='';
  481. let result = '';
  482. params.forEach(function (item) {
  483. xv=`${item.name}<br/>`;
  484. result += ` ${item.marker} ${item.seriesName}: ${item.value}(`+typeUnitName+`)<br/>`;
  485. });
  486. return xv+result;
  487. }
  488. },
  489. grid: {
  490. left: '5%',
  491. right: '5%',
  492. bottom: '0',
  493. top: '15%',
  494. containLabel: true
  495. },
  496. xAxis: {
  497. type: 'category',
  498. boundaryGap: true,
  499. axisLabel: {
  500. rotate: 45,
  501. color: "#26e2fb"
  502. },
  503. axisTick:{
  504. show:false
  505. },
  506. data: times
  507. },
  508. yAxis: {
  509. type: 'value',
  510. nameTextStyle: {
  511. color: "#26e2fb"
  512. },
  513. axisLine:{
  514. show:true
  515. },
  516. axisLabel: {
  517. color: "#26e2fb"
  518. },
  519. splitLine: {
  520. lineStyle: {
  521. color: "#7DA7CD",
  522. type: "dashed",
  523. width: 1
  524. }
  525. }
  526. },
  527. series: v_series
  528. };
  529. if(echartsEleIns_1!=null){
  530. echartsEleIns_1.dispose();
  531. }
  532. echartsEleIns_1 = echarts.init(t);
  533. echartsEleIns_1.setOption(opt);
  534. }
  535. function LoadUsedLine(dataType){
  536. buttonCode2.value = dataType;
  537. typeUnitName = dataTypeUnit[dataType];
  538. let data = deviceStatData.value.energyTrade;
  539. //能耗趋势
  540. var t = echarts_used_qushi.value;
  541. var times = [];
  542. var v_series = [];
  543. var week_aefficiency = [];
  544. var week_befficiency = [];
  545. for (var i = 0; i < data.length; i++) {
  546. times.push(data[i]['date']);
  547. if(data[i]['jb'][dataType]!=null) week_aefficiency.push(data[i]['jb'][dataType]);
  548. if(data[i]['rz'][dataType]!=null) week_befficiency.push(data[i]['rz'][dataType]);
  549. }
  550. if (week_aefficiency.length> 0) {
  551. v_series.push({
  552. name: "经编", type: 'line', //symbol: 'none',
  553. data: week_aefficiency,
  554. symbol: 'circle', // 使用圆作为折点标记
  555. symbolSize: 6,
  556. itemStyle: {
  557. normal: {
  558. color: '#fbc16b', // 这里设置折线的颜色
  559. lineStyle: {
  560. color: '#fbc16b' // 这里同时设置线头的颜色
  561. }
  562. }
  563. },
  564. });
  565. }
  566. if(week_befficiency.length>0){
  567. v_series.push({
  568. name: "染整", type: 'line', //symbol: 'none',
  569. data: week_befficiency,
  570. symbol: 'circle', // 使用圆作为折点标记
  571. symbolSize: 6,
  572. itemStyle: {
  573. normal: {
  574. color: '#fc4850', // 这里设置折线的颜色
  575. lineStyle: {
  576. color: '#fc4850' // 这里同时设置线头的颜色
  577. }
  578. }
  579. },
  580. });
  581. }
  582. var opt = {
  583. title: {
  584. show: false, //不显示标题
  585. text: '',
  586. textStyle: {
  587. color: "rgb(89, 151, 229)",
  588. fontWeight: "bold"
  589. },
  590. top: "0px",
  591. left: "30px"
  592. },
  593. tooltip: {
  594. trigger: 'axis',
  595. formatter: function (params) {
  596. let xv='';
  597. let result = '';
  598. params.forEach(function (item) {
  599. xv=`${item.name}<br/>`;
  600. result += ` ${item.marker} ${item.seriesName}: ${item.value}(`+typeUnitName+`)<br/>`;
  601. });
  602. return xv+result;
  603. }
  604. },
  605. legend: {
  606. show: true, //不显示图例
  607. inactiveColor: "#04417A",
  608. data: "",
  609. textStyle: {color: "#fff"},
  610. top: "5",
  611. left:"10px",
  612. icon:"circle",
  613. },
  614. grid: {
  615. left: '3%',
  616. right: '1%',
  617. bottom: '0',
  618. top: '15%',
  619. containLabel: true
  620. },
  621. xAxis: {
  622. type: 'category',
  623. boundaryGap: false,
  624. axisLabel: {
  625. rotate: 45,
  626. color: "#26e2fb"
  627. },
  628. axisLine:{
  629. show:true
  630. },
  631. axisTick:{
  632. show:false,
  633. },
  634. data: times
  635. },
  636. yAxis: {
  637. type: 'value',
  638. nameTextStyle: {
  639. color: "#26e2fb"
  640. },
  641. axisLine:{
  642. show:true
  643. },
  644. axisTick:{
  645. show:false,
  646. },
  647. axisLabel: {
  648. color: "#26e2fb"
  649. },
  650. splitLine: {
  651. lineStyle: {
  652. color: "#7DA7CD",
  653. type: "dashed",
  654. width: 1
  655. }
  656. }
  657. },
  658. series: v_series
  659. };
  660. if(echartsEleIns_0!=null){
  661. echartsEleIns_0.dispose();
  662. }
  663. echartsEleIns_0 = echarts.init(t);
  664. echartsEleIns_0.setOption(opt);
  665. }
  666. function LoadJBPie(){
  667. //嫁动率
  668. const myChart = echarts.init(echarts1.value);
  669. // 配置项
  670. const option = {
  671. title: {
  672. text: '进度仪表盘',
  673. left: 'center',
  674. top: 'top',
  675. show:false,
  676. },
  677. tooltip: {
  678. formatter: '{a} <br/>{b} : {c}%'
  679. },
  680. series: [
  681. {
  682. name: '经编',
  683. type: 'gauge',
  684. startAngle: '90',
  685. endAngle: '-270',
  686. pointer: {
  687. show: false
  688. },
  689. progress: {
  690. show: true,
  691. itemStyle:{
  692. color:"#28c4d8"
  693. },
  694. roundCap: true, //圆角
  695. width: 8 // 进度条宽度
  696. },
  697. axisLine: {
  698. show:true,
  699. lineStyle: {
  700. width: 8, // 仪表盘宽度,
  701. color: [[1, '#052c45']] // 底色
  702. }
  703. },
  704. axisTick: {
  705. show: false // 隐藏刻度
  706. },
  707. splitLine: {
  708. show:false,
  709. length: 15, // 分割线长度
  710. lineStyle: {
  711. width: 2,
  712. color: '#999'
  713. }
  714. },
  715. axisLabel: {
  716. distance: 25,
  717. color: '#999',
  718. fontSize: 14,
  719. show:false,
  720. },
  721. data: [
  722. {
  723. value: deviceStatData.value.currYield.jb.jdl, // 初始进度值
  724. name: '当前嫁动率',
  725. title:{
  726. offsetCenter: [0, -15], // 位置调整,'50%' 表示垂直居中,0 表示水平居中(根据需要调整)
  727. color: '#27e6ff', // 文字颜色
  728. fontSize: 14*BODY_H_RATE // 文字大小
  729. },
  730. detail: {
  731. valueAnimation: true,
  732. offsetCenter: [0, 10],
  733. formatter: '{value}%',
  734. color: '#27e6ff', // 文字颜色
  735. fontSize: 24*BODY_H_RATE // 文字大小
  736. },
  737. }
  738. ]
  739. },
  740. {
  741. type: 'pie',
  742. radius: ['59%', '60.5%'],
  743. hoverAnimation: false,
  744. clockWise: false,
  745. tooltip:{
  746. show:false,
  747. },
  748. itemStyle: {
  749. normal: {
  750. shadowBlur: 20,
  751. shadowColor: 'rgba(0, 255, 255,.3)',
  752. color: '#008596',
  753. }
  754. },
  755. label: {
  756. show: false
  757. },
  758. data: [100]
  759. },
  760. ]
  761. };
  762. // 使用配置项渲染图表
  763. myChart.setOption(option);
  764. //开机率
  765. const kjOpt = {
  766. title: {
  767. text: '进度仪表盘',
  768. left: 'center',
  769. top: 'top',
  770. show:false,
  771. },
  772. tooltip: {
  773. formatter: '{a} <br/>{b} : {c}%'
  774. },
  775. series: [
  776. {
  777. name: '经编',
  778. type: 'gauge',
  779. startAngle: '90',
  780. endAngle: '-270',
  781. pointer: {
  782. show: false
  783. },
  784. progress: {
  785. show: true,
  786. itemStyle:{
  787. color:"#28c4d8"
  788. },
  789. roundCap: true, //圆角
  790. width: 8 // 进度条宽度
  791. },
  792. axisLine: {
  793. show:true,
  794. lineStyle: {
  795. width: 8, // 仪表盘宽度,
  796. color: [[1, '#052c45']] // 底色
  797. }
  798. },
  799. axisTick: {
  800. show: false // 隐藏刻度
  801. },
  802. splitLine: {
  803. show:false,
  804. length: 15, // 分割线长度
  805. lineStyle: {
  806. width: 2,
  807. color: '#999'
  808. }
  809. },
  810. axisLabel: {
  811. distance: 25,
  812. color: '#999',
  813. fontSize: 14,
  814. show:false,
  815. },
  816. data: [
  817. {
  818. value: deviceStatData.value.currYield.jb.openRatio, // 初始进度值
  819. name: '开机率',
  820. title:{
  821. offsetCenter: [0, -15], // 位置调整,'50%' 表示垂直居中,0 表示水平居中(根据需要调整)
  822. color: '#27e6ff', // 文字颜色
  823. fontSize: 14*BODY_H_RATE // 文字大小
  824. },
  825. detail: {
  826. valueAnimation: true,
  827. offsetCenter: [0, 10],
  828. formatter: '{value}%',
  829. color: '#27e6ff', // 文字颜色
  830. fontSize: 24*BODY_H_RATE // 文字大小
  831. },
  832. }
  833. ]
  834. },
  835. {
  836. type: 'pie',
  837. radius: ['59%', '60.5%'],
  838. hoverAnimation: false,
  839. clockWise: false,
  840. tooltip:{
  841. show:false,
  842. },
  843. itemStyle: {
  844. normal: {
  845. shadowBlur: 20,
  846. shadowColor: 'rgba(0, 255, 255,.3)',
  847. color: '#008596',
  848. }
  849. },
  850. label: {
  851. show: false
  852. },
  853. data: [100]
  854. },
  855. ]
  856. };
  857. const kj = echarts.init(echarts2.value);
  858. kj.setOption(kjOpt);
  859. }
  860. function LoadRZPie(){
  861. //嫁动率
  862. const myChart = echarts.init(echarts3.value);
  863. // 配置项
  864. const option = {
  865. title: {
  866. text: '进度仪表盘',
  867. left: 'center',
  868. top: 'top',
  869. show:false,
  870. },
  871. tooltip: {
  872. formatter: function(a){
  873. return a.seriesName+'<br>'+a.name+" : "+a.value/100*deviceStatData.value.currYield.rz.maxLine+'条';
  874. }
  875. },
  876. series: [
  877. {
  878. name: '染整',
  879. type: 'gauge',
  880. startAngle: '90',
  881. endAngle: '-270',
  882. pointer: {
  883. show: false
  884. },
  885. progress: {
  886. show: true,
  887. itemStyle:{
  888. color:"#28c4d8"
  889. },
  890. roundCap: true, //圆角
  891. width: 8 // 进度条宽度
  892. },
  893. axisLine: {
  894. show:true,
  895. lineStyle: {
  896. width: 8, // 仪表盘宽度,
  897. color: [[1, '#052c45']] // 底色
  898. }
  899. },
  900. axisTick: {
  901. show: false // 隐藏刻度
  902. },
  903. splitLine: {
  904. show:false,
  905. length: 15, // 分割线长度
  906. lineStyle: {
  907. width: 2,
  908. color: '#999'
  909. }
  910. },
  911. axisLabel: {
  912. distance: 25,
  913. color: '#999',
  914. fontSize: 14,
  915. show:false,
  916. },
  917. data: [
  918. {
  919. value: deviceStatData.value.currYield.rz.openLine/deviceStatData.value.currYield.rz.maxLine*100, // 初始进度值
  920. name: '开动产线',
  921. title:{
  922. offsetCenter: [0, -15], // 位置调整,'50%' 表示垂直居中,0 表示水平居中(根据需要调整)
  923. color: '#27e6ff', // 文字颜色
  924. fontSize: 14*BODY_H_RATE // 文字大小
  925. },
  926. detail: {
  927. valueAnimation: true,
  928. offsetCenter: [0, 10],
  929. formatter:function(v){
  930. return v/100*deviceStatData.value.currYield.rz.maxLine+'条'
  931. },
  932. color: '#27e6ff', // 文字颜色
  933. fontSize: 24*BODY_H_RATE // 文字大小
  934. },
  935. }
  936. ]
  937. },
  938. {
  939. type: 'pie',
  940. radius: ['59%', '60.5%'],
  941. hoverAnimation: false,
  942. clockWise: false,
  943. tooltip:{
  944. show:false,
  945. },
  946. itemStyle: {
  947. normal: {
  948. shadowBlur: 20,
  949. shadowColor: 'rgba(0, 255, 255,.3)',
  950. color: '#008596',
  951. }
  952. },
  953. label: {
  954. show: false
  955. },
  956. data: [100]
  957. },
  958. ]
  959. };
  960. // 使用配置项渲染图表
  961. myChart.setOption(option);
  962. //开机率
  963. const kjOpt = {
  964. title: {
  965. text: '进度仪表盘',
  966. left: 'center',
  967. top: 'top',
  968. show:false,
  969. },
  970. tooltip: {
  971. formatter: '{a} <br/>{b} : {c}%'
  972. },
  973. series: [
  974. {
  975. name: '染整',
  976. type: 'gauge',
  977. startAngle: '90',
  978. endAngle: '-270',
  979. pointer: {
  980. show: false
  981. },
  982. progress: {
  983. show: true,
  984. itemStyle:{
  985. color:"#28c4d8"
  986. },
  987. roundCap: true, //圆角
  988. width: 8 // 进度条宽度
  989. },
  990. axisLine: {
  991. show:true,
  992. lineStyle: {
  993. width: 8, // 仪表盘宽度,
  994. color: [[1, '#052c45']] // 底色
  995. }
  996. },
  997. axisTick: {
  998. show: false // 隐藏刻度
  999. },
  1000. splitLine: {
  1001. show:false,
  1002. length: 15, // 分割线长度
  1003. lineStyle: {
  1004. width: 2,
  1005. color: '#999'
  1006. }
  1007. },
  1008. axisLabel: {
  1009. distance: 25,
  1010. color: '#999',
  1011. fontSize: 14,
  1012. show:false,
  1013. },
  1014. data: [
  1015. {
  1016. value: deviceStatData.value.currYield.rz.openRatio, // 初始进度值
  1017. name: '开机率',
  1018. title:{
  1019. offsetCenter: [0, -15], // 位置调整,'50%' 表示垂直居中,0 表示水平居中(根据需要调整)
  1020. color: '#27e6ff', // 文字颜色
  1021. fontSize: 14*BODY_H_RATE // 文字大小
  1022. },
  1023. detail: {
  1024. valueAnimation: true,
  1025. offsetCenter: [0, 10],
  1026. formatter: '{value}%',
  1027. color: '#27e6ff', // 文字颜色
  1028. fontSize: 24*BODY_H_RATE // 文字大小
  1029. },
  1030. }
  1031. ]
  1032. },
  1033. {
  1034. type: 'pie',
  1035. radius: ['59%', '60.5%'],
  1036. hoverAnimation: false,
  1037. clockWise: false,
  1038. tooltip:{
  1039. show:false,
  1040. },
  1041. itemStyle: {
  1042. normal: {
  1043. shadowBlur: 20,
  1044. shadowColor: 'rgba(0, 255, 255,.3)',
  1045. color: '#008596',
  1046. }
  1047. },
  1048. label: {
  1049. show: false
  1050. },
  1051. data: [100]
  1052. },
  1053. ]
  1054. };
  1055. const kj = echarts.init(echarts4.value);
  1056. kj.setOption(kjOpt);
  1057. }
  1058. function showStockTrend(type){
  1059. iframeWinData.value = {class:'newwin bpbWin',src:'/stock-trend-fx#'+type,title:StockTypeName[type]+'库存趋势'};
  1060. isShowIframeWin.value=true;
  1061. }
  1062. function CloseIframeWin(){
  1063. isShowIframeWin.value=false;
  1064. iframeWinData.value={};
  1065. }
  1066. onMounted(()=>{
  1067. clearTimeout(getDataTimer);
  1068. clearTimeout(getDataTimer1);
  1069. clearTimeout(getDataTimer2);
  1070. clearTimeout(getDataTimer3);
  1071. clearTimeout(getDataTimer4);
  1072. backMasterViewByFac();
  1073. });
  1074. onUnmounted(()=>{
  1075. clearTimeout(getDataTimer);
  1076. clearTimeout(getDataTimer1);
  1077. clearTimeout(getDataTimer2);
  1078. clearTimeout(getDataTimer3);
  1079. clearTimeout(getDataTimer4);
  1080. if(MarkerMapFac["FAC"]==null) return;
  1081. for(let key in MarkerMapFac["FAC"]){
  1082. if(player!=null && player.Native!=null)player.Native.GisMarker.destroy(key)
  1083. }
  1084. });
  1085. return{
  1086. backMasterViewByFac,
  1087. loadmarkers,
  1088. showStockTrend,
  1089. LoadSCLine,
  1090. LoadUsedLine,
  1091. isShowIframeWin,
  1092. iframeWinData,
  1093. markerLClickObj,
  1094. CloseIframeWin,
  1095. getDataTimer,
  1096. getDataTimer1,
  1097. getDataTimer2,
  1098. getDataTimer3,
  1099. getDataTimer4,
  1100. deviceStatData,
  1101. echarts1,
  1102. echarts2,
  1103. echarts3,
  1104. echarts4,
  1105. echarts_sc_qushi,
  1106. echarts_used_qushi,
  1107. buttonCode1,
  1108. buttonCode2,
  1109. }
  1110. }
  1111. }
  1112. </script>
  1113. <style>
  1114. .bg1{
  1115. z-index: 1; pointer-events: none;position: absolute;
  1116. top: calc(90px * var(--hRate));
  1117. left: 0;
  1118. width: 98.2%;
  1119. height: 89%;
  1120. margin-left: 19px;
  1121. border: 2px solid #17666e;
  1122. border-top: 0px;
  1123. /*
  1124. background:url('../../assets/image//bg.png');
  1125. -webkit-mask-image:radial-gradient(circle, transparent 26%, #95afc5 54%);
  1126. background:
  1127. repeating-linear-gradient(
  1128. 45deg,
  1129. #ccc 0, #ccc 10px,
  1130. transparent 10px, transparent 20px
  1131. ),
  1132. repeating-linear-gradient(
  1133. -45deg,
  1134. #ccc 0, #ccc 10px,
  1135. transparent 10px, transparent 20px
  1136. );
  1137. background-size: 20px 20px;
  1138. */
  1139. }
  1140. .devicePanel{
  1141. position: absolute;top: 5%;left: 2%;width: 300px;height: 306px;z-index: 2;color: rgb(255, 255, 255);font-size: 18px;padding: 10px;border: 1px solid #b4a9e6;background: #1d476c1c;border-radius: 5px;box-shadow: 0px 0px 4px #5d7a94;
  1142. }
  1143. .deviceItem{
  1144. line-height: 35px;width:80%;display:inline-block;height: 60px;font-weight: bold;
  1145. }
  1146. .deviceDetailItem{
  1147. line-height: 20px;width:80%;display:inline-block;font-weight: normal;font-size: 14px;margin-left: 58px;color: #e1d7e8;
  1148. }
  1149. .precentBg{
  1150. width: 100%;height: 10px;display: inline-block;background: rgb(221 219 224);border-radius: 10px;
  1151. }
  1152. .productionPanel{
  1153. position: absolute;
  1154. top: 9%;
  1155. right: 5%;
  1156. width: 11%;
  1157. color: #fff;
  1158. font-size: 14px;
  1159. z-index: 2;
  1160. filter: blur(0px);
  1161. backdrop-filter: blur(5px);
  1162. /*border: 1px solid #b4a9e6;*/
  1163. /*background: #1d476c1c;*/
  1164. border-radius: 5px;
  1165. box-shadow: 0px 0px 10px #c1cce587;
  1166. /*transform: rotateZ(0deg) rotateX(20deg) rotateY(-58deg) skew(2deg);*/
  1167. }
  1168. .productionPanel .content{
  1169. background: transparent;padding: 5px;
  1170. }
  1171. .productionPanel .title{
  1172. text-align: center;width: 100%;font-weight: bold;line-height: 32px;font-size: 18px;color: #d6dce3;
  1173. }
  1174. .productionPanel .cyc{
  1175. border: 10px solid #2566ad;
  1176. border-radius: 50%;
  1177. height: 66px;
  1178. text-align: center;
  1179. width: 33%;
  1180. line-height: 66px;
  1181. background: #258cce;
  1182. font-size: 19px;
  1183. margin: 10px 29%;
  1184. }
  1185. </style>