|
@@ -67,16 +67,16 @@ const getStartTimeAndEndTime = () => {
|
|
|
}
|
|
|
|
|
|
const formatter = (row, column) => {
|
|
|
- const { title, ratesDeviationNumber }= row;
|
|
|
- const { no } = column;
|
|
|
-
|
|
|
+ const { title }= row;
|
|
|
+ const { no, property } = column;
|
|
|
+
|
|
|
if ( title === '合格率偏差' && no != 0 && no != columns.value.length - 1 ) {
|
|
|
- const val = row[column.property];
|
|
|
-
|
|
|
- if (!ratesDeviationNumber && ratesDeviationNumber != 0) return '';
|
|
|
+ const val = row[property + 'ratesDeviationNumber'];
|
|
|
|
|
|
+ if (!val && val != 0) return '';
|
|
|
+
|
|
|
return h('span', {
|
|
|
- style: { color: ratesDeviationNumber != 0 ? 'red' : '#606266' },
|
|
|
+ style: { color: val > 0 ? 'red' : '#606266' },
|
|
|
}, row[column.property])
|
|
|
}
|
|
|
|
|
@@ -101,19 +101,20 @@ const initPageData = async() => {
|
|
|
let zkTotal = 0;
|
|
|
|
|
|
const middleData = Object.entries(data).map(([key, value]) => {
|
|
|
- assayTotal += value['assayCounts']
|
|
|
- zkTotal += value['zkCounts']
|
|
|
+ assayTotal += value['assayCounts'];
|
|
|
+ zkTotal += value['zkCounts'];
|
|
|
return {
|
|
|
label: key,
|
|
|
prop: key,
|
|
|
minWidth: 160
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
const tableResultData = whiteTableList.map(item => {
|
|
|
const { key } = item;
|
|
|
|
|
|
Object.entries(data).forEach(([k, v]) => {
|
|
|
+
|
|
|
let total = '';
|
|
|
|
|
|
if ( key === 'assayCounts' ) total = assayTotal;
|
|
@@ -123,13 +124,15 @@ const initPageData = async() => {
|
|
|
item = {
|
|
|
total: total === '' ? '' : total,
|
|
|
...item,
|
|
|
+ [k]: v[key],
|
|
|
ratesDeviationNumber: v['ratesDeviationNumber'],
|
|
|
- [k]: v[key]
|
|
|
+ [k + 'ratesDeviationNumber']: v['ratesDeviationNumber'],
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
return item;
|
|
|
})
|
|
|
- console.log(tableResultData)
|
|
|
+
|
|
|
if ( middleData.length ) {
|
|
|
columns.value = [
|
|
|
{ label: '检测指标', width: 200, prop: 'title' },
|