回收站全部删除进度条
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 deleteFile = (params)=>deleteAction("/recycleBin/deleteFile",params);
|
||||
const recoverFile = (params)=>putAction("/recycleBin/recoverFile",params);
|
||||
const deleteAllFile = (params)=>deleteAction("/recycleBin/deleteAllFile",params);
|
||||
|
||||
|
||||
export {
|
||||
getlist,
|
||||
deleteFile,
|
||||
recoverFile
|
||||
recoverFile,
|
||||
deleteAllFile
|
||||
}
|
||||
|
|
|
@ -42,15 +42,7 @@
|
|||
},
|
||||
methods: {
|
||||
open () {
|
||||
this.rangeTime=[];
|
||||
this.visible =true;
|
||||
setInterval(() => {
|
||||
if (this.percent < 100) {
|
||||
this.percent += 10;
|
||||
} else {
|
||||
clearInterval(intervalId);
|
||||
}
|
||||
}, 500);
|
||||
},
|
||||
handleClose(){
|
||||
this.visible =false;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</a-col>
|
||||
</span>
|
||||
<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-row>
|
||||
</a-form>
|
||||
|
@ -60,9 +60,8 @@
|
|||
|
||||
<script>
|
||||
import deleteFileModal from './modules/deleteFileModal'
|
||||
import { getlist,
|
||||
deleteFile,
|
||||
recoverFile } from '@/api/recycleBin'
|
||||
import {getlist, deleteFile, recoverFile, deleteAllFile} from '@/api/recycleBin'
|
||||
import store from '@/store/'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import JEllipsis from "@/components/jeecg/JEllipsis";
|
||||
import {putAction} from '@/api/manage'
|
||||
|
@ -129,6 +128,7 @@
|
|||
computed: {
|
||||
},
|
||||
created () {
|
||||
this.initWebSocket();
|
||||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
|
@ -178,9 +178,40 @@
|
|||
}
|
||||
});
|
||||
},
|
||||
alldelete(){
|
||||
this.$refs.modalForm.open();
|
||||
allDelete(){
|
||||
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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user