暂存
This commit is contained in:
parent
7461da0dc4
commit
2a9a3aadaa
@ -152,7 +152,7 @@ import {
|
||||
// post,
|
||||
getUseUrl
|
||||
} from "../../util/AjaxUtils.ts";
|
||||
import { getLoginflag, getAiUseName, getAiUseMatrix } from '../../request/api'
|
||||
import { getLoginflag, getAiUseName, getAiUseMatrix } from '../../request/api'
|
||||
|
||||
import { GlobalContext, GlobalDispatchContext, reloadUser } from "../../context/GlobalContext.ts";
|
||||
import UserEdit from "../../components/user/UserEdit.tsx";
|
||||
@ -1825,6 +1825,25 @@ export default function Head() {
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
// 查看字符串长度是否大雨30和小于8 如果大雨30返回big 小于8返回small 介于8到30之间返回normal
|
||||
const checkNameLength = (name: string) => {
|
||||
if (name.length > 30) {
|
||||
return 'big'
|
||||
} else if (name.length < 8) {
|
||||
return 'small'
|
||||
} else {
|
||||
return 'normal'
|
||||
}
|
||||
}
|
||||
// 定义一个函数查看字符串是否以“软件”、“系统”、“平台”、“APP”或“小程序”结尾 如果是返回true 否则返回false
|
||||
const checkNameEnd = (name: string) => {
|
||||
if (name.endsWith('软件') || name.endsWith('系统') || name.endsWith('平台') || name.endsWith('APP') || name.endsWith('小程序')) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const useItem: MenuProps['items'] = [
|
||||
{
|
||||
@ -3353,9 +3372,9 @@ export default function Head() {
|
||||
}}>总体状态</span>
|
||||
<span className='aiUseNameChecStatus'
|
||||
style={{
|
||||
background: aiUseNameResultStatus === '通过' ? '#39B551' : '#FF4D4F'
|
||||
background: aiUseNameResultStatus === '通过' && checkNameLength(aiUseResultName) === 'normal' && checkNameEnd(aiUseResultName) ? '#39B551' : '#FF4D4F'
|
||||
}}
|
||||
>{aiUseNameResultStatus}</span>
|
||||
>{aiUseNameResultStatus == '通过' && checkNameLength(aiUseResultName) === 'normal' && checkNameEnd(aiUseResultName) ? '通过' : '不通过'}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -3421,6 +3440,114 @@ export default function Head() {
|
||||
marginTop: 20,
|
||||
|
||||
}}>
|
||||
<div >
|
||||
<div>
|
||||
<div style={{
|
||||
display: 'flex',
|
||||
justifyContent: 'space-between',
|
||||
alignItems: 'center',
|
||||
}}>
|
||||
<div style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
}}>
|
||||
<img
|
||||
src={checkNameLength(aiUseResultName) === 'normal' ? greenImg : redImg} alt="" height={18}
|
||||
style={{
|
||||
marginRight: 5,
|
||||
marginTop: 3,
|
||||
}}
|
||||
/>
|
||||
<div className='aiUseNameCheckSmall'>
|
||||
{/* {item.name} */}
|
||||
字数检查
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<span className='aiUseNameChecStatus'
|
||||
style={{
|
||||
background: checkNameLength(aiUseResultName) === 'normal' ? '#39B551' : '#FF4D4F'
|
||||
}}
|
||||
>
|
||||
{checkNameLength(aiUseResultName) === 'normal' ? '通过' : '不通过'}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className='aiUseNameCheckSmallText'>
|
||||
{checkNameLength(aiUseResultName) === 'normal' ? `字数符合要求(${aiUseResultName.length}个汉字)` : checkNameLength(aiUseResultName) === 'small' ? `字数过少(${aiUseResultName.length}个汉字,要求8-30个)` : `字数过多(${aiUseResultName.length}个汉字,要求8-30个)`}
|
||||
</div>
|
||||
<div style={{
|
||||
marginTop: 10,
|
||||
paddingLeft: 20,
|
||||
|
||||
}}>
|
||||
<div className='aiUseNameCheckSmallTextBox' style={{
|
||||
display: checkNameLength(aiUseResultName) === 'normal' ? 'none' : 'block'
|
||||
}}>
|
||||
建议:{checkNameLength(aiUseResultName) === 'small' ? `请增加项目名称的描述内容,使其达到8个汉字以上` : checkNameLength(aiUseResultName) === 'big' ? `请简化项目名称,使其控制在30个汉字以内` : ''}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div className='aiUseNameCheckLineSmall' style={{
|
||||
|
||||
}}></div>
|
||||
</div>
|
||||
<div >
|
||||
<div>
|
||||
<div style={{
|
||||
display: 'flex',
|
||||
justifyContent: 'space-between',
|
||||
alignItems: 'center',
|
||||
}}>
|
||||
<div style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
}}>
|
||||
<img
|
||||
src={checkNameEnd(aiUseResultName) ? greenImg : redImg} alt="" height={18}
|
||||
style={{
|
||||
marginRight: 5,
|
||||
marginTop: 3,
|
||||
}}
|
||||
/>
|
||||
<div className='aiUseNameCheckSmall'>
|
||||
{/* {item.name} */}
|
||||
结尾词检查
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<span className='aiUseNameChecStatus'
|
||||
style={{
|
||||
background: checkNameEnd(aiUseResultName) ? '#39B551' : '#FF4D4F'
|
||||
}}
|
||||
>
|
||||
{checkNameEnd(aiUseResultName) ? '通过' : '不通过'}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className='aiUseNameCheckSmallText'>
|
||||
{checkNameEnd(aiUseResultName) ? '结尾词符合要求' : '未使用规范的结尾词'}
|
||||
</div>
|
||||
<div style={{
|
||||
marginTop: 10,
|
||||
paddingLeft: 20,
|
||||
|
||||
}}>
|
||||
<div className='aiUseNameCheckSmallTextBox' style={{
|
||||
display: checkNameEnd(aiUseResultName) ? 'none' : 'block'
|
||||
}}>
|
||||
建议:请在项目名称末尾添加“软件”、“系统”、“平台”、“APP”或“小程序”等词汇
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div className='aiUseNameCheckLineSmall' style={{
|
||||
|
||||
}}></div>
|
||||
</div>
|
||||
{
|
||||
aiUseNameResultArray.map((item: any, index: number) => {
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user