diff --git a/jikimo_frontend/__init__.py b/jikimo_frontend/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/jikimo_frontend/__manifest__.py b/jikimo_frontend/__manifest__.py new file mode 100644 index 00000000..716bc918 --- /dev/null +++ b/jikimo_frontend/__manifest__.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. +{ + 'name': '机企猫智能工厂 样式调整', + 'version': '1.0', + 'summary': '机企猫智能工厂 样式调整', + 'sequence': 1, + 'description': """ +在本模块,定义了样式的修改 + """, + 'category': 'sf', + 'website': 'https://www.sf.jikimo.com', + 'depends': [], + 'data': [ + + ], + 'demo': [ + ], + 'assets': { + + 'web.assets_qweb': [ + ], + 'web.assets_backend': [ + 'jikimo_frontend/static/src/fields/custom_many2many_checkboxes/*', + 'jikimo_frontend/static/src/scss/custom_style.scss', + ], + + }, + 'license': 'LGPL-3', + 'installable': True, + 'application': False, + 'auto_install': False, +} 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..df6cdfb6 --- /dev/null +++ b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.css @@ -0,0 +1,41 @@ +.zoomed { + position: fixed !important; + top: 50%; + left: 50%; + transform: translate(-50%, -50%) scale(10); +} + +.many2many_flex { + display: flex; +} + +.many2many_flex>div { + margin-right: 15px; + display: flex; + flex-direction: column; + align-items: center; +} + +.many2many_flex>div>:nth-child(2) { + position: relative; +} + +.close { + width: 20px; + height: 20px; + position: absolute; + top: -8.8px; + right: -8.8px; + color: #fff; + background-color: #000; + opacity: 0; + text-align: center; + line-height: 20px; + font-size: 18px; +} + +.img_close { + opacity: 1; + transform: scale(0.1); + cursor: pointer; +} \ No newline at end of file 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..5845dbae --- /dev/null +++ b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js @@ -0,0 +1,37 @@ +/** @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; + const close = img.nextSibling + + // 实现放大图片逻辑 + // 比如使用 CSS 放大 + img.parentElement.classList.add('zoomed'); + close.classList.add('img_close') + } + + onCloseClick(event) { + const close = event.target; + const img = close.previousSibling + img.parentElement.classList.remove('zoomed') + close.classList.remove('img_close') + } +} + +MyCustomWidget.template = "jikimo_frontend.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..bebae03b --- /dev/null +++ b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml @@ -0,0 +1,28 @@ + + + + +
+ +
+ + + + +
+ + +
×
+
+
+
+ +
+
+
+ +
diff --git a/jikimo_frontend/static/src/scss/custom_style.scss b/jikimo_frontend/static/src/scss/custom_style.scss new file mode 100644 index 00000000..a9f2cee8 --- /dev/null +++ b/jikimo_frontend/static/src/scss/custom_style.scss @@ -0,0 +1,151 @@ +.test_model { + display: flex !important; +} + +.test_model > .o_form_label { + margin-left: 20px; + margin-right: 0px !important; + white-space: nowrap; +} + +div:has(.o_required_modifier) > label::before { + content: '*' !important; + color: red !important; + padding: 0 4px !important; + vertical-align: top !important; + font-size: 1.5rem !important; +} + +.my-image div { + width: 110px !important; + height: 110px !important; +} + +.add_flex { + padding: 5px 0; + display: flex; + flex-direction: column; + justify-content: space-between; +} + +.maintenance_name { + font-weight: bold; +} + +.o_kanban_renderer .o_kanban_record .o_kanban_record_has_image_fill .o_kanban_image_fill_left { + flex: unset !important; +} + +.o_kanban_renderer .o_kanban_record .o_kanban_record_bottom { + margin-top: 5px; + display: inline !important; +} + +td.o_required_modifier { + display: table-cell !important; +} + +.show_state { + display: flex; + flex-direction: column; + position: absolute; + top: 0; + bottom: 0; + right: 8px; + margin: auto; + height: 34px; +} + +.show_state > div { + width: 12px; + height: 12px; + border: 1px solid #000 +} + +.show_state > div:nth-child(2) { + border-top: none; + border-bottom: none; +} + +.oe_kanban_card.kanban_color_2 { + background-color: #FF4343 !important; + color: #fff; +} + +.oe_kanban_card.kanban_color_1 { + background-color: #27FEA9 !important; + opacity: 0.7; + color: #fff; +} + +.oe_kanban_card.kanban_color_3 { + background-color: rgb(255, 150, 0) !important; + color: #fff; +} + +.my-image img { + width: 100%; + height: 100%; +} + +.color_1 { + background-color: #27FEA9; +} + +.color_2 { + background-color: #FF4343; +} + +.color_3 { + background-color: rgb(255, 150, 0); +} + +.font_color_1 { + color: rgb(0, 183, 0); +} + +.font_color_2 { + color: #FF4343; +} + +.font_color_3 { + color: rgb(255, 150, 0); +} + +.o_kanban_card_header_title { + font-size: 15px; +} + +.o_kanban_record_bottom { + font-family: '华文中宋'; + //font-weight: bold; +} + +.text-truncate { + overflow: unset !important; + text-overflow: unset !important; + white-space: unset !important; +} + +.o_list_renderer .o_list_table tbody > tr > td:not(.o_list_record_selector):not(.o_handle_cell):not(.o_list_button):not(.o_list_record_remove) { + white-space: nowrap !important; +} + +.o_status { + width: 18px; + height: 18px; +} + +.czyg { + font-size: 12px; + margin-right: 10px; + color: #aaa; +} + +.o_kanban_primary_left { + display: flex; + flex-direction: row-reverse; + justify-content: flex-start; +} + +//----------------------------------------------------------- \ No newline at end of file diff --git a/sf_base/models/tool_base_new.py b/sf_base/models/tool_base_new.py index 04b8338a..fc62074e 100644 --- a/sf_base/models/tool_base_new.py +++ b/sf_base/models/tool_base_new.py @@ -108,6 +108,7 @@ class CuttingToolModel(models.Model): tool_thickness = fields.Integer('厚度(mm)') tool_weight = fields.Float('重量(kg)') coating_material = fields.Char('涂层材质') + # 整体式刀具参数 total_length = fields.Float('总长度(mm)') shank_length = fields.Float('柄部长度(mm)') diff --git a/sf_base/security/ir.model.access.csv b/sf_base/security/ir.model.access.csv index 2cb14006..fefaeb1b 100644 --- a/sf_base/security/ir.model.access.csv +++ b/sf_base/security/ir.model.access.csv @@ -32,3 +32,4 @@ access_sf_sync_common,sf_sync_common,model_sf_sync_common,base.group_user,1,1,1, + diff --git a/sf_base/static/src/scss/test.scss b/sf_base/static/src/scss/test.scss index 8495e5cd..a54eb808 100644 --- a/sf_base/static/src/scss/test.scss +++ b/sf_base/static/src/scss/test.scss @@ -130,3 +130,35 @@ td.o_required_modifier { .o_list_renderer .o_list_table tbody > tr > td:not(.o_list_record_selector):not(.o_handle_cell):not(.o_list_button):not(.o_list_record_remove) { white-space: nowrap !important; } + +.o_status { + width: 18px; + height: 18px; +} + +.czyg { + font-size: 12px; + margin-right: 10px; + color: #aaa; +} + +.o_kanban_primary_left { + display: flex; + flex-direction: row-reverse; + justify-content: flex-start; +} + +.diameter:before { + content:"Ф"; + display:inline; +} +.diameter{ + display: flex !important; + justify-content: flex-start !important; + align-items: center !important; +} +.o_address_format { + display: flex !important; + justify-content: flex-start !important; + align-items: center !important; +} \ No newline at end of file diff --git a/sf_base/views/tool_views.xml b/sf_base/views/tool_views.xml index bfc405f9..ee5546a8 100644 --- a/sf_base/views/tool_views.xml +++ b/sf_base/views/tool_views.xml @@ -243,6 +243,7 @@ attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/> +