no message
This commit is contained in:
parent
7bf05c91a6
commit
fa01bb4e7d
@ -509,7 +509,7 @@ class FileController extends AbstractController
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
if ($file->isNnShare()) {
|
if ($file->isNnShare()) {
|
||||||
return Base::retError('已经处于共享目录中');
|
return Base::retError('已经处于共享文件夹中');
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
if ($action == 'unshare') {
|
if ($action == 'unshare') {
|
||||||
|
@ -51,21 +51,21 @@ class File extends AbstractModel
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否有访问权限
|
* 是否有访问权限
|
||||||
* ① 自己的目录
|
* ① 自己的文件夹
|
||||||
* ② 共享所有人的目录
|
* ② 共享所有人的文件夹
|
||||||
* ③ 在指定共享人员内
|
* ③ 在指定共享人员内
|
||||||
* @param $userid
|
* @param $userid
|
||||||
*/
|
*/
|
||||||
public function chackAllow($userid)
|
public function chackAllow($userid)
|
||||||
{
|
{
|
||||||
if ($userid == $this->userid) {
|
if ($userid == $this->userid) {
|
||||||
// ① 自己的目录
|
// ① 自己的文件夹
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$row = $this->getShareInfo();
|
$row = $this->getShareInfo();
|
||||||
if ($row) {
|
if ($row) {
|
||||||
if ($row->share == 1) {
|
if ($row->share == 1) {
|
||||||
// ② 共享所有人的目录
|
// ② 共享所有人的文件夹
|
||||||
return;
|
return;
|
||||||
} elseif ($row->share == 2) {
|
} elseif ($row->share == 2) {
|
||||||
// ③ 在指定共享人员内
|
// ③ 在指定共享人员内
|
||||||
@ -101,7 +101,7 @@ class File extends AbstractModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否处于共享目录内(不含自身)
|
* 是否处于共享文件夹内(不含自身)
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isNnShare()
|
public function isNnShare()
|
||||||
|
@ -249,7 +249,7 @@ class Base
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新建目录
|
* 新建文件夹
|
||||||
* @param $path
|
* @param $path
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
@ -268,7 +268,7 @@ class Base
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除目录
|
* 删除文件夹
|
||||||
* @param $path
|
* @param $path
|
||||||
*/
|
*/
|
||||||
public static function deleteDir($path)
|
public static function deleteDir($path)
|
||||||
@ -277,9 +277,9 @@ class Base
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除目录及目录下所有的文件
|
* 删除文件夹及文件夹下所有的文件
|
||||||
* @param $dirName
|
* @param $dirName
|
||||||
* @param bool $undeleteDir 不删除目录(只删除文件)
|
* @param bool $undeleteDir 不删除文件夹(只删除文件)
|
||||||
*/
|
*/
|
||||||
public static function deleteDirAndFile($dirName, $undeleteDir = false)
|
public static function deleteDirAndFile($dirName, $undeleteDir = false)
|
||||||
{
|
{
|
||||||
@ -2129,7 +2129,7 @@ class Base
|
|||||||
$array = [
|
$array = [
|
||||||
"name" => $fileName, //原文件名
|
"name" => $fileName, //原文件名
|
||||||
"size" => Base::twoFloat($fileSize / 1024, true), //大小KB
|
"size" => Base::twoFloat($fileSize / 1024, true), //大小KB
|
||||||
"file" => $filePath . $fileName, //目录的完整路径 "D:\www....KzZ.jpg"
|
"file" => $filePath . $fileName, //文件的完整路径 "D:\www....KzZ.jpg"
|
||||||
"path" => $fileDir . $fileName, //相对路径 "uploads/pic....KzZ.jpg"
|
"path" => $fileDir . $fileName, //相对路径 "uploads/pic....KzZ.jpg"
|
||||||
"url" => Base::fillUrl($fileDir . $fileName), //完整的URL "https://.....hhsKzZ.jpg"
|
"url" => Base::fillUrl($fileDir . $fileName), //完整的URL "https://.....hhsKzZ.jpg"
|
||||||
"thumb" => '', //缩略图(预览图) "https://.....hhsKzZ.jpg_thumb.jpg"
|
"thumb" => '', //缩略图(预览图) "https://.....hhsKzZ.jpg_thumb.jpg"
|
||||||
@ -2278,7 +2278,7 @@ class Base
|
|||||||
$array = [
|
$array = [
|
||||||
"name" => $file->getClientOriginalName(), //原文件名
|
"name" => $file->getClientOriginalName(), //原文件名
|
||||||
"size" => Base::twoFloat($fileSize / 1024, true), //大小KB
|
"size" => Base::twoFloat($fileSize / 1024, true), //大小KB
|
||||||
"file" => public_path($param['path'] . $fileName), //目录的完整路径 "D:\www....KzZ.jpg"
|
"file" => public_path($param['path'] . $fileName), //文件的完整路径 "D:\www....KzZ.jpg"
|
||||||
"path" => $param['path'] . $fileName, //相对路径 "uploads/pic....KzZ.jpg"
|
"path" => $param['path'] . $fileName, //相对路径 "uploads/pic....KzZ.jpg"
|
||||||
"url" => Base::fillUrl($param['path'] . $fileName), //完整的URL "https://.....hhsKzZ.jpg"
|
"url" => Base::fillUrl($param['path'] . $fileName), //完整的URL "https://.....hhsKzZ.jpg"
|
||||||
"thumb" => '', //缩略图(预览图) "https://.....hhsKzZ.jpg_thumb.jpg"
|
"thumb" => '', //缩略图(预览图) "https://.....hhsKzZ.jpg_thumb.jpg"
|
||||||
|
@ -7,7 +7,7 @@ const argv = process.argv;
|
|||||||
const env = require('dotenv').config({ path: './.env' })
|
const env = require('dotenv').config({ path: './.env' })
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除目录及文件
|
* 删除文件夹及文件
|
||||||
* @param path
|
* @param path
|
||||||
*/
|
*/
|
||||||
function deleteFile(path) {
|
function deleteFile(path) {
|
||||||
|
1
public/images/file/updir.svg
Normal file
1
public/images/file/updir.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg t="1625965307816" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5186"><path d="M157.55422847 260.93639894h708.89154306c32.51369263 0 59.08291044 26.56921781 59.08291046 59.08291044v472.61159243c0 32.46200152-26.56921781 59.03121935-59.08291046 59.03121935H157.55422847A59.23798371 59.23798371 0 0 1 98.47131801 792.68259288V260.93639894h59.08291046z" fill="#F7D154" p-id="5187"></path><path d="M497.21634964 260.93639894S494.26995777 172.33787884 408.61782952 172.33787884H187.06983813C101.41770988 172.33787884 98.47131801 260.93639894 98.47131801 260.93639894h398.74503163z" fill="#ECC049" p-id="5188"></path><path d="M169.56948774 333.95339175h684.86102452c8.19762251 0 13.71064349 5.46508168 13.71064347 13.66270422v13.71064348H155.81090492v-13.71064348c0-8.19762251 5.513021-13.66270419 13.71064349-13.66270422zM389.32329822 612.04934607h66.25213048v80.53804575c0 19.84687555 16.10760914 35.90654541 35.90654538 35.90654538h41.22780912a35.90654541 35.90654541 0 0 0 35.85860606-35.85860608v-80.58598505h66.06037321a21.18917632 21.18917632 0 0 0 15.81997329-35.28333431l0.14381793-0.14381793-123.20403425-123.20403422-0.04793929 0.04793928a21.14123699 21.14123699 0 0 0-31.40025001 1.43817942l-118.41010291 118.41010292a21.23711564 21.23711564 0 0 0 11.79307099 38.73496484z" fill="#FFFFFF" p-id="5189"></path></svg>
|
After Width: | Height: | Size: 1.3 KiB |
@ -334,7 +334,7 @@
|
|||||||
browseItem(item) {
|
browseItem(item) {
|
||||||
//点击选择图片
|
//点击选择图片
|
||||||
if (item.type === 'dir') {
|
if (item.type === 'dir') {
|
||||||
//目录
|
//文件夹
|
||||||
this.browsePicture(item.path);
|
this.browsePicture(item.path);
|
||||||
}else if (item.type === 'file') {
|
}else if (item.type === 'file') {
|
||||||
//文件
|
//文件
|
||||||
|
@ -171,7 +171,7 @@
|
|||||||
@mouseenter="mousescrollSide('right')">
|
@mouseenter="mousescrollSide('right')">
|
||||||
<div v-html="html" ref="previewInner"></div>
|
<div v-html="html" ref="previewInner"></div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 目录 -->
|
<!-- 文件夹 -->
|
||||||
<ul v-show="tocShow" class="toc-anchor">
|
<ul v-show="tocShow" class="toc-anchor">
|
||||||
<li class="toc-anchor-item" v-for="item in tocLists" :key="item.anchor" @click="tocClick(item)">
|
<li class="toc-anchor-item" v-for="item in tocLists" :key="item.anchor" @click="tocClick(item)">
|
||||||
<span :class="`toc-link-${tocLevel(item.level)}${tocAction == item.anchor ? ' toc-link-action' : ''}`" :anchor="item.anchor" :title="item.text">{{item.text}}</span>
|
<span :class="`toc-link-${tocLevel(item.level)}${tocAction == item.anchor ? ' toc-link-action' : ''}`" :anchor="item.anchor" :title="item.text">{{item.text}}</span>
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-file">
|
<div class="page-file">
|
||||||
<PageTitle :title="$L('文件')"/>
|
<PageTitle :title="$L('文件')"/>
|
||||||
<div class="file-wrapper">
|
|
||||||
|
<div class="file-wrapper" ref="fileWrapper">
|
||||||
|
|
||||||
<div class="file-head">
|
<div class="file-head">
|
||||||
<div class="file-nav">
|
<div class="file-nav">
|
||||||
<h1>{{$L('文件')}}</h1>
|
<h1>{{$L('文件')}}</h1>
|
||||||
@ -11,24 +13,10 @@
|
|||||||
<Input v-model="searchKey" suffix="ios-search" @on-change="onSearchChange" :placeholder="$L('搜索名称')"/>
|
<Input v-model="searchKey" suffix="ios-search" @on-change="onSearchChange" :placeholder="$L('搜索名称')"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="file-add">
|
<div class="file-add">
|
||||||
<EDropdown
|
<Button shape="circle" icon="md-add" @click.stop="handleRightClick($event, null, true)"></Button>
|
||||||
trigger="click"
|
|
||||||
placement="bottom"
|
|
||||||
@command="addFile">
|
|
||||||
<i class="taskfont"></i>
|
|
||||||
<EDropdownMenu slot="dropdown" class="page-file-dropdown-menu">
|
|
||||||
<EDropdownItem
|
|
||||||
v-for="(type, key) in types"
|
|
||||||
v-if="type.label"
|
|
||||||
:key="key"
|
|
||||||
:divided="!!type.divided"
|
|
||||||
:command="type.value">
|
|
||||||
<div :class="['file-item ' + type.value]">{{$L(type.label)}}</div>
|
|
||||||
</EDropdownItem>
|
|
||||||
</EDropdownMenu>
|
|
||||||
</EDropdown>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="file-navigator">
|
<div class="file-navigator">
|
||||||
<ul>
|
<ul>
|
||||||
<li @click="[pid=0,searchKey='']">{{$L('全部文件')}}</li>
|
<li @click="[pid=0,searchKey='']">{{$L('全部文件')}}</li>
|
||||||
@ -38,19 +26,20 @@
|
|||||||
<span :title="item.name">{{item.name}}</span>
|
<span :title="item.name">{{item.name}}</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div v-if="loadIng > 0" class="nav-load"><Loading/></div>
|
|
||||||
<Button v-if="shearFile && shearFile.pid != pid" size="small" type="primary" @click="shearTo">
|
<Button v-if="shearFile && shearFile.pid != pid" size="small" type="primary" @click="shearTo">
|
||||||
<div class="file-shear">
|
<div class="file-shear">
|
||||||
<span>{{$L('粘贴')}}</span>
|
<span>{{$L('粘贴')}}</span>
|
||||||
"<em>{{shearFile.name}}</em>"
|
"<em>{{shearFile.name}}</em>"
|
||||||
</div>
|
</div>
|
||||||
</Button>
|
</Button>
|
||||||
|
<div v-if="loadIng > 0" class="nav-load"><Loading/></div>
|
||||||
<div class="flex-full"></div>
|
<div class="flex-full"></div>
|
||||||
<div :class="['switch-button', tableMode ? 'table' : '']" @click="tableMode=!tableMode">
|
<div :class="['switch-button', tableMode ? 'table' : '']" @click="tableMode=!tableMode">
|
||||||
<div><i class="taskfont"></i></div>
|
<div><i class="taskfont"></i></div>
|
||||||
<div><i class="taskfont"></i></div>
|
<div><i class="taskfont"></i></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="tableMode" class="file-table">
|
<div v-if="tableMode" class="file-table">
|
||||||
<Table
|
<Table
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
@ -58,6 +47,8 @@
|
|||||||
:height="tableHeight"
|
:height="tableHeight"
|
||||||
:no-data-text="$L('没有任何文件')"
|
:no-data-text="$L('没有任何文件')"
|
||||||
@on-cell-click="clickRow"
|
@on-cell-click="clickRow"
|
||||||
|
@on-contextmenu="handleContextMenu"
|
||||||
|
context-menu
|
||||||
stripe/>
|
stripe/>
|
||||||
</div>
|
</div>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
@ -65,25 +56,16 @@
|
|||||||
<i class="taskfont"></i>
|
<i class="taskfont"></i>
|
||||||
<p>{{$L('没有任何文件')}}</p>
|
<p>{{$L('没有任何文件')}}</p>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="file-list">
|
<div v-else class="file-list" @contextmenu.prevent="handleRightClick">
|
||||||
<ul class="clearfix">
|
<ul class="clearfix">
|
||||||
<li v-for="item in fileList" :class="[item.type, item.id && shearId == item.id ? 'shear' : '']" @click="openFile(item)">
|
<li
|
||||||
<EDropdown
|
v-for="item in fileList"
|
||||||
trigger="click"
|
:class="[item.type, item.id && shearId == item.id ? 'shear' : '']"
|
||||||
size="small"
|
@contextmenu.prevent.stop="handleRightClick($event, item)"
|
||||||
placement="bottom"
|
@click="openFile(item)">
|
||||||
class="file-menu"
|
<div class="file-menu" @click.stop="handleRightClick($event, item)">
|
||||||
@command="dropFile(item, $event)">
|
<Icon type="ios-more" />
|
||||||
<Icon @click.stop="" type="ios-more" />
|
</div>
|
||||||
<EDropdownMenu slot="dropdown">
|
|
||||||
<EDropdownItem command="open">{{$L('打开')}}</EDropdownItem>
|
|
||||||
<EDropdownItem command="rename" divided>{{$L('重命名')}}</EDropdownItem>
|
|
||||||
<EDropdownItem command="copy" :disabled="item.type=='folder'">{{$L('复制')}}</EDropdownItem>
|
|
||||||
<EDropdownItem command="shear" :disabled="item.userid != userId">{{$L('剪切')}}</EDropdownItem>
|
|
||||||
<EDropdownItem command="share" :disabled="item.userid != userId" divided>{{$L('共享')}}</EDropdownItem>
|
|
||||||
<EDropdownItem command="delete" divided style="color:red">{{$L('删除')}}</EDropdownItem>
|
|
||||||
</EDropdownMenu>
|
|
||||||
</EDropdown>
|
|
||||||
<div class="file-icon">
|
<div class="file-icon">
|
||||||
<template v-if="item.share">
|
<template v-if="item.share">
|
||||||
<UserAvatar v-if="item.userid != userId" :userid="item.userid" class="share-avatar" :size="20"/>
|
<UserAvatar v-if="item.userid != userId" :userid="item.userid" class="share-avatar" :size="20"/>
|
||||||
@ -108,15 +90,62 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<div class="file-menu" :style="contextMenuStyles">
|
||||||
|
<Dropdown trigger="custom" :visible="contextMenuVisible" transfer @on-clickoutside="handleClickContextMenuOutside">
|
||||||
|
<DropdownMenu slot="list" class="page-file-dropdown-menu">
|
||||||
|
<template v-if="contextMenuItem.id">
|
||||||
|
<DropdownItem @click.native="handleContextClick('open')">{{$L('打开')}}</DropdownItem>
|
||||||
|
<DropdownItem @click.native="handleContextClick('rename')" divided>{{$L('重命名')}}</DropdownItem>
|
||||||
|
<DropdownItem @click.native="handleContextClick('copy')" :disabled="contextMenuItem.type=='folder'">{{$L('复制')}}</DropdownItem>
|
||||||
|
<DropdownItem @click.native="handleContextClick('shear')" :disabled="contextMenuItem.userid != userId">{{$L('剪切')}}</DropdownItem>
|
||||||
|
<DropdownItem @click.native="handleContextClick('share')" :disabled="contextMenuItem.userid != userId" divided>{{$L('共享')}}</DropdownItem>
|
||||||
|
<DropdownItem @click.native="handleContextClick('delete')" divided style="color:red">{{$L('删除')}}</DropdownItem>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<DropdownItem
|
||||||
|
v-for="(type, key) in types"
|
||||||
|
v-if="type.label"
|
||||||
|
:key="key"
|
||||||
|
:divided="!!type.divided"
|
||||||
|
@click.native="addFile(type.value)">
|
||||||
|
<div :class="['file-item ' + type.value]">{{$L(type.label)}}</div>
|
||||||
|
</DropdownItem>
|
||||||
|
</template>
|
||||||
|
</DropdownMenu>
|
||||||
|
</Dropdown>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--上传文件-->
|
||||||
<Upload
|
<Upload
|
||||||
name="files"
|
name="files"
|
||||||
ref="fileUpload"
|
ref="fileUpload"
|
||||||
v-show="false"
|
v-show="false"
|
||||||
:action="actionUrl"
|
:action="actionUrl"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
multiple
|
:multiple="true"
|
||||||
|
:webkitdirectory="false"
|
||||||
|
:format="uploadFormat"
|
||||||
|
:accept="uploadAccept"
|
||||||
|
:show-upload-list="false"
|
||||||
|
:max-size="maxSize"
|
||||||
|
:on-progress="handleProgress"
|
||||||
|
:on-success="handleSuccess"
|
||||||
|
:on-error="handleError"
|
||||||
|
:on-format-error="handleFormatError"
|
||||||
|
:on-exceeded-size="handleMaxSize"
|
||||||
|
:before-upload="handleBeforeUpload"/>
|
||||||
|
|
||||||
|
<!--上传文件夹-->
|
||||||
|
<Upload
|
||||||
|
name="files"
|
||||||
|
ref="dirUpload"
|
||||||
|
v-show="false"
|
||||||
|
:action="actionUrl"
|
||||||
|
:headers="headers"
|
||||||
|
:multiple="true"
|
||||||
|
:webkitdirectory="true"
|
||||||
:format="uploadFormat"
|
:format="uploadFormat"
|
||||||
:accept="uploadAccept"
|
:accept="uploadAccept"
|
||||||
:show-upload-list="false"
|
:show-upload-list="false"
|
||||||
@ -167,6 +196,7 @@
|
|||||||
import {mapState} from "vuex";
|
import {mapState} from "vuex";
|
||||||
import {sortBy} from "lodash";
|
import {sortBy} from "lodash";
|
||||||
import UserInput from "../../components/UserInput";
|
import UserInput from "../../components/UserInput";
|
||||||
|
|
||||||
const FileContent = () => import('./components/FileContent');
|
const FileContent = () => import('./components/FileContent');
|
||||||
|
|
||||||
|
|
||||||
@ -184,13 +214,19 @@ export default {
|
|||||||
types: [
|
types: [
|
||||||
{
|
{
|
||||||
"value": "folder",
|
"value": "folder",
|
||||||
"label": "新建目录",
|
"label": "新建文件夹",
|
||||||
"name": "目录",
|
"name": "文件夹",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"value": "upload",
|
"value": "upload",
|
||||||
"label": "上传文件",
|
"label": "上传文件",
|
||||||
"name": "上传",
|
"name": null,
|
||||||
|
"divided": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "updir",
|
||||||
|
"label": "上传文件夹",
|
||||||
|
"name": null,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"value": "document",
|
"value": "document",
|
||||||
@ -244,10 +280,18 @@ export default {
|
|||||||
editHeight: 0,
|
editHeight: 0,
|
||||||
editInfo: {},
|
editInfo: {},
|
||||||
|
|
||||||
|
uploadDir: false,
|
||||||
uploadIng: 0,
|
uploadIng: 0,
|
||||||
uploadFormat: ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx'],
|
uploadFormat: ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx'],
|
||||||
uploadAccept: ['.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx'].join(","),
|
uploadAccept: ['.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx'].join(","),
|
||||||
maxSize: 204800
|
maxSize: 204800,
|
||||||
|
|
||||||
|
contextMenuItem: {},
|
||||||
|
contextMenuVisible: false,
|
||||||
|
contextMenuStyles: {
|
||||||
|
top: 0,
|
||||||
|
left: 0
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -390,6 +434,7 @@ export default {
|
|||||||
array.push(h('QuickEdit', {
|
array.push(h('QuickEdit', {
|
||||||
props: {
|
props: {
|
||||||
value: row.name,
|
value: row.name,
|
||||||
|
autoEdit: !!row._edit
|
||||||
},
|
},
|
||||||
on: {
|
on: {
|
||||||
'on-edit-change': (b) => {
|
'on-edit-change': (b) => {
|
||||||
@ -464,7 +509,7 @@ export default {
|
|||||||
resizable: true,
|
resizable: true,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
render: (h, {row}) => {
|
render: (h, {row}) => {
|
||||||
let type = this.types.find(({value}) => value == row.type);
|
let type = this.types.find(({value, name}) => value == row.type && name);
|
||||||
if (type) {
|
if (type) {
|
||||||
return h('AutoTip', type.name);
|
return h('AutoTip', type.name);
|
||||||
} else {
|
} else {
|
||||||
@ -523,8 +568,13 @@ export default {
|
|||||||
|
|
||||||
addFile(command) {
|
addFile(command) {
|
||||||
if (command == 'upload') {
|
if (command == 'upload') {
|
||||||
|
this.uploadDir = false
|
||||||
this.$refs.fileUpload.handleClick();
|
this.$refs.fileUpload.handleClick();
|
||||||
return;
|
return;
|
||||||
|
} else if (command == 'updir') {
|
||||||
|
this.uploadDir = true
|
||||||
|
this.$refs.dirUpload.handleClick();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
let id = $A.randomString(8);
|
let id = $A.randomString(8);
|
||||||
this.files.push({
|
this.files.push({
|
||||||
@ -538,6 +588,25 @@ export default {
|
|||||||
this.autoBlur(id)
|
this.autoBlur(id)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handleRightClick(event, item, isAddButton) {
|
||||||
|
this.contextMenuItem = $A.isJson(item) ? item : {};
|
||||||
|
if (this.contextMenuVisible) {
|
||||||
|
this.handleClickContextMenuOutside();
|
||||||
|
}
|
||||||
|
this.$nextTick(() => {
|
||||||
|
const fileWrap = this.$refs.fileWrapper;
|
||||||
|
const fileBounding = fileWrap.getBoundingClientRect();
|
||||||
|
this.contextMenuStyles = {
|
||||||
|
left: `${event.clientX - fileBounding.left}px`,
|
||||||
|
top: `${event.clientY - fileBounding.top}px`
|
||||||
|
};
|
||||||
|
if (isAddButton === true) {
|
||||||
|
this.contextMenuStyles.top = `${event.target.clientHeight + event.target.offsetTop - 5}px`
|
||||||
|
}
|
||||||
|
this.contextMenuVisible = true;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
openFile(item) {
|
openFile(item) {
|
||||||
if (this.fileList.findIndex((file) => file._edit === true) > -1) {
|
if (this.fileList.findIndex((file) => file._edit === true) > -1) {
|
||||||
return;
|
return;
|
||||||
@ -559,6 +628,18 @@ export default {
|
|||||||
this.dropFile(row, 'open');
|
this.dropFile(row, 'open');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handleContextMenu(row, event) {
|
||||||
|
this.handleRightClick(event, this.files.find(({id}) => id === row.id) || {});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleContextClick(command) {
|
||||||
|
this.dropFile(this.contextMenuItem, command)
|
||||||
|
},
|
||||||
|
|
||||||
|
handleClickContextMenuOutside() {
|
||||||
|
this.contextMenuVisible = false;
|
||||||
|
},
|
||||||
|
|
||||||
dropFile(item, command) {
|
dropFile(item, command) {
|
||||||
switch (command) {
|
switch (command) {
|
||||||
case 'open':
|
case 'open':
|
||||||
@ -653,7 +734,10 @@ export default {
|
|||||||
cursor: 'all'
|
cursor: 'all'
|
||||||
})
|
})
|
||||||
} else if (document.getElementById('input_' + id)) {
|
} else if (document.getElementById('input_' + id)) {
|
||||||
document.getElementById('input_' + id).focus();
|
const el = document.getElementById('input_' + id);
|
||||||
|
const len = el.value.length;
|
||||||
|
el.focus();
|
||||||
|
el.setSelectionRange(0, len);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -794,6 +878,9 @@ export default {
|
|||||||
|
|
||||||
handleFormatError(file) {
|
handleFormatError(file) {
|
||||||
//上传类型错误
|
//上传类型错误
|
||||||
|
if (this.uploadDir) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$A.modalWarning({
|
$A.modalWarning({
|
||||||
title: '文件格式不正确',
|
title: '文件格式不正确',
|
||||||
content: '文件 ' + file.name + ' 格式不正确,仅支持上传:' + this.uploadFormat.join(',')
|
content: '文件 ' + file.name + ' 格式不正确,仅支持上传:' + this.uploadFormat.join(',')
|
||||||
|
@ -16,7 +16,6 @@ $--dropdown-menuItem-hover-color: #606266;
|
|||||||
|
|
||||||
.el-dropdown-menu__item {
|
.el-dropdown-menu__item {
|
||||||
min-width: 100px;
|
min-width: 100px;
|
||||||
line-height: 34px;
|
|
||||||
.item {
|
.item {
|
||||||
&.red {
|
&.red {
|
||||||
color: #f00;
|
color: #f00;
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
height: 0;
|
height: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
position: relative;
|
||||||
.file-head {
|
.file-head {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -49,7 +50,7 @@
|
|||||||
}
|
}
|
||||||
.file-add {
|
.file-add {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
margin-left: 22px;
|
margin-left: 18px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
.taskfont {
|
.taskfont {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
@ -258,6 +259,9 @@
|
|||||||
&.upload:before {
|
&.upload:before {
|
||||||
background-image: url("../images/file/upload.svg");
|
background-image: url("../images/file/upload.svg");
|
||||||
}
|
}
|
||||||
|
&.updir:before {
|
||||||
|
background-image: url("../images/file/updir.svg");
|
||||||
|
}
|
||||||
&.folder:before {
|
&.folder:before {
|
||||||
background-image: url("../images/file/folder.svg");
|
background-image: url("../images/file/folder.svg");
|
||||||
}
|
}
|
||||||
@ -347,8 +351,8 @@
|
|||||||
.file-menu {
|
.file-menu {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 2px;
|
||||||
right: 0;
|
right: 2px;
|
||||||
transition: opacity 0.2s;
|
transition: opacity 0.2s;
|
||||||
display: flex;
|
display: flex;
|
||||||
.ivu-icon {
|
.ivu-icon {
|
||||||
@ -395,6 +399,9 @@
|
|||||||
&.upload .file-icon {
|
&.upload .file-icon {
|
||||||
background-image: url("../images/file/upload.svg");
|
background-image: url("../images/file/upload.svg");
|
||||||
}
|
}
|
||||||
|
&.updir .file-icon {
|
||||||
|
background-image: url("../images/file/updir.svg");
|
||||||
|
}
|
||||||
&.folder .file-icon {
|
&.folder .file-icon {
|
||||||
background-image: url("../images/file/folder.svg");
|
background-image: url("../images/file/folder.svg");
|
||||||
}
|
}
|
||||||
@ -428,6 +435,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.file-menu {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -439,8 +449,8 @@
|
|||||||
&:before {
|
&:before {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
content: "";
|
content: "";
|
||||||
width: 18px;
|
width: 20px;
|
||||||
height: 18px;
|
height: 20px;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: contain;
|
background-size: contain;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
@ -448,6 +458,9 @@
|
|||||||
&.upload:before {
|
&.upload:before {
|
||||||
background-image: url("../images/file/upload.svg");
|
background-image: url("../images/file/upload.svg");
|
||||||
}
|
}
|
||||||
|
&.updir:before {
|
||||||
|
background-image: url("../images/file/updir.svg");
|
||||||
|
}
|
||||||
&.folder:before {
|
&.folder:before {
|
||||||
background-image: url("../images/file/folder.svg");
|
background-image: url("../images/file/folder.svg");
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
## public目录所有资源将拷贝到public下
|
## public文件夹所有资源将拷贝到public下
|
||||||
|
1
resources/assets/statics/public/images/file/updir.svg
Normal file
1
resources/assets/statics/public/images/file/updir.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg t="1625965307816" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5186"><path d="M157.55422847 260.93639894h708.89154306c32.51369263 0 59.08291044 26.56921781 59.08291046 59.08291044v472.61159243c0 32.46200152-26.56921781 59.03121935-59.08291046 59.03121935H157.55422847A59.23798371 59.23798371 0 0 1 98.47131801 792.68259288V260.93639894h59.08291046z" fill="#F7D154" p-id="5187"></path><path d="M497.21634964 260.93639894S494.26995777 172.33787884 408.61782952 172.33787884H187.06983813C101.41770988 172.33787884 98.47131801 260.93639894 98.47131801 260.93639894h398.74503163z" fill="#ECC049" p-id="5188"></path><path d="M169.56948774 333.95339175h684.86102452c8.19762251 0 13.71064349 5.46508168 13.71064347 13.66270422v13.71064348H155.81090492v-13.71064348c0-8.19762251 5.513021-13.66270419 13.71064349-13.66270422zM389.32329822 612.04934607h66.25213048v80.53804575c0 19.84687555 16.10760914 35.90654541 35.90654538 35.90654538h41.22780912a35.90654541 35.90654541 0 0 0 35.85860606-35.85860608v-80.58598505h66.06037321a21.18917632 21.18917632 0 0 0 15.81997329-35.28333431l0.14381793-0.14381793-123.20403425-123.20403422-0.04793929 0.04793928a21.14123699 21.14123699 0 0 0-31.40025001 1.43817942l-118.41010291 118.41010292a21.23711564 21.23711564 0 0 0 11.79307099 38.73496484z" fill="#FFFFFF" p-id="5189"></path></svg>
|
After Width: | Height: | Size: 1.3 KiB |
Loading…
x
Reference in New Issue
Block a user