From e92db41bea17c6204c04cf544546b608687fc11d Mon Sep 17 00:00:00 2001 From: Jason <5340635+wen-jason@user.noreply.gitee.com> Date: Fri, 16 Sep 2022 10:18:01 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=B4=A0=E6=9D=90=E4=B8=AD=E5=BF=83=20?= =?UTF-8?q?=E5=88=86=E7=BB=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/src/components/material/hook.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/admin/src/components/material/hook.ts b/admin/src/components/material/hook.ts index 79fd1646..5ff9a2e3 100644 --- a/admin/src/components/material/hook.ts +++ b/admin/src/components/material/hook.ts @@ -20,7 +20,7 @@ export function useCate(type: number) { const cateLists = ref([]) // 选中的分组id - const cateId = ref('') + const cateId = ref('') // 获取分组列表 const getCateLists = async () => { @@ -39,6 +39,9 @@ export function useCate(type: number) { ] cateLists.value = data cateLists.value.unshift(...item) + setTimeout(() => { + treeRef.value?.setCurrentKey(cateId.value) + }, 0) } // 添加分组 @@ -66,6 +69,7 @@ export function useCate(type: number) { const handleDeleteCate = async (id: number) => { await feedback.confirm('确定要删除?') await fileCateDelete({ id }) + cateId.value = '' getCateLists() } @@ -87,7 +91,12 @@ export function useCate(type: number) { } // 处理文件的钩子函数 -export function useFile(cateId: Ref, type: Ref, limit: Ref, size: number) { +export function useFile( + cateId: Ref, + type: Ref, + limit: Ref, + size: number +) { const tableRef = shallowRef() const listShowType = ref('normal') const moveId = ref(0) From 5b1c03235344806ba9c4e2ac80a783b3e65f26b6 Mon Sep 17 00:00:00 2001 From: Jason <5340635+wen-jason@user.noreply.gitee.com> Date: Fri, 16 Sep 2022 10:18:51 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8C=87=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/src/install/directives/copy.ts | 28 ++++++++++++++++++++++++++++ admin/src/views/channel/h5.vue | 5 ++--- 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 admin/src/install/directives/copy.ts diff --git a/admin/src/install/directives/copy.ts b/admin/src/install/directives/copy.ts new file mode 100644 index 00000000..c0b1909c --- /dev/null +++ b/admin/src/install/directives/copy.ts @@ -0,0 +1,28 @@ +/** + * perm 操作权限处理 + * 指令用法: + * 编辑 + */ + +import feedback from '@/utils/feedback' +import useClipboard from 'vue-clipboard3' +const clipboard = 'data-clipboard-text' +export default { + mounted: (el: HTMLElement, binding: any) => { + el.setAttribute(clipboard, binding.value) + const { toClipboard } = useClipboard() + + el.onclick = () => { + toClipboard(el.getAttribute(clipboard)!) + .then(() => { + feedback.msgSuccess('复制成功') + }) + .catch(() => { + feedback.msgError('复制失败') + }) + } + }, + updated: (el: HTMLElement, binding: any) => { + el.setAttribute(clipboard, binding.value) + } +} diff --git a/admin/src/views/channel/h5.vue b/admin/src/views/channel/h5.vue index a98d45f5..efbdfe47 100644 --- a/admin/src/views/channel/h5.vue +++ b/admin/src/views/channel/h5.vue @@ -27,7 +27,7 @@
{{ formData.accessLink }}
- 复制 + 复制
@@ -39,7 +39,6 @@