|
@@ -69,8 +69,8 @@
|
|
</el-button>
|
|
</el-button>
|
|
</HcTooltip> -->
|
|
</HcTooltip> -->
|
|
</template>
|
|
</template>
|
|
- <div :class="tableFileShow ? 'file-table' : ''" class="body">
|
|
|
|
- <div class="hc-c-table-box">
|
|
|
|
|
|
+ <div class="flex-container body">
|
|
|
|
+ <div class="hc-c-table-box" :style="{ flex: tableFileShow ? '1' : 'auto' }">
|
|
<HcTable
|
|
<HcTable
|
|
ref="tableRef" :check-style="{ width: 29 }" :column="tableColumn" :datas="tableData"
|
|
ref="tableRef" :check-style="{ width: 29 }" :column="tableColumn" :datas="tableData"
|
|
:index-style="{ width: 70 }" :is-arr-index="false" :loading="tableLoading" :ui="hoverHand ? 'hover-hand' : ''"
|
|
:index-style="{ width: 70 }" :is-arr-index="false" :loading="tableLoading" :ui="hoverHand ? 'hover-hand' : ''"
|
|
@@ -89,14 +89,24 @@
|
|
</template>
|
|
</template>
|
|
</HcTable>
|
|
</HcTable>
|
|
</div>
|
|
</div>
|
|
- <div v-if="tableFileShow" class="hc-f-table-box">
|
|
|
|
|
|
+ <div v-if="tableFileShow" class="hc-f-table-box" :style="{ flex: tableFileShow ? 'auto' : '0' }">
|
|
<div class="header-box">
|
|
<div class="header-box">
|
|
<div class="header">卷内文件</div>
|
|
<div class="header">卷内文件</div>
|
|
|
|
+
|
|
|
|
+ <el-tooltip
|
|
|
|
+
|
|
|
|
+ effect="light"
|
|
|
|
+ content="按住鼠标拖动可改变表格高度"
|
|
|
|
+ placement="top"
|
|
|
|
+ >
|
|
|
|
+ <HcIcon class="hc-icon-close text-hover" name="arrow-up-double" style="color:rgb(64, 149, 229);" @mousedown="startDrag($event)" />
|
|
|
|
+ </el-tooltip>
|
|
<div>
|
|
<div>
|
|
<HcIcon class="hc-icon-close text-hover" name="edit" style=" color:rgb(64, 149, 229);" @click="batchEditClick(2)" />
|
|
<HcIcon class="hc-icon-close text-hover" name="edit" style=" color:rgb(64, 149, 229);" @click="batchEditClick(2)" />
|
|
- <!-- <HcIcon name="delete-bin" @click="delModalClick" class="hc-icon-close text-hover"
|
|
|
|
- style="margin-left:5px;margin-right:5px;color: rgb(189, 49, 36);"/> -->
|
|
|
|
- <HcIcon class="hc-icon-close 'text-hover'" name="close" style=" color:rgb(64, 149, 229);" @click="closetableFile" />
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <HcIcon class="hc-icon-close text-hover" name="close" style=" color:rgb(64, 149, 229);" @click="closetableFile" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="hc-file-table-box">
|
|
<div class="hc-file-table-box">
|
|
@@ -299,7 +309,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import { onMounted, ref, watch } from 'vue'
|
|
|
|
|
|
+import { nextTick, onMounted, ref, watch } from 'vue'
|
|
import { useAppStore } from '~src/store'
|
|
import { useAppStore } from '~src/store'
|
|
import HcTree from '~src/components/tree/hc-tree.vue'
|
|
import HcTree from '~src/components/tree/hc-tree.vue'
|
|
import { arrToId, deepClone, getArrValue } from 'js-fast-way'
|
|
import { arrToId, deepClone, getArrValue } from 'js-fast-way'
|
|
@@ -482,6 +492,31 @@ const tableSelection = (rows) => {
|
|
const intableSelection = (rows) => {
|
|
const intableSelection = (rows) => {
|
|
intableCheckedKeys.value = rows
|
|
intableCheckedKeys.value = rows
|
|
}
|
|
}
|
|
|
|
+const isDragging = ref(false) // 添加一个标志来跟踪鼠标是否按下
|
|
|
|
+const startDrag = (event) => {
|
|
|
|
+ isDragging.value = true // 鼠标按下时设置标志为true
|
|
|
|
+ const startY = event.clientY
|
|
|
|
+ const initialHeight = document.querySelector('.hc-f-table-box').offsetHeight
|
|
|
|
+
|
|
|
|
+ document.onmousemove = (moveEvent) => {
|
|
|
|
+ console.log(isDragging.value, 'isDragging.value')
|
|
|
|
+
|
|
|
|
+ if (isDragging.value) { // 确保只有在鼠标按下时才会改变高度
|
|
|
|
+ const moveY = moveEvent.clientY
|
|
|
|
+ const deltaY = startY - moveY // 修改这里,使用 startY 减去 moveY
|
|
|
|
+ const newHeight = Math.max(50, initialHeight + deltaY) // 最小高度设为50
|
|
|
|
+
|
|
|
|
+ document.querySelector('.hc-f-table-box').style.height = `${newHeight}px`
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ document.onmouseup = () => {
|
|
|
|
+
|
|
|
|
+ document.onmousemove = null
|
|
|
|
+ document.onmouseup = null
|
|
|
|
+ isDragging.value = false // 鼠标释放时设置标志为false
|
|
|
|
+ }
|
|
|
|
+}
|
|
//删除
|
|
//删除
|
|
const delModalClick = () => {
|
|
const delModalClick = () => {
|
|
|
|
|
|
@@ -657,10 +692,20 @@ const checkInid = ref('')
|
|
const checkRow = ref({})
|
|
const checkRow = ref({})
|
|
const tableRowClick = ({ row }) => {
|
|
const tableRowClick = ({ row }) => {
|
|
tableFileShow.value = true
|
|
tableFileShow.value = true
|
|
|
|
+
|
|
checkRow.value = row
|
|
checkRow.value = row
|
|
checkInid.value = row.id
|
|
checkInid.value = row.id
|
|
setInnertableColumn()
|
|
setInnertableColumn()
|
|
getintableData()
|
|
getintableData()
|
|
|
|
+
|
|
|
|
+ // 限制 hc-f-table-box 的初始高度不超过容器的一半
|
|
|
|
+ nextTick(()=>{
|
|
|
|
+ const containerHeight = document.querySelector('.flex-container').clientHeight
|
|
|
|
+ const maxHeight = containerHeight / 6
|
|
|
|
+ const initialHeight = Math.min(document.querySelector('.hc-f-table-box').offsetHeight, maxHeight)
|
|
|
|
+ document.querySelector('.hc-f-table-box').style.height = `${initialHeight}px`
|
|
|
|
+ })
|
|
|
|
+
|
|
}
|
|
}
|
|
//收起卷内文件
|
|
//收起卷内文件
|
|
const closetableFile = () => {
|
|
const closetableFile = () => {
|
|
@@ -1134,3 +1179,31 @@ const combinationClick = async ()=>{
|
|
height: auto;
|
|
height: auto;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|
|
|
|
+
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+@import '~style/archives/tuning.scss';
|
|
|
|
+
|
|
|
|
+.flex-container {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ height: 100%;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.hc-c-table-box {
|
|
|
|
+ flex: 1; /* 默认占据所有空间 */
|
|
|
|
+ overflow-y: auto; /* 允许垂直滚动 */
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.hc-f-table-box {
|
|
|
|
+ flex: 0; /* 初始时不占据空间 */
|
|
|
|
+ overflow-y: auto; /* 允许垂直滚动 */
|
|
|
|
+ transition: flex 0.3s ease; /* 添加过渡效果 */
|
|
|
|
+}
|
|
|
|
+.drag-icon {
|
|
|
|
+ cursor: ns-resize;
|
|
|
|
+ user-select: none;
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 20px;
|
|
|
|
+ top: 10px;
|
|
|
|
+}
|
|
|
|
+</style>
|