From f28363d03c3539b0219c5b58ea8b7db37d50be6f Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期二, 23 四月 2024 22:34:17 +0800
Subject: [PATCH] 编辑时间轴组件

---
 src/views/mdc/processParam/index.vue |   75 +++++++++++++++++++++++++++++++++----
 1 files changed, 67 insertions(+), 8 deletions(-)

diff --git a/src/views/mdc/processParam/index.vue b/src/views/mdc/processParam/index.vue
index 832099e..53a28f8 100644
--- a/src/views/mdc/processParam/index.vue
+++ b/src/views/mdc/processParam/index.vue
@@ -1,24 +1,83 @@
 <!--
  * @Date: 2024-04-09 22:11:21
  * @LastEditors: Sneed
- * @LastEditTime: 2024-04-13 22:16:48
+ * @LastEditTime: 2024-04-23 21:40:53
  * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/processParam/index.vue
  瀹炴椂鐪嬫澘
 -->
 <template>
     <el-main>
         <el-card shadow="never">
-            鏁堢巼鍒嗘瀽
+            <el-container style="height: 100%;">
+                <el-aside width="300px" style="height: 100%;">
+                    <el-container>
+                        <el-main class="nopadding">
+                            <el-row style="margin-top: 14px;">
+                                宸ヤ綅
+                            </el-row>
+                            <MYTree v-model="treeChecked" @loaded="query"></MYTree>
+                        </el-main>
+                    </el-container>
+                </el-aside>
+                <el-container>
+                    <el-main>
+                        <el-row>
+                            <el-col style='text-align: right;'>
+                                <el-date-picker :max-range="3" :clearable="false" 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" />
+                            </el-col>
+                        </el-row>
+                        <TimeLine ref="timeLine"></TimeLine>
+                    </el-main>
+                </el-container>
+            </el-container>
         </el-card>
     </el-main>
 </template>
 
 <script>
-    export default {
-        
-    }
+import moment from 'moment'
+import TimeLine from './TimeLine.vue'
+import MYTree from '../MYTree.vue'
+export default {
+    components: {
+        TimeLine,
+        MYTree
+    },
+    watch: {
+        treeChecked() {
+            this.query()
+        },
+        time() {
+            this.query()
+        }
+    },
+    data() {
+        return {
+            treeChecked: [],
+            timeStart: moment().format('YYYY-MM-DD'),
+            time: [moment().format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')],
+            disabledDate: Date => {
+                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);
+            }
+        }
+    },
+    methods: {
+        query() {
+            this.$refs.timeLine.init({
+                dates: this.time,
+                workstationId: this.treeChecked.toString()
+            })
+        },
+        change(e) {
+            this.timeStart = e[0] || moment().format('YYYY-MM-DD')
+        }
+    },
+}
 </script>
 
-<style lang="scss" scoped>
-
-</style>
\ No newline at end of file
+<style lang="scss" scoped></style>
\ No newline at end of file

--
Gitblit v1.9.3