Files
gzth/源码/源码.js
T
2024-11-18 11:19:08 +08:00

23 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import {Component, markup, useState} from "@odoo/owl";
// odoo\addons\web\static\src\views\view_dialogs\select_create_dialog.js
export class SelectCreateDialog extends Component {
setup() {
this.viewService = useService("view");
this.dialogService = useService("dialog");
this.state = useState({ resIds: [] });
// ℹ️ `_t` can only be inlined directly inside JS template literals
// after Babel has been updated to version 2.12.
const translatedText = _t("No records found!");
this.busy = false; // flag used to ensure we only call once the onSelected/onUnselect props
this.baseViewProps = {
display: { searchPanel: true }, // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
editable: false, // readonly
noBreadcrumbs: true,
noContentHelp: markup(`<p>${escape(translatedText)}</p>`),
showButtons: false,
selectRecord: (resId) => this.select([resId]),
onSelectionChanged: (resIds) => {
this.state.resIds = resIds;
},
};
}