|
@@ -1,16 +1,11 @@
|
|
|
import { Button, Checkbox, Popover, Input, message, Spin } from 'antd'
|
|
import { Button, Checkbox, Popover, Input, message, Spin } from 'antd'
|
|
|
import React, { useState, useRef, useEffect, useMemo } from 'react'
|
|
import React, { useState, useRef, useEffect, useMemo } from 'react'
|
|
|
-import { connect, useAccess } from '@umijs/max'
|
|
|
|
|
|
|
+import { useAccess } from '@umijs/max'
|
|
|
|
|
+import { connect } from '@@/plugin-dva'
|
|
|
import styles from './index.less'
|
|
import styles from './index.less'
|
|
|
import { apiConnOrDelTag, apiUpdateTag } from '@/services/customer'
|
|
import { apiConnOrDelTag, apiUpdateTag } from '@/services/customer'
|
|
|
import consts from '@/basic/consts'
|
|
import consts from '@/basic/consts'
|
|
|
-import {
|
|
|
|
|
- DropdownType,
|
|
|
|
|
- LabelModeType,
|
|
|
|
|
- LabelStatusColorMap,
|
|
|
|
|
- TagDataType,
|
|
|
|
|
- TagType
|
|
|
|
|
-} from './const'
|
|
|
|
|
|
|
+import { DropdownType, LabelModeType, LabelStatusColorMap, TagDataType, TagType } from './const'
|
|
|
|
|
|
|
|
const DropDownMenu = props => {
|
|
const DropDownMenu = props => {
|
|
|
// 保存选中的checkbox ids
|
|
// 保存选中的checkbox ids
|
|
@@ -49,8 +44,7 @@ const DropDownMenu = props => {
|
|
|
}
|
|
}
|
|
|
checkCallBack()
|
|
checkCallBack()
|
|
|
} else {
|
|
} else {
|
|
|
- checkCallBack &&
|
|
|
|
|
- checkCallBack(tagType === TagType.PERSONTAG ? 'tagIds' : 'tagCooperationIds', ids)
|
|
|
|
|
|
|
+ checkCallBack && checkCallBack(tagType === TagType.PERSONTAG ? 'tagIds' : 'tagCooperationIds', ids)
|
|
|
}
|
|
}
|
|
|
if (canRender) {
|
|
if (canRender) {
|
|
|
setCheckedIds(ids)
|
|
setCheckedIds(ids)
|
|
@@ -89,16 +83,12 @@ const DropDownMenu = props => {
|
|
|
return (
|
|
return (
|
|
|
<li
|
|
<li
|
|
|
key={item.id}
|
|
key={item.id}
|
|
|
- className={[styles.menuItem, checkedIds.includes(item.id) && styles.select].join(
|
|
|
|
|
- ' '
|
|
|
|
|
- )}
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ className={[styles.menuItem, checkedIds.includes(item.id) && styles.select].join(' ')}>
|
|
|
<div className={styles.labelText}>
|
|
<div className={styles.labelText}>
|
|
|
<div
|
|
<div
|
|
|
- className={[
|
|
|
|
|
- styles.statusIcon,
|
|
|
|
|
- tagType === TagType.PERSONTAG ? styles.suqare : ''
|
|
|
|
|
- ].join(' ')}
|
|
|
|
|
|
|
+ className={[styles.statusIcon, tagType === TagType.PERSONTAG ? styles.suqare : ''].join(
|
|
|
|
|
+ ' '
|
|
|
|
|
+ )}
|
|
|
style={{ backgroundColor: LabelStatusColorMap[tagType][idx] }}
|
|
style={{ backgroundColor: LabelStatusColorMap[tagType][idx] }}
|
|
|
/>
|
|
/>
|
|
|
<span>{item.name}</span>
|
|
<span>{item.name}</span>
|
|
@@ -123,15 +113,13 @@ const DropDownMenu = props => {
|
|
|
styles.editMenuItem,
|
|
styles.editMenuItem,
|
|
|
styles.menuItemWithBorder,
|
|
styles.menuItemWithBorder,
|
|
|
item.id === activeState.activeId ? styles.active : ''
|
|
item.id === activeState.activeId ? styles.active : ''
|
|
|
- ].join(' ')}
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ ].join(' ')}>
|
|
|
<li onClick={() => labelOnClick(item.id)} style={{ width: '100%' }}>
|
|
<li onClick={() => labelOnClick(item.id)} style={{ width: '100%' }}>
|
|
|
<div className={styles.editLabel}>
|
|
<div className={styles.editLabel}>
|
|
|
<div
|
|
<div
|
|
|
- className={[
|
|
|
|
|
- styles.statusIcon,
|
|
|
|
|
- tagType === TagType.PERSONTAG ? styles.suqare : ''
|
|
|
|
|
- ].join(' ')}
|
|
|
|
|
|
|
+ className={[styles.statusIcon, tagType === TagType.PERSONTAG ? styles.suqare : ''].join(
|
|
|
|
|
+ ' '
|
|
|
|
|
+ )}
|
|
|
style={{ backgroundColor: LabelStatusColorMap[tagType][idx] }}
|
|
style={{ backgroundColor: LabelStatusColorMap[tagType][idx] }}
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
@@ -241,8 +229,7 @@ const PersonLabel = props => {
|
|
|
{tagType === TagType.PERSONTAG || hasPermEdit ? (
|
|
{tagType === TagType.PERSONTAG || hasPermEdit ? (
|
|
|
<span
|
|
<span
|
|
|
onClick={() => setDropdownType(DropdownType.edit)}
|
|
onClick={() => setDropdownType(DropdownType.edit)}
|
|
|
- className="text-primary cursor-pointer ml-3"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ className="text-primary cursor-pointer ml-3">
|
|
|
编辑标签
|
|
编辑标签
|
|
|
</span>
|
|
</span>
|
|
|
) : null}
|
|
) : null}
|
|
@@ -254,11 +241,7 @@ const PersonLabel = props => {
|
|
|
) : null}
|
|
) : null}
|
|
|
</div>
|
|
</div>
|
|
|
) : (
|
|
) : (
|
|
|
- <Button
|
|
|
|
|
- size="small"
|
|
|
|
|
- className="ml-5px"
|
|
|
|
|
- onClick={() => setDropdownType(DropdownType.check)}
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <Button size="small" className="ml-5px" onClick={() => setDropdownType(DropdownType.check)}>
|
|
|
返回
|
|
返回
|
|
|
</Button>
|
|
</Button>
|
|
|
)}
|
|
)}
|