Merge branch 'master' of http://www.beijingsoft.cn:9090/r/smart-web
| | |
| | | <!-- |
| | | * @Date: 2024-04-09 22:11:21 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-04-21 18:58:16 |
| | | * @LastEditTime: 2024-05-14 20:40:54 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/alarm-statistics.vue |
| | | * 效率分析 |
| | | --> |
| | |
| | | </el-main> |
| | | <el-footer> |
| | | <el-button @click="query()">查询</el-button> |
| | | <el-button>导出</el-button> |
| | | <!-- <el-button>导出</el-button> --> |
| | | </el-footer> |
| | | </el-container> |
| | | </el-aside> |
| | |
| | | }, |
| | | methods: { |
| | | query(firstWorkKey) { |
| | | console.log('------') |
| | | let workstationId = firstWorkKey ? [firstWorkKey] : [...this.treeChecked] |
| | | this.$nextTick(() => { |
| | | this.$refs[this.activeName].init({ |
| | | endDate: this.time[1], |
| | | startDate: this.time[0], |
| | | workstationId |
| | | }) |
| | | }) |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | <!-- |
| | | * @Date: 2024-04-18 21:52:18 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-04-23 19:45:00 |
| | | * @LastEditTime: 2024-05-14 20:42:32 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/components/ShiftAlarm.vue |
| | | --> |
| | | <template> |
| | |
| | | }, |
| | | methods: { |
| | | init(params) { |
| | | this.btnListActive = '' |
| | | console.log('++++++') |
| | | this.params = { |
| | | ...this.params, |
| | | ...params, |
| | | workstationId: params.workstationId.toString() |
| | | } |
| | | this.getTime({ |
| | |
| | | }, |
| | | getColor(name) { |
| | | var color = ''; |
| | | console.log(this.achievements,name); |
| | | this.achievements.forEach(item=> { |
| | | if(item.code == name) { |
| | | color = item.color; |
| | |
| | | var endTime = moment(item1.endTime).diff(moment(initstart + " 00:00:00"), 'minutes'); |
| | | var diff = moment(item1.endTime).diff(moment(item1.startTime), 'minutes') //开始了多久 |
| | | var color = this.getColor(item1.wcs); |
| | | console.log(color,222) |
| | | item1.value = [index,startTime,endTime,diff]; |
| | | item1.itemStyle = {"normal": {"color": color}}; |
| | | item1.code = item.workstationInfo.code; |
| | |
| | | }) |
| | | this.total = res.data.total; |
| | | //渲染图表 |
| | | console.log(yAxisData,newData,111) |
| | | this.setCharts(yAxisData,newData); |
| | | // 检查是否存在id为'parentNodeDom'的DOM元素,有就先删除 |
| | | var parentNodeDom = document.getElementById('parentNodeDom'); |
| | |
| | | import moment from 'moment'; |
| | | import * as echarts from 'echarts'; |
| | | export default { |
| | | props: ['setWork','collectionstatus',"select"], |
| | | props: ['setWork','achievements',"select"], |
| | | watch: { |
| | | setWork(val) { |
| | | this.current = "1"; |
| | |
| | | }, |
| | | getColor(name) { |
| | | var color = ''; |
| | | this.collectionstatus.forEach(item=> { |
| | | if(item.name == name) { |
| | | this.achievements.forEach(item=> { |
| | | if(item.code == name) { |
| | | color = item.color; |
| | | } |
| | | }) |
| | |
| | | var startTime = moment(item1.startTime).diff(moment(initstart + " 00:00:00"), 'minutes'); |
| | | var endTime = moment(item1.endTime).diff(moment(initstart + " 00:00:00"), 'minutes'); |
| | | var diff = moment(item1.endTime).diff(moment(item1.startTime), 'minutes') //开始了多久 |
| | | var color = this.getColor(item1.wcsDesc); |
| | | var color = this.getColor(item1.wcs); |
| | | item1.value = [index,startTime,endTime,diff]; |
| | | item1.itemStyle = {"normal": {"color": color}}; |
| | | item1.code = item.date; |
| | |
| | | var option = { |
| | | tooltip: { |
| | | formatter: function (params) { |
| | | console.log(params) |
| | | return `<span class="tipdesc">工位</span>${params.data.name}</br> |
| | | <span class="tipdesc">状态</span>${params.data.wcsDesc}</br> |
| | | <span class="tipdesc">描述</span>${params.data.feedbackDesc}</br> |
| | |
| | | <el-icon><ArrowRight /></el-icon> |
| | | </div> |
| | | <div class="status-content-cardp" v-for="item in timestatus" style="width: 33.3333%; height: 50%;"> |
| | | <div class="status-card-box" style="border-color: rgb(89, 89, 89);"> |
| | | <div class="status-card-box" style="border-color: #ccc;"> |
| | | <div class="status-card-top"> |
| | | <div class="status-card-detail"> |
| | | <div title="461" class="status-card-detail-name">{{item.code}}</div> |
| | | <div class="status-card-detail-status"> |
| | | <div class="status-card-detail-point" style="background-color: rgb(89, 89, 89);"></div>{{item.statusName}} |
| | | <div class="status-card-detail-time" style="color: rgb(89, 89, 89);">---</div> |
| | | <div class="status-card-detail-point" :style="{'background-color': item.statusStyle}"></div>{{item.statusName}} |
| | | <div class="status-card-detail-time" style="color: #ccc;">---</div> |
| | | </div> |
| | | </div> |
| | | <div class="status-card-machine" style="border-color: rgb(89, 89, 89);"> |
| | | <div class="status-card-machine" style="border-color: #ccc;"> |
| | | <div class="status-card-machine-img"> |
| | | <img src="./station.png" width="68" height="68"> |
| | | </div> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | statusStyle: "#ccc", |
| | | titleMap: "", |
| | | visible: false, |
| | | visibleList: [], |
| | |
| | | var visibleList = JSON.parse(JSON.stringify(item.properties)); |
| | | visibleList.forEach(item=> { |
| | | if(item.statusName) { |
| | | item.namecolor = "rgb(89, 89, 89)"; |
| | | item.namecolor = "#ccc"; |
| | | item.statuscolor = "rgba(89, 89, 89, 0.14)"; |
| | | }else { |
| | | item.namecolor = "rgb(127, 192, 192)"; |
| | |
| | | var records = JSON.parse(JSON.stringify(res.data.records)); |
| | | records.forEach(item=> { |
| | | item.statusName = "未知"; |
| | | item.statusStyle = '#ccc'; |
| | | if(item.properties != null) { |
| | | item.properties.forEach(item1=> { |
| | | this.devicestatus.forEach(item2=> { |
| | | if(item2.status == item1.value) { |
| | | item.statusName = item2.statusName; |
| | | item1.statusName = item2.statusName; |
| | | item.statusStyle = item2.color; |
| | | } |
| | | }) |
| | | }) |
| | |
| | | <save-dialog v-if="dialog.save" ref="saveDialog" @success="addfeedbackSuccess" :workstationId="lastLevelId" @closed="dialog.save=false"></save-dialog> |
| | | </template> |
| | | <script> |
| | | import moment from 'moment' |
| | | import * as echarts from 'echarts'; |
| | | import saveDialog from './add-station-status' |
| | | export default { |
| | |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | data: ['00:00:00', '02:00:00', '04:00:00', '06:00:00', '08:00:00', '10:00:00', '12:00:00', '14:00:00', '18:00:00'], |
| | | data: [], |
| | | }, |
| | | yAxis: { |
| | | type: 'category', |
| | |
| | | item.value = 0; |
| | | }) |
| | | this.wcsOptionLog.series[0].data = res.data; |
| | | //计算时间 |
| | | var startOfDay = moment().startOf('day'); //00:00:00 |
| | | var now = moment(); //当前时间 |
| | | var diffInMilliseconds = now.diff(startOfDay); //时间差 |
| | | var diffInHours = Math.floor(diffInMilliseconds / (1000 * 60 * 60)); //时间差转换成小时 |
| | | //分割 |
| | | var everTime = Math.ceil(diffInHours/8); |
| | | var arrData = []; |
| | | for(var i=0;i<=diffInHours;i+=everTime) { |
| | | if(i<=10) { |
| | | var num = '0' + i; |
| | | }else { |
| | | var num = i; |
| | | } |
| | | arrData.push(num + ':00:00'); |
| | | } |
| | | //计算时间结束 |
| | | this.wcsOptionLog.xAxis.data = [...arrData,moment().format("HH:mm:ss")]; |
| | | myChart.setOption(this.wcsOptionLog); |
| | | } |
| | | }) |
| | |
| | | this.$HTTP.get(`/api/blade-cps/workstation/get-dmp-variables?machineId=${machineId}&workstationId=${lastLevelId}`).then(res=> { |
| | | if(res.code == 200) { |
| | | this.dmpList = res.data; |
| | | console.log(this.dmpList,1) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | </div> |
| | | </div> |
| | | <!-- setWork 入参 --> |
| | | <record-charts-by-workstation :setWork="setWork" :select="select" :collectionstatus="collectionstatus" v-if="!isshowempty"></record-charts-by-workstation> |
| | | <record-charts-by-workstation :setWork="setWork" :select="select" :achievements="achievements" v-if="!isshowempty"></record-charts-by-workstation> |
| | | </div> |
| | | </div> |
| | | <save-dialog v-if="dialog.save" ref="saveDialog" @success="addfeedbackSuccess" :workstationId="lastLevelId" @closed="dialog.save=false"></save-dialog> |
| | |
| | | }, |
| | | methods: { |
| | | addfeedbackSuccess() { |
| | | var workstationName = ""; |
| | | this.btnGongweiList.forEach(item=> { |
| | | if(item.id == this.btnGongweiListActive) { |
| | | workstationName = item.name; |
| | | } |
| | | }) |
| | | this.setWork = { |
| | | endDate: this.time[1], |
| | | startDate: this.time[0], |
| | | humanFeedback: true, |
| | | machineFeedback: true, |
| | | workstationId: this.lastLevelId |
| | | workstationId: this.lastLevelId, |
| | | workstationName: workstationName |
| | | } |
| | | }, |
| | | table_edit(){ |
| | |
| | | changeTabGongwei(item) { //按工位查询 |
| | | this.btnGongweiListActive = item.id; |
| | | this.lastLevelId = this.btnGongweiListActive; |
| | | var workstationName = ""; |
| | | this.btnGongweiList.forEach(item=> { |
| | | if(item.id == this.btnGongweiListActive) { |
| | | workstationName = item.name; |
| | | } |
| | | }) |
| | | this.setWork = { |
| | | endDate: this.time[1], |
| | | startDate: this.time[0], |
| | | humanFeedback: true, |
| | | machineFeedback: true, |
| | | workstationId: item.id |
| | | workstationId: item.id, |
| | | workstationName: workstationName |
| | | } |
| | | }, |
| | | getachievements() { //班次状态记录采集状态 |
| | |
| | | startDate: this.time[0], |
| | | humanFeedback: true, |
| | | machineFeedback: true, |
| | | workstationId: this.select[0].id |
| | | workstationId: this.select[0].id, |
| | | workstationName: this.btnGongweiList[0].name |
| | | } |
| | | this.isshowempty = false; |
| | | } |