Index2.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <div class="login">
  3. <div class="content">
  4. <div class="title"></div>
  5. <div class="logout_bg">
  6. <el-image style="width:40px;height:40px;margin-right: 40px" :src="manager" fit="cover" @click="toProfile" v-if="roles.includes('super_admin') || roles.includes('sys_admin')"/>
  7. <el-image style="width:40px;height:40px;margin-right: 20px" :src="logouticon" fit="cover" @click="loginOut"/>
  8. </div>
  9. <div class="main">
  10. <div class="col">
  11. <div class="row2" style="background-color: #30CA79;">
  12. <img class="image2" :src="img1" alt />
  13. <div class="text2"><el-link style="font-size: 30px;color: #fff; font-weight: 500" @click="handlerLink(44)">社区居家养老管理系统</el-link></div>
  14. </div>
  15. <div class="row2" style="background-color: #32B19E;">
  16. <img class="image2" :src="img2" alt />
  17. <div class="text2"><a class="aaa" href="http://web.poteviohealth.com/boss/" target="_blank">智慧养老IOT物联网平台</a></div>
  18. </div>
  19. </div>
  20. <div class="col col3" style="background-color: #00734D;">
  21. <div class="text0"><el-link style="font-size: 30px;color: #fff; font-weight: 500" @click="handlerLink(45)">康养大数据平台</el-link></div>
  22. </div>
  23. <div class="col">
  24. <div class="row2" style="background-color: #4C4B6B;">
  25. <img class="image2" :src="img5" alt />
  26. <div class="text2"><a class="aaa" href="http://106.37.165.111:9080/pc/PCLGO001Action_001.action" target="_blank">机构养老运营管理系统</a></div>
  27. </div>
  28. <div class="row2" style="background-color: #4A8EE2;">
  29. <img class="image2" :src="img6" alt />
  30. <div class="text2"><a class="aaa" href="http://223.71.228.205:9080/qtels-cloud/login/login.do" target="_blank">旅居养老运营管理系统</a></div>
  31. </div>
  32. </div>
  33. <div class="col">
  34. <div class="row2" style="background-color: #F3B144;">
  35. <img class="image2" :src="img7" alt/>
  36. <div class="text2"><el-link style="font-size: 30px;color: #fff; font-weight: 500" @click="handlerLink(46)">运营数据分析平台</el-link></div>
  37. </div>
  38. <div class="row2" style="background-color: #AACC05;">
  39. <img class="image2" :src="img8" alt />
  40. <div class="text2">建设中</div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </template>
  47. <script setup>
  48. import { ElMessageBox } from 'element-plus'
  49. import { useUserStore } from '@/store/modules/user'
  50. import { useTagsViewStore } from '@/store/modules/tagsView'
  51. import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
  52. import * as UserApi from '@/api/system/user'
  53. import img1 from '@/assets/imgs/main/icon1.png';
  54. import img2 from '@/assets/imgs/main/icon2.png';
  55. import img3 from '@/assets/imgs/main/icon3.png';
  56. import img5 from '@/assets/imgs/main/icon5.png';
  57. import img6 from '@/assets/imgs/main/icon6.png';
  58. import img7 from '@/assets/imgs/main/icon7.png';
  59. import img8 from '@/assets/imgs/main/icon8.png';
  60. import logouticon from '@/assets/imgs/main/logout.png'
  61. import manager from '@/assets/imgs/main/manager.png'
  62. import * as authUtil from '@/utils/auth'
  63. const userStore = useUserStore()
  64. const tagsViewStore = useTagsViewStore()
  65. const { t } = useI18n()
  66. //
  67. const { push, replace } = useRouter()
  68. const { wsCache } = useCache()
  69. // console.log("################",wsCache.get(CACHE_KEY.LoginForm).username)
  70. // console.log("################2",authUtil.getLoginForm().username)
  71. // console.log("################3",authUtil.getRefreshToken())
  72. // console.log("################4",authUtil.getAccessToken())
  73. //
  74. // console.log("***************",JSON.stringify(wsCache.get(CACHE_KEY.LoginForm)))
  75. const loginOut = async () => {
  76. try {
  77. await ElMessageBox.confirm(t('common.loginOutMessage'), t('common.reminder'), {
  78. confirmButtonText: t('common.ok'),
  79. cancelButtonText: t('common.cancel'),
  80. type: 'warning'
  81. })
  82. await userStore.loginOut()
  83. tagsViewStore.delAllViews()
  84. replace('/login?redirect=/Navicate')
  85. } catch {}
  86. }
  87. const toProfile = async () => {
  88. push('/system/user')
  89. }
  90. const handlerLink = async (id) =>{
  91. try {
  92. const linkUrl = await UserApi.getLinkInfo(id, authUtil.getAccessToken())
  93. console.log(linkUrl)
  94. if (linkUrl != "") {
  95. window.open(linkUrl);
  96. }
  97. }catch (error) {
  98. console.log(error);
  99. }
  100. // window.open("http://web.poteviohealth.com/boss/");
  101. }
  102. const roles = wsCache.get(CACHE_KEY.USER).roles
  103. console.log("######################",roles)
  104. // const checkRoles = (value)=>{
  105. // const permissionRoles = value
  106. // const roles = wsCache.get(CACHE_KEY.USER).roles
  107. // const hasRole = roles.some((role) => {
  108. // return super_admin === role || permissionRoles.includes(role)
  109. // })
  110. // return hasRole;
  111. // }
  112. </script>
  113. <style lang="scss" scoped>
  114. .login {
  115. width: 100%;
  116. height: 100%;
  117. background-image: url("/src/assets/imgs/main/bg.png");
  118. /* 背景图垂直、水平均居中 */
  119. background-position: center center;
  120. /* 背景图不平铺 */
  121. background-repeat: no-repeat;
  122. /* 让背景图基于容器大小伸缩 */
  123. background-size: cover;
  124. display: flex;
  125. justify-content: center;
  126. .content{
  127. width: 1660px;
  128. height: 777px;
  129. }
  130. .title{
  131. width: 655px;
  132. height: 62px;
  133. // position: absolute;
  134. // top:63px;
  135. // left:113px;
  136. margin-top: 63px;
  137. background-image: url("/src/assets/imgs/main/logo.png");
  138. background-repeat: no-repeat;
  139. }
  140. .main{
  141. width: 1680px;
  142. height: 600px;
  143. margin-top: 115px;
  144. // margin-left: 130px;
  145. // position: absolute;
  146. // top:240px;
  147. // left:130px;
  148. display: flex;
  149. color: #fff;
  150. font-size: 32px;
  151. }
  152. .col{
  153. width: 400px;
  154. height: 600px;
  155. margin-right: 10px;
  156. text-decoration: none;
  157. }
  158. .col3{
  159. background-image: url("/src/assets/imgs/main/icon0.png");
  160. }
  161. .row3{
  162. width: 400px;
  163. height: 190px;
  164. margin-bottom: 15px;
  165. display: flex;
  166. }
  167. .image3{
  168. margin: 61px 24px 61px 40px;
  169. }
  170. .text3{
  171. margin-top: 51px;
  172. }
  173. .row2{
  174. width: 400px;
  175. height: 290px;
  176. margin-bottom: 20px;
  177. }
  178. .text0{
  179. text-align: center;
  180. margin-top: 110px;
  181. }
  182. .image2{
  183. margin: 69px 160px 20px 160px;
  184. }
  185. .text2{
  186. text-align: center;
  187. width: 100%;
  188. }
  189. .aaa{
  190. color: #fff;
  191. }
  192. .logout_bg {
  193. position: absolute;
  194. top: 80px;
  195. right: 60px;
  196. width: 200px;
  197. height: 50px;
  198. cursor: pointer;
  199. }
  200. }
  201. .el-link.el-link--default:after,
  202. .el-link.el-link--primary.is-underline:hover:after,
  203. .el-link.el-link--primary:after {
  204. border-color: #fff !important;
  205. }
  206. </style>