From c1330a8d02be1e8f5d712a21c94e3281d503e546 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Mon, 21 Apr 2025 20:19:40 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/main.ts | 5 +- src/pages/Index/History.vue | 408 ++++++++++++------------------------------ src/services/Index/history.ts | 4 +- 4 files changed, 118 insertions(+), 300 deletions(-) diff --git a/package.json b/package.json index 8ff72ed..ae3f7ff 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "axios": "^1.7.7", "date-fns": "^4.1.0", "dayjs": "^1.11.13", + "el-table-infinite-scroll": "^3.0.6", "element-plus": "^2.8.5", "less": "^4.2.0", "mitt": "^3.0.1", diff --git a/src/main.ts b/src/main.ts index 0db684b..db735fb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,11 +3,13 @@ import './style.css' import App from './App.vue' import router from './router/router' import ElementPlus from 'element-plus' +import locale from 'element-plus/es/locale/lang/zh-cn' import 'element-plus/dist/index.css' import * as ElementPlusIconsVue from '@element-plus/icons-vue' // import './mock/index' import { createPinia } from 'pinia' import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' +import ElTableInfiniteScroll from "el-table-infinite-scroll"; import Confirm from './components/Confirm.vue' const pinia = createPinia() @@ -19,5 +21,6 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) { app.component('Confirm', Confirm) app.use(router) app.use(pinia) -app.use(ElementPlus) +app.use(ElementPlus, { locale, zIndex: 3000 }) +app.use(ElTableInfiniteScroll); app.mount('#app') diff --git a/src/pages/Index/History.vue b/src/pages/Index/History.vue index 62561e2..8b6ad88 100644 --- a/src/pages/Index/History.vue +++ b/src/pages/Index/History.vue @@ -1,51 +1,47 @@ diff --git a/src/services/Index/history.ts b/src/services/Index/history.ts index b8fd3f0..220484d 100644 --- a/src/services/Index/history.ts +++ b/src/services/Index/history.ts @@ -17,10 +17,10 @@ export const getHistoryInfo = async (params: paramsType) => { //删除历史记录 -export const deleteHistoryInfo = async (id: number) => { +export const deleteHistoryInfo = async (ids: string) => { try { const res = await apiClient.post( - `/api/v1/app/reactionResult/deleteRecord?id=${id}`, + `/api/v1/app/reactionResult/deleteRecordByIds?id=${ids}`, ) return res.data } catch (error) { From 8944a3270c2890f0548540df9b58e096969d4def Mon Sep 17 00:00:00 2001 From: guoapeng Date: Mon, 21 Apr 2025 20:26:49 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E9=87=8D=E6=9E=841?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Index/History.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/Index/History.vue b/src/pages/Index/History.vue index 8b6ad88..b67c0b8 100644 --- a/src/pages/Index/History.vue +++ b/src/pages/Index/History.vue @@ -14,8 +14,8 @@ header-cell-class-name="table-header" row-class-name="table-row"> - - + + @@ -469,6 +469,9 @@ const handleExport = async () => { box-sizing: border-box; .table-box { height: calc(100% - 80px); + .el-table { + font-size: 18px; + } } .history-table-footer { height: 80px; From 20746a4dc5f8abb11291b3c4a815cdd64eface4b Mon Sep 17 00:00:00 2001 From: guoapeng Date: Mon, 21 Apr 2025 21:16:07 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E9=87=8D=E6=9E=842?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Index/History.vue | 9 --------- src/services/Index/history.ts | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/pages/Index/History.vue b/src/pages/Index/History.vue index b67c0b8..b436646 100644 --- a/src/pages/Index/History.vue +++ b/src/pages/Index/History.vue @@ -364,7 +364,6 @@ const handleConfirm = async () => { } } const handleWarnClose = () => { - getTableData() showWarn.value = false } @@ -400,10 +399,6 @@ const handlePrint = async () => { warnIcon = new URL('@/assets/Index/History/success.svg', import.meta.url) .href showWarn.value = true - - // 清空选中状态 - selectedItems.value = [] - selectedIds.value = [] } else { eMessage.error(res.message || '打印失败') } @@ -424,10 +419,6 @@ const handleExport = async () => { warnIcon = new URL('@/assets/Index/History/success.svg', import.meta.url) .href showWarn.value = true - - // 清空选中状态 - selectedItems.value = [] - selectedIds.value = [] } else { eMessage.error(res.message || '导出失败') } diff --git a/src/services/Index/history.ts b/src/services/Index/history.ts index 220484d..bf67cf0 100644 --- a/src/services/Index/history.ts +++ b/src/services/Index/history.ts @@ -20,7 +20,7 @@ export const getHistoryInfo = async (params: paramsType) => { export const deleteHistoryInfo = async (ids: string) => { try { const res = await apiClient.post( - `/api/v1/app/reactionResult/deleteRecordByIds?id=${ids}`, + `/api/v1/app/reactionResult/deleteRecordByIds?ids=${ids}`, ) return res.data } catch (error) { From 74c6544f6b89706c82e4eddd3b9f4f94b1451491 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Mon, 21 Apr 2025 22:41:29 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E8=80=97=E6=9D=90=E6=BB=91=E5=8A=A8?= =?UTF-8?q?=E6=94=B9=E5=8F=98=E9=87=8D=E6=9E=84=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Index/Regular/Consumables.vue | 2 +- .../Index/components/Consumables/BallGrid2.vue | 12 +++++---- .../Index/components/Consumables/DragAreaEx.vue | 30 ++++++++++++++-------- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/pages/Index/Regular/Consumables.vue b/src/pages/Index/Regular/Consumables.vue index 5e3c167..5833915 100644 --- a/src/pages/Index/Regular/Consumables.vue +++ b/src/pages/Index/Regular/Consumables.vue @@ -342,7 +342,7 @@ const updateTipNum = async ({ sync: boolean }) => { if (tipNum < 0) { - return + tipNum = 0 } if (deviceStore.deviceState.workState !== 'WORKING') { consumableStore.setDisableUpdateConsumableData(true) diff --git a/src/pages/Index/components/Consumables/BallGrid2.vue b/src/pages/Index/components/Consumables/BallGrid2.vue index d07e333..2bd9b8f 100644 --- a/src/pages/Index/components/Consumables/BallGrid2.vue +++ b/src/pages/Index/components/Consumables/BallGrid2.vue @@ -86,17 +86,19 @@ const ballStates = ref(Array.from({ length: props.total }, () => false)) // 小 // 发出自定义事件通知父组件 const emit = defineEmits(['update:TipNum']) -const updateSliderVal = async (hVal, vVal) => { - const empty = parseInt(vVal) * columns + parseInt(hVal) +const updateSliderVal = async (empty) => { + if (empty< 0){ + empty = 0 + } const activated = total - empty emit('update:TipNum', activated, props.order, false) } const updateSliderEndVal = async (hVal, vVal) => { - const empty = parseInt(vVal) * columns + parseInt(hVal) - const activated = total - empty - emit('update:TipNum', activated, props.order, true) + // const empty = parseInt(vVal) * columns + parseInt(hVal) + // const activated = total - empty + // emit('update:TipNum', activated, props.order, true) } // 计算网格样式 const gridStyle = computed(() => ({ diff --git a/src/pages/Index/components/Consumables/DragAreaEx.vue b/src/pages/Index/components/Consumables/DragAreaEx.vue index 98c6e6f..f5588e8 100644 --- a/src/pages/Index/components/Consumables/DragAreaEx.vue +++ b/src/pages/Index/components/Consumables/DragAreaEx.vue @@ -84,20 +84,30 @@ function handleDrag(event) { if (!isDragging.value) return const touchEvent = event.touches ? event.touches[0] : event - const deltaX = touchEvent.clientX - startX.value - const deltaY = touchEvent.clientY - startY.value const rect = sliderTrack.value.getBoundingClientRect() - let percentX = (deltaX + startXValue.value) / rect.width - let percentY = (deltaY + startYValue.value) / rect.height - - hValue.value = Math.min(1, Math.max(0, percentX)) * hTotalVal.value - vValue.value = Math.min(1, Math.max(0, percentY)) * vTotalVal.value - - emit('update:sliderValue', +hValue.value.toFixed(), +vValue.value.toFixed()) + const clientX = touchEvent.clientX + const clientY = touchEvent.clientY + const relativeX = clientX - rect.left + const relativeY = clientY - rect.top + + const row = Math.ceil(relativeY / (rect.height / vTotalVal.value) ) + const col = Math.ceil(relativeX / (rect.width /hTotalVal.value) ) + + const empty = (row - 1)* hTotalVal.value + col + emit('update:sliderValue', empty) + + // + // let percentX = (deltaX + startXValue.value) / rect.width + // let percentY = (deltaY + startYValue.value) / rect.height + // + // hValue.value = Math.min(1, Math.max(0, percentX)) * hTotalVal.value + // vValue.value = Math.min(1, Math.max(0, percentY)) * vTotalVal.value + // + // emit('update:sliderValue', +hValue.value.toFixed(), +vValue.value.toFixed()) } function handleEnd() { - emit('update:sliderEndValue', +hValue.value.toFixed(), +vValue.value.toFixed()) + // emit('update:sliderEndValue', +hValue.value.toFixed(), +vValue.value.toFixed()) isDragging.value = false document.removeEventListener('mousemove', handleDrag) document.removeEventListener('touchmove', handleDrag)