workbench.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  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 class="app" :url="item.path" :key="index" v-if="item.path">
  20. <view class="bg" :style="item.color">
  21. <image class="image" :src="`/static/workbench/${item.label}.svg`" mode="widthFix"></image>
  22. </view>
  23. <text class="name">{{item.label}}</text>
  24. </navigator>
  25. </template>
  26. </view>
  27. <view class="work-panel_options">
  28. <template v-for="(item,index) in list2">
  29. <navigator class="option" :key="index" :url="item.path" hover-class="navigator-hover" open-type="navigate" v-if="item.path">
  30. <view class="box">
  31. <text class="left">{{ item.label }}</text>
  32. <view class="right">
  33. <!-- <view class="tag">10</view> -->
  34. <u-icon name="arrow-right" color="#999999"></u-icon>
  35. </view>
  36. </view>
  37. </navigator>
  38. </template>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import UserInfo from './userInfo.vue'
  44. export default {
  45. components: { UserInfo },
  46. data() {
  47. return {
  48. updatePage: true,
  49. list: [{
  50. label: "预约名单",
  51. itemId: "cloud",
  52. name:'orderList'
  53. }, {
  54. label: "企业公告",
  55. itemId: "index",
  56. page: "活动",
  57. name:'1'
  58. }, {
  59. label: "设计实景",
  60. itemId: "index",
  61. page: "案例",
  62. params: {
  63. active: '图库'
  64. },
  65. name:'1'
  66. }, {
  67. label: "商城订单",
  68. itemId: "index",
  69. page: "案例",
  70. params: {
  71. active: '实景案例'
  72. },
  73. name:'1'
  74. }, {
  75. label: "订单提报",
  76. itemId: "cloud",
  77. name:'1'
  78. }, {
  79. label: "团队管理",
  80. itemId: "cloud",
  81. }, {
  82. label: "商品调整",
  83. name:'1'
  84. }, {
  85. label: "直播管理",
  86. name:'1'
  87. }, {
  88. label: "品质服务管理",
  89. name:'1'
  90. }, {
  91. label: "装修预算改价",
  92. name:"budget",
  93. }],
  94. list2: [{
  95. label: "我的访问店铺",
  96. itemId: "cloud",
  97. name:'1'
  98. }, {
  99. label: "我的预约",
  100. itemId: "index",
  101. page: "活动",
  102. name:'selfOrder',
  103. }, {
  104. label: "收货地址",
  105. itemId: "index",
  106. page: "案例",
  107. name:'1',
  108. }, {
  109. label: "我的收藏",
  110. itemId: "index",
  111. page: "案例",
  112. name:'1',
  113. }, {
  114. label: "通讯录",
  115. itemId: "cloud",
  116. name:'1',
  117. }, {
  118. label: "考试成绩",
  119. itemId: "cloud",
  120. name:'1',
  121. }, {
  122. label: "问卷调查",
  123. name:'1',
  124. }, {
  125. label: "意见反馈",
  126. name:'1',
  127. }],
  128. colors: ['background: linear-gradient( 225deg, #81AEF3 0%, #6787E7 100%)',
  129. "background: linear-gradient( 225deg, #F1AA68 0%, #EA895B 100%)",
  130. "background: linear-gradient( 225deg, #EEA6A4 0%, #E0605A 100%)",
  131. "background: linear-gradient( 225deg, #80D3EF 0%, #5DAAE6 100%)",
  132. "background: linear-gradient( 225deg, #EEA6A4 0%, #E0605A 100%)",
  133. "background: linear-gradient( 225deg, #80D3EF 0%, #5DAAE6 100%)",
  134. "background: linear-gradient( 225deg, #81AEF3 0%, #6787E7 100%)",
  135. "background: linear-gradient( 225deg, #F1AA68 0%, #EA895B 100%)",
  136. "background: linear-gradient( 225deg, #81AEF3 0%, #6787E7 100%)",
  137. "background: linear-gradient( 225deg, #F1AA68 0%, #EA895B 100%)"
  138. ],
  139. content: {
  140. "pageNumber": 1,
  141. "pageSize": 20,
  142. "where": {
  143. "condition": "",
  144. "isnew": '',
  145. "class": ""
  146. }
  147. },
  148. userInfoValue:{},
  149. roles:[]
  150. }
  151. },
  152. methods: {
  153. init(callBack) {
  154. callBack()
  155. this.list = this.dye(this.list, this.colors, 1)
  156. this.getUserInfo()
  157. this.handleAppRole()
  158. console.log(this.list,'应用');
  159. this.updatePage = false;
  160. },
  161. async getUserInfo () {
  162. let res = await this.$Http.basic({
  163. "id": "20240510104102",
  164. "content": {}
  165. })
  166. this.userInfoValue = res.data
  167. console.log(this.userInfoValue,'用户信息')
  168. },
  169. //处理权限
  170. handleAppRole () {
  171. this.roles = uni.getStorageSync("authList")
  172. let keys = Object.keys(this.roles.工作台)
  173. for (let index = 0; index < this.list.length; index++) {
  174. for (let index2 = 0; index2 < keys.length; index2++) {
  175. if (this.roles.工作台[keys[index2]] && this.roles.工作台[keys[index2]].name == this.list[index].name) {
  176. this.list[index] = Object.assign({},this.list[index],this.roles.工作台[keys[index2]])
  177. break;
  178. }
  179. }
  180. }
  181. let keys2 = Object.keys(this.roles.工作台)
  182. for (let index = 0; index < this.list2.length; index++) {
  183. for (let index2 = 0; index2 < keys2.length; index2++) {
  184. if (this.roles.工作台[keys2[index2]] && this.roles.工作台[keys2[index2]].name == this.list2[index].name) {
  185. this.list2[index] = Object.assign({},this.list2[index],this.roles.工作台[keys2[index2]])
  186. break;
  187. }
  188. }
  189. }
  190. console.log(this.roles,this.list2,'权限');
  191. },
  192. onSearch () {
  193. uni.navigateTo({
  194. url: '/cloud/globalSearch/index',
  195. // fail: (fail) => {
  196. // viewImage(item.attinfos[0].url)
  197. // },
  198. })
  199. }
  200. },
  201. }
  202. </script>
  203. <style lang="scss">
  204. .work-panel {
  205. padding: 10px 10px 80px 10px;
  206. .work-panel_header {
  207. display: flex;
  208. align-items: center;
  209. .image{
  210. width: 40px;
  211. height: 20px;
  212. margin-right: 10px;
  213. }
  214. }
  215. .work-panel_signin {
  216. display: flex;
  217. align-items: center;
  218. justify-content: space-between;
  219. padding: 9px 15px;
  220. font-family: Source Han Sans SC, Source Han Sans SC;
  221. background: #FFFFFF;
  222. border-radius: 8px 8px 8px 8px;
  223. .title{
  224. font-weight: 400;
  225. font-size: 14px;
  226. color: #333333;
  227. }
  228. .but {
  229. font-weight: 500;
  230. font-size: 14px;
  231. color: #FFFFFF;
  232. background: linear-gradient( 90deg, #C30D23 0%, #E3041F 100%);
  233. border-radius: 50px 50px 50px 50px;
  234. padding: 6px 15px;
  235. }
  236. }
  237. .work-panel_applist {
  238. display: flex;
  239. flex-wrap: wrap;
  240. margin: 10px 0;
  241. background: #ffffff;
  242. border-radius: 8px 8px 8px 8px;
  243. padding: 16px 16px 0 16px;
  244. .app {
  245. margin-right: 33px;
  246. display: flex;
  247. flex-direction: column;
  248. align-items: center;
  249. margin-bottom: 30px;
  250. &:nth-child(4),&:nth-child(8) {
  251. margin-right: 0;
  252. }
  253. .bg {
  254. width: 44px;
  255. height: 44px;
  256. border-radius: 12px 12px 12px 12px;
  257. display: flex;
  258. align-items: center;
  259. justify-content: space-evenly;
  260. align-content: center;
  261. background: linear-gradient( 225deg, #81AEF3 0%, #6787E7 100%);
  262. .image{
  263. align-self: center;
  264. width: 24px;
  265. height: 24px;
  266. }
  267. }
  268. .name{
  269. font-family: Source Han Sans SC, Source Han Sans SC;
  270. font-weight: 400;
  271. font-size: 14px;
  272. color: #333333;
  273. margin-top: 10px;
  274. text-align: center;
  275. width: 56px;
  276. }
  277. }
  278. }
  279. .work-panel_options {
  280. background: #ffffff;
  281. border-radius: 8px;
  282. font-family: Source Han Sans SC, Source Han Sans SC;
  283. .option {
  284. padding: 15px 0 0 10px;
  285. &:last-child {
  286. .box {
  287. border: none;
  288. }
  289. }
  290. .box {
  291. padding-bottom:15px;
  292. padding-right:15px;
  293. border-bottom: 1px solid #DDDDDD;
  294. display: flex;
  295. justify-content: space-between;
  296. align-items: center;
  297. align-content: center;
  298. .left {
  299. font-weight: 400;
  300. font-size: 14px;
  301. color: #333333;
  302. }
  303. .right{
  304. display: flex;
  305. align-items: center;
  306. align-content: center;
  307. .tag {
  308. background: #BBBBBB;
  309. border-radius: 50px 50px 50px 50px;
  310. padding: 3px 12px;
  311. margin-right: 10px;
  312. font-family: PingFang SC, PingFang SC;
  313. font-weight: 400;
  314. font-size: 10px;
  315. color: #FFFFFF;
  316. }
  317. }
  318. }
  319. }
  320. }
  321. }
  322. </style>