|
@@ -1,11 +1,9 @@
|
|
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
import styles from './index.module.scss'
|
|
import styles from './index.module.scss'
|
|
import { Button, Cascader, Input, Select } from 'antd'
|
|
import { Button, Cascader, Input, Select } from 'antd'
|
|
-import dayjs from 'dayjs'
|
|
|
|
import { MessageFu } from '@/utils/message'
|
|
import { MessageFu } from '@/utils/message'
|
|
import { resJiLianFu } from '@/utils/history'
|
|
import { resJiLianFu } from '@/utils/history'
|
|
import { statusCollectObj, statusStorageObj } from '@/utils/tableData'
|
|
import { statusCollectObj, statusStorageObj } from '@/utils/tableData'
|
|
-import ExportJsonExcel from 'js-export-excel'
|
|
|
|
import { useDispatch } from 'react-redux'
|
|
import { useDispatch } from 'react-redux'
|
|
import { C1baseFormData, C1baseFormData2, C1InputKeyArr1, C1InputKeyArr2 } from '../C1ledger/data'
|
|
import { C1baseFormData, C1baseFormData2, C1InputKeyArr1, C1InputKeyArr2 } from '../C1ledger/data'
|
|
import { A32_APIgetList } from '@/store/action/A32Routing'
|
|
import { A32_APIgetList } from '@/store/action/A32Routing'
|
|
@@ -71,7 +69,7 @@ function A32Routing() {
|
|
arr = arr.map(v => ({
|
|
arr = arr.map(v => ({
|
|
...v,
|
|
...v,
|
|
show: true,
|
|
show: true,
|
|
- son: v.son.filter(c => c.name.includes(value2) && filterId.includes(c.id))
|
|
|
|
|
|
+ son: (v.son || []).filter(c => c.name.includes(value2) && filterId.includes(c.id))
|
|
}))
|
|
}))
|
|
|
|
|
|
const arrPu: { id: string; name: string; key: string }[] = []
|
|
const arrPu: { id: string; name: string; key: string }[] = []
|
|
@@ -236,8 +234,6 @@ function A32Routing() {
|
|
|
|
|
|
// 点击导出
|
|
// 点击导出
|
|
const deriveFu = useCallback(async () => {
|
|
const deriveFu = useCallback(async () => {
|
|
- const name = '藏品分账' + dayjs(new Date()).format('YYYY-MM-DD HH:mm')
|
|
|
|
-
|
|
|
|
const obj = {
|
|
const obj = {
|
|
...formDataOldRef.current,
|
|
...formDataOldRef.current,
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
@@ -250,64 +246,42 @@ function A32Routing() {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
if (res.data.records.length <= 0) return MessageFu.warning('当前搜索条件没有数据!')
|
|
if (res.data.records.length <= 0) return MessageFu.warning('当前搜索条件没有数据!')
|
|
|
|
|
|
- const option = {
|
|
|
|
- fileName: name,
|
|
|
|
- datas: [
|
|
|
|
- {
|
|
|
|
- sheetData: res.data.records.map((v: FourTableType) => ({
|
|
|
|
- ...v,
|
|
|
|
- thumbPc: v.thumbPc ? window.location.origin + v.thumbPc : '(空)',
|
|
|
|
- dictType: resJiLianFu(v.dictType),
|
|
|
|
- dictAge: v.dictAge === '其他' ? '其他' : resJiLianFu(v.dictAge),
|
|
|
|
- dictTexture3: resJiLianFu(v.dictTexture3),
|
|
|
|
- dictTorn: resJiLianFu(v.dictTorn),
|
|
|
|
- source: resJiLianFu(v.source),
|
|
|
|
- statusCollect: Reflect.get(statusCollectObj, v.statusCollect) || '(空)',
|
|
|
|
- statusStorage: Reflect.get(statusStorageObj, v.statusStorage) || '(空)',
|
|
|
|
- accountIndoor:
|
|
|
|
- (selectObj['展览状态'].find(c => c.value === v.accountIndoor) || {}).label ||
|
|
|
|
- '(空)'
|
|
|
|
- })),
|
|
|
|
- sheetName: name,
|
|
|
|
- sheetFilter: [
|
|
|
|
- 'num',
|
|
|
|
- 'thumbPc',
|
|
|
|
- 'numName',
|
|
|
|
- 'name',
|
|
|
|
- 'dictLevel',
|
|
|
|
- 'dictType',
|
|
|
|
- 'dictAge',
|
|
|
|
- 'dictTexture3',
|
|
|
|
- 'dictTorn',
|
|
|
|
- 'source',
|
|
|
|
- 'statusCollect',
|
|
|
|
- 'statusStorage',
|
|
|
|
- 'accountIndoor',
|
|
|
|
- 'createTime'
|
|
|
|
- ],
|
|
|
|
- sheetHeader: [
|
|
|
|
- '藏品编号',
|
|
|
|
- '封面图地址',
|
|
|
|
- '编号类型',
|
|
|
|
- '藏品名称',
|
|
|
|
- '文物级别',
|
|
|
|
- '文物类别',
|
|
|
|
- '年代',
|
|
|
|
- '质地',
|
|
|
|
- '完残程度',
|
|
|
|
- '来源',
|
|
|
|
- '入藏状态',
|
|
|
|
- '库存状态',
|
|
|
|
- '展览状态',
|
|
|
|
- '创建日期'
|
|
|
|
- ],
|
|
|
|
- columnWidths: [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- const toExcel = new ExportJsonExcel(option) //new
|
|
|
|
- toExcel.saveExcel() //保存
|
|
|
|
|
|
+ store.dispatch({
|
|
|
|
+ type: 'layout/exInfo',
|
|
|
|
+ payload: {
|
|
|
|
+ name: '藏品分账',
|
|
|
|
+ show: true,
|
|
|
|
+ arr: [
|
|
|
|
+ { key: 'num', txt: '藏品编号' },
|
|
|
|
+ { key: 'thumbPc', txt: '封面图地址' },
|
|
|
|
+ { key: 'numName', txt: '编号类型' },
|
|
|
|
+ { key: 'name', txt: '藏品名称' },
|
|
|
|
+ { key: 'dictLevel', txt: '文物级别' },
|
|
|
|
+ { key: 'dictType', txt: '文物类别' },
|
|
|
|
+ { key: 'dictAge', txt: '年代' },
|
|
|
|
+ { key: 'dictTexture3', txt: '质地' },
|
|
|
|
+ { key: 'dictTorn', txt: '完残程度' },
|
|
|
|
+ { key: 'source', txt: '来源' },
|
|
|
|
+ { key: 'statusCollect', txt: '入藏状态' },
|
|
|
|
+ { key: 'statusStorage', txt: '库存状态' },
|
|
|
|
+ { key: 'accountIndoor', txt: '展览状态' },
|
|
|
|
+ { key: 'createTime', txt: '创建日期' }
|
|
|
|
+ ],
|
|
|
|
+ data: res.data.records.map((v: FourTableType) => ({
|
|
|
|
+ ...v,
|
|
|
|
+ thumbPc: v.thumbPc ? window.location.origin + v.thumbPc : '(空)',
|
|
|
|
+ dictType: resJiLianFu(v.dictType),
|
|
|
|
+ dictAge: v.dictAge === '其他' ? '其他' : resJiLianFu(v.dictAge),
|
|
|
|
+ dictTexture3: resJiLianFu(v.dictTexture3),
|
|
|
|
+ dictTorn: resJiLianFu(v.dictTorn),
|
|
|
|
+ source: resJiLianFu(v.source),
|
|
|
|
+ statusCollect: Reflect.get(statusCollectObj, v.statusCollect) || '(空)',
|
|
|
|
+ statusStorage: Reflect.get(statusStorageObj, v.statusStorage) || '(空)',
|
|
|
|
+ accountIndoor:
|
|
|
|
+ (selectObj['展览状态'].find(c => c.value === v.accountIndoor) || {}).label || '(空)'
|
|
|
|
+ }))
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}, [treeAc])
|
|
}, [treeAc])
|
|
|
|
|