新增文件夹时添加限制
This commit is contained in:
parent
e68eb4c8d6
commit
fc6b23432c
|
@ -899,7 +899,8 @@ export default defineComponent({
|
|||
message: $t.t("input folder name") + ":",
|
||||
prompt: {
|
||||
model: "",
|
||||
isValid: (val: string) => !!val && val.trim().length > 0,
|
||||
isValid: (val: string) =>
|
||||
!!val && val.trim().length > 0&& val.indexOf(".") != 0 ,
|
||||
type: "text",
|
||||
},
|
||||
ok: {
|
||||
|
@ -917,6 +918,7 @@ export default defineComponent({
|
|||
const response = await GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.CreateDirectoryFileManager(path.value, data);
|
||||
console.log(response);
|
||||
if (response && response.success) {
|
||||
refresh_file_list();
|
||||
$q.notify({
|
||||
|
@ -926,17 +928,35 @@ export default defineComponent({
|
|||
timeout: 1500,
|
||||
});
|
||||
} else {
|
||||
// if (
|
||||
// response?.error_message ==
|
||||
// "the folder name cannot start with a '.'"
|
||||
// ) {
|
||||
// $q.notify({
|
||||
// type: "warning",
|
||||
// message:
|
||||
// $t.t("create folder") +
|
||||
// $t.t("fail") +
|
||||
// "!" +
|
||||
// $t.t("the folder name cannot start with a '.'"),
|
||||
// position: "top",
|
||||
// timeout: 1500,
|
||||
// });
|
||||
// }
|
||||
// else {
|
||||
if (response) {
|
||||
$q.notify({
|
||||
type: "warning",
|
||||
message:
|
||||
$t.t("create folder") +
|
||||
$t.t("fail") +
|
||||
"! " +
|
||||
(response ? response.error_message : ""),
|
||||
$t.t(response.error_message),
|
||||
position: "top",
|
||||
timeout: 1500,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -445,4 +445,6 @@ export default {
|
|||
resize: "Resize",
|
||||
"export magic": "Export",
|
||||
"raster graph": "Raster Graph",
|
||||
"the folder name cannot start with a '.'":"The Folder Name Cannot Start With a '.'",
|
||||
|
||||
};
|
||||
|
|
|
@ -713,4 +713,5 @@ export default {
|
|||
resize: "缩放",
|
||||
"export magic": "导出",
|
||||
"raster graph": "栅格图",
|
||||
"the folder name cannot start with a '.'":"文件夹名称不能以“.” 开头",
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue