Ver código fonte

feat: 完善标签icon的显示

lanjianrong 5 anos atrás
pai
commit
56cf333ed5

+ 2 - 0
src/basic/css/common.scss

@@ -455,12 +455,14 @@
 }
 
 .zh-circle-icon {
+  display: inline-block;
   width: 12px;
   height: 12px;
   border-radius: 50%;
 }
 
 .zh-square-icon {
+  display: inline-block;
   width: 12px;
   height: 12px;
 }

+ 22 - 2
src/pages/Customer/Company/index.jsx

@@ -31,10 +31,30 @@ const Company = props => {
     const personTagMap = {}
     const teamTagMap = {}
     personTags.forEach(item => {
-      personTagMap[item.id] = { text: item.name }
+      personTagMap[item.id] = {
+        text: (
+          <>
+            <span
+              className="zh-circle-icon zh-mg-right-3"
+              style={{ backgroundColor: personTagColorMap[item.id] }}
+            />
+            <span>{item.name}</span>
+          </>
+        )
+      }
     })
     teamTags.forEach(item => {
-      teamTagMap[item.id] = { text: item.name }
+      teamTagMap[item.id] = {
+        text: (
+          <>
+            <span
+              className="zh-circle-icon zh-mg-right-3"
+              style={{ backgroundColor: teamTagColorMap[item.id] }}
+            />
+            <span>{item.name}</span>
+          </>
+        )
+      }
     })
 
     return { personTagMap, teamTagMap }

+ 22 - 3
src/pages/Customer/Contact/index.jsx

@@ -31,10 +31,30 @@ const Contact = props => {
     const personTagMap = {}
     const teamTagMap = {}
     personTags.forEach(item => {
-      personTagMap[item.id] = { text: item.name }
+      personTagMap[item.id] = {
+        text: (
+          <>
+            <span
+              className="zh-circle-icon zh-mg-right-3"
+              style={{ backgroundColor: personTagColorMap[item.id] }}
+            />
+            <span>{item.name}</span>
+          </>
+        )
+      }
     })
     teamTags.forEach(item => {
-      teamTagMap[item.id] = { text: item.name }
+      teamTagMap[item.id] = {
+        text: (
+          <>
+            <span
+              className="zh-circle-icon zh-mg-right-3"
+              style={{ backgroundColor: teamTagColorMap[item.id] }}
+            />
+            <span>{item.name}</span>
+          </>
+        )
+      }
     })
 
     return { personTagMap, teamTagMap }
@@ -456,7 +476,6 @@ const Contact = props => {
           code = -1,
           data: { client = [], total = 0 }
         } = await queryContact({ ...params, ...sort, ...filter })
-        console.log('data', client)
         return {
           data: client,
           success: code === consts.RET_CODE.SUCCESS,