king
2023-08-31 3a675efd3a8883f23208cefd39e0e871bf57a70b
2023-08-31
12个文件已修改
4个文件已添加
474 ■■■■ 已修改文件
src/menu/components/card/balcony/options.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/data-card/options.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/double-data-card/options.jsx 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/settingform/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/process/index.jsx 136 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/process/index.scss 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/process/settingform/index.jsx 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/process/settingform/index.scss 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils-datamanage.js 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/billprint/index.jsx 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/menudesign/index.jsx 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mobdesign/index.jsx 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pcdesign/index.jsx 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tabledesign/index.jsx 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/balcony/options.jsx
@@ -6,7 +6,7 @@
 */
export default function (wrap, buttons, columns) {
  let menu = window.GLOB.customMenu
  let MenuType = menu.parentId === 'BillPrintTemp' ? 'billPrint' : ''
  let MenuType = sessionStorage.getItem('MenuType') || 'custom'
  let modules = MenuUtils.getLinkModules(menu.components) || []
  let supmodules = MenuUtils.getSupModules(menu.components, '', menu.interfaces)
src/menu/components/card/data-card/options.jsx
@@ -5,7 +5,7 @@
 */
export default function (wrap, subtype, columns = [], id = '', supNodes = [], setting, buttons = []) {
  let appType = sessionStorage.getItem('appType')
  let MenuType = ''
  let MenuType = sessionStorage.getItem('MenuType') || 'custom'
  let menu = window.GLOB.customMenu
  let laypage = setting && setting.laypage !== 'false'
  let interfaces = []
@@ -18,10 +18,6 @@
        })
      }
    })
  }
  if (menu.parentId === 'BillPrintTemp') {
    MenuType = 'billPrint'
  }
  let modules = []
  if (subtype === 'propcard' || subtype === 'datacard') {
src/menu/components/card/double-data-card/options.jsx
@@ -3,14 +3,7 @@
 */
export default function (wrap, columns = [], setting) {
  let appType = sessionStorage.getItem('appType')
  // let MenuType = ''
  // let menu = window.GLOB.customMenu
  let laypage = setting && setting.laypage !== 'false'
  // if (menu.parentId === 'BillPrintTemp') {
  //   MenuType = 'billPrint'
  // }
  let roleList = sessionStorage.getItem('sysRoles')
  if (roleList) {
@@ -156,15 +149,6 @@
        {value: 'true', label: '有'},
      ],
    },
    // {
    //   type: 'number',
    //   field: 'printHeight',
    //   label: '换算高度',
    //   initval: wrap.printHeight || '',
    //   tooltip: '当前数据卡高度相当于几条数据。',
    //   required: false,
    //   forbid: MenuType !== 'billPrint'
    // },
    {
      type: 'radio',
      field: 'empty',
src/menu/datasource/index.jsx
@@ -147,6 +147,12 @@
    this.setState({loading: true})
    this.verifyRef.submitDataSource().then(res => {
      let MenuType = sessionStorage.getItem('MenuType')
      if (MenuType === 'billPrint') {
        res.setting.supModule = ['empty']
      }
      if (res.columns) {
        res.columns = res.columns.map(item => {
    
src/menu/datasource/verifycard/settingform/index.jsx
@@ -27,7 +27,7 @@
    modules: [],
    innerRules: [],
    innertip: '',
    MenuType: '',
    MenuType: sessionStorage.getItem('MenuType') || '',
    ismain: false
  }
@@ -35,12 +35,6 @@
    const { config, setting } = this.props
    let menu = window.GLOB.customMenu
    let MenuType = ''
    if (menu.parentId === 'BillPrintTemp') {
      MenuType = 'billPrint'
    }
    let modules = MenuUtils.getSupModules(menu.components, config.uuid, menu.interfaces)
    let ismain = false
@@ -90,7 +84,7 @@
      }
    }
    this.setState({modules, innerRules, innertip, setting: _setting, ismain, MenuType})
    this.setState({modules, innerRules, innertip, setting: _setting, ismain})
  }
  handleConfirm = () => {
src/menu/process/index.jsx
New file
@@ -0,0 +1,136 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Modal, Tooltip, notification } from 'antd'
import { QuestionCircleOutlined, PlusOutlined, CloseOutlined } from '@ant-design/icons'
import SettingForm from './settingform'
import './index.scss'
const { confirm } = Modal
class ProcessComponent extends Component {
  static propTpyes = {
    config: PropTypes.any,
    updateConfig: PropTypes.func
  }
  state = {
    visible: false,
    urlFields: this.props.config.urlFields || []
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState))
  }
  editDataSource = () => {
    this.setState({
      visible: true
    })
  }
  verifySubmit = () => {
    const { urlFields } = this.state
    const { config } = this.props
    this.verifyRef.handleConfirm().then(res => {
      if (urlFields.filter(field => field === res.field).length > 0) {
        notification.warning({
          top: 92,
          message: '字段已存在!',
          duration: 5
        })
        return
      }
      let _urlFields = [...urlFields, res.field]
      this.setState({
        visible: false,
        urlFields: _urlFields
      })
      if (window.GLOB.urlFields) {
        window.GLOB.urlFields = _urlFields
      }
      this.props.updateConfig({...config, urlFields: _urlFields})
    })
  }
  deleteField = (field) => {
    let config = JSON.stringify(this.props.config)
    const _this = this
    if (new RegExp(field, 'ig').test(config)) {
      confirm({
        title: `配置中存在@${field}@,确定删除吗?`,
        content: '',
        onOk() {
          _this.execDelete(field)
        },
        onCancel() {}
      })
    } else {
      this.execDelete(field)
    }
  }
  execDelete = (_field) => {
    const { config } = this.props
    let _urlFields = this.state.urlFields.filter(field => field !== _field)
    this.setState({
      urlFields: _urlFields
    })
    if (window.GLOB.urlFields) {
      window.GLOB.urlFields = _urlFields
    }
    this.props.updateConfig({...config, urlFields: _urlFields})
  }
  render () {
    const { visible, urlFields } = this.state
    return (
      <div className="url-field-component">
        <div className="field-plus">
          <Tooltip placement="topLeft" title="页面可接收的参数字段,在查询数据源或自定义脚本中使用 @字段@ 接收。">
            <QuestionCircleOutlined className="mk-form-tip" />
            url变量
          </Tooltip>
          <PlusOutlined title="添加" onClick={() => this.editDataSource()} />
        </div>
        <div>
          {urlFields.map((field, index) => {
            return (
              <div className="field-item" key={index}>
                <CloseOutlined title="删除" onClick={() => this.deleteField(field)} />
                {field}
              </div>
            )
          })}
        </div>
        <Modal
          title="字段添加"
          visible={visible}
          width={500}
          maskClosable={false}
          onOk={this.verifySubmit}
          onCancel={() => { this.setState({ visible: false }) }}
          destroyOnClose
        >
          <SettingForm
            inputSubmit={this.verifySubmit}
            wrappedComponentRef={(inst) => this.verifyRef = inst}
          />
        </Modal>
      </div>
    )
  }
}
export default ProcessComponent
src/menu/process/index.scss
New file
@@ -0,0 +1,25 @@
.url-field-component {
  margin-bottom: 15px;
  .field-plus {
    line-height: 35px;
    padding-left: 16px;
    >.anticon-plus {
      color: #26C281;
      padding: 2px 5px;
      margin-left: 5px;
    }
  }
  .field-item {
    position: relative;
    border: 1px solid #e8e8e8;
    padding: 5px 10px;
    border-radius: 4px;
    >.anticon-close {
      position: absolute;
      right: 5px;
      top: 3px;
      font-size: 13px;
    }
  }
}
src/menu/process/settingform/index.jsx
New file
@@ -0,0 +1,82 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Input } from 'antd'
// import './index.scss'
class SettingForm extends Component {
  static propTpyes = {
    inputSubmit: PropTypes.func  // 回车事件
  }
  handleConfirm = () => {
    // 表单提交时检查输入值是否正确
    return new Promise((resolve, reject) => {
      this.props.form.validateFieldsAndScroll((err, values) => {
        if (!err) {
          resolve(values)
        } else {
          reject(err)
        }
      })
    })
  }
  handleSubmit = (e) => {
    e.preventDefault()
    if (this.props.inputSubmit) {
      this.props.inputSubmit()
    }
  }
  componentDidMount() {
    try {
      let _input = document.getElementById('field')
      if (_input.focus) {
        _input.focus()
      }
    } catch (e) {
      console.warn('focus error!')
    }
  }
  render() {
    const { getFieldDecorator } = this.props.form
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
        sm: { span: 8 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 14 }
      }
    }
    return (
      <div className="url-field-form">
        <Form {...formItemLayout}>
          <Form.Item label="字段名">
            {getFieldDecorator('field', {
              initialValue: '',
              rules: [
                {
                  required: true,
                  message: '请输入字段名!'
                },
                {
                  pattern: /^[a-zA-Z0-9_]*$/ig,
                  message: '字段可使用英文、数字或_'
                }
              ]
            })(<Input placeholder={''} autoComplete="off" onPressEnter={this.handleSubmit} />)}
          </Form.Item>
        </Form>
      </div>
    )
  }
}
export default Form.create()(SettingForm)
src/menu/process/settingform/index.scss
src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx
@@ -463,7 +463,7 @@
        fields.push(
          <Col span={24} key={index}>
            <Form.Item label={item.label}>
              <ColorSketch defaultValue={item.initval} onChange={(value) => this.change(value, item.field)}/>
              <ColorSketch config={{initval: item.initval}} onChange={(value) => this.change(value, item.field)}/>
            </Form.Item>
          </Col>
        )
src/utils/utils-datamanage.js
@@ -445,13 +445,6 @@
    _customScript = _customScript.replace(item.reg, item.value)
  })
  // _dataresource = _dataresource.replace(/@select\$|\$select@/ig, '')
  // _customScript = _customScript.replace(/@select\$|\$select@/ig, '')
  // _dataresource = _dataresource.replace(/\$sum@/ig, '/*')
  // _dataresource = _dataresource.replace(/@sum\$/ig, '*/')
  // _customScript = _customScript.replace(/\$sum@/ig, '/*')
  // _customScript = _customScript.replace(/@sum\$/ig, '*/')
  let _search = ''
  if (setting.queryType !== 'statistics' && _dataresource) {
    _search = Utils.joinMainSearchkey(searchlist)
@@ -494,8 +487,7 @@
    primaryKey: setting.primaryKey || '',
    foreign_key: '',
    sql: _dataresource,
    script: _customScript,
    // transaction: setting.transaction === 'true'
    script: _customScript
  }
}
src/views/billprint/index.jsx
@@ -719,16 +719,11 @@
      _dataresource = `select top 1000 ${setting.arr_field} from ${_dataresource} `
    }
    // 测试系统打印查询语句
    if (window.GLOB.debugger === true) {
      _customScript &&  console.info(`${_dataresource ? '' : '/*不执行默认sql*/\n'}${_customScript}`)
      _dataresource &&  console.info(_dataresource)
    }
    return {
      name: dataName,
      columns: columns,
      par_tablename: '',
      order: setting.order || '',
      type: format === 'array' ? format : '',
      primaryKey: setting.primaryKey || '',
      foreign_key: '',
@@ -755,6 +750,18 @@
    let district = sessionStorage.getItem('district') || ''
    let address = sessionStorage.getItem('address') || ''
    let regoptions = [
      { reg: /@pageSize@/ig, value: 9999 },
      { reg: /@pageIndex@/ig, value: 1},
      { reg: /@ID@/ig, value: `''`},
      { reg: /@BID@/ig, value: `'${BID || ''}'`},
      { reg: /@LoginUID@/ig, value: `'${sessionStorage.getItem('LoginUID') || ''}'`},
      { reg: /@SessionUid@/ig, value: `'${localStorage.getItem('SessionUid') || ''}'`},
      { reg: /@UserID@/ig, value: `'${sessionStorage.getItem('UserID') || ''}'`},
      { reg: /@Appkey@/ig, value: `'${window.GLOB.appkey || ''}'`},
      { reg: /@typename@/ig, value: `'admin'`},
    ]
    let LText = params.map((item, index) => {
      let _sql = item.sql
      let _script = item.script
@@ -766,6 +773,20 @@
        `
      }
      _sql = _sql.replace(/@orderBy@/ig, item.order)
      _script = _script.replace(/@orderBy@/ig, item.order)
      regoptions.forEach(cell => {
        _sql = _sql.replace(cell.reg, cell.value)
        _script = _script.replace(cell.reg, cell.value)
      })
      // 测试系统打印查询语句
      if (window.GLOB.debugger === true) {
        _script && console.info(`${_sql ? '' : '/*不执行默认sql*/\n'}${_script}`)
        _sql &&  console.info(_sql)
      }
      item.columns.forEach(cell => {
        LText_field.push(`Select '${item.name}' as tablename,'${cell.field}' as fieldname,'${cell.datatype}' as field_type`)
      })
src/views/menudesign/index.jsx
@@ -95,6 +95,8 @@
    try {
      let param = JSON.parse(window.decodeURIComponent(window.atob(this.props.match.params.param)))
      sessionStorage.setItem('MenuType', param.MenuType || 'custom')
      this.setState({
        MenuType: param.MenuType,
        MenuId: param.MenuId || param.MenuID,
@@ -1115,31 +1117,32 @@
                <Collapse accordion defaultActiveKey="basedata" bordered={false}>
                  {/* 基本信息 */}
                  <Panel header="基本信息" key="basedata">
                    {/* 菜单信息 */}
                    {config && MenuType === 'custom' ? <MenuForm
                      config={config}
                      MenuId={MenuId}
                      parentId={ParentId}
                      MenuName={config.MenuName}
                      MenuNo={config.MenuNo}
                      updateConfig={this.updateConfig}
                    /> : null}
                    {config && MenuType === 'home' ? <HomeForm
                      config={config}
                      updateConfig={this.updateConfig}
                    /> : null}
                    {config && MenuType === 'billPrint' ? <PrintMenuForm
                      config={config}
                      updateConfig={this.updateConfig}
                    /> : null}
                    {config ? <UrlFieldComponent
                      config={config}
                      updateConfig={this.updateConfig}
                    /> : null}
                    {/* 表名添加 */}
                    {config ? <TableComponent config={config} updatetable={this.updateConfig}/> : null}
                    {config ? <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> : null}
                    {config ? <NormalCss config={config} updateConfig={this.updateConfig}/> : null}
                    {config ? <>
                      {MenuType === 'custom' ? <MenuForm
                        config={config}
                        MenuId={MenuId}
                        parentId={ParentId}
                        MenuName={config.MenuName}
                        MenuNo={config.MenuNo}
                        updateConfig={this.updateConfig}
                      /> : null}
                      {MenuType === 'home' ? <HomeForm
                        config={config}
                        updateConfig={this.updateConfig}
                      /> : null}
                      {MenuType === 'billPrint' ? <PrintMenuForm
                        config={config}
                        updateConfig={this.updateConfig}
                      /> : null}
                      <UrlFieldComponent
                        config={config}
                        updateConfig={this.updateConfig}
                      />
                      {/* 表名添加 */}
                      <TableComponent config={config} updatetable={this.updateConfig}/>
                      <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph>
                      <NormalCss config={config} updateConfig={this.updateConfig}/>
                    </> : null}
                  </Panel>
                  {/* 组件添加 */}
                  <Panel header="组件" key="component">
src/views/mobdesign/index.jsx
@@ -2070,24 +2070,25 @@
                <Collapse accordion activeKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}>
                  {/* 基本信息 */}
                  <Panel header="基本信息" forceRender className="basedata" key="basedata">
                    {/* 菜单信息 */}
                    {config ? <MenuForm
                      config={config}
                      MenuId={MenuId}
                      adapters={adapters}
                      updateConfig={(con) => {
                        this.updateConfig(con)
                        if (con.direction !== config.direction) {
                          this.changeView(con.direction)
                        }
                      }}
                    /> : null}
                    {config ? <UrlFieldComponent config={config} updateConfig={this.updateConfig}/> : null}
                    {/* 表名添加 */}
                    {config ? <TableComponent config={config} updatetable={this.updateConfig}/> : null}
                    {config ? <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> : null}
                    {config ? <Paragraph style={{padding: '10px 0px 0px 18px'}} copyable={{ text:  `${window.GLOB.baseurl}mob/index.html#/index/${sessionStorage.getItem('kei_no')}/${sessionStorage.getItem('typename')}/${sessionStorage.getItem('lang')}/${MenuId}/@BID@` }}>菜单链接</Paragraph> : null}
                    {config ? <NormalCss config={config} updateConfig={this.updateConfig}/> : null}
                    {config ? <>
                      <MenuForm
                        config={config}
                        MenuId={MenuId}
                        adapters={adapters}
                        updateConfig={(con) => {
                          this.updateConfig(con)
                          if (con.direction !== config.direction) {
                            this.changeView(con.direction)
                          }
                        }}
                      />
                      <UrlFieldComponent config={config} updateConfig={this.updateConfig}/>
                      {/* 表名添加 */}
                      <TableComponent config={config} updatetable={this.updateConfig}/>
                      <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph>
                      <Paragraph style={{padding: '10px 0px 0px 18px'}} copyable={{ text:  `${window.GLOB.baseurl}mob/index.html#/index/${sessionStorage.getItem('kei_no')}/${sessionStorage.getItem('typename')}/${sessionStorage.getItem('lang')}/${MenuId}/@BID@` }}>菜单链接</Paragraph>
                      <NormalCss config={config} updateConfig={this.updateConfig}/>
                    </> : null}
                  </Panel>
                  {/* 组件添加 */}
                  <Panel header="组件" className="component" key="component">
src/views/pcdesign/index.jsx
@@ -1689,17 +1689,18 @@
                <Collapse accordion activeKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}>
                  {/* 基本信息 */}
                  <Panel header="基本信息" key="basedata">
                    {/* 菜单信息 */}
                    {config ? <MenuForm
                      config={config}
                      MenuId={MenuId}
                      updateConfig={this.updateConfig}
                    /> : null}
                    {config ? <UrlFieldComponent config={config} updateConfig={this.updateConfig}/> : null}
                    {/* 表名添加 */}
                    {config ? <TableComponent config={config} updatetable={this.updateConfig}/> : null}
                    {config ? <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> : null}
                    {config ? <NormalCss config={config} updateConfig={this.updateConfig}/> : null}
                    {config ? <>
                      <MenuForm
                        config={config}
                        MenuId={MenuId}
                        updateConfig={this.updateConfig}
                      />
                      <UrlFieldComponent config={config} updateConfig={this.updateConfig}/>
                      {/* 表名添加 */}
                      <TableComponent config={config} updatetable={this.updateConfig}/>
                      <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph>
                      <NormalCss config={config} updateConfig={this.updateConfig}/>
                    </> : null}
                  </Panel>
                  {/* 组件添加 */}
                  <Panel header="组件" key="component">
src/views/tabledesign/index.jsx
@@ -831,22 +831,23 @@
                <Collapse accordion activeKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}>
                  {/* 基本信息 */}
                  <Panel header="基本信息" key="basedata">
                    {/* 菜单信息 */}
                    {config ? <MenuForm
                      config={config}
                      MenuId={MenuId}
                      parentId={ParentId}
                      MenuName={config.MenuName}
                      MenuNo={config.MenuNo}
                      updateConfig={this.updateConfig}
                    /> : null}
                    {config ? <UrlFieldComponent
                      config={config}
                      updateConfig={this.updateConfig}
                    /> : null}
                    {/* 表名添加 */}
                    {config ? <TableComponent config={config} updatetable={this.updateConfig}/> : null}
                    {config ? <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> : null}
                    {config ? <>
                      <MenuForm
                        config={config}
                        MenuId={MenuId}
                        parentId={ParentId}
                        MenuName={config.MenuName}
                        MenuNo={config.MenuNo}
                        updateConfig={this.updateConfig}
                      />
                      <UrlFieldComponent
                        config={config}
                        updateConfig={this.updateConfig}
                      />
                      {/* 表名添加 */}
                      <TableComponent config={config} updatetable={this.updateConfig}/>
                      <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph>
                    </> : null}
                  </Panel>
                  <Panel header="搜索" key="search">
                    {Source.searchItems.map((item, index) => (<SourceElement key={index} content={item}/>))}