import projectTagDialog from "@base/views/user/project_tag/dialog.vue";

let modules = {};
modules = {
  name: "projectTagView",
  components: {projectTagDialog},
  props: {
    value: {
      type: Array,
      default: () => []
    },
    readonly: {
      type: Boolean,
    }
  },
  created() {
  },
  mounted() {
  },
  data() {
    return {
      showProjectTagDialog: false,
      checkRows: []
    }
  },
  methods: {
    openProjectTagDialog() {
      this.checkRows = this.value ? this.value.map(item => {
        return {
          tagCode: item.tagCode,
          tagName: item.tagName,
        }
      }) : []
      this.showProjectTagDialog = true;
    },
    confirmProjectTagDialog(rows) {
      let value = rows.map(item => {
        return {
          tagCode: item.tagCode,
          tagName: item.tagName
        }
      })
      this.$emit("input", value)
    },
  }
}
export default modules
