This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
import type { QuestionVO, QuestionForm, QuestionQuery } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询调查问卷问题列表
|
||||
* @param params
|
||||
* @returns 调查问卷问题列表
|
||||
*/
|
||||
export function questionList(params?: QuestionQuery) {
|
||||
return requestClient.get<PageResult<QuestionVO>>('/property/question/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出调查问卷问题列表
|
||||
* @param params
|
||||
* @returns 调查问卷问题列表
|
||||
*/
|
||||
export function questionExport(params?: QuestionQuery) {
|
||||
return commonExport('/property/question/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询调查问卷问题详情
|
||||
* @param id id
|
||||
* @returns 调查问卷问题详情
|
||||
*/
|
||||
export function questionInfo(id: ID) {
|
||||
return requestClient.get<QuestionVO>(`/property/question/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增调查问卷问题
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function questionAdd(data: QuestionForm) {
|
||||
return requestClient.postWithMsg<void>('/property/question', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新调查问卷问题
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function questionUpdate(data: QuestionForm) {
|
||||
return requestClient.putWithMsg<void>('/property/question', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除调查问卷问题
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function questionRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/question/${id}`);
|
||||
}
|
114
apps/web-antd/src/api/property/questionnaire/question/model.d.ts
vendored
Normal file
114
apps/web-antd/src/api/property/questionnaire/question/model.d.ts
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface QuestionVO {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 调查问卷id
|
||||
*/
|
||||
questionnaireId: string | number;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
head: string;
|
||||
|
||||
/**
|
||||
* 问题类型(1单行文本2多行文本3单选题4多选题5评分题6日期选择)
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* 是否必填(1不必填2必填)
|
||||
*/
|
||||
isRequired: string;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
depict: string;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort: number;
|
||||
|
||||
}
|
||||
|
||||
export interface QuestionForm extends BaseEntity {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 调查问卷id
|
||||
*/
|
||||
questionnaireId?: string | number;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
head?: string;
|
||||
|
||||
/**
|
||||
* 问题类型(1单行文本2多行文本3单选题4多选题5评分题6日期选择)
|
||||
*/
|
||||
type?: string;
|
||||
|
||||
/**
|
||||
* 是否必填(1不必填2必填)
|
||||
*/
|
||||
isRequired?: string;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
depict?: string;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort?: number;
|
||||
|
||||
}
|
||||
|
||||
export interface QuestionQuery extends PageQuery {
|
||||
/**
|
||||
* 调查问卷id
|
||||
*/
|
||||
questionnaireId?: string | number;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
head?: string;
|
||||
|
||||
/**
|
||||
* 问题类型(1单行文本2多行文本3单选题4多选题5评分题6日期选择)
|
||||
*/
|
||||
type?: string;
|
||||
|
||||
/**
|
||||
* 是否必填(1不必填2必填)
|
||||
*/
|
||||
isRequired?: string;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
depict?: string;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
Reference in New Issue
Block a user