Bez popisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Home2.vue 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <!-- 首页 -->
  2. <template>
  3. <!-- 主要内容区域 -->
  4. <div class="body-bg">
  5. <div class="card">
  6. <div class="title">常用应用</div>
  7. <van-grid :border="false" :column-num="4">
  8. <van-grid-item v-for="(item,idx) in functionList" :key="idx" :to="item.jumpPath">
  9. <img :src="item.img" width="45rpx" />
  10. <span class="vanicon_text">{{ item.title }}</span>
  11. </van-grid-item>
  12. </van-grid>
  13. </div>
  14. <div class="card">
  15. <div class="title">通知公告</div>
  16. <van-grid :border="false" :column-num="4">
  17. <van-grid-item to="/annex">
  18. <img src="../../public/images/zyqk.png" width="45rpx" />
  19. <span class="vanicon_text">文件发布</span>
  20. </van-grid-item>
  21. <van-grid-item to="/notice" v-if="showCheckTakeN">
  22. <img src="../../public/images/yj.png" width="45rpx" />
  23. <span class="vanicon_text">通知公告</span>
  24. </van-grid-item>
  25. </van-grid>
  26. </div>
  27. <div class="card">
  28. <div class="title">制度管理</div>
  29. <van-grid :border="false" :column-num="4">
  30. <van-grid-item to="/institution/law">
  31. <img src="../../public/images/fl.png" width="45rpx" />
  32. <span class="vanicon_text">法律法规</span>
  33. </van-grid-item>
  34. <van-grid-item to="/institution/institutionRegime">
  35. <img src="../../public/images/aqzd.png" width="45rpx" />
  36. <span class="vanicon_text">安全制度管理</span>
  37. </van-grid-item>
  38. <van-grid-item to="/institution/institutionRule">
  39. <img src="../../public/images/zd.png" width="45rpx" />
  40. <span class="vanicon_text">安全操作规程</span>
  41. </van-grid-item>
  42. </van-grid>
  43. </div>
  44. <div class="card">
  45. <div class="title">计划管理</div>
  46. <van-grid :border="false" :column-num="4">
  47. <van-grid-item to="/keyMatters">
  48. <img src="../../public/images/keyMatters.png" width="45rpx" />
  49. <span class="vanicon_text">重点事项</span>
  50. </van-grid-item>
  51. <van-grid-item to="/planManagement">
  52. <img src="../../public/images/planManagement.png" width="45rpx" />
  53. <span class="vanicon_text">计划任务</span>
  54. </van-grid-item>
  55. </van-grid>
  56. </div>
  57. <div class="card">
  58. <div class="title">考核评价</div>
  59. <van-grid :border="false" :column-num="4">
  60. <van-grid-item to="/performanceReview/units">
  61. <img src="../../public/images/unitsPerformance.png" width="45rpx" />
  62. <span class="vanicon_text">单位考核</span>
  63. </van-grid-item>
  64. </van-grid>
  65. </div>
  66. <div class="card">
  67. <div class="title">知识共享</div>
  68. <van-grid :border="false" :column-num="4" v-if="showCheckTakeN">
  69. <van-grid-item to="/knowledge/accident">
  70. <img src="../../public/images/zd.png" width="45rpx" />
  71. <span class="vanicon_text">事故案例</span>
  72. </van-grid-item>
  73. <van-grid-item to="/knowledge/manager">
  74. <img src="../../public/images/zd.png" width="45rpx" />
  75. <span class="vanicon_text">管理案例</span>
  76. </van-grid-item>
  77. <van-grid-item to="/knowledge/Culture">
  78. <img src="../../public/images/zd.png" width="45rpx" />
  79. <span class="vanicon_text">安全环保文化</span>
  80. </van-grid-item>
  81. <van-grid-item to="/knowledge/project">
  82. <img src="../../public/images/zd.png" width="45rpx" />
  83. <span class="vanicon_text">项目案例库</span>
  84. </van-grid-item>
  85. </van-grid>
  86. </div>
  87. <div class="card">
  88. <div class="title">安全检查</div>
  89. <van-grid :border="false" :column-num="4">
  90. <van-grid-item to="/safeCheck/task">
  91. <img src="../../public/images/aq.png" width="45rpx" />
  92. <span class="vanicon_text">检查任务</span>
  93. </van-grid-item>
  94. <van-grid-item to="/checkTake">
  95. <img src="../../public/images/dt.png" width="45rpx" />
  96. <span class="vanicon_text">考试任务</span>
  97. </van-grid-item>
  98. </van-grid>
  99. </div>
  100. <div class="card">
  101. <div class="title">安全监督</div>
  102. <van-grid :border="false" :column-num="4">
  103. <van-grid-item to="/institution/riskList">
  104. <img src="../../public/images/fx.png" width="45rpx" />
  105. <span class="vanicon_text">风险分级管控记录</span>
  106. </van-grid-item>
  107. <van-grid-item to="/lvzhicx">
  108. <img src="../../public/images/lzcx.png" width="45rpx" />
  109. <span class="vanicon_text">履职查询</span>
  110. </van-grid-item>
  111. <van-grid-item to="/yinhuan/hdLedger">
  112. <img src="../../public/images/yh.png" width="45rpx" />
  113. <span class="vanicon_text">隐患台账</span>
  114. </van-grid-item>
  115. <van-grid-item to="/projectManage/projectWorkLedger">
  116. <img src="../../public/images/xm.png" width="45rpx" />
  117. <span class="vanicon_text">项目作业台账</span>
  118. </van-grid-item>
  119. </van-grid>
  120. </div>
  121. <div class="card">
  122. <div class="title">教育培训</div>
  123. <van-grid :border="false" :column-num="4">
  124. <van-grid-item to="/dailyproblem">
  125. <img src="../../public/images/dt.png" width="45rpx" />
  126. <span class="vanicon_text">每日答题</span>
  127. </van-grid-item>
  128. <van-grid-item to="/cardManager">
  129. <img src="../../public/images/zj.png" width="45rpx" />
  130. <span class="vanicon_text">证件管理</span>
  131. </van-grid-item>
  132. <van-grid-item to="/checkTake">
  133. <img src="../../public/images/dt.png" width="45rpx" />
  134. <span class="vanicon_text">逢查必考</span>
  135. </van-grid-item>
  136. <van-grid-item to="/examtask" v-if="showCheckTake">
  137. <img src="../../public/images/zyqk.png" width="45rpx" />
  138. <span class="vanicon_text">考试任务</span>
  139. </van-grid-item>
  140. </van-grid>
  141. </div>
  142. <div class="card">
  143. <div class="title">事故管理</div>
  144. <van-grid :border="false" :column-num="4">
  145. <van-grid-item to="/accidentManager/accidentBaoGaoLedger/index">
  146. <img src="../../public/images/sgbgtz.png" width="45rpx" />
  147. <span class="vanicon_text">事故报告台账</span>
  148. </van-grid-item>
  149. <van-grid-item to="/accidentManager/accidentJuBao/index">
  150. <img src="../../public/images/sgjb.png" width="45rpx" />
  151. <span class="vanicon_text">事故举报</span>
  152. </van-grid-item>
  153. <van-grid-item v-if="true" to="/accidentManager/accidentJuBaoLedger/index">
  154. <img src="../../public/images/sgjbtz.png" width="45rpx" />
  155. <span class="vanicon_text">事故举报台账</span>
  156. </van-grid-item>
  157. </van-grid>
  158. </div>
  159. <div class="card">
  160. <div class="title">安环费用管理</div>
  161. <van-grid :border="false" :column-num="4" v-if="showCheckTakeN">
  162. <van-grid-item to="/moneySafe/safeMoneyManagement">
  163. <img src="../../public/images/aq.png" width="45rpx" />
  164. <span class="vanicon_text">安环费用管理</span>
  165. </van-grid-item>
  166. <van-grid-item to="/moneySafe/safeMoneyBudget">
  167. <img src="../../public/images/aq.png" width="45rpx" />
  168. <span class="vanicon_text">安全费用预算</span>
  169. </van-grid-item>
  170. </van-grid>
  171. </div>
  172. <div class="card">
  173. <div class="title">隐患有奖举报</div>
  174. <van-grid :border="false" :column-num="4">
  175. <van-grid-item to="/yinhuan/hdRwardReporting">
  176. <img src="../../public/images/yhdb.png" width="45rpx" />
  177. <span class="vanicon_text">隐患有奖举报</span>
  178. </van-grid-item>
  179. <van-grid-item to="/yinhuan/hdLedgerJuBao">
  180. <img src="../../public/images/yh.png" width="45rpx" />
  181. <span class="vanicon_text">隐患有奖举报台账</span>
  182. </van-grid-item>
  183. </van-grid>
  184. </div>
  185. </div>
  186. </template>
  187. <script setup>
  188. import { ref, getCurrentInstance, onMounted } from 'vue';
  189. import { onBeforeRouteLeave } from 'vue-router';
  190. import { showFailToast, showSuccessToast } from 'vant';
  191. const {
  192. proxy
  193. } = getCurrentInstance();
  194. const showCheckTake = ref(false);
  195. const showCheckTakeN = ref(false);
  196. const userDesc = localStorage.getItem('userDesc');
  197. const role = localStorage.getItem('role')[0].roleCode;
  198. if (role == 'SX0201' || role == 'SX0201' || role == 'SX0302' || role == 'SX0303') {
  199. showCheckTake.value = true;
  200. }
  201. if (userDesc == '贾俊臣' || userDesc == '张瑞楠' || userDesc == '刘焯') {
  202. showCheckTake.value = true;
  203. showCheckTakeN.value=true
  204. }
  205. const userCode = localStorage.getItem('userCode');
  206. const handleClick = () => {
  207. console.log('111');
  208. const url = '/sgsafe/RecordMaster/tuisong';
  209. const param = {
  210. userCode: userCode
  211. };
  212. proxy.$axios.get(url, param).then(response => {
  213. if (response.data.code == 0) {
  214. showSuccessToast('已推送');
  215. } else {
  216. showFailToast(response.data.msg);
  217. }
  218. }, 500);
  219. };
  220. /**
  221. * 修改最近使用的页面记录
  222. */
  223. const getRecentlyUsed = (jumpPath) => {
  224. const url = '/sgsafe/MenuRecentlyUsed/updateMenuRecentlyUsedStatus'
  225. const param = {
  226. jumpPath
  227. }
  228. proxy.$axios.post(url,param).then(res => {
  229. if (res.data.code !== 0) {
  230. console.log('执行失败!' + res.data.msg)
  231. }
  232. })
  233. }
  234. onBeforeRouteLeave((to, from) => {
  235. getRecentlyUsed(to.path)
  236. });
  237. /**
  238. * 获取最近使用页面记录
  239. */
  240. const functionList = ref([]);
  241. const coincideNotList = ref([]);
  242. const queryMenuRecently = () => {
  243. const url = '/sgsafe/MenuRecentlyUsed/queryRecentlyUsed';
  244. const param = {
  245. applicationId: 'c77da6a732d34400b24374e2cea811ee'
  246. };
  247. proxy.$axios.get(url, param).then(res => {
  248. functionList.value = res.data.data.map(item => ({
  249. title: item.menuName,
  250. img: 'images/' + item.menuIcon,
  251. jumpPath: item.jumpPath
  252. }));
  253. if (functionList.value.length < 4) {
  254. coincideNotList.value = defaultPageList.value;
  255. for (let item of functionList.value) {
  256. coincideNotList.value = coincideNotList.value.filter(info => info.jumpPath !== item.jumpPath);
  257. }
  258. coincideNotList.value = coincideNotList.value.slice(0, 4 - functionList.value.length);
  259. functionList.value = [...functionList.value, ...coincideNotList.value];
  260. } else {
  261. functionList.value = functionList.value.slice(0, 4);
  262. }
  263. });
  264. };
  265. onMounted(() => {
  266. queryMenuRecently();
  267. });
  268. /**
  269. * 默认页面
  270. */
  271. const defaultPageList = ref([
  272. { title: '隐患登记', img: 'images/yhdj.png', jumpPath: '/yinhuan/registration' },
  273. { title: '隐患台账', img: 'images/yh.png', jumpPath: '/yinhuan/hdLedger' },
  274. { title: '每日答题', img: 'images/dt.png', jumpPath: '/dailyproblem' },
  275. { title: '履职记录', img: 'images/lz.png', jumpPath: '/lvzhi' },
  276. { title: '安全制度管理', img: 'images/aqzd.png', jumpPath: '/institution/institutionRegime' },
  277. { title: '证件管理', img: 'images/zj.png', jumpPath: '/cardManager' },
  278. { title: '隐患待办', img: 'images/yhdb.png', jumpPath: '/yinhuan/todo' }
  279. ]);
  280. /**
  281. * 测试消息
  282. */
  283. const getAccessToken = () => {
  284. const url = '/sgsafe/MobileMessage/getAccessToken';
  285. const params = {};
  286. proxy.$axios.get(url, params).then(response => {
  287. if (response.data.code === 0) {
  288. console.log('accessToken操作成功', response.data.data);
  289. } else {
  290. console.log('accessToken操作失败操作失败', response.data.fullMsg);
  291. }
  292. });
  293. };
  294. const sendMobileMsg = () => {
  295. const url = '/sgsafe/MobileMessage/sendMsg';
  296. const params = {};
  297. proxy.$axios.get(url, params).then(response => {
  298. if (response.data.code === 0) {
  299. console.log('accessToken操作成功', response.data.data);
  300. } else {
  301. showFailToast('操作失败', response.data.msg);
  302. console.log('accessToken操作失败操作失败', response.data.fullMsg);
  303. }
  304. });
  305. };
  306. </script>
  307. <style scoped>
  308. /* 固定在顶部的标题栏样式 */
  309. .header-title {
  310. background-color: #3875c6;
  311. height: 50px;
  312. padding: 15px 20px;
  313. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  314. z-index: 100;
  315. }
  316. .title-text {
  317. margin-top: 12px;
  318. color: white;
  319. font-size: 18px;
  320. /* font-weight: 600; */
  321. text-align: center;
  322. font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  323. letter-spacing: 1px;
  324. }
  325. .body-bg {
  326. background-color: #ffffff;
  327. padding-top: 10px;
  328. }
  329. :deep(.van-grid-item__text) {
  330. font-size: var(--van-font-size-lg0);
  331. }
  332. .dbTitle {
  333. margin-top: 10px;
  334. }
  335. .daiban_titile_img {
  336. vertical-align: middle;
  337. width: 20px;
  338. height: 20px;
  339. }
  340. .custom-title {
  341. font-size: var(--van-font-size-lg);
  342. font-weight: bold;
  343. color: var(--van-gray-9);
  344. }
  345. .vanicon_text {
  346. font-size: var(--van-font-size-lg0);
  347. color: var(--van-grid-item-text-color);
  348. margin-top: var(--van-padding-xs);
  349. line-height: 1.5;
  350. word-break: break-all;
  351. text-align: center;
  352. height: 40px;
  353. }
  354. .card {
  355. margin: 10px;
  356. border-radius: 8px;
  357. overflow: hidden;
  358. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  359. background-color: #fff;
  360. }
  361. .title {
  362. padding-left: 20px;
  363. padding-top: 20px;
  364. font-weight: bold;
  365. font-size: 20px;
  366. }
  367. </style>