quickcommand新增六个系统级弹窗接口showSystemMessageBox、showSystemInputBox、showSystemConfirmBox、showSystemSelectList、showSystemButtonBox、showSystemTextArea

This commit is contained in:
fofolee
2025-01-12 20:45:33 +08:00
parent 246ce8bc33
commit 5f3806a797
5 changed files with 560 additions and 9 deletions

View File

@@ -0,0 +1,21 @@
const fs = require("fs");
const path = require("path");
const os = require("os");
const getQuickcommandTempFile = (ext, name, dir = "quickcommandTempDir") => {
if (!name) name = new Date().getTime() + (Math.random() * 10 ** 6).toFixed();
let tempDir = path.join(os.tmpdir(), dir);
if (!fs.existsSync(tempDir)) fs.mkdirSync(tempDir);
return path.join(tempDir, `${name}.${ext}`);
};
const getQuickcommandFolderFile = (name, ext) => {
const quickcommandPath = path.join(
window.utools.getPath("userData"),
"quickcommand"
);
if (!fs.existsSync(quickcommandPath)) fs.mkdirSync(quickcommandPath);
return path.join(quickcommandPath, `${name}.${ext}`);
};
module.exports = { getQuickcommandTempFile, getQuickcommandFolderFile };