application-system.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  1. <template>
  2. <div class="application-system">
  3. <div class="module" v-for="(item,index) in moduleList" :key="index">
  4. <div class="left-part">
  5. <img :src="getImagePath(item.name)" style="width: 242px;height: 313px">
  6. </div>
  7. <div class="right-part">
  8. <div class="module-title">
  9. {{item.name}}
  10. </div>
  11. <div class="module-content scroll">
  12. <div v-for="singleItem in item.children" @mouseover="selectedItem = singleItem.name"
  13. @mouseleave="selectedItem = ''" :key="singleItem.name" class="single">
  14. <div class="single-icon"></div>
  15. <span class="single-title"
  16. :class="{
  17. 'disabled':singleItem.disabled ||(!loginPinia.canSeeSystemArr.find(i => +i.MODULE_ID === +singleItem.moduleId)),
  18. 'highlight': singleItem.name === selectedItem }"
  19. @click="linkToOther(singleItem,item.name)">{{singleItem.name}}</span>
  20. </div>
  21. </div>
  22. </div>
  23. </div>
  24. </div>
  25. </template>
  26. <script setup>
  27. import { ref } from 'vue'
  28. import szcs from '@/assets/imgs/szcs.png';
  29. import szzf from '@/assets/imgs/szzf.png';
  30. import szgc from '@/assets/imgs/szgc.png';
  31. import szcz from '@/assets/imgs/szcz.png';
  32. import {useLoginStore} from "@/pinia/login";
  33. import {loginInSpace, loginInSpaceLog} from "@/service/login";
  34. import {encode} from "js-base64";
  35. import {showMessage} from "@/unit/element-ui/tip";
  36. const loginPinia = useLoginStore()
  37. let moduleList = ref([
  38. {
  39. name:"数字工程",
  40. imgUrl:'xxxx',
  41. children:[
  42. {
  43. name: '上海重大工程信息管理系统',
  44. moduleId: '655',
  45. linkHref: 'http://10.86.133.76:8080/FGW_WEB_SZDB',
  46. loginPage: 'http://10.86.133.76:8080/FGW_WEB_SZDB'
  47. },
  48. {name: '上海市城市维护项目管理信息系统', disabled: true}
  49. ]
  50. },
  51. {
  52. name:"数字住房",
  53. imgUrl:'xxxx',
  54. children:[
  55. {name: '上海市售后公房维修资金管理业务系统', disabled: true}
  56. ]
  57. },
  58. {
  59. name:"数字城市",
  60. imgUrl:'xxxx',
  61. children:[
  62. {
  63. name: '上海市住建行业基础数据应用系统',
  64. isZi: true,
  65. linkHref: 'https://cimweb.zjw.sh.cegn.cn:2007/industry-database/#/visualizationHome/mainPage',
  66. loginPage: 'https://cimweb.zjw.sh.cegn.cn:2007/industry-database/#/visualizationHome/mainPage',
  67. moduleId: '692'
  68. },
  69. {
  70. name: '上海城市体检信息系统',
  71. isZi: true,
  72. linkHref: 'https://cimweb.zjw.sh.cegn.cn:2007/urban-examine/#/infoHome',
  73. loginPage: 'https://cimweb.zjw.sh.cegn.cn:2007/urban-examine/#/login',
  74. moduleId: '603'
  75. },
  76. {
  77. name: '上海城市更新信息系统',
  78. moduleId: '653',
  79. linkHref: 'https://cimweb.zjw.sh.cegn.cn:2007/urban-renew/#/home',
  80. loginPage: 'https://cimweb.zjw.sh.cegn.cn:2007/urban-renew/#/home'
  81. },
  82. {
  83. name: '上海市海绵城市信息系统',
  84. moduleId: '747',
  85. linkHref: 'https://cimweb.zjw.sh.cegn.cn:2007/sponge-city-web/#/index',
  86. loginPage: 'https://cimweb.zjw.sh.cegn.cn:2007/sponge-city-web/#/index'
  87. },
  88. {
  89. name: '上海市城市网格化管理信息系统',
  90. moduleId: '1430',
  91. linkHref: 'https://wghdp.zjw.sh.cegn.cn/',
  92. loginPage: 'https://wghdp.zjw.sh.cegn.cn/'
  93. },
  94. {
  95. name: '上海地下空间信息基础平台',
  96. moduleId: '656',
  97. linkHref: 'http://10.81.73.104:8086',
  98. loginPage: 'http://10.81.73.104:8086'
  99. },
  100. {
  101. name: '上海路面塌陷风险预警平台',
  102. moduleId: '657',
  103. linkHref: 'http://10.81.73.104:8086/#/first/four',
  104. loginPage: 'http://10.81.73.104:8086/#/first/four'
  105. },
  106. ]
  107. },
  108. {
  109. name:"数字村镇",
  110. imgUrl:'xxxx',
  111. children:[
  112. {
  113. name: '上海市农民相对集中居住管理系统',
  114. moduleId: '659',
  115. linkHref: 'https://10.90.11.49:2005/cr/',
  116. loginPage: 'https://10.90.11.49:2005/cr/'
  117. },
  118. {
  119. name: '上海市农村路桥信息管理系统',
  120. moduleId: '658',
  121. linkHref: 'http://10.83.244.180:8888',
  122. loginPage: 'http://10.83.244.180:8888'
  123. },
  124. ]
  125. }
  126. ]);
  127. let selectedItem = ref("");
  128. function getImagePath(name) {
  129. switch (name) {
  130. case '数字工程':
  131. return szgc
  132. case '数字住房':
  133. return szzf
  134. case '数字城市':
  135. return szcs
  136. case '数字村镇':
  137. return szcz
  138. }
  139. }
  140. function linkToOther(item, headName) {
  141. let isDisabled = getDisabled(item)
  142. if (!item.disabled) {
  143. if (item.linkHref) {
  144. let isCanLink = loginPinia.canSeeSystemArr.find(i => +i.MODULE_ID === +item.moduleId)
  145. if (!isCanLink) {
  146. return
  147. }
  148. toPage(item, isDisabled, headName)
  149. }
  150. }
  151. function getDisabled(child) {
  152. return !loginPinia.canSeeSystemArr.find(i => +i.MODULE_ID === +child.moduleId) && child.isZi
  153. }
  154. function toPage(item, isDisabled, headName) {
  155. // console.log('点击', item, isDisabled)
  156. debugger
  157. let path = isDisabled ? item.loginPage : item.linkHref
  158. if (!item.isZi) {
  159. if (path.indexOf("http://") > -1 || path.indexOf("https://") > -1) {
  160. window.open(path, path)
  161. } else {
  162. // 记录父名称
  163. selectedHead.value = headName
  164. router.push({name: 'interface', params: {type: item.type}})
  165. }
  166. return
  167. }
  168. // console.log('进入了', isDisabled)
  169. if (isDisabled) {
  170. if (path.indexOf("http://") > -1 || path.indexOf("https://") > -1) {
  171. window.open(path, path)
  172. } else {
  173. router.push(path)
  174. }
  175. return
  176. }
  177. switch (item.moduleId) {
  178. case '692': //行业基础数据库临时登录
  179. loginKj(2, path, "a42fe58a1ff142f696c63b56519833a0")
  180. break
  181. case '569': //空间浏览系统
  182. loginKj(2, path, "a42fe58a1ff142f696c63b56519833a0")
  183. break
  184. case '538': //空间管理系统
  185. loginKj(1, path, "4f2a211f473b4e39b9ccc1e04233c725")
  186. break
  187. case '570': //政务数据浏览系统
  188. loginZW(0, path, "166ab385ec6d49e3aa8473f31d2aaca3")
  189. break
  190. case '116': //政务目录管理系统
  191. loginZW(1, path, "0693eeb52c154ba3ba57db71b30a0b98")
  192. break
  193. case '51': //平台监控系统
  194. loginZW(2, path, "ebb42096345340359741dcb9c039f15c");
  195. break
  196. case '571': //数据综合分析系统
  197. loginZHFXFN(3, path, "ed698aa9d09e4ac7b35df02a2d73985f");
  198. break
  199. case '572':
  200. break
  201. case '573':
  202. break
  203. case '574':
  204. break
  205. case '575':
  206. break
  207. case '576': //城市体检
  208. loginZW(9, path, "47e0971bb15b4420bf1f351510378c72");
  209. break
  210. case '577':
  211. break
  212. case '578':
  213. break
  214. case '579': //数据综合分析系统
  215. loginZHFXFN(3, path, "ed698aa9d09e4ac7b35df02a2d73985f");
  216. break
  217. case '603': //城市体检
  218. loginKj(9, path, "47e0971bb15b4420bf1f351510378c72");
  219. break
  220. }
  221. }
  222. }
  223. function loginKj(type, url, systemType) {
  224. loginInSpace(loginPinia.loginInfo.username, encode(loginPinia.loginInfo.psd), type, systemType)
  225. .then(res => {
  226. debugger
  227. let result = res.msg;
  228. if (result.length == 0) {
  229. showMessage({
  230. type: 'warning',
  231. message: '登录信息失效'
  232. })
  233. return;
  234. }
  235. let rows = result[0].Rows;
  236. if (type == "1") {
  237. //获取用户信息
  238. var usercode = rows[0].USERID;
  239. var unitcode = rows[0].UNIT;
  240. var username = rows[0].USERNAME;
  241. var truename = rows[0].NAME;
  242. var password = rows[0].PASSWORD;
  243. var unitname = rows[0].UNIT_NAME;
  244. var contact = rows[0].CONTACT;
  245. var sex = rows[0].SEX;
  246. var telephone = rows[0].TELPHONE;
  247. var email = rows[0].MAIL;
  248. var identify = rows[0].IS_IDENTIFY;
  249. var usertype = rows[0].TYPE;
  250. var userkeycode = rows[0]["TEMPUSERKEYCODE"];
  251. var change_time = rows[0].CHANGE_TIME;
  252. //保存用户信息
  253. const loginUserInfo = {
  254. ywxt_usercode: usercode,
  255. ywxt_username: username,
  256. ywxt_unitcode: unitcode,
  257. ywxt_unitname: unitname,
  258. ywxt_contact: contact,
  259. ywxt_telephone: telephone,
  260. ywxt_email: email,
  261. ywxt_identify: identify,
  262. ywxt_userkeycode: userkeycode,
  263. ptjk_changetime: change_time,
  264. password: password
  265. }
  266. // 根据user_id获取角色
  267. localStorage.setItem('loginUserInfoSpace', JSON.stringify(loginUserInfo))
  268. loginKj_log(unitcode, usercode, "运维系统-登录", "登录系统成功", "系统登录");
  269. //空间运维系统 登录成功后 需要缓存用户权限
  270. selectUserRole(usercode, url);
  271. return;
  272. }
  273. if (type == "2") {
  274. //获取用户信息
  275. var usercode = rows[0].USERID;
  276. var username = rows[0].USERNAME;
  277. var truename = rows[0].NAME;
  278. var password = rows[0].PASSWORD;
  279. var unitcode = rows[0].UNIT;
  280. var unitname = rows[0].UNIT_NAME;
  281. var contact = rows[0].CONTACT;
  282. var sex = rows[0].SEX;
  283. var telephone = rows[0].TELPHONE;
  284. var email = rows[0].MAIL;
  285. var identify = rows[0].IS_IDENTIFY;
  286. var usertype = rows[0].TYPE;
  287. var userkeycode = rows[0]["TEMPUSERKEYCODE"];
  288. var changetime = rows[0]["CHANGE_TIME"];
  289. const loginUserInfo = {
  290. gxjh_usercode: usercode,
  291. gxjh_username: username,
  292. gxjh_unitcode: unitcode,
  293. gxjh_unitname: unitname,
  294. gxjh_contact: contact ? decode(contact) : '',
  295. gxjh_telephone: telephone ? decode(telephone) : '',
  296. gxjh_email: email ? decode(email) : '',
  297. gxjh_identify: identify,
  298. gxjh_userkeycode: userkeycode,
  299. gxjh_changetime: changetime,
  300. }
  301. localStorage.setItem('exchangeUserInfo', JSON.stringify(loginUserInfo))
  302. loginKj_log(unitcode, usercode, "浏览系统-登录", "登录系统成功", "系统登录");
  303. //切换首页
  304. window.open(url, url)
  305. // window.location.href = url;
  306. return;
  307. }
  308. if (type == "9") {
  309. //获取用户信息
  310. var usercode = rows[0].USERID;
  311. var username = rows[0].USERNAME;
  312. var unitcode = rows[0].UNIT;
  313. var unitname = rows[0].UNIT_NAME;
  314. var lasttime = rows[0].LAST_TIME;
  315. var name = rows[0].NAME;
  316. var phone = rows[0].PHONE;
  317. var mail = rows[0].MAIL;
  318. var change_time = rows[0].CHANGE_TIME;
  319. var unit_level = rows[0].UNIT_LEVEL;
  320. var unit_level_name = rows[0].UNIT_LEVEL_NAME;
  321. debugger
  322. var roleId = rows[0].ROLE_LIST.map(obj => obj.ROLE_ID).join(',');
  323. var roleUUID = rows[0].ROLE_LIST.map(obj => obj.UUID).join(',');
  324. localStorage.setItem("cstj_usercode", usercode);
  325. localStorage.setItem("cstj_username", username);
  326. localStorage.setItem("cstj_unitcode", unitcode);
  327. localStorage.setItem("cstj_unitname", unitname);
  328. //localStorage.setItem("cstj_password", password);
  329. localStorage.setItem("cstj_lasttime", lasttime);
  330. localStorage.setItem("cstj_role", roleId);
  331. localStorage.setItem("cstj_role_uuid", roleUUID);
  332. localStorage.setItem("cstj_name", name);
  333. localStorage.setItem("cstj_phone", phone);
  334. localStorage.setItem("cstj_mail", mail);
  335. localStorage.setItem("cstj_changetime", change_time);
  336. localStorage.setItem("cstj_unit_level", unit_level);
  337. localStorage.setItem("cstj_unit_level_name", unit_level_name);
  338. let userInfoObj = {
  339. 'cstj_usercode': usercode,
  340. cstj_username: username,
  341. cstj_unitcode: unitcode,
  342. cstj_unitname: unitname,
  343. //cstj_password:password,
  344. cstj_lasttime: lasttime,
  345. cstj_role: roleId,
  346. cstj_name: name,
  347. cstj_phone: phone,
  348. cstj_mail: mail,
  349. cstj_changetime: change_time,
  350. cstj_role_uuid: roleUUID,
  351. }
  352. localStorage.setItem('cstjUserInfo', JSON.stringify(userInfoObj))
  353. loginKj_log(unitcode, usercode, "城市体检-登录", "登录系统成功", "系统登录");
  354. //切换首页
  355. window.open(url, url)
  356. // window.location.href = url;
  357. return;
  358. }
  359. })
  360. .catch((e) => {
  361. showMessage({
  362. type: 'error',
  363. message: '登录失败'
  364. })
  365. })
  366. }
  367. function loginKj_log(unitid, userid, module, type, des) {
  368. var json_data = {
  369. "UNIT": unitid,
  370. "userid": userid,
  371. "PLATE": module,
  372. "OPERATION": type,
  373. "OPERATIONRESULT": des,
  374. "appkey": localStorage.getItem("ywxt_userkeycode")
  375. };
  376. loginInSpaceLog(json_data).then(res => {
  377. })
  378. }
  379. </script>
  380. <style scoped lang="scss">
  381. .application-system {
  382. text-align: center;
  383. display: flex;
  384. flex-wrap: wrap;
  385. justify-content: center; /* 水平居中 */
  386. align-items: center; /* 垂直居中 */
  387. align-content: center;
  388. font-size: 38px;
  389. line-height: 1.6;
  390. color: rgba(255, 255, 255, 0.7);
  391. height: 100%;
  392. background: url("@/assets/imgs/power-home.png");
  393. background-size: 100% 100%;
  394. .module{
  395. display: flex;
  396. justify-content: center;
  397. align-items: center;
  398. width: 730px;
  399. height:380px;
  400. margin: 20px;
  401. background-color: rgba(255,255,255,0.95);
  402. border-radius: 4px;
  403. .left-part{
  404. width: 40%;
  405. height: 80%;
  406. display: flex;
  407. justify-content: center;
  408. align-items: center;
  409. }
  410. .right-part{
  411. width: 60%;
  412. height: 80%;
  413. .module-title{
  414. width: 100%;
  415. height: 20%;
  416. font-size: 36px;
  417. color: #262626;
  418. text-align: left;
  419. padding-left: 20px;
  420. font-family: "heitao";
  421. }
  422. .module-content{
  423. width: 100%;
  424. height: 80%;
  425. overflow-y: auto;
  426. &::-webkit-scrollbar {
  427. width: 10px;
  428. height: 4px;
  429. }
  430. &::-webkit-scrollbar-thumb {
  431. border-radius: 5px;
  432. -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
  433. background-color: #99a9bf;
  434. }
  435. &::-webkit-scrollbar-track {
  436. -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
  437. border-radius: 5px;
  438. background-color: #d3dce6;
  439. }
  440. .single{
  441. width: 100%;
  442. padding-bottom: 16px;
  443. display: flex;
  444. justify-content: left;
  445. align-items: center;
  446. padding-left: 20px;
  447. cursor: pointer;
  448. .single-icon{
  449. width: 27px;
  450. height: 17px;
  451. background: url("@/assets/imgs/bhtb.png") no-repeat;
  452. background-size: 100% 100%;
  453. }
  454. .single-title{
  455. width: 329px;
  456. height: 36px;
  457. font-family: Microsoft YaHei;
  458. font-weight: 400;
  459. font-size: 20px;
  460. color: #262626;
  461. line-height: 36px;
  462. text-align: left;
  463. }
  464. .disabled{
  465. color: grey;
  466. opacity: 0.5;
  467. }
  468. }
  469. }
  470. }
  471. }
  472. }
  473. </style>