|
@@ -1,6 +1,5 @@
|
|
|
import React, { useState, useEffect, useRef } from 'react'
|
|
import React, { useState, useEffect, useRef } from 'react'
|
|
|
import ProTable from '@ant-design/pro-table'
|
|
import ProTable from '@ant-design/pro-table'
|
|
|
-import { useModel } from 'umi'
|
|
|
|
|
import { Row, Col, Select, Card, Skeleton } from 'antd'
|
|
import { Row, Col, Select, Card, Skeleton } from 'antd'
|
|
|
import { AddressBook, City, Finance, Comment } from '@icon-park/react'
|
|
import { AddressBook, City, Finance, Comment } from '@icon-park/react'
|
|
|
import consts from '@/consts'
|
|
import consts from '@/consts'
|
|
@@ -12,12 +11,13 @@ import SoftLeaderboard from './components/SoftLeaderboard'
|
|
|
import { cardTypeMap, cyclicalOp } from './consts'
|
|
import { cardTypeMap, cyclicalOp } from './consts'
|
|
|
import BusinessChar from './components/BusinessChar'
|
|
import BusinessChar from './components/BusinessChar'
|
|
|
import RatioPanels from './components/RatioPanels'
|
|
import RatioPanels from './components/RatioPanels'
|
|
|
|
|
+import PermSelect from '@/pages/Customer/Company/components/PermSelect'
|
|
|
|
|
|
|
|
const Dashboard = () => {
|
|
const Dashboard = () => {
|
|
|
const timer = useRef(null)
|
|
const timer = useRef(null)
|
|
|
- const { initialState: { permData } = { permData: {} } } = useModel('@@initialState')
|
|
|
|
|
const [state, setState] = useState({
|
|
const [state, setState] = useState({
|
|
|
loading: true,
|
|
loading: true,
|
|
|
|
|
+ staffIds: null,
|
|
|
immediate: false,
|
|
immediate: false,
|
|
|
visible: false,
|
|
visible: false,
|
|
|
reminderData: [],
|
|
reminderData: [],
|
|
@@ -88,23 +88,23 @@ const Dashboard = () => {
|
|
|
aggregation,
|
|
aggregation,
|
|
|
businessChar
|
|
businessChar
|
|
|
})
|
|
})
|
|
|
- } else {
|
|
|
|
|
- timer.current = setTimeout(() => {
|
|
|
|
|
- setState({
|
|
|
|
|
- ...state,
|
|
|
|
|
- loading: false,
|
|
|
|
|
- reminderData,
|
|
|
|
|
- leaderboard,
|
|
|
|
|
- productLeaderBoard,
|
|
|
|
|
- clientChainRatio,
|
|
|
|
|
- customerChainRatio,
|
|
|
|
|
- businessChainRatio,
|
|
|
|
|
- serviceLogChainRatio,
|
|
|
|
|
- aggregation,
|
|
|
|
|
- businessChar
|
|
|
|
|
- })
|
|
|
|
|
- }, 1000)
|
|
|
|
|
|
|
+ return
|
|
|
}
|
|
}
|
|
|
|
|
+ timer.current = setTimeout(() => {
|
|
|
|
|
+ setState({
|
|
|
|
|
+ ...state,
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ reminderData,
|
|
|
|
|
+ leaderboard,
|
|
|
|
|
+ productLeaderBoard,
|
|
|
|
|
+ clientChainRatio,
|
|
|
|
|
+ customerChainRatio,
|
|
|
|
|
+ businessChainRatio,
|
|
|
|
|
+ serviceLogChainRatio,
|
|
|
|
|
+ aggregation,
|
|
|
|
|
+ businessChar
|
|
|
|
|
+ })
|
|
|
|
|
+ }, 1000)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -187,6 +187,22 @@ const Dashboard = () => {
|
|
|
const handleChangeGroupId = e =>
|
|
const handleChangeGroupId = e =>
|
|
|
setState({ ...state, immediate: true, params: { ...state.params, businessGroupId: e } })
|
|
setState({ ...state, immediate: true, params: { ...state.params, businessGroupId: e } })
|
|
|
|
|
|
|
|
|
|
+ // 处理权限Select下拉组件OnChange事件
|
|
|
|
|
+ const handlePermChange = ({ staffIds = [], dataPermission }) => {
|
|
|
|
|
+ if (staffIds?.length) {
|
|
|
|
|
+ setState({
|
|
|
|
|
+ ...state,
|
|
|
|
|
+ immediate: true,
|
|
|
|
|
+ params: { ...state.params, staffIds, dataPermission: null }
|
|
|
|
|
+ })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ setState({
|
|
|
|
|
+ ...state,
|
|
|
|
|
+ immediate: true,
|
|
|
|
|
+ params: { ...state.params, staffIds: null, dataPermission }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
return (
|
|
return (
|
|
|
<div>
|
|
<div>
|
|
|
<div className="shadow-card">
|
|
<div className="shadow-card">
|
|
@@ -207,7 +223,8 @@ const Dashboard = () => {
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<div className="mt-4">
|
|
<div className="mt-4">
|
|
|
- <Select
|
|
|
|
|
|
|
+ <PermSelect loading={state.loading} onConfirm={handlePermChange} dataType="workbench" />
|
|
|
|
|
+ {/* <Select
|
|
|
loading={state.loading}
|
|
loading={state.loading}
|
|
|
options={permData?.workbench || []}
|
|
options={permData?.workbench || []}
|
|
|
dropdownMatchSelectWidth={false}
|
|
dropdownMatchSelectWidth={false}
|
|
@@ -215,7 +232,7 @@ const Dashboard = () => {
|
|
|
onChange={e =>
|
|
onChange={e =>
|
|
|
setState({ ...state, immediate: true, params: { ...state.params, dataPermission: e } })
|
|
setState({ ...state, immediate: true, params: { ...state.params, dataPermission: e } })
|
|
|
}
|
|
}
|
|
|
- />
|
|
|
|
|
|
|
+ /> */}
|
|
|
<span className="ml-4">
|
|
<span className="ml-4">
|
|
|
<Select
|
|
<Select
|
|
|
loading={state.loading}
|
|
loading={state.loading}
|