feat:修改http数据集动态参数

main
liu.shiyi 2 years ago
parent e6dcb8f3dc
commit 17e076a9db

@ -441,7 +441,7 @@
<el-button
type="text"
style="float: right;border: none;margin-top: -4px;"
@click="$refs.paramsSettingDialog.open()"
@click="openParamsSetDialog(false)"
>
配置
</el-button>
@ -451,7 +451,7 @@
v-for="param in dataForm.config.paramsList"
:key="param.name"
class="field-item"
@click="$refs.paramsSettingDialog.open()"
@click="openParamsSetDialog(false)"
>
<span>{{ param.name }}</span>&nbsp;<span
v-show="param.remark"
@ -463,7 +463,7 @@
class="edit_field"
type="text"
style="float: right;border: none;margin-top: 2px;"
@click="$refs.paramsSettingDialog.open()"
@click="openParamsSetDialog(false)"
>
配置
</el-button>
@ -620,10 +620,11 @@
<ParamsSettingDialog
ref="paramsSettingDialog"
:params-list="dataForm.config.paramsList"
:newParamsList="newParamsList"
:new-params-list="newParamsList"
@saveParams="saveParams"
@saveNewParams="saveNewParams"
@getData="getData"
@getPramsList="getPramsList"
/>
<OutputFieldDialog
ref="outputFieldDialog"
@ -908,7 +909,6 @@ export default {
this.dataForm.config.params.splice(index, 1)
},
saveParams (val) {
debugger
this.dataForm.config.paramsList = val
},
saveNewParams (val) {
@ -975,6 +975,14 @@ export default {
})
this.fieldDesc = fieldDesc
},
//
async openParamsSetDialog (isUpdate) {
this.getPramsList()
const oldList = _.cloneDeep(this.dataForm.config.paramsList)
this.newParamsList = this.compareParamsList(this.newParamsList, oldList)
await this.$nextTick()
this.$refs.paramsSettingDialog.open(isUpdate)
},
//
getPramsList () {
const paramNames1 = this.getValName(this.dataForm.config.url)
@ -994,13 +1002,40 @@ export default {
type: 'String',
value: '',
status: 1,
require: 1,
require: 0,
remark: ''
})
}
})
this.dataForm.config.paramsList = _.cloneDeep(params)
},
//
compareParamsList (newList, oldList) {
//
const result = []
// A
for (const objA of oldList) {
let found = false // B
// B
for (const objB of newList) {
if (objA.name === objB.name) {
// ABfieldNameBA
objA.value = objB.value
result.push(objA)
found = true
break
}
}
// B
if (!found) {
result.push(objA)
}
}
return result
},
// ${}
getValName (str) {
//
@ -1015,12 +1050,13 @@ export default {
},
//
scriptExecute (isInit = false) {
this.getPramsList()
// this.getPramsList()
// this.newParamsList = this.compareParamsList(this.newParamsList, this.dataForm.config.paramsList)
//
// const flag = this.dataForm.config.paramsList.some(item => !item.value)
//
if (this.dataForm.config.paramsList && this.dataForm.config.paramsList.length && !isInit) {
this.$refs.paramsSettingDialog.open(true)
this.openParamsSetDialog(true)
} else {
this.getData()
}
@ -1098,6 +1134,7 @@ export default {
}
return result
},
//
clearType () {
this.typeName = ''

@ -29,6 +29,7 @@
class="bs-el-input"
placeholder="请输入名称"
clearable
readonly
@change="checkParamsName(scope.row)"
/>
</template>
@ -64,7 +65,10 @@
filterable
>
<template slot-scope="scope">
<el-radio-group v-model="scope.row.require">
<el-radio-group
v-model="scope.row.require"
:disabled="isUpdate"
>
<el-radio :label="1">
</el-radio>
@ -108,6 +112,7 @@
class="bs-el-input"
placeholder="请输入备注"
rows="2"
:readonly="isUpdate"
maxlength="200"
/>
</template>
@ -184,8 +189,9 @@ export default {
},
methods: {
open (isUpdate = false) {
this.$emit('getPramsList')
if (isUpdate) {
this.params = cloneDeep(this.newParamsList)
this.params = this.newParamsList
} else {
this.params = cloneDeep(this.paramsList)
}
@ -219,7 +225,6 @@ export default {
this.dialogVisible = false
}
}
}
</script>

Loading…
Cancel
Save