钉钉修改

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);
}
.list-img {
.onClickList .list-img {
position: absolute;
right: 30px;
display: none;
@ -1850,6 +1850,8 @@ a.color-b:hover {
width: 25px;
}
.file-tit-btn {
width: 100px;
height: 30px;
@ -1999,6 +2001,105 @@ a.color-b:hover {
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 {
position: absolute;
right: 200px;

252
dist/hidefile.html vendored
View File

@ -343,8 +343,29 @@
</form>
</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="name" id="phone-menu">
<!-- <a href="javascript:;" class="active">公共文件</a>
@ -368,9 +389,14 @@
</div>
<!--pc-->
<div class="name">
<span class="font-14" id="folder-navigation"><i class="icon-back"></i><a href="hidefile.html"
data-id="0">全部文件</a></span>
<span class="font-14" id="folder-navigation"><i class="icon-back"></i><a href="hidefile.html" data-id="0">全部文件</a></span>
<input type="hidden" id="navigation" value="">
<div>
<div class="listBtn">
<button type="button" onclick="editorName()">修改名字</button>
<button type="button" onclick="hgiddenFiles()">显示文件</button>
<button type="button " onclick="editorButton(this)">编辑文件</button>
</div>
<ul class="con-list-mero pc-block" role="tablist">
<li role="presentation" class="active">
<a class="img-list" href="#Chart" aria-controls="Chart" role="tab" data-toggle="tab">&nbsp;</a>
@ -380,6 +406,8 @@
</li>
</ul>
</div>
</div>
<div class="con-list-cn tab-content">
<div class="list-content active tab-pane" role="tabpanel" id="Chart">
<ul></ul>
@ -464,7 +492,25 @@
startTime: '',
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;
$(function () {
@ -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) {
dataEditor.editorData = []
dataEditor.editorIf = true
ajaxData.parentFolderId = $(obj).attr('data-id')
getFileList(ajaxData)
$("#navigation").val($(obj).attr('data-id'));
@ -768,27 +864,71 @@
}
//隐藏文件
function hgiddenFiles(obj) {
var arr2 = dataEditor.editorData.some(function (v) {
return v.folder == true;
});
console.log(arr2);
if (arr2) {
layer.msg("不能显示文件夹")
return
}
layer.confirm('确认显示这些文件吗?', {
btn: ['确认', '取消'] //可以无限个按钮
,
}, function (index, layero) {
let objD = {
fileIds: [],
isShow: 1
}
for (let index = 0; index < dataEditor.editorData.length; index++) {
objD.fileIds.push(dataEditor.editorData[index].id)
}
let contentType = "application/json"
let url = host + '/ding/file/disPlayFiles'
dxtcRequest('post', url, JSON.stringify(objD), function name(data) {
if (data.code == 200) {
console.log(data);
layer.msg('显示成功')
getFileList(ajaxData)
} else {
layer.msg(data.msg)
}
}, contentType)
layer.closeAll();
}, function (index) {
//按钮【按钮二】的回调
layer.closeAll();
});
return false;
}
function hideFile(obj) {
layer.confirm('确认显示这个文件吗?', {
layer.confirm('确认隐藏这个文件吗?', {
btn: ['确认', '取消'] //可以无限个按钮
,
}, function (index, layero) {
//按钮【按钮一】的回调
$.ajax({
url: host + '/ding/file/disPlayFile'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10),
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:1
isShow: 0
},
type: "get",
contentType: "application/x-www-form-urlencoded",
dataType: "json",
success: function (data) {
if (data.code == 200) {
layer.msg('显示成功')
layer.msg('隐藏成功')
getFileList(ajaxData)
} else {
layer.msg(data.msg)
@ -797,6 +937,7 @@
},
error: function (data) {
console.log(data);
layer.msg(data.responseJSON.msg)
}
})
}, function (index) {
@ -805,6 +946,76 @@
});
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) {
console.log(ajaxData, 'getFileList');
@ -820,19 +1031,20 @@
contentType: "application/x-www-form-urlencoded",
dataType: "json",
success: function (data) {
dataEditor.rows = data.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 + '">' +
'<li class="list onClickListOne onClickList" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this)" data-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="text-two-hide list-hight">' + item.name + '</div>' +
'</li>'
$('.list-content#Chart ul').append(html1)
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 +
'</span></div></td>' +
'<td></td>' +
@ -850,26 +1062,24 @@
if (data.data.files.length > 0) {
data.data.files.forEach(function (item) {
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>'
+ '<div class="more-edit" onclick="hideFile(this)" data-id="' + item.id + '" data-name="' + item.name + '">显示</div>'
+ '</div>'+
'<div class="img" onclick="openFile(this)" data-id="' +
'<img class="list-img" src="./image/icon_30.png">' +
'<div class="img onClickListTwo" data-if="2" data-click="1" onclick="openIf(this)" data-id="' +
item.id + '" data-name="' + item.name + '" data-type="' + item
.type + '" data-url="' + item.url + '" data-time="' + item
.createTime + '" data-dingid="' + item.dingFileId +
'" 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>' +
'<div class="text-two-hide list-hight">' + item.name + '</div>' +
'</li>'
$('.list-content#Chart ul').append(html1)
var html2 = '<tr>' +
'<td>'
+ '<div class="more">'

117
dist/index.html vendored
View File

@ -343,8 +343,30 @@
</form>
</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="name" id="phone-menu">
<!-- <a href="javascript:;" class="active">公共文件</a>
@ -378,7 +400,7 @@
<input type="hidden" id="navigation" value="">
<div>
<div class="listBtn">
<button type="button"></button>
<button type="button" onclick="editorName()">修改名字</button>
<button type="button" onclick="hgiddenFiles()">隐藏文件</button>
<button type="button " onclick="editorButton(this)">编辑文件</button>
</div>
@ -478,6 +500,7 @@
let dataEditor = {
editorIf: true,
editorData: [],
rows: []
}
function editorButton(obj) {
if (dataEditor.editorIf) {
@ -708,7 +731,13 @@
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) {
@ -752,6 +781,7 @@
function openFolder(obj) {
dataEditor.editorData = []
dataEditor.editorIf = true
ajaxData.parentFolderId = $(obj).attr('data-id')
getFileList(ajaxData)
$("#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) {
var arr2 = dataEditor.editorData.some(function (v) {
return v.folder == true;
});
if (arr2) {
layer.msg("不能隐藏文件夹")
return
}
layer.confirm('确认隐藏这个文件吗?', {
btn: ['确认', '取消'] //可以无限个按钮
@ -948,12 +1049,13 @@
contentType: "application/x-www-form-urlencoded",
dataType: "json",
success: function (data) {
dataEditor.rows = data.data
if (data.code == 200) {
init()
if (data.data.folders.length > 0) {
data.data.folders.forEach(function (item) {
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 + '">' +
'<img class="list-img" src="./image/icon_30.png">' +
'<div class="img"> <img src="image/' + (item.folderType == "0" ?
@ -962,7 +1064,7 @@
'</li>'
$('.list-content#Chart ul').append(html1)
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" ?
"icon_11.png" : "icon_11_2.png") + '"><span>' + item.name +
'</span></div></td>' +
@ -979,17 +1081,12 @@
})
$(".onClickList").on("click", () => {
})
$(".onClickList").on("ondblclick", () => {
})
}
if (data.data.files.length > 0) {
data.data.files.forEach(function (item) {
var html1 =
'<li class="list click-download ps" >'
'<li class="list click-download ps onClickList" >'
+ (item.isPublic == "0" ?
"<span class='internal'></span>" : "") +

137
dist/inside.html vendored
View File

@ -344,8 +344,23 @@
</form>
</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="name" id="phone-menu">
<!-- <a href=" index.html">公共文件</a>
@ -373,7 +388,7 @@
<input type="hidden" id="navigation" value="">
<div>
<div class="listBtn">
<button type="button"></button>
<button type="button" onclick="editorName()">修改名字</button>
<button type="button" onclick="hgiddenFiles()">隐藏文件</button>
<button type="button " onclick="editorButton(this)">编辑文件</button>
</div>
@ -474,6 +489,7 @@
let dataEditor = {
editorIf: true,
editorData: [],
rows: []
}
function editorButton(obj) {
if (dataEditor.editorIf) {
@ -707,6 +723,9 @@
//打开文件夹
function openFolder(obj) {
dataEditor.editorData = []
dataEditor.editorIf = true
console.log(obj);
ajaxData.parentFolderId = $(obj).attr('data-id')
getFileList(ajaxData)
$("#navigation").val($(obj).attr('data-id'))
@ -744,9 +763,15 @@
}
function openIf(data) {
console.log(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) {
@ -787,15 +812,75 @@
}
}
function openFolder(obj) {
dataEditor.editorData = []
dataEditor.editorIf = true
ajaxData.parentFolderId = $(obj).attr('data-id')
getFileList(ajaxData)
$("#navigation").val($(obj).attr('data-id'));
$('#folder-navigation').append('<a data-id="' + $(obj).attr('data-id') + '"> > ' + $(obj).text() + '</a>');
serch_flag = 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 downloadfile(obj) {
var id = $(obj).data('fileid');
@ -872,6 +957,7 @@
});
if (arr2) {
layer.msg("不能隐藏文件夹")
return
}
layer.confirm('确认隐藏这个文件吗?', {
btn: ['确认', '取消'] //可以无限个按钮
@ -880,7 +966,7 @@
let objD = {
fileIds: [],
isShow: 0
isShow: 1
}
for (let index = 0; index < dataEditor.editorData.length; index++) {
@ -926,20 +1012,22 @@
contentType: "application/x-www-form-urlencoded",
dataType: "json",
success: function (data) {
dataEditor.rows = data.data
if (data.code == 200) {
init()
if (data.data.folders.length > 0) {
data.data.folders.forEach(function (item) {
console.log("======" + item.id + '=====');
var html1 =
'<li class="list" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this) data-id="' +
item.id + '">' +
'<li class="list onClickListOne onClickList" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this)" data-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="text-two-hide list-hight">' + item.name + '</div>' +
'</li>'
$('.list-content#Chart ul').append(html1)
var html2 = '<tr>' +
'<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 +
'<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 +
'</span></div></td>' +
'<td></td>' +
'<td></td>' +
@ -956,19 +1044,16 @@
if (data.data.files.length > 0) {
data.data.files.forEach(function (item) {
var html1 =
'<li class="list click-download" >'
+ '<div class="more">'
+ '<span>...</span>'
+ '<div class="more-edit" onclick="hideFile(this)" data-id="' + item.id + '" data-name="' + item.name + '">隐藏</div>'
+ '</div>' +
'<div class="img" onclick="openFile(this)" data-id="' +
item.id + '" data-name="' + item.name + '" data-type="' + item
'<li class="list click-download ps onClickList" >'
+
'<img class="list-img" src="./image/icon_30.png">' +
'<div class="img onClickListTwo" data-if="2" data-click="1" onclick="openIf(this)" data-id="' + item.id +
'" data-name="' + item.name + '" data-type="' + item
.type + '" data-url="' + item.url + '" data-time="' + item
.createTime + '" data-dingid="' + item.dingFileId +
'" 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>' +
'<div class="text-two-hide list-hight">' + item.name + '</div>' +
'</li>'
@ -980,8 +1065,6 @@
+ '<span onclick="showBtn(this)" >...</span>'
+ '<div class="more-edit" onclick="hideFile(this)" data-id="' + item.id + '" data-name="' + item.name + '">隐藏</div>'
+ '</div>'
+ '<div class="list-img" onclick="openFile(this)" data-id="' +
item.id + '" data-name="' + item.name + '" data-type="' + item
.type + '" data-url="' + item.url + '" data-time="' + item

1
dist/js/script.js vendored
View File

@ -82,6 +82,7 @@ $(document).contextmenu(function (e) {
})
//判断是否在钉钉内
console.log(dd);
if (dd.env.platform !== "notInDingTalk") {
console.log('进入钉钉了');
// var host = 'http://192.168.0.184:12306'

197
dist/organization.html vendored
View File

@ -302,9 +302,9 @@
<div class="form-control__input">
<div class="js_party_select_result">
<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>
<input id="deptInput" class="form-input" type="hidden" name="policy_dept_ids" value=""
style="display: none;">
<input id="deptInput" class="form-input" type="hidden" name="policy_dept_ids" value="" style="display: none;">
</div>
</div>
</div>
@ -319,8 +319,7 @@
</div>
<div class="con-text bg-w hide-mobile">
<div class="name add-border">
<input type="text" name="" value="组织名称01" data-id="" id="folder-name" disabled="disabled"
class="name-input">
<input type="text" name="" value="组织名称01" data-id="" id="folder-name" disabled="disabled" class="name-input">
<div class="name-btn name-btn-none">
<button class="btn-edit btn-edit-op"><img src="image/icon_32.png"></button>
</div>
@ -333,16 +332,13 @@
<div class="org-list">
<ul class="org-ul " role="tablist">
<li role="presentation" class="active">
<a href="#Admin" aria-controls="Admin" role="tab" data-toggle="tab" data-role-id="3"
class="tab-menu-admin">管理员</a>
<a href="#Admin" aria-controls="Admin" role="tab" data-toggle="tab" data-role-id="3" class="tab-menu-admin">管理员</a>
</li>
<li role="presentation">
<a href="#opera" aria-controls="opera" role="tab" data-toggle="tab" data-role-id="5"
class="tab-menu-opera">操作员</a>
<a href="#opera" aria-controls="opera" role="tab" data-toggle="tab" data-role-id="5" class="tab-menu-opera">操作员</a>
</li>
<li role="presentation">
<a href="#look" aria-controls="look" role="tab" data-toggle="tab" data-role-id="6"
class="tab-menu-look">查看员</a>
<a href="#look" aria-controls="look" role="tab" data-toggle="tab" data-role-id="6" class="tab-menu-look">查看员</a>
</li>
</ul>
<div class="tab-content org-con top20">
@ -352,8 +348,7 @@
<p>1. 可查看、添加和下载授权组织内部文件、公共文件; </p>
<p>2. 创建和修改授权组织 “操作员”</p>
<p>3. 创建授权组织内部文件分类</p>
<a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="3"
onclick="choosePeople(this, 'Admin')">
<a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="3" onclick="choosePeople(this, 'Admin')">
+添加人员
</a>
</div>
@ -365,8 +360,7 @@
<div class="org-remarks">
<p>操作员权限</p>
<p>1. 可查看、添加和下载授权组织内部文件、公共文件; </p>
<a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="5"
onclick="choosePeople(this, 'opera')">
<a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="5" onclick="choosePeople(this, 'opera')">
+添加人员
</a>
</div>
@ -378,8 +372,7 @@
<div class="org-remarks">
<p>查看员权限</p>
<p>1. 可查看和下载授权组织内部文件、公共文件; </p>
<a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="6"
onclick="choosePeople(this, 'look')">
<a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="6" onclick="choosePeople(this, 'look')">
+添加人员
</a>
</div>
@ -392,8 +385,61 @@
</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">
<div class="con-content">
<div class="con-mune bg-w">
@ -415,6 +461,8 @@
{{# }); }}
</ul>
</div>
</div>
</script>
@ -434,6 +482,16 @@
<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>
var fileAjaxData = {
current: '',
isPublic: 1,
parentFolderId: 0,
size: '',
isUpload: 1
}
let dataOrganization = {
state: false
}
//修改名称
$(".btn-edit-op").click(function () {
$(".name-btn-active").show();
@ -660,7 +718,7 @@
'" data-folder-name="' + value.deptName + '">设置人员</span>';
if (value.hasChildren) {
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>";
});
@ -668,8 +726,44 @@
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) {
var id = $(obj).data('id');
zuId = $(obj).data('folder-id');
var roleId = $(obj).data('role-id');
@ -681,6 +775,12 @@
}
// 选中组织
function change(obj) {
console.log(dataOrganization.state);
if (dataOrganization.state) {
$('.upload').show()
getFileList(fileAjaxData)
return
}
shangId = $(obj).data('id');
zuId = $(obj).data('folder-id');
chuFolderId = zuId
@ -893,6 +993,66 @@
}
}, '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>
@ -918,4 +1078,5 @@
});
</script>
</body>
</html>

14
dist/record.html vendored
View File

@ -323,6 +323,8 @@
<option value="1">文件上传</option>
<option value="2">文件下载</option>
<option value="3">文件更新</option>
<option value="4">文件隐藏</option>
<option value="5">文件显示</option>
</select>
</div>
</div>
@ -439,6 +441,7 @@
logsData.scope = data.field.fileType
logsData.startTime = data.field.times.split(' - ')[0] || ''
logsData.endTime = data.field.times.split(' - ')[1] || ''
console.log(logsData);
getLogs()
return false;
});
@ -497,6 +500,12 @@
case '3':
item.type = '文件更新';
break;
case '4':
item.type = '文件隐藏';
break;
case '5':
item.type = '文件显示';
break;
default:
item.type = '未知类型';
break;
@ -511,6 +520,7 @@
if (data.data.records.length > 0) {
var html = '';
data.data.records.forEach(function (item, i) {
html += '<tr>';
html += '<td><div class="list-img"><img src="image/img_01.png"><span>' + item.username + '</span></div></td>';
html += '<td>';
@ -520,6 +530,10 @@
html += '文件下载';
} else if (item.type == 3) {
html += '文件更新';
} else if (item.type == 4) {
html += '文件隐藏';
} else if (item.type == 5) {
html += '文件显示';
}
html += '</td>';
html += '<td>' + item.fileName + '</td>';

55
dist/renewadd.html vendored
View File

@ -333,29 +333,31 @@
<div class="layui-form-item list">
<label class="layui-form-label">文件名称:</label>
<div class="layui-input-block">
<input type="text" name="name" lay-verify="required" lay-reqtext="请填写文件名称"
placeholder="请填写文件名称" autocomplete="off" class="layui-input">
<input type="text" name="name" lay-verify="required" lay-reqtext="请填写文件名称" placeholder="请填写文件名称" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item list">
<label class="layui-form-label">文件号:</label>
<div class="layui-input-block">
<input type="text" name="number" lay-verify="required" lay-reqtext="请填写文件号"
placeholder="请填写文件号" autocomplete="off" class="layui-input">
<input type="text" name="number" lay-verify="required" lay-reqtext="请填写文件号" placeholder="请填写文件号" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item list">
<label class="layui-form-label">拟稿人:</label>
<div class="layui-input-block">
<input type="text" name="createUser" lay-verify="required" lay-reqtext="请填写拟稿人"
placeholder="请填写拟稿人" autocomplete="off" class="layui-input">
<input type="text" name="createUser" lay-verify="required" lay-reqtext="请填写拟稿人" placeholder="请填写拟稿人" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item list">
<label class="layui-form-label">发布时间:</label>
<div class="layui-input-block">
<input type="text" name="createTime" lay-verify="datetime" placeholder="请选择时间"
autocomplete="off" class="layui-input layui-time">
<input type="text" name="createTime" lay-verify="datetime" placeholder="请选择时间" 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>
@ -381,6 +383,7 @@
<div class="upload-form">
<button class="flie-btn" lay-submit lay-filter="formDemo">保存</button>
<button type="reset" class="flie-btn flie-btn-primary">重置</button>
<button type="button" onclick="ddFile()">重置</button>
</div>
</form>
</div>
@ -415,8 +418,7 @@
<!--文件夹-->
<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>
<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">
@ -516,6 +518,8 @@
number: 1,
before: function (obj) {
this.data.code = this_code;
console.log(this.data.code);
getDingCode();
obj.preview(function (index, file, result) {
uploadNum++
@ -605,6 +609,7 @@
//监听提交
form.on('submit(formDemo)', function (data) {
console.log(data);
// console.log('提交时当前进度:' + pressw);
if (pressw != '100%') {
// console.log('不等于:' + pressw);
@ -630,11 +635,13 @@
});
return false;
}
var ajaxData = {
createTime: data.field.createTime + " 00:00:00",
createUser: '',
deptId: data.field.deptId,
drafter: data.field.createUser,
note: data.field.note,
//folderIds: folderIds.map(function(item){ return item.id }),
// groupId: "",
// id: '',
@ -837,6 +844,34 @@
}
});
}
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>

View File

@ -53,8 +53,29 @@
</form>
</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="name" id="phone-menu">
<!-- <a href="javascript:;" class="active">公共文件</a>
@ -78,9 +99,14 @@
</div>
<!--pc-->
<div class="name">
<span class="font-14" id="folder-navigation"><i class="icon-back"></i><a href="hidefile.html"
data-id="0">全部文件</a></span>
<span class="font-14" id="folder-navigation"><i class="icon-back"></i><a href="hidefile.html" data-id="0">全部文件</a></span>
<input type="hidden" id="navigation" value="">
<div>
<div class="listBtn">
<button type="button" onclick="editorName()">修改名字</button>
<button type="button" onclick="hgiddenFiles()">显示文件</button>
<button type="button " onclick="editorButton(this)">编辑文件</button>
</div>
<ul class="con-list-mero pc-block" role="tablist">
<li role="presentation" class="active">
<a class="img-list" href="#Chart" aria-controls="Chart" role="tab" data-toggle="tab">&nbsp;</a>
@ -90,6 +116,8 @@
</li>
</ul>
</div>
</div>
<div class="con-list-cn tab-content">
<div class="list-content active tab-pane" role="tabpanel" id="Chart">
<ul></ul>
@ -174,7 +202,25 @@
startTime: '',
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;
$(function () {
@ -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) {
dataEditor.editorData = []
dataEditor.editorIf = true
ajaxData.parentFolderId = $(obj).attr('data-id')
getFileList(ajaxData)
$("#navigation").val($(obj).attr('data-id'));
@ -478,27 +574,71 @@
}
//隐藏文件
function hgiddenFiles(obj) {
var arr2 = dataEditor.editorData.some(function (v) {
return v.folder == true;
});
console.log(arr2);
if (arr2) {
layer.msg("不能显示文件夹")
return
}
layer.confirm('确认显示这些文件吗?', {
btn: ['确认', '取消'] //可以无限个按钮
,
}, function (index, layero) {
let objD = {
fileIds: [],
isShow: 1
}
for (let index = 0; index < dataEditor.editorData.length; index++) {
objD.fileIds.push(dataEditor.editorData[index].id)
}
let contentType = "application/json"
let url = host + '/ding/file/disPlayFiles'
dxtcRequest('post', url, JSON.stringify(objD), function name(data) {
if (data.code == 200) {
console.log(data);
layer.msg('显示成功')
getFileList(ajaxData)
} else {
layer.msg(data.msg)
}
}, contentType)
layer.closeAll();
}, function (index) {
//按钮【按钮二】的回调
layer.closeAll();
});
return false;
}
function hideFile(obj) {
layer.confirm('确认显示这个文件吗?', {
layer.confirm('确认隐藏这个文件吗?', {
btn: ['确认', '取消'] //可以无限个按钮
,
}, function (index, layero) {
//按钮【按钮一】的回调
$.ajax({
url: host + '/ding/file/disPlayFile'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10),
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:1
isShow: 0
},
type: "get",
contentType: "application/x-www-form-urlencoded",
dataType: "json",
success: function (data) {
if (data.code == 200) {
layer.msg('显示成功')
layer.msg('隐藏成功')
getFileList(ajaxData)
} else {
layer.msg(data.msg)
@ -507,6 +647,7 @@
},
error: function (data) {
console.log(data);
layer.msg(data.responseJSON.msg)
}
})
}, function (index) {
@ -515,6 +656,76 @@
});
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) {
console.log(ajaxData, 'getFileList');
@ -530,19 +741,20 @@
contentType: "application/x-www-form-urlencoded",
dataType: "json",
success: function (data) {
dataEditor.rows = data.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 + '">' +
'<li class="list onClickListOne onClickList" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this)" data-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="text-two-hide list-hight">' + item.name + '</div>' +
'</li>'
$('.list-content#Chart ul').append(html1)
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 +
'</span></div></td>' +
'<td></td>' +
@ -560,26 +772,24 @@
if (data.data.files.length > 0) {
data.data.files.forEach(function (item) {
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>'
+ '<div class="more-edit" onclick="hideFile(this)" data-id="' + item.id + '" data-name="' + item.name + '">显示</div>'
+ '</div>'+
'<div class="img" onclick="openFile(this)" data-id="' +
'<img class="list-img" src="./image/icon_30.png">' +
'<div class="img onClickListTwo" data-if="2" data-click="1" onclick="openIf(this)" data-id="' +
item.id + '" data-name="' + item.name + '" data-type="' + item
.type + '" data-url="' + item.url + '" data-time="' + item
.createTime + '" data-dingid="' + item.dingFileId +
'" 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>' +
'<div class="text-two-hide list-hight">' + item.name + '</div>' +
'</li>'
$('.list-content#Chart ul').append(html1)
var html2 = '<tr>' +
'<td>'
+ '<div class="more">'

View File

@ -53,8 +53,30 @@
</form>
</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="name" id="phone-menu">
<!-- <a href="javascript:;" class="active">公共文件</a>
@ -88,7 +110,7 @@
<input type="hidden" id="navigation" value="">
<div>
<div class="listBtn">
<button type="button"></button>
<button type="button" onclick="editorName()">修改名字</button>
<button type="button" onclick="hgiddenFiles()">隐藏文件</button>
<button type="button " onclick="editorButton(this)">编辑文件</button>
</div>
@ -188,6 +210,7 @@
let dataEditor = {
editorIf: true,
editorData: [],
rows: []
}
function editorButton(obj) {
if (dataEditor.editorIf) {
@ -418,7 +441,13 @@
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) {
@ -462,6 +491,7 @@
function openFolder(obj) {
dataEditor.editorData = []
dataEditor.editorIf = true
ajaxData.parentFolderId = $(obj).attr('data-id')
getFileList(ajaxData)
$("#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) {
var arr2 = dataEditor.editorData.some(function (v) {
return v.folder == true;
});
if (arr2) {
layer.msg("不能隐藏文件夹")
return
}
layer.confirm('确认隐藏这个文件吗?', {
btn: ['确认', '取消'] //可以无限个按钮
@ -658,12 +759,13 @@
contentType: "application/x-www-form-urlencoded",
dataType: "json",
success: function (data) {
dataEditor.rows = data.data
if (data.code == 200) {
init()
if (data.data.folders.length > 0) {
data.data.folders.forEach(function (item) {
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 + '">' +
'<img class="list-img" src="./image/icon_30.png">' +
'<div class="img"> <img src="image/' + (item.folderType == "0" ?
@ -672,7 +774,7 @@
'</li>'
$('.list-content#Chart ul').append(html1)
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" ?
"icon_11.png" : "icon_11_2.png") + '"><span>' + item.name +
'</span></div></td>' +
@ -689,17 +791,12 @@
})
$(".onClickList").on("click", () => {
})
$(".onClickList").on("ondblclick", () => {
})
}
if (data.data.files.length > 0) {
data.data.files.forEach(function (item) {
var html1 =
'<li class="list click-download ps" >'
'<li class="list click-download ps onClickList" >'
+ (item.isPublic == "0" ?
"<span class='internal'></span>" : "") +

View File

@ -54,8 +54,23 @@
</form>
</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="name" id="phone-menu">
<!-- <a href=" index.html">公共文件</a>
@ -83,7 +98,7 @@
<input type="hidden" id="navigation" value="">
<div>
<div class="listBtn">
<button type="button"></button>
<button type="button" onclick="editorName()">修改名字</button>
<button type="button" onclick="hgiddenFiles()">隐藏文件</button>
<button type="button " onclick="editorButton(this)">编辑文件</button>
</div>
@ -184,6 +199,7 @@
let dataEditor = {
editorIf: true,
editorData: [],
rows: []
}
function editorButton(obj) {
if (dataEditor.editorIf) {
@ -417,6 +433,9 @@
//打开文件夹
function openFolder(obj) {
dataEditor.editorData = []
dataEditor.editorIf = true
console.log(obj);
ajaxData.parentFolderId = $(obj).attr('data-id')
getFileList(ajaxData)
$("#navigation").val($(obj).attr('data-id'))
@ -454,9 +473,15 @@
}
function openIf(data) {
console.log(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) {
@ -497,15 +522,75 @@
}
}
function openFolder(obj) {
dataEditor.editorData = []
dataEditor.editorIf = true
ajaxData.parentFolderId = $(obj).attr('data-id')
getFileList(ajaxData)
$("#navigation").val($(obj).attr('data-id'));
$('#folder-navigation').append('<a data-id="' + $(obj).attr('data-id') + '"> > ' + $(obj).text() + '</a>');
serch_flag = 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 downloadfile(obj) {
var id = $(obj).data('fileid');
@ -582,6 +667,7 @@
});
if (arr2) {
layer.msg("不能隐藏文件夹")
return
}
layer.confirm('确认隐藏这个文件吗?', {
btn: ['确认', '取消'] //可以无限个按钮
@ -590,7 +676,7 @@
let objD = {
fileIds: [],
isShow: 0
isShow: 1
}
for (let index = 0; index < dataEditor.editorData.length; index++) {
@ -636,20 +722,22 @@
contentType: "application/x-www-form-urlencoded",
dataType: "json",
success: function (data) {
dataEditor.rows = data.data
if (data.code == 200) {
init()
if (data.data.folders.length > 0) {
data.data.folders.forEach(function (item) {
console.log("======" + item.id + '=====');
var html1 =
'<li class="list" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this) data-id="' +
item.id + '">' +
'<li class="list onClickListOne onClickList" data-if="1" data-click="1" onclick="openIf(this)" ondblclick="openIf(this)" data-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="text-two-hide list-hight">' + item.name + '</div>' +
'</li>'
$('.list-content#Chart ul').append(html1)
var html2 = '<tr>' +
'<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 +
'<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 +
'</span></div></td>' +
'<td></td>' +
'<td></td>' +
@ -666,19 +754,16 @@
if (data.data.files.length > 0) {
data.data.files.forEach(function (item) {
var html1 =
'<li class="list click-download" >'
+ '<div class="more">'
+ '<span>...</span>'
+ '<div class="more-edit" onclick="hideFile(this)" data-id="' + item.id + '" data-name="' + item.name + '">隐藏</div>'
+ '</div>' +
'<div class="img" onclick="openFile(this)" data-id="' +
item.id + '" data-name="' + item.name + '" data-type="' + item
'<li class="list click-download ps onClickList" >'
+
'<img class="list-img" src="./image/icon_30.png">' +
'<div class="img onClickListTwo" data-if="2" data-click="1" onclick="openIf(this)" data-id="' + item.id +
'" data-name="' + item.name + '" data-type="' + item
.type + '" data-url="' + item.url + '" data-time="' + item
.createTime + '" data-dingid="' + item.dingFileId +
'" 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>' +
'<div class="text-two-hide list-hight">' + item.name + '</div>' +
'</li>'
@ -690,8 +775,6 @@
+ '<span onclick="showBtn(this)" >...</span>'
+ '<div class="more-edit" onclick="hideFile(this)" data-id="' + item.id + '" data-name="' + item.name + '">隐藏</div>'
+ '</div>'
+ '<div class="list-img" onclick="openFile(this)" data-id="' +
item.id + '" data-name="' + item.name + '" data-type="' + item
.type + '" data-url="' + item.url + '" data-time="' + item

View File

@ -12,9 +12,9 @@
<div class="form-control__input">
<div class="js_party_select_result">
<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>
<input id="deptInput" class="form-input" type="hidden" name="policy_dept_ids" value=""
style="display: none;">
<input id="deptInput" class="form-input" type="hidden" name="policy_dept_ids" value="" style="display: none;">
</div>
</div>
</div>
@ -29,8 +29,7 @@
</div>
<div class="con-text bg-w hide-mobile">
<div class="name add-border">
<input type="text" name="" value="组织名称01" data-id="" id="folder-name" disabled="disabled"
class="name-input">
<input type="text" name="" value="组织名称01" data-id="" id="folder-name" disabled="disabled" class="name-input">
<div class="name-btn name-btn-none">
<button class="btn-edit btn-edit-op"><img src="image/icon_32.png"></button>
</div>
@ -43,16 +42,13 @@
<div class="org-list">
<ul class="org-ul " role="tablist">
<li role="presentation" class="active">
<a href="#Admin" aria-controls="Admin" role="tab" data-toggle="tab" data-role-id="3"
class="tab-menu-admin">管理员</a>
<a href="#Admin" aria-controls="Admin" role="tab" data-toggle="tab" data-role-id="3" class="tab-menu-admin">管理员</a>
</li>
<li role="presentation">
<a href="#opera" aria-controls="opera" role="tab" data-toggle="tab" data-role-id="5"
class="tab-menu-opera">操作员</a>
<a href="#opera" aria-controls="opera" role="tab" data-toggle="tab" data-role-id="5" class="tab-menu-opera">操作员</a>
</li>
<li role="presentation">
<a href="#look" aria-controls="look" role="tab" data-toggle="tab" data-role-id="6"
class="tab-menu-look">查看员</a>
<a href="#look" aria-controls="look" role="tab" data-toggle="tab" data-role-id="6" class="tab-menu-look">查看员</a>
</li>
</ul>
<div class="tab-content org-con top20">
@ -62,8 +58,7 @@
<p>1. 可查看、添加和下载授权组织内部文件、公共文件; </p>
<p>2. 创建和修改授权组织 “操作员”</p>
<p>3. 创建授权组织内部文件分类</p>
<a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="3"
onclick="choosePeople(this, 'Admin')">
<a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="3" onclick="choosePeople(this, 'Admin')">
+添加人员
</a>
</div>
@ -75,8 +70,7 @@
<div class="org-remarks">
<p>操作员权限</p>
<p>1. 可查看、添加和下载授权组织内部文件、公共文件; </p>
<a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="5"
onclick="choosePeople(this, 'opera')">
<a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="5" onclick="choosePeople(this, 'opera')">
+添加人员
</a>
</div>
@ -88,8 +82,7 @@
<div class="org-remarks">
<p>查看员权限</p>
<p>1. 可查看和下载授权组织内部文件、公共文件; </p>
<a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="6"
onclick="choosePeople(this, 'look')">
<a href="javascript:;" class="org-remarks-add" data-folder-id="" data-role-id="6" onclick="choosePeople(this, 'look')">
+添加人员
</a>
</div>
@ -102,8 +95,61 @@
</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">
<div class="con-content">
<div class="con-mune bg-w">
@ -125,6 +171,8 @@
{{# }); }}
</ul>
</div>
</div>
</script>
@ -144,6 +192,16 @@
<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>
var fileAjaxData = {
current: '',
isPublic: 1,
parentFolderId: 0,
size: '',
isUpload: 1
}
let dataOrganization = {
state: false
}
//修改名称
$(".btn-edit-op").click(function () {
$(".name-btn-active").show();
@ -370,7 +428,7 @@
'" data-folder-name="' + value.deptName + '">设置人员</span>';
if (value.hasChildren) {
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>";
});
@ -378,8 +436,44 @@
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) {
var id = $(obj).data('id');
zuId = $(obj).data('folder-id');
var roleId = $(obj).data('role-id');
@ -391,6 +485,12 @@
}
// 选中组织
function change(obj) {
console.log(dataOrganization.state);
if (dataOrganization.state) {
$('.upload').show()
getFileList(fileAjaxData)
return
}
shangId = $(obj).data('id');
zuId = $(obj).data('folder-id');
chuFolderId = zuId
@ -603,6 +703,66 @@
}
}, '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>
@ -628,4 +788,5 @@
});
</script>
</body>
</html>

View File

@ -33,6 +33,8 @@
<option value="1">文件上传</option>
<option value="2">文件下载</option>
<option value="3">文件更新</option>
<option value="4">文件隐藏</option>
<option value="5">文件显示</option>
</select>
</div>
</div>
@ -149,6 +151,7 @@
logsData.scope = data.field.fileType
logsData.startTime = data.field.times.split(' - ')[0] || ''
logsData.endTime = data.field.times.split(' - ')[1] || ''
console.log(logsData);
getLogs()
return false;
});
@ -207,6 +210,12 @@
case '3':
item.type = '文件更新';
break;
case '4':
item.type = '文件隐藏';
break;
case '5':
item.type = '文件显示';
break;
default:
item.type = '未知类型';
break;
@ -221,6 +230,7 @@
if (data.data.records.length > 0) {
var html = '';
data.data.records.forEach(function (item, i) {
html += '<tr>';
html += '<td><div class="list-img"><img src="image/img_01.png"><span>' + item.username + '</span></div></td>';
html += '<td>';
@ -230,6 +240,10 @@
html += '文件下载';
} else if (item.type == 3) {
html += '文件更新';
} else if (item.type == 4) {
html += '文件隐藏';
} else if (item.type == 5) {
html += '文件显示';
}
html += '</td>';
html += '<td>' + item.fileName + '</td>';

View File

@ -43,29 +43,31 @@
<div class="layui-form-item list">
<label class="layui-form-label">文件名称:</label>
<div class="layui-input-block">
<input type="text" name="name" lay-verify="required" lay-reqtext="请填写文件名称"
placeholder="请填写文件名称" autocomplete="off" class="layui-input">
<input type="text" name="name" lay-verify="required" lay-reqtext="请填写文件名称" placeholder="请填写文件名称" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item list">
<label class="layui-form-label">文件号:</label>
<div class="layui-input-block">
<input type="text" name="number" lay-verify="required" lay-reqtext="请填写文件号"
placeholder="请填写文件号" autocomplete="off" class="layui-input">
<input type="text" name="number" lay-verify="required" lay-reqtext="请填写文件号" placeholder="请填写文件号" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item list">
<label class="layui-form-label">拟稿人:</label>
<div class="layui-input-block">
<input type="text" name="createUser" lay-verify="required" lay-reqtext="请填写拟稿人"
placeholder="请填写拟稿人" autocomplete="off" class="layui-input">
<input type="text" name="createUser" lay-verify="required" lay-reqtext="请填写拟稿人" placeholder="请填写拟稿人" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item list">
<label class="layui-form-label">发布时间:</label>
<div class="layui-input-block">
<input type="text" name="createTime" lay-verify="datetime" placeholder="请选择时间"
autocomplete="off" class="layui-input layui-time">
<input type="text" name="createTime" lay-verify="datetime" placeholder="请选择时间" 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>
@ -91,6 +93,7 @@
<div class="upload-form">
<button class="flie-btn" lay-submit lay-filter="formDemo">保存</button>
<button type="reset" class="flie-btn flie-btn-primary">重置</button>
<button type="button" onclick="ddFile()">重置</button>
</div>
</form>
</div>
@ -125,8 +128,7 @@
<!--文件夹-->
<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>
<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">
@ -226,6 +228,8 @@
number: 1,
before: function (obj) {
this.data.code = this_code;
console.log(this.data.code);
getDingCode();
obj.preview(function (index, file, result) {
uploadNum++
@ -315,6 +319,7 @@
//监听提交
form.on('submit(formDemo)', function (data) {
console.log(data);
// console.log('提交时当前进度:' + pressw);
if (pressw != '100%') {
// console.log('不等于:' + pressw);
@ -340,11 +345,13 @@
});
return false;
}
var ajaxData = {
createTime: data.field.createTime + " 00:00:00",
createUser: '',
deptId: data.field.deptId,
drafter: data.field.createUser,
note: data.field.note,
//folderIds: folderIds.map(function(item){ return item.id }),
// groupId: "",
// id: '',
@ -547,6 +554,34 @@
}
});
}
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>
<include src="./footer.html"></include>