<template>
|
<div class="aui-navbar" :class="`aui-navbar--${$store.state.navbarLayoutType}`">
|
<div class="aui-navbar__header">
|
<h1 class="aui-navbar__brand" @click="gotoHome" style="font-size: 16px">
|
<img :src="srcUrl" width="30" height="30" alt="">
|
<a class="aui-navbar__brand-lg" href="javascript:;">
|
{{ $store.state.word.systemName }}<span style="color:red">{{ $store.state.word.mj }}</span></a>
|
<a class="aui-navbar__brand-mini" href="javascript:;">{{ $store.state.word.systemName }} <span
|
style="color:red">{{ $store.state.word.mj }}</span></a>
|
</h1>
|
</div>
|
<div class="aui-navbar__body">
|
<el-menu class="aui-navbar__menu mr-auto" mode="horizontal">
|
<!-- <el-menu-item index="1" @click="$store.state.sidebarFold = !$store.state.sidebarFold">-->
|
<!-- <svg class="icon-svg aui-navbar__icon-menu aui-navbar__icon-menu--switch" aria-hidden="true">-->
|
<!-- <use xlink:href="#icon-outdent"></use>-->
|
<!-- </svg>-->
|
<!-- </el-menu-item>-->
|
<el-menu-item index="2" @click="getRecordNumber(3);Collapse()">
|
<i class="el-icon-s-fold"></i>
|
</el-menu-item>
|
<el-menu-item index="3" @click="refresh()">
|
<i class="el-icon-refresh"></i>
|
</el-menu-item>
|
</el-menu>
|
<!-- <el-form :inline="true" @submit.native.prevent @keyup.enter.native="search()" style="margin-right: 5px;">-->
|
<!-- <el-form-item>-->
|
<!-- <el-input v-model="dataForm.keyword" placeholder="综合查询" id="materialSearch"-->
|
<!-- style="width: 300px;margin-top:5px;"/>-->
|
<!-- </el-form-item>-->
|
<!-- <!–<el-form-item class="message-btn">–>-->
|
<!-- <!–<zt-button type="query" @click="search()" style="margin-top:9px;"></zt-button>–>-->
|
<!-- <!–</el-form-item>–>-->
|
<!-- </el-form>-->
|
<el-menu class="aui-navbar__menu" mode="horizontal" style=":hover{background:none} !important;">
|
<!-- <el-menu-item>-->
|
<!-- <local-ship-selector v-model="localShip" placeholder="舷号"/>-->
|
<!-- </el-menu-item>-->
|
<!-- <el-menu-item>-->
|
<!-- <el-badge :value="feedCount" class="item" :hidden="!isAdmin">-->
|
<!-- <el-button @click="toFeedBack()" type="text">意见反馈</el-button>-->
|
<!-- </el-badge>-->
|
<!-- </el-menu-item>-->
|
<el-tooltip class="item" effect="dark" content="帮助" placement="bottom">
|
<el-menu-item v-if="help_show" index="4">
|
<router-link tag="a" target="_blank" :to="{name:'userHelp',params:{id:0}}">
|
<i class="bz-iconfont icon-bangzhu"></i>
|
</router-link>
|
</el-menu-item>
|
</el-tooltip>
|
<!--<el-menu-item class="menu">
|
<el-badge :value="taskCount" class="item">
|
<el-popover
|
placement="bottom"
|
width="800"
|
trigger="hover">
|
<i @click="task()" slot="reference" class="wt-iconfont icon-lingdang"></i>
|
<zt-button type="primary" style="margin-bottom: 6px; float: right; margin-right: 40px"
|
@click="addOneClassFile1">一键已阅
|
</zt-button>
|
<el-table :data="gridData" lazy load="true" style="margin-top:10px;" height="300"
|
:default-sort="{prop: 'createDate', order: 'descending'}">
|
<el-table-column width="80" type="index" :index="indexMethod" label="序号" align="center">
|
</el-table-column>
|
<el-table-column property="deptName,model,taskType" label="摘要" align="center">
|
<template slot-scope="scope">
|
<span @click="getJsfa(scope.row)" v-if="scope.row.code === 1" style="cursor: pointer">
|
{{ scope.row.deptName }}已上传{{ scope.row.model }}工程{{ scope.row.busiFieldName }}
|
</span>
|
<span style="cursor: pointer" v-else>{{ scope.row.model }}工程工程单{{ scope.row.taskType }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="操作" width="130" align="center">
|
<template v-slot="{ row }">
|
<zt-table-button v-if="row.code === 1" @click="addOneClassFile(row,1)">已阅</zt-table-button>
|
<!– <zt-table-button v-if="row.code === 1" @click="addOneClassFile(row,2)">一键已阅</zt-table-button>–>
|
<zt-table-button v-else @click="task(row)" style="color: coral">办理</zt-table-button>
|
</template>
|
</el-table-column>
|
<template slot="append">
|
<InfiniteLoading
|
@infinite="load"
|
spinner="circles"
|
force-use-infinite-wrapper=".el-table__body-wrapper">
|
<div slot="spinner">加载中...</div>
|
<div slot="no-more">所有数据加载完毕</div>
|
<div slot="no-results">加载完毕</div>
|
</InfiniteLoading>
|
</template>
|
</el-table>
|
</el-popover>
|
</el-badge>
|
</el-menu-item>-->
|
<el-menu-item v-if="$store.state.isGoToHome" @click="goToIndex()">回到首页</el-menu-item>
|
<!--<a href="#" @click="myNoticeRouter()"><i class="el-icon-bell"></i></a>-->
|
<!--</el-badge>-->
|
<!--</el-menu-item>-->
|
<el-tooltip class="item" effect="dark" content="全屏" placement="bottom">
|
<el-menu-item index="4" @click="fullscreenHandle('formal')">
|
<svg class="icon-svg aui-navbar__icon-menu" aria-hidden="true">
|
<use xlink:href="#icon-fullscreen"></use>
|
</svg>
|
</el-menu-item>
|
</el-tooltip>
|
<el-tooltip class="item" effect="dark" content="投屏" placement="bottom">
|
<el-menu-item index="4" @click="fullscreenHandle('large')" style="padding-top:2px;">
|
<i class="el-icon-full-screen" aria-hidden="true">
|
<use xlink:href="#icon-fullscreen"></use>
|
</i>
|
</el-menu-item>
|
</el-tooltip>
|
<el-menu-item index="1" class="aui-navbar__avatar" v-if="loginType === 'syLogin'">
|
<el-dropdown trigger="click" @command="changeSystem">
|
<span class="el-dropdown-link" style="font-weight: 700;font-size: 20px">
|
{{ systemName }}
|
</span>
|
<el-dropdown-menu slot="dropdown" class="el-dropdown-link-xt">
|
<el-dropdown-item :command="item" v-for="item in systemList" :key="item.name" :value="item.id" v-show="!item.disabled">
|
{{ item.text }}
|
</el-dropdown-item>
|
</el-dropdown-menu>
|
</el-dropdown>
|
</el-menu-item>
|
<el-menu-item index="5" class="aui-navbar__avatar" @click="getRecordNumber(4)">
|
<el-dropdown placement="bottom" :show-timeout="0">
|
<span class="el-dropdown-link">
|
<!--<img src="~@/assets/img/avatar.png">-->
|
<span>{{ $store.state.user.name }}({{ userRoleInfo.roleName }})</span>
|
<i class="el-icon-arrow-down"></i>
|
</span>
|
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-item @click.native="changeTheme()">{{ $t('changeTheme') }}</el-dropdown-item>
|
<!-- <el-dropdown-item @click.native="updatePasswordHandle()">{{ $t('updatePassword.title') }}-->
|
<!-- </el-dropdown-item>-->
|
<el-dropdown-item @click.native="logoutHandle()">{{ $t('logout') }}</el-dropdown-item>
|
</el-dropdown-menu>
|
</el-dropdown>
|
</el-menu-item>
|
<div class="aui-theme-tools" :class="{ 'aui-theme-tools--open': isOpen }">
|
<!-- <div class="aui-theme-tools__toggle" @click="isOpen = !isOpen">
|
<svg class="icon-svg" aria-hidden="true"><use xlink:href="#icon-setting"></use></svg>
|
</div> -->
|
<div id="div_panel" class="aui-theme-tools__content">
|
<div class="aui-theme-tools__item">
|
<h3>主题</h3>
|
<div style="margin: 20px 0">
|
<el-radio-group v-model="$store.state.theme" size="mini" @change="themehangeHandle">
|
<el-radio-button label="light">浅色</el-radio-button>
|
<el-radio-button label="high">深色</el-radio-button>
|
</el-radio-group>
|
</div>
|
</div>
|
</div>
|
</div>
|
</el-menu>
|
</div>
|
<!-- 弹窗, 修改密码 -->
|
<update-password v-if="updatePasswordVisible" ref="updatePassword"></update-password>
|
<!-- <el-dialog title="系统功能" top="10vh" append-to-body width='85%' v-if="dialogVisible" v-dialogDrag :visible.sync="dialogVisible">-->
|
<!-- <el-tabs id="scheduleTabs" v-model="activeName" @tab-click="getDiagramProject">-->
|
<!-- <el-tab-pane label="问题解决方案" name="1">-->
|
<!-- <QuestionSolution></QuestionSolution>-->
|
<!-- </el-tab-pane>-->
|
<!-- <el-tab-pane label="表关联管理" name="2">-->
|
<!-- <TableRelation></TableRelation>-->
|
<!-- </el-tab-pane>-->
|
<!-- <el-tab-pane label="数据字典" name="3">-->
|
<!-- <DatabaseTableInfo></DatabaseTableInfo>-->
|
<!-- </el-tab-pane>-->
|
<!-- <el-tab-pane label="表结构维护" name="4">-->
|
<!-- <TableStructMaintain></TableStructMaintain>-->
|
<!-- </el-tab-pane>-->
|
<!-- </el-tabs>-->
|
<!-- </el-dialog>-->
|
</div>
|
|
</template>
|
<script>
|
import Cookies from 'js-cookie'
|
import screenfull from 'screenfull'
|
// import UpdatePassword from './main-navbar-update-password'
|
import {clearLoginInfo} from '../../../packages/utils'
|
import debounce from 'lodash/debounce'
|
import router from '../../router'
|
import InfiniteLoading from 'vue-infinite-loading'
|
import srcUrl from '../../../public/logo.png'
|
|
function addEventHandler(target, type, func) {
|
if (target.addEventListener) {
|
target.addEventListener(type, func, false)
|
} else if (target.attachEvent) {
|
target.attachEvent('on' + type, func)
|
} else {
|
target['on' + type] = func
|
}
|
}
|
|
function removeEventHandler(target, type, func) {
|
if (target.removeEventListener) {
|
target.removeEventListener(type, func, false)
|
} else if (target.detachEvent) {
|
target.detachEvent('on' + type, func)
|
} else {
|
delete target['on' + type]
|
}
|
}
|
|
function documentMouseDown(e) {
|
var element = typeof event !== 'undefined' ? event.srcElement : e.target
|
var downPanel = false
|
while (element) {
|
downPanel = element === document.getElementById('div_panel')
|
if (downPanel) break
|
element = element.parentNode
|
}
|
if (!downPanel) {
|
removeEventHandler(document, 'mousedown', documentMouseDown)
|
document.getElementById('div_panel').style.display = 'none'
|
}
|
}
|
|
// var socket = null
|
export default {
|
inject: ['Collapse', 'refresh'],
|
props: {
|
letter: String,
|
falg: {
|
type: Boolean,
|
default: false
|
}
|
},
|
data() {
|
return {
|
help_show:true,
|
loginType:'',
|
activeName: '1',
|
dialogVisible: false,
|
recordNumber: 0,
|
srcUrl: srcUrl,
|
pageIndex: 1,
|
pageSize: 60,
|
technologyurl: '',
|
userRoleInfo: {},
|
msg: '',
|
gridData: [],
|
isOpen: false,
|
localShip: 0,
|
themeColor: '',
|
dataForm: {
|
keyword: ''
|
},
|
updatePasswordVisible: false,
|
messageTip: false,
|
taskCount: '',
|
taskList: [],
|
feedCount:'',
|
system:'',
|
isAdmin:false
|
}
|
},
|
created() {
|
let that = this
|
this.getUserRoleInfo()
|
this.$EventBus.$on('changeTheme', function () {
|
that.isOpen = true
|
})
|
//this.systemList = window.SITE_CONFIG['menuList']
|
this.loginType=Cookies.get('loginType')
|
// Cookies.get('loginType')
|
},
|
watch: {
|
themeColor(val) {
|
this.$router.go(0)
|
},
|
'$route.params.keyword'() {
|
this.dataForm.keyword = this.$route.params.keyword
|
this.query()
|
},
|
localShip(val) {
|
this.$store.commit('setLocalShip', val)
|
},
|
},
|
mounted() {
|
// alert(`${window.SITE_CONFIG['apiURL']}/sys/oss/commFile?fileFlag=logo`)
|
// this.srcUrl = `${window.SITE_CONFIG['apiURL']}/sys/oss/commFile?fileFlag=logo&token=${Cookies.get('token')}`
|
// this.srcUrl = require('../../../public/logo.png')
|
|
// this.$http.get('http://127.0.0.1:8086/life-protection/sys/oss/commFile?fileFlag=logo').then(res => {
|
// console.log(res,'res')
|
// })
|
// this.getUserRoleInfo()
|
this.system = this.$store.state.user.system
|
/* alert(this.system)
|
if(this.system){
|
if(this.system==='djxl'|| this.system==='smj'){
|
this.help_show = true
|
}
|
}*/
|
// if (Cookies.get('system') === "djxl" || Cookies.get('system') === "smj" ){
|
// this.help_show = true
|
// }
|
|
this.$EventBus.$on('formSubmit', (msg) => {
|
this.msg = msg
|
// console.log(msg)
|
})
|
this.$EventBus.$on('reLogin', () => {
|
this.gotoLogin()
|
})
|
this.$EventBus.$on('singleSignVerify', () => {
|
let token = Cookies.get('singleSignToken')
|
let verifyUrl = Cookies.get('singleSignVerifyUrl')
|
// console.log('singleSignVerifyUrl', verifyUrl)
|
// console.log('singleSignToken',token)
|
if (verifyUrl && token) {
|
console.log('do singleSignVerify')
|
/* this.$http2.get(verifyUrl, {params: {token: token}}).then(res => {
|
console.log(res,'singleSignVerify return')
|
})*/
|
}
|
})
|
|
if (Cookies.get('loginMethod') === 'single'){
|
this.technologyurl = 'http://'+location.hostname+':8080/select'
|
this.loginUrl = 'http://'+location.hostname+':8080/login'
|
}else{
|
this.technologyurl = 'http://'+location.hostname+':8020/#/home'
|
this.loginUrl = 'http://'+location.hostname+':8020/#/login'
|
}
|
/* this.$http.get('/sys/data/export/inte/technologyurl').then(res => {
|
this.technologyurl = res.data.url
|
})
|
this.$http.get('/sys/data/export/inte/loginurl').then(res => {
|
this.loginUrl = res.data.url
|
})*/
|
|
this.getTaskCount()
|
// console.log(this.$store.state.user,'this.$store.state.user.debug navbar6666666666')
|
|
this.isAdmin = this.$store.state.user.isAdmin
|
},
|
methods: {
|
getHelp(){
|
console.log(this.system)
|
if(this.system&&this.system==='smj'){
|
window.open('./help/smjVideo/index.html','_blank');
|
}else if(this.system==='djxl') {
|
window.open('./help/djxlVideo/index.html','_blank');
|
}
|
},
|
getDiffDay(date_1, date_2) {
|
// 计算两个日期之间的差值
|
let totalDays, diffDate
|
let myDate_1 = Date.parse(date_1)
|
let myDate_2 = Date.parse(date_2)
|
// 将两个日期都转换为毫秒格式,然后做差
|
diffDate = Math.abs(myDate_1 - myDate_2) // 取相差毫秒数的绝对值
|
totalDays = Math.floor(diffDate / (1000 * 3600 * 24)) // 向下取整
|
// console.log(totalDays)
|
return totalDays // 相差的天数
|
},
|
// 获取当前用户登录信息
|
getUserRoleInfo() {
|
return this.$http.get('/user/userRoleInfo').then(res => {
|
this.loading = false
|
if (res.code !== 0) {
|
return this.$message.error(res.msg)
|
}
|
this.userRoleInfo = res.data
|
console.log(this.userRoleInfo, 'userRoleInfo')
|
}).catch(() => {
|
})
|
},
|
async gotoHome() {
|
/* let res = await this.$http.post('/logout')
|
if (!res.success) {
|
console.log(res.msg)
|
}
|
clearLoginInfo()
|
*/
|
window.location.href = this.technologyurl
|
},
|
// 退出
|
async logoutHandle() {
|
if (await this.$tip.confirm(this.$t('prompt.info', {'handle': this.$t('logout')}))) {
|
let res = await this.$http.post('/logout')
|
if (!res.success) {
|
return this.$message.error(res.msg)
|
}
|
this.gotoLogin()
|
}
|
},
|
async gotoLogin() {
|
clearLoginInfo()
|
console.log(Cookies.get('loginMethod'), 'gotoLogin loginMethod')
|
if (Cookies.get('loginMethod') === 'single') {
|
window.location.href = this.loginUrl
|
} else {
|
this.$router.push({name: 'login'})
|
}
|
},
|
indexMethod(index) {
|
return index += 1
|
},
|
task(row) {
|
this.getRecordNumber(1)
|
let menuId = '1439894944222408706'
|
let route = window.SITE_CONFIG['dynamicMenuRoutes'].filter(item => item.meta.menuId === menuId)[0]
|
if (route === undefined) {
|
this.$tip.alert('没有配置菜单权限')
|
return
|
}
|
let params = {
|
projectId: row.id, approveStepId: row.approveStepId
|
}
|
if (Object.keys(params).length > 0) {
|
params = Object.assign(params, route.meta.params)
|
}
|
this.$router.push({
|
name: menuId,
|
params: params
|
})
|
},
|
async getTaskCount() {
|
let res = await this.$http.get(`/task/taskCenter/page`)
|
if (res.success) {
|
// this.taskCount = res.data.length
|
this.taskList = res.data
|
// console.log(this.taskList, "12311")
|
}
|
},
|
goToIndex() {
|
console.log(this.$store.state.user.roleName,'this.$store.state.user.roleName')
|
this.$router.push({name: 'TestDjxlHome',params: {roleName: this.$store.state.user.roleName}})
|
// window.console.log(this.$route.name)
|
},
|
themehangeHandle(val) {
|
this.themeColor = val
|
Cookies.set('systemTheme', val)
|
let body = document.querySelector('body')
|
let clazz = body.className
|
if (val === 'light') {
|
clazz = clazz.replace(' high', '').replace(' light', '')
|
} else {
|
clazz = clazz.replace(' light', '').replace(' high', '')
|
}
|
body.className = clazz + ' ' + val
|
this.isOpen = false
|
},
|
search() {
|
let keyword = document.getElementById('materialSearch').value
|
this.$EventBus.$emit('search', keyword)
|
if (keyword) {
|
this.$router.push({
|
name: 'search',
|
params: {
|
keyword: keyword
|
}
|
})
|
} else {
|
}
|
},
|
// 更换主题
|
changeTheme() {
|
document.getElementById('div_panel').style.display = ''
|
addEventHandler(document, 'mousedown', documentMouseDown)
|
this.$EventBus.$emit('changeTheme')
|
},
|
myNoticeRouter() {
|
this.$router.replace('notice-notice-user')
|
},
|
getUnReadCount() {
|
this.$http.get(`/sys/notice/my/unread`).then(res => {
|
if (res.code !== 0) {
|
return this.$message.error(res.msg)
|
}
|
if (res.data > 0) {
|
this.messageTip = true
|
}
|
}).catch(() => {
|
})
|
},
|
// 全屏
|
fullscreenHandle(param) {
|
this.getRecordNumber(2)
|
if (!screenfull.enabled) {
|
return this.$message({
|
message: this.$t('fullscreen.prompt'),
|
type: 'warning',
|
duration: 500
|
})
|
}
|
// this.is_sidebar = false
|
// this.$emit('getSide',this.is_sidebar)
|
this.$emit('windowResize', param, this.recordNumber)
|
this.$EventBus.$emit('netWorkDiagramHeight', '网络图高度')
|
if (!screenfull.isFullscreen) {
|
screenfull.toggle()
|
}
|
},
|
getRecordNumber(param) {
|
if (param == this.recordNumber + 1) {
|
this.recordNumber = param
|
if (param == 4) {
|
this.recordNumber = 0
|
this.dialogVisible = true
|
|
this.$store.state.debugging = true
|
}
|
} else {
|
this.recordNumber = 0
|
}
|
},
|
// fullscreenHandleResize(){
|
// if (!screenfull.enabled) {
|
// return this.$message({
|
// message: this.$t('fullscreen.prompt'),
|
// type: 'warning',
|
// duration: 500
|
// })
|
// }
|
// console.log('111111111')
|
// this.$emit('windowResizeHandle','open');
|
// screenfull.toggle()
|
// },
|
// 修改密码
|
// updatePasswordHandle() {
|
// this.updatePasswordVisible = true
|
// this.$nextTick(() => {
|
// this.$refs.updatePassword.init()
|
// })
|
// },
|
changeSystem(system) {
|
console.log(Cookies.get('token'),'Cookies token')
|
console.log(system.path,'system.path')
|
this.$nextTick(() => {
|
window.location.href = system.path
|
if (system.path.indexOf('8020')>-1) {
|
window.location.reload()
|
}
|
})
|
|
/* this.$store.state.contentTabs = []
|
this.systemName = system.name
|
Cookies.set('systemId', system.id)
|
this.$store.commit('setMenuList', system.children)
|
if (system.children.length > 0) {
|
let firstMenu = system.children[0]
|
if ((firstMenu.children || []).length > 0) {
|
firstMenu = firstMenu.children[0]
|
}
|
//if ((firstMenu.url || '').length > 0 && (firstMenu.remark || firstMenu.name).indexOf('首页') >= 0) {
|
if ((firstMenu.url || '').length > 0) {
|
this.gotoRouteHandle(firstMenu.id)
|
}
|
}*/
|
},
|
gotoRouteHandle(menuId) {
|
let route = window.SITE_CONFIG['dynamicMenuRoutes'].filter(item => item.meta.menuId === menuId)[0]
|
if (route) {
|
this.$router.push({name: route.name})
|
}
|
},
|
}
|
}
|
</script>
|
<style>
|
.v-modal {
|
opacity: 1;
|
background: rgb(48 33 33 / 50%)
|
}
|
|
.el-dropdown-link-xt {
|
background: #586587;
|
}
|
|
.el-dropdown-link-xt .el-dropdown-menu__item {
|
color: #fff;
|
padding-left: 10px;
|
font-size: 16px;
|
}
|
|
.el-dropdown-link-xt .el-dropdown-menu__item:hover {
|
color: #fff;
|
background: #17507c !important
|
}
|
</style>
|