gaoshp
2024-06-18 e1725ad8bfa9167d20184f6c166fbd459cfcc1fb
update
已修改2个文件
79 ■■■■■ 文件已修改
src/views/mdc/components/Time.vue 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/configComp/Status.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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 = {
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)
        }
    }
}