添加通道设置,app设置
parent
c30be6e10c
commit
2dc62f2d57
@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div class="buttonBox">
|
||||
<el-button type="primary" @click="handleSetChannel">APP设置 </el-button>
|
||||
<setAppDialog ref="setChannelDialog_ref"></setAppDialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {} from "@/utils/api/index";
|
||||
import setAppDialog from "./setAppDialog.vue";
|
||||
export default {
|
||||
components: { setAppDialog },
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
watch: {},
|
||||
mounted() {},
|
||||
computed: {
|
||||
termId() {
|
||||
return this.$store.state.termId;
|
||||
},
|
||||
channelIdList() {
|
||||
return this.$store.state.channelIdList;
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleSetChannel() {
|
||||
this.$refs.setChannelDialog_ref.display();
|
||||
},
|
||||
},
|
||||
destroyed() {},
|
||||
beforeRouteLeave(to, from, next) {},
|
||||
};
|
||||
</script>
|
@ -0,0 +1,129 @@
|
||||
<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="roleName">
|
||||
<el-input
|
||||
placeholder="请输入角色名称"
|
||||
v-model="formdata.roleName"
|
||||
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 { addUserApi, updateUserApi } from "@/utils/api/index";
|
||||
export default {
|
||||
props: {
|
||||
title: String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
roleUser: "",
|
||||
isShow: false,
|
||||
|
||||
formdata: {},
|
||||
rules: {
|
||||
roleName: [
|
||||
{ required: true, message: "请输入用户名", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
xgrules: {
|
||||
roleName: [
|
||||
{ required: true, message: "请输入用户名", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//判断
|
||||
getdataform(val) {
|
||||
console.log(val);
|
||||
if (val == null) {
|
||||
return (this.formdata = {
|
||||
role: 2,
|
||||
});
|
||||
}
|
||||
//this.formdata = val;
|
||||
this.formdata = JSON.parse(JSON.stringify(val));
|
||||
},
|
||||
// 保存确定操作
|
||||
submitForm() {
|
||||
this.$refs.formInfo.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.title == "新增") {
|
||||
addUserApi(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 {
|
||||
updateUserApi(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.deviceList();
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
<style lang="less">
|
||||
.addUserDialog {
|
||||
.el-form-item {
|
||||
.el-input,
|
||||
.el-select,
|
||||
.el-input-number {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,193 @@
|
||||
<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="deviceTableData"
|
||||
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="角色"
|
||||
show-overflow-tooltip
|
||||
prop="userName"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
show-overflow-tooltip
|
||||
prop="createTime"
|
||||
>
|
||||
<template slot-scope="scope">{{
|
||||
$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">
|
||||
<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 { getUserList, delUserApi } from "@/utils/api/index";
|
||||
|
||||
export default {
|
||||
name: "roleManagement",
|
||||
components: {
|
||||
addRole,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: "", //弹窗标题
|
||||
deviceTableData: [],
|
||||
//multipleSelection: [], //获取当前选中
|
||||
page: 1, // 当前页数
|
||||
pageSize: 20, // 每页数量
|
||||
total: 0, //总条数
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.deviceList();
|
||||
},
|
||||
methods: {
|
||||
//获取线路列表数据
|
||||
deviceList() {
|
||||
getUserList({
|
||||
pageindex: this.page,
|
||||
pagesize: this.pageSize,
|
||||
})
|
||||
.then((res) => {
|
||||
this.deviceTableData = res.data.list;
|
||||
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) {
|
||||
this.$confirm("确定要删除记录吗,同时删除关联关系?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
delUserApi({ uid: data.userId }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$message.success("删除成功");
|
||||
this.deviceList(); //刷新
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
duration: 1500,
|
||||
showClose: true,
|
||||
type: "info",
|
||||
message: "已取消删除",
|
||||
});
|
||||
});
|
||||
},
|
||||
//点击分页
|
||||
handleCurrentChange(val) {
|
||||
this.page = val;
|
||||
this.deviceList();
|
||||
},
|
||||
//每页条数
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val;
|
||||
this.deviceList();
|
||||
},
|
||||
},
|
||||
};
|
||||
</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>
|
Loading…
Reference in New Issue