浏览代码

线索管理

shaogen1995 1 周之前
父节点
当前提交
7e8af5403a

+ 9 - 0
后台管理/src/components/MyTable/index.tsx

@@ -82,6 +82,15 @@ function MyTable({
       const obj = {
         index: (_: any, __: any, index: number) => index + 1 + (pageNum - 1) * pageSize,
         txt: (item: any) => item[v[2]] || isNull,
+        // 城市拼接
+        cityAll: (item: any) => {
+          let res = '(空)'
+          if (item[v[2]]) res = item[v[2]]
+          if (item[v[3]]) res += ` / ${item[v[3]]}`
+          if (item[v[4]]) res += ` / ${item[v[4]]}`
+          if (item[v[5]]) res += ` - ${item[v[5]]}`
+          return res
+        },
         img: (item: any) => (
           <div className='tableImgAuto'>
             <ImageLazy

+ 2 - 1
后台管理/src/components/ZupTypes/index.tsx

@@ -525,7 +525,8 @@ function ZupTypes(
               <br />
             </>
           ) : null}
-          第一张为封面图;支持png、jpg的图片格式;最大支持{imgSize}M;最多支持{imgLength}张。
+          {oneIsCover ? '第一张为封面图;' : ''} 支持png、jpg的图片格式;最大支持{imgSize}
+          M;最多支持{imgLength}张。
           {lastImgTxt}
         </div>
       </div>

+ 1 - 1
后台管理/src/pages/A1record/A1look/index.module.scss

@@ -4,7 +4,7 @@
   left: 0;
   width: 100%;
   height: 100%;
-  z-index: 10;
+  z-index: 22;
   background-color: #ecedf1;
   overflow: auto;
   :global {

+ 0 - 8
后台管理/src/pages/A1record/A1tab/A1tab1life/index.module.scss

@@ -46,14 +46,6 @@
           }
         }
       }
-
-      .A1t1Rowll {
-        width: 120px;
-        text-align: center;
-      }
-      .A1t1Rowrr {
-        width: calc(100% - 140px);
-      }
     }
   }
 }

+ 0 - 14
后台管理/src/pages/A1record/A1tab/A1tab1life/index.tsx

@@ -76,20 +76,6 @@ function A1tab1life({ sId }: Props) {
                 <div>简介:</div>
                 <div dangerouslySetInnerHTML={{ __html: textFu(item.rtf) || '(空)' }}></div>
               </div>
-
-              {/* <div className='A1t1Rowll'>
-                {item.date}
-                <p>
-                  <Button size='small' type='text' onClick={() => setAddInfo(item)}>
-                    编辑
-                  </Button>
-                  <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
-                </p>
-              </div>
-              <div
-                className='A1t1Rowrr'
-                dangerouslySetInnerHTML={{ __html: textFu(item.rtf) || '(空)' }}
-              ></div> */}
             </div>
           ))}
         </>

+ 1 - 1
后台管理/src/pages/A1record/A1tab/A2tab2clan/index.tsx

@@ -5,7 +5,7 @@ type Props = {
   sId: number
 }
 
-function A2tab2clan({ sId: number }: Props) {
+function A2tab2clan({ sId }: Props) {
   return (
     <div className={styles.A2tab2clan}>
       <h1>A2tab2clan</h1>

+ 10 - 0
后台管理/src/pages/A1record/A1tab/A3tab3clue/index.module.scss

@@ -1,4 +1,14 @@
 .A3tab3clue {
   :global {
+    .A3t1btn {
+      position: absolute;
+      right: 10px;
+      top: 12px;
+      z-index: 10;
+    }
+
+    .ant-table-cell {
+      padding: 8px !important;
+    }
   }
 }

+ 106 - 3
后台管理/src/pages/A1record/A1tab/A3tab3clue/index.tsx

@@ -1,14 +1,117 @@
-import React from 'react'
+import React, { useCallback, useEffect, useMemo, useState } from 'react'
 import styles from './index.module.scss'
+import { useDispatch, useSelector } from 'react-redux'
+import { A1_APIgetList } from '@/store/action/A1record'
+import { RootState } from '@/store'
+import { A2ListType } from '@/pages/A2clue/data'
+import { A2_APIdel, A2_APIgetList } from '@/store/action/A2clue'
+import MyTable from '@/components/MyTable'
+import { A2tableC } from '@/utils/tableData'
+import { MessageFu } from '@/utils/message'
+import { Button } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import A2add from '@/pages/A2clue/A2add'
 
 type Props = {
   sId: number
 }
 
-function A3tab3clue({ sId: number }: Props) {
+function A3tab3clue({ sId }: Props) {
+  const dispatch = useDispatch()
+  // 获取所有烈士信息
+
+  useEffect(() => {
+    dispatch(
+      A1_APIgetList({
+        pageNum: 1,
+        pageSize: 99999
+      })
+    )
+  }, [dispatch])
+
+  const listAll = useSelector((state: RootState) => state.A1record.tableInfo.list)
+
+  const listAllRes = useMemo(() => {
+    return listAll.map(c => ({
+      value: c.id,
+      label: c.name
+    }))
+  }, [listAll])
+  // 获取所有烈士信息-end
+
+  // 获取列表信息
+  const [list, setList] = useState<A2ListType[]>([])
+
+  const getList = useCallback(async () => {
+    const res = await A2_APIgetList(
+      {
+        pageNum: 1,
+        pageSize: 99999,
+        martyrId: sId
+      },
+      true
+    )
+    if (res.code === 0) {
+      setList(res.data.records || [])
+    }
+  }, [sId])
+
+  useEffect(() => {
+    getList()
+  }, [getList])
+
+  // 点击新增、编辑
+  const [editId, setEditId] = useState(0)
+
+  // 点击删除
+  const delTableFu = useCallback(
+    async (id: number) => {
+      const res = await A2_APIdel(id)
+      if (res.code === 0) {
+        MessageFu.success('删除成功!')
+        getList()
+      }
+    },
+    [getList]
+  )
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: '操作',
+        render: (item: any) => {
+          return (
+            <>
+              <Button size='small' type='text' onClick={() => setEditId(item.id)}>
+                编辑
+              </Button>
+              <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
+            </>
+          )
+        }
+      }
+    ]
+  }, [delTableFu])
+
   return (
     <div className={styles.A3tab3clue}>
-      <h1>A3tab3clue</h1>
+      <div className='A3t1btn'>
+        <Button type='primary' onClick={() => setEditId(-1)}>
+          新增线索
+        </Button>
+      </div>
+      <MyTable list={list} columnsTemp={A2tableC} lastBtn={tableLastBtn} pagingInfo={false} />
+
+      {editId ? (
+        <A2add
+          sId={editId}
+          closeFu={() => setEditId(0)}
+          addTableFu={getList}
+          upTableFu={getList}
+          listAllRes={listAllRes}
+          martyrId={sId}
+        />
+      ) : null}
     </div>
   )
 }

+ 1 - 1
后台管理/src/pages/A1record/A1tab/A4tab4antique/index.tsx

@@ -5,7 +5,7 @@ type Props = {
   sId: number
 }
 
-function A4tab4antique({ sId: number }: Props) {
+function A4tab4antique({ sId }: Props) {
   return (
     <div className={styles.A4tab4antique}>
       <h1>A4tab4antique</h1>

+ 95 - 0
后台管理/src/pages/A2clue/A2add/index.module.scss

@@ -0,0 +1,95 @@
+.A2add {
+  position: absolute;
+  top: 0;
+  left: 0;
+  z-index: 100;
+  width: 100%;
+  height: 100%;
+  border-radius: 10px;
+  background-color: rgba(0, 0, 0, 0.6);
+  padding: 50px 100px;
+  overflow: hidden;
+  :global {
+    .A2addMain {
+      width: 100%;
+      height: 100%;
+      background-color: #fff;
+      border-radius: 10px;
+      position: relative;
+      padding: 15px;
+
+      .A2aTit {
+        font-weight: 700;
+        font-size: 16px;
+        color: var(--themeColor);
+        margin-bottom: 15px;
+      }
+
+      .A2accc {
+        width: calc(100% - 100px);
+        height: calc(100% - 30px);
+        overflow: auto;
+
+        .ant-form-item-label {
+          width: 81px;
+        }
+
+        .A2aRow {
+          display: flex;
+          justify-content: space-between;
+          .ant-form-item {
+            width: 48%;
+          }
+
+          .A2aRowSon {
+            width: 48%;
+            display: flex;
+            .ant-btn {
+              margin-left: 10px;
+            }
+            .ant-form-item {
+              width: calc(100% - 74px);
+            }
+          }
+        }
+        .A2aRowAll {
+          width: 100%;
+          .ant-form-item {
+            width: 100%;
+          }
+        }
+
+        .formRow {
+          display: flex;
+
+          .formLeft {
+            position: relative;
+            top: 3px;
+            width: 81px;
+            text-align: right;
+
+            & > span {
+              color: #ff4d4f;
+            }
+          }
+
+          .formRight {
+            width: calc(100% - 81px);
+            position: relative;
+            top: -15px;
+          }
+        }
+        .formRow2 {
+          margin-bottom: -20px;
+        }
+
+        .A2aBtn {
+          position: absolute;
+          top: 50%;
+          right: 20px;
+          transform: translateY(-50%);
+        }
+      }
+    }
+  }
+}

+ 248 - 0
后台管理/src/pages/A2clue/A2add/index.tsx

@@ -0,0 +1,248 @@
+import React, { useCallback, useEffect, useRef } from 'react'
+import styles from './index.module.scss'
+import { Button, Cascader, Form, FormInstance, Input, Radio, Select } from 'antd'
+import { A2_APIgetInfo, A2_APIsave } from '@/store/action/A2clue'
+import { MessageFu } from '@/utils/message'
+import { A2select1, A2select2 } from '../data'
+import { myCity } from '@/utils/history'
+import ZupTypes from '@/components/ZupTypes'
+import ZupVideos from '@/components/ZupVideos'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import TextArea from 'antd/es/input/TextArea'
+
+type Props = {
+  sId: number
+  closeFu: () => void
+  addTableFu: () => void
+  upTableFu: () => void
+  listAllRes: {
+    value: number
+    label: string
+  }[]
+  // 从烈士档案中进来
+  martyrId?: number
+}
+
+function A2add({ sId, closeFu, addTableFu, upTableFu, listAllRes, martyrId }: Props) {
+  // 表单的ref
+  const FormBoxRef = useRef<FormInstance>(null)
+
+  // 多张图片的ref
+  const ZupImgsRef = useRef<any>(null)
+
+  // 多个视频的ref
+  const ZupVideosRef = useRef<any>(null)
+
+  // 编辑进来获取详情
+  const getInfoFu = useCallback(async (id: number) => {
+    const res = await A2_APIgetInfo(id)
+    if (res.code === 0) {
+      const obj = res.data
+
+      // 线索地址
+      if (obj.province) obj.myCity = [obj.province]
+      if (obj.city) obj.myCity.push(obj.city)
+      if (obj.region) obj.myCity.push(obj.region)
+
+      FormBoxRef.current?.setFieldsValue(obj)
+    }
+
+    const file = res.data.img || []
+    // 传给 附件 组件的
+    const sonInfo = {
+      type: 'img',
+      fileList: file
+    }
+    ZupImgsRef.current?.setFileComFileFu(sonInfo)
+    ZupVideosRef.current?.setFileComFileFu(res.data.video || [])
+  }, [])
+
+  useEffect(() => {
+    if (sId > 0) getInfoFu(sId)
+    if (martyrId) FormBoxRef.current?.setFieldsValue({ martyrId })
+  }, [getInfoFu, martyrId, sId])
+
+  // 没有通过校验
+  const onFinishFailed = useCallback(() => {}, [])
+
+  //  通过校验点击确定
+  const onFinish = useCallback(
+    async (values: any) => {
+      // 多张图片
+      const { sonFileIds, sonIsOk } = ZupImgsRef.current?.fileComFileResFu()
+
+      // 多个视频
+      const list = ZupVideosRef.current?.fileComFileResFu() || []
+
+      // 线索地址
+      let province = ''
+      let city = ''
+      let region = ''
+
+      if (values.myCity && values.myCity.length) {
+        province = values.myCity[0] || ''
+        city = values.myCity[1] || ''
+        region = values.myCity[2] || ''
+      }
+
+      const obj = {
+        ...values,
+        id: sId > 0 ? sId : null,
+        province,
+        city,
+        region,
+        imgIds: sonIsOk ? '' : sonFileIds.join(','),
+        videoIds: list.map((v: any) => v.id).join(',')
+      }
+
+      const res = await A2_APIsave(obj)
+      if (res.code === 0) {
+        MessageFu.success(sId > 0 ? '编辑成功' : '新增成功')
+        sId > 0 ? upTableFu() : addTableFu()
+        closeFu()
+      }
+
+      // if (1 + 1 === 2) {
+      //   console.log('------222', obj)
+      //   return
+      // }
+    },
+    [addTableFu, closeFu, sId, upTableFu]
+  )
+
+  const formDomRef = useRef<HTMLDivElement>(null)
+
+  return (
+    <div className={styles.A2add} style={{ position: martyrId ? 'fixed' : 'absolute' }}>
+      <div className='A2addMain'>
+        <div className='A2aTit'>{sId > 0 ? '编辑' : '新增'}线索</div>
+
+        <div className='A2accc' ref={formDomRef}>
+          <div>
+            <Form
+              ref={FormBoxRef}
+              name='basic'
+              onFinish={onFinish}
+              onFinishFailed={onFinishFailed}
+              autoComplete='off'
+              scrollToFirstError
+            >
+              <div className='A2aRow'>
+                <Form.Item
+                  label='线索类型'
+                  name='type'
+                  rules={[{ required: true, message: '请选择线索类型' }]}
+                >
+                  <Select
+                    getPopupContainer={() => formDomRef.current!}
+                    placeholder='请选择'
+                    options={A2select1}
+                  />
+                </Form.Item>
+
+                <Form.Item
+                  label='关联烈士'
+                  name='martyrId'
+                  rules={[{ required: true, message: '请选择关联烈士' }]}
+                >
+                  <Select
+                    disabled={!!martyrId}
+                    getPopupContainer={() => formDomRef.current!}
+                    filterOption={(input, option) =>
+                      (option?.label ?? '').toLowerCase().includes(input.toLowerCase())
+                    }
+                    placeholder='请搜索并选择'
+                    showSearch
+                    options={listAllRes}
+                  />
+                </Form.Item>
+              </div>
+
+              <div className='A2aRow'>
+                <Form.Item
+                  label='线索状态'
+                  name='status'
+                  rules={[{ required: true, message: '请选择线索状态' }]}
+                >
+                  <Radio.Group options={A2select2} />
+                </Form.Item>
+                <Form.Item label='提供者信息' name='supply'>
+                  <Input maxLength={50} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+
+              <div className='A2aRow'>
+                <Form.Item label='线索地址' name='myCity'>
+                  <Cascader options={myCity} placeholder='请选择' allowClear changeOnSelect />
+                </Form.Item>
+                <Form.Item label='线索详址' name='address'>
+                  <Input maxLength={50} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+
+              <div className='A2aRowAll'>
+                <Form.Item label='线索说明' name='remark'>
+                  <TextArea maxLength={500} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+
+              <div className='A2aRowAll'>
+                <Form.Item label='处理结果' name='result'>
+                  <TextArea maxLength={1000} showCount placeholder='请输入内容' />
+                </Form.Item>
+              </div>
+
+              {/* 多个图片 */}
+              <div className='formRow'>
+                <div className='formLeft'>图片:</div>
+                <div className='formRight'>
+                  <ZupTypes
+                    ref={ZupImgsRef}
+                    isLook={false}
+                    fileCheck={false}
+                    selecFlag='图片'
+                    imgSize={5}
+                    imgLength={50}
+                    dirCode='A2clue'
+                    myUrl='cms/clue/upload'
+                    isTypeShow={true}
+                  />
+                </div>
+              </div>
+
+              {/* 多个视频 */}
+              <div className='formRow formRow2'>
+                <div className='formLeft'>视频:</div>
+                <div className='formRight'>
+                  <ZupVideos
+                    isLook={false}
+                    size={500}
+                    fileNum={50}
+                    dirCode='A2clueVideo'
+                    myUrl='cms/clue/upload'
+                    upTxt=';数量不超过50个。'
+                    ref={ZupVideosRef}
+                  />
+                </div>
+              </div>
+
+              {/* 确定和取消按钮 */}
+              <Form.Item className='A2aBtn'>
+                <Button type='primary' htmlType='submit'>
+                  提交
+                </Button>
+                <br />
+                <br />
+                <MyPopconfirm txtK='取消' onConfirm={closeFu} />
+              </Form.Item>
+            </Form>
+          </div>
+        </div>
+      </div>
+    </div>
+  )
+}
+
+const MemoA2add = React.memo(A2add)
+
+export default MemoA2add

+ 42 - 0
后台管理/src/pages/A2clue/data.ts

@@ -0,0 +1,42 @@
+export type A2ListType = {
+  address: string
+  city: string
+  createTime: string
+  creatorId: number
+  creatorName: string
+  id: number
+  img?: any
+  imgIds: string
+  martyrId: number
+  martyrName: string
+  num: string
+  province: string
+  region: string
+  remark: string
+  result: string
+  status: number
+  supply: string
+  type: string
+  updateTime: string
+  video?: any
+  videoIds: string
+}
+
+export const A2select1 = [
+  { value: '亲属提供', label: '亲属提供' },
+  { value: '社会征集', label: '社会征集' },
+  { value: '档案资料', label: '档案资料' },
+  { value: '现场调查', label: '现场调查' },
+  { value: '口述史', label: '口述史' },
+  { value: '媒体报道', label: '媒体报道' },
+  { value: '部队反馈', label: '部队反馈' },
+  { value: '其他', label: '其他' }
+]
+
+export const A2select2 = [
+  { value: 0, label: '待确定' },
+  { value: 1, label: '跟进中' },
+  { value: 2, label: '已找到' },
+  { value: 3, label: '未找到' },
+  { value: 4, label: '作废' }
+]

+ 48 - 0
后台管理/src/pages/A2clue/index.module.scss

@@ -1,4 +1,52 @@
 .A2clue {
   :global {
+    .A2top {
+      padding: 15px 24px;
+      border-radius: 10px;
+      background-color: #fff;
+      display: flex;
+      justify-content: space-between;
+
+      .A2topLeft {
+        display: flex;
+
+        & > div {
+          margin-right: 24px;
+          .ant-btn {
+            margin-right: 10px;
+          }
+        }
+      }
+    }
+
+    .A2tableBox {
+      border-radius: 10px;
+      overflow: hidden;
+      margin-top: 15px;
+      height: calc(100% - 77px);
+      background-color: #fff;
+
+      .ant-table-body {
+        height: 645px;
+        overflow: auto !important;
+      }
+
+      .ant-table-cell {
+        padding: 8px !important;
+      }
+
+      .A2tableFen {
+        & > p {
+          margin-top: 5px;
+          text-decoration: underline;
+          color: var(--themeColor);
+          cursor: pointer;
+        }
+      }
+
+      .A2Tit {
+        cursor: pointer;
+      }
+    }
   }
 }

+ 176 - 2
后台管理/src/pages/A2clue/index.tsx

@@ -1,9 +1,183 @@
-import React from 'react'
+import React, { useCallback, useEffect, useMemo, useState } from 'react'
 import styles from './index.module.scss'
+import { useDispatch, useSelector } from 'react-redux'
+import { A2_APIdel, A2_APIgetList } from '@/store/action/A2clue'
+import { RootState } from '@/store'
+import { MessageFu } from '@/utils/message'
+import MyTable from '@/components/MyTable'
+import { A2tableC } from '@/utils/tableData'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import { Button, Select } from 'antd'
+import { A2select1, A2select2 } from './data'
+import { A1_APIgetList } from '@/store/action/A1record'
+import A2add from './A2add'
+
+const baseFromData = {
+  pageNum: 1,
+  pageSize: 10,
+  type: '',
+  martyrId: '',
+  status: ''
+}
+
 function A2clue() {
+  const dispatch = useDispatch()
+
+  // 获取所有烈士信息
+
+  useEffect(() => {
+    dispatch(
+      A1_APIgetList({
+        pageNum: 1,
+        pageSize: 99999
+      })
+    )
+  }, [dispatch])
+
+  const listAll = useSelector((state: RootState) => state.A1record.tableInfo.list)
+
+  const listAllRes = useMemo(() => {
+    return listAll.map(c => ({
+      value: c.id,
+      label: c.name
+    }))
+  }, [listAll])
+  // 获取所有烈士信息-end
+
+  const [fromData, setFromData] = useState(baseFromData)
+
+  const getListFu = useCallback(() => {
+    dispatch(A2_APIgetList(fromData))
+  }, [dispatch, fromData])
+
+  useEffect(() => {
+    getListFu()
+  }, [getListFu])
+
+  const tableInfo = useSelector((state: RootState) => state.A2clue.tableInfo)
+
+  // 点击重置
+  const resetSelectFu = useCallback(() => {
+    setFromData({ ...baseFromData })
+  }, [])
+
+  // 下拉框的改变
+  const selectChangeFu = useCallback(
+    (value: any, key: 'type' | 'martyrId' | 'status') => {
+      setFromData({ ...fromData, [key]: value, pageNum: 1 })
+    },
+    [fromData]
+  )
+
+  // 点击新增、编辑
+  const [editId, setEditId] = useState(0)
+
+  // 点击删除
+  const delTableFu = useCallback(
+    async (id: number) => {
+      const res = await A2_APIdel(id)
+      if (res.code === 0) {
+        MessageFu.success('删除成功!')
+        getListFu()
+      }
+    },
+    [getListFu]
+  )
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: '操作',
+        render: (item: any) => {
+          return (
+            <>
+              <Button size='small' type='text' onClick={() => setEditId(item.id)}>
+                编辑
+              </Button>
+              <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
+            </>
+          )
+        }
+      }
+    ]
+  }, [delTableFu])
+
   return (
     <div className={styles.A2clue}>
-      <div className='pageTitle'>线索管理</div>
+      <div className='pageTitle'>线索管理{editId ? (editId > 0 ? ' - 编辑' : ' - 新增') : ''}</div>
+
+      {/* 顶部筛选 */}
+      <div className='A2top'>
+        <div className='A2topLeft'>
+          <div>
+            <Select
+              allowClear
+              style={{ width: 150 }}
+              placeholder='线索类型'
+              value={fromData.type || null}
+              onChange={e => selectChangeFu(e, 'type')}
+              options={A2select1}
+            />
+          </div>
+
+          <div>
+            <Select
+              style={{ width: 240 }}
+              filterOption={(input, option) =>
+                (option?.label ?? '').toLowerCase().includes(input.toLowerCase())
+              }
+              allowClear
+              placeholder='搜索并选择关联烈士'
+              showSearch
+              options={listAllRes}
+              value={fromData.martyrId || null}
+              onChange={e => selectChangeFu(e, 'martyrId')}
+            />
+          </div>
+
+          <div>
+            <Select
+              allowClear
+              style={{ width: 150 }}
+              placeholder='线索状态'
+              value={fromData.status || null}
+              onChange={e => selectChangeFu(e, 'status')}
+              options={A2select2}
+            />
+          </div>
+        </div>
+
+        <div>
+          <Button onClick={resetSelectFu}>重置</Button>
+          &emsp;
+          <Button type='primary' onClick={() => setEditId(-1)}>
+            新增
+          </Button>
+        </div>
+      </div>
+
+      {/* 表格主体 */}
+      <div className='A2tableBox'>
+        <MyTable
+          yHeight={645}
+          list={tableInfo.list}
+          columnsTemp={A2tableC}
+          lastBtn={tableLastBtn}
+          pageNum={fromData.pageNum}
+          pageSize={fromData.pageSize}
+          total={tableInfo.total}
+          onChange={(pageNum, pageSize) => setFromData({ ...fromData, pageNum, pageSize })}
+        />
+      </div>
+      {editId ? (
+        <A2add
+          sId={editId}
+          closeFu={() => setEditId(0)}
+          addTableFu={resetSelectFu}
+          upTableFu={getListFu}
+          listAllRes={listAllRes}
+        />
+      ) : null}
     </div>
   )
 }

+ 1 - 1
后台管理/src/store/action/A1record.ts

@@ -32,7 +32,7 @@ export const A1_APIsave = (data: any) => {
 }
 
 /**
- * 烈士档案-新增
+ * 烈士档案-获取详情
  */
 export const A1_APIgetInfo = (id: number) => {
   return http.get(`cms/martyr/detail/${id}`)

+ 42 - 0
后台管理/src/store/action/A2clue.ts

@@ -0,0 +1,42 @@
+import http from '@/utils/http'
+import { AppDispatch } from '..'
+/**
+ * 线索管理-获取列表
+ */
+export const A2_APIgetList = (data: any, flag = false): any => {
+  if (flag) return http.post('cms/clue/pageList', data)
+  else {
+    return async (dispatch: AppDispatch) => {
+      const res = await http.post('cms/clue/pageList', data)
+      if (res.code === 0) {
+        const obj = {
+          list: res.data.records,
+          total: res.data.total
+        }
+
+        dispatch({ type: 'A2/getList', payload: obj })
+      }
+    }
+  }
+}
+
+/**
+ * 线索管理-删除
+ */
+export const A2_APIdel = (id: number) => {
+  return http.get(`cms/clue/remove/${id}`)
+}
+
+/**
+ * 线索管理-新增
+ */
+export const A2_APIsave = (data: any) => {
+  return http.post('cms/clue/save', data)
+}
+
+/**
+ * 线索管理-获取详情
+ */
+export const A2_APIgetInfo = (id: number) => {
+  return http.get(`cms/clue/detail/${id}`)
+}

+ 28 - 0
后台管理/src/store/reducer/A2clue.ts

@@ -0,0 +1,28 @@
+import { A2ListType } from '@/pages/A2clue/data'
+
+// 初始化状态
+const initState = {
+  // 列表数据
+  tableInfo: {
+    list: [] as A2ListType[],
+    total: 0
+  }
+}
+
+// 定义 action 类型
+type Props = {
+  type: 'A2/getList'
+  payload: { list: A2ListType[]; total: number }
+}
+
+// reducer
+export default function userReducer(state = initState, action: Props) {
+  switch (action.type) {
+    // 获取列表数据
+    case 'A2/getList':
+      return { ...state, tableInfo: action.payload }
+
+    default:
+      return state
+  }
+}

+ 2 - 0
后台管理/src/store/reducer/index.ts

@@ -4,6 +4,7 @@ import { combineReducers } from 'redux'
 // 导入 登录 模块的 reducer
 import A0Layout from './layout'
 import A1record from './A1record'
+import A2clue from './A2clue'
 
 import Z1user from './Z1user'
 import Z2log from './Z2log'
@@ -12,6 +13,7 @@ import Z2log from './Z2log'
 const rootReducer = combineReducers({
   A0Layout,
   A1record,
+  A2clue,
   Z1user,
   Z2log
 })

+ 17 - 12
后台管理/src/utils/tableData.ts

@@ -14,18 +14,23 @@
 //     ["text", "创建日期",'description', 50,A],
 //   ];
 
-// 待完善
-export const A1tableC = [
-  ['txt', 'ID', 'num'],
-  ['txt', '姓名', 'name'],
-  ['txtChange', '性别', 'gender', { 2: '女', 1: '男' }],
-  ['txt', '民族', 'nation'],
-  ['txt', '番号', 'dictPanName'],
-  ['txt', '籍贯', 'name'],
-  ['txt', '生卒', 'name'],
-  ['text', '备注', 'name', 50],
-  ['txt', '编辑时间', 'name'],
-  ['txt', '编辑人', 'name']
+import { A2select2 } from '@/pages/A2clue/data'
+
+const A2select2Obj: any = {}
+A2select2.forEach(v => {
+  A2select2Obj[v.value] = v.label
+})
+
+export const A2tableC = [
+  ['txt', '线索编号', 'num'],
+  ['txt', '线索类型', 'type'],
+  ['txt', '关联烈士', 'martyrName'],
+  ['txtChange', '线索状态', 'status', A2select2Obj],
+  ['cityAll', '线索地址', 'province', 'city', 'region', 'address'],
+  ['txt', '提供者信息', 'supply'],
+
+  ['txt', '编辑时间', 'updateTime'],
+  ['txt', '编辑人', 'creatorName']
 ]
 
 export const Z1tableC = [