<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 EventParentConfig from "../../eventParentConfig";
    export default {
        name: "batchRequestFormatter",
        extends: EventParentConfig,
        eventType: 'list',
        eventName:'批量远程请求',
        renderKey:'batch-remote-request-render', //渲染模版对应的唯一标识（渲染组件 name）
        reqAfter:'batch-remote-request-after',
        data(){
            return {
                eventSource: 'list',
                eventShowName:'远程请求',
                requestForm:{
                    requestUrl:"",
                    dealMethod:""
                }
            }
        },
        created() {
            this.initData();
        },
        methods:{
            initData(){
                this.eventSource = 'list';
                this.eventName = "远程请求";
                this.requestForm = JSON.parse(JSON.stringify(this.cloumnFormatterObj || {}));
            },
            validateMethod(){
                let result = false;
                this.$refs.form.validate(valid => {
                    result = valid;
                })
                return result;
            },
            getConfigDatas(){
                return this.requestForm;
            }
        }
    }
</script>

<style scoped>

</style>