设备类型CRUD
This commit is contained in:
@@ -54,7 +54,7 @@ export const importCNDev = (params: Device.ReqPqDevParams) => {
|
||||
}
|
||||
//根据设备类型决定(电源、icd、模板、通道数、额定电压、额定电流);
|
||||
export const getPqDev = () => {
|
||||
return http.post(`/devType/listAll`)
|
||||
return http.get(`/devType/listAll`)
|
||||
}
|
||||
|
||||
//被检设备归档
|
||||
|
||||
@@ -482,7 +482,7 @@ const getTableList = async (params: any) => {
|
||||
} else {
|
||||
checkStateList.value = checkStateTable.value
|
||||
}
|
||||
console.log('table,getBoundPqDevList')
|
||||
//console.log('table,getBoundPqDevList')
|
||||
return getBoundPqDevList({
|
||||
'planId': props.id,
|
||||
'checkStateList': checkStateList.value,
|
||||
@@ -667,12 +667,12 @@ const handleSelectionChange = (selection: any[]) => {
|
||||
|
||||
//查询
|
||||
const handleSearch = () => {
|
||||
console.log('handleSearch,getBoundPqDevList')
|
||||
//console.log('handleSearch,getBoundPqDevList')
|
||||
proTable.value?.getTableList()
|
||||
}
|
||||
//重置
|
||||
const handleRefresh = () => {
|
||||
console.log('handleRefresh,getBoundPqDevList')
|
||||
//console.log('handleRefresh,getBoundPqDevList')
|
||||
form.value.search = null
|
||||
form.value.checkStatus = null
|
||||
form.value.checkResult = null
|
||||
|
||||
@@ -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('')
|
||||
|
||||
@@ -399,7 +399,6 @@ const getPieData = async (id: string) => {
|
||||
pieRef3.value.init()
|
||||
}
|
||||
const getTree = (data?: any) => {
|
||||
|
||||
treeRef.value.getTreeData(data)
|
||||
}
|
||||
//前往检测
|
||||
|
||||
Reference in New Issue
Block a user