From 1fb2a8251cc938b65b8e74ac52a1b01a0c2443de Mon Sep 17 00:00:00 2001 From: lyp Date: Mon, 1 Sep 2025 16:17:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/head/Head.tsx | 287 ++++++++++++++++++++++++++++----------- src/layout/head/head.css | 79 +++++++++-- src/request/api.ts | 9 +- 3 files changed, 279 insertions(+), 96 deletions(-) diff --git a/src/layout/head/Head.tsx b/src/layout/head/Head.tsx index bd82899..a54adf7 100644 --- a/src/layout/head/Head.tsx +++ b/src/layout/head/Head.tsx @@ -138,7 +138,7 @@ import greenImg from '../../static/aiUse/green.png' // }, // ]; -import { DownOutlined, UserOutlined, QuestionCircleOutlined, BellOutlined, KeyOutlined, LogoutOutlined, GiftOutlined, AccountBookOutlined, ContainerOutlined, MenuFoldOutlined, UsergroupAddOutlined, TableOutlined, UpOutlined } from "@ant-design/icons"; +import { DownOutlined, UserOutlined, QuestionCircleOutlined, BellOutlined, KeyOutlined, LogoutOutlined, GiftOutlined, AccountBookOutlined, ContainerOutlined, MenuFoldOutlined, UsergroupAddOutlined, TableOutlined, UpOutlined, SearchOutlined } from "@ant-design/icons"; import { useContext, useEffect, useState, @@ -149,7 +149,7 @@ import { // post, getUseUrl } from "../../util/AjaxUtils.ts"; -import { getLoginflag, test, test1 } 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"; @@ -178,11 +178,12 @@ import aiUseNameBg from '../../static/aiUse/useNameback.png' import aiUseMatrixBg from '../../static/aiUse/useMatrixback.png' import con from '../../static/aiUse/contest.png' import closeImg from '../../static/aiUse/close.png' -import searchImg from '../../static/aiUse/search.png' +// import searchImg from '../../static/aiUse/search.png' import boxImg from '../../static/aiUse/box.png' const { TextArea } = Input; export default function Head() { + const aiNameArray = [ // { // key:'', @@ -1800,19 +1801,23 @@ export default function Head() { const [aiUseNameModal, setAiUseNameModal] = useState(false) const [componentKey, setComponentKey] = useState(1); // 控制组件重新加载的 key const [aiUseName, setAiUseName] = useState('') // 软件名称 - + const [aiUseNameResultArray, setAiUseNameResultArray] = useState([]) // 检查结果数组 + const [aiUseNameResultStatus, setAiUseNameResultStatus] = useState('') // 检查结果 + const [aiUseNameResultNames, setAiUseNameResultNames] = useState([]) // 推荐名字数组 const [clostNameExampleArray, setClostNameExampleArray] = useState([]) // 初始化Ai预审软件名称工具弹窗 const initAiUseNameModal = () => { setClostNameExampleArray([]) setComponentKey(1) setAiUseName('') - setUseShow(false) - + // setUseShow(false) + setAiUseNameResultArray([]) + setAiUseNameResultStatus('') + setAiUseNameResultNames([]) } const [aiUseNameSpin, setAiUseNameSpin] = useState(false) - const [useShow, setUseShow] = useState(false) + // const [useShow, setUseShow] = useState(false) const [aiUseResultName, setAiUseResultName] = useState('') // 软件名称 @@ -1868,12 +1873,15 @@ export default function Head() { const [matrixKey, setMatrixKey] = useState(2); // 控制组件重新加载的 key const [aiUseText, setAiUseText] = useState('') // 软件名称 const [clostMatrixExampleArray, setClostMatrixExampleArray] = useState([]) + const [aiUseMatrixSpin, setAiUseMatrixSpin] = useState(false) + const [aiUseMatrixResultArray, setAiUseMatrixResultArray] = useState([]) // 初始化AI软著矩阵规划工具弹窗 const initAiMatrixModal = () => { setClostMatrixExampleArray([]) setMatrixKey(2) setAiUseText('') - setUseShow(false) + setAiUseMatrixResultArray([]) + // setUseShow(false) } // -------------------------------------------------------------------------------------------- @@ -3123,6 +3131,8 @@ export default function Head() { width: '100vw', height: '100vh', }}> + +
{ - setAiUseNameModal(false) - initAiUseNameModal() + + if (aiUseNameSpin) { + message.error('正在检测中,请勿关闭') + } else { + setAiUseNameModal(false) + initAiUseNameModal() + } }} > @@ -3196,31 +3211,50 @@ export default function Head() { }} placeholder='请输入您的软件名称' allowClear + disabled={aiUseNameSpin} > + + {aiUseNameSpin ? '检查中...' : '开始检查'} +
@@ -3252,17 +3288,18 @@ export default function Head() { // marginTop: 200, } }> +
0 ? 'block' : 'none' }}> @@ -3313,9 +3350,9 @@ export default function Head() { }}>总体状态 通过 + >{aiUseNameResultStatus}
@@ -3337,12 +3374,18 @@ export default function Head() { -
{ + return ( +
- 嘻嘻嘻哈哈哈嘎嘎嘎嘎嘎 -
+ }} key={index}> + {item} +
+ ) + }) + } @@ -3375,44 +3418,59 @@ export default function Head() { marginTop: 20, }}> -
-
-
- -
字数检查
+ { + aiUseNameResultArray.map((item: any, index: number) => { + return ( +
+
+
+
+ +
+ {item.name} +
-
-
- 通过 -
-
-
字数符合要求(10字以内)
-
+
+ {item.status} +
+
+
{item.reason}
+
-
- 建议:请在项目名称末尾添加'软件'、'系统'、'平台'或 -
-
+ }}> +
+ 建议:{item.suggestion} +
+
+ +
+
+
+ ) + }) + } -
-
@@ -3549,6 +3607,7 @@ export default function Head() { + @@ -3595,8 +3654,13 @@ export default function Head() { }} title='关闭' onClick={() => { - setAiUseMatrixModal(false) - initAiMatrixModal() + + if (aiUseMatrixSpin) { + message.error('正在生成中,请勿关闭') + } else { + setAiUseMatrixModal(false) + initAiMatrixModal() + } }} > @@ -3671,6 +3735,8 @@ export default function Head() { }} placeholder='例:我们是一家做AI客服的SaaS公司,主营智能工单与知识库' allowClear + disabled={aiUseMatrixSpin} + >
+ {aiUseMatrixSpin ? '生成中...' : ' 生成矩阵材料'} + +
@@ -3729,7 +3828,7 @@ export default function Head() { style={{ - // display: useShow ? 'block' : 'none' + display: aiUseMatrixResultArray.length > 0 ? 'block' : 'none' }} @@ -3752,11 +3851,38 @@ export default function Head() {
-
+ { + aiUseMatrixResultArray.map((item: any, Index) => { + return ( +
+ +
{item.name}
+
+
+
设计理念
+ +
+
+ {item.description} + +
+ + +
+ ) + }) + } + + {/*
@@ -3764,10 +3890,7 @@ export default function Head() {
-
-
- -
+
*/}
diff --git a/src/layout/head/head.css b/src/layout/head/head.css index 545ffa9..9865f72 100644 --- a/src/layout/head/head.css +++ b/src/layout/head/head.css @@ -585,7 +585,8 @@ padding: 5px 15px; border-radius: 5px; } -.aiUseNameCheckLine{ + +.aiUseNameCheckLine { width: 100%; height: 1px; background-color: #E9E9E9; @@ -594,44 +595,100 @@ } -.aiUseNameCheckLineSmall{ - width: 100%; + +.aiUseNameCheckLineSmall { + width: 100%; height: 1px; background-color: #E9E9E9; margin-top: 20px; margin-bottom: 20px; } -.aiUseNameCheckSmall{ + +.aiUseNameCheckSmall { font-size: 18px; } -.aiUseNameCheckSmallText{ + +.aiUseNameCheckSmallText { font-size: 14px; - color:#727A85; + color: #727A85; margin-top: 10px; padding-left: 20px; } -.aiUseNameCheckSmallTextBox{ + +.aiUseNameCheckSmallTextBox { font-size: 14px; background-color: #fae3c4; - color:#e48602; + color: #e48602; padding: 5px 10px; box-sizing: border-box; border-left: 5px solid #e48602; max-width: 100%; } -.aiUseMatrixBigBox{ - background-color: skyblue; + +.aiUseMatrixBigBox { + /* background-color: skyblue; */ display: flex; flex-wrap: wrap; } -.aiUseMatrixSmallBoxItem{ + +.aiUseMatrixSmallBoxItem { margin-left: 10px; margin-top: 10px; width: 240px; height: 300px; + background-color: rgb(255, 255, 255); + border-radius: 10px; + border: 1px solid rgb(240, 240, 240); + border-top: 5px solid #FFC573; + padding: 15px; + box-sizing: border-box; +} +/* .aiUseMatrixSmallBoxItemTop{ background-color: pink; + height: 200px; +} */ +.aiUseMatrixSmallBoxItemTitle { + /* background-color: skyblue; */ + width: 100%; + overflow: hidden; + + font-size: 18px; + max-height: 48px; + display: -webkit-box; /* 弹性盒子模型 */ + -webkit-line-clamp: 2; /* 最多显示10行(根据字体大小和高度调整) */ + -webkit-box-orient: vertical; /* 垂直排列 */ + /* font-weight: 700; */ +} + +.aiUseMatrixSmallBoxItemDian { + width: 5px; + height: 5px; + background-color: #FFC573; + border-radius: 50%; + margin-right: 5px; + margin-top: 2px; +} + +.aiUseMatrixSmallBoxItemDianTitle { + color: #FFC573; + + +} +.aiUseMatrixSmallBoxItemContent { + + font-size: 14px; + color: #727A85; + margin-top: 10px; + height: 160px; /* 固定高度 */ + overflow: hidden; /* 隐藏超出部分 */ + /* background-color: skyblue; */ + + /* 新增多行文本溢出省略设置 */ + display: -webkit-box; /* 弹性盒子模型 */ + -webkit-line-clamp: 8; /* 最多显示10行(根据字体大小和高度调整) */ + -webkit-box-orient: vertical; /* 垂直排列 */ } \ No newline at end of file diff --git a/src/request/api.ts b/src/request/api.ts index 6b71155..538d2fe 100644 --- a/src/request/api.ts +++ b/src/request/api.ts @@ -39,7 +39,10 @@ export const updateInvoiceInfoByinvoiceRechargeId = (invoiceRechargeId: string, // 获取套餐包使用详情 export const getPackageDetail = (userId:string,packageOrderId:string,params:any) => request.get(`/operator-plugin/app/packageorderitem/listpagerelease/${userId}?packageOrderId=${packageOrderId}`, { params }) - +// //ai分析矩阵 +// export const getAiUseMatrix = (name:any) => request.get(`operator-plugin/app/query/sqlrelease/qf3a3c8c?content=${name}`) +// //ai分析系统名称 +// export const getAiUseName = (name:any) => request.get(`operator-plugin/app/query/sqlrelease/q4ddb993?content=${name}`) //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -249,6 +252,6 @@ export const supplementTrademarkData = (params:any) => aiShopRequest.post(`/aish // 线上测试----------------------------------------------------------------------------------------- -export const test = (name:any) => onLineRequest.get(`operator-plugin/app/query/sqlrelease/qf3a3c8c?content=${name}`) -export const test1 = (name:any) => onLineRequest.get(`operator-plugin/app/query/sqlrelease/q4ddb993?content=${name}`) +export const getAiUseMatrix = (name:any) => onLineRequest.get(`operator-plugin/app/query/sqlrelease/qf3a3c8c?content=${name}`) +export const getAiUseName = (name:any) => onLineRequest.get(`operator-plugin/app/query/sqlrelease/q4ddb993?content=${name}`)