@hddjs/hdd-cloud-types 1.0.15-SNAPSHOT.1 → 1.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -66,10 +66,6 @@ export interface IGetRecommendSchool {
66
66
  * 省控线
67
67
  */
68
68
  minControlLine?: number;
69
- /**
70
- * 排名
71
- */
72
- rank?: number;
73
69
  /**
74
70
  * 招生代码
75
71
  */
@@ -78,6 +74,10 @@ export interface IGetRecommendSchool {
78
74
  * 专业名称
79
75
  */
80
76
  majorName?: string;
77
+ /**
78
+ * 去年最低排名
79
+ */
80
+ rank?: number;
81
81
  /**
82
82
  * 学费
83
83
  */
@@ -87,7 +87,11 @@ export interface IGetRecommendSchool {
87
87
  */
88
88
  hc?: number;
89
89
  /**
90
- * 冲稳保标识
90
+ * 排序理由
91
+ */
92
+ rankReason?: string;
93
+ /**
94
+ * 冲稳保策略标识
91
95
  */
92
96
  strategyTag?: 'chong' | 'wen' | 'bao';
93
97
  }
@@ -0,0 +1,250 @@
1
+ /**
2
+ * FieldType
3
+ * 字段类型
4
+ */
5
+ export const enum FieldType {
6
+ /** 文本输入 */
7
+ TEXT = 'text',
8
+ /** 数字输入 */
9
+ NUMBER = 'number',
10
+ /** 单选框 */
11
+ RADIO = 'radio',
12
+ /** 多选框 */
13
+ CHECKBOX = 'checkbox',
14
+ /** 开关 */
15
+ SWITCH = 'switch',
16
+ /** 滑块 */
17
+ SLIDER = 'slider',
18
+ /** 分割线 */
19
+ DIVIDER = 'divider',
20
+ /** 标题 */
21
+ TITLE = 'title',
22
+ /** 描述文本 */
23
+ DESCRIPTION = 'description',
24
+ /** QuestionBase 风格的字段列表卡片布局(问题在左,答案在右) */
25
+ QUESTION_BASE_CARD = 'question_base_card',
26
+ /** 弹窗选项选择器 */
27
+ POPUP_OPTIONS_SELECTOR = 'popup-options-selector',
28
+ /** 自定义选择器 前端渲染提前准备的自定义选择器组件 */
29
+ CUSTOM_COMPONENT = 'custom-component'
30
+ }
31
+
32
+ /**
33
+ * 选项接口
34
+ */
35
+ export interface IBaseOption {
36
+ /**
37
+ * 选项值
38
+ */
39
+ value?: string | number;
40
+ /**
41
+ * 选项标签
42
+ */
43
+ label?: string;
44
+ }
45
+
46
+ /**
47
+ * 自定义选择器选项接口
48
+ */
49
+ export interface ICustomSelectorOption extends IBaseOption {
50
+ /**
51
+ * 选项描述
52
+ */
53
+ description?: string;
54
+ /**
55
+ * 图标(font awesome Unicode 字符)
56
+ */
57
+ icon?: string;
58
+ /**
59
+ * 图标背景色
60
+ */
61
+ color?: string;
62
+ }
63
+
64
+ /**
65
+ * 自定义验证规则接口
66
+ */
67
+ export interface ICustomRules {
68
+ /**
69
+ * 由于rules由后端下发 所以不能使用函数表达式 只能使用字符串。
70
+ * 由于跨端限制,执行时候 不能使用eval等方法,需要使用正则替换和专门解析工具来解析rule,为可执行的js代码。
71
+ * 自定义验证规则可以处理跨字段依赖的验证。
72
+ * 执行验证时候需要替换字符串为特定值,字符串会使用 ${value} 占位。${}内部为取数路径
73
+ * ROOT 为根节点,${age} 为根配置中name为age的字段配置;ROOT.${age}.value 为根配置中name为age的字段的值。
74
+ * e.g.:
75
+ * ROOT.${age}.value >= 18"
76
+ * ROOT.${age1}.value >= ROOT.${age2}.value"
77
+ */
78
+ rule: string;
79
+ }
80
+
81
+ /**
82
+ * 低代码项渲染配置
83
+ */
84
+ export interface FieldConfig {
85
+ /**
86
+ * 字段名称
87
+ */
88
+ name?: string;
89
+ /**
90
+ * 字段标签
91
+ */
92
+ label?: string;
93
+ /*
94
+ * 是否必填
95
+ */
96
+ required?: boolean;
97
+ /**
98
+ * value 字段值
99
+ */
100
+ value?: unknown;
101
+ /**
102
+ * rules 字段验证规则
103
+ * 由于rules由后端下发 所以不能使用函数表达式 只能使用字符串
104
+ * 执行验证时候需要替换字符串为特定值,字符串会使用 ${value} 占位。${}内部为取数路径 如
105
+ */
106
+ rules?: ICustomRules[];
107
+ /**
108
+ * 字段描述
109
+ */
110
+ description?: string;
111
+ /**
112
+ * 占位符
113
+ */
114
+ placeholder?: string;
115
+ /**
116
+ * 字段展示类型
117
+ */
118
+ fieldType?: FieldType;
119
+ /**
120
+ * 嵌套字段列表
121
+ */
122
+ fields?: FieldConfig[];
123
+ /**
124
+ * 用于 fieldType = FieldType.TEXT 类型的文本输入配置
125
+ */
126
+ textConfig?: {
127
+ /**
128
+ * 输入框类型
129
+ */
130
+ inputType?: 'text' | 'textArea' | 'password' | 'email' | 'tel' | 'url';
131
+ /**
132
+ * 最大长度(用于 textarea 类型)
133
+ */
134
+ maxlength?: number;
135
+ };
136
+ /**
137
+ * 用于 fieldType = FieldType.NUMBER 类型的数字输入配置
138
+ */
139
+ numberConfig?: {
140
+ /**
141
+ * 最小值(用于 number、slider 类型)
142
+ */
143
+ min?: number;
144
+ /**
145
+ * 最大值(用于 number、slider 类型)
146
+ */
147
+ max?: number;
148
+ };
149
+ /**
150
+ * 用于 fieldType = FieldType.RADIO 类型的单选框配置
151
+ */
152
+ radioConfig?: {
153
+ /**
154
+ * 选项列表
155
+ */
156
+ options?: IBaseOption[];
157
+ };
158
+ /**
159
+ * 用于 fieldType = FieldType.CHECKBOX 类型的多选框配置
160
+ */
161
+ checkboxConfig?: {
162
+ /**
163
+ * 选项列表
164
+ */
165
+ options?: IBaseOption[];
166
+ };
167
+ /**
168
+ * 用于 fieldType = FieldType.QUESTION_BASE_CARD 类型的卡片配置
169
+ */
170
+ questionBaseCardConfig?: {
171
+ /**
172
+ * 卡片标题
173
+ */
174
+ title?: string;
175
+ /**
176
+ * 卡片图标(Unicode 字符)
177
+ */
178
+ icon?: string;
179
+ /**
180
+ * 卡片描述
181
+ */
182
+ description?: string;
183
+ /**
184
+ * 图标背景色(CSS 颜色值或渐变)
185
+ */
186
+ iconBackground?: string;
187
+ /**
188
+ * 图标颜色
189
+ */
190
+ iconColor?: string;
191
+ };
192
+ /**
193
+ * 用于 fieldType = FieldType.SLIDER 类型的开关配置
194
+ */
195
+ sliderConfig?: {
196
+ /**
197
+ * 最小值
198
+ */
199
+ min?: number;
200
+ /**
201
+ * 最大值
202
+ */
203
+ max?: number;
204
+ /**
205
+ * 步长
206
+ */
207
+ step?: number;
208
+ };
209
+ /**
210
+ * 当 fieldType = FieldType.CUSTOM_COMPONENT 时,自定义选择器组件配置
211
+ */
212
+ customComponentConfig?: {
213
+ /**
214
+ * 自定义组件名称(组件需放在 components 目录下)
215
+ * 所有自定义组件都放在 ./components 目录下
216
+ * 自定义组件均会提供 confirm:(value: any) => void 和 close:() => void 事件
217
+ * 例如:'province-selector' 对应 ./components/province-selector/province-selector.vue
218
+ */
219
+ componentName: string;
220
+ /**
221
+ * 传递给自定义组件的额外配置
222
+ */
223
+ componentProps?: Record<string, any>;
224
+ };
225
+ /**
226
+ * 当 fieldType = FieldType.POPUP_OPTIONS_SELECTOR 时,低代码配置选择器配置
227
+ */
228
+ popupOptionsSelectorConfig?: {
229
+ /**
230
+ * 选择器标题
231
+ */
232
+ title?: string;
233
+ /**
234
+ * 主描述文本
235
+ */
236
+ mainDescription?: string;
237
+ /**
238
+ * 副描述文本
239
+ */
240
+ subDescription?: string;
241
+ /**
242
+ * 选项列表(支持图标、颜色、描述等)
243
+ */
244
+ options?: Array<ICustomSelectorOption>;
245
+ /**
246
+ * 确认按钮文本
247
+ */
248
+ confirmText?: string;
249
+ };
250
+ }
@@ -1,3 +1,5 @@
1
+ import { type IGetRecommendSchool } from './IGetRecommendSchool';
2
+
1
3
  /**
2
4
  * 高考霍兰德职业兴趣测评报告接口
3
5
  * @interface IGaokaoInterestReport
@@ -71,45 +73,7 @@ export interface IGaokaoMajorMatchingReport {
71
73
  * @interface IGaokaoVolunteerRecommendationReport
72
74
  */
73
75
  export interface IGaokaoVolunteerRecommendationReport {
74
- recommendations: IRecommendationSchoolItem[];
75
- }
76
-
77
- /**
78
- * 院校排序等推荐列表项
79
- */
80
- export interface IRecommendationSchoolItem {
81
- /**
82
- * 学校名称
83
- */
84
- schoolName?: String;
85
- /**
86
- * 招生代码
87
- */
88
- enrollmentId?: string;
89
- /**
90
- * 专业名称
91
- */
92
- majorName?: string;
93
- /**
94
- * 去年最低排名
95
- */
96
- rank?: number;
97
- /**
98
- * 学费
99
- */
100
- money?: number;
101
- /**
102
- * 招生人数
103
- */
104
- hc?: number;
105
- /**
106
- * 排序理由
107
- */
108
- rankReason?: string;
109
- /**
110
- * 冲稳保策略标识
111
- */
112
- strategyTag?: 'chong' | 'wen' | 'bao';
76
+ recommendations: IGetRecommendSchool[];
113
77
  }
114
78
 
115
79
  /**
@@ -10,9 +10,9 @@ import { type SubReportTypeEnum } from './SubReportTypeEnum';
10
10
  */
11
11
  export interface IReportInfo {
12
12
  /**
13
- * 会话id
13
+ * 报告id
14
14
  */
15
- sessionId?: string;
15
+ reportId?: string;
16
16
  /**
17
17
  * 报告类型
18
18
  */
@@ -0,0 +1,46 @@
1
+ import { type ReportTypeEnum } from './ReportTypeEnum';
2
+ import { type IGetRecommendSchool } from './IGetRecommendSchool';
3
+
4
+ /**
5
+ * 报告列表
6
+ */
7
+ export interface IReportList {
8
+ /**
9
+ * 报告类型
10
+ */
11
+ type?: ReportTypeEnum;
12
+ /**
13
+ * 标题
14
+ */
15
+ title?: string;
16
+ /**
17
+ * 创建时间
18
+ */
19
+ createTime?: number;
20
+ /**
21
+ * 高考报告
22
+ */
23
+ gaokaoReportInfo?: IGaoKaoReportInfo;
24
+ }
25
+
26
+ /**
27
+ * 高考报告列表
28
+ */
29
+ export interface IGaoKaoReportInfo {
30
+ /**
31
+ * 分数
32
+ */
33
+ grade?: number | null;
34
+ /**
35
+ * 排名
36
+ */
37
+ rank?: number | null;
38
+ /**
39
+ * 分组名称
40
+ */
41
+ groupDesc?: string;
42
+ /**
43
+ * 推荐院校
44
+ */
45
+ recommendSchool?: IGetRecommendSchool[];
46
+ }
@@ -1,3 +1,4 @@
1
+ import { type FieldConfig } from './ILowerCoderForm';
1
2
  import { type SessionRoleEnum } from './ISessionRole';
2
3
 
3
4
  /**
@@ -30,6 +31,16 @@ export interface ISessionContent {
30
31
  toolMessage?: IToolMessage;
31
32
  }
32
33
 
34
+ /**
35
+ * 系统消息
36
+ */
37
+ export interface ISystemMessage {
38
+ /**
39
+ * 内容
40
+ */
41
+ content?: string;
42
+ }
43
+
33
44
  /**
34
45
  * 工具消息类型
35
46
  */
@@ -92,7 +103,7 @@ export interface IToolMessage {
92
103
  /**
93
104
  * 工具消息类型
94
105
  */
95
- type: IToolTypeEnum;
106
+ type?: IToolTypeEnum;
96
107
  /**
97
108
  * 工具消息内容
98
109
  */
@@ -115,11 +126,16 @@ export interface IToolMessage {
115
126
  actionDescription?: string;
116
127
  };
117
128
  /**
118
- * 需要收集非结构化信息
129
+ * 需要收集结构化信息
119
130
  */
120
131
  needCollectStructuredInfo?: INeedCollectStructuredInfo;
121
132
  }
122
133
 
134
+ /**
135
+ * 系统消息
136
+ */
137
+ export interface ISystemMessage {}
138
+
123
139
  /**
124
140
  * uCharts 图表类型
125
141
  */
@@ -153,7 +169,7 @@ export interface IUChartsSeries {
153
169
  /**
154
170
  * 数据值数组
155
171
  */
156
- data?: number[] | { value: number; name?: string }[];
172
+ data?: number[] | number;
157
173
  /**
158
174
  * 系列颜色
159
175
  */
@@ -281,6 +297,8 @@ export interface IUChartsOpts {
281
297
  scrollColor?: string;
282
298
  scrollBackgroundColor?: string;
283
299
  format?: string;
300
+ min?: number;
301
+ max?: number;
284
302
  };
285
303
  /**
286
304
  * Y轴配置
@@ -363,6 +381,7 @@ export interface IUChartsOpts {
363
381
  opacity?: number;
364
382
  max?: number;
365
383
  labelShow?: boolean;
384
+ border?: boolean;
366
385
  labelColor?: string;
367
386
  labelPointShow?: boolean;
368
387
  labelPointColor?: string;
@@ -462,14 +481,32 @@ export const enum IBehaviorAction {
462
481
  EndInquiryToGenerateReport = 'endInquiryToGenerateReport'
463
482
  }
464
483
 
484
+ /**
485
+ * 结构化表单类型
486
+ */
487
+ export const enum FormTypeEnum {
488
+ /**
489
+ * 高考基础信息
490
+ */
491
+ GaokaoBasicInfo = 'gaokaoBasicInfo',
492
+ /**
493
+ * 霍兰德性格测试回答
494
+ */
495
+ PersonalityAssessment = 'personalityAssessment',
496
+ /**
497
+ * 兴趣偏好
498
+ */
499
+ GaokaoPreferenceInfo = 'gaokaoPreferenceInfo'
500
+ }
501
+
465
502
  /**
466
503
  * 需要收集结构化信息
467
504
  */
468
505
  export interface INeedCollectStructuredInfo {
469
506
  /**
470
- * 表单类型
507
+ * 结构化表单类型
471
508
  */
472
- type?: string;
509
+ type?: FormTypeEnum;
473
510
  /**
474
511
  * 对用户的语言提示
475
512
  */
@@ -489,30 +526,5 @@ export interface INeedCollectStructuredInfo {
489
526
  /**
490
527
  * 需要收集的字段列表
491
528
  */
492
- fields: {
493
- /**
494
- * 字段名称
495
- */
496
- name?: string;
497
- /**
498
- * 字段标签
499
- */
500
- label?: string;
501
- /**
502
- * 字段描述
503
- */
504
- description?: string;
505
- /**
506
- * 是否必填
507
- */
508
- required?: boolean;
509
- /**
510
- * 选项
511
- */
512
- options?: string[];
513
- /**
514
- * 占位符
515
- */
516
- placeholder?: string;
517
- }[];
529
+ fields: FieldConfig[];
518
530
  }
@@ -27,3 +27,4 @@ export * from './SubReportTypeEnum.d.ts';
27
27
  export * from './IReportData.d.ts';
28
28
  export * from './IFormatGaokaoBasicInfo.d.ts';
29
29
  export * from './IConfigInfo.d.ts';
30
+ export * from './ILowerCoderForm.d.ts';
@@ -20,6 +20,8 @@ import { type IGaokaoVolunteerRecommendationReport } from '../common/IReportData
20
20
  import { type IGaokaoInterestReport } from '../common/IReportData';
21
21
  import { type IGaokaoMajorMatchingReport } from '../common/IReportData';
22
22
  import { type IGaokaoFutureDevelopmentReport } from '../common/IReportData';
23
+ import { type IReportList } from '../common/IReportList';
24
+ import { type FormTypeEnum } from '../common/ISessionContent';
23
25
 
24
26
  /**
25
27
  * 千问AI聊天api 请求参数
@@ -204,6 +206,10 @@ export interface IAiGenerateReportReq extends ICommonReq {
204
206
  * 报告id
205
207
  */
206
208
  reportId?: string;
209
+ /**
210
+ * 会话id
211
+ */
212
+ sessionId?: string;
207
213
  /**
208
214
  * 报告类型
209
215
  */
@@ -254,9 +260,9 @@ export interface IAgentReq extends ICommonReq {
254
260
  */
255
261
  showGraph?: 'F' | 'T';
256
262
  /**
257
- * 表单类型
263
+ * 前端传递的结构化表单类型
258
264
  */
259
- formType?: 'gaokaoBasicInfo';
265
+ formType?: FormTypeEnum;
260
266
  /**
261
267
  * 格式化的表单数据 包括高考数据和报告数据
262
268
  */
@@ -387,7 +393,12 @@ export interface IGetInquirySessionListRes extends ICommonRes {
387
393
  /**
388
394
  * 添加会话内容req
389
395
  */
390
- export interface IAddSessionContentReq extends ICommonReq, ISessionContent {}
396
+ export interface IAddSessionContentReq extends ICommonReq, ISessionContent {
397
+ /**
398
+ * 会话id
399
+ */
400
+ sessionId?: string;
401
+ }
391
402
 
392
403
  /**
393
404
  * 添加会话内容res
@@ -494,3 +505,15 @@ export interface IGenerateReportInfoRes extends ICommonRes {
494
505
  export interface IGetConfigInfoRes extends ICommonRes {
495
506
  data?: IConfigInfo;
496
507
  }
508
+
509
+ /**
510
+ * 获取报告列表req
511
+ */
512
+ export interface IGetReportInfoReq extends ICommonReq {}
513
+
514
+ /**
515
+ * 获取报告列表res
516
+ */
517
+ export interface IGetReportInfoRes extends ICommonRes {
518
+ data?: IReportList[];
519
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hddjs/hdd-cloud-types",
3
- "version": "1.0.15-SNAPSHOT.1",
3
+ "version": "1.0.18",
4
4
  "main": "index.d.ts",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"