index.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <div>
  3. <!-- 逐题提交 -->
  4. <Progressive
  5. @close="close"
  6. v-if="commitType == 1"
  7. :form='form'
  8. />
  9. <!-- 常规 -->
  10. <Continuous
  11. @close='close'
  12. v-else
  13. :form='form'
  14. />
  15. </div>
  16. </template>
  17. <script>
  18. import Vue from "vue";
  19. import Continuous from "./component/Continuous";
  20. import Progressive from "./component/Progressive";
  21. import {
  22. Button,
  23. Popup,
  24. Cell,
  25. CellGroup,
  26. Field,
  27. Image,
  28. Loading,
  29. RadioGroup,
  30. Radio,
  31. CheckboxGroup,
  32. Checkbox,
  33. Dialog,
  34. ImagePreview,
  35. Slider,
  36. Form,
  37. GoodsActionButton,
  38. GoodsAction,
  39. Tag,
  40. Uploader
  41. } from "vant";
  42. Vue.use(Button)
  43. .use(Popup)
  44. .use(Slider)
  45. .use(Dialog)
  46. .use(Form)
  47. .use(Cell)
  48. .use(CellGroup)
  49. .use(Field)
  50. .use(Image)
  51. .use(Loading)
  52. .use(RadioGroup)
  53. .use(Radio)
  54. .use(CheckboxGroup)
  55. .use(Checkbox)
  56. .use(ImagePreview).use(GoodsActionButton).use(GoodsAction).use(Tag).use(Uploader);
  57. import 'vant/lib/index.css'
  58. export default {
  59. props:['form'],
  60. components: {
  61. Continuous,
  62. Progressive,
  63. },
  64. data() {
  65. return {
  66. loginFlag: true,
  67. commitType: 0, // 1是逐题提交 0.一起提交
  68. preView: false,
  69. };
  70. },
  71. mounted() {
  72. this.commitType = this.form.commitType;
  73. // window.addEventListener("message", this.handleMessage);
  74. // this.$emit("load");
  75. },
  76. methods: {
  77. // handleMessage(e) {
  78. // var data = e.data;
  79. // if (data.cmd == "getFormJson") {
  80. // this.loginFlag = data.data.loginFlag;
  81. // this.commitType = data.data.commitType;
  82. // this.preView = true;
  83. // this.questionList = data.data.questionnaireQuestionList;
  84. // console.log(this.questionList, data.data);
  85. // }
  86. // },
  87. close(){
  88. this.$emit('close')
  89. }
  90. },
  91. };
  92. </script>
  93. <style lang="scss" scoped>
  94. /deep/.icon-weigouxuan {
  95. border: 1px solid #ccc;
  96. border-radius: 50%;
  97. }
  98. </style>