修改算法库拖动问题

This commit is contained in:
guanj
2026-06-23 21:36:43 +08:00
parent 4272f7756e
commit a324f7afcf

View File

@@ -2,33 +2,40 @@
<div class="default-main" :style="height">
<!-- 标准库 -->
<splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
<splitpanes
style="height: 100%"
class="default-theme"
id="navigation-splitpanes"
@resize="onPaneResize"
@resized="onPaneResized"
>
<pane :size="size">
<standardTree ref="treeRef"
:default-expanded-keys="monitoringPoint.state.lineId ? [monitoringPoint.state.lineId] : []"
:current-node-key="monitoringPoint.state.lineId" @node-click="handleNodeClick"
@init="handleNodeClick"></standardTree>
</pane>
<pane style="background: #fff" :style="height">
<div class="pd10" style="display: flex; justify-content: end">
<pane style="background: #fff" class="standard-pane">
<div class="pd10 standard-pane__toolbar" style="display: flex; justify-content: end">
<el-button icon="el-icon-Plus" type="primary" @click="addUser" v-if="information">新增</el-button>
<el-button icon="el-icon-Edit" type="primary" @click="editUser" v-if="information">修改</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven"
v-if="information">删除</el-button>
<el-button icon="el-icon-Download" type="primary" @click="download" v-if="flag">下载</el-button>
</div>
<el-empty v-if="url.length == 0" description="暂无数据" class="custom-empty"
:style="`height: calc(${height.height} - 60px);`" />
<div :style="`height: calc(${height.height} - 60px);overflow: auto;`" v-else>
<el-empty v-if="url.length == 0" description="暂无数据" class="custom-empty standard-pane__content" />
<div v-else class="standard-pane__content">
<div v-show="!isPaneResizing" class="standard-preview">
<vue-office-docx v-if="urlKey.includes('.doc') || urlKey.includes('.docx')" :src="url" />
<vue-office-excel v-if="urlKey.includes('.xls') || urlKey.includes('.xlsx')" :src="url"
:options="excelOptions" />
<!-- <vue-office-pdf v-if="url.includes('.pdf')" :src="url"/> -->
<iframe v-if="urlKey.includes('.pdf')" :src="url" style="width: 100%; height: 99%"></iframe>
<iframe v-if="urlKey.includes('.pdf')" :src="url" style="width: 100%; height: 100%"></iframe>
<img v-if="
urlKey.includes('.png') || urlKey.includes('.jpg') || urlKey.includes('.gif') || urlKey.includes('.bmp')
" :src="url" />
</div>
</div>
</pane>
</splitpanes>
<!-- 新增 -->
@@ -70,7 +77,16 @@ const addTreeRef = ref()
const url = ref('')
const dotList: any = ref({})
const flag: any = ref(false)
const isPaneResizing = ref(false)
const information = adminInfo.roleCode.includes('information_info')
const onPaneResize = () => {
isPaneResizing.value = true
}
const onPaneResized = () => {
requestAnimationFrame(() => {
isPaneResizing.value = false
})
}
onMounted(() => {
const dom = document.getElementById('navigation-splitpanes')
if (dom) {
@@ -166,6 +182,36 @@ const download = () => {
background: #eaeef1;
}
:deep(.splitpanes__pane) {
overflow: hidden;
}
.standard-pane {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
}
.standard-pane__toolbar {
flex-shrink: 0;
}
.standard-pane__content {
flex: 1;
min-height: 0;
overflow: auto;
}
.standard-preview {
height: 99%;
min-height: 99%;
}
:deep(.splitpanes--dragging) .standard-preview {
visibility: hidden;
}
.grid-content {
text-align: center;
}