diff --git a/src/components/Tinymce.vue b/src/components/Tinymce.vue index c38dcd4..ebe3971 100644 --- a/src/components/Tinymce.vue +++ b/src/components/Tinymce.vue @@ -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}); diff --git a/src/views/article-management/add.vue b/src/views/article-management/add.vue index e74a49f..d6cec6e 100644 --- a/src/views/article-management/add.vue +++ b/src/views/article-management/add.vue @@ -27,10 +27,26 @@ - + + + + + +
+
+ {{index+1}}{{item.originalFilename}} +
+
+
+
+
@@ -54,6 +70,7 @@ const loading = ref(false) const showTinymce = ref(true) const fundForm = ref() const formData = ref({}) +const articleFile = ref({}) const routerName = ref(router.currentRoute.value.name) const rules = reactive({ articleTitle: [{required: true, message: '请输入文章标题', trigger: ['blur', 'change']}], @@ -64,7 +81,10 @@ const rules = reactive({ const handleBack = () => { history.back() } - +const getFiles=(filelist)=>{ + console.log("🚀 ~ file:filelist ", filelist) + articleFile.value=filelist +} const submitParam = (item) => { return { articleContent: item.articleContent, diff --git a/src/views/article-management/detail.vue b/src/views/article-management/detail.vue index 993d97c..03152a9 100644 --- a/src/views/article-management/detail.vue +++ b/src/views/article-management/detail.vue @@ -10,7 +10,7 @@ -
+
@@ -43,7 +43,7 @@ const clickHandle = (e) => { fileName } // handleDownload(fileId,fileName) - download(item) + // download(item) // }else { // e.preventDefault() // }