From 57facfaf80f4f354ffb39cb06cc92f2defc6a6c0 Mon Sep 17 00:00:00 2001 From: Jingle <599194993@qq.com> Date: Thu, 3 Dec 2020 12:21:19 +0800 Subject: [PATCH 1/4] fix bug --- simpleui/__init__.py | 2 +- simpleui/static/admin/simpleui-x/js/index.js | 1 - simpleui/templates/admin/actions.html | 3 ++- simpleui/templates/admin/includes/js-part.html | 4 ++-- simpleui/templates/admin/search_form.html | 1 - 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/simpleui/__init__.py b/simpleui/__init__.py index ff11571d..aba2d8be 100644 --- a/simpleui/__init__.py +++ b/simpleui/__init__.py @@ -2,4 +2,4 @@ def get_version(): - return '2021.1.0' + return '2021.1.1' diff --git a/simpleui/static/admin/simpleui-x/js/index.js b/simpleui/static/admin/simpleui-x/js/index.js index 8a9ae605..5051e347 100644 --- a/simpleui/static/admin/simpleui-x/js/index.js +++ b/simpleui/static/admin/simpleui-x/js/index.js @@ -290,7 +290,6 @@ } else if (name == 'font') { fontEvents.push(handler); }else if(name=='title'){ - console.log(handler) app.tabs.forEach(item=>{ if(item.eid==app.tabModel){ item.name = handler; diff --git a/simpleui/templates/admin/actions.html b/simpleui/templates/admin/actions.html index b814efb4..46a9c430 100644 --- a/simpleui/templates/admin/actions.html +++ b/simpleui/templates/admin/actions.html @@ -238,8 +238,9 @@ axios.post('{% get_model_ajax_url %}', data).then(res => { if(res.data.status=='success'){ self.visible = false; + //1.5s 后刷新 + setTimeout(() => window.location.reload(), 1000); } - self.$message({ message: res.data.msg, type: res.data.status diff --git a/simpleui/templates/admin/includes/js-part.html b/simpleui/templates/admin/includes/js-part.html index 7561bf5b..2b3aba37 100644 --- a/simpleui/templates/admin/includes/js-part.html +++ b/simpleui/templates/admin/includes/js-part.html @@ -1,8 +1,8 @@ {% load static simpletags %} {% if "SIMPLEUI_STATIC_OFFLINE"|get_config %} - -{# #} +{##} + {% else %} diff --git a/simpleui/templates/admin/search_form.html b/simpleui/templates/admin/search_form.html index 6b7f4f9e..0c9e5748 100644 --- a/simpleui/templates/admin/search_form.html +++ b/simpleui/templates/admin/search_form.html @@ -114,7 +114,6 @@ {% block index_js %} + {% endblock %} {% block autoupdate %} diff --git a/simpleui/templatetags/simpletags.py b/simpleui/templatetags/simpletags.py index 547bcebe..853ed6f4 100644 --- a/simpleui/templatetags/simpletags.py +++ b/simpleui/templatetags/simpletags.py @@ -258,14 +258,14 @@ def menus(context, _get_config=None): # 给每个菜单增加一个唯一标识,用于tab页判断 eid = 1000 - for i in data: - eid += 1 - i['eid'] = eid - if 'models' in i: - for k in i.get('models'): - eid += 1 - k['eid'] = eid - + # for i in data: + # eid += 1 + # i['eid'] = eid + # if 'models' in i: + # for k in i.get('models'): + # eid += 1 + # k['eid'] = eid + handler_eid(data, eid) menus_string = json.dumps(data, cls=LazyEncoder) # 把data放入session中,其他地方可以调用 @@ -275,6 +275,14 @@ def menus(context, _get_config=None): return ''.format(menus_string) +def handler_eid(data, eid): + for i in data: + eid += 1 + i['eid'] = eid + if 'models' in i: + handler_eid(i.get('models'),eid) + + def get_icon(obj, name=None): temp = get_config_icon(name) if temp != '': From ec640907b48c4ca022b07efee6e78599f7c8187f Mon Sep 17 00:00:00 2001 From: Jingle <599194993@qq.com> Date: Tue, 26 Jan 2021 15:27:12 +0800 Subject: [PATCH 4/4] release version: 2021.2 --- simpleui/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simpleui/__init__.py b/simpleui/__init__.py index 866632f7..2ef4d4d1 100644 --- a/simpleui/__init__.py +++ b/simpleui/__init__.py @@ -2,4 +2,4 @@ def get_version(): - return '2021.1.26' + return '2021.2'