eventDrawer.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <div>
  3. <el-drawer class="custom-drawer-form" size="1100px" :with-header="false" :visible.sync="drawer" direction="rtl" :before-close="close" destroy-on-close append-to-body>
  4. <div style="padding:10px;height:100%">
  5. <questionIndex :applicationScenario="getQuestionId(params.scenarioName)"></questionIndex>
  6. </div>
  7. </el-drawer>
  8. </div>
  9. </template>
  10. <script>
  11. export default {
  12. name:'eventDrawer',
  13. components: {
  14. questionIndex:() => import('@/views/event/components/index.vue')
  15. },
  16. props: {},
  17. data() {
  18. return {
  19. drawer:false,
  20. params:{},
  21. QuestionTotal:[]
  22. };
  23. },
  24. watch: {},
  25. computed: {},
  26. created() {},
  27. mounted() {
  28. this.getEventNumber()
  29. },
  30. methods: {
  31. getQuestionId(type){
  32. if(this.QuestionTotal.length>0){
  33. var a= this.QuestionTotal.find(item=>{return item.applicationScenarioName == type})
  34. if(a){
  35. return a.applicationScenarioValue
  36. }
  37. }
  38. },
  39. //获取事件数量
  40. async getEventNumber(){
  41. await this.$api.queryApplicationScenarioEventNumber().then(response=>{
  42. if(response.code == 200){
  43. this.QuestionTotal = response.data
  44. }
  45. })
  46. },
  47. open(scenarioName, typeName, question){
  48. this.params = {
  49. scenarioName:scenarioName,
  50. typeName:typeName,
  51. question:question
  52. }
  53. this.drawer = true
  54. },
  55. close(){
  56. this.$emit('close')
  57. this.drawer = false
  58. }
  59. },
  60. };
  61. </script>
  62. <style lang="scss">
  63. </style>