微调
This commit is contained in:
@@ -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 = '/api-docx/excelreport' + currentRoute.value?.href?.split('?')[1]
|
||||
console.log("🚀 ~ url:", url)
|
||||
const excelOptions = ref({
|
||||
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{
|
||||
//下载
|
||||
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
console.log()
|
||||
})
|
||||
|
||||
@@ -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
|
||||
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
|
||||
// })
|
||||
|
||||
@@ -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(() => {
|
||||
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
|
||||
// })
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user