{"remainingRequest":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/test-v5inweb-5.x-vue/src/views/Main.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/src/views/Main.vue","mtime":1739760944329},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/babel-loader/lib/index.js","mtime":315532800000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/vue-loader/lib/index.js","mtime":1655715099000}],"contextDependencies":[],"result":["\nimport main_appbar from \"@/components/main_appbar.vue\";\nimport main_navbar from \"@/components/main_navbar.vue\";\nimport main_content from \"@/components/main_content.vue\";\nimport main_domain from \"@/components/domain.vue\";\nimport Constant from \"@/Constant.js\";\nimport config from \"../../public/js/obpm.config.js\";\nimport API from \"@/api.js\";\nlet Base64 = require(\"js-base64\").Base64;\nconst statiContextPath = config.statiContextPath;\nconst signonContextPath = config.signonContextPath;\nexport default {\n name: \"mainpage\",\n provide() {\n return {\n addTab: this.addTab,\n };\n },\n components: {\n \"obpm-main-appbar\": main_appbar,\n main_navbar,\n main_content,\n main_domain,\n },\n computed: {\n applicationName() {\n return this.$store.getters.currentAppName;\n },\n showInstance() {\n return this.$store.state.isInstance;\n },\n },\n created() {\n this.getLock();\n window.setInterval(() => {\n setTimeout(this.getOnlineNumber, 0);\n }, 60000);\n\n let radomNum = new Date().getTime();\n this.$api.getMessage(radomNum, {\n onSucess: (res) => {\n this.notice = res.data.data.notice;\n },\n });\n this.$api.getDomainList({\n onSucess: (res) => {\n if (res.data.data.length) {\n // if(res.data.data[0].systemName){\n // document.title = res.data.data[0].systemName\n // }\n //当前企业域的domainId\n let domainId = this.$store.state.domainId;\n this.domainList = res.data.data;\n let data = res.data.data;\n //显示对应的企业域的systemName\n for (let i = 0; i < data.length; i++) {\n if (domainId === data[i].id) {\n document.title = data[i].systemName;\n break;\n }\n }\n if (res.data.data.length > 1) {\n this.isChangeDomain = true;\n }\n }\n },\n });\n this.$api.getNotificationNum({\n onSucess: (res) => {\n let otherNotice = res.data.data;\n let arr = [];\n for (let key in otherNotice) {\n let obj = {};\n if (otherNotice[key] > 0 && key != \"size\") {\n obj.type = key.toString();\n obj.value = otherNotice[key];\n arr.push(obj);\n }\n }\n this.otherNotice = arr;\n },\n });\n },\n\n data: function () {\n return {\n appid: \"km1\",\n tabs: [],\n password: \"\",\n isLock: \"false\",\n notice: 0,\n otherNotice: [],\n showMessagePopup: true,\n showMenu: true,\n Constant,\n updateMenu: \"\",\n updateMenuData: {},\n dialogVisible: false,\n domainDialogVisible: false,\n pwd: \"\",\n isPasswordError: \"\",\n isChangeDomain: false,\n domainList: [],\n nullPrompt: \"\",\n };\n },\n\n methods: {\n updateViewNumber(menuData) {\n this.updateMenuData = menuData;\n this.updateMenu = new Date().getTime();\n },\n\n hiddenMenu() {\n this.showMenu = !this.showMenu;\n this.$refs.mychild.setMaincontent(); // 调用子组件的方法\n },\n\n jumpToInfo(val) {\n this.showMessagePopup = false;\n this.addTab(val);\n },\n\n closeMessagePopup() {\n this.showMessagePopup = false;\n },\n\n signOut() {\n this.$api.LogOut({\n onSucess: (res) => {\n window.localStorage.clear();\n let statiContextPath = obpmConfig.statiContextPath;\n let signonContextPath = obpmConfig.signonContextPath;\n let url = \"\";\n if (statiContextPath) {\n //5.0 trunk\n url =\n window.location.origin +\n statiContextPath +\n signonContextPath +\n \"/index.html\";\n } else {\n //4.4 stable\n url = window.location.origin + signonContextPath + \"/index.html\";\n }\n window.location.href = url;\n },\n });\n },\n\n getLock() {\n let val = localStorage.getItem(\"screenLock\");\n if (val) {\n this.isLock = val;\n } else {\n this.isLock = \"false\";\n }\n },\n\n getOnlineNumber() {\n this.$api.getNotification({\n onSucess: (res) => {\n if (res.data.data.data && res.data.data.data.length > 0) {\n let data = res.data.data.data[0];\n this.$notify({\n title: \"\",\n dangerouslyUseHTMLString: true,\n message: \"你有一条新消息\",\n duration: 5000,\n customClass: \"fontclass\",\n });\n }\n },\n });\n },\n\n systemManagement() {\n let domainid = this.$store.state.domainId;\n let domainName; //企业域名称\n for (let i = 0; i < this.domainList.length; i++) {\n if (domainid === this.domainList[i].id) {\n domainName = this.domainList[i].name;\n }\n }\n let statiContextPath = obpmConfig.statiContextPath;\n let systemUrl = \"\";\n if (statiContextPath) {\n //5.0 trunk\n systemUrl =\n obpmConfig.statiContextPath +\n \"/domain/index.html#/domain?domainid=\" +\n domainid +\n \"&from=systemManagement\" +\n \"&name=\" +\n domainName; //&from=systemManagement让deisgner那边可以获取到标识\n } else {\n //4.4 stable\n systemUrl =\n obpmConfig.obpmFilePath +\n \"/domain/index.html#/domain?domainid=\" +\n domainid +\n \"&from=systemManagement\" +\n \"&name=\" +\n domainName;\n }\n window.open(systemUrl);\n },\n\n changeDomain() {\n this.domainDialogVisible = true;\n },\n\n //退出系统\n Actionquit() {\n API.LogOut({\n onSucess: (response) => {\n if (response.status == 200) {\n window.location = \"http://localhost:8080/signon/\";\n }\n },\n onError: (error) => {\n console.log(error);\n },\n });\n },\n\n hanleClickLogin() {\n let statiContextPath = obpmConfig.statiContextPath;\n let url = \"\";\n if (statiContextPath) {\n //5.0 trunk\n url = window.location.origin + statiContextPath + \"/signon/index.html\";\n } else {\n //4.4 stable\n url = window.location.origin + \"/signon/index.html\";\n }\n window.location.href = url;\n },\n\n hanleClick() {\n let cookie = document.cookie.split(\";\");\n let language, url, path;\n for (let i = 0; i < cookie.length; i++) {\n if (cookie[i].indexOf(\"USERLANGUAGE\") >= 0) {\n language = cookie[i].split(\"=\")[1];\n }\n }\n let str = Base64.encode(this.pwd);\n let userPwd;\n if (str.length > 2) {\n let lp = str.substr(0, 2);\n let rp = str.substr(2, str.length);\n userPwd = rp + lp;\n }\n let data = {\n username: this.$store.state.myProfile.loginNo,\n password: userPwd,\n remember: \"0\",\n debug: false,\n domainName: this.$store.state.myProfile.domainName,\n checkcode: \"\",\n language: language,\n url: url,\n path: path,\n };\n this.$api.signonLogin(data, {\n onSucess: (res) => {\n if (res.data.resultCode != 0) {\n //更新accessToken\n document.cookie = res.data.accessToken;\n localStorage.setItem(\"accessToken\", res.data.accessToken);\n this.pwd = \"\";\n this.dialogVisible = false;\n this.$message({\n message: this.$t(\"msg.login_ss\"),\n type: \"success\",\n });\n } else {\n this.$message.error(this.$t(\"msg.fail_login\"));\n }\n },\n });\n },\n\n //解除锁屏\n unlockScreen() {\n if (!this.password) {\n this.nullPrompt = this.$t(\"e_password\");\n this.isPasswordError = \"true\";\n setTimeout(() => {\n this.isPasswordError = \"\";\n }, 2000);\n } else {\n this.$api.isLock(this.password, {\n onSucess: (res) => {\n this.nullPrompt = \"\";\n if (res.data.data == true) {\n this.isLock = \"false\";\n localStorage.setItem(\"screenLock\", \"false\");\n } else {\n this.isLock = \"true\";\n this.isPasswordError = \"true\";\n setTimeout(() => {\n this.isPasswordError = \"\";\n }, 2000);\n }\n },\n });\n }\n //let val = localStorage.getItem('screenLock');\n },\n\n //一键锁频\n lockScreen() {\n this.password = \"\";\n this.isLock = \"true\";\n localStorage.setItem(\"screenLock\", \"true\");\n },\n\n changeMenu: function (appid) {\n this.appid = appid;\n },\n\n activeHome: function () {\n this.tabs.forEach(function (value) {\n value.active = false;\n });\n },\n\n addTab(param) {\n var flag = false;\n this.tabs.forEach(function (value) {\n if (value.id && value.id == param.id) {\n value.active = true;\n if (param.linkType == \"01\") {\n //视图\n value.randomNumber = param.randomNumber;\n }\n flag = flag || true;\n } else {\n value.active = false;\n }\n });\n\n if (flag) return;\n this.tabs.forEach(function (value) {\n value.active = false;\n });\n param.active = true;\n this.tabs.push(param);\n },\n\n closeAllTab() {\n this.tabs = [];\n },\n\n closeTab: function (tab, tabindex) {\n let tabs = this.tabs;\n if (tabindex >= 0) {\n //点击X关闭\n let currentIndex = \"\";\n let haveParentTab = tabs.some((item, index) => {\n if (item.id == tab.refreshId) {\n currentIndex = index;\n return true;\n }\n });\n if (haveParentTab) {\n tabs.splice(tabindex, 1);\n tabs.forEach((item) => {\n item.active = false;\n });\n tabs[currentIndex].active = true;\n } else {\n tabs.splice(tabindex, 1);\n if (tab.active) {\n if (tabs.length > 0 && tabs.length - 1 >= tabindex) {\n tabs[tabindex].active = true;\n } else if (tabs.length > 0 && tabs.length - 1 < tabindex) {\n if (tabindex > 0) {\n tabs[tabindex - 1].active = true;\n }\n }\n }\n }\n } else {\n //单击返回按钮\n let i = -1;\n tabs.forEach((value, index) => {\n if (\n (value.id && value.id == tab.id) ||\n (value._select && value._select == tab._select)\n ) {\n i = index;\n }\n });\n let currentIndex = \"\";\n let haveParentTab = tabs.some((item, index) => {\n if (item.id == tab.refreshId) {\n currentIndex = index;\n return true;\n }\n });\n if (haveParentTab) {\n tabs.splice(i, 1);\n tabs[currentIndex].active = true;\n } else {\n tabs.splice(i, 1);\n let act = tabs[i];\n if (act) {\n this.activeTab({ id: act._select ? act._select : act.id });\n } else if (i >= 1) {\n let act = this.tabs[i - 1];\n this.activeTab({ id: act._select ? act._select : act.id });\n } else {\n if (tabs.length > 0) {\n tabs[tabs.length - 1].active = true;\n }\n }\n }\n }\n },\n\n activeTab: function (tab, index) {\n if (index >= 0) {\n this.tabs.forEach((value, i) => {\n if (i == index) {\n value.active = true;\n } else {\n value.active = false;\n }\n });\n } else {\n this.tabs.forEach((value) => {\n if (\n (value.id && value.id == tab.id) ||\n (value._select && value._select == tab._select) ||\n (value._select && value._select == tab.id)\n ) {\n value.active = true;\n return;\n } else {\n value.active = false;\n }\n });\n }\n },\n },\n watch: {\n showInstance(val) {\n if (val) {\n this.dialogVisible = true;\n }\n },\n },\n};\n",null]}