Commit c40ebf27 authored by xinzhedeai's avatar xinzhedeai

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

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