/******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	// The require scope
/******/ 	var __webpack_require__ = {};
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = function(exports) {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": function() { return /* binding */ select_group; }
});

;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/select-group/src/main.vue?vue&type=template&id=c48798d6&
var render = function render() {
  var _vm = this,
    _c = _vm._self._c;
  return _vm.dialogVisible ? _c("el-dialog", _vm._b({
    directives: [{
      name: "el-drag-dialog",
      rawName: "v-el-drag-dialog",
      value: true,
      expression: "true"
    }],
    ref: "elDialog",
    attrs: {
      title: _vm.dialogTitle,
      visible: _vm.dialogVisible,
      "modal-append-to-body": _vm.modalAppendToBody,
      "append-to-body": _vm.appendToBody,
      top: "10vh",
      "custom-class": "jdf-select-person-dialog"
    },
    on: {
      "update:visible": function updateVisible($event) {
        _vm.dialogVisible = $event;
      }
    }
  }, "el-dialog", _vm.dialogAttrs, false), [_c("div", {
    staticClass: "jdf-select-group mc-group-area"
  }, [_vm.isSearch ? _c("div", {
    staticClass: "mc-search"
  }, [_c("el-input", {
    attrs: {
      size: "middle"
    },
    model: {
      value: _vm.filterText,
      callback: function callback($$v) {
        _vm.filterText = $$v;
      },
      expression: "filterText"
    }
  }, [_c("template", {
    slot: "append"
  }, [_c("el-button", {
    attrs: {
      type: "text"
    },
    on: {
      click: _vm.clickSearch
    }
  }, [_vm._v("搜索")])], 1)], 2)], 1) : _vm._e(), _c("el-row", {
    staticClass: "mc-group-div"
  }, [_c("el-row", {
    staticClass: "mc-row"
  }, [_c("span", [_vm._v("已选数量：" + _vm._s(_vm.choosedNum))])]), _c("div", {
    staticClass: "mc-group-half mc-br"
  }, [_c("div", {
    staticClass: "mc-title-text"
  }, [_c("span", [_vm._v(_vm._s(_vm.leftTitle))]), _vm.isCheckedAll ? _c("a", {
    staticClass: "mc-link",
    attrs: {
      href: "javascript:;"
    },
    on: {
      click: _vm.checkedAll
    }
  }, [_vm._v("全选")]) : _vm._e()]), _c("el-tree", {
    directives: [{
      name: "loading",
      rawName: "v-loading",
      value: _vm.loading,
      expression: "loading"
    }],
    ref: "tree",
    staticClass: "mc-tree",
    attrs: {
      props: _vm.props,
      data: _vm.datas,
      "node-key": _vm.nodeKey,
      "show-checkbox": _vm.showCheckbox,
      "highlight-current": _vm.highlightCurrent,
      "check-on-click-node": true,
      "filter-node-method": _vm.filterNode,
      "default-expand-all": _vm.expandAll,
      "default-expanded-keys": _vm.defaultExpandedKeys
    },
    on: {
      "check-change": _vm.checkChange,
      "node-click": _vm.handleNodeClick
    }
  })], 1), _c("div", {
    staticClass: "mc-group-half"
  }, [_c("div", {
    staticClass: "mc-title-text"
  }, [_c("span", [_vm._v(_vm._s(_vm.rightTitle))]), !_vm.isSingleChoice ? _c("a", {
    staticClass: "mc-link",
    attrs: {
      href: "javascript:;"
    },
    on: {
      click: _vm.clearAll
    }
  }, [_vm._v("清空")]) : _vm._e()]), _c("div", {
    staticClass: "mc-tree-list"
  }, _vm._l(_vm.chooseList, function (item, index) {
    return _c("div", {
      key: index,
      staticClass: "mc-tree-list-item",
      on: {
        click: function click($event) {
          return _vm.removeItem(index, item);
        }
      }
    }, [_vm._v("\n            " + _vm._s(item.name) + "\n          ")]);
  }), 0)])], 1)], 1), _c("div", {
    staticClass: "dialog-footer",
    attrs: {
      slot: "footer"
    },
    slot: "footer"
  }, [_c("el-button", {
    attrs: {
      type: "primary"
    },
    on: {
      click: _vm.confirm
    }
  }, [_vm._v("确定")]), _c("el-button", {
    on: {
      click: _vm.hideDialog
    }
  }, [_vm._v("取消")])], 1)]) : _vm._e();
};
var staticRenderFns = [];
render._withStripped = true;

;// CONCATENATED MODULE: ./packages/select-group/src/main.vue?vue&type=template&id=c48798d6&

;// CONCATENATED MODULE: external "@babel/runtime/helpers/defineProperty"
var defineProperty_namespaceObject = require("@babel/runtime/helpers/defineProperty");
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty_namespaceObject);
;// CONCATENATED MODULE: external "@babel/runtime/helpers/toConsumableArray"
var toConsumableArray_namespaceObject = require("@babel/runtime/helpers/toConsumableArray");
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray_namespaceObject);
;// CONCATENATED MODULE: external "@babel/runtime/helpers/asyncToGenerator"
var asyncToGenerator_namespaceObject = require("@babel/runtime/helpers/asyncToGenerator");
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator_namespaceObject);
;// CONCATENATED MODULE: external "@babel/runtime/regenerator"
var regenerator_namespaceObject = require("@babel/runtime/regenerator");
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator_namespaceObject);
;// CONCATENATED MODULE: external "lodash/map"
var map_namespaceObject = require("lodash/map");
var map_default = /*#__PURE__*/__webpack_require__.n(map_namespaceObject);
;// CONCATENATED MODULE: external "lodash/uniqBy"
var uniqBy_namespaceObject = require("lodash/uniqBy");
var uniqBy_default = /*#__PURE__*/__webpack_require__.n(uniqBy_namespaceObject);
;// CONCATENATED MODULE: external "lodash/isEmpty"
var isEmpty_namespaceObject = require("lodash/isEmpty");
var isEmpty_default = /*#__PURE__*/__webpack_require__.n(isEmpty_namespaceObject);
;// CONCATENATED MODULE: external "jdf-jssdk"
var external_jdf_jssdk_namespaceObject = require("jdf-jssdk");
;// CONCATENATED MODULE: ./src/utils/tools/getOrgLevel.js
/*
 * @Author: lirl
 * @Date: 2023-02-26 20:35:22
 * @Description: 获取组织的等级
 */
function getOrgLevel(orgPath) {
  var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '/';
  return orgPath ? orgPath.split(separator).length : 0;
}
;// CONCATENATED MODULE: external "globalthis/implementation"
var implementation_namespaceObject = require("globalthis/implementation");
;// CONCATENATED MODULE: external "element-ui"
var external_element_ui_namespaceObject = require("element-ui");
;// CONCATENATED MODULE: external "lodash/isString"
var isString_namespaceObject = require("lodash/isString");
var isString_default = /*#__PURE__*/__webpack_require__.n(isString_namespaceObject);
;// CONCATENATED MODULE: ./src/utils/message.js


/*
 * @Author: lirl
 * @Date: 2020-06-03 15:09:21
 * @LastEditTime: 2023-03-02 14:10:57
 * @Description: 消息提示
 */
// 信息提示框




var TOKEN_CODES = ['B004-000-10', 'B004-000-11', 'B004-000-09'];

/**
 * 消息提示框.
 * @param {String} text 消息提示文字
 * @param {String} type success/warning/info/error,默认为success
 */
var message = function message(text) {
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'success';
  var duration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2000;
  var showClose = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  var className = type === 'success' ? 'pj-common-message' : 'pj-ui-validate';
  return Message({
    message: text,
    type: type,
    offset: 300,
    dangerouslyUseHTMLString: false,
    duration: duration,
    showClose: showClose,
    customClass: className
  });
};

/**
 * 弹出提示框.
 * @param {String} content 提示内容
 * @param {String} type 提示类型 success / info / warning / error
 * @param {Boolean} center 是否居中显示
 */
var messageAlert = function messageAlert(content) {
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'success';
  var center = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  return external_element_ui_namespaceObject.MessageBox.alert(content, '提示', {
    confirmButtonText: '确定',
    type: type,
    dangerouslyUseHTMLString: false,
    center: center
  });
};

/**
 * 弹出确认框.
 * @param {String} content 提示内容
 * @param {Function} yes 点击确定按钮的回调
 * @param {Function} cancel 点击取消按钮的回调
 * @returns Promise 调用方式： mmessageConfirm("提示信息", () => {
 *  alert('确定');
 * }, () => {
 *  alert('取消');
 * })
 */
var messageConfirm = /*#__PURE__*/(/* unused pure expression or super */ null && (function () {
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(content, yes, cancel) {
    var title,
      _args = arguments;
    return _regeneratorRuntime.wrap(function _callee$(_context) {
      while (1) switch (_context.prev = _context.next) {
        case 0:
          title = _args.length > 3 && _args[3] !== undefined ? _args[3] : '温馨提示';
          _context.prev = 1;
          _context.next = 4;
          return MessageBox.confirm(content, title, {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            cancelButtonClass: 'fr ml10',
            confirmButtonClass: 'fr',
            type: 'warning',
            lockScroll: false,
            dangerouslyUseHTMLString: false,
            iconClass: 'el-icon-question orange'
          });
        case 4:
          return _context.abrupt("return", yes === null || yes === void 0 ? void 0 : yes());
        case 7:
          _context.prev = 7;
          _context.t0 = _context["catch"](1);
          cancel === null || cancel === void 0 ? void 0 : cancel();
          return _context.abrupt("return", false);
        case 11:
        case "end":
          return _context.stop();
      }
    }, _callee, null, [[1, 7]]);
  }));
  return function messageConfirm(_x, _x2, _x3) {
    return _ref.apply(this, arguments);
  };
}()));
var showErrorMsg = function showErrorMsg(error, customClass) {
  var msg = isString(error) ? error : error === null || error === void 0 ? void 0 : error.message;
  msg && Message({
    message: msg,
    type: 'warning',
    offset: 300,
    dangerouslyUseHTMLString: false,
    duration: 3000,
    showClose: true,
    customClass: customClass
  });
};

/**
 * 弹出接口错误信息
 */
var alertErrorMsg = function alertErrorMsg(error) {
  if (!error) {
    return;
  }
  if (isString_default()(error)) {
    messageAlert(error, 'warning');
    return;
  }
  var ssoPage = sessionStorage.getItem('ssoPage');
  if (TOKEN_CODES.includes(error.code) && ssoPage) {
    implementation_namespaceObject.window.open(decodeURIComponent(ssoPage), '_self');
  } else {
    var msg = error === null || error === void 0 ? void 0 : error.message;
    msg && messageAlert(msg, 'warning');
  }
};
var showSubmitPrompt = /*#__PURE__*/(/* unused pure expression or super */ null && (function () {
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(msg, wordLimit, isRequired, yesCallback, cancelCallback) {
    var inputWordLimit, _yield$MessageBox$pro, value;
    return _regeneratorRuntime.wrap(function _callee2$(_context2) {
      while (1) switch (_context2.prev = _context2.next) {
        case 0:
          _context2.prev = 0;
          inputWordLimit = wordLimit !== null && wordLimit !== void 0 ? wordLimit : 200;
          _context2.next = 4;
          return MessageBox.prompt(msg, '流程提交', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            cancelButtonClass: 'fr ml10',
            confirmButtonClass: 'fr',
            inputValidator: function inputValidator(v) {
              if (isRequired && isEmptyStr(v)) {
                return '请填写意见';
              }
              if ((v === null || v === void 0 ? void 0 : v.length) > inputWordLimit) {
                return "\u8BF7\u6700\u591A\u8F93\u5165".concat(inputWordLimit, "\u5B57");
              }
              return true;
            },
            inputErrorMessage: '请填写意见',
            closeOnClickModal: false,
            inputType: 'textarea',
            inputPlaceholder: "\u8BF7\u586B\u5199\u610F\u89C1\uFF0C\u6700\u591A".concat(inputWordLimit, "\u5B57")
          });
        case 4:
          _yield$MessageBox$pro = _context2.sent;
          value = _yield$MessageBox$pro.value;
          yesCallback === null || yesCallback === void 0 ? void 0 : yesCallback(value);
          _context2.next = 12;
          break;
        case 9:
          _context2.prev = 9;
          _context2.t0 = _context2["catch"](0);
          cancelCallback === null || cancelCallback === void 0 ? void 0 : cancelCallback();
        case 12:
        case "end":
          return _context2.stop();
      }
    }, _callee2, null, [[0, 9]]);
  }));
  return function showSubmitPrompt(_x4, _x5, _x6, _x7, _x8) {
    return _ref2.apply(this, arguments);
  };
}()));
;// CONCATENATED MODULE: external "xregexp"
var external_xregexp_namespaceObject = require("xregexp");
var external_xregexp_default = /*#__PURE__*/__webpack_require__.n(external_xregexp_namespaceObject);
;// CONCATENATED MODULE: ./src/directives/el-drag-dialog/drag.js
/*
 * @Author: lirl
 * @Date: 2020-08-03 10:31:13
 * @LastEditTime: 2022-12-07 14:35:00
 * @Description: dialog拖动
 */



/** 宽度高度为百分比 */
var PERSENT_WH = external_xregexp_default()('%', 'g');
/** 宽度高度为像素 */
var PIXEL_WH = external_xregexp_default()('px', 'g');
/* harmony default export */ var drag = ({
  bind: function bind(el, binding, vnode) {
    // 自定义属性，判断是否可拖拽
    if (!binding.value) return;
    var dialogHeaderEl = el.querySelector('.el-dialog__header');
    var dragDom = el.querySelector('.el-dialog');
    dialogHeaderEl.style.cssText += ';cursor:move;';
    dragDom.style.cssText += ';top:0px;';

    // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
    var getStyle = function () {
      if (implementation_namespaceObject.window.document.currentStyle) {
        return function (dom, attr) {
          return dom.currentStyle[attr];
        };
      }
      return function (dom, attr) {
        return getComputedStyle(dom, false)[attr];
      };
    }();
    dialogHeaderEl.onmousedown = function (e) {
      // 鼠标按下，计算当前元素距离可视区的距离
      var disX = e.clientX - dialogHeaderEl.offsetLeft;
      var disY = e.clientY - dialogHeaderEl.offsetTop;
      var dragDomWidth = dragDom.offsetWidth;
      var dragDomheight = dragDom.offsetHeight;
      var screenWidth = implementation_namespaceObject.document.body.clientWidth;
      var screenHeight = implementation_namespaceObject.document.body.clientHeight;
      var minDragDomLeft = dragDom.offsetLeft + dragDomWidth * 0.7;
      var maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth * 0.3;
      var minDragDomTop = dragDom.offsetTop;
      var maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomheight * 0.3;

      // 获取到的值带px 正则匹配替换
      var styL = getStyle(dragDom, 'left');
      var styT = getStyle(dragDom, 'top');
      if (styL.includes('%')) {
        styL = +implementation_namespaceObject.document.body.clientWidth * (+external_xregexp_default().replace(styL, PERSENT_WH, '') / 100);
        styT = +implementation_namespaceObject.document.body.clientHeight * (+external_xregexp_default().replace(styT, PERSENT_WH, '') / 100);
      } else {
        styL = +external_xregexp_default().replace(styL, PIXEL_WH, '');
        styT = +external_xregexp_default().replace(styT, PIXEL_WH, '');
      }
      implementation_namespaceObject.document.onmousemove = function (evt) {
        // 通过事件委托，计算移动的距离
        var left = evt.clientX - disX;
        var top = evt.clientY - disY;

        // 边界处理
        if (-left > minDragDomLeft) {
          left = -minDragDomLeft;
        } else if (left > maxDragDomLeft) {
          left = maxDragDomLeft;
        }
        if (-top > minDragDomTop) {
          top = -minDragDomTop;
        } else if (top > maxDragDomTop) {
          top = maxDragDomTop;
        }

        // 移动当前元素
        dragDom.style.cssText += ";left:".concat(left + styL, "px;top:").concat(top + styT, "px;");

        // emit onDrag event
        vnode.child.$emit('dragDialog');
      };
      implementation_namespaceObject.document.onmouseup = function () {
        implementation_namespaceObject.document.onmousemove = null;
        implementation_namespaceObject.document.onmouseup = null;
      };
    };
  }
});
;// CONCATENATED MODULE: ./src/directives/el-drag-dialog/index.js


var install = function install(Vue) {
  Vue.directive('el-drag-dialog', drag);
};
if (implementation_namespaceObject.window.Vue) {
  implementation_namespaceObject.window['el-drag-dialog'] = drag;
  implementation_namespaceObject.window.Vue.use(install);
}
drag.install = install;
/* harmony default export */ var el_drag_dialog = (drag);
;// CONCATENATED MODULE: ./src/mixins/dialogAttrs.js

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { defineProperty_default()(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
/* eslint-disable no-undef */
/* eslint-disable no-param-reassign */
/*
 * @Author: lirl
 * @Date: 2023-02-02 19:37:40
 * @Description: file content
 */
/* harmony default export */ var dialogAttrs = ({
  data: function data() {
    var _this$$JDF = this.$JDF,
      dialogAttrs = _this$$JDF.dialogAttrs,
      lockScroll = _this$$JDF.lockScroll;
    return {
      // el-dialog属性，closeOnClickModal需要设为false，这样才可以向遮罩层添加关闭弹窗事件
      dialogAttrs: dialogAttrs ? _objectSpread(_objectSpread({}, dialogAttrs), {}, {
        closeOnClickModal: false
      }) : {
        appendToBody: true,
        lockScroll: lockScroll !== null && lockScroll !== void 0 ? lockScroll : false,
        closeOnClickModal: false,
        closeOnPressEscape: false,
        customClass: 'jdf-common-dialog'
      },
      // 当前为拖动鼠标还是点击鼠标
      isMove: false
    };
  },
  methods: {
    /**
     * 添加关闭弹窗事件，鼠标拖动到遮罩时不关闭弹窗，鼠标点击到遮罩时关闭弹窗
     */
    addCloseDialogEvent: function addCloseDialogEvent(dialogRef) {
      var _this = this;
      this.$nextTick(function () {
        var isMove = _this.isMove;
        var dialogEles = document.querySelectorAll('.el-dialog__wrapper');
        var handleMousemove = function handleMousemove() {
          isMove = true;
        };
        dialogEles === null || dialogEles === void 0 ? void 0 : dialogEles.forEach(function (ele) {
          if (ele) {
            ele.onclick = function (event) {
              if (!isMove && event.target === ele) {
                var dialogName = dialogRef || 'elDialog';
                _this.$refs[dialogName].handleClose();
              }
            };
            ele.onmousedown = function () {
              isMove = false;
              window.addEventListener('mousemove', handleMousemove);
            };
            ele.onmouseup = function () {
              return window.removeEventListener('mousemove', handleMousemove);
            };
          }
        });
      });
    }
  }
});
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/select-group/src/main.vue?vue&type=script&lang=js&



function mainvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function mainvue_type_script_lang_js_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? mainvue_type_script_lang_js_ownKeys(Object(source), !0).forEach(function (key) { defineProperty_default()(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : mainvue_type_script_lang_js_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

// 选人组件








/* harmony default export */ var mainvue_type_script_lang_js_ = ({
  name: 'JdfSelectGroup',
  directives: {
    elDragDialog: el_drag_dialog
  },
  mixins: [dialogAttrs],
  props: {
    // 自定义数据
    data: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    // dialog是否展示
    visible: {
      type: Boolean,
      default: false
    },
    // 群组编码
    groupCode: {
      type: String,
      default: ''
    },
    // 要去除的身份id数组
    identities: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    // JSON串,用于动态参数条件过滤,如配置检索条件为人员姓名,具体需要提交哪些配置可通过接口查询.
    groupJson: {
      type: String,
      default: null
    },
    // 选择的节点类型-OrgResultTypeEnum.ORG选组织，OrgResultTypeEnum.IDENTITY-选人
    type: {
      type: String,
      default: external_jdf_jssdk_namespaceObject.OrgResultTypeEnum.IDENTITY
    },
    // 已选择
    selectedDatas: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    // 身份id
    identityId: String,
    // dialog标题
    dialogTitle: {
      type: String,
      default: '选择人员'
    },
    // 是否开启搜索功能
    isSearch: {
      type: Boolean,
      default: true
    },
    // 是否单选
    isSingleChoice: {
      type: Boolean,
      default: false
    },
    // 遮罩层是否插入至 body 元素上，若为 false，则遮罩层会插入至 Dialog 的父元素上
    modalAppendToBody: {
      type: Boolean,
      default: true
    },
    // Dialog 自身是否插入至 body 元素上。嵌套的 Dialog 必须指定该属性并赋值为 true
    appendToBody: {
      type: Boolean,
      default: false
    },
    // 高亮选中的行
    highlightCurrent: {
      type: Boolean,
      default: true
    },
    // 左侧标题
    leftTitle: {
      type: String,
      default: '选择'
    },
    // 右侧标题
    rightTitle: {
      type: String,
      default: '已选择'
    },
    // 是否显示复选框
    showCheckbox: {
      type: Boolean,
      default: false
    },
    // 是否默认展开所有节点
    expandAll: {
      type: Boolean,
      default: false
    },
    // 是否默认展开第一级
    expandFirstLevel: {
      type: Boolean,
      default: true
    },
    // 自定义渲染函数
    render: {
      type: Function,
      default: function _default() {
        return function () {};
      }
    },
    // 根据节点的哪个字段进行人员的筛选、去重
    nodeKey: {
      type: String,
      default: 'id'
    },
    // 是否可以全选
    isCheckedAll: {
      type: Boolean,
      default: false
    },
    // 可以选择的层级 - 默认99，表示只能选择叶子节点
    clickLevel: {
      type: Number,
      default: 99
    },
    // 是否使用组件自带的确认事件
    useBuiltInComponentsConfirmFunc: {
      type: Boolean,
      default: true
    },
    // 确定按钮事件
    customConfirmFunc: {
      type: Function,
      default: function _default() {
        return function () {};
      }
    },
    // 是否点击搜索按钮进行搜索
    isClickSearch: {
      type: Boolean,
      default: false
    },
    // 是否需要扩展参数
    isExtend: {
      type: Boolean,
      default: false
    },
    // 是否开启拖拽
    isDrag: {
      type: Boolean,
      default: false
    }
  },
  data: function data() {
    return {
      loading: false,
      // 候选数据
      datas: [],
      dialogVisible: false,
      // tree的属性
      props: {
        label: 'name',
        children: 'children',
        isLeaf: 'isLeaf'
      },
      // 已选
      chooseList: [],
      // 查询字段
      filterText: '',
      // 默认展开的节点
      defaultExpandedKeys: [],
      lockScroll: this.$JDF.lockScroll
    };
  },
  watch: {
    // 监听dialog显示隐藏
    dialogVisible: function dialogVisible(value) {
      // 如果dialogVisible为隐藏，则修改传入的visible为false
      !value && this.$emit('update:visible', false);
    },
    // 监听传入的visible
    visible: function visible(value) {
      this.dialogVisible = value;
      value && this.show();
    },
    // 监听待办人搜索框
    filterText: function filterText(val) {
      !this.isClickSearch && this.$refs.tree.filter(val);
    }
  },
  computed: {
    // 请求接口
    service: function service() {
      return new external_jdf_jssdk_namespaceObject.GroupService(this.$JDF.baseUrl);
    },
    // 已选数量
    choosedNum: function choosedNum() {
      return this.chooseList.length;
    },
    // 只能选叶子节点
    onlyCheckLeaf: function onlyCheckLeaf() {
      return this.clickLevel === 99;
    }
  },
  methods: {
    /**
     * 显示dialog
     */
    show: function show() {
      this.getTree();
      // 添加关闭弹窗事件
      this.addCloseDialogEvent();
    },
    /**
     * 展示tree
     */
    getTree: function getTree() {
      var _this = this;
      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee() {
        return regenerator_default().wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              _this.loading = true;
              // 已选数据
              _this.chooseList = toConsumableArray_default()(_this.selectedDatas);
              _context.prev = 2;
              _context.next = 5;
              return _this.getDatas();
            case 5:
              // 设置默认展开的节点
              if (!_this.expandAll && _this.expandFirstLevel) {
                _this.defaultExpandedKeys = map_default()(_this.datas.filter(function (t) {
                  return t.type === external_jdf_jssdk_namespaceObject.OrgResultTypeEnum.ORG;
                }), function (v) {
                  return v.id;
                });
              }
              if (_this.showCheckbox) {
                _this.$refs.tree.setCheckedKeys(map_default()(_this.selectedDatas, _this.nodeKey));
              }
              _context.next = 12;
              break;
            case 9:
              _context.prev = 9;
              _context.t0 = _context["catch"](2);
              alertErrorMsg(_context.t0);
            case 12:
              _context.prev = 12;
              _this.loading = false;
              return _context.finish(12);
            case 15:
            case "end":
              return _context.stop();
          }
        }, _callee, null, [[2, 9, 12, 15]]);
      }))();
    },
    /**
     * 获取要展示的数据
     */
    getDatas: function getDatas() {
      var _this2 = this;
      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee2() {
        var list, fun, res;
        return regenerator_default().wrap(function _callee2$(_context2) {
          while (1) switch (_context2.prev = _context2.next) {
            case 0:
              if (isEmpty_default()(_this2.data)) {
                _context2.next = 4;
                break;
              }
              list = _this2.data;
              _context2.next = 13;
              break;
            case 4:
              if (!_this2.groupCode) {
                _context2.next = 12;
                break;
              }
              // 请求接口获取数据
              fun = _this2.isExtend ? 'getIdentityTree' : 'getSimpleIdentityTree';
              _context2.next = 8;
              return _this2.service[fun]({
                groupCode: _this2.groupCode,
                identityId: _this2.identityId,
                groupJson: _this2.groupJson,
                identities: _this2.identities
              });
            case 8:
              res = _context2.sent;
              list = [res];
              _context2.next = 13;
              break;
            case 12:
              list = [];
            case 13:
              // 如果是选组织，则把叶子节点设置为组织，并将用户信息放到组织的user字段中
              if (_this2.type === external_jdf_jssdk_namespaceObject.OrgResultTypeEnum.ORG) {
                _this2.datas = isEmpty_default()(list) ? [] : _this2.setLeafNode(list);
              } else {
                _this2.datas = list;
              }
            case 14:
            case "end":
              return _context2.stop();
          }
        }, _callee2);
      }))();
    },
    /**
     * 点击搜索按钮进行搜索
     */
    clickSearch: function clickSearch() {
      this.clickSearch && this.$refs.tree.filter(this.filterText);
    },
    /**
     * 处理当叶子节点为人员，但是需要选组织的情况，在该情况下选择组织，并将组织下的人员返回
     * 1. 如果是叶子节点，则不做操作
     * 2. 如果不是叶子节点，判断该节点的children的数据是否为人员数据，
     *    如果是人员数据则将children放到节点的users字段中,并且将children字段置为空
     */
    setLeafNode: function setLeafNode(array) {
      var _this3 = this;
      return array.map(function (item) {
        if (item.isLeaf) {
          return item;
        }
        var node = mainvue_type_script_lang_js_objectSpread({}, item);
        var children = node.children;
        var childrenData = children.filter(function (it) {
          return it.type === external_jdf_jssdk_namespaceObject.OrgResultTypeEnum.ORG;
        });
        if (childrenData.length > 0) {
          node.children = _this3.setLeafNode(childrenData);
        } else {
          node.users = children;
          node.children = [];
          node.isLeaf = true;
        }
        return node;
      });
    },
    /**
     * 向已选数组中添加数据, 如果为多选，则根据传入的nodeKey作去重处理
     * @param {Object} 选择的节点的数据
     */
    setData: function setData(data) {
      this.chooseList = this.isSingleChoice ? [data] : uniqBy_default()([].concat(toConsumableArray_default()(this.chooseList), [data]), this.nodeKey);
    },
    /**
     * 从已选数组中删除数据
     * @param {Object} 取消选择的节点的数据
     */
    removeData: function removeData(data) {
      var _this4 = this;
      // 从数组中删除item[nodeKey] === data[nodeKey]的数据
      this.chooseList = this.chooseList.filter(function (item) {
        return item[_this4.nodeKey] !== data[_this4.nodeKey];
      });
    },
    /**
     * 复选框变化时调用
     * @param {Object} data 选择的节点的数据
     * @param {Boolean} checked 节点本身是否被选中
     */
    checkChange: function checkChange(data, checked) {
      // 如果不显示复选框 或者不是叶子节点，则不做操作
      if (!this.showCheckbox) {
        return;
      }
      // clickLevel = 0，即只能选叶子节点；否则当组织层级 >= clickLevel时，都能选中
      if (this.onlyCheckLeaf && data.isLeaf || getOrgLevel(data.orgDeepId) >= this.clickLevel) {
        // 如果是选中状态并且是单选并且显示checkbox，则设置选中的节点为当前节点
        checked && this.isSingleChoice && this.$refs.tree.setCheckedKeys([data[this.nodeKey]]);
        // 如果选中则添加数据，否则删除数据
        (checked ? this.setData : this.removeData)(data);
      }
    },
    /**
     * 搜索待办选人树
     * @param {String} value 搜索的字段
     * @param {Object} data
     */
    filterNode: function filterNode(value, data) {
      // 按照名称和code过滤，只过滤叶子节点
      if (!value) {
        return true;
      }
      if (this.onlyCheckLeaf && data.isLeaf || getOrgLevel(data.orgPath) >= this.clickLevel) {
        var _data$name, _data$code;
        return ((_data$name = data.name) === null || _data$name === void 0 ? void 0 : _data$name.includes(value)) || ((_data$code = data.code) === null || _data$code === void 0 ? void 0 : _data$code.includes(value));
      }
      return false;
    },
    /**
     * 删除已选数据, 只当不显示复选框时生效
     * @param {Number} index 要删除的数据的index
     * @param {String} item 要删除的数据
     */
    removeItem: function removeItem(index) {
      this.chooseList.splice(index, 1);
      if (this.showCheckbox) {
        this.$refs.tree.setCheckedKeys(map_default()(this.chooseList, this.nodeKey));
      }
    },
    /**
     * 点击树节点的操作, 只当不显示复选框时生效
     */
    handleNodeClick: function handleNodeClick(data) {
      // 当为复杂树结构时
      var level = this.isExtend && this.type === external_jdf_jssdk_namespaceObject.OrgResultTypeEnum.ORG ? getOrgLevel(data.orgObj.orgDeepId) : getOrgLevel(data.orgDeepId);
      // clickLevel = 0，即只能选叶子节点；否则当组织层级 >= clickLevel时，都能选中
      if (this.onlyCheckLeaf && data.isLeaf || level >= this.clickLevel) {
        this.setData(data);
      }
    },
    /**
     * 点击取消按钮
     */
    hideDialog: function hideDialog() {
      this.dialogVisible = false;
      this.chooseList = [];
    },
    /**
     * 点击确定按钮
     */
    confirm: function confirm() {
      if (this.useBuiltInComponentsConfirmFunc) {
        this.dialogVisible = false;
        this.$emit('confirm', this.chooseList);
      } else {
        var _this$customConfirmFu;
        (_this$customConfirmFu = this.customConfirmFunc) === null || _this$customConfirmFu === void 0 ? void 0 : _this$customConfirmFu.call(this, this.chooseList);
      }
    },
    /**
     * 清空已选
     */
    clearAll: function clearAll() {
      this.chooseList = [];
      if (this.showCheckbox) {
        this.$refs.tree.setCheckedKeys([]);
      }
    },
    /**
     * 全选，遍历候选树，选中所有叶子节点
     */
    checkedAll: function checkedAll() {
      var checkedAllLeafstatus = function checkedAllLeafstatus(array) {
        var initial = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
        return array.reduce(function (all, value) {
          return value.isLeaf ? [].concat(toConsumableArray_default()(all), [value]) : checkedAllLeafstatus(value.children, all);
        }, initial);
      };
      this.chooseList = checkedAllLeafstatus(this.datas, []);
    }
  }
});
;// CONCATENATED MODULE: ./packages/select-group/src/main.vue?vue&type=script&lang=js&
 /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_); 
;// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
/* globals __VUE_SSR_CONTEXT__ */

// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.

function normalizeComponent(
  scriptExports,
  render,
  staticRenderFns,
  functionalTemplate,
  injectStyles,
  scopeId,
  moduleIdentifier /* server only */,
  shadowMode /* vue-cli only */
) {
  // Vue.extend constructor export interop
  var options =
    typeof scriptExports === 'function' ? scriptExports.options : scriptExports

  // render functions
  if (render) {
    options.render = render
    options.staticRenderFns = staticRenderFns
    options._compiled = true
  }

  // functional template
  if (functionalTemplate) {
    options.functional = true
  }

  // scopedId
  if (scopeId) {
    options._scopeId = 'data-v-' + scopeId
  }

  var hook
  if (moduleIdentifier) {
    // server build
    hook = function (context) {
      // 2.3 injection
      context =
        context || // cached call
        (this.$vnode && this.$vnode.ssrContext) || // stateful
        (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
      // 2.2 with runInNewContext: true
      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
        context = __VUE_SSR_CONTEXT__
      }
      // inject component styles
      if (injectStyles) {
        injectStyles.call(this, context)
      }
      // register component module identifier for async chunk inferrence
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier)
      }
    }
    // used by ssr in case component is cached and beforeCreate
    // never gets called
    options._ssrRegister = hook
  } else if (injectStyles) {
    hook = shadowMode
      ? function () {
          injectStyles.call(
            this,
            (options.functional ? this.parent : this).$root.$options.shadowRoot
          )
        }
      : injectStyles
  }

  if (hook) {
    if (options.functional) {
      // for template-only hot-reload because in that case the render fn doesn't
      // go through the normalizer
      options._injectStyles = hook
      // register for functional component in vue file
      var originalRender = options.render
      options.render = function renderWithStyleInjection(h, context) {
        hook.call(context)
        return originalRender(h, context)
      }
    } else {
      // inject component registration as beforeCreate hook
      var existing = options.beforeCreate
      options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
    }
  }

  return {
    exports: scriptExports,
    options: options
  }
}

;// CONCATENATED MODULE: ./packages/select-group/src/main.vue





/* normalize component */
;
var component = normalizeComponent(
  src_mainvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  null
  
)

/* harmony default export */ var main = (component.exports);
;// CONCATENATED MODULE: ./packages/select-group/index.js
/*
 * @Author: lirl
 * @Date: 2022-04-21 09:32:16
 * @Description: file content
 */

main.install = function (Vue) {
  Vue.component(main.name, main);
};
/* harmony default export */ var select_group = (main);
module.exports = __webpack_exports__;
/******/ })()
;