From cf70c857789b4e5117ba76744a1d2b591a62de82 Mon Sep 17 00:00:00 2001 From: aqu415 Date: Sun, 13 Feb 2022 12:56:43 +0800 Subject: [PATCH] update --- server/views.py | 2 +- static/html/list.html | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/server/views.py b/server/views.py index 3b0a733..fe43101 100644 --- a/server/views.py +++ b/server/views.py @@ -57,7 +57,7 @@ class JsMindLogView(ListAPIView): coop_mind_name = request.data.get('mind_name') snapshot_data = request.data.get('snapshot_data') print(snapshot_data) - mind = CooperationMind(coop_mind_name=coop_mind_name, client_id='', snapshot_log_id=-1, creator=-1, snapshot_data=snapshot_data) + mind = CooperationMind(coop_mind_name=coop_mind_name, client_id='', snapshot_log_id=-1, creator=9527, snapshot_data=snapshot_data) mind.save() return build_response(data=mind.id) diff --git a/static/html/list.html b/static/html/list.html index 754ca84..4cb6cf1 100644 --- a/static/html/list.html +++ b/static/html/list.html @@ -49,13 +49,16 @@ }, // 获取数据 fetch_data: function () { + const me = this const get_param = {'page': this.current_page, 'page_size': this.limit} if (this.get_coop_mind_name()) { get_param.coop_mind_name = this.get_coop_mind_name() } $.get('list', get_param, function (resp) { - console.log(resp) + // 清空数据 $('#layui-table tbody').empty() + $('#' + me.opts.page_bar_elem).empty() + const results = resp.results results.forEach(item => { const tr = ` @@ -63,13 +66,17 @@ ${item.creator} ${item.create_time} ${item.update_time} - + + 编辑 + 复制分享 + ` $('#layui-table tbody').append(tr) }) + + // 分页组件 + me.auto_page_bar() }) - // 分页组件 - this.auto_page_bar() }, get_coop_mind_name: function () { return $('#mind_name').val()