mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-08 14:34:13 +08:00
封装 dbstorage
This commit is contained in:
parent
73e342c8c3
commit
91c4e48888
@ -27,7 +27,6 @@ export default defineComponent({
|
|||||||
enterData: {},
|
enterData: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
|
||||||
created: function () {
|
created: function () {
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
@ -156,7 +155,7 @@ export default defineComponent({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
v2DataHandler() {
|
v2DataHandler() {
|
||||||
let v2DataHandled = this.utools.whole.dbStorage.getItem(
|
let v2DataHandled = this.utools.getStorage(
|
||||||
this.utools.DBPRE.STATUS + "v2DataHandled"
|
this.utools.DBPRE.STATUS + "v2DataHandled"
|
||||||
);
|
);
|
||||||
if (v2DataHandled) return;
|
if (v2DataHandled) return;
|
||||||
@ -180,10 +179,7 @@ export default defineComponent({
|
|||||||
);
|
);
|
||||||
// 处理历史代码
|
// 处理历史代码
|
||||||
// ...
|
// ...
|
||||||
this.utools.whole.dbStorage.setItem(
|
this.utools.setStorage(this.utools.DBPRE.STATUS + "v2DataHandled", true);
|
||||||
this.utools.DBPRE.STATUS + "v2DataHandled",
|
|
||||||
true
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -83,8 +83,7 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.cmd =
|
this.cmd = this.$root.utools.getStorage("cfg_serverCode") || "";
|
||||||
this.$root.utools.whole.dbStorage.getItem("cfg_serverCode") || "";
|
|
||||||
this.$refs.editor.setEditorValue(this.cmd);
|
this.$refs.editor.setEditorValue(this.cmd);
|
||||||
this.$refs.editor.setEditorLanguage("javascript");
|
this.$refs.editor.setEditorLanguage("javascript");
|
||||||
},
|
},
|
||||||
@ -111,7 +110,7 @@ export default {
|
|||||||
saveCode() {
|
saveCode() {
|
||||||
clearTimeout(this.saveCodeTimer);
|
clearTimeout(this.saveCodeTimer);
|
||||||
this.saveCodeTimer = setTimeout(() => {
|
this.saveCodeTimer = setTimeout(() => {
|
||||||
this.$root.utools.whole.dbStorage.setItem("cfg_serverCode", this.cmd);
|
this.$root.utools.setStorage("cfg_serverCode", this.cmd);
|
||||||
this.saveCodeTimer = null;
|
this.saveCodeTimer = null;
|
||||||
}, 1000);
|
}, 1000);
|
||||||
},
|
},
|
||||||
|
@ -42,6 +42,9 @@ let getDocs = key => {
|
|||||||
return whole.db.allDocs(key)
|
return whole.db.allDocs(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let setStorage = whole.dbStorage.setItem
|
||||||
|
let getStorage = whole.dbStorage.getItem
|
||||||
|
|
||||||
const nativeId = utools.getNativeId()
|
const nativeId = utools.getNativeId()
|
||||||
|
|
||||||
let userData = {
|
let userData = {
|
||||||
@ -79,7 +82,8 @@ export default {
|
|||||||
getDB,
|
getDB,
|
||||||
putDB,
|
putDB,
|
||||||
delDB,
|
delDB,
|
||||||
getDocs,
|
setStorage,
|
||||||
|
getStorage,
|
||||||
userData,
|
userData,
|
||||||
DBPRE,
|
DBPRE,
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user