派生自 wuyushui/SewerAndRainNetwork

XingChuan
2021-05-30 d4a64e11c43a8268d48fbb6d710d3ba379a31359
src/components/layer/src/layer.js
@@ -20,16 +20,12 @@
   * @return {[type]}         [description]
   */
  self.open = function (opt) {
    /* let option = {
      type: 1,
      content: opt.content,
      area: opt.area
    } */
    self.closeAll()
    var options = mergeJson(opt, defOptions)
    const id = `notification_${new Date().getTime()}_${seed++}`
    options.id = id
    options.layer = self
    options.content.content = Vue.extend(options.content.content)
    options.content.comp = Vue.extend(options.content.comp)
    const instance = new LayerVueExtend({
      data: options
    })
@@ -55,7 +51,6 @@
   * @return {[type]}    [description]
   */
  self.close = function (id) {
    console.log(id)
    const oElm = document.getElementById(id).parentElement
    if (oElm) {
      document.body.removeChild(oElm)
@@ -111,22 +106,9 @@
   * @param  {[type]} id [description]
   * @return {[type]}    [description]
   */
  self.closeAll = function (type = -1) {
    const types = {
      page: 0,
      iframe: 1
    }
    if (type === -1) {
      for (const k in self.instances) {
        self.close(k)
      }
    } else {
      const targetType = types[type]
      for (const k in self.instances) {
        if (self.instances[k].type === targetType) {
          self.close(k)
        }
      }
  self.closeAll = function () {
    for (const k in self.instances) {
      self.close(k)
    }
  }
  /**