Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-dml
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-dml
Commits
3e45dd18
提交
3e45dd18
authored
2月 23, 2023
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 新增固定旅程模板配置
上级
8bc2ee8c
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
110 行增加
和
3 行删除
+110
-3
api.ts
src/modules/trip/template/api.ts
+15
-0
index.ts
src/modules/trip/template/index.ts
+4
-1
Index.vue
src/modules/trip/template/views/Index.vue
+8
-2
Setting.vue
src/modules/trip/template/views/Setting.vue
+83
-0
没有找到文件。
src/modules/trip/template/api.ts
浏览文件 @
3e45dd18
...
...
@@ -25,3 +25,18 @@ export function getTripConnections(params: { itinerary_id: string }) {
export
function
bindTripConnections
(
data
:
{
itinerary_id
:
string
;
connection_ids
:
string
[]
})
{
return
httpRequest
.
post
(
'/api/lab/v1/experiment/itinerary/bind-connections'
,
data
)
}
// 获取旅程模板详情
export
function
getTripTemplate
(
params
:
{
id
:
string
})
{
return
httpRequest
.
get
(
'/api/lab/v1/experiment/itinerary/detail'
,
{
params
})
}
// 获取旅程模板demo
export
function
getTripTemplateDemo
(
params
:
{
itinerary_id
:
string
})
{
return
httpRequest
.
get
(
'/api/lab/v1/experiment/itinerary/get-itinerary-demo'
,
{
params
})
}
// 更新旅程模板demo
export
function
updateTripTemplateDemo
(
data
:
{
itinerary_id
:
string
;
graph
:
string
})
{
return
httpRequest
.
post
(
'/api/lab/v1/experiment/itinerary/save-itinerary-demo'
,
data
)
}
src/modules/trip/template/index.ts
浏览文件 @
3e45dd18
...
...
@@ -5,7 +5,10 @@ const routes: RouteRecordRaw[] = [
{
path
:
'/trip/template'
,
component
:
Layout
,
children
:
[{
path
:
''
,
component
:
()
=>
import
(
'./views/Index.vue'
)
}]
children
:
[
{
path
:
''
,
component
:
()
=>
import
(
'./views/Index.vue'
)
},
{
path
:
':id'
,
component
:
()
=>
import
(
'./views/Setting.vue'
),
props
:
true
}
]
}
]
...
...
src/modules/trip/template/views/Index.vue
浏览文件 @
3e45dd18
...
...
@@ -85,9 +85,15 @@ function handleView(row: TripTemplate) {
// 配置
let
configVisible
=
$ref
(
false
)
const
router
=
useRouter
()
function
handleConfig
(
row
:
TripTemplate
)
{
currentRow
=
row
configVisible
=
true
// 自由旅程
if
(
row
.
type
===
'2'
)
{
router
.
push
(
`/trip/template/
${
row
.
id
}
`
)
}
else
{
currentRow
=
row
configVisible
=
true
}
}
</
script
>
...
...
src/modules/trip/template/views/Setting.vue
0 → 100644
浏览文件 @
3e45dd18
<
script
setup
lang=
"ts"
>
import
type
{
TripTemplate
}
from
'../types'
import
{
ElMessage
}
from
'element-plus'
import
TripFlow
from
'@/components/flow/Index.vue'
import
{
getTripTemplate
,
getTripTemplateDemo
,
updateTripTemplateDemo
}
from
'../api'
import
{
useMapStore
}
from
'@/stores/map'
import
{
getNameByValue
,
tripTemplateTypeList
}
from
'@/utils/dictionary'
const
props
=
defineProps
<
{
id
:
string
}
>
()
const
statusList
=
useMapStore
().
getMapValuesByKey
(
'system_status'
)
const
detail
=
ref
<
TripTemplate
>
()
function
fetchInfo
()
{
getTripTemplate
({
id
:
props
.
id
}).
then
(
res
=>
{
detail
.
value
=
res
.
data
.
detail
})
}
onMounted
(()
=>
fetchInfo
())
const
elements
=
ref
([])
// 获取模板配置数据
function
fetchDemo
()
{
getTripTemplateDemo
({
itinerary_id
:
props
.
id
}).
then
(
res
=>
{
try
{
elements
.
value
=
JSON
.
parse
(
res
.
data
.
graph
)
}
catch
(
error
)
{
console
.
log
(
error
)
}
})
}
onMounted
(()
=>
fetchDemo
())
// 保存
function
handleSubmit
()
{
const
params
=
{
itinerary_id
:
props
.
id
,
graph
:
JSON
.
stringify
(
elements
.
value
)
}
updateTripTemplateDemo
(
params
).
then
(()
=>
{
ElMessage
.
success
(
'保存成功'
)
})
}
</
script
>
<
template
>
<AppCard
title=
"固定旅程模版配置"
>
<el-card
shadow=
"never"
style=
"margin-bottom: 20px"
v-if=
"detail"
>
<el-form
label-suffix=
":"
>
<el-row
justify=
"space-between"
>
<el-col
:span=
"8"
>
<el-form-item
label=
"旅程模版名称"
>
{{
detail
.
name
}}
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"模板类型"
>
{{
getNameByValue
(
detail
.
type
,
tripTemplateTypeList
)
}}
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"分值"
>
{{
detail
.
score
}}
</el-form-item>
</el-col>
</el-row>
<el-row
justify=
"space-between"
>
<el-col
:span=
"8"
>
<el-form-item
label=
"更新人"
>
{{
detail
.
updated_operator
.
real_name
}}
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"更新时间"
>
{{
detail
.
updated_time
}}
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"状态"
>
<el-tag
:type=
"detail.status === '1' ? 'success' : 'danger'"
>
{{
getNameByValue
(
detail
.
status
,
statusList
)
}}
</el-tag>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<TripFlow
v-model=
"elements"
action=
"edit"
role=
"teacher"
style=
"height: 80vh"
>
<template
#
footer
>
<el-row
justify=
"center"
>
<el-button
type=
"primary"
auto-insert-space
@
click=
"handleSubmit"
>
保存
</el-button>
</el-row>
</
template
>
</TripFlow>
</AppCard>
</template>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论