| | |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | | |
| | | //设置æä¸ªåå
æ ¼èæ¯é¢è² |
| | | this.columns.forEach((x) => { |
| | | if (x.field == "topleft") { |
| | | x.cellStyle = (row, rowIndex, columnIndex) => { |
| | | let qu = row.interval.split(","); |
| | | let zhi = qu[0].split("-"); |
| | | if (row.topleft < zhi[0] || row.topleft > zhi[1]) |
| | | return { background: 'red' }; |
| | | }; |
| | | } |
| | | if (x.field == "topmiddle") { |
| | | x.cellStyle = (row, rowIndex, columnIndex) => { |
| | | let qu = row.interval.split(","); |
| | | let zhi = qu[1].split("-"); |
| | | if (row.topmiddle < zhi[0] || row.topmiddle > zhi[1]) |
| | | return { background: 'red' }; |
| | | }; |
| | | } |
| | | if (x.field == "topright") { |
| | | x.cellStyle = (row, rowIndex, columnIndex) => { |
| | | let qu = row.interval.split(","); |
| | | let zhi = qu[2].split("-"); |
| | | if (row.topright < zhi[0] || row.topright > zhi[1]) |
| | | return { background: 'red' }; |
| | | }; |
| | | } |
| | | if (x.field == "centreleft") { |
| | | x.cellStyle = (row, rowIndex, columnIndex) => { |
| | | let qu = row.interval.split(","); |
| | | let zhi = qu[3].split("-"); |
| | | if (row.centreleft < zhi[0] || row.centreleft > zhi[1]) |
| | | return { background: 'red' }; |
| | | }; |
| | | } |
| | | if (x.field == "centremiddle") { |
| | | x.cellStyle = (row, rowIndex, columnIndex) => { |
| | | let qu = row.interval.split(","); |
| | | let zhi = qu[4].split("-"); |
| | | if (row.centremiddle < zhi[0] || row.centremiddle > zhi[1]) |
| | | return { background: 'red' }; |
| | | }; |
| | | } |
| | | if (x.field == "centreright") { |
| | | x.cellStyle = (row, rowIndex, columnIndex) => { |
| | | let qu = row.interval.split(","); |
| | | let zhi = qu[5].split("-"); |
| | | if (row.centreright < zhi[0] || row.centreright > zhi[1]) |
| | | return { background: 'red' }; |
| | | }; |
| | | } |
| | | if (x.field == "bottomleft") { |
| | | x.cellStyle = (row, rowIndex, columnIndex) => { |
| | | let qu = row.interval.split(","); |
| | | let zhi = qu[6].split("-"); |
| | | if (row.bottomleft < zhi[0] || row.bottomleft > zhi[1]) |
| | | return { background: 'red' }; |
| | | }; |
| | | } |
| | | if (x.field == "bottomright") { |
| | | x.cellStyle = (row, rowIndex, columnIndex) => { |
| | | let qu = row.interval.split(","); |
| | | let zhi = qu[7].split("-"); |
| | | if (row.bottomright < zhi[0] || row.bottomright > zhi[1]) |
| | | return { background: 'red' }; |
| | | }; |
| | | } |
| | | }); |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | } |
| | | }; |
| | | export default extension; |
| | | |