index.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <template>
  2. <view class="work-container">
  3. <!-- 宫格组件 -->
  4. <uni-section title="日常办公" type="line"></uni-section>
  5. <view class="grid-body">
  6. <uni-grid :column="4" :showBorder="false" @change="changeProcessGrid">
  7. <uni-grid-item :index="1">
  8. <view class="grid-item-box">
  9. <text class="ygoa-icon icon-outsourcing"></text>
  10. <text class="text">外协结算</text>
  11. </view>
  12. </uni-grid-item>
  13. <uni-grid-item :index="2">
  14. <view class="grid-item-box">
  15. <text class="ygoa-icon icon-apply-car"></text>
  16. <text class="text">用车申请</text>
  17. </view>
  18. </uni-grid-item>
  19. <uni-grid-item :index="3">
  20. <view class="grid-item-box">
  21. <text class="ygoa-icon icon-apply-business"></text>
  22. <text class="text">出差申请</text>
  23. </view>
  24. </uni-grid-item>
  25. <uni-grid-item :index="4">
  26. <view class="grid-item-box">
  27. <text class="ygoa-icon icon-apply-out"></text>
  28. <text class="text">外出申请</text>
  29. </view>
  30. </uni-grid-item>
  31. <uni-grid-item :index="5">
  32. <view class="grid-item-box">
  33. <text class="ygoa-icon icon-apply-expense"></text>
  34. <text class="text">费用报销</text>
  35. </view>
  36. </uni-grid-item>
  37. <uni-grid-item :index="6">
  38. <view class="grid-item-box">
  39. <text class="ygoa-icon icon-apply-overtime"></text>
  40. <text class="text">加班申请</text>
  41. </view>
  42. </uni-grid-item>
  43. <uni-grid-item :index="7">
  44. <view class="grid-item-box">
  45. <text class="ygoa-icon icon-apply-leave"></text>
  46. <text class="text">请假申请</text>
  47. </view>
  48. </uni-grid-item>
  49. <uni-grid-item :index="8">
  50. <view class="grid-item-box">
  51. <text class="ygoa-icon icon-apply-purchase"></text>
  52. <text class="text">采购申请</text>
  53. </view>
  54. </uni-grid-item>
  55. <uni-grid-item :index="9">
  56. <view class="grid-item-box">
  57. <text class="ygoa-icon icon-apply-sign-contract"></text>
  58. <text class="text">合同会签</text>
  59. </view>
  60. </uni-grid-item>
  61. <uni-grid-item :index="10">
  62. <view class="grid-item-box">
  63. <text class="ygoa-icon icon-checkIn"></text>
  64. <text class="text">考勤</text>
  65. </view>
  66. </uni-grid-item>
  67. <uni-grid-item :index="11">
  68. <view class="grid-item-box">
  69. <text class="ygoa-icon icon-location"></text>
  70. <text class="text">打卡</text>
  71. </view>
  72. </uni-grid-item>
  73. </uni-grid>
  74. </view>
  75. <uni-section title="日报周报" type="line"></uni-section>
  76. <view class="grid-body">
  77. <uni-grid :column="4" :showBorder="false" @change="changeDiaryGrid">
  78. <uni-grid-item :index="1">
  79. <view class="grid-item-box">
  80. <text class="ygoa-icon icon-diary"></text>
  81. <text class="text">日报</text>
  82. </view>
  83. </uni-grid-item>
  84. <uni-grid-item :index="2">
  85. <view class="grid-item-box">
  86. <text class="ygoa-icon icon-diary"></text>
  87. <text class="text">日报</text>
  88. </view>
  89. </uni-grid-item>
  90. </uni-grid>
  91. </view>
  92. <uni-section title="系统工具" type="line"></uni-section>
  93. <view class="grid-body">
  94. <uni-grid :column="4" :showBorder="false" @change="changeToolsGrid">
  95. <uni-grid-item :index="1">
  96. <view class="grid-item-box">
  97. <text class="ygoa-icon icon-calculator"></text>
  98. <text class="text">计算器</text>
  99. </view>
  100. </uni-grid-item>
  101. <uni-grid-item :index="2">
  102. <view class="grid-item-box">
  103. <text class="ygoa-icon icon-clear-cache"></text>
  104. <text class="text">清除缓存</text>
  105. </view>
  106. </uni-grid-item>
  107. </uni-grid>
  108. </view>
  109. <!-- 计算器弹出层 -->
  110. <view class="popup_container">
  111. <cui-calculator ref="calculatorPopup" size="normal"></cui-calculator>
  112. </view>
  113. <!-- 清除缓存弹出层 -->
  114. <view class="clear_cache_popup_container">
  115. <uni-popup ref="clearCacheDialog" type="dialog">
  116. <uni-popup-dialog title="确认清除缓存" @confirm="clearCache"></uni-popup-dialog>
  117. </uni-popup>
  118. </view>
  119. </view>
  120. </template>
  121. <script setup lang="ts">
  122. import cuiCalculator from "@/components/cui-calculator/cui-calculator.vue"
  123. import { ref } from "vue"
  124. // import $modal from "@/plugins/modal.js"
  125. import $tab from "@/plugins/tab.js"
  126. import { getUserInfo } from '@/utils/auth'
  127. import { useUserStore } from '@/store/user.js'
  128. function changeProcessGrid(e) { // 点击流程宫格
  129. console.log('changeProcessGrid', e);
  130. // 跳转流程申请页面
  131. $tab.navigateTo('/pages/work/edit/index?title=' + '')
  132. }
  133. function changeDiaryGrid(e) {
  134. if (1 == e.detail.index) {
  135. wx.navigateToMiniProgram({
  136. appId: 'wxd45c635d754dbf59',
  137. path: `pages/detail/detail?url=https://docs.qq.com/sheet/DZndGYU5aWVBpR1Nm`
  138. })
  139. return
  140. }
  141. if (2 == e.detail.index) {
  142. $tab.navigateTo('/pages/work/diary/index')
  143. return
  144. }
  145. }
  146. function changeToolsGrid(e) { // 点击工具宫格
  147. switch (e.detail.index) {
  148. case 1:
  149. openCalculatorPopup()
  150. break
  151. case 2:
  152. openClearCachePopup()
  153. break
  154. default:
  155. }
  156. console.log('changeToolsGrid', e);
  157. // $tab.navigateTo('/pages/work/edit/index?title=' + '')
  158. // $modal.showToast('模块建设中~')
  159. }
  160. // 计算器
  161. const calculatorPopup = ref(null)
  162. function openCalculatorPopup() { // 打开计算器弹出层
  163. calculatorPopup.value.open()
  164. }
  165. function closeCalculatorPopup() { // 关闭计算器弹出层
  166. calculatorPopup.value.close()
  167. }
  168. // 清除缓存
  169. const clearCacheDialog = ref(null)
  170. function openClearCachePopup() { // 打开清除缓存弹出层
  171. clearCacheDialog.value.open()
  172. }
  173. function closeClearCachePopup() { // 关闭清除缓存弹出层
  174. clearCacheDialog.value.close()
  175. }
  176. // const userStore = useUserStore()
  177. function clearCache() {
  178. const userInfo = getUserInfo()
  179. uni.clearStorageSync();
  180. // console.log('userStore.user', userStore.user);
  181. // console.log('userInfo', userInfo);
  182. uni.setStorageSync('userInfo', userInfo)
  183. // console.log('userInfo', userStore.user);
  184. // 提示用户缓存清理成功
  185. uni.showToast({
  186. title: '缓存清理成功',
  187. icon: 'success',
  188. duration: 2000
  189. });
  190. }
  191. </script>
  192. <style lang="scss">
  193. @import "@/static/font/ygoa/iconfont.css";
  194. .ygoa-icon {
  195. font-size: 80rpx;
  196. // color: #468bf0;
  197. }
  198. /* #ifndef APP-NVUE */
  199. page {
  200. display: flex;
  201. flex-direction: column;
  202. box-sizing: border-box;
  203. background-color: #fff;
  204. min-height: 100%;
  205. height: auto;
  206. }
  207. view {
  208. font-size: 14px;
  209. line-height: inherit;
  210. }
  211. /* #endif */
  212. .text {
  213. text-align: center;
  214. font-size: 26rpx;
  215. margin-top: 10rpx;
  216. }
  217. .grid-item-box {
  218. flex: 1;
  219. /* #ifndef APP-NVUE */
  220. display: flex;
  221. /* #endif */
  222. flex-direction: column;
  223. align-items: center;
  224. justify-content: center;
  225. padding: 15px 0;
  226. }
  227. .uni-margin-wrap {
  228. width: 690rpx;
  229. width: 100%;
  230. ;
  231. }
  232. .swiper {
  233. height: 300rpx;
  234. }
  235. .swiper-box {
  236. height: 150px;
  237. }
  238. .swiper-item {
  239. /* #ifndef APP-NVUE */
  240. display: flex;
  241. /* #endif */
  242. flex-direction: column;
  243. justify-content: center;
  244. align-items: center;
  245. color: #fff;
  246. height: 300rpx;
  247. line-height: 300rpx;
  248. }
  249. @media screen and (min-width: 500px) {
  250. .uni-swiper-dot-box {
  251. width: 400px;
  252. /* #ifndef APP-NVUE */
  253. margin: 0 auto;
  254. /* #endif */
  255. margin-top: 8px;
  256. }
  257. .image {
  258. width: 100%;
  259. }
  260. }
  261. </style>