revert: 恢复 AddKnowledgePage 标签改动

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
wangdl 2026-06-06 18:15:51 +08:00
parent 4029da9c44
commit 9d0f426118

View File

@ -643,7 +643,7 @@ struct AddKnowledgePage: View {
ScrollView { VStack(spacing: 16) { ScrollView { VStack(spacing: 16) {
// //
VStack(alignment: .leading, spacing: 8) { VStack(alignment: .leading, spacing: 8) {
Text("内容来源").font(.system(size: 15, weight: .semibold)).foregroundColor(Color.zxF035) Text("内容来源").font(.system(size: 12, weight: .semibold)).foregroundColor(Color.zxF035)
Picker("", selection: $sourceType) { Picker("", selection: $sourceType) {
ForEach(SourceType.allCases, id: \.self) { t in Text(t.rawValue).tag(t) } ForEach(SourceType.allCases, id: \.self) { t in Text(t.rawValue).tag(t) }
} }
@ -654,14 +654,14 @@ struct AddKnowledgePage: View {
switch sourceType { switch sourceType {
case .manual: case .manual:
VStack(alignment: .leading, spacing: 8) { VStack(alignment: .leading, spacing: 8) {
Text("标题").font(.system(size: 15, weight: .semibold)).foregroundColor(Color.zxF035) Text("标题").font(.system(size: 12, weight: .semibold)).foregroundColor(Color.zxF035)
TextField("输入知识点标题", text: $title).font(.system(size: 16)).tint(Color.zxPurple) TextField("输入知识点标题", text: $title).font(.system(size: 16)).tint(Color.zxPurple)
.padding(.horizontal, 16).frame(height: 52) .padding(.horizontal, 16).frame(height: 52)
.background(Color.zxFill004).clipShape(RoundedRectangle(cornerRadius: 14)) .background(Color.zxFill004).clipShape(RoundedRectangle(cornerRadius: 14))
.overlay(RoundedRectangle(cornerRadius: 14).stroke(Color.zxBorder008, lineWidth: 1)) .overlay(RoundedRectangle(cornerRadius: 14).stroke(Color.zxBorder008, lineWidth: 1))
} }
VStack(alignment: .leading, spacing: 8) { VStack(alignment: .leading, spacing: 8) {
Text("内容").font(.system(size: 15, weight: .semibold)).foregroundColor(Color.zxF035) Text("内容").font(.system(size: 12, weight: .semibold)).foregroundColor(Color.zxF035)
TextEditor(text: $content) TextEditor(text: $content)
.frame(minHeight: 200).scrollContentBackground(.hidden).padding(12) .frame(minHeight: 200).scrollContentBackground(.hidden).padding(12)
.background(Color.zxFill004).clipShape(RoundedRectangle(cornerRadius: 14)) .background(Color.zxFill004).clipShape(RoundedRectangle(cornerRadius: 14))
@ -701,8 +701,7 @@ struct AddKnowledgePage: View {
ForEach(selectedFiles) { f in ForEach(selectedFiles) { f in
HStack(spacing: 8) { HStack(spacing: 8) {
Image(systemName: f.icon).foregroundColor(Color.zxGreen) Image(systemName: f.icon).foregroundColor(Color.zxGreen)
Text(f.name).font(.system(size: 15)).foregroundColor(Color.zxF0).lineLimit(1) Text(f.name).font(.system(size: 14)).foregroundColor(Color.zxF0).lineLimit(1)
.onTapGesture { UIPasteboard.general.string = f.name }
Spacer() Spacer()
Text(f.size).font(.system(size: 12)).foregroundColor(Color.zxF04) Text(f.size).font(.system(size: 12)).foregroundColor(Color.zxF04)
Button { Button {
@ -722,7 +721,7 @@ struct AddKnowledgePage: View {
Image(systemName: "info.circle").font(.system(size: 12)) Image(systemName: "info.circle").font(.system(size: 12))
Text("支持多选,每个文件生成一个知识点") Text("支持多选,每个文件生成一个知识点")
} }
.font(.system(size: 13)).foregroundColor(Color.zxF04) .font(.system(size: 12)).foregroundColor(Color.zxF04)
} }
if isUploading { if isUploading {
@ -1363,8 +1362,8 @@ struct EditKnowledgePage: View {
var body: some View { var body: some View {
ZStack { Color.zxBg0.ignoresSafeArea(); VStack(spacing: 0) { ZStack { Color.zxBg0.ignoresSafeArea(); VStack(spacing: 0) {
ScrollView { VStack(spacing: 16) { ScrollView { VStack(spacing: 16) {
VStack(alignment: .leading, spacing: 8) { Text("标题").font(.system(size: 15, weight: .semibold)).foregroundColor(Color.zxF035); TextField("", text: $title).font(.system(size: 16)).tint(Color.zxPurple).padding(.horizontal, 16).frame(height: 52).background(Color.zxFill004).clipShape(RoundedRectangle(cornerRadius: 14)).overlay(RoundedRectangle(cornerRadius: 14).stroke(Color.zxBorder008, lineWidth: 1)) } VStack(alignment: .leading, spacing: 8) { Text("标题").font(.system(size: 12, weight: .semibold)).foregroundColor(Color.zxF035); TextField("", text: $title).font(.system(size: 16)).tint(Color.zxPurple).padding(.horizontal, 16).frame(height: 52).background(Color.zxFill004).clipShape(RoundedRectangle(cornerRadius: 14)).overlay(RoundedRectangle(cornerRadius: 14).stroke(Color.zxBorder008, lineWidth: 1)) }
VStack(alignment: .leading, spacing: 8) { Text("内容").font(.system(size: 15, weight: .semibold)).foregroundColor(Color.zxF035); TextEditor(text: $content).frame(minHeight: 200).scrollContentBackground(.hidden).padding(12).background(Color.zxFill004).clipShape(RoundedRectangle(cornerRadius: 14)).overlay(RoundedRectangle(cornerRadius: 14).stroke(Color.zxBorder008, lineWidth: 1)) } VStack(alignment: .leading, spacing: 8) { Text("内容").font(.system(size: 12, weight: .semibold)).foregroundColor(Color.zxF035); TextEditor(text: $content).frame(minHeight: 200).scrollContentBackground(.hidden).padding(12).background(Color.zxFill004).clipShape(RoundedRectangle(cornerRadius: 14)).overlay(RoundedRectangle(cornerRadius: 14).stroke(Color.zxBorder008, lineWidth: 1)) }
Button { Button {
Task { _ = try? await KnowledgeItemService.shared.update(id: item.id, title: title, content: content, summary: nil) } Task { _ = try? await KnowledgeItemService.shared.update(id: item.id, title: title, content: content, summary: nil) }
} label: { Text("保存修改").font(.system(size: 14, weight: .bold)).foregroundColor(.white).frame(maxWidth: .infinity).frame(height: 52).background(ZXGradient.ctaPurple).clipShape(RoundedRectangle(cornerRadius: 16)) } } label: { Text("保存修改").font(.system(size: 14, weight: .bold)).foregroundColor(.white).frame(maxWidth: .infinity).frame(height: 52).background(ZXGradient.ctaPurple).clipShape(RoundedRectangle(cornerRadius: 16)) }