((typeof self !== 'undefined' ? self : this)["webpackJsonpportal_homepage_nanhai"] = (typeof self !== 'undefined' ? self : this)["webpackJsonpportal_homepage_nanhai"] || []).push([[45],{

/***/ "cfba":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addRequestQueue; });
/* harmony import */ var _data_jenkins_workspace_tools_ui_cdn_wiz_integration_protal_dananhai_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("c7eb");
/* harmony import */ var _data_jenkins_workspace_tools_ui_cdn_wiz_integration_protal_dananhai_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("1da1");
/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("14d9");
/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("d3b7");
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("e6cf");
/* harmony import */ var core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_4__);





var queue = [];
var runningCount = 0;
var maxRequestsNum = 3;
function processNextRequest() {
  return _processNextRequest.apply(this, arguments);
}
function _processNextRequest() {
  _processNextRequest = Object(_data_jenkins_workspace_tools_ui_cdn_wiz_integration_protal_dananhai_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])( /*#__PURE__*/Object(_data_jenkins_workspace_tools_ui_cdn_wiz_integration_protal_dananhai_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])().mark(function _callee2() {
    var request;
    return Object(_data_jenkins_workspace_tools_ui_cdn_wiz_integration_protal_dananhai_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])().wrap(function _callee2$(_context2) {
      while (1) switch (_context2.prev = _context2.next) {
        case 0:
          if (!(runningCount >= maxRequestsNum || queue.length === 0)) {
            _context2.next = 2;
            break;
          }
          return _context2.abrupt("return");
        case 2:
          runningCount += 1;
          request = queue.shift();
          _context2.prev = 4;
          _context2.next = 7;
          return request();
        case 7:
          _context2.next = 11;
          break;
        case 9:
          _context2.prev = 9;
          _context2.t0 = _context2["catch"](4);
        case 11:
          _context2.prev = 11;
          runningCount -= 1;
          processNextRequest();
          return _context2.finish(11);
        case 15:
        case "end":
          return _context2.stop();
      }
    }, _callee2, null, [[4, 9, 11, 15]]);
  }));
  return _processNextRequest.apply(this, arguments);
}
function addRequestQueue(request) {
  return new Promise(function (resolve, reject) {
    queue.push( /*#__PURE__*/Object(_data_jenkins_workspace_tools_ui_cdn_wiz_integration_protal_dananhai_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])( /*#__PURE__*/Object(_data_jenkins_workspace_tools_ui_cdn_wiz_integration_protal_dananhai_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])().mark(function _callee() {
      var result;
      return Object(_data_jenkins_workspace_tools_ui_cdn_wiz_integration_protal_dananhai_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])().wrap(function _callee$(_context) {
        while (1) switch (_context.prev = _context.next) {
          case 0:
            _context.prev = 0;
            _context.next = 3;
            return request();
          case 3:
            result = _context.sent;
            resolve(result);
            _context.next = 10;
            break;
          case 7:
            _context.prev = 7;
            _context.t0 = _context["catch"](0);
            reject(_context.t0);
          case 10:
          case "end":
            return _context.stop();
        }
      }, _callee, null, [[0, 7]]);
    })));
    processNextRequest();
  });
}

/***/ }),

/***/ "e7a4":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

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

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"628455f4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/windicss-webpack-plugin/dist/loaders/windicss-template.cjs!./src/components/portal/BayWindow.vue?vue&type=template&id=7e0a03ec&scoped=true
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.visible)?_c('div',{ref:"thediv",staticClass:"w-full h-full absolute overflow-hidden",style:({
    left: (_vm.xPos + "px"),
    top: (_vm.yPos + "px"),
  }),on:{"mousemove":_vm.clearFdAd,"mouseout":_vm.starFdAd}},[(_vm.showClose)?_c('span',{staticClass:"iconfont icon-line-close absolute right-5px top-5px z-1 text-12px cursor-pointer text-hex-333",on:{"click":function($event){_vm.visible = false}}}):_vm._e(),_c('div',{staticClass:"w-full h-full",class:_vm.data.layout === 'horizontal' ? 'flex' : ''},[_vm._t("content",_vm._l((_vm.hrefList),function(item,index){return _c('div',{key:index,staticClass:"w-full mx-0",class:_vm.filterHeight()},[_c('el-image',{staticClass:"w-full h-full",attrs:{"src":("" + _vm.fileUrl + (item.imageFile)),"fit":_vm.data.imageFit || 'fill'},on:{"click":function($event){return _vm.hrefTo(item)}}})],1)}))],2)]):_vm._e()}
var staticRenderFns = []


// CONCATENATED MODULE: ./src/components/portal/BayWindow.vue?vue&type=template&id=7e0a03ec&scoped=true

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 3 modules
var slicedToArray = __webpack_require__("3835");

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__("c7eb");

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
var asyncToGenerator = __webpack_require__("1da1");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.concat.js
var es_array_concat = __webpack_require__("99af");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.map.js
var es_array_map = __webpack_require__("d81d");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
var es_array_push = __webpack_require__("14d9");

// EXTERNAL MODULE: ./node_modules/@wiz-api/workbench/lib/workbench.umd.js
var workbench_umd = __webpack_require__("c7fe");

// EXTERNAL MODULE: ./src/assets/js/RequestQueue.js
var RequestQueue = __webpack_require__("cfba");

// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib??ref--12-1!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/windicss-webpack-plugin/dist/loaders/windicss-template.cjs!./src/components/portal/BayWindow.vue?vue&type=script&lang=js






//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//



var columnTableApi = new workbench_umd["ColumnTableApi"]();
var columApi = new workbench_umd["ColumApi"]();
/* harmony default export */ var BayWindowvue_type_script_lang_js = ({
  props: {
    data: {
      type: Object,
      default: function _default() {
        return {};
      }
    },
    mode: {
      type: String,
      default: ''
    }
  },
  computed: {
    fileUrl: function fileUrl() {
      var fileServer = Wiz.GetModuleServer('file-management');
      return "".concat(fileServer, "/api/file-management/files/public/image/");
    },
    showClose: function showClose() {
      var _this$data;
      return (_this$data = this.data) === null || _this$data === void 0 ? void 0 : _this$data.showClose;
    },
    routerBase: function routerBase() {
      if (window.__POWERED_BY_QIANKUN__) {
        return "/".concat(_.get(Wiz, 'globalSettings.globalConfig.routerBase'));
      }
      return '';
    }
  },
  watch: {
    data: {
      immediate: true,
      deep: true,
      handler: function handler(val, oldVal) {
        var _this = this;
        if (!_.isEmpty(val) && !_.isEmpty(val.dataSource)) {
          if (val.dataSource && (val.dataSource !== (oldVal === null || oldVal === void 0 ? void 0 : oldVal.dataSource) || val.pageSize !== (oldVal === null || oldVal === void 0 ? void 0 : oldVal.pageSize))) {
            this.getTableData(val.dataSource, val.pageSize);
          }
          this.mode === 'update' ? this.step = 0 : this.step = val.speed;
          this.$nextTick(function () {
            _this.init();
            _this.starFdAd();
          });
        }
      }
    }
  },
  data: function data() {
    return {
      // 定义相关参数
      xPos: 0,
      // 初始化x轴位置
      yPos: 0,
      // 初始化y轴位置
      xin: true,
      yin: true,
      step: 0,
      // 移动速度
      delay: 18,
      // 刷新时间
      hOffset: 0,
      wOffset: 0,
      topPosMax: 0,
      topPosMin: 0,
      yon: true,
      xon: true,
      pause: true,
      interval: null,
      hrefList: [],
      visible: true
    };
  },
  mounted: function mounted() {
    // init()
  },
  deactivated: function deactivated() {
    if (this.interval) {
      window.clearInterval(this.interval);
    }
    var homePage = document.getElementsByClassName('portal-container')[0];
    if (homePage) {
      homePage.removeEventListener('scroll', this.onScroll);
    }
  },
  beforeDestroy: function beforeDestroy() {
    if (this.interval) {
      window.clearInterval(this.interval);
    }
    var homePage = document.getElementsByClassName('portal-container')[0];
    if (homePage) {
      homePage.removeEventListener('scroll', this.onScroll);
    }
  },
  methods: {
    init: function init() {
      var _this2 = this;
      try {
        if (this.$refs.thediv) {
          var _clientRect = this.$refs.thediv.parentElement.getBoundingClientRect();
          this.hOffset = _clientRect.y;
          this.wOffset = _clientRect.x;
        }
        var homePage = document.getElementsByClassName('homepage-index')[0];
        if (homePage) {
          if (clientRect.y + clientRect.height > window.innerHeight) return;
          homePage.addEventListener('scroll', this.onScroll);
        }
      } catch (error) {
        setTimeout(function () {
          _this2.init();
        }, 500);
      }
    },
    onScroll: function onScroll(e) {
      if (this.step === 0) {
        this.xPos = e.target.scrollLeft;
        this.yPos = e.target.scrollTop;
      }
    },
    changePos: function changePos() {
      if (!this.$refs.thediv) return;
      // 初始获取偏移值可能不准确，需根据判断重新获取
      var parentClientRect = this.$refs.thediv.parentElement.getBoundingClientRect();
      var scrollContainer = document.getElementsByClassName('portal-container')[0];
      if (parentClientRect.x !== this.wOffset || parentClientRect.y !== this.hOffset) {
        this.hOffset = parentClientRect.y + scrollContainer.scrollTop;
        this.wOffset = parentClientRect.x + scrollContainer.scrollLeft;
      }
      var clientRect = this.$refs.thediv.getBoundingClientRect();
      // 元素top最小值 = 元素距离页面顶部的距离 + 页面纵向滚动的距离
      var topPosMin = -this.hOffset + scrollContainer.scrollTop;
      // 元素top最大值 = 页面可视区域高度 - 元素高度 - 元素距离页面顶部的距离 + 页面纵向滚动的距离
      var topPosMax = document.documentElement.clientHeight - clientRect.height - this.hOffset + scrollContainer.scrollTop;
      // 元素left最小值 = 元素距离页面左侧的距离 + 页面横向滚动的距离
      var leftPosMin = -this.wOffset + scrollContainer.scrollLeft;
      // 元素left最大值 = 页面可视区域宽度 - 元素宽度 - 元素距离页面顶部的距离 + 页面横向滚动的距离
      var leftPosMax = document.documentElement.clientWidth - clientRect.width - this.wOffset + scrollContainer.scrollLeft;
      if (this.yon) {
        var nextPosY = this.yPos + this.step;
        if (nextPosY > topPosMax) {
          this.yPos = topPosMax;
          this.yon = false;
        } else {
          this.yPos = nextPosY;
        }
      } else {
        var _nextPosY = this.yPos - this.step;
        if (_nextPosY < topPosMin) {
          this.yPos = topPosMin;
          this.yon = true;
        } else {
          this.yPos = _nextPosY;
        }
      }
      if (this.xon) {
        var nextPosX = this.xPos + this.step;
        if (nextPosX > leftPosMax) {
          this.xPos = leftPosMax;
          this.xon = false;
        } else {
          this.xPos = nextPosX;
        }
      } else {
        var _nextPosX = this.xPos - this.step;
        if (_nextPosX < leftPosMin) {
          this.xPos = leftPosMin;
          this.xon = true;
        } else {
          this.xPos = _nextPosX;
        }
      }
    },
    clearFdAd: function clearFdAd() {
      if (this.interval) {
        window.clearInterval(this.interval);
        this.interval = null;
      }
    },
    starFdAd: function starFdAd() {
      if (!this.interval && this.step) {
        this.interval = window.setInterval(this.changePos, this.delay);
      }
    },
    hrefTo: function hrefTo(row) {
      var _this3 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee() {
        var path;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              if (!(_this3.mode === 'update')) {
                _context.next = 2;
                break;
              }
              return _context.abrupt("return");
            case 2:
              if (row.jumpType === 2) {
                row.skipMode === 1 ? window.open(row.url) : window.location.href = row.url;
              } else if (row.jumpType === 1) {
                path = "".concat(_this3.routerBase, "/portal/homepage?columnId=").concat(row.jumpColumn); // row.skipMode === 1
                //   ? window.open(`${window.location.origin}${window.location.hash ? '/#' : ''}${path}`)
                //   : this.$router.push(path)
                window.open("".concat(window.location.origin).concat(window.location.hash ? '/#' : '').concat(path));
              }
            case 3:
            case "end":
              return _context.stop();
          }
        }, _callee);
      }))();
    },
    getTableData: function getTableData(id, pageSize) {
      var _this4 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee2() {
        var param, _yield$addRequestQueu, _yield$addRequestQueu2, err, res;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee2$(_context2) {
          while (1) switch (_context2.prev = _context2.next) {
            case 0:
              param = {
                columnId: id,
                isShow: true
              };
              _context2.next = 3;
              return Object(RequestQueue["a" /* default */])(function () {
                return columnTableApi.getBinnerColumnTable(1, pageSize, param);
              });
            case 3:
              _yield$addRequestQueu = _context2.sent;
              _yield$addRequestQueu2 = Object(slicedToArray["a" /* default */])(_yield$addRequestQueu, 2);
              err = _yield$addRequestQueu2[0];
              res = _yield$addRequestQueu2[1];
              if (!err && res) {
                _this4.hrefList = [];
                _.map(res.items, function (it) {
                  it.isShow === true ? _this4.hrefList.push(it) : '';
                });
              }
            case 8:
            case "end":
              return _context2.stop();
          }
        }, _callee2);
      }))();
    },
    filterHeight: function filterHeight() {
      var str = '';
      if (this.data.layout === 'vertical') {
        this.hrefList.length > 1 ? str = "h-1/".concat(this.hrefList.length) : str = 'h-full';
      } else {
        str = 'h-full';
      }
      return str;
    }
  }
});
// CONCATENATED MODULE: ./src/components/portal/BayWindow.vue?vue&type=script&lang=js
 /* harmony default export */ var portal_BayWindowvue_type_script_lang_js = (BayWindowvue_type_script_lang_js); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("2877");

// CONCATENATED MODULE: ./src/components/portal/BayWindow.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  portal_BayWindowvue_type_script_lang_js,
  render,
  staticRenderFns,
  false,
  null,
  "7e0a03ec",
  null
  
)

/* harmony default export */ var BayWindow = __webpack_exports__["default"] = (component.exports);

/***/ })

}]);
//# sourceMappingURL=portal-homepage-nanhai.umd.45.js.map