布局项目库变更
This commit is contained in:
+26
-14
@@ -70,13 +70,13 @@
|
|||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
projectVersion:[
|
projectVersion: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: this.$t('projectVersion') + this.$t('cannotEmpty'),
|
message: this.$t('projectVersion') + this.$t('cannotEmpty'),
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
disabled: false,
|
disabled: false,
|
||||||
projectNameList: [],
|
projectNameList: [],
|
||||||
@@ -98,7 +98,28 @@
|
|||||||
},
|
},
|
||||||
editModel(value) {
|
editModel(value) {
|
||||||
this.visible = true
|
this.visible = true
|
||||||
this.formInline = value
|
this.formInline.id = value.id
|
||||||
|
if (!value.children) {
|
||||||
|
this.formInline.projectVersion = '01'
|
||||||
|
} else if (value.children && value.children.length > 0) {
|
||||||
|
let projectVersion = value.children[value.children.length - 1].projectVersion
|
||||||
|
if (projectVersion.slice(0, 1) == '0') {
|
||||||
|
let num = projectVersion.slice(1, 2)
|
||||||
|
let numIndex = parseInt(num) + 1
|
||||||
|
if (numIndex.length == 1) {
|
||||||
|
this.formInline.projectVersion = '0' + numIndex
|
||||||
|
} else {
|
||||||
|
this.formInline.projectVersion = numIndex
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let index = parseInt(projectVersion) + 1
|
||||||
|
if (index.length == 1) {
|
||||||
|
this.formInline.projectVersion = '0' + index
|
||||||
|
} else {
|
||||||
|
this.formInline.projectVersion = index
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
this.formInline = { ...this.formInline }
|
this.formInline = { ...this.formInline }
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.ruleForm.clearValidate()
|
this.$refs.ruleForm.clearValidate()
|
||||||
@@ -110,15 +131,6 @@
|
|||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
this.$refs.ruleForm.validate(valid => {
|
this.$refs.ruleForm.validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let url = ''
|
|
||||||
let Action
|
|
||||||
if (this.formInline.id) {
|
|
||||||
url = this.url.edit
|
|
||||||
Action = putAction
|
|
||||||
} else {
|
|
||||||
url = this.url.add
|
|
||||||
Action = postAction
|
|
||||||
}
|
|
||||||
let query = JSON.parse(JSON.stringify(this.formInline))
|
let query = JSON.parse(JSON.stringify(this.formInline))
|
||||||
Object.keys(query).forEach(res => {
|
Object.keys(query).forEach(res => {
|
||||||
if (query[res] && query[res] instanceof Array) {
|
if (query[res] && query[res] instanceof Array) {
|
||||||
@@ -126,12 +138,12 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.confirmLoading = true
|
this.confirmLoading = true
|
||||||
Action(url, query).then((res) => {
|
postAction('/project/projectLibraryBase/addChild', query).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.confirmLoading = false
|
this.confirmLoading = false
|
||||||
this.$message.success(this.$t('OperationSuccessful'))
|
this.$message.success(this.$t('OperationSuccessful'))
|
||||||
this.visible = false
|
this.visible = false
|
||||||
this.$emit('addModelList')
|
this.$emit('changeExtensionForm')
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(res.message)
|
this.$message.warning(res.message)
|
||||||
this.confirmLoading = false
|
this.confirmLoading = false
|
||||||
|
|||||||
@@ -272,7 +272,7 @@
|
|||||||
this.toggleSearchStatus = !this.toggleSearchStatus
|
this.toggleSearchStatus = !this.toggleSearchStatus
|
||||||
},
|
},
|
||||||
changeExtensionClick(val) {
|
changeExtensionClick(val) {
|
||||||
this.$refs.changeExtensionModelRef.addModel(JSON.parse(JSON.stringify(val)))
|
this.$refs.changeExtensionModelRef.editModel(JSON.parse(JSON.stringify(val)))
|
||||||
},
|
},
|
||||||
changeExtensionForm() {
|
changeExtensionForm() {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user