Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-dml
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-dml
Commits
69329fd8
提交
69329fd8
authored
8月 17, 2023
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 旅程增加触发和关闭按钮
上级
d4fdc150
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
19 行增加
和
13 行删除
+19
-13
api.ts
src/modules/trip/template/api.ts
+6
-7
Setting.vue
src/modules/trip/template/views/Setting.vue
+13
-6
没有找到文件。
src/modules/trip/template/api.ts
浏览文件 @
69329fd8
...
...
@@ -52,12 +52,11 @@ export function ruleQuery(data: { experiment_id: string; filters: string }) {
}
// 保存实验旅程数据规则
export
function
saveRule
(
data
:
{
itinerary_id
:
string
data_generate_mode
:
string
data_generate_frequency
:
string
auto_generate_rule
:
string
graph
:
string
})
{
export
function
saveRule
(
data
:
{
itinerary_id
:
string
;
data_generate_mode
:
string
;
data_generate_frequency
:
string
;
auto_generate_rule
:
string
;
graph
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/backend/experiment-itinerary/save-data-config'
,
data
)
}
// 取消、触发旅程
export
function
updateTriggerStatus
(
data
:
{
itinerary_id
:
string
;
trigger_status
:
0
|
1
})
{
return
httpRequest
.
post
(
'/api/lab/v1/experiment/itinerary/trigger'
,
data
)
}
src/modules/trip/template/views/Setting.vue
浏览文件 @
69329fd8
...
...
@@ -5,7 +5,7 @@ import type { ConnectionType } from '@/composables/useAllData'
import
{
ElMessage
}
from
'element-plus'
import
TripFlow
from
'@/components/flow/Index.vue'
import
TripFlowSidebar
from
'@/components/flow/Sidebar.vue'
import
{
getTripTemplate
,
getTripConnections
,
getTripTemplateDemo
,
updateTripTemplateDemo
}
from
'../api'
import
{
getTripTemplate
,
getTripConnections
,
getTripTemplateDemo
,
updateTripTemplateDemo
,
updateTriggerStatus
}
from
'../api'
import
{
useMapStore
}
from
'@/stores/map'
import
{
getNameByValue
,
tripTemplateTypeList
}
from
'@/utils/dictionary'
const
BindConnection
=
defineAsyncComponent
(()
=>
import
(
'../components/BindConnection.vue'
))
...
...
@@ -15,12 +15,14 @@ const props = defineProps<{ id: string }>()
const
statusList
=
useMapStore
().
getMapValuesByKey
(
'system_status'
)
const
detail
=
ref
<
TripTemplate
>
()
const
triggerStatus
=
ref
<
number
>
(
0
)
const
score
=
computed
(()
=>
{
return
detail
.
value
?
parseFloat
(
detail
.
value
?.
score
)
:
0
})
function
fetchInfo
()
{
getTripTemplate
({
id
:
props
.
id
}).
then
(
res
=>
{
detail
.
value
=
res
.
data
.
detail
triggerStatus
.
value
=
parseInt
(
res
.
data
.
detail
.
is_trigger
)
})
}
...
...
@@ -63,6 +65,13 @@ let configVisible = $ref(false)
function
handleConfig
()
{
configVisible
=
true
}
function
handleChantTriggerStatus
(
status
:
0
|
1
)
{
updateTriggerStatus
({
itinerary_id
:
props
.
id
,
trigger_status
:
status
}).
then
(()
=>
{
triggerStatus
.
value
=
status
ElMessage
.
success
(
'修改成功'
)
})
}
</
script
>
<
template
>
<AppCard
title=
"固定旅程模版配置"
v-if=
"detail"
>
...
...
@@ -115,15 +124,13 @@ function handleConfig() {
<el-row
justify=
"center"
>
<el-button
plain
auto-insert-space
@
click=
"$router.push('/trip/template')"
>
取消
</el-button>
<el-button
type=
"primary"
auto-insert-space
@
click=
"handleSubmit"
>
保存
</el-button>
<el-button
type=
"primary"
auto-insert-space
:disabled=
"triggerStatus === 1"
@
click=
"handleChantTriggerStatus(1)"
>
触发旅程
</el-button>
<el-button
type=
"primary"
auto-insert-space
:disabled=
"triggerStatus === 0"
@
click=
"handleChantTriggerStatus(0)"
>
关闭旅程
</el-button>
</el-row>
</
template
>
</TripFlow>
</AppCard>
<!-- 配置连接 -->
<BindConnection
v-model=
"configVisible"
:data=
"detail"
v-if=
"configVisible && detail"
@
update=
"fetchConnections"
></BindConnection>
<BindConnection
v-model=
"configVisible"
:data=
"detail"
v-if=
"configVisible && detail"
@
update=
"fetchConnections"
></BindConnection>
</template>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论