Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-dml
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-dml
Commits
a5af738d
提交
a5af738d
authored
11月 21, 2025
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 评分修改为多人评分,总分取平均分
上级
a546e977
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
78 行增加
和
19 行删除
+78
-19
prompt2.ts
src/modules/score/prompt2.ts
+5
-5
Index.vue
src/modules/score/views/Index.vue
+37
-7
View.vue
src/modules/score/views/View.vue
+36
-7
没有找到文件。
src/modules/score/prompt2.ts
浏览文件 @
a5af738d
...
@@ -23,7 +23,7 @@ ${JSON.stringify(data.commodity_types)}
...
@@ -23,7 +23,7 @@ ${JSON.stringify(data.commodity_types)}
速食面品类下:
速食面品类下:
●至少2个二级品类
●至少2个二级品类
●必须包含:“复合式
速煮
面”、“高端速食拌面/干面”
●必须包含:“复合式
冲泡
面”、“高端速食拌面/干面”
●状态为"有效"
●状态为"有效"
鲜切面品类下:
鲜切面品类下:
...
@@ -147,21 +147,21 @@ ${JSON.stringify(data.commodities)}
...
@@ -147,21 +147,21 @@ ${JSON.stringify(data.commodities)}
一级品类:"襄阳牛肉面2桶装(有牛肉)"应关联到"速食面品类"
一级品类:"襄阳牛肉面2桶装(有牛肉)"应关联到"速食面品类"
二级品类:应关联到"速食面品类"下的"复合式
速煮
面"
二级品类:应关联到"速食面品类"下的"复合式
冲泡
面"
计分规则
计分规则
| 情况 | 得分 | 判定依据 |
| 情况 | 得分 | 判定依据 |
| ------------------------------ | ----- | ----------------------------------------------------- |
| ------------------------------ | ----- | ----------------------------------------------------- |
| 一级品类 ✅ 且 二级品类 ✅ | 1分 | 在商品详情配置页中明确显示"速食面品类 > 复合式
速煮
面" |
| 一级品类 ✅ 且 二级品类 ✅ | 1分 | 在商品详情配置页中明确显示"速食面品类 > 复合式
冲泡
面" |
| 仅一级品类 ✅ 或 仅二级品类 ✅ | 0.5分 | 仅显示其中一项正确 |
| 仅一级品类 ✅ 或 仅二级品类 ✅ | 0.5分 | 仅显示其中一项正确 |
| 两者都错误或缺失 | 0分 | 未找到类目信息,或类目错误 |
| 两者都错误或缺失 | 0分 | 未找到类目信息,或类目错误 |
评分示例
评分示例
✅ 得1分:配置页显示"类目:速食面品类 > 复合式
速煮
面"
✅ 得1分:配置页显示"类目:速食面品类 > 复合式
冲泡
面"
⚠️ 得0.5分:配置页显示"类目:速食面品类"(缺少二级分类)
⚠️ 得0.5分:配置页显示"类目:速食面品类"(缺少二级分类)
...
@@ -1097,7 +1097,7 @@ ________________________________________
...
@@ -1097,7 +1097,7 @@ ________________________________________
- 一级品类:已配置:配置页显示"速食面品类"
- 一级品类:已配置:配置页显示"速食面品类"
- 二级品类:已配置:配置页显示"复合式
速煮
面"
- 二级品类:已配置:配置页显示"复合式
冲泡
面"
...
...
src/modules/score/views/Index.vue
浏览文件 @
a5af738d
...
@@ -6,6 +6,8 @@ import { useChat } from '@ezijing/ai-vue'
...
@@ -6,6 +6,8 @@ import { useChat } from '@ezijing/ai-vue'
import
{
generatePrompt
}
from
'../prompt'
import
{
generatePrompt
}
from
'../prompt'
import
{
generatePrompt
as
generatePrompt2
}
from
'../prompt2'
import
{
generatePrompt
as
generatePrompt2
}
from
'../prompt2'
import
{
useIntervalFn
}
from
'@vueuse/core'
import
{
useIntervalFn
}
from
'@vueuse/core'
import
{
useUserStore
}
from
'@/stores/user'
const
userStore
=
useUserStore
()
const
route
=
useRoute
()
const
route
=
useRoute
()
const
appList
=
ref
(
null
)
const
appList
=
ref
(
null
)
...
@@ -43,7 +45,19 @@ const listOptions = computed(() => {
...
@@ -43,7 +45,19 @@ const listOptions = computed(() => {
// { label: '班级', prop: 'class_name' },
// { label: '班级', prop: 'class_name' },
{
label
:
'成绩'
,
prop
:
'score_display'
},
{
label
:
'成绩'
,
prop
:
'score_display'
},
{
label
:
'状态'
,
prop
:
'check_status_name'
},
{
label
:
'状态'
,
prop
:
'check_status_name'
},
{
label
:
'评分人'
,
prop
:
'checker_name'
},
{
label
:
'评分人'
,
prop
:
'checker_name'
,
computed
:
({
row
})
=>
{
const
scores
=
JSON
.
parse
(
row
.
score_details
)
return
Array
.
isArray
(
scores
)
?
scores
.
filter
((
item
)
=>
!
item
.
is_ai
)
.
map
((
item
)
=>
`
${
item
.
checker_name
}
(
${
item
.
total_score
}
)`
)
.
join
(
','
)
:
''
},
},
{
label
:
'提交时间'
,
prop
:
'commit_time'
},
{
label
:
'提交时间'
,
prop
:
'commit_time'
},
{
label
:
'批改时间'
,
prop
:
'commit_time'
},
{
label
:
'批改时间'
,
prop
:
'commit_time'
},
{
label
:
'操作'
,
slots
:
'table-x'
,
width
:
120
},
{
label
:
'操作'
,
slots
:
'table-x'
,
width
:
120
},
...
@@ -65,21 +79,37 @@ const handleAIScore = async () => {
...
@@ -65,21 +79,37 @@ const handleAIScore = async () => {
list
.
forEach
(
async
(
item
)
=>
{
list
.
forEach
(
async
(
item
)
=>
{
const
detailRes
=
await
getScoreDetail
({
id
:
item
.
id
})
const
detailRes
=
await
getScoreDetail
({
id
:
item
.
id
})
const
detail
=
detailRes
.
data
.
detail
const
detail
=
detailRes
.
data
.
detail
const
parsed
=
JSON
.
parse
(
detail
.
score_details
)
let
scores
=
Array
.
isArray
(
parsed
)
?
parsed
:
[]
const
prompt
=
const
prompt
=
detail
.
competition_rule
?.
questions
==
1
?
generatePrompt
(
detail
.
live_data
)
:
generatePrompt2
(
detail
.
live_data
)
detail
.
competition_rule
?.
questions
==
1
?
generatePrompt
(
detail
.
live_data
)
:
generatePrompt2
(
detail
.
live_data
)
// 修改为评分中
// 修改为评分中
updateScore
({
id
:
item
.
id
,
check_status
:
1
})
updateScore
({
id
:
item
.
id
,
check_status
:
1
})
const
result
=
await
generateText
({
prompt
,
response_format
:
{
type
:
'json_object'
}
})
const
result
=
await
generateText
({
prompt
,
response_format
:
{
type
:
'json_object'
}
})
console
.
log
(
result
)
try
{
try
{
const
parsed
=
JSON
.
parse
(
result
.
content
)
const
scoreDetails
=
JSON
.
parse
(
result
.
content
)
console
.
log
(
parsed
)
const
totalScore
=
Object
.
values
(
scoreDetails
).
reduce
((
acc
,
curr
)
=>
acc
+
(
curr
.
score
||
0
),
0
)
const
totalScore
=
Object
.
values
(
parsed
).
reduce
((
acc
,
curr
)
=>
acc
+
(
curr
.
score
||
0
),
0
)
console
.
log
(
scoreDetails
)
const
myScore
=
{
is_ai
:
true
,
checker_id
:
userStore
.
user
.
id
,
checker_name
:
userStore
.
user
.
name
,
scores
:
scoreDetails
,
total_score
:
totalScore
,
updated_at
:
new
Date
().
toLocaleString
(),
}
scores
=
[...
scores
.
filter
((
item
)
=>
item
.
checker_id
!=
userStore
.
user
.
id
),
myScore
]
// 总平均分,过滤掉AI评分
const
validScores
=
scores
.
filter
((
item
)
=>
!
item
.
is_ai
)
const
totalAverageScore
=
validScores
.
reduce
((
acc
,
curr
)
=>
acc
+
(
curr
.
total_score
||
0
),
0
)
/
validScores
.
length
updateScore
({
updateScore
({
id
:
item
.
id
,
id
:
item
.
id
,
check_status
:
3
,
check_status
:
3
,
total_score
:
total
Score
.
valu
e
,
total_score
:
total
AverageScor
e
,
score_details
:
JSON
.
stringify
(
parsed
),
score_details
:
JSON
.
stringify
(
scores
),
}).
then
(()
=>
{
}).
then
(()
=>
{
console
.
log
(
'AI评分完成'
)
console
.
log
(
'AI评分完成'
)
})
})
...
...
src/modules/score/views/View.vue
浏览文件 @
a5af738d
...
@@ -4,6 +4,8 @@ import { ElMessageBox, ElMessage } from 'element-plus'
...
@@ -4,6 +4,8 @@ import { ElMessageBox, ElMessage } from 'element-plus'
import
{
useChat
}
from
'@ezijing/ai-vue'
import
{
useChat
}
from
'@ezijing/ai-vue'
import
{
generatePrompt
}
from
'../prompt'
import
{
generatePrompt
}
from
'../prompt'
import
{
generatePrompt
as
generatePrompt2
}
from
'../prompt2'
import
{
generatePrompt
as
generatePrompt2
}
from
'../prompt2'
import
{
useUserStore
}
from
'@/stores/user'
const
userStore
=
useUserStore
()
const
CompetitionLive
=
defineAsyncComponent
(()
=>
import
(
'../components/CompetitionLive.vue'
))
const
CompetitionLive
=
defineAsyncComponent
(()
=>
import
(
'../components/CompetitionLive.vue'
))
const
CompetitionLiveProd
=
defineAsyncComponent
(()
=>
import
(
'../components/CompetitionLiveProd.vue'
))
const
CompetitionLiveProd
=
defineAsyncComponent
(()
=>
import
(
'../components/CompetitionLiveProd.vue'
))
...
@@ -21,10 +23,22 @@ const totalScore = computed(() => {
...
@@ -21,10 +23,22 @@ const totalScore = computed(() => {
return
Object
.
values
(
scoreDetails
).
reduce
((
acc
,
curr
)
=>
acc
+
(
curr
.
score
||
0
),
0
)
return
Object
.
values
(
scoreDetails
).
reduce
((
acc
,
curr
)
=>
acc
+
(
curr
.
score
||
0
),
0
)
})
})
// 所有评分人的评分列表
let
scores
=
[]
const
fetchDetail
=
async
()
=>
{
const
fetchDetail
=
async
()
=>
{
const
res
=
await
getScoreDetail
({
id
})
const
res
=
await
getScoreDetail
({
id
})
detail
.
value
=
res
.
data
.
detail
const
resDetail
=
res
.
data
.
detail
Object
.
assign
(
scoreDetails
,
res
.
data
.
detail
.
score_details
?
JSON
.
parse
(
res
.
data
.
detail
.
score_details
)
:
{})
detail
.
value
=
resDetail
try
{
const
parsed
=
JSON
.
parse
(
resDetail
.
score_details
)
scores
=
Array
.
isArray
(
parsed
)
?
parsed
:
[]
}
catch
(
error
)
{
console
.
log
(
'评分列表解析失败'
,
error
)
scores
=
[]
}
const
myScore
=
scores
.
find
((
item
)
=>
item
.
checker_id
==
userStore
.
user
.
id
)?.
scores
const
firstScore
=
scores
[
0
]?.
scores
Object
.
assign
(
scoreDetails
,
myScore
||
firstScore
||
{})
}
}
onMounted
(()
=>
{
onMounted
(()
=>
{
...
@@ -41,7 +55,7 @@ const handleAIScore = async () => {
...
@@ -41,7 +55,7 @@ const handleAIScore = async () => {
try
{
try
{
const
parsed
=
JSON
.
parse
(
result
.
content
)
const
parsed
=
JSON
.
parse
(
result
.
content
)
Object
.
assign
(
scoreDetails
,
parsed
)
Object
.
assign
(
scoreDetails
,
parsed
)
commitScore
().
then
(()
=>
{
commitScore
(
1
,
true
).
then
(()
=>
{
ElMessage
.
success
(
'保存成功'
)
ElMessage
.
success
(
'保存成功'
)
})
})
}
catch
(
error
)
{
}
catch
(
error
)
{
...
@@ -57,15 +71,30 @@ const handleSave = () => {
...
@@ -57,15 +71,30 @@ const handleSave = () => {
})
})
}
}
const
commitScore
=
(
status
=
1
)
=>
{
const
commitScore
=
(
status
=
1
,
isAI
=
false
)
=>
{
const
myScore
=
{
is_ai
:
isAI
,
checker_id
:
userStore
.
user
.
id
,
checker_name
:
userStore
.
user
.
name
,
scores
:
scoreDetails
,
total_score
:
totalScore
.
value
,
updated_at
:
new
Date
().
toLocaleString
(),
}
// 去掉当前评分人的评分,并添加当前评分人的评分
scores
=
[...
scores
.
filter
((
item
)
=>
item
.
checker_id
!=
userStore
.
user
.
id
),
myScore
]
// 总平均分,过滤掉AI评分
const
validScores
=
scores
.
filter
((
item
)
=>
!
item
.
is_ai
)
const
totalAverageScore
=
validScores
.
reduce
((
acc
,
curr
)
=>
acc
+
(
curr
.
total_score
||
0
),
0
)
/
validScores
.
length
return
updateScore
({
return
updateScore
({
id
:
route
.
query
.
id
,
id
:
route
.
query
.
id
,
check_status
:
status
,
check_status
:
status
,
total_score
:
total
Score
.
valu
e
,
total_score
:
total
AverageScor
e
,
score_details
:
JSON
.
stringify
(
score
Detail
s
),
score_details
:
JSON
.
stringify
(
scores
),
})
})
}
}
const
handlePublishScore
=
()
=>
{
const
handlePublishScore
=
()
=>
{
ElMessageBox
.
confirm
(
'确定要发布成绩吗?'
,
'提示'
,
{
ElMessageBox
.
confirm
(
'确定要发布成绩吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论