zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    Locust学习笔记3——模拟登录案例(非加密)
    Locust学习笔记2——环境搭建与基本用法
    Locust学习笔记1——性能测试工具选择
    Pytest学习笔记7——接口自动化测试框架实战附源码(开荒篇)
    Pytest学习笔记6——自定义用例顺序
    Pytest学习笔记5——Allure测试报告用例详细描述
    Pytest学习笔记4——测试步骤
    Python 批量插入100万级数据到Excel文件(简洁版)
    [Java] SpringBoot
    [bug] Springboot JPA使用Sort排序时的问题
  • 原文地址:https://www.cnblogs.com/javascript9527/p/11823047.html
Copyright © 2011-2022 走看看