| | |
| | | * @Descripttion: å·¥å
·é |
| | | * @version: 1.2 |
| | | * @LastEditors: lzhe lzhe@example.com |
| | | * @LastEditTime: 2024-11-01 14:57:42 |
| | | * @LastEditTime: 2024-11-10 18:49:52 |
| | | */ |
| | | |
| | | import CryptoJS from 'crypto-js'; |
| | |
| | | |
| | | console.log(hostname,port,pathname) |
| | | if (process.env.NODE_ENV=='development') { |
| | | //var path = "120.46.212.231:85"; //å¦ææ¯æ¬å°èè°ï¼åæ120.46.212.231:85ï¼åçåæhostname+":"+port; |
| | | //var path = "120.46.212.231:86"; //å¦ææ¯æ¬å°èè°ï¼åæ120.46.212.231:86ï¼åçåæhostname+":"+port; |
| | | var path = hostname+":"+port; |
| | | } else { |
| | | var path = hostname+":"+port; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | * @Date: 2024-04-18 21:52:18 |
| | | * @LastEditors: lzhe lzhe@example.com |
| | | * @LastEditTime: 2024-11-10 13:22:12 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/components/TimeAlarm.vue |
| | | --> |
| | | <template> |
| | | <div> |
| | | <div id="pie1" style="width: 100%;height:200px;"></div> |
| | | <div id="pie2" style="width: 100%;height:200px;"></div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import * as echarts from 'echarts'; |
| | | export default { |
| | | props: { |
| | | getwcsRData: { |
| | | default: [], |
| | | type: Array |
| | | } |
| | | }, |
| | | components: { |
| | | |
| | | }, |
| | | data() { |
| | | return { |
| | | option: { |
| | | title: { |
| | | text: '弿ºè¿è¡ç', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item', |
| | | formatter: function (params) { |
| | | // èªå®ä¹tooltipå
容ï¼å¦ææ¬åå¨âå
¶ä»âä¸ï¼åè¿å空å符串 |
| | | if (params.name === 'è¿è¡ç') { |
| | | return params.name + ' : ' + ' (' + params.percent + '%)'; |
| | | } else { |
| | | return ''; |
| | | } |
| | | } |
| | | }, |
| | | graphic: { |
| | | type: 'text', |
| | | enterFrom: { |
| | | style: { opacity: 0 }// æ·¡å
¥ |
| | | }, |
| | | enterAnimation: { |
| | | duration: 1300//å¨ç»æ¶é¿ |
| | | }, |
| | | left: 'center', |
| | | top: 'middle', |
| | | style: { |
| | | text: [ |
| | | '弿ºè¿è¡ç', |
| | | '88.00%' |
| | | ].join('\n'), |
| | | textAlign: 'center', |
| | | textVerticalAlign: 'middle', |
| | | fontSize: 12, |
| | | fontWeight: 'bold', |
| | | fill: '#44CD96' // æåé¢è² |
| | | } |
| | | }, |
| | | series: [ |
| | | { |
| | | radius: ['40%', '65%'], |
| | | center: ['50%', '50%'], |
| | | name: 'æ°æ®æ¥æº', |
| | | type: 'pie', |
| | | // data: [ |
| | | // { value: 80, name: 'è¿è¡ç', itemStyle: { color: '#44CD96' } }, |
| | | // { value: 20, name: 'å
¶ä»', itemStyle: { color: '#ADB0AF' } } |
| | | // ], |
| | | label: { //outside注é |
| | | show: false, |
| | | // formatter: function(params) { |
| | | // if(params.name == 'è¿è¡ç') { |
| | | // return params.name + ':' + params.percent + '%'; |
| | | // }else { |
| | | // return '' |
| | | // } |
| | | // } |
| | | }, |
| | | emphasis: { //hoverå
³éé«äº®ç¶æ |
| | | disabled: true, |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | query() { |
| | | this.getwcsRData.forEach(item=> { |
| | | if(item.name == 'è¿è¡ç') { |
| | | var option = JSON.parse(JSON.stringify(this.option)); |
| | | option.title.text = "弿ºè¿è¡ç"; |
| | | option.graphic.style.text = ['弿ºè¿è¡ç',item.value + '%'].join('\n'); |
| | | option.series[0].data = [ |
| | | { value: item.value, name: 'è¿è¡ç', itemStyle: { color: item.itemStyle.color }}, |
| | | { value: (100 - item.value), name: 'å
¶ä»', itemStyle: { color: '#ADB0AF' }} |
| | | ] |
| | | var myChartPie1 = echarts.init(document.getElementById('pie1')); |
| | | myChartPie1.setOption(option); |
| | | } |
| | | if(item.name == '稼å¨ç') { |
| | | var option = JSON.parse(JSON.stringify(this.option)); |
| | | option.title.text = "稼å¨ç"; |
| | | option.graphic.style.text = ['稼å¨ç',item.value + '%'].join('\n'); |
| | | option.series[0].data = [ |
| | | { value: item.value, name: '稼å¨ç', itemStyle: { color: item.itemStyle.color }}, |
| | | { value: (100 - item.value), name: 'å
¶ä»', itemStyle: { color: '#ADB0AF' }} |
| | | ] |
| | | var myChartPie2 = echarts.init(document.getElementById('pie2')); |
| | | myChartPie2.setOption(option); |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | watch: { |
| | | getwcsRData() { |
| | | this.query(); |
| | | } |
| | | }, |
| | | mounted() { |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped></style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | * @Date: 2024-04-18 21:52:18 |
| | | * @LastEditors: lzhe lzhe@example.com |
| | | * @LastEditTime: 2024-11-10 18:35:10 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/components/TimeAlarm.vue |
| | | --> |
| | | <template> |
| | | <div class="speed"> |
| | | <div id="c" style="width: 30%;height:200px;"></div> |
| | | <div id="d" style="width: 30%;height:200px;"></div> |
| | | <div id="e" style="width: 30%;height:200px;"></div> |
| | | </div> |
| | | <div class="dataHr">å å·¥æ°æ®</div> |
| | | <el-row :gutter="20" style="padding-right: 12px;padding-left: 12px;"> |
| | | <!-- 主轴è´è½½(SpindleLoad),主轴åç(SpindleRate),è¿ç»åç(FeedRate) ä¸å¨è¿éå±ç¤º --> |
| | | <el-col :span="12" v-for="item in dmpList" style="margin-bottom: 12px;"> |
| | | <div v-if="item.dpName != 'SpindleLoad' && item.dpName != 'SpindleRate' && item.dpName != 'FeedRate'"> |
| | | <div class="inlineDiv">{{item.dpLabel}}</div> |
| | | <el-input v-model="item.codeName" :disabled="true" class="inlineInput" :title="item.codeName"></el-input> |
| | | </div> |
| | | |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <script> |
| | | import * as echarts from 'echarts'; |
| | | export default { |
| | | props: { |
| | | dmpList: { |
| | | default: [], |
| | | type: Array, |
| | | } |
| | | }, |
| | | watch: { |
| | | dmpList() { |
| | | this.query(); |
| | | } |
| | | }, |
| | | components: { |
| | | |
| | | }, |
| | | data() { |
| | | return { |
| | | input: '', |
| | | option: { |
| | | graphic: { |
| | | type: 'text', |
| | | enterFrom: { |
| | | style: { opacity: 0 }// æ·¡å
¥ |
| | | }, |
| | | enterAnimation: { |
| | | duration: 1300//å¨ç»æ¶é¿ |
| | | }, |
| | | left: 'center', |
| | | top: 'bottom', |
| | | style: { |
| | | text: [ |
| | | '主轴åç100.00%', |
| | | ].join('\n'), |
| | | textAlign: 'center', |
| | | textVerticalAlign: 'middle', |
| | | fontSize: 12, |
| | | fontWeight: 'bold', |
| | | fill: '#333' // æåé¢è² |
| | | } |
| | | }, |
| | | series: [ |
| | | { |
| | | type: 'gauge', |
| | | axisLine: { |
| | | lineStyle: { |
| | | width: 10, |
| | | color: [ |
| | | [0.3, '#67e0e3'], |
| | | [0.7, '#37a2da'], |
| | | [1, '#fd666d'] |
| | | ] |
| | | } |
| | | }, |
| | | pointer: { |
| | | itemStyle: { |
| | | color: 'auto' |
| | | } |
| | | }, |
| | | axisTick: { //å»åº¦ |
| | | splitNumber: 5, |
| | | distance: -10, //å»åº¦ä¸è½´çº¿çè·ç¦» |
| | | lineStyle: { |
| | | color: '#fff', |
| | | width: 2 |
| | | } |
| | | }, |
| | | splitLine: { |
| | | distance: -14, //å»åº¦è·ç¦»è¡¨ççè·ç¦» |
| | | length: 10, |
| | | lineStyle: { |
| | | color: '#fff', |
| | | width: 2 //æ¯ä¸ªé¯é½¿çº¿å®½ |
| | | } |
| | | }, |
| | | axisLabel: { //表çå
å»åº¦ |
| | | color: 'inherit', |
| | | distance: 20, //å»åº¦è·ç¦»è¡¨ççè·ç¦» |
| | | fontSize: 12 |
| | | }, |
| | | detail: { |
| | | show: false |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | query() { |
| | | if(this.dmpList.length == 0) return; |
| | | var a,b,c; |
| | | this.dmpList.forEach(item=> { |
| | | if(item.dpName == "SpindleLoad") { |
| | | a = item.codeName; |
| | | }else if(item.dpName == "SpindleRate") { |
| | | b = item.codeName; |
| | | }else if(item.dpName == "FeedRate") { |
| | | c = item.codeName; |
| | | } |
| | | }) |
| | | this.showCharts(a,b,c); |
| | | }, |
| | | showCharts(a,b,c) { |
| | | var myChartA = echarts.init(document.getElementById('c')); |
| | | var myChartB = echarts.init(document.getElementById('d')); |
| | | var myChartC = echarts.init(document.getElementById('e')); |
| | | var optionA = JSON.parse(JSON.stringify(this.option)); |
| | | var optionB = JSON.parse(JSON.stringify(this.option)); |
| | | var optionC = JSON.parse(JSON.stringify(this.option)); |
| | | optionA.graphic.style.text= ['主轴è´è½½'+a+'%',].join('\n'); |
| | | optionB.graphic.style.text= ['主轴è´è½½'+b+'%',].join('\n'); |
| | | optionC.graphic.style.text= ['ç»è¿åç'+c+'%',].join('\n'); |
| | | optionA.series[0].data = [{value: a}]; |
| | | optionB.series[0].data = [{value: b}]; |
| | | optionC.series[0].data = [{value: c}]; |
| | | myChartA.setOption(optionA); |
| | | myChartB.setOption(optionB); |
| | | myChartC.setOption(optionC); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.showCharts(0,0,0); |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .speed { |
| | | display: flex; |
| | | justify-content: center; |
| | | } |
| | | .speed > div { |
| | | flex: 1; |
| | | } |
| | | .dataHr { |
| | | background-color: #48ACF8; |
| | | height: 30px; |
| | | width: 100%; |
| | | text-align: center; |
| | | line-height: 30px; |
| | | font-size: 13px; |
| | | color: #fff; |
| | | font-weight: bold; |
| | | margin-top: 12px; |
| | | margin-bottom: 12px; |
| | | } |
| | | .inlineDiv { |
| | | display: inline-block; |
| | | width: 70px; |
| | | text-align: left; |
| | | } |
| | | .inlineInput { |
| | | width: calc(100% - 76px); |
| | | margin-left: 6px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | * @Date: 2024-04-18 21:52:18 |
| | | * @LastEditors: lzhe lzhe@example.com |
| | | * @LastEditTime: 2024-11-10 18:34:55 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/components/TimeAlarm.vue |
| | | --> |
| | | <template> |
| | | <el-row> |
| | | <el-col :span="24" class="stationFormDataImg"><img :src="stationFormData.avatar" alt=""></el-col> |
| | | <el-col :span="24" class="stationFormData">å·¥ä½ç¼å·: {{stationFormData.code}}</el-col> |
| | | <el-col :span="24" class="stationFormData">æºå¨åç: {{stationFormData.machineBrand}}</el-col> |
| | | <el-col :span="24" class="stationFormData">æºå¨ç¼å·: {{stationFormData.machineCode}}</el-col> |
| | | <el-col :span="24" class="stationFormData">æºå¨åç§°: {{stationFormData.machineName}}</el-col> |
| | | <el-col :span="24" class="stationFormData">å®å·¥ä»¶æ°ï¼{{stationFormData.Output}}</el-col> |
| | | <el-col :span="24" class="stationFormData">æºåºç¶æï¼{{stationFormData.DeviceStatus}}</el-col> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <script> |
| | | import station from "../station.png"; |
| | | export default { |
| | | props: { |
| | | stationFormData: { |
| | | default: {}, |
| | | type: Object, |
| | | }, |
| | | dmpList: { |
| | | default: [], |
| | | type: Array, |
| | | } |
| | | }, |
| | | components: { |
| | | |
| | | }, |
| | | watch: { |
| | | stationFormData() { |
| | | this.query(); |
| | | }, |
| | | dmpList() { |
| | | this.setDmpList(); |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | } |
| | | }, |
| | | methods: { |
| | | setDmpList() { |
| | | if(this.dmpList.length == 0) return; |
| | | this.dmpList.forEach(item=> { |
| | | if(item.dpName == "DeviceStatus") { |
| | | this.stationFormData.DeviceStatus = item.codeName; |
| | | } |
| | | if(item.dpName == "Output") { |
| | | this.stationFormData.Output = item.codeName; |
| | | } |
| | | }) |
| | | }, |
| | | query() { |
| | | //console.log(this.stationFormData,1) |
| | | } |
| | | }, |
| | | mounted() { |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .stationFormData { |
| | | padding-left: 12px; |
| | | line-height: 24px; |
| | | border-bottom: 1px solid #eee; |
| | | } |
| | | .stationFormDataImg { |
| | | margin-bottom: 12px; |
| | | } |
| | | .stationFormDataImg img{ |
| | | width: 100%; |
| | | height: 150px; |
| | | } |
| | | </style> |
| | |
| | | * @Author: lzhe lzhe@example.com |
| | | * @Date: 2024-03-26 10:28:33 |
| | | * @LastEditors: lzhe lzhe@example.com |
| | | * @LastEditTime: 2024-11-08 18:26:10 |
| | | * @LastEditTime: 2024-11-10 18:49:17 |
| | | * @FilePath: /smart-web/src/views/master/person/main/index.vue |
| | | * @Description: è¿æ¯é»è®¤è®¾ç½®,请设置`customMade`, æå¼koroFileHeaderæ¥çé
ç½® è¿è¡è®¾ç½®: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE |
| | | --> |
| | |
| | | <MYTree v-model="treeChecked" @loaded="query"></MYTree> |
| | | </div> |
| | | <div class="aposcope-right"> |
| | | <div class="content-machine-box"> |
| | | <div class="content-machine-box" style="min-height: 450px;"> |
| | | <div class="content-one content-border"> |
| | | <div style="text-align: center;margin-bottom: 12px;margin-top:12px;"> |
| | | <el-date-picker v-model="wcsDate" type="date" @change="wcschangedate" value-format="YYYY-MM-DD" size="small" /> |
| | | </div> |
| | | <stationLiveItem :getwcsRData="getwcsRData"></stationLiveItem> |
| | | </div> |
| | | <div class="content-two content-border"> |
| | | <tationLiveSpeed :dmpList="dmpList"></tationLiveSpeed> |
| | | </div> |
| | | <div class="content-three content-border"> |
| | | <speenBaseInfo :stationFormData="stationForm" :dmpList="dmpList"></speenBaseInfo> |
| | | </div> |
| | | </div> |
| | | <div class="dataHr"></div> |
| | | <div class="content-zhou-box"> |
| | | <div class="zhou-one content-zhou-border"> |
| | | <div><div id="wcs-left" style="width: 100%;height:300px;"></div></div> |
| | | </div> |
| | | <div class="zhou-two content-zhou-border"> |
| | | <el-table :data="tableData2" style="width: 100%;height:300px;"> |
| | | <el-table-column prop="test" label="è½´"></el-table-column> |
| | | <el-table-column prop="test" label="åæ "></el-table-column> |
| | | <el-table-column prop="test" label="æç©"></el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <div class="zhou-three content-zhou-border"> |
| | | <el-table :data="alarmtableData" style="width: 100%;height:300px;"> |
| | | <el-table-column prop="alarmCode" label="æ¥è¦å·"></el-table-column> |
| | | <el-table-column prop="alarmMsg" label="æ¥è¦å
容"></el-table-column> |
| | | <el-table-column prop="alarmTime" label="æ¥è¦æ¶é´"></el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | <div>------------------------------------</div> |
| | | <!-- <div class="content-machine-box"> |
| | | <div class="content-machine-img"><img :src="stationForm.avatar" alt=""></div> |
| | | <div class="content-machine-detail"> |
| | | <div class="content-machine-name">{{stationForm.machineName}}</div> |
| | |
| | | </el-row> |
| | | </el-form> |
| | | </div> |
| | | </div> |
| | | <div class="collect-info-panel"> |
| | | </div> --> |
| | | <!-- <div class="collect-info-panel"> |
| | | <div class="fact-analysis-realtim"> |
| | | <div class="wimi-empty" style="background-color: rgb(255, 255, 255);" v-if="dmpList.length == 0"> |
| | | <!-- <div class="wimi-empty-img" style="width: 150px; height: 150px;"> |
| | | <img src="./quesheng.bd026700.png" style="height: auto; width: 100%;"> |
| | | </div> --> |
| | | <div class="empty-description"> |
| | | <div>ææ æ°æ®</div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <el-tabs type="border-card" class="demo-tabs"> |
| | | <el-tab-pane label="工使°æ®"> |
| | | <div style="text-align: right;margin-bottom: 14px;"> |
| | | <el-date-picker v-model="wcsDate" type="date" @change="wcschangedate" value-format="YYYY-MM-DD" size="small" /> |
| | | </div> |
| | | <div class="wcs-main"> |
| | | <div><div id="wcs-left" style="width: 100%;height:400px;"></div></div> |
| | | <div><div id="wcs-right" style="width: 100%;height:400px;"></div></div> |
| | | </div> |
| | | |
| | | </el-tab-pane> |
| | | <el-tab-pane label="æºå¨å±¥å"> |
| | | <div class="alarm-title">æ¥è¦ä¿¡æ¯å±¥å</div> |
| | |
| | | :total="alarmtotal"> |
| | | </el-pagination> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | |
| | | </el-tabs> --> |
| | | <div class="bottom-panel content-panel"> |
| | | <div class="panel-title">çæ¬¡ç¶æè®°å½</div> |
| | | <div class="panel-content bottom-panel-chart"> |
| | |
| | | import * as echarts from 'echarts'; |
| | | import saveDialog from './add-station-status'; |
| | | import MYTree from './MYTree.vue'; |
| | | import stationLiveItem from './components/StationLiveItem'; //饼ç¶å¾ |
| | | import tationLiveSpeed from './components/StationLiveSpeed'; //speed |
| | | import speenBaseInfo from './components/speenBaseInfo'; //speenBaseInfo |
| | | export default { |
| | | name: "state-feedback", |
| | | data(){ |
| | | return { |
| | | getwcsRData: [], |
| | | tableData1: [], |
| | | tableData2: [], |
| | | tableData3: [], |
| | | treeChecked: [], |
| | | achievements: [], |
| | | collectionstatus: [], |
| | |
| | | fontSize:14 |
| | | } |
| | | }, |
| | | grid: { |
| | | top: 0, |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item', |
| | | //formatter: '{a} <br/>{b} : {c} ({d}%)' |
| | |
| | | legend: { |
| | | orient: 'vertical', |
| | | bottom: 'bottom', |
| | | data: ['è°è¯', '离线', 'å¾
æº', 'æ¥å', 'æ¥è¦', 'è¿è¡'] |
| | | data: ['è°è¯', '离线', 'å¾
æº', 'æ¥å', 'æ¥è¦', 'è¿è¡'] |
| | | }, |
| | | series: [ |
| | | { |
| | | top: -30, |
| | | { |
| | | name: 'ç¨æ¶:', |
| | | type: 'pie', |
| | | radius: '55%', |
| | | center: ['40%', '50%'], |
| | | center: ['50%', '50%'], |
| | | data: [], |
| | | itemStyle: { |
| | | borderRadius: 10, |
| | |
| | | } |
| | | }, |
| | | created(){ |
| | | |
| | | |
| | | }, |
| | | watch: { |
| | | treeChecked() { |
| | |
| | | }, |
| | | mounted(){ |
| | | this.newDate(); //è·åå½åæ¥æ |
| | | this.getachievements(); |
| | | }, |
| | | components: { |
| | | saveDialog,MYTree |
| | | saveDialog,MYTree,stationLiveItem,tationLiveSpeed,speenBaseInfo |
| | | }, |
| | | methods: { |
| | | table_edit(){ |
| | |
| | | } |
| | | this.$HTTP.post(`/api/mdc/status-record/equipment-efficiency`,obj).then(res=> { |
| | | if(res.code == 200) { |
| | | var myChart = echarts.init(document.getElementById('wcs-right')); |
| | | //var myChart = echarts.init(document.getElementById('wcs-right')); |
| | | res.data.forEach(item=> { |
| | | item.value = (Number(item.value)*100).toFixed(2); |
| | | if(item.name == "è¿è¡ç") item.itemStyle = {color: '#73d13d'}; |
| | | if(item.name == "æ¥è¦ç") item.itemStyle = {color: '#ff4d4f'}; |
| | | if(item.name == "稼å¨ç") item.itemStyle = {color: '#40a9ff'}; |
| | | }) |
| | | this.wcsOptionR.series[0].data = res.data; |
| | | myChart.setOption(this.wcsOptionR); |
| | | //this.wcsOptionR.series[0].data = res.data; |
| | | this.getwcsRData = res.data; //æ°å¾å½¢ |
| | | //myChart.setOption(this.wcsOptionR); |
| | | } |
| | | }) |
| | | }, |
| | |
| | | workstationIdList: this.treeChecked |
| | | } |
| | | if(res.data.dpConfig == null || res.data.dpConfig.length == 0) return; //没å¼ä¸ç¨å¾ªç¯ |
| | | |
| | | if(this.$TOOL.socket.websocket == null) { //没æå»ºç«å
å»ºç« |
| | | this.$TOOL.socket.connectToWebSocket(this.$TOOL.cookie.get("TOKEN")); |
| | | } |
| | | this.$TOOL.socket.sendDataToWebSocket(obj); //åé |
| | | var intervalId123 = setInterval(function () { |
| | | if (that.$TOOL.socket.websocket.readyState == 1) { |
| | | clearInterval(intervalId123); |
| | | that.$TOOL.socket.sendDataToWebSocket(obj); //åé |
| | | } |
| | | }, 500); |
| | | this.$TOOL.socket.websocket.onmessage = function(event) { |
| | | var JSONData = JSON.parse(res.data.dpConfig); |
| | | var SpindleLoad = JSONData.some(obj => obj.dpName === 'SpindleLoad'); //夿æ¯å¦æä¸»è½´è´è½½(SpindleLoad)ï¼ |
| | | var SpindleRate = JSONData.some(obj => obj.dpName === 'SpindleRate'); //夿æ¯å¦æä¸»è½´åç(SpindleRate)ï¼ |
| | | var FeedRate = JSONData.some(obj => obj.dpName === 'FeedRate'); //夿æ¯å¦æè¿ç»åç(FeedRate)ï¼ |
| | | if(!SpindleLoad) JSONData.push({dpName: "SpindleLoad",dpLabel: "主轴è´è½½"}); |
| | | if(!SpindleRate) JSONData.push({dpName: "SpindleRate",dpLabel: "主轴åç"}); |
| | | if(!FeedRate) JSONData.push({dpName: "FeedRate",dpLabel: "è¿ç»åç"}); |
| | | var eventData = JSON.parse(event.data); |
| | | if(Object.keys(eventData.data).length == 0) return; |
| | | JSONData.forEach((item,index)=> { //ç¬¬ä¸æ¥ævæ¾å°codeé |
| | | if(item.dpName == "DeviceStatus") { //æºå¨ç¶æ |
| | | if(eventData.data[item.dpName]) { |
| | | item.code = eventData.data[item.dpName].v; |
| | | } |
| | | |
| | | setTimeout(()=> { |
| | | console.log(that.allwcs,888) |
| | | },5000) |
| | | that.allwcs.forEach((item1)=> { |
| | | if(item.code == item1.code) { |
| | | item.codeName = item1.name; //ç¬¬äºæ¥ævçcodeåè¿è¡å¯¹åº |
| | | item.color = item1.color; |
| | | } |
| | | }) |
| | | }else { |
| | | if(item.dpName == 'Alarm') { //æ¥è¦ |
| | | if(eventData.data[item.dpName]) { |
| | | var v = JSON.parse(eventData.data[item.dpName].v); |
| | | if(Array.isArray(v)) { //å¦ææ¯æ°ç»ï¼ä¸èµå¼ |
| | | if(v.length == 0) { |
| | | JSONData.splice(index,1); |
| | | }else { |
| | | item.codeName = v[0].msg; |
| | | } |
| | | }else { |
| | | item.codeName = v.msg; |
| | | } |
| | | item.codeName = eventData.data[item.dpName].v; |
| | | } |
| | | }else { |
| | | if(eventData.data[item.dpName]) { |
| | | item.codeName = eventData.data[item.dpName].v; |
| | | }else { |
| | | item.codeName = ""; |
| | | }else { //ws没æçæ
åµ |
| | | if(item.dpName == "SpindleLoad" || item.dpName == "SpindleRate" || item.dpName == "FeedRate") { |
| | | item.codeName = 0; |
| | | }else { |
| | | item.codeName = ""; |
| | | } |
| | | } |
| | | } |
| | | that.allwcs.forEach((item1)=> { |
| | | if(item.code == item1.code) { |
| | | item.color = item1.color; |
| | | }else { |
| | | item.color = "#7FC0C0"; |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | that.dmpList = JSONData; |
| | |
| | | color: #fff; |
| | | border-radius: 2px 2px 0 0; |
| | | } |
| | | .content-machine-box { |
| | | .content-machine-box,.content-zhou-box { |
| | | display: flex; |
| | | align-items: center; |
| | | align-items: flex-start; |
| | | flex-direction: row; |
| | | flex-wrap: nowrap; |
| | | align-content: center; |
| | | justify-content: flex-start; |
| | | background-color: rgba(59, 142, 142, .06); |
| | | border-radius: 2px; |
| | | border: 1px solid #ccc; |
| | | } |
| | | .content-border { |
| | | height: 100%; |
| | | } |
| | | .content-zhou-border { |
| | | height: 100%; |
| | | } |
| | | .content-one { |
| | | width: 25%; |
| | | } |
| | | .content-two,.zhou-three { |
| | | flex: 1; |
| | | } |
| | | .content-two { |
| | | border-left: 1px solid #eee; |
| | | border-right: 1px solid #eee; |
| | | min-height: 450px; |
| | | } |
| | | .content-three { |
| | | width: 25%; |
| | | } |
| | | .zhou-one { |
| | | width: 28%; |
| | | } |
| | | .zhou-two { |
| | | width:28%; |
| | | border-left: 1px solid #eee; |
| | | border-right: 1px solid #eee; |
| | | } |
| | | .content-machine-img { |
| | | margin: 14px; |
| | |
| | | display: inline-block; |
| | | border-bottom: 1px solid #eee; |
| | | } |
| | | .dataHr { |
| | | background-color: #48ACF8; |
| | | height: 30px; |
| | | width: 100%; |
| | | text-align: center; |
| | | line-height: 30px; |
| | | font-size: 13px; |
| | | color: #fff; |
| | | font-weight: bold; |
| | | margin-top: 12px; |
| | | margin-bottom: 12px; |
| | | } |
| | | </style> |