Commit 15f0d08b by yuwei

2.0.0项目初始化

parent 8da81b6a
......@@ -220,9 +220,9 @@ export default {
})
},
apiSelectChanged (val) {
this.resParamList = this.apiOptions.filter(item => item.id === val).map(function (item) {
return item.resParams
})
this.resParamList = this.apiOptions.find(function (item) {
return item.id === val
}).resParams
},
fieldRule (fieldName) {
this.cipher.open = true
......
......@@ -168,9 +168,16 @@ export default {
let cipher = this.cipherTypeOptions.find((item) => {
return item.itemText === rule.cipherType
})
let crypt = this.cryptTypeOptions.find((item) => {
return item.itemText === rule.cryptType
})
let crypt = {}
if (rule.cipherType === '1') {
crypt = this.regexCryptoOptions.find((item) => {
return item.itemText === rule.cryptType
})
} else if (rule.cipherType === '2') {
crypt = this.algorithmCryptoOptions.find((item) => {
return item.itemText === rule.cryptType
})
}
let resParam = Object.assign({}, this.resParamList[fieldParamIndex], { cipherType: (cipher && cipher.itemValue) || undefined, cryptType: (crypt && crypt.itemValue) || undefined })
this.$set(this.resParamList, fieldParamIndex, resParam)
}
......
......@@ -226,9 +226,9 @@ export default {
getApiMask(id).then(response => {
if (response.success) {
this.form = response.data
this.resParamList = this.apiOptions.filter(item => item.id === this.form.apiId).map(function (item) {
return item.resParams
})
this.resParamList = this.apiOptions.find(function (item) {
return item.id === this.form.apiId
}).resParams
this.form.rules.forEach(rule => {
let fieldParamIndex = this.resParamList.findIndex((param) => {
return param.fieldName === rule.fieldName
......@@ -237,9 +237,16 @@ export default {
let cipher = this.cipherTypeOptions.find((item) => {
return item.itemText === rule.cipherType
})
let crypt = this.cryptTypeOptions.find((item) => {
return item.itemText === rule.cryptType
})
let crypt = {}
if (rule.cipherType === '1') {
crypt = this.regexCryptoOptions.find((item) => {
return item.itemText === rule.cryptType
})
} else if (rule.cipherType === '2') {
crypt = this.algorithmCryptoOptions.find((item) => {
return item.itemText === rule.cryptType
})
}
let resParam = Object.assign({}, this.resParamList[fieldParamIndex], { cipherType: (cipher && cipher.itemValue) || undefined, cryptType: (crypt && crypt.itemValue) || undefined })
this.$set(this.resParamList, fieldParamIndex, resParam)
}
......@@ -248,9 +255,9 @@ export default {
})
},
apiSelectChanged (val) {
this.resParamList = this.apiOptions.filter(item => item.id === val).map(function (item) {
return item.resParams
})
this.resParamList = this.apiOptions.find(function (item) {
return item.id === val
}).resParams
},
fieldRule (fieldName) {
this.cipher.open = true
......
......@@ -436,6 +436,26 @@ export default {
})
}
})
this.form1.reqParams.forEach(param => {
let paramIndex = this.fieldParamList.findIndex((item) => {
return item.colName === param.paramName
})
if (paramIndex !== -1) {
let reqParam = this.fieldParamList[paramIndex]
reqParam.reqable = true
this.$set(this.fieldParamList, paramIndex, reqParam)
}
})
this.form1.resParams.forEach(field => {
let fieldIndex = this.fieldParamList.findIndex((item) => {
return item.colName === field.fieldName
})
if (fieldIndex !== -1) {
let resParam = this.fieldParamList[fieldIndex]
resParam.resable = true
this.$set(this.fieldParamList, fieldIndex, resParam)
}
})
}
if (this.form2.configType === '2') {
this.$refs.sqleditor.editor.setValue(this.form2.sqlText)
......
......@@ -435,11 +435,11 @@ export default {
let json = {}
json.paramName = item.colName
json.nullable = item.nullable || '0'
json.remark = item.remark || undefined
json.paramType = item.paramType || undefined
json.whereType = item.whereType || undefined
json.exampleValue = item.exampleValue || undefined
json.defaultValue = item.defaultValue || undefined
json.remark = item.colComment || undefined
json.paramType = undefined
json.whereType = undefined
json.exampleValue = undefined
json.defaultValue = item.dataDefault || undefined
return json
})
this.form3.resParams = this.fieldParamList.filter(item => item.resable).map(function (item) {
......@@ -447,7 +447,7 @@ export default {
json.fieldName = item.colName
json.remark = item.colComment || undefined
json.dataType = item.dataType || undefined
json.exampleValue = item.exampleValue || undefined
json.exampleValue = undefined
return json
})
}
......@@ -546,6 +546,26 @@ export default {
this.fieldParamList = response.data
}
})
this.form1.reqParams.forEach(param => {
let paramIndex = this.fieldParamList.findIndex((item) => {
return item.colName === param.paramName
})
if (paramIndex !== -1) {
let reqParam = this.fieldParamList[paramIndex]
reqParam.reqable = true
this.$set(this.fieldParamList, paramIndex, reqParam)
}
})
this.form1.resParams.forEach(field => {
let fieldIndex = this.fieldParamList.findIndex((item) => {
return item.colName === field.fieldName
})
if (fieldIndex !== -1) {
let resParam = this.fieldParamList[fieldIndex]
resParam.resable = true
this.$set(this.fieldParamList, fieldIndex, resParam)
}
})
}
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment