diff --git a/README.md b/README.md index 473fc83..9fa865b 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ url: 登录成功后跳转链接 ------------------------------------------------------------------------------- ### 应用场景四: 在django项目中当作apps使用 **django新手不建意使用此方法** -- 最简单的方法(推荐!!!!) +- django新手推荐下载此项目使用 ```shell script 请直接下载gitee/github的项目后 pip install smartchart @@ -186,6 +186,7 @@ v3.9.9.5 开发界面优化,fix定时刷新BUG,新增批量数据集删除 v3.9.9.7 增加python连接器,数据池,自定义主模板,优化开发界面 v3.9.9.10 DIV设定中可以写css,新增内置动态表格,优化布局支持,增加config文件 v3.9.9.12 优化后台数据处理性能,Jupyter使用体验 +v3.9.9.16 新增模板编辑功能,增加嵌入报表TOKEN方式,优化编辑界面,优化连接池选择 ``` ------------------------------------------------------------------------------- diff --git a/static/editor/common.js b/static/editor/common.js index 5cfcd99..a119a53 100644 --- a/static/editor/common.js +++ b/static/editor/common.js @@ -4,7 +4,7 @@ var editor1 = ''; var helpText = ''; var helmodal = $('#myModal'); -$('#ace-theme').val(theme); +theme_init(); $("#ace-theme").change(function () { theme=$("#ace-theme").val(); editor1.setTheme("ace/theme/"+theme); @@ -36,4 +36,18 @@ function load_help(name) { type: "get", url: 'https://www.smartchart.cn/smartdata/api/?i='+name, success: function (data) {helpText=data;helmodal.html(helpText);} })}helmodal.modal('show'); +} + +function theme_init(){ + theme_option = ` + + + + + + + + `; + $('#ace-theme').append(theme_option).val(theme); + } \ No newline at end of file diff --git a/static/editor/ds_editor.js b/static/editor/ds_editor.js index c545b20..9e7e9df 100644 --- a/static/editor/ds_editor.js +++ b/static/editor/ds_editor.js @@ -1,12 +1,13 @@ var dsid = GetQueryString('dsid'); -var divid = GetQueryString('divid'); +var divid = GetQueryString('divid') || ''; var on = GetQueryString('on') || '1'; var dsname =''; var seq = GetQueryString('seq') || ''; -$('#dsseq').val(seq); + +if(divid) {dssq_init(16);}else{$('#dsseq').css('display', 'None');} $.ajax({type: "get",url: '/echart/get_sqlstr/?dsid='+ dsid,success: function (data) {editor1.setValue(data['msg']);dsname=data['name'];$('#title').text('#'+seq+":"+dsid+dsname);$('#conn').text(data['connname']);} }); -set_onoff(); +if(divid){set_onoff();}else{$('#onoff').css('display', 'None');} editor1 = init_editor('sql'); @@ -57,7 +58,7 @@ $('#submit').click(function () {let e = editor1.getValue();console.log(e); else{window.opener.location.reload();}} catch (e) {console.log('no opener');} } // window.opener=null;window.close(); - else{window.location.href="/echart/?type=z.chart&dev=1&dataset="+dsid } + // else{window.location.href="/echart/?type=z.chart&dev=1&dataset="+dsid } } }); }); @@ -93,7 +94,15 @@ $('#conn').click(function () { let connselect = $('#connselect');connselect.empty(); data['msg'].forEach(function (item) { connselect.append('') + if(item[1]===$('#conn').text()){connselect.val(item[0])} }); $('#modal_conn').modal('show'); } }); }); + +function dssq_init(qty){ + for(let i=1;i${i}`); + } + $('#dsseq').val(seq); +} diff --git a/static/editor/ds_editor_frame.js b/static/editor/ds_editor_frame.js index ef7db69..862954c 100644 --- a/static/editor/ds_editor_frame.js +++ b/static/editor/ds_editor_frame.js @@ -52,6 +52,7 @@ $('#conn').click(function () { let connselect = $('#connselect');connselect.empty(); data['msg'].forEach(function (item) { connselect.append('') + if(item[1]===$('#conn').text()){connselect.val(item[0])} }); $('#modal_conn').modal('show'); } }); diff --git a/static/editor/editor.css b/static/editor/editor.css index 673caed..21522e2 100644 --- a/static/editor/editor.css +++ b/static/editor/editor.css @@ -97,4 +97,7 @@ .edit-area { height: 92%; -} \ No newline at end of file +} + +.devhead:hover select, .devhead:hover a .show{display: initial;} +.devhead select, .devhead a, .hidden {display: none} \ No newline at end of file diff --git a/static/index/input.css b/static/index/input.css index f292a7d..993ffac 100644 --- a/static/index/input.css +++ b/static/index/input.css @@ -16,7 +16,7 @@ form h1 { text-align: center; color: #2196F3; } -form h5 { +form h5, a { text-align: center; text-transform: uppercase; color: #c6c6c6; diff --git a/templates/diy/common.html b/templates/diy/common.html new file mode 100644 index 0000000..b5497f1 --- /dev/null +++ b/templates/diy/common.html @@ -0,0 +1,14 @@ +{% extends "echart/base.html" %} +{% block head %} {% endblock %} +{% block body %} + +
+
+ {% for div in div_list %} + {{div|safe}} + {% endfor %} +
+
+ +{% endblock %} +{% block javascript %}{% endblock %} \ No newline at end of file diff --git a/templates/echart/403.html b/templates/echart/403.html index 96ffe55..2cbd36b 100644 --- a/templates/echart/403.html +++ b/templates/echart/403.html @@ -11,8 +11,8 @@

SmartChart

-
加微信或群获取激活码,请支持一杯咖啡
-
+
请支持一杯咖啡,激活说明
+
@@ -34,7 +34,8 @@ $("#submitup").click(function(){ let key = $.trim($('#authkey').val()); if(key === ''){ $('#authkey').css('display', 'initial'); - $('#msg').html('在微信公众号"智晶数据"中使用扫码获取激活码'); + $('#msg').html('公众号"智晶数据"中使用扫码获取激活码 激活说明'); + $('#author').css('display', 'None'); makeCode(); return; } diff --git a/templates/echart/base.html b/templates/echart/base.html index de38837..bdb1444 100644 --- a/templates/echart/base.html +++ b/templates/echart/base.html @@ -1,14 +1,12 @@ -smartchart:{{title}}{% block head %}{% endblock %}{{contentrefresh|safe}} +smartchart:{{title}}{{contentrefresh|safe}} +{% block head %}{% endblock %} {% if dv %}{% endif %} -{% block stylesheet %}{% endblock %}{{devhead|safe}} +{{devhead|safe}} {% block body %}{% endblock %} {{footer|safe}}{% block javascript %}{% endblock %} - \ No newline at end of file diff --git a/templates/echart/common.html b/templates/echart/common.html index 4d0839b..59d46a8 100644 --- a/templates/echart/common.html +++ b/templates/echart/common.html @@ -1,7 +1,5 @@ {% extends "echart/base.html" %} {% block head %}{% endblock %} -{% block style %}{% endblock %} -{% block stylesheet %}{% endblock %} {% block body %} diff --git a/templates/echart/common2.html b/templates/echart/common2.html index 71226a8..f2b02e0 100644 --- a/templates/echart/common2.html +++ b/templates/echart/common2.html @@ -1,7 +1,5 @@ {% extends "echart/base.html" %} {% block head %}{% endblock %} -{% block style %}{% endblock %} -{% block stylesheet %}{% endblock %} {% block body %} diff --git a/templates/echart/common3.html b/templates/echart/common3.html index 5b78567..cfbeca4 100644 --- a/templates/echart/common3.html +++ b/templates/echart/common3.html @@ -1,7 +1,5 @@ {% extends "echart/base.html" %} {% block head %}{% endblock %} -{% block style %}{% endblock %} -{% block stylesheet %}{% endblock %} {% block body %} {% for div in div_list %} {{div|safe}} diff --git a/templates/echart/div_editor.html b/templates/echart/div_editor.html index fe07163..9470fd2 100644 --- a/templates/echart/div_editor.html +++ b/templates/echart/div_editor.html @@ -22,20 +22,13 @@
- {{name|safe}}保存DIV + {{name|safe}} + DVAB + 保存DIV
- {{name|safe}}保存DIV + {{name|safe}} + 带#号的行为标识位,不要修改 + 保存DIV带#号的行为标识位,不要修改 @@ -42,6 +34,10 @@ style="color: rgb(155, 205, 60);float:right" onclick="load_help('help_divlist')"> + +

                                 
@@ -134,6 +130,19 @@ function reset_seq(){ autoshow = !autoshow; if(autoshow){$('#id_autohtml').css('color', 'red')}else{$('#id_autohtml').css('color', 'gray')} } +function transform_html() { + let e = editor1.getValue(); + $.ajax({ + type: "POST", + url: "/echart/divlist_editor_transform/", + data: {dashid: GetQueryString('dashid'), div: e}, + success: function (data) { + if(data['div']!==''){editor1.setValue(data['div'])} + $('#printlog').html(data['msg']); + } + }); +} + \ No newline at end of file diff --git a/templates/echart/ds_editor.html b/templates/echart/ds_editor.html index 9209b36..813a053 100644 --- a/templates/echart/ds_editor.html +++ b/templates/echart/ds_editor.html @@ -23,42 +23,17 @@
- - 保存并刷新 + + + - + + + + 保存数据集 - diff --git a/templates/echart/ds_editor_iframe.html b/templates/echart/ds_editor_iframe.html index e7a0f7c..9ffb3e4 100644 --- a/templates/echart/ds_editor_iframe.html +++ b/templates/echart/ds_editor_iframe.html @@ -23,25 +23,12 @@
- - 返回 + 保存 - 保存并刷新 - +

                                 
diff --git a/templates/echart/option_editor.html b/templates/echart/option_editor.html index 3d70690..1df4892 100644 --- a/templates/echart/option_editor.html +++ b/templates/echart/option_editor.html @@ -23,20 +23,12 @@
- {{name|safe}}保存option + {{name|safe}} + 加载样列 + 加载样列保存option

                                 
diff --git a/templates/echart/template_editor.html b/templates/echart/template_editor.html new file mode 100644 index 0000000..3f239b7 --- /dev/null +++ b/templates/echart/template_editor.html @@ -0,0 +1,105 @@ +{% load static %} + + + + + Template设计 + + + + + + + + + +
+
+
+
+
+
+
+
+
+ + + 保存Template + + + +

+                                
+
+
+
+
+
+
+
点击上方太阳标识可开启实时调试
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/templates/source/no_favorite b/templates/source/no_favorite index 5361705..2cbd36b 100644 --- a/templates/source/no_favorite +++ b/templates/source/no_favorite @@ -11,9 +11,9 @@

SmartChart

-
加微信或群获取激活码,请支持一杯咖啡
+
请支持一杯咖啡,激活说明
+
-
@@ -34,7 +34,8 @@ $("#submitup").click(function(){ let key = $.trim($('#authkey').val()); if(key === ''){ $('#authkey').css('display', 'initial'); - $('#msg').html('在微信公众号"智晶数据"中使用扫码获取激活码'); + $('#msg').html('公众号"智晶数据"中使用扫码获取激活码 激活说明'); + $('#author').css('display', 'None'); makeCode(); return; }