You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

251 lines
7.3 KiB

5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
  1. <script setup lang="ts">
  2. import type { logQuery } from 'apis/log'
  3. import { del, list } from 'apis/log'
  4. import { list as matrixList } from 'apis/matrix'
  5. import { list as matrixCraftList } from 'apis/matrixCraft'
  6. import route3 from 'assets/images/route.png'
  7. import route2 from 'assets/images/route_horizontal.png'
  8. import route1 from 'assets/images/route_vertical.png'
  9. import FtButton from 'components/common/FTButton/index.vue'
  10. import { ElMessageBox } from 'element-plus'
  11. import { FtMessage } from 'libs/message'
  12. import { onMounted, ref } from 'vue'
  13. onMounted(() => {
  14. getList()
  15. })
  16. const selectedData = ref<any[]>([])
  17. const handleSelectionChange = (val: any[]) => {
  18. console.log(val)
  19. selectedData.value = val
  20. }
  21. const tableData = ref([])
  22. const total = ref(0)
  23. const query = ref<logQuery>({
  24. pageNum: 1,
  25. pageSize: 10,
  26. })
  27. const loading = ref(false)
  28. const MatrixList = ref([])
  29. const MatrixCraftList = ref([])
  30. const getList = async () => {
  31. loading.value = true
  32. const res = await list(query.value)
  33. tableData.value = res.list
  34. tableData.value = tableData.value.map((item: any) => {
  35. return {
  36. ...item,
  37. ...JSON.parse(item.matrixInfo),
  38. }
  39. })
  40. const res1 = await matrixList({ pageNum: 1, pageSize: 1000 })
  41. MatrixList.value = res1.list
  42. const res2 = await matrixCraftList({ pageNum: 1, pageSize: 1000 })
  43. MatrixCraftList.value = res2.list
  44. console.log(tableData.value)
  45. total.value = res.total
  46. loading.value = false
  47. }
  48. const pageChange = (pageNum: number, pageSize: number) => {
  49. query.value.pageNum = pageNum
  50. query.value.pageSize = pageSize
  51. getList()
  52. }
  53. const delHandle = async () => {
  54. const ids = selectedData.value.map((item: any) => item.id)
  55. ElMessageBox.confirm('确认删除?', '提示', {
  56. type: 'warning',
  57. confirmButtonText: '确定',
  58. cancelButtonText: '取消',
  59. showCancelButton: true,
  60. showClose: false,
  61. closeOnClickModal: false,
  62. closeOnPressEscape: false,
  63. closeOnHashChange: false,
  64. }).then(async () => {
  65. await del(ids.join(','))
  66. FtMessage.success('删除成功')
  67. await getList()
  68. })
  69. }
  70. </script>
  71. <template>
  72. <div>
  73. <el-row class="search-box">
  74. <el-col :span="12">
  75. <!-- <el-input v-model="query.matrixName" class="my-input" placeholder="请输入基质名称" clearable @input="inputChange" /> -->
  76. </el-col>
  77. <el-col :span="12">
  78. <div style="float: right">
  79. <!-- <FtButton type="primary" @click="addHandle"> -->
  80. <!-- 新增 -->
  81. <!-- </FtButton> -->
  82. <!-- <FtButton :disabled="selectedData.length !== 1" @click="editHandle"> -->
  83. <!-- 编辑 -->
  84. <!-- </FtButton> -->
  85. <FtButton :disabled="selectedData.length === 0" @click="delHandle">
  86. 删除
  87. </FtButton>
  88. </div>
  89. </el-col>
  90. </el-row>
  91. <div class="table-box">
  92. <el-table v-loading="loading" :data="tableData" header-row-class-name="table-header" height="100%" @selection-change="handleSelectionChange">
  93. <el-table-column type="selection" width="55" />
  94. <el-table-column prop="matrixName" label="基质名称">
  95. <template #default="scope">
  96. <div class="scope-box">
  97. <div>
  98. {{ MatrixList.find(item => item.id === scope.row.matrixId)?.name }}
  99. </div>
  100. </div>
  101. </template>
  102. </el-table-column>
  103. <el-table-column prop="name" label="工艺名称">
  104. <template #default="scope">
  105. <div class="scope-box">
  106. <div>
  107. {{ MatrixCraftList.find(item => item.id === scope.row.matrixCraftId)?.name }}
  108. </div>
  109. </div>
  110. </template>
  111. </el-table-column>
  112. <el-table-column prop="matrixPathType" label="喷涂路线">
  113. <template #default="scope">
  114. <div class="scope-box">
  115. <img v-show="scope.row.matrixPathType === 'horizontal'" :src="route1" width="20px" height="20px" alt="icon">
  116. <img v-show="scope.row.matrixPathType === 'vertical'" :src="route2" width="20px" height="20px" alt="icon">
  117. <img v-show="scope.row.matrixPathType === 'grid'" :src="route3" width="20px" height="20px" alt="icon">
  118. </div>
  119. </template>
  120. </el-table-column>
  121. <el-table-column prop="motorZHeight" label="喷涂高度">
  122. <template #default="scope">
  123. <div class="scope-box">
  124. {{ scope.row.motorZHeight }}mm
  125. </div>
  126. </template>
  127. </el-table-column>
  128. <el-table-column prop="gasPressure" label="氮气气压">
  129. <template #default="scope">
  130. <div class="scope-box">
  131. {{ scope.row.gasPressure }}Mpa
  132. </div>
  133. </template>
  134. </el-table-column>
  135. <el-table-column prop="volume" label="基质流速">
  136. <template #default="scope">
  137. <div class="scope-box">
  138. {{ scope.row.volume }}uL/min
  139. </div>
  140. </template>
  141. </el-table-column>
  142. <el-table-column prop="highVoltageValue" label="电压">
  143. <template #default="scope">
  144. <div class="scope-box">
  145. {{ scope.row.highVoltageValue }}V
  146. </div>
  147. </template>
  148. </el-table-column>
  149. <el-table-column prop="movingSpeed" label="移速">
  150. <template #default="scope">
  151. <div class="scope-box">
  152. {{ scope.row.movingSpeed }}mm/s
  153. </div>
  154. </template>
  155. </el-table-column>
  156. <el-table-column prop="spacing" label="行间距">
  157. <template #default="scope">
  158. <div class="scope-box">
  159. {{ scope.row.spacing }}mm
  160. </div>
  161. </template>
  162. </el-table-column>
  163. <el-table-column prop="times" label="喷涂次数">
  164. <template #default="scope">
  165. <div class="scope-box">
  166. {{ scope.row.times }}
  167. </div>
  168. </template>
  169. </el-table-column>
  170. <el-table-column prop="createTime" label="创建时间" width="150" />
  171. </el-table>
  172. </div>
  173. <div class="table-footer">
  174. <el-pagination size="large" background layout="prev, pager, next, total" :total @change="pageChange" />
  175. </div>
  176. </div>
  177. </template>
  178. <style scoped lang="scss">
  179. .table-header {
  180. background: #E8ECF7;
  181. }
  182. .my-input {
  183. height: 100px;
  184. width: 400px;
  185. margin-right: 20px;
  186. background: #E8ECF7;
  187. border: 0;
  188. .el-input__wrapper {
  189. background: #E8ECF7;
  190. border: 0;
  191. .el-input__inner {
  192. height: calc(100% - 2px);
  193. }
  194. }
  195. }
  196. :deep(.el-input__inner)::placeholder {
  197. color: #a8abb2;
  198. font-size: 40px;
  199. }
  200. .my-select {
  201. width: 400px;
  202. .el-select__input {
  203. height: 80px !important;
  204. }
  205. .el-select__wrapper {
  206. min-height: 80px;
  207. background: #E8ECF7;
  208. border: 0;
  209. font-size: 40px;
  210. line-height:40px;
  211. }
  212. .el-select__placeholder {
  213. color: #0349A8;
  214. font-weight: 500;
  215. }
  216. .el-select-dropdown__item {
  217. height: 80px;
  218. line-height: 40px;
  219. padding: 20px;
  220. font-size: 40px;
  221. }
  222. .el-select-dropdown__empty {
  223. font-size: 40px;
  224. line-height: 40px;
  225. padding: 20px;
  226. }
  227. }
  228. .search-box {
  229. height: 120px;
  230. }
  231. .table-footer {
  232. height: 100px;
  233. display: flex;
  234. justify-content: flex-end;
  235. }
  236. .table-box {
  237. height: calc(100% - 100px - 120px);
  238. }
  239. </style>