parent
cf1d79c51e
commit
103d3f6026
@ -0,0 +1,13 @@ |
|||||||
|
import { AxiosPromise } from "axios"; |
||||||
|
import { HistoryQueryResult } from "@/api/history-query/types"; |
||||||
|
import request from "@/utils/request"; |
||||||
|
|
||||||
|
export function historyQueryApi( |
||||||
|
data: SelectForm |
||||||
|
): AxiosPromise<HistoryQueryResult> { |
||||||
|
return request({ |
||||||
|
url: "/api/history-query/v1/page", |
||||||
|
method: "POST", |
||||||
|
data, |
||||||
|
}); |
||||||
|
} |
@ -0,0 +1,14 @@ |
|||||||
|
export interface HistoryQueryTableVO { |
||||||
|
devSno?: string; |
||||||
|
|
||||||
|
devOui?: string; |
||||||
|
|
||||||
|
devTypeName?: string; |
||||||
|
|
||||||
|
userSnNo?: string; |
||||||
|
|
||||||
|
insertdate?: string; |
||||||
|
|
||||||
|
updatedate?: string; |
||||||
|
} |
||||||
|
export type HistoryQueryResult = PageResult<HistoryQueryTableVO[]>; |
@ -0,0 +1,130 @@ |
|||||||
|
<template> |
||||||
|
<div class="app-container"> |
||||||
|
<div class="search-container"> |
||||||
|
<el-form :model="queryForm" :inline="true"> |
||||||
|
<el-row> |
||||||
|
<el-col :span="6"> |
||||||
|
<el-form-item label="查询条件"> |
||||||
|
<el-select |
||||||
|
v-model="queryForm.selectName" |
||||||
|
placeholder="请选择" |
||||||
|
style="width: 240px" |
||||||
|
@change="resetSelect" |
||||||
|
clearable |
||||||
|
> |
||||||
|
<el-option |
||||||
|
v-for="item in options" |
||||||
|
:key="item.value" |
||||||
|
:label="item.label" |
||||||
|
:value="item.value" |
||||||
|
/> |
||||||
|
</el-select> |
||||||
|
</el-form-item> |
||||||
|
</el-col> |
||||||
|
<el-col |
||||||
|
:span="6" |
||||||
|
v-if=" |
||||||
|
queryForm.selectName !== undefined && |
||||||
|
queryForm.selectName !== 'regionAreaId' |
||||||
|
" |
||||||
|
> |
||||||
|
<el-input |
||||||
|
v-model="queryForm.selectValue" |
||||||
|
placeholder="请输入" |
||||||
|
style="width: 300px" |
||||||
|
/> |
||||||
|
</el-col> |
||||||
|
<el-col :span="buttonColSpan"> |
||||||
|
<el-form-item> |
||||||
|
<el-button type="primary" :icon="Search" @click="handleQuery" |
||||||
|
>搜索 |
||||||
|
</el-button> |
||||||
|
</el-form-item> |
||||||
|
</el-col> |
||||||
|
</el-row> |
||||||
|
</el-form> |
||||||
|
</div> |
||||||
|
<div class="any-table"> |
||||||
|
<el-table |
||||||
|
:data="tableData" |
||||||
|
max-height="450" |
||||||
|
highlight-current-row |
||||||
|
v-loading="loading" |
||||||
|
> |
||||||
|
<el-table-column label="序列号" prop="devSno" align="center" /> |
||||||
|
<el-table-column label="设备Oui" prop="devOui" align="center" /> |
||||||
|
<el-table-column label="设备型号" prop="devTypeName" align="center" /> |
||||||
|
<el-table-column label="逻辑Id" prop="userSnNo" align="center" /> |
||||||
|
<el-table-column |
||||||
|
label="首次绑定时间" |
||||||
|
prop="insertdate" |
||||||
|
align="center" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
label="记录更新时间" |
||||||
|
prop="updatedate" |
||||||
|
align="center" |
||||||
|
/> |
||||||
|
</el-table> |
||||||
|
<pagination |
||||||
|
v-if="total > 0" |
||||||
|
v-model:total="total" |
||||||
|
v-model:page="queryForm.pageNum" |
||||||
|
v-model:limit="queryForm.pageSize" |
||||||
|
@pagination="handleQuery" |
||||||
|
/> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script setup lang="ts"> |
||||||
|
import { Search } from "@element-plus/icons-vue"; |
||||||
|
import { HistoryQueryTableVO } from "@/api/history-query/types"; |
||||||
|
import { historyQueryApi } from "@/api/history-query"; |
||||||
|
|
||||||
|
defineOptions({ |
||||||
|
name: "HistoryQuery", |
||||||
|
inheritAttrs: false, |
||||||
|
}); |
||||||
|
const queryForm = ref<SelectForm>({ |
||||||
|
pageNum: 1, |
||||||
|
pageSize: 10, |
||||||
|
}); |
||||||
|
const total = ref<number>(0); |
||||||
|
const tableData = ref<HistoryQueryTableVO[]>([]); |
||||||
|
const options = ref<OptionType[]>([ |
||||||
|
{ label: "逻辑Id", value: "logicId" }, |
||||||
|
{ label: "设备序列号", value: "devSno" }, |
||||||
|
]); |
||||||
|
const loading = ref<boolean>(false); |
||||||
|
const buttonColSpan = computed(() => { |
||||||
|
return queryForm.value.selectName === undefined ? 18 : 12; |
||||||
|
}); |
||||||
|
const resetSelect = () => { |
||||||
|
queryForm.value.selectValue = undefined; |
||||||
|
}; |
||||||
|
const handleQuery = () => { |
||||||
|
if ( |
||||||
|
queryForm.value.selectName === undefined || |
||||||
|
queryForm.value.selectValue === undefined |
||||||
|
) { |
||||||
|
ElMessage({ |
||||||
|
message: "查询条件不能为空", |
||||||
|
type: "error", |
||||||
|
duration: 1000, |
||||||
|
}); |
||||||
|
return; |
||||||
|
} |
||||||
|
loading.value = true; |
||||||
|
historyQueryApi(queryForm.value) |
||||||
|
.then(({ data }) => { |
||||||
|
tableData.value = data.list; |
||||||
|
total.value = data.total; |
||||||
|
}) |
||||||
|
.finally(() => { |
||||||
|
loading.value = false; |
||||||
|
}); |
||||||
|
}; |
||||||
|
</script> |
||||||
|
|
||||||
|
<style scoped lang="scss"></style> |
@ -0,0 +1,3 @@ |
|||||||
|
<template> |
||||||
|
<router-view /> |
||||||
|
</template> |
@ -0,0 +1,27 @@ |
|||||||
|
<template> |
||||||
|
<div class="app-container"></div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script setup lang="ts"> |
||||||
|
defineOptions({ |
||||||
|
name: "DetailInventoryStatistics", |
||||||
|
inheritAttrs: false, |
||||||
|
}); |
||||||
|
const queryForm = ref<SelectForm>({ |
||||||
|
pageNum: 1, |
||||||
|
pageSize: 10, |
||||||
|
}); |
||||||
|
const options = ref<OptionType[]>([ |
||||||
|
{ label: "客户名称", value: "customName" }, |
||||||
|
{ label: "系统管理域", value: "regionAreaId" }, |
||||||
|
]); |
||||||
|
const buttonColSpan = computed(() => { |
||||||
|
return queryForm.value.selectName === undefined ? 18 : 12; |
||||||
|
}); |
||||||
|
const resetSelect = () => { |
||||||
|
queryForm.value.selectValue = undefined; |
||||||
|
}; |
||||||
|
</script> |
||||||
|
|
||||||
|
<style scoped lang="scss"> |
||||||
|
</style> |
@ -0,0 +1,6 @@ |
|||||||
|
<template> |
||||||
|
<div> |
||||||
|
<router-view /> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
<script setup lang="ts"></script> |
Loading…
Reference in new issue