Нет описания
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  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="/examtask" v-if="showCheckTake">
  95. <img src="../../public/images/zyqk.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="/courseManagement" v-if="showCheckTake">
  125. <img src="../../public/images/zyqk.png" width="45rpx" />
  126. <span class="vanicon_text">课程管理</span>
  127. </van-grid-item>
  128. <van-grid-item to="/class2" v-if="showCheckTake">
  129. <img src="../../public/images/zyqk.png" width="45rpx" />
  130. <span class="vanicon_text">在线学习考试</span>
  131. </van-grid-item>
  132. <van-grid-item to="/cardManager">
  133. <img src="../../public/images/zj.png" width="45rpx" />
  134. <span class="vanicon_text">证件管理</span>
  135. </van-grid-item>
  136. </van-grid>
  137. </div>
  138. <div class="card">
  139. <div class="title">事故管理</div>
  140. <van-grid :border="false" :column-num="4">
  141. <van-grid-item to="/accidentManager/accidentBaoGaoLedger/index">
  142. <img src="../../public/images/sgbgtz.png" width="45rpx" />
  143. <span class="vanicon_text">事故报告台账</span>
  144. </van-grid-item>
  145. <van-grid-item to="/accidentManager/accidentJuBao/index">
  146. <img src="../../public/images/sgjb.png" width="45rpx" />
  147. <span class="vanicon_text">事故举报</span>
  148. </van-grid-item>
  149. <van-grid-item v-if="true" to="/accidentManager/accidentJuBaoLedger/index">
  150. <img src="../../public/images/sgjbtz.png" width="45rpx" />
  151. <span class="vanicon_text">事故举报台账</span>
  152. </van-grid-item>
  153. </van-grid>
  154. </div>
  155. <div class="card">
  156. <div class="title">安环费用管理</div>
  157. <van-grid :border="false" :column-num="4" v-if="showCheckTakeN">
  158. <van-grid-item to="/moneySafe/safeMoneyManagement">
  159. <img src="../../public/images/aq.png" width="45rpx" />
  160. <span class="vanicon_text">安环费用管理</span>
  161. </van-grid-item>
  162. <van-grid-item to="/moneySafe/safeMoneyBudget">
  163. <img src="../../public/images/aq.png" width="45rpx" />
  164. <span class="vanicon_text">安全费用预算</span>
  165. </van-grid-item>
  166. </van-grid>
  167. </div>
  168. <div class="card">
  169. <div class="title">隐患有奖举报</div>
  170. <van-grid :border="false" :column-num="4">
  171. <van-grid-item to="/yinhuan/hdRwardReporting">
  172. <img src="../../public/images/yhdb.png" width="45rpx" />
  173. <span class="vanicon_text">隐患有奖举报</span>
  174. </van-grid-item>
  175. <van-grid-item to="/yinhuan/hdLedgerJuBao">
  176. <img src="../../public/images/yh.png" width="45rpx" />
  177. <span class="vanicon_text">隐患有奖举报台账</span>
  178. </van-grid-item>
  179. </van-grid>
  180. </div>
  181. </div>
  182. </template>
  183. <script setup>
  184. import { ref, getCurrentInstance, onMounted } from 'vue';
  185. import { onBeforeRouteLeave } from 'vue-router';
  186. import { showFailToast, showSuccessToast } from 'vant';
  187. const {
  188. proxy
  189. } = getCurrentInstance();
  190. const showCheckTake = ref(false);
  191. const showCheckTakeN = ref(false);
  192. const userDesc = localStorage.getItem('userDesc');
  193. const role = localStorage.getItem('role')[0].roleCode;
  194. if (role == 'SX0201' || role == 'SX0201' || role == 'SX0302' || role == 'SX0303') {
  195. showCheckTake.value = true;
  196. }
  197. if (userDesc == '贾俊臣' || userDesc == '张瑞楠' || userDesc == '刘焯') {
  198. showCheckTake.value = true;
  199. showCheckTakeN.value=true
  200. }
  201. const userCode = localStorage.getItem('userCode');
  202. const handleClick = () => {
  203. console.log('111');
  204. const url = '/sgsafe/RecordMaster/tuisong';
  205. const param = {
  206. userCode: userCode
  207. };
  208. proxy.$axios.get(url, param).then(response => {
  209. if (response.data.code == 0) {
  210. showSuccessToast('已推送');
  211. } else {
  212. showFailToast(response.data.msg);
  213. }
  214. }, 500);
  215. };
  216. /**
  217. * 修改最近使用的页面记录
  218. */
  219. const getRecentlyUsed = (jumpPath) => {
  220. const url = '/sgsafe/MenuRecentlyUsed/updateMenuRecentlyUsedStatus'
  221. const param = {
  222. json: JSON.stringify({
  223. jumpPath,
  224. applicationId: 'c77da6a732d34400b24374e2cea811ee',
  225. })
  226. }
  227. proxy.$axios.post(url,param).then(res => {
  228. if (res.data.code !== 0) {
  229. console.log('执行失败!' + res.data.msg)
  230. }
  231. })
  232. }
  233. onBeforeRouteLeave((to, from) => {
  234. getRecentlyUsed(to.path)
  235. });
  236. /**
  237. * 获取最近使用页面记录
  238. */
  239. const functionList = ref([]);
  240. const coincideNotList = ref([]);
  241. const queryMenuRecently = () => {
  242. const url = '/sgsafe/MenuRecentlyUsed/queryRecentlyUsed';
  243. const param = {
  244. applicationId: 'c77da6a732d34400b24374e2cea811ee'
  245. };
  246. proxy.$axios.get(url, param).then(res => {
  247. functionList.value = res.data.data.map(item => ({
  248. title: item.menuName,
  249. img: 'images/' + item.menuIcon,
  250. jumpPath: item.jumpPath
  251. }));
  252. if (functionList.value.length < 4) {
  253. coincideNotList.value = defaultPageList.value;
  254. for (let item of functionList.value) {
  255. coincideNotList.value = coincideNotList.value.filter(info => info.jumpPath !== item.jumpPath);
  256. }
  257. coincideNotList.value = coincideNotList.value.slice(0, 4 - functionList.value.length);
  258. functionList.value = [...functionList.value, ...coincideNotList.value];
  259. } else {
  260. functionList.value = functionList.value.slice(0, 4);
  261. }
  262. });
  263. };
  264. onMounted(() => {
  265. queryMenuRecently();
  266. });
  267. /**
  268. * 默认页面
  269. */
  270. const defaultPageList = ref([
  271. { title: '隐患登记', img: 'images/yhdj.png', jumpPath: '/yinhuan/registration' },
  272. { title: '隐患台账', img: 'images/yh.png', jumpPath: '/yinhuan/hdLedger' },
  273. { title: '每日答题', img: 'images/dt.png', jumpPath: '/dailyproblem' },
  274. { title: '履职记录', img: 'images/lz.png', jumpPath: '/lvzhi' },
  275. { title: '安全制度管理', img: 'images/aqzd.png', jumpPath: '/institution/institutionRegime' },
  276. { title: '证件管理', img: 'images/zj.png', jumpPath: '/cardManager' },
  277. { title: '隐患待办', img: 'images/yhdb.png', jumpPath: '/yinhuan/todo' }
  278. ]);
  279. /**
  280. * 测试消息
  281. */
  282. const getAccessToken = () => {
  283. const url = '/sgsafe/MobileMessage/getAccessToken';
  284. const params = {};
  285. proxy.$axios.get(url, params).then(response => {
  286. if (response.data.code === 0) {
  287. console.log('accessToken操作成功', response.data.data);
  288. } else {
  289. console.log('accessToken操作失败操作失败', response.data.fullMsg);
  290. }
  291. });
  292. };
  293. const sendMobileMsg = () => {
  294. const url = '/sgsafe/MobileMessage/sendMsg';
  295. const params = {};
  296. proxy.$axios.get(url, params).then(response => {
  297. if (response.data.code === 0) {
  298. console.log('accessToken操作成功', response.data.data);
  299. } else {
  300. showFailToast('操作失败', response.data.msg);
  301. console.log('accessToken操作失败操作失败', response.data.fullMsg);
  302. }
  303. });
  304. };
  305. </script>
  306. <style scoped>
  307. /* 固定在顶部的标题栏样式 */
  308. .header-title {
  309. background-color: #3875c6;
  310. height: 50px;
  311. padding: 15px 20px;
  312. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  313. z-index: 100;
  314. }
  315. .title-text {
  316. margin-top: 12px;
  317. color: white;
  318. font-size: 18px;
  319. /* font-weight: 600; */
  320. text-align: center;
  321. font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  322. letter-spacing: 1px;
  323. }
  324. .body-bg {
  325. background-color: #ffffff;
  326. padding-top: 10px;
  327. }
  328. :deep(.van-grid-item__text) {
  329. font-size: var(--van-font-size-lg0);
  330. }
  331. .dbTitle {
  332. margin-top: 10px;
  333. }
  334. .daiban_titile_img {
  335. vertical-align: middle;
  336. width: 20px;
  337. height: 20px;
  338. }
  339. .custom-title {
  340. font-size: var(--van-font-size-lg);
  341. font-weight: bold;
  342. color: var(--van-gray-9);
  343. }
  344. .vanicon_text {
  345. font-size: var(--van-font-size-lg0);
  346. color: var(--van-grid-item-text-color);
  347. margin-top: var(--van-padding-xs);
  348. line-height: 1.5;
  349. word-break: break-all;
  350. text-align: center;
  351. height: 40px;
  352. }
  353. .card {
  354. margin: 10px;
  355. border-radius: 8px;
  356. overflow: hidden;
  357. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  358. background-color: #fff;
  359. }
  360. .title {
  361. padding-left: 20px;
  362. padding-top: 20px;
  363. font-weight: bold;
  364. font-size: 20px;
  365. }
  366. </style>