From e07e410cf2fbc64c4e1fa8a080a9aac6a3d0c305 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 23 十月 2023 10:39:50 +0800 Subject: [PATCH] 2023-10-23 --- src/tabviews/custom/components/card/cardcellList/index.jsx | 9 ---- src/tabviews/custom/components/share/normalTable/index.jsx | 12 +++--- src/utils/utils.js | 21 +++++----- src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 24 ++++++------ 4 files changed, 29 insertions(+), 37 deletions(-) diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index fed3d09..5ca4716 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -278,8 +278,7 @@ _style.lineHeight = card.innerHeight + 'px' let mark = getMark(card.marks, data, _style) - - _style = mark.style + className = mark.signType } contents.push( @@ -418,8 +417,6 @@ if (card.marks) { let mark = getMark(card.marks, data, _style) - _style = mark.style - if (mark.icon) { if (mark.position === 'front') { val = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {val}</span> @@ -507,8 +504,6 @@ let className = '' if (card.marks) { let mark = getMark(card.marks, data, _style) - - _style = mark.style if (mark.icon) { if (mark.position === 'front') { @@ -883,8 +878,6 @@ let className = '' if (card.marks) { let mark = getMark(card.marks, data, _style) - - _style = mark.style if (mark.icon) { if (mark.position === 'front') { diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx index 01f6363..f7c2b8d 100644 --- a/src/tabviews/custom/components/share/normalTable/index.jsx +++ b/src/tabviews/custom/components/share/normalTable/index.jsx @@ -132,9 +132,9 @@ } if (col.marks) { - let mark = getMark(col.marks, record, style) + style = style ? {...style} : {} - style = mark.style + let mark = getMark(col.marks, record, style) if (mark.icon) { if (mark.position === 'front') { @@ -204,9 +204,9 @@ } if (col.marks) { - let mark = getMark(col.marks, record, style) + style = style ? {...style} : {} - style = mark.style + let mark = getMark(col.marks, record, style) if (mark.icon) { if (mark.position === 'front') { @@ -389,9 +389,9 @@ } if (col.marks) { - let mark = getMark(col.marks, record, style) + style = style ? {...style} : {} - style = mark.style + let mark = getMark(col.marks, record, style) if (mark.icon) { if (mark.position === 'front') { diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx index 4da1baa..053c122 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -407,9 +407,9 @@ } if (col.marks) { - let mark = getMark(col.marks, record, style) + style = style ? {...style} : {} - style = mark.style + let mark = getMark(col.marks, record, style) if (mark.icon) { if (mark.position === 'front') { @@ -507,9 +507,9 @@ } if (col.marks) { - let mark = getMark(col.marks, record, style) + style = style ? {...style} : {} - style = mark.style + let mark = getMark(col.marks, record, style) if (mark.icon) { if (mark.position === 'front') { @@ -612,9 +612,9 @@ } if (col.marks) { - let mark = getMark(col.marks, record, style) + style = style ? {...style} : {} - style = mark.style + let mark = getMark(col.marks, record, style) if (mark.icon) { if (mark.position === 'front') { @@ -903,9 +903,9 @@ } if (col.marks) { - let mark = getMark(col.marks, record, style) + style = style ? {...style} : {} - style = mark.style + let mark = getMark(col.marks, record, style) if (mark.icon) { if (mark.position === 'front') { @@ -979,9 +979,9 @@ } if (col.marks) { - let mark = getMark(col.marks, record, style) + style = style ? {...style} : {} - style = mark.style + let mark = getMark(col.marks, record, style) if (mark.icon) { if (mark.position === 'front') { @@ -1073,9 +1073,9 @@ } if (col.marks) { - let mark = getMark(col.marks, record, style) + style = style ? {...style} : {} - style = mark.style + let mark = getMark(col.marks, record, style) if (mark.icon) { if (mark.position === 'front') { diff --git a/src/utils/utils.js b/src/utils/utils.js index 2062f1d..f640cee 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -2394,9 +2394,8 @@ /** * @description 鑾峰彇鏍囪淇℃伅 */ -export function getMark (marks, record, style = {}) { - style = JSON.parse(JSON.stringify(style)) - let res = {style} +export function getMark (marks, record, style) { + let res = {} marks.some(mark => { let originVal = record[mark.field[0]] @@ -2431,22 +2430,22 @@ let type = mark.signType[0] if (type === 'font') { - res.style.color = mark.color + style.color = mark.color res.innerStyle = {color: mark.color} res.signType = ' sign-font' } else if (type === 'background') { - res.style.backgroundColor = mark.color + style.backgroundColor = mark.color if (mark.fontColor) { - res.style.color = mark.fontColor + style.color = mark.fontColor res.innerStyle = {color: mark.fontColor} } } else if (type === 'underline') { - res.style.textDecoration = 'underline' - res.style.color = mark.color + style.textDecoration = 'underline' + style.color = mark.color res.innerStyle = {color: mark.color, textDecoration: 'underline'} } else if (type === 'line-through') { - res.style.textDecoration = 'line-through' - res.style.color = mark.color + style.textDecoration = 'line-through' + style.color = mark.color res.innerStyle = {color: mark.color, textDecoration: 'line-through'} } else if (type.indexOf('icon') > -1) { res.icon = mark.signType[mark.signType.length - 1] @@ -2457,7 +2456,7 @@ res.position = 'back' } } else if (type === 'indent') { - res.style.color = mark.color + style.color = mark.color res.space = Array(mark.signType[1] + 1).join(' ') } else if (type === 'pointfront') { res.position = 'front' -- Gitblit v1.8.0