maotao 2 miesięcy temu
rodzic
commit
c3040060b8

+ 18 - 4
angular.json

@@ -35,13 +35,20 @@
35 35
             "styles": [
36 36
               "src/styles.less",
37 37
               "src/assets/iconfont/iconfont.css",
38
-              "./node_modules/swiper/swiper-bundle.min.css"
38
+              "./node_modules/swiper/swiper-bundle.min.css",
39
+							"node_modules/prismjs/themes/prism-okaidia.css",
40
+							"node_modules/prismjs/plugins/line-numbers/prism-line-numbers.css"
39 41
             ],
40 42
             "scripts": [
41 43
               "node_modules/echarts/dist/echarts.min.js",
42 44
               "./node_modules/swiper/swiper-bundle.min.js",
43 45
               "src/assets/libs/TLWebSocketAgent.js",
44
-              "src/assets/libs/ola_api.js"
46
+              "src/assets/libs/ola_api.js",
47
+							"node_modules/marked/lib/marked.js",
48
+							"node_modules/prismjs/prism.js",
49
+							"node_modules/prismjs/components/prism-csharp.min.js",
50
+							"node_modules/prismjs/components/prism-css.min.js",
51
+							"node_modules/prismjs/plugins/line-numbers/prism-line-numbers.js"
45 52
             ]
46 53
           },
47 54
           "configurations": {
@@ -108,13 +115,20 @@
108 115
             "styles": [
109 116
               "src/styles.less",
110 117
               "src/assets/iconfont/iconfont.css",
111
-              "./node_modules/swiper/swiper-bundle.min.css"
118
+              "./node_modules/swiper/swiper-bundle.min.css",
119
+							"node_modules/prismjs/themes/prism-okaidia.css",
120
+							"node_modules/prismjs/plugins/line-numbers/prism-line-numbers.css"
112 121
             ],
113 122
             "scripts": [
114 123
               "node_modules/echarts/dist/echarts.min.js",
115 124
               "./node_modules/swiper/swiper-bundle.min.js",
116 125
               "src/assets/libs/TLWebSocketAgent.js",
117
-              "src/assets/libs/ola_api.js"
126
+              "src/assets/libs/ola_api.js",
127
+							"node_modules/marked/lib/marked.js",
128
+							"node_modules/prismjs/prism.js",
129
+							"node_modules/prismjs/components/prism-csharp.min.js",
130
+							"node_modules/prismjs/components/prism-css.min.js",
131
+							"node_modules/prismjs/plugins/line-numbers/prism-line-numbers.js"
118 132
             ]
119 133
           }
120 134
         },

+ 64 - 21
package-lock.json

@@ -30,12 +30,14 @@
30 30
         "lodash-es": "^4.17.21",
31 31
         "ng-zorro-antd": "^8.5.2",
32 32
         "ngx-echarts": "^4.2.2",
33
+        "ngx-markdown": "^8.2.2",
33 34
         "ngx-print": "~1.2.1",
34 35
         "ngx-sortablejs": "^3.1.3",
35 36
         "ngx-virtual-scroller": "^4.0.3",
36 37
         "npm": "^6.14.15",
37 38
         "overlayscrollbars": "^1.11.0",
38 39
         "overlayscrollbars-ngx": "^0.1.1",
40
+        "prismjs": "^1.29.0",
39 41
         "rxjs": "~6.4.0",
40 42
         "sortablejs": "^1.14.0",
41 43
         "swiper": "^6.8.4",
@@ -898,6 +900,11 @@
898 900
         "@types/sizzle": "*"
899 901
       }
900 902
     },
903
+    "node_modules/@types/marked": {
904
+      "version": "0.7.4",
905
+      "resolved": "https://registry.npmmirror.com/@types/marked/-/marked-0.7.4.tgz",
906
+      "integrity": "sha512-fdg0NO4qpuHWtZk6dASgsrBggY+8N4dWthl1bAQG9ceKUNKFjqpHaDKCAhRUI6y8vavG7hLSJ4YBwJtZyZEXqw=="
907
+    },
901 908
     "node_modules/@types/minimatch": {
902 909
       "version": "5.1.2",
903 910
       "resolved": "https://registry.npmmirror.com/@types/minimatch/-/minimatch-5.1.2.tgz",
@@ -2886,8 +2893,7 @@
2886 2893
     "node_modules/commander": {
2887 2894
       "version": "2.20.3",
2888 2895
       "resolved": "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz",
2889
-      "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
2890
-      "dev": true
2896
+      "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
2891 2897
     },
2892 2898
     "node_modules/commondir": {
2893 2899
       "version": "1.0.1",
@@ -3371,12 +3377,12 @@
3371 3377
       }
3372 3378
     },
3373 3379
     "node_modules/debug": {
3374
-      "version": "4.3.4",
3375
-      "resolved": "https://registry.npmmirror.com/debug/-/debug-4.3.4.tgz",
3376
-      "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
3380
+      "version": "4.4.0",
3381
+      "resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.0.tgz",
3382
+      "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
3377 3383
       "dev": true,
3378 3384
       "dependencies": {
3379
-        "ms": "2.1.2"
3385
+        "ms": "^2.1.3"
3380 3386
       },
3381 3387
       "engines": {
3382 3388
         "node": ">=6.0"
@@ -6779,6 +6785,17 @@
6779 6785
         "node": ">=0.10.0"
6780 6786
       }
6781 6787
     },
6788
+    "node_modules/katex": {
6789
+      "version": "0.11.1",
6790
+      "resolved": "https://registry.npmmirror.com/katex/-/katex-0.11.1.tgz",
6791
+      "integrity": "sha512-5oANDICCTX0NqYIyAiFCCwjQ7ERu3DQG2JFHLbYOf+fXaMoH8eg/zOq5WSYJsKMi/QebW+Eh3gSM+oss1H/bww==",
6792
+      "dependencies": {
6793
+        "commander": "^2.19.0"
6794
+      },
6795
+      "bin": {
6796
+        "katex": "cli.js"
6797
+      }
6798
+    },
6782 6799
     "node_modules/killable": {
6783 6800
       "version": "1.0.1",
6784 6801
       "resolved": "https://registry.npmmirror.com/killable/-/killable-1.0.1.tgz",
@@ -7145,6 +7162,17 @@
7145 7162
         "node": ">=0.10.0"
7146 7163
       }
7147 7164
     },
7165
+    "node_modules/marked": {
7166
+      "version": "0.7.0",
7167
+      "resolved": "https://registry.npmmirror.com/marked/-/marked-0.7.0.tgz",
7168
+      "integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==",
7169
+      "bin": {
7170
+        "marked": "bin/marked"
7171
+      },
7172
+      "engines": {
7173
+        "node": ">=0.10.0"
7174
+      }
7175
+    },
7148 7176
     "node_modules/md5.js": {
7149 7177
       "version": "1.3.5",
7150 7178
       "resolved": "https://registry.npmmirror.com/md5.js/-/md5.js-1.3.5.tgz",
@@ -7494,9 +7522,9 @@
7494 7522
       }
7495 7523
     },
7496 7524
     "node_modules/ms": {
7497
-      "version": "2.1.2",
7498
-      "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.2.tgz",
7499
-      "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
7525
+      "version": "2.1.3",
7526
+      "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz",
7527
+      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
7500 7528
       "dev": true
7501 7529
     },
7502 7530
     "node_modules/multicast-dns": {
@@ -7640,6 +7668,25 @@
7640 7668
         "echarts": ">=3.1.1"
7641 7669
       }
7642 7670
     },
7671
+    "node_modules/ngx-markdown": {
7672
+      "version": "8.2.2",
7673
+      "resolved": "https://registry.npmmirror.com/ngx-markdown/-/ngx-markdown-8.2.2.tgz",
7674
+      "integrity": "sha512-wo2M2LIiLsuLqvmpeKwk8CDiT0qkxMdyNyCeypwJRcrfkzb6qjWEycA8i9VBBXwFze+8rS2BZn1YXrdezGi/3w==",
7675
+      "dependencies": {
7676
+        "@types/marked": "^0.7.0",
7677
+        "katex": "^0.11.0",
7678
+        "marked": "^0.7.0",
7679
+        "prismjs": "^1.16.0",
7680
+        "tslib": "^1.9.0"
7681
+      },
7682
+      "peerDependencies": {
7683
+        "@angular/common": "^7.0.0 || ^8.0.0",
7684
+        "@angular/core": "^7.0.0 || ^8.0.0",
7685
+        "@angular/platform-browser": "^7.0.0 || ^8.0.0",
7686
+        "rxjs": "^6.0.0",
7687
+        "zone.js": "^0.8.26 || ^0.9.1 || ^0.10.0"
7688
+      }
7689
+    },
7643 7690
     "node_modules/ngx-print": {
7644 7691
       "version": "1.2.1",
7645 7692
       "resolved": "https://registry.npmmirror.com/ngx-print/-/ngx-print-1.2.1.tgz",
@@ -10191,7 +10238,6 @@
10191 10238
     },
10192 10239
     "node_modules/npm/node_modules/lodash._baseindexof": {
10193 10240
       "version": "3.1.0",
10194
-      "extraneous": true,
10195 10241
       "inBundle": true,
10196 10242
       "license": "MIT"
10197 10243
     },
@@ -10206,19 +10252,16 @@
10206 10252
     },
10207 10253
     "node_modules/npm/node_modules/lodash._bindcallback": {
10208 10254
       "version": "3.0.1",
10209
-      "extraneous": true,
10210 10255
       "inBundle": true,
10211 10256
       "license": "MIT"
10212 10257
     },
10213 10258
     "node_modules/npm/node_modules/lodash._cacheindexof": {
10214 10259
       "version": "3.0.2",
10215
-      "extraneous": true,
10216 10260
       "inBundle": true,
10217 10261
       "license": "MIT"
10218 10262
     },
10219 10263
     "node_modules/npm/node_modules/lodash._createcache": {
10220 10264
       "version": "3.1.2",
10221
-      "extraneous": true,
10222 10265
       "inBundle": true,
10223 10266
       "license": "MIT",
10224 10267
       "dependencies": {
@@ -10232,7 +10275,6 @@
10232 10275
     },
10233 10276
     "node_modules/npm/node_modules/lodash._getnative": {
10234 10277
       "version": "3.9.1",
10235
-      "extraneous": true,
10236 10278
       "inBundle": true,
10237 10279
       "license": "MIT"
10238 10280
     },
@@ -10248,7 +10290,6 @@
10248 10290
     },
10249 10291
     "node_modules/npm/node_modules/lodash.restparam": {
10250 10292
       "version": "3.6.1",
10251
-      "extraneous": true,
10252 10293
       "inBundle": true,
10253 10294
       "license": "MIT"
10254 10295
     },
@@ -13090,6 +13131,14 @@
13090 13131
         "node": ">=0.10.0"
13091 13132
       }
13092 13133
     },
13134
+    "node_modules/prismjs": {
13135
+      "version": "1.29.0",
13136
+      "resolved": "https://registry.npmmirror.com/prismjs/-/prismjs-1.29.0.tgz",
13137
+      "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==",
13138
+      "engines": {
13139
+        "node": ">=6"
13140
+      }
13141
+    },
13093 13142
     "node_modules/process": {
13094 13143
       "version": "0.11.10",
13095 13144
       "resolved": "https://registry.npmmirror.com/process/-/process-0.11.10.tgz",
@@ -14170,12 +14219,6 @@
14170 14219
         "node": ">=4"
14171 14220
       }
14172 14221
     },
14173
-    "node_modules/send/node_modules/ms": {
14174
-      "version": "2.1.3",
14175
-      "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz",
14176
-      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
14177
-      "dev": true
14178
-    },
14179 14222
     "node_modules/send/node_modules/statuses": {
14180 14223
       "version": "2.0.1",
14181 14224
       "resolved": "https://registry.npmmirror.com/statuses/-/statuses-2.0.1.tgz",

+ 2 - 0
package.json

@@ -39,12 +39,14 @@
39 39
     "lodash-es": "^4.17.21",
40 40
     "ng-zorro-antd": "^8.5.2",
41 41
     "ngx-echarts": "^4.2.2",
42
+    "ngx-markdown": "^8.2.2",
42 43
     "ngx-print": "~1.2.1",
43 44
     "ngx-sortablejs": "^3.1.3",
44 45
     "ngx-virtual-scroller": "^4.0.3",
45 46
     "npm": "^6.14.15",
46 47
     "overlayscrollbars": "^1.11.0",
47 48
     "overlayscrollbars-ngx": "^0.1.1",
49
+    "prismjs": "^1.29.0",
48 50
     "rxjs": "~6.4.0",
49 51
     "sortablejs": "^1.14.0",
50 52
     "swiper": "^6.8.4",

+ 1 - 1
src/app/app.module.ts

@@ -27,7 +27,7 @@ registerLocaleData(zh);
27 27
     BrowserAnimationsModule,
28 28
     AppRoutingModule,
29 29
     HttpClientModule,
30
-    ShareModule,
30
+    ShareModule
31 31
   ],
32 32
   providers: [
33 33
     { provide: NZ_I18N, useValue: zh_CN },

+ 28 - 0
src/app/components/smart-dialogue/smart-dialogue.component.html

@@ -0,0 +1,28 @@
1
+<div class="save add display_flex align-items_center justify-content_flex-center">
2
+	<div class="modalBody">
3
+		<div class="title">
4
+			智能客服
5
+			<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
6
+		</div>
7
+		<div class="view-box" #scrollContainer>
8
+			<div *ngFor="let message of messagesData;">
9
+				<div class="timestamp" *ngIf="message.showTime">
10
+					<!-- {{ formatSendTime(message.timestamp) }} -->
11
+				</div>
12
+				<div class="content-message" [ngClass]="{'user-message' : message.role === 'user','bot-message': message.role === 'assistant'}">
13
+					<!-- <div markdown [data]="message.content" *ngIf="message.role=='assistant'"></div> -->
14
+					<!-- <markdown lineNumbers ># Hello, Markdown!</markdown> -->
15
+					<!-- <div *ngIf="message.role=='user'">{{message.content}}</div> -->
16
+					{{message.content}}
17
+				</div>
18
+			</div>
19
+		</div>
20
+		<div class="display_flex justify-content_flex-center">
21
+			<nz-input-group nzSearch [nzAddOnAfter]="suffixIconButton">
22
+			  <input type="text" (keydown.enter)="handleEnter()" nz-input [(ngModel)]="userContent" placeholder="请输入您想咨询的问题" />
23
+			</nz-input-group>
24
+			<ng-template #suffixIconButton>
25
+			  <button nz-button nzType="primary" nzSearch (click)="searchDeepSeek()"><i nz-icon nzType="search"></i></button>
26
+			</ng-template>
27
+		</div>
28
+	</div>

+ 366 - 0
src/app/components/smart-dialogue/smart-dialogue.component.less

@@ -0,0 +1,366 @@
1
+@import "../../../../src/theme.less";
2
+:host {
3
+  .add-button {
4
+    margin: 0 auto 16px !important;
5
+  }
6
+  .targetDept {
7
+    overflow: hidden;
8
+    // width: 90px;
9
+    text-overflow: ellipsis;
10
+    white-space: nowrap;
11
+  }
12
+  .dynamic {
13
+    margin-bottom: 16px;
14
+    display: flex;
15
+    align-items: center;
16
+    input {
17
+      width: 90%;
18
+    }
19
+    i {
20
+      margin-left: 8px;
21
+      cursor: pointer;
22
+      font-size: 18px;
23
+    }
24
+  }
25
+}
26
+
27
+.save {
28
+  position: fixed;
29
+  left: 0;
30
+  top: 0;
31
+  width: 100%;
32
+  height: 100%;
33
+  background: rgba(0, 0, 0, 0.4);
34
+  z-index: 99;
35
+
36
+  .modalBody {
37
+    width: 70%;
38
+    background: #fff;
39
+    border-radius: 5px;
40
+    padding: 10px 20px;
41
+    color: #333;
42
+
43
+    .title {
44
+      width: 100%;
45
+      text-align: center;
46
+      font-size: 18px;
47
+      position: relative;
48
+			margin-bottom: 10px;
49
+      i {
50
+        position: absolute;
51
+        right: 0;
52
+        top: 0;
53
+        font-size: 20px;
54
+        color: #666;
55
+        cursor: pointer;
56
+        padding: 0 5px;
57
+      }
58
+    }
59
+    .content {
60
+      width: 100%;
61
+      height: 117px;
62
+      background: #f9fafb;
63
+      border: 1px solid #e5e9ed;
64
+      border-radius: 5px;
65
+      overflow: hidden;
66
+      margin-top: 12px;
67
+
68
+      div {
69
+        text-align: center;
70
+        margin: 0;
71
+
72
+        &.icon {
73
+          margin-top: 17px;
74
+
75
+          i {
76
+            color: #34b349;
77
+            font-size: 30px !important;
78
+
79
+            &.transport-wenhao {
80
+              color: #f5a523;
81
+            }
82
+
83
+            &.transport-shibai {
84
+              color: #ff3a52;
85
+            }
86
+          }
87
+        }
88
+
89
+        &.defeat {
90
+          color: #333;
91
+          font-size: 18px;
92
+        }
93
+
94
+        &:nth-child(3) {
95
+          font-size: 14px;
96
+          color: #666;
97
+        }
98
+      }
99
+    }
100
+
101
+    button {
102
+      &.btn {
103
+        margin-left: 8px;
104
+      }
105
+    }
106
+  }
107
+
108
+  // 查看/审核
109
+  &.add {
110
+    .modalBody {
111
+      width: 70%;
112
+      height: auto;
113
+				.mask-style{
114
+					width: 100%;
115
+					height: 100%;
116
+					position: fixed;
117
+					top: 0;
118
+					left: 0;
119
+					z-index: 999;
120
+					display: flex;
121
+					background: rgba(0,0,0,0.2);
122
+					align-items: center;
123
+					justify-content: center;
124
+				}
125
+				.spin-style{
126
+					z-index:9999;
127
+				}
128
+			.view-box{
129
+				height: 400px;
130
+				padding: 20px;
131
+				overflow-y: auto;
132
+				border: 1px solid #eee;
133
+				margin-bottom: 10px;
134
+				border-radius: 5px;
135
+				.content-message{
136
+					position: relative;
137
+					padding: 10px 15px;
138
+					border-radius: 10px;
139
+					font-size: 14px;
140
+					color: #333;
141
+					line-height: 25px;
142
+					width: fit-content;
143
+					max-width: 70%;
144
+				}
145
+				
146
+				.user-message {
147
+				  background: #34b349;
148
+					color: #fff;
149
+					margin-left: auto;
150
+				}
151
+				 
152
+				.bot-message {
153
+				  background: #f2f2f2;
154
+				  color: #000;
155
+				}
156
+				
157
+				.left-box{
158
+					flex: 1;
159
+					font-size: 14px;
160
+					border-right: 1px solid #E9E9E9;
161
+					overflow-y: auto;
162
+					.item-left-list{
163
+						display: flex;
164
+						align-items: center;
165
+						height: 35px;
166
+						padding-left: 10px;
167
+						cursor: pointer;
168
+					}
169
+				}
170
+				.center-box{
171
+					flex: 6;
172
+					padding: 0 20px 20px 20px;
173
+					border-right: 1px solid #E9E9E9;
174
+					height: auto;
175
+					overflow-y: auto;
176
+					.title{
177
+						margin: 10px 0 10px 0;
178
+						font-weight: bold;
179
+						font-size: 20px;
180
+						color: #000000;
181
+						font-style: normal;
182
+						text-transform: none;
183
+					}
184
+					.title-sign{
185
+						display: flex;
186
+						font-weight: 400;
187
+						font-size: 12px;
188
+						color: #555555;
189
+						margin-bottom: 5px;
190
+						.width-180{
191
+							width: 160px;
192
+						}
193
+						div{
194
+							margin-right: 60px;
195
+						}
196
+					}
197
+					.content-class{
198
+						margin-top: 20px;
199
+					}
200
+					.file-box{
201
+						margin-top: 30px;
202
+						font-size: 14px;
203
+						.file-class{
204
+							color: #1890FF;
205
+							text-decoration: underline;
206
+							margin-left: 10px;
207
+							cursor: pointer;
208
+						}
209
+						.download-icon{
210
+							margin-left: 8px;
211
+						}
212
+					}
213
+				}
214
+				.right-box{
215
+					flex: 1.6;
216
+					padding: 10px;
217
+					font-size: 14px;
218
+					overflow-y: auto;
219
+					.back-class{
220
+						color: red;
221
+						cursor: pointer;
222
+					}
223
+				}
224
+			}
225
+      .content {
226
+        width: 100%;
227
+        height: auto;
228
+        padding: 19px 14px 0 14px;
229
+        max-height: 500px;
230
+        overflow-y: auto;
231
+
232
+				.ant-select{
233
+					width: 100%;
234
+				}
235
+				.ant-calendar-picker{
236
+					width: 100% !important;
237
+				}
238
+				.list-template__bottom {
239
+				  background: #f9fafb;
240
+				  border: 1px solid #e5e9ed;
241
+				  border-radius: 8px;
242
+				  padding-bottom: 56px;
243
+				  position: relative;
244
+				  .list-template__nzTable {
245
+				    padding: 16px 16px 0;
246
+
247
+				    .thead {
248
+				      background-image: linear-gradient(to right, @bg-start, @bg-end);
249
+
250
+				      th {
251
+				        background: transparent;
252
+				        color: #fff;
253
+				        text-align: center;
254
+				      }
255
+				    }
256
+
257
+				    .ant-table-body {
258
+				      border-bottom: 1px solid #e5e9ed;
259
+				    }
260
+
261
+				    .ant-table-tbody {
262
+				      tr {
263
+				        text-align: center;
264
+				        color: #333;
265
+
266
+				        td {
267
+				          border: none;
268
+
269
+				          &.tab_hover:hover{
270
+				            text-decoration: underline;
271
+				            cursor: pointer;
272
+				          }
273
+
274
+				          .coop {
275
+				            button{
276
+				              color: #333;
277
+				            }
278
+				            span,button {
279
+				              display: inline-block;
280
+				              padding: 0 8px;
281
+				              cursor: pointer;
282
+				              position: relative;
283
+
284
+				              &::after {
285
+				                content: "|";
286
+				                position: absolute;
287
+				                top: 0;
288
+				                right: 0;
289
+				              }
290
+
291
+				              &:hover,
292
+				              &:active {
293
+				                color: @primary-color;
294
+				              }
295
+
296
+				              &:nth-last-child(1) {
297
+				                &::after {
298
+				                  content: "";
299
+				                }
300
+				              }
301
+				            }
302
+				          }
303
+				        }
304
+				      }
305
+				    }
306
+				  }
307
+				  .list-template__pagination {
308
+				    height: 56px;
309
+				    display: flex;
310
+				    align-items: center;
311
+				    position: absolute;
312
+				    right: 8px;
313
+				  }
314
+				}
315
+
316
+        .addForm {
317
+          .ant-form-item {
318
+            margin-bottom: 14px;
319
+
320
+            .ant-form-item-label {
321
+              line-height: 14px;
322
+              text-align: left;
323
+            }
324
+          }
325
+        }
326
+
327
+        .editForm {
328
+          .ant-form-item {
329
+            margin-bottom: 14px;
330
+
331
+            .ant-form-item-label {
332
+              line-height: 0;
333
+              text-align: left;
334
+            }
335
+          }
336
+        }
337
+      }
338
+    }
339
+  }
340
+}
341
+
342
+.activeClass{
343
+	background: #F0F6ED;
344
+}
345
+
346
+.monad{
347
+	margin-top: 20px;
348
+	.monad-list{
349
+		border: 1px solid #e7e7e7;
350
+		border-radius: 5px;
351
+		margin-bottom: 40px;
352
+		padding: 20px;
353
+	}
354
+	.monad-title{
355
+		text-align: center;
356
+		font-weight: 700;
357
+		font-size: 16px;
358
+	}
359
+	.monad-sign{
360
+		display: flex;
361
+		line-height: 30px;
362
+		div{
363
+			margin-right: 15px;
364
+		}
365
+	}
366
+}

+ 89 - 0
src/app/components/smart-dialogue/smart-dialogue.component.ts

@@ -0,0 +1,89 @@
1
+import { Component, OnInit, Output, Input } from '@angular/core';
2
+import { EventEmitter, ElementRef, AfterViewInit, ViewChild  } from '@angular/core';
3
+import { MainService } from 'src/app/services/main.service';
4
+import { DomSanitizer } from '@angular/platform-browser';
5
+import { ToolService } from 'src/app/services/tool.service';
6
+import { format } from 'date-fns';
7
+
8
+@Component({
9
+  selector: 'app-smart-dialogue',
10
+  templateUrl: './smart-dialogue.component.html',
11
+  styleUrls: ['./smart-dialogue.component.less']
12
+})
13
+export class SmartDialogueComponent implements OnInit  {
14
+  @Output() cancelModal = new EventEmitter();
15
+  @Input() knowledgeData: any = {};
16
+	@ViewChild('scrollContainer', {static: false}) scrollContainer: ElementRef;
17
+	
18
+  constructor(
19
+    private mainService: MainService,
20
+    private sanitizer: DomSanitizer,
21
+    private tool: ToolService,
22
+  ) { }
23
+
24
+  ngOnInit() {
25
+    this.hosId = this.tool.getCurrentHospital().id;
26
+  }
27
+		
28
+	userContent:any;
29
+  hosId: number;
30
+  messagesData:any = [];
31
+	
32
+	// 回车
33
+	handleEnter(){
34
+		this.searchDeepSeek()
35
+	}
36
+	
37
+  searchDeepSeek(){
38
+		this.scrollContainer.nativeElement.scrollTop = this.scrollContainer.nativeElement.scrollHeight;
39
+		if(this.userContent==''){
40
+			return
41
+		}
42
+		let messagesStr = JSON.parse(JSON.stringify(this.userContent))
43
+		this.messagesData.push({
44
+			role: "user",
45
+			content: messagesStr,
46
+			// timestamp: new Date(), //时间戳
47
+		});
48
+		this.userContent = '';
49
+		this.messagesData.push({
50
+			role: "assistant",
51
+			content: "正在思考中...",
52
+			// timestamp: new Date(), //时间戳
53
+		});
54
+		let arr = this.messagesData.filter((item) => {
55
+			return item.content.indexOf("正在思考中") === -1;
56
+		});
57
+		this.mainService.getDeepSeekData({
58
+			chatList:arr
59
+		})
60
+			.subscribe((res:any) => {
61
+				// messageContainer.scrollTop = messageContainer.scrollHeight;
62
+				this.messagesData = this.messagesData.filter((item) => {
63
+				  return item.content.indexOf("正在思考中") === -1;
64
+				});
65
+				
66
+				if (res.state==200) {
67
+					let data = JSON.parse(res.data)
68
+					console.log(564,data)
69
+					this.messagesData.push({
70
+						role: "assistant",
71
+						content: data.choices[0].message.content,
72
+						// timestamp: new Date(), //时间戳
73
+					});
74
+				} else {
75
+					this.messagesData.push({
76
+						role: "assistant",
77
+						content: "抱歉,我现在无法回答您的问题,请稍后再试。",
78
+						// timestamp: new Date(), //时间戳
79
+					});
80
+				}
81
+				this.scrollContainer.nativeElement.scrollTop = this.scrollContainer.nativeElement.scrollHeight;
82
+			});
83
+  }
84
+
85
+  // 隐藏模态框
86
+  hideModal() {
87
+    this.cancelModal.emit(false)
88
+  }
89
+}

+ 21 - 0
src/app/components/smart-dialogue/smart-dialogue.module.ts

@@ -0,0 +1,21 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { SmartDialogueComponent } from './smart-dialogue.component';
5
+import { ShareModule } from 'src/app/share/share.module';
6
+import { MarkdownModule } from 'ngx-markdown';
7
+
8
+@NgModule({
9
+  declarations: [
10
+    SmartDialogueComponent,
11
+  ],
12
+  imports: [
13
+    CommonModule,
14
+    ShareModule,
15
+		MarkdownModule.forChild()
16
+  ],
17
+  exports: [
18
+    SmartDialogueComponent
19
+  ]
20
+})
21
+export class SmartDialogueModule { }

+ 6 - 1
src/app/services/main.service.ts

@@ -1094,5 +1094,10 @@ export class MainService {
1094 1094
 	    headers: this.headers,
1095 1095
 	  });
1096 1096
 	}
1097
-	
1097
+	// 获取deepSeek数据
1098
+	getDeepSeekData(data){
1099
+		return this.http.post(host.host + `/user/data/ds/chat`, data, {
1100
+		  headers: this.headers,
1101
+		});
1102
+	}
1098 1103
 }

+ 7 - 0
src/app/views/hushijiandan/hushijiandan.component.html

@@ -2730,5 +2730,12 @@
2730 2730
   </div>
2731 2731
 </nz-modal>
2732 2732
 
2733
+<!-- <div class="kefu" (click)="smartOpen()">
2734
+	<img src="../../assets/images/kefu.png" alt="">
2735
+</div> -->
2736
+
2733 2737
 <!-- 快捷方式建单弹窗 -->
2734 2738
 <app-build-quick-confirm *ngIf="isShowBuildQuickConfirm" [buildQuickConfirmData]="buildQuickConfirmData" (cancelModal)="cancelBuildQuickConfirm($event)" (confirmModal)="confirmBuildQuickConfirm($event)" [loading5]="loadingQuick"></app-build-quick-confirm>
2739
+
2740
+<!-- 智能客服 -->
2741
+<app-smart-dialogue *ngIf="smartShow" (cancelModal)="smartClose($event)"></app-smart-dialogue>

+ 10 - 0
src/app/views/hushijiandan/hushijiandan.component.less

@@ -2762,3 +2762,13 @@
2762 2762
     }
2763 2763
   }
2764 2764
 }
2765
+
2766
+.kefu{
2767
+	position: fixed;
2768
+	bottom: 20px;
2769
+	right: 20px;
2770
+	img{
2771
+		width: 50px;
2772
+		cursor: pointer;
2773
+	}
2774
+}

+ 11 - 1
src/app/views/hushijiandan/hushijiandan.component.ts

@@ -176,7 +176,7 @@ export class HushijiandanComponent implements OnInit {
176 176
   coopBtns: any = {};
177 177
 	surgeryDataId: any; //手术id
178 178
 	patientDataId: any; //病人id
179
-
179
+	smartShow:boolean = false; //智能客服弹框
180 180
   ngOnInit() {
181 181
     this.getCoopBtns();
182 182
     this.currentHospital = this.tool.getCurrentHospital();
@@ -314,6 +314,16 @@ export class HushijiandanComponent implements OnInit {
314 314
     console.log(this.coopBtns);
315 315
   }
316 316
 	
317
+	// 关闭客服弹框
318
+	smartClose(e){
319
+		this.smartShow = false;
320
+	}
321
+	
322
+	// 打开客服弹框
323
+	smartOpen(e){
324
+		this.smartShow = true;
325
+	}
326
+	
317 327
 	// 预览图片
318 328
 	imgs = [];
319 329
 	isPreview = false;

+ 2 - 1
src/app/views/hushijiandan/hushijiandan.module.ts

@@ -8,12 +8,13 @@ import { DragModule } from 'src/app/directives/drag/drag.module';
8 8
 import { SortablejsModule } from 'ngx-sortablejs';
9 9
 import { NgxPrintModule } from 'ngx-print';
10 10
 import { BuildQuickConfirmComponent } from 'src/app/components/build-quick-confirm/build-quick-confirm.component';
11
-
11
+import { SmartDialogueComponent } from 'src/app/components/smart-dialogue/smart-dialogue.component';
12 12
 
13 13
 @NgModule({
14 14
   declarations: [
15 15
     HushijiandanComponent,
16 16
     BuildQuickConfirmComponent,
17
+		SmartDialogueComponent,
17 18
   ],
18 19
   imports: [
19 20
     CommonModule,

+ 14 - 14
src/app/views/new-statistics/maintenance-statistics/synthesize-statistics/synthesize-statistics.component.html

@@ -15,30 +15,30 @@
15 15
 	<div class="top1-statistics">
16 16
 		<div class="top-list">
17 17
 			<div class="special-box">
18
-				<div class="num">{{workData.gd_total}}</div>
18
+				<div class="num">{{workData.gd_total || 0}}</div>
19 19
 				<div class="describe">工单总数</div>
20 20
 			</div>
21 21
 			<div class="special-box-right">
22
-				<div class="sign-describe">已完成: <span class="sign-num">{{workData.gd_close}}</span></div>
23
-				<div class="sign-describe">待接单: <span class="sign-num">{{workData.gd_todo}}</span></div>
24
-				<div class="sign-describe">处理中: <span class="sign-num">{{workData.gd_doing}}</span></div>
22
+				<div class="sign-describe">已完成: <span class="sign-num">{{workData.gd_close || 0}}</span></div>
23
+				<div class="sign-describe">待接单: <span class="sign-num">{{workData.gd_todo || 0}}</span></div>
24
+				<div class="sign-describe">处理中: <span class="sign-num">{{workData.gd_doing || 0}}</span></div>
25 25
 			</div>
26 26
 		</div>
27 27
 		<div class="top-list">
28 28
 			<div class="special-box">
29
-				<div class="num">{{workData.sum_price}}</div>
29
+				<div class="num">{{workData.sum_price || 0}}</div>
30 30
 				<div class="describe">总费用 (元)</div>
31 31
 			</div>
32 32
 		</div>
33 33
 		<div class="top-list">
34 34
 			<div class="special-box">
35
-				<div class="num">{{workData.gd_postpone}}</div>
35
+				<div class="num">{{workData.gd_postpone || 0}}</div>
36 36
 				<div class="describe">挂起单数</div>
37 37
 			</div>
38 38
 		</div>
39 39
 		<div class="top-list">
40 40
 			<div class="special-box">
41
-				<div class="num">{{workData.gd_overtime}}</div>
41
+				<div class="num">{{workData.gd_overtime || 0}}</div>
42 42
 				<div class="describe">超时单数</div>
43 43
 			</div>
44 44
 		</div>
@@ -78,10 +78,10 @@
78 78
 						<span *ngIf="index !=0 && index !=1 && index !=2">{{index+1}}</span>
79 79
 					</div>
80 80
 					<div class="table-list">{{item.name}}</div>
81
-					<div class="table-list">{{item.count}}</div>
82
-					<div class="table-list">{{item.avg_handle}}分</div>
81
+					<div class="table-list">{{item.count || 0}}</div>
83 82
 					<div class="table-list">{{item.avg_response}}分</div>
84
-					<div class="table-list">{{item.overtime}}</div>
83
+					<div class="table-list">{{item.avg_handle }}分</div>
84
+					<div class="table-list">{{item.overtime || 0}}</div>
85 85
 				</div>
86 86
 			</div>
87 87
 		</div>
@@ -135,8 +135,8 @@
135 135
 				<div class="th" *ngFor="let item of deptCostData; let index = index;">
136 136
 					<div class="table-list-4">{{index+1}}</div>
137 137
 					<div class="table-list-4">{{item.dept}}</div>
138
-					<div class="table-list-4">{{item.sum}}</div>
139
-					<div class="table-list-4">{{item.sum_price}}</div>
138
+					<div class="table-list-4">{{item.sum || 0}}</div>
139
+					<div class="table-list-4">{{item.sum_price || 0}}</div>
140 140
 				</div>
141 141
 			</div>
142 142
 		</div>
@@ -156,8 +156,8 @@
156 156
 				<div class="th" *ngFor="let item of consumableData; let index = index;">
157 157
 					<div class="table-list-4">{{index+1}}</div>
158 158
 					<div class="table-list-4">{{item.name}}({{item.spd_code}})</div>
159
-					<div class="table-list-4">{{item.sum}}</div>
160
-					<div class="table-list-4">{{item.sum_price}}</div>
159
+					<div class="table-list-4">{{item.sum || 0}}</div>
160
+					<div class="table-list-4">{{item.sum_price || 0}}</div>
161 161
 				</div>
162 162
 			</div>
163 163
 		</div>

BIN
src/assets/images/kefu.png