From 429cc3b795ad496e42a224a8e8b85b98ec255263 Mon Sep 17 00:00:00 2001 From: rookie4show Date: Wed, 19 Mar 2025 11:25:23 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=8F=E7=A5=9E?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ShikigamiSelect.vue | 33 ++++++++++++++++++++++++------ src/data/updateLog.json | 7 +++++++ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/components/ShikigamiSelect.vue b/src/components/ShikigamiSelect.vue index 0a1a581..dd78c9f 100644 --- a/src/components/ShikigamiSelect.vue +++ b/src/components/ShikigamiSelect.vue @@ -6,11 +6,19 @@ :before-close="cancel" > 当前选择式神:{{ current.name }} +
+ +
-
+
{ const confirm = (shikigami: Shikigami) => { emit('updateShikigami', shikigami) + searchText.value='' + activeName.value='ALL' // cancel() } -const filterShikigamiByRarity = (rarity: string) => { - if (rarity.toLowerCase() === 'all') return shikigamiData - return shikigamiData.filter(item => - item.rarity.toLowerCase() === rarity.toLowerCase() - ) + +// 修改后的过滤函数 +const filterShikigamiByRarityAndSearch = (rarity: string, search: string) => { + let filteredList = shikigamiData; + if (rarity.toLowerCase() !== 'all') { + filteredList = filteredList.filter(item => + item.rarity.toLowerCase() === rarity.toLowerCase() + ); + } + if (search.trim() !== '') { + return filteredList.filter(item => + item.name.toLowerCase().includes(search.toLowerCase()) + ); + } + return filteredList; } \ No newline at end of file diff --git a/src/data/updateLog.json b/src/data/updateLog.json index cdb89fd..b35ec09 100644 --- a/src/data/updateLog.json +++ b/src/data/updateLog.json @@ -1,4 +1,11 @@ [ + { + "version": "2.1.0", + "date": "2025-03-19", + "changes": [ + "增加式神搜索功能" + ] + }, { "version": "2.0.2", "date": "2025-03-19", From 874c773512af2844a21d0e635a9aa9fbd734ac8c Mon Sep 17 00:00:00 2001 From: zhangqi <395733086@qq.com> Date: Thu, 20 Mar 2025 10:44:55 +0800 Subject: [PATCH 2/6] fix: quill size style --- src/components/Yys.vue | 220 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 198 insertions(+), 22 deletions(-) diff --git a/src/components/Yys.vue b/src/components/Yys.vue index 8cbdb4b..66a0bbc 100644 --- a/src/components/Yys.vue +++ b/src/components/Yys.vue @@ -37,13 +37,11 @@
- +
+
@@ -116,7 +118,8 @@ import ShikigamiSelect from './ShikigamiSelect.vue'; import ShikigamiProperty from './ShikigamiProperty.vue'; import html2canvas from 'html2canvas'; import {useI18n} from 'vue-i18n' -import {QuillEditor} from '@vueup/vue-quill' +import { Quill, QuillEditor } from '@vueup/vue-quill' +import '@vueup/vue-quill/dist/vue-quill.bubble.css' import '@vueup/vue-quill/dist/vue-quill.snow.css' // 引入样式文件 import * as ElementPlusIconsVue from '@element-plus/icons-vue' import shikigamiData from '../data/Shikigami.json'; @@ -151,30 +154,48 @@ const copy = (str) => { } const paste = (groupIndex, type) => { + console.log("paste", groupIndex, type, clipboard.value) if ('shortDescription' == type) props.groups[groupIndex].shortDescription = clipboard.value else if ('details' == type) props.groups[groupIndex].details = clipboard.value } -// 定义工具栏选项 -const toolbarOptions = [ +// 自定义字体注册 +const registerFonts = () => { + const Font = Quill.import('attributors/style/font') + Font.whitelist = ['SimSun', 'SimHei', 'KaiTi', 'FangSong', 'Microsoft YaHei', 'PingFang SC'] + Quill.register(Font, true) +} + +// 自定义字号注册 +const registerSizes = () => { + const Size = Quill.import('attributors/style/size') + Size.whitelist = ['12px', '14px', '16px', '18px', '21px', '29px', '32px', '34px'] + Quill.register(Size, true) +} + +// 执行注册 +registerFonts() +registerSizes() - [{'color': []}, {'background': []}], +// 工具栏配置 +const toolbarOptions = ref([ ['bold', 'italic', 'underline', 'strike'], // ['blockquote', 'code-block'], - // ['link', 'image', 'video', 'formula'], - [{'header': 1}, {'header': 2}], - [{'list': 'ordered'}, {'list': 'bullet'}, {'list': 'check'}], - // [{ 'script': 'sub'}, { 'script': 'super' }], - [{'indent': '-1'}, {'indent': '+1'}], - // [{ 'size': ['small', false, 'large', 'huge'] }], - // [{ 'header': [1, 2, 3, 4, 5, 6, false] }], - // [{ 'font': [] }], - [{'align': []}], - [{'direction': 'rtl'}], - // ['clean'] -]; + [{ header: 1 }, { header: 2 }], + [{ list: 'ordered' }, { list: 'bullet' }, {'list': 'check'}], + [{ script: 'sub' }, { script: 'super' }], + [{ indent: '-1' }, { indent: '+1' }], + [{ direction: 'rtl' }], + [{ color: [] }, { background: [] }], + // [{ header: [1, 2, 3, 4, 5, 6, false] }], + [{ size: ['12px', '14px', '16px', '18px', '21px', '29px', '32px', '34px'] }], + [{ font: ['SimSun', 'SimHei', 'KaiTi', 'FangSong', 'Microsoft YaHei', 'PingFang SC'] }], + [{ align: [] }], + // ['link', 'image', 'video'], + ['clean'] +] as const) // 定义方法 const closeSelectShikigami = () => { @@ -331,8 +352,30 @@ const importGroups = (file) => { reader.readAsText(file); }; +// 定义 QuillEditor 的 ref +const shortDescriptionEditor = ref>() +const detailsEditor = ref>() + +// 保存方法 +const saveQuillDesc = async (): Promise => { + if (!shortDescriptionEditor.value) { + throw new Error('Quill editor instance not found') + } + return shortDescriptionEditor.value.getHTML() +} + +// 保存方法 +const saveQuillDetail = async (): Promise => { + if (!detailsEditor.value) { + throw new Error('Quill detailsEditor instance not found') + } + return detailsEditor.value.getHTML() +} + // 暴露方法给父组件 defineExpose({ + saveQuillDesc, + saveQuillDetail, exportGroups, importGroups }); @@ -388,6 +431,10 @@ defineExpose({ justify-content: space-between; } +.group-item { + width: 100%; +} + .group-body { padding: 20px; width: 80%; @@ -450,3 +497,132 @@ defineExpose({ } + + \ No newline at end of file From a14b9dd1dc1830b002a379ad77b9fba4a8a99020 Mon Sep 17 00:00:00 2001 From: zhangqi <395733086@qq.com> Date: Thu, 20 Mar 2025 15:17:48 +0800 Subject: [PATCH 3/6] =?UTF-8?q?refine:=20=E4=BF=AE=E6=94=B9=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Yys.vue | 40 ++++++++++++++++++++++++++++++---------- src/locales/zh.json | 2 ++ 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/components/Yys.vue b/src/components/Yys.vue index 66a0bbc..ef7daae 100644 --- a/src/components/Yys.vue +++ b/src/components/Yys.vue @@ -16,8 +16,6 @@ - -