方法一:
导航栏下面的页面在宽屏上不留白的办法
修改views/layouts/main.php
将class="container" 改成class="container-fluid"
方法二:
<?php
/* @var $this yii\web\View */
$this->title = '企业画像123';
?>
<style>
.mydivstyle{ border-style:solid; border-width:1px; border-color:#000;width: 1s50px;height:100px;
background:#000066;
}
h2{
color:#ffffcc;
}
//图片与div同缩放
#testfullscreen{
background-image: url(img/bg.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
</style>
<script>
function showFull(){
var full=document.getElementById("testfullscreen");
launchIntoFullscreen(full);
}
function delFull() {
exitFullscreen();
}
//全屏方法封装:
function launchIntoFullscreen(element) {
if(element.requestFullscreen){
element.requestFullscreen();
}
else if(element.mozRequestFullScreen) {
element.mozRequestFullScreen();
}
else if(element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
}
else if(element.msRequestFullscreen) {
element.msRequestFullscreen();
}
}
//退出全屏
function exitFullscreen() {
if(document.exitFullscreen) {
document.exitFullscreen();
} else if(document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if(document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
}
</script>
<div class="site-index">
<div class="body-content" id="testfullscreen">
<button onclick="showFull();">
全屏
</button>
<button onclick="delFull();">
退出全屏
</button>
<div class="row clearfix">
<div class="col-md-4 column">
<div class="row-lg-4">
<h2>0</h2>
<h2>企业高管信息</h2>
<div id="main" class="mydivstyle"></div>
<p><a class="btn btn-default" href="http://localhost/index.php?r=site%2Fabout">更多»</a></p>
</div>
<div class="row-lg-4">
<h2>0</h2>
<h2>企业综合信息</h2>
<div id="m2" class="mydivstyle"></div>
<p><a class="btn btn-default" href="http://localhost/index.php?r=site%2Fabout">更多»</a></p>
</div>
<div class="row-lg-4">
<h2>0</h2>
<h2>企业图谱</h2>
<div id="m3" class="mydivstyle"></div>
<p><a class="btn btn-default" href="http://localhost/index.php?r=site%2Fabout">更多»</a></p>
</div>
</div>
</div>
<div class="col-md-4 column">
</div>
<div class="col-md-4 column">
</div>
</div>
</div>
</div>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js">
</script>
<script language="javascript">
$('#aa').load("data.txt");
</script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-gl/dist/echarts-gl.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-stat/dist/ecStat.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/dist/extension/dataTool.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/map/js/china.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/map/js/world.js"></script>
<script type="text/javascript" src="https://api.map.baidu.com/getscript?v=2.0&ak=BAfb9bb97f7b712e5426859ac957c98f"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/dist/extension/bmap.min.js"></script>
<!--script src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js"></script-->
<script type="text/javascript">
var dom = document.getElementById("main");
var myChart = echarts.init(dom);
var app = {};
option = null;
myChart.showLoading();
$.get('http://localhost/data.txt', function (data) {
myChart.hideLoading();
echarts.util.each(data.children, function (datum, index) {
index % 2 === 0 && (datum.collapsed = true);
});
/* myChart.setOption(option = {
tooltip: {
// trigger: 'item',
// triggerOn: 'mousemove'
},
series: [
{
type: 'tree',
data: [data1],
s top: '1%',
left: '7%',
bottom: '1%',
right: '20%',
symbolSize: 7,
label: {
position: 'left',
verticalAlign: 'middle',
align: 'right',
fontSize: 9
},
leaves: {
label: {
position: 'right',
verticalAlign: 'middle',
align: 'left'
}
},
expandAndCollapse: true,
// animationDuration: 550,
//animationDurationUpdate: 750
}
]
});*/
myChart.setOption({
tooltip: {
trigger: 'item',
triggerOn: 'mousemove'
},
series :
[
{
"name": "国资委",
"type": "tree",
top: '1%',
left: '7%',
bottom: '1%',
right: '30%',
symbolSize: 10,
label: {
position: 'left',
verticalAlign: 'middle',
align: 'right',
fontSize: 10
},leaves: {
label: {
position: 'right',
verticalAlign: 'middle',
align: 'left'
}
},
'data':[
{
"id": "000000000",
"parentId": null,
"name": "国资委",
"dataId": null,
"companyCount": 782,
"children": [{
"id": "73746554X9",
"parentId": "000000000",
"name": "上海同盛投资(集团)有限公司(集团汇总表)",
"dataId": "09a30b23-6ff2-4f9b-8d32-f4ac3f8529db",
"companyCount": 9,
"children": [{
"id": "7672369670",
"parentId": "73746554X9",
"name": "上海同盛置业有限公司(单户表)",
"dataId": "03621932-9a7d-4001-aabe-1443541daecd",
"companyCount": 0,
"children": [
{
"id": "7377674250",
"parentId": "73746554X9",
"name": "洋山同盛港口建设有限公司(单户表)",
"dataId": "459c3698-0bc0-4869-8b9f-df45a1efa9c2",
"companyCount": 0,
"children": [{
"id": "7377674250",
"parentId": "73746554X9",
"name": "洋山同盛港口建设有限公司(单户表)",
"dataId": "459c3698-0bc0-4869-8b9f-df45a1efa9c2",
"companyCount": 0,
"children": [{
"id": "7377674250",
"parentId": "73746554X9",
"name": "洋山同盛港口建设有限公司(单户表)",
"dataId": "459c3698-0bc0-4869-8b9f-df45a1efa9c2",
"companyCount": 0,
"children": [{
"id": "7377674250",
"parentId": "73746554X9",
"name": "洋山同盛港口建设有限公司(单户表)",
"dataId": "459c3698-0bc0-4869-8b9f-df45a1efa9c2",
"companyCount": 0,
"children": []
}]
}]
}]
}
]
}, {
"id": "7844456480",
"parentId": "73746554X9",
"name": "洋山同盛联合投资发展有限公司(单户表)",
"dataId": "3f127dff-efc2-4aa1-93f7-2fbc1c85c388",
"companyCount": 0,
"children": []
}, {
"id": "7377674250",
"parentId": "73746554X9",
"name": "洋山同盛港口建设有限公司(单户表)",
"dataId": "459c3698-0bc0-4869-8b9f-df45a1efa9c2",
"companyCount": 0,
"children": []
}, {
"id": "73746554X0",
"parentId": "73746554X9",
"name": "上海同盛投资(集团)有限公司(单户表)",
"dataId": "46e1c2b8-034a-461f-a719-777b2997b955",
"companyCount": 0,
"children": []
}, {
"id": "73746554X1",
"parentId": "73746554X9",
"name": "上海同盛投资(集团)有限公司(集团差额表)",
"dataId": "5766e8f8-1cac-4143-8de9-f5653ceeddbb",
"companyCount": 0,
"children": []
}, {
"id": "7605970730",
"parentId": "73746554X9",
"name": "上海同盛电力有限公司(单户表)",
"dataId": "5ef32ea1-785c-4b9f-830b-3f8152d5f715",
"companyCount": 0,
"children": []
}, {
"id": "7595844510",
"parentId": "73746554X9",
"name": "上海同盛投资集团资产管理有限公司(单户表)",
"dataId": "64073d4d-ed15-4ab9-9620-9030b8fd11b1",
"companyCount": 0,
"children": []
}, {
"id": "7655620720",
"parentId": "73746554X9",
"name": "上海同盛水务有限公司(单户表)",
"dataId": "6f3b9252-5656-4ff7-8f96-39879caee530",
"companyCount": 0,
"children": []
}, {
"id": "1345456470",
"parentId": "73746554X9",
"name": "上海同盛投资集团房地产有限公司(单户表)",
"dataId": "8b5e06f8-4dbc-41f4-8896-e1874b509853",
"companyCount": 0,
"children": []
}]
}]
}
]
}
]
});
});
if (option && typeof option === "object") {
myChart.setOption(option, true);
}
</script>