Skip to content

Commit

Permalink
feat: upgrade imgpond & pic-viewer & minimce, close #93
Browse files Browse the repository at this point in the history
  • Loading branch information
cloydlau authored and Qiu-Jun committed Dec 2, 2023
1 parent 5b40fd6 commit 10d9d06
Show file tree
Hide file tree
Showing 12 changed files with 10,458 additions and 7,063 deletions.
17,461 changes: 10,425 additions & 7,036 deletions packages/mall-cook-platform/package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions packages/mall-cook-platform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@
},
"dependencies": {
"axios": "^0.21.1",
"axios-shortcut": "~0.0.1",
"axios-shortcut": "~0.1.1",
"compression-webpack-plugin": "5.0.1",
"core-js": "^3.6.5",
"cross-env": "^7.0.3",
"dom-to-image": "^2.6.0",
"element-ui": "^2.15.2",
"element-verify": "^0.2.3",
"imgpond": "~0.6.0",
"imgpond": "~0.13.0",
"jr-qrcode": "^1.1.4",
"js-cookie": "^3.0.0",
"lodash": "^4.17.21",
"lru-cache": "^6.0.0",
"mammoth": "^1.4.21",
"minimce": "~0.4.8",
"pic-viewer": "~0.5.0",
"mammoth": "^1.6.0",
"minimce": "~0.8.4",
"pic-viewer": "~0.10.0",
"postcss-plugin-px2rem": "^0.8.1",
"sass": "^1.49.0",
"sass-resources-loader": "^2.2.1",
"swiper": "5.4.5",
"tinymce": "^6.1.2",
"tinymce": "^6.7.0",
"vue": "^2.7.8",
"vue-awesome-swiper": "^4.1.1",
"vue-json-viewer": "^2.2.19",
Expand Down
6 changes: 4 additions & 2 deletions packages/mall-cook-platform/src/components/MiniMCE/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Vue from 'vue'

import './index.scss'
import 'minimce/dist/style.css'
import MiniMCE from 'minimce'

/**
Expand All @@ -28,6 +27,9 @@ import 'tinymce/themes/silver'
*/
import 'tinymce/icons/default'

// 语言(非必须,默认英文,下载地址:https://www.tiny.cloud/get-tiny/language-packages)
import './langs/zh-Hans'

/**
* 自定义内容样式(非必须)
* 该样式仅在生产侧有效,不包含在生成的 HTML 文本中
Expand Down Expand Up @@ -59,7 +61,7 @@ import global from '@/config/global'
export default function () {
Vue.use(MiniMCE, {
options: {
language: 'zh_CN',
language: 'zh-Hans',
content_style: [contentCSS, contentUICSS, contentCustomCSS].join('\n'),
menu: {
insert: {
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
prop="src"
:rules="{required:true,message:'必填项'}"
>
<Imgpond v-model="formData.src" valueType="array"/>
<ImgPond v-model="formData.src" arrayed />
</el-form-item>
</el-form>
<template #footer>
Expand All @@ -23,11 +23,10 @@
</template>

<script>
import 'imgpond/dist/style.css'
import Imgpond from 'imgpond'
import ImgPond from 'imgpond'
export default {
components: { Imgpond },
components: { ImgPond },
props: {
editor: {
required: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
></el-input>
</config-item>
<config-item label='默认图片'>
<Imgpond
<ImgPond
v-model="content.curComponent.value"
:count="1"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->
<template>
<config-item :label='label'>
<Imgpond
<ImgPond
v-model="mValue"
v-bind="mOptions"
:count="1"
Expand All @@ -23,4 +23,4 @@ export default {

mixins: [schemaMixin],
};
</script>
</script>
9 changes: 3 additions & 6 deletions packages/mall-cook-platform/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,18 @@ for (let k in axiosShortcut) {
/**
* 图片预览
*/
import 'pic-viewer/dist/style.css'
import PicViewer from 'pic-viewer'
Vue.use(PicViewer)

/**
* 图片上传
*/
import 'imgpond/dist/style.css'
import Imgpond from 'imgpond'
import ImgPond from 'imgpond'

Vue.use(Imgpond, {
upload: (file, context) => new Promise((resolve, reject) => {
Vue.use(ImgPond, {
upload: (file) => new Promise((resolve, reject) => {
Vue.prototype.$POST.upload(global.baseApi + 'upload', ({
file,
...context.$attrs.requestParam,
}), {
baseURL: '',
timeout: 20000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
</div>
</el-form-item>
<el-form-item label="商品封面:" prop="cover" verify>
<Imgpond v-model="form.cover" :count="1" />
<ImgPond v-model="form.cover" :count="1" />
<div class="f12 f-grey">建议尺寸:800*800像素</div>
</el-form-item>
<el-form-item label="商品图:" prop="imgList" verify>
<Imgpond v-model="form.imgList" :count="10" />
<ImgPond v-model="form.imgList" :count="10" />
<div class="f12 f-grey">
建议尺寸:800*800像素,你可以拖拽图片调整顺序,最多上传10张
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
prop="image"
verify
>
<Imgpond
<ImgPond
:count="1"
v-model="form.image"
/>
Expand Down Expand Up @@ -220,4 +220,4 @@ export default {
display: inline-block;
margin: 0 auto;
}
</style>
</style>
3 changes: 2 additions & 1 deletion packages/mall-cook-platform/src/scss/imgpond.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
}

.el-upload-list__item-status-label,
.el-upload__text {
.el-upload__text,
.el-upload__tip {
display: none !important;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/mall-cook-platform/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = {
chunks: ['chunk-vendors', 'chunk-common', 'index']
}
},

transpileDependencies: ['imgpond', 'pic-viewer', 'minimce'],
configureWebpack: config => {
// CDN 加载依赖
config.externals = {
Expand Down

0 comments on commit 10d9d06

Please sign in to comment.