king
2020-06-08 46fa548514ba2a438908586e2b54ed742777e9b0
2020-06-08
21个文件已修改
1个文件已添加
385 ■■■■■ 已修改文件
package-lock.json 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/mainsubtable.jpg 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/normaltable.jpg 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/treepage.jpg 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/mobimg/mklogo.png 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/login/index.jsx 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/login/index.scss 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/menuconfig/editthdmenu/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/cardcomponent/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/chartcomponent/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/chartgroupcomponent/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/columncomponent/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/fieldscomponent/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/searchcomponent/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/settingform/index.jsx 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/tabscomponent/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mobile/index.jsx 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mobile/index.scss 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package-lock.json
@@ -2282,7 +2282,7 @@
        "rc-drawer": "2.0.9",
        "rc-dropdown": "2.4.1",
        "rc-editor-mention": "1.1.13",
        "rc-form": "2.4.8",
        "rc-form": "2.4.11",
        "rc-input-number": "4.5.0",
        "rc-mentions": "0.4.0",
        "rc-menu": "7.4.28",
@@ -13500,9 +13500,9 @@
      }
    },
    "rc-form": {
      "version": "2.4.8",
      "resolved": "https://registry.npmjs.org/rc-form/-/rc-form-2.4.8.tgz",
      "integrity": "sha512-hlHajcYg51pFQf+B6neAbhy2ZA+8DmxnDxiOYZRAXCLhPN788ZnrtZq5/iADDWcZqjHFnXiThoZE/Fu8syciDQ==",
      "version": "2.4.11",
      "resolved": "https://registry.npmjs.org/rc-form/-/rc-form-2.4.11.tgz",
      "integrity": "sha512-8BL+FNlFLTOY/A5X6tU35GQJLSIpsmqpwn/tFAYQTczXc4dMJ33ggtH248Cum8+LS0jLTsJKG2L4Qp+1CkY+sA==",
      "requires": {
        "async-validator": "1.11.5",
        "babel-runtime": "6.26.0",
@@ -13510,7 +13510,27 @@
        "dom-scroll-into-view": "1.2.1",
        "hoist-non-react-statics": "3.3.0",
        "lodash": "4.17.15",
        "rc-util": "4.21.1",
        "warning": "4.0.3"
      },
      "dependencies": {
        "rc-util": {
          "version": "4.21.1",
          "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-4.21.1.tgz",
          "integrity": "sha512-Z+vlkSQVc1l8O2UjR3WQ+XdWlhj5q9BMQNLk2iOBch75CqPfrJyGtcWMcnhRlNuDu0Ndtt4kLVO8JI8BrABobg==",
          "requires": {
            "add-dom-event-listener": "1.1.0",
            "prop-types": "15.7.2",
            "react-is": "16.13.1",
            "react-lifecycles-compat": "3.0.4",
            "shallowequal": "1.1.0"
          }
        },
        "react-is": {
          "version": "16.13.1",
          "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
          "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
        }
      }
    },
    "rc-gesture": {
package.json
@@ -60,6 +60,7 @@
    "postcss-preset-env": "6.7.0",
    "postcss-safe-parser": "4.0.1",
    "prop-types": "^15.7.2",
    "rc-form": "^2.4.11",
    "react": "^16.9.0",
    "react-app-polyfill": "^1.0.2",
    "react-codemirror2": "^7.1.0",
src/assets/img/mainsubtable.jpg

src/assets/img/normaltable.jpg

src/assets/img/treepage.jpg

src/assets/mobimg/mklogo.png
src/components/header/index.jsx
@@ -678,7 +678,7 @@
        {this.props.editLevel === 'level4' ? <Button className="level4-close" type="primary" onClick={this.exitManage}>退出</Button> : null}
        {/* 进入编辑按钮 */}
        {this.props.editState && !this.props.editLevel ? <Icon onClick={this.enterEdit} className="edit-check" type="edit" /> : null}
        {/* {this.props.editState && !this.props.editLevel ? <a href="#/mobile" target="blank" className="mobile" type="edit"> 移动端 <Icon type="arrow-right" /></a> : null} */}
        {this.props.editState && !this.props.editLevel ? <a href="#/mobile" target="_blank" className="mobile" type="edit"> 移动端 <Icon type="arrow-right" /></a> : null}
        {/* 编辑菜单 */}
        {this.props.editLevel === 'level1' ? <EditMenu menulist={this.state.menulist} reload={this.reload} exitEdit={this.exitEdit}/> : null}
        {/* 头像、用户名 */}
src/mob/login/index.jsx
@@ -1,11 +1,25 @@
import React, {Component} from 'react'
// import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
// import { Flex, WhiteSpace, Tabs } from 'antd-mobile'
// import { is, fromJS } from 'immutable'
import { InputItem, Icon, Checkbox, Picker, List, Button } from 'antd-mobile'
import { createForm } from 'rc-form'
import zhCN from '@/locales/zh-CN/mob.js'
import enUS from '@/locales/en-US/mob.js'
import mklogo from '@/assets/mobimg/mklogo.png'
import './index.scss'
const CheckboxItem = Checkbox.CheckboxItem
const langs = [
  {
    label: 'zh-CN',
    value: '中文简体',
  },
  {
    label: 'en-US',
    value: 'English',
  }
]
class MobLogin extends Component {
  // static propTpyes = {
@@ -13,20 +27,73 @@
  // }
  state = {
    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    lang: ['zh-CN'],
    rember: true,
    param: {
      background: {color: '#000000', image: ''},
      logo: {width: ''}
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
  onChange = () => {
    const { rember } = this.state
    this.setState({
      rember: !rember
    })
  }
  onChangeLang = (value) => {
    this.setState({
      lang: value
    })
  }
  render () {
    const { getFieldProps } = this.props.form
    const { lang, rember } = this.state
    return (
      <div className="mob-login">
        <div className="logo" style={{marginTop: `calc(17vh - 10px)`}}>
          <img src={mklogo} alt=""/>
        </div>
        <div className="plat-name">明科商业智能开放平台</div>
        <InputItem
          placeholder="UserName"
          prefixListCls="mk-login-item am-list"
          {...getFieldProps('userName', {
            initialValue: '8888',
          })}
        >
          <Icon type="check-circle-o" />
        </InputItem>
        <InputItem
          placeholder="Password"
          prefixListCls="mk-login-item am-list"
          {...getFieldProps('password', {
            initialValue: '8888',
          })}
          type={'password'}
        >
          <Icon type="check-circle-o" />
        </InputItem>
        <div className="other-setting">
          <CheckboxItem checked={rember} onChange={this.onChange}>
            <span onClick={this.onChange}>记住密码</span>
          </CheckboxItem>
          <Picker data={langs} value={lang} cols={1} onChange={this.onChangeLang} className="forss">
            <List.Item>{lang}</List.Item>
          </Picker>
          <div className="clear-both"></div>
        </div>
        <Button type="primary">登录</Button>
        <div className="company-msg">
          <p>Copyright©2017  所有相关版权归  北京明科普华信息技术有限公司</p>
        </div>
      </div>
    )
  }
}
export default MobLogin
export default createForm()(MobLogin)
src/mob/login/index.scss
@@ -1,6 +1,123 @@
.mob-login {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(#378DBE, #46C29E, #48A9D6);
  .logo {
    max-width: 280px;
    margin: 0 auto;
    margin-top: calc(15vh);
    text-align: center;
    img {
      max-width: 100%;
    }
  }
  .plat-name {
    max-width: 280px;
    margin: 0 auto;
    margin-top: 15px;
    margin-bottom: 30px;
    text-align: center;
    font-size: 20px;
    color: #ffffff;
    font-weight: bold;
  }
  .mk-login-item.am-list-item {
    width: 245px;
    max-width: 270px;
    margin: 0 auto;
    margin-bottom: 10px;
    border-radius: 30px;
    background-color: rgba(255, 255, 255, 0.3);
    .am-input-label {
      width: 30px;
      color: #ffffff;
      padding-top: 10px;
    }
    input {
      color: #fafafa;
    }
    input::-webkit-input-placeholder {
      color: #ffffff;
    }
    input:-moz-placeholder {
      color: #ffffff;
    }
    input::-moz-placeholder {
      color: #ffffff;
    }
    input:-ms-input-placeholder {
      color: #ffffff;
    }
  }
  .am-list-item:not(:last-child) .am-list-line {
    border: none;
  }
  .other-setting {
    width: 245px;
    max-width: 270px;
    margin: 0 auto;
    margin-bottom: 10px;
    .am-list-item {
      float: left;
      background: transparent;
      width: 50%;
      padding: 0;
      .am-list-thumb:first-child {
        margin-right: 5px;
        .am-checkbox-inner {
          width: 18px;
          height: 18px;
        }
        .am-checkbox-inner:after {
          width: 5px;
          height: 9px;
        }
      }
      .am-list-line .am-list-content {
        font-size: 14px;
        color: #fafafa;
      }
      .am-list-extra {
        display: none;
      }
    }
    > div:not(.am-list-item) {
      float: right;
      background: transparent;
      padding: 0;
      .am-list-item {
        width: 100%;
      }
    }
  }
  >.am-button {
    width: 245px;
    max-width: 270px;
    margin: 0 auto;
    border-radius: 30px;
  }
  .company-msg {
    position: absolute;
    width: 100%;
    bottom: 20px;
    padding: 0 20px;
    font-size: 12px;
    color: #fafafa;
    text-align: center;
  }
}
.am-picker-popup-wrap {
  left: calc(50vw - 305px);
  right: calc(50vw - 45px);
  bottom: 54px;
  overflow: hidden;
}
.clear-both {
  float: none!important;
  clear: both;
}
src/templates/menuconfig/editthdmenu/index.jsx
@@ -10,7 +10,8 @@
import { sysTemps } from '@/utils/option.js'
import zhCN from '@/locales/zh-CN/header.js'
import enUS from '@/locales/en-US/header.js'
import nortable from '@/assets/img/normaltable.jpg'
import mainsubtable from '@/assets/img/mainsubtable.jpg'
import treepage from '@/assets/img/treepage.jpg'
import Preview from './preview'
import MenuForm from './menuform'
@@ -37,7 +38,8 @@
const { Search } = Input
const illust = { // 模板图片,用于已使用模板
  CommonTable: nortable
  CommonTable: mainsubtable,
  TreePage: treepage
}
class EditMenu extends Component {
src/templates/sharecomponent/actioncomponent/index.jsx
@@ -843,6 +843,10 @@
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
  }
  /**
   * @description 组件销毁,清除state更新
   */
src/templates/sharecomponent/cardcomponent/index.jsx
@@ -29,8 +29,8 @@
    cardcell: null   // 卡片元素
  }
  componentDidMount () {
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
  }
  UNSAFE_componentWillReceiveProps (nextProps) {
src/templates/sharecomponent/chartcomponent/index.jsx
@@ -601,9 +601,13 @@
    this.props.plotchange({...config, charts: _charts})
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
  }
  render() {
    const { plot } = this.props
    console.log(plot)
    return (
      <div className="line-chart-edit-box" style={{minHeight: plot.height ? plot.height + 50 : 450}}>
        {plot.title ? <p className="chart-title">{plot.title}</p> : null}
src/templates/sharecomponent/chartgroupcomponent/index.jsx
@@ -228,6 +228,10 @@
    this.props.updatechartgroup(config, id)
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
  }
  /**
   * @description 组件销毁,清除state更新
   */
src/templates/sharecomponent/columncomponent/index.jsx
@@ -429,6 +429,10 @@
    })
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
  }
  /**
   * @description 组件销毁,清除state更新
   */
src/templates/sharecomponent/fieldscomponent/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { is, fromJS } from 'immutable'
import { Button, Modal, Empty, notification } from 'antd'
import Utils from '@/utils/utils.js'
@@ -204,6 +204,10 @@
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
  }
  /**
   * @description 组件销毁,清除state更新
   */
src/templates/sharecomponent/searchcomponent/index.jsx
@@ -271,6 +271,10 @@
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState))
  }
  render() {
    const { dict, searchlist, visible, sqlVerifing, card } = this.state
src/templates/sharecomponent/settingcomponent/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { is, fromJS } from 'immutable'
import { Icon, Modal, Button, notification } from 'antd'
import Utils from '@/utils/utils.js'
@@ -160,6 +160,10 @@
    })
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState))
  }
  /**
   * @description 组件销毁,清除state更新
   */
src/templates/sharecomponent/settingcomponent/settingform/index.jsx
@@ -210,6 +210,37 @@
              reject()
              return
            } else if (values.interType === 'inner' && !values.innerFunc && values.default !== 'false' && values.dataresource) {
              let _quot = values.dataresource.match(/'{1}/g)
              let _lparen = values.dataresource.match(/\({1}/g)
              let _rparen = values.dataresource.match(/\){1}/g)
              _quot = _quot ? _quot.length : 0
              _lparen = _lparen ? _lparen.length : 0
              _rparen = _rparen ? _rparen.length : 0
              if (_quot % 2 !== 0) {
                notification.warning({
                  top: 92,
                  message: '数据源中\'必须成对出现',
                  duration: 5
                })
                return
              } else if (_lparen !== _rparen) {
                notification.warning({
                  top: 92,
                  message: '数据源中()必须成对出现',
                  duration: 5
                })
                return
              } else if (/--/ig.test(values.dataresource)) {
                notification.warning({
                  top: 92,
                  message: '数据源中,不可出现字符 -- ,注释请用 /*内容*/',
                  duration: 5
                })
                return
              }
              let error = Utils.verifySql(values.dataresource)
  
              if (error) {
src/templates/sharecomponent/tabscomponent/index.jsx
@@ -376,6 +376,10 @@
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState))
  }
  /**
   * @description 组件销毁,清除state更新
   */
src/views/mobile/index.jsx
@@ -11,11 +11,18 @@
const Header = asyncComponent(() => import('@/mob/header'))
const Home = asyncComponent(() => import('@/mob/home'))
// const Login = asyncComponent(() => import('@/mob/login'))
const Login = asyncComponent(() => import('@/mob/login'))
class Mobile extends Component {
  state = {
    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    view: null
  }
  UNSAFE_componentWillMount() {
    this.setState({
      view: {uuid: 'login', type: 'login', parentId: null, parentType: null}
    })
  }
  /**
@@ -28,17 +35,26 @@
  }
  render () {
    const { view } = this.state
    return (
      <div className="mobile-view">
        <Header />
        <div className="mob-body">
          <div className="mob-tool">
            <div className="mob-tool-item"><Icon type="plus-circle" />添 加 内 容</div>
            <div className="mob-tool-content">
              <div className="plus-content">
                <Icon type="plus-circle" />添 加 内 容
              </div>
              <div className="useable-component"></div>
            </div>
            <div className="mob-tool-other"></div>
          </div>
          <div className="mob-shell">
            <div className="mob-shell-inner">
              <Home />
            </div>
            {view ? <div className="mob-shell-inner">
              {view.type === 'login' ? <Login /> : null}
              {view.type === 'home' ? <Home /> : null}
            </div> : null}
          </div>
          <div className="mob-setting">
          </div>
src/views/mobile/index.scss
@@ -16,19 +16,48 @@
      width: 40px;
      background: #262626;
      box-shadow: 2px 0px 2px #000;
      .mob-tool-item {
        color: #ffffff;
      .mob-tool-content {
        width: 100%;
        display: flex;
        align-items: center;
        writing-mode: tb-rl;
        padding: 16px 0;
        border-bottom: 1px solid #000;
        cursor: pointer;
        i {
          margin-bottom: 5px;
          margin-left: 2px;
        .plus-content {
          position: relative;
          color: #ffffff;
          width: 100%;
          display: flex;
          align-items: center;
          writing-mode: tb-rl;
          padding: 16px 0;
          border-bottom: 1px solid #000;
          cursor: pointer;
          z-index: 10;
          background: #262626;
          i {
            margin-bottom: 5px;
            margin-left: 2px;
          }
        }
        .useable-component {
          position: absolute;
          width: 300px;
          top: 0;
          bottom: 0;
          left: -340px;
          background: #fff;
          opacity: 0;
          transition: left 0.3s, opacity 0.3s;
        }
      }
      .mob-tool-content:hover {
        .useable-component {
          opacity: 1;
          left: 40px;
        }
      }
      .mob-tool-other {
        position: relative;
        z-index: 10;
        height: 1000px;
        background: #262626;
      }
    }