Преглед изворни кода

Merge branch 'develop' of ssh://121.43.162.141:10022/six.fe/health.admin into develop

cc12458 пре 6 месеци
родитељ
комит
e8489971e7
3 измењених фајлова са 40 додато и 35 уклоњено
  1. 37 29
      src/pages/index/care/serviceItems.vue
  2. 2 3
      src/request/api/care.api.ts
  3. 1 3
      src/service/ServiceItemsSystem.vue

+ 37 - 29
src/pages/index/care/serviceItems.vue

@@ -22,31 +22,45 @@ const panels = shallowReactive([
 ].filter(item => !unref(item.hide)));
 
 const activePanel = ref(panels[0].id);
-const panelRef = ref<any[]>([]);
-
-function handleChange(activeKey: any) {
-  let newVal = activeKey.target.value;
-  const activeComponent = panels.findIndex(panel => {
-    return panel.id === newVal;
-  });
-  panelRef.value[activeComponent]?.send();
+const currentComponent = ref<any>(null);
+
+// 获取当前激活的组件
+const getCurrentComponent = () => {
+  return panels.find(panel => panel.id === activePanel.value);
+};
+
+// 切换面板
+function handleChange(panelId: string) {
+  activePanel.value = panelId;
+  // 延迟执行,确保新组件已经渲染完成
+  setTimeout(() => {
+    if (currentComponent.value && typeof currentComponent.value.send === 'function') {
+      currentComponent.value?.send();
+    } 
+  }, 100);
 };
 </script>
 
 <template>
   <div class="p-6">
-    <a-tabs class="panel-wrapper" v-model:activeKey="activePanel" >
-      <a-tab-pane v-for="panel in panels" :key="panel.id">
-        <component :is="panel.component" :title="panel.title" ref="panelRef"></component>
-      </a-tab-pane>
-      <template #renderTabBar>
-        <a-radio-group v-model:value="activePanel" @change="handleChange">
-          <a-radio-button v-for="panel in panels" :key="panel.id" :value="panel.id">
-            {{ panel.title }}
-          </a-radio-button>
-        </a-radio-group>
-      </template>
-    </a-tabs>
+    <!-- 标签栏 -->
+    <div class="mb-4">
+      <a-radio-group v-model:value="activePanel" @change="(e) => handleChange(e.target.value)">
+        <a-radio-button v-for="panel in panels" :key="panel.id" :value="panel.id">
+          {{ panel.title }}
+        </a-radio-button>
+      </a-radio-group>
+    </div>
+    
+    <!-- 内容区域 -->
+    <div class="content-wrapper">
+      <component 
+        :is="getCurrentComponent()?.component" 
+        :title="getCurrentComponent()?.title" 
+        ref="currentComponent"
+        :key="activePanel"
+      ></component>
+    </div>
   </div>
 </template>
 
@@ -124,15 +138,9 @@ section {
   }
 }
 
-.panel-wrapper {
-  :deep(.ant-tabs-content-holder) {
-    padding-top: 12px;
-    height: calc(100vh - 60px - 24px - 32px);
-
-    .ant-tabs-content {
-      height: 100%;
-    }
-  }
+.content-wrapper {
+  height: calc(100vh - 60px - 24px - 32px - 60px); // 减去标签栏高度
+  overflow: auto;
 }
 
 .trend-up {

+ 2 - 3
src/request/api/care.api.ts

@@ -28,7 +28,7 @@ export function supplierDeleteMethod(data: Partial<SupplierModel>) {
 //系统项目列表
 export function pageSystemCpMethod(page: number, size: number, query?: SystemIteQuery) {
   return request.Post<List<SystemItemModel>>('/fdhb-pc/conditioningManage/program/pageSystemCp', query ?? {}, {
-    // hitSource: /plan$/, // 匹配失效源
+    hitSource: /system-cp$/, // 系统项目专用缓存标识
     params: { pageNum: page, pageSize: size },
   });
 }
@@ -45,7 +45,6 @@ export function getAllSystemCpMethod() {
 }
 // 新增和编辑系统项目和新增编辑项目列表。  项目列表就是机构项目
 export function systemCpEditMethod(data: Partial<SystemItemModel>) {
-  console.log(data, 'data==>', data.addType,data.id,data.isType);
   if(data.isType === 'itemsList'){
     delete data.id;
   }
@@ -79,7 +78,7 @@ export function selectSystemCpMethod(data: Array<string>) {
 // 机构待确认列表
 export function pageOrgConfirmMethod(page: number, size: number, query?: SystemIteQuery) {
   return request.Post<List<SystemItemModel>>('/fdhb-pc/conditioningManage/program/pageUnconfirmedCp', query ?? {}, {
-    hitSource: /plan$/, // 匹配失效源
+    hitSource: /org-confirm$/, // 待确认项目专用缓存标识
     params: { pageNum: page, pageSize: size },
   });
 }

+ 1 - 3
src/service/ServiceItemsSystem.vue

@@ -152,9 +152,7 @@ onSuccess(({ data: { data } }) => {
   gridRef.value?.loadData(data);
 });
 
-// const send = () => {
-//   sendRefresh();
-// }
+
 
 onMounted(() => {
   model.value = toRaw(searchFormProps.data);