回收站全部删除进度条
This commit is contained in:
parent
e421c87bf2
commit
e4858792e7
|
@ -4,10 +4,12 @@ import { getAction, deleteAction, putAction, postAction, httpAction,uploadAction
|
||||||
const getlist = (params)=>getAction("/recycleBin/list",params);
|
const getlist = (params)=>getAction("/recycleBin/list",params);
|
||||||
const deleteFile = (params)=>deleteAction("/recycleBin/deleteFile",params);
|
const deleteFile = (params)=>deleteAction("/recycleBin/deleteFile",params);
|
||||||
const recoverFile = (params)=>putAction("/recycleBin/recoverFile",params);
|
const recoverFile = (params)=>putAction("/recycleBin/recoverFile",params);
|
||||||
|
const deleteAllFile = (params)=>deleteAction("/recycleBin/deleteAllFile",params);
|
||||||
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
getlist,
|
getlist,
|
||||||
deleteFile,
|
deleteFile,
|
||||||
recoverFile
|
recoverFile,
|
||||||
|
deleteAllFile
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,15 +42,7 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open () {
|
open () {
|
||||||
this.rangeTime=[];
|
|
||||||
this.visible =true;
|
this.visible =true;
|
||||||
setInterval(() => {
|
|
||||||
if (this.percent < 100) {
|
|
||||||
this.percent += 10;
|
|
||||||
} else {
|
|
||||||
clearInterval(intervalId);
|
|
||||||
}
|
|
||||||
}, 500);
|
|
||||||
},
|
},
|
||||||
handleClose(){
|
handleClose(){
|
||||||
this.visible =false;
|
this.visible =false;
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
</span>
|
</span>
|
||||||
<a-col :md="15" :sm="24" style="text-align: right;">
|
<a-col :md="15" :sm="24" style="text-align: right;">
|
||||||
<a-button type="primary" @click="alldelete" icon="delete" style="background-color: brown;">清空回收站</a-button>
|
<a-button type="primary" @click="allDelete" icon="delete" style="background-color: brown;">清空回收站</a-button>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
|
@ -60,9 +60,8 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import deleteFileModal from './modules/deleteFileModal'
|
import deleteFileModal from './modules/deleteFileModal'
|
||||||
import { getlist,
|
import {getlist, deleteFile, recoverFile, deleteAllFile} from '@/api/recycleBin'
|
||||||
deleteFile,
|
import store from '@/store/'
|
||||||
recoverFile } from '@/api/recycleBin'
|
|
||||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||||
import JEllipsis from "@/components/jeecg/JEllipsis";
|
import JEllipsis from "@/components/jeecg/JEllipsis";
|
||||||
import {putAction} from '@/api/manage'
|
import {putAction} from '@/api/manage'
|
||||||
|
@ -129,6 +128,7 @@
|
||||||
computed: {
|
computed: {
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
this.initWebSocket();
|
||||||
this.loadData();
|
this.loadData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -178,9 +178,40 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
alldelete(){
|
allDelete(){
|
||||||
this.$refs.modalForm.open();
|
deleteAllFile({}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.result);
|
||||||
|
} else {
|
||||||
|
this.$message.warning(res.message);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
this.$refs.modalForm.open();
|
||||||
|
},
|
||||||
|
initWebSocket: function () {
|
||||||
|
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
|
||||||
|
var userId = store.getters.userInfo.id;
|
||||||
|
var url = window._CONFIG['domianURL'].replace("https://", "ws://").replace("http://", "ws://") + "/websocket/" + userId + "/file_del";
|
||||||
|
this.websock = new WebSocket(url);
|
||||||
|
this.websock.onopen = this.websocketonopen;
|
||||||
|
this.websock.onerror = this.websocketonerror;
|
||||||
|
this.websock.onmessage = this.websocketonmessage;
|
||||||
|
this.websock.onclose = this.websocketclose;
|
||||||
|
},
|
||||||
|
websocketonopen: function () {
|
||||||
|
console.log("消息服务连接成功");
|
||||||
|
},
|
||||||
|
websocketonerror: function (e) {
|
||||||
|
console.log("消息服务连接失败" + JSON.stringify(e));
|
||||||
|
},
|
||||||
|
websocketonmessage: function (e) {
|
||||||
|
console.log(e.data)
|
||||||
|
this.$refs.modalForm.percent = e.data;
|
||||||
|
this.loadData();
|
||||||
|
},
|
||||||
|
websocketclose: function (e) {
|
||||||
|
console.log("connection closed (" + e + ")");
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user