Demo:优化导出弹窗的界面

This commit is contained in:
wanglin2
2025-04-20 22:33:27 +08:00
parent eb61e24746
commit 84782f924b
15 changed files with 363 additions and 219 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -465,12 +465,6 @@ export const downTypeList = [
desc: desc:
'SimpleMindMap private format, can be used for re import, and the client can directly edit it' 'SimpleMindMap private format, can be used for re import, and the client can directly edit it'
}, },
{
name: 'JSON',
type: 'json',
icon: 'iconjson',
desc: 'Popular data exchange format that can be used for re importing'
},
{ {
name: 'Image', name: 'Image',
type: 'png', type: 'png',
@@ -507,6 +501,12 @@ export const downTypeList = [
icon: 'iconTXT', icon: 'iconTXT',
desc: 'Plain text file' desc: 'Plain text file'
}, },
{
name: 'Excel',
type: 'xlsx',
icon: 'iconfile-excel',
desc: 'Table text format, editable with Excel software'
},
{ {
name: 'FreeMind', name: 'FreeMind',
type: 'mm', type: 'mm',
@@ -514,11 +514,11 @@ export const downTypeList = [
desc: 'FreeMind software format' desc: 'FreeMind software format'
}, },
{ {
name: 'Excel', name: 'JSON',
type: 'xlsx', type: 'json',
icon: 'iconfile-excel', icon: 'iconjson',
desc: 'Table text format, editable with Excel software' desc: 'Popular data exchange format that can be used for re importing'
} },
] ]
// 编号类型列表 // 编号类型列表

View File

@@ -562,12 +562,6 @@ export const downTypeList = [
icon: 'iconwenjian', icon: 'iconwenjian',
desc: 'SimpleMindMap私有格式可用于再次导入客户端可直接编辑' desc: 'SimpleMindMap私有格式可用于再次导入客户端可直接编辑'
}, },
{
name: 'JSON',
type: 'json',
icon: 'iconjson',
desc: '流行的数据交换格式,可用于再次导入'
},
{ {
name: '图片', name: '图片',
type: 'png', type: 'png',
@@ -604,6 +598,12 @@ export const downTypeList = [
icon: 'iconTXT', icon: 'iconTXT',
desc: '纯文本文件' desc: '纯文本文件'
}, },
{
name: 'Excel',
type: 'xlsx',
icon: 'iconfile-excel',
desc: '表格文本形式可用Excel软件编辑'
},
{ {
name: 'FreeMind', name: 'FreeMind',
type: 'mm', type: 'mm',
@@ -611,11 +611,11 @@ export const downTypeList = [
desc: 'FreeMind软件格式' desc: 'FreeMind软件格式'
}, },
{ {
name: 'Excel', name: 'JSON',
type: 'xlsx', type: 'json',
icon: 'iconfile-excel', icon: 'iconjson',
desc: '表格文本形式可用Excel软件编辑' desc: '流行的数据交换格式,可用于再次导入'
} },
] ]
// 编号类型列表 // 编号类型列表

View File

@@ -464,12 +464,6 @@ export const downTypeList = [
icon: 'iconwenjian', icon: 'iconwenjian',
desc: 'SimpleMindMap私有格式可用于再次導入客戶端可直接編輯' desc: 'SimpleMindMap私有格式可用于再次導入客戶端可直接編輯'
}, },
{
name: 'JSON',
type: 'json',
icon: 'iconjson',
desc: '流行的數據交換格式,可用于再次導入'
},
{ {
name: '圖片', name: '圖片',
type: 'png', type: 'png',
@@ -506,6 +500,12 @@ export const downTypeList = [
icon: 'iconTXT', icon: 'iconTXT',
desc: '純文本文件' desc: '純文本文件'
}, },
{
name: 'Excel',
type: 'xlsx',
icon: 'iconfile-excel',
desc: '表格文本形式可用Excel軟件編輯'
},
{ {
name: 'FreeMind', name: 'FreeMind',
type: 'mm', type: 'mm',
@@ -513,11 +513,11 @@ export const downTypeList = [
desc: 'FreeMind軟件格式' desc: 'FreeMind軟件格式'
}, },
{ {
name: 'Excel', name: 'JSON',
type: 'xlsx', type: 'json',
icon: 'iconfile-excel', icon: 'iconjson',
desc: '表格文本形式可用Excel軟件編輯' desc: '流行的數據交換格式,可用于再次導入'
} },
] ]
// 編號類型列表 // 編號類型列表

View File

@@ -146,8 +146,8 @@ export default {
nodes: '节点' nodes: '节点'
}, },
dialog: { dialog: {
cancel: '取 消', cancel: '取消',
confirm: '确 定' confirm: '确定'
}, },
export: { export: {
title: '导出', title: '导出',

View File

@@ -12,16 +12,6 @@
:top="isMobile ? '20px' : '15vh'" :top="isMobile ? '20px' : '15vh'"
> >
<div class="exportContainer" :class="{ isDark: isDark }"> <div class="exportContainer" :class="{ isDark: isDark }">
<!-- 文件名称输入 -->
<div class="nameInputBox">
<span class="name">{{ $t('export.filename') }}</span>
<el-input
style="max-width: 300px"
v-model="fileName"
size="mini"
@keydown.native.stop
></el-input>
</div>
<!-- 导出类型选择 --> <!-- 导出类型选择 -->
<div class="downloadTypeSelectBox"> <div class="downloadTypeSelectBox">
<!-- 类型列表 --> <!-- 类型列表 -->
@@ -33,97 +23,123 @@
:class="{ active: exportType === item.type }" :class="{ active: exportType === item.type }"
@click="exportType = item.type" @click="exportType = item.type"
> >
<div class="icon iconfont" :class="[item.icon, item.type]"></div> <div class="typeIcon" :class="[item.type]"></div>
<div class="name">{{ item.name }}</div> <div class="name">{{ item.name }}</div>
<div class="icon checked el-icon-check"></div> <div class="icon checked el-icon-check"></div>
</div> </div>
</div> </div>
<!-- 类型内容 --> <!-- 类型内容 -->
<div class="downloadTypeContent customScrollbar"> <div class="downloadTypeContent">
<div class="contentRow"> <!-- 文件名称输入 -->
<div class="contentName">{{ $t('export.desc') }}</div> <div class="nameInputBox">
<div class="contentValue"> <div class="nameInput">
{{ currentTypeData ? currentTypeData.desc : '' }} <span class="name">{{ $t('export.filename') }}</span>
<el-input
style="max-width: 250px"
v-model="fileName"
size="mini"
@keydown.native.stop
></el-input>
</div> </div>
<span class="closeBtn el-icon-close" @click="cancel"></span>
</div> </div>
<div class="contentRow"> <!-- 配置 -->
<div class="contentName">{{ $t('export.options') }}</div> <div class="contentBox customScrollbar">
<div class="contentValue"> <div class="contentRow">
<div <div class="contentName">{{ $t('export.format') }}</div>
class="valueItem" <div class="contentValue info">
v-show="['smm', 'json'].includes(exportType)" {{ currentTypeData ? '.' + currentTypeData.type : '' }}
>
<el-checkbox v-model="widthConfig">{{
$t('export.include')
}}</el-checkbox>
</div> </div>
<div </div>
class="valueItem" <div class="contentRow">
v-show="['svg', 'png', 'pdf'].includes(exportType)" <div class="contentName">{{ $t('export.desc') }}</div>
> <div class="contentValue info">
<div class="valueSubItem" v-if="['png'].includes(exportType)"> {{ currentTypeData ? currentTypeData.desc : '' }}
<span class="name">{{ $t('export.format') }}</span> </div>
<el-radio-group v-model="imageFormat"> </div>
<el-radio label="png">PNG</el-radio> <div class="contentRow">
<el-radio label="jpg">JPG</el-radio> <div class="contentName">{{ $t('export.options') }}</div>
</el-radio-group> <div class="contentValue info" v-if="noOptions"></div>
</div> <div class="contentValue" v-else>
<div class="valueSubItem"> <div
<span class="name">{{ $t('export.paddingX') }}</span> class="valueItem"
<el-input v-show="['smm', 'json'].includes(exportType)"
style="width: 200px" >
v-model="paddingX" <el-checkbox v-model="widthConfig">{{
size="mini" $t('export.include')
@change="onPaddingChange"
@keydown.native.stop
></el-input>
</div>
<div class="valueSubItem">
<span class="name">{{ $t('export.paddingY') }}</span>
<el-input
style="width: 200px"
v-model="paddingY"
size="mini"
@change="onPaddingChange"
@keydown.native.stop
></el-input>
</div>
<div class="valueSubItem">
<span class="name">{{
this.$t('export.addFooterText')
}}</span>
<el-input
style="width: 200px"
v-model="extraText"
size="mini"
:placeholder="$t('export.addFooterTextPlaceholder')"
@keydown.native.stop
></el-input>
</div>
<div class="valueSubItem">
<el-checkbox
v-show="['png', 'pdf'].includes(exportType)"
v-model="isTransparent"
>{{ $t('export.isTransparent') }}</el-checkbox
>
</div>
<div class="valueSubItem">
<el-checkbox v-show="showFitBgOption" v-model="isFitBg">{{
$t('export.isFitBg')
}}</el-checkbox> }}</el-checkbox>
</div> </div>
<div
class="valueItem"
v-show="['svg', 'png', 'pdf'].includes(exportType)"
>
<div class="valueSubItem" v-if="['png'].includes(exportType)">
<span class="name">{{ $t('export.format') }}</span>
<el-radio-group v-model="imageFormat">
<el-radio label="png">PNG</el-radio>
<el-radio label="jpg">JPG</el-radio>
</el-radio-group>
</div>
<div class="valueSubItem">
<span class="name">{{ $t('export.paddingX') }}</span>
<el-input
style="width: 200px"
v-model="paddingX"
size="mini"
@change="onPaddingChange"
@keydown.native.stop
></el-input>
</div>
<div class="valueSubItem">
<span class="name">{{ $t('export.paddingY') }}</span>
<el-input
style="width: 200px"
v-model="paddingY"
size="mini"
@change="onPaddingChange"
@keydown.native.stop
></el-input>
</div>
<div class="valueSubItem">
<span class="name">{{
this.$t('export.addFooterText')
}}</span>
<el-input
style="width: 200px"
v-model="extraText"
size="mini"
:placeholder="$t('export.addFooterTextPlaceholder')"
@keydown.native.stop
></el-input>
</div>
<div class="valueSubItem">
<el-checkbox
v-show="['png', 'pdf'].includes(exportType)"
v-model="isTransparent"
>{{ $t('export.isTransparent') }}</el-checkbox
>
</div>
<div class="valueSubItem">
<el-checkbox v-show="showFitBgOption" v-model="isFitBg">{{
$t('export.isFitBg')
}}</el-checkbox>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
<!-- 按钮 -->
<div class="btnList">
<el-button @click="cancel" size="small">{{
$t('dialog.cancel')
}}</el-button>
<el-button type="primary" @click="confirm" size="small">{{
$t('export.confirm')
}}</el-button>
</div>
</div> </div>
</div> </div>
</div> </div>
<span slot="footer" class="dialog-footer">
<el-button @click="cancel">{{ $t('dialog.cancel') }}</el-button>
<el-button type="primary" @click="confirm">{{
$t('dialog.confirm')
}}</el-button>
</span>
</el-dialog> </el-dialog>
</template> </template>
@@ -184,6 +200,10 @@ export default {
showFitBgOption() { showFitBgOption() {
return ['png', 'pdf'].includes(this.exportType) && !this.isTransparent return ['png', 'pdf'].includes(this.exportType) && !this.isTransparent
},
noOptions() {
return ['md', 'xmind', 'txt', 'xlsx', 'mm'].includes(this.exportType)
} }
}, },
created() { created() {
@@ -284,14 +304,10 @@ export default {
.nodeExportDialog { .nodeExportDialog {
.exportContainer { .exportContainer {
&.isDark { &.isDark {
.nameInputBox {
.name {
color: hsla(0, 0%, 100%, 0.6);
}
}
.downloadTypeSelectBox { .downloadTypeSelectBox {
.downloadTypeList { .downloadTypeList {
background-color: #363b3f;
.downloadTypeItem { .downloadTypeItem {
background-color: #363b3f; background-color: #363b3f;
@@ -306,15 +322,39 @@ export default {
} }
.downloadTypeContent { .downloadTypeContent {
.contentRow { .nameInputBox {
.contentName { border-bottom: 1px solid hsla(0, 0%, 100%, 0.6);
color: hsla(0, 0%, 100%, 0.6);
.nameInput {
.name {
color: hsla(0, 0%, 100%, 0.6);
}
} }
.contentValue { .closeBtn {
color: hsla(0, 0%, 100%, 0.6); color: hsla(0, 0%, 100%, 0.6);
} }
} }
.contentBox {
.contentRow {
.contentName {
color: hsla(0, 0%, 100%, 0.6);
}
.contentValue {
color: hsla(0, 0%, 100%, 0.6);
&.info {
background-color: transparent;
}
}
}
}
.btnList {
border-top: 1px solid hsla(0, 0%, 100%, 0.6);
}
} }
} }
} }
@@ -332,10 +372,17 @@ export default {
} }
} }
/deep/ .el-dialog {
border-radius: 10px;
overflow: hidden;
.el-dialog__header {
display: none;
}
}
/deep/ .el-dialog__body { /deep/ .el-dialog__body {
padding: 0; padding: 0;
border-top: 1px solid #f2f4f7;
border-bottom: 1px solid #f2f4f7;
.el-checkbox__input.is-checked + .el-checkbox__label { .el-checkbox__input.is-checked + .el-checkbox__label {
color: #409eff !important; color: #409eff !important;
@@ -359,11 +406,13 @@ export default {
align-items: center; align-items: center;
overflow-x: auto; overflow-x: auto;
height: 60px; height: 60px;
overflow-y: hidden;
.downloadTypeItem { .downloadTypeItem {
width: 100px; width: 100px;
flex-shrink: 0; flex-shrink: 0;
padding-left: 10px; padding-left: 5px;
padding-right: 5px;
.icon { .icon {
margin-right: 5px; margin-right: 5px;
@@ -376,21 +425,33 @@ export default {
} }
.downloadTypeContent { .downloadTypeContent {
.contentRow { .nameInputBox {
flex-direction: column; height: 70px;
.contentName { .nameInput {
margin-bottom: 10px; .name {
margin-bottom: 5px;
}
} }
}
.contentValue { .contentBox {
.valueItem { .contentRow {
.valueSubItem { flex-direction: column;
display: flex;
flex-direction: column;
.name { .contentName {
margin-bottom: 5px; margin-bottom: 10px;
}
.contentValue {
.valueItem {
.valueSubItem {
display: flex;
flex-direction: column;
.name {
margin-bottom: 5px;
}
} }
} }
} }
@@ -403,25 +464,11 @@ export default {
.exportContainer { .exportContainer {
width: 100%; width: 100%;
height: 450px; height: 552px;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.nameInputBox {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
height: 50px;
flex-shrink: 0;
border-bottom: 1px solid #f2f4f7;
.name {
margin-right: 10px;
}
}
.downloadTypeSelectBox { .downloadTypeSelectBox {
width: 100%; width: 100%;
height: 100%; height: 100%;
@@ -429,17 +476,18 @@ export default {
display: flex; display: flex;
.downloadTypeList { .downloadTypeList {
width: 210px; width: 208px;
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
background-color: #f2f4f7; background-color: #f2f4f7;
flex-shrink: 0; flex-shrink: 0;
padding: 16px 0;
.downloadTypeItem { .downloadTypeItem {
width: 100%; width: 100%;
height: 60px; height: 52px;
padding-left: 28px; padding: 0 30px;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
align-items: center; align-items: center;
@@ -457,40 +505,7 @@ export default {
.icon { .icon {
font-size: 25px; font-size: 25px;
margin-right: 15px; font-weight: 700;
flex-shrink: 0;
&.png {
color: #ffc038;
}
&.pdf {
color: #ff6c4d;
}
&.md {
color: #2b2b2b;
}
&.json {
color: #12c87e;
}
&.svg {
color: #4380ff;
}
&.smm {
color: #409eff;
}
&.xmind {
color: #f55e5e;
}
&.txt {
color: #70798e;
}
&.checked { &.checked {
color: #409eff; color: #409eff;
@@ -500,53 +515,182 @@ export default {
} }
} }
.typeIcon {
margin-right: 18px;
flex-shrink: 0;
width: 23px;
height: 26px;
background-size: cover;
&.png {
background-image: url('../../../assets/img/foramt/2.png');
}
&.pdf {
background-image: url('../../../assets/img/foramt/4.png');
}
&.md {
background-image: url('../../../assets/img/foramt/5.png');
}
&.json {
background-image: url('../../../assets/img/foramt/10.png');
}
&.svg {
background-image: url('../../../assets/img/foramt/3.png');
}
&.smm {
background-image: url('../../../assets/img/foramt/1.png');
}
&.xmind {
background-image: url('../../../assets/img/foramt/6.png');
}
&.txt {
background-image: url('../../../assets/img/foramt/7.png');
}
&.mm {
background-image: url('../../../assets/img/foramt/8.png');
}
&.xlsx {
background-image: url('../../../assets/img/foramt/9.png');
}
}
.name { .name {
color: #1a1a1a; color: #333;
font-size: 15px; font-size: 15px;
margin-bottom: 5px;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
font-weight: bold;
} }
} }
} }
.downloadTypeContent { .downloadTypeContent {
padding: 30px; width: 100%;
height: 100%; height: 100%;
overflow-y: auto; display: flex;
overflow-x: hidden; flex-direction: column;
overflow: hidden;
.contentRow { .nameInputBox {
display: flex; display: flex;
font-size: 14px; align-items: center;
margin-bottom: 20px; justify-content: space-between;
height: 67px;
flex-shrink: 0;
border-bottom: 1px solid #f2f4f7;
padding-left: 40px;
padding-right: 20px;
padding-top: 16px;
.contentName { .nameInput {
width: 80px; display: flex;
color: #666; flex-wrap: wrap;
align-items: center;
width: 100%;
font-weight: bold;
.name {
margin-right: 10px;
font-size: 15px;
color: #333;
font-weight: bold;
}
} }
.contentValue { .closeBtn {
color: #1a1a1a; font-size: 20px;
cursor: pointer;
}
}
.valueItem { .contentBox {
.valueSubItem { height: 100%;
margin-bottom: 12px; overflow-y: auto;
display: flex; overflow-x: hidden;
padding: 15px 40px;
&:last-of-type { .contentRow {
margin-right: 0; display: flex;
} font-size: 14px;
margin-bottom: 20px;
.name { &:last-of-type {
margin-right: 12px; margin-bottom: 0;
width: 100px; }
.contentName {
width: 45px;
color: #808080;
flex-shrink: 0;
font-size: 13px;
font-weight: 500;
line-height: 25px;
}
.contentValue {
color: #808080;
line-height: 23px;
font-weight: 500;
border: 1px solid transparent;
font-size: 14px;
&.info {
color: rgb(90, 158, 247);
background-color: rgb(245, 248, 249);
border: 1px solid rgb(90, 158, 247);
border-radius: 5px;
padding: 0 16px;
}
.valueItem {
.valueSubItem {
margin-bottom: 12px;
display: flex;
align-items: center;
&:last-of-type {
margin-right: 0;
}
&.alignCenter {
align-items: center;
}
.name {
margin-right: 12px;
width: 85px;
}
} }
} }
} }
} }
} }
.btnList {
padding: 0 40px;
display: flex;
align-items: center;
justify-content: flex-end;
height: 69px;
flex-shrink: 0;
border-top: 1px solid #f2f4f7;
/deep/ .el-button--small {
height: 25px;
padding: 0 30px;
border-radius: 5px;
}
}
} }
} }
} }