diff --git a/bun.lockb b/bun.lockb index 0ed1661..508439b 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index ac9456e..2e3f4b4 100644 --- a/package.json +++ b/package.json @@ -28,12 +28,14 @@ "@tauri-apps/plugin-store": "^2.2.0", "@tauri-apps/plugin-updater": "^2.7.0", "@types/crypto-js": "^4.2.2", + "@types/md5": "^2.3.5", "@typescript-eslint/eslint-plugin": "^8.27.0", "@vicons/fluent": "^0.13.0", "@vitejs/plugin-basic-ssl": "^2.0.0", "@vitejs/plugin-vue": "^5.2.3", "@vue/cli": "^5.0.8", "@vueuse/core": "^13.0.0", + "@vueuse/integrations": "^13.1.0", "@vueuse/router": "^13.0.0", "@wangeditor/editor": "^5.1.23", "@wangeditor/editor-for-vue": "^5.1.12", @@ -50,7 +52,9 @@ "file-saver": "^2.0.5", "grapheme-splitter": "^1.0.4", "html2canvas": "^1.4.1", + "idb-keyval": "^6", "linqts": "^2.0.0", + "md5": "^2.3.0", "mitt": "^3.0.1", "monaco-editor": "^0.52.2", "music-metadata-browser": "^2.5.11", @@ -85,7 +89,6 @@ "@types/bun": "^1.2.5", "@types/eslint": "^9.6.1", "@types/file-saver": "^2.0.7", - "@types/node": "^22.14.1", "@types/obs-studio": "^2.17.2", "@types/uuid": "^10.0.0", "@typescript-eslint/parser": "^8.27.0", diff --git a/src/client/ClientAutoAction.vue b/src/client/ClientAutoAction.vue index d100f82..dc2b226 100644 --- a/src/client/ClientAutoAction.vue +++ b/src/client/ClientAutoAction.vue @@ -1,93 +1,652 @@ \ No newline at end of file diff --git a/src/client/ClientDanmakuWindow.vue b/src/client/ClientDanmakuWindow.vue index 49006d4..dc56374 100644 --- a/src/client/ClientDanmakuWindow.vue +++ b/src/client/ClientDanmakuWindow.vue @@ -43,6 +43,13 @@ // 动画和阴影 root.style.setProperty('--dw-animation-duration', `${setting.value.animationDuration || 300}ms`); root.style.setProperty('--dw-shadow', setting.value.enableShadow ? `0 0 10px ${setting.value.shadowColor}` : 'none'); + + // 根据 enableAnimation 设置 data-animation-disabled 属性 + if (setting.value.enableAnimation) { + root.removeAttribute('data-animation-disabled'); + } else { + root.setAttribute('data-animation-disabled', 'true'); + } } function addDanmaku(data: EventModel) { @@ -287,6 +294,7 @@ transition-duration: 100ms !important; } + /* 动画相关样式 - 根据 enableAnimation 设置应用 */ /* 1. declare transition */ .danmaku-list-move, .danmaku-list-enter-active, @@ -294,6 +302,14 @@ transition: all var(--dw-animation-duration) cubic-bezier(0.55, 0, 0.1, 1); } + /* 当禁用动画时应用的样式 */ + :root[data-animation-disabled="true"] .danmaku-list-move, + :root[data-animation-disabled="true"] .danmaku-list-enter-active, + :root[data-animation-disabled="true"] .danmaku-list-leave-active { + transition: none !important; + animation: none !important; + } + .danmaku-list-enter-from, .danmaku-list-leave-to { opacity: 0; diff --git a/src/client/ClientSettings.vue b/src/client/ClientSettings.vue index 3014c81..6d06e6b 100644 --- a/src/client/ClientSettings.vue +++ b/src/client/ClientSettings.vue @@ -278,6 +278,24 @@ import { invoke } from '@tauri-apps/api/core'; + + +

当B站私信发送失败时通知你

+
+ + +

当直播弹幕发送失败时通知你

+
diff --git a/src/client/DanmakuWindowManager.vue b/src/client/DanmakuWindowManager.vue index b9d9dfb..4e0391f 100644 --- a/src/client/DanmakuWindowManager.vue +++ b/src/client/DanmakuWindowManager.vue @@ -402,6 +402,20 @@ const separatorOptions = [ + + + + + 关闭可减少资源占用 + + + + +import { NCard, NSpace, NCollapse, NDivider } from 'naive-ui'; +import { AutoActionItem, TriggerType } from '@/client/store/useAutoAction'; + +// 引入拆分的子组件 +import BasicSettings from './settings/BasicSettings.vue'; +import AdvancedSettings from './settings/AdvancedSettings.vue'; +import DanmakuSettings from './settings/DanmakuSettings.vue'; +import GiftSettings from './settings/GiftSettings.vue'; +import GuardSettings from './settings/GuardSettings.vue'; +import ScheduledSettings from './settings/ScheduledSettings.vue'; +import TemplateSettings from './settings/TemplateSettings.vue'; +import FollowSettings from './settings/FollowSettings.vue'; +import EnterSettings from './settings/EnterSettings.vue'; +import SuperChatSettings from './settings/SuperChatSettings.vue'; + +const props = defineProps({ + action: { + type: Object as () => AutoActionItem, + required: true + } +}); + +// 根据触发类型获取对应的设置组件 +const getTriggerSettings = () => { + switch (props.action.triggerType) { + case TriggerType.DANMAKU: + return DanmakuSettings; + case TriggerType.GIFT: + return GiftSettings; + case TriggerType.GUARD: + return GuardSettings; + case TriggerType.FOLLOW: + return FollowSettings; + case TriggerType.ENTER: + return EnterSettings; + case TriggerType.SCHEDULED: + return ScheduledSettings; + case TriggerType.SUPER_CHAT: + return SuperChatSettings; + default: + return null; + } +}; + +const TriggerSettings = getTriggerSettings(); + + + + + diff --git a/src/client/components/autoaction/AutoReplyConfig.vue b/src/client/components/autoaction/AutoReplyConfig.vue deleted file mode 100644 index b5f358e..0000000 --- a/src/client/components/autoaction/AutoReplyConfig.vue +++ /dev/null @@ -1,313 +0,0 @@ - - - - - diff --git a/src/client/components/autoaction/EntryWelcomeConfig.vue b/src/client/components/autoaction/EntryWelcomeConfig.vue deleted file mode 100644 index 7369197..0000000 --- a/src/client/components/autoaction/EntryWelcomeConfig.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - diff --git a/src/client/components/autoaction/FollowThankConfig.vue b/src/client/components/autoaction/FollowThankConfig.vue deleted file mode 100644 index d511791..0000000 --- a/src/client/components/autoaction/FollowThankConfig.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - diff --git a/src/client/components/autoaction/GiftThankConfig.vue b/src/client/components/autoaction/GiftThankConfig.vue deleted file mode 100644 index 4ffa205..0000000 --- a/src/client/components/autoaction/GiftThankConfig.vue +++ /dev/null @@ -1,161 +0,0 @@ - - - diff --git a/src/client/components/autoaction/GlobalSettingsConfig.vue b/src/client/components/autoaction/GlobalSettingsConfig.vue new file mode 100644 index 0000000..e69de29 diff --git a/src/client/components/autoaction/GuardPmConfig.vue b/src/client/components/autoaction/GuardPmConfig.vue deleted file mode 100644 index a6909ec..0000000 --- a/src/client/components/autoaction/GuardPmConfig.vue +++ /dev/null @@ -1,223 +0,0 @@ - - - diff --git a/src/client/components/autoaction/ScheduledDanmakuConfig.vue b/src/client/components/autoaction/ScheduledDanmakuConfig.vue deleted file mode 100644 index 6d08036..0000000 --- a/src/client/components/autoaction/ScheduledDanmakuConfig.vue +++ /dev/null @@ -1,78 +0,0 @@ - - - diff --git a/src/client/components/autoaction/TemplateEditor.vue b/src/client/components/autoaction/TemplateEditor.vue index 6e1daf9..fa95ec5 100644 --- a/src/client/components/autoaction/TemplateEditor.vue +++ b/src/client/components/autoaction/TemplateEditor.vue @@ -1,6 +1,10 @@ @@ -112,56 +209,284 @@ function removeTemplate(index: number) { {{ description }}

- - + + - + - {{ template }} - - - 确定要删除此模板吗? - - - - + +
+ +
+ JS +
+
- + + + 测试 + + + 编辑 + + + + 确定要删除这个模板吗? + + + + + + - - - + + + + + + + + + 转换为表达式 + + + + + + 取消 + + + {{ isEditing ? '保存' : '添加' }} + + + + + + + + - 添加模板 - - + + + + + diff --git a/src/client/components/autoaction/TemplateHelper.vue b/src/client/components/autoaction/TemplateHelper.vue new file mode 100644 index 0000000..d876244 --- /dev/null +++ b/src/client/components/autoaction/TemplateHelper.vue @@ -0,0 +1,74 @@ + + + + + \ No newline at end of file diff --git a/src/client/components/autoaction/TemplateTester.vue b/src/client/components/autoaction/TemplateTester.vue new file mode 100644 index 0000000..900fac9 --- /dev/null +++ b/src/client/components/autoaction/TemplateTester.vue @@ -0,0 +1,107 @@ + + + + + \ No newline at end of file diff --git a/src/client/components/autoaction/settings/AdvancedSettings.vue b/src/client/components/autoaction/settings/AdvancedSettings.vue new file mode 100644 index 0000000..8a7448a --- /dev/null +++ b/src/client/components/autoaction/settings/AdvancedSettings.vue @@ -0,0 +1,196 @@ + + + + + diff --git a/src/client/components/autoaction/settings/BasicSettings.vue b/src/client/components/autoaction/settings/BasicSettings.vue new file mode 100644 index 0000000..c1ca3b4 --- /dev/null +++ b/src/client/components/autoaction/settings/BasicSettings.vue @@ -0,0 +1,143 @@ + + + + + diff --git a/src/client/components/autoaction/settings/DanmakuSettings.vue b/src/client/components/autoaction/settings/DanmakuSettings.vue new file mode 100644 index 0000000..2ddfbd2 --- /dev/null +++ b/src/client/components/autoaction/settings/DanmakuSettings.vue @@ -0,0 +1,137 @@ + + + + + diff --git a/src/client/components/autoaction/settings/EnterSettings.vue b/src/client/components/autoaction/settings/EnterSettings.vue new file mode 100644 index 0000000..cbf6f83 --- /dev/null +++ b/src/client/components/autoaction/settings/EnterSettings.vue @@ -0,0 +1,65 @@ + + + \ No newline at end of file diff --git a/src/client/components/autoaction/settings/FollowSettings.vue b/src/client/components/autoaction/settings/FollowSettings.vue new file mode 100644 index 0000000..63242b7 --- /dev/null +++ b/src/client/components/autoaction/settings/FollowSettings.vue @@ -0,0 +1,43 @@ + + + \ No newline at end of file diff --git a/src/client/components/autoaction/settings/GiftSettings.vue b/src/client/components/autoaction/settings/GiftSettings.vue new file mode 100644 index 0000000..5448026 --- /dev/null +++ b/src/client/components/autoaction/settings/GiftSettings.vue @@ -0,0 +1,149 @@ + + + diff --git a/src/client/components/autoaction/settings/GuardSettings.vue b/src/client/components/autoaction/settings/GuardSettings.vue new file mode 100644 index 0000000..5f4ea76 --- /dev/null +++ b/src/client/components/autoaction/settings/GuardSettings.vue @@ -0,0 +1,152 @@ + + + + + diff --git a/src/client/components/autoaction/settings/ScheduledSettings.vue b/src/client/components/autoaction/settings/ScheduledSettings.vue new file mode 100644 index 0000000..efb9e57 --- /dev/null +++ b/src/client/components/autoaction/settings/ScheduledSettings.vue @@ -0,0 +1,60 @@ + + + diff --git a/src/client/components/autoaction/settings/SuperChatSettings.vue b/src/client/components/autoaction/settings/SuperChatSettings.vue new file mode 100644 index 0000000..797d308 --- /dev/null +++ b/src/client/components/autoaction/settings/SuperChatSettings.vue @@ -0,0 +1,77 @@ + + + \ No newline at end of file diff --git a/src/client/components/autoaction/settings/TemplateSettings.vue b/src/client/components/autoaction/settings/TemplateSettings.vue new file mode 100644 index 0000000..5bfff6a --- /dev/null +++ b/src/client/components/autoaction/settings/TemplateSettings.vue @@ -0,0 +1,136 @@ + + + + + diff --git a/src/client/components/danmaku/CardStyleDanmakuItem.vue b/src/client/components/danmaku/CardStyleDanmakuItem.vue index d9ce0e5..9f67dca 100644 --- a/src/client/components/danmaku/CardStyleDanmakuItem.vue +++ b/src/client/components/danmaku/CardStyleDanmakuItem.vue @@ -57,12 +57,15 @@ import { VehicleShip24Filled } from '@vicons/fluent'; + + diff --git a/src/views/manage/point/PointUserManage.vue b/src/views/manage/point/PointUserManage.vue index 6306291..5ea6719 100644 --- a/src/views/manage/point/PointUserManage.vue +++ b/src/views/manage/point/PointUserManage.vue @@ -5,6 +5,7 @@ import { QueryGetAPI } from '@/api/query' import { POINT_API_URL } from '@/data/constants' import { objectsToCSV } from '@/Utils' import { Info24Filled } from '@vicons/fluent' +import { Warning24Regular } from '@vicons/fluent' import { useStorage } from '@vueuse/core' import { format } from 'date-fns' import { saveAs } from 'file-saver' @@ -63,6 +64,7 @@ const ps = ref(25) // 弹窗控制 const showModal = ref(false) const showGivePointModal = ref(false) +const showResetAllPointsModal = ref(false) const isLoading = ref(true) // 积分调整表单 @@ -70,6 +72,10 @@ const addPointCount = ref(0) const addPointReason = ref('') const addPointTarget = ref() +// 重置所有积分确认 +const resetConfirmText = ref('') +const RESET_CONFIRM_TEXT = '我确认删除' + // 用户数据 const users = ref([]) // 根据筛选条件过滤后的用户 @@ -277,6 +283,37 @@ async function deleteUser(user: ResponsePointUserModel) { } } +// 重置所有用户积分 +async function resetAllPoints() { + // 验证确认文本 + if (resetConfirmText.value !== RESET_CONFIRM_TEXT) { + message.error(`请输入"${RESET_CONFIRM_TEXT}"以确认操作`) + return + } + + isLoading.value = true + try { + const data = await QueryGetAPI(POINT_API_URL + 'reset') + + if (data.code == 200) { + message.success('已重置所有用户积分') + resetConfirmText.value = '' + showResetAllPointsModal.value = false + + // 重新加载用户数据 + setTimeout(() => { + refresh() + }, 1500) + } else { + message.error('重置失败: ' + data.message) + } + } catch (err) { + message.error('重置失败: ' + err) + } finally { + isLoading.value = false + } +} + // 导出用户积分数据 function exportData() { try { @@ -360,6 +397,12 @@ onMounted(async () => { > 导出积分数据 + + 重置所有积分 + @@ -516,6 +559,46 @@ onMounted(async () => { + + + + + + + + 警告:此操作将删除所有用户积分记录,不可恢复! + + + 请输入 "{{ RESET_CONFIRM_TEXT }}" 以确认操作 + + + + 确认重置所有用户积分 + + +