提交 6d3b4f84 authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 8c92f7f5
......@@ -13,7 +13,8 @@ const props = defineProps({
data: { type: Object, required: false },
markerEnd: { type: String, required: false },
style: { type: Object, required: false },
label: { required: false }
label: { required: false },
selected: { type: Boolean, required: false }
})
const { removeEdges } = useVueFlow()
......@@ -28,11 +29,11 @@ export default {
</script>
<template>
<StraightEdge :id="id" :style="style" :path="path[0]" :marker-end="markerEnd"></StraightEdge>
<StraightEdge :id="id" :style="style" :path="path[0]" :marker-end="markerEnd" :interactionWidth="2"></StraightEdge>
<EdgeLabelRenderer>
<div class="edge-label" :style="{ transform: `translate(-50%, -50%) translate(${path[1]}px,${path[2]}px)` }">
<span v-if="label">{{ label }}</span>
<el-icon @click="removeEdges([id])"><CircleCloseFilled /></el-icon>
<el-icon @click="removeEdges([id])" v-if="selected"><CircleCloseFilled /></el-icon>
</div>
</EdgeLabelRenderer>
</template>
......
......@@ -95,13 +95,13 @@ const onDragStart = (event: DragEvent, data: any) => {
:draggable="true"
@dragstart="event => onDragStart(event, item)">
<div class="icon-box">
<Icon class="icon" color="#fff" :name="item.icon" w="24" h="24"></Icon>
<Icon
class="circle"
:color="item.color || parent.background?.color"
:name="parent.background?.icon || ''"
w="60"
h="60"></Icon>
<Icon class="icon" color="#fff" :name="item.icon" w="24" h="24"></Icon>
</div>
<p>{{ item.name }}</p>
</li>
......@@ -157,6 +157,11 @@ const onDragStart = (event: DragEvent, data: any) => {
font-size: 12px;
text-align: center;
}
&:hover {
.circle {
filter: drop-shadow(2px 2px 10px #969696);
}
}
}
}
</style>
......@@ -117,3 +117,11 @@ function updateNode() {
</template>
</el-dialog>
</template>
<style lang="scss">
.el-card {
.el-form-item:last-child {
margin-bottom: 0;
}
}
</style>
......@@ -22,8 +22,8 @@ function onRemove() {
<template>
<div class="custom-node">
<div class="node-toolbar">
<el-icon v-if="nodesDraggable" size="12" @click="onRemove"><Delete /></el-icon>
<el-icon size="12" @click="emit('setting')" v-if="canSetting"><Setting /></el-icon>
<el-icon v-if="nodesDraggable" size="14" @click="onRemove"><Delete /></el-icon>
<el-icon size="14" @click="emit('setting')" v-if="canSetting"><Setting /></el-icon>
</div>
<div class="custom-node__inner"><slot :node="node" /></div>
<p class="node-label">{{ node.label }}</p>
......@@ -72,7 +72,7 @@ function onRemove() {
position: absolute;
left: 100%;
top: 50%;
padding-left: 5px;
padding-left: 2px;
transform: translateY(-50%);
.handle-link {
position: unset;
......@@ -119,13 +119,22 @@ function onRemove() {
}
}
}
.vue-flow__handle-right {
right: 0;
}
.custom-node {
position: relative;
&:hover {
.circle {
filter: drop-shadow(2px 2px 10px #969696);
}
}
}
.node-toolbar {
position: absolute;
left: 50%;
top: -25px;
bottom: 100%;
margin-bottom: 2px;
display: none;
align-items: center;
justify-content: center;
......@@ -134,7 +143,7 @@ function onRemove() {
box-shadow: 2px 2px 10px 0px rgba(0, 0, 0, 0.3);
border-radius: 20px;
.el-icon {
margin: 5px 8px;
padding: 5px 8px;
cursor: pointer;
}
}
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" :connectionType="1" @setting="settingVisible = true">
<div class="node-item">
<Icon name="hexagon" :color="isGray ? '#9a9a9a' : '#ceaa62'" w="60" h="60"></Icon>
<Icon class="circle" name="hexagon" :color="isGray ? '#9a9a9a' : '#ceaa62'" w="60" h="60"></Icon>
<Icon class="icon" name="20" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" :connectionType="1" @setting="settingVisible = true">
<div class="node-item">
<Icon name="hexagon" :color="isGray ? '#9a9a9a' : '#ceaa62'" w="60" h="60"></Icon>
<Icon class="circle" name="hexagon" :color="isGray ? '#9a9a9a' : '#ceaa62'" w="60" h="60"></Icon>
<Icon class="icon" name="23" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" :connectionType="1" @setting="settingVisible = true">
<div class="node-item">
<Icon name="hexagon" :color="isGray ? '#9a9a9a' : '#ceaa62'" w="60" h="60"></Icon>
<Icon class="circle" name="hexagon" :color="isGray ? '#9a9a9a' : '#ceaa62'" w="60" h="60"></Icon>
<Icon class="icon" name="22" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" :connectionType="1" @setting="settingVisible = true">
<div class="node-item">
<Icon name="hexagon" :color="isGray ? '#9a9a9a' : '#ceaa62'" w="60" h="60"></Icon>
<Icon class="circle" name="hexagon" :color="isGray ? '#9a9a9a' : '#ceaa62'" w="60" h="60"></Icon>
<Icon class="icon" name="21" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -14,7 +14,7 @@ watchEffect(() => {
Object.assign(form, props.node.data[role])
})
const { connectionList } = useConnection()
const { connectionList } = useConnection(1)
const operateList = ref([{ label: '关注中', value: '0' }])
</script>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" :connectionType="1" @setting="settingVisible = true">
<div class="node-item">
<Icon name="hexagon" :color="isGray ? '#9a9a9a' : '#ceaa62'" w="60" h="60"></Icon>
<Icon class="circle" name="hexagon" :color="isGray ? '#9a9a9a' : '#ceaa62'" w="60" h="60"></Icon>
<Icon class="icon" name="1" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" :connectionType="1" @setting="settingVisible = true">
<div class="node-item">
<Icon name="hexagon" :color="isGray ? '#9a9a9a' : '#ceaa62'" w="60" h="60"></Icon>
<Icon class="circle" name="hexagon" :color="isGray ? '#9a9a9a' : '#ceaa62'" w="60" h="60"></Icon>
<Icon class="icon" name="24" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" :connectionType="2" @setting="settingVisible = true">
<div class="node-item">
<Icon name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="circle" name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="icon" name="15" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" :connectionType="2" @setting="settingVisible = true">
<div class="node-item">
<Icon name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="circle" name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="icon" name="18" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -21,9 +21,12 @@ const operateList = ref([{ label: '发送消息', value: '0' }])
const materialTypeList = useMapStore().getMapValuesByKey('experiment_marketing_material_type')
const { materialList } = useMaterial()
const { materialList, materialType } = useMaterial()
watchEffect(() => {
materialType.value = form.material_type
})
const { connectionList } = useConnection()
const { connectionList } = useConnection(2)
</script>
<template>
......@@ -47,7 +50,7 @@ const { connectionList } = useConnection()
</template>
<template v-else-if="step === 2">
<el-form-item>
<el-radio-group v-model="form.material_type">
<el-radio-group v-model="form.material_type" @change="form.material_id = ''">
<el-radio v-for="item in materialTypeList" :key="item.id" :label="item.value" style="width: 105px">
发送{{ item.label }}
</el-radio>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" :connectionType="2" @setting="settingVisible = true">
<div class="node-item">
<Icon name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="circle" name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="icon" name="2" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -25,9 +25,12 @@ const operateList = ref([
const materialTypeList = useMapStore().getMapValuesByKey('experiment_marketing_material_type')
const { materialList } = useMaterial()
const { materialList, materialType } = useMaterial()
watchEffect(() => {
materialType.value = form.material_type
})
const { connectionList } = useConnection()
const { connectionList } = useConnection(6)
</script>
<template>
......@@ -51,7 +54,7 @@ const { connectionList } = useConnection()
</template>
<template v-else-if="step === 2">
<el-form-item>
<el-radio-group v-model="form.material_type">
<el-radio-group v-model="form.material_type" @change="form.material_id = ''">
<el-radio v-for="item in materialTypeList" :key="item.id" :label="item.value" style="width: 105px">
发送{{ item.label }}
</el-radio>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" :connectionType="2" @setting="settingVisible = true">
<div class="node-item">
<Icon name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="circle" name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="icon" name="6" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -21,9 +21,11 @@ const operateList = ref([{ label: '发送邮件', value: '0' }])
const materialTypeList = useMapStore().getMapValuesByKey('experiment_marketing_material_type')
const { materialList } = useMaterial()
const { connectionList } = useConnection()
const { materialList, materialType } = useMaterial()
watchEffect(() => {
materialType.value = form.material_type
})
const { connectionList } = useConnection(9)
</script>
<template>
......@@ -47,7 +49,7 @@ const { connectionList } = useConnection()
</template>
<template v-else-if="step === 2">
<el-form-item>
<el-radio-group v-model="form.material_type">
<el-radio-group v-model="form.material_type" @change="form.material_id = ''">
<el-radio v-for="item in materialTypeList" :key="item.id" :label="item.value" style="width: 105px">
发送{{ item.label }}
</el-radio>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" :connectionType="2" @setting="settingVisible = true">
<div class="node-item">
<Icon name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="circle" name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="icon" name="9" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -9,7 +9,7 @@ defineProps<{ node: any }>()
<template>
<NodeTemplate :node="node" :connectionType="2" :canSetting="false" :canConnect="false">
<div class="node-item">
<Icon name="square" color="#AA1941" w="60" h="60"></Icon>
<Icon class="circle" name="square" color="#AA1941" w="60" h="60"></Icon>
<Icon class="icon" name="16" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" :connectionType="2" @setting="settingVisible = true">
<div class="node-item">
<Icon name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="circle" name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="icon" name="19" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" :connectionType="2" @setting="settingVisible = true">
<div class="node-item">
<Icon name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="circle" name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="icon" name="14" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" :connectionType="2" @setting="settingVisible = true">
<div class="node-item">
<Icon name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="circle" name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="icon" name="17" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -18,9 +18,12 @@ watchEffect(() => {
const materialTypeList = useMapStore().getMapValuesByKey('experiment_marketing_material_type')
const { materialList } = useMaterial()
const { materialList, materialType } = useMaterial()
watchEffect(() => {
materialType.value = form.material_type
})
const { connectionList } = useConnection()
const { connectionList } = useConnection(1)
</script>
<template>
......@@ -28,7 +31,7 @@ const { connectionList } = useConnection()
<template #default="{ step }: { step: number }">
<template v-if="step === 0">
<el-form-item>
<el-radio-group v-model="form.material_type">
<el-radio-group v-model="form.material_type" @change="form.material_id = ''">
<el-radio v-for="item in materialTypeList" :key="item.id" :label="item.value" style="width: 105px">
发送{{ item.label }}
</el-radio>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" :connectionType="2" @setting="settingVisible = true">
<div class="node-item">
<Icon name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="circle" name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="icon" name="1" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -17,7 +17,7 @@ watchEffect(() => {
const operateList = ref([{ label: '发送消息', value: '0' }])
const { connectionList } = useConnection()
const { connectionList } = useConnection(10)
</script>
<template>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" :connectionType="2" @setting="settingVisible = true">
<div class="node-item">
<Icon name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="circle" name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="icon" name="10" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -25,9 +25,11 @@ const operateList = ref([
const materialTypeList = useMapStore().getMapValuesByKey('experiment_marketing_material_type')
const { materialList } = useMaterial()
const { connectionList } = useConnection()
const { materialList, materialType } = useMaterial()
watchEffect(() => {
materialType.value = form.material_type
})
const { connectionList } = useConnection(7)
</script>
<template>
......@@ -51,7 +53,7 @@ const { connectionList } = useConnection()
</template>
<template v-else-if="step === 2">
<el-form-item>
<el-radio-group v-model="form.material_type">
<el-radio-group v-model="form.material_type" @change="form.material_id = ''">
<el-radio v-for="item in materialTypeList" :key="item.id" :label="item.value" style="width: 105px">
发送{{ item.label }}
</el-radio>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" :connectionType="2" @setting="settingVisible = true">
<div class="node-item">
<Icon name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="circle" name="square" :color="isGray ? '#9a9a9a' : '#19AAA5'" w="60" h="60"></Icon>
<Icon class="icon" name="7" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" @setting="settingVisible = true">
<div class="node-item">
<Icon name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="circle" name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="icon" name="15" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -15,7 +15,7 @@ watchEffect(() => {
Object.assign(form, props.node.data[role])
})
const { connectionList } = useConnection()
const { connectionList } = useConnection(12)
const operateList = ref([
{ label: '用户发送文本私信', value: '0' },
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" @setting="settingVisible = true">
<div class="node-item">
<Icon name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="circle" name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="icon" name="12" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" @setting="settingVisible = true">
<div class="node-item">
<Icon name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="circle" name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="icon" name="14" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -15,17 +15,13 @@ watchEffect(() => {
Object.assign(form, props.node.data[role])
})
const { connectionList } = useConnection()
const { connectionList } = useConnection(6)
const operateList = ref([
{ label: '访问网页', value: '0' },
{ label: '激活APP', value: '1' },
{ label: '启动APP', value: '2' },
{ label: '退出APP', value: '3' },
{ label: '展示APP页面', value: '4' },
{ label: '点击APP元素', value: '5' },
{ label: '退出APP页面', value: '6' },
{ label: '离开网页', value: '7' }
{ label: '用户发送文本私信', value: '0' },
{ label: '用户发送表情私信', value: '1' },
{ label: '用户发送卡片私信', value: '2' },
{ label: '在主页Tab提交预约', value: '3' }
])
</script>
......@@ -35,7 +31,7 @@ const operateList = ref([
<el-form-item>
<template v-if="step === 0">
<el-radio-group v-model="form.operate" v-if="step === 0">
<el-radio v-for="item in operateList" :key="item.value" :label="item.value" style="width: 105px">
<el-radio v-for="item in operateList" :key="item.value" :label="item.value" style="width: 140px">
{{ item.label }}
</el-radio>
</el-radio-group>
......
......@@ -9,14 +9,10 @@ defineProps<{ node: any }>()
const { connectionList } = useConnection()
const operateList = [
{ label: '访问网页', value: '0' },
{ label: '激活APP', value: '1' },
{ label: '启动APP', value: '2' },
{ label: '退出APP', value: '3' },
{ label: '展示APP页面', value: '4' },
{ label: '点击APP元素', value: '5' },
{ label: '退出APP页面', value: '6' },
{ label: '离开网页', value: '7' }
{ label: '用户发送文本私信', value: '0' },
{ label: '用户发送表情私信', value: '1' },
{ label: '用户发送卡片私信', value: '2' },
{ label: '在主页Tab提交预约', value: '3' }
]
const getConnectionLabel = function (id: string) {
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" @setting="settingVisible = true">
<div class="node-item">
<Icon name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="circle" name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="icon" name="6" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" @setting="settingVisible = true">
<div class="node-item">
<Icon name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="circle" name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="icon" name="14" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -15,7 +15,7 @@ watchEffect(() => {
Object.assign(form, props.node.data[role])
})
const { connectionList } = useConnection()
const { connectionList } = useConnection(1)
const operateList = ref([
{ label: '关注公众号', value: '0' },
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" @setting="settingVisible = true">
<div class="node-item">
<Icon name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="circle" name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="icon" name="1" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......@@ -32,4 +32,4 @@ const settingVisible = ref(false)
<Config v-model="settingVisible" :node="node" v-if="settingVisible && action === 'edit'" />
<!-- 查看配置 -->
<ConfigView v-model="settingVisible" :node="node" v-if="settingVisible && action === 'view'" />
</template>
\ No newline at end of file
</template>
......@@ -23,7 +23,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" @setting="settingVisible = true">
<div class="node-item">
<Icon name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="circle" name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="icon" name="13" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -15,7 +15,7 @@ watchEffect(() => {
Object.assign(form, props.node.data[role])
})
const { connectionList } = useConnection()
const { connectionList } = useConnection(7)
const operateList = ref([
{ label: '关注微博', value: '0' },
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" @setting="settingVisible = true">
<div class="node-item">
<Icon name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="circle" name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="icon" name="7" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -15,7 +15,7 @@ watchEffect(() => {
Object.assign(form, props.node.data[role])
})
const { connectionList } = useConnection()
const { connectionList } = useConnection(4)
const operateList = ref([{ label: '提交表单', value: '0' }])
</script>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" @setting="settingVisible = true">
<div class="node-item">
<Icon name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="circle" name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="icon" name="4" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -15,7 +15,7 @@ watchEffect(() => {
Object.assign(form, props.node.data[role])
})
const { connectionList } = useConnection()
const { connectionList } = useConnection(3)
const operateList = ref([{ label: '新用户注册', value: '0' }])
</script>
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" @setting="settingVisible = true">
<div class="node-item">
<Icon name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="circle" name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="icon" name="3" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -15,7 +15,7 @@ watchEffect(() => {
Object.assign(form, props.node.data[role])
})
const { connectionList } = useConnection()
const { connectionList } = useConnection(8)
const operateList = ref([
{ label: '被用户关注', value: '0' },
......
......@@ -24,7 +24,7 @@ const settingVisible = ref(false)
<template>
<NodeTemplate :node="node" @setting="settingVisible = true">
<div class="node-item">
<Icon name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="circle" name="circle" :color="isGray ? '#9a9a9a' : '#4C5AB3'" w="60" h="60"></Icon>
<Icon class="icon" name="8" color="#fff" w="24" h="24"></Icon>
</div>
</NodeTemplate>
......
......@@ -90,11 +90,12 @@ export function useTag() {
}
// 所有连接
const connectionList = ref<ConnectionType[]>([])
export function useConnection() {
const allConnectionList = ref<ConnectionType[]>([])
export function useConnection(type?: number) {
const connectionType = ref<number | undefined>(type)
function fetchConnectionList() {
getConnectionList().then((res: any) => {
connectionList.value = res.data.items.map((item: any) => {
allConnectionList.value = res.data.items.map((item: any) => {
const attrs =
typeof item.config_attributes === 'string' ? JSON.parse(item.config_attributes) : item.config_attributes
const name = Array.isArray(attrs) ? attrs.find((item: any) => item.prop === 'name')?.value : attrs.name
......@@ -102,10 +103,16 @@ export function useConnection() {
})
})
}
const connectionList = computed(() => {
if (connectionType.value !== undefined) {
return allConnectionList.value.filter(item => item.type === connectionType.value)
}
return allConnectionList.value
})
onMounted(() => {
if (!connectionList.value?.length) fetchConnectionList()
if (!allConnectionList.value?.length) fetchConnectionList()
})
return { fetchConnectionList, connectionList }
return { fetchConnectionList, connectionList, connectionType }
}
// 所有群组
......@@ -123,15 +130,22 @@ export function useGroup() {
}
// 所有营销资料
const materialList = ref<MaterialType[]>([])
export function useMaterial() {
const allMaterialList = ref<MaterialType[]>([])
export function useMaterial(type?: string) {
const materialType = ref<string | undefined>(type)
function fetchMaterialList() {
getMaterialList().then((res: any) => {
materialList.value = res.data.items
allMaterialList.value = res.data.items
})
}
const materialList = computed(() => {
if (materialType.value !== undefined) {
return allMaterialList.value.filter(item => item.type === materialType.value)
}
return allMaterialList.value
})
onMounted(() => {
if (!materialList.value?.length) fetchMaterialList()
if (!allMaterialList.value?.length) fetchMaterialList()
})
return { fetchMaterialList, materialList }
return { fetchMaterialList, materialList, materialType }
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论