Index.vue 29 KB

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