From 34d5375897180160d49bdac6cec6746d8ed0cc3c Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期三, 19 六月 2024 10:12:42 +0800
Subject: [PATCH] Merge branch 'master' of http://www.beijingsoft.cn:9090/r/smart-web

---
 src/views/mdc/configComp/Status.vue     |   17 +++
 src/views/mdc/processParam/index.vue    |   86 +++++++++++++--------
 src/views/mdc/components/Time.vue       |   62 ++++++++++-----
 src/views/mdc/processParam/TimeLine.vue |    4 
 src/views/dnc/document/index.vue        |   12 +-
 5 files changed, 117 insertions(+), 64 deletions(-)

diff --git a/src/views/dnc/document/index.vue b/src/views/dnc/document/index.vue
index 5db565f..a88a9d7 100644
--- a/src/views/dnc/document/index.vue
+++ b/src/views/dnc/document/index.vue
@@ -1,7 +1,7 @@
 <!--
  * @Date: 2024-05-16 22:40:01
  * @LastEditors: Sneed
- * @LastEditTime: 2024-06-17 23:43:44
+ * @LastEditTime: 2024-06-18 21:51:57
  * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/dnc/document/index.vue
 -->
 <template>
@@ -111,7 +111,7 @@
                                 <template #default="scope">
                                     <el-button-group>
                                         <el-button text type="primary" size="small"
-                                            @click="table_edit(scope.row, scope.$index)">缂栬緫</el-button>
+                                            @click="table_edit(scope.row, scope.$index)">閲嶅懡鍚�</el-button>
                                         <el-popconfirm width="220" title="纭畾灏嗛�夋嫨鐨勬暟鎹垹闄�" @confirm="del([scope.row], '0')">
                                             <template #reference>
                                                 <el-button text type="primary" size="small">鍒犻櫎</el-button>
@@ -127,7 +127,7 @@
                 </el-container>
             </el-container>
         </el-card>
-        <el-dialog v-model="visible" title="鏂板缓鏂囦欢澶�" width="500">
+        <el-dialog v-model="visible" :title="form.id ? '閲嶅懡鍚�' : '鏂板缓鏂囦欢澶�'" width="500">
             <el-form :model="form" :rules="rules" ref="dialogForm" label-width="120px" label-position="center">
                 <el-form-item v-if="form.fileType == 1 || !form.id" label="鏂囦欢澶瑰悕绉�" prop="name">
                     <el-input v-model="form.name" />
@@ -160,7 +160,7 @@
                 </div>
             </template>
         </el-dialog>
-        <scDialog v-model="visible">
+        <scDialog v-model="visible1">
             <scForm ref="form" :config="config" :rules="rules1" v-model="form1" @submit="submit1">
             </scForm>
         </scDialog>
@@ -208,7 +208,7 @@
             },
             treeData: [],
             selectNode: {},
-            visible: false,
+            visible1: false,
             form: {},
             rules: {
                 name: [{
@@ -283,7 +283,7 @@
         addFile() {
             this.form1 = {}
             this.$refs?.form?.resetFields()
-            this.visible = true
+            this.visible1 = true
         },
         submit1() {
             // 鍒涘缓鏂囨湰鍐呭
diff --git a/src/views/mdc/components/Time.vue b/src/views/mdc/components/Time.vue
index 5bb8fcd..cd12ccb 100644
--- a/src/views/mdc/components/Time.vue
+++ b/src/views/mdc/components/Time.vue
@@ -1,16 +1,15 @@
 <!--
  * @Date: 2024-04-18 21:52:18
  * @LastEditors: Sneed
- * @LastEditTime: 2024-06-17 23:37:51
+ * @LastEditTime: 2024-06-18 20:09:02
  * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/components/Time.vue
 -->
 <template>
     <el-row>
         <el-col>
             <el-button-group>
-                <el-button size="small" @click="statisticalMethod = item.value"
-                    :type="statisticalMethod == item.value ? 'primary' : ''" v-for="item in btnList"
-                    :key="item.value">{{
+                <el-button size="small" @click="change(item)" :type="statisticalMethod == item.value ? 'primary' : ''"
+                    v-for="item in btnList" :key="item.value">{{
                         item.label }}</el-button>
             </el-button-group>
         </el-col>
@@ -39,6 +38,7 @@
 
 <script>
 import scEcharts from '@/components/scEcharts';
+import moment from 'moment'
 export default {
     props: {
         url: {
@@ -90,19 +90,26 @@
             cols: [],
             chartsData: [],
             option2: {},
+            btnListNew: []
         }
     },
     watch: {
         statisticalMethod(val) {
-            this.query({
-                ...this.params,
-            })
-            this.queryChart({
-                ...this.params,
-            })
+            // this.query({
+            //     ...this.params,
+            // })
+            // this.queryChart({
+            //     ...this.params,
+            // })
         }
     },
     methods: {
+        change(item) {
+            this.statisticalMethod = item.value
+            this.init({
+                ...this.params
+            })
+        },
         init(params) {
             this.params = params
             this.getTime({
@@ -110,9 +117,22 @@
                 startDate: params.startDate,
                 statisticalMethod: this.statisticalMethod
             }).then(res => {
-                this.query({
+                let startDate = Math.min(...res.data.map(v => new Date(v.startDate).getTime()))
+                let endDate = Math.max(...res.data.map(v => new Date(v.startDate).getTime()))
+                let data = {
                     ...params,
                     statisticalMethod: this.statisticalMethod
+                }
+                if (this.statisticalMethod !== 'Day') {
+                    data = {
+                        ...data,
+                        endDate: moment(endDate).format('YYYY-MM-DD'),
+                        statisticalMethod: this.statisticalMethod
+                    }
+                }
+                console.log(startDate, endDate)
+                this.query({
+                    ...data
                 })
                 this.queryChart({
                     ...params,
@@ -122,14 +142,15 @@
 
         },
         getTime(data) {
-            return Promise.resolve()
-            // return this.$HTTP.post('/api/blade-mdc/efficiency-analysis/interval', {
-            //     ...data
-            // }).then(res => {
-            //     if (res.code === 200) {
-            //         this.btnList = res.data
-            //     }
-            // })
+            //return Promise.resolve()
+            return this.$HTTP.post('/api/blade-mdc/efficiency-analysis/interval', {
+                ...data
+            }).then(res => {
+                if (res.code === 200) {
+                    this.btnListNew = res.data
+                    return res
+                }
+            })
         },
         queryChart(data) {
             let params = {
@@ -201,8 +222,7 @@
                 console.log(option2)
             })
         },
-        query(params) {
-            this.params = params
+        query() {
             this.apiObj = {
                 get: async (data) => {
                     let params = {
diff --git a/src/views/mdc/configComp/Status.vue b/src/views/mdc/configComp/Status.vue
index 447b169..1dce398 100644
--- a/src/views/mdc/configComp/Status.vue
+++ b/src/views/mdc/configComp/Status.vue
@@ -1,14 +1,14 @@
 <!--
  * @Date: 2024-04-17 18:53:45
  * @LastEditors: Sneed
- * @LastEditTime: 2024-06-17 22:12:42
+ * @LastEditTime: 2024-06-18 20:17:23
  * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/configComp/Status.vue
 -->
 <template>
     <el-main>
         <el-row>
             <!-- dragSort -->
-            <scFormTable ref="table" size="small" v-model="data" stripe hideAdd hideDelete @rowDrop="save">
+            <scFormTable ref="table" size="small" v-model="data" stripe hideAdd hideDelete dragSort @rowDrop="rowDrop">
                 <el-table-column label="宸ヤ綅/鏈哄櫒鐘舵��" prop="name"></el-table-column>
                 <el-table-column label="缂栧彿" prop="code"></el-table-column>
                 <el-table-column label="棰滆壊" prop="color"></el-table-column>
@@ -37,7 +37,8 @@
         </el-row>
         <el-row style="margin-top: 20px;">
             <!-- dragSort -->
-            <scFormTable ref="table1" v-model="Tabledata" stripe @delRow="remove" :addTemplate="addTemplate">
+            <scFormTable ref="table1" v-model="Tabledata" stripe @delRow="remove" :addTemplate="addTemplate"
+                @rowDrop="rowDrop" dragSort>
                 <el-table-column label="浜哄伐鍙嶉鐘舵��" prop="name">
                     <template #default="scope">
                         <el-input v-model="scope.row.name" @change="update(scope.row)"></el-input>
@@ -234,6 +235,16 @@
                     this.getList()
                 }
             })
+        },
+        rowDrop(arr) {
+            this.$HTTP.post(`/api/blade-cps/global_wcs/update-wcs-seq`, arr.map(v => v.code)).then(res => {
+                if (res.success) {
+                    this.$message.success(res.msg)
+                } else {
+                    this.$message.success(res.msg)
+                }
+            })
+            console.log(arr)
         }
     }
 }
diff --git a/src/views/mdc/processParam/TimeLine.vue b/src/views/mdc/processParam/TimeLine.vue
index 9cbf4c6..71dd49b 100644
--- a/src/views/mdc/processParam/TimeLine.vue
+++ b/src/views/mdc/processParam/TimeLine.vue
@@ -1,7 +1,7 @@
 <!--
  * @Date: 2024-04-23 20:03:41
  * @LastEditors: Sneed
- * @LastEditTime: 2024-04-24 20:48:55
+ * @LastEditTime: 2024-06-18 23:16:52
  * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/processParam/TimeLine.vue
 -->
 <template>
@@ -39,7 +39,7 @@
 export default {
     data() {
         return {
-            step: 1,
+            step: 2,
             params: {},
             dateList: [],
             lines: [],
diff --git a/src/views/mdc/processParam/index.vue b/src/views/mdc/processParam/index.vue
index 764c3b7..1053491 100644
--- a/src/views/mdc/processParam/index.vue
+++ b/src/views/mdc/processParam/index.vue
@@ -198,14 +198,20 @@
             }).then(res => {
                 if (res.code === 200) {
                     if (item.name !== 'DeviceStatus') {
-                        this.tableData = res.data.records
+                        this.tableData = res.data.records.map(v => {
+                            return {
+                                ...v,
+                            }
+                        })
+                    } else {
+                        this.tableData = res.data.records.map(item => {
+                            return {
+                                ...item,
+                                value: this.legend.find(v => v.code === item.value)?.name
+                            }
+                        })
                     }
-                    this.tableData = res.data.records.map(item => {
-                        return {
-                            ...item,
-                            value: this.legend.find(v => v.code === item.value)?.name
-                        }
-                    })
+
                     this.drawer = true
                 }
             })
@@ -258,7 +264,7 @@
         },
         setLineOptions(data, myname) {
             if (!data) return
-            console.log(data, myname)
+            // console.log(data, myname)
             let xAxis = data?.map(item => {
                 return item.time
             })
@@ -269,8 +275,7 @@
                 tooltip: {
                     position: ['50%', '50%']
                 },
-                legend: [
-                ],
+                legend: {},
                 title: {
                     text: '',
                     subtext: '',
@@ -297,7 +302,6 @@
                     dayCharts: {}
                 })
             } else {
-                console.log(myname, '>>>>>>???????????>>>>>>', yAxisData)
                 let index = this.list.findIndex(item => item.name === myname)
                 this.list[index] = Object.assign({
                     ...this.list[index],
@@ -331,34 +335,51 @@
                     stack: 'total',
                     barWidth: '20px',
                     data: [current / total],
-                    label: {
+                    // label: {
+                    //     show: true,
+                    //     position: 'insideLeft',
+                    //     color: '#FFF',
+                    //     formatter: params => {
+                    //         if (i == 0 || current === 0) return ''
+                    //         return `${name}:寮�濮嬫椂闂�${moment(data.data[i - 1].time).format('HH:mm')}-${moment(item.time).format('HH:mm')}`
+                    //     }
+                    // },
+                    // itemStyle: {
+                    //     // color, // 杩欎竴琛屽浐瀹氱殑棰滆壊鍊奸渶瑕佸垹闄ゆ垨娉ㄩ噴
+                    //     borderColor: '#FFF',
+                    //     borderWidth: 1
+                    // },
+                    tooltip: {
                         show: true,
-                        position: 'insideLeft',
-                        color: '#FFF',
-                        formatter: params => {
+                        trigger: 'item',
+                        position: 'top',
+                        triggerOn: 'click',
+                        formatter: (value, ticket) => {
+                            // console.log('----------1111')
+                            // let add = Math.abs(moment(this.timeRange.startTime).diff(moment(this.timeRange.endTime))) * value
+                            // let current = moment(this.timeRange.startTime).add(add, 'ms')
+                            // console.log('--11111111------------', current)
+                            // return current.format('HH:mm')
+                            // return value
                             if (i == 0 || current === 0) return ''
-                            return `${name}:寮�濮嬫椂闂�${moment(data.data[i - 1].time).format('HH:mm')}-${moment(item.time).format('HH:mm')}`
+                            return `${name}:鏃舵${moment(data.data[i - 1].time).format('HH:mm')}-${moment(item.time).format('HH:mm')}`
                         }
-                    },
-                    itemStyle: {
-                        // color, // 杩欎竴琛屽浐瀹氱殑棰滆壊鍊奸渶瑕佸垹闄ゆ垨娉ㄩ噴
-                        borderColor: '#FFF',
-                        borderWidth: 1
                     },
                 }
             })
             let dayCharts = {
-                // tooltip: {
-                //     position: ['50%', '50%'],
-                //     formatter: (value, ticket) => {
-                //         console.log('>>>>>>>>>>>>____________', value, ticket)
-                //         let add = Math.abs(moment(this.timeRange.startTime).diff(moment(this.timeRange.endTime))) * value
-                //         let current = moment(this.timeRange.startTime).add(add, 'ms')
-                //         return current.format('HH:mm')
-                //     }
-                // },
-                legend: [
-                ],
+                tooltip: {
+                    position: ['50%', '50%'],
+                    // formatter: (value, ticket) => {
+                    //     // console.log('>>>>>>>>>>>>____________', value, ticket)
+                    //     let add = Math.abs(moment(this.timeRange.startTime).diff(moment(this.timeRange.endTime))) * value
+                    //     let current = moment(this.timeRange.startTime).add(add, 'ms')
+                    //     return current.format('HH:mm')
+                    // }
+                },
+                legend: {
+                    selectedMode: false
+                },
                 title: {
                     text: '',
                     subtext: '',
@@ -380,6 +401,7 @@
                     },
                 },
             }
+            console.log(dayCharts, '>>>>>>>???')
             let index = this.list.findIndex(item => item.name === myname)
             this.list[index] = Object.assign({
                 ...this.list[index],

--
Gitblit v1.9.3