大小版本显示具体版本号
This commit is contained in:
parent
5f5a886b81
commit
76b12eb280
@ -114,8 +114,8 @@
|
||||
>
|
||||
<span>请选择以{{ currentVersion }}版本为模板创建的新文件版本号:</span></br>
|
||||
<el-radio-group style="margin-top: 10px" v-model="isLargeIteration">
|
||||
<el-radio :label=true>大版本</el-radio></br>
|
||||
<el-radio style="margin-top: 5px" :label=false>小版本</el-radio>
|
||||
<el-radio :label=true>{{ largeVersion }}</el-radio></br>
|
||||
<el-radio style="margin-top: 5px" :label=false>{{ smallVersion }}</el-radio>
|
||||
</el-radio-group>
|
||||
<span slot="footer">
|
||||
<awsui-button class="button-general-color" type="primary" @click="confirmAddVersion">确定</awsui-button>
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user