|
@@ -8,7 +8,7 @@
|
|
|
</el-form>
|
|
|
<!-- 表格 -->
|
|
|
<el-table :data="tableData" v-loading="loading">
|
|
|
- <el-table-column label="ID" prop="id" align="center" />
|
|
|
+ <el-table-column label="权限ID" prop="id" align="center" />
|
|
|
<el-table-column label="功能名称" prop="name" align="center" />
|
|
|
<el-table-column label="功能分类" prop="type" align="center"></el-table-column>
|
|
|
<el-table-column label="状态" align="center">
|
|
@@ -40,8 +40,8 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer">
|
|
|
- <el-button size="mini" @click="getCancel">取消</el-button>
|
|
|
- <el-button type="primary" size="mini" @click="getAdd">确定</el-button>
|
|
|
+ <el-button @click="getCancel">取消</el-button>
|
|
|
+ <el-button type="primary" @click="getSubmit">确定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -60,7 +60,11 @@ export default {
|
|
|
// 弹窗
|
|
|
dialogVisible: false,
|
|
|
title: "",
|
|
|
- form: {},
|
|
|
+ form: {
|
|
|
+ name: "",
|
|
|
+ type: "",
|
|
|
+ status: 0,
|
|
|
+ },
|
|
|
rules: {
|
|
|
name: [
|
|
|
{
|
|
@@ -95,32 +99,37 @@ export default {
|
|
|
this.loading = true;
|
|
|
functionList({ isDelete: 0 }).then((res) => {
|
|
|
if (res.data.code === 0) {
|
|
|
- console.log(res);
|
|
|
this.tableData = res.data.data;
|
|
|
this.loading = false;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- // 新增 / 编辑按钮
|
|
|
+ // 新增 / 编辑
|
|
|
getChange(row) {
|
|
|
this.dialogVisible = true;
|
|
|
- this.form = row ? row : {};
|
|
|
+ this.form = row
|
|
|
+ ? row
|
|
|
+ : {
|
|
|
+ name: "",
|
|
|
+ type: "",
|
|
|
+ status: 0,
|
|
|
+ };
|
|
|
this.title = row ? "编辑" : "新增";
|
|
|
},
|
|
|
|
|
|
// 取消
|
|
|
getCancel() {
|
|
|
- this.$refs.form.resetFields();
|
|
|
+ this.$refs.form.clearValidate();
|
|
|
this.dialogVisible = false;
|
|
|
},
|
|
|
|
|
|
// 确定
|
|
|
- getAdd() {
|
|
|
+ getSubmit() {
|
|
|
this.$refs.form.validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.form.id) {
|
|
|
- // 编辑
|
|
|
+ // 编辑
|
|
|
functionEdit(this.form).then((res) => {
|
|
|
if (res.code === 0) {
|
|
|
this.$message.success("修改成功!");
|