qymljy 6 月之前
父節點
當前提交
3f4e512fe9
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/utils/tool.js

+ 4 - 4
src/utils/tool.js

@@ -266,16 +266,16 @@ export default {
     return year + '-' + month +'-' + date
   },
   /*查重格式化*/
-  getFontHighlight(data){
+  getFontHighlight(data,type){
     data.map(item => {
       item.chars = item.chars.reduce((acc,ite) => ({
         ...acc,
         ...ite
       }),{})
 
-      item.projectname = item.projectname.split('').map(text => {
-        let projectname = item.chars.projectname.join("") || ''
-        return projectname.includes(text) ? {
+      item[type] = item[type].split('').map(text => {
+        type = item.chars[type].join("") || ''
+        return type.includes(text) ? {
           text,
           color: 'red'
         } : {