mirror of
https://github.com/certd/certd.git
synced 2026-05-15 20:47:31 +08:00
feat: 升级前端框架,适配手机端
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import * as _ 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);
|
||||
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: any, srcValue: any) => {
|
||||
mergeWith(item, req.body, (objValue: any, srcValue: any) => {
|
||||
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: any, srcValue: any) => {
|
||||
mergeWith(item, { [req.body.key]: req.body.value }, (objValue: any, srcValue: any) => {
|
||||
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: any, srcValue: any) => {
|
||||
mergeWith(item2, item, (objValue: any, srcValue: any) => {
|
||||
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 * as _ 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,6 +1,6 @@
|
||||
import { mock } from "../api/service";
|
||||
import * as tools from "../api/tools";
|
||||
import * as _ 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: any) => {
|
||||
forEach(apiMocks, (value: any) => {
|
||||
list.push(value.default);
|
||||
});
|
||||
_.forEach(viewMocks, (value: any) => {
|
||||
forEach(viewMocks, (value: any) => {
|
||||
list.push(value.default);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user