Fac.vue 60 KB

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