123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260 |
- <template>
- <div class="prev" v-if="dataDetail">
- <div>
- <div class="prev-text" style="margin-top: 0">
- <span>所属社区: </span><span class="text-right">{{ dataDetail.communityName }}</span>
- </div>
- <!-- <div class="prev-text detail">
- <div>发布对象:{{ dataDetail.treeData }}</div>
- <div class="detail-right">
- <el-tree
- class="filter-tree"
- ref="filterPeople"
- node-key="id"
- :data="organList"
- :props="defaultProps"
- default-expand-all
- :filter-node-method="filterNode"
- >
- </el-tree>
- </div>
- <div>查看详情</div>
- </div> -->
- <div class="prev-text">
- <span>通知类型: </span
- ><span class="text-right">{{ dataDetail.type == 0 ? '物业通知' : dataDetail.type == 1 ? '社区活动' : '其他' }}</span>
- </div>
- <div class="prev-text">
- <span> 标题:</span><span class="text-right">{{ dataDetail.title }}</span>
- </div>
- <div class="prev-text">
- <span>是否紧急:</span><span class="text-right">{{ dataDetail.urgentFlag ? '是' : '否' }}</span>
- </div>
- <div class="prev-text image-content" v-if="dataDetail.type">
- <div class="image-text">主题图片:</div>
- <div class="right-image" v-if="successImageLists.length > 0">
- <el-image
- class="images"
- v-for="(item, index) of successImageLists"
- :key="index"
- :src="item.url"
- :preview-src-list="[item.url]"
- ></el-image>
- <!-- <img v-for="(item, index) of successImageLists" :key="index" :src="item.url" alt="" /> -->
- <!-- <img src="https://a.storyblok.com/f/88751/1734x1092/c3cde09986/storyblok-editor-1.jpg/m/900x0/" alt="" /> -->
- <!-- <img src="https://a.storyblok.com/f/88751/1734x1092/c3cde09986/storyblok-editor-1.jpg/m/900x0/" alt="" /> -->
- <!-- <img src="https://a.storyblok.com/f/88751/1734x1092/c3cde09986/storyblok-editor-1.jpg/m/900x0/" alt="" /> -->
- </div>
- <div class="prev-text-none" v-else>暂无图片</div>
- </div>
- <div class="prev-text files">
- <div>文件上传:</div>
- <div v-if="filePath.length > 0" class="files-content">
- <div v-for="(item, index) of filePath" :key="index" class="prev-text-file">
- <div class="prev-text-right"><i class="el-icon-paperclip"></i> {{ item.name }}</div>
- </div>
- </div>
- <div class="prev-text-none" v-else style="margin-left: 25px">暂无文件</div>
- </div>
- <div class="prev-text html-content">
- <div class="html-left">通知内容:</div>
- <GeminiScrollbar class="my-scroll-bar" :autoshow="true">
- <!-- <div class="html-right"> -->
- <div v-html="dataDetail.content"></div>
- <!-- </div> -->
- </GeminiScrollbar>
- </div>
- </div>
- </div>
- </template>
- <script>
- export default {
- name: 'previeInform',
- props: {
- dataDetail: {
- type: Object,
- default: {}
- },
- detailPeople: {
- type: Array,
- default: () => []
- },
- filePath: {
- type: Array,
- default: () => []
- },
- successImageLists: {
- type: Array,
- default: () => []
- }
- },
- watch: {
- filterText(val) {
- this.$refs.filterPeople.filter(val);
- },
- dataDetail(val) {
- val.treeData;
- }
- // detailPeople(val) {
- // console.log('====================================');
- // this.filterPeople(val);
- // console.log('detailPeople', val);
- // console.log('====================================');
- // }
- },
- computed: {},
- data() {
- return {
- filterText: '',
- dataPeopleList: [],
- detailPeopleName: [],
- showTree: false,
- organList: [],
- defaultProps: {
- children: 'children',
- label: 'name'
- },
- treeArr: []
- };
- },
- created() {
- // this.getPeopleList();
- // this.getOrgTreeList();
- },
- computed: {},
- methods: {
- filterPeople(dataSource, currentArr) {
- // console.log('dataSource', JSON.stringify(dataSource));
- // console.log('currnArr', JSON.stringify(currentArr));
- dataSource.forEach((t, i) => {
- currentArr.forEach((x, xIndex) => {
- if (t.id === x.userId) {
- if (!this.treeArr.find((x2) => x2.id === t.id)) {
- this.treeArr.push({ id: t.id, label: t.label });
- }
- } else {
- if (Array.isArray(t.children) && t.children.length > 0) {
- this.filterPeople(t.children, currentArr);
- }
- }
- });
- });
- },
- // 获取房间
- // getOrgTreeList() {
- // this.$http
- // .get('/sc-community/assets/tree/community/find', { buildingType: this.buildingType })
- // .then(({ status, data, msg }) => {
- // if (status === 0 && data) {
- // this.organList = data;
- // }
- // // console.log('获取房间', data);
- // });
- // },
- filterNode(value, data) {
- // console.log('====================================');
- // console.log('filterNode value', value);
- // console.log('filterNode data', data.id);
- // console.log('====================================');
- if (!value) return true;
- return data.label.indexOf(value) !== -1;
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .prev {
- width: 100%;
- .prev-text {
- width: 100%;
- font-size: 12px;
- color: #424656;
- margin: 34px 20px;
- .text-right {
- margin-left: 25px;
- }
- }
- .detail {
- display: flex;
- position: relative;
- .detail-right {
- position: absolute;
- top: 0;
- right: 0;
- }
- }
- .files {
- display: flex;
- }
- .prev-text-none {
- font-size: 12px;
- }
- .image-content {
- width: 100%;
- display: flex;
- .image-text {
- width: 12%;
- display: flex;
- flex-direction: column;
- justify-content: center;
- }
- .right-image {
- max-height: 120px;
- display: flex;
- :last-child {
- margin-right: 0;
- }
- .images {
- display: block;
- float: left;
- width: 180px;
- height: 100px;
- border: 1px solid #ccc;
- border-radius: 4px;
- min-width: 100px;
- margin-right: 10px;
- }
- }
- }
- .files-content {
- min-width: 150px;
- display: flex;
- .prev-text-file {
- background: #f8fcff;
- border-radius: 4px;
- font-size: 14px;
- margin-left: 25px;
- padding: 2px 8px;
- .prev-text-right {
- overflow: hidden;
- white-space: nowrap;
- -o-text-overflow: ellipsis; //浏览器兼容
- text-overflow: ellipsis;
- }
- }
- }
- .html-content {
- display: flex;
- width: 100%;
- max-height: 200px;
- .html-left {
- margin-right: 5%;
- }
- }
- // 弹框自定义滚动条
- .my-scroll-bar {
- width: 86%;
- height: 200px;
- max-height: 218px;
- /deep/ .gm-scrollbar.-horizontal .thumb {
- height: 0;
- }
- }
- /deep/ .wscnph {
- max-width: 200px;
- max-height: 200px;
- }
- }
- </style>
|