双击详情完成
This commit is contained in:
@@ -232,7 +232,10 @@
|
||||
<!-- w2:轮次的问题单ma-crud,这里要传参2个,首先是请求另外一个接口,然后取消是否关联字段 -->
|
||||
<problem-choose ref="problemRoundRef" hasRelated="roundProblem" :title="problemTitle"></problem-choose>
|
||||
<!-- 下面都是对应被测件、设计需求、测试项、测试用例、问题单的SubForm -->
|
||||
<DutSubForm ref="dutSubFormRef"></DutSubForm>
|
||||
<DutSubForm ref="dutSubFormRef" />
|
||||
<DesignSubForm ref="designSubFormRef" />
|
||||
<TestDemandSubForm ref="testDemandSubFormRef" />
|
||||
<CaseSubForm ref="caseSubFormRef" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -250,6 +253,9 @@ import { storeToRefs } from "pinia"
|
||||
import Progress from "@/views/testmanage/projmanage/cpns/progress.vue"
|
||||
// 导入单独节点类型单独对应的Modal组件
|
||||
import DutSubForm from "@/views/project/round/DutSubForm"
|
||||
import DesignSubForm from "@/views/project/dut/DesignSubForm"
|
||||
import TestDemandSubForm from "@/views/project/design-demand/DemandSubForm"
|
||||
import CaseSubForm from "@/views/project/testDemand/CaseSubForm"
|
||||
// hooks模块化
|
||||
import useTreeDrag from "@/layout/treeHooks/treeDrag.js"
|
||||
import { useRightClick } from "./treeHooks/rightClick"
|
||||
@@ -296,7 +302,8 @@ const {
|
||||
const { expandedKeys, toggleExpanded } = useNodeExpand()
|
||||
|
||||
//~~~~~~大功能:单击/双击节点逻辑~~~~~~
|
||||
const { selectedKeys, pointNode, dutSubFormRef } = useNodeClick(expandedKeys)
|
||||
const { selectedKeys, pointNode, dutSubFormRef, designSubFormRef, testDemandSubFormRef, caseSubFormRef } =
|
||||
useNodeClick(expandedKeys)
|
||||
|
||||
//~~~~~~大功能:动态加载a-tree节点函数~~~~~~
|
||||
const { loadMore } = useLoadTreeNode()
|
||||
|
||||
@@ -6,6 +6,9 @@ import { storeToRefs } from "pinia"
|
||||
import { useRouter } from "vue-router"
|
||||
// 导入组件用于类型
|
||||
import type { DutSubFormInstance } from "@/views/project/round/DutSubForm"
|
||||
import type { DesignSubFormInstance } from "@/views/project/dut/DesignSubForm"
|
||||
import type { DemandSubFormInstance } from "@/views/project/design-demand/DemandSubForm"
|
||||
import type { CaseSubFormInstance } from "@/views/project/testDemand/CaseSubForm"
|
||||
export default function useNodeClick(expandedKeys: Ref<string[]>) {
|
||||
// global
|
||||
const route = useRoute()
|
||||
@@ -21,6 +24,9 @@ export default function useNodeClick(expandedKeys: Ref<string[]>) {
|
||||
const previousKey = ref<any>() // 上一次点击
|
||||
// SubFormRefs
|
||||
const dutSubFormRef = ref<DutSubFormInstance | null>(null)
|
||||
const designSubFormRef = ref<DesignSubFormInstance | null>(null)
|
||||
const testDemandSubFormRef = ref<DemandSubFormInstance | null>(null)
|
||||
const caseSubFormRef = ref<CaseSubFormInstance | null>(null)
|
||||
// 点击节点事件
|
||||
const pointNode = (value: any, data: any) => {
|
||||
// 获取处理单击不选中,双击选中的变量
|
||||
@@ -47,8 +53,13 @@ export default function useNodeClick(expandedKeys: Ref<string[]>) {
|
||||
dutSubFormRef.value!.open(data.node)
|
||||
}
|
||||
if (data.node.level == "2") {
|
||||
designSubFormRef.value!.open(data.node)
|
||||
}
|
||||
if (data.node.level == "3") {
|
||||
testDemandSubFormRef.value!.open(data.node)
|
||||
}
|
||||
if (data.node.level == "4") {
|
||||
caseSubFormRef.value!.open(data.node)
|
||||
}
|
||||
count = 0
|
||||
if (timerId) clearTimeout(timerId)
|
||||
@@ -87,6 +98,9 @@ export default function useNodeClick(expandedKeys: Ref<string[]>) {
|
||||
return {
|
||||
selectedKeys,
|
||||
pointNode,
|
||||
dutSubFormRef
|
||||
dutSubFormRef,
|
||||
designSubFormRef,
|
||||
testDemandSubFormRef,
|
||||
caseSubFormRef
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user