<template>
  <div>
    <el-dialog title="文本筛选条件" :visible.sync="visible" width="850px" append-to-body destroy-on-close :before-close="close" top="10vh">
      <div class="patent-text-query-filter">
        <el-form ref="form" :model="form" label-width="80px" label-position="left">
          <el-form-item label="标题">
            <el-input type="textarea" v-model="form.name" placeholder="请输入查询内容"></el-input>
          </el-form-item>
          <el-form-item label="摘要">
            <el-input type="textarea" v-model="form.abstractStr" placeholder="请输入查询内容"></el-input>
          </el-form-item>
          <el-form-item label="权利要求">
            <el-input type="textarea" v-model="form.rightContent" placeholder="请输入查询内容"></el-input>
          </el-form-item>
          <el-form-item label="公开号">
            <el-input type="textarea" v-model="form.publicNo" placeholder="请输入查询内容"></el-input>
          </el-form-item>
          <el-form-item label="申请号">
            <el-input type="textarea" v-model="form.applicationNo" placeholder="请输入查询内容"></el-input>
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="close">取 消</el-button>
        <el-button type="primary" @click="submit" :loading="btnLoading">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      visible: false,
      btnLoading: false,
      form: {
        name: '',
        abstractStr: '',
        publicNo: '',
        applicationNo: '',
        rightContent: ''
      }
    }
  },
  computed: {
    params() {
      return this.$store.state.patent.params
    },
  },
  methods: {
    open() {
      this.form.name = this.params.name
      this.form.abstractStr = this.params.abstractStr
      this.form.publicNo = this.params.publicNo
      this.form.applicationNo = this.params.applicationNo
      this.form.rightContent = this.params.rightContent
      this.visible = true
    },
    close() {
      this.visible = false
      this.$emit('close')
    },
    submit() {
      this.$emit('submit', this.form)
      this.visible = false
    }
  }
}
</script>

<style lang="scss">
.patent-text-query-filter {
  .el-alert {
    margin-bottom: 20px;
  }
  .el-textarea {
  }
}
</style>