previeInform.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  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] ? 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 }}
  52. </span>
  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. // 这里不知道什么原因
  244. // if (e.type == 'community') {
  245. // this.showTree = false;
  246. // }
  247. },
  248. // 点击显示发布对象详情
  249. clickDetail(val) {
  250. this.showTree = !this.showTree;
  251. this.showTreeHouse = !this.showTreeHouse;
  252. this.showTreePeople = !this.showTreePeople;
  253. },
  254. clickDetailHouse(val) {
  255. if (this.showTreePeople) {
  256. this.showTreePeople = false;
  257. } else {
  258. this.showTree = !this.showTree;
  259. }
  260. this.showTreeHouse = !this.showTreeHouse;
  261. },
  262. clickDetailPeople() {
  263. if (this.showTreeHouse) {
  264. this.showTreeHouse = false;
  265. } else {
  266. this.showTree = !this.showTree;
  267. }
  268. this.showTreePeople = !this.showTreePeople;
  269. // this.showTreeHouse = false;
  270. },
  271. filterNode(value, data) {
  272. if (!value) return true;
  273. return data.label.indexOf(value) !== -1;
  274. }
  275. }
  276. };
  277. </script>
  278. <style lang="scss" scoped>
  279. @import '../style.scss';
  280. .prev {
  281. width: 100%;
  282. display: flex;
  283. position: relative;
  284. // 弹框自定义滚动条
  285. .my-scroll-bar-right {
  286. height: 438px;
  287. /deep/ .gm-scrollbar.-horizontal .thumb {
  288. height: 0;
  289. }
  290. }
  291. .el-tree {
  292. padding: 5px;
  293. .circle {
  294. display: block;
  295. }
  296. /deep/ .el-tree-node__expand-icon.is-leaf {
  297. width: 4px;
  298. height: 4px;
  299. border-radius: 50%;
  300. background: #7a7d88;
  301. margin: 6px;
  302. padding: 0px;
  303. }
  304. .el-tree-node:focus > .el-tree-node__content {
  305. background: #fff;
  306. }
  307. }
  308. // 右侧部分
  309. .detail-right {
  310. .dialog-right {
  311. width: 283px;
  312. height: 570px;
  313. border-radius: 24px;
  314. border: 1px solid #e0e1e3;
  315. margin: 20px 40px 70px;
  316. background-color: #fafcff;
  317. .dialog-right-top {
  318. text-align: center;
  319. background: white;
  320. border-top-right-radius: 28px;
  321. border-top-left-radius: 28px;
  322. border-bottom: none;
  323. padding: 4px;
  324. img {
  325. background: white;
  326. width: 100%;
  327. width: 234px;
  328. height: 8px;
  329. text-align: center;
  330. }
  331. }
  332. .dialog-right-header {
  333. width: 100%;
  334. padding: 24px 14px;
  335. background: white;
  336. :first-child {
  337. float: left;
  338. line-height: 20px;
  339. }
  340. :last-child {
  341. font-weight: bold;
  342. text-align: center;
  343. }
  344. }
  345. .center-padding {
  346. padding: 5px 0;
  347. }
  348. .dialog-right-content {
  349. background: white;
  350. padding: 11px;
  351. .dialog-title {
  352. display: flex;
  353. .dialog-titles {
  354. font-size: 14px;
  355. color: #424656;
  356. }
  357. .dialog-urgency {
  358. border-radius: 15px;
  359. width: 36px;
  360. height: 15px;
  361. line-height: 15px;
  362. background-image: linear-gradient(to right, #f65b5b, #ffa3a3);
  363. font-size: 12px;
  364. -webkit-transform-origin-x: 0;
  365. -webkit-transform: scale(0.8);
  366. margin-left: 2px;
  367. margin-top: 2px;
  368. color: white;
  369. text-align: center;
  370. }
  371. }
  372. .dialog-right-time {
  373. font-size: 10px;
  374. -webkit-transform-origin-x: 0;
  375. -webkit-transform: scale(0.9);
  376. color: #9ba6af;
  377. padding: 3px 0;
  378. }
  379. .dialog-right-time + div {
  380. width: 100%;
  381. border-bottom: 1px solid #eeeeee;
  382. margin-bottom: 10px;
  383. }
  384. .content {
  385. width: 110%;
  386. font-size: 10px;
  387. color: #e0e1e3;
  388. background-color: #fff;
  389. -webkit-transform-origin-x: 0;
  390. -webkit-transform: scale(0.92);
  391. .content-text {
  392. width: 100%;
  393. color: #686b78;
  394. background-color: #fff;
  395. /deep/ img {
  396. // width: 100%;
  397. max-width: 100%;
  398. max-height: 750px;
  399. }
  400. }
  401. .content-inform {
  402. width: 100%;
  403. text-align: center;
  404. margin: 50px;
  405. :first-child {
  406. color: #373b49;
  407. }
  408. }
  409. .file-name {
  410. margin: 5px;
  411. border-radius: 24px;
  412. width: 90%;
  413. background: #fafcff;
  414. .file-name-left {
  415. color: #0eaeff;
  416. font-size: 14px;
  417. }
  418. .file-name-right {
  419. color: #424656;
  420. }
  421. }
  422. }
  423. }
  424. }
  425. }
  426. // 左侧部分
  427. .detail-left {
  428. width: 100%;
  429. padding: 27px 20px 40px 24px;
  430. .prev-text {
  431. width: 100%;
  432. font-size: 12px;
  433. color: #424656;
  434. margin: 34px 20px;
  435. .text-right {
  436. margin-left: 25px;
  437. min-width: 60px;
  438. }
  439. }
  440. .prev-obj {
  441. width: 100%;
  442. display: flex;
  443. .prev-obj-right {
  444. display: flex;
  445. .prev-obj-text {
  446. max-width: 495px;
  447. margin-left: 25px;
  448. overflow: hidden;
  449. white-space: nowrap;
  450. text-overflow: ellipsis;
  451. margin-bottom: 10px;
  452. }
  453. .click-prev {
  454. color: #0eaeff;
  455. cursor: pointer;
  456. margin-left: 5px;
  457. }
  458. }
  459. }
  460. .detail {
  461. display: flex;
  462. position: relative;
  463. .prev-detail-right {
  464. position: absolute;
  465. top: 24px;
  466. left: 11%;
  467. background: #fff;
  468. width: 559px;
  469. height: 55vh;
  470. z-index: 99;
  471. box-shadow: 0px 2px 10px 0px #e6ebf4;
  472. // border-radius: 4px;
  473. // .prev-my-scroll-bar {
  474. // }
  475. }
  476. .prev-detail-right-two {
  477. top: 44px !important;
  478. }
  479. }
  480. .files {
  481. display: flex;
  482. .files-text {
  483. min-width: 60px;
  484. }
  485. }
  486. .prev-text-none {
  487. margin-left: 20px;
  488. font-size: 12px;
  489. }
  490. .image-content {
  491. width: 100%;
  492. display: flex;
  493. .image-text {
  494. min-width: 60px;
  495. display: flex;
  496. flex-direction: column;
  497. justify-content: center;
  498. }
  499. .right-image {
  500. max-height: 120px;
  501. display: flex;
  502. margin-left: 15px;
  503. :last-child {
  504. margin-right: 0;
  505. }
  506. .images {
  507. display: block;
  508. float: left;
  509. width: 180px;
  510. height: 100px;
  511. border: 1px solid #ccc;
  512. border-radius: 4px;
  513. min-width: 100px;
  514. margin-right: 10px;
  515. }
  516. }
  517. }
  518. .files-content {
  519. min-width: 150px;
  520. display: flex;
  521. .prev-text-file {
  522. background: #f8fcff;
  523. border-radius: 4px;
  524. font-size: 14px;
  525. margin-left: 25px;
  526. padding: 2px 8px;
  527. .prev-text-right {
  528. overflow: hidden;
  529. white-space: nowrap;
  530. -o-text-overflow: ellipsis; //浏览器兼容
  531. text-overflow: ellipsis;
  532. }
  533. }
  534. }
  535. .html-content {
  536. display: flex;
  537. width: 100%;
  538. max-height: 200px;
  539. }
  540. // 弹框自定义滚动条
  541. .my-scroll-bar {
  542. width: 86%;
  543. height: 200px;
  544. max-height: 218px;
  545. /deep/ .gm-scrollbar.-horizontal .thumb {
  546. height: 0;
  547. }
  548. }
  549. /deep/ .wscnph {
  550. max-width: 200px;
  551. max-height: 200px;
  552. vertical-align: middle;
  553. }
  554. }
  555. }
  556. </style>