From 3bc8a21c49239b972025fdd3462e95ea662a3fd2 Mon Sep 17 00:00:00 2001 From: tangyi <275503107@qq.com> Date: Wed, 8 Dec 2021 18:12:10 +0800 Subject: [PATCH] =?UTF-8?q?=E9=92=89=E9=92=89=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/css/style.css | 103 ++++++++- dist/hidefile.html | 422 +++++++++++++++++++++++++++--------- dist/index.html | 119 +++++++++- dist/inside.html | 139 +++++++++--- dist/js/script.js | 3 +- dist/organization.html | 285 ++++++++++++++++++------ dist/record.html | 32 ++- dist/renewadd.html | 143 +++++++----- src/pages/hidefile.html | 422 +++++++++++++++++++++++++++--------- src/pages/index.html | 119 +++++++++- src/pages/inside.html | 139 +++++++++--- src/pages/organization.html | 285 ++++++++++++++++++------ src/pages/record.html | 32 ++- src/pages/renewadd.html | 143 +++++++----- 14 files changed, 1844 insertions(+), 542 deletions(-) diff --git a/dist/css/style.css b/dist/css/style.css index e44c5e9..ebdc4b7 100644 --- a/dist/css/style.css +++ b/dist/css/style.css @@ -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; diff --git a/dist/hidefile.html b/dist/hidefile.html index 9ef3df0..e3cd241 100644 --- a/dist/hidefile.html +++ b/dist/hidefile.html @@ -292,7 +292,7 @@
-
+
隐藏文件
@@ -343,8 +343,29 @@
-
+
+
+ + +
+ + +

修改文件夹名称

+
+

+ 文件1 + +

+ +
+ +
+ +
+ +
+
- 全部文件 + 全部文件 -
    - -
  • -   -
  • -
+
+
+ + + +
+
    + +
  • +   +
  • +
+
+
@@ -421,7 +449,7 @@

文件名称

预览 - 下载 + 下载
@@ -464,31 +492,49 @@ 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() { + $(function () { - layui.use(['form', 'upload', 'element', 'layer'], function() { + layui.use(['form', 'upload', 'element', 'layer'], function () { var form = layui.form; var upload = layui.upload; var element = layui.element; var layer = layui.layer; //var haveLogin = localStorage['haveLogin'] || false; - var loginInterval = setInterval(function() { + var loginInterval = setInterval(function () { var tmpHaveLogin = localStorage['haveLogin'] || false; if (tmpHaveLogin) { clearInterval(loginInterval); pageInit(); } }, 500); - + function pageInit() { getFileType(); getFileList(ajaxData); } - $('#toggle-filter').on('click', function() { + $('#toggle-filter').on('click', function () { layer.open({ type: 1, title: ['文件过滤', 'font-size:18px;padding:0;text-align:center'], @@ -497,8 +543,8 @@ area: ['100%', '100%'], closeBtn: 1, skin: 'file-filter-layer', - success: function(dom, index) { - dom.find('.layui-btn[lay-submit]').on('click', function() { + success: function (dom, index) { + dom.find('.layui-btn[lay-submit]').on('click', function () { layer.close(index); }); } @@ -506,7 +552,7 @@ }); //搜索 - form.on('submit(formDemo)', function(data) { + form.on('submit(formDemo)', function (data) { ajaxData = { createUser: data.field.createUser, drafter: data.field.drafter, @@ -529,23 +575,23 @@ //文件类型 function getFileType() { $.ajax({ - url: host + '/ding/file/getFileType'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), + url: host + '/ding/file/getFileType' + '?timetmp=' + Date.parse(new Date()).toString().substr(0, 10), headers: { 'Blade-Auth': 'bearer ' + accessToken, }, data: {}, type: "get", dataType: "json", - success: function(data) { + success: function (data) { if (data.code == 200) { if (data.data.length > 0) { - data.data.forEach(function(item) { + data.data.forEach(function (item) { $('.con-search select[name=type]').append( '') }) form.render() - } + } // else { // layer.msg('暂无记录') // } @@ -553,7 +599,7 @@ layer.msg(data.msg) } }, - error: function(data) { + error: function (data) { console.log(data); } }); @@ -563,11 +609,11 @@ }) function init() { - $('.con-list .name span .icon-back').off("click").click(function() { + $('.con-list .name span .icon-back').off("click").click(function () { var that = $(this); if (serch_flag) { $("#search-form")[0].reset(); - layui.use(['form'], function() { + layui.use(['form'], function () { var form = layui.form; form.render(); }) @@ -605,12 +651,12 @@ serch_flag = false; }); //路由事件 - $('#folder-navigation a').off("click").click(function() { + $('#folder-navigation a').off("click").click(function () { var that = $(this) console.log(that.attr('data-id'), 'parentFolderId'); ajaxData.parentFolderId = that.attr('data-id') ajaxData.name = ''; - $('.con-list .name span a').each(function() { + $('.con-list .name span a').each(function () { if ($(this).index() >= that.index()) { $('.con-list .name span a').eq($(this).index()).remove() } @@ -624,7 +670,7 @@ //历史记录 function getHistory(obj) { $.ajax({ - url: host + '/ding/file/getHistory'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), + url: host + '/ding/file/getHistory' + '?timetmp=' + Date.parse(new Date()).toString().substr(0, 10), headers: { 'Blade-Auth': 'bearer ' + accessToken, }, @@ -633,18 +679,18 @@ }, type: "get", dataType: "json", - success: function(data) { + success: function (data) { if (data.code == 200) { if (data.data.length > 0) { var html = ''; - data.data.forEach(function(item) { + data.data.forEach(function (item) { html += '' + '
' + item.name + '
' html += ''; @@ -659,7 +705,7 @@ }) $(".history .table tbody").html(html) $(".history").show(); - } + } // else { // layer.msg('暂无记录') // } @@ -667,7 +713,7 @@ layer.msg(data.msg) } }, - error: function(data) { + error: function (data) { console.log(data); } }); @@ -675,7 +721,57 @@ } //打开文件夹 + function openIf(data) { + if (dataEditor.editorIf) { + if ($(data).attr("data-if") == 1) { + openFolder(data) + } else { + openFile(data) + } + } else { + if ($(data).attr("data-click") == "1") { + if ($(data).attr("data-if") == 1) { + $(data).children(".list-img").css("display", "block") + $(data).css("background", "#f5f6ff") + dataEditor.editorData.push({ + id: $(data).attr("data-id"), + folder: true + }) + } else { + $(data).prev().css("display", "block") + $(data).parent().css("background", "#f5f6ff") + + dataEditor.editorData.push({ + id: $(data).attr("data-id"), + folder: false + }) + + } + $(data).attr("data-click", "0") + } else { + if ($(data).attr("data-if") == 1) { + $(data).children(".list-img").css("display", "none") + $(data).css("background", "#fff") + let ina = screening(dataEditor.editorData, $(data).attr("data-id")) + dataEditor.editorData.splice(ina, 1) + } else { + $(data).prev().css("display", "none") + $(data).parent().css("background", "#fff") + let ina = screening(dataEditor.editorData, $(data).attr("data-id")) + dataEditor.editorData.splice(ina, 1) + } + $(data).attr("data-click", "1") + } + + console.log(dataEditor.editorData); + + } + + } function openFolder(obj) { + dataEditor.editorData = [] + dataEditor.editorIf = true + ajaxData.parentFolderId = $(obj).attr('data-id') getFileList(ajaxData) $("#navigation").val($(obj).attr('data-id')); @@ -687,7 +783,7 @@ function downloadfile(obj) { var id = $(obj).data('fileid'); $.ajax({ - url: host + '/ding/file/downLoadFile'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), + url: host + '/ding/file/downLoadFile' + '?timetmp=' + Date.parse(new Date()).toString().substr(0, 10), headers: { 'Blade-Auth': 'bearer ' + localStorage.accessToken }, @@ -697,17 +793,17 @@ type: "get", contentType: "application/json", dataType: "json", - success: function(data) { + success: function (data) { if (data.code == 200) { $(obj).attr('data', data.data); console.log(data.data); - - window.open(data.data); + + window.open(data.data); } else { layer.msg(data.msg) } }, - error: function(data) { + error: function (data) { console.log(data); } }); @@ -766,52 +862,167 @@ // } // }); } - + //隐藏文件 - function hideFile(obj){ - layer.confirm('确认显示这个文件吗?', { - btn: ['确认', '取消'] //可以无限个按钮 - , - }, function(index, layero){ - //按钮【按钮一】的回调 - $.ajax({ - url: host + '/ding/file/disPlayFile'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), - headers: { - 'Blade-Auth': 'bearer ' + localStorage.accessToken - }, - data: { - fileId:$(obj).attr("data-id"), - isShow:1 - }, - type: "get", - contentType: "application/x-www-form-urlencoded", - dataType: "json", - success: function(data) { - if(data.code==200){ - layer.msg('显示成功') - getFileList(ajaxData) - }else{ - layer.msg(data.msg) - } - - }, - error: function(data) { - console.log(data); - } - }) - }, function(index){ - //按钮【按钮二】的回调 - layer.closeAll(); + 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('确认隐藏这个文件吗?', { + btn: ['确认', '取消'] //可以无限个按钮 + , + }, function (index, layero) { + //按钮【按钮一】的回调 + $.ajax({ + url: host + '/ding/file/disPlayFile' + '?timetmp=' + Date.parse(new Date()).toString() + .substr(0, 10), + headers: { + 'Blade-Auth': 'bearer ' + localStorage.accessToken + }, + data: { + fileId: $(obj).attr("data-id"), + isShow: 0 + }, + type: "get", + contentType: "application/x-www-form-urlencoded", + dataType: "json", + success: function (data) { + if (data.code == 200) { + layer.msg('隐藏成功') + getFileList(ajaxData) + } else { + layer.msg(data.msg) + } + + }, + error: function (data) { + console.log(data); + layer.msg(data.responseJSON.msg) + } + }) + }, function (index) { + //按钮【按钮二】的回调 + layer.closeAll(); + }); + return false; + } + + //修改文件名 + function editorName() { + console.log(dataEditor.rows, "--------------"); + console.log(dataEditor.editorData, "--------------"); + var arr2 = dataEditor.editorData.some(function (v) { + return v.folder == true; + }); + if (arr2) { + layer.msg("不能重命名文件夹") + return + } + let editorNameData = [] + for (let index = 0; index < dataEditor.editorData.length; index++) { + for (let k = 0; k < dataEditor.rows.files.length; k++) { + if (dataEditor.editorData[index].id == dataEditor.rows.files[k].id) { + editorNameData.push(dataEditor.rows.files[k]) + } + + } + + } + + $(".nameMake").css("display", "flex") + let str = editorNameData.map((v, i) => `

+ 文件${i + 1} + +

`).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'); $('.list-content#Chart ul').empty() $('.list-content#tab tbody').empty() $.ajax({ - url: host + '/ding/file/getDisplayFile'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), + url: host + '/ding/file/getDisplayFile' + '?timetmp=' + Date.parse(new Date()).toString().substr(0, 10), headers: { 'Blade-Auth': 'bearer ' + localStorage.accessToken }, @@ -819,21 +1030,22 @@ type: "get", contentType: "application/x-www-form-urlencoded", dataType: "json", - success: function(data) { + success: function (data) { + dataEditor.rows = data.data if (data.code == 200) { init() if (data.data.folders.length > 0) { - data.data.folders.forEach(function(item) { + data.data.folders.forEach(function (item) { var html1 = - '
  • ' + - '
    ' + + '
  • ' + + '' + + '
    ' + '
    ' + item.name + '
    ' + '
  • ' $('.list-content#Chart ul').append(html1) var html2 = '' + - '
    ' + item.name + + '
    ' + item.name + '
    ' + '' + '' + @@ -848,30 +1060,28 @@ }) } if (data.data.files.length > 0) { - data.data.files.forEach(function(item) { + data.data.files.forEach(function (item) { var html1 = - '
  • ' - - - + '
    ' - + '...' - + '
    显示
    ' - + '
    '+ - - - '
    ' + + (item.isPublic == "0" ? + "" : "") + + + '' + + '
    ' + '
    ' + item.name + '
    ' + '
  • ' $('.list-content#Chart ul').append(html1) var html2 = '' + + '' - + + '
    ' + '...' + '
    显示
    ' @@ -879,8 +1089,8 @@ + '
    ' + item.name + '
    ' + '' + item.number + '' + '
    ' + item.drafter + @@ -908,7 +1118,7 @@ layer.msg(data.msg) } }, - error: function(data) { + error: function (data) { console.log(data); } }); @@ -964,4 +1174,4 @@ $('#2').click(function(){ localStorage.setItem('pubilc','功能区') }) - + \ No newline at end of file diff --git a/dist/index.html b/dist/index.html index 7948d9b..41ee1db 100644 --- a/dist/index.html +++ b/dist/index.html @@ -343,8 +343,30 @@
    -
    +
    + +
    + + +
    + + +

    修改文件夹名称

    +
    +

    + 文件1 + +

    + +
    + +
    + +
    + +
    +
    -
    +
    +
    +
    +

    修改文件夹名称

    +
    +

    + 文件1 + +

    +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    +

    选择文件路径

    +
    +   +
    + + +
    +
    + 全部文件 + +
    +
    +
    +
      +
      +
      + + +
      + +
      + + +
      +
      +
      +
      +
      @@ -434,20 +482,30 @@ - + + \ No newline at end of file diff --git a/dist/record.html b/dist/record.html index c5d969b..48d5b57 100644 --- a/dist/record.html +++ b/dist/record.html @@ -323,6 +323,8 @@ + +
      @@ -343,12 +345,12 @@
      - - - - - - + + + + + + @@ -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; }); @@ -461,7 +464,7 @@ title: '操作记录', body: $('.con-search'), success: function ($el, idx) { - $el.find('.layui-form').css({padding: '20px'}) + $el.find('.layui-form').css({ padding: '20px' }) $el.find('.font-18').hide() $el.find('button[lay-submit]').on('click', function () { layer.close(idx) @@ -497,13 +500,19 @@ case '3': item.type = '文件更新'; break; + case '4': + item.type = '文件隐藏'; + break; + case '5': + item.type = '文件显示'; + break; default: item.type = '未知类型'; break; } return item }) - $items.html(layui.laytpl(itemTpl).render({items: items})) + $items.html(layui.laytpl(itemTpl).render({ items: items })) return } @@ -511,6 +520,7 @@ if (data.data.records.length > 0) { var html = ''; data.data.records.forEach(function (item, i) { + html += ''; html += ''; html += ''; html += ''; @@ -605,4 +619,4 @@ }); - + \ No newline at end of file diff --git a/dist/renewadd.html b/dist/renewadd.html index a32f992..d195162 100644 --- a/dist/renewadd.html +++ b/dist/renewadd.html @@ -333,29 +333,31 @@
      - +
      - +
      - +
      - + +
      +
      +
      + +
      +
      @@ -381,6 +383,7 @@
      +
      @@ -415,8 +418,7 @@
      @@ -454,9 +456,9 @@ var folderIds = [] var filesIds = [] - $(function() { + $(function () { - $(".click-history").click(function() { + $(".click-history").click(function () { $('.upload').show() getFileList(fileAjaxData) }); @@ -467,22 +469,22 @@ function getDingCode() { dd.runtime.permission.requestAuthCode({ corpId: corpId, - onSuccess: function(result) { + onSuccess: function (result) { this_code = result.code; }, - onFail: function(err) { + onFail: function (err) { console.log(err) } }); } - layui.use(['form', 'formSelects', 'upload', 'element', 'layer'], function() { + layui.use(['form', 'formSelects', 'upload', 'element', 'layer'], function () { var form = layui.form; var formSelects = layui.formSelects; var upload = layui.upload; var element = layui.element; var layer = layui.layer; - var renewaddIntervalScript = setInterval(function() { + var renewaddIntervalScript = setInterval(function () { var tmpHaveLogin = localStorage['haveLogin'] || false; if (tmpHaveLogin) { clearInterval(renewaddIntervalScript); @@ -490,7 +492,7 @@ } }, 500); - form.on('radio(isPublic)', function(data) { + form.on('radio(isPublic)', function (data) { fileAjaxData.isPublic = data.value getMainDeptList(fileAjaxData.isPublic) }); @@ -508,16 +510,18 @@ }, field: 'file', accept: 'file' - // ,acceptMime: '.docx,.doc,.xlsx,.xls,.pdf,.ppt,pptx,.png,.jpg,.jpeg,.gif,.csv' - , + // ,acceptMime: '.docx,.doc,.xlsx,.xls,.pdf,.ppt,pptx,.png,.jpg,.jpeg,.gif,.csv' + , acceptMime: '*', multiple: false //多文件 - , + , number: 1, - before: function(obj) { + before: function (obj) { this.data.code = this_code; + console.log(this.data.code); + getDingCode(); - obj.preview(function(index, file, result) { + obj.preview(function (index, file, result) { uploadNum++ pressw = '' // console.log('清空当前进度1:' + pressw); @@ -532,18 +536,18 @@ var n = 0 var that = $('.layui-upload-list .list') uploadTime = setInterval( - function() { //按照时间随机生成一个小于95的进度,具体数值可以自己调整 - n = n + Math.random() * 10 | 0; - if (n > 95) { - n = 95; - clearInterval(uploadTime); - } - that.eq(uploadNum - 1).find('i').css('width', - n + '%') - }, 50 + Math.random() * 100); + function () { //按照时间随机生成一个小于95的进度,具体数值可以自己调整 + n = n + Math.random() * 10 | 0; + if (n > 95) { + n = 95; + clearInterval(uploadTime); + } + that.eq(uploadNum - 1).find('i').css('width', + n + '%') + }, 50 + Math.random() * 100); }); }, - done: function(res, index, upload) { + done: function (res, index, upload) { if (res.code == 200) { pressw = '' // console.log('清空当前进度2:' + pressw); @@ -552,7 +556,7 @@ uploadNum + '" data-id="' + res.data.id + '" data-filename="' + res.data.name + '" data-filesize="' + res.data.size + '" data-spaceid="' + res.data.spaceId + '" value="' + res.data - .url + '" />'; + .url + '" />'; clearInterval(uploadTime); $('.progress' + uploadNum).css('width', '100%'); @@ -568,16 +572,16 @@ }); } }, - allDone: function(obj) { + allDone: function (obj) { clearInterval(uploadTime); $('.layui-upload-list .list i').css('width', '100%') } }); //选择文件夹 - form.on('submit(formFile)', function(data) { + form.on('submit(formFile)', function (data) { var navName = '' - $('#folder-navigation a').each(function() { + $('#folder-navigation a').each(function () { if ($(this).attr('data-id') == $('#navigation').val()) { navName = $(this).attr('data-name') folderIds.push({ @@ -586,7 +590,7 @@ }) } }) - $('.list-content#Chart ul li').each(function() { + $('.list-content#Chart ul li').each(function () { if ($(this).attr('class') == 'list upload_selection upload_list_acive') { filesIds.push({ @@ -604,7 +608,8 @@ }) //监听提交 - form.on('submit(formDemo)', function(data) { + form.on('submit(formDemo)', function (data) { + console.log(data); // console.log('提交时当前进度:' + pressw); if (pressw != '100%') { // console.log('不等于:' + pressw); @@ -618,23 +623,25 @@ var dingFileName = that.data('filename'); var dingFileSize = that.data('filesize'); var dingSpaceId = that.data('spaceid'); - filesIds.forEach(function(item) { + filesIds.forEach(function (item) { arr2.push(item.id) }) if (folderIds.length == 0) { layer.msg("请选择需要更新的文件", { icon: 5, shift: 6 - }, function() { + }, function () { $(".click-history").click(); }); 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: '', @@ -666,7 +673,7 @@ type: "post", contentType: "application/json", dataType: "json", - success: function(data) { + success: function (data) { if (data.code == 200) { window.location = 'renew.html'; //window.location.reload() @@ -674,7 +681,7 @@ layer.msg(data.msg) } }, - error: function(data) { + error: function (data) { console.log(data); layer.msg(data.responseJSON.msg) } @@ -698,11 +705,11 @@ type: "get", contentType: "application/x-www-form-urlencoded", dataType: "json", - success: function(data) { + success: function (data) { if (data.code == 200) { $('.renew-list select').empty() if (data.data.length > 0) { - data.data.forEach(function(item) { + data.data.forEach(function (item) { $('.renew-list select').append( '') @@ -713,7 +720,7 @@ layer.msg(data.msg) } }, - error: function(data) { + error: function (data) { console.log(data); } }); @@ -724,7 +731,7 @@ //删除文件路径 function folderDel(obj) { - folderIds.forEach(function(item, i) { + folderIds.forEach(function (item, i) { if (item.id == $(obj).attr('data-id')) { folderIds.splice(i, 1) } @@ -743,7 +750,7 @@ function init() { //返回事件 - $('.con-list .name span .icon-back').off("click").click(function() { + $('.con-list .name span .icon-back').off("click").click(function () { var that = $(this) if ($("#navigation").val() != 0) { fileAjaxData.parentFolderId = $('.con-list .name span a').eq(-2).attr('data-id') @@ -753,10 +760,10 @@ } }); //路由事件 - $('#folder-navigation a').off("click").click(function() { + $('#folder-navigation a').off("click").click(function () { var that = $(this) fileAjaxData.parentFolderId = that.attr('data-id') - $('.con-list .name span a').each(function() { + $('.con-list .name span a').each(function () { if ($(this).index() >= that.index()) { $('.con-list .name span a').eq($(this).index()).remove() } @@ -794,11 +801,11 @@ type: "get", contentType: "application/x-www-form-urlencoded", dataType: "json", - success: function(data) { + success: function (data) { if (data.code == 200) { init() if (data.data.folders.length > 0) { - data.data.folders.forEach(function(item) { + data.data.folders.forEach(function (item) { var html1 = '
    • ' + @@ -810,7 +817,7 @@ }) } if (data.data.files.length > 0) { - data.data.files.forEach(function(item) { + data.data.files.forEach(function (item) { var html1 = '
    • ' + @@ -832,11 +839,39 @@ layer.msg(data.msg) } }, - error: function(data) { + error: function (data) { console.log(data); } }); } + + function ddFile(params) { + + dd.biz.util.uploadAttachment({ + types: ["photo"], + image: { "multiple": true, "compress": false, "max": 9, "spaceId": "12345" }, + compress: true, + multiple: false, + max: 9, + isCopy: 0, + spaceId: "123", + space: { "corpId": "xxx3020", "spaceId": "12345", "isCopy": 1, "max": 9 }, + file: { "spaceId": "12345", "max": 1 }, + onSuccess: function (res) { + // 调用成功时回调 + console.log(res) + }, + onFail: function (err) { + // 调用失败时回调 + console.log(err) + } + }); + + } + + + + - + \ No newline at end of file diff --git a/src/pages/hidefile.html b/src/pages/hidefile.html index 8bb552e..e833fe2 100644 --- a/src/pages/hidefile.html +++ b/src/pages/hidefile.html @@ -2,7 +2,7 @@
      -
      +
      隐藏文件
      @@ -53,8 +53,29 @@
      -
      +
      +
      + + +
      + + +

      修改文件夹名称

      +
      +

      + 文件1 + +

      + +
      + +
      + +
      + +
      +
      - 全部文件 + 全部文件 -
        - -
      • -   -
      • -
      +
      +
      + + + +
      +
        + +
      • +   +
      • +
      +
      +
      @@ -131,7 +159,7 @@

      文件名称

      预览 - 下载 + 下载
      @@ -174,31 +202,49 @@ 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() { + $(function () { - layui.use(['form', 'upload', 'element', 'layer'], function() { + layui.use(['form', 'upload', 'element', 'layer'], function () { var form = layui.form; var upload = layui.upload; var element = layui.element; var layer = layui.layer; //var haveLogin = localStorage['haveLogin'] || false; - var loginInterval = setInterval(function() { + var loginInterval = setInterval(function () { var tmpHaveLogin = localStorage['haveLogin'] || false; if (tmpHaveLogin) { clearInterval(loginInterval); pageInit(); } }, 500); - + function pageInit() { getFileType(); getFileList(ajaxData); } - $('#toggle-filter').on('click', function() { + $('#toggle-filter').on('click', function () { layer.open({ type: 1, title: ['文件过滤', 'font-size:18px;padding:0;text-align:center'], @@ -207,8 +253,8 @@ area: ['100%', '100%'], closeBtn: 1, skin: 'file-filter-layer', - success: function(dom, index) { - dom.find('.layui-btn[lay-submit]').on('click', function() { + success: function (dom, index) { + dom.find('.layui-btn[lay-submit]').on('click', function () { layer.close(index); }); } @@ -216,7 +262,7 @@ }); //搜索 - form.on('submit(formDemo)', function(data) { + form.on('submit(formDemo)', function (data) { ajaxData = { createUser: data.field.createUser, drafter: data.field.drafter, @@ -239,23 +285,23 @@ //文件类型 function getFileType() { $.ajax({ - url: host + '/ding/file/getFileType'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), + url: host + '/ding/file/getFileType' + '?timetmp=' + Date.parse(new Date()).toString().substr(0, 10), headers: { 'Blade-Auth': 'bearer ' + accessToken, }, data: {}, type: "get", dataType: "json", - success: function(data) { + success: function (data) { if (data.code == 200) { if (data.data.length > 0) { - data.data.forEach(function(item) { + data.data.forEach(function (item) { $('.con-search select[name=type]').append( '') }) form.render() - } + } // else { // layer.msg('暂无记录') // } @@ -263,7 +309,7 @@ layer.msg(data.msg) } }, - error: function(data) { + error: function (data) { console.log(data); } }); @@ -273,11 +319,11 @@ }) function init() { - $('.con-list .name span .icon-back').off("click").click(function() { + $('.con-list .name span .icon-back').off("click").click(function () { var that = $(this); if (serch_flag) { $("#search-form")[0].reset(); - layui.use(['form'], function() { + layui.use(['form'], function () { var form = layui.form; form.render(); }) @@ -315,12 +361,12 @@ serch_flag = false; }); //路由事件 - $('#folder-navigation a').off("click").click(function() { + $('#folder-navigation a').off("click").click(function () { var that = $(this) console.log(that.attr('data-id'), 'parentFolderId'); ajaxData.parentFolderId = that.attr('data-id') ajaxData.name = ''; - $('.con-list .name span a').each(function() { + $('.con-list .name span a').each(function () { if ($(this).index() >= that.index()) { $('.con-list .name span a').eq($(this).index()).remove() } @@ -334,7 +380,7 @@ //历史记录 function getHistory(obj) { $.ajax({ - url: host + '/ding/file/getHistory'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), + url: host + '/ding/file/getHistory' + '?timetmp=' + Date.parse(new Date()).toString().substr(0, 10), headers: { 'Blade-Auth': 'bearer ' + accessToken, }, @@ -343,18 +389,18 @@ }, type: "get", dataType: "json", - success: function(data) { + success: function (data) { if (data.code == 200) { if (data.data.length > 0) { var html = ''; - data.data.forEach(function(item) { + data.data.forEach(function (item) { html += '
    • ' + '' html += '' + - '' + '' + '' + @@ -558,30 +770,28 @@ }) } if (data.data.files.length > 0) { - data.data.files.forEach(function(item) { + data.data.files.forEach(function (item) { var html1 = - '
    • ' - - - + '
      ' - + '...' - + '
      显示
      ' - + '
      '+ - - - '
      ' + + (item.isPublic == "0" ? + "" : "") + + + '' + + '
      ' + '
      ' + item.name + '
      ' + '
    • ' $('.list-content#Chart ul').append(html1) var html2 = '' + + '' + '' + '
      账号操作类型文件名称操作时间
      账号操作类型文件名称操作时间
      ' + item.username + '
      '; @@ -520,6 +530,10 @@ html += '文件下载'; } else if (item.type == 3) { html += '文件更新'; + } else if (item.type == 4) { + html += '文件隐藏'; + } else if (item.type == 5) { + html += '文件显示'; } html += '' + item.fileName + '
      ' + item.name + '
      '; @@ -369,7 +415,7 @@ }) $(".history .table tbody").html(html) $(".history").show(); - } + } // else { // layer.msg('暂无记录') // } @@ -377,7 +423,7 @@ layer.msg(data.msg) } }, - error: function(data) { + error: function (data) { console.log(data); } }); @@ -385,7 +431,57 @@ } //打开文件夹 + function openIf(data) { + if (dataEditor.editorIf) { + if ($(data).attr("data-if") == 1) { + openFolder(data) + } else { + openFile(data) + } + } else { + if ($(data).attr("data-click") == "1") { + if ($(data).attr("data-if") == 1) { + $(data).children(".list-img").css("display", "block") + $(data).css("background", "#f5f6ff") + dataEditor.editorData.push({ + id: $(data).attr("data-id"), + folder: true + }) + } else { + $(data).prev().css("display", "block") + $(data).parent().css("background", "#f5f6ff") + + dataEditor.editorData.push({ + id: $(data).attr("data-id"), + folder: false + }) + + } + $(data).attr("data-click", "0") + } else { + if ($(data).attr("data-if") == 1) { + $(data).children(".list-img").css("display", "none") + $(data).css("background", "#fff") + let ina = screening(dataEditor.editorData, $(data).attr("data-id")) + dataEditor.editorData.splice(ina, 1) + } else { + $(data).prev().css("display", "none") + $(data).parent().css("background", "#fff") + let ina = screening(dataEditor.editorData, $(data).attr("data-id")) + dataEditor.editorData.splice(ina, 1) + } + $(data).attr("data-click", "1") + } + + console.log(dataEditor.editorData); + + } + + } function openFolder(obj) { + dataEditor.editorData = [] + dataEditor.editorIf = true + ajaxData.parentFolderId = $(obj).attr('data-id') getFileList(ajaxData) $("#navigation").val($(obj).attr('data-id')); @@ -397,7 +493,7 @@ function downloadfile(obj) { var id = $(obj).data('fileid'); $.ajax({ - url: host + '/ding/file/downLoadFile'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), + url: host + '/ding/file/downLoadFile' + '?timetmp=' + Date.parse(new Date()).toString().substr(0, 10), headers: { 'Blade-Auth': 'bearer ' + localStorage.accessToken }, @@ -407,17 +503,17 @@ type: "get", contentType: "application/json", dataType: "json", - success: function(data) { + success: function (data) { if (data.code == 200) { $(obj).attr('data', data.data); console.log(data.data); - - window.open(data.data); + + window.open(data.data); } else { layer.msg(data.msg) } }, - error: function(data) { + error: function (data) { console.log(data); } }); @@ -476,52 +572,167 @@ // } // }); } - + //隐藏文件 - function hideFile(obj){ - layer.confirm('确认显示这个文件吗?', { - btn: ['确认', '取消'] //可以无限个按钮 - , - }, function(index, layero){ - //按钮【按钮一】的回调 - $.ajax({ - url: host + '/ding/file/disPlayFile'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), - headers: { - 'Blade-Auth': 'bearer ' + localStorage.accessToken - }, - data: { - fileId:$(obj).attr("data-id"), - isShow:1 - }, - type: "get", - contentType: "application/x-www-form-urlencoded", - dataType: "json", - success: function(data) { - if(data.code==200){ - layer.msg('显示成功') - getFileList(ajaxData) - }else{ - layer.msg(data.msg) - } - - }, - error: function(data) { - console.log(data); - } - }) - }, function(index){ - //按钮【按钮二】的回调 - layer.closeAll(); + 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('确认隐藏这个文件吗?', { + btn: ['确认', '取消'] //可以无限个按钮 + , + }, function (index, layero) { + //按钮【按钮一】的回调 + $.ajax({ + url: host + '/ding/file/disPlayFile' + '?timetmp=' + Date.parse(new Date()).toString() + .substr(0, 10), + headers: { + 'Blade-Auth': 'bearer ' + localStorage.accessToken + }, + data: { + fileId: $(obj).attr("data-id"), + isShow: 0 + }, + type: "get", + contentType: "application/x-www-form-urlencoded", + dataType: "json", + success: function (data) { + if (data.code == 200) { + layer.msg('隐藏成功') + getFileList(ajaxData) + } else { + layer.msg(data.msg) + } + + }, + error: function (data) { + console.log(data); + layer.msg(data.responseJSON.msg) + } + }) + }, function (index) { + //按钮【按钮二】的回调 + layer.closeAll(); + }); + return false; + } + + //修改文件名 + function editorName() { + console.log(dataEditor.rows, "--------------"); + console.log(dataEditor.editorData, "--------------"); + var arr2 = dataEditor.editorData.some(function (v) { + return v.folder == true; + }); + if (arr2) { + layer.msg("不能重命名文件夹") + return + } + let editorNameData = [] + for (let index = 0; index < dataEditor.editorData.length; index++) { + for (let k = 0; k < dataEditor.rows.files.length; k++) { + if (dataEditor.editorData[index].id == dataEditor.rows.files[k].id) { + editorNameData.push(dataEditor.rows.files[k]) + } + + } + + } + + $(".nameMake").css("display", "flex") + let str = editorNameData.map((v, i) => `

      + 文件${i + 1} + +

      `).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'); $('.list-content#Chart ul').empty() $('.list-content#tab tbody').empty() $.ajax({ - url: host + '/ding/file/getDisplayFile'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10), + url: host + '/ding/file/getDisplayFile' + '?timetmp=' + Date.parse(new Date()).toString().substr(0, 10), headers: { 'Blade-Auth': 'bearer ' + localStorage.accessToken }, @@ -529,21 +740,22 @@ type: "get", contentType: "application/x-www-form-urlencoded", dataType: "json", - success: function(data) { + success: function (data) { + dataEditor.rows = data.data if (data.code == 200) { init() if (data.data.folders.length > 0) { - data.data.folders.forEach(function(item) { + data.data.folders.forEach(function (item) { var html1 = - '
    • ' + - '
      ' + + '
    • ' + + '' + + '
      ' + '
      ' + item.name + '
      ' + '
    • ' $('.list-content#Chart ul').append(html1) var html2 = '
      ' + item.name + + '
      ' + item.name + '
      ' - + + '
      ' + '...' + '
      显示
      ' @@ -589,8 +799,8 @@ + '
      ' + item.name + '
      ' + item.number + '
      ' + item.drafter + @@ -618,7 +828,7 @@ layer.msg(data.msg) } }, - error: function(data) { + error: function (data) { console.log(data); } }); @@ -628,4 +838,4 @@ - + \ No newline at end of file diff --git a/src/pages/index.html b/src/pages/index.html index dc561d1..59a5753 100644 --- a/src/pages/index.html +++ b/src/pages/index.html @@ -53,8 +53,30 @@
      -
      +
      + +
      + + +
      + + +

      修改文件夹名称

      +
      +

      + 文件1 + +

      + +
      + +
      + +
      + +
      +
      -
      +
      +
      +
      +

      修改文件夹名称

      +
      +

      + 文件1 + +

      +
      +
      + +
      + +
      +
      +
      +
      +
      +
      +
      +

      选择文件路径

      +
      +   +
      + + +
      +
      + 全部文件 + +
      +
      +
      +
        +
        +
        + + +
        + +
        + + +
        +
        +
        +
        +
        @@ -144,20 +192,30 @@ - + + \ No newline at end of file diff --git a/src/pages/record.html b/src/pages/record.html index 0861034..e9f82b8 100644 --- a/src/pages/record.html +++ b/src/pages/record.html @@ -33,6 +33,8 @@ + +
        @@ -53,12 +55,12 @@
        - - - - - - + + + + + + @@ -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; }); @@ -171,7 +174,7 @@ title: '操作记录', body: $('.con-search'), success: function ($el, idx) { - $el.find('.layui-form').css({padding: '20px'}) + $el.find('.layui-form').css({ padding: '20px' }) $el.find('.font-18').hide() $el.find('button[lay-submit]').on('click', function () { layer.close(idx) @@ -207,13 +210,19 @@ case '3': item.type = '文件更新'; break; + case '4': + item.type = '文件隐藏'; + break; + case '5': + item.type = '文件显示'; + break; default: item.type = '未知类型'; break; } return item }) - $items.html(layui.laytpl(itemTpl).render({items: items})) + $items.html(layui.laytpl(itemTpl).render({ items: items })) return } @@ -221,6 +230,7 @@ if (data.data.records.length > 0) { var html = ''; data.data.records.forEach(function (item, i) { + html += ''; html += ''; html += ''; html += ''; @@ -292,4 +306,4 @@ }); - + \ No newline at end of file diff --git a/src/pages/renewadd.html b/src/pages/renewadd.html index 5912ea5..fbe686c 100644 --- a/src/pages/renewadd.html +++ b/src/pages/renewadd.html @@ -43,29 +43,31 @@
        - +
        - +
        - +
        - + +
        +
        +
        + +
        +
        @@ -91,6 +93,7 @@
        +
        @@ -125,8 +128,7 @@
        @@ -164,9 +166,9 @@ var folderIds = [] var filesIds = [] - $(function() { + $(function () { - $(".click-history").click(function() { + $(".click-history").click(function () { $('.upload').show() getFileList(fileAjaxData) }); @@ -177,22 +179,22 @@ function getDingCode() { dd.runtime.permission.requestAuthCode({ corpId: corpId, - onSuccess: function(result) { + onSuccess: function (result) { this_code = result.code; }, - onFail: function(err) { + onFail: function (err) { console.log(err) } }); } - layui.use(['form', 'formSelects', 'upload', 'element', 'layer'], function() { + layui.use(['form', 'formSelects', 'upload', 'element', 'layer'], function () { var form = layui.form; var formSelects = layui.formSelects; var upload = layui.upload; var element = layui.element; var layer = layui.layer; - var renewaddIntervalScript = setInterval(function() { + var renewaddIntervalScript = setInterval(function () { var tmpHaveLogin = localStorage['haveLogin'] || false; if (tmpHaveLogin) { clearInterval(renewaddIntervalScript); @@ -200,7 +202,7 @@ } }, 500); - form.on('radio(isPublic)', function(data) { + form.on('radio(isPublic)', function (data) { fileAjaxData.isPublic = data.value getMainDeptList(fileAjaxData.isPublic) }); @@ -218,16 +220,18 @@ }, field: 'file', accept: 'file' - // ,acceptMime: '.docx,.doc,.xlsx,.xls,.pdf,.ppt,pptx,.png,.jpg,.jpeg,.gif,.csv' - , + // ,acceptMime: '.docx,.doc,.xlsx,.xls,.pdf,.ppt,pptx,.png,.jpg,.jpeg,.gif,.csv' + , acceptMime: '*', multiple: false //多文件 - , + , number: 1, - before: function(obj) { + before: function (obj) { this.data.code = this_code; + console.log(this.data.code); + getDingCode(); - obj.preview(function(index, file, result) { + obj.preview(function (index, file, result) { uploadNum++ pressw = '' // console.log('清空当前进度1:' + pressw); @@ -242,18 +246,18 @@ var n = 0 var that = $('.layui-upload-list .list') uploadTime = setInterval( - function() { //按照时间随机生成一个小于95的进度,具体数值可以自己调整 - n = n + Math.random() * 10 | 0; - if (n > 95) { - n = 95; - clearInterval(uploadTime); - } - that.eq(uploadNum - 1).find('i').css('width', - n + '%') - }, 50 + Math.random() * 100); + function () { //按照时间随机生成一个小于95的进度,具体数值可以自己调整 + n = n + Math.random() * 10 | 0; + if (n > 95) { + n = 95; + clearInterval(uploadTime); + } + that.eq(uploadNum - 1).find('i').css('width', + n + '%') + }, 50 + Math.random() * 100); }); }, - done: function(res, index, upload) { + done: function (res, index, upload) { if (res.code == 200) { pressw = '' // console.log('清空当前进度2:' + pressw); @@ -262,7 +266,7 @@ uploadNum + '" data-id="' + res.data.id + '" data-filename="' + res.data.name + '" data-filesize="' + res.data.size + '" data-spaceid="' + res.data.spaceId + '" value="' + res.data - .url + '" />'; + .url + '" />'; clearInterval(uploadTime); $('.progress' + uploadNum).css('width', '100%'); @@ -278,16 +282,16 @@ }); } }, - allDone: function(obj) { + allDone: function (obj) { clearInterval(uploadTime); $('.layui-upload-list .list i').css('width', '100%') } }); //选择文件夹 - form.on('submit(formFile)', function(data) { + form.on('submit(formFile)', function (data) { var navName = '' - $('#folder-navigation a').each(function() { + $('#folder-navigation a').each(function () { if ($(this).attr('data-id') == $('#navigation').val()) { navName = $(this).attr('data-name') folderIds.push({ @@ -296,7 +300,7 @@ }) } }) - $('.list-content#Chart ul li').each(function() { + $('.list-content#Chart ul li').each(function () { if ($(this).attr('class') == 'list upload_selection upload_list_acive') { filesIds.push({ @@ -314,7 +318,8 @@ }) //监听提交 - form.on('submit(formDemo)', function(data) { + form.on('submit(formDemo)', function (data) { + console.log(data); // console.log('提交时当前进度:' + pressw); if (pressw != '100%') { // console.log('不等于:' + pressw); @@ -328,23 +333,25 @@ var dingFileName = that.data('filename'); var dingFileSize = that.data('filesize'); var dingSpaceId = that.data('spaceid'); - filesIds.forEach(function(item) { + filesIds.forEach(function (item) { arr2.push(item.id) }) if (folderIds.length == 0) { layer.msg("请选择需要更新的文件", { icon: 5, shift: 6 - }, function() { + }, function () { $(".click-history").click(); }); 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: '', @@ -376,7 +383,7 @@ type: "post", contentType: "application/json", dataType: "json", - success: function(data) { + success: function (data) { if (data.code == 200) { window.location = 'renew.html'; //window.location.reload() @@ -384,7 +391,7 @@ layer.msg(data.msg) } }, - error: function(data) { + error: function (data) { console.log(data); layer.msg(data.responseJSON.msg) } @@ -408,11 +415,11 @@ type: "get", contentType: "application/x-www-form-urlencoded", dataType: "json", - success: function(data) { + success: function (data) { if (data.code == 200) { $('.renew-list select').empty() if (data.data.length > 0) { - data.data.forEach(function(item) { + data.data.forEach(function (item) { $('.renew-list select').append( '') @@ -423,7 +430,7 @@ layer.msg(data.msg) } }, - error: function(data) { + error: function (data) { console.log(data); } }); @@ -434,7 +441,7 @@ //删除文件路径 function folderDel(obj) { - folderIds.forEach(function(item, i) { + folderIds.forEach(function (item, i) { if (item.id == $(obj).attr('data-id')) { folderIds.splice(i, 1) } @@ -453,7 +460,7 @@ function init() { //返回事件 - $('.con-list .name span .icon-back').off("click").click(function() { + $('.con-list .name span .icon-back').off("click").click(function () { var that = $(this) if ($("#navigation").val() != 0) { fileAjaxData.parentFolderId = $('.con-list .name span a').eq(-2).attr('data-id') @@ -463,10 +470,10 @@ } }); //路由事件 - $('#folder-navigation a').off("click").click(function() { + $('#folder-navigation a').off("click").click(function () { var that = $(this) fileAjaxData.parentFolderId = that.attr('data-id') - $('.con-list .name span a').each(function() { + $('.con-list .name span a').each(function () { if ($(this).index() >= that.index()) { $('.con-list .name span a').eq($(this).index()).remove() } @@ -504,11 +511,11 @@ type: "get", contentType: "application/x-www-form-urlencoded", dataType: "json", - success: function(data) { + success: function (data) { if (data.code == 200) { init() if (data.data.folders.length > 0) { - data.data.folders.forEach(function(item) { + data.data.folders.forEach(function (item) { var html1 = '
      • ' + @@ -520,7 +527,7 @@ }) } if (data.data.files.length > 0) { - data.data.files.forEach(function(item) { + data.data.files.forEach(function (item) { var html1 = '
      • ' + @@ -542,11 +549,39 @@ layer.msg(data.msg) } }, - error: function(data) { + error: function (data) { console.log(data); } }); } + + function ddFile(params) { + + dd.biz.util.uploadAttachment({ + types: ["photo"], + image: { "multiple": true, "compress": false, "max": 9, "spaceId": "12345" }, + compress: true, + multiple: false, + max: 9, + isCopy: 0, + spaceId: "123", + space: { "corpId": "xxx3020", "spaceId": "12345", "isCopy": 1, "max": 9 }, + file: { "spaceId": "12345", "max": 1 }, + onSuccess: function (res) { + // 调用成功时回调 + console.log(res) + }, + onFail: function (err) { + // 调用失败时回调 + console.log(err) + } + }); + + } + + + + - + \ No newline at end of file
      • 账号操作类型文件名称操作时间
        账号操作类型文件名称操作时间
        ' + item.username + '
        '; @@ -230,6 +240,10 @@ html += '文件下载'; } else if (item.type == 3) { html += '文件更新'; + } else if (item.type == 4) { + html += '文件隐藏'; + } else if (item.type == 5) { + html += '文件显示'; } html += '' + item.fileName + '