<template>
  <div class="subfield-item-container">
    <img src="@/assets/images/consultingAgencyManagement/customForm/icon_drag@2x.png" alt="" class="subfield-module-item-dragg-target-icon">
    <el-form-item class="subfield-module-form-item" :label="comChildModuleInfo.comLabel">
      <el-input v-model="comChildModuleInfo.value" :placeholder="comChildModuleInfo.placeholder" clearable></el-input>
    </el-form-item>
    <img src="@/assets/images/consultingAgencyManagement/customForm/icon_delete@2x.png" alt="" class="remove-subfield-item-icon"
      @click.stop="removeModuleItem">
  </div>
</template>
<script>
export default {
  name: "subfieldItem",
  props: {
    childModuleInfo: Object,
    parentUid: String
  },
  watch: {
    childModuleInfo: {
      handler(newValue) {
        this.comChildModuleInfo = newValue;
      },
      deep: true
    }
  },
  data() {
    return {
      comChildModuleInfo: this.childModuleInfo
    };
  },
  //可访问data属性
  created() {

  },
  //计算集
  computed: {

  },
  //方法集
  methods: {
    removeModuleItem() {
      this.$emit("removeModuleItem", this.comChildModuleInfo, this.parentUid);
    },
  },
}
</script>
<style lang="scss" scoped>
.subfield-item-container {
  width: 100%;
  min-height: 56px;
  padding: 0px 16px 0px 32px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  background: #dcebff;

  .subfield-module-item-dragg-target-icon {
    width: 14px;
    height: 14px;
    cursor: move;
  }

  ::v-deep .subfield-module-form-item {
    display: flex;

    .el-form-item__label {
      line-height: 32px;
      font-size: 14px;
      font-weight: 400;
      color: rgba(35, 35, 35, 0.8);
    }
    .el-form-item__content {
      flex: 1;
    }
  }

  .remove-subfield-item-icon {
    width: 16px;
    height: 16px;
    margin-left: 12px;
    cursor: pointer;
  }
}
</style>
