From 2eba9cad138f4bdd024eed5d1593a286e4916148 Mon Sep 17 00:00:00 2001
From: betaqi <3188864257@qq.com>
Date: Wed, 10 Dec 2025 14:53:31 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=20=E8=AE=BE=E5=A4=87=E5=87=BA=E5=BA=93?=
=?UTF-8?q?=E5=8F=AF=E7=BC=96=E8=BE=91=20&=20=E5=A2=9E=E5=8A=A0=E6=97=B6?=
=?UTF-8?q?=E9=97=B4=E6=8E=92=E5=BA=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/dashboard/Edfs-table/index.vue | 6 ++++++
.../deviceInfo/components/DeliveryInfo.vue | 9 ++++----
src/pages/deviceInfo/index.vue | 21 ++++++++++++++++---
src/pages/deviceStorage/index.vue | 21 +++++++++++++++++--
4 files changed, 48 insertions(+), 9 deletions(-)
diff --git a/src/components/dashboard/Edfs-table/index.vue b/src/components/dashboard/Edfs-table/index.vue
index 80a8aff..345f230 100644
--- a/src/components/dashboard/Edfs-table/index.vue
+++ b/src/components/dashboard/Edfs-table/index.vue
@@ -17,6 +17,7 @@
@selection-change="handleSelectionChange"
class="edfs-table"
:span-method="spanMethod"
+ @sort-change="handleScrollChange"
>
@@ -59,6 +60,7 @@ const emit = defineEmits<{
// 'page-size-change': [pageSize: number]
'page-current-change': [currentPage: number]
'selection-change': [selection: any[]]
+ 'on-scroll-change':[data:any[]]
}>()
function onCurrentChange(currentRow: any, oldCurrentRow: any) {
@@ -75,6 +77,10 @@ function handleSelectionChange(selection: any[]) {
emit('selection-change', selection)
}
+function handleScrollChange(data:any[]) {
+ emit('on-scroll-change',data)
+}
+
// 分页
const pageSize = ref()
diff --git a/src/pages/deviceInfo/components/DeliveryInfo.vue b/src/pages/deviceInfo/components/DeliveryInfo.vue
index dd09b63..39c4eec 100644
--- a/src/pages/deviceInfo/components/DeliveryInfo.vue
+++ b/src/pages/deviceInfo/components/DeliveryInfo.vue
@@ -9,7 +9,7 @@
:options="customerList"
placeholder="请选择出库流向"
keyTag="id"
- :disabled="action === 'view' || !isShowSaveButton"
+ :disabled="action === 'view' "
labelTag="name"
valueTag="id"
:isShowLabel="false"
@@ -19,7 +19,7 @@
设备价格:
@@ -31,7 +31,7 @@
type="textarea"
v-model="params.description"
placeholder="请输入备注"
- :disabled="action === 'view' || !isShowSaveButton"
+ :disabled="action === 'view' "
:autosize="{ minRows: 3, maxRows: 4 }"
/>
@@ -41,7 +41,7 @@
type="primary"
class="save-button"
@click="onSave"
- v-if="isShowSaveButton"
+ v-if="action != 'view'"
/>
@@ -105,6 +105,7 @@ async function onSave() {
const res = await storageOutDevice(options)
if (isResError(res)) return
+ message.success('出口成功')
emit('onSave')
}
diff --git a/src/pages/deviceInfo/index.vue b/src/pages/deviceInfo/index.vue
index 428f3d9..fec95f1 100644
--- a/src/pages/deviceInfo/index.vue
+++ b/src/pages/deviceInfo/index.vue
@@ -23,6 +23,7 @@
:page-size="queryParams.pageSize"
row-class-name="row"
@pageCurrentChange="handleJump"
+ @onScrollChange="onScrollChange"
>
@@ -34,6 +35,7 @@
v-if="col.prop.endsWith('Time')"
:label="col.label"
:min-width="col.minWidth"
+ sortable="custom"
>
{{ dayjs(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
@@ -72,7 +74,7 @@
- 编辑基础信息
+ 编辑信息
测试结果录入
@@ -133,7 +135,7 @@ const route = useRoute()
const updateId = ref(
route.query.updateId !== undefined && route.query.updateId !== null
? Number(route.query.updateId)
- : undefined
+ : undefined,
)
onActivated(async () => {
@@ -166,7 +168,10 @@ const getList = async () => {
}
loading.value = true
- const options = Object.assign({}, queryParams, filter.value)
+ const options = Object.assign({}, queryParams, filter.value, {
+ sortName: 'create_time',
+ sortAsc: isAscending.value,
+ })
const res = await getDevicePage(options)
@@ -183,6 +188,16 @@ function handleJump(page: number) {
getList()
}
+const isAscending = ref(false)
+
+watch(isAscending, () => {
+ getList()
+})
+
+function onScrollChange(data: any) {
+ isAscending.value = data.order === 'ascending'
+}
+
const filter = ref({})
function onSearch(search: any) {
queryParams.pageNo = 1
diff --git a/src/pages/deviceStorage/index.vue b/src/pages/deviceStorage/index.vue
index e9f220c..f5e8cf6 100644
--- a/src/pages/deviceStorage/index.vue
+++ b/src/pages/deviceStorage/index.vue
@@ -20,6 +20,7 @@
:page-size="queryParams.pageSize"
row-class-name="row"
@pageCurrentChange="handleJump"
+ @onScrollChange="onScrollChange"
>
@@ -31,6 +32,7 @@
v-if="col.prop.endsWith('Time')"
:label="storageStatus + col.label"
:min-width="col.minWidth"
+ sortable="custom"
>
{{ dayjs(scope.row[col.prop]).format('YYYY-MM-DD HH:mm:ss') }}
@@ -107,7 +109,12 @@ const getList = async () => {
}
loading.value = true
- const res = await getStoragePage(Object.assign({}, queryParams, filter.value))
+ const res = await getStoragePage(
+ Object.assign({}, queryParams, filter.value, {
+ sortName: 'update_time',
+ sortAsc: isAscending.value,
+ }),
+ )
if (!isResError(res)) {
list.value = res.data.list
@@ -118,7 +125,7 @@ const getList = async () => {
}
const storageStatus = computed(
- () => statusList.find(item => item.value === filter.value.status)?.colName ?? ''
+ () => statusList.find(item => item.value === filter.value.status)?.colName ?? '',
)
const filter = ref({})
@@ -133,6 +140,16 @@ function handleJump(page: number) {
getList()
}
+const isAscending = ref(false)
+
+watch(isAscending, () => {
+ getList()
+})
+
+function onScrollChange(data: any) {
+ isAscending.value = data.order === 'ascending'
+}
+
function addMaintain(row: any) {
router.push({
path: '/device/deviceOperation',