From 71f58f33a8bd79e66d5cc70e62c1a7daa2861e30 Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期四, 18 四月 2024 23:47:18 +0800
Subject: [PATCH] update
---
src/views/mdc/components/Shift.vue | 168 +++++++++++++++++++++++++++++++++
src/views/mdc/components/Time.vue | 19 +++
package.json | 1
src/views/mdc/efficiency-analysis.vue | 68 ++++++++-----
4 files changed, 230 insertions(+), 26 deletions(-)
diff --git a/package.json b/package.json
index ad9998c..761103b 100644
--- a/package.json
+++ b/package.json
@@ -20,6 +20,7 @@
"deepmerge": "^1.5.2",
"echarts": "5.4.1",
"element-plus": "2.2.32",
+ "moment": "^2.30.1",
"nprogress": "0.2.0",
"qrcodejs2": "0.0.2",
"qs": "6.7.0",
diff --git a/src/views/mdc/components/Shift.vue b/src/views/mdc/components/Shift.vue
new file mode 100644
index 0000000..0570c69
--- /dev/null
+++ b/src/views/mdc/components/Shift.vue
@@ -0,0 +1,168 @@
+<!--
+ * @Date: 2024-04-18 21:52:18
+ * @LastEditors: Sneed
+ * @LastEditTime: 2024-04-18 23:43:13
+ * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/components/Shift.vue
+-->
+<template>
+ <el-row>
+ <el-col>
+ <el-button-group>
+ <el-button :type="btnListActive == item.id ? 'primary' : ''" v-for="item in btnList" :key="item.id">{{
+ item.title }}</el-button>
+ </el-button-group>
+ </el-col>
+ <el-col>
+ <el-card shadow="never">
+ <scEcharts height="300px" :option="option2"></scEcharts>
+ </el-card>
+ </el-col>
+ <el-col>
+ 缁熻鏁版嵁
+ </el-col>
+ <el-col>
+ <scTable ref="table" row-key="id" border :params="params" :apiObj="apiObj" stripe>
+ <el-table-column prop="workstationCode" label="宸ヤ綅缂栫爜" />
+ <el-table-column prop="workstationName" label="宸ヤ綅鍚嶇О" />
+ <el-table-column prop="" label="鐝1">
+ <template #default="scope">
+ <span>{{ scope.row.nameData['1'] }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column prop="" label="鏁堢巼">
+ <template #default="scope">
+ <span>{{ scope.row.data['1'] }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column prop="" label="鐝2">
+ <template #default="scope">
+ <span>{{ scope.row.nameData['2'] }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column prop="" label="鏁堢巼">
+ <template #default="scope">
+ <span>{{ scope.row.data['2'] }}</span>
+ </template>
+ </el-table-column>
+ </scTable>
+ </el-col>
+ </el-row>
+</template>
+
+<script>
+import scEcharts from '@/components/scEcharts';
+export default {
+ components: {
+ scEcharts
+ },
+ data() {
+ return {
+ apiObj: '',
+ params: {},
+ statisticalMethod: 'SHIFT',
+ btnList: [],
+ btnListActive: '',
+ chartsData: [],
+ option2: {
+ title: {
+ text: '缁熻鍥捐〃',
+ subtext: '鍩虹鎶樼嚎鍥�',
+ },
+ grid: {
+ top: '80px'
+ },
+ tooltip: {
+ trigger: 'axis'
+ },
+ xAxis: {
+ type: 'category',
+ data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
+ },
+ yAxis: {
+ type: 'value'
+ },
+ series: [{
+ data: [120, 200, 150, 80, 70, 110, 130],
+ type: 'line',
+ },
+ {
+ data: [110, 180, 120, 120, 60, 90, 110],
+ type: 'line',
+ }]
+ },
+ }
+ },
+ methods: {
+ init(params) {
+ this.getTime({
+ endDate: params.endDate,
+ startDate: params.startDate,
+ statisticalMethod: this.statisticalMethod
+ }).then(res => {
+ this.query({
+ ...params,
+ startDate: this.btnListActive,
+ endDate: this.btnListActive
+ })
+ this.queryChart({
+ ...params,
+ startDate: this.btnListActive,
+ endDate: this.btnListActive
+ })
+ })
+
+ },
+ getTime(data) {
+ return this.$HTTP.post('/api/blade-mdc/efficiency-analysis/interval', {
+ ...data
+ }).then(res => {
+ if (res.code === 200) {
+ this.btnList = res.data
+ this.btnListActive = res?.data?.[0]?.id
+ }
+ })
+ },
+ queryChart(data) {
+ let params = {
+ size: -1
+ }
+ let dataSend = {
+ ...data,
+ queryType: 0,
+ statisticalMethod: this.statisticalMethod
+ }
+ return this.$HTTP.post('/api/blade-mdc/efficiency-analysis', dataSend, { params }).then(res => {
+ this.chartsData = res.data.items.records
+ })
+ },
+ query(params) {
+ this.params = params
+ this.apiObj = {
+ get: async (data) => {
+ let params = {
+ current: data.current,
+ size: data.size
+ }
+ let dataSend = {
+ ...data,
+ queryType: 1,
+ statisticalMethod: this.statisticalMethod
+ }
+ delete dataSend.current
+ delete dataSend.size
+ delete dataSend.order
+ delete dataSend.prop
+ return await this.$HTTP.post('/api/blade-mdc/efficiency-analysis', dataSend, { params }).then(res => {
+ return {
+ ...res,
+ data: res.data.items
+ }
+ })
+ }
+ }
+ }
+ }
+}
+</script>
+
+<style lang="scss" scoped></style>
\ No newline at end of file
diff --git a/src/views/mdc/components/Time.vue b/src/views/mdc/components/Time.vue
new file mode 100644
index 0000000..6578296
--- /dev/null
+++ b/src/views/mdc/components/Time.vue
@@ -0,0 +1,19 @@
+<!--
+ * @Date: 2024-04-18 21:52:28
+ * @LastEditors: Sneed
+ * @LastEditTime: 2024-04-18 21:54:53
+ * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/components/Time.vue
+-->
+<template>
+ <div>
+
+ </div>
+</template>
+
+<script>
+export default {
+
+}
+</script>
+
+<style lang="scss" scoped></style>
\ No newline at end of file
diff --git a/src/views/mdc/efficiency-analysis.vue b/src/views/mdc/efficiency-analysis.vue
index 2776c22..a8ebf55 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-18 21:48:13
+ * @LastEditTime: 2024-04-18 22:47:36
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/efficiency-analysis.vue
* 鏁堢巼鍒嗘瀽
-->
@@ -22,8 +22,8 @@
</el-col>
<el-col style="margin-top: 14px;">鏃ユ湡</el-col>
<el-col>
- <el-date-picker style="width: 250px" v-model="time" type="daterange"
- range-separator="-" start-placeholder="" end-placeholder="" />
+ <el-date-picker value-format="YYYY-MM-DD" style="width: 250px" v-model="time"
+ type="daterange" range-separator="-" start-placeholder="" end-placeholder="" />
</el-col>
</el-row>
<el-row style="margin-top: 14px;">
@@ -32,20 +32,22 @@
<MYTree v-model="treeChecked" show-checkbox></MYTree>
</el-main>
<el-footer>
- <el-button>鏌ヨ</el-button>
+ <el-button @click="query">鏌ヨ</el-button>
<el-button>瀵煎嚭</el-button>
</el-footer>
</el-container>
</el-aside>
<el-container>
- <el-tabs tab-position="top" v-model="activeName">
- <el-tab-pane label="鎸夌彮娆$粺璁�" name="ban">
-
- </el-tab-pane>
- <el-tab-pane label="鎸夋椂闂村懆鏈熺粺璁�" name="time">
-
- </el-tab-pane>
- </el-tabs>
+ <el-main>
+ <el-tabs tab-position="top" v-model="activeName" type="card">
+ <el-tab-pane label="鎸夌彮娆$粺璁�" name="shift">
+ <Shift ref="shift" v-if="activeName == 'shift'" />
+ </el-tab-pane>
+ <el-tab-pane label="鎸夋椂闂村懆鏈熺粺璁�" name="time">
+ <Time ref="time" v-if="activeName == 'time'" />
+ </el-tab-pane>
+ </el-tabs>
+ </el-main>
</el-container>
</el-container>
</el-card>
@@ -53,21 +55,28 @@
</template>
<script>
+import moment from 'moment';
import MYTree from './MYTree.vue'
+import Shift from './components/Shift.vue'
+import Time from './components/Time.vue'
+
export default {
components: {
MYTree,
+ Shift,
+ Time
},
watch: {
treeChecked(value) {
- this.query(value)
+ // this.query(value)
}
},
data() {
return {
- activeName: '',
- productivityType: '',
+ activeName: 'shift',
+ productivityType: 'OEE',
time: [],
+ treeChecked: [],
options: [
{
label: '绋煎姩鐜�',
@@ -84,21 +93,28 @@
]
}
},
+ created() {
+ this.time = [moment().format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')]
+ },
+ mounted() {
+ this.query()
+ },
methods: {
- query(vals) {
- console.log([...vals])
- this.$HTTP.post('/api/blade-mdc/efficiency-analysis/interval', {
- endDate: this.time[0],
- startDate: this.time[1],
- statisticalMethod: 'SHIFT'
+ query() {
+ this.$refs[this.activeName].init({
+ endDate: this.time[1],
+ startDate: this.time[0],
+ productivityType: this.productivityType,
+ shiftIndexList: [1, 2],
+ workStationIdList: [...this.treeChecked]
})
- this.$HTTP.post('/api/blade-mdc/efficiency-analysis?size=-1', {
+ // this.$HTTP.post('/api/blade-mdc/efficiency-analysis?size=-1', {
- })
- this.$HTTP.post('/api/blade-mdc/efficiency-analysis?current=1&size=15', {
+ // })
+ // this.$HTTP.post('/api/blade-mdc/efficiency-analysis?current=1&size=15', {
- })
- this.$HTTP.post('/api/blade-cps/workstation-wcs-feedback/feedback-status', [...vals])
+ // })
+ // this.$HTTP.post('/api/blade-cps/workstation-wcs-feedback/feedback-status', [...vals])
}
}
}
--
Gitblit v1.9.3