index.uvue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. <template>
  2. <uni-navbar-lite :showLeft=false title="工作台"></uni-navbar-lite>
  3. <view class="page-container">
  4. <!-- 头部背景图 -->
  5. <image class="header-bg" src="/static/images/workbench/1.png" mode="widthFix"></image>
  6. <scroll-view class="page-content">
  7. <!-- 快捷功能卡片 -->
  8. <view class="quick-cards">
  9. <view v-for="(item, index) in quickFunctions" :key="index" class="quick-card" @click="handleQuickClick(item)">
  10. <image class="quick-card-bg" :src="item.bgImage" mode="aspectFill"></image>
  11. <view class="quick-card-content">
  12. <text class="quick-card-title">{{ item.title }}</text>
  13. </view>
  14. </view>
  15. </view>
  16. <!-- 库区管理 -->
  17. <view class="section">
  18. <view class="section-header">
  19. <view class="section-indicator"></view>
  20. <text class="section-title">库区管理</text>
  21. </view>
  22. <view class="management-grid">
  23. <view v-for="(item, index) in managementList" :key="index" class="management-item" @click="handleManagementClick(item)" :style="{ backgroundColor: item.bgColor }">
  24. <view class="management-icon-box">
  25. <image class="management-icon" :src="item.icon" mode="aspectFit"></image>
  26. </view>
  27. <text class="management-title">{{ item.title }}</text>
  28. <view v-if="item.badge" class="management-badge">
  29. <text class="badge-text">{{ item.badge }}</text>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </scroll-view>
  35. <!-- 底部 TabBar -->
  36. <custom-tabbar :current="1" />
  37. </view>
  38. </template>
  39. <script setup lang="uts">
  40. import { ref } from 'vue'
  41. // 快捷功能类型
  42. type QuickFunction = {
  43. id: number
  44. title: string
  45. bgImage: string
  46. icon: string
  47. path: string
  48. }
  49. // 库区管理功能类型
  50. type ManagementItem = {
  51. id: number
  52. title: string
  53. icon: string
  54. bgColor: string
  55. path: string
  56. badge: string
  57. }
  58. // 快捷功能列表
  59. const quickFunctions = ref<QuickFunction[]>([
  60. {
  61. id: 1,
  62. title: '在线会议',
  63. bgImage: '/static/images/workbench/2.png',
  64. icon: '',
  65. path: ''
  66. },
  67. {
  68. id: 2,
  69. title: '视频广场',
  70. bgImage: '/static/images/workbench/3.png',
  71. icon: '',
  72. path: ''
  73. },
  74. {
  75. id: 3,
  76. title: '四乱信息',
  77. bgImage: '/static/images/workbench/4.png',
  78. icon: '',
  79. path: ''
  80. },
  81. {
  82. id: 4,
  83. title: '六项机制',
  84. bgImage: '/static/images/workbench/5.png',
  85. icon: '',
  86. path: ''
  87. },
  88. {
  89. id: 5,
  90. title: '水库矩阵',
  91. bgImage: '/static/images/workbench/6.png',
  92. icon: '',
  93. path: ''
  94. },
  95. {
  96. id: 6,
  97. title: 'AI助手',
  98. bgImage: '/static/images/workbench/7.png',
  99. icon: '',
  100. path: ''
  101. }
  102. ])
  103. // 库区管理功能列表
  104. const managementList = ref<ManagementItem[]>([
  105. {
  106. id: 1,
  107. title: '列表',
  108. icon: '/static/images/workbench/8.png',
  109. bgColor: '#E3F2FD',
  110. path: '/pages/workbench/order/index',
  111. badge: '1'
  112. },
  113. {
  114. id: 2,
  115. title: '表单',
  116. icon: '/static/images/workbench/9.png',
  117. bgColor: '#FFF3E0',
  118. path: '/pages/workbench/form/index',
  119. badge: ''
  120. },
  121. {
  122. id: 3,
  123. title: '地图',
  124. icon: '/static/images/workbench/10.png',
  125. bgColor: '#FCE4EC',
  126. path: '/pages/workbench/map/index',
  127. badge: ''
  128. },
  129. ])
  130. // 快捷功能点击
  131. const handleQuickClick = (item: QuickFunction): void => {
  132. if (item.path.length > 0) {
  133. uni.navigateTo({
  134. url: item.path,
  135. fail: (err: any) => {
  136. console.log('导航失败', err)
  137. }
  138. })
  139. } else {
  140. uni.showToast({
  141. title: item.title,
  142. icon: 'none'
  143. })
  144. }
  145. }
  146. // 库区管理功能点击
  147. const handleManagementClick = (item: ManagementItem): void => {
  148. if (item.path.length > 0) {
  149. uni.navigateTo({
  150. url: item.path,
  151. fail: (err: any) => {
  152. console.log('导航失败', err)
  153. }
  154. })
  155. } else {
  156. uni.showToast({
  157. title: item.title,
  158. icon: 'none'
  159. })
  160. }
  161. }
  162. </script>
  163. <style lang="scss">
  164. .page-container {
  165. flex: 1;
  166. background-color: #f5f8fe;
  167. // padding-top: env(safe-area-inset-top);
  168. }
  169. .page-content {
  170. flex: 1;
  171. padding: 32rpx;
  172. padding-bottom: 150rpx;
  173. box-sizing: border-box;
  174. // border-radius: 24rpx;
  175. border: 1rpx solid rgba(255, 255, 255, 0.3);
  176. background: #f5f8fe;
  177. // background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, #f5f8fe 100%);
  178. // backdrop-filter: blur(20rpx);
  179. }
  180. .header-bg {
  181. position: absolute;
  182. top: 0;
  183. left: 0;
  184. width: 100%;
  185. height: auto;
  186. z-index: 0;
  187. }
  188. .header {
  189. position: relative;
  190. overflow: hidden;
  191. &-content {
  192. position: relative;
  193. z-index: 1;
  194. padding: 80rpx 30rpx 40rpx;
  195. display: flex;
  196. justify-content: center;
  197. align-items: center;
  198. }
  199. &-title {
  200. font-size: 48rpx;
  201. color: #ffffff;
  202. font-weight: bold;
  203. }
  204. }
  205. .quick-cards {
  206. flex-direction: row;
  207. flex-wrap: wrap;
  208. justify-content: space-between;
  209. .quick-card {
  210. position: relative;
  211. width: 212rpx;
  212. height: 120rpx;
  213. margin-bottom: 20rpx;
  214. overflow: hidden;
  215. border-radius: 16rpx;
  216. &-bg {
  217. position: absolute;
  218. top: 0;
  219. left: 0;
  220. width: 226rpx;
  221. height: 140rpx;
  222. z-index: 0;
  223. }
  224. &-content {
  225. position: relative;
  226. z-index: 1;
  227. padding: 20rpx;
  228. height: 140rpx;
  229. justify-content: flex-start;
  230. }
  231. &-title {
  232. font-size: 28rpx;
  233. color: #333333;
  234. font-weight: bold;
  235. }
  236. }
  237. }
  238. .section {
  239. padding: 0 20rpx 30rpx;
  240. background: #ffffff;
  241. border-radius: 16rpx;
  242. &-header {
  243. flex-direction: row;
  244. align-items: center;
  245. padding: 30rpx 10rpx 20rpx;
  246. }
  247. &-indicator {
  248. width: 6rpx;
  249. height: 32rpx;
  250. background-color: #007aff;
  251. border-radius: 3rpx;
  252. margin-right: 12rpx;
  253. }
  254. &-title {
  255. font-size: 36rpx;
  256. color: #333333;
  257. font-weight: bold;
  258. }
  259. }
  260. .management-grid {
  261. flex-direction: row;
  262. flex-wrap: wrap;
  263. justify-content: space-between;
  264. .management-item {
  265. position: relative;
  266. width: 192rpx;
  267. height: 156rpx;
  268. margin-bottom: 24rpx;
  269. background-color: #edf5ff;
  270. border-radius: 8rpx;
  271. align-items: flex-start;
  272. justify-content: center;
  273. padding: 24rpx;
  274. box-sizing: border-box;
  275. .management-icon-box {
  276. width: 64rpx;
  277. height: 64rpx;
  278. justify-content: center;
  279. align-items: center;
  280. margin-bottom: 16rpx;
  281. }
  282. .management-icon {
  283. width: 100%;
  284. height: 100%;
  285. }
  286. .management-title {
  287. font-weight: bold;
  288. font-size: 24rpx;
  289. color: #333333;
  290. text-align: center;
  291. }
  292. .management-badge {
  293. position: absolute;
  294. top: 20rpx;
  295. right: 20rpx;
  296. width: 32rpx;
  297. height: 32rpx;
  298. background-color: #ff3b30;
  299. border-radius: 16rpx;
  300. justify-content: center;
  301. align-items: center;
  302. .badge-text {
  303. font-size: 20rpx;
  304. color: #ffffff;
  305. line-height: 20rpx;
  306. }
  307. }
  308. }
  309. }
  310. </style>