|
|
@@ -41,6 +41,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
+import { computed } from 'vue'
|
|
|
import type { ComponentPublicInstance } from 'vue'
|
|
|
import { VideoPlay, User, Message, Operation, CircleCheck } from '@element-plus/icons-vue'
|
|
|
import type { Role } from '@/types/system'
|
|
|
@@ -54,6 +55,8 @@ const props = defineProps<{
|
|
|
roleList: Role[]
|
|
|
selectedSubNodeIndex: number | null
|
|
|
drawerVisible: boolean
|
|
|
+ /** 被 SCRM 内嵌时隐藏抄送节点入口,已有抄送节点仍按流程模型展示 */
|
|
|
+ embedded: boolean
|
|
|
}>()
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
@@ -67,7 +70,7 @@ const emit = defineEmits<{
|
|
|
removeSubNode: [index: number]
|
|
|
}>()
|
|
|
|
|
|
-const nodeTypes = [
|
|
|
+const allNodeTypes = [
|
|
|
{ type: 'start-node', label: '开始', icon: VideoPlay, color: '#67C23A' },
|
|
|
{ type: 'approval-node', label: '审批节点', icon: User, color: '#409EFF' },
|
|
|
{ type: 'cc-node', label: '抄送节点', icon: Message, color: '#E6A23C' },
|
|
|
@@ -75,6 +78,11 @@ const nodeTypes = [
|
|
|
{ type: 'end-node', label: '结束', icon: CircleCheck, color: '#F56C6C' }
|
|
|
]
|
|
|
|
|
|
+// 内嵌到 SCRM 时不允许再从左侧面板新增抄送节点;独立使用 qqflow 时保持完整能力
|
|
|
+const nodeTypes = computed(() => props.embedded
|
|
|
+ ? allNodeTypes.filter((node) => node.type !== 'cc-node')
|
|
|
+ : allNodeTypes)
|
|
|
+
|
|
|
function handleDragStart(e: DragEvent, node: any) {
|
|
|
const serializable = { type: node.type, label: node.label }
|
|
|
e.dataTransfer?.setData('application/json', JSON.stringify(serializable))
|