From 1e4a06205344af754c9bb0fdb2c90273552c27cb Mon Sep 17 00:00:00 2001 From: pengyuthon Date: Wed, 14 Jan 2026 23:45:57 +0800 Subject: [PATCH 1/6] 1 --- soong_workflow/wizard/soong_workflow_comment_wizard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard.py b/soong_workflow/wizard/soong_workflow_comment_wizard.py index f2ea71b03..553aaf686 100644 --- a/soong_workflow/wizard/soong_workflow_comment_wizard.py +++ b/soong_workflow/wizard/soong_workflow_comment_wizard.py @@ -450,7 +450,7 @@ class SoongWorkflowCommentWizard(models.TransientModel): url = f'https://oa.thtzjt.com/web#id={record_id.id}&cids=2&active_id={action_id.id}&model={record_id._name}&view_type=form' result_data = self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa', user_id=employee.wecom_userid, - title=record_id._description, + title= record_id._description if 'Purchase Order' != record_id._description else '采购订单', description="标题: {}\n".format( record_id.name) + self.env.user.name + ' ' + str( fields.Datetime.now() + timedelta( From 5defc803b1671c0147268bf83ccd1c9af36e876e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Thu, 15 Jan 2026 10:20:27 +0800 Subject: [PATCH 2/6] 1 --- yuthon_hr_employee/views/inherit_hr_job_views.xml | 2 +- yuthon_official/views/yuthon_official_views.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yuthon_hr_employee/views/inherit_hr_job_views.xml b/yuthon_hr_employee/views/inherit_hr_job_views.xml index 845d9b0d1..312856978 100644 --- a/yuthon_hr_employee/views/inherit_hr_job_views.xml +++ b/yuthon_hr_employee/views/inherit_hr_job_views.xml @@ -82,7 +82,7 @@ 1 - + diff --git a/yuthon_official/views/yuthon_official_views.xml b/yuthon_official/views/yuthon_official_views.xml index 89245e416..86e91871e 100644 --- a/yuthon_official/views/yuthon_official_views.xml +++ b/yuthon_official/views/yuthon_official_views.xml @@ -94,7 +94,7 @@ - > + From 50ec178c03634ffa5955481e59477eada2579d49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Thu, 15 Jan 2026 11:08:03 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oo_list_manager/__manifest__.py | 1 + .../static/src/views/list/list_renderer.js | 137 +++++++++++++----- .../list_view_sticky_header_and_column.scss | 6 +- 3 files changed, 103 insertions(+), 41 deletions(-) diff --git a/oo_list_manager/__manifest__.py b/oo_list_manager/__manifest__.py index 009e97d58..2f43ab785 100644 --- a/oo_list_manager/__manifest__.py +++ b/oo_list_manager/__manifest__.py @@ -31,6 +31,7 @@ Long description of module's purpose 'license': 'LGPL-3', 'assets': { 'web.assets_backend': [ + 'oo_list_manager/static/src/core/ensure_jquery.js', 'oo_list_manager/static/src/views/list/*', 'oo_list_manager/static/src/views/auto_hide_list/*', ] diff --git a/oo_list_manager/static/src/views/list/list_renderer.js b/oo_list_manager/static/src/views/list/list_renderer.js index a67760924..02710d24a 100644 --- a/oo_list_manager/static/src/views/list/list_renderer.js +++ b/oo_list_manager/static/src/views/list/list_renderer.js @@ -1,24 +1,26 @@ /** @odoo-module **/ -import { ListRenderer } from "@web/views/list/list_renderer"; -import { patch } from "@web/core/utils/patch"; -import { loadJS, loadCSS } from "@web/core/assets"; -import { ListRendererCust } from "@tree_view_advanced_filter/tree_view_advanced_filter/tree" -import { onWillDestroy, useEffect } from "@odoo/owl"; +import {ListRenderer} from "@web/views/list/list_renderer"; +import {patch} from "@web/core/utils/patch"; +import {loadJS, loadCSS} from "@web/core/assets"; +import {ListRendererCust} from "@tree_view_advanced_filter/tree_view_advanced_filter/tree" +import {onWillDestroy, useEffect} from "@odoo/owl"; +import { ensureJQuery } from '../../core/ensure_jquery'; patch(ListRenderer.prototype, { setup() { super.setup(); - if (this.isX2Many) { - this.props.ooManagerSerialNum = true; - } + // 注释掉 X2Many 自动启用序号,避免布局错位 + // if (this.isX2Many) { + // this.props.ooManagerSerialNum = true; + // } const computeFunction = this.computeFreeze.bind(this); const resizeObserver = new ResizeObserver(computeFunction); + + useEffect( (tableEl) => { if (tableEl) { - // Lucky by 2025/08/08添加此行:设置 table-layout: fixed,先注释反馈有Bug - // tableEl.style.setProperty('table-layout', 'fixed', 'important'); resizeObserver.observe(tableEl); return () => resizeObserver.unobserve(tableEl); } @@ -34,10 +36,15 @@ patch(ListRenderer.prototype, { freezeColumnWidths() { super.freezeColumnWidths(); const table = this.tableRef.el; + if (!table) return; + const headers = [...table.querySelectorAll("thead th:not(.o_list_actions_header)")]; headers.forEach((th, index) => { - th.style.minWidth = `${Math.floor(this.columnWidths[index])}px`; + // 只有在自定义列宽存在时才设置 minWidth + if (this.columnWidths[index]) { + th.style.minWidth = `${Math.floor(this.columnWidths[index])}px`; + } }); this._computeLock(); }, @@ -53,10 +60,63 @@ patch(ListRenderer.prototype, { setTimeout(computeFunction, 200); }); }, + + // _computeLock() { + // const table = this.tableRef.el; + // if (!table) return; + + // const thead = [...table.querySelectorAll('thead tr:first-child th')]; + // const filterBox = [...table.querySelectorAll('thead .o_filter_box td')]; + // const tbody = [...table.querySelectorAll('tbody tr')]; + // const tfoot = [...table.querySelectorAll('tfoot tr')]; + + // const setStyle = (element, left, z = 10) => { + // element.classList.add('position-sticky', 'o_column_freeze'); + // Object.assign(element.style, { + // left: `${left}px`, + // zIndex: `${z}`, + // }); + // }; + + // const removeStyle = (element) => { + // element.classList.remove('position-sticky', 'o_column_freeze'); + // element.style.left = ''; + // element.style.zIndex = ''; + // }; + + // for (let i = 0; i < thead.length; i++) { + // const th = thead[i]; + // const shouldFreeze = th.classList.contains('o_column_freeze') || + // th.classList.contains('o_list_record_selector') || + // th.classList.contains('list-number'); + + // if (shouldFreeze) { + // let left = 0; + // for (let j = 0; j < i; j++) { + // left += thead[j].getBoundingClientRect().width; + // } + + // setStyle(th, left, 20); + // if (filterBox[i]) setStyle(filterBox[i], left, 30); + // tbody.forEach(tr => tr.classList.contains('o_data_row') && setStyle(tr.children[i], left, 10)); + // tfoot.forEach(tr => setStyle(tr.children[i], left, 10)); + // } else { + // removeStyle(th); + // if (filterBox[i]) removeStyle(filterBox[i]); + // tbody.forEach(tr => tr.classList.contains('o_data_row') && removeStyle(tr.children[i])); + // tfoot.forEach(tr => removeStyle(tr.children[i])); + // } + // } + // }, _computeLock() { const table = this.tableRef.el; if (!table) return; + // 对于 X2Many 字段,如果没有启用列管理功能,则不应用列冻结 + if (this.isX2Many && !this.props.ooManagerColumns) { + return; + } + const thead = [...table.querySelectorAll('thead tr:first-child th')]; const filterBox = [...table.querySelectorAll('thead .o_filter_box td')]; const tbody = [...table.querySelectorAll('tbody tr')]; @@ -64,6 +124,7 @@ patch(ListRenderer.prototype, { const groupHeaders = [...table.querySelectorAll('tbody tr.o_group_header')]; const setStyle = (element, left, z = 10) => { + if (!element) return; element.classList.add('position-sticky', 'o_column_freeze'); Object.assign(element.style, { left: `${left}px`, @@ -72,6 +133,7 @@ patch(ListRenderer.prototype, { }; const removeStyle = (element) => { + if (!element) return; element.classList.remove('position-sticky', 'o_column_freeze'); element.style.left = ''; element.style.zIndex = ''; @@ -108,14 +170,11 @@ patch(ListRenderer.prototype, { const cell = tr.children[i]; if (cell) setStyle(cell, left, 10); }); - console.log('groupHeaders',groupHeaders) + // 冻结分组行 groupHeaders.forEach(tr => { const cell = tr.children[i]; - - //if (cell) setStyle(cell, left, 4); // 比 body 高,比 header 低 - // 分组头部是不是 left= 0 就行. 头部都固定左侧. - if(cell) setStyle(cell, 0, 4); + if (cell) setStyle(cell, left, 15); // 比 body 高,比 header 低 }); } else { @@ -146,6 +205,7 @@ patch(ListRenderer.prototype, { // 针对右侧的(尾列的数据冻结功能) // 样式增加 hover const setRightStyle = (element, right) => { + if (!element) return; element.classList.add('position-sticky', 'position-sticky-right'); Object.assign(element.style, { right: `${right}px`, @@ -155,12 +215,15 @@ patch(ListRenderer.prototype, { } const resetRightStyle = (element) => { - element.classList.remove('position-sticky'); - element.style.right = 'auto'; + if (!element) return; + element.classList.remove('position-sticky', 'position-sticky-right'); + element.style.right = ''; + element.style.backgroundColor = ''; element.style.zIndex = ''; } if (this.props.ooManagerStickyEnd) { + console.log('ooManagerStickyEnd') let rightOffset = 0; const rightStickyIndices = []; @@ -216,6 +279,7 @@ patch(ListRenderer.prototype, { * @returns {boolean} */ get hasOptionalFields() { + console.log('hasOptionalFields') return false }, get displayOptionalFields() { @@ -225,6 +289,7 @@ patch(ListRenderer.prototype, { getActiveColumns(list) { if (this.props.ooManagerColumns) { + // console.log(this.allColumns) const columns = this.allColumns.filter((col) => { if (list.isGrouped && col.widget === "handle") return false; const mColumn = this.props.ooManagerColumns.find(item => item.id === col.id); @@ -269,16 +334,20 @@ patch(ListRenderer.prototype, { computeColumnWidthsFromContent(allowedWidth) { const columnWidths = super.computeColumnWidthsFromContent(allowedWidth); if (!this.props.ooManagerColumns) return columnWidths; + const table = this.tableRef.el; + if (!table) return columnWidths; table.classList.add("o_list_computing_widths"); const headers = [...table.querySelectorAll("thead th")]; headers.forEach((th, index) => { const id = th.getAttribute('data-id'); - const mColumn = this.props.ooManagerColumns.find(item => item.id === id); - if (mColumn && mColumn.width) { - columnWidths[index] = mColumn.width; + if (id) { + const mColumn = this.props.ooManagerColumns.find(item => item.id === id); + if (mColumn && mColumn.width && mColumn.width > 0) { + columnWidths[index] = mColumn.width; + } } }); @@ -289,38 +358,31 @@ patch(ListRenderer.prototype, { getColumnStyle(column) { if (!this.props.ooManagerColumns) return ''; const mColumn = this.props.ooManagerColumns.find(item => item.id === column.id); - const styles = []; - if (mColumn?.width) { - styles.push(`width: ${mColumn.width}px`); - styles.push(`min-width: ${mColumn.width}px`); - styles.push(`max-width: ${mColumn.width}px`); + if (mColumn && mColumn.color) { + return `color: ${mColumn.color};`; } - - if (mColumn?.color) { - styles.push(`color: ${mColumn.color}`); - } - - return styles.join('; '); + return ''; }, _renderSearchPanel: async function () { + await ensureJQuery(); if (this.isX2Many) { return ListRendererCust._renderSearchPanel.call(this); } if (!this.props.archInfo.advanced_filter) { - $('.o_filter_box').remove(); + $('.o_filter_box').remove(); // $ is not defined + // document.querySelectorAll('.o_filter_box').forEach(el => el.remove()); } else { + await loadJS("/tree_view_advanced_filter/static/src/libs/moment/moment.min.js"); await loadJS("/tree_view_advanced_filter/static/src/libs/daterangepicker.min.js"); await loadCSS("/tree_view_advanced_filter/static/src/libs/daterangepicker.css"); - await loadJS("/tree_view_advanced_filter/static/src/libs/moment/moment.min.js"); - const List = this.props.list; const rootRef = this.rootRef.el; const tableRef = this.tableRef.el; tableRef.removeAttribute('style'); const columns = this.getActiveColumns(this.props.list); - const $tr1 = $('', { class: 'o_filter_box' }).append(columns.map(col => this._renderHeaderCellSearch(col))); + const $tr1 = $('', {class: 'o_filter_box'}).append(columns.map(col => this._renderHeaderCellSearch(col))); if (this.props.ooManagerSerialNum) $tr1.prepend($('').addClass('web_list_num')); if (this.hasSelectors) $tr1.prepend($('').addClass('o_list_record_selector')); if (this.isStudioEditable || this.displayOptionalFields) $tr1.append($('').addClass('o_list_record_selector')); @@ -330,7 +392,6 @@ patch(ListRenderer.prototype, { } else { $tr1.insertAfter($(tableRef).find('tr')[0]); } - rootRef.querySelectorAll('thead tr td.search_td input').forEach((a) => a.addEventListener('keyup', this._onfilter.bind(this))); rootRef.querySelectorAll('.search_button').forEach((a) => a.addEventListener('click', this._onSearch.bind(this))); rootRef.querySelectorAll('.remove_button').forEach((a) => a.addEventListener('click', this._onRemove.bind(this))); @@ -342,4 +403,4 @@ patch(ListRenderer.prototype, { ListRenderer.props.push('ooManagerColumns?'); ListRenderer.props.push('ooManagerFilter?'); ListRenderer.props.push('ooManagerSerialNum?'); -ListRenderer.props.push('ooManagerStickyEnd?'); +ListRenderer.props.push('ooManagerStickyEnd?'); \ No newline at end of file diff --git a/tree_view_advanced_filter/static/src/list_view_sticky_header_and_column/scss/list_view_sticky_header_and_column.scss b/tree_view_advanced_filter/static/src/list_view_sticky_header_and_column/scss/list_view_sticky_header_and_column.scss index fe1f837af..c839079e6 100644 --- a/tree_view_advanced_filter/static/src/list_view_sticky_header_and_column/scss/list_view_sticky_header_and_column.scss +++ b/tree_view_advanced_filter/static/src/list_view_sticky_header_and_column/scss/list_view_sticky_header_and_column.scss @@ -21,9 +21,9 @@ overflow-x: auto; overflow-y: visible; } -.table-responsive { - overflow: visible; -} +// .table-responsive { +// overflow: visible; +// } .o_list_view .table-responsive .table thead { z-index: 20; } From 455b25823c017dfdd51629ce9a7680ae1b0b2d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Thu, 15 Jan 2026 11:41:30 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_official/models/officical_type.py | 2 ++ yuthon_official/views/official_type_views.xml | 1 + 2 files changed, 3 insertions(+) diff --git a/yuthon_official/models/officical_type.py b/yuthon_official/models/officical_type.py index dd6994d8d..bc9161ac0 100644 --- a/yuthon_official/models/officical_type.py +++ b/yuthon_official/models/officical_type.py @@ -14,8 +14,10 @@ class OfficialType(models.Model): class MainFlats(models.Model): _name = 'main.flats' _description = '主送/抄送单位' + _order = 'sequence' name = fields.Char(string="主送/抄送单位") + sequence = fields.Integer(string='排序序号') class CopyFlats(models.Model): diff --git a/yuthon_official/views/official_type_views.xml b/yuthon_official/views/official_type_views.xml index 8e3c5e531..701b874f5 100644 --- a/yuthon_official/views/official_type_views.xml +++ b/yuthon_official/views/official_type_views.xml @@ -20,6 +20,7 @@ main.flats + From 77f847d953aac0a2b1406cd158c70a528b1eacb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Thu, 15 Jan 2026 12:41:40 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contract_review_report_templates.xml | 44 ++++++++++++++----- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/yuthon_hr_employee_approval/report/contract_review_report_templates.xml b/yuthon_hr_employee_approval/report/contract_review_report_templates.xml index 52176d45a..a19813d76 100644 --- a/yuthon_hr_employee_approval/report/contract_review_report_templates.xml +++ b/yuthon_hr_employee_approval/report/contract_review_report_templates.xml @@ -6,7 +6,7 @@
- 合同审查单 + 会审意见表
- +
- 承办部门: + 承办部门:
@@ -47,6 +47,22 @@ + + + + + + + + @@ -54,11 +70,19 @@ - + + + + + - + - + - + ', {class: 'o_filter_box'}).append(columns.map(col => this._renderHeaderCellSearch(col))); + const $tr1 = $('', { class: 'o_filter_box' }).append(columns.map(col => this._renderHeaderCellSearch(col))); if (this.props.ooManagerSerialNum) $tr1.prepend($('
审批类型 + 合同 + 章程 +
业务类型 + + + , + +
合同类型 合同金额
情况说明
律师意见 + +
+
+
附件清单
@@ -71,9 +95,9 @@
From 76b9a4ef9a5eda1eb1de777664eb61757995efd3 Mon Sep 17 00:00:00 2001 From: pengyuthon Date: Thu, 15 Jan 2026 15:05:35 +0800 Subject: [PATCH 6/6] 1 --- oo_list_manager/__manifest__.py | 1 - .../static/src/views/list/list_renderer.js | 135 +++++------------- 2 files changed, 38 insertions(+), 98 deletions(-) diff --git a/oo_list_manager/__manifest__.py b/oo_list_manager/__manifest__.py index 2f43ab785..009e97d58 100644 --- a/oo_list_manager/__manifest__.py +++ b/oo_list_manager/__manifest__.py @@ -31,7 +31,6 @@ Long description of module's purpose 'license': 'LGPL-3', 'assets': { 'web.assets_backend': [ - 'oo_list_manager/static/src/core/ensure_jquery.js', 'oo_list_manager/static/src/views/list/*', 'oo_list_manager/static/src/views/auto_hide_list/*', ] diff --git a/oo_list_manager/static/src/views/list/list_renderer.js b/oo_list_manager/static/src/views/list/list_renderer.js index 02710d24a..bbdb1e22a 100644 --- a/oo_list_manager/static/src/views/list/list_renderer.js +++ b/oo_list_manager/static/src/views/list/list_renderer.js @@ -1,26 +1,24 @@ /** @odoo-module **/ -import {ListRenderer} from "@web/views/list/list_renderer"; -import {patch} from "@web/core/utils/patch"; -import {loadJS, loadCSS} from "@web/core/assets"; -import {ListRendererCust} from "@tree_view_advanced_filter/tree_view_advanced_filter/tree" -import {onWillDestroy, useEffect} from "@odoo/owl"; -import { ensureJQuery } from '../../core/ensure_jquery'; +import { ListRenderer } from "@web/views/list/list_renderer"; +import { patch } from "@web/core/utils/patch"; +import { loadJS, loadCSS } from "@web/core/assets"; +import { ListRendererCust } from "@tree_view_advanced_filter/tree_view_advanced_filter/tree" +import { onWillDestroy, useEffect } from "@odoo/owl"; patch(ListRenderer.prototype, { setup() { super.setup(); - // 注释掉 X2Many 自动启用序号,避免布局错位 - // if (this.isX2Many) { - // this.props.ooManagerSerialNum = true; - // } + if (this.isX2Many) { + this.props.ooManagerSerialNum = true; + } const computeFunction = this.computeFreeze.bind(this); const resizeObserver = new ResizeObserver(computeFunction); - - useEffect( (tableEl) => { if (tableEl) { + // Lucky by 2025/08/08添加此行:设置 table-layout: fixed,先注释反馈有Bug + // tableEl.style.setProperty('table-layout', 'fixed', 'important'); resizeObserver.observe(tableEl); return () => resizeObserver.unobserve(tableEl); } @@ -36,15 +34,10 @@ patch(ListRenderer.prototype, { freezeColumnWidths() { super.freezeColumnWidths(); const table = this.tableRef.el; - if (!table) return; - const headers = [...table.querySelectorAll("thead th:not(.o_list_actions_header)")]; headers.forEach((th, index) => { - // 只有在自定义列宽存在时才设置 minWidth - if (this.columnWidths[index]) { - th.style.minWidth = `${Math.floor(this.columnWidths[index])}px`; - } + th.style.minWidth = `${Math.floor(this.columnWidths[index])}px`; }); this._computeLock(); }, @@ -60,63 +53,10 @@ patch(ListRenderer.prototype, { setTimeout(computeFunction, 200); }); }, - - // _computeLock() { - // const table = this.tableRef.el; - // if (!table) return; - - // const thead = [...table.querySelectorAll('thead tr:first-child th')]; - // const filterBox = [...table.querySelectorAll('thead .o_filter_box td')]; - // const tbody = [...table.querySelectorAll('tbody tr')]; - // const tfoot = [...table.querySelectorAll('tfoot tr')]; - - // const setStyle = (element, left, z = 10) => { - // element.classList.add('position-sticky', 'o_column_freeze'); - // Object.assign(element.style, { - // left: `${left}px`, - // zIndex: `${z}`, - // }); - // }; - - // const removeStyle = (element) => { - // element.classList.remove('position-sticky', 'o_column_freeze'); - // element.style.left = ''; - // element.style.zIndex = ''; - // }; - - // for (let i = 0; i < thead.length; i++) { - // const th = thead[i]; - // const shouldFreeze = th.classList.contains('o_column_freeze') || - // th.classList.contains('o_list_record_selector') || - // th.classList.contains('list-number'); - - // if (shouldFreeze) { - // let left = 0; - // for (let j = 0; j < i; j++) { - // left += thead[j].getBoundingClientRect().width; - // } - - // setStyle(th, left, 20); - // if (filterBox[i]) setStyle(filterBox[i], left, 30); - // tbody.forEach(tr => tr.classList.contains('o_data_row') && setStyle(tr.children[i], left, 10)); - // tfoot.forEach(tr => setStyle(tr.children[i], left, 10)); - // } else { - // removeStyle(th); - // if (filterBox[i]) removeStyle(filterBox[i]); - // tbody.forEach(tr => tr.classList.contains('o_data_row') && removeStyle(tr.children[i])); - // tfoot.forEach(tr => removeStyle(tr.children[i])); - // } - // } - // }, _computeLock() { const table = this.tableRef.el; if (!table) return; - // 对于 X2Many 字段,如果没有启用列管理功能,则不应用列冻结 - if (this.isX2Many && !this.props.ooManagerColumns) { - return; - } - const thead = [...table.querySelectorAll('thead tr:first-child th')]; const filterBox = [...table.querySelectorAll('thead .o_filter_box td')]; const tbody = [...table.querySelectorAll('tbody tr')]; @@ -170,11 +110,14 @@ patch(ListRenderer.prototype, { const cell = tr.children[i]; if (cell) setStyle(cell, left, 10); }); - + console.log('groupHeaders',groupHeaders) // 冻结分组行 groupHeaders.forEach(tr => { const cell = tr.children[i]; - if (cell) setStyle(cell, left, 15); // 比 body 高,比 header 低 + + //if (cell) setStyle(cell, left, 4); // 比 body 高,比 header 低 + // 分组头部是不是 left= 0 就行. 头部都固定左侧. + if(cell) setStyle(cell, 0, 4); }); } else { @@ -205,7 +148,6 @@ patch(ListRenderer.prototype, { // 针对右侧的(尾列的数据冻结功能) // 样式增加 hover const setRightStyle = (element, right) => { - if (!element) return; element.classList.add('position-sticky', 'position-sticky-right'); Object.assign(element.style, { right: `${right}px`, @@ -215,15 +157,12 @@ patch(ListRenderer.prototype, { } const resetRightStyle = (element) => { - if (!element) return; - element.classList.remove('position-sticky', 'position-sticky-right'); - element.style.right = ''; - element.style.backgroundColor = ''; + element.classList.remove('position-sticky'); + element.style.right = 'auto'; element.style.zIndex = ''; } if (this.props.ooManagerStickyEnd) { - console.log('ooManagerStickyEnd') let rightOffset = 0; const rightStickyIndices = []; @@ -279,7 +218,6 @@ patch(ListRenderer.prototype, { * @returns {boolean} */ get hasOptionalFields() { - console.log('hasOptionalFields') return false }, get displayOptionalFields() { @@ -289,7 +227,6 @@ patch(ListRenderer.prototype, { getActiveColumns(list) { if (this.props.ooManagerColumns) { - // console.log(this.allColumns) const columns = this.allColumns.filter((col) => { if (list.isGrouped && col.widget === "handle") return false; const mColumn = this.props.ooManagerColumns.find(item => item.id === col.id); @@ -334,20 +271,16 @@ patch(ListRenderer.prototype, { computeColumnWidthsFromContent(allowedWidth) { const columnWidths = super.computeColumnWidthsFromContent(allowedWidth); if (!this.props.ooManagerColumns) return columnWidths; - const table = this.tableRef.el; - if (!table) return columnWidths; table.classList.add("o_list_computing_widths"); const headers = [...table.querySelectorAll("thead th")]; headers.forEach((th, index) => { const id = th.getAttribute('data-id'); - if (id) { - const mColumn = this.props.ooManagerColumns.find(item => item.id === id); - if (mColumn && mColumn.width && mColumn.width > 0) { - columnWidths[index] = mColumn.width; - } + const mColumn = this.props.ooManagerColumns.find(item => item.id === id); + if (mColumn && mColumn.width) { + columnWidths[index] = mColumn.width; } }); @@ -358,31 +291,38 @@ patch(ListRenderer.prototype, { getColumnStyle(column) { if (!this.props.ooManagerColumns) return ''; const mColumn = this.props.ooManagerColumns.find(item => item.id === column.id); - if (mColumn && mColumn.color) { - return `color: ${mColumn.color};`; + const styles = []; + if (mColumn?.width) { + styles.push(`width: ${mColumn.width}px`); + styles.push(`min-width: ${mColumn.width}px`); + styles.push(`max-width: ${mColumn.width}px`); } - return ''; + + if (mColumn?.color) { + styles.push(`color: ${mColumn.color}`); + } + + return styles.join('; '); }, _renderSearchPanel: async function () { - await ensureJQuery(); if (this.isX2Many) { return ListRendererCust._renderSearchPanel.call(this); } if (!this.props.archInfo.advanced_filter) { - $('.o_filter_box').remove(); // $ is not defined - // document.querySelectorAll('.o_filter_box').forEach(el => el.remove()); + $('.o_filter_box').remove(); } else { - await loadJS("/tree_view_advanced_filter/static/src/libs/moment/moment.min.js"); await loadJS("/tree_view_advanced_filter/static/src/libs/daterangepicker.min.js"); await loadCSS("/tree_view_advanced_filter/static/src/libs/daterangepicker.css"); + await loadJS("/tree_view_advanced_filter/static/src/libs/moment/moment.min.js"); + const List = this.props.list; const rootRef = this.rootRef.el; const tableRef = this.tableRef.el; tableRef.removeAttribute('style'); const columns = this.getActiveColumns(this.props.list); - const $tr1 = $('
').addClass('web_list_num')); if (this.hasSelectors) $tr1.prepend($('').addClass('o_list_record_selector')); if (this.isStudioEditable || this.displayOptionalFields) $tr1.append($('').addClass('o_list_record_selector')); @@ -392,6 +332,7 @@ patch(ListRenderer.prototype, { } else { $tr1.insertAfter($(tableRef).find('tr')[0]); } + rootRef.querySelectorAll('thead tr td.search_td input').forEach((a) => a.addEventListener('keyup', this._onfilter.bind(this))); rootRef.querySelectorAll('.search_button').forEach((a) => a.addEventListener('click', this._onSearch.bind(this))); rootRef.querySelectorAll('.remove_button').forEach((a) => a.addEventListener('click', this._onRemove.bind(this))); @@ -403,4 +344,4 @@ patch(ListRenderer.prototype, { ListRenderer.props.push('ooManagerColumns?'); ListRenderer.props.push('ooManagerFilter?'); ListRenderer.props.push('ooManagerSerialNum?'); -ListRenderer.props.push('ooManagerStickyEnd?'); \ No newline at end of file +ListRenderer.props.push('ooManagerStickyEnd?');