Index.vue 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060
  1. <template>
  2. <div id="playerMap" ref="playerMap" class="app-container lineBoard platformDiv">
  3. <!-- 头部-部分 -->
  4. <el-row class="rowCls">
  5. <div class="headerBg headerNwBg">
  6. <!-- 标题-产线运行智能总控监控平台 -->
  7. <div class="headerTitle">{{$t("largeScreen.common.largeAllTitle")}}</div>
  8. <!-- tab切换回 -->
  9. <div class="tabsDiv">
  10. <!-- 3D孪生展示 -->
  11. <span>{{$t("largeScreen.common.data3d")}}</span>
  12. <!-- 2D简洁模式 -->
  13. <span @click="boxCardClk()">{{$t("largeScreen.common.data2d")}}</span>
  14. <!-- 2D数据模式 -->
  15. <span class="tabsActive">{{$t("largeScreen.common.data2shu")}}</span>
  16. </div>
  17. <!-- 全屏 -->
  18. <div class="battonDiv">
  19. <el-tooltip v-if="!isFullSreen" class="item" effect="dark" :content="$t('largeScreen.common.screening')" placement="top-start">
  20. <a @click="fullPing()"><i class="el-icon-full-screen"></i></a>
  21. </el-tooltip>
  22. <el-tooltip v-else class="item" effect="dark" :content="$t('largeScreen.common.cancel')" placement="top-start">
  23. <a @click="exitFullPing()"><i class="el-icon-switch-button"></i></a>
  24. </el-tooltip>
  25. </div>
  26. </div>
  27. </el-row>
  28. <!-- 中间-部分 -->
  29. <el-row :gutter="15" class="rowCls marginBottom15">
  30. <!-- 左 -->
  31. <el-col :span="7">
  32. <!-- 车间产线运转评估 -->
  33. <div class="leftDiv marginBottom15">
  34. <div class="modelTitle marginBottom15">车间产线运转评估</div>
  35. <!-- Echarts仪表盘 -->
  36. <div class="gaugeDiv">
  37. <gauge-grade :gaugeData="gaugeData" :width="gaudeWidth" :height="gaudeHeight" ref="gauge"></gauge-grade>
  38. </div>
  39. </div>
  40. <!-- 车间产线 -->
  41. <div class="leftDiv leftDivAuto">
  42. <div class="modelTitle marginBottom15">车间产线</div>
  43. <table class="pragreeTable tableBorder" border="0" cellspacing="0" cellpadding="0">
  44. <tr>
  45. <th width="50">编号</th>
  46. <th width="250">产线名称</th>
  47. <th width="150">模式</th>
  48. </tr>
  49. <tr v-for="(item, index) in orderDatas" :key="index">
  50. <td>{{ index+1 }}</td>
  51. <td>{{ item.name }}</td>
  52. <td>{{ dicts.RUN_MODE[item.runMode]}}</td>
  53. </tr>
  54. </table>
  55. </div>
  56. <!-- 设备利用率 -->
  57. <div class="rightDiv marginBottom15">
  58. <div class="modelTitle marginBottom15">设备利用率</div>
  59. <el-row :gutter="15">
  60. <el-col :span="8">
  61. <div id="percenter1" class="percenter">
  62. <el-progress type="circle" :percentage="percentages[0]" :stroke-width="10" :width="100"></el-progress>
  63. <span class="pcText">智能生产保障系统</span>
  64. </div>
  65. </el-col>
  66. <el-col :span="8">
  67. <div id="percenter2" class="percenter">
  68. <el-progress type="circle" :percentage="percentages[1]" color="#5cb87a" :stroke-width="10" :width="100"></el-progress>
  69. <span class="pcText">框体类加工单元</span>
  70. </div>
  71. </el-col>
  72. <el-col :span="8">
  73. <div id="percenter3" class="percenter">
  74. <el-progress type="circle" :percentage="percentages[2]" color="#6a5acd" :stroke-width="10" :width="100"></el-progress>
  75. <span class="pcText">舱体类加工单元</span>
  76. </div>
  77. </el-col>
  78. </el-row>
  79. </div>
  80. </el-col>
  81. <!-- 中 -->
  82. <el-col :span="10">
  83. <!-- 车间总体情况 -->
  84. <div class="centerDiv marginBottom15">
  85. <div class="modelTitle marginBottom15">车间总体情况</div>
  86. <el-row class="marginBottom15" :gutter="15">
  87. <el-col :span="11" align="left">
  88. <div class="allTitleLeft font13">今日持续加工时间</div>
  89. <div class="allFont" ref="runningTime">{{ allDatas[0] }}小时</div>
  90. </el-col>
  91. <el-col :span="13">
  92. <el-row :gutter="15" v-show="false">
  93. <el-col :span="8">
  94. <div class="allTitle font12">产线运行状态</div>
  95. <div class="modelStatus">正常</div>
  96. </el-col>
  97. <el-col :span="8">
  98. <div class="allTitle font12">调度管理状态</div>
  99. <div class="modelStatus">正常</div>
  100. </el-col>
  101. <el-col :span="8">
  102. <div class="allTitle font12">生产资料准备</div>
  103. <div class="modelStatus">正常</div>
  104. </el-col>
  105. </el-row>
  106. </el-col>
  107. </el-row>
  108. <div class="modelTitle marginBottom15">生产汇总</div>
  109. <el-row class="borderTop">
  110. <el-col>
  111. <el-row :gutter="15">
  112. <el-col :span="6">
  113. <div class="modelStatus2">
  114. <p class="centerNums">{{ this.diaoduList.length }}</p>
  115. <div class="centerTitle">待完成订单</div>
  116. </div>
  117. </el-col>
  118. <el-col :span="6">
  119. <div class="modelStatus2">
  120. <p class="centerNums">{{ this.incomplete }}</p>
  121. <div class="centerTitle">待完成零件</div>
  122. </div>
  123. </el-col>
  124. <el-col :span="6">
  125. <div class="modelStatus2">
  126. <p class="centerNums"><countTo :startVal='0' :endVal='allDatas[1]' :duration='3000'></countTo>%</p>
  127. <div class="centerTitle">合格率</div>
  128. </div>
  129. </el-col>
  130. <el-col :span="6">
  131. <div class="modelStatus2">
  132. <p class="centerNums"><countTo :startVal='0' :endVal='allDatas[2]' :duration='3000'></countTo>%</p>
  133. <div class="centerTitle">当日合格率</div>
  134. </div>
  135. </el-col>
  136. </el-row>
  137. </el-col>
  138. </el-row>
  139. </div>
  140. <!-- 生产计划 -->
  141. <div class="centerDiv">
  142. <div class="modelTitle marginBottom15">生产计划</div>
  143. <table class="pragreeTable tableBorder" border="0" cellspacing="0" cellpadding="0" >
  144. <tr>
  145. <th width="70">生产计划(-订单)</th>
  146. <th width="60">零件名称</th>
  147. <!--<th width="55">排产产线</th>-->
  148. <th width="45">数量</th>
  149. <th width="80">计划完成时间</th>
  150. <th width="45">已生产</th>
  151. <th width="45">合格率</th>
  152. <th width="60">生产进度</th>
  153. </tr>
  154. <tr v-for="(item, index) in runDatas" :key="index">
  155. <td>{{ item.planNo }}-{{ item.orderNo }}</td>
  156. <td>{{ item.bomDesc }}</td>
  157. <!--<td>{{ item.zoenDesc }}</td>-->
  158. <td>{{ item.planBomNum }}</td>
  159. <td>{{ item.endTime }}</td>
  160. <td>{{ item.completeNum }}</td>
  161. <td>{{ item.qualification? item.qualification : "0" }}%</td>
  162. <td>
  163. <el-progress :text-inside="true" :stroke-width="15" :percentage="item.process" status="success"></el-progress>
  164. </td>
  165. </tr>
  166. </table>
  167. </div>
  168. </el-col>
  169. <!-- 右 -->
  170. <el-col :span="7">
  171. <!-- 预警信息 -->
  172. <div class="rightDiv marginBottom15">
  173. <div class="modelTitle marginBottom15">预警信息</div>
  174. <!--
  175. <table class="tableBorder" border="0" cellspacing="0" cellpadding="0">
  176. <tr v-for="(item, index) in yujingList" :key="index">
  177. <td style="text-align: left;">{{ item.name1 }}</td>
  178. <td>{{ item.name2 }}</td>
  179. </tr>
  180. </table> -->
  181. <vue-seamless-scroll :data="yujingList" class="seamless-warp" :class-option="classOption">
  182. <ul class="item" style="height:160px;">
  183. <li class="DataList_top" v-for="(item,index) in yujingList" :key="index">
  184. <div class="DataList_col">{{item.itemname}}</div>
  185. <div class="DataList_col2">{{item.time}}</div>
  186. <div class="clearfix"></div>
  187. </li>
  188. </ul>
  189. </vue-seamless-scroll>
  190. </div>
  191. <!-- 待完成订单 -->
  192. <div class="rightDiv marginBottom15">
  193. <div class="modelTitle marginBottom15">待完成订单</div>
  194. <table class="tableBorder" border="0" cellspacing="0" cellpadding="0" >
  195. <tr>
  196. <th>订单号</th>
  197. <th width="80" v-show="false">客户</th>
  198. <th width="60">零件数量</th>
  199. <th width="50">已生产</th>
  200. <th>交付时间</th>
  201. <th width="120">交付倒计时</th>
  202. </tr>
  203. <tr v-for="(item, index) in diaoduList" :key="index">
  204. <td style="word-wrap: break-word;word-break: break-all;width:80px;">{{ item.orderNo }}</td>
  205. <td style="min-width:30px;" v-show="false" >{{ item.custDesc }}</td>
  206. <td>{{ item.productNum }}</td>
  207. <td v-if="item.completeNum">{{ item.completeNum}}</td>
  208. <td v-else>0</td>
  209. <td style="min-width:30px;">{{ item.deliveryTime }}</td>
  210. <td class="timeprogress" style="min-width:80px;">
  211. <el-progress :text-inside="true" :stroke-width="15" :percentage="setPercentage(item.deliveryTime)" :format="setItemText(item.deliveryTime)" color="#FF3366"></el-progress>
  212. </td>
  213. </tr>
  214. </table>
  215. </div>
  216. <!-- 维保倒计时(2天内) -->
  217. <div class="rightDiv">
  218. <div class="modelTitle marginBottom15">维保倒计时</div>
  219. <table class="tableBorder" border="0" cellspacing="0" cellpadding="0">
  220. <tr>
  221. <th width="130">设备</th>
  222. <th>剩余时间</th>
  223. </tr>
  224. <tr v-for="(item, index) in weibaoList" :key="index">
  225. <td>{{ item.productionresourceName }}</td>
  226. <td class="timeprogress">
  227. <el-progress v-if="item.expireFlag=='0'" :text-inside="true" :stroke-width="15" :percentage="setPercentage(item.repairEndTime)" color="#FF3366" :format="setItemText(item.repairEndTime)" ></el-progress>
  228. <el-progress v-else :text-inside="true" :stroke-width="15" :percentage="100" color="#FF3366" :format="expireText(item.repairEndTime)" ></el-progress>
  229. </td>
  230. </tr>
  231. </table>
  232. </div>
  233. </el-col>
  234. </el-row>
  235. <!-- 尾部-部分 -->
  236. <el-row class="rowCls">
  237. <div class="bottomDiv">
  238. <vue-scroll :ops="ops" style="width:100%;height:100%;">
  239. <ul>
  240. <li class="resourceLi">
  241. <div class="modelTitle2">设备生产资源</div>
  242. </li>
  243. <li v-for="(item, index) in mashingOneList.data" :key="index">
  244. <span class="mStatus" :style="{background:item.controlStatus.background}">{{ item.controlStatusCN}}</span>
  245. <span class="mAudit" :style="{background:item.productionStatus.background}" >{{item.productionStatusCN}}</span>
  246. <img class="mashingImg" :src="item.pic" v-lazy="item.pic" />
  247. <div class="mashingDiv">
  248. <!--<div class="mashingCode">{{ item.productionStatusCN }}</div>-->
  249. <div class="mashingName">{{ item.name }}</div>
  250. </div>
  251. </li>
  252. </ul>
  253. </vue-scroll>
  254. </div>
  255. </el-row>
  256. </div>
  257. </template>
  258. <script>
  259. // Echarts的组件
  260. import * as echarts from 'echarts'
  261. // 引入vuescroll
  262. import VueScroll from "vuescroll"
  263. import vueSeamlessScroll from 'vue-seamless-scroll'
  264. // 【区域管理】-API
  265. import lineBoardAPI from "@/api/runManageCenter/lineBoard"
  266. import areaMgrApi from "@/api/resourceProductMgr/areaMgr"
  267. import planMgrApi from "@/api/runManageCenter/planMgr"
  268. import orderMgrApi from "@/api/runManageCenter/orderMgr"
  269. import repairApi from "@/api/resourceProductMgr/repair"
  270. // 【Echarts-仪表盘】-API
  271. import GaugeGrade from "@/components/Charts/GaugeGrade"
  272. // 共通保存本地
  273. import db from '@/utils/localstorage'
  274. import elDragDialog from '@/directive/el-drag-dialog'
  275. // 共通的函数
  276. import { downloadFile, initDicts, initQueryParams, fullScreen, exitFullScreen, percentPie, randomFloor } from '@/utils/commons'
  277. import { convertEnum } from '@/utils/utils'
  278. // 加载动态数字组件
  279. import countTo from 'vue-count-to'
  280. export default {
  281. name: "TwoDatasModel",
  282. directives: { elDragDialog },
  283. components: { countTo, GaugeGrade, VueScroll, vueSeamlessScroll},
  284. props: {},
  285. data () {
  286. return {
  287. dicts: {
  288. RUN_MODE: {} //运行模式
  289. },
  290. incomplete: 0,
  291. gaugeData: {value: 0.5, name:"效率"},
  292. gaudeWidth: '100%',
  293. gaudeHeight: '190px',
  294. percentages: [randomFloor(10,23), randomFloor(20,100), randomFloor(30,100)],
  295. allDatas: [],
  296. resourceId: '',
  297. orderDatas: [], // [插单订单]数据
  298. runDatas: [], // [运行中订单]数据
  299. yujingList: [], // [预警信息]
  300. diaoduList: [], // [最新订单/待调度]
  301. mashingOneList: [], // [机器人]产线一数据
  302. mashingTwoList: [], // [机器人]产线二数据
  303. mashingThreeList: [],
  304. weibaoList: [], //维保数据
  305. tabDownData: { // 下部分-数据
  306. list: []
  307. },
  308. isFullSreen: false, // 默认不全屏
  309. queryParams: initQueryParams({}),
  310. ops: {
  311. vuescroll: {
  312. mode: 'native',
  313. sizeStrategy: 'percent',
  314. detectResize: true,
  315. },
  316. scrollPanel: {
  317. initialScrollY: false,
  318. initialScrollX: false,
  319. scrollingX: true,
  320. scrollingY: false,
  321. speed: 200
  322. },
  323. rail: {
  324. background: '#1883f7',
  325. opacity: 0.5,
  326. size: '6px',
  327. specifyBorderRadius: false,
  328. gutterOfEnds: null,
  329. gutterOfSide: '2px',
  330. keepShow: true
  331. },
  332. bar: {
  333. hoverStyle: true,
  334. onlyShowBarOnScroll: false, //是否只有滚动的时候才显示滚动条
  335. background: "#F5F5F5", //滚动条颜色
  336. opacity: 0.5 //滚动条透明度
  337. }
  338. }
  339. }
  340. },
  341. filters:{
  342. },
  343. // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
  344. created() {
  345. // 初始化数据
  346. initDicts(['RUN_MODE'], this.dicts)
  347. this.initDatas()
  348. this.getDatas()
  349. },
  350. watch: {
  351. websocketMsg(curVal, oldVal) {
  352. let obj = JSON.parse(curVal)
  353. this.openMessageTips(obj)
  354. }
  355. },
  356. computed: {
  357. currentUser () {
  358. return this.$store.state.account.user
  359. },
  360. nationList() {
  361. return convertEnum(this.dicts.NATION)
  362. },
  363. runModelList() {
  364. return convertEnum(this.dicts.RUN_MODE)
  365. },
  366. classOption () {
  367. return {
  368. step: 0.2, // 数值越大速度滚动越快
  369. limitMoveNum: 2, // 开始无缝滚动的数据量 this.dataList.length
  370. hoverStop: true, // 是否开启鼠标悬停stop
  371. direction: 1, // 0向下 1向上 2向左 3向右
  372. openWatch: true, // 开启数据实时监控刷新dom
  373. singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动)
  374. singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动)
  375. waitTime: 1000 // 单步运动停止的时间(默认值1000ms)
  376. }
  377. },
  378. // 接收信息
  379. websocketMsg() {
  380. return this.$store.getters.STAFF_UPDATE.msg
  381. }
  382. ,
  383. percentage(){
  384. return Math.floor(Math.random()*100)
  385. }
  386. },
  387. mounted () {
  388. // 判断长连接,是否已经开启
  389. if(this.$store.state.websocket.websock == null){
  390. // 页面刚进入时开启长连接
  391. this.$store.dispatch('STAFF_WEBSOCKET')
  392. }
  393. // DOM加载后,加载
  394. this.$nextTick(()=> {
  395. // 加载数据
  396. //this.initPercentPie()
  397. })
  398. },
  399. // 销毁
  400. destroyed() {
  401. this.websocketClose()
  402. },
  403. methods: {
  404. // 初始化数据
  405. getDatas(){
  406. //产线数据
  407. areaMgrApi.getList({status:1}).then(res => {
  408. //resolve(res)
  409. //console.log(res)
  410. if(res.status == 200 && res.data.isSuccess){
  411. this.orderDatas = res.data.data
  412. }else{
  413. this.$message({
  414. message: "产线数据查询失败",
  415. type: "error"
  416. })
  417. }
  418. })
  419. //计划数据
  420. this.queryParams.size = 5
  421. this.queryParams.model.planStatus = 2
  422. planMgrApi.page(this.queryParams).then(res => {
  423. //console.log(res)
  424. if(res.status == 200 && res.data.isSuccess){
  425. this.runDatas = res.data.data.records
  426. }else{
  427. this.$message({
  428. message: "计划数据查询失败",
  429. type: "error"
  430. })
  431. }
  432. })
  433. //未完成订单
  434. let orderParams = initQueryParams({})
  435. orderParams.size = 5
  436. //orderParams.timeRange = {}
  437. orderMgrApi.page(orderParams).then(res => {
  438. //console.log(res)
  439. if(res.status == 200 && res.data.isSuccess){
  440. this.diaoduList = res.data.data.records
  441. //待完成零件
  442. for(let i = 0; i < this.diaoduList.length; i++){
  443. if(this.diaoduList[i].completeNum == null){
  444. this.incomplete += parseInt(this.diaoduList[i].productNum)
  445. }else{
  446. this.incomplete += parseInt(this.diaoduList[i].productNum) - parseInt(this.diaoduList[i].completeNum)
  447. }
  448. }
  449. }else{
  450. this.$message({
  451. message: "未完成订单数据查询失败",
  452. type: "error"
  453. })
  454. }
  455. })
  456. //维保数据
  457. let repairParams = initQueryParams({})
  458. //this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
  459. //this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
  460. repairParams.size = 5
  461. repairApi.page(repairParams).then(res => {
  462. //console.log(res)
  463. if (res.status == 200 && res.data.isSuccess) {
  464. this.weibaoList = res.data.data.records
  465. }else{
  466. this.$message({
  467. message: "维保数据查询失败",
  468. type: "error"
  469. })
  470. }
  471. })
  472. orderMgrApi.orderStatitcs().then(res=> {
  473. if (res.status == 200 && res.data.isSuccess) {
  474. //更新执行时间和合格率
  475. this.allDatas = [parseInt(res.data.data.lastHour.rate), parseFloat(res.data.data.tadayRate.rate), parseFloat(res.data.data.weekRate.rate)]
  476. }else{
  477. this.$message({
  478. message: "订单合格率查询失败",
  479. type: "error"
  480. })
  481. }
  482. })
  483. //设备资源数据
  484. areaMgrApi.iconGroupList({resourceStatus:"1",group:0}).then(res => {
  485. //console.log(res)
  486. if (res.status == 200 && res.data.isSuccess) {
  487. this.mashingOneList = this.filterResource(res.data.data.iconGroupList[0])
  488. this.mashingTwoList = this.filterResource(res.data.data.iconGroupList[1])
  489. this.mashingThreeList = this.filterResource(res.data.data.iconGroupList[2])
  490. this.initPercentPie([parseInt(100 * this.mashingOneList.runData.length / this.mashingOneList.data.length),
  491. parseInt(100 * this.mashingTwoList.runData.length / this.mashingTwoList.data.length), parseInt(100 * this.mashingThreeList.runData.length / this.mashingThreeList.data.length)])
  492. let runLen = this.mashingOneList.runData.length + this.mashingTwoList.runData.length + this.mashingThreeList.runData.length
  493. this.mashingOneList.data = this.mashingOneList.data.concat(this.mashingTwoList.data).concat(this.mashingThreeList.data)
  494. this.gaugeData = {value : parseFloat(runLen/this.mashingOneList.data.length).toFixed(2), name:"效率"}
  495. this.$refs.gauge.dispose()
  496. this.$refs.gauge.initChart(this.gaugeData)
  497. }else{
  498. this.$message({
  499. message: "设备数据查询失败",
  500. type: "error"
  501. })
  502. }
  503. })
  504. },
  505. initDatas(){
  506. // [预警信息]
  507. this.yujingList = [
  508. ];
  509. },
  510. // 加载数据-[生产资源使用率]
  511. initPercentPie(vals){
  512. var elm = echarts.init(document.getElementById("percenter1"))
  513. var elm2 = echarts.init(document.getElementById("percenter2"))
  514. var elm3 = echarts.init(document.getElementById("percenter3"))
  515. if(elm != null && elm !='' && elm != undefined){
  516. elm.dispose()
  517. }
  518. if(elm2 != null && elm2 !='' && elm2 != undefined){
  519. elm2.dispose()
  520. }
  521. if(elm3 != null && elm3 !='' && elm3 != undefined){
  522. elm3.dispose()
  523. }
  524. var option1 = {
  525. value: vals == null ? randomFloor(67,77) : vals[0], //百分比,必填
  526. name:'智能保障系统利用率', //必填
  527. name2:'保障中心未利用率',
  528. title:'',
  529. backgroundColor: null,
  530. color:['#24a9ea','#DDDDDD'],
  531. fontSize:12,
  532. domEle:document.getElementById("percenter1")//必填
  533. };
  534. percentPie(option1);
  535. var option2 = {
  536. value: vals == null ? randomFloor(49,59) : vals[1], //百分比,必填
  537. name:'框体类加工利用率', //必填
  538. name2:'框体未利用率', //必填
  539. title:'',
  540. backgroundColor: null,
  541. color:['#13ce66','#DDDDDD'],
  542. fontSize:12,
  543. domEle:document.getElementById("percenter2")//必填
  544. };
  545. percentPie(option2);
  546. var option3 = {
  547. value: vals == null ? randomFloor(49,69) : vals[2], //百分比,必填
  548. name:'舱体类加工利用率', //必填
  549. name2:'舱体未利用率', //必填
  550. title:'',
  551. backgroundColor: null,
  552. color:['#6a5acd','#DDDDDD'],
  553. fontSize:12,
  554. domEle:document.getElementById("percenter3")//必填
  555. };
  556. percentPie(option3);
  557. },
  558. // 是否设置大屏
  559. setMaxScreen(){
  560. let isCurrScreen = db.get("isCurrScreen");
  561. console.log("是否全屏22222:",isCurrScreen)
  562. if(isCurrScreen == true){
  563. this.fullPing();
  564. }
  565. },
  566. // 推送接收到的数据
  567. openMessageTips(data){
  568. // 如果是【数据模式】
  569. if(this.$route.fullPath.indexOf("/largeScreen/twoDatasModel") > -1){
  570. console.log("接收websocket的推送信息 == ",data)
  571. if(data.type == 'PUSH_TYPE_DATA_SCREEN'){
  572. this.$nextTick(()=> {
  573. // 数据变更
  574. //this.initPercentPie([randomFloor(77,87), randomFloor(59,69), randomFloor(49,69)])
  575. this.orderDatas = data.data.zoneMap.zoneData
  576. this.runDatas = data.data.planMap.planData.records
  577. //合格率和工时时长信息更新
  578. this.allDatas = [parseInt(data.data.orderStatistics.lastHour.rate), parseFloat(data.data.orderStatistics.tadayRate.rate), parseFloat(data.data.orderStatistics.weekRate.rate)]
  579. this.diaoduList = data.data.orderMap.orderData.records
  580. this.incomplete = 0
  581. for(let i = 0; i < this.diaoduList.length; i++){
  582. if(this.diaoduList[i].completeNum == null){
  583. this.incomplete += parseInt(this.diaoduList[i].productNum)
  584. }else{
  585. this.incomplete += parseInt(this.diaoduList[i].productNum) - parseInt(this.diaoduList[i].completeNum)
  586. }
  587. }
  588. this.weibaoList = []
  589. this.weibaoList = data.data.repairMap.repairData.records
  590. this.mashingOneList = this.filterResource(data.data.groupMap.iconGroupList[0])
  591. this.mashingTwoList = this.filterResource(data.data.groupMap.iconGroupList[1])
  592. this.mashingThreeList = this.filterResource(data.data.groupMap.iconGroupList[2])
  593. //计算设备利用率
  594. this.initPercentPie([parseInt(100 * this.mashingOneList.runData.length / this.mashingOneList.data.length),
  595. parseInt(100 * this.mashingTwoList.runData.length / this.mashingTwoList.data.length), parseInt(100 * this.mashingThreeList.runData.length / this.mashingThreeList.data.length)])
  596. let runLen = this.mashingOneList.runData.length + this.mashingTwoList.runData.length + this.mashingThreeList.runData.length;
  597. this.mashingOneList.data = this.mashingOneList.data.concat(this.mashingTwoList.data).concat(this.mashingThreeList.data)
  598. this.gaugeData = {value : parseFloat(runLen/this.mashingOneList.data.length).toFixed(2), name:"效率"}
  599. this.$refs.gauge.dispose()
  600. this.$refs.gauge.initChart(this.gaugeData)
  601. let datas = data.data.warnMap.warnData.records
  602. let that = this
  603. this.yujingList = datas.map((data)=>{
  604. let msg = data.feedback ? data.feedback : " 响应超时 ";
  605. let arr = data.createTime;
  606. let time = arr[0] + "-" + arr[1] + "-" + arr[2] + "\t" + arr[3] + ":" + arr[4];
  607. let itemname = ""
  608. if(data.taskNodeId){
  609. itemname = "["+ data.resourceName +"] "+data.procedureName+"("+data.instructionName+")" + msg;
  610. }else{
  611. itemname = "[监控推送]" + msg;
  612. }
  613. if(data.status == '0'){
  614. setTimeout(function(){
  615. that.$notify({
  616. title: '预警提示',
  617. message: itemname + "\t" + "请管理人员去产线查看",
  618. type: 'warning',
  619. position: 'bottom-right',
  620. duration: 5000,
  621. customClass:'notifyStyle',
  622. });
  623. },8000);
  624. }
  625. return {itemname:itemname , time: time}
  626. });
  627. })
  628. }
  629. }
  630. },
  631. // 组件销毁的时候,关闭websocket连接
  632. websocketClose() {
  633. this.$store.getters.STAFF_UPDATE.lockReconnect = true
  634. this.$store.getters.STAFF_UPDATE.websock.close() // 离开路由之后断开websocket连接
  635. clearTimeout(this.$store.getters.STAFF_UPDATE.reconnectData) // 离开清除 timeout
  636. clearTimeout(this.$store.getters.STAFF_UPDATE.timeoutObj) // 离开清除 timeout
  637. clearTimeout(this.$store.getters.STAFF_UPDATE.serverTimeoutObj) // 离开清除 timeout
  638. },
  639. // websocket信息变更
  640. onmessage() {
  641. this.$store.getters.STAFF_UPDATE.websock.onmessage = function(evt) {
  642. console.log(evt)
  643. console.log("websocket获取数据==="+evt)
  644. }
  645. },
  646. // 过滤设备数据
  647. filterResource(mashingList){
  648. let arr = mashingList.data.filter((data) => {
  649. return data.name.indexOf("接驳位") <0 && data.name.indexOf("托板") < 0 && data.name.indexOf("上下料站") < 0
  650. && data.name.indexOf("线边库") <0 && data.name.indexOf("立库") <0
  651. });
  652. mashingList.data = arr
  653. mashingList.runData = arr.filter((data)=> { return data.productionStatusCN=="生产中"});
  654. return mashingList
  655. },
  656. // 【SUM50】点击-事件
  657. boxCardClk(){
  658. let paths = "/largeScreen/modeSummary";
  659. // 调用全局挂载的方法
  660. this.$store.dispatch('tagsView/delView', this.$route).then(res => {
  661. this.$router.push({ path: paths, query: {}}) //带参跳转
  662. })
  663. // this.$router.push('/runManageCenter/lineBoardDetail')
  664. // console.log("弹出详情页面!", paths)
  665. },
  666. // 全屏
  667. fullPing(){
  668. this.$nextTick(() => {
  669. // 显示【退出全屏】
  670. this.isFullSreen = true
  671. // 如果是退出全屏
  672. db.save("isCurrScreen", this.isFullSreen)
  673. let $playerMap = this.$refs.playerMap
  674. if($playerMap){
  675. fullScreen($playerMap)
  676. // fullScreen(document.getElementById('playerMap'))
  677. }
  678. })
  679. },
  680. // 退出全屏
  681. exitFullPing(){
  682. this.$nextTick(() => {
  683. // 显示【全屏】
  684. this.isFullSreen = false
  685. // 如果是全屏
  686. db.save("isCurrScreen", this.isFullSreen)
  687. exitFullScreen(document.getElementById('playerMap'))
  688. })
  689. },
  690. // 加载背景颜色
  691. setBackground(color){
  692. return "background: "+ color +";"
  693. },
  694. // 加载【本地图片】
  695. resolveLogo(logo) {
  696. return require(`@/assets/icon/${logo}`);
  697. },
  698. // 获取列表数据
  699. getTabList(){
  700. lineBoardAPI.getBigScreenList({}).then(res => {
  701. res = res.data
  702. if(res.isSuccess){
  703. this.tabDownData.list = res.data.list
  704. // 给资源赋值id
  705. this.resourceId = this.tabDownData.list[0].id
  706. }
  707. })
  708. },
  709. //时间差转换
  710. formatGap(date) {
  711. let staytimeGap = new Date(date).getTime() - new Date().getTime();
  712. if(staytimeGap<0){
  713. staytimeGap = new Date().getTime() - new Date(date).getTime();
  714. }
  715. let stayDay = Math.floor(staytimeGap/(24*3600*1000));
  716. let level = staytimeGap%(24*3600*1000);
  717. let stayHour = Math.floor(level/(3600*1000));
  718. let leave12 = level%(3600*1000);
  719. let stayMin = Math.floor(leave12/(60*1000));
  720. return [Number(parseFloat(stayDay/30*100).toFixed(2)), stayDay + "天" +stayHour + "小时" + stayMin + "分"]
  721. },
  722. // 设置进度文本内容
  723. setItemText(text){
  724. return () => {
  725. return this.formatGap(text)[1]
  726. }
  727. },
  728. expireText(text){
  729. return () => {
  730. return "过期" + this.formatGap(text)[1]
  731. }
  732. },
  733. setPercentage(text){
  734. return this.formatGap(text)[0]>100? 100 : this.formatGap(text)[0]
  735. }
  736. }
  737. }
  738. </script>
  739. <!-- 全局样式-通过定义父DOM的calss,来只影响本组件 -->
  740. <style lang="scss" type="text/css">
  741. .percenter{
  742. .el-progress--circle .el-progress__text{
  743. top: 60%;
  744. color: #FFFFFF;
  745. font-size: 14px;
  746. }
  747. }
  748. .pragreeTable {
  749. .el-progress-bar__outer{
  750. background-color: #a1a1a178;
  751. }
  752. }
  753. .timeprogress .el-progress-bar__outer {
  754. background-color:#000;
  755. }
  756. .timeprogress .el-progress-bar__inner {
  757. text-align:center;
  758. }
  759. .notifyStyle {
  760. background-color:#000088 !important;
  761. }
  762. .notifyStyle .el-notification__content{
  763. color: #fff !important;
  764. }
  765. .notifyStyle .el-notification__title {
  766. color: #fff !important;
  767. }
  768. </style>
  769. <!-- 本组件样式 -->
  770. <style lang="scss" scoped>
  771. .headerTitle{
  772. position: relative;
  773. top: 20px;
  774. left: -13px;
  775. font-family: "微软雅黑";
  776. font-size: 32px;
  777. text-shadow: 1px 2px 3px #ece9e9;
  778. letter-spacing: 3px;
  779. }
  780. .platformDiv {
  781. .leftDivAuto {
  782. min-height: initial;
  783. }
  784. .modelTitle {
  785. color: #28BDE0;
  786. }
  787. }
  788. .headerBg{
  789. .tabsDiv{
  790. position: absolute;
  791. font-size: 17px;
  792. font-weight: bold;
  793. color: #28BDE0;
  794. bottom: 20px;
  795. left: 0;
  796. span {
  797. cursor: pointer;
  798. margin-right: 20px;
  799. }
  800. span:hover{
  801. opacity: 0.7;
  802. }
  803. .tabsActive{
  804. color: #FFFFFF;
  805. }
  806. }
  807. }
  808. .gaugeDiv{
  809. width: 100%;
  810. height: 190px;
  811. }
  812. .bottomDiv{
  813. width: 100%;
  814. min-height: 215px;
  815. white-space: nowrap;
  816. ul {
  817. width: 100%;
  818. list-style: none;
  819. margin: 0;
  820. padding: 0;
  821. li {
  822. position: relative;
  823. background: #457f968c;
  824. display: inline-block;
  825. margin: 0 10px 10px;
  826. -moz-border-radius: 8px;
  827. -webkit-border-radius: 8px;
  828. border-radius: 8px;
  829. .mStatus {
  830. position: absolute;
  831. top: 10px;
  832. right: 0px;
  833. display: inline-block;
  834. background: #2573b8d1;
  835. padding: 2px 6px;
  836. font-size: 14px;
  837. -moz-border-radius: 3px;
  838. -webkit-border-radius: 3px;
  839. border-radius: 3px;
  840. }
  841. .mAudit {
  842. position: absolute;
  843. top: 40px;
  844. right: 0px;
  845. display: inline-block;
  846. background: #2573b8d1;
  847. padding: 2px 6px;
  848. font-size: 14px;
  849. -moz-border-radius: 3px;
  850. -webkit-border-radius: 3px;
  851. border-radius: 3px;
  852. }
  853. .mashingImg {
  854. background: #FFFFFF;
  855. width: 180px;
  856. height: 110px;
  857. -moz-border-radius: 8px;
  858. -webkit-border-radius: 8px;
  859. border-radius: 8px;
  860. }
  861. .mashingDiv {
  862. padding: 20px 10px 10px;
  863. .mashingCode {
  864. position: relative;
  865. text-align: left;
  866. padding-left: 20px;
  867. margin-bottom: 7px;
  868. }
  869. .mashingCode:before {
  870. background: #00FFFF;
  871. position: absolute;
  872. content: "";
  873. left: 0;
  874. top: 5px;
  875. width: 10px;
  876. height: 10px;
  877. -moz-border-radius: 50%;
  878. -webkit-border-radius: 50%;
  879. border-radius: 50%;
  880. }
  881. .mashingName {
  882. text-align: left;
  883. }
  884. }
  885. }
  886. li.resourceLi{
  887. background: none;
  888. .modelTitle2 {
  889. position: relative;
  890. top: 0;
  891. color: #28BDE0;
  892. font-size: 18px;
  893. line-height: 22px;
  894. font-weight: bold;
  895. width: 20px;
  896. white-space: normal;
  897. }
  898. }
  899. }
  900. }
  901. .tableBorder{
  902. width: 100%;
  903. border-left: 1px solid #184659;
  904. border-top: 1px solid #184659;
  905. tr {
  906. th{
  907. background: #457f968c;
  908. padding: 5px 2px;
  909. font-size: 12px;
  910. border-bottom: 1px solid #184659;
  911. }
  912. td {
  913. padding: 5px 2px;
  914. text-align: center;
  915. font-size: 11px;
  916. border-right: 1px solid #184659;
  917. border-bottom: 1px solid #184659;
  918. }
  919. }
  920. }
  921. .percenter{
  922. position: relative;
  923. width: 100%;
  924. height: 105px;
  925. .pcText{
  926. display: inline-block;
  927. position: absolute;
  928. top: 35%;
  929. left: 0;
  930. width: 100%;
  931. color: #999999;
  932. font-size: 12px;
  933. text-align: center;
  934. }
  935. }
  936. .allTitleLeft{
  937. padding-top: 10px;
  938. margin-bottom: 30px;
  939. border-top: 1px solid #275379;
  940. }
  941. .allTitle{
  942. margin-bottom: 10px;
  943. font-size: 11px;
  944. }
  945. .allFont{
  946. font-size: 22px;
  947. color: #00d8ff;
  948. }
  949. .modelStatus{
  950. display: flex;
  951. justify-content: center;
  952. align-items: center;
  953. background: #13ce66;
  954. min-height: 60px;
  955. -moz-border-radius: 5px;
  956. -webkit-border-radius: 5px;
  957. border-radius: 5px;
  958. }
  959. .modelStatus2{
  960. background: #457f968c;
  961. min-height: 60px;
  962. -moz-border-radius: 5px;
  963. -webkit-border-radius: 5px;
  964. border-radius: 5px;
  965. }
  966. .centerNums{
  967. font-size: 28px;
  968. margin: 0;
  969. padding: 15px 0 10px;
  970. }
  971. .centerTitle{
  972. font-size: 14px;
  973. padding: 10px 0;
  974. }
  975. .borderTop{
  976. padding-top: 10px;
  977. border-top: 1px solid #275379;
  978. }
  979. .seamless-warp {
  980. height: 200px;
  981. overflow: hidden;
  982. }
  983. .item > .DataList_top {
  984. list-style: none;
  985. float: left;
  986. color: red;
  987. margin-left: -40px;
  988. font-size: 14px;
  989. min-width:400px;
  990. width:100%;
  991. }
  992. .item .DataList_col {
  993. float: left;
  994. font-size: 12px;
  995. margin:2px 0;
  996. }
  997. .item .DataList_col2 {
  998. float: left;
  999. font-size: 12px;
  1000. margin:2px 0 2px 12px;
  1001. }
  1002. .item .clearfix {
  1003. clear: both;
  1004. }
  1005. </style>