前端-胡立永 1 month ago
parent
commit
bdc0513c84
8 changed files with 61 additions and 30 deletions
  1. +11
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiPaperServiceImpl.java
  2. +0
    -2
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletPaper/entity/AppletQuestions.java
  3. +1
    -2
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletPaper/entity/AppletQuestionsOptions.java
  4. +8
    -2
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletPaper/vo/AppletQuestionsPage.java
  5. +14
    -12
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletPaper/vue3/AppletQuestions.data.ts
  6. +1
    -2
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletPaperReport/entity/AppletPaperReportItem.java
  7. +5
    -5
      jeecgboot-vue3/src/views/applet/questions/AppletQuestions.data.ts
  8. +21
    -4
      jeecgboot-vue3/src/views/applet/questions/components/CustomTagSelector.vue

+ 11
- 1
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiPaperServiceImpl.java View File

@ -308,6 +308,12 @@ public class AppletApiPaperServiceImpl implements AppletApiPaperService {
if (option.getScore() != null) {
totalScore += option.getScore();
}
try{
processBlankAnswer(option, option.getContent(), report);
}catch (Exception e){
log.error(e.getMessage());
}
}
}
}
@ -335,13 +341,13 @@ public class AppletApiPaperServiceImpl implements AppletApiPaperService {
}
}
}
appletPaperReportService.updateById(report);
}catch (JacksonException e){
log.error(e.getMessage());
throw new JeecgBootException("格式有误!");
}
}
appletPaperReportService.updateById(report);
if (existingItem != null) {
// 更新现有记录
@ -685,6 +691,10 @@ public class AppletApiPaperServiceImpl implements AppletApiPaperService {
} catch (NumberFormatException e) {
throw new JeecgBootException("身高格式不正确,请输入有效的数字");
}
} else if (optionText.contains("sex")){
report.setSex(userInput);
} else if (optionText.contains("age")){
report.setAge(userInput);
}
}


+ 0
- 2
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletPaper/entity/AppletQuestions.java View File

@ -77,8 +77,6 @@ public class AppletQuestions implements Serializable {
@Schema(description = "排序")
private java.lang.Double sort;
/**关联标签*/
// @Excel(name = "关联标签", width = 15, dicCode = "topic_associate_tag")
// @Dict(dicCode = "topic_associate_tag")
@Schema(description = "关联标签")
private java.lang.String needTag;
/**触发器*/


+ 1
- 2
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletPaper/entity/AppletQuestionsOptions.java View File

@ -85,8 +85,7 @@ public class AppletQuestionsOptions implements Serializable {
@Schema(description = "产品")
private java.lang.String productId;
/**设置关联*/
@Excel(name = "设置关联", width = 15, dicCode = "topic_associate_tag")
@Dict(dicCode = "topic_associate_tag")
@Excel(name = "设置关联", width = 15, dictTable = "applet_questions_tag", dicText = "title", dicCode = "id")
@Schema(description = "设置关联")
private java.lang.String settingTag;
/**输入框类型*/


+ 8
- 2
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletPaper/vo/AppletQuestionsPage.java View File

@ -74,10 +74,16 @@ public class AppletQuestionsPage {
@Schema(description = "排序")
private java.lang.Integer sort;
/**关联标签*/
@Excel(name = "关联标签", width = 15, dicCode = "topic_associate_tag")
@Dict(dicCode = "topic_associate_tag")
@Schema(description = "关联标签")
private java.lang.String needTag;
/**多选*/
@Excel(name = "多选", width = 15)
@Schema(description = "多选")
private java.lang.String multiple;
/**触发器*/
@Excel(name = "触发器", width = 15, dictTable = "applet_question_trigger", dicText = "title", dicCode = "id")
@Schema(description = "触发器")
private java.lang.String triggerId;
@ExcelCollection(name="题目选项")
@Schema(description = "题目选项")


+ 14
- 12
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletPaper/vue3/AppletQuestions.data.ts View File

@ -100,7 +100,9 @@ export const formSchema: FormSchema[] = [
field: 'needTag',
component: 'JSelectMultiple',
componentProps:{
dictCode:"topic_associate_tag"
dictTable: "applet_questions_tag",
dictCode: "id",
dictText: "title"
},
},
// TODO 主键隐藏字段,目前写死为ID
@ -221,15 +223,15 @@ export const appletQuestionsOptionsJVxeColumns: JVxeColumn[] = [
defaultValue:'',
},
{
title: '设置关联',
key: 'settingTag',
type: JVxeTypes.selectMultiple,
options:[],
dictCode:"topic_associate_tag",
width:"250px",
placeholder: '请输入${title}',
defaultValue:'',
},
title: '设置关联',
key: 'settingTag',
type: JVxeTypes.selectMultiple,
options:[],
dictCode:"applet_questions_tag,title,id",
width:"250px",
placeholder: '请输入${title}',
defaultValue:'',
},
]
// 高级查询数据
@ -240,7 +242,7 @@ export const superQuerySchema = {
required: {title: '必填',order: 3,view: 'switch', type: 'string',},
remark: {title: '备注',order: 4,view: 'text', type: 'string',},
sort: {title: '排序',order: 5,view: 'number', type: 'number',},
needTag: {title: '关联标签',order: 6,view: 'list_multi', type: 'string',dictCode: 'topic_associate_tag',},
needTag: {title: '关联标签',order: 6,view: 'list_multi', type: 'string',dictTable: 'applet_questions_tag', dictCode: 'id', dictText: 'title',},
//子表高级查询
appletQuestionsOptions: {
title: '题目选项',
@ -253,7 +255,7 @@ export const superQuerySchema = {
imageAfter: {title: '选中后图片',order: 4,view: 'text', type: 'string',},
schemeId: {title: '方案',order: 5,view: 'list_multi', type: 'string',dictTable: "applet_scheme", dictCode: 'id', dictText: 'title',},
productId: {title: '产品',order: 6,view: 'list_multi', type: 'string',dictTable: "applet_product", dictCode: 'id', dictText: 'name',},
settingTag: {title: '设置关联',order: 7,view: 'list_multi', type: 'string',dictCode: 'topic_associate_tag',},
settingTag: {title: '设置关联',order: 7,view: 'list_multi', type: 'string',dictTable: 'applet_questions_tag', dictCode: 'id', dictText: 'title',},
}
},
};


+ 1
- 2
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletPaperReport/entity/AppletPaperReportItem.java View File

@ -84,8 +84,7 @@ public class AppletPaperReportItem implements Serializable {
@Schema(description = "触发器")
private java.lang.String triggerId;
/**设置关联*/
@Excel(name = "设置标签", width = 15, dicCode = "topic_associate_tag")
@Dict(dicCode = "topic_associate_tag")
@Excel(name = "设置标签", width = 15, dictTable = "applet_questions_tag", dicText = "title", dicCode = "id")
@Schema(description = "设置标签")
private java.lang.String settingTag;
/**得分*/


+ 5
- 5
jeecgboot-vue3/src/views/applet/questions/AppletQuestions.data.ts View File

@ -149,7 +149,7 @@ export const formSchema: FormSchema[] = [
field: 'needTag',
component: 'CustomTagSelector',
componentProps:{
dictCode:"topic_associate_tag"
dictCode:"applet_questions_tags,title,id"
},
},
// TODO 主键隐藏字段,目前写死为ID
@ -210,7 +210,7 @@ export const appletQuestionsOptionsColumns: BasicColumn[] = [
dataIndex: 'inputType_dictText'
},
{
title: '输入框内容类型',
title: '内容关联',
align:"center",
dataIndex: 'inputContentType_dictText'
},
@ -284,7 +284,7 @@ export const appletQuestionsOptionsJVxeColumns: JVxeColumn[] = [
key: 'settingTag',
type: JVxeTypes.selectMultiple,
options:[],
dictCode:"topic_associate_tag",
dictCode:"applet_questions_tags,title,id",
width:"250px",
placeholder: '请输入${title}',
defaultValue:'',
@ -329,7 +329,7 @@ export const superQuerySchema = {
remark: {title: '备注',order: 5,view: 'text', type: 'string',},
sort: {title: '排序',order: 6,view: 'number', type: 'string',},
triggerId: {title: '触发器',order: 7,view: 'list_multi', type: 'string',dictCode: 'applet_question_trigger',},
needTag: {title: '关联标签',order: 8,view: 'list_multi', type: 'string',dictCode: 'topic_associate_tag',},
needTag: {title: '关联标签',order: 8,view: 'list_multi', type: 'string',dictTable: 'applet_questions_tags', dictCode: 'id', dictText: 'title',},
//子表高级查询
appletQuestionsOptions: {
title: '题目选项',
@ -342,7 +342,7 @@ export const superQuerySchema = {
imageAfter: {title: '选中后图片',order: 4,view: 'text', type: 'string',},
schemeId: {title: '方案',order: 5,view: 'list_multi', type: 'string',dictTable: "applet_scheme", dictCode: 'id', dictText: 'title',},
productId: {title: '产品',order: 6,view: 'list_multi', type: 'string',dictTable: "applet_product", dictCode: 'id', dictText: 'name',},
settingTag: {title: '设置关联',order: 7,view: 'list_multi', type: 'string',dictCode: 'topic_associate_tag',},
settingTag: {title: '设置关联',order: 7,view: 'list_multi', type: 'string',dictTable: 'applet_questions_tags', dictCode: 'id', dictText: 'title',},
inputType: {title: '输入框类型',order: 8,view: 'list', type: 'string',dictCode: 'applet_question_input_type',},
inputContentType: {title: '输入框内容类型',order: 9,view: 'list', type: 'string',dictCode: 'applet_question_input_content_type',},
}


+ 21
- 4
jeecgboot-vue3/src/views/applet/questions/components/CustomTagSelector.vue View File

@ -90,7 +90,7 @@ import { ref, watch, defineProps, defineEmits } from 'vue';
import { useRuleFormItem } from '/@/hooks/component/useFormItem';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
import { PlusOutlined, DeleteOutlined } from '@ant-design/icons-vue';
import { filterDictTextByCache } from '/@/utils/dict/JDictSelectUtil';
import { initDictOptions, filterDictText } from '/@/utils/dict/JDictSelectUtil';
interface TagItem {
value: string;
@ -108,8 +108,8 @@ const props = defineProps({
},
dictCode: {
type: String,
default: 'topic_associate_tag'
}
default: 'applet_questions_tag,title,id'
},
});
const emit = defineEmits(['update:value', 'change']);
@ -117,10 +117,22 @@ const props = defineProps({
const columns = ref<TagColumn[]>([{ tags: [] }]);
const emitData = ref<any[]>([]);
const availableTags = ref<any[]>([]);
const dictOptions = ref<any[]>([]);
// 使
const [state] = useRuleFormItem(props, 'value', 'change', emitData);
//
const initDictData = async () => {
try {
const options = await initDictOptions(props.dictCode);
dictOptions.value = options || [];
} catch (error) {
console.error('初始化字典数据失败:', error);
dictOptions.value = [];
}
};
//
const initData = () => {
console.log('CustomTagSelector initData - props.value:', props.value);
@ -162,6 +174,11 @@ watch(() => props.value, (newValue, oldValue) => {
}
}, { immediate: true });
// dictCode
watch(() => props.dictCode, () => {
initDictData();
}, { immediate: true });
//
const addColumn = () => {
columns.value.push({ tags: [] });
@ -214,7 +231,7 @@ const getTagValues = (columnTags: TagItem[]) => {
//
const getDictText = (value: string) => {
const dictText = filterDictTextByCache(props.dictCode, value);
const dictText = filterDictText(dictOptions.value, value);
return dictText || value;
};


Loading…
Cancel
Save