king
2021-02-18 cd49c7caada72872817b36712db7bd9e338a081f
2021-02-18
5个文件已修改
2个文件已添加
356 ■■■■ 已修改文件
src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/callbackcustomscript/index.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/customscript/index.jsx 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mobmanage/index.jsx 124 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mobmanage/mutilform/index.jsx 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mobmanage/submutilform/index.jsx 123 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mobmanage/submutilform/index.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx
@@ -147,6 +147,25 @@
          }
        })
        if (!values.uuid) {
          if (values.position === 'init') {
            _initCustomScript += `
            /* 初始化脚本 */
            ${values.sql}
            `
          } else if (values.position === 'front') {
            _prevCustomScript += `
            /* 默认sql前脚本 */
            ${values.sql}
            `
          } else {
            _backCustomScript += `
            /* 默认sql后脚本 */
            ${values.sql}
            `
          }
        }
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
src/templates/zshare/verifycard/callbackcustomscript/index.jsx
@@ -107,6 +107,20 @@
          }
        })
        if (!values.uuid) {
          if (values.position === 'front') {
            _prevCustomScript += `
            /* 默认sql前脚本 */
            ${values.sql}
            `
          } else {
            _backCustomScript += `
            /* 默认sql后脚本 */
            ${values.sql}
            `
          }
        }
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
src/templates/zshare/verifycard/customscript/index.jsx
@@ -114,6 +114,25 @@
          }
        })
        if (!values.uuid) {
          if (values.position === 'init') {
            _initCustomScript += `
            /* 初始化脚本 */
            ${values.sql}
            `
          } else if (values.position === 'front') {
            _prevCustomScript += `
            /* 默认sql前脚本 */
            ${values.sql}
            `
          } else {
            _backCustomScript += `
            /* 默认sql后脚本 */
            ${values.sql}
            `
          }
        }
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
src/views/mobmanage/index.jsx
@@ -1,6 +1,7 @@
import React, {Component} from 'react'
// import { fromJS } from 'immutable'
import { Spin, notification, Button, Table, Modal } from 'antd'
import moment from 'moment'
import Api from '@/api'
import Utils from '@/utils/utils.js'
@@ -17,7 +18,7 @@
    appsublist: [],
    columns: [
      { title: '应用名称', dataIndex: 'remark', key: 'remark', align: 'center' },
      { title: '应用参数', dataIndex: 'kei_no', key: 'kei_no', align: 'center' },
      { title: '应用编码', dataIndex: 'kei_no', key: 'kei_no', align: 'center' },
      {
        title: 'Action',
        key: 'action',
@@ -52,7 +53,7 @@
        render: (text, record) => (
          <div>
            <Button type="link" onClick={() => this.deleteSubApp(record)} style={{color: '#ff4d4f'}}>删除</Button>
            <Button type="link" onClick={() => this.jumpMenu(record)}>编辑应用</Button>
            <Button type="link" onClick={() => this.jumpApp(record)}>编辑应用</Button>
          </div>
        )
      },
@@ -61,6 +62,8 @@
    selectSubApp: null,
    selectedRowKeys: [],
    selectedSubRowKeys: [],
    visible: false,
    subVisible: false
  }
  UNSAFE_componentWillMount() {
@@ -118,13 +121,8 @@
    console.log(record)
  }
  
  jumpMenu = (card) => {
    console.log(card)
    // let _type = 'mob'
    // if (card.type === 'pc') {
    //   _type = 'pc'
    // }
    // this.props.history.replace(`/mobdesign/${card.uuid}/${_type}/${card.keiNo}/${card.name}`)
  jumpApp = (item) => {
    console.log(item)
  }
  /**
@@ -159,7 +157,7 @@
  }
  trigerApp = (type) => {
    if ((type === 'appedit' && !this.state.selectApp) || (type === 'subappedit' && !this.state.selectSubApp)) {
    if (type === 'edit' && !this.state.selectApp) {
      notification.warning({
        top: 92,
        message: '请选择需要编辑的应用!',
@@ -173,11 +171,84 @@
    })
  }
  trigerSubApp = (type) => {
    if (type === 'edit' && !this.state.selectSubApp) {
      notification.warning({
        top: 92,
        message: '请选择需要编辑的子应用!',
        duration: 5
      })
      return
    }
    this.setState({
      subVisible: type
    })
  }
  
  submitCard = () => {
    const { card } = this.state
    const { selectApp, visible } = this.state
    this.mobcardRef.handleConfirm().then(res => {
      this.setState({
        confirmloading: true
      })
      let param = {
        func: 's_kei_addupt',
        ID: visible === 'edit' ? selectApp.ID : Utils.getuuid(),
        exec_type: 'y',
        remark: res.remark,
        kei_no: res.kei_no,
        LText: ''
      }
      param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      param.secretkey = Utils.encrypt('', param.timestamp)
      if (visible === 'edit' && selectApp.sublist && selectApp.sublist.length > 0) {
        param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}'`)
        param.LText = param.LText.join(' union all ')
        param.LText = Utils.formatOptions(param.LText)
      }
      Api.getCloudConfig(param).then(result => {
        if (result.status) {
          notification.success({
            top: 92,
            message: '操作成功!',
            duration: 5
          })
          this.setState({
            confirmloading: false,
            visible: false,
            loading: true
          })
          this.getAppList()
        } else {
          this.setState({
            confirmloading: false
          })
          notification.warning({
            top: 92,
            message: result.message,
            duration: 5
          })
        }
      }, () => {
        this.setState({
          confirmloading: false
        })
      })
    })
  }
  submitSubCard = () => {
    const { card } = this.state
    this.submobcardRef.handleConfirm().then(res => {
      this.setState({
        confirmloading: true
      })
@@ -203,7 +274,7 @@
            visible: false,
            loading: true
          })
          this.getMobCards()
          this.getAppList()
        } else {
          this.setState({
            confirmloading: false
@@ -223,7 +294,7 @@
  }
  render () {
    const { loading, visible, columns, applist, appsublist, selectedRowKeys, selectedSubRowKeys, subcolumns, selectApp, selectSubApp } = this.state
    const { loading, visible, subVisible, columns, applist, appsublist, selectedRowKeys, selectedSubRowKeys, subcolumns, selectApp, selectSubApp } = this.state
    return (
      <div className="mk-app-manage">
@@ -236,8 +307,8 @@
        }
        <div className="app-table">
          <div className="app-action">
            <Button className="mk-green" onClick={() => this.trigerApp('appplus')}>添加</Button>
            <Button className="mk-purple" onClick={() => this.trigerApp('appedit')}>修改</Button>
            <Button className="mk-green" onClick={() => this.trigerApp('plus')}>添加</Button>
            <Button className="mk-purple" onClick={() => this.trigerApp('edit')}>修改</Button>
          </div>
          <Table
            rowKey="ID"
@@ -251,8 +322,8 @@
        <div className="app-table">
          <div className="sub-app-title"><span>子应用</span></div>
          <div className="app-action">
            <Button className="mk-green" onClick={() => this.trigerApp('subappplus')}>添加</Button>
            <Button className="mk-purple" onClick={() => this.trigerApp('subappedit')}>修改</Button>
            <Button className="mk-green" onClick={() => this.trigerSubApp('plus')}>添加</Button>
            <Button className="mk-purple" onClick={() => this.trigerSubApp('edit')}>修改</Button>
          </div>
          <Table
            rowKey="ID"
@@ -264,19 +335,32 @@
          />
        </div>
        <Modal
          // className="mob-card-modal"
          title={'编辑应用'}
          width={'600px'}
          maskClosable={false}
          visible={!!visible}
          onCancel={() => this.setState({visible: ''})}
          onCancel={() => this.setState({visible: false})}
          confirmLoading={this.state.confirmloading}
          onOk={this.submitCard}
          cancelText="取消"
          okText="确定"
          destroyOnClose
        >
          <MutilForm card={visible === 'appedit' ? selectApp : (visible === 'subappedit' ? selectSubApp : '')} wrappedComponentRef={(inst) => this.mobcardRef = inst} inputSubmit={this.submitCard} />
          <MutilForm type={visible} card={visible === 'edit' ? selectApp : ''} wrappedComponentRef={(inst) => this.mobcardRef = inst} inputSubmit={this.submitCard} />
        </Modal>
        <Modal
          title={'编辑子应用'}
          width={'600px'}
          maskClosable={false}
          visible={!!subVisible}
          onCancel={() => this.setState({subVisible: false})}
          confirmLoading={this.state.confirmloading}
          onOk={this.submitSubCard}
          cancelText="取消"
          okText="确定"
          destroyOnClose
        >
          <MutilForm type={subVisible} card={subVisible === 'edit' ? selectSubApp : ''} wrappedComponentRef={(inst) => this.submobcardRef = inst} inputSubmit={this.submitSubCard} />
        </Modal>
      </div>
    )
src/views/mobmanage/mutilform/index.jsx
@@ -1,10 +1,11 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Radio } from 'antd'
import { Form, Row, Col, Input } from 'antd'
import './index.scss'
class MainSearch extends Component {
  static propTpyes = {
    type: PropTypes.any,         // 编辑类型
    card: PropTypes.any,         // 编辑应用
    inputSubmit: PropTypes.func  // input回车提交
  }
@@ -33,7 +34,7 @@
  }
  render() {
    const { card } = this.props
    const { card, type } = this.props
    const { getFieldDecorator } = this.props.form
    const formItemLayout = {
      labelCol: {
@@ -50,8 +51,8 @@
        <Row gutter={24}>
          <Col span={24}>
            <Form.Item label="应用名">
              {getFieldDecorator('name', {
                initialValue: card ? card.name : '',
              {getFieldDecorator('remark', {
                initialValue: card ? card.remark : '',
                rules: [{
                  required: true,
                  message: '请输入应用名!'
@@ -63,27 +64,9 @@
            </Form.Item>
          </Col>
          <Col span={24}>
            <Form.Item label="应用类型">
              {getFieldDecorator('type', {
                initialValue: card ? card.type : 'mob',
                rules: [
                  {
                    required: true,
                    message: '请选择应用类型!'
                  }
                ]
              })(
                <Select>
                  <Select.Option value="mob">移动端</Select.Option>
                  <Select.Option value="pc">PC端</Select.Option>
                </Select>
              )}
            </Form.Item>
          </Col>
          <Col span={24}>
            <Form.Item label="应用编码">
              {getFieldDecorator('keiNo', {
                initialValue: card ? card.keiNo : '',
              {getFieldDecorator('kei_no', {
                initialValue: card ? card.kei_no : '',
                rules: [{
                  required: true,
                  message: '请输入应用编码!'
@@ -91,26 +74,10 @@
                  pattern: /^[a-zA-Z_]*$/ig,
                  message: '应用编码只允许包含大小写字母及_!'
                }, {
                  max: 20,
                  message: '应用编码不可超过20个字符!'
                  max: 10,
                  message: '应用编码不可超过10个字符!'
                }]
              })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)}
            </Form.Item>
          </Col>
          <Col span={24}>
            <Form.Item label="权限管理">
              {getFieldDecorator('role_manage', {
                initialValue: card ? card.role_manage || 'false' : 'false',
                rules: [{
                  required: true,
                  message: '请选择是否启用权限管理!'
                }]
              })(
                <Radio.Group>
                  <Radio value="true">启用</Radio>
                  <Radio value="false">不启用</Radio>
                </Radio.Group>
              )}
              })(<Input placeholder="" disabled={type === 'edit'} autoComplete="off" onPressEnter={this.handleSubmit} />)}
            </Form.Item>
          </Col>
        </Row>
src/views/mobmanage/submutilform/index.jsx
New file
@@ -0,0 +1,123 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Radio } from 'antd'
import './index.scss'
class MainSearch extends Component {
  static propTpyes = {
    type: PropTypes.any,         // 编辑类型
    card: PropTypes.any,         // 编辑应用
    inputSubmit: PropTypes.func  // input回车提交
  }
  state = {}
  /**
   * @description 获取表单值
   */
  handleConfirm = () => {
    return new Promise(resolve => {
      this.props.form.validateFieldsAndScroll((err, values) => {
        if (!err) {
          resolve(values)
        }
      })
    })
  }
  /**
   * @description 回车提交
   */
  handleSubmit = (e) => {
    e.preventDefault()
    this.props.inputSubmit()
  }
  render() {
    const { card, type } = this.props
    const { getFieldDecorator } = this.props.form
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
        sm: { span: 8 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      }
    }
    return (
      <Form {...formItemLayout} className="mob-card-edit-form">
        <Row gutter={24}>
          <Col span={24}>
            <Form.Item label="应用名">
              {getFieldDecorator('name', {
                initialValue: card ? card.name : '',
                rules: [{
                  required: true,
                  message: '请输入应用名!'
                }, {
                  max: 20,
                  message: '应用名不可超过20个字符!'
                }]
              })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)}
            </Form.Item>
          </Col>
          <Col span={24}>
            <Form.Item label="应用类型">
              {getFieldDecorator('type', {
                initialValue: card ? card.type : 'mob',
                rules: [
                  {
                    required: true,
                    message: '请选择应用类型!'
                  }
                ]
              })(
                <Select>
                  <Select.Option value="mob">移动端</Select.Option>
                  <Select.Option value="pc">PC端</Select.Option>
                </Select>
              )}
            </Form.Item>
          </Col>
          <Col span={24}>
            <Form.Item label="应用编码">
              {getFieldDecorator('keiNo', {
                initialValue: card ? card.keiNo : '',
                rules: [{
                  required: true,
                  message: '请输入应用编码!'
                }, {
                  pattern: /^[a-zA-Z_]*$/ig,
                  message: '应用编码只允许包含大小写字母及_!'
                }, {
                  max: 20,
                  message: '应用编码不可超过20个字符!'
                }]
              })(<Input placeholder="" disabled={type === 'edit'} autoComplete="off" onPressEnter={this.handleSubmit} />)}
            </Form.Item>
          </Col>
          <Col span={24}>
            <Form.Item label="权限管理">
              {getFieldDecorator('role_manage', {
                initialValue: card ? card.role_manage || 'false' : 'false',
                rules: [{
                  required: true,
                  message: '请选择是否启用权限管理!'
                }]
              })(
                <Radio.Group>
                  <Radio value="true">启用</Radio>
                  <Radio value="false">不启用</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
        </Row>
      </Form>
    )
  }
}
export default Form.create()(MainSearch)
src/views/mobmanage/submutilform/index.scss
New file
@@ -0,0 +1,4 @@
.mob-card-edit-form {
  padding: 0px 24px 20px;
}