Commit b2977701 by Jony.L

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

parent e924edf5
......@@ -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(.*)*',
component: () => import('@/views/Error/404.vue'),
name: '',
......
......@@ -166,7 +166,7 @@
<el-button
type="primary"
plain
@click="openForm('create')"
@click="openForm(undefined)"
v-hasPermi="['compute:resource-spu:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
......@@ -222,16 +222,15 @@
</div>
</template>
</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="ram" />
<el-table-column label="存储" align="center" prop="storage" />
<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="intro" min-width="200" />
<!-- <el-table-column label="算力资源分类编号" align="center" prop="categoryId" />-->
<el-table-column label="算力资源分类" align="center" prop="categoryName" min-width="150" />
<!-- 轮播图地址已隐藏 -->
<el-table-column label="总库存数量" align="center" prop="stock" />
<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">
<dict-tag :type="DICT_TYPE.COMPUTE_RESOURCE_SPU_STATUS" :value="scope.row.status" />
</template>
......@@ -248,7 +247,7 @@
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
@click="openForm(scope.row.id)"
v-hasPermi="['compute:resource-spu:update']"
>
编辑
......@@ -272,9 +271,6 @@
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗:添加/修改 -->
<ResourceSpuForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
......@@ -283,9 +279,10 @@ import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { createImageViewer } from '@/components/ImageViewer'
import { ResourceSpuApi, ResourceSpu } from '@/api/compute/resourcespu'
import ResourceSpuForm from './ResourceSpuForm.vue'
import {DICT_TYPE, getIntDictOptions} from "@/utils/dict";
const { push } = useRouter()
/** 算力资源SPU表(基础配置信息) 列表 */
defineOptions({ name: 'ResourceSpu' })
......@@ -344,10 +341,15 @@ const resetQuery = () => {
handleQuery()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
/** 新增或修改 */
const openForm = (id?: number) => {
// 修改
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