From 20c6d1fbd147470a42df5932975c62b0213ee317 Mon Sep 17 00:00:00 2001 From: hhyo Date: Sun, 24 Mar 2019 16:14:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A7=84=E5=88=99=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=98=93=E7=94=A8=E6=80=A7=E6=94=B9=E8=BF=9B=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=98=BE=E7=A4=BA=E8=A7=84=E5=88=99=E8=AF=A6?= =?UTF-8?q?=E7=BB=86=EF=BC=8C=E5=B9=B6=E4=B8=94=E6=94=AF=E6=8C=81=E7=BC=96?= =?UTF-8?q?=E8=BE=91=20#76?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themis/static/js/sql_review/rule_set.js | 51 ++++++------------------- themis/views.py | 5 +-- 2 files changed, 13 insertions(+), 43 deletions(-) diff --git a/themis/static/js/sql_review/rule_set.js b/themis/static/js/sql_review/rule_set.js index a07cbcc26e..40d3891bd0 100644 --- a/themis/static/js/sql_review/rule_set.js +++ b/themis/static/js/sql_review/rule_set.js @@ -20,7 +20,7 @@ $(document).ready(function() { // if (flag != 0){ // } - // }) + // }) $.get("/themis/sqlreview/rule/info", {}, function(result){ if(result["errcode"] === 80013){ var columns = [ @@ -63,32 +63,24 @@ $(document).ready(function() { $(nTd).addClass('inputParm2').attr('id', oData[0] + "$parm2"); } }, - { + { "title": "参数三", "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) { $(nTd).addClass('inputParm3').attr('dbtype', oData[6]); $(nTd).addClass('inputParm3').attr('id', oData[0] + "$parm3"); } }, - { - "title": "参数四", + { + "title": "RuleCmd", "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) { - $(nTd).addClass('inputParm4').attr('dbtype', oData[6]); - $(nTd).addClass('inputParm4').attr('id', oData[0] + "$parm4"); + $(nTd).addClass('RuleCmd').attr('dbtype', oData[6]); + $(nTd).addClass('RuleCmd').attr('id', oData[0] + "$rule_cmd"); } - }, - { - "title": "参数五", - "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) { - $(nTd).addClass('inputParm5').attr('dbtype', oData[6]); - $(nTd).addClass('inputParm5').attr('id', oData[0] + "$parm5"); - } - }, - {"title": "exclude_type"} + } ] genTable("struct", "struct_table", result["data"], columns) } - }) + }) }); function genTable(domid, table_id, data, columns){ @@ -227,7 +219,7 @@ function genTable(domid, table_id, data, columns){ } } }); - $('#' + table_id + ' tbody td.inputParm3'). + $('#' + table_id + ' tbody td.inputParm3'). editable('/themis/sqlreview/rule/info', { method: "POST", submitdata: function(value, settings) { @@ -248,35 +240,14 @@ function genTable(domid, table_id, data, columns){ } } }); - $('#' + table_id + ' tbody td.inputParm4'). - editable('/themis/sqlreview/rule/info', { - method: "POST", - submitdata: function(value, settings) { - return { - oldvalue: value, - dbtype: $(this).attr("dbtype"), - flag: "parm4" - }; - }, - callback: function(value, settings) { - var result = JSON.parse(value) - if (result["errcode"] === 80025){ - $(this).text(function(){ return result["data"]}) - } - else{ - alert(result["message"]) - $(this).text(function(){ return 0}) - } - } - }); - $('#' + table_id + ' tbody td.inputParm5'). + $('#' + table_id + ' tbody td.RuleCmd'). editable('/themis/sqlreview/rule/info', { method: "POST", submitdata: function(value, settings) { return { oldvalue: value, dbtype: $(this).attr("dbtype"), - flag: "parm5" + flag: "rule_cmd" }; }, callback: function(value, settings) { diff --git a/themis/views.py b/themis/views.py index 6538456ad9..60eab71810 100644 --- a/themis/views.py +++ b/themis/views.py @@ -161,9 +161,8 @@ def get(self, request): parms[0], parms[1], parms[2], - parms[3], - parms[4], - value.get("exclude_obj_type", "无") + value["rule_cmd"], + value.get("exclude_obj_type", "无"), ]) return {"errcode": 80013, "message": u"查询成功", "data": data}