From 089bf5d2378b3c4a61d795b2a92bede2c193b771 Mon Sep 17 00:00:00 2001
From: admin <344137771@qq.com>
Date: Tue, 06 Jan 2026 11:22:58 +0800
Subject: [PATCH] 1

---
 src/components/tiny-mce/components/EditorImage.vue |   88 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 88 insertions(+), 0 deletions(-)

diff --git a/src/components/tiny-mce/components/EditorImage.vue b/src/components/tiny-mce/components/EditorImage.vue
new file mode 100644
index 0000000..d2e0a44
--- /dev/null
+++ b/src/components/tiny-mce/components/EditorImage.vue
@@ -0,0 +1,88 @@
+<template>
+  <div class="upload-container">
+    <el-tooltip v-if="tinymceUploadType === 'prod'" :content="this.$i18n.t('product.uploadDetailPicTips')" placement="top">
+      <el-button :style="{background:color,borderColor:color}" icon="el-icon-upload" size="mini" type="primary" @click="clickUpload()">
+        {{ $t('components.uploadImage') }}
+      </el-button>
+    </el-tooltip>
+    <el-button v-else :style="{background:color,borderColor:color}" icon="el-icon-upload" size="mini" type="primary" @click="clickUpload()">
+      {{ $t('components.uploadImage') }}
+    </el-button>
+    <!-- 弹窗, 新增图片 -->
+    <elx-imgbox v-if="elxImgboxVisible" ref="elxImgbox" @refreshPic="refreshPic"></elx-imgbox>
+  </div>
+</template>
+
+<script>
+import ImgsUpload from '@/components/imgs-upload'
+import ElxImgbox from '@/components/elx-imgbox'
+export default {
+  name: 'EditorSlideUpload',
+  props: {
+    color: {
+      type: String,
+      default: '#1890ff'
+    },
+    tinymceUploadType: {
+      default: '',
+      type: String
+    }
+  },
+  data () {
+    return {
+      elxImgboxVisible: false,
+      maxNum: 15, // 可选择的最大图片数量
+      imgUrls: [],
+      resourcesUrl: process.env.VUE_APP_RESOURCES_URL
+    }
+  },
+  components: {
+    ImgsUpload,
+    ElxImgbox
+  },
+  methods: {
+    /**
+     * 打开图片选择窗
+     */
+    clickUpload () {
+      this.imgUrls = ''
+      this.elxImgboxVisible = true
+      this.$nextTick(() => {
+        this.$refs.elxImgbox.init(0, this.maxNum)
+      })
+    },
+    /**
+     * 接收回调的图片数据
+     */
+    refreshPic (imagePath) {
+      let imageArray = imagePath.split(',')
+      var data = []
+      imageArray.forEach(img => {
+        data.push(this.resourcesUrl + img)
+      })
+      this.imgUrls = ''
+      this.dialogVisible = false
+      this.$emit('successCBK', data)
+    }
+    // handleSubmit() {
+    //   let imageArray = this.imgUrls.split(',')
+    //   var data = []
+    //   imageArray.forEach(img => {
+    //     data.push(this.resourcesUrl + img)
+    //   })
+    //   this.imgUrls = ''
+    //   this.dialogVisible = false
+    //   this.$emit('successCBK', data)
+    // }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.editor-slide-upload {
+  margin-bottom: 20px;
+  ::v-deep .el-upload--picture-card {
+    width: 100%;
+  }
+}
+</style>

--
Gitblit v1.9.3