nlp.vue 1.88 KB
<template xmlns:el-col="http://www.w3.org/1999/html">
  <div>
    <br/>
    <span>NLP测试用例</span>
    <el-table
      :data="nlpTestcases"
      border
      style="width: 100%"
      :header-cell-style="{background: 'deepskyblue', color: 'snow'}">
      <el-table-column
        prop="name"
        label="domain名称"
        min-width="1">
      </el-table-column>
      <el-table-column
        prop="tag"
        label="domain标识"
        min-width="1">
      </el-table-column>
      <el-table-column
        prop="keyword"
        label="NLP问题"
        min-width="2">
      </el-table-column>
      <el-table-column
        prop="assert_text"
        label="NLP断言"
        min-width="3">
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        myplatform: this.$route.query.myplatform,
        runtime: this.$route.query.runtime,
        nlpTestcases: []
      }
    },
    mounted() {
      this.activity()
    },
    methods: {
      activity() {
        const loading = this.$loading({
          lock: true,
          text: '加载中...',
          spinner: 'el-icon-loading',
          background: 'rgba(0, 0, 0, 0.7)'
        });
        let config = {
          headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
          }
        }
        this.$http.get('/tool/nlpTestCase?'+this.$qs.stringify({
          runtime: this.runtime,
          platform: this.myplatform,
        }),config).then((res)=>{
          console.log(res.data)
          this.nlpTestcases=res.data.nlpTestcases
          loading.close();
        }).catch(error=>{
          console.log(error);
          loading.close();
          this.$message({
            showClose: true,
            message: '服务器处理失败,请核对参数!',
            type: 'error'
          });
        })
      }
    }
  }
</script>