|
@@ -64,11 +64,13 @@ const props = withDefaults(
|
|
|
data: Tree[];
|
|
|
height?: number | string;
|
|
|
showCheckbox?: boolean;
|
|
|
+ type?: string;
|
|
|
}>(),
|
|
|
{
|
|
|
data: () => [],
|
|
|
height: 400,
|
|
|
showCheckbox: false,
|
|
|
+ type: 'wind'
|
|
|
}
|
|
|
);
|
|
|
|
|
@@ -109,10 +111,13 @@ const funCommand = async ({ type, data, node }) => {
|
|
|
type: "warning",
|
|
|
}).then(() => {
|
|
|
const a = document.createElement("a");
|
|
|
- const childs = data.childs.map((o) => o.id);
|
|
|
+ let childs = []
|
|
|
+ childs = props.type==='wind'? data.childs.map((o) => o.id): data.childs.map((o) => o.path)
|
|
|
+ const url = props.type==='wind'? '/data/option/download?ids=': '/export/files?filename='
|
|
|
a.href =
|
|
|
- config.baseURL + "/data/option/download?ids=" + childs.join(",");
|
|
|
+ config.baseURL + url + childs.join(",");
|
|
|
a.download = "";
|
|
|
+ a.target='_blank'
|
|
|
a.click();
|
|
|
});
|
|
|
break;
|
|
@@ -126,20 +131,27 @@ const funCommand = async ({ type, data, node }) => {
|
|
|
const repeatArr = (arr, deleteArr) => {
|
|
|
for (const unit of arr) {
|
|
|
if (unit.childs?.length) {
|
|
|
- deleteArr.push(...unit.childs.map((o) => o.id));
|
|
|
+ deleteArr.push(...unit.childs.map((o) => props.type==='wind'? o.id : o.path));
|
|
|
} else if (unit.children?.length) {
|
|
|
repeatArr(unit.children, deleteArr);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
if (data.childs?.length) {
|
|
|
- deleteArr = data.childs.map((o) => o.id);
|
|
|
+ deleteArr = data.childs.map((o) => props.type==='wind'? o.id : o.path);
|
|
|
} else if (data.children?.length) {
|
|
|
repeatArr(data.children, deleteArr);
|
|
|
}
|
|
|
- const res = await request.get("/data/option/delete", {
|
|
|
- params: { ids: deleteArr.join(",") },
|
|
|
- }); //删除当前节点
|
|
|
+ let res = {code: 500}
|
|
|
+ if(props.type==='wind'){
|
|
|
+ res = await request.get("/data/option/delete", {
|
|
|
+ params: { ids: deleteArr.join(",") },
|
|
|
+ }); //删除当前节点
|
|
|
+ }else{
|
|
|
+ res = await request.delete("/delete/files", {
|
|
|
+ data: { filename: deleteArr.join(",") },
|
|
|
+ }); //删除当前节点
|
|
|
+ }
|
|
|
if (res.code === 200) {
|
|
|
ElMessage.success(res.msg);
|
|
|
emits("refresh");
|