实现对文件是否重命名的控制,目前设定为管理员上传的文件不会重命名,完善日志输出存储
This commit is contained in:
@@ -4,6 +4,7 @@ import com.fjy.spring.domain.TbFile;
|
|||||||
import com.fjy.spring.enums.ResultEnum;
|
import com.fjy.spring.enums.ResultEnum;
|
||||||
import com.fjy.spring.exception.UserException;
|
import com.fjy.spring.exception.UserException;
|
||||||
import com.fjy.spring.service.FileService;
|
import com.fjy.spring.service.FileService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
|
@Slf4j
|
||||||
public class DeleteController {
|
public class DeleteController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private FileService fileService;//文件相关数据库操作
|
private FileService fileService;//文件相关数据库操作
|
||||||
@@ -37,7 +39,7 @@ public class DeleteController {
|
|||||||
TbFile resfile = fileService.findFileById(tbFile);
|
TbFile resfile = fileService.findFileById(tbFile);
|
||||||
File filepath = new File(resfile.getColfilepath());
|
File filepath = new File(resfile.getColfilepath());
|
||||||
if (!filepath.exists()) {
|
if (!filepath.exists()) {
|
||||||
System.out.println("删除文件失败:" + resfile.getColfilename() + "不存在!");
|
log.error("删除文件失败:" + resfile.getColfilename() + "不存在!");
|
||||||
} else {
|
} else {
|
||||||
if (filepath.isFile()){
|
if (filepath.isFile()){
|
||||||
deleteFile(resfile.getColfilepath(),resfile.getColfileid());
|
deleteFile(resfile.getColfilepath(),resfile.getColfileid());
|
||||||
@@ -60,14 +62,14 @@ public class DeleteController {
|
|||||||
if (file.exists() && file.isFile()) {
|
if (file.exists() && file.isFile()) {
|
||||||
if (file.delete()) {
|
if (file.delete()) {
|
||||||
fileService.deleteFileById(tbFile);
|
fileService.deleteFileById(tbFile);
|
||||||
System.out.println("删除单个文件" + fileName + "成功!");
|
log.info("删除单个文件" + fileName + "成功!");
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
System.out.println("删除单个文件" + fileName + "失败!");
|
log.info("删除单个文件" + fileName + "失败!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
System.out.println("删除单个文件失败:" + fileName + "不存在!");
|
log.info("删除单个文件失败:" + fileName + "不存在!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.fjy.spring.enums.ResultEnum;
|
|||||||
import com.fjy.spring.exception.UserException;
|
import com.fjy.spring.exception.UserException;
|
||||||
import com.fjy.spring.properties.ServerProperties;
|
import com.fjy.spring.properties.ServerProperties;
|
||||||
import com.fjy.spring.service.FileService;
|
import com.fjy.spring.service.FileService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@@ -55,7 +56,7 @@ public class DownLoadController {
|
|||||||
@ResponseBody
|
@ResponseBody
|
||||||
public List<TbFile> toDownloadOne(){
|
public List<TbFile> toDownloadOne(){
|
||||||
TbUser user = (TbUser)request.getSession().getAttribute(USER_SESSION_KEY);
|
TbUser user = (TbUser)request.getSession().getAttribute(USER_SESSION_KEY);
|
||||||
System.out.println(user.toString());
|
//log.info(user.toString());
|
||||||
List<TbFile> files = fileService.findByColuserid(user.getColuserid());
|
List<TbFile> files = fileService.findByColuserid(user.getColuserid());
|
||||||
//此处做空指针判断并抛出错误
|
//此处做空指针判断并抛出错误
|
||||||
if (files!=null)
|
if (files!=null)
|
||||||
@@ -81,12 +82,12 @@ public class DownLoadController {
|
|||||||
TbFile tbFile = fileService.findFileById(file);
|
TbFile tbFile = fileService.findFileById(file);
|
||||||
//TbFile tbFile = fileService.findFile(file);
|
//TbFile tbFile = fileService.findFile(file);
|
||||||
|
|
||||||
System.out.println(tbFile.getColfilepath());
|
//System.out.println(tbFile.getColfilepath());
|
||||||
|
|
||||||
String ctxPath = tbFile.getColfilepath();
|
String ctxPath = tbFile.getColfilepath();
|
||||||
String downLoadPath = ctxPath;
|
String downLoadPath = ctxPath;
|
||||||
//String downLoadPath = ctxPath + tbFile.getColfilename();
|
//String downLoadPath = ctxPath + tbFile.getColfilename();
|
||||||
System.out.println(downLoadPath);
|
//System.out.println(downLoadPath);
|
||||||
try {
|
try {
|
||||||
long fileLength = new File(downLoadPath).length();
|
long fileLength = new File(downLoadPath).length();
|
||||||
response.setContentType("application/x-msdownload;");
|
response.setContentType("application/x-msdownload;");
|
||||||
@@ -146,7 +147,7 @@ public class DownLoadController {
|
|||||||
// 要生成的压缩文件地址和文件名称
|
// 要生成的压缩文件地址和文件名称
|
||||||
String zipFileName=courseName+folder+".zip";
|
String zipFileName=courseName+folder+".zip";
|
||||||
String desPath = zipPath+"\\"+zipFileName;
|
String desPath = zipPath+"\\"+zipFileName;
|
||||||
System.out.println("打包文件存储地址:"+desPath);
|
//System.out.println("打包文件存储地址:"+desPath);
|
||||||
|
|
||||||
File zipFile = new File(desPath);
|
File zipFile = new File(desPath);
|
||||||
ZipOutputStream zipStream = null;
|
ZipOutputStream zipStream = null;
|
||||||
@@ -244,13 +245,13 @@ public class DownLoadController {
|
|||||||
if (f.isFile()) {
|
if (f.isFile()) {
|
||||||
fileList.add(f);
|
fileList.add(f);
|
||||||
} else if (f.isDirectory()) {
|
} else if (f.isDirectory()) {
|
||||||
System.out.println(f.getAbsolutePath());
|
//log.info(f.getAbsolutePath());
|
||||||
path.add(f.getAbsolutePath());
|
path.add(f.getAbsolutePath());
|
||||||
getFileString(f.getAbsolutePath());
|
getFileString(f.getAbsolutePath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (File f1 : fileList) {
|
for (File f1 : fileList) {
|
||||||
System.out.println(f1.getName());
|
//System.out.println(f1.getName());
|
||||||
path.add(f1.getAbsolutePath());
|
path.add(f1.getAbsolutePath());
|
||||||
/*name[j]=f1.getName();j++;*/
|
/*name[j]=f1.getName();j++;*/
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.fjy.spring.domain.TbUser;
|
|||||||
import com.fjy.spring.properties.ServerProperties;
|
import com.fjy.spring.properties.ServerProperties;
|
||||||
import com.fjy.spring.service.FeedBackService;
|
import com.fjy.spring.service.FeedBackService;
|
||||||
import com.fjy.spring.untils.RedirectUtil;
|
import com.fjy.spring.untils.RedirectUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -19,6 +20,7 @@ import java.util.Date;
|
|||||||
import static com.fjy.spring.constant.GlobalConstant.USER_SESSION_KEY;
|
import static com.fjy.spring.constant.GlobalConstant.USER_SESSION_KEY;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
@Slf4j
|
||||||
public class FeedBackController {
|
public class FeedBackController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -42,7 +44,7 @@ public class FeedBackController {
|
|||||||
feedBack.setUserid(user.getColuserid());
|
feedBack.setUserid(user.getColuserid());
|
||||||
RedirectUtil red = new RedirectUtil();
|
RedirectUtil red = new RedirectUtil();
|
||||||
if (feedBackService.addContent(feedBack)){
|
if (feedBackService.addContent(feedBack)){
|
||||||
System.out.println("写入数据库成功");
|
log.info("反馈信息写入数据库成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.fjy.spring.properties.ServerProperties;
|
|||||||
import com.fjy.spring.service.FileService;
|
import com.fjy.spring.service.FileService;
|
||||||
import com.fjy.spring.service.LogService;
|
import com.fjy.spring.service.LogService;
|
||||||
import com.fjy.spring.untils.FormatFileSizeUtil;
|
import com.fjy.spring.untils.FormatFileSizeUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -25,6 +26,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
|
@Slf4j
|
||||||
public class UpLoadController {
|
public class UpLoadController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -91,13 +93,15 @@ public class UpLoadController {
|
|||||||
file.setColip(request.getRemoteAddr());
|
file.setColip(request.getRemoteAddr());
|
||||||
file.setColuserid(user.getColuserid());
|
file.setColuserid(user.getColuserid());
|
||||||
if (fileService.addFile(file))
|
if (fileService.addFile(file))
|
||||||
System.out.println("记录写入数据库成功");
|
log.info("记录写入数据库成功");
|
||||||
|
//System.out.println("记录写入数据库成功");
|
||||||
else
|
else
|
||||||
System.out.println("记录写入数据库失败");
|
log.error("记录写入数据库失败");
|
||||||
|
//System.out.println("记录写入数据库失败");
|
||||||
|
|
||||||
System.out.println("文件上传到: " + uploadUrl + filename);
|
log.info("文件上传到: " + uploadUrl + filename);
|
||||||
System.out.println("文件大小: " + new FormatFileSizeUtil().GetFileSize(imageFile.getSize()));
|
log.info("文件大小: " + new FormatFileSizeUtil().GetFileSize(imageFile.getSize()));
|
||||||
System.out.println("文件名: " + filename);
|
log.info("文件名: " + filename);
|
||||||
|
|
||||||
File targetFile = new File(uploadUrl + filename);
|
File targetFile = new File(uploadUrl + filename);
|
||||||
if (!targetFile.exists()) {
|
if (!targetFile.exists()) {
|
||||||
@@ -133,7 +137,8 @@ public class UpLoadController {
|
|||||||
@RequestMapping("/moreUpload")
|
@RequestMapping("/moreUpload")
|
||||||
public void moreUpload(HttpServletRequest request,
|
public void moreUpload(HttpServletRequest request,
|
||||||
@RequestParam(value = "courseName",required = false) String courseName,
|
@RequestParam(value = "courseName",required = false) String courseName,
|
||||||
@RequestParam(value = "folder",required = false) String folder) {
|
@RequestParam(value = "folder",required = false) String folder,
|
||||||
|
@RequestParam(value = "rename",required = true) boolean rename) {
|
||||||
|
|
||||||
MultipartHttpServletRequest multipartHttpServletRequest = (MultipartHttpServletRequest) request;
|
MultipartHttpServletRequest multipartHttpServletRequest = (MultipartHttpServletRequest) request;
|
||||||
Map<String, MultipartFile> files = multipartHttpServletRequest.getFileMap();
|
Map<String, MultipartFile> files = multipartHttpServletRequest.getFileMap();
|
||||||
@@ -142,8 +147,14 @@ public class UpLoadController {
|
|||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
String dateNowStr = sdf.format(date);
|
String dateNowStr = sdf.format(date);
|
||||||
|
String uploadUrl;
|
||||||
//String uploadUrl = request.getSession().getServletContext().getRealPath("/") + "upload/";
|
//String uploadUrl = request.getSession().getServletContext().getRealPath("/") + "upload/";
|
||||||
String uploadUrl = serverProperties.getFilePath()+ "upload/"+courseName+"/"+folder+"/";
|
if (rename){
|
||||||
|
uploadUrl = serverProperties.getFilePath()+ "upload/"+courseName+"/"+folder+"/";
|
||||||
|
}else {
|
||||||
|
uploadUrl = serverProperties.getFilePath()+ "upload/";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
File dir = new File(uploadUrl);
|
File dir = new File(uploadUrl);
|
||||||
if (!dir.exists()) {
|
if (!dir.exists()) {
|
||||||
@@ -155,35 +166,43 @@ public class UpLoadController {
|
|||||||
for (MultipartFile file : files.values()) {
|
for (MultipartFile file : files.values()) {
|
||||||
String filename = file.getOriginalFilename();
|
String filename = file.getOriginalFilename();
|
||||||
String suffix = "."+filename.substring(filename.lastIndexOf(".") + 1);//获取文件后缀
|
String suffix = "."+filename.substring(filename.lastIndexOf(".") + 1);//获取文件后缀
|
||||||
|
|
||||||
File targetFile = new File(uploadUrl + user.getColstudentno()+user.getColrealname()+suffix);
|
|
||||||
|
|
||||||
System.out.println("文件上传到: " + uploadUrl + filename);
|
|
||||||
System.out.println("文件大小: " + new FormatFileSizeUtil().GetFileSize(file.getSize()));
|
|
||||||
System.out.println("文件名: " + filename);
|
|
||||||
|
|
||||||
TbFile tbFile = new TbFile();
|
TbFile tbFile = new TbFile();
|
||||||
tbFile.setColfilesize(new FormatFileSizeUtil().GetFileSize(file.getSize()));
|
String pathname;
|
||||||
|
if (rename){
|
||||||
|
pathname = uploadUrl + user.getColstudentno()+user.getColrealname()+suffix;
|
||||||
tbFile.setColfilename(user.getColstudentno()+user.getColrealname()+suffix);
|
tbFile.setColfilename(user.getColstudentno()+user.getColrealname()+suffix);
|
||||||
|
}else {
|
||||||
|
pathname = uploadUrl + filename;
|
||||||
|
tbFile.setColfilename(filename);
|
||||||
|
}
|
||||||
|
File targetFile = new File(pathname);
|
||||||
|
|
||||||
|
log.info("文件上传到: " + uploadUrl + filename);
|
||||||
|
log.info("文件大小: " + new FormatFileSizeUtil().GetFileSize(file.getSize()));
|
||||||
|
log.info("文件名: " + filename);
|
||||||
|
|
||||||
|
|
||||||
|
tbFile.setColfilesize(new FormatFileSizeUtil().GetFileSize(file.getSize()));
|
||||||
|
|
||||||
tbFile.setColtime(dateNowStr);
|
tbFile.setColtime(dateNowStr);
|
||||||
tbFile.setColrealname(filename);
|
tbFile.setColrealname(filename);
|
||||||
tbFile.setColfilepath(uploadUrl + user.getColstudentno()+user.getColrealname()+suffix);//文件自动学号+姓名命名
|
tbFile.setColfilepath(pathname);//文件自动学号+姓名命名
|
||||||
tbFile.setColip(request.getRemoteAddr());
|
tbFile.setColip(request.getRemoteAddr());
|
||||||
tbFile.setColuserid(user.getColuserid());
|
tbFile.setColuserid(user.getColuserid());
|
||||||
tbFile.setCourseName(courseName);
|
tbFile.setCourseName(courseName);
|
||||||
tbFile.setWorkFolder(folder);
|
tbFile.setWorkFolder(folder);
|
||||||
|
|
||||||
TbLog log = new TbLog();
|
TbLog logs = new TbLog();
|
||||||
log.setUserid(user.getColuserid());
|
logs.setUserid(user.getColuserid());
|
||||||
log.setColtime(dateNowStr);
|
logs.setColtime(dateNowStr);
|
||||||
log.setColip(httpServletRequest.getRemoteAddr());
|
logs.setColip(httpServletRequest.getRemoteAddr());
|
||||||
log.setColheader(user.getColname()+"上传了"+filename+"文件");
|
logs.setColheader(user.getColname()+"上传了'"+filename+"'文件");
|
||||||
logService.addLogRec(log);
|
logService.addLogRec(logs);
|
||||||
|
|
||||||
if (fileService.addFile(tbFile))
|
if (fileService.addFile(tbFile))
|
||||||
System.out.println("记录写入数据库成功");
|
log.info("记录写入数据库成功");
|
||||||
else
|
else
|
||||||
System.out.println("记录写入数据库失败");
|
log.error("记录写入数据库失败");
|
||||||
|
|
||||||
if (!targetFile.exists()) {
|
if (!targetFile.exists()) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.fjy.spring.exception.UserException;
|
|||||||
import com.fjy.spring.properties.ServerProperties;
|
import com.fjy.spring.properties.ServerProperties;
|
||||||
import com.fjy.spring.service.UserService;
|
import com.fjy.spring.service.UserService;
|
||||||
import com.fjy.spring.untils.CodingUtil;
|
import com.fjy.spring.untils.CodingUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.validation.BindingResult;
|
import org.springframework.validation.BindingResult;
|
||||||
@@ -16,6 +17,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
|
@Slf4j
|
||||||
public class UpdateController {
|
public class UpdateController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserService userService;
|
private UserService userService;
|
||||||
@@ -36,7 +38,7 @@ public class UpdateController {
|
|||||||
tbUser.setColpassword(new BigInteger(CodingUtil.encryptSHA(tbUser.getColpassword().getBytes())).toString(32));
|
tbUser.setColpassword(new BigInteger(CodingUtil.encryptSHA(tbUser.getColpassword().getBytes())).toString(32));
|
||||||
}
|
}
|
||||||
if (userService.doRegisterService(tbUser)){
|
if (userService.doRegisterService(tbUser)){
|
||||||
System.out.println(tbUser.getColname()+" 信息更新成功");
|
log.info(tbUser.getColname()+" 信息更新成功");
|
||||||
return "redirect:" + request.getScheme() + "://" + request.getServerName() + ":"
|
return "redirect:" + request.getScheme() + "://" + request.getServerName() + ":"
|
||||||
+ serverProperties.getPortNum() + request.getContextPath() + "/home/user";
|
+ serverProperties.getPortNum() + request.getContextPath() + "/home/user";
|
||||||
// return "login";
|
// return "login";
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
|
||||||
<!--<appender name="consoleLog" class="ch.qos.logback.core.ConsoleAppender">
|
<appender name="consoleLog" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
<layout class="ch.qos.logback.classic.PatternLayout">
|
<layout class="ch.qos.logback.classic.PatternLayout">
|
||||||
<pattern>
|
<pattern>
|
||||||
%d - %msg%n
|
%d - %msg%n
|
||||||
</pattern>
|
</pattern>
|
||||||
</layout>
|
</layout>
|
||||||
</appender>-->
|
</appender>
|
||||||
<!--每天输出一个文件,使用RollingFileAppender滚动输出策略-->
|
<!--每天输出一个文件,使用RollingFileAppender滚动输出策略-->
|
||||||
<appender name="fileInfoLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="fileInfoLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<!--根据范围仅保留info的日志-->
|
<!--根据范围仅保留info的日志-->
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<root level="info">
|
<root level="info">
|
||||||
<!--<appender-ref ref="consoleLog"/>-->
|
<appender-ref ref="consoleLog"/>
|
||||||
<appender-ref ref="fileInfoLog"/>
|
<appender-ref ref="fileInfoLog"/>
|
||||||
<appender-ref ref="fileErrorLog"/>
|
<appender-ref ref="fileErrorLog"/>
|
||||||
</root>
|
</root>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ var Main = {
|
|||||||
form: {
|
form: {
|
||||||
content: '',
|
content: '',
|
||||||
},
|
},
|
||||||
|
fileList: [],
|
||||||
feedbackData:[
|
feedbackData:[
|
||||||
{
|
{
|
||||||
id: 68,
|
id: 68,
|
||||||
@@ -60,6 +61,18 @@ var Main = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
uploadURL(row) {
|
||||||
|
return getRootPath_web()+"/moreUpload?rename=false";
|
||||||
|
},
|
||||||
|
submitUpload() {
|
||||||
|
this.$refs.upload.submit();
|
||||||
|
},
|
||||||
|
handleRemove(file, fileList) {
|
||||||
|
console.log(file, fileList);
|
||||||
|
},
|
||||||
|
handlePreview(file) {
|
||||||
|
console.log(file);
|
||||||
|
},
|
||||||
ClickToJump(targe){
|
ClickToJump(targe){
|
||||||
window.location.href=getRootPath_web()+"/" + targe;
|
window.location.href=getRootPath_web()+"/" + targe;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -328,7 +328,7 @@ var Main = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
uploadURL(row) {
|
uploadURL(row) {
|
||||||
return getRootPath_web()+"/moreUpload?courseName=" + row.coursename + "&folder=" + row.workfolder;
|
return getRootPath_web()+"/moreUpload?courseName=" + row.coursename + "&folder=" + row.workfolder+"&rename=true";
|
||||||
},
|
},
|
||||||
limitTime(row) {
|
limitTime(row) {
|
||||||
return DateDiff(row.worktime.replace(/([^\s]+)\s.*/, "$1"), cur);
|
return DateDiff(row.worktime.replace(/([^\s]+)\s.*/, "$1"), cur);
|
||||||
|
|||||||
@@ -18,6 +18,21 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="13" :lg="13" :xl="13" :sm="18" :xs="23" :offset="1">
|
<el-col :md="13" :lg="13" :xl="13" :sm="18" :xs="23" :offset="1">
|
||||||
|
<el-row>
|
||||||
|
<span>上传模板文件</span>
|
||||||
|
<el-upload class="upload-demo" ref="upload"
|
||||||
|
:action="uploadURL()"
|
||||||
|
:on-preview="handlePreview"
|
||||||
|
:on-remove="handleRemove" :file-list="fileList" :auto-upload="false"
|
||||||
|
name="imageFile">
|
||||||
|
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
||||||
|
<el-button style="margin-left: 10px;" size="small" type="success"
|
||||||
|
@click="submitUpload">
|
||||||
|
上传到服务器
|
||||||
|
</el-button>
|
||||||
|
<!--<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>-->
|
||||||
|
</el-upload>
|
||||||
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<h4>发布公告</h4>
|
<h4>发布公告</h4>
|
||||||
<el-form :model="form">
|
<el-form :model="form">
|
||||||
|
|||||||
Reference in New Issue
Block a user