<!--
|
* @Author: elkers
|
* @Date: 2024-08-06 16:17:39
|
* @LastEditors: hqs elkers@163.com
|
* @LastEditTime: 2024-08-13 18:41:23
|
* @FilePath: \water-qinghe-web\src\views\waterMeter\meterOperation\index.vue
|
* @Description: 水表检定
|
-->
|
|
<script setup>
|
import meterOperationApi from "@/api/waterMeterApi/meterOperation";
|
import { nameReg ,phoneReg } from "@/utils/regular";
|
import setPostParams from "../../../utils/searchParams.js";
|
|
const { proxy } = getCurrentInstance();
|
|
/**
|
* 搜索相关
|
*/
|
/** 搜索按钮操作 */
|
function handleQuery() {
|
getList({keywords:searchParams.value.deviceId})
|
}
|
|
/** 重置按钮操作 */
|
function resetQuery() {
|
proxy.resetForm("queryRef");
|
handleQuery();
|
}
|
|
/**
|
* Table表格权限数据列表相关
|
*/
|
const pageParam = ref({
|
total:0,
|
limit:0,
|
page:1,
|
})
|
const tableData = ref([]);
|
const inpTip= '请输入',selTip = '请选择';
|
let tableHeader = ref({
|
useFacilityId: '设备/水表编号',
|
comment: '操作说明',
|
operateIp:'ip地址',
|
createUserName:'操作人',
|
|
})
|
/** 获取列表 */
|
const loading = ref()
|
async function getList(val) {
|
let postParam = setPostParams(val)
|
loading.value = true;
|
await meterOperationApi().search(postParam).then((res) =>{
|
tableData.value = res.data.list
|
tableData.value.forEach((item,index) =>{
|
if (item.facilityId){
|
item.useFacilityId = item.facilityId
|
}
|
if(item.useWaterMeterId){
|
item.useFacilityId = item.useWaterMeterId
|
}
|
})
|
pageParam.value.total = res.data.total
|
pageParam.value.limit = res.data.limit
|
pageParam.value.page = res.data.page
|
})
|
loading.value = false;
|
}
|
/**
|
* 表单相关
|
*/
|
const searchParams = ref({
|
keywords: '',
|
});
|
getList();
|
</script>
|
<template>
|
<div class="app-container">
|
<el-form :model="searchParams" ref="queryRef" :inline="true">
|
<el-form-item label="" prop="">
|
<el-input
|
v-model="searchParams.deviceId"
|
placeholder="请输入搜索信息"
|
clearable
|
style="width: 200px"
|
@keyup.enter="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
</el-form-item>
|
</el-form>
|
<!--表格及分页-->
|
<el-table v-loading="loading" :data="tableData">
|
<el-table-column
|
v-for="(item, key, index) of tableHeader"
|
:prop="key.toString()"
|
:label="item"
|
:key="index"
|
align="center"
|
>
|
<template #default="scope">
|
<div v-if="key.toString() == 'headImg'">
|
<img :src="scope.row.headImg" class="table-headImg"/>
|
</div>
|
</template>
|
</el-table-column>
|
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
|
<template #default="scope">
|
<el-button link type="primary" icon="Edit" v-has="['update',route]" @click="handleUpdate(scope.row)">修改</el-button>
|
<el-button link type="primary" icon="Delete" v-has="['delete',route]" @click="handleDelete(scope.row)">删除</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<pagination
|
:total="pageParam.total"
|
v-model:page="pageParam.page"
|
v-model:limit="pageParam.limit"
|
:page-sizes="[10,20,30]"
|
@pagination="getList"
|
/>
|
</div>
|
</template>
|
|
<style lang="scss" scoped>
|
|
</style>
|
|