Browse Source

附件 备注 变更记录 高度调整

master_hella_20240701
yufei0306 8 months ago
parent
commit
127fea7734
  1. 30
      src/components/Detail/src/Detail.vue

30
src/components/Detail/src/Detail.vue

@ -25,7 +25,7 @@
/> />
</ContentWrap> </ContentWrap>
<Tabs :tabsList="tabsList" :current="current" @change="change" /> <Tabs ref="tabRef" :tabsList="tabsList" :current="current" @change="change" />
<div class="flex"> <div class="flex">
<!-- 详情 --> <!-- 详情 -->
<ContentWrap class="w-[100%]" v-show="tabsList[current].label!='附件'&&tabsList[current].label!='备注'&&tabsList[current].label!='变更记录'"> <!-- 列表头部 --> <ContentWrap class="w-[100%]" v-show="tabsList[current].label!='附件'&&tabsList[current].label!='备注'&&tabsList[current].label!='变更记录'"> <!-- 列表头部 -->
@ -97,8 +97,9 @@
</DetailTable> </DetailTable>
</ContentWrap> </ContentWrap>
<!-- 附件/备注/变更记录 --> <!-- 附件/备注/变更记录 -->
<ContentWrap class="w-[100%]" v-show="tabsList[current].label=='附件'||tabsList[current].label=='备注'||tabsList[current].label=='变更记录'"> <ContentWrap class="w-[100%]" v-show="tabsList[current].label=='附件'||tabsList[current].label=='备注'||tabsList[current].label=='变更记录'" :style="{height:remarkHeight+'px'}">
<!-- 附件组件 --> <!-- 附件组件 -->
<ElScrollbar ref="scrollbar" :style="{height:(remarkHeight-40)+'px'}">
<Annex v-show="tabsList[current].label=='附件'" <Annex v-show="tabsList[current].label=='附件'"
:annexData="annexData" :annexData="annexData"
@handleAnnexSuccess="handleAnnexSuccess" @handleAnnexSuccess="handleAnnexSuccess"
@ -112,7 +113,9 @@
@remarksSubmitScuess="remarksSubmitScuess" @remarksSubmitScuess="remarksSubmitScuess"
/> />
<!-- 变更记录组件 --> <!-- 变更记录组件 -->
<ChangeRecord v-show="tabsList[current].label=='变更记录'" :changeRecordData="changeRecordData" class="mt-20px" /> </ContentWrap> <ChangeRecord v-show="tabsList[current].label=='变更记录'" :changeRecordData="changeRecordData" class="mt-20px" />
</ElScrollbar>
</ContentWrap>
</div> </div>
</el-drawer> </el-drawer>
<!-- 表格弹窗 --> <!-- 表格弹窗 -->
@ -142,6 +145,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import Annex from '@/components/Annex/src/Annex.vue' import Annex from '@/components/Annex/src/Annex.vue'
import Remarks from '@/components/Remarks/src/Remarks.vue' import Remarks from '@/components/Remarks/src/Remarks.vue'
import ChangeRecord from '@/components/ChangeRecord/src/ChangeRecord.vue' import ChangeRecord from '@/components/ChangeRecord/src/ChangeRecord.vue'
@ -350,6 +354,21 @@ if (!tabsList.value || tabsList.value && tabsList.value.length == otherList.leng
}) })
} }
// Tabs
const tabRef = ref()
//
const scrollbar = ref()
//
const remarkHeight = computed(() => {
const tab = unref(tabRef)
const tabTop = tab?.$el.getBoundingClientRect().top
const tabHeight = tab?.$el.getBoundingClientRect().height
console.log('tabTop',tabTop)
const height = window.innerHeight - (tabTop) - (tabHeight) - 60
return height
})
// //
const annexData = reactive({ const annexData = reactive({
annexList: [] annexList: []
@ -391,6 +410,11 @@ const current = ref(0)
const change = (item, index) => { const change = (item, index) => {
current.value = index current.value = index
emit('changeTabs', item) emit('changeTabs', item)
if(otherList.find(other=>other.label==item.label)){
// // --
scrollbar.value.scrollTo({ top: 0});
}
} }
// //

Loading…
Cancel
Save