Front-end vue uni-app imitation enterprise Chacha, Tianyancha affiliated investment institution equity structure tree structure holding structure

With the development of technology, the complexity of development is getting higher and higher. The traditional development method makes a system into a whole application. It often happens that a small change or the addition of a small function may cause the overall logic to change. The modification affects the whole body. Through component development, individual development and maintenance can be effectively achieved, and they can be combined at will. Greatly improve low development efficiency and reduce maintenance costs.

Componentization is the only way for any front-end application with complex business scenarios and products after multiple iterations. Componentization requires more than just the module splitting and decoupling seen on the surface. There is also a lot of work behind it to support componentization, such as module splitting strategies based on business characteristics, interaction methods between modules, and building systems. etc.

The components introduced in this article are:

Quickly realize the vue uni-app front-end imitation enterprise Chacha and Tianyancha affiliated investment institutions equity structure tree structure holding structure . To download, please visit the uni-app plug-in market: https://ext.dcloud.net.cn/plugin?id= 12073

 For more information on front-end components, please follow the WeChat public account: Front-end component development

The renderings are as follows:

488a8d8f98d644cd88d694c1f7aa14f4.png

 # Front-end imitation enterprise Chacha, Tianyancha affiliated investment institutions equity structure tree structure holding structure


#### How to use 
```How to use

    <!-- treeName: Theme name of the tree structure treeData: The filling data of the tree structure -->
        <CCBCashTree v-if="(curTreeName.length > 0)" :treeName="curTreeName" :treeData="curTreeData" >
        </CCBCashTree>


```

#### HTML code part```html
<template>
<
    view class="content">
        
        <!-- treeName: the theme name of the tree structure treeData: the filling data of the tree structure -->
        <CCBCashTree v-if ="(curTreeName.length > 0)" :treeName="curTreeName" :treeData="curTreeData">
        </CCBCashTree>


    </view>
</template>


```

#### JS code (introducing component filling data)
```javascript
<script>
    import CCBCashTree from '@/components/CCBCashTree.vue'

    export default {
        components: {


            CCBCashTree


        },
        data() {
            return {
                title: 'Hello',
                curTreeName: '',
                curTreeData: []
            }
        },
        onLoad() {


            this.curTreeName = "Guangzhou Automobile Group Co., Ltd.";

            let tmpArr = [];
            for (let i = 0; i < 4; i++) {                 // Simulate corporate holding data                 let s = {                     'ratio': '20%',                     'amount': '10 million',                     'label ': 'Guangzhou|Advanced Manufacturing|High Technology',                     'investName': 'Guangzhou Automobile Industry Group Co., Ltd.' + i,                     'investType': '0',                     'invests':[{'ratio': '20%' ,                     'amount': '1000 million',                     'label': 'Guangzhou | Automobile | High-tech',                     'investName': 'GAC Toyota Co., Ltd.',                     'investType': '0',},                     {'ratio': '10%',                     'amount': '90000万',
                














                    'label': 'Guangzhou | Industry | High-tech',
                    'investName': 'China National Machinery Industry Group Co., Ltd.',
                    'investType': '0',},
                    
                    {'ratio': '10%',
                    'amount': '9 million',
                    'label': 'shareholder',
                    'investName': 'Zeng Qinghong',
                    'investType': '1',},
                    {'ratio': '10%',
                    'amount': '9 million',
                    'label': 'Shareholder',
                    'investName': 'Wu Song',
                    'investType':'1',}]
                    
                };
                
                
                let tmpDict = Object.assign(s, {                     "isOpen": false

                });
                tmpArr.push(tmpDict);
                
            }
            
            // Simulate personal holding data
            let t = {                 'ratio': '10%',                 'amount': '9 million',                 'label': 'shareholder',                 'investName' : 'Zeng Qinghong',                 'investType': '1',                 'invests':[]             };             let tmpDict = Object.assign(t, {                 "isOpen": false             });             tmpArr.push(tmpDict);






                




            this.curTreeData = tmpArr;
        },
        methods: {

        }
    }
</script>


```

#### CSS 
```CSS
<style>
    
    page{
        background-color: #f6f6f6;
        
    }
    .content {
        display: flex;
        flex-direction: column;

    }


    
</style>

```

Guess you like

Origin blog.csdn.net/chenchuang0128/article/details/130773970