2023-12-16 12:19:26 +08:00
|
|
|
<template>
|
|
|
|
<iframe
|
|
|
|
ref="iframe"
|
2023-12-16 17:58:03 +08:00
|
|
|
:src="`/lib?token=${token}&x1c2Hdd6=D7Rzd7Oe&namespaceId=${namespaceId}&id=${id}`"
|
2023-12-16 12:19:26 +08:00
|
|
|
marginwidth="0"
|
|
|
|
frameborder="no"
|
|
|
|
:style="`width: 100%;height:calc(99vh - 60px)`"
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import storage from 'store'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'WorkFlowEdit',
|
|
|
|
components: {},
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
id: '',
|
|
|
|
token: '',
|
|
|
|
namespaceId: ''
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted () {
|
|
|
|
this.id = this.$route.query.id
|
|
|
|
this.token = storage.get('Access-Token')
|
|
|
|
this.namespaceId = storage.get('app_namespace')
|
|
|
|
},
|
|
|
|
created () {
|
|
|
|
window.addEventListener('message', this.handleMessage, false)
|
|
|
|
},
|
|
|
|
destroyed () {
|
|
|
|
window.removeEventListener('message', this.handleMessage)
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
save () {
|
|
|
|
window.removeEventListener('message', this.handleMessage)
|
2023-12-16 18:21:49 +08:00
|
|
|
this.$message.info('工作流新增成功')
|
2023-12-16 12:19:26 +08:00
|
|
|
this.$router.push({ path: '/job/workflow/list' })
|
|
|
|
},
|
|
|
|
cancel () {
|
|
|
|
window.removeEventListener('message', this.handleMessage)
|
|
|
|
this.$router.push({ path: '/job/workflow/list' })
|
|
|
|
},
|
2023-12-16 18:21:49 +08:00
|
|
|
update () {
|
|
|
|
this.$message.info('工作流修改成功')
|
|
|
|
this.$router.push({ path: '/job/workflow/list' })
|
|
|
|
},
|
2023-12-16 12:19:26 +08:00
|
|
|
handleMessage (e) {
|
|
|
|
if (typeof e.data === 'object') {
|
|
|
|
if (e.data.code === 'SV5ucvLBhvFkOftb') {
|
|
|
|
this.save()
|
|
|
|
} else if (e.data.code === 'kb4DO9h6WIiqFhbp') {
|
|
|
|
this.cancel()
|
2023-12-16 18:21:49 +08:00
|
|
|
} else if (e.data.code === '8Rr3XPtVVAHfduQg') {
|
|
|
|
this.update()
|
2023-12-16 12:19:26 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.ant-layout-content {
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ant-layout-footer {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
</style>
|