Merge pull request 'zhuhao_dev' (#399) from zhuhao_dev into main
Reviewed-on: #399
This commit is contained in:
commit
169d6d7c31
|
@ -2,7 +2,7 @@
|
|||
<div style="padding: 10px;">
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
width="30%"
|
||||
width="350"
|
||||
append-to-body
|
||||
>
|
||||
<div style="display: flex;justify-content: center;">
|
||||
|
@ -17,18 +17,20 @@
|
|||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup>
|
||||
import { ref, defineExpose } from 'vue'
|
||||
import ChooseTextbook from '@/components/choose-textbook/index.vue'
|
||||
|
||||
|
||||
const emit = defineEmits(['onsuccess'])
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const getNodeInfo = ref([])
|
||||
|
||||
|
||||
const openDialog = () => {
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
|
||||
const getFullObj = (node) => {
|
||||
const obj = []
|
||||
const recursive = (currentNode) => {
|
||||
|
@ -43,17 +45,17 @@
|
|||
recursive(node)
|
||||
return obj
|
||||
}
|
||||
|
||||
|
||||
const nodeClick = (data) => {
|
||||
getNodeInfo.value = getFullObj(data.node)
|
||||
console.log(getNodeInfo.value, 'getNodeInfo.value')
|
||||
}
|
||||
|
||||
|
||||
const save = () => {
|
||||
dialogVisible.value = false
|
||||
emit('onsuccess', getNodeInfo.value)
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
openDialog
|
||||
})
|
||||
</script>
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue