shaogen1995 1 ماه پیش
والد
کامیت
ed646d96fe

+ 49 - 0
后台管理/src/pages/A3relation/A3show/index.module.scss

@@ -0,0 +1,49 @@
+.A3show {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+    .ant-modal {
+      width: 800px !important;
+    }
+    .A3aMain {
+      border-top: 1px solid #ccc;
+      padding-top: 20px;
+
+      .formRow {
+        display: flex;
+        margin-bottom: 24px;
+
+        .formLeft {
+          position: relative;
+          // top: 3px;
+          width: 80px;
+          text-align: right;
+
+          & > span {
+            color: #ff4d4f;
+          }
+        }
+
+        .formRight {
+          width: calc(100% - 80px);
+        }
+      }
+      .A3fromRow {
+        position: relative;
+
+        .A3_6Frow {
+          position: absolute;
+          left: 165px;
+          top: 5px;
+          color: #999;
+          font-size: 12px;
+        }
+      }
+      .A3aBtn {
+        margin-top: 24px;
+        padding-left: 77px;
+      }
+    }
+  }
+}

+ 131 - 0
后台管理/src/pages/A3relation/A3show/index.tsx

@@ -0,0 +1,131 @@
+import React, { useCallback, useEffect, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { Button, Modal, Radio } from 'antd'
+import ZupOne from '@/components/ZupOne'
+import { A3_APIS_getInfo, A3_APIS_save } from '@/store/action/A3relation'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import { MessageFu } from '@/utils/message'
+
+type Props = {
+  closeFu: () => void
+}
+
+function A3show({ closeFu }: Props) {
+  // 封面图的ref
+  const ZupThumbRef = useRef<any>(null)
+
+  const infoRef = useRef({})
+
+  // 进来获取详情
+  const getInfoFu = useCallback(async () => {
+    const res = await A3_APIS_getInfo()
+    if (res.code === 0) {
+      const info = res.data || {}
+      infoRef.current = info
+      setValue(res.data.typeSon || '1')
+
+      // 设置封面图
+      ZupThumbRef.current?.setFileComFileFu({
+        fileName: '',
+        filePath: info.thumbPc || info.thumb,
+        thumb: info.thumb
+      })
+    }
+  }, [])
+
+  useEffect(() => {
+    getInfoFu()
+  }, [getInfoFu])
+
+  const [value, setValue] = useState('0')
+
+  // 图片是否为必填
+  const [imgFlag, setImgFlag] = useState(false)
+
+  useEffect(() => {
+    setImgFlag(value === '1')
+  }, [value])
+
+  // 点击确定
+  const btnOk = useCallback(async () => {
+    const coverUrl1 = ZupThumbRef.current?.fileComFileResFu()
+    // 没有传 图片
+    if (!coverUrl1.filePath && imgFlag) return MessageFu.warning('请上传图片')
+
+    const obj = {
+      ...infoRef.current,
+      typeSon: value,
+      thumb: coverUrl1.filePath || ''
+    }
+
+    const res = await A3_APIS_save(obj)
+    if (res.code === 0) {
+      MessageFu.success('设置成功')
+      closeFu()
+    }
+  }, [closeFu, imgFlag, value])
+
+  return (
+    <Modal
+      wrapClassName={styles.A3show}
+      open={true}
+      title='用户端展示设置'
+      footer={
+        [] // 设置footer为空,去掉 取消 确定默认按钮
+      }
+    >
+      <div className='A3aMain'>
+        <div className='formRow'>
+          <div className='formLeft'>
+            <span>* </span>
+            展示类型:
+          </div>
+          <div className='formRight'>
+            <Radio.Group
+              value={value}
+              onChange={e => setValue(e.target.value)}
+              options={[
+                { value: '1', label: '图片' },
+                { value: '2', label: '动态关系图' }
+              ]}
+            />
+          </div>
+        </div>
+        {/* 图片 */}
+        <div className='formRow'>
+          <div className='formLeft'>
+            <span hidden={!imgFlag}>* </span>
+            图片:
+          </div>
+          <div className='formRight'>
+            <ZupOne
+              ref={ZupThumbRef}
+              isLook={false}
+              fileCheck={imgFlag}
+              size={10}
+              dirCode='A3relationShow'
+              myUrl='cms/person/upload'
+              format={['image/jpeg', 'image/png']}
+              formatTxt='png、jpg和jpeg'
+              checkTxt='请上传头像'
+              upTxt='最多1张'
+              myType='thumb'
+            />
+          </div>
+        </div>
+
+        <div className='A3aBtn'>
+          <Button type='primary' onClick={btnOk}>
+            提交
+          </Button>
+          &emsp;
+          <MyPopconfirm txtK='取消' onConfirm={closeFu} />
+        </div>
+      </div>
+    </Modal>
+  )
+}
+
+const MemoA3show = React.memo(A3show)
+
+export default MemoA3show

+ 11 - 0
后台管理/src/pages/A3relation/index.tsx

@@ -11,6 +11,7 @@ import MyTable from '@/components/MyTable'
 import { A3tableC } from '@/utils/tableData'
 import A3add from './A3add'
 import A3group from './A3group'
+import A3show from './A3show'
 
 const baseFromData = {
   pageNum: 1,
@@ -66,6 +67,9 @@ function A3relation() {
   // 关系组页面
   const [group, setGroup] = useState(false)
 
+  // 用户端展示设置
+  const [showPage, setShowPage] = useState(false)
+
   return (
     <div className={styles.A3relation}>
       <div className='pageTitle'>人际关系</div>
@@ -75,6 +79,10 @@ function A3relation() {
         <div></div>
 
         <div>
+          <Button type='primary' onClick={() => setShowPage(true)}>
+            用户端展示设置
+          </Button>
+          &emsp;
           <Button type='primary' onClick={() => setGroup(true)}>
             关系组设置
           </Button>
@@ -115,6 +123,9 @@ function A3relation() {
           <A3group closeFu={() => setGroup(false)} upTableFu={getListFu} />
         </div>
       ) : null}
+
+      {/* 用户端展示页面 */}
+      {showPage ? <A3show closeFu={() => setShowPage(false)} /> : null}
     </div>
   )
 }

+ 1 - 1
后台管理/src/pages/A4evaluate/A4add/index.tsx

@@ -85,7 +85,7 @@ function A4add({ info, closeFu, addTableFu, upTableFu }: Props) {
             // getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
             getValueFromEvent={e => e.target.value.trim()}
           >
-            <Input maxLength={10} showCount placeholder='请输入内容' />
+            <Input maxLength={20} showCount placeholder='请输入内容' />
           </Form.Item>
 
           <Form.Item

+ 1 - 1
后台管理/src/pages/A5photoWall/A5add/index.tsx

@@ -112,7 +112,7 @@ function A5add({ info, closeFu, addTableFu, upTableFu }: Props) {
                 ref={ZupThumbRef}
                 isLook={false}
                 fileCheck={fileCheck}
-                size={5}
+                size={10}
                 dirCode='A5photoWall'
                 myUrl='cms/img/upload'
                 format={['image/jpeg', 'image/png']}

+ 15 - 0
后台管理/src/store/action/A3relation.ts

@@ -62,3 +62,18 @@ export const A3_APIG_save = (data: any) => {
 export const A3_APIG_getUserList = () => {
   return http.get('cms/relation/getPerson')
 }
+
+// -------------------用户展示端设置-----------------
+/**
+ * 人际关系-展示端-获取配置
+ */
+export const A3_APIS_getInfo = (dictId = 1) => {
+  return http.get(`cms/person/dict/getDict/${dictId}`)
+}
+
+/**
+ * 人际关系-展示端-设置配置
+ */
+export const A3_APIS_save = (data: any) => {
+  return http.post('cms/person/dict/update', data)
+}