设备类型CRUD
This commit is contained in:
@@ -54,7 +54,7 @@ export const importCNDev = (params: Device.ReqPqDevParams) => {
|
|||||||
}
|
}
|
||||||
//根据设备类型决定(电源、icd、模板、通道数、额定电压、额定电流);
|
//根据设备类型决定(电源、icd、模板、通道数、额定电压、额定电流);
|
||||||
export const getPqDev = () => {
|
export const getPqDev = () => {
|
||||||
return http.post(`/devType/listAll`)
|
return http.get(`/devType/listAll`)
|
||||||
}
|
}
|
||||||
|
|
||||||
//被检设备归档
|
//被检设备归档
|
||||||
|
|||||||
@@ -482,7 +482,7 @@ const getTableList = async (params: any) => {
|
|||||||
} else {
|
} else {
|
||||||
checkStateList.value = checkStateTable.value
|
checkStateList.value = checkStateTable.value
|
||||||
}
|
}
|
||||||
console.log('table,getBoundPqDevList')
|
//console.log('table,getBoundPqDevList')
|
||||||
return getBoundPqDevList({
|
return getBoundPqDevList({
|
||||||
'planId': props.id,
|
'planId': props.id,
|
||||||
'checkStateList': checkStateList.value,
|
'checkStateList': checkStateList.value,
|
||||||
@@ -667,12 +667,12 @@ const handleSelectionChange = (selection: any[]) => {
|
|||||||
|
|
||||||
//查询
|
//查询
|
||||||
const handleSearch = () => {
|
const handleSearch = () => {
|
||||||
console.log('handleSearch,getBoundPqDevList')
|
//console.log('handleSearch,getBoundPqDevList')
|
||||||
proTable.value?.getTableList()
|
proTable.value?.getTableList()
|
||||||
}
|
}
|
||||||
//重置
|
//重置
|
||||||
const handleRefresh = () => {
|
const handleRefresh = () => {
|
||||||
console.log('handleRefresh,getBoundPqDevList')
|
//console.log('handleRefresh,getBoundPqDevList')
|
||||||
form.value.search = null
|
form.value.search = null
|
||||||
form.value.checkStatus = null
|
form.value.checkStatus = null
|
||||||
form.value.checkResult = null
|
form.value.checkResult = null
|
||||||
|
|||||||
@@ -55,30 +55,34 @@ const searchForm = ref({
|
|||||||
planName: '',
|
planName: '',
|
||||||
})
|
})
|
||||||
const defaultChecked = ref<string[]>([]) // 明确类型为 number[]
|
const defaultChecked = ref<string[]>([]) // 明确类型为 number[]
|
||||||
|
const tree = ref(false)//确保左侧树高凉只执行一次
|
||||||
const getTreeData = (val: any) => {
|
const getTreeData = (val: any) => {
|
||||||
|
defaultChecked.value = [];
|
||||||
defaultChecked.value = []
|
data.value = val;
|
||||||
data.value = val
|
|
||||||
if (data.value.length > 0 && data.value[0].children.length > 0) {
|
|
||||||
let node = data.value[0].children[0]
|
|
||||||
defaultChecked.value.push(node.id)
|
|
||||||
checkStore.setPlanId(node.id)
|
|
||||||
checkStore.setPlanCode(node.code)
|
|
||||||
checkStore.setScriptId(node.scriptId)
|
|
||||||
checkStore.setErrorSysId(node.errorSysId)
|
|
||||||
// 高亮显示第一个节点
|
|
||||||
// 使用 nextTick 确保在 DOM 更新后调用 setCurrentKey
|
|
||||||
nextTick(() => {
|
|
||||||
treeRef.value?.setCurrentKey(node.id);
|
|
||||||
idd.value = node.id
|
|
||||||
});
|
|
||||||
//console.log(checkStore.planId,checkStore.planCode,checkStore.scriptId,checkStore.errorSysId)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
for (let item of data.value) {
|
||||||
|
if (item.children.length > 0) {
|
||||||
|
let node = item.children[0];
|
||||||
|
defaultChecked.value.push(node.id);
|
||||||
|
checkStore.setPlanId(node.id);
|
||||||
|
checkStore.setPlanCode(node.code);
|
||||||
|
checkStore.setScriptId(node.scriptId);
|
||||||
|
checkStore.setErrorSysId(node.errorSysId);
|
||||||
|
// 高亮显示第一个节点
|
||||||
|
// 使用 nextTick 确保在 DOM 更新后调用 setCurrentKey
|
||||||
|
nextTick(() => {
|
||||||
|
treeRef.value?.setCurrentKey(node.id);
|
||||||
|
idd.value = node.id;
|
||||||
|
});
|
||||||
|
// 找到第一个符合条件的 children 后跳出循环
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//点击表格后左侧树刷新,高亮显示对应节点
|
//点击表格后左侧树刷新,高亮显示对应节点
|
||||||
const clickTableToTree = (val: any,id:any) => {
|
const clickTableToTree = (val: any,id:any) => {
|
||||||
|
|
||||||
defaultChecked.value = []
|
defaultChecked.value = []
|
||||||
data.value = val
|
data.value = val
|
||||||
let node = ref('')
|
let node = ref('')
|
||||||
@@ -116,14 +120,14 @@ watch(
|
|||||||
|
|
||||||
const idd = ref('')
|
const idd = ref('')
|
||||||
const handleNodeClick = (data: Plan.ResPlan) => {
|
const handleNodeClick = (data: Plan.ResPlan) => {
|
||||||
|
|
||||||
if (data.name === '未检' || data.name === '检测中' || data.name === '检测完成') {
|
if (data.name === '未检' || data.name === '检测中' || data.name === '检测完成') {
|
||||||
// 如果是父节点,不执行任何操作
|
// 如果是父节点,不执行任何操作
|
||||||
//console.log('父节点不执行任何操作');
|
//console.log('父节点不执行任何操作');
|
||||||
// 设置当前高亮节点
|
// 设置当前高亮节点
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
treeRef.value?.setCurrentKey(idd.value);
|
treeRef.value?.setCurrentKey(idd.value);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -399,7 +399,6 @@ const getPieData = async (id: string) => {
|
|||||||
pieRef3.value.init()
|
pieRef3.value.init()
|
||||||
}
|
}
|
||||||
const getTree = (data?: any) => {
|
const getTree = (data?: any) => {
|
||||||
|
|
||||||
treeRef.value.getTreeData(data)
|
treeRef.value.getTreeData(data)
|
||||||
}
|
}
|
||||||
//前往检测
|
//前往检测
|
||||||
|
|||||||
Reference in New Issue
Block a user