diff --git a/server/src/modules/survey/template/surveyTemplate/survey/normal.json b/server/src/modules/survey/template/surveyTemplate/survey/normal.json index 3808e775..606c6e08 100644 --- a/server/src/modules/survey/template/surveyTemplate/survey/normal.json +++ b/server/src/modules/survey/template/surveyTemplate/survey/normal.json @@ -11,13 +11,16 @@ "field": "data458", "title": "标题1", "placeholder": "", - "randomSort": false, - "checked": false, - "minNum": "", - "maxNum": "", - "star": 5, - "placeholderDesc": "", - "urlKey": "", + "numberRange": { + "max": { + "placeholder": "1000", + "value": 1000 + }, + "min": { + "placeholder": "0", + "value": 0 + } + }, "textRange": { "min": { "placeholder": "0", @@ -35,14 +38,8 @@ "showType": true, "showSpliter": true, "type": "radio", - "placeholderDesc": "", "field": "data515", "title": "标题2", - "placeholder": "", - "randomSort": false, - "checked": false, - "minNum": "", - "maxNum": "", "options": [ { "text": "选项1", @@ -62,23 +59,7 @@ "placeholderDesc": "", "hash": "115020" } - ], - "importKey": "single", - "importData": "", - "cOption": "", - "cOptions": [], - "star": 5, - "exclude": false, - "textRange": { - "min": { - "placeholder": "0", - "value": 0 - }, - "max": { - "placeholder": "500", - "value": 500 - } - } + ] } ] } diff --git a/server/src/modules/survey/template/surveyTemplate/survey/nps.json b/server/src/modules/survey/template/surveyTemplate/survey/nps.json index 8901c69b..41571c3b 100644 --- a/server/src/modules/survey/template/surveyTemplate/survey/nps.json +++ b/server/src/modules/survey/template/surveyTemplate/survey/nps.json @@ -6,30 +6,21 @@ "showIndex": true, "showType": true, "showSpliter": true, - "placeholderDesc": "", "placeholder": "", "isRequired": true, - "randomSort": false, - "innerRandom": false, - "hideSubTitleIndex": false, - "checked": false, - "minNum": "", - "maxNum": "", - "relyType": "and", - "extraOptions": [], - "importKey": "single", - "importData": "", - "addressType": 3, - "isAuto": false, - "urlKey": "", - "hasRely": true, - "relyList": [], - "optionOrigin": "", - "answerTip": "", "type": "text", "valid": "", "title": "标题1", - "answer": "", + "numberRange": { + "max": { + "placeholder": "1000", + "value": 1000 + }, + "min": { + "placeholder": "0", + "value": 0 + } + }, "textRange": { "min": { "placeholder": "0", @@ -46,45 +37,12 @@ "showIndex": true, "showType": true, "showSpliter": true, - "placeholderDesc": "", "placeholder": "", "isRequired": true, - "randomSort": false, - "innerRandom": false, - "hideSubTitleIndex": false, - "checked": false, - "minNum": "", - "maxNum": "", - "relyType": "and", - "extraOptions": [], - "importKey": "single", - "importData": "", - "cOption": "", - "cOptions": [], - "star": 5, - "urlKey": "", - "defaultProps": { - "children": "children", - "label": "name", - "id": "id" - }, - "hasRely": true, - "relyList": [], - "optionOrigin": "", - "answerTip": "", + "min": "", + "max": "", "type": "radio-star", - "title": "标题2", - "answer": "", - "textRange": { - "min": { - "placeholder": "0", - "value": 0 - }, - "max": { - "placeholder": "500", - "value": 500 - } - } + "title": "标题2" } ] } diff --git a/server/src/modules/survey/template/surveyTemplate/survey/register.json b/server/src/modules/survey/template/surveyTemplate/survey/register.json index 5f2fd5be..d7fa4a1b 100644 --- a/server/src/modules/survey/template/surveyTemplate/survey/register.json +++ b/server/src/modules/survey/template/surveyTemplate/survey/register.json @@ -11,13 +11,16 @@ "field": "data458", "title": "姓名", "placeholder": "", - "randomSort": false, - "checked": false, - "minNum": "", - "maxNum": "", - "star": 5, - "exclude": false, - "placeholderDesc": "", + "numberRange": { + "max": { + "placeholder": "1000", + "value": 1000 + }, + "min": { + "placeholder": "0", + "value": 0 + } + }, "textRange": { "min": { "placeholder": "0", @@ -40,10 +43,6 @@ "title": "选择您感兴趣的课程进行报名", "placeholder": "", "valid": "", - "randomSort": false, - "checked": false, - "minNum": "", - "maxNum": "", "options": [ { "text": "课程1", @@ -81,27 +80,7 @@ "othersKey": "", "placeholderDesc": "" } - ], - "star": 5, - "exclude": false, - "urlKey": "", - "defaultProps": { - "children": "children", - "label": "name", - "id": "id" - }, - "startDate": "", - "endDate": "", - "textRange": { - "min": { - "placeholder": "0", - "value": 0 - }, - "max": { - "placeholder": "500", - "value": 500 - } - } + ] } ] } diff --git a/server/src/modules/survey/template/surveyTemplate/survey/vote.json b/server/src/modules/survey/template/surveyTemplate/survey/vote.json index 9ae7d7fe..f8bbc899 100644 --- a/server/src/modules/survey/template/surveyTemplate/survey/vote.json +++ b/server/src/modules/survey/template/surveyTemplate/survey/vote.json @@ -11,15 +11,16 @@ "field": "data631", "title": "标题1", "placeholder": "", - "sLimit": 1, - "randomSort": false, - "checked": false, - "minNum": "", - "maxNum": "", - "star": 5, - "exclude": false, - "placeholderDesc": "", - "urlKey": "", + "numberRange": { + "max": { + "placeholder": "1000", + "value": 1000 + }, + "min": { + "placeholder": "0", + "value": 0 + } + }, "textRange": { "min": { "placeholder": "0", @@ -38,12 +39,8 @@ "showSpliter": true, "type": "vote", "innerType": "radio", - "placeholderDesc": "", "field": "data606", "title": "标题2", - "placeholder": "", - "randomSort": false, - "checked": false, "minNum": "", "maxNum": "", "options": [ @@ -65,18 +62,7 @@ "placeholderDesc": "", "hash": "115020" } - ], - "star": 5, - "textRange": { - "min": { - "placeholder": "0", - "value": 0 - }, - "max": { - "placeholder": "500", - "value": 500 - } - } + ] } ] } diff --git a/server/src/modules/survey/utils/index.ts b/server/src/modules/survey/utils/index.ts index ced78f14..c8e426ee 100644 --- a/server/src/modules/survey/utils/index.ts +++ b/server/src/modules/survey/utils/index.ts @@ -33,7 +33,7 @@ export function getListHeadByDataList(dataList) { let othersCode; const radioType = ['radio-star', 'radio-nps']; if (radioType.includes(question.type)) { - const rangeConfigKeys = Object.keys(question.rangeConfig); + const rangeConfigKeys = question.rangeConfig ? Object.keys(question.rangeConfig) : []; if (rangeConfigKeys.length > 0) { othersCode = [{ code: `${question.field}_custom`, option: '填写理由' }]; } diff --git a/web/src/management/pages/edit/components/SetterField.vue b/web/src/management/pages/edit/components/SetterField.vue index 365eff41..36c1c9cf 100644 --- a/web/src/management/pages/edit/components/SetterField.vue +++ b/web/src/management/pages/edit/components/SetterField.vue @@ -59,8 +59,8 @@ const emit = defineEmits() // 静态配置设置动态值 const formatValue = ({ item, moduleConfig }: any) => { - if (_isFunction(item.valueAdapter)) { - const value = item.valueAdapter({ moduleConfig }) + if (_isFunction(item.valueGetter)) { + const value = item.valueGetter({ moduleConfig }) return value } else { @@ -82,8 +82,8 @@ const init = ref(true) const components = shallowRef({}) const handleFormChange = (data: any, formConfig: any) => { - if (_isFunction(formConfig?.setterAdapter)) { - const resultData = formConfig.setterAdapter(data) + if (_isFunction(formConfig?.valueSetter)) { + const resultData = formConfig.valueSetter(data) if (Array.isArray(resultData)) { resultData.forEach((item) => { diff --git a/web/src/management/pages/list/components/MemberList.vue b/web/src/management/pages/list/components/MemberList.vue index 50b9f7f0..dedb06be 100644 --- a/web/src/management/pages/list/components/MemberList.vue +++ b/web/src/management/pages/list/components/MemberList.vue @@ -15,7 +15,7 @@