previeInform.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. <template>
  2. <div class="prev" v-if="dataDetail">
  3. <!-- <div class="dialog-header" v-show="showrightPhone">
  4. <div class="dialogTitle">{{ dataDetail.type == 0 ? '物业通知' : '社区活动' }}详情</div>
  5. </div> -->
  6. <!-- 详情左侧部分 -->
  7. <div class="detail-left">
  8. <div class="prev-text" style="margin-top: 0">
  9. <span>所属社区:</span><span class="text-right">{{ dataDetail.communityName }}</span>
  10. </div>
  11. <div class="prev-text detail">
  12. <div class="prev-obj">
  13. <div class="files-text">发布对象:</div>
  14. <div v-if="userType == 2">
  15. <div class="prev-obj-right">
  16. <div class="prev-obj-text">社区住户/{{ '指定房间' }}/{{ houseDataNames }}</div>
  17. <div @click="clickDetailHouse()" class="click-prev">{{ showTreeHouse ? '关闭详情' : '查看详情' }}</div>
  18. </div>
  19. <div class="prev-obj-right">
  20. <div class="prev-obj-text">
  21. 社区员工/{{ '指定员工' }}/{{ peopleData[0].value }}/
  22. {{ houseDataNamesPeople }}
  23. </div>
  24. <div @click="clickDetailPeople()" class="click-prev">{{ showTreePeople ? '关闭详情' : '查看详情' }}</div>
  25. </div>
  26. </div>
  27. <div class="prev-obj-right" v-else>
  28. <div class="prev-obj-text" v-if="userType == 0">社区住户/{{ '指定房间' }}/{{ houseDataNames }}</div>
  29. <div class="prev-obj-text" v-else>社区员工/{{ '指定员工' }}/{{ houseDataNamesPeople }}</div>
  30. <div @click="clickDetail()" class="click-prev">{{ showTree ? '关闭详情' : '查看详情' }}</div>
  31. </div>
  32. </div>
  33. <div v-if="showTree">
  34. <div>
  35. <!-- 社区住户 -->
  36. <div class="prev-detail-right" v-if="(userType == 0 || userType == 2) && showTreeHouse">
  37. <GeminiScrollbar class="prev-my-scroll-bar" :autoshow="true">
  38. <el-tree
  39. class="filter-tree"
  40. ref="filterHouse"
  41. node-key="id"
  42. :data="houseData"
  43. :props="defaultProps"
  44. :default-expand-all="true"
  45. :filter-node-method="filterNode"
  46. @node-collapse="closeTree"
  47. >
  48. <span class="custom-tree-node" slot-scope="{ node, data }">
  49. <span v-if="data.children == null || data.children.length > 0">
  50. <span class="circle"></span>
  51. {{ data.name }}</span
  52. >
  53. </span>
  54. </el-tree>
  55. </GeminiScrollbar>
  56. </div>
  57. <!-- 社区人员 -->
  58. <div
  59. :class="{ 'prev-detail-right': true, 'prev-detail-right-two': userType == 2 }"
  60. v-if="(userType == 1 || userType == 2) && showTreePeople"
  61. >
  62. <GeminiScrollbar class="prev-my-scroll-bar" :autoshow="true">
  63. <el-tree
  64. class="filter-tree"
  65. ref="filterHouse"
  66. node-key="id"
  67. :data="peopleData"
  68. :props="defaultPropsPeople"
  69. :default-expand-all="true"
  70. :filter-node-method="filterNode"
  71. @node-collapse="closeTree"
  72. >
  73. <span class="custom-tree-node" slot-scope="{ node, data }">
  74. <span v-if="data.children == null || data.children.length > 0">
  75. <span class="circle"></span>{{ data.label }}</span
  76. >
  77. </span>
  78. </el-tree>
  79. </GeminiScrollbar>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. <div class="prev-text">
  85. <span class="files-text">通知类型: </span
  86. ><span class="text-right">{{ dataDetail.type == 0 ? '物业通知' : dataDetail.type == 1 ? '社区活动' : '其他' }} </span>
  87. </div>
  88. <div class="prev-text" v-if="dataDetail.type == 1">
  89. <span class="files-text">活动时间: </span
  90. ><span class="text-right">{{ dataDetail.startTime }} - {{ dataDetail.endTime }}</span>
  91. </div>
  92. <div class="prev-text">
  93. <span class="files-text"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 标题:</span
  94. ><span class="text-right">{{ dataDetail.title }}</span>
  95. </div>
  96. <div class="prev-text">
  97. <span class="files-text">是否紧急:</span><span class="text-right">{{ dataDetail.urgentFlag ? '是' : '否' }}</span>
  98. </div>
  99. <div class="prev-text image-content" v-if="dataDetail.type == 1">
  100. <div class="image-text">主题图片:</div>
  101. <div class="right-image" v-if="successImageLists.length > 0">
  102. <el-image
  103. class="images"
  104. v-for="(item, index) of successImageLists"
  105. :key="index"
  106. :src="item.url"
  107. :preview-src-list="[item.url]"
  108. ></el-image>
  109. </div>
  110. <div class="prev-text-none" v-else>暂无图片</div>
  111. </div>
  112. <div class="prev-text files">
  113. <div class="files-text">文件上传:</div>
  114. <div v-if="filePath.length > 0" class="files-content">
  115. <div v-for="(item, index) of filePath" :key="index" class="prev-text-file">
  116. <div class="prev-text-right"><i class="el-icon-paperclip"></i> {{ item.name }}</div>
  117. </div>
  118. </div>
  119. <div class="prev-text-none" v-else>暂无文件</div>
  120. </div>
  121. <div class="prev-text html-content">
  122. <div class="files-text" style="margin-right: 25px">通知内容:</div>
  123. <GeminiScrollbar class="my-scroll-bar" :autoshow="true">
  124. <!-- <div class="html-right"> -->
  125. <div v-html="dataDetail.content"></div>
  126. <!-- </div> -->
  127. </GeminiScrollbar>
  128. </div>
  129. </div>
  130. <!-- 右侧手机部分 -->
  131. <div class="detail-right" v-show="showrightPhone">
  132. <div class="dialog-right">
  133. <div class="dialog-right-top">
  134. <img src="../../../assets/img/phoneHeader.png" alt="" />
  135. </div>
  136. <div class="dialog-right-header">
  137. <i class="el-icon-arrow-left"></i>
  138. <div>{{ dataDetail.type == 0 ? '物业通知' : '社区活动' }}</div>
  139. </div>
  140. <div class="center-padding"></div>
  141. <GeminiScrollbar class="my-scroll-bar-right" :autoshow="true">
  142. <div class="dialog-right-content">
  143. <div class="dialog-title">
  144. <div class="dialog-titles">
  145. {{ dataDetail.title }}
  146. </div>
  147. <div>
  148. <div class="dialog-urgency" v-if="dataDetail.urgentFlag">紧急</div>
  149. </div>
  150. <!-- ruleForm.exigencyOr -->
  151. </div>
  152. <div class="dialog-right-time">{{ dataDetail.pubDate }}</div>
  153. <div></div>
  154. <div class="content">
  155. <div class="content-text">
  156. <div v-html="dataDetail.content" id="content" />
  157. </div>
  158. <div class="content-inform"></div>
  159. <div v-if="filePath.length > 0">
  160. <div class="file-name" v-for="(item, index) of filePath" :key="index">
  161. <span class="file-name-left"><i class="el-icon-paperclip"></i> </span>
  162. <span class="file-name-right">
  163. {{ item.name }}
  164. </span>
  165. </div>
  166. </div>
  167. </div>
  168. <div></div>
  169. </div>
  170. </GeminiScrollbar>
  171. </div>
  172. </div>
  173. </div>
  174. </template>
  175. <script>
  176. export default {
  177. name: 'previeInform',
  178. props: {
  179. houseDataNamesPeople: '',
  180. showrightPhone: false,
  181. houseDataNames: '',
  182. userType: '',
  183. dataDetail: {
  184. type: Object,
  185. default: () => {}
  186. },
  187. houseData: {
  188. type: Array,
  189. default: () => []
  190. },
  191. peopleData: {
  192. type: Array,
  193. default: () => []
  194. },
  195. detailPeople: {
  196. type: Array,
  197. default: () => []
  198. },
  199. filePath: {
  200. type: Array,
  201. default: () => []
  202. },
  203. successImageLists: {
  204. type: Array,
  205. default: () => []
  206. }
  207. },
  208. watch: {
  209. dataDetail(val) {
  210. this.showTree = false;
  211. }
  212. },
  213. computed: {},
  214. data() {
  215. return {
  216. index: 99,
  217. showTreeHouse: false,
  218. showTreePeople: false,
  219. showTree: false,
  220. dialogVisibleHouse: false,
  221. dialogVisiblePeople: false,
  222. defaultProps: {
  223. children: 'children',
  224. label: 'name'
  225. },
  226. defaultPropsPeople: {
  227. children: 'children',
  228. label: 'value'
  229. }
  230. };
  231. },
  232. created() {},
  233. computed: {},
  234. methods: {
  235. // 关闭弹框事件
  236. closeDialog() {
  237. this.showTreeHouse = false;
  238. this.showTreePeople = false;
  239. },
  240. // 关闭节点事件
  241. closeTree(e) {
  242. console.log('e', e);
  243. if (e.type == 'community') {
  244. this.showTree = false;
  245. }
  246. },
  247. // 点击显示发布对象详情
  248. clickDetail(val) {
  249. this.showTree = !this.showTree;
  250. this.showTreeHouse = !this.showTreeHouse;
  251. this.showTreePeople = !this.showTreePeople;
  252. },
  253. clickDetailHouse(val) {
  254. this.showTree = !this.showTree;
  255. this.showTreeHouse = !this.showTreeHouse;
  256. },
  257. clickDetailPeople() {
  258. this.showTree = !this.showTree;
  259. this.showTreePeople = !this.showTreePeople;
  260. // this.showTreeHouse = false;
  261. },
  262. filterNode(value, data) {
  263. if (!value) return true;
  264. return data.label.indexOf(value) !== -1;
  265. }
  266. }
  267. };
  268. </script>
  269. <style lang="scss" scoped>
  270. @import '../style.scss';
  271. .prev {
  272. width: 100%;
  273. display: flex;
  274. position: relative;
  275. // 弹框自定义滚动条
  276. .my-scroll-bar-right {
  277. height: 438px;
  278. /deep/ .gm-scrollbar.-horizontal .thumb {
  279. height: 0;
  280. }
  281. }
  282. .el-tree {
  283. padding: 5px;
  284. .circle {
  285. display: block;
  286. }
  287. /deep/ .el-tree-node__expand-icon.is-leaf {
  288. width: 4px;
  289. height: 4px;
  290. border-radius: 50%;
  291. background: #7a7d88;
  292. margin: 6px;
  293. padding: 0px;
  294. }
  295. .el-tree-node:focus > .el-tree-node__content {
  296. background: #fff;
  297. }
  298. }
  299. // 右侧部分
  300. .detail-right {
  301. .dialog-right {
  302. width: 283px;
  303. height: 570px;
  304. border-radius: 24px;
  305. border: 1px solid #e0e1e3;
  306. margin: 20px 40px 70px;
  307. background-color: #fafcff;
  308. .dialog-right-top {
  309. text-align: center;
  310. background: white;
  311. border-top-right-radius: 28px;
  312. border-top-left-radius: 28px;
  313. border-bottom: none;
  314. padding: 4px;
  315. img {
  316. background: white;
  317. width: 100%;
  318. width: 234px;
  319. height: 8px;
  320. text-align: center;
  321. }
  322. }
  323. .dialog-right-header {
  324. width: 100%;
  325. padding: 24px 14px;
  326. background: white;
  327. :first-child {
  328. float: left;
  329. line-height: 20px;
  330. }
  331. :last-child {
  332. font-weight: bold;
  333. text-align: center;
  334. }
  335. }
  336. .center-padding {
  337. padding: 5px 0;
  338. }
  339. .dialog-right-content {
  340. background: white;
  341. padding: 11px;
  342. .dialog-title {
  343. display: flex;
  344. .dialog-titles {
  345. font-size: 14px;
  346. color: #424656;
  347. }
  348. .dialog-urgency {
  349. border-radius: 15px;
  350. width: 36px;
  351. height: 15px;
  352. line-height: 15px;
  353. background-image: linear-gradient(to right, #f65b5b, #ffa3a3);
  354. font-size: 12px;
  355. -webkit-transform-origin-x: 0;
  356. -webkit-transform: scale(0.8);
  357. margin-left: 2px;
  358. margin-top: 2px;
  359. color: white;
  360. text-align: center;
  361. }
  362. }
  363. .dialog-right-time {
  364. font-size: 10px;
  365. -webkit-transform-origin-x: 0;
  366. -webkit-transform: scale(0.9);
  367. color: #9ba6af;
  368. padding: 3px 0;
  369. }
  370. .dialog-right-time + div {
  371. width: 100%;
  372. border-bottom: 1px solid #eeeeee;
  373. margin-bottom: 10px;
  374. }
  375. .content {
  376. width: 110%;
  377. font-size: 10px;
  378. color: #e0e1e3;
  379. background-color: #fff;
  380. -webkit-transform-origin-x: 0;
  381. -webkit-transform: scale(0.92);
  382. .content-text {
  383. width: 100%;
  384. color: #686b78;
  385. background-color: #fff;
  386. /deep/ img {
  387. // width: 100%;
  388. max-width: 100%;
  389. max-height: 750px;
  390. }
  391. }
  392. .content-inform {
  393. width: 100%;
  394. text-align: center;
  395. margin: 50px;
  396. :first-child {
  397. color: #373b49;
  398. }
  399. }
  400. .file-name {
  401. margin: 5px;
  402. border-radius: 24px;
  403. width: 90%;
  404. background: #fafcff;
  405. .file-name-left {
  406. color: #0eaeff;
  407. font-size: 14px;
  408. }
  409. .file-name-right {
  410. color: #424656;
  411. }
  412. }
  413. }
  414. }
  415. }
  416. }
  417. // 左侧部分
  418. .detail-left {
  419. width: 100%;
  420. padding: 27px 20px 40px 24px;
  421. .prev-text {
  422. width: 100%;
  423. font-size: 12px;
  424. color: #424656;
  425. margin: 34px 20px;
  426. .text-right {
  427. margin-left: 25px;
  428. min-width: 60px;
  429. }
  430. }
  431. .prev-obj {
  432. width: 100%;
  433. display: flex;
  434. .prev-obj-right {
  435. display: flex;
  436. .prev-obj-text {
  437. max-width: 495px;
  438. margin-left: 25px;
  439. overflow: hidden;
  440. white-space: nowrap;
  441. text-overflow: ellipsis;
  442. margin-bottom: 10px;
  443. }
  444. .click-prev {
  445. color: #0eaeff;
  446. cursor: pointer;
  447. margin-left: 5px;
  448. }
  449. }
  450. }
  451. .detail {
  452. display: flex;
  453. position: relative;
  454. .prev-detail-right {
  455. position: absolute;
  456. top: 24px;
  457. left: 11%;
  458. background: #fff;
  459. width: 559px;
  460. height: 55vh;
  461. z-index: 99;
  462. box-shadow: 0px 2px 10px 0px #e6ebf4;
  463. // border-radius: 4px;
  464. // .prev-my-scroll-bar {
  465. // }
  466. }
  467. .prev-detail-right-two {
  468. top: 44px !important;
  469. }
  470. }
  471. .files {
  472. display: flex;
  473. .files-text {
  474. min-width: 60px;
  475. }
  476. }
  477. .prev-text-none {
  478. margin-left: 20px;
  479. font-size: 12px;
  480. }
  481. .image-content {
  482. width: 100%;
  483. display: flex;
  484. .image-text {
  485. min-width: 60px;
  486. display: flex;
  487. flex-direction: column;
  488. justify-content: center;
  489. }
  490. .right-image {
  491. max-height: 120px;
  492. display: flex;
  493. margin-left: 15px;
  494. :last-child {
  495. margin-right: 0;
  496. }
  497. .images {
  498. display: block;
  499. float: left;
  500. width: 180px;
  501. height: 100px;
  502. border: 1px solid #ccc;
  503. border-radius: 4px;
  504. min-width: 100px;
  505. margin-right: 10px;
  506. }
  507. }
  508. }
  509. .files-content {
  510. min-width: 150px;
  511. display: flex;
  512. .prev-text-file {
  513. background: #f8fcff;
  514. border-radius: 4px;
  515. font-size: 14px;
  516. margin-left: 25px;
  517. padding: 2px 8px;
  518. .prev-text-right {
  519. overflow: hidden;
  520. white-space: nowrap;
  521. -o-text-overflow: ellipsis; //浏览器兼容
  522. text-overflow: ellipsis;
  523. }
  524. }
  525. }
  526. .html-content {
  527. display: flex;
  528. width: 100%;
  529. max-height: 200px;
  530. }
  531. // 弹框自定义滚动条
  532. .my-scroll-bar {
  533. width: 86%;
  534. height: 200px;
  535. max-height: 218px;
  536. /deep/ .gm-scrollbar.-horizontal .thumb {
  537. height: 0;
  538. }
  539. }
  540. /deep/ .wscnph {
  541. max-width: 200px;
  542. max-height: 200px;
  543. vertical-align: middle;
  544. }
  545. }
  546. }
  547. </style>