Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-dml
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-dml
Commits
285b3d47
提交
285b3d47
authored
11月 21, 2024
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 直播练习名称修改为直播;修改为数据字典获取数据
上级
0c0d5df9
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
42 行增加
和
34 行删除
+42
-34
FormDialog.vue
src/modules/live/talk/components/FormDialog.vue
+5
-3
api.ts
src/modules/live/test/api.ts
+6
-6
FormDialog.vue
src/modules/live/test/components/FormDialog.vue
+11
-11
Live.vue
src/modules/live/test/components/Live.vue
+1
-1
RecordDialog.vue
src/modules/live/test/components/RecordDialog.vue
+1
-1
Demo.vue
src/modules/live/test/views/Demo.vue
+6
-3
Index.vue
src/modules/live/test/views/Index.vue
+8
-5
menu.ts
src/stores/menu.ts
+2
-2
dictionary.ts
src/utils/dictionary.ts
+2
-2
没有找到文件。
src/modules/live/talk/components/FormDialog.vue
浏览文件 @
285b3d47
<
script
setup
>
import
{
ElMessage
}
from
'element-plus'
import
{
liveTestDuration
}
from
'@/utils/dictionary'
import
LiveProductSelect
from
'@/components/LiveProductSelect.vue'
import
{
createTalk
,
updateTalk
,
getTalk
,
getProduct
}
from
'../api'
import
{
useChat
}
from
'@/composables/useChat'
import
Editor
from
'@tinymce/tinymce-vue'
import
{
useMapStore
}
from
'@/stores/map'
const
props
=
defineProps
([
'data'
,
'action'
])
const
emit
=
defineEmits
([
'update'
,
'update:modelValue'
])
const
liveTalkDuration
=
useMapStore
().
getMapValuesByKey
(
'live_talk_duration'
)
const
actonMap
=
{
add
:
'添加'
,
update
:
'编辑'
,
view
:
'查看'
}
const
isUpdate
=
computed
(()
=>
props
.
action
===
'update'
)
...
...
@@ -20,7 +22,7 @@ const form = reactive({
live_commodity_id
:
''
,
selling_point
:
''
,
marketing_campaign
:
''
,
duration
:
'10'
,
duration
:
liveTalkDuration
[
0
]?.
value
||
'10'
,
content
:
''
,
})
watchEffect
(()
=>
{
...
...
@@ -194,7 +196,7 @@ function handleAIGenerate(index) {
</el-form-item>
<el-form-item
label=
"话术时长"
prop=
"duration"
>
<el-radio-group
v-model=
"form.duration"
>
<el-radio
v-for=
"item in liveT
est
Duration"
v-bind=
"item"
:key=
"item.value"
></el-radio>
<el-radio
v-for=
"item in liveT
alk
Duration"
v-bind=
"item"
:key=
"item.value"
></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
...
...
src/modules/live/test/api.ts
浏览文件 @
285b3d47
import
httpRequest
from
'@/utils/axios'
// 获取实验直播
练习
的列表
// 获取实验直播的列表
export
function
getTestList
(
params
?:
{
live_commodity_id
?:
string
live_commodity_type_id
?:
string
...
...
@@ -9,22 +9,22 @@ export function getTestList(params?: {
return
httpRequest
.
get
(
'/api/lab/v1/experiment/live-practice/list'
,
{
params
})
}
// 获取实验直播
练习
详情
// 获取实验直播详情
export
function
getTest
(
params
:
{
id
:
string
})
{
return
httpRequest
.
get
(
'/api/lab/v1/experiment/live-practice/detail'
,
{
params
})
}
// 创建实验直播
练习
// 创建实验直播
export
function
createTest
(
data
:
{
pid
:
string
;
name
:
string
;
status
:
string
})
{
return
httpRequest
.
post
(
'/api/lab/v1/experiment/live-practice/create'
,
data
)
}
// 更新实验直播
练习
详情
// 更新实验直播详情
export
function
updateTest
(
data
:
{
id
:
string
;
name
:
string
;
status
:
string
})
{
return
httpRequest
.
post
(
'/api/lab/v1/experiment/live-practice/update'
,
data
)
}
// 删除实验直播
练习
// 删除实验直播
export
function
deleteTest
(
data
:
{
id
:
string
})
{
return
httpRequest
.
post
(
'/api/lab/v1/experiment/live-practice/delete'
,
data
)
}
...
...
@@ -39,7 +39,7 @@ export function getTalkList(params?: {
return
httpRequest
.
get
(
'/api/lab/v1/experiment/live-speeches/list'
,
{
params
})
}
// 更新实验直播
练习
详情
// 更新实验直播详情
export
function
saveTestRecord
(
data
:
{
id
?:
string
live_practice_id
:
string
...
...
src/modules/live/test/components/FormDialog.vue
浏览文件 @
285b3d47
<
script
setup
>
import
{
ElMessage
}
from
'element-plus'
import
{
liveTestDuration
,
liveTestUploadWay
}
from
'@/utils/dictionary'
import
LiveProductSelect
from
'@/components/LiveProductSelect.vue'
import
{
createTest
,
updateTest
,
getTalkList
}
from
'../api'
import
{
useMapStore
}
from
'@/stores/map'
const
props
=
defineProps
([
'data'
])
const
emit
=
defineEmits
([
'update'
,
'update:modelValue'
])
const
liveDuration
=
useMapStore
().
getMapValuesByKey
(
'live_duration'
)
const
liveUploadWay
=
useMapStore
().
getMapValuesByKey
(
'live_upload_way'
)
const
isUpdate
=
computed
(()
=>
!!
props
.
data
?.
id
)
const
title
=
computed
(()
=>
(
isUpdate
.
value
?
'编辑直播
练习'
:
'添加直播练习
'
))
const
title
=
computed
(()
=>
(
isUpdate
.
value
?
'编辑直播
'
:
'添加直播
'
))
const
formRef
=
ref
()
const
form
=
reactive
({
live_commodity_id
:
''
,
live_speech_id
:
''
,
duration
:
'10'
,
upload_way
:
'2'
,
duration
:
liveDuration
[
0
]?.
value
||
'10'
,
upload_way
:
liveUploadWay
[
0
]?.
value
||
'2'
,
})
const
rules
=
ref
({
...
...
@@ -71,17 +74,14 @@ async function handleUpdate() {
<el-option
v-for=
"item in options"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"选择
练习
时长"
prop=
"duration"
>
<el-form-item
label=
"选择
直播
时长"
prop=
"duration"
>
<el-radio-group
v-model=
"form.duration"
>
<el-radio
v-for=
"item in live
Test
Duration"
v-bind=
"item"
:key=
"item.value"
></el-radio>
<el-radio
v-for=
"item in liveDuration"
v-bind=
"item"
:key=
"item.value"
></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"直播
练习
上传方式"
prop=
"upload_way"
>
<el-form-item
label=
"直播
视频
上传方式"
prop=
"upload_way"
>
<el-radio-group
v-model=
"form.upload_way"
>
<el-radio
v-for=
"item in liveTestUploadWay.filter((item) => item.value == 2)"
v-bind=
"item"
:key=
"item.value"
></el-radio>
<el-radio
v-for=
"item in liveUploadWay"
v-bind=
"item"
:key=
"item.value"
></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
...
...
src/modules/live/test/components/Live.vue
浏览文件 @
285b3d47
...
...
@@ -173,7 +173,7 @@ defineExpose({ enabled, start, stop })
style=
"width: 80%"
@
click=
"enabled ? stop() : start()"
v-if=
"!recordId"
>
{{
enabled
?
'结束直播
练习'
:
'开始练习
'
}}
{{
enabled
?
'结束直播
'
:
'开始直播
'
}}
</el-button>
<el-button
type=
"primary"
...
...
src/modules/live/test/components/RecordDialog.vue
浏览文件 @
285b3d47
...
...
@@ -41,7 +41,7 @@ const listOptions = {
</
script
>
<
template
>
<el-dialog
title=
"
选择直播练习
场次"
>
<el-dialog
title=
"
查看历史直播
场次"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
>
<template
#
table-x=
"
{ row }">
<el-button
text
type=
"primary"
>
...
...
src/modules/live/test/views/Demo.vue
浏览文件 @
285b3d47
...
...
@@ -33,7 +33,7 @@ async function fetchInfo() {
timeLeft
.
value
=
duration
.
value
}
watchEffect
(()
=>
{
fetchInfo
()
!
props
.
isView
&&
fetchInfo
()
})
// 商品卖点
...
...
@@ -57,7 +57,10 @@ const stats = computed(() => {
const
fetchRecord
=
async
()
=>
{
const
res
=
await
getRecord
({
id
:
route
.
query
.
record_id
})
record
.
value
=
{
...
res
.
data
.
detail
,
live_info
:
JSON
.
parse
(
res
.
data
.
detail
.
live_info
)
}
const
resDetail
=
res
.
data
.
detail
record
.
value
=
{
...
resDetail
,
live_info
:
JSON
.
parse
(
resDetail
.
live_info
)
}
detail
.
value
=
resDetail
.
live_practice_info
timeLeft
.
value
=
duration
.
value
}
onMounted
(()
=>
{
props
.
isView
&&
fetchRecord
()
...
...
@@ -65,7 +68,7 @@ onMounted(() => {
</
script
>
<
template
>
<AppCard
title=
"直播练习
"
full
>
<AppCard
:title=
"isView ? '查看历史直播详情' : '直播'
"
full
>
<div
class=
"live-row"
>
<div
class=
"live-col"
>
<template
v-if=
"isView"
>
...
...
src/modules/live/test/views/Index.vue
浏览文件 @
285b3d47
...
...
@@ -2,7 +2,10 @@
import
{
ElMessageBox
,
ElMessage
}
from
'element-plus'
import
LiveProductCategory
from
'@/components/LiveProductCategory.vue'
import
{
getTestList
,
deleteTest
}
from
'../api'
import
{
getNameByValue
,
liveTestUploadWay
}
from
'@/utils/dictionary'
import
{
getNameByValue
}
from
'@/utils/dictionary'
import
{
useMapStore
}
from
'@/stores/map'
const
liveUploadWay
=
useMapStore
().
getMapValuesByKey
(
'live_upload_way'
)
const
FormDialog
=
defineAsyncComponent
(()
=>
import
(
'../components/FormDialog.vue'
))
const
RecordDialog
=
defineAsyncComponent
(()
=>
import
(
'../components/RecordDialog.vue'
))
...
...
@@ -41,7 +44,7 @@ const listOptions = computed(() => {
label
:
'上传方式'
,
prop
:
'upload_way'
,
computed
({
row
})
{
return
getNameByValue
(
row
.
upload_way
,
live
Test
UploadWay
)
return
getNameByValue
(
row
.
upload_way
,
liveUploadWay
)
},
},
{
label
:
'更新时间'
,
prop
:
'updated_time'
},
...
...
@@ -68,17 +71,17 @@ const handleRemove = async (row) => {
</
script
>
<
template
>
<AppCard
title=
"
直播练习
"
>
<AppCard
title=
"
我的直播
"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
>
<template
#
header-buttons
>
<el-button
type=
"primary"
@
click=
"formVisible = true"
>
添加直播
练习
</el-button>
<el-button
type=
"primary"
@
click=
"formVisible = true"
>
添加直播
</el-button>
</
template
>
<
template
#
filter-category
>
<LiveProductCategory
v-model=
"listParams.live_commodity_type_id"
@
change=
"handleRefresh"
></LiveProductCategory>
</
template
>
<
template
#
table-x=
"{ row }"
>
<el-button
text
type=
"primary"
>
<router-link
:to=
"
{ path: 'test/demo', query: { id: row.id } }">
练习
</router-link>
<router-link
:to=
"
{ path: 'test/demo', query: { id: row.id } }">
开始直播
</router-link>
</el-button>
<el-button
text
type=
"primary"
@
click=
"handelView(row)"
>
查看
</el-button>
<el-button
text
type=
"primary"
@
click=
"handleRemove(row)"
>
删除
</el-button>
...
...
src/stores/menu.ts
浏览文件 @
285b3d47
...
...
@@ -172,7 +172,7 @@ const studentMenus: IMenuItem[] = [
icon
:
markRaw
(
IconLiveProductManagement
),
},
{
id
:
24
,
name
:
'直播话术管理'
,
path
:
'/live/talk'
,
icon
:
markRaw
(
IconLiveTalk
)
},
{
id
:
25
,
name
:
'直播
练习
'
,
path
:
'/live/test'
,
icon
:
markRaw
(
IconLiveTest
)
},
{
id
:
25
,
name
:
'直播'
,
path
:
'/live/test'
,
icon
:
markRaw
(
IconLiveTest
)
},
],
},
{
...
...
@@ -339,7 +339,7 @@ const adminMenus: IMenuItem[] = [
{
id
:
22
,
name
:
'商品属性管理'
,
path
:
'/live/product/attr'
,
icon
:
markRaw
(
IconLiveProductAttr
)
},
{
id
:
23
,
name
:
'商品管理'
,
path
:
'/live/product/management'
,
icon
:
markRaw
(
IconLiveProductManagement
)
},
{
id
:
24
,
name
:
'直播话术管理'
,
path
:
'/live/talk'
,
icon
:
markRaw
(
IconLiveTalk
)
},
{
id
:
25
,
name
:
'直播
练习
'
,
path
:
'/live/test'
,
icon
:
markRaw
(
IconLiveTest
)
},
{
id
:
25
,
name
:
'直播'
,
path
:
'/live/test'
,
icon
:
markRaw
(
IconLiveTest
)
},
],
},
{
...
...
src/utils/dictionary.ts
浏览文件 @
285b3d47
...
...
@@ -156,14 +156,14 @@ export const textPurposeList = [
{
label
:
'短视频脚本 '
,
value
:
'3'
},
]
// 直播
练习
时长
// 直播时长
export
const
liveTestDuration
=
[
{
label
:
'10分钟'
,
value
:
'10'
},
{
label
:
'15分钟 '
,
value
:
'15'
},
{
label
:
'20分钟 '
,
value
:
'20'
},
]
// 直播
练习
时长
// 直播时长
export
const
liveTestUploadWay
=
[
{
label
:
'实时上传'
,
value
:
'1'
},
{
label
:
'本地上传'
,
value
:
'2'
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论