diff --git a/bin/serve.js b/bin/serve.js index ff3bba6b..d02bae31 100644 --- a/bin/serve.js +++ b/bin/serve.js @@ -40,12 +40,12 @@ const chalkTag = { */ const findApp = (dir, cb) => { return readdir(dir).then(apps => { - return Promise.all(apps?.map(e => { + return Promise.all(apps.map(e => { let cPath = path.join(dir, e) return stat(cPath).then(state => { - if (state?.isDirectory()) { + if (state.isDirectory()) { return findApp(cPath, cb) - } else if (state?.isFile()) { + } else if (state.isFile()) { cb && cb(cPath) } }) diff --git a/src/apps/AppAskForm/AppAskForm.vue b/src/apps/AppAskForm/AppAskForm.vue new file mode 100644 index 00000000..82121b5d --- /dev/null +++ b/src/apps/AppAskForm/AppAskForm.vue @@ -0,0 +1,69 @@ + + + + + diff --git a/src/apps/AppAskForm/addForm.vue b/src/apps/AppAskForm/addForm.vue new file mode 100644 index 00000000..d0172ec2 --- /dev/null +++ b/src/apps/AppAskForm/addForm.vue @@ -0,0 +1,700 @@ + + + + + diff --git a/src/apps/AppAskForm/askForm.vue b/src/apps/AppAskForm/askForm.vue new file mode 100644 index 00000000..304ca182 --- /dev/null +++ b/src/apps/AppAskForm/askForm.vue @@ -0,0 +1,52 @@ + + + + + diff --git a/src/apps/AppAskForm/components/addList.vue b/src/apps/AppAskForm/components/addList.vue new file mode 100644 index 00000000..a2826ce5 --- /dev/null +++ b/src/apps/AppAskForm/components/addList.vue @@ -0,0 +1,182 @@ + + + + + diff --git a/src/apps/AppAskForm/components/list.vue b/src/apps/AppAskForm/components/list.vue new file mode 100644 index 00000000..2bcd23ce --- /dev/null +++ b/src/apps/AppAskForm/components/list.vue @@ -0,0 +1,497 @@ + + + + + diff --git a/src/apps/AppAskForm/config.js b/src/apps/AppAskForm/config.js new file mode 100644 index 00000000..affd9efb --- /dev/null +++ b/src/apps/AppAskForm/config.js @@ -0,0 +1,163 @@ +export const components = [ + { + type: 'radio', + label: '单选', + fixedLabel: '单选', + value: '', + points: '', + icon: 'iconradio', + isShowPoints: false, + required: true, + hasAnswer: false, + answer: '', + pointType: '0', + pointDict: [ + { + dictName: '此题有唯一答案和分值', + dictValue: '0' + }, + { + dictName: '每个选项都有对应分值', + dictValue: '1' + } + ], + options: [ + { + label: '选项1', + value: '', + point: '', + img: [] + }, + { + label: '选项2', + value: '', + point: '', + img: [] + } + ], + title: '' + }, + { + type: 'checkbox', + label: '多选', + fixedLabel: '多选', + points: '', + icon: 'iconcheck_box', + isShowPoints: false, + required: true, + hasAnswer: false, + answer: [], + value: [], + pointType: '0', + pointDict: [ + { + dictName: '此题有唯一答案和分值', + dictValue: '0' + }, + { + dictName: '每个选项都有对应分值', + dictValue: '1' + }, + { + dictName: '答对几项得几分,答错不得分', + dictValue: '2' + } + ], + options: [ + { + label: '选项1', + value: '', + point: '', + img: [], + checked: false + }, + { + label: '选项2', + point: '', + value: '', + img: [], + checked: false + } + ], + title: '' + }, + { + type: 'select', + label: '单下拉框', + fixedLabel: '单下拉框', + value: '', + points: '', + icon: 'iconSelect', + isShowPoints: false, + required: true, + hasAnswer: false, + answer: '', + pointType: '0', + placeholder: '请选择', + pointDict: [ + { + dictName: '此题有唯一答案和分值', + dictValue: '0' + }, + { + dictName: '每个选项都有对应分值', + dictValue: '1' + } + ], + options: [ + { + label: '选项1', + value: '', + point: '', + img: [] + }, + { + label: '选项2', + value: '', + point: '', + img: [] + } + ], + title: '' + }, + { + type: 'input', + label: '单行填空', + fixedLabel: '单行填空', + value: '', + pointType: '0', + icon: 'icontext_box', + isShowPoints: false, + points: '', + required: true, + hasAnswer: false, + placeholder: '请输入...', + answer: '' + }, + { + type: 'textarea', + label: '多行填空', + fixedLabel: '多行填空', + pointType: '0', + icon: 'icontext_area', + points: '', + isShowPoints: false, + required: true, + hasAnswer: false, + answer: '', + placeholder: '请输入...', + value: '' + }, + { + type: 'upload', + label: '上传图片', + fixedLabel: '上传图片', + value: '', + icon: 'iconpic', + isShowPoints: false, + points: '', + required: true, + hasAnswer: false, + answer: '' + } +]; diff --git a/src/apps/AppAskForm/filedConfig.vue b/src/apps/AppAskForm/filedConfig.vue new file mode 100644 index 00000000..fe59b245 --- /dev/null +++ b/src/apps/AppAskForm/filedConfig.vue @@ -0,0 +1,535 @@ + + + + +