弃用lodash

This commit is contained in:
fofolee
2024-12-30 20:41:54 +08:00
parent 7a79d3a443
commit 1d3aa3c9ae
30 changed files with 597 additions and 152 deletions

View File

@@ -93,7 +93,8 @@ export default {
},
computed: {
cronConverted() {
return _.values(this.cronDetail)
return window.lodashM
.values(this.cronDetail)
.map((x) => x.value)
.join(" ");
},
@@ -129,7 +130,7 @@ export default {
window.showUb.help("#Q0e7s");
},
initValue() {
this.cronDetail = _.cloneDeep(this.default);
this.cronDetail = window.lodashM.cloneDeep(this.default);
if (!this.cronExp) return;
let splited = this.cronExp.split(" ");
Object.keys(this.cronDetail).forEach((key, index) => {
@@ -149,7 +150,7 @@ export default {
},
delCrontab() {
this.$emit("delCrontab");
this.cronDetail = _.cloneDeep(this.default);
this.cronDetail = window.lodashM.cloneDeep(this.default);
quickcommand.showMessageBox("禁用成功");
},
},

View File

@@ -47,12 +47,12 @@ export default {
if (item === null) return "null";
if (typeof item === "undefined") return "undefined";
if (typeof item === "string")
return _.truncate(item, { length: maxSize.txt });
return window.lodashM.truncate(item, { length: maxSize.txt });
if (typeof item === "number") return item;
if (typeof item === "function")
return `f ${item.name ? item.name + "()" : "anonymous()"}`;
if (typeof item !== "object") return item.toString();
if (_.isBuffer(item)) {
if (window.lodashM.isBuffer(item)) {
var bufferString = `[Buffer ${item
.slice(0, maxSize.buff)
.toString("hex")

View File

@@ -71,7 +71,9 @@ export default {
},
methods: {
markTag() {
this.$root.utools.whole.setFeature(_.cloneDeep(this.features));
this.$root.utools.whole.setFeature(
window.lodashM.cloneDeep(this.features)
);
this.$root.$refs.view.activatedQuickPanels.push(this.currentTag);
quickcommand.showMessageBox(
`主输入框输入『${this.features.cmds.join("、")}』即可直接进入『${

View File

@@ -170,7 +170,10 @@ export default {
return this.$root.utools.getDB("cfg_extraInfo");
},
saveYuQueInfo() {
this.$root.utools.putDB(_.cloneDeep(this.yuQueInfo), "cfg_extraInfo");
this.$root.utools.putDB(
window.lodashM.cloneDeep(this.yuQueInfo),
"cfg_extraInfo"
);
},
},
};