<template>
    <el-container style="height: 100%;width: 100%">
        <el-form :model="requestForm" label-width="120px" label-position="top" style="width: 100%" ref="form">
            <el-form-item label="请求路径（仅请求一次）" prop="requestUrl" :rules="plValidate('required')">
                <el-input v-model="requestForm.requestUrl"></el-input>
            </el-form-item>
            <el-form-item label="返回值解析（入参result,rowData）" prop="dealMethod" :rules="plValidate('required')">
                <el-input type="textarea" :autosize="{minRows:5}" v-model="requestForm.dealMethod"></el-input>
            </el-form-item>
        </el-form>
    </el-container>
</template>

<script>
    import ColumnFormatParentConfig from "./columnFormatParentConfig";
    export default {
        name: "batch-remote-request-config",
        extends: ColumnFormatParentConfig,
        data(){
            return {
                requestForm:{
                    requestUrl:"",
                    dealMethod:""
                }
            }
        },
        created() {
            this.initData();
        },
        methods:{
            initData(){
                this.requestForm = JSON.parse(JSON.stringify(this.configData || {}));
            },
            validateMethod(){
                let result = false;
                this.$refs.form.validate(valid => {
                    result = valid;
                })
                return result;
            },
            getConfigDatas(){
                return this.requestForm;
            }
        }
    }
</script>

<style scoped>

</style>