element 弹框关闭报错

Posted javascript9527

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了element 弹框关闭报错相关的知识,希望对你有一定的参考价值。

<template>
  <el-container style="padding: 00px 20px 0px 20px">
    <el-dialog
      title="售电公司注册审批记录"
      :visible.sync="innerVisible"
      width="60%"
      @close="closeDialog"
      :close-on-click-modal="true"
      :modal="false"
    >
    </el-dialog>
  </el-container>
</template>

<script>
import FlowNodeInsInfoRegApi from @/api/pxf-service-imarketservice/imarketMemberManage/registerCheck/FlowNodeInsInfoRegApi
import moment from moment
export default {
  props: {
    accessVisible: Boolean,
    membersRegInfo: {
      type: Object,
      default: function() {
        return {}
      }
    },
    states: {
      type: Object,
      default: function() {
        return {}
      }
    },
    processNum: {
      type: String,
      default: ‘‘
    }
  },
  data() {
    return {
      innerVisible: false,
      mmFlowNodeInsInfoRegList: [],
      scopeFlowNodeInsInfoRegList: [],
      scopeInfos: [],
      scopeProcessNum: ‘‘,
      scopeAll: ‘‘,
    }
  },
  watch: {

    accessVisible(newValue) {
      this.innerVisible = newValue
    }
  },
  mounted() {
    if (this.accessVisible) {
      this.init()
      this.queryByProcessNum(this.processNum, 1)
      this.queryByProcessNum(this.scopeProcessNum, 0)
    }
  },
  methods: {
    closeDialog() {
      this.$emit(close-dialog)
    },
    close() {
      this.$emit(update:visible) // 传递关闭事件
      this.$emit(close-dialog)
    },
    closeModal(e) {
      if (this.visible) {
        document.querySelector(.dialog).contains(e.target) ? ‘‘ : this.close() // 判断点击的落点在不在dialog对话框内,如果在对话框外就调用this.close()方法关闭对话框
      }
    },
    init() {
      this.scopeInfos = this.membersRegInfo.scopeInfos.filter(item => item.isRegAdd !== 1 && item.state !== 01)
      // 默认第一业务范围
      this.scopeProcessNum = ‘‘
      if (this.scopeInfos.length > 0) {
        if (this.scopeProcessNum === ‘‘) {
          this.scopeProcessNum = this.scopeInfos[0].processNum
        }
      }
      // 拼接所有业务范围
      this.scopeAll = ‘‘
      this.membersRegInfo.scopeInfos.forEach((item) => {
        this.scopeAll += item.name + 
      })
      if (this.scopeAll.indexOf() > -1) {
        this.scopeAll = this.scopeAll.substr(0, this.scopeAll.length - 1)
      }
    },
    queryByProcessNum(processNum, isRegAdd) {
      if (!processNum) {
        return
      }
      FlowNodeInsInfoRegApi.queryByProcessNum(processNum).then(result => {
        if (isRegAdd === 1) {
          this.mmFlowNodeInsInfoRegList = result.data
        } else {
          this.scopeFlowNodeInsInfoRegList = result.data
        }
      }).catch(err => {
        console.log(err)
      })
    },
    applicationDateFormat(row) {
      var date = row.applicationDate
      if (!date) {
        return ‘‘
      }
      return moment(date).format(YYYY-MM-DD)
    },
    dateFormat(row, column) {
      var date = row[column.property]
      if (!date) {
        return ‘‘
      }
      return moment(date).format(YYYY-MM-DD HH:mm:ss)
    },
    close() {
      this.$emit(close-dialog)
    },
    formatterState(row, column) {
      var state = row[column.property]
      return this.states[state]
    }
  }
}
</script>

<style scoped>

</style>

 

 

 

以上是关于element 弹框关闭报错的主要内容,如果未能解决你的问题,请参考以下文章

vue3关闭弹框校验还在element

取消elementUI-Notification组件($notify弹框)的esc按键关闭

element-ui MessageBox 弹框,我只想要弹出样式,不想要点击,当做一个弹出提醒,两秒后自动关闭

element-ui MessageBox 弹框,我只想要弹出样式,不想要点击,当做一个弹出提醒,两秒后自动关闭

解决element弹框组件导致页面抖动问题

解决element弹框组件导致页面抖动问题