From 1a14ff6035932eadfb6ef7970e3adb24b4e158a6 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 18 十二月 2019 18:56:17 +0800 Subject: [PATCH] 2019-12-18 --- src/components/header/index.scss | 28 - src/templates/comtableconfig/actionform/index.jsx | 2 src/templates/comtableconfig/colspanform/index.jsx | 15 src/templates/modalconfig/index.scss | 4 src/templates/modalconfig/settingform/index.jsx | 94 +++++++ src/tabviews/commontable/mainAction/index.jsx | 16 + src/components/sidemenu/editthdmenu/index.jsx | 3 src/templates/comtableconfig/index.jsx | 147 ++++++----- src/tabviews/commontable/mainSearch/index.jsx | 13 + src/templates/comtableconfig/settingform/index.jsx | 10 src/tabviews/commontable/mutilform/index.jsx | 37 ++ src/templates/comtableconfig/searchform/index.jsx | 10 src/templates/modalconfig/index.jsx | 4 src/api/index.js | 16 + src/templates/modalconfig/source.jsx | 5 src/locales/zh-CN/comtable.js | 4 src/tabviews/commontable/index.jsx | 38 ++ src/templates/comtableconfig/dragelement/index.jsx | 6 src/tabviews/commontable/mainTable/index.jsx | 38 +- src/utils/option.js | 20 + src/templates/comtableconfig/dragelement/card.jsx | 113 +++++--- src/utils/utils.js | 56 +++- 22 files changed, 449 insertions(+), 230 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 026eddc..0ddce06 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -194,7 +194,6 @@ param.lang = localStorage.getItem('lang') || '' param.SessionUid = sessionStorage.getItem('SessionUid') || '' param.LoginUID = sessionStorage.getItem('LoginUID') || '' - // param.appkey = window.GLOB.appkey || '' return axios({ url: '/webapi/dostar', @@ -203,6 +202,21 @@ } /** + * @description 瀵煎嚭Excel + */ + getExcelOut (param) { + param.userid = sessionStorage.getItem('UserID') + param.lang = localStorage.getItem('lang') || '' + param.SessionUid = sessionStorage.getItem('SessionUid') || '' + param.LoginUID = sessionStorage.getItem('LoginUID') || '' + + return axios({ + url: '/webapi/doexcel', + data: param + }) + } + + /** * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅 * @param {String} MenuNo 椤甸潰鑿滃崟鍙傛暟 */ diff --git a/src/components/header/index.scss b/src/components/header/index.scss index 84221f2..ac20a39 100644 --- a/src/components/header/index.scss +++ b/src/components/header/index.scss @@ -2,7 +2,6 @@ .header-container { position: fixed; - // background-color: $header-bg; z-index: 1060; left: 0; top: 0; @@ -62,15 +61,16 @@ } &:hover { - height: 42px; color: #eeeeee; - border-bottom: 4px solid #fafcfb; + span { + border-bottom: 4px solid #fafcfb; + } } &.active { - height: 42px; color: #ffffff; - // font-weight: bold; - border-bottom: 4px solid #06b4f7; + span { + border-bottom: 4px solid #06b4f7; + } } } } @@ -95,28 +95,12 @@ } } } - // .header-drag-menu { - // float: left; - // } .edit-check { font-size: 18px; margin-top: 14px; margin-left: 10px; cursor: pointer; } - // .mask { - // position: fixed; - // top: 48px; - // left: 0px; - // right: 0px; - // bottom: calc(100vh - 48px); - // background-color: rgba(0, 0, 0, 0); - // transition: background-color 0.5s; - // } - // .mask.active { - // bottom: 0px; - // background-color: rgba(0, 0, 0, 0.25); - // } } .header-dropdown { li { diff --git a/src/components/sidemenu/editthdmenu/index.jsx b/src/components/sidemenu/editthdmenu/index.jsx index 2e91133..1ef770b 100644 --- a/src/components/sidemenu/editthdmenu/index.jsx +++ b/src/components/sidemenu/editthdmenu/index.jsx @@ -129,7 +129,7 @@ } _menu.LongParam = _LongParam _menu.ParentID = this.props.supMenu.MenuID - // console.log(_menu) + // 妫�娴嬫ā鏉挎槸鍚﹀瓨鍦� let _Template = this.state.baseTemplates.filter(temp => temp.type === _menu.PageParam.Template) this.setState({ @@ -514,6 +514,7 @@ menu={this.state.editMenu} supMenuList={this.props.supMenuList} handleConfig={this.handleConfig} + reloadmenu={() => {this.props.reload()}} handleSubConfig={this.handleSubConfig} /> } diff --git a/src/locales/zh-CN/comtable.js b/src/locales/zh-CN/comtable.js index c6bb907..4af26b3 100644 --- a/src/locales/zh-CN/comtable.js +++ b/src/locales/zh-CN/comtable.js @@ -99,8 +99,8 @@ 'header.form.popview': '寮圭獥锛堥〉闈級', 'header.form.tab': '鏍囩椤�', 'header.form.currenttab': '褰撳墠鑿滃崟', - 'header.form.excelIn': 'Excel瀵煎叆', - 'header.form.excelOut': 'Excel瀵煎嚭', + 'header.form.excelIn': '瀵煎叆Excel', + 'header.form.excelOut': '瀵煎嚭Excel', 'header.form.newpage': '鏂伴〉闈�', 'header.form.newpage.inner': '鏂伴〉闈紙鍐呴儴锛�', 'header.form.newpage.outer': '鏂伴〉闈紙澶栭儴锛�', diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index eb03ae3..0325d43 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -248,7 +248,7 @@ let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${setting.dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows` let DateCount = `select count(1) as total from ${setting.dataresource} ${_search}` - console.log(LText) + param.LText = Utils.formatOptions(LText) param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' param.secretkey = Utils.encrypt(param.LText, param.timestamp) @@ -368,7 +368,33 @@ this.reloadtable() } else if (btn.execError === 'view' && type === 'error') { this.reloadview() + } else if (type === 'excelOut') { + this.handleExcelout() } + } + + handleExcelout = () => { + const { arr_field, orderColumn, orderType, search, setting } = this.state + + let _search = Utils.joinMainSearchkey(search) + _search = _search ? 'where (' + _search + ')' : '' + // 鑾峰彇鍒楄〃鏁版嵁 + let param = { + func: setting.innerFunc || 'sPC_Get_TableData', + obj_name: 'data', + arr_field: arr_field + } + + let orderBy = orderColumn ? (orderColumn + ' ' + orderType) : setting.order + + let LText = `select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${setting.dataresource} ${_search}) tmptable order by tmptable.rows` + + param.LText = Utils.formatOptions(LText) + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' + param.secretkey = Utils.encrypt(param.LText, param.timestamp) + param.DateCount = '' + + Api.genericInterface(param) } gettableselected = () => { @@ -378,6 +404,10 @@ data.push(this.refs.mainTable.props.data[item]) }) return data + } + + buttonTrigger = (btn, record) => { + this.refs.mainButton.actionTrigger(btn, record) } UNSAFE_componentWillMount () { @@ -404,6 +434,7 @@ } {actions && <MainAction + ref="mainButton" MenuID={this.props.MenuID} setting={setting} refreshdata={this.refreshbyaction} @@ -415,14 +446,15 @@ {columns && <MainTable ref="mainTable" + dict={this.state.dict} MenuID={this.props.MenuID} setting={setting} - refreshdata={this.refreshbytable} columns={columns} data={this.state.data} total={this.state.total} loading={this.state.loading} - dict={this.state.dict} + refreshdata={this.refreshbytable} + buttonTrigger={this.buttonTrigger} /> } <BackTop> diff --git a/src/tabviews/commontable/mainAction/index.jsx b/src/tabviews/commontable/mainAction/index.jsx index 50298f9..096c27c 100644 --- a/src/tabviews/commontable/mainAction/index.jsx +++ b/src/tabviews/commontable/mainAction/index.jsx @@ -31,6 +31,7 @@ refreshdata = (item, type) => { this.props.refreshdata(item, type) } + actionTrigger = (item) => { const { setting } = this.props @@ -86,6 +87,8 @@ }, () => { this.improveAction(item) }) + } else if (item.OpenType === 'excelOut') { + this.refreshdata(item, 'excelOut') } else { notification.warning({ top: 92, @@ -499,7 +502,8 @@ message: this.props.dict['main.action.confirm.success'], duration: 2 }) - if (btn.OpenType === 'pop') { + + if (btn.OpenType === 'pop' && btn.setting && btn.setting.finish !== 'unclose') { this.setState({ visible: false }) @@ -708,7 +712,9 @@ let title = '' let width = '62vw' + let clickouter = false let container = document.body + if (execAction && execAction.setting) { title = execAction.setting.title width = execAction.setting.width + 'vw' @@ -717,13 +723,18 @@ width = execAction.setting.width + '%' container = () => document.getElementById('commontable' + this.props.MenuID) } + + if (execAction.setting.clickouter === 'close') { + clickouter = true + } } return ( <Modal + title={title} + maskClosable={clickouter} getContainer={container} wrapClassName='action-modal' - title={title} visible={this.state.visible} width={width} onOk={this.handleOk} @@ -734,6 +745,7 @@ <MutilForm dict={this.props.dict} action={execAction} + inputSubmit={this.handleOk} configMap={this.state.configMap} data={this.state.tabledata[0]} wrappedComponentRef={(inst) => this.formRef = inst} diff --git a/src/tabviews/commontable/mainSearch/index.jsx b/src/tabviews/commontable/mainSearch/index.jsx index 2f9d0a7..78ff563 100644 --- a/src/tabviews/commontable/mainSearch/index.jsx +++ b/src/tabviews/commontable/mainSearch/index.jsx @@ -91,12 +91,23 @@ </Col> ) } else if (item.type === 'daterange') { + let _defaultValue = [null, null] + + if (item.initval) { + try { + let _initval = JSON.parse(item.initval) + _defaultValue = [moment().subtract(_initval[0], 'days'), moment().subtract(_initval[1], 'days')] + } catch { + _defaultValue = [null, null] + } + } + fields.push( <Col className="daterange" span={6} key={index}> <Form.Item label={item.label}> {getFieldDecorator(item.field, { - initialValue: item.initval ? [moment().subtract(item.initval, 'days'), moment().subtract(item.initval === 1 ? 1 : 0, 'days')] : [null, null] + initialValue: _defaultValue })( <RangePicker placeholder={['寮�濮嬫棩鏈�', '缁撴潫鏃ユ湡']} diff --git a/src/tabviews/commontable/mainTable/index.jsx b/src/tabviews/commontable/mainTable/index.jsx index 1714101..6b65a50 100644 --- a/src/tabviews/commontable/mainTable/index.jsx +++ b/src/tabviews/commontable/mainTable/index.jsx @@ -6,30 +6,29 @@ export default class MainTable extends Component { static propTpyes = { - MenuID: PropTypes.string, // 鑿滃崟鍙傛暟 - setting: PropTypes.object, // 琛ㄦ牸澶撮儴鏄惁鍥哄畾浜庨〉闈笂鏂� - loading: PropTypes.bool, - total: PropTypes.number, - select: PropTypes.object, - dict: PropTypes.object, // 瀛楀吀椤� - columns: PropTypes.array, // 琛ㄦ牸鍒� - data: PropTypes.oneOfType([ - PropTypes.object, - PropTypes.array - ]) + dict: PropTypes.object, // 瀛楀吀椤� + MenuID: PropTypes.string, // 鑿滃崟Id + setting: PropTypes.object, // 琛ㄦ牸鍏ㄥ眬璁剧疆锛歵ableType锛堣〃鏍兼槸鍚﹀彲閫夈�佸崟閫夈�佸閫夛級銆乧olumnfixed锛堝垪鍥哄畾锛夈�乤ctionfixed锛堟寜閽浐瀹氾級 + columns: PropTypes.array, // 琛ㄦ牸鍒� + data: PropTypes.any, // 琛ㄦ牸鏁版嵁 + total: PropTypes.number, // 鎬绘暟 + loading: PropTypes.bool, // 琛ㄦ牸鍔犺浇涓� + refreshdata: PropTypes.func, // 琛ㄦ牸涓帓搴忓垪銆侀〉鐮佺殑鍙樺寲鏃跺埛鏂� + buttonTrigger: PropTypes.func // 琛ㄦ牸涓寜閽Е鍙戞搷浣� } state = { - selectedRowKeys: [], - pageIndex: 1, - pageSize: 10, - columns: null + selectedRowKeys: [], // 琛ㄦ牸涓�変腑琛� + pageIndex: 1, // 鍒濆椤甸潰绱㈠紩 + pageSize: 10, // 姣忛〉鏁版嵁鏉℃暟 + columns: null // 鏄剧ず鍒� } UNSAFE_componentWillMount () { const { columns } = this.props let _columns = [] - columns.forEach((item, index) => { + + columns.forEach(item => { let cell = { align: item.Align, dataIndex: item.field || item.uuid, @@ -164,8 +163,7 @@ actionTrigger = (e, btn, record) => { e.stopPropagation() - console.log(btn) - console.log(record) + this.props.buttonTrigger(btn, record) } copycontent = (e, content) => { @@ -251,9 +249,9 @@ <div className="main-table"> {this.props.setting.columnfixed && <Affix offsetTop={offset} className="fix-header"> <Table + size="middle" bordered={true} rowSelection={rowSelection} - size="middle" columns={this.state.columns.map(column => { return { align: column.align, @@ -265,9 +263,9 @@ /> </Affix>} <Table + size="middle" bordered={true} rowSelection={rowSelection} - size="middle" columns={this.state.columns} dataSource={this.props.data ? this.props.data : []} loading={this.props.loading} diff --git a/src/tabviews/commontable/mutilform/index.jsx b/src/tabviews/commontable/mutilform/index.jsx index 096534e..4ceb1e2 100644 --- a/src/tabviews/commontable/mutilform/index.jsx +++ b/src/tabviews/commontable/mutilform/index.jsx @@ -9,10 +9,11 @@ class MainSearch extends Component { static propTpyes = { - action: PropTypes.object, // 鎼滅储鏉′欢鍒楄〃 - dict: PropTypes.object, // 瀛楀吀椤� - data: PropTypes.any, // 琛ㄦ牸鏁版嵁 - configMap: PropTypes.object + action: PropTypes.object, // 鎸夐挳淇℃伅銆佽〃鍗曞垪琛� + dict: PropTypes.object, // 瀛楀吀椤� + data: PropTypes.any, // 琛ㄦ牸鏁版嵁 + configMap: PropTypes.object, // 鎸夐挳鍙婁笅鎷夎〃鍗曢厤缃俊鎭泦 + inputSubmit: PropTypes.func // input鍥炶溅鎻愪氦 } state = { @@ -22,6 +23,7 @@ } componentDidMount () { + const { data } = this.props let action = JSON.parse(JSON.stringify(this.props.action)) let datatype = {} @@ -83,12 +85,18 @@ formlist = formlist.map(item => { if (item.type === 'link') { let supItem = formlist.filter(form => form.field === item.linkField)[0] + + if (!supItem && data && data.hasOwnProperty(item.linkField)) { + supItem = {initval: data[item.linkField]} + } + if (!supItem) { error = true } else { item.options = item.oriOptions.filter(option => option.parentId === supItem.initval) } } + return item }) @@ -104,6 +112,13 @@ readtype: readtype, datatype: datatype, formlist: formlist + }, () => { + if (action.setting && action.setting.focus) { + let _item = document.getElementById(action.setting.focus) + if (_item) { + _item.select() + } + } }) } @@ -187,14 +202,14 @@ <Col span={24 / cols} key={index}> <Form.Item label={item.label}> {getFieldDecorator(item.field, { - initialValue: item.initval, + initialValue: item.initval || 'text', rules: [ { required: item.required === 'true', message: this.props.dict['form.required.input'] + item.label + '!' } ] - })(<Input placeholder="" autoComplete="off" disabled={item.readonly === 'true'} />)} + })(<Input placeholder="" autoComplete="off" disabled={item.readonly === 'true'} onPressEnter={this.handleSubmit} />)} </Form.Item> </Col> ) @@ -217,8 +232,8 @@ ] })( precision === null ? - <InputNumber initialValue={_initval} min={min} max={max} disabled={item.readonly === 'true'} /> : - <InputNumber initialValue={_initval} min={min} max={max} precision={precision} disabled={item.readonly === 'true'} /> + <InputNumber initialValue={_initval} min={min} max={max} disabled={item.readonly === 'true'} onPressEnter={this.handleSubmit} /> : + <InputNumber initialValue={_initval} min={min} max={max} precision={precision} disabled={item.readonly === 'true'} onPressEnter={this.handleSubmit} /> )} </Form.Item> </Col> @@ -394,9 +409,9 @@ }) } - handleReset = () => { - // 閲嶇疆 - this.props.form.resetFields() + handleSubmit = (e) => { + e.preventDefault() + this.props.inputSubmit() } render() { diff --git a/src/templates/comtableconfig/actionform/index.jsx b/src/templates/comtableconfig/actionform/index.jsx index b1f06d8..531b09e 100644 --- a/src/templates/comtableconfig/actionform/index.jsx +++ b/src/templates/comtableconfig/actionform/index.jsx @@ -333,7 +333,7 @@ values.position = 'toolbar' values.Ot = 'notRequired' } - console.log(values) + if (values.innerFunc === '' && values.sql === '') { notification.warning({ top: 92, diff --git a/src/templates/comtableconfig/colspanform/index.jsx b/src/templates/comtableconfig/colspanform/index.jsx index 13cc7b5..b1c39c8 100644 --- a/src/templates/comtableconfig/colspanform/index.jsx +++ b/src/templates/comtableconfig/colspanform/index.jsx @@ -1,6 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Input, notification, InputNumber, Select, Radio } from 'antd' +import { Form, Row, Col, Input, InputNumber, Select, Radio } from 'antd' import TransferForm from '../transferform' import './index.scss' @@ -21,17 +21,10 @@ this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { let targetKeys = this.refs['column-transfer'].state.targetKeys - if (targetKeys.length === 0) { - notification.warning({ - top: 92, - message: '璇锋坊鍔犳樉绀哄垪', - duration: 10 - }) - return - } - delete values.type - let subfield = [] // 鐢ㄤ簬鏌ョ湅鍚堝苟鍒楀瓧娈� + delete values.type // 鍒犻櫎type锛屾澶勫�间负'鍚堝苟鍒�'鏂囧瓧 + + let subfield = [] // 鐢ㄤ簬鏌ョ湅鍚堝苟鍒楀瓧娈� this.props.columns.forEach(col => { if (col.field && targetKeys.includes(col.uuid)) { subfield.push(col.field) diff --git a/src/templates/comtableconfig/dragelement/card.jsx b/src/templates/comtableconfig/dragelement/card.jsx index 617c5f5..00bdafe 100644 --- a/src/templates/comtableconfig/dragelement/card.jsx +++ b/src/templates/comtableconfig/dragelement/card.jsx @@ -45,79 +45,98 @@ copyCard(id) } - let selectval = '' + let _defaultValue = '' // 涓嬫媺鎼滅储銆佹椂闂磋寖鍥寸被鍨嬶紝鍒濆鍊奸渶瑕侀澶勭悊 + if (type === 'search' && card.type === 'select') { if (card.initval) { let _option = card.options.filter(option => option.Value === card.initval)[0] if (_option) { - selectval = _option.Text || '' + _defaultValue = _option.Text || '' } else { - selectval = '' + _defaultValue = '' } } else if (card.setAll === 'true') { - selectval = '鍏ㄩ儴' + _defaultValue = '鍏ㄩ儴' + } + } else if (type === 'search' && card.type === 'daterange') { + _defaultValue = [null, null] + if (card.initval) { + try { + let _initval = JSON.parse(card.initval) + _defaultValue = [moment().subtract(_initval[0], 'days'), moment().subtract(_initval[1], 'days')] + } catch { + _defaultValue = [null, null] + } } } return ( <div className="page-card" style={type === 'columns' ? { flex: card.Width, opacity: opacity} : { opacity: opacity}}> <div ref={node => drag(drop(node))}> - {type === 'search' && <div className="ant-row ant-form-item"> - <div className="ant-col ant-form-item-label"> - <label title={card.label}>{card.label}</label> - </div> - <div className="ant-col ant-form-item-control-wrapper"> - {card.type === 'text' ? - <Input style={{marginTop: '4px'}} defaultValue={card.initval} /> : null - } - {(card.type === 'select' || card.type === 'link') ? - <Select defaultValue={selectval}></Select> : null - } - {card.type === 'date' ? - <DatePicker defaultValue={card.initval ? moment().subtract(card.initval, 'days') : null} /> : null - } - {card.type === 'dateweek' ? - <WeekPicker defaultValue={card.initval ? moment().subtract(card.initval * 7, 'days') : null} /> : null - } - {card.type === 'datemonth' ? - <MonthPicker defaultValue={card.initval ? moment().subtract(card.initval, 'month') : null} /> : null - } - {card.type === 'daterange' ? - <RangePicker - className="data-range" - placeholder={['寮�濮嬫棩鏈�', '缁撴潫鏃ユ湡']} - renderExtraFooter={() => 'extra footer'} - defaultValue={card.initval ? [moment().subtract(card.initval, 'days'), moment().subtract(card.initval === 1 ? 1 : 0, 'days')] : [null, null]} - /> : null - } - <div className="input-mask"></div> - </div> - </div>} - {type === 'action' && + {type === 'search' ? + <div className="ant-row ant-form-item"> + <div className="ant-col ant-form-item-label"> + <label title={card.label}>{card.label}</label> + </div> + <div className="ant-col ant-form-item-control-wrapper"> + {card.type === 'text' ? + <Input style={{marginTop: '4px'}} defaultValue={card.initval} /> : null + } + {(card.type === 'select' || card.type === 'link') ? + <Select defaultValue={_defaultValue}></Select> : null + } + {card.type === 'date' ? + <DatePicker defaultValue={card.initval ? moment().subtract(card.initval, 'days') : null} /> : null + } + {card.type === 'dateweek' ? + <WeekPicker defaultValue={card.initval ? moment().subtract(card.initval * 7, 'days') : null} /> : null + } + {card.type === 'datemonth' ? + <MonthPicker defaultValue={card.initval ? moment().subtract(card.initval, 'month') : null} /> : null + } + {card.type === 'daterange' ? + <RangePicker + className="data-range" + placeholder={['寮�濮嬫棩鏈�', '缁撴潫鏃ユ湡']} + renderExtraFooter={() => 'extra footer'} + defaultValue={_defaultValue} + /> : null + } + <div className="input-mask"></div> + </div> + </div> : null + } + {type === 'action' ? <Button className={'mk-btn mk-' + card.class} icon={card.icon} key={card.uuid} - >{card.label}{card.position === 'grid' && <Icon type="table" />}</Button> + > + {card.label}{card.position === 'grid' && <Icon type="table" />} + </Button> : null } - {type === 'columns' && + {type === 'columns' ? <span className="ant-table-header-column"> <div className="ant-table-column-sorters" title={card.label} style={{textAlign: card.Align}}> <span className="ant-table-column-title">{card.label}</span> - {card.IsSort === 'true' && <span className="ant-table-column-sorter"> - <Icon type="caret-up" /> - <Icon type="caret-down" /> - </span>} + {card.IsSort === 'true' ? + <span className="ant-table-column-sorter"> + <Icon type="caret-up" /> + <Icon type="caret-down" /> + </span> : null + } </div> - {showfield ? <div className="ant-table-column-fields"> - <span className="ant-table-column-title">{card.type === 'colspan' ? card.subfield : card.field}</span> - </div> : null} - </span> + {showfield ? + <div className="ant-table-column-fields"> + <span className="ant-table-column-title">{card.type === 'colspan' ? card.subfield : card.field}</span> + </div> : null + } + </span> : null } </div> <Icon className="edit" type="edit" onClick={edit} /> <Icon className="edit close" type="close" onClick={del} /> - {type === 'action' && <Icon className="edit copy" type="copy" onClick={copy} />} + {type === 'action' ? <Icon className="edit copy" type="copy" onClick={copy} /> : null} </div> ) } diff --git a/src/templates/comtableconfig/dragelement/index.jsx b/src/templates/comtableconfig/dragelement/index.jsx index a0a26d7..7c00ea3 100644 --- a/src/templates/comtableconfig/dragelement/index.jsx +++ b/src/templates/comtableconfig/dragelement/index.jsx @@ -15,7 +15,6 @@ const _cards = update(cards, { $splice: [[index, 1], [atIndex, 0, card]] }) setCards(_cards) handleList(type, _cards) - // handleList({[type]: _cards}) } const findCard = id => { @@ -105,6 +104,11 @@ newcard.callbackFunc = '' newcard.pageTemplate = '' newcard.url = '' + + if (item.subType === 'excelIn' || item.subType === 'excelOut') { + // 瀵煎叆鍜屽鍑篹xcel锛屾寜閽悕绉扮洿鎺ヤ负瀵煎叆銆佸鍑� + newcard.label = item.label + } } else if (item.type === 'columns') { newcard.uuid = Utils.getuuid() newcard.Align = 'left' diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index cec7cb8..8bf970a 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -32,6 +32,7 @@ static propTpyes = { type: PropTypes.string, menu: PropTypes.any, + reloadmenu: PropTypes.func, handleConfig: PropTypes.func, handleSubConfig: PropTypes.func, supMenuList: PropTypes.array @@ -949,13 +950,17 @@ if (this.state.formtemp !== 'gridbtn') { this.formRef.handleConfirm().then(res => { let isupdate = false - + if (res.type === 'search') { if ((res.values.type === 'select' || res.values.type === 'link') && res.values.resourceType === '1') { - let sql = 'select ' + res.values.valueField + ',' + res.values.valueText + ' from (' + res.values.dataSource + ')' - if (res.values.orderBy) { - sql = sql + ' ld order by ' + res.values.orderBy + ' ' + res.values.orderType + let sql = 'select ' + res.values.valueField + ',' + res.values.valueText + ' from ' + res.values.dataSource + if (res.values.type === 'link') { + sql = 'select ' + res.values.valueField + ',' + res.values.valueText + ',' + res.values.linkField + ' from ' + res.values.dataSource } + if (res.values.orderBy) { + sql = sql + ' order by ' + res.values.orderBy + ' ' + res.values.orderType + } + res.values.dataSourceSql = Utils.formatOptions(sql) } } @@ -1058,6 +1063,7 @@ * @description 鍒涘缓鎸夐挳瀛樺偍杩囩▼ */ creatFunc = () => { + const { menu } = this.props let _config = JSON.parse(JSON.stringify(this.state.config)) this.formRef.handleConfirm().then(res => { @@ -1115,11 +1121,11 @@ funcName: btn.innerFunc, name: _config.setting.tableName || '', fields: fields, - menuNo: this.props.menu.MenuNo + menuNo: menu.MenuNo } - newLText = Utils.formatOptions(Utils.getfunc(_param)) + newLText = Utils.formatOptions(Utils.getfunc(_param, btn, menu, _config.columns)) DelText = Utils.formatOptions(Utils.dropfunc(_param.funcName)) - resolve(true) + resolve(false) } else { resolve(false) notification.warning({ @@ -1134,15 +1140,14 @@ funcName: btn.innerFunc, name: _config.setting.tableName || '', fields: '', - menuNo: this.props.menu.MenuNo + menuNo: menu.MenuNo } - newLText = Utils.formatOptions(Utils.getfunc(_param)) + newLText = Utils.formatOptions(Utils.getfunc(_param, btn, menu, _config.columns)) DelText = Utils.formatOptions(Utils.dropfunc(_param.funcName)) - resolve(true) + resolve(false) } }).then(res => { // 鑾峰彇浜戠鍙婃湰鍦帮紝鏄惁宸插瓨鍦ㄨ瀛樺偍杩囩▼鐨勪俊鎭� - console.log(res) if (res === false) return res let sysDefer = new Promise(resolve => { @@ -1170,7 +1175,6 @@ return Promise.all([sysDefer, localDefer]) }).then(res => { // 浜戠缁撴灉涓庢柊璇彞涓嶅悓鏃讹紝鏇存柊浜戠淇℃伅 - console.log(res) if (res === false) return res let isError = false @@ -1186,7 +1190,6 @@ } else if (index === 0) { sysTVPText = result.TVPText } else { - console.log(result.Ltext) if (result.Ltext) { // 鏈湴瀛樺偍杩囩▼鏄惁瀛樺湪 isExit = true } @@ -1231,7 +1234,6 @@ } }).then(res => { // 浜戠淇℃伅鏇存柊鍚庯紝鍒ゆ柇鏄垹闄ゆ垨鏄洿鎺ユ柊寤哄瓨鍌ㄨ繃绋� - console.log(res) if (res === false || res === 'drop') return res if (!res.status) { @@ -1248,7 +1250,6 @@ } }).then(res => { // 鍒犻櫎瀛樺偍杩囩▼ - console.log(res) if (res === false || res === 'create') return res let _param = { @@ -1263,7 +1264,6 @@ return Api.getLocalConfig(_param) }).then(res => { // 鏍规嵁涓婅堪鎿嶄綔缁撴灉锛屽垽鏂槸鍚︽柊寤哄瓨鍌ㄨ繃绋� - console.log(res) if (res === false || res === 'create') return res if (!res.status) { @@ -1278,7 +1278,6 @@ } }).then(res => { // 鏂板缓瀛樺偍杩囩▼ - console.log(res) if (res === false) return res let _param = { @@ -1292,7 +1291,6 @@ return Api.getLocalConfig(_param) }).then(res => { // 澶勭悊鏂板缓缁撴灉 - console.log(res) if (res === false) return res if (!res.status) { @@ -1312,7 +1310,6 @@ } }).then(res => { // 鏂板缓鎴愬姛鍚庯紝鏇存柊椤甸潰鎸夐挳淇℃伅 - console.log(res) if (res === false) { this.setState({ funcLoading: false @@ -1505,6 +1502,8 @@ columnsloading: false }) }) + + this.props.reloadmenu() this.submitAction(btnParam) } else { @@ -1535,65 +1534,65 @@ const { config } = this.state new Promise(resolve => { // 鍐呴儴璇锋眰 - if (param.LText) { - Api.getSystemConfig(param).then(response => { - if (response.status) { - resolve('true') - } else { - resolve(response) - } - }) - } else { - resolve('true') - } - }).then(res => { - console.log(res) - if (res === 'true' && this.state.delActions.length > 0) { + if (this.state.delActions.length > 0) { let deffers = this.state.delActions.map(item => { - let param = { + let _param = { func: 'sPC_MainMenu_Del', MenuID: item } return new Promise(resolve => { - Api.getSystemConfig(param).then(res => { + Api.getSystemConfig(_param).then(res => { resolve(res) }) }) }) - return Promise.all(deffers) - } else if (res === 'true' && this.state.delActions.length === 0) { + Promise.all(deffers).then(result => { + let error = false + result.forEach(res => { + if (!res.status) { + error = res + } + }) + + if (error) { + notification.warning({ + top: 92, + message: error.message, + duration: 10 + }) + resolve(false) + } else { + this.setState({ + delActions: [] + }) + resolve(param) + } + }) + } else if (this.state.delActions.length === 0) { + resolve(param) + } + }).then(res => { + if (res === false) return res + + if (res.LText) { + return Api.getSystemConfig(res) + } else { return 'copy' - } else if (!res.status) { + } + }).then(response => { + if (response === false || response === 'copy') return response + + if (response.status) { + return 'copy' + } else { notification.warning({ top: 92, - message: res.message, + message: response.message, duration: 10 }) return false } }).then(response => { - console.log(response) - if (response === false || response === 'copy') return response - - let res = 'copy' - if (Array.isArray(response)) { - response.forEach(result => { - if (!result.status) { - res = result - } - }) - } - - if (res === 'copy') return 'copy' - - notification.warning({ - top: 92, - message: res.message, - duration: 10 - }) - return false - }).then(response => { - console.log(response) if (response === false) return response let oriActions = [] @@ -1604,7 +1603,7 @@ oriActions.push({ prebtn: item.prebtn, - curBtn: item.curBtn + curBtn: curBtn }) }) @@ -1645,7 +1644,6 @@ }) return 'true' }).then(response => { - console.log(response) if (response === 'true') { notification.success({ top: 92, @@ -1992,8 +1990,29 @@ } settingSave = () => { + const { menu } = this.props const {config} = this.state + this.settingRef.handleConfirm().then(res => { + if ( + res.interType === 'inner' && + !res.innerFunc && + res.dataresource.length > 50 && + config.setting.dataresource !== res.dataresource + ) { + let param = { + func: 's_DataSrc_Save', + LText: res.dataresource, + MenuID: menu.MenuID + } + + 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) + + Api.getLocalConfig(param) + } + this.setState({ config: {...config, setting: res}, settingVisible: false, @@ -2069,7 +2088,6 @@ _LongParam = '' } } - console.log(_LongParam) this.props.handleSubConfig(btn, originMenu, _LongParam) } else { this.setState({ @@ -2370,6 +2388,7 @@ destroyOnClose > <SettingForm + menu={this.props.menu} data={this.state.config.setting} columns={this.state.config.columns} dict={this.state.dict} diff --git a/src/templates/comtableconfig/searchform/index.jsx b/src/templates/comtableconfig/searchform/index.jsx index 94f3db4..e92df3c 100644 --- a/src/templates/comtableconfig/searchform/index.jsx +++ b/src/templates/comtableconfig/searchform/index.jsx @@ -57,8 +57,10 @@ form.options = matchReg.text } else if (type === 'select' || type === 'link') { form.options = matchReg.select - } else if (type === 'date' || type === 'datemonth') { + } else if (type === 'date') { form.options = matchReg.date + } else if (type === 'datemonth') { + form.options = matchReg.datemonth } else if (type === 'dateweek' || type === 'daterange') { form.options = matchReg.daterange } @@ -87,7 +89,7 @@ if (value === 'link') { _options = [..._options, 'linkField'] } - + console.log(value) this.setState({ openType: value, formlist: this.state.formlist.map(form => { @@ -107,8 +109,10 @@ form.options = matchReg.text } else if (value === 'select' || value === 'link') { form.options = matchReg.select - } else if (value === 'date' || value === 'datemonth') { + } else if (value === 'date') { form.options = matchReg.date + } else if (value === 'datemonth') { + form.options = matchReg.datemonth } else if (value === 'dateweek' || value === 'daterange') { form.options = matchReg.daterange } diff --git a/src/templates/comtableconfig/settingform/index.jsx b/src/templates/comtableconfig/settingform/index.jsx index ff83ed6..9b0ab62 100644 --- a/src/templates/comtableconfig/settingform/index.jsx +++ b/src/templates/comtableconfig/settingform/index.jsx @@ -8,6 +8,7 @@ class SettingForm extends Component { static propTpyes = { dict: PropTypes.object, // 瀛楀吀椤� + menu: PropTypes.object, data: PropTypes.object, columns: PropTypes.array } @@ -45,7 +46,7 @@ } render() { - const { data, dict } = this.props + const { data, dict, menu } = this.props const { getFieldDecorator } = this.props.form const { interType } = this.state @@ -67,6 +68,7 @@ primaryKey = '' } } + console.log(menu) return ( <Form {...formItemLayout} className="ant-advanced-search-form commontable-setting-form" id="commontable-setting-form"> @@ -138,8 +140,8 @@ })(<Input placeholder="" autoComplete="off" />)} </Form.Item> </Col> : null} - <Col span={24}> - <Form.Item label={ + {interType !== 'outer' ? <Col span={24}> + <Form.Item help={'鏁版嵁ID锛�' + menu.MenuID} label={ <Tooltip placement="topLeft" title="浣跨敤绯荤粺鍑芥暟鏃讹紝闇�濉啓鏁版嵁婧愶紝鑷畾涔夊嚱鏁版椂锛屽彲蹇界暐銆�"> <Icon type="question-circle" /> {'鏁版嵁婧�'} @@ -149,7 +151,7 @@ initialValue: data.dataresource })(<TextArea rows={4} />)} </Form.Item> - </Col> + </Col> : null} <Col span={12}> <Form.Item label="鍥哄畾鎸夐挳"> {getFieldDecorator('actionfixed', { diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx index 4d376e7..3f81e65 100644 --- a/src/templates/modalconfig/index.jsx +++ b/src/templates/modalconfig/index.jsx @@ -495,7 +495,7 @@ if (res.orderBy) { sql = sql + ' order by ' + res.orderBy + ' ' + res.orderType } - console.log(sql) + res.dataSourceSql = Utils.formatOptions(sql) } @@ -1210,8 +1210,8 @@ destroyOnClose > <SettingForm - data={config.setting} dict={this.state.dict} + config={config} wrappedComponentRef={(inst) => this.settingRef = inst} /> </Modal> diff --git a/src/templates/modalconfig/index.scss b/src/templates/modalconfig/index.scss index 7d93103..a40f2e0 100644 --- a/src/templates/modalconfig/index.scss +++ b/src/templates/modalconfig/index.scss @@ -247,14 +247,14 @@ } .edit { position: absolute; - left: 0; + left: calc(33% - 100px); top: 0px; color: #1890ff; cursor: pointer; display: none; } .edit.close { - left: 20px; + left: calc(33% - 75px); color: #ff4d4f; } } diff --git a/src/templates/modalconfig/settingform/index.jsx b/src/templates/modalconfig/settingform/index.jsx index 8af9ea6..24cfb22 100644 --- a/src/templates/modalconfig/settingform/index.jsx +++ b/src/templates/modalconfig/settingform/index.jsx @@ -1,12 +1,41 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Radio, InputNumber } from 'antd' +import { Form, Row, Col, Input, Radio, InputNumber, Select } from 'antd' import './index.scss' class SettingForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� - data: PropTypes.object + dict: PropTypes.object, // 瀛楀吀椤� + config: PropTypes.object // 琛ㄥ崟閰嶇疆淇℃伅 + } + + state = { + fields: null + } + + UNSAFE_componentWillMount () { + const { config } = this.props + let fields = [] + + if (config.groups.length > 0) { + config.groups.forEach(group => { + group.sublist.forEach(item => { + if (item.field && (item.type === 'text' || item.type === 'number')) { + fields.push(item) + } + }) + }) + } else if (config.fields.length > 0) { + config.fields.forEach(f => { + if (f.field && (f.type === 'text' || f.type === 'number')) { + fields.push(f) + } + }) + } + console.log(fields) + this.setState({ + fields: fields + }) } handleConfirm = () => { @@ -23,7 +52,8 @@ } render() { - const { data } = this.props + const { config, dict } = this.props + const { fields } = this.state const { getFieldDecorator } = this.props.form const formItemLayout = { @@ -36,27 +66,73 @@ sm: { span: 16 } } } + return ( <Form {...formItemLayout} className="ant-advanced-search-form modal-setting-form"> <Row gutter={24}> <Col span={12}> <Form.Item label="鏍囬"> {getFieldDecorator('title', { - initialValue: data.title + initialValue: config.setting.title })(<Input placeholder="" autoComplete="off"/>)} </Form.Item> </Col> <Col span={12}> <Form.Item label="瀹藉害"> {getFieldDecorator('width', { - initialValue: data.width - })(<InputNumber min={30} max={90} precision={0} />)} + initialValue: config.setting.width + })(<InputNumber min={10} max={90} precision={0} />)} + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label="鐒︾偣"> + {getFieldDecorator('focus', { + initialValue: config.setting.focus || '' + })( + <Select + showSearch + filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} + > + <Select.Option value=""> + {dict['header.form.empty']} + </Select.Option> + {fields.map(option => + <Select.Option id={option.uuid} title={option.label} key={option.uuid} value={option.field}> + {option.label} + </Select.Option> + )} + </Select> + )} + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label="瀹屾垚鍚�"> + {getFieldDecorator('finish', { + initialValue: config.setting.finish || 'close' + })( + <Radio.Group> + <Radio value="close">鍏抽棴</Radio> + <Radio value="unclose">涓嶅叧闂�</Radio> + </Radio.Group> + )} + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label="鐐瑰嚮绌虹櫧澶�"> + {getFieldDecorator('clickouter', { + initialValue: config.setting.clickouter || 'unclose' + })( + <Radio.Group> + <Radio value="close">鍏抽棴</Radio> + <Radio value="unclose">涓嶅叧闂�</Radio> + </Radio.Group> + )} </Form.Item> </Col> <Col span={12}> <Form.Item label="鍒楁暟"> {getFieldDecorator('cols', { - initialValue: data.cols + initialValue: config.setting.cols })( <Radio.Group> <Radio value="1">1鍒�</Radio> @@ -69,7 +145,7 @@ <Col span={12}> <Form.Item label="鎸傝浇瀵硅薄"> {getFieldDecorator('container', { - initialValue: data.container || 'view' + initialValue: config.setting.container || 'view' })( <Radio.Group> <Radio value="view">椤甸潰</Radio> diff --git a/src/templates/modalconfig/source.jsx b/src/templates/modalconfig/source.jsx index 42d37ef..38fda2d 100644 --- a/src/templates/modalconfig/source.jsx +++ b/src/templates/modalconfig/source.jsx @@ -11,7 +11,10 @@ title: '', width: 60, cols: '2', - container: 'view' + container: 'view', + focus: '', + finish: 'close', + clickouter: 'unclose' }, tables: [], groups: [], diff --git a/src/utils/option.js b/src/utils/option.js index 96301ce..b97f0eb 100644 --- a/src/utils/option.js +++ b/src/utils/option.js @@ -28,11 +28,14 @@ ], daterange: [ {value: '', text: _dict['date.empty']}, - {value: '0', text: '浠婂ぉ'}, - {value: 1, text: '鏄ㄥぉ'}, - {value: 3, text: '鍓嶄笁澶�'}, - {value: 7, text: '鍓嶄竷澶�'}, - {value: 30, text: '鍓�30澶�'} + {value: '[0, 0]', text: '浠婂ぉ'}, + {value: '[1, 1]', text: '鏄ㄥぉ'}, + {value: '[3, 0]', text: '杩戜笁澶�'}, + {value: '[7, 0]', text: '杩戜竷澶�'}, + {value: '[30, 0]', text: '杩�30澶�'}, + {value: '[7, -7]', text: '鍓嶅悗涓冨ぉ'}, + {value: '[30, -30]', text: '鍓嶅悗30澶�'}, + {value: '[90, -90]', text: '鍓嶅悗90澶�'} ], datetime: [ {value: '', text: _dict['date.empty']}, @@ -71,6 +74,13 @@ }, { value: '<=', text: '<=' + }, { + value: '=', + text: '=' + }], + datemonth: [{ + value: 'between', + text: 'between' }], daterange: [{ value: 'between', diff --git a/src/utils/utils.js b/src/utils/utils.js index 62df4d8..840f7b1 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -223,7 +223,7 @@ } /** - * @description 鎷兼帴鎼滅储鏉′欢 + * @description 鎷兼帴鎼滅储鏉′欢main * @param {Array} searches 鎼滅储鏉′欢 * @return {String} searchText 鎷兼帴缁撴灉 */ @@ -244,12 +244,17 @@ let timetail = ' 00:00:00.000' if (item.match === '<' || item.match === '<=') { timetail = ' 23:59:59.999' + } else if (item.match === '=') { + timetail = '' } // eslint-disable-next-line searchText += '(' + item.key + ' ' + item.match + ' ' + '\'' + item.value + timetail + '\')' } else if (item.type === 'datemonth') { + // 鏈�-杩囨护鏉′欢锛屼粠鏈堝紑濮嬭嚦缁撴潫 + let _startval = moment(item.value, 'YYYY-MM').startOf('month').format('YYYY-MM-DD') + ' 00:00:00.000' + let _endval = moment(item.value, 'YYYY-MM').endOf('month').format('YYYY-MM-DD') + ' 23:59:59.999' // eslint-disable-next-line - searchText += '(' + item.key + ' ' + item.match + ' ' + '\'' + item.value + '\')' + searchText += '(' + item.key + ' ' + item.match + ' ' + '\'' + _startval + '\' AND \'' + _endval + '\')' } else if (item.type === 'dateweek') { let stimetail = ' 00:00:00.000' let etimetail = ' 23:59:59.999' @@ -269,7 +274,7 @@ } /** - * @description 鎷兼帴鎼滅储鏉′欢 + * @description 鎷兼帴鎼滅储鏉′欢datamanage * @param {Array} searches 鎼滅储鏉′欢 * @return {String} searchText 鎷兼帴缁撴灉 */ @@ -323,8 +328,6 @@ * @return {String} table 琛ㄥ悕 */ static getSysDefaultSql (btn, setting, formdata) { - console.log(btn) - console.log(formdata) let _sql = '' if (btn.OpenType === 'pop' && btn.sqlType === 'insert') { let keys = [] @@ -358,14 +361,6 @@ } else if ((btn.OpenType === 'prompt' || btn.OpenType === 'exec') && btn.sqlType === 'delete') { _sql = `insert into snote (remark,createuserid) select '鍒犻櫎琛�:${btn.sql} 鏁版嵁: id='+@id,@userid delete ${btn.sql} where ${setting.primaryKey}=@id` } - //insert into 琛ㄥ悕 (琛ㄥ崟瀛楁锛岄�楀彿鍒嗛殧锛屽鏋滀富閿负鍙紪杈戝垯浼犲~鍐欏唴瀹癸紝鍙鎴栨病鏈夐厤缃〃鍗曪紝鍒欎紶鍓嶇鐢熸垚id,+createuserid) - // +select 琛ㄥ崟瀛楁鍊�+@userid - - // 淇敼锛歶pdate 琛ㄥ悕 set 琛ㄥ崟闈炲彧璇诲瓧娈�=琛ㄥ崟鍊硷紝modifydate=getdate(),modifyuserid=@userid where 涓婚敭=@id琛宨d - - // 閫昏緫鍒犻櫎:update 琛ㄥ悕 set deleted=1锛宮odifydate=getdate(),modifyuserid=@userid where 涓婚敭=@id琛宨d - - // 鐗╃悊鍒犻櫎锛歩nsert into snote (remark,createuserid) select '鍒犻櫎琛� '+琛ㄥ悕+'鏁版嵁 '+id=@id delete 琛ㄥ悕 where 涓婚敭=@id琛宨d console.log(_sql) return _sql } @@ -382,10 +377,11 @@ * @description 鍒涘缓瀛樺偍杩囩▼ * @return {String} */ - static getfunc (param) { + static getfunc (param, btn, menu, columns) { let form = '' let formParam = '' - + console.log(menu) + console.log(columns) if (param.fields && param.fields.length > 0) { let _fields = [] param.fields.forEach(item => { @@ -420,8 +416,33 @@ ` } + if (columns) { + let _col = [] + let _field = [] + columns.forEach(col => { + if (col.field) { + if (col.type === 'number') { + _col.push(col.field + ' decimal(18,2)') + } else { + _col.push(col.field + ' nvarchar(50)') + } + _field.push(col.field) + } + }) + _col = _col.join(',') + _field = _field.join(',') + + form = form + ` + declare @dc table (${_col}) + + insert into @dc (${_field}) + + @tableid ='${menu.MenuID}' + ` + } + let Ltext = `create proc ${param.funcName} - ( + ( /*${menu.MenuName} ${btn.label}*/ @BID nvarchar(50)='', @ID nvarchar(50)='',${formParam} @sEPTMenuNo nvarchar(50)='${param.menuNo}', @@ -490,8 +511,9 @@ ROLLBACK TRAN END` - Ltext = Ltext.replace(/\n\s{4}/ig, 'mchr13k') console.log(Ltext) + Ltext = Ltext.replace(/\n\s{4}/ig, 'mchr13k') + return Ltext } } \ No newline at end of file -- Gitblit v1.8.0