首頁  >  文章  >  web前端  >  基於bootstrap的UI框架有哪些

基於bootstrap的UI框架有哪些

藏色散人
藏色散人原創
2020-11-09 11:34:533728瀏覽

基於bootstrap的UI框架有:1、AdminLTE框架;2、ACE框架;3、clearmin框架;4、h-ui框架;5、Echats框架等等。

基於bootstrap的UI框架有哪些

推薦:《bootstrap教程

淺聊目前基於bootstrap框架的幾個主流前端框架

一  概述

#當新開發專案或產品時,技術選型是不可缺少的環節,在軟體架構中有著舉足輕重的作用,可以這麼說,技術選型的好壞直接影響專案或產品的成敗優劣,因此,在進行軟體架構時,一定要想好技術選型。 傳統的前後端耦合在一起的模式,基本上無法滿足當前環境下的大數據,高並發等需求,如.NET 的WebForm模式逐漸被MVC取代,MVC逐漸取代WebForm,其中有兩點重要的原因:MVC前後端徹底分離和MVC通用性比較好。從架構的架構,我們把軟體架構抽象化為兩個部分,即前端和後端,兩者透過介面來傳遞資料。但在這篇文章中,不談架構,只是與大家分享幾個基於Bootsrap的比較主流的前端框架。

 目前幾種比較流行的前端框架

(一)AdminLTE

 1.參考網址:https://adminlte.io/

# 2.開源

 3.Bootstrap3架構

 4.輕量級

 5.完全響應式,支援客製化

 6.github:https://github.com/almasaeed2010/AdminLTE

(二)ACE框架

 

 1.參考網址:http://ace.jeka.by/

 2.Twitter bootstrap3開發的後台範本

3.開源

 4.github:https://github.com/bopoda/ace

(三)clearmin

 

# 1 .參考網址:http://cm.paomedia.com/

 2.基於Bootstrap3框架開發的

 3.github:https://github.com/paomedia/clearmin

(四)h-ui

 

 1.參考網址:http://www.h-ui.net/H-ui.admin.shtml

 2.H-ui.admin是用H-ui前端框架開發的輕量級網站後台模版採用源生html語言,完全免費,簡單靈活,兼容性好讓您快速搭建中小型網站後台

(五)Echats

1.參考網址:http://echarts.baidu.com/

2.由百度團隊開發,完全用js開發,功能強大,各種型別報表

三Echarts架構圖

如上雖然我給大家推薦了五套前端框架,但筆者推薦AdminLTE H-ui Echarts組合模式,這也是我目前在軟體架構中運用到的組合模式。

Echarts框架

 

#四  用Echarts做個報表統計

#(一)先看看DEMO效果圖

動態效果

 1.支援多種動報表切換,如Line,Bar等;

 2.具有隱藏/顯示按鈕;

 3.具有資料表格功能;

 4.具有圖示儲存功能。

(二) 前端Code

1.定義一個p容器

1 fcd91d75aeec58fde99e1ec03869a41094b3e26ee717c64999d7867364b1b4a3

2.初始化

1 var myChart = echarts.init(document.getElementById('EchartsBarDemo'));

3.設定option

var option = {
                title: {
                    text: 'XXX高三6月学生总分统计',
                    subtext: '虚拟数据'
                },
                tooltip: {
                    trigger: 'axis'
                },
                legend: {
                    data: ['文科', '理科']
                },
                toolbox: {
                    show: true,
                    feature: {
                        mark: { show: true },
                        dataView: { show: true, readOnly: false },
                        magicType: { show: true, type: ['line', 'bar'] },
                        restore: { show: true },
                        saveAsImage: { show: true }
                    }
                },
                calculable: true,
                xAxis: [
                    {
                        type: 'category',
                        data: ['300以下', '300-400', '400-500', '500-550', '550-600', '600-650', '650以上']
                    }
                ],
                yAxis: [
                    {
                        type: 'value'
                    }
                ],
                series: [
                    {
                        name: '理科',
                        type: 'bar',
                        data: LiKeScores,
                        markPoint: {
                            data: [
                                { type: 'max', name: '最大值' },
                                { type: 'min', name: '最小值' }
                            ]
                        },
                        markLine: {
                            data: [
                                { type: 'average', name: '平均值' }
                            ]
                        }
                    },
                    {
                        name: '文科',
                        type: 'bar',
                        data: WenKeScores,
                        markPoint: {//标注点
                            data: [
                                { type: 'max', name: '最大值' },
                                { type: 'min', name: '最小值' }
                            ]
                        },
                        markLine: { //水平线
                            data: [
                                { type: 'average', name: '平均值' } //水平线表示平均值
                            ]
                        }
                    }
                ]
            }

4.將option加入myCharts實例

 myChart.setOption(option);
 // 设置加载等待隐藏
 myChart.hideLoading();

(三).NET

public class DefaultController : Controller
    {
        // GET: Default
        public ActionResult BarEcharts()
        {
            return View();
        }

        public ContentResult GetScoresJson()
        {
            //这里只是模拟数据,正式环境需要到db中查询
            return Content("{LiKe:[10, 20, 30, 100, 300, 80, 60],WenKe:[15, 10, 30, 80, 400, 100, 60]}");
        }
    }

(四)完整原始碼

1.前端



    
    
    
    BarEcharts


    
<script> //初始化 var myChart = echarts.init(document.getElementById(&#39;EchartsBarDemo&#39;)); //定义全局变量 //var LiKeScores = [10, 20, 30, 100, 300, 80, 60]; //var WenKeScores = [15, 10, 30, 80, 400, 100, 60]; var LiKeScores = []; var WenKeScores = []; var jsonURL = "/Default/GetScoresJson"; $.ajax({ type: &#39;get&#39;, url: jsonURL, dataType: "text", success: function (rspData) { console.log(rspData); var str = eval(&#39;(&#39; + rspData + &#39;)&#39;); LiKeScores =str.LiKe; WenKeScores = str.WenKe; var option = { title: { text: &amp;#39;XXX高三6月学生总分统计&amp;#39;, subtext: &amp;#39;虚拟数据&amp;#39; }, tooltip: { trigger: &amp;#39;axis&amp;#39; }, legend: { data: [&amp;#39;文科&amp;#39;, &amp;#39;理科&amp;#39;] }, toolbox: { show: true, feature: { mark: { show: true }, dataView: { show: true, readOnly: false }, magicType: { show: true, type: [&amp;#39;line&amp;#39;, &amp;#39;bar&amp;#39;] }, restore: { show: true }, saveAsImage: { show: true } } }, calculable: true, xAxis: [ { type: &amp;#39;category&amp;#39;, data: [&amp;#39;300以下&amp;#39;, &amp;#39;300-400&amp;#39;, &amp;#39;400-500&amp;#39;, &amp;#39;500-550&amp;#39;, &amp;#39;550-600&amp;#39;, &amp;#39;600-650&amp;#39;, &amp;#39;650以上&amp;#39;] } ], yAxis: [ { type: &amp;#39;value&amp;#39; } ], series: [ { name: &amp;#39;理科&amp;#39;, type: &amp;#39;bar&amp;#39;, data: LiKeScores, markPoint: { data: [ { type: &amp;#39;max&amp;#39;, name: &amp;#39;最大值&amp;#39; }, { type: &amp;#39;min&amp;#39;, name: &amp;#39;最小值&amp;#39; } ] }, markLine: { data: [ { type: &amp;#39;average&amp;#39;, name: &amp;#39;平均值&amp;#39; } ] } }, { name: &amp;#39;文科&amp;#39;, type: &amp;#39;bar&amp;#39;, data: WenKeScores, markPoint: {//标注点 data: [ { type: &amp;#39;max&amp;#39;, name: &amp;#39;最大值&amp;#39; }, { type: &amp;#39;min&amp;#39;, name: &amp;#39;最小值&amp;#39; } ] }, markLine: { //水平线 data: [ { type: &amp;#39;average&amp;#39;, name: &amp;#39;平均值&amp;#39; } //水平线表示平均值 ] } } ] } myChart.setOption(option); // 设置加载等待隐藏 myChart.hideLoading(); }, error: function (data) { console.log(data); LiKeScores = data.LiKe; WenKeScores = data.WenKe; //Loading(false); } }); </script>

2 .後端

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace EchartDemo.Controllers
{
    public class DefaultController : Controller
    {
        // GET: Default
        public ActionResult BarEcharts()
        {
            return View();
        }

        public ContentResult GetScoresJson()
        {
            //这里只是模拟数据,正式环境需要到db中查询
            return Content("{LiKe:[10, 20, 30, 100, 300, 80, 60],WenKe:[15, 10, 30, 80, 400, 100, 60]}");
        }
    }
}

以上是基於bootstrap的UI框架有哪些的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn