previeInform.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <div class="prev" v-if="dataDetail">
  3. <div>
  4. <div class="prev-text" style="margin-top: 0">
  5. <span>所属社区: </span><span class="text-right">{{ dataDetail.communityName }}</span>
  6. </div>
  7. <!-- <div class="prev-text detail">
  8. <div>发布对象:{{ dataDetail.treeData }}</div>
  9. <div>发布对象:{{ houseData }}</div>
  10. <div class="detail-right">
  11. <el-tree
  12. class="filter-tree"
  13. ref="filterPeople"
  14. node-key="id"
  15. :data="houseData"
  16. :props="defaultProps"
  17. default-expand-all
  18. :filter-node-method="filterNode"
  19. >
  20. </el-tree>
  21. </div>
  22. <div>查看详情</div>
  23. </div> -->
  24. <div class="prev-text">
  25. <span>通知类型: </span
  26. ><span class="text-right">{{ dataDetail.type == 0 ? '物业通知' : dataDetail.type == 1 ? '社区活动' : '其他' }}</span>
  27. </div>
  28. <div class="prev-text">
  29. <span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 标题:</span><span class="text-right">{{ dataDetail.title }}</span>
  30. </div>
  31. <div class="prev-text">
  32. <span>是否紧急:</span><span class="text-right">{{ dataDetail.urgentFlag ? '是' : '否' }}</span>
  33. </div>
  34. <div class="prev-text image-content" v-if="dataDetail.type">
  35. <div class="image-text">主题图片:</div>
  36. <div class="right-image" v-if="successImageLists.length > 0">
  37. <el-image
  38. class="images"
  39. v-for="(item, index) of successImageLists"
  40. :key="index"
  41. :src="item.url"
  42. :preview-src-list="[item.url]"
  43. ></el-image>
  44. <!-- <img v-for="(item, index) of successImageLists" :key="index" :src="item.url" alt="" /> -->
  45. <!-- <img src="https://a.storyblok.com/f/88751/1734x1092/c3cde09986/storyblok-editor-1.jpg/m/900x0/" alt="" /> -->
  46. <!-- <img src="https://a.storyblok.com/f/88751/1734x1092/c3cde09986/storyblok-editor-1.jpg/m/900x0/" alt="" /> -->
  47. <!-- <img src="https://a.storyblok.com/f/88751/1734x1092/c3cde09986/storyblok-editor-1.jpg/m/900x0/" alt="" /> -->
  48. </div>
  49. <div class="prev-text-none" v-else>暂无图片</div>
  50. </div>
  51. <div class="prev-text files">
  52. <div>文件上传:</div>
  53. <div v-if="filePath.length > 0" class="files-content">
  54. <div v-for="(item, index) of filePath" :key="index" class="prev-text-file">
  55. <div class="prev-text-right"><i class="el-icon-paperclip"></i> {{ item.name }}</div>
  56. </div>
  57. </div>
  58. <div class="prev-text-none" v-else style="margin-left: 25px">暂无文件</div>
  59. </div>
  60. <div class="prev-text html-content">
  61. <div class="html-left">通知内容:</div>
  62. <GeminiScrollbar class="my-scroll-bar" :autoshow="true">
  63. <!-- <div class="html-right"> -->
  64. <div v-html="dataDetail.content"></div>
  65. <!-- </div> -->
  66. </GeminiScrollbar>
  67. </div>
  68. </div>
  69. </div>
  70. </template>
  71. <script>
  72. export default {
  73. name: 'previeInform',
  74. props: {
  75. dataDetail: {
  76. type: Object,
  77. default: () => {}
  78. },
  79. houseData: {
  80. type: Array,
  81. default: () => []
  82. },
  83. detailPeople: {
  84. type: Array,
  85. default: () => []
  86. },
  87. filePath: {
  88. type: Array,
  89. default: () => []
  90. },
  91. successImageLists: {
  92. type: Array,
  93. default: () => []
  94. }
  95. },
  96. watch: {
  97. filterText(val) {
  98. this.$refs.filterPeople.filter(val);
  99. },
  100. dataDetail(val) {
  101. val.treeData;
  102. }
  103. // detailPeople(val) {
  104. // console.log('====================================');
  105. // this.filterPeople(val);
  106. // console.log('detailPeople', val);
  107. // console.log('====================================');
  108. // }
  109. },
  110. computed: {},
  111. data() {
  112. return {
  113. filterText: '',
  114. dataPeopleList: [],
  115. detailPeopleName: [],
  116. showTree: false,
  117. organList: [],
  118. defaultProps: {
  119. children: 'children',
  120. label: 'name'
  121. },
  122. treeArr: []
  123. };
  124. },
  125. created() {
  126. // this.getPeopleList();
  127. // this.getOrgTreeList();
  128. },
  129. computed: {},
  130. methods: {
  131. filterPeople(dataSource, currentArr) {
  132. // console.log('dataSource', JSON.stringify(dataSource));
  133. // console.log('currnArr', JSON.stringify(currentArr));
  134. dataSource.forEach((t, i) => {
  135. currentArr.forEach((x, xIndex) => {
  136. if (t.id === x.userId) {
  137. if (!this.treeArr.find((x2) => x2.id === t.id)) {
  138. this.treeArr.push({ id: t.id, label: t.label });
  139. }
  140. } else {
  141. if (Array.isArray(t.children) && t.children.length > 0) {
  142. this.filterPeople(t.children, currentArr);
  143. }
  144. }
  145. });
  146. });
  147. },
  148. // 获取房间
  149. // getOrgTreeList() {
  150. // this.$http
  151. // .get('/sc-community/assets/tree/community/find', { buildingType: this.buildingType })
  152. // .then(({ status, data, msg }) => {
  153. // if (status === 0 && data) {
  154. // this.organList = data;
  155. // }
  156. // // console.log('获取房间', data);
  157. // });
  158. // },
  159. filterNode(value, data) {
  160. // console.log('====================================');
  161. // console.log('filterNode value', value);
  162. // console.log('filterNode data', data.id);
  163. // console.log('====================================');
  164. if (!value) return true;
  165. return data.label.indexOf(value) !== -1;
  166. }
  167. }
  168. };
  169. </script>
  170. <style lang="scss" scoped>
  171. .prev {
  172. width: 100%;
  173. .prev-text {
  174. width: 100%;
  175. font-size: 12px;
  176. color: #424656;
  177. margin: 34px 20px;
  178. .text-right {
  179. margin-left: 25px;
  180. }
  181. }
  182. .detail {
  183. display: flex;
  184. position: relative;
  185. .detail-right {
  186. position: absolute;
  187. top: 0;
  188. right: 0;
  189. }
  190. }
  191. .files {
  192. display: flex;
  193. }
  194. .prev-text-none {
  195. font-size: 12px;
  196. }
  197. .image-content {
  198. width: 100%;
  199. display: flex;
  200. .image-text {
  201. width: 12%;
  202. display: flex;
  203. flex-direction: column;
  204. justify-content: center;
  205. }
  206. .right-image {
  207. max-height: 120px;
  208. display: flex;
  209. :last-child {
  210. margin-right: 0;
  211. }
  212. .images {
  213. display: block;
  214. float: left;
  215. width: 180px;
  216. height: 100px;
  217. border: 1px solid #ccc;
  218. border-radius: 4px;
  219. min-width: 100px;
  220. margin-right: 10px;
  221. }
  222. }
  223. }
  224. .files-content {
  225. min-width: 150px;
  226. display: flex;
  227. .prev-text-file {
  228. background: #f8fcff;
  229. border-radius: 4px;
  230. font-size: 14px;
  231. margin-left: 25px;
  232. padding: 2px 8px;
  233. .prev-text-right {
  234. overflow: hidden;
  235. white-space: nowrap;
  236. -o-text-overflow: ellipsis; //浏览器兼容
  237. text-overflow: ellipsis;
  238. }
  239. }
  240. }
  241. .html-content {
  242. display: flex;
  243. width: 100%;
  244. max-height: 200px;
  245. .html-left {
  246. margin-right: 5%;
  247. }
  248. }
  249. // 弹框自定义滚动条
  250. .my-scroll-bar {
  251. width: 86%;
  252. height: 200px;
  253. max-height: 218px;
  254. /deep/ .gm-scrollbar.-horizontal .thumb {
  255. height: 0;
  256. }
  257. }
  258. /deep/ .wscnph {
  259. max-width: 200px;
  260. max-height: 200px;
  261. }
  262. }
  263. </style>