Accept Merge Request #1817: (feature/前端样式修改 -> develop)

Merge Request: 增加刀具管理的展开列

Created By: @黄焱
Reviewed By: @胡尧
Approved By: @胡尧 
Accepted By: @黄焱
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1817
This commit is contained in:
黄焱
2025-02-18 16:24:30 +08:00
committed by Coding
3 changed files with 10 additions and 33 deletions

View File

@@ -9,7 +9,6 @@ import {ListRenderer} from "@web/views/list/list_renderer";
import {FormLabel} from "@web/views/form/form_label"; import {FormLabel} from "@web/views/form/form_label";
import { fieldVisualFeedback } from "@web/views/fields/field"; import { fieldVisualFeedback } from "@web/views/fields/field";
import {Field} from "@web/views/fields/field";
var Dialog = require('web.Dialog'); var Dialog = require('web.Dialog');
// var {patch} = require("web.utils") 这句话也行 // var {patch} = require("web.utils") 这句话也行
@@ -53,7 +52,6 @@ const tableRequiredList = [
'product_template_id', 'product_uom_qty', 'price_unit','product_id','product_qty', 'product_template_id', 'product_uom_qty', 'price_unit','product_id','product_qty',
'name', 'fault_type', 'maintenance_standards', 'Period' 'name', 'fault_type', 'maintenance_standards', 'Period'
] ]
patch(FormStatusIndicator.prototype, 'jikimo_frontend.FormStatusIndicator', { patch(FormStatusIndicator.prototype, 'jikimo_frontend.FormStatusIndicator', {
setup() { setup() {
owl.onMounted(() => { owl.onMounted(() => {
@@ -109,30 +107,7 @@ patch(FormStatusIndicator.prototype, 'jikimo_frontend.FormStatusIndicator', {
} }
); );
patch(Field.prototype, 'jikimo_frontend.Field', {
setup() {
owl.onMounted(this.setRequired);
return this._super(...arguments);
},
setRequired() {
const id = this.props.id
const isRequired = filedRequiredList[id]
if(isRequired) {
let dom;
dom = $(`label[for=${id}]`)
if(isRequired.multiple && dom.length > 1) {
dom = dom.eq(-1)
dom = dom.parent().parent().next().find('label')
}
if(isRequired.noLabel) {
dom = dom.parent().parent()
}
let t = dom.html()
t = '<i class="c* r" style="color: red;margin-left: -4px">*</i>' + t
dom.html(t)
}
}
})
patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', { patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', {
setup(){ setup(){
owl.onMounted(() => { owl.onMounted(() => {
@@ -200,7 +175,9 @@ patch(FormLabel.prototype, 'jikimo_frontend.FormLabel', {
this.props.fieldInfo this.props.fieldInfo
); );
const classes = this.props.className ? [this.props.className] : []; const classes = this.props.className ? [this.props.className] : [];
if(this.props.fieldInfo?.rawAttrs?.class?.indexOf('custom_required') >= 0) { const otherRequired = filedRequiredList[this.props.fieldName]
if(this.props.fieldInfo?.rawAttrs?.class?.indexOf('custom_required') >= 0 || otherRequired) {
classes.push('custom_required_add') classes.push('custom_required_add')
} }
if (invalid) { if (invalid) {

View File

@@ -187,23 +187,23 @@
<group string="刀尖特征" <group string="刀尖特征"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}"> attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
<field name="blade_tip_characteristics_id" string="" <field name="blade_tip_characteristics_id" string=""
widget="many2one_radio"/> widget="many2one_radio" attrs="{'showExpand': True}"/>
</group> </group>
<group attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}"> <group attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
<group string="柄部类型" attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"> <group string="柄部类型" attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
<field name="handle_type_id" string="" widget="many2one_radio"/> <field name="handle_type_id" string="" widget="many2one_radio" attrs="{'showExpand': True}"/>
</group> </group>
<group string="压紧方式" <group string="压紧方式"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"> attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}">
<field name="compaction_way_id" string="" widget="many2one_radio"/> <field name="compaction_way_id" string="" widget="many2one_radio" attrs="{'showExpand': True}"/>
</group> </group>
</group> </group>
<group attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}"> <group attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
<group string="走刀方向"> <group string="走刀方向">
<field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes"/> <field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes" attrs="{'showExpand': True}"/>
</group> </group>
<group string="适合冷却方式"> <group string="适合冷却方式">
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes"/> <field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes" attrs="{'showExpand': True}" />
</group> </group>
</group> </group>
<notebook> <notebook>

View File

@@ -2,7 +2,7 @@
min-width: 62px !important; min-width: 62px !important;
} }
.section_and_note_text span{ .section_and_note_text, .section_and_note_text span{
white-space: wrap!important; white-space: wrap!important;
overflow: auto!important; overflow: auto!important;
text-overflow: unset!important; text-overflow: unset!important;