index.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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>
  62. </view>
  63. <uni-section title="日报周报" type="line"></uni-section>
  64. <view class="grid-body">
  65. <uni-grid :column="4" :showBorder="false" @change="changeDiaryGrid">
  66. <uni-grid-item :index="1">
  67. <view class="grid-item-box">
  68. <text class="ygoa-icon icon-diary"></text>
  69. <text class="text">日报</text>
  70. </view>
  71. </uni-grid-item>
  72. </uni-grid>
  73. </view>
  74. <uni-section title="系统工具" type="line"></uni-section>
  75. <view class="grid-body">
  76. <uni-grid :column="4" :showBorder="false" @change="changeToolsGrid">
  77. <uni-grid-item :index="1">
  78. <view class="grid-item-box">
  79. <text class="ygoa-icon icon-calculator"></text>
  80. <text class="text">计算器</text>
  81. </view>
  82. </uni-grid-item>
  83. <uni-grid-item :index="2">
  84. <view class="grid-item-box">
  85. <text class="ygoa-icon icon-clear-cache"></text>
  86. <text class="text">清除缓存</text>
  87. </view>
  88. </uni-grid-item>
  89. </uni-grid>
  90. </view>
  91. <!-- 计算器弹出层 -->
  92. <view class="popup_container">
  93. <cui-calculator ref="calculatorPopup" size="normal"></cui-calculator>
  94. </view>
  95. <!-- 清除缓存弹出层 -->
  96. <view class="clear_cache_popup_container">
  97. <uni-popup ref="clearCacheDialog" type="dialog">
  98. <uni-popup-dialog title="确认清除缓存" @confirm="clearCache"></uni-popup-dialog>
  99. </uni-popup>
  100. </view>
  101. </view>
  102. </template>
  103. <script setup lang="ts">
  104. import cuiCalculator from "@/components/cui-calculator/cui-calculator.vue"
  105. import { ref } from "vue"
  106. // import $modal from "@/plugins/modal.js"
  107. import $tab from "@/plugins/tab.js"
  108. function changeProcessGrid(e) { // 点击流程宫格
  109. console.log('changeProcessGrid', e);
  110. // 跳转流程申请页面
  111. $tab.navigateTo('/pages/work/edit/index?title=' + '')
  112. }
  113. function changeDiaryGrid() {
  114. }
  115. function changeToolsGrid(e) { // 点击工具宫格
  116. switch (e.detail.index) {
  117. case 1:
  118. openCalculatorPopup()
  119. break
  120. case 2:
  121. openClearCachePopup()
  122. break
  123. default:
  124. }
  125. console.log('changeToolsGrid', e);
  126. // $tab.navigateTo('/pages/work/edit/index?title=' + '')
  127. // $modal.showToast('模块建设中~')
  128. }
  129. // 计算器
  130. const calculatorPopup = ref(null)
  131. function openCalculatorPopup() { // 打开计算器弹出层
  132. calculatorPopup.value.open()
  133. }
  134. function closeCalculatorPopup() { // 关闭计算器弹出层
  135. calculatorPopup.value.close()
  136. }
  137. // 清除缓存
  138. const clearCacheDialog = ref(null)
  139. function openClearCachePopup() { // 打开清除缓存弹出层
  140. clearCacheDialog.value.open()
  141. }
  142. function closeClearCachePopup() { // 关闭清除缓存弹出层
  143. clearCacheDialog.value.close()
  144. }
  145. function clearCache() {
  146. uni.clearStorageSync();
  147. // 提示用户缓存清理成功
  148. uni.showToast({
  149. title: '缓存清理成功',
  150. icon: 'success',
  151. duration: 2000
  152. });
  153. }
  154. </script>
  155. <style lang="scss">
  156. @import "@/static/font/ygoa/iconfont.css";
  157. .ygoa-icon {
  158. font-size: 30px;
  159. // color: #468bf0;
  160. }
  161. /* #ifndef APP-NVUE */
  162. page {
  163. display: flex;
  164. flex-direction: column;
  165. box-sizing: border-box;
  166. background-color: #fff;
  167. min-height: 100%;
  168. height: auto;
  169. }
  170. view {
  171. font-size: 14px;
  172. line-height: inherit;
  173. }
  174. /* #endif */
  175. .text {
  176. text-align: center;
  177. font-size: 26rpx;
  178. margin-top: 10rpx;
  179. }
  180. .grid-item-box {
  181. flex: 1;
  182. /* #ifndef APP-NVUE */
  183. display: flex;
  184. /* #endif */
  185. flex-direction: column;
  186. align-items: center;
  187. justify-content: center;
  188. padding: 15px 0;
  189. }
  190. .uni-margin-wrap {
  191. width: 690rpx;
  192. width: 100%;
  193. ;
  194. }
  195. .swiper {
  196. height: 300rpx;
  197. }
  198. .swiper-box {
  199. height: 150px;
  200. }
  201. .swiper-item {
  202. /* #ifndef APP-NVUE */
  203. display: flex;
  204. /* #endif */
  205. flex-direction: column;
  206. justify-content: center;
  207. align-items: center;
  208. color: #fff;
  209. height: 300rpx;
  210. line-height: 300rpx;
  211. }
  212. @media screen and (min-width: 500px) {
  213. .uni-swiper-dot-box {
  214. width: 400px;
  215. /* #ifndef APP-NVUE */
  216. margin: 0 auto;
  217. /* #endif */
  218. margin-top: 8px;
  219. }
  220. .image {
  221. width: 100%;
  222. }
  223. }
  224. </style>