|
|
@ -1,142 +1,142 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<SearchTemplate> |
|
|
|
<el-form :inline="true"> |
|
|
|
<el-form-item label="菜单名称"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.title" |
|
|
|
placeholder="请输入菜单名称" |
|
|
|
clearable |
|
|
|
size="small" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button |
|
|
|
icon="el-icon-search" |
|
|
|
size="mini" |
|
|
|
class="search-button-style" |
|
|
|
@click="handleQuery" |
|
|
|
>搜索</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
class="reset-button-style" |
|
|
|
icon="el-icon-plus" |
|
|
|
size="mini" |
|
|
|
@click="setIsAddOrEdit" |
|
|
|
>新增</el-button |
|
|
|
> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</SearchTemplate> |
|
|
|
<ContentContainer> |
|
|
|
<el-table |
|
|
|
v-loading="loading" |
|
|
|
:data="tableData" |
|
|
|
row-key="menu_id" |
|
|
|
border |
|
|
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }" |
|
|
|
> |
|
|
|
<el-table-column |
|
|
|
prop="title" |
|
|
|
label="菜单名称" |
|
|
|
:show-overflow-tooltip="true" |
|
|
|
width="180px" |
|
|
|
/> |
|
|
|
<el-table-column prop="icon" label="图标" align="center" width="100px"> |
|
|
|
<template #default="scope"> |
|
|
|
<svg-icon :icon-class="scope.row.icon" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="path" label="路径" :show-overflow-tooltip="true"> |
|
|
|
<template #default="scope"> |
|
|
|
<span v-if="scope.row.menu_type == 'A'">{{ scope.row.path }}</span> |
|
|
|
<span v-else>{{ scope.row.component }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
label="创建时间" |
|
|
|
align="center" |
|
|
|
prop="createtime" |
|
|
|
width="180" |
|
|
|
> |
|
|
|
<template #default="scope"> |
|
|
|
<span>{{ parseTime(scope.row.createtime) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
label="操作" |
|
|
|
align="center" |
|
|
|
class-name="small-padding fixed-width" |
|
|
|
width="180" |
|
|
|
> |
|
|
|
<template #default="scope"> |
|
|
|
<el-button |
|
|
|
class="edit-button-style" |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-edit" |
|
|
|
@click="handleUpdate(scope.row)" |
|
|
|
>修改</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
class="edit-button-style" |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-delete" |
|
|
|
@click="handleDelete(scope.row)" |
|
|
|
>删除</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</ContentContainer> |
|
|
|
<AddOrEdit v-if="isAddOrEdit" @setIsAddOrEdit="setIsAddOrEdit" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import SearchTemplate from "@/components/SearchTemplate.vue"; |
|
|
|
import ContentContainer from "@/components/ContentContainer.vue"; |
|
|
|
import { ListMixin } from "@/mixins/ListMixin"; |
|
|
|
import { getMenuDetails } from "@/server/system/menu"; |
|
|
|
import AddOrEdit from "./addOrEdit.vue"; |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
SearchTemplate, |
|
|
|
ContentContainer, |
|
|
|
AddOrEdit |
|
|
|
}, |
|
|
|
mixins: [ListMixin], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
queryTableDataUrl: "/admin/menu/menulist", |
|
|
|
loading: false, |
|
|
|
isAddOrEdit:false |
|
|
|
}; |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 搜索按钮操作 |
|
|
|
handleQuery() { |
|
|
|
this.pagination.pageNumber = 1; |
|
|
|
this.getList(); |
|
|
|
}, |
|
|
|
// 新增菜单 |
|
|
|
setIsAddOrEdit() { |
|
|
|
this.isAddOrEdit=!this.isAddOrEdit; |
|
|
|
}, |
|
|
|
// 修改 |
|
|
|
handleUpdate() {}, |
|
|
|
// 删除 |
|
|
|
handleDelete() {}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
getMenuDetails({ id: 261 }).then((res) => { |
|
|
|
console.log(res); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
<style lang="less" scoped> |
|
|
|
.el-form-item { |
|
|
|
margin-bottom: 0; |
|
|
|
} |
|
|
|
</style> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<SearchTemplate> |
|
|
|
<el-form :inline="true"> |
|
|
|
<el-form-item label="菜单名称"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.title" |
|
|
|
placeholder="请输入菜单名称" |
|
|
|
clearable |
|
|
|
size="small" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button |
|
|
|
icon="el-icon-search" |
|
|
|
size="mini" |
|
|
|
class="search-button-style" |
|
|
|
@click="handleQuery" |
|
|
|
>搜索</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
class="reset-button-style" |
|
|
|
icon="el-icon-plus" |
|
|
|
size="mini" |
|
|
|
@click="setIsAddOrEdit" |
|
|
|
>新增</el-button |
|
|
|
> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</SearchTemplate> |
|
|
|
<ContentContainer> |
|
|
|
<el-table |
|
|
|
v-loading="loading" |
|
|
|
:data="tableData" |
|
|
|
row-key="menu_id" |
|
|
|
border |
|
|
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }" |
|
|
|
> |
|
|
|
<el-table-column |
|
|
|
prop="title" |
|
|
|
label="菜单名称" |
|
|
|
:show-overflow-tooltip="true" |
|
|
|
width="180px" |
|
|
|
/> |
|
|
|
<el-table-column prop="icon" label="图标" align="center" width="100px"> |
|
|
|
<template #default="scope"> |
|
|
|
<svg-icon :icon-class="scope.row.icon" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="path" label="路径" :show-overflow-tooltip="true"> |
|
|
|
<template #default="scope"> |
|
|
|
<span v-if="scope.row.menu_type == 'A'">{{ scope.row.path }}</span> |
|
|
|
<span v-else>{{ scope.row.component }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
label="创建时间" |
|
|
|
align="center" |
|
|
|
prop="createtime" |
|
|
|
width="180" |
|
|
|
> |
|
|
|
<template #default="scope"> |
|
|
|
<span>{{ parseTime(scope.row.createtime) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
label="操作" |
|
|
|
align="center" |
|
|
|
class-name="small-padding fixed-width" |
|
|
|
width="180" |
|
|
|
> |
|
|
|
<template #default="scope"> |
|
|
|
<el-button |
|
|
|
class="edit-button-style" |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-edit" |
|
|
|
@click="handleUpdate(scope.row)" |
|
|
|
>修改</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
class="edit-button-style" |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-delete" |
|
|
|
@click="handleDelete(scope.row)" |
|
|
|
>删除</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</ContentContainer> |
|
|
|
<AddOrEdit v-if="isAddOrEdit" @setIsAddOrEdit="setIsAddOrEdit" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import SearchTemplate from "@/components/SearchTemplate.vue"; |
|
|
|
import ContentContainer from "@/components/ContentContainer.vue"; |
|
|
|
import { ListMixin } from "@/mixins/ListMixin"; |
|
|
|
import { getMenuDetails } from "@/server/system/menu"; |
|
|
|
import AddOrEdit from "./addOrEdit.vue"; |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
SearchTemplate, |
|
|
|
ContentContainer, |
|
|
|
AddOrEdit |
|
|
|
}, |
|
|
|
mixins: [ListMixin], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
queryTableDataUrl: "/admin/menu/menulist", |
|
|
|
loading: false, |
|
|
|
isAddOrEdit:false |
|
|
|
}; |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 搜索按钮操作 |
|
|
|
handleQuery() { |
|
|
|
this.pagination.pageNumber = 1; |
|
|
|
this.getList(); |
|
|
|
}, |
|
|
|
// 新增菜单 |
|
|
|
setIsAddOrEdit() { |
|
|
|
this.isAddOrEdit=!this.isAddOrEdit; |
|
|
|
}, |
|
|
|
// 修改 |
|
|
|
handleUpdate() {}, |
|
|
|
// 删除 |
|
|
|
handleDelete() {}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
getMenuDetails({ id: 261 }).then((res) => { |
|
|
|
console.log(res); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
<style lang="less" scoped> |
|
|
|
.el-form-item { |
|
|
|
margin-bottom: 0; |
|
|
|
} |
|
|
|
</style> |