钉钉修改

master
tangyi 2021-12-08 18:12:10 +08:00
parent 5ba09c9c14
commit 3bc8a21c49
14 changed files with 1844 additions and 542 deletions

103
dist/css/style.css vendored
View File

@ -1842,7 +1842,7 @@ a.color-b:hover {
background-color: rgba(0, 0, 0, .4); background-color: rgba(0, 0, 0, .4);
} }
.list-img { .onClickList .list-img {
position: absolute; position: absolute;
right: 30px; right: 30px;
display: none; display: none;
@ -1850,6 +1850,8 @@ a.color-b:hover {
width: 25px; width: 25px;
} }
.file-tit-btn { .file-tit-btn {
width: 100px; width: 100px;
height: 30px; height: 30px;
@ -1999,6 +2001,105 @@ a.color-b:hover {
width: 100%; width: 100%;
} }
.nameMake {
width: 100%;
height: 100%;
display: flex;
align-items: center;
position: absolute;
left: 0px;
display: none;
top: 0px;
z-index: 3;
}
.nameMake-con {
width: 100%;
height: 100%;
margin: auto;
background-color: #fff;
}
.nameMake-con .tit-name {
font-size: 26px;
font-weight: bold;
padding-top: 20px;
text-align: center;
}
.nameMake-cona {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-top: 60px;
}
.nameMake-cona p {
display: flex;
margin-bottom: 30px;
align-items: center;
}
.nameMake-cona span {
display: inline-block;
font-size: 20px;
margin-right: 10px;
margin-left: 10px;
}
.nameMake-btn {
display: flex;
justify-content: center;
}
.nameMake-btn button {
width: 150px;
height: 40px;
color: #fff;
margin: 40px 20px;
background-color: #397cdd;
display: flex;
align-items: center;
font-size: 20px;
border: none;
justify-content: center;
}
.nameMake-cona input {
width: 300px;
height: 30px;
}
.mobileGroup {
position: absolute;
right: 160px;
top: 15px;
font-weight: 400;
font-size: 12px;
color: #fff;
text-decoration: none;
background: #3d59f8;
display: inline-block;
position: absolute;
padding: 0 20px;
height: 30px;
line-height: 30px;
text-align: center;
border: none;
border-radius: 5px;
}
.organization-con {
width: 100%;
left: 0px;
z-index: 10;
top: 0px;
height: 100%;
position: fixed;
background-color: rgba(0, 0, 0, 0.5);
}
.listBtn { .listBtn {
position: absolute; position: absolute;
right: 200px; right: 200px;

422
dist/hidefile.html vendored
View File

@ -292,7 +292,7 @@
</script> </script>
<!--内容--> <!--内容-->
<div class="f-r content content-pd-50"> <div class="f-r content content-pd-50">
<div class="content-auto" data-id="11" > <div class="content-auto" data-id="11">
<div class="con-tit font-20 pc-block"> <div class="con-tit font-20 pc-block">
隐藏文件 隐藏文件
</div> </div>
@ -343,8 +343,29 @@
</form> </form>
</div> </div>
<!--内容--> <!--内容-->
<div class="con-list bg-w top20 phone-bg-none phone-top-0"> <div class="con-list bg-w top20 phone-bg-none phone-top-0 pr">
<!--手机--> <!--手机-->
<div class="nameMake">
<div class="nameMake-con">
<p class="tit-name">修改文件夹名称</p>
<div class="nameMake-cona">
<p>
<span>文件1</span>
<input type="text">
</p>
</div>
<div class="nameMake-btn">
<button onclick="nameMakeConfirm()">确定修改</button><button>取消修改</button>
</div>
</div>
</div>
<div class="phone-tit phone-block"> <div class="phone-tit phone-block">
<div class="name" id="phone-menu"> <div class="name" id="phone-menu">
<!-- <a href="javascript:;" class="active">公共文件</a> <!-- <a href="javascript:;" class="active">公共文件</a>
@ -368,17 +389,24 @@
</div> </div>
<!--pc--> <!--pc-->
<div class="name"> <div class="name">
<span class="font-14" id="folder-navigation"><i class="icon-back"></i><a href="hidefile.html" <span class="font-14" id="folder-navigation"><i class="icon-back"></i><a href="hidefile.html" data-id="0">全部文件</a></span>
data-id="0">全部文件</a></span>
<input type="hidden" id="navigation" value=""> <input type="hidden" id="navigation" value="">
<ul class="con-list-mero pc-block" role="tablist"> <div>
<li role="presentation" class="active"> <div class="listBtn">
<a class="img-list" href="#Chart" aria-controls="Chart" role="tab" data-toggle="tab">&nbsp;</a> <button type="button" onclick="editorName()">修改名字</button>
</li> <button type="button" onclick="hgiddenFiles()">显示文件</button>
<li role="presentation"> <button type="button " onclick="editorButton(this)">编辑文件</button>
<a href="#tab" aria-controls="tab" role="tab" data-toggle="tab" class="tab-list">&nbsp;</a> </div>
</li> <ul class="con-list-mero pc-block" role="tablist">
</ul> <li role="presentation" class="active">
<a class="img-list" href="#Chart" aria-controls="Chart" role="tab" data-toggle="tab">&nbsp;</a>
</li>
<li role="presentation">
<a href="#tab" aria-controls="tab" role="tab" data-toggle="tab" class="tab-list">&nbsp;</a>
</li>
</ul>
</div>
</div> </div>
<div class="con-list-cn tab-content"> <div class="con-list-cn tab-content">
<div class="list-content active tab-pane" role="tabpanel" id="Chart"> <div class="list-content active tab-pane" role="tabpanel" id="Chart">
@ -421,7 +449,7 @@
<h3>文件名称</h3> <h3>文件名称</h3>
<p></p> <p></p>
<a href="#" class="btn1" id="preview-button" onclick="previewBtn(this)">预览</a> <a href="#" class="btn1" id="preview-button" onclick="previewBtn(this)">预览</a>
<a onclick="downloadfile(this)" id="download" class="btn2" download="">下载</a> <a onclick="downloadfile(this)" id="download" class="btn2" download="">下载</a>
</div> </div>
</div> </div>
</div> </div>
@ -464,31 +492,49 @@
startTime: '', startTime: '',
type: '' type: ''
} }
let dataEditor = {
editorIf: true,
editorData: [],
rows: []
}
function editorButton(obj) {
if (dataEditor.editorIf) {
$(obj).html("取消编辑")
} else {
$(obj).html("编辑文件")
$(".onClickListOne").attr("data-click", "1")
$(".onClickListOne").children(".list-img").css("display", "none")
$(".onClickListOne").css("background", "rgba(0,0,0,0)")
$(".onClickListTwo").parent().css("background", "rgba(0,0,0,0)")
$(".onClickListTwo").attr("data-click", "1")
$(".onClickListTwo").prev().css("display", "none")
}
dataEditor.editorIf = !dataEditor.editorIf
}
var serch_flag = false; var serch_flag = false;
$(function() { $(function () {
layui.use(['form', 'upload', 'element', 'layer'], function() { layui.use(['form', 'upload', 'element', 'layer'], function () {
var form = layui.form; var form = layui.form;
var upload = layui.upload; var upload = layui.upload;
var element = layui.element; var element = layui.element;
var layer = layui.layer; var layer = layui.layer;
//var haveLogin = localStorage['haveLogin'] || false; //var haveLogin = localStorage['haveLogin'] || false;
var loginInterval = setInterval(function() { var loginInterval = setInterval(function () {
var tmpHaveLogin = localStorage['haveLogin'] || false; var tmpHaveLogin = localStorage['haveLogin'] || false;
if (tmpHaveLogin) { if (tmpHaveLogin) {
clearInterval(loginInterval); clearInterval(loginInterval);
pageInit(); pageInit();
} }
}, 500); }, 500);
function pageInit() { function pageInit() {
getFileType(); getFileType();
getFileList(ajaxData); getFileList(ajaxData);
} }
$('#toggle-filter').on('click', function() { $('#toggle-filter').on('click', function () {
layer.open({ layer.open({
type: 1, type: 1,
title: ['文件过滤', 'font-size:18px;padding:0;text-align:center'], title: ['文件过滤', 'font-size:18px;padding:0;text-align:center'],
@ -497,8 +543,8 @@
area: ['100%', '100%'], area: ['100%', '100%'],
closeBtn: 1, closeBtn: 1,
skin: 'file-filter-layer', skin: 'file-filter-layer',
success: function(dom, index) { success: function (dom, index) {
dom.find('.layui-btn[lay-submit]').on('click', function() { dom.find('.layui-btn[lay-submit]').on('click', function () {
layer.close(index); layer.close(index);
}); });
} }
@ -506,7 +552,7 @@
}); });
//搜索 //搜索
form.on('submit(formDemo)', function(data) { form.on('submit(formDemo)', function (data) {
ajaxData = { ajaxData = {
createUser: data.field.createUser, createUser: data.field.createUser,
drafter: data.field.drafter, drafter: data.field.drafter,
@ -529,23 +575,23 @@
//文件类型 //文件类型
function getFileType() { function getFileType() {
$.ajax({ $.ajax({
url: host + '/ding/file/getFileType'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), url: host + '/ding/file/getFileType' + '?timetmp=' + Date.parse(new Date()).toString().substr(0, 10),
headers: { headers: {
'Blade-Auth': 'bearer ' + accessToken, 'Blade-Auth': 'bearer ' + accessToken,
}, },
data: {}, data: {},
type: "get", type: "get",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
if (data.data.length > 0) { if (data.data.length > 0) {
data.data.forEach(function(item) { data.data.forEach(function (item) {
$('.con-search select[name=type]').append( $('.con-search select[name=type]').append(
'<option value="' + item + '">' + item + '<option value="' + item + '">' + item +
'</option>') '</option>')
}) })
form.render() form.render()
} }
// else { // else {
// layer.msg('暂无记录') // layer.msg('暂无记录')
// } // }
@ -553,7 +599,7 @@
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
console.log(data); console.log(data);
} }
}); });
@ -563,11 +609,11 @@
}) })
function init() { function init() {
$('.con-list .name span .icon-back').off("click").click(function() { $('.con-list .name span .icon-back').off("click").click(function () {
var that = $(this); var that = $(this);
if (serch_flag) { if (serch_flag) {
$("#search-form")[0].reset(); $("#search-form")[0].reset();
layui.use(['form'], function() { layui.use(['form'], function () {
var form = layui.form; var form = layui.form;
form.render(); form.render();
}) })
@ -605,12 +651,12 @@
serch_flag = false; serch_flag = false;
}); });
//路由事件 //路由事件
$('#folder-navigation a').off("click").click(function() { $('#folder-navigation a').off("click").click(function () {
var that = $(this) var that = $(this)
console.log(that.attr('data-id'), 'parentFolderId'); console.log(that.attr('data-id'), 'parentFolderId');
ajaxData.parentFolderId = that.attr('data-id') ajaxData.parentFolderId = that.attr('data-id')
ajaxData.name = ''; ajaxData.name = '';
$('.con-list .name span a').each(function() { $('.con-list .name span a').each(function () {
if ($(this).index() >= that.index()) { if ($(this).index() >= that.index()) {
$('.con-list .name span a').eq($(this).index()).remove() $('.con-list .name span a').eq($(this).index()).remove()
} }
@ -624,7 +670,7 @@
//历史记录 //历史记录
function getHistory(obj) { function getHistory(obj) {
$.ajax({ $.ajax({
url: host + '/ding/file/getHistory'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), url: host + '/ding/file/getHistory' + '?timetmp=' + Date.parse(new Date()).toString().substr(0, 10),
headers: { headers: {
'Blade-Auth': 'bearer ' + accessToken, 'Blade-Auth': 'bearer ' + accessToken,
}, },
@ -633,18 +679,18 @@
}, },
type: "get", type: "get",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
if (data.data.length > 0) { if (data.data.length > 0) {
var html = ''; var html = '';
data.data.forEach(function(item) { data.data.forEach(function (item) {
html += '<tr>' + html += '<tr>' +
'<td><div class="list-img click-download" onclick="openFile(this)" data-id="' + '<td><div class="list-img click-download" onclick="openFile(this)" data-id="' +
item.id + '" data-name="' + item.name + '" data-type="' + item item.id + '" data-name="' + item.name + '" data-type="' + item
.type + '" data-url="' + item.url + '" data-time="' + item .type + '" data-url="' + item.url + '" data-time="' + item
.createTime + '" data-dingid="' + item.dingFileId + .createTime + '" data-dingid="' + item.dingFileId +
'" data-dingname="' + item.dingFileName + '" data-dingsize="' + item '" data-dingname="' + item.dingFileName + '" data-dingsize="' + item
.dingFileSize + '" data-spaceid="' + item.dingSpaceId + .dingFileSize + '" data-spaceid="' + item.dingSpaceId +
'"><img src="image/icon_22.png"><span>' + item.name + '"><img src="image/icon_22.png"><span>' + item.name +
'</span></div></td>' '</span></div></td>'
html += '<td>'; html += '<td>';
@ -659,7 +705,7 @@
}) })
$(".history .table tbody").html(html) $(".history .table tbody").html(html)
$(".history").show(); $(".history").show();
} }
// else { // else {
// layer.msg('暂无记录') // layer.msg('暂无记录')
// } // }
@ -667,7 +713,7 @@
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
console.log(data); console.log(data);
} }
}); });
@ -675,7 +721,57 @@
} }
//打开文件夹 //打开文件夹
function openIf(data) {
if (dataEditor.editorIf) {
if ($(data).attr("data-if") == 1) {
openFolder(data)
} else {
openFile(data)
}
} else {
if ($(data).attr("data-click") == "1") {
if ($(data).attr("data-if") == 1) {
$(data).children(".list-img").css("display", "block")
$(data).css("background", "#f5f6ff")
dataEditor.editorData.push({
id: $(data).attr("data-id"),
folder: true
})
} else {
$(data).prev().css("display", "block")
$(data).parent().css("background", "#f5f6ff")
dataEditor.editorData.push({
id: $(data).attr("data-id"),
folder: false
})
}
$(data).attr("data-click", "0")
} else {
if ($(data).attr("data-if") == 1) {
$(data).children(".list-img").css("display", "none")
$(data).css("background", "#fff")
let ina = screening(dataEditor.editorData, $(data).attr("data-id"))
dataEditor.editorData.splice(ina, 1)
} else {
$(data).prev().css("display", "none")
$(data).parent().css("background", "#fff")
let ina = screening(dataEditor.editorData, $(data).attr("data-id"))
dataEditor.editorData.splice(ina, 1)
}
$(data).attr("data-click", "1")
}
console.log(dataEditor.editorData);
}
}
function openFolder(obj) { function openFolder(obj) {
dataEditor.editorData = []
dataEditor.editorIf = true
ajaxData.parentFolderId = $(obj).attr('data-id') ajaxData.parentFolderId = $(obj).attr('data-id')
getFileList(ajaxData) getFileList(ajaxData)
$("#navigation").val($(obj).attr('data-id')); $("#navigation").val($(obj).attr('data-id'));
@ -687,7 +783,7 @@
function downloadfile(obj) { function downloadfile(obj) {
var id = $(obj).data('fileid'); var id = $(obj).data('fileid');
$.ajax({ $.ajax({
url: host + '/ding/file/downLoadFile'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), url: host + '/ding/file/downLoadFile' + '?timetmp=' + Date.parse(new Date()).toString().substr(0, 10),
headers: { headers: {
'Blade-Auth': 'bearer ' + localStorage.accessToken 'Blade-Auth': 'bearer ' + localStorage.accessToken
}, },
@ -697,17 +793,17 @@
type: "get", type: "get",
contentType: "application/json", contentType: "application/json",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
$(obj).attr('data', data.data); $(obj).attr('data', data.data);
console.log(data.data); console.log(data.data);
window.open(data.data); window.open(data.data);
} else { } else {
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
console.log(data); console.log(data);
} }
}); });
@ -766,52 +862,167 @@
// } // }
// }); // });
} }
//隐藏文件 //隐藏文件
function hideFile(obj){ function hgiddenFiles(obj) {
layer.confirm('确认显示这个文件吗?', { var arr2 = dataEditor.editorData.some(function (v) {
btn: ['确认', '取消'] //可以无限个按钮 return v.folder == true;
, });
}, function(index, layero){ console.log(arr2);
//按钮【按钮一】的回调 if (arr2) {
$.ajax({ layer.msg("不能显示文件夹")
url: host + '/ding/file/disPlayFile'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), return
headers: {
'Blade-Auth': 'bearer ' + localStorage.accessToken }
}, layer.confirm('确认显示这些文件吗?', {
data: { btn: ['确认', '取消'] //可以无限个按钮
fileId:$(obj).attr("data-id"), ,
isShow:1 }, function (index, layero) {
},
type: "get", let objD = {
contentType: "application/x-www-form-urlencoded", fileIds: [],
dataType: "json", isShow: 1
success: function(data) { }
if(data.code==200){
layer.msg('显示成功') for (let index = 0; index < dataEditor.editorData.length; index++) {
getFileList(ajaxData) objD.fileIds.push(dataEditor.editorData[index].id)
}else{ }
layer.msg(data.msg) let contentType = "application/json"
} let url = host + '/ding/file/disPlayFiles'
dxtcRequest('post', url, JSON.stringify(objD), function name(data) {
}, if (data.code == 200) {
error: function(data) { console.log(data);
console.log(data); layer.msg('显示成功')
} getFileList(ajaxData)
}) } else {
}, function(index){ layer.msg(data.msg)
//按钮【按钮二】的回调 }
layer.closeAll(); }, contentType)
layer.closeAll();
}, function (index) {
//按钮【按钮二】的回调
layer.closeAll();
}); });
return false; return false;
} }
function hideFile(obj) {
layer.confirm('确认隐藏这个文件吗?', {
btn: ['确认', '取消'] //可以无限个按钮
,
}, function (index, layero) {
//按钮【按钮一】的回调
$.ajax({
url: host + '/ding/file/disPlayFile' + '?timetmp=' + Date.parse(new Date()).toString()
.substr(0, 10),
headers: {
'Blade-Auth': 'bearer ' + localStorage.accessToken
},
data: {
fileId: $(obj).attr("data-id"),
isShow: 0
},
type: "get",
contentType: "application/x-www-form-urlencoded",
dataType: "json",
success: function (data) {
if (data.code == 200) {
layer.msg('隐藏成功')
getFileList(ajaxData)
} else {
layer.msg(data.msg)
}
},
error: function (data) {
console.log(data);
layer.msg(data.responseJSON.msg)
}
})
}, function (index) {
//按钮【按钮二】的回调
layer.closeAll();
});
return false;
}
//修改文件名
function editorName() {
console.log(dataEditor.rows, "--------------");
console.log(dataEditor.editorData, "--------------");
var arr2 = dataEditor.editorData.some(function (v) {
return v.folder == true;
});
if (arr2) {
layer.msg("不能重命名文件夹")
return
}
let editorNameData = []
for (let index = 0; index < dataEditor.editorData.length; index++) {
for (let k = 0; k < dataEditor.rows.files.length; k++) {
if (dataEditor.editorData[index].id == dataEditor.rows.files[k].id) {
editorNameData.push(dataEditor.rows.files[k])
}
}
}
$(".nameMake").css("display", "flex")
let str = editorNameData.map((v, i) => ` <p>
<span>文件${i + 1}</span>
<input value='${v.name}' data-id="${v.id}" type="text">
</p>`).join("")
$(".nameMake-cona").html(str)
}
function modifyName(data) {
let contentType = "application/json"
let url = host + '/ding/file/updateFile'
dxtcRequest('post', url, JSON.stringify(data), function name(data) {
if (data.code == 200) {
console.log(data);
} else {
layer.msg(data.msg)
}
}, contentType)
}
function nameMakeConfirm(params) {
layer.confirm('确认修改这些文件名嘛?', {
btn: ['确认', '取消'] //可以无限个按钮
,
}, function (index, layero) {
let arr = []
for (let index = 0; index < $(".nameMake-cona input").length; index++) {
arr.push({
name: $($(".nameMake-cona input")[index]).val(),
id: $($(".nameMake-cona input")[index]).attr("data-id")
})
}
for (let index = 0; index < arr.length; index++) {
modifyName(arr[index])
}
getFileList(ajaxData)
$(".nameMake").css("display", "none")
layer.closeAll();
}, function (index) {
layer.closeAll();
});
}
//影藏文件列表 //影藏文件列表
function getFileList(ajaxData) { function getFileList(ajaxData) {
console.log(ajaxData, 'getFileList'); console.log(ajaxData, 'getFileList');
$('.list-content#Chart ul').empty() $('.list-content#Chart ul').empty()
$('.list-content#tab tbody').empty() $('.list-content#tab tbody').empty()
$.ajax({ $.ajax({
url: host + '/ding/file/getDisplayFile'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), url: host + '/ding/file/getDisplayFile' + '?timetmp=' + Date.parse(new Date()).toString().substr(0, 10),
headers: { headers: {
'Blade-Auth': 'bearer ' + localStorage.accessToken 'Blade-Auth': 'bearer ' + localStorage.accessToken
}, },
@ -819,21 +1030,22 @@
type: "get", type: "get",
contentType: "application/x-www-form-urlencoded", contentType: "application/x-www-form-urlencoded",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
dataEditor.rows = data.data
if (data.code == 200) { if (data.code == 200) {
init() init()
if (data.data.folders.length > 0) { if (data.data.folders.length > 0) {
data.data.folders.forEach(function(item) { data.data.folders.forEach(function (item) {
var html1 = var html1 =
'<li class="list" onclick="openFolder(this)" ondblclick="openFolder(this)" data-id="' + '<li class="list onClickListOne onClickList" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this)" data-id="' + item.id + '">' +
item.id + '">' + '<img class="list-img" src="./image/icon_30.png">' +
'<div class="img"><img src="image/'+(item.folderType=="0"?"icon_11.png":"icon_11_2.png")+'"></div>' + '<div class="img"><img src="image/' + (item.folderType == "0" ? "icon_11.png" : "icon_11_2.png") + '"></div>' +
'<div class="text-two-hide list-hight">' + item.name + '</div>' + '<div class="text-two-hide list-hight">' + item.name + '</div>' +
'</li>' '</li>'
$('.list-content#Chart ul').append(html1) $('.list-content#Chart ul').append(html1)
var html2 = '<tr>' + var html2 = '<tr>' +
'<td><div class="list-img" onclick="openFolder(this)" ondblclick ="openFolder(this)" data-id="' + '<td><div class="list-img" data-if="1" data-click="1" onclick="openIf(this)" ondblclick ="openIf(this)" data-id="' +
item.id + '"><img src="image/'+(item.folderType=="0"?"icon_11.png":"icon_11_2.png")+'"><span>' + item.name + item.id + '"><img src="image/' + (item.folderType == "0" ? "icon_11.png" : "icon_11_2.png") + '"><span>' + item.name +
'</span></div></td>' + '</span></div></td>' +
'<td></td>' + '<td></td>' +
'<td></td>' + '<td></td>' +
@ -848,30 +1060,28 @@
}) })
} }
if (data.data.files.length > 0) { if (data.data.files.length > 0) {
data.data.files.forEach(function(item) { data.data.files.forEach(function (item) {
var html1 = var html1 =
'<li class="list click-download" >' '<li class="list click-download ps onClickList" >'
+ (item.isPublic == "0" ?
"<span class='internal'></span>" : "") +
+ '<div class="more">'
+ '<span>...</span>' '<img class="list-img" src="./image/icon_30.png">' +
+ '<div class="more-edit" onclick="hideFile(this)" data-id="' + item.id + '" data-name="' + item.name + '">显示</div>' '<div class="img onClickListTwo" data-if="2" data-click="1" onclick="openIf(this)" data-id="' +
+ '</div>'+
'<div class="img" onclick="openFile(this)" data-id="' +
item.id + '" data-name="' + item.name + '" data-type="' + item item.id + '" data-name="' + item.name + '" data-type="' + item
.type + '" data-url="' + item.url + '" data-time="' + item .type + '" data-url="' + item.url + '" data-time="' + item
.createTime + '" data-dingid="' + item.dingFileId + .createTime + '" data-dingid="' + item.dingFileId +
'" data-dingname="' + item.dingFileName + '" data-dingsize="' + item '" data-dingname="' + item.dingFileName + '" data-dingsize="' + item
.dingFileSize + '" data-spaceid="' + item.dingSpaceId + '"><img src="image/icon-file/icon_' + item.type + .dingFileSize + '" data-spaceid="' + item.dingSpaceId +
'"><img src="image/icon-file/icon_' + item.type +
'.png"></div>' + '.png"></div>' +
'<div class="text-two-hide list-hight">' + item.name + '</div>' + '<div class="text-two-hide list-hight">' + item.name + '</div>' +
'</li>' '</li>'
$('.list-content#Chart ul').append(html1) $('.list-content#Chart ul').append(html1)
var html2 = '<tr>' + var html2 = '<tr>' +
'<td>' '<td>'
+ '<div class="more">' + '<div class="more">'
+ '<span>...</span>' + '<span>...</span>'
+ '<div class="more-edit" onclick="hideFile(this)" data-id="' + item.id + '" data-name="' + item.name + '">显示</div>' + '<div class="more-edit" onclick="hideFile(this)" data-id="' + item.id + '" data-name="' + item.name + '">显示</div>'
@ -879,8 +1089,8 @@
+ +
'<div class="list-img" onclick="openFile(this)" data-id="' + '<div class="list-img" onclick="openFile(this)" data-id="' +
item.id + '" data-name="' + item.name + '" data-type="' + item item.id + '" data-name="' + item.name + '" data-type="' + item
.type + '" data-url="' + item.url + '" data-time="' + item .type + '" data-url="' + item.url + '" data-time="' + item
.createTime + '" ><img src="image/icon-file/icon_' + item.type + .createTime + '" ><img src="image/icon-file/icon_' + item.type +
'.png"><span>' + item.name + '</span></div></td>' + '.png"><span>' + item.name + '</span></div></td>' +
'<td>' + item.number + '</td>' + '<td>' + item.number + '</td>' +
'<td><div class="list-img"><span>' + item.drafter + '<td><div class="list-img"><span>' + item.drafter +
@ -908,7 +1118,7 @@
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
console.log(data); console.log(data);
} }
}); });
@ -964,4 +1174,4 @@
$('#2').click(function(){ $('#2').click(function(){
localStorage.setItem('pubilc','功能区') localStorage.setItem('pubilc','功能区')
}) })
</script> </script>

119
dist/index.html vendored
View File

@ -343,8 +343,30 @@
</form> </form>
</div> </div>
<!--内容--> <!--内容-->
<div class="con-list bg-w top20 phone-bg-none phone-top-0"> <div class="con-list bg-w top20 phone-bg-none phone-top-0 pr">
<!--手机--> <!--手机-->
<div class="nameMake">
<div class="nameMake-con">
<p class="tit-name">修改文件夹名称</p>
<div class="nameMake-cona">
<p>
<span>文件1</span>
<input type="text">
</p>
</div>
<div class="nameMake-btn">
<button onclick="nameMakeConfirm()">确定修改</button><button>取消修改</button>
</div>
</div>
</div>
<div class="phone-tit phone-block"> <div class="phone-tit phone-block">
<div class="name" id="phone-menu"> <div class="name" id="phone-menu">
<!-- <a href="javascript:;" class="active">公共文件</a> <!-- <a href="javascript:;" class="active">公共文件</a>
@ -378,7 +400,7 @@
<input type="hidden" id="navigation" value=""> <input type="hidden" id="navigation" value="">
<div> <div>
<div class="listBtn"> <div class="listBtn">
<button type="button"></button> <button type="button" onclick="editorName()">修改名字</button>
<button type="button" onclick="hgiddenFiles()">隐藏文件</button> <button type="button" onclick="hgiddenFiles()">隐藏文件</button>
<button type="button " onclick="editorButton(this)">编辑文件</button> <button type="button " onclick="editorButton(this)">编辑文件</button>
</div> </div>
@ -478,6 +500,7 @@
let dataEditor = { let dataEditor = {
editorIf: true, editorIf: true,
editorData: [], editorData: [],
rows: []
} }
function editorButton(obj) { function editorButton(obj) {
if (dataEditor.editorIf) { if (dataEditor.editorIf) {
@ -708,7 +731,13 @@
function openIf(data) { function openIf(data) {
if (dataEditor.editorIf) { if (dataEditor.editorIf) {
openFolder(data)
if ($(data).attr("data-if") == 1) {
openFolder(data)
} else {
openFile(data)
}
} else { } else {
if ($(data).attr("data-click") == "1") { if ($(data).attr("data-click") == "1") {
if ($(data).attr("data-if") == 1) { if ($(data).attr("data-if") == 1) {
@ -752,6 +781,7 @@
function openFolder(obj) { function openFolder(obj) {
dataEditor.editorData = [] dataEditor.editorData = []
dataEditor.editorIf = true dataEditor.editorIf = true
ajaxData.parentFolderId = $(obj).attr('data-id') ajaxData.parentFolderId = $(obj).attr('data-id')
getFileList(ajaxData) getFileList(ajaxData)
$("#navigation").val($(obj).attr('data-id')); $("#navigation").val($(obj).attr('data-id'));
@ -846,13 +876,84 @@
// }); // });
} }
// 文件夹重命名
function editorName() {
console.log(dataEditor.rows);
console.log(dataEditor.editorData);
var arr2 = dataEditor.editorData.some(function (v) {
return v.folder == true;
});
if (arr2) {
layer.msg("不能重命名文件夹")
return
}
let editorNameData = []
for (let index = 0; index < dataEditor.editorData.length; index++) {
for (let k = 0; k < dataEditor.rows.files.length; k++) {
if (dataEditor.editorData[index].id == dataEditor.rows.files[k].id) {
editorNameData.push(dataEditor.rows.files[k])
}
}
}
$(".nameMake").css("display", "flex")
let str = editorNameData.map((v, i) => ` <p>
<span>文件${i + 1}</span>
<input value='${v.name}' data-id="${v.id}" type="text">
</p>`).join("")
$(".nameMake-cona").html(str)
}
function modifyName(data) {
let contentType = "application/json"
let url = host + '/ding/file/updateFile'
dxtcRequest('post', url, JSON.stringify(data), function name(data) {
if (data.code == 200) {
console.log(data);
} else {
layer.msg(data.msg)
}
}, contentType)
}
function nameMakeConfirm(params) {
layer.confirm('确认隐藏这个文件吗?', {
btn: ['确认', '取消'] //可以无限个按钮
,
}, function (index, layero) {
let arr = []
for (let index = 0; index < $(".nameMake-cona input").length; index++) {
arr.push({
name: $($(".nameMake-cona input")[index]).val(),
id: $($(".nameMake-cona input")[index]).attr("data-id")
})
}
for (let index = 0; index < arr.length; index++) {
modifyName(arr[index])
}
getFileList(ajaxData)
$(".nameMake").css("display", "none")
layer.closeAll();
}, function (index) {
layer.closeAll();
});
}
//隐藏文件 //隐藏文件
function hgiddenFiles(obj) { function hgiddenFiles(obj) {
var arr2 = dataEditor.editorData.some(function (v) { var arr2 = dataEditor.editorData.some(function (v) {
return v.folder == true; return v.folder == true;
}); });
if (arr2) { if (arr2) {
layer.msg("不能隐藏文件夹") layer.msg("不能隐藏文件夹")
return
} }
layer.confirm('确认隐藏这个文件吗?', { layer.confirm('确认隐藏这个文件吗?', {
btn: ['确认', '取消'] //可以无限个按钮 btn: ['确认', '取消'] //可以无限个按钮
@ -948,12 +1049,13 @@
contentType: "application/x-www-form-urlencoded", contentType: "application/x-www-form-urlencoded",
dataType: "json", dataType: "json",
success: function (data) { success: function (data) {
dataEditor.rows = data.data
if (data.code == 200) { if (data.code == 200) {
init() init()
if (data.data.folders.length > 0) { if (data.data.folders.length > 0) {
data.data.folders.forEach(function (item) { data.data.folders.forEach(function (item) {
var html1 = var html1 =
'<li class="list onClickListOne" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this)" data-id="' + '<li class="list onClickListOne onClickList" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this)" data-id="' +
item.id + '">' + item.id + '">' +
'<img class="list-img" src="./image/icon_30.png">' + '<img class="list-img" src="./image/icon_30.png">' +
'<div class="img"> <img src="image/' + (item.folderType == "0" ? '<div class="img"> <img src="image/' + (item.folderType == "0" ?
@ -962,7 +1064,7 @@
'</li>' '</li>'
$('.list-content#Chart ul').append(html1) $('.list-content#Chart ul').append(html1)
var html2 = '<tr>' + var html2 = '<tr>' +
'<td><div class="list-img" onclick="openIf(this)" ondblclick ="openIf(this)" data-id="' + '<td><div class="list-img" data-if="1" data-click="1" onclick="openIf(this)" ondblclick ="openIf(this)" data-id="' +
item.id + '"><img src="image/' + (item.folderType == "0" ? item.id + '"><img src="image/' + (item.folderType == "0" ?
"icon_11.png" : "icon_11_2.png") + '"><span>' + item.name + "icon_11.png" : "icon_11_2.png") + '"><span>' + item.name +
'</span></div></td>' + '</span></div></td>' +
@ -979,17 +1081,12 @@
}) })
$(".onClickList").on("click", () => {
})
$(".onClickList").on("ondblclick", () => {
})
} }
if (data.data.files.length > 0) { if (data.data.files.length > 0) {
data.data.files.forEach(function (item) { data.data.files.forEach(function (item) {
var html1 = var html1 =
'<li class="list click-download ps" >' '<li class="list click-download ps onClickList" >'
+ (item.isPublic == "0" ? + (item.isPublic == "0" ?
"<span class='internal'></span>" : "") + "<span class='internal'></span>" : "") +

139
dist/inside.html vendored
View File

@ -344,8 +344,23 @@
</form> </form>
</div> </div>
<!--内容--> <!--内容-->
<div class="con-list bg-w top20 phone-bg-none phone-top-0"> <div class="con-list bg-w top20 phone-bg-none phone-top-0 pr">
<!--手机--> <!--手机-->
<div class="nameMake">
<div class="nameMake-con">
<p class="tit-name">修改文件夹名称</p>
<div class="nameMake-cona">
<p>
<span>文件1</span>
<input type="text">
</p>
</div>
<div class="nameMake-btn">
<button onclick="nameMakeConfirm()">确定修改</button><button>取消修改</button>
</div>
</div>
</div>
<div class="phone-tit phone-block"> <div class="phone-tit phone-block">
<div class="name" id="phone-menu"> <div class="name" id="phone-menu">
<!-- <a href=" index.html">公共文件</a> <!-- <a href=" index.html">公共文件</a>
@ -373,7 +388,7 @@
<input type="hidden" id="navigation" value=""> <input type="hidden" id="navigation" value="">
<div> <div>
<div class="listBtn"> <div class="listBtn">
<button type="button"></button> <button type="button" onclick="editorName()">修改名字</button>
<button type="button" onclick="hgiddenFiles()">隐藏文件</button> <button type="button" onclick="hgiddenFiles()">隐藏文件</button>
<button type="button " onclick="editorButton(this)">编辑文件</button> <button type="button " onclick="editorButton(this)">编辑文件</button>
</div> </div>
@ -474,6 +489,7 @@
let dataEditor = { let dataEditor = {
editorIf: true, editorIf: true,
editorData: [], editorData: [],
rows: []
} }
function editorButton(obj) { function editorButton(obj) {
if (dataEditor.editorIf) { if (dataEditor.editorIf) {
@ -707,6 +723,9 @@
//打开文件夹 //打开文件夹
function openFolder(obj) { function openFolder(obj) {
dataEditor.editorData = []
dataEditor.editorIf = true
console.log(obj);
ajaxData.parentFolderId = $(obj).attr('data-id') ajaxData.parentFolderId = $(obj).attr('data-id')
getFileList(ajaxData) getFileList(ajaxData)
$("#navigation").val($(obj).attr('data-id')) $("#navigation").val($(obj).attr('data-id'))
@ -744,9 +763,15 @@
} }
function openIf(data) { function openIf(data) {
console.log(data);
if (dataEditor.editorIf) { if (dataEditor.editorIf) {
openFolder(data) if ($(data).attr("data-if") == 1) {
openFolder(data)
} else {
openFile(data)
}
} else { } else {
if ($(data).attr("data-click") == "1") { if ($(data).attr("data-click") == "1") {
if ($(data).attr("data-if") == 1) { if ($(data).attr("data-if") == 1) {
@ -787,15 +812,75 @@
} }
} }
function openFolder(obj) { // 文件夹重命名
dataEditor.editorData = [] function editorName() {
dataEditor.editorIf = true console.log(dataEditor.rows, "--------------");
ajaxData.parentFolderId = $(obj).attr('data-id') console.log(dataEditor.editorData, "--------------");
getFileList(ajaxData) var arr2 = dataEditor.editorData.some(function (v) {
$("#navigation").val($(obj).attr('data-id')); return v.folder == true;
$('#folder-navigation').append('<a data-id="' + $(obj).attr('data-id') + '"> > ' + $(obj).text() + '</a>'); });
serch_flag = false; if (arr2) {
layer.msg("不能重命名文件夹")
return
}
let editorNameData = []
for (let index = 0; index < dataEditor.editorData.length; index++) {
for (let k = 0; k < dataEditor.rows.files.length; k++) {
if (dataEditor.editorData[index].id == dataEditor.rows.files[k].id) {
editorNameData.push(dataEditor.rows.files[k])
}
}
}
$(".nameMake").css("display", "flex")
let str = editorNameData.map((v, i) => ` <p>
<span>文件${i + 1}</span>
<input value='${v.name}' data-id="${v.id}" type="text">
</p>`).join("")
$(".nameMake-cona").html(str)
} }
function modifyName(data) {
let contentType = "application/json"
let url = host + '/ding/file/updateFile'
dxtcRequest('post', url, JSON.stringify(data), function name(data) {
if (data.code == 200) {
console.log(data);
} else {
layer.msg(data.msg)
}
}, contentType)
}
function nameMakeConfirm(params) {
layer.confirm('确认隐藏这个文件吗?', {
btn: ['确认', '取消'] //可以无限个按钮
,
}, function (index, layero) {
let arr = []
for (let index = 0; index < $(".nameMake-cona input").length; index++) {
arr.push({
name: $($(".nameMake-cona input")[index]).val(),
id: $($(".nameMake-cona input")[index]).attr("data-id")
})
}
for (let index = 0; index < arr.length; index++) {
modifyName(arr[index])
}
getFileList(ajaxData)
$(".nameMake").css("display", "none")
layer.closeAll();
}, function (index) {
layer.closeAll();
});
}
//文件下载 //文件下载
function downloadfile(obj) { function downloadfile(obj) {
var id = $(obj).data('fileid'); var id = $(obj).data('fileid');
@ -872,6 +957,7 @@
}); });
if (arr2) { if (arr2) {
layer.msg("不能隐藏文件夹") layer.msg("不能隐藏文件夹")
return
} }
layer.confirm('确认隐藏这个文件吗?', { layer.confirm('确认隐藏这个文件吗?', {
btn: ['确认', '取消'] //可以无限个按钮 btn: ['确认', '取消'] //可以无限个按钮
@ -880,7 +966,7 @@
let objD = { let objD = {
fileIds: [], fileIds: [],
isShow: 0 isShow: 1
} }
for (let index = 0; index < dataEditor.editorData.length; index++) { for (let index = 0; index < dataEditor.editorData.length; index++) {
@ -926,20 +1012,22 @@
contentType: "application/x-www-form-urlencoded", contentType: "application/x-www-form-urlencoded",
dataType: "json", dataType: "json",
success: function (data) { success: function (data) {
dataEditor.rows = data.data
if (data.code == 200) { if (data.code == 200) {
init() init()
if (data.data.folders.length > 0) { if (data.data.folders.length > 0) {
data.data.folders.forEach(function (item) { data.data.folders.forEach(function (item) {
console.log("======" + item.id + '=====');
var html1 = var html1 =
'<li class="list" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this) data-id="' + '<li class="list onClickListOne onClickList" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this)" data-id="' + item.id + '">' +
item.id + '">' + '<img class="list-img" src="./image/icon_30.png">' +
'<div class="img"><img src="image/' + (item.folderType == "0" ? "icon_11.png" : "icon_11_2.png") + '"></div>' + '<div class="img"><img src="image/' + (item.folderType == "0" ? "icon_11.png" : "icon_11_2.png") + '"></div>' +
'<div class="text-two-hide list-hight">' + item.name + '</div>' + '<div class="text-two-hide list-hight">' + item.name + '</div>' +
'</li>' '</li>'
$('.list-content#Chart ul').append(html1) $('.list-content#Chart ul').append(html1)
var html2 = '<tr>' + var html2 = '<tr>' +
'<td><div class="list-img" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this) data-id="' + '<td><div class="list-img" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this)" data-id="' + item.id + '"><img src="image/' + (item.folderType == "0" ? "icon_11.png" : "icon_11_2.png") + '"><span>' + item.name +
item.id + '"><img src="image/' + (item.folderType == "0" ? "icon_11.png" : "icon_11_2.png") + '"><span>' + item.name +
'</span></div></td>' + '</span></div></td>' +
'<td></td>' + '<td></td>' +
'<td></td>' + '<td></td>' +
@ -956,19 +1044,16 @@
if (data.data.files.length > 0) { if (data.data.files.length > 0) {
data.data.files.forEach(function (item) { data.data.files.forEach(function (item) {
var html1 = var html1 =
'<li class="list click-download" >' '<li class="list click-download ps onClickList" >'
+
+ '<div class="more">' '<img class="list-img" src="./image/icon_30.png">' +
+ '<span>...</span>' '<div class="img onClickListTwo" data-if="2" data-click="1" onclick="openIf(this)" data-id="' + item.id +
+ '<div class="more-edit" onclick="hideFile(this)" data-id="' + item.id + '" data-name="' + item.name + '">隐藏</div>' '" data-name="' + item.name + '" data-type="' + item
+ '</div>' +
'<div class="img" onclick="openFile(this)" data-id="' +
item.id + '" data-name="' + item.name + '" data-type="' + item
.type + '" data-url="' + item.url + '" data-time="' + item .type + '" data-url="' + item.url + '" data-time="' + item
.createTime + '" data-dingid="' + item.dingFileId + .createTime + '" data-dingid="' + item.dingFileId +
'" data-dingname="' + item.dingFileName + '" data-dingsize="' + item '" data-dingname="' + item.dingFileName + '" data-dingsize="' + item
.dingFileSize + '" data-spaceid="' + item.dingSpaceId + '" ><img src="image/icon-file/icon_' + item.type + .dingFileSize + '" data-spaceid="' + item.dingSpaceId +
'"><img src="image/icon-file/icon_' + item.type +
'.png"></div>' + '.png"></div>' +
'<div class="text-two-hide list-hight">' + item.name + '</div>' + '<div class="text-two-hide list-hight">' + item.name + '</div>' +
'</li>' '</li>'
@ -980,8 +1065,6 @@
+ '<span onclick="showBtn(this)" >...</span>' + '<span onclick="showBtn(this)" >...</span>'
+ '<div class="more-edit" onclick="hideFile(this)" data-id="' + item.id + '" data-name="' + item.name + '">隐藏</div>' + '<div class="more-edit" onclick="hideFile(this)" data-id="' + item.id + '" data-name="' + item.name + '">隐藏</div>'
+ '</div>' + '</div>'
+ '<div class="list-img" onclick="openFile(this)" data-id="' + + '<div class="list-img" onclick="openFile(this)" data-id="' +
item.id + '" data-name="' + item.name + '" data-type="' + item item.id + '" data-name="' + item.name + '" data-type="' + item
.type + '" data-url="' + item.url + '" data-time="' + item .type + '" data-url="' + item.url + '" data-time="' + item

3
dist/js/script.js vendored
View File

@ -82,6 +82,7 @@ $(document).contextmenu(function (e) {
}) })
//判断是否在钉钉内 //判断是否在钉钉内
console.log(dd);
if (dd.env.platform !== "notInDingTalk") { if (dd.env.platform !== "notInDingTalk") {
console.log('进入钉钉了'); console.log('进入钉钉了');
// var host = 'http://192.168.0.184:12306' // var host = 'http://192.168.0.184:12306'
@ -438,7 +439,7 @@ function dxtcRequest(type, url, data, successFunction, contentType = 'applicatio
function screening(arr, num) { function screening(arr, num) {
console.log(arr); console.log(arr);
for (let index = 0; index < arr.length; index++) { for (let index = 0; index < arr.length; index++) {
if (arr[index].id == num) { if (arr[index].id == num) {
return index return index
} }

285
dist/organization.html vendored
View File

@ -302,9 +302,9 @@
<div class="form-control__input"> <div class="form-control__input">
<div class="js_party_select_result"> <div class="js_party_select_result">
<div class="js_party_select_result_list"></div> <div class="js_party_select_result_list"></div>
<button class="mobileGroup" onclick="mobileGroup(this)">移动组织</button>
<a id="addDept" class="js_show_party_selector add" href="javascript:;">+添加组织</a> <a id="addDept" class="js_show_party_selector add" href="javascript:;">+添加组织</a>
<input id="deptInput" class="form-input" type="hidden" name="policy_dept_ids" value="" <input id="deptInput" class="form-input" type="hidden" name="policy_dept_ids" value="" style="display: none;">
style="display: none;">
</div> </div>
</div> </div>
</div> </div>
@ -319,8 +319,7 @@
</div> </div>
<div class="con-text bg-w hide-mobile"> <div class="con-text bg-w hide-mobile">
<div class="name add-border"> <div class="name add-border">
<input type="text" name="" value="组织名称01" data-id="" id="folder-name" disabled="disabled" <input type="text" name="" value="组织名称01" data-id="" id="folder-name" disabled="disabled" class="name-input">
class="name-input">
<div class="name-btn name-btn-none"> <div class="name-btn name-btn-none">
<button class="btn-edit btn-edit-op"><img src="image/icon_32.png"></button> <button class="btn-edit btn-edit-op"><img src="image/icon_32.png"></button>
</div> </div>
@ -333,16 +332,13 @@
<div class="org-list"> <div class="org-list">
<ul class="org-ul " role="tablist"> <ul class="org-ul " role="tablist">
<li role="presentation" class="active"> <li role="presentation" class="active">
<a href="#Admin" aria-controls="Admin" role="tab" data-toggle="tab" data-role-id="3" <a href="#Admin" aria-controls="Admin" role="tab" data-toggle="tab" data-role-id="3" class="tab-menu-admin">管理员</a>
class="tab-menu-admin">管理员</a>
</li> </li>
<li role="presentation"> <li role="presentation">
<a href="#opera" aria-controls="opera" role="tab" data-toggle="tab" data-role-id="5" <a href="#opera" aria-controls="opera" role="tab" data-toggle="tab" data-role-id="5" class="tab-menu-opera">操作员</a>
class="tab-menu-opera">操作员</a>
</li> </li>
<li role="presentation"> <li role="presentation">
<a href="#look" aria-controls="look" role="tab" data-toggle="tab" data-role-id="6" <a href="#look" aria-controls="look" role="tab" data-toggle="tab" data-role-id="6" class="tab-menu-look">查看员</a>
class="tab-menu-look">查看员</a>
</li> </li>
</ul> </ul>
<div class="tab-content org-con top20"> <div class="tab-content org-con top20">
@ -352,8 +348,7 @@
<p>1. 可查看、添加和下载授权组织内部文件、公共文件; </p> <p>1. 可查看、添加和下载授权组织内部文件、公共文件; </p>
<p>2. 创建和修改授权组织 “操作员”</p> <p>2. 创建和修改授权组织 “操作员”</p>
<p>3. 创建授权组织内部文件分类</p> <p>3. 创建授权组织内部文件分类</p>
<a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="3" <a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="3" onclick="choosePeople(this, 'Admin')">
onclick="choosePeople(this, 'Admin')">
+添加人员 +添加人员
</a> </a>
</div> </div>
@ -365,8 +360,7 @@
<div class="org-remarks"> <div class="org-remarks">
<p>操作员权限</p> <p>操作员权限</p>
<p>1. 可查看、添加和下载授权组织内部文件、公共文件; </p> <p>1. 可查看、添加和下载授权组织内部文件、公共文件; </p>
<a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="5" <a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="5" onclick="choosePeople(this, 'opera')">
onclick="choosePeople(this, 'opera')">
+添加人员 +添加人员
</a> </a>
</div> </div>
@ -378,8 +372,7 @@
<div class="org-remarks"> <div class="org-remarks">
<p>查看员权限</p> <p>查看员权限</p>
<p>1. 可查看和下载授权组织内部文件、公共文件; </p> <p>1. 可查看和下载授权组织内部文件、公共文件; </p>
<a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="6" <a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="6" onclick="choosePeople(this, 'look')">
onclick="choosePeople(this, 'look')">
+添加人员 +添加人员
</a> </a>
</div> </div>
@ -392,8 +385,61 @@
</div> </div>
</div> </div>
</div> </div>
</div> <!-- <div class="organization-con">
<div class="organization-con-data">
</div>
</div> -->
</div>
<div class="history upload">
<div class="center-center download-hight">
<div class="history-content bg-w">
<div class="on-name">
<h3 class="font-14">选择文件路径</h3>
</div>
<a href="javascript:;" class="close">&nbsp;</a>
<form class="p-25 layui-form">
<!-- <div class="con-search upload-search add-border">
<div class="layui-form-item">
<label class="layui-form-label">主管部门:</label>
<div class="layui-input-block">
<select name="city">
<option value="">全部类型</option>
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">文件名称:</label>
<div class="layui-input-block">
<input type="text" class="layui-input" placeholder="文件名称 ">
</div>
</div>
</div> -->
<!--文件夹-->
<div class="con-list bg-w top20 add-border">
<div class="name">
<span class="font-14" id="folder-navigation"><i class="icon-back"></i><a data-id="0" data-name="全部文件">全部文件</a></span>
<input type="hidden" id="navigation" value="0">
</div>
<div class="con-list-cn">
<div class="list-content" id="Chart">
<ul></ul>
</div>
</div>
<!-- 无内容 -->
<div class="no-con-list" style="display: none;">
<img src="image/img_02.jpg">
</div>
</div>
<!--保存-->
<div class="upload-form t-r">
<button class="flie-btn" lay-submit lay-filter="formFile">保存</button>
<button type="reset" class="flie-btn flie-btn-primary">重置</button>
</div>
</form>
</div>
</div>
</div>
<script type="text/html" id="modal-tpl"> <script type="text/html" id="modal-tpl">
<div class="con-content"> <div class="con-content">
<div class="con-mune bg-w"> <div class="con-mune bg-w">
@ -415,6 +461,8 @@
{{# }); }} {{# }); }}
</ul> </ul>
</div> </div>
</div> </div>
</script> </script>
@ -434,20 +482,30 @@
<link rel="stylesheet" type="text/css" href="js/orgTree/orgTree.css" /> <link rel="stylesheet" type="text/css" href="js/orgTree/orgTree.css" />
<script src="js/orgTree/orgTree.js" type="text/javascript" charset="utf-8"></script> <script src="js/orgTree/orgTree.js" type="text/javascript" charset="utf-8"></script>
<script> <script>
var fileAjaxData = {
current: '',
isPublic: 1,
parentFolderId: 0,
size: '',
isUpload: 1
}
let dataOrganization = {
state: false
}
//修改名称 //修改名称
$(".btn-edit-op").click(function() { $(".btn-edit-op").click(function () {
$(".name-btn-active").show(); $(".name-btn-active").show();
$(".name-input").addClass("name-input-edit"); $(".name-input").addClass("name-input-edit");
$(".name-input").attr("disabled", false); $(".name-input").attr("disabled", false);
}); });
$(".btn-close,.btn-keep").click(function() { $(".btn-close,.btn-keep").click(function () {
$(".name-btn-active").hide(); $(".name-btn-active").hide();
$(".name-input").removeClass("name-input-edit"); $(".name-input").removeClass("name-input-edit");
$(".name-input").attr("disabled", "disabled"); $(".name-input").attr("disabled", "disabled");
}); });
let zuId = 0 let zuId = 0
let shangId = 0 let shangId = 0
$('body').on('click', '.tab-menu-admin, .tab-menu-opera, .tab-menu-look', function() { $('body').on('click', '.tab-menu-admin, .tab-menu-opera, .tab-menu-look', function () {
let that = $(this); let that = $(this);
// let folderId = $('.org-menu-list li a.active').data('folder-id'); // let folderId = $('.org-menu-list li a.active').data('folder-id');
// console.log('组织ID'+zuId) // console.log('组织ID'+zuId)
@ -456,31 +514,31 @@
getDeptUsers(type, zuId, roleId); getDeptUsers(type, zuId, roleId);
}) })
//添加组织 //添加组织
$("#addDept").click(function() { $("#addDept").click(function () {
if ($(".org-menu-list a.active").length == 0) { if ($(".org-menu-list a.active").length == 0) {
layer.confirm('确认添加组织?', { layer.confirm('确认添加组织?', {
btn: ['确认', '取消'] //可以无限个按钮 btn: ['确认', '取消'] //可以无限个按钮
}, function(index, layero) { }, function (index, layero) {
//按钮【按钮一】的回调 //按钮【按钮一】的回调
var parentId = shangId; var parentId = shangId;
// console.log('组织ID1'+parentId); // console.log('组织ID1'+parentId);
layer.closeAll(); layer.closeAll();
addDept(parentId) addDept(parentId)
}, function(index) { }, function (index) {
//按钮【按钮二】的回调 //按钮【按钮二】的回调
layer.closeAll(); layer.closeAll();
}); });
} else { } else {
// var parentId = $(".org-menu-list a.active").attr("data-id"); // var parentId = $(".org-menu-list a.active").attr("data-id");
console.log('组织ID2'+shangId); console.log('组织ID2' + shangId);
addDept(shangId) addDept(shangId)
} }
}); });
function addDept(parentId) { function addDept(parentId) {
// console.log(parentId); // console.log(parentId);
layer.prompt(function(value, index, elem) { layer.prompt(function (value, index, elem) {
layer.alert(value); //得到value layer.alert(value); //得到value
layer.close(index); layer.close(index);
var data = { var data = {
@ -497,16 +555,16 @@
type: "post", type: "post",
contentType: "application/json", contentType: "application/json",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
layer.msg("添加成功", function() { layer.msg("添加成功", function () {
location.reload(); location.reload();
}) })
} else { } else {
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
layer.msg(data.responseJSON.msg) layer.msg(data.responseJSON.msg)
} }
}); });
@ -518,9 +576,9 @@
$(".org-menu-list a.active").removeClass('active'); $(".org-menu-list a.active").removeClass('active');
clearId() clearId()
} }
function clearId(){//把上级组织ID设为0 function clearId() {//把上级组织ID设为0
shangId = 0 shangId = 0
console.log("shangId:"+shangId); console.log("shangId:" + shangId);
} }
@ -529,14 +587,14 @@
tckd = ['90%', '90%']; tckd = ['90%', '90%'];
} }
layui.use(['element', 'form', 'laydate', 'laypage', 'laytpl'], function() { layui.use(['element', 'form', 'laydate', 'laypage', 'laytpl'], function () {
var laypage = layui.laypage; var laypage = layui.laypage;
var element = layui.element; var element = layui.element;
var form = layui.form; var form = layui.form;
var laydate = layui.laydate; var laydate = layui.laydate;
// return false; // return false;
var organizationIntervalScript = setInterval(function() { var organizationIntervalScript = setInterval(function () {
var tmpHaveLogin = localStorage['haveLogin'] || false; var tmpHaveLogin = localStorage['haveLogin'] || false;
if (tmpHaveLogin) { if (tmpHaveLogin) {
clearInterval(organizationIntervalScript); clearInterval(organizationIntervalScript);
@ -555,7 +613,7 @@
data: {}, data: {},
type: "get", type: "get",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
if (data.data.length > 0) { if (data.data.length > 0) {
$('.deptBtn').orgTree({ $('.deptBtn').orgTree({
@ -569,7 +627,7 @@
defaultTitle: '请选择', defaultTitle: '请选择',
defaultButton: '+添加组织', defaultButton: '+添加组织',
jsonData: data.data, jsonData: data.data,
custom: function(event) { custom: function (event) {
// form属性为true才会生效 // form属性为true才会生效
var data = { var data = {
parentId: event[0].id, parentId: event[0].id,
@ -578,24 +636,24 @@
$.ajax({ $.ajax({
url: host + '/ding/dept/addDept' + url: host + '/ding/dept/addDept' +
'?timetmp=' + Date.parse(new Date()) '?timetmp=' + Date.parse(new Date())
.toString().substr(0, 10), .toString().substr(0, 10),
headers: { headers: {
'Blade-Auth': 'bearer ' + 'Blade-Auth': 'bearer ' +
localStorage localStorage
.accessToken .accessToken
}, },
data: JSON.stringify(data), data: JSON.stringify(data),
type: "post", type: "post",
contentType: "application/json", contentType: "application/json",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
getDeptList() getDeptList()
} else { } else {
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
layer.msg(data.responseJSON.msg) layer.msg(data.responseJSON.msg)
} }
}); });
@ -606,7 +664,7 @@
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
// console.log(data); // console.log(data);
} }
}); });
@ -620,15 +678,15 @@
let type = "get"; let type = "get";
let data = {}; let data = {};
let roleId = $('.org-list .org-ul li.active a').data('role-id'); let roleId = $('.org-list .org-ul li.active a').data('role-id');
dxtcRequest(type, url, data, function(data) { dxtcRequest(type, url, data, function (data) {
if (data.code == 200) { if (data.code == 200) {
let html = ''; let html = '';
let active = ''; let active = '';
$.each(data.data, function(index, value) { $.each(data.data, function (index, value) {
if (index === 0) { if (index === 0) {
active = 'active'; active = 'active';
$('#folder-name').val(value.deptName).attr('data-id', value.id); $('#folder-name').val(value.deptName).attr('data-id', value.id);
// console.log('初始组织名称:'+value.deptName); // console.log('初始组织名称:'+value.deptName);
chuFolderId = value.folderId chuFolderId = value.folderId
// console.log("chuFolderId:"+chuFolderId); // console.log("chuFolderId:"+chuFolderId);
if (!MobileLib.isMobile()) getDeptUsers('Admin', value.folderId, roleId); if (!MobileLib.isMobile()) getDeptUsers('Admin', value.folderId, roleId);
@ -647,7 +705,7 @@
function menu_list_html(data, index = 0) { function menu_list_html(data, index = 0) {
var html = ""; var html = "";
var null_str = "" var null_str = ""
$.each(data, function(index, value) { $.each(data, function (index, value) {
// html += '<li class="add-border" ><a href="javascript:;" data-id="' + value.id + // html += '<li class="add-border" ><a href="javascript:;" data-id="' + value.id +
// '" data-folder-id="' + value.folderId + '" data-role-id="' + roleId + // '" data-folder-id="' + value.folderId + '" data-role-id="' + roleId +
// '" data-folder-name="' + value.deptName + '" onclick="changeDept(this)">' + value.deptName + // '" data-folder-name="' + value.deptName + '" onclick="changeDept(this)">' + value.deptName +
@ -660,7 +718,7 @@
'" data-folder-name="' + value.deptName + '">设置人员</span>'; '" data-folder-name="' + value.deptName + '">设置人员</span>';
if (value.hasChildren) { if (value.hasChildren) {
html += '<span onclick="PutAway(this)" class=" PutAway float-right">展开</span>'; html += '<span onclick="PutAway(this)" class=" PutAway float-right">展开</span>';
html += "<ul class='org-menu-lis-children'>" + menu_list_html(value.children) + "</ul>"; html += "<ul class='org-menu-lis-children'>" + menu_list_html(value.children, { num: 0, id: value.id }) + "</ul>";
} }
html += "</li>"; html += "</li>";
}); });
@ -668,8 +726,44 @@
return html; return html;
} }
function init() {
//返回事件
$('.con-list .name span .icon-back').off("click").click(function () {
var that = $(this)
if ($("#navigation").val() != 0) {
fileAjaxData.parentFolderId = $('.con-list .name span a').eq(-2).attr('data-id')
$("#navigation").val($('.con-list .name span a').eq(-2).attr('data-id'))
$('.con-list .name span a').eq(-1).remove()
getFileList(fileAjaxData)
}
});
//路由事件
$('#folder-navigation a').off("click").click(function () {
var that = $(this)
fileAjaxData.parentFolderId = that.attr('data-id')
$('.con-list .name span a').each(function () {
if ($(this).index() >= that.index()) {
$('.con-list .name span a').eq($(this).index()).remove()
}
})
$("#navigation").val(that.attr('data-id'))
getFileList(fileAjaxData)
})
}
//选择组织,更改显示内容 //选择组织,更改显示内容
function mobileGroup(params) {
if (dataOrganization.state) {
$(params).html("取消")
} else {
$(params).html("移动组织")
}
dataOrganization.state = !dataOrganization.state
console.log(dataOrganization.state);
}
function changeDept(obj) { function changeDept(obj) {
var id = $(obj).data('id'); var id = $(obj).data('id');
zuId = $(obj).data('folder-id'); zuId = $(obj).data('folder-id');
var roleId = $(obj).data('role-id'); var roleId = $(obj).data('role-id');
@ -681,6 +775,12 @@
} }
// 选中组织 // 选中组织
function change(obj) { function change(obj) {
console.log(dataOrganization.state);
if (dataOrganization.state) {
$('.upload').show()
getFileList(fileAjaxData)
return
}
shangId = $(obj).data('id'); shangId = $(obj).data('id');
zuId = $(obj).data('folder-id'); zuId = $(obj).data('folder-id');
chuFolderId = zuId chuFolderId = zuId
@ -689,7 +789,7 @@
// console.log('顶级组织ID' + shangId); // console.log('顶级组织ID' + shangId);
// console.log('当前组织ID' + zuId); // console.log('当前组织ID' + zuId);
let roleId = $('.org-list .org-ul li.active a').data('role-id'); let roleId = $('.org-list .org-ul li.active a').data('role-id');
// console.log('roleId' + roleId); // console.log('roleId' + roleId);
getDeptUsers('Admin', zuId, roleId); getDeptUsers('Admin', zuId, roleId);
} }
//收起 //收起
@ -719,7 +819,7 @@
'roleId': roleId 'roleId': roleId
}; };
$('.org-remarks-add').attr('data-folder-id', folderId); $('.org-remarks-add').attr('data-folder-id', folderId);
dxtcRequest('get', url, data, function(data) { dxtcRequest('get', url, data, function (data) {
if (data.code == 200) { if (data.code == 200) {
if (MobileLib.isMobile()) { if (MobileLib.isMobile()) {
layer.closeAll(); layer.closeAll();
@ -733,16 +833,16 @@
type: type, type: type,
users: data.data.userList || [] users: data.data.userList || []
}), }),
success: function($p, idx1) { success: function ($p, idx1) {
$p.find('.name > span').on('click', function() { $p.find('.name > span').on('click', function () {
MobileLib.actionSheet({ MobileLib.actionSheet({
body: layui.laytpl(modalSelectorTpl).render({ body: layui.laytpl(modalSelectorTpl).render({
roleId: roleId roleId: roleId
}), }),
success: function($el, idx2) { success: function ($el, idx2) {
$el.find('a.list-group-item').on( $el.find('a.list-group-item').on(
'click', 'click',
function(el) { function (el) {
layer.close(idx2) layer.close(idx2)
layer.close(idx1) layer.close(idx1)
var data = $(el.target) var data = $(el.target)
@ -772,7 +872,7 @@
</thead> </thead>
<tbody> <tbody>
`; `;
$.each(data.data.userList, function(index, value) { $.each(data.data.userList, function (index, value) {
html += ` html += `
<tr> <tr>
<td> <td>
@ -800,7 +900,7 @@
function choosePeople(obj, type) { function choosePeople(obj, type) {
var folderId = $('.org-menu-list li a.active').data('folder-id'); var folderId = $('.org-menu-list li a.active').data('folder-id');
folderId == undefined ? folderId = chuFolderId : folderId = folderId folderId == undefined ? folderId = chuFolderId : folderId = folderId
console.log("folderId2"+folderId); console.log("folderId2" + folderId);
var roleId = $(obj).data('role-id'); var roleId = $(obj).data('role-id');
dd.biz.contact.complexPicker({ dd.biz.contact.complexPicker({
title: "添加人员", //标题 title: "添加人员", //标题
@ -818,7 +918,7 @@
permissionType: "GLOBAL", //可添加权限校验选人权限目前只有GLOBAL这个参数 permissionType: "GLOBAL", //可添加权限校验选人权限目前只有GLOBAL这个参数
responseUserOnly: false, //返回人,或者返回人和部门 responseUserOnly: false, //返回人,或者返回人和部门
startWithDepartmentId: 0, //仅支持0和-1 startWithDepartmentId: 0, //仅支持0和-1
onSuccess: function(result) { onSuccess: function (result) {
/** /**
{ {
selectedCount:1, //选择人数 selectedCount:1, //选择人数
@ -827,7 +927,7 @@
} }
*/ */
var arr = [] var arr = []
result.users.forEach(function(item) { result.users.forEach(function (item) {
arr.push(item.emplId) arr.push(item.emplId)
}) })
var ajaxdata = { var ajaxdata = {
@ -837,7 +937,7 @@
"userIds": arr "userIds": arr
} }
var url = host + '/ding/dept/addUser'; var url = host + '/ding/dept/addUser';
dxtcRequest('post', url, JSON.stringify(ajaxdata), function(data) { dxtcRequest('post', url, JSON.stringify(ajaxdata), function (data) {
if (data.code == 200) { if (data.code == 200) {
getDeptUsers(type, folderId, roleId); getDeptUsers(type, folderId, roleId);
} else { } else {
@ -845,7 +945,7 @@
} }
}, 'application/json'); }, 'application/json');
}, },
onFail: function(err) { onFail: function (err) {
} }
}); });
@ -865,7 +965,7 @@
"userIds": arr "userIds": arr
} }
var url = host + '/ding/dept/delUser'; var url = host + '/ding/dept/delUser';
dxtcRequest('post', url, JSON.stringify(ajaxdata), function(data) { dxtcRequest('post', url, JSON.stringify(ajaxdata), function (data) {
if (data.code == 200) { if (data.code == 200) {
getDeptUsers(type, folderId, roleId, roleName); getDeptUsers(type, folderId, roleId, roleName);
} else { } else {
@ -874,7 +974,7 @@
}, 'application/json'); }, 'application/json');
} }
//修改组织名称 //修改组织名称
$('body').on('click', '#saveFolder', function() { $('body').on('click', '#saveFolder', function () {
var that = $('#folder-name'); var that = $('#folder-name');
var id = $('.org-menu-list li a.active').data('id'); var id = $('.org-menu-list li a.active').data('id');
var name = that.val(); var name = that.val();
@ -883,7 +983,7 @@
"name": name "name": name
} }
var url = host + '/ding/dept/updName'; var url = host + '/ding/dept/updName';
dxtcRequest('post', url, JSON.stringify(ajaxdata), function(data) { dxtcRequest('post', url, JSON.stringify(ajaxdata), function (data) {
if (data.code == 200) { if (data.code == 200) {
$('.org-menu-list li a.active').html(name); $('.org-menu-list li a.active').html(name);
$('.org-menu-list li a.active').data('folder-name', name); $('.org-menu-list li a.active').data('folder-name', name);
@ -893,10 +993,70 @@
} }
}, 'application/json'); }, 'application/json');
}) })
function getFileList(fileAjaxData) {
$('.list-content#Chart ul').empty()
$('.list-content#tab tbody').empty()
$.ajax({
url: host + '/ding/file/getFileList' + '?timetmp=' + Date.parse(new Date()).toString().substr(0,
10),
headers: {
'Blade-Auth': 'bearer ' + localStorage.accessToken
},
data: fileAjaxData,
type: "get",
contentType: "application/x-www-form-urlencoded",
dataType: "json",
success: function (data) {
if (data.code == 200) {
init()
if (data.data.folders.length > 0) {
data.data.folders.forEach(function (item) {
var html1 =
'<li class="list" onclick="openFolder(this)" ondblclick="openFolder(this)" data-id="' +
item.id + '" data-name="' + item.name + '">' +
'<div class="img"><img src="image/' + (item.folderType == "0" ?
"icon_11.png" : "icon_11_2.png") + '"></div>' +
'<div class="text-two-hide list-hight">' + item.name + '</div>' +
'</li>'
$('.list-content#Chart ul').append(html1)
})
}
if (data.data.files.length > 0) {
data.data.files.forEach(function (item) {
var html1 =
'<li class="list upload_selection" onclick="choiceFolder(this)" data-id="' +
item.id + '" data-name="' + item.name + '">' +
'<div class="img"><img src="image/icon-file/icon_' + item.type +
'.png"></div>' +
'<div class="text-two-hide list-hight">' + item.name + '</div>' +
'</li>'
$('.list-content#Chart ul').append(html1)
})
}
if (data.data.folders.length == 0 && data.data.files.length == 0) {
$('.no-con-list').show()
$('.con-list-cn').hide()
} else {
$('.no-con-list').hide()
$('.con-list-cn').show()
}
} else {
layer.msg(data.msg)
}
},
error: function (data) {
console.log(data);
}
});
}
</script> </script>
<script> <script>
layui.use(['element', 'form', 'laydate', 'layer'], function() { layui.use(['element', 'form', 'laydate', 'layer'], function () {
var element = layui.element; var element = layui.element;
var form = layui.form; var form = layui.form;
var laydate = layui.laydate; var laydate = layui.laydate;
@ -918,4 +1078,5 @@
}); });
</script> </script>
</body> </body>
</html>
</html>

32
dist/record.html vendored
View File

@ -323,6 +323,8 @@
<option value="1">文件上传</option> <option value="1">文件上传</option>
<option value="2">文件下载</option> <option value="2">文件下载</option>
<option value="3">文件更新</option> <option value="3">文件更新</option>
<option value="4">文件隐藏</option>
<option value="5">文件显示</option>
</select> </select>
</div> </div>
</div> </div>
@ -343,12 +345,12 @@
<div class="list-content"> <div class="list-content">
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>账号</th> <th>账号</th>
<th>操作类型</th> <th>操作类型</th>
<th>文件名称</th> <th>文件名称</th>
<th>操作时间</th> <th>操作时间</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
</tbody> </tbody>
@ -439,6 +441,7 @@
logsData.scope = data.field.fileType logsData.scope = data.field.fileType
logsData.startTime = data.field.times.split(' - ')[0] || '' logsData.startTime = data.field.times.split(' - ')[0] || ''
logsData.endTime = data.field.times.split(' - ')[1] || '' logsData.endTime = data.field.times.split(' - ')[1] || ''
console.log(logsData);
getLogs() getLogs()
return false; return false;
}); });
@ -461,7 +464,7 @@
title: '操作记录', title: '操作记录',
body: $('.con-search'), body: $('.con-search'),
success: function ($el, idx) { success: function ($el, idx) {
$el.find('.layui-form').css({padding: '20px'}) $el.find('.layui-form').css({ padding: '20px' })
$el.find('.font-18').hide() $el.find('.font-18').hide()
$el.find('button[lay-submit]').on('click', function () { $el.find('button[lay-submit]').on('click', function () {
layer.close(idx) layer.close(idx)
@ -497,13 +500,19 @@
case '3': case '3':
item.type = '文件更新'; item.type = '文件更新';
break; break;
case '4':
item.type = '文件隐藏';
break;
case '5':
item.type = '文件显示';
break;
default: default:
item.type = '未知类型'; item.type = '未知类型';
break; break;
} }
return item return item
}) })
$items.html(layui.laytpl(itemTpl).render({items: items})) $items.html(layui.laytpl(itemTpl).render({ items: items }))
return return
} }
@ -511,6 +520,7 @@
if (data.data.records.length > 0) { if (data.data.records.length > 0) {
var html = ''; var html = '';
data.data.records.forEach(function (item, i) { data.data.records.forEach(function (item, i) {
html += '<tr>'; html += '<tr>';
html += '<td><div class="list-img"><img src="image/img_01.png"><span>' + item.username + '</span></div></td>'; html += '<td><div class="list-img"><img src="image/img_01.png"><span>' + item.username + '</span></div></td>';
html += '<td>'; html += '<td>';
@ -520,6 +530,10 @@
html += '文件下载'; html += '文件下载';
} else if (item.type == 3) { } else if (item.type == 3) {
html += '文件更新'; html += '文件更新';
} else if (item.type == 4) {
html += '文件隐藏';
} else if (item.type == 5) {
html += '文件显示';
} }
html += '</td>'; html += '</td>';
html += '<td>' + item.fileName + '</td>'; html += '<td>' + item.fileName + '</td>';
@ -605,4 +619,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

143
dist/renewadd.html vendored
View File

@ -333,29 +333,31 @@
<div class="layui-form-item list"> <div class="layui-form-item list">
<label class="layui-form-label">文件名称:</label> <label class="layui-form-label">文件名称:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="name" lay-verify="required" lay-reqtext="请填写文件名称" <input type="text" name="name" lay-verify="required" lay-reqtext="请填写文件名称" placeholder="请填写文件名称" autocomplete="off" class="layui-input">
placeholder="请填写文件名称" autocomplete="off" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item list"> <div class="layui-form-item list">
<label class="layui-form-label">文件号:</label> <label class="layui-form-label">文件号:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="number" lay-verify="required" lay-reqtext="请填写文件号" <input type="text" name="number" lay-verify="required" lay-reqtext="请填写文件号" placeholder="请填写文件号" autocomplete="off" class="layui-input">
placeholder="请填写文件号" autocomplete="off" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item list"> <div class="layui-form-item list">
<label class="layui-form-label">拟稿人:</label> <label class="layui-form-label">拟稿人:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="createUser" lay-verify="required" lay-reqtext="请填写拟稿人" <input type="text" name="createUser" lay-verify="required" lay-reqtext="请填写拟稿人" placeholder="请填写拟稿人" autocomplete="off" class="layui-input">
placeholder="请填写拟稿人" autocomplete="off" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item list"> <div class="layui-form-item list">
<label class="layui-form-label">发布时间:</label> <label class="layui-form-label">发布时间:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="createTime" lay-verify="datetime" placeholder="请选择时间" <input type="text" name="createTime" lay-verify="datetime" placeholder="请选择时间" autocomplete="off" class="layui-input layui-time">
autocomplete="off" class="layui-input layui-time"> </div>
</div>
<div class="layui-form-item list">
<label class="layui-form-label">文件备注:</label>
<div class="layui-input-block">
<textarea name="note" maxlength="200" placeholder="请输入内容" class="layui-textarea"></textarea>
</div> </div>
</div> </div>
</div> </div>
@ -381,6 +383,7 @@
<div class="upload-form"> <div class="upload-form">
<button class="flie-btn" lay-submit lay-filter="formDemo">保存</button> <button class="flie-btn" lay-submit lay-filter="formDemo">保存</button>
<button type="reset" class="flie-btn flie-btn-primary">重置</button> <button type="reset" class="flie-btn flie-btn-primary">重置</button>
<button type="button" onclick="ddFile()">重置</button>
</div> </div>
</form> </form>
</div> </div>
@ -415,8 +418,7 @@
<!--文件夹--> <!--文件夹-->
<div class="con-list bg-w top20 add-border"> <div class="con-list bg-w top20 add-border">
<div class="name"> <div class="name">
<span class="font-14" id="folder-navigation"><i class="icon-back"></i><a data-id="0" <span class="font-14" id="folder-navigation"><i class="icon-back"></i><a data-id="0" data-name="全部文件">全部文件</a></span>
data-name="全部文件">全部文件</a></span>
<input type="hidden" id="navigation" value="0"> <input type="hidden" id="navigation" value="0">
</div> </div>
<div class="con-list-cn"> <div class="con-list-cn">
@ -454,9 +456,9 @@
var folderIds = [] var folderIds = []
var filesIds = [] var filesIds = []
$(function() { $(function () {
$(".click-history").click(function() { $(".click-history").click(function () {
$('.upload').show() $('.upload').show()
getFileList(fileAjaxData) getFileList(fileAjaxData)
}); });
@ -467,22 +469,22 @@
function getDingCode() { function getDingCode() {
dd.runtime.permission.requestAuthCode({ dd.runtime.permission.requestAuthCode({
corpId: corpId, corpId: corpId,
onSuccess: function(result) { onSuccess: function (result) {
this_code = result.code; this_code = result.code;
}, },
onFail: function(err) { onFail: function (err) {
console.log(err) console.log(err)
} }
}); });
} }
layui.use(['form', 'formSelects', 'upload', 'element', 'layer'], function() { layui.use(['form', 'formSelects', 'upload', 'element', 'layer'], function () {
var form = layui.form; var form = layui.form;
var formSelects = layui.formSelects; var formSelects = layui.formSelects;
var upload = layui.upload; var upload = layui.upload;
var element = layui.element; var element = layui.element;
var layer = layui.layer; var layer = layui.layer;
var renewaddIntervalScript = setInterval(function() { var renewaddIntervalScript = setInterval(function () {
var tmpHaveLogin = localStorage['haveLogin'] || false; var tmpHaveLogin = localStorage['haveLogin'] || false;
if (tmpHaveLogin) { if (tmpHaveLogin) {
clearInterval(renewaddIntervalScript); clearInterval(renewaddIntervalScript);
@ -490,7 +492,7 @@
} }
}, 500); }, 500);
form.on('radio(isPublic)', function(data) { form.on('radio(isPublic)', function (data) {
fileAjaxData.isPublic = data.value fileAjaxData.isPublic = data.value
getMainDeptList(fileAjaxData.isPublic) getMainDeptList(fileAjaxData.isPublic)
}); });
@ -508,16 +510,18 @@
}, },
field: 'file', field: 'file',
accept: 'file' accept: 'file'
// ,acceptMime: '.docx,.doc,.xlsx,.xls,.pdf,.ppt,pptx,.png,.jpg,.jpeg,.gif,.csv' // ,acceptMime: '.docx,.doc,.xlsx,.xls,.pdf,.ppt,pptx,.png,.jpg,.jpeg,.gif,.csv'
, ,
acceptMime: '*', acceptMime: '*',
multiple: false //多文件 multiple: false //多文件
, ,
number: 1, number: 1,
before: function(obj) { before: function (obj) {
this.data.code = this_code; this.data.code = this_code;
console.log(this.data.code);
getDingCode(); getDingCode();
obj.preview(function(index, file, result) { obj.preview(function (index, file, result) {
uploadNum++ uploadNum++
pressw = '' pressw = ''
// console.log('清空当前进度1' + pressw); // console.log('清空当前进度1' + pressw);
@ -532,18 +536,18 @@
var n = 0 var n = 0
var that = $('.layui-upload-list .list') var that = $('.layui-upload-list .list')
uploadTime = setInterval( uploadTime = setInterval(
function() { //按照时间随机生成一个小于95的进度具体数值可以自己调整 function () { //按照时间随机生成一个小于95的进度具体数值可以自己调整
n = n + Math.random() * 10 | 0; n = n + Math.random() * 10 | 0;
if (n > 95) { if (n > 95) {
n = 95; n = 95;
clearInterval(uploadTime); clearInterval(uploadTime);
} }
that.eq(uploadNum - 1).find('i').css('width', that.eq(uploadNum - 1).find('i').css('width',
n + '%') n + '%')
}, 50 + Math.random() * 100); }, 50 + Math.random() * 100);
}); });
}, },
done: function(res, index, upload) { done: function (res, index, upload) {
if (res.code == 200) { if (res.code == 200) {
pressw = '' pressw = ''
// console.log('清空当前进度2' + pressw); // console.log('清空当前进度2' + pressw);
@ -552,7 +556,7 @@
uploadNum + '" data-id="' + res.data.id + '" data-filename="' + uploadNum + '" data-id="' + res.data.id + '" data-filename="' +
res.data.name + '" data-filesize="' + res.data.size + res.data.name + '" data-filesize="' + res.data.size +
'" data-spaceid="' + res.data.spaceId + '" value="' + res.data '" data-spaceid="' + res.data.spaceId + '" value="' + res.data
.url + '" />'; .url + '" />';
clearInterval(uploadTime); clearInterval(uploadTime);
$('.progress' + uploadNum).css('width', '100%'); $('.progress' + uploadNum).css('width', '100%');
@ -568,16 +572,16 @@
}); });
} }
}, },
allDone: function(obj) { allDone: function (obj) {
clearInterval(uploadTime); clearInterval(uploadTime);
$('.layui-upload-list .list i').css('width', '100%') $('.layui-upload-list .list i').css('width', '100%')
} }
}); });
//选择文件夹 //选择文件夹
form.on('submit(formFile)', function(data) { form.on('submit(formFile)', function (data) {
var navName = '' var navName = ''
$('#folder-navigation a').each(function() { $('#folder-navigation a').each(function () {
if ($(this).attr('data-id') == $('#navigation').val()) { if ($(this).attr('data-id') == $('#navigation').val()) {
navName = $(this).attr('data-name') navName = $(this).attr('data-name')
folderIds.push({ folderIds.push({
@ -586,7 +590,7 @@
}) })
} }
}) })
$('.list-content#Chart ul li').each(function() { $('.list-content#Chart ul li').each(function () {
if ($(this).attr('class') == if ($(this).attr('class') ==
'list upload_selection upload_list_acive') { 'list upload_selection upload_list_acive') {
filesIds.push({ filesIds.push({
@ -604,7 +608,8 @@
}) })
//监听提交 //监听提交
form.on('submit(formDemo)', function(data) { form.on('submit(formDemo)', function (data) {
console.log(data);
// console.log('提交时当前进度:' + pressw); // console.log('提交时当前进度:' + pressw);
if (pressw != '100%') { if (pressw != '100%') {
// console.log('不等于:' + pressw); // console.log('不等于:' + pressw);
@ -618,23 +623,25 @@
var dingFileName = that.data('filename'); var dingFileName = that.data('filename');
var dingFileSize = that.data('filesize'); var dingFileSize = that.data('filesize');
var dingSpaceId = that.data('spaceid'); var dingSpaceId = that.data('spaceid');
filesIds.forEach(function(item) { filesIds.forEach(function (item) {
arr2.push(item.id) arr2.push(item.id)
}) })
if (folderIds.length == 0) { if (folderIds.length == 0) {
layer.msg("请选择需要更新的文件", { layer.msg("请选择需要更新的文件", {
icon: 5, icon: 5,
shift: 6 shift: 6
}, function() { }, function () {
$(".click-history").click(); $(".click-history").click();
}); });
return false; return false;
} }
var ajaxData = { var ajaxData = {
createTime: data.field.createTime + " 00:00:00", createTime: data.field.createTime + " 00:00:00",
createUser: '', createUser: '',
deptId: data.field.deptId, deptId: data.field.deptId,
drafter: data.field.createUser, drafter: data.field.createUser,
note: data.field.note,
//folderIds: folderIds.map(function(item){ return item.id }), //folderIds: folderIds.map(function(item){ return item.id }),
// groupId: "", // groupId: "",
// id: '', // id: '',
@ -666,7 +673,7 @@
type: "post", type: "post",
contentType: "application/json", contentType: "application/json",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
window.location = 'renew.html'; window.location = 'renew.html';
//window.location.reload() //window.location.reload()
@ -674,7 +681,7 @@
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
console.log(data); console.log(data);
layer.msg(data.responseJSON.msg) layer.msg(data.responseJSON.msg)
} }
@ -698,11 +705,11 @@
type: "get", type: "get",
contentType: "application/x-www-form-urlencoded", contentType: "application/x-www-form-urlencoded",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
$('.renew-list select').empty() $('.renew-list select').empty()
if (data.data.length > 0) { if (data.data.length > 0) {
data.data.forEach(function(item) { data.data.forEach(function (item) {
$('.renew-list select').append( $('.renew-list select').append(
'<option value="' + item.id + '">' + '<option value="' + item.id + '">' +
item.name + '</option>') item.name + '</option>')
@ -713,7 +720,7 @@
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
console.log(data); console.log(data);
} }
}); });
@ -724,7 +731,7 @@
//删除文件路径 //删除文件路径
function folderDel(obj) { function folderDel(obj) {
folderIds.forEach(function(item, i) { folderIds.forEach(function (item, i) {
if (item.id == $(obj).attr('data-id')) { if (item.id == $(obj).attr('data-id')) {
folderIds.splice(i, 1) folderIds.splice(i, 1)
} }
@ -743,7 +750,7 @@
function init() { function init() {
//返回事件 //返回事件
$('.con-list .name span .icon-back').off("click").click(function() { $('.con-list .name span .icon-back').off("click").click(function () {
var that = $(this) var that = $(this)
if ($("#navigation").val() != 0) { if ($("#navigation").val() != 0) {
fileAjaxData.parentFolderId = $('.con-list .name span a').eq(-2).attr('data-id') fileAjaxData.parentFolderId = $('.con-list .name span a').eq(-2).attr('data-id')
@ -753,10 +760,10 @@
} }
}); });
//路由事件 //路由事件
$('#folder-navigation a').off("click").click(function() { $('#folder-navigation a').off("click").click(function () {
var that = $(this) var that = $(this)
fileAjaxData.parentFolderId = that.attr('data-id') fileAjaxData.parentFolderId = that.attr('data-id')
$('.con-list .name span a').each(function() { $('.con-list .name span a').each(function () {
if ($(this).index() >= that.index()) { if ($(this).index() >= that.index()) {
$('.con-list .name span a').eq($(this).index()).remove() $('.con-list .name span a').eq($(this).index()).remove()
} }
@ -794,11 +801,11 @@
type: "get", type: "get",
contentType: "application/x-www-form-urlencoded", contentType: "application/x-www-form-urlencoded",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
init() init()
if (data.data.folders.length > 0) { if (data.data.folders.length > 0) {
data.data.folders.forEach(function(item) { data.data.folders.forEach(function (item) {
var html1 = var html1 =
'<li class="list" onclick="openFolder(this)" ondblclick="openFolder(this)" data-id="' + '<li class="list" onclick="openFolder(this)" ondblclick="openFolder(this)" data-id="' +
item.id + '" data-name="' + item.name + '">' + item.id + '" data-name="' + item.name + '">' +
@ -810,7 +817,7 @@
}) })
} }
if (data.data.files.length > 0) { if (data.data.files.length > 0) {
data.data.files.forEach(function(item) { data.data.files.forEach(function (item) {
var html1 = var html1 =
'<li class="list upload_selection" onclick="choiceFolder(this)" data-id="' + '<li class="list upload_selection" onclick="choiceFolder(this)" data-id="' +
item.id + '" data-name="' + item.name + '">' + item.id + '" data-name="' + item.name + '">' +
@ -832,11 +839,39 @@
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
console.log(data); console.log(data);
} }
}); });
} }
function ddFile(params) {
dd.biz.util.uploadAttachment({
types: ["photo"],
image: { "multiple": true, "compress": false, "max": 9, "spaceId": "12345" },
compress: true,
multiple: false,
max: 9,
isCopy: 0,
spaceId: "123",
space: { "corpId": "xxx3020", "spaceId": "12345", "isCopy": 1, "max": 9 },
file: { "spaceId": "12345", "max": 1 },
onSuccess: function (res) {
// 调用成功时回调
console.log(res)
},
onFail: function (err) {
// 调用失败时回调
console.log(err)
}
});
}
</script> </script>
<script> <script>
@ -862,4 +897,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -2,7 +2,7 @@
<include src="./lefter.html"></include> <include src="./lefter.html"></include>
<!--内容--> <!--内容-->
<div class="f-r content content-pd-50"> <div class="f-r content content-pd-50">
<div class="content-auto" data-id="11" > <div class="content-auto" data-id="11">
<div class="con-tit font-20 pc-block"> <div class="con-tit font-20 pc-block">
隐藏文件 隐藏文件
</div> </div>
@ -53,8 +53,29 @@
</form> </form>
</div> </div>
<!--内容--> <!--内容-->
<div class="con-list bg-w top20 phone-bg-none phone-top-0"> <div class="con-list bg-w top20 phone-bg-none phone-top-0 pr">
<!--手机--> <!--手机-->
<div class="nameMake">
<div class="nameMake-con">
<p class="tit-name">修改文件夹名称</p>
<div class="nameMake-cona">
<p>
<span>文件1</span>
<input type="text">
</p>
</div>
<div class="nameMake-btn">
<button onclick="nameMakeConfirm()">确定修改</button><button>取消修改</button>
</div>
</div>
</div>
<div class="phone-tit phone-block"> <div class="phone-tit phone-block">
<div class="name" id="phone-menu"> <div class="name" id="phone-menu">
<!-- <a href="javascript:;" class="active">公共文件</a> <!-- <a href="javascript:;" class="active">公共文件</a>
@ -78,17 +99,24 @@
</div> </div>
<!--pc--> <!--pc-->
<div class="name"> <div class="name">
<span class="font-14" id="folder-navigation"><i class="icon-back"></i><a href="hidefile.html" <span class="font-14" id="folder-navigation"><i class="icon-back"></i><a href="hidefile.html" data-id="0">全部文件</a></span>
data-id="0">全部文件</a></span>
<input type="hidden" id="navigation" value=""> <input type="hidden" id="navigation" value="">
<ul class="con-list-mero pc-block" role="tablist"> <div>
<li role="presentation" class="active"> <div class="listBtn">
<a class="img-list" href="#Chart" aria-controls="Chart" role="tab" data-toggle="tab">&nbsp;</a> <button type="button" onclick="editorName()">修改名字</button>
</li> <button type="button" onclick="hgiddenFiles()">显示文件</button>
<li role="presentation"> <button type="button " onclick="editorButton(this)">编辑文件</button>
<a href="#tab" aria-controls="tab" role="tab" data-toggle="tab" class="tab-list">&nbsp;</a> </div>
</li> <ul class="con-list-mero pc-block" role="tablist">
</ul> <li role="presentation" class="active">
<a class="img-list" href="#Chart" aria-controls="Chart" role="tab" data-toggle="tab">&nbsp;</a>
</li>
<li role="presentation">
<a href="#tab" aria-controls="tab" role="tab" data-toggle="tab" class="tab-list">&nbsp;</a>
</li>
</ul>
</div>
</div> </div>
<div class="con-list-cn tab-content"> <div class="con-list-cn tab-content">
<div class="list-content active tab-pane" role="tabpanel" id="Chart"> <div class="list-content active tab-pane" role="tabpanel" id="Chart">
@ -131,7 +159,7 @@
<h3>文件名称</h3> <h3>文件名称</h3>
<p></p> <p></p>
<a href="#" class="btn1" id="preview-button" onclick="previewBtn(this)">预览</a> <a href="#" class="btn1" id="preview-button" onclick="previewBtn(this)">预览</a>
<a onclick="downloadfile(this)" id="download" class="btn2" download="">下载</a> <a onclick="downloadfile(this)" id="download" class="btn2" download="">下载</a>
</div> </div>
</div> </div>
</div> </div>
@ -174,31 +202,49 @@
startTime: '', startTime: '',
type: '' type: ''
} }
let dataEditor = {
editorIf: true,
editorData: [],
rows: []
}
function editorButton(obj) {
if (dataEditor.editorIf) {
$(obj).html("取消编辑")
} else {
$(obj).html("编辑文件")
$(".onClickListOne").attr("data-click", "1")
$(".onClickListOne").children(".list-img").css("display", "none")
$(".onClickListOne").css("background", "rgba(0,0,0,0)")
$(".onClickListTwo").parent().css("background", "rgba(0,0,0,0)")
$(".onClickListTwo").attr("data-click", "1")
$(".onClickListTwo").prev().css("display", "none")
}
dataEditor.editorIf = !dataEditor.editorIf
}
var serch_flag = false; var serch_flag = false;
$(function() { $(function () {
layui.use(['form', 'upload', 'element', 'layer'], function() { layui.use(['form', 'upload', 'element', 'layer'], function () {
var form = layui.form; var form = layui.form;
var upload = layui.upload; var upload = layui.upload;
var element = layui.element; var element = layui.element;
var layer = layui.layer; var layer = layui.layer;
//var haveLogin = localStorage['haveLogin'] || false; //var haveLogin = localStorage['haveLogin'] || false;
var loginInterval = setInterval(function() { var loginInterval = setInterval(function () {
var tmpHaveLogin = localStorage['haveLogin'] || false; var tmpHaveLogin = localStorage['haveLogin'] || false;
if (tmpHaveLogin) { if (tmpHaveLogin) {
clearInterval(loginInterval); clearInterval(loginInterval);
pageInit(); pageInit();
} }
}, 500); }, 500);
function pageInit() { function pageInit() {
getFileType(); getFileType();
getFileList(ajaxData); getFileList(ajaxData);
} }
$('#toggle-filter').on('click', function() { $('#toggle-filter').on('click', function () {
layer.open({ layer.open({
type: 1, type: 1,
title: ['文件过滤', 'font-size:18px;padding:0;text-align:center'], title: ['文件过滤', 'font-size:18px;padding:0;text-align:center'],
@ -207,8 +253,8 @@
area: ['100%', '100%'], area: ['100%', '100%'],
closeBtn: 1, closeBtn: 1,
skin: 'file-filter-layer', skin: 'file-filter-layer',
success: function(dom, index) { success: function (dom, index) {
dom.find('.layui-btn[lay-submit]').on('click', function() { dom.find('.layui-btn[lay-submit]').on('click', function () {
layer.close(index); layer.close(index);
}); });
} }
@ -216,7 +262,7 @@
}); });
//搜索 //搜索
form.on('submit(formDemo)', function(data) { form.on('submit(formDemo)', function (data) {
ajaxData = { ajaxData = {
createUser: data.field.createUser, createUser: data.field.createUser,
drafter: data.field.drafter, drafter: data.field.drafter,
@ -239,23 +285,23 @@
//文件类型 //文件类型
function getFileType() { function getFileType() {
$.ajax({ $.ajax({
url: host + '/ding/file/getFileType'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), url: host + '/ding/file/getFileType' + '?timetmp=' + Date.parse(new Date()).toString().substr(0, 10),
headers: { headers: {
'Blade-Auth': 'bearer ' + accessToken, 'Blade-Auth': 'bearer ' + accessToken,
}, },
data: {}, data: {},
type: "get", type: "get",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
if (data.data.length > 0) { if (data.data.length > 0) {
data.data.forEach(function(item) { data.data.forEach(function (item) {
$('.con-search select[name=type]').append( $('.con-search select[name=type]').append(
'<option value="' + item + '">' + item + '<option value="' + item + '">' + item +
'</option>') '</option>')
}) })
form.render() form.render()
} }
// else { // else {
// layer.msg('暂无记录') // layer.msg('暂无记录')
// } // }
@ -263,7 +309,7 @@
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
console.log(data); console.log(data);
} }
}); });
@ -273,11 +319,11 @@
}) })
function init() { function init() {
$('.con-list .name span .icon-back').off("click").click(function() { $('.con-list .name span .icon-back').off("click").click(function () {
var that = $(this); var that = $(this);
if (serch_flag) { if (serch_flag) {
$("#search-form")[0].reset(); $("#search-form")[0].reset();
layui.use(['form'], function() { layui.use(['form'], function () {
var form = layui.form; var form = layui.form;
form.render(); form.render();
}) })
@ -315,12 +361,12 @@
serch_flag = false; serch_flag = false;
}); });
//路由事件 //路由事件
$('#folder-navigation a').off("click").click(function() { $('#folder-navigation a').off("click").click(function () {
var that = $(this) var that = $(this)
console.log(that.attr('data-id'), 'parentFolderId'); console.log(that.attr('data-id'), 'parentFolderId');
ajaxData.parentFolderId = that.attr('data-id') ajaxData.parentFolderId = that.attr('data-id')
ajaxData.name = ''; ajaxData.name = '';
$('.con-list .name span a').each(function() { $('.con-list .name span a').each(function () {
if ($(this).index() >= that.index()) { if ($(this).index() >= that.index()) {
$('.con-list .name span a').eq($(this).index()).remove() $('.con-list .name span a').eq($(this).index()).remove()
} }
@ -334,7 +380,7 @@
//历史记录 //历史记录
function getHistory(obj) { function getHistory(obj) {
$.ajax({ $.ajax({
url: host + '/ding/file/getHistory'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), url: host + '/ding/file/getHistory' + '?timetmp=' + Date.parse(new Date()).toString().substr(0, 10),
headers: { headers: {
'Blade-Auth': 'bearer ' + accessToken, 'Blade-Auth': 'bearer ' + accessToken,
}, },
@ -343,18 +389,18 @@
}, },
type: "get", type: "get",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
if (data.data.length > 0) { if (data.data.length > 0) {
var html = ''; var html = '';
data.data.forEach(function(item) { data.data.forEach(function (item) {
html += '<tr>' + html += '<tr>' +
'<td><div class="list-img click-download" onclick="openFile(this)" data-id="' + '<td><div class="list-img click-download" onclick="openFile(this)" data-id="' +
item.id + '" data-name="' + item.name + '" data-type="' + item item.id + '" data-name="' + item.name + '" data-type="' + item
.type + '" data-url="' + item.url + '" data-time="' + item .type + '" data-url="' + item.url + '" data-time="' + item
.createTime + '" data-dingid="' + item.dingFileId + .createTime + '" data-dingid="' + item.dingFileId +
'" data-dingname="' + item.dingFileName + '" data-dingsize="' + item '" data-dingname="' + item.dingFileName + '" data-dingsize="' + item
.dingFileSize + '" data-spaceid="' + item.dingSpaceId + .dingFileSize + '" data-spaceid="' + item.dingSpaceId +
'"><img src="image/icon_22.png"><span>' + item.name + '"><img src="image/icon_22.png"><span>' + item.name +
'</span></div></td>' '</span></div></td>'
html += '<td>'; html += '<td>';
@ -369,7 +415,7 @@
}) })
$(".history .table tbody").html(html) $(".history .table tbody").html(html)
$(".history").show(); $(".history").show();
} }
// else { // else {
// layer.msg('暂无记录') // layer.msg('暂无记录')
// } // }
@ -377,7 +423,7 @@
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
console.log(data); console.log(data);
} }
}); });
@ -385,7 +431,57 @@
} }
//打开文件夹 //打开文件夹
function openIf(data) {
if (dataEditor.editorIf) {
if ($(data).attr("data-if") == 1) {
openFolder(data)
} else {
openFile(data)
}
} else {
if ($(data).attr("data-click") == "1") {
if ($(data).attr("data-if") == 1) {
$(data).children(".list-img").css("display", "block")
$(data).css("background", "#f5f6ff")
dataEditor.editorData.push({
id: $(data).attr("data-id"),
folder: true
})
} else {
$(data).prev().css("display", "block")
$(data).parent().css("background", "#f5f6ff")
dataEditor.editorData.push({
id: $(data).attr("data-id"),
folder: false
})
}
$(data).attr("data-click", "0")
} else {
if ($(data).attr("data-if") == 1) {
$(data).children(".list-img").css("display", "none")
$(data).css("background", "#fff")
let ina = screening(dataEditor.editorData, $(data).attr("data-id"))
dataEditor.editorData.splice(ina, 1)
} else {
$(data).prev().css("display", "none")
$(data).parent().css("background", "#fff")
let ina = screening(dataEditor.editorData, $(data).attr("data-id"))
dataEditor.editorData.splice(ina, 1)
}
$(data).attr("data-click", "1")
}
console.log(dataEditor.editorData);
}
}
function openFolder(obj) { function openFolder(obj) {
dataEditor.editorData = []
dataEditor.editorIf = true
ajaxData.parentFolderId = $(obj).attr('data-id') ajaxData.parentFolderId = $(obj).attr('data-id')
getFileList(ajaxData) getFileList(ajaxData)
$("#navigation").val($(obj).attr('data-id')); $("#navigation").val($(obj).attr('data-id'));
@ -397,7 +493,7 @@
function downloadfile(obj) { function downloadfile(obj) {
var id = $(obj).data('fileid'); var id = $(obj).data('fileid');
$.ajax({ $.ajax({
url: host + '/ding/file/downLoadFile'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), url: host + '/ding/file/downLoadFile' + '?timetmp=' + Date.parse(new Date()).toString().substr(0, 10),
headers: { headers: {
'Blade-Auth': 'bearer ' + localStorage.accessToken 'Blade-Auth': 'bearer ' + localStorage.accessToken
}, },
@ -407,17 +503,17 @@
type: "get", type: "get",
contentType: "application/json", contentType: "application/json",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
$(obj).attr('data', data.data); $(obj).attr('data', data.data);
console.log(data.data); console.log(data.data);
window.open(data.data); window.open(data.data);
} else { } else {
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
console.log(data); console.log(data);
} }
}); });
@ -476,52 +572,167 @@
// } // }
// }); // });
} }
//隐藏文件 //隐藏文件
function hideFile(obj){ function hgiddenFiles(obj) {
layer.confirm('确认显示这个文件吗?', { var arr2 = dataEditor.editorData.some(function (v) {
btn: ['确认', '取消'] //可以无限个按钮 return v.folder == true;
, });
}, function(index, layero){ console.log(arr2);
//按钮【按钮一】的回调 if (arr2) {
$.ajax({ layer.msg("不能显示文件夹")
url: host + '/ding/file/disPlayFile'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), return
headers: {
'Blade-Auth': 'bearer ' + localStorage.accessToken }
}, layer.confirm('确认显示这些文件吗?', {
data: { btn: ['确认', '取消'] //可以无限个按钮
fileId:$(obj).attr("data-id"), ,
isShow:1 }, function (index, layero) {
},
type: "get", let objD = {
contentType: "application/x-www-form-urlencoded", fileIds: [],
dataType: "json", isShow: 1
success: function(data) { }
if(data.code==200){
layer.msg('显示成功') for (let index = 0; index < dataEditor.editorData.length; index++) {
getFileList(ajaxData) objD.fileIds.push(dataEditor.editorData[index].id)
}else{ }
layer.msg(data.msg) let contentType = "application/json"
} let url = host + '/ding/file/disPlayFiles'
dxtcRequest('post', url, JSON.stringify(objD), function name(data) {
}, if (data.code == 200) {
error: function(data) { console.log(data);
console.log(data); layer.msg('显示成功')
} getFileList(ajaxData)
}) } else {
}, function(index){ layer.msg(data.msg)
//按钮【按钮二】的回调 }
layer.closeAll(); }, contentType)
layer.closeAll();
}, function (index) {
//按钮【按钮二】的回调
layer.closeAll();
}); });
return false; return false;
} }
function hideFile(obj) {
layer.confirm('确认隐藏这个文件吗?', {
btn: ['确认', '取消'] //可以无限个按钮
,
}, function (index, layero) {
//按钮【按钮一】的回调
$.ajax({
url: host + '/ding/file/disPlayFile' + '?timetmp=' + Date.parse(new Date()).toString()
.substr(0, 10),
headers: {
'Blade-Auth': 'bearer ' + localStorage.accessToken
},
data: {
fileId: $(obj).attr("data-id"),
isShow: 0
},
type: "get",
contentType: "application/x-www-form-urlencoded",
dataType: "json",
success: function (data) {
if (data.code == 200) {
layer.msg('隐藏成功')
getFileList(ajaxData)
} else {
layer.msg(data.msg)
}
},
error: function (data) {
console.log(data);
layer.msg(data.responseJSON.msg)
}
})
}, function (index) {
//按钮【按钮二】的回调
layer.closeAll();
});
return false;
}
//修改文件名
function editorName() {
console.log(dataEditor.rows, "--------------");
console.log(dataEditor.editorData, "--------------");
var arr2 = dataEditor.editorData.some(function (v) {
return v.folder == true;
});
if (arr2) {
layer.msg("不能重命名文件夹")
return
}
let editorNameData = []
for (let index = 0; index < dataEditor.editorData.length; index++) {
for (let k = 0; k < dataEditor.rows.files.length; k++) {
if (dataEditor.editorData[index].id == dataEditor.rows.files[k].id) {
editorNameData.push(dataEditor.rows.files[k])
}
}
}
$(".nameMake").css("display", "flex")
let str = editorNameData.map((v, i) => ` <p>
<span>文件${i + 1}</span>
<input value='${v.name}' data-id="${v.id}" type="text">
</p>`).join("")
$(".nameMake-cona").html(str)
}
function modifyName(data) {
let contentType = "application/json"
let url = host + '/ding/file/updateFile'
dxtcRequest('post', url, JSON.stringify(data), function name(data) {
if (data.code == 200) {
console.log(data);
} else {
layer.msg(data.msg)
}
}, contentType)
}
function nameMakeConfirm(params) {
layer.confirm('确认修改这些文件名嘛?', {
btn: ['确认', '取消'] //可以无限个按钮
,
}, function (index, layero) {
let arr = []
for (let index = 0; index < $(".nameMake-cona input").length; index++) {
arr.push({
name: $($(".nameMake-cona input")[index]).val(),
id: $($(".nameMake-cona input")[index]).attr("data-id")
})
}
for (let index = 0; index < arr.length; index++) {
modifyName(arr[index])
}
getFileList(ajaxData)
$(".nameMake").css("display", "none")
layer.closeAll();
}, function (index) {
layer.closeAll();
});
}
//影藏文件列表 //影藏文件列表
function getFileList(ajaxData) { function getFileList(ajaxData) {
console.log(ajaxData, 'getFileList'); console.log(ajaxData, 'getFileList');
$('.list-content#Chart ul').empty() $('.list-content#Chart ul').empty()
$('.list-content#tab tbody').empty() $('.list-content#tab tbody').empty()
$.ajax({ $.ajax({
url: host + '/ding/file/getDisplayFile'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), url: host + '/ding/file/getDisplayFile' + '?timetmp=' + Date.parse(new Date()).toString().substr(0, 10),
headers: { headers: {
'Blade-Auth': 'bearer ' + localStorage.accessToken 'Blade-Auth': 'bearer ' + localStorage.accessToken
}, },
@ -529,21 +740,22 @@
type: "get", type: "get",
contentType: "application/x-www-form-urlencoded", contentType: "application/x-www-form-urlencoded",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
dataEditor.rows = data.data
if (data.code == 200) { if (data.code == 200) {
init() init()
if (data.data.folders.length > 0) { if (data.data.folders.length > 0) {
data.data.folders.forEach(function(item) { data.data.folders.forEach(function (item) {
var html1 = var html1 =
'<li class="list" onclick="openFolder(this)" ondblclick="openFolder(this)" data-id="' + '<li class="list onClickListOne onClickList" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this)" data-id="' + item.id + '">' +
item.id + '">' + '<img class="list-img" src="./image/icon_30.png">' +
'<div class="img"><img src="image/'+(item.folderType=="0"?"icon_11.png":"icon_11_2.png")+'"></div>' + '<div class="img"><img src="image/' + (item.folderType == "0" ? "icon_11.png" : "icon_11_2.png") + '"></div>' +
'<div class="text-two-hide list-hight">' + item.name + '</div>' + '<div class="text-two-hide list-hight">' + item.name + '</div>' +
'</li>' '</li>'
$('.list-content#Chart ul').append(html1) $('.list-content#Chart ul').append(html1)
var html2 = '<tr>' + var html2 = '<tr>' +
'<td><div class="list-img" onclick="openFolder(this)" ondblclick ="openFolder(this)" data-id="' + '<td><div class="list-img" data-if="1" data-click="1" onclick="openIf(this)" ondblclick ="openIf(this)" data-id="' +
item.id + '"><img src="image/'+(item.folderType=="0"?"icon_11.png":"icon_11_2.png")+'"><span>' + item.name + item.id + '"><img src="image/' + (item.folderType == "0" ? "icon_11.png" : "icon_11_2.png") + '"><span>' + item.name +
'</span></div></td>' + '</span></div></td>' +
'<td></td>' + '<td></td>' +
'<td></td>' + '<td></td>' +
@ -558,30 +770,28 @@
}) })
} }
if (data.data.files.length > 0) { if (data.data.files.length > 0) {
data.data.files.forEach(function(item) { data.data.files.forEach(function (item) {
var html1 = var html1 =
'<li class="list click-download" >' '<li class="list click-download ps onClickList" >'
+ (item.isPublic == "0" ?
"<span class='internal'></span>" : "") +
+ '<div class="more">'
+ '<span>...</span>' '<img class="list-img" src="./image/icon_30.png">' +
+ '<div class="more-edit" onclick="hideFile(this)" data-id="' + item.id + '" data-name="' + item.name + '">显示</div>' '<div class="img onClickListTwo" data-if="2" data-click="1" onclick="openIf(this)" data-id="' +
+ '</div>'+
'<div class="img" onclick="openFile(this)" data-id="' +
item.id + '" data-name="' + item.name + '" data-type="' + item item.id + '" data-name="' + item.name + '" data-type="' + item
.type + '" data-url="' + item.url + '" data-time="' + item .type + '" data-url="' + item.url + '" data-time="' + item
.createTime + '" data-dingid="' + item.dingFileId + .createTime + '" data-dingid="' + item.dingFileId +
'" data-dingname="' + item.dingFileName + '" data-dingsize="' + item '" data-dingname="' + item.dingFileName + '" data-dingsize="' + item
.dingFileSize + '" data-spaceid="' + item.dingSpaceId + '"><img src="image/icon-file/icon_' + item.type + .dingFileSize + '" data-spaceid="' + item.dingSpaceId +
'"><img src="image/icon-file/icon_' + item.type +
'.png"></div>' + '.png"></div>' +
'<div class="text-two-hide list-hight">' + item.name + '</div>' + '<div class="text-two-hide list-hight">' + item.name + '</div>' +
'</li>' '</li>'
$('.list-content#Chart ul').append(html1) $('.list-content#Chart ul').append(html1)
var html2 = '<tr>' + var html2 = '<tr>' +
'<td>' '<td>'
+ '<div class="more">' + '<div class="more">'
+ '<span>...</span>' + '<span>...</span>'
+ '<div class="more-edit" onclick="hideFile(this)" data-id="' + item.id + '" data-name="' + item.name + '">显示</div>' + '<div class="more-edit" onclick="hideFile(this)" data-id="' + item.id + '" data-name="' + item.name + '">显示</div>'
@ -589,8 +799,8 @@
+ +
'<div class="list-img" onclick="openFile(this)" data-id="' + '<div class="list-img" onclick="openFile(this)" data-id="' +
item.id + '" data-name="' + item.name + '" data-type="' + item item.id + '" data-name="' + item.name + '" data-type="' + item
.type + '" data-url="' + item.url + '" data-time="' + item .type + '" data-url="' + item.url + '" data-time="' + item
.createTime + '" ><img src="image/icon-file/icon_' + item.type + .createTime + '" ><img src="image/icon-file/icon_' + item.type +
'.png"><span>' + item.name + '</span></div></td>' + '.png"><span>' + item.name + '</span></div></td>' +
'<td>' + item.number + '</td>' + '<td>' + item.number + '</td>' +
'<td><div class="list-img"><span>' + item.drafter + '<td><div class="list-img"><span>' + item.drafter +
@ -618,7 +828,7 @@
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
console.log(data); console.log(data);
} }
}); });
@ -628,4 +838,4 @@
<include src="./footer.html"></include> <include src="./footer.html"></include>
<!--appfooter--> <!--appfooter-->
<include src="./appFooter.html"></include> <include src="./appFooter.html"></include>

View File

@ -53,8 +53,30 @@
</form> </form>
</div> </div>
<!--内容--> <!--内容-->
<div class="con-list bg-w top20 phone-bg-none phone-top-0"> <div class="con-list bg-w top20 phone-bg-none phone-top-0 pr">
<!--手机--> <!--手机-->
<div class="nameMake">
<div class="nameMake-con">
<p class="tit-name">修改文件夹名称</p>
<div class="nameMake-cona">
<p>
<span>文件1</span>
<input type="text">
</p>
</div>
<div class="nameMake-btn">
<button onclick="nameMakeConfirm()">确定修改</button><button>取消修改</button>
</div>
</div>
</div>
<div class="phone-tit phone-block"> <div class="phone-tit phone-block">
<div class="name" id="phone-menu"> <div class="name" id="phone-menu">
<!-- <a href="javascript:;" class="active">公共文件</a> <!-- <a href="javascript:;" class="active">公共文件</a>
@ -88,7 +110,7 @@
<input type="hidden" id="navigation" value=""> <input type="hidden" id="navigation" value="">
<div> <div>
<div class="listBtn"> <div class="listBtn">
<button type="button"></button> <button type="button" onclick="editorName()">修改名字</button>
<button type="button" onclick="hgiddenFiles()">隐藏文件</button> <button type="button" onclick="hgiddenFiles()">隐藏文件</button>
<button type="button " onclick="editorButton(this)">编辑文件</button> <button type="button " onclick="editorButton(this)">编辑文件</button>
</div> </div>
@ -188,6 +210,7 @@
let dataEditor = { let dataEditor = {
editorIf: true, editorIf: true,
editorData: [], editorData: [],
rows: []
} }
function editorButton(obj) { function editorButton(obj) {
if (dataEditor.editorIf) { if (dataEditor.editorIf) {
@ -418,7 +441,13 @@
function openIf(data) { function openIf(data) {
if (dataEditor.editorIf) { if (dataEditor.editorIf) {
openFolder(data)
if ($(data).attr("data-if") == 1) {
openFolder(data)
} else {
openFile(data)
}
} else { } else {
if ($(data).attr("data-click") == "1") { if ($(data).attr("data-click") == "1") {
if ($(data).attr("data-if") == 1) { if ($(data).attr("data-if") == 1) {
@ -462,6 +491,7 @@
function openFolder(obj) { function openFolder(obj) {
dataEditor.editorData = [] dataEditor.editorData = []
dataEditor.editorIf = true dataEditor.editorIf = true
ajaxData.parentFolderId = $(obj).attr('data-id') ajaxData.parentFolderId = $(obj).attr('data-id')
getFileList(ajaxData) getFileList(ajaxData)
$("#navigation").val($(obj).attr('data-id')); $("#navigation").val($(obj).attr('data-id'));
@ -556,13 +586,84 @@
// }); // });
} }
// 文件夹重命名
function editorName() {
console.log(dataEditor.rows);
console.log(dataEditor.editorData);
var arr2 = dataEditor.editorData.some(function (v) {
return v.folder == true;
});
if (arr2) {
layer.msg("不能重命名文件夹")
return
}
let editorNameData = []
for (let index = 0; index < dataEditor.editorData.length; index++) {
for (let k = 0; k < dataEditor.rows.files.length; k++) {
if (dataEditor.editorData[index].id == dataEditor.rows.files[k].id) {
editorNameData.push(dataEditor.rows.files[k])
}
}
}
$(".nameMake").css("display", "flex")
let str = editorNameData.map((v, i) => ` <p>
<span>文件${i + 1}</span>
<input value='${v.name}' data-id="${v.id}" type="text">
</p>`).join("")
$(".nameMake-cona").html(str)
}
function modifyName(data) {
let contentType = "application/json"
let url = host + '/ding/file/updateFile'
dxtcRequest('post', url, JSON.stringify(data), function name(data) {
if (data.code == 200) {
console.log(data);
} else {
layer.msg(data.msg)
}
}, contentType)
}
function nameMakeConfirm(params) {
layer.confirm('确认隐藏这个文件吗?', {
btn: ['确认', '取消'] //可以无限个按钮
,
}, function (index, layero) {
let arr = []
for (let index = 0; index < $(".nameMake-cona input").length; index++) {
arr.push({
name: $($(".nameMake-cona input")[index]).val(),
id: $($(".nameMake-cona input")[index]).attr("data-id")
})
}
for (let index = 0; index < arr.length; index++) {
modifyName(arr[index])
}
getFileList(ajaxData)
$(".nameMake").css("display", "none")
layer.closeAll();
}, function (index) {
layer.closeAll();
});
}
//隐藏文件 //隐藏文件
function hgiddenFiles(obj) { function hgiddenFiles(obj) {
var arr2 = dataEditor.editorData.some(function (v) { var arr2 = dataEditor.editorData.some(function (v) {
return v.folder == true; return v.folder == true;
}); });
if (arr2) { if (arr2) {
layer.msg("不能隐藏文件夹") layer.msg("不能隐藏文件夹")
return
} }
layer.confirm('确认隐藏这个文件吗?', { layer.confirm('确认隐藏这个文件吗?', {
btn: ['确认', '取消'] //可以无限个按钮 btn: ['确认', '取消'] //可以无限个按钮
@ -658,12 +759,13 @@
contentType: "application/x-www-form-urlencoded", contentType: "application/x-www-form-urlencoded",
dataType: "json", dataType: "json",
success: function (data) { success: function (data) {
dataEditor.rows = data.data
if (data.code == 200) { if (data.code == 200) {
init() init()
if (data.data.folders.length > 0) { if (data.data.folders.length > 0) {
data.data.folders.forEach(function (item) { data.data.folders.forEach(function (item) {
var html1 = var html1 =
'<li class="list onClickListOne" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this)" data-id="' + '<li class="list onClickListOne onClickList" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this)" data-id="' +
item.id + '">' + item.id + '">' +
'<img class="list-img" src="./image/icon_30.png">' + '<img class="list-img" src="./image/icon_30.png">' +
'<div class="img"> <img src="image/' + (item.folderType == "0" ? '<div class="img"> <img src="image/' + (item.folderType == "0" ?
@ -672,7 +774,7 @@
'</li>' '</li>'
$('.list-content#Chart ul').append(html1) $('.list-content#Chart ul').append(html1)
var html2 = '<tr>' + var html2 = '<tr>' +
'<td><div class="list-img" onclick="openIf(this)" ondblclick ="openIf(this)" data-id="' + '<td><div class="list-img" data-if="1" data-click="1" onclick="openIf(this)" ondblclick ="openIf(this)" data-id="' +
item.id + '"><img src="image/' + (item.folderType == "0" ? item.id + '"><img src="image/' + (item.folderType == "0" ?
"icon_11.png" : "icon_11_2.png") + '"><span>' + item.name + "icon_11.png" : "icon_11_2.png") + '"><span>' + item.name +
'</span></div></td>' + '</span></div></td>' +
@ -689,17 +791,12 @@
}) })
$(".onClickList").on("click", () => {
})
$(".onClickList").on("ondblclick", () => {
})
} }
if (data.data.files.length > 0) { if (data.data.files.length > 0) {
data.data.files.forEach(function (item) { data.data.files.forEach(function (item) {
var html1 = var html1 =
'<li class="list click-download ps" >' '<li class="list click-download ps onClickList" >'
+ (item.isPublic == "0" ? + (item.isPublic == "0" ?
"<span class='internal'></span>" : "") + "<span class='internal'></span>" : "") +

View File

@ -54,8 +54,23 @@
</form> </form>
</div> </div>
<!--内容--> <!--内容-->
<div class="con-list bg-w top20 phone-bg-none phone-top-0"> <div class="con-list bg-w top20 phone-bg-none phone-top-0 pr">
<!--手机--> <!--手机-->
<div class="nameMake">
<div class="nameMake-con">
<p class="tit-name">修改文件夹名称</p>
<div class="nameMake-cona">
<p>
<span>文件1</span>
<input type="text">
</p>
</div>
<div class="nameMake-btn">
<button onclick="nameMakeConfirm()">确定修改</button><button>取消修改</button>
</div>
</div>
</div>
<div class="phone-tit phone-block"> <div class="phone-tit phone-block">
<div class="name" id="phone-menu"> <div class="name" id="phone-menu">
<!-- <a href=" index.html">公共文件</a> <!-- <a href=" index.html">公共文件</a>
@ -83,7 +98,7 @@
<input type="hidden" id="navigation" value=""> <input type="hidden" id="navigation" value="">
<div> <div>
<div class="listBtn"> <div class="listBtn">
<button type="button"></button> <button type="button" onclick="editorName()">修改名字</button>
<button type="button" onclick="hgiddenFiles()">隐藏文件</button> <button type="button" onclick="hgiddenFiles()">隐藏文件</button>
<button type="button " onclick="editorButton(this)">编辑文件</button> <button type="button " onclick="editorButton(this)">编辑文件</button>
</div> </div>
@ -184,6 +199,7 @@
let dataEditor = { let dataEditor = {
editorIf: true, editorIf: true,
editorData: [], editorData: [],
rows: []
} }
function editorButton(obj) { function editorButton(obj) {
if (dataEditor.editorIf) { if (dataEditor.editorIf) {
@ -417,6 +433,9 @@
//打开文件夹 //打开文件夹
function openFolder(obj) { function openFolder(obj) {
dataEditor.editorData = []
dataEditor.editorIf = true
console.log(obj);
ajaxData.parentFolderId = $(obj).attr('data-id') ajaxData.parentFolderId = $(obj).attr('data-id')
getFileList(ajaxData) getFileList(ajaxData)
$("#navigation").val($(obj).attr('data-id')) $("#navigation").val($(obj).attr('data-id'))
@ -454,9 +473,15 @@
} }
function openIf(data) { function openIf(data) {
console.log(data);
if (dataEditor.editorIf) { if (dataEditor.editorIf) {
openFolder(data) if ($(data).attr("data-if") == 1) {
openFolder(data)
} else {
openFile(data)
}
} else { } else {
if ($(data).attr("data-click") == "1") { if ($(data).attr("data-click") == "1") {
if ($(data).attr("data-if") == 1) { if ($(data).attr("data-if") == 1) {
@ -497,15 +522,75 @@
} }
} }
function openFolder(obj) { // 文件夹重命名
dataEditor.editorData = [] function editorName() {
dataEditor.editorIf = true console.log(dataEditor.rows, "--------------");
ajaxData.parentFolderId = $(obj).attr('data-id') console.log(dataEditor.editorData, "--------------");
getFileList(ajaxData) var arr2 = dataEditor.editorData.some(function (v) {
$("#navigation").val($(obj).attr('data-id')); return v.folder == true;
$('#folder-navigation').append('<a data-id="' + $(obj).attr('data-id') + '"> > ' + $(obj).text() + '</a>'); });
serch_flag = false; if (arr2) {
layer.msg("不能重命名文件夹")
return
}
let editorNameData = []
for (let index = 0; index < dataEditor.editorData.length; index++) {
for (let k = 0; k < dataEditor.rows.files.length; k++) {
if (dataEditor.editorData[index].id == dataEditor.rows.files[k].id) {
editorNameData.push(dataEditor.rows.files[k])
}
}
}
$(".nameMake").css("display", "flex")
let str = editorNameData.map((v, i) => ` <p>
<span>文件${i + 1}</span>
<input value='${v.name}' data-id="${v.id}" type="text">
</p>`).join("")
$(".nameMake-cona").html(str)
} }
function modifyName(data) {
let contentType = "application/json"
let url = host + '/ding/file/updateFile'
dxtcRequest('post', url, JSON.stringify(data), function name(data) {
if (data.code == 200) {
console.log(data);
} else {
layer.msg(data.msg)
}
}, contentType)
}
function nameMakeConfirm(params) {
layer.confirm('确认隐藏这个文件吗?', {
btn: ['确认', '取消'] //可以无限个按钮
,
}, function (index, layero) {
let arr = []
for (let index = 0; index < $(".nameMake-cona input").length; index++) {
arr.push({
name: $($(".nameMake-cona input")[index]).val(),
id: $($(".nameMake-cona input")[index]).attr("data-id")
})
}
for (let index = 0; index < arr.length; index++) {
modifyName(arr[index])
}
getFileList(ajaxData)
$(".nameMake").css("display", "none")
layer.closeAll();
}, function (index) {
layer.closeAll();
});
}
//文件下载 //文件下载
function downloadfile(obj) { function downloadfile(obj) {
var id = $(obj).data('fileid'); var id = $(obj).data('fileid');
@ -582,6 +667,7 @@
}); });
if (arr2) { if (arr2) {
layer.msg("不能隐藏文件夹") layer.msg("不能隐藏文件夹")
return
} }
layer.confirm('确认隐藏这个文件吗?', { layer.confirm('确认隐藏这个文件吗?', {
btn: ['确认', '取消'] //可以无限个按钮 btn: ['确认', '取消'] //可以无限个按钮
@ -590,7 +676,7 @@
let objD = { let objD = {
fileIds: [], fileIds: [],
isShow: 0 isShow: 1
} }
for (let index = 0; index < dataEditor.editorData.length; index++) { for (let index = 0; index < dataEditor.editorData.length; index++) {
@ -636,20 +722,22 @@
contentType: "application/x-www-form-urlencoded", contentType: "application/x-www-form-urlencoded",
dataType: "json", dataType: "json",
success: function (data) { success: function (data) {
dataEditor.rows = data.data
if (data.code == 200) { if (data.code == 200) {
init() init()
if (data.data.folders.length > 0) { if (data.data.folders.length > 0) {
data.data.folders.forEach(function (item) { data.data.folders.forEach(function (item) {
console.log("======" + item.id + '=====');
var html1 = var html1 =
'<li class="list" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this) data-id="' + '<li class="list onClickListOne onClickList" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this)" data-id="' + item.id + '">' +
item.id + '">' + '<img class="list-img" src="./image/icon_30.png">' +
'<div class="img"><img src="image/' + (item.folderType == "0" ? "icon_11.png" : "icon_11_2.png") + '"></div>' + '<div class="img"><img src="image/' + (item.folderType == "0" ? "icon_11.png" : "icon_11_2.png") + '"></div>' +
'<div class="text-two-hide list-hight">' + item.name + '</div>' + '<div class="text-two-hide list-hight">' + item.name + '</div>' +
'</li>' '</li>'
$('.list-content#Chart ul').append(html1) $('.list-content#Chart ul').append(html1)
var html2 = '<tr>' + var html2 = '<tr>' +
'<td><div class="list-img" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this) data-id="' + '<td><div class="list-img" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this)" data-id="' + item.id + '"><img src="image/' + (item.folderType == "0" ? "icon_11.png" : "icon_11_2.png") + '"><span>' + item.name +
item.id + '"><img src="image/' + (item.folderType == "0" ? "icon_11.png" : "icon_11_2.png") + '"><span>' + item.name +
'</span></div></td>' + '</span></div></td>' +
'<td></td>' + '<td></td>' +
'<td></td>' + '<td></td>' +
@ -666,19 +754,16 @@
if (data.data.files.length > 0) { if (data.data.files.length > 0) {
data.data.files.forEach(function (item) { data.data.files.forEach(function (item) {
var html1 = var html1 =
'<li class="list click-download" >' '<li class="list click-download ps onClickList" >'
+
+ '<div class="more">' '<img class="list-img" src="./image/icon_30.png">' +
+ '<span>...</span>' '<div class="img onClickListTwo" data-if="2" data-click="1" onclick="openIf(this)" data-id="' + item.id +
+ '<div class="more-edit" onclick="hideFile(this)" data-id="' + item.id + '" data-name="' + item.name + '">隐藏</div>' '" data-name="' + item.name + '" data-type="' + item
+ '</div>' +
'<div class="img" onclick="openFile(this)" data-id="' +
item.id + '" data-name="' + item.name + '" data-type="' + item
.type + '" data-url="' + item.url + '" data-time="' + item .type + '" data-url="' + item.url + '" data-time="' + item
.createTime + '" data-dingid="' + item.dingFileId + .createTime + '" data-dingid="' + item.dingFileId +
'" data-dingname="' + item.dingFileName + '" data-dingsize="' + item '" data-dingname="' + item.dingFileName + '" data-dingsize="' + item
.dingFileSize + '" data-spaceid="' + item.dingSpaceId + '" ><img src="image/icon-file/icon_' + item.type + .dingFileSize + '" data-spaceid="' + item.dingSpaceId +
'"><img src="image/icon-file/icon_' + item.type +
'.png"></div>' + '.png"></div>' +
'<div class="text-two-hide list-hight">' + item.name + '</div>' + '<div class="text-two-hide list-hight">' + item.name + '</div>' +
'</li>' '</li>'
@ -690,8 +775,6 @@
+ '<span onclick="showBtn(this)" >...</span>' + '<span onclick="showBtn(this)" >...</span>'
+ '<div class="more-edit" onclick="hideFile(this)" data-id="' + item.id + '" data-name="' + item.name + '">隐藏</div>' + '<div class="more-edit" onclick="hideFile(this)" data-id="' + item.id + '" data-name="' + item.name + '">隐藏</div>'
+ '</div>' + '</div>'
+ '<div class="list-img" onclick="openFile(this)" data-id="' + + '<div class="list-img" onclick="openFile(this)" data-id="' +
item.id + '" data-name="' + item.name + '" data-type="' + item item.id + '" data-name="' + item.name + '" data-type="' + item
.type + '" data-url="' + item.url + '" data-time="' + item .type + '" data-url="' + item.url + '" data-time="' + item

View File

@ -12,9 +12,9 @@
<div class="form-control__input"> <div class="form-control__input">
<div class="js_party_select_result"> <div class="js_party_select_result">
<div class="js_party_select_result_list"></div> <div class="js_party_select_result_list"></div>
<button class="mobileGroup" onclick="mobileGroup(this)">移动组织</button>
<a id="addDept" class="js_show_party_selector add" href="javascript:;">+添加组织</a> <a id="addDept" class="js_show_party_selector add" href="javascript:;">+添加组织</a>
<input id="deptInput" class="form-input" type="hidden" name="policy_dept_ids" value="" <input id="deptInput" class="form-input" type="hidden" name="policy_dept_ids" value="" style="display: none;">
style="display: none;">
</div> </div>
</div> </div>
</div> </div>
@ -29,8 +29,7 @@
</div> </div>
<div class="con-text bg-w hide-mobile"> <div class="con-text bg-w hide-mobile">
<div class="name add-border"> <div class="name add-border">
<input type="text" name="" value="组织名称01" data-id="" id="folder-name" disabled="disabled" <input type="text" name="" value="组织名称01" data-id="" id="folder-name" disabled="disabled" class="name-input">
class="name-input">
<div class="name-btn name-btn-none"> <div class="name-btn name-btn-none">
<button class="btn-edit btn-edit-op"><img src="image/icon_32.png"></button> <button class="btn-edit btn-edit-op"><img src="image/icon_32.png"></button>
</div> </div>
@ -43,16 +42,13 @@
<div class="org-list"> <div class="org-list">
<ul class="org-ul " role="tablist"> <ul class="org-ul " role="tablist">
<li role="presentation" class="active"> <li role="presentation" class="active">
<a href="#Admin" aria-controls="Admin" role="tab" data-toggle="tab" data-role-id="3" <a href="#Admin" aria-controls="Admin" role="tab" data-toggle="tab" data-role-id="3" class="tab-menu-admin">管理员</a>
class="tab-menu-admin">管理员</a>
</li> </li>
<li role="presentation"> <li role="presentation">
<a href="#opera" aria-controls="opera" role="tab" data-toggle="tab" data-role-id="5" <a href="#opera" aria-controls="opera" role="tab" data-toggle="tab" data-role-id="5" class="tab-menu-opera">操作员</a>
class="tab-menu-opera">操作员</a>
</li> </li>
<li role="presentation"> <li role="presentation">
<a href="#look" aria-controls="look" role="tab" data-toggle="tab" data-role-id="6" <a href="#look" aria-controls="look" role="tab" data-toggle="tab" data-role-id="6" class="tab-menu-look">查看员</a>
class="tab-menu-look">查看员</a>
</li> </li>
</ul> </ul>
<div class="tab-content org-con top20"> <div class="tab-content org-con top20">
@ -62,8 +58,7 @@
<p>1. 可查看、添加和下载授权组织内部文件、公共文件; </p> <p>1. 可查看、添加和下载授权组织内部文件、公共文件; </p>
<p>2. 创建和修改授权组织 “操作员”</p> <p>2. 创建和修改授权组织 “操作员”</p>
<p>3. 创建授权组织内部文件分类</p> <p>3. 创建授权组织内部文件分类</p>
<a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="3" <a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="3" onclick="choosePeople(this, 'Admin')">
onclick="choosePeople(this, 'Admin')">
+添加人员 +添加人员
</a> </a>
</div> </div>
@ -75,8 +70,7 @@
<div class="org-remarks"> <div class="org-remarks">
<p>操作员权限</p> <p>操作员权限</p>
<p>1. 可查看、添加和下载授权组织内部文件、公共文件; </p> <p>1. 可查看、添加和下载授权组织内部文件、公共文件; </p>
<a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="5" <a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="5" onclick="choosePeople(this, 'opera')">
onclick="choosePeople(this, 'opera')">
+添加人员 +添加人员
</a> </a>
</div> </div>
@ -88,8 +82,7 @@
<div class="org-remarks"> <div class="org-remarks">
<p>查看员权限</p> <p>查看员权限</p>
<p>1. 可查看和下载授权组织内部文件、公共文件; </p> <p>1. 可查看和下载授权组织内部文件、公共文件; </p>
<a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="6" <a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="6" onclick="choosePeople(this, 'look')">
onclick="choosePeople(this, 'look')">
+添加人员 +添加人员
</a> </a>
</div> </div>
@ -102,8 +95,61 @@
</div> </div>
</div> </div>
</div> </div>
</div> <!-- <div class="organization-con">
<div class="organization-con-data">
</div>
</div> -->
</div>
<div class="history upload">
<div class="center-center download-hight">
<div class="history-content bg-w">
<div class="on-name">
<h3 class="font-14">选择文件路径</h3>
</div>
<a href="javascript:;" class="close">&nbsp;</a>
<form class="p-25 layui-form">
<!-- <div class="con-search upload-search add-border">
<div class="layui-form-item">
<label class="layui-form-label">主管部门:</label>
<div class="layui-input-block">
<select name="city">
<option value="">全部类型</option>
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">文件名称:</label>
<div class="layui-input-block">
<input type="text" class="layui-input" placeholder="文件名称 ">
</div>
</div>
</div> -->
<!--文件夹-->
<div class="con-list bg-w top20 add-border">
<div class="name">
<span class="font-14" id="folder-navigation"><i class="icon-back"></i><a data-id="0" data-name="全部文件">全部文件</a></span>
<input type="hidden" id="navigation" value="0">
</div>
<div class="con-list-cn">
<div class="list-content" id="Chart">
<ul></ul>
</div>
</div>
<!-- 无内容 -->
<div class="no-con-list" style="display: none;">
<img src="image/img_02.jpg">
</div>
</div>
<!--保存-->
<div class="upload-form t-r">
<button class="flie-btn" lay-submit lay-filter="formFile">保存</button>
<button type="reset" class="flie-btn flie-btn-primary">重置</button>
</div>
</form>
</div>
</div>
</div>
<script type="text/html" id="modal-tpl"> <script type="text/html" id="modal-tpl">
<div class="con-content"> <div class="con-content">
<div class="con-mune bg-w"> <div class="con-mune bg-w">
@ -125,6 +171,8 @@
{{# }); }} {{# }); }}
</ul> </ul>
</div> </div>
</div> </div>
</script> </script>
@ -144,20 +192,30 @@
<link rel="stylesheet" type="text/css" href="js/orgTree/orgTree.css" /> <link rel="stylesheet" type="text/css" href="js/orgTree/orgTree.css" />
<script src="js/orgTree/orgTree.js" type="text/javascript" charset="utf-8"></script> <script src="js/orgTree/orgTree.js" type="text/javascript" charset="utf-8"></script>
<script> <script>
var fileAjaxData = {
current: '',
isPublic: 1,
parentFolderId: 0,
size: '',
isUpload: 1
}
let dataOrganization = {
state: false
}
//修改名称 //修改名称
$(".btn-edit-op").click(function() { $(".btn-edit-op").click(function () {
$(".name-btn-active").show(); $(".name-btn-active").show();
$(".name-input").addClass("name-input-edit"); $(".name-input").addClass("name-input-edit");
$(".name-input").attr("disabled", false); $(".name-input").attr("disabled", false);
}); });
$(".btn-close,.btn-keep").click(function() { $(".btn-close,.btn-keep").click(function () {
$(".name-btn-active").hide(); $(".name-btn-active").hide();
$(".name-input").removeClass("name-input-edit"); $(".name-input").removeClass("name-input-edit");
$(".name-input").attr("disabled", "disabled"); $(".name-input").attr("disabled", "disabled");
}); });
let zuId = 0 let zuId = 0
let shangId = 0 let shangId = 0
$('body').on('click', '.tab-menu-admin, .tab-menu-opera, .tab-menu-look', function() { $('body').on('click', '.tab-menu-admin, .tab-menu-opera, .tab-menu-look', function () {
let that = $(this); let that = $(this);
// let folderId = $('.org-menu-list li a.active').data('folder-id'); // let folderId = $('.org-menu-list li a.active').data('folder-id');
// console.log('组织ID'+zuId) // console.log('组织ID'+zuId)
@ -166,31 +224,31 @@
getDeptUsers(type, zuId, roleId); getDeptUsers(type, zuId, roleId);
}) })
//添加组织 //添加组织
$("#addDept").click(function() { $("#addDept").click(function () {
if ($(".org-menu-list a.active").length == 0) { if ($(".org-menu-list a.active").length == 0) {
layer.confirm('确认添加组织?', { layer.confirm('确认添加组织?', {
btn: ['确认', '取消'] //可以无限个按钮 btn: ['确认', '取消'] //可以无限个按钮
}, function(index, layero) { }, function (index, layero) {
//按钮【按钮一】的回调 //按钮【按钮一】的回调
var parentId = shangId; var parentId = shangId;
// console.log('组织ID1'+parentId); // console.log('组织ID1'+parentId);
layer.closeAll(); layer.closeAll();
addDept(parentId) addDept(parentId)
}, function(index) { }, function (index) {
//按钮【按钮二】的回调 //按钮【按钮二】的回调
layer.closeAll(); layer.closeAll();
}); });
} else { } else {
// var parentId = $(".org-menu-list a.active").attr("data-id"); // var parentId = $(".org-menu-list a.active").attr("data-id");
console.log('组织ID2'+shangId); console.log('组织ID2' + shangId);
addDept(shangId) addDept(shangId)
} }
}); });
function addDept(parentId) { function addDept(parentId) {
// console.log(parentId); // console.log(parentId);
layer.prompt(function(value, index, elem) { layer.prompt(function (value, index, elem) {
layer.alert(value); //得到value layer.alert(value); //得到value
layer.close(index); layer.close(index);
var data = { var data = {
@ -207,16 +265,16 @@
type: "post", type: "post",
contentType: "application/json", contentType: "application/json",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
layer.msg("添加成功", function() { layer.msg("添加成功", function () {
location.reload(); location.reload();
}) })
} else { } else {
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
layer.msg(data.responseJSON.msg) layer.msg(data.responseJSON.msg)
} }
}); });
@ -228,9 +286,9 @@
$(".org-menu-list a.active").removeClass('active'); $(".org-menu-list a.active").removeClass('active');
clearId() clearId()
} }
function clearId(){//把上级组织ID设为0 function clearId() {//把上级组织ID设为0
shangId = 0 shangId = 0
console.log("shangId:"+shangId); console.log("shangId:" + shangId);
} }
@ -239,14 +297,14 @@
tckd = ['90%', '90%']; tckd = ['90%', '90%'];
} }
layui.use(['element', 'form', 'laydate', 'laypage', 'laytpl'], function() { layui.use(['element', 'form', 'laydate', 'laypage', 'laytpl'], function () {
var laypage = layui.laypage; var laypage = layui.laypage;
var element = layui.element; var element = layui.element;
var form = layui.form; var form = layui.form;
var laydate = layui.laydate; var laydate = layui.laydate;
// return false; // return false;
var organizationIntervalScript = setInterval(function() { var organizationIntervalScript = setInterval(function () {
var tmpHaveLogin = localStorage['haveLogin'] || false; var tmpHaveLogin = localStorage['haveLogin'] || false;
if (tmpHaveLogin) { if (tmpHaveLogin) {
clearInterval(organizationIntervalScript); clearInterval(organizationIntervalScript);
@ -265,7 +323,7 @@
data: {}, data: {},
type: "get", type: "get",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
if (data.data.length > 0) { if (data.data.length > 0) {
$('.deptBtn').orgTree({ $('.deptBtn').orgTree({
@ -279,7 +337,7 @@
defaultTitle: '请选择', defaultTitle: '请选择',
defaultButton: '+添加组织', defaultButton: '+添加组织',
jsonData: data.data, jsonData: data.data,
custom: function(event) { custom: function (event) {
// form属性为true才会生效 // form属性为true才会生效
var data = { var data = {
parentId: event[0].id, parentId: event[0].id,
@ -288,24 +346,24 @@
$.ajax({ $.ajax({
url: host + '/ding/dept/addDept' + url: host + '/ding/dept/addDept' +
'?timetmp=' + Date.parse(new Date()) '?timetmp=' + Date.parse(new Date())
.toString().substr(0, 10), .toString().substr(0, 10),
headers: { headers: {
'Blade-Auth': 'bearer ' + 'Blade-Auth': 'bearer ' +
localStorage localStorage
.accessToken .accessToken
}, },
data: JSON.stringify(data), data: JSON.stringify(data),
type: "post", type: "post",
contentType: "application/json", contentType: "application/json",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
getDeptList() getDeptList()
} else { } else {
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
layer.msg(data.responseJSON.msg) layer.msg(data.responseJSON.msg)
} }
}); });
@ -316,7 +374,7 @@
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
// console.log(data); // console.log(data);
} }
}); });
@ -330,15 +388,15 @@
let type = "get"; let type = "get";
let data = {}; let data = {};
let roleId = $('.org-list .org-ul li.active a').data('role-id'); let roleId = $('.org-list .org-ul li.active a').data('role-id');
dxtcRequest(type, url, data, function(data) { dxtcRequest(type, url, data, function (data) {
if (data.code == 200) { if (data.code == 200) {
let html = ''; let html = '';
let active = ''; let active = '';
$.each(data.data, function(index, value) { $.each(data.data, function (index, value) {
if (index === 0) { if (index === 0) {
active = 'active'; active = 'active';
$('#folder-name').val(value.deptName).attr('data-id', value.id); $('#folder-name').val(value.deptName).attr('data-id', value.id);
// console.log('初始组织名称:'+value.deptName); // console.log('初始组织名称:'+value.deptName);
chuFolderId = value.folderId chuFolderId = value.folderId
// console.log("chuFolderId:"+chuFolderId); // console.log("chuFolderId:"+chuFolderId);
if (!MobileLib.isMobile()) getDeptUsers('Admin', value.folderId, roleId); if (!MobileLib.isMobile()) getDeptUsers('Admin', value.folderId, roleId);
@ -357,7 +415,7 @@
function menu_list_html(data, index = 0) { function menu_list_html(data, index = 0) {
var html = ""; var html = "";
var null_str = "" var null_str = ""
$.each(data, function(index, value) { $.each(data, function (index, value) {
// html += '<li class="add-border" ><a href="javascript:;" data-id="' + value.id + // html += '<li class="add-border" ><a href="javascript:;" data-id="' + value.id +
// '" data-folder-id="' + value.folderId + '" data-role-id="' + roleId + // '" data-folder-id="' + value.folderId + '" data-role-id="' + roleId +
// '" data-folder-name="' + value.deptName + '" onclick="changeDept(this)">' + value.deptName + // '" data-folder-name="' + value.deptName + '" onclick="changeDept(this)">' + value.deptName +
@ -370,7 +428,7 @@
'" data-folder-name="' + value.deptName + '">设置人员</span>'; '" data-folder-name="' + value.deptName + '">设置人员</span>';
if (value.hasChildren) { if (value.hasChildren) {
html += '<span onclick="PutAway(this)" class=" PutAway float-right">展开</span>'; html += '<span onclick="PutAway(this)" class=" PutAway float-right">展开</span>';
html += "<ul class='org-menu-lis-children'>" + menu_list_html(value.children) + "</ul>"; html += "<ul class='org-menu-lis-children'>" + menu_list_html(value.children, { num: 0, id: value.id }) + "</ul>";
} }
html += "</li>"; html += "</li>";
}); });
@ -378,8 +436,44 @@
return html; return html;
} }
function init() {
//返回事件
$('.con-list .name span .icon-back').off("click").click(function () {
var that = $(this)
if ($("#navigation").val() != 0) {
fileAjaxData.parentFolderId = $('.con-list .name span a').eq(-2).attr('data-id')
$("#navigation").val($('.con-list .name span a').eq(-2).attr('data-id'))
$('.con-list .name span a').eq(-1).remove()
getFileList(fileAjaxData)
}
});
//路由事件
$('#folder-navigation a').off("click").click(function () {
var that = $(this)
fileAjaxData.parentFolderId = that.attr('data-id')
$('.con-list .name span a').each(function () {
if ($(this).index() >= that.index()) {
$('.con-list .name span a').eq($(this).index()).remove()
}
})
$("#navigation").val(that.attr('data-id'))
getFileList(fileAjaxData)
})
}
//选择组织,更改显示内容 //选择组织,更改显示内容
function mobileGroup(params) {
if (dataOrganization.state) {
$(params).html("取消")
} else {
$(params).html("移动组织")
}
dataOrganization.state = !dataOrganization.state
console.log(dataOrganization.state);
}
function changeDept(obj) { function changeDept(obj) {
var id = $(obj).data('id'); var id = $(obj).data('id');
zuId = $(obj).data('folder-id'); zuId = $(obj).data('folder-id');
var roleId = $(obj).data('role-id'); var roleId = $(obj).data('role-id');
@ -391,6 +485,12 @@
} }
// 选中组织 // 选中组织
function change(obj) { function change(obj) {
console.log(dataOrganization.state);
if (dataOrganization.state) {
$('.upload').show()
getFileList(fileAjaxData)
return
}
shangId = $(obj).data('id'); shangId = $(obj).data('id');
zuId = $(obj).data('folder-id'); zuId = $(obj).data('folder-id');
chuFolderId = zuId chuFolderId = zuId
@ -399,7 +499,7 @@
// console.log('顶级组织ID' + shangId); // console.log('顶级组织ID' + shangId);
// console.log('当前组织ID' + zuId); // console.log('当前组织ID' + zuId);
let roleId = $('.org-list .org-ul li.active a').data('role-id'); let roleId = $('.org-list .org-ul li.active a').data('role-id');
// console.log('roleId' + roleId); // console.log('roleId' + roleId);
getDeptUsers('Admin', zuId, roleId); getDeptUsers('Admin', zuId, roleId);
} }
//收起 //收起
@ -429,7 +529,7 @@
'roleId': roleId 'roleId': roleId
}; };
$('.org-remarks-add').attr('data-folder-id', folderId); $('.org-remarks-add').attr('data-folder-id', folderId);
dxtcRequest('get', url, data, function(data) { dxtcRequest('get', url, data, function (data) {
if (data.code == 200) { if (data.code == 200) {
if (MobileLib.isMobile()) { if (MobileLib.isMobile()) {
layer.closeAll(); layer.closeAll();
@ -443,16 +543,16 @@
type: type, type: type,
users: data.data.userList || [] users: data.data.userList || []
}), }),
success: function($p, idx1) { success: function ($p, idx1) {
$p.find('.name > span').on('click', function() { $p.find('.name > span').on('click', function () {
MobileLib.actionSheet({ MobileLib.actionSheet({
body: layui.laytpl(modalSelectorTpl).render({ body: layui.laytpl(modalSelectorTpl).render({
roleId: roleId roleId: roleId
}), }),
success: function($el, idx2) { success: function ($el, idx2) {
$el.find('a.list-group-item').on( $el.find('a.list-group-item').on(
'click', 'click',
function(el) { function (el) {
layer.close(idx2) layer.close(idx2)
layer.close(idx1) layer.close(idx1)
var data = $(el.target) var data = $(el.target)
@ -482,7 +582,7 @@
</thead> </thead>
<tbody> <tbody>
`; `;
$.each(data.data.userList, function(index, value) { $.each(data.data.userList, function (index, value) {
html += ` html += `
<tr> <tr>
<td> <td>
@ -510,7 +610,7 @@
function choosePeople(obj, type) { function choosePeople(obj, type) {
var folderId = $('.org-menu-list li a.active').data('folder-id'); var folderId = $('.org-menu-list li a.active').data('folder-id');
folderId == undefined ? folderId = chuFolderId : folderId = folderId folderId == undefined ? folderId = chuFolderId : folderId = folderId
console.log("folderId2"+folderId); console.log("folderId2" + folderId);
var roleId = $(obj).data('role-id'); var roleId = $(obj).data('role-id');
dd.biz.contact.complexPicker({ dd.biz.contact.complexPicker({
title: "添加人员", //标题 title: "添加人员", //标题
@ -528,7 +628,7 @@
permissionType: "GLOBAL", //可添加权限校验选人权限目前只有GLOBAL这个参数 permissionType: "GLOBAL", //可添加权限校验选人权限目前只有GLOBAL这个参数
responseUserOnly: false, //返回人,或者返回人和部门 responseUserOnly: false, //返回人,或者返回人和部门
startWithDepartmentId: 0, //仅支持0和-1 startWithDepartmentId: 0, //仅支持0和-1
onSuccess: function(result) { onSuccess: function (result) {
/** /**
{ {
selectedCount:1, //选择人数 selectedCount:1, //选择人数
@ -537,7 +637,7 @@
} }
*/ */
var arr = [] var arr = []
result.users.forEach(function(item) { result.users.forEach(function (item) {
arr.push(item.emplId) arr.push(item.emplId)
}) })
var ajaxdata = { var ajaxdata = {
@ -547,7 +647,7 @@
"userIds": arr "userIds": arr
} }
var url = host + '/ding/dept/addUser'; var url = host + '/ding/dept/addUser';
dxtcRequest('post', url, JSON.stringify(ajaxdata), function(data) { dxtcRequest('post', url, JSON.stringify(ajaxdata), function (data) {
if (data.code == 200) { if (data.code == 200) {
getDeptUsers(type, folderId, roleId); getDeptUsers(type, folderId, roleId);
} else { } else {
@ -555,7 +655,7 @@
} }
}, 'application/json'); }, 'application/json');
}, },
onFail: function(err) { onFail: function (err) {
} }
}); });
@ -575,7 +675,7 @@
"userIds": arr "userIds": arr
} }
var url = host + '/ding/dept/delUser'; var url = host + '/ding/dept/delUser';
dxtcRequest('post', url, JSON.stringify(ajaxdata), function(data) { dxtcRequest('post', url, JSON.stringify(ajaxdata), function (data) {
if (data.code == 200) { if (data.code == 200) {
getDeptUsers(type, folderId, roleId, roleName); getDeptUsers(type, folderId, roleId, roleName);
} else { } else {
@ -584,7 +684,7 @@
}, 'application/json'); }, 'application/json');
} }
//修改组织名称 //修改组织名称
$('body').on('click', '#saveFolder', function() { $('body').on('click', '#saveFolder', function () {
var that = $('#folder-name'); var that = $('#folder-name');
var id = $('.org-menu-list li a.active').data('id'); var id = $('.org-menu-list li a.active').data('id');
var name = that.val(); var name = that.val();
@ -593,7 +693,7 @@
"name": name "name": name
} }
var url = host + '/ding/dept/updName'; var url = host + '/ding/dept/updName';
dxtcRequest('post', url, JSON.stringify(ajaxdata), function(data) { dxtcRequest('post', url, JSON.stringify(ajaxdata), function (data) {
if (data.code == 200) { if (data.code == 200) {
$('.org-menu-list li a.active').html(name); $('.org-menu-list li a.active').html(name);
$('.org-menu-list li a.active').data('folder-name', name); $('.org-menu-list li a.active').data('folder-name', name);
@ -603,10 +703,70 @@
} }
}, 'application/json'); }, 'application/json');
}) })
function getFileList(fileAjaxData) {
$('.list-content#Chart ul').empty()
$('.list-content#tab tbody').empty()
$.ajax({
url: host + '/ding/file/getFileList' + '?timetmp=' + Date.parse(new Date()).toString().substr(0,
10),
headers: {
'Blade-Auth': 'bearer ' + localStorage.accessToken
},
data: fileAjaxData,
type: "get",
contentType: "application/x-www-form-urlencoded",
dataType: "json",
success: function (data) {
if (data.code == 200) {
init()
if (data.data.folders.length > 0) {
data.data.folders.forEach(function (item) {
var html1 =
'<li class="list" onclick="openFolder(this)" ondblclick="openFolder(this)" data-id="' +
item.id + '" data-name="' + item.name + '">' +
'<div class="img"><img src="image/' + (item.folderType == "0" ?
"icon_11.png" : "icon_11_2.png") + '"></div>' +
'<div class="text-two-hide list-hight">' + item.name + '</div>' +
'</li>'
$('.list-content#Chart ul').append(html1)
})
}
if (data.data.files.length > 0) {
data.data.files.forEach(function (item) {
var html1 =
'<li class="list upload_selection" onclick="choiceFolder(this)" data-id="' +
item.id + '" data-name="' + item.name + '">' +
'<div class="img"><img src="image/icon-file/icon_' + item.type +
'.png"></div>' +
'<div class="text-two-hide list-hight">' + item.name + '</div>' +
'</li>'
$('.list-content#Chart ul').append(html1)
})
}
if (data.data.folders.length == 0 && data.data.files.length == 0) {
$('.no-con-list').show()
$('.con-list-cn').hide()
} else {
$('.no-con-list').hide()
$('.con-list-cn').show()
}
} else {
layer.msg(data.msg)
}
},
error: function (data) {
console.log(data);
}
});
}
</script> </script>
<script> <script>
layui.use(['element', 'form', 'laydate', 'layer'], function() { layui.use(['element', 'form', 'laydate', 'layer'], function () {
var element = layui.element; var element = layui.element;
var form = layui.form; var form = layui.form;
var laydate = layui.laydate; var laydate = layui.laydate;
@ -628,4 +788,5 @@
}); });
</script> </script>
</body> </body>
</html>
</html>

View File

@ -33,6 +33,8 @@
<option value="1">文件上传</option> <option value="1">文件上传</option>
<option value="2">文件下载</option> <option value="2">文件下载</option>
<option value="3">文件更新</option> <option value="3">文件更新</option>
<option value="4">文件隐藏</option>
<option value="5">文件显示</option>
</select> </select>
</div> </div>
</div> </div>
@ -53,12 +55,12 @@
<div class="list-content"> <div class="list-content">
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>账号</th> <th>账号</th>
<th>操作类型</th> <th>操作类型</th>
<th>文件名称</th> <th>文件名称</th>
<th>操作时间</th> <th>操作时间</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
</tbody> </tbody>
@ -149,6 +151,7 @@
logsData.scope = data.field.fileType logsData.scope = data.field.fileType
logsData.startTime = data.field.times.split(' - ')[0] || '' logsData.startTime = data.field.times.split(' - ')[0] || ''
logsData.endTime = data.field.times.split(' - ')[1] || '' logsData.endTime = data.field.times.split(' - ')[1] || ''
console.log(logsData);
getLogs() getLogs()
return false; return false;
}); });
@ -171,7 +174,7 @@
title: '操作记录', title: '操作记录',
body: $('.con-search'), body: $('.con-search'),
success: function ($el, idx) { success: function ($el, idx) {
$el.find('.layui-form').css({padding: '20px'}) $el.find('.layui-form').css({ padding: '20px' })
$el.find('.font-18').hide() $el.find('.font-18').hide()
$el.find('button[lay-submit]').on('click', function () { $el.find('button[lay-submit]').on('click', function () {
layer.close(idx) layer.close(idx)
@ -207,13 +210,19 @@
case '3': case '3':
item.type = '文件更新'; item.type = '文件更新';
break; break;
case '4':
item.type = '文件隐藏';
break;
case '5':
item.type = '文件显示';
break;
default: default:
item.type = '未知类型'; item.type = '未知类型';
break; break;
} }
return item return item
}) })
$items.html(layui.laytpl(itemTpl).render({items: items})) $items.html(layui.laytpl(itemTpl).render({ items: items }))
return return
} }
@ -221,6 +230,7 @@
if (data.data.records.length > 0) { if (data.data.records.length > 0) {
var html = ''; var html = '';
data.data.records.forEach(function (item, i) { data.data.records.forEach(function (item, i) {
html += '<tr>'; html += '<tr>';
html += '<td><div class="list-img"><img src="image/img_01.png"><span>' + item.username + '</span></div></td>'; html += '<td><div class="list-img"><img src="image/img_01.png"><span>' + item.username + '</span></div></td>';
html += '<td>'; html += '<td>';
@ -230,6 +240,10 @@
html += '文件下载'; html += '文件下载';
} else if (item.type == 3) { } else if (item.type == 3) {
html += '文件更新'; html += '文件更新';
} else if (item.type == 4) {
html += '文件隐藏';
} else if (item.type == 5) {
html += '文件显示';
} }
html += '</td>'; html += '</td>';
html += '<td>' + item.fileName + '</td>'; html += '<td>' + item.fileName + '</td>';
@ -292,4 +306,4 @@
}); });
</script> </script>
<include src="./footer.html"></include> <include src="./footer.html"></include>

View File

@ -43,29 +43,31 @@
<div class="layui-form-item list"> <div class="layui-form-item list">
<label class="layui-form-label">文件名称:</label> <label class="layui-form-label">文件名称:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="name" lay-verify="required" lay-reqtext="请填写文件名称" <input type="text" name="name" lay-verify="required" lay-reqtext="请填写文件名称" placeholder="请填写文件名称" autocomplete="off" class="layui-input">
placeholder="请填写文件名称" autocomplete="off" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item list"> <div class="layui-form-item list">
<label class="layui-form-label">文件号:</label> <label class="layui-form-label">文件号:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="number" lay-verify="required" lay-reqtext="请填写文件号" <input type="text" name="number" lay-verify="required" lay-reqtext="请填写文件号" placeholder="请填写文件号" autocomplete="off" class="layui-input">
placeholder="请填写文件号" autocomplete="off" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item list"> <div class="layui-form-item list">
<label class="layui-form-label">拟稿人:</label> <label class="layui-form-label">拟稿人:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="createUser" lay-verify="required" lay-reqtext="请填写拟稿人" <input type="text" name="createUser" lay-verify="required" lay-reqtext="请填写拟稿人" placeholder="请填写拟稿人" autocomplete="off" class="layui-input">
placeholder="请填写拟稿人" autocomplete="off" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item list"> <div class="layui-form-item list">
<label class="layui-form-label">发布时间:</label> <label class="layui-form-label">发布时间:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="createTime" lay-verify="datetime" placeholder="请选择时间" <input type="text" name="createTime" lay-verify="datetime" placeholder="请选择时间" autocomplete="off" class="layui-input layui-time">
autocomplete="off" class="layui-input layui-time"> </div>
</div>
<div class="layui-form-item list">
<label class="layui-form-label">文件备注:</label>
<div class="layui-input-block">
<textarea name="note" maxlength="200" placeholder="请输入内容" class="layui-textarea"></textarea>
</div> </div>
</div> </div>
</div> </div>
@ -91,6 +93,7 @@
<div class="upload-form"> <div class="upload-form">
<button class="flie-btn" lay-submit lay-filter="formDemo">保存</button> <button class="flie-btn" lay-submit lay-filter="formDemo">保存</button>
<button type="reset" class="flie-btn flie-btn-primary">重置</button> <button type="reset" class="flie-btn flie-btn-primary">重置</button>
<button type="button" onclick="ddFile()">重置</button>
</div> </div>
</form> </form>
</div> </div>
@ -125,8 +128,7 @@
<!--文件夹--> <!--文件夹-->
<div class="con-list bg-w top20 add-border"> <div class="con-list bg-w top20 add-border">
<div class="name"> <div class="name">
<span class="font-14" id="folder-navigation"><i class="icon-back"></i><a data-id="0" <span class="font-14" id="folder-navigation"><i class="icon-back"></i><a data-id="0" data-name="全部文件">全部文件</a></span>
data-name="全部文件">全部文件</a></span>
<input type="hidden" id="navigation" value="0"> <input type="hidden" id="navigation" value="0">
</div> </div>
<div class="con-list-cn"> <div class="con-list-cn">
@ -164,9 +166,9 @@
var folderIds = [] var folderIds = []
var filesIds = [] var filesIds = []
$(function() { $(function () {
$(".click-history").click(function() { $(".click-history").click(function () {
$('.upload').show() $('.upload').show()
getFileList(fileAjaxData) getFileList(fileAjaxData)
}); });
@ -177,22 +179,22 @@
function getDingCode() { function getDingCode() {
dd.runtime.permission.requestAuthCode({ dd.runtime.permission.requestAuthCode({
corpId: corpId, corpId: corpId,
onSuccess: function(result) { onSuccess: function (result) {
this_code = result.code; this_code = result.code;
}, },
onFail: function(err) { onFail: function (err) {
console.log(err) console.log(err)
} }
}); });
} }
layui.use(['form', 'formSelects', 'upload', 'element', 'layer'], function() { layui.use(['form', 'formSelects', 'upload', 'element', 'layer'], function () {
var form = layui.form; var form = layui.form;
var formSelects = layui.formSelects; var formSelects = layui.formSelects;
var upload = layui.upload; var upload = layui.upload;
var element = layui.element; var element = layui.element;
var layer = layui.layer; var layer = layui.layer;
var renewaddIntervalScript = setInterval(function() { var renewaddIntervalScript = setInterval(function () {
var tmpHaveLogin = localStorage['haveLogin'] || false; var tmpHaveLogin = localStorage['haveLogin'] || false;
if (tmpHaveLogin) { if (tmpHaveLogin) {
clearInterval(renewaddIntervalScript); clearInterval(renewaddIntervalScript);
@ -200,7 +202,7 @@
} }
}, 500); }, 500);
form.on('radio(isPublic)', function(data) { form.on('radio(isPublic)', function (data) {
fileAjaxData.isPublic = data.value fileAjaxData.isPublic = data.value
getMainDeptList(fileAjaxData.isPublic) getMainDeptList(fileAjaxData.isPublic)
}); });
@ -218,16 +220,18 @@
}, },
field: 'file', field: 'file',
accept: 'file' accept: 'file'
// ,acceptMime: '.docx,.doc,.xlsx,.xls,.pdf,.ppt,pptx,.png,.jpg,.jpeg,.gif,.csv' // ,acceptMime: '.docx,.doc,.xlsx,.xls,.pdf,.ppt,pptx,.png,.jpg,.jpeg,.gif,.csv'
, ,
acceptMime: '*', acceptMime: '*',
multiple: false //多文件 multiple: false //多文件
, ,
number: 1, number: 1,
before: function(obj) { before: function (obj) {
this.data.code = this_code; this.data.code = this_code;
console.log(this.data.code);
getDingCode(); getDingCode();
obj.preview(function(index, file, result) { obj.preview(function (index, file, result) {
uploadNum++ uploadNum++
pressw = '' pressw = ''
// console.log('清空当前进度1' + pressw); // console.log('清空当前进度1' + pressw);
@ -242,18 +246,18 @@
var n = 0 var n = 0
var that = $('.layui-upload-list .list') var that = $('.layui-upload-list .list')
uploadTime = setInterval( uploadTime = setInterval(
function() { //按照时间随机生成一个小于95的进度具体数值可以自己调整 function () { //按照时间随机生成一个小于95的进度具体数值可以自己调整
n = n + Math.random() * 10 | 0; n = n + Math.random() * 10 | 0;
if (n > 95) { if (n > 95) {
n = 95; n = 95;
clearInterval(uploadTime); clearInterval(uploadTime);
} }
that.eq(uploadNum - 1).find('i').css('width', that.eq(uploadNum - 1).find('i').css('width',
n + '%') n + '%')
}, 50 + Math.random() * 100); }, 50 + Math.random() * 100);
}); });
}, },
done: function(res, index, upload) { done: function (res, index, upload) {
if (res.code == 200) { if (res.code == 200) {
pressw = '' pressw = ''
// console.log('清空当前进度2' + pressw); // console.log('清空当前进度2' + pressw);
@ -262,7 +266,7 @@
uploadNum + '" data-id="' + res.data.id + '" data-filename="' + uploadNum + '" data-id="' + res.data.id + '" data-filename="' +
res.data.name + '" data-filesize="' + res.data.size + res.data.name + '" data-filesize="' + res.data.size +
'" data-spaceid="' + res.data.spaceId + '" value="' + res.data '" data-spaceid="' + res.data.spaceId + '" value="' + res.data
.url + '" />'; .url + '" />';
clearInterval(uploadTime); clearInterval(uploadTime);
$('.progress' + uploadNum).css('width', '100%'); $('.progress' + uploadNum).css('width', '100%');
@ -278,16 +282,16 @@
}); });
} }
}, },
allDone: function(obj) { allDone: function (obj) {
clearInterval(uploadTime); clearInterval(uploadTime);
$('.layui-upload-list .list i').css('width', '100%') $('.layui-upload-list .list i').css('width', '100%')
} }
}); });
//选择文件夹 //选择文件夹
form.on('submit(formFile)', function(data) { form.on('submit(formFile)', function (data) {
var navName = '' var navName = ''
$('#folder-navigation a').each(function() { $('#folder-navigation a').each(function () {
if ($(this).attr('data-id') == $('#navigation').val()) { if ($(this).attr('data-id') == $('#navigation').val()) {
navName = $(this).attr('data-name') navName = $(this).attr('data-name')
folderIds.push({ folderIds.push({
@ -296,7 +300,7 @@
}) })
} }
}) })
$('.list-content#Chart ul li').each(function() { $('.list-content#Chart ul li').each(function () {
if ($(this).attr('class') == if ($(this).attr('class') ==
'list upload_selection upload_list_acive') { 'list upload_selection upload_list_acive') {
filesIds.push({ filesIds.push({
@ -314,7 +318,8 @@
}) })
//监听提交 //监听提交
form.on('submit(formDemo)', function(data) { form.on('submit(formDemo)', function (data) {
console.log(data);
// console.log('提交时当前进度:' + pressw); // console.log('提交时当前进度:' + pressw);
if (pressw != '100%') { if (pressw != '100%') {
// console.log('不等于:' + pressw); // console.log('不等于:' + pressw);
@ -328,23 +333,25 @@
var dingFileName = that.data('filename'); var dingFileName = that.data('filename');
var dingFileSize = that.data('filesize'); var dingFileSize = that.data('filesize');
var dingSpaceId = that.data('spaceid'); var dingSpaceId = that.data('spaceid');
filesIds.forEach(function(item) { filesIds.forEach(function (item) {
arr2.push(item.id) arr2.push(item.id)
}) })
if (folderIds.length == 0) { if (folderIds.length == 0) {
layer.msg("请选择需要更新的文件", { layer.msg("请选择需要更新的文件", {
icon: 5, icon: 5,
shift: 6 shift: 6
}, function() { }, function () {
$(".click-history").click(); $(".click-history").click();
}); });
return false; return false;
} }
var ajaxData = { var ajaxData = {
createTime: data.field.createTime + " 00:00:00", createTime: data.field.createTime + " 00:00:00",
createUser: '', createUser: '',
deptId: data.field.deptId, deptId: data.field.deptId,
drafter: data.field.createUser, drafter: data.field.createUser,
note: data.field.note,
//folderIds: folderIds.map(function(item){ return item.id }), //folderIds: folderIds.map(function(item){ return item.id }),
// groupId: "", // groupId: "",
// id: '', // id: '',
@ -376,7 +383,7 @@
type: "post", type: "post",
contentType: "application/json", contentType: "application/json",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
window.location = 'renew.html'; window.location = 'renew.html';
//window.location.reload() //window.location.reload()
@ -384,7 +391,7 @@
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
console.log(data); console.log(data);
layer.msg(data.responseJSON.msg) layer.msg(data.responseJSON.msg)
} }
@ -408,11 +415,11 @@
type: "get", type: "get",
contentType: "application/x-www-form-urlencoded", contentType: "application/x-www-form-urlencoded",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
$('.renew-list select').empty() $('.renew-list select').empty()
if (data.data.length > 0) { if (data.data.length > 0) {
data.data.forEach(function(item) { data.data.forEach(function (item) {
$('.renew-list select').append( $('.renew-list select').append(
'<option value="' + item.id + '">' + '<option value="' + item.id + '">' +
item.name + '</option>') item.name + '</option>')
@ -423,7 +430,7 @@
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
console.log(data); console.log(data);
} }
}); });
@ -434,7 +441,7 @@
//删除文件路径 //删除文件路径
function folderDel(obj) { function folderDel(obj) {
folderIds.forEach(function(item, i) { folderIds.forEach(function (item, i) {
if (item.id == $(obj).attr('data-id')) { if (item.id == $(obj).attr('data-id')) {
folderIds.splice(i, 1) folderIds.splice(i, 1)
} }
@ -453,7 +460,7 @@
function init() { function init() {
//返回事件 //返回事件
$('.con-list .name span .icon-back').off("click").click(function() { $('.con-list .name span .icon-back').off("click").click(function () {
var that = $(this) var that = $(this)
if ($("#navigation").val() != 0) { if ($("#navigation").val() != 0) {
fileAjaxData.parentFolderId = $('.con-list .name span a').eq(-2).attr('data-id') fileAjaxData.parentFolderId = $('.con-list .name span a').eq(-2).attr('data-id')
@ -463,10 +470,10 @@
} }
}); });
//路由事件 //路由事件
$('#folder-navigation a').off("click").click(function() { $('#folder-navigation a').off("click").click(function () {
var that = $(this) var that = $(this)
fileAjaxData.parentFolderId = that.attr('data-id') fileAjaxData.parentFolderId = that.attr('data-id')
$('.con-list .name span a').each(function() { $('.con-list .name span a').each(function () {
if ($(this).index() >= that.index()) { if ($(this).index() >= that.index()) {
$('.con-list .name span a').eq($(this).index()).remove() $('.con-list .name span a').eq($(this).index()).remove()
} }
@ -504,11 +511,11 @@
type: "get", type: "get",
contentType: "application/x-www-form-urlencoded", contentType: "application/x-www-form-urlencoded",
dataType: "json", dataType: "json",
success: function(data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
init() init()
if (data.data.folders.length > 0) { if (data.data.folders.length > 0) {
data.data.folders.forEach(function(item) { data.data.folders.forEach(function (item) {
var html1 = var html1 =
'<li class="list" onclick="openFolder(this)" ondblclick="openFolder(this)" data-id="' + '<li class="list" onclick="openFolder(this)" ondblclick="openFolder(this)" data-id="' +
item.id + '" data-name="' + item.name + '">' + item.id + '" data-name="' + item.name + '">' +
@ -520,7 +527,7 @@
}) })
} }
if (data.data.files.length > 0) { if (data.data.files.length > 0) {
data.data.files.forEach(function(item) { data.data.files.forEach(function (item) {
var html1 = var html1 =
'<li class="list upload_selection" onclick="choiceFolder(this)" data-id="' + '<li class="list upload_selection" onclick="choiceFolder(this)" data-id="' +
item.id + '" data-name="' + item.name + '">' + item.id + '" data-name="' + item.name + '">' +
@ -542,11 +549,39 @@
layer.msg(data.msg) layer.msg(data.msg)
} }
}, },
error: function(data) { error: function (data) {
console.log(data); console.log(data);
} }
}); });
} }
function ddFile(params) {
dd.biz.util.uploadAttachment({
types: ["photo"],
image: { "multiple": true, "compress": false, "max": 9, "spaceId": "12345" },
compress: true,
multiple: false,
max: 9,
isCopy: 0,
spaceId: "123",
space: { "corpId": "xxx3020", "spaceId": "12345", "isCopy": 1, "max": 9 },
file: { "spaceId": "12345", "max": 1 },
onSuccess: function (res) {
// 调用成功时回调
console.log(res)
},
onFail: function (err) {
// 调用失败时回调
console.log(err)
}
});
}
</script> </script>
<include src="./footer.html"></include> <include src="./footer.html"></include>