1
lzhe
2024-05-14 a7b6aa5c857c091bc53a9f02fed855d926ecb90a
1
已修改5个文件
70 ■■■■ 文件已修改
src/views/mdc/components/recordChartsByDate.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/components/recordChartsByWorkstation.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/realtime-status/index.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/station-live.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/status-record.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/components/recordChartsByDate.vue
@@ -75,7 +75,6 @@
        },
        getColor(name) {
            var color = '';
            console.log(this.achievements,name);
            this.achievements.forEach(item=> {
                if(item.code == name) {
                    color = item.color;
@@ -105,7 +104,6 @@
                            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;
@@ -116,7 +114,6 @@
                    })
                    this.total = res.data.total;
                    //渲染图表
                    console.log(yAxisData,newData,111)
                    this.setCharts(yAxisData,newData);
                    // 检查是否存在id为'parentNodeDom'的DOM元素,有就先删除
                    var parentNodeDom = document.getElementById('parentNodeDom');  
src/views/mdc/components/recordChartsByWorkstation.vue
@@ -11,7 +11,7 @@
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";
@@ -67,8 +67,8 @@
        },
        getColor(name) {
            var color = '';
            this.collectionstatus.forEach(item=> {
                if(item.name == name) {
            this.achievements.forEach(item=> {
                if(item.code == name) {
                    color = item.color;
                }
            })
@@ -90,7 +90,7 @@
                            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;
@@ -109,7 +109,6 @@
            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>
src/views/mdc/realtime-status/index.vue
@@ -37,16 +37,16 @@
                  <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>
@@ -92,6 +92,7 @@
        },
        data() {
            return {
                statusStyle: "#ccc",
                titleMap: "",
                visible: false,
                visibleList: [],
@@ -149,7 +150,7 @@
                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)";
@@ -195,12 +196,14 @@
                        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;
                                        }
                                    })
                                })
src/views/mdc/station-live.vue
@@ -116,6 +116,7 @@
    <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 {
@@ -233,7 +234,7 @@
                    },
                    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',
@@ -364,6 +365,24 @@
                            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);
                    }
                })
@@ -458,7 +477,6 @@
                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)
                    }
                })
            },
src/views/mdc/status-record.vue
@@ -72,7 +72,7 @@
                                </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>
@@ -166,12 +166,19 @@
    },
    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(){
@@ -206,12 +213,19 @@
        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() { //班次状态记录采集状态
@@ -272,7 +286,8 @@
                    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;
            }