Initial commit

This commit is contained in:
2025-08-18 16:50:57 +08:00
commit 4fc95516d6
350 changed files with 175555 additions and 0 deletions

29
src/filters/index.js Normal file
View File

@ -0,0 +1,29 @@
import dayjs from "dayjs";
// https://dayjs.fenxianglu.cn/category/display.html#%E6%A0%BC%E5%BC%8F%E5%8C%96
const dateFilter = (val, format = "YYYY-MM-DD HH:mm:ss") => {
if (val) {
if (!isNaN(val)) {
val = parseInt(val);
}
return dayjs(val).format(format);
} else {
return '--'
}
};
const isAvailable = (val) => {
if (val === 0) return true;
if (val == null || val == undefined || val == '' || val == 'undefined' || val == 'null') {
return false
} else {
return true
}
}
export default (app) => {
app.config.globalProperties.$filters = {
dateFilter,
isAvailable
};
};