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

;// 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/back-to-back/src/main.vue?vue&type=template&id=777ed759&
var render = function render() {
  var _vm = this,
    _c = _vm._self._c;
  return _c("div", {
    staticClass: "jdf-back-to-back"
  }, [_vm.dialogVisible ? _c("el-dialog", _vm._b({
    directives: [{
      name: "el-drag-dialog",
      rawName: "v-el-drag-dialog",
      value: true,
      expression: "true"
    }],
    ref: "elDialog",
    attrs: {
      width: _vm.dialogWidth,
      title: _vm.title,
      visible: _vm.dialogVisible,
      "modal-append-to-body": _vm.modalAppendToBody,
      "append-to-body": _vm.appendToBody,
      top: "10vh",
      "custom-class": "jdf-back-to-back-dialog"
    },
    on: {
      "update:visible": function updateVisible($event) {
        _vm.dialogVisible = $event;
      },
      close: _vm.closed
    }
  }, "el-dialog", _vm.dialogAttrs, false), [_c("div", {
    staticClass: "jdf-back-to-back-content-div"
  }, [_vm.chooseFlag ? [_c("el-row", {
    staticClass: "jdf-back-to-back-content-choose"
  }, [_c("el-col", {
    attrs: {
      span: 24
    }
  }, [_c("el-checkbox", {
    attrs: {
      indeterminate: _vm.isIndeterminate
    },
    on: {
      change: _vm.handleCheckAllChange
    },
    model: {
      value: _vm.checkAll,
      callback: function callback($$v) {
        _vm.checkAll = $$v;
      },
      expression: "checkAll"
    }
  }, [_vm._v("全选")]), _c("el-input", _vm._b({
    attrs: {
      size: "small",
      clearable: ""
    },
    model: {
      value: _vm.searchText,
      callback: function callback($$v) {
        _vm.searchText = $$v;
      },
      expression: "searchText"
    }
  }, "el-input", _vm.searchInputAttrs, false))], 1)], 1), _vm.chooseFileFlag ? [_c("el-tree", {
    directives: [{
      name: "show",
      rawName: "v-show",
      value: _vm.isSearch,
      expression: "isSearch"
    }],
    ref: "searchTree",
    staticClass: "jdf-back-to-back-choose-file",
    attrs: {
      data: _vm.searchTreeData,
      "show-checkbox": "",
      "default-expand-all": "",
      "check-on-click-node": true,
      "node-key": "fileId",
      props: _vm.fileProps
    },
    on: {
      "check-change": _vm.handleCheckChange
    }
  }), _c("el-tree", {
    directives: [{
      name: "show",
      rawName: "v-show",
      value: !_vm.isSearch,
      expression: "!isSearch"
    }],
    ref: "tree",
    staticClass: "jdf-back-to-back-choose-file",
    attrs: {
      data: _vm.fileList,
      "show-checkbox": "",
      "default-expand-all": "",
      "check-on-click-node": true,
      "node-key": "fileId",
      props: _vm.fileProps
    },
    on: {
      "check-change": _vm.handleCheckChange
    }
  })] : [[_c("el-tree", {
    directives: [{
      name: "show",
      rawName: "v-show",
      value: _vm.isSearch,
      expression: "isSearch"
    }],
    ref: "searchTree",
    staticClass: "jdf-back-to-back-choose-org",
    attrs: {
      data: _vm.searchTreeData,
      "show-checkbox": "",
      "default-expand-all": "",
      "node-key": "pkId",
      props: _vm.defaultProps
    },
    on: {
      "check-change": _vm.handleCheckChange
    },
    scopedSlots: _vm._u([{
      key: "default",
      fn: function fn(_ref) {
        var node = _ref.node,
          data = _ref.data;
        return _c("span", {
          staticClass: "custom-tree-node"
        }, [_c("span", {
          on: {
            click: function click($event) {
              $event.stopPropagation();
              return function () {
                return _vm.setTreeChecked(node, data);
              }.apply(null, arguments);
            }
          }
        }, [_vm._v(_vm._s(node.label))])]);
      }
    }], null, false, 4039060455)
  }), _c("el-tree", {
    directives: [{
      name: "show",
      rawName: "v-show",
      value: !_vm.isSearch,
      expression: "!isSearch"
    }],
    ref: "tree",
    staticClass: "jdf-back-to-back-choose-org",
    attrs: {
      data: _vm.orgList,
      "show-checkbox": "",
      "default-expand-all": "",
      "node-key": "pkId",
      props: _vm.defaultProps
    },
    on: {
      "check-change": _vm.handleCheckChange
    },
    scopedSlots: _vm._u([{
      key: "default",
      fn: function fn(_ref2) {
        var node = _ref2.node,
          data = _ref2.data;
        return _c("span", {
          staticClass: "custom-tree-node"
        }, [_c("span", {
          on: {
            click: function click($event) {
              $event.stopPropagation();
              return function () {
                return _vm.setTreeChecked(node, data);
              }.apply(null, arguments);
            }
          }
        }, [_vm._v(_vm._s(node.label))])]);
      }
    }], null, false, 4039060455)
  })]]] : [_c("el-button", {
    attrs: {
      type: "primary",
      size: "small"
    },
    on: {
      click: _vm.switchValue
    }
  }, [_vm._v("切换为" + _vm._s(_vm.btnTitle))]), _vm.isOrg ? [_c("el-collapse", {
    staticClass: "jdf-back-to-back-content",
    model: {
      value: _vm.activeNames,
      callback: function callback($$v) {
        _vm.activeNames = $$v;
      },
      expression: "activeNames"
    }
  }, _vm._l(_vm.orgList, function (item, index) {
    return _c("el-collapse-item", {
      key: index,
      attrs: {
        title: item.orgName,
        name: item.orgName
      }
    }, _vm._l(item.orgs, function (t, i) {
      return _c("el-row", {
        key: i
      }, [_c("el-col", {
        class: {
          "jdf-back-to-back-col-first": t.fileList.length > 0
        },
        attrs: {
          span: 24
        }
      }, [_c("div", {
        staticClass: "jdf-back-to-back-content-title"
      }, [_vm._v(_vm._s(t.orgName))]), _vm.isEdit ? _c("el-button", {
        attrs: {
          type: "primary",
          size: "small"
        },
        on: {
          click: function click($event) {
            return _vm.chooseFiles(t);
          }
        }
      }, [_vm._v("选择附件")]) : _vm._e()], 1), _vm._l(t.fileList, function (v, s) {
        return _c("el-col", {
          key: s,
          staticClass: "jdf-back-to-back-col",
          attrs: {
            span: 24
          }
        }, [_c("div", {
          staticClass: "jdf-back-to-back-content-file-title",
          attrs: {
            title: v.fileName
          }
        }, [_vm._v(_vm._s(v.fileName))]), _vm.isEdit ? _c("span", {
          staticClass: "jdf-back-to-back-content-del-title",
          on: {
            click: function click($event) {
              return _vm.deleteItem(t, v);
            }
          }
        }, [_vm._v("删除")]) : _vm._e()]);
      })], 2);
    }), 1);
  }), 1)] : _vm._l(_vm.fileList, function (item, index) {
    return _c("el-collapse", {
      key: index,
      staticClass: "jdf-back-to-back-content-file-list",
      model: {
        value: _vm.fileNames,
        callback: function callback($$v) {
          _vm.fileNames = $$v;
        },
        expression: "fileNames"
      }
    }, [_c("el-collapse-item", {
      attrs: {
        title: item.fileName,
        name: item.fileId
      }
    }, [_c("template", {
      slot: "title"
    }, [_c("div", {
      staticClass: "jdf-back-to-back-content-file"
    }, [_c("div", {
      attrs: {
        title: item.fileName
      }
    }, [_vm._v(_vm._s(item.fileName))]), _vm.isEdit ? _c("el-button", {
      attrs: {
        type: "primary",
        size: "small",
        plain: ""
      },
      on: {
        click: function click($event) {
          return _vm.chooseOrgs(item);
        }
      }
    }, [_vm._v("选择组织")]) : _vm._e()], 1)]), _vm._l(item.orgs, function (t, i) {
      return _c("el-row", {
        key: i
      }, [_c("el-col", [_c("div", {
        staticClass: "jdf-back-to-back-content-file-title"
      }, [_vm._v(_vm._s(t.orgName))]), _vm.isEdit ? _c("span", {
        staticClass: "jdf-back-to-back-content-del-title",
        on: {
          click: function click($event) {
            return _vm.deleteItem(t, item);
          }
        }
      }, [_vm._v("删除")]) : _vm._e()])], 1);
    })], 2)], 1);
  })]], 2), _c("div", {
    staticClass: "dialog-footer",
    attrs: {
      slot: "footer"
    },
    slot: "footer"
  }, [!_vm.chooseFlag ? [_c("el-button", {
    on: {
      click: _vm.closed
    }
  }, [_vm._v("关闭")])] : [_c("el-button", {
    attrs: {
      type: "primary"
    },
    on: {
      click: _vm.confirm
    }
  }, [_vm._v("确定")]), _c("el-button", {
    on: {
      click: _vm.cancel
    }
  }, [_vm._v("取消")])]], 2)]) : _vm._e()], 1);
};
var staticRenderFns = [];
render._withStripped = true;

;// CONCATENATED MODULE: ./packages/back-to-back/src/main.vue?vue&type=template&id=777ed759&

;// 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 "@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 "lodash/cloneDeep"
var cloneDeep_namespaceObject = require("lodash/cloneDeep");
var cloneDeep_default = /*#__PURE__*/__webpack_require__.n(cloneDeep_namespaceObject);
;// CONCATENATED MODULE: external "lodash/uniqBy"
var uniqBy_namespaceObject = require("lodash/uniqBy");
var uniqBy_default = /*#__PURE__*/__webpack_require__.n(uniqBy_namespaceObject);
;// CONCATENATED MODULE: external "lodash/uniq"
var uniq_namespaceObject = require("lodash/uniq");
var uniq_default = /*#__PURE__*/__webpack_require__.n(uniq_namespaceObject);
;// CONCATENATED MODULE: external "lodash/flatMap"
var flatMap_namespaceObject = require("lodash/flatMap");
var flatMap_default = /*#__PURE__*/__webpack_require__.n(flatMap_namespaceObject);
;// CONCATENATED MODULE: external "lodash/difference"
var difference_namespaceObject = require("lodash/difference");
var difference_default = /*#__PURE__*/__webpack_require__.n(difference_namespaceObject);
;// CONCATENATED MODULE: external "lodash/intersection"
var intersection_namespaceObject = require("lodash/intersection");
var intersection_default = /*#__PURE__*/__webpack_require__.n(intersection_namespaceObject);
;// CONCATENATED MODULE: external "lodash/isEmpty"
var isEmpty_namespaceObject = require("lodash/isEmpty");
var isEmpty_default = /*#__PURE__*/__webpack_require__.n(isEmpty_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/groupBy"
var groupBy_namespaceObject = require("lodash/groupBy");
var groupBy_default = /*#__PURE__*/__webpack_require__.n(groupBy_namespaceObject);
;// CONCATENATED MODULE: external "lodash/intersectionBy"
var intersectionBy_namespaceObject = require("lodash/intersectionBy");
;// CONCATENATED MODULE: external "jdf-jssdk"
var external_jdf_jssdk_namespaceObject = require("jdf-jssdk");
;// CONCATENATED MODULE: external "globalthis/implementation"
var implementation_namespaceObject = require("globalthis/implementation");
;// CONCATENATED MODULE: external "xregexp"
var external_xregexp_namespaceObject = require("xregexp");
var external_xregexp_default = /*#__PURE__*/__webpack_require__.n(external_xregexp_namespaceObject);
;// CONCATENATED MODULE: ./src/directives/el-drag-dialog/drag.js
/*
 * @Author: lirl
 * @Date: 2020-08-03 10:31:13
 * @LastEditTime: 2022-12-07 14:35:00
 * @Description: dialog拖动
 */



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

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

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

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

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

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


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

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { defineProperty_default()(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
/* eslint-disable no-undef */
/* eslint-disable no-param-reassign */
/*
 * @Author: lirl
 * @Date: 2023-02-02 19:37:40
 * @Description: file content
 */
/* harmony default export */ var dialogAttrs = ({
  data: function data() {
    var _this$$JDF = this.$JDF,
      dialogAttrs = _this$$JDF.dialogAttrs,
      lockScroll = _this$$JDF.lockScroll;
    return {
      // el-dialog属性，closeOnClickModal需要设为false，这样才可以向遮罩层添加关闭弹窗事件
      dialogAttrs: dialogAttrs ? _objectSpread(_objectSpread({}, dialogAttrs), {}, {
        closeOnClickModal: false
      }) : {
        appendToBody: true,
        lockScroll: lockScroll !== null && lockScroll !== void 0 ? lockScroll : false,
        closeOnClickModal: false,
        closeOnPressEscape: false,
        customClass: 'jdf-common-dialog'
      },
      // 当前为拖动鼠标还是点击鼠标
      isMove: false
    };
  },
  methods: {
    /**
     * 添加关闭弹窗事件，鼠标拖动到遮罩时不关闭弹窗，鼠标点击到遮罩时关闭弹窗
     */
    addCloseDialogEvent: function addCloseDialogEvent(dialogRef) {
      var _this = this;
      this.$nextTick(function () {
        var isMove = _this.isMove;
        var dialogEles = document.querySelectorAll('.el-dialog__wrapper');
        var handleMousemove = function handleMousemove() {
          isMove = true;
        };
        dialogEles === null || dialogEles === void 0 ? void 0 : dialogEles.forEach(function (ele) {
          if (ele) {
            ele.onclick = function (event) {
              if (!isMove && event.target === ele) {
                var dialogName = dialogRef || 'elDialog';
                _this.$refs[dialogName].handleClose();
              }
            };
            ele.onmousedown = function () {
              isMove = false;
              window.addEventListener('mousemove', handleMousemove);
            };
            ele.onmouseup = function () {
              return window.removeEventListener('mousemove', handleMousemove);
            };
          }
        });
      });
    }
  }
});
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/back-to-back/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: 'JdfBackToBack',
  directives: {
    elDragDialog: el_drag_dialog
  },
  mixins: [dialogAttrs],
  props: {
    visible: Boolean,
    // 关联流程实例id
    piid: {
      type: String,
      required: true
    },
    dialogTitle: {
      type: String,
      default: '背靠背关联'
    },
    // dialog宽度
    dialogWidth: {
      type: String,
      default: '1200px'
    },
    // 遮罩层是否插入至 body 元素上，若为 false，则遮罩层会插入至 Dialog 的父元素上
    modalAppendToBody: {
      type: Boolean,
      default: true
    },
    // Dialog 自身是否插入至 body 元素上。嵌套的 Dialog 必须指定该属性并赋值为 true
    appendToBody: {
      type: Boolean,
      default: false
    },
    // 组织list
    deptList: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    // 附件list
    attachList: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    // 附件列表
    bizFileList: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    // 选择的主抄送列表
    sendOrgList: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    isEdit: {
      type: Boolean,
      default: true
    },
    // 搜索输入框属性
    searchInputAttrs: {
      type: Object,
      default: function _default() {
        return {
          placeholder: '请输入搜索内容',
          'prefix-icon': 'el-icon-search'
        };
      }
    }
  },
  data: function data() {
    return {
      // dialog显示隐藏
      dialogVisible: false,
      loading: false,
      // 是否为组织列表
      isOrg: true,
      // 默认展开
      activeNames: [],
      // 搜索字段
      searchText: '',
      // 是否为选择附件或者组织界面
      chooseFlag: false,
      // 是否为选择附件列表
      chooseFileFlag: false,
      // 选中的值
      checkedValue: [],
      fileNames: [],
      // 当前 org 的 Pkid
      currentOrgId: '',
      // 当前附件id
      currentFileId: '',
      // 所有组织list
      orgList: [],
      // 多有附件list
      fileList: [],
      // 组织树映射关系
      defaultProps: {
        children: 'orgs',
        label: 'orgName'
      },
      // 附件树映射关系
      fileProps: {
        label: 'fileName'
      },
      // 不包含类别的组织树list
      orgs: [],
      // 搜索后不包含类别的组织树list
      searchOrgs: [],
      // 搜索后的树数据
      searchTreeData: [],
      //
      isSearch: false,
      lockScroll: this.$JDF.lockScroll
    };
  },
  methods: {
    closed: function closed() {
      this.dialogVisible = false;
      this.$emit('update:visible', false);
    },
    /**
     * 隐藏窗口
     */
    hide: function hide() {
      this.dialogVisible = false;
    },
    /**
     * 打开窗口
     */
    show: function show() {
      var _this = this;
      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee() {
        var orgList;
        return regenerator_default().wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              _context.next = 2;
              return _this.getBackToBackData();
            case 2:
              orgList = _this.orgList;
              _this.orgs = flatMap_default()(orgList.map(function (t) {
                return t.orgs;
              }));
              _this.activeNames = map_default()(orgList, 'orgName');
              _this.fileNames = map_default()(_this.fileList, 'fileId');
              _this.dialogVisible = true;
              _this.chooseFlag = false;
              _this.currentOrgId = '';
              _this.currentFileId = '';
              // 添加关闭弹窗事件
              _this.addCloseDialogEvent();
            case 11:
            case "end":
              return _context.stop();
          }
        }, _callee);
      }))();
    },
    /**
     * 取消事件
     */
    cancel: function cancel() {
      this.chooseFlag = false;
    },
    /**
     * 附件列表和组织列表切换
     */
    switchValue: function switchValue() {
      this.isOrg = !this.isOrg;
    },
    getBackToBackData: function getBackToBackData() {
      var _this2 = this;
      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee2() {
        var list, sendOrgList, bizFileList, orgCodes, fileList, backToBackList, orgFileList, orgsByFile, newFiles, filesByOrg, newOrgs;
        return regenerator_default().wrap(function _callee2$(_context2) {
          while (1) switch (_context2.prev = _context2.next) {
            case 0:
              _context2.next = 2;
              return _this2.api.getList(_this2.piid);
            case 2:
              list = _context2.sent;
              // 打开背靠背后 需要获取orgList，以及附件list
              sendOrgList = _this2.sendOrgList, bizFileList = _this2.bizFileList;
              orgCodes = sendOrgList.map(function (v) {
                return v.orgCode;
              });
              fileList = bizFileList.map(function (v) {
                return v.fileId;
              }); // 获取完存储的背靠背信息，判断下前端传入的orgList和fileList是否有删除，如果有删除，则将获取到的list进行对应的删除
              backToBackList = list.filter(function (t) {
                return orgCodes.includes(t.orgCode);
              }).filter(function (v) {
                return fileList.includes(v.fileId);
              });
              orgFileList = map_default()(backToBackList, function (t) {
                var _sendOrgList$find, _bizFileList$find;
                return mainvue_type_script_lang_js_objectSpread(mainvue_type_script_lang_js_objectSpread({}, t), {}, {
                  orgObj: (_sendOrgList$find = sendOrgList.find(function (v) {
                    return v.orgCode === t.orgCode;
                  })) !== null && _sendOrgList$find !== void 0 ? _sendOrgList$find : {},
                  fileObj: (_bizFileList$find = bizFileList.find(function (v) {
                    return v.fileId === t.fileId;
                  })) !== null && _bizFileList$find !== void 0 ? _bizFileList$find : {}
                });
              }); // 按照 fileId 进行分组
              orgsByFile = groupBy_default()(orgFileList, 'fileId');
              newFiles = map_default()(bizFileList, function (t) {
                return mainvue_type_script_lang_js_objectSpread(mainvue_type_script_lang_js_objectSpread({}, t), {}, {
                  orgs: map_default()(orgsByFile[t.fileId], function (v) {
                    return v.orgObj;
                  })
                });
              }); // 按照 orgCode 进行分组
              filesByOrg = groupBy_default()(orgFileList, 'orgCode');
              newOrgs = uniqBy_default()(sendOrgList.map(function (t) {
                return mainvue_type_script_lang_js_objectSpread(mainvue_type_script_lang_js_objectSpread({}, t), {}, {
                  fileList: map_default()(filesByOrg[t.orgCode], function (v) {
                    return v.fileObj;
                  })
                });
              }), 'pkId');
              _this2.updateOrgList(Object.entries(groupBy_default()(newOrgs, 'parentName')).map(function (_ref) {
                var _ref2 = slicedToArray_default()(_ref, 2),
                  k = _ref2[0],
                  v = _ref2[1];
                return {
                  orgName: k,
                  pkId: v[0].parentId,
                  orgs: v
                };
              }));
              _this2.updateAttachList(newFiles);
            case 14:
            case "end":
              return _context2.stop();
          }
        }, _callee2);
      }))();
    },
    /**
     * 选择附件
     */
    chooseFiles: function chooseFiles(_ref3) {
      var _this3 = this;
      var fileList = _ref3.fileList,
        pkId = _ref3.pkId;
      this.chooseFlag = true;
      this.chooseFileFlag = true;
      this.currentOrgId = pkId;
      this.checkedValue = [];
      this.searchText = '';
      this.$nextTick(function () {
        _this3.$refs.tree.setCheckedKeys(fileList.map(function (v) {
          return v.fileId;
        }));
      });
    },
    /**
     * 点击树的label则选中/取消选中当前节点
     */
    setTreeChecked: function setTreeChecked(_ref4, _ref5) {
      var checked = _ref4.checked;
      var pkId = _ref5.pkId;
      this.$refs[this.treeName].setChecked(pkId, !checked, true);
    },
    /**
     * 点击树的checkBox
     */
    handleCheckAllChange: function handleCheckAllChange(val) {
      this.chooseFileFlag ? this.setCheck({
        field: this.treeFileField,
        key: 'fileId',
        val: val
      }) : this.setCheck({
        field: this.treeOrgField,
        key: 'pkId',
        val: val
      });
    },
    /**
     * 设置树的checkbox状态
     */
    setCheck: function setCheck(_ref6) {
      var field = _ref6.field,
        key = _ref6.key,
        val = _ref6.val;
      var data = val ? this[field].map(function (t) {
        return t[key];
      }) : [];
      this.$refs[this.treeName].setCheckedKeys(data);
    },
    /**
     * 点击checkBox事件
     */
    handleCheckChange: function handleCheckChange(data, checked) {
      // 只保存叶子节点数据
      if (this.chooseFileFlag || data.parentId) {
        this.checkedValue = checked ? uniq_default()([].concat(toConsumableArray_default()(this.checkedValue), [data[this.chooseFileFlag ? 'fileId' : 'pkId']])) : difference_default()(this.checkedValue, [data[this.chooseFileFlag ? 'fileId' : 'pkId']]);
      }
    },
    /**
     * 选择组织
     */
    chooseOrgs: function chooseOrgs(item) {
      var _this4 = this;
      var orgs = item.orgs,
        fileId = item.fileId;
      this.chooseFlag = true;
      this.chooseFileFlag = false;
      this.currentFileId = fileId;
      this.checkedValue = [];
      this.searchText = '';
      this.$nextTick(function () {
        _this4.$refs.tree.setCheckedKeys(orgs.map(function (t) {
          return t.pkId;
        }));
      });
    },
    /**
     * 保存背靠背数据
     * @param {Array} fileList 附件列表
     */
    save: function save(fileList) {
      if (isEmpty_default()(fileList)) {
        return;
      }
      var orgFiles = fileList.map(function (t) {
        return {
          orgFileVoList: map_default()(t.orgs, function (v) {
            return {
              fileId: t.fileId,
              orgCode: v.orgCode,
              fileName: t.fileName,
              orgName: v.orgName
            };
          }).filter(function (v) {
            return !isEmpty_default()(v.orgCode);
          })
        };
      });
      new external_jdf_jssdk_namespaceObject.TransOrgFileService(this.$JDF.baseUrl).save(this.piid, flatMap_default()(orgFiles, 'orgFileVoList'));
    },
    /**
     * 确定事件
     */
    confirm: function confirm() {
      var _this5 = this;
      // 选择组织确认事件, chooseFileFlag true为选择附件页面，false 选择组织页面
      this.chooseFlag = false;
      var checkedList = uniqBy_default()([].concat(toConsumableArray_default()(this.$refs.searchTree.getCheckedNodes(true)), toConsumableArray_default()(this.$refs.tree.getCheckedNodes(true))), this.chooseFileFlag ? 'fileId' : 'pkId');
      var checkedValue = uniq_default()([].concat(toConsumableArray_default()(this.$refs.searchTree.getCheckedKeys(true)), toConsumableArray_default()(this.$refs.tree.getCheckedKeys(true))));
      if (this.chooseFileFlag) {
        var orgList = this.orgList.map(function (t) {
          return mainvue_type_script_lang_js_objectSpread(mainvue_type_script_lang_js_objectSpread({}, t), {}, {
            orgs: t.orgs.map(function (m) {
              return mainvue_type_script_lang_js_objectSpread(mainvue_type_script_lang_js_objectSpread({}, m), {}, {
                fileList: m.pkId === _this5.currentOrgId ? checkedList : m.fileList
              });
            })
          });
        });
        this.updateOrgList(orgList);
        var orgs = this.orgs.filter(function (v) {
          return v.pkId === _this5.currentOrgId;
        });
        var fileList = this.fileList.map(function (t) {
          var _t$orgs;
          return mainvue_type_script_lang_js_objectSpread(mainvue_type_script_lang_js_objectSpread({}, t), {}, {
            orgs: checkedValue.includes(t.fileId) ? uniqBy_default()([].concat(toConsumableArray_default()((_t$orgs = t.orgs) !== null && _t$orgs !== void 0 ? _t$orgs : []), toConsumableArray_default()(orgs)), 'pkId') : t.orgs
          });
        });
        this.save(fileList);
        this.updateAttachList(fileList);
        this.$emit('confirm', fileList, orgList);
      } else {
        // 确定时将 deptList, attachList,进行更新
        var file = this.fileList.filter(function (t) {
          return t.fileId === _this5.currentFileId;
        });
        var _fileList = this.fileList.map(function (t) {
          return mainvue_type_script_lang_js_objectSpread(mainvue_type_script_lang_js_objectSpread({}, t), {}, {
            orgs: t.fileId === _this5.currentFileId ? checkedList : t.orgs
          });
        });
        // 复写附件list
        this.updateAttachList(_fileList);
        // 复写orgList
        var _orgList = this.orgList.map(function (t) {
          return mainvue_type_script_lang_js_objectSpread(mainvue_type_script_lang_js_objectSpread({}, t), {}, {
            orgs: t.orgs.map(function (m) {
              return mainvue_type_script_lang_js_objectSpread(mainvue_type_script_lang_js_objectSpread({}, m), {}, {
                fileList: checkedValue.includes(m.pkId) ? uniqBy_default()([].concat(toConsumableArray_default()(m.fileList), toConsumableArray_default()(file)), 'fileId') : m.fileList
              });
            })
          });
        });
        this.save(_fileList);
        this.updateOrgList(_orgList);
        this.$emit('confirm', _fileList, _orgList);
      }
    },
    /**
     * 更新部门列表
     * @param {Array} orgList 部门列表
     */
    updateOrgList: function updateOrgList(orgList) {
      this.orgList = orgList;
      this.$emit('update:deptList', orgList);
    },
    /**
     * 更新附件列表
     * @param {Array} fileList 附件列表
     */
    updateAttachList: function updateAttachList(fileList) {
      this.fileList = fileList;
      this.$emit('update:attachList', fileList);
    },
    /**
     * 设置checkbox状态
     */
    getCheckState: function getCheckState(_ref7) {
      var field = _ref7.field,
        key = _ref7.key,
        isCheck = _ref7.isCheck;
      var arr = intersection_default()(this.checkedValue, this[field].map(function (t) {
        return t[key];
      }));
      return isCheck ? arr.length === this[field].length : arr.length > 0 && arr.length < this[field].length;
    },
    /**
     * 删除附件或者组织
     */
    deleteItem: function deleteItem(data, item) {
      var _this6 = this;
      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee3() {
        var parentId, pkId, orgCode, fileId, orgList, fileList, orgFiles;
        return regenerator_default().wrap(function _callee3$(_context3) {
          while (1) switch (_context3.prev = _context3.next) {
            case 0:
              parentId = data.parentId, pkId = data.pkId, orgCode = data.orgCode;
              fileId = item.fileId;
              orgList = _this6.orgList.map(function (t) {
                return mainvue_type_script_lang_js_objectSpread(mainvue_type_script_lang_js_objectSpread({}, t), {}, {
                  orgs: t.pkId === parentId ? t.orgs.map(function (v) {
                    var files = v.fileList;
                    v.pkId === pkId && files.splice(files.findIndex(function (s) {
                      return s.fileId === fileId;
                    }), 1);
                    return mainvue_type_script_lang_js_objectSpread(mainvue_type_script_lang_js_objectSpread({}, v), {}, {
                      files: files
                    });
                  }) : t.orgs
                });
              });
              fileList = _this6.fileList.map(function (t) {
                var orgs = t.orgs;
                if (t.fileId === fileId) {
                  orgs.splice(orgs.findIndex(function (s) {
                    return s.pkId === pkId;
                  }), 1);
                }
                return mainvue_type_script_lang_js_objectSpread(mainvue_type_script_lang_js_objectSpread({}, t), {}, {
                  orgs: orgs
                });
              }); // 复写附件list
              _this6.updateAttachList(fileList);
              _this6.updateOrgList(orgList);
              // 重新保存删除后的附件
              // 获取附件列表，随后进行删除再重新保存
              _context3.next = 8;
              return _this6.api.getList(_this6.piid);
            case 8:
              orgFiles = _context3.sent;
              _context3.next = 11;
              return _this6.api.save(_this6.piid, orgFiles.filter(function (t) {
                return !(t.orgCode === orgCode && t.fileId === fileId);
              }));
            case 11:
              _this6.$emit('delete', data, item, _this6.isOrg);
            case 12:
            case "end":
              return _context3.stop();
          }
        }, _callee3);
      }))();
    },
    /**
     * 搜索后加载新的选择组织或者选择附件树
     */
    setNewTree: function setNewTree(val) {
      this.isSearch = !!val;
      if (this.chooseFileFlag) {
        this.searchTreeData = cloneDeep_default()(this.fileList);
        this.searchTreeData = this.searchTreeData.filter(function (t) {
          return t.fileName.includes(val);
        });
      } else {
        var _this$searchTreeData$;
        this.searchTreeData = cloneDeep_default()(this.orgList);
        this.searchTreeData = (_this$searchTreeData$ = this.searchTreeData.filter(function (t) {
          var orgs = t.orgs;
          var childs = orgs.filter(function (v) {
            return v.orgName.includes(val) || v.parentName.includes(val);
          });
          return !isEmpty_default()(childs);
        })) === null || _this$searchTreeData$ === void 0 ? void 0 : _this$searchTreeData$.map(function (t) {
          return mainvue_type_script_lang_js_objectSpread(mainvue_type_script_lang_js_objectSpread({}, t), {}, {
            orgs: t.orgs.filter(function (v) {
              return v.orgName.includes(val) || v.parentName.includes(val);
            })
          });
        });
        this.searchOrgs = flatMap_default()(this.searchTreeData.map(function (t) {
          return t.orgs;
        }));
      }
      var treeName = this.isSearch ? 'searchTree' : 'tree';
      this.$refs[treeName].setCheckedKeys(this.checkedValue);
    }
  },
  computed: {
    // 获取btn的值
    btnTitle: function btnTitle() {
      return this.isOrg ? '附件列表' : '组织列表';
    },
    chooseTitle: function chooseTitle() {
      return this.chooseFileFlag ? '选择附件' : '选择组织';
    },
    /**
     * dialog标题
     */
    title: function title() {
      return this.chooseFlag ? this.chooseTitle : this.dialogTitle;
    },
    /**
     * 计算全选
     */
    checkAll: {
      get: function get() {
        return this.chooseFileFlag ? this.getCheckState({
          field: this.treeFileField,
          key: 'fileId',
          isCheck: true
        }) : this.getCheckState({
          field: this.treeOrgField,
          key: 'pkId',
          isCheck: true
        });
      },
      set: function set() {}
    },
    /**
     * 计算半选
     */
    isIndeterminate: function isIndeterminate() {
      return this.chooseFileFlag ? this.getCheckState({
        field: this.treeFileField,
        key: 'fileId',
        isCheck: false
      }) : this.getCheckState({
        field: this.treeOrgField,
        key: 'pkId',
        isCheck: false
      });
    },
    treeOrgField: function treeOrgField() {
      return this.isSearch ? 'searchOrgs' : 'orgs';
    },
    treeFileField: function treeFileField() {
      return this.isSearch ? 'searchTreeData' : 'fileList';
    },
    treeName: function treeName() {
      return this.isSearch ? 'searchTree' : 'tree';
    },
    api: function api() {
      return new external_jdf_jssdk_namespaceObject.TransOrgFileService(this.$JDF.baseUrl);
    }
  },
  watch: {
    // deptList(val) {
    //   this.orgList = cloneDeep(val);
    // },
    // attachList(val) {
    //   this.fileList = cloneDeep(val);
    // },
    searchText: function searchText(val) {
      this.setNewTree(val);
    },
    /**
     * 监听弹框展示
     */
    visible: {
      handler: function handler(val) {
        val && this.show();
      },
      immediate: true
    }
  }
});
;// CONCATENATED MODULE: ./packages/back-to-back/src/main.vue?vue&type=script&lang=js&
 /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_); 
;// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
/* globals __VUE_SSR_CONTEXT__ */

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

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

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

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

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

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

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

  return {
    exports: scriptExports,
    options: options
  }
}

;// CONCATENATED MODULE: ./packages/back-to-back/src/main.vue





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

/* harmony default export */ var main = (component.exports);
;// CONCATENATED MODULE: ./packages/back-to-back/index.js
/*
 * @Author: liujm
 * @Date: 2022-10-03 16:44:15
 * @Description: 背靠背关联组件
 */

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