<script setup name="FlowDesign">
import { reactive, ref } from 'vue'
import ScWorkflow from '@/components/scWorkflow'

defineProps({
	label: {
		type: String
	},
	name: {
		type: String
	}
})
const formRef = ref()
const form = reactive({
	// "name": "请假审批",
	processConfig: {
		nodeName: '发起人',
		type: 0,
		nodeRoleList: []
	}
})
const validate = () => {
	return new Promise(resolve => {
		// return new Promise((resolve, reject) => {
		resolve(form)
		/*formRef.value.validate((valid, errObj) => {
			if (valid) {
				console.error('valid 成功')
				// cb?.(form.value)
				resolve(form.value)
				// return form.value
				return
			}
			return reject([props.name, errObj])
		})*/
	})
}
defineExpose({
	formRef,
	validate
})
</script>

<template>
	<ScWorkflow v-model="form.processConfig"></ScWorkflow>
</template>

<style scoped>
.flow-design-wrap {
	background: #f6f8f9;
	margin-bottom: 10px;
}
</style>
