<template>
  <ts-form
    ref="xForm"
    :data="copyData_"
    :rules="rules"
    class="sysManageSystemDepartment__editor"
    @submit="submitEvent"
  >
  <div slot="formCon">
    <ts-form-item field="newDesignName">
      <ts-input
        v-model="copyData_.newDesignName"
        title="重命名"
        :emphasize="true"
        placeholder
        name="rename"
        :key="copyData.id"
      ></ts-input>
    </ts-form-item>
    <!-- <div class="none">
      <ts-button type="submit" status="primary" ref="submit">提交</ts-button>
    </div> -->
  </div>
  </ts-form>
</template>

<script>
export default {
  name: 'bi_menuCopy',
  props: {
    copyData: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  data() {
    return {
      copyData_: { ...this.copyData },
      rules: {
        newDesignName: [{ required: true, message: '请输入' }]
      }
    }
  },
  created() {},
  mounted() {
  },
  watch: {
    copyData: {
      handler(n) {
        this.copyData_ = { ...n }
      },
      deep: true
    }
  },
  methods: {
    // 表单提交验证
    submitEvent() {
      this.submit()
    },
    submit() {
      this.$emit('submitClick', {
        formData: this.copyData_,
        type: 'biMenuCopy'
      })
    }
  }
}
</script>