Compare commits

...

4 Commits

Author SHA1 Message Date
朱浩 169d6d7c31 Merge pull request 'zhuhao_dev' (#399) from zhuhao_dev into main
Reviewed-on: #399
2024-11-12 10:36:30 +08:00
朱浩 a75f880b30 添加回调 2024-11-12 10:35:45 +08:00
朱浩 e31904ed9f Merge branch 'main' into zhuhao_dev
# Conflicts:
#	package.json
2024-11-12 09:59:52 +08:00
朱浩 2d75ae6cb8 版本管理 2024-11-12 09:59:17 +08:00
1 changed files with 12 additions and 10 deletions

View File

@ -2,7 +2,7 @@
<div style="padding: 10px;"> <div style="padding: 10px;">
<el-dialog <el-dialog
v-model="dialogVisible" v-model="dialogVisible"
width="30%" width="350"
append-to-body append-to-body
> >
<div style="display: flex;justify-content: center;"> <div style="display: flex;justify-content: center;">
@ -17,18 +17,20 @@
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script setup> <script setup>
import { ref, defineExpose } from 'vue' import { ref, defineExpose } from 'vue'
import ChooseTextbook from '@/components/choose-textbook/index.vue' import ChooseTextbook from '@/components/choose-textbook/index.vue'
const emit = defineEmits(['onsuccess'])
const dialogVisible = ref(false) const dialogVisible = ref(false)
const getNodeInfo = ref([]) const getNodeInfo = ref([])
const openDialog = () => { const openDialog = () => {
dialogVisible.value = true dialogVisible.value = true
} }
const getFullObj = (node) => { const getFullObj = (node) => {
const obj = [] const obj = []
const recursive = (currentNode) => { const recursive = (currentNode) => {
@ -43,17 +45,17 @@
recursive(node) recursive(node)
return obj return obj
} }
const nodeClick = (data) => { const nodeClick = (data) => {
getNodeInfo.value = getFullObj(data.node) getNodeInfo.value = getFullObj(data.node)
console.log(getNodeInfo.value, 'getNodeInfo.value')
} }
const save = () => { const save = () => {
dialogVisible.value = false dialogVisible.value = false
emit('onsuccess', getNodeInfo.value)
} }
defineExpose({ defineExpose({
openDialog openDialog
}) })
</script> </script>