|
@ -17,7 +17,10 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
<div draggable="true" class="file-item" :class="{ |
|
|
<div |
|
|
|
|
|
draggable="true" |
|
|
|
|
|
class="file-item" |
|
|
|
|
|
:class="{ |
|
|
chosen: chosenIndexs.includes(index), |
|
|
chosen: chosenIndexs.includes(index), |
|
|
'no-chosen': !chosenIndexs.includes(index), |
|
|
'no-chosen': !chosenIndexs.includes(index), |
|
|
'mode-icon': mode === 'icon', |
|
|
'mode-icon': mode === 'icon', |
|
@ -26,27 +29,52 @@ |
|
|
'mode-middle': mode === 'middle', |
|
|
'mode-middle': mode === 'middle', |
|
|
'mode-detail': mode === 'detail', |
|
|
'mode-detail': mode === 'detail', |
|
|
'drag-over': hoverIndex === index, |
|
|
'drag-over': hoverIndex === index, |
|
|
}" :style="{ |
|
|
}" |
|
|
|
|
|
:style="{ |
|
|
'--theme-color': theme === 'light' ? '#ffffff6b' : '#3bdbff3d', |
|
|
'--theme-color': theme === 'light' ? '#ffffff6b' : '#3bdbff3d', |
|
|
}" v-for="(item, index) in fileList" :key="item.path" @dblclick="handleOnOpen(item)" |
|
|
}" |
|
|
@touchstart.passive="doubleTouch($event, item)" @contextmenu.stop.prevent="handleRightClick($event, item, index)" |
|
|
v-for="(item, index) in fileList" |
|
|
@drop="hadnleDrop($event, item.path)" @dragenter.prevent="handleDragEnter(index)" @dragover.prevent |
|
|
:key="item.path" |
|
|
@dragleave="handleDragLeave()" @dragstart.stop="startDragApp($event, item)" @click="handleClick(index)" |
|
|
@dblclick="handleOnOpen(item)" |
|
|
@mousedown.stop :ref="(ref: any) => { |
|
|
@touchstart.passive="doubleTouch($event, item)" |
|
|
|
|
|
@contextmenu.stop.prevent="handleRightClick($event, item, index)" |
|
|
|
|
|
@drop="hadnleDrop($event, item.path)" |
|
|
|
|
|
@dragenter.prevent="handleDragEnter(index)" |
|
|
|
|
|
@dragover.prevent |
|
|
|
|
|
@dragleave="handleDragLeave()" |
|
|
|
|
|
@dragstart.stop="startDragApp($event, item)" |
|
|
|
|
|
@click="handleClick(index)" |
|
|
|
|
|
@mousedown.stop |
|
|
|
|
|
:ref="(ref: any) => { |
|
|
if (ref) { |
|
|
if (ref) { |
|
|
appPositions[index] = markRaw(ref as Element); |
|
|
appPositions[index] = markRaw(ref as Element); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
"> |
|
|
" |
|
|
|
|
|
> |
|
|
<div class="file-item_img"> |
|
|
<div class="file-item_img"> |
|
|
<FileIcon :file="item" /> |
|
|
<FileIcon :file="item" /> |
|
|
</div> |
|
|
</div> |
|
|
<span v-if="editIndex !== index" class="file-item_title"> |
|
|
<span |
|
|
|
|
|
v-if="editIndex !== index" |
|
|
|
|
|
class="file-item_title" |
|
|
|
|
|
> |
|
|
{{ getName(item) }} |
|
|
{{ getName(item) }} |
|
|
</span> |
|
|
</span> |
|
|
<textarea autofocus draggable="false" @dragover.stop @dragstart.stop @dragenter.stop @mousedown.stop @dblclick.stop |
|
|
<textarea |
|
|
@click.stop @blur="onEditNameEnd" v-if="editIndex === index" class="file-item_title file-item_editing" |
|
|
autofocus |
|
|
v-model="editName"></textarea> |
|
|
draggable="false" |
|
|
|
|
|
@dragover.stop |
|
|
|
|
|
@dragstart.stop |
|
|
|
|
|
@dragenter.stop |
|
|
|
|
|
@mousedown.stop |
|
|
|
|
|
@dblclick.stop |
|
|
|
|
|
@click.stop |
|
|
|
|
|
@blur="onEditNameEnd" |
|
|
|
|
|
v-if="editIndex === index" |
|
|
|
|
|
class="file-item_title file-item_editing" |
|
|
|
|
|
v-model="editName" |
|
|
|
|
|
></textarea> |
|
|
<template v-if="mode === 'detail'"> |
|
|
<template v-if="mode === 'detail'"> |
|
|
<div class="file-item_type"> |
|
|
<div class="file-item_type"> |
|
|
<span>{{ item.isDirectory ? "-" : dealSize(item.size) }}</span> |
|
|
<span>{{ item.isDirectory ? "-" : dealSize(item.size) }}</span> |
|
@ -64,23 +92,30 @@ |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
<script lang="ts" setup> |
|
|
<script lang="ts" setup> |
|
|
import { useSystem, basename, OsFileWithoutContent, Notify, BrowserWindow } from '@/system/index.ts'; |
|
|
import { useAppMenu } from "@/hook/useAppMenu"; |
|
|
import { getSystemKey } from '@/system/config' |
|
|
import { useContextMenu } from "@/hook/useContextMenu.ts"; |
|
|
import { emitEvent, mountEvent } from '@/system/event'; |
|
|
import { useFileDrag } from "@/hook/useFileDrag"; |
|
|
import { useContextMenu } from '@/hook/useContextMenu.ts'; |
|
|
import { Rect } from "@/hook/useRectChosen"; |
|
|
import { t, dealSystemName } from '@/i18n'; |
|
|
import { dealSystemName, t } from "@/i18n"; |
|
|
import { useFileDrag } from '@/hook/useFileDrag'; |
|
|
|
|
|
import { useAppMenu } from '@/hook/useAppMenu'; |
|
|
|
|
|
import { onMounted, ref, markRaw } from 'vue'; |
|
|
|
|
|
import { Rect } from '@/hook/useRectChosen'; |
|
|
|
|
|
import { throttle } from '@/util/debounce'; |
|
|
|
|
|
import { dealSize } from '@/util/file'; |
|
|
|
|
|
import { Menu } from '@/system/menu/Menu'; |
|
|
|
|
|
import { useChooseStore } from "@/stores/choose"; |
|
|
import { useChooseStore } from "@/stores/choose"; |
|
|
const { openPropsWindow, copyFile, createLink, deleteFile } = useContextMenu(); |
|
|
import { getSystemKey } from "@/system/config"; |
|
|
|
|
|
import { emitEvent, mountEvent } from "@/system/event"; |
|
|
|
|
|
import { |
|
|
|
|
|
basename, |
|
|
|
|
|
BrowserWindow, |
|
|
|
|
|
Notify, |
|
|
|
|
|
OsFileWithoutContent, |
|
|
|
|
|
useSystem, |
|
|
|
|
|
} from "@/system/index.ts"; |
|
|
|
|
|
import { Menu } from "@/system/menu/Menu"; |
|
|
|
|
|
import { throttle } from "@/util/debounce"; |
|
|
|
|
|
import { dealSize } from "@/util/file"; |
|
|
|
|
|
import { markRaw, onMounted, ref } from "vue"; |
|
|
|
|
|
const { openPropsWindow, copyFile, createLink, deleteFile } = |
|
|
|
|
|
useContextMenu(); |
|
|
const sys = useSystem(); |
|
|
const sys = useSystem(); |
|
|
const { startDrag, folderDrop } = useFileDrag(sys); |
|
|
const { startDrag, folderDrop } = useFileDrag(sys); |
|
|
const choose = useChooseStore() |
|
|
const choose = useChooseStore(); |
|
|
const props = defineProps({ |
|
|
const props = defineProps({ |
|
|
onChosen: { |
|
|
onChosen: { |
|
|
type: Function, |
|
|
type: Function, |
|
@ -104,22 +139,22 @@ const props = defineProps({ |
|
|
}, |
|
|
}, |
|
|
theme: { |
|
|
theme: { |
|
|
type: String || Object, |
|
|
type: String || Object, |
|
|
default: 'light', |
|
|
default: "light", |
|
|
}, |
|
|
}, |
|
|
mode: { |
|
|
mode: { |
|
|
type: String, |
|
|
type: String, |
|
|
default: 'icon', |
|
|
default: "icon", |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
function getName(item: any) { |
|
|
function getName(item: any) { |
|
|
const name = dealSystemName(basename(item.path)) |
|
|
const name = dealSystemName(basename(item.path)); |
|
|
// console.log(name) |
|
|
// console.log(name) |
|
|
// console.log(item.path) |
|
|
// console.log(item.path) |
|
|
if (name.endsWith('.exe')) { |
|
|
if (name.endsWith(".exe")) { |
|
|
return t(name.replace('.exe', "")) |
|
|
return t(name.replace(".exe", "")); |
|
|
} else { |
|
|
} else { |
|
|
return name |
|
|
return name; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
function handleOnOpen(item: OsFileWithoutContent) { |
|
|
function handleOnOpen(item: OsFileWithoutContent) { |
|
@ -127,13 +162,13 @@ function handleOnOpen(item: OsFileWithoutContent) { |
|
|
// emitEvent('desktop.app.open'); |
|
|
// emitEvent('desktop.app.open'); |
|
|
chosenIndexs.value = []; |
|
|
chosenIndexs.value = []; |
|
|
if (choose.ifShow && !item.isDirectory) { |
|
|
if (choose.ifShow && !item.isDirectory) { |
|
|
choose.path.push(item.path) |
|
|
choose.path.push(item.path); |
|
|
choose.close() |
|
|
choose.close(); |
|
|
} else { |
|
|
} else { |
|
|
// console.log(' file list:',props.fileList); |
|
|
// console.log(' file list:',props.fileList); |
|
|
|
|
|
|
|
|
props.onOpen(item); |
|
|
props.onOpen(item); |
|
|
emitEvent('desktop.app.open'); |
|
|
emitEvent("desktop.app.open"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
function hadnleDrop(mouse: DragEvent, path: string) { |
|
|
function hadnleDrop(mouse: DragEvent, path: string) { |
|
@ -160,33 +195,30 @@ function doubleTouch(e: TouchEvent, item: OsFileWithoutContent) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const editIndex = ref<number>(-1); |
|
|
const editIndex = ref<number>(-1); |
|
|
const editName = ref<string>(''); |
|
|
const editName = ref<string>(""); |
|
|
async function onEditNameEnd() { |
|
|
async function onEditNameEnd() { |
|
|
const editEndName = editName.value.trim(); |
|
|
const editEndName = editName.value.trim(); |
|
|
if (editEndName && editIndex.value >= 0) { |
|
|
if (editEndName && editIndex.value >= 0) { |
|
|
const editpath: any = props.fileList[editIndex.value].path.toString() |
|
|
const editpath: any = |
|
|
|
|
|
props.fileList[editIndex.value].path.toString(); |
|
|
let newPath: any; |
|
|
let newPath: any; |
|
|
let sp = "/" |
|
|
let sp = "/"; |
|
|
if (editpath.indexOf("/") === -1) { |
|
|
if (editpath.indexOf("/") === -1) { |
|
|
sp = "\\" |
|
|
sp = "\\"; |
|
|
} |
|
|
} |
|
|
newPath = editpath?.split(sp); |
|
|
newPath = editpath?.split(sp); |
|
|
newPath.pop() |
|
|
newPath.pop(); |
|
|
newPath.push(editEndName) |
|
|
newPath.push(editEndName); |
|
|
newPath = newPath.join(sp) |
|
|
newPath = newPath.join(sp); |
|
|
await sys?.fs.rename( |
|
|
await sys?.fs.rename(editpath, newPath); |
|
|
editpath, |
|
|
|
|
|
newPath |
|
|
|
|
|
); |
|
|
|
|
|
props.onRefresh(); |
|
|
props.onRefresh(); |
|
|
if (newPath.indexOf("Desktop") !== -1) { |
|
|
if (newPath.indexOf("Desktop") !== -1) { |
|
|
sys.refershAppList() |
|
|
sys.refershAppList(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
editIndex.value = -1; |
|
|
editIndex.value = -1; |
|
|
} |
|
|
} |
|
|
mountEvent('edit.end', () => { |
|
|
mountEvent("edit.end", () => { |
|
|
onEditNameEnd(); |
|
|
onEditNameEnd(); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
@ -240,35 +272,39 @@ function startDragApp(mouse: DragEvent, item: OsFileWithoutContent) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function handleRightClick(mouse: MouseEvent, item: OsFileWithoutContent, index: number) { |
|
|
function handleRightClick( |
|
|
|
|
|
mouse: MouseEvent, |
|
|
|
|
|
item: OsFileWithoutContent, |
|
|
|
|
|
index: number |
|
|
|
|
|
) { |
|
|
if (chosenIndexs.value.length <= 1) { |
|
|
if (chosenIndexs.value.length <= 1) { |
|
|
chosenIndexs.value = [props.fileList.findIndex((app) => app.path === item.path)]; |
|
|
chosenIndexs.value = [ |
|
|
|
|
|
props.fileList.findIndex((app) => app.path === item.path), |
|
|
|
|
|
]; |
|
|
} |
|
|
} |
|
|
const ext = item.name.split(".").pop(); |
|
|
const ext = item.name.split(".").pop(); |
|
|
|
|
|
|
|
|
const zipSucess = (res: any) => { |
|
|
const zipSucess = (res: any) => { |
|
|
if (!res || res.code < 0) { |
|
|
if (!res || res.code < 0) { |
|
|
new Notify({ |
|
|
new Notify({ |
|
|
title: t('tips'), |
|
|
title: t("tips"), |
|
|
content: t('error'), |
|
|
content: t("error"), |
|
|
}); |
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
props.onRefresh(); |
|
|
props.onRefresh(); |
|
|
new Notify({ |
|
|
new Notify({ |
|
|
title: t('tips'), |
|
|
title: t("tips"), |
|
|
content: t('file.zip.success'), |
|
|
content: t("file.zip.success"), |
|
|
}); |
|
|
}); |
|
|
if (item.parentPath == '/C/Users/Desktop') { |
|
|
if (item.parentPath == "/C/Users/Desktop") { |
|
|
sys.refershAppList() |
|
|
sys.refershAppList(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
// eslint-disable-next-line prefer-const |
|
|
// eslint-disable-next-line prefer-const |
|
|
let menuArr: any = [ |
|
|
let menuArr: any = [ |
|
|
{ |
|
|
{ |
|
|
label: t('open'), |
|
|
label: t("open"), |
|
|
click: () => { |
|
|
click: () => { |
|
|
chosenIndexs.value = []; |
|
|
chosenIndexs.value = []; |
|
|
props.onOpen(item); |
|
|
props.onOpen(item); |
|
@ -281,78 +317,80 @@ function handleRightClick(mouse: MouseEvent, item: OsFileWithoutContent, index: |
|
|
// openWith(item); |
|
|
// openWith(item); |
|
|
// }, |
|
|
// }, |
|
|
// }, |
|
|
// }, |
|
|
|
|
|
|
|
|
]; |
|
|
]; |
|
|
if (item.isDirectory && !item.isShare) { |
|
|
if (item.isDirectory && !item.isShare) { |
|
|
if (getSystemKey('storeType') == 'local') { |
|
|
if (getSystemKey("storeType") == "local") { |
|
|
menuArr.push({ |
|
|
menuArr.push({ |
|
|
label: t('zip'), |
|
|
label: t("zip"), |
|
|
submenu: [ |
|
|
submenu: [ |
|
|
{ |
|
|
{ |
|
|
label: 'zip', |
|
|
label: "zip", |
|
|
click: () => { |
|
|
click: () => { |
|
|
sys.fs.zip(item.path, 'zip').then((res: any) => { |
|
|
sys.fs |
|
|
zipSucess(res) |
|
|
.zip(item.path, "zip") |
|
|
|
|
|
.then((res: any) => { |
|
|
|
|
|
zipSucess(res); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: 'tar', |
|
|
label: "tar", |
|
|
click: () => { |
|
|
click: () => { |
|
|
sys.fs.zip(item.path, 'tar').then((res: any) => { |
|
|
sys.fs |
|
|
zipSucess(res) |
|
|
.zip(item.path, "tar") |
|
|
|
|
|
.then((res: any) => { |
|
|
|
|
|
zipSucess(res); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: 'gz', |
|
|
label: "gz", |
|
|
click: () => { |
|
|
click: () => { |
|
|
sys.fs.zip(item.path, 'gz').then((res: any) => { |
|
|
sys.fs.zip(item.path, "gz").then((res: any) => { |
|
|
zipSucess(res) |
|
|
zipSucess(res); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
}) |
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
menuArr.push({ |
|
|
menuArr.push({ |
|
|
label: t('zip'), |
|
|
label: t("zip"), |
|
|
click: () => { |
|
|
click: () => { |
|
|
sys.fs.zip(item.path, 'zip').then((res: any) => { |
|
|
sys.fs.zip(item.path, "zip").then((res: any) => { |
|
|
zipSucess(res) |
|
|
zipSucess(res); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
}) |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
if (choose.ifShow) { |
|
|
if (choose.ifShow) { |
|
|
menuArr.push({ |
|
|
menuArr.push({ |
|
|
label: "选中发送", |
|
|
label: "选中发送", |
|
|
click: () => { |
|
|
click: () => { |
|
|
const paths: any = [] |
|
|
const paths: any = []; |
|
|
chosenIndexs.value.forEach((index) => { |
|
|
chosenIndexs.value.forEach((index) => { |
|
|
const item = props.fileList[index]; |
|
|
const item = props.fileList[index]; |
|
|
paths.push(item.path) |
|
|
paths.push(item.path); |
|
|
}) |
|
|
}); |
|
|
if (paths.length > 0) { |
|
|
if (paths.length > 0) { |
|
|
choose.path = paths |
|
|
choose.path = paths; |
|
|
choose.close() |
|
|
choose.close(); |
|
|
} |
|
|
} |
|
|
chosenIndexs.value = []; |
|
|
chosenIndexs.value = []; |
|
|
}, |
|
|
}, |
|
|
}) |
|
|
}); |
|
|
} |
|
|
} |
|
|
// eslint-disable-next-line prefer-const |
|
|
// eslint-disable-next-line prefer-const |
|
|
let extMenus = useAppMenu(item, sys, props); |
|
|
let extMenus = useAppMenu(item, sys, props); |
|
|
if (extMenus && extMenus.length > 0) { |
|
|
if (extMenus && extMenus.length > 0) { |
|
|
// eslint-disable-next-line prefer-spread |
|
|
// eslint-disable-next-line prefer-spread |
|
|
menuArr.push.apply(menuArr, extMenus) |
|
|
menuArr.push.apply(menuArr, extMenus); |
|
|
} |
|
|
} |
|
|
if (ext != 'exe') { |
|
|
if (ext != "exe") { |
|
|
const fileMenus = [ |
|
|
const fileMenus = [ |
|
|
{ |
|
|
{ |
|
|
label: t('rename'), |
|
|
label: t("rename"), |
|
|
click: () => { |
|
|
click: () => { |
|
|
editIndex.value = index; |
|
|
editIndex.value = index; |
|
|
editName.value = basename(item.path); |
|
|
editName.value = basename(item.path); |
|
@ -360,50 +398,58 @@ function handleRightClick(mouse: MouseEvent, item: OsFileWithoutContent, index: |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: t('copy'), |
|
|
label: t("copy"), |
|
|
click: () => { |
|
|
click: () => { |
|
|
//if(["/","/B"].includes(item.path)) return; |
|
|
//if(["/","/B"].includes(item.path)) return; |
|
|
copyFile(chosenIndexs.value.map((index) => props.fileList[index])); |
|
|
copyFile( |
|
|
|
|
|
chosenIndexs.value.map( |
|
|
|
|
|
(index) => props.fileList[index] |
|
|
|
|
|
) |
|
|
|
|
|
); |
|
|
chosenIndexs.value = []; |
|
|
chosenIndexs.value = []; |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
]; |
|
|
]; |
|
|
if (!item.isShare || item.path.indexOf('/F/othershare') !== 0) { |
|
|
if (!item.isShare || item.path.indexOf("/F/othershare") !== 0) { |
|
|
fileMenus.push({ |
|
|
fileMenus.push({ |
|
|
label: t('delete'), |
|
|
label: t("delete"), |
|
|
click: async () => { |
|
|
click: async () => { |
|
|
for (let i = 0; i < chosenIndexs.value.length; i++) { |
|
|
for (let i = 0; i < chosenIndexs.value.length; i++) { |
|
|
await deleteFile(props.fileList[chosenIndexs.value[i]]); |
|
|
await deleteFile( |
|
|
|
|
|
props.fileList[chosenIndexs.value[i]] |
|
|
|
|
|
); |
|
|
} |
|
|
} |
|
|
chosenIndexs.value = []; |
|
|
chosenIndexs.value = []; |
|
|
props.onRefresh(); |
|
|
props.onRefresh(); |
|
|
if (item.path.indexOf('Desktop') > -1) { |
|
|
if (item.path.indexOf("Desktop") > -1) { |
|
|
sys.refershAppList() |
|
|
sys.refershAppList(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}) |
|
|
}); |
|
|
} |
|
|
} |
|
|
if (!item.isShare) { |
|
|
if (!item.isShare) { |
|
|
fileMenus.push({ |
|
|
fileMenus.push({ |
|
|
label: t('create.shortcut'), |
|
|
label: t("create.shortcut"), |
|
|
click: () => { |
|
|
click: () => { |
|
|
createLink(item.path)?.then(() => { |
|
|
createLink(item.path)?.then(() => { |
|
|
chosenIndexs.value = []; |
|
|
chosenIndexs.value = []; |
|
|
props.onRefresh(); |
|
|
props.onRefresh(); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
},) |
|
|
}); |
|
|
} |
|
|
} |
|
|
const userType = sys.getConfig('userType'); |
|
|
const userType = sys.getConfig("userType"); |
|
|
if (userType == 'member' && !item.isShare && !item.isDirectory) { |
|
|
interface UserInfo { |
|
|
|
|
|
isPwd?: boolean |
|
|
menuArr.push( |
|
|
} |
|
|
{ |
|
|
const userInfo = sys.getConfig("userInfo") as UserInfo |
|
|
label: '分享给...', |
|
|
const isPwd = userInfo?.isPwd || false; |
|
|
|
|
|
if (userType == "member" && !item.isShare && !item.isDirectory) { |
|
|
|
|
|
menuArr.push({ |
|
|
|
|
|
label: "分享给...", |
|
|
click: () => { |
|
|
click: () => { |
|
|
const win = new BrowserWindow({ |
|
|
const win = new BrowserWindow({ |
|
|
title: '分享', |
|
|
title: "分享", |
|
|
content: "ShareFiles", |
|
|
content: "ShareFiles", |
|
|
config: { |
|
|
config: { |
|
|
path: item.path, |
|
|
path: item.path, |
|
@ -414,14 +460,13 @@ function handleRightClick(mouse: MouseEvent, item: OsFileWithoutContent, index: |
|
|
}); |
|
|
}); |
|
|
win.show(); |
|
|
win.show(); |
|
|
}, |
|
|
}, |
|
|
} |
|
|
}); |
|
|
) |
|
|
if (isPwd) { |
|
|
menuArr.push( |
|
|
menuArr.push({ |
|
|
{ |
|
|
label: "文件加密", |
|
|
label: '文件加密', |
|
|
|
|
|
click: () => { |
|
|
click: () => { |
|
|
const win = new BrowserWindow({ |
|
|
const win = new BrowserWindow({ |
|
|
title: '文件加密', |
|
|
title: "文件加密", |
|
|
content: "FilePwd", |
|
|
content: "FilePwd", |
|
|
config: { |
|
|
config: { |
|
|
path: item.path, |
|
|
path: item.path, |
|
@ -432,14 +477,13 @@ function handleRightClick(mouse: MouseEvent, item: OsFileWithoutContent, index: |
|
|
}); |
|
|
}); |
|
|
win.show(); |
|
|
win.show(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
) |
|
|
menuArr.push({ |
|
|
menuArr.push( |
|
|
label: "评论", |
|
|
{ |
|
|
|
|
|
label: '评论', |
|
|
|
|
|
click: () => { |
|
|
click: () => { |
|
|
const win = new BrowserWindow({ |
|
|
const win = new BrowserWindow({ |
|
|
title: '评论', |
|
|
title: "评论", |
|
|
content: "CommentsFiles", |
|
|
content: "CommentsFiles", |
|
|
config: { |
|
|
config: { |
|
|
path: item.path, |
|
|
path: item.path, |
|
@ -450,25 +494,24 @@ function handleRightClick(mouse: MouseEvent, item: OsFileWithoutContent, index: |
|
|
}); |
|
|
}); |
|
|
win.show(); |
|
|
win.show(); |
|
|
}, |
|
|
}, |
|
|
} |
|
|
}); |
|
|
) |
|
|
|
|
|
} |
|
|
} |
|
|
// eslint-disable-next-line prefer-spread |
|
|
// eslint-disable-next-line prefer-spread |
|
|
menuArr.push.apply(menuArr, fileMenus) |
|
|
menuArr.push.apply(menuArr, fileMenus); |
|
|
} |
|
|
} |
|
|
const sysEndMenu = [ |
|
|
const sysEndMenu = [ |
|
|
{ |
|
|
{ |
|
|
label: t('props'), |
|
|
label: t("props"), |
|
|
click: () => { |
|
|
click: () => { |
|
|
chosenIndexs.value.forEach((index) => { |
|
|
chosenIndexs.value.forEach((index) => { |
|
|
openPropsWindow(props.fileList[index].path); |
|
|
openPropsWindow(props.fileList[index].path); |
|
|
chosenIndexs.value = []; |
|
|
chosenIndexs.value = []; |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
} |
|
|
}, |
|
|
]; |
|
|
]; |
|
|
// eslint-disable-next-line prefer-spread |
|
|
// eslint-disable-next-line prefer-spread |
|
|
menuArr.push.apply(menuArr, sysEndMenu) |
|
|
menuArr.push.apply(menuArr, sysEndMenu); |
|
|
//console.log(item) |
|
|
//console.log(item) |
|
|
|
|
|
|
|
|
//console.log(ext) |
|
|
//console.log(ext) |
|
|