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 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, })( )} diff --git a/src/forge/Information/Pages/newsCreate.jsx b/src/forge/Information/Pages/newsCreate.jsx index b4e283848..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} = 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; @@ -27,6 +27,12 @@ function NewsCreate(props){ wrapperCol: { span: 14 }, }; + useEffect(()=>{ + if((role && role.role === "None") || (current_user && !current_user.login)){ + history.push(`/zone/${deptId}`); + } + }, [role]) + useEffect(()=>{ id && getDircList(); },[id]) 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); }) diff --git a/src/forge/Information/Pages/sourceCreate.jsx b/src/forge/Information/Pages/sourceCreate.jsx index 14c630333..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} = 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; @@ -20,6 +20,12 @@ function SourceCreate(props){ wrapperCol: { span: 14 }, }; + useEffect(()=>{ + if((role && role.role === "None") || (current_user && !current_user.login)){ + 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 e82f0c35f..599fdbd01 100644 --- a/src/forge/Information/index.jsx +++ b/src/forge/Information/index.jsx @@ -165,13 +165,13 @@ function Index(props){ ( - + )} > ( - + )} > ( - + )} > ( - + )} >