let mixin = {};
mixin = {
  props: ["visiable", "multi", "rows", "param", "current_prefix", "wfInfo"],
  mixins: [],
  data() {
    return {
      showDialog: true,
      selectMulti: true,
      vxeOption: {},
    };
  },
  created() {
    this.initSetting({
      pageEnabled: false,
      url: this.current_prefix + "/wf/getIncreaseSign",
      param: () => {
        return {
          uuid: this.wfInfo.uuid,
          taskId: this.wfInfo.taskId,
        }
      }
    });
  },
  mounted() {
    this.searchEvent();
  },
  methods: {
    dialogConfirm() {
      this.dialogPrimary();
      // this.$emit("confirm");
    },
    subForm() {
      let that = this;
      let userIds = this.checkRows.map((checkRow) => checkRow.id);
      if (userIds.length == 0) {
        that.$message({
          message: this.$t2('请选择候选人', 'components.wf.deleteIncreaseSignWarnMsg1'),
          type: "error",
          duration: 2000,
          onClose: (t) => {
          },
        });
        return false;
      }
      that.$baseConfirm(this.$t2('您确定要减签选中的候选人吗？', 'components.wf.deleteIncreaseSignTip')).then(() => {
        var data = JSON.stringify({
          uuid: this.wfInfo.uuid,
          taskId: this.wfInfo.taskId,
          userIds: userIds,
        });
        this.agreeDialogVisible = false;
        that.$http({
          url: this.current_prefix + "/wf/deleteIncreaseSign",
          data: data,
          method: "post",
          loadingTarget: document.body,
          headers: {
            "Content-Type": "application/json;charset=utf-8",
          },
          isLoading: true,
          success: (resultMsg) => {
            that.$message({
              message: resultMsg.content,
              type: "success",
              duration: 500,
              onClose: (t) => {
                this.dialogConfirm();
              },
            });
          },
        });
      });
    },
  },
};

export default mixin;
