role1.0
fanluyan 1 year ago
parent 90acfc0a27
commit 45b1aacc7e

@ -121,10 +121,10 @@ export default {
index: "/userManagement",
title: "用户管理",
},
// {
// index: "/roleManagement",
// title: "",
// },
{
index: "/roleManagement",
title: "角色管理",
},
{
index: "/deviceUpgrade",
title: "升级管理",

@ -749,7 +749,7 @@ export function deleteRole(data) {
export function getPermissionTree(data) {
return request({
url: "/xymanager/role/getPermissionTree",
url: "/xymanager/user/getFullTree",
method: "get",
params: data,
});

@ -424,6 +424,7 @@ export default {
if (this.formInfo.list[0].id == "") {
this.$set(this.formInfo, "list", []);
}
console.log("修改aaaaaaaaaaaaaaa", this.formInfo);
updateTerminalJoggle(this.formInfo)
.then((res) => {
this.isShow = false;

@ -6,6 +6,17 @@
:close-on-click-modal="false"
width="1360px"
>
<div class="zzinfo">
<span v-if="rowInfo.protocol == '65280'"> I1 </span>
<span v-if="rowInfo.protocol == '65296'"> 西 </span>
<span v-if="rowInfo.protocol == '65281'"> </span>
<span v-if="rowInfo.protocol == '65282'"> </span>
<span v-if="rowInfo.protocol == '65283'"> </span>
<span v-if="rowInfo.protocol == '65284'"> </span>
<span v-if="rowInfo.protocol == '65285'"> </span>
<span v-if="rowInfo.protocol == '65286'"> </span>
<span v-if="rowInfo.protocol == '65290'"> v2020 </span>
</div>
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="开始日期">
<el-date-picker
@ -80,13 +91,22 @@
label="通信协议版本号"
show-overflow-tooltip
></el-table-column>
<!-- <el-table-column
prop="protocolVersion"
label="规约版本号V1.3"
show-overflow-tooltip
></el-table-column> -->
<el-table-column prop="bsManu" label="生产厂家"> </el-table-column>
<el-table-column
prop="productionDate"
label="生产日期"
show-overflow-tooltip
></el-table-column>
>
<template slot-scope="scope">
{{ $moment(scope.row.productionDate).format("YYYY-MM-DD") }}
</template>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@ -251,6 +271,11 @@ export default {
</script>
<style lang="less">
.baseInforDialog {
.zzinfo {
position: absolute;
top: 22px;
left: 126px;
}
.pageNation {
justify-content: flex-start;
margin-top: 16px;

@ -6,6 +6,17 @@
:close-on-click-modal="false"
width="1000px"
>
<div class="zzinfo">
<span v-if="rowInfo.protocol == '65280'"> I1 </span>
<span v-if="rowInfo.protocol == '65296'"> 西 </span>
<span v-if="rowInfo.protocol == '65281'"> </span>
<span v-if="rowInfo.protocol == '65282'"> </span>
<span v-if="rowInfo.protocol == '65283'"> </span>
<span v-if="rowInfo.protocol == '65284'"> </span>
<span v-if="rowInfo.protocol == '65285'"> </span>
<span v-if="rowInfo.protocol == '65286'"> </span>
<span v-if="rowInfo.protocol == '65290'"> v2020 </span>
</div>
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="开始日期">
<el-date-picker
@ -233,6 +244,11 @@ export default {
</script>
<style lang="less">
.faultInfo {
.zzinfo {
position: absolute;
top: 22px;
left: 126px;
}
.pageNation {
justify-content: flex-start;
margin-top: 16px;

@ -7,17 +7,6 @@
width="662px"
@close="handleclose"
>
<!-- <div class="gpsbox" v-loading="loading">
<p>
<span>经度</span><span>{{ infornr.longitude }}</span>
</p>
<p>
<span>纬度</span><span>{{ infornr.latitude }}</span>
</p>
<p>
<span>半径</span><span>{{ infornr.radius }}</span>
</p>
</div> -->
<div class="gpsbox" v-loading="loading">
<el-descriptions :column="1" border>
<el-descriptions-item>

@ -6,6 +6,17 @@
:close-on-click-modal="false"
width="1000px"
>
<div class="zzinfo">
<span v-if="rowInfo.protocol == '65280'"> I1 </span>
<span v-if="rowInfo.protocol == '65296'"> 西 </span>
<span v-if="rowInfo.protocol == '65281'"> </span>
<span v-if="rowInfo.protocol == '65282'"> </span>
<span v-if="rowInfo.protocol == '65283'"> </span>
<span v-if="rowInfo.protocol == '65284'"> </span>
<span v-if="rowInfo.protocol == '65285'"> </span>
<span v-if="rowInfo.protocol == '65286'"> </span>
<span v-if="rowInfo.protocol == '65290'"> v2020 </span>
</div>
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="开始日期">
<el-date-picker
@ -244,6 +255,11 @@ export default {
</script>
<style lang="less">
.gpsSiteDialog {
.zzinfo {
position: absolute;
top: 22px;
left: 126px;
}
.pageNation {
justify-content: flex-start;
margin-top: 16px;

@ -6,6 +6,17 @@
:close-on-click-modal="false"
width="1360px"
>
<div class="zzinfo">
<span v-if="rowInfo.protocol == '65280'"> I1 </span>
<span v-if="rowInfo.protocol == '65296'"> 西 </span>
<span v-if="rowInfo.protocol == '65281'"> </span>
<span v-if="rowInfo.protocol == '65282'"> </span>
<span v-if="rowInfo.protocol == '65283'"> </span>
<span v-if="rowInfo.protocol == '65284'"> </span>
<span v-if="rowInfo.protocol == '65285'"> </span>
<span v-if="rowInfo.protocol == '65286'"> </span>
<span v-if="rowInfo.protocol == '65290'"> v2020 </span>
</div>
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="开始日期">
<el-date-picker
@ -249,6 +260,11 @@ export default {
</script>
<style lang="less">
.runStatusDialog {
.zzinfo {
position: absolute;
top: 22px;
left: 126px;
}
.pageNation {
justify-content: flex-start;
margin-top: 16px;

@ -6,6 +6,17 @@
:close-on-click-modal="false"
width="1360px"
>
<div class="zzinfo">
<span v-if="rowInfo.protocol == '65280'"> I1 </span>
<span v-if="rowInfo.protocol == '65296'"> 西 </span>
<span v-if="rowInfo.protocol == '65281'"> </span>
<span v-if="rowInfo.protocol == '65282'"> </span>
<span v-if="rowInfo.protocol == '65283'"> </span>
<span v-if="rowInfo.protocol == '65284'"> </span>
<span v-if="rowInfo.protocol == '65285'"> </span>
<span v-if="rowInfo.protocol == '65286'"> </span>
<span v-if="rowInfo.protocol == '65290'"> v2020 </span>
</div>
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="开始日期">
<el-date-picker
@ -117,6 +128,11 @@
label="通信协议版本"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="protocolVersion"
label="GPRS信号强度"
show-overflow-tooltip
></el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@ -281,6 +297,11 @@ export default {
</script>
<style lang="less">
.workStatusBox {
.zzinfo {
position: absolute;
top: 22px;
left: 126px;
}
.pageNation {
justify-content: flex-start;
margin-top: 16px;

@ -340,7 +340,10 @@ export default {
{ name: "type13", value: 1 },
//productionDate
{ name: "name14", value: "productionDate" },
{ name: "value14", value: this.appForm.productionDate },
{
name: "value14",
value: Math.round(this.appForm.productionDate / 1000),
},
{ name: "type14", value: 0 },
//
{ name: "name15", value: "heartbeat" },
@ -505,7 +508,7 @@ export default {
this.appForm.model = resultContent.model; //
this.appForm.equipName = resultContent.equipName; //
this.appForm.bsManufacturer = resultContent.bsManufacturer; //
this.appForm.productionDate = resultContent.productionDate; //
this.appForm.productionDate = resultContent.productionDate * 1000; //
this.$message({
duration: 1500,
showClose: true,

@ -701,7 +701,18 @@ export default {
console.log(timeArr);
} else {
//
// if (this.$moment(Stime).isBefore(this.$moment(Etime))) {
// timeArr.push(Stime);
// Stime = this.$moment(Stime)
// .add(spanTime, "minute")
// .format("YYYY-MM-DD HH:mm:ss");
// } else if (this.$moment(Stime).isSame(this.$moment(Etime))) {
// // Stime = "";
// timeArr = [];
// // Stime = this.$moment(Stime)
// // .add(spanTime, "minute")
// // .format("YYYY-MM-DD HH:mm:ss");
// }
while (
this.$moment(Stime).isBefore(this.$moment(Etime)) ||
this.$moment(Stime).isSame(this.$moment(Etime))

@ -0,0 +1,125 @@
<template>
<el-dialog
class="addUserDialog"
:title="title"
:visible.sync="isShow"
:close-on-click-modal="false"
width="470px"
@close="handleclose"
>
<el-form
label-position="left"
ref="formInfo"
label-width="100px"
:rules="title == '新增' ? rules : xgrules"
:model="formdata"
>
<el-form-item label="角色名称:" prop="name">
<el-input
placeholder="请输入角色名称"
v-model="formdata.name"
autocomplete="off"
></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
<el-button type="primary" @click="submitForm()"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { addRole, updateRole } from "@/utils/api/index";
export default {
props: {
title: String,
},
data() {
return {
roleUser: "",
isShow: false,
formdata: {},
rules: {
name: [{ required: true, message: "请输入用户名", trigger: "blur" }],
},
xgrules: {
name: [{ required: true, message: "请输入用户名", trigger: "blur" }],
},
};
},
methods: {
//
getdataform(val) {
console.log(val);
if (val == null) {
return (this.formdata = {
name: "",
});
}
//this.formdata = val;
this.formdata = JSON.parse(JSON.stringify(val));
},
//
submitForm() {
this.$refs.formInfo.validate((valid) => {
if (valid) {
if (this.title == "新增") {
addRole(this.formdata)
.then((res) => {
if (res.code == 200) {
this.$message({
duration: 1500,
showClose: true,
message: "添加成功",
type: "success",
});
this.isShow = false;
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {});
} else {
updateRole(this.formdata)
.then((res) => {
if (res.code == 200) {
this.$message.success("修改成功");
this.isShow = false;
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {});
}
} else {
console.log("error submit!!");
return false;
}
});
},
display() {
this.isShow = true;
this.roleUser = localStorage.getItem("role");
},
hide() {
this.isShow = false;
},
handleclose() {
this.$parent.roleListAll();
},
},
mounted() {},
};
</script>
<style lang="less">
.addUserDialog {
.el-form-item {
.el-input,
.el-select,
.el-input-number {
width: 100%;
}
}
}
</style>

@ -0,0 +1,200 @@
<template>
<div class="rolemanagement">
<div class="deviceBox">
<div class="deviceBtnGroup">
<h4>角色管理</h4>
<el-button type="primary" icon="el-icon-plus" @click="handleAdddevice()"
>新增</el-button
>
</div>
<div class="deviceTable">
<el-table
ref="multipleTable"
:data="roleTableData"
stripe
tooltip-effect="dark"
style="width: 100%"
height="calc(100% - 40px)"
@row-click="handleRowClick"
>
<template slot="empty">
<el-empty :image-size="160" description="暂无数据"></el-empty>
</template>
<el-table-column
label="ID"
show-overflow-tooltip
prop="id"
></el-table-column>
<el-table-column
label="角色"
show-overflow-tooltip
prop="name"
></el-table-column>
<el-table-column
label="创建时间"
show-overflow-tooltip
prop="createTime"
>
<template slot-scope="scope" v-if="scope.row.createTime !== null">{{
$moment(scope.row.createTime).format("yy-MM-DD HH:mm:ss")
}}</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="200">
<template slot-scope="scope" v-if="scope.row.id !== 0">
<el-button
@click.native.stop="handleResive(scope.row)"
type="text"
>修改</el-button
>
<el-button
type="text"
class="deleteText"
@click.native.stop="handleDelete(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<!-- <div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
background
>
</el-pagination>
</div> -->
</div>
</div>
<!-- 新增 -->
<addRole :title="title" ref="adduserref"></addRole>
</div>
</template>
<script>
import addRole from "./components/addRole.vue";
import { getRoleList, deleteRole } from "@/utils/api/index";
export default {
name: "roleManagement",
components: {
addRole,
},
data() {
return {
title: "", //
roleTableData: [],
//multipleSelection: [], //
page: 1, //
pageSize: 20, //
total: 0, //
};
},
created() {
this.roleListAll();
},
methods: {
//线
roleListAll() {
getRoleList()
.then((res) => {
this.roleTableData = res.data;
this.total = res.data.total;
})
.catch((err) => {});
},
//
handleRowClick(row, column, event) {
this.$refs.multipleTable.toggleRowSelection(row);
},
//
handleSelectionChange(val) {
this.multipleSelection = val;
},
//
handleAdddevice() {
this.title = "新增";
this.$refs.adduserref.display();
this.$refs.adduserref.getdataform(null);
},
//
handleResive(data) {
this.title = "修改";
this.$refs.adduserref.display();
this.$refs.adduserref.getdataform(data);
},
//
handleDelete(data) {
console.log(data);
this.$confirm("确定要删除记录吗,同时删除关联关系?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
deleteRole({ id: data.id }).then((res) => {
console.log(res.code);
if (res.code == 200) {
this.$message.success("删除成功");
this.roleListAll(); //
} else if (res.code == 400) {
this.$message.error(res.msg);
}
});
})
.catch(() => {
this.$message({
duration: 1500,
showClose: true,
type: "info",
message: "已取消删除",
});
});
},
//
handleCurrentChange(val) {
this.page = val;
this.roleListAll();
},
//
handleSizeChange(val) {
this.pageSize = val;
this.roleListAll();
},
},
};
</script>
<style lang="less">
.rolemanagement {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
.deviceBox {
border: 1px solid #dddddd;
height: calc(100% - 24px);
padding: 12px;
border-radius: 4px;
}
.deviceBtnGroup {
display: flex;
justify-content: space-between;
align-items: center;
}
.deviceTable {
margin-top: 16px;
height: calc(100% - 48px);
//background: #fcc;
}
}
</style>
../user/components/blindPermiss.vue

@ -0,0 +1,203 @@
<template>
<el-dialog
class="blindDialog"
title="菜单功能绑定"
:visible.sync="isShow"
:close-on-click-modal="false"
width="470px"
@close="handleclose"
>
<div class="treeBoxList" v-loading="treeLoading"></div>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
<el-button type="primary" @click="submitForm()"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {
getPermissionTree,
getPermission,
changePermission,
} from "@/utils/api/index";
export default {
props: {},
data() {
return {
roleUser: "",
isShow: false,
treeData: [],
defaultProps: {
//
children: "list",
label: "name",
key: "compositeKey", // 使 uniqueKey
},
treeLoading: false,
rowData: "",
premissData: [],
selectTreeNode: [],
defaultExpandedArr: [],
rules: {
name: [{ required: true, message: "请输入用户名", trigger: "blur" }],
},
xgrules: {
name: [{ required: true, message: "请输入用户名", trigger: "blur" }],
},
};
},
methods: {
//
getdataform(val) {
this.rowData = JSON.parse(JSON.stringify(val));
},
//
getPermissionList() {
this.treeLoading = true;
getPermissionTree()
.then((res) => {
if (res.code == 200) {
console.log(res);
// this.treeLoading = false;
//this.treeData = res.data.list;
this.treeData = this.processData(res.data);
console.log(this.treeData);
// this.treeData.forEach((item) => {
// this.defaultExpandedArr.push(item.id);
// });
this.defaultExpandedArr.push(this.treeData[0].compositeKey);
// console.log("id", this.defaultExpandedArr);
this.getPermissionRole();
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {});
},
processData(data, level = 0) {
return data.map((node) => {
const compositeKey = `${level}-${node.id}`; //
node.compositeKey = compositeKey; //
if (node.list) {
node.list = this.processData(node.list, level + 1); //
}
return node;
});
},
//
getPermissionRole() {
console.log(this.rowData);
getPermission({ id: this.rowData.uid })
.then((res) => {
if (res.code == 200) {
console.log(res);
this.premissData = res.data;
// let setCheckedKeysList = this.premissData.map(function (item) {
// return item.resourceId;
// });
let setCheckedKeysList = [];
this.premissData.forEach((node) => {
if (node.resourceType == 1) {
console.log(node);
setCheckedKeysList.push("0-" + node.resourceId);
} else if (node.resourceType == 2) {
setCheckedKeysList.push("1-" + node.resourceId);
} else if (node.resourceType == 3) {
setCheckedKeysList.push("2-" + node.resourceId);
} else if (node.resourceType == 4) {
setCheckedKeysList.push("3-" + node.resourceId);
}
});
console.log(setCheckedKeysList);
this.$refs.tree.setCheckedKeys(setCheckedKeysList);
this.treeLoading = false;
// this.$nextTick(() => {
// this.$refs.tree.setCheckedKeys(setCheckedKeysList);
// this.treeLoading = false;
// });
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {});
},
//
submitForm() {
//
let originData = this.$refs.tree.store;
//
const checkedNodeIds = [];
//
const isAllChecked = function (node) {
const childNodes = node.root ? node.root.childNodes : node.childNodes;
childNodes.forEach((child) => {
if (child.checked) {
checkedNodeIds.push(child.data);
}
if (child.indeterminate) {
isAllChecked(child);
}
});
};
isAllChecked(originData);
console.log(checkedNodeIds);
//
let paramsList = [];
checkedNodeIds.forEach((node) => {
if ("dyValue" in node) {
console.log(node);
paramsList.push({ resourceType: 1, resourceId: node.id });
} else if ("bsManufacturer" in node) {
paramsList.push({ resourceType: 2, resourceId: node.id });
} else if ("lineid" in node) {
paramsList.push({ resourceType: 3, resourceId: node.id });
} else if ("towerid" in node) {
paramsList.push({ resourceType: 4, resourceId: node.id });
}
});
console.log(paramsList);
changePermission({
list: paramsList,
userId: this.rowData.uid,
})
.then((res) => {
if (res.code == 200) {
console.log(res);
this.isShow = false;
this.$message({
duration: 1500,
showClose: true,
message: "权限绑定成功",
type: "success",
});
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {});
},
display() {
this.isShow = true;
this.getPermissionList();
},
hide() {
this.isShow = false;
},
handleclose() {
this.treeData = [];
},
},
mounted() {},
};
</script>
<style lang="less">
.blindDialog {
.treeBoxList {
height: 600px;
overflow: auto;
.el-dialog__body {
overflow: auto;
}
}
}
</style>

@ -47,7 +47,11 @@
type="text"
>修改</el-button
>
<el-button
@click.native.stop="handleMenuBlind(scope.row)"
type="text"
>菜单功能分配</el-button
>
<el-button
type="text"
class="deleteText"
@ -73,17 +77,20 @@
</div>
<!-- 新增 -->
<addRole :title="title" ref="adduserref"></addRole>
<!-- 权限绑定 -->
<blindMenuPermiss ref="blindMenuPermissRef"></blindMenuPermiss>
</div>
</template>
<script>
import addRole from "./components/addRole.vue";
import blindMenuPermiss from "./components/blindMenuPermiss.vue";
import { getRoleList, deleteRole } from "@/utils/api/index";
export default {
name: "roleManagement",
components: {
addRole,
blindMenuPermiss,
},
data() {
return {
@ -129,6 +136,12 @@ export default {
this.$refs.adduserref.display();
this.$refs.adduserref.getdataform(data);
},
//
handleMenuBlind(row) {
console.log(row);
this.$refs.blindMenuPermissRef.display();
this.$refs.blindMenuPermissRef.getdataform(data);
},
//
handleDelete(data) {

@ -23,7 +23,7 @@ module.exports = defineConfig({
//表示拦截以/api开头的请求路径
//target: "http://47.96.238.157:8093", //阿里云服务器环境
target: "http://180.166.218.222:40080", //dell
//target: "http://192.168.50.7:8094", //liu 本机ip
//target: "http://192.168.1.190:8080", //liu 本机ip
// target: "http://192.168.50.42:81", //东视
changOrigin: true, //是否开启跨域
pathRewrite: {

Loading…
Cancel
Save