Commit 15f0d08b by yuwei

2.0.0项目初始化

parent 8da81b6a
...@@ -220,9 +220,9 @@ export default { ...@@ -220,9 +220,9 @@ export default {
}) })
}, },
apiSelectChanged (val) { apiSelectChanged (val) {
this.resParamList = this.apiOptions.filter(item => item.id === val).map(function (item) { this.resParamList = this.apiOptions.find(function (item) {
return item.resParams return item.id === val
}) }).resParams
}, },
fieldRule (fieldName) { fieldRule (fieldName) {
this.cipher.open = true this.cipher.open = true
......
...@@ -168,9 +168,16 @@ export default { ...@@ -168,9 +168,16 @@ export default {
let cipher = this.cipherTypeOptions.find((item) => { let cipher = this.cipherTypeOptions.find((item) => {
return item.itemText === rule.cipherType return item.itemText === rule.cipherType
}) })
let crypt = this.cryptTypeOptions.find((item) => { let crypt = {}
return item.itemText === rule.cryptType 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 }) let resParam = Object.assign({}, this.resParamList[fieldParamIndex], { cipherType: (cipher && cipher.itemValue) || undefined, cryptType: (crypt && crypt.itemValue) || undefined })
this.$set(this.resParamList, fieldParamIndex, resParam) this.$set(this.resParamList, fieldParamIndex, resParam)
} }
......
...@@ -226,9 +226,9 @@ export default { ...@@ -226,9 +226,9 @@ export default {
getApiMask(id).then(response => { getApiMask(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
this.resParamList = this.apiOptions.filter(item => item.id === this.form.apiId).map(function (item) { this.resParamList = this.apiOptions.find(function (item) {
return item.resParams return item.id === this.form.apiId
}) }).resParams
this.form.rules.forEach(rule => { this.form.rules.forEach(rule => {
let fieldParamIndex = this.resParamList.findIndex((param) => { let fieldParamIndex = this.resParamList.findIndex((param) => {
return param.fieldName === rule.fieldName return param.fieldName === rule.fieldName
...@@ -237,9 +237,16 @@ export default { ...@@ -237,9 +237,16 @@ export default {
let cipher = this.cipherTypeOptions.find((item) => { let cipher = this.cipherTypeOptions.find((item) => {
return item.itemText === rule.cipherType return item.itemText === rule.cipherType
}) })
let crypt = this.cryptTypeOptions.find((item) => { let crypt = {}
return item.itemText === rule.cryptType 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 }) let resParam = Object.assign({}, this.resParamList[fieldParamIndex], { cipherType: (cipher && cipher.itemValue) || undefined, cryptType: (crypt && crypt.itemValue) || undefined })
this.$set(this.resParamList, fieldParamIndex, resParam) this.$set(this.resParamList, fieldParamIndex, resParam)
} }
...@@ -248,9 +255,9 @@ export default { ...@@ -248,9 +255,9 @@ export default {
}) })
}, },
apiSelectChanged (val) { apiSelectChanged (val) {
this.resParamList = this.apiOptions.filter(item => item.id === val).map(function (item) { this.resParamList = this.apiOptions.find(function (item) {
return item.resParams return item.id === val
}) }).resParams
}, },
fieldRule (fieldName) { fieldRule (fieldName) {
this.cipher.open = true this.cipher.open = true
......
...@@ -436,6 +436,26 @@ export default { ...@@ -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') { if (this.form2.configType === '2') {
this.$refs.sqleditor.editor.setValue(this.form2.sqlText) this.$refs.sqleditor.editor.setValue(this.form2.sqlText)
......
...@@ -435,11 +435,11 @@ export default { ...@@ -435,11 +435,11 @@ export default {
let json = {} let json = {}
json.paramName = item.colName json.paramName = item.colName
json.nullable = item.nullable || '0' json.nullable = item.nullable || '0'
json.remark = item.remark || undefined json.remark = item.colComment || undefined
json.paramType = item.paramType || undefined json.paramType = undefined
json.whereType = item.whereType || undefined json.whereType = undefined
json.exampleValue = item.exampleValue || undefined json.exampleValue = undefined
json.defaultValue = item.defaultValue || undefined json.defaultValue = item.dataDefault || undefined
return json return json
}) })
this.form3.resParams = this.fieldParamList.filter(item => item.resable).map(function (item) { this.form3.resParams = this.fieldParamList.filter(item => item.resable).map(function (item) {
...@@ -447,7 +447,7 @@ export default { ...@@ -447,7 +447,7 @@ export default {
json.fieldName = item.colName json.fieldName = item.colName
json.remark = item.colComment || undefined json.remark = item.colComment || undefined
json.dataType = item.dataType || undefined json.dataType = item.dataType || undefined
json.exampleValue = item.exampleValue || undefined json.exampleValue = undefined
return json return json
}) })
} }
...@@ -546,6 +546,26 @@ export default { ...@@ -546,6 +546,26 @@ export default {
this.fieldParamList = response.data 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