From ea34e669b45f86793017621a0dc3f9a71aa3276b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 23 二月 2021 18:23:26 +0800
Subject: [PATCH] 2021-02-23

---
 src/components/tabview/index.jsx                  |    2 
 src/components/tabview/index.scss                 |    7 
 src/pc/components/navbar/normal-navbar/index.jsx  |  437 +++++++++++++++++++++++++++++++++
 src/pc/modulesource/option.jsx                    |   36 ++
 package-lock.json                                 |    8 
 src/assets/css/viewstyle.scss                     |    3 
 src/views/pcdesign/index.jsx                      |    6 
 src/pc/modulesource/dragsource/index.jsx          |   15 +
 src/pc/modulesource/index.jsx                     |   93 +++++++
 src/pc/modulesource/index.scss                    |    9 
 config/webpack.config.js                          |    4 
 src/pc/components/navbar/normal-navbar/index.scss |   87 ++++++
 src/pc/modulesource/dragsource/index.scss         |   46 +++
 src/views/appmanage/index.jsx                     |   12 
 package.json                                      |    1 
 15 files changed, 754 insertions(+), 12 deletions(-)

diff --git a/config/webpack.config.js b/config/webpack.config.js
index 6591fda..54b9961 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -1,4 +1,4 @@
-'use strict';
+// 'use strict';
 
 const fs = require('fs');
 const isWsl = require('is-wsl');
@@ -25,7 +25,7 @@
 const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
 const ForkTsCheckerWebpackPlugin = require('react-dev-utils/ForkTsCheckerWebpackPlugin');
 const typescriptFormatter = require('react-dev-utils/typescriptFormatter');
-const eslint = require('eslint');
+// const eslint = require('eslint');
 
 const postcssNormalize = require('postcss-normalize');
 
diff --git a/package-lock.json b/package-lock.json
index 20b5512..a4a2649 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -4195,7 +4195,7 @@
       "dependencies": {
         "immutable": {
           "version": "3.7.6",
-          "resolved": "https://registry.npmjs.org/immutable/-/immutable-3.7.6.tgz",
+          "resolved": "http://registry.npm.taobao.org/immutable/download/immutable-3.7.6.tgz",
           "integrity": "sha1-E7TTyxK++hVIKib+Gy665kAHHks="
         }
       }
@@ -4519,9 +4519,9 @@
       }
     },
     "caniuse-lite": {
-      "version": "1.0.30001102",
-      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001102.tgz",
-      "integrity": "sha512-fOjqRmHjRXv1H1YD6QVLb96iKqnu17TjcLSaX64TwhGYed0P1E1CCWZ9OujbbK4Z/7zax7zAzvQidzdtjx8RcA=="
+      "version": "1.0.30001191",
+      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001191.tgz",
+      "integrity": "sha512-xJJqzyd+7GCJXkcoBiQ1GuxEiOBCLQ0aVW9HMekifZsAVGdj5eJ4mFB9fEhSHipq9IOk/QXFJUiIr9lZT+EsGw=="
     },
     "capture-exit": {
       "version": "2.0.0",
diff --git a/package.json b/package.json
index 0e71613..ad7bc05 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,6 @@
     "braft-extensions": "^0.1.1",
     "browserslist": "^4.13.0",
     "camelcase": "^5.2.0",
-    "caniuse-lite": "^1.0.30001102",
     "case-sensitive-paths-webpack-plugin": "2.2.0",
     "codemirror": "^5.52.2",
     "css-loader": "2.1.1",
diff --git a/src/assets/css/viewstyle.scss b/src/assets/css/viewstyle.scss
index c5dbf67..33e7094 100644
--- a/src/assets/css/viewstyle.scss
+++ b/src/assets/css/viewstyle.scss
@@ -370,6 +370,9 @@
   .ant-table-thead > tr > th .ant-table-column-sorter .ant-table-column-sorter-inner .ant-table-column-sorter-up.on, .ant-table-thead > tr > th .ant-table-column-sorter .ant-table-column-sorter-inner .ant-table-column-sorter-down.on {
     color: $color6;
   }
+  .mk-water-mark {
+    color: $color4;
+  }
 }
 
 body.hidden-split-line #root { // 鍘婚櫎鐧诲綍椤靛垎鍓茬嚎
diff --git a/src/components/tabview/index.jsx b/src/components/tabview/index.jsx
index 7c4e5a5..ce5a0e8 100644
--- a/src/components/tabview/index.jsx
+++ b/src/components/tabview/index.jsx
@@ -9,6 +9,7 @@
 import { modifyTabview, toggleIsiframe } from '@/store/action'
 import asyncComponent from '@/utils/asyncLoadComponent'
 import NotFount from '@/components/404'
+import options from '@/store/options.js'
 import mzhCN from '@/locales/zh-CN/main.js'
 import menUS from '@/locales/en-US/main.js'
 import MKEmitter from '@/utils/events.js'
@@ -243,6 +244,7 @@
                         </div>
                       </div>
                     </BackTop>
+                    {options.sysType === 'local' && window.GLOB.systemType !== 'production' ? <div className="mk-water-mark">娴嬭瘯绯荤粺</div> : null}
                   </Tabs.TabPane>
                 )
               })}
diff --git a/src/components/tabview/index.scss b/src/components/tabview/index.scss
index c99ba4e..fe43335 100644
--- a/src/components/tabview/index.scss
+++ b/src/components/tabview/index.scss
@@ -107,6 +107,13 @@
     bottom: 20px;
     right: 30px;
   }
+  .mk-water-mark {
+    position: absolute;
+    top: 47px;
+    left: 5px;
+    font-size: 13px;
+    font-style: italic;
+  }
 }
 .mk-tabview-wrap.collapsed {
   max-width: calc(100% - 80px);
diff --git a/src/pc/components/navbar/normal-navbar/index.jsx b/src/pc/components/navbar/normal-navbar/index.jsx
new file mode 100644
index 0000000..37cebdb
--- /dev/null
+++ b/src/pc/components/navbar/normal-navbar/index.jsx
@@ -0,0 +1,437 @@
+import React, {Component} from 'react'
+import PropTypes from 'prop-types'
+import { connect } from 'react-redux'
+import { is, fromJS } from 'immutable'
+import { Icon, Popover, Modal, Pagination, notification } from 'antd'
+
+import asyncComponent from '@/utils/asyncComponent'
+import asyncIconComponent from '@/utils/asyncIconComponent'
+
+import MKEmitter from '@/utils/events.js'
+import Utils from '@/utils/utils.js'
+import zhCN from '@/locales/zh-CN/model.js'
+import enUS from '@/locales/en-US/model.js'
+import './index.scss'
+
+const SettingComponent = asyncIconComponent(() => import('@/menu/datasource'))
+const WrapComponent = asyncIconComponent(() => import('./wrapsetting'))
+const CardComponent = asyncComponent(() => import('../cardcomponent'))
+const LogComponent = asyncIconComponent(() => import('@/menu/components/share/logcomponent'))
+const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
+const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent'))
+const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent'))
+const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader'))
+const ActionComponent = asyncComponent(() => import('@/menu/components/share/actioncomponent'))
+
+const { confirm } = Modal
+
+class DataCardEditComponent extends Component {
+  static propTpyes = {
+    card: PropTypes.object,
+    deletecomponent: PropTypes.func,
+    updateConfig: PropTypes.func,
+  }
+
+  state = {
+    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
+    card: null,
+    back: false
+  }
+
+  UNSAFE_componentWillMount () {
+    const { card } = this.props
+
+    if (card.isNew) {
+      let _card = {
+        uuid: card.uuid,
+        type: card.type,
+        floor: card.floor,
+        tabId: card.tabId || '',
+        parentId: card.parentId || '',
+        format: 'array',   // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡
+        pageable: true,    // 缁勪欢灞炴�� - 鏄惁鍙垎椤�
+        switchable: true,  // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹�
+        dataName: card.dataName || '',
+        width: card.width || 24,
+        name: card.name,
+        subtype: card.subtype,
+        setting: { interType: 'system' },
+        wrap: { name: card.name, width: card.width || 24, title: '', pagestyle: 'page', switch: 'false' },
+        style: { marginLeft: '0px', marginRight: '0px', marginTop: '8px', marginBottom: '8px' },
+        headerStyle: { fontSize: '16px', borderBottomWidth: '1px', borderBottomColor: '#e8e8e8' },
+        columns: [],
+        scripts: [],
+        action: [],
+        search: [],
+        btnlog: [],
+        subcards: [{
+          uuid: Utils.getuuid(),
+          setting: { width: 6, type: 'simple'},
+          style: {
+            borderWidth: '1px', borderColor: '#e8e8e8',
+            paddingTop: '15px', paddingBottom: '15px', paddingLeft: '15px', paddingRight: '15px',
+            marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px'
+          },
+          backStyle: {},
+          elements: [],
+          backElements: []
+        }]
+      }
+
+      if (card.config) {
+        let config = fromJS(card.config).toJS()
+
+        _card.wrap = config.wrap
+        _card.wrap.name = card.name
+        _card.style = config.style
+        _card.headerStyle = config.headerStyle
+
+        _card.subcards = config.subcards.map(scard => {
+          scard.uuid = Utils.getuuid()
+          scard.elements = scard.elements.map(elem => {
+            elem.uuid = Utils.getuuid()
+            return elem
+          })
+          scard.backElements = scard.backElements.map(elem => {
+            elem.uuid = Utils.getuuid()
+            return elem
+          })
+          return scard
+        })
+        _card.action = config.action.map(col => {
+          col.uuid = Utils.getuuid()
+          return col
+        })
+        _card.search = config.search.map(col => {
+          col.uuid = Utils.getuuid()
+          return col
+        })
+      }
+
+      this.setState({
+        card: _card
+      })
+      this.props.updateConfig(_card)
+    } else {
+      card.action = card.action || [] // 鍏煎
+      card.search = card.search || [] // 鍏煎
+
+      this.setState({
+        card: fromJS(card).toJS()
+      })
+    }
+  }
+
+  componentDidMount () {
+    MKEmitter.addListener('submitStyle', this.getStyle)
+    MKEmitter.addListener('submitModal', this.handleSave)
+    MKEmitter.addListener('logButton', this.logButton)
+  }
+
+  shouldComponentUpdate (nextProps, nextState) {
+    return !is(fromJS(this.state), fromJS(nextState)) || (!this.props.menu && nextProps.menu)
+  }
+
+  /**
+   * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊锛屾竻闄ゅ揩鎹烽敭璁剧疆
+   */
+  componentWillUnmount () {
+    this.setState = () => {
+      return
+    }
+    MKEmitter.removeListener('submitStyle', this.getStyle)
+    MKEmitter.removeListener('submitModal', this.handleSave)
+    MKEmitter.removeListener('logButton', this.logButton)
+  }
+
+  logButton = (id, item) => {
+    const { card } = this.state
+
+    if (id !== card.uuid) return
+
+    let btnlog = card.btnlog || []
+    btnlog.push(item)
+
+    this.setState({
+      card: {...card, btnlog}
+    })
+    this.props.updateConfig({...card, btnlog})
+  }
+  
+  /**
+   * @description 鍗$墖琛屽灞備俊鎭洿鏂帮紙鏁版嵁婧愶紝鏍峰紡绛夛級
+   */
+  updateComponent = (component) => {
+    this.setState({
+      card: component
+    })
+
+    component.width = component.wrap.width
+    component.name = component.wrap.name
+
+    this.props.updateConfig(component)
+  }
+
+  /**
+   * @description 鍗曚釜鍗$墖淇℃伅鏇存柊
+   */
+  updateCard = (cell) => {
+    let card = fromJS(this.state.card).toJS()
+
+    card.subcards = card.subcards.map(item => {
+      if (item.uuid === cell.uuid) return cell
+      return item
+    })
+
+    this.setState({card})
+
+    this.props.updateConfig(card)
+  }
+
+  /**
+   * @description 鍗曚釜鍗$墖淇℃伅鏇存柊
+   */
+  deleteCard = (cell) => {
+    let card = fromJS(this.state.card).toJS()
+    let _this = this
+
+    confirm({
+      content: '纭畾鍒犻櫎鍗$墖鍚楋紵',
+      onOk() {
+        card.subcards = card.subcards.filter(item => item.uuid !== cell.uuid)
+
+        let uuids = []
+        cell.elements && cell.elements.forEach(c => {
+          if (c.eleType === 'button') {
+            uuids.push(c.uuid)
+          }
+        })
+        cell.backElements && cell.backElements.forEach(c => {
+          if (c.eleType === 'button') {
+            uuids.push(c.uuid)
+          }
+        })
+        MKEmitter.emit('delButtons', uuids)
+
+        if (card.btnlog) {
+          card.btnlog = card.btnlog.filter(c => c.$parentId !== cell.uuid)
+        }
+
+        _this.setState({card})
+        _this.props.updateConfig(card)
+      },
+      onCancel() {}
+    })
+  }
+
+  changeStyle = () => {
+    const { card } = this.state
+
+    MKEmitter.emit('changeStyle', [card.uuid], ['background', 'border', 'padding', 'margin'], card.style)
+  }
+
+  getStyle = (comIds, style) => {
+    const { card } = this.state
+
+    if (comIds.length !== 1 || comIds[0] !== card.uuid) return
+
+    let _card = {...card, style}
+
+    this.setState({
+      card: _card
+    })
+    
+    this.props.updateConfig(_card)
+  }
+
+  addSearch = () => {
+    const { card } = this.state
+
+    let newcard = {}
+    newcard.uuid = Utils.getuuid()
+    newcard.focus = true
+
+    newcard.label = 'label'
+    newcard.type = 'select'
+    newcard.resourceType = '0'
+    newcard.options = []
+    newcard.setAll = 'false'
+    newcard.orderType = 'asc'
+    newcard.display = 'dropdown'
+    newcard.match = '='
+
+    // 娉ㄥ唽浜嬩欢-娣诲姞鎼滅储
+    MKEmitter.emit('addSearch', card.uuid, newcard)
+  }
+
+  addButton = () => {
+    const { card } = this.state
+
+    let newcard = {}
+    newcard.uuid = Utils.getuuid()
+    newcard.focus = true
+    
+    newcard.label = 'label'
+    newcard.Ot = 'requiredSgl'
+    newcard.OpenType = 'pop'
+    newcard.icon = ''
+    newcard.class = 'green'
+    newcard.intertype = card.setting.interType || 'system'
+    newcard.innerFunc = card.setting.innerFunc || ''
+    newcard.sysInterface = card.setting.sysInterface || ''
+    newcard.outerFunc = card.setting.outerFunc || ''
+    newcard.interface = card.setting.interface || ''
+    newcard.execSuccess = 'grid'
+    newcard.execError = 'never'
+    newcard.verify = null
+    newcard.show = 'button'
+    newcard.btnstyle = {marginRight: '15px'}
+
+    // 娉ㄥ唽浜嬩欢-娣诲姞鎸夐挳
+    MKEmitter.emit('addButton', card.uuid, newcard)
+  }
+
+  setSubConfig = (item) => {
+    const { card } = this.state
+    let btn = fromJS(item).toJS()
+
+    if (btn.OpenType === 'pop') {
+      if (!btn.modal) {
+        btn.modal = {
+          setting: { title: btn.label, width: 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' },
+          tables: [],
+          groups: [],
+          fields: []
+        }
+      }
+      MKEmitter.emit('changeModal', card, btn)
+    } else if (btn.OpenType === 'popview') {
+      MKEmitter.emit('changePopview', card, btn)
+    }
+  }
+
+  handleSave = (_cards, btn, modal) => {
+    let card = fromJS(this.state.card).toJS()
+
+    if (card.uuid !== _cards.uuid) return
+
+    let _index = card.action.findIndex(cell => cell.uuid === btn.uuid)
+
+    if (_index === -1) return
+
+    card.action = card.action.map(cell => {
+      if (cell.uuid === btn.uuid) {
+        cell.modal = modal
+      }
+
+      return cell
+    })
+
+    this.setState({card})
+    this.props.updateConfig(card)
+  }
+
+  handleLog = (type, logs, item) => {
+    let card = fromJS(this.state.card).toJS()
+
+    if (type === 'revert') {
+      let done = false
+      if (item.$parentId) {
+        card.subcards.forEach(col => {
+          if (item.$parentId === col.uuid) {
+            if (item.$side !== 'back') {
+              col.elements = col.elements ? [...col.elements, item] : [item]
+            } else {
+              col.backElements = col.backElements ? [...col.backElements, item] : [item]
+            }
+            done = true
+          }
+        })
+      }
+
+      if (!done) {
+        card.action = card.action ? [...card.action, item] : [item]
+      }
+
+      card.btnlog = logs
+
+      this.setState({ card })
+      this.props.updateConfig(card)
+      notification.success({
+        top: 92,
+        message: '鎭㈠鎴愬姛锛�',
+        duration: 2
+      })
+    } else {
+      card.btnlog = logs
+      this.setState({ card })
+      this.props.updateConfig(card)
+      notification.success({
+        top: 92,
+        message: '娓呴櫎鎴愬姛锛�',
+        duration: 2
+      })
+    }
+  }
+
+  clickComponent = (e) => {
+    if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') {
+      e.stopPropagation()
+      MKEmitter.emit('clickComponent', this.state.card)
+    }
+  }
+
+  render() {
+    const { card } = this.state
+
+    let offset = 0
+    if (card.wrap.cardFloat && card.wrap.cardFloat !== 'left') {
+      let _width = 0
+      card.subcards.forEach(card => {
+        _width += card.setting.width
+      })
+      offset = _width < 24 ? 24 - _width : 0
+      if (card.wrap.cardFloat === 'center') {
+        offset = Math.floor(offset / 2)
+      }
+    }
+
+    return (
+      <div className="menu-data-card-edit-box" style={{...card.style}} onClick={this.clickComponent} id={card.uuid}>
+        <NormalHeader defaultshow="hidden" config={card} updateComponent={this.updateComponent}/>
+        <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
+          <div className="mk-popover-control">
+            <Icon className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch} type="plus-circle" />
+            <Icon className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton} type="plus-square" />
+            <WrapComponent config={card} updateConfig={this.updateComponent} />
+            <CopyComponent type="datacard" card={card}/>
+            <PasteComponent config={card} options={['action', 'search', 'form']} updateConfig={this.updateComponent} />
+            <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" />
+            <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog} />
+            <UserComponent config={card}/>
+            <Icon className="close" title="鍒犻櫎缁勪欢" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} />
+            <SettingComponent config={card} updateConfig={this.updateComponent} />
+          </div>
+        } trigger="hover">
+          <Icon type="tool" />
+        </Popover>
+        <ActionComponent config={card} setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/>
+        {card.subcards.map((subcard, index) => (<CardComponent key={subcard.uuid} offset={!index ? offset : 0} cards={card} card={subcard} updateElement={this.updateCard} deleteElement={this.deleteCard}/>))}
+        <div style={{clear: 'both'}}></div>
+        {card.wrap.pagestyle !== 'switch' && card.setting.laypage === 'true' ? <Pagination total={85} size="small" showTotal={total => `鍏� ${total} 鏉} pageSize={20} defaultCurrent={1}/> : null}
+      </div>
+    )
+  }
+}
+
+const mapStateToProps = (state) => {
+  return {
+    menu: state.customMenu
+  }
+}
+
+const mapDispatchToProps = () => {
+  return {}
+}
+
+export default connect(mapStateToProps, mapDispatchToProps)(DataCardEditComponent)
\ No newline at end of file
diff --git a/src/pc/components/navbar/normal-navbar/index.scss b/src/pc/components/navbar/normal-navbar/index.scss
new file mode 100644
index 0000000..6346310
--- /dev/null
+++ b/src/pc/components/navbar/normal-navbar/index.scss
@@ -0,0 +1,87 @@
+.menu-data-card-edit-box {
+  position: relative;
+  box-sizing: border-box;
+  background: #ffffff;
+  background-position: center center;
+  background-repeat: no-repeat;
+  background-size: cover;
+  min-height: 20px;
+  
+  .card-control {
+    position: absolute;
+    top: 0px;
+    left: 0px;
+    .anticon-tool {
+      right: auto;
+      left: 1px;
+      padding: 1px;
+    }
+  }
+  .anticon-tool {
+    position: absolute;
+    z-index: 2;
+    font-size: 16px;
+    right: 1px;
+    top: 1px;
+    cursor: pointer;
+    padding: 5px;
+    background: rgba(255, 255, 255, 0.55);
+  }
+
+  .card-item {
+    overflow: hidden;
+    position: relative;
+    background-color: #ffffff;
+    background-position: center center;
+    background-repeat: no-repeat;
+    background-size: cover;
+    min-height: 20px;
+  }
+  
+  .card-item:hover {
+    box-shadow: 0px 0px 2px #1890ff;
+  }
+
+  .model-menu-card-cell-list .card-detail-row > .anticon-plus {
+    position: absolute;
+    right: -30px;
+    font-size: 16px;
+  }
+  .model-menu-action-list {
+    line-height: 40px;
+    .ant-row > .anticon-plus {
+      position: absolute;
+      right: -30px;
+      font-size: 16px;
+    }
+  }
+  .card-add-button {
+    text-align: right;
+    clear: left;
+    .anticon-plus {
+      font-size: 20px;
+      color: #26C281;
+      padding: 5px;
+      margin-right: 10px;
+    }
+  }
+  .ant-pagination {
+    float: right;
+    margin: 10px;
+  }
+
+  .model-menu-action-list {
+    .page-card {
+      line-height: 55px;
+    }
+  }
+}
+.menu-data-card-edit-box::after {
+  display: block;
+  content: ' ';
+  clear: both;
+}
+.menu-data-card-edit-box:hover {
+  z-index: 1;
+  box-shadow: 0px 0px 4px #1890ff;
+}
diff --git a/src/pc/modulesource/dragsource/index.jsx b/src/pc/modulesource/dragsource/index.jsx
new file mode 100644
index 0000000..0f13372
--- /dev/null
+++ b/src/pc/modulesource/dragsource/index.jsx
@@ -0,0 +1,15 @@
+import React from 'react'
+import { useDrag } from 'react-dnd'
+import { Icon } from 'antd'
+import './index.scss'
+
+const MobSourceElement = ({item, triggerDel}) => {
+  const [, drag] = useDrag({ item })
+  return (
+    <div className="menu-source-item">
+      <div className="property"><span>{item.title}</span>{item.config ? <Icon onClick={() => triggerDel(item)} type="close-circle" /> : null}</div>
+      <img ref={drag} src={item.url} alt=""/>
+    </div>
+  )
+}
+export default MobSourceElement
\ No newline at end of file
diff --git a/src/pc/modulesource/dragsource/index.scss b/src/pc/modulesource/dragsource/index.scss
new file mode 100644
index 0000000..ac891ba
--- /dev/null
+++ b/src/pc/modulesource/dragsource/index.scss
@@ -0,0 +1,46 @@
+.menu-source-item {
+  display: inline-block;
+  width: 100%;
+  margin-bottom: 15px;
+  height: auto;
+  min-height: 70px;
+
+  .property {
+    font-size: 14px;
+    color: rgba(0, 0, 0, 0.65);
+    margin-bottom: 2px;
+
+    .anticon-close-circle {
+      opacity: 0;
+      cursor: pointer;
+      padding: 0 3px;
+      color: #ff4d4f;
+      transition: all 0.3s;
+    }
+  }
+
+  img {
+    width: 100%;
+    cursor: move;
+    box-shadow: 0px 0px 1px #1890ff;
+  }
+
+  .tooltip-block {
+    width: 100%;
+    height: 100%;
+    background: transparent;
+  }
+}
+
+.menu-source-item:hover .property {
+  .anticon-close-circle {
+    opacity: 1;
+  }
+}
+
+.menu-source-tooltip-box {
+  margin-left: 20px;
+  .ant-tooltip-content {
+    width: 250px;
+  }
+}
\ No newline at end of file
diff --git a/src/pc/modulesource/index.jsx b/src/pc/modulesource/index.jsx
new file mode 100644
index 0000000..f4705bf
--- /dev/null
+++ b/src/pc/modulesource/index.jsx
@@ -0,0 +1,93 @@
+import React, {Component} from 'react'
+import { is, fromJS } from 'immutable'
+import { Modal, notification } from 'antd'
+
+import Api from '@/api'
+import { menuOptions } from './option'
+import SourceWrap from './dragsource'
+import MKEmitter from '@/utils/events.js'
+import './index.scss'
+
+const { confirm } = Modal
+
+class ModelSource extends Component {
+  state = {
+    menuOptions: null,
+  }
+
+  UNSAFE_componentWillMount () {
+    const { components } = this.props
+    let options = []
+    
+    if (components) {
+      options = fromJS(components).toJS()
+    } else {
+      options = fromJS(menuOptions).toJS()
+    }
+
+    this.setState({
+      menuOptions: options
+    })
+  }
+
+  UNSAFE_componentWillReceiveProps (nextProps) {
+    if (nextProps.components && !is(fromJS(this.props.components), fromJS(nextProps.components))) {
+      this.setState({
+        menuOptions: fromJS(nextProps.components).toJS()
+      })
+    }
+  }
+
+  shouldComponentUpdate (nextProps, nextState) {
+    return !is(fromJS(this.state), fromJS(nextState))
+  }
+
+  triggerDel = (item) => {
+    confirm({
+      title: `纭畾鍒犻櫎<${item.title}>鍚楋紵`,
+      content: '',
+      onOk() {
+        return new Promise(resolve => {
+          Api.getSystemConfig({
+            func: 's_custom_components_adduptdel',
+            c_id: item.uuid,
+            images: '',
+            c_name: item.title,
+            long_param: '',
+            del_type: 'Y'
+          }).then(result => {
+            if (result.status) {
+              notification.success({
+                top: 92,
+                message: '鍒犻櫎鎴愬姛锛�',
+                duration: 5
+              })
+
+              MKEmitter.emit('updateCustomComponent')
+            } else {
+              notification.warning({
+                top: 92,
+                message: result.message,
+                duration: 5
+              })
+            }
+            resolve()
+          })
+        })
+      },
+      onCancel() {}
+    })
+  }
+
+  render() {
+    const { menuOptions } = this.state
+
+    return (
+      <div className="mob-card-source-box">
+        {menuOptions.map((item, index) => (<SourceWrap key={index} item={item} triggerDel={this.triggerDel} />))}
+      </div>
+    )
+  }
+}
+
+export default ModelSource
\ No newline at end of file
diff --git a/src/pc/modulesource/index.scss b/src/pc/modulesource/index.scss
new file mode 100644
index 0000000..cd91c8f
--- /dev/null
+++ b/src/pc/modulesource/index.scss
@@ -0,0 +1,9 @@
+.mob-card-source-box {
+  padding: 20px 0px;
+  position: relative;
+
+  p {
+    color: rgba(0, 0, 0, 0.85);
+    margin-bottom: 10px;
+  }
+}
diff --git a/src/pc/modulesource/option.jsx b/src/pc/modulesource/option.jsx
new file mode 100644
index 0000000..9c9ee1c
--- /dev/null
+++ b/src/pc/modulesource/option.jsx
@@ -0,0 +1,36 @@
+import bar from '@/assets/mobimg/bar.png'
+import bar1 from '@/assets/mobimg/bar1.png'
+import line from '@/assets/mobimg/line.png'
+import line1 from '@/assets/mobimg/line1.png'
+import tabs from '@/assets/mobimg/tabs.png'
+import group from '@/assets/mobimg/group.png'
+import card1 from '@/assets/mobimg/card1.png'
+import card2 from '@/assets/mobimg/card2.png'
+import TableCard from '@/assets/mobimg/table-card.png'
+import NormalTable from '@/assets/mobimg/normal-table.png'
+import Pie from '@/assets/mobimg/pie.png'
+import Editor from '@/assets/mobimg/editor.png'
+import SandBox from '@/assets/mobimg/sandbox.png'
+import Pie1 from '@/assets/mobimg/ring.png'
+import Pie2 from '@/assets/mobimg/nightingale.png'
+import Mainsearch from '@/assets/mobimg/mainsearch.png'
+
+// 缁勪欢閰嶇疆淇℃伅
+export const menuOptions = [
+  { type: 'menu', url: tabs, component: 'tabs', subtype: 'tabs', title: '鏍囩椤�', width: 24 },
+  { type: 'menu', url: Mainsearch, component: 'search', subtype: 'mainsearch', title: '鎼滅储鏉′欢', width: 24 },
+  { type: 'menu', url: card1, component: 'card', subtype: 'datacard', title: '鏁版嵁鍗�', width: 24 },
+  { type: 'menu', url: card2, component: 'card', subtype: 'propcard', title: '灞炴�у崱', width: 24 },
+  { type: 'menu', url: NormalTable, component: 'table', subtype: 'normaltable', title: '甯哥敤琛�', width: 24 },
+  { type: 'menu', url: TableCard, component: 'table', subtype: 'tablecard', title: '琛ㄦ牸', width: 12 },
+  { type: 'menu', url: line, component: 'line', subtype: 'line', title: '鎶樼嚎鍥�', width: 24 },
+  { type: 'menu', url: line1, component: 'line', subtype: 'line1', title: '闃舵鎶樼嚎鍥�', width: 24 },
+  { type: 'menu', url: bar, component: 'bar', subtype: 'bar', title: '鏌辩姸鍥�', width: 24 },
+  { type: 'menu', url: bar1, component: 'bar', subtype: 'bar1', title: '鏉″舰鍥�', width: 24 },
+  { type: 'menu', url: Pie, component: 'pie', subtype: 'pie', title: '楗煎浘', width: 12 },
+  { type: 'menu', url: Pie1, component: 'pie', subtype: 'ring', title: '鐜浘', width: 12 },
+  { type: 'menu', url: Editor, component: 'editor', subtype: 'brafteditor', title: '瀵屾枃鏈�', width: 24 },
+  { type: 'menu', url: SandBox, component: 'code', subtype: 'sandbox', title: '鑷畾涔�', width: 24 },
+  { type: 'menu', url: Pie2, component: 'pie', subtype: 'nightingale', title: '鍗椾竵鏍煎皵鍥�', width: 12 },
+  { type: 'menu', url: group, component: 'group', subtype: 'normalgroup', title: '鍒嗙粍', width: 24 },
+]
diff --git a/src/views/appmanage/index.jsx b/src/views/appmanage/index.jsx
index 8b9b2fc..e714bdd 100644
--- a/src/views/appmanage/index.jsx
+++ b/src/views/appmanage/index.jsx
@@ -2,6 +2,7 @@
 import { fromJS } from 'immutable'
 import { Spin, notification, Button, Table, Modal, ConfigProvider } from 'antd'
 import moment from 'moment'
+import md5 from 'md5'
 import enUS from 'antd/es/locale/en_US'
 import zhCN from 'antd/es/locale/zh_CN'
 
@@ -318,9 +319,16 @@
         confirmloading: true
       })
 
+      let ID = ''
+      if (visible === 'edit') {
+        ID = selectApp.ID
+      } else {
+        ID = md5(window.GLOB.appkey + res.kei_no)
+      }
+
       let param = {
         func: 's_kei_addupt',
-        ID: visible === 'edit' ? selectApp.ID : Utils.getuuid(),
+        ID: ID,
         exec_type: 'y',
         remark: res.remark,
         kei_no: res.kei_no,
@@ -403,7 +411,7 @@
       let sublist = fromJS(selectApp.sublist).toJS()
       if (subVisible === 'plus') {
         sublist.unshift({
-          ID: Utils.getuuid(),
+          ID: md5(window.GLOB.appkey + selectApp.kei_no + res.typename + res.lang),
           ...res
         })
       } else {
diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx
index 1c39a05..7ae3739 100644
--- a/src/views/pcdesign/index.jsx
+++ b/src/views/pcdesign/index.jsx
@@ -27,7 +27,7 @@
 
 const MenuForm = asyncComponent(() => import('./menuform'))
 const MenuShell = asyncComponent(() => import('@/menu/menushell'))
-const SourceWrap = asyncComponent(() => import('@/menu/modulesource'))
+const SourceWrap = asyncComponent(() => import('@/pc/modulesource'))
 const BgController = asyncComponent(() => import('@/pc/bgcontroller'))
 const PasteController = asyncComponent(() => import('@/menu/pastecontroller'))
 const PaddingController = asyncComponent(() => import('@/pc/padcontroller'))
@@ -936,10 +936,10 @@
                   </Panel>
                   {/* 缁勪欢娣诲姞 */}
                   <Panel header={dict['mob.component']} key="component">
-                    <SourceWrap MenuType={'pc'} />
+                    <SourceWrap />
                   </Panel>
                   {customComponents && customComponents.length ? <Panel header="鑷畾涔夌粍浠�" key="cuscomponent">
-                    <SourceWrap components={customComponents} MenuType={'pc'} />
+                    <SourceWrap components={customComponents} />
                   </Panel> : null}
                   <Panel header={'椤甸潰鑳屾櫙'} key="background">
                     {config ? <BgController config={config} updateConfig={this.updateConfig} /> : null}

--
Gitblit v1.8.0