合并版本v0.8.3.1

This commit is contained in:
wuhongjian 2022-07-26 18:08:52 +08:00
commit 13622255f8
5 changed files with 159 additions and 157 deletions

View File

@ -100,25 +100,25 @@
</nav> </nav>
</template> </template>
<script> <script>
import { messages } from "@/i18n"; import { messages } from '@/i18n'
import screenfull from "screenfull"; import screenfull from 'screenfull'
import UpdatePassword from "./main-navbar-update-password"; import UpdatePassword from './main-navbar-update-password'
import { clearLoginInfo } from "@/utils"; import { clearLoginInfo } from '@/utils'
// import Cookies from 'js-cookie' // import Cookies from 'js-cookie'
// var socket = null // var socket = null
export default { export default {
inject: ["refresh"], inject: ['refresh'],
data() { data () {
return { return {
i18nMessages: messages, i18nMessages: messages,
updatePasswordVisible: false, updatePasswordVisible: false,
messageTip: false, messageTip: false
}; }
}, },
components: { components: {
UpdatePassword, UpdatePassword
}, },
created() { created () {
// var vue = this // var vue = this
// socket = new WebSocket(`${window.SITE_CONFIG['socketURL']}?token=${Cookies.get('token')}`) // socket = new WebSocket(`${window.SITE_CONFIG['socketURL']}?token=${Cookies.get('token')}`)
// socket.onopen = function () {} // socket.onopen = function () {}
@ -144,70 +144,70 @@ export default {
// } // }
// //
this.getUnReadCount(); this.getUnReadCount()
}, },
methods: { methods: {
myNoticeRouter() { myNoticeRouter () {
this.$router.replace("notice-notice-user"); this.$router.replace('notice-notice-user')
}, },
getUnReadCount() { getUnReadCount () {
this.$http this.$http
.get("/sys/notice/mynotice/unread") .get('/sys/notice/mynotice/unread')
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg); return this.$message.error(res.msg)
} }
if (res.data > 0) { if (res.data > 0) {
this.messageTip = true; this.messageTip = true
} }
}) })
.catch(() => {}); .catch(() => {})
}, },
// //
fullscreenHandle() { fullscreenHandle () {
if (!screenfull.enabled) { if (!screenfull.enabled) {
return this.$message({ return this.$message({
message: this.$t("fullscreen.prompt"), message: this.$t('fullscreen.prompt'),
type: "warning", type: 'warning',
duration: 500, duration: 500
}); })
} }
screenfull.toggle(); screenfull.toggle()
}, },
// //
updatePasswordHandle() { updatePasswordHandle () {
this.updatePasswordVisible = true; this.updatePasswordVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.updatePassword.init(); this.$refs.updatePassword.init()
}); })
}, },
// 退 // 退
logoutHandle() { logoutHandle () {
this.$confirm( this.$confirm(
this.$t("prompt.info", { handle: this.$t("logout") }), this.$t('prompt.info', { handle: this.$t('logout') }),
this.$t("prompt.title"), this.$t('prompt.title'),
{ {
confirmButtonText: this.$t("confirm"), confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t("cancel"), cancelButtonText: this.$t('cancel'),
type: "warning", type: 'warning'
} }
) )
.then(() => { .then(() => {
this.$http this.$http
.post("/logout") .post('/logout')
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg); return this.$message.error(res.msg)
} }
clearLoginInfo(); clearLoginInfo()
this.$router.push({ name: "login" }); this.$router.push({ name: 'login' })
}) })
.catch(() => {}); .catch(() => {})
}) })
.catch(() => {}); .catch(() => {})
}, }
}, }
}; }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@font-face { @font-face {

View File

@ -16,122 +16,122 @@
</template> </template>
<script> <script>
import MainNavbar from "./main-navbar"; import MainNavbar from './main-navbar'
import MainSidebar from "./main-sidebar"; import MainSidebar from './main-sidebar'
import MainContent from "./main-content"; import MainContent from './main-content'
import MainThemeTools from "./main-theme-tools"; import MainThemeTools from './main-theme-tools'
import debounce from "lodash/debounce"; import debounce from 'lodash/debounce'
import { isURL } from "@/utils/validate"; import { isURL } from '@/utils/validate'
export default { export default {
provide() { provide () {
return { return {
// //
refresh() { refresh () {
this.$store.state.contentIsNeedRefresh = true; this.$store.state.contentIsNeedRefresh = true
this.$nextTick(() => { this.$nextTick(() => {
this.$store.state.contentIsNeedRefresh = false; this.$store.state.contentIsNeedRefresh = false
}); })
}, }
}; }
}, },
data() { data () {
return { return {
loading: true, loading: true
}; }
}, },
components: { components: {
MainNavbar, MainNavbar,
MainSidebar, MainSidebar,
MainContent, MainContent,
MainThemeTools, MainThemeTools
}, },
watch: { watch: {
$route: "routeHandle", $route: 'routeHandle'
}, },
created() { created () {
this.windowResizeHandle(); this.windowResizeHandle()
this.routeHandle(this.$route); this.routeHandle(this.$route)
Promise.all([this.getUserInfo(), this.getPermissions()]).then(() => { Promise.all([this.getUserInfo(), this.getPermissions()]).then(() => {
this.loading = false; this.loading = false
}); })
}, },
methods: { methods: {
// //
windowResizeHandle() { windowResizeHandle () {
this.$store.state.sidebarFold = this.$store.state.sidebarFold =
document.documentElement["clientWidth"] <= 992 || false; document.documentElement.clientWidth <= 992 || false
window.addEventListener( window.addEventListener(
"resize", 'resize',
debounce(() => { debounce(() => {
this.$store.state.sidebarFold = this.$store.state.sidebarFold =
document.documentElement["clientWidth"] <= 992 || false; document.documentElement.clientWidth <= 992 || false
}, 150) }, 150)
); )
}, },
// , // ,
routeHandle(route) { routeHandle (route) {
if (!route.meta.isTab) { if (!route.meta.isTab) {
return false; return false
} }
let tab = {}; let tab = {}
let routeName = route.name; let routeName = route.name
let routeMeta = route.meta; const routeMeta = route.meta
if (route.name === "iframe") { if (route.name === 'iframe') {
let url = route.query.url || ""; const url = route.query.url || ''
if (!isURL(url)) { if (!isURL(url)) {
return false; return false
} }
let key = route.query.key || new Date().getTime(); const key = route.query.key || new Date().getTime()
routeName = `${routeName}_${key}`; routeName = `${routeName}_${key}`
routeMeta.title = key.toString(); routeMeta.title = key.toString()
routeMeta.menuId = route.query.menuId || ""; routeMeta.menuId = route.query.menuId || ''
routeMeta.iframeURL = url; routeMeta.iframeURL = url
} }
tab = this.$store.state.contentTabs.filter( tab = this.$store.state.contentTabs.filter(
(item) => item.name === routeName (item) => item.name === routeName
)[0]; )[0]
if (!tab) { if (!tab) {
tab = { tab = {
...window.SITE_CONFIG["contentTabDefault"], ...window.SITE_CONFIG.contentTabDefault,
...routeMeta, ...routeMeta,
name: routeName, name: routeName,
params: { ...route.params }, params: { ...route.params },
query: { ...route.query }, query: { ...route.query }
}; }
this.$store.state.contentTabs = this.$store.state.contentTabs =
this.$store.state.contentTabs.concat(tab); this.$store.state.contentTabs.concat(tab)
} }
this.$store.state.sidebarMenuActiveName = tab.menuId; this.$store.state.sidebarMenuActiveName = tab.menuId
this.$store.state.contentTabsActiveName = tab.name; this.$store.state.contentTabsActiveName = tab.name
}, },
// //
getUserInfo() { getUserInfo () {
return this.$http return this.$http
.get("/sys/user/info") .get('/sys/user/info')
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg); return this.$message.error(res.msg)
} }
this.$store.state.user.id = res.data.id; this.$store.state.user.id = res.data.id
this.$store.state.user.name = res.data.username; this.$store.state.user.name = res.data.realName
this.$store.state.user.superAdmin = res.data.superAdmin; this.$store.state.user.superAdmin = res.data.superAdmin
}) })
.catch(() => {}); .catch(() => {})
}, },
// //
getPermissions() { getPermissions () {
return this.$http return this.$http
.get("/sys/menu/permissions") .get('/sys/menu/permissions')
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg); return this.$message.error(res.msg)
} }
window.SITE_CONFIG["permissions"] = res.data; window.SITE_CONFIG.permissions = res.data
}) })
.catch(() => {}); .catch(() => {})
}, }
}, }
}; }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.aui-content__wrapper { .aui-content__wrapper {

View File

@ -50,7 +50,7 @@
border border
@selection-change="dataListSelectionChangeHandle" @selection-change="dataListSelectionChangeHandle"
style="width: 100%" style="width: 100%"
:height="qp ? '650px' : '650px'" height="650px"
> >
<el-table-column <el-table-column
type="selection" type="selection"
@ -126,7 +126,7 @@
fixed="right" fixed="right"
header-align="center" header-align="center"
align="center" align="center"
width="300" width="150"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button <!-- <el-button
@ -284,7 +284,7 @@ export default {
selectType: 0, selectType: 0,
type: '组件服务' type: '组件服务'
}, },
qp: false, // qp: false,
// //
relateApplicationVisible: false, relateApplicationVisible: false,
relateInfo: { relateInfo: {
@ -306,8 +306,8 @@ export default {
this.dataForm.type = '组件服务' this.dataForm.type = '组件服务'
}, },
mounted () { mounted () {
window.addEventListener('resize', this.a) // window.addEventListener('resize', this.a)
this.fullScreen() // this.fullScreen()
}, },
methods: { methods: {
reset () { reset () {
@ -448,17 +448,17 @@ export default {
this.$message.error('查询信息不能为空') this.$message.error('查询信息不能为空')
} }
}, },
fullScreen () { // fullScreen () {
if (window.outerHeight === screen.availHeight) { // if (window.outerHeight === screen.availHeight) {
if (window.outerWidth === screen.availWidth) { // if (window.outerWidth === screen.availWidth) {
this.qp = false // this.qp = false
} else { // } else {
this.qp = true // this.qp = true
} // }
} else { // } else {
this.qp = true // this.qp = true
} // }
}, // },
// //
showRelateApplication (row) { showRelateApplication (row) {
this.$http this.$http

View File

@ -52,7 +52,7 @@
border border
@selection-change="dataListSelectionChangeHandle" @selection-change="dataListSelectionChangeHandle"
style="width: 100%" style="width: 100%"
:height="qp ? '810px' : '650px'" height="650px"
> >
<el-table-column <el-table-column
type="selection" type="selection"
@ -287,8 +287,8 @@ export default {
this.dataForm.type = '应用资源' this.dataForm.type = '应用资源'
}, },
mounted () { mounted () {
window.addEventListener('resize', this.a) // window.addEventListener('resize', this.a)
this.fullScreen() // this.fullScreen()
}, },
methods: { methods: {
reset () { reset () {
@ -425,38 +425,38 @@ export default {
this.$message.error('查询不能输入为空') this.$message.error('查询不能输入为空')
} }
}, },
fullScreen () { // fullScreen () {
if (window.outerHeight === screen.availHeight) { // if (window.outerHeight === screen.availHeight) {
if (window.outerWidth === screen.availWidth) { // if (window.outerWidth === screen.availWidth) {
console.log( // console.log(
'全屏1', // '1',
window.outerHeight, // window.outerHeight,
screen.availHeight, // screen.availHeight,
window.outerWidth, // window.outerWidth,
screen.availWidth // screen.availWidth
) // )
this.qp = false // this.qp = false
} else { // } else {
console.log( // console.log(
'不是全屏2', // '2',
window.outerHeight, // window.outerHeight,
screen.availHeight, // screen.availHeight,
window.outerWidth, // window.outerWidth,
screen.availWidth // screen.availWidth
) // )
this.qp = true // this.qp = true
} // }
} else { // } else {
console.log( // console.log(
'不是全屏3', // '3',
window.outerHeight, // window.outerHeight,
screen.availHeight, // screen.availHeight,
window.outerWidth, // window.outerWidth,
screen.availWidth // screen.availWidth
) // )
this.qp = true // this.qp = true
} // }
}, // },
// //
applyAndAssembly (val) { applyAndAssembly (val) {
console.log('vvvv', val) console.log('vvvv', val)

View File

@ -122,6 +122,7 @@
import { mynotice } from '@/api/home' import { mynotice } from '@/api/home'
import { useStore } from 'vuex' import { useStore } from 'vuex'
import { getSgcTotal } from '@/api/home' import { getSgcTotal } from '@/api/home'
import Cookies from 'js-cookie'
import mybus from '@/myplugins/mybus' import mybus from '@/myplugins/mybus'
const store = useStore() const store = useStore()
const router = useRouter() const router = useRouter()
@ -222,6 +223,7 @@
}) })
break break
case '后台管理': case '后台管理':
Cookies.remove('JESSIONID')
window.open(window.SITE_CONFIG.backUrl + '/#/workBench-workBench') window.open(window.SITE_CONFIG.backUrl + '/#/workBench-workBench')
// window.reload('http://15.2.21.238:9797') // window.reload('http://15.2.21.238:9797')
break break