提交 995b8b5a 编写于 作者: doc_wei's avatar doc_wei

feat: 云盘管理第一版测试完成

上级 0daf8701
......@@ -27,7 +27,7 @@ function createFolder(folderId, refreshCallBack, initDragCallBack, currentUserId
name: '新建文件夹'
};
AjaxPostUtil.request({url: sysMainMation.diskCloudBasePath + "insertFileCatalog", params: params, type: 'json', method: 'POST', callback: function (json) {
initNewFolder(json.bean.id, json.bean.name, json.bean.logoPath, true, currentUserId);
initNewFolder(json.bean.id, json.bean.name, '../../assets/images/folder-show.png', true, currentUserId);
// 刷新节点
if(typeof(refreshCallBack) == "function") {
refreshCallBack();
......@@ -87,7 +87,9 @@ layui.define(["jquery"], function(exports) {
// 展示方式
$("body").on("click", ".showFileType", function (e) {
$(".showFileType").find("img").attr("src", "");
$(".showFileType").find("img").hide();
$(this).find("img").attr("src", "../../assets/images/icon_choose.png");
$(this).find("img").show();
if($(this).attr("data-type") === '1'){
$("#showTypeChoose").find("i").attr("class", "fa fa-th-large");
$("#showListStyle").html('');
......
......@@ -183,7 +183,7 @@ layui.config({
});
// 加载右侧右键内容
function initFileContentRight(_this, e){
function initFileContentRight(_this, e) {
var par = {
id: _this.attr("rowid"),
name: _this.find(".title").html(),
......@@ -192,7 +192,7 @@ layui.config({
$("#fileRightMenu").show();
$("#fileRightMenu").html(getDataUseHandlebars($("#fileRightMenuTemplate").html(), {bean: par}));
$("#fileRightMenu").css({top: e.clientY + "px", left: e.clientX + "px", visibility: "visible", position: "absolute"});
if($.inArray(_this.attr("filetype"), officeType) == -1){
if ($.inArray(_this.attr("filetype"), officeType) == -1) {
$(".openByOnlyOffice").hide();
$(".openByMicrosoftOffice").hide();
}
......@@ -792,7 +792,9 @@ layui.config({
if($(this).attr("data-type") != orderBy){
orderBy = $(this).attr("data-type");
$(".orderBy").find("img").attr("src", "");
$(".orderBy").find("img").hide();
$(this).find("img").attr("src", "../../assets/images/icon_choose.png");
$(this).find("img").show();
loadThisFolderChild();
}
});
......
......@@ -33,30 +33,32 @@ layui.config({
fileId: parent.shareId,
shareType: shareType
};
AjaxPostUtil.request({url: sysMainMation.diskCloudBasePath + "insertFileToShare", params: params, type: 'json', method: 'POST', callback: function (json) {
json.bean.shareUrl = reqBasePath + json.bean.shareUrl;
var str = "链接:" + json.bean.shareUrl;
if (json.bean.shareType === '1') {//无提取码
json.bean.shareType = "none";
json.bean.btnName = "复制链接";
} else {//有提取码
json.bean.shareType = "block";
json.bean.btnName = "复制链接及提取码";
str += " 提取码:" + json.bean.sharePassword;
}
var html = getDataUseHandlebars(getFileContent('tpl/fileconsole/shareFileTemplate.tpl'), json);
$("#shareDiv").html(html);
$("#copyBtn").attr("data-clipboard-text", str);
form.render();
AjaxPostUtil.request({url: sysMainMation.diskCloudBasePath + "insertFileToShare", params: params, type: 'json', method: 'POST', callback: function (result) {
AjaxPostUtil.request({url: sysMainMation.diskCloudBasePath + "fileconsole021", params: {id: result.bean.id}, type: 'json', method: 'GET', callback: function (json) {
json.bean.shareUrl = homePagePath + json.bean.shareUrl;
var str = "链接:" + json.bean.shareUrl;
if (json.bean.shareType === '1') {//无提取码
json.bean.shareType = "none";
json.bean.btnName = "复制链接";
} else {//有提取码
json.bean.shareType = "block";
json.bean.btnName = "复制链接及提取码";
str += " 提取码:" + json.bean.sharePassword;
}
var html = getDataUseHandlebars(getFileContent('tpl/fileconsole/shareFileTemplate.tpl'), json);
$("#shareDiv").html(html);
$("#copyBtn").attr("data-clipboard-text", str);
form.render();
//复制
clipboard = new ClipboardJS('#copyBtn');
clipboard.on('success', function(e) {
winui.window.msg("复制成功", {icon: 1, time: 2000});
});
clipboard.on('error', function(e) {
winui.window.msg("浏览器不支持!", {icon: 2, time: 2000});
});
//复制
clipboard = new ClipboardJS('#copyBtn');
clipboard.on('success', function(e) {
winui.window.msg("复制成功", {icon: 1, time: 2000});
});
clipboard.on('error', function(e) {
winui.window.msg("浏览器不支持!", {icon: 2, time: 2000});
});
}});
}});
});
......
......@@ -61,7 +61,7 @@ layui.config({
+ '<font id="exitBtn">退出</font>';
$("#operatorBtn").html(str);
$("#file-operator").html('<button class="layui-btn layui-btn-primary" id="saveBtn"><language showName="com.skyeye.save"></language></button>');
}, function (){
}, function () {
$("#operatorBtn").html('<font id="loginBtn">登陆</font>');
});
loadFileMation();
......@@ -72,9 +72,9 @@ layui.config({
//加载分享基础信息
AjaxPostUtil.request({url: sysMainMation.diskCloudBasePath + "fileconsole021", params: {id: rowId}, type: 'json', method: 'GET', callback: function (json) {
var str = "";
if (json.bean.fileType == 1) {//文件夹
if (json.bean.fileType == 'folder') {//文件夹
str = '<img src="../../assets/images/share-folder.png"/>';
} else if (json.bean.fileType == 2) {//文件
} else if (json.bean.fileType == 'file') {//文件
str = '<img src="../../assets/images/share-file.png"/>';
}
$("#fileTitle").html(str + json.bean.shareName);
......@@ -112,7 +112,7 @@ layui.config({
//下载按钮
$("body").on("click", ".file-list-content .file-item .size .download", function (e) {
if(isNull(getCookie('userToken'))){//用户信息为空,提示登陆
if (isNull(getCookie('userToken'))) {//用户信息为空,提示登陆
layer.confirm("该操作需要登陆后才可继续进行。", { icon: 3, title: '系统提示', btn: ['前往登陆','稍后登陆'] }, function (index) {
layer.close(index);
location.href = "../../tpl/index/login.html?url=" + escape("../../tpl/shareFile/shareFileList.html?id=" + rowId);
......@@ -120,11 +120,11 @@ layui.config({
} else {
var operaterId = $(this).parent().parent().attr("rowid");
var fileType = $(this).parent().parent().attr("filetype");
if(fileType === 'folder'){//文件夹
if (fileType === 'folder') {//文件夹
winui.window.msg('暂不提供文件夹的下载。', {icon: 2, time: 2000});
} else {//文件
AjaxPostUtil.request({url: sysMainMation.diskCloudBasePath + "queryFileConsoleById", params: {id: operaterId}, type: 'json', method: 'GET', callback: function (json) {
if($.inArray(json.bean.type, imageType) >= 0){//图片
if ($.inArray(json.bean.type, imageType) >= 0) {//图片
downloadImage(fileBasePath + json.bean.address, json.bean.name);
} else {
download(fileBasePath + json.bean.address, json.bean.name);
......@@ -138,7 +138,7 @@ layui.config({
//文件夹点击
$("body").on("click", ".file-list-content .file-item", function() {
var fileType = $(this).attr("filetype");
if(fileType === 'folder'){//文件夹
if (fileType === 'folder') {//文件夹
folderId = $(this).attr("rowid");
reFreshAllFilePath(folderId, $(this).find(".file_name").find("font").html());
loadFileList();
......
......@@ -42,7 +42,7 @@ layui.config({
$("#showForm").hide();
$("#showFormNone").show();
} else {//跳转列表页面
$.cookie("file" + rowId, $("#sharePassword").val(), {path: '/' });
setCookie("file" + rowId, $("#sharePassword").val());
location.href = "../../tpl/shareFile/shareFileList.html?id=" + rowId;
}
}});
......
......@@ -255,13 +255,13 @@
<ul class="layui-dropdown-menu">
<li class="is-file orderBy" data-type="1">
<a href="javascript:;">
<img alt="" src="" />
<img alt="" src="" style="display: none"/>
<span>名称</span>
</a>
</li>
<li class="is-file orderBy" data-type="2">
<a href="javascript:;">
<img alt="" src="" />
<img alt="" src="" style="display: none"/>
<span>上传时间</span>
</a>
</li>
......@@ -273,7 +273,7 @@
</li>
<li class="is-file orderBy" data-type="4">
<a href="javascript:;">
<img alt="" src="" />
<img alt="" src="" style="display: none"/>
<span>大小</span>
</a>
</li>
......@@ -292,7 +292,7 @@
</li>
<li class="is-file showFileType" data-type="2">
<a href="javascript:;">
<img alt="" src="" />
<img alt="" src="" style="display: none"/>
<span>列表排列</span>
</a>
</li>
......@@ -349,12 +349,6 @@
<span>分享</span>
</a>
</li>
<li class="is-file">
<a href="javascript:;">
<img alt="" src="../../assets/images/download-icon.png" />
<span>下载</span>
</a>
</li>
<li class="is-file treerefreshContent">
<a href="javascript:;">
<img alt="" src="../../assets/images/refresh-icon.png" />
......@@ -523,7 +517,7 @@
<!-- imagesTemplate.tpl -->
<script type="text/x-handlebars-template" id="imagesTemplate">
{{#bean}}
<div class="file images-box menu-folder" title="名称:{{name}}&#10;大小:{{fileSize}}&#10;上传时间:{{createTime}}&#10;操作人:{{createName}}" rowid="{{id}}" filetype="{{fileType}}" createId="{{createId}}">
<div class="file images-box menu-folder" title="名称:{{name}}&#10;大小:{{fileSize}}&#10;上传时间:{{createTime}}&#10;操作人:{{createName}}" rowid="{{id}}" filetype="{{type}}" createId="{{createId}}">
<div class="item-select">
<div class="item-check">
<input type="checkbox" id="check{{id}}" class="checkFile" name="checkFile"/>
......@@ -554,7 +548,7 @@
<!-- officeTemplate.tpl -->
<script type="text/x-handlebars-template" id="officeTemplate">
{{#bean}}
<div class="file office-box menu-folder" title="名称:{{name}}&#10;大小:{{fileSize}}&#10;上传时间:{{createTime}}&#10;操作人:{{createName}}" rowid="{{id}}" filetype="{{fileType}}" createId="{{createId}}">
<div class="file office-box menu-folder" title="名称:{{name}}&#10;大小:{{fileSize}}&#10;上传时间:{{createTime}}&#10;操作人:{{createName}}" rowid="{{id}}" filetype="{{type}}" createId="{{createId}}">
<div class="item-select">
<div class="item-check">
<input type="checkbox" id="check{{id}}" class="checkFile" name="checkFile"/>
......@@ -585,7 +579,7 @@
<!-- vedioTemplate.tpl -->
<script type="text/x-handlebars-template" id="vedioTemplate">
{{#bean}}
<div class="file vedio-box menu-folder" title="名称:{{name}}&#10;大小:{{fileSize}}&#10;上传时间:{{createTime}}&#10;操作人:{{createName}}" rowid="{{id}}" filetype="{{fileType}}" createId="{{createId}}">
<div class="file vedio-box menu-folder" title="名称:{{name}}&#10;大小:{{fileSize}}&#10;上传时间:{{createTime}}&#10;操作人:{{createName}}" rowid="{{id}}" filetype="{{type}}" createId="{{createId}}">
<div class="item-select">
<div class="item-check">
<input type="checkbox" id="check{{id}}" class="checkFile" name="checkFile"/>
......@@ -616,7 +610,7 @@
<!-- packageTemplate.tpl -->
<script type="text/x-handlebars-template" id="packageTemplate">
{{#bean}}
<div class="file package-box menu-folder" title="名称:{{name}}&#10;大小:{{fileSize}}&#10;上传时间:{{createTime}}&#10;操作人:{{createName}}" rowid="{{id}}" filetype="{{fileType}}" createId="{{createId}}">
<div class="file package-box menu-folder" title="名称:{{name}}&#10;大小:{{fileSize}}&#10;上传时间:{{createTime}}&#10;操作人:{{createName}}" rowid="{{id}}" filetype="{{type}}" createId="{{createId}}">
<div class="item-select">
<div class="item-check">
<input type="checkbox" id="check{{id}}" class="checkFile" name="checkFile"/>
......@@ -647,7 +641,7 @@
<!-- aceTemplate.tpl -->
<script type="text/x-handlebars-template" id="aceTemplate">
{{#bean}}
<div class="file ace-box menu-folder" title="名称:{{name}}&#10;大小:{{fileSize}}&#10;上传时间:{{createTime}}&#10;操作人:{{createName}}" rowid="{{id}}" filetype="{{fileType}}" createId="{{createId}}">
<div class="file ace-box menu-folder" title="名称:{{name}}&#10;大小:{{fileSize}}&#10;上传时间:{{createTime}}&#10;操作人:{{createName}}" rowid="{{id}}" filetype="{{type}}" createId="{{createId}}">
<div class="item-select">
<div class="item-check">
<input type="checkbox" id="check{{id}}" class="checkFile" name="checkFile"/>
......@@ -678,7 +672,7 @@
<!-- otherTemplate.tpl -->
<script type="text/x-handlebars-template" id="otherTemplate">
{{#bean}}
<div class="file other-box menu-folder" title="名称:{{name}}&#10;大小:{{fileSize}}&#10;上传时间:{{createTime}}&#10;操作人:{{createName}}" rowid="{{id}}" filetype="{{fileType}}" createId="{{createId}}">
<div class="file other-box menu-folder" title="名称:{{name}}&#10;大小:{{fileSize}}&#10;上传时间:{{createTime}}&#10;操作人:{{createName}}" rowid="{{id}}" filetype="{{type}}" createId="{{createId}}">
<div class="item-select">
<div class="item-check">
<input type="checkbox" id="check{{id}}" class="checkFile" name="checkFile"/>
......@@ -709,7 +703,7 @@
<!-- epubTemplate.tpl -->
<script type="text/x-handlebars-template" id="epubTemplate">
{{#bean}}
<div class="file epub-box menu-folder" title="名称:{{name}}&#10;大小:{{fileSize}}&#10;上传时间:{{createTime}}&#10;操作人:{{createName}}" rowid="{{id}}" filetype="{{fileType}}" createId="{{createId}}">
<div class="file epub-box menu-folder" title="名称:{{name}}&#10;大小:{{fileSize}}&#10;上传时间:{{createTime}}&#10;操作人:{{createName}}" rowid="{{id}}" filetype="{{type}}" createId="{{createId}}">
<div class="item-select">
<div class="item-check">
<input type="checkbox" id="check{{id}}" class="checkFile" name="checkFile"/>
......
......@@ -15,7 +15,7 @@
<div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar">
<a class="layui-btn layui-btn-normal layui-btn-xs copyUrl" data-clipboard-text="链接:{{d.reqBasePath}}{{d.shareUrl}}{{# if(d.shareTypeNum == 2){ }} 提取码:{{d.sharePassword}} {{# } }}">复制</a>
<a class="layui-btn layui-btn-normal layui-btn-xs copyUrl" data-clipboard-text="链接:{{homePagePath}}{{d.shareUrl}}{{# if(d.shareType == 2){ }} 提取码:{{d.sharePassword}} {{# } }}">复制</a>
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="cancleShare">取消分享</a>
</script>
</div>
......
......@@ -5722,7 +5722,7 @@ body .layer-ext-winconfirm .layui-layer-content {
}
.fileListForm .share-file-list .share-file-mation .share-time-validity .share-time{
width: 135px;
width: 165px;
height: 100%;
float: left;
text-align: left;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册