Browse Source

解决bug:注册页面筛选区域,点击协议按钮后查询的是view,点击view按钮查询的是协议,正常情况下应该是点击协议查询协议,点击view查询view

dengdx 2 months ago
parent
commit
746cf1a6db

+ 1 - 1
src/pages/patient/components/RegisterAvailableFilterBar.tsx

@@ -63,7 +63,7 @@ const RegisterAvailableFilterBar: React.FC<Props> = ({
               dispatch(setSelected(val as 'protocol' | 'view'));
               dispatch(
                 fetchViewsOrProtocols({
-                  selection: selected,
+                  selection: val as 'protocol' | 'view',
                   patientType: currentPatientType?.patient_type_id ?? null,
                   bodyPart: currentBodyPart?.body_part_id ?? null,
                 })

+ 2 - 0
src/states/patient/viewSelection/index.ts

@@ -140,6 +140,8 @@ export const fetchViewsOrProtocols = createAsyncThunk(
   'data/fetchData',
   async (filter: FilterCondition, { rejectWithValue }) => {
     try {
+      console.log(`触发查询,查询条件是:${JSON.stringify(filter)}`);
+
       if (filter.selection === 'protocol') {
         const response = await fetchProcedures(
           filter.patientType,