File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed
Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 22 <div class =" bg-base-100 dark:bg-[#1A1A1A] flex-1" >
33 <!-- 题型显示 -->
44 <div class =" flex bg-base-200 dark:bg-customGray_shallow w-full opacity-0.6 items-center" style =" height : 4vh ;" >
5- <div v-if =" activeSerial!==-1 " class =" text-red-400 dark:text-white pl-16 text-sm" >
5+ <div v-if =" questionList[ activeSerial - 1] " class =" text-red-400 dark:text-white pl-16 text-sm" >
66 {{ typeChinese[currentType] }}
77 </div >
88 </div >
99
1010 <!-- 垂直间距 -->
1111 <div class =" w-full" style =" height : 2vh ;" />
1212
13- <div v-if =" activeSerial!==-1 " class =" pl-16" >
13+ <div v-if =" questionList[ activeSerial-1] " class =" pl-16" >
1414 <!-- 所有题型通用 -->
1515 <div class =" text-sm font-medium" >
1616 基础配置
4242 <div class =" pt-16" >
4343 <el-input
4444 v-model =" questionList[activeSerial-1].description"
45+ type =" textarea"
4546 style =" width : 240px "
4647 placeholder =" Please input"
4748 />
@@ -100,6 +101,7 @@ import { basicReg } from "@/utilities/regs";
100101import { storeToRefs } from " pinia" ;
101102
102103const typeChinese = {
104+ 0 : " " ,
103105 1 : " 单项选择题" ,
104106 2 : " 多项选择题" ,
105107 3 : " 单行输入框" ,
@@ -123,7 +125,7 @@ const questionList = computed({
123125 }
124126});
125127
126- const currentType = computed <number >(() => {
128+ const currentType = computed <QuesItemType >(() => {
127129 if (activeSerial .value === - 1 ) {
128130 return 0 ;
129131 } else {
Original file line number Diff line number Diff line change @@ -38,7 +38,10 @@ function defaultSchema() {
3838 required : true ,
3939 unique : false ,
4040 otherOption : false ,
41- questionType : QuesItemType . RADIO
41+ questionType : QuesItemType . RADIO ,
42+ minimumOption : 1 ,
43+ maximumOption : 1 ,
44+ reg : "^.*$"
4245 } ,
4346 options : [
4447 {
Original file line number Diff line number Diff line change @@ -10,11 +10,13 @@ enum QuesType {
1010}
1111
1212enum QuesItemType {
13+ UNDEFINED = 0 ,
1314 RADIO = 1 ,
1415 CHECKBOX = 2 ,
1516 INPUT = 3 ,
1617 TEXTAREA = 4 ,
17- PHOTO = 5
18+ PHOTO = 5 ,
19+ VOTE = 6
1820}
1921
2022export {
You can’t perform that action at this time.
0 commit comments