|
@@ -69,12 +69,12 @@
|
|
|
:data="tableData"
|
|
:data="tableData"
|
|
|
v-loading="loading"
|
|
v-loading="loading"
|
|
|
stripe
|
|
stripe
|
|
|
- style="width: 100%;overflow-y: auto"
|
|
|
|
|
|
|
+ style="width: 100%; overflow-y: auto"
|
|
|
:height="48 * 13"
|
|
:height="48 * 13"
|
|
|
>
|
|
>
|
|
|
<el-table-column prop="ind" label="序号">
|
|
<el-table-column prop="ind" label="序号">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ ((page-1)*20)+scope.row.ind}}</span>
|
|
|
|
|
|
|
+ <span>{{ (page - 1) * 20 + scope.row.ind }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -125,6 +125,7 @@
|
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
|
:close-on-press-escape="false"
|
|
:close-on-press-escape="false"
|
|
|
:visible.sync="addrUserVisible"
|
|
:visible.sync="addrUserVisible"
|
|
|
|
|
+ @close="addrUserclose"
|
|
|
width="500px"
|
|
width="500px"
|
|
|
>
|
|
>
|
|
|
<el-form ref="form" :rules="rules" :model="form" label-width="90px">
|
|
<el-form ref="form" :rules="rules" :model="form" label-width="90px">
|
|
@@ -207,13 +208,13 @@ export default {
|
|
|
addrUserVisible: false,
|
|
addrUserVisible: false,
|
|
|
form: {
|
|
form: {
|
|
|
name: "",
|
|
name: "",
|
|
|
- describe: ""
|
|
|
|
|
|
|
+ describe: "",
|
|
|
},
|
|
},
|
|
|
rules: {
|
|
rules: {
|
|
|
name: [{ required: true, message: "请输入角色名称", trigger: "blur" }],
|
|
name: [{ required: true, message: "请输入角色名称", trigger: "blur" }],
|
|
|
describe: [
|
|
describe: [
|
|
|
- { required: true, message: "请输入角色描述", trigger: "blur" }
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ { required: true, message: "请输入角色描述", trigger: "blur" },
|
|
|
|
|
+ ],
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 分配权限
|
|
// 分配权限
|
|
@@ -225,11 +226,11 @@ export default {
|
|
|
// 树形控件的属性绑定对象
|
|
// 树形控件的属性绑定对象
|
|
|
treeProps: {
|
|
treeProps: {
|
|
|
label: "purview_name",
|
|
label: "purview_name",
|
|
|
- children: "children"
|
|
|
|
|
|
|
+ children: "children",
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
isClick: true, // 防止重复弹框
|
|
isClick: true, // 防止重复弹框
|
|
|
- submitBtn: false // 防止弹框确定按钮重复请求
|
|
|
|
|
|
|
+ submitBtn: false, // 防止弹框确定按钮重复请求
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
//监听属性 类似于data概念
|
|
//监听属性 类似于data概念
|
|
@@ -251,7 +252,7 @@ export default {
|
|
|
this.fullHeight = val;
|
|
this.fullHeight = val;
|
|
|
this.timer = true;
|
|
this.timer = true;
|
|
|
let that = this;
|
|
let that = this;
|
|
|
- setTimeout(function() {
|
|
|
|
|
|
|
+ setTimeout(function () {
|
|
|
//防止过度调用监测事件,导致卡顿
|
|
//防止过度调用监测事件,导致卡顿
|
|
|
that.timer = false;
|
|
that.timer = false;
|
|
|
}, 400);
|
|
}, 400);
|
|
@@ -262,7 +263,7 @@ export default {
|
|
|
if (val == false) {
|
|
if (val == false) {
|
|
|
this.defKeys = [];
|
|
this.defKeys = [];
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
//方法集合
|
|
//方法集合
|
|
|
methods: {
|
|
methods: {
|
|
@@ -284,10 +285,10 @@ export default {
|
|
|
data: this.qs.stringify({
|
|
data: this.qs.stringify({
|
|
|
page: this.page,
|
|
page: this.page,
|
|
|
page_item: "20",
|
|
page_item: "20",
|
|
|
- role_name: this.input
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ role_name: this.input,
|
|
|
|
|
+ }),
|
|
|
})
|
|
})
|
|
|
- .then(res => {
|
|
|
|
|
|
|
+ .then((res) => {
|
|
|
if (res.data.data.total_item !== 0) {
|
|
if (res.data.data.total_item !== 0) {
|
|
|
var data = res.data.data.page_list;
|
|
var data = res.data.data.page_list;
|
|
|
this.pagesum = res.data.data.total_item;
|
|
this.pagesum = res.data.data.total_item;
|
|
@@ -303,7 +304,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
})
|
|
})
|
|
|
- .catch(err => {
|
|
|
|
|
|
|
+ .catch((err) => {
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -335,9 +336,15 @@ export default {
|
|
|
this.form.describe = data.role_message; // 角色描述
|
|
this.form.describe = data.role_message; // 角色描述
|
|
|
this.addrUserVisible = true;
|
|
this.addrUserVisible = true;
|
|
|
},
|
|
},
|
|
|
|
|
+ //弹框关闭回调
|
|
|
|
|
+ addrUserclose() {
|
|
|
|
|
+ console.log(5555555555)
|
|
|
|
|
+ this.form.name = ''; // 角色名称
|
|
|
|
|
+ this.form.describe = ''; // 角色描述
|
|
|
|
|
+ },
|
|
|
// 添加、编辑角色确定
|
|
// 添加、编辑角色确定
|
|
|
submitForm() {
|
|
submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
|
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
if (this.tltData == "添加角色") {
|
|
if (this.tltData == "添加角色") {
|
|
|
// 添加
|
|
// 添加
|
|
@@ -360,17 +367,17 @@ export default {
|
|
|
url: "/api/api_gateway?method=sysmenage.usermanager.role_add",
|
|
url: "/api/api_gateway?method=sysmenage.usermanager.role_add",
|
|
|
data: this.qs.stringify({
|
|
data: this.qs.stringify({
|
|
|
role_name: this.form.name,
|
|
role_name: this.form.name,
|
|
|
- role_message: this.form.describe
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ role_message: this.form.describe,
|
|
|
|
|
+ }),
|
|
|
})
|
|
})
|
|
|
- .then(res => {
|
|
|
|
|
|
|
+ .then((res) => {
|
|
|
if (res.data.data == true) {
|
|
if (res.data.data == true) {
|
|
|
if (document.getElementsByClassName("el-message").length == 0) {
|
|
if (document.getElementsByClassName("el-message").length == 0) {
|
|
|
- this.$message({
|
|
|
|
|
- message: "成功!",
|
|
|
|
|
- type: "success",
|
|
|
|
|
- duration: 1500
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: "成功!",
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ duration: 1500,
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
this.addrUserVisible = false;
|
|
this.addrUserVisible = false;
|
|
|
this.tabListData();
|
|
this.tabListData();
|
|
@@ -378,7 +385,7 @@ export default {
|
|
|
this.submitBtn = false;
|
|
this.submitBtn = false;
|
|
|
// this.addrUserVisible = false;
|
|
// this.addrUserVisible = false;
|
|
|
})
|
|
})
|
|
|
- .catch(err => {
|
|
|
|
|
|
|
+ .catch((err) => {
|
|
|
this.submitBtn = false;
|
|
this.submitBtn = false;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -392,17 +399,17 @@ export default {
|
|
|
data: this.qs.stringify({
|
|
data: this.qs.stringify({
|
|
|
role_id: this.describeData.id,
|
|
role_id: this.describeData.id,
|
|
|
role_name: this.form.name,
|
|
role_name: this.form.name,
|
|
|
- role_message: this.form.describe
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ role_message: this.form.describe,
|
|
|
|
|
+ }),
|
|
|
})
|
|
})
|
|
|
- .then(res => {
|
|
|
|
|
|
|
+ .then((res) => {
|
|
|
if (res.data.data == true) {
|
|
if (res.data.data == true) {
|
|
|
if (document.getElementsByClassName("el-message").length == 0) {
|
|
if (document.getElementsByClassName("el-message").length == 0) {
|
|
|
- this.$message({
|
|
|
|
|
- message: "成功!",
|
|
|
|
|
- type: "success",
|
|
|
|
|
- duration: 1500
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: "成功!",
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ duration: 1500,
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
this.addrUserVisible = false;
|
|
this.addrUserVisible = false;
|
|
|
this.tabListData();
|
|
this.tabListData();
|
|
@@ -410,7 +417,7 @@ export default {
|
|
|
this.addrUserVisible = false;
|
|
this.addrUserVisible = false;
|
|
|
this.submitBtn = false;
|
|
this.submitBtn = false;
|
|
|
})
|
|
})
|
|
|
- .catch(err => {
|
|
|
|
|
|
|
+ .catch((err) => {
|
|
|
this.submitBtn = false;
|
|
this.submitBtn = false;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -423,9 +430,9 @@ export default {
|
|
|
this.isClick = false;
|
|
this.isClick = false;
|
|
|
this.$axios({
|
|
this.$axios({
|
|
|
method: "POST",
|
|
method: "POST",
|
|
|
- url: "/api/api_gateway?method=sysmenage.usermanager.user_info"
|
|
|
|
|
|
|
+ url: "/api/api_gateway?method=sysmenage.usermanager.user_info",
|
|
|
})
|
|
})
|
|
|
- .then(res => {
|
|
|
|
|
|
|
+ .then((res) => {
|
|
|
if (res.data.message == "") {
|
|
if (res.data.message == "") {
|
|
|
var data = res.data.data.children;
|
|
var data = res.data.data.children;
|
|
|
this.rightsList = [];
|
|
this.rightsList = [];
|
|
@@ -434,14 +441,14 @@ export default {
|
|
|
} else {
|
|
} else {
|
|
|
this.rightsList = [];
|
|
this.rightsList = [];
|
|
|
if (document.getElementsByClassName("el-message").length == 0) {
|
|
if (document.getElementsByClassName("el-message").length == 0) {
|
|
|
- this.$message.error("获取权限列表失败!");
|
|
|
|
|
|
|
+ this.$message.error("获取权限列表失败!");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
that.isClick = true;
|
|
that.isClick = true;
|
|
|
}, 2500);
|
|
}, 2500);
|
|
|
})
|
|
})
|
|
|
- .catch(err => {
|
|
|
|
|
|
|
+ .catch((err) => {
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
that.isClick = true;
|
|
that.isClick = true;
|
|
|
}, 2500);
|
|
}, 2500);
|
|
@@ -454,10 +461,10 @@ export default {
|
|
|
method: "POST",
|
|
method: "POST",
|
|
|
url: "/api/api_gateway?method=sysmenage.usermanager.role_info",
|
|
url: "/api/api_gateway?method=sysmenage.usermanager.role_info",
|
|
|
data: this.qs.stringify({
|
|
data: this.qs.stringify({
|
|
|
- role_id: this.describeData.id //角色ID
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ role_id: this.describeData.id, //角色ID
|
|
|
|
|
+ }),
|
|
|
})
|
|
})
|
|
|
- .then(res => {
|
|
|
|
|
|
|
+ .then((res) => {
|
|
|
if (res.data.data) {
|
|
if (res.data.data) {
|
|
|
this.setRightDialogVisible = true;
|
|
this.setRightDialogVisible = true;
|
|
|
var list = this.tableData;
|
|
var list = this.tableData;
|
|
@@ -475,14 +482,14 @@ export default {
|
|
|
// this.tabListData = list;
|
|
// this.tabListData = list;
|
|
|
// this.tableData = list;
|
|
// this.tableData = list;
|
|
|
})
|
|
})
|
|
|
- .catch(err => {});
|
|
|
|
|
|
|
+ .catch((err) => {});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
getLeafkeys(node, arr) {
|
|
getLeafkeys(node, arr) {
|
|
|
if (!node.children) {
|
|
if (!node.children) {
|
|
|
return arr.push(node.pur_id);
|
|
return arr.push(node.pur_id);
|
|
|
}
|
|
}
|
|
|
- node.children.forEach(item => this.getLeafkeys(item, arr));
|
|
|
|
|
|
|
+ node.children.forEach((item) => this.getLeafkeys(item, arr));
|
|
|
},
|
|
},
|
|
|
setRightDialogClosed() {
|
|
setRightDialogClosed() {
|
|
|
this.rightsList = [];
|
|
this.rightsList = [];
|
|
@@ -494,7 +501,7 @@ export default {
|
|
|
// 获得当前选中的Id
|
|
// 获得当前选中的Id
|
|
|
const keys = [
|
|
const keys = [
|
|
|
...this.$refs.treeRef.getCheckedKeys(),
|
|
...this.$refs.treeRef.getCheckedKeys(),
|
|
|
- ...this.$refs.treeRef.getHalfCheckedKeys()
|
|
|
|
|
|
|
+ ...this.$refs.treeRef.getHalfCheckedKeys(),
|
|
|
];
|
|
];
|
|
|
const idStr = keys.join(",");
|
|
const idStr = keys.join(",");
|
|
|
this.$axios({
|
|
this.$axios({
|
|
@@ -502,20 +509,20 @@ export default {
|
|
|
url: "/api/api_gateway?method=sysmenage.usermanager.role_perm",
|
|
url: "/api/api_gateway?method=sysmenage.usermanager.role_perm",
|
|
|
data: this.qs.stringify({
|
|
data: this.qs.stringify({
|
|
|
pur_id: idStr, // 权限id
|
|
pur_id: idStr, // 权限id
|
|
|
- role_id: this.describeData.id // 角色id
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ role_id: this.describeData.id, // 角色id
|
|
|
|
|
+ }),
|
|
|
})
|
|
})
|
|
|
- .then(res => {
|
|
|
|
|
|
|
+ .then((res) => {
|
|
|
if (res.data.message == "") {
|
|
if (res.data.message == "") {
|
|
|
if (document.getElementsByClassName("el-message").length == 0) {
|
|
if (document.getElementsByClassName("el-message").length == 0) {
|
|
|
- this.$message.success("分配权限成功!");
|
|
|
|
|
|
|
+ this.$message.success("分配权限成功!");
|
|
|
}
|
|
}
|
|
|
that.setRightDialogVisible = false;
|
|
that.setRightDialogVisible = false;
|
|
|
that.tabListData();
|
|
that.tabListData();
|
|
|
}
|
|
}
|
|
|
this.submitBtn = false;
|
|
this.submitBtn = false;
|
|
|
})
|
|
})
|
|
|
- .catch(err => {
|
|
|
|
|
|
|
+ .catch((err) => {
|
|
|
this.submitBtn = false;
|
|
this.submitBtn = false;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -525,39 +532,39 @@ export default {
|
|
|
this.$confirm("此操作将永久删除, 是否继续?", "提示", {
|
|
this.$confirm("此操作将永久删除, 是否继续?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
|
|
|
|
+ type: "warning",
|
|
|
})
|
|
})
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
this.$axios({
|
|
this.$axios({
|
|
|
method: "POST",
|
|
method: "POST",
|
|
|
url: "/api/api_gateway?method=sysmenage.usermanager.role_delete",
|
|
url: "/api/api_gateway?method=sysmenage.usermanager.role_delete",
|
|
|
data: this.qs.stringify({
|
|
data: this.qs.stringify({
|
|
|
- role_id: data.id
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ role_id: data.id,
|
|
|
|
|
+ }),
|
|
|
})
|
|
})
|
|
|
- .then(res => {
|
|
|
|
|
|
|
+ .then((res) => {
|
|
|
if (res.data.message == "") {
|
|
if (res.data.message == "") {
|
|
|
if (document.getElementsByClassName("el-message").length == 0) {
|
|
if (document.getElementsByClassName("el-message").length == 0) {
|
|
|
- this.$message({
|
|
|
|
|
- type: "success",
|
|
|
|
|
- message: "删除成功!",
|
|
|
|
|
- duration: 1500
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ message: "删除成功!",
|
|
|
|
|
+ duration: 1500,
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
this.tabListData();
|
|
this.tabListData();
|
|
|
})
|
|
})
|
|
|
- .catch(err => {});
|
|
|
|
|
|
|
+ .catch((err) => {});
|
|
|
})
|
|
})
|
|
|
.catch(() => {
|
|
.catch(() => {
|
|
|
if (document.getElementsByClassName("el-message").length == 0) {
|
|
if (document.getElementsByClassName("el-message").length == 0) {
|
|
|
- this.$message({
|
|
|
|
|
- type: "info",
|
|
|
|
|
- message: "已取消删除"
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: "info",
|
|
|
|
|
+ message: "已取消删除",
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {},
|
|
created() {},
|
|
@@ -572,7 +579,7 @@ export default {
|
|
|
updated() {}, //生命周期 - 更新之后
|
|
updated() {}, //生命周期 - 更新之后
|
|
|
beforeDestroy() {}, //生命周期 - 销毁之前
|
|
beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
destroyed() {}, //生命周期 - 销毁完成
|
|
destroyed() {}, //生命周期 - 销毁完成
|
|
|
- activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
|
|
|
|
+ activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
@@ -610,7 +617,8 @@ export default {
|
|
|
|
|
|
|
|
// 文本域样式更改
|
|
// 文本域样式更改
|
|
|
/deep/.el-textarea__inner {
|
|
/deep/.el-textarea__inner {
|
|
|
- font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
|
|
|
|
|
|
|
+ font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
|
|
|
|
|
+ "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/deep/.el-button--info {
|
|
/deep/.el-button--info {
|