pengyuthon wechat

This commit is contained in:
李鹏宇
2024-11-22 16:06:06 +08:00
parent dc12865387
commit f70883d9c9
2 changed files with 27 additions and 17 deletions
+13 -3
View File
@@ -4,13 +4,13 @@ export class SelectCreateDialog extends Component {
setup() {
this.viewService = useService("view");
this.dialogService = useService("dialog");
this.state = useState({ resIds: [] });
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 }, // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
display: {searchPanel: true}, // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
editable: false, // readonly
noBreadcrumbs: true,
noContentHelp: markup(`<p>${escape(translatedText)}</p>`),
@@ -20,4 +20,14 @@ export class SelectCreateDialog extends Component {
this.state.resIds = resIds;
},
};
}
}
// addons\web\static\src\views\list\list_renderer.js
get getEmptyRowIds() {
let nbEmptyRow = Math.max(0, this.props.list.records.length); // !!!!!!!!!!!!!!!!!!!!!!!
if (nbEmptyRow > 0 && this.displayRowCreates) {
nbEmptyRow -= 1;
}
return Array.from(Array(nbEmptyRow).keys());
}
}