|
@@ -10,18 +10,15 @@
|
|
<div class="dialog-tree-box">
|
|
<div class="dialog-tree-box">
|
|
<el-scrollbar>
|
|
<el-scrollbar>
|
|
<!-- 试验检测树 -->
|
|
<!-- 试验检测树 -->
|
|
- <ElTree v-if="fileModalradio==1"
|
|
|
|
- :indent="0"
|
|
|
|
- :load="ElTreeLoadNode"
|
|
|
|
- :props="ElTreeProps"
|
|
|
|
- accordion
|
|
|
|
- class="hc-tree-node tree-line"
|
|
|
|
- highlight-current
|
|
|
|
- lazy
|
|
|
|
- node-key="primaryKeyId"
|
|
|
|
- @node-click="fileModalElTreeClick"
|
|
|
|
|
|
+ <TestTree v-if="fileModalradio==1"
|
|
|
|
+ :contractId="contractId"
|
|
|
|
+ :projectId="projectId"
|
|
|
|
+ :tenantId="tenant_id"
|
|
|
|
+ :wbsId="wbsTempId"
|
|
|
|
+ :wbsType="wbs_type"
|
|
|
|
+ @nodeTap="fileModalElTreeClick"
|
|
>
|
|
>
|
|
- </ElTree>
|
|
|
|
|
|
+ </TestTree>
|
|
<!-- 第三方树 -->
|
|
<!-- 第三方树 -->
|
|
<ElTree
|
|
<ElTree
|
|
v-else
|
|
v-else
|
|
@@ -86,6 +83,7 @@ import {getArrValue, isItem} from "vue-utils-plus"
|
|
import {getTreeAll} from "~api/tentative/detect";
|
|
import {getTreeAll} from "~api/tentative/detect";
|
|
import thirdApi from "~api/tentative/detect/third";
|
|
import thirdApi from "~api/tentative/detect/third";
|
|
import samplingApi from "~api/tentative/material/sampling";
|
|
import samplingApi from "~api/tentative/material/sampling";
|
|
|
|
+import TestTree from "./testTree.vue"
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
projectId: [String, Number],
|
|
projectId: [String, Number],
|
|
@@ -128,54 +126,7 @@ const ElTreeProps = ref({
|
|
children: 'children',
|
|
children: 'children',
|
|
isLeaf: 'hasChildren'
|
|
isLeaf: 'hasChildren'
|
|
})
|
|
})
|
|
-const ElTreeLoadNode = async (node, resolve) => {
|
|
|
|
- let parentId = '0';
|
|
|
|
- if (node.level !== 0) {
|
|
|
|
- parentId = node?.data?.id
|
|
|
|
- }
|
|
|
|
- //获取数据
|
|
|
|
- const {error, code, data} = await samplingApi.queryLazyTree({
|
|
|
|
- wbsId: wbsTempId.value,
|
|
|
|
- tenantId: tenant_id.value,
|
|
|
|
- projectId: projectId.value,
|
|
|
|
- parentId,
|
|
|
|
- wbsType: wbs_type.value
|
|
|
|
- })
|
|
|
|
- //处理数据
|
|
|
|
- if (!error && code === 200) {
|
|
|
|
- let clickKey = '', defaultExpandedArr = [];
|
|
|
|
- const keys = CTDTreeAutoExpandKeys.value || []
|
|
|
|
- const resData = getArrValue(data)
|
|
|
|
- for (let i = 0; i < resData.length; i++) {
|
|
|
|
- resData[i].hasChildren = !resData[i].hasChildren
|
|
|
|
- }
|
|
|
|
- if (keys.length > 0) {
|
|
|
|
- let lastKey = keys[keys.length - 1];
|
|
|
|
- for (const item of resData) {
|
|
|
|
- //自动展开
|
|
|
|
- if (isItem(keys, item?.primaryKeyId)) {
|
|
|
|
- defaultExpandedArr.push(item?.primaryKeyId)
|
|
|
|
- }
|
|
|
|
- //最后一个,选中点击
|
|
|
|
- if (item?.primaryKeyId === lastKey) {
|
|
|
|
- clickKey = item?.primaryKeyId
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- } else if (node.level === 0) {
|
|
|
|
- defaultExpandedArr.push(resData[0]?.primaryKeyId)
|
|
|
|
- }
|
|
|
|
- //自动展开
|
|
|
|
- defaultExpandedCids.value = defaultExpandedArr
|
|
|
|
- if (node.level === 0) {
|
|
|
|
- if (resData.length <= 0) {
|
|
|
|
- window?.$message?.warning('该项目未使用试验系统,无法获取数据')
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- resolve(resData)
|
|
|
|
- } else {
|
|
|
|
- resolve([])
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
+
|
|
|
|
|
|
//关联试验文件
|
|
//关联试验文件
|
|
const filedialogTableData = ref([])
|
|
const filedialogTableData = ref([])
|
|
@@ -199,7 +150,7 @@ const fileTableColumn = ref([
|
|
{key: 'detectionResultName', name: '检测结果'},
|
|
{key: 'detectionResultName', name: '检测结果'},
|
|
])
|
|
])
|
|
|
|
|
|
-const fileModalElTreeClick = async (data, node) => {
|
|
|
|
|
|
+const fileModalElTreeClick = async ({data, node}) => {
|
|
filenodeItemInfo.value = node
|
|
filenodeItemInfo.value = node
|
|
filenodeDataInfo.value = data
|
|
filenodeDataInfo.value = data
|
|
getfileNodeData()
|
|
getfileNodeData()
|