检测计划列表数据渲染替换
This commit is contained in:
@@ -123,7 +123,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="tsx" name="useProTable">
|
||||
import { ref, reactive,onMounted } from "vue";
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { User } from "@/api/interface";
|
||||
import { useHandleData } from "@/hooks/useHandleData";
|
||||
@@ -161,7 +161,7 @@ const searchForm = ref({
|
||||
const proTable = ref<ProTableInstance>();
|
||||
|
||||
// 如果表格需要初始化请求参数,直接定义传给 ProTable (之后每次请求都会自动带上该参数,此参数更改之后也会一直带上,改变此参数会自动刷新表格数据)
|
||||
const initParam = reactive({ type: 1 });
|
||||
const initParam = reactive({ type: 1, pageNum: 1, pageSize: 10 });
|
||||
|
||||
// dataCallback 是对于返回的表格数据做处理,如果你后台返回的数据不是 list && total 这些字段,可以在这里进行处理成这些字段
|
||||
// 或者直接去 hooks/useTable.ts 文件中把字段改为你后端对应的就行
|
||||
@@ -171,11 +171,11 @@ const tableList = ref([]);
|
||||
// console.log(tableList.value, "?????????????????????177");
|
||||
const dataCallback = (data: any) => {
|
||||
return {
|
||||
list: data||data.data||data.list,
|
||||
total: data.length||data.total,//total
|
||||
list: data || data.data || data.list,
|
||||
total: data.length || data.total, //total
|
||||
};
|
||||
};
|
||||
console.log(proTable.value,"proTable.value?proTable.value?proTable.value?");
|
||||
console.log(proTable.value, "proTable.value?proTable.value?proTable.value?");
|
||||
// 如果你想在请求之前对当前请求参数做一些操作,可以自定义如下函数:params 为当前所有的请求参数(包括分页),最后返回请求列表接口
|
||||
// 默认不做操作就直接在 ProTable 组件上绑定 :requestApi="getUserList"
|
||||
const getTableList = (params: any) => {
|
||||
@@ -194,25 +194,135 @@ const columns = reactive<ColumnProps<User.ResUserList>[]>([
|
||||
{
|
||||
prop: "planName",
|
||||
label: "计划名称",
|
||||
width:120,
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
prop: "checkMode",
|
||||
label: "检测模式",
|
||||
width: 120 ,
|
||||
width: 120,
|
||||
render: (scope) => {
|
||||
return scope.row.checkMode == 0
|
||||
? "模拟式"
|
||||
: scope.row.checkMode == 1
|
||||
? "对比式"
|
||||
: scope.row.checkMode == 2
|
||||
? "数字式"
|
||||
: scope.row.checkMode;
|
||||
},
|
||||
},
|
||||
{ prop: "checkFrom", label: "检测源", Width: 120 },
|
||||
{ prop: "numberFromName", label: "数字源名称", width: 120 },
|
||||
{ prop: "checkExe", label: "检测脚本", width: 120 },
|
||||
{ prop: "wctx", label: "误差体系", width: 120 },
|
||||
{ prop: "checkStatus", label: "检测状态", width: 120 },
|
||||
{ prop: "checkReport", label: "检测报告", width: 120 },
|
||||
{ prop: "checkResult", label: "检测结果", width: 120 },
|
||||
{ prop: "parentNode", label: "父节点", width: 90 },
|
||||
{
|
||||
prop: "createTime",
|
||||
label: "创建时间",
|
||||
width: 180,
|
||||
prop: "checkFrom",
|
||||
label: "检测源",
|
||||
Width: 120,
|
||||
render: (scope) => {
|
||||
return scope.row.checkFrom == 0
|
||||
? "标准源-福禄克-6100A"
|
||||
: scope.row.checkFrom == 1
|
||||
? "标准源-昂立-PF2"
|
||||
: scope.row.checkFrom == 2
|
||||
? "高精度设备-PQS882-1"
|
||||
: scope.row.checkFrom;
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: "numberFromName",
|
||||
label: "数字源名称",
|
||||
width: 120,
|
||||
render: (scope) => {
|
||||
return scope.row.numberFromName == 0
|
||||
? "分钟统计数据最大值"
|
||||
: scope.row.numberFromName == 1
|
||||
? "分钟统计数据最小值"
|
||||
: scope.row.numberFromName == 2
|
||||
? "分钟统计数据CP95值"
|
||||
: scope.row.numberFromName;
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: "checkExe",
|
||||
label: "检测脚本",
|
||||
width: 120,
|
||||
render: (scope) => {
|
||||
return scope.row.checkExe == 0
|
||||
? "国网入网检测脚本(单影响量-模拟式)"
|
||||
: scope.row.checkExe == 1
|
||||
? "国网入网检测脚本"
|
||||
: scope.row.checkExe == 2
|
||||
? "/"
|
||||
: scope.row.checkExe;
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: "wctx",
|
||||
label: "误差体系",
|
||||
width: 120,
|
||||
render: (scope) => {
|
||||
return scope.row.wctx == 0
|
||||
? "Q/GDW 1650.2- 2016"
|
||||
: scope.row.wctx == 1
|
||||
? "Q/GDW 10650.2 - 2021"
|
||||
: scope.row.wctx == 2
|
||||
? "/"
|
||||
: scope.row.wctx;
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: "checkStatus",
|
||||
label: "检测状态",
|
||||
width: 120,
|
||||
render: (scope) => {
|
||||
return scope.row.checkStatus == 1
|
||||
? "未检测"
|
||||
: scope.row.checkStatus == 2
|
||||
? "检测中"
|
||||
: scope.row.checkStatus == 3
|
||||
? "检测完成"
|
||||
: scope.row.checkStatus;
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: "checkReport",
|
||||
label: "检测报告",
|
||||
width: 120,
|
||||
render: (scope) => {
|
||||
return scope.row.checkReport == 1
|
||||
? "未生成"
|
||||
: scope.row.checkReport == 2
|
||||
? "部分生成"
|
||||
: scope.row.checkReport == 3
|
||||
? "全部生成"
|
||||
: scope.row.checkReport;
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: "checkResult",
|
||||
label: "检测结果",
|
||||
width: 120,
|
||||
render: (scope) => {
|
||||
return scope.row.checkReport == 1
|
||||
? "/"
|
||||
: scope.row.checkReport == 2
|
||||
? "符合"
|
||||
: scope.row.checkReport == 3
|
||||
? "不符合"
|
||||
: scope.row.checkReport;
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: "parentNode",
|
||||
label: "父节点",
|
||||
width: 90,
|
||||
render: (scope) => {
|
||||
return scope.row.checkReport == 0
|
||||
? "/"
|
||||
: scope.row.checkReport == 1
|
||||
? "检测计划1"
|
||||
: scope.row.checkReport == 2
|
||||
? "检测计划2"
|
||||
: scope.row.checkReport == 3
|
||||
? "检测计划3"
|
||||
: scope.row.checkReport;
|
||||
},
|
||||
},
|
||||
{ prop: "operation", label: "操作", fixed: "right", width: 250 },
|
||||
]);
|
||||
@@ -266,14 +376,14 @@ const changeStatus = async (row: User.ResUserList) => {
|
||||
);
|
||||
proTable.value?.getTableList();
|
||||
};
|
||||
onMounted(()=>{
|
||||
onMounted(() => {
|
||||
console.log(proTable.value?.tableData);
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.planList {
|
||||
width: 100%;
|
||||
height: calc(100vh - 100px);
|
||||
height: calc(100vh - 130px);
|
||||
}
|
||||
::v-deep .el-select {
|
||||
width: 180px !important;
|
||||
|
||||
Reference in New Issue
Block a user