fix: 主界面最多展示数量改为5 修改路径后自动保存

This commit is contained in:
ZiuChen 2022-09-19 18:45:47 +08:00
parent fc6f1680bf
commit d9dbfba67e
2 changed files with 18 additions and 18 deletions

View File

@ -2,7 +2,7 @@
"database.path": "",
"database.maxsize": 800,
"database.maxage": 14,
"operation.shown": ["copy", "view", "collect", "remove"],
"operation.shown": ["copy", "view", "collect", "un-collect", "remove"],
"operation.custom": [
{
"id": "custom.1663583455000",

View File

@ -36,7 +36,7 @@
class="operation-select"
v-model="shown"
multiple
:multiple-limit="4"
:multiple-limit="5"
placeholder="请选择"
:teleported="false"
>
@ -93,22 +93,6 @@ const handleLinkClick = (index) => {
utools.shellOpenExternal(links[index])
}
const handlePathBtnClick = (param) => {
if (param === 'modify') {
const file = document.getElementById('database-path')
file.click()
file.onchange = (e) => {
const { files } = e.target
if (files.length > 0) {
path.value = files[0].path
}
ElMessage.info('修改成功 不要忘记点击保存按钮')
}
} else if (param === 'open') {
utools.shellShowItemInFolder(path.value)
}
}
const handleSaveBtnClick = () => {
//
if (path.value === '') {
@ -154,6 +138,22 @@ const handleSaveBtnClick = () => {
ElMessage.success('保存成功 重启插件生效')
}
const handlePathBtnClick = (param) => {
if (param === 'modify') {
const file = document.getElementById('database-path')
file.click()
file.onchange = (e) => {
const { files } = e.target
if (files.length > 0) {
path.value = files[0].path
}
handleSaveBtnClick()
}
} else if (param === 'open') {
utools.shellShowItemInFolder(path.value)
}
}
const handleRestoreBtnClick = () => {
ElMessageBox.confirm('确定要重置设置吗', '警告', {
confirmButtonText: '确定',