Merge branch 'master' into positec
| | |
| | | "display": "standalone", |
| | | "theme_color": "#000000", |
| | | "background_color": "#ffffff", |
| | | "mk_version": "20240910" |
| | | "mk_version": "20241002" |
| | | } |
| | |
| | | card.name = card.wrap.name |
| | | |
| | | card.errors = [] |
| | | card.$tables = [] |
| | | |
| | | if (card.wrap.datatype !== 'static') { |
| | | if (card.wrap.datatype === 'dynamic') { |
| | | card.$c_ds = true |
| | | card.errors = checkComponent(card) |
| | | |
| | |
| | | </Radio.Group> : null} |
| | | {url && type === 'video' ? <div className="mk-source-item-info"> |
| | | <PaperClipOutlined /> |
| | | <a target="_blank" rel="noopener noreferrer" href={url}>{name}</a> |
| | | <a target="_blank" rel="noopener noreferrer" href={url.replace(/@mywebsite@\//ig, window.GLOB.baseurl)}>{name}</a> |
| | | <DeleteOutlined title="删除文件" onClick={this.deleteUrl}/> |
| | | </div> : null} |
| | | {url && type !== 'video' && url !== '@icon@' ? <div className="mk-source-item-info picture"> |
| | | <img src={url.replace(/@mywebsite@\//ig, window.GLOB.baseurl)} alt="" /> |
| | | <a target="_blank" rel="noopener noreferrer" href={url}>{name}</a> |
| | | <a target="_blank" rel="noopener noreferrer" href={url.replace(/@mywebsite@\//ig, window.GLOB.baseurl)}>{name}</a> |
| | | <DeleteOutlined title="删除文件" onClick={this.deleteUrl}/> |
| | | </div> : null} |
| | | {url && type !== 'video' && url === '@icon@' ? <div className="mk-source-item-info avatar"> |
| | |
| | | } |
| | | |
| | | render() { |
| | | return (<DownloadOutlined className="columns-out" onClick={this.actionTrigger}/>) |
| | | return (<DownloadOutlined className="columns-out" title="下载" onClick={this.actionTrigger}/>) |
| | | } |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | tolowercase = (type) => { |
| | | const that = this |
| | | confirm({ |
| | | content: type === 'sub' ? '确定将子表字段转为小写吗?' : '确定将字段转为小写吗?', |
| | | onOk() { |
| | | that.execlowercase(type) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | execlowercase = (type) => { |
| | | const { subColumns, columns } = this.state |
| | | |
| | | if (type === 'sub') { |
| | | this.setState({subColumns: fromJS(subColumns).toJS().map(col => { |
| | | col.field = col.field.toLowerCase() |
| | | return col |
| | | })}) |
| | | } else { |
| | | this.setState({columns: fromJS(columns).toJS().map(col => { |
| | | col.field = col.field.toLowerCase() |
| | | return col |
| | | })}) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | |
| | | type="fields" |
| | | updatefield={this.updatefields} |
| | | /> |
| | | <SwapOutlined className="columns-lowercase" title="转小写" onClick={() => this.tolowercase()}/> |
| | | <ExcelOut data={columns} setting={setting}/> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} searchKey={searchKey} type="datasourcefield" wrappedComponentRef={(inst) => this.datasource = inst} data={columns} columns={colColumns} onChange={(columns) => this.setState({columns})}/> |
| | | </TabPane> : <TabPane tab={ |
| | |
| | | type="fields" |
| | | updatefield={this.updateSubfields} |
| | | /> |
| | | <SwapOutlined className="columns-lowercase" title="转小写" onClick={() => this.tolowercase('sub')}/> |
| | | <ExcelOut data={subColumns} setting={setting}/> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} searchKey={searchKey} type="datasourcefield" wrappedComponentRef={(inst) => this.subdatasource = inst} data={subColumns} columns={colColumns} onChange={(subColumns) => this.setState({subColumns})}/> |
| | | </TabPane> : null} |
| | |
| | | margin-right: 5px; |
| | | cursor: pointer; |
| | | } |
| | | .columns-lowercase { |
| | | float: right; |
| | | position: relative; |
| | | z-index: 2; |
| | | right: 30px; |
| | | height: 0px; |
| | | top: -15px; |
| | | color: orange; |
| | | cursor: pointer; |
| | | } |
| | | .columns-out { |
| | | float: right; |
| | | position: relative; |
| | |
| | | .ant-table-thead { |
| | | .copy-control { |
| | | top: -18px; |
| | | right: 30px; |
| | | right: 55px; |
| | | .anticon-copy { |
| | | margin-right: 12px; |
| | | } |
| | |
| | | // SELECT @appkey@,'sPC_Get_TableData',1,@menuname@,@UserID@,@username@,@fullname@,@SessionUid@,@LoginUID@ |
| | | let sql = '' |
| | | |
| | | if (item.setting.transact === 'true') { |
| | | if (item.setting.transact === 'true' && !/BEGIN\s+TRY\s+begin\s+TRAN/.test(_customScript)) { |
| | | sql = `/* ${item.setting.$name} */ |
| | | BEGIN TRY |
| | | begin TRAN |
| | |
| | | arr_field='${arr_field}',tabid='${tabid}',parid='${parid}',sub_name='${sub_name}',sub_field='${sub_field}' |
| | | ` |
| | | |
| | | let e_sql = `select ${_columns.map(col => col.field).join(',')} from (select ${_columns.map(col => /date/ig.test(col.datatype) ? `'1949-10-01' as ${col.field}` : `'0' as ${col.field}`).join(',')}) a where ${item.setting.primaryKey || 'ID'} != '0'` |
| | | if (DateCount) { |
| | | e_sql += ` |
| | | select 0 as total |
| | | ` |
| | | } |
| | | |
| | | _tailScript = `${_tailScript} |
| | | select @ErrorCode as ErrorCode,@retmsg as retmsg |
| | | ${callback} |
| | | |
| | | COMMIT TRAN |
| | | set NOCOUNT ON |
| | | RETURN |
| | | END TRY |
| | | BEGIN CATCH |
| | | ROLLBACK TRAN |
| | | DECLARE @ErrorMessage NVARCHAR(4000); |
| | | DECLARE @ErrorSeverity INT; |
| | | DECLARE @ErrorState INT; |
| | | |
| | | set @ErrorCode=cast(ERROR_NUMBER() as nvarchar(50)) |
| | | set @retmsg=ERROR_MESSAGE(); |
| | | select @ErrorMessage=ERROR_MESSAGE(), @ErrorSeverity=ERROR_SEVERITY(), @ErrorState=ERROR_STATE(); |
| | | |
| | | RAISERROR(@ErrorMessage, @ErrorSeverity, @ErrorState); |
| | | END CATCH |
| | | |
| | | aaa: |
| | | ${e_sql} |
| | | select @ErrorCode as ErrorCode,@retmsg as retmsg |
| | | GOTO_RETURN: |
| | | ROLLBACK TRAN |
| | | ` |
| | | } else { |
| | | sql = `/* ${item.setting.$name} */ |
| | |
| | | } |
| | | } |
| | | |
| | | if (this.state.config.printPage === 'custom' && this.state.config.printScripts) { |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('components', 'pages', 'notification', this.state.config.printScripts) |
| | | func(comps, pages, notification) |
| | | } catch (e) { |
| | | console.warn(e) |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '自定义脚本执行错误!', |
| | | duration: 5 |
| | | }) |
| | | } |
| | | } else { |
| | | while (!over) { |
| | | let page = [] |
| | | let count = 0 |
| | |
| | | over = true |
| | | } |
| | | } |
| | | } |
| | | |
| | | let total = pages.length |
| | | let date = moment().format('YYYY-MM-DD') |
| | |
| | | <StyleCombControlButton menu={config} /> |
| | | <PasteController insert={this.insert} /> |
| | | {config ? <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config.enabled} onChange={this.onEnabledChange} /> : null} |
| | | <Button type="primary" id="save-config" className={needUpdate ? 'update-tip' : ''} onClick={this.submitConfig} loading={menuloading}>保存</Button> |
| | | <Button type="primary" id="save-config" disabled={!config} className={needUpdate ? 'update-tip' : ''} onClick={this.submitConfig} loading={menuloading}>保存</Button> |
| | | <Button type="default" disabled={menuloading} onClick={this.closeView}>关闭</Button> |
| | | </div> |
| | | } style={{ width: '100%' }}> |
| | |
| | | top: calc(50vh - 70px); |
| | | z-index: 10; |
| | | } |
| | | .mini-radio { |
| | | white-space: nowrap; |
| | | span.ant-radio + * { |
| | | padding-right: 0px; |
| | | padding-left: 4px; |
| | | } |
| | | } |
| | | .mk-hidden { |
| | | text-decoration: line-through!important; |
| | | span { |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, InputNumber, Select, Radio, Tooltip, Input } from 'antd' |
| | | import { Form, Row, Col, InputNumber, Select, Radio, Tooltip, Input, Modal } from 'antd' |
| | | import { QuestionCircleOutlined, EditOutlined } from '@ant-design/icons' |
| | | |
| | | import CodeMirror from '@/templates/zshare/codemirror' |
| | | // import './index.scss' |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.object, |
| | | updateConfig: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | | visible: false, |
| | | printScripts: '' |
| | | } |
| | | |
| | | selectChange = (key, value) => { |
| | |
| | | }) |
| | | } |
| | | |
| | | onScriptChange = (val) => { |
| | | this.setState({printScripts: val}) |
| | | } |
| | | |
| | | submit = () => { |
| | | const { config } = this.props |
| | | const { printScripts } = this.state |
| | | |
| | | this.setState({visible: false}) |
| | | this.props.updateConfig({...config, printScripts}) |
| | | } |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { visible, printScripts } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | } |
| | | |
| | | return ( |
| | | <> |
| | | <Form {...formItemLayout}> |
| | | <Row> |
| | | <Col span={24}> |
| | |
| | | {getFieldDecorator('printPage', { |
| | | initialValue: config.printPage || 'auto' |
| | | })( |
| | | <Radio.Group onChange={(e) => this.selectChange('printPage', e.target.value)}> |
| | | <Radio.Group className="mini-radio" onChange={(e) => this.selectChange('printPage', e.target.value)}> |
| | | <Radio value="auto">自适应</Radio> |
| | | <Radio value="page">分页</Radio> |
| | | <Radio value="custom">自定义</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {config.printPage === 'custom' ? <Col span={24}> |
| | | <Form.Item label="自定义脚本"> |
| | | <EditOutlined style={{color: '#1890ff'}} onClick={() => this.setState({visible: true, printScripts: config.printScripts || ''})} /> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {config.printPage === 'page' ? <Col span={24}> |
| | | <Form.Item label="每页数(条)"> |
| | | {getFieldDecorator('everyPCount', { |
| | |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | <Modal |
| | | title="自定义脚本" |
| | | wrapClassName="normal-css-modal" |
| | | visible={visible} |
| | | width={800} |
| | | maskClosable={false} |
| | | onOk={this.submit} |
| | | onCancel={() => { this.setState({ visible: false })}} |
| | | destroyOnClose |
| | | > |
| | | <CodeMirror mode="text/javascript" theme="cobalt" value={printScripts} onChange={this.onScriptChange} /> |
| | | </Modal> |
| | | </> |
| | | ) |
| | | } |
| | | } |
| | |
| | | {!controlshow ? <DoubleLeftOutlined onClick={() => {this.setState({controlshow: true})}}/> : null} |
| | | </div> |
| | | <div className="wrap"> |
| | | <Button type="primary" className={needUpdate ? 'update-tip' : ''} onClick={this.submitConfig} id="save-config" loading={menuloading}>保存</Button> |
| | | <Button type="primary" className={needUpdate ? 'update-tip' : ''} disabled={!config} onClick={this.submitConfig} id="save-config" loading={menuloading}>保存</Button> |
| | | {config ? <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config.enabled} onChange={this.onEnabledChange} /> : null} |
| | | <ArrowLeftOutlined title="后退" className="back-view" onClick={this.backView}/> |
| | | {config ? <Debug config={config}/> : null} |
| | |
| | | {!controlshow ? <DoubleLeftOutlined onClick={() => {sessionStorage.setItem('controlshow', 'true'); this.setState({controlshow: true})}}/> : null} |
| | | </div> |
| | | <div className="wrap"> |
| | | <Button type="primary" className={needUpdate ? 'update-tip' : ''} id="save-config" onClick={this.submitConfig} loading={menuloading}>保存</Button> |
| | | <Button type="primary" className={needUpdate ? 'update-tip' : ''} disabled={!config} id="save-config" onClick={this.submitConfig} loading={menuloading}>保存</Button> |
| | | {config ? <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config.enabled} onChange={this.onEnabledChange} /> : null} |
| | | <ArrowLeftOutlined title="后退" className="back-view" onClick={this.backView}/> |
| | | {config ? <Debug config={config}/> : null} |
| | |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | <PasteBaseTable type="page" insert={this.insert}/> |
| | | {config ? <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config.enabled} onChange={this.onEnabledChange} /> : null} |
| | | <Button type="primary" id="save-config" onClick={this.submitConfig} loading={menuloading}>保存</Button> |
| | | <Button type="primary" id="save-config" disabled={!config} onClick={this.submitConfig} loading={menuloading}>保存</Button> |
| | | <Button type="default" disabled={menuloading} onClick={this.closeView}>关闭</Button> |
| | | </div> |
| | | } style={{ width: '100%' }}> |