成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

vue.js如何生成S型拓?fù)鋱D

小編給大家分享一下vue.js如何生成S型拓?fù)鋱D,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

創(chuàng)新互聯(lián)在網(wǎng)站設(shè)計(jì)、網(wǎng)站制作、重慶APP開發(fā)、網(wǎng)站運(yùn)營等方面均有出色的表現(xiàn),憑借多年豐富的經(jīng)驗(yàn),我們會(huì)仔細(xì)了解各客戶的需求而做出多方面的分析、設(shè)計(jì)、整合,為客戶設(shè)計(jì)出具風(fēng)格及創(chuàng)意性的商業(yè)解決方案,我們更提供一系列成都全網(wǎng)營銷,網(wǎng)站制作和網(wǎng)站推廣的服務(wù),以推動(dòng)各中小企業(yè)全面信息化,并利用創(chuàng)新技術(shù)幫助各行業(yè)提升企業(yè)形象和運(yùn)營效率。

1.前端代碼

<link href="https://magicbox.bk.tencent.com/static_api/v3/assets/bootstrap-3.3.4/css/bootstrap.min.css" rel="stylesheet">
<link href="https://magicbox.bk.tencent.com/static_api/v3/assets/bkTopology-1.1/css/bkTopology.css" rel="stylesheet">

<script src="https://magicbox.bk.tencent.com/static_api/v3/assets/js/jquery-1.10.2.min.js"></script>
<script src="https://magicbox.bk.tencent.com/static_api/v3/assets/bootstrap-3.3.4/js/bootstrap.min.js"></script>
<script src="https://magicbox.bk.tencent.com/static_api/v3/assets/bkTopology-1.2/js/bkTopology.js"></script>

<div id="app" >
    <el-row :gutter="40">
        <el-col :span="16" :offset="4">
            <div class="none node" id="node-templates" data-container="body" data-placement="top" data-html="true" data-trigger="hover">
                <div class="node-container"><span class="node-text"></span></div>
            </div>
            <div class="bktopo-container">
                <div class="bktopo_demo" id="bktopo_demo">
                    <div class="none node" id="node-templates" data-container="body" data-placement="top" data-html="true" data-trigger="hover">
                        <div class="node-container"><span class="node-text"></span></div>
                    </div>
                    <div class="bktopo_box" ></div>
                </div>
            </div>
        </el-col>
    </el-row>
</div>
<script type="text/javascript">
    new Vue({
        el: '#app',
        data: {
        },
        mounted() {
            this.init()
        },
        methods: {
            init() {
                axios.get(site_url + "topo/").then(res => {
                    if (res.data.result){
                        $('#bktopo_demo .bktopo_box').bkTopology({
                            data: res.data.data, //配置數(shù)據(jù)源
                            lineType:[ //配置線條的類型
                                {type:'success',lineColor:'#46C37B'},
                                {type:'info',lineColor:'#4A9BFF'},
                                {type:'warning',lineColor:'#f0a63a'},
                                {type:'danger',lineColor:'#c94d3c'},
                                {type:'default',lineColor:'#aaa'}
                            ]
                        });
                    }else{
                        this.$message.error('獲取拓樸數(shù)據(jù)失敗');
                    }
                },'json');
            }
        }
    })
</script>

2.后端代碼

def topo(request):
    data = {
        "nodes": [
            {
                "id": "demo3_node1", "x": 100, "y": 50, "height": 50,
                "width": 100, "text": "發(fā)起", "className": "node success"
            },
            {
                "id": "demo3_node2", "x": 250, "y": 50, "height": 50,
                "width": 100, "text": "過程1", "className": "node success"
            },
            {
                "id": "demo3_node3", "x": 400, "y": 50, "height": 50,
                "width": 100, "text": "過程2", "className": "node danger"
            },
            {
                "id": "demo3_node4", "x": 550, "y": 50, "height": 50,
                "width": 100, "text": "過程3", "className": "node success"
            },
            {
                "id": "demo3_node5", "x": 550, "y": 150, "height": 50,
                "width": 100, "text": "過程4", "className": "node success"
            },
            {
                "id": "demo3_node6", "x": 400, "y": 150, "height": 50,
                "width": 100, "text": "過程5", "className": "node warning"
            },
            {
                "id": "demo3_node7", "x": 250, "y": 150, "height": 50,
                "width": 100, "text": "過程6", "className": "node success"
            },
            {
                "id": "demo3_node8", "x": 100, "y": 150, "height": 50,
                "width": 100, "text": "過程7", "className": "node success"
            },
        ],
        "edges": [
            {
                "source": "demo3_node1", "sDirection": 'right',
                "target": "demo3_node2", "tDirection": 'left', "edgesType": "success"
            },
            {
                "source": "demo3_node2", "sDirection": 'right',
                "target": "demo3_node3", "tDirection": 'left', "edgesType": "danger"
            },
            {
                "source": "demo3_node3", "sDirection": 'right',
                "target": "demo3_node4", "tDirection": 'left', "edgesType": "success"
            },
            {
                "source": "demo3_node4", "sDirection": 'right',
                "target": "demo3_node5", "tDirection": 'right', "edgesType": "success"
            },
            {
                "source": "demo3_node5", "sDirection": 'right',
                "target": "demo3_node6", "tDirection": 'right', "edgesType": "warning"
            },
            {
                "source": "demo3_node6", "sDirection": 'right',
                "target": "demo3_node7", "tDirection": 'right', "edgesType": "success"
            },
            {
                "source": "demo3_node7", "sDirection": 'right',
                "target": "demo3_node8", "tDirection": 'right', "edgesType": "success"
            },
        ]
    }
    return JsonResponse({"result": True, "data": data})

顯示效果

vue.js如何生成S型拓?fù)鋱D

以上是“vue.js如何生成S型拓?fù)鋱D”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學(xué)習(xí)更多知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!

當(dāng)前標(biāo)題:vue.js如何生成S型拓?fù)鋱D
文章鏈接:http://jinyejixie.com/article24/ggecje.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站策劃、網(wǎng)站收錄網(wǎng)頁設(shè)計(jì)公司、品牌網(wǎng)站制作App開發(fā)、網(wǎng)站營銷

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站建設(shè)網(wǎng)站維護(hù)公司
克东县| 星座| 丹凤县| 防城港市| 栖霞市| 都兰县| 无锡市| 六安市| 怀仁县| 精河县| 陆丰市| 额尔古纳市| 孝义市| 台湾省| 张家界市| 西丰县| 新营市| 高州市| 方城县| 台中县| 益阳市| 勐海县| 闸北区| 卫辉市| 百色市| 大姚县| 易门县| 凉山| 马公市| 广平县| 古田县| 太康县| 马尔康县| 新疆| 轮台县| 融水| 大港区| 民和| 天峨县| 华容县| 呼和浩特市|