mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-19 13:10:16 +08:00
chore: eslint
This commit is contained in:
parent
3c10b82bab
commit
cc73104d62
@ -4,7 +4,7 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"webui:lint": "eslint . --fix",
|
"webui:lint": "eslint --fix src/**/*.{js,ts,vue}",
|
||||||
"webui:dev": "vite",
|
"webui:dev": "vite",
|
||||||
"webui:build": "vue-tsc -b && vite build",
|
"webui:build": "vue-tsc -b && vite build",
|
||||||
"webui:preview": "vite preview"
|
"webui:preview": "vite preview"
|
||||||
|
|||||||
@ -23,9 +23,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts"></script>
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.about-us {
|
.about-us {
|
||||||
|
|||||||
@ -1,7 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<t-space class="full-space">
|
<t-space class="full-space">
|
||||||
<template v-if="clientPanelData.length > 0">
|
<template v-if="clientPanelData.length > 0">
|
||||||
<t-tabs v-model="activeTab" :addable="true" theme="card" @add="showAddTabDialog" @remove="removeTab" class="full-tabs">
|
<t-tabs
|
||||||
|
v-model="activeTab"
|
||||||
|
:addable="true"
|
||||||
|
theme="card"
|
||||||
|
@add="showAddTabDialog"
|
||||||
|
@remove="removeTab"
|
||||||
|
class="full-tabs"
|
||||||
|
>
|
||||||
<t-tab-panel
|
<t-tab-panel
|
||||||
v-for="(config, idx) in clientPanelData"
|
v-for="(config, idx) in clientPanelData"
|
||||||
:key="idx"
|
:key="idx"
|
||||||
@ -12,7 +19,7 @@
|
|||||||
>
|
>
|
||||||
<component :is="resolveDynamicComponent(getComponent(config.key))" :config="config.data" />
|
<component :is="resolveDynamicComponent(getComponent(config.key))" :config="config.data" />
|
||||||
<div class="button-container">
|
<div class="button-container">
|
||||||
<t-button @click="saveConfig" style="width: 100px; height: 40px;">保存</t-button>
|
<t-button @click="saveConfig" style="width: 100px; height: 40px">保存</t-button>
|
||||||
</div>
|
</div>
|
||||||
</t-tab-panel>
|
</t-tab-panel>
|
||||||
</t-tabs>
|
</t-tabs>
|
||||||
@ -176,9 +183,9 @@
|
|||||||
userConfig.network = config;
|
userConfig.network = config;
|
||||||
const success = await setOB11Config(userConfig);
|
const success = await setOB11Config(userConfig);
|
||||||
if (success) {
|
if (success) {
|
||||||
MessagePlugin.success('配置保存成功');
|
await MessagePlugin.success('配置保存成功');
|
||||||
} else {
|
} else {
|
||||||
MessagePlugin.error('配置保存失败');
|
await MessagePlugin.error('配置保存失败');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -189,8 +196,8 @@
|
|||||||
|
|
||||||
const addTab = async () => {
|
const addTab = async () => {
|
||||||
const { name, type } = newTab.value;
|
const { name, type } = newTab.value;
|
||||||
if (clientPanelData.some(panel => panel.name === name)) {
|
if (clientPanelData.some((panel) => panel.name === name)) {
|
||||||
MessagePlugin.error('选项卡名称已存在');
|
await MessagePlugin.error('选项卡名称已存在');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const defaultConfig = structuredClone(defaultConfigs[type]);
|
const defaultConfig = structuredClone(defaultConfigs[type]);
|
||||||
@ -199,7 +206,7 @@
|
|||||||
isDialogVisible.value = false;
|
isDialogVisible.value = false;
|
||||||
await nextTick();
|
await nextTick();
|
||||||
activeTab.value = clientPanelData.length - 1;
|
activeTab.value = clientPanelData.length - 1;
|
||||||
MessagePlugin.success('选项卡添加成功');
|
await MessagePlugin.success('选项卡添加成功');
|
||||||
};
|
};
|
||||||
|
|
||||||
const removeTab = async (payload: { value: string; index: number; e: PointerEvent }) => {
|
const removeTab = async (payload: { value: string; index: number; e: PointerEvent }) => {
|
||||||
|
|||||||
@ -36,14 +36,17 @@ const props = defineProps<{
|
|||||||
|
|
||||||
const messageFormatOptions = ref([
|
const messageFormatOptions = ref([
|
||||||
{ label: 'Array', value: 'array' },
|
{ label: 'Array', value: 'array' },
|
||||||
{ label: 'String', value: 'string' }
|
{ label: 'String', value: 'string' },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
watch(() => props.config.messagePostFormat, (newValue) => {
|
watch(
|
||||||
|
() => props.config.messagePostFormat,
|
||||||
|
(newValue) => {
|
||||||
if (newValue !== 'array' && newValue !== 'string') {
|
if (newValue !== 'array' && newValue !== 'string') {
|
||||||
props.config.messagePostFormat = 'array';
|
props.config.messagePostFormat = 'array';
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -42,14 +42,17 @@ const props = defineProps<{
|
|||||||
|
|
||||||
const messageFormatOptions = ref([
|
const messageFormatOptions = ref([
|
||||||
{ label: 'Array', value: 'array' },
|
{ label: 'Array', value: 'array' },
|
||||||
{ label: 'String', value: 'string' }
|
{ label: 'String', value: 'string' },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
watch(() => props.config.messagePostFormat, (newValue) => {
|
watch(
|
||||||
|
() => props.config.messagePostFormat,
|
||||||
|
(newValue) => {
|
||||||
if (newValue !== 'array' && newValue !== 'string') {
|
if (newValue !== 'array' && newValue !== 'string') {
|
||||||
props.config.messagePostFormat = 'array';
|
props.config.messagePostFormat = 'array';
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -39,14 +39,17 @@ const props = defineProps<{
|
|||||||
|
|
||||||
const messageFormatOptions = ref([
|
const messageFormatOptions = ref([
|
||||||
{ label: 'Array', value: 'array' },
|
{ label: 'Array', value: 'array' },
|
||||||
{ label: 'String', value: 'string' }
|
{ label: 'String', value: 'string' },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
watch(() => props.config.messagePostFormat, (newValue) => {
|
watch(
|
||||||
|
() => props.config.messagePostFormat,
|
||||||
|
(newValue) => {
|
||||||
if (newValue !== 'array' && newValue !== 'string') {
|
if (newValue !== 'array' && newValue !== 'string') {
|
||||||
props.config.messagePostFormat = 'array';
|
props.config.messagePostFormat = 'array';
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -45,14 +45,17 @@ const props = defineProps<{
|
|||||||
|
|
||||||
const messageFormatOptions = ref([
|
const messageFormatOptions = ref([
|
||||||
{ label: 'Array', value: 'array' },
|
{ label: 'Array', value: 'array' },
|
||||||
{ label: 'String', value: 'string' }
|
{ label: 'String', value: 'string' },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
watch(() => props.config.messagePostFormat, (newValue) => {
|
watch(
|
||||||
|
() => props.config.messagePostFormat,
|
||||||
|
(newValue) => {
|
||||||
if (newValue !== 'array' && newValue !== 'string') {
|
if (newValue !== 'array' && newValue !== 'string') {
|
||||||
props.config.messagePostFormat = 'array';
|
props.config.messagePostFormat = 'array';
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -1,6 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<t-space class="full-space">
|
<t-space class="full-space">
|
||||||
<t-tabs v-model="activeTab" :addable="true" theme="card" @add="showAddTabDialog" @remove="removeTab" class="full-tabs">
|
<t-tabs
|
||||||
|
v-model="activeTab"
|
||||||
|
:addable="true"
|
||||||
|
theme="card"
|
||||||
|
@add="showAddTabDialog"
|
||||||
|
@remove="removeTab"
|
||||||
|
class="full-tabs"
|
||||||
|
>
|
||||||
<t-tab-panel
|
<t-tab-panel
|
||||||
v-for="(config, idx) in clientPanelData"
|
v-for="(config, idx) in clientPanelData"
|
||||||
:key="idx"
|
:key="idx"
|
||||||
@ -11,7 +18,7 @@
|
|||||||
>
|
>
|
||||||
<component :is="resolveDynamicComponent(getComponent(config.key))" :config="config.data" />
|
<component :is="resolveDynamicComponent(getComponent(config.key))" :config="config.data" />
|
||||||
<div class="button-container">
|
<div class="button-container">
|
||||||
<t-button @click="saveConfig" style="width: 100px; height: 40px;">保存</t-button>
|
<t-button @click="saveConfig" style="width: 100px; height: 40px">保存</t-button>
|
||||||
</div>
|
</div>
|
||||||
</t-tab-panel>
|
</t-tab-panel>
|
||||||
</t-tabs>
|
</t-tabs>
|
||||||
@ -183,7 +190,7 @@ 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)) {
|
if (clientPanelData.some((panel) => panel.name === name)) {
|
||||||
MessagePlugin.error('选项卡名称已存在');
|
MessagePlugin.error('选项卡名称已存在');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user