let mixin = {};
mixin = {
  props: ["visiable", "multi", "rows", "param", "current_prefix", "wfInfo"],
  mixins: [],
  data() {
    return {
      showDialog: true,
      selectMulti: true,
      vxeOption: {},
      genderMap: {1: '男', 2: '女'}
    };
  },
  created() {
    this.initSetting({
      url: USER_PREFIX + '/user/listCurrentPage',
      param: () => {
        return {
          enabled: true,
          ...this.formData,
          ...this.param,
        }
      }
    });
  },
  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.addIncreaseSignWarnMsg1'),
          type: "error",
          duration: 2000,
          onClose: (t) => {
          },
        });
        return false;
      }
      that.$baseConfirm(this.$t2('您确定要加签选中的候选人吗？', 'components.wf.addIncreaseSignConfirmTip2')).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/addIncreaseSign",
          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;
