informat.survey Survey
Overview
Use informat.survey to operate the survey module.
querySurveyListCount
Query survey list count
javascript
informat.survey.querySurveyListCount(moduleId, defineId, filter);| Parameter | Type | Description |
|---|---|---|
| moduleId | String | Module identifier |
| defineId | String | Survey identifier |
| filter | Filter | Filter condition |
List of fields that can be used in filters
| Field | Type | Description |
|---|---|---|
| id | String | Survey ID |
| name | String | Survey name |
| isEnable | Boolean | Is valid |
| submitCount | Integer | Submit count |
| createTime | String | Create time |
| createAccountId | String | Creator ID |
Return Value Type is Integer Returns survey list count
Example
js
informat.survey.querySurveyListCount('moduleId', 'defineId', {
conditionList: [{
fieldId: 'name',
opt: 'eq',
value: 'informat survey'
}]
})json
1querySurveyList
Query survey list
javascript
informat.survey.querySurveyList(moduleId, defineId, query);| Parameter | Type | Description |
|---|---|---|
| moduleId | String | Module identifier |
| defineId | String | Survey identifier |
| query | Query | Query condition |
List of fields that can be used in filters
| Field | Type | Description |
|---|---|---|
| id | String | Survey ID |
| name | String | Survey name |
| isEnable | Boolean | Is valid |
| submitCount | Integer | Submit count |
| createTime | String | Create time |
| createAccountId | String | Creator ID |
Return Value Type is Array<SurveyItem> Returns survey list
Example
js
informat.survey.querySurveyList('moduleId', 'defineId', {
pageIndex: 1,
pageSize: 20,
filter: {
conditionList: [{
fieldId: 'name',
opt: 'eq',
value: 'informat survey'
}]
}
});addSurvey
Add survey
javascript
informat.survey.addSurvey(moduleId, defineId, survey);| Parameter | Type | Description |
|---|---|---|
| moduleId | String | Module identifier |
| defineId | String | Survey identifier |
| survey | SurveyItem | Survey information |
Return Value Type is String Returns new ID
Example
javascript
const name = "informat survey";
const value1 = "123456";
const value2 = "abc";
const surveyInfo = {
name: name,
fieldList: [
{
id: "field1",
value: value1,
},
{
id: "field2",
value: value2,
},
],
};
informat.survey.addSurvey("moduleId", "defineId", surveyInfo);updateSurvey
Update survey information
javascript
informat.system.updateSurvey(moduleId, defineId, survey, filter);| Parameter | Type | Description |
|---|---|---|
| moduleId | String | Module identifier |
| defineId | String | Survey identifier |
| survey | SurveyItem | Survey information |
| filter | Filter | Filter condition |
List of fields that can be updated
| Field | Type | Description |
|---|---|---|
| name | String | Name |
| updateAccountId | String | Updater ID |
| startTime | Date | Start time |
| endTime | Date | End time |
| fieldList | Array<SurveyField> | Default field collection |
| isEnable | Boolean | Is valid |
| rowNumber | Integer | Row position |
Return Value Type is Integer Returns update count
Example
js
const name = 'informat survey';
const surveyInfo = {
name: name,
fieldList:[
{
id: 'name',
value: 'mr.zhang',
},
{
id: "age",
value: 18
},
]
}
informat.survey.updateSurvey('moduleId', 'defineId', surveyInfo, {
conditionList:[{fieldId: 'name',opt:'eq', value: 'informat survey'}]
});json
1deleteSurvey
Delete survey information
javascript
informat.survey.deleteSurvey(moduleId, defineId, filter);| Parameter | Type | Description |
|---|---|---|
| moduleId | String | Module identifier |
| defineId | String | Survey identifier |
| filter | Filter | Filter condition |
List of fields that can be filtered
| Field | Type | Description |
|---|---|---|
| name | String | Name |
Example
js
informat.survey.deleteSurvey('moduleId', 'defineId', {
conditionList:[{fieldId: 'name',opt:'eq', value: 'informat survey'}]
})json
1
