ts/src/views/Daodan/index.jsx

52 lines
1.3 KiB
React
Raw Normal View History

2025-02-11 02:56:16 +00:00
import Tree from '@/components/Tree/index.vue'
import { useDaodan } from './ddHooks'
import { NButton } from 'naive-ui'
2025-02-14 08:33:28 +00:00
import { useTestConfig } from './components/hooks/testHooks'
2025-02-19 08:06:46 +00:00
import { onMounted } from 'vue'
2025-01-23 01:05:13 +00:00
export default defineComponent({
setup() {
2025-02-19 08:06:46 +00:00
const { treeData, isLoading, showOrHideDdConfig, getDaodanTreeData } =
useDaodan()
onMounted(() => {
getDaodanTreeData()
})
2025-02-11 02:56:16 +00:00
const renderSuffix = ({ option }) => {
if (!option.data) {
return undefined
}
return (
<>
<NButton
type="info"
text
size="tiny"
onClick={() => showOrHideDdConfig(option.data)}
>
试验配置
</NButton>
</>
)
}
2025-01-23 01:05:13 +00:00
return () => (
2025-02-11 02:56:16 +00:00
<div class="w-h-full" v-loading={isLoading.value}>
2025-02-14 08:33:28 +00:00
{/* <NButton type="primary" onClick={showOrHideDdConfig}>
aaaaa
</NButton> */}
2025-02-11 02:56:16 +00:00
<Tree
data={treeData.value}
key-field="dataId"
label-field="nodeName"
// v-model:checked="checkedKeys"
// defaultCheckedKeys="allKeys"
checkable={false}
showSearch
renderSuffix={renderSuffix}
// nodeProps={nodeProps}
/>
2025-01-23 01:05:13 +00:00
</div>
)
},
})