From d882e6774b7d96df39d6a6683d9e305da2d34c7c Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期一, 20 五月 2024 21:16:51 +0800
Subject: [PATCH] update

---
 src/views/mdc/components/Shift.vue    |   47 ++-------------
 src/views/mdc/processParam/index.vue  |    9 ++-
 src/views/mdc/output-statistics.vue   |   44 ++++++++++++++
 src/views/mdc/efficiency-analysis.vue |   44 ++++++++++++++
 4 files changed, 97 insertions(+), 47 deletions(-)

diff --git a/src/views/mdc/components/Shift.vue b/src/views/mdc/components/Shift.vue
index 2bab6cf..326fbaf 100644
--- a/src/views/mdc/components/Shift.vue
+++ b/src/views/mdc/components/Shift.vue
@@ -1,7 +1,7 @@
 <!--
  * @Date: 2024-04-18 21:52:18
  * @LastEditors: Sneed
- * @LastEditTime: 2024-04-27 23:31:53
+ * @LastEditTime: 2024-05-20 21:05:43
  * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/components/Shift.vue
 -->
 <template>
@@ -61,6 +61,11 @@
         colname: {
             default: '',
             type: String,
+        },
+        options: {
+            default() {
+                return {}
+            },
         }
     },
     components: {
@@ -134,45 +139,7 @@
             return this.$HTTP.post(this.url, dataSend, { params }).then(res => {
                 this.chartsData = res.data.items.records
                 let option2 = {
-                    legend: {
-                        type: 'plain',
-                    },
-                    title: {
-                        text: '缁熻鍥捐〃',
-                        subtext: '',
-                    },
-                    grid: {
-                        top: '80px'
-                    },
-                    tooltip: {
-                        trigger: 'axis'
-                    },
-                    xAxis: {
-                        type: 'category',
-                    },
-                    yAxis: {
-                        type: 'value',
-                        axisLabel: {
-                            formatter: (value) => {
-                                return value + '%'
-                            }
-                        },
-                    },
-                    dataZoom: [
-                        { type: 'slider' }
-                    ],
-                    dataset: {
-                        source: [
-                            ['product', '鐝1', '鐝2'],
-
-                        ]
-                    },
-                    series: [{
-                        type: 'bar',
-                    },
-                    {
-                        type: 'bar',
-                    }]
+                    ...this.options
                 }
                 option2.dataset.source = [['product', '鐝1', '鐝2']]
                 res.data.items.records.forEach(v => {
diff --git a/src/views/mdc/efficiency-analysis.vue b/src/views/mdc/efficiency-analysis.vue
index f42fd8b..3e23ecc 100644
--- a/src/views/mdc/efficiency-analysis.vue
+++ b/src/views/mdc/efficiency-analysis.vue
@@ -1,7 +1,7 @@
 <!--
  * @Date: 2024-04-09 22:11:21
  * @LastEditors: Sneed
- * @LastEditTime: 2024-04-20 21:04:13
+ * @LastEditTime: 2024-05-20 21:04:56
  * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/efficiency-analysis.vue
  * 鏁堢巼鍒嗘瀽
 -->
@@ -41,7 +41,7 @@
                     <el-main>
                         <el-tabs tab-position="top" v-model="activeName" type="card">
                             <el-tab-pane label="鎸夌彮娆$粺璁�" name="shift">
-                                <Shift colname="鏁堢巼" ref="shift" v-if="activeName == 'shift'" />
+                                <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'" />
@@ -80,6 +80,46 @@
             productivityType: 'OEE',
             time: [],
             treeChecked: [],
+            chartOption: {
+                legend: {
+                    type: 'plain',
+                },
+                title: {
+                    text: '缁熻鍥捐〃',
+                    subtext: '',
+                },
+                grid: {
+                    top: '80px'
+                },
+                tooltip: {
+                    trigger: 'axis'
+                },
+                xAxis: {
+                    type: 'category',
+                },
+                yAxis: {
+                    type: 'value',
+                    axisLabel: {
+                        formatter: (value) => {
+                            return value + '%'
+                        }
+                    },
+                },
+                dataZoom: [
+                    { type: 'slider' }
+                ],
+                dataset: {
+                    source: [
+                        ['product', '鐝1', '鐝2'],
+                    ]
+                },
+                series: [{
+                    type: 'bar',
+                },
+                {
+                    type: 'bar',
+                }]
+            },
             options: [
                 {
                     label: '绋煎姩鐜�',
diff --git a/src/views/mdc/output-statistics.vue b/src/views/mdc/output-statistics.vue
index 88961fa..c171885 100644
--- a/src/views/mdc/output-statistics.vue
+++ b/src/views/mdc/output-statistics.vue
@@ -1,7 +1,7 @@
 <!--
  * @Date: 2024-04-09 22:11:21
  * @LastEditors: Sneed
- * @LastEditTime: 2024-04-20 21:04:01
+ * @LastEditTime: 2024-05-20 21:04:40
  * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/output-statistics.vue
  * 鏁堢巼鍒嗘瀽
 -->
@@ -34,7 +34,7 @@
                     <el-main>
                         <el-tabs tab-position="top" v-model="activeName" type="card">
                             <el-tab-pane label="鎸夌彮娆$粺璁�" name="shift">
-                                <Shift colname="浜ч噺" url="/api/blade-mdc/output" ref="shift"
+                                <Shift :options="chartOption" colname="浜ч噺" url="/api/blade-mdc/output" ref="shift"
                                     v-if="activeName == 'shift'">
                                 </Shift>
                             </el-tab-pane>
@@ -76,6 +76,46 @@
             activeName: 'shift',
             time: [],
             treeChecked: [],
+            chartOption: {
+                legend: {
+                    type: 'plain',
+                },
+                title: {
+                    text: '缁熻鍥捐〃',
+                    subtext: '',
+                },
+                grid: {
+                    top: '80px'
+                },
+                tooltip: {
+                    trigger: 'axis'
+                },
+                xAxis: {
+                    type: 'category',
+                },
+                yAxis: {
+                    type: 'value',
+                    axisLabel: {
+                        formatter: (value) => {
+                            return value
+                        }
+                    },
+                },
+                dataZoom: [
+                    { type: 'slider' }
+                ],
+                dataset: {
+                    source: [
+                        ['product', '鐝1', '鐝2'],
+                    ]
+                },
+                series: [{
+                    type: 'bar',
+                },
+                {
+                    type: 'bar',
+                }]
+            },
             options: [
                 {
                     label: '绋煎姩鐜�',
diff --git a/src/views/mdc/processParam/index.vue b/src/views/mdc/processParam/index.vue
index 912adf6..476f28c 100644
--- a/src/views/mdc/processParam/index.vue
+++ b/src/views/mdc/processParam/index.vue
@@ -76,7 +76,7 @@
                                 <!-- <el-switch v-model="isShowTable" class="mb-2" active-text="鏁版嵁琛�" inactive-text="缁熻鍥�" /> -->
                             </el-col>
                             <el-col :span="20" style='text-align: right;'>
-                                <el-date-picker :max-range="3" :clearable="false" value-format="YYYY-MM-DD"
+                                <el-date-picker :max-range="3" :clearable="true" value-format="YYYY-MM-DD"
                                     style="width: 250px" v-model="time" type="daterange" range-separator="-"
                                     start-placeholder="" end-placeholder="" :disabled-date="disabledDate"
                                     @calendar-change="change" />
@@ -133,7 +133,8 @@
         treeChecked() {
             this.query()
         },
-        time() {
+        time(val) {
+            if (!val?.[0]) return
             this.query()
         },
         timeRange(val) {
@@ -153,9 +154,11 @@
             activeList: [0, 1, 2, 3, 4, 5, 6, 7, 8],
             timeRange: '',
             treeChecked: [],
-            timeStart: moment().format('YYYY-MM-DD'),
+            timeStart: '',
             time: [moment().format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')],
             disabledDate: Date => {
+                if (!this.timeStart) return false
+                console.log(this.timeStart, '????????')
                 let max = moment(this.timeStart, 'YYYY-MM-DD').add(3, 'd').format('YYYY-MM-DD')
                 let min = moment(this.timeStart, 'YYYY-MM-DD').subtract(3, 'd').format('YYYY-MM-DD')
                 return !moment(Date).isBetween(min, max);

--
Gitblit v1.9.3