|
@@ -171,7 +171,19 @@ export default {
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
+ var checkVersion = (rule, value, callback) => {
|
|
|
+ if (!value) {
|
|
|
+ return callback(new Error('请输入版本号'))
|
|
|
+ }
|
|
|
+ if (this.pauseVersionCallBack === 15000) {
|
|
|
+ this.pauseVersionCallBack = ''
|
|
|
+ return callback(new Error('版本已经存在请勿重复添加'))
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ }
|
|
|
return {
|
|
|
+ pauseVersionCallBack: '',
|
|
|
userInformation: localStorage.getItem('username'),
|
|
|
userName: localStorage.getItem('realname'),
|
|
|
curIndex: 1,
|
|
@@ -226,7 +238,7 @@ export default {
|
|
|
name: ''
|
|
|
},
|
|
|
addVersionDataRules: {
|
|
|
- version: [{ required: true, message: '请输入版本号', trigger: 'change' }]
|
|
|
+ version: [{ validator: checkVersion, trigger: 'change' }]
|
|
|
},
|
|
|
addEventDataRules: {
|
|
|
name: [{ required: true, message: '请输入事件名称', trigger: 'change' }],
|
|
@@ -329,7 +341,7 @@ export default {
|
|
|
this.dialogFormVisible = true
|
|
|
this.getVersionBytpye(this.isCommand === '' ? this.typeOpt[0].code : this.isCommand)
|
|
|
this.versionlist()
|
|
|
- this.getAllVersionList()
|
|
|
+ // this.getAllVersionList()
|
|
|
},
|
|
|
// 获取所有版本
|
|
|
getVersionBytpye(ele) {
|
|
@@ -384,7 +396,9 @@ export default {
|
|
|
this.dialogCraeteVisible = false
|
|
|
this.getVersionBytpye(this.isCommand === '' ? 1 : this.isCommand)
|
|
|
} else {
|
|
|
- this.errorFun(response.msg)
|
|
|
+ this.pauseVersionCallBack = response.code
|
|
|
+ // this.errorFun(response.msg)
|
|
|
+ this.$refs['addVersionForms'].validate()
|
|
|
}
|
|
|
})
|
|
|
}
|