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

/***/ "0aea":
/***/ (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/NavigationBar.vue?vue&type=template&id=0fe7b98a&scoped=true
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"relative h-full",on:{"mouseleave":_vm.mouseleave}},[_c('div',{ref:"nav",staticClass:"flex h-full bg-hex-$portalPrimaryColor text-hex-$portalPrimaryTextColor  font-400 text-18px w-full"},_vm._l((_vm.navList),function(item,index){return _c('div',{key:index,staticClass:"flex-1 cursor-pointer h-full text-center leading-50px"},[_c('span',{staticClass:"relative",class:{
          active: _vm.currentNav === item.id,
        },attrs:{"title":item.name},on:{"click":function($event){return _vm.navbarClick(item)},"mouseenter":function($event){return _vm.mouseenter(item, index)}}},[_vm._v("\n        "+_vm._s(item.name)+"\n      ")])])}),0),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.subNavbarVisible),expression:"subNavbarVisible"}],ref:"subNav",staticClass:"absolute top-48px z-2 w-full font-400 text-16px border-b-1px border-x-1px border-hex-e6e6e6 text-hex-333 bg-hex-fff"},[_c('div',{staticClass:"w-full h-full pt-20px leading-20px overflow-hidden flex flex-wrap"},_vm._l((_vm.subNavbarChildren),function(child,index){return _c('div',{key:index,staticClass:"!w-1/4 h-full px-20px pb-20px font-700 text-16px text-center cursor-pointer sub-nav-item",class:{
          'text-hex-$portalPrimaryColor': _vm.subNavbar === child.id,
        },attrs:{"title":child.name},on:{"click":function($event){return _vm.subNavbarClick(child)}}},[_vm._v("\n        "+_vm._s(child.name)+"\n      ")])}),0)])])}
var staticRenderFns = []


// CONCATENATED MODULE: ./src/components/portal/NavigationBar.vue?vue&type=template&id=0fe7b98a&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.find.js
var es_array_find = __webpack_require__("7db0");

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

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.slice.js
var es_array_slice = __webpack_require__("fb6a");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
var es_object_to_string = __webpack_require__("d3b7");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.for-each.js
var web_dom_collections_for_each = __webpack_require__("159b");

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

// 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/NavigationBar.vue?vue&type=script&lang=js









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


var columnApi = new workbench_umd["ColumApi"]();
/* harmony default export */ var NavigationBarvue_type_script_lang_js = ({
  props: {
    data: {
      type: Object,
      default: function _default() {
        return {};
      }
    },
    mode: {
      type: String,
      default: 'view'
    }
  },
  data: function data() {
    return {
      subNavbarVisible: false,
      // 二级导航栏菜单box, 显示二级菜单的
      navbar: {},
      subNavbarChildren: [],
      subNavbar: {},
      // 当前二级菜单子项
      columnData: [],
      currentNav: '',
      translateX: 0,
      navList: []
    };
  },
  computed: {
    // navList() {
    //   if (!this.data?.columnIds) return []
    //   const list = []
    //   _.forEach(this.data.columnIds, (item) => {
    //     const column = _.find(this.columnData, { id: item })
    //     if (column) {
    //       list.push(column)
    //     }
    //   })
    //   return list
    // },
    columnId: function columnId() {
      return this.$route.query.columnId;
    },
    routerBase: function routerBase() {
      if (window.__POWERED_BY_QIANKUN__) {
        return "/".concat(_.get(Wiz, 'globalSettings.globalConfig.routerBase'));
      }
      return '';
    }
  },
  watch: {
    data: {
      deep: true,
      immediate: true,
      handler: function handler(val, oldVal) {
        var _this = this;
        return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee() {
          return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee$(_context) {
            while (1) switch (_context.prev = _context.next) {
              case 0:
                if (_.isEqual(val === null || val === void 0 ? void 0 : val.columnIds, oldVal === null || oldVal === void 0 ? void 0 : oldVal.columnIds)) {
                  _context.next = 4;
                  break;
                }
                _context.next = 3;
                return _this.getNavList();
              case 3:
                _this.navList = _context.sent;
              case 4:
              case "end":
                return _context.stop();
            }
          }, _callee);
        }))();
      }
    },
    columnId: {
      immediate: true,
      handler: function handler(val) {
        this.currentNav = val;
      }
    }
  },
  methods: {
    getNavList: function getNavList() {
      var _this2 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee2() {
        var _this2$data;
        var list;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee2$(_context2) {
          while (1) switch (_context2.prev = _context2.next) {
            case 0:
              if (!(_this2.columnData.length === 0)) {
                _context2.next = 3;
                break;
              }
              _context2.next = 3;
              return _this2.getColumnData();
            case 3:
              if ((_this2$data = _this2.data) !== null && _this2$data !== void 0 && _this2$data.columnIds) {
                _context2.next = 5;
                break;
              }
              return _context2.abrupt("return", []);
            case 5:
              list = [];
              _.forEach(_this2.data.columnIds, function (item) {
                var column = _.find(_this2.columnData, {
                  id: item
                });
                if (column) {
                  list.push(column);
                }
              });
              return _context2.abrupt("return", list);
            case 8:
            case "end":
              return _context2.stop();
          }
        }, _callee2);
      }))();
    },
    mouseenter: function mouseenter(navbar, index) {
      this.navbar = navbar;
      if (navbar.child) {
        this.subNavbarChildren = navbar.child.slice(0, 9);
        this.subNavbarVisible = true;
        // 存在children 才显示一级标题和二级标题
        // this.$nextTick(() => {
        //   const subNavWidth = this.$refs.subNav.offsetWidth
        //   const subItemWidth = subNavWidth / 9
        //   const navWidth = this.$refs.nav.offsetWidth
        //   const navItemWidth = navWidth / this.navList.length
        //   const subWidth = subItemWidth * this.subNavbarChildren.length
        //   const offsetWidth = navItemWidth * index - subWidth / 2 + navItemWidth / 2
        //   if (offsetWidth < 0) {
        //     this.translateX = 0
        //   } else if (subWidth + offsetWidth > subNavWidth) {
        //     this.translateX = subNavWidth - subWidth
        //   } else {
        //     this.translateX = offsetWidth
        //   }
        // })
        return;
      }
      this.subNavbarVisible = false;
      this.subNavbarChildren = [];
    },
    mouseleave: function mouseleave() {
      this.subNavbarVisible = false;
    },
    // 一级navbar-click
    navbarClick: function navbarClick(navbar) {
      if (this.mode === 'update' || !navbar.existPage) return;
      this.currentNav = navbar.id;
      // this.$router.push({
      //   path: '/portal/homepage',
      //   query: {
      //     columnId: navbar.id,
      //   },
      // })
      window.open("".concat(window.location.origin).concat(window.location.hash ? '/#' : '').concat(this.routerBase, "/portal/homepage?columnId=").concat(navbar.id));
    },
    // 二级sub-navbar-click
    subNavbarClick: function subNavbarClick(subNavbar) {
      if (this.mode === 'update' || !subNavbar.existPage) return;
      this.subNavbar = subNavbar.id;
      // this.$router.push({
      //   path: '/portal/homepage',
      //   query: {
      //     columnId: subNavbar.id,
      //   },
      // })
      window.open("".concat(window.location.origin).concat(window.location.hash ? '/#' : '').concat(this.routerBase, "/portal/homepage?columnId=").concat(subNavbar.id));
    },
    getColumnData: function getColumnData() {
      var _this3 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee3() {
        var _yield$columnApi$tree, _yield$columnApi$tree2, err, res;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee3$(_context3) {
          while (1) switch (_context3.prev = _context3.next) {
            case 0:
              _context3.next = 2;
              return columnApi.tree(0, {
                isExistPage: true
              });
            case 2:
              _yield$columnApi$tree = _context3.sent;
              _yield$columnApi$tree2 = Object(slicedToArray["a" /* default */])(_yield$columnApi$tree, 2);
              err = _yield$columnApi$tree2[0];
              res = _yield$columnApi$tree2[1];
              if (!err) {
                _this3.columnData = res;
              }
            case 7:
            case "end":
              return _context3.stop();
          }
        }, _callee3);
      }))();
    }
  }
});
// CONCATENATED MODULE: ./src/components/portal/NavigationBar.vue?vue&type=script&lang=js
 /* harmony default export */ var portal_NavigationBarvue_type_script_lang_js = (NavigationBarvue_type_script_lang_js); 
// EXTERNAL MODULE: ./src/components/portal/NavigationBar.vue?vue&type=style&index=0&id=0fe7b98a&prod&scoped=true&lang=scss
var NavigationBarvue_type_style_index_0_id_0fe7b98a_prod_scoped_true_lang_scss = __webpack_require__("2d52");

// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("2877");

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






/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  portal_NavigationBarvue_type_script_lang_js,
  render,
  staticRenderFns,
  false,
  null,
  "0fe7b98a",
  null
  
)

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

/***/ }),

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

"use strict";
/* harmony import */ var _node_modules_windicss_webpack_plugin_dist_loaders_windicss_style_pitcher_cjs_node_modules_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_windicss_webpack_plugin_dist_loaders_windicss_template_cjs_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_NavigationBar_vue_vue_type_style_index_0_id_0fe7b98a_prod_scoped_true_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cbc2");
/* harmony import */ var _node_modules_windicss_webpack_plugin_dist_loaders_windicss_style_pitcher_cjs_node_modules_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_windicss_webpack_plugin_dist_loaders_windicss_template_cjs_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_NavigationBar_vue_vue_type_style_index_0_id_0fe7b98a_prod_scoped_true_lang_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_windicss_webpack_plugin_dist_loaders_windicss_style_pitcher_cjs_node_modules_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_windicss_webpack_plugin_dist_loaders_windicss_template_cjs_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_NavigationBar_vue_vue_type_style_index_0_id_0fe7b98a_prod_scoped_true_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
/* unused harmony reexport * */


/***/ }),

/***/ "7db0":
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $ = __webpack_require__("23e7");
var $find = __webpack_require__("b727").find;
var addToUnscopables = __webpack_require__("44d2");

var FIND = 'find';
var SKIPS_HOLES = true;

// Shouldn't skip holes
// eslint-disable-next-line es/no-array-prototype-find -- testing
if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });

// `Array.prototype.find` method
// https://tc39.es/ecma262/#sec-array.prototype.find
$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  find: function find(callbackfn /* , that = undefined */) {
    return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  }
});

// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
addToUnscopables(FIND);


/***/ }),

/***/ "c0ee":
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__("2350")(false);
// imports


// module
exports.push([module.i, ".active[data-v-0fe7b98a]{font-weight:700}.active[data-v-0fe7b98a]:before{content:\"\";position:absolute;width:100%;height:3px;background-color:var(--portalPrimaryTextColor);bottom:-7px}.sub-nav-item[data-v-0fe7b98a]:hover{color:var(--portalPrimaryColor)}", ""]);

// exports


/***/ }),

/***/ "cbc2":
/***/ (function(module, exports, __webpack_require__) {

// style-loader: Adds some css to the DOM by adding a <style> tag

// load the styles
var content = __webpack_require__("c0ee");
if(content.__esModule) content = content.default;
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var add = __webpack_require__("499e").default
var update = add("238acfd3", content, true, {"sourceMap":false,"shadowMode":false});

/***/ })

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