From f1868168af54cbe12a6c5366a81df10805a82828 Mon Sep 17 00:00:00 2001 From: hy <123@qq.com> Date: Mon, 30 Dec 2024 14:38:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BC=9A=E8=AE=A1=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E8=A1=A8=E5=A4=B4=E5=B0=91=E4=BA=86=E5=88=97bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/js/custom_form_status_indicator.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/jikimo_frontend/static/src/js/custom_form_status_indicator.js b/jikimo_frontend/static/src/js/custom_form_status_indicator.js index 46e3ad70..1e39b719 100644 --- a/jikimo_frontend/static/src/js/custom_form_status_indicator.js +++ b/jikimo_frontend/static/src/js/custom_form_status_indicator.js @@ -139,6 +139,7 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', { owl.onMounted(() => { this.activeElement = this.uiService.activeElement; this.setRequired() + this.listherHeaderBodyNum() }) return this._super(...arguments); }, @@ -165,6 +166,25 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', { } catch (e) { console.log(e) } + }, + listherHeaderBodyNum() { + const dom = this.tableRef.el + try { + const thead = $(dom).children('thead') + const tbody = $(dom).children('tbody') + const thead_tr = thead.children().eq(0) + const tbody_tr = tbody.children().eq(0) + const thead_th_num = thead_tr.children().length + const tbody_tr_num = tbody_tr.children().length + const num = thead_th_num - tbody_tr_num + console.log('num', num); + if(num == -1) { + thead_tr.prepend('序号') + } + + } catch (e) { + console.log(e) + } } })