|
@ -3,12 +3,25 @@ |
|
|
<div class="group"> |
|
|
<div class="group"> |
|
|
<!-- <div class="button">文件</div> --> |
|
|
<!-- <div class="button">文件</div> --> |
|
|
<!-- <div class="button">计算机</div> --> |
|
|
<!-- <div class="button">计算机</div> --> |
|
|
<div class="button" @click="backFolder()">{{ t("back") }}</div> |
|
|
<div |
|
|
|
|
|
class="button" |
|
|
|
|
|
@click="backFolder()" |
|
|
|
|
|
> |
|
|
|
|
|
{{ t("back") }} |
|
|
|
|
|
</div> |
|
|
<!-- 查看 --> |
|
|
<!-- 查看 --> |
|
|
<div class="button" @click="popoverChange()">{{ t("view") }}</div> |
|
|
<div |
|
|
|
|
|
class="button" |
|
|
|
|
|
@click="popoverChange()" |
|
|
|
|
|
> |
|
|
|
|
|
{{ t("view") }} |
|
|
|
|
|
</div> |
|
|
<!-- <div class="button" @click="newFolder()">新建</div> --> |
|
|
<!-- <div class="button" @click="newFolder()">新建</div> --> |
|
|
</div> |
|
|
</div> |
|
|
<div v-if="isPopoverView" class="up-pop"> |
|
|
<div |
|
|
|
|
|
v-if="isPopoverView" |
|
|
|
|
|
class="up-pop" |
|
|
|
|
|
> |
|
|
<UpPopover v-model="chosenView"></UpPopover> |
|
|
<UpPopover v-model="chosenView"></UpPopover> |
|
|
</div> |
|
|
</div> |
|
|
<ComputerNavBar |
|
|
<ComputerNavBar |
|
@ -19,15 +32,24 @@ |
|
|
@changeHistory="handleHistoryChange" |
|
|
@changeHistory="handleHistoryChange" |
|
|
></ComputerNavBar> |
|
|
></ComputerNavBar> |
|
|
</div> |
|
|
</div> |
|
|
<div class="main" @click="handleOuterClick"> |
|
|
<div |
|
|
|
|
|
class="main" |
|
|
|
|
|
@click="handleOuterClick" |
|
|
|
|
|
> |
|
|
<div |
|
|
<div |
|
|
class="left-tree" |
|
|
class="left-tree" |
|
|
:style="{ |
|
|
:style="{ |
|
|
width: leftWidth + 'px', |
|
|
width: leftWidth + 'px', |
|
|
}" |
|
|
}" |
|
|
> |
|
|
> |
|
|
<div class="disktopshow" @click="onTreeOpen('/C/Users/Desktop')"> |
|
|
<div |
|
|
<el-icon :size="20" color="#137bd2"> |
|
|
class="disktopshow" |
|
|
|
|
|
@click="onTreeOpen('/C/Users/Desktop')" |
|
|
|
|
|
> |
|
|
|
|
|
<el-icon |
|
|
|
|
|
:size="20" |
|
|
|
|
|
color="#137bd2" |
|
|
|
|
|
> |
|
|
<Platform /> |
|
|
<Platform /> |
|
|
</el-icon> |
|
|
</el-icon> |
|
|
{{ t("desktop") }} |
|
|
{{ t("desktop") }} |
|
@ -42,7 +64,12 @@ |
|
|
:key="random" |
|
|
:key="random" |
|
|
> |
|
|
> |
|
|
</FileTree> |
|
|
</FileTree> |
|
|
<div class="showName" v-if="shareShow">{{ t("share") }}</div> |
|
|
<div |
|
|
|
|
|
class="showName" |
|
|
|
|
|
v-if="shareShow" |
|
|
|
|
|
> |
|
|
|
|
|
{{ t("share") }} |
|
|
|
|
|
</div> |
|
|
<FileTree |
|
|
<FileTree |
|
|
v-if="shareShow" |
|
|
v-if="shareShow" |
|
|
:chosen-path="chosenTreePath" |
|
|
:chosen-path="chosenTreePath" |
|
@ -54,7 +81,10 @@ |
|
|
> |
|
|
> |
|
|
</FileTree> |
|
|
</FileTree> |
|
|
<QuickLink :on-open="onTreeOpen"></QuickLink> |
|
|
<QuickLink :on-open="onTreeOpen"></QuickLink> |
|
|
<div class="left-handle" @mousedown="leftHandleDown"></div> |
|
|
<div |
|
|
|
|
|
class="left-handle" |
|
|
|
|
|
@mousedown="leftHandleDown" |
|
|
|
|
|
></div> |
|
|
</div> |
|
|
</div> |
|
|
<div |
|
|
<div |
|
|
class="desk-outer" |
|
|
class="desk-outer" |
|
@ -75,55 +105,74 @@ |
|
|
> |
|
|
> |
|
|
</FileList> |
|
|
</FileList> |
|
|
|
|
|
|
|
|
<div draggable="true" class="desk-item" v-if="creating"> |
|
|
<div |
|
|
|
|
|
draggable="true" |
|
|
|
|
|
class="desk-item" |
|
|
|
|
|
v-if="creating" |
|
|
|
|
|
> |
|
|
<div class="item_img"> |
|
|
<div class="item_img"> |
|
|
<!-- <img draggable="false" width="50" :src="foldericon" /> --> |
|
|
<!-- <img draggable="false" width="50" :src="foldericon" /> --> |
|
|
<svg class="icon" aria-hidden="true" style="font-size: 1.2em"> |
|
|
<svg |
|
|
|
|
|
class="icon" |
|
|
|
|
|
aria-hidden="true" |
|
|
|
|
|
style="font-size: 1.2em" |
|
|
|
|
|
> |
|
|
<use xlink:href="#icon-folder"></use> |
|
|
<use xlink:href="#icon-folder"></use> |
|
|
</svg> |
|
|
</svg> |
|
|
</div> |
|
|
</div> |
|
|
<input class="item_input" v-model="createInput" @blur="creatingEditEnd" /> |
|
|
<input |
|
|
|
|
|
class="item_input" |
|
|
|
|
|
v-model="createInput" |
|
|
|
|
|
@blur="creatingEditEnd" |
|
|
|
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
<Chosen></Chosen> |
|
|
<Chosen></Chosen> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
<script lang="ts" setup> |
|
|
<script lang="ts" setup> |
|
|
import { ref, onMounted, inject } from "vue"; |
|
|
import { inject, onMounted, ref } from "vue"; |
|
|
//import foldericon from '@/assets/folder.png'; |
|
|
//import foldericon from '@/assets/folder.png'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { useComputer } from "@/hook/useComputer"; |
|
|
|
|
|
import { useContextMenu } from "@/hook/useContextMenu"; |
|
|
|
|
|
import { useFileDrag } from "@/hook/useFileDrag"; |
|
|
|
|
|
import { Rect, useRectChosen } from "@/hook/useRectChosen"; |
|
|
|
|
|
import { getSystemConfig } from "@/system/config"; |
|
|
|
|
|
import { emitEvent, mountEvent } from "@/system/event"; |
|
|
|
|
|
import { |
|
|
BrowserWindow, |
|
|
BrowserWindow, |
|
|
OsFileWithoutContent, |
|
|
|
|
|
dirname, |
|
|
dirname, |
|
|
Notify, |
|
|
Notify, |
|
|
useSystem, |
|
|
OsFileWithoutContent, |
|
|
t, |
|
|
t, |
|
|
} from "@/system/index.ts"; |
|
|
useSystem, |
|
|
import { useContextMenu } from "@/hook/useContextMenu"; |
|
|
} from "@/system/index.ts"; |
|
|
import { emitEvent, mountEvent } from "@/system/event"; |
|
|
import { |
|
|
import { useFileDrag } from "@/hook/useFileDrag"; |
|
|
isRootShare, |
|
|
import { useComputer } from "@/hook/useComputer"; |
|
|
isShareFile, |
|
|
import { Rect, useRectChosen } from "@/hook/useRectChosen"; |
|
|
turnLocalPath, |
|
|
import { getSystemConfig } from "@/system/config"; |
|
|
} from "@/util/sharePath.ts"; |
|
|
import { isShareFile, isRootShare, turnLocalPath } from "@/util/sharePath.ts"; |
|
|
|
|
|
|
|
|
|
|
|
const { choseStart, chosing, choseEnd, getRect, Chosen } = useRectChosen(); |
|
|
const { choseStart, chosing, choseEnd, getRect, Chosen } = useRectChosen(); |
|
|
|
|
|
|
|
|
const browserWindow: BrowserWindow | undefined = inject("browserWindow"); |
|
|
const browserWindow: BrowserWindow | undefined = inject("browserWindow"); |
|
|
const config = browserWindow?.config; |
|
|
const config = browserWindow?.config; |
|
|
|
|
|
|
|
|
const router_url = ref(""); |
|
|
const router_url = ref(""); |
|
|
const router_url_history = ref<Array<string>>([]); |
|
|
const router_url_history = ref<Array<string>>([]); |
|
|
const router_url_history_index = ref(0); |
|
|
const router_url_history_index = ref(0); |
|
|
const currentList = ref<Array<OsFileWithoutContent>>([]); |
|
|
const currentList = ref<Array<OsFileWithoutContent>>([]); |
|
|
|
|
|
|
|
|
const system = useSystem(); |
|
|
const system = useSystem(); |
|
|
const { dragFileToDrop } = useFileDrag(system); |
|
|
const { dragFileToDrop } = useFileDrag(system); |
|
|
const { createDesktopContextMenu } = useContextMenu(); |
|
|
const { createDesktopContextMenu } = useContextMenu(); |
|
|
const setRouter = function (path: string) { |
|
|
const setRouter = function (path: string) { |
|
|
router_url.value = path; |
|
|
router_url.value = path; |
|
|
if (router_url_history_index.value <= router_url_history.value.length - 1) { |
|
|
if ( |
|
|
|
|
|
router_url_history_index.value <= |
|
|
|
|
|
router_url_history.value.length - 1 |
|
|
|
|
|
) { |
|
|
router_url_history.value = router_url_history.value.slice( |
|
|
router_url_history.value = router_url_history.value.slice( |
|
|
0, |
|
|
0, |
|
|
router_url_history_index.value + 1 |
|
|
router_url_history_index.value + 1 |
|
@ -131,8 +180,9 @@ const setRouter = function (path: string) { |
|
|
} |
|
|
} |
|
|
router_url_history_index.value = router_url_history.value.length; |
|
|
router_url_history_index.value = router_url_history.value.length; |
|
|
router_url_history.value.push(path); |
|
|
router_url_history.value.push(path); |
|
|
}; |
|
|
}; |
|
|
const { refersh, createFolder, backFolder, openFolder, onComputerMount } = useComputer({ |
|
|
const { refersh, createFolder, backFolder, openFolder, onComputerMount } = |
|
|
|
|
|
useComputer({ |
|
|
setRouter: setRouter, |
|
|
setRouter: setRouter, |
|
|
getRouter() { |
|
|
getRouter() { |
|
|
return router_url.value; |
|
|
return router_url.value; |
|
@ -140,16 +190,19 @@ const { refersh, createFolder, backFolder, openFolder, onComputerMount } = useCo |
|
|
setFileList(list) { |
|
|
setFileList(list) { |
|
|
// console.log('list:',list) |
|
|
// console.log('list:',list) |
|
|
//currentList.value = list; |
|
|
//currentList.value = list; |
|
|
if(config.ext && config.ext instanceof Array && config.ext.length > 0) { |
|
|
if ( |
|
|
const res:any = [] |
|
|
config.ext && |
|
|
list.forEach((d : any) => { |
|
|
config.ext instanceof Array && |
|
|
|
|
|
config.ext.length > 0 |
|
|
if(config.ext.includes(d.ext) || d.isDirectory){ |
|
|
) { |
|
|
res.push(d) |
|
|
const res: any = []; |
|
|
|
|
|
list.forEach((d: any) => { |
|
|
|
|
|
if (config.ext.includes(d.ext) || d.isDirectory) { |
|
|
|
|
|
res.push(d); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}); |
|
|
currentList.value = res; |
|
|
currentList.value = res; |
|
|
}else{ |
|
|
} else { |
|
|
currentList.value = list; |
|
|
currentList.value = list; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -166,7 +219,7 @@ const { refersh, createFolder, backFolder, openFolder, onComputerMount } = useCo |
|
|
return system.fs.readdir(path); |
|
|
return system.fs.readdir(path); |
|
|
}, |
|
|
}, |
|
|
sharedir(path) { |
|
|
sharedir(path) { |
|
|
return system.fs.sharedir(getSystemConfig().userInfo.id,path) |
|
|
return system.fs.sharedir(path); |
|
|
}, |
|
|
}, |
|
|
exists(path) { |
|
|
exists(path) { |
|
|
return system.fs.exists(path); |
|
|
return system.fs.exists(path); |
|
@ -175,7 +228,7 @@ const { refersh, createFolder, backFolder, openFolder, onComputerMount } = useCo |
|
|
return file.isDirectory; |
|
|
return file.isDirectory; |
|
|
}, |
|
|
}, |
|
|
// 读取分享文件夹 |
|
|
// 读取分享文件夹 |
|
|
async readShareDir(path){ |
|
|
async readShareDir(path) { |
|
|
// let file: OsFileWithoutContent |
|
|
// let file: OsFileWithoutContent |
|
|
// if (type === 'path') { |
|
|
// if (type === 'path') { |
|
|
// file = await system.fs.getShareInfo(params) |
|
|
// file = await system.fs.getShareInfo(params) |
|
@ -185,7 +238,10 @@ const { refersh, createFolder, backFolder, openFolder, onComputerMount } = useCo |
|
|
// file = params |
|
|
// file = params |
|
|
// } |
|
|
// } |
|
|
// return system.fs.readShareFileDir(getSystemConfig().userInfo.id, file) |
|
|
// return system.fs.readShareFileDir(getSystemConfig().userInfo.id, file) |
|
|
return system.fs.readShareFileDir(getSystemConfig().userInfo.id, path) |
|
|
return system.fs.readShareFileDir( |
|
|
|
|
|
getSystemConfig().userInfo.id, |
|
|
|
|
|
path |
|
|
|
|
|
); |
|
|
}, |
|
|
}, |
|
|
notify(title, content) { |
|
|
notify(title, content) { |
|
|
new Notify({ |
|
|
new Notify({ |
|
@ -196,18 +252,23 @@ const { refersh, createFolder, backFolder, openFolder, onComputerMount } = useCo |
|
|
search(keyword) { |
|
|
search(keyword) { |
|
|
return system.fs.search(keyword); |
|
|
return system.fs.search(keyword); |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
function handleHistoryChange(offset: number) { |
|
|
function handleHistoryChange(offset: number) { |
|
|
if (router_url_history_index.value + offset < 0) return; |
|
|
if (router_url_history_index.value + offset < 0) return; |
|
|
if (router_url_history_index.value + offset > router_url_history.value.length - 1) |
|
|
if ( |
|
|
|
|
|
router_url_history_index.value + offset > |
|
|
|
|
|
router_url_history.value.length - 1 |
|
|
|
|
|
) |
|
|
return; |
|
|
return; |
|
|
router_url_history_index.value = router_url_history_index.value + offset; |
|
|
router_url_history_index.value = |
|
|
router_url.value = router_url_history.value[router_url_history_index.value]; |
|
|
router_url_history_index.value + offset; |
|
|
|
|
|
router_url.value = |
|
|
|
|
|
router_url_history.value[router_url_history_index.value]; |
|
|
|
|
|
|
|
|
refersh(); |
|
|
refersh(); |
|
|
} |
|
|
} |
|
|
const leftWidth = ref(200); |
|
|
const leftWidth = ref(200); |
|
|
function leftHandleDown(e: MouseEvent) { |
|
|
function leftHandleDown(e: MouseEvent) { |
|
|
const startX = e.clientX; |
|
|
const startX = e.clientX; |
|
|
const startWidth = leftWidth.value; |
|
|
const startWidth = leftWidth.value; |
|
|
addEventListener("mousemove", leftHandleMove); |
|
|
addEventListener("mousemove", leftHandleMove); |
|
@ -222,10 +283,10 @@ function leftHandleDown(e: MouseEvent) { |
|
|
removeEventListener("mousemove", leftHandleMove); |
|
|
removeEventListener("mousemove", leftHandleMove); |
|
|
removeEventListener("mouseup", leftHandleUp); |
|
|
removeEventListener("mouseup", leftHandleUp); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const rootFileList = ref<Array<OsFileWithoutContent>>([]); |
|
|
const rootFileList = ref<Array<OsFileWithoutContent>>([]); |
|
|
const shareFileList = ref<Array<OsFileWithoutContent>>([ |
|
|
const shareFileList = ref<Array<OsFileWithoutContent>>([ |
|
|
{ |
|
|
{ |
|
|
ext: "", |
|
|
ext: "", |
|
|
isDirectory: true, |
|
|
isDirectory: true, |
|
@ -241,7 +302,7 @@ const shareFileList = ref<Array<OsFileWithoutContent>>([ |
|
|
mtime: "", |
|
|
mtime: "", |
|
|
rdev: 0, |
|
|
rdev: 0, |
|
|
atime: "", |
|
|
atime: "", |
|
|
birthtime: "" |
|
|
birthtime: "", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
ext: "", |
|
|
ext: "", |
|
@ -258,12 +319,12 @@ const shareFileList = ref<Array<OsFileWithoutContent>>([ |
|
|
mtime: "", |
|
|
mtime: "", |
|
|
rdev: 0, |
|
|
rdev: 0, |
|
|
atime: "", |
|
|
atime: "", |
|
|
birthtime: "" |
|
|
birthtime: "", |
|
|
} |
|
|
}, |
|
|
]); |
|
|
]); |
|
|
const random = ref(0); |
|
|
const random = ref(0); |
|
|
const shareShow = ref(false) |
|
|
const shareShow = ref(false); |
|
|
onMounted(() => { |
|
|
onMounted(() => { |
|
|
if (config) { |
|
|
if (config) { |
|
|
router_url.value = config.path; |
|
|
router_url.value = config.path; |
|
|
} else { |
|
|
} else { |
|
@ -282,74 +343,77 @@ onMounted(() => { |
|
|
random.value = random.value + 1; |
|
|
random.value = random.value + 1; |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
shareShow.value = system.getConfig('userType') === 'member' ? true : false |
|
|
shareShow.value = |
|
|
|
|
|
system.getConfig("userType") === "member" ? true : false; |
|
|
// console.log('配置信息:', system.getConfig('userInfo').id); |
|
|
// console.log('配置信息:', system.getConfig('userInfo').id); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
}); |
|
|
function handleOuterClick() { |
|
|
|
|
|
|
|
|
function handleOuterClick() { |
|
|
|
|
|
emitEvent("mycomputer.click"); |
|
|
emitEvent("mycomputer.click"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function onListRefresh() { |
|
|
function onListRefresh() { |
|
|
refersh(); |
|
|
refersh(); |
|
|
system.fs.readdir("/").then((file: any) => { |
|
|
system.fs.readdir("/").then((file: any) => { |
|
|
if (file) { |
|
|
if (file) { |
|
|
rootFileList.value = [...file]; |
|
|
rootFileList.value = [...file]; |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/**------视图切换------ */ |
|
|
/**------视图切换------ */ |
|
|
const isPopoverView = ref(false); |
|
|
const isPopoverView = ref(false); |
|
|
function popoverChange() { |
|
|
function popoverChange() { |
|
|
isPopoverView.value = !isPopoverView.value; |
|
|
isPopoverView.value = !isPopoverView.value; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const chosenView = ref("icon"); |
|
|
const chosenView = ref("icon"); |
|
|
|
|
|
|
|
|
/**------树状列表打开------ */ |
|
|
/**------树状列表打开------ */ |
|
|
const chosenTreePath = ref(""); |
|
|
const chosenTreePath = ref(""); |
|
|
async function onTreeOpen(path: string) { |
|
|
async function onTreeOpen(path: string) { |
|
|
chosenTreePath.value = path; |
|
|
chosenTreePath.value = path; |
|
|
let file:any |
|
|
let file: any; |
|
|
// const file = await system.fs.stat(path); |
|
|
// const file = await system.fs.stat(path); |
|
|
if (isRootShare(path)) { |
|
|
if (isRootShare(path)) { |
|
|
file = path === '/F/myshare' ? shareFileList.value[0] : shareFileList.value[1] |
|
|
file = |
|
|
|
|
|
path === "/F/myshare" |
|
|
|
|
|
? shareFileList.value[0] |
|
|
|
|
|
: shareFileList.value[1]; |
|
|
} else if (isShareFile(path)) { |
|
|
} else if (isShareFile(path)) { |
|
|
file = await system.fs.getShareInfo(path) |
|
|
file = await system.fs.getShareInfo(path); |
|
|
file = file.fi |
|
|
file = file.fi; |
|
|
file.path = turnLocalPath(file.path, path, 1) |
|
|
file.path = turnLocalPath(file.path, path, 1); |
|
|
} else { |
|
|
} else { |
|
|
file = await system.fs.stat(path) |
|
|
file = await system.fs.stat(path); |
|
|
} |
|
|
} |
|
|
if (file) { |
|
|
if (file) { |
|
|
openFolder(file); |
|
|
openFolder(file); |
|
|
} |
|
|
} |
|
|
router_url.value = path; |
|
|
router_url.value = path; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/**------框选--------- */ |
|
|
/**------框选--------- */ |
|
|
let chosenCallback: (rect: Rect) => void = () => { |
|
|
let chosenCallback: (rect: Rect) => void = () => { |
|
|
// |
|
|
// |
|
|
}; |
|
|
}; |
|
|
function onChosen(callback: (rect: Rect) => void) { |
|
|
function onChosen(callback: (rect: Rect) => void) { |
|
|
chosenCallback = callback; |
|
|
chosenCallback = callback; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function backgroundDown(e: MouseEvent) { |
|
|
function backgroundDown(e: MouseEvent) { |
|
|
choseStart(e); |
|
|
choseStart(e); |
|
|
addEventListener("mousemove", backgroundMove); |
|
|
addEventListener("mousemove", backgroundMove); |
|
|
addEventListener("mouseup", backgroundUp); |
|
|
addEventListener("mouseup", backgroundUp); |
|
|
} |
|
|
} |
|
|
function backgroundMove(e: MouseEvent) { |
|
|
function backgroundMove(e: MouseEvent) { |
|
|
chosing(e); |
|
|
chosing(e); |
|
|
const rectValue = getRect(); |
|
|
const rectValue = getRect(); |
|
|
if (rectValue) { |
|
|
if (rectValue) { |
|
|
chosenCallback(rectValue); |
|
|
chosenCallback(rectValue); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
function backgroundUp() { |
|
|
function backgroundUp() { |
|
|
choseEnd(); |
|
|
choseEnd(); |
|
|
const rectValue = getRect(); |
|
|
const rectValue = getRect(); |
|
|
if (rectValue) { |
|
|
if (rectValue) { |
|
@ -357,31 +421,31 @@ function backgroundUp() { |
|
|
} |
|
|
} |
|
|
removeEventListener("mousemove", backgroundMove); |
|
|
removeEventListener("mousemove", backgroundMove); |
|
|
removeEventListener("mouseup", backgroundUp); |
|
|
removeEventListener("mouseup", backgroundUp); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* ------------ 新建文件夹 ------------*/ |
|
|
/* ------------ 新建文件夹 ------------*/ |
|
|
const createInput = ref(t("new.folder")); |
|
|
const createInput = ref(t("new.folder")); |
|
|
const creating = ref(false); |
|
|
const creating = ref(false); |
|
|
function creatingEditEnd() { |
|
|
function creatingEditEnd() { |
|
|
if (creating.value) { |
|
|
if (creating.value) { |
|
|
createFolder(createInput.value); |
|
|
createFolder(createInput.value); |
|
|
creating.value = false; |
|
|
creating.value = false; |
|
|
createInput.value = t("new.folder"); |
|
|
createInput.value = t("new.folder"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
function onBackClick() { |
|
|
function onBackClick() { |
|
|
creatingEditEnd(); |
|
|
creatingEditEnd(); |
|
|
} |
|
|
} |
|
|
/* ------------ 新建文件夹end ---------*/ |
|
|
/* ------------ 新建文件夹end ---------*/ |
|
|
|
|
|
|
|
|
function showOuterMenu(e: MouseEvent) { |
|
|
function showOuterMenu(e: MouseEvent) { |
|
|
e.preventDefault(); |
|
|
e.preventDefault(); |
|
|
createDesktopContextMenu(e, router_url.value, () => { |
|
|
createDesktopContextMenu(e, router_url.value, () => { |
|
|
refersh(); |
|
|
refersh(); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
/* ------------ 路径输入框 ------------*/ |
|
|
/* ------------ 路径输入框 ------------*/ |
|
|
async function handleNavRefresh(path: string) { |
|
|
async function handleNavRefresh(path: string) { |
|
|
if (path == "") return; |
|
|
if (path == "") return; |
|
|
if (path.startsWith("search:")) { |
|
|
if (path.startsWith("search:")) { |
|
|
setRouter(path); |
|
|
setRouter(path); |
|
@ -397,23 +461,23 @@ async function handleNavRefresh(path: string) { |
|
|
setRouter(dirname(path)); |
|
|
setRouter(dirname(path)); |
|
|
refersh(); |
|
|
refersh(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
async function handleNavSearch(path: string) { |
|
|
async function handleNavSearch(path: string) { |
|
|
setRouter("search:" + path); |
|
|
setRouter("search:" + path); |
|
|
refersh(); |
|
|
refersh(); |
|
|
} |
|
|
} |
|
|
/* ------------ 路径输入框end ---------*/ |
|
|
/* ------------ 路径输入框end ---------*/ |
|
|
</script> |
|
|
</script> |
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|
.uper { |
|
|
.uper { |
|
|
/* height: 40px; */ |
|
|
/* height: 40px; */ |
|
|
background-color: rgba(255, 235, 205, 0); |
|
|
background-color: rgba(255, 235, 205, 0); |
|
|
font-size: 12px; |
|
|
font-size: 12px; |
|
|
font-weight: 300; |
|
|
font-weight: 300; |
|
|
/* border-bottom: 1px solid black; */ |
|
|
/* border-bottom: 1px solid black; */ |
|
|
--button-item-height: 30px; |
|
|
--button-item-height: 30px; |
|
|
} |
|
|
} |
|
|
.main { |
|
|
.main { |
|
|
display: flex; |
|
|
display: flex; |
|
|
height: 100%; |
|
|
height: 100%; |
|
|
position: relative; |
|
|
position: relative; |
|
@ -448,9 +512,9 @@ async function handleNavSearch(path: string) { |
|
|
position: relative; |
|
|
position: relative; |
|
|
overflow-x: hidden; |
|
|
overflow-x: hidden; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.desk-item { |
|
|
.desk-item { |
|
|
position: relative; |
|
|
position: relative; |
|
|
cursor: default; |
|
|
cursor: default; |
|
|
box-sizing: border-box; |
|
|
box-sizing: border-box; |
|
@ -459,29 +523,29 @@ async function handleNavSearch(path: string) { |
|
|
background-color: rgba(119, 119, 119, 0); |
|
|
background-color: rgba(119, 119, 119, 0); |
|
|
color: white; |
|
|
color: white; |
|
|
border: 1px solid rgba(0, 0, 0, 0); |
|
|
border: 1px solid rgba(0, 0, 0, 0); |
|
|
} |
|
|
} |
|
|
.chosen { |
|
|
.chosen { |
|
|
border: 1px dashed #3bdbff3d; |
|
|
border: 1px dashed #3bdbff3d; |
|
|
background-color: #b9e3fd90; |
|
|
background-color: #b9e3fd90; |
|
|
} |
|
|
} |
|
|
.desk-item:hover { |
|
|
.desk-item:hover { |
|
|
border: 1px solid rgba(149, 149, 149, 0.233); |
|
|
border: 1px solid rgba(149, 149, 149, 0.233); |
|
|
background-color: #b9e3fd5a; |
|
|
background-color: #b9e3fd5a; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.item_img { |
|
|
.item_img { |
|
|
width: 50px; |
|
|
width: 50px; |
|
|
height: 40px; |
|
|
height: 40px; |
|
|
overflow: hidden; |
|
|
overflow: hidden; |
|
|
padding: 10px; |
|
|
padding: 10px; |
|
|
text-align: center; |
|
|
text-align: center; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.item_img img { |
|
|
.item_img img { |
|
|
user-select: none; |
|
|
user-select: none; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.item_name { |
|
|
.item_name { |
|
|
overflow: hidden; |
|
|
overflow: hidden; |
|
|
max-width: 200px; |
|
|
max-width: 200px; |
|
|
color: rgba(0, 0, 0, 0.664); |
|
|
color: rgba(0, 0, 0, 0.664); |
|
@ -496,20 +560,20 @@ async function handleNavSearch(path: string) { |
|
|
display: -webkit-box; |
|
|
display: -webkit-box; |
|
|
-webkit-box-orient: vertical; |
|
|
-webkit-box-orient: vertical; |
|
|
-webkit-line-clamp: 2; |
|
|
-webkit-line-clamp: 2; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.item_input { |
|
|
.item_input { |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.group { |
|
|
.group { |
|
|
display: flex; |
|
|
display: flex; |
|
|
border-bottom: 1px solid rgba(134, 134, 134, 0.267); |
|
|
border-bottom: 1px solid rgba(134, 134, 134, 0.267); |
|
|
|
|
|
|
|
|
user-select: none; |
|
|
user-select: none; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.button { |
|
|
.button { |
|
|
cursor: pointer; |
|
|
cursor: pointer; |
|
|
text-align: center; |
|
|
text-align: center; |
|
|
width: 50px; |
|
|
width: 50px; |
|
@ -525,18 +589,18 @@ async function handleNavSearch(path: string) { |
|
|
transition: 0.1s; |
|
|
transition: 0.1s; |
|
|
white-space: nowrap; |
|
|
white-space: nowrap; |
|
|
user-select: none; |
|
|
user-select: none; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.button:hover { |
|
|
.button:hover { |
|
|
/* background-color: #137bd2; */ |
|
|
/* background-color: #137bd2; */ |
|
|
background-color: #1b6bad; |
|
|
background-color: #1b6bad; |
|
|
color: white; |
|
|
color: white; |
|
|
} |
|
|
} |
|
|
.showName { |
|
|
.showName { |
|
|
font-size: 11px; |
|
|
font-size: 11px; |
|
|
text-indent: 5px; |
|
|
text-indent: 5px; |
|
|
} |
|
|
} |
|
|
.disktopshow { |
|
|
.disktopshow { |
|
|
font-size: 12px; |
|
|
font-size: 12px; |
|
|
line-height: 20px; |
|
|
line-height: 20px; |
|
|
max-width: 200px; |
|
|
max-width: 200px; |
|
@ -548,8 +612,8 @@ async function handleNavSearch(path: string) { |
|
|
.el-icon { |
|
|
.el-icon { |
|
|
margin-right: 3px; |
|
|
margin-right: 3px; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
.disktopshow:hover { |
|
|
.disktopshow:hover { |
|
|
background-color: #b1f1ff4c; |
|
|
background-color: #b1f1ff4c; |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |
|
|