gaoshp
2024-06-17 cbc3dfa01846e836a18face51e329fa600f5e3d0
update
已修改4个文件
100 ■■■■ 文件已修改
src/views/mdc/components/Shift.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/components/Time.vue 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/efficiency-analysis.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/output-statistics.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/components/Shift.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-04-18 21:52:18
 * @LastEditors: Sneed
 * @LastEditTime: 2024-06-16 14:58:00
 * @LastEditTime: 2024-06-17 21:55:33
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/components/Shift.vue
-->
<template>
@@ -32,7 +32,7 @@
                </el-table-column>
                <el-table-column prop="" :label="colname">
                    <template #default="scope">
                        <span>{{ (scope.row.data['1'] ? scope.row.data['1'] * 100 : 0).toFixed(2) }}%</span>
                        <span>{{ colnameFn(scope.row.data['1']) }}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="" label="班次2">
@@ -42,7 +42,7 @@
                </el-table-column>
                <el-table-column prop="" :label="colname">
                    <template #default="scope">
                        <span>{{ scope.row.data['2'] }}</span>
                        <span>{{ colnameFn(scope.row.data['2']) }}</span>
                    </template>
                </el-table-column>
            </scTable>
@@ -62,6 +62,13 @@
            default: '',
            type: String,
        },
        colnameFn: {
            type: Function,
            default: val => {
                if (isNaN(val)) return '-'
                return `${(val ? val * 100 : 0).toFixed(2)}%`
            }
        },
        options: {
            default() {
                return {}
src/views/mdc/components/Time.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-04-18 21:52:18
 * @LastEditors: Sneed
 * @LastEditTime: 2024-04-27 23:30:06
 * @LastEditTime: 2024-06-17 22:02:38
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/components/Time.vue
-->
<template>
@@ -26,9 +26,9 @@
            <scTable ref="table" row-key="id" border :params="params" :apiObj="apiObj" stripe>
                <el-table-column prop="workstationCode" label="工位编码" />
                <el-table-column prop="workstationName" label="工位名称" />
                <el-table-column prop="" :label="item" v-for="item in cols">
                <el-table-column prop="" :label="item" v-for="item in cols" :key="item">
                    <template #default="scope">
                        <span>{{ scope.row.data[item] }}</span>
                        <span>{{ colnameFn(scope.row.data[item]) }}</span>
                    </template>
                </el-table-column>
@@ -44,6 +44,25 @@
        url: {
            default: '/api/blade-mdc/efficiency-analysis',
            type: String,
        },
        options: {
            default() {
                return {}
            },
        },
        colnameFn: {
            type: Function,
            default: val => {
                if (isNaN(val)) return '-'
                return `${(val ? val * 100 : 0).toFixed(2)}%`
            }
        },
        resFn: {
            type: Function,
            default: val => {
                if (isNaN(val)) return 0
                return (val - 0) * 100
            }
        }
    },
    components: {
@@ -157,7 +176,8 @@
                    dataset: {
                        source: []
                    },
                    series: []
                    series: [],
                    ...this.options
                }
                let source1 = ['product']
                let row = res.data.items.records[0]
@@ -171,7 +191,8 @@
                res.data.items.records.forEach(v => {
                    let current = [v.id]
                    Object.keys(v.nameData).forEach(key => {
                        current.push((v.data[key] - 0) * 100)
                        current.push(this.resFn(v.data[key]))
                        // current.push((v.data[key] - 0) * 100)
                    })
                    option2.dataset.source.push(current)
                });
src/views/mdc/efficiency-analysis.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-04-09 22:11:21
 * @LastEditors: Sneed
 * @LastEditTime: 2024-06-16 15:06:31
 * @LastEditTime: 2024-06-17 21:53:34
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/efficiency-analysis.vue
 * 效率分析
-->
@@ -44,7 +44,7 @@
                                <Shift :options="chartOption" colname="效率" ref="shift" v-if="activeName == 'shift'" />
                            </el-tab-pane>
                            <el-tab-pane label="按时间周期统计" name="time">
                                <Time ref="time" v-if="activeName == 'time'" />
                                <Time :options="chartOption1" ref="time" v-if="activeName == 'time'" />
                            </el-tab-pane>
                        </el-tabs>
                    </el-main>
@@ -80,6 +80,45 @@
            productivityType: 'OEE',
            time: [],
            treeChecked: [],
            chartOption1: {
                title: {
                    text: '统计图表',
                    subtext: '',
                },
                grid: {
                    top: '80px'
                },
                tooltip: {
                    trigger: 'axis'
                },
                tooltip: {
                    trigger: 'axis',
                    valueFormatter: (params) => {
                        return params.toFixed(2) + '%'
                    }
                },
                xAxis: {
                    type: 'category',
                    axisLabel: {
                        interval: 'auto',
                    }
                },
                yAxis: {
                    type: 'value',
                    axisLabel: {
                        formatter: (value) => {
                            return value + '%'
                        }
                    },
                },
                dataZoom: [
                    { type: 'slider' }
                ],
                dataset: {
                    source: []
                },
                series: []
            },
            chartOption: {
                legend: {
                    type: 'plain',
src/views/mdc/output-statistics.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-04-09 22:11:21
 * @LastEditors: Sneed
 * @LastEditTime: 2024-06-04 21:23:21
 * @LastEditTime: 2024-06-17 22:01:34
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/output-statistics.vue
 * 效率分析
-->
@@ -34,12 +34,14 @@
                    <el-main>
                        <el-tabs tab-position="top" v-model="activeName" type="card">
                            <el-tab-pane label="按班次统计" name="shift">
                                <Shift :options="chartOption" :datasetNum="1" colname="产量" url="/api/blade-mdc/output"
                                    ref="shift" v-if="activeName == 'shift'">
                                <Shift :options="chartOption" :datasetNum="1" colname="产量"
                                    :colnameFn="val => { return val }" url="/api/blade-mdc/output" ref="shift"
                                    v-if="activeName == 'shift'">
                                </Shift>
                            </el-tab-pane>
                            <el-tab-pane label="按时间周期统计" name="time">
                                <Time url="/api/blade-mdc/output" ref="time" v-if="activeName == 'time'">
                                <Time :resFn="val => val" :options="chartOption1" :colnameFn="val => { return val }"
                                    url="/api/blade-mdc/output" ref="time" v-if="activeName == 'time'">
                                </Time>
                            </el-tab-pane>
@@ -76,6 +78,9 @@
            activeName: 'shift',
            time: [],
            treeChecked: [],
            chartOption1: {
            },
            chartOption: {
                legend: {
                    type: 'plain',