workbench.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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" @selfCardClick="selfCardClick"></UserInfo>
  11. <view class="work-panel_signin" v-if="isSign">
  12. <text class="title">你已累计打卡{{ userInfoValue.signdays }}天</text>
  13. <navigator class="but" @click="toDailyYttendance" url="/packageA/dailyYttendance/index"
  14. hover-class="navigator-hover">
  15. 每日一签
  16. </navigator>
  17. </view>
  18. <view class="work-panel_applist">
  19. <template v-for="(item, index) in list">
  20. <navigator @click="switchPage(item)" class="app" url="#" :key="item.name">
  21. <view class="bg" :style="item.color">
  22. <image class="image" :src="`/static/workbench/${item.name}.svg`" mode="widthFix"></image>
  23. </view>
  24. <text class="name">{{ item.remark }}</text>
  25. </navigator>
  26. </template>
  27. </view>
  28. <view class="work-panel_options">
  29. <template v-for="(item, index) in list2">
  30. <navigator @click="switchPage(item)" class="option" :key="index" url="#" hover-class="navigator-hover"
  31. open-type="navigate">
  32. <view class="box">
  33. <text class="left">{{ item.remark }}</text>
  34. <view class="right">
  35. <u-icon name="arrow-right" color="#999999"></u-icon>
  36. </view>
  37. </view>
  38. </navigator>
  39. </template>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import UserInfo from './userInfo.vue'
  45. export default {
  46. components: { UserInfo },
  47. data() {
  48. return {
  49. updatePage: true,
  50. list: [],
  51. list2: [],
  52. colors: ['background: linear-gradient( 225deg, #81AEF3 0%, #6787E7 100%)',
  53. "background: linear-gradient( 225deg, #F1AA68 0%, #EA895B 100%)",
  54. "background: linear-gradient( 225deg, #EEA6A4 0%, #E0605A 100%)",
  55. "background: linear-gradient( 225deg, #80D3EF 0%, #5DAAE6 100%)",
  56. "background: linear-gradient( 225deg, #EEA6A4 0%, #E0605A 100%)",
  57. "background: linear-gradient( 225deg, #80D3EF 0%, #5DAAE6 100%)",
  58. "background: linear-gradient( 225deg, #81AEF3 0%, #6787E7 100%)",
  59. "background: linear-gradient( 225deg, #F1AA68 0%, #EA895B 100%)",
  60. "background: linear-gradient( 225deg, #81AEF3 0%, #6787E7 100%)",
  61. "background: linear-gradient( 225deg, #F1AA68 0%, #EA895B 100%)"
  62. ],
  63. content: {
  64. "pageNumber": 1,
  65. "pageSize": 20,
  66. "where": {
  67. "condition": "",
  68. "isnew": '',
  69. "class": ""
  70. }
  71. },
  72. userInfoValue: {rolenames:'',name:'',remarks:'',joindays:0,signdays:''},
  73. roles: [],
  74. auth:uni.getStorageSync('authList').资料库
  75. }
  76. },
  77. computed: {
  78. isSign () {
  79. console.log(!uni.getStorageSync('authList').资料库,!uni.getStorageSync('authList').资料库.每日一签,11111)
  80. if (!uni.getStorageSync('authList').资料库) return false
  81. if (!uni.getStorageSync('authList').资料库.每日一签) return false
  82. return true
  83. }
  84. },
  85. methods: {
  86. selfCardClick () {
  87. this.$Http.refreshUserInfoData = function () {
  88. this.getUserInfo()
  89. delete this.$Http.refreshUserInfoData
  90. }.bind(this)
  91. },
  92. init(callBack) {
  93. callBack()
  94. this.list = Object.values(uni.getStorageSync('authList').工作台)
  95. this.list2 = Object.values(uni.getStorageSync('authList').工作台导航)
  96. this.list = this.dye(this.list, this.colors, 1)
  97. this.getUserInfo()
  98. this.updatePage = false;
  99. },
  100. async getUserInfo() {
  101. let res = await this.$Http.basic({
  102. "id": "20240510104102",
  103. "content": {}
  104. })
  105. if (this.cutoff(res.msg)) return;
  106. this.userInfoValue = res.data
  107. this.userInfoValue.headpic = this.userInfoValue.attinfos.find(v => v.usetype == "headportrait") && this.userInfoValue.attinfos.find(v => v.usetype == "headportrait").url || '';
  108. console.log(this.userInfoValue, '用户信息')
  109. },
  110. toDailyYttendance() {
  111. this.$Http.updateUserInfo = this.getUserInfo.bind(this)
  112. },
  113. onSearch() {
  114. uni.navigateTo({
  115. url: '/cloud/globalSearch/index',
  116. })
  117. }
  118. },
  119. }
  120. </script>
  121. <style lang="scss">
  122. .work-panel {
  123. padding: 10px 10px 80px 10px;
  124. .work-panel_header {
  125. display: flex;
  126. align-items: center;
  127. .image {
  128. width: 40px;
  129. height: 20px;
  130. margin-right: 10px;
  131. }
  132. }
  133. .work-panel_signin {
  134. display: flex;
  135. align-items: center;
  136. justify-content: space-between;
  137. padding: 9px 15px;
  138. font-family: Source Han Sans SC, Source Han Sans SC;
  139. background: #FFFFFF;
  140. border-radius: 8px 8px 8px 8px;
  141. .title {
  142. font-weight: 400;
  143. font-size: 14px;
  144. color: #333333;
  145. }
  146. .but {
  147. font-weight: 500;
  148. font-size: 14px;
  149. color: #FFFFFF;
  150. background: linear-gradient(90deg, #C30D23 0%, #E3041F 100%);
  151. border-radius: 50px 50px 50px 50px;
  152. padding: 6px 15px;
  153. }
  154. }
  155. .work-panel_applist {
  156. display: flex;
  157. flex-wrap: wrap;
  158. margin: 10px 0;
  159. background: #ffffff;
  160. border-radius: 8px 8px 8px 8px;
  161. box-sizing: border-box;
  162. .app {
  163. display: flex;
  164. flex-direction: column;
  165. align-items: center;
  166. border-radius: 8px;
  167. padding: 15px;
  168. width: 25%;
  169. box-sizing: border-box;
  170. .bg {
  171. width: 44px;
  172. height: 44px;
  173. border-radius: 12px 12px 12px 12px;
  174. display: flex;
  175. align-items: center;
  176. justify-content: space-evenly;
  177. align-content: center;
  178. background: linear-gradient(225deg, #81AEF3 0%, #6787E7 100%);
  179. .image {
  180. align-self: center;
  181. width: 24px;
  182. height: 24px;
  183. }
  184. }
  185. .name {
  186. font-family: Source Han Sans SC, Source Han Sans SC;
  187. font-weight: 400;
  188. font-size: 14px;
  189. color: #333333;
  190. margin-top: 10px;
  191. text-align: center;
  192. }
  193. }
  194. }
  195. .work-panel_options {
  196. background: #ffffff;
  197. border-radius: 8px;
  198. font-family: Source Han Sans SC, Source Han Sans SC;
  199. .option {
  200. padding: 15px 0 0 10px;
  201. &:first-child {
  202. border-top-left-radius: 8px;
  203. border-top-right-radius: 8px;
  204. }
  205. &:last-child {
  206. border-bottom-left-radius: 8px;
  207. border-bottom-right-radius: 8px;
  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>