/******/ (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 */ common_groups; }
});

;// 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/common-groups/src/main.vue?vue&type=template&id=68d341b1&
var render = function render() {
  var _vm = this,
    _c = _vm._self._c;
  return _c("div", {
    staticClass: "jdf-common-groups"
  }, [_c("el-dialog", _vm._b({
    directives: [{
      name: "el-drag-dialog",
      rawName: "v-el-drag-dialog",
      value: true,
      expression: "true"
    }],
    ref: "elDialog",
    attrs: {
      title: _vm.title,
      visible: _vm.dialogVisible,
      width: _vm.dialogWidth,
      "modal-append-to-body": _vm.modalAppendToBody,
      "append-to-body": _vm.appendToBody
    },
    on: {
      "update:visible": function updateVisible($event) {
        _vm.dialogVisible = $event;
      },
      close: _vm.handleClose
    }
  }, "el-dialog", _vm.dialogAttrs, false), [_c("div", {
    staticClass: "operation"
  }, [_c("el-checkbox", {
    on: {
      change: _vm.selectAllChange
    },
    model: {
      value: _vm.checked,
      callback: function callback($$v) {
        _vm.checked = $$v;
      },
      expression: "checked"
    }
  }, [_c("span", {
    staticClass: "operation-selectAll"
  }, [_vm._v("全选")])]), _c("el-button", {
    attrs: {
      size: "small",
      type: "danger",
      plain: ""
    },
    on: {
      click: _vm.batchDelete
    }
  }, [_vm._v("删除")])], 1), _c("el-table", {
    directives: [{
      name: "loading",
      rawName: "v-loading",
      value: _vm.loading,
      expression: "loading"
    }],
    ref: "groupTable",
    staticClass: "common-group-table",
    staticStyle: {
      width: "100%"
    },
    attrs: {
      "header-cell-style": _vm.headerCellStyle,
      stripe: "",
      data: _vm.pageData,
      height: "530",
      "tooltip-effect": "light"
    }
  }, [_c("el-table-column", {
    attrs: {
      align: "left",
      label: "分组名称",
      "show-overflow-tooltip": ""
    },
    scopedSlots: _vm._u([{
      key: "default",
      fn: function fn(scope) {
        return [_c("div", {
          staticClass: "table-checkbox-row"
        }, [_c("el-checkbox", {
          staticClass: "checkbox-item",
          on: {
            change: _vm.checkboxItemChange
          },
          model: {
            value: scope.row.checked,
            callback: function callback($$v) {
              _vm.$set(scope.row, "checked", $$v);
            },
            expression: "scope.row.checked"
          }
        }), _c("div", {
          staticClass: "group-name"
        }, [_vm._v(_vm._s(scope.row.groupName))])], 1)];
      }
    }])
  }), _c("el-table-column", {
    attrs: {
      align: "center",
      label: "操作",
      width: "130"
    },
    scopedSlots: _vm._u([{
      key: "default",
      fn: function fn(scope) {
        return [_c("div", {
          staticClass: "operation-row-icon"
        }, [_c("i", {
          staticClass: "iconfont icon-bianji",
          on: {
            click: function click($event) {
              return _vm.editRow(scope.row);
            }
          }
        }), _c("i", {
          staticClass: "iconfont icon-lajitong",
          on: {
            click: function click($event) {
              return _vm.deleteRow(scope.row);
            }
          }
        })])];
      }
    }])
  })], 1), _c("el-pagination", {
    staticClass: "common-groups-pagination",
    attrs: {
      "current-page": _vm.currentPage,
      "page-size": _vm.pageSize,
      layout: "->, total, prev, pager, next, jumper",
      total: _vm.total
    },
    on: {
      "size-change": _vm.handleSizeChange,
      "current-change": _vm.handleCurrentChange
    }
  }), _c("span", {
    staticClass: "dialog-footer",
    attrs: {
      slot: "footer"
    },
    slot: "footer"
  }, [_c("div", [_c("el-button", {
    attrs: {
      size: "small",
      type: "primary",
      icon: "el-icon-plus"
    },
    on: {
      click: _vm.newData
    }
  }, [_vm._v("新增")])], 1), _c("div", [_c("el-button", {
    attrs: {
      size: "small",
      type: "primary"
    },
    on: {
      click: _vm.enter
    }
  }, [_vm._v("确定")]), _c("el-button", {
    staticClass: "cancel-btn",
    attrs: {
      size: "small"
    },
    on: {
      click: _vm.hide
    }
  }, [_vm._v("取消")])], 1)])], 1), _c("NewCommonGroups", {
    ref: "NewCommonGroups",
    attrs: {
      expandLevel: _vm.expandLevel,
      "common-group-tree-expand-less-than-one-level": _vm.commonGroupTreeExpandLessThanOneLevel,
      simpleTreeArrts: _vm.simpleTreeArrts
    },
    on: {
      dialogClose: _vm.saveCallback
    }
  })], 1);
};
var staticRenderFns = [];
render._withStripped = true;

;// CONCATENATED MODULE: ./packages/common-groups/src/main.vue?vue&type=template&id=68d341b1&

;// 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/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 "sortablejs"
var external_sortablejs_namespaceObject = require("sortablejs");
var external_sortablejs_default = /*#__PURE__*/__webpack_require__.n(external_sortablejs_namespaceObject);
;// CONCATENATED MODULE: external "globalthis/implementation"
var implementation_namespaceObject = require("globalthis/implementation");
;// CONCATENATED MODULE: external "lodash/cloneDeep"
var cloneDeep_namespaceObject = require("lodash/cloneDeep");
var cloneDeep_default = /*#__PURE__*/__webpack_require__.n(cloneDeep_namespaceObject);
;// CONCATENATED MODULE: external "lodash/isArray"
var isArray_namespaceObject = require("lodash/isArray");
var isArray_default = /*#__PURE__*/__webpack_require__.n(isArray_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/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: 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 (0,external_element_ui_namespaceObject.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__*/function () {
  var _ref = asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee(content, yes, cancel) {
    var title,
      _args = arguments;
    return regenerator_default().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 external_element_ui_namespaceObject.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: ./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/components/NewCommonGroups.vue?vue&type=template&id=126c68eb&
var NewCommonGroupsvue_type_template_id_126c68eb_render = function render() {
  var _vm = this,
    _c = _vm._self._c;
  return _c("el-dialog", _vm._b({
    directives: [{
      name: "el-drag-dialog",
      rawName: "v-el-drag-dialog",
      value: true,
      expression: "true"
    }],
    ref: "elDialog",
    attrs: {
      visible: _vm.innerVisible,
      width: "60%",
      title: "新建常用分组"
    },
    on: {
      "update:visible": function updateVisible($event) {
        _vm.innerVisible = $event;
      },
      close: _vm.dialogClose
    }
  }, "el-dialog", _vm.dialogAttrs, false), [_c("div", {
    staticClass: "NewCommonGroups"
  }, [_c("el-form", {
    ref: "form",
    attrs: {
      rules: _vm.rules,
      model: _vm.form,
      "label-width": "120px"
    }
  }, [_c("el-form-item", {
    attrs: {
      label: "分组名称：",
      prop: "groupName"
    }
  }, [_c("el-input", {
    attrs: {
      placeholder: "请输入分组名称",
      clearable: ""
    },
    model: {
      value: _vm.form.groupName,
      callback: function callback($$v) {
        _vm.$set(_vm.form, "groupName", $$v);
      },
      expression: "form.groupName"
    }
  })], 1)], 1), _c("div", [_c("jdf-simple-tree", _vm._b({
    directives: [{
      name: "loading",
      rawName: "v-loading",
      value: _vm.loadLoading,
      expression: "loadLoading"
    }],
    attrs: {
      "tree-class": "common-group-tree",
      "default-expanded-keys": _vm.defaultExpandedKeys,
      data: _vm.treeData,
      "search-input-attrs": _vm.searchInputAttrs
    },
    model: {
      value: _vm.selected,
      callback: function callback($$v) {
        _vm.selected = $$v;
      },
      expression: "selected"
    }
  }, "jdf-simple-tree", _vm.simpleTreeArrts, false))], 1)], 1), _c("div", {
    staticClass: "dialog-footer inside",
    attrs: {
      slot: "footer"
    },
    slot: "footer"
  }, [_c("el-button", {
    attrs: {
      type: "primary",
      size: "small",
      loading: _vm.loading
    },
    on: {
      click: _vm.save
    }
  }, [_vm._v("确定")]), _c("el-button", {
    staticClass: "cancel-btn",
    attrs: {
      size: "small"
    },
    on: {
      click: function click($event) {
        _vm.innerVisible = false;
      }
    }
  }, [_vm._v("取 消")])], 1)]);
};
var NewCommonGroupsvue_type_template_id_126c68eb_staticRenderFns = [];
NewCommonGroupsvue_type_template_id_126c68eb_render._withStripped = true;

;// CONCATENATED MODULE: ./packages/components/NewCommonGroups.vue?vue&type=template&id=126c68eb&

;// 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/slicedToArray"
var slicedToArray_namespaceObject = require("@babel/runtime/helpers/slicedToArray");
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray_namespaceObject);
;// CONCATENATED MODULE: external "lodash/isNil"
var isNil_namespaceObject = require("lodash/isNil");
var isNil_default = /*#__PURE__*/__webpack_require__.n(isNil_namespaceObject);
;// CONCATENATED MODULE: external "lodash/flatMap"
var flatMap_namespaceObject = require("lodash/flatMap");
var flatMap_default = /*#__PURE__*/__webpack_require__.n(flatMap_namespaceObject);
;// CONCATENATED MODULE: ./src/utils/tools/getTreeExpandKeys.js

/*
 * @Author: lirl
 * @Date: 2023-02-26 21:41:57
 * @Description: 获取树默认展开的节点
 */



function getTreeExpandKeys(tree, expandLevel) {
  if (isNil_default()(expandLevel)) {
    return [];
  }
  if (expandLevel === 0) {
    return map_default()(tree, 'id');
  }
  var fn = function fn(arr, level) {
    return flatMap_default()(arr, function (t) {
      var _t$orgObj$orgLevel, _t$orgObj;
      if (!t || t.type === 'IDENTITY') {
        return null;
      }
      var orgLevel = (_t$orgObj$orgLevel = (_t$orgObj = t.orgObj) === null || _t$orgObj === void 0 ? void 0 : _t$orgObj.orgLevel) !== null && _t$orgObj$orgLevel !== void 0 ? _t$orgObj$orgLevel : level;
      if (orgLevel < expandLevel) {
        return [t.id].concat(toConsumableArray_default()(fn(t.children, level + 1)));
      }
      if (orgLevel === expandLevel) {
        return t.id;
      }
      return null;
    });
  };
  return fn(tree, 0).filter(function (t) {
    return t;
  });
}
;// 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: 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: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/components/NewCommonGroups.vue?vue&type=script&lang=js&











/* harmony default export */ var NewCommonGroupsvue_type_script_lang_js_ = ({
  mixins: [dialogAttrs],
  directives: {
    elDragDialog: el_drag_dialog
  },
  props: {
    expandLevel: {
      type: Number,
      default: 0
    },
    // 常用群组树展开层级是否比候选人树展开层级少一级
    commonGroupTreeExpandLessThanOneLevel: {
      type: Boolean,
      default: false
    },
    // jdf-simple-tree组件配置
    simpleTreeArrts: {
      type: Object,
      default: function _default() {
        return {};
      }
    }
  },
  inject: {
    searchInputAttrs: {
      default: {
        placeholder: '搜索：姓名（汉字/拼音）',
        'prefix-icon': 'el-icon-search'
      }
    },
    taskOwner: {
      default: function _default() {
        return {};
      }
    },
    treeId: {
      default: sessionStorage.getItem('treeId')
    }
  },
  computed: {
    taskUser: function taskUser() {
      return this.taskOwner();
    }
  },
  data: function data() {
    var _this = this;
    return {
      innerVisible: false,
      form: {
        groupName: ''
      },
      rules: {
        groupName: [{
          required: true,
          message: '请输入分组名称',
          trigger: 'blur'
        }, {
          max: 64,
          message: '请最多输入64个字',
          trigger: 'blur'
        }, {
          validator: function validator(rule, value, callback) {
            if (_this.validateExist(value)) {
              callback(new Error('分组名称已存在'));
            } else {
              callback();
            }
          }
        }]
      },
      selected: [],
      treeData: [],
      currentData: {},
      loading: false,
      identityIds: [],
      loadLoading: false,
      defaultExpandedKeys: []
    };
  },
  methods: {
    /**
     * 弹窗关闭
     */
    dialogClose: function dialogClose() {
      this.clearData();
      this.$refs.form.resetFields();
      this.$emit('dialogClose');
    },
    /**
     * 弹窗打开
     * @param {Object} data 当前选则数据
     */
    show: function show(data) {
      this.clearData();
      if (data) {
        this.form.groupName = data.groupName;
        this.currentData = cloneDeep_default()(data);
      }
      this.innerVisible = true;
      this.getTreeData();
      // 添加关闭弹窗事件
      this.addCloseDialogEvent();
    },
    /**
     * 清除数据
     */
    clearData: function clearData() {
      this.selected = [];
      this.treeData = [];
      this.currentData = {};
      this.form.groupName = '';
    },
    /**
     * 校验分组名称是否存在
     */
    validateExist: function validateExist(val) {
      var _this$$parent$tableDa;
      return this.currentData.groupName !== val && ((_this$$parent$tableDa = this.$parent.tableData) === null || _this$$parent$tableDa === void 0 ? void 0 : _this$$parent$tableDa.some(function (t) {
        return t.groupName === val;
      }));
    },
    /**
     * 获取常用群组
     */
    getCommonGroupsList: function getCommonGroupsList() {
      var _this2 = this;
      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee() {
        var data, _this2$currentData, id, users;
        return regenerator_default().wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              _context.next = 2;
              return new external_jdf_jssdk_namespaceObject.CommonCandidateGroupService(_this2.$JDF.baseUrl).getTree(_this2.taskUser.userId);
            case 2:
              data = _context.sent;
              _this2$currentData = _this2.currentData, id = _this2$currentData.id, users = _this2$currentData.users;
              if (id && users) {
                _this2.selected = users.map(function (v) {
                  return {
                    id: v.identityId,
                    name: v.userName,
                    loginName: v.userAccount,
                    orgCode: v.orgCode,
                    isLeaf: true,
                    type: external_jdf_jssdk_namespaceObject.OrgResultTypeEnum.IDENTITY
                  };
                });
              }
              return _context.abrupt("return", data);
            case 6:
            case "end":
              return _context.stop();
          }
        }, _callee);
      }))();
    },
    /**
     * 获取群组列表
     */
    getGroupList: function getGroupList() {
      var _this3 = this;
      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee2() {
        var data;
        return regenerator_default().wrap(function _callee2$(_context2) {
          while (1) switch (_context2.prev = _context2.next) {
            case 0:
              _context2.next = 2;
              return new external_jdf_jssdk_namespaceObject.OrgBaseService(_this3.$JDF.baseUrl).getSimpleOrgAndUserTree(_this3.treeId);
            case 2:
              data = _context2.sent;
              return _context2.abrupt("return", data);
            case 4:
            case "end":
              return _context2.stop();
          }
        }, _callee2);
      }))();
    },
    // 获取常用群组树
    getTreeData: function getTreeData() {
      var _this4 = this;
      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee3() {
        var _yield$Promise$all, _yield$Promise$all2, commonGroupData, userTreeData, expandLevel, expandKeys;
        return regenerator_default().wrap(function _callee3$(_context3) {
          while (1) switch (_context3.prev = _context3.next) {
            case 0:
              _context3.prev = 0;
              _this4.loadLoading = true;
              _context3.next = 4;
              return Promise.all([_this4.getCommonGroupsList(), _this4.getGroupList()]);
            case 4:
              _yield$Promise$all = _context3.sent;
              _yield$Promise$all2 = slicedToArray_default()(_yield$Promise$all, 2);
              commonGroupData = _yield$Promise$all2[0];
              userTreeData = _yield$Promise$all2[1];
              _this4.treeData = [commonGroupData, userTreeData].filter(function (t) {
                return t;
              });
              if (_this4.commonGroupTreeExpandLessThanOneLevel) {
                expandLevel = _this4.expandLevel;
                expandKeys = getTreeExpandKeys([userTreeData], expandLevel);
                commonGroupData && expandKeys.push.apply(expandKeys, toConsumableArray_default()(getTreeExpandKeys([commonGroupData], expandLevel - 1)));
                _this4.defaultExpandedKeys = expandKeys;
              } else {
                _this4.defaultExpandedKeys = getTreeExpandKeys(_this4.treeData, _this4.expandLevel);
              }
              _context3.next = 15;
              break;
            case 12:
              _context3.prev = 12;
              _context3.t0 = _context3["catch"](0);
              alertErrorMsg(_context3.t0);
            case 15:
              _context3.prev = 15;
              _this4.loadLoading = false;
              return _context3.finish(15);
            case 18:
            case "end":
              return _context3.stop();
          }
        }, _callee3, null, [[0, 12, 15, 18]]);
      }))();
    },
    /**
     * 保存数据
     */
    save: function save() {
      var _this5 = this;
      this.$refs.form.validate( /*#__PURE__*/function () {
        var _ref = asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee4(valid) {
          return regenerator_default().wrap(function _callee4$(_context4) {
            while (1) switch (_context4.prev = _context4.next) {
              case 0:
                if (!valid) {
                  _context4.next = 19;
                  break;
                }
                _this5.loading = true;
                _context4.prev = 2;
                if (!isEmpty_default()(_this5.selected)) {
                  _context4.next = 6;
                  break;
                }
                message('请选择人员', 'warning');
                return _context4.abrupt("return", false);
              case 6:
                _context4.next = 8;
                return _this5.pushData(_this5.form.groupName, _this5.currentData);
              case 8:
                _this5.innerVisible = false;
                _this5.$emit('dialogClose');
                _context4.next = 15;
                break;
              case 12:
                _context4.prev = 12;
                _context4.t0 = _context4["catch"](2);
                alertErrorMsg(_context4.t0);
              case 15:
                _context4.prev = 15;
                _this5.loading = false;
                return _context4.finish(15);
              case 18:
                return _context4.abrupt("return", true);
              case 19:
                return _context4.abrupt("return", false);
              case 20:
              case "end":
                return _context4.stop();
            }
          }, _callee4, null, [[2, 12, 15, 18]]);
        }));
        return function (_x) {
          return _ref.apply(this, arguments);
        };
      }());
    },
    /**
     * 推送常用分组数据
     * @param {String} groupName 常用分组名称
     * @param {Object} currentData 常用分组数据
     */
    pushData: function pushData(groupName, currentData) {
      var id = currentData.id;
      var taskUser = this.taskUser;
      var data = {
        groupId: id,
        groupName: groupName,
        groupCode: currentData.groupCode,
        orderNum: currentData.orderNo,
        operateType: id ? external_jdf_jssdk_namespaceObject.CommonGroupOperateType.UPDATE : external_jdf_jssdk_namespaceObject.CommonGroupOperateType.ADD,
        operatorName: taskUser.userName,
        operatorId: taskUser.userId,
        userList: this.selected.map(function (v, i) {
          return {
            userId: v.loginName,
            userName: v.name,
            identityId: v.id,
            orgCode: v.orgCode,
            orderNum: i
          };
        })
      };
      return new external_jdf_jssdk_namespaceObject.ProcessApiService(this.$JDF.bizUrl).pushCommonGroupData([data]);
    }
  }
});
;// CONCATENATED MODULE: ./packages/components/NewCommonGroups.vue?vue&type=script&lang=js&
 /* harmony default export */ var components_NewCommonGroupsvue_type_script_lang_js_ = (NewCommonGroupsvue_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/components/NewCommonGroups.vue





/* normalize component */
;
var component = normalizeComponent(
  components_NewCommonGroupsvue_type_script_lang_js_,
  NewCommonGroupsvue_type_template_id_126c68eb_render,
  NewCommonGroupsvue_type_template_id_126c68eb_staticRenderFns,
  false,
  null,
  null,
  null
  
)

/* harmony default export */ var NewCommonGroups = (component.exports);
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/common-groups/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: 'JdfCommonGroups',
  components: {
    NewCommonGroups: NewCommonGroups
  },
  directives: {
    elDragDialog: el_drag_dialog
  },
  mixins: [dialogAttrs],
  props: {
    visible: Boolean,
    // 标题
    title: {
      type: String,
      default: '编辑常用分组'
    },
    // 遮罩层是否插入至 body 元素上
    modalAppendToBody: {
      type: Boolean,
      default: true
    },
    // Dialog 自身是否插入至 body 元素上
    appendToBody: {
      type: Boolean,
      default: false
    },
    // dialog宽度
    dialogWidth: {
      type: String,
      default: '800px'
    },
    expandLevel: {
      type: Number,
      default: 0
    },
    // 常用群组树展开层级是否比候选人树展开层级少一级
    commonGroupTreeExpandLessThanOneLevel: {
      type: Boolean,
      default: false
    },
    // jdf-simple-tree组件配置
    simpleTreeArrts: {
      type: Object,
      default: function _default() {
        return {
          search: true,
          transfer: true,
          multiple: true,
          multipleSelectRemoveLeft: true
        };
      }
    }
  },
  data: function data() {
    return {
      dialogVisible: false,
      checked: false,
      currentPage: 1,
      pageSize: 10,
      total: 0,
      headerCellStyle: {
        background: 'rgba(236, 239, 244, 0.996078431372549)',
        color: '#000'
      },
      // 所有数据
      tableData: [],
      loading: false,
      // 关闭常用分组列表窗口时是否需要展示上一级：
      // 注：当打开新建窗口，关闭列表窗口时，不需要展示上一级窗口；当单独关闭列表窗口时，需要展示上一级窗口
      isShowPreviousModal: true
    };
  },
  inject: {
    taskOwner: {
      default: function _default() {
        return {};
      }
    }
  },
  computed: {
    taskUser: function taskUser() {
      return this.taskOwner();
    },
    // 当前页数据
    pageData: function pageData() {
      var pageSize = this.pageSize,
        currentPage = this.currentPage;
      return this.tableData.slice((currentPage - 1) * pageSize, pageSize * currentPage);
    }
  },
  watch: {
    visible: {
      handler: function handler(val) {
        val && this.show();
      },
      immediate: true
    }
  },
  methods: {
    /**
     * 弹窗打开
     */
    show: function show() {
      var _this = this;
      this.clearData();
      this.dialogVisible = true;
      this.getListData();
      this.$nextTick(function () {
        _this.initDragEvent();
      });
      // 添加关闭弹窗事件
      this.addCloseDialogEvent();
    },
    /**
     * 清除数据
     */
    clearData: function clearData() {
      this.currentPage = 1;
      this.checked = false;
      this.tableData = [];
    },
    /**
     * 关闭弹窗
     */
    hide: function hide() {
      this.dialogVisible = false;
      this.$emit('update:visible', false);
    },
    /**
     * 确认按钮点击事件
     */
    enter: function enter() {
      this.hide();
      this.$emit('enter');
    },
    /**
     * 弹窗关闭事件
     */
    handleClose: function handleClose() {
      this.clearData();
      /**
       * 1. 当点击新建、编辑分组时，会关闭列表窗口，isShowPreviousModal = false 此时不弹出列表窗口的上一级窗口
       * 2. 当点击列表dialog的取消、确定时，isShowPreviousModal = true需弹出列表窗口的上一级窗口
       * 3. 当点击列表dialog的蒙层时，isShowPreviousModal = true需弹出列表窗口的上一级窗口
       * 4. 当点击列表dialog右上角的关闭按钮时，isShowPreviousModal = true需弹出列表窗口的上一级窗口
       */
      if (this.isShowPreviousModal) {
        this.$emit('update:visible', false);
      }
      this.$emit('close');
    },
    /**
     * 初始化拖拽
     */
    initDragEvent: function initDragEvent() {
      var _this2 = this;
      external_sortablejs_default().create(implementation_namespaceObject.document.querySelector('.common-group-table .el-table__body tbody'), {
        ghostClass: 'jdf-sortable-ghost',
        animation: 150,
        onEnd: function onEnd(_ref) {
          var newIndex = _ref.newIndex,
            oldIndex = _ref.oldIndex;
          var list = cloneDeep_default()(_this2.tableData);
          var targetRow = list[oldIndex];
          list.splice(oldIndex, 1);
          list.splice(newIndex, 0, targetRow);
          _this2.pushAll(list);
        }
      });
    },
    /**
     * 获取常用分组列表
     */
    getListData: function getListData(isDelete) {
      var _this3 = this;
      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee() {
        var dataList, currentPage, pageSize, total, page;
        return regenerator_default().wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              _this3.tableData = [];
              _context.prev = 1;
              _context.next = 4;
              return new external_jdf_jssdk_namespaceObject.CommonCandidateGroupService(_this3.$JDF.baseUrl).getList(_this3.taskUser.userId);
            case 4:
              dataList = _context.sent;
              if (isEmpty_default()(dataList)) {
                _this3.total = 0;
                _this3.tableData = [];
              } else {
                _this3.total = dataList.length;
                _this3.tableData = dataList.map(function (v) {
                  return mainvue_type_script_lang_js_objectSpread(mainvue_type_script_lang_js_objectSpread({}, v), {}, {
                    checked: false
                  });
                });
              }
              currentPage = _this3.currentPage, pageSize = _this3.pageSize, total = _this3.total; // 如果是删除操作，并且还有数据，并且当前页大于1，但是可展示页小于当前页，则重置当前页
              if (isDelete && total && currentPage > 1 && !(total % pageSize)) {
                page = total / pageSize;
                page < currentPage && (_this3.currentPage = page);
              }
              _context.next = 13;
              break;
            case 10:
              _context.prev = 10;
              _context.t0 = _context["catch"](1);
              alertErrorMsg(_context.t0);
            case 13:
            case "end":
              return _context.stop();
          }
        }, _callee, null, [[1, 10]]);
      }))();
    },
    /**
     * 构建后台推送接口的参数
     */
    pushParam: function pushParam(item, operateType, orderNo) {
      var taskUser = this.taskUser;
      return {
        groupId: item.id,
        groupCode: item.groupCode,
        groupName: item.groupName,
        orderNum: orderNo !== null && orderNo !== void 0 ? orderNo : item.orderNo,
        operateType: operateType,
        operatorName: taskUser.userName,
        operatorId: taskUser.userId,
        userList: map_default()(item.users, function (v, i) {
          return {
            userId: v.userAccount,
            userName: v.userName,
            identityId: v.identityId,
            orgCode: v.orgCode,
            orderNum: i
          };
        })
      };
    },
    /**
     * 全选按钮change事件
     * @param {Boolean} e
     */
    selectAllChange: function selectAllChange(e) {
      var _this4 = this;
      this.tableData.forEach(function (item) {
        return _this4.$set(item, 'checked', e);
      });
    },
    /**
     * checkbox按钮change事件(item)
     */
    checkboxItemChange: function checkboxItemChange() {
      this.checked = !isEmpty_default()(this.pageData) && this.pageData.every(function (item) {
        return item.checked;
      });
    },
    /**
     * pageSize 改变时会触发
     * @param {Number} val 每页条数
     */
    handleSizeChange: function handleSizeChange(val) {
      this.pageSize = val;
      this.currentPage = 1;
    },
    /**
     * currentPage 改变时会触发
     * @param {} val 当前页
     */
    handleCurrentChange: function handleCurrentChange(val) {
      var _this5 = this;
      this.tableData.forEach(function (item) {
        return _this5.$set(item, 'checked', false);
      });
      this.checked = false;
      this.currentPage = val;
    },
    /**
     * 是否重载
     */
    reload: function reload(isDelete) {
      var _this6 = this;
      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee2() {
        return regenerator_default().wrap(function _callee2$(_context2) {
          while (1) switch (_context2.prev = _context2.next) {
            case 0:
              _context2.next = 2;
              return _this6.getListData(isDelete);
            case 2:
              _this6.checkboxItemChange();
              _this6.$nextTick(function () {
                _this6.$refs.groupTable.doLayout();
              });
            case 4:
            case "end":
              return _context2.stop();
          }
        }, _callee2);
      }))();
    },
    /**
     * 批量删除
     */
    batchDelete: function batchDelete() {
      var _this7 = this;
      var checkedList = this.pageData.filter(function (item) {
        return item.checked;
      });
      if (isEmpty_default()(checkedList)) {
        message('请选择要删除的常用分组', 'warning');
        return;
      }
      messageConfirm("\u786E\u5B9A\u5220\u9664\u9009\u4E2D\u7684".concat(checkedList.length, "\u6761\u5E38\u7528\u5206\u7EC4\uFF1F"), /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee3() {
        return regenerator_default().wrap(function _callee3$(_context3) {
          while (1) switch (_context3.prev = _context3.next) {
            case 0:
              _context3.prev = 0;
              _context3.next = 3;
              return _this7.deleteData(checkedList);
            case 3:
              _this7.reload(true);
              message('删除成功');
              _context3.next = 10;
              break;
            case 7:
              _context3.prev = 7;
              _context3.t0 = _context3["catch"](0);
              alertErrorMsg(_context3.t0);
            case 10:
            case "end":
              return _context3.stop();
          }
        }, _callee3, null, [[0, 7]]);
      })));
    },
    /**
     * 删除按钮点击事件
     * @param {Number} id 主键
     */
    deleteRow: function deleteRow(row) {
      var _this8 = this;
      messageConfirm('确定删除该常用分组？', /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee4() {
        return regenerator_default().wrap(function _callee4$(_context4) {
          while (1) switch (_context4.prev = _context4.next) {
            case 0:
              _context4.next = 2;
              return _this8.deleteData(row);
            case 2:
              _this8.reload(true);
              message('删除成功');
            case 4:
            case "end":
              return _context4.stop();
          }
        }, _callee4);
      })));
    },
    /**
     * 根据主键删除数据
     * @param {Number} id 主键
     */
    deleteData: function deleteData(data) {
      var pushParam = this.pushParam;
      var DELETE = external_jdf_jssdk_namespaceObject.CommonGroupOperateType.DELETE;
      var paramList = isArray_default()(data) ? data.map(function (t) {
        return pushParam(t, DELETE);
      }) : [pushParam(data, DELETE)];
      return new external_jdf_jssdk_namespaceObject.ProcessApiService(this.$JDF.baseUrl).pushCommonGroupData(paramList);
    },
    /**
     * 修改所有数据
     * @param {*} list 数据列表
     */
    pushAll: function pushAll(list) {
      var _this9 = this;
      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee5() {
        var pushParam, UPDATE, paramList;
        return regenerator_default().wrap(function _callee5$(_context5) {
          while (1) switch (_context5.prev = _context5.next) {
            case 0:
              _context5.prev = 0;
              _this9.loading = true;
              pushParam = _this9.pushParam;
              UPDATE = external_jdf_jssdk_namespaceObject.CommonGroupOperateType.UPDATE;
              paramList = list.map(function (t, index) {
                return pushParam(t, UPDATE, index);
              });
              _context5.next = 7;
              return new external_jdf_jssdk_namespaceObject.ProcessApiService(_this9.$JDF.baseUrl).pushCommonGroupData(paramList);
            case 7:
              _context5.next = 9;
              return _this9.getListData();
            case 9:
              _context5.next = 14;
              break;
            case 11:
              _context5.prev = 11;
              _context5.t0 = _context5["catch"](0);
              alertErrorMsg(_context5.t0);
            case 14:
              _context5.prev = 14;
              _this9.loading = false;
              return _context5.finish(14);
            case 17:
            case "end":
              return _context5.stop();
          }
        }, _callee5, null, [[0, 11, 14, 17]]);
      }))();
    },
    /**
     * 编辑
     * @param {Object} row 当前行数据
     */
    editRow: function editRow(row) {
      // 打开编辑常用分组的弹窗，隐藏常用分组列表弹窗
      this.dialogVisible = false;
      this.isShowPreviousModal = false;
      this.$refs.NewCommonGroups.show(row);
    },
    /**
     * 新增数据
     */
    newData: function newData() {
      // 打开新建常用分组的弹窗，隐藏常用分组列表弹窗
      this.dialogVisible = false;
      this.isShowPreviousModal = false;
      this.$refs.NewCommonGroups.show({
        orderNo: this.total + 1
      });
    },
    saveCallback: function saveCallback() {
      // 关闭新建常用分组弹窗，打开常用分组列表弹窗
      this.show();
      this.isShowPreviousModal = true;
      this.checked = false;
    }
  }
});
;// CONCATENATED MODULE: ./packages/common-groups/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: ./packages/common-groups/src/main.vue





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

/* harmony default export */ var main = (main_component.exports);
;// CONCATENATED MODULE: ./packages/common-groups/index.js

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