设备类型CRUD

This commit is contained in:
sjl
2025-02-11 10:32:09 +08:00
parent 4fcb26bbde
commit e46e9e1d3a
4 changed files with 34 additions and 31 deletions

View File

@@ -54,7 +54,7 @@ export const importCNDev = (params: Device.ReqPqDevParams) => {
}
//根据设备类型决定电源、icd、模板、通道数、额定电压、额定电流
export const getPqDev = () => {
return http.post(`/devType/listAll`)
return http.get(`/devType/listAll`)
}
//被检设备归档

View File

@@ -482,7 +482,7 @@ const getTableList = async (params: any) => {
} else {
checkStateList.value = checkStateTable.value
}
console.log('tablegetBoundPqDevList')
//console.log('tablegetBoundPqDevList')
return getBoundPqDevList({
'planId': props.id,
'checkStateList': checkStateList.value,
@@ -667,12 +667,12 @@ const handleSelectionChange = (selection: any[]) => {
//查询
const handleSearch = () => {
console.log('handleSearchgetBoundPqDevList')
//console.log('handleSearchgetBoundPqDevList')
proTable.value?.getTableList()
}
//重置
const handleRefresh = () => {
console.log('handleRefreshgetBoundPqDevList')
//console.log('handleRefreshgetBoundPqDevList')
form.value.search = null
form.value.checkStatus = null
form.value.checkResult = null

View File

@@ -55,30 +55,34 @@ const searchForm = ref({
planName: '',
})
const defaultChecked = ref<string[]>([]) // 明确类型为 number[]
const tree = ref(false)//确保左侧树高凉只执行一次
const getTreeData = (val: any) => {
defaultChecked.value = [];
data.value = val;
defaultChecked.value = []
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)
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
idd.value = node.id;
});
//console.log(checkStore.planId,checkStore.planCode,checkStore.scriptId,checkStore.errorSysId)
// 找到第一个符合条件的 children 后跳出循环
break;
}
}
}
//点击表格后左侧树刷新,高亮显示对应节点
const clickTableToTree = (val: any,id:any) => {
defaultChecked.value = []
data.value = val
let node = ref('')

View File

@@ -399,7 +399,6 @@ const getPieData = async (id: string) => {
pieRef3.value.init()
}
const getTree = (data?: any) => {
treeRef.value.getTreeData(data)
}
//前往检测