From 096cf070b862a31d58eea83d62f7e0feae47ce52 Mon Sep 17 00:00:00 2001 From: Simo-C3 Date: Fri, 5 May 2023 19:02:12 +0900 Subject: [PATCH 01/25] =?UTF-8?q?[fix]=20=E3=83=97=E3=83=AD=E3=83=95?= =?UTF-8?q?=E3=82=A3=E3=83=BC=E3=83=AB=E3=81=AE=E3=82=A2=E3=82=A4=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=82=B5=E3=82=A4=E3=82=BA=E3=81=8C=E5=B0=8F=E3=81=99?= =?UTF-8?q?=E3=81=8E=E3=82=8B=E3=83=90=E3=82=B0=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Header.vue | 4 ++-- components/commons/UserRoundedIcon.vue | 12 +++++++----- components/commons/UserTag.vue | 2 +- components/users/UsersProfile.vue | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/components/Header.vue b/components/Header.vue index 84e678d..609db25 100644 --- a/components/Header.vue +++ b/components/Header.vue @@ -89,7 +89,7 @@ class="hover:opacity-60 transition" @click="activeNav = true" > - + @@ -113,7 +113,7 @@ diff --git a/components/commons/UserRoundedIcon.vue b/components/commons/UserRoundedIcon.vue index e4abd92..af24642 100644 --- a/components/commons/UserRoundedIcon.vue +++ b/components/commons/UserRoundedIcon.vue @@ -2,11 +2,13 @@
@@ -47,6 +49,6 @@ export default class UserRoundedIcon extends Vue { imageSrc!: string @Prop({ type: String, required: false, default: 'base' }) - size!: 'small' | 'base' | 'large' | 'x-large' | 'xx-large' + size!: 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | 'full' } diff --git a/components/commons/UserTag.vue b/components/commons/UserTag.vue index fac994f..aafecb9 100644 --- a/components/commons/UserTag.vue +++ b/components/commons/UserTag.vue @@ -12,7 +12,7 @@ >
- +
{{ user.display_name }} From 135fe3877ceaa1f3bd9aed4f4bc28c3872fcacd2 Mon Sep 17 00:00:00 2001 From: Simo-C3 Date: Fri, 5 May 2023 19:04:31 +0900 Subject: [PATCH 02/25] =?UTF-8?q?[fix]=20=E3=83=AD=E3=82=B0=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=81=AE=E9=9A=A0=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=AE?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Header.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/Header.vue b/components/Header.vue index 609db25..0ab39d3 100644 --- a/components/Header.vue +++ b/components/Header.vue @@ -1,5 +1,10 @@ + diff --git a/components/works/form/FormInputThumbnail.vue b/components/works/form/FormInputThumbnail.vue index 69fd322..15f20e1 100644 --- a/components/works/form/FormInputThumbnail.vue +++ b/components/works/form/FormInputThumbnail.vue @@ -39,10 +39,10 @@ diff --git a/store/blog_post.ts b/store/blog_post.ts new file mode 100644 index 0000000..6c39ff1 --- /dev/null +++ b/store/blog_post.ts @@ -0,0 +1,66 @@ +import { + Module, + VuexModule, + Mutation, + Action, + config +} from 'vuex-module-decorators' +import { Blog, BlogAsset } from '@/types' + +@Module({ + name: 'blog_post', + stateFactory: true, + namespaced: true +}) +export default class BlogPost extends VuexModule { + private thumbnailViewInfo: BlogAsset = { + asset_type: '', + id: '', + url: '', + user: { + id: '', + name: '', + display_name: '', + created_at: '', + updated_at: '' + }, + extension: '', + created_at: '', + updated_at: '' + } + + get getThumbnailViewInfo() { + return this.thumbnailViewInfo + } + + @Mutation + INIT_THUMBNAILVIEWINFO() { + this.thumbnailViewInfo = { + asset_type: '', + id: '', + url: '', + user: { + id: '', + name: '', + display_name: '', + created_at: '', + updated_at: '' + }, + extension: '', + created_at: '', + updated_at: '' + } + } + @Mutation + SET_THUMBNAILVIEWINFO(thumbnail: BlogAsset) { + this.thumbnailViewInfo = thumbnail + } + @Action + initThumbnailViewInfo() { + this.INIT_THUMBNAILVIEWINFO() + } + @Action + setThumbnailViewInfo(thumbnail: BlogAsset) { + this.SET_THUMBNAILVIEWINFO(thumbnail) + } +} diff --git a/utils/store-accessor.ts b/utils/store-accessor.ts index 59ecef6..88f869d 100644 --- a/utils/store-accessor.ts +++ b/utils/store-accessor.ts @@ -11,6 +11,7 @@ import DownloadAsset from '@/store/download_asset' import Preview from '~/store/preview' import WorkShare from '~/store/work_share' import TagSelector from '~/store/tag_selector' +import BlogPost from '~/store/blog_post' let authStore: Auth let commentStore: Comment @@ -24,6 +25,8 @@ let previewStore: Preview let workShareStore: WorkShare let tagSelectorStore: TagSelector +let blogPostStore: BlogPost + function initializeStores(store: Store): void { authStore = getModule(Auth, store) commentStore = getModule(Comment, store) @@ -36,6 +39,7 @@ function initializeStores(store: Store): void { previewStore = getModule(Preview, store) workShareStore = getModule(WorkShare, store) tagSelectorStore = getModule(TagSelector, store) + blogPostStore = getModule(BlogPost, store) } export { @@ -50,5 +54,6 @@ export { downloadAssetStore, previewStore, workShareStore, - tagSelectorStore + tagSelectorStore, + blogPostStore } From ba6d76d5d5b5a2bc7af24b6cd95a62dfa790a727 Mon Sep 17 00:00:00 2001 From: PigeonsHouse Date: Mon, 27 Nov 2023 15:19:17 +0900 Subject: [PATCH 20/25] =?UTF-8?q?update:=20=E7=94=BB=E5=83=8F=E3=83=BB?= =?UTF-8?q?=E5=8B=95=E7=94=BB=E3=81=AE=E8=BF=BD=E5=8A=A0=E5=87=A6=E7=90=86?= =?UTF-8?q?=E3=81=AE=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/blogs/BlogForm.vue | 5 +- components/blogs/form/FormAsset.vue | 150 +++++++++++++++++++++++++ components/works/WorksForm.vue | 2 +- components/works/form/FormMarkdown.vue | 35 +++++- pages/blogs/create.vue | 1 + store/blog_post.ts | 38 +++++++ 6 files changed, 224 insertions(+), 7 deletions(-) create mode 100644 components/blogs/form/FormAsset.vue diff --git a/components/blogs/BlogForm.vue b/components/blogs/BlogForm.vue index 99db6b1..1db5efa 100644 --- a/components/blogs/BlogForm.vue +++ b/components/blogs/BlogForm.vue @@ -45,8 +45,10 @@ " >
@@ -108,6 +110,7 @@ export default class BlogForm extends Vue { blogData!: PostBlog submitSuccessProcess() { + blogPostStore.initAssetsViewInfo() tagSelectorStore.initSelectedTags() blogPostStore.initThumbnailViewInfo() workPostStore.initIsBlockUnload() diff --git a/components/blogs/form/FormAsset.vue b/components/blogs/form/FormAsset.vue new file mode 100644 index 0000000..2a400bf --- /dev/null +++ b/components/blogs/form/FormAsset.vue @@ -0,0 +1,150 @@ + + + diff --git a/components/works/WorksForm.vue b/components/works/WorksForm.vue index cbf580e..90141ab 100644 --- a/components/works/WorksForm.vue +++ b/components/works/WorksForm.vue @@ -51,7 +51,7 @@ " > diff --git a/components/works/form/FormMarkdown.vue b/components/works/form/FormMarkdown.vue index 17b6ef3..c367836 100644 --- a/components/works/form/FormMarkdown.vue +++ b/components/works/form/FormMarkdown.vue @@ -6,11 +6,22 @@ :show-warning="showWarning" class="mb-3" /> + diff --git a/components/works/WorksForm.vue b/components/works/WorksForm.vue index 90141ab..cbf580e 100644 --- a/components/works/WorksForm.vue +++ b/components/works/WorksForm.vue @@ -51,7 +51,7 @@ " > diff --git a/components/works/form/FormMarkdown.vue b/components/works/form/FormMarkdown.vue index c367836..17b6ef3 100644 --- a/components/works/form/FormMarkdown.vue +++ b/components/works/form/FormMarkdown.vue @@ -6,22 +6,11 @@ :show-warning="showWarning" class="mb-3" /> - diff --git a/components/blogs/form/FormMarkdown.vue b/components/blogs/form/FormMarkdown.vue index eacdfa0..870d816 100644 --- a/components/blogs/form/FormMarkdown.vue +++ b/components/blogs/form/FormMarkdown.vue @@ -6,8 +6,9 @@ :show-warning="showWarning" class="mb-3" /> - +
@@ -47,12 +49,23 @@ export default class FormMarkdown extends Vue { showWarning!: boolean @Prop({ type: Function, required: true }) - onFilePicked!: (e: Event) => void + fileUploadHandler!: (files: File[]) => Promise changeBlockUnloadState() { workPostStore.changeIsBlockUnload() } + async dragAndDropAsset(pos: Number, file: File) { + await this.fileUploadHandler([file]) + const reg = RegExp(`\\!\\[.+\\]\\(${pos}\\)`, 'i') + console.log(reg) + console.log(this.description) + console.log('start reg') + this.description = this.description.replace(reg, '') + console.log('finish reg') + console.log(this.description) + } + toolbarsOption = { bold: true, // 粗体 italic: true, // 斜体 From 0c9c3100b51bc39e4b887c9a025465de903f51b4 Mon Sep 17 00:00:00 2001 From: PigeonsHouse Date: Tue, 28 Nov 2023 20:54:37 +0900 Subject: [PATCH 23/25] =?UTF-8?q?delete:=20console.log=E3=81=AE=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/blogs/form/FormMarkdown.vue | 5 ----- 1 file changed, 5 deletions(-) diff --git a/components/blogs/form/FormMarkdown.vue b/components/blogs/form/FormMarkdown.vue index 870d816..92e75b9 100644 --- a/components/blogs/form/FormMarkdown.vue +++ b/components/blogs/form/FormMarkdown.vue @@ -58,12 +58,7 @@ export default class FormMarkdown extends Vue { async dragAndDropAsset(pos: Number, file: File) { await this.fileUploadHandler([file]) const reg = RegExp(`\\!\\[.+\\]\\(${pos}\\)`, 'i') - console.log(reg) - console.log(this.description) - console.log('start reg') this.description = this.description.replace(reg, '') - console.log('finish reg') - console.log(this.description) } toolbarsOption = { From 6333e2e22a435d523b165f243af23da1972f55c5 Mon Sep 17 00:00:00 2001 From: PigeonsHouse Date: Tue, 28 Nov 2023 22:50:41 +0900 Subject: [PATCH 24/25] =?UTF-8?q?fix:=20video=E3=81=AEwidth=E3=82=92?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E3=81=97=E3=81=AA=E3=81=84=E3=82=88=E3=81=86?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/blogs/BlogForm.vue | 2 +- components/blogs/form/FormMarkdown.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/blogs/BlogForm.vue b/components/blogs/BlogForm.vue index bb7d063..0f155df 100644 --- a/components/blogs/BlogForm.vue +++ b/components/blogs/BlogForm.vue @@ -235,7 +235,7 @@ export default class BlogForm extends Vue { if (result.data.asset_type === 'image') { assetText = `![${result.data.id}](${result.data.url})\n` } else if (result.data.asset_type === 'video') { - assetText = `
@@ -126,6 +127,10 @@ export default class BlogForm extends Vue { return tagSelectorStore.getSelectedTags } + get assetStatus() { + return workPostStore.getPostAssetStatus + } + @Prop({ type: Boolean, required: false, default: true }) isNewBlogs!: boolean @@ -256,6 +261,7 @@ export default class BlogForm extends Vue { workPostStore.setPostAssetStatus('') } } + workPostStore.setPostAssetStatus('') workPostStore.changeIsBlockUnload() } diff --git a/components/blogs/form/FormAsset.vue b/components/blogs/form/FormAsset.vue index fbc9d89..62f0606 100644 --- a/components/blogs/form/FormAsset.vue +++ b/components/blogs/form/FormAsset.vue @@ -1,20 +1,9 @@