diff --git a/src/views/components/tinymce2/index.vue b/src/views/components/tinymce2/index.vue index 405f52807..afb355118 100644 --- a/src/views/components/tinymce2/index.vue +++ b/src/views/components/tinymce2/index.vue @@ -187,7 +187,7 @@ export default { this.$emit("input", editor.getContent()); }); editor.on("blur", () => { - this.$emit("blur"); + this.$emit("blur", editor.getContent()); }); }, dormatHtml(content) { diff --git a/src/views/modules/communityParty/promotion/components/eventDetails.vue b/src/views/modules/communityParty/promotion/components/eventDetails.vue deleted file mode 100644 index 0dc5f9bcc..000000000 --- a/src/views/modules/communityParty/promotion/components/eventDetails.vue +++ /dev/null @@ -1,278 +0,0 @@ - - - - diff --git a/src/views/modules/communityParty/promotion/components/initiateActivity.vue b/src/views/modules/communityParty/promotion/components/initiateActivity.vue deleted file mode 100644 index f22211a28..000000000 --- a/src/views/modules/communityParty/promotion/components/initiateActivity.vue +++ /dev/null @@ -1,881 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/views/modules/communityParty/promotion/components/promotionDialog.vue b/src/views/modules/communityParty/promotion/components/promotionDialog.vue index 59387a9e3..f2e104c84 100644 --- a/src/views/modules/communityParty/promotion/components/promotionDialog.vue +++ b/src/views/modules/communityParty/promotion/components/promotionDialog.vue @@ -4,27 +4,28 @@
- + -
- +
- +
@@ -37,6 +38,10 @@ 取 消 确 定
+ + + + @@ -47,6 +52,7 @@ import { Loading } from 'element-ui' // 引入Loading服务 import { requestPost } from '@/js/dai/request' import Tinymce from '@c/tinymce2/index.vue' import UploadImage from '@/views/modules/plugins/rent/upload-image.vue' +import ElImageViewer from "element-ui/packages/image/src/image-viewer" const defaultFormData = { id: undefined, @@ -61,7 +67,7 @@ const defaultFormData = { let loading // 加载动画 export default { - components: { Tinymce, UploadImage }, + components: { Tinymce, UploadImage, ElImageViewer }, props: { visible: { type: Boolean, @@ -81,6 +87,7 @@ export default { btnDisable: false, typeList: [], uploadUrl: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2', + isShowPics: false } }, @@ -109,6 +116,7 @@ export default { // 详情数据 async initForm(row) { if (row && row.id) { + this.startLoading() let url = `/actual/base/partyPublicity/${row.id}` const { data, code, msg } = await requestPost(url) this.formData = data ? data : _.cloneDeep(defaultFormData) @@ -120,20 +128,19 @@ export default { } else { this.fileList = [] } - - // this.startLoading() - - // this.endLoading() - } else { - + this.endLoading() } }, - validateContent() { - // 使用正则表达式去除HTML标签后检查内容 - const textContent = this.stripHtml(this.formData.sumUp); - if (textContent.trim() === '') { - this.formData.sumUp = null; + // 校验富文本内容是否为空 + validateContent(val) { + const textContent = this.stripHtml(val); + const hasImgTag = /]+>/i.test(val); + if (textContent.trim() === '' && !hasImgTag) { + this.formData.content = ''; + this.$refs['ref_form'].validateField('content') + } else { + this.$refs['ref_form'].validateField('content') } }, stripHtml(html) { @@ -142,93 +149,30 @@ export default { return div.textContent || div.innerText || ''; }, - // 上传成功 - handleImgSuccess(res, file, fileList) { - if (res.code === 0 && res.msg === 'success') { - let format = file.name.split('.').pop(); - let srcType = file.raw.type; - let type = 'file'; - if (srcType.indexOf('image') != -1) { - type = 'image'; - } else if (srcType.indexOf('video') != -1) { - type = 'video'; - } - - this.formData.coverPic = res.data.url; - - } else { - this.$message.error(res.msg); - } - }, - // 删除图片 - handleImgRemove(file) { - console.log('handleImgRemove', file); - if (file.response) { - let index = this.formData.activityImgs.findIndex(item => item.url == file.response.data.url); - this.formData.activityImgs.splice(index, 1); - } else if (file.url) { - let index = this.formData.activityImgs.findIndex(item => item.url == file.url); - this.formData.activityImgs.splice(index, 1); - } - }, // 图片预览 handleImgPreview(file) { - console.log(file); - window.open(file.url || file.response.data.url); - }, - // 文件数量超过限制 - handleImgExceed() { - this.$message({ - type: 'warning', - message: '文件数量最多不超过三个' - }); + this.isShowPics = true }, - // 上传前的验证 - beforeImgUpload(file) { - const isLt1M = file.size / 1024 / 1024 < 10; - const srcType = file.type; - const format = file.name.split('.').pop(); - if (!isLt1M) { - this.$message.error('上传文件大小不能超过 10MB!'); - return false; - } - if (srcType.indexOf('image') == -1) { - this.$message.error('仅限图片格式'); - return false; - } - return true; + closeViewer() { + this.isShowPics = false }, removedImg() { this.formData.coverPic = '' }, - onChangeFileList(e) { - this.fileList = e.length > 0 ? e.map(item => ({ + + onChangeFileList(fileList) { + this.fileList = fileList.length > 0 ? fileList.map(item => ({ fileType: '0', fileUrl: item.response.data.url })) : []; // 当e为空时清空fileList - if (e.length > 0) { - this.formData.coverPic = e[0].response.data.url; + if (fileList.length > 0) { + this.formData.coverPic = fileList[0].response.data.url; } else { this.formData.coverPic = ''; } }, - onChangeImgs(e, rowIndex = 0) { - console.log('onChangeFileList', e) - if (e.length > 0) { - this.activityImgs = [] - e.forEach(item => { - let ob = { - fileType: '0', - fileUrl: item.response.data.url - } - this.activityImgs.push(ob) - }) - } - }, - - async handleConfirm() { this.$refs['ref_form'].validate(async valid => { if (valid) { diff --git a/src/views/modules/communityParty/promotion/components/summDetails.vue b/src/views/modules/communityParty/promotion/components/summDetails.vue deleted file mode 100644 index 09b25d709..000000000 --- a/src/views/modules/communityParty/promotion/components/summDetails.vue +++ /dev/null @@ -1,313 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/views/modules/communityParty/promotion/index.vue b/src/views/modules/communityParty/promotion/index.vue index 09653a31b..c7f2d928d 100644 --- a/src/views/modules/communityParty/promotion/index.vue +++ b/src/views/modules/communityParty/promotion/index.vue @@ -302,11 +302,8 @@ export default { }, computed: { tableHeight() { - return this.$store.state.inIframe ? this.clientHeight - 430 + this.iframeHeight : this.clientHeight - 430 - }, - ...mapGetters(['clientHeight', 'iframeHeight']) } } @@ -324,14 +321,6 @@ export default { margin: 20px 7px 7px; } -// .item_width_1 { -// width: 260px; -// } - -// .item_width_2 { -// width: 495px; -// } - .m-table { background: #ffffff; box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1); @@ -339,19 +328,6 @@ export default { margin-top: 15px; padding: 24px 16px 10px; margin: 16px 7px 7px; - - // .table { - // margin-top: 20px; - // } } - - -.el-row { - /* margin-bottom: 20px; */ - display: flex; - flex-wrap: wrap; - margin-top: 10px; - margin-right: 50px; -} \ No newline at end of file diff --git a/src/views/modules/plugins/rent/upload-image.vue b/src/views/modules/plugins/rent/upload-image.vue index 4f6c12dd7..e7a69b5d0 100644 --- a/src/views/modules/plugins/rent/upload-image.vue +++ b/src/views/modules/plugins/rent/upload-image.vue @@ -42,6 +42,10 @@ export default { }, defaultFileList: { type: Array + }, + isInPreview: { + type: Boolean, + default: true } }, watch: { @@ -82,8 +86,12 @@ export default { console.log(this.fileList); }, handlePictureCardPreview(file) { - this.dialogImageUrl = file.url - this.dialogVisible = true + if (this.isInPreview) { + this.dialogImageUrl = file.url + this.dialogVisible = true + } else this.$emit('preview', file) + + }, beforeImgUpload(file) { // console.log(file) diff --git a/src/views/modules/villageGovernance/revitalize/components/revitalizeDialog.vue b/src/views/modules/villageGovernance/revitalize/components/revitalizeDialog.vue new file mode 100644 index 000000000..2a6d17545 --- /dev/null +++ b/src/views/modules/villageGovernance/revitalize/components/revitalizeDialog.vue @@ -0,0 +1,275 @@ + + + + + + \ No newline at end of file diff --git a/src/views/modules/villageGovernance/revitalize/index.vue b/src/views/modules/villageGovernance/revitalize/index.vue new file mode 100644 index 000000000..a828a7308 --- /dev/null +++ b/src/views/modules/villageGovernance/revitalize/index.vue @@ -0,0 +1,299 @@ + + + \ No newline at end of file