实现文件上传和删除后自动更新列表
This commit is contained in:
@@ -9,7 +9,7 @@ serverproperties:
|
|||||||
spring:
|
spring:
|
||||||
thymeleaf:
|
thymeleaf:
|
||||||
prefix: classpath:/templates/
|
prefix: classpath:/templates/
|
||||||
cache: false
|
cache: true
|
||||||
check-template: true
|
check-template: true
|
||||||
|
|
||||||
datasource:
|
datasource:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#控制配置文件调用
|
#控制配置文件调用
|
||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: prod
|
active: dev
|
||||||
@@ -25,13 +25,13 @@
|
|||||||
<!--滚动策略-->
|
<!--滚动策略-->
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<!--路径文件名,文件名包含时间-->
|
<!--路径文件名,文件名包含时间-->
|
||||||
<!--<fileNamePattern>F:\JAVA Workspace\Temp\log\%d\info.%d.log</fileNamePattern>-->
|
<fileNamePattern>F:\JAVA Workspace\Temp\log\%d\info.%d.log</fileNamePattern>
|
||||||
<fileNamePattern>/www/cmsfile/%d/info.%d.log</fileNamePattern>
|
<!--<fileNamePattern>/www/cmsfile/%d/info.%d.log</fileNamePattern>-->
|
||||||
</rollingPolicy>
|
</rollingPolicy>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<appender name="fileErrorLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="fileErrorLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<!--根据范围过滤ERROR等级以下的日志-->
|
<!--根据范围过滤ERROR等级以下的日志-->
|
||||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||||
<level>ERROR</level>
|
<level>ERROR</level>
|
||||||
</filter>
|
</filter>
|
||||||
@@ -44,8 +44,8 @@
|
|||||||
<!--滚动策略-->
|
<!--滚动策略-->
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<!--路径文件名,文件名包含时间-->
|
<!--路径文件名,文件名包含时间-->
|
||||||
<!--<fileNamePattern>F:\JAVA Workspace\Temp\log\error.%d.log</fileNamePattern>-->
|
<fileNamePattern>F:\JAVA Workspace\Temp\log\error.%d.log</fileNamePattern>
|
||||||
<fileNamePattern>/www/cmsfile/%d/error.%d.log</fileNamePattern>
|
<!--<fileNamePattern>/www/cmsfile/%d/error.%d.log</fileNamePattern>-->
|
||||||
</rollingPolicy>
|
</rollingPolicy>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
|
|||||||
@@ -163,15 +163,11 @@ var Main = {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
var that = this;
|
let that = this;
|
||||||
axios.get(getRootPath_web()+'/download/findone')
|
/*setInterval(function(){
|
||||||
.then(function (response) {
|
that.getFileList();
|
||||||
console.log(response.data);
|
},1000);*/
|
||||||
that.DownloadList = response.data;
|
this.getFileList();
|
||||||
})
|
|
||||||
.catch(function (error) {
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
axios.get(getRootPath_web()+'/home/findAllHomework')
|
axios.get(getRootPath_web()+'/home/findAllHomework')
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
console.log(response.data);
|
console.log(response.data);
|
||||||
@@ -202,6 +198,18 @@ var Main = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getFileList(){
|
||||||
|
let that = this;
|
||||||
|
axios.get(getRootPath_web()+'/download/findone')
|
||||||
|
.then(function (response) {
|
||||||
|
//console.log(response.data);
|
||||||
|
that.DownloadList = response.data;
|
||||||
|
})
|
||||||
|
.catch(function (error) {
|
||||||
|
console.log(error);
|
||||||
|
that.openNotiError("失败", "获取文件列表失败!");
|
||||||
|
});
|
||||||
|
},
|
||||||
openNotiSuccess(title, content) {
|
openNotiSuccess(title, content) {
|
||||||
this.$notify({
|
this.$notify({
|
||||||
title: title,
|
title: title,
|
||||||
@@ -279,7 +287,10 @@ var Main = {
|
|||||||
console.log(row.colfileid);
|
console.log(row.colfileid);
|
||||||
},
|
},
|
||||||
submitUpload() {
|
submitUpload() {
|
||||||
|
let that = this;
|
||||||
this.$refs.upload.submit();
|
this.$refs.upload.submit();
|
||||||
|
this.openNotiSuccess("成功", "文件上传成功!");
|
||||||
|
setTimeout(function () {that.getFileList();},1000);
|
||||||
},
|
},
|
||||||
handleRemove(file, fileList) {
|
handleRemove(file, fileList) {
|
||||||
console.log(file, fileList);
|
console.log(file, fileList);
|
||||||
@@ -315,7 +326,8 @@ var Main = {
|
|||||||
if (response.data===true){
|
if (response.data===true){
|
||||||
//that.$refs[formName].submit;
|
//that.$refs[formName].submit;
|
||||||
//return true;
|
//return true;
|
||||||
that.openNotiSuccess("成功", "删除成功!")
|
that.openNotiSuccess("成功", "删除成功!");
|
||||||
|
that.getFileList();
|
||||||
}else if (response.data===false){
|
}else if (response.data===false){
|
||||||
that.openNotiError("失败", "删除失败!");
|
that.openNotiError("失败", "删除失败!");
|
||||||
}else {
|
}else {
|
||||||
|
|||||||
@@ -237,6 +237,10 @@
|
|||||||
<el-table-column prop="colfilesize" label="大小" width="80">
|
<el-table-column prop="colfilesize" label="大小" width="80">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="coltime" label="上传时间">
|
<el-table-column prop="coltime" label="上传时间">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="courseName" label="课程名">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="workFolder" label="作业名">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column fixed="right" label="操作" width="150">
|
<el-table-column fixed="right" label="操作" width="150">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|||||||
Reference in New Issue
Block a user