This commit is contained in:
lb
2023-11-27 11:31:21 +08:00
parent d5507ec4c0
commit 76c2f50bf3
10 changed files with 304 additions and 1124 deletions

View File

@@ -21,18 +21,15 @@ export default {
chart: null,
};
},
// watch: {
// list: {
// handler(listdata) {
// if (listdata && listdata.length) {
// console.log('[linechart] list changed', listdata);
// const option = this.handleList(listdata);
// this.setOption(option);
// }
// },
// immediate: true,
// },
// },
watch: {
list: {
handler(listdata) {
this.setOption();
},
immediate: true,
deep: true,
},
},
computed: {
option() {
const opt = [];
@@ -55,7 +52,7 @@ export default {
},
formatter: (params) => {
const name = params[0].name;
const goodRate = opt.find((item) => item[0] == name)[4];
const goodRate = opt.find((item) => item[0] == name)[4] || '0';
return `
<h1 style="font-size: 18px; letter-spacing: 1px;">${
params[0].axisValue
@@ -109,6 +106,9 @@ export default {
xAxis: {
type: 'category',
axisTick: { show: false },
axisLabel: {
rotate: 45,
},
data: opt.map((item) => item[0]),
},
yAxis: {

View File

@@ -6,15 +6,15 @@
-->
<template>
<div class="app-container">
<div class="app-container" style="flex: 1; height: 1px; display: flex; flex-direction: column;">
<!-- 搜索工作栏 -->
<SearchBar
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<el-row>
<el-col class="custom-tabs">
<el-row type="flex" style="flex: 1;">
<el-col class="custom-tabs" style="flex: 1;">
<el-tabs
v-model="activeName"
:stretch="true"
@@ -32,7 +32,7 @@
<div
v-if="activeName == 'graph'"
class="graph"
style="height: 40vh; display: flex; flex-direction: column">
style="height: 100%; display: flex; flex-direction: column">
<div class="blue-title">各设备加工数量</div>
<LineChart v-if="list && list.length" :list="list" />
<div v-else class="no-data-bg"></div>
@@ -63,13 +63,13 @@ export default {
activeName: 'table', // defaults to 'table'
searchBarFormConfig: [
// 产品
{
__index: 'product',
type: 'select',
label: '产品',
placeholder: '请选择产品',
param: 'productId',
},
// {
// __index: 'product',
// type: 'select',
// label: '产品',
// placeholder: '请选择产品',
// param: 'productId',
// },
// 产线
{
__index: 'line',
@@ -156,17 +156,17 @@ export default {
{
// width: 160,
prop: 'inQuantity',
label: '进片数量',
label: '加工数量',
},
{
// width: 160,
prop: 'outQuantity',
label: '出片数量',
label: '合格数量',
},
{
// width: 160,
prop: 'nokQuantity',
label: '破损/不合格数',
label: '不合格数',
},
{
// width: 160,
@@ -377,6 +377,9 @@ export default {
}
:deep(.custom-tabs) {
.el-tabs {
height: 100%;
}
.el-tabs__header {
margin-bottom: 8px;
display: inline-block;
@@ -389,6 +392,14 @@ export default {
line-height: 36px !important;
height: 36px;
}
.el-tabs__content {
height: calc(100% - 48px);
}
#pane-graph {
height: 100%;
}
}
.blue-title {

View File

@@ -42,7 +42,8 @@
:dataForm="form"
:rows="formRows" /> -->
<el-row v-if="mode.includes('detail')" style="margin-bottom: 24px">
<!-- <el-row v-if="mode.includes('detail')" style="margin-bottom: 24px"> -->
<el-row style="margin-bottom: 24px">
<el-col :span="8">
<div
class="title"
@@ -62,7 +63,7 @@
</div>
</el-col>
</el-row>
<el-row v-else style="margin-bottom: 24px" :gutter="20">
<!-- <el-row v-else style="margin-bottom: 24px" :gutter="20">
<el-form ref="form" :model="form">
<el-col :span="8">
<el-form-item
@@ -85,7 +86,7 @@
</el-form-item>
</el-col>
</el-form>
</el-row>
</el-row> -->
</div>
<div
@@ -132,8 +133,8 @@
<el-button
type="primary"
v-if="!mode.includes('detail')"
@click="handleSave">
保存
@click="handleCancel">
确定
</el-button>
</div>
</div>