From 76b12eb280a4bc6cd074a555b5e9f63b829fbacd Mon Sep 17 00:00:00 2001 From: "mrs_12345@163.com" Date: Mon, 18 Jul 2022 15:32:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E7=89=88=E6=9C=AC=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=85=B7=E4=BD=93=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/RepositoryInfoVersion.vue | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/com.actionsoft.apps.coe.pal/src/views/repository/RepositoryInfoVersion.vue b/com.actionsoft.apps.coe.pal/src/views/repository/RepositoryInfoVersion.vue index 029c170..d823e5b 100644 --- a/com.actionsoft.apps.coe.pal/src/views/repository/RepositoryInfoVersion.vue +++ b/com.actionsoft.apps.coe.pal/src/views/repository/RepositoryInfoVersion.vue @@ -114,8 +114,8 @@ > 请选择以{{ currentVersion }}版本为模板创建的新文件版本号:
- 大版本
- 小版本 + {{ largeVersion }}
+ {{ smallVersion }}
确定 @@ -156,6 +156,8 @@ havingVersionManagePerm: false, addNewVersionVisible: false, currentVersion: '', + largeVersion: '', + smallVersion: '', currentId: '', isLargeIteration: true, isOlderVersion: true, @@ -283,6 +285,24 @@ } }, createNewVersion(id, versionNo) {// 复制/创建新版本 + let versionArr = [] + let smallVersionInteger // 小版本整数位 + let smallVersionDecimal // 小版本小数位 + let arr1 = [] // 大版本号 + let arr2 = [] // 以当前版本为大版本的所有小版本 + smallVersionInteger = parseInt(versionNo.match(/\d+\.\d+/g)[0]) + this.tableData.forEach(item => { + versionArr.push(item.versionNo.match(/\d+\.\d+/g)[0].split('.')) // /\d+(.\d+)?/g + }) + versionArr.forEach(item => { + arr1.push(parseInt(item[0])) + if (item[0] == smallVersionInteger) { + arr2.push(parseInt(item[1])) + } + }) + smallVersionDecimal = Math.max(...arr2) + 1 + this.largeVersion = 'V' + (Math.max(...arr1) + 1).toFixed(1) + this.smallVersion = 'V' + smallVersionInteger + '.' + smallVersionDecimal this.addNewVersionVisible = true this.currentVersion = versionNo this.currentId = id