mirror of
https://github.com/certd/certd.git
synced 2026-05-15 20:47:31 +08:00
🔱: [client] sync upgrade with 5 commits [trident-sync]
build: publish success perf: antdv 异步加载,加快首页打开速度 perf: 精简lodash chore: 兼容手机版
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import _ from "lodash-es";
|
||||
import { cloneDeep, mergeWith, isArray } from "lodash-es";
|
||||
function copyList(originList: any, newList: any, options: any, parentId?: any) {
|
||||
for (const item of originList) {
|
||||
const newItem: any = _.cloneDeep(item);
|
||||
if(parentId!= null && newItem.parentId == null){
|
||||
const newItem: any = cloneDeep(item);
|
||||
if (parentId != null && newItem.parentId == null) {
|
||||
newItem.parentId = parentId;
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ const mockUtil: any = {
|
||||
return {
|
||||
code: 0,
|
||||
msg: "success",
|
||||
data: _.cloneDeep(req.body)
|
||||
data: cloneDeep(req.body)
|
||||
};
|
||||
}
|
||||
},
|
||||
@@ -228,12 +228,12 @@ const mockUtil: any = {
|
||||
handle(req: any): any {
|
||||
const item = findById(req.body.id, list);
|
||||
if (item) {
|
||||
_.mergeWith(item, req.body, (objValue, srcValue) => {
|
||||
mergeWith(item, req.body, (objValue, srcValue) => {
|
||||
if (srcValue == null) {
|
||||
return;
|
||||
}
|
||||
// 如果被合并对象为数组,则直接被覆盖对象覆盖,只要覆盖对象不为空
|
||||
if (_.isArray(objValue)) {
|
||||
if (isArray(objValue)) {
|
||||
return srcValue;
|
||||
}
|
||||
});
|
||||
@@ -305,12 +305,12 @@ const mockUtil: any = {
|
||||
console.log("req", req);
|
||||
let item = findById(req.body.id, list);
|
||||
if (item) {
|
||||
_.mergeWith(item, { [req.body.key]: req.body.value }, (objValue, srcValue) => {
|
||||
mergeWith(item, { [req.body.key]: req.body.value }, (objValue, srcValue) => {
|
||||
if (srcValue == null) {
|
||||
return;
|
||||
}
|
||||
// 如果被合并对象为数组,则直接被覆盖对象覆盖,只要覆盖对象不为空
|
||||
if (_.isArray(objValue)) {
|
||||
if (isArray(objValue)) {
|
||||
return srcValue;
|
||||
}
|
||||
});
|
||||
@@ -336,12 +336,12 @@ const mockUtil: any = {
|
||||
for (const item of req.body) {
|
||||
const item2 = findById(item.id, list);
|
||||
if (item2) {
|
||||
_.mergeWith(item2, item, (objValue, srcValue) => {
|
||||
mergeWith(item2, item, (objValue, srcValue) => {
|
||||
if (srcValue == null) {
|
||||
return;
|
||||
}
|
||||
// 如果被合并对象为数组,则直接被覆盖对象覆盖,只要覆盖对象不为空
|
||||
if (_.isArray(objValue)) {
|
||||
if (isArray(objValue)) {
|
||||
return srcValue;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -3,7 +3,7 @@ import cascaderData from "./cascader-data";
|
||||
import pcaDataLittle from "./pca-data-little";
|
||||
// @ts-ignore
|
||||
import { TreeNodesLazyLoader, getPcaData } from "./pcas-data";
|
||||
import _ from "lodash-es";
|
||||
import { cloneDeep } from "lodash-es";
|
||||
const openStatus = [
|
||||
{ value: "1", label: "打开", color: "success", icon: "ion:radio-button-on" },
|
||||
{ value: "2", label: "停止", color: "cyan" },
|
||||
@@ -29,7 +29,7 @@ let manyStatus = [
|
||||
];
|
||||
let tempManyStatus: any[] = [];
|
||||
for (let i = 0; i < 100; i++) {
|
||||
tempManyStatus = tempManyStatus.concat(_.cloneDeep(manyStatus));
|
||||
tempManyStatus = tempManyStatus.concat(cloneDeep(manyStatus));
|
||||
}
|
||||
manyStatus = tempManyStatus;
|
||||
let idIndex = 0;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ from "lodash-es";
|
||||
import {cloneDeep} from "lodash-es";
|
||||
export async function getPcasData() {
|
||||
// @ts-ignore
|
||||
const pcasData = () => import("china-division/dist/pcas-code.json");
|
||||
@@ -22,7 +22,7 @@ export const TreeNodesLazyLoader = {
|
||||
for (const value of values) {
|
||||
const found = this.getNode(data, value);
|
||||
if (found) {
|
||||
const target = _.cloneDeep(found);
|
||||
const target = cloneDeep(found);
|
||||
delete target.children;
|
||||
nodes.push(target);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { mock } from "../api/service";
|
||||
import * as tools from "../api/tools";
|
||||
import _ from "lodash-es";
|
||||
import { forEach } from "lodash-es";
|
||||
import { utils } from "@fast-crud/fast-crud";
|
||||
// @ts-ignore
|
||||
const commonMocks: any = import.meta.glob("./common/mock.*.[j|t]s", { eager: true });
|
||||
@@ -10,13 +10,13 @@ const apiMocks: any = import.meta.glob("../api/modules/*.mock.ts", { eager: true
|
||||
const viewMocks: any = import.meta.glob("../views/**/mock.[j|t]s", { eager: true });
|
||||
|
||||
const list: any = [];
|
||||
_.forEach(commonMocks, (value: any) => {
|
||||
forEach(commonMocks, (value: any) => {
|
||||
list.push(value.default);
|
||||
});
|
||||
_.forEach(apiMocks, (value) => {
|
||||
forEach(apiMocks, (value) => {
|
||||
list.push(value.default);
|
||||
});
|
||||
_.forEach(viewMocks, (value) => {
|
||||
forEach(viewMocks, (value) => {
|
||||
list.push(value.default);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user