mirror of
https://gitee.com/smartchart/smartchart
synced 2025-05-05 00:59:25 +08:00
v3.9.9.10
This commit is contained in:
parent
6d6d8b6ffd
commit
b70fb8395a
@ -230,6 +230,7 @@ v3.9.9.0 print函数优化,新增数据透视函数,个人静态资源路径
|
||||
v3.9.9.1 开发界面美化
|
||||
v3.9.9.5 开发界面优化,fix定时刷新BUG,新增批量数据集删除
|
||||
v3.9.9.7 增加python连接器,数据池,自定义主模板,优化开发界面
|
||||
v3.9.9.10 DIV设定中可以写css,新增内置动态表格,优化布局支持,增加config文件
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
70
static/js/fun.css
Normal file
70
static/js/fun.css
Normal file
@ -0,0 +1,70 @@
|
||||
.table th, .table td {text-align: center;}
|
||||
.table {font-size:10px;}
|
||||
.devspan {position:absolute;z-index:99999;}
|
||||
.devspan:hover a, .devhead:hover select, .devhead:hover a .show{display: initial;}
|
||||
.devspan a, .devhead select, .devhead a, .hidden {display: none}
|
||||
.devhead {background:white;position:fixed;z-index:99998;}
|
||||
.fixdiv {position:absolute;z-index:10;}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 0.25rem;
|
||||
height: 0.25rem;
|
||||
background-image: linear-gradient(135deg, #1DE9B6 0%, rgba(8, 196, 219, 0.5) 72%, rgba(0, 182, 234, 0.3) 100%);
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
border-radius: 0;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-image: linear-gradient(135deg, #1DE9B6 0%, #08c4db 72%, #057494 100%);
|
||||
transition: all .2s;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background-color: rgba(95, 95, 95, 0.7);
|
||||
}
|
||||
|
||||
.tb-scroll-sty {
|
||||
height: 100%;
|
||||
margin: 0 auto;
|
||||
border: 0.06rem solid #364a5f;
|
||||
line-height: 1.8rem;
|
||||
font-size: 1rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
.tb-scroll-sty>ul{
|
||||
list-style-type: none;
|
||||
margin:0;
|
||||
padding:0;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.tb-scroll-sty>ul>li{
|
||||
color: #393939;
|
||||
}
|
||||
.tb-scroll-sty li {
|
||||
height: 1.8rem;
|
||||
}
|
||||
|
||||
.tb-scroll-head{
|
||||
height:2rem;
|
||||
background-color: #364a5f;
|
||||
color:#FFF;
|
||||
font-size: 1.2rem;
|
||||
font-weight: 800;
|
||||
z-index: 998;
|
||||
}
|
||||
|
||||
.tb-baseStyle{
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
width:6rem;
|
||||
height:3.5rem;
|
||||
}
|
||||
|
||||
.tb-evenRowStyle{
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
.tb-rowhover{
|
||||
background-color: #52c1a1;
|
||||
color: #FFF;
|
||||
font-weight: bold;
|
||||
}
|
1
static/js/qrcode.min.js
vendored
Executable file
1
static/js/qrcode.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
108
static/js/scroll.js
Normal file
108
static/js/scroll.js
Normal file
@ -0,0 +1,108 @@
|
||||
/**
|
||||
* 滚动组件的实现
|
||||
* @param {Object} $
|
||||
*/
|
||||
(function($){
|
||||
/**
|
||||
* 实现滚动方法
|
||||
* @param {Object} options
|
||||
*/
|
||||
$.fn.initTable = function(options){
|
||||
//默认配置
|
||||
let defaults = {
|
||||
speed:null, //滚动速度,值越大速度越慢
|
||||
rowHeight:24, //每行的高度
|
||||
dataObj: null,
|
||||
ClassForEven: 'tb-evenRowStyle',
|
||||
ClassForHover: 'tb-rowhover',
|
||||
ClassForOdd: null
|
||||
};
|
||||
//对象赋值
|
||||
let opts = $.extend({}, defaults, options),intId = [];
|
||||
|
||||
function marquee(obj, step){
|
||||
obj.find("ul").animate({marginTop: '-=1'},0,function(){
|
||||
let s = Math.abs(parseInt($(this).css("margin-top")));
|
||||
if(s >= step){
|
||||
let firstli = $(this).find("li").slice(0, 1)
|
||||
firstli.appendTo($(this));
|
||||
$(this).css("margin-top", 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
function initScroll(obj, dataObj){
|
||||
let mybody = $('.tb-scroll-body', obj);
|
||||
let myhead = $('.tb-scroll-head', obj)
|
||||
let key = null;
|
||||
let span_dom = null;
|
||||
mybody.empty();
|
||||
$.each(dataObj,function(index,item){
|
||||
mybody.append('<li><a></a></li>')
|
||||
for(key in item){
|
||||
span_dom = myhead.find("div[name='"+key+"']").clone();
|
||||
span_dom.text(item[key]);
|
||||
mybody.find('li:last-child>a').append(span_dom);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addClassForHover(obj, styleName){
|
||||
let mysty = $('ul>li', obj)
|
||||
mysty.hover(function(){
|
||||
mysty.each(function(){
|
||||
$(this).removeClass(styleName);
|
||||
});
|
||||
$(this).addClass(styleName);
|
||||
});
|
||||
mysty.mouseleave(function(){
|
||||
$(this).removeClass(styleName);
|
||||
});
|
||||
}
|
||||
//初始化数据
|
||||
if(opts.dataObj){initScroll($(this), opts.dataObj)}
|
||||
if(opts.ClassForEven){$('>ul>li:even', this).addClass(opts.ClassForEven);}
|
||||
if(opts.ClassForOdd){$('>ul>li:odd', this).addClass(opts.ClassForOdd);}
|
||||
if(opts.ClassForHover){addClassForHover(this, opts.ClassForHover)}
|
||||
|
||||
if(opts.speed){
|
||||
this.each(function(i){
|
||||
let sh = opts["rowHeight"],speed = opts["speed"],_this = $(this);
|
||||
intId[i] = setInterval(function(){
|
||||
if(_this.find("ul").height()<=_this.height()){
|
||||
clearInterval(intId[i]);
|
||||
}else{
|
||||
marquee(_this, sh);
|
||||
}
|
||||
}, speed);
|
||||
|
||||
_this.hover(function(){
|
||||
clearInterval(intId[i]);
|
||||
},function(){
|
||||
intId[i] = setInterval(function(){
|
||||
if(_this.find("ul").height()<=_this.height()){
|
||||
clearInterval(intId[i]);
|
||||
}else{
|
||||
marquee(_this, sh);
|
||||
}
|
||||
}, speed);
|
||||
});
|
||||
|
||||
});}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 行点击事件
|
||||
* @param {Object} callback
|
||||
*/
|
||||
$.fn.rowOnclick = function(callback){
|
||||
$('>ul>li', this).bind('click',function(){
|
||||
let scroll_obj = {};
|
||||
$(this).find('div').each(function(index,item){
|
||||
scroll_obj[$(this).attr('name')]=$(this).text();
|
||||
});
|
||||
callback(scroll_obj);
|
||||
});
|
||||
}
|
||||
})(jQuery);
|
@ -12,9 +12,10 @@
|
||||
<form>
|
||||
<h1>SmartChart</h1>
|
||||
<h5 id="msg">加微信或群获取激活码,请支持一杯咖啡</h5>
|
||||
<h5><img src="https://www.smartchart.cn/static/images/auth.png" height="150px"></h5>
|
||||
<h5><div ><img src="https://www.smartchart.cn/static/images/auth.png" height="150px"></div></h5>
|
||||
<center><div id="qrcode"></div></center>
|
||||
<div class="group">
|
||||
<input id="authkey" placeholder="请输入你的KEY" required="required" /><span class="highlight"></span><span class="bar"></span>
|
||||
<input id="authkey" style="display: none" placeholder="请输入激活码" required="required" /><span class="highlight"></span><span class="bar"></span>
|
||||
</div>
|
||||
</form>
|
||||
<div class="btn-box">
|
||||
@ -26,17 +27,34 @@
|
||||
</div>
|
||||
|
||||
<script src="/static/js/jquery-2.2.3.min.js"></script>
|
||||
<script src="/static/js/qrcode.min.js"></script>
|
||||
|
||||
<script>
|
||||
$("#submitup").click(function(){
|
||||
let key = $.trim($('#authkey').val());
|
||||
if(key === ''){
|
||||
$('#msg').html('请输入KEY');
|
||||
$('#authkey').css('display', 'initial');
|
||||
$('#msg').html('在微信公众号"智晶数据"中使用扫码获取激活码');
|
||||
makeCode();
|
||||
return;
|
||||
}
|
||||
$.ajax({type: "POST",url: '/echart/auth_right/', data:{key: key} ,success: function (data)
|
||||
{ $('#msg').html(data['msg']);
|
||||
} });
|
||||
});
|
||||
|
||||
var qrcode = null;
|
||||
function makeCode () {
|
||||
$.ajax({type: "GET",url: '/echart/get_auth_key/', success: function (data)
|
||||
{ if(qrcode === null){qrcode = new QRCode(document.getElementById("qrcode"), {width : 150, height : 150})}
|
||||
qrcode.makeCode(data['key']);
|
||||
} });
|
||||
}
|
||||
|
||||
$.ajax({type: "GET",url: '/echart/get_auth_key/', success: function (data){
|
||||
if(data.isauth){$('#msg').html('已激活, 有效期到:'+ data.expire);}
|
||||
} });
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
@ -1,34 +1,12 @@
|
||||
<html><head><title>smartchart:{{title}}</title><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta http-equiv="X-UA-Compatible" content="IE=edge">{% block head %}{% endblock %}{{contentrefresh|safe}}<style type="text/css">
|
||||
.table th, .table td {text-align: center;}
|
||||
.table {font-size:10px;}
|
||||
.devspan {position:absolute;z-index:99999;}
|
||||
.devspan:hover a, .devhead:hover select, .devhead:hover a .show{display: initial;}
|
||||
.devspan a, .devhead select, .devhead a, .hidden {display: none}
|
||||
.devhead {background:white;position:fixed;z-index:99998;}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 0.25rem;
|
||||
height: 0.25rem;
|
||||
background-image: linear-gradient(135deg, #1DE9B6 0%, rgba(8, 196, 219, 0.5) 72%, rgba(0, 182, 234, 0.3) 100%);
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
border-radius: 0;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-image: linear-gradient(135deg, #1DE9B6 0%, #08c4db 72%, #057494 100%);
|
||||
transition: all .2s;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background-color: rgba(95, 95, 95, 0.7);
|
||||
}
|
||||
{% block style %}
|
||||
{% endblock %}</style></head>
|
||||
<link rel="icon" type="image.png" href="/static/images/favicon.ico"><link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css">
|
||||
<link rel="icon" type="image.png" href="/static/images/favicon.ico"><link rel="stylesheet" href="/static/js/fun.css"><link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css">
|
||||
{% if dv %}<script src="/static/echart/opt/vue.js"></script><script src="/static/echart/opt/dv.js"></script>{% endif %}<script src="/static/js/jquery-2.2.3.min.js"></script>
|
||||
{% block stylesheet %}{% endblock %}{{devhead|safe}}
|
||||
{% block body %}{% endblock %}
|
||||
</html><script type="text/javascript" src="/static/echart/dist/echarts.min.js"></script><script src="/static/echart/dist/china.js"></script><script src="/static/js/fun.js"></script><script src="/static/echart/theme/{{theme}}"></script><script type="text/javascript" src="/static/bootstrap/js/bootstrap.min.js"></script>
|
||||
</html><script type="text/javascript" src="/static/echart/dist/echarts.min.js"></script><script src="/static/echart/dist/china.js"></script><script src="/static/js/fun.js"></script><script src="/static/js/scroll.js"></script><script src="/static/echart/theme/{{theme}}"></script><script type="text/javascript" src="/static/bootstrap/js/bootstrap.min.js"></script>
|
||||
{{footer|safe}}{% block javascript %}{% endblock %}
|
||||
<script>function print(item){console.log(item)};$("#smartcharthead").on("click",function(){if($("#id_devhead").hasClass('devhead')){$("#id_devhead").removeClass('devhead');}else{$("#id_devhead").addClass('devhead')}});{% if dv %}var vapp = new Vue({el: '#vue_app', data: {d0:'',d1:'',d2:'',d3:'',d4:'',d5:'',d6:'',d7:'',d8:'',d9:'',d10:'',d11:'',d12:'',d13:'',d14:'',d15:'',d16:''}});{% endif %}var app = {};var charts = [];{{echart_main|safe}}window.onresize = function(){for(var i = 0; i < charts.length; i++){charts[i].resize();}};
|
||||
$(function(){$("#fullScreen").on("click",function(){var isFull=!!(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement||document.fullscreenElement);if(isFull===false){fullScreen()}else{exitFullscreen()}})});function fullScreen(){var element=document.documentElement;if(element.requestFullscreen){element.requestFullscreen()}else if(element.msRequestFullscreen){element.msRequestFullscreen()}else if(element.mozRequestFullScreen){element.mozRequestFullScreen()}else if(element.webkitRequestFullscreen){element.webkitRequestFullscreen()}}function exitFullscreen(){if(document.exitFullscreen){document.exitFullscreen()}else if(document.msExitFullscreen){document.msExitFullscreen()}else if(document.mozCancelFullScreen){document.mozCancelFullScreen()}else if(document.webkitExitFullscreen){document.webkitExitFullscreen()}}
|
||||
|
@ -33,8 +33,9 @@
|
||||
<option value="dawn">dawn</option>
|
||||
<option value="sqlserver">sqlserver</option>
|
||||
<option value="twilight">twilight</option>
|
||||
</select><a class="glyphicon glyphicon-import" href="#" id="load_sample"
|
||||
style="color: rgb(255, 140, 60);">DV</a><span id="printlog" style="color:red"></span>
|
||||
</select><a class="glyphicon glyphicon-import" href="#" id="load_sample1"
|
||||
style="color: rgb(255, 140, 60);">DV</a><a class="glyphicon glyphicon-import" href="#" id="load_sample2"
|
||||
style="color: #6ec2cf;">AB</a><span id="printlog" style="color:red"></span>
|
||||
<a class="glyphicon glyphicon-question-sign" title="帮助"
|
||||
style="color: rgb(155, 205, 60);float:right" onclick="load_help('help_div')"></a>
|
||||
<a class="glyphicon glyphicon-magnet" title="复制数据集"
|
||||
@ -98,11 +99,19 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
$("#load_sample").click(function () {
|
||||
$("#load_sample1").click(function () {
|
||||
$.ajax({
|
||||
type: "get", url: 'https://www.smartchart.cn/smartdata/api/?i=datavsample',
|
||||
success: function (data) {
|
||||
editor1.setValue(data);
|
||||
editor1.setValue(editor1.getValue() + '\n\n' + data);
|
||||
}
|
||||
})
|
||||
});
|
||||
$("#load_sample2").click(function () {
|
||||
$.ajax({
|
||||
type: "get", url: 'https://www.smartchart.cn/smartdata/api/?i=datavsample2',
|
||||
success: function (data) {
|
||||
editor1.setValue(editor1.getValue() + '\n\n' + data);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
@ -78,7 +78,7 @@
|
||||
//开启datav和vue模式
|
||||
"dv":1
|
||||
//自定义模板文件
|
||||
"template":"common2.html"</pre>
|
||||
"template":"common.html"</pre>
|
||||
自定义静态资源文件路径:<br>{{ spath }}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -12,9 +12,10 @@
|
||||
<form>
|
||||
<h1>SmartChart</h1>
|
||||
<h5 id="msg">加微信或群获取激活码,请支持一杯咖啡</h5>
|
||||
<h5><img src="https://www.smartchart.cn/static/images/auth.png" height="150px"></h5>
|
||||
<center><div id="qrcode"></div></center>
|
||||
<h5><div ><img src="https://www.smartchart.cn/static/images/auth.png" height="150px"></div></h5>
|
||||
<div class="group">
|
||||
<input id="authkey" placeholder="请输入你的KEY" required="required" /><span class="highlight"></span><span class="bar"></span>
|
||||
<input id="authkey" style="display: none" placeholder="请输入激活码" required="required" /><span class="highlight"></span><span class="bar"></span>
|
||||
</div>
|
||||
</form>
|
||||
<div class="btn-box">
|
||||
@ -26,17 +27,34 @@
|
||||
</div>
|
||||
|
||||
<script src="/static/js/jquery-2.2.3.min.js"></script>
|
||||
<script src="/static/js/qrcode.min.js"></script>
|
||||
|
||||
<script>
|
||||
$("#submitup").click(function(){
|
||||
let key = $.trim($('#authkey').val());
|
||||
if(key === ''){
|
||||
$('#msg').html('请输入KEY');
|
||||
$('#authkey').css('display', 'initial');
|
||||
$('#msg').html('在微信公众号"智晶数据"中使用扫码获取激活码');
|
||||
makeCode();
|
||||
return;
|
||||
}
|
||||
$.ajax({type: "POST",url: '/echart/auth_right/', data:{key: key} ,success: function (data)
|
||||
{ $('#msg').html(data['msg']);
|
||||
} });
|
||||
});
|
||||
|
||||
var qrcode = null;
|
||||
function makeCode () {
|
||||
$.ajax({type: "GET",url: '/echart/get_auth_key/', success: function (data)
|
||||
{ if(qrcode === null){qrcode = new QRCode(document.getElementById("qrcode"), {width : 150, height : 150})}
|
||||
qrcode.makeCode(data['key']);
|
||||
} });
|
||||
}
|
||||
|
||||
$.ajax({type: "GET",url: '/echart/get_auth_key/', success: function (data){
|
||||
if(data.isauth){$('#msg').html('已激活, 有效期到:'+ data.expire);}
|
||||
} });
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user