diff --git a/jikimo_frontend/__manifest__.py b/jikimo_frontend/__manifest__.py index 7c17b18a..fc3c7549 100644 --- a/jikimo_frontend/__manifest__.py +++ b/jikimo_frontend/__manifest__.py @@ -10,7 +10,7 @@ """, 'category': 'sf', 'website': 'https://www.sf.jikimo.com', - 'depends': ['account', 'base', 'mrp_workorder', 'sale'], + 'depends': [], 'data': [ ], @@ -21,6 +21,7 @@ 'web.assets_qweb': [ ], 'web.assets_backend': [ + 'jikimo_frontend/static/src/fields/custom_many2many_checkboxes/*', 'jikimo_frontend/static/src/scss/test.scss', ], diff --git a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.css b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.css new file mode 100644 index 00000000..de17fabb --- /dev/null +++ b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.css @@ -0,0 +1,6 @@ +.zoomed { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%) scale(20); +} diff --git a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js new file mode 100644 index 00000000..f3cadea1 --- /dev/null +++ b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js @@ -0,0 +1,26 @@ +/** @odoo-module **/ + +import { Many2ManyCheckboxesField } from "@web/views/fields/many2many_checkboxes/many2many_checkboxes_field"; +import { registry } from "@web/core/registry"; + +export class MyCustomWidget extends Many2ManyCheckboxesField { + // 你可以重写或者添加一些方法和属性 + // 例如,你可以重写setup方法来添加一些事件监听器或者初始化一些变量 + setup() { + super.setup(); // 调用父类的setup方法 + // 你自己的代码 + } + onImageClick(event) { + // 放大图片逻辑 + // 获取图片元素 + const img = event.target; + + // 实现放大图片逻辑 + // 比如使用 CSS 放大 + img.classList.add('zoomed'); + } +} +MyCustomWidget.template = "sf_plan.MyCustomWidget" +// MyCustomWidget.supportedTypes = ['many2many']; + +registry.category("fields").add("custom_many2many_checkboxes", MyCustomWidget); diff --git a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml new file mode 100644 index 00000000..91eaff59 --- /dev/null +++ b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml @@ -0,0 +1,27 @@ + + + + +
+ +
+ + + + + +
+
+ + + +
+
+
+
+ +
diff --git a/sf_machine_connect/views/compensation.xml b/sf_machine_connect/views/compensation.xml index 5ec6f382..f79c539e 100644 --- a/sf_machine_connect/views/compensation.xml +++ b/sf_machine_connect/views/compensation.xml @@ -6,7 +6,8 @@ -