Commit b2977701 by Jony.L

算力资源重构-算力资源SPU管理修改1.1

parent e924edf5
...@@ -696,6 +696,42 @@ const remainingRouter: AppRouteRecordRaw[] = [ ...@@ -696,6 +696,42 @@ const remainingRouter: AppRouteRecordRaw[] = [
] ]
}, },
{ {
path: '/compute',
component: Layout,
name: 'Compute',
meta: {
hidden: true
},
children: [
{
path: 'resource-spu/add',
component: () => import('@/views/compute/resourcespu/form/index.vue'),
name: 'ResourceSpuAdd',
meta: {
noCache: false,
hidden: true,
canTo: true,
icon: 'ep:edit',
title: '算力资源添加',
activeMenu: '/compute/resource-spu'
}
},
{
path: 'resource-spu/edit/:id(\\d+)',
component: () => import('@/views/compute/resourcespu/form/index.vue'),
name: 'ResourceSpuEdit',
meta: {
noCache: true,
hidden: true,
canTo: true,
icon: 'ep:edit',
title: '算力资源编辑',
activeMenu: '/compute/resource-spu'
}
}
]
},
{
path: '/:pathMatch(.*)*', path: '/:pathMatch(.*)*',
component: () => import('@/views/Error/404.vue'), component: () => import('@/views/Error/404.vue'),
name: '', name: '',
......
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
<el-button <el-button
type="primary" type="primary"
plain plain
@click="openForm('create')" @click="openForm(undefined)"
v-hasPermi="['compute:resource-spu:create']" v-hasPermi="['compute:resource-spu:create']"
> >
<Icon icon="ep:plus" class="mr-5px" /> 新增 <Icon icon="ep:plus" class="mr-5px" /> 新增
...@@ -222,16 +222,15 @@ ...@@ -222,16 +222,15 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="CPU配置" align="center" prop="cpu" /> <!-- 硬件配置字段已隐藏 -->
<el-table-column label="GPU配置" align="center" prop="gpu" /> <el-table-column label="商品简介" align="center" prop="intro" min-width="200" />
<el-table-column label="内存" align="center" prop="ram" /> <!-- <el-table-column label="算力资源分类编号" align="center" prop="categoryId" />-->
<el-table-column label="存储" align="center" prop="storage" /> <el-table-column label="算力资源分类" align="center" prop="categoryName" min-width="150" />
<el-table-column label="商品简介" align="center" prop="intro" />
<el-table-column label="算力资源分类编号" align="center" prop="categoryId" /> <!-- 轮播图地址已隐藏 -->
<el-table-column label="商品轮播图地址" align="center" prop="sliderPicUrls" />
<el-table-column label="总库存数量" align="center" prop="stock" /> <el-table-column label="总库存数量" align="center" prop="stock" />
<el-table-column label="商品销量" align="center" prop="sales" /> <el-table-column label="商品销量" align="center" prop="sales" />
<el-table-column label="状态" align="center" min-width="150" prop="status"> <el-table-column label="状态" align="center" width="80" prop="status">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.COMPUTE_RESOURCE_SPU_STATUS" :value="scope.row.status" /> <dict-tag :type="DICT_TYPE.COMPUTE_RESOURCE_SPU_STATUS" :value="scope.row.status" />
</template> </template>
...@@ -248,7 +247,7 @@ ...@@ -248,7 +247,7 @@
<el-button <el-button
link link
type="primary" type="primary"
@click="openForm('update', scope.row.id)" @click="openForm(scope.row.id)"
v-hasPermi="['compute:resource-spu:update']" v-hasPermi="['compute:resource-spu:update']"
> >
编辑 编辑
...@@ -272,9 +271,6 @@ ...@@ -272,9 +271,6 @@
@pagination="getList" @pagination="getList"
/> />
</ContentWrap> </ContentWrap>
<!-- 表单弹窗:添加/修改 -->
<ResourceSpuForm ref="formRef" @success="getList" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
...@@ -283,9 +279,10 @@ import { dateFormatter } from '@/utils/formatTime' ...@@ -283,9 +279,10 @@ import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download' import download from '@/utils/download'
import { createImageViewer } from '@/components/ImageViewer' import { createImageViewer } from '@/components/ImageViewer'
import { ResourceSpuApi, ResourceSpu } from '@/api/compute/resourcespu' import { ResourceSpuApi, ResourceSpu } from '@/api/compute/resourcespu'
import ResourceSpuForm from './ResourceSpuForm.vue'
import {DICT_TYPE, getIntDictOptions} from "@/utils/dict"; import {DICT_TYPE, getIntDictOptions} from "@/utils/dict";
const { push } = useRouter()
/** 算力资源SPU表(基础配置信息) 列表 */ /** 算力资源SPU表(基础配置信息) 列表 */
defineOptions({ name: 'ResourceSpu' }) defineOptions({ name: 'ResourceSpu' })
...@@ -344,10 +341,15 @@ const resetQuery = () => { ...@@ -344,10 +341,15 @@ const resetQuery = () => {
handleQuery() handleQuery()
} }
/** 添加/修改操作 */ /** 新增或修改 */
const formRef = ref() const openForm = (id?: number) => {
const openForm = (type: string, id?: number) => { // 修改
formRef.value.open(type, id) if (typeof id === 'number') {
push({ name: 'ResourceSpuEdit', params: { id } })
return
}
// 新增
push({ name: 'ResourceSpuAdd' })
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment