{"remainingRequest":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\cssc-fvue\\src\\components\\layout\\Navigator.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\cssc-fvue\\src\\components\\layout\\Navigator.vue","mtime":1681441192473},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\cssc-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport HtAvatar from '@/components/common/HtAvatar.vue'\r\nimport { mapState } from 'vuex'\r\nimport { Base64 } from 'js-base64'\r\nimport req from '@/request.js'\r\nimport uc from '@/api/uc.js'\r\n\r\nexport default {\r\n name: 'navigator',\r\n components: { HtAvatar },\r\n props: ['menuShow', 'showTopMenu'],\r\n data() {\r\n var validateNew = (rule, value, callback) => {\r\n if (value === '') {\r\n callback(new Error('请输入新密码'))\r\n }\r\n let config = this.pwdStrategy\r\n if (config.enable == 1) {\r\n let pwdRule = config.pwdRule\r\n let pwdLength = config.pwdLength\r\n if (pwdRule) {\r\n if (value.length < pwdLength) {\r\n callback(new Error('新密码长度至少为' + pwdLength))\r\n } else if (pwdRule == 2) {\r\n var re = new RegExp('(?=.*[0-9])(?=.*[a-zA-Z])')\r\n if (!re.test(value)) {\r\n callback(new Error('新密码必须包含数字、字母'))\r\n } else {\r\n callback()\r\n }\r\n } else if (pwdRule == 3) {\r\n var re = new RegExp('(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9])')\r\n if (!re.test(value)) {\r\n callback(new Error('新密码必须包含数字、字母、特殊字符'))\r\n } else {\r\n callback()\r\n }\r\n } else if (pwdRule == 4) {\r\n var re = new RegExp(\r\n '(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[^a-zA-Z0-9])'\r\n )\r\n if (!re.test(value)) {\r\n callback(new Error('新密码必须包含数字、大小字母、特殊字符'))\r\n } else {\r\n callback()\r\n }\r\n } else {\r\n callback()\r\n }\r\n }\r\n } else {\r\n if (value.length < 6) {\r\n callback(new Error('新密码长度至少为6'))\r\n } else {\r\n callback()\r\n }\r\n }\r\n }\r\n var validateold = (rule, value, callback) => {\r\n if (value === '') {\r\n callback(new Error('请输入旧密码'))\r\n } else {\r\n callback()\r\n }\r\n }\r\n var validateNewReapeat = (rule, value, callback) => {\r\n if (value === '') {\r\n callback(new Error('请再次输入新密码'))\r\n } else {\r\n callback()\r\n }\r\n }\r\n return {\r\n messageList: [],\r\n messnum: '',\r\n logo: '',\r\n bizUrl: '',\r\n showLogo: true,\r\n styleSettingDialogVisible: false,\r\n styleSetting: {\r\n tabsStyle: {\r\n tabPosition: 'top',\r\n tabType: 'border-card'\r\n },\r\n elementUI: {\r\n theme: 'day-theme'\r\n }\r\n },\r\n searchWork: '',\r\n searchMenus: [],\r\n infoDialogVisible: false,\r\n modifyPwdDialogVisible: false,\r\n pwdForm: {\r\n old: '',\r\n new: '',\r\n newRepeat: ''\r\n },\r\n pwdRules: {\r\n old: [{ validator: validateold, trigger: 'blur' }],\r\n new: [{ validator: validateNew, trigger: 'blur' }],\r\n newRepeat: [{ validator: validateNewReapeat, trigger: 'blur' }]\r\n },\r\n isIeExplorer: false,\r\n sysPath: '',\r\n platName: '管理平台',\r\n frontMenus: [],\r\n currentMenu: '',\r\n companyName: ''\r\n }\r\n },\r\n created() {\r\n // this.getUnread()\r\n this.getBizUrl()\r\n let USER_AGENT = navigator.userAgent.toLowerCase()\r\n let isChrome = /.*(chrome)\\/([\\w.]+).*/\r\n if (!isChrome.test(USER_AGENT)) {\r\n this.isIeExplorer = true\r\n }\r\n const currentUser = this.$store.state.login.currentUser\r\n if ((!this.frontMenus || this.frontMenus.length == 0) && currentUser) {\r\n let this_ = this\r\n this.$store.dispatch('menu/actionFrontMenus').then(data => {\r\n this.frontMenus = data\r\n this.activePage()\r\n })\r\n }\r\n },\r\n mounted() {\r\n !this.currentUser && this.$store.dispatch('user/loadCurrentUserDetail')\r\n const currentUser = this.$store.state.login.currentUser\r\n if (currentUser) {\r\n let userAttrs = this.$store.state.login.currentUser.userAttrs\r\n if (userAttrs) {\r\n //租户\r\n const tenantId = userAttrs.tenantId\r\n if (tenantId) {\r\n let _this = this\r\n let url = '${uc}/uc/tenantManage/v1/getJson?id=' + tenantId\r\n this.$http.get(url).then(\r\n resp => {\r\n if (resp.data) {\r\n let tenantManage = resp.data\r\n tenantManage.nameFront\r\n ? (_this.platName = tenantManage.nameFront)\r\n : null\r\n this.companyName = tenantManage.nameFront\r\n if (tenantManage.frontLogo) {\r\n let frontLogo = JSON.parse(tenantManage.frontLogo)\r\n if (frontLogo && frontLogo.length > 0) {\r\n _this.showLogo = true\r\n // 附件上传请求\r\n // req\r\n // .get(\r\n // window.context.portal +\r\n // '/file/onlinePreviewController/v1/getFileById_' +\r\n // frontLogo[0].id,\r\n // 'arraybuffer'\r\n // )\r\n // .then(response => {\r\n // let type = response.headers['content-type']\r\n // if (type) {\r\n // _this.logo = window.URL.createObjectURL(\r\n // new Blob([response.data], {type: type})\r\n // )\r\n // } else {\r\n // _this.logo = window.URL.createObjectURL(\r\n // new Blob([response.data])\r\n // )\r\n // }\r\n // })\r\n }\r\n } else {\r\n _this.showLogo = false\r\n }\r\n }\r\n },\r\n error => {\r\n _this.showLogo = false\r\n reject(error)\r\n }\r\n )\r\n } else {\r\n //不是租户\r\n this.sysSetting()\r\n }\r\n } else {\r\n //不是租户\r\n this.sysSetting()\r\n }\r\n } else {\r\n //不是租户\r\n this.sysSetting()\r\n }\r\n },\r\n computed: {\r\n ...mapState({\r\n sysMenus: state => state.menu.sysMenus,\r\n currentUser: state => state.user.currentUserDetail,\r\n token: state => state.login.currentUser.token,\r\n frontUrl: function () {\r\n if (\r\n this.currentUser &&\r\n this.currentUser.user &&\r\n this.currentUser.user.account &&\r\n (!window.ssoConfig.mode || window.ssoConfig.mode == 'jwt')\r\n ) {\r\n return `${this.bizUrl}?token= ` + this.token\r\n } else {\r\n return this.bizUrl\r\n // return this.bizUrl ? this.bizUrl : `${window.context.front}`\r\n }\r\n },\r\n mobileUrl: function () {\r\n if (\r\n this.currentUser &&\r\n this.currentUser.user &&\r\n this.currentUser.user.account &&\r\n (!window.ssoConfig.mode || window.ssoConfig.mode == 'jwt')\r\n ) {\r\n return `${window.context.mobile}?token= ` + this.token\r\n } else {\r\n return `${window.context.mobile}`\r\n }\r\n },\r\n pwdStrategy: state => state.user.pwdStrategy,\r\n userType: function () {\r\n if (this.currentUser && this.currentUser.user) {\r\n return this.currentUser.user.userType\r\n }\r\n }\r\n })\r\n // currentMenu: {\r\n // get() {\r\n // return this.frontMenus[0].alias\r\n // },\r\n // set(newValue) {\r\n // this.changeMenu(newValue)\r\n // },\r\n // },\r\n },\r\n watch: {\r\n styleSetting: {\r\n handler: function (val, oldval) {\r\n let str = JSON.stringify(val)\r\n localStorage.setItem('styleSetting', str)\r\n this.$store.dispatch('styleSetting/actionStyleSetting', JSON.parse(str))\r\n },\r\n deep: true //对象内部的属性监听,也叫深度监听\r\n }\r\n },\r\n watch: {\r\n $route: 'activePage'\r\n },\r\n methods: {\r\n activePage() {\r\n let fullPath = this.$route.path\r\n let path = fullPath.split('/')\r\n let urlAnchor = path[path.indexOf('frontPlat') + 1]\r\n this.frontMenus.filter(item => {\r\n if (item.alias == urlAnchor) {\r\n this.currentMenu = urlAnchor\r\n }\r\n })\r\n },\r\n changeMenu(item) {\r\n this.currentMenu = item.alias\r\n this.$router.push('/frontPlat/' + item.alias)\r\n },\r\n // ----------------------\r\n goIndex() {\r\n this.$router.push({\r\n path: `/crewIndex`\r\n })\r\n },\r\n handleSysPlat() {\r\n if (!this.sysMenus.length) {\r\n this.$store.dispatch('menu/actionSysMenus').then(res => {\r\n if (res) {\r\n window.open(\r\n window.context.manage +\r\n // \"http://localhost:8081/mvue\"+\r\n '/sysplat/' +\r\n `${this.sysMenus[0].children[0].alias}` +\r\n '?token=' +\r\n this.token,\r\n '_blank'\r\n )\r\n }\r\n })\r\n } else {\r\n window.open(\r\n window.context.manage +\r\n // \"http://localhost:8081/mvue\"+\r\n '/sysplat/' +\r\n `${this.sysMenus[0].children[0].alias}` +\r\n '?token=' +\r\n this.token,\r\n '_blank'\r\n )\r\n }\r\n },\r\n readload(val) {\r\n this.getUnread()\r\n },\r\n getUnread() {\r\n uc.messagelist().then(res => {\r\n if (res && res.data && res.data.rows) {\r\n this.messageList = res.data.rows\r\n if (res.data.rows.length > 0) {\r\n this.messnum = res.data.rows.length\r\n } else {\r\n this.messnum = ''\r\n }\r\n }\r\n console.log(this.messageList)\r\n })\r\n },\r\n getBizUrl() {\r\n this.$http\r\n .get('${portal}/sys/sysProperties/v1/getByAlias?alias=biz.url', {\r\n responseType: 'text'\r\n })\r\n .then(res => {\r\n this.bizUrl = res.data\r\n })\r\n },\r\n showDrawer() {\r\n this.$refs.messageDrawer.drawer = true\r\n },\r\n\r\n submitForm() {\r\n let this_ = this\r\n this.$refs['pwdForm'].validate(valid => {\r\n if (valid) {\r\n this.$http\r\n .post('${uc}/api/user/v1/user/changUserPsd', {\r\n oldPwd: this.pwdForm.old,\r\n newPwd: this.pwdForm.new\r\n })\r\n .then(resp => {\r\n let data = resp.data\r\n if (data && data.state) {\r\n this.modifyPwdDialogVisible = false\r\n this.$alert('修改密码成功, 请使用新密码重新登录。', '提示', {\r\n confirmButtonText: '确定',\r\n callback: action => {\r\n //退出登录\r\n this_.logout()\r\n }\r\n })\r\n }\r\n })\r\n }\r\n })\r\n },\r\n openInfoDialog() {\r\n this.$router.push({\r\n path: '/frontPlat/personMenus/personInfo'\r\n })\r\n this.$refs.frontMenu.activeIndex = ''\r\n // this.infoDialogVisible = true\r\n },\r\n openResetPwdDialog() {\r\n this.$store.dispatch('user/getDefPwdStrategy')\r\n this.modifyPwdDialogVisible = true\r\n if (this.$refs['pwdForm']) {\r\n this.$refs['pwdForm'].resetFields()\r\n }\r\n },\r\n openPersonalCenter() {\r\n this.$router.push({\r\n path: '/frontPlat/PersonalInfo'\r\n })\r\n },\r\n handleMenuCollapse() {\r\n this.$bus.$emit('frontMenuShow', !this.menuShow)\r\n },\r\n logout() {\r\n this.$store.dispatch('menu/clearMenus')\r\n this.$store.dispatch('user/clearUser')\r\n this.$store.dispatch('menu/setCopyMenus', []) //菜单\r\n let loginRouthPath =\r\n localStorage.getItem(\r\n this.$store.state.login.currentUser.account + 'loginRoutePath'\r\n ) || '/login'\r\n this.$store.dispatch('login/logoutAndCleanUp').then(() => {\r\n switch (window.ssoConfig.mode) {\r\n case 'cas':\r\n case 'oauth':\r\n window.sessionStorage.removeItem('currentUser')\r\n window.location.href =\r\n window.ssoConfig.logout +\r\n '?service=' +\r\n window.location.href.split('?')[0]\r\n break\r\n default:\r\n this.$router.push({\r\n path: loginRouthPath\r\n })\r\n break\r\n }\r\n })\r\n },\r\n handleStyleSettingDialog() {\r\n let styleSetting = localStorage.getItem('styleSetting')\r\n if (styleSetting && styleSetting != 'null') {\r\n this.styleSetting = JSON.parse(styleSetting)\r\n }\r\n this.styleSettingDialogVisible = true\r\n },\r\n handleStyleSettingDialogClose() {\r\n this.styleSettingDialogVisible = false\r\n this.infoDialogVisible = false\r\n this.modifyPwdDialogVisible = false\r\n },\r\n querySearch(queryString, cb) {\r\n // 查询出二级三级的菜单\r\n let menus = []\r\n menus = [...this.menus]\r\n if (queryString) {\r\n this.searchMenus = []\r\n this.preFilterMenus(this.menus, queryString)\r\n } else {\r\n this.searchMenus = menus\r\n }\r\n // 调用 callback 返回建议列表的数据\r\n this.searchMenus = this.searchMenus.unique('alias')\r\n cb(this.searchMenus)\r\n },\r\n preFilterMenus(menus, queryString) {\r\n if (menus instanceof Array) {\r\n menus.forEach(x => {\r\n this.filterMenus(x, queryString)\r\n })\r\n } else {\r\n this.filterMenus(menus, queryString, true)\r\n }\r\n },\r\n filterMenus(x, queryString, isComponent) {\r\n if (x.children) {\r\n let r = x.children.filter(menu => {\r\n this.preFilterMenus(menu, queryString)\r\n return (\r\n menu.name.toLowerCase().indexOf(queryString.toLowerCase()) != -1 ||\r\n menu.alias.toLowerCase().indexOf(queryString.toLowerCase()) != -1\r\n )\r\n })\r\n if (r && r.length >= 1) {\r\n r.forEach(y => {\r\n if (isComponent) {\r\n y.parentComponent = x\r\n }\r\n this.searchMenus.push(y)\r\n })\r\n }\r\n }\r\n },\r\n handleSelect(item) {\r\n if (!item.parentComponent) {\r\n this.$router.push({ path: `/${item.alias}` })\r\n } else {\r\n this.$router.push({\r\n path: `/${item.parentComponent.alias}#${item.alias}`\r\n })\r\n }\r\n },\r\n //获取系统默认配置 系统Logo、名称\r\n sysSetting() {\r\n const _this = this\r\n let url =\r\n window.context.portal + '/sys/sysProperties/v1/getDecryptBySysSetting'\r\n _this.$http.get(url).then(response => {\r\n if (response && response.data && response.data.value) {\r\n let sysSettingData = JSON.parse(response.data.value)\r\n sysSettingData.nameFront\r\n ? (_this.platName = sysSettingData.nameFront)\r\n : null\r\n if (sysSettingData.frontLogo.length > 0) {\r\n let frontLogo = sysSettingData.frontLogo\r\n _this.showLogo = true\r\n req\r\n .get(\r\n window.context.portal +\r\n '/file/onlinePreviewController/v1/getFileById_' +\r\n frontLogo[0].id,\r\n 'arraybuffer'\r\n )\r\n .then(response => {\r\n let type = response.headers['content-type']\r\n if (type) {\r\n _this.logo = window.URL.createObjectURL(\r\n new Blob([response.data], { type: type })\r\n )\r\n } else {\r\n _this.logo = window.URL.createObjectURL(\r\n new Blob([response.data])\r\n )\r\n }\r\n })\r\n //_this.logo = window.context.portal + \"/file/v1/downloadFile?fileId=\" + manageLogo[0].id;\r\n } else {\r\n this.showLogo = false\r\n }\r\n } else {\r\n this.showLogo = false\r\n }\r\n })\r\n }\r\n }\r\n}\r\n",null]}