From e1725ad8bfa9167d20184f6c166fbd459cfcc1fb Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期二, 18 六月 2024 20:19:11 +0800
Subject: [PATCH] update
---
src/views/mdc/configComp/Status.vue | 17 +++++++-
src/views/mdc/components/Time.vue | 62 ++++++++++++++++++++----------
2 files changed, 55 insertions(+), 24 deletions(-)
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)
}
}
}
--
Gitblit v1.9.3