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

let modules = {};
modules = {
  name: "projectTagDeleteButton",
  props: {
    option: {
      type: Object,
      default: () => {
      }
    }
  },
  components: {projectTagDialog},
  data() {
    return {
      showProjectTagDialog: false
    }
  },
  created() {
  },
  mounted() {
  },
  methods: {
    openProjectTagDialog() {
      let rows = this.option.tableDatas();
      if (!rows.length) {
        this.$baseAlert(this.$t1("请选择需要删除标签的数据"));
        return;
      }
      this.showProjectTagDialog = true;
    },
    confirmProjectTagDialog(rows) {
      if (!rows.length) return
      let checkRows = this.option.tableDatas();
      let reqData = this.option.reqData(rows, checkRows)
      this.$http({
        aes:true,
        url: this.option.url,
        method: `post`,
        data: reqData,
        isLoading: true,
        success: res => {
          this.$message({
            message: res.content,
            type: 'success',
            duration: 500,
            onClose: t => {
              this.option.callback && this.option.callback()
            }
          });
        }
      });
    },
  },
}
export default modules
