Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
corporateCulture-qd
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王立鹏
corporateCulture-qd
Commits
0ca6abec
Commit
0ca6abec
authored
Dec 23, 2025
by
lijiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【需求 17679】 perf: 优化类型
parent
9a58bcf0
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
70 deletions
+36
-70
index.ts
src/api/backend/shop/index.ts
+9
-4
types.ts
src/api/backend/shop/types.ts
+21
-2
actionButtons.vue
src/views/articleDetail/components/actionButtons.vue
+2
-2
index.vue
src/views/backend/goodsDistribution/index.vue
+2
-51
index.vue
src/views/backend/goodsManage/index.vue
+2
-10
tsconfig.app.json
tsconfig.app.json
+0
-1
No files found.
src/api/backend/shop/index.ts
View file @
0ca6abec
import
service
from
'@/utils/request/index'
import
type
{
BackendShopItemDto
,
AddOrUpdateShopItemDto
}
from
'./types'
import
type
{
BackendServicePageResult
,
PageSearchParams
}
from
'@/utils/request/types'
import
type
{
BackendShopItemDto
,
AddOrUpdateShopItemDto
,
BackendExchangeListSearchParams
,
BackendShopListSearchParams
,
}
from
'./types'
import
type
{
BackendServicePageResult
}
from
'@/utils/request/types'
// 后台管理 积分商城相关接口
/**
* 商品配置列表
*/
export
const
getShopItemList
=
(
params
:
Page
SearchParams
)
=>
{
export
const
getShopItemList
=
(
params
:
BackendShopList
SearchParams
)
=>
{
return
service
.
request
<
BackendServicePageResult
<
BackendShopItemDto
>>
({
url
:
'/api/culture/shop/item/productList'
,
method
:
'POST'
,
...
...
@@ -37,7 +42,7 @@ export const deleteShopItem = (id: number) => {
/**
* 后台商品领用列表
*/
export
const
getBackendExchangeList
=
(
data
:
Page
SearchParams
)
=>
{
export
const
getBackendExchangeList
=
(
data
:
BackendExchangeList
SearchParams
)
=>
{
return
service
.
request
<
BackendServicePageResult
<
BackendShopItemDto
>>
({
url
:
'/api/culture/shop/order/background/productList'
,
method
:
'POST'
,
...
...
src/api/backend/shop/types.ts
View file @
0ca6abec
import
type
{
PageSearchParams
}
from
'@/utils/request/types'
import
{
BooleanFlag
,
ShopGoodsTypeEnum
}
from
'@/constants'
export
interface
BackendShopListSearchParams
extends
PageSearchParams
{
name
?:
string
itemType
?:
ShopGoodsTypeEnum
region
?:
string
enable
?:
0
|
1
}
export
interface
BackendShopItemDto
{
id
:
number
id
?:
number
sort
:
number
enable
:
BooleanFlag
imageUrl
:
string
itemType
:
ShopGoodsTypeEnum
name
:
string
price
:
number
region
:
string
title
:
string
description
:
string
imgUrl
:
string
price
:
number
stock
:
number
status
:
number
}
...
...
@@ -17,3 +31,8 @@ export interface AddOrUpdateShopItemDto {
stock
:
number
status
:
number
}
export
interface
BackendExchangeListSearchParams
extends
PageSearchParams
{
source
:
string
status
?:
0
|
1
|
2
itemName
?:
string
}
src/views/articleDetail/components/actionButtons.vue
View file @
0ca6abec
...
...
@@ -106,9 +106,9 @@ const stats = computed(() => {
]
})
const
handleClick
=
async
(
item
:
StatItem
)
=>
{
const
handleClick
=
(
item
:
StatItem
)
=>
{
if
(
item
.
actionFn
)
{
await
item
.
actionFn
()
item
.
actionFn
()
}
}
</
script
>
src/views/backend/goodsDistribution/index.vue
View file @
0ca6abec
...
...
@@ -151,14 +151,7 @@
<
script
setup
lang=
"ts"
>
import
{
Search
,
Upload
}
from
'@element-plus/icons-vue'
import
{
usePageSearch
,
useResetData
}
from
'@/hooks'
import
{
addOrUpdateColumn
,
deleteColumn
,
hideColumn
,
getBackendExchangeList
,
issueProduct
,
}
from
'@/api/backend'
import
{
updateArticleRecommend
}
from
'@/api'
import
{
addOrUpdateColumn
,
getBackendExchangeList
,
issueProduct
}
from
'@/api/backend'
import
type
{
FormInstance
,
FormRules
}
from
'element-plus'
import
type
{
BackendColumnListItemDto
,
AddOrUpdateColumnDto
}
from
'@/api/backend'
import
dayjs
from
'dayjs'
...
...
@@ -178,7 +171,7 @@ const formRef = ref<FormInstance>()
// 表单数据
const
[
form
,
resetForm
]
=
useResetData
<
AddOrUpdateColumnDto
>
({
const
[
form
]
=
useResetData
<
AddOrUpdateColumnDto
>
({
title
:
''
,
color
:
'#000000'
,
id
:
undefined
,
...
...
@@ -192,32 +185,6 @@ const formRules: FormRules = {
sort
:
[{
required
:
true
,
message
:
'请输入排序'
,
trigger
:
'blur'
}],
}
// 新增
const
handleAdd
=
()
=>
{
resetForm
()
dialogVisible
.
value
=
true
}
// 编辑
const
handleEdit
=
(
row
:
BackendColumnListItemDto
)
=>
{
resetForm
()
form
.
value
=
{
title
:
row
.
title
,
color
:
row
.
color
,
id
:
row
.
id
,
sort
:
row
.
sort
,
type
:
'column'
,
}
dialogVisible
.
value
=
true
}
// 是否置顶改变
const
handleIsRecommendChange
=
async
(
row
:
ArticleItemDto
)
=>
{
await
updateArticleRecommend
(
row
.
id
)
ElMessage
.
success
(
'修改成功'
)
refresh
()
}
// 取消发放
const
handleCancelIssue
=
async
(
row
:
BackendColumnListItemDto
)
=>
{
await
ElMessageBox
.
confirm
(
'确定要取消发放吗?'
,
'提示'
,
{
...
...
@@ -278,22 +245,6 @@ const selectedRows = ref<BackendColumnListItemDto[]>([])
const
handleSelectionChange
=
(
selection
:
BackendColumnListItemDto
[])
=>
{
selectedRows
.
value
=
selection
}
// 批量发布/隐藏
const
handleBatchPublish
=
async
()
=>
{
await
hideColumn
(
selectedRows
.
value
.
map
((
item
)
=>
item
.
id
))
refresh
()
selectedRows
.
value
=
[]
ElMessage
.
success
(
'发布/隐藏成功'
)
}
// 批量删除
const
handleBatchDelete
=
async
()
=>
{
await
deleteColumn
(
selectedRows
.
value
.
map
((
item
)
=>
item
.
id
))
refresh
()
selectedRows
.
value
=
[]
ElMessage
.
success
(
'删除成功'
)
}
</
script
>
<
style
scoped
lang=
"scss"
>
...
...
src/views/backend/goodsManage/index.vue
View file @
0ca6abec
...
...
@@ -193,17 +193,9 @@
<
script
setup
lang=
"ts"
>
import
{
Search
,
Plus
,
Upload
}
from
'@element-plus/icons-vue'
import
{
usePageSearch
,
useResetData
}
from
'@/hooks'
import
{
addOrUpdateColumn
,
deleteColumn
,
hideColumn
,
getShopItemList
,
addOrUpdateShopItem
,
deleteShopItem
,
}
from
'@/api/backend'
import
{
updateArticleRecommend
}
from
'@/api'
import
{
getShopItemList
,
addOrUpdateShopItem
,
deleteShopItem
}
from
'@/api/backend'
import
type
{
FormInstance
,
FormRules
}
from
'element-plus'
import
type
{
BackendColumnListItemDto
,
AddOrUpdateColumnDto
}
from
'@/api/backend'
import
type
{
BackendColumnListItemDto
}
from
'@/api/backend'
import
dayjs
from
'dayjs'
import
{
BooleanFlag
,
ShopGoodsTypeEnum
,
regionListOptions
}
from
'@/constants'
import
UploadFile
from
'@/components/common/UploadFile/index.vue'
...
...
tsconfig.app.json
View file @
0ca6abec
...
...
@@ -8,7 +8,6 @@
"auto-imports.d.ts"
,
"components.d.ts"
],
"exclude"
:
[
"src/**/__tests__/*"
],
"compilerOptions"
:
{
"tsBuildInfoFile"
:
"./node_modules/.tmp/tsconfig.app.tsbuildinfo"
,
//
"types"
:
[
"element-plus/global"
],
...
...
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