-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
5,041 additions
and
4,630 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "MegSpot", | ||
"version": "v2.2.5", | ||
"version": "v2.2.6", | ||
"author": "weiyajun <[email protected]>", | ||
"description": "A tool to improve the viewing of pictures and videos by researchers", | ||
"homepage": "https://github.com/MegEngine/MegSpot", | ||
|
@@ -44,8 +44,8 @@ | |
"appId": "org.megvii.megspot", | ||
"copyright": " Copyright (c) 2022 Megvii Inc. All rights reserved.", | ||
"releaseInfo": { | ||
"releaseNotes": "新增功能:\n 1. 视频对比中支持并默认启用视频进度同步功能,可在工具栏最右侧的图像设置中进行更改,详情请见github wiki说明", | ||
"releaseDate": "2023.12.17" | ||
"releaseNotes": "新增功能:\n 1. 支持新建任意行数、列数的布局配置", | ||
"releaseDate": "2024.02.07" | ||
}, | ||
"directories": { | ||
"output": "build" | ||
|
@@ -229,6 +229,7 @@ | |
} | ||
}, | ||
"volta": { | ||
"node": "16.20.2" | ||
"node": "16.20.2", | ||
"yarn": "1.22.21" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<template> | ||
<el-dialog :title="$t('image.layout.dialogTitle')" :visible.sync="dialogVisible" center width="600px"> | ||
<div class="config-list"> | ||
<div class="config-item"> | ||
<b>{{ $t('image.layout.rowLabel') }}:</b> | ||
<el-input-number v-model.number="rows" :min="1" step="1" step-strictly></el-input-number> | ||
</div> | ||
<div class="config-item"> | ||
<b>{{ $t('image.layout.columnLabel') }}:</b> | ||
<el-input-number v-model.number="columns" :min="1" step="1" step-strictly></el-input-number> | ||
</div> | ||
</div> | ||
<span slot="footer" class="dialog-footer"> | ||
<el-button @click="dialogVisible = false">{{ $t('common.cancel') }}</el-button> | ||
<el-button type="primary" @click="handleCreateNewLayout">{{ $t('image.layout.confirm') }}</el-button> | ||
</span> | ||
</el-dialog> | ||
</template> | ||
|
||
<script> | ||
import { createNamespacedHelpers } from 'vuex' | ||
const { mapGetters: imageMapGetters, mapActions: imageMapActions } = createNamespacedHelpers('imageStore') | ||
const { mapGetters: videoMapGetters, mapActions: videoMapActions } = createNamespacedHelpers('videoStore') | ||
const { mapGetters: preferenceMapGetters, mapActions: preferenceMapActions } = | ||
createNamespacedHelpers('preferenceStore') | ||
import { i18nRender } from '@/lang' | ||
export default { | ||
data() { | ||
return { | ||
dialogVisible: false, | ||
rows: 1, | ||
columns: 1 | ||
} | ||
}, | ||
computed: { | ||
...preferenceMapGetters(['preference']), | ||
...imageMapGetters(['imageList', 'imageConfig']), | ||
...videoMapGetters(['videoList', 'videoConfig']) | ||
}, | ||
methods: { | ||
...preferenceMapActions(['setPreference']), | ||
...imageMapActions(['setImageConfig']), | ||
...videoMapActions(['setVideoConfig']), | ||
show() { | ||
this.dialogVisible = true | ||
}, | ||
handleCreateNewLayout() { | ||
const newLayout = `${this.rows}x${this.columns}` | ||
if (this.preference.layouts.includes(newLayout)) { | ||
this.$message.info(i18nRender('image.layout.layoutExists')) | ||
} else { | ||
const newLayouts = [newLayout, ...this.preference.layouts] | ||
newLayouts.sort() | ||
this.setPreference({ | ||
layouts: newLayouts | ||
}) | ||
this.$message.success(i18nRender('image.layout.successAdded') + `:${newLayout}`) | ||
if ( | ||
(this.$route.path.includes('image') && | ||
this.imageConfig.layout !== newLayout && | ||
this.imageList.length >= this.rows * this.columns) || | ||
(this.$route.path.includes('video') && | ||
this.videoConfig.layout !== newLayout && | ||
this.videoList.length >= this.rows * this.columns) | ||
) { | ||
this.$confirm( | ||
i18nRender('image.layout.confirmUseNewLayout') + '?', | ||
i18nRender('image.layout.confirmDialogTitle'), | ||
{ | ||
confirmButtonText: i18nRender('image.layout.confirmUse'), | ||
cancelButtonText: i18nRender('common.cancel'), | ||
type: 'info', | ||
'append-to-body': true | ||
} | ||
).then(() => { | ||
if (this.$route.path.includes('image')) { | ||
this.setImageConfig({ layout: newLayout }) | ||
} else if (this.$route.path.includes('video')) { | ||
this.setVideoConfig({ layout: newLayout }) | ||
} | ||
}) | ||
} | ||
} | ||
this.dialogVisible = false | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.config-list { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 20px; | ||
.config-item { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 16px; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.