框架优化
This commit is contained in:
1 parent
ed5eb9ca52
commit
2f7e1a9c16
26 files changed
+3398
-194
No files matched your search
@@ -153,3 +153,62 @@ export const checkUserAnswered = (surveyId: string | number): AxiosPromise<boole
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取问卷统计分析数据
|
||||
* @param surveyId 问卷ID
|
||||
*/
|
||||
export const getSurveyStatistics = (surveyId: string | number): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: '/hq/satSurvey/' + surveyId + '/statistics',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取问卷的所有答题记录列表
|
||||
* @param surveyId 问卷ID
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const getSurveyAnswerRecords = (surveyId: string | number, query?: any): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: '/hq/satSurvey/' + surveyId + '/records',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查看答题记录详情
|
||||
* @param recordId 答题记录ID
|
||||
*/
|
||||
export const getAnswerRecordDetail = (recordId: string | number): AxiosPromise<any> => {
|
||||
return request({
|
||||
url: '/hq/satSurvey/record/' + recordId,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导出调查报告
|
||||
* @param surveyId 问卷ID
|
||||
*/
|
||||
export const exportSurveyReport = (surveyId: string | number) => {
|
||||
return request({
|
||||
url: '/hq/satSurvey/' + surveyId + '/exportReport',
|
||||
method: 'post',
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导出原始数据
|
||||
* @param surveyId 问卷ID
|
||||
*/
|
||||
export const exportSurveyRawData = (surveyId: string | number) => {
|
||||
return request({
|
||||
url: '/hq/satSurvey/' + surveyId + '/exportRawData',
|
||||
method: 'post',
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
@@ -212,5 +212,393 @@ export interface SatSurveyQuery extends PageQuery {
|
||||
params?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 问卷统计信息
|
||||
*/
|
||||
export interface SurveyStatisticsVO {
|
||||
/**
|
||||
* 问卷ID
|
||||
*/
|
||||
surveyId: string | number;
|
||||
|
||||
/**
|
||||
* 问卷标题
|
||||
*/
|
||||
surveyTitle: string;
|
||||
|
||||
/**
|
||||
* 问卷编号
|
||||
*/
|
||||
surveyCode: string;
|
||||
|
||||
/**
|
||||
* 总参与人数
|
||||
*/
|
||||
totalParticipants: number;
|
||||
|
||||
/**
|
||||
* 已完成人数
|
||||
*/
|
||||
completedCount: number;
|
||||
|
||||
/**
|
||||
* 草稿数量
|
||||
*/
|
||||
draftCount: number;
|
||||
|
||||
/**
|
||||
* 完成率
|
||||
*/
|
||||
completionRate: number;
|
||||
|
||||
/**
|
||||
* 平均用时(秒)
|
||||
*/
|
||||
avgDuration: number;
|
||||
|
||||
/**
|
||||
* 平均得分
|
||||
*/
|
||||
avgScore: number;
|
||||
|
||||
/**
|
||||
* 最高得分
|
||||
*/
|
||||
maxScore: number;
|
||||
|
||||
/**
|
||||
* 最低得分
|
||||
*/
|
||||
minScore: number;
|
||||
|
||||
/**
|
||||
* 题目统计详情
|
||||
*/
|
||||
questionStats: QuestionStatItem[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 题目统计项
|
||||
*/
|
||||
export interface QuestionStatItem {
|
||||
/**
|
||||
* 题目ID
|
||||
*/
|
||||
questionId: string | number;
|
||||
|
||||
/**
|
||||
* 题目标题
|
||||
*/
|
||||
questionTitle: string;
|
||||
|
||||
/**
|
||||
* 题目类型 (1-单选题 2-多选题 3-问答题)
|
||||
*/
|
||||
questionType: string;
|
||||
|
||||
/**
|
||||
* 题目序号
|
||||
*/
|
||||
sortOrder: number;
|
||||
|
||||
/**
|
||||
* 是否必填
|
||||
*/
|
||||
isRequired: number;
|
||||
|
||||
/**
|
||||
* 回答人数
|
||||
*/
|
||||
answerCount: number;
|
||||
|
||||
/**
|
||||
* 回答率
|
||||
*/
|
||||
answerRate: number;
|
||||
|
||||
/**
|
||||
* 选项统计(单选题、多选题)
|
||||
*/
|
||||
optionStats?: OptionStatItem[];
|
||||
|
||||
/**
|
||||
* 问答题统计
|
||||
*/
|
||||
textAnswers?: TextAnswerItem[];
|
||||
|
||||
/**
|
||||
* 图表类型(用于前端显示)
|
||||
*/
|
||||
chartType?: 'bar' | 'pie';
|
||||
}
|
||||
|
||||
/**
|
||||
* 选项统计项
|
||||
*/
|
||||
export interface OptionStatItem {
|
||||
/**
|
||||
* 选项ID
|
||||
*/
|
||||
optionId: string | number;
|
||||
|
||||
/**
|
||||
* 选项值
|
||||
*/
|
||||
optionValue: string;
|
||||
|
||||
/**
|
||||
* 选项文本
|
||||
*/
|
||||
optionText: string;
|
||||
|
||||
/**
|
||||
* 选择人数
|
||||
*/
|
||||
selectCount: number;
|
||||
|
||||
/**
|
||||
* 选择率
|
||||
*/
|
||||
selectRate: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 问答题回答项
|
||||
*/
|
||||
export interface TextAnswerItem {
|
||||
/**
|
||||
* 答案ID
|
||||
*/
|
||||
answerId: string | number;
|
||||
|
||||
/**
|
||||
* 答案内容
|
||||
*/
|
||||
answerText: string;
|
||||
|
||||
/**
|
||||
* 答题人
|
||||
*/
|
||||
userName?: string;
|
||||
|
||||
/**
|
||||
* 答题时间
|
||||
*/
|
||||
answerTime: string;
|
||||
|
||||
/**
|
||||
* 字符数
|
||||
*/
|
||||
textLength: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 答题记录VO
|
||||
*/
|
||||
export interface SatRecordVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 问卷ID
|
||||
*/
|
||||
surveyId: string | number;
|
||||
|
||||
/**
|
||||
* 答题人ID
|
||||
*/
|
||||
userId: string | number;
|
||||
|
||||
/**
|
||||
* 答题人姓名
|
||||
*/
|
||||
userName: string;
|
||||
|
||||
/**
|
||||
* 答题人部门
|
||||
*/
|
||||
deptName?: string;
|
||||
|
||||
/**
|
||||
* 答题开始时间
|
||||
*/
|
||||
startTime: string;
|
||||
|
||||
/**
|
||||
* 答题结束时间
|
||||
*/
|
||||
endTime?: string;
|
||||
|
||||
/**
|
||||
* 答题用时(秒)
|
||||
*/
|
||||
duration: number;
|
||||
|
||||
/**
|
||||
* 总得分
|
||||
*/
|
||||
totalScore: number;
|
||||
|
||||
/**
|
||||
* 答题状态(0草稿 1已提交)
|
||||
*/
|
||||
status: string;
|
||||
|
||||
/**
|
||||
* 是否匿名
|
||||
*/
|
||||
isAnonymous: number;
|
||||
|
||||
/**
|
||||
* 提交时间
|
||||
*/
|
||||
submitTime?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
/**
|
||||
* 答题详情列表
|
||||
*/
|
||||
answers?: SatAnswerVO[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 答题详情VO
|
||||
*/
|
||||
export interface SatAnswerVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 答题记录ID
|
||||
*/
|
||||
recordId: string | number;
|
||||
|
||||
/**
|
||||
* 题目ID
|
||||
*/
|
||||
questionId: string | number;
|
||||
|
||||
/**
|
||||
* 题目标题
|
||||
*/
|
||||
questionTitle: string;
|
||||
|
||||
/**
|
||||
* 题目类型
|
||||
*/
|
||||
questionType: string;
|
||||
|
||||
/**
|
||||
* 答案值
|
||||
*/
|
||||
answerValue: string;
|
||||
|
||||
/**
|
||||
* 答案得分
|
||||
*/
|
||||
score: number;
|
||||
|
||||
/**
|
||||
* 选项详情(单选题、多选题)
|
||||
*/
|
||||
options?: Array<{
|
||||
optionId: string | number;
|
||||
optionValue: string;
|
||||
optionText: string;
|
||||
isSelected: boolean;
|
||||
}>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 满意度分析数据
|
||||
*/
|
||||
export interface SatisfactionAnalysisVO {
|
||||
/**
|
||||
* 整体满意度评分
|
||||
*/
|
||||
overallScore: number;
|
||||
|
||||
/**
|
||||
* 满意度等级
|
||||
*/
|
||||
satisfactionLevel: string;
|
||||
|
||||
/**
|
||||
* 满意度分布
|
||||
*/
|
||||
distribution: {
|
||||
excellent: number; // 非常满意
|
||||
good: number; // 满意
|
||||
fair: number; // 一般
|
||||
poor: number; // 不满意
|
||||
terrible: number; // 非常不满意
|
||||
};
|
||||
|
||||
/**
|
||||
* 各维度满意度
|
||||
*/
|
||||
dimensions: Array<{
|
||||
dimensionName: string;
|
||||
score: number;
|
||||
questionCount: number;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* 满意度趋势(按时间)
|
||||
*/
|
||||
trend: Array<{
|
||||
date: string;
|
||||
score: number;
|
||||
count: number;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* 关键词分析(基于问答题)
|
||||
*/
|
||||
keywords: Array<{
|
||||
word: string;
|
||||
count: number;
|
||||
sentiment: 'positive' | 'negative' | 'neutral';
|
||||
}>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 答题记录查询参数
|
||||
*/
|
||||
export interface RecordQuery extends PageQuery {
|
||||
/**
|
||||
* 问卷ID
|
||||
*/
|
||||
surveyId?: string | number;
|
||||
|
||||
/**
|
||||
* 答题状态
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 答题人姓名
|
||||
*/
|
||||
userName?: string;
|
||||
|
||||
/**
|
||||
* 答题时间范围
|
||||
*/
|
||||
dateRange?: string[];
|
||||
|
||||
/**
|
||||
* 得分范围
|
||||
*/
|
||||
scoreRange?: number[];
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user