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
0f477de8
Commit
0f477de8
authored
Feb 05, 2026
by
lijiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【需求 20331】 feat: 优化案例库相关内容
1:后台的案例库应用状态[已使用],禁止用户在前台编辑 2:[审核通过]的案例库,用户在前台编辑提交时二次提示
parent
c8a47b69
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
14 deletions
+43
-14
types.ts
src/api/case/types.ts
+8
-1
index.vue
src/views/publishCase/index.vue
+35
-13
selfCase.vue
src/views/userPage/components/selfCase.vue
+0
-0
No files found.
src/api/case/types.ts
View file @
0f477de8
/**
* 添加或更新案例库DTO
*/
import
{
TagTypeEnum
,
TagLevelEnum
,
BooleanFlag
,
ReleaseStatusTypeEnum
}
from
'@/constants'
import
{
TagTypeEnum
,
TagLevelEnum
,
BooleanFlag
,
ReleaseStatusTypeEnum
,
AuditStatusEnum
,
}
from
'@/constants'
type
TagItemDto
=
{
tagId
:
number
...
...
@@ -31,4 +37,5 @@ export interface CaseDetailDto {
cultureKeywordSub
:
string
[]
sceneKeywordMain
:
string
sceneKeywordSub
:
string
[]
isAudit
:
AuditStatusEnum
}
src/views/publishCase/index.vue
View file @
0f477de8
...
...
@@ -96,6 +96,7 @@
class=
"px-6 py-2 bg-blue-500 hover:bg-blue-600 rounded-lg text-white text-sm font-medium shadow-sm hover:shadow-md transition-all duration-200"
type=
"primary"
@
click=
"handleSubmit(ReleaseStatusTypeEnum.PUBLISH)"
:loading=
"loading"
>
提交
</el-button>
...
...
@@ -113,7 +114,13 @@ import type { AddOrUpdateCaseDto } from '@/api'
import
SelectTags
from
'@/components/common/SelectTags/index.vue'
import
type
{
FormInstance
}
from
'element-plus'
import
type
{
TagItemDto
}
from
'@/api'
import
{
TagTypeEnum
,
TagLevelEnum
,
BooleanFlag
,
ReleaseStatusTypeEnum
}
from
'@/constants'
import
{
TagTypeEnum
,
TagLevelEnum
,
BooleanFlag
,
ReleaseStatusTypeEnum
,
AuditStatusEnum
,
}
from
'@/constants'
import
{
selectDepOrUser
}
from
'@/utils'
import
{
useUserStore
}
from
'@/stores'
import
{
storeToRefs
}
from
'pinia'
...
...
@@ -122,7 +129,7 @@ const router = useRouter()
const
userStore
=
useUserStore
()
const
{
userInfo
}
=
storeToRefs
(
userStore
)
const
formRef
=
useTemplateRef
<
FormInstance
>
(
'formRef'
)
const
loading
=
ref
(
false
)
const
rules
=
{
title
:
[{
required
:
true
,
message
:
'请输入标题'
,
trigger
:
'blur'
}],
content
:
[{
required
:
true
,
message
:
'请输入内容'
,
trigger
:
'blur'
}],
...
...
@@ -164,14 +171,7 @@ const handleCancel = () => {
router
.
back
()
}
// 预览
// const handlePreview = () => {
// console.log('预览', form)
// ElMessage.success('预览功能待实现')
// }
// 保存草稿
// 保存
const
transformData
=
(
releaseStatus
:
ReleaseStatusTypeEnum
):
AddOrUpdateCaseDto
=>
{
const
{
mainTagId
,
...
...
@@ -224,15 +224,30 @@ const transformData = (releaseStatus: ReleaseStatusTypeEnum): AddOrUpdateCaseDto
return
obj
}
const
showSubmitGuide
=
ref
(
false
)
// 提交
const
handleSubmit
=
async
(
releaseStatus
:
ReleaseStatusTypeEnum
)
=>
{
await
formRef
.
value
?.
validate
()
console
.
log
(
'form'
,
{
...
transformData
(
releaseStatus
)
})
const
res
=
await
addOrUpdateCase
({
...
transformData
(
releaseStatus
)
})
if
(
res
)
{
if
(
showSubmitGuide
.
value
)
{
await
ElMessageBox
.
confirm
(
'该案例库已审核通过,修改后需重新审核,确定提交吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
})
}
loading
.
value
=
true
try
{
await
addOrUpdateCase
({
...
transformData
(
releaseStatus
)
})
ElMessage
.
success
(
'提交成功'
)
resetForm
()
router
.
back
()
}
catch
(
error
)
{
console
.
log
(
'error'
,
error
)
}
finally
{
loading
.
value
=
false
}
}
...
...
@@ -340,6 +355,13 @@ onActivated(async () => {
}
form
.
value
=
obj
console
.
log
(
'form'
,
form
.
value
)
// 已经同意的案例库 二次修改需要提示
if
(
data
.
isAudit
===
AuditStatusEnum
.
AGREED
)
{
showSubmitGuide
.
value
=
true
}
else
{
showSubmitGuide
.
value
=
false
}
}
else
{
showSubmissionGuide
()
}
...
...
src/views/userPage/components/selfCase.vue
View file @
0f477de8
This diff is collapsed.
Click to expand it.
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