微调
This commit is contained in:
@@ -3,16 +3,16 @@
|
||||
<!-- :request-api="getTableList" -->
|
||||
<ProTable
|
||||
ref="proTable"
|
||||
|
||||
:columns="columns"
|
||||
:data='deviceData'
|
||||
:init-param="initParam"
|
||||
:data-callback="dataCallback"
|
||||
:data ='deviceData'
|
||||
@drag-sort="sortTable"
|
||||
:default-sort="{ prop: 'check_State', order: 'ascending' }"
|
||||
:stripe="true"
|
||||
:pagination = "false"
|
||||
:key="tableKey"
|
||||
@selection-change='handleSelectionChange'
|
||||
:request-api='getTableList'
|
||||
>
|
||||
<!-- :height="tableHeight" -->
|
||||
<!-- 表格 header 按钮 -->
|
||||
@@ -57,17 +57,6 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="检测结果">
|
||||
<el-select v-model="form.checkResult" clearable>
|
||||
<el-option
|
||||
v-for="(item, index) in checkResultList"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:disabled="item.disabled"
|
||||
:key="index"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" :icon="Search" @click="handleSearch"
|
||||
>查询</el-button
|
||||
@@ -75,7 +64,6 @@
|
||||
<el-button :icon="Delete" @click="handleRefresh"
|
||||
>重置</el-button
|
||||
>
|
||||
|
||||
<!-- :disabled='!scope.isSelected' -->
|
||||
<el-button
|
||||
type="primary"
|
||||
@@ -265,9 +253,11 @@ import testPopup from "./testPopup.vue";
|
||||
import reportPopup from "./reportPopup.vue";
|
||||
import dataCheckPopup from "./dataCheckPopup.vue";
|
||||
import dataCheckChangeErrSysPopup from "./dataCheckChangeErrSysPopup.vue";
|
||||
import { getBoundPqDevList } from '@/api/plan/plan.ts'
|
||||
import { onMounted, reactive, ref, watch } from "vue";
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
|
||||
import { reactive, ref } from "vue";
|
||||
|
||||
const dictStore = useDictStore()
|
||||
let devNum = 0;//当前选取的被检设备数量
|
||||
let devChannelsNum = 0;//当前选择的被检设备通道总数
|
||||
let devTestedNum = 0;//当前选择的已完成检测的被检设备数量
|
||||
@@ -294,10 +284,26 @@ const dialogForm = ref<any>({
|
||||
const shouldShowOption = (item) => {
|
||||
return !item.disabled;
|
||||
};
|
||||
|
||||
|
||||
|
||||
const plan_devicedata = [
|
||||
{
|
||||
id: '1', //装置序号ID
|
||||
name: '240001', //设备名称
|
||||
dev_Type: 'PQS-882B4',//设备类型
|
||||
dev_Chns: 4, //设备通道数
|
||||
check_Result: '未检', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'未检',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
}]
|
||||
|
||||
//console.log(window.innerHeight, "+++++++++");
|
||||
tableHeight.value = window.innerHeight - 600;
|
||||
//const deviceData = deviceDataList.plan_devicedata
|
||||
const deviceData = ref([]);
|
||||
const deviceData = ref<Device.ResPqDev[]>([]);
|
||||
deviceData.value = deviceDataList.plan_devicedata.filter((item) => item.document_State === "未归档")
|
||||
const operationShow = ref(false);
|
||||
const documentStateShow = ref(false);
|
||||
@@ -305,6 +311,13 @@ const checkStateShow = ref(true);
|
||||
const operationMinWidth = ref(200);
|
||||
const selectionShow = ref(true);
|
||||
|
||||
const props = defineProps({
|
||||
id: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
|
||||
//下拉框数据
|
||||
//检测状态数据
|
||||
let checkStatusList = reactive([
|
||||
@@ -404,16 +417,33 @@ const dataCallback = (data: any) => {
|
||||
};
|
||||
// 如果你想在请求之前对当前请求参数做一些操作,可以自定义如下函数:params 为当前所有的请求参数(包括分页),最后返回请求列表接口
|
||||
// 默认不做操作就直接在 ProTable 组件上绑定 :requestApi="getUserList"
|
||||
const getTableList = (params: any) => {
|
||||
let newParams = JSON.parse(JSON.stringify(params));
|
||||
newParams.createTime && (newParams.startTime = newParams.createTime[0]);
|
||||
newParams.createTime && (newParams.endTime = newParams.createTime[1]);
|
||||
delete newParams.createTime;
|
||||
return getPlanList(newParams);
|
||||
// const getTableList = (params: any) => {
|
||||
// console.log('11111111111111111',props.id);
|
||||
// let newParams = JSON.parse(JSON.stringify(params));
|
||||
// newParams.createTime && (newParams.startTime = newParams.createTime[0]);
|
||||
// newParams.createTime && (newParams.endTime = newParams.createTime[1]);
|
||||
// delete newParams.createTime;
|
||||
// return getPlanList(newParams);
|
||||
// };
|
||||
|
||||
const boundPqDevList=ref<Device.ReqPqDevParams[]>([])//根据检测计划id查询出所有已绑定的设备
|
||||
|
||||
const getTableList = async (params: any) => {
|
||||
|
||||
deviceData.value = plan_devicedata.filter((item) => item.document_State === "未归档")
|
||||
|
||||
|
||||
const pqDevList_Result2 = await getBoundPqDevList({'planId': props.id, 'checkStateList':[0,1,2]});
|
||||
boundPqDevList.value = pqDevList_Result2.data as Device.ReqPqDevParams[];
|
||||
console.log('qwe',boundPqDevList.value)
|
||||
console.log('qwe123',props.id)
|
||||
return getBoundPqDevList({'planId': props.id, 'checkStateList':[0,1,2]});
|
||||
};
|
||||
|
||||
|
||||
|
||||
// 表格配置项
|
||||
const columns = reactive([
|
||||
const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
{ type: 'selection', fixed: 'left', width: 70, isShow:selectionShow },
|
||||
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
||||
{
|
||||
@@ -422,18 +452,20 @@ const columns = reactive([
|
||||
minWidth: 220,
|
||||
},
|
||||
{
|
||||
prop: 'dev_Type',
|
||||
prop: 'devType',
|
||||
label: '设备类型',
|
||||
minWidth: 100,
|
||||
enum: dictStore.getDictData('Dev_Type'),
|
||||
fieldNames: { label: 'name', value: 'id' },
|
||||
},
|
||||
{
|
||||
prop: 'dev_Chns',
|
||||
prop: 'devChns',
|
||||
label: '通道数',
|
||||
minWidth: 100,
|
||||
sortable:true,
|
||||
},
|
||||
{
|
||||
prop: 'reCheck_Num',
|
||||
prop: 'reCheckNum',
|
||||
label: '检测次数',
|
||||
minWidth: 100,
|
||||
sortable:true,
|
||||
@@ -445,40 +477,36 @@ const columns = reactive([
|
||||
// </template>
|
||||
},
|
||||
{
|
||||
prop: 'check_State',
|
||||
prop: 'checkState',
|
||||
label: '检测状态',
|
||||
minWidth: 100,
|
||||
sortable:true,
|
||||
isShow:checkStateShow,
|
||||
},
|
||||
{
|
||||
prop: 'check_Result',
|
||||
prop: 'checkResult',
|
||||
label: '检测结果',
|
||||
minWidth: 100,
|
||||
sortable:true,
|
||||
render: (scope) => {
|
||||
if(scope.row.check_Result === '不符合')
|
||||
{
|
||||
return (
|
||||
<el-tag type='danger'>{ scope.row.check_Result }</el-tag>
|
||||
)
|
||||
}
|
||||
else
|
||||
{
|
||||
return (
|
||||
<span>{ scope.row.check_Result }</span>
|
||||
)
|
||||
}
|
||||
},
|
||||
if (scope.row.checkResult === 2)
|
||||
{
|
||||
return (<el-tag type='danger'>{ scope.row.checkResult }</el-tag>)
|
||||
}
|
||||
else
|
||||
{
|
||||
return (<span>{ scope.row.checkResult }</span>)
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'report_State',
|
||||
prop: 'reportState',
|
||||
label: '报告状态',
|
||||
minWidth: 100,
|
||||
sortable:true,
|
||||
},
|
||||
{
|
||||
prop: 'document_State',
|
||||
prop: 'documentState',
|
||||
label: '归档状态',
|
||||
minWidth: 100,
|
||||
sortable:true,
|
||||
@@ -487,149 +515,82 @@ const columns = reactive([
|
||||
{ prop: 'operation', label: '操作', fixed: 'right', minWidth: 200 ,isShow: operationShow},
|
||||
])
|
||||
|
||||
// const columns = reactive<ColumnProps<User.ResUserList>[]>([
|
||||
// { type: "selection", fixed: "left", width: 70 },
|
||||
// {
|
||||
// prop: "checkMode",
|
||||
// label: "设备序列号",
|
||||
// width: 140,
|
||||
// render: (scope) => {
|
||||
// return scope.row.checkMode == 0
|
||||
// ? "设备1"
|
||||
// : scope.row.checkMode == 1
|
||||
// ? "设备2"
|
||||
// : scope.row.checkMode == 2
|
||||
// ? "设备3"
|
||||
// : scope.row.checkMode;
|
||||
|
||||
// // 表格配置项
|
||||
// const columns = reactive([
|
||||
// { type: 'selection', fixed: 'left', width: 70, isShow:selectionShow },
|
||||
// { type: 'index', fixed: 'left', width: 70, label: '序号' },
|
||||
// {
|
||||
// prop: 'name',
|
||||
// label: '设备名称',
|
||||
// minWidth: 220,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// prop: "checkMode",
|
||||
// label: "设备类型",
|
||||
// width: 140,
|
||||
// render: (scope) => {
|
||||
// return scope.row.checkMode == 0
|
||||
// ? "PQS991"
|
||||
// : scope.row.checkMode == 1
|
||||
// ? "PQS882"
|
||||
// : scope.row.checkMode == 2
|
||||
// ? "PQS6666"
|
||||
// : scope.row.checkMode;
|
||||
// {
|
||||
// prop: 'dev_Type',
|
||||
// label: '设备类型',
|
||||
// minWidth: 100,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// prop: "checkFrom",
|
||||
// label: "制造厂商",
|
||||
// width: 140,
|
||||
// render: (scope) => {
|
||||
// return scope.row.checkFrom == 0
|
||||
// ? "南京灿能"
|
||||
// : scope.row.checkFrom == 1
|
||||
// ? "南瑞继保"
|
||||
// : scope.row.checkFrom == 2
|
||||
// ? "/"
|
||||
// : scope.row.checkFrom;
|
||||
// {
|
||||
// prop: 'dev_Chns',
|
||||
// label: '通道数',
|
||||
// minWidth: 100,
|
||||
// sortable:true,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// prop: "numberFromName",
|
||||
// label: "MAC/IP",
|
||||
// render: (scope) => {
|
||||
// return scope.row.numberFromName == 0
|
||||
// ? "192.168.0.1"
|
||||
// : scope.row.numberFromName == 1
|
||||
// ? "192.168.0.2"
|
||||
// : scope.row.numberFromName == 2
|
||||
// ? "192.168.0.3"
|
||||
// : scope.row.numberFromName;
|
||||
// {
|
||||
// prop: 'reCheck_Num',
|
||||
// label: '检测次数',
|
||||
// minWidth: 100,
|
||||
// sortable:true,
|
||||
// // <template #header>
|
||||
// // <span>检测次数</span>
|
||||
// // <el-tooltip content = "最大检测次数为3次,超过会强制归档" placement="top" style="align-items: bottom;">
|
||||
// // <el-icon><InfoFilled /></el-icon>
|
||||
// // </el-tooltip>
|
||||
// // </template>
|
||||
// },
|
||||
// {
|
||||
// prop: 'check_State',
|
||||
// label: '检测状态',
|
||||
// minWidth: 100,
|
||||
// sortable:true,
|
||||
// isShow:checkStateShow,
|
||||
// },
|
||||
// {
|
||||
// prop: 'check_Result',
|
||||
// label: '检测结果',
|
||||
// minWidth: 100,
|
||||
// sortable:true,
|
||||
// render: (scope) => {
|
||||
// if(scope.row.check_Result === '不符合')
|
||||
// {
|
||||
// return (
|
||||
// <el-tag type='danger'>{ scope.row.check_Result }</el-tag>
|
||||
// )
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return (
|
||||
// <span>{ scope.row.check_Result }</span>
|
||||
// )
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// prop: "checkExe",
|
||||
// label: "检测脚本",
|
||||
// render: (scope) => {
|
||||
// return scope.row.checkExe == 0
|
||||
// ? "国网入网检测脚本(单影响量-模拟式)"
|
||||
// : scope.row.checkExe == 1
|
||||
// ? "国网入网检测脚本"
|
||||
// : scope.row.checkExe == 2
|
||||
// ? "/"
|
||||
// : scope.row.checkExe;
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// prop: "wctx",
|
||||
// label: "误差体系",
|
||||
// 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: 'report_State',
|
||||
// label: '报告状态',
|
||||
// minWidth: 100,
|
||||
// sortable:true,
|
||||
// },
|
||||
// {
|
||||
// prop: 'document_State',
|
||||
// label: '归档状态',
|
||||
// minWidth: 100,
|
||||
// sortable:true,
|
||||
// isShow: documentStateShow,
|
||||
// },
|
||||
// { prop: 'operation', label: '操作', fixed: 'right', minWidth: 200 ,isShow: operationShow},
|
||||
// ])
|
||||
|
||||
// 跳转详情页
|
||||
const toDetail = () => {
|
||||
router.push(
|
||||
@@ -1016,6 +977,19 @@ const openDrawer = (title: string, row: any) => {
|
||||
onMounted(() => {
|
||||
//console.log(proTable.value?.tableData);
|
||||
});
|
||||
|
||||
// 监听 props.id 的变化
|
||||
watch(
|
||||
() => props.id,
|
||||
(newId) => {
|
||||
console.log(`props.id changed to ${newId}`);
|
||||
// 调用获取数据的方法
|
||||
getTableList({ type: 1, pageNum: 1, pageSize: 10 });
|
||||
},
|
||||
{ immediate: true } // 立即执行一次
|
||||
);
|
||||
|
||||
|
||||
defineExpose({ changeActiveTabs });
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user