Index.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043
  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]/60).toFixed(1) }}小时</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[3]' :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[4]' :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">客户</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;">{{ 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">{{ item.controlStatusCN}}</span>
  245. <span class="mAudit">{{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,100), randomFloor(20,100), randomFloor(30,100)],
  295. allDatas: [randomFloor(100,4000), randomFloor(1,10), randomFloor(20,100), randomFloor(90,100), randomFloor(95,100)],
  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. //设备资源数据
  473. areaMgrApi.iconGroupList({resourceStatus:"1",group:0}).then(res => {
  474. //console.log(res)
  475. if (res.status == 200 && res.data.isSuccess) {
  476. this.mashingOneList = this.filterResource(res.data.data.iconGroupList[0])
  477. this.mashingTwoList = this.filterResource(res.data.data.iconGroupList[1])
  478. this.mashingThreeList = this.filterResource(res.data.data.iconGroupList[2])
  479. this.initPercentPie([parseInt(100 * this.mashingOneList.runData.length / this.mashingOneList.data.length),
  480. parseInt(100 * this.mashingTwoList.runData.length / this.mashingTwoList.data.length), parseInt(100 * this.mashingThreeList.runData.length / this.mashingThreeList.data.length)])
  481. let runLen = this.mashingOneList.runData.length + this.mashingTwoList.runData.length + this.mashingThreeList.runData.length
  482. this.mashingOneList.data = this.mashingOneList.data.concat(this.mashingTwoList.data).concat(this.mashingThreeList.data)
  483. this.gaugeData = {value : parseFloat(runLen/this.mashingOneList.data.length).toFixed(2), name:"效率"}
  484. this.$refs.gauge.dispose()
  485. this.$refs.gauge.initChart(this.gaugeData)
  486. }else{
  487. this.$message({
  488. message: "设备数据查询失败",
  489. type: "error"
  490. })
  491. }
  492. })
  493. },
  494. initDatas(){
  495. // [预警信息]
  496. this.yujingList = [
  497. ];
  498. },
  499. // 加载数据-[生产资源使用率]
  500. initPercentPie(vals){
  501. var elm = echarts.init(document.getElementById("percenter1"))
  502. var elm2 = echarts.init(document.getElementById("percenter2"))
  503. var elm3 = echarts.init(document.getElementById("percenter3"))
  504. if(elm != null && elm !='' && elm != undefined){
  505. elm.dispose()
  506. }
  507. if(elm2 != null && elm2 !='' && elm2 != undefined){
  508. elm2.dispose()
  509. }
  510. if(elm3 != null && elm3 !='' && elm3 != undefined){
  511. elm3.dispose()
  512. }
  513. var option1 = {
  514. value: vals == null ? randomFloor(67,77) : vals[0], //百分比,必填
  515. name:'智能保障系统利用率', //必填
  516. name2:'保障中心未利用率',
  517. title:'',
  518. backgroundColor: null,
  519. color:['#24a9ea','#DDDDDD'],
  520. fontSize:12,
  521. domEle:document.getElementById("percenter1")//必填
  522. };
  523. percentPie(option1);
  524. var option2 = {
  525. value: vals == null ? randomFloor(49,59) : vals[1], //百分比,必填
  526. name:'框体类加工利用率', //必填
  527. name2:'框体未利用率', //必填
  528. title:'',
  529. backgroundColor: null,
  530. color:['#13ce66','#DDDDDD'],
  531. fontSize:12,
  532. domEle:document.getElementById("percenter2")//必填
  533. };
  534. percentPie(option2);
  535. var option3 = {
  536. value: vals == null ? randomFloor(49,69) : vals[2], //百分比,必填
  537. name:'舱体类加工利用率', //必填
  538. name2:'舱体未利用率', //必填
  539. title:'',
  540. backgroundColor: null,
  541. color:['#6a5acd','#DDDDDD'],
  542. fontSize:12,
  543. domEle:document.getElementById("percenter3")//必填
  544. };
  545. percentPie(option3);
  546. },
  547. // 是否设置大屏
  548. setMaxScreen(){
  549. let isCurrScreen = db.get("isCurrScreen");
  550. console.log("是否全屏22222:",isCurrScreen)
  551. if(isCurrScreen == true){
  552. this.fullPing();
  553. }
  554. },
  555. // 推送接收到的数据
  556. openMessageTips(data){
  557. // 如果是【数据模式】
  558. if(this.$route.fullPath.indexOf("/largeScreen/twoDatasModel") > -1){
  559. console.log("接收websocket的推送信息 == ",data)
  560. if(data.type == 'PUSH_TYPE_DATA_SCREEN'){
  561. this.$nextTick(()=> {
  562. // 数据变更
  563. //this.initPercentPie([randomFloor(77,87), randomFloor(59,69), randomFloor(49,69)])
  564. this.orderDatas = data.data.zoneMap.zoneData
  565. this.runDatas = data.data.planMap.planData.records
  566. this.diaoduList = data.data.orderMap.orderData.records
  567. this.incomplete = 0
  568. for(let i = 0; i < this.diaoduList.length; i++){
  569. if(this.diaoduList[i].completeNum == null){
  570. this.incomplete += parseInt(this.diaoduList[i].productNum)
  571. }else{
  572. this.incomplete += parseInt(this.diaoduList[i].productNum) - parseInt(this.diaoduList[i].completeNum)
  573. }
  574. }
  575. this.weibaoList = []
  576. this.weibaoList = data.data.repairMap.repairData.records
  577. this.mashingOneList = this.filterResource(data.data.groupMap.iconGroupList[0])
  578. this.mashingTwoList = this.filterResource(data.data.groupMap.iconGroupList[1])
  579. this.mashingThreeList = this.filterResource(data.data.groupMap.iconGroupList[2])
  580. //计算设备利用率
  581. this.initPercentPie([parseInt(100 * this.mashingOneList.runData.length / this.mashingOneList.data.length),
  582. parseInt(100 * this.mashingTwoList.runData.length / this.mashingTwoList.data.length), parseInt(100 * this.mashingThreeList.runData.length / this.mashingThreeList.data.length)])
  583. let runLen = this.mashingOneList.runData.length + this.mashingTwoList.runData.length + this.mashingThreeList.runData.length;
  584. this.mashingOneList.data = this.mashingOneList.data.concat(this.mashingTwoList.data).concat(this.mashingThreeList.data)
  585. this.gaugeData = {value : parseFloat(runLen/this.mashingOneList.data.length).toFixed(2), name:"效率"}
  586. this.$refs.gauge.dispose()
  587. this.$refs.gauge.initChart(this.gaugeData)
  588. let datas = data.data.warnMap.warnData.records
  589. let that = this
  590. this.yujingList = datas.map((data)=>{
  591. let msg = data.feedback ? data.feedback : " 响应超时 ";
  592. let arr = data.createTime;
  593. let time = arr[0] + "-" + arr[1] + "-" + arr[2] + "\t" + arr[3] + ":" + arr[4];
  594. let itemname = ""
  595. if(data.taskNodeId){
  596. itemname = "["+ data.resourceName +"] "+data.procedureName+"("+data.instructionName+")" + msg;
  597. }else{
  598. itemname = "[监控推送]" + msg;
  599. }
  600. if(data.status == '0'){
  601. setTimeout(function(){
  602. that.$notify({
  603. title: '预警提示',
  604. message: itemname + "\t" + "请管理人员去产线查看",
  605. type: 'warning',
  606. position: 'bottom-right',
  607. duration: 5000,
  608. customClass:'notifyStyle',
  609. });
  610. },8000);
  611. }
  612. return {itemname:itemname , time: time}
  613. });
  614. })
  615. }
  616. }
  617. },
  618. // 组件销毁的时候,关闭websocket连接
  619. websocketClose() {
  620. this.$store.getters.STAFF_UPDATE.lockReconnect = true
  621. this.$store.getters.STAFF_UPDATE.websock.close() // 离开路由之后断开websocket连接
  622. clearTimeout(this.$store.getters.STAFF_UPDATE.reconnectData) // 离开清除 timeout
  623. clearTimeout(this.$store.getters.STAFF_UPDATE.timeoutObj) // 离开清除 timeout
  624. clearTimeout(this.$store.getters.STAFF_UPDATE.serverTimeoutObj) // 离开清除 timeout
  625. },
  626. // websocket信息变更
  627. onmessage() {
  628. this.$store.getters.STAFF_UPDATE.websock.onmessage = function(evt) {
  629. console.log(evt)
  630. console.log("websocket获取数据==="+evt)
  631. }
  632. },
  633. // 过滤设备数据
  634. filterResource(mashingList){
  635. let arr = mashingList.data.filter((data) => {
  636. return data.name.indexOf("接驳位") <0 && data.name.indexOf("托板") < 0 && data.name.indexOf("上下料站") < 0
  637. && data.name.indexOf("线边库") <0 && data.name.indexOf("立库") <0
  638. });
  639. mashingList.data = arr
  640. mashingList.runData = arr.filter((data)=> { return data.productionStatusCN=="生产中"});
  641. return mashingList
  642. },
  643. // 【SUM50】点击-事件
  644. boxCardClk(){
  645. let paths = "/largeScreen/modeSummary";
  646. // 调用全局挂载的方法
  647. this.$store.dispatch('tagsView/delView', this.$route).then(res => {
  648. this.$router.push({ path: paths, query: {}}) //带参跳转
  649. })
  650. // this.$router.push('/runManageCenter/lineBoardDetail')
  651. // console.log("弹出详情页面!", paths)
  652. },
  653. // 全屏
  654. fullPing(){
  655. this.$nextTick(() => {
  656. // 显示【退出全屏】
  657. this.isFullSreen = true
  658. // 如果是退出全屏
  659. db.save("isCurrScreen", this.isFullSreen)
  660. let $playerMap = this.$refs.playerMap
  661. if($playerMap){
  662. fullScreen($playerMap)
  663. // fullScreen(document.getElementById('playerMap'))
  664. }
  665. })
  666. },
  667. // 退出全屏
  668. exitFullPing(){
  669. this.$nextTick(() => {
  670. // 显示【全屏】
  671. this.isFullSreen = false
  672. // 如果是全屏
  673. db.save("isCurrScreen", this.isFullSreen)
  674. exitFullScreen(document.getElementById('playerMap'))
  675. })
  676. },
  677. // 加载背景颜色
  678. setBackground(color){
  679. return "background: "+ color +";"
  680. },
  681. // 加载【本地图片】
  682. resolveLogo(logo) {
  683. return require(`@/assets/icon/${logo}`);
  684. },
  685. // 获取列表数据
  686. getTabList(){
  687. lineBoardAPI.getBigScreenList({}).then(res => {
  688. res = res.data
  689. if(res.isSuccess){
  690. this.tabDownData.list = res.data.list
  691. // 给资源赋值id
  692. this.resourceId = this.tabDownData.list[0].id
  693. }
  694. })
  695. },
  696. //时间差转换
  697. formatGap(date) {
  698. let staytimeGap = new Date(date).getTime() - new Date().getTime();
  699. if(staytimeGap<0){
  700. staytimeGap = new Date().getTime() - new Date(date).getTime();
  701. }
  702. let stayDay = Math.floor(staytimeGap/(24*3600*1000));
  703. let level = staytimeGap%(24*3600*1000);
  704. let stayHour = Math.floor(level/(3600*1000));
  705. let leave12 = level%(3600*1000);
  706. let stayMin = Math.floor(leave12/(60*1000));
  707. return [Number(parseFloat(stayDay/30*100).toFixed(2)), stayDay + "天" +stayHour + "小时" + stayMin + "分"]
  708. },
  709. // 设置进度文本内容
  710. setItemText(text){
  711. return () => {
  712. return this.formatGap(text)[1]
  713. }
  714. },
  715. expireText(text){
  716. return () => {
  717. return "过期" + this.formatGap(text)[1]
  718. }
  719. },
  720. setPercentage(text){
  721. return this.formatGap(text)[0]>100? 100 : this.formatGap(text)[0]
  722. }
  723. }
  724. }
  725. </script>
  726. <!-- 全局样式-通过定义父DOM的calss,来只影响本组件 -->
  727. <style lang="scss" type="text/css">
  728. .percenter{
  729. .el-progress--circle .el-progress__text{
  730. top: 60%;
  731. color: #FFFFFF;
  732. font-size: 14px;
  733. }
  734. }
  735. .pragreeTable {
  736. .el-progress-bar__outer{
  737. background-color: #a1a1a178;
  738. }
  739. }
  740. .timeprogress .el-progress-bar__outer {
  741. background-color:#000;
  742. }
  743. .timeprogress .el-progress-bar__inner {
  744. text-align:center;
  745. }
  746. .notifyStyle {
  747. background-color:#000088 !important;
  748. }
  749. .notifyStyle .el-notification__content{
  750. color: #fff !important;
  751. }
  752. .notifyStyle .el-notification__title {
  753. color: #fff !important;
  754. }
  755. </style>
  756. <!-- 本组件样式 -->
  757. <style lang="scss" scoped>
  758. .headerTitle{
  759. position: relative;
  760. top: 20px;
  761. left: -13px;
  762. font-family: "微软雅黑";
  763. font-size: 32px;
  764. text-shadow: 1px 2px 3px #ece9e9;
  765. letter-spacing: 3px;
  766. }
  767. .platformDiv {
  768. .leftDivAuto {
  769. min-height: initial;
  770. }
  771. .modelTitle {
  772. color: #28BDE0;
  773. }
  774. }
  775. .headerBg{
  776. .tabsDiv{
  777. position: absolute;
  778. font-size: 17px;
  779. font-weight: bold;
  780. color: #28BDE0;
  781. bottom: 20px;
  782. left: 0;
  783. span {
  784. cursor: pointer;
  785. margin-right: 20px;
  786. }
  787. span:hover{
  788. opacity: 0.7;
  789. }
  790. .tabsActive{
  791. color: #FFFFFF;
  792. }
  793. }
  794. }
  795. .gaugeDiv{
  796. width: 100%;
  797. height: 190px;
  798. }
  799. .bottomDiv{
  800. width: 100%;
  801. min-height: 215px;
  802. white-space: nowrap;
  803. ul {
  804. width: 100%;
  805. list-style: none;
  806. margin: 0;
  807. padding: 0;
  808. li {
  809. position: relative;
  810. background: #457f968c;
  811. display: inline-block;
  812. margin: 0 10px 10px;
  813. -moz-border-radius: 8px;
  814. -webkit-border-radius: 8px;
  815. border-radius: 8px;
  816. .mStatus {
  817. position: absolute;
  818. top: 10px;
  819. right: 0px;
  820. display: inline-block;
  821. background: #2573b8d1;
  822. padding: 2px 6px;
  823. font-size: 14px;
  824. -moz-border-radius: 3px;
  825. -webkit-border-radius: 3px;
  826. border-radius: 3px;
  827. }
  828. .mAudit {
  829. position: absolute;
  830. top: 40px;
  831. right: 0px;
  832. display: inline-block;
  833. background: #2573b8d1;
  834. padding: 2px 6px;
  835. font-size: 14px;
  836. -moz-border-radius: 3px;
  837. -webkit-border-radius: 3px;
  838. border-radius: 3px;
  839. }
  840. .mashingImg {
  841. background: #FFFFFF;
  842. width: 180px;
  843. height: 110px;
  844. -moz-border-radius: 8px;
  845. -webkit-border-radius: 8px;
  846. border-radius: 8px;
  847. }
  848. .mashingDiv {
  849. padding: 20px 10px 10px;
  850. .mashingCode {
  851. position: relative;
  852. text-align: left;
  853. padding-left: 20px;
  854. margin-bottom: 7px;
  855. }
  856. .mashingCode:before {
  857. background: #00FFFF;
  858. position: absolute;
  859. content: "";
  860. left: 0;
  861. top: 5px;
  862. width: 10px;
  863. height: 10px;
  864. -moz-border-radius: 50%;
  865. -webkit-border-radius: 50%;
  866. border-radius: 50%;
  867. }
  868. .mashingName {
  869. text-align: left;
  870. }
  871. }
  872. }
  873. li.resourceLi{
  874. background: none;
  875. .modelTitle2 {
  876. position: relative;
  877. top: 0;
  878. color: #28BDE0;
  879. font-size: 18px;
  880. line-height: 22px;
  881. font-weight: bold;
  882. width: 20px;
  883. white-space: normal;
  884. }
  885. }
  886. }
  887. }
  888. .tableBorder{
  889. width: 100%;
  890. border-left: 1px solid #184659;
  891. border-top: 1px solid #184659;
  892. tr {
  893. th{
  894. background: #457f968c;
  895. padding: 5px 2px;
  896. font-size: 12px;
  897. border-bottom: 1px solid #184659;
  898. }
  899. td {
  900. padding: 5px 2px;
  901. text-align: center;
  902. font-size: 11px;
  903. border-right: 1px solid #184659;
  904. border-bottom: 1px solid #184659;
  905. }
  906. }
  907. }
  908. .percenter{
  909. position: relative;
  910. width: 100%;
  911. height: 105px;
  912. .pcText{
  913. display: inline-block;
  914. position: absolute;
  915. top: 35%;
  916. left: 0;
  917. width: 100%;
  918. color: #999999;
  919. font-size: 12px;
  920. text-align: center;
  921. }
  922. }
  923. .allTitleLeft{
  924. padding-top: 10px;
  925. margin-bottom: 30px;
  926. border-top: 1px solid #275379;
  927. }
  928. .allTitle{
  929. margin-bottom: 10px;
  930. font-size: 11px;
  931. }
  932. .allFont{
  933. font-size: 22px;
  934. color: #00d8ff;
  935. }
  936. .modelStatus{
  937. display: flex;
  938. justify-content: center;
  939. align-items: center;
  940. background: #13ce66;
  941. min-height: 60px;
  942. -moz-border-radius: 5px;
  943. -webkit-border-radius: 5px;
  944. border-radius: 5px;
  945. }
  946. .modelStatus2{
  947. background: #457f968c;
  948. min-height: 60px;
  949. -moz-border-radius: 5px;
  950. -webkit-border-radius: 5px;
  951. border-radius: 5px;
  952. }
  953. .centerNums{
  954. font-size: 28px;
  955. margin: 0;
  956. padding: 15px 0 10px;
  957. }
  958. .centerTitle{
  959. font-size: 14px;
  960. padding: 10px 0;
  961. }
  962. .borderTop{
  963. padding-top: 10px;
  964. border-top: 1px solid #275379;
  965. }
  966. .seamless-warp {
  967. height: 200px;
  968. overflow: hidden;
  969. }
  970. .item > .DataList_top {
  971. list-style: none;
  972. float: left;
  973. color: red;
  974. margin-left: -40px;
  975. font-size: 14px;
  976. min-width:400px;
  977. width:100%;
  978. }
  979. .item .DataList_col {
  980. float: left;
  981. font-size: 12px;
  982. margin:2px 0;
  983. }
  984. .item .DataList_col2 {
  985. float: left;
  986. font-size: 12px;
  987. margin:2px 0 2px 12px;
  988. }
  989. .item .clearfix {
  990. clear: both;
  991. }
  992. </style>