index.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <template>
  2. <page-meta root-font-size="system" />
  3. <view class="work-container">
  4. <!-- 宫格组件 -->
  5. <view v-if="processList.fList.length != 0">
  6. <uni-section :title="processList.ftypeList[0].typeName" titleFontSize="1.3rem" type="line"></uni-section>
  7. <view class="grid-body">
  8. <uni-grid :column="4" :showBorder="false" @change="changeProcessGrid">
  9. <uni-grid-item v-for="(item, index) in processList.fList" :index="index" :key="index">
  10. <view class="grid-item-box">
  11. <text class="ygoa-icon"
  12. :class="item.modelPicture == 'default.png' ? 'icon-outsourcing' : item.modelPicture"></text>
  13. <text class="text">{{ item.modelName }}</text>
  14. </view>
  15. </uni-grid-item>
  16. </uni-grid>
  17. </view>
  18. </view>
  19. <uni-section title="考勤管理" titleFontSize="1.3rem" type="line"></uni-section>
  20. <view class="grid-body">
  21. <uni-grid :column="4" :showBorder="false" @change="changeAttendanceGrid">
  22. <uni-grid-item :index="1">
  23. <view class="grid-item-box">
  24. <text class="ygoa-icon icon-checkIn"></text>
  25. <text class="text">考勤</text>
  26. </view>
  27. </uni-grid-item>
  28. <uni-grid-item :index="2">
  29. <view class="grid-item-box">
  30. <text class="ygoa-icon icon-location"></text>
  31. <text class="text">打卡</text>
  32. </view>
  33. </uni-grid-item>
  34. </uni-grid>
  35. </view>
  36. <uni-section title="日报周报" titleFontSize="1.3rem" type="line"></uni-section>
  37. <view class="grid-body">
  38. <uni-grid :column="4" :showBorder="false" @change="changeDiaryGrid">
  39. <uni-grid-item :index="1">
  40. <view class="grid-item-box">
  41. <text class="ygoa-icon icon-diary"></text>
  42. <text class="text">日报</text>
  43. </view>
  44. </uni-grid-item>
  45. <!-- <uni-grid-item :index="2">
  46. <view class="grid-item-box">
  47. <text class="ygoa-icon icon-diary"></text>
  48. <text class="text">日报</text>
  49. </view>
  50. </uni-grid-item> -->
  51. </uni-grid>
  52. </view>
  53. <uni-section title="系统工具" titleFontSize="1.3rem" type="line"></uni-section>
  54. <view class="grid-body">
  55. <uni-grid :column="4" :showBorder="false" @change="changeToolsGrid">
  56. <uni-grid-item :index="1">
  57. <view class="grid-item-box">
  58. <text class="ygoa-icon icon-calculator"></text>
  59. <text class="text">计算器</text>
  60. </view>
  61. </uni-grid-item>
  62. <uni-grid-item :index="2">
  63. <view class="grid-item-box">
  64. <text class="ygoa-icon icon-clear-cache"></text>
  65. <text class="text">清除缓存</text>
  66. </view>
  67. </uni-grid-item>
  68. </uni-grid>
  69. </view>
  70. <!-- 计算器弹出层 -->
  71. <view class="popup_container">
  72. <cui-calculator ref="calculatorPopup" size="normal"></cui-calculator>
  73. </view>
  74. <!-- 清除缓存弹出层 -->
  75. <!-- <view class="clear_cache_popup_container">
  76. <uni-popup ref="clearCacheDialog" type="dialog">
  77. <uni-popup-dialog title="确认清除缓存" @confirm="clearCache"></uni-popup-dialog>
  78. </uni-popup>
  79. </view> -->
  80. </view>
  81. </template>
  82. <script setup lang="ts">
  83. import cuiCalculator from "@/components/cui-calculator/cui-calculator.vue"
  84. import { onMounted, ref } from "vue"
  85. import $tab from "@/plugins/tab.js"
  86. import { useUserStore } from '@/store/user.js'
  87. import { getProcessList } from '@/api/work.js'
  88. import { clearCache } from '@/utils/ygoa.js'
  89. import { onShow } from '@dcloudio/uni-app'
  90. const userStore = useUserStore()
  91. onMounted(() => {
  92. initProcessList()
  93. })
  94. onShow(()=>{
  95. uni.$emit('showTabBarBadge')
  96. })
  97. // 流程列表
  98. const processList = ref({
  99. fList: [],
  100. ftypeList: [
  101. {
  102. typeName: ''
  103. }
  104. ],
  105. })
  106. // 获取流程宫格数据
  107. function initProcessList() {
  108. const staffId = userStore.user.useId
  109. const unitId = userStore.user.unitId
  110. getProcessList(staffId, unitId).then(res => {
  111. processList.value = res.returnParams // 设置processList
  112. })
  113. }
  114. // 点击流程宫格
  115. function changeProcessGrid(e) {
  116. // console.log('changeProcessGrid', e);
  117. const { modelName, modelId, control } = processList.value.fList[e.detail.index]
  118. // 跳转流程申请页面
  119. $tab.navigateTo('/pages/work/edit/index?modelName=' + modelName + '&modelId=' + modelId + '&control=' + control)
  120. }
  121. // 点击考勤宫格
  122. function changeAttendanceGrid(e) {
  123. if (1 == e.detail.index) { // 考勤
  124. $tab.navigateTo('/pages/mine/checkIn/checkIn')
  125. }
  126. if (2 == e.detail.index) { // 打卡
  127. $tab.navigateTo('/pages/mine/clockIn/clockIn')
  128. }
  129. }
  130. // 点击日报宫格
  131. function changeDiaryGrid(e) {
  132. if (1 == e.detail.index) {
  133. wx.navigateToMiniProgram({
  134. appId: 'wxd45c635d754dbf59',
  135. path: `pages/detail/detail?url=https://docs.qq.com/sheet/DZndGYU5aWVBpR1Nm`
  136. })
  137. // wx.navigateToMiniProgram({
  138. // appId: 'wxde4bf149a4c88707',
  139. // path: `pages/login`
  140. // })
  141. return
  142. }
  143. if (2 == e.detail.index) {
  144. $tab.navigateTo('/pages/work/diary/index')
  145. return
  146. }
  147. }
  148. // 点击工具宫格
  149. function changeToolsGrid(e) {
  150. switch (e.detail.index) {
  151. case 1:
  152. openCalculatorPopup() // 打开计算器弹出层
  153. break
  154. case 2:
  155. clearCache()
  156. // openClearCachePopup() // 打开清除缓存弹出层
  157. break
  158. default:
  159. }
  160. }
  161. // 计算器
  162. const calculatorPopup = ref(null)
  163. function openCalculatorPopup() { // 打开计算器弹出层
  164. calculatorPopup.value.open()
  165. }
  166. // 清除缓存
  167. // const clearCacheDialog = ref(null)
  168. // function openClearCachePopup() { // 打开清除缓存弹出层
  169. // clearCacheDialog.value.open()
  170. // }
  171. // const userStore = useUserStore()
  172. </script>
  173. <style lang="scss">
  174. // @import "@/static/font/ygoa/iconfont.css";
  175. .ygoa-icon {
  176. font-size: calc(80rpx + .5*(1rem - 16px));
  177. }
  178. /* #ifndef APP-NVUE */
  179. page {
  180. display: flex;
  181. flex-direction: column;
  182. box-sizing: border-box;
  183. background-color: #fff;
  184. min-height: 100%;
  185. height: auto;
  186. }
  187. view {
  188. font-size: calc(14px + .5*(1rem - 16px));
  189. line-height: inherit;
  190. }
  191. /* #endif */
  192. .text {
  193. text-align: center;
  194. font-size: calc(26rpx + .5* (1rem - 16px));// 16px
  195. margin-top: 10rpx;
  196. }
  197. .work-container {
  198. .grid-item-box {
  199. flex: 1;
  200. /* #ifndef APP-NVUE */
  201. display: flex;
  202. /* #endif */
  203. flex-direction: column;
  204. align-items: center;
  205. justify-content: center;
  206. padding: 15px 0;
  207. }
  208. // .uni-margin-wrap {
  209. // width: 690rpx;
  210. // width: 100%;
  211. // }
  212. .swiper {
  213. height: 300rpx;
  214. }
  215. .swiper-box {
  216. height: 150px;
  217. }
  218. .swiper-item {
  219. /* #ifndef APP-NVUE */
  220. display: flex;
  221. /* #endif */
  222. flex-direction: column;
  223. justify-content: center;
  224. align-items: center;
  225. color: #fff;
  226. height: 300rpx;
  227. line-height: 300rpx;
  228. }
  229. @media screen and (min-width: 500px) {
  230. .uni-swiper-dot-box {
  231. width: 400px;
  232. /* #ifndef APP-NVUE */
  233. margin: 0 auto;
  234. /* #endif */
  235. margin-top: 8px;
  236. }
  237. .image {
  238. width: 100%;
  239. }
  240. }
  241. }
  242. </style>