Merge remote-tracking branch 'origin/master'

# Conflicts:
#	cyx-admin/src/main/resources/templates/base/affairs/affairs.html
This commit is contained in:
liuwu 2023-08-28 17:08:18 +08:00
commit 959180859a
9 changed files with 359 additions and 9 deletions

View File

@ -7,7 +7,6 @@ import java.util.Map;
import com.cyx.common.annotation.Log;
import com.cyx.common.core.controller.BaseController;
import com.cyx.common.core.domain.AjaxResult;
import com.cyx.common.core.domain.entity.SysDept;
import com.cyx.common.core.page.TableDataInfo;
import com.cyx.common.enums.BusinessType;
import com.cyx.common.utils.poi.ExcelUtil;

View File

@ -7,7 +7,7 @@ ruoyi:
# 版权年份
copyrightYear: 2023
# 实例演示开关
demoEnabled: false
demoEnabled: true
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: D:/ruoyi/uploadPath
# 获取ip地址开关
@ -16,7 +16,7 @@ ruoyi:
# 开发环境配置
server:
# 服务器的HTTP端口默认为80
port: 8088
port: 8101
servlet:
# 应用的访问路径
context-path: /

View File

@ -121,6 +121,8 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a data-files="'+row.events+'" data-type="1" class="viewFiles0828 btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>查看图片</a> ');
actions.push('<a data-files="'+row.events+'" data-type="2" class="viewFiles0828 btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>下载文件</a> ');
actions.push('<a data-id="'+row.id+'" class="openUpload btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>上传附件</a> ');
actions.push('<a class="btn btn-default btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看详情</a> ');
// actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
@ -146,7 +148,54 @@
$.table.search()
}
})
})
});
$("#bootstrap-table").on("click",".viewFiles0828",function () {
let _files = $(this)[0].dataset.files.split(',');
let _type = $(this)[0].dataset.type;
let _dataImg = [];
let _downData = [];
_files.forEach((item,index) => {
if(item.indexOf(".jpg")>-1 || item.indexOf(".png")>-1){
_dataImg.push({
"alt": "",
"pid": index, //图片id
"src": window.location.origin+item, //原图地址
"thumb": window.location.origin+item //缩略图地址
})
}else if(item.indexOf(".docx")> -1 || item.indexOf(".doc") > -1 || item.indexOf(".xlsx") > -1 || item.indexOf(".xls") > -1 || item.indexOf(".pdf") > -1){
_downData.push(item);
}
})
if(_type === '1'){ //查看图片
let json = {
"title": "查看图片", //相册标题
"id": 123, //相册id
"start": 0, //初始显示的图片序号默认0
"data": _dataImg
};
layer.photos({
photos: json,
closeBtn: 0, //右上角按钮可通过配置1和2来展示如果不显示则closeBtn: 0
anim: 5 //0-6的选择指定弹出图片动画类型默认随机请注意3.0之前的版本用shift参数
});
}else{ //下载附件
if(_downData.length === 0){
$.modal.msgError('暂无文件!')
return false;
}
_downData.forEach(item => {
let _lastNum = item.lastIndexOf('/')+1;
let _title = item.substr(_lastNum,item.length-1);
const a = document.createElement('a');
a.style.display = 'none';
a.download = _title;
a.href = window.location.origin+item;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
})
}
});
});
</script>
</body>

View File

@ -105,6 +105,8 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a data-files="'+row.events+'" data-type="1" class="viewFiles0828 btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>查看图片</a> ');
actions.push('<a data-files="'+row.events+'" data-type="2" class="viewFiles0828 btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>下载文件</a> ');
actions.push('<a data-id="'+row.id+'" class="openUpload btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>上传附件</a> ');
actions.push('<a class="btn btn-default btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看详情</a> ');
@ -132,7 +134,54 @@
$.table.search()
}
})
})
});
$("#bootstrap-table").on("click",".viewFiles0828",function () {
let _files = $(this)[0].dataset.files.split(',');
let _type = $(this)[0].dataset.type;
let _dataImg = [];
let _downData = [];
_files.forEach((item,index) => {
if(item.indexOf(".jpg")>-1 || item.indexOf(".png")>-1){
_dataImg.push({
"alt": "",
"pid": index, //图片id
"src": window.location.origin+item, //原图地址
"thumb": window.location.origin+item //缩略图地址
})
}else if(item.indexOf(".docx")> -1 || item.indexOf(".doc") > -1 || item.indexOf(".xlsx") > -1 || item.indexOf(".xls") > -1 || item.indexOf(".pdf") > -1){
_downData.push(item);
}
})
if(_type === '1'){ //查看图片
let json = {
"title": "查看图片", //相册标题
"id": 123, //相册id
"start": 0, //初始显示的图片序号默认0
"data": _dataImg
};
layer.photos({
photos: json,
closeBtn: 0, //右上角按钮可通过配置1和2来展示如果不显示则closeBtn: 0
anim: 5 //0-6的选择指定弹出图片动画类型默认随机请注意3.0之前的版本用shift参数
});
}else{ //下载附件
if(_downData.length === 0){
$.modal.msgError('暂无文件!')
return false;
}
_downData.forEach(item => {
let _lastNum = item.lastIndexOf('/')+1;
let _title = item.substr(_lastNum,item.length-1);
const a = document.createElement('a');
a.style.display = 'none';
a.download = _title;
a.href = window.location.origin+item;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
})
}
});
});
</script>
</body>

View File

@ -185,6 +185,10 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a data-files="'+row.files+'" data-type="1" class="viewFiles0828 btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>查看图片</a> ');
actions.push('<a data-files="'+row.files+'" data-type="2" class="viewFiles0828 btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>下载文件</a> ');
actions.push('<a data-id="'+row.id+'" class="openUpload btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>上传附件</a> ');
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看详情</a> ');
if (row.status === '1'){
actions.push('<a data-id="'+row.id+'" data-header="'+row.header+'" data-shotname="'+row.shotName+'" data-deptname="'+row.deptName+'" class="openUpload btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-upload"></i>上传附件</a> ');
}else if (row.status === '2'){
@ -204,7 +208,7 @@
}]
};
$.table.init(options);
$("#bootstrap-table").on('click','.openUpload',function () {
$("#bootstrap-table").on('click',".openUpload",function () {
let _id = $(this)[0].dataset.id;
let header = $(this)[0].dataset.header;
let deptName = $(this)[0].dataset.deptname;
@ -228,8 +232,54 @@
}
})
})
$("#bootstrap-table").on("click",".viewFiles0828",function () {
let _files = $(this)[0].dataset.files.split(',');
let _type = $(this)[0].dataset.type;
let _dataImg = [];
let _downData = [];
_files.forEach((item,index) => {
if(item.indexOf(".jpg")>-1 || item.indexOf(".png")>-1){
_dataImg.push({
"alt": "",
"pid": index, //图片id
"src": window.location.origin+item, //原图地址
"thumb": window.location.origin+item //缩略图地址
})
}else if(item.indexOf(".docx")> -1 || item.indexOf(".doc") > -1 || item.indexOf(".xlsx") > -1 || item.indexOf(".xls") > -1 || item.indexOf(".pdf") > -1){
_downData.push(item);
}
})
if(_type === '1'){ //查看图片
let json = {
"title": "查看图片", //相册标题
"id": 123, //相册id
"start": 0, //初始显示的图片序号默认0
"data": _dataImg
};
layer.photos({
photos: json,
closeBtn: 0, //右上角按钮可通过配置1和2来展示如果不显示则closeBtn: 0
anim: 5 //0-6的选择指定弹出图片动画类型默认随机请注意3.0之前的版本用shift参数
});
}else{ //下载附件
if(_downData.length === 0){
$.modal.msgError('暂无文件!')
return false;
}
_downData.forEach(item => {
let _lastNum = item.lastIndexOf('/')+1;
let _title = item.substr(_lastNum,item.length-1);
const a = document.createElement('a');
a.style.display = 'none';
a.download = _title;
a.href = window.location.origin+item;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
})
}
});
});
</script>
</body>
</html>

View File

@ -189,6 +189,8 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a data-files="'+row.files+'" data-type="1" class="viewFiles0828 btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>查看图片</a> ');
actions.push('<a data-files="'+row.files+'" data-type="2" class="viewFiles0828 btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>下载文件</a> ');
actions.push('<a data-id="'+row.id+'" class="openUpload btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>上传附件</a> ');
actions.push('<a class="btn btn-default btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看详情</a> ');
@ -216,7 +218,72 @@
$.table.search()
}
})
});
$("#bootstrap-table").on('click',".openUpload",function () {
let _id = $(this)[0].dataset.id;
layer.open({
title:'上传附件',
area:['80%','80%'],
type:2,
content:'/base/affairs/upload',
success(res,index){
//传值
parent.a_upload_id = _id;
parent.a_upload_index = index;
parent.a_upload_type = "1";
},
end(){
$.table.search()
}
})
})
$("#bootstrap-table").on("click",".viewFiles0828",function () {
let _files = $(this)[0].dataset.files.split(',');
let _type = $(this)[0].dataset.type;
let _dataImg = [];
let _downData = [];
_files.forEach((item,index) => {
if(item.indexOf(".jpg")>-1 || item.indexOf(".png")>-1){
_dataImg.push({
"alt": "",
"pid": index, //图片id
"src": window.location.origin+item, //原图地址
"thumb": window.location.origin+item //缩略图地址
})
}else if(item.indexOf(".docx")> -1 || item.indexOf(".doc") > -1 || item.indexOf(".xlsx") > -1 || item.indexOf(".xls") > -1 || item.indexOf(".pdf") > -1){
_downData.push(item);
}
})
if(_type === '1'){ //查看图片
let json = {
"title": "查看图片", //相册标题
"id": 123, //相册id
"start": 0, //初始显示的图片序号默认0
"data": _dataImg
};
layer.photos({
photos: json,
closeBtn: 0, //右上角按钮可通过配置1和2来展示如果不显示则closeBtn: 0
anim: 5 //0-6的选择指定弹出图片动画类型默认随机请注意3.0之前的版本用shift参数
});
}else{ //下载附件
if(_downData.length === 0){
$.modal.msgError('暂无文件!')
return false;
}
_downData.forEach(item => {
let _lastNum = item.lastIndexOf('/')+1;
let _title = item.substr(_lastNum,item.length-1);
const a = document.createElement('a');
a.style.display = 'none';
a.download = _title;
a.href = window.location.origin+item;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
})
}
});
});
</script>
</body>

View File

@ -186,6 +186,8 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a data-files="'+row.files+'" data-type="1" class="viewFiles0828 btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>查看图片</a> ');
actions.push('<a data-files="'+row.files+'" data-type="2" class="viewFiles0828 btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>下载文件</a> ');
actions.push('<a data-id="'+row.id+'" class="openUpload btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>上传附件</a> ');
actions.push('<a class="btn btn-default btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看详情</a> ');
@ -213,7 +215,72 @@
$.table.search()
}
})
});
$("#bootstrap-table").on('click',".openUpload",function () {
let _id = $(this)[0].dataset.id;
layer.open({
title:'上传附件',
area:['80%','80%'],
type:2,
content:'/base/affairs/upload',
success(res,index){
//传值
parent.a_upload_id = _id;
parent.a_upload_index = index;
parent.a_upload_type = "1";
},
end(){
$.table.search()
}
})
})
$("#bootstrap-table").on("click",".viewFiles0828",function () {
let _files = $(this)[0].dataset.files.split(',');
let _type = $(this)[0].dataset.type;
let _dataImg = [];
let _downData = [];
_files.forEach((item,index) => {
if(item.indexOf(".jpg")>-1 || item.indexOf(".png")>-1){
_dataImg.push({
"alt": "",
"pid": index, //图片id
"src": window.location.origin+item, //原图地址
"thumb": window.location.origin+item //缩略图地址
})
}else if(item.indexOf(".docx")> -1 || item.indexOf(".doc") > -1 || item.indexOf(".xlsx") > -1 || item.indexOf(".xls") > -1 || item.indexOf(".pdf") > -1){
_downData.push(item);
}
})
if(_type === '1'){ //查看图片
let json = {
"title": "查看图片", //相册标题
"id": 123, //相册id
"start": 0, //初始显示的图片序号默认0
"data": _dataImg
};
layer.photos({
photos: json,
closeBtn: 0, //右上角按钮可通过配置1和2来展示如果不显示则closeBtn: 0
anim: 5 //0-6的选择指定弹出图片动画类型默认随机请注意3.0之前的版本用shift参数
});
}else{ //下载附件
if(_downData.length === 0){
$.modal.msgError('暂无文件!')
return false;
}
_downData.forEach(item => {
let _lastNum = item.lastIndexOf('/')+1;
let _title = item.substr(_lastNum,item.length-1);
const a = document.createElement('a');
a.style.display = 'none';
a.download = _title;
a.href = window.location.origin+item;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
})
}
});
});
</script>
</body>

View File

@ -13,7 +13,7 @@
<div class="form-group">
<label class="font-noraml">多文件上传</label>
<div class="file-loading">
<input id="multipleFile" multiple name="files" type="file">
<input id="multipleFile" multiple name="files" type="file" accept="image/*,.pdf,.xls,.xlsx,.docx,.doc">
</div>
</div>
</div>
@ -31,7 +31,9 @@
uploadAsync: false,
layoutTemplates: {
actionUpload:''
}
},
allowedFileExtensions:['jpg','png','pdf','docx','doc','xlsx','xls'],
// allowedFileExtensions: "image/*,.pdf,.xls,.xlsx,.docx,.doc", //接收的文件后缀
}).on('filebatchuploadsuccess', function (event, data, previewId, index) {
let _type = parent.parent.a_upload_type;
let _url = _type === '1'?'/base/affairs/commit':'/base/advancedparty/edit';

View File

@ -165,6 +165,8 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a data-files="'+row.files+'" data-type="1" class="viewFiles0828 btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>查看图片</a> ');
actions.push('<a data-files="'+row.files+'" data-type="2" class="viewFiles0828 btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>下载文件</a> ');
actions.push('<a data-id="'+row.id+'" class="openUpload btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>上传附件</a> ');
actions.push('<a class="btn btn-default btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看详情</a> ');
@ -192,7 +194,72 @@
$.table.search()
}
})
});
$("#bootstrap-table").on('click',".openUpload",function () {
let _id = $(this)[0].dataset.id;
layer.open({
title:'上传附件',
area:['80%','80%'],
type:2,
content:'/base/affairs/upload',
success(res,index){
//传值
parent.a_upload_id = _id;
parent.a_upload_index = index;
parent.a_upload_type = "1";
},
end(){
$.table.search()
}
})
})
$("#bootstrap-table").on("click",".viewFiles0828",function () {
let _files = $(this)[0].dataset.files.split(',');
let _type = $(this)[0].dataset.type;
let _dataImg = [];
let _downData = [];
_files.forEach((item,index) => {
if(item.indexOf(".jpg")>-1 || item.indexOf(".png")>-1){
_dataImg.push({
"alt": "",
"pid": index, //图片id
"src": window.location.origin+item, //原图地址
"thumb": window.location.origin+item //缩略图地址
})
}else if(item.indexOf(".docx")> -1 || item.indexOf(".doc") > -1 || item.indexOf(".xlsx") > -1 || item.indexOf(".xls") > -1 || item.indexOf(".pdf") > -1){
_downData.push(item);
}
})
if(_type === '1'){ //查看图片
let json = {
"title": "查看图片", //相册标题
"id": 123, //相册id
"start": 0, //初始显示的图片序号默认0
"data": _dataImg
};
layer.photos({
photos: json,
closeBtn: 0, //右上角按钮可通过配置1和2来展示如果不显示则closeBtn: 0
anim: 5 //0-6的选择指定弹出图片动画类型默认随机请注意3.0之前的版本用shift参数
});
}else{ //下载附件
if(_downData.length === 0){
$.modal.msgError('暂无文件!')
return false;
}
_downData.forEach(item => {
let _lastNum = item.lastIndexOf('/')+1;
let _title = item.substr(_lastNum,item.length-1);
const a = document.createElement('a');
a.style.display = 'none';
a.download = _title;
a.href = window.location.origin+item;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
})
}
});
});
</script>
</body>