index3.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  1. <template>
  2. <div id="app">
  3. <div class="topx">
  4. <div class="Left" @click="tz()">
  5. <img src="../assets/title.png">
  6. </div>
  7. <div class="right">
  8. <ul>
  9. <li @click="dp()" style="cursor:pointer "><img src="../assets/home-LargeScreenicon.png">
  10. <h2>大屏</h2>
  11. </li>
  12. <li @click="lpb()" style="cursor:pointer "><img src="../assets/home-roomlisticon.png">
  13. <h2>楼盘表</h2>
  14. </li>
  15. <li @click="dt()" style="cursor:pointer "><img src="../assets/home-mapicon.png">
  16. <h2>地图</h2>
  17. </li>
  18. <li @click="change" style="cursor:pointer ">
  19. <h2><i style="font-size: 22px;" :class="skin==1?'el-icon-sunny':'el-icon-moon-night'"></i></h2>
  20. </li>
  21. <li @click="dialogVisible=true"
  22. style="font-size: 19px;margin: 2.6% 0;max-width: 70px;cursor:pointer">
  23. <el-badge :is-dot='MessageReminder'>
  24. <i class="el-icon-message-solid"></i>
  25. </el-badge>
  26. </li>
  27. </ul>
  28. <el-dropdown>
  29. <img src="../assets/romeicon.png" style="cursor: pointer;">
  30. <el-dropdown-menu slot="dropdown">
  31. <el-dropdown-item disabled>
  32. <div>{{xm}}</div>
  33. </el-dropdown-item>
  34. <el-dropdown-item>
  35. <div @click="updatePassword()">修改密码</div>
  36. </el-dropdown-item>
  37. <el-dropdown-item>
  38. <div @click="retreat()">退出登录</div>
  39. </el-dropdown-item>
  40. </el-dropdown-menu>
  41. </el-dropdown>
  42. </div>
  43. </div>
  44. <router-view v-if="sengcontrol" :searchVal="searchVal" ref="relo" style="width: 100%;height: calc(100% - 43px);display: flex;">
  45. </router-view>
  46. <div class="tis" v-show="!drawer" v-if="dialogVisible"
  47. style="width: 388px;box-shadow: 0 0 13px rgba(0, 0, 0, 0.37);right:7px">
  48. <div class="tis-a" v-for="(item,i) in messageList" :key="i" v-show="item.control">
  49. <div class="tis-a-top">
  50. <div class="tis-a-top-left">
  51. <i class="el-icon-info"></i>
  52. <span>{{item.belong}}</span>
  53. </div>
  54. <i class="el-icon-close" @click="dialogVisible=!dialogVisible" style="cursor:pointer;"
  55. v-show="i == 0"></i>
  56. </div>
  57. <ul>
  58. <li v-for="(itemLabel,index) in item.messageCount" :key="index" @click="checkDetails(itemLabel)"
  59. v-show="itemLabel.count!= 0">
  60. <el-badge :value="itemLabel.count" class="item">
  61. <img v-if="MRimg[itemLabel.method]" :src="MRimg[itemLabel.method]">
  62. <img v-else src="../assets/news-default.png">
  63. </el-badge>
  64. <span>{{itemLabel.messageType}}</span>
  65. </li>
  66. </ul>
  67. </div>
  68. <div class="tis-a" v-if="!MessageReminder">
  69. <div class="tis-a-top">
  70. <div></div>
  71. <i class="el-icon-close" @click="dialogVisible=!dialogVisible" style="cursor:pointer;"></i>
  72. </div>
  73. <div class="tis-zwnr">
  74. 暂无内容
  75. </div>
  76. </div>
  77. </div>
  78. <!-- ===========消息提醒============= -->
  79. <div class="details" v-if="drawer">
  80. <div class="details-top">
  81. <div class="details-top-ringth">
  82. <i class="el-icon-info"></i>
  83. {{title}}
  84. </div>
  85. <div class="details-top-leth">
  86. <i class="el-icon-close" style="cursor: pointer;" @click="drawer=false"></i>
  87. </div>
  88. </div>
  89. <div class="details-data">
  90. <div class="info" v-for="(item,i) in details" :key="i">
  91. <div class="info-acti">
  92. <div class="info-acti-indx">
  93. {{i+1}}
  94. </div>
  95. </div>
  96. <div class="details-data-details">
  97. <div>{{item.title}}</div>
  98. <span>{{item.msg}}</span>
  99. <p>{{item.dateTime}}</p>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. <!-- 修改密码 -->
  105. <div class="tk">
  106. <el-dialog title="修改密码" :visible.sync="ChangePassword" width="35%">
  107. <div class="form">
  108. <el-form :model="passwordData" :rules="passRules" label-position="right" ref="passRule" label-width="120px">
  109. <el-form-item label="原密码:" prop="oldPass" style="width: 100%;">
  110. <el-input v-model="passwordData.oldPass" type="password" autocomplete="off" placeholder="请输入原密码"></el-input>
  111. </el-form-item>
  112. <el-form-item label="新密码:" prop="pass" style="width: 100%;">
  113. <el-input v-model="passwordData.pass" type="password" autocomplete="off" placeholder="请输入新密码"></el-input>
  114. </el-form-item>
  115. <el-form-item label="确认新密码:" prop="checkPass" style="width: 100%;">
  116. <el-input v-model="passwordData.checkPass" type="password" autocomplete="off" placeholder="请确认新密码"></el-input>
  117. </el-form-item>
  118. </el-form>
  119. </div>
  120. <span slot="footer" class="dialog-footer">
  121. <el-button @click="ChangePassword = false">取 消</el-button>
  122. <el-button type="primary" @click="passSubmit()">确 定</el-button>
  123. </span>
  124. </el-dialog>
  125. </div>
  126. <div v-if="dialogVisible" style="position: absolute;top: 0;width: 100%;height: 100%;z-index: 9;"
  127. @click="close()"></div>
  128. </div>
  129. </template>
  130. <script>
  131. export default {
  132. name: "app",
  133. data() {
  134. var validatePass = (rule, value, callback) => {
  135. if (value === '') {
  136. callback(new Error('请再次输入新密码'));
  137. } else if (value !== this.passwordData.pass) {
  138. callback(new Error('两次输入新密码不一致!'));
  139. } else {
  140. callback();
  141. }
  142. };
  143. return {
  144. sengcontrol:true,
  145. //修改密码
  146. ChangePassword:false,
  147. passwordData: {
  148. id: '',
  149. oldPass: '',
  150. pass: '',
  151. checkPass: ''
  152. },
  153. passRules: {
  154. oldPass: [{
  155. required: true,
  156. message: '请输入原密码',
  157. trigger: 'blur'
  158. }],
  159. pass: [{
  160. required: true,
  161. message: '请输入新密码',
  162. trigger: 'blur'
  163. }],
  164. checkPass: [{
  165. required: true,
  166. validator: validatePass,
  167. trigger: 'blur'
  168. }],
  169. },
  170. skin: 1,
  171. activeName: '',
  172. xm: '',
  173. dialogVisible: false,
  174. searchVal: '',
  175. messageList: [],
  176. drawer: false,
  177. title: '',
  178. details: [],
  179. MessageReminder: false,
  180. MRimg: {
  181. projectPropertyCheck: require('../assets/news-projectPropertyCheck.png'),
  182. propertyCheckReturned: require('../assets/news-propertyCheckReturned.png'),
  183. projectAwait: require('../assets/news-projectAwait.png'),
  184. projectReturned: require('../assets/news-projectReturned.png'),
  185. contDut: require('../assets/news-contDut.png'),
  186. nextPayDut: require('../assets/news-nextPayDut.png'),
  187. excessContDut: require('../assets/news-excessContDut.png'),
  188. patrolAudit: require('../assets/news-patrolAudit.png'),
  189. repairAudit: require('../assets/news-repairAudit.png')
  190. }
  191. }
  192. },
  193. mounted() {
  194. this.nam()
  195. if (sessionStorage.getItem("skin")) {
  196. this.skin = sessionStorage.getItem("skin")
  197. } else {
  198. this.skin = 1
  199. }
  200. this.getMessage();
  201. },
  202. methods: {
  203. // 修改密码
  204. updatePassword() {
  205. const that = this;
  206. for (let key in that.passwordData) {that.passwordData[key] = '';}
  207. this.nam();
  208. this.ChangePassword=true
  209. },
  210. // 修改密码
  211. passSubmit() {
  212. const that = this;
  213. that.$refs['passRule'].validate((valid) => {
  214. if (valid) {
  215. let info = that.passwordData;
  216. let data = {
  217. id: info.id,
  218. oldPassword: info.oldPass,
  219. newPassword: info.checkPass
  220. }
  221. that.$http.post('api/auth/user/updatePassword', data).then(res => {
  222. if (res.status == 200 && res.data.code == 0) {
  223. that.$message.success('修改密码成功!');
  224. this.ChangePassword = false
  225. } else {
  226. // that.$message.error(res.data.msg);
  227. }
  228. })
  229. } else {
  230. return false;
  231. }
  232. });
  233. },
  234. close() {
  235. if (this.drawer == true) {
  236. this.drawer = false
  237. this.dialogVisible = true
  238. } else if (this.dialogVisible == true) {
  239. this.drawer = false
  240. this.dialogVisible = false
  241. }
  242. },
  243. // 获取消息提醒
  244. getMessage() {
  245. this.$http.get('api/auth/message/count', null).then((res) => {
  246. if (res.status == 200 && res.data.code == 0) {
  247. this.messageList = res.data.data;
  248. this.MessageReminder = false
  249. // 判断是否有消息显示红点 break
  250. this.messageList.forEach((rrs, inde) => {
  251. this.messageList[inde].control = false
  252. this.messageList[inde].messageCount.forEach((rrs, index) => {
  253. if (this.messageList[inde].messageCount[index].count != 0) {
  254. this.messageList[inde].control = true
  255. this.MessageReminder = true
  256. }
  257. })
  258. })
  259. } else {
  260. this.$message.error('获取消息提醒失败!');
  261. }
  262. })
  263. },
  264. // 查看消息详情
  265. checkDetails(data) {
  266. let that = this;
  267. that.drawer = true;
  268. that.title = data.messageType;
  269. that.$http.get('api/auth/message/getMessage?method=' + data.method, null).then((res) => {
  270. if (res.status == 200 && res.data.code == 0) {
  271. that.details = res.data.data;
  272. } else {
  273. that.$message.error('获取消息详情失败!');
  274. }
  275. })
  276. },
  277. // 退出登录
  278. retreat() {
  279. this.$http.post('/api/v1/pub/logout', null).then((res) => {
  280. if (res.status == 200 && res.data.code == 0) {
  281. this.$router.push('/')
  282. } else {
  283. this.$message.error('失败!');
  284. }
  285. })
  286. },
  287. // 获取姓名
  288. nam() {
  289. this.$http.get('/api/v1/pri/userInfo', null).then((res) => {
  290. if (res.status == 200 && res.data.code == 0) {
  291. this.xm = res.data.user.name
  292. this.passwordData.id=res.data.user.depid
  293. } else {
  294. this.$message.error('失败!');
  295. }
  296. })
  297. },
  298. // 换肤
  299. change() {
  300. if (this.skin == 1) {
  301. document.getElementById('style').setAttribute("href", "./static/css/one.less");
  302. sessionStorage.setItem("style", "./static/css/one.less");
  303. window.location.reload()
  304. this.skin = 2
  305. sessionStorage.setItem("skin", this.skin);
  306. this.searchVal = 2;
  307. } else if (this.skin == 2) {
  308. document.getElementById('style').setAttribute("href", "./static/css/two.less");
  309. sessionStorage.setItem("style", "./static/css/two.less");
  310. window.location.reload()
  311. this.skin = 1
  312. sessionStorage.setItem("skin", this.skin);
  313. this.searchVal = 1;
  314. }
  315. },
  316. // 跳转首页
  317. tz() {
  318. this.$router.push('/home')
  319. },
  320. // 跳转消息详情
  321. xxtx() {
  322. this.$router.push('/index3/notice')
  323. },
  324. //楼盘表
  325. lpb() {
  326. // 获取菜单列表
  327. this.sengcontrol=false
  328. var data=[]
  329. this.$http.get('api/auth/userMenus', null).then((res) => {
  330. if (res.status == 200 && res.data.code == 0) {
  331. data=res.data.userMenus
  332. this.sengcontrol=true
  333. this.$store.commit("add",data[3].roleMenuDTOS)
  334. this.$store.commit("Jurisdiction",data[3].roleMenuDTOS[2].id)
  335. window.sessionStorage.setItem("Highlight",data[3].roleMenuDTOS[2].url);
  336. this.$router.push(data[3].roleMenuDTOS[2].url)
  337. } else {
  338. this.$message.error('失败!');
  339. }
  340. })
  341. },
  342. // 大屏
  343. dp() {
  344. let {href} = this.$router.resolve({path: '/LargeScreenOnt'})
  345. window.open(href, '_blank')
  346. // if (document.documentElement.clientWidth > 2000) {
  347. // let {
  348. // href
  349. // } = this.$router.resolve({
  350. // path: '/index1'
  351. // })
  352. // window.open(href, '_blank')
  353. // } else {
  354. // // let { href } = this.$router.resolve({ path: '/index21' })
  355. // let {
  356. // href
  357. // } = this.$router.resolve({
  358. // path: '/LargeScreenOnt'
  359. // })
  360. // window.open(href, '_blank')
  361. // }
  362. },
  363. // 地图
  364. dt() {
  365. window.sessionStorage.setItem('route', '/ResidentialResettlement');
  366. let {
  367. href
  368. } = this.$router.resolve({
  369. path: '/ResidentialResettlement'
  370. })
  371. window.open(href, '_blank')
  372. }
  373. }
  374. }
  375. </script>
  376. <style scoped lang="less">
  377. #app {
  378. width: 100%;
  379. height: 100%;
  380. display: block;
  381. position: relative;
  382. min-width: 1400px;
  383. min-height: 500px;
  384. overflow: auto;
  385. background-color: #dfdfdf;
  386. .topx {
  387. display: flex;
  388. justify-content: space-between;
  389. background: #FFFFFF;
  390. width: 100%;
  391. height: 43px;
  392. .Left {
  393. display: flex;
  394. width: 384px;
  395. padding: 0.3% 0% 0.3% 0.5%;
  396. cursor: pointer;
  397. img {
  398. width: 100%;
  399. }
  400. }
  401. .right {
  402. display: flex;
  403. width: 537px;
  404. ul {
  405. display: flex;
  406. width: 100%;
  407. li {
  408. width: 26%;
  409. height: 38.5%;
  410. margin: 2.5% 0;
  411. color: #707070;
  412. list-style: none;
  413. border-right: 2px solid #707070;
  414. display: flex;
  415. justify-content: center;
  416. img {
  417. width: auto;
  418. height: auto;
  419. margin: 0 5%;
  420. }
  421. h2 {
  422. margin: 0;
  423. font-size: 0.0625rem;
  424. line-height: 14px;
  425. font-size: 12px;
  426. font-weight: 400;
  427. line-height: 20px;
  428. color: #707070;
  429. opacity: 1;
  430. }
  431. }
  432. }
  433. .el-dropdown {
  434. display: inline-block;
  435. position: relative;
  436. color: #606266;
  437. font-size: 14px;
  438. img {
  439. margin: 10% 17px;
  440. height: 57%;
  441. }
  442. }
  443. }
  444. }
  445. .tis {
  446. position: absolute;
  447. top: 50px;
  448. right: 60px;
  449. width: auto;
  450. background: #fff;
  451. border-radius: 24px;
  452. padding: 1.5%;
  453. box-sizing: border-box;
  454. z-index: 999;
  455. .tis-a {
  456. .tis-a-top {
  457. display: flex;
  458. justify-content: space-between;
  459. i {
  460. font-size: 30px;
  461. color: #167AA1;
  462. }
  463. .tis-a-top-left {
  464. i {
  465. font-size: 24px;
  466. color: #167AA1;
  467. }
  468. span {
  469. font-size: 18px;
  470. font-weight: 400;
  471. line-height: 31px;
  472. color: #167AA1;
  473. }
  474. }
  475. }
  476. ul {
  477. width: 100%;
  478. display: flex;
  479. flex-wrap: wrap;
  480. li {
  481. width: 80px;
  482. text-align: center;
  483. border-radius: 24px;
  484. padding: 5px;
  485. margin: 0 10px;
  486. cursor: pointer;
  487. .el-badge {
  488. width: 80px;
  489. height: 80px;
  490. display: flex;
  491. flex-direction: column;
  492. justify-content: center;
  493. box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.16);
  494. background: #167AA1;
  495. border-radius: 14px;
  496. img {
  497. width: 42px;
  498. margin: 0 auto;
  499. }
  500. span {
  501. font-size: 13px;
  502. font-weight: 400;
  503. color: #707070;
  504. text-align: center;
  505. display: block;
  506. margin-top: 12px;
  507. }
  508. }
  509. span {
  510. font-size: 13px;
  511. font-weight: 400;
  512. color: #707070;
  513. text-align: center;
  514. display: block;
  515. margin-top: 12px;
  516. }
  517. }
  518. }
  519. /deep/.el-badge__content.is-fixed {
  520. top: 4%;
  521. right: 19%;
  522. }
  523. /deep/.el-badge__content {
  524. font-size: 18px;
  525. }
  526. }
  527. }
  528. .details {
  529. width: 388px;
  530. height: calc(100% - 45px);
  531. box-shadow: rgba(0, 0, 0, 0.37) 0px 0px 13px;
  532. position: absolute;
  533. top: 45px;
  534. right: 0px;
  535. box-sizing: border-box;
  536. z-index: 999;
  537. overflow: hidden;
  538. .details-top {
  539. width: 100%;
  540. height: 40px;
  541. background-color: #167aa1;
  542. padding: 0 20px;
  543. display: flex;
  544. justify-content: space-between;
  545. box-sizing: border-box;
  546. .details-top-ringth {
  547. line-height: 40px;
  548. font-size: 16px;
  549. color: #fff;
  550. i {
  551. color: #FFFFFF;
  552. font-size: 18px;
  553. }
  554. }
  555. .details-top-leth {
  556. i {
  557. line-height: 40px;
  558. color: #FFFFFF;
  559. font-size: 20px;
  560. }
  561. }
  562. }
  563. .details-data {
  564. background: #fff;
  565. height: calc(100% - 40px);
  566. overflow: auto;
  567. scrollbar-width: thin;
  568. .info {
  569. border-bottom: 4px solid #f2f2f2;
  570. padding: 15px 15px 0 0;
  571. font-size: 15px;
  572. display: flex;
  573. .info-acti {
  574. width: 28px;
  575. padding: 0 15px;
  576. .info-acti-indx {
  577. /* margin: 0 auto; */
  578. width: 28PX;
  579. height: 28PX;
  580. background-color: #167AA1;
  581. color: #FFFFFF;
  582. text-align: center;
  583. line-height: 28px;
  584. border-radius: 28px;
  585. }
  586. }
  587. .details-data-details {
  588. width: 100%;
  589. div {
  590. font-size: 16px;
  591. color: #167aa1;
  592. }
  593. span {
  594. margin: 10px 0;
  595. color: #666;
  596. font-size: 14px;
  597. display: flex;
  598. flex-direction: column;
  599. justify-content: center;
  600. }
  601. p {
  602. color: rgb(181, 181, 181);
  603. font-size: 14px;
  604. width: 100%;
  605. text-align: end;
  606. padding: 10px 0;
  607. border-top: 1px solid #F2F2F2;
  608. }
  609. }
  610. }
  611. &::-webkit-scrollbar {
  612. width: 8px;
  613. }
  614. &::-webkit-scrollbar-track {
  615. background-color: #f0f0f0;
  616. }
  617. &::-webkit-scrollbar-thumb {
  618. background-color: #cdcdcd;
  619. }
  620. }
  621. }
  622. }
  623. </style>