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/getTaskCandidates",
      param: () => {
        return {stringOne: this.wfInfo.uuid};
      }
    });
  },
  mounted() {
    this.searchEvent();
  },
  methods: {
    dialogConfirm() {
      this.dialogPrimary();
      this.$emit("confirm");
    },
    subUrgingForm() {
      let that = this;
      let urgingUserIds = this.checkRows.map((checkRow) => checkRow.id);
      if (urgingUserIds.length == 0) {
        that.$message({
          message: this.$t2('请选择催办人', 'components.wf.urgingWarnMsg1'),
          type: "error",
          duration: 2000,
          onClose: (t) => {
          },
        });
        return false;
      }
      that.$baseConfirm(this.$t2('您确定要催办吗？', 'components.wf.urgingConfirmTip')).then(() => {
        var data = JSON.stringify({
          uuid: this.wfInfo.uuid,
          taskId: this.wfInfo.taskId,
          notifyType: "wfUrging",
          userIds: urgingUserIds,
        });
        this.agreeDialogVisible = false;
        that.$http({
          url: this.current_prefix + "/wf/urging",
          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.reloadContent();
                this.dialogConfirm();
              },
            });
          },
        });
      });
    },
  },
};

export default mixin;
