feat(article-management): 增加文章附件上传功能

- 在文章管理页面添加公告附件列表
- 实现附件上传和展示功能- 优化 Tinymce 组件,支持附件上传事件
This commit is contained in:
dj
2025-04-11 18:21:43 +08:00
parent ad6d7af1a3
commit 5cf2e4d208
3 changed files with 29 additions and 5 deletions

View File

@@ -38,7 +38,7 @@ import 'tinymce/plugins/wordcount'
import 'tinymce/plugins/autosave'
import '@/assets/axupimgs/plugin.js'//多图上传插件
const emit = defineEmits(['update:value'])
const emit = defineEmits(['update:value','getFiles'])
const props = defineProps({
//默认值
value: {
@@ -78,6 +78,7 @@ const props = defineProps({
default: 500
}
})
const fileLists=ref([])
const content = ref(props.value);
const imgUrl = ref();
// const apiKey = reactive("v4zo4n22oanvco29ws5drh0pecuf3gh53clx53cccj3grjwg");
@@ -168,6 +169,9 @@ const init = reactive({
type: res.code === 1000 ? 'success' : 'error'
})
loading.close()
console.log("🚀 ~ file:res.data ", res.data)
fileLists.value.push(res.data)
emit('getFiles',fileLists.value)
const fileUrl = res.data.url;
// '?fileId='+res.data.id+
callback(fileUrl + '?fileName=' + res.data.originalFilename, {text: file.name, title: file.name});