优化警告问题

This commit is contained in:
mgw
2023-11-27 22:40:56 +08:00
parent 4f83c5f29a
commit 9fef877d12
4 changed files with 7 additions and 12 deletions

View File

@@ -15,19 +15,18 @@ export class Many2OneRadioField extends RadioField {
// 放大图片逻辑 // 放大图片逻辑
// 获取图片元素 // 获取图片元素
const img = event.target; const img = event.target;
const close = img.nextSibling const close = img.nextSibling;
// 实现放大图片逻辑 // 实现放大图片逻辑
// 比如使用 CSS 放大 // 比如使用 CSS 放大
img.parentElement.classList.add('zoomed'); img.parentElement.classList.add('zoomed');
close.classList.add('img_close') close.classList.add('img_close');
} }
onCloseClick(event) { onCloseClick(event) {
const close = event.target; const close = event.target;
const img = close.previousSibling const img = close.previousSibling;
img.parentElement.classList.remove('zoomed') img.parentElement.classList.remove('zoomed');
close.classList.remove('img_close') close.classList.remove('img_close');
} }
get items() { get items() {
@@ -48,7 +47,7 @@ export class Many2OneRadioField extends RadioField {
} }
} }
Many2OneRadioField.template = "jikimo_frontend.Many2OneRadioField" Many2OneRadioField.template = "jikimo_frontend.Many2OneRadioField";
// MyCustomWidget.supportedTypes = ['many2many']; // MyCustomWidget.supportedTypes = ['many2many'];
registry.category("fields").add("many2one_radio", Many2OneRadioField); registry.category("fields").add("many2one_radio", Many2OneRadioField);

View File

@@ -537,7 +537,7 @@ class WorkCenterBarcode(models.Model):
action1 = json.dumps(action) action1 = json.dumps(action)
return action1 return action1
else: else:
return False return None
def cnc_file_download(self): def cnc_file_download(self):
""" """

View File

@@ -73,10 +73,7 @@ class CustomChar extends CharField {
// this.$input.on('focus', function () { // this.$input.on('focus', function () {
// $(this).select(); // $(this).select();
// }); // });
// 当光标聚焦于输入框时,选中输入框内容 // 当光标聚焦于输入框时,选中输入框内容
} }
registry.category("fields").add("custom_char", CustomChar); registry.category("fields").add("custom_char", CustomChar);

View File

@@ -24,7 +24,6 @@ class CustomMany2One extends Many2OneField {
this.select(); this.select();
}); });
} }
} }
registry.category("fields").add("custom_many2one", CustomMany2One); registry.category("fields").add("custom_many2one", CustomMany2One);