1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

分类管理增删改查完成

This commit is contained in:
2023-04-13 22:07:05 +08:00
parent 7dcf15fd79
commit bad6ecb111
19 changed files with 376 additions and 36 deletions

View File

@@ -12,6 +12,9 @@ declare module '@vue/runtime-core' {
ElAlert: typeof import('element-plus/es')['ElAlert']
ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCol: typeof import('element-plus/es')['ElCol']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDropdown: typeof import('element-plus/es')['ElDropdown']
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
@@ -26,14 +29,18 @@ declare module '@vue/runtime-core' {
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElProgress: typeof import('element-plus/es')['ElProgress']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElUpload: typeof import('element-plus/es')['ElUpload']
Header: typeof import('./src/components/header.vue')['default']
ImageUpload: typeof import('./src/components/image-upload.vue')['default']
ManageList: typeof import('./src/components/manage-list.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']

View File

@@ -0,0 +1,51 @@
import send_request from '../utils/send_request';
/**
* 获取商品列表
* @returns
*/
export function getCateList(params) {
return send_request({
url: '/shop/good/manage/getCategoryList',
method: 'GET',
params: params,
});
};
/**
* 添加/修改商品信息
* @returns
*/
export function editCate(params) {
return send_request({
url: '/shop/good/manage/editCategory',
method: 'POST',
useQS: true,
params: params,
});
};
/**
* 删除商品
* @returns
*/
export function deleteCate(params) {
return send_request({
url: '/shop/good/manage/deleteCategory',
method: 'POST',
useQS: true,
params: params,
});
};
/**
* 导出商品列表
* @returns
*/
export function exportCateList(params) {
return send_request({
url: '/shop/good/manage/exportCategoryList',
method: 'GET',
params: params,
});
};

View File

@@ -31,9 +31,6 @@
</span>
<template #dropdown>
<el-dropdown-menu>
<a href="https://github.com/lin-xin/vue-manage-system" target="_blank">
<el-dropdown-item>项目仓库</el-dropdown-item>
</a>
<el-dropdown-item command="user">个人中心</el-dropdown-item>
<el-dropdown-item divided command="loginout">退出登录</el-dropdown-item>
</el-dropdown-menu>

View File

@@ -28,14 +28,18 @@ const emit = defineEmits(['change'])
const handleHttpRequest = async (data: UploadRequestOptions) => {
console.log('httpRequest', data)
await cos.upload(data.file)
let result = await cos.upload(data.file)
console.log("result", result)
return result
}
const handleSuccess: UploadProps['onSuccess'] = (
response,
response, // 这里的 response 就是 handleHttpRequest 返回的结果
uploadFile
) => {
let url = URL.createObjectURL(uploadFile.raw!)
console.log("response", response)
// let url = URL.createObjectURL(uploadFile.raw!)
let url = "//" + response.Location
emit('change', url)
}

View File

@@ -73,9 +73,14 @@ const items = [
{
icon: 'OfficeBuilding',
index: '/shop',
title: '商品管理',
title: '生活物资',
permiss: 'shop',
subs: [
{
index: '/shop-cate-setting',
title: '分类管理',
permiss: 'shop-cate-setting',
},
{
index: '/shop-good-setting',
title: '商品管理',
@@ -86,7 +91,7 @@ const items = [
{
icon: 'Avatar',
index: '/privilege',
title: '用户管理',
title: '系统管理',
permiss: 'privilege',
subs: [
{

View File

@@ -31,6 +31,15 @@ const routes: RouteRecordRaw[] = [
},
component: () => import('../views/shop-good-setting.vue'),
},
{
path: '/shop-cate-setting',
name: 'shop-cate-setting',
meta: {
title: '分类管理',
permiss: 'shop-good-setting',
},
component: () => import('../views/shop-cate-setting.vue'),
},
{
path: '/privilege-user-setting',
name: 'privilege-user-setting',

View File

@@ -9,6 +9,7 @@ interface ObjectList {
export const usePermissStore = defineStore('permiss', {
state: () => {
return {
// 系统管理员
"1": [
"default",
@@ -16,10 +17,13 @@ export const usePermissStore = defineStore('permiss', {
"shop",
"shop-good-setting",
"shop-cate-setting",
"privilege",
"privilege-user-setting",
],
// 社区管理员
"2": [
"default",
@@ -27,6 +31,7 @@ export const usePermissStore = defineStore('permiss', {
"shop",
"shop-good-setting",
"shop-cate-setting",
"privilege",
"privilege-user-setting",

View File

@@ -0,0 +1,11 @@
<template>
<div class="container">
<manageList :list-func="shopCateApi.getCateList" :add-func="shopCateApi.editCate" :edit-func="shopCateApi.editCate"
:delete-func="shopCateApi.deleteCate" :export-func="shopCateApi.exportCateList" edit-permiss="shop-cate-setting" />
</div>
</template>
<script setup lang="ts">
import manageList from '../components/manage-list.vue';
import * as shopCateApi from '../api/shop-cate';
</script>