Commit 64ff978a authored by xuchaozou's avatar xuchaozou

fix: 修复菜单

parent 32ff219e
Pipeline #85788 passed with stages
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
"@wisdom-map/arcgismap": "1.4.0-261", "@wisdom-map/arcgismap": "1.4.0-261",
"@wisdom-map/basemap": "1.1.0-41", "@wisdom-map/basemap": "1.1.0-41",
"@wisdom-map/util": "^1.0.28-0", "@wisdom-map/util": "^1.0.28-0",
"@wisdom-utils/components": "0.1.350", "@wisdom-utils/components": "0.1.351",
"@wisdom-utils/runtime": "0.0.48", "@wisdom-utils/runtime": "0.0.48",
"@wisdom-utils/utils": "0.1.388", "@wisdom-utils/utils": "0.1.388",
"@congcongcai/jieba.js" : "0.0.3", "@congcongcai/jieba.js" : "0.0.3",
......
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
...@@ -12,7 +12,17 @@ const Dialog = props => { ...@@ -12,7 +12,17 @@ const Dialog = props => {
const { pandaRecordWebSocketRef} = props const { pandaRecordWebSocketRef} = props
const ulRef = useRef(null) const ulRef = useRef(null)
const directiveRef = useRef(null) const directiveRef = useRef(null)
const [data , setData] = useState([]) const [data , setData] = useState([
// {
// role : "user",
// content : "打开模型大建材,打开模型大建材。打开模型大建材。",
// time: new moment().format("HH:mm:ss"),
// },{
// role : "system",
// content : "没有开启增强人机交互,系统正在学习更多指令中。",
// time: new moment().format("HH:mm:ss"),
// }
])
const finish = useCallback(async ({resultText}) => { const finish = useCallback(async ({resultText}) => {
pandaRecordWebSocketRef.current.setStatus("pause") pandaRecordWebSocketRef.current.setStatus("pause")
...@@ -123,7 +133,7 @@ const Dialog = props => { ...@@ -123,7 +133,7 @@ const Dialog = props => {
<div className={style.header}> <div className={style.header}>
<p>熊猫智能语音库</p> <p>熊猫智能语音库</p>
<div className={style.help}> <div className={style.help}>
<QuestionCircleOutlined className={style.question} /> <span className={style.helpIcon}></span>
<div className={style.toolTipContent}> <div className={style.toolTipContent}>
<p>支持以下语音指令集</p> <p>支持以下语音指令集</p>
<ul className={style.toolTip}> <ul className={style.toolTip}>
......
@imageRoot : "@/assets/images/soundAi/";
.getImage(@imageName) {
background: url("@{imageRoot}/@{imageName}") no-repeat center center;
background-size: 100% 100%;
}
.container { .container {
position: absolute; position: absolute;
right: 80px; right: 80px;
width: 350px; width: 395px;
height: 400px; height: 435px;
background-color: #fff; bottom: -150px;
bottom: 0;
border-radius: 5px; border-radius: 5px;
box-shadow: 2px 2px #e6e0e0;
z-index: 10; z-index: 10;
.getImage("框.png");
padding: 15px 20px;
.main { .main {
position: relative; position: relative;
...@@ -23,17 +30,38 @@ ...@@ -23,17 +30,38 @@
display: flex; display: flex;
align-items: center; align-items: center;
padding-left: 10px; padding-left: 10px;
height: 40px; height: 50px;
border-bottom: 1px solid #eee; // border-bottom: 1px solid #eee;
justify-content: space-between; justify-content: space-between;
>p { >p {
margin-bottom: 0; margin: 10px 0 0 65px;
position: relative;
letter-spacing: 0.5px;
color: #fff;
&::before {
content: "";
position: absolute;
left: -35px;
top: 50%;
transform: translateY(-50%);
width: 28px;
height: 30px;
.getImage("录音icon.png");
}
} }
.help { .help {
position: relative; position: relative;
margin-right: 20px; margin-right: 30px;
margin-top: 5px;
.helpIcon{
display: flex;
width: 22px;
height: 22px;
.getImage("帮助.png");
}
&:hover { &:hover {
cursor: pointer; cursor: pointer;
...@@ -50,7 +78,7 @@ ...@@ -50,7 +78,7 @@
right: 0; right: 0;
font-weight: normal; font-weight: normal;
font-size: 14px; font-size: 14px;
background: #f5f5f5; // background: #f5f5f5;
padding: 0 10px; padding: 0 10px;
border-radius: 5px; border-radius: 5px;
z-index: 10; z-index: 10;
...@@ -86,7 +114,7 @@ ...@@ -86,7 +114,7 @@
.display { .display {
width: 100%; width: 100%;
height: auto; height: auto;
background-color: #eee; // background-color: #eee;
.ul { .ul {
padding: 5px 5px 15px 5px; padding: 5px 5px 15px 5px;
...@@ -107,7 +135,7 @@ ...@@ -107,7 +135,7 @@
.aiContent { .aiContent {
flex: 1; flex: 1;
background-color: #fff; // background-color: #fff;
border-radius: 4px; border-radius: 4px;
padding: 5px; padding: 5px;
color: #000; color: #000;
...@@ -125,7 +153,7 @@ ...@@ -125,7 +153,7 @@
font-size: 12px; font-size: 12px;
color: #797070; color: #797070;
border-radius: 2px; border-radius: 2px;
background-color: #dbd3d3; // background-color: #dbd3d3;
} }
} }
...@@ -138,21 +166,7 @@ ...@@ -138,21 +166,7 @@
} }
} }
// .empty {
// width: 100%;
// height: 100%;
// display: flex;
// align-items: center;
// justify-content: center;
// }
} }
// .footer {
// display: flex;
// width: 100%;
// height: 40px;
// align-items: center;
// padding-left: 5px;
// }
} }
} }
\ No newline at end of file
import { useCallback, useEffect, useRef, useState } from 'react' import { useCallback, useEffect, useRef, useState } from 'react'
import style from './style.less' import style from './style.less'
import image from '@/assets/images/soundAi/熊猫.gif' import image from '@/assets/images/soundAi/眨眼.gif'
import {event} from '@wisdom-utils/utils' import { event } from '@wisdom-utils/utils'
import { AwakenDirective , ByeDirective, Directive} from '../../core' import { AwakenDirective, ByeDirective, Directive } from '../../core'
import Dialog from '../Dialog' import Dialog from '../Dialog'
const PandaTip = props => { const PandaTip = props => {
const [status, setStatus] = useState("close") const [status, setStatus] = useState("close")
const directiveRef = useRef(null) const directiveRef = useRef(null)
const {pandaRecordWebSocketRef} = props const { pandaRecordWebSocketRef } = props
const finish = useCallback(({resultText}) => { const finish = useCallback(({ resultText }) => {
const directive = directiveRef.current.parse({ const directive = directiveRef.current.parse({
text : resultText text: resultText
}) })
if(!directive) return null if (!directive) return null
if(directive instanceof AwakenDirective && status == "close") { if (directive instanceof AwakenDirective && status == "close") {
setStatus("open") setStatus("open")
} else if(directive instanceof ByeDirective && status == "open") { } else if (directive instanceof ByeDirective && status == "open") {
setStatus("close") setStatus("close")
} }
}, [status]) }, [status])
useEffect(() => { useEffect(() => {
directiveRef.current = new Directive({ directiveRef.current = new Directive({
directiveTypes : [AwakenDirective , ByeDirective], directiveTypes: [AwakenDirective, ByeDirective],
}) })
}, []) }, [])
...@@ -36,9 +36,13 @@ const PandaTip = props => { ...@@ -36,9 +36,13 @@ const PandaTip = props => {
}, [status]) }, [status])
return (<div className={style.container}> return (<div className={style.container}>
<img src = {image} className={style.image} />
{ {
status == "open" ? <Dialog pandaRecordWebSocketRef = {pandaRecordWebSocketRef}/> : null status == "open" ? <Dialog pandaRecordWebSocketRef={pandaRecordWebSocketRef} /> : <div className={style.content}>
<div className={style.tipImage}>
<span>呼叫“熊猫熊猫”唤醒语音小助手。</span>
</div>
<img src={image} className={style.image} />
</div>
} }
</div>) </div>)
} }
......
.container{ @imageRoot : "@/assets/images/soundAi/";
.getImage(@imageName) {
background: url("@{imageRoot}/@{imageName}") no-repeat center center;
background-size: 100% 100%;
}
.container {
position: absolute; position: absolute;
right: 50px; right: 0px;
bottom: 50px; bottom: 150px;
z-index: 9999; z-index: 9999;
.image{
width: 80px; .content {
height: 80px; position: relative;
&:hover{ .tipImage{
position: absolute;
right: 55px;
top: 50%;
transform: translateY(-50%);
width: 167px;
height: 66px;
.getImage("气泡框.png");
display: flex;
justify-content: center;
align-items: center;
span {
display: flex;
height: 68%;
width: 68%;
font-size: 13px;
color: #fff;
}
}
.image {
width: 65px;
height: 108px;
&:hover {
cursor: pointer; cursor: pointer;
} }
} }
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment