mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
fix: 逻辑操作
This commit is contained in:
parent
41db435ef5
commit
34e96b1089
@ -183,6 +183,10 @@ const showAddTabDialog = () => {
|
|||||||
|
|
||||||
const addTab = async () => {
|
const addTab = async () => {
|
||||||
const { name, type } = newTab.value;
|
const { name, type } = newTab.value;
|
||||||
|
if (clientPanelData.some(panel => panel.name === name)) {
|
||||||
|
MessagePlugin.error('选项卡名称已存在');
|
||||||
|
return;
|
||||||
|
}
|
||||||
const defaultConfig = structuredClone(defaultConfigs[type]);
|
const defaultConfig = structuredClone(defaultConfigs[type]);
|
||||||
defaultConfig.name = name;
|
defaultConfig.name = name;
|
||||||
clientPanelData.push({ name, data: defaultConfig, key: type });
|
clientPanelData.push({ name, data: defaultConfig, key: type });
|
||||||
@ -192,9 +196,10 @@ const addTab = async () => {
|
|||||||
MessagePlugin.success('选项卡添加成功');
|
MessagePlugin.success('选项卡添加成功');
|
||||||
};
|
};
|
||||||
|
|
||||||
const removeTab = (payload: { value: string; index: number; e: PointerEvent }) => {
|
const removeTab = async (payload: { value: string; index: number; e: PointerEvent }) => {
|
||||||
clientPanelData.splice(payload.index, 1);
|
clientPanelData.splice(payload.index, 1);
|
||||||
activeTab.value = Math.max(0, activeTab.value - 1);
|
activeTab.value = Math.max(0, activeTab.value - 1);
|
||||||
|
await saveConfig();
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@ -231,3 +236,32 @@ onMounted(() => {
|
|||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<style scoped>
|
||||||
|
.full-space {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.full-tabs {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.full-tab-panel {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,17 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="other-config">
|
<div>
|
||||||
<div>
|
<t-divider content="其余配置" align="left" />
|
||||||
<t-divider content="其余配置" align="left" />
|
</div>
|
||||||
|
<div class="other-config-container">
|
||||||
|
<div class="other-config">
|
||||||
|
<t-form ref="form" :model="otherConfig" class="form">
|
||||||
|
<t-form-item label="音乐签名地址" name="musicSignUrl" class="form-item">
|
||||||
|
<t-input v-model="otherConfig.musicSignUrl" />
|
||||||
|
</t-form-item>
|
||||||
|
<t-form-item label="启用本地文件到URL" name="enableLocalFile2Url" class="form-item">
|
||||||
|
<t-switch v-model="otherConfig.enableLocalFile2Url" />
|
||||||
|
</t-form-item>
|
||||||
|
</t-form>
|
||||||
|
<div class="button-container">
|
||||||
|
<t-button @click="saveConfig">保存</t-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<t-form ref="form" :model="otherConfig" class="form">
|
|
||||||
<t-form-item label="音乐签名地址" name="musicSignUrl" class="form-item">
|
|
||||||
<t-input v-model="otherConfig.musicSignUrl" />
|
|
||||||
</t-form-item>
|
|
||||||
<t-form-item label="启用本地文件到URL" name="enableLocalFile2Url" class="form-item">
|
|
||||||
<t-switch v-model="otherConfig.enableLocalFile2Url" />
|
|
||||||
</t-form-item>
|
|
||||||
</t-form>
|
|
||||||
<t-button @click="saveConfig">保存</t-button>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -83,8 +87,20 @@ onMounted(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.other-config {
|
.other-config-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: flex-start;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.other-config {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 600px;
|
||||||
|
background: #fff;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form {
|
.form {
|
||||||
@ -98,6 +114,11 @@ onMounted(() => {
|
|||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.button-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.form-item {
|
.form-item {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user