Accept Merge Request #937: (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/937?initial=true
This commit is contained in:
@@ -4,6 +4,7 @@ import {patch} from '@web/core/utils/patch';
|
|||||||
// import { Dialog } from "@web/core/dialog/dialog";
|
// import { Dialog } from "@web/core/dialog/dialog";
|
||||||
import {_t} from "@web/core/l10n/translation";
|
import {_t} from "@web/core/l10n/translation";
|
||||||
import {FormStatusIndicator} from "@web/views/form/form_status_indicator/form_status_indicator";
|
import {FormStatusIndicator} from "@web/views/form/form_status_indicator/form_status_indicator";
|
||||||
|
import {ListRenderer} from "@web/views/list/list_renderer";
|
||||||
|
|
||||||
import {Field} from "@web/views/fields/field";
|
import {Field} from "@web/views/fields/field";
|
||||||
|
|
||||||
@@ -45,6 +46,11 @@ const filedRequiredList = {
|
|||||||
'date_planned_start': { multiple: false, noLabel: false },
|
'date_planned_start': { multiple: false, noLabel: false },
|
||||||
'date_planned_finished': { multiple: false, noLabel: false },
|
'date_planned_finished': { multiple: false, noLabel: false },
|
||||||
}
|
}
|
||||||
|
const tableRequiredList = [
|
||||||
|
'product_template_id', 'product_uom_qty', 'price_unit','product_id','product_qty',
|
||||||
|
'name', 'fault_type', 'maintenance_standards', 'Period'
|
||||||
|
]
|
||||||
|
|
||||||
patch(FormStatusIndicator.prototype, 'jikimo_frontend.FormStatusIndicator', {
|
patch(FormStatusIndicator.prototype, 'jikimo_frontend.FormStatusIndicator', {
|
||||||
// 你可以重写或者添加一些方法和属性
|
// 你可以重写或者添加一些方法和属性
|
||||||
async _onDiscardChanges() {
|
async _onDiscardChanges() {
|
||||||
@@ -110,7 +116,24 @@ patch(Field.prototype, 'jikimo_frontend.Field', {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', {
|
||||||
|
setup(){
|
||||||
|
owl.onMounted(() => {
|
||||||
|
this.activeElement = this.uiService.activeElement;
|
||||||
|
this.setRequired()
|
||||||
|
})
|
||||||
|
return this._super(...arguments);
|
||||||
|
},
|
||||||
|
setRequired() {
|
||||||
|
this.allColumns.forEach(_ => {
|
||||||
|
if( tableRequiredList.indexOf(_.name) >= 0 ) {
|
||||||
|
const dom = $(`th[data-name=${_.name}]`)
|
||||||
|
let t = dom.html()
|
||||||
|
dom.html('<i style="color: red;margin-left: -4px;position: absolute;left: 0">*</i>' + t)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
document.addEventListener('click', function () {
|
document.addEventListener('click', function () {
|
||||||
@@ -160,45 +183,13 @@ $(function () {
|
|||||||
}, 500)
|
}, 500)
|
||||||
}
|
}
|
||||||
|
|
||||||
function setRequired(dom = {label: [], table: []}) {
|
|
||||||
let domTimer = null
|
|
||||||
let timer_count = 0
|
|
||||||
clearInterval(domTimer)
|
|
||||||
domTimer = setInterval(() => {
|
|
||||||
timer_count++
|
|
||||||
const lint = $('.o_form_view_container')
|
|
||||||
if (lint.length) {
|
|
||||||
clearInterval(domTimer)
|
|
||||||
const { table} = dom
|
|
||||||
|
|
||||||
if (table.length) {
|
|
||||||
table.forEach(_ => {
|
|
||||||
const th = $(`th[data-name=${_}]`)
|
|
||||||
const t = th.find('span').eq(0).text().replace('*','')
|
|
||||||
th.find('span').eq(0).html('<i style="color: red">*</i>' + t)
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (timer_count == 20) {
|
|
||||||
clearInterval(domTimer)
|
|
||||||
}
|
|
||||||
}, 500)
|
|
||||||
}
|
|
||||||
|
|
||||||
var currentUrl = location.href
|
var currentUrl = location.href
|
||||||
const customRequiredDom = {
|
|
||||||
table: ['product_template_id', 'product_uom_qty', 'price_unit','product_id','product_qty', 'name', 'fault_type', 'maintenance_standards', 'Period']
|
|
||||||
}
|
|
||||||
const listenerUrl = setInterval(() => {
|
const listenerUrl = setInterval(() => {
|
||||||
const isChange = currentUrl != location.href
|
const isChange = currentUrl != location.href
|
||||||
if (isChange) {
|
if (isChange) {
|
||||||
currentUrl = location.href
|
currentUrl = location.href
|
||||||
customRequired()
|
customRequired()
|
||||||
setRequired(customRequiredDom)
|
|
||||||
}
|
}
|
||||||
}, 500)
|
}, 500)
|
||||||
customRequired()
|
customRequired()
|
||||||
setRequired(customRequiredDom)
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -467,3 +467,15 @@ div:has(.o_required_modifier) > label::before {
|
|||||||
background: #71639e;
|
background: #71639e;
|
||||||
color: #fff
|
color: #fff
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 修改时间输入框宽度
|
||||||
|
.o_datepicker_input.o_input.datetimepicker-input {
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.o_form_view .o_form_editable .o_row > .o_field_widget, .o_form_view .o_form_editable .o_row > .o_field_widget.o_field_float_time {
|
||||||
|
width: auto !important;
|
||||||
|
flex: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -189,3 +189,6 @@ td.o_required_modifier {
|
|||||||
flex-direction: row !important;
|
flex-direction: row !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.supplier_ids_set_css thead th[data-name=partner_id]{
|
||||||
|
width: 500px!important;
|
||||||
|
}
|
||||||
@@ -269,7 +269,7 @@
|
|||||||
</group>
|
</group>
|
||||||
<notebook>
|
<notebook>
|
||||||
<page string="供应商">
|
<page string="供应商">
|
||||||
<field name='supplier_ids'>
|
<field name='supplier_ids' class="supplier_ids_set_css">
|
||||||
<tree editable='bottom'>
|
<tree editable='bottom'>
|
||||||
<field name="sequence" widget="handle" string="序号"/>
|
<field name="sequence" widget="handle" string="序号"/>
|
||||||
<field name="partner_id" string="名称"/>
|
<field name="partner_id" string="名称"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user