<template>
  <el-dialog
    v-dialogDrag
    :title="title"
    :visible="dialogFormVisible"
    @close="cancelForm"
    :close-on-click-modal="false"
    class="el-dialog-single"
  >
    <el-form
      label-width="200px"
      :model="formList"
      :rules="rules"
      ref="ruleForm"
    >  

      <el-row>
        <el-col :span="24">
           <div v-html="agreement"></div>
        </el-col>
      </el-row>
     
    </el-form>

    <!-- <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="submitForm()">确 定</el-button>
      <el-button @click="cancelForm()">取 消</el-button>
    </div> -->
  </el-dialog>
</template>
<script>
export default {
  props: ["showdialog","agreementTitle","agreement"],
  watch: {
    showdialog() {
      this.dialogFormVisible = this.showdialog;
      this.title = this.agreementTitle;
    },
  },
  components: {
    // selectTree //注册组件
  },
  data() {
    return {     
      title: "",
      dialogFormVisible: this.showdialog,
      OperType: 0, //0 新增  1修改
      formList: {},
      params:{//搜索条件
        pageIndex:1,
        pageSize:10,
        keyword:'',             
        total:0
      },
      rules: {
        
      },
      defaulDataParent:'',//上级部门默认回选数据
      defaulData:[],
      parentIdShow:true
    };
  },
  methods: {     
    getTableRow(data, type) {       
      let newRowData = JSON.parse(JSON.stringify(data)); //拷贝一份存储对象
      this.formList = newRowData; //拷贝一份存储对象引用不同地址
      this.OperType = type;
      console.log(this.formList.parentId)
      if (this.OperType == 0) {        
        this.title = this.agreementTitle;
        
      } else {
        this.title = this.agreementTitle;
       
      }
      
     
    },     
    submitForm() {      
    //   let obj2={domainId:this.$route.query.domainId}
    //   if (this.OperType == 0) {
    //     //新增
    //   }
    //   this.$refs.ruleForm.validate((valid) => {
    //     if (valid) {
    //       if (this.OperType == 0) {
    //         AddDepartmentsApi(this.formList,obj2).then((response) => {
    //           //新增
    //           if (response.status==200) {
    //             let newobj = JSON.parse(JSON.stringify(this.formList));
    //             this.$emit("refurlist", newobj); //确定后发送$emit绑定父数据
    //             this.cancelForm();
    //           }
    //         });
    //       } else {
    //         EditDepartmentsApi(this.formList,obj2).then((response) => {
    //           //修改
    //           if (response.status==200) {
    //             let newobj = JSON.parse(JSON.stringify(this.formList));
    //             this.$emit("refurlist", newobj); //确定后发送$emit绑定父数据
    //             this.cancelForm();
    //           }
    //         });
    //       }
    //     } else {
    //       return false;
    //     }
    //   });
    },
    cancelForm() {
      //取消关闭
      this.$emit("update:showdialog", false);
      this.$nextTick(function () {
        this.$refs.ruleForm.resetFields(); //重置输入框提示
      });
    },
  },
};
</script>
<style lang="scss">

</style>