DownloadList.uvue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <view class="info-row btn-panel">
  3. <button class="btn btn-first" @click="download">
  4. 下载数据
  5. </button>
  6. <button class="btn btn-second" @click="upload">
  7. 上传数据
  8. </button>
  9. </view>
  10. <!-- #ifdef APP -->
  11. <scroll-view style="flex:1">
  12. <!-- #endif -->
  13. <view class="download-card" v-for="(item, index) in downloads" :key="index" @click="enterItem(item.pdid)">
  14. <view class="info-row">
  15. <text class="label">工作令:</text>
  16. <text class="value">{{ item.workorder }}</text>
  17. </view>
  18. <view class="info-row">
  19. <text class="label">产品名称:</text>
  20. <text class="value">{{ item.invname }}</text>
  21. </view>
  22. <view class="info-row">
  23. <text class="label">图号:</text>
  24. <text class="value">{{ item.graphid }}</text>
  25. </view>
  26. <view class="info-row">
  27. <text class="label">产品编码:</text>
  28. <text class="value">{{ item.productno }}</text>
  29. </view>
  30. <view class="info-row">
  31. <text class="label">路卡号:</text>
  32. <text class="value">{{ item.cardno }}</text>
  33. </view>
  34. <view class="info-row">
  35. <text class="label">工艺编号:</text>
  36. <text class="value">{{ item.processno }}</text>
  37. </view>
  38. <view class="info-row">
  39. <text class="label">版本号:</text>
  40. <text class="value">{{ item.ver }}</text>
  41. </view>
  42. <view class="info-row">
  43. <text class="label">最近更新时间:</text>
  44. <text class="value">{{ item.updatetime }}</text>
  45. </view>
  46. <view class="info-row">
  47. <text class="label">进度:</text>
  48. <text class="process-value" :class="{
  49. 'bg-green': item.state === 'done',
  50. 'bg-yellow': item.state === 'doing',
  51. 'bg-black': item.state === 'waiting'
  52. }">{{ item.progress }}</text>
  53. </view>
  54. </view>
  55. <!-- #ifdef APP -->
  56. </scroll-view>
  57. <!-- #endif -->
  58. </template>
  59. <script setup>
  60. import {
  61. ref
  62. } from 'vue'
  63. type Download = {
  64. pdid : number,
  65. workorder : string,
  66. invname : string,
  67. productno : string,
  68. graphid : string,
  69. cardno : string,
  70. processno : string,
  71. ver : string,
  72. updatetime : string,
  73. progress : string,
  74. state : string
  75. }
  76. const downloads = [{
  77. pdid: 1,
  78. workorder: "632-P-01",
  79. invname: "箱间段",
  80. productno: "1CFA1040-00#S",
  81. graphid: "HBJ0100-00",
  82. cardno: "LK20230707070012",
  83. processno: "Pb/XXX-E11",
  84. ver: "A.1",
  85. updatetime: "2025-06-23",
  86. progress: "3/3",
  87. state: "done"
  88. }, {
  89. pdid: 2,
  90. workorder: "712-SY-10-6",
  91. invname: "级间架",
  92. productno: "1XA1020-00A",
  93. graphid: "1XC002-00",
  94. cardno: "LK20250215003",
  95. processno: "Pb/XXX-E11",
  96. ver: "B.1",
  97. updatetime: "2025-08-25",
  98. progress: "2/4",
  99. state: "doing"
  100. }, {
  101. pdid: 3,
  102. workorder: "712-SY-10-6",
  103. invname: "级间架",
  104. productno: "1XA1020-00A",
  105. graphid: "1XC002-00",
  106. cardno: "LK20250215003",
  107. processno: "Pb/XXX-E11",
  108. ver: "B.1",
  109. updatetime: "2025-08-25",
  110. progress: "0/4",
  111. state: "waiting"
  112. }] as Download[];
  113. const download = (e : any) => {
  114. console.log("开始下载...")
  115. }
  116. const upload = (e : any) => {
  117. console.log("开始上传...")
  118. }
  119. const enterItem = (id : number) => {
  120. uni.navigateTo({
  121. url: `/pages/work/download/DownloadDetail?id=${id}`
  122. });
  123. }
  124. </script>
  125. <style scope>
  126. .container {
  127. padding: 24rpx;
  128. background-color: #f0f4f8;
  129. flex: 1;
  130. display: flex;
  131. flex-direction: column;
  132. font-family: "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
  133. /* #ifndef APP-ANDROID */
  134. min-height: 100vh;
  135. /* #endif */
  136. height: 120rpx;
  137. }
  138. .download-card {
  139. background: #ffffff;
  140. border-radius: 20rpx;
  141. padding: 24rpx 32rpx;
  142. box-shadow: 0 8rpx 15rpx rgba(0, 43, 92, 0.1);
  143. display: flex;
  144. flex-direction: column;
  145. margin-bottom: 20rpx;
  146. margin-top: 40rpx;
  147. }
  148. .download-card .view {
  149. margin-bottom: 16rpx;
  150. }
  151. /* 信息行 */
  152. .info-row {
  153. display: flex;
  154. flex-direction: row;
  155. font-size: 28rpx;
  156. color: #33475b;
  157. align-items: center;
  158. }
  159. .info-row>.label {
  160. margin-left: 10rpx;
  161. }
  162. .info-row>.value {
  163. margin-left: 10rpx;
  164. }
  165. .btn-panel {
  166. display: flex;
  167. justify-content: space-between;
  168. align-items: center;
  169. margin-left: 5rpx;
  170. margin-right: 5rpx;
  171. }
  172. .label {
  173. font-weight: bold;
  174. color: #102a43;
  175. min-width: 100rpx;
  176. }
  177. .value {
  178. flex: 1;
  179. white-space: nowrap;
  180. overflow: hidden;
  181. text-overflow: ellipsis;
  182. }
  183. .btn {
  184. align-self: flex-end;
  185. background-color: #00aaff;
  186. color: #fff;
  187. border: none;
  188. border-radius: 32rpx;
  189. padding: 2rpx 30rpx;
  190. font-size: 24rpx;
  191. font-weight: bold;
  192. /* #ifndef APP-ANDROID */
  193. transition: background-color 0.3s ease;
  194. /* #endif */
  195. margin-top: 30rpx;
  196. }
  197. .process-value {
  198. width: 120rpx;
  199. min-width: 100rpx;
  200. text-align: center;
  201. border-radius: 10rpx;
  202. }
  203. .bg-green {
  204. background-color: seagreen;
  205. }
  206. .bg-yellow {
  207. background-color: yellow;
  208. }
  209. .bg-black {
  210. background-color: #102a43;
  211. }
  212. .btn-first {
  213. margin-left: 5rpx;
  214. }
  215. .btn-second {
  216. margin-right: 5rpx;
  217. }
  218. </style>