refactor(web): 合并 crud 组件共同参数

This commit is contained in:
2023-06-09 20:31:06 +08:00
parent 605616b116
commit 75ddfd8862
6 changed files with 15 additions and 24 deletions

View File

@@ -1,3 +1,13 @@
function crudCommonOptions() {
return {
affixHeader: false,
stopAutoRefreshWhenModalIsOpen: true,
resizable: false,
syncLocation: false,
silentPolling: true,
}
}
function timeAndFrom(field, fromNow, emptyText = '未停止', showSource = true) {
let tpl = "${IF(" + field + " === 0, '(" + emptyText + ")', CONCATENATE('<span class=\"font-bold\">'," + fromNow + ",'</span>'))}"
if (showSource) {