-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Expand file tree
/
Copy pathindex.vue
More file actions
71 lines (65 loc) · 2.38 KB
/
index.vue
File metadata and controls
71 lines (65 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<template>
<NodeContainer :nodeModel="nodeModel">
<h5 class="title-decoration-1 mb-8">{{ $t('workflow.nodeSetting') }}</h5>
<UserInputFieldTable ref="UserInputFieldTableFef" :node-model="nodeModel" />
<h5 class="title-decoration-1 mb-8 mt-8">
{{ $t('common.param.outputParam') }}
</h5>
<template v-if="nodeFields.length > 0">
<template v-for="(item, index) in nodeFields" :key="index">
<div
class="flex-between border-r-6 p-8-12 mb-8 layout-bg lighter"
@mouseenter="showicon = index"
@mouseleave="showicon = null"
>
<span class="break-all">{{ item.label }} {{ '{' + item.value + '}' }}</span>
<el-tooltip
effect="dark"
:content="$t('workflow.setting.copyParam')"
placement="top"
v-if="showicon === index"
>
<el-button link @click="copyClick(item.globeLabel)" style="padding: 0">
<AppIcon iconName="app-copy"></AppIcon>
</el-button>
</el-tooltip>
</div>
</template>
</template>
<div v-else class="border-r-6 p-8-12 mb-8 layout-bg lighter">
{{ $t('common.noData') }}
</div>
</NodeContainer>
</template>
<script setup lang="ts">
import NodeContainer from '@/workflow/common/NodeContainer.vue'
import { ref, computed, onMounted, inject } from 'vue'
import { copyClick } from '@/utils/clipboard'
import { set } from 'lodash'
import UserInputFieldTable from './component/UserInputFieldTable.vue'
const showicon = ref<number | null>(null)
const getResourceDetail = inject('getResourceDetail') as any
const props = defineProps<{ nodeModel: any }>()
const UserInputFieldTableFef = ref()
const nodeFields = computed(() => {
if (props.nodeModel.properties.user_input_field_list) {
const fields = props.nodeModel.properties.user_input_field_list.map((item: any) => ({
label: typeof item.label == 'string' ? item.label : item.label.label,
value: item.field,
globeLabel: `{{global.${item.field}}}`,
globeValue: `{{context['global'].${item.field}}}`,
}))
set(props.nodeModel.properties.config, 'globalFields', fields)
return fields
}
set(props.nodeModel.properties.config, 'globalFields', [])
return []
})
const resource = getResourceDetail()
onMounted(() => {})
</script>
<style lang="scss" scoped>
:deep(.el-form-item__label) {
display: block;
}
</style>