1
lzhe
2024-06-03 a786409d7f6769f43c107159dd84faf4a2927a9a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<template>
    <promoter v-if="nodeConfig.type==0" v-model="nodeConfig"></promoter>
 
    <approver v-if="nodeConfig.type==1" v-model="nodeConfig"></approver>
 
    <send v-if="nodeConfig.type==2" v-model="nodeConfig"></send>
 
    <branch v-if="nodeConfig.type==4" v-model="nodeConfig">
        <template v-slot="slot">
            <node-wrap v-if="slot.node" v-model="slot.node.childNode"></node-wrap>
        </template>
    </branch>
 
    <node-wrap v-if="nodeConfig.childNode" v-model="nodeConfig.childNode"></node-wrap>
 
</template>
 
<script>
    import approver from './nodes/approver'
    import promoter from './nodes/promoter'
    import branch from './nodes/branch'
    import send from './nodes/send'
 
    export default {
        props: {
            modelValue: { type: Object, default: () => {} }
        },
        components: {
            approver,
            promoter,
            branch,
            send
        },
        data() {
            return {
                nodeConfig: {},
            }
        },
        watch:{
            modelValue(val){
                this.nodeConfig = val
            },
            nodeConfig(val){
                this.$emit("update:modelValue", val)
            }
        },
        mounted() {
            this.nodeConfig = this.modelValue
        },
        methods: {
 
        }
    }
</script>
 
<style>
</style>