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
e5c7e6a6
Commit
e5c7e6a6
authored
Dec 23, 2025
by
lijiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【需求 17679】 perf: 优化ts类型
parent
92f4a386
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
55 additions
and
432 deletions
+55
-432
index.ts
src/api/backend/carousel/index.ts
+0
-10
index.ts
src/api/backend/shop/index.ts
+9
-9
types.ts
src/api/backend/shop/types.ts
+11
-17
types.ts
src/api/case/types.ts
+6
-4
index.ts
src/api/common/index.ts
+24
-3
index.ts
src/api/index.ts
+0
-4
types.ts
src/api/online/types.ts
+1
-300
index.ts
src/api/otherUserPage/index.ts
+1
-1
types.ts
src/api/otherUserPage/types.ts
+1
-15
types.ts
src/api/practice/types.ts
+0
-67
index.vue
src/components/common/PublishBox/index.vue
+2
-2
No files found.
src/api/backend/carousel/index.ts
View file @
e5c7e6a6
...
...
@@ -42,16 +42,6 @@ export const editCarousel = (data: AddOrUpdateCarouselDto) => {
}
/**
* 更改发布状态
*/
// export const deleteCarousel = (id: number) => {
// return service.request<boolean>({
// url: `/api/cultureCarousel/updateRelease?id=${id}`,
// method: 'POST',
// })
// }
/**
* 根据类型获取文章列表
*/
export
const
getArticleList
=
(
data
:
ArticleSearchParams
)
=>
{
...
...
src/api/backend/shop/index.ts
View file @
e5c7e6a6
import
service
from
'@/utils/request/index'
import
type
{
AddOrUpdateTagDto
,
BackendTagListItemDto
,
BackendTagSearchParams
}
from
'./types'
import
type
{
BackendServicePageResult
}
from
'@/utils/request/types'
import
type
{
BackendShopItemDto
,
AddOrUpdateShopItemDto
}
from
'./types'
import
type
{
BackendServicePageResult
,
PageSearchParams
}
from
'@/utils/request/types'
// 后台管理 积分商城相关接口
/**
* 商品配置列表
*/
export
const
getShopItemList
=
(
params
:
BackendTag
SearchParams
)
=>
{
return
service
.
request
<
BackendServicePageResult
<
Backend
TagList
ItemDto
>>
({
export
const
getShopItemList
=
(
params
:
Page
SearchParams
)
=>
{
return
service
.
request
<
BackendServicePageResult
<
Backend
Shop
ItemDto
>>
({
url
:
'/api/culture/shop/item/productList'
,
method
:
'POST'
,
data
:
params
,
...
...
@@ -17,8 +17,8 @@ export const getShopItemList = (params: BackendTagSearchParams) => {
/**
* 新增/编辑商品
*/
export
const
addOrUpdateShopItem
=
(
data
:
AddOrUpdate
Tag
Dto
)
=>
{
return
service
.
request
<
BackendServicePageResult
<
BackendTagListItemDto
>>
({
export
const
addOrUpdateShopItem
=
(
data
:
AddOrUpdate
ShopItem
Dto
)
=>
{
return
service
.
request
({
url
:
'/api/culture/shop/item/addOrUpdate'
,
method
:
'POST'
,
data
,
...
...
@@ -37,8 +37,8 @@ export const deleteShopItem = (id: number) => {
/**
* 后台商品领用列表
*/
export
const
getBackendExchangeList
=
(
data
:
BackendTag
SearchParams
)
=>
{
return
service
.
request
<
BackendServicePageResult
<
Backend
TagList
ItemDto
>>
({
export
const
getBackendExchangeList
=
(
data
:
Page
SearchParams
)
=>
{
return
service
.
request
<
BackendServicePageResult
<
Backend
Shop
ItemDto
>>
({
url
:
'/api/culture/shop/order/background/productList'
,
method
:
'POST'
,
data
,
...
...
@@ -48,7 +48,7 @@ export const getBackendExchangeList = (data: BackendTagSearchParams) => {
/**
* 发放 取消发放
*/
export
const
issueProduct
=
(
data
)
=>
{
export
const
issueProduct
=
(
data
:
{
id
:
number
;
status
:
number
;
memo
?:
string
}
)
=>
{
return
service
.
request
({
url
:
`/api/culture/shop/order/issueProduct`
,
method
:
'POST'
,
...
...
src/api/backend/shop/types.ts
View file @
e5c7e6a6
import
type
{
PageSearchParams
}
from
'@/utils/request/types'
export
interface
BackendTagSearchParams
extends
PageSearchParams
{
export
interface
BackendShopItemDto
{
id
:
number
title
:
string
type
:
string
description
:
string
imgUrl
:
string
price
:
number
stock
:
number
status
:
number
}
export
interface
AddOrUpdate
Tag
Dto
{
export
interface
AddOrUpdate
ShopItem
Dto
{
id
?:
number
color
:
string
description
:
string
title
:
string
type
:
string
}
export
interface
BackendTagListItemDto
{
color
:
string
createId
:
number
createTime
:
number
description
:
string
id
:
number
imgUrl
:
string
styl
e
:
number
title
:
string
type
:
string
pric
e
:
number
stock
:
number
status
:
number
}
src/api/case/types.ts
View file @
e5c7e6a6
...
...
@@ -3,17 +3,19 @@
*/
import
{
TagTypeEnum
,
TagLevelEnum
,
BooleanFlag
,
ReleaseStatusTypeEnum
}
from
'@/constants'
export
type
TagItemDto
=
{
type
TagItemDto
=
{
tagId
:
number
type
:
TagTypeEnum
keywordType
:
TagLevelEnum
}
export
interface
AddOrUpdateCaseDto
{
id
?:
number
content
:
string
title
:
string
tagRelationDtoList
:
TagItemDto
[]
deptId
:
string
deptName
:
string
isSync
:
BooleanFlag
releaseStatus
:
ReleaseStatusTypeEnum
sourceUser
:
string
tagRelationDtoList
:
TagItemDto
[]
title
:
string
}
src/api/common/index.ts
View file @
e5c7e6a6
// 常规的接口
import
service
from
'@/utils/request/index'
import
type
{
FielItemDto
}
from
'./types'
//
import service from '@/utils/request/index'
//
import type { FielItemDto } from './types'
/**
* 获取常规的接口
*/
...
...
@@ -22,7 +22,28 @@ import type { FielItemDto } from './types'
* 暂时调用oa正式接口
*/
import
axios
from
'axios'
export
const
uploadFile
=
(
file
:
File
,
onProgress
?:
(
progress
:
number
)
=>
void
)
=>
{
type
UploadFileResponse
=
{
data
:
{
data
:
{
createTime
:
string
createUser
:
number
fileBucket
:
string
fileId
:
string
fileName
:
string
filePath
:
string
fileSizeKb
:
number
fileSuffix
:
string
finalName
:
string
realPath
:
string
updateTime
:
string
updateUser
:
string
}[]
}
}
export
const
uploadFile
=
(
file
:
File
,
onProgress
?:
(
progress
:
number
)
=>
void
,
):
Promise
<
UploadFileResponse
>
=>
{
const
formData
=
new
FormData
()
formData
.
append
(
'fileList'
,
file
)
return
axios
.
post
(
'http://47.112.96.71:8082/mobiles/uploadFile'
,
formData
,
{
...
...
src/api/index.ts
View file @
e5c7e6a6
...
...
@@ -3,8 +3,6 @@ export * from './task'
export
*
from
'./sign'
export
*
from
'./article'
export
*
from
'./shop'
// export * from './column'
// export * from './interview'
export
*
from
'./tag'
export
*
from
'./article'
export
*
from
'./user'
...
...
@@ -20,8 +18,6 @@ export * from './otherUserPage'
export
*
from
'./task/types'
export
*
from
'./shop/types'
export
*
from
'./article/types'
// export * from './column/types'
// export * from './interview/types'
export
*
from
'./tag/types'
export
*
from
'./article/types'
export
*
from
'./user/types'
...
...
src/api/online/types.ts
View file @
e5c7e6a6
import
{
ArticleTypeEnum
,
ReleaseStatusTypeEnum
,
BooleanFlag
,
SendTypeEnum
}
from
'@/constants'
import
type
{
PageSearchParams
}
from
'@/utils/request/types'
/**
* 搜索文章的参数
*/
export
interface
ArticleSearchParams
extends
PageSearchParams
{
type
?:
ArticleTypeEnum
sortLogic
?:
number
title
?:
string
}
/**
* 添加或更新文章DTO(带枚举版本)
*/
export
type
AddOrUpdateArticleDto
=
|
AddOrUpdatePostDto
|
AddOrUpdateColumnDto
|
AddOrUpdateInterviewDto
|
AddOrUpdateVideoDto
/**
* 添加帖子的DTO
*/
export
interface
AddOrUpdatePostDto
{
id
?:
number
title
?:
string
content
?:
string
releaseStatus
?:
ReleaseStatusTypeEnum
sendType
?:
SendTypeEnum
faceUrl
?:
string
imgUrl
?:
string
sendTime
?:
string
type
?:
ArticleTypeEnum
.
POST
}
interface
AddOrUpdateColumnBase
{
id
?:
number
type
:
ArticleTypeEnum
.
COLUMN
title
:
string
content
:
string
releaseStatus
:
ReleaseStatusTypeEnum
sendType
:
SendTypeEnum
faceUrl
?:
string
imgUrl
?:
string
// 关联的专栏栏目
relateColumnId
?:
number
mainTagId
:
string
isRelateColleague
:
BooleanFlag
sendTime
?:
string
isRecommend
:
BooleanFlag
}
/**
* 添加专栏的原始form类型
*/
export
interface
AddOrUpdateColumnForm
extends
AddOrUpdateColumnBase
{
tagList
:
number
[]
}
/**
* 添加专栏的DTO
*/
export
interface
AddOrUpdateColumnDto
extends
AddOrUpdateColumnBase
{
tagList
:
{
tagId
:
number
;
sort
:
number
}[]
}
export
interface
AddOrUpdateInterviewBase
{
id
?:
number
type
:
ArticleTypeEnum
.
INTERVIEW
title
:
string
content
:
string
releaseStatus
:
ReleaseStatusTypeEnum
sendType
:
SendTypeEnum
faceUrl
?:
string
imgUrl
?:
string
// 关联的专访栏目
relateColumnId
?:
number
mainTagId
:
string
sendTime
?:
string
isRecommend
:
BooleanFlag
}
export
interface
AddOrUpdateInterviewForm
extends
AddOrUpdateInterviewBase
{
tagList
:
number
[]
}
/**
* 添加专访的DTO
*/
export
interface
AddOrUpdateInterviewDto
extends
AddOrUpdateInterviewBase
{
tagList
:
{
tagId
:
number
;
sort
:
number
}[]
}
export
interface
AddOrUpdateVideoDto
{
id
?:
number
title
:
string
type
:
ArticleTypeEnum
.
VIDEO
content
:
string
videoUrl
:
string
videoDuration
:
string
releaseStatus
:
ReleaseStatusTypeEnum
sendType
:
SendTypeEnum
faceUrl
?:
string
imgUrl
?:
string
sendTime
?:
string
isRecommend
?:
BooleanFlag
mainTagId
:
string
|
number
tagList
:
{
tagId
:
number
;
sort
:
number
}[]
|
number
[]
relateColumnId
?:
number
}
/**
* 添加专访的DTO
*/
/**
* 文章详情
*/
export
interface
ArticleItemDto
{
id
:
number
title
:
string
content
:
string
faceUrl
:
string
videoUrl
:
string
description
:
string
createUserId
:
number
createTime
:
number
viewCount
:
number
isRecommend
:
BooleanFlag
type
:
ArticleTypeEnum
isRelateColleague
:
BooleanFlag
releaseStatus
:
ReleaseStatusTypeEnum
tagNameList
:
string
[]
praiseCount
:
number
collectionCount
:
number
replyCount
:
number
hasPraised
:
boolean
hasCollect
:
boolean
imgUrl
:
string
createUserAvatar
:
string
createUserName
:
string
showAvatar
:
string
showName
:
string
videoDuration
:
string
showComment
?:
boolean
relateColumn
?:
string
rewardNum
:
number
}
/**
* 专栏选项
*/
export
interface
ColumnOptionDto
{
color
:
string
createTime
:
number
createUserId
:
number
id
:
number
isDelete
:
BooleanFlag
sort
:
number
status
:
BooleanFlag
title
:
string
type
:
'column'
}
/**
* 专栏列表Item
*/
export
interface
ColumnItemDto
{
title
:
string
color
:
string
sort
:
number
yaColumnVoList
:
{
articleId
:
number
collectCount
:
number
content
:
string
createTime
:
number
description
:
string
faceUrl
:
string
hasPraised
:
boolean
isRecommend
:
number
praiseCount
:
number
replyCount
:
number
title
:
string
type
:
ArticleTypeEnum
.
COLUMN
viewCount
:
number
}[]
}
/**
* 专访选项
*/
export
interface
InterviewOptionDto
{
color
:
string
createTime
:
number
createUserId
:
number
id
:
number
isDelete
:
BooleanFlag
sort
:
number
status
:
BooleanFlag
title
:
string
type
:
'column'
}
/**
* 视频选项
*/
export
interface
VideoOptionDto
{
color
:
string
createTime
:
number
createUserId
:
number
id
:
number
isDelete
:
BooleanFlag
sort
:
number
status
:
BooleanFlag
title
:
string
type
:
'video'
}
/**
* 专访列表Item
*/
export
interface
InterviewItemDto
{
title
:
string
color
:
string
sort
:
number
yaColumnVoList
:
{
articleId
:
number
collectCount
:
number
content
:
string
createTime
:
number
description
:
string
faceUrl
:
string
hasPraised
:
boolean
isRecommend
:
number
praiseCount
:
number
replyCount
:
number
title
:
string
type
:
ArticleTypeEnum
.
INTERVIEW
viewCount
:
number
}[]
}
/**
* 视频选项
*/
/**
* 评论列表
*/
export
interface
CommentSearchParams
extends
PageSearchParams
{
articleId
:
number
|
string
sortType
:
number
}
/**
* 获取子评论列表
*/
export
interface
CommentChildrenSearchParams
extends
PageSearchParams
{
pid
:
number
|
string
articleId
:
number
|
string
}
/**
* 新增评论
*/
export
interface
AddCommentDto
{
articleId
:
number
|
string
content
:
string
pId
?:
number
|
string
}
/**
* 评论信息
*/
export
interface
CommentItemDto
{
articleId
:
number
avatar
:
string
children
:
CommentItemDto
[]
content
:
string
createTime
:
number
hasPraise
:
BooleanFlag
hiddenAvatar
:
string
hiddenName
:
string
id
:
number
isFeatured
:
number
isTop
:
number
pid
:
number
postPriseCount
:
number
region
:
string
regionHide
:
number
replyUser
:
string
replyName
:
string
userId
:
number
isHaveChildren
:
BooleanFlag
childrenNum
:
number
showChildrenPage
:
boolean
childrenPageCurrent
:
number
childrenPageList
:
CommentItemDto
[]
loadingChildren
:
boolean
}
export
type
a
=
string
src/api/otherUserPage/index.ts
View file @
e5c7e6a6
import
service
from
'@/utils/request/index'
import
type
{
BooleanFlag
}
from
'@/constants'
import
type
{
OtherUserInfoDto
}
from
'
@
/types'
import
type
{
OtherUserInfoDto
}
from
'
.
/types'
// 其他用户页面数据
...
...
src/api/otherUserPage/types.ts
View file @
e5c7e6a6
/**
* 添加或更新案例库DTO
*/
import
{
TagTypeEnum
,
TagLevelEnum
,
BooleanFlag
,
ReleaseStatusTypeEnum
}
from
'@/constants'
import
{
BooleanFlag
}
from
'@/constants'
export
type
TagItemDto
=
{
tagId
:
number
type
:
TagTypeEnum
keywordType
:
TagLevelEnum
}
export
interface
AddOrUpdateCaseDto
{
id
?:
number
content
:
string
title
:
string
tagRelationDtoList
:
TagItemDto
[]
isSync
:
BooleanFlag
releaseStatus
:
ReleaseStatusTypeEnum
}
export
interface
OtherUserInfoDto
{
ayabiAvailable
:
number
ayabiTotal
:
number
...
...
src/api/practice/types.ts
View file @
e5c7e6a6
...
...
@@ -29,73 +29,6 @@ export interface PracticeSearchParams extends PageSearchParams {
}
/**
* 添加或更新文章DTO(带枚举版本)
*/
export
interface
AddOrUpdateArticleDto
{
/** 内容 */
content
?:
string
/** 创建人id */
createUserId
?:
number
/** 描述 */
description
?:
string
/** 封面图 */
faceUrl
?:
string
/** id,编辑时必传 */
id
?:
number
/** 是否关联同事 */
isRelateColleague
?:
number
/** 主标签id */
mainTagId
?:
number
/** 发布状态 */
releaseStatus
?:
ReleaseStatusTypeEnum
/** 标签列表 */
tagList
?:
{
tagId
:
number
;
sort
:
number
}[]
/** 标题 */
title
?:
string
/** 文章类型 */
type
?:
ArticleTypeEnum
/** 视频url */
videoUrl
?:
string
}
/**
* 文章详情
*/
// 更严格的类型定义
export
interface
ArticleItemDto
{
id
:
number
title
:
string
content
:
string
faceUrl
:
string
videoUrl
:
string
description
:
string
createUserId
:
number
createTime
:
number
viewCount
:
number
isRecommend
:
BooleanFlag
type
:
ArticleTypeEnum
isRelateColleague
:
BooleanFlag
releaseStatus
:
ReleaseStatusTypeEnum
tagNameList
:
string
[]
praiseCount
:
number
collectionCount
:
number
replyCount
:
number
hasPraised
:
BooleanFlag
}
/**
* 实践列表item
*/
export
interface
PracticeItemDto
{
...
...
src/components/common/PublishBox/index.vue
View file @
e5c7e6a6
...
...
@@ -248,7 +248,7 @@ const { play } = useAnimate(
const
[
form
,
resetForm
]
=
useResetData
({
title
:
''
,
content
:
''
,
imgUrl
:
[],
imgUrl
:
[]
as
string
[]
,
releaseStatus
:
ReleaseStatusTypeEnum
.
PUBLISH
,
mainTagId
:
''
,
tagList
:
[],
...
...
@@ -272,7 +272,7 @@ const handleFileChange = async (e: Event) => {
const
file
=
(
e
.
target
as
HTMLInputElement
).
files
?.[
0
]
if
(
file
)
{
const
{
data
}
=
await
uploadFile
(
file
)
form
.
value
.
imgUrl
.
push
(
data
.
data
[
0
]
.
filePath
)
form
.
value
.
imgUrl
.
push
(
data
.
data
[
0
]
?.
filePath
||
''
)
}
}
...
...
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