添加权限控制

newCac1.0
fanluyan 7 months ago
parent ad57243c3a
commit 40483e92cb

@ -6,8 +6,8 @@
mode="horizontal"
router
>
<template v-for="item in routeItem">
<template v-if="item.subs">
<template v-for="item in processedRouteItems">
<template v-if="item.subs && item.show">
<el-submenu :index="item.path" :key="item.path">
<template slot="title">
<span slot="title">{{ item.name }}</span>
@ -19,7 +19,7 @@
</template>
</el-submenu>
</template>
<template v-else>
<template v-else-if="item.show">
<el-menu-item :index="item.path" :key="item.path">
<span slot="title">{{ item.name }}</span>
</el-menu-item>
@ -115,8 +115,24 @@ export default {
],
},
],
rawMenus: "",
};
},
computed: {
processedRouteItems() {
// rawMenus
const menus = this.rawMenus.split(",").map(Number);
// routeItems show
return this.routeItem.map((item, index) => {
// item show
if (!item.hasOwnProperty("show")) {
return { ...item, show: menus[index] };
} else {
return { ...item, show: item.show && menus[index] }; //
}
});
},
},
mounted() {
console.log(window.location.host);
console.log(process.env.NODE_ENV);
@ -152,6 +168,8 @@ export default {
},
},
created() {
this.rawMenus = localStorage.getItem("menus") || "1,1,1,1,0,0,0"; //
console.log(this.menus);
this.setCurrentRoute();
},
};

@ -1150,6 +1150,18 @@ export function ieddlDelApi(data) {
});
}
// /ieddl/listFiles 查询文件和目录
export function ieddllistFilesApi(data) {
return request({
url: "/ieddl/listFiles",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//下载记录
export function ieddlDownloadAllApi(data) {
return request({

@ -17,7 +17,12 @@
:model="formInfo"
>
<el-form-item label="IED" prop="iedId">
<el-select v-model="formInfo.iedId" filterable placeholder="请选择">
<el-select
v-model="formInfo.iedId"
filterable
placeholder="请选择"
@change="changeIed"
>
<el-option
v-for="item in iedOptions"
:key="item.id"
@ -84,6 +89,7 @@ import {
ieddlUpdateApi,
listIedConfigApi,
monitoringListAllApi,
ieddllistFilesApi,
} from "@/utils/api/index";
export default {
props: ["title"],
@ -108,6 +114,7 @@ export default {
],
iedOptions: [],
devIdOptions: [],
iedId: "",
};
},
created() {},
@ -213,6 +220,23 @@ export default {
})
.catch((err) => {});
},
//ied
changeIed(val) {
console.log(val);
this.iedId = val;
this.getiedFileList();
},
//
getiedFileList() {
ieddllistFilesApi({
iedId: this.iedId,
path: "/",
})
.then((res) => {
console.log(res);
})
.catch((err) => {});
},
//
getmonitorList() {
monitoringListAllApi()

@ -99,7 +99,11 @@ export default {
if (res.success) {
console.log(res.data);
//this.$router.push("/weather");
localStorage.setItem("token", "13747c96ff9f434cb09ecf78e4b9a8bc");
localStorage.setItem(
"token",
"13747c96ff9f434cb09ecf78e4b9a8bc"
);
localStorage.setItem("menus", res.data.menus);
this.$message({
duration: 1500,
showClose: true,

@ -119,87 +119,40 @@
>历史数据</el-button
>
</div>
<el-tooltip placement="bottom-start">
<div slot="content">
<div class="textitem">
<h3 class="headTitle" :title="item.name">
{{ item.jgName }}/{{ item.zsbName }}/{{ item.name }}
</h3>
<p>
采集时间
<span v-if="item.lastData" class="timeclass">
{{ item.lastData.acquisitionTime }}
</span>
<span v-else class="timeclass"> -- </span>
</p>
<!-- 遍历 typePoints 显示数据 -->
<div
class="dataclass"
v-for="fieldDesc in item.typePoints"
:key="fieldDesc.field"
>
<strong
>{{ fieldDesc.fieldDesc || fieldDesc.field }}:</strong
>
<span
v-if="item.lastData && fieldDesc.field in item.lastData"
>
{{ getDataByField(item, fieldDesc.field) }}
</span>
<span v-else> -- </span>
</div>
<!-- 显示 lastData 中有但 typePoints 中没有的字段 -->
<div
class="dataclass"
v-for="(value, key) in item.lastData"
:key="key"
v-if="
!item.typePoints.some((fd) => fd.field === key) &&
key !== 'acquisitionTime'
"
>
<strong>{{ key }}:</strong>
{{ value }}
</div>
</div>
<div class="textitem">
<p>
采集时间
<span v-if="item.lastData" class="timeclass">
{{ item.lastData.acquisitionTime }}
</span>
<span v-else class="timeclass"> -- </span>
</p>
<!-- 遍历 typePoints 显示数据 -->
<div
class="dataclass"
v-for="fieldDesc in item.typePoints"
:key="fieldDesc.field"
>
<strong>{{ fieldDesc.fieldDesc || fieldDesc.field }}:</strong>
<span v-if="item.lastData && fieldDesc.field in item.lastData">
{{ getDataByField(item, fieldDesc.field) }}
</span>
<span v-else> -- </span>
</div>
<div class="textitem">
<p>
采集时间
<span v-if="item.lastData" class="timeclass">
{{ item.lastData.acquisitionTime }}
</span>
<span v-else class="timeclass"> -- </span>
</p>
<!-- 遍历 typePoints 显示数据 -->
<div
class="dataclass"
v-for="fieldDesc in item.typePoints"
:key="fieldDesc.field"
>
<strong>{{ fieldDesc.fieldDesc || fieldDesc.field }}:</strong>
<span
v-if="item.lastData && fieldDesc.field in item.lastData"
>
{{ getDataByField(item, fieldDesc.field) }}
</span>
<span v-else> -- </span>
</div>
<!-- 显示 lastData 中有但 typePoints 中没有的字段 -->
<div
class="dataclass"
v-for="(value, key) in item.lastData"
:key="key"
v-if="
!item.typePoints.some((fd) => fd.field === key) &&
key !== 'acquisitionTime'
"
>
<strong>{{ key }}:</strong>
{{ value }}
</div>
<!-- 显示 lastData 中有但 typePoints 中没有的字段 -->
<div
class="dataclass"
v-for="(value, key) in item.lastData"
:key="key"
v-if="
!item.typePoints.some((fd) => fd.field === key) &&
key !== 'acquisitionTime'
"
>
<strong>{{ key }}:</strong>
{{ value }}
</div>
</el-tooltip>
</div>
</el-card>
</div>
<div class="emptyBox" v-else>
@ -603,7 +556,7 @@ export default {
}
.el-card__body {
padding: 8px;
height: 78px;
height: auto;
.textitem {
height: 100%;
overflow: hidden;

Loading…
Cancel
Save