Commit 81915e80 authored by Kimber's avatar Kimber

Merge branch 'rev2'

parents 31cebfca 971c40f9
import request from '@/utils/request'
export default {
// 绑定我的
addMy: (iotMachine) => {
return request({
url: 'api/iot-machine/add/my',
method: 'post',
data: iotMachine
})
},
// 移除我的
removeMy: () => {
return request({
url: 'api/iot-machine/remove-all/my',
method: 'post'
})
},
// 查询我的
getDataList:(params) => {
return request({
url: 'data/mp/history',
method: 'get',
params
})
},
// 查询风速、温度
getDataList4windSpeed: (params) => {
return request({
url: 'data/sz/history',
method: 'get',
params
})
},
// 查询降雨量
getDataList4waterPrecipitation: (params) => {
return request({
url: 'data/rg/history',
method: 'get',
params
})
}
}
import request from '@/utils/request'
export default {
// 绑定我的
addMy: (iotMachine) => {
return request({
url: 'api/iot-machine/add/my',
method: 'post',
data: iotMachine
})
},
// 移除我的
removeMy: () => {
return request({
url: 'api/iot-machine/remove-all/my',
method: 'post'
})
},
// 查询我的
getDataList:(params) => {
return request({
url: 'tab/drybeachequipinfor',
method: 'get',
params
})
}
}
......@@ -8,6 +8,14 @@ export function getDepts(params) {
})
}
export function getDeptList(params) {
return request({
url: 'api/dept/tree',
method: 'get',
params
})
}
export function getDeptSuperior(ids) {
const data = ids.length || ids.length === 0 ? ids : Array.of(ids)
return request({
......
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 }
import request from '@/utils/request'
import { encrypt } from '@/utils/rsaEncrypt'
export function getCompanyList(data) {
return request({
url: 'api/enterprise/auth/enterpriseList',
method: 'get',
params:data
})
}
export function add(data) {
return request({
url: 'api/users',
......
......@@ -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">
<div class="right-menu-item hover-effect" @click="gotoDatav">数据大屏</div>
<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,59 @@ 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')
}
}
// window.open(location.protocol + '//' + window.location.host + '/datav/index.html', '_self')
// window.open('http://192.168.3.226:8057/datav/index.html', '_self')
this.$router.push('/login4Index')
// 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()
......
<template>
<div class="login" :style="'background-image:url(' + Background + ');'">
<div class="topTitle" >
<div class="floating-text">
中和地信有限公司欢迎您!
</div>
</div>
<div class="bottomTitle">@中和地信有限公司</div>
<div class="wrapper">
<div class="header">
<h2 @click="navTo('admin')"><i class="el-icon-setting"></i>管理后台</h2>
</div>
<div class="title">
<h1>中和地信应急平台</h1>
</div>
<div class="content">
<ul>
<li v-for="(item, index) in dataList" :key="index" @click="navTo(item.label)">
{{ item.label }}
</li>
</ul>
</div>
</div>
</div>
</template>
<script>
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() {
return {
show: false,
userStyle: null,
Background: Background,
codeUrl: "",
cookiePass: "",
loading: false,
redirect: undefined,
dataList: []
};
},
computed: {
...mapGetters(["user"]),
},
watch: {
$route: {
handler: function (route) {
const data = route.query;
if (data && data.redirect) {
this.redirect = data.redirect;
delete data.redirect;
if (JSON.stringify(data) !== "{}") {
this.redirect =
this.redirect + "&" + qs.stringify(data, { indices: false });
}
}
},
immediate: true,
},
},
created() {
// // 按照不同域名加载不同页面样式(企业、应急局),加载完毕后再显示页面
// 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: "/user/center" });
}else if(type === "应急管理"){
// this.$router.push({ path: "home4Center" });
// this.$router.push({ path: "/user/center" });
location.href = 'http://192.168.3.226:8057/datav/index.html'
}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" });
}
},
},
};
</script>
<style rel="stylesheet/scss" lang="scss">
@keyframes floatShadow {
0% {
transform:translateX(1300px);
display:block;
}
100% {
transform:translateX(-1300px);
display:none;
}
}
.floating-text {
font-size:18px;line-height:1;
color: #FDD756;text-shadow: 0 0 5px #fff;
animation: floatShadow;
animation-name:floatShadow;
animation-duration: 20s;
animation-iteration-count: infinite;
animation-timing-function:linear;
position:absolute;top:8px;
}
.topTitle {
position: absolute;
top: 0;
background: #15181a73;
height: 32px;
width: 100%;
line-height: 32px;
color: #fff;
text-align: center;
}
.bottomTitle {
position: absolute;
bottom: 0;
background: #021d39;
height: 32px;
width: 100%;
line-height: 32px;
color: #fff;
text-align: center;
}
.wrapper {
.header {
h2 {
color: #00346b;
text-align: right;
position: absolute;
top: 20px;
right: 20px;
cursor: pointer;
}
}
h1 {
text-align: center;
color: #00346b;
}
ul {
list-style: none;
width: 900px;
overflow: hidden;
}
li {
float: left;
width: 400px;
background: #173e67;
height: 170px;
line-height: 170px;
text-align: center;
color: #fff;
font-size: 28px;
font-weight: bold;
margin: 10px;
cursor: pointer;
&:nth-child(1) {
background: #135965;
}
&:nth-child(4) {
background: #135965;
}
}
}
.login {
position: relative;
display: flex;
justify-content: center;
align-items: center;
height: 100%;
background-size: cover;
}
</style>
......@@ -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">
......@@ -187,7 +187,8 @@ export default {
return
}
}
this.$router.push({ path: /* 记住上次退出时的页面 */ /* this.redirect || */'/home4Login' })
// this.$router.push({ path: /* 记住上次退出时的页面 */ /* this.redirect || */'/home4Login' })
this.$router.push({ path: 'login4Index' })
}).catch(() => {
this.loading = false
this.getCode()
......
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div>
<el-input
v-model="equipname"
clearable
size="small"
placeholder="测点名称"
style="width: 200px"
class="filter-item"
/>
<date-range-picker v-model="datarealtime" class="date-item" />
<el-button
class="filter-item"
size="mini"
type="success"
icon="el-icon-search"
@click="search"
>搜索</el-button
>
<el-button
class="filter-item"
size="mini"
type="warning"
icon="el-icon-refresh-left"
@click="clearSearch"
>重置</el-button
>
</div>
</div>
<!--表格-->
<el-table ref="table" v-loading="loading" :data="tableData" row-key="id">
<el-table-column
:show-overflow-tooltip="true"
prop="sensorid"
label="站点编号"
width="130px"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="sensorname"
label="测站名称"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="dispx"
label="X变化量"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="dispy"
label="Y变化量"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="disph"
label="Z变化量"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="time"
label="监测时间"
align="center"
>
</el-table-column>
</el-table>
<el-pagination
:page-sizes="[10, 20, 50, 100]"
:current-page.sync="page"
:page-size.sync="size"
:total="totalElement"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
import API from "@/api/newResource/data.js";
import { getToken } from "@/utils/auth";
import { mapGetters } from "vuex";
import DateRangePicker from '@/components/DateRangePicker'
export default {
name: "newResourceDisplaceMachine", // 本页面名
data() {
return {
equipname: '',
datarealtime: '',
loading: false,
tableData: [],
// 总的个数
totalElement: 0,
// 当前页的条数
size: 10,
// 当前页码
page: 1,
};
},
components: { DateRangePicker },
mounted() {
this.search()
},
methods: {
getData() {
this.loading = true;
API.getDataList({
page: this.page,
size: this.size,
time: this.datarealtime && this.datarealtime.join(',') || '',
sensorname: this.equipname,
})
.then((response) => {
this.loading = false;
this.tableData = response.body.list;
this.totalElement = response.body.total;
})
.catch(() => {
this.loading = false;
});
},
// 模糊搜索
search() {
this.getData();
},
clearSearch() {
this.equipname = ''
this.datarealtime = ''
this.size = 10;
this.page = 0;
this.getData();
},
// 当前页的条数变化
handleSizeChange(val) {
this.size = val;
this.getData();
},
// 当前第几页
handleCurrentChange(val) {
this.page = val;
this.getData();
},
},
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-input-number .el-input__inner {
text-align: left;
}
::v-deep .vue-treeselect__control,
::v-deep .vue-treeselect__placeholder,
::v-deep .vue-treeselect__single-value {
height: 30px;
line-height: 30px;
}
</style>
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div>
<el-input
v-model="equipname"
clearable
size="small"
placeholder="测点名称"
style="width: 200px"
class="filter-item"
/>
<date-range-picker v-model="datarealtime" class="date-item" />
<el-button
class="filter-item"
size="mini"
type="success"
icon="el-icon-search"
@click="search"
>搜索</el-button
>
<el-button
class="filter-item"
size="mini"
type="warning"
icon="el-icon-refresh-left"
@click="clearSearch"
>重置</el-button
>
</div>
</div>
<!--表格-->
<el-table ref="table" v-loading="loading" :data="tableData" row-key="id">
<el-table-column
:show-overflow-tooltip="true"
prop="equipno"
label="站点编号"
width="130px"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="equipname"
label="测站名称"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="online"
label="设备状态"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="datarealtime"
label="监测时间"
align="center"
>
</el-table-column>
</el-table>
<el-pagination
:page-sizes="[10, 20, 50, 100]"
:current-page.sync="page"
:page-size.sync="size"
:total="totalElement"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
import API from "@/api/newResource/machine.js";
import { getToken } from "@/utils/auth";
import { mapGetters } from "vuex";
import DateRangePicker from '@/components/DateRangePicker'
export default {
name: "newResourceDisplaceMachine", // 本页面名
data() {
return {
equipname: '',
datarealtime: '',
loading: false,
tableData: [],
// 总的个数
totalElement: 0,
// 当前页的条数
size: 10,
// 当前页码
page: 1,
};
},
components: { DateRangePicker },
mounted() {
this.search()
},
methods: {
getData() {
this.loading = true;
API.getDataList({
page: this.page,
size: this.size,
datarealtime: this.datarealtime && this.datarealtime.join(',') || '',
equipname: this.equipname,
deviceType: '3'
})
.then((response) => {
this.loading = false;
this.tableData = response.body.list;
})
.catch(() => {
this.loading = false;
});
},
// 模糊搜索
search() {
this.getData();
},
clearSearch() {
this.equipname = ''
this.datarealtime = ''
this.size = 10;
this.page = 0;
this.getData();
},
// 当前页的条数变化
handleSizeChange(val) {
this.size = val;
this.getData();
},
// 当前第几页
handleCurrentChange(val) {
this.page = val;
this.getData();
},
},
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-input-number .el-input__inner {
text-align: left;
}
::v-deep .vue-treeselect__control,
::v-deep .vue-treeselect__placeholder,
::v-deep .vue-treeselect__single-value {
height: 30px;
line-height: 30px;
}
</style>
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div>
<el-input
v-model="equipname"
clearable
size="small"
placeholder="测点名称"
style="width: 200px"
class="filter-item"
/>
<date-range-picker v-model="datarealtime" class="date-item" />
<el-button
class="filter-item"
size="mini"
type="success"
icon="el-icon-search"
@click="search"
>搜索</el-button
>
<el-button
class="filter-item"
size="mini"
type="warning"
icon="el-icon-refresh-left"
@click="clearSearch"
>重置</el-button
>
</div>
</div>
<!--表格-->
<el-table ref="table" v-loading="loading" :data="tableData" row-key="id">
<el-table-column
:show-overflow-tooltip="true"
prop="sensorid"
label="站点编号"
width="130px"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="sensorname"
label="测站名称"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="svalue"
label="温度"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="time"
label="监测时间"
align="center"
>
</el-table-column>
</el-table>
<el-pagination
:page-sizes="[10, 20, 50, 100]"
:current-page.sync="page"
:page-size.sync="size"
:total="totalElement"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
import API from "@/api/newResource/data.js";
import DateRangePicker from '@/components/DateRangePicker'
export default {
name: "newResourceDisplaceMachine", // 本页面名
data() {
return {
equipname: '',
datarealtime: '',
loading: false,
tableData: [],
// 总的个数
totalElement: 0,
// 当前页的条数
size: 10,
// 当前页码
page: 1,
};
},
components: { DateRangePicker },
mounted() {
this.search()
},
methods: {
getData() {
this.loading = true;
API.getDataList4windSpeed({
page: this.page,
size: this.size,
time: this.datarealtime && this.datarealtime.join(',') || '',
sensorname: this.equipname,
different: '温度'
})
.then((response) => {
this.loading = false;
this.tableData = response.body.list;
this.totalElement = response.body.total;
})
.catch(() => {
this.loading = false;
});
},
// 模糊搜索
search() {
this.getData();
},
clearSearch() {
this.equipname = ''
this.datarealtime = ''
this.size = 10;
this.page = 0;
this.getData();
},
// 当前页的条数变化
handleSizeChange(val) {
this.size = val;
this.getData();
},
// 当前第几页
handleCurrentChange(val) {
this.page = val;
this.getData();
},
},
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-input-number .el-input__inner {
text-align: left;
}
::v-deep .vue-treeselect__control,
::v-deep .vue-treeselect__placeholder,
::v-deep .vue-treeselect__single-value {
height: 30px;
line-height: 30px;
}
</style>
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div>
<el-input
v-model="equipname"
clearable
size="small"
placeholder="测点名称"
style="width: 200px"
class="filter-item"
/>
<date-range-picker v-model="datarealtime" class="date-item" />
<el-button
class="filter-item"
size="mini"
type="success"
icon="el-icon-search"
@click="search"
>搜索</el-button
>
<el-button
class="filter-item"
size="mini"
type="warning"
icon="el-icon-refresh-left"
@click="clearSearch"
>重置</el-button
>
</div>
</div>
<!--表格-->
<el-table ref="table" v-loading="loading" :data="tableData" row-key="id">
<el-table-column
:show-overflow-tooltip="true"
prop="equipno"
label="站点编号"
width="130px"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="equipname"
label="测站名称"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="online"
label="设备状态"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="datarealtime"
label="监测时间"
align="center"
>
</el-table-column>
</el-table>
<el-pagination
:page-sizes="[10, 20, 50, 100]"
:current-page.sync="page"
:page-size.sync="size"
:total="totalElement"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
import API from "@/api/newResource/machine.js";
import { getToken } from "@/utils/auth";
import { mapGetters } from "vuex";
import DateRangePicker from '@/components/DateRangePicker'
export default {
name: "newResourceDisplaceMachine", // 本页面名
data() {
return {
equipname: '',
datarealtime: '',
loading: false,
tableData: [],
// 总的个数
totalElement: 0,
// 当前页的条数
size: 10,
// 当前页码
page: 1,
};
},
components: { DateRangePicker },
mounted() {
this.search()
},
methods: {
getData() {
this.loading = true;
API.getDataList({
page: this.page,
size: this.size,
datarealtime: this.datarealtime && this.datarealtime.join(',') || '',
equipname: this.equipname,
deviceType: '8',
different: '温度'
})
.then((response) => {
this.loading = false;
this.tableData = response.body.list;
})
.catch(() => {
this.loading = false;
});
},
// 模糊搜索
search() {
this.getData();
},
clearSearch() {
this.equipname = ''
this.datarealtime = ''
this.size = 10;
this.page = 0;
this.getData();
},
// 当前页的条数变化
handleSizeChange(val) {
this.size = val;
this.getData();
},
// 当前第几页
handleCurrentChange(val) {
this.page = val;
this.getData();
},
},
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-input-number .el-input__inner {
text-align: left;
}
::v-deep .vue-treeselect__control,
::v-deep .vue-treeselect__placeholder,
::v-deep .vue-treeselect__single-value {
height: 30px;
line-height: 30px;
}
</style>
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div>
<el-input
v-model="equipname"
clearable
size="small"
placeholder="测点名称"
style="width: 200px"
class="filter-item"
/>
<date-range-picker v-model="datarealtime" class="date-item" />
<el-button
class="filter-item"
size="mini"
type="success"
icon="el-icon-search"
@click="search"
>搜索</el-button
>
<el-button
class="filter-item"
size="mini"
type="warning"
icon="el-icon-refresh-left"
@click="clearSearch"
>重置</el-button
>
</div>
</div>
<!--表格-->
<el-table ref="table" v-loading="loading" :data="tableData" row-key="id">
<el-table-column
:show-overflow-tooltip="true"
prop="sensorid"
label="站点编号"
width="130px"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="sensorname"
label="测站名称"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="svalue"
label="风速"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="time"
label="监测时间"
align="center"
>
</el-table-column>
</el-table>
<el-pagination
:page-sizes="[10, 20, 50, 100]"
:current-page.sync="page"
:page-size.sync="size"
:total="totalElement"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
import API from "@/api/newResource/data.js";
import DateRangePicker from '@/components/DateRangePicker'
export default {
name: "newResourceDisplaceMachine", // 本页面名
data() {
return {
equipname: '',
datarealtime: '',
loading: false,
tableData: [],
// 总的个数
totalElement: 0,
// 当前页的条数
size: 10,
// 当前页码
page: 1,
};
},
components: { DateRangePicker },
mounted() {
this.search()
},
methods: {
getData() {
this.loading = true;
API.getDataList4windSpeed({
page: this.page,
size: this.size,
time: this.datarealtime && this.datarealtime.join(',') || '',
sensorname: this.equipname,
different: '风速'
})
.then((response) => {
this.loading = false;
this.tableData = response.body.list;
this.totalElement = response.body.total;
})
.catch(() => {
this.loading = false;
});
},
// 模糊搜索
search() {
this.getData();
},
clearSearch() {
this.equipname = ''
this.datarealtime = ''
this.size = 10;
this.page = 0;
this.getData();
},
// 当前页的条数变化
handleSizeChange(val) {
this.size = val;
this.getData();
},
// 当前第几页
handleCurrentChange(val) {
this.page = val;
this.getData();
},
},
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-input-number .el-input__inner {
text-align: left;
}
::v-deep .vue-treeselect__control,
::v-deep .vue-treeselect__placeholder,
::v-deep .vue-treeselect__single-value {
height: 30px;
line-height: 30px;
}
</style>
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div>
<el-input
v-model="equipname"
clearable
size="small"
placeholder="测点名称"
style="width: 200px"
class="filter-item"
/>
<date-range-picker v-model="datarealtime" class="date-item" />
<el-button
class="filter-item"
size="mini"
type="success"
icon="el-icon-search"
@click="search"
>搜索</el-button
>
<el-button
class="filter-item"
size="mini"
type="warning"
icon="el-icon-refresh-left"
@click="clearSearch"
>重置</el-button
>
</div>
</div>
<!--表格-->
<el-table ref="table" v-loading="loading" :data="tableData" row-key="id">
<el-table-column
:show-overflow-tooltip="true"
prop="equipno"
label="站点编号"
width="130px"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="equipname"
label="测站名称"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="online"
label="设备状态"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="datarealtime"
label="监测时间"
align="center"
>
</el-table-column>
</el-table>
<el-pagination
:page-sizes="[10, 20, 50, 100]"
:current-page.sync="page"
:page-size.sync="size"
:total="totalElement"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
import API from "@/api/newResource/machine.js";
import { getToken } from "@/utils/auth";
import { mapGetters } from "vuex";
import DateRangePicker from '@/components/DateRangePicker'
export default {
name: "newResourceDisplaceMachine", // 本页面名
data() {
return {
equipname: '',
datarealtime: '',
loading: false,
tableData: [],
// 总的个数
totalElement: 0,
// 当前页的条数
size: 10,
// 当前页码
page: 1,
};
},
components: { DateRangePicker },
mounted() {
this.search()
},
methods: {
getData() {
this.loading = true;
API.getDataList({
page: this.page,
size: this.size,
datarealtime: this.datarealtime && this.datarealtime.join(',') || '',
equipname: this.equipname,
deviceType: '8',
different: '风速'
})
.then((response) => {
this.loading = false;
this.tableData = response.body.list;
})
.catch(() => {
this.loading = false;
});
},
// 模糊搜索
search() {
this.getData();
},
clearSearch() {
this.equipname = ''
this.datarealtime = ''
this.size = 10;
this.page = 0;
this.getData();
},
// 当前页的条数变化
handleSizeChange(val) {
this.size = val;
this.getData();
},
// 当前第几页
handleCurrentChange(val) {
this.page = val;
this.getData();
},
},
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-input-number .el-input__inner {
text-align: left;
}
::v-deep .vue-treeselect__control,
::v-deep .vue-treeselect__placeholder,
::v-deep .vue-treeselect__single-value {
height: 30px;
line-height: 30px;
}
</style>
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div>
<el-input
v-model="equipname"
clearable
size="small"
placeholder="测点名称"
style="width: 200px"
class="filter-item"
/>
<date-range-picker v-model="datarealtime" class="date-item" />
<el-button
class="filter-item"
size="mini"
type="success"
icon="el-icon-search"
@click="search"
>搜索</el-button
>
<el-button
class="filter-item"
size="mini"
type="warning"
icon="el-icon-refresh-left"
@click="clearSearch"
>重置</el-button
>
</div>
</div>
<!--表格-->
<el-table ref="table" v-loading="loading" :data="tableData" row-key="id">
<el-table-column
:show-overflow-tooltip="true"
prop="sensorid"
label="站点编号"
width="130px"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="sensorname"
label="测站名称"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="rainfall"
label="实时雨量"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="zongliang"
label="累计雨量"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="time"
label="监测时间"
align="center"
>
</el-table-column>
</el-table>
<el-pagination
:page-sizes="[10, 20, 50, 100]"
:current-page.sync="page"
:page-size.sync="size"
:total="totalElement"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
import API from "@/api/newResource/data.js";
import DateRangePicker from '@/components/DateRangePicker'
export default {
name: "waterPrecipitation", // 本页面名
data() {
return {
equipname: '',
datarealtime: '',
loading: false,
tableData: [],
// 总的个数
totalElement: 0,
// 当前页的条数
size: 10,
// 当前页码
page: 1,
};
},
components: { DateRangePicker },
mounted() {
this.search()
},
methods: {
getData() {
this.loading = true;
API.getDataList4waterPrecipitation({
page: this.page,
size: this.size,
time: this.datarealtime && this.datarealtime.join(',') || '',
sensorname: this.equipname,
different: '温度'
})
.then((response) => {
this.loading = false;
this.tableData = response.body.list;
this.totalElement = response.body.total;
})
.catch(() => {
this.loading = false;
});
},
// 模糊搜索
search() {
this.getData();
},
clearSearch() {
this.equipname = ''
this.datarealtime = ''
this.size = 10;
this.page = 0;
this.getData();
},
// 当前页的条数变化
handleSizeChange(val) {
this.size = val;
this.getData();
},
// 当前第几页
handleCurrentChange(val) {
this.page = val;
this.getData();
},
},
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-input-number .el-input__inner {
text-align: left;
}
::v-deep .vue-treeselect__control,
::v-deep .vue-treeselect__placeholder,
::v-deep .vue-treeselect__single-value {
height: 30px;
line-height: 30px;
}
</style>
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div>
<el-input
v-model="equipname"
clearable
size="small"
placeholder="测点名称"
style="width: 200px"
class="filter-item"
/>
<date-range-picker v-model="datarealtime" class="date-item" />
<el-button
class="filter-item"
size="mini"
type="success"
icon="el-icon-search"
@click="search"
>搜索</el-button
>
<el-button
class="filter-item"
size="mini"
type="warning"
icon="el-icon-refresh-left"
@click="clearSearch"
>重置</el-button
>
</div>
</div>
<!--表格-->
<el-table ref="table" v-loading="loading" :data="tableData" row-key="id">
<el-table-column
:show-overflow-tooltip="true"
prop="equipno"
label="站点编号"
width="130px"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="equipname"
label="测站名称"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="online"
label="设备状态"
align="center"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="datarealtime"
label="监测时间"
align="center"
>
</el-table-column>
</el-table>
<el-pagination
:page-sizes="[10, 20, 50, 100]"
:current-page.sync="page"
:page-size.sync="size"
:total="totalElement"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
import API from "@/api/newResource/machine.js";
import { getToken } from "@/utils/auth";
import { mapGetters } from "vuex";
import DateRangePicker from '@/components/DateRangePicker'
export default {
name: "newResourceDisplaceMachine", // 本页面名
data() {
return {
equipname: '',
datarealtime: '',
loading: false,
tableData: [],
// 总的个数
totalElement: 0,
// 当前页的条数
size: 10,
// 当前页码
page: 1,
};
},
components: { DateRangePicker },
mounted() {
this.search()
},
methods: {
getData() {
this.loading = true;
API.getDataList({
page: this.page,
size: this.size,
datarealtime: this.datarealtime && this.datarealtime.join(',') || '',
equipname: this.equipname,
deviceType: '6',
})
.then((response) => {
this.loading = false;
this.tableData = response.body.list;
})
.catch(() => {
this.loading = false;
});
},
// 模糊搜索
search() {
this.getData();
},
clearSearch() {
this.equipname = ''
this.datarealtime = ''
this.size = 10;
this.page = 0;
this.getData();
},
// 当前页的条数变化
handleSizeChange(val) {
this.size = val;
this.getData();
},
// 当前第几页
handleCurrentChange(val) {
this.page = val;
this.getData();
},
},
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-input-number .el-input__inner {
text-align: left;
}
::v-deep .vue-treeselect__control,
::v-deep .vue-treeselect__placeholder,
::v-deep .vue-treeselect__single-value {
height: 30px;
line-height: 30px;
}
</style>
......@@ -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(() => {
......
......@@ -25,7 +25,20 @@
<el-form-item label="角色名称" prop="name">
<el-input v-model="form.name" style="width: 380px;" />
</el-form-item>
<el-form-item v-if="form.dataScope === '自定义'" label="数据权限" prop="depts">
<el-form-item label="角色级别" prop="level">
<el-input-number v-model.number="form.level" :min="1" controls-position="right" style="width: 145px;" />
</el-form-item>
<el-form-item label="数据范围" prop="dataScope">
<el-select v-model="form.dataScope" style="width: 140px" placeholder="请选择数据范围" @change="changeScope">
<el-option
v-for="item in dateScopes"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
<!-- <el-form-item v-if="form.dataScope === '自定义'" label="数据权限" prop="depts">
<treeselect
v-model="deptDatas"
:load-options="loadDepts"
......@@ -34,7 +47,7 @@
style="width: 380px"
placeholder="请选择"
/>
</el-form-item>
</el-form-item> -->
<el-form-item label="描述信息" prop="description">
<el-input v-model="form.description" style="width: 380px;" rows="5" type="textarea" />
</el-form-item>
......@@ -54,6 +67,7 @@
<el-table ref="table" v-loading="crud.loading" highlight-current-row style="width: 100%;" :data="crud.data" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange">
<el-table-column :selectable="checkboxT" type="selection" width="55" />
<el-table-column prop="name" label="名称" />
<el-table-column label="权限等级" prop="level" />
<el-table-column :show-overflow-tooltip="true" prop="description" label="描述" />
<el-table-column :show-overflow-tooltip="true" width="135px" prop="createTime" label="创建日期" />
<el-table-column v-if="checkPer(['admin','roles:edit','roles:del'])" label="操作" width="130px" align="center" fixed="right">
......@@ -132,6 +146,7 @@ export default {
mixins: [presenter(), header(), form(defaultForm), crud()],
data() {
return {
dateScopes: ["本级", "全部"],
defaultProps: { children: 'children', label: 'label', isLeaf: 'leaf' },
level: 3,
currentId: 0, currentName: '', menuLoading: false, showButton: false,
......@@ -194,8 +209,8 @@ export default {
},
// 提交前做的操作
[CRUD.HOOK.afterValidateCU](crud) {
crud.form.dataScope = '全部'
crud.form.depts = []
// crud.form.dataScope = '全部'
// crud.form.depts = []
return true
},
// 触发单选
......
......@@ -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() {
......
......@@ -55,19 +55,37 @@
<el-radio label="女"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form.enabled" :disabled="form.id === user.id">
<el-radio-button
v-for="item in user_status"
:key="item.value"
:label="item.value"
>{{ item.label }}</el-radio-button>
</el-radio-group>
<el-form-item label="区域" prop="depts" >
<el-cascader
v-model="form.dept"
:options="data"
:props="{ checkStrictly: true, value: 'id' }"
:show-all-levels="false"
@change="deptChange"
></el-cascader>
</el-form-item>
<el-form-item label="企业" prop="enterpriseIdList">
<el-select
v-model="form.enterpriseIdList"
placeholder="请输入企业"
:multiple="true"
>
<el-option
v-for="item in options4enterpriseIdList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item style="margin-bottom: 0;" label="角色" prop="roles">
<el-select
v-model="roleDatas"
style="width: 437px"
style="width: 237px"
multiple
placeholder="请选择"
@remove-tag="deleteTag"
......@@ -76,11 +94,20 @@
<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"
/>
</el-select>
<el-form-item label="状态">
<el-radio-group v-model="form.enabled" :disabled="form.id === user.id">
<el-radio-button
v-for="item in user_status"
:key="item.value"
:label="item.value"
>{{ item.label }}</el-radio-button>
</el-radio-group>
</el-form-item>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
......@@ -132,8 +159,10 @@
<script>
import crudUser from '@/api/system/user'
import {getCompanyList} from '@/api/system/user'
import { isvalidPhone } from '@/utils/validate'
// import { getDepts, getDeptSuperior } from '@/api/system/dept'
import { getDeptList, getDeptSuperior } from '@/api/system/dept'
import { getAll, getLevel } from '@/api/system/role'
import { getAllJob } from '@/api/system/job'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
......@@ -146,7 +175,8 @@ import { mapGetters } from 'vuex'
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: { id: null }, phone: null }
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 },
......@@ -172,6 +202,7 @@ export default {
height: document.documentElement.clientHeight - 180 + 'px;',
deptName: '', depts: [], deptDatas: [], jobs: [], level: 3, roles: [],
jobDatas: [], roleDatas: [], // 多选时使用
options4enterpriseIdList: [],
defaultProps: { children: 'children', label: 'name', isLeaf: 'leaf' },
permission: {
add: ['admin', 'user:add'],
......@@ -183,6 +214,7 @@ export default {
{ key: 'false', display_name: '禁用' }
],
rules: {
username: [
{ required: true, message: '请输入用户名', trigger: 'blur' },
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
......@@ -193,7 +225,11 @@ export default {
],
phone: [
{ required: true, trigger: 'blur', validator: validPhone }
]
],
dept: [
{ required: true, message: '请选择部门', trigger: 'blur' }
],
}
}
},
......@@ -202,9 +238,10 @@ export default {
'user'
]),
canChoosedRoles() {
return this.roles.filter(r => {
return r.enterpriseId === this.user.enterpriseId
})
// return this.roles.filter(r => {
// return r.enterpriseId === this.user.enterpriseId
// })
return this.roles
}
},
created() {
......@@ -215,8 +252,31 @@ export default {
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 180 + 'px;'
}
this.getDeptList()
},
methods: {
getCompanyList(deptId){
console.log('deptId', deptId)
getCompanyList({
// deptId
deptId: deptId.length > 1 ? deptId[deptId.length-1] : deptId[0]
})
.then((res) => {
this.options4enterpriseIdList = res.body;
});
},
deptChange(value){
console.log('value', value)
this.getCompanyList(value)
},
getDeptList() {
getDeptList({
}).then((res) => {
this.data = res.body.content;
});
},
// 禁止输入空格
keydown(e) {
if (e.keyCode === 32) {
......@@ -260,14 +320,20 @@ export default {
[CRUD.HOOK.beforeToAdd]() {
this.jobDatas = []
this.roleDatas = []
this.form.dept = []
},
// 初始化编辑时候的角色与岗位
[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 = []
userRoles = []
userJobs = []
const _this = this
form.roles.forEach(function(role, index) {
_this.roleDatas.push(role.id)
......@@ -279,6 +345,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) {
......@@ -289,8 +364,19 @@ export default {
})
return false
}
if(!this.form.dept.length){
this.$message({
message: '部门不能为空',
type: 'warning'
})
return false
}
crud.form.roles = userRoles
crud.form.jobs = userJobs
crud.form.dept = {id: this.form.dept[this.form.dept.length-1]}
return true
},
// getDepts() {
......
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