king
2023-09-18 b58d2d0277eecbae9348d633e7dc805771962024
2023-09-18
15个文件已修改
2个文件已添加
340 ■■■■ 已修改文件
src/menu/components/share/pastebasetable/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/debug/index.jsx 203 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/debug/index.scss 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/header/index.jsx 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/header/index.scss 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/pastecontroller/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/picturecontroller/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/replaceField/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/sysinterface/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/tablenodes/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/versions/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/unattended/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/menudesign/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/menudesign/index.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mobdesign/index.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tabledesign/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tabledesign/index.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/pastebasetable/index.jsx
@@ -95,7 +95,7 @@
    const { visible } = this.state
    return (
      <div style={{display: 'inline-block'}}>
      <>
        {type === 'page' ? <Button icon="snippets" style={{color: '#1890ff', borderColor: '#1890ff'}} onClick={() => {this.setState({visible: true})}} >粘贴</Button> : <SnippetsOutlined style={{color: 'purple'}} onClick={() => {this.setState({visible: true})}} />}
        <Modal
          title="粘贴"
@@ -108,7 +108,7 @@
        >
          <PasteForm wrappedComponentRef={(inst) => this.pasteFormRef = inst} inputSubmit={this.pasteSubmit}/>
        </Modal>
      </div>
      </>
    )
  }
}
src/menu/debug/index.jsx
New file
@@ -0,0 +1,203 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
// import { fromJS } from 'immutable'
import { Modal, Button } from 'antd'
// import moment from 'moment'
// import Api from '@/api'
// import Utils from '@/utils/utils.js'
import './index.scss'
class DebugSql extends Component {
  static propTpyes = {
    config: PropTypes.object
  }
  state = {
    visible: false,
    confirming: false,
  }
  trigger = () => {
    // const { config } = this.props
    // let list = []
    // let mainSearch = []
  }
  // formatSearch (config) {
  //   if (!config.search) return []
  //   let values = []
  //   config.search.forEach(item => {
  //     item.hidden = item.Hide === 'true'
  //     item.required = !item.hidden && item.required === 'true'
  //     item.advanced = item.advanced === 'true'
  //     item.$forbid = item.query === 'false'
  //     item.precision = item.precision || 'day'
  //     if (item.type === 'date') { // 时间搜索
  //       let format = 'YYYY-MM-DD'
  //       if (item.precision === 'day') {
  //       } else if (item.precision === 'hour') {
  //         format = 'YYYY-MM-DD HH'
  //       } else if (item.precision === 'minute') {
  //         format = 'YYYY-MM-DD HH:mm'
  //       } else if (item.precision === 'second') {
  //         format = 'YYYY-MM-DD HH:mm:ss'
  //       }
  //       item.initval = item.initval ? moment().subtract(item.initval, 'days').format(format) : ''
  //     } else if (item.type === 'datemonth') {
  //       item.initval = item.initval ? moment().subtract(item.initval, 'month').format('YYYY-MM') : ''
  //     } else if (item.type === 'dateweek') {
  //       item.initval = item.initval ? moment().subtract(item.initval * 7, 'days').format('YYYY-MM-DD') : ''
  //     } else if (item.type === 'daterange') {
  //       let format = 'YYYY-MM-DD'
  //       if (item.precision === 'day') {
  //       } else if (item.precision === 'hour') {
  //         format = 'YYYY-MM-DD HH'
  //       } else if (item.precision === 'minute') {
  //         format = 'YYYY-MM-DD HH:mm'
  //       } else if (item.precision === 'second') {
  //         format = 'YYYY-MM-DD HH:mm:ss'
  //       }
  //       if (item.initval === 'week') {
  //         item.initval = [moment().startOf('week').format(format), moment().endOf('week').format(format)].join(',')
  //       } else if (item.initval === 'month') {
  //         item.initval = [moment().startOf('month').format(format), moment().endOf('month').format(format)].join(',')
  //       } else if (item.initval === 'lastMonth') {
  //         item.initval = [moment().subtract(1, 'months').startOf('month').format(format), moment().subtract(1, 'months').endOf('month').format(format)].join(',')
  //       } else if (item.initval) {
  //         try {
  //           let _initval = JSON.parse(item.initval)
  //           let _vals = [moment().subtract(_initval[0], 'days').format(format), moment().subtract(_initval[1], 'days').format(format)]
  //           item.initval = _vals.join(',')
  //         } catch (e) {
  //           item.initval = ''
  //         }
  //       }
  //     } else if (item.type === 'group') {
  //       if (item.initval && item.initval[0]) {
  //         let _type = item.initval[0]
  //         let _val = item.initval[1]
  //         let _dateRange = ''
  //         if (_type === 'day') {
  //           _dateRange = [moment().subtract(_val, 'days').format('YYYY-MM-DD'),
  //             moment().subtract(_val, 'days').format('YYYY-MM-DD')]
  //         } else if (_type === 'week') {
  //           _dateRange = [moment().subtract(_val * 7, 'days').startOf('week').format('YYYY-MM-DD'),
  //             moment().subtract(_val * 7, 'days').endOf('week').format('YYYY-MM-DD')]
  //         } else if (_type === 'month') {
  //           _dateRange = [moment().subtract(_val, 'month').startOf('month').format('YYYY-MM-DD'),
  //             moment().subtract(_val, 'month').endOf('month').format('YYYY-MM-DD')]
  //         } else if (_type === 'quarter') {
  //           let _differ = parseInt(moment().format('MM')) % 3
  //           let _pdiffer = 0
  //           let _ndiffer = 0
  //           // 差值计算
  //           switch(_differ) {
  //             case 0:
  //               _pdiffer = 2
  //               _ndiffer = 0
  //               break
  //             case 1:
  //               _pdiffer = 0
  //               _ndiffer = -2
  //               break
  //             case 2:
  //               _pdiffer = 1
  //               _ndiffer = -1
  //               break
  //             default:
  //           }
  //           _dateRange = [moment().subtract(_pdiffer + _val * 3, 'month').startOf('month').format('YYYY-MM-DD'),
  //             moment().subtract(_ndiffer + _val * 3, 'month').endOf('month').format('YYYY-MM-DD')]
  //         } else if (_type === 'year') {
  //           let _year = parseInt(moment().format('YYYY')) - _val
  //           _dateRange = [_year + '-01-01', _year + '-12-31']
  //         } else if (_type === 'customized') {
  //           try {
  //             _val = JSON.parse(_val)
  //           } catch (e) {
  //             _val = [0, 0]
  //           }
  //           _dateRange = [moment().subtract(_val[0], 'days').format('YYYY-MM-DD'),
  //             moment().subtract(_val[1], 'days').format('YYYY-MM-DD')]
  //         }
  //         item.initval = _dateRange.join(',')
  //         item.initType = _type
  //       } else {
  //         item.initval = ''
  //         item.initType = ''
  //       }
  //     }
  //     item.oriInitval = item.initval
  //     if (values) {
  //       item.initval = values[item.field] || ''
  //     }
  //     if (item.blacklist && item.blacklist.length > 0 && !item.hidden) {
  //       if (item.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
  //         item.hidden = true
  //         item.required = false
  //       }
  //     }
  //     if (item.required) {
  //       required = true
  //     }
  //     if (item.type === 'text' || item.type === 'select') {
  //       if (/,/.test(item.field)) {
  //         item.field.split(',').forEach(field => {
  //           keys.push(field.toLowerCase())
  //         })
  //       } else {
  //         keys.push(item.field.toLowerCase())
  //       }
  //     } else if (item.type === 'group') {
  //       keys.push(item.field.toLowerCase())
  //       keys.push(item.datefield.toLowerCase())
  //     }
  //     return item
  //   })
  //   config.$s_keys = keys
  //   config.$s_req = required
  // }
  render() {
    const { visible, confirming } = this.state
    return (
      <>
        <Button className="mk-border-yellow" icon="bug" onClick={this.trigger}>调试</Button>
        <Modal
          title="SQL验证"
          wrapClassName="debug-modal"
          visible={visible}
          width={600}
          maskClosable={false}
          onOk={this.submit}
          onCancel={() => { this.setState({ visible: false })}}
          confirmLoading={confirming}
          destroyOnClose
        >
        </Modal>
      </>
    )
  }
}
export default DebugSql
src/menu/debug/index.scss
New file
@@ -0,0 +1,9 @@
.replace-field-modal {
  .ant-modal {
    top: 70px;
  }
  .ant-modal-body {
    min-height: 150px;
    padding-top: 40px;
  }
}
src/menu/header/index.jsx
@@ -1,5 +1,4 @@
import React, {Component} from 'react'
import { is, fromJS } from 'immutable'
import avatar from '@/assets/img/avatar.jpg'
import MainLogo from '@/assets/img/main-logo.png'
@@ -11,21 +10,19 @@
    userName: sessionStorage.getItem('CloudUserName')
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState))
  }
  render () {
    const { menuName } = this.props
    return (
      <header className="menu-header-container">
        <div className="header-logo"><img src={MainLogo} alt=""/></div>
          <div className="header-setting">
            <img src={this.state.avatar} alt=""/>
            <span>
              <span className="username">{this.state.userName}</span>
            </span>
          </div>
        <div className="menu-name">{menuName}</div>
        <div className="header-setting">
          <img src={this.state.avatar} alt=""/>
          <span>
            <span className="username">{this.state.userName}</span>
          </span>
        </div>
      </header>
    )
  }
src/menu/header/index.scss
@@ -10,7 +10,7 @@
  border-bottom: 1px solid #000;
  .header-logo {
    float: left;
    position: absolute;
    width: 180px;
    line-height: 48px;
    text-align: center;
@@ -22,8 +22,17 @@
      max-height: 40px;
    }
  }
  .menu-name {
    text-align: center;
    color: #ffffff;
    line-height: 45px;
    font-size: 16px;
    margin-left: 40px;
  }
  .header-setting {
    float: right;
    position: absolute;
    right: 0px;
    top: 0px;
    line-height: 48px;
    margin-right: 10px;
    img {
@@ -43,44 +52,6 @@
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }
  }
  >.ant-menu {
    float: left;
    width: unset;
    .ant-menu-item {
      margin-bottom: 0;
      float: left;
      width: unset;
      cursor: default;
      .anticon-arrow-left {
        height: 24px;
        cursor: pointer;
      }
      .ant-btn {
        color: #fff;
        width: unset;
        cursor: pointer;
        height: 37px;
        background: transparent;
        border: 0;
        .anticon-save {
          margin-right: 0;
        }
      }
      .ant-btn[ant-click-animating-without-extra-node="true"]::after {
        display: none!important;
      }
      .ant-btn::before {
        display: none!important;
      }
    }
    .ant-menu-item.ant-menu-item-selected {
      background-color: transparent;
    }
    .ant-menu-item:not(:last-child) {
      border-right: 1px solid #353535;
    }
  }
}
src/menu/pastecontroller/index.jsx
@@ -94,7 +94,7 @@
    const { visible } = this.state
    return (
      <div className="mk-view-paste" style={{display: 'inline-block'}}>
      <>
        <Button style={{borderColor: '#40a9ff', color: '#40a9ff'}} onClick={() => {this.setState({visible: true})}}><SnippetsOutlined />粘贴</Button>
        <Modal
          title="粘贴"
@@ -107,7 +107,7 @@
        >
          <PasteForm wrappedComponentRef={(inst) => this.pasteFormRef = inst} inputSubmit={this.pasteSubmit}/>
        </Modal>
      </div>
      </>
    )
  }
}
src/menu/picturecontroller/index.jsx
@@ -261,7 +261,7 @@
    const { visible, editvisible, card, filpictures, filvideos, piclist, vidlist, imageKey, videoKey, pageSize, picIndex, vidIndex, colorlist, iconlist } = this.state
    return (
      <div style={{display: 'inline-block'}}>
      <>
        <Button className="mk-border-purple" onClick={this.trigger}><PictureOutlined /> 资源管理</Button>
        <Modal
          wrapClassName="mk-pop-modal picture-control-model"
@@ -389,7 +389,7 @@
        >
          <EditForm card={card} wrappedComponentRef={(inst) => this.editFormRef = inst} inputSubmit={this.save}/>
        </Modal>
      </div>
      </>
    )
  }
}
src/menu/replaceField/index.jsx
@@ -636,7 +636,7 @@
    const { visible, loadingTable, tables, confirming } = this.state
    return (
      <div className="mk-replace-field" style={{display: 'inline-block'}}>
      <>
        <Button className="mk-border-yellow" icon="swap" loading={loadingTable} onClick={this.trigger}>字段替换</Button>
        <Modal
          title="字段替换"
@@ -651,7 +651,7 @@
        >
          <SettingForm tables={tables} wrappedComponentRef={(inst) => this.settingRef = inst}/>
        </Modal>
      </div>
      </>
    )
  }
}
src/menu/sysinterface/index.jsx
@@ -253,7 +253,7 @@
    const { visible, columns, interfaces } = this.state
    return (
      <div className="mk-sys-interface" style={{display: 'inline-block'}}>
      <>
        <Button className="mk-border-danger" onClick={this.trigger}><DatabaseOutlined /> 公共数据源</Button>
        <Modal
          title="公共数据源"
@@ -272,7 +272,7 @@
          <PlusOutlined key="add-interface" onClick={this.addInterface}/>
          <EditTable key="manage-interface" actions={['copy']} type="interface" data={interfaces} columns={columns} onChange={this.changeScripts}/>
        </Modal>
      </div>
      </>
    )
  }
}
src/menu/tablenodes/index.jsx
@@ -800,7 +800,7 @@
    const { visible, loading, empty } = this.state
    return (
      <div style={{display: 'inline-block'}}>
      <>
        <Button style={{borderColor: '#8E44AD', color: '#8E44AD'}} onClick={this.trigger}><ForkOutlined /> 表关系图</Button>
        <Modal
          title=""
@@ -824,7 +824,7 @@
            <span className="tip">注:点击表名(右侧)可展开/收起菜单,左侧橙色标注为接口或函数名。</span>
          </div>
        </Modal>
      </div>
      </>
    )
  }
}
src/menu/versions/index.jsx
@@ -128,7 +128,7 @@
    const { visible, preconfirming, nextconfirming } = this.state
    return (
      <div style={{display: 'inline-block'}}>
      <>
        <Button style={{borderColor: '#40a9ff', color: '#40a9ff'}} onClick={this.trigger}><CalendarOutlined /> 版本管理</Button>
        <Modal
          title=""
@@ -148,7 +148,7 @@
            <Button key="cancel" onClick={() => { this.setState({ visible: false })}}>取消</Button>
          </div>
        </Modal>
      </div>
      </>
    )
  }
}
src/templates/zshare/unattended/index.jsx
@@ -65,7 +65,7 @@
    const { visible, actions, autoMatic } = this.state
    return (
      <div style={{display: 'inline-block'}}>
      <>
        <Button className="mk-border-purple" onClick={this.trigger}><UserOutlined/> 无人值守</Button>
        <Modal
          title="无人值守"
@@ -79,7 +79,7 @@
        >
          <SettingForm actions={actions} autoMatic={autoMatic} wrappedComponentRef={(inst) => this.settingRef = inst}/>
        </Modal>
      </div>
      </>
    )
  }
}
src/views/menudesign/index.jsx
@@ -36,6 +36,7 @@
const PasteController = asyncComponent(() => import('@/menu/pastecontroller'))
const StyleController = asyncComponent(() => import('@/menu/stylecontroller'))
const ReplaceField = asyncComponent(() => import('@/menu/replaceField'))
// const Debug = asyncComponent(() => import('@/menu/debug'))
const NormalCss = asyncComponent(() => import('@/menu/normalCss'))
const Versions = asyncComponent(() => import('@/menu/versions'))
const TableNodes = asyncComponent(() => import('@/menu/tablenodes'))
@@ -1108,7 +1109,7 @@
    return (
      <ConfigProvider locale={_locale}>
        <Header />
        <Header menuName={config ? config.MenuName : ''}/>
        <DndProvider backend={HTML5Backend}>
          {view !== 'popview' ? <div className={'pc-menu-view ' + (MenuType || '')}>
            <div className="menu-body">
@@ -1159,8 +1160,9 @@
                </Collapse>
              </div>
              <div className={'menu-view' + (menuloading ? ' saving' : '') + (eyeopen ? ' eye-open' : '')}>
                <Card title={config ? config.MenuName : ''} bordered={false} extra={
                <Card bordered={false} extra={
                  <div className="mk-opeartion-list">
                    {/* <Debug config={config}/> */}
                    <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 组件名</Button>
                    <Versions MenuId={MenuId} open_edition={config ? config.open_edition : ''}/>
                    <TableNodes config={config} />
src/views/menudesign/index.scss
@@ -189,8 +189,8 @@
            button {
              margin-left: 10px;
            }
            >div >div >button, .style-control-button {
              padding: 0px 7px;
            .mk-opeartion-list button:not(.ant-switch):not(:last-child):not(:nth-last-child(2)) {
              padding: 0px 10px;
            }
            .ant-switch.big {
              min-width: 60px;
src/views/mobdesign/index.scss
@@ -323,7 +323,7 @@
    }
  }
  .menu-control {
    .back-view, .mk-view-paste, .quote-wrap, .mk-sys-interface, .set-home, .set-login, .mk-replace-field {
    .quote-wrap, .set-home, .set-login {
      display: none!important;
    }
  }
src/views/tabledesign/index.jsx
@@ -34,6 +34,7 @@
const BgController = asyncComponent(() => import('@/pc/bgcontroller'))
const StyleController = asyncComponent(() => import('@/menu/stylecontroller'))
const ReplaceField = asyncComponent(() => import('@/menu/replaceField'))
// const Debug = asyncComponent(() => import('@/menu/debug'))
const Versions = asyncComponent(() => import('@/menu/versions'))
const Transfer = asyncComponent(() => import('@/menu/transfer'))
const Unattended = asyncComponent(() => import('@/templates/zshare/unattended'))
@@ -822,7 +823,7 @@
    return (
      <ConfigProvider locale={_locale}>
        <Header />
        <Header menuName={config ? config.MenuName : ''}/>
        <DndProvider backend={HTML5Backend}>
        {view !== 'popview' ? <div className="pc-table-view">
            <div className="menu-body">
@@ -869,10 +870,9 @@
                </Collapse>
              </div>
              <div className={'menu-view' + (menuloading ? ' saving' : '')}>
                <Card title={
                  <div style={{paddingLeft: '15px'}}> {config && config.MenuName} </div>
                } bordered={false} extra={
                  <div>
                <Card bordered={false} extra={
                  <div className="mk-opeartion-list">
                    {/* {config ? <Debug config={config}/> : null} */}
                    {config ? <Transfer config={config}/> : null}
                    {config ? <Unattended config={config} updateConfig={this.updateConfig}/> : null}
                    <Versions MenuId={MenuId} open_edition={config ? config.open_edition : ''}/>
src/views/tabledesign/index.scss
@@ -148,8 +148,8 @@
            button {
              margin-left: 15px;
            }
            >div >div >button, .style-control-button {
              padding: 0px 7px;
            .mk-opeartion-list button:not(.ant-switch):not(:last-child):not(:nth-last-child(2)) {
              padding: 0px 10px;
            }
            .ant-switch.big {
              min-width: 60px;