+
+
+ {{ $t('project.project_file.validation.can_not_move_repository_file') }}
+
+
@@ -26,8 +29,8 @@
:condition="condition"/>
-
+
@@ -37,6 +40,7 @@ import {buildTree} from "@/business/components/api/definition/model/NodeTree";
import MsMyFile from "./MyFile";
import MsSearchBar from "@/business/components/common/components/search/MsSearchBar";
import {getCurrentProjectID, getCurrentUserId} from "@/common/js/utils";
+import FileModuleDialog from "@/business/components/project/menu/file/dialog/FileModuleDialog";
export default {
name: 'MsFileModule',
@@ -44,6 +48,7 @@ export default {
MsSearchBar,
MsMyFile,
MsNodeTree,
+ FileModuleDialog,
},
props: {
isReadOnly: {
@@ -95,6 +100,12 @@ export default {
}
},
methods: {
+ fileTreeModuleAdd(param) {
+ this.$refs.fileModuleDialog.open('create', param);
+ },
+ fileTreeModuleEdit(data) {
+ this.$refs.fileModuleDialog.open('edit', data);
+ },
reload() {
this.loading = false
this.$nextTick(() => {
@@ -138,16 +149,6 @@ export default {
this.list();
});
},
- add(param) {
- param.projectId = this.projectId;
- param.protocol = this.condition.protocol;
- this.$post("/file/module/add", param, () => {
- this.$success(this.$t('commons.save_success'));
- this.list();
- }, (error) => {
- this.list();
- });
- },
remove(nodeIds) {
this.$post("/file/module/delete", nodeIds, () => {
this.list();
diff --git a/frontend/src/business/components/track/common/NodeTree.vue b/frontend/src/business/components/track/common/NodeTree.vue
index df07157d87..638e7d5bfd 100644
--- a/frontend/src/business/components/track/common/NodeTree.vue
+++ b/frontend/src/business/components/track/common/NodeTree.vue
@@ -117,6 +117,16 @@ export default {
type: String,
default: "view"
},
+ //添加操作的操作类型
+ operation_type_add: {
+ type: String,
+ default: "simple"
+ },
+ //修改操作的操作类型
+ operation_type_edit: {
+ type: String,
+ default: "simple"
+ },
treeNodes: {
type: Array
},
@@ -254,20 +264,23 @@ export default {
}
},
edit(node, data, isAppend) {
- this.$set(data, 'isEdit', true);
- this.$nextTick(() => {
- this.$refs.nameInput.focus();
-
- // 不知为何,执行this.$set(data, 'isEdit', true);进入编辑状态之后过滤会失效,重新执行下过滤
- if (!isAppend) {
- this.$nextTick(() => {
- this.filter(this.filterText);
- });
- this.$nextTick(() => {
- this.$emit('filter');
- });
- }
- });
+ if (this.operation_type_edit === 'simple') {
+ this.$set(data, 'isEdit', true);
+ this.$nextTick(() => {
+ this.$refs.nameInput.focus();
+ // 不知为何,执行this.$set(data, 'isEdit', true);进入编辑状态之后过滤会失效,重新执行下过滤
+ if (!isAppend) {
+ this.$nextTick(() => {
+ this.filter(this.filterText);
+ });
+ this.$nextTick(() => {
+ this.$emit('filter');
+ });
+ }
+ });
+ } else if (this.operation_type_edit === 'external') {
+ this.$emit("editOperation", data);
+ }
},
increase(id) {
this.traverse(id, node => {
@@ -317,21 +330,33 @@ export default {
}
},
append(node, data) {
- const newChild = {
- id: undefined,
- isEdit: false,
- name: "",
- children: []
- };
- if (!data.children) {
- this.$set(data, 'children', [])
+ if (this.operation_type_add === 'simple') {
+ const newChild = {
+ id: undefined,
+ isEdit: false,
+ name: "",
+ children: []
+ };
+ if (!data.children) {
+ this.$set(data, 'children', [])
+ }
+ data.children.push(newChild);
+ this.edit(node, newChild, true);
+ node.expanded = true;
+ this.$nextTick(() => {
+ this.$refs.nameInput.focus();
+ });
+ } else if (this.operation_type_add === 'external') {
+ let param = {};
+ param.parentId = node.id;
+ param.level = 1;
+ if (data.id != 'root') {
+ // 非根节点
+ param.parentId = data.id;
+ param.level = data.level + 1;
+ }
+ this.$emit("addOperation", param);
}
- data.children.push(newChild);
- this.edit(node, newChild, true);
- node.expanded = true;
- this.$nextTick(() => {
- this.$refs.nameInput.focus();
- });
},
save(node, data) {
if (data.name.trim() === '') {
diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js
index b67b83571d..2ef61664ed 100644
--- a/frontend/src/i18n/en-US.js
+++ b/frontend/src/i18n/en-US.js
@@ -870,6 +870,34 @@ export default {
compare: 'Compare',
change_latest_tip: 'This operation will modify the default display of the interface, scene, test case and other list pages, which may take some time. Please wait! '
},
+ project_file: {
+ file_module_type: {
+ module: 'Module',
+ repository: 'Repository'
+ },
+ file: {
+ branch: 'File branck',
+ path: 'File path',
+ },
+ repository: {
+ name: 'Repository name',
+ path: 'Path',
+ token: 'Token',
+ desc: 'Description',
+ version_history: 'History',
+ file_version: 'Version',
+ update_log: 'Commit log',
+ },
+ validation: {
+ input_repository_name: 'Input repository name',
+ input_repository_path: 'Input repository path',
+ input_repository_token: 'Input repository token',
+ input_file_branch: 'Input file branch',
+ input_file_path: 'Input file path',
+ input_gitee_user_please: 'Gitee uses need input user name',
+ can_not_move_repository_file: 'Repository file can not move',
+ },
+ },
timing_clean_plan_report: "Regularly clean up test report",
timing_clean_api_report: "Regularly clean up api report",
timing_clean_load_report: "Regularly clean up performance report",
diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js
index 77a565d3cd..4ce05cfbc7 100644
--- a/frontend/src/i18n/zh-CN.js
+++ b/frontend/src/i18n/zh-CN.js
@@ -879,6 +879,34 @@ export default {
compare: '对比',
change_latest_tip: '此操作会修改接口,场景,测试用例等列表页面的默认展示,可能会消耗一些时间。请耐心等待!'
},
+ project_file: {
+ file_module_type: {
+ module: '模块',
+ repository: '存储库'
+ },
+ file: {
+ branch: '文件分支',
+ path: '文件路径',
+ },
+ repository: {
+ name: '存储库名称',
+ path: '存储库地址',
+ token: 'Token',
+ desc: '描述',
+ version_history: '版本历史',
+ file_version: '文件版本',
+ update_log: '更新记录',
+ },
+ validation: {
+ input_repository_name: '请输入存储库名称',
+ input_repository_path: '请输入存储库地址',
+ input_repository_token: '请输入存储库Token',
+ input_file_branch: '请输入文件分支',
+ input_file_path: '请输入文件路径',
+ input_gitee_user_please: 'Gitee用户需要输入用户名',
+ can_not_move_repository_file: '文件库文件无法移动',
+ },
+ },
timing_clean_plan_report: "定时清理测试计划报告",
timing_clean_api_report: "定时清理接口测试报告",
timing_clean_load_report: "定时清理性能测试报告",
diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js
index 24eb607617..aed62918f7 100644
--- a/frontend/src/i18n/zh-TW.js
+++ b/frontend/src/i18n/zh-TW.js
@@ -875,6 +875,34 @@ export default {
compare: '對比',
change_latest_tip: '此操作會修改接口,場景,測試用例等列表頁面的默認展示,可能會消耗一些時間。請耐心等待! '
},
+ project_file: {
+ file_module_type: {
+ module: '模塊',
+ repository: '存儲庫'
+ },
+ repository: {
+ name: '存儲庫名稱',
+ path: '存儲庫地址',
+ token: 'Token',
+ desc: '描述',
+ version_history: '版本歷史',
+ file_version: '文件版本',
+ update_log: '更新記錄',
+ },
+ file: {
+ branch: '文件分支',
+ path: '文件路徑',
+ },
+ validation: {
+ input_repository_name: '請輸入存儲庫名稱',
+ input_repository_path: '請輸入存儲庫地址',
+ input_repository_token: '請輸入存儲庫Token',
+ input_file_branch: '请输入文件分支',
+ input_file_path: '请输入文件路徑',
+ input_gitee_user_please: 'Gitee用戶需要輸入用戶名',
+ can_not_move_repository_file: '文件庫文件無法移動',
+ },
+ },
timing_clean_plan_report: "定時清理測試計劃報告",
timing_clean_api_report: "定時清理接口測試報告",
timing_clean_load_report: "定時清理性能測試報告",