Commit 8900a0f7 by 莫晓莉

删除资源库文件

parent f8490a41
...@@ -245,6 +245,14 @@ export function doTrans(data) { ...@@ -245,6 +245,14 @@ export function doTrans(data) {
method: 'post' method: 'post'
}) })
} }
//删除资源库
export function drop(data) {
return request({
url: 'etlweb/repository/drop',
data,
method: 'post'
})
}
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
</template> </template>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item style="text-align:right" @click.native="createFile()">新建目录</el-dropdown-item> <el-dropdown-item style="text-align:right" @click.native="createFile()">新建目录</el-dropdown-item>
<el-dropdown-item style="text-align:right" @click.native="deleteFile()">删除</el-dropdown-item>
<el-dropdown-item class="text-center">打开</el-dropdown-item> <el-dropdown-item class="text-center">打开</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
...@@ -344,7 +345,7 @@ import dialogRemind from '../dialogs-components/dialog-remind'//删除提示弹 ...@@ -344,7 +345,7 @@ import dialogRemind from '../dialogs-components/dialog-remind'//删除提示弹
import {explorer,features,remove,checkInit} from "@/api/kettle/file"; import {explorer,features,remove,checkInit,drop} from "@/api/kettle/file";
import { import {
types, types,
getLinkList, getLinkList,
...@@ -380,6 +381,7 @@ export default { ...@@ -380,6 +381,7 @@ export default {
props: ["dragItem"], props: ["dragItem"],
data() { data() {
return { return {
curNode:{},//删除资源库文件当前点击的节点
curNodeText:'数据库名称',//当前点击选中的资源库节点 curNodeText:'数据库名称',//当前点击选中的资源库节点
blankCanvas:"",//空白画布xml blankCanvas:"",//空白画布xml
graph:null, graph:null,
...@@ -1203,9 +1205,32 @@ props: ["dragItem"], ...@@ -1203,9 +1205,32 @@ props: ["dragItem"],
} }
}, },
// 删除资源库文件
deleteFile(){
console.log("删除当前节点==========",this.curNode);
var path=this.curNode.data.path;
var type=this.curNode.data.type;
if(type==null){
type=''
}
let pamer = new FormData(); // 创建form对象
pamer.append("path", path);
pamer.append("type", type);
drop(pamer).then(res=>{
if(res){
console.log('删除资源库文件==',res)
this.$message.success('删除成功');
// 刷新
this.explorer('');
}
})
},
handleNodeClick(data,node){ handleNodeClick(data,node){
console.log('点击当前节点===',node); console.log('点击当前节点===',node);
this.nodePath=data.path;//当前选择数 this.curNode=node;//当前选中节点
this.nodePath=data.path;//当前选择数
this.curNodeIconCls=data.iconCls;//当前选中节点 this.curNodeIconCls=data.iconCls;//当前选中节点
this.nodePath=data.path; this.nodePath=data.path;
console.log('当前节点的文件夹路径:',this.nodePath); console.log('当前节点的文件夹路径:',this.nodePath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment