<template>
  <div  class='container index-container'>
    <el-card shadow="hover">
      <div slot="header" class="clearfix">
        <h3>新增知识库</h3>
      </div>
      <el-row >
        <el-col :span='21' :offset='1'>
          <el-form :model="model" ref="model" label-width="100px">
            <el-form-item label="知识库名称：" prop="knowledgeName">
              <el-input></el-input>
            </el-form-item>

            <el-form-item label="描述(可选)：" prop="knowledgeName" requried>
              <el-input type='textarea'></el-input>
            </el-form-item>

            <el-form-item label="分段模式：" prop="knowledgeName" requried>
              <el-radio-group>
                <el-radio label="1">通用分段模式</el-radio>
                <el-radio label="1">Q&A分段模式</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-form>
        </el-col>

        <el-col :span='24' class='text-center'>
          <el-button type='primary' size='medium' @click='save'>创建</el-button>
          <el-button size='medium'>取消 </el-button>
        </el-col>




      </el-row>



    </el-card>

  </div>
</template>
<script>
import 'nprogress/nprogress.css' // progress bar style
import renderLoading from '@/components/RenderLoading/loading/index'
import NProgress from 'nprogress'
export default {
  name: 'knowledgeForm',
  data() {
    return {}
  },
  props: {
    knowledgeForm: {
      type: Object,
      default: () => {
        return {
          knowledgeName:''
        }
      }
    },
    knowledgeId: {
      type: String
    }
  },
  watch: {},
  components: {},
  filters: {},
  methods: {
    save(){

// 配置进度条参数
//       NProgress.configure({
//         showSpinner: false,  // 隐藏转圈圈
//       })

      // setTimeout(()=>{
      //
      //   NProgress.done();
      // },5000)

      let loadingDom = document.getElementById('knowledgeFormDrawer').querySelector('.el-drawer')


      console.log(loadingDom)
      let loading = renderLoading.service({
        target:loadingDom,
      })

      loading.close()

    },
  },
  created() {
  },
  mounted() {
  },
  computed: {
   // model 获取 knowledgeForm
    model() {
      return this.knowledgeForm
    }
  }
}
</script>
<style scoped lang='scss'>

</style>
