From 15efbd83c61c97b793985da28a31777d05771be7 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Thu, 10 Nov 2022 14:13:10 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/editor.css | 61 ++++ src/components/img-upload/Cropper.vue | 23 +- src/components/modules/content.vue | 38 ++- src/components/modules/link.vue | 11 +- src/components/modules/module.vue | 74 +++-- src/const/column.js | 4 +- src/mixins/page/index.js | 43 +-- src/pages/account/login/index.vue | 212 +++++++------- src/pages/article/add/editor.js | 102 ++++--- src/pages/article/add/index.vue | 156 +++++++--- src/pages/article/list/index.vue | 47 ++- src/pages/column/add/index.vue | 118 ++++---- src/pages/column/list/index.vue | 14 +- src/pages/column/page/about.vue | 392 ++++++++++++++------------ src/pages/column/page/careers.vue | 240 +++++++++------- src/pages/column/page/edu.vue | 122 ++++---- src/pages/column/page/home.vue | 341 +++++++++++----------- src/pages/column/page/news.vue | 337 ++++++++++++---------- src/pages/column/page/newsPress.vue | 61 ++-- src/pages/user/list/index.vue | 3 +- src/router/permission.js | 2 + src/styles/common.scss | 15 +- src/styles/page/page.scss | 7 +- 23 files changed, 1396 insertions(+), 1027 deletions(-) create mode 100644 public/editor.css diff --git a/public/editor.css b/public/editor.css new file mode 100644 index 0000000..9c8759c --- /dev/null +++ b/public/editor.css @@ -0,0 +1,61 @@ +.mce-content-body:not([dir=rtl]) blockquote { + padding: 8px 15px; + border-left: 0; + background-color: #ededed; +} +.tiny-wrap { + width: 900px; + margin: 0 auto; +} +.tiny-wrap blockquote p { + margin: 0; + font-style: italic; +} +.tiny-wrap .block { + margin-bottom: 20px; + overflow: hidden; +} +.tiny-wrap .block .fl { + float: left; + margin: 0 20px 0 0; +} +.tiny-wrap .block .fr { + float: right; + margin: 0 0 0 20px; +} +.tiny-wrap .block p { + margin: 0 0 10px; + font-size: 19px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #101010; + line-height: 32px; +} +.tiny-wrap .block .tiny-title { + margin: 10px 0; + font-size: 24px; + font-family: PingFangSC-Medium, PingFang SC; + font-weight: 500; + color: #101010; + line-height: 32px; +} +.tiny-wrap .quote { + padding: 15px; + font-size: 14px; + font-style: italic; + border: 1px solid #e3e3e3; + background-color: #f1f1f1; +} +.tiny-wrap .img-wrap { + text-align: center; +} +.tiny-wrap .img-wrap img { + max-width: 600px; + max-height: 600px; +} +.tiny-wrap .block .img-des { + margin: 10px 0 0; + font-size: 14px; + color: #8d8d8d; + text-align: center; +} \ No newline at end of file diff --git a/src/components/img-upload/Cropper.vue b/src/components/img-upload/Cropper.vue index 22854fa..93b7cf4 100644 --- a/src/components/img-upload/Cropper.vue +++ b/src/components/img-upload/Cropper.vue @@ -16,8 +16,8 @@ :auto-crop="option.autoCrop" :auto-crop-width="option.autoCropWidth" :auto-crop-height="option.autoCropHeight" - :fixed-box="fixedBox" - :fixed="fixed" + :fixed-box="option.fixedBox" + :fixed="option.fixed" :fixed-number="fixedNumber" @realTime="realTime" /> @@ -46,7 +46,7 @@ :loading="isUpload" :disabled="isDisabled" @click.prevent="uploadImg('base64')"> - {{ '上传' | transLoading(isUpload) }} + 上传 @@ -75,6 +75,11 @@ export default { default: () => { return { url: '', size: 10 } } + }, + // 截图框比例 + fixedNumber: { + type: Array, + default: [1, 0.26] } }, data() { @@ -89,11 +94,11 @@ export default { original: false, // 上传图片按照原始比例渲染 (默认:false) canMoveBox: true, // 截图框能否拖动 (默认:true) autoCrop: true, // 是否默认生成截图框 (默认:false) - // autoCropWidth: 480, // 默认生成截图框宽度 (默认:80%) - // autoCropHeight: 320, // 默认生成截图框高度 (默认:80%) + autoCropWidth: 480, // 默认生成截图框宽度 (默认:80%) + autoCropHeight: 124, // 默认生成截图框高度 (默认:80%) fixedBox: false, // 固定截图框大小 不允许改变 (默认:false) fixed: true, // 是否开启截图框宽高固定比例 (默认:true) - fixedNumber: [1.5, 1], // 截图框比例 (默认:[1:1]) + fixedNumber: [1, 0.26], // 截图框比例 (默认:[1:1]) enlarge: 1 }, isDisabled: false @@ -113,9 +118,9 @@ export default { // 向右旋转 this.$refs.cropper.rotateRight() }, - updateImg() { - this.option.img = this.imgFile.url - this.option.size = this.imgFile.size / 1024 > 200 ? 0.9 : 0.95 + updateImg(file) { + this.option.img = file.url + this.option.size = file.size / 1024 > 200 ? 0.9 : 0.95 }, realTime(data) { // 实时预览 diff --git a/src/components/modules/content.vue b/src/components/modules/content.vue index 5855307..7d78745 100644 --- a/src/components/modules/content.vue +++ b/src/components/modules/content.vue @@ -2,10 +2,10 @@
- + - + e.id == data.articleId) + name = item ? item.title : '' + } else { + name = el.$refs.column.getCheckedNodes()[0].pathLabels.join('/') } - if (data.connectionType === 3) { - if (!data.otherColumnId.length) return Util.errorMsg('请选择栏目') + } else if (data.connectionType === 3) { // 其他站点链接 + if (!data.otherColumnId.length) return Util.errorMsg('请选择栏目') + // 如果选择了文章,则取文章标题作为链接名称,否则取栏目标题 + if (data.otherArticleId) { + const item = el.articles.find(e => e.id == data.otherArticleId) + name = item ? item.title : '' + } else { + name = el.$refs.otherColumn.getCheckedNodes()[0].pathLabels.join('/') } + } else { // 站外链接 + if (!data.linkAddress) return Util.errorMsg('请输入站外链接') + name = data.linkAddress } - data.linkName = linkEle ? linkEle.getCheckedNodes()[0].pathLabels.join('/') : data.linkAddress - console.log("🚀 ~ file: module.vue ~ line 296 ~ linkSubmit ~ data", this.data) + data.linkName = name this.linkVisible = false }, // 模块设置提交 diff --git a/src/components/modules/link.vue b/src/components/modules/link.vue index b0e4ee5..43fb1a8 100644 --- a/src/components/modules/link.vue +++ b/src/components/modules/link.vue @@ -1,7 +1,7 @@