update:拖拽优化
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
:title="diaTitle"
|
:title="diaTitle"
|
||||||
@open="openFun"
|
@open="openFun"
|
||||||
draggable
|
draggable
|
||||||
|
append-to-body
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
>
|
>
|
||||||
<template v-for="(name) in Object.keys($slots)" :key="name" #[name]="scope">
|
<template v-for="(name) in Object.keys($slots)" :key="name" #[name]="scope">
|
||||||
|
|||||||
@@ -22,15 +22,6 @@
|
|||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="btns">
|
<div class="btns">
|
||||||
<slot name="leftOptions" />
|
<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']">
|
<template v-if="$slots['cardTemplate']">
|
||||||
<el-tooltip v-if="viewType === 'list'" content="切换至卡片视图" placement="top" >
|
<el-tooltip v-if="viewType === 'list'" content="切换至卡片视图" placement="top" >
|
||||||
<div class="icon-btn" @click="viewTypeChangeFun('card')">
|
<div class="icon-btn" @click="viewTypeChangeFun('card')">
|
||||||
@@ -47,6 +38,27 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -248,11 +248,6 @@ const closeFun = () => {
|
|||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.table-form-dia {
|
.table-form-dia {
|
||||||
height: 75vh;
|
height: 75vh;
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.comp-content {
|
|
||||||
.content {
|
.content {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
.toper {
|
.toper {
|
||||||
|
|||||||
@@ -22,8 +22,20 @@
|
|||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="btns">
|
<div class="btns">
|
||||||
<slot name="leftOptions" />
|
<slot name="leftOptions" />
|
||||||
<el-button v-if="exportApi" :icon="Download" @click="exportFun">{{ $t('表格.导出') }}</el-button>
|
<el-tooltip :content="$t('表格.导出')" placement="top" >
|
||||||
<el-button v-if="showImport" :icon="Upload">{{ $t('表格.导入') }}</el-button>
|
<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" >
|
<el-tooltip :content="$t('表格.列表字段设置')" placement="top" >
|
||||||
<div class="icon-btn" @click="formDiaVisible = true">
|
<div class="icon-btn" @click="formDiaVisible = true">
|
||||||
<el-icon :size="18">
|
<el-icon :size="18">
|
||||||
|
|||||||
@@ -200,19 +200,19 @@ const onDragFun = (e: any) => {
|
|||||||
x = Math.max(0, Math.min(x, maxX));
|
x = Math.max(0, Math.min(x, maxX));
|
||||||
y = Math.max(0, Math.min(y, maxY));
|
y = Math.max(0, Math.min(y, maxY));
|
||||||
if (x <= 0) {
|
if (x <= 0) {
|
||||||
x = 0;
|
x = 5;
|
||||||
isDragging = false;
|
isDragging = false;
|
||||||
}
|
}
|
||||||
if (x >= maxX) {
|
if (x >= maxX) {
|
||||||
x = maxX;
|
x = maxX - 5;
|
||||||
isDragging = false;
|
isDragging = false;
|
||||||
}
|
}
|
||||||
if (y <= 0) {
|
if (y <= 0) {
|
||||||
y = 0;
|
y = 5;
|
||||||
isDragging = false;
|
isDragging = false;
|
||||||
}
|
}
|
||||||
if (y >= maxY) {
|
if (y >= maxY) {
|
||||||
y = maxY;
|
y = maxY - 5;
|
||||||
isDragging = false;
|
isDragging = false;
|
||||||
}
|
}
|
||||||
el.style.left = x + 'px';
|
el.style.left = x + 'px';
|
||||||
|
|||||||
@@ -193,8 +193,8 @@ export const exportFile = (api: any, tableName: string, fileName: string, params
|
|||||||
return val;
|
return val;
|
||||||
});
|
});
|
||||||
api({
|
api({
|
||||||
exportExcelFormatList: listData,
|
excelHeaders: listData,
|
||||||
...params,
|
params,
|
||||||
}, `${dayjs().format('YYYYMMDDHHmmss')}_${fileName || tableName}.xlsx`);
|
}, `${dayjs().format('YYYYMMDDHHmmss')}_${fileName || tableName}.xlsx`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -141,6 +141,7 @@
|
|||||||
v-model:showNodeInfoDialog="showNodeInfoDialog"
|
v-model:showNodeInfoDialog="showNodeInfoDialog"
|
||||||
:nodeLevel1Uuid="editId"
|
:nodeLevel1Uuid="editId"
|
||||||
dialogType="edit"
|
dialogType="edit"
|
||||||
|
@completeFun="reloadFun"
|
||||||
/>
|
/>
|
||||||
<ProjectInfoDialog
|
<ProjectInfoDialog
|
||||||
v-model="showProjectInfoDialog"
|
v-model="showProjectInfoDialog"
|
||||||
@@ -222,6 +223,7 @@ const addDiaFun = (type: string) => {
|
|||||||
ElMessage.warning('请在项目下创建阶段');
|
ElMessage.warning('请在项目下创建阶段');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
editId.value = currentData.value.relatedResourceUuid;
|
||||||
showNodeInfoDialog.value = true;
|
showNodeInfoDialog.value = true;
|
||||||
}
|
}
|
||||||
if (type === NODE_TYPE.CATEGORY) {
|
if (type === NODE_TYPE.CATEGORY) {
|
||||||
|
|||||||
Reference in New Issue
Block a user