|
|
@@ -11,12 +11,12 @@ import { useTableScroll } from '@/hooks/useAutoTable'
|
|
|
import CompanyDetail from '../Company/components/CompanyDetail'
|
|
|
import { Funnel } from '@ant-design/charts'
|
|
|
|
|
|
-const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
|
|
|
+const Business = ({ dispatch, groupList, shouldUpdate, permData, loading }) => {
|
|
|
const tRef = useRef(null)
|
|
|
const { toggleDrawer, setDrawerProps } = useModal()
|
|
|
const [state, setState] = useState({
|
|
|
orderIds: [],
|
|
|
- businessGroupId: null,
|
|
|
+ params: { businessGroupId: null },
|
|
|
funnelData: []
|
|
|
})
|
|
|
useEffect(() => {
|
|
|
@@ -29,7 +29,7 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
|
|
|
const group = groupList[0]
|
|
|
setState({
|
|
|
...state,
|
|
|
- businessGroupId: group.value,
|
|
|
+ params: { ...state.params, businessGroupId: group.value },
|
|
|
funnelData: group.items
|
|
|
?.filter(item => !item.endProcess)
|
|
|
?.map(item => ({ ...item, percentage: parseInt(item.percentage, 10) }))
|
|
|
@@ -122,7 +122,7 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
|
|
|
const conifg = {
|
|
|
xField: 'name',
|
|
|
yField: 'count',
|
|
|
- legend: false,
|
|
|
+ // legend: false,
|
|
|
shape: 'pyramid',
|
|
|
conversionTag: false
|
|
|
}
|
|
|
@@ -161,11 +161,11 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
|
|
|
</div>
|
|
|
<div className="w-17/20">
|
|
|
<div className="ml-8 bg-white shadow-card">
|
|
|
- {state.businessGroupId ? (
|
|
|
+ {state.params.businessGroupId ? (
|
|
|
<ProTable
|
|
|
bordered
|
|
|
actionRef={tRef}
|
|
|
- params={{ businessGroupId: state.businessGroupId }}
|
|
|
+ params={state.params}
|
|
|
rowKey={record => record.id}
|
|
|
columns={columns}
|
|
|
onLoadingChange={loadingStatus => {
|
|
|
@@ -184,6 +184,16 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
|
|
|
total
|
|
|
}
|
|
|
}}
|
|
|
+ headerTitle={
|
|
|
+ <Select
|
|
|
+ defaultValue="oneself"
|
|
|
+ dropdownMatchSelectWidth={false}
|
|
|
+ onChange={e => {
|
|
|
+ setState({ ...state, params: { ...state.params, dataPermission: e } })
|
|
|
+ }}
|
|
|
+ options={permData?.customer || []}
|
|
|
+ />
|
|
|
+ }
|
|
|
search={false}
|
|
|
toolbar={{
|
|
|
actions: [
|
|
|
@@ -202,8 +212,9 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
|
|
|
)
|
|
|
}
|
|
|
|
|
|
-export default connect(({ business, refresh, loading }) => ({
|
|
|
+export default connect(({ business, refresh, global, loading }) => ({
|
|
|
groupList: business.groupList,
|
|
|
loading: loading.models.business,
|
|
|
- shouldUpdate: refresh.business
|
|
|
+ shouldUpdate: refresh.business,
|
|
|
+ permData: global.premData
|
|
|
}))(Business)
|