king
2021-08-31 72419e2f826031a158173f46d723a672064e37cd
src/menu/components/tabs/tabcomponents/index.jsx
@@ -6,7 +6,7 @@
import Utils from '@/utils/utils.js'
import MKEmitter from '@/utils/events.js'
import MenuUtils from '@/menu/utils/menuUtils.js'
import MenuUtils from '@/utils/utils-custom.js'
import Card from './card'
import './index.scss'
@@ -54,8 +54,11 @@
      title: `确定删除《${card.name}》吗?`,
      content: hasComponent ? '当前组件中含有子组件!' : '',
      onOk() {
        MKEmitter.emit('delButtons', uuids)
        handleList({...config, components: cards.filter(item => item.uuid !== card.uuid)})
        if (uuids.length === 0) return
        MKEmitter.emit('delButtons', uuids)
      },
      onCancel() {}
    })
@@ -96,6 +99,14 @@
        search: '搜索',
        table: '表格',
        group: '分组',
        editor: '富文本',
        code: '自定义',
        carousel: '轮播',
        form: '表单',
        dashboard: '仪表盘',
        scatter: '散点图',
        tree: '树形列表',
        balcony: '浮动卡',
        card: '卡片'
      }
      let i = 1
@@ -107,14 +118,6 @@
        }
        i++
      }
      let dataName = ''
      while (!dataName) {
        let _dataName = Utils.getdataName()
        if (config.components.filter(com => com.dataName === _dataName).length === 0) {
          dataName = _dataName
        }
      }
      
      let newcard = {
        uuid: Utils.getuuid(),
@@ -124,7 +127,7 @@
        subtype: item.subtype,
        config: item.config,
        width: item.width || 24,
        dataName: dataName,
        dataName: Utils.getdataName(),
        name: name,
        floor: config.floor ? (config.floor + 1) : 2, // 组件的层级
        isNew: true                                   // 新添加标志,用于初始化