retrieveDialog.vue 2.71 KB
<template>
  <dialogBox title="调用接口" @submitForm="submitForm" saveButton="调用" width="50%" :isFullscreen="false"
    @closeDialog="closeDialog" v-model="value">
    <el-descriptions class="margin-top" :column="1" :size="16" border>
      <el-descriptions-item>
        <template slot="label" style="width:200px">接口代码</template>{{ruleForm.interfaceCode}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">接口名称</template>{{ruleForm.interfaceService}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">接口地址</template>{{ruleForm.interfaceApi}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">接口方式</template>{{ruleForm.interfaceMethod}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">接口类型</template>{{ruleForm.interfaceType}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">接口参数</template><el-input v-model="interfaceParams" type="textarea" :rows="4"></el-input>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">调用状态</template>{{returnMessage.statusCode}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">返回结果</template>{{returnMessage.body}}
      </el-descriptions-item>
    </el-descriptions>
  </dialogBox>
</template>

<script>
import {interfaceRetrieve } from "@/api/jkfw.js"
export default {
  components: {
  },
  computed: {
  },
  props: {
    value: { type: Boolean, default: false },
  },
  data () {
    return {
      //表单提交数据
      interfaceMethods: ['webapi','webservice'],
      interfaceTypes: [
          {'label': '工作流服务平台','value':'1'},
          {'label': '管理平台','value':'2'},
          {'label': '定时器服务','value':'3'},
          {'label': '其他第三方平台','value':'4'},
      ],
      ruleForm: {},
      interfaceParams: '{\n\n}' ,
      returnMessage: {},
    }
  },
  methods: {
    //表单提交
    submitForm () {
      var formdata = new FormData();
      formdata.append("interfaceCode", this.ruleForm.interfaceCode);
      formdata.append("params", this.interfaceParams);
      interfaceRetrieve(formdata).then(res => {
        if(res.code == 200){
          this.returnMessage = res.result
          
        }
      })
    },
    //获取详情
    getDetailInfo(item){
      this.ruleForm = item
    },
    //关闭弹窗
    closeDialog () {
      this.$emit("input", false);
      this.interfaceParams = '{\n\n}'
      this.returnMessage = {}
    }
  }
}
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
</style>