🔱: [client] sync upgrade with 9 commits [trident-sync]

perf: 完善文档,完善部分types
perf: 优化d.ts类型
perf: 日期增加week、month、year、quarter类型
feat: resetCrudOptions 示例
feat: tabs快捷查询组件
fix: 行编辑支持多级表头

https://github.com/fast-crud/fast-crud/issues/143
perf: antdv 增加自定义表头示例

https://github.com/fast-crud/fast-crud/issues/141
perf: 表单下方按钮支持context

https://github.com/fast-crud/fast-crud/issues/142
This commit is contained in:
GitHub Actions Bot
2023-03-09 19:24:01 +00:00
parent 76dd23174a
commit 52a167c647
100 changed files with 1465 additions and 585 deletions
@@ -1,13 +1,13 @@
import _ from "lodash-es";
export default {
arrayToMap(array) {
arrayToMap(array: any) {
if (!array) {
return {};
}
if (!_.isArray(array)) {
return array;
}
const map = {};
const map: any = {};
for (const item of array) {
if (item.key) {
map[item.key] = item;
@@ -15,7 +15,7 @@ export default {
}
return map;
},
mapToArray(map) {
mapToArray(map: any) {
if (!map) {
return [];
}
@@ -1,15 +1,15 @@
import _ from "lodash-es";
export function getEnvValue(key) {
export function getEnvValue(key: string) {
// @ts-ignore
return import.meta.env["VITE_APP_" + key];
}
export class EnvConfig {
API;
MODE;
STORAGE;
TITLE;
PM_ENABLED;
API: string;
MODE: string;
STORAGE: string;
TITLE: string;
PM_ENABLED: string;
constructor() {
this.init();
}
@@ -19,6 +19,7 @@ export class EnvConfig {
_.forEach(import.meta.env, (value, key) => {
if (key.startsWith("VITE_APP")) {
key = key.replace("VITE_APP_", "");
// @ts-ignore
this[key] = value;
}
});
@@ -26,7 +27,8 @@ export class EnvConfig {
this.MODE = import.meta.env.MODE;
}
get(key, defaultValue) {
get(key: string, defaultValue: string) {
// @ts-ignore
return this[key] ?? defaultValue;
}
isDev() {
@@ -4,7 +4,7 @@ export const site = {
* @description 更新标题
* @param {String} title 标题
*/
title: function (titleText) {
title: function (titleText: string) {
const processTitle = env.TITLE || "FsAdmin";
window.document.title = `${processTitle}${titleText ? ` | ${titleText}` : ""}`;
}
@@ -1,5 +1,5 @@
import { env } from "./util.env";
function isNullOrUnDef(value) {
function isNullOrUnDef(value: any) {
return value == null;
}
const DEFAULT_CACHE_TIME = 60 * 60 * 24 * 7;