|
@@ -40,6 +40,29 @@ const Company = props => {
|
|
|
tagCooperationIds: []
|
|
tagCooperationIds: []
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+ const [state, setState] = useState({
|
|
|
|
|
+ params: {},
|
|
|
|
|
+ orderIds: []
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
|
+ if (!personTags.length) {
|
|
|
|
|
+ dispatch({
|
|
|
|
|
+ type: 'company/fetchPersonTags',
|
|
|
|
|
+ payload: { tagType: TagTypeEnum.PERSONTAG, tagColumn: TagDataTypeEnum.COMPANY }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!teamTags.length) {
|
|
|
|
|
+ dispatch({
|
|
|
|
|
+ type: 'company/fetchTeamTags',
|
|
|
|
|
+ payload: { tagType: TagTypeEnum.TEAMTAG, tagColumn: TagDataTypeEnum.COMPANY }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ if (shouldUpdate) {
|
|
|
|
|
+ tRef.current.reload()
|
|
|
|
|
+ }
|
|
|
|
|
+ }, [shouldUpdate])
|
|
|
|
|
+
|
|
|
const tag = useMemo(() => {
|
|
const tag = useMemo(() => {
|
|
|
const personTagMap = {}
|
|
const personTagMap = {}
|
|
|
const teamTagMap = {}
|
|
const teamTagMap = {}
|
|
@@ -87,10 +110,7 @@ const Company = props => {
|
|
|
return { personTagMap, teamTagMap, natureMap, personOptions, teamOptions }
|
|
return { personTagMap, teamTagMap, natureMap, personOptions, teamOptions }
|
|
|
}, [loading])
|
|
}, [loading])
|
|
|
|
|
|
|
|
- const [state, setState] = useState({
|
|
|
|
|
- params: {},
|
|
|
|
|
- orderIds: []
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ const [defaultPermAuthCache] = getPermAuthCache(PermDataTypeEunm.CUSTOMER)
|
|
|
|
|
|
|
|
// 重置到默认值,包括表单
|
|
// 重置到默认值,包括表单
|
|
|
const initData = () => {
|
|
const initData = () => {
|
|
@@ -110,24 +130,6 @@ const Company = props => {
|
|
|
initData()
|
|
initData()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- useEffect(() => {
|
|
|
|
|
- if (!personTags.length) {
|
|
|
|
|
- dispatch({
|
|
|
|
|
- type: 'company/fetchTags',
|
|
|
|
|
- payload: { tagType: TagTypeEnum.PERSONTAG, tagColumn: TagDataTypeEnum.COMPANY }
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- if (!teamTags.length) {
|
|
|
|
|
- dispatch({
|
|
|
|
|
- type: 'company/fetchTags',
|
|
|
|
|
- payload: { tagType: TagTypeEnum.TEAMTAG, tagColumn: TagDataTypeEnum.COMPANY }
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- if (shouldUpdate) {
|
|
|
|
|
- tRef.current.reload()
|
|
|
|
|
- }
|
|
|
|
|
- }, [shouldUpdate])
|
|
|
|
|
const handleSearch = value => {
|
|
const handleSearch = value => {
|
|
|
tRef.current.reset()
|
|
tRef.current.reset()
|
|
|
setState({ ...state, params: { ...state.params, search: value } })
|
|
setState({ ...state, params: { ...state.params, search: value } })
|
|
@@ -165,7 +167,8 @@ const Company = props => {
|
|
|
render: (companyName, record) => (
|
|
render: (companyName, record) => (
|
|
|
<span
|
|
<span
|
|
|
onClick={() => showDrawer(record.id)}
|
|
onClick={() => showDrawer(record.id)}
|
|
|
- className="text-primary cursor-pointer hover:text-[#967bbd]">
|
|
|
|
|
|
|
+ className="text-primary cursor-pointer hover:text-[#967bbd]"
|
|
|
|
|
+ >
|
|
|
{companyName}
|
|
{companyName}
|
|
|
</span>
|
|
</span>
|
|
|
)
|
|
)
|
|
@@ -210,7 +213,8 @@ const Company = props => {
|
|
|
tagType={TagTypeEnum.PERSONTAG}
|
|
tagType={TagTypeEnum.PERSONTAG}
|
|
|
tagColumn={TagDataTypeEnum.COMPANY}
|
|
tagColumn={TagDataTypeEnum.COMPANY}
|
|
|
checkCallBack={refreshData}
|
|
checkCallBack={refreshData}
|
|
|
- modeType={LabelModeType.column}>
|
|
|
|
|
|
|
+ modeType={LabelModeType.column}
|
|
|
|
|
+ >
|
|
|
<Add theme="filled" size="20" fill="#868e96" className="cursor-pointer" />
|
|
<Add theme="filled" size="20" fill="#868e96" className="cursor-pointer" />
|
|
|
</PersonLabel>
|
|
</PersonLabel>
|
|
|
</div>
|
|
</div>
|
|
@@ -241,7 +245,8 @@ const Company = props => {
|
|
|
tagType={TagTypeEnum.TEAMTAG}
|
|
tagType={TagTypeEnum.TEAMTAG}
|
|
|
tagColumn={TagDataTypeEnum.COMPANY}
|
|
tagColumn={TagDataTypeEnum.COMPANY}
|
|
|
checkCallBack={refreshData}
|
|
checkCallBack={refreshData}
|
|
|
- modeType={LabelModeType.column}>
|
|
|
|
|
|
|
+ modeType={LabelModeType.column}
|
|
|
|
|
+ >
|
|
|
<Add theme="filled" size="20" fill="#868e96" className="cursor-pointer" />
|
|
<Add theme="filled" size="20" fill="#868e96" className="cursor-pointer" />
|
|
|
</PersonLabel>
|
|
</PersonLabel>
|
|
|
</div>
|
|
</div>
|
|
@@ -390,8 +395,6 @@ const Company = props => {
|
|
|
requestSuccess && refreshData()
|
|
requestSuccess && refreshData()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const [defaultPermAuthCache] = getPermAuthCache(PermDataTypeEunm.CUSTOMER)
|
|
|
|
|
-
|
|
|
|
|
const renderTableAlert = ({ selectedRowKeys }) => {
|
|
const renderTableAlert = ({ selectedRowKeys }) => {
|
|
|
return (
|
|
return (
|
|
|
<div className="flex flex-row">
|
|
<div className="flex flex-row">
|
|
@@ -400,7 +403,8 @@ const Company = props => {
|
|
|
tagType={TagTypeEnum.PERSONTAG}
|
|
tagType={TagTypeEnum.PERSONTAG}
|
|
|
tagColumn={TagDataTypeEnum.COMPANY}
|
|
tagColumn={TagDataTypeEnum.COMPANY}
|
|
|
checkCallBack={toolbarOptionsChange}
|
|
checkCallBack={toolbarOptionsChange}
|
|
|
- modeType={LabelModeType.toolbar}>
|
|
|
|
|
|
|
+ modeType={LabelModeType.toolbar}
|
|
|
|
|
+ >
|
|
|
{tagState.tagIds.length ? (
|
|
{tagState.tagIds.length ? (
|
|
|
<Button>
|
|
<Button>
|
|
|
{tagState.tagIds.map(item => (
|
|
{tagState.tagIds.map(item => (
|
|
@@ -425,7 +429,8 @@ const Company = props => {
|
|
|
tagType={TagTypeEnum.TEAMTAG}
|
|
tagType={TagTypeEnum.TEAMTAG}
|
|
|
tagColumn={TagDataTypeEnum.COMPANY}
|
|
tagColumn={TagDataTypeEnum.COMPANY}
|
|
|
checkCallBack={toolbarOptionsChange}
|
|
checkCallBack={toolbarOptionsChange}
|
|
|
- modeType={LabelModeType.toolbar}>
|
|
|
|
|
|
|
+ modeType={LabelModeType.toolbar}
|
|
|
|
|
+ >
|
|
|
{tagState.tagCooperationIds.length ? (
|
|
{tagState.tagCooperationIds.length ? (
|
|
|
<Button>
|
|
<Button>
|
|
|
{tagState.tagCooperationIds.map(item => (
|
|
{tagState.tagCooperationIds.map(item => (
|
|
@@ -453,6 +458,8 @@ const Company = props => {
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (!personTags?.length || !teamTags?.length) return null
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<div className={styles.companyContent}>
|
|
<div className={styles.companyContent}>
|
|
|
<BasicTable
|
|
<BasicTable
|