module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// 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 });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "/dist/";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 292);
/******/ })
/************************************************************************/
/******/ ({

/***/ 1:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
/* 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
  }
}


/***/ }),

/***/ 112:
/***/ (function(module, exports) {

module.exports = require("element-ui-for-gov/lib/tabs");

/***/ }),

/***/ 14:
/***/ (function(module, exports) {

var nestRE = /^(attrs|props|on|nativeOn|class|style|hook)$/

module.exports = function mergeJSXProps (objs) {
  return objs.reduce(function (a, b) {
    var aa, bb, key, nestedKey, temp
    for (key in b) {
      aa = a[key]
      bb = b[key]
      if (aa && nestRE.test(key)) {
        // normalize class
        if (key === 'class') {
          if (typeof aa === 'string') {
            temp = aa
            a[key] = aa = {}
            aa[temp] = true
          }
          if (typeof bb === 'string') {
            temp = bb
            b[key] = bb = {}
            bb[temp] = true
          }
        }
        if (key === 'on' || key === 'nativeOn' || key === 'hook') {
          // merge functions
          for (nestedKey in bb) {
            aa[nestedKey] = mergeFn(aa[nestedKey], bb[nestedKey])
          }
        } else if (Array.isArray(aa)) {
          a[key] = aa.concat(bb)
        } else if (Array.isArray(bb)) {
          a[key] = [aa].concat(bb)
        } else {
          for (nestedKey in bb) {
            aa[nestedKey] = bb[nestedKey]
          }
        }
      } else {
        a[key] = b[key]
      }
    }
    return a
  }, {})
}

function mergeFn (a, b) {
  return function () {
    a && a.apply(this, arguments)
    b && b.apply(this, arguments)
  }
}


/***/ }),

/***/ 292:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXTERNAL MODULE: ./node_modules/babel-helper-vue-jsx-merge-props/index.js
var babel_helper_vue_jsx_merge_props = __webpack_require__(14);
var babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(babel_helper_vue_jsx_merge_props);

// EXTERNAL MODULE: external "element-ui-for-gov/lib/dialog"
var dialog_ = __webpack_require__(41);
var dialog_default = /*#__PURE__*/__webpack_require__.n(dialog_);

// EXTERNAL MODULE: external "element-ui-for-gov/lib/tabs"
var tabs_ = __webpack_require__(112);
var tabs_default = /*#__PURE__*/__webpack_require__.n(tabs_);

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/tabs/src/tab-pane.vue?vue&type=template&id=9145a070&
var tab_panevue_type_template_id_9145a070_render = function() {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  return !_vm.lazy || _vm.loaded || _vm.active
    ? _c(
        "div",
        {
          directives: [
            {
              name: "show",
              rawName: "v-show",
              value: _vm.active,
              expression: "active"
            }
          ],
          staticClass: "el-tab-pane",
          attrs: {
            role: "tabpanel",
            "aria-hidden": !_vm.active,
            id: "pane-" + _vm.paneName,
            "aria-labelledby": "tab-" + _vm.paneName
          }
        },
        [_vm._t("default")],
        2
      )
    : _vm._e()
}
var staticRenderFns = []
tab_panevue_type_template_id_9145a070_render._withStripped = true


// CONCATENATED MODULE: ./packages/tabs/src/tab-pane.vue?vue&type=template&id=9145a070&

// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/tabs/src/tab-pane.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//

/* harmony default export */ var tab_panevue_type_script_lang_js_ = ({
  name: 'ElTabPane',

  componentName: 'ElTabPane',

  props: {
    label: String,
    labelContent: Function,
    name: String,
    closable: Boolean,
    disabled: Boolean,
    lazy: Boolean
  },

  data: function data() {
    return {
      index: null,
      loaded: false
    };
  },


  computed: {
    isClosable: function isClosable() {
      return this.closable || this.$parent.closable;
    },
    active: function active() {
      var active = this.$parent.currentName === (this.name || this.index);
      if (active) {
        this.loaded = true;
      }
      return active;
    },
    paneName: function paneName() {
      return this.name || this.index;
    }
  },

  updated: function updated() {
    this.$parent.$emit('tab-nav-update');
  }
});
// CONCATENATED MODULE: ./packages/tabs/src/tab-pane.vue?vue&type=script&lang=js&
 /* harmony default export */ var src_tab_panevue_type_script_lang_js_ = (tab_panevue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(1);

// CONCATENATED MODULE: ./packages/tabs/src/tab-pane.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  src_tab_panevue_type_script_lang_js_,
  tab_panevue_type_template_id_9145a070_render,
  staticRenderFns,
  false,
  null,
  null,
  null
  
)

/* hot reload */
if (false) { var api; }
component.options.__file = "packages/tabs/src/tab-pane.vue"
/* harmony default export */ var tab_pane = (component.exports);
// EXTERNAL MODULE: external "element-ui-for-gov/lib/button"
var button_ = __webpack_require__(9);
var button_default = /*#__PURE__*/__webpack_require__.n(button_);

// EXTERNAL MODULE: external "element-ui-for-gov/lib/message"
var message_ = __webpack_require__(79);
var message_default = /*#__PURE__*/__webpack_require__.n(message_);

// EXTERNAL MODULE: external "element-ui-for-gov/lib/row"
var row_ = __webpack_require__(42);
var row_default = /*#__PURE__*/__webpack_require__.n(row_);

// EXTERNAL MODULE: external "element-ui-for-gov/lib/col"
var col_ = __webpack_require__(36);
var col_default = /*#__PURE__*/__webpack_require__.n(col_);

// EXTERNAL MODULE: external "element-ui-for-gov/lib/tree"
var tree_ = __webpack_require__(31);
var tree_default = /*#__PURE__*/__webpack_require__.n(tree_);

// EXTERNAL MODULE: external "element-ui-for-gov/lib/utils/tree-store"
var tree_store_ = __webpack_require__(81);
var tree_store_default = /*#__PURE__*/__webpack_require__.n(tree_store_);

// CONCATENATED MODULE: ./packages/user-picker/src/section-header.js
var prefix = 'el-user-picker';

/* harmony default export */ var section_header = ({
  name: 'SectionHeader',
  props: {
    title: {
      type: String
    },
    selectPanelButton: {
      type: Function
    }
  },
  render: function render() {
    var h = arguments[0];
    var title = this.title,
        selectPanelButton = this.selectPanelButton;

    return h(
      'div',
      { 'class': prefix + '__section-header' },
      [title, selectPanelButton ? selectPanelButton() : null]
    );
  }
});
// EXTERNAL MODULE: external "element-ui-for-gov/lib/input"
var input_ = __webpack_require__(8);
var input_default = /*#__PURE__*/__webpack_require__.n(input_);

// CONCATENATED MODULE: ./packages/user-picker/src/selected-list.js






var selected_list_prefix = 'el-user-picker';
/* harmony default export */ var selected_list = ({
  name: 'SelectedList',
  props: {
    label: String,
    checkedUsers: Array,
    renderChecked: Function,
    renderCheckedItem: Function,
    selectPanelButton: Function,
    height: Number
  },
  components: { ElButton: button_default.a, ElInput: input_default.a, SectionHeader: section_header },
  data: function data() {
    return {
      keyword: ''
    };
  },

  methods: {
    uncheckedUser: function uncheckedUser(user) {
      var index = this.checkedUsers.findIndex(function (item) {
        return item === user;
      });
      this.checkedUsers.splice(index, 1);
      this.$emit('unchecked-user');
    }
  },
  computed: {
    sortedUsers: function sortedUsers() {
      var _this = this;

      var filteredUsers = this.checkedUsers.filter(function (item) {
        return _this.keyword ? item[_this.label].indexOf(_this.keyword) > -1 : true;
      });
      if (this.renderChecked && typeof this.renderChecked === 'function') {
        return this.renderChecked(filteredUsers);
      }
      return filteredUsers;
    }
  },

  render: function render() {
    var _this2 = this;

    var h = arguments[0];
    var label = this.label,
        sortedUsers = this.sortedUsers,
        renderCheckedItem = this.renderCheckedItem,
        selectPanelButton = this.selectPanelButton;

    var searchWrapHeight = 64;
    return h(
      'div',
      { 'class': selected_list_prefix + '__section-wrapper' },
      [h(section_header, {
        attrs: { title: '\u5DF2\u9009\u5217\u8868', selectPanelButton: selectPanelButton }
      }), h(
        'div',
        { 'class': 'filter-wrapper' },
        [h(input_default.a, babel_helper_vue_jsx_merge_props_default()([{
          attrs: { value: this.keyword
          }
        }, {
          on: {
            input: function input(value) {
              _this2.keyword = value;
            }
          }
        }, {
          attrs: { prefixIcon: 'sg-icon sg-icon-fangdajing', placeholder: '\u8BF7\u8F93\u5165\u5173\u952E\u8BCD' }
        }]))]
      ), h(
        'div',
        { 'class': selected_list_prefix + '__section-content', style: { height: (this.height ? this.height - searchWrapHeight - 1 : 400) + 'px' } },
        [h(
          'ul',
          { 'class': selected_list_prefix + '__section-list' },
          [sortedUsers.map(function (item) {
            return item._classify && item.list.length ? h(
              'ul',
              { 'class': selected_list_prefix + '__section-list-children' },
              [h(
                'li',
                { 'class': selected_list_prefix + '__section-list-title' },
                [item._classify]
              ), item.list.map(function (item) {
                return h('li', [renderCheckedItem && typeof renderCheckedItem === 'function' ? renderCheckedItem(item) : item[label], h('i', babel_helper_vue_jsx_merge_props_default()([{ 'class': 'el-icon-close' }, { on: { click: _this2.uncheckedUser.bind(_this2, item) } }]))]);
              })]
            ) : item[label] && h('li', [renderCheckedItem && typeof renderCheckedItem === 'function' ? renderCheckedItem(item) : item[label], h('i', babel_helper_vue_jsx_merge_props_default()([{ 'class': 'el-icon-close' }, { on: { click: _this2.uncheckedUser.bind(_this2, item) } }]))]);
          })]
        )]
      )]
    );
  }
});
// CONCATENATED MODULE: ./packages/user-picker/src/transfer.js


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };










var transfer_prefix = 'el-user-picker';
/* harmony default export */ var transfer = ({
  name: 'Transfer',
  inject: ['handleChangeUser', 'clearChecked', 'nodeKey', 'setTreeInstance'],
  props: {
    treeProps: Object,
    fieldNames: Object,
    grid: Object,
    checkedUsers: Array,
    filterNodeMethod: Function,
    defaultChecked: Array,
    renderChecked: Function,
    renderCheckedItem: Function,
    selectPanelButton: Function,
    radio: Boolean,
    isSearchCheckAll: Boolean,
    height: Number,
    checkOnClickNode: Boolean
  },
  components: { ElRow: row_default.a, ElCol: col_default.a, ElButton: button_default.a, ElTree: tree_default.a, SectionHeader: section_header, SelectedList: selected_list },
  data: function data() {
    return {
      treeData: [],
      store: null,
      totalData: [],
      searchData: [],
      prevChecked: [],
      searchWrapHeight: 0
    };
  },
  created: function created() {
    var _this = this;

    var _treeProps = this.treeProps,
        lazy = _treeProps.lazy,
        loadData = _treeProps.loadData,
        children = _treeProps.children,
        disabled = _treeProps.disabled;
    var fieldNames = this.fieldNames;

    this.store = new tree_store_default.a({
      key: this.nodeKey,
      label: function label(data) {
        return data[fieldNames.parent] || data[fieldNames.userName];
      },
      isLeaf: function isLeaf(data) {
        return !!data[fieldNames.userName];
      },
      hideCheckbox: 'hideCheckbox',
      children: children || 'children',
      disabled: disabled || 'disabled',
      data: []
    });
    !lazy ? loadData().then(function (data) {
      _this.store.initData(data);
      _this.treeData = _this.store.data;
      _this.totalData = _this.treeData;
      _this.searchData = _this.treeData;
      _this.setDefaultChecked(_this.defaultChecked);
    }) : this.setDefaultChecked(this.defaultChecked);
  },
  mounted: function mounted() {
    this.setTreeInstance(this.treeProps.key, this);
    this.initFilterResize();
  },


  watch: {
    defaultChecked: function defaultChecked(users) {
      var _this2 = this;

      this.$nextTick(function () {
        _this2.setDefaultChecked(users);
      });
    },
    checkedUsers: function checkedUsers(arr) {
      var _this3 = this;

      var nodes = [];
      arr.forEach(function (item) {
        var cache = _this3.store.getNodes(item);
        nodes = nodes.concat(cache);
      });
      this.prevChecked = [].concat(nodes);
      // console.log('selected nodes: ', nodes);
      this.$nextTick(function () {
        _this3.setCheckedNodes(nodes);
      });
    }
  },
  methods: {
    initFilterResize: function initFilterResize() {
      var _this4 = this;

      var filterWrapper = this.$el.querySelector('.custom-filter-wrapper');
      if (filterWrapper) {
        try {
          var resizeObserver = new ResizeObserver(function (entries) {
            for (var _iterator = entries, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
              var _ref;

              if (_isArray) {
                if (_i >= _iterator.length) break;
                _ref = _iterator[_i++];
              } else {
                _i = _iterator.next();
                if (_i.done) break;
                _ref = _i.value;
              }

              var entry = _ref;

              if (entry.contentRect.height > 0) {
                _this4.searchWrapHeight = filterWrapper.offsetHeight;
              }
            }
          });
          resizeObserver.observe(filterWrapper);
        } catch (e) {
          this.$nextTick(function () {
            _this4.searchWrapHeight = filterWrapper.offsetHeight;
          });
        }
      }
    },
    setDefaultChecked: function setDefaultChecked(keys) {
      var _this5 = this;

      // console.log(ids);
      var users = [];
      keys.forEach(function (user) {
        // console.log(user);
        var nodes = (typeof user === 'undefined' ? 'undefined' : _typeof(user)) === 'object' ? [{ data: user }] : _this5.store.getNodesByKey(user);
        if (nodes.length) {
          users.push(nodes[0].data);
        }
      });
      this.handleChangeUser(users);
    },
    handleCheck: function handleCheck(node, _ref2) {
      var checkedNodes = _ref2.checkedNodes;

      if (this.radio) {
        var users = [];
        if (checkedNodes.includes(node)) {
          users = [node.data];
        }
        this.handleChangeUser(users);
      } else {
        var deleteArr = this.store.difference(this.prevChecked, checkedNodes.filter(function (node) {
          return node.isLeaf;
        }));
        // console.log(deleteArr);
        var _users = checkedNodes.filter(function (node) {
          return node.isLeaf;
        }).map(function (item) {
          return item.data;
        });

        var deleteUsers = deleteArr.filter(function (node) {
          return node.isLeaf;
        }).map(function (item) {
          return item.data;
        });
        this.handleChangeUser(_users, deleteUsers);
      }
    },
    getCheckedNodes: function getCheckedNodes() {
      var nodes = this.$refs['tree'].getCheckedNodes();
      var users = nodes.filter(function (node) {
        return node.isLeaf;
      }).map(function (item) {
        return item.data;
      });
      if (this.radio) {
        if (users && users.length) {
          this.handleChangeUser(users, []);
        }
      } else {
        this.handleChangeUser(users, []);
      }
    },
    checkAll: function checkAll() {
      var _this6 = this;

      console.log('checkAll');
      var checkAllMethod = this.treeProps.checkAllMethod;

      if (checkAllMethod) {
        checkAllMethod(this, function (users) {
          _this6.handleChangeUser(users);
        });
      } else {
        var users = [];
        var traverse = function traverse(arr) {
          arr.forEach(function (item) {
            if (item.isLeaf && !item.disabled) {
              users.push(item.data);
            } else if (item.children) {
              traverse(item.children);
            }
          });
        };
        if (this.isSearchCheckAll) {
          traverse(this.searchData);
        } else {
          traverse(this.totalData);
        }
        this.handleChangeUser(users);
      }
    },
    setCheckedNodes: function setCheckedNodes(nodes) {
      this.$refs['tree'].setCheckedNodes(nodes);
    },
    filter: function filter(value) {
      var _this7 = this;

      var filteredData = [];
      var traverse = function traverse(arr) {
        arr.forEach(function (item) {
          if (_this7.filterNodeMethod(value, item, item)) {
            filteredData.push(item);
          } else if (item.children) {
            traverse(item.children);
          }
        });
      };
      traverse(this.totalData);
      this.searchData = filteredData;
      this.$refs['tree'].filter(value);
    },
    setTreeData: function setTreeData(data) {
      this.store.initData(data, this.treeProps.lazy);
      this.treeData = this.store.data;
      this.searchData = this.store.data;
      this.setDefaultChecked(this.defaultChecked);
    },
    bfsRegisterNode: function bfsRegisterNode(data, current) {
      var _this8 = this;

      var getChildren = function getChildren(node) {
        var children = _this8.treeProps.children || 'children';
        return typeof children === 'function' ? children(node) : node[children];
      };
      var queue = [{ root: true, children: data }];
      var queueNode = [current];
      while (queue.length) {
        var head = queue.shift();
        var parent = queueNode.shift();
        if (Array.isArray(head.children)) {
          for (var i = 0, len = head.children.length; i < len; i++) {
            var node = this.store.registerNode(head.children[i]);
            node.parent = parent;
            parent.children.push(node);
            queue.push(_extends({}, head.children[i], {
              children: getChildren(head.children[i])
            }));
            queueNode.push(node);
          }
        }
      }
    },
    bfsTravel: function bfsTravel(node, cb) {
      var queue = [node];
      while (queue.length) {
        var head = queue.shift();
        cb && cb(head);
        if (Array.isArray(head.children)) {
          for (var i = 0; i < head.children.length; i++) {
            queue.push(head.children[i]);
          }
        }
      }
    },
    loadDataAsync: function loadDataAsync(node, resolve, isCheck) {
      var _this9 = this;

      var loadDataAsync = this.treeProps.loadDataAsync;
      // console.log('load', node);

      loadDataAsync(node.data ? node.data : node, function (data) {
        // console.log(data);
        if (data && data.length > 0) {
          var current = !node.parent ? { children: [] } : node.data;
          _this9.bfsRegisterNode(data, current);
          if (!node.parent) {
            _this9.store.data = current.children;
            _this9.totalData = _this9.store.data;
            _this9.searchData = _this9.store.data;
          }

          if (!isCheck) {
            if (_this9.radio) {
              if (_this9.checkedUsers && _this9.checkedUsers.length && _this9.defaultChecked.length) {
                if (_this9.checkedUsers[0].id && _this9.checkedUsers[0].id === _this9.defaultChecked[0].id) {
                  _this9.setDefaultChecked([_this9.defaultChecked[0]]);
                }
              }
            } else {
              var sList = [];
              _this9.checkedUsers.forEach(function (node) {
                _this9.defaultChecked.forEach(function (nodeD) {
                  if (nodeD.key && nodeD.key === node.key) {
                    sList.push(node);
                  }
                });
              });
              _this9.setDefaultChecked(sList);
            }
          } else {
            var selectList = [];
            _this9.bfsTravel(current, function (node) {
              if (!node.disabled && node.isLeaf) {
                selectList.push(node.key);
              }
            });
            _this9.defaultChecked.forEach(function (item) {
              if (!selectList.includes(item)) {
                selectList.push(item);
              }
            });
            _this9.setDefaultChecked(selectList);
          }
          return resolve(current.children);
        } else {
          return resolve([]);
        }
      }, isCheck);
    }
  },

  render: function render() {
    var h = arguments[0];
    var treeData = this.treeData,
        fieldNames = this.fieldNames,
        treeProps = this.treeProps,
        checkedUsers = this.checkedUsers,
        $slots = this.$slots,
        renderChecked = this.renderChecked,
        renderCheckedItem = this.renderCheckedItem,
        selectPanelButton = this.selectPanelButton,
        height = this.height,
        checkOnClickNode = this.checkOnClickNode;

    return h(row_default.a, [h(
      col_default.a,
      {
        attrs: { span: 10 }
      },
      [h(
        'div',
        { 'class': transfer_prefix + '__section-wrapper' },
        [h(section_header, {
          attrs: { title: '\u5F85\u9009\u5217\u8868' }
        }), $slots.filter && h(
          'div',
          { 'class': 'custom-filter-wrapper' },
          [$slots.filter]
        ), h(
          'div',
          { 'class': transfer_prefix + '__section-content', style: { height: (height ? height - this.searchWrapHeight - 1 : 464 - this.searchWrapHeight) + 'px' } },
          [h(tree_default.a, babel_helper_vue_jsx_merge_props_default()([{ ref: 'tree',
            attrs: { lazy: treeProps.lazy,
              data: treeData,
              nodeKey: 'id',
              load: this.loadDataAsync,
              props: {
                hideCheckbox: 'hideCheckbox',
                isLeaf: function isLeaf(item) {
                  return item.isLeaf;
                }
              },
              'show-checkbox': true,
              checkOnClickNode: checkOnClickNode,
              'expand-on-check': treeProps.lazy,
              filterNodeMethod: this.filterNodeMethod
            }
          }, {
            on: {
              // 'check-change': treeProps.lazy ? this.handleCheckChange : this.getCheckedNodes,
              'node-expand': treeProps.lazy ? this.getCheckedNodes : function () {},
              'check': this.handleCheck
            }
          }]))]
        )]
      )]
    ), h(
      col_default.a,
      {
        attrs: { span: 4 },
        'class': transfer_prefix + '__section-btns' },
      [!this.radio && h(
        button_default.a,
        { on: { click: this.checkAll } },
        ['\u5168\u9009', h('i', { 'class': 'el-icon-arrow-right' })]
      ), h('br'), h(
        button_default.a,
        { on: { click: this.clearChecked } },
        ['\u6E05\u7A7A\u5DF2\u9009']
      )]
    ), h(
      col_default.a,
      {
        attrs: { span: 10 }
      },
      [h(selected_list, {
        attrs: { height: this.height, checkedUsers: checkedUsers, label: fieldNames.userName, renderChecked: renderChecked, renderCheckedItem: renderCheckedItem, selectPanelButton: selectPanelButton }
      })]
    )]);
  }
});
// CONCATENATED MODULE: ./packages/user-picker/src/picker-panel.js


/* harmony default export */ var picker_panel = ({
  name: 'PickerPanel',
  components: { Transfer: transfer },
  props: {
    defaultChecked: Array,
    treeProps: Object,
    checkedUsers: Array,
    renderChecked: Function,
    renderCheckedItem: Function,
    selectPanelButton: Function,
    radio: Boolean,
    isSearchCheckAll: Boolean,
    height: Number,
    checkOnClickNode: Boolean
  },

  render: function render() {
    var h = arguments[0];
    var _treeProps = this.treeProps,
        parentName = _treeProps.parentName,
        userName = _treeProps.userName,
        renderFilter = _treeProps.renderFilter,
        filterNodeMethod = _treeProps.filterNodeMethod;

    return h(
      transfer,
      { ref: 'tree',
        'class': this.radio ? 'radio' : '',
        attrs: { fieldNames: {
            parent: parentName,
            userName: userName
          },
          height: this.height,
          treeProps: this.treeProps,
          filterNodeMethod: filterNodeMethod,
          defaultChecked: this.defaultChecked,
          checkedUsers: this.checkedUsers,
          renderChecked: this.renderChecked,
          renderCheckedItem: this.renderCheckedItem,
          selectPanelButton: this.selectPanelButton,
          radio: this.radio,
          isSearchCheckAll: this.isSearchCheckAll,
          checkOnClickNode: this.checkOnClickNode
        }
      },
      [h(
        'template',
        { slot: 'filter' },
        [renderFilter && renderFilter(this.$refs['tree'])]
      )]
    );
  }
});
// CONCATENATED MODULE: ./packages/user-picker/src/user-picker.js


var user_picker_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };









/* harmony default export */ var user_picker = ({
  name: 'UserPicker',
  components: { ElDialog: dialog_default.a, ElTabs: tabs_default.a, ElTabPane: tab_pane, ElButton: button_default.a, PickerPanel: picker_panel },
  props: {
    title: {
      type: String,
      default: '选择人员'
    },
    visible: {
      type: Boolean
    },
    required: {
      type: Boolean,
      default: true
    },

    requiredTips: {
      type: String,
      default: '请选择人员'
    },

    userUniqueId: { type: String, default: 'id' },

    defaultChecked: {
      type: Array,
      default: function _default() {
        return [];
      }
    },

    tabs: {
      type: Array,
      default: function _default() {
        return [];
      }
    },

    confirmText: {
      type: String,
      default: '确定'
    },

    cancelText: {
      type: String,
      default: '取消'
    },
    renderChecked: {
      type: Function
    },
    renderCheckedItem: {
      type: Function
    },
    selectPanelButton: {
      type: Function
    },
    radio: {
      type: Boolean,
      default: false
    },
    isSearchCheckAll: {
      type: Boolean,
      default: true
    },
    dialogProps: {
      type: Object,
      default: function _default() {}
    },
    poppable: {
      type: Boolean,
      default: true
    },
    loading: Boolean,
    height: String,
    checkOnClickNode: {
      type: Boolean,
      default: false
    }
  },

  data: function data() {
    return {
      checkedUsers: [],
      defaultCheckUsers: [],
      treeInstances: {},
      currTabsVal: this.tabs[0] ? this.tabs[0].key : '0'
    };
  },
  provide: function provide() {
    return {
      handleChangeUser: this.handleChangeUser,
      clearChecked: this.clearChecked,
      nodeKey: this.userUniqueId,
      setTreeInstance: this.setTreeInstance
    };
  },


  watch: {
    visible: {
      handler: function handler(val) {
        if (val) {
          this.defaultCheckUsers = this.defaultChecked.slice();
        }
      },

      immediate: true
    },
    defaultChecked: {
      handler: function handler() {
        if (!this.poppable) {
          this.defaultCheckUsers = this.defaultChecked.slice();
        }
      },

      immediate: true
    },
    checkedUsers: {
      handler: function handler(val) {
        // console.log('watch-checkedUsers', val);
        this.$emit('changeUser', val);
      },

      immediate: true
    },
    tabs: function tabs(val, old) {
      if (old.length === 0 && val.length > 0) {
        if (val[0]) this.currTabsVal = val[0].key;
      }
    }
  },

  methods: {
    getTreeInstance: function getTreeInstance() {
      return this.treeInstances;
    },
    setTreeInstance: function setTreeInstance(key, $tree) {
      // console.log('setTreeInstance', key);
      this.treeInstances[key] = $tree;
      this.$emit('mounted-tree', { key: key, $tree: $tree });
    },
    handleChangeUser: function handleChangeUser(users) {
      var _this = this;

      var deleteUsers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];

      if (this.radio) {
        this.checkedUsers = users;
      } else {
        var arr = [];
        var unique = {};
        // console.log('handleChangeUser-this.checkedUsers', this.checkedUsers);
        this.checkedUsers.concat(users).forEach(function (user) {
          var del = deleteUsers.find(function (del) {
            return del[_this.userUniqueId] === user[_this.userUniqueId];
          });
          if (!unique[user[_this.userUniqueId]] && !del) {
            arr.push(user);
            unique[user[_this.userUniqueId]] = user;
          }
        });
        this.checkedUsers = arr;
      }
    },
    clearChecked: function clearChecked() {
      this.checkedUsers = [];
      this.defaultCheckUsers = [];
    },
    handleCancel: function handleCancel(e) {
      this.checkedUsers = [];
      this.$emit('cancel');
    },
    handleConfirm: function handleConfirm() {
      if (this.required && this.checkedUsers.length === 0) {
        message_default.a.error(this.requiredTips);
        return;
      }
      this.$emit('confirm', this.checkedUsers.slice(0));
      this.checkedUsers = [];
    },
    onTabClick: function onTabClick(tab) {
      try {
        if (tab.$children && tab.$children[0] && tab.$children[0].$refs.tree) {
          tab.$children[0].$refs.tree.adjustFilterHeight();
        }
      } catch (e) {}
    },
    onTabsChange: function onTabsChange(val) {
      this.currTabsVal = val;
    }
  },

  render: function render() {
    var h = arguments[0];
    var title = this.title,
        visible = this.visible,
        checkedUsers = this.checkedUsers,
        defaultCheckUsers = this.defaultCheckUsers,
        tabs = this.tabs,
        confirmText = this.confirmText,
        cancelText = this.cancelText,
        renderChecked = this.renderChecked,
        renderCheckedItem = this.renderCheckedItem,
        selectPanelButton = this.selectPanelButton,
        radio = this.radio,
        isSearchCheckAll = this.isSearchCheckAll,
        dialogProps = this.dialogProps,
        poppable = this.poppable,
        loading = this.loading,
        checkOnClickNode = this.checkOnClickNode;

    var HEADER_HEIGHT = 59;
    var TAB_HEIGHT = tabs.length > 1 ? 56 : 0;
    var TRAN_HEIGHT = this.height ? Number(this.height.replace('px', '')) - TAB_HEIGHT - HEADER_HEIGHT : null;

    if (poppable) {
      return h(
        dialog_default.a,
        babel_helper_vue_jsx_merge_props_default()([{
          attrs: {
            'append-to-body': true,
            'close-on-click-modal': false,
            title: title,
            visible: visible
          }
        }, { on: { 'update:visible': this.handleCancel }, props: user_picker_extends({}, dialogProps) }, {
          attrs: {
            width: '1000px' }
        }]),
        [this.$slots.header && h(
          'template',
          { slot: 'header' },
          [this.$slots.header]
        ), h(
          'div',
          { 'class': 'el-user-picker', style: { height: this.height }, directives: [{
              name: 'loading',
              value: loading
            }]
          },
          [tabs.length > 1 && h(
            tabs_default.a,
            babel_helper_vue_jsx_merge_props_default()([{
              attrs: { value: this.currTabsVal },
              on: {
                'input': this.onTabsChange
              }
            }, {
              on: {
                'tab-click': this.onTabClick
              }
            }]),
            [tabs.map(function (tab, i) {
              return h(
                tab_pane,
                { key: tab.key, attrs: { label: tab.title, name: tab.key || i + '' }
                },
                [h(picker_panel, {
                  attrs: { checkOnClickNode: checkOnClickNode, height: TRAN_HEIGHT, defaultChecked: defaultCheckUsers, checkedUsers: checkedUsers, treeProps: tab, renderChecked: renderChecked, renderCheckedItem: renderCheckedItem, selectPanelButton: selectPanelButton, radio: radio, isSearchCheckAll: isSearchCheckAll }
                })]
              );
            })]
          ), tabs.length === 1 && h(picker_panel, {
            attrs: { checkOnClickNode: checkOnClickNode, height: TRAN_HEIGHT, defaultChecked: defaultCheckUsers, checkedUsers: checkedUsers, treeProps: tabs[0], renderChecked: renderChecked, renderCheckedItem: renderCheckedItem, selectPanelButton: selectPanelButton, radio: radio, isSearchCheckAll: isSearchCheckAll }
          })]
        ), h(
          'span',
          { 'class': 'dialog-footer', slot: 'footer' },
          [h(
            button_default.a,
            {
              on: {
                click: this.handleCancel
              }
            },
            [cancelText]
          ), h(
            button_default.a,
            babel_helper_vue_jsx_merge_props_default()([{
              attrs: { type: 'primary' }
            }, {
              on: {
                click: this.handleConfirm
              }
            }]),
            [confirmText]
          )]
        )]
      );
    } else {
      return h(
        'div',
        { 'class': 'el-user-picker', style: { height: this.height }, directives: [{
            name: 'loading',
            value: loading
          }]
        },
        [tabs.length > 1 && h(
          tabs_default.a,
          {
            attrs: { value: this.currTabsVal },
            on: {
              'input': this.onTabsChange
            }
          },
          [tabs.map(function (tab, i) {
            return h(
              tab_pane,
              { key: tab.key, attrs: { label: tab.title, name: tab.key || i + '' }
              },
              [h(picker_panel, {
                attrs: { height: TRAN_HEIGHT, defaultChecked: defaultCheckUsers, checkOnClickNode: checkOnClickNode, checkedUsers: checkedUsers, treeProps: tab,
                  renderChecked: renderChecked, selectPanelButton: selectPanelButton, renderCheckedItem: renderCheckedItem, radio: radio, isSearchCheckAll: isSearchCheckAll }
              })]
            );
          })]
        ), tabs.length === 1 && h(picker_panel, {
          attrs: { height: TRAN_HEIGHT, defaultChecked: defaultCheckUsers, checkOnClickNode: checkOnClickNode, checkedUsers: checkedUsers, treeProps: tabs[0],
            renderChecked: renderChecked, renderCheckedItem: renderCheckedItem, selectPanelButton: selectPanelButton, radio: radio, isSearchCheckAll: isSearchCheckAll }
        })]
      );
    }
  }
});
// CONCATENATED MODULE: ./packages/user-picker/index.js


/* istanbul ignore next */
user_picker.install = function (Vue) {
  Vue.component(user_picker.name, user_picker);
};

/* harmony default export */ var packages_user_picker = __webpack_exports__["default"] = (user_picker);

/***/ }),

/***/ 31:
/***/ (function(module, exports) {

module.exports = require("element-ui-for-gov/lib/tree");

/***/ }),

/***/ 36:
/***/ (function(module, exports) {

module.exports = require("element-ui-for-gov/lib/col");

/***/ }),

/***/ 41:
/***/ (function(module, exports) {

module.exports = require("element-ui-for-gov/lib/dialog");

/***/ }),

/***/ 42:
/***/ (function(module, exports) {

module.exports = require("element-ui-for-gov/lib/row");

/***/ }),

/***/ 79:
/***/ (function(module, exports) {

module.exports = require("element-ui-for-gov/lib/message");

/***/ }),

/***/ 8:
/***/ (function(module, exports) {

module.exports = require("element-ui-for-gov/lib/input");

/***/ }),

/***/ 81:
/***/ (function(module, exports) {

module.exports = require("element-ui-for-gov/lib/utils/tree-store");

/***/ }),

/***/ 9:
/***/ (function(module, exports) {

module.exports = require("element-ui-for-gov/lib/button");

/***/ })

/******/ });