diff --git a/admin/src/components/material/file.vue b/admin/src/components/material/file.vue index a9f05003347ab54397926ba69eaa2cc87704264f..fef7d719bc2995303efc851d442969945c207ea5 100644 --- a/admin/src/components/material/file.vue +++ b/admin/src/components/material/file.vue @@ -3,6 +3,11 @@
+
{ + await fileCateAdd({ + type, + name: value, + pid: pid + }) + getCateLists() + } + // 编辑分组 const handleEditCate = async (value: string, id: number) => { await fileCateEdit({ @@ -82,6 +91,7 @@ export function useCate(type: number) { cateId, cateLists, handleAddCate, + handleAddChildCate, handleEditCate, handleDeleteCate, getCateLists, @@ -105,7 +115,8 @@ export function useFile( const fileParams = reactive({ name: '', type: type, - cid: cateId + cid: cateId, + source: '' }) const { pager, getLists, resetPage } = usePaging({ fetchFun: fileList, diff --git a/admin/src/components/material/index.vue b/admin/src/components/material/index.vue index a5149eb208d92f8bb12a134942d9c07c0975e61b..b92b76afd22323ffcd41527aea81e981f0090407 100644 --- a/admin/src/components/material/index.vue +++ b/admin/src/components/material/index.vue @@ -42,6 +42,20 @@
+ +
+ + 添加分组 + +
+
删除分组
@@ -91,6 +105,16 @@ > 本地上传 + + 本地上传 +
+ + + +
重命名 - + + 查看 + + 地址 + 下载
@@ -359,6 +422,7 @@
+ @@ -367,6 +431,7 @@ import { useCate, useFile } from './hook' import FileItem from './file.vue' import Preview from './preview.vue' import type { Ref } from 'vue' +import { ElMessage } from 'element-plus' const props = defineProps({ fileSize: { type: String, @@ -403,6 +468,17 @@ const typeValue = computed(() => { return 0 } }) +const options = [ + { + value: '0', + label: '后台上传' + }, + { + value: '1', + label: '前端上传' + } +] + const visible: Ref = inject('visible')! const previewUrl = ref('') const showPreview = ref(false) @@ -411,6 +487,7 @@ const { cateId, cateLists, handleAddCate, + handleAddChildCate, handleEditCate, handleDeleteCate, getCateLists, @@ -492,6 +569,19 @@ onMounted(() => { defineExpose({ clearSelect }) + +const textCopys = ref() +const textCopy = (uri: string) => { + const text = uri // 复制文本内容 + const input = textCopys.value + input.value = text // 修改input的内容 + input.select() // 选中文本 + document.execCommand('copy') // 浏览器复制 + ElMessage({ + message: '地址复制成功', + type: 'success' + }) +}