In02.vue 95 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094
  1. <template>
  2. <!--这是经编模块的模块展示内容-->
  3. <div class="bg23">
  4. <div class="bg32"></div>
  5. </div>
  6. <div @click="HideWindow">
  7. <div for="IN02" id="search"><input v-model="seachValue" type="text" placeholder="请输入设备编号" maxlength="4" @keyup.enter="search"><img
  8. style="position: absolute;top: 20%;right: 5px;" src="../../assets/image/search_icon.png" class="search_btn" @click="search"></div>
  9. <div id="search_result" v-if="isshow_search_result">
  10. <div class="item" v-if="search_result_list.length==0">未搜索到任何设备</div>
  11. <template v-else>
  12. <div class="item" v-for="item in search_result_list" @click="ShowInfo(item.code)">{{ item.name }}</div>
  13. </template>
  14. </div>
  15. <div for="IN02" id="top" class="top top02" style="padding: 32px 0 0px 0;" @click="switchIndex">
  16. <div title="进入数据消费平台"
  17. style="cursor: pointer;height: 38px;width: 38px;text-align: center;float: right;margin: 0px 49px 0px 10px;"
  18. @click.stop="toAdmin"><img src="../../assets/image/toAdmin.png"></div>
  19. <div title="返回主视图"
  20. style="cursor: pointer;height: 38px;width: 38px;text-align: center;float: right;margin: 0 10px;"
  21. @click.stop="backMasterViewBy02"><img src="../../assets/image/view.png"></div>
  22. <div ref="autoplayer_btn" id="autoplayer_btn" title="切换自动漫游"
  23. style="cursor: pointer;height: 38px;width: 38px;float: right;margin: 0 10px;" @click.stop="switchAutoPlayer">
  24. <img v-if="AutoPlayer" src="../../assets/image/auto3d_start.png">
  25. <img v-else src="../../assets/image/auto3d_stop.png">
  26. </div>
  27. <div title="AI分析"
  28. style="cursor: pointer;height: 38px;width: 38px;float: right;margin: 0 10px;" @click.stop="OpenBPBWin">
  29. <img src="../../assets/image/icon-ai1.png">
  30. </div>
  31. </div>
  32. <div v-if="isShowFuncMenuList" id="func_menulist">
  33. <div id="maogao_btn" title="" style="cursor: pointer;" @click="OpenMaoGaoWin">毛高比重</div>
  34. <div id="bpb_fx" title="" style="cursor: pointer;" @click="OpenBPBWin">白坯布预测分析</div>
  35. </div>
  36. <div for="IN02" id="dev_state" show="设备状态" style="width: 790px;height: calc(182px*var(--hRate));left: 50%;margin-left: -395px;top:78%;">
  37. <div class="title_row" style="font-weight: normal;">
  38. <div class="title_left_line"></div><span>生产情况</span><span style="color:#27e6ff">(今日)</span>
  39. </div>
  40. <div class="data_row content" style="display:flex;width:100%;height:calc(134px*var(--hRate));font-weight:normal;font-size: 24px;">
  41. <div style="width:15%;">
  42. <div class="littleFont">米数</div>
  43. <div class="label">
  44. <NumberAnimation :value="ReplaceNull(indexjsondata.efficiency.totalLength,'0')" :decimal="0" />
  45. <span class="unitname">米</span>
  46. </div>
  47. <div class="littleFont" style="margin-top: calc(30px*var(--hRate));">重量</div>
  48. <div class="label">
  49. <NumberAnimation :value="ReplaceNull(indexjsondata.efficiency.totalWeight,'0')" :decimal="2" />
  50. <span class="unitname">吨</span>
  51. </div>
  52. </div>
  53. <div style="margin: 0 5%; width:1px;border-left:1px solid #168895 ;"></div>
  54. <div style="width:11%;height: 100%;">
  55. <div class="littleFont">设备<span style="color:#27e6ff">(开机)</span></div>
  56. <div class="label" @click="openStopView" title="查看设备停机状态分析" style="cursor: pointer;text-decoration: underline;">
  57. <NumberAnimation :value="ReplaceNull(alarmjsondata.device.online,'0')" :decimal="0" />
  58. <span class="unitname">台</span>
  59. </div>
  60. <div class="littleFont" style="margin-top: calc(30px*var(--hRate));">设备<span style="color:#27e6ff">(总数)</span></div>
  61. <div class="label">
  62. <NumberAnimation :value="ReplaceNull(alarmjsondata.device.total,'0')" :decimal="0" />
  63. <span class="unitname">台</span>
  64. </div>
  65. </div>
  66. <div style="margin: 0 5%; width:1px;border-left:1px solid #168895 ;"></div>
  67. <div>
  68. <div class="littleFont">落卷停机数</div>
  69. <div class="label">
  70. <NumberAnimation :value="ReplaceNull(alarmjsondata.device.stop6,'0')" :decimal="0" />
  71. <span class="unitname">台</span>
  72. </div>
  73. <div class="littleFont" style="margin-top: calc(30px*var(--hRate));">其他停机数</div>
  74. <div class="label">
  75. <NumberAnimation :value="ReplaceNull(alarmjsondata.device.alarm,'0')" :decimal="0" />
  76. <span class="unitname">台</span>
  77. </div>
  78. </div>
  79. <div style="width:15%;">
  80. <div class="littleFont">断纱停机数</div>
  81. <div class="label">
  82. <NumberAnimation :value="ReplaceNull(alarmjsondata.device.stop2,'0')" :decimal="0" />
  83. <span class="unitname">台</span>
  84. </div>
  85. <div class="littleFont" style="margin-top: calc(30px*var(--hRate));">盘头小于200圈</div>
  86. <div class="label">
  87. <NumberAnimation :value="ReplaceNull(alarmjsondata.device.stopPan,'0')" :decimal="0" />
  88. <span class="unitname">台</span>
  89. </div>
  90. </div>
  91. <div>
  92. <div class="littleFont">停经片停机数</div>
  93. <div class="label">
  94. <NumberAnimation :value="ReplaceNull(alarmjsondata.device.stop1,'0')" :decimal="0" />
  95. <span class="unitname">台</span>
  96. </div>
  97. <div class="littleFont" style="margin-top: calc(30px*var(--hRate));">当前开机率</div>
  98. <div class="label">
  99. <NumberAnimation :value="ReplaceNull(alarmjsondata.device.runningRatio,'0')" :decimal="2" />
  100. <span class="unitname">%</span>
  101. </div>
  102. </div>
  103. <div>
  104. <div class="littleFont">叫料数</div>
  105. <div class="label">
  106. <NumberAnimation :value="ReplaceNull(alarmjsondata.device.stop8,'0')" :decimal="0" />
  107. <span class="unitname">台</span>
  108. </div>
  109. <div class="littleFont" style="margin-top: calc(30px*var(--hRate));">当日开机率</div>
  110. <div class="label">
  111. <NumberAnimation :value="ReplaceNull(indexjsondata.device.runningRatio,'0')" :decimal="2" />
  112. <span class="unitname">%</span>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. <div for="IN02" id="dev_alarm" ref="dev_alarm" show="当前告警" style="color: #ffffff;font-size: 14px;">
  118. <div class="title_row" style="font-weight: normal;">
  119. <div class="title_left_line"></div><span>当前告警</span>
  120. </div>
  121. <div class="content">
  122. <table style="width: 100%;font-weight:normal;" cellspacing=0>
  123. <thead>
  124. <tr>
  125. <td class="label" style="width: 30%;text-align: center;">设备编号</td>
  126. <td class="label" style="width: 70%">告警类型</td>
  127. </tr>
  128. </thead>
  129. </table>
  130. <div style="height: 128px;width: 100%;overflow: hidden;">
  131. <table v-show="AlarmData.length>0" id="dev_alarm_list" ref="dev_alarm_list" style="width: 100%;background: transparent;" cellspacing=0>
  132. <tbody>
  133. <tr v-for="item in alarmDevList" @click="clickalarmtr(item)" :devno="item.devcode"><td style="width: 30%;text-align: center;">{{item.devcode}}#</td><td :style="'width: 70%;color:'+ item.color">{{ item.typename }}</td></tr>
  134. </tbody>
  135. </table>
  136. </div>
  137. <div style="margin-top: 20px;">
  138. <div style="text-align: center;"><img src="../../assets/image/alarm_txt.png"></div>
  139. <div class="echarts_alarm" ref="echarts_alarm" id="echarts_alarm" style="height: calc(180px*var(--hRate));width: 100%;">
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. <div for="IN02" id="dev_stop" ref="dev_stop" show="停机原因" style="color: #ffffff;font-size: 14px;">
  145. <div class="title_row" style="font-weight: normal;">
  146. <div class="title_left_line"></div><span>停机原因</span>
  147. </div>
  148. <div class="content">
  149. <div class="echarts_stop" ref="echarts_stop" id="echarts_stop" style="height: calc(280px*var(--hRate));width: 100%;"></div>
  150. </div>
  151. </div>
  152. <div for="IN02" id="dev_xiaolv" show="生产效率" style="color: #ffffff;font-size: 14px;">
  153. <div class="title_row" style="font-weight: normal;">
  154. <div class="title_left_line"></div><span>生产效率</span>
  155. </div>
  156. <div class="content">
  157. <div style="max-height: 96px;width: 100%;overflow: hidden;font-size: 12px;">
  158. <table style="width: 100%;" cellspacing=0>
  159. <thead>
  160. <tr>
  161. <td class="label" style="width: 10%;text-align: center;">班组</td>
  162. <td class="label" style="width: 25%">生产时间(H)</td>
  163. <td class="label" style="width: 25%">已生产数(米)</td>
  164. <td class="label" style="width: 20%">总重量(T)</td>
  165. <td class="label" style="width: 20%">稼动率(%)</td>
  166. </tr>
  167. </thead>
  168. <tbody>
  169. <tr id="scxl_a">
  170. <td style="width: 10%;text-align: center;">A组</td>
  171. <td style="width: 25%;">{{ scxljsondata.atime }}</td>
  172. <td style="width: 25%;">{{ scxljsondata.alength }}</td>
  173. <td style="width: 20%;">{{ scxljsondata.aweight }}</td>
  174. <td style="width: 20%;">{{ scxljsondata.aefficiency }}</td>
  175. </tr>
  176. <tr id="scxl_b">
  177. <td style="width: 10%;text-align: center;">B组</td>
  178. <td style="width: 25%;">{{ scxljsondata.btime }}</td>
  179. <td style="width: 25%;">{{ scxljsondata.blength }}</td>
  180. <td style="width: 20%;">{{ scxljsondata.bweight }}</td>
  181. <td style="width: 20%;">{{ scxljsondata.befficiency }}</td>
  182. </tr>
  183. </tbody>
  184. </table>
  185. </div>
  186. </div>
  187. </div>
  188. <div for="IN02" id="dev_jiadonglv" show="稼动率周曲线" style="color: #ffffff;font-size: 14px;">
  189. <div class="title_row" style="font-weight: normal;">
  190. <div class="title_left_line"></div><span>稼动率周曲线</span>
  191. </div>
  192. <div class="content">
  193. <div class="echarts_jiadonglv" ref="echarts_jiadonglv" id="echarts_jiadonglv" style="height: 142px;width: 100%;"></div>
  194. </div>
  195. </div>
  196. <div for="IN02" id="dev_sc_qushi" show="生产趋势" style="color: #ffffff;font-size: 14px;">
  197. <div class="title_row" style="font-weight: normal;">
  198. <div class="title_left_line"></div><span>生产趋势</span>
  199. </div>
  200. <div class="content">
  201. <div class="echarts_sc_qushi" ref="echarts_sc_qushi" id="echarts_sc_qushi" style="height: 142px;width: 100%;"></div>
  202. </div>
  203. </div>
  204. <div for="IN02" id="dev_used_qushi" show="能耗趋势" style="color: #ffffff;font-size: 14px;">
  205. <div class="title_row" style="font-weight: normal;">
  206. <div class="title_left_line"></div><span>能耗趋势</span>
  207. </div>
  208. <div class="content">
  209. <div class="echarts_used_qushi" ref="echarts_used_qushi" id="echarts_used_qushi" style="height: 142px;width: 100%;"></div>
  210. </div>
  211. </div>
  212. <div for="IN02" id="imp_item" v-if="isShowImpItem" desc="导出功能菜单">
  213. <div :itemcode="index+1" v-for="(item,index) in impFuncList" @click.stop="showImpWin(item,$event)"><span style="display:inline-block;width:85%;">{{ item.name }}</span><img src="../../assets/image/imp2.png" style="float: right;margin-top: 7px;"></div>
  214. <div @click.stop="showTTT"><span>毯业加工成本</span><img src="../../assets/image/imp2.png" style="float: right;margin-top: 7px;"></div>
  215. </div>
  216. <div id="ttt" class="showinfo" v-if="isShowTTT" style="height: 630px;margin-top: -315px;">
  217. <div class="title">
  218. <img src="../../assets/image/title_icon.png" style="margin: 7px;float: left;">
  219. <span class="text">毯业加工成本-经编车间</span>
  220. <img src="../../assets/image/Close.png" style="margin: 7px;float: right;cursor: pointer;" @click="HideWindow">
  221. </div>
  222. <div class="content">
  223. <table cellspacing="0" cellpadding="0" style="width: 100%;text-align: center;color: #fff">
  224. <thead>
  225. <tr style="font-weight: bold;background:rgb(66 90 121);">
  226. <td rowspan="2" style="border-right: 1px solid #767e9d !important;">项目</td>
  227. <td colspan="2" style="border-right: 1px solid #767e9d !important;border-bottom: 1px solid #767e9d !important;">2024年</td>
  228. <td colspan="2" style="border-right: 1px solid #767e9d !important;border-bottom: 1px solid #767e9d !important;">2023年</td>
  229. <td colspan="2" style="border-right: 1px solid #767e9d !important;border-bottom: 1px solid #767e9d !important;">差异</td>
  230. <td rowspan="2" >原因分析</td>
  231. </tr>
  232. <tr style="font-weight: bold;background:rgb(66 90 121);">
  233. <td style="border-right: 1px solid #767e9d !important;">28169</td><td style="border-right: 1px solid #767e9d !important;">单位成本</td><td style="border-right: 1px solid #767e9d !important;">21574</td><td style="border-right: 1px solid #767e9d !important;">单位成本</td><td style="border-right: 1px solid #767e9d !important;">6594</td><td style="border-right: 1px solid #767e9d !important;">单位成本</td></tr>
  234. </thead>
  235. <tbody>
  236. <tr style="font-weight:bold;background:rgb(236 239 243 / 48%)" v-for="item in tttData">
  237. <td v-for="item2 in item">{{ item2 }}</td>
  238. </tr>
  239. </tbody>
  240. </table>
  241. </div>
  242. </div>
  243. <!--毛高占比窗口-->
  244. <div id="maogaoWin" class="showinfo" v-if="isShowMaogaoWin">
  245. <div class="title">
  246. <img src="../../assets/image/title_icon.png" style="margin: 7px;float: left;">
  247. <span class="text">生产工艺总览</span>
  248. <img src="../../assets/image/Close.png" style="margin: 7px;float: right;cursor: pointer;" @click="cloasMaogaoWin">
  249. </div>
  250. <div class="content">
  251. <div style="height: 50px;width: 100%;">
  252. <table style="width: 100%;text-align: center;" cellspacing="0" cellpadding="0">
  253. <thead>
  254. <tr style="height: 50px;font-size:16px;">
  255. <td width="33%">毛高</td>
  256. <td width="1px" style="color: #817e7e">|</td>
  257. <td width="33%">设备数量</td>
  258. <td width="1px" style="color: #817e7e">|</td>
  259. <td width="33%">占比</td>
  260. </tr>
  261. </thead>
  262. </table>
  263. </div>
  264. <div style="height: 340px;overflow: auto;width: 100%;">
  265. <table style="width: 100%;text-align: center;" cellspacing="0" cellpadding="0">
  266. <tbody>
  267. <tr v-if="maogaoData.length==0"><td colspan="6" style="text-align:center">未查询到数据</td></tr>
  268. <template v-else>
  269. <tr v-for="item in maogaoData" style="color: #FFFFFF;font-size: 20px;cursor: pointer;" title="点击可查看详情" @click="OpenMaoGaoDetailWin(item)">
  270. <td width="33%">{{ item.height }}</td>
  271. <td width="1px" style="color: transparent">|</td>
  272. <td width="33%">{{ item.num }}</td>
  273. <td width="1px" style="color: transparent">|</td>
  274. <td width="33%">{{item.percent}}</td>
  275. </tr>
  276. </template>
  277. </tbody>
  278. </table>
  279. </div>
  280. </div>
  281. </div>
  282. <!--毛高占比详情窗口-->
  283. <div id="maogaoDetailWin" class="newwin" v-if="isShowMaogaoDetailWin">
  284. <div class="title">
  285. <img src="../../assets/image/title_icon.png" style="margin: 7px;float: left;">
  286. <span class="text">生产工艺详情</span>
  287. <img src="../../assets/image/Close.png" style="margin: 7px;float: right;cursor: pointer;" @click="cloasMaogaoDetailWin">
  288. </div>
  289. <div class="content">
  290. <div style="position: relative;height: 50px">
  291. <div id="imp_btn_maogaodetail" @click="impMaogaodetail" title="导出数据" style="cursor: pointer;position: absolute;right: 5px;top: 5px;height: 38px;width: 38px;">
  292. <img src="../../assets/image/imp_icon.png">
  293. </div>
  294. </div>
  295. <div style="height: 64px;">
  296. <table style="width: 100%;text-align: center;" cellspacing="0" cellpadding="0">
  297. <thead>
  298. <tr style="height: 32px;font-size:14px;">
  299. <td rowspan="2" width="60" style="border-right: 1px solid #76549b !important;">设备名称</td>
  300. <td rowspan="2" width="60" style="border-right: 1px solid #76549b !important;">机台号</td>
  301. <td rowspan="2" width="60" style="border-right: 1px solid #76549b !important;">毛高</td>
  302. <td rowspan="2" width="60" style="border-right: 1px solid #76549b !important;">配方号</td>
  303. <td rowspan="2" width="60" style="border-right: 1px solid #76549b !important;">米克重</td>
  304. <td colspan="5" width="300" style="border-right: 1px solid #76549b !important;border-bottom: 1px solid #76549b !important;">
  305. 送经量
  306. </td>
  307. <td colspan="3" width="180" style="border-bottom: 1px solid #76549b !important;">线纱规格D</td>
  308. </tr>
  309. <tr style="height: 32px;">
  310. <td width="60" style="border-right: 1px solid #76549b !important;">GB1</td>
  311. <td width="60" style="border-right: 1px solid #76549b !important;">GB2</td>
  312. <td width="60" style="border-right: 1px solid #76549b !important;">GB3</td>
  313. <td width="60" style="border-right: 1px solid #76549b !important;">GB4</td>
  314. <td width="60" style="border-right: 1px solid #76549b !important;">GB5</td>
  315. <td width="60" style="border-right: 1px solid #76549b !important;">L1、L5</td>
  316. <td width="60" style="border-right: 1px solid #76549b !important;">L2、L4</td>
  317. <td width="60">L3</td>
  318. </tr>
  319. </thead>
  320. </table>
  321. </div>
  322. <div style="height: 420px;overflow: auto;">
  323. <table style="width: 100%;text-align: center;" cellspacing="0" cellpadding="0">
  324. <tbody>
  325. <tr v-for="item in maogaoDetailData" :key="item.index">
  326. <td width="60">{{item.device}}</td>
  327. <td width="60">{{item.formula_data_2}}</td>
  328. <td width="60">{{item.formula_data_15}}</td>
  329. <td width="60">{{item.formula_data_1}}</td>
  330. <td width="60">{{item.formula_data_3}}</td>
  331. <td width="60">{{item.formula_data_19}}</td>
  332. <td width="60">{{item.formula_data_20}}</td>
  333. <td width="60">{{item.formula_data_21}}</td>
  334. <td width="60">{{item.formula_data_22}}</td>
  335. <td width="60">{{item.formula_data_23}}</td>
  336. <td width="60">{{item.formula_data_4}}</td>
  337. <td width="60">{{item.formula_data_5}}</td>
  338. <td width="60">{{item.formula_data_6}}</td>
  339. </tr>
  340. </tbody>
  341. </table>
  342. </div>
  343. </div>
  344. </div>
  345. <div id="iframeWin" v-if="isShowIframeWin" :class="iframeWinData.class">
  346. <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>
  347. <div class="content"><iframe id="ifrm" :src="iframeWinData.src" class=""></iframe></div>
  348. </div>
  349. <Imp01 v-if="impItemCode=='01'" :xy="impItemShowDivXY"></Imp01>
  350. <Imp02 v-if="impItemCode=='02'" :xy="impItemShowDivXY"></Imp02>
  351. <Imp03 v-if="impItemCode=='03'" :xy="impItemShowDivXY"></Imp03>
  352. <Imp04 v-if="impItemCode=='04'" :xy="impItemShowDivXY"></Imp04>
  353. <Imp05 v-if="impItemCode=='05'" :xy="impItemShowDivXY"></Imp05>
  354. <Imp06 v-if="impItemCode=='06'" :xy="impItemShowDivXY"></Imp06>
  355. <Imp08 v-if="impItemCode=='08'" :xy="impItemShowDivXY"></Imp08>
  356. <Imp10 v-if="impItemCode=='10'" :xy="impItemShowDivXY"></Imp10>
  357. <Imp11 v-if="impItemCode=='11'" :xy="impItemShowDivXY"></Imp11>
  358. <Imp12 v-if="impItemCode=='12'" :xy="impItemShowDivXY"></Imp12>
  359. <Imp13 v-if="impItemCode=='13'" :xy="impItemShowDivXY"></Imp13>
  360. <Imp14 v-if="impItemCode=='14'" :xy="impItemShowDivXY"></Imp14>
  361. <Imp15 v-if="impItemCode=='15'" :xy="impItemShowDivXY"></Imp15>
  362. </div>
  363. </template>
  364. <script>
  365. import { ref,onMounted,onUnmounted,watch } from 'vue';
  366. import * as echarts from 'echarts';
  367. import {useRouter} from 'vue-router';
  368. import api from "@/api/system";
  369. import impapi from "@/api/imp";
  370. import Imp01 from "../imp/imp01.vue"
  371. import Imp02 from "../imp/imp02.vue"
  372. import Imp03 from "../imp/imp03.vue"
  373. import Imp04 from "../imp/imp04.vue"
  374. import Imp05 from "../imp/imp05.vue"
  375. import Imp06 from "../imp/imp06.vue"
  376. import Imp08 from "../imp/imp08.vue"
  377. import Imp10 from "../imp/imp10.vue"
  378. import Imp11 from "../imp/imp11.vue"
  379. import Imp12 from "../imp/imp12.vue"
  380. import Imp13 from "../imp/imp13.vue"
  381. import Imp14 from "../imp/imp14.vue"
  382. import Imp15 from "../imp/imp15.vue"
  383. import NumberAnimation from './NumberAnimation.vue'
  384. export default {
  385. components:{
  386. Imp01,Imp02,Imp03,Imp04,Imp05,Imp06,Imp08,Imp10,Imp11,Imp12,Imp13,Imp14,Imp15,
  387. NumberAnimation
  388. },
  389. props:{
  390. clickEvent:{
  391. type:Object,
  392. required: true,
  393. default:{}
  394. },
  395. in02ModelLoadState:{
  396. type:Boolean
  397. },
  398. userTimeout:{
  399. type:Boolean
  400. },
  401. userRole:{
  402. type:String
  403. }
  404. },
  405. setup(props,{emit}) {
  406. const router = useRouter();
  407. const showIndexData=ref('');
  408. let impItemCode=ref('');
  409. let impItemShowDivXY = ref({top:0,left:0});
  410. let AutoPlayer=ref(false);
  411. let isShowFuncMenuList=ref(false);
  412. let isShowImpItem = ref(null);
  413. let isshow_search_result = ref(false);
  414. let search_result_list = ref([]);
  415. let seachValue = ref([]);
  416. let LastClickObj='';
  417. let dbClickTimer =null;
  418. let openState = false;
  419. let modelsMap = {};
  420. let MarkerMap = {};//标记记录
  421. let MODEL_LOADED = 1;
  422. let ALARM_DEVS=[];
  423. let OFFLINE_DEVS={}
  424. let indexjsondata=ref({device:{},weekData:[],efficiency:{}});
  425. let alarmjsondata=ref({device:{}});
  426. let scxljsondata=ref({});
  427. let alarmWeek=ref([]);
  428. let AlarmData=ref([]);
  429. let tttData = ref([]);
  430. let stopDeviceNum = ref(0);
  431. const echarts_stop = ref(null);
  432. const echarts_jiadonglv = ref(null);
  433. const echarts_sc_qushi = ref(null);
  434. const echarts_used_qushi = ref(null);
  435. const echarts_alarm = ref(null);
  436. let dev_alarm_echarts = ref(null);
  437. const dev_stop=ref(null);
  438. const dev_alarm = ref(null);
  439. const dev_alarm_list = ref(null);
  440. const StopDevList=ref([]);
  441. let DiffStatusDevList=ref({});
  442. let alarmDevList=ref([]);
  443. let devAlarmAutoLoadTimter=null;
  444. let Pan={};
  445. let LastAlarmDevs={};
  446. let PanAlarm={};//盘头告警记录
  447. let deviceInfo=ref({});
  448. let dataTimer1=null;
  449. let dataTimer2=null;
  450. let dataTimer3=null;
  451. let dataTimer4=null;
  452. let maogaoData=ref([]);
  453. let maogaoDetailData = ref([]);
  454. let maogaoDetailHeight=0;
  455. let isShowMaogaoWin = ref(false);
  456. let isShowMaogaoDetailWin = ref(false);
  457. let isShowTTT = ref(false);
  458. let isShowIframeWin = ref(false);
  459. let iframeWinData = ref({});
  460. let cacheNameRGB = {};
  461. //导出功能 列表项
  462. let impFuncList=ref([
  463. {name:'生产数据',path:'/imp-01',title:'',code:"01",type:"impWin"},
  464. {name:'停机原因',path:'/imp-02',title:'',code:"02",type:"impWin"},
  465. {name:'断纱分析',path:'/imp-03',title:'',code:"03",type:"impWin"},
  466. {name:'并发叫料分析',path:'/imp-04',title:'',code:"04",type:"impWin"},
  467. {name:'并发下卷分析',path:'/imp-05',title:'',code:"05",type:"impWin"},
  468. //{name:'告警分析',path:'/imp-06',title:'',code:"06",type:"impWin"},
  469. {name:'平方米克重',path:'/imp-07',title:'',code:"07"},
  470. {name:'纱线规格',path:'/imp-08',title:'',code:"08",type:"impWin"},
  471. {name:'送经量',path:'/imp-09',title:'',code:"09"},
  472. //{name:'生产绩效日报',path:'/imp-10',title:'',code:"10",type:"impWin"},
  473. //{name:'生产绩效月报',path:'/imp-11',title:'',code:"11",type:"impWin"},
  474. //{name:'车间能耗日报',path:'/imp-12',title:'',code:"12",type:"impWin"},
  475. //{name:'车间能耗月报',path:'/imp-13',title:'',code:"13",type:"impWin"},
  476. {name:'白坯布靶向预测',path:'/imp-14',title:'',code:"14",type:"impWin"},
  477. {name:'能耗统计报表',path:'/imp-15',title:'',code:"15",type:"impWin"},
  478. ]);
  479. let AlarmType={
  480. "1": "GB1伺服通讯故障",
  481. "2": "GB2伺服通讯故障",
  482. "3": "GB3伺服通讯故障",
  483. "4": "GB4伺服通讯故障",
  484. "5": "GB5伺服通讯故障",
  485. "6": "牵引伺服通讯故障",
  486. "7": "卷曲伺服通讯故障",
  487. "8": "断纱故障",
  488. "9": "电源故障",
  489. "10": "联动未完全啮合",
  490. "11": "米长到达",
  491. "12": "GB1剩余圈数报警",
  492. "13": "GB2剩余圈数报警",
  493. "14": "GB3剩余圈数报警",
  494. "15": "GB4剩余圈数报警",
  495. "16": "GB5剩余圈数报警",
  496. "17": "主轴变频掉线",
  497. "18": "主轴变频故障",
  498. "19": "GB1伺服故障",
  499. "20": "GB2伺服故障",
  500. "21": "GB3伺服故障",
  501. "22": "GB4伺服故障",
  502. "23": "GB5伺服故障",
  503. "24": "牵引伺服故障",
  504. "25": "卷曲伺服故障",
  505. "26": "拍照自停",
  506. "27": "CCD位置报警信息显示",
  507. "1000": "", //盘头比例低于20%
  508. "1001": "", //盘头比例低于50%
  509. "10001": "停经片停机",
  510. "10002": "CCD断纱停机",
  511. "10006": "落布米数到达停机",
  512. "10008": "叫料停机"
  513. }
  514. //告警指示灯颜色
  515. let AlarmColorTypeCode={
  516. "1": "FF0000", //红色
  517. "2": "FF0000",
  518. "3": "FF0000",
  519. "4": "FF0000",
  520. "5": "FF0000",
  521. "6": "FF0000",
  522. "7": "FF0000",
  523. "8": "FF0000",
  524. "9": "FF0000",
  525. "10": "FFFF00", //黄色
  526. "11": "FFFF00", //黄色
  527. "12": "FFFF00", //黄色
  528. "13": "FFFF00", //黄色
  529. "14": "FFFF00", //黄色
  530. "15": "FFFF00", //黄色
  531. "16": "FFFF00", //黄色
  532. "17": "FF0000", //红色
  533. "18": "FF0000", //红色
  534. "19": "FF0000", //红色
  535. "20": "FF0000", //红色
  536. "21": "FF0000", //红色
  537. "22": "FF0000", //红色
  538. "23": "FF0000", //红色
  539. "24": "FF0000", //红色
  540. "25": "FF0000",
  541. "26": "FFFF00",
  542. "27": "FFFF00",
  543. "1000": "", //盘头比例低于20%
  544. "1001": "", //盘头比例低于50%
  545. "10001": "FFFF00", //黄色
  546. "10002": "FFFF00", //黄色
  547. "10006": "FFFF00", //黄色
  548. "10008": "FFFF00" //黄色
  549. }
  550. //停机原因类型
  551. let StopType={
  552. "stop1": "停经片停机",
  553. "stop2": "CCD停机",
  554. "stop3": "人工停机",
  555. "stop4": "断电停机",
  556. "stop5": "设备故障停机",
  557. "stop6": "落布米数达到停机",
  558. "stop7": "盘头剩余圈数达到停机",
  559. }
  560. watch(() => props.clickEvent, newVal=> {
  561. if(newVal==null){
  562. HideWindow();
  563. return;
  564. }
  565. console.log('-----click:',newVal);
  566. updateInfo('LClick',newVal)
  567. },{deep:true,immediate:true})
  568. watch(() => props.in02ModelLoadState, newVal=> {
  569. console.log('经编模型加载状态:',newVal)
  570. if(newVal){
  571. init();
  572. }
  573. },{deep:true,immediate:true})
  574. watch(() => props.userTimeout, newVal=> {
  575. console.log('IN02 userTimeout value:',newVal)
  576. if(newVal){
  577. if (!AutoPlayer.value && window.CurrentTargetType=='IN02') switchAutoPlayer(); //开启自动漫游
  578. }
  579. },{deep:true,immediate:true})
  580. watch(() => props.userRole, newVal=> {
  581. showIndexData.value = newVal;
  582. },{deep:true,immediate:true})
  583. let DataFull={
  584. GetData:function(){
  585. if(api==null) return;
  586. api.GetData().then((res)=> {
  587. if(window.CurrentTargetType!='IN02') return;
  588. dataTimer1 = setTimeout(function () {
  589. //每60秒主动查询一次数据
  590. DataFull.GetData()
  591. }, INDEX_TIMEOUT);
  592. if (res == null || res.code != 0 || window.CurrentTargetType!='IN02') {
  593. return
  594. }
  595. indexjsondata.value = res.data;
  596. for(var k in res.data.efficiency) {
  597. res.data.efficiency[k] = res.data.efficiency[k].toFixed(2);
  598. }
  599. scxljsondata.value = res.data.efficiency;
  600. AlarmLine(res.data.weekData);
  601. StopLine(res.data.weekData);
  602. LoadJDL(res.data.weekData);
  603. LoadSCLine(res.data.weekData);
  604. LoadUsedLine(res.data.weekData);
  605. //$("#dev_state .content .stat .runningRatio").html(jsondata.device.runningRatio);
  606. //DataFill.AlarmLine(jsondata.weekData)
  607. //DataFill.StopLine(jsondata.weekData)
  608. //DataFill.LoadSCXL(jsondata.efficiency)
  609. //DataFill.LoadJDL(jsondata.weekData)
  610. //DataFill.LoadSCLine(jsondata.weekData)
  611. //DataFill.LoadUsedLine(jsondata.weekData)
  612. })
  613. },
  614. GetAlarmData:function(){
  615. api.GetAlarmData().then(res=>{
  616. if(window.CurrentTargetType!='IN02') return;
  617. dataTimer2 = setTimeout(function () {
  618. //每10秒主动查询一次数据
  619. DataFull.GetAlarmData()
  620. }, ALARM_TIMEOUT);
  621. if (res == null || res.code != 0 || window.CurrentTargetType!='IN02') {
  622. return
  623. }
  624. alarmjsondata.value = res.data;
  625. //DataFill.DevInfo(jsondata.device)
  626. AlarmTable(res.data.alarm);
  627. LoadPan(res.data.pan);
  628. })
  629. },
  630. //获取已接入平台设备列表.将在设备模型加载完成后进行初始调用
  631. GetOnlineDev:function(){
  632. api.GetOnlineDev().then(res=> {
  633. if(window.CurrentTargetType!='IN02') return;
  634. dataTimer3 = setTimeout(function () {
  635. //每5分钟主动查询一次数据
  636. DataFull.GetOnlineDev();
  637. }, ONLIME_TIMEOUT);
  638. if (res == null || res.code != 0 ||window.CurrentTargetType!='IN02') {
  639. return
  640. }
  641. var jsondata = "," + res.data.join(",") + ",";
  642. for (var devcode in modelsMap) {
  643. //判断当前设备是否在在线设备列表中
  644. //设备原来未接入,现在接入了才恢复正常颜色
  645. if (jsondata.indexOf("," + devcode + ",") > -1) {
  646. //设备已接入
  647. if (OFFLINE_DEVS[devcode] != null) {
  648. ChangeModelColor(devcode); //恢复原颜色
  649. ChangeModelAlarmState2(devcode);//"00ff00"
  650. OFFLINE_DEVS[devcode] = null;
  651. console.log('设备上线:', devcode)
  652. }
  653. } else {
  654. if (OFFLINE_DEVS[devcode] == null) {
  655. //设备未接入
  656. ChangeModelColor(devcode, DEV_OFFLINE_COLOR);
  657. ChangeModelAlarmState2(devcode);
  658. OFFLINE_DEVS[devcode] = 1
  659. console.log('离线设备:',devcode)
  660. }
  661. }
  662. }
  663. })
  664. },
  665. GetStopDev:function(){
  666. impapi.Get00Data().then(async (res)=>{
  667. dataTimer4 = setTimeout(function () {
  668. //每60秒主动查询一次数据
  669. DataFull.GetStopDev();
  670. }, INDEX_TIMEOUT);
  671. if(res.code!=0){
  672. return;
  673. }
  674. res.data.detail.map(item=>{
  675. DiffStatusDevList.value[item.device] = item;
  676. });
  677. if(StopDevList.value!=null && StopDevList.value.length>0){
  678. //找出状态有变化的设备
  679. for(var i=0;i<StopDevList.value.length;i++){
  680. var item = StopDevList.value[i];
  681. if(DiffStatusDevList.value[item.device]==null){
  682. continue;
  683. }
  684. if(item.status==DiffStatusDevList.value[item.device].status){
  685. delete DiffStatusDevList.value[item.device];
  686. }
  687. }
  688. }
  689. for(var k in DiffStatusDevList.value){
  690. let item = DiffStatusDevList.value[k];
  691. //状态=0的显示生产中 蓝色,其他停机显示红色
  692. let devIten=modelsMap["C_"+item.device]||modelsMap["D_"+item.device];
  693. if(devIten==null) continue
  694. if(player!=null && player.Native!=null)player.Native.GisMarker.destroy(devIten['markPtr']);
  695. let imgid = null;
  696. let options = null;
  697. console.log('设备状态变化:',item.device,"====",item.device*1%2)
  698. if(item.status=="0"){
  699. //正常生产态
  700. imgid = await player.Native.GisMarker.loadImage("data://icon/qietu/tip3.png");
  701. options = {
  702. "text": " "+ k + "#"+"\r\r 正常生产中",
  703. "visible": true,
  704. //"maxLod": 100,
  705. //"minLod": 2,
  706. "textFontSize": 16,
  707. "textAlign": "center",
  708. "contentPadding": [2,2,2,2],
  709. "nodeOffset": (item.device*1%2)==0 ? [-120,-340] : [-140,-160],
  710. "textColor": parseInt("0xffffffff")
  711. };
  712. options.imgSize = [160, 80];
  713. }else{
  714. //停经 断纱 落卷 叫料 黄色
  715. if(item.status=="1"||item.status=="7"||item.status=="2"||item.status=="6"){
  716. imgid = await player.Native.GisMarker.loadImage("data://icon/qietu/tip_yellow.png");
  717. options = {
  718. "text":" "+ k + "#"+"\r\r "+item.remark,
  719. "visible": true,
  720. //"maxLod": 100,
  721. //"minLod": 0.1,
  722. "textFontSize": 16,
  723. "contentPadding": [2,2,2,2],
  724. "textAlign": "center",
  725. "nodeOffset": (item.device*1%2)==0 ? [-120,-340] : [-140,-160],
  726. "textColor": parseInt("0xffffffff")
  727. };
  728. options.imgSize = [160, 80];
  729. }else{
  730. imgid = await player.Native.GisMarker.loadImage("data://icon/qietu/tip_red.png");
  731. options = {
  732. "text":" "+ k + "#"+"\r\r "+item.remark,
  733. "visible": true,
  734. //"maxLod": 100,
  735. //"minLod": 0.1,
  736. "textFontSize": 16,
  737. "contentPadding": [2,2,2,2],
  738. "textAlign": "center",
  739. "nodeOffset": (item.device*1%2)==0 ? [-120,-340] : [-140,-160],
  740. "textColor": parseInt("0xffffffff")
  741. };
  742. options.imgSize = [160, 80];
  743. }
  744. }
  745. options.imgId = imgid
  746. options.pos = [devIten.xyz[0]+1, devIten.xyz[1]-3, 0]
  747. let markPtr = await player.Native.GisMarker.create(options);
  748. player.Native.GisMarker.update(markPtr, options);
  749. devIten['markPtr'] = markPtr;
  750. }
  751. StopDevList.value = res.data.detail;
  752. }).catch(res=>{
  753. console.log("设备停机数据获取失败!",res);
  754. });
  755. },
  756. }
  757. function search() {
  758. if (seachValue.value == "") {
  759. search_result_list.value = [];
  760. return
  761. }
  762. isshow_search_result.value=true;
  763. var lst = [];
  764. for (var k in modelsMap) {
  765. if (k.indexOf(seachValue.value) > -1) {
  766. lst.push({"code":k,"name":k.replace("C_", "小经编机").replace("D_", "大经编机")});
  767. }
  768. }
  769. search_result_list.value = lst;
  770. }
  771. function switchAutoPlayer(){
  772. AutoPlayer.value = !AutoPlayer.value;
  773. if (AutoPlayer.value) {
  774. try {
  775. //循环播放
  776. player.Native.CameraAnimation.setLoop(true);
  777. // 播放动画
  778. player.Native.CameraAnimation.start();
  779. } catch (e) {
  780. }
  781. } else {
  782. try {
  783. player.Native.CameraAnimation.stop();
  784. } catch (e) {
  785. }
  786. }
  787. }
  788. async function init(){
  789. backMasterViewBy02();
  790. (async()=>{
  791. let marklst = await player.Native.GisMarker.getMarkerList();
  792. if(marklst!=null){
  793. for(var i=0;i<marklst.length;i++){
  794. if(player!=null && player.Native!=null)player.Native.GisMarker.destroy(marklst[i].id)
  795. }
  796. }
  797. })();
  798. for (var i in ANIMATION_DATA) {
  799. // 添加关键帧
  800. player.Native.CameraAnimation.addKeyFrames([ANIMATION_DATA[i]]);
  801. }
  802. //let cfInfo=await player.Native.Model.getInfo("all");
  803. //player.Native.NodeProxy.setNodeRotation(cfInfo.nodePtr, [0,0,90]);
  804. var rootItem = await player.Native.ModelTree.getRootItems();
  805. var rootObj=null;
  806. for (var i = 0; i < rootItem.length; i++) {
  807. if(rootItem[i].name=="T_02"){
  808. rootObj = rootItem[i]
  809. break;
  810. }
  811. }
  812. if(rootObj==null){
  813. console.log('未找到该模型的根节点')
  814. return;
  815. }
  816. var rowItems = await player.Native.ModelTree.getSubItems(rootObj.item)
  817. for (var row = 0; row < rowItems.length; row++) {
  818. if (rowItems[row].name.length < 2 || (rowItems[row].name.substr(0, 1) != "R" && rowItems[row].name.substr(0, 1) != "D")) continue;
  819. var devItems = await player.Native.ModelTree.getSubItems(rowItems[row].item)
  820. for (var i = 0; i < devItems.length; i++) {
  821. if (devItems[i].name.length < 2 || (devItems[i].name.substr(0, 2) != 'C_' && devItems[i].name.substr(0, 2) != 'D_')) continue
  822. var tmp = devItems[i];// await player.Native.ModelTree.findItemByName(name,0,true,3);
  823. //计算当前设备在世界坐标
  824. var xyz = await player.Native.ModelTree.calcItemAabb(tmp.item)
  825. var xyz2 = [(xyz.aabb.max[0] + xyz.aabb.min[0]) * 0.5, (xyz.aabb.max[1] + xyz.aabb.min[1]) * 0.5, (xyz.aabb.max[2] + xyz.aabb.min[2]) * 0.5];
  826. modelsMap[tmp.name] = {item: tmp.item, xyz: xyz2, rowno: rowItems[row].name.substr(1)}
  827. //console.log(tmp.name)
  828. //初始化设备状态颜色
  829. ChangeModelAlarmState2(tmp.name);
  830. //创建指示灯标记
  831. /*
  832. var alarmColorMarker = {
  833. "text": "●",
  834. "visible": true,
  835. "maxLod": 110,
  836. "minLod": 0.1,
  837. "textFontSize": 14,
  838. "textColor": parseInt("0xffffff00") //透明色
  839. }
  840. alarmColorMarker.pos = [xyz2[0] + 0.7, xyz2[1] - 3, 0]
  841. var colormarkPtr = await player.Native.GisMarker.create(alarmColorMarker);
  842. player.Native.GisMarker.update(colormarkPtr, alarmColorMarker);
  843. modelsAlarmColorMap[tmp.name] = {itemPtr: colormarkPtr, options: alarmColorMarker}
  844. */
  845. }
  846. }
  847. //console.log(modelsMap)
  848. clearTimeout(dataTimer1);
  849. clearTimeout(dataTimer2);
  850. clearTimeout(dataTimer3);
  851. clearTimeout(dataTimer4);
  852. DataFull.GetData();
  853. DataFull.GetAlarmData();
  854. DataFull.GetOnlineDev();
  855. DataFull.GetStopDev();
  856. if (ALARM_DEVS.length > 0) {
  857. for (var i = 0; i < ALARM_DEVS.length; i++) {
  858. var s = ALARM_DEVS[i].split(">")
  859. //ChangeModelColor(s[0],s[1] , s[2]);
  860. ChangeModelAlarmState2(s[0], s[1]);
  861. }
  862. ALARM_DEVS = [];//清除
  863. }
  864. }
  865. //经编 2号楼内部最佳视图
  866. function backMasterViewBy02() {
  867. if(window.CurrentTargetType!='IN02') return;
  868. if (AutoPlayer.value) {
  869. AutoPlayer.value=false;
  870. try {
  871. player.Native.CameraAnimation.stop();
  872. } catch (e) {
  873. }
  874. }
  875. // player.Native.Camera.moveTo([-60.91624261330108, -39.68511717426356, 85.99570940739352], [-61.26059834308166, -0.225858934410347, -0.5930273740619612], [-0.007940809332449061, 0.9099266223396253, 0.41469324265623975], 1);
  876. /*player.Native.Camera.moveTo([7.630977787770181, -19.831384507538644, 3.1479712959809714],
  877. [-18.374309539794922, -20.014415740966797, 0],
  878. [-0.1600317165278932, 0.0027650086325702416, 0.9871080003892169], 1);
  879. */
  880. //-18.330399532189816, -36.35682993987315, 20.472951979735864
  881. //-18.374309539794922, -20.01441574096679, -7.105427357601002
  882. //0.004097338015901916, 0.7815354812192895, 0.6238473398328448
  883. player.Native.Camera.moveTo([-16.875883106106, -40.239128553583534, 25.62119307690701],
  884. [-17.089787852639105, -19.014737178759784, -1.310617574676634],
  885. [-0.002761719036738653, 0.7854016082664139, 0.6189803604642822], 1);
  886. }
  887. //更改指示灯状态.版本2:更改设备标号牌旁边的指示灯模型
  888. //绿灯为G 红灯为R 黄灯为Y
  889. //如果没有告警和停机,显示绿灯另外2个隐藏
  890. //CCD 叫料 停经片停机显示黄灯另外2个隐藏
  891. //有故障和掉线二字的显示红灯,其他都显示黄灯
  892. async function ChangeModelAlarmState2(name, color) {
  893. if(player.Native==null || window.CurrentTargetType!='IN02') return;
  894. color = color==null ? "" : color.toUpperCase();
  895. var iteminfo = modelsMap[name]
  896. if (iteminfo == null) return;
  897. var t = (!color ||color=="00FF00"||color=="FFFFFF")?"g":(color=="FF0000"?"r":"y");
  898. var y_itemid=null,g_itemid=null,r_itemid=null;
  899. if(cacheNameRGB[name]==null){
  900. y_itemid = await player.Native.ModelTree.findItemByName(name+"Y",iteminfo.item,true,1)
  901. g_itemid = await player.Native.ModelTree.findItemByName(name+"G",iteminfo.item,true,1)
  902. r_itemid = await player.Native.ModelTree.findItemByName(name+"R",iteminfo.item,true,1)
  903. cacheNameRGB[name]=[r_itemid,g_itemid,y_itemid];
  904. }else{
  905. y_itemid = cacheNameRGB[name][2];
  906. g_itemid = cacheNameRGB[name][1];
  907. r_itemid = cacheNameRGB[name][0];
  908. }
  909. player.Native.ModelTree.setItemVisible([y_itemid.item,g_itemid.item,r_itemid.item],false)
  910. if(t=='g'){
  911. player.Native.ModelTree.setItemVisible([g_itemid.item],true);
  912. return;
  913. }
  914. if(t=='r'){
  915. player.Native.ModelTree.setItemVisible([r_itemid.item],true);
  916. return;
  917. }
  918. if(t=='y'){
  919. player.Native.ModelTree.setItemVisible([y_itemid.item],true);
  920. return;
  921. }
  922. }
  923. //设置设置名称或者模型id的颜色
  924. async function ChangeModelColor(name, color, hinttxt) {
  925. if(player.Native==null || window.CurrentTargetType!='IN02') return;
  926. var iteminfo = modelsMap[name]
  927. if (iteminfo == null) return
  928. //var tmp = await player.Native.ModelTree.findItemByName(name,0,true,3);
  929. if (color == null || color == "") {
  930. if (OFFLINE_DEVS[name] == 1) return; //离线设备无需处理
  931. //还原
  932. await player.Native.ModelTree.restoreItemColor(iteminfo.item)
  933. //隐藏已有标签
  934. await player.Native.GisMarker.update(MarkerMap[name], {"visible": false});
  935. MarkerMap[name] = null;
  936. } else {
  937. await player.Native.ModelTree.setItemColor(iteminfo.item, parseInt("0x" + color + "ff"), true)
  938. if (hinttxt != null && hinttxt != "") {
  939. var srcPosition = iteminfo.xyz // await player.Native.NodeProxy.getNodePosition(temp.item);
  940. //console.log("posio",srcPosition)
  941. // 创建标记
  942. var options = {};
  943. if (MarkerOptMap[name] == null) {
  944. var imgid = await player.Native.GisMarker.loadImage("rgba:255,0,0,255");
  945. options = {
  946. "text": hinttxt,
  947. "visible": true,
  948. "maxLod": 130,
  949. "minLod": 0.1,
  950. "textColor": parseInt("0xffffffff")
  951. };
  952. options.pos = [srcPosition[0] - 1, srcPosition[1] - 2, srcPosition[2]];
  953. //options.parentNode=tmp.item;
  954. options.imgId = imgid
  955. options.imgSize = [-1, -1];
  956. MarkerOptMap[name] = options;
  957. } else {
  958. options = MarkerOptMap[name]
  959. options.text = hinttxt;
  960. }
  961. if (MarkerMap[name] != null) {
  962. await player.Native.GisMarker.update(MarkerMap[name], options);
  963. } else {
  964. var markPtr = await player.Native.GisMarker.create(options);
  965. await player.Native.GisMarker.update(markPtr, options);
  966. MarkerMap[name] = markPtr;
  967. }
  968. } else {
  969. await player.Native.GisMarker.update(MarkerMap[name], {"visible": false});
  970. }
  971. }
  972. }
  973. function showFuncMenuList(event){
  974. //event.stopPropagation();
  975. isShowFuncMenuList.value=true;
  976. }
  977. async function updateInfo(name, event) {
  978. if(player.Native==null) return;
  979. if(event.object==null) return;
  980. if (AutoPlayer.value)
  981. {
  982. //停止 自动漫游
  983. AutoPlayer.value=false;
  984. player.Native.CameraAnimation.stop();
  985. }
  986. if (name != "LClick") {
  987. HideWindow();
  988. return
  989. }
  990. //console.log(event)
  991. var ty = event.object.nodePtr != null ? 'NODE' : 'ITEM';
  992. var modelsId = ty == 'NODE' ? event.object.nodePtr : event.object.item;
  993. if (modelsId == null || modelsId == "") {
  994. HideWindow();
  995. return
  996. }
  997. var devName = null;
  998. var cnt = 0;
  999. var p = null;
  1000. while (devName == null) {
  1001. if (cnt > 5) break //最多查找5层
  1002. if (ty == 'NODE') p = await player.Native.NodeProxy.getNodeParent(modelsId) //节点类型的node
  1003. else p = await player.Native.ModelTree.getItemInfo(modelsId)
  1004. console.log('p:',p)
  1005. if (p.name != null &&p.name!=null && (p.name.substr(0, 2) == "C_")||p.name.substr(0, 2) == "D_") {
  1006. devName = p.name
  1007. break
  1008. }
  1009. modelsId = ty == 'NODE' ? p.nodePtr : p.parentItem;
  1010. cnt++
  1011. }
  1012. console.log('Lclick name:',devName,' LastClickObj:',LastClickObj)
  1013. if (devName == null) {
  1014. HideWindow();
  1015. return
  1016. }
  1017. if (devName == LastClickObj) {
  1018. if (dbClickTimer != null) clearTimeout(dbClickTimer)
  1019. HideWindow();
  1020. //双击
  1021. if (openState) return //窗口已经打开
  1022. OpenWin(devName)
  1023. return
  1024. }
  1025. HideWindow();
  1026. LastClickObj = devName
  1027. dbClickTimer = setTimeout(function (n) {
  1028. ShowInfo(n)
  1029. LastClickObj = null
  1030. }, 200, devName)
  1031. }
  1032. //显示设备基本信息
  1033. async function ShowInfo(name) {
  1034. var se = modelsMap[name];// await player.Native.ModelTree.findItemByName(name,0,true,3);
  1035. if(se==null || player.Native==null || window.CurrentTargetType!='IN02') return;
  1036. //选中
  1037. player.Native.ModelTree.setSelectItem(se.item);
  1038. var calcInfo = await PlayerUtils.call(player.Native.ModelTree.calcItemAabb, se.item);
  1039. //调整目标对象的视角和角度
  1040. if(se.rowno%2==0){
  1041. // 面索引,0表示不定位视角,可设置一个面,也可设置两个或三个面进行组合
  1042. // Top = 1
  1043. // Bottom = 2
  1044. // Front = 4
  1045. // Back = 8
  1046. // Left = 16
  1047. // Right = 32,
  1048. //移动到目标并放大
  1049. player.Native.Camera.moveToAabbWithDistance([calcInfo.localAabb.min, [calcInfo.localAabb.max[0],calcInfo.localAabb.max[1],calcInfo.localAabb.max[2]-1]], 0.2, 9, 0.5);
  1050. }else{
  1051. //backMasterView();
  1052. player.Native.Camera.moveToAabbWithDistance([calcInfo.localAabb.min, [calcInfo.localAabb.max[0],calcInfo.localAabb.max[1],calcInfo.localAabb.max[2]-1]], 0.2, 5, 0.5);
  1053. }
  1054. emit('OpenIframeWin',{class:'newwin deviceInfoWin',src:'/in02-device-info#'+name,title:name.replace('C_','小经编机').replace('D_','大经编机')+'#基本信息'})
  1055. //player.Native.Camera.moveToAabbWithDistance([calcInfo.localAabb.min, calcInfo.localAabb.max], 0.2, 21, 4);
  1056. }
  1057. //打开单设备窗口
  1058. function OpenWin(name) {
  1059. if (LastClickObj != null && name != LastClickObj) return;
  1060. emit('OpenIframeWin',{class:'newwin',src:'/in02-device-peifang#'+name,title:name.replace('C_','小经编机').replace('D_','大经编机')+'#详细信息'})
  1061. }
  1062. function AlarmLine (data) {
  1063. //只获取数据中的alarm数据
  1064. var times = [];
  1065. var v_series = [];
  1066. var tmpWeek=[];
  1067. for (var i = 0; i < data.length; i++) {
  1068. var v = data[i]['alarm'];
  1069. var tv = data[i]['time'].split("-")
  1070. times.push([tv[2],data[i]['time']]);
  1071. if (v != null) tmpWeek.push(v);
  1072. }
  1073. alarmWeek.value = tmpWeek;
  1074. if (alarmWeek.value.length > 0){
  1075. v_series.push({
  1076. name: "",
  1077. type: 'line',
  1078. smooth: true,
  1079. //symbol: 'none',
  1080. data: alarmWeek.value,
  1081. itemStyle: {
  1082. normal: {
  1083. color: '#F0F275', // 这里设置折线的颜色
  1084. lineStyle: {
  1085. color: '#F0F27560' // 这里同时设置线头的颜色
  1086. }
  1087. }
  1088. },
  1089. });
  1090. var opt = {
  1091. title: {
  1092. show: false, //不显示标题
  1093. text: '',
  1094. textStyle: {
  1095. color: "rgb(89, 151, 229)",
  1096. fontWeight: "bold"
  1097. },
  1098. top: "0px",
  1099. left: "30px"
  1100. },
  1101. tooltip: {
  1102. trigger: 'axis',
  1103. formatter: function (params) {
  1104. let xv='';
  1105. let result = '';
  1106. params.forEach(function (item) {
  1107. xv=`${item.name}`;
  1108. xv = xv.split(',')[1]+'<br/>';
  1109. result += ` ${item.marker} ${item.value}(次)<br/>`;
  1110. });
  1111. return xv+result;
  1112. }
  1113. },
  1114. legend: {
  1115. show: false, //不显示图例
  1116. inactiveColor: "#04417A",
  1117. data: "",
  1118. textStyle: {color: "#fff"},
  1119. top: "0px"
  1120. },
  1121. grid: {
  1122. left: '1%',
  1123. right: '2%',
  1124. bottom: '2%',
  1125. top: '5%',
  1126. containLabel: true
  1127. },
  1128. xAxis: {
  1129. type: 'category',
  1130. boundaryGap: false,
  1131. axisLabel: {
  1132. rotate: 0,
  1133. color: "#26e2fb",
  1134. formatter:function(v){
  1135. return v.split(',')[0];
  1136. }
  1137. },
  1138. data: times
  1139. },
  1140. yAxis: {
  1141. type: 'value',
  1142. nameTextStyle: {
  1143. color: "#fff"
  1144. },
  1145. axisLabel: {
  1146. color: "#26e2fb"
  1147. },
  1148. splitLine: {
  1149. lineStyle: {
  1150. color: "#7DA7CD",
  1151. type: "dashed",
  1152. width: 1
  1153. }
  1154. }
  1155. },
  1156. series: v_series
  1157. };
  1158. var echartsEle = echarts.init(document.getElementById('echarts_alarm'));
  1159. echartsEle.setOption(opt);
  1160. }
  1161. }
  1162. function StopLine (data, typecode) {
  1163. var t = dev_stop.value;
  1164. var week = {"stop1A": [], "stop2A": [], "stop3A": [], "stop1B": [], "stop2B": [], "stop3B": []};
  1165. var times = [];
  1166. var v_series = [];
  1167. for (var i = 0; i < data.length; i++) {
  1168. var tv = data[i]['time'].split("-")
  1169. times.push([tv[2],data[i]['time']]);
  1170. for (var k1 in week) {
  1171. week[k1].push(data[i][k1])
  1172. }
  1173. }
  1174. stopDeviceNum.value = week.stop1A.length + week.stop2A.length + week.stop3A.length + week.stop1B.length + week.stop2B.length + week.stop3B.length
  1175. if (stopDeviceNum.value == 0) {
  1176. echarts_stop.value.innerHtml='';
  1177. return;
  1178. }
  1179. var option = {
  1180. title: {
  1181. show: false,
  1182. text: '',
  1183. left: 'center',
  1184. top: '1%',
  1185. bottom: '0'
  1186. },
  1187. color: ["#ffb649", "#cdff5b", "#47b9fb", "#fe7a00","#8fc318","#277dfe"],
  1188. tooltip: {
  1189. trigger: 'axis',
  1190. formatter: function (params) {
  1191. let xv='';
  1192. let result = '';
  1193. params.forEach(function (item) {
  1194. xv=`${item.name}`;
  1195. xv = xv.split(',')[1]+'<br>';
  1196. result += ` ${item.marker} ${item.seriesName}: ${item.value}(次)<br/>`;
  1197. });
  1198. return xv+result;
  1199. }
  1200. },
  1201. legend: {
  1202. data: ['停经片A班', 'CCD断纱A班', '人工停机A班', '停经片B班', 'CCD断纱B班', '人工停机B班',],
  1203. button: '5%',
  1204. icon:"circle",
  1205. textStyle: {color: "#fff"},
  1206. top: "0px",
  1207. padding:[0,0],
  1208. },
  1209. grid: {
  1210. containLabel: true,
  1211. top: '25%',
  1212. bottom: '0',
  1213. right: '1%',
  1214. left: '1%'
  1215. },
  1216. xAxis: [{
  1217. type: 'category',
  1218. boundaryGap: true,
  1219. data: times,
  1220. axisLabel: {
  1221. rotate: 0,
  1222. color: "#26e2fb",
  1223. formatter:function(v){
  1224. return v.split(',')[0];
  1225. }
  1226. },
  1227. axisPointer: {snap: false}
  1228. }],
  1229. yAxis: [{
  1230. type: 'value',
  1231. axisPointer: {snap: false},
  1232. axisLabel: {
  1233. color: "#26e2fb"
  1234. },
  1235. splitLine: {
  1236. lineStyle: {
  1237. color: "#7DA7CD",
  1238. type: "dashed",
  1239. width: 1
  1240. }
  1241. }
  1242. }],
  1243. series: [{
  1244. name: '停经片A班',
  1245. type: 'bar',
  1246. barWidth: 5,
  1247. stack: 'jp',
  1248. data: week.stop1A
  1249. }, {
  1250. name: 'CCD断纱A班',
  1251. type: 'bar',
  1252. barWidth: 5,
  1253. stack: 'ccd',
  1254. data: week.stop3A
  1255. }, {
  1256. name: '人工停机A班',
  1257. type: 'bar',
  1258. barWidth: 5,
  1259. stack: 'r',
  1260. data: week.stop2B
  1261. }, {
  1262. name: '停经片B班',
  1263. type: 'bar',
  1264. stack: 'jp',
  1265. data: week.stop2A
  1266. }, {
  1267. name: 'CCD断纱B班',
  1268. type: 'bar',
  1269. stack: 'ccd',
  1270. data: week.stop1B
  1271. }, {
  1272. name: '人工停机B班',
  1273. type: 'bar',
  1274. stack: 'r',
  1275. data: week.stop3B
  1276. }]
  1277. };
  1278. var echartsEle = echarts.init(echarts_stop.value);
  1279. echartsEle.setOption(option);
  1280. }
  1281. function LoadJDL(data) {
  1282. //稼动率
  1283. //获取数据中efficiency、aefficiency、befficiency
  1284. var t = echarts_jiadonglv.value;
  1285. var week_efficiency = [];
  1286. var week_aefficiency = [];
  1287. var week_befficiency = [];
  1288. var times = [];
  1289. var v_series = [];
  1290. var minValue = 100;
  1291. for (var i = 0; i < data.length; i++) {
  1292. var v = data[i]['efficiency'];
  1293. var tv = data[i]['time'].split("-")
  1294. times.push([tv[2],data[i]['time']]);
  1295. if (v != null) week_efficiency.push(v);
  1296. week_aefficiency.push(data[i]['aefficiency']);
  1297. week_befficiency.push(data[i]['befficiency']);
  1298. if(data[i]['aefficiency']<minValue) minValue = parseInt(data[i]['aefficiency']);
  1299. if(data[i]['befficiency']<minValue) minValue = parseInt(data[i]['befficiency']);
  1300. }
  1301. minValue = minValue-10;
  1302. if (week_efficiency.length == 0) {
  1303. return
  1304. }
  1305. v_series.push({
  1306. name: "总稼动率", type: 'line',
  1307. smooth:true,
  1308. showSymbol: false,
  1309. data: week_efficiency, itemStyle: {
  1310. normal: {
  1311. color: '#F0F275', // 这里设置折线的颜色
  1312. lineStyle: {
  1313. color: '#F0F275' // 这里同时设置线头的颜色
  1314. }
  1315. }
  1316. },
  1317. });
  1318. v_series.push({
  1319. name: "A组稼动率", type: 'line',
  1320. smooth:true,
  1321. showSymbol: false,
  1322. data: week_aefficiency, itemStyle: {
  1323. normal: {
  1324. color: '#1EFFFF', // 这里设置折线的颜色
  1325. lineStyle: {
  1326. color: '#1EFFFF' // 这里同时设置线头的颜色
  1327. }
  1328. }
  1329. },
  1330. });
  1331. v_series.push({
  1332. name: "B组稼动率", type: 'line',
  1333. smooth:true,
  1334. showSymbol: false,
  1335. data: week_befficiency, itemStyle: {
  1336. normal: {
  1337. color: '#fb4750', // 这里设置折线的颜色
  1338. lineStyle: {
  1339. color: '#fb4750' // 这里同时设置线头的颜色
  1340. }
  1341. }
  1342. },
  1343. });
  1344. var opt = {
  1345. title: {
  1346. show: false, //不显示标题
  1347. text: '',
  1348. textStyle: {
  1349. color: "rgb(89, 151, 229)",
  1350. fontWeight: "bold"
  1351. },
  1352. top: "0px",
  1353. left: "30px"
  1354. },
  1355. tooltip: {
  1356. trigger: 'axis',
  1357. formatter: function (params) {
  1358. let xv='';
  1359. let result = '';
  1360. params.forEach(function (item) {
  1361. xv=`${item.name}`;
  1362. xv = xv.split(',')[1]+'<br>';
  1363. result += ` ${item.marker} ${item.seriesName}: ${item.value} %<br/>`;
  1364. });
  1365. return xv+result;
  1366. }
  1367. },
  1368. legend: {
  1369. show: true, //不显示图例
  1370. inactiveColor: "#04417A",
  1371. data: "",
  1372. icon:"circle",
  1373. textStyle: {color: "#fff"},
  1374. top: "top",
  1375. left:"left",
  1376. },
  1377. grid: {
  1378. left: '3%',
  1379. right: '2%',
  1380. bottom: '0',
  1381. top: '25%',
  1382. containLabel: true
  1383. },
  1384. xAxis: {
  1385. type: 'category',
  1386. boundaryGap: false,
  1387. axisLabel: {
  1388. rotate: 0,
  1389. color: "#26e2fb",
  1390. formatter:function(v){
  1391. return v.split(',')[0];
  1392. }
  1393. },
  1394. data: times
  1395. },
  1396. yAxis: {
  1397. type: 'value',
  1398. min:minValue,
  1399. nameTextStyle: {
  1400. color: "#26e2fb"
  1401. },
  1402. axisLabel: {
  1403. color: "#26e2fb"
  1404. },
  1405. splitLine: {
  1406. lineStyle: {
  1407. color: "#7DA7CD",
  1408. type: "dashed",
  1409. width: 1
  1410. }
  1411. }
  1412. },
  1413. series: v_series
  1414. };
  1415. var echartsEle = echarts.init(t);
  1416. echartsEle.setOption(opt);
  1417. }
  1418. function LoadSCLine(data) {
  1419. //生产趋势
  1420. //获取数据中weight、aweight、bweight
  1421. var t = echarts_sc_qushi.value;
  1422. var week_efficiency = [];
  1423. var week_aefficiency = [];
  1424. var week_befficiency = [];
  1425. var times = [];
  1426. var v_series = [];
  1427. for (var i = 0; i < data.length; i++) {
  1428. var tv = data[i]['time'].split("-")
  1429. times.push([tv[2],data[i]['time']]);
  1430. week_efficiency.push(data[i]['length'])
  1431. week_aefficiency.push(data[i]['lengthA'])
  1432. week_befficiency.push(data[i]['lengthB'])
  1433. }
  1434. if (week_efficiency.length == 0) {
  1435. return
  1436. }
  1437. v_series.push({
  1438. name: "总产量", type: 'line', smooth:true, showSymbol: false,
  1439. data: week_efficiency, itemStyle: {
  1440. normal: {
  1441. color: '#F0F275', // 这里设置折线的颜色
  1442. lineStyle: {
  1443. color: '#F0F275' // 这里同时设置线头的颜色
  1444. }
  1445. }
  1446. },
  1447. });
  1448. v_series.push({
  1449. name: "A组产量", type: 'line', smooth:true, showSymbol: false,
  1450. data: week_aefficiency, itemStyle: {
  1451. normal: {
  1452. color: '#1EFFFF', // 这里设置折线的颜色
  1453. lineStyle: {
  1454. color: '#1EFFFF' // 这里同时设置线头的颜色
  1455. }
  1456. }
  1457. }
  1458. });
  1459. v_series.push({
  1460. name: "B组产量", type: 'line', smooth:true, showSymbol: false,
  1461. data: week_befficiency, itemStyle: {
  1462. normal: {
  1463. color: '#fc4850', // 这里设置折线的颜色
  1464. lineStyle: {
  1465. color: '#fc4850' // 这里同时设置线头的颜色
  1466. }
  1467. }
  1468. }
  1469. });
  1470. var opt = {
  1471. title: {
  1472. show: false, //不显示标题
  1473. text: '',
  1474. textStyle: {
  1475. color: "rgb(89, 151, 229)",
  1476. fontWeight: "bold"
  1477. },
  1478. top: "0px",
  1479. left: "30px"
  1480. },
  1481. legend: {
  1482. show: true, //不显示图例
  1483. inactiveColor: "#04417A",
  1484. data: "",
  1485. icon:"circle",
  1486. textStyle: {color: "#fff"},
  1487. top: "top",
  1488. left:"left",
  1489. },
  1490. tooltip: {
  1491. trigger: 'axis',
  1492. backgroundColor: '#fff',
  1493. textStyle: {
  1494. color: '#5c6c7c'
  1495. },
  1496. padding: [10, 10],
  1497. extraCssText: 'box-shadow: 1px 0 2px 0 rgba(163,163,163,0.5)',
  1498. formatter: function (params) {
  1499. let xv='';
  1500. let result = '';
  1501. params.forEach(function (item) {
  1502. xv=`${item.name}`;
  1503. xv = xv.split(',')[1]+'<br>';
  1504. result += ` ${item.marker} ${item.seriesName}: ${item.value}(米/日)<br/>`;
  1505. });
  1506. return xv+result;
  1507. }
  1508. },
  1509. grid: {
  1510. left: '3%',
  1511. right: '2%',
  1512. bottom: '0',
  1513. top: '25%',
  1514. containLabel: true
  1515. },
  1516. xAxis: {
  1517. type: 'category',
  1518. boundaryGap: false,
  1519. axisLabel: {
  1520. rotate: 0,
  1521. color: "#26e2fb",
  1522. formatter:function(v){
  1523. return v.split(',')[0]
  1524. }
  1525. },
  1526. data: times
  1527. },
  1528. yAxis: {
  1529. type: 'value',
  1530. nameTextStyle: {
  1531. color: "#26e2fb"
  1532. },
  1533. axisLabel: {
  1534. color: "#26e2fb"
  1535. },
  1536. splitLine: {
  1537. lineStyle: {
  1538. color: "#7DA7CD",
  1539. type: "dashed",
  1540. width: 1
  1541. }
  1542. }
  1543. },
  1544. series: v_series
  1545. };
  1546. var echartsEle = echarts.init(t);
  1547. echartsEle.setOption(opt);
  1548. }
  1549. function LoadUsedLine(data){
  1550. //能耗趋势
  1551. //获取数据中kwh、akwh、bkwh
  1552. var t = echarts_used_qushi.value;
  1553. var week_efficiency = [];
  1554. var week_aefficiency = [];
  1555. var week_befficiency = [];
  1556. var times = [];
  1557. var v_series = [];
  1558. for (var i = 0; i < data.length; i++) {
  1559. var v = data[i]['kwh'];
  1560. var tv = data[i]['time'].split("-")
  1561. times.push([tv[2],data[i]['time']]);
  1562. if (v != null) week_efficiency.push(v);
  1563. week_aefficiency.push(data[i]['akwh'])
  1564. week_befficiency.push(data[i]['bkwh'])
  1565. }
  1566. if (week_efficiency.length == 0) {
  1567. return
  1568. }
  1569. v_series.push({
  1570. name: "总电量", type: 'line', smooth:true, showSymbol: false,
  1571. data: week_efficiency, itemStyle: {
  1572. normal: {
  1573. color: '#F0F275', // 这里设置折线的颜色
  1574. lineStyle: {
  1575. color: '#F0F275' // 这里同时设置线头的颜色
  1576. }
  1577. }
  1578. },
  1579. });
  1580. v_series.push({
  1581. name: "A组电量", type: 'line', smooth:true, showSymbol: false,
  1582. data: week_aefficiency, itemStyle: {
  1583. normal: {
  1584. color: '#1EFFFF', // 这里设置折线的颜色
  1585. lineStyle: {
  1586. color: '#1EFFFF' // 这里同时设置线头的颜色
  1587. }
  1588. }
  1589. },
  1590. });
  1591. v_series.push({
  1592. name: "B组电量", type: 'line', smooth:true, showSymbol: false,
  1593. data: week_befficiency, itemStyle: {
  1594. normal: {
  1595. color: '#fb4750', // 这里设置折线的颜色
  1596. lineStyle: {
  1597. color: '#fb4750' // 这里同时设置线头的颜色
  1598. }
  1599. }
  1600. },
  1601. });
  1602. var opt = {
  1603. title: {
  1604. show: false, //不显示标题
  1605. text: '',
  1606. textStyle: {
  1607. color: "rgb(89, 151, 229)",
  1608. fontWeight: "bold"
  1609. },
  1610. top: "0px",
  1611. left: "30px"
  1612. },
  1613. tooltip: {
  1614. trigger: 'axis',
  1615. formatter: function (params) {
  1616. let xv='';
  1617. let result = '';
  1618. params.forEach(function (item) {
  1619. xv=`${item.name}`;
  1620. xv = xv.split(',')[1]+'<br>';
  1621. result += ` ${item.marker} ${item.seriesName}: ${item.value}(kWh)<br/>`;
  1622. });
  1623. return xv+result;
  1624. }
  1625. },
  1626. legend: {
  1627. show: true, //不显示图例
  1628. inactiveColor: "#04417A",
  1629. data: "",
  1630. icon:"circle",
  1631. textStyle: {color: "#fff"},
  1632. top: "top",
  1633. left:"left",
  1634. padding:[0,5]
  1635. },
  1636. grid: {
  1637. left: '3%',
  1638. right: '2%',
  1639. bottom: '0',
  1640. top: '25%',
  1641. containLabel: true
  1642. },
  1643. xAxis: {
  1644. type: 'category',
  1645. boundaryGap: false,
  1646. axisLabel: {
  1647. rotate: 0,
  1648. color: "#26e2fb",
  1649. formatter:function(v){
  1650. return v.split(',')[0]
  1651. }
  1652. },
  1653. data: times
  1654. },
  1655. yAxis: {
  1656. type: 'value',
  1657. nameTextStyle: {
  1658. color: "#26e2fb"
  1659. },
  1660. axisLabel: {
  1661. color: "#26e2fb"
  1662. },
  1663. splitLine: {
  1664. lineStyle: {
  1665. color: "#7DA7CD",
  1666. type: "dashed",
  1667. width: 1
  1668. }
  1669. }
  1670. },
  1671. series: v_series
  1672. };
  1673. var echartsEle = echarts.init(t);
  1674. echartsEle.setOption(opt);
  1675. }
  1676. //告警设备列表数据
  1677. function AlarmTable(data) {
  1678. AlarmData.value = data;
  1679. if (data == null || data.length == 0) {
  1680. for (var devcode in modelsMap) {
  1681. if(LastAlarmDevs[devcode]==null) continue;
  1682. LastAlarmDevs[devcode] = null;
  1683. if (PanAlarm[devcode] == null) {
  1684. //还原设备状态
  1685. ChangeModelColor(devcode);
  1686. ChangeModelAlarmState2(devcode); //"00ff00" 绿色
  1687. }
  1688. }
  1689. return
  1690. }
  1691. var alarmDev = {};
  1692. for (var i = 0; i < AlarmData.value.length; i++) {
  1693. alarmDev[AlarmData.value[i].code] = AlarmData.value[i].type;
  1694. }
  1695. //var tpl = '<tr style="font-weight:bold" devno="{1}"><td style="width: 30%;">{1}#</td><td style="width: 70%;color:{COLOR}">{2}</td></tr>';
  1696. //var lst = [];
  1697. for (var devcode in alarmDev) {
  1698. var alarmInfo = alarmDev[devcode];
  1699. var color = "rgb(206,161,94)" //默认告警文本颜色
  1700. var typeName = AlarmType[alarmInfo];
  1701. if (typeName.indexOf("故障") > -1 || typeName.indexOf("掉线") > -1) color = "rgb(195,70,76)" //红色提醒
  1702. alarmDev[devcode]={color:color,devcode:devcode.replace(/C_/g, "").replace(/D_/g, ""),devcode_all:devcode,typename:typeName,type:alarmInfo};
  1703. ChangeModelAlarmState2(devcode,AlarmColorTypeCode[alarmInfo]); //"00ff00" 绿色
  1704. //lst.push(tpl.replace(/\{1\}/gi, devcode.replace(/C_/g, "")).replace(/\{2\}/g, typeName).replace('{COLOR}', color))
  1705. }
  1706. alarmDevList.value = alarmDev;
  1707. //dev_alarm_list.value.innerHtml='<tbody>'+lst.join('')+'</tbody>';
  1708. var noAlarmDevs = [];
  1709. for (var devcode in modelsMap) {
  1710. if (OFFLINE_DEVS[devcode] == 1) continue;
  1711. var alarmInfo = alarmDev[devcode];
  1712. //上一次没有告警,本次有告警,需要设置成告警状态
  1713. if (alarmInfo != null) {
  1714. if (LastAlarmDevs[devcode] == null) {
  1715. var typeName = AlarmType[alarmInfo];
  1716. if (MODEL_LOADED == 1) {
  1717. //机器告警提示
  1718. //ChangeModelColor(devcode, DEV_ALAR_COLOR, typeName)
  1719. ChangeModelAlarmState2(devcode, AlarmColorTypeCode[alarmInfo]);
  1720. } else {
  1721. //记录下来,等待模型加载完成时处理
  1722. //ALARM_DEVS.push(devcode + ">"+DEV_ALAR_COLOR+">" + typeName)
  1723. ALARM_DEVS.push(devcode + ">" + AlarmColorTypeCode[alarmInfo] + ">" + typeName)
  1724. }
  1725. }
  1726. LastAlarmDevs[devcode] = 1;
  1727. } else {
  1728. //上一次有告警,并且没有盘头告警时,本次未告警,需要恢复成未告警状态
  1729. if (LastAlarmDevs[devcode] == 1 && PanAlarm[devcode] == null) {
  1730. noAlarmDevs.push(devcode);
  1731. }
  1732. LastAlarmDevs[devcode] = null;
  1733. }
  1734. }
  1735. var tb = dev_alarm_list.value;
  1736. //console.log(tb,tb.parentElement)
  1737. if(tb==null) return;
  1738. if (parseInt(window.getComputedStyle(tb).height) > parseInt(window.getComputedStyle(tb.parentElement).height)) {
  1739. if (devAlarmAutoLoadTimter != null) {
  1740. clearInterval(devAlarmAutoLoadTimter);
  1741. }
  1742. tb.style.top='0px';
  1743. tb.style.position='relative';
  1744. devAlarmAutoLoadTimter = window.setInterval(function () {
  1745. var tb = dev_alarm_list.value;
  1746. if(tb==null) return;
  1747. var tbs = window.getComputedStyle(tb);
  1748. var tbtop = tb.style.top.replace("px", "") * 1;
  1749. if (Math.abs(tbtop) >= (parseInt(tbs.height) - 32)) {
  1750. tb.style.top='0px'
  1751. } else {
  1752. tb.style.top = (tbtop - 32) + "px";
  1753. }
  1754. }, 3000);
  1755. } else {
  1756. clearInterval(devAlarmAutoLoadTimter)
  1757. tb.style.top='0px';
  1758. }
  1759. if (noAlarmDevs.length > 0) {
  1760. for (var i = 0; i < noAlarmDevs.length; i++) {
  1761. if(LastAlarmDevs[noAlarmDevs[i]]==null) continue;
  1762. //还原设备的无告警状态
  1763. ChangeModelColor(noAlarmDevs[i])
  1764. ChangeModelAlarmState2(noAlarmDevs[i]) //00ff00
  1765. }
  1766. }
  1767. }
  1768. function clickalarmtr(item){
  1769. var devno = item.devcode_all;
  1770. if (devno == '') return;
  1771. ShowInfo(devno);
  1772. }
  1773. function openStopView(){
  1774. emit('OpenIframeWin',{class:'newwin bpbWin',src:'/imp-00',title:'停机状态分析'})
  1775. }
  1776. function LoadPan(data) {
  1777. //盘头数据处理
  1778. window.Pan = {};//先存储,设备详情时需要使用到
  1779. Pan = {};
  1780. if (data == null || data.length == 0) return;
  1781. /*
  1782. var alarmDev = {};
  1783. for (var i = 0; i < this.AlarmData.length; i++) {
  1784. alarmDev[this.AlarmData[i].code] = 1;
  1785. }
  1786. */
  1787. for (var i = 0; i < data.length; i++) {
  1788. var devCode = data[i].code;
  1789. window.Pan[devCode] = data[i].panPercent;
  1790. Pan[devCode] = data[i].panPercent
  1791. /*
  1792. if (alarmDev[devCode] == 1) {
  1793. continue; //该设备有告警,不处理盘头
  1794. }
  1795. //判断盘头中是否有低于20的
  1796. var panTmp = data[i].panPercent;
  1797. var is20 = false;//是否是小于20%的
  1798. for (var p = 0; p < panTmp.length; p++) {
  1799. if (panTmp[p] < 20) {
  1800. if (this.PanAlarm[devCode] != 20) {
  1801. //该设备进行告警
  1802. if (MODEL_LOADED == 1) {
  1803. //机器告警提示
  1804. console.log('设备', devCode, '盘头小于20%')
  1805. //ChangeModelColor(devCode, DEV_ALAR_COLOR, this.AlarmType["1000"])
  1806. } else {
  1807. //记录下来,等待模型加载完成时处理
  1808. //ALARM_DEVS.push(devCode + ">"+DEV_ALAR_COLOR+">"+this.AlarmType["1000"])
  1809. }
  1810. }
  1811. is20 = true
  1812. //this.PanAlarm[devCode] = 20
  1813. break
  1814. }
  1815. }
  1816. if (is20) {
  1817. //当前盘头有小于20%的,则不再做其他判断了
  1818. continue
  1819. }
  1820. //判断盘头中是否有低于50的,但大于20%的
  1821. var is50 = false;
  1822. for (var p = 0; p < panTmp.length; p++) {
  1823. if (panTmp[p] < 50 && panTmp[p] >= 20) {
  1824. if (this.PanAlarm[devCode] != 50) {
  1825. //该设备进行提醒
  1826. if (MODEL_LOADED == 1) {
  1827. //机器提醒提示
  1828. console.log('设备', devCode, '盘头小于50%大于20%')
  1829. //ChangeModelColor(devCode, DEV_HINT_COLOR, this.AlarmType["1001"])
  1830. } else {
  1831. //记录下来,等待模型加载完成时处理
  1832. //ALARM_DEVS.push(devCode + ">"+DEV_HINT_COLOR+">"+this.AlarmType["1001"])
  1833. }
  1834. }
  1835. is50 = true
  1836. //this.PanAlarm[devCode] = 50
  1837. break
  1838. }
  1839. }
  1840. if (is50) {
  1841. continue
  1842. }
  1843. this.PanAlarm[devCode] = null;
  1844. if (MODEL_LOADED == 1) {
  1845. //盘头剩余比例正常,隐藏提示标签
  1846. ChangeModelColor(devCode)
  1847. }
  1848. */
  1849. }
  1850. }
  1851. function showImpMenu(){
  1852. isShowImpItem.value = true;
  1853. }
  1854. function OpenMaoGaoWin(){
  1855. isShowMaogaoWin.value = true;
  1856. api.GetMaoGao().then(res=>{
  1857. if(res==null ||res.code!=0){
  1858. return;
  1859. }
  1860. maogaoData.value = res.data;
  1861. });
  1862. }
  1863. function cloasMaogaoWin(){
  1864. isShowMaogaoWin.value = false;
  1865. }
  1866. function cloasMaogaoDetailWin() {
  1867. isShowMaogaoDetailWin.value = false;
  1868. }
  1869. function OpenMaoGaoDetailWin(item){
  1870. maogaoDetailHeight = item.height //当前查看详细的比重
  1871. api.GetMaoGaoDetail(maogaoDetailHeight).then(res=>{
  1872. if(res==null ||res.code!=0){
  1873. return;
  1874. }
  1875. isShowMaogaoDetailWin.value = true;
  1876. })
  1877. }
  1878. //导出毛高比重数据
  1879. function impMaogaodetail(){
  1880. window.open(ApiServer + "/formula/export/" + maogaoDetailHeight)
  1881. }
  1882. function showTTT(){
  1883. impItemCode.value='';
  1884. isShowTTT.value = true;
  1885. var datalist=[];
  1886. datalist.push(["人工工资",1289,457,1027,476,261,-19,'']);
  1887. datalist.push(["社会保险",62,22,55,26,7,-4,'']);
  1888. datalist.push(["福利费",4,1,'-','-',4,1,'']);
  1889. datalist.push(["配件/修理费",30,11,38,18,-8,-7,'']);
  1890. datalist.push(["制版材料",'-','-','-','-','-','-','']);
  1891. datalist.push(["染料",'-','-','-','-','-','-','']);
  1892. datalist.push(["助剂",'-','-','-','-','-','-','']);
  1893. datalist.push(["辅料",2,1,'-','-',2,1,'']);
  1894. datalist.push(["电",190,68,65,30,125,37,'']);
  1895. datalist.push(["天燃气",'-','-','-','-','-','-','']);
  1896. datalist.push(["蒸汽",'-','-','-','-','-','-','']);
  1897. datalist.push(["污水处理费",'-','-','-','-','-','-','']);
  1898. datalist.push(["污泥清理费",'-','-','-','-','-','-','']);
  1899. datalist.push(["其他",18,6,3,1,16,5,'']);
  1900. datalist.push(["摊销及工程费",485,172,133,62,352,110,'']);
  1901. datalist.push(["合计",2080,739,1322,613,758,126,'']);
  1902. tttData.value = datalist;
  1903. isShowImpItem.value = false;
  1904. }
  1905. function showImpWin(item,target){
  1906. if(item.type=='impWin'){
  1907. let targetEle = target.target;
  1908. let xy = {y:targetEle.parentElement.offsetTop+targetEle.parentElement.parentElement.offsetTop,x:targetEle.parentElement.offsetLeft+targetEle.parentElement.parentElement.offsetLeft,h:parseInt(window.getComputedStyle(targetEle.parentElement).height)};
  1909. impItemShowDivXY.value={top:xy.y-xy.h/2,left:xy.x-38};
  1910. impItemCode.value = item.code;
  1911. return;
  1912. }
  1913. impItemCode.value='';
  1914. isShowImpItem.value = false;
  1915. OpenIframe({class:'newwin bpbWin',src:item.path,title:item.title||item.name,type:item.type});
  1916. }
  1917. function OpenBPBWin(){
  1918. OpenIframe({class:'newwin bpbWin',src:'/bpb-fx',title:'白柸布智能靶向预测'});
  1919. }
  1920. function OpenIframe(data){
  1921. iframeWinData.value = data;
  1922. isShowIframeWin.value=true;
  1923. }
  1924. function CloseIframeWin(){
  1925. isShowIframeWin.value=false;
  1926. iframeWinData.value={};
  1927. }
  1928. function HideWindow(){
  1929. isShowFuncMenuList.value=false;
  1930. isShowImpItem.value =false;
  1931. isshow_search_result.value = false;
  1932. isShowTTT.value = false;
  1933. LastClickObj = null
  1934. openState = false
  1935. seachValue.value = '';
  1936. window.Device_Data = null;
  1937. impItemCode.value='';
  1938. }
  1939. //切换到数据消费后台
  1940. function toAdmin(){
  1941. window.open(process.env.VUE_APP_SSO+'?role='+(showIndexData=='index'?"producer":"manager"));
  1942. }
  1943. function switchIndex(){
  1944. if(showIndexData.value=='index'){
  1945. router.push('/datamain');
  1946. }else{
  1947. router.push('/main');
  1948. }
  1949. }
  1950. onMounted(() => {
  1951. backMasterViewBy02();
  1952. //动态设置停机原因的top
  1953. var ele = document.getElementById('dev_alarm');
  1954. var style = window.getComputedStyle(ele);
  1955. dev_stop.value.style.top= (ele.offsetTop * 1 + parseInt(style.height) + 30) + "px";
  1956. clearTimeout(dataTimer1);
  1957. clearTimeout(dataTimer2);
  1958. clearTimeout(dataTimer3);
  1959. clearTimeout(dataTimer4);
  1960. DataFull.GetData();
  1961. DataFull.GetAlarmData();
  1962. DataFull.GetOnlineDev();
  1963. DataFull.GetStopDev();
  1964. })
  1965. onUnmounted(()=>{
  1966. AutoPlayer.value=false;
  1967. window.Pan = null;
  1968. if(player!=null && player.Native!=null) player.Native.CameraAnimation.stop();
  1969. clearTimeout(dataTimer1);
  1970. clearTimeout(dataTimer2);
  1971. clearTimeout(dataTimer3);
  1972. })
  1973. return{
  1974. impItemCode,
  1975. impItemShowDivXY,
  1976. AutoPlayer,
  1977. isShowFuncMenuList,
  1978. isShowImpItem,
  1979. isshow_search_result,
  1980. showIndexData,
  1981. backMasterViewBy02,
  1982. ChangeModelAlarmState2,
  1983. switchAutoPlayer,
  1984. showFuncMenuList,
  1985. showImpMenu,
  1986. showTTT,
  1987. updateInfo,
  1988. ShowInfo,
  1989. HideWindow,
  1990. clickalarmtr,
  1991. openStopView,
  1992. OpenBPBWin,
  1993. indexjsondata,
  1994. alarmjsondata,
  1995. scxljsondata,
  1996. seachValue,
  1997. search_result_list,
  1998. tttData,
  1999. alarmWeek,
  2000. stopDeviceNum,
  2001. dev_alarm,
  2002. dev_stop,
  2003. echarts_stop,
  2004. echarts_jiadonglv,
  2005. echarts_alarm,
  2006. echarts_sc_qushi,
  2007. echarts_used_qushi,
  2008. dev_alarm_echarts,
  2009. impFuncList,
  2010. AlarmData,
  2011. dev_alarm_list,
  2012. alarmDevList,
  2013. deviceInfo,
  2014. isShowMaogaoWin,
  2015. isShowMaogaoDetailWin,
  2016. showImpWin,
  2017. isShowTTT,
  2018. isShowIframeWin,
  2019. OpenMaoGaoWin,
  2020. OpenMaoGaoDetailWin,
  2021. OpenBPBWin,
  2022. OpenIframe,
  2023. maogaoData,
  2024. maogaoDetailData,
  2025. iframeWinData,
  2026. impMaogaodetail,
  2027. cloasMaogaoDetailWin,
  2028. cloasMaogaoWin,
  2029. CloseIframeWin,
  2030. search,
  2031. switchIndex,
  2032. toAdmin,
  2033. StopDevList,
  2034. }
  2035. }
  2036. }
  2037. </script>
  2038. <style>
  2039. .bg23{
  2040. z-index: 1; pointer-events: none;position: absolute;
  2041. top: 0;
  2042. left: 0;
  2043. width: 100%;
  2044. height: 100%;
  2045. margin-left: 0;
  2046. border: 0px solid #17666e;
  2047. border-top: 0px;
  2048. background:url('../../assets/image/bg.png');
  2049. -webkit-mask-image: linear-gradient(to bottom, #0b313de5 10%, transparent 40%,transparent 50%, #0b313d 100%);
  2050. mask-image: linear-gradient(to bottom, #0b313de5 10%,transparent 40%,transparent 50%, #0b313d 100%);
  2051. /*
  2052. background:url('../../assets/image/000.png');
  2053. -webkit-mask-image:radial-gradient(circle, transparent 26%, #95afc5 54%);
  2054. background:
  2055. repeating-linear-gradient(
  2056. 45deg,
  2057. #ccc 0, #ccc 10px,
  2058. transparent 10px, transparent 20px
  2059. ),
  2060. repeating-linear-gradient(
  2061. -45deg,
  2062. #ccc 0, #ccc 10px,
  2063. transparent 10px, transparent 20px
  2064. );
  2065. background-size: 20px 20px;
  2066. */
  2067. }
  2068. .bg32{
  2069. z-index: 2; pointer-events: none;position: absolute;
  2070. top: calc(22px * var(--hRate));
  2071. left: 0;
  2072. width: 1877.54px;
  2073. height: 96%;
  2074. margin-left: 19px;
  2075. border: 2px solid #17666e;
  2076. border-top: 0px;
  2077. }
  2078. </style>