钉钉修改

master
tangyi 2021-12-09 18:02:20 +08:00
parent 3bc8a21c49
commit a5954330be
10 changed files with 709 additions and 66 deletions

17
dist/css/style.css vendored
View File

@ -2106,6 +2106,23 @@ a.color-b:hover {
top: 0px;
}
.onClickImg {
border: solid 2px #ddd;
position: absolute;
right: -10px;
top: -10px;
width: 40px;
display: flex;
justify-content: center;
border-radius: 5px;
align-items: center;
height: 40px;
}
.onClickImg img {
display: none;
}
/* 小于等于多少高度的样式 */
@media screen and (max-height:880px) {}

214
dist/index.html vendored
View File

@ -400,6 +400,7 @@
<input type="hidden" id="navigation" value="">
<div>
<div class="listBtn">
<button type="button" onclick="moveFiles()">移动文件</button>
<button type="button" onclick="editorName()">修改名字</button>
<button type="button" onclick="hgiddenFiles()">隐藏文件</button>
<button type="button " onclick="editorButton(this)">编辑文件</button>
@ -484,6 +485,39 @@
</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-list bg-w top20 add-border">
<div class="namea">
<span class="font-14" id="folder-navigationa"><i class="icon-back"></i><a data-id="0" data-name="全部文件">文件可选择路径</a></span>
<input type="hidden" id="navigationa" value="0">
</div>
<div class="con-list-cna">
<div class="list-content" id="movefiles">
<ul></ul>
</div>
</div>
<!-- 无内容 -->
<div class="no-con-lista" style="display: none;">
<img src="image/img_02.jpg">
</div>
</div>
<!--保存-->
<div class="upload-form t-r">
<button class="flie-btn" type="button" onclick="determineMobileGroup()">移动</button>
</div>
</form>
</div>
</div>
</div>
<script type="text/javascript">
var ajaxData = {
@ -500,7 +534,16 @@
let dataEditor = {
editorIf: true,
editorData: [],
rows: []
rows: [],
id: "",
thisId: "",
}
var fileAjaxData = {
current: '',
isPublic: 1,
parentFolderId: 0,
size: '',
isUpload: 1
}
function editorButton(obj) {
if (dataEditor.editorIf) {
@ -615,8 +658,35 @@
})
function inita() {
//返回事件
$('.con-list .namea span .icon-back').off("click").click(function () {
var that = $(this)
if ($("#navigationa").val() != 0) {
fileAjaxData.parentFolderId = $('.con-list .namea span a').eq(-2).attr('data-id')
$("#navigationa").val($('.con-list .namea span a').eq(-2).attr('data-id'))
$('.con-list .namea span a').eq(-1).remove()
getmovefiles(fileAjaxData)
}
});
//路由事件
$('#folder-navigationa a').off("click").click(function () {
var that = $(this)
fileAjaxData.parentFolderId = that.attr('data-id')
$('.con-list .namea span a').each(function () {
if ($(this).index() >= that.index()) {
$('.con-list .namea span a').eq($(this).index()).remove()
}
})
$("#navigationa").val(that.attr('data-id'))
getmovefiles(fileAjaxData)
})
}
function init() {
$('.con-list .name span .icon-back').off("click").click(function () {
$('.con-list .namea span .icon-back').off("click").click(function () {
var that = $(this);
if (serch_flag) {
$("#search-form")[0].reset();
@ -672,6 +742,7 @@
getFileList(ajaxData);
serch_flag = false;
})
}
//历史记录
@ -726,7 +797,62 @@
});
}
function moveFiles(params) {
if (dataEditor.editorIf) {
layer.msg("请先获取编辑权限")
return
}
if (!dataEditor.editorData.length >= 1) {
layer.msg("请先选择你要隐藏的文件")
return
}
var arr2 = dataEditor.editorData.some(function (v) {
return v.folder == true;
});
if (arr2) {
layer.msg("不能移动文件夹")
return
}
$('.upload').show()
getmovefiles(fileAjaxData)
}
function onClickImg(obj) {
$(".onClickImg img").css("display", "none")
event.stopPropagation()
$(obj).children().show()
dataEditor.id = $(obj).attr("data-id")
}
function determineMobileGroup(params) {
// let contentType = "application/json"
let arrData = {
fileIds: [],
fromFolderId: dataEditor.thisId,
toFolderId: dataEditor.id
}
for (let index = 0; index < dataEditor.editorData.length; index++) {
arrData.fileIds.push(dataEditor.editorData[index].id)
}
let url = host + '/ding/file/moveFiles'
let contentType = "application/json"
dxtcRequest('post', url, JSON.stringify(arrData), function name(data) {
if (data.code == 200) {
console.log(data);
getFileList(ajaxData)
} else {
layer.msg(data.msg)
}
}, contentType)
$('.upload').toggle()
}
//打开文件夹
function openIf(data) {
@ -734,6 +860,7 @@
if ($(data).attr("data-if") == 1) {
dataEditor.thisId = $(data).attr("data-id")
openFolder(data)
} else {
openFile(data)
@ -773,7 +900,7 @@
$(data).attr("data-click", "1")
}
console.log(dataEditor.editorData);
}
@ -788,6 +915,15 @@
$('#folder-navigation').append('<a data-id="' + $(obj).attr('data-id') + '"> > ' + $(obj).text() + '</a>');
serch_flag = false;
}
function openFoldera(obj) {
dataEditor.editorIf = true
fileAjaxData.parentFolderId = $(obj).attr('data-id')
getmovefiles(fileAjaxData)
$("#navigationa").val($(obj).attr('data-id'));
$('#folder-navigationa').append('<a data-id="' + $(obj).attr('data-id') + '"> > ' + $(obj).text() + '</a>');
serch_flag = false;
}
//文件下载
function downloadfile(obj) {
@ -876,10 +1012,16 @@
// });
}
// 文件夹重命名
// 文件夹重命名
function editorName() {
console.log(dataEditor.rows);
console.log(dataEditor.editorData);
if (dataEditor.editorIf) {
layer.msg("请先获取编辑权限")
return
}
if (!dataEditor.editorData.length >= 1) {
layer.msg("请先选择你要重命名的文件")
return
}
var arr2 = dataEditor.editorData.some(function (v) {
return v.folder == true;
});
@ -948,6 +1090,14 @@
//隐藏文件
function hgiddenFiles(obj) {
if (dataEditor.editorIf) {
layer.msg("请先获取编辑权限")
return
}
if (!dataEditor.editorData.length >= 1) {
layer.msg("请先选择你要隐藏的文件")
return
}
var arr2 = dataEditor.editorData.some(function (v) {
return v.folder == true;
});
@ -1151,6 +1301,58 @@
});
}
function getmovefiles(fileAjaxData) {
$('.list-content#movefiles ul').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) {
inita()
if (data.data.folders.length > 0) {
data.data.folders.forEach(function (item) {
var html1 =
'<li class="list pr" onclick="openFoldera(this)" ondblclick="openFoldera(this)" data-id="' +
item.id + '" data-name="' + item.name + '">' +
'<div class="onClickImg" data-id="' + item.id + '" onclick="onClickImg(this)"><img src="image/icon_30.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>' +
'</li>'
console.log($('#movefiles ul'));
$('#movefiles ul').append(html1)
})
}
if (data.data.folders.length == 0 && data.data.files.length == 0) {
$('.no-con-lista').show()
$('.con-list-cna').hide()
} else {
$('.no-con-lista').hide()
$('.con-list-cna').show()
}
} else {
layer.msg(data.msg)
}
},
error: function (data) {
console.log(data);
}
});
}
</script>

1
dist/inside.html vendored
View File

@ -388,6 +388,7 @@
<input type="hidden" id="navigation" value="">
<div>
<div class="listBtn">
<button type="button" onclick="moveFiles()">移动文件</button>
<button type="button" onclick="editorName()">修改名字</button>
<button type="button" onclick="hgiddenFiles()">隐藏文件</button>
<button type="button " onclick="editorButton(this)">编辑文件</button>

4
dist/js/script.js vendored
View File

@ -415,11 +415,11 @@ window.MobileLib = {
//自定义请求方法
function dxtcRequest(type, url, data, successFunction, contentType = 'application/x-www-form-urlencoded') {
console.log(contentType);
console.log(data);
$.ajax({
url: url,
headers: {
'Blade-Auth': 'bearer ' + localStorage.accessToken
'Blade-Auth': 'bearer ' + localStorage.accessToken,
},
data: data,
type: type,

145
dist/organization.html vendored
View File

@ -418,7 +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">
@ -433,8 +433,7 @@
</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>
<button class="flie-btn" type="button" onclick="determineMobileGroup()">移动</button>
</div>
</form>
</div>
@ -490,7 +489,12 @@
isUpload: 1
}
let dataOrganization = {
state: false
state: false,
data: [],
dataIndex: {
},
id: "",
thisId: "",
}
//修改名称
$(".btn-edit-op").click(function () {
@ -679,6 +683,8 @@
let data = {};
let roleId = $('.org-list .org-ul li.active a').data('role-id');
dxtcRequest(type, url, data, function (data) {
console.log(data.data);
dataOrganization.data = data.data
if (data.code == 200) {
let html = '';
let active = '';
@ -702,12 +708,32 @@
}
});
}
function menu_list_html(data, index = 0) {
function queryId(data, id, indexParent = []) {
for (let index = 0; index < data.length; index++) {
if (id == data[index].id) {
indexParent.unshift(index)
dataOrganization.dataIndex = {
index: index,
indexParent: indexParent
}
return true
}
if (data[index].children) {
let ifFor = queryId(data[index].children, id, indexParent)
if (ifFor) {
indexParent.unshift(index)
return true
}
}
}
}
function menu_list_html(data, id, index = 0) {
var html = "";
var null_str = ""
$.each(data, function (index, value) {
// html += '<li class="add-border" ><a href="javascript:;" data-id="' + value.id +
// '" data-folder-id="' + value.folderId + '" data-role-id="' + roleId +
0 // '" data-folder-id="' + value.folderId + '" data-role-id="' + roleId +
// '" data-folder-name="' + value.deptName + '" onclick="changeDept(this)">' + value.deptName +
// '</a><span class="float-right hide-wide">设置人员</span>';
// console.log('data:'+JSON.stringify(value));
@ -718,7 +744,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, { num: 0, id: value.id }) + "</ul>";
html += "<ul class='org-menu-lis-children'>" + menu_list_html(value.children) + "</ul>";
}
html += "</li>";
});
@ -754,9 +780,12 @@
//选择组织,更改显示内容
function mobileGroup(params) {
if (dataOrganization.state) {
$(params).html("取消")
} else {
$(params).html("移动组织")
} else {
$(params).html("取消")
}
dataOrganization.state = !dataOrganization.state
@ -775,11 +804,50 @@
}
// 选中组织
function change(obj) {
console.log(dataOrganization.state);
if (dataOrganization.state) {
dataOrganization.thisId = `${$(obj).data('folder-id')}`
$('.upload').show()
getFileList(fileAjaxData)
return
// layer.confirm('请选择升降级', {
// btn: ['升级',平级拖动, '降级'] //可以无限个按钮
// }, function (params) {
// // $('.upload').show()
// // getFileList(fileAjaxData)
// queryId(dataOrganization.data, $(obj).attr("data-id"))
// let dataIin;
// if (dataOrganization.dataIndex.indexParent.length > 1) {
// for (let index = 0; index < dataOrganization.dataIndex.indexParent.length - 2; index++) {
// if (index == 0) {
// dataIin = dataOrganization.data[dataOrganization.dataIndex.indexParent[index]]
// } else if (index == dataIndex.indexParent.length - 1) {
// dataIin = dataIin.children[dataOrganization.dataIndex.indexParent[index]]
// } else {
// dataIin = dataIin.children[dataOrganization.dataIndex.indexParent[index]]
// }
// }
// dataOrganization.id=dataIin.folderId
// determineMobileGroup()
// } else {
// layer.mag("顶层不能移动")
// layer.closeAll();
// return
// }
// layer.closeAll();
// return
// }, function (params) {
// $('.upload').show()
// getFileList(fileAjaxData)
// layer.closeAll();
// return
// })
}
shangId = $(obj).data('id');
zuId = $(obj).data('folder-id');
@ -995,7 +1063,13 @@
})
function openFolder(obj) {
fileAjaxData.parentFolderId = $(obj).attr('data-id')
getFileList(fileAjaxData)
$("#navigation").val($(obj).attr('data-id'))
$('#folder-navigation').append('<a data-id="' + $(obj).attr('data-id') + '" data-name="' + $(obj).text() +
'"> > ' + $(obj).text() + '</a>')
}
function getFileList(fileAjaxData) {
$('.list-content#Chart ul').empty()
$('.list-content#tab tbody').empty()
@ -1015,8 +1089,9 @@
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="' +
'<li class="list pr" onclick="openFolder(this)" ondblclick="openFolder(this)" data-id="' +
item.id + '" data-name="' + item.name + '">' +
'<div class="onClickImg" data-id="' + item.id + '" onclick="onClickImg(this)"><img src="image/icon_30.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>' +
@ -1024,18 +1099,7 @@
$('.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()
@ -1053,6 +1117,37 @@
});
}
function onClickImg(obj) {
$(".onClickImg img").css("display", "none")
event.stopPropagation()
$(obj).children().show()
dataOrganization.id = $(obj).attr("data-id")
}
function getId(obj) {
$('.list-content#Chart ul li').css("background", "rgba(0,0,0,0)")
dataOrganization.id = $(obj).attr("data-id")
$(obj).css("background", "#f5f6ff")
}
function determineMobileGroup(params) {
// let contentType = "application/json"
let arrData = {
targetFolderId: dataOrganization.id,
thisFolderId: dataOrganization.thisId
}
let url = host + '/ding/dept/moveDept'
dxtcRequest('get', url, arrData, function name(data) {
if (data.code == 200) {
console.log(data);
} else {
layer.msg(data.msg)
}
})
$('.upload').toggle()
}
</script>
<script>

17
dist/renewadd.html vendored
View File

@ -847,7 +847,7 @@
function ddFile(params) {
dd.biz.util.uploadAttachment({
dd.biz.util.uploadAttachment({
types: ["photo"],
image: { "multiple": true, "compress": false, "max": 9, "spaceId": "12345" },
compress: true,
@ -870,6 +870,21 @@
}
function ddfile() {
dd.biz.util.uploadAttachment({
image: { multiple: true, compress: false, max: 9, spaceId: "12345" },
space: { corpId: "xxx3020", spaceId: "12345", isCopy: 1, max: 9 },
file: { spaceId: "12345", max: 1 },
types: ["photo", "camera", "file", "space"],//PC端支持["photo","file","space"]
onSuccess: function (result) {
},
onFail: function (err) { }
});
}
</script>

View File

@ -110,6 +110,7 @@
<input type="hidden" id="navigation" value="">
<div>
<div class="listBtn">
<button type="button" onclick="moveFiles()">移动文件</button>
<button type="button" onclick="editorName()">修改名字</button>
<button type="button" onclick="hgiddenFiles()">隐藏文件</button>
<button type="button " onclick="editorButton(this)">编辑文件</button>
@ -194,6 +195,39 @@
</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-list bg-w top20 add-border">
<div class="namea">
<span class="font-14" id="folder-navigationa"><i class="icon-back"></i><a data-id="0" data-name="全部文件">文件可选择路径</a></span>
<input type="hidden" id="navigationa" value="0">
</div>
<div class="con-list-cna">
<div class="list-content" id="movefiles">
<ul></ul>
</div>
</div>
<!-- 无内容 -->
<div class="no-con-lista" style="display: none;">
<img src="image/img_02.jpg">
</div>
</div>
<!--保存-->
<div class="upload-form t-r">
<button class="flie-btn" type="button" onclick="determineMobileGroup()">移动</button>
</div>
</form>
</div>
</div>
</div>
<script type="text/javascript">
var ajaxData = {
@ -210,7 +244,16 @@
let dataEditor = {
editorIf: true,
editorData: [],
rows: []
rows: [],
id: "",
thisId: "",
}
var fileAjaxData = {
current: '',
isPublic: 1,
parentFolderId: 0,
size: '',
isUpload: 1
}
function editorButton(obj) {
if (dataEditor.editorIf) {
@ -325,8 +368,35 @@
})
function inita() {
//返回事件
$('.con-list .namea span .icon-back').off("click").click(function () {
var that = $(this)
if ($("#navigationa").val() != 0) {
fileAjaxData.parentFolderId = $('.con-list .namea span a').eq(-2).attr('data-id')
$("#navigationa").val($('.con-list .namea span a').eq(-2).attr('data-id'))
$('.con-list .namea span a').eq(-1).remove()
getmovefiles(fileAjaxData)
}
});
//路由事件
$('#folder-navigationa a').off("click").click(function () {
var that = $(this)
fileAjaxData.parentFolderId = that.attr('data-id')
$('.con-list .namea span a').each(function () {
if ($(this).index() >= that.index()) {
$('.con-list .namea span a').eq($(this).index()).remove()
}
})
$("#navigationa").val(that.attr('data-id'))
getmovefiles(fileAjaxData)
})
}
function init() {
$('.con-list .name span .icon-back').off("click").click(function () {
$('.con-list .namea span .icon-back').off("click").click(function () {
var that = $(this);
if (serch_flag) {
$("#search-form")[0].reset();
@ -382,6 +452,7 @@
getFileList(ajaxData);
serch_flag = false;
})
}
//历史记录
@ -436,7 +507,62 @@
});
}
function moveFiles(params) {
if (dataEditor.editorIf) {
layer.msg("请先获取编辑权限")
return
}
if (!dataEditor.editorData.length >= 1) {
layer.msg("请先选择你要隐藏的文件")
return
}
var arr2 = dataEditor.editorData.some(function (v) {
return v.folder == true;
});
if (arr2) {
layer.msg("不能移动文件夹")
return
}
$('.upload').show()
getmovefiles(fileAjaxData)
}
function onClickImg(obj) {
$(".onClickImg img").css("display", "none")
event.stopPropagation()
$(obj).children().show()
dataEditor.id = $(obj).attr("data-id")
}
function determineMobileGroup(params) {
// let contentType = "application/json"
let arrData = {
fileIds: [],
fromFolderId: dataEditor.thisId,
toFolderId: dataEditor.id
}
for (let index = 0; index < dataEditor.editorData.length; index++) {
arrData.fileIds.push(dataEditor.editorData[index].id)
}
let url = host + '/ding/file/moveFiles'
let contentType = "application/json"
dxtcRequest('post', url, JSON.stringify(arrData), function name(data) {
if (data.code == 200) {
console.log(data);
getFileList(ajaxData)
} else {
layer.msg(data.msg)
}
}, contentType)
$('.upload').toggle()
}
//打开文件夹
function openIf(data) {
@ -444,6 +570,7 @@
if ($(data).attr("data-if") == 1) {
dataEditor.thisId = $(data).attr("data-id")
openFolder(data)
} else {
openFile(data)
@ -483,7 +610,7 @@
$(data).attr("data-click", "1")
}
console.log(dataEditor.editorData);
}
@ -498,6 +625,15 @@
$('#folder-navigation').append('<a data-id="' + $(obj).attr('data-id') + '"> > ' + $(obj).text() + '</a>');
serch_flag = false;
}
function openFoldera(obj) {
dataEditor.editorIf = true
fileAjaxData.parentFolderId = $(obj).attr('data-id')
getmovefiles(fileAjaxData)
$("#navigationa").val($(obj).attr('data-id'));
$('#folder-navigationa').append('<a data-id="' + $(obj).attr('data-id') + '"> > ' + $(obj).text() + '</a>');
serch_flag = false;
}
//文件下载
function downloadfile(obj) {
@ -586,10 +722,16 @@
// });
}
// 文件夹重命名
// 文件夹重命名
function editorName() {
console.log(dataEditor.rows);
console.log(dataEditor.editorData);
if (dataEditor.editorIf) {
layer.msg("请先获取编辑权限")
return
}
if (!dataEditor.editorData.length >= 1) {
layer.msg("请先选择你要重命名的文件")
return
}
var arr2 = dataEditor.editorData.some(function (v) {
return v.folder == true;
});
@ -658,6 +800,14 @@
//隐藏文件
function hgiddenFiles(obj) {
if (dataEditor.editorIf) {
layer.msg("请先获取编辑权限")
return
}
if (!dataEditor.editorData.length >= 1) {
layer.msg("请先选择你要隐藏的文件")
return
}
var arr2 = dataEditor.editorData.some(function (v) {
return v.folder == true;
});
@ -861,6 +1011,58 @@
});
}
function getmovefiles(fileAjaxData) {
$('.list-content#movefiles ul').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) {
inita()
if (data.data.folders.length > 0) {
data.data.folders.forEach(function (item) {
var html1 =
'<li class="list pr" onclick="openFoldera(this)" ondblclick="openFoldera(this)" data-id="' +
item.id + '" data-name="' + item.name + '">' +
'<div class="onClickImg" data-id="' + item.id + '" onclick="onClickImg(this)"><img src="image/icon_30.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>' +
'</li>'
console.log($('#movefiles ul'));
$('#movefiles ul').append(html1)
})
}
if (data.data.folders.length == 0 && data.data.files.length == 0) {
$('.no-con-lista').show()
$('.con-list-cna').hide()
} else {
$('.no-con-lista').hide()
$('.con-list-cna').show()
}
} else {
layer.msg(data.msg)
}
},
error: function (data) {
console.log(data);
}
});
}
</script>

View File

@ -98,6 +98,7 @@
<input type="hidden" id="navigation" value="">
<div>
<div class="listBtn">
<button type="button" onclick="moveFiles()">移动文件</button>
<button type="button" onclick="editorName()">修改名字</button>
<button type="button" onclick="hgiddenFiles()">隐藏文件</button>
<button type="button " onclick="editorButton(this)">编辑文件</button>

View File

@ -128,7 +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">
@ -143,8 +143,7 @@
</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>
<button class="flie-btn" type="button" onclick="determineMobileGroup()">移动</button>
</div>
</form>
</div>
@ -200,7 +199,12 @@
isUpload: 1
}
let dataOrganization = {
state: false
state: false,
data: [],
dataIndex: {
},
id: "",
thisId: "",
}
//修改名称
$(".btn-edit-op").click(function () {
@ -389,6 +393,8 @@
let data = {};
let roleId = $('.org-list .org-ul li.active a').data('role-id');
dxtcRequest(type, url, data, function (data) {
console.log(data.data);
dataOrganization.data = data.data
if (data.code == 200) {
let html = '';
let active = '';
@ -412,12 +418,32 @@
}
});
}
function menu_list_html(data, index = 0) {
function queryId(data, id, indexParent = []) {
for (let index = 0; index < data.length; index++) {
if (id == data[index].id) {
indexParent.unshift(index)
dataOrganization.dataIndex = {
index: index,
indexParent: indexParent
}
return true
}
if (data[index].children) {
let ifFor = queryId(data[index].children, id, indexParent)
if (ifFor) {
indexParent.unshift(index)
return true
}
}
}
}
function menu_list_html(data, id, index = 0) {
var html = "";
var null_str = ""
$.each(data, function (index, value) {
// html += '<li class="add-border" ><a href="javascript:;" data-id="' + value.id +
// '" data-folder-id="' + value.folderId + '" data-role-id="' + roleId +
0 // '" data-folder-id="' + value.folderId + '" data-role-id="' + roleId +
// '" data-folder-name="' + value.deptName + '" onclick="changeDept(this)">' + value.deptName +
// '</a><span class="float-right hide-wide">设置人员</span>';
// console.log('data:'+JSON.stringify(value));
@ -428,7 +454,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, { num: 0, id: value.id }) + "</ul>";
html += "<ul class='org-menu-lis-children'>" + menu_list_html(value.children) + "</ul>";
}
html += "</li>";
});
@ -464,9 +490,12 @@
//选择组织,更改显示内容
function mobileGroup(params) {
if (dataOrganization.state) {
$(params).html("取消")
} else {
$(params).html("移动组织")
} else {
$(params).html("取消")
}
dataOrganization.state = !dataOrganization.state
@ -485,11 +514,50 @@
}
// 选中组织
function change(obj) {
console.log(dataOrganization.state);
if (dataOrganization.state) {
dataOrganization.thisId = `${$(obj).data('folder-id')}`
$('.upload').show()
getFileList(fileAjaxData)
return
// layer.confirm('请选择升降级', {
// btn: ['升级',平级拖动, '降级'] //可以无限个按钮
// }, function (params) {
// // $('.upload').show()
// // getFileList(fileAjaxData)
// queryId(dataOrganization.data, $(obj).attr("data-id"))
// let dataIin;
// if (dataOrganization.dataIndex.indexParent.length > 1) {
// for (let index = 0; index < dataOrganization.dataIndex.indexParent.length - 2; index++) {
// if (index == 0) {
// dataIin = dataOrganization.data[dataOrganization.dataIndex.indexParent[index]]
// } else if (index == dataIndex.indexParent.length - 1) {
// dataIin = dataIin.children[dataOrganization.dataIndex.indexParent[index]]
// } else {
// dataIin = dataIin.children[dataOrganization.dataIndex.indexParent[index]]
// }
// }
// dataOrganization.id=dataIin.folderId
// determineMobileGroup()
// } else {
// layer.mag("顶层不能移动")
// layer.closeAll();
// return
// }
// layer.closeAll();
// return
// }, function (params) {
// $('.upload').show()
// getFileList(fileAjaxData)
// layer.closeAll();
// return
// })
}
shangId = $(obj).data('id');
zuId = $(obj).data('folder-id');
@ -705,7 +773,13 @@
})
function openFolder(obj) {
fileAjaxData.parentFolderId = $(obj).attr('data-id')
getFileList(fileAjaxData)
$("#navigation").val($(obj).attr('data-id'))
$('#folder-navigation').append('<a data-id="' + $(obj).attr('data-id') + '" data-name="' + $(obj).text() +
'"> > ' + $(obj).text() + '</a>')
}
function getFileList(fileAjaxData) {
$('.list-content#Chart ul').empty()
$('.list-content#tab tbody').empty()
@ -725,8 +799,9 @@
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="' +
'<li class="list pr" onclick="openFolder(this)" ondblclick="openFolder(this)" data-id="' +
item.id + '" data-name="' + item.name + '">' +
'<div class="onClickImg" data-id="' + item.id + '" onclick="onClickImg(this)"><img src="image/icon_30.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>' +
@ -734,18 +809,7 @@
$('.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()
@ -763,6 +827,37 @@
});
}
function onClickImg(obj) {
$(".onClickImg img").css("display", "none")
event.stopPropagation()
$(obj).children().show()
dataOrganization.id = $(obj).attr("data-id")
}
function getId(obj) {
$('.list-content#Chart ul li').css("background", "rgba(0,0,0,0)")
dataOrganization.id = $(obj).attr("data-id")
$(obj).css("background", "#f5f6ff")
}
function determineMobileGroup(params) {
// let contentType = "application/json"
let arrData = {
targetFolderId: dataOrganization.id,
thisFolderId: dataOrganization.thisId
}
let url = host + '/ding/dept/moveDept'
dxtcRequest('get', url, arrData, function name(data) {
if (data.code == 200) {
console.log(data);
} else {
layer.msg(data.msg)
}
})
$('.upload').toggle()
}
</script>
<script>

View File

@ -557,7 +557,7 @@
function ddFile(params) {
dd.biz.util.uploadAttachment({
dd.biz.util.uploadAttachment({
types: ["photo"],
image: { "multiple": true, "compress": false, "max": 9, "spaceId": "12345" },
compress: true,
@ -580,6 +580,21 @@
}
function ddfile() {
dd.biz.util.uploadAttachment({
image: { multiple: true, compress: false, max: 9, spaceId: "12345" },
space: { corpId: "xxx3020", spaceId: "12345", isCopy: 1, max: 9 },
file: { spaceId: "12345", max: 1 },
types: ["photo", "camera", "file", "space"],//PC端支持["photo","file","space"]
onSuccess: function (result) {
},
onFail: function (err) { }
});
}
</script>