能源权限

This commit is contained in:
朱菊兰 2024-04-10 17:36:37 +08:00
parent 93236f9828
commit 7c5d8bde0b
15 changed files with 102 additions and 147 deletions

View File

@ -1,8 +1,7 @@
<template> <template>
<div <div
class="searchBarBox divHeight" class="searchBarBox divHeight"
ref="searchBarRef" ref="searchBarRef">
:style="{ paddingRight: isFold ? '55px' : '0px' }">
<el-form <el-form
:inline="true" :inline="true"
class="demo-form-inline"> class="demo-form-inline">
@ -200,13 +199,6 @@
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span
v-if="isFold"
class="foldClass"
@click="switchMode">
{{ isExpand ? '收起' : '展开' }}
<svg-icon :icon-class="isExpand ? 'upward' : 'downward'" />
</span>
</div> </div>
</template> </template>
<script> <script>
@ -217,16 +209,8 @@ import { getFactoryList } from '@/api/core/base/factory';
import moment from 'moment'; import moment from 'moment';
export default { export default {
name: 'searchArea', name: 'searchArea',
props: {
isFold: {
//
type: Boolean,
default: false,
},
},
data() { data() {
return { return {
isExpand: false, //
// //
queryParams: { queryParams: {
energyTypeId: null, energyTypeId: null,
@ -525,16 +509,6 @@ export default {
let value = new Date(newData).getTime(); let value = new Date(newData).getTime();
return value; return value;
}, },
switchMode() {
//
this.isExpand = !this.isExpand;
const element = this.$refs.searchBarRef;
if (this.isExpand) {
element.classList.remove('divHeight');
} else {
element.classList.add('divHeight');
}
},
}, },
}; };
</script> </script>
@ -573,21 +547,6 @@ export default {
margin-bottom: 4px; margin-bottom: 4px;
} }
} }
.searchBarBox .foldClass {
position: absolute;
top: 14px;
right: 0;
cursor: pointer;
font-size: 12px;
color: #0b58ff;
}
.searchBarBox .foldClass .iconfont {
font-size: 14px;
}
.divHeight {
height: 45px;
overflow: hidden;
}
.separateStyle { .separateStyle {
display: inline-block; display: inline-block;
width: 1px; width: 1px;

View File

@ -4,7 +4,6 @@
id="contrastAnalysisBox"> id="contrastAnalysisBox">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-area <search-area
:isFold="isFold"
@submit="getList" @submit="getList"
@export="exportExl" /> @export="exportExl" />
<div v-show="chartData.length"> <div v-show="chartData.length">
@ -38,7 +37,6 @@ export default {
mixins: [tableHeightMixin], mixins: [tableHeightMixin],
data() { data() {
return { return {
isFold: false,
chartData: [], chartData: [],
timeDim: '', timeDim: '',
tableProps: [], tableProps: [],
@ -46,13 +44,6 @@ export default {
tableH: this.tableHeight(250) / 2, tableH: this.tableHeight(250) / 2,
}; };
}, },
mounted() {
window.addEventListener('resize', () => {
this.isFold = this.searchBarWidth('contrastAnalysisBox', 1437);
// console.log(document.getElementById("contrastAnalysisBox").offsetWidth)
});
this.isFold = this.searchBarWidth('contrastAnalysisBox', 1437);
},
methods: { methods: {
_setTableHeight() { _setTableHeight() {
this.tableH = this.tableHeight(250) / 2; this.tableH = this.tableHeight(250) / 2;

View File

@ -1,8 +1,7 @@
<template> <template>
<div <div
class="searchBarBox divHeight" class="searchBarBox"
ref="searchBarRef" ref="searchBarRef">
:style="{ paddingRight: isFold ? '55px' : '0px' }">
<el-form <el-form
:inline="true" :inline="true"
class="demo-form-inline"> class="demo-form-inline">
@ -172,9 +171,9 @@
</el-button> </el-button>
<span <span
class="separateStyle" class="separateStyle"
v-hasPermi="['analysis:trend-analysis:export']"></span> v-hasPermi="['analysis:energy-analysis:query']"></span>
<el-button <el-button
v-hasPermi="['analysis:trend-analysis:export']" v-hasPermi="['analysis:energy-analysis:query']"
type="primary" type="primary"
size="small" size="small"
plain plain
@ -183,13 +182,6 @@
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span
v-if="isFold"
class="foldClass"
@click="switchMode">
{{ isExpand ? '收起' : '展开' }}
<svg-icon :icon-class="isExpand ? 'upward' : 'downward'" />
</span>
</div> </div>
</template> </template>
<script> <script>
@ -198,16 +190,8 @@ import { getEnergyTypeListAll } from '@/api/base/energyType';
import moment from 'moment'; import moment from 'moment';
export default { export default {
name: 'searchArea', name: 'searchArea',
props: {
isFold: {
//
type: Boolean,
default: false,
},
},
data() { data() {
return { return {
isExpand: false, //
// //
queryParams: { queryParams: {
energyTypeId: null, energyTypeId: null,
@ -509,16 +493,6 @@ export default {
let value = new Date(newData).getTime(); let value = new Date(newData).getTime();
return value; return value;
}, },
switchMode() {
//
this.isExpand = !this.isExpand;
const element = this.$refs.searchBarRef;
if (this.isExpand) {
element.classList.remove('divHeight');
} else {
element.classList.add('divHeight');
}
},
}, },
}; };
</script> </script>
@ -557,21 +531,6 @@ export default {
margin-bottom: 4px; margin-bottom: 4px;
} }
} }
.searchBarBox .foldClass {
position: absolute;
top: 14px;
right: 0;
cursor: pointer;
font-size: 12px;
color: #0b58ff;
}
.searchBarBox .foldClass .iconfont {
font-size: 14px;
}
.divHeight {
height: 45px;
overflow: hidden;
}
.separateStyle { .separateStyle {
display: inline-block; display: inline-block;
width: 1px; width: 1px;

View File

@ -4,7 +4,6 @@
id="trendAnalysisBox"> id="trendAnalysisBox">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-area <search-area
:isFold="isFold"
@submit="getList" @submit="getList"
@export="exportExl" /> @export="exportExl" />
<div v-show="chartData.length"> <div v-show="chartData.length">
@ -33,20 +32,12 @@ export default {
components: { SearchArea, LineChart }, components: { SearchArea, LineChart },
data() { data() {
return { return {
isFold: false,
chartData: [], chartData: [],
timeDim: '', timeDim: '',
tableProps: [], tableProps: [],
list: [], list: [],
}; };
}, },
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
this.isFold = this.searchBarWidth('trendAnalysisBox', 1480);
});
this.isFold = this.searchBarWidth('trendAnalysisBox', 1480);
},
methods: { methods: {
getList(params) { getList(params) {
this.timeDim = params.timeDim; this.timeDim = params.timeDim;

View File

@ -89,13 +89,13 @@ export default {
param: 'name', param: 'name',
}, },
{ {
type: 'button', type: this.$auth.hasPermi('base:energy-plc:query') ? 'button' : '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ {
type: 'separate', type: this.$auth.hasPermi('base:energy-plc:create') ? 'separate' : '',
}, },
{ {
type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '', type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '',

View File

@ -22,7 +22,9 @@
readonly readonly
style="width: 250px"></el-input> style="width: 250px"></el-input>
</el-form-item> </el-form-item>
<el-form-item v-if="showBtn"> <el-form-item
v-if="showBtn"
v-hasPermi="['base:energy-plc-param:create']">
<el-button <el-button
type="success" type="success"
size="small" size="small"
@ -160,15 +162,19 @@ export default {
this.drawerTitle = '参数绑定'; this.drawerTitle = '参数绑定';
this.showBtn = true; this.showBtn = true;
this.tableBtn = [ this.tableBtn = [
{ this.$auth.hasPermi('base:energy-plc-param:update')
? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
}, }
{ : undefined,
this.$auth.hasPermi('base:energy-plc-param:delete')
? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
}, }
]; : undefined,
].filter((v) => v);
} }
}, },
getList() { getList() {

View File

@ -107,13 +107,17 @@ export default {
param: 'cnName', param: 'cnName',
}, },
{ {
type: 'button', type: this.$auth.hasPermi('base:energy-plc-connect:query')
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ {
type: 'separate', type: this.$auth.hasPermi('base:energy-plc-connect:create')
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('base:energy-plc-connect:create') type: this.$auth.hasPermi('base:energy-plc-connect:create')
@ -127,17 +131,25 @@ export default {
], ],
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:energy-plc-connect:bind') this.$auth.hasPermiAnd([
'base:energy-plc-param:query',
'base:energy-type:query',
])
? { ? {
type: 'connect', type: 'connect',
btnName: '绑定', btnName: '绑定',
} }
: undefined, : undefined,
{ this.$auth.hasPermi('base:energy-plc-param:query')
? {
type: 'detail', type: 'detail',
btnName: '详情', btnName: '详情',
}, }
this.$auth.hasPermi('base:energy-plc-connect:update') : undefined,
this.$auth.hasPermiAnd([
'base:energy-plc-connect:update',
'base:energy-plc-connect:query',
])
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',

View File

@ -114,13 +114,20 @@ export default {
defaultSelect: [], defaultSelect: [],
}, },
{ {
type: 'button', type: this.$auth.hasPermi('base:energy-quantity-manual:query')
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ {
type: 'separate', type: this.$auth.hasPermiOr([
'base:energy-quantity-manual:export',
'base:energy-quantity-manual:create',
])
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('base:energy-quantity-manual:export') type: this.$auth.hasPermi('base:energy-quantity-manual:export')
@ -147,13 +154,19 @@ export default {
// //
list: [], list: [],
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:energy-quantity-manual:create') this.$auth.hasPermiAnd([
'base:energy-quantity-manual:query',
'base:energy-quantity-manual:create',
])
? { ? {
type: 'meterReading', type: 'meterReading',
btnName: '抄表', btnName: '抄表',
} }
: undefined, : undefined,
this.$auth.hasPermi('base:energy-quantity-manual:update') this.$auth.hasPermiAnd([
'base:energy-quantity-manual:update',
'base:energy-quantity-manual:query',
])
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',

View File

@ -90,7 +90,9 @@ export default {
width: 350, width: 350,
}, },
{ {
type: 'button', type: this.$auth.hasPermi('base:energy-quantity-realtime:query')
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@ -52,7 +52,10 @@ export default {
return { return {
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:table-name-config:edit') this.$auth.hasPermiAnd([
'base:energy-table:query',
'base:energy-table:update',
])
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',

View File

@ -125,13 +125,17 @@ export default {
param: 'limitType', param: 'limitType',
}, },
{ {
type: 'button', type: this.$auth.hasPermi('monitoring:energy-limit:query')
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ {
type: 'separate', type: this.$auth.hasPermi('monitoring:energy-limit:create')
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('monitoring:energy-limit:create') type: this.$auth.hasPermi('monitoring:energy-limit:create')

View File

@ -113,7 +113,9 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: 'separate', type: this.$auth.hasPermi('monitoring:energy-report:export')
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('monitoring:energy-report:export') type: this.$auth.hasPermi('monitoring:energy-report:export')

View File

@ -22,6 +22,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
v-hasPermi="['monitoring:energy-statistics-det:query']"
type="success" type="success"
size="small" size="small"
v-if="showBtn" v-if="showBtn"
@ -30,6 +31,7 @@
新增 新增
</el-button> </el-button>
<el-button <el-button
v-hasPermi="['monitoring:energy-statistics-det:delete']"
type="danger" type="danger"
size="small" size="small"
v-if="showBtn" v-if="showBtn"
@ -161,11 +163,13 @@ export default {
this.drawerTitle = '参数绑定'; this.drawerTitle = '参数绑定';
this.showBtn = true; this.showBtn = true;
this.tableBtn = [ this.tableBtn = [
{ this.$auth.hasPermi('monitoring:energy-statistics-det:delete')
? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
}, }
]; : undefined,
].filter((v) => v);
} }
}, },
getList() { getList() {

View File

@ -88,7 +88,9 @@ export default {
type: 'separate', type: 'separate',
}, },
{ {
type: 'button', type: this.$auth.hasPermi('monitoring:energy-statistics-det:create')
? 'button'
: '',
btnName: '关联', btnName: '关联',
name: 'add', name: 'add',
color: 'primary', color: 'primary',

View File

@ -104,7 +104,9 @@ export default {
color: 'primary', color: 'primary',
}, },
{ {
type: 'separate', type: this.$auth.hasPermi('monitoring:energy-statistics:create')
? 'separate'
: '',
}, },
{ {
type: this.$auth.hasPermi('monitoring:energy-statistics:create') type: this.$auth.hasPermi('monitoring:energy-statistics:create')
@ -118,17 +120,22 @@ export default {
], ],
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi('monitoring:energy-statistics:bind') this.$auth.hasPermi('monitoring:energy-statistics-det:query')
? { ? {
type: 'connect', type: 'connect',
btnName: '绑定', btnName: '绑定',
} }
: undefined, : undefined,
{ this.$auth.hasPermi('monitoring:energy-statistics:query')
? {
type: 'detail', type: 'detail',
btnName: '详情', btnName: '详情',
}, }
this.$auth.hasPermi('monitoring:energy-statistics:update') : undefined,
this.$auth.hasPermiAnd([
'monitoring:energy-statistics:update',
'monitoring:energy-statistics:query',
])
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',