diff --git a/src/components/DetailComponent/CollectionDetail.vue b/src/components/DetailComponent/CollectionDetail.vue index 5bda21d..bbc1e2f 100644 --- a/src/components/DetailComponent/CollectionDetail.vue +++ b/src/components/DetailComponent/CollectionDetail.vue @@ -74,10 +74,8 @@ import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.v import {matterTree} from '@/utils/matterTree.js'; import {downloadFile} from "@/api/project-demand"; -const emit = defineEmits(['getInfo']) +const emit = defineEmits(['getInfo',"update:formData"]) const form = ref() -const showForm = ref(true) -const loading = ref(false) const showTable = ref(false) const companyNameArray = ref([]) @@ -97,7 +95,10 @@ const props = defineProps({ companyOption: { type: Array, default: [] - }, + }, loading: { + type: Boolean, + default: false + } }) const tableConfig = reactive({ columns: [ @@ -136,10 +137,6 @@ const tableConfig = reactive({ } ] }) - -const getInfo = () => { - emit('getInfo') -} const handleDownload = (row) => { downloadFile(row.fileId).then(res => { const blob = new Blob([res]) @@ -152,28 +149,26 @@ const handleDownload = (row) => { const getDataSourceOptionItem = (val) => { if (val instanceof Array) { val.forEach(item => { - matterTree(companyNameArray.value,props.companyOption, item) + matterTree(companyNameArray.value, props.companyOption, item) }) } - return companyNameArray.value.join(','); + let uniqueArr = Array.from(new Set(companyNameArray.value)); + return uniqueArr.join(','); } -watch(() => props.companyOption, (newVal) => { - props.companyOption=newVal + +watch(() => props.loading, (newVal) => { + props.loading = newVal }, {deep: true}) -watch(() => props.formData, (newVal) => { - if (newVal) { - newVal.companyIds = getDataSourceOptionItem(newVal.companyIds) - props.formData=newVal - } + +watch(() => props.companyOption, (newVal) => { + props.companyOption = newVal +}, {deep: true}) +watch(() => props.formData.companyIds, (newVal) => { + props.formData.companyIds = getDataSourceOptionItem(newVal) }, {deep: true}) watch(() => props.processViewer, (newVal) => { props.processViewer = newVal }, {deep: true}) -onMounted(() => { - loading.value = true - getInfo() - loading.value = false -}) diff --git a/src/views/project-demand/summary/add.vue b/src/views/project-demand/summary/add.vue index 1607123..f8f0ebf 100644 --- a/src/views/project-demand/summary/add.vue +++ b/src/views/project-demand/summary/add.vue @@ -1,5 +1,5 @@