Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
84548daa
authored
Feb 26, 2026
by
Jony.L
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
平台总体态势 真实数据; 后台添加算力资源spu中的算力来源:合作、自有、社会
parent
bc35ed9d
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
68 additions
and
14 deletions
+68
-14
src/api/Home/count/index.ts
+5
-0
src/api/compute/resourcespu/index.ts
+1
-0
src/utils/dict.ts
+1
-0
src/views/Home/Home.vue
+8
-8
src/views/Home/apiEchart.vue
+9
-2
src/views/Home/userManage.vue
+8
-2
src/views/compute/resourcespu/form/index.vue
+14
-1
src/views/compute/resourcespu/index.vue
+22
-1
No files found.
src/api/Home/count/index.ts
View file @
84548daa
...
@@ -33,4 +33,9 @@ export const getTopBarData = async () => {
...
@@ -33,4 +33,9 @@ export const getTopBarData = async () => {
})
})
}
}
export
const
getOverallSituation
=
async
()
=>
{
return
await
request
.
get
({
url
:
`/index/count/getOverallSituation`
,
})
}
src/api/compute/resourcespu/index.ts
View file @
84548daa
...
@@ -20,6 +20,7 @@ export interface ResourceSpu {
...
@@ -20,6 +20,7 @@ export interface ResourceSpu {
initPassword
?:
string
;
// 初始密码
initPassword
?:
string
;
// 初始密码
intro
?:
string
;
// 商品简介
intro
?:
string
;
// 商品简介
categoryId
?:
number
;
// 算力资源分类编号
categoryId
?:
number
;
// 算力资源分类编号
source
?:
string
;
// 算力来源
picUrl
?:
string
;
// 商品封面图
picUrl
?:
string
;
// 商品封面图
sliderPicUrls
?:
string
;
// 商品轮播图地址,以逗号分隔,最多15张
sliderPicUrls
?:
string
;
// 商品轮播图地址,以逗号分隔,最多15张
stock
?:
number
;
// 总库存数量
stock
?:
number
;
// 总库存数量
...
...
src/utils/dict.ts
View file @
84548daa
...
@@ -181,6 +181,7 @@ export enum DICT_TYPE {
...
@@ -181,6 +181,7 @@ export enum DICT_TYPE {
COMPUTE_RESOURCE_DURATION
=
'compute_resource_duration'
,
COMPUTE_RESOURCE_DURATION
=
'compute_resource_duration'
,
COMPUTE_RESOURCE_ORDER_STATUS
=
'compute_resource_order_status'
,
COMPUTE_RESOURCE_ORDER_STATUS
=
'compute_resource_order_status'
,
COMPUTE_RESOURCE_REFUND_STATUS
=
'compute_resource_refund_status'
,
COMPUTE_RESOURCE_REFUND_STATUS
=
'compute_resource_refund_status'
,
COMPUTE_RESOURCE_SOURCE
=
'compute_resource_source'
,
// ========== MALL - 商品模块 ==========
// ========== MALL - 商品模块 ==========
PRODUCT_SPU_STATUS
=
'product_spu_status'
,
//商品状态
PRODUCT_SPU_STATUS
=
'product_spu_status'
,
//商品状态
...
...
src/views/Home/Home.vue
View file @
84548daa
...
@@ -13,19 +13,19 @@
...
@@ -13,19 +13,19 @@
<div
class=
"header-title"
>
平台总体态势
</div>
<div
class=
"header-title"
>
平台总体态势
</div>
<div
class=
"cumulative-delivery"
>
<div
class=
"cumulative-delivery"
>
<img
src=
"@/assets/images/cumulative-delivery-icon.png"
alt=
""
/>
<img
src=
"@/assets/images/cumulative-delivery-icon.png"
alt=
""
/>
<span
class=
"label"
style=
"margin-left: 20px"
>
算力总规模(
P
TOPS)
</span>
<span
class=
"label"
style=
"margin-left: 20px"
>
算力总规模(TOPS)
</span>
<span
class=
"value"
>
<span
class=
"value"
>
{{
dashboardData
.
overallSituation
.
allCompute
}}
{{
dashboardData
.
overallSituation
.
allCompute
}}
P
TOPS
</span>
TOPS
</span>
</div>
</div>
<div
class=
"statistical"
>
<div
class=
"statistical"
>
<div
class=
"statistical-item"
>
<div
class=
"statistical-item"
>
<i></i>
<i></i>
<div>
<div>
<div
class=
"label"
>
已租赁算力(
P
TOPS)
</div>
<div
class=
"label"
>
已租赁算力(TOPS)
</div>
<div
class=
"value"
>
<div
class=
"value"
>
{{
dashboardData
.
overallSituation
.
leaseCompute
}}
P
TOPS
{{
dashboardData
.
overallSituation
.
leaseCompute
}}
TOPS
<!-- 139.94
<!-- 139.94
<animation-count
:end-val=
"53632"
decimals
:range-min=
"0.01"
:range-max=
"0.02"
/>
-->
<animation-count
:end-val=
"53632"
decimals
:range-min=
"0.01"
:range-max=
"0.02"
/>
-->
</div>
</div>
...
@@ -231,15 +231,15 @@ const fetchAllMockData = async () => {
...
@@ -231,15 +231,15 @@ const fetchAllMockData = async () => {
const
fetchRealData
=
async
()
=>
{
const
fetchRealData
=
async
()
=>
{
try
{
try
{
// 并行调用所有真实数据接口
// 并行调用所有真实数据接口
const
[
topBar
Res
,
apiCallsRes
,
usersRes
]
=
await
Promise
.
all
([
const
[
overall
Res
,
apiCallsRes
,
usersRes
]
=
await
Promise
.
all
([
IndexCountApi
.
get
TopBarData
(),
IndexCountApi
.
get
OverallSituation
(),
IndexCountApi
.
getApiCallsData
(
'm'
),
IndexCountApi
.
getApiCallsData
(
'm'
),
IndexCountApi
.
getUsersData
(
'd'
)
IndexCountApi
.
getUsersData
(
'd'
)
])
])
// 总体态势数据
// 总体态势数据
if
(
topBar
Res
)
{
if
(
overall
Res
)
{
dashboardData
.
value
.
overallSituation
=
topBar
Res
dashboardData
.
value
.
overallSituation
=
overall
Res
}
}
// API 调用趋势
// API 调用趋势
...
...
src/views/Home/apiEchart.vue
View file @
84548daa
...
@@ -121,13 +121,15 @@ const outerPadding = ref('0px')
...
@@ -121,13 +121,15 @@ const outerPadding = ref('0px')
// 从 dashboardData 获取图表数据
// 从 dashboardData 获取图表数据
const
getChartData
=
()
=>
{
const
getChartData
=
()
=>
{
const
data
=
dashboardData
.
value
.
apiCalls
||
[]
const
apiCalls
=
dashboardData
.
value
.
apiCalls
||
{}
const
data
=
apiCalls
[
rangeType
.
value
]
||
[]
if
(
!
Array
.
isArray
(
data
))
{
if
(
!
Array
.
isArray
(
data
))
{
return
{
x
:
[],
y
:
[]
}
return
{
x
:
[],
y
:
[]
}
}
}
// 根据数据格式转换为图表数据
// 根据数据格式转换为图表数据
// apiCalls 格式: [{countDate: "2025-01-01", callsCount: 1202}, ...]
// apiCalls
[d/m/y]
格式: [{countDate: "2025-01-01", callsCount: 1202}, ...]
const
x
=
data
.
map
(
item
=>
{
const
x
=
data
.
map
(
item
=>
{
const
date
=
new
Date
(
item
.
countDate
)
const
date
=
new
Date
(
item
.
countDate
)
const
m
=
String
(
date
.
getMonth
()
+
1
).
padStart
(
2
,
'0'
)
const
m
=
String
(
date
.
getMonth
()
+
1
).
padStart
(
2
,
'0'
)
...
@@ -254,6 +256,11 @@ watch(() => dashboardData.value.apiCalls, () => {
...
@@ -254,6 +256,11 @@ watch(() => dashboardData.value.apiCalls, () => {
render
()
render
()
},
{
deep
:
true
})
},
{
deep
:
true
})
// 监听维度切换
watch
(
rangeType
,
()
=>
{
render
()
})
onBeforeUnmount
(()
=>
{
onBeforeUnmount
(()
=>
{
window
.
removeEventListener
(
'resize'
,
onResize
)
window
.
removeEventListener
(
'resize'
,
onResize
)
document
.
removeEventListener
(
'fullscreenchange'
,
onFsChange
)
document
.
removeEventListener
(
'fullscreenchange'
,
onFsChange
)
...
...
src/views/Home/userManage.vue
View file @
84548daa
...
@@ -90,8 +90,9 @@ function getOption(xData: string[], growth: number[], active: number[]): ECharts
...
@@ -90,8 +90,9 @@ function getOption(xData: string[], growth: number[], active: number[]): ECharts
}
}
async
function
render
()
{
async
function
render
()
{
// 直接从 dashboardData 获取数据
// 从 dashboardData 获取对应维度的数据
const
arr
=
dashboardData
.
value
.
users
||
[]
const
users
=
dashboardData
.
value
.
users
||
{}
const
arr
=
users
[
dateType
.
value
]
||
[]
const
x
=
arr
.
map
((
item
:
any
)
=>
t
(
item
.
countDate
))
const
x
=
arr
.
map
((
item
:
any
)
=>
t
(
item
.
countDate
))
const
growth
=
arr
.
map
((
item
:
any
)
=>
item
.
growthUsersCount
??
item
.
usersCount
??
0
)
const
growth
=
arr
.
map
((
item
:
any
)
=>
item
.
growthUsersCount
??
item
.
usersCount
??
0
)
...
@@ -120,6 +121,11 @@ watch(() => dashboardData.value.users, () => {
...
@@ -120,6 +121,11 @@ watch(() => dashboardData.value.users, () => {
render
()
render
()
},
{
deep
:
true
})
},
{
deep
:
true
})
// 监听维度切换
watch
(
dateType
,
()
=>
{
render
()
})
onMounted
(()
=>
{
onMounted
(()
=>
{
render
()
render
()
window
.
addEventListener
(
'resize'
,
onResize
)
window
.
addEventListener
(
'resize'
,
onResize
)
...
...
src/views/compute/resourcespu/form/index.vue
View file @
84548daa
...
@@ -30,6 +30,18 @@
...
@@ -30,6 +30,18 @@
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<!-- 3.1 算力来源 -->
<el-form-item
label=
"算力来源"
prop=
"source"
>
<el-select
v-model=
"formData.source"
placeholder=
"请选择算力来源"
clearable
style=
"width: 200px;"
:disabled=
"isDetailMode"
>
<el-option
v-for=
"dict in getStrDictOptions(DICT_TYPE.COMPUTE_RESOURCE_SOURCE)"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
<!-- 4. 硬件配置 - inline布局 -->
<!-- 4. 硬件配置 - inline布局 -->
<div
style=
"display: flex; margin-bottom: 16px;"
>
<div
style=
"display: flex; margin-bottom: 16px;"
>
<el-form-item
label=
"CPU配置"
prop=
"cpu"
style=
"margin-right: 20px; margin-bottom: 0;"
>
<el-form-item
label=
"CPU配置"
prop=
"cpu"
style=
"margin-right: 20px; margin-bottom: 0;"
>
...
@@ -200,7 +212,7 @@
...
@@ -200,7 +212,7 @@
</
template
>
</
template
>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
DICT_TYPE
,
getIntDictOptions
}
from
'@/utils/dict'
import
{
DICT_TYPE
,
getIntDictOptions
,
getStrDictOptions
}
from
'@/utils/dict'
import
{
UploadImg
}
from
'@/components/UploadFile'
import
{
UploadImg
}
from
'@/components/UploadFile'
import
{
useTagsViewStore
}
from
'@/store/modules/tagsView'
import
{
useTagsViewStore
}
from
'@/store/modules/tagsView'
import
{
useResourceConfigStore
}
from
'@/store/modules/compute/hardwareConfig'
import
{
useResourceConfigStore
}
from
'@/store/modules/compute/hardwareConfig'
...
@@ -250,6 +262,7 @@ const formData = ref<ResourceSpu>({
...
@@ -250,6 +262,7 @@ const formData = ref<ResourceSpu>({
initPassword
:
undefined
,
initPassword
:
undefined
,
intro
:
undefined
,
intro
:
undefined
,
categoryId
:
undefined
,
categoryId
:
undefined
,
source
:
undefined
,
picUrl
:
undefined
,
picUrl
:
undefined
,
sliderPicUrls
:
undefined
,
sliderPicUrls
:
undefined
,
compute
:
undefined
,
compute
:
undefined
,
...
...
src/views/compute/resourcespu/index.vue
View file @
84548daa
...
@@ -128,6 +128,21 @@
...
@@ -128,6 +128,21 @@
/>
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"算力来源"
prop=
"source"
>
<el-select
v-model=
"queryParams.source"
placeholder=
"请选择算力来源"
clearable
class=
"!w-240px"
>
<el-option
v-for=
"dict in getStrDictOptions(DICT_TYPE.COMPUTE_RESOURCE_SOURCE)"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"服务器所在地"
prop=
"location"
>
<el-form-item
label=
"服务器所在地"
prop=
"location"
>
<el-select
<el-select
v-model=
"queryParams.location"
v-model=
"queryParams.location"
...
@@ -270,6 +285,11 @@
...
@@ -270,6 +285,11 @@
<!-- 硬件配置字段已隐藏 -->
<!-- 硬件配置字段已隐藏 -->
<!-- <el-table-column label="算力资源分类编号" align="center" prop="categoryId" />-->
<!-- <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=
"categoryName"
min-width=
"150"
/>
<el-table-column
label=
"算力来源"
align=
"center"
prop=
"source"
min-width=
"120"
>
<
template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.COMPUTE_RESOURCE_SOURCE"
:value=
"scope.row.source"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"服务器所在地"
align=
"center"
prop=
"location"
min-width=
"120"
/>
<el-table-column
label=
"服务器所在地"
align=
"center"
prop=
"location"
min-width=
"120"
/>
<el-table-column
label=
"商品简介"
align=
"center"
prop=
"intro"
min-width=
"200"
/>
<el-table-column
label=
"商品简介"
align=
"center"
prop=
"intro"
min-width=
"200"
/>
...
@@ -333,7 +353,7 @@ import { dateFormatter } from '@/utils/formatTime'
...
@@ -333,7 +353,7 @@ 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
{
DICT_TYPE
,
getIntDictOptions
}
from
"@/utils/dict"
;
import
{
DICT_TYPE
,
getIntDictOptions
,
getStrDictOptions
}
from
"@/utils/dict"
;
import
{
useResourceConfigStore
}
from
'@/store/modules/compute/hardwareConfig'
import
{
useResourceConfigStore
}
from
'@/store/modules/compute/hardwareConfig'
const
{
push
}
=
useRouter
()
const
{
push
}
=
useRouter
()
...
@@ -362,6 +382,7 @@ const queryParams = reactive({
...
@@ -362,6 +382,7 @@ const queryParams = reactive({
initPassword
:
undefined
,
initPassword
:
undefined
,
intro
:
undefined
,
intro
:
undefined
,
categoryId
:
undefined
,
categoryId
:
undefined
,
source
:
undefined
,
location
:
undefined
,
location
:
undefined
,
picUrl
:
undefined
,
picUrl
:
undefined
,
sliderPicUrls
:
undefined
,
sliderPicUrls
:
undefined
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment