shaogen1995 2 дней назад
Родитель
Сommit
638ccbcbe1

+ 2 - 2
src/pages/Cledger/C1ledger/index.tsx

@@ -129,7 +129,7 @@ function C1ledger() {
       {
         type: 'CascaderSS',
         key: 'subTagIds',
-        placeholder: '藏品标签',
+        placeholder: '藏品类别',
         options: store.getState().E1tag.treeData
       },
       {
@@ -270,7 +270,7 @@ function C1ledger() {
       return {
         藏品登记号: item.num,
         封面: item.thumb,
-        藏品标签: resTagFu(item.tagDictId || '', '藏品'),
+        藏品类别: resTagFu(item.tagDictId || '', '藏品'),
         文化标签: resTagFu(item.artDictId || '', '文创'),
         藏品名称: item.name,
         级别: item.level,

+ 3 - 3
src/pages/Cledger/C2routing/index.tsx

@@ -129,7 +129,7 @@ const C2siderLeftTree = ({ setExtraParams }: { setExtraParams: (params: any) =>
     [value]
   )
 
-  // 按节点名称筛选:藏品标签(树)、藏品年代、文化标签(树)、藏品级别(平铺)
+  // 按节点名称筛选:藏品类别(树)、藏品年代、文化标签(树)、藏品级别(平铺)
   const categoryFiltered = useMemo(() => {
     return value2 ? filterTreeByName(dictAll, value2) : dictAll
   }, [dictAll, value2])
@@ -150,11 +150,11 @@ const C2siderLeftTree = ({ setExtraParams }: { setExtraParams: (params: any) =>
     return list.filter((item: { label: string }) => item.label.toUpperCase().includes(key))
   }, [value2])
 
-  // 四个数据源合并为一棵树:藏品标签(树)、藏品年代、文化标签(树)、藏品级别(平铺)(key 带前缀便于拆分为分类参数)
+  // 四个数据源合并为一棵树:藏品类别(树)、藏品年代、文化标签(树)、藏品级别(平铺)(key 带前缀便于拆分为分类参数)
   const treeData = useMemo(() => {
     const rootCategory: TreeDataNode = {
       key: 'root-类别',
-      title: '藏品标签',
+      title: '藏品类别',
       children: loopToTreeNodes(categoryFiltered, 'type')
     }
     const rootAge: TreeDataNode = {

+ 1 - 1
src/pages/Cledger/C3goodsInfo/index.tsx

@@ -19,7 +19,7 @@ const C1topSearch = [
   {
     type: 'CascaderSS',
     key: 'subTagIds',
-    placeholder: '藏品标签',
+    placeholder: '藏品类别',
     options: store.getState().E1tag.treeData
   },
   {

+ 48 - 12
src/pages/Cledger/C4file/index.tsx

@@ -4,7 +4,11 @@ import { useSelector } from 'react-redux'
 import store, { RootState } from '@/store'
 import { openLink } from '@/utils/history'
 import TableList from '@/pages/Zother/TableList'
-import { API_getFileList, API_downloadFiles } from '@/store/action/Cledger/C4file'
+import {
+  API_getFileList,
+  API_downloadFiles,
+  API_getFileInfoByid
+} from '@/store/action/Cledger/C4file'
 import { goodsFileTableC } from '@/utils/tableData'
 import { Button, message } from 'antd'
 import { baseURL } from '@/utils/http'
@@ -12,7 +16,8 @@ import { FileListType } from '@/components/Z3upFiles/data'
 import ImageLazy from '@/components/ImageLazy'
 import { EyeOutlined } from '@ant-design/icons'
 import DownLog from '@/pages/Zother/DownLog'
-import { fileImgArr } from '@/utils'
+import { downloadFileByUrl, fileImgArr } from '@/utils'
+import dayjs from 'dayjs'
 
 const C4search = [
   {
@@ -83,16 +88,42 @@ function C4file() {
   )
 
   // 下载方法
-  const downloadFn = async (ids: number | number[]) => {
-    const idArr = Array.isArray(ids) ? ids : [ids]
-    if (!idArr.length) return
+  const downloadFn = async (ids: number[]) => {
+    if (ids.length === 1) {
+      const res1 = await API_getFileInfoByid(ids[0])
+      if (res1.code === 0) {
+        const obj = res1.data[0]
+        const res = await API_downloadFiles([obj.id])
+        if (res.code === 0) {
+          downloadFileByUrl(
+            obj.filePath,
+            obj.joinNum + obj.joinName + dayjs().format('YYYY-MM-DD HH:mm:ss'),
 
-    const res: any = await API_downloadFiles(idArr)
-    if (res && res.code === 0 && res.data) {
-      const path = res.data as string
-      const fullUrl = path.startsWith('http') ? path : `${baseURL}${path}`
-      window.open(fullUrl)
+            () => {
+              setSelectedRowKeys([])
+            }
+          )
+        }
+      }
+    } else {
+      const res: any = await API_downloadFiles(selectedRowKeys as number[])
+      if (res && res.code === 0 && res.data) {
+        const path = res.data as string
+        const fullUrl = path.startsWith('http') ? path : `${baseURL}${path}`
+        window.open(fullUrl)
+        setSelectedRowKeys([])
+      }
     }
+
+    // const idArr = Array.isArray(ids) ? ids : [ids]
+    // if (!idArr.length) return
+
+    // const res: any = await API_downloadFiles(idArr)
+    // if (res && res.code === 0 && res.data) {
+    //   const path = res.data as string
+    //   const fullUrl = path.startsWith('http') ? path : `${baseURL}${path}`
+    //   window.open(fullUrl)
+    // }
   }
 
   // 故事管理/藏品总账定制右侧内容
@@ -190,13 +221,18 @@ function C4file() {
             <Button
               size='small'
               type='text'
-              onClick={() => {
+              onClick={async () => {
                 const id = Number(item.id)
                 if (Number.isNaN(id)) {
                   message.error('当前附件ID异常,无法下载')
                   return
                 }
-                downloadFn(id)
+                const res = await API_downloadFiles([item.id])
+                if (res.code === 0)
+                  downloadFileByUrl(
+                    item.filePath,
+                    item.joinNum + item.joinName + dayjs().format('YYYY-MM-DD HH:mm:ss')
+                  )
               }}
             >
               下载

+ 1 - 1
src/pages/Dmanage/D2edit/D2info/index.tsx

@@ -35,7 +35,7 @@ function D2info() {
         { key: 'name', name: '藏品名称' },
         {
           key: 'tagDictId',
-          name: '藏品标签',
+          name: '藏品类别',
           resFu: (info: GoodsType) => {
             let resTxt = info.tagDictId
             if (resTxt) return resTagFu(resTxt, '藏品') || '(空)'

+ 4 - 4
src/pages/Eculture/E1tag/E1add.tsx

@@ -148,7 +148,7 @@ function E1add({ addInfo, addFu, closeFu }: Props) {
           autoComplete='off'
         >
           <div className='fromRow'>
-            <div className='fromRowll'>上级标签:</div>
+            <div className='fromRowll'>上级类别:</div>
             <div className='fromRowrr'>
               <Cascader
                 style={{ width: 658 }}
@@ -164,15 +164,15 @@ function E1add({ addInfo, addFu, closeFu }: Props) {
           </div>
 
           <Form.Item
-            label='标签名称'
+            label='类别名称'
             name='name'
-            rules={[{ required: true, message: '请输入标签名称!' }]}
+            rules={[{ required: true, message: '请输入类别名称!' }]}
             getValueFromEvent={e => e.target.value.replace(/\s+/g, '')}
           >
             <Input maxLength={20} showCount placeholder='请输入内容' />
           </Form.Item>
 
-          <Form.Item label='标签说明' name='intro'>
+          <Form.Item label='类别说明' name='intro'>
             <TextArea maxLength={500} showCount placeholder='请输入内容' />
           </Form.Item>
 

+ 4 - 4
src/pages/Eculture/E1tag/index.tsx

@@ -150,14 +150,14 @@ function E1tag() {
 
   return (
     <div className={styles.E1tag}>
-      <div className='pageTitle'>藏品标签</div>
+      <div className='pageTitle'>藏品类别</div>
 
       {/* 左侧 */}
       <div className='E1son E1ll'>
         <div className='E1ll1'>
           <Input
             style={{ width: 300 }}
-            placeholder='请输入标签名称'
+            placeholder='请输入类别名称'
             maxLength={30}
             showCount
             value={value}
@@ -213,7 +213,7 @@ function E1tag() {
               </div>
 
               <div className='E1mr2Row'>
-                <div className='E1mr2Row1'>标签名称:</div>
+                <div className='E1mr2Row1'>类别名称:</div>
                 <div className='E1mr2Row2'>{rightData.name}</div>
               </div>
 
@@ -232,7 +232,7 @@ function E1tag() {
               </div>
 
               <div className='E1mr2Row'>
-                <div className='E1mr2Row1'>标签说明:</div>
+                <div className='E1mr2Row1'>类别说明:</div>
                 <div className='E1mr2Row2'>{rightData.intro || '(空)'}</div>
               </div>
             </div>

+ 2 - 2
src/pages/Eculture/E2story/index.tsx

@@ -22,7 +22,7 @@ const E2topSearch = [
   {
     type: 'CascaderSS',
     key: 'subTagIds',
-    placeholder: '藏品标签',
+    placeholder: '藏品类别',
     options: store.getState().E1tag.treeData
   },
   {
@@ -61,7 +61,7 @@ function D1register() {
       return {
         故事标题: item.name,
         关联藏品: item.goodName,
-        藏品标签: item.tagName,
+        藏品类别: item.tagName,
         录入人: item.creatorName,
         录入日期: item.createTime
       }

+ 1 - 1
src/pages/Fstorehouse/F1inStorage/F1edit/index.tsx

@@ -186,7 +186,7 @@ function F1editContent() {
           goodsSonTable={[
             ['txt', '藏品登记号', 'num'],
             ['img', '封面', 'thumb'],
-            ['txtCTag', '藏品标签', 'tagDictId'],
+            ['txtCTag', '藏品类别', 'tagDictId'],
             ['txt', '藏品名称', 'name'],
             ['select', '级别', 'level', selectObj['藏品级别']],
             ['txtCTag', '文化标签', 'artDictId', '文创'],

+ 1 - 1
src/pages/Fstorehouse/F2moveStorage/F2edit/index.tsx

@@ -190,7 +190,7 @@ function F2editContent() {
           goodsSonTable={[
             ['txt', '藏品登记号', 'num'],
             ['img', '封面', 'thumb'],
-            ['txtCTag', '藏品标签', 'tagDictId'],
+            ['txtCTag', '藏品类别', 'tagDictId'],
             ['txt', '藏品名称', 'name'],
             ['select', '级别', 'level', selectObj['藏品级别']],
             ['txtCTag', '文化标签', 'artDictId', '文创'],

+ 1 - 1
src/pages/Fstorehouse/F3outStorage/F3edit/index.tsx

@@ -128,7 +128,7 @@ function F3editContent() {
           goodsSonTable={[
             ['txt', '藏品登记号', 'num'],
             ['img', '封面', 'thumb'],
-            ['txtCTag', '藏品标签', 'tagDictId'],
+            ['txtCTag', '藏品类别', 'tagDictId'],
             ['txt', '藏品名称', 'name'],
             ['select', '级别', 'level', selectObj['藏品级别']],
             ['txtCTag', '文化标签', 'artDictId', '文创'],

+ 1 - 1
src/pages/Fstorehouse/F4check/F4edit/index.tsx

@@ -190,7 +190,7 @@ function F1editContent() {
             ['connectTxt', '库房位置', 'storageName', 'siteLoc'],
             ['txt', '藏品登记号', 'num'],
             ['img', '封面', 'thumb'],
-            ['txtCTag', '藏品标签', 'tagDictId'],
+            ['txtCTag', '藏品类别', 'tagDictId'],
             ['txt', '藏品名称', 'name'],
             ['select', '级别', 'level', selectObj['藏品级别']],
             ['txtCTag', '文化标签', 'artDictId', '文创'],

+ 1 - 1
src/pages/Hexhibits/H1loan/H1detail/index.tsx

@@ -387,7 +387,7 @@ function H1detail() {
           <Cascader
             changeOnSelect
             options={store.getState().E1tag.treeData}
-            placeholder='藏品标签'
+            placeholder='藏品类别'
             fieldNames={{ label: 'name', value: 'id', children: 'children' }}
             allowClear={true}
             showSearch={true}

+ 1 - 1
src/pages/Layout/data.ts

@@ -166,7 +166,7 @@ const tabLeftArr: RouterType = [
       },
       {
         id: 601,
-        name: '藏品标签',
+        name: '藏品类别',
         path: '/tag',
         Com: React.lazy(() => import('../Eculture/E1tag'))
       }

+ 15 - 6
src/pages/ZgoodsInfo/GItab3/index.tsx

@@ -15,6 +15,7 @@ import { baseURL } from '@/utils/http'
 import { GI3tableC } from '@/utils/tableData'
 import DownLog from '@/pages/Zother/DownLog'
 import SetFileType from '@/pages/Zother/SetFileType'
+import dayjs from 'dayjs'
 
 type Props = {
   info: GoodsType
@@ -71,9 +72,13 @@ function GItab3({ info, fileList }: Props) {
       if (obj) {
         const res = await API_downloadFiles([obj.id])
         if (res.code === 0) {
-          downloadFileByUrl(obj.filePath, obj.fileName, () => {
-            setCheckArr([])
-          })
+          downloadFileByUrl(
+            obj.filePath,
+            info.num + info.name + dayjs().format('YYYY-MM-DD HH:mm:ss'),
+            () => {
+              setCheckArr([])
+            }
+          )
         }
       } else {
         MessageFu.warning('找不到文件或已被删除')
@@ -88,7 +93,7 @@ function GItab3({ info, fileList }: Props) {
         setCheckArr([])
       }
     }
-  }, [checkArr, getFileListFu, list])
+  }, [checkArr, getFileListFu, info.name, info.num, list])
 
   const staBtn = useMemo(() => {
     let arr: any[] = []
@@ -176,7 +181,11 @@ function GItab3({ info, fileList }: Props) {
               type='text'
               onClick={async () => {
                 const res = await API_downloadFiles([item.id])
-                if (res.code === 0) downloadFileByUrl(item.filePath, item.fileName)
+                if (res.code === 0)
+                  downloadFileByUrl(
+                    item.filePath,
+                    info.num + info.name + dayjs().format('YYYY-MM-DD HH:mm:ss')
+                  )
               }}
             >
               下载
@@ -191,7 +200,7 @@ function GItab3({ info, fileList }: Props) {
         )
       }
     ]
-  }, [])
+  }, [info.name, info.num])
 
   // 下载记录参数
   const [downLogId, setDownLogId] = useState(0)

+ 2 - 2
src/pages/ZgoodsInfo/data.ts

@@ -4,7 +4,7 @@ import { myTableTransferSize, resJiLianFu, zhiDiResFu } from '@/utils/dataChange
 
 const isNull = '(空)'
 
-// 多个标签发请求改变数据结果 //藏品标签   文化标签
+// 多个标签发请求改变数据结果 //藏品类别   文化标签
 export const tagApiArr = ['subTagIds', 'subArtDictIds']
 
 export const GIrowArr = [
@@ -65,7 +65,7 @@ export const GIrowArr = [
     name: '质量等级',
     resFu: (info: GoodsType) => resJiLianFu(info.qualityLevelDictId)
   },
-  { key: 'pressAuthor', name: '著者' },
+  { key: 'pressAuthor', name: '作者/品牌' },
   { key: 'pressFile', name: '存卷' },
   { key: 'pressVersion', name: '版本' },
   { key: 'intro', name: '藏品简介', full: true },

+ 1 - 1
src/pages/Zother/AddClues/index.tsx

@@ -170,7 +170,7 @@ function AddClues({ closeFu, succFu, moduleId, info, fileUpInfo, isLook }: Props
                 options={selectObj['完残程度']}
               />
             </Form.Item>
-            <Form.Item label='初步藏品标签' name='tagDictId'>
+            <Form.Item label='初步藏品类别' name='tagDictId'>
               <Cascader
                 disabled={isLook}
                 changeOnSelect

+ 2 - 2
src/pages/Zother/AddGoods/index.tsx

@@ -341,7 +341,7 @@ function AddGoods({
               <Select allowClear={true} placeholder='请选择' options={selectObj['藏品级别']} />
             </Form.Item>
 
-            <Form.Item label='藏品标签' name='tagDictId'>
+            <Form.Item label='藏品类别' name='tagDictId'>
               <Cascader
                 changeOnSelect
                 options={E1tree}
@@ -509,7 +509,7 @@ function AddGoods({
               />
             </Form.Item>
 
-            <Form.Item label='著者' name='pressAuthor'>
+            <Form.Item label='作者/品牌' name='pressAuthor'>
               <Input placeholder='请输入' showCount maxLength={50} />
             </Form.Item>
             <Form.Item label='版本' name='pressVersion'>

+ 6 - 1
src/pages/Zother/FileArchive/index.tsx

@@ -100,7 +100,12 @@ function FileArchive({ fromData }: Props) {
         render: (item: FileListType) => (
           <>
             <Button size='small' type='text'>
-              <a href={baseURL + item.filePath} download target='_blank' rel='noreferrer'>
+              <a
+                href={baseURL + item.filePath}
+                download={item.fileName}
+                target='_blank'
+                rel='noreferrer'
+              >
                 下载
               </a>
             </Button>

+ 2 - 2
src/pages/Zother/SonGoodsList/data.ts

@@ -95,7 +95,7 @@ export const sgTopSelectDom = [
     type: 'Input'
   },
   {
-    name: '初定藏品标签',
+    name: '初定藏品类别',
     key: 'subTagIds',
     type: 'CascaderSS',
     options: store.getState().E1tag.treeData
@@ -136,7 +136,7 @@ export const sgTopSelectDomGood = [
     width: 240
   },
   {
-    name: '藏品标签',
+    name: '藏品类别',
     key: 'subTagIds',
     type: 'CascaderSS',
     options: store.getState().E1tag.treeData

+ 7 - 0
src/store/action/Cledger/C4file.ts

@@ -26,6 +26,13 @@ export const API_getFileList = (data: any): any => {
 }
 
 /**
+ * 藏品附件 -根据附件id拿详情
+ */
+export const API_getFileInfoByid = (id: number) => {
+  return http.post('cms/good/file/findByFileIds', [id])
+}
+
+/**
  * 藏品附件 -下载记录
  */
 export const API_getFileLog = (fileId: number) => {

+ 1 - 1
src/utils/dataChange.tsx

@@ -202,7 +202,7 @@ export const resJiLianFu = (idTemp: string, type?: 'tag', isNull?: string) => {
   } else return isNull || '(空)'
 }
 
-// 藏品标签回显 、文化标签回显
+// 藏品类别回显 、文化标签回显
 export function resTagFu(idString: string, type: '藏品' | '文创' | '质地3'): any {
   const dataList =
     type === '藏品'

+ 6 - 6
src/utils/tableData.ts

@@ -36,7 +36,7 @@ export const SonClueListTableC = [
   ['txt', '线索编号', 'num'],
   ['text', '线索简介', 'intro', 50],
   ['txt', '联系方式', 'phone'],
-  ['txtCTag', '初步藏品标签', 'tagDictId', '藏品'],
+  ['txtCTag', '初步藏品类别', 'tagDictId', '藏品'],
   ['txtC', '初步藏品年代', 'ageDictId'],
   ['select', '完残程度', 'tornLevel', selectObj['完残程度']],
   ['text', '备注', 'remark', 50]
@@ -47,7 +47,7 @@ export const goodsSonTableC = (loc?: boolean) => {
   const arr: any = [
     ['txt', '藏品登记号', 'num'],
     ['img', '封面', 'thumb'],
-    ['txtCTag', '藏品标签', 'tagDictId', '藏品'],
+    ['txtCTag', '藏品类别', 'tagDictId', '藏品'],
     ['txtCTag', '文化标签', 'artDictId', '文创'],
     ['txt', '藏品名称', 'name'],
     ['select', '级别', 'level', selectObj['藏品级别']],
@@ -65,7 +65,7 @@ export const goodsSelectCuleC = [
   ['txt', '线索编号', 'num'],
   ['img', '封面', 'thumb'],
   ['txt', '线索名称', 'name'],
-  ['txtCTag', '初步藏品标签', 'tagDictId', '藏品'],
+  ['txtCTag', '初步藏品类别', 'tagDictId', '藏品'],
   ['txtC', '初定年代', 'ageDictId'],
   ['select', '完残程度', 'tornLevel', selectObj['完残程度']]
 ]
@@ -117,7 +117,7 @@ export const I8tableC = [
 export const storyTableC = [
   ['txt', '故事标题', 'name'],
   ['txt', '关联藏品', 'goodName'],
-  ['txt', '藏品标签', 'tagName', '藏品'],
+  ['txt', '藏品类别', 'tagName', '藏品'],
   ['txt', '录入人', 'creatorName'],
   ['txt', '录入日期', 'createTime']
 ]
@@ -125,7 +125,7 @@ export const storyTableC = [
 export const storyAndGoodsTableC = [
   ['txt', '藏品登记号', 'num'],
   ['img', '封面', 'thumb'],
-  ['txt', '藏品标签', 'tagName', '藏品'],
+  ['txt', '藏品类别', 'tagName', '藏品'],
   ['txt', '藏品名称', 'name']
 ]
 
@@ -293,7 +293,7 @@ export const staffTableC = [
 export const showGoodTableC = [
   ['txt', '藏品登记号', 'goodNum'],
   ['img', '封面', 'goodThumb'],
-  ['txtCTag', '藏品标签', 'goodTag', '藏品'],
+  ['txtCTag', '藏品类别', 'goodTag', '藏品'],
   ['txt', '藏品名称', 'goodName'],
   ['txt', '展区', 'region'],
   ['txt', '具体位置', 'address'],