update:拖拽优化

This commit is contained in:
2025-11-26 13:20:37 +08:00
parent 0ac272ae07
commit f6e004215b
7 changed files with 44 additions and 22 deletions

View File

@@ -4,6 +4,7 @@
:title="diaTitle"
@open="openFun"
draggable
append-to-body
v-bind="$attrs"
>
<template v-for="(name) in Object.keys($slots)" :key="name" #[name]="scope">

View File

@@ -22,15 +22,6 @@
<div class="item">
<div class="btns">
<slot name="leftOptions" />
<el-button v-if="exportApi" :icon="Download" @click="exportFun">{{ $t('表格.导出') }}</el-button>
<el-button v-if="showImport" :icon="Upload">{{ $t('表格.导入') }}</el-button>
<el-tooltip :content="$t('表格.列表字段设置')" placement="top" >
<div class="icon-btn" @click="formDiaVisible = true">
<el-icon :size="18">
<Setting />
</el-icon>
</div>
</el-tooltip>
<template v-if="$slots['cardTemplate']">
<el-tooltip v-if="viewType === 'list'" content="切换至卡片视图" placement="top" >
<div class="icon-btn" @click="viewTypeChangeFun('card')">
@@ -47,6 +38,27 @@
</div>
</el-tooltip>
</template>
<el-tooltip :content="$t('表格.导出')" placement="top" >
<div v-if="exportApi" class="icon-btn" @click="exportFun">
<el-icon :size="18">
<Download />
</el-icon>
</div>
</el-tooltip>
<el-tooltip :content="$t('表格.导入')" placement="top" >
<div v-if="showImport" class="icon-btn" @click="formDiaVisible = true">
<el-icon :size="18">
<Upload />
</el-icon>
</div>
</el-tooltip>
<el-tooltip :content="$t('表格.列表字段设置')" placement="top" >
<div class="icon-btn" @click="formDiaVisible = true">
<el-icon :size="18">
<Setting />
</el-icon>
</div>
</el-tooltip>
</div>
</div>
</div>

View File

@@ -248,11 +248,6 @@ const closeFun = () => {
<style lang="scss">
.table-form-dia {
height: 75vh;
}
</style>
<style lang="scss" scoped>
.comp-content {
.content {
height: 100%;
.toper {

View File

@@ -22,8 +22,20 @@
<div class="item">
<div class="btns">
<slot name="leftOptions" />
<el-button v-if="exportApi" :icon="Download" @click="exportFun">{{ $t('表格.导出') }}</el-button>
<el-button v-if="showImport" :icon="Upload">{{ $t('表格.导入') }}</el-button>
<el-tooltip :content="$t('表格.导出')" placement="top" >
<div v-if="exportApi" class="icon-btn" @click="exportFun">
<el-icon :size="18">
<Download />
</el-icon>
</div>
</el-tooltip>
<el-tooltip :content="$t('表格.导入')" placement="top" >
<div v-if="showImport" class="icon-btn" @click="formDiaVisible = true">
<el-icon :size="18">
<Upload />
</el-icon>
</div>
</el-tooltip>
<el-tooltip :content="$t('表格.列表字段设置')" placement="top" >
<div class="icon-btn" @click="formDiaVisible = true">
<el-icon :size="18">

View File

@@ -200,19 +200,19 @@ const onDragFun = (e: any) => {
x = Math.max(0, Math.min(x, maxX));
y = Math.max(0, Math.min(y, maxY));
if (x <= 0) {
x = 0;
x = 5;
isDragging = false;
}
if (x >= maxX) {
x = maxX;
x = maxX - 5;
isDragging = false;
}
if (y <= 0) {
y = 0;
y = 5;
isDragging = false;
}
if (y >= maxY) {
y = maxY;
y = maxY - 5;
isDragging = false;
}
el.style.left = x + 'px';

View File

@@ -193,8 +193,8 @@ export const exportFile = (api: any, tableName: string, fileName: string, params
return val;
});
api({
exportExcelFormatList: listData,
...params,
excelHeaders: listData,
params,
}, `${dayjs().format('YYYYMMDDHHmmss')}_${fileName || tableName}.xlsx`);
}
});

View File

@@ -141,6 +141,7 @@
v-model:showNodeInfoDialog="showNodeInfoDialog"
:nodeLevel1Uuid="editId"
dialogType="edit"
@completeFun="reloadFun"
/>
<ProjectInfoDialog
v-model="showProjectInfoDialog"
@@ -222,6 +223,7 @@ const addDiaFun = (type: string) => {
ElMessage.warning('请在项目下创建阶段');
return;
}
editId.value = currentData.value.relatedResourceUuid;
showNodeInfoDialog.value = true;
}
if (type === NODE_TYPE.CATEGORY) {