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

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

module.exports = __webpack_require__.p + "img/avatar0.97b89416.png";

/***/ }),

/***/ "1ce5":
/***/ (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/modules/portal-homepage/components/Header.vue?vue&type=template&id=01fab7e9&scoped=true
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"h-60px flex justify-between items-center w-$portalContainerWidth mx-auto"},[_c('div',{staticClass:"pl-20px"},[_c('img',{staticClass:"h-30px cursor-pointer",attrs:{"src":_vm.getLogo(),"alt":""},on:{"click":function($event){return _vm.$router.push((_vm.routerBase + "/portal/homepage"))}}})]),_c('div',{staticClass:"flex items-center"},[_vm._l((_vm.navigation),function(item,index){return [(item.url.startsWith('http') || _vm.userInfo)?_c('div',{key:index,staticClass:"text-14px font-bold h-14px flex items-center"},[_c('span',{staticClass:"mx-16px cursor-pointer",on:{"click":function($event){return _vm.jump(item)}}},[_vm._v(_vm._s(item.name))]),(index !== _vm.navigation.length - 1)?_c('span',{staticClass:"w-2px h-full bg-$portalPrimaryColor rounded-1px"}):_vm._e()]):_vm._e()]}),(!_vm.userInfo)?_c('div',{staticClass:"mr-20px"},[_c('span',{staticClass:"w-2px h-full bg-$portalPrimaryColor rounded-1px inline-block h-14px mr-14px"}),_c('el-button',{attrs:{"type":"primary","size":"small"},on:{"click":_vm.toLogin}},[_vm._v(" 统一登录 ")])],1):_vm._e(),_c('el-input',{staticClass:"w-180px focus:border-$portalPrimaryColor",attrs:{"placeholder":"请输入关键字搜索","prefix-icon":"el-icon-search","clearable":""},on:{"input":_vm.search},model:{value:(_vm.keyWord),callback:function ($$v) {_vm.keyWord=$$v},expression:"keyWord"}}),(_vm.userInfo)?_c('div',{staticClass:"relative mr-20px ml-20px",on:{"click":function($event){return _vm.$router.push((_vm.routerBase + "/portal/workbench"))}}},[(_vm.haveTodo)?_c('div',{staticClass:"bg-$portalPrimaryColor w-6px h-6px rounded-1/2 absolute right-0"}):_vm._e(),_c('img',{staticClass:"cursor-pointer w-20px h-20px max-w-none",attrs:{"src":__webpack_require__("8461"),"alt":""}})]):_vm._e(),(_vm.userInfo)?_c('img',{staticClass:"mr-3px h-28px w-28px rounded-1/2",attrs:{"src":_vm.userPic,"alt":""}}):_vm._e(),(_vm.userInfo)?_c('el-dropdown',{staticClass:"overflow-visible"},[_c('div',{staticClass:"flex items-center text-hex-333"},[_c('span',{staticClass:"el-dropdown-link inline-block max-w-55px truncate"},[_vm._v("\n          "+_vm._s(_vm.userInfo.profile.given_name)+"\n        ")]),_c('i',{staticClass:"el-icon-caret-bottom"})]),_c('el-dropdown-menu',{attrs:{"slot":"dropdown"},slot:"dropdown"},[_c('el-dropdown-item',{attrs:{"command":"1"},nativeOn:{"click":function($event){return _vm.toBackground('/system-management/personal-center')}}},[_vm._v("个人中心")]),_c('el-dropdown-item',{attrs:{"command":"2"},nativeOn:{"click":function($event){return _vm.toBackground('/portal-management/information-publish/column-publish-application')}}},[_vm._v("门户管理")]),_c('el-dropdown-item',{attrs:{"command":"3"},nativeOn:{"click":function($event){return _vm.logout($event)}}},[_vm._v("退出登录")])],1)],1):_vm._e()],2)])}
var staticRenderFns = []


// CONCATENATED MODULE: ./src/modules/portal-homepage/components/Header.vue?vue&type=template&id=01fab7e9&scoped=true

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

// 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/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.push.js
var es_array_push = __webpack_require__("14d9");

// 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/es.regexp.exec.js
var es_regexp_exec = __webpack_require__("ac1f");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.replace.js
var es_string_replace = __webpack_require__("5319");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.starts-with.js
var es_string_starts_with = __webpack_require__("2ca0");

// 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/modules/portal-homepage/components/Header.vue?vue&type=script&lang=js









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


var config = Wiz.globalSettings.dynamicModules.modules['portal-homepage-nanhai'].config;
var columnTableSearchApi = new workbench_umd["ColumnTableSearchApi"]();
/* harmony default export */ var Headervue_type_script_lang_js = ({
  name: 'portalHeader',
  components: {},
  props: {
    logo: {
      type: String,
      default: ''
    }
  },
  data: function data() {
    return {
      keyWord: '',
      navigation: config.navigation || [],
      userInfo: null,
      haveTodo: false
    };
  },
  watch: {},
  methods: {
    search: function search(value) {
      this.$router.push({
        path: "".concat(this.routerBase, "/portal/search"),
        query: {
          text: value
        }
      });
    },
    toLogin: function toLogin() {
      // 退出登录还原默认icon title
      document.querySelector("link[rel='icon']").href = __webpack_require__("91fb");
      document.title = 'Wiz Saas';
      if (window.__POWERED_BY_QIANKUN__) {
        this.$router.push({
          path: '/login',
          query: {
            redirect: this.$route.fullPath
          }
        });
      } else if (config !== null && config !== void 0 && config.fromDiyCode) {
        var _Wiz$globalSettings, _Wiz$globalSettings$g;
        window.location.href = "".concat((_Wiz$globalSettings = Wiz.globalSettings) === null || _Wiz$globalSettings === void 0 ? void 0 : (_Wiz$globalSettings$g = _Wiz$globalSettings.globalConfig) === null || _Wiz$globalSettings$g === void 0 ? void 0 : _Wiz$globalSettings$g.diyCodePage, "/#/login?returnUrl=").concat(encodeURIComponent(window.location.href));
      } else {
        var _Wiz$globalSettings2, _Wiz$globalSettings2$;
        this.$router.push({
          path: (_Wiz$globalSettings2 = Wiz.globalSettings) === null || _Wiz$globalSettings2 === void 0 ? void 0 : (_Wiz$globalSettings2$ = _Wiz$globalSettings2.auth) === null || _Wiz$globalSettings2$ === void 0 ? void 0 : _Wiz$globalSettings2$.defaultLoginPath,
          query: {
            returnUrl: this.$route.fullPath
          }
        });
      }
    },
    jump: function jump(item) {
      var url = item.url;
      // 变量替换
      if (item.url.indexOf('{token}') > -1) {
        var _this$userInfo;
        // if (!this.userInfo) {
        //   this.toLogin()
        //   return
        // }
        url = item.url.replace('{token}', (_this$userInfo = this.userInfo) === null || _this$userInfo === void 0 ? void 0 : _this$userInfo.access_token);
      }
      // 当前项目模块
      if (item.url.startsWith(window.location.origin)) {
        if (!this.userInfo) {
          var _Wiz$globalSettings3, _Wiz$globalSettings3$;
          // 跳转登录再做重定向
          window.open("".concat((_Wiz$globalSettings3 = Wiz.globalSettings) === null || _Wiz$globalSettings3 === void 0 ? void 0 : (_Wiz$globalSettings3$ = _Wiz$globalSettings3.globalConfig) === null || _Wiz$globalSettings3$ === void 0 ? void 0 : _Wiz$globalSettings3$.diyCodePage, "/#/login?returnUrl=").concat(item.url.replace(window.location.origin, '')));
          return;
        }
      }
      if (item.url.startsWith('http')) {
        window.open(url);
      } else {
        this.$router.push("".concat(this.routerBase).concat(url));
      }
    },
    toBackground: function toBackground(path) {
      if (config !== null && config !== void 0 && config.fromDiyCode) {
        var _Wiz$globalSettings4, _Wiz$globalSettings4$;
        var routerBase = "/".concat(_.get(Wiz, 'globalSettings.globalConfig.routerBase'));
        window.location.href = "".concat((_Wiz$globalSettings4 = Wiz.globalSettings) === null || _Wiz$globalSettings4 === void 0 ? void 0 : (_Wiz$globalSettings4$ = _Wiz$globalSettings4.globalConfig) === null || _Wiz$globalSettings4$ === void 0 ? void 0 : _Wiz$globalSettings4$.diyCodePage, "/#").concat(routerBase).concat(path);
      } else {
        this.$router.push("".concat(this.routerBase).concat(path));
      }
    },
    logout: function logout() {
      var _this = this;
      var currentTheme = this.$store.getters['System/currentTheme'];
      var accountInfo = localStorage.getItem('accountInfo');
      localStorage.clear();
      var vuexModules = ['Auth', 'System', 'Abp', 'Sites'];
      vuexModules.forEach(function (item) {
        _this.$store.commit("".concat(item, "/resetState"));
      });
      // 退出清空缓存后设置当前主题缓存 保证登录页主题显示正常
      this.$store.dispatch('System/currentTheme', currentTheme);
      if (accountInfo) {
        localStorage.setItem('accountInfo', accountInfo);
      }
      this.userInfo = null;
      this.$router.replace('/portal/homepage');
    },
    getLogo: function getLogo() {
      if (!this.logo) {
        return '';
      }
      return "".concat(this.fileUrl, "public/image/").concat(this.logo);
    },
    getTodo: function getTodo() {
      var _this2 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee() {
        var _yield$columnTableSea, _yield$columnTableSea2, err, res;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              _context.next = 2;
              return columnTableSearchApi.getTodoColumnTable(1, 1, {
                title: '',
                isCompeleted: false
              });
            case 2:
              _yield$columnTableSea = _context.sent;
              _yield$columnTableSea2 = Object(slicedToArray["a" /* default */])(_yield$columnTableSea, 2);
              err = _yield$columnTableSea2[0];
              res = _yield$columnTableSea2[1];
              if (!err) {
                _this2.haveTodo = res.items.length > 0;
              }
            case 7:
            case "end":
              return _context.stop();
          }
        }, _callee);
      }))();
    }
  },
  created: function created() {},
  mounted: function mounted() {
    var _this3 = this;
    return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee2() {
      return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee2$(_context2) {
        while (1) switch (_context2.prev = _context2.next) {
          case 0:
            _this3.userInfo = Wiz.AuthHooks.GetUserInfo();
            if (_this3.userInfo) {
              _this3.getTodo();
            }
          case 2:
          case "end":
            return _context2.stop();
        }
      }, _callee2);
    }))();
  },
  computed: {
    routerBase: function routerBase() {
      if (window.__POWERED_BY_QIANKUN__) {
        return "/".concat(_.get(Wiz, 'globalSettings.globalConfig.routerBase'));
      }
      return '';
    },
    fileUrl: function fileUrl() {
      var fileServer = Wiz.GetModuleServer('file-management');
      return "".concat(fileServer, "/api/file-management/files/");
    },
    AvatarUrl: function AvatarUrl() {
      if (window.__POWERED_BY_QIANKUN__ || config !== null && config !== void 0 && config.fromDiyCode) {
        return _.get(Wiz, 'globalSettings.globalConfig.diyCodeMediaServer');
      }
      return this.fileUrl;
    },
    userPic: function userPic() {
      var _this$userInfo2, _this$userInfo2$profi, _this$userInfo3, _this$userInfo3$profi;
      var avatar = (_this$userInfo2 = this.userInfo) === null || _this$userInfo2 === void 0 ? void 0 : (_this$userInfo2$profi = _this$userInfo2.profile) === null || _this$userInfo2$profi === void 0 ? void 0 : _this$userInfo2$profi.avatar;
      if (avatar) {
        return "".concat(this.AvatarUrl).concat(avatar);
      }
      var gender = ((_this$userInfo3 = this.userInfo) === null || _this$userInfo3 === void 0 ? void 0 : (_this$userInfo3$profi = _this$userInfo3.profile) === null || _this$userInfo3$profi === void 0 ? void 0 : _this$userInfo3$profi.gender) || '1';
      return __webpack_require__("414d")("./avatar".concat(gender, ".png"));
    }
  }
});
// CONCATENATED MODULE: ./src/modules/portal-homepage/components/Header.vue?vue&type=script&lang=js
 /* harmony default export */ var components_Headervue_type_script_lang_js = (Headervue_type_script_lang_js); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("2877");

// CONCATENATED MODULE: ./src/modules/portal-homepage/components/Header.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  components_Headervue_type_script_lang_js,
  render,
  staticRenderFns,
  false,
  null,
  "01fab7e9",
  null
  
)

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

/***/ }),

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

"use strict";

var $ = __webpack_require__("23e7");
var uncurryThis = __webpack_require__("4625");
var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
var toLength = __webpack_require__("50c4");
var toString = __webpack_require__("577e");
var notARegExp = __webpack_require__("5a34");
var requireObjectCoercible = __webpack_require__("1d80");
var correctIsRegExpLogic = __webpack_require__("ab13");
var IS_PURE = __webpack_require__("c430");

var stringSlice = uncurryThis(''.slice);
var min = Math.min;

var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');
// https://github.com/zloirock/core-js/pull/702
var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {
  var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith');
  return descriptor && !descriptor.writable;
}();

// `String.prototype.startsWith` method
// https://tc39.es/ecma262/#sec-string.prototype.startswith
$({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
  startsWith: function startsWith(searchString /* , position = 0 */) {
    var that = toString(requireObjectCoercible(this));
    notARegExp(searchString);
    var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));
    var search = toString(searchString);
    return stringSlice(that, index, index + search.length) === search;
  }
});


/***/ }),

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

var map = {
	"./avatar0.png": "0cd1",
	"./avatar1.png": "512d"
};


function webpackContext(req) {
	var id = webpackContextResolve(req);
	return __webpack_require__(id);
}
function webpackContextResolve(req) {
	if(!__webpack_require__.o(map, req)) {
		var e = new Error("Cannot find module '" + req + "'");
		e.code = 'MODULE_NOT_FOUND';
		throw e;
	}
	return map[req];
}
webpackContext.keys = function webpackContextKeys() {
	return Object.keys(map);
};
webpackContext.resolve = webpackContextResolve;
module.exports = webpackContext;
webpackContext.id = "414d";

/***/ }),

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

"use strict";

var isObject = __webpack_require__("861d");
var classof = __webpack_require__("c6b6");
var wellKnownSymbol = __webpack_require__("b622");

var MATCH = wellKnownSymbol('match');

// `IsRegExp` abstract operation
// https://tc39.es/ecma262/#sec-isregexp
module.exports = function (it) {
  var isRegExp;
  return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) === 'RegExp');
};


/***/ }),

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

module.exports = __webpack_require__.p + "img/avatar1.b2f4957a.png";

/***/ }),

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

"use strict";

var isRegExp = __webpack_require__("44e7");

var $TypeError = TypeError;

module.exports = function (it) {
  if (isRegExp(it)) {
    throw new $TypeError("The method doesn't accept regular expressions");
  } return it;
};


/***/ }),

/***/ "8461":
/***/ (function(module, exports) {

module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADRSURBVHgB7ZTNEYIwEIWfPwdvUgIlUEI6kRLsAEuwA+nAEsAOtAI9etOjN92dPGYQh7BRjn4zb2ZJXkJ+NguMzMTgSUUZ44voiC9xokr0FN0ojc/si6Lg4C1X2KBxyb4CRjIOWAc8OT0OBnSbO4OvpDdIwj9nGMbRm1hMVj62PcXI/Cd8S2ILd9EyZNBnZcnBhg06uThvxTn8CtOISTUHHVVrw6xjWMBvw8oDvvocRFfLgL1o1fp2bOtl6JZP8G+2KV8V23qxFliVnleNuCP5nRenNCszlc8MAQAAAABJRU5ErkJggg=="

/***/ }),

/***/ "91fb":
/***/ (function(module, exports) {

module.exports = "data:image/png;base64, "

/***/ }),

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

"use strict";

var wellKnownSymbol = __webpack_require__("b622");

var MATCH = wellKnownSymbol('match');

module.exports = function (METHOD_NAME) {
  var regexp = /./;
  try {
    '/./'[METHOD_NAME](regexp);
  } catch (error1) {
    try {
      regexp[MATCH] = false;
      return '/./'[METHOD_NAME](regexp);
    } catch (error2) { /* empty */ }
  } return false;
};


/***/ })

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