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
c43550c0
authored
Oct 22, 2025
by
Jony.L
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复算力资源sku管理页面中,点击编辑时SPU信息不显示的问题
parent
167cacff
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
src/views/compute/resourcesku/ResourceSkuForm.vue
+16
-2
No files found.
src/views/compute/resourcesku/ResourceSkuForm.vue
View file @
c43550c0
...
@@ -86,6 +86,7 @@
...
@@ -86,6 +86,7 @@
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ResourceSkuApi
,
ResourceSku
}
from
'@/api/compute/resourcesku'
import
{
ResourceSkuApi
,
ResourceSku
}
from
'@/api/compute/resourcesku'
import
{
ResourceSpuApi
}
from
'@/api/compute/resourcespu'
import
ResourceSpuSelectDialog
from
'../resourcespu/ResourceSpuSelectDialog.vue'
import
ResourceSpuSelectDialog
from
'../resourcespu/ResourceSpuSelectDialog.vue'
import
{
DICT_TYPE
,
getIntDictOptions
,
getStrDictOptions
}
from
"@/utils/dict"
import
{
DICT_TYPE
,
getIntDictOptions
,
getStrDictOptions
}
from
"@/utils/dict"
import
{
fenToYuan
,
yuanToFen
}
from
'@/utils'
import
{
fenToYuan
,
yuanToFen
}
from
'@/utils'
...
@@ -112,8 +113,15 @@ const formData = ref({
...
@@ -112,8 +113,15 @@ const formData = ref({
})
})
const
selectedSpuName
=
ref
(
''
)
// 选中的SPU名称显示
const
selectedSpuName
=
ref
(
''
)
// 选中的SPU名称显示
// 租赁时长选项
// 租赁时长选项 - 确保value为字符串类型以匹配后端返回的数字
const
durationOptions
=
getStrDictOptions
(
DICT_TYPE
.
COMPUTE_RESOURCE_DURATION
)
const
durationOptions
=
computed
(()
=>
{
const
options
=
getStrDictOptions
(
DICT_TYPE
.
COMPUTE_RESOURCE_DURATION
)
// 将字典中的value转换为数字类型,以便与后端返回的数字类型匹配
return
options
.
map
(
option
=>
({
...
option
,
value
:
option
.
value
===
'0'
?
0
:
Number
(
option
.
value
)
}))
})
// 价格的计算属性(元单位)
// 价格的计算属性(元单位)
const
paymentPriceYuan
=
computed
({
const
paymentPriceYuan
=
computed
({
...
@@ -150,6 +158,12 @@ const open = async (type: string, id?: number) => {
...
@@ -150,6 +158,12 @@ const open = async (type: string, id?: number) => {
formLoading
.
value
=
true
formLoading
.
value
=
true
try
{
try
{
formData
.
value
=
await
ResourceSkuApi
.
getResourceSku
(
id
)
formData
.
value
=
await
ResourceSkuApi
.
getResourceSku
(
id
)
// 获取关联的SPU信息并设置显示名称
if
(
formData
.
value
.
spuId
)
{
const
spuInfo
=
await
ResourceSpuApi
.
getResourceSpu
(
formData
.
value
.
spuId
)
selectedSpu
.
value
=
spuInfo
selectedSpuName
.
value
=
spuInfo
.
name
}
}
finally
{
}
finally
{
formLoading
.
value
=
false
formLoading
.
value
=
false
}
}
...
...
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