feat: user

This commit is contained in:
dap
2024-10-05 22:08:32 +08:00
parent 1947f5c3b6
commit bd340e63b7
4 changed files with 148 additions and 86 deletions

View File

@@ -5,10 +5,12 @@ import { DictEnum } from '@vben/constants';
import { Tag } from 'ant-design-vue';
import dayjs from 'dayjs';
import duration from 'dayjs/plugin/duration';
import relativeTime from 'dayjs/plugin/relativeTime';
import { renderDict } from '#/utils/render';
dayjs.extend(duration);
dayjs.extend(relativeTime);
function renderTags(list: string[]) {
return (
@@ -100,7 +102,7 @@ export const descSchema: DescItem[] = [
// 默认en显示
dayjs.locale('zh-cn');
// 计算相差秒数
const diffSeconds = dayjs(new Date()).diff(dayjs(value), 'second');
const diffSeconds = dayjs().diff(dayjs(value), 'second');
/**
* 转为时间显示(x月 x天)
* https://dayjs.fenxianglu.cn/category/duration.html#%E4%BA%BA%E6%80%A7%E5%8C%96