Quellcode durchsuchen

feat: 左滑删除知识库项

王晓东 vor 1 Woche
Ursprung
Commit
f280c6e1cd
52 geänderte Dateien mit 778 neuen und 629 gelöschten Zeilen
  1. 3 59
      src/app.less
  2. 18 0
      src/components/BlurContainer/index.module.less
  3. 23 0
      src/components/BlurContainer/index.tsx
  4. 17 1
      src/components/UploaderGrid/index.tsx
  5. 1 1
      src/components/card/card-editable/index.module.less
  6. 1 1
      src/components/card/card-editable/index.tsx
  7. 5 4
      src/components/component-list/components/card-link/index.tsx
  8. 5 2
      src/components/component-list/components/card-tel/index.tsx
  9. 9 11
      src/components/component-list/components/card-title/index.tsx
  10. 17 8
      src/components/component-list/components/new-comp-button/index.tsx
  11. 2 2
      src/components/list/FigureListItem/index.tsx
  12. 5 9
      src/components/rotate-loading/index.module.less
  13. 8 2
      src/components/rotate-loading/index.tsx
  14. 1 0
      src/components/slide-delete/index.wxss
  15. 4 4
      src/components/wemeta-tabs/index.tsx
  16. 29 7
      src/components/widgets/widget-card/index.tsx
  17. 3 0
      src/components/widgets/widget-media/index.tsx
  18. 7 0
      src/components/widgets/widget-type-row/index.module.less
  19. 2 2
      src/components/widgets/widget-type-row/index.tsx
  20. 10 0
      src/images/svgs/IconPlayWhite12.svg
  21. 6 0
      src/images/svgs/knowledge/IconCorrect.svg
  22. 6 0
      src/images/svgs/knowledge/IconError.svg
  23. 3 0
      src/images/svgs/website/IconChange.svg
  24. 3 0
      src/images/svgs/website/IconDelete.svg
  25. 3 0
      src/images/svgs/website/IconDown.svg
  26. 3 0
      src/images/svgs/website/IconPlus.svg
  27. 5 0
      src/images/svgs/website/IconUp.svg
  28. 15 8
      src/pages/component-library/components/createComponentData.ts
  29. 58 63
      src/pages/contact/index.tsx
  30. 4 6
      src/pages/dashboard/index.tsx
  31. 2 0
      src/pages/editor-pages/editor-greeting/index.tsx
  32. 3 1
      src/pages/editor-pages/editor-personality/index.tsx
  33. 1 1
      src/pages/editor-pages/editor-tel/index.tsx
  34. 1 1
      src/pages/editor-pages/editor-title/index.tsx
  35. 2 2
      src/pages/knowledge-item/index.tsx
  36. 62 47
      src/pages/knowledge/components/CompanyTab/components/ScrollList.tsx
  37. 3 3
      src/pages/knowledge/components/CompanyTab/components/ScrollListChat.tsx
  38. 10 6
      src/pages/knowledge/components/CompanyTab/index.tsx
  39. 0 89
      src/pages/knowledge/components/CorrectionList/index.tsx
  40. 23 58
      src/pages/knowledge/components/CorrectionTab/components/CorrectionList.tsx
  41. 157 0
      src/pages/knowledge/components/CorrectionTab/components/CorrectionListChat.tsx
  42. 96 0
      src/pages/knowledge/components/CorrectionTab/index.tsx
  43. 0 146
      src/pages/knowledge/components/PersonalTab/components/ScrollList-slide-delete.tsx
  44. 86 56
      src/pages/knowledge/components/PersonalTab/components/ScrollList.tsx
  45. 4 4
      src/pages/knowledge/components/PersonalTab/components/ScrollListChat.tsx
  46. 12 12
      src/pages/knowledge/components/PersonalTab/index.tsx
  47. 4 4
      src/pages/knowledge/components/StyleFilter/index.tsx
  48. 1 0
      src/pages/knowledge/index.module.less
  49. 7 8
      src/pages/knowledge/index.tsx
  50. 10 0
      src/styles/_iconfont.less
  51. 1 1
      tsconfig.json
  52. 17 0
      types/custom-components.d.ts

+ 3 - 59
src/app.less

@@ -1,57 +1,24 @@
 @import 'tailwindcss/base';
 @import 'tailwindcss/components';
 @import 'tailwindcss/utilities';
-@import './styles/iconfont.less';
 @import './styles/_vars.less';
 
-:root{
-  font-family: PingFangSC-Medium;
-  // 主题色
-  --color-primary: #317CFA;
-  --color-primary-rgb: 49, 124, 250;
-  --color-primary-light: rgba(49, 124, 250, 0.1);
-  --color-primary-dark: #1E6FF8;
-  --color-text-primary: #262626;
-  --color-bg-primary: #F4F9FF;
-  --color-bg-gray: #F4F9FF;
-  
-}
-
 /* 确保变量定义在全局作用域 */
-page {
+/* 为 RootPortal 容器单独定义变量 */
+:root, .taro-portal-container, page  {
   font-family: PingFangSC-Medium;
-  // 主题色
   --color-primary: #317CFA;
   --color-primary-rgb: 49, 124, 250;
   --color-primary-light: rgba(49, 124, 250, 0.1);
   --color-primary-dark: #1E6FF8;
   --color-text-primary: #262626;
-  --color-text-title: #111A34;;
   --color-bg-primary: #F4F9FF;
   --color-bg-gray: #F4F9FF;
 }
-
-/* 为 RootPortal 容器单独定义变量 */
-.taro-portal-container {
-  --color-primary: #317CFA;
-  --color-primary-rgb: 49, 124, 250;
-  --color-primary-light: rgba(49, 124, 250, 0.1);
-  --color-primary-dark: #1E6FF8;
-  --color-text-primary: #262626;
-  --color-text-title: #111A34;;
-  --color-bg-primary: #F6F6F6;
-  --color-bg-gray: #F6F6F6;
-}
 .taro-portal-container-ztop{
   z-index: 10000;
 }
-/* 在线链接服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
-@font-face {
-  font-family: 'font_family';  /* Project id 4668063 */
-  src: url('//at.alicdn.com/t/c/font_4668063_9cn2cmbc63i.woff2?t=1725011811061') format('woff2'),
-       url('//at.alicdn.com/t/c/font_4668063_9cn2cmbc63i.woff?t=1725011811061') format('woff'),
-       url('//at.alicdn.com/t/c/font_4668063_9cn2cmbc63i.ttf?t=1725011811061') format('truetype');
-}
+
 .w-full{
   box-sizing: border-box;
 }
@@ -104,28 +71,6 @@ page {
   background-color: var(--color-bg-primary);
 }
 
-.icon-24{
-  .iconfont();
-  width: 24px;
-  height: 24px;
-  font-size: 24px;
-}
-.icon-24-fill{
-  .iconfont();
-  width: 24px;
-  height: 24px;
-  font-size: 24px;
-  .bg-primary-color();
-  border-radius: 4px;
-}
-.icon-box{
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  border-radius: 4px;
-  background-color: var(--color-primary);
-}
-
 
 // text
 
@@ -463,4 +408,3 @@ page {
 }
 
 
-

+ 18 - 0
src/components/BlurContainer/index.module.less

@@ -0,0 +1,18 @@
+.blurBgContainer{
+  position: absolute;
+  z-index: 1;
+  left: 0;
+  top: 0;
+  right: 0;
+  width: 100%;
+  height: 100%;
+  border-top: 1px solid #fff;
+  border-radius: 20px 20px 0 0;
+}
+.blurBg{
+  width: 100%;
+  height: 100%;
+  background-image: linear-gradient(180deg, #ffffff99 0%, #ffffff00 100%);
+  border-radius: 20px 20px 0 0;
+  filter: blur(15px);
+}

+ 23 - 0
src/components/BlurContainer/index.tsx

@@ -0,0 +1,23 @@
+import { View } from "@tarojs/components";
+
+import style from "./index.module.less";
+
+export interface IndexProps {
+  children: JSX.Element | JSX.Element[];
+  className?: string
+};
+
+const Index = ({ className='', children }: IndexProps) => {
+  return (
+    <View className={`flex flex-col h-full w-full relative ${className}`}>
+      <View className={style.blurBgContainer}>
+        <View className={style.blurBg}></View>
+      </View>
+      <View className="h-full relative z-10">
+        {children}
+      </View>
+    </View>
+  );
+};
+
+export default Index

+ 17 - 1
src/components/UploaderGrid/index.tsx

@@ -4,6 +4,7 @@ import style from "./index.module.less";
 import IconDeleteGray16 from "@/components/icon/IconDeleteGray16";
 import IconPlusGray16 from "@/components/icon/IconPlusGray16";
 import type { TMediaType } from "@/types/index";
+import Taro from "@tarojs/taro";
 
 
 export interface IndexProps {
@@ -15,6 +16,21 @@ export interface IndexProps {
 
 const Index = ({onNewUpload, list, onChange, onDelete }: IndexProps) => {
   
+  // 预览媒体
+  const handlePreview = (e: any, index: number, item: TMediaType) => {
+    console.log(index, item,3333)
+    e.stopPropagation();
+    Taro.previewMedia({
+      current: index,
+      //@ts-ignore
+      sources: list.map((item) => {
+        return {
+          url: item.url,
+          type: item.fileType,
+        }
+      }),
+    })
+  };
   
   return (
     <View className="grid grid-cols-3 gap-x-8 gap-y-12 justify-center">
@@ -25,7 +41,7 @@ const Index = ({onNewUpload, list, onChange, onDelete }: IndexProps) => {
       </View>
       {list.map((item, index) => {
         return (
-          <View className="flex">
+          <View className="flex" onClick={(e) => handlePreview(e, index, item)}>
             <View className={style.imageItem}>
               <MediaItem media={item}></MediaItem>
               <View className={style.deleteButton} onClick={(e:any)=> {

+ 1 - 1
src/components/card/card-editable/index.module.less

@@ -5,7 +5,7 @@
   justify-content: center;
   font-size: 12px;
   line-height: 20px;
-  padding: 12px 0;
+  padding: 0;
   color: rgba(#000, .45);
 }
 .gutterLine{

+ 1 - 1
src/components/card/card-editable/index.tsx

@@ -15,7 +15,7 @@ const Index = ({children, buttons }: IndexProps) => {
         </View>
       </View>
       <View className="border-top1-gray">
-        <View className="flex items-center px-16">
+        <View className="flex items-center">
           {buttons.map((buttons,index)=> {
             return <View className={`${style.button} ${index < buttonLen ? style.gutterLine : ''}`}>{buttons}</View>
           })}

+ 5 - 4
src/components/component-list/components/card-link/index.tsx

@@ -1,5 +1,5 @@
 import Taro from "@tarojs/taro";
-import { View, Image } from "@tarojs/components";
+import { View, Text } from "@tarojs/components";
 import WidgetCard from "@/components/widgets/widget-card/index";
 import style from "./index.module.less";
 import MediaItem from "@/components/media-item/index";
@@ -133,9 +133,10 @@ export default ({
       <View
         className={`flex flex-1 ${
           data?.layout === "center" ? "justify-center" : ""
-        }`}
+        } truncate`}
       >
-        {data?.text ? data?.text : data?.link}
+        <Text className="block truncate">{data?.text ? data?.text : data?.link}</Text>
+        
       </View>
     );
   };
@@ -177,7 +178,7 @@ export default ({
           {renderIcon()}
           {renderContent()}
 
-          {renderRight()}
+          {/* {renderRight()} */}
         </View>
       </WidgetCard>
     </>

+ 5 - 2
src/components/component-list/components/card-tel/index.tsx

@@ -29,6 +29,8 @@ export default ({
   onStyleChanged,
   onClick
 }:Props) => {
+  const text = component?.data?.text ? component?.data?.text : component?.data.placeholder
+  
   const IconPhone = ()=> {
     return <View className='component-icon-tel'></View>
   }
@@ -39,8 +41,9 @@ export default ({
       Taro.makePhoneCall({phoneNumber: component?.data?.text})
     }
   }
+  
   return <>
-    
+      
       <WidgetCard
         enabled={component.enabled}
         onSwitchChanged={(checked)=> onSwitchChanged(component, checked)}
@@ -63,7 +66,7 @@ export default ({
           layout={component?.data?.layout}
           type={IconPhone()}
         >
-          {component?.data?.text}
+         {text} 
         </WidgetTypeRow>
       </WidgetCard>
   </>

+ 9 - 11
src/components/component-list/components/card-title/index.tsx

@@ -1,20 +1,17 @@
 import {View} from '@tarojs/components'
 import WidgetCard from "@/components/widgets/widget-card/index";
 import WidgetTitle from "@/components/widgets/widget-title/index";
-import type {
-  IEntityDocument,
-  TEntityComponent,
-} from "@/types/index";
+import { TComponentItem } from '@/types/agent';
 
 interface Props {
   index: number
   editMode: boolean
-  component: TEntityComponent
-  components: TEntityComponent[]
-  onSwitchChanged: (c: TEntityComponent, checked: boolean)=> void
-  onDelete:(c: IEntityDocument)=> void
-  onMove: (c: TEntityComponent, direction: number) => void
-  onStyleChanged: (c: TEntityComponent) => void
+  component: TComponentItem
+  components: TComponentItem[]
+  onSwitchChanged: (c: TComponentItem, checked: boolean)=> void
+  onDelete:(c: TComponentItem)=> void
+  onMove: (c: TComponentItem, direction: number) => void
+  onStyleChanged: (c: TComponentItem) => void
 }
 export default ({
   index,
@@ -26,6 +23,7 @@ export default ({
   onMove,
   onStyleChanged,
 }:Props) => {
+  const text = component?.data?.text ? component?.data?.text : component?.data?.placeholder
   return <>
     <View className={`${index === 0 ? "" : "mt-48"}`}>
       <WidgetCard
@@ -49,7 +47,7 @@ export default ({
           data={component}
           editMode={editMode}
         >
-          {component?.data?.text}
+          {text}
         </WidgetTitle>
       </WidgetCard>
     </View>

+ 17 - 8
src/components/component-list/components/new-comp-button/index.tsx

@@ -1,10 +1,19 @@
-import { View, Text } from "@tarojs/components"
-import style from './index.module.less'
+import { View, Text, Image } from "@tarojs/components";
+import IconPlus from "@/images/svgs/website/IconPlus.svg";
+import style from "./index.module.less";
 interface Props {
-  index?: number
+  index?: number;
 }
-export default ({index}:Props) => {
-  return <View className={`flex items-center justify-center gap-8 py-12 rounded-12 ${style.container}`}>
-    <Text className={`iconfont icon-icon_20_add text-16 ${style.textColor}`}></Text><Text className={`text-14 font-medium leading-28 ${style.textColor}`}>添加组件</Text>
-  </View>
-}
+export default ({ index }: Props) => {
+  return (
+    <View
+      className={`flex items-center justify-center gap-8 py-12 rounded-12 ${style.container}`}
+    >
+      <Image src={IconPlus} mode="widthFix"
+                  className={`w-12 h-12`} />
+      <Text className={`text-14 font-medium leading-22 ${style.textColor}`}>
+        添加组件
+      </Text>
+    </View>
+  );
+};

+ 2 - 2
src/components/list/FigureListItem/index.tsx

@@ -10,9 +10,9 @@ export interface IndexProps {
   onClick?: () => void;
 }
 
-const Index = ({ figure, arrow, underline, rightRenderer, children, onClick }: IndexProps) => {
+const Index = ({ figure, arrow, underline, rightRenderer, children, className, onClick }: IndexProps) => {
   return (
-    <View className={`flex items-center gap-12 w-full ${underline ? 'border-bottom1-gray pb-12' : ''}`} onClick={ ()=> { onClick && onClick()}}>
+    <View className={`flex items-start gap-12 w-full ${underline ? 'border-bottom1-gray pb-12' : ''} ${className}`} onClick={ ()=> { onClick && onClick()}}>
       {figure()}
       <View className="flex flex-col flex-1 gap-2 w-full overflow-hidden">{children}</View>
       {rightRenderer && rightRenderer()}

+ 5 - 9
src/components/rotate-loading/index.module.less

@@ -7,15 +7,16 @@
     transform: rotate(360deg);
   }
 }
-
-.rotateLoading {
+.container{
   position: relative;
+}
+.rotateLoading {
   display: inline-flex;
   justify-content: center;
   align-items: center;
   box-sizing: border-box;
   border-radius: 50%;
-  border: 1px solid rgba(#000, .1);
+  border: 2px solid rgba(#000, .1);
 }
 .rotateRing {
   position: absolute;
@@ -25,14 +26,9 @@
   right:0;
   bottom:0;
   display: inline-block;
-  position: relative;
   box-sizing: border-box;
   border-style: solid;
   border-radius: 50%;
   animation: rotate-loading 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
-  
-  // 兼容微信小程序
-  /* postcss-disable */
-  -webkit-animation: rotate-loading 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
-  /* postcss-enable */
+
 }

+ 8 - 2
src/components/rotate-loading/index.tsx

@@ -12,8 +12,13 @@ interface RotateLoadingProps {
 const RotateLoading: React.FC<RotateLoadingProps> = ({
   color = '#317CFA',
   size = 16,
-  strokeWidth = 2
+  strokeWidth = 1
 }) => {
+  const ringBgStyle = {
+    width: `${size}px`,
+    height: `${size}px`,
+    borderWidth: `${strokeWidth}px`
+  }
   const ringStyle = {
     width: `${size}px`,
     height: `${size}px`,
@@ -22,7 +27,8 @@ const RotateLoading: React.FC<RotateLoadingProps> = ({
   }
 
   return (
-    <View className={style.rotateLoading}>
+    <View className={style.container}>
+      <View className={style.rotateLoading} style={ringBgStyle}></View>
       <View className={style.rotateRing} style={ringStyle}></View>
     </View>
   )

+ 1 - 0
src/components/slide-delete/index.wxss

@@ -21,6 +21,7 @@
   bottom: 0;
   right: 0;
   overflow: hidden;
+  border-radius: 0 24rpx 24rpx 0;
 }
 
 .wrap .action {

+ 4 - 4
src/components/wemeta-tabs/index.tsx

@@ -26,12 +26,12 @@ export default function Index({
 
   const renderTabContent = () => {
     return (
-      <View>
+      <View className="h-full">
         {list.map((item) => {
           return (
             <View
               className={
-                item.key === tabIndex ? style.visible : style.invisible
+                `${item.key === tabIndex ? style.visible : style.invisible} h-full helloworld`
               }
             >
               {item.children}
@@ -44,7 +44,7 @@ export default function Index({
 
   if (tabStyle === "outline") {
     return (
-      <View>
+      <View className="h-full">
         <View className={`${style.outlineTabButtons} ${className}`}>
           {list.map((item) => {
             return (
@@ -66,7 +66,7 @@ export default function Index({
   }
 
   return (
-    <View>
+    <View className="w-full">
       <View className={`flex items-center gap-8 ${className}`}>
         {list.map((item) => {
           return (

+ 29 - 7
src/components/widgets/widget-card/index.tsx

@@ -3,6 +3,10 @@ import style from "./index.module.less";
 import React from "react";
 import WemetaSwitch from "../../WemetaSwitch/index";
 import type { TEntityComponent } from "@/types/index";
+import IconChange from '@/images/svgs/website/IconChange.svg'
+import IconUp from '@/images/svgs/website/IconUp.svg'
+import IconDown from '@/images/svgs/website/IconDown.svg'
+import IconDelete from '@/images/svgs/website/IconDelete.svg'
 import Taro from "@tarojs/taro";
 interface Props {
   children?: React.ReactChild | React.ReactChild[];
@@ -74,7 +78,7 @@ const Index: React.FC<Props> = ({
             <View className="flex flex-1 items-center">
               {!disableChangeStyle && (
                 <Image
-                  src="https://cdn.wehome.cn/cmn/png/105/META-H8UKWHWU-6NNPBTA0CSOODDVD47MV3-6RIGKS2M-VQ.png"
+                  src={IconChange}
                   mode="widthFix"
                   className={`w-20 h-20 ${style.pressed}`}
                   onClick={onChanged}
@@ -82,21 +86,39 @@ const Index: React.FC<Props> = ({
               )}
             </View>
             <View
-              className={`iconfont icon-icon_20_up ${style.editButton} ${
+              className={`${style.editButton} ${
                 isFirst ? style.buttonDisabled : ""
               } ${style.pressed}`}
               onClick={() => handleMove(0, isFirst)}
-            ></View>
+            >
+              <Image
+                  src={IconUp}
+                  mode="widthFix"
+                  className={`w-20 h-20`}
+                ></Image>
+            </View>
             <View
-              className={`iconfont icon-icon_20_down ${style.editButton} ${
+              className={`${style.editButton} ${
                 isLast ? style.buttonDisabled : ""
               } ${style.pressed}`}
               onClick={() => handleMove(1, isLast)}
-            ></View>
+            >
+              <Image
+                  src={IconDown}
+                  mode="widthFix"
+                  className={`w-20 h-20`}
+                ></Image>
+            </View>
             <View
-              className={`iconfont icon-icon_20_delet ${style.editButton} ${style.pressed}`}
+              className={`${style.editButton} ${style.pressed}`}
               onClick={handleDelete}
-            ></View>
+            >
+             <Image
+                  src={IconDelete}
+                  mode="widthFix"
+                  className={`w-20 h-20`}
+                ></Image> 
+            </View>
             <WemetaSwitch
               checked={enabled}
               onChange={(checked) => handleSwitchChange(checked)}

+ 3 - 0
src/components/widgets/widget-media/index.tsx

@@ -13,6 +13,9 @@ const Index: React.FC<Props> = ({ layout, mediaList, editMode=false }) => {
   
   // 预览媒体
   const handlePreview = (e: any, index: number, item: TMediaType) => {
+    if(editMode){
+      return;
+    }
     e.stopPropagation();
     Taro.previewMedia({
       current: index,

+ 7 - 0
src/components/widgets/widget-type-row/index.module.less

@@ -7,3 +7,10 @@
   width: 24px;
   height: 24px;
 }
+.iconBox{
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  border-radius: 4px;
+  background-color: var(--color-primary);
+}

+ 2 - 2
src/components/widgets/widget-type-row/index.tsx

@@ -52,7 +52,7 @@ const Index: React.FC<Props> = ({
         className={`flex items-center gap-8 px-16`}
         onClick={(e) => handleCopy(e)}
       >
-        <View className={`${className} icon-24-fill icon-box`}>{type}</View>
+        <View className={`${className} ${style.iconBox}`}>{type}</View>
         <View className={`flex flex-1 ${center ? "justify-center" : ""}`}>
           {children}
         </View>
@@ -62,7 +62,7 @@ const Index: React.FC<Props> = ({
   }
   return (
     <View className={`flex items-center gap-8 px-16`} onClick={handleClick}>
-      <View className={`${className} icon-24-fill icon-box`}>
+      <View className={`${className} ${style.iconBox}`}>
         {type}
       </View>
       <View className={`flex flex-1 ${center ? "justify-center" : ""}`}>

+ 10 - 0
src/images/svgs/IconPlayWhite12.svg

@@ -0,0 +1,10 @@
+<svg width="13" height="12" viewBox="0 0 13 12" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_1950_6575)">
+<path d="M9.33325 5.13397C9.99992 5.51887 9.99992 6.48113 9.33325 6.86603L4.45825 9.68061C3.79159 10.0655 2.95825 9.58438 2.95825 8.81458L2.95825 3.18542C2.95825 2.41562 3.79159 1.93449 4.45825 2.31939L9.33325 5.13397Z" fill="white"/>
+</g>
+<defs>
+<clipPath id="clip0_1950_6575">
+<rect width="12" height="12" fill="white" transform="translate(0.333252)"/>
+</clipPath>
+</defs>
+</svg>

+ 6 - 0
src/images/svgs/knowledge/IconCorrect.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" class="design-iconfont">
+  <g fill="#24BE3D" fill-rule="nonzero">
+    <path d="M8,0 C3.5818,0 0,3.5818 0,8 C0,12.4182 3.5818,16 8,16 C12.4182,16 16,12.4182 16,8 C16,3.5818 12.4182,0 8,0 Z M8,1.2 C11.7556,1.2 14.8,4.2444 14.8,8 C14.8,11.7556 11.7556,14.8 8,14.8 C4.2444,14.8 1.2,11.7556 1.2,8 C1.2,4.2444 4.2444,1.2 8,1.2 Z" transform="translate(2 2)"/>
+    <path d="M6.4226,11.0034 C6.64425642,11.2473445 7.02119216,11.2668119 7.2668,11.047 L7.2944,11.021 L11.4276,6.821 C11.6546114,6.59030865 11.6577422,6.22114321 11.4346759,5.98663491 C11.2116097,5.75212661 10.8427492,5.73680237 10.601,5.952 L10.5724,5.9792 L6.884,9.727 L5.244,7.9216 C5.0311275,7.68723294 4.67278312,7.65860391 4.4254,7.8562 L4.3966,7.8808 C4.16211051,8.0936945 4.13347693,8.45218339 4.3312,8.6996 L4.3558,8.7284 L6.4226,11.0034 L6.4226,11.0034 Z" transform="translate(2 2)"/>
+  </g>
+</svg>

+ 6 - 0
src/images/svgs/knowledge/IconError.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" class="design-iconfont">
+  <g fill="#FF4747" fill-rule="nonzero">
+    <path d="M8,0 C3.5818,0 0,3.5818 0,8 C0,12.4182 3.5818,16 8,16 C12.4182,16 16,12.4182 16,8 C16,3.5818 12.4182,0 8,0 Z M8,1.2 C11.7556,1.2 14.8,4.2444 14.8,8 C14.8,11.7556 11.7556,14.8 8,14.8 C4.2444,14.8 1.2,11.7556 1.2,8 C1.2,4.2444 4.2444,1.2 8,1.2 Z" transform="translate(2 2)"/>
+    <path d="M8,10.4 C8.4418278,10.4 8.8,10.7581722 8.8,11.2 C8.8,11.6418278 8.4418278,12 8,12 C7.5581722,12 7.2,11.6418278 7.2,11.2 C7.2,10.7581722 7.5581722,10.4 8,10.4 Z M8,4 C8.31771152,4 8.58036092,4.24763569 8.599,4.5648 L8.60000028,4.6 L8.60000028,8.8 C8.60031296,9.12473891 8.34220658,9.39079033 8.01760737,9.40031984 C7.69300816,9.40984936 7.4197384,9.15939798 7.401,8.8352 L7.4,8.8 L7.4,4.6 C7.4,4.26862915 7.66862915,4 8,4 L8,4 Z" transform="translate(2 2)"/>
+  </g>
+</svg>

+ 3 - 0
src/images/svgs/website/IconChange.svg

@@ -0,0 +1,3 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M10.3658 11.6242C10.3658 11.7144 10.3395 11.801 10.2888 11.8745L7.1035 16.5115C7.06612 16.5674 7.0157 16.6133 6.9566 16.6453C6.8975 16.6773 6.8315 16.6944 6.7643 16.6952C6.6971 16.696 6.63071 16.6804 6.57089 16.6498C6.51107 16.6191 6.4596 16.5744 6.42094 16.5194L3.08254 11.8815C3.01618 11.7888 2.98824 11.674 3.00454 11.5611C3.02085 11.4483 3.08015 11.3461 3.17004 11.276C3.24219 11.2209 3.33043 11.1911 3.42119 11.1911L5.56862 11.1911L5.56862 7.40026C5.55375 4.69891 6.85236 3.23228 9.46358 2.99951C9.22468 3.23403 7.81406 4.25962 7.81406 7.40114C7.81406 9.49344 7.83769 10.757 7.88407 11.1902L9.94487 11.1902C10.1776 11.1902 10.3658 11.3854 10.3658 11.6242ZM16.83 8.72425C16.7578 8.77931 16.6696 8.80914 16.5788 8.80913L14.4314 8.80913L14.4314 12.6C14.4463 15.3013 13.1476 16.7679 10.5364 17.0007C10.7753 16.7662 12.1859 15.7406 12.1859 12.5991C12.1859 10.5068 12.1623 9.24317 12.1159 8.81001L10.0551 8.81001C9.94179 8.80816 9.83381 8.76142 9.7549 8.68005C9.67598 8.59867 9.63258 8.48931 9.63422 8.37597C9.63401 8.28668 9.66086 8.19943 9.71123 8.1257L12.8965 3.48868C12.9339 3.43283 12.9843 3.38691 13.0434 3.35491C13.1025 3.32291 13.1685 3.30579 13.2357 3.30501C13.3029 3.30423 13.3693 3.31984 13.4291 3.35046C13.4889 3.38109 13.5404 3.42583 13.5791 3.4808L16.9175 8.1187C16.9838 8.21143 17.0118 8.32621 16.9955 8.43907C16.9791 8.55192 16.9198 8.6541 16.83 8.72425Z" fill="#6C6C6C"/>
+</svg>

+ 3 - 0
src/images/svgs/website/IconDelete.svg

@@ -0,0 +1,3 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M12 3H8V4H4V6H16V4H12V3ZM5 7H15V17H5V7ZM7.3 15H8.7V9H7.3V15ZM11.3 9V15H12.7V9H11.3Z" fill="#6C6C6C"/>
+</svg>

+ 3 - 0
src/images/svgs/website/IconDown.svg

@@ -0,0 +1,3 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M17 9L10 17L3 9H7V3H13V9H17Z" fill="#6C6C6C"/>
+</svg>

+ 3 - 0
src/images/svgs/website/IconPlus.svg

@@ -0,0 +1,3 @@
+<svg width="13" height="12" viewBox="0 0 13 12" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M5.75 6.75V12H7.25V6.75H12.5V5.25H7.25V0H5.75V5.25H0.5V6.75H5.75Z" fill="black" fill-opacity="0.65"/>
+</svg>

+ 5 - 0
src/images/svgs/website/IconUp.svg

@@ -0,0 +1,5 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g opacity="0.2">
+<path d="M17 11L10 3L3 11H7V17H13V11H17Z" fill="#6C6C6C"/>
+</g>
+</svg>

+ 15 - 8
src/pages/component-library/components/createComponentData.ts

@@ -2,7 +2,8 @@ import { EComponentType } from "@/consts/enum";
 export function createComponentData(type: EComponentType): Record<string, any> | null {
   if(type === EComponentType.title){
     return {
-      text: '默认标题',
+      text: '',
+      placeholder: '默认标题',
       layout: 'left'
     }
   }
@@ -19,7 +20,8 @@ export function createComponentData(type: EComponentType): Record<string, any> |
       layout: 'left',
       poster: '',
       linkType: '',
-      text: '默认链接',
+      text: '',
+      placeholder: '默认链接',
     }
   }
   
@@ -29,20 +31,23 @@ export function createComponentData(type: EComponentType): Record<string, any> |
       layout: 'left',
       poster: '',
       linkType: 'weixinOfficialAccountArticle',
-      text: '公众号文章',
+      text: '',
+      placeholder: '公众号文章',
     }
   }
   if(type === EComponentType.tel){
     return {
-      text: '默认电话',
-      layout: 'left'
+      text: '',
+      layout: 'left',
+      placeholder: '默认电话',
     }
   }
   if(type === EComponentType.address){
     return  {
-      address: '默认地址',
+      address: '',
       latitude: 39.916527,
       longitude:116.397128,
+      placeholder: '默认地址'
     }
   }
   // 图片/视频
@@ -64,7 +69,8 @@ export function createComponentData(type: EComponentType): Record<string, any> |
   if(type === EComponentType.wechat){
     return  {
       value: '',
-      text: '微信公众号',
+      text: '',
+      placeholder: '微信公众号',
       layout: 'left',
     }
   }
@@ -75,7 +81,8 @@ export function createComponentData(type: EComponentType): Record<string, any> |
     return  {
       layout: 'left',
       value: '',
-      text: '视频号',
+      text: '',
+      placeholder: '视频号',
     }
   }
   // 小程序

+ 58 - 63
src/pages/contact/index.tsx

@@ -7,12 +7,16 @@ import style from "./index.module.less";
 import { useEffect, useState } from "react";
 import ContactCard from "./components/contact-card/index";
 import { getContactList, setContactToTop } from "@/service/contact";
-import { useLoadMoreInfinite, type TResponseData } from "@/utils/loadMoreInfinite";
+import {
+  useLoadMoreInfinite,
+  type TResponseData,
+} from "@/utils/loadMoreInfinite";
 import PageCustom from "@/components/page-custom/index";
 import { TContactItem } from "@/types/contact";
 import { isSuccess } from "@/utils";
 import { delContact } from "@/service/contact";
-import TabPageCheckLogin from '@/components/TabPageCheckLogin'
+import TabPageCheckLogin from "@/components/TabPageCheckLogin";
+import BlurContainer from "@/components/BlurContainer";
 
 export default function Index() {
   const [searchValue, setSearchValue] = useState("");
@@ -28,13 +32,9 @@ export default function Index() {
     return res.data;
   };
   const [totalCount, setTotalCount] = useState<number>(0);
-  const getKey = (pageIndex:number, previousPageData) => {
+  const getKey = (pageIndex: number, previousPageData) => {
     if (pageIndex === 0)
-      return [
-        "/my/contacts",
-        { nextId: undefined, pageSize: 10},
-        searchValue,
-      ];
+      return ["/my/contacts", { nextId: undefined, pageSize: 10 }, searchValue];
     if (previousPageData && previousPageData.nextId) {
       return [
         "/my/contacts",
@@ -44,8 +44,9 @@ export default function Index() {
     }
     return null;
   };
-  const {data, list, setSize, mutate, pageIndex} = useLoadMoreInfinite<TContactItem[]>(getKey, fetcher)
-
+  const { data, list, setSize, mutate, pageIndex } = useLoadMoreInfinite<
+    TContactItem[]
+  >(getKey, fetcher);
 
   const handleSearchBarChanged = (v: string) => {
     setSearchValue(v);
@@ -64,7 +65,6 @@ export default function Index() {
     setSize((prevSize) => prevSize + 1);
   };
 
-
   const handleHello = async (e: any) => {
     const detail = e.detail as { type: string; id: string };
     console.log(detail);
@@ -75,77 +75,71 @@ export default function Index() {
         contactId: detail.id,
       });
       if (isSuccess(reseponse.status)) {
-        mutate()
+        mutate();
         return;
       }
     }
-    if(detail.type === 'delete'){
-      handleDelete(detail.id)
+    if (detail.type === "delete") {
+      handleDelete(detail.id);
     }
   };
 
-  useDidShow(()=> {
-    mutate()
-  })
-  const onLoginEnd = ()=> {
-    mutate()
-  }
+  useDidShow(() => {
+    mutate();
+  });
+  const onLoginEnd = () => {
+    mutate();
+  };
 
   useEffect(() => {
-    if(data &&  pageIndex === 1) {
-      setTotalCount(data?.[0].totalCount || 0)
+    if (data && pageIndex === 1) {
+      setTotalCount(data?.[0].totalCount || 0);
     }
   }, [data, pageIndex]);
-  
 
-  const handleDelete = (contactId: string|number) => {
-    
+  const handleDelete = (contactId: string | number) => {
     Taro.showModal({
       content: "😭 确认删除该联系人吗?",
       async success(result) {
         if (result.confirm) {
           const response = await delContact(contactId);
-          if(isSuccess(response.status)) {
+          if (isSuccess(response.status)) {
             Taro.showToast({
               title: "删除成功",
-              icon: 'none',
+              icon: "none",
             });
-            mutate()
+            mutate();
           }
         }
       },
     });
   };
 
-  const renderItem = (item)=> {
-    // @ts-ignore
-  return <slide-contact
-    pid={item.contactId}
-      pinned={item.isTop}
-      onAction={handleHello}
-    >
-    <View className={``}>
-        <ContactCard
-          refresh={mutate}
-          deleteable={true}
-          key={item.contactId}
-          data={item}
-          fromContact
-          className={`${item.isTop ? "bg-[#EDF1FF]" : "bg-white"}`}
-        ></ContactCard>
-      </View>
-    </slide-contact>
-  }
 
   const renderContent = () => {
     if (list?.length) {
       return list.map((item) => (
         <View className={`rounded-12 overflow-hidden`}>
-          {renderItem(item)}
+          <slide-contact
+            pid={item.contactId}
+            pinned={item.isTop}
+            onAction={handleHello}
+          >
+            <View className={``}>
+              <ContactCard
+                refresh={mutate}
+                deleteable={true}
+                key={item.contactId}
+                data={item}
+                fromContact
+                className={`${item.isTop ? "bg-[#EDF1FF]" : "bg-white"}`}
+              ></ContactCard>
+            </View>
+          </slide-contact>
         </View>
       ));
     }
-    return <EmptyData type={'search'} />;
+    return <EmptyData type={"search"} />;
   };
 
   return (
@@ -162,20 +156,21 @@ export default function Index() {
             onClear={() => handleClear()}
           ></SearchBar>
         </View>
-        <View className="rounded-container-header"></View>
-        <View className="px-16 text-gray-45 text-12 leading-20 mb-20">
-          共 {totalCount} 个联系人 
-        </View>
-        <ScrollView
-          scrollY
-          onScrollToUpper={onScrollToUpper}
-          style={{
-            flex: 1,
-            height: "100%", // 高度自适应
-          }}
-        >
-          <View className={style.contactContent}>{renderContent()}</View>  
-        </ScrollView>
+        <BlurContainer>
+          <View className="px-16 text-gray-45 text-12 leading-20 mb-20 pt-16">
+            共 {totalCount} 个联系人
+          </View>
+          <ScrollView
+            scrollY
+            onScrollToUpper={onScrollToUpper}
+            style={{
+              flex: 1,
+              height: "100%", // 高度自适应
+            }}
+          >
+            <View className={style.contactContent}>{renderContent()}</View>
+          </ScrollView>
+        </BlurContainer>
       </View>
       <TabPageCheckLogin onEnd={onLoginEnd}></TabPageCheckLogin>
     </PageCustom>

+ 4 - 6
src/pages/dashboard/index.tsx

@@ -26,9 +26,6 @@ export default () => {
   const [currentAgent, setCurrentAgent] = useState<TAgent|null>(null)
   const [summary, setSummary] = useState<TVisitorSummary>()
 
-
-  const [showLogin, setShowLogin] = useState(false);
-
   const fetcher = async ([_url, {nextId, pageSize}, [agentId]]) => {
     console.log(nextId, agentId)
     const res = await getVisitorList({ startId: nextId, pageSize, agentId});
@@ -38,7 +35,8 @@ export default () => {
     createKey(`getVisitorList ${currentAgent?.agentId}`, 20, [currentAgent?.agentId]),
     fetcher);
 
-
+  
+  // 统计数据
   const fetchSummary = async () => {
     const response = await getVisitorSummary(currentAgent?.agentId)
     if(isSuccess(response.status)){
@@ -62,7 +60,7 @@ export default () => {
   })
 
 
-
+  // 登录完成后
   const onLoginEnd = ()=> {
     fetchInitData()
     mutate()
@@ -91,7 +89,7 @@ export default () => {
       <View className="w-full pt-8 px-16 pb-40">
         <View className="flex items-center gap-8 mb-16">
           <View className="bg-white rounded-12 py-12 px-16" onClick={()=> setCurrentAgent(null)}>
-            <View className={`${currentAgent ? 'text-gray-45' : 'text-black' }`}>全部</View>
+            <View className={`${currentAgent?.agentId ? 'text-black' : 'text-gray-45' }`}>全部</View>
           </View>
           <View className="flex flex-1 items-center gap-2 bg-white rounded-12 p-12" onClick={()=> setShow(true)}>
               <View className="flex-1 text-14 leading-22">

+ 2 - 0
src/pages/editor-pages/editor-greeting/index.tsx

@@ -25,6 +25,8 @@ const onPolished = (text:string|null)=> {
         <View className="w-full p-16">
           <WemetaTextarea
               value={value}
+              autoHeight
+              extraClass="min-h-[380px] max-h-[500]"
               onBlur={(value: string) => onChange(value)}
               onInput={(value: string) => onChange(value)}
               placeholder="碰到TA之后,第一句话想说什么?"

+ 3 - 1
src/pages/editor-pages/editor-personality/index.tsx

@@ -26,10 +26,12 @@ export default function Index() {
       <NavBarNormal backText="人设"></NavBarNormal>
       <View className="flex flex-col items-center w-full">
       <View
-            className="w-full p-16"
+            className="w-full p-16 pb-120"
           >
             <WemetaTextarea
               value={value}
+              autoHeight
+              extraClass="min-h-[380px] max-h-[500]"
               onBlur={(value: string) => onChange(value)}
               onInput={(value: string) => onChange(value)}
               placeholder="示例:你是一位汽车销售人员,拥有专业的汽车相关知识,善于耐心的解答客户提出的每一个问题,并会主动邀请客户上门试驾。"

+ 1 - 1
src/pages/editor-pages/editor-tel/index.tsx

@@ -53,7 +53,7 @@ export default function Index() {
           <WemetaTextarea
               value={value}
               onInput={(value: string) => onChange(value)}
-              placeholder="请输入电话..."
+              placeholder={currentComponent?.data.placeholder}
               maxlength={14}
             />
         </View>

+ 1 - 1
src/pages/editor-pages/editor-title/index.tsx

@@ -57,7 +57,7 @@ export default function Index() {
               value={value}
               onBlur={(value: string) => onChange(value)}
               onInput={(value: string) => onChange(value)}
-              placeholder="章节标题"
+              placeholder={currentComponent?.data?.placeholder ?? ''}
               autoFocus
               maxlength={50}
             />

+ 2 - 2
src/pages/knowledge-item/index.tsx

@@ -114,10 +114,10 @@ export default function Index() {
       return []
     }
     return [
-      <View onClick={() => handleDeleteItem(item.qaId)}>
+      <View className="flex-1 w-full h-full py-12 flex-center" onClick={() => handleDeleteItem(item.qaId)}>
         删除
       </View>,
-      <View onClick={() => handleEdit(item.qaId)}>编辑</View>,
+      <View className="flex-1 w-full h-full py-12 flex-center" onClick={() => handleEdit(item.qaId)}>编辑</View>,
     ]
   }
 

+ 62 - 47
src/pages/knowledge/components/CompanyTab/components/ScrollList.tsx

@@ -7,60 +7,68 @@ import { useEffect, useState } from "react";
 import EmptyData from "@/components/empty-data";
 import RotateLoading from "@/components/rotate-loading";
 import Taro from "@tarojs/taro";
+import IconError from '@/images/svgs/knowledge/IconError.svg'
+import IconCorrect from '@/images/svgs/knowledge/IconCorrect.svg'
 
 import KnowledgeIcon from "@/components/KnowledgeIcon";
-import {
-  getEntKnowledgeList,
-} from "@/service/knowledge";
+import { getEntKnowledgeList } from "@/service/knowledge";
 import type { TKnowledgeItem } from "@/types/knowledge";
 
 import { useLoadMoreInfinite, createKey } from "@/utils/loadMoreInfinite";
 export interface Iprops {
-  entId: string|number
+  entId: string | number;
   setTotalCount: (count: number) => void;
 }
-const Index = ({entId, setTotalCount}:Iprops) => {
-
-
-  const fetcher = async ([_url, {nextId, pageSize},  [entId]]) => {
+const Index = ({ entId, setTotalCount }: Iprops) => {
+  const fetcher = async ([_url, { nextId, pageSize }, [entId]]) => {
     const res = await getEntKnowledgeList({ startId: nextId, pageSize, entId });
     return res.data;
   };
-  const { list, loadMore, pageIndex, mutate, data } = useLoadMoreInfinite<TKnowledgeItem[]>(createKey(`getEntKnowledgeList ${entId}`, 30, [entId]),
-    fetcher);
+  const { list, loadMore, pageIndex, mutate, data } = useLoadMoreInfinite<
+    TKnowledgeItem[]
+  >(createKey(`getEntKnowledgeList ${entId}`, 30, [entId]), fetcher);
 
   const onScrollToLower = async () => {
-    console.log('toLower')
-    loadMore()
-  }
-  useDidShow(()=> {
+    console.log("toLower");
+    loadMore();
+  };
+  useDidShow(() => {
     mutate(undefined, { revalidate: true });
-  })
-  
+  });
 
   useEffect(() => {
-    if(data &&  pageIndex === 1) {
-      setTotalCount(data?.[0].totalCount || 0)
+    if (data && pageIndex === 1) {
+      setTotalCount(data?.[0].totalCount || 0);
     }
   }, [data, pageIndex]);
-  
 
-  const handleEdit = (item: TKnowledgeItem)=> {
-    if(item.parseStatus !== 'parsed'){
-      return ;
+  const handleEdit = (item: TKnowledgeItem) => {
+    if (item.parseStatus !== "parsed") {
+      return;
     }
     Taro.navigateTo({
-      url: `/pages/knowledge-item/index?knowledgeId=${item.knowledgeId}&entId=${entId}`
-    })
-  }
+      url: `/pages/knowledge-item/index?knowledgeId=${item.knowledgeId}&entId=${entId}`,
+    });
+  };
   const rightRenderer = (item: TKnowledgeItem) => {
-    if(!item.isParsing){
-      return <></>
+    if (item.isParsing) {
+      return (
+        <View className="flex items-center gap-4 self-center">
+          <RotateLoading />
+          <View className="text-primary text-12">解析中</View>
+        </View>
+      );
+    }
+    if(item.parseStatus === 'parsed'){
+      return (
+        <View className="flex items-center self-center">
+          <Image src={IconCorrect} className="w-20 h-20"  />
+        </View>
+      );
     }
     return (
-      <View className="flex items-center gap-4">
-        <RotateLoading />
-        <View className="text-primary text-12">解析中</View>
+      <View className="flex items-center self-center">
+        <Image src={IconError} className="w-20 h-20"  />
       </View>
     );
   };
@@ -74,24 +82,31 @@ const Index = ({entId, setTotalCount}:Iprops) => {
         height: "100%", // 高度自适应
       }}
     >
-      {list.length<=0 ? <View className="pt-46"><EmptyData type={'plane'}/></View> : <></>}
-      <FigureList>
-      {list.map(item => {
-        return <FigureListItem
-            figure={()=> <KnowledgeIcon data={item}/>}
-            underline
-            arrow={item.parseStatus === 'parsed'}
-            onClick={()=> handleEdit(item)}
-            rightRenderer={()=> rightRenderer(item)}
-          >
-            <View className="flex flex-col flex-1 gap-2 w-full">
-              <View className="text-14 leading-22">{item.title}</View>
-              <View className="text-12 leading-20 text-gray-45">
-              {item.createTime} | {item.fileSize}
+      {list.length <= 0 ? (
+        <View className="pt-46">
+          <EmptyData type={"plane"} />
+        </View>
+      ) : (
+        <></>
+      )}
+      <FigureList className="mx-16">
+        {list.map((item) => {
+          return (
+            <FigureListItem
+              figure={() => <KnowledgeIcon data={item} />}
+              underline
+              onClick={() => handleEdit(item)}
+              rightRenderer={() => rightRenderer(item)}
+            >
+              <View className="flex flex-col flex-1 gap-2 w-full">
+                <View className="text-14 leading-22">{item.title}</View>
+                <View className="text-12 leading-20 text-gray-45">
+                  {item.createTime} | {item.fileSize}
+                </View>
               </View>
-            </View>
-          </FigureListItem>
-      })}
+            </FigureListItem>
+          );
+        })}
       </FigureList>
     </ScrollView>
   );

+ 3 - 3
src/pages/knowledge/components/CompanyTab/components/ScrollListChat.tsx

@@ -81,7 +81,7 @@ const Index = ({ entId, assistantOnly, setTotalCount }: Iprops) => {
         height: "100%", // 高度自适应
       }}
     >
-      <View className="flex flex-col gap-20 pb-120">
+      <View className="flex flex-col gap-20 pb-120 mx-16">
         {reversedList.length<=0 ? <View className="pt-46"><EmptyData type={'plane'}/></View> : <></>}
         {reversedList.map((group) => {
           // 渲染自己发送的消息
@@ -129,8 +129,8 @@ const Index = ({ entId, assistantOnly, setTotalCount }: Iprops) => {
                         })
                       }
                     >
-                      <View className="flex flex-col flex-1 gap-2 w-full">
-                        <View className="text-14 leading-22">{item.title}</View>
+                      <View className="flex flex-col flex-1 gap-2 w-full truncate">
+                        <View className="text-14 leading-22 truncate">{item.title}</View>
                         <View className="text-12 leading-20 text-gray-45">
                           {item.createTime} | {item.fileSizeStr}
                         </View>

+ 10 - 6
src/pages/knowledge/components/CompanyTab/index.tsx

@@ -27,14 +27,18 @@ const Index = () => {
   };
 
   return (
-    <View className="px-16 h-full">
-      <CompanyList setCurrentEnt={setEnt} currentEnt={ent}></CompanyList>
-
-      <StyleFilter checked={assistantOnly} setChecked={setAssistantOnly} listStyle={listStyle} setListStyle={setListStyle}>
-        <View className="flex-1 text-12 leading-20 text-gray-45">
+    <View className="h-full">
+      <View className="pt-20 pb-20">
+        <View className="px-16">
+          <CompanyList setCurrentEnt={setEnt} currentEnt={ent}></CompanyList>
+        </View>
+        <StyleFilter checked={assistantOnly} setChecked={setAssistantOnly} listStyle={listStyle} setListStyle={setListStyle}>
+          <View className="flex-1 text-12 leading-20 text-gray-45">
             共 {totalCount ?? 0} 个文件
           </View>
-      </StyleFilter>
+        </StyleFilter>
+        
+      </View>
       
       {/* 知识库内容 */}
       {renderScrollList()}

+ 0 - 89
src/pages/knowledge/components/CorrectionList/index.tsx

@@ -1,89 +0,0 @@
-import { View } from "@tarojs/components";
-import RoundedLabel from "../RoundedLabel";
-import IconFilterFeeds from "@/components/icon/IconFilterFeeds";
-import IconFilterBatch from "@/components/icon/IconFilterBatch";
-import IconFilterList from "@/components/icon/IconFilterList";
-import EmptyData from "@/components/empty-data";
-
-import Popup from "@/components/popup/popup";
-import WemetaSwitch from "@/components/WemetaSwitch";
-import { useState } from "react";
-
-import ViewStyleListCorrection from "../view-style/ViewStyleListCorrection";
-
-import { TEntItem } from "@/types/user";
-
-import CompanyList from '../CompanyList'
-import { TCorrectionItem } from "@/types/correction";
-
-type TListStyle = "card" | "list";
-
-const Index = () => {
-  // const [checked, setChecked] = useState(false);
-  // const [showPopup, setShowPopup] = useState(false);
-  const [listStyle, setListStyle] = useState<TListStyle>("card");
-  const [ent, setEnt] = useState<TEntItem|null>(null)
-  const [list, setList] = useState<TCorrectionItem[]>();
-
-  const extraEnt: TEntItem[] = [{
-    entName: '个人知识库',
-    entId: undefined,
-    expireTime: '0',
-    isExpired: false,
-    knowledgeCnt: 0
-  }]
-
-
-  // 渲染数据内容
-  const renderScrollContent = () => {
-    if (listStyle === "card") {
-      return (
-        <ViewStyleListCorrection
-          setData={setList}
-          entId={ent?.entId}
-          viewStyle="card"
-        />
-      );
-    }
-    // return (
-    //   <ViewStyleListCorrection
-    //     setData={setList}
-    //     entId={ent?.entId}
-    //     viewStyle="list"
-    //   />
-    // );
-  };
-  console.log('渲染纠错模块')
-  // 渲染主体
-  const renderEmpty = () => {
-    // 空数据
-    if (list && !list.length) {
-      return (
-        <View className="flex-center pt-40">
-          <EmptyData type={'whiteboard'}>
-            <View className="text-center text-14 leading-28 text-gray-45 mb-44 w-[296px]">
-              <View className="text-center text-16 leading-24 font-medium text-black">
-                还没有纠正过的内容
-              </View>
-              <View>当你发现 AI 理解有误的知识点并进行修改后,</View>
-              <View>会汇总在这里,用于优化AI回答。</View>
-            </View>
-          </EmptyData>
-        </View>
-      );
-    }
-    return <></>
-  };
-
-  return (
-    <>
-      <View className="px-16 h-full">
-        <CompanyList currentEnt={ent} setCurrentEnt={setEnt} extraEnt={extraEnt}></CompanyList>
-        {renderEmpty()}
-        {renderScrollContent()}
-      </View>
-    </>
-  );
-};
-
-export default Index;

+ 23 - 58
src/pages/knowledge/components/view-style/ViewStyleListCorrection.tsx → src/pages/knowledge/components/CorrectionTab/components/CorrectionList.tsx

@@ -6,20 +6,21 @@ import { useEffect, useState } from "react";
 import { TCorrectionItem } from "@/types/correction";
 import { getCorrectionList } from "@/service/correction";
 import { useLoadMoreInfinite, createKey } from "@/utils/loadMoreInfinite";
+import IconError from '@/images/svgs/knowledge/IconError.svg'
+import IconCorrect from '@/images/svgs/knowledge/IconCorrect.svg'
 
 import IconA from "@/components/icon/IconA";
 import IconQ from "@/components/icon/IconQ";
 import CardEditable from "@/components/card/card-editable/index";
 
 import { useModalStore } from "@/store/modalStore";
-import { mutate } from "swr";
 
 export interface Iprops {
-  viewStyle: 'list'|'card'
   entId?: number|string
+  setTotalCount: (count: number) => void;
   setData: (value: any[])=> void
 }
-const Index = ({viewStyle, entId, setData}:Iprops) => {
+const Index = ({entId, setData, setTotalCount}:Iprops) => {
   
   const { showModal } = useModalStore();
 
@@ -29,7 +30,7 @@ const Index = ({viewStyle, entId, setData}:Iprops) => {
   };
 
   
-  const { list, loadMore, pageIndex, mutate } = useLoadMoreInfinite<TCorrectionItem[]>(
+  const {data, list, loadMore, pageIndex, mutate } = useLoadMoreInfinite<TCorrectionItem[]>(
     createKey(`api/v1/my/correction/list${entId}`, 10, [entId]),
     fetcher);  
 
@@ -49,6 +50,12 @@ const Index = ({viewStyle, entId, setData}:Iprops) => {
     mutate(undefined, { revalidate: true });
   })
 
+  useEffect(() => {
+    if(data &&  pageIndex === 1) {
+      setTotalCount(data?.[0].totalCount || 0)
+    }
+  }, [data, pageIndex]);
+
 
   const handleEdit = (qaId: number | string) => {
     // Taro.navigateTo({
@@ -89,60 +96,18 @@ const Index = ({viewStyle, entId, setData}:Iprops) => {
         height: "100%", // 高度自适应
       }}
     >
-    {list.map((item) => {
-      return (
-        <View className="flex flex-col gap-16 mb-16">
-          <CardEditable
-            buttons={createCardOptions(item)}
-          >
-            <View className="flex items-start mb-8 gap-8">
-              <View className="flex-center h-28">
-                <IconQ />
-              </View>
-              <View className="flex-1 font-medium text-14 leading-28">
-                {item.questions[0]}
-              </View>
-            </View>
-
-            <View className="flex items-start gap-8">
-              <View className="flex-center  h-28">
-                <IconA />
-              </View>
-              <View className="flex-1 text-12 leading-20 text-gray-45 truncate">
-                <View className="truncate">{item.answer}</View>
-
-                {!!item.links.length && (
-                  <View className="pb-12">
-                    {item.links.map((link) => {
-                      return (
-                        <View>
-                          查看链接 <Text>{link}</Text>
-                        </View>
-                      );
-                    })}
-                  </View>
-                )}
-                {!!item.pics.length && (
-                  <View className="pb-12">
-                    {item.pics.map((pic) => {
-                      return (
-                        <View>
-                          <Image
-                            src={pic}
-                            mode="widthFix"
-                            className="w-full"
-                          ></Image>
-                        </View>
-                      );
-                    })}
-                  </View>
-                )}
-              </View>
-            </View>
-          </CardEditable>
-        </View>
-      );
-    })}
+      <View className="flex flex-col gap-8 mx-16">
+        {list.map((item) => {
+          return (
+            <View className="rounded-12 overflow-hidden">
+              <slide-delete pid={item.id}>
+                <View className="bg-white p-16">
+                  <View className="text-14 leading-28 font-medium">{item.questions[0]}</View>
+                </View>
+              </slide-delete>
+            </View>)
+        })}
+      </View>
     </ScrollView>
   );
 };

+ 157 - 0
src/pages/knowledge/components/CorrectionTab/components/CorrectionListChat.tsx

@@ -0,0 +1,157 @@
+import { ScrollView, View, Image, Text } from "@tarojs/components";
+
+import Taro, { useDidShow } from "@tarojs/taro";
+import { useEffect, useState } from "react";
+
+import { TCorrectionItem } from "@/types/correction";
+import { getCorrectionList } from "@/service/correction";
+import { useLoadMoreInfinite, createKey } from "@/utils/loadMoreInfinite";
+
+import IconA from "@/components/icon/IconA";
+import IconQ from "@/components/icon/IconQ";
+import CardEditable from "@/components/card/card-editable/index";
+
+import { useModalStore } from "@/store/modalStore";
+
+export interface Iprops {
+  entId?: number|string
+  setTotalCount: (count: number) => void;
+  setData: (value: any[])=> void
+}
+const Index = ({entId, setData, setTotalCount}:Iprops) => {
+  
+  const { showModal } = useModalStore();
+
+  const fetcher = async ([_url, {nextId, pageSize}, [_entId]]) => {
+    const res = await getCorrectionList({ startId: nextId, pageSize, entId: _entId});
+    return res.data;
+  };
+
+  
+  const {data, list, loadMore, pageIndex, mutate } = useLoadMoreInfinite<TCorrectionItem[]>(
+    createKey(`api/v1/my/correction/list${entId}`, 10, [entId]),
+    fetcher);  
+
+  const onScrollToUpper = async () => {
+    console.log('toUpper')
+    loadMore()
+  }
+  console.log('pageIndex', pageIndex, list)
+  useEffect(() => {
+    if(pageIndex === 1){
+      console.log('setData', entId)
+      setData(list);
+    }
+  }, [entId]);
+
+  useDidShow(()=> {
+    mutate(undefined, { revalidate: true });
+  })
+
+  useEffect(() => {
+    if(data &&  pageIndex === 1) {
+      setTotalCount(data?.[0].totalCount || 0)
+    }
+  }, [data, pageIndex]);
+
+
+  const handleEdit = (qaId: number | string) => {
+    // Taro.navigateTo({
+    //   url: `/pages/knowledge-item-editor/index?knowledgeId=${knowledgeId}&qaId=${qaId}&knowledgeTitle=${detail?.title}`,
+    // });
+  };
+  
+  // 删除问答项
+  const handleDeleteItem = async (qaId: number | string) => {
+    
+    showModal({
+      content: "确定删除该问答项吗?",
+      onConfirm: async () => {
+        // const { status } = await deleteKnowledgeQa(detail.knowledgeId, qaId);
+        // if (isSuccess(status)) {
+        //   Taro.showToast({ title: "删除成功", icon: "success" });
+        //   getDetail(detail.knowledgeId);
+        // }
+      },
+    });
+  };
+
+
+  const createCardOptions = (item: TCorrectionItem) => {
+    return [
+      // <View onClick={() => handleDeleteItem(item.id)}>
+      //   删除
+      // </View>,
+      // <View onClick={() => handleEdit(item.id)}>编辑</View>,
+    ]
+  }
+  return (
+    <ScrollView
+      scrollY
+      onScrollToUpper={onScrollToUpper}
+      style={{
+        flex: 1,
+        height: "100%", // 高度自适应
+      }}
+    >
+      <View className="mx-16">
+      {list.map((item) => {
+        return (
+          <View className="flex flex-col gap-16 mb-16">
+            <CardEditable
+              buttons={createCardOptions(item)}
+            >
+              <View className="flex items-start mb-8 gap-8">
+                <View className="flex-center h-28">
+                  <IconQ />
+                </View>
+                <View className="flex-1 font-medium text-14 leading-28">
+                  {item.questions[0]}
+                </View>
+              </View>
+
+              <View className="flex items-start gap-8">
+                <View className="flex-center  h-28">
+                  <IconA />
+                </View>
+                <View className="flex-1 text-12 leading-20 text-gray-45 truncate">
+                  <View className="truncate">{item.answer}</View>
+
+                  {!!item.links.length && (
+                    <View className="pb-12">
+                      {item.links.map((link) => {
+                        return (
+                          <View>
+                            查看链接 <Text>{link}</Text>
+                          </View>
+                        );
+                      })}
+                    </View>
+                  )}
+                  {!!item.pics.length && (
+                    <View className="pb-12">
+                      {item.pics.map((pic) => {
+                        return (
+                          <View>
+                            <Image
+                              src={pic}
+                              mode="widthFix"
+                              className="w-full"
+                            ></Image>
+                          </View>
+                        );
+                      })}
+                    </View>
+                  )}
+                </View>
+              </View>
+            </CardEditable>
+          </View>
+        );
+      })}
+    </View>
+    </ScrollView>
+  );
+};
+
+export default Index;

+ 96 - 0
src/pages/knowledge/components/CorrectionTab/index.tsx

@@ -0,0 +1,96 @@
+import { View } from "@tarojs/components";
+import EmptyData from "@/components/empty-data";
+
+import StyleFilter, { TListStyle } from "../StyleFilter";
+import { useState } from "react";
+
+import CorrectionListChat from "./components/CorrectionListChat";
+import CorrectionList from "./components/CorrectionList";
+
+import { TEntItem } from "@/types/user";
+
+import CompanyList from "../CompanyList";
+import { TCorrectionItem } from "@/types/correction";
+
+const Index = () => {
+  // const [checked, setChecked] = useState(false);
+  // const [showPopup, setShowPopup] = useState(false);
+  const [listStyle, setListStyle] = useState<TListStyle>("chat");
+  const [ent, setEnt] = useState<TEntItem | null>(null);
+  const [list, setList] = useState<TCorrectionItem[]>();
+  const [totalCount, setTotalCount] = useState<number>(0);
+
+  const extraEnt: TEntItem[] = [
+    {
+      entName: "个人知识库",
+      entId: undefined,
+      expireTime: "0",
+      isExpired: false,
+      knowledgeCnt: 0,
+    },
+  ];
+
+  // 渲染数据内容
+  const renderScrollContent = () => {
+    if (listStyle === "chat") {
+      return (
+        <CorrectionListChat
+          setTotalCount={setTotalCount}
+          setData={setList}
+          entId={ent?.entId}
+        />
+      );
+    }
+    return (
+      <CorrectionList
+        setTotalCount={setTotalCount}
+        setData={setList}
+        entId={ent?.entId}
+      />
+    );
+  };
+  console.log("渲染纠错模块");
+  // 渲染主体
+  const renderEmpty = () => {
+    // 空数据
+    if (!list?.length) {
+      return (
+        <View className="flex-center pt-40">
+          <EmptyData type={"whiteboard"}>
+            <View className="text-center text-14 leading-28 text-gray-45 mb-44 w-[296px]">
+              <View className="text-center text-16 leading-24 font-medium text-black">
+                还没有纠正过的内容
+              </View>
+              <View>当你发现 AI 理解有误的知识点并进行修改后,</View>
+              <View>会汇总在这里,用于优化AI回答。</View>
+            </View>
+          </EmptyData>
+        </View>
+      );
+    }
+    return <></>;
+  };
+
+  return (
+    <View className="h-full">
+      <View className="pt-20 pb-20">
+        <View className="px-16">
+          <CompanyList
+            currentEnt={ent}
+            setCurrentEnt={setEnt}
+            extraEnt={extraEnt}
+          ></CompanyList>
+        </View>
+        <StyleFilter listStyle={listStyle} setListStyle={setListStyle}>
+          <View className="flex-1 text-12 leading-20 text-gray-45">
+            共纠正 {totalCount ?? 0} 条问答
+          </View>
+        </StyleFilter>
+      </View>
+      {renderEmpty()}
+      {renderScrollContent()}
+    </View>
+  );
+};
+
+export default Index;

+ 0 - 146
src/pages/knowledge/components/PersonalTab/components/ScrollList-slide-delete.tsx

@@ -1,146 +0,0 @@
-import { ScrollView, View, Image } from "@tarojs/components";
-
-import FigureList from "@/components/list/FigureList";
-import FigureListItem from "@/components/list/FigureListItem";
-import { useDidShow } from "@tarojs/taro";
-import { useEffect, useState } from "react";
-
-import RotateLoading from "@/components/rotate-loading";
-import Taro from "@tarojs/taro";
-
-import { EKnowlegeTypes } from "@/consts/enum";
-import KnowledgeIcon from "@/components/KnowledgeIcon";
-import EmptyData from "@/components/empty-data";
-
-import type { TKnowledgeItem } from "@/types/knowledge";
-
-import { deleteMyKnowledge, getKnowledgeList } from "@/service/knowledge";
-
-import { useLoadMoreInfinite, createKey } from "@/utils/loadMoreInfinite";
-import { isSuccess } from "@/utils";
-
-export interface IProps {
-  types?: EKnowlegeTypes[];
-  setTotalCount: (count: number) => void;
-}
-
-const Index = ({ types, setTotalCount }: IProps) => {
-  const fetcher = async ([_url, { nextId, pageSize }, [types]]) => {
-    const res = await getKnowledgeList({ startId: nextId, pageSize, types });
-    return res.data;
-  };
-  const { list, loadMore, mutate, data, pageIndex } = useLoadMoreInfinite<
-    TKnowledgeItem[]
-  >(createKey("getKnowledgeList", 2, [types]), fetcher);
-
-  const onScrollToLower = async () => {
-    loadMore();
-  };
-
-  useDidShow(() => {
-    mutate(undefined, { revalidate: true });
-  });
-
-  useEffect(() => {
-    if (data && pageIndex === 1) {
-      setTotalCount(data?.[0].totalCount || 0);
-    }
-  }, [data, pageIndex]);
-
-  const handleEdit = (item: TKnowledgeItem) => {
-    if (item.parseStatus !== "parsed") {
-      return;
-    }
-    Taro.navigateTo({
-      url: `/pages/knowledge-item/index?knowledgeId=${item.knowledgeId}`,
-    });
-  };
-
-  const handleDelete = async (id: string | number) => {
-    Taro.showModal({
-      content: "确认删除该知识?",
-      async success(result) {
-        if (result.confirm) {
-          const response = await deleteMyKnowledge(id);
-          if (isSuccess(response.status)) {
-            Taro.showToast({
-              title: "删除成功",
-              icon: "none",
-            });
-            mutate();
-          }
-        }
-      },
-    });
-  };
-
-  const handleHello = async (e: any) => {
-    const detail = e.detail as { type: string; id: string };
-    console.log(detail);
-    // 置顶与取消置顶
-    if (detail.type === "delete") {
-      handleDelete(detail.id);
-    }
-  };
-
-  const renderItem = (item: TKnowledgeItem) => {
-    // @ts-ignore
-    return (<slide-delete pid={item.knowledgeId} onAction={handleHello}>
-        <View className="px-16">
-        <FigureListItem
-          figure={() => <KnowledgeIcon data={item} />}
-          arrow={item.parseStatus === "parsed"}
-          onClick={() => handleEdit(item)}
-          rightRenderer={() => rightRenderer(item)}
-        >
-          <View className="flex flex-col flex-1 gap-2 w-full">
-            <View className="text-14 leading-22">{item.title}</View>
-            <View className="text-12 leading-20 text-gray-45">
-              {item.createTime} | {item.fileSize}
-            </View>
-          </View>
-        </FigureListItem>
-        </View>
-      </slide-delete>
-    );
-  };
-
-  const rightRenderer = (item: TKnowledgeItem) => {
-    if (!item.isParsing) {
-      return <></>;
-    }
-
-    return (
-      <View className="flex items-center gap-4">
-        <RotateLoading />
-        <View className="text-primary text-12">解析中</View>
-      </View>
-    );
-  };
-
-  return (
-    <ScrollView
-      scrollY
-      onScrollToLower={onScrollToLower}
-      style={{
-        flex: 1,
-        height: "100%", // 高度自适应
-      }}
-    >
-      {list.length <= 0 ? (
-        <View className="pt-46">
-          <EmptyData type={"plane"} />
-        </View>
-      ) : (
-        <></>
-      )}
-      <View className="rounded-8 flex flex-col gap-12 bg-white">
-        {list.map((item) => {
-          return renderItem(item);
-        })}
-      </View>
-    </ScrollView>
-  );
-};
-
-export default Index;

+ 86 - 56
src/pages/knowledge/components/PersonalTab/components/ScrollList.tsx

@@ -1,9 +1,10 @@
-import { ScrollView, View, Image } from "@tarojs/components";
+import { ScrollView, View, Image, Text } from "@tarojs/components";
 
-import FigureList from "@/components/list/FigureList";
+import IconError from '@/images/svgs/knowledge/IconError.svg'
+import IconCorrect from '@/images/svgs/knowledge/IconCorrect.svg'
 import FigureListItem from "@/components/list/FigureListItem";
 import { useDidShow } from "@tarojs/taro";
-import { useEffect } from "react";
+import { useEffect, useState } from "react";
 
 import RotateLoading from "@/components/rotate-loading";
 import Taro from "@tarojs/taro";
@@ -15,10 +16,9 @@ import EmptyData from "@/components/empty-data";
 import type { TKnowledgeItem } from "@/types/knowledge";
 
 import { deleteMyKnowledge, getKnowledgeList } from "@/service/knowledge";
-import { useContext } from "react";
+
 import { useLoadMoreInfinite, createKey } from "@/utils/loadMoreInfinite";
 import { isSuccess } from "@/utils";
-import LoginMutationContext from "@/pages/knowledge/LoginMutationContext";
 
 export interface IProps {
   types?: EKnowlegeTypes[];
@@ -26,34 +26,22 @@ export interface IProps {
 }
 
 const Index = ({ types, setTotalCount }: IProps) => {
-  const { isMutate, setLoginShow } = useContext(LoginMutationContext)
-
   const fetcher = async ([_url, { nextId, pageSize }, [types]]) => {
     const res = await getKnowledgeList({ startId: nextId, pageSize, types });
     return res.data;
   };
-  const { list, loadMore, mutate, data, pageIndex, error } = useLoadMoreInfinite<
+  const { list, loadMore, mutate, data, pageIndex } = useLoadMoreInfinite<
     TKnowledgeItem[]
-  >(createKey("getKnowledgeList", 20, [types]), fetcher);
+  >(createKey("getKnowledgeList", 30, [types]), fetcher);
 
   const onScrollToLower = async () => {
     loadMore();
   };
 
   useDidShow(() => {
-    mutate();
+    mutate(undefined, { revalidate: true });
   });
 
-  useEffect(()=> {
-    mutate();
-  }, [isMutate])
-  useEffect(()=> {
-    if(error?.code === 401){
-      setLoginShow(true)
-    }
-    
-  }, [error])
-
   useEffect(() => {
     if (data && pageIndex === 1) {
       setTotalCount(data?.[0].totalCount || 0);
@@ -69,7 +57,7 @@ const Index = ({ types, setTotalCount }: IProps) => {
     });
   };
 
-  const handleLongPress = async (id: string | number) => {
+  const handleDelete = async (id: string | number) => {
     Taro.showModal({
       content: "确认删除该知识?",
       async success(result) {
@@ -87,19 +75,59 @@ const Index = ({ types, setTotalCount }: IProps) => {
     });
   };
 
-  const rightRenderer = (item: TKnowledgeItem) => {
-    if (!item.isParsing) {
-      return <></>;
+  const handleHello = async (e: any) => {
+    const detail = e.detail as { type: string; id: string };
+    console.log(detail);
+    // 置顶与取消置顶
+    if (detail.type === "delete") {
+      handleDelete(detail.id);
     }
+  };
 
+  const rightRenderer = (item: TKnowledgeItem) => {
+    if (item.isParsing) {
+      return (
+        <View className="flex items-center gap-4 self-center">
+          <RotateLoading />
+          <View className="text-primary text-12">解析中</View>
+        </View>
+      );
+    }
+    if(item.parseStatus === 'parsed'){
+      return (
+        <View className="flex items-center self-center">
+          <Image src={IconCorrect} className="w-20 h-20"  />
+        </View>
+      );
+    }
     return (
-      <View className="flex items-center gap-4">
-        <RotateLoading />
-        <View className="text-primary text-12">解析中</View>
+      <View className="flex items-center self-center">
+        <Image src={IconError} className="w-20 h-20"  />
       </View>
     );
   };
 
+  const renderSummary = (item: TKnowledgeItem) => {
+    const createTime = item.createTime.slice(5, 16);
+    if (item.enableExactAnswer) {
+      return (
+        <View className="flex gap-8 items-center">
+          <View>{createTime}</View>
+          <View>|</View>
+          <View className="">
+            已开启 <Text className="text-primary">{item.answerCnt}</Text>{" "}
+            条精准问答
+          </View>
+        </View>
+      );
+    }
+    return (
+      <>
+        {createTime} | {item.fileSizeStr}
+      </>
+    );
+  };
+
   return (
     <ScrollView
       scrollY
@@ -109,37 +137,39 @@ const Index = ({ types, setTotalCount }: IProps) => {
         height: "100%", // 高度自适应
       }}
     >
-      <View className="px-16">
-        {list.length <= 0 ? (
-          <View className="pt-46">
-            <EmptyData type={"plane"} />
-          </View>
-        ) : (
-          <></>
-        )}
-        <FigureList>
-          {list.map((item) => {
-            return (
-              <FigureListItem
-                figure={() => <KnowledgeIcon data={item} />}
-                underline
-                arrow={item.parseStatus === "parsed"}
-                onClick={() => handleEdit(item)}
-                rightRenderer={() => rightRenderer(item)}
-              >
-                <View
-                  className="flex flex-col flex-1 gap-2 w-full"
-                  onLongPress={() => handleLongPress(item.knowledgeId)}
+      {list.length <= 0 ? (
+        <View className="pt-46">
+          <EmptyData type={"plane"} />
+        </View>
+      ) : (
+        <></>
+      )}
+      {/* <slide-delete> 如果被嵌套太深,会无法正常执行原生小程序逻辑 */}
+      <View className="flex flex-col gap-8 mx-16">
+        {list.map((item) => {
+          // @ts-ignore
+          return (
+            <View className="rounded-12 overflow-hidden">
+              <slide-delete pid={item.knowledgeId} onAction={handleHello}>
+                <FigureListItem
+                  className="bg-white p-16"
+                  figure={() => <KnowledgeIcon data={item} />}
+                  onClick={() => handleEdit(item)}
+                  rightRenderer={() => rightRenderer(item)}
                 >
-                  <View className="text-14 leading-22">{item.title}</View>
-                  <View className="text-12 leading-20 text-gray-45">
-                    {item.createTime} | {item.fileSize}
+                  <View className="flex flex-col flex-1 gap-2 w-full truncate">
+                    <View className="text-14 leading-22 truncate">
+                      {item.title}
+                    </View>
+                    <View className="text-12 leading-20 text-gray-45 flex items-center">
+                      {renderSummary(item)}
+                    </View>
                   </View>
-                </View>
-              </FigureListItem>
-            );
-          })}
-        </FigureList>
+                </FigureListItem>
+              </slide-delete>
+            </View>
+          );
+        })}
       </View>
     </ScrollView>
   );

+ 4 - 4
src/pages/knowledge/components/PersonalTab/components/ScrollListChat.tsx

@@ -144,7 +144,7 @@ const Index = ({assistantOnly, setTotalCount}: IProps) => {
       scrollTop={scrollTop}
       style={{
         flex: 1,
-        height: "100%", // 高度自适应
+        height: '100%', // 高度自适应
       }}
     >
       <View className="flex flex-col gap-20 pb-80 px-16">
@@ -162,8 +162,8 @@ const Index = ({assistantOnly, setTotalCount}: IProps) => {
                   avatar: whoami?.avatarUrl ?? '',
                   name: whoami?.nickName ?? ''
                 }}>
-                  <View className="flex items-center gap-12">
-                    <View className="w-36 h-36 overflow-hidden"><KnowledgeIcon data={item} /></View>
+                  <View className="flex items-start gap-12">
+                    <View className="w-36 h-36 overflow-hidden pt-4"><KnowledgeIcon data={item} /></View>
                     <View className="flex flex-col flex-1 gap-2">
                       <View className="text-14 leading-22">{item.title}</View>
                       <View className="text-12 leading-20 text-gray-45">
@@ -188,7 +188,7 @@ const Index = ({assistantOnly, setTotalCount}: IProps) => {
                   return (
                     <FigureListItem
                       figure={()=> {
-                        return <KnowledgeIcon data={item}/>
+                        return <View className="w-36 h-36 overflow-hidden pt-4"><KnowledgeIcon data={item}/></View>
                       }}
                       underline={index + 1 < group.knowledgeList.length}
                       arrow={item.parseStatus === 'parsed'}

+ 12 - 12
src/pages/knowledge/components/PersonalTab/index.tsx

@@ -6,7 +6,7 @@ import Popup from "@/components/popup/popup";
 import { useState } from "react";
 
 import ScrollListChat from "./components/ScrollListChat";
-import ScrollList from "./components/ScrollList";
+import ScrollList from './components/ScrollList';
 import WeComQRcode from '@/components/WeComQRcode'
 
 import StyleFilter, {TListStyle} from '../StyleFilter'
@@ -22,20 +22,20 @@ const Index = () => {
   };
 
   return (
-    <View className="h-full">
-      <StyleFilter onlyAssistantButton checked={assistantOnly} setChecked={setAssistantOnly} listStyle={listStyle} setListStyle={setListStyle}>
-        <View className="flex-1 text-12 leading-20 text-gray-45">
-            共 {totalCount} 个文件
-          </View>
-      </StyleFilter>
-
-      <View className="h-full">
-        {listStyle === "chat" ? <ScrollListChat setTotalCount={setTotalCount} assistantOnly={assistantOnly} /> : <ScrollList setTotalCount={setTotalCount} />}
+    <>
+      <View className="pt-20 pb-20">
+        <StyleFilter onlyAssistantButton checked={assistantOnly} setChecked={setAssistantOnly} listStyle={listStyle} setListStyle={setListStyle}>
+          <View className="flex-1 text-12 leading-20 text-gray-45">
+              共 {totalCount} 个文件
+            </View>
+        </StyleFilter>
       </View>
 
+      {listStyle === "chat" ? <ScrollListChat setTotalCount={setTotalCount} assistantOnly={assistantOnly} /> : <ScrollList setTotalCount={setTotalCount} />}
+
       <View
         onClick={handleShowAsistantTip}
-        className="fixed right-20 bottom-20 w-48 h-48 rounded-full bg-primary flex-center drop-shadow-[0_4px_16px_rgba(49,124,250,0.25)]"
+        className="fixed right-20 bottom-20 z-[200] w-48 h-48 rounded-full bg-primary flex-center drop-shadow-[0_4px_16px_rgba(49,124,250,0.25)]"
       >
         <IconPlusBig></IconPlusBig>
       </View>
@@ -46,7 +46,7 @@ const Index = () => {
           <WeComQRcode text="长按二维码添加" />
         </View>
       </Popup>
-    </View>
+    </>
   );
 };
 

+ 4 - 4
src/pages/knowledge/components/StyleFilter/index.tsx

@@ -12,8 +12,8 @@ interface IProps {
   listStyle?: TListStyle
   setListStyle: (style: TListStyle)=>void
   children: JSX.Element
-  checked: boolean
-  setChecked: (checked: boolean) => void;
+  checked?: boolean
+  setChecked?: (checked: boolean) => void;
   onlyAssistantButton?: boolean;
 }
 
@@ -29,7 +29,7 @@ const Index = ({listStyle = "chat", setListStyle, checked, setChecked,  onlyAssi
 
   return (
     <>
-      <View className="px-16 pb-20">
+      <View className="px-16">
         <View className="flex items-center">
           <View className="flex-1 text-12 leading-20 text-gray-45">
             {children}
@@ -86,7 +86,7 @@ const Index = ({listStyle = "chat", setListStyle, checked, setChecked,  onlyAssi
             </View>
             <WemetaSwitch
               checked={checked}
-              onChange={(checked) => setChecked(checked)}
+              onChange={(checked) => setChecked?.(checked)}
             ></WemetaSwitch>
           </View>}
         </View>

+ 1 - 0
src/pages/knowledge/index.module.less

@@ -6,5 +6,6 @@ page {
   overflow: hidden;
 }
 .tabContent{
+  margin-top: 12px;
   height: calc(100vh - 160px);
 }

+ 7 - 8
src/pages/knowledge/index.tsx

@@ -6,9 +6,10 @@ import { View, Text } from "@tarojs/components";
 import PageCustom from "@/components/page-custom/index";
 import NavBarNormal from "@/components/NavBarNormal/index";
 import WemetaTabs from "@/components/wemeta-tabs/index";
+import BlurContainer from "@/components/BlurContainer";
 import PersonalTab from "./components/PersonalTab";
 import CompanyTab from "./components/CompanyTab";
-import CorrectionList from "./components/CorrectionList";
+import CorrectionTab from "./components/CorrectionTab";
 import TabPageCheckLogin from '@/components/TabPageCheckLogin'
 import style from "./index.module.less";
 import { useRef, useState } from "react";
@@ -16,14 +17,12 @@ import Taro, { useDidShow } from "@tarojs/taro";
 import LoginMutationContext from './LoginMutationContext'
 
 // 渲染统一容器带高光圆角的头部
+// !!! 注意,这里层级不能再深嵌套了,否则内部使用的微信自定义组件 slide-delete 将无法编译成功!!!
 const renderTabContainer = (children: JSX.Element) => {
   return (
-    <View className={style.tabContent}>
-      <View className="pt-12 h-full">
-        <View className="rounded-container-header"></View>
-        {children}
-      </View>
-    </View>
+    <BlurContainer className={style.tabContent}>
+      {children}
+    </BlurContainer>
   );
 };
 
@@ -46,7 +45,7 @@ export default function Index() {
     {
       key: "3",
       label: "纠错记录",
-      children: renderTabContainer(<CorrectionList />),
+      children: renderTabContainer(<CorrectionTab />),
     },
   ];
 

+ 10 - 0
src/styles/iconfont.less → src/styles/_iconfont.less

@@ -1,3 +1,13 @@
+//  由于无设计维护,暂使用 svg 代替 iconfont
+
+
+/* 在线链接服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
+@font-face {
+  font-family: 'font_family';  /* Project id 4668063 */
+  src: url('//at.alicdn.com/t/c/font_4668063_9cn2cmbc63i.woff2?t=1725011811061') format('woff2'),
+       url('//at.alicdn.com/t/c/font_4668063_9cn2cmbc63i.woff?t=1725011811061') format('woff'),
+       url('//at.alicdn.com/t/c/font_4668063_9cn2cmbc63i.ttf?t=1725011811061') format('truetype');
+}
 @font-face {
   font-family: "font_family"; /* Project id 4668063 */
   src: 

+ 1 - 1
tsconfig.json

@@ -26,6 +26,6 @@
       "@/*": ["./src/*"]
     }
   },
-  "include": ["./src", "./types", "./config"],
+  "include": ["./src", "./types", "./config", "./types/**/*.d.ts"],
   "compileOnSave": false
 }

+ 17 - 0
types/custom-components.d.ts

@@ -0,0 +1,17 @@
+import React from "react";
+
+interface SlideDeleteProps {
+  pid: string | number;
+  pinned?: boolean;
+  onAction?: (e: any) => Promise<void>;
+  children: React.ReactNode; // 建议用 React.ReactNode
+}
+declare global {
+  namespace JSX {
+    interface IntrinsicElements {
+      "slide-delete":  SlideDeleteProps;
+      "slide-contact":  SlideDeleteProps;
+      // 你可以继续添加其它自定义组件
+    }
+  }
+}