eventDrawer.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <div>
  3. <el-drawer class="custom-drawer-form" size="900px" :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)" isOperate='可视化'></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. //控制弹窗是否显示
  20. drawer:false,
  21. //事件的信息
  22. params:{},
  23. //事件数量
  24. QuestionTotal:[]
  25. };
  26. },
  27. watch: {},
  28. computed: {},
  29. created() {},
  30. mounted() {
  31. //获取事件数量
  32. this.getEventNumber()
  33. },
  34. methods: {
  35. //获取当前应用场景数据
  36. getQuestionId(type){
  37. if(this.QuestionTotal.length>0){
  38. var a= this.QuestionTotal.find(item=>{return item.applicationScenarioName == type})
  39. if(a){
  40. return a.applicationScenarioValue
  41. }
  42. }
  43. },
  44. //获取事件数量
  45. async getEventNumber(){
  46. await this.$api.queryApplicationScenarioEventNumber().then(response=>{
  47. if(response.code == 200){
  48. this.QuestionTotal = response.data
  49. }
  50. })
  51. },
  52. //打开抽屉
  53. open(scenarioName, typeName, question){
  54. this.params = {
  55. scenarioName:scenarioName,
  56. typeName:typeName,
  57. question:question
  58. }
  59. this.drawer = true
  60. },
  61. //关闭抽屉
  62. close(){
  63. this.$emit('close')
  64. this.drawer = false
  65. }
  66. },
  67. };
  68. </script>
  69. <style lang="scss">
  70. </style>