5 changed files with 169 additions and 10 deletions
-
22src/services/matrix/craft.ts
-
27src/utils/index.ts
-
117src/views/History.vue
-
8src/views/debug/index.vue
-
5src/views/matrixCraft/index.vue
@ -1,5 +1,116 @@ |
|||||
<template> |
<template> |
||||
<div class="p-6 text-primary text-lg">历史喷涂</div> |
|
||||
|
<main class="spurt_print"> |
||||
|
<div class="spurt_print_btn ml-[3rem]"> |
||||
|
<el-button @click="onDel">删除</el-button> |
||||
|
</div> |
||||
|
<div class="w-[90vw] ml-[3rem] mt-[2rem] h-[70vh]"> |
||||
|
<el-table :data="tableData" stripe style="width: 100%" ref="historyTableRef"> |
||||
|
<el-table-column type="selection" width="55" /> |
||||
|
<el-table-column prop="createTime" label="时间" width="100" /> |
||||
|
<el-table-column prop="matrixName" label="基质名称" width="100" /> |
||||
|
<el-table-column prop="name" label="工艺名称"/> |
||||
|
<el-table-column prop="routeType" label="喷涂路线" width="100"> |
||||
|
<template v-slot="scope"> |
||||
|
{{scope.row.routeType == 1 ? '横向' : '竖向'}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="height" label="喷涂高度" width="100" /> |
||||
|
<el-table-column prop="nitrogenFlowVelocity" label="氮气流速" width="100" /> |
||||
|
<el-table-column prop="nitrogenAirPressure" label="氮气气压" width="100" /> |
||||
|
<el-table-column prop="matrixFlowVelocity" label="基质流速" width="100" /> |
||||
|
<el-table-column prop="voltage" label="电压" width="100" /> |
||||
|
<el-table-column prop="movementSpeed" label="移速" width="100" /> |
||||
|
<el-table-column prop="space" label="行间距" width="100" /> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
|
||||
|
</main> |
||||
|
<footer class="footer" v-if="total"> |
||||
|
<el-pagination class="pagination" layout="prev, pager, next" :total="total" /> |
||||
|
</footer> |
||||
</template> |
</template> |
||||
<script setup lang="ts"></script> |
|
||||
<style lang="scss" scoped></style> |
|
||||
|
<script lang="ts" setup> |
||||
|
import { ref, onMounted } from 'vue' |
||||
|
import { getHistoryList, delHistoryLog} from '@/services/matrix/craft' |
||||
|
import { useSettingStore } from '@/stores/setting' |
||||
|
import type { CraftItem } from "@/services/matrix/type"; |
||||
|
import { ElMessage, ElMessageBox } from "element-plus"; |
||||
|
let total = ref() |
||||
|
const settingStore = useSettingStore() |
||||
|
let tableData = ref<any>([]) |
||||
|
const defaultCraft: CraftItem = { |
||||
|
id: 1, |
||||
|
name: '', |
||||
|
matrixId: 0, |
||||
|
routeType: 1, |
||||
|
space: 0, |
||||
|
nitrogenFlowVelocity: 0, |
||||
|
nitrogenAirPressure: 0, |
||||
|
matrixFlowVelocity: 0, |
||||
|
voltage: 0, |
||||
|
needPower: false, |
||||
|
height: 0, |
||||
|
movementSpeed: 0, |
||||
|
position: [], |
||||
|
}; |
||||
|
|
||||
|
onMounted(()=>{ |
||||
|
tableData.value = settingStore.matrixList |
||||
|
getLogList() |
||||
|
}) |
||||
|
|
||||
|
//历史列表 |
||||
|
const getLogList = () => { |
||||
|
const params = { |
||||
|
pageNum:1, |
||||
|
pageSize:10, |
||||
|
} |
||||
|
getHistoryList(params).then((res:any)=>{ |
||||
|
tableData.value = res.data.list |
||||
|
total.value = res.data.total |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
const historyTableRef = ref() |
||||
|
const onDel = () => { |
||||
|
const selectRows = historyTableRef.value.getSelectionRows() |
||||
|
if(selectRows.length !== 1){ |
||||
|
ElMessage.error('请选择一条数据进行编辑') |
||||
|
return; |
||||
|
} |
||||
|
const sel = selectRows[0] |
||||
|
ElMessageBox.confirm('确认删除此条数据吗?','提示',{ |
||||
|
confirmButtonText: '确认', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning', |
||||
|
}).then(()=>{ |
||||
|
delHistoryLog(sel).then(res => { |
||||
|
ElMessage.success("删除成功") |
||||
|
getLogList() |
||||
|
}) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
<style lang="scss" scoped> |
||||
|
.el-button--primary{ |
||||
|
background: linear-gradient(90deg, #0657c0 24%, #096ae0 101%);; |
||||
|
} |
||||
|
.spurt_print{ |
||||
|
.spurt_print_btn{ |
||||
|
margin-top: 2rem; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.footer{ |
||||
|
display: flex; |
||||
|
justify-content: end; |
||||
|
position: relative; |
||||
|
|
||||
|
.pagination{ |
||||
|
position: absolute; |
||||
|
bottom: 0; |
||||
|
right: 3rem; |
||||
|
} |
||||
|
} |
||||
|
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue