Просмотр исходного кода

feat: 调整统计-产品销售-通用模块跳转

lanjianrong 4 лет назад
Родитель
Сommit
2ed29b0536

+ 2 - 2
src/pages/Statistic/Product/InvoiceAggregate/index.jsx

@@ -74,14 +74,14 @@ const InvoiceAggregate = () => {
   }
   return (
     <div className="flex flex-col">
-      {!isMobile() && (
+      {!isMobile() ? (
         <div className="flex flex-row justify-between mb-4">
           <div className="card-transition bg-white w-full">
             {/* {pieData.pieLeft ? <Pie {...leftConfig} /> : null} */}
             {state.list?.length ? <Column {...columnConfig} /> : null}
           </div>
         </div>
-      )}
+      ) : null}
 
       <BasicTable
         manualRequest

+ 2 - 2
src/pages/Statistic/Product/SoftwareUsage/index.jsx

@@ -120,7 +120,7 @@ const Usage = () => {
 
   return (
     <div className="flex flex-col">
-      {!isMobile() && (
+      {!isMobile() ? (
         <div className="flex flex-row justify-between mb-4">
           <div className="card-transition  w-1/2 bg-white mr-2">
             {pieData.pieLeft ? <Pie {...leftConfig} /> : null}
@@ -129,7 +129,7 @@ const Usage = () => {
             {pieData.pieRight ? <Pie {...rightConfig} /> : null}
           </div>
         </div>
-      )}
+      ) : null}
 
       <BasicTable
         manualRequest

+ 13 - 9
src/pages/Statistic/components/OptionSelect.tsx

@@ -15,7 +15,7 @@ type OptionSelectProps = {
 const OptionSelect: React.FC<OptionSelectProps> = ({ onChange }) => {
   const [state, setState] = useState({
     optionType: opMap.STAFF,
-    opIds: null,
+    opIds: [],
     department: [],
     staff: []
   })
@@ -44,16 +44,19 @@ const OptionSelect: React.FC<OptionSelectProps> = ({ onChange }) => {
   )
   return (
     <div>
-      <Select
-        defaultValue="staff"
-        options={[
-          { label: '按部门', value: 'department' },
-          { label: '按员工', value: 'staff' }
-        ]}
-        onChange={val => setState({ ...state, optionType: val })}
-      />
+      <span className="mr-2">
+        <Select
+          defaultValue="staff"
+          options={[
+            { label: '按部门', value: 'department' },
+            { label: '按员工', value: 'staff' }
+          ]}
+          onChange={val => setState({ ...state, optionType: val, opIds: [] })}
+        />
+      </span>
       {state.optionType === opMap.STAFF ? (
         <TreeSelect
+          value={state.opIds}
           className="min-w-180px"
           defaultOpen
           treeCheckable
@@ -64,6 +67,7 @@ const OptionSelect: React.FC<OptionSelectProps> = ({ onChange }) => {
         />
       ) : (
         <TreeSelect
+          value={state.opIds}
           className="min-w-180px"
           defaultOpen
           treeData={state.department}