diff --git a/front/src/utils/i18n/languages/en-us.js b/front/src/utils/i18n/languages/en-us.js index 309c1674ce5847b609138df02d57e20f22dcfb62..4d9ff570ff70d1ee4b7dbf8d147214597d882831 100644 --- a/front/src/utils/i18n/languages/en-us.js +++ b/front/src/utils/i18n/languages/en-us.js @@ -491,7 +491,9 @@ export default { }, SwaggerSetting: { 'syncConfirm': 'Save success, synchronize documents now?', - 'synchronizing': 'Synchronizing' + 'synchronizing': 'Synchronizing', + 'synchronization': 'synchronization', + 'checkSynchronized': 'Please check whether it is synchronized' }, EditDocCustom: { 'inputDocContent': 'Input document content' diff --git a/front/src/utils/i18n/languages/zh-cn.js b/front/src/utils/i18n/languages/zh-cn.js index cd15ef29ce0b1da686af85de51b295de9ba4b56c..2ad0514a74df2f83ea03abff0d59bc74812a1789 100644 --- a/front/src/utils/i18n/languages/zh-cn.js +++ b/front/src/utils/i18n/languages/zh-cn.js @@ -399,7 +399,7 @@ export default { 'nickEmail': '昵称/邮箱', 'releaseNo': '版本号', 'releaseDesc': '版本描述', - 'viewAssociatedDocuments': '查看关联版本', + 'viewAssociatedDocuments': '查看关联文档', 'associatedDocument': '关联文档', 'visitStyle': '访问方式', 'updateName': '修改名称', @@ -492,7 +492,9 @@ export default { }, SwaggerSetting: { 'syncConfirm': '保存成功,是否立即同步文档?', - 'synchronizing': '同步中...' + 'synchronizing': '同步中...', + 'synchronization': '同步', + 'checkSynchronized': '请确认是否同步?' }, EditDocCustom: { 'inputDocContent': '输入文档内容' diff --git a/front/src/views/project/ModuleSetting/MeterSphereSetting/index.vue b/front/src/views/project/ModuleSetting/MeterSphereSetting/index.vue index 56630d8a81eee88e5bfb720e61f36ce453cad401..240670e543fe7c10d89c96b0de6e5663589eb7d2 100644 --- a/front/src/views/project/ModuleSetting/MeterSphereSetting/index.vue +++ b/front/src/views/project/ModuleSetting/MeterSphereSetting/index.vue @@ -9,10 +9,11 @@ {{ currentName }} - + {{ $t('save') }} + {{ $t('SwaggerSetting.synchronization') }} @@ -46,6 +47,7 @@ export default { props: { value: 'id', label: 'name', + checkStrictly: true, lazy: true, lazyLoad(node, resolve) { const { level } = node @@ -56,9 +58,9 @@ export default { const msProjectId = node.value that.get('third/metersphere/module/list', { projectId: that.projectId, msProjectId: msProjectId }, resp => { const data = resp.data - for (const el of data) { - el.leaf = true - } + // for (const el of data) { + // el.leaf = true + // } resolve(data) }) } @@ -93,19 +95,34 @@ export default { const leaf = checkedNodes[0] const pathNodes = leaf.pathNodes const msProject = pathNodes[0] - const msModule = pathNodes[1] + const msModule = pathNodes[pathNodes.length - 1] + const label = pathNodes.slice(1).map(node => node.label).join('/') const data = { msProjectId: msProject.value, msProjectName: msProject.label, msModuleId: msModule.value, - msModuleName: msModule.label, + msModuleName: label, moduleId: this.moduleId } this.post('third/metersphere/module/save', data, resp => { - this.tipSuccess($t('saveSuccess')) + if (resp.code === '0') { + this.confirm(this.$t('SwaggerSetting.syncConfirm'), () => { + this.syncMeterSphere() + }) + } }) } }) + }, + syncMeterSphere() { + const data = { + moduleId: this.moduleId + } + this.confirm(this.$t('SwaggerSetting.checkSynchronized'), () => { + this.post('third/metersphere/module/sync', data, resp => { + this.tipSuccess($t('syncSuccess')) + }) + }) } } } diff --git a/front/src/views/project/ProjectRelease/index.vue b/front/src/views/project/ProjectRelease/index.vue index a78611de9e2775c625c2efca727ec1510a453e11..4ba6a042dfbb8a2d0f3a9579144ab8b5a6c125e8 100644 --- a/front/src/views/project/ProjectRelease/index.vue +++ b/front/src/views/project/ProjectRelease/index.vue @@ -81,12 +81,26 @@ {{ $t('viewAssociatedDocuments') }} {{ $t('update') }} - - {{ $t('remove') }} - + + + + + + + + + {{ $t('remove') }} + + + + + 同步MeterSphere + + + @@ -143,23 +157,76 @@ > - {{ node.label }} + {{ node.label }} + + + {{ data.url }} + + {{ data.version }} + + + + + + + + + 当前版本绑定MeterSphere模块 + + + + {{ currentMsModuleName }} + + + + + + {{ $t('save') }} + {{ $t('SwaggerSetting.synchronization') }} + + + + + + 空间未配置MeterSphere参数 前往配置 + + + + +