检测计划列表数据渲染替换
This commit is contained in:
@@ -161,7 +161,7 @@ const searchForm = ref({
|
|||||||
const proTable = ref<ProTableInstance>();
|
const proTable = ref<ProTableInstance>();
|
||||||
|
|
||||||
// 如果表格需要初始化请求参数,直接定义传给 ProTable (之后每次请求都会自动带上该参数,此参数更改之后也会一直带上,改变此参数会自动刷新表格数据)
|
// 如果表格需要初始化请求参数,直接定义传给 ProTable (之后每次请求都会自动带上该参数,此参数更改之后也会一直带上,改变此参数会自动刷新表格数据)
|
||||||
const initParam = reactive({ type: 1 });
|
const initParam = reactive({ type: 1, pageNum: 1, pageSize: 10 });
|
||||||
|
|
||||||
// dataCallback 是对于返回的表格数据做处理,如果你后台返回的数据不是 list && total 这些字段,可以在这里进行处理成这些字段
|
// dataCallback 是对于返回的表格数据做处理,如果你后台返回的数据不是 list && total 这些字段,可以在这里进行处理成这些字段
|
||||||
// 或者直接去 hooks/useTable.ts 文件中把字段改为你后端对应的就行
|
// 或者直接去 hooks/useTable.ts 文件中把字段改为你后端对应的就行
|
||||||
@@ -200,19 +200,129 @@ const columns = reactive<ColumnProps<User.ResUserList>[]>([
|
|||||||
prop: "checkMode",
|
prop: "checkMode",
|
||||||
label: "检测模式",
|
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",
|
prop: "checkFrom",
|
||||||
label: "创建时间",
|
label: "检测源",
|
||||||
width: 180,
|
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 },
|
{ prop: "operation", label: "操作", fixed: "right", width: 250 },
|
||||||
]);
|
]);
|
||||||
@@ -268,12 +378,12 @@ const changeStatus = async (row: User.ResUserList) => {
|
|||||||
};
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log(proTable.value?.tableData);
|
console.log(proTable.value?.tableData);
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.planList {
|
.planList {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100vh - 100px);
|
height: calc(100vh - 130px);
|
||||||
}
|
}
|
||||||
::v-deep .el-select {
|
::v-deep .el-select {
|
||||||
width: 180px !important;
|
width: 180px !important;
|
||||||
|
|||||||
Reference in New Issue
Block a user