|
@@ -257,7 +257,10 @@
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
<el-row>
|
|
<el-row>
|
|
- <el-col :span="24">
|
|
|
|
|
|
+ <el-col
|
|
|
|
+ :span="12"
|
|
|
|
+ :offset="6"
|
|
|
|
+ >
|
|
<div
|
|
<div
|
|
class="add-btn"
|
|
class="add-btn"
|
|
@click="addHeader"
|
|
@click="addHeader"
|
|
@@ -327,7 +330,10 @@
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
<el-row>
|
|
<el-row>
|
|
- <el-col :span="24">
|
|
|
|
|
|
+ <el-col
|
|
|
|
+ :span="12"
|
|
|
|
+ :offset="6"
|
|
|
|
+ >
|
|
<div
|
|
<div
|
|
class="add-btn"
|
|
class="add-btn"
|
|
@click="addParam"
|
|
@click="addParam"
|
|
@@ -517,10 +523,9 @@
|
|
<el-table
|
|
<el-table
|
|
align="center"
|
|
align="center"
|
|
:data="dataPreviewList"
|
|
:data="dataPreviewList"
|
|
- max-height="400"
|
|
|
|
|
|
+ max-height="300"
|
|
:border="true"
|
|
:border="true"
|
|
- height="500px"
|
|
|
|
- class="bs-el-table bs-scrollbar"
|
|
|
|
|
|
+ class="bs-el-table bs-scrollba preview-table"
|
|
>
|
|
>
|
|
<el-table-column
|
|
<el-table-column
|
|
v-for="(value, key) in dataPreviewList[0]"
|
|
v-for="(value, key) in dataPreviewList[0]"
|
|
@@ -615,7 +620,9 @@
|
|
<ParamsSettingDialog
|
|
<ParamsSettingDialog
|
|
ref="paramsSettingDialog"
|
|
ref="paramsSettingDialog"
|
|
:params-list="dataForm.config.paramsList"
|
|
:params-list="dataForm.config.paramsList"
|
|
|
|
+ :newParamsList="newParamsList"
|
|
@saveParams="saveParams"
|
|
@saveParams="saveParams"
|
|
|
|
+ @saveNewParams="saveNewParams"
|
|
@getData="getData"
|
|
@getData="getData"
|
|
/>
|
|
/>
|
|
<OutputFieldDialog
|
|
<OutputFieldDialog
|
|
@@ -704,6 +711,7 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return {
|
|
return {
|
|
|
|
+ newParamsList: [], // 存放临时的动态参数值
|
|
activeName: 'head',
|
|
activeName: 'head',
|
|
options: [{
|
|
options: [{
|
|
value: 'string',
|
|
value: 'string',
|
|
@@ -811,6 +819,7 @@ export default {
|
|
this.dataForm = { id, name, typeId, remark, datasetType, moduleCode, editable, sourceId, config: { ...config } }
|
|
this.dataForm = { id, name, typeId, remark, datasetType, moduleCode, editable, sourceId, config: { ...config } }
|
|
this.fieldDesc = fieldDesc
|
|
this.fieldDesc = fieldDesc
|
|
this.outputFieldList = fieldList
|
|
this.outputFieldList = fieldList
|
|
|
|
+ this.newParamsList = _.cloneDeep(paramsList)
|
|
this.codemirrorOption.mode = this.dataForm.config.requestType === 'frontend' ? 'text/javascript' : 'text/x-groovy'
|
|
this.codemirrorOption.mode = this.dataForm.config.requestType === 'frontend' ? 'text/javascript' : 'text/x-groovy'
|
|
// this.replaceParams(paramsList)
|
|
// this.replaceParams(paramsList)
|
|
this.scriptExecute(true)
|
|
this.scriptExecute(true)
|
|
@@ -899,8 +908,13 @@ export default {
|
|
this.dataForm.config.params.splice(index, 1)
|
|
this.dataForm.config.params.splice(index, 1)
|
|
},
|
|
},
|
|
saveParams (val) {
|
|
saveParams (val) {
|
|
|
|
+ debugger
|
|
this.dataForm.config.paramsList = val
|
|
this.dataForm.config.paramsList = val
|
|
},
|
|
},
|
|
|
|
+ saveNewParams (val) {
|
|
|
|
+ console.log(val)
|
|
|
|
+ this.newParamsList = val
|
|
|
|
+ },
|
|
// 取消操作
|
|
// 取消操作
|
|
// cancelField () {
|
|
// cancelField () {
|
|
// this.structurePreviewListCopy = cloneDeep(this.outputFieldList)
|
|
// this.structurePreviewListCopy = cloneDeep(this.outputFieldList)
|
|
@@ -1005,19 +1019,22 @@ export default {
|
|
// 如果动态参数未配置,则直接打开配置弹窗
|
|
// 如果动态参数未配置,则直接打开配置弹窗
|
|
// const flag = this.dataForm.config.paramsList.some(item => !item.value)
|
|
// const flag = this.dataForm.config.paramsList.some(item => !item.value)
|
|
// 每次执行时只要有动态参数就会打开参数配置的弹窗进行设置
|
|
// 每次执行时只要有动态参数就会打开参数配置的弹窗进行设置
|
|
- this.$refs.paramsSettingDialog.open()
|
|
|
|
|
|
+ if (this.dataForm.config.paramsList && this.dataForm.config.paramsList.length) {
|
|
|
|
+ this.$refs.paramsSettingDialog.open(true)
|
|
|
|
+ } else {
|
|
|
|
+ this.getData()
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 调接口
|
|
// 调接口
|
|
getData () {
|
|
getData () {
|
|
// 如果是前端代理,则自行组装接口及参数并调接口
|
|
// 如果是前端代理,则自行组装接口及参数并调接口
|
|
if (this.dataForm.config.requestType === 'frontend') {
|
|
if (this.dataForm.config.requestType === 'frontend') {
|
|
// this.replaceParams(this.dataForm.config.paramsList)
|
|
// this.replaceParams(this.dataForm.config.paramsList)
|
|
- axiosFormatting({ ...this.dataForm.config }).then((res) => {
|
|
|
|
- const { resp, response } = res
|
|
|
|
|
|
+ axiosFormatting({ ...this.dataForm.config, paramsList: this.newParamsList }).then((res) => {
|
|
// this.dataPreviewList = res.data && Array.isArray(res.data) ? res.data : []
|
|
// this.dataPreviewList = res.data && Array.isArray(res.data) ? res.data : []
|
|
this.dataPreviewList = [{}]
|
|
this.dataPreviewList = [{}]
|
|
- for (const item in response.data) {
|
|
|
|
- this.dataPreviewList[0][item] = response.data[item]
|
|
|
|
|
|
+ for (const item in res) {
|
|
|
|
+ this.dataPreviewList[0][item] = res[item]
|
|
}
|
|
}
|
|
// 获取数据后更新输出字段
|
|
// 获取数据后更新输出字段
|
|
this.updateOoutputFieldList(this.dataPreviewList)
|
|
this.updateOoutputFieldList(this.dataPreviewList)
|
|
@@ -1246,13 +1263,13 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-::v-deep .bs-table-box.is-Edit .el-table {
|
|
|
|
- max-height: unset !important;
|
|
|
|
-
|
|
|
|
- .el-table__body-wrapper {
|
|
|
|
- max-height: unset !important;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
+//::v-deep .bs-table-box.is-Edit .el-table {
|
|
|
|
+// max-height: unset !important;
|
|
|
|
+//
|
|
|
|
+// .el-table__body-wrapper {
|
|
|
|
+// max-height: unset !important;
|
|
|
|
+// }
|
|
|
|
+//}
|
|
|
|
|
|
.bs-table-box {
|
|
.bs-table-box {
|
|
padding: 0;
|
|
padding: 0;
|
|
@@ -1283,4 +1300,7 @@ export default {
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+.preview-table{
|
|
|
|
+ max-height: 300px!important;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|