review:【bpm 工作流】流程打印
This commit is contained in:
@ -22,7 +22,6 @@ const open = async (id: string) => {
|
|||||||
printData.value = await ProcessInstanceApi.getProcessInstancePrintData(id)
|
printData.value = await ProcessInstanceApi.getProcessInstancePrintData(id)
|
||||||
initPrintDataMap()
|
initPrintDataMap()
|
||||||
parseFormFields()
|
parseFormFields()
|
||||||
console.log(printData.value)
|
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
@ -31,6 +30,7 @@ const open = async (id: string) => {
|
|||||||
defineExpose({ open })
|
defineExpose({ open })
|
||||||
|
|
||||||
const parseFormFields = () => {
|
const parseFormFields = () => {
|
||||||
|
// TODO @lesan:form field 有可能基于 form-create 什么 api 生成么?好像也挺难的 = =
|
||||||
const formFieldsObj = decodeFields(printData.value.formFields)
|
const formFieldsObj = decodeFields(printData.value.formFields)
|
||||||
const processVariables = printData.value.processVariables
|
const processVariables = printData.value.processVariables
|
||||||
let res: any = []
|
let res: any = []
|
||||||
@ -39,10 +39,10 @@ const parseFormFields = () => {
|
|||||||
const name = item['title']
|
const name = item['title']
|
||||||
let html = '暂不支持此类型的表单展示'
|
let html = '暂不支持此类型的表单展示'
|
||||||
// TODO 完善各类型表单的展示
|
// TODO 完善各类型表单的展示
|
||||||
|
// TODO @lesan:要不 UploadImg、UploadFile 特殊处理下,其它就 else processVariables[item['field']]?
|
||||||
if (item['type'] === 'input') {
|
if (item['type'] === 'input') {
|
||||||
html = processVariables[item['field']]
|
html = processVariables[item['field']]
|
||||||
}
|
} else if (item['type'] === 'UploadImg') {
|
||||||
if (item['type'] === 'UploadImg') {
|
|
||||||
html = `<img src="${processVariables[item['field']]}" style="max-width: 600px" />`
|
html = `<img src="${processVariables[item['field']]}" style="max-width: 600px" />`
|
||||||
}
|
}
|
||||||
printDataMap.value[item['field']] = html
|
printDataMap.value[item['field']] = html
|
||||||
@ -96,7 +96,7 @@ const getPrintTemplateHTML = () => {
|
|||||||
headTd.innerHTML = '流程节点'
|
headTd.innerHTML = '流程节点'
|
||||||
headTr.appendChild(headTd)
|
headTr.appendChild(headTd)
|
||||||
processRecordTable.appendChild(headTr)
|
processRecordTable.appendChild(headTr)
|
||||||
printData.value.approveNodes.forEach(item => {
|
printData.value.approveNodes.forEach((item) => {
|
||||||
const tr = document.createElement('tr')
|
const tr = document.createElement('tr')
|
||||||
const td1 = document.createElement('td')
|
const td1 = document.createElement('td')
|
||||||
td1.innerHTML = item.nodeName
|
td1.innerHTML = item.nodeName
|
||||||
@ -107,7 +107,7 @@ const getPrintTemplateHTML = () => {
|
|||||||
processRecordTable.appendChild(tr)
|
processRecordTable.appendChild(tr)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
processRecords.forEach(item => {
|
processRecords.forEach((item) => {
|
||||||
item.innerHTML = processRecordTable.outerHTML
|
item.innerHTML = processRecordTable.outerHTML
|
||||||
})
|
})
|
||||||
// 返回 html
|
// 返回 html
|
||||||
|
|||||||
Reference in New Issue
Block a user