优化检测脚本样式
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { TestScript } from '@/api/device/interface/testScript'
|
||||
import http from '@/api'
|
||||
import { Loading } from '@element-plus/icons-vue'
|
||||
|
||||
/**
|
||||
* @name 检测脚本管理模块
|
||||
@@ -48,5 +49,5 @@ export const scriptDtlsCheckDataList = (params: any) => {
|
||||
}
|
||||
// 通讯脚本回显
|
||||
export const checkDataList = (params: any) => {
|
||||
return http.post(`/pqScript/checkDataList`, params)
|
||||
return http.post(`/pqScript/checkDataList`, params, { loading: true })
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import http from '@/api'
|
||||
import { type Dict } from '@/api/system/dictionary/interface'
|
||||
import {c} from "vite/dist/node/types.d-aGj9QkWt";
|
||||
import { c } from 'vite/dist/node/types.d-aGj9QkWt'
|
||||
|
||||
//获取字典类型
|
||||
export const getDictTreeByCode = (params: Dict.ResDictTree) => {
|
||||
const code = params.code || '';
|
||||
return http.get(`/dictTree/getTreeByCode?code=${code}`)
|
||||
const code = params.code || ''
|
||||
return http.get(`/dictTree/getTreeByCode?code=${code}`, { loading: true })
|
||||
}
|
||||
|
||||
export const getDictTreeByName = (params: Dict.ResDictTree) => {
|
||||
const name = params.name || '';
|
||||
const name = params.name || ''
|
||||
return http.get(`/dictTree/getTreeByName?name=${name}`)
|
||||
}
|
||||
|
||||
@@ -27,4 +27,3 @@ export const updateDictTree = (params: Dict.ResDictTree) => {
|
||||
export const deleteDictTree = (params: Dict.ResDictTree) => {
|
||||
return http.post(`/dictTree/delete?id=${params.id}`)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
@node-click="handleNodeClick"
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
<el-tooltip effect="dark" :content="data.scriptTypeName || data.sourceDesc" placement="top" :hide-after="0">
|
||||
<el-tooltip effect="dark" :content="data.sourceDesc || data.scriptTypeName" placement="top" :hide-after="0">
|
||||
<div class="custom-tree-node">
|
||||
{{ data.scriptTypeName || data.sourceDesc }}
|
||||
</div>
|
||||
@@ -34,19 +34,27 @@ const defaultProps = {
|
||||
label: 'scriptTypeName',
|
||||
pid: 'pid'
|
||||
}
|
||||
const activeName = ref('')
|
||||
const childActiveName = ref('')
|
||||
const handleNodeClick = (data, node) => {
|
||||
let code = ['Base', 'VOL', 'Freq', 'Harm', 'Base_0_10', 'Base_20_85', 'Base_110_200']
|
||||
const parents = getParentNodes(node, [])
|
||||
parents.pop()
|
||||
parents.unshift(node.data)
|
||||
parents.reverse()
|
||||
let active = parents[0].scriptTypeCode
|
||||
let childActive = findTargetCodes(parents, code)[0] || ''
|
||||
// 获取当前节点的直接父节点
|
||||
|
||||
if (activeName.value != active || childActiveName.value != childActive) {
|
||||
activeName.value = active
|
||||
childActiveName.value = childActive
|
||||
emit('setTab', {
|
||||
activeName: parents[0].scriptTypeCode,
|
||||
childActiveName: findTargetCodes(parents, code)[0] || ''
|
||||
activeName: active,
|
||||
childActiveName: childActive
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 返回父级
|
||||
const getParentNodes = (node, parents) => {
|
||||
if (node.parent) {
|
||||
|
||||
Reference in New Issue
Block a user