|
|
@@ -7,29 +7,26 @@
|
|
|
>新增</a-button
|
|
|
>
|
|
|
</div>
|
|
|
- <a-table
|
|
|
- :columns="columns"
|
|
|
- :dataSource="tableList"
|
|
|
- :pagination="false"
|
|
|
- :loading="loading"
|
|
|
- style="background: #fff"
|
|
|
- :customRow="customRow"
|
|
|
- >
|
|
|
- <div class="operation-list" slot="operation" slot-scope="text, record">
|
|
|
- <a-button type="danger" @click="delMenu({ text, record })"
|
|
|
- >删除
|
|
|
- </a-button>
|
|
|
- <a-button type="primary" @click="editMenu({ text, record })"
|
|
|
- >编辑</a-button
|
|
|
- >
|
|
|
- <!-- <a-button type="primary" @click="editMenu({ text, record }, 'auth')"
|
|
|
- >数据权限</a-button
|
|
|
- >
|
|
|
- <a-button type="danger" @click="delMenu({ text, record }, 'auth')"
|
|
|
- >清空</a-button
|
|
|
- > -->
|
|
|
- </div>
|
|
|
- </a-table>
|
|
|
+ <a-spin :spinning="loading">
|
|
|
+ <a-table
|
|
|
+ :columns="columns"
|
|
|
+ :dataSource="tableList"
|
|
|
+ :pagination="false"
|
|
|
+ style="background: #fff"
|
|
|
+ :customRow="customRow"
|
|
|
+ rowKey="id"
|
|
|
+ >
|
|
|
+ <div class="operation-list" slot="operation" slot-scope="text, record">
|
|
|
+ <a-button type="danger" @click="delMenu({ text, record })"
|
|
|
+ >删除
|
|
|
+ </a-button>
|
|
|
+ <a-button type="primary" @click="editMenu({ text, record })"
|
|
|
+ >编辑</a-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </a-table>
|
|
|
+ </a-spin>
|
|
|
+
|
|
|
<a-modal
|
|
|
v-model="visible"
|
|
|
:title="title"
|
|
|
@@ -47,7 +44,7 @@
|
|
|
<a-radio-group :default-value="'目录'" v-model="dataForm.type">
|
|
|
<a-radio
|
|
|
v-for="(item, index) in menuTypeList"
|
|
|
- :key="item"
|
|
|
+ :key="index"
|
|
|
:value="index"
|
|
|
>
|
|
|
{{ item }}
|
|
|
@@ -201,7 +198,6 @@ const columns = [
|
|
|
{
|
|
|
title: "ID",
|
|
|
dataIndex: "id",
|
|
|
- //
|
|
|
},
|
|
|
|
|
|
{
|
|
|
@@ -241,6 +237,7 @@ const columns = [
|
|
|
];
|
|
|
|
|
|
export default {
|
|
|
+ components: {},
|
|
|
data() {
|
|
|
return {
|
|
|
visible: false,
|
|
|
@@ -389,6 +386,7 @@ export default {
|
|
|
.then((res) => {
|
|
|
if (res.data.code === 200) {
|
|
|
that.$message.success("操作成功");
|
|
|
+ that.loading = false;
|
|
|
that.getList();
|
|
|
}
|
|
|
});
|
|
|
@@ -398,6 +396,7 @@ export default {
|
|
|
.then((res) => {
|
|
|
if (res.data.code === 200) {
|
|
|
that.$message.success("操作成功");
|
|
|
+ that.loading = false;
|
|
|
that.getList();
|
|
|
}
|
|
|
});
|
|
|
@@ -412,6 +411,7 @@ export default {
|
|
|
editMenu(item, type) {
|
|
|
this.title = "编辑";
|
|
|
this.visible = true;
|
|
|
+
|
|
|
this.$nextTick(() => {
|
|
|
this.dataForm = { ...item.record };
|
|
|
|
|
|
@@ -425,7 +425,6 @@ export default {
|
|
|
this.$API.sysManage
|
|
|
.getMenuAuthItem({ menuId: item.record.id })
|
|
|
.then((res) => {
|
|
|
- console.log(res);
|
|
|
if (res.data.code === 200) {
|
|
|
this.authPermissions = { ...res.data.data };
|
|
|
}
|
|
|
@@ -440,11 +439,14 @@ export default {
|
|
|
},
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- this.$API.sysManage.getMenuList().then((res) => {
|
|
|
+ this.$API.sysManage.getMenuList({}).then((res) => {
|
|
|
if (res.data.code === 200) {
|
|
|
this.loading = false;
|
|
|
|
|
|
this.tableList = [...res.data.data];
|
|
|
+ } else {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.error(res.data.msg);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -452,6 +454,8 @@ export default {
|
|
|
this.title = "新增";
|
|
|
this.visible = true;
|
|
|
this.dataForm = { ...this.resetForm };
|
|
|
+ this.form.setFieldsValue({ ["name"]: "" });
|
|
|
+ this.form.setFieldsValue({ ["url"]: "" });
|
|
|
},
|
|
|
handleOk() {
|
|
|
this.form.validateFields((err, values) => {
|
|
|
@@ -477,6 +481,7 @@ export default {
|
|
|
this.$message.success("操作成功");
|
|
|
this.confirmLoading = false;
|
|
|
this.visible = false;
|
|
|
+ this.loading = false;
|
|
|
this.getList();
|
|
|
}
|
|
|
});
|
|
|
@@ -492,6 +497,7 @@ export default {
|
|
|
this.$message.success("操作成功");
|
|
|
this.confirmLoading = false;
|
|
|
this.visible = false;
|
|
|
+ this.loading = false;
|
|
|
this.getList();
|
|
|
}
|
|
|
});
|
|
|
@@ -506,6 +512,8 @@ export default {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
background: #fff;
|
|
|
+ padding: 15px;
|
|
|
+ box-sizing: border-box;
|
|
|
.menu-head {
|
|
|
display: flex;
|
|
|
button {
|