<template>
|
<!-- 搜索 -->
|
<ContentWrap>
|
<el-form
|
class="-mb-15px"
|
ref="queryFormRef"
|
:inline="true"
|
label-width="68px"
|
>
|
<el-form-item>
|
<el-button
|
type="primary"
|
plain
|
@click="openForm('create')"
|
v-hasPermi="['item:accuracy-rate:create']"
|
>
|
<Icon icon="ep:plus" class="mr-5px" />
|
新增
|
</el-button>
|
</el-form-item>
|
</el-form>
|
</ContentWrap>
|
|
<!-- 列表 -->
|
<ContentWrap>
|
<el-table v-loading="loading" :data="list">
|
<el-table-column label="预测项ID" header-align="center" align="center" min-width="150" prop="itemId" fixed/>
|
<el-table-column label="输出ID" header-align="center" align="center" min-width="150" prop="outId" />
|
<el-table-column label="取样长度" header-align="center" align="center" min-width="100" prop="sampleLength" />
|
<el-table-column label="值类型" header-align="center" align="center" min-width="50" prop="valueType" />
|
<el-table-column label="开始统计时间" header-align="center" align="center" min-width="50" prop="beginTime" />
|
<el-table-column label="精准误差" header-align="center" align="center" min-width="50" prop="inDeviation" />
|
<el-table-column label="精准度" header-align="center" align="center" min-width="100" prop="inAccuracyRate" />
|
<el-table-column label="不可信误差" header-align="center" align="center" min-width="100" prop="outDeviation" />
|
<el-table-column label="不可信率" header-align="center" align="center" min-width="100" prop="outAccuracyRate" />
|
<el-table-column label="是否启用" header-align="center" align="center" min-width="100" prop="isEnable" >
|
<template #default="scope">
|
<dict-tag :type="DICT_TYPE.COM_IS_INT" :value="scope.row.isEnable" />
|
</template>
|
</el-table-column>
|
<el-table-column label="创建时间" header-align="center" align="center" min-width="100" prop="createTime" />
|
<el-table-column label="操作" align="center" min-width="180" fixed="right">
|
<template #default="scope">
|
<el-button
|
link
|
type="primary"
|
@click="openForm('update', scope.row.id)"
|
v-hasPermi="['item:accuracy-rate:update']"
|
>
|
编辑
|
</el-button>
|
<el-button
|
link
|
type="danger"
|
@click="handleDelete(scope.row.id)"
|
v-hasPermi="['item:accuracy-rate:delete']"
|
>
|
删除
|
</el-button>
|
<el-button
|
link
|
type="danger"
|
@click="handleView(scope.row.id)"
|
>
|
查看历史
|
</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<!-- 分页 -->
|
<Pagination
|
:total="total"
|
v-model:page="queryParams.pageNo"
|
v-model:limit="queryParams.pageSize"
|
@pagination="getList"
|
/>
|
</ContentWrap>
|
|
<!-- 表单弹窗:添加/修改 -->
|
<MmItemAccuracyRateForm ref="formRef" @success="getList" />
|
<MmItemAccuracyHis ref="MessageRef" />
|
|
</template>
|
<script lang="ts" setup>
|
import MmItemAccuracyRateForm from './MmItemAccuracyRateForm.vue'
|
import MmItemAccuracyHis from './MmItemAccuracyHisForm.vue'
|
import * as MmItemAccuracyRate from '@/api/model/pre/accuracy/rate'
|
import {DICT_TYPE} from "@/utils/dict";
|
|
defineOptions({name: 'DataMmItemAccuracyRate'})
|
|
const message = useMessage() // 消息弹窗
|
const {t} = useI18n() // 国际化
|
|
const loading = ref(true) // 列表的加载中
|
const total = ref(0) // 列表的总页数
|
const list = ref([]) // 列表的数据
|
const queryParams = reactive({
|
pageNo: 1,
|
pageSize: 10,
|
})
|
const queryFormRef = ref() // 搜索的表单
|
|
/** 查询列表 */
|
const getList = async () => {
|
loading.value = true
|
try {
|
const page = await MmItemAccuracyRate.getMmItemAccuracyRatePage(queryParams)
|
list.value = page.list
|
total.value = page.total
|
} finally {
|
loading.value = false
|
}
|
}
|
|
/** 添加/修改操作 */
|
const formRef = ref()
|
const openForm = (type: string, id?: number) => {
|
formRef.value.open(type, id)
|
}
|
|
/** 删除按钮操作 */
|
const handleDelete = async (id: number) => {
|
try {
|
// 删除的二次确认
|
await message.delConfirm()
|
// 发起删除
|
await MmItemAccuracyRate.deleteMmItemAccuracyRate(id)
|
message.success(t('common.delSuccess'))
|
// 刷新列表
|
await getList()
|
} catch {
|
}
|
}
|
|
/** 查看历史按钮操作 */
|
const MessageRef = ref()
|
const handleView = (id?: string) => {
|
MessageRef.value.open(id)
|
}
|
|
/** 初始化 **/
|
onMounted(async () => {
|
await getList()
|
})
|
</script>
|