shaogen1995 1 giorno fa
parent
commit
08fa314ecb

BIN
.nvmrc


+ 1 - 1
src/pages/A4advanced/A4add/index.tsx

@@ -116,7 +116,7 @@ function A4add({ txt, _id, closeFu, addTableFu, editTableFu }: Props) {
             rules={[{ required: true, message: '请输入标题' }]}
             getValueFromEvent={e => e.target.value.trim()}
           >
-            <Input readOnly={txt === '查看'} maxLength={30} showCount placeholder='请输入内容' />
+            <Input readOnly={txt === '查看'} maxLength={50} showCount placeholder='请输入内容' />
           </Form.Item>
 
           <Form.Item

+ 46 - 30
src/pages/A5share/A5add/index.module.scss

@@ -8,42 +8,58 @@
   border-radius: 10px;
   padding: 20px;
   :global {
-    .ant-form {
-      width: 1000px;
-      .ant-form-item-label {
-        width: 120px;
-      }
+    .A5main {
+      width: 100%;
+      height: 100%;
+      overflow: auto;
 
-      .formBox {
-        display: flex;
-        margin-bottom: 24px;
-        .formBoxll {
+      .ant-form {
+        width: 1000px;
+        height: 100%;
+        .ant-form-item-label {
           width: 120px;
-          text-align: right;
-          line-height: 26px;
-          & > span {
-            color: #ff4d4f;
+        }
+
+        .formBox {
+          display: flex;
+          margin-bottom: 24px;
+          .formBoxll {
+            width: 120px;
+            text-align: right;
+            line-height: 26px;
+            & > span {
+              color: #ff4d4f;
+            }
+          }
+          .formBoxrr {
+            width: calc(100% - 120px);
+            .noUpThumb {
+              display: none;
+            }
+            .zztxtRow {
+              margin-bottom: 0;
+            }
           }
         }
-        .formBoxrr {
-          width: calc(100% - 120px);
+        .sortForm {
+          position: relative;
+          .fromRowTit {
+            position: absolute;
+            left: 225px;
+            top: 6px;
+            color: #999;
+            font-size: 12px;
+          }
         }
-      }
-      .sortForm {
-        position: relative;
-        .fromRowTit {
+        .BtnForm {
           position: absolute;
-          left: 225px;
-          top: 6px;
-          color: #999;
-          font-size: 12px;
-        }
-      }
-      .BtnForm {
-        padding-left: 120px;
-        margin-top: 40px;
-        .ant-btn {
-          margin-right: 30px;
+          right: 200px;
+          top: 50%;
+          transform: translateY(-50%);
+
+          .ant-btn {
+            margin-bottom: 30px;
+          }
         }
       }
     }

+ 140 - 166
src/pages/A5share/A5add/index.tsx

@@ -8,8 +8,7 @@ import { MessageFu } from '@/utils/message'
 import { A5typeSelectType } from '../data'
 import ZupOne from '@/components/ZupOne'
 import MyPopconfirm from '@/components/MyPopconfirm'
-import ZupTypes from '@/components/ZupTypes'
-import TextArea from 'antd/es/input/TextArea'
+import ZRichTextOne from '@/components/ZRichTextOne'
 
 type Props = {
   txt: AddTxtType
@@ -32,8 +31,8 @@ function A5add({ txt, _id, closeFu, addTableFu, editTableFu }: Props) {
   // 文档的ref
   const ZupDocRef = useRef<any>(null)
 
-  // 图片的ref
-  const ZupImgRef = useRef<any>(null)
+  // 图片富文本的ref
+  const ZRichTextRef = useRef<any>(null)
 
   const [type, setType] = useState('')
 
@@ -55,11 +54,8 @@ function A5add({ txt, _id, closeFu, addTableFu, editTableFu }: Props) {
         compressedUrl: ''
       })
     } else if (type === '图片资料') {
-      //  设置附件类型
-      ZupImgRef.current?.setFileComFileFu({
-        type: ['img'],
-        fileList: infoRef.current.fileDetails || []
-      })
+      // 设置富文本
+      ZRichTextRef.current?.ritxtShowFu(infoRef.current.imgTxt)
     } else if (type === '档案文件') {
       // 设置文档
       ZupDocRef.current?.setFileComFileFu({
@@ -110,7 +106,8 @@ function A5add({ txt, _id, closeFu, addTableFu, editTableFu }: Props) {
       let docUrl = ''
       let docName = ''
 
-      let fileIds = []
+      // 富文本
+      const rtf = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
 
       if (type === '视频素材') {
         // 封面图
@@ -123,18 +120,6 @@ function A5add({ txt, _id, closeFu, addTableFu, editTableFu }: Props) {
         if (!videoUrlObj.originalUrl) return MessageFu.warning('请上传视频')
         videoUrl = videoUrlObj.originalUrl || ''
         videoName = videoUrlObj.originalName || ''
-      } else if (type === '图片资料') {
-        // 文件类型
-        const {
-          sonIsOk,
-          sonFileIds,
-          cover: cover2,
-          coverSmall: coverSmall2
-        } = ZupImgRef.current?.fileComFileResFu()
-        if (sonIsOk) return MessageFu.warning('请上传图片')
-        cover = cover2
-        coverSmall = coverSmall2
-        fileIds = sonFileIds || []
       } else if (type === '档案文件') {
         const docUrlObj = ZupDocRef.current?.fileComFileResFu()
         if (!docUrlObj.originalUrl) return MessageFu.warning('请上传文档')
@@ -152,7 +137,7 @@ function A5add({ txt, _id, closeFu, addTableFu, editTableFu }: Props) {
         videoName,
         docUrl,
         docName,
-        fileIds
+        imgTxt: rtf.val || ''
       }
 
       // if (1 + 1 === 2) {
@@ -176,168 +161,157 @@ function A5add({ txt, _id, closeFu, addTableFu, editTableFu }: Props) {
 
   return (
     <div className={styles.A5add}>
-      <Form
-        scrollToFirstError={true}
-        ref={FormBoxRef}
-        name='basic'
-        onFinish={onFinish}
-        onFinishFailed={onFinishFailed}
-        autoComplete='off'
-      >
-        <Form.Item
-          label='标题'
-          name='name'
-          rules={[{ required: true, message: '请输入标题' }]}
-          getValueFromEvent={e => e.target.value.trim()}
+      <div className='A5main'>
+        <Form
+          scrollToFirstError={true}
+          ref={FormBoxRef}
+          name='basic'
+          onFinish={onFinish}
+          onFinishFailed={onFinishFailed}
+          autoComplete='off'
         >
-          <Input readOnly={txt === '查看'} maxLength={30} showCount placeholder='请输入内容' />
-        </Form.Item>
+          <Form.Item
+            label='标题'
+            name='name'
+            rules={[{ required: true, message: '请输入标题' }]}
+            getValueFromEvent={e => e.target.value.trim()}
+          >
+            <Input readOnly={txt === '查看'} maxLength={30} showCount placeholder='请输入内容' />
+          </Form.Item>
 
-        <Form.Item
-          label='发布日期'
-          name='releaseDate'
-          rules={[{ required: true, message: '请选择发布日期' }]}
-        >
-          <DatePicker disabled={txt === '查看'} allowClear={false} />
-        </Form.Item>
-
-        <Form.Item label='类别' name='type' rules={[{ required: true, message: '请选择类别' }]}>
-          <Select
-            value={type}
-            onChange={e => setType(e)}
-            disabled={txt === '查看'}
-            style={{ width: 150 }}
-            options={A5typeSelectType}
-            placeholder='请选择'
-          />
-        </Form.Item>
-
-        {type && type === '视频素材' ? (
-          <div className='formBox'>
-            <div className='formBoxll'>
-              <span>* </span>封面:
-            </div>
-            <div className='formBoxrr'>
-              <ZupOne
-                ref={ZupThumbRef}
-                isLook={txt === '查看'}
-                fileCheck={fileCheck}
-                myUrl='file/upload?upPath=A5share'
-                format={['image/jpeg', 'image/png']}
-                formatTxt='png、jpg和jpeg'
-                checkTxt='请上传封面图'
-                upTxt='最多1张'
-                myType='thumb'
-                size={5}
-              />
-            </div>
-          </div>
-        ) : null}
+          <Form.Item
+            label='发布日期'
+            name='releaseDate'
+            rules={[{ required: true, message: '请选择发布日期' }]}
+          >
+            <DatePicker disabled={txt === '查看'} allowClear={false} />
+          </Form.Item>
 
-        {type === '视频素材' ? (
-          <div className='formBox'>
-            <div className='formBoxll'>
-              <span>* </span>视频:
-            </div>
-            <div className='formBoxrr'>
-              <ZupOne
-                ref={ZupVideoRef}
-                isLook={txt === '查看'}
-                fileCheck={fileCheck}
-                myUrl='file/upload?upPath=A5share'
-                format={['video/mp4']}
-                formatTxt='mp4'
-                checkTxt='请上传视频'
-                upTxt='最多1个'
-                myType='video'
-                size={500}
-              />
-            </div>
-          </div>
-        ) : null}
+          <Form.Item label='类别' name='type' rules={[{ required: true, message: '请选择类别' }]}>
+            <Select
+              value={type}
+              onChange={e => setType(e)}
+              disabled={txt === '查看'}
+              style={{ width: 150 }}
+              options={A5typeSelectType}
+              placeholder='请选择'
+            />
+          </Form.Item>
 
-        {type === '图片资料' ? (
-          <>
+          {type && type === '视频素材' ? (
             <div className='formBox'>
               <div className='formBoxll'>
-                <span>* </span>图片
+                <span>* </span>封面:
               </div>
               <div className='formBoxrr'>
-                <ZupTypes
-                  ref={ZupImgRef}
-                  selecFlag='图片'
+                <ZupOne
+                  ref={ZupThumbRef}
+                  isLook={txt === '查看'}
                   fileCheck={fileCheck}
                   myUrl='file/upload?upPath=A5share'
+                  format={['image/jpeg', 'image/png']}
+                  formatTxt='png、jpg和jpeg'
+                  checkTxt='请上传封面图'
+                  upTxt='最多1张'
+                  myType='thumb'
+                  size={5}
+                />
+              </div>
+            </div>
+          ) : null}
+
+          {type === '视频素材' ? (
+            <div className='formBox'>
+              <div className='formBoxll'>
+                <span>* </span>视频:
+              </div>
+              <div className='formBoxrr'>
+                <ZupOne
+                  ref={ZupVideoRef}
                   isLook={txt === '查看'}
-                  imgLength={20}
-                  multipleImg={true}
-                  oneIsCover={true}
-                  isTypeShow={true}
+                  fileCheck={fileCheck}
+                  myUrl='file/upload?upPath=A5share'
+                  format={['video/mp4']}
+                  formatTxt='mp4'
+                  checkTxt='请上传视频'
+                  upTxt='最多1个'
+                  myType='video'
+                  size={500}
                 />
               </div>
             </div>
-            <Form.Item label='图片介绍' name='imgTxt'>
-              <TextArea
-                readOnly={txt === '查看'}
-                maxLength={200}
-                showCount
-                placeholder='请输入内容'
-              />
-            </Form.Item>
-          </>
-        ) : null}
+          ) : null}
+
+          {type === '图片资料' ? (
+            <>
+              <div className='formBox'>
+                <div className='formBoxll'>内容:</div>
+                <div className='formBoxrr'>
+                  <ZRichTextOne
+                    check={false}
+                    myUrl='file/upload?upPath=A5share'
+                    isLook={txt === '查看'}
+                    ref={ZRichTextRef}
+                  />
+                </div>
+              </div>
+            </>
+          ) : null}
 
-        {type === '档案文件' ? (
-          <div className='formBox'>
-            <div className='formBoxll'>
-              <span>* </span>文档:
+          {type === '档案文件' ? (
+            <div className='formBox'>
+              <div className='formBoxll'>
+                <span>* </span>文档:
+              </div>
+              <div className='formBoxrr'>
+                <ZupOne
+                  ref={ZupDocRef}
+                  isLook={txt === '查看'}
+                  fileCheck={fileCheck}
+                  myUrl='file/upload?upPath=A5share'
+                  format={['video/mp4']}
+                  formatTxt='pdf/doc/docx'
+                  checkTxt='请上传文档'
+                  upTxt='最多1个'
+                  myType='pdf'
+                  size={50}
+                />
+              </div>
             </div>
-            <div className='formBoxrr'>
-              <ZupOne
-                ref={ZupDocRef}
-                isLook={txt === '查看'}
-                fileCheck={fileCheck}
-                myUrl='file/upload?upPath=A5share'
-                format={['video/mp4']}
-                formatTxt='pdf/doc/docx'
-                checkTxt='请上传文档'
-                upTxt='最多1个'
-                myType='pdf'
-                size={50}
-              />
+          ) : null}
+
+          <div className='sortForm'>
+            <Form.Item
+              label='排序值'
+              name='sort'
+              initialValue={999}
+              rules={[{ required: true, message: '请输入排序值' }]}
+            >
+              <InputNumber readOnly={txt === '查看'} min={1} max={999} placeholder='请输入' />
+            </Form.Item>
+            <div className='fromRowTit'>
+              请输入1~999的数字。数字越大,排序越靠前。数字相同时,更新发布的内容排在前面
             </div>
           </div>
-        ) : null}
-
-        <div className='sortForm'>
-          <Form.Item
-            label='排序值'
-            name='sort'
-            initialValue={999}
-            rules={[{ required: true, message: '请输入排序值' }]}
-          >
-            <InputNumber readOnly={txt === '查看'} min={1} max={999} placeholder='请输入' />
-          </Form.Item>
-          <div className='fromRowTit'>
-            请输入1~999的数字。数字越大,排序越靠前。数字相同时,更新发布的内容排在前面
+          {/* 确定和取消按钮 */}
+          <div className='BtnForm'>
+            <Form.Item>
+              {txt === '查看' ? (
+                <Button onClick={closeFu}>返回</Button>
+              ) : (
+                <>
+                  <Button type='primary' htmlType='submit'>
+                    提交
+                  </Button>
+                  <br />
+                  <br />
+                  <MyPopconfirm txtK='取消' onConfirm={closeFu} />
+                </>
+              )}
+            </Form.Item>
           </div>
-        </div>
-        {/* 确定和取消按钮 */}
-        <div className='BtnForm'>
-          <Form.Item>
-            {txt === '查看' ? (
-              <Button onClick={closeFu}>返回</Button>
-            ) : (
-              <>
-                <Button type='primary' htmlType='submit'>
-                  提交
-                </Button>
-                <MyPopconfirm txtK='取消' onConfirm={closeFu} />
-              </>
-            )}
-          </Form.Item>
-        </div>
-      </Form>
+        </Form>
+      </div>
     </div>
   )
 }

+ 16 - 4
src/pages/B1audit/B1btn/index.tsx

@@ -176,12 +176,24 @@ function B1btn({ sId, isLook, closeFu, upTableFu }: Props) {
             <div className='B1Btoprr'>{info.title}</div>
           </div>
           <div className='B1Btop'>
-            <div className='B1Btopll'>联系方式:</div>
-            <div className='B1Btoprr'>{info.title}</div>
+            <div className='B1Btopll'>手机号:</div>
+            <div className='B1Btoprr'>{info.phone || '-'}</div>
+          </div>
+          <div className='B1Btop'>
+            <div className='B1Btopll'>邮箱:</div>
+            <div className='B1Btoprr'>{info.mailbox || '-'}</div>
+          </div>
+          <div className='B1Btop'>
+            <div className='B1Btopll'>姓名:</div>
+            <div className='B1Btoprr'>{info.name || '-'}</div>
+          </div>
+          <div className='B1Btop'>
+            <div className='B1Btopll'>单位:</div>
+            <div className='B1Btoprr'>{info.unit || '-'}</div>
           </div>
-          <div className='B1Btop B1Btop2'>
+          <div className='B1Btop'>
             <div className='B1Btopll'>概述:</div>
-            <div className='B1Btoprr'>{info.description}</div>
+            <div className='B1Btoprr'>{info.description || '-'}</div>
           </div>
         </div>
         <div className='B1Btit'>文件</div>

+ 3 - 0
src/pages/B1audit/data.ts

@@ -10,6 +10,9 @@ export type B1listType = {
   state: boolean
   createTime: string
   updateTime: string
+  mailbox: string
+  name: string
+  unit: string
   __v: number
 }
 

+ 4 - 1
src/utils/tableData.ts

@@ -45,7 +45,10 @@ export const A5tableC = [
 
 export const B1tableC = [
   ['txt', `标题`, 'title'],
-  ['txt', '联系方式', 'phone'],
+  ['txt', '手机号', 'phone'],
+  ['txt', '邮箱', 'mailbox'],
+  ['txt', '姓名', 'name'],
+  ['text', '单位', 'unit', 50],
   ['text', '概述', 'description', 50],
   ['length', `文件数量`, 'fileIds'],
   ['txt', '上传时间', 'createTime'],