提交 | 用户 | 时间
|
ebc552
|
1 |
<template> |
L |
2 |
<el-drawer |
|
3 |
v-model="drawer" |
|
4 |
size="60%" |
|
5 |
title="历史详情" |
|
6 |
direction="rtl" |
|
7 |
:before-close="handleClose" |
|
8 |
> |
|
9 |
<!-- 搜索工作栏 --> |
|
10 |
<el-form |
|
11 |
class="-mb-15px" |
|
12 |
:model="queryParams" |
|
13 |
ref="queryFormRef" |
|
14 |
:inline="true" |
|
15 |
label-width="68px" |
|
16 |
> |
|
17 |
<el-form-item label="精准误差" prop="inDeviation"> |
|
18 |
<el-input |
|
19 |
v-model="queryParams.inDeviation" |
|
20 |
placeholder="请输入精准误差" |
|
21 |
clearable |
|
22 |
class="!w-240px" |
|
23 |
/> |
|
24 |
</el-form-item> |
|
25 |
<el-form-item> |
|
26 |
<el-button @click="handleQuery"> |
|
27 |
<Icon icon="ep:search" class="mr-5px"/> |
|
28 |
搜索 |
|
29 |
</el-button> |
|
30 |
<el-button @click="resetQuery"> |
|
31 |
<Icon icon="ep:refresh" class="mr-5px"/> |
|
32 |
重置 |
|
33 |
</el-button> |
|
34 |
</el-form-item> |
|
35 |
</el-form> |
|
36 |
<!-- 列表 --> |
|
37 |
<el-table |
|
38 |
v-loading="loading" |
|
39 |
:data="list" |
|
40 |
row-key="id" |
|
41 |
> |
|
42 |
<el-table-column prop="inDeviation" label="精准误差"/> |
|
43 |
<el-table-column prop="inAccuracyRate" label="精准度"/> |
|
44 |
<el-table-column prop="outDeviation" label="不可信误差"/> |
|
45 |
<el-table-column prop="outAccuracyRate" label="不可信率"/> |
|
46 |
</el-table> |
|
47 |
<!-- 分页 --> |
|
48 |
<Pagination |
|
49 |
v-model:limit="queryParams.limit" |
|
50 |
v-model:page="queryParams.page" |
|
51 |
:total="total" |
|
52 |
@pagination="getList" |
|
53 |
/> |
|
54 |
</el-drawer> |
|
55 |
</template> |
|
56 |
<script lang="ts" setup> |
|
57 |
import * as MmItemAccuracyHis from '@/api/model/pre/accuracy/his' |
|
58 |
|
|
59 |
defineOptions({name: 'ChartParam'}) |
|
60 |
|
|
61 |
const drawer = ref(false) |
|
62 |
const loading = ref(false) // 列表的加载中 |
|
63 |
const total = ref(0) // 列表的总页数 |
|
64 |
const list = ref([]) // 字典表格数据 |
|
65 |
const queryParams = reactive({ |
|
66 |
page: 1, |
|
67 |
limit: 10, |
|
68 |
rateId: undefined, |
|
69 |
inDeviation: undefined, |
|
70 |
inAccuracyRate: undefined, |
|
71 |
outDeviation: undefined, |
|
72 |
outAccuracyRate: undefined, |
|
73 |
}) |
|
74 |
const queryFormRef = ref() // 搜索的表单 |
|
75 |
|
|
76 |
const getList = async () => { |
|
77 |
loading.value = true |
|
78 |
try { |
|
79 |
const data = await MmItemAccuracyHis.getMmItemAccuracyHisPage(queryParams) |
|
80 |
list.value = data.list |
|
81 |
total.value = data.total |
|
82 |
} finally { |
|
83 |
loading.value = false |
|
84 |
} |
|
85 |
} |
|
86 |
|
|
87 |
/** 打开弹窗 */ |
|
88 |
const open = async (rateId?: string) => { |
|
89 |
resetForm() |
|
90 |
drawer.value = true |
|
91 |
queryParams.rateId = rateId |
|
92 |
if (rateId) { |
|
93 |
getList() |
|
94 |
} |
|
95 |
} |
|
96 |
defineExpose({open}) // 提供 open 方法,用于打开弹窗 |
|
97 |
|
|
98 |
/** 重置表单 */ |
|
99 |
const resetForm = () => { |
|
100 |
queryParams.rateId = undefined |
|
101 |
queryParams.inDeviation = undefined |
|
102 |
queryParams.inAccuracyRate = undefined |
|
103 |
queryParams.outDeviation = undefined |
|
104 |
queryParams.outAccuracyRate = undefined |
|
105 |
|
|
106 |
} |
|
107 |
|
|
108 |
/** 搜索按钮操作 */ |
|
109 |
const handleQuery = () => { |
|
110 |
getList() |
|
111 |
} |
|
112 |
|
|
113 |
/** 重置按钮操作 */ |
|
114 |
const resetQuery = () => { |
|
115 |
queryFormRef.value.resetFields() |
|
116 |
handleQuery() |
|
117 |
} |
|
118 |
|
|
119 |
const handleClose = (done: () => void) => { |
|
120 |
drawer.value = false |
|
121 |
} |
|
122 |
</script> |