|
@@ -475,6 +475,11 @@ export const exportWordHandler = async (type: EXPORT_WORD_ENUM, data: Record<any
|
|
|
page: numberToChinese(page),
|
|
|
borrowDate: dayjs(temp.createTime).format('YYYY年MM月DD日')
|
|
|
}
|
|
|
+ temp.goods.forEach((i: any) => {
|
|
|
+ if (i.numName !== '藏品总登记号') {
|
|
|
+ i.num = ''
|
|
|
+ }
|
|
|
+ })
|
|
|
break
|
|
|
case EXPORT_WORD_ENUM.HALL_PUT_BACK:
|
|
|
temp = {
|
|
@@ -486,12 +491,16 @@ export const exportWordHandler = async (type: EXPORT_WORD_ENUM, data: Record<any
|
|
|
}
|
|
|
break
|
|
|
case EXPORT_WORD_ENUM.SUB_PUT_BACK:
|
|
|
- console.log(temp)
|
|
|
temp = {
|
|
|
...temp,
|
|
|
num: dayjs(temp.date).format('YYYY') + temp.num,
|
|
|
date: dayjs(temp.date).format('YYYY年MM月DD日')
|
|
|
}
|
|
|
+ temp.goods.forEach((i: any) => {
|
|
|
+ if (i.numName !== '藏品总登记号') {
|
|
|
+ i.num = ''
|
|
|
+ }
|
|
|
+ })
|
|
|
break
|
|
|
case EXPORT_WORD_ENUM.COLLECTION_INVENTORY:
|
|
|
temp = {
|
|
@@ -518,6 +527,9 @@ export const exportWordHandler = async (type: EXPORT_WORD_ENUM, data: Record<any
|
|
|
group: numberToChinese(temp.goods.length),
|
|
|
page: numberToChinese(page)
|
|
|
}
|
|
|
+ temp.goods.forEach((i: any) => {
|
|
|
+ i.pcsActual = i.pcsActual || i.pcs.match(/\d+\.?\d*/)?.[0]
|
|
|
+ })
|
|
|
break
|
|
|
case EXPORT_WORD_ENUM.FORM_FOR_DIGITAL:
|
|
|
const __date = dayjs(temp.createTime)
|
|
@@ -562,8 +574,12 @@ export const exportWordHandler = async (type: EXPORT_WORD_ENUM, data: Record<any
|
|
|
case EXPORT_WORD_ENUM.COLLECTION_CARD:
|
|
|
const rtf2 = temp.rtf ? JSON.parse(temp.rtf).txtArr[0].txt : ''
|
|
|
const stack2 = []
|
|
|
- for (const url of getImageUrlsFromHtml(rtf2)) {
|
|
|
- stack2.push(await getBase64Sync(url))
|
|
|
+ try {
|
|
|
+ for (const url of getImageUrlsFromHtml(rtf2)) {
|
|
|
+ stack2.push(await getBase64Sync(url))
|
|
|
+ }
|
|
|
+ } catch (err) {
|
|
|
+ console.log(`rtf img transfer base64 error: `, err)
|
|
|
}
|
|
|
temp = {
|
|
|
...temp,
|
|
@@ -595,10 +611,20 @@ export const exportWordHandler = async (type: EXPORT_WORD_ENUM, data: Record<any
|
|
|
imgs: stack2
|
|
|
}
|
|
|
|
|
|
- if (type === EXPORT_WORD_ENUM.COLLECTION_ARCHIVES) {
|
|
|
- temp.imagePages = await arrangeImages(temp.imagePages)
|
|
|
- } else if (temp.thumb) {
|
|
|
- temp.thumb = await getBase64Sync(temp.thumb)
|
|
|
+ if (temp.numName !== '藏品总登记号') {
|
|
|
+ temp.num2 = temp.num
|
|
|
+ temp.num = ''
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ if (type === EXPORT_WORD_ENUM.COLLECTION_ARCHIVES) {
|
|
|
+ temp.imagePages = await arrangeImages(temp.imagePages)
|
|
|
+ } else if (temp.thumb) {
|
|
|
+ temp.thumb = await getBase64Sync(temp.thumb)
|
|
|
+ }
|
|
|
+ } catch (err) {
|
|
|
+ console.log(err)
|
|
|
+ temp.imagePages = []
|
|
|
}
|
|
|
break
|
|
|
case EXPORT_WORD_ENUM.OUTSIDER_FORM:
|