Procházet zdrojové kódy

feat: 个人/协作标签bug

lanjianrong před 4 roky
rodič
revize
9bf78de8f5

+ 2 - 2
src/pages/Customer/Client/components/ClientDetail/Form.jsx

@@ -38,13 +38,13 @@ const ContanctForm = props => {
   useEffect(() => {
     if (!personTags.length) {
       dispatch({
-        type: 'client/fetchTags',
+        type: 'client/fetchPersonTags',
         payload: { tagType: TagTypeEnum.PERSONTAG, tagColumn: TagDataTypeEnum.CLIENT }
       })
     }
     if (!teamTags.length) {
       dispatch({
-        type: 'client/fetchTags',
+        type: 'client/fetchTeamTags',
         payload: { tagType: TagTypeEnum.TEAMTAG, tagColumn: TagDataTypeEnum.CLIENT }
       })
     }

+ 6 - 4
src/pages/Customer/Company/components/CompanyDetail/Form.jsx

@@ -20,13 +20,13 @@ const CompanyForm = props => {
   useEffect(() => {
     if (!personTags.length) {
       dispatch({
-        type: 'company/fetchTags',
+        type: 'company/fetchPersonTags',
         payload: { tagType: TagTypeEnum.PERSONTAG, tagColumn: TagDataTypeEnum.COMPANY }
       })
     }
     if (!teamTags.length) {
       dispatch({
-        type: 'company/fetchTags',
+        type: 'company/fetchTeamTags',
         payload: { tagType: TagTypeEnum.TEAMTAG, tagColumn: TagDataTypeEnum.COMPANY }
       })
     }
@@ -122,7 +122,8 @@ const CompanyForm = props => {
             tagType={TagTypeEnum.PERSONTAG}
             tagColumn={TagDataTypeEnum.COMPANY}
             checkCallBack={refreshCompany}
-            modeType={LabelModeType.column}>
+            modeType={LabelModeType.column}
+          >
             <Add theme="filled" size="20" fill="#868e96" className="cursor-pointer" />
           </PersonLabel>
         </div>
@@ -149,7 +150,8 @@ const CompanyForm = props => {
             tagType={TagTypeEnum.TEAMTAG}
             tagColumn={TagDataTypeEnum.COMPANY}
             checkCallBack={refreshCompany}
-            modeType={LabelModeType.column}>
+            modeType={LabelModeType.column}
+          >
             <Add theme="filled" size="20" fill="#868e96" className="cursor-pointer" />
           </PersonLabel>
         </div>

+ 4 - 2
src/pages/Customer/Company/components/PersonLabel/index.jsx

@@ -201,7 +201,9 @@ const PersonLabel = props => {
   const [showOkBtn, setShowOkBtn] = useState(false)
   const initData = () => {
     dispatch({
-      type: `${tagColumn === TagDataTypeEnum.COMPANY ? 'company' : 'client'}/fetchTags`,
+      type: `${tagColumn === TagDataTypeEnum.COMPANY ? 'company' : 'client'}/${
+        tagType === TagTypeEnum.PERSONTAG ? 'fetchPersonTags' : 'fetchTeamTags'
+      }`,
       payload: { tagType, tagColumn }
     })
   }
@@ -236,7 +238,7 @@ const PersonLabel = props => {
       <div className="mt-5px">
         {dropdownType === DropdownTypeEnum.check ? (
           <div className="flex justify-between">
-            {hasPermEdit || tagType === TagTypeEnum.PERSONTAG ? (
+            {tagType === TagTypeEnum.PERSONTAG || hasPermEdit ? (
               <span
                 onClick={() => setDropdownType(DropdownTypeEnum.edit)}
                 className="text-primary cursor-pointer ml-3"