927 lines
40 KiB
HTML
927 lines
40 KiB
HTML
<!doctype html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8" />
|
||
<title>公共文件</title>
|
||
<meta http-equiv="Access-Control-Allow-Origin" content="*">
|
||
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
|
||
<meta name="format-detection" content="telephone=no" />
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||
<meta name="renderer" content="webkit|ie-comp|ie-stand">
|
||
<meta name="Keywords" content="">
|
||
<meta name="description" content="">
|
||
<link rel="shortcut icon" type="image/ico" href="/favicon.ico">
|
||
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
|
||
<link href="js/layui/css/layui.css" rel="stylesheet" type="text/css" />
|
||
<link rel="stylesheet" type="text/css" href="css/style.css?v=8" />
|
||
<link rel="stylesheet" type="text/css" media="screen and (max-width: 768px)" href="css/mobile.css?v=3" />
|
||
<script src="js/jquery-3.4.1.min.js" type="text/javascript" charset="utf-8"></script>
|
||
<script src="js/dx_bootstrap.js" type="text/javascript" charset="utf-8"></script>
|
||
<script src="js/dingtalk.open.js" type="text/javascript" charset="utf-8"></script>
|
||
<script src="js/layui/layui.js" type="text/javascript" charset="utf-8"></script>
|
||
<script src="js/script.js?v=1" type="text/javascript" charset="utf-8"></script>
|
||
</head>
|
||
<body class="w-100 p-40">
|
||
<div class="head p-25">
|
||
<div class="head-tit f-l">
|
||
<span class="color-w font-18">文件池管理</span>
|
||
</div>
|
||
<div class="head-other f-r">
|
||
<div class="head-news f-l">
|
||
<!-- <div class="head-news-icon">
|
||
<img src="image/icon_02.png">
|
||
<span class="color-w"></span>
|
||
</div> -->
|
||
<div class="head-drop-down">
|
||
<ul class="down-ul">
|
||
<li data-id="1">系统通知(<i>0</i>)</li>
|
||
<li data-id="2">下载告警(<i>0</i>)</li>
|
||
</ul>
|
||
<div class="down-con">
|
||
<div>
|
||
<ul class="down-list list1">
|
||
</ul>
|
||
<ul class="down-list">
|
||
<li class="down-list-center">
|
||
<a href="notice.html" class="color-g6 font-14 t-c">查看全部</a>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
<div>
|
||
<ul class="down-list list2">
|
||
</ul>
|
||
<ul class="down-list">
|
||
<li class="down-list-center">
|
||
<a href="notice.html" class="color-g6 font-14 t-c">查看全部</a>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<div class="operation font-14">
|
||
<div class="f-l operation-list operation-icon">全部已读</div>
|
||
<div class="f-r operation-list"><a href="#" class="color-b">历史通知</a></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="head-name f-r">
|
||
<div class="img f-l">
|
||
<img src="image/img_01.png">
|
||
</div>
|
||
<div class="name color-w f-l">钉钉用户名称</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="f-l nav">
|
||
<ul class="layui-nav layui-nav-tree" lay-filter="test" id="forMenu">
|
||
<!-- <li class="layui-nav-item" data-id="1">
|
||
<a href="index.html" class="nav-icon-public">公共文件</a>
|
||
</li>
|
||
<li class="layui-nav-item" data-id="2"><a href="inside.html" class="nav-icon-inside">内部文件</a></li>
|
||
<li class="layui-nav-item" data-id="3"><a href="upload.html" class="nav-icon-upload">文件上传</a></li>
|
||
<li class="layui-nav-item" data-id="4"><a href="renew.html" class="nav-icon-renew">文件更新</a></li>
|
||
<li class="layui-nav-item" data-id="5">
|
||
<a href="javascript:;" class="nav-icon-set">设置</a>
|
||
<dl class="layui-nav-child">
|
||
<dd><a href="organization.html">组织设置</a></dd>
|
||
<dd><a href="Administration.html">主管理设置</a></dd>
|
||
<dd><a href="field.html">自定义字段</a></dd>
|
||
<dd><a href="record.html">操作记录</a></dd>
|
||
</dl>
|
||
</li>
|
||
<li class="layui-nav-item" data-id="6"><a href="notice.html" class="nav-icon-notice">通知</a></li> -->
|
||
</ul>
|
||
</div>
|
||
<script type="text/javascript">
|
||
|
||
|
||
layui.use(['element','layer'], function(){
|
||
var element = layui.element;
|
||
// $(window).on("load", function() {
|
||
$('.nav .layui-nav-tree .layui-nav-item').each(function(i){
|
||
var that = $(this)
|
||
var newNum = $('.content-auto').attr('data-id')
|
||
if(newNum == that.attr('data-id')){
|
||
$('.nav .layui-nav-tree .layui-nav-item').removeClass('layui-nav-itemed').eq(i).addClass('layui-nav-itemed')
|
||
$('.nav .layui-nav-tree .layui-nav-item .layui-nav-child dd').each(function(){
|
||
if($(this).index()+1 == $('.content-auto').attr('data-two')){
|
||
$(this).find('a').addClass('active')
|
||
}
|
||
})
|
||
}
|
||
});
|
||
var menuUrl = {};
|
||
menuUrl['menu1'] = 'index.html';
|
||
menuUrl['menu2'] = 'inside.html';
|
||
menuUrl['menu3'] = 'upload.html';
|
||
menuUrl['menu4'] = 'renew.html';
|
||
menuUrl['menu5'] = 'index.html';
|
||
menuUrl['menu6'] = 'notice.html';
|
||
menuUrl['menu7'] = 'organization.html';
|
||
menuUrl['menu8'] = 'Administration.html';
|
||
menuUrl['menu9'] = 'field.html';
|
||
menuUrl['menu10'] = 'record.html';
|
||
menuUrl['menu10'] = 'hidefile.html';
|
||
var menuClass = {};
|
||
menuClass['menu1'] = 'nav-icon-public';
|
||
menuClass['menu2'] = 'nav-icon-inside';
|
||
menuClass['menu3'] = 'nav-icon-upload';
|
||
menuClass['menu4'] = 'nav-icon-renew';
|
||
menuClass['menu5'] = 'nav-icon-set';
|
||
menuClass['menu6'] = 'nav-icon-notice';
|
||
var menuIcon = {};
|
||
menuIcon['menu1'] = 'inco_app08';
|
||
menuIcon['menu2'] = 'inco_app08';
|
||
menuIcon['menu3'] = 'inco_app07';
|
||
|
||
menuIcon['menu4'] = 'inco_app06';
|
||
menuIcon['menu5'] = 'inco_app08';
|
||
menuIcon['menu6'] = 'inco_app12';
|
||
menuIcon['menu7'] = 'inco_app08';
|
||
menuIcon['menu8'] = 'inco_app09';
|
||
menuIcon['menu9'] = 'inco_app11';
|
||
menuIcon['menu10'] = 'inco_app10';
|
||
var haveLogin = localStorage['haveLogin'] || false;
|
||
if(haveLogin){
|
||
getMenu();
|
||
}else{
|
||
var loginIntervalLefter = setInterval(function(){
|
||
var tmpHaveLogin = localStorage['haveLogin'] || false;
|
||
if(tmpHaveLogin){
|
||
clearInterval(loginIntervalLefter);
|
||
getMenu();
|
||
}
|
||
}, 500);
|
||
}
|
||
|
||
function getMenu(){
|
||
var url = host + '/ding/menu/getMenuList';
|
||
dxtcRequest('get', url, {}, function(data) {
|
||
var newNum = $('.content-auto').attr('data-id');
|
||
if (data.code == 200) {
|
||
if(data.data.length > 0){
|
||
var html = '';
|
||
var phoneHtml = '';
|
||
var funcSectionBase = '';
|
||
var funcSectionConfig = '';
|
||
var funcSectionNotice = '';
|
||
var extHtml = '<div class="wh76"></div>';
|
||
data.data.forEach(function(item){
|
||
var classStr = '';
|
||
if(item.id == newNum){
|
||
classStr = 'layui-nav-itemed';
|
||
}
|
||
html += '<li class="layui-nav-item '+classStr+'" data-id="'+item.id+'">';
|
||
if(item.hasChildren){
|
||
var childMenuId = $('.content-auto').attr('data-two')
|
||
html += '<a href="javascript:;" class="'+menuClass['menu'+item.id]+'" >'+item.name+'</a>';
|
||
html += '<dl class="layui-nav-child">';
|
||
item.children.forEach(function(child){
|
||
var activeClass = '';
|
||
if(child.sort == childMenuId){
|
||
activeClass = 'active';
|
||
}
|
||
html += '<dd><a href="'+menuUrl['menu'+child.id]+'" class="'+activeClass+'">'+child.name+'</a></dd>';
|
||
});
|
||
html += '</dl>';
|
||
}else{
|
||
html += '<a href="'+menuUrl['menu'+item.id]+'" class="'+menuClass['menu'+item.id]+'">'+item.name+'</a>';
|
||
}
|
||
html += '</li>';
|
||
|
||
// 手机版文件夹 只取id<=2
|
||
if (item.id <= 2) {
|
||
let activeStr = '';
|
||
let urlStr = `${menuUrl['menu'+item.id]}`;
|
||
if (item.id == newNum) {
|
||
classStr = 'active';
|
||
urlStr = 'javascript:;';
|
||
}
|
||
phoneHtml += `<a href="${urlStr}" class="${classStr}">${item.name}</a>`;
|
||
}
|
||
|
||
// 手机版功能区 基本区域
|
||
if ($.inArray(item.id, [3, 4]) >= 0) {
|
||
funcSectionBase += `<div class="wh76 ">
|
||
<a href="${menuUrl['menu'+item.id]}" class="flexcolumn">
|
||
<img src="image/icon-app/${menuIcon['menu'+item.id]}.png" class="wh50" alt="">
|
||
<div class="displayCenter fontS12 margitt7">${item.name}</div>
|
||
</a>
|
||
</div>`;
|
||
}
|
||
|
||
// 手机版功能区 设置区域
|
||
if (item.id === 5) {
|
||
item.children.forEach(function(it) {
|
||
funcSectionConfig += `<div class="wh76 ">
|
||
<a href="${menuUrl['menu'+it.id]}" class="flexcolumn">
|
||
<img src="image/icon-app/${menuIcon['menu'+it.id]}.png" class="wh50" alt="">
|
||
<div class="displayCenter fontS12 margitt7">${it.name}</div>
|
||
</a>
|
||
</div>`;
|
||
});
|
||
}
|
||
// 手机版功能区 通知区域
|
||
if (item.id === 6) {
|
||
funcSectionNotice += `<div class="wh76 ">
|
||
<a href="${menuUrl['menu'+item.id]}" class="flexcolumn">
|
||
<img src="image/icon-app/${menuIcon['menu'+item.id]}.png" class="wh50" alt="">
|
||
<div class="displayCenter fontS12 margitt7">${item.name}</div>
|
||
</a>
|
||
</div>`;
|
||
}
|
||
});
|
||
|
||
let baseCount = $(funcSectionBase).find('a').length;
|
||
let configCount = $(funcSectionConfig).find('a').length;
|
||
let noticeCount = $(funcSectionNotice).find('a').length;
|
||
funcSectionBase += baseCount > 0 ? extHtml.repeat(4-baseCount) : '';
|
||
funcSectionConfig += configCount > 0 ? extHtml.repeat(4-configCount) : '';
|
||
funcSectionNotice += noticeCount > 0 ? extHtml.repeat(4-noticeCount) : '';
|
||
$('#forMenu').html(html);
|
||
$('#phone-menu').html(phoneHtml);
|
||
$('#func-section').find('.base').html(funcSectionBase);
|
||
$('#func-section').find('.config').html(funcSectionConfig);
|
||
$('#func-section').find('.notice').html(funcSectionNotice);
|
||
|
||
|
||
element.init();
|
||
}
|
||
} else {
|
||
layer.msg(data.msg)
|
||
}
|
||
});
|
||
}
|
||
})
|
||
</script>
|
||
<!--内容-->
|
||
<div class="f-r content content-pd-50">
|
||
<div class="content-auto" data-id="1">
|
||
<div class="con-tit font-20 pc-block">
|
||
公共文件
|
||
</div>
|
||
<div class="con-search bg-w top20 phone-top-0">
|
||
<form class="layui-form" id="search-form">
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">文件类型:</label>
|
||
<div class="layui-input-block">
|
||
<select name="type">
|
||
<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" name="drafter" class="layui-input" placeholder="请输入拟稿人">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">发布人:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="createUser" class="layui-input" placeholder="请输入发布人">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">时间段:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="times" class="layui-input layui-time-time" placeholder="请选择时间段">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">文件号:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="fileNum" class="layui-input" placeholder="请输入文件号">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">文件名:</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="name" class="layui-input" placeholder="请输入文件名">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<button class="layui-btn" id="formDemo" lay-submit lay-filter="formDemo">搜索</button>
|
||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
<!--内容-->
|
||
<div class="con-list bg-w top20 phone-bg-none phone-top-0">
|
||
<!--手机-->
|
||
<div class="phone-tit phone-block">
|
||
<div class="name" id="phone-menu">
|
||
<!-- <a href="javascript:;" class="active">公共文件</a>
|
||
<a href="inside.html" >内部文件</a> -->
|
||
</div>
|
||
<ul class="con-list-mero con-list-none" role="tablist">
|
||
<li role="presentation" class="active">
|
||
<a class="img-list" href="#Chart" aria-controls="Chart" role="tab" data-toggle="tab"> </a>
|
||
</li>
|
||
<li role="presentation">
|
||
<a href="#tab" aria-controls="tab" role="tab" data-toggle="tab" class="tab-list"> </a>
|
||
</li>
|
||
</ul>
|
||
<div class="toolbox">
|
||
<ul class="con-list-mero filter-icon" style="display:none">
|
||
<li role="presentation">
|
||
<a href="javascript:void(0);" id="toggle-filter"> </a>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<!--pc-->
|
||
<div class="name">
|
||
<span class="font-14" id="folder-navigation"><i class="icon-back"></i><a href="index.html"
|
||
data-id="0">全部文件</a></span>
|
||
<input type="hidden" id="navigation" value="">
|
||
<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"> </a>
|
||
</li>
|
||
<li role="presentation">
|
||
<a href="#tab" aria-controls="tab" role="tab" data-toggle="tab" class="tab-list"> </a>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
<div class="con-list-cn tab-content">
|
||
<div class="list-content active tab-pane" role="tabpanel" id="Chart">
|
||
<ul></ul>
|
||
</div>
|
||
<div class="list-content tab-pane" role="tabpanel" id="tab">
|
||
<table class="table">
|
||
<thead>
|
||
<tr>
|
||
<th>文件名称</th>
|
||
<th>文件号</th>
|
||
<th>拟稿人</th>
|
||
<th>发布人</th>
|
||
<th>文件类型</th>
|
||
<th>修改时间</th>
|
||
<th>操作</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody></tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
<!-- 无内容 -->
|
||
<div class="no-con-list">
|
||
<img src="image/img_02.jpg">
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<!--点击弹出下载-->
|
||
<div class="download">
|
||
<div class="center-center download-hight">
|
||
<div class="download-content bg-w t-c">
|
||
<a href="javascript:;" class="close"> </a>
|
||
<div class="text">
|
||
<img src="">
|
||
<h3>文件名称</h3>
|
||
<p></p>
|
||
<a href="#" class="btn1" id="preview-button" onclick="previewBtn(this)">预览</a>
|
||
<a onclick="downloadfile(this)" id="download" class="btn2" download="">下载</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!--点击弹出历史记录-->
|
||
<div class="history">
|
||
<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"> </a>
|
||
<div class="p-25">
|
||
<table class="table">
|
||
<thead>
|
||
<tr>
|
||
<th>文件名称</th>
|
||
<th>文件类型</th>
|
||
<th>修改时间</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<script type="text/javascript">
|
||
var ajaxData = {
|
||
createUser: '',
|
||
drafter: '',
|
||
fileNum: '',
|
||
isPublic: 1,
|
||
name: '',
|
||
parentFolderId: 0,
|
||
endTime: '',
|
||
startTime: '',
|
||
type: ''
|
||
}
|
||
|
||
var serch_flag = false;
|
||
|
||
$(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;
|
||
if (haveLogin) {
|
||
pageInit();
|
||
} else {
|
||
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() {
|
||
layer.open({
|
||
type: 1,
|
||
title: ['文件过滤', 'font-size:18px;padding:0;text-align:center'],
|
||
content: $('#search-form'),
|
||
offset: [0, 0],
|
||
area: ['100%', '100%'],
|
||
closeBtn: 1,
|
||
skin: 'file-filter-layer',
|
||
success: function(dom, index) {
|
||
dom.find('.layui-btn[lay-submit]').on('click', function() {
|
||
layer.close(index);
|
||
});
|
||
}
|
||
})
|
||
});
|
||
|
||
//搜索
|
||
form.on('submit(formDemo)', function(data) {
|
||
ajaxData = {
|
||
createUser: data.field.createUser,
|
||
drafter: data.field.drafter,
|
||
fileNum: data.field.fileNum,
|
||
isPublic: 1,
|
||
name: data.field.name,
|
||
//parentFolderId: $("#navigation").val(),
|
||
parentFolderId: '',
|
||
startTime: data.field.times.split(' - ')[0] || '',
|
||
endTime: data.field.times.split(' - ')[1] || '',
|
||
type: data.field.type
|
||
}
|
||
// $("#navigation").val(0)
|
||
// $('.con-list .name span a').next().remove()
|
||
getFileList(ajaxData);
|
||
serch_flag = true;
|
||
return false;
|
||
});
|
||
|
||
//文件类型
|
||
function getFileType() {
|
||
$.ajax({
|
||
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) {
|
||
if (data.code == 200) {
|
||
if (data.data.length > 0) {
|
||
data.data.forEach(function(item) {
|
||
$('.con-search select[name=type]').append(
|
||
'<option value="' + item + '">' + item +
|
||
'</option>')
|
||
})
|
||
form.render()
|
||
}
|
||
// else {
|
||
// layer.msg('暂无记录')
|
||
// }
|
||
} else {
|
||
layer.msg(data.msg)
|
||
}
|
||
},
|
||
error: function(data) {
|
||
console.log(data);
|
||
}
|
||
});
|
||
}
|
||
});
|
||
|
||
})
|
||
|
||
function init() {
|
||
$('.con-list .name span .icon-back').off("click").click(function() {
|
||
var that = $(this);
|
||
if (serch_flag) {
|
||
$("#search-form")[0].reset();
|
||
layui.use(['form'], function() {
|
||
var form = layui.form;
|
||
form.render();
|
||
})
|
||
$("#navigation").val($('.con-list .name span a').last().attr('data-id'))
|
||
var ajaxData = {
|
||
createUser: '',
|
||
drafter: '',
|
||
fileNum: '',
|
||
isPublic: 1,
|
||
name: '',
|
||
parentFolderId: parseInt($('.con-list .name span a').last().attr('data-id')),
|
||
endTime: '',
|
||
startTime: '',
|
||
type: ''
|
||
}
|
||
getFileList(ajaxData);
|
||
} else {
|
||
if ($("#navigation").val() != 0) {
|
||
var ajaxData = {
|
||
createUser: '',
|
||
drafter: '',
|
||
fileNum: '',
|
||
isPublic: 1,
|
||
name: '',
|
||
parentFolderId: parseInt($('.con-list .name span a').eq(-2).attr('data-id')),
|
||
endTime: '',
|
||
startTime: '',
|
||
type: ''
|
||
}
|
||
$("#navigation").val($('.con-list .name span a').eq(-2).attr('data-id'))
|
||
$('.con-list .name span a').eq(-1).remove()
|
||
getFileList(ajaxData)
|
||
}
|
||
}
|
||
serch_flag = false;
|
||
});
|
||
//路由事件
|
||
$('#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() {
|
||
if ($(this).index() >= that.index()) {
|
||
$('.con-list .name span a').eq($(this).index()).remove()
|
||
}
|
||
})
|
||
$("#navigation").val(that.attr('data-id'))
|
||
getFileList(ajaxData);
|
||
serch_flag = false;
|
||
})
|
||
}
|
||
|
||
//历史记录
|
||
function getHistory(obj) {
|
||
$.ajax({
|
||
url: host + '/ding/file/getHistory'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10),
|
||
headers: {
|
||
'Blade-Auth': 'bearer ' + accessToken,
|
||
},
|
||
data: {
|
||
groupId: $(obj).attr('data-groupid')
|
||
},
|
||
type: "get",
|
||
dataType: "json",
|
||
success: function(data) {
|
||
if (data.code == 200) {
|
||
if (data.data.length > 0) {
|
||
var html = '';
|
||
data.data.forEach(function(item) {
|
||
html += '<tr>' +
|
||
'<td><div class="list-img click-download" onclick="openFile(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_22.png"><span>' + item.name +
|
||
'</span></div></td>'
|
||
html += '<td>';
|
||
if (item.isPublic) {
|
||
html += '公共文件类型';
|
||
} else {
|
||
html += '内部文件类型';
|
||
}
|
||
html += '</td>';
|
||
html += '<td>' + item.updateTime + '</td>' +
|
||
'</tr>';
|
||
})
|
||
$(".history .table tbody").html(html)
|
||
$(".history").show();
|
||
}
|
||
// else {
|
||
// layer.msg('暂无记录')
|
||
// }
|
||
} else {
|
||
layer.msg(data.msg)
|
||
}
|
||
},
|
||
error: function(data) {
|
||
console.log(data);
|
||
}
|
||
});
|
||
|
||
}
|
||
|
||
//打开文件夹
|
||
function openFolder(obj) {
|
||
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 downloadfile(obj) {
|
||
var id = $(obj).data('fileid');
|
||
$.ajax({
|
||
url: host + '/ding/file/downLoadFile'+'?timetmp='+ Date.parse( new Date() ).toString().substr(0,10),
|
||
headers: {
|
||
'Blade-Auth': 'bearer ' + localStorage.accessToken
|
||
},
|
||
data: {
|
||
fileId: id
|
||
},
|
||
type: "get",
|
||
contentType: "application/json",
|
||
dataType: "json",
|
||
success: function(data) {
|
||
if (data.code == 200) {
|
||
$(obj).attr('data', data.data);
|
||
console.log(data.data);
|
||
|
||
window.open(data.data);
|
||
} else {
|
||
layer.msg(data.msg)
|
||
}
|
||
},
|
||
error: function(data) {
|
||
console.log(data);
|
||
}
|
||
});
|
||
}
|
||
|
||
//预览文件
|
||
function openFile(obj) {
|
||
var id = $(obj).attr('data-id');
|
||
var name = $(obj).attr('data-name');
|
||
var type = $(obj).attr('data-type');
|
||
var url = $(obj).attr('data-url');
|
||
var time = $(obj).attr('data-time');
|
||
|
||
var dingFileId = $(obj).data('dingid');
|
||
var dingFileName = $(obj).data('dingname');
|
||
var dingFileSize = $(obj).data('dingsize');
|
||
var dingSpaceId = $(obj).data('spaceid');
|
||
|
||
$('.download .download-content .text h3').text(name)
|
||
$('.download .download-content .text p').text(time)
|
||
$('.download .download-content .text a.btn2').attr('download', name)
|
||
$('.download-content .text img').attr('src', 'image/icon-file/icon_' + type + '.png')
|
||
$('#download').data('fileid', id);
|
||
|
||
var previewButton = $('#preview-button');
|
||
previewButton.attr('dingfileid', dingFileId);
|
||
previewButton.attr('dingfilename', dingFileName);
|
||
previewButton.attr('dingfilesize', dingFileSize);
|
||
previewButton.attr('dingspaceid', dingSpaceId);
|
||
previewButton.attr('filetype', type);
|
||
$('.download').show()
|
||
|
||
// $.ajax({
|
||
// url: host + '/ding/file/downLoadFile',
|
||
// headers: {
|
||
// 'Blade-Auth': 'bearer ' + localStorage.accessToken
|
||
// },
|
||
// data: {
|
||
// fileId: id
|
||
// },
|
||
// type: "get",
|
||
// contentType:"application/json",
|
||
// dataType: "json",
|
||
// success: function(data) {
|
||
// if (data.code == 200) {
|
||
// console.log(data.data, '路径555');
|
||
// $('.download .download-content .text a.btn1').attr('data-url',data.data)
|
||
// $('.download .download-content .text a.btn2').attr('href',data.data)
|
||
// $('.download').show()
|
||
// } else {
|
||
// layer.msg(data.msg)
|
||
// }
|
||
// },
|
||
// error: function(data) {
|
||
// console.log(data);
|
||
// }
|
||
// });
|
||
}
|
||
|
||
//隐藏文件
|
||
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);
|
||
}
|
||
})
|
||
}, function(index){
|
||
//按钮【按钮二】的回调
|
||
layer.closeAll();
|
||
});
|
||
return false;
|
||
}
|
||
//文件列表
|
||
function getFileList(ajaxData) {
|
||
console.log(ajaxData, 'getFileList');
|
||
$('.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: ajaxData,
|
||
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 + '">' +
|
||
'<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="' +
|
||
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>' +
|
||
'<td></td>' +
|
||
'<td>公共文件</td>' +
|
||
'<td>' + item.createTime + '</td>' +
|
||
'<td></td>'
|
||
//+'<td><a href="javascript:;" class="news-red" data-groupid="'+item.groupId+'" onclick="getHistory(this)">历史记录</a></td>'
|
||
+
|
||
'</tr>'
|
||
$('.list-content#tab tbody').append(html2)
|
||
})
|
||
}
|
||
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
|
||
.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 +
|
||
'.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">'
|
||
+ '<span>...</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
|
||
.createTime + '" ><img src="image/icon-file/icon_' + item.type +
|
||
'.png"><span>' + item.name + '</span></div></td>' +
|
||
'<td>' + item.number + '</td>' +
|
||
'<td><div class="list-img"><span>' + item.drafter +
|
||
'</span></div></td>' +
|
||
'<td><div class="list-img"><span>' + item.createUser +
|
||
'</span></div></td>' +
|
||
'<td>' + item.type + '</td>' +
|
||
'<td>' + item.createTime + '</td>'
|
||
html2 += '<td>';
|
||
if (item.isHistory == 1) {
|
||
html2 += '<a href="javascript:;" class="news-red" data-groupid="' +
|
||
item.groupId + '" onclick="getHistory(this)">历史记录</a>';
|
||
}
|
||
html2 += '</td>';
|
||
html2 += '</tr>';
|
||
$('.list-content#tab tbody').append(html2)
|
||
})
|
||
}
|
||
if (data.data.folders.length == 0 && data.data.files.length == 0) {
|
||
$('.no-con-list').show()
|
||
} else {
|
||
$('.no-con-list').hide()
|
||
}
|
||
} else {
|
||
layer.msg(data.msg)
|
||
}
|
||
},
|
||
error: function(data) {
|
||
console.log(data);
|
||
}
|
||
});
|
||
}
|
||
</script>
|
||
|
||
|
||
<script>
|
||
layui.use(['element','form','laydate','layer'],function(){
|
||
var element = layui.element;
|
||
var form = layui.form;
|
||
var laydate = layui.laydate;
|
||
var layer = layui.layer;
|
||
//单时间
|
||
laydate.render({
|
||
elem: '.layui-time',
|
||
theme: '#3e5afa',
|
||
type:'date',
|
||
format: 'yyyy-MM-dd',
|
||
max: 0
|
||
});
|
||
//时间段
|
||
laydate.render({
|
||
elem: '.layui-time-time',
|
||
range: true,
|
||
theme: '#3e5afa'
|
||
});
|
||
});
|
||
</script>
|
||
</body>
|
||
</html>
|
||
<!--appfooter-->
|
||
<div class="height84 poflexfoot">
|
||
<div class="height50 display disLeftRihgt aligncneter">
|
||
<div class=" widthb50">
|
||
<a href="index.html" class="flexcolumn">
|
||
<img src="image/icon-app/inco_app03.png" class="wh20">
|
||
<div class="displayCenter fontS12 margitt7">文件夹</div>
|
||
</a>
|
||
</div>
|
||
<div class=" widthb50">
|
||
<a href="appHome.html" class="flexcolumn">
|
||
<img src="image/icon-app/inco_app04.png" class="wh20">
|
||
<div class="displayCenter fontS12 margitt7">功能区</div>
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</div>
|