Преглед на файлове

优化资料填报页的表单展开高度(因为顶部菜单导航记录导致的错位)

ZaiZai преди 2 години
родител
ревизия
cb52b9d66e
променени са 2 файла, в които са добавени 14 реда и са изтрити 8 реда
  1. 1 1
      src/global/components/hc-drawer/index.vue
  2. 13 7
      src/views/data-fill/components/ListItem.vue

+ 1 - 1
src/global/components/hc-drawer/index.vue

@@ -1,7 +1,7 @@
 <template>
     <Suspense v-if="isBody">
         <Teleport :to="`#${toId}`">
-            <el-drawer ref="drawerRef" :modal-class="uis" :custom-class="`hc-drawer-box ${ui}`" v-model="isShow" :with-header="false" :direction="direction" :size="size" destroy-on-close @closed="drawerClosed">
+            <el-drawer ref="drawerRef" :modal-class="uis" :class="`hc-drawer-box ${ui}`" v-model="isShow" :with-header="false" :direction="direction" :size="size" destroy-on-close @closed="drawerClosed">
                 <HcCard :title="title" :extraText="extraText" :actionSize="actionSize" :scrollbar="scrollbar" :actionUi="actionUi" v-if="isCard">
                     <template #header v-if="isSlotHeader">
                         <slot name='header'/>

+ 13 - 7
src/views/data-fill/components/ListItem.vue

@@ -32,7 +32,7 @@
                             </div>
                         </div>
                     </template>
-                    <div class="data-fill-list-item-content">
+                    <div class="data-fill-list-item-content" :style="`height: calc(100vh - ${drawType ? '555px' : '386px'} - ${menuBarShow ? 50 : 0}px);`">
                         <div class="data-fill-table-form-box">
                             <div class="hc-excel-table-form-view" :id="`table-form-${item?.pkeyId}`" />
                             <div class="hc-no-table-form" v-if="item?.isTableForm === false">
@@ -425,6 +425,8 @@ const drawType = ref(props.drawType)
 const wbsTempId = ref(props.wbsTempId);
 const tenantId = ref(props.tenantId);
 const wbsType = ref(props.wbsType);
+const menuBarShow = ref(useAppState.menuBarShow)
+
 //全局变量
 const projectId = ref(useAppState.getProjectId);
 const  componentDetail=ref({
@@ -447,12 +449,14 @@ watch(() => [
     props.primaryKeyId,
     props.contractId,
     props.projectInfo,
-], ([datas, classifyVal, primaryKeyId, cid, pInfo]) => {
+    useAppState.menuBarShow,
+], ([datas, classifyVal, primaryKeyId, cid, pInfo, menuBar]) => {
     listDatas.value = datas
     classify.value = classifyVal
     isPrimaryKeyId.value = primaryKeyId
     contractId.value = cid
     projectInfo.value = pInfo
+    menuBarShow.value = menuBar
     setFormDataNum(datas)
 })
 
@@ -1702,15 +1706,17 @@ const emit = defineEmits(['renew','offsetTop'])
 const getOffsetTop = (key = '') => {
     if (key) {
         const dom = document.getElementById(key[key.length-1])
-        if(!drawType.value){
-             if(dom?.offsetTop>=583&&ActiveKey.value.length>1){
-                 emit('offsetTop', dom?.offsetTop-583)
+        if(!drawType.value) {
+             if(dom?.offsetTop >= 583 && ActiveKey.value.length > 1){
+                const barWidth = menuBarShow.value ? 36 : 0;
+                emit('offsetTop', dom?.offsetTop - 583 + barWidth)
             }else{
                 emit('offsetTop', dom?.offsetTop)
             }
         }else {
-            if(dom.offsetTop>=424&&ActiveKey.value.length>1){
-                  emit('offsetTop', dom?.offsetTop-424)
+            if(dom.offsetTop >= 424 && ActiveKey.value.length > 1){
+                const barWidth = menuBarShow.value ? 18 : 0;
+                emit('offsetTop', dom?.offsetTop - 424 - barWidth)
             }else{
                 emit('offsetTop', dom?.offsetTop)
             }