lanjianrong пре 4 година
родитељ
комит
349aa43f1c
1 измењених фајлова са 8 додато и 4 уклоњено
  1. 8 4
      src/pages/Customer/Business/index.jsx

+ 8 - 4
src/pages/Customer/Business/index.jsx

@@ -137,10 +137,14 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
     xField: 'name',
     yField: 'count',
     shape: 'pyramid',
-    conversionTag: false
+    conversionTag: false,
+    dynamicHeight: true
   }
-  const handleOnPermChange = ({ staffIds, dataPermission }) =>
+  const handleOnPermChange = ({ staffIds, dataPermission }) => {
     setState({ ...state, groupParams: { ...state.groupParams, staffIds, dataPermission } })
+    initGroupList({ staffIds, dataPermission })
+  }
+
   return (
     <div className="h-full w-full flex flex-row justify-between">
       <div className="h-full w-3/20 rounded-4px shadow-card">
@@ -154,7 +158,7 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
                 bordered={false}
                 options={groupList}
                 defaultValue={groupList[0]?.value}
-                onChange={(id, option) => {
+                onChange={async (id, option) => {
                   setState({
                     ...state,
                     params: { ...state.params, businessGroupId: id },
@@ -169,7 +173,7 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
         </div>
         <div className="p-4 bg-white " style={{ height: 'calc(100% - 1rem*2 - 20px)' }}>
           <div className="max-h-1/3">
-            <Funnel data={state.funnelData} {...conifg} />
+            {state.funnelData?.length && <Funnel data={state.funnelData} {...conifg} />}
           </div>
         </div>
       </div>