workbench.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <template>
  2. <view class="work-panel">
  3. <view class="work-panel_header">
  4. <image class="image" src="/static/c+unselected.svg" mode="widthFix" />
  5. <view @click="onSearch" style="flex:1">
  6. <My_search placeholder="搜索全站关键字" disabled></My_search>
  7. </view>
  8. </view>
  9. <!-- 用户信息 -->
  10. <UserInfo :userInfoValue="userInfoValue"></UserInfo>
  11. <view class="work-panel_signin">
  12. <text class="title">你已累计打卡{{userInfoValue.signdays}}天</text>
  13. <navigator class="but" url="/packageA/dailyYttendance/index" hover-class="navigator-hover">
  14. 每日一签
  15. </navigator>
  16. </view>
  17. <view class="work-panel_applist">
  18. <template v-for="(item,index) in list">
  19. <navigator @click="switchPage(item)" class="app" url="#" :key="item.name">
  20. <view class="bg" :style="item.color">
  21. <image class="image" :src="`/static/workbench/${item.name}.svg`" mode="widthFix"></image>
  22. </view>
  23. <text class="name">{{item.remark}}</text>
  24. </navigator>
  25. </template>
  26. </view>
  27. <view class="work-panel_options">
  28. <template v-for="(item,index) in list2">
  29. <navigator @click="switchPage(item)" class="option" :key="index" url="#" hover-class="navigator-hover" open-type="navigate">
  30. <view class="box">
  31. <text class="left">{{ item.remark }}</text>
  32. <view class="right">
  33. <u-icon name="arrow-right" color="#999999"></u-icon>
  34. </view>
  35. </view>
  36. </navigator>
  37. </template>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import UserInfo from './userInfo.vue'
  43. export default {
  44. components: { UserInfo },
  45. data() {
  46. return {
  47. updatePage: true,
  48. list: [],
  49. list2: [],
  50. colors: ['background: linear-gradient( 225deg, #81AEF3 0%, #6787E7 100%)',
  51. "background: linear-gradient( 225deg, #F1AA68 0%, #EA895B 100%)",
  52. "background: linear-gradient( 225deg, #EEA6A4 0%, #E0605A 100%)",
  53. "background: linear-gradient( 225deg, #80D3EF 0%, #5DAAE6 100%)",
  54. "background: linear-gradient( 225deg, #EEA6A4 0%, #E0605A 100%)",
  55. "background: linear-gradient( 225deg, #80D3EF 0%, #5DAAE6 100%)",
  56. "background: linear-gradient( 225deg, #81AEF3 0%, #6787E7 100%)",
  57. "background: linear-gradient( 225deg, #F1AA68 0%, #EA895B 100%)",
  58. "background: linear-gradient( 225deg, #81AEF3 0%, #6787E7 100%)",
  59. "background: linear-gradient( 225deg, #F1AA68 0%, #EA895B 100%)"
  60. ],
  61. content: {
  62. "pageNumber": 1,
  63. "pageSize": 20,
  64. "where": {
  65. "condition": "",
  66. "isnew": '',
  67. "class": ""
  68. }
  69. },
  70. userInfoValue:{},
  71. roles:[]
  72. }
  73. },
  74. methods: {
  75. init(callBack) {
  76. callBack()
  77. this.list = Object.values(uni.getStorageSync('authList').工作台)
  78. this.list2 = Object.values(uni.getStorageSync('authList').工作台导航)
  79. this.list = this.dye(this.list, this.colors, 1)
  80. this.getUserInfo()
  81. this.updatePage = false;
  82. },
  83. async getUserInfo () {
  84. let res = await this.$Http.basic({
  85. "id": "20240510104102",
  86. "content": {}
  87. })
  88. this.userInfoValue = res.data
  89. console.log(this.userInfoValue,'用户信息')
  90. },
  91. // //处理权限
  92. // handleAppRole () {
  93. // this.roles = uni.getStorageSync("authList")
  94. // let keys = Object.keys(this.roles.工作台)
  95. // for (let index = 0; index < this.list.length; index++) {
  96. // for (let index2 = 0; index2 < keys.length; index2++) {
  97. // if (this.roles.工作台[keys[index2]] && this.roles.工作台[keys[index2]].name == this.list[index].name) {
  98. // this.list[index] = Object.assign({},this.list[index],this.roles.工作台[keys[index2]])
  99. // break;
  100. // }
  101. // }
  102. // }
  103. // let keys2 = Object.keys(this.roles.工作台导航)
  104. // for (let index = 0; index < this.list2.length; index++) {
  105. // for (let index2 = 0; index2 < keys2.length; index2++) {
  106. // if (this.roles.工作台导航[keys2[index2]] && this.roles.工作台导航[keys2[index2]].name == this.list2[index].name) {
  107. // this.list2[index] = Object.assign({},this.list2[index],this.roles.工作台导航[keys2[index2]])
  108. // break;
  109. // }
  110. // }
  111. // }
  112. // console.log(this.roles,this.list2,'权限');
  113. // },
  114. onSearch () {
  115. uni.navigateTo({
  116. url: '/cloud/globalSearch/index',
  117. // fail: (fail) => {
  118. // viewImage(item.attinfos[0].url)
  119. // },
  120. })
  121. }
  122. },
  123. }
  124. </script>
  125. <style lang="scss">
  126. .work-panel {
  127. padding: 10px 10px 80px 10px;
  128. .work-panel_header {
  129. display: flex;
  130. align-items: center;
  131. .image{
  132. width: 40px;
  133. height: 20px;
  134. margin-right: 10px;
  135. }
  136. }
  137. .work-panel_signin {
  138. display: flex;
  139. align-items: center;
  140. justify-content: space-between;
  141. padding: 9px 15px;
  142. font-family: Source Han Sans SC, Source Han Sans SC;
  143. background: #FFFFFF;
  144. border-radius: 8px 8px 8px 8px;
  145. .title{
  146. font-weight: 400;
  147. font-size: 14px;
  148. color: #333333;
  149. }
  150. .but {
  151. font-weight: 500;
  152. font-size: 14px;
  153. color: #FFFFFF;
  154. background: linear-gradient( 90deg, #C30D23 0%, #E3041F 100%);
  155. border-radius: 50px 50px 50px 50px;
  156. padding: 6px 15px;
  157. }
  158. }
  159. .work-panel_applist {
  160. display: flex;
  161. flex-wrap: wrap;
  162. margin: 10px 0;
  163. background: #ffffff;
  164. border-radius: 8px 8px 8px 8px;
  165. padding: 16px 16px 0 16px;
  166. .app {
  167. margin-right: 33px;
  168. display: flex;
  169. flex-direction: column;
  170. align-items: center;
  171. margin-bottom: 30px;
  172. &:nth-child(4),&:nth-child(8) {
  173. margin-right: 0;
  174. }
  175. .bg {
  176. width: 44px;
  177. height: 44px;
  178. border-radius: 12px 12px 12px 12px;
  179. display: flex;
  180. align-items: center;
  181. justify-content: space-evenly;
  182. align-content: center;
  183. background: linear-gradient( 225deg, #81AEF3 0%, #6787E7 100%);
  184. .image{
  185. align-self: center;
  186. width: 24px;
  187. height: 24px;
  188. }
  189. }
  190. .name{
  191. font-family: Source Han Sans SC, Source Han Sans SC;
  192. font-weight: 400;
  193. font-size: 14px;
  194. color: #333333;
  195. margin-top: 10px;
  196. text-align: center;
  197. width: 56px;
  198. }
  199. }
  200. }
  201. .work-panel_options {
  202. background: #ffffff;
  203. border-radius: 8px;
  204. font-family: Source Han Sans SC, Source Han Sans SC;
  205. .option {
  206. padding: 15px 0 0 10px;
  207. &:last-child {
  208. .box {
  209. border: none;
  210. }
  211. }
  212. .box {
  213. padding-bottom:15px;
  214. padding-right:15px;
  215. border-bottom: 1px solid #DDDDDD;
  216. display: flex;
  217. justify-content: space-between;
  218. align-items: center;
  219. align-content: center;
  220. .left {
  221. font-weight: 400;
  222. font-size: 14px;
  223. color: #333333;
  224. }
  225. .right{
  226. display: flex;
  227. align-items: center;
  228. align-content: center;
  229. .tag {
  230. background: #BBBBBB;
  231. border-radius: 50px 50px 50px 50px;
  232. padding: 3px 12px;
  233. margin-right: 10px;
  234. font-family: PingFang SC, PingFang SC;
  235. font-weight: 400;
  236. font-size: 10px;
  237. color: #FFFFFF;
  238. }
  239. }
  240. }
  241. }
  242. }
  243. }
  244. </style>