Commit c40ebf27 authored by xinzhedeai's avatar xinzhedeai

上传文件路径修改 顶部栏公司添加样式调整 默认首页修改 大屏入口新增

parent eb2c5877
import request from '@/utils/request' import request from '@/utils/request'
export function getMenusHome(pid) { // 获取中间页菜单列表
return request({
url: '/api/menus/home',
method: 'get'
})
}
export function getMenusTree(pid) { export function getMenusTree(pid) {
return request({ return request({
url: 'api/menus/lazy?pid=' + pid, url: 'api/menus/lazy?pid=' + pid,
...@@ -62,4 +70,4 @@ export function edit(data) { ...@@ -62,4 +70,4 @@ export function edit(data) {
}) })
} }
export default { add, edit, del, getMenusTree, getMenuSuperior, getMenus, getChild } export default { add, edit, del, getMenusTree, getMenuSuperior, getMenus, getChild, getMenusHome }
...@@ -5,7 +5,7 @@ import { encrypt } from '@/utils/rsaEncrypt' ...@@ -5,7 +5,7 @@ import { encrypt } from '@/utils/rsaEncrypt'
return request({ return request({
url: 'api/enterprise/auth/enterpriseList', url: 'api/enterprise/auth/enterpriseList',
method: 'get', method: 'get',
data params:data
}) })
} }
......
...@@ -13,12 +13,22 @@ ...@@ -13,12 +13,22 @@
<!-- <el-tooltip content="项目文档" effect="dark" placement="bottom"> <!-- <el-tooltip content="项目文档" effect="dark" placement="bottom">
<Doc class="right-menu-item hover-effect" /> <Doc class="right-menu-item hover-effect" />
</el-tooltip> --> </el-tooltip> -->
<div style="display: inline-block; overflow: hidden;vertical-align: -4px;">
<el-select size="mini" v-model="currentCompany" placeholder="" @change="handleChange">
<el-option
v-for="item in companyList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</div>
<el-tooltip v-if="showDatav" content="打开大数据监控平台数据大屏" effect="dark" placement="bottom"> <el-tooltip content="打开数据大屏" effect="dark" placement="bottom">
<div class="right-menu-item hover-effect" @click="gotoDatav">数据大屏</div> <div class="right-menu-item hover-effect" @click="gotoDatav">数据大屏</div>
</el-tooltip> </el-tooltip>
<el-tooltip v-if="showNotice" :content="playNotice?'通知公告':'打开声音权限,新消息可以播放提示音'" effect="dark" placement="bottom"> <!-- <el-tooltip v-if="showNotice" :content="playNotice?'通知公告':'打开声音权限,新消息可以播放提示音'" effect="dark" placement="bottom">
<router-link :to="noticeUrl"> <router-link :to="noticeUrl">
<div class="right-menu-item hover-effect"> <div class="right-menu-item hover-effect">
<el-badge :value="undoNotice.totle" :hidden="!undoNotice.totle" :max="99" class="item"> <el-badge :value="undoNotice.totle" :hidden="!undoNotice.totle" :max="99" class="item">
...@@ -28,15 +38,15 @@ ...@@ -28,15 +38,15 @@
</el-badge> </el-badge>
</div> </div>
</router-link> </router-link>
</el-tooltip> </el-tooltip> -->
<el-tooltip content="全屏缩放" effect="dark" placement="bottom"> <el-tooltip content="全屏缩放" effect="dark" placement="bottom">
<screenfull id="screenfull" class="right-menu-item hover-effect" /> <screenfull id="screenfull" class="right-menu-item hover-effect" />
</el-tooltip> </el-tooltip>
<el-tooltip content="布局设置" effect="dark" placement="bottom"> <!-- <el-tooltip content="布局设置" effect="dark" placement="bottom">
<size-select id="size-select" class="right-menu-item hover-effect" /> <size-select id="size-select" class="right-menu-item hover-effect" />
</el-tooltip> </el-tooltip> -->
</template> </template>
...@@ -68,6 +78,7 @@ ...@@ -68,6 +78,7 @@
</template> </template>
<script> <script>
import request from '@/utils/request'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import Breadcrumb from '@/components/Breadcrumb' import Breadcrumb from '@/components/Breadcrumb'
import Hamburger from '@/components/Hamburger' import Hamburger from '@/components/Hamburger'
...@@ -89,6 +100,8 @@ export default { ...@@ -89,6 +100,8 @@ export default {
}, },
data() { data() {
return { return {
currentCompany: '',
companyList: [],
selectedMine: {}, selectedMine: {},
undoNotice: {}, // 未处理的通知 undoNotice: {}, // 未处理的通知
playNotice: true, playNotice: true,
...@@ -127,34 +140,35 @@ export default { ...@@ -127,34 +140,35 @@ export default {
} }
}, },
mounted() { mounted() {
// 当前选择的矿山 this.getCompanyList()
const selectedMineJson = window.localStorage.getItem('kd.selected.mine') // // 当前选择的矿山
if (selectedMineJson) { // const selectedMineJson = window.localStorage.getItem('kd.selected.mine')
const selectedMine = JSON.parse(selectedMineJson) // if (selectedMineJson) {
if (selectedMine && selectedMine.enterpriseId === this.user.enterpriseId) { // const selectedMine = JSON.parse(selectedMineJson)
this.selectedMine = selectedMine // if (selectedMine && selectedMine.enterpriseId === this.user.enterpriseId) {
} // this.selectedMine = selectedMine
} // }
this.$refs.audio.src = require('@/assets/audio/notice.wav') // }
// 是否有通知权限 // this.$refs.audio.src = require('@/assets/audio/notice.wav')
this.sidebarRouters.forEach(r => { // // 是否有通知权限
if (this.user.enterpriseId === 0 && r.path === '/c/noticeMix') { // this.sidebarRouters.forEach(r => {
this.showNotice = true // if (this.user.enterpriseId === 0 && r.path === '/c/noticeMix') {
this.bindNoticeTimer() // this.showNotice = true
} // this.bindNoticeTimer()
if (this.user.enterpriseId !== 0 && r.path === '/e/noticeMix' && this.selectedMine.hasEnable) { // }
this.showNotice = true // if (this.user.enterpriseId !== 0 && r.path === '/e/noticeMix' && this.selectedMine.hasEnable) {
this.bindNoticeTimer() // this.showNotice = true
} // this.bindNoticeTimer()
}) // }
// 是否有大屏功能 // })
if (this.user.enterpriseId === 0) { // // 是否有大屏功能
this.showDatav = true // if (this.user.enterpriseId === 0) {
} else { // this.showDatav = true
if (this.selectedMine.hasEnable) { // } else {
this.showDatav = true // if (this.selectedMine.hasEnable) {
} // this.showDatav = true
} // }
// }
}, },
beforeDestroy() { // 组件卸载,关闭通知 beforeDestroy() { // 组件卸载,关闭通知
if (this.noticeTimer) { if (this.noticeTimer) {
...@@ -162,25 +176,56 @@ export default { ...@@ -162,25 +176,56 @@ export default {
} }
}, },
methods: { methods: {
getCompanyList(){
request({
url: 'api/enterprise/auth/enterpriseList',
method: 'get',
params:{
}
}).then((res)=>{
this.companyList = res.body || []
this.currentCompany = this.companyList[0].id
})
},
handleChange(value) {
console.log('被选择的值:', value);
request({
url: 'api/enterprise/change/default/enterprise',
method: 'post',
data:{
id: value
}
}).then((res)=>{
Message({
message: '操作成功,正在重新加载页面',
type: 'success',
duration: 3000 // 消息显示的时间,单位为 ms
});
// window.location.reload()
})
},
// 跳转到大屏 // 跳转到大屏
gotoDatav() { gotoDatav() {
if (this.user.enterpriseId === 0) { // 应急局用户
window.open(location.protocol + '//' + window.location.host + '/datav/index.html', '_self') window.open(location.protocol + '//' + window.location.host + '/datav/index.html', '_self')
} else { // 企业用户 // if (this.user.enterpriseId === 0) { // 应急局用户
if (this.selectedMine.hasEnable) { // window.open(location.protocol + '//' + window.location.host + '/datav/index.html', '_self')
this.$message.error('当前未选择矿山') // } else { // 企业用户
this.$router.replace('/dashboard') // if (this.selectedMine.hasEnable) {
} // this.$message.error('当前未选择矿山')
if (this.selectedMine.mineType === 1) { // this.$router.replace('/dashboard')
window.open(location.protocol + '//' + window.location.host + '/datav/underground.html', '_self') // }
} // if (this.selectedMine.mineType === 1) {
if (this.selectedMine.mineType === 2) { // window.open(location.protocol + '//' + window.location.host + '/datav/underground.html', '_self')
window.open(location.protocol + '//' + window.location.host + '/datav/open-air.html', '_self') // }
} // if (this.selectedMine.mineType === 2) {
if (this.selectedMine.mineType === 3) { // window.open(location.protocol + '//' + window.location.host + '/datav/open-air.html', '_self')
window.open(location.protocol + '//' + window.location.host + '/datav/tailings.html', '_self') // }
} // if (this.selectedMine.mineType === 3) {
} // window.open(location.protocol + '//' + window.location.host + '/datav/tailings.html', '_self')
// }
// }
}, },
bindNoticeTimer() { // 为页面绑定通知的定时任务 bindNoticeTimer() { // 为页面绑定通知的定时任务
const searchFunction = () => { const searchFunction = () => {
......
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
data() { data() {
return { return {
selectedMine: {}, selectedMine: {},
title: '', title: '中和地信应急平台',
logo: false, logo: false,
showPublic: false, showPublic: false,
showMineUnderground: false, showMineUnderground: false,
...@@ -43,22 +43,22 @@ export default { ...@@ -43,22 +43,22 @@ export default {
]) ])
}, },
mounted() { mounted() {
if (this.user.enterpriseId !== 0) { // 非应急局 // if (this.user.enterpriseId !== 0) { // 非应急局
const selectedMineJson = window.localStorage.getItem('kd.selected.mine') // const selectedMineJson = window.localStorage.getItem('kd.selected.mine')
if (selectedMineJson) { // if (selectedMineJson) {
const mine = JSON.parse(selectedMineJson) // const mine = JSON.parse(selectedMineJson)
this.title = mine.name // 设置上方矿山名称 // this.title = mine.name // 设置上方矿山名称
} else { // } else {
enterpriseApi.getMy().then(response => { // 设置上方企业名称 // enterpriseApi.getMy().then(response => { // 设置上方企业名称
if (response && response.name) { // if (response && response.name) {
this.title = response.name // this.title = response.name
} // }
}) // })
} // }
} else { // 应急局 // } else { // 应急局
this.title = '应急管理中心' // this.title = '应急管理中心'
this.logo = Logo // this.logo = Logo
} // }
} }
} }
</script> </script>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
unique-opened unique-opened
mode="vertical" mode="vertical"
> >
<sidebar-item v-for="route in sidebarRouters" v-show="checkMine(route)" :key="route.path" :item="route" :base-path="route.path" /> <sidebar-item v-for="route in sidebarRouters" v-show1="checkMine(route)" :key="route.path" :item="route" :base-path="route.path" />
</el-menu> </el-menu>
</el-scrollbar> </el-scrollbar>
</div> </div>
...@@ -57,28 +57,28 @@ export default { ...@@ -57,28 +57,28 @@ export default {
} }
}, },
mounted() { mounted() {
console.log(this.sidebarRouters) // console.log(this.sidebarRouters)
const selectedMineJson = window.localStorage.getItem('kd.selected.mine') // const selectedMineJson = window.localStorage.getItem('kd.selected.mine')
if (selectedMineJson) { // if (selectedMineJson) {
this.mine = JSON.parse(selectedMineJson) // this.mine = JSON.parse(selectedMineJson)
} // }
if (this.user.enterpriseId === 0) { // 应急局 // if (this.user.enterpriseId === 0) { // 应急局
this.hasPublic = true // this.hasPublic = true
} else { // 非应急局 // } else { // 非应急局
if (this.mine && this.mine.mineType) { // 含矿山 // if (this.mine && this.mine.mineType) { // 含矿山
if (this.mine.mineType === 1) { // 地下矿山 // if (this.mine.mineType === 1) { // 地下矿山
this.hasMineUnderground = true // this.hasMineUnderground = true
} // }
if (this.mine.mineType === 2) { // 露天矿山 // if (this.mine.mineType === 2) { // 露天矿山
this.hasMineOpencast = true // this.hasMineOpencast = true
} // }
if (this.mine.mineType === 3) { // 尾矿库 // if (this.mine.mineType === 3) { // 尾矿库
this.hasMineTailings = true // this.hasMineTailings = true
} // }
} else { // } else {
this.hasPublic = true // this.hasPublic = true
} // }
} // }
}, },
methods: { methods: {
checkMine(route) { checkMine(route) {
......
...@@ -15,6 +15,11 @@ export const constantRouterMap = [ ...@@ -15,6 +15,11 @@ export const constantRouterMap = [
component: (resolve) => require(['@/views/login'], resolve), component: (resolve) => require(['@/views/login'], resolve),
hidden: true hidden: true
}, },
{ path: '/login4Index',
meta: { title: '登录', noCache: true },
component: (resolve) => require(['@/views/home4Index'], resolve),
hidden: true
},
{ {
path: '/print', path: '/print',
meta: { title: '打印', noCache: true }, meta: { title: '打印', noCache: true },
...@@ -46,6 +51,7 @@ export const constantRouterMap = [ ...@@ -46,6 +51,7 @@ export const constantRouterMap = [
path: '/', path: '/',
component: Layout, component: Layout,
redirect: '/dashboard', redirect: '/dashboard',
hidden: true,
children: [ children: [
{ {
path: 'dashboard', path: 'dashboard',
......
// 适配 Nginx 反向代理 // 适配 Nginx 反向代理
const baseUrl = process.env.VUE_APP_BASE_API === '/' ? '' : process.env.VUE_APP_BASE_API // const baseUrl = process.env.VUE_APP_BASE_API === '/' ? '' : process.env.VUE_APP_BASE_API
const baseUrl = process.env.VUE_APP_LOCAL_API === '/' ? '' : process.env.VUE_APP_LOCAL_API
const api = { const api = {
state: { state: {
// 部署包上传 // 部署包上传
......
...@@ -6,7 +6,27 @@ import { getToken } from '@/utils/auth' ...@@ -6,7 +6,27 @@ import { getToken } from '@/utils/auth'
import Config from '@/settings' import Config from '@/settings'
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
/**
* 矿产信息固定值
*/
// localStorage.setItem(
// "kd.selected.mine",
// JSON.stringify({
// address: "测试地址",
// code: "1452562",
// enterpriseId: 1,
// hasEnable: true,
// id: 1,
// latitude: "37.05",
// liablePerson: "人员",
// liablePersonPhone: "15455248718",
// longitude: "117.74",
// mineType: 1,
// name: "测试地下矿山",
// runState: null,
// })
// );
var baseURL = process.env.NODE_ENV var baseURL = process.env.NODE_ENV
=== 'development' ? process.env.VUE_APP_LOCAL_API + '/' : (process.env.VUE_APP_LOCAL_API) + '/'; === 'development' ? process.env.VUE_APP_LOCAL_API + '/' : (process.env.VUE_APP_LOCAL_API) + '/';
......
...@@ -25,11 +25,12 @@ export default { ...@@ -25,11 +25,12 @@ export default {
* 真实首页只做中专路由。 * 真实首页只做中专路由。
*/ */
created() { created() {
if (this.user.enterpriseId === 0) { // 应急局用户 // if (this.user.enterpriseId === 0) { // 应急局用户
this.$router.replace('/home4Center') // this.$router.replace('/home4Center')
} else { // 企业用户 // } else { // 企业用户
this.$router.replace('/home4Enterprise') // this.$router.replace('/home4Enterprise')
} // }
this.$router.replace('/user/center')
} }
} }
</script> </script>
......
...@@ -270,10 +270,10 @@ export default { ...@@ -270,10 +270,10 @@ export default {
]) ])
}, },
mounted() { mounted() {
if (this.user.enterpriseId !== 0) { // 身份错误 // if (this.user.enterpriseId !== 0) { // 身份错误
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
return // return
} // }
this.reload1() this.reload1()
this.reload2() this.reload2()
this.reload3() this.reload3()
......
...@@ -138,6 +138,7 @@ export default { ...@@ -138,6 +138,7 @@ export default {
const x = this.$router.resolve('/home4Mine') const x = this.$router.resolve('/home4Mine')
window.open(x.href, '_self') window.open(x.href, '_self')
} else { } else {
alert(mine)
window.localStorage.removeItem('kd.selected.mine') window.localStorage.removeItem('kd.selected.mine')
} }
// window.location.reload() // window.location.reload()
......
...@@ -11,10 +11,9 @@ ...@@ -11,10 +11,9 @@
</div> </div>
<div class="content"> <div class="content">
<ul> <ul>
<li>应急管理</li> <li v-for="(item, index) in dataList" :key="index" @click="navTo(item.label)">
<li>自然资源</li> {{ item.label }}
<li>水利系统</li> </li>
<li>电子档案馆</li>
</ul> </ul>
</div> </div>
</div> </div>
...@@ -25,6 +24,7 @@ ...@@ -25,6 +24,7 @@
import qs from "qs"; import qs from "qs";
import Background from "@/assets/images/background.webp"; import Background from "@/assets/images/background.webp";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import menuApi from '@/api/system/menu.js'
export default { export default {
name: "Login", name: "Login",
data() { data() {
...@@ -36,6 +36,7 @@ export default { ...@@ -36,6 +36,7 @@ export default {
cookiePass: "", cookiePass: "",
loading: false, loading: false,
redirect: undefined, redirect: undefined,
dataList: []
}; };
}, },
computed: { computed: {
...@@ -60,19 +61,38 @@ export default { ...@@ -60,19 +61,38 @@ export default {
created() { created() {
// 按照不同域名加载不同页面样式(企业、应急局),加载完毕后再显示页面 // // 按照不同域名加载不同页面样式(企业、应急局),加载完毕后再显示页面
const host = window.location.host; // const host = window.location.host;
if (host === "yingji.longxijiancai.com") { // if (host === "yingji.longxijiancai.com") {
this.userStyle = "应急局"; // this.userStyle = "应急局";
} // }
if (host === "qiye.longxijiancai.com") { // if (host === "qiye.longxijiancai.com") {
this.userStyle = "企业"; // this.userStyle = "企业";
} // }
menuApi.getMenusHome().then((res)=>{
this.dataList = res.body
})
}, },
methods: { methods: {
navTo(type) { navTo(type) {
if (type === "admin") { if (type === "admin") {
this.$router.push({ path: "home4Center" }); // this.$router.push({ path: "home4Center" });
this.$router.push({ path: "/user/center" });
}else if(type === "应急管理"){
// this.$router.push({ path: "home4Center" });
this.$router.push({ path: "/user/center" });
}else if(type === "自然资源"){
// location.href = process.env.NODE_ENV + ''
location.href = 'http://192.168.3.226:8057/datav/natural.html'
}else if(type === "水利系统"){
location.href = 'http://192.168.3.226:8057/datav/watersource.html'
}else if(type === "电子档案馆"){
// this.$router.push({ path: "home4Center" });
this.$router.push({ path: "/user/center" });
} }
}, },
}, },
......
...@@ -45,10 +45,10 @@ export default { ...@@ -45,10 +45,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
}, },
methods: {} methods: {}
} }
......
...@@ -230,13 +230,13 @@ ...@@ -230,13 +230,13 @@
<!-- <el-table-column type="selection" width="55" /> --> <!-- <el-table-column type="selection" width="55" /> -->
<el-table-column :show-overflow-tooltip="true" label="编号" prop="id" width="100px" align="center" /> <el-table-column :show-overflow-tooltip="true" label="编号" prop="id" width="100px" align="center" />
<el-table-column :show-overflow-tooltip="true" label="企业名称" prop="name" align="center" /> <el-table-column :show-overflow-tooltip="true" label="企业名称" prop="name" align="center" />
<el-table-column :show-overflow-tooltip="true" label="审核状态" prop="auditState" align="center"> <!-- <el-table-column :show-overflow-tooltip="true" label="审核状态" prop="auditState" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-for="e in enterpriseApi.auditStates()" :key="e.key"> <span v-for="e in enterpriseApi.auditStates()" :key="e.key">
<span v-if="e.key==scope.row.auditState">{{ e.value }}</span> <span v-if="e.key==scope.row.auditState">{{ e.value }}</span>
</span> </span>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column :show-overflow-tooltip="true" label="统一社会信用代码" prop="idCode" align="center" /> <el-table-column :show-overflow-tooltip="true" label="统一社会信用代码" prop="idCode" align="center" />
<el-table-column :show-overflow-tooltip="true" label="成立日期" prop="setupDate" align="center" /> <el-table-column :show-overflow-tooltip="true" label="成立日期" prop="setupDate" align="center" />
<el-table-column :show-overflow-tooltip="true" label="公司地址" prop="address" align="center" /> <el-table-column :show-overflow-tooltip="true" label="公司地址" prop="address" align="center" />
...@@ -259,8 +259,8 @@ ...@@ -259,8 +259,8 @@
<el-table-column label="操作" width="200px" align="center" fixed="right"> <el-table-column label="操作" width="200px" align="center" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-show="scope.row.auditState!=1" size="mini" round @click="showEnterpriseInfo(scope.row.id)">查看详情</el-button> <el-button v-show="scope.row.auditState!=1" size="mini" round @click="showEnterpriseInfo(scope.row.id)">查看详情</el-button>
<el-button v-show="scope.row.auditState==1" size="mini" round @click="auditBtn(scope.row, 2)">通过</el-button> <!-- <el-button v-show="scope.row.auditState==1" size="mini" round @click="auditBtn(scope.row, 2)">通过</el-button>
<el-button v-show="scope.row.auditState==1" size="mini" round @click="auditBtn(scope.row, 3)">不通过</el-button> <el-button v-show="scope.row.auditState==1" size="mini" round @click="auditBtn(scope.row, 3)">不通过</el-button> -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
...@@ -347,10 +347,10 @@ export default { ...@@ -347,10 +347,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
}, },
......
...@@ -237,10 +237,10 @@ export default { ...@@ -237,10 +237,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
// 字典选项卡 // 字典选项卡
const dictGroups = [35, 36] const dictGroups = [35, 36]
dictGroups.forEach(i => { dictGroups.forEach(i => {
......
...@@ -230,10 +230,10 @@ export default { ...@@ -230,10 +230,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
// 字典选项卡 // 字典选项卡
const dictGroups = [35, 36] const dictGroups = [35, 36]
dictGroups.forEach(i => { dictGroups.forEach(i => {
......
...@@ -295,10 +295,10 @@ export default { ...@@ -295,10 +295,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
// 字典选项卡 // 字典选项卡
const dictGroups = [37, 38, 39] const dictGroups = [37, 38, 39]
dictGroups.forEach(i => { dictGroups.forEach(i => {
......
...@@ -188,10 +188,10 @@ export default { ...@@ -188,10 +188,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
// 字典选项卡 // 字典选项卡
const dictGroups = [34] const dictGroups = [34]
dictGroups.forEach(i => { dictGroups.forEach(i => {
......
...@@ -338,10 +338,10 @@ export default { ...@@ -338,10 +338,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
}, },
......
...@@ -264,10 +264,10 @@ export default { ...@@ -264,10 +264,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
}, },
......
...@@ -184,10 +184,10 @@ export default { ...@@ -184,10 +184,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
}, },
......
...@@ -210,10 +210,10 @@ export default { ...@@ -210,10 +210,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
}, },
......
...@@ -257,10 +257,10 @@ export default { ...@@ -257,10 +257,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
}, },
......
...@@ -186,10 +186,10 @@ export default { ...@@ -186,10 +186,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
}, },
......
...@@ -69,10 +69,10 @@ export default { ...@@ -69,10 +69,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
this.searchSubmit() this.searchSubmit()
}, },
methods: { methods: {
......
...@@ -271,10 +271,10 @@ export default { ...@@ -271,10 +271,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
}, },
......
...@@ -170,10 +170,10 @@ export default { ...@@ -170,10 +170,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
}, },
......
...@@ -76,10 +76,10 @@ export default { ...@@ -76,10 +76,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
}, },
......
...@@ -267,10 +267,10 @@ export default { ...@@ -267,10 +267,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
}, },
......
...@@ -127,10 +127,10 @@ export default { ...@@ -127,10 +127,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
// 字典 // 字典
const dictGroups = [40] const dictGroups = [40]
dictGroups.forEach(i => { dictGroups.forEach(i => {
......
...@@ -127,10 +127,10 @@ export default { ...@@ -127,10 +127,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
// 字典 // 字典
const dictGroups = [40] const dictGroups = [40]
dictGroups.forEach(i => { dictGroups.forEach(i => {
......
...@@ -138,10 +138,10 @@ export default { ...@@ -138,10 +138,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
}, },
......
...@@ -125,10 +125,10 @@ export default { ...@@ -125,10 +125,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
}, },
......
...@@ -251,10 +251,10 @@ export default { ...@@ -251,10 +251,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
}, },
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<el-button class="filter-item" size="mini" type="primary" icon="el-icon-plus" @click="doAdd()">新增</el-button> <el-button class="filter-item" size="mini" type="primary" icon="el-icon-plus" @click="doAdd()">新增</el-button>
<el-upload <el-upload
class="filter-item" class="filter-item"
action="/api/staff/import" :action="`${previewUrl}/api/staff/import`"
multiple multiple
:data="{mineType:selectedMine.mineType,mineId:selectedMine.id}" :data="{mineType:selectedMine.mineType,mineId:selectedMine.id}"
:headers="httpHeaders" :headers="httpHeaders"
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
<el-upload <el-upload
v-show="dialog1Editing" v-show="dialog1Editing"
class="upload-demo" class="upload-demo"
action="/api/file/upload" :action="`${previewUrl}/api/file/upload`"
multiple multiple
:headers="httpHeaders" :headers="httpHeaders"
:limit="1" :limit="1"
...@@ -295,6 +295,7 @@ export default { ...@@ -295,6 +295,7 @@ export default {
components: { }, components: { },
data() { data() {
return { return {
previewUrl: process.env.VUE_APP_LOCAL_API,
selectedMine: {}, selectedMine: {},
httpHeaders: { httpHeaders: {
'Authorization': getToken() 'Authorization': getToken()
...@@ -359,22 +360,22 @@ export default { ...@@ -359,22 +360,22 @@ export default {
} }
}, },
mounted() { mounted() {
const selectedMineJson = window.localStorage.getItem('kd.selected.mine') // const selectedMineJson = window.localStorage.getItem('kd.selected.mine')
let noMine = false // let noMine = false
if (!selectedMineJson) { // if (!selectedMineJson) {
noMine = true // noMine = true
} else { // } else {
const selectedMine = JSON.parse(selectedMineJson) // const selectedMine = JSON.parse(selectedMineJson)
if (!selectedMine || selectedMine.enterpriseId !== this.user.enterpriseId) { // if (!selectedMine || selectedMine.enterpriseId !== this.user.enterpriseId) {
noMine = true // noMine = true
} else { // } else {
this.selectedMine = selectedMine // this.selectedMine = selectedMine
} // }
} // }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
}, },
......
...@@ -96,10 +96,10 @@ export default { ...@@ -96,10 +96,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
}, },
......
...@@ -133,10 +133,10 @@ export default { ...@@ -133,10 +133,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
videoApi.getLink({ videoApi.getLink({
mineType: this.selectedMine.mineType, mineType: this.selectedMine.mineType,
mineId: this.selectedMine.id mineId: this.selectedMine.id
......
...@@ -22,10 +22,10 @@ export default { ...@@ -22,10 +22,10 @@ export default {
this.selectedMine = selectedMine this.selectedMine = selectedMine
} }
} }
if (noMine) { // if (noMine) {
this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
} // }
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
}, },
......
...@@ -34,13 +34,13 @@ ...@@ -34,13 +34,13 @@
<span v-else>登 录 中...</span> <span v-else>登 录 中...</span>
</el-button> </el-button>
</el-form-item> </el-form-item>
<el-form-item v-show="userStyle!='应急局'" style="width:100%;"> <!-- <el-form-item v-show="userStyle!='应急局'" style="width:100%;">
<router-link :to="{path: '/enterpriseApply'}"> <router-link :to="{path: '/enterpriseApply'}">
<el-button size="medium" style="width:100%;"> <el-button size="medium" style="width:100%;">
<span>企 业 注 册</span> <span>企 业 注 册</span>
</el-button> </el-button>
</router-link> </router-link>
</el-form-item> </el-form-item> -->
</el-form> </el-form>
<!-- 底部 --> <!-- 底部 -->
<div v-if="$store.state.settings.showFooter" id="el-login-footer"> <div v-if="$store.state.settings.showFooter" id="el-login-footer">
......
...@@ -106,6 +106,7 @@ import udOperation from '@crud/UD.operation' ...@@ -106,6 +106,7 @@ import udOperation from '@crud/UD.operation'
import DateRangePicker from '@/components/DateRangePicker' import DateRangePicker from '@/components/DateRangePicker'
const defaultForm = { id: null, name: null, isTop: '1', subCount: 0, pid: null, deptSort: 999, enabled: 'true' } const defaultForm = { id: null, name: null, isTop: '1', subCount: 0, pid: null, deptSort: 999, enabled: 'true' }
export default { export default {
name: 'Dept', name: 'Dept',
components: { Treeselect, crudOperation, rrOperation, udOperation, DateRangePicker }, components: { Treeselect, crudOperation, rrOperation, udOperation, DateRangePicker },
......
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
placeholder="选择上级类目" placeholder="选择上级类目"
/> />
</el-form-item> </el-form-item>
<el-form-item label="权限类" prop="type"> <!-- <el-form-item label="权限类" prop="type">
<el-radio-group v-model="form.enterpriseType" size="mini" style="width: 178px"> <el-radio-group v-model="form.enterpriseType" size="mini" style="width: 178px">
<el-radio-button label="0">应急局</el-radio-button> <el-radio-button label="0">应急局</el-radio-button>
<el-radio-button label="1">企业</el-radio-button> <el-radio-button label="1">企业</el-radio-button>
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
<el-checkbox v-model="form.hasMineUnderground">地下矿山</el-checkbox> <el-checkbox v-model="form.hasMineUnderground">地下矿山</el-checkbox>
<el-checkbox v-model="form.hasMineOpencast">露天矿山</el-checkbox> <el-checkbox v-model="form.hasMineOpencast">露天矿山</el-checkbox>
<el-checkbox v-model="form.hasMineTailings">尾矿库</el-checkbox> <el-checkbox v-model="form.hasMineTailings">尾矿库</el-checkbox>
</el-form-item> </el-form-item> -->
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button> <el-button type="text" @click="crud.cancelCU">取消</el-button>
...@@ -133,12 +133,12 @@ ...@@ -133,12 +133,12 @@
<svg-icon :icon-class="scope.row.icon ? scope.row.icon : ''" />{{ scope.row.title }} <svg-icon :icon-class="scope.row.icon ? scope.row.icon : ''" />{{ scope.row.title }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="enterpriseType" label="权限类" align="center" width="60px" :show-overflow-tooltip="true"> <!-- <el-table-column prop="enterpriseType" label="权限类" align="center" width="60px" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.enterpriseType==0">应急局</span> <span v-if="scope.row.enterpriseType==0">应急局</span>
<span v-else>企业</span> <span v-else>企业</span>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column prop="menuSort" align="center" label="排序"> <el-table-column prop="menuSort" align="center" label="排序">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.menuSort }} {{ scope.row.menuSort }}
...@@ -262,7 +262,7 @@ export default { ...@@ -262,7 +262,7 @@ export default {
if (!obj.leaf) { if (!obj.leaf) {
obj.children = null obj.children = null
} }
obj.label = (obj.enterpriseType === 0 ? '局)' : '企)') + obj.label // obj.label = (obj.enterpriseType === 0 ? '局)' : '企)') + obj.label
return obj return obj
}) })
setTimeout(() => { setTimeout(() => {
......
...@@ -159,6 +159,11 @@ export default { ...@@ -159,6 +159,11 @@ export default {
created() { created() {
this.form = { id: this.user.id, nickName: this.user.nickName, gender: this.user.gender, phone: this.user.phone } this.form = { id: this.user.id, nickName: this.user.nickName, gender: this.user.gender, phone: this.user.phone }
store.dispatch('GetInfo').then(() => {}) store.dispatch('GetInfo').then(() => {})
window.localStorage.setItem('kd.selected.mine', JSON.stringify({
mineType: '1',
mineId: '1'
}))
}, },
methods: { methods: {
toggleShow() { toggleShow() {
......
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
<el-option <el-option
v-for="item in canChoosedRoles" v-for="item in canChoosedRoles"
:key="item.name" :key="item.name"
:disabled="item.level <= 1 || item.level <= level" :disabled="item.level < 1 || item.level < level"
:label="item.name" :label="item.name"
:value="item.id" :value="item.id"
/> />
...@@ -176,7 +176,7 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css' ...@@ -176,7 +176,7 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
let userRoles = [] let userRoles = []
let userJobs = [] let userJobs = []
const defaultForm = { id: null, username: null, nickName: null, gender: '', email: null, enabled: 'false', roles: [], jobs: [], dept: [], phone: null, enterpriseIdList:[]} const defaultForm = { id: null, username: null, nickName: null, gender: '', email: null, enabled: 'false', roles: [], jobs: [], dept: {}, phone: null, enterpriseIdList:[]}
export default { export default {
name: 'User', name: 'User',
components: { crudOperation, rrOperation, udOperation, pagination, DateRangePicker }, components: { crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
...@@ -258,8 +258,9 @@ export default { ...@@ -258,8 +258,9 @@ export default {
}, },
methods: { methods: {
getCompanyList(deptId){ getCompanyList(deptId){
debugger
getCompanyList({ getCompanyList({
deptId: deptId.length > 1 ? deptId[deptId.length-1] : deptId[0] deptId // : deptId.length > 1 ? deptId[deptId.length-1] : deptId[0]
}) })
.then((res) => { .then((res) => {
this.options4enterpriseIdList = res.body; this.options4enterpriseIdList = res.body;
...@@ -322,10 +323,12 @@ export default { ...@@ -322,10 +323,12 @@ export default {
}, },
// 初始化编辑时候的角色与岗位 // 初始化编辑时候的角色与岗位
[CRUD.HOOK.beforeToEdit](crud, form) { [CRUD.HOOK.beforeToEdit](crud, form) {
// console.log('编辑行数据', form.dept, this.form.dept)
// this.getJobs(this.form.dept.id) // this.getJobs(this.form.dept.id)
this.jobDatas = [] this.jobDatas = []
this.roleDatas = [] this.roleDatas = []
this.form.dept = [] // this.form.dept = []
userRoles = [] userRoles = []
userJobs = [] userJobs = []
...@@ -341,6 +344,15 @@ export default { ...@@ -341,6 +344,15 @@ export default {
const data = { id: job.id } const data = { id: job.id }
userJobs.push(data) userJobs.push(data)
}) })
// 区域列表回显
this.form.dept = [form.dept.id]
// this.form.dept = [7]
// 公司列表回显
this.form.enterpriseIdList = []
form.enterpriseList && form.enterpriseList.forEach(item => {
this.form.enterpriseIdList.push(item.id)
});
}, },
// 提交前做的操作 // 提交前做的操作
[CRUD.HOOK.afterValidateCU](crud) { [CRUD.HOOK.afterValidateCU](crud) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment