|
@@ -20,7 +20,6 @@
|
|
|
<img src="../../assets/img/btn_tianjia@2x.png" alt="" @click="add" />
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
<div class="content">
|
|
|
<div class="roles-wrap">
|
|
|
<zz-table
|
|
@@ -177,53 +176,23 @@
|
|
|
:editable="false"
|
|
|
></el-date-picker>
|
|
|
</el-form-item>
|
|
|
- <!-- <el-form-item label="主题图片" prop="image" v-if="showUploadImage">
|
|
|
- <div>
|
|
|
- <el-upload
|
|
|
- class="avatar-uploader"
|
|
|
- action="/sc-community-web/upload/uploadFile"
|
|
|
- :show-file-list="false"
|
|
|
- :on-success="handleAvatarSuccess"
|
|
|
- :before-upload="beforeAvatarUpload"
|
|
|
- >
|
|
|
- <img v-if="imageUrl" :src="imageUrl" class="prev-image" />
|
|
|
- <div class="avatar-uploader-icon">
|
|
|
- <el-button type="primary" @click="clickUploadImage">点击上传</el-button>
|
|
|
- </div>
|
|
|
- </el-upload>
|
|
|
- <span class="uploader-explain">
|
|
|
- <el-upload
|
|
|
- v-if="showImageUrlTwo"
|
|
|
- class="avatar-uploader"
|
|
|
- action="/sc-community-web/upload/uploadFile"
|
|
|
- :show-file-list="false"
|
|
|
- :on-success="handleAvatarSuccessTwo"
|
|
|
- :before-upload="beforeAvatarUpload"
|
|
|
- >
|
|
|
- <img v-if="imageUrlTwo" :src="imageUrlTwo" class="prev-image" />
|
|
|
- <div class="avatar-uploader-icon">
|
|
|
- <el-button type="primary">点击上传</el-button>
|
|
|
- </div>
|
|
|
- </el-upload>
|
|
|
- <span v-if="showUploadImageText">
|
|
|
- 图片像素为670px * 300px,jpg/png图片格式,文件大小在 2M内,最多可上传2张图片</span
|
|
|
- >
|
|
|
- </span>
|
|
|
- </div></el-form-item
|
|
|
- > -->
|
|
|
+ <el-form-item label="主体图片" prop="image" v-show="showUploadImage">
|
|
|
+ <div class="up-image">
|
|
|
+ <up-image
|
|
|
+ color="#1890ff"
|
|
|
+ class="editor-upload-btn"
|
|
|
+ @successCBK="imageSuccessCBK"
|
|
|
+ @deleteImage="deleteImage"
|
|
|
+ @successImageList="successImageList"
|
|
|
+ ref="upImages"
|
|
|
+ ></up-image>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="通知内容" prop="informContent">
|
|
|
- <!-- tui-editor 富文本编辑器 -->
|
|
|
+ <!-- tinymce-editor 富文本编辑器 -->
|
|
|
<div class="editor-container">
|
|
|
- <!-- <markdown-editor
|
|
|
- ref="markdownEditor"
|
|
|
- v-model="markdownEditorContent"
|
|
|
- :language="language"
|
|
|
- height="180px"
|
|
|
- width="543"
|
|
|
- /> -->
|
|
|
- <tinymce v-model="editorContent" :height="140" :width="510" />
|
|
|
+ <tinymce v-model="editorContent" ref="endit" :height="150" />
|
|
|
</div>
|
|
|
- <!-- <el-button type="primary" icon="el-icon-document" @click="getHtml"> 预览 </el-button> -->
|
|
|
</el-form-item>
|
|
|
<el-form-item label="文件上传" prop="fill">
|
|
|
<div>
|
|
@@ -257,7 +226,11 @@
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
<!-- 详情显示 -->
|
|
|
- <previe-inform :dataDetail="rowDetail" :filePath="filePath"></previe-inform>
|
|
|
+ <previe-inform
|
|
|
+ :dataDetail="rowDetail"
|
|
|
+ :filePath="filePath"
|
|
|
+ :successImageLists="successImageLists"
|
|
|
+ ></previe-inform>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -273,27 +246,28 @@
|
|
|
<GeminiScrollbar class="my-scroll-bar" :autoshow="false" :color="red">
|
|
|
<div class="dialog-right-content">
|
|
|
<div class="dialog-title">
|
|
|
- <div class="dialog-titles" v-if="rowDetail">
|
|
|
+ <div class="dialog-titles">
|
|
|
{{ rowDetail.title ? rowDetail.title : '标题' }}
|
|
|
</div>
|
|
|
- <div class="dialog-titles" v-else>{{ ruleForm.title ? ruleForm.title : '标题' }}</div>
|
|
|
<div class="dialog-urgency" v-if="ruleForm.exigencyText">紧急</div>
|
|
|
</div>
|
|
|
- <div class="dialog-right-time" v-if="rowDetail">{{ rowDetail.pubDate }}</div>
|
|
|
+ <div class="dialog-right-time" v-if="showDetail">{{ rowDetail.pubDate }}</div>
|
|
|
<div class="dialog-right-time" v-else>{{ new Date() | filterTime }}</div>
|
|
|
<div></div>
|
|
|
<div class="content">
|
|
|
- <div class="content-text">
|
|
|
+ <div class="content-text" v-if="showDetail">
|
|
|
<div v-html="editorContent" id="content" />
|
|
|
</div>
|
|
|
- <!-- <div><img style="width: 100px; height: 100px" :src="imageUrl" alt="" /></div> -->
|
|
|
+ <div class="content-text" v-else>
|
|
|
+ <div v-html="contentHtml" id="content" />
|
|
|
+ </div>
|
|
|
<div class="content-inform">
|
|
|
<!-- <div>{{ !showDetail ? rowDetail.communityName : popCommunityName }}</div>
|
|
|
<div v-if="rowDetail">{{ rowDetail.pubDate }}</div>
|
|
|
<div v-else>{{ new Date() | filterTime }}</div>
|
|
|
<div>物业电话:{{ $store.state.cruUserInfo.phone }}</div> -->
|
|
|
</div>
|
|
|
- <div v-if="!rowDetail">
|
|
|
+ <div v-if="showDetail">
|
|
|
<div class="file-name" v-for="(item, index) of uploadFileUrl" :key="index">
|
|
|
<span class="file-name-left"><i class="el-icon-paperclip"></i> </span>
|
|
|
<span class="file-name-right">
|
|
@@ -325,59 +299,44 @@
|
|
|
<script>
|
|
|
import list from '@utils/list.js';
|
|
|
import previeInform from './common/previeInform';
|
|
|
+import upImage from './common/upImage';
|
|
|
// Tinymce 富文本编辑器
|
|
|
import Tinymce from '@/components/Tinymce';
|
|
|
const content = ` <div>
|
|
|
- 您好!为了给大家提供一个舒适、卫生的生活环境,进一步有效控制小区“四害”孳生,减少四害对大家生活影响,管理处计划12月份安排小区公共区域集中消杀4次。
|
|
|
- <div style="text-align: end; margin-right: 10px; color: #e0e1e3">
|
|
|
- <div style="margin-right: 30px">xxx物业管理处</div>
|
|
|
- <div>2022-02-22 02:02:02</div>
|
|
|
- <div>物业电话:13123123123</div>
|
|
|
- </div>
|
|
|
- </div>`;
|
|
|
+ 您好!为了给大家提供一个舒适、卫生的生活环境,进一步有效控制小区“四害”孳生,减少四害对大家生活影响,管理处计划12月份安排小区公共区域集中消杀4次。
|
|
|
+ <div style="text-align: end; margin-right: 10px; color: #e0e1e3">
|
|
|
+ <div style="margin-right: 30px">xxx物业管理处</div>
|
|
|
+ <div>2022-02-22 02:02:02</div>
|
|
|
+ <div>物业电话:13123123123</div>
|
|
|
+ </div>
|
|
|
+ </div>`;
|
|
|
export default {
|
|
|
mixins: [list],
|
|
|
- components: { previeInform, Tinymce },
|
|
|
+ components: { previeInform, Tinymce, upImage },
|
|
|
data() {
|
|
|
let _this = this;
|
|
|
return {
|
|
|
popCommunityName: '',
|
|
|
fileList: [],
|
|
|
// 显示图片上传
|
|
|
- imageUrl: '',
|
|
|
- imageUrlTwo: '',
|
|
|
showUploadImage: false,
|
|
|
- showImageUrlTwo: false,
|
|
|
- showUploadImageText: true,
|
|
|
dialogImageUrl: '',
|
|
|
- disabled: false,
|
|
|
// 显示详情
|
|
|
showDetail: true,
|
|
|
rowDetail: '',
|
|
|
// 富文本编辑器
|
|
|
editorContent: content,
|
|
|
- html: content,
|
|
|
- languageTypeList: {
|
|
|
- en: 'en_US',
|
|
|
- zh: 'zh_CN',
|
|
|
- es: 'es_ES'
|
|
|
- },
|
|
|
+ contentHtml: '',
|
|
|
+ contents: ` <div>
|
|
|
+ 您好!为了给大家提供一个舒适、卫生的生活环境,进一步有效控制小区“四害”孳生,减少四害对大家生活影响,管理处计划12月份安排小区公共区域集中消杀4次。
|
|
|
+ <div style="text-align: end; margin-right: 10px; color: #e0e1e3">
|
|
|
+ <div style="margin-right: 30px">xxx物业管理处</div>
|
|
|
+ <div>2022-02-22 02:02:02</div>
|
|
|
+ <div>物业电话:13123123123</div>
|
|
|
+ </div>
|
|
|
+ </div>`,
|
|
|
// 查询的时间
|
|
|
searchTime: [],
|
|
|
- // 选择的房间
|
|
|
- optionsRoom: [],
|
|
|
- // 选择的员工
|
|
|
- selectStaff: [],
|
|
|
- optionsStaff: [
|
|
|
- {
|
|
|
- value: '选项1',
|
|
|
- label: '员工A'
|
|
|
- },
|
|
|
- {
|
|
|
- value: '选项2',
|
|
|
- label: '员工B'
|
|
|
- }
|
|
|
- ],
|
|
|
// 添加弹框信息
|
|
|
ruleForm: {
|
|
|
popCommunityId: '', //所属社区
|
|
@@ -480,8 +439,6 @@ export default {
|
|
|
mixins_post: 'post',
|
|
|
// 显隐弹框
|
|
|
centerDialogVisible: false,
|
|
|
- // 保存上传的文本
|
|
|
- newConten: '',
|
|
|
// 获取的房间信息
|
|
|
houseData: [],
|
|
|
peopleData: [],
|
|
@@ -502,27 +459,12 @@ export default {
|
|
|
this.mixins_query = {};
|
|
|
this.mixins_search();
|
|
|
},
|
|
|
- computed: {
|
|
|
- language() {
|
|
|
- return this.languageTypeList['zh_CN'];
|
|
|
- }
|
|
|
- },
|
|
|
mounted() {},
|
|
|
- watch: {
|
|
|
- html(newv, oldv) {
|
|
|
- console.log('watch', newv, oldv);
|
|
|
- },
|
|
|
- newConten(newv, oldv) {
|
|
|
- console.log('newConten', newv, oldv);
|
|
|
- }
|
|
|
- },
|
|
|
+ watch: {},
|
|
|
methods: {
|
|
|
// 人员树
|
|
|
dataPeople(data) {
|
|
|
this.peopleData = data;
|
|
|
- console.log('====================================');
|
|
|
- console.log('人员', data);
|
|
|
- console.log('====================================');
|
|
|
},
|
|
|
// 房间树
|
|
|
buildingInformation(data) {
|
|
@@ -567,51 +509,27 @@ export default {
|
|
|
});
|
|
|
this.fileList = removeName;
|
|
|
this.uploadFileUrl = removeName;
|
|
|
- console.log('点击一处', this.fileList);
|
|
|
+ console.log('点击移除', this.fileList);
|
|
|
},
|
|
|
|
|
|
/**上传图片*/
|
|
|
- clickUploadImage() {
|
|
|
- this.showImageUrlTwo = true;
|
|
|
- this.showUploadImageText = false;
|
|
|
- this.html = this.$refs.markdownEditor.getHtml();
|
|
|
- console.log('富文本内容', this.editorContent);
|
|
|
+ successImageList(arr) {
|
|
|
+ this.successImageLists = arr;
|
|
|
+ console.log('====================================');
|
|
|
+ console.log('上传图片', arr);
|
|
|
+ console.log('====================================');
|
|
|
},
|
|
|
- handleAvatarSuccess(res, file) {
|
|
|
- // this.imageUrl = URL.createObjectURL(file.raw);
|
|
|
- this.imageUrl = res.data;
|
|
|
- let contentText = document.getElementById('content');
|
|
|
- let image = document.createElement('img');
|
|
|
- image.src = res.data;
|
|
|
- contentText.appendChild(image);
|
|
|
- this.newConten = contentText;
|
|
|
- console.log('获取最新预览文本内容', contentText);
|
|
|
- console.log('this.imageUrl', this.imageUrl);
|
|
|
- console.log('handleAvatarSuccess', res, file);
|
|
|
+ imageSuccessCBK(arr) {
|
|
|
+ this.$refs.endit.imageSuccessCBK(arr);
|
|
|
},
|
|
|
- handleAvatarSuccessTwo(res, file) {
|
|
|
- this.imageUrlTwo = URL.createObjectURL(file.raw);
|
|
|
- console.log('handleAvatarSuccess', res, file);
|
|
|
+ deleteImage(val) {
|
|
|
+ this.$refs.endit.deleteImage(val);
|
|
|
},
|
|
|
- beforeAvatarUpload(file) {
|
|
|
- const isJPG = file.type === 'image/jpeg';
|
|
|
- const isPNG = file.type === 'image/png';
|
|
|
- const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
|
|
|
- if (!isJPG && !isPNG) {
|
|
|
- this.$message.error('上传头像图片只能是 JPG或PNG格式!');
|
|
|
- }
|
|
|
- if (!isLt2M) {
|
|
|
- this.$message.error('上传头像图片大小不能超过 2MB!');
|
|
|
- }
|
|
|
- return isJPG && isLt2M;
|
|
|
- },
|
|
|
handleRemove(file) {
|
|
|
console.log(file);
|
|
|
},
|
|
|
- handlePictureCardPreview(file) {
|
|
|
- this.dialogImageUrl = file.url;
|
|
|
- },
|
|
|
+
|
|
|
handleDownload(file) {
|
|
|
console.log(file);
|
|
|
},
|
|
@@ -624,35 +542,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- getSelect(data) {
|
|
|
- var str = [];
|
|
|
- const getStr = function (list) {
|
|
|
- list.forEach(function (row) {
|
|
|
- if (row.children) {
|
|
|
- getStr(row.children);
|
|
|
- } else {
|
|
|
- if (row.type !== 'unit') {
|
|
|
- str.push(row.value);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- };
|
|
|
- getStr(data);
|
|
|
- return str;
|
|
|
- console.log('getStr', str);
|
|
|
- },
|
|
|
- dimension(arr) {
|
|
|
- var arrs = [];
|
|
|
- arr.map((item, index) => {
|
|
|
- if (!!item.children & (item.type !== 'unit')) {
|
|
|
- this.dimension(item.children);
|
|
|
- } else {
|
|
|
- if (item.name.indexOf('单元') === -1 && item.type !== 'unit') {
|
|
|
- arrs.push(item.value);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
// 选中的房间
|
|
|
selectDataHouseTree(val) {
|
|
|
// this.selectDataHouseTreeData = val;
|
|
@@ -728,17 +617,27 @@ export default {
|
|
|
},
|
|
|
// 发布活动类型
|
|
|
changeInformType(val) {
|
|
|
- if (val == 0) {
|
|
|
+ if (val) {
|
|
|
this.showUploadImage = true;
|
|
|
+ this.showDetail = false;
|
|
|
+ this.rowDetail = '';
|
|
|
+ this.showDetail = true;
|
|
|
+ this.centerDialogVisible = true;
|
|
|
+ this.$refs.upImages.clearImageList();
|
|
|
} else {
|
|
|
this.showUploadImage = false;
|
|
|
+ this.$refs.endit.setContent(this.contents);
|
|
|
}
|
|
|
console.log('发布活动类型', val);
|
|
|
},
|
|
|
/**添加按钮 */
|
|
|
add() {
|
|
|
+ this.rowDetail = '';
|
|
|
this.showDetail = true;
|
|
|
this.centerDialogVisible = true;
|
|
|
+ this.$refs.endit.setContent(this.contents);
|
|
|
+ this.$refs.upImages.clearImageList();
|
|
|
+ this.$refs['ruleForm'].resetFields();
|
|
|
},
|
|
|
/**查询按钮*/
|
|
|
searchInfo() {
|
|
@@ -756,16 +655,6 @@ export default {
|
|
|
console.log('点击查询', this.searchTime);
|
|
|
this.mixins_search();
|
|
|
},
|
|
|
- /**预览富文本内容*/
|
|
|
- getHtml() {
|
|
|
- this.html = this.$refs.markdownEditor.getHtml();
|
|
|
- console.log('====================, this.markdownEditorContent================');
|
|
|
- console.log(this.html);
|
|
|
- let contentText = document.getElementById('content');
|
|
|
- this.markdownEditorContent = contentText;
|
|
|
- console.log('获取最新预览文本内容', contentText);
|
|
|
- console.log('====================================');
|
|
|
- },
|
|
|
/**
|
|
|
* 弹框按钮
|
|
|
* @param type 类型
|
|
@@ -773,8 +662,8 @@ export default {
|
|
|
* */
|
|
|
dialogButton(type) {
|
|
|
if (type === 'prev') {
|
|
|
- if (this.selectDataHouseTreeData.length < 1) {
|
|
|
- this.$message.warning('请选择房间');
|
|
|
+ if (this.selectDataHouseTreeData.length < 1 && this.selectDataPeopleTreeData.length < 1) {
|
|
|
+ return this.$message.warning('请选择房间');
|
|
|
}
|
|
|
this.$refs['ruleForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
@@ -791,7 +680,7 @@ export default {
|
|
|
pubDate: this.$moment(new Date()).format(`YYYY-MM-DDTHH:mm:ss`),
|
|
|
// pubPeople:ruleForm.informType,
|
|
|
// pubStatus: "",
|
|
|
- // themePictrue: '',
|
|
|
+ themePictrue: JSON.stringify(this.successImageLists),
|
|
|
userId: this.ruleForm.issueRoom.checkAll ? this.selectDataHouseTreeData : this.selectDataPeopleTreeData,
|
|
|
title: this.ruleForm.title,
|
|
|
type: this.ruleForm.informType,
|
|
@@ -805,6 +694,8 @@ export default {
|
|
|
this.mixins_search();
|
|
|
} else {
|
|
|
this.$message('发布失败,请重试');
|
|
|
+ this.successImageList = [];
|
|
|
+ this.contentHtml = '';
|
|
|
}
|
|
|
this.centerDialogVisible = false;
|
|
|
|
|
@@ -816,9 +707,15 @@ export default {
|
|
|
});
|
|
|
} else if (type == 'clear') {
|
|
|
this.centerDialogVisible = false;
|
|
|
+ this.rowDetail = '';
|
|
|
+ this.$refs.endit.setContent(this.contents);
|
|
|
+ this.$refs.upImages.clearImageList();
|
|
|
this.$refs['ruleForm'].resetFields();
|
|
|
} else {
|
|
|
this.centerDialogVisible = false;
|
|
|
+ this.rowDetail = '';
|
|
|
+ this.$refs.endit.setContent(this.contents);
|
|
|
+ this.$refs.upImages.clearImageList();
|
|
|
this.$refs['ruleForm'].resetFields();
|
|
|
}
|
|
|
},
|
|
@@ -840,15 +737,20 @@ export default {
|
|
|
/** 查看详情*/
|
|
|
clickDatail(row) {
|
|
|
this.rowDetail = [];
|
|
|
- console.log('查看详情', row);
|
|
|
- this.centerDialogVisible = true;
|
|
|
- this.showDetail = false;
|
|
|
this.$http.get('/sc-community-web/notice/find/' + row.id).then((res) => {
|
|
|
- this.rowDetail = row;
|
|
|
- // let fileArr = row.filePath.split(',');
|
|
|
- // this.filePath = fileArr.slice(0, fileArr.length - 1);
|
|
|
- this.filePath = JSON.parse(row.filePath);
|
|
|
- console.log('查看详情', res);
|
|
|
+ if (res.status === 0) {
|
|
|
+ this.centerDialogVisible = true;
|
|
|
+ this.showDetail = false;
|
|
|
+ this.rowDetail = res.data;
|
|
|
+ // let fileArr = row.filePath.split(',');
|
|
|
+ // this.filePath = fileArr.slice(0, fileArr.length - 1);
|
|
|
+ this.filePath = JSON.parse(row.filePath);
|
|
|
+ this.successImageLists = JSON.parse(row.themePictrue);
|
|
|
+ this.contentHtml = row.content;
|
|
|
+ console.log('查看详情', res);
|
|
|
+ } else {
|
|
|
+ return this.$message('获取详情失败!请稍后重试');
|
|
|
+ }
|
|
|
});
|
|
|
// this.ruleForm.title = row.managementName;
|
|
|
// this.ruleForm.newPhone = row.phone;
|