|
@@ -1,7 +1,6 @@
|
|
|
import React, { useState, useEffect, useRef } from 'react'
|
|
import React, { useState, useEffect, useRef } from 'react'
|
|
|
import { connect } from 'umi'
|
|
import { connect } from 'umi'
|
|
|
import { getBusinessList } from '@/services/customer'
|
|
import { getBusinessList } from '@/services/customer'
|
|
|
-import ProTable from '@ant-design/pro-table'
|
|
|
|
|
import consts from '@/consts'
|
|
import consts from '@/consts'
|
|
|
import { Select } from 'antd'
|
|
import { Select } from 'antd'
|
|
|
import AddBusiness from './components/AddBusiness'
|
|
import AddBusiness from './components/AddBusiness'
|
|
@@ -9,8 +8,7 @@ import Detail from './components/BusinessDetail'
|
|
|
import { useModal } from '@/components/Modal'
|
|
import { useModal } from '@/components/Modal'
|
|
|
import CompanyDetail from '../Company/components/CompanyDetail'
|
|
import CompanyDetail from '../Company/components/CompanyDetail'
|
|
|
import { Funnel } from '@ant-design/charts'
|
|
import { Funnel } from '@ant-design/charts'
|
|
|
-import PermSelect from '../Company/components/PermSelect'
|
|
|
|
|
-import { PermDataTypeEunm } from '../Company/components/PermSelect'
|
|
|
|
|
|
|
+import BasicTable from '@/components/Table'
|
|
|
|
|
|
|
|
const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
|
|
const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
|
|
|
const tRef = useRef(null)
|
|
const tRef = useRef(null)
|
|
@@ -21,8 +19,6 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
|
|
|
funnelData: []
|
|
funnelData: []
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- // const { initialState: { permData } = { permData: {} } } = useModel('@@initialState')
|
|
|
|
|
-
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
if (!groupList) {
|
|
if (!groupList) {
|
|
|
dispatch({
|
|
dispatch({
|
|
@@ -131,20 +127,9 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
|
|
|
const conifg = {
|
|
const conifg = {
|
|
|
xField: 'name',
|
|
xField: 'name',
|
|
|
yField: 'count',
|
|
yField: 'count',
|
|
|
- // legend: false,
|
|
|
|
|
shape: 'pyramid',
|
|
shape: 'pyramid',
|
|
|
conversionTag: false
|
|
conversionTag: false
|
|
|
}
|
|
}
|
|
|
- // const { getScrollRef, redoHeight } = useTableScroll(columns)
|
|
|
|
|
-
|
|
|
|
|
- // 处理权限Select下拉组件OnChange事件
|
|
|
|
|
- const handlePermChange = ({ staffIds = [], dataPermission }) => {
|
|
|
|
|
- if (staffIds?.length) {
|
|
|
|
|
- setState({ ...state, params: { ...state.params, staffIds, dataPermission: null } })
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- setState({ ...state, params: { ...state.params, staffIds: null, dataPermission } })
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<div className="h-full w-full flex flex-row justify-between">
|
|
<div className="h-full w-full flex flex-row justify-between">
|
|
@@ -181,9 +166,10 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
|
|
|
<div className="w-17/20">
|
|
<div className="w-17/20">
|
|
|
<div className="ml-8 bg-white shadow-card">
|
|
<div className="ml-8 bg-white shadow-card">
|
|
|
{state.params.businessGroupId ? (
|
|
{state.params.businessGroupId ? (
|
|
|
- <ProTable
|
|
|
|
|
- bordered
|
|
|
|
|
|
|
+ <BasicTable
|
|
|
actionRef={tRef}
|
|
actionRef={tRef}
|
|
|
|
|
+ mainMenuType="customer"
|
|
|
|
|
+ columnStateType="BUSINESS"
|
|
|
params={state.params}
|
|
params={state.params}
|
|
|
rowKey={record => record.id}
|
|
rowKey={record => record.id}
|
|
|
columns={columns}
|
|
columns={columns}
|
|
@@ -199,9 +185,6 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
|
|
|
total
|
|
total
|
|
|
}
|
|
}
|
|
|
}}
|
|
}}
|
|
|
- headerTitle={
|
|
|
|
|
- <PermSelect onConfirm={handlePermChange} dataType={PermDataTypeEunm.CUSTOMER} />
|
|
|
|
|
- }
|
|
|
|
|
search={false}
|
|
search={false}
|
|
|
toolbar={{
|
|
toolbar={{
|
|
|
actions: [
|
|
actions: [
|