diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 1b1b648cff..7df8e183c4 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1641,6 +1641,7 @@ export default { has_repeat_name: 'Duplicate API data table name', has_repeat_field_name: 'The field name is duplicate, please modify it before selecting', api_field_not_empty: 'Field cannot be empty', + success_copy: 'Copy succeeded', valid: 'Valid', invalid: 'Invalid', api_step_1: 'Connection API', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index e7fe8600ef..329b01b3e3 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1641,6 +1641,7 @@ export default { has_repeat_name: 'API 數據表名稱重複', has_repeat_field_name: '欄位名重複,請修改後再選擇', api_field_not_empty: '欄位不能為空', + success_copy: '複製成功', valid: '有效', invalid: '無效', api_step_1: '連接API', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index a1976ad776..55c32a421d 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1649,6 +1649,7 @@ export default { has_repeat_name: 'API 数据表名称重复', has_repeat_field_name: '字段名重复,请修改后再选择', api_field_not_empty: '字段不能为空', + success_copy: '复制成功', valid: '有效', invalid: '无效', api_step_1: '连接API', diff --git a/frontend/src/views/system/datasource/DsConfiguration.vue b/frontend/src/views/system/datasource/DsConfiguration.vue index 0519aacd44..be710c70f0 100644 --- a/frontend/src/views/system/datasource/DsConfiguration.vue +++ b/frontend/src/views/system/datasource/DsConfiguration.vue @@ -1010,8 +1010,21 @@ export default { copyItem(item){ var newItem = JSON.parse(JSON.stringify(item)) newItem.serialNumber = this.form.apiConfiguration[this.form.apiConfiguration.length - 1].serialNumber + 1 - newItem.name = item.name + '_copy' + var reg = new RegExp(item.name + '_copy_' + '([0-9]*)', "gim"); + var number = 0 + for(var i =1;i number){ + number = parseInt(num) + } + } + } + number = number + 1 + newItem.name = item.name + '_copy_' + number this.form.apiConfiguration.push(newItem) + this.$message.success(i18n.t('datasource.success_copy')) }, addApiItem(item) { if (item) {