Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
1bf98a4b
Commit
1bf98a4b
authored
Dec 04, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// AI
parent
4b4152ad
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
4 deletions
+46
-4
YHAutoTextView.swift
galaxy/galaxy/Classes/Base/V/YHAutoTextView.swift
+1
-1
YHAIMainChatViewController.swift
...s/AI/AI-Dialogue(AI对话)/C/YHAIMainChatViewController.swift
+5
-0
YHAIRobotChatViewController.swift
.../AI/AI-Dialogue(AI对话)/C/YHAIRobotChatViewController.swift
+5
-1
YHAITextMessageCell.swift
.../Modules/AI/AI-Dialogue(AI对话)/V/YHAITextMessageCell.swift
+35
-2
No files found.
galaxy/galaxy/Classes/Base/V/YHAutoTextView.swift
View file @
1bf98a4b
...
@@ -20,7 +20,7 @@ class YHAutoTextView: UITextView, UITextViewDelegate {
...
@@ -20,7 +20,7 @@ class YHAutoTextView: UITextView, UITextViewDelegate {
}
}
}
}
let
maxHeight
=
6
0.0
let
maxHeight
=
8
0.0
static
let
verticalGap
=
5.0
static
let
verticalGap
=
5.0
var
placeHolder
:
String
=
""
{
var
placeHolder
:
String
=
""
{
didSet
{
didSet
{
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/C/YHAIMainChatViewController.swift
View file @
1bf98a4b
...
@@ -190,6 +190,10 @@ class YHAIMainChatViewController: YHBaseViewController {
...
@@ -190,6 +190,10 @@ class YHAIMainChatViewController: YHBaseViewController {
}
}
@objc
func
didCleanButtonClicked
()
{
@objc
func
didCleanButtonClicked
()
{
YHCommonAlertView
.
show
(
"删除历史记录"
,
"删除后记录无法恢复"
,
"取消"
,
"删除"
,
fullGuestureEnable
:
false
)
{
}
callBack
:
{
self
.
manager
.
clearGlobalConverastionId
()
self
.
manager
.
clearGlobalConverastionId
()
self
.
viewModel
.
requestConversationId
{
sessionId
in
self
.
viewModel
.
requestConversationId
{
sessionId
in
if
!
sessionId
.
isEmpty
{
if
!
sessionId
.
isEmpty
{
...
@@ -201,6 +205,7 @@ class YHAIMainChatViewController: YHBaseViewController {
...
@@ -201,6 +205,7 @@ class YHAIMainChatViewController: YHBaseViewController {
}
}
}
}
}
}
}
}
}
extension
YHAIMainChatViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
extension
YHAIMainChatViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/C/YHAIRobotChatViewController.swift
View file @
1bf98a4b
...
@@ -206,7 +206,10 @@ class YHAIRobotChatViewController: YHBaseViewController {
...
@@ -206,7 +206,10 @@ class YHAIRobotChatViewController: YHBaseViewController {
@objc
func
didCleanButtonClicked
()
{
@objc
func
didCleanButtonClicked
()
{
self
.
manager
.
clearLobalSubRobotConversationIdForRobotId
(
robotId
)
YHCommonAlertView
.
show
(
"删除历史记录"
,
"删除后记录无法恢复"
,
"取消"
,
"删除"
,
fullGuestureEnable
:
false
)
{
}
callBack
:
{
self
.
manager
.
clearLobalSubRobotConversationIdForRobotId
(
self
.
robotId
)
self
.
viewModel
.
requestConversationId
{
sessionId
in
self
.
viewModel
.
requestConversationId
{
sessionId
in
if
!
sessionId
.
isEmpty
{
if
!
sessionId
.
isEmpty
{
self
.
conversationId
=
sessionId
self
.
conversationId
=
sessionId
...
@@ -217,6 +220,7 @@ class YHAIRobotChatViewController: YHBaseViewController {
...
@@ -217,6 +220,7 @@ class YHAIRobotChatViewController: YHBaseViewController {
}
}
}
}
}
}
}
}
}
extension
YHAIRobotChatViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
extension
YHAIRobotChatViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/V/YHAITextMessageCell.swift
View file @
1bf98a4b
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
//
//
import
UIKit
import
UIKit
import
Lottie
class
YHAITextMessageCell
:
UITableViewCell
{
class
YHAITextMessageCell
:
UITableViewCell
{
...
@@ -39,6 +40,7 @@ class YHAITextMessageCell: UITableViewCell {
...
@@ -39,6 +40,7 @@ class YHAITextMessageCell: UITableViewCell {
}
}
isNeedShowCopyView
=
false
isNeedShowCopyView
=
false
isNeedShowLoadingView
=
false
}
else
{
}
else
{
...
@@ -62,9 +64,12 @@ class YHAITextMessageCell: UITableViewCell {
...
@@ -62,9 +64,12 @@ class YHAITextMessageCell: UITableViewCell {
if
message
.
getType
()
==
.
recommendText
{
if
message
.
getType
()
==
.
recommendText
{
isNeedShowCopyView
=
false
isNeedShowCopyView
=
false
isNeedShowLoadingView
=
false
}
else
{
}
else
{
isNeedShowCopyView
=
message
.
isDone
isNeedShowCopyView
=
message
.
isDone
let
complete
=
message
.
isCompleted
()
||
message
.
isDone
isNeedShowLoadingView
=
!
complete
}
}
}
}
...
@@ -79,13 +84,25 @@ class YHAITextMessageCell: UITableViewCell {
...
@@ -79,13 +84,25 @@ class YHAITextMessageCell: UITableViewCell {
copyContentView
.
snp
.
remakeConstraints
{
make
in
copyContentView
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
equalTo
(
0
)
make
.
left
.
equalTo
(
0
)
make
.
right
.
equalTo
(
0
)
make
.
right
.
equalTo
(
0
)
make
.
top
.
equalTo
(
messageLabel
.
snp
.
bottom
)
.
offset
(
16
)
make
.
top
.
equalTo
(
loadingImgView
.
snp
.
bottom
)
.
offset
(
16
)
make
.
height
.
equalTo
(
isNeedShowCopyView
?
37.0
:
0.0
)
make
.
height
.
equalTo
(
isNeedShowCopyView
?
37.0
:
0.0
)
make
.
bottom
.
equalTo
(
0
)
make
.
bottom
.
equalTo
(
0
)
}
}
}
}
}
}
var
isNeedShowLoadingView
:
Bool
=
false
{
didSet
{
loadingImgView
.
isHidden
=
!
isNeedShowLoadingView
loadingImgView
.
snp
.
remakeConstraints
{
make
in
make
.
right
.
equalTo
(
-
16
)
make
.
width
.
equalTo
(
26
)
make
.
height
.
equalTo
(
isNeedShowLoadingView
?
18
:
0
)
make
.
top
.
equalTo
(
messageLabel
.
snp
.
bottom
)
.
offset
(
isNeedShowLoadingView
?
6
:
0
)
}
}
}
lazy
var
whiteContentView
:
UIView
=
{
lazy
var
whiteContentView
:
UIView
=
{
let
v
=
UIView
()
let
v
=
UIView
()
v
.
backgroundColor
=
.
white
v
.
backgroundColor
=
.
white
...
@@ -156,6 +173,14 @@ class YHAITextMessageCell: UITableViewCell {
...
@@ -156,6 +173,14 @@ class YHAITextMessageCell: UITableViewCell {
return
v
return
v
}()
}()
let
loadingImgView
:
LottieAnimationView
!
=
{
let
lottieView
=
LottieAnimationView
(
name
:
"ai_chat_loading"
)
lottieView
.
loopMode
=
.
loop
lottieView
.
contentMode
=
.
scaleAspectFit
lottieView
.
play
()
return
lottieView
}()
@objc
func
didCopyTextButtonClicked
()
{
@objc
func
didCopyTextButtonClicked
()
{
let
text
=
message
.
body
.
contentText
let
text
=
message
.
body
.
contentText
let
pasteBoard
=
UIPasteboard
.
general
let
pasteBoard
=
UIPasteboard
.
general
...
@@ -186,6 +211,7 @@ class YHAITextMessageCell: UITableViewCell {
...
@@ -186,6 +211,7 @@ class YHAITextMessageCell: UITableViewCell {
contentView
.
addSubview
(
rightAngleView
)
contentView
.
addSubview
(
rightAngleView
)
contentView
.
addSubview
(
whiteContentView
)
contentView
.
addSubview
(
whiteContentView
)
whiteContentView
.
addSubview
(
messageLabel
)
whiteContentView
.
addSubview
(
messageLabel
)
whiteContentView
.
addSubview
(
loadingImgView
)
whiteContentView
.
addSubview
(
copyContentView
)
whiteContentView
.
addSubview
(
copyContentView
)
shadowView
.
snp
.
makeConstraints
{
make
in
shadowView
.
snp
.
makeConstraints
{
make
in
...
@@ -210,9 +236,16 @@ class YHAITextMessageCell: UITableViewCell {
...
@@ -210,9 +236,16 @@ class YHAITextMessageCell: UITableViewCell {
make
.
top
.
equalTo
(
16
)
make
.
top
.
equalTo
(
16
)
}
}
loadingImgView
.
snp
.
makeConstraints
{
make
in
make
.
right
.
equalTo
(
-
16
)
make
.
width
.
equalTo
(
26
)
make
.
height
.
equalTo
(
18
)
make
.
top
.
equalTo
(
messageLabel
.
snp
.
bottom
)
.
offset
(
6
)
}
copyContentView
.
snp
.
makeConstraints
{
make
in
copyContentView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
0
)
make
.
left
.
equalTo
(
0
)
make
.
top
.
equalTo
(
messageLabel
.
snp
.
bottom
)
.
offset
(
16
)
make
.
top
.
equalTo
(
loadingImgView
.
snp
.
bottom
)
.
offset
(
16
)
make
.
height
.
equalTo
(
0
)
make
.
height
.
equalTo
(
0
)
make
.
bottom
.
equalTo
(
0
)
make
.
bottom
.
equalTo
(
0
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment