mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-07-03 06:22:44 +08:00
41 lines
1.0 KiB
Vue
41 lines
1.0 KiB
Vue
<script>
|
|
export default {
|
|
mounted() {
|
|
utools.setExpendHeight(0);
|
|
quickcommand.enterData.payload.forEach((file) => {
|
|
let uid = this.getUid();
|
|
let fileInfo = window.getFileInfo({
|
|
type: "file",
|
|
argvs: file.path,
|
|
readfile: false,
|
|
});
|
|
let fileName = fileInfo.name.replace(fileInfo.ext, "");
|
|
let command = {
|
|
features: {
|
|
cmds: [fileName],
|
|
explain: `打开${fileName}`,
|
|
icon: utools.getFileIcon(file.path),
|
|
platform: [window.processPlatform],
|
|
code: `key_${uid}`,
|
|
},
|
|
program: "quickcommand",
|
|
cmd: `open(\"${file.path.replace(/\\/g, "\\\\")}\")`,
|
|
output: "ignore",
|
|
tags: [this.$root.profile.quickFeatures.favFile.tag],
|
|
};
|
|
this.importCommand(command);
|
|
});
|
|
utools.showNotification("操作成功!");
|
|
utools.outPlugin();
|
|
},
|
|
methods: {
|
|
getUid() {
|
|
return this.$parent.getUid();
|
|
},
|
|
importCommand(command) {
|
|
this.$parent.importCommand(command);
|
|
},
|
|
},
|
|
};
|
|
</script>
|