|
@@ -1,53 +1,47 @@
|
|
|
<template>
|
|
|
<div class="hc-task-html-form-body">
|
|
|
- <hc-table-form ref="htmlRef" :form="htmlForm" :html="tableHtml" :loading="htmlLoading" @render="htmlRender" />
|
|
|
+ <hc-table-form v-if="detailInfo.opinionType === 1 && tableHtml" ref="htmlRef" :form="htmlForm" :html="tableHtml" :loading="htmlLoading" @render="htmlRender" />
|
|
|
+ <hc-pdf v-else-if="detailInfo.opinionType === 2 && HtmlPdfUrl" :src="HtmlPdfUrl" />
|
|
|
+ <hc-empty v-else-if="detailInfo.opinionType === 3" :src="nullPng" title="当前暂无审计咨询意见" />
|
|
|
+ <hc-empty v-else :src="noDataPng" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import { onMounted, ref, watch } from 'vue'
|
|
|
-import tableHtml from '../html-form/html'
|
|
|
+import { getObjValue } from 'js-fast-way'
|
|
|
+import nullPng from '~src/assets/view/null.svg'
|
|
|
+import noDataPng from '~src/assets/view/no-data.svg'
|
|
|
|
|
|
const props = defineProps({
|
|
|
- isEdit: {
|
|
|
- type: Boolean,
|
|
|
- default: true,
|
|
|
- },
|
|
|
- info: {
|
|
|
- type: Object,
|
|
|
- default: () => ({}),
|
|
|
- },
|
|
|
- table: {
|
|
|
- type: Object,
|
|
|
- default: () => ({}),
|
|
|
- },
|
|
|
detail: {
|
|
|
type: Object,
|
|
|
default: () => ({}),
|
|
|
},
|
|
|
})
|
|
|
|
|
|
-//监听可否编辑
|
|
|
-const isEdits = ref(props.isEdit)
|
|
|
-watch(() => props.isEdit, (val) => {
|
|
|
- isEdits.value = val
|
|
|
-}, { immediate: true, deep: true })
|
|
|
-
|
|
|
//监听数据
|
|
|
-watch(() => [props.table, props.info, props.detail], ([table, row, detail]) => {
|
|
|
- setTaskInfo(table, row, detail)
|
|
|
+const detailInfo = ref(props.detail)
|
|
|
+watch(() => props.detail, (detail) => {
|
|
|
+ setTaskInfo(detail)
|
|
|
}, { deep: true })
|
|
|
|
|
|
//渲染完成
|
|
|
+const opinionType = ref(0)
|
|
|
onMounted(() => {
|
|
|
- setTaskInfo(props.table, props.info, props.detail)
|
|
|
+ setTaskInfo(props.detail)
|
|
|
})
|
|
|
|
|
|
//设置任务信息
|
|
|
-const detailInfo = ref(props.detail)
|
|
|
-const setTaskInfo = (table, row, info) => {
|
|
|
- console.log(info)
|
|
|
+const tableHtml = ref('')
|
|
|
+const HtmlPdfUrl = ref('')
|
|
|
+const setTaskInfo = (info) => {
|
|
|
+ htmlLoading.value = true
|
|
|
detailInfo.value = info
|
|
|
+ opinionType.value = info.opinionType
|
|
|
+ tableHtml.value = info.tableHtml
|
|
|
+ htmlForm.value = getObjValue(info.tableData)
|
|
|
+ HtmlPdfUrl.value = info.pdfUrl
|
|
|
}
|
|
|
|
|
|
//填写的表单
|
|
@@ -56,12 +50,17 @@ const htmlForm = ref({})
|
|
|
const htmlLoading = ref(false)
|
|
|
const htmlRender = (form) => {
|
|
|
htmlForm.value = form
|
|
|
+ htmlLoading.value = false
|
|
|
}
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="scss" scoped>
|
|
|
-.hc-task-html-form-body {
|
|
|
|
|
|
+//获取表单数据
|
|
|
+const getTableForm = () => {
|
|
|
+ const res = htmlRef.value?.getFormData()
|
|
|
+ return getObjValue(res)
|
|
|
}
|
|
|
-</style>
|
|
|
+
|
|
|
+defineExpose({
|
|
|
+ getTableForm,
|
|
|
+})
|
|
|
+</script>
|
|
|
|