diff --git a/src/components/PreviewFile/index.vue b/src/components/PreviewFile/index.vue index cb2b2730..e11fb4c5 100644 --- a/src/components/PreviewFile/index.vue +++ b/src/components/PreviewFile/index.vue @@ -18,14 +18,22 @@ import VueOfficeDocx from '@vue-office/docx' import VueOfficeExcel from '@vue-office/excel' //引入VueOfficePdf组件 import VueOfficePdf from '@vue-office/pdf' +import { downloadFile } from '@/api/system-boot/file' const { push, options, currentRoute } = useRouter() +const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei' // const url = 'http://192.168.1.22:9009/excelreport' + currentRoute.value.href?.split('?')[1] +const url = ref('') +const excelOptions = ref({}) +if(VITE_FLAG){ + url.value = '/api-docx/excelreport' + currentRoute.value?.href?.split('?')[1] + excelOptions.value = ref({ + xls: currentRoute.value.href?.split('?')[1].split('.')[1] == 'xls' ? true : false + }) +}else{ + //下载 + +} -const url = '/api-docx/excelreport' + currentRoute.value?.href?.split('?')[1] -console.log("🚀 ~ url:", url) -const excelOptions = ref({ - xls: currentRoute.value.href?.split('?')[1].split('.')[1] == 'xls' ? true : false -}) onMounted(() => { console.log() }) diff --git a/src/views/pqs/database/case/components/drawer.vue b/src/views/pqs/database/case/components/drawer.vue index 56414ab0..ee7353d7 100644 --- a/src/views/pqs/database/case/components/drawer.vue +++ b/src/views/pqs/database/case/components/drawer.vue @@ -52,12 +52,18 @@ const num = ref(0) const url = ref('') const excelOptions = ref({}) const information = adminInfo.roleCode.includes('information_info') + +const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei' const open = (row: any) => { // console.log('🚀 ~ open ~ row:', row) // url.value = row drawer.value = true - url.value = `/api-docx/excelreport` + row - excelOptions.value = { xls: row.split('.')[1] == 'xls' ? true : false } + if(VITE_FLAG){ + url.value = `/api-docx/excelreport` + row + excelOptions.value = { xls: row.split('.')[1] == 'xls' ? true : false } + }else{ + + } // getFileNameAndFilePath({ filePath: row }).then(res => { // url.value = res.data.url // }) diff --git a/src/views/pqs/database/standard/index.vue b/src/views/pqs/database/standard/index.vue index 8d5068d9..5109cf8e 100644 --- a/src/views/pqs/database/standard/index.vue +++ b/src/views/pqs/database/standard/index.vue @@ -77,6 +77,8 @@ onMounted(() => { } }) + +const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei' const handleNodeClick = (data: any, node: any) => { console.log("🚀 ~ handleNodeClick ~ data:", data) dotList.value = data @@ -86,8 +88,13 @@ const handleNodeClick = (data: any, node: any) => { flag.value = true setTimeout(() => { - url.value = `/api-docx/excelreport` + data.url - excelOptions.value = { xls: data.url.split('.')[1] == 'xls' ? true : false } + if(VITE_FLAG){ + url.value = `/api-docx/excelreport` + data.url + excelOptions.value = { xls: data.url.split('.')[1] == 'xls' ? true : false } + }else{ + + } + // getFileNameAndFilePath({ filePath: data.url }).then(res => { // url.value = res.data.url // }) diff --git a/src/views/system/bpm/processInstance/detail/index.vue b/src/views/system/bpm/processInstance/detail/index.vue index 1ca3cd21..32e57b82 100644 --- a/src/views/system/bpm/processInstance/detail/index.vue +++ b/src/views/system/bpm/processInstance/detail/index.vue @@ -195,15 +195,54 @@ watch( /** 处理审批通过和不通过的操作 */ const handleAudit = async (task, pass) => { + loading.value = true // 1.1 获得对应表单 const index = runningTasks.value.indexOf(task) const auditFormRef = proxy.$refs['form' + index][0] // 1.2 校验表单 const elForm = unref(auditFormRef) - if (!elForm) return - const valid = await elForm.validate() - if (!valid) return + + if (!elForm){ + loading.value = false + return + } + + // const valid = await elForm.validate() + // if (!valid) + // return + try { + const valid = await new Promise((resolve) => { + elForm.validate((isValid) => { + resolve(isValid) + }) + }) + if (!valid){ + loading.value = false + return + } + } catch (error) { + loading.value = false + return + } + + // 1.3 验证 approveForms 中的 radio 字段是否都有值 + const currentApproveForm = approveForms.value[index]; + if (currentApproveForm && currentApproveForm.rule && Array.isArray(currentApproveForm.rule)) { + const emptyRadioFields = currentApproveForm.rule.filter(rule => + rule.type === 'radio' && + (rule.value === undefined || + rule.value === null || + rule.value === '') + + ); + + if (emptyRadioFields.length > 0) { + ElMessage.error('请确认试运行分析报告审核要点都已勾选!'); + loading.value = false; + return; + } + } // 2.1 提交审批 const data = {