From e62bed4f742dd29820499cfe745eb381d9f39f87 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 30 六月 2020 17:23:01 +0800 Subject: [PATCH] 2020-06-30 --- src/tabviews/treepage/index.jsx | 4 src/tabviews/formtab/actionList/index.jsx | 27 +++ src/tabviews/verupmanage/actionList/index.jsx | 54 ++++++ src/tabviews/verupmanage/subtabtable/index.jsx | 2 src/mob/controller/index.scss | 19 ++ src/tabviews/zshare/actionList/excelInbutton/index.jsx | 4 src/tabviews/zshare/actionList/exceloutbutton/index.jsx | 13 + src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx | 2 src/mob/contupdate/index.jsx | 54 +++++++ src/views/mobdesign/index.scss | 1 src/tabviews/subtable/index.jsx | 6 src/mob/login/index.scss | 1 src/tabviews/subtabtable/index.jsx | 6 src/mob/login/index.jsx | 16 + src/tabviews/commontable/index.jsx | 6 src/tabviews/zshare/actionList/normalbutton/index.jsx | 41 +++++ src/mob/contupdate/index.scss | 26 +++ src/tabviews/verupmanage/index.jsx | 2 src/utils/utils.js | 103 +++++++++++++- 19 files changed, 336 insertions(+), 51 deletions(-) diff --git a/src/mob/controller/index.scss b/src/mob/controller/index.scss index 2762e98..68457bf 100644 --- a/src/mob/controller/index.scss +++ b/src/mob/controller/index.scss @@ -3,12 +3,21 @@ height: 100%; overflow: hidden; >.ant-collapse { - border-top: 0; + border: 0; + background: #262E3F; - > .ant-collapse-item > .ant-collapse-header { - padding: 10px 40px 10px 16px; - background: #262E3F; - color: rgba(255, 255, 255, 0.85); + > .ant-collapse-item { + border-color: #202735; + > .ant-collapse-header { + padding: 10px 40px 10px 16px; + background: #262E3F; + color: rgba(255, 255, 255, 0.85); + } + >.ant-collapse-content { + color: rgba(255, 255, 255, 0.85); + background-color: #202735; + border-top: 1px solid #202735; + } } } } \ No newline at end of file diff --git a/src/mob/contupdate/index.jsx b/src/mob/contupdate/index.jsx new file mode 100644 index 0000000..e47b566 --- /dev/null +++ b/src/mob/contupdate/index.jsx @@ -0,0 +1,54 @@ +import React, {Component} from 'react' +import PropTypes from 'prop-types' +// import { is, fromJS } from 'immutable' +import { Form, Icon, Popover, Input } from 'antd' + +import zhCN from '@/locales/zh-CN/mob.js' +import enUS from '@/locales/en-US/mob.js' +import './index.scss' + +class ContentUpdate extends Component { + static propTpyes = { + element: PropTypes.object, + updateContent: PropTypes.func + } + + state = { + dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS + } + + UNSAFE_componentWillMount () { + + } + + // shouldComponentUpdate (nextProps, nextState) { + // return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) + // } + + onVisibleChange = (visible) => { + let val = this.props.form.getFieldValue('content') + console.log(visible) + console.log(val) + } + + render () { + const { element } = this.props + const { getFieldDecorator } = this.props.form + + return ( + <div className="mob-content-update"> + <Popover content={ + <div> + {getFieldDecorator('content', { + initialValue: element.content + })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)} + </div> + } overlayClassName="mob-content-update-popover" placement="bottomRight" title="" trigger="click" onVisibleChange={this.onVisibleChange}> + <Icon type="edit" /> + </Popover> + </div> + ) + } +} + +export default Form.create()(ContentUpdate) \ No newline at end of file diff --git a/src/mob/contupdate/index.scss b/src/mob/contupdate/index.scss new file mode 100644 index 0000000..7f8e8e7 --- /dev/null +++ b/src/mob/contupdate/index.scss @@ -0,0 +1,26 @@ +.mob-content-update { + position: absolute; + top: -23px; + right: -1px; + background: #2f54eb; + border-radius: 2px; + color: #ffffff; + font-size: 14px; + + i { + padding: 2px 5px; + cursor: pointer; + } + +} +.mob-content-update-popover { + .ant-popover-content { + margin-top: -5px; + .ant-popover-arrow { + top: 1px; + } + } + input { + width: 200px; + } +} diff --git a/src/mob/login/index.jsx b/src/mob/login/index.jsx index 39486fb..4387a21 100644 --- a/src/mob/login/index.jsx +++ b/src/mob/login/index.jsx @@ -6,10 +6,13 @@ import zhCN from '@/locales/zh-CN/mob.js' import enUS from '@/locales/en-US/mob.js' -// import mklogo from '@/assets/mobimg/mklogo.png' +import ContentUpdate from '@/mob/contupdate' import './index.scss' const CheckboxItem = Checkbox.CheckboxItem +// const PlaceHolder = ({ active = false, children}) => ( +// <div>{active ? <div></div> : null}{children}</div> +// ) class MobLogin extends Component { static propTpyes = { @@ -95,6 +98,10 @@ this.props.triggerEdit(element) } + updateContent = () => { + + } + render () { const { card, editId } = this.props const { getFieldProps } = this.props.form @@ -105,7 +112,10 @@ <div className={'logo ' + (editId === card.logo.uuid ? 'editing' : '')} onClick={this.editLogo}> <img src={card.logo.content} alt=""/> </div> - <div className={'plat-name ' + (editId === card.title.uuid ? 'editing' : '')} onClick={this.editTitle}>鏄庣鍟嗕笟鏅鸿兘寮�鏀惧钩鍙�</div> + <div className={'plat-name ' + (editId === card.title.uuid ? 'editing' : '')} onClick={this.editTitle}> + {editId === card.title.uuid ? <ContentUpdate element={card.title} updateContent={this.updateContent}/> : null} + {card.title.content} + </div> <InputItem placeholder="UserName" prefixListCls="mk-login-item am-list" @@ -139,7 +149,7 @@ </div> <Button type="primary" onDoubleClick={() => this.props.doubleClickCard(card.login)}>鐧诲綍</Button> <div className={'company-msg ' + (editId === card.copyright.uuid ? 'editing' : '')} onClick={this.editMsg}> - <p>Copyright漏2017 鎵�鏈夌浉鍏崇増鏉冨綊 鍖椾含鏄庣鏅崕淇℃伅鎶�鏈湁闄愬叕鍙�</p> + <p>{card.copyright.content}</p> </div> </div> ) diff --git a/src/mob/login/index.scss b/src/mob/login/index.scss index 920728a..13499ee 100644 --- a/src/mob/login/index.scss +++ b/src/mob/login/index.scss @@ -24,6 +24,7 @@ } .plat-name { + position: relative; max-width: 280px; min-height: 10px; margin: 0 auto; diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index 5edf990..16be35f 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -767,10 +767,10 @@ let DateCount = '' if (setting.default !== 'false' && setting.laypage !== 'false') { - LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows` + LText = ` select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows ` DateCount = `select count(1) as total from ${_dataresource} ${_search}` } else if (setting.default !== 'false') { - LText = `select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows` + LText = ` select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows ` DateCount = '' } @@ -797,7 +797,7 @@ LText += ` aaa: if @ErrorCode!='' - insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ + insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ ` } else { param.custom_script += ` diff --git a/src/tabviews/formtab/actionList/index.jsx b/src/tabviews/formtab/actionList/index.jsx index 51443a1..117d15a 100644 --- a/src/tabviews/formtab/actionList/index.jsx +++ b/src/tabviews/formtab/actionList/index.jsx @@ -110,21 +110,42 @@ } else if (btn.sql && btn.sqlType === 'insert') { // 绯荤粺鍑芥暟娣诲姞鏃讹紝鐢熸垚uuid param.ID = Utils.getguid() - param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata, param, data, logcolumns)) // 鏁版嵁婧� + param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data, logcolumns) // 鏁版嵁婧� + + let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) + + param.LText2 = LText2 + param.LText1 = LText1 + param.LText = LText + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) _primaryId = param.ID } else if (btn.sql && btn.sqlType === 'insertOrUpdate') { // 绯荤粺鍑芥暟娣诲姞鎴栦慨鏀规椂 param.ID = primaryId || Utils.getguid() - param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata, param, data, logcolumns)) // 鏁版嵁婧� + param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data, logcolumns) // 鏁版嵁婧� + + let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) + + param.LText2 = LText2 + param.LText1 = LText1 + param.LText = LText + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) _primaryId = param.ID } else if (btn.sql) { param.ID = primaryId - param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata, param, data, logcolumns)) // 鏁版嵁婧� + param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data, logcolumns) // 鏁版嵁婧� + + let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) + + param.LText2 = LText2 + param.LText1 = LText1 + param.LText = LText + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) } diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index 9fd6f65..f7e18a7 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -672,10 +672,10 @@ let DateCount = '' if (setting.default !== 'false' && setting.laypage !== 'false') { - LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows` + LText = ` select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows ` DateCount = `select count(1) as total from ${_dataresource} ${_search}` } else if (setting.default !== 'false') { - LText = `select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows` + LText = ` select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows ` DateCount = '' } @@ -702,7 +702,7 @@ LText += ` aaa: if @ErrorCode!='' - insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ + insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ ` } else { param.custom_script += ` diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx index 5b876a9..a278a22 100644 --- a/src/tabviews/subtabtable/index.jsx +++ b/src/tabviews/subtabtable/index.jsx @@ -543,10 +543,10 @@ let DateCount = '' if (setting.default !== 'false' && setting.laypage !== 'false') { - LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows` + LText = ` select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows ` DateCount = `select count(1) as total from ${_dataresource} ${_search}` } else if (setting.default !== 'false') { - LText = `select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows` + LText = ` select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows ` DateCount = '' } @@ -573,7 +573,7 @@ LText += ` aaa: if @ErrorCode!='' - insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ + insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ ` } else { param.custom_script += ` diff --git a/src/tabviews/treepage/index.jsx b/src/tabviews/treepage/index.jsx index bda5914..455b130 100644 --- a/src/tabviews/treepage/index.jsx +++ b/src/tabviews/treepage/index.jsx @@ -498,7 +498,7 @@ let LText = '' if (setting.default !== 'false') { - LText = `select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${setting.order}) as rows from ${_dataresource}) tmptable order by tmptable.rows` + LText = ` select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${setting.order}) as rows from ${_dataresource}) tmptable order by tmptable.rows ` } if (param.custom_script) { @@ -508,7 +508,7 @@ LText += ` aaa: if @ErrorCode!='' - insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ + insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ ` } else { param.custom_script += ` diff --git a/src/tabviews/verupmanage/actionList/index.jsx b/src/tabviews/verupmanage/actionList/index.jsx index 506ba98..77c455f 100644 --- a/src/tabviews/verupmanage/actionList/index.jsx +++ b/src/tabviews/verupmanage/actionList/index.jsx @@ -171,7 +171,14 @@ } } else if (btn.sql) { param.ID = primaryId - param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, '', param, data[0], logcolumns)) // 鏁版嵁婧� + param.LText = Utils.getSysDefaultSql(btn, setting, '', param, data[0], logcolumns) // 鏁版嵁婧� + + let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) + + param.LText2 = LText2 + param.LText1 = LText1 + param.LText = LText + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) } @@ -196,12 +203,26 @@ } } param.ID = primaryId || Utils.getguid() - param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata, param, data[0], logcolumns)) // 鏁版嵁婧� + param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data[0], logcolumns) // 鏁版嵁婧� + + let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) + + param.LText2 = LText2 + param.LText1 = LText1 + param.LText = LText + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) } else if (btn.sql) { param.ID = primaryId - param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata, param, data[0], logcolumns)) // 鏁版嵁婧� + param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data[0], logcolumns) // 鏁版嵁婧� + + let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) + + param.LText2 = LText2 + param.LText1 = LText1 + param.LText = LText + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) } @@ -244,7 +265,14 @@ } } else if (btn.sql) { param.ID = primaryId - param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, '', param, cell, logcolumns)) // 鏁版嵁婧� + param.LText = Utils.getSysDefaultSql(btn, setting, '', param, cell, logcolumns) // 鏁版嵁婧� + + let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) + + param.LText2 = LText2 + param.LText1 = LText1 + param.LText = LText + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) } @@ -265,7 +293,14 @@ } } else if (btn.sql && btn.sqlType === 'insert') { // 绯荤粺鍑芥暟娣诲姞鏃讹紝鐢熸垚uuid param.ID = _formPrimaryId || Utils.getguid() - param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata, param, cell, logcolumns)) // 鏁版嵁婧� + param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, cell, logcolumns) // 鏁版嵁婧� + + let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) + + param.LText2 = LText2 + param.LText1 = LText1 + param.LText = LText + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) } else if (btn.sql) { @@ -279,7 +314,14 @@ } param.ID = primaryId - param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata, param, cell, logcolumns)) // 鏁版嵁婧� + param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, cell, logcolumns) // 鏁版嵁婧� + + let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) + + param.LText2 = LText2 + param.LText1 = LText1 + param.LText = LText + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) } diff --git a/src/tabviews/verupmanage/index.jsx b/src/tabviews/verupmanage/index.jsx index af3e2c5..6b56103 100644 --- a/src/tabviews/verupmanage/index.jsx +++ b/src/tabviews/verupmanage/index.jsx @@ -260,7 +260,7 @@ _search = '' } - let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows` + let LText = ` select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows ` let DateCount = `select count(1) as total from ${_dataresource} ${_search}` param.LText = Utils.formatOptions(LText) diff --git a/src/tabviews/verupmanage/subtabtable/index.jsx b/src/tabviews/verupmanage/subtabtable/index.jsx index 8f4f1fa..d7d7390 100644 --- a/src/tabviews/verupmanage/subtabtable/index.jsx +++ b/src/tabviews/verupmanage/subtabtable/index.jsx @@ -280,7 +280,7 @@ _search = '' } - let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows` + let LText = ` select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows ` let DateCount = `select count(1) as total from ${_dataresource} ${_search}` param.LText = Utils.formatOptions(LText) diff --git a/src/tabviews/zshare/actionList/excelInbutton/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/index.jsx index 383b19a..49edf75 100644 --- a/src/tabviews/zshare/actionList/excelInbutton/index.jsx +++ b/src/tabviews/zshare/actionList/excelInbutton/index.jsx @@ -262,8 +262,8 @@ } param.excel_in_type = 'true' - param.LText_insert = Utils.formatOptions(result.insert) - param.LText_bottom = Utils.formatOptions(result.bottom) + param.LText1 = Utils.formatOptions(result.insert) + param.LText2 = Utils.formatOptions(result.bottom) param.LText = Utils.formatOptions(result.sql) param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx index 1129358..760a4be 100644 --- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx +++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx @@ -505,7 +505,12 @@ param.BID = this.props.BID } - param.LText = Utils.formatOptions(script) + let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(script) + + param.LText2 = LText2 + param.LText1 = LText1 + param.LText = LText + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) @@ -619,9 +624,9 @@ let LText = '' if (setting.default !== 'false' && !pagination) { - LText = `select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows` + LText = ` select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows ` } else if (setting.default !== 'false') { - LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows` + LText = ` select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows ` } if (param.custom_script) { @@ -633,7 +638,7 @@ LText += ` aaa: if @ErrorCode!='' - insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ + insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ ` } else { param.custom_script += ` diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 8b22246..f56f4e5 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -223,7 +223,12 @@ param.LText = param.LText.replace(/@\$|\$@/ig, '') } - param.LText = Utils.formatOptions(param.LText) + let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) + + param.LText2 = LText2 + param.LText1 = LText1 + param.LText = LText + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) } @@ -259,7 +264,12 @@ param.LText = param.LText.replace(/@\$|\$@/ig, '') } - param.LText = Utils.formatOptions(param.LText) + let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) + + param.LText2 = LText2 + param.LText1 = LText1 + param.LText = LText + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) } else if (btn.sql) { @@ -272,8 +282,13 @@ } else { param.LText = param.LText.replace(/@\$|\$@/ig, '') } + + let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) + + param.LText2 = LText2 + param.LText1 = LText1 + param.LText = LText - param.LText = Utils.formatOptions(param.LText) param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) } @@ -336,7 +351,11 @@ param.LText = param.LText.replace(/@\$|\$@/ig, '') } - param.LText = Utils.formatOptions(param.LText) + let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) + + param.LText2 = LText2 + param.LText1 = LText1 + param.LText = LText param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) } @@ -371,7 +390,12 @@ param.LText = param.LText.replace(/@\$|\$@/ig, '') } - param.LText = Utils.formatOptions(param.LText) + let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) + + param.LText2 = LText2 + param.LText1 = LText1 + param.LText = LText + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) } else if (btn.sql) { @@ -385,7 +409,12 @@ param.LText = param.LText.replace(/@\$|\$@/ig, '') } - param.LText = Utils.formatOptions(param.LText) + let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) + + param.LText2 = LText2 + param.LText1 = LText1 + param.LText = LText + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) } diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx index 046402e..5a50093 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx @@ -38,7 +38,7 @@ } let _sql = `Declare @${btn.sheet} table (${usefulfields.map(item => item.Column + ' ' + item.type).join(',')},jskey nvarchar(50) ) - Declare @UserName nvarchar(50),@FullName nvarchar(50),@ErrorCode nvarchar(50), @retmsg nvarchar(4000) + Declare @UserName nvarchar(50),@FullName nvarchar(50),@ErrorCode nvarchar(50), @retmsg nvarchar(4000),@tbid Nvarchar(512) Select @ErrorCode='', @retmsg='' ` diff --git a/src/utils/utils.js b/src/utils/utils.js index 186bb97..12faef9 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -10,9 +10,9 @@ static getuuid () { let uuid = [] let timestamp = new Date().getTime() - let options = '0123456789abcdefghigklmnopqrstuv' + let _options = '0123456789abcdefghigklmnopqrstuv' for (let i = 0; i < 19; i++) { - uuid.push(options.substr(Math.floor(Math.random() * 0x20), 1)) + uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1)) } uuid = timestamp + uuid.join('') return uuid @@ -180,6 +180,81 @@ } return value + } + + /** + * @description sPC_TableData_InUpDe sql鍔犲瘑 + * @return {String} value + */ + static sPCInUpDeFormatOptions (value) { + if (!value) return {LText: '', LText1: '', LText2: ''} + + let salt = 'minKe' // 鐩愬�� + // 鍏抽敭瀛楄浆鎹㈣鍒� + let format = [ + { key: 'select', value: ' msltk ' }, + { key: 'from', value: ' mfrmk ' }, + { key: 'where', value: ' mwhrk ' }, + { key: 'order by', value: ' modbk ' }, + { key: 'asc', value: ' modack ' }, + { key: 'desc', value: ' moddesk ' }, + { key: 'top', value: ' mtpk ' }, + { key: 'like', value: ' mlkk ' }, + { key: 'not like', value: ' mnlkk ' }, + { key: 'between', value: ' mbtnk ' }, + { key: 'and', value: ' madk ' }, + { key: 'insert', value: ' mistk ' }, + { key: 'into', value: ' mitk ' }, + { key: 'update', value: ' muptk ' }, + { key: 'delete', value: ' mdelk ' }, + { key: 'begin', value: ' mbgink ' }, + { key: 'end', value: ' medk ' }, + { key: 'if', value: ' mefk ' }, + { key: 'while', value: ' mwilk ' }, + { key: 'create', value: ' mcrtk ' }, + { key: 'alter', value: ' matek ' }, + { key: 'len', value: ' mlnk ' }, + { key: 'left', value: ' mlftk ' }, + { key: 'right', value: ' mritk ' }, + { key: 'union', value: ' munok ' }, + { key: 'varchar', value: ' mvcrk ' }, + { key: 'getdate', value: ' mgtdtk ' }, + { key: 'TRY', value: ' mtryonek ' }, + { key: 'TRAN', value: ' mtrnk ' }, + { key: 'goto', value: ' mgtk ' }, + { key: 'set', value: ' mstk ' }, + { key: 'ROLLBACK', value: ' mrlbkk ' } + ] + + value = value.replace(/\n/ig, ' \n ') + // 鏇挎崲鍏抽敭瀛� + format.forEach(item => { + let reg = new RegExp('(^|\\s)' + item.key + '(\\s|$)', 'ig') + value = value.replace(reg, item.value) + }) + + // 1銆佹浛鎹�%绗︼紙鏁版嵁搴撲腑瑙f瀽鍚巗ql鎶ラ敊锛� + value = value.replace(/%/ig, ' mpercent ') + + let encodesql = (val) => { + if (!val) return '' + + let _value = window.btoa(window.encodeURIComponent(val)) + + // 鎻掑叆瀛楃 + let index = Math.floor(_value.length / 2) + _value = _value.slice(0, index) + salt + _value.slice(index) + + // base64鍔犲瘑 + return window.btoa(_value) + } + + // 娉細LText 涓� LText1 椤哄簭棰犲�� + return { + LText: encodesql(value.substring(5000, 10000)), + LText1: encodesql(value.substring(0, 5000)), + LText2: encodesql(value.substring(10000)) + } } /** @@ -870,10 +945,19 @@ Delete @${item.sheet} aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg` - - let fsql = `${_sql}${_sqlInsert}${_sqlBottom}` - fsql = fsql.replace(/\n\s{8}/ig, '\n') - console.log(fsql) + + if (window.GLOB.systemType !== 'official') { + let fsql = ` + ${_sql} + ${_sqlInsert} + + /* excel鏁版嵁锛堝墠40鏉★級 */ + ${_Ltext.slice(0, 40).join(' Union all ')} + ${_sqlBottom} + ` + fsql = fsql.replace(/\n\s{8}/ig, '\n') + console.log(fsql) + } } else { // s_sDataDictb_excelIn 浜戠瀵嗛挜楠岃瘉鍙傛暟 _sql = ` /* 绯荤粺鐢熸垚 */ @@ -1492,8 +1576,11 @@ _sql += ` aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg` - _sql = _sql.replace(/\n\s{8}/ig, '\n') - console.log(_sql) + if (window.GLOB.systemType !== 'official') { + _sql = _sql.replace(/\n\s{8}/ig, '\n') + console.log(_sql) + } + return _sql } } \ No newline at end of file diff --git a/src/views/mobdesign/index.scss b/src/views/mobdesign/index.scss index 3fedde8..b496b3a 100644 --- a/src/views/mobdesign/index.scss +++ b/src/views/mobdesign/index.scss @@ -74,6 +74,7 @@ >.ant-tabs { >.ant-tabs-bar { border-bottom: 1px solid #181F29; + margin-bottom: 0px; .ant-tabs-tab { color: rgba(255, 255, 255, 0.85); } -- Gitblit v1.8.0