Skip to content

Commit d6854a1

Browse files
authored
Merge pull request #178 from DumbDaiDai/fix/rightMenuTypeError
fix: 修复问卷编辑器右侧菜单的类型错误
2 parents c52b964 + 4b180d4 commit d6854a1

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/pages/DetailInfo/rightMenu.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ import { basicReg } from "@/utilities/regs";
100100
import { storeToRefs } from "pinia";
101101
102102
const typeChinese = {
103+
0: "",
103104
1: "单项选择题",
104105
2: "多项选择题",
105106
3: "单行输入框",
@@ -123,7 +124,7 @@ const questionList = computed({
123124
}
124125
});
125126
126-
const currentType = computed<number>(() => {
127+
const currentType = computed<QuesItemType>(() => {
127128
if (activeSerial.value === -1) {
128129
return 0;
129130
} else {

src/stores/edit.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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
{

src/utilities/constMap.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ enum QuesType {
1010
}
1111

1212
enum 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

2022
export {

0 commit comments

Comments
 (0)