门店多轮播图
This commit is contained in:
@ -96,7 +96,6 @@ public class CompanyStoreServiceImpl implements ICompanyStoreService
|
|||||||
companyStore.setCreateTime(DateUtils.getNowDate());
|
companyStore.setCreateTime(DateUtils.getNowDate());
|
||||||
companyStore.setUpdateTime(DateUtils.getNowDate());
|
companyStore.setUpdateTime(DateUtils.getNowDate());
|
||||||
companyStore.setStatus("0");
|
companyStore.setStatus("0");
|
||||||
companyStore.setAddress(companyStore.getProvinceName()+companyStore.getCityName()+companyStore.getAreaName());
|
|
||||||
setAreaInfo(companyStore);
|
setAreaInfo(companyStore);
|
||||||
int flag = companyStoreMapper.insertCompanyStore(companyStore);
|
int flag = companyStoreMapper.insertCompanyStore(companyStore);
|
||||||
if(flag > 0){
|
if(flag > 0){
|
||||||
@ -120,6 +119,8 @@ public class CompanyStoreServiceImpl implements ICompanyStoreService
|
|||||||
companyStore.setCityName(areaHn.getName());
|
companyStore.setCityName(areaHn.getName());
|
||||||
companyStore.setProvinceId(areaHn.getParentCode());
|
companyStore.setProvinceId(areaHn.getParentCode());
|
||||||
companyStore.setProvinceName(areaHn.getParentName());
|
companyStore.setProvinceName(areaHn.getParentName());
|
||||||
|
companyStore.setAddress(companyStore.getProvinceName()+companyStore.getCityName()+companyStore.getAreaName());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -133,7 +134,6 @@ public class CompanyStoreServiceImpl implements ICompanyStoreService
|
|||||||
{
|
{
|
||||||
companyStore.setUpdateTime(DateUtils.getNowDate());
|
companyStore.setUpdateTime(DateUtils.getNowDate());
|
||||||
companyStore.setStatus("0");
|
companyStore.setStatus("0");
|
||||||
companyStore.setAddress(companyStore.getProvinceName()+companyStore.getCityName()+companyStore.getAreaName());
|
|
||||||
setAreaInfo(companyStore);
|
setAreaInfo(companyStore);
|
||||||
return companyStoreMapper.updateCompanyStore(companyStore);
|
return companyStoreMapper.updateCompanyStore(companyStore);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -355,15 +355,31 @@ public class CommonController
|
|||||||
String filePath = RuoYiConfig.getUploadPath();
|
String filePath = RuoYiConfig.getUploadPath();
|
||||||
|
|
||||||
for (MultipartFile file : files) {
|
for (MultipartFile file : files) {
|
||||||
|
|
||||||
|
/** oss --------------- */
|
||||||
|
// 检查文件是否为空
|
||||||
|
if (file.isEmpty()) {
|
||||||
|
return AjaxResult.error("上传文件不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查文件类型(可选)
|
||||||
|
String contentType = file.getContentType();
|
||||||
|
if (contentType == null || !contentType.startsWith("image/")) {
|
||||||
|
return AjaxResult.error("只允许上传图片文件");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 上传到 OSS
|
||||||
|
String url = ossService.uploadImage(file);
|
||||||
|
// 返回文件访问 URL
|
||||||
|
String[] str = url.split("/");
|
||||||
|
String fileName = str[str.length - 1];
|
||||||
|
|
||||||
|
/** 原文件上传 --------------- */
|
||||||
// 上传并返回新文件名称
|
// 上传并返回新文件名称
|
||||||
String fileName = FileUploadUtils.upload(filePath, fileType, file);
|
// String fileName = FileUploadUtils.upload(filePath, fileType, file);
|
||||||
|
// String url = serverConfig.getUrl() + fileName;
|
||||||
|
/** -------------------------- */
|
||||||
String uuid = UUID.randomUUID().toString();
|
String uuid = UUID.randomUUID().toString();
|
||||||
|
|
||||||
// String url = serverConfig.getUrl() + "/common/newDownload?uuid=" + uuid;
|
|
||||||
|
|
||||||
String url = serverConfig.getUrl() + fileName;
|
|
||||||
|
|
||||||
CommonAttachment insert = new CommonAttachment();
|
CommonAttachment insert = new CommonAttachment();
|
||||||
insert.setUuid(uuid);
|
insert.setUuid(uuid);
|
||||||
insert.setDataId(dataId);
|
insert.setDataId(dataId);
|
||||||
|
|||||||
@ -172,9 +172,9 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">门店图片:</label>
|
<label class="col-sm-3 control-label">门店图片:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="hidden" name="image">
|
<input name="image" type="hidden">
|
||||||
<div class="file-loading">
|
<div class="file-loading">
|
||||||
<input class="form-control file-upload" id="image" name="file" type="file">
|
<input id="image" name="files" type="file" multiple>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -218,42 +218,35 @@
|
|||||||
focusCleanup: true
|
focusCleanup: true
|
||||||
});
|
});
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
// 单图上传
|
|
||||||
|
|
||||||
$("#image").fileinput({
|
$("#image").fileinput({
|
||||||
uploadUrl: ctx + 'common/newUpload',
|
uploadUrl: ctx + 'common/newBatchUpload',
|
||||||
uploadExtraData: {
|
uploadExtraData: {
|
||||||
dataType: '30'
|
dataType: '40'
|
||||||
},
|
},
|
||||||
maxFileCount: 1,
|
uploadAsync: false,
|
||||||
autoReplace: true,
|
overwriteInitial:false,
|
||||||
showClose: false,
|
|
||||||
layoutTemplates :{
|
layoutTemplates :{
|
||||||
actionDelete:'', //去除上传预览的缩略图中的删除图标
|
actionDelete:'', //去除上传预览的缩略图中的删除图标
|
||||||
actionUpload:'',//去除上传预览缩略图中的上传图片图标;
|
actionUpload:'',//去除上传预览缩略图中的上传图片图标;
|
||||||
actionZoom:'' //去除上传预览缩略图中的查看详情预览的缩略图标。
|
|
||||||
},
|
},
|
||||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
}).on('filebatchuploadsuccess', function (event, data, previewId, index) {
|
||||||
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
|
let rsp = data.response;
|
||||||
preId = previewId;
|
let imgList = rsp.data;
|
||||||
}).on('fileremoved', function (event, id, index) {
|
let imageUrlList = $("input[name='" + event.currentTarget.id + "']");
|
||||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
let urlList = ('' === imageUrlList.val()) ? [] : imageUrlList.val().split(",");
|
||||||
}).on("filebatchselected", function(event, files) {
|
for(let i = 0;i < imgList.length; i++){
|
||||||
if(preId !== ''){
|
urlList.push(imgList[i].url);
|
||||||
document.getElementById(preId).remove()
|
|
||||||
}
|
}
|
||||||
$("#image").fileinput("upload");
|
let urls = urlList.join(",");
|
||||||
}).on('fileerror', function (event,data,msg){
|
imageUrlList.val(urls);
|
||||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
}).on("filecleared",function(event, data, msg){
|
||||||
// 清除当前的预览图 ,并隐藏 【移除】 按钮
|
$("input[name='" + event.currentTarget.id + "']").val('');
|
||||||
$(event.target).fileinput('clear').fileinput('unlock')
|
|
||||||
$(event.target).parent().siblings('.fileinput-remove').hide()
|
|
||||||
// 打开失败的信息弹窗
|
|
||||||
$.modal.alertError('上传失败,请稍后重试')
|
|
||||||
}
|
|
||||||
).on("filecleared",function(event, data, msg){
|
|
||||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$("#businessLicenseImg").fileinput({
|
$("#businessLicenseImg").fileinput({
|
||||||
uploadUrl: ctx + 'common/newUpload',
|
uploadUrl: ctx + 'common/newUpload',
|
||||||
uploadExtraData: {
|
uploadExtraData: {
|
||||||
|
|||||||
@ -172,9 +172,9 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">门店图片:</label>
|
<label class="col-sm-3 control-label">门店图片:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="hidden" name="image" th:value="*{image}">
|
<input name="image" th:value="*{image}" type="hidden">
|
||||||
<div class="file-loading">
|
<div class="file-loading">
|
||||||
<input class="form-control file-upload" id="image" name="file" type="file">
|
<input id="image" name="files" type="file" multiple>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -229,46 +229,53 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
let preId = '';
|
let preId = '';
|
||||||
let initUrl = new Array();
|
|
||||||
initUrl.push([[${companyStore.image}]]);
|
|
||||||
|
|
||||||
|
let initUrl = [[${companyStore.image}]].split(",");
|
||||||
|
let initConfig = [];
|
||||||
|
for (const url of initUrl) {
|
||||||
|
let config = {
|
||||||
|
type: 'image',
|
||||||
|
caption: '', // 展示的文件名
|
||||||
|
url: 'idcardremove', // 删除url 必填,可以写一个空方法,不然无法删除初始化图片
|
||||||
|
key: '', // 删除时Ajax向后台传递的参数
|
||||||
|
};
|
||||||
|
initConfig.push(config);
|
||||||
|
}
|
||||||
|
let clear = true;
|
||||||
$("#image").fileinput({
|
$("#image").fileinput({
|
||||||
uploadUrl: ctx + 'common/newUpload',
|
uploadUrl: ctx + 'common/newBatchUpload',
|
||||||
uploadExtraData: {
|
uploadExtraData: {
|
||||||
dataType: '30'
|
dataType: '40'
|
||||||
},
|
},
|
||||||
maxFileCount: 1,
|
uploadAsync: false,
|
||||||
autoReplace: true,
|
|
||||||
showClose: false,
|
|
||||||
initialPreview: initUrl,
|
initialPreview: initUrl,
|
||||||
initialPreviewFileType: 'image',
|
initialPreviewFileType: 'image',
|
||||||
initialPreviewAsData: true,
|
initialPreviewAsData: true,
|
||||||
|
// initialPreviewShowDelete:true, //是否显示初始化数据的删除按钮
|
||||||
|
// initialPreviewConfig:initConfig, //初始化图片配置
|
||||||
|
// overwriteInitial:false,
|
||||||
layoutTemplates :{
|
layoutTemplates :{
|
||||||
actionDelete:'', //去除上传预览的缩略图中的删除图标
|
actionDelete:'', //去除上传预览的缩略图中的删除图标
|
||||||
actionUpload:'',//去除上传预览缩略图中的上传图片图标;
|
actionUpload:'',//去除上传预览缩略图中的上传图片图标;
|
||||||
// actionZoom:'' //去除上传预览缩略图中的查看详情预览的缩略图标。
|
|
||||||
},
|
},
|
||||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
}).on('filebatchuploadsuccess', function (event, data, previewId, index) {
|
||||||
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
|
let rsp = data.response;
|
||||||
preId = previewId;
|
let imgList = rsp.data;
|
||||||
}).on('fileremoved', function (event, id, index) {
|
let imageUrlList = $("input[name='" + event.currentTarget.id + "']");
|
||||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
let urlList = ('' === imageUrlList.val()) ? [] : imageUrlList.val().split(",");
|
||||||
}).on("filebatchselected", function(event, files) {
|
for(let i = 0;i < imgList.length; i++){
|
||||||
if(preId !== ''){
|
urlList.push(imgList[i].url);
|
||||||
document.getElementById(preId).remove()
|
|
||||||
}
|
}
|
||||||
$("#image").fileinput("upload");
|
let urls = urlList.join(",");
|
||||||
}).on('fileerror', function (event,data,msg){
|
imageUrlList.val(urls);
|
||||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
}).on("filecleared",function(event, data, msg){
|
||||||
// 清除当前的预览图 ,并隐藏 【移除】 按钮
|
$("input[name='" + event.currentTarget.id + "']").val('');
|
||||||
$(event.target).fileinput('clear').fileinput('unlock')
|
}).on("filebatchselected",function(event, data, msg){
|
||||||
$(event.target).parent().siblings('.fileinput-remove').hide()
|
if(clear){
|
||||||
// 打开失败的信息弹窗
|
$("input[name='" + event.currentTarget.id + "']").val('');
|
||||||
$.modal.alertError('上传失败,请稍后重试')
|
clear = false;
|
||||||
}
|
}
|
||||||
).on("filecleared",function(event, data, msg){
|
})
|
||||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
|
||||||
});
|
|
||||||
|
|
||||||
let preId2 = '';
|
let preId2 = '';
|
||||||
let initUrl2 = new Array();
|
let initUrl2 = new Array();
|
||||||
|
|||||||
@ -67,7 +67,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn-group-sm" id="toolbar" role="group">
|
<div class="btn-group-sm" id="toolbar" role="group">
|
||||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="operation:store:add">
|
<a class="btn btn-success" onclick="$.operate.addCustomize(null,1300,700)" shiro:hasPermission="operation:store:add">
|
||||||
<i class="fa fa-plus"></i> 添加
|
<i class="fa fa-plus"></i> 添加
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="operation:store:edit">
|
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="operation:store:edit">
|
||||||
@ -192,7 +192,7 @@
|
|||||||
formatter: function(value, row, index) {
|
formatter: function(value, row, index) {
|
||||||
var actions = [];
|
var actions = [];
|
||||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="assStoreUser(\'' + row.id + '\')"><i class="fa fa-edit"></i>门店用户</a> ');
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="assStoreUser(\'' + row.id + '\')"><i class="fa fa-edit"></i>门店用户</a> ');
|
||||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>修改</a> ');
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.editCustomize(\'' + row.id + '\',1300,700)"><i class="fa fa-edit"></i>修改</a> ');
|
||||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||||
if (row.status == 1) {
|
if (row.status == 1) {
|
||||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="enable(\'' + row.id + '\')"><i class="fa fa-edit"></i>启用</a> ');
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="enable(\'' + row.id + '\')"><i class="fa fa-edit"></i>启用</a> ');
|
||||||
|
|||||||
Reference in New Issue
Block a user