table chart
This commit is contained in:
@@ -106,6 +106,10 @@ export default {
|
||||
activeIndex(val) {
|
||||
this.initChart(val);
|
||||
},
|
||||
daterange(val) {
|
||||
console.log('222', val)
|
||||
this.templateOption.xAxis.data = val
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
@@ -124,8 +128,8 @@ export default {
|
||||
},
|
||||
/** 初始化/设置 图表 */
|
||||
initChart(val) {
|
||||
console.log('tableData', this.tableData);
|
||||
if (!this.chart) this.chart = echarts.init(this.$refs.chartDiv);
|
||||
this.chart.clear();
|
||||
switch (val) {
|
||||
case 0:
|
||||
const eqCt = this.tableData.map((row) => ({
|
||||
@@ -139,7 +143,7 @@ export default {
|
||||
...this.templateOption,
|
||||
yAxis: { ...this.templateOption.yAxis, name: '设备CT' },
|
||||
series: eqCt,
|
||||
});
|
||||
}, true);
|
||||
break;
|
||||
case 1:
|
||||
const eqTt = this.tableData.map((row) => ({
|
||||
@@ -153,7 +157,7 @@ export default {
|
||||
...this.templateOption,
|
||||
yAxis: { ...this.templateOption.yAxis, name: '设备TT' },
|
||||
series: eqTt,
|
||||
});
|
||||
}, true);
|
||||
break;
|
||||
case 2:
|
||||
const plCt = this.tableData.map((row) => ({
|
||||
@@ -167,7 +171,7 @@ export default {
|
||||
...this.templateOption,
|
||||
yAxis: { ...this.templateOption.yAxis, name: '产线CT' },
|
||||
series: plCt,
|
||||
});
|
||||
}, true);
|
||||
break;
|
||||
case 3:
|
||||
const plTt = this.tableData.map((row) => ({
|
||||
@@ -181,9 +185,10 @@ export default {
|
||||
...this.templateOption,
|
||||
yAxis: { ...this.templateOption.yAxis, name: '产线TT' },
|
||||
series: plTt,
|
||||
});
|
||||
}, true);
|
||||
break;
|
||||
default:
|
||||
this.activeIndex = 0
|
||||
const eqCt2 = this.tableData.map((row) => ({
|
||||
name: row.equName,
|
||||
type: 'line',
|
||||
@@ -195,7 +200,7 @@ export default {
|
||||
...this.templateOption,
|
||||
yAxis: { ...this.templateOption.yAxis, name: '设备CT' },
|
||||
series: eqCt2,
|
||||
});
|
||||
}, true);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -18,13 +18,15 @@
|
||||
:page="1"
|
||||
:limit="999"
|
||||
:table-props="tableProps"
|
||||
:table-data="tableData" />
|
||||
:table-data="tableData"
|
||||
:max-height="tableH" />
|
||||
<div v-if="tableData.length == 0" class="no-data-bg"></div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="'\u3000产线平衡分析图\u3000'" name="graph">
|
||||
<div class="graph" style="height: 800px">
|
||||
<!-- graph -->
|
||||
<AnalysisChart
|
||||
ref="analysisChart"
|
||||
v-if="activeName == 'graph'"
|
||||
:table-data="tableData"
|
||||
:daterange="dateArr"></AnalysisChart>
|
||||
@@ -47,13 +49,14 @@ import BalanceChart from '../balanceChart';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import AnalysisChart from './chart.vue';
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
BalanceChart,
|
||||
AnalysisChart,
|
||||
},
|
||||
mixins: [basicPageMixin],
|
||||
mixins: [basicPageMixin, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
activeName: 'table',
|
||||
@@ -176,6 +179,11 @@ export default {
|
||||
// const p = this.tableProps
|
||||
// const d = this.tableData
|
||||
// debugger;
|
||||
if (this.activeName == 'graph') {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['analysisChart'].initChart()
|
||||
})
|
||||
}
|
||||
this.ready = true;
|
||||
},
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="tableData">
|
||||
:table-data="tableData"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
@@ -41,6 +42,7 @@
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '../../mixins/basic-page';
|
||||
import { parseTime } from '../../mixins/code-filter';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
import {
|
||||
deleteFactory,
|
||||
getFactoryPage
|
||||
@@ -71,7 +73,7 @@ const tableProps = [
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
|
||||
@@ -17,7 +17,7 @@ export default {
|
||||
},
|
||||
tableData: [],
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
},
|
||||
|
||||
@@ -27,13 +27,16 @@
|
||||
import { getPdlDataOneDay } from '@/api/core/monitoring/data24'
|
||||
import { parseTime } from '../../mixins/code-filter';
|
||||
import { getSchedulingMonitoringRecord1 } from '@/api/monitoring/teamProduction'
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
export default {
|
||||
name: 'productionLineData24',
|
||||
mixins: [tableHeightMixin],
|
||||
components: {},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
heightNum: 240,
|
||||
urlOptions: {
|
||||
getDataListURL: getPdlDataOneDay
|
||||
},
|
||||
@@ -56,9 +59,9 @@ export default {
|
||||
},
|
||||
computed: {},
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(240)
|
||||
})
|
||||
// window.addEventListener('resize', () => {
|
||||
// this.tableH = this.tableHeight(240)
|
||||
// })
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
|
||||
Reference in New Issue
Block a user