|
@@ -3,25 +3,52 @@ import { BasicColumn } from '/@/components/Table';
|
|
|
import { render } from '/@/utils/common/renderUtils';
|
|
|
|
|
|
const renderNum = (num, weight, backArr?: boolean) => {
|
|
|
+ let arr = [h('span', { style: { color: '#0085ff' } }, num)];
|
|
|
+ if (weight !== null) {
|
|
|
+ arr.push(h('span', {}, '/' + weight.toFixed(2)));
|
|
|
+ }
|
|
|
if (backArr === true) {
|
|
|
- return [h('span', { style: { color: '#0085ff' } }, num), h('span', {}, '/' + weight.toFixed(2))];
|
|
|
+ return arr;
|
|
|
}
|
|
|
- return h('div', {}, [h('span', { style: { color: '#0085ff' } }, num), h('span', {}, '/' + weight.toFixed(2))]);
|
|
|
+ return h('div', {}, arr);
|
|
|
+};
|
|
|
+
|
|
|
+const renderStrandCell = (num, lengthJsonStr) => {
|
|
|
+ try {
|
|
|
+ if (lengthJsonStr) {
|
|
|
+ const lengthJson = JSON.parse(lengthJsonStr);
|
|
|
+ console.log('lengthJson', lengthJson);
|
|
|
+ const lengthKeys = Object.keys(lengthJson);
|
|
|
+ if (lengthKeys.length) {
|
|
|
+ return h('div', { style: { textAlign: 'left' } }, [
|
|
|
+ h('div', { style: { color: '#f50' } }, num),
|
|
|
+ ...lengthKeys.map((key) => {
|
|
|
+ return h('div', {}, [h('span', {}, Number(key) / 1000 + ': '), h('span', { style: { color: '#0085ff' } }, lengthJson[key])]);
|
|
|
+ }),
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+
|
|
|
+ return num;
|
|
|
+ }
|
|
|
+ } catch (error) {}
|
|
|
+ return num;
|
|
|
};
|
|
|
|
|
|
// 列表数据
|
|
|
export const columns: BasicColumn[] = [
|
|
|
{
|
|
|
- title: '序号',
|
|
|
+ title: '#',
|
|
|
align: 'center',
|
|
|
dataIndex: 'columnIndex',
|
|
|
- width: 50,
|
|
|
+ width: 36,
|
|
|
+ fixed: 'left',
|
|
|
},
|
|
|
{
|
|
|
title: '炉号',
|
|
|
align: 'center',
|
|
|
dataIndex: 'heatNo',
|
|
|
width: 90,
|
|
|
+ fixed: 'left',
|
|
|
},
|
|
|
{
|
|
|
title: '牌号',
|
|
@@ -34,66 +61,93 @@ export const columns: BasicColumn[] = [
|
|
|
},
|
|
|
{
|
|
|
title: '1流',
|
|
|
- width: 50,
|
|
|
+ width: 90,
|
|
|
align: 'center',
|
|
|
dataIndex: 'oneStrandNo',
|
|
|
+ customRender(opt) {
|
|
|
+ return renderStrandCell(opt.record.oneStrandNo, opt.record.oneLength);
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
title: '2流',
|
|
|
- width: 50,
|
|
|
+ width: 90,
|
|
|
align: 'center',
|
|
|
dataIndex: 'twoStrandNo',
|
|
|
+ customRender(opt) {
|
|
|
+ return renderStrandCell(opt.record.twoStrandNo, opt.record.twoLength);
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
title: '3流',
|
|
|
- width: 50,
|
|
|
+ width: 90,
|
|
|
align: 'center',
|
|
|
dataIndex: 'threeStrandNo',
|
|
|
+ customRender(opt) {
|
|
|
+ return renderStrandCell(opt.record.threeStrandNo, opt.record.threeLength);
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
title: '4流',
|
|
|
- width: 50,
|
|
|
+ width: 90,
|
|
|
align: 'center',
|
|
|
dataIndex: 'fourStrandNo',
|
|
|
+ customRender(opt) {
|
|
|
+ return renderStrandCell(opt.record.fourStrandNo, opt.record.fourLength);
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
title: '5流',
|
|
|
- width: 50,
|
|
|
+ width: 90,
|
|
|
align: 'center',
|
|
|
dataIndex: 'fiveStrandNo',
|
|
|
+ customRender(opt) {
|
|
|
+ return renderStrandCell(opt.record.fiveStrandNo, opt.record.fiveLength);
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
title: '6流',
|
|
|
- width: 50,
|
|
|
+ width: 90,
|
|
|
align: 'center',
|
|
|
dataIndex: 'sixStrandNo',
|
|
|
+ customRender(opt) {
|
|
|
+ return renderStrandCell(opt.record.sixStrandNo, opt.record.sixLength);
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
title: '7流',
|
|
|
- width: 50,
|
|
|
+ width: 90,
|
|
|
align: 'center',
|
|
|
dataIndex: 'sevenStrandNo',
|
|
|
+ customRender(opt) {
|
|
|
+ return renderStrandCell(opt.record.sevenStrandNo, opt.record.sevenLength);
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
title: '8流',
|
|
|
- width: 50,
|
|
|
+ width: 90,
|
|
|
align: 'center',
|
|
|
dataIndex: 'eightStrandNo',
|
|
|
+ customRender(opt) {
|
|
|
+ return renderStrandCell(opt.record.eightStrandNo, opt.record.eightLength);
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
title: '棒一',
|
|
|
align: 'center',
|
|
|
+ width: 100,
|
|
|
dataIndex: 'directRolling',
|
|
|
customRender({ record }) {
|
|
|
const { hotSend, directRolling } = record;
|
|
|
try {
|
|
|
if (hotSend) {
|
|
|
const obj = JSON.parse(hotSend);
|
|
|
- return obj.hotSendTotalCount + ' / ' + obj.hotSendTotalWeight.toFixed(2);
|
|
|
+ // return obj.hotSendTotalCount + ' / ' + obj.hotSendTotalWeight.toFixed(2);
|
|
|
+ return renderNum(obj.hotSendTotalCount, obj.hotSendTotalWeight);
|
|
|
}
|
|
|
if (directRolling) {
|
|
|
const obj = JSON.parse(directRolling);
|
|
|
- return obj.directRollingTotalCount + ' / ' + obj.directRollingTotalWeight.toFixed(2);
|
|
|
+ // return obj.directRollingTotalCount + ' / ' + obj.directRollingTotalWeight.toFixed(2);
|
|
|
+ return renderNum(obj.directRollingTotalCount, obj.directRollingTotalWeight);
|
|
|
}
|
|
|
} catch (error) {}
|
|
|
return '';
|
|
@@ -102,6 +156,7 @@ export const columns: BasicColumn[] = [
|
|
|
{
|
|
|
title: '热装',
|
|
|
align: 'center',
|
|
|
+ width: 100,
|
|
|
dataIndex: 'hotCharge',
|
|
|
customRender({ record }) {
|
|
|
const { hotCharge } = record;
|
|
@@ -118,6 +173,7 @@ export const columns: BasicColumn[] = [
|
|
|
{
|
|
|
title: '堆垛',
|
|
|
align: 'center',
|
|
|
+ width: 100,
|
|
|
dataIndex: 'stacking',
|
|
|
customRender({ record }) {
|
|
|
const { stacking } = record;
|
|
@@ -134,6 +190,7 @@ export const columns: BasicColumn[] = [
|
|
|
{
|
|
|
title: '定尺',
|
|
|
align: 'center',
|
|
|
+ width: 100,
|
|
|
dataIndex: 'length',
|
|
|
customRender({ record }) {
|
|
|
const { length } = record;
|
|
@@ -143,8 +200,8 @@ export const columns: BasicColumn[] = [
|
|
|
let lengthCC: any[] = [];
|
|
|
Object.keys(obj).forEach((key) => {
|
|
|
// lengthCC.push(h('div', {}, key + ' : ' + obj[key].lengthTotalCount + ' / ' + obj[key].lengthTotalWeight.toFixed(2)));
|
|
|
- const lengthStlArr = renderNum(obj[key].lengthTotalCount, obj[key].lengthTotalWeight, true) as any[];
|
|
|
- lengthCC.push(h('div', {}, [h('span', {}, Number(key) / 1000 + ' : '), ...lengthStlArr]));
|
|
|
+ const lengthStlArr = renderNum(obj[key].lengthTotalCount, null, true) as any[];
|
|
|
+ lengthCC.push(h('div', {}, [h('span', {}, Number(key) / 1000 + ': '), ...lengthStlArr]));
|
|
|
});
|
|
|
return h('div', { style: { fontSize: '12px', textAlign: 'left' } }, lengthCC);
|
|
|
}
|
|
@@ -155,6 +212,7 @@ export const columns: BasicColumn[] = [
|
|
|
{
|
|
|
title: '总计',
|
|
|
align: 'center',
|
|
|
+ width: 100,
|
|
|
dataIndex: 'totalInfo',
|
|
|
customRender({ record }) {
|
|
|
try {
|