Browse Source

💊 修复编辑器图片传递问题

快乐的梦鱼 1 month ago
parent
commit
f18a6e194b

+ 3 - 1
src/common/components/form/RichTextEditor.vue

@@ -1,7 +1,7 @@
 <template>
   <FlexCol>
     <view class="richtext-preview-box" @click="() => !disabled && !readonly ? edit() : preview()">
-      <Parse v-if="modelValue" :content="modelValue" containerStyle="max-height:400px;word-break:break-all;" />
+      <Parse v-if="modelValue" :content="modelValue" contentStyle="max-height:400px;word-break:break-all;overflow:hidden;" />
       <Text v-else color="text.second">{{placeholder}}</Text>
       <view v-if="modelValue" class="richtext-preview-mask" :style="maskStyle" />
     </view>
@@ -86,6 +86,8 @@ async function edit() {
   const extraProps = props.extraProps.get();
   const extraAiInfo = await props.getExtraAiInfo();
 
+  console.log('加载编辑器', props.modelValue, extraProps, extraAiInfo);
+
   uni.setStorage({
     key: 'editorContent',
     data: {

+ 8 - 6
src/pages/home/chat/dependent/post/editor.vue

@@ -128,12 +128,14 @@ function load() {
       currentTitle.value = success.data.title;
       currentContent.value = success.data.content;
       currentImages.value = success.data.images;
-      uploader.value?.setList(currentImages.value.map((image) => ({
-        url: image,
-        type: 'image',
-        filePath: image,
-        state: image ? 'success' : 'notstart',
-      })));
+      setTimeout(() => {
+        uploader.value?.setList(currentImages.value.map((image) => ({
+          url: image,
+          type: 'image',
+          filePath: image,
+          state: image ? 'success' : 'notstart',
+        })));
+      }, 1000);
     },
   })
 }