|
require.config({
paths: {
'md5': '../lib/md5',
'jquery': '../lib/jquery-1.11.1.min', // jquery的模拟名固定为jquery,小写
'echarts' : '../lib/echarts.min'
}
});
require(["jquery", "md5","echarts"], function ($, md5,echarts) {
$(function () {
var username = 'play0'; // 登录用户名
var pass = '111111'; // 登录密码
var passcode = hex_md5(pass).toUpperCase(); // md5加密,默认字体串为小写,服务端要求为大写
var stream = '1'; // 房间号
var data = {userName: username, passwd: passcode, stream: stream, publish: false};
$.getJSON("/StreamMgmt/rest/UserMgmt/authentication", data, function (result) {
if (result.code == 0) { // 表示成功
$("#video-play source").prop("src", result.url);
let myPlayer = videojs("video-play");
myPlayer.play();
} else {
alert('获流失败,请刷新重试');
}
});
$(".item-name > i").click(function(){
$(this).parent().parent().toggleClass("unfold")
$(this).parent().parent().find("ul:first").slideToggle(500);
$(this).toggleClass("unfold");
$(this).parent().children(".filename").toggleClass("filename-open");
});
$(".checkbox").click(function (){
$(this).toggleClass("c-selected");
});
var myChart1 = echarts.init($(".chart-1")[0]);
option = {
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)'
},
legend: {
orient: 'vertical',
left: 'right',
bottom: 'bottom',
data: ['外部人员', '内部人员']
},
series: [
{
name: '访问来源',
type: 'pie',
radius: '55%',
center: ['40%', '40%'],
data: [
{value: 15, name: '外部人员'},
{value: 105, name: '内部人员'},
],
itemStyle : {
normal : {
label : {
position : 'inner',
formatter : function (params){return (params.value);},
textStyle: {
color: '#000'
}
},
labelLine : {
show : false
}
}
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
myChart1.setOption(option, true);
});
})
;
|