From b85b1ab33958b28d8a3add3d268fea510947122e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Mon, 25 Sep 2023 09:48:24 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=97=A0=E6=9D=83=E9=99=90=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Information/index.jsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/forge/Information/index.jsx b/src/forge/Information/index.jsx index e82f0c35f..9ee250f40 100644 --- a/src/forge/Information/index.jsx +++ b/src/forge/Information/index.jsx @@ -162,18 +162,18 @@ function Index(props){ )} > - ( )} - > - } + {role && role.role !== "None" && ( )} - > + >} ( @@ -192,18 +192,18 @@ function Index(props){ )} > - ( )} - > - } + {role && role.role !== "None" && ( )} - > + >} ( From 7f2f8c8a129d435fda2620b73349b71dd4d328c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Mon, 25 Sep 2023 10:06:14 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=97=A0=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Information/Pages/newsCreate.jsx | 8 +++++++- src/forge/Information/Pages/sourceCreate.jsx | 8 +++++++- src/forge/Information/fetch.js | 1 - src/forge/Information/index.jsx | 16 ++++++++-------- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/forge/Information/Pages/newsCreate.jsx b/src/forge/Information/Pages/newsCreate.jsx index b4e283848..1e68f5054 100644 --- a/src/forge/Information/Pages/newsCreate.jsx +++ b/src/forge/Information/Pages/newsCreate.jsx @@ -11,7 +11,7 @@ import { addNewsByDirId, getDirListById, getNewsDetailByAu, updateDoc } from '.. import { httpUrl } from '../fetch'; function NewsCreate(props){ - const {history, id} = props; + const {history, id, role} = props; const temp = props.temp; const { getFieldDecorator, validateFields , setFieldsValue, setFields } = props.form; const { deptId, id: newsId } = props.match.params; @@ -27,6 +27,12 @@ function NewsCreate(props){ wrapperCol: { span: 14 }, }; + useEffect(()=>{ + if(role && role.role === "None"){ + history.push(`/zone/${deptId}`); + } + }, [role]) + useEffect(()=>{ id && getDircList(); },[id]) diff --git a/src/forge/Information/Pages/sourceCreate.jsx b/src/forge/Information/Pages/sourceCreate.jsx index 14c630333..86a5cf8a8 100644 --- a/src/forge/Information/Pages/sourceCreate.jsx +++ b/src/forge/Information/Pages/sourceCreate.jsx @@ -6,7 +6,7 @@ import { Link } from 'react-router-dom'; import { getTypeByFileId, getSourceZoneList, addResource, getSourceDetailByAu, updateMyResource } from '../api'; function SourceCreate(props){ - const {history, id} = props; + const {history, id, role} = props; const { getFieldDecorator, validateFields , setFieldsValue, setFields } = props.form; const { deptId, sourceid} = props.match.params; const pathname = props.location.pathname; @@ -20,6 +20,12 @@ function SourceCreate(props){ wrapperCol: { span: 14 }, }; + useEffect(()=>{ + if(role && role.role === "None"){ + history.push(`/zone/${deptId}`); + } + }, [role]) + useEffect(()=>{ id && getZoneList(); },[id]) diff --git a/src/forge/Information/fetch.js b/src/forge/Information/fetch.js index c9057bca0..29cc15d28 100644 --- a/src/forge/Information/fetch.js +++ b/src/forge/Information/fetch.js @@ -7,7 +7,6 @@ function beforeFetch(actionUrl){ } const service = axios.create({ - headers:{Authorization:"fb55fcaae60bb0c341078dade4b37c965e285394"}, baseURL: actionUrl, timeout: 1800000, // 请求超时时间 }); diff --git a/src/forge/Information/index.jsx b/src/forge/Information/index.jsx index 9ee250f40..942d814e4 100644 --- a/src/forge/Information/index.jsx +++ b/src/forge/Information/index.jsx @@ -162,16 +162,16 @@ function Index(props){ )} > - {role && role.role !== "None" && ( - + )} >} - {role && role.role !== "None" && ( - + )} >} )} > - {role && role.role !== "None" && ( - + )} >} - {role && role.role !== "None" && ( - + )} >} Date: Mon, 25 Sep 2023 10:31:17 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E7=BC=96=E8=BE=91=E5=99=A8=E5=BC=B9=E6=A1=86=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Component/RichEditor/index.jsx | 1 + src/forge/Component/RichEditor/index.scss | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 src/forge/Component/RichEditor/index.scss diff --git a/src/forge/Component/RichEditor/index.jsx b/src/forge/Component/RichEditor/index.jsx index aa9da43f8..21485b82c 100644 --- a/src/forge/Component/RichEditor/index.jsx +++ b/src/forge/Component/RichEditor/index.jsx @@ -4,6 +4,7 @@ import '@wangeditor/editor/dist/css/style.css'; import cookie from 'react-cookies'; import { message, Spin } from 'antd'; import axios from 'axios'; +import './index.scss'; // 富文本编辑器 function MyEditor(props) { diff --git a/src/forge/Component/RichEditor/index.scss b/src/forge/Component/RichEditor/index.scss new file mode 100644 index 000000000..002e8faad --- /dev/null +++ b/src/forge/Component/RichEditor/index.scss @@ -0,0 +1,5 @@ +.w-e-modal{ + input, button, select, optgroup, textarea{ + line-height: 1.9; + } +} \ No newline at end of file From 5d0f4df7e9cd72ac04433d2bca520687ccb65624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Mon, 25 Sep 2023 10:34:09 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppConfig.js | 2 +- src/forge/Information/Pages/newsCreate.jsx | 4 ++-- src/forge/Information/Pages/sourceCreate.jsx | 4 ++-- src/forge/Information/index.jsx | 16 ++++++++-------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index cf7fe8b6a..9ca6363a5 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -25,7 +25,7 @@ if (isDev) { } debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : window.location.search.indexOf('debug=s') !== -1 ? 'student' : - window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin' + window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || '' } window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/src/forge/Information/Pages/newsCreate.jsx b/src/forge/Information/Pages/newsCreate.jsx index 1e68f5054..5926af15d 100644 --- a/src/forge/Information/Pages/newsCreate.jsx +++ b/src/forge/Information/Pages/newsCreate.jsx @@ -11,7 +11,7 @@ import { addNewsByDirId, getDirListById, getNewsDetailByAu, updateDoc } from '.. import { httpUrl } from '../fetch'; function NewsCreate(props){ - const {history, id, role} = props; + const {history, id, role, current_user} = props; const temp = props.temp; const { getFieldDecorator, validateFields , setFieldsValue, setFields } = props.form; const { deptId, id: newsId } = props.match.params; @@ -28,7 +28,7 @@ function NewsCreate(props){ }; useEffect(()=>{ - if(role && role.role === "None"){ + if((role && role.role === "None") || (current_user && !current_user.login)){ history.push(`/zone/${deptId}`); } }, [role]) diff --git a/src/forge/Information/Pages/sourceCreate.jsx b/src/forge/Information/Pages/sourceCreate.jsx index 86a5cf8a8..9b99a3f98 100644 --- a/src/forge/Information/Pages/sourceCreate.jsx +++ b/src/forge/Information/Pages/sourceCreate.jsx @@ -6,7 +6,7 @@ import { Link } from 'react-router-dom'; import { getTypeByFileId, getSourceZoneList, addResource, getSourceDetailByAu, updateMyResource } from '../api'; function SourceCreate(props){ - const {history, id, role} = props; + const {history, id, role, current_user} = props; const { getFieldDecorator, validateFields , setFieldsValue, setFields } = props.form; const { deptId, sourceid} = props.match.params; const pathname = props.location.pathname; @@ -21,7 +21,7 @@ function SourceCreate(props){ }; useEffect(()=>{ - if(role && role.role === "None"){ + if((role && role.role === "None") || (current_user && !current_user.login)){ history.push(`/zone/${deptId}`); } }, [role]) diff --git a/src/forge/Information/index.jsx b/src/forge/Information/index.jsx index 942d814e4..599fdbd01 100644 --- a/src/forge/Information/index.jsx +++ b/src/forge/Information/index.jsx @@ -162,18 +162,18 @@ function Index(props){ )} > - {current_user && current_user.login && ( )} - >} - {current_user && current_user.login && + ( )} - >} + > ( @@ -192,18 +192,18 @@ function Index(props){ )} > - {current_user && current_user.login && ( )} - >} - {current_user && current_user.login && + ( )} - >} + > ( From 2cf9642cfa0b17349a4bdd0bc992f946a446c39d Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Mon, 25 Sep 2023 14:26:36 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=A0=87=E8=AF=86check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Information/Pages/apply.jsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/forge/Information/Pages/apply.jsx b/src/forge/Information/Pages/apply.jsx index 9f3515eab..5f020e6eb 100644 --- a/src/forge/Information/Pages/apply.jsx +++ b/src/forge/Information/Pages/apply.jsx @@ -2,7 +2,7 @@ import React, { useEffect } from 'react'; import { Form , Input , Row , Col, Button } from 'antd'; import '../index.scss'; import { postCreateZone } from '../api'; -import cookie from 'react-cookies'; +import axios from 'axios'; const { TextArea } = Input; const phonereg = /^([1][3456789])\d{9}$/ @@ -45,6 +45,17 @@ function Apply(props){ callback(); } + function checkId(rule,value,callback){ + value ? axios.post(`/accounts/check_keywords`, { + text:value + }).then(response => { + if(response && response.data.data===false){ + callback("与系统标识重复,请更改标识"); + } + callback(); + }):callback(); + } + return(
@@ -94,7 +105,10 @@ function Apply(props){ rules:[ { required: true,message:"请输入专区域名标识" }, { pattern: /^[a-zA-Z][a-zA-Z0-9_-]{0,18}[a-zA-Z]$/, message: "长度2-20,只能包含数字、字母、下划线、中划线,必须以字母开头结尾"}, - ] + { validator:checkId } + ], + validateTrigger:"onBlur", + validateFirst: true, })( )} From 98358de1bbb3815b4e5a3cc15488cabd0f0debe3 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Mon, 25 Sep 2023 15:37:10 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E7=A9=BA=E6=95=B0=E6=8D=AE=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppConfig.js | 2 +- src/forge/Information/Pages/selfList.jsx | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index 9ca6363a5..cf7fe8b6a 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -25,7 +25,7 @@ if (isDev) { } debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : window.location.search.indexOf('debug=s') !== -1 ? 'student' : - window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || '' + window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin' } window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/src/forge/Information/Pages/selfList.jsx b/src/forge/Information/Pages/selfList.jsx index 9f87a96d1..74d11df27 100644 --- a/src/forge/Information/Pages/selfList.jsx +++ b/src/forge/Information/Pages/selfList.jsx @@ -67,7 +67,12 @@ function SelfList(props){ pageSize:limit, pageNum:page }).then(result=>{ - setList(result.data.rows); + let rows = result.data && result.data.rows; + if(rows && rows.length>0){ + setList(rows); + }else{ + setList([]); + } setTotal(result.data.total); setIsSpin(false); }) @@ -79,7 +84,12 @@ function SelfList(props){ pageSize:limit, pageNum:page }).then(result=>{ - setList(result.data.rows); + let rows = result.data && result.data.rows; + if(rows && rows.length>0){ + setList(rows); + }else{ + setList([]); + } setTotal(result.data.total); setIsSpin(false); })