|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<el-button type="primary" icon="plus" round @click="selectProcessForm">选择流程表单</el-button>
|
|
|
- <el-tag v-if="modelValue" class="ml-2" size="small" closable @close="delProcessForm">{{ selected_label || '-' }}</el-tag>
|
|
|
+ <el-tag v-if="modelValue?.formId" class="ml-2" size="small" closable @close="delProcessForm">{{ selected_label || '-' }}</el-tag>
|
|
|
<!-- 查看流程表单 查看 -->
|
|
|
<el-dialog v-model="visible" class="le-dialog local-select-process-form-dialog" title="选择流程表单" width="272">
|
|
|
<!-- <el-scrollbar max-height="400px">
|
|
@@ -22,8 +22,8 @@
|
|
|
value-key="id"
|
|
|
label-key="name"
|
|
|
:loading="optionsRef.loading"
|
|
|
+ @update:selected_label="update_selected_label"
|
|
|
>
|
|
|
- <!-- @update:selected_label="update_selected_label"-->
|
|
|
<template #default="{ item, index, disabled }">
|
|
|
<div class="item">
|
|
|
{{ item.name }} <el-tag class="ml-2" size="small">{{ typeOptions_config[item.type] || '-' }}</el-tag>
|
|
@@ -49,8 +49,8 @@ import { typeOptions_config } from '@/views/flow/form/data.tsx'
|
|
|
const props = defineProps({
|
|
|
modelValue: {
|
|
|
required: true,
|
|
|
- type: String
|
|
|
- // default: ''
|
|
|
+ type: Object as PropType<{ formId: string; formName?: string }>,
|
|
|
+ default: () => ({ formId: undefined, formName: undefined })
|
|
|
}
|
|
|
// value: {
|
|
|
// type: String,
|
|
@@ -62,7 +62,7 @@ const localValue = ref<any>(undefined)
|
|
|
watch(
|
|
|
() => props.modelValue,
|
|
|
val => {
|
|
|
- localValue.value = val
|
|
|
+ localValue.value = val?.formId
|
|
|
}
|
|
|
)
|
|
|
const optionsRef = ref({ list: [], loading: false })
|
|
@@ -73,35 +73,28 @@ formtemplate.formTemplatePageApi({ page: 1, pageSize: 9999 }).then((res: any) =>
|
|
|
}
|
|
|
})
|
|
|
const selected = computed(() => {
|
|
|
- const modelValue = props.modelValue
|
|
|
- return optionsRef.value.list.find(v => v.id === modelValue)
|
|
|
+ const formId = props.modelValue.formId
|
|
|
+ return optionsRef.value.list.find(v => v.id === formId)
|
|
|
})
|
|
|
const selected_label = computed(() => {
|
|
|
return selected.value?.name
|
|
|
})
|
|
|
+const local_selected_label = ref()
|
|
|
const update_selected_label = (label: string) => {
|
|
|
- console.log(label, 'label')
|
|
|
- selected_label.value = label
|
|
|
+ // console.log(label, 'label')
|
|
|
+ local_selected_label.value = label
|
|
|
}
|
|
|
const visible = ref(false)
|
|
|
const selectProcessForm = () => {
|
|
|
console.log('selectProcessForm')
|
|
|
visible.value = true
|
|
|
- localValue.value = props.modelValue
|
|
|
+ localValue.value = props.modelValue?.formId
|
|
|
}
|
|
|
const delProcessForm = () => {
|
|
|
console.log('delProcessForm')
|
|
|
- emits('update:modelValue', undefined)
|
|
|
+ emits('update:modelValue', {})
|
|
|
}
|
|
|
|
|
|
-const validateForm = ref({
|
|
|
- rule: [],
|
|
|
- loading: false
|
|
|
-})
|
|
|
-const EReditorRef = ref()
|
|
|
-const modelContentConfig = ref({})
|
|
|
-const activeData = ref([])
|
|
|
-
|
|
|
const queryDetail = () => {}
|
|
|
onMounted(queryDetail)
|
|
|
const closeDialog = () => {
|
|
@@ -109,7 +102,7 @@ const closeDialog = () => {
|
|
|
visible.value = false
|
|
|
}
|
|
|
const submit = () => {
|
|
|
- emits('update:modelValue', localValue.value)
|
|
|
+ emits('update:modelValue', { formId: localValue.value, formName: local_selected_label.value })
|
|
|
closeDialog()
|
|
|
}
|
|
|
|
|
@@ -121,12 +114,6 @@ const submit = () => {
|
|
|
$myEmit('update:modelValue', val)
|
|
|
}
|
|
|
})*/
|
|
|
-watch(
|
|
|
- () => props.value,
|
|
|
- val => {
|
|
|
- console.error(val, 'props.value')
|
|
|
- }
|
|
|
-)
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|