From 9282e645d0205f85bf0d424a0b2f5c42c2aae1d9 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 21 五月 2025 11:40:32 +0800 Subject: [PATCH] 2025-05-21 --- src/menu/datasource/verifycard/settingform/index.jsx | 489 ++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 365 insertions(+), 124 deletions(-) diff --git a/src/menu/datasource/verifycard/settingform/index.jsx b/src/menu/datasource/verifycard/settingform/index.jsx index f0ff0c4..92b8896 100644 --- a/src/menu/datasource/verifycard/settingform/index.jsx +++ b/src/menu/datasource/verifycard/settingform/index.jsx @@ -1,23 +1,25 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { fromJS } from 'immutable' -import { Form, Row, Col, Input, Radio, Tooltip, notification, Select, InputNumber, Cascader } from 'antd' -import { QuestionCircleOutlined } from '@ant-design/icons' +import { Form, Row, Col, Input, Radio, Tooltip, notification, Select, InputNumber, Cascader, Modal, Button } from 'antd' +import { QuestionCircleOutlined, PlusOutlined } from '@ant-design/icons' import { formRule } from '@/utils/option.js' -import Utils from '@/utils/utils.js' import MenuUtils from '@/utils/utils-custom.js' +import { checkSQL } from '@/utils/utils-custom.js' import CodeMirror from '@/templates/zshare/codemirror' +import KeyInterface from '@/components/keyInterface' import './index.scss' const { TextArea } = Input class SettingForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� + updateStatus: PropTypes.func, + updateColumns: PropTypes.func, + addProcess: PropTypes.func, config: PropTypes.object, // 缁勪欢閰嶇疆 setting: PropTypes.object, // 鏁版嵁婧愰厤缃� - modules: PropTypes.array, // 鍙粦瀹氱殑涓婄骇缁勪欢 columns: PropTypes.array, // 鍒楄缃� scripts: PropTypes.array, // 鑷畾涔夎剼鏈� } @@ -27,13 +29,34 @@ modules: [], innerRules: [], innertip: '', - appType: sessionStorage.getItem('appType') + MenuType: sessionStorage.getItem('MenuType') || '', + ismain: false, + visible: false } UNSAFE_componentWillMount () { const { config, setting } = this.props - let modules = MenuUtils.getSupModules(window.GLOB.customMenu.components, config.uuid) || [] + let menu = window.GLOB.customMenu + let modules = [] + let ismain = false + + if (menu.Template === 'BaseTable') { + ismain = config.name === '涓昏〃' + } + + if (config.type === 'interface') { + menu.components.forEach(item => { + if (item.type === 'module' && item.subtype === 'account') { + modules.push({ + value: item.uuid, + label: item.name + }) + } + }) + } else { + modules = MenuUtils.getSupModules(menu.components, config.uuid, menu.interfaces) + } modules.unshift({ value: 'empty', @@ -70,65 +93,40 @@ _setting.supModule = setting.supModule || [] _setting.execute = setting.execute || 'true' - this.setState({modules, innerRules, innertip, setting: _setting}) + if (_setting.supModule.length > 0 && _setting.supModule[0] !== 'empty') { + let has = MenuUtils.checkSupModules(modules, _setting.supModule.slice(-1)[0]) + if (!has) { + _setting.supModule = [] + } + } + + this.setState({modules, innerRules, innertip, setting: _setting, ismain}) } handleConfirm = () => { - const { appType } = this.state + const { config } = this.props // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� return new Promise((resolve, reject) => { this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { values.sync = values.sync || 'false' - if (appType === 'mob' && values.useMSearch === 'true') { - values.syncRefresh = 'true' + if (['navbar', 'balcony', 'menubar', 'interface'].includes(config.type)) { + values.onload = 'true' + } + + if (values.interType === 'system' && values.onload === 'false') { + values.sync = 'false' + } + if (values.interType === 'system' && values.database === 'sso') { + values.sync = 'false' } // 鏁版嵁婧愬墠绔獙璇� if (values.interType === 'system' && values.execute !== 'false' && values.dataresource) { - let _quot = values.dataresource.match(/'{1}/g) - let _lparen = values.dataresource.match(/\({1}/g) - let _rparen = values.dataresource.match(/\){1}/g) + let pass = checkSQL(values.dataresource) - _quot = _quot ? _quot.length : 0 - _lparen = _lparen ? _lparen.length : 0 - _rparen = _rparen ? _rparen.length : 0 - - if (_quot % 2 !== 0) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑\'蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - reject() - return - } else if (_lparen !== _rparen) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑()蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - reject() - return - } else if (/--/ig.test(values.dataresource)) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜板瓧绗� -- 锛屾敞閲婅鐢� /*鍐呭*/', - duration: 5 - }) - reject() - return - } - - let error = Utils.verifySql(values.dataresource) - - if (error) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑涓嶅彲浣跨敤' + error, - duration: 5 - }) + if (!pass) { reject() return } @@ -151,12 +149,65 @@ if (key === 'sysInterface' && value === 'true') { this.props.form.setFieldsValue({interface: window.GLOB.mainSystemApi}) } + this.props.updateStatus(setting) + } + + addProcess = () => { + this.setState({visible: true}) + } + + execAddProcess = (type) => { + let _sql = this.props.form.getFieldValue('dataresource') + let tableName = this.props.form.getFieldValue('tableName') || '琛ㄥ悕' + + if (type === 'flowstart') { + _sql = _sql + `\n/* select a.*, w.remark as remark_w, w.statusname as statusname_w,w.status as status_w,w.works_flow_param,w.works_flow_detail_id,w.modifydate as modifydate_w from (select * from ${tableName} where status=0 and deleted=0 $@ and createuserid=@userid@ @$) a + inner join (select * from s_my_works_flow where works_flow_code=@works_flow_code@ and status=0 and deleted=0) w on a.id=w.works_flow_id */` + } else if (type === 'flowcheck') { + _sql = _sql + `\n/* select a.*, w.remark as remark_w, w.statusname as statusname_w,w.status as status_w,w.works_flow_param,w.works_flow_detail_id,w.modifydate as modifydate_w + from (select * from ${tableName} where status=0 and deleted=0 ) a + inner join (select * from s_my_works_flow where works_flow_code=@works_flow_code@ and status>0 and status<888 and deleted=0) w + on a.id=w.works_flow_id + $@ inner join (select works_flow_id from s_my_works_flow_role where userid=@userid@ and works_flow_code=@works_flow_code@ and deleted=0 ) r + on r.works_flow_id=w.works_flow_id @$ */` + } + + this.props.form.setFieldsValue({ + dataresource: _sql + }) + + this.setState({visible: false}) + + this.props.addProcess() + } + + addSql = () => { + let tableName = this.props.form.getFieldValue('tableName') + + if (!tableName) { + notification.warning({ + top: 92, + message: '璇锋坊鍔犺〃鍚嶃��', + duration: 5 + }) + return + } + + let _sql = this.props.form.getFieldValue('dataresource') + + if (/^\s*$/.test(_sql)) { + this.props.form.setFieldsValue({ + dataresource: `select * from ${tableName} where deleted=0` + }) + } + + this.props.updateColumns(tableName) } render() { - const { columns, config } = this.props + const { columns, config, hasMainSearch } = this.props const { getFieldDecorator } = this.props.form - const { setting, modules, innerRules, appType, innertip } = this.state + const { setting, modules, innerRules, innertip, MenuType, visible } = this.state const formItemLayout = { labelCol: { @@ -168,6 +219,7 @@ sm: { span: 16 } } } + let hasUp = !['balcony', 'menubar', 'commonbar', 'tabbar', 'invTable'].includes(config.subtype) && (!config.wrap || config.wrap.supType !== 'multi') && MenuType !== 'billPrint' return ( <div className="model-datasource-setting-form-box"> @@ -180,10 +232,10 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鏁版嵁婧愬悕绉�!' + message: '璇疯緭鍏ユ暟鎹簮鍚嶇О!' } ] - })(<Input placeholder={''} autoComplete="off" />)} + })(<Input placeholder="" autoComplete="off" />)} </Form.Item> </Col> : null} <Col span={8}> @@ -193,18 +245,22 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '琛ㄥ悕!' + message: '璇疯緭鍏ヨ〃鍚�!' }, { max: 50, message: '琛ㄥ悕鏈�闀夸负50涓瓧绗�!' }, { - pattern: /^[a-zA-Z_]+$/, - message: '琛ㄥ悕鍙彲浣跨敤瀛楁瘝浠ュ強_' + pattern: /^[a-zA-Z0-9@_]+$/, + message: '琛ㄥ悕鍙彲浣跨敤瀛楁瘝銆佹暟瀛椾互鍙奯' } ] - })(<Input placeholder={''} autoComplete="off" />)} + })( + setting.interType === 'system' && ((columns.length === 0 && config.subtype !== 'basetable') || !setting.dataresource) ? + <Input placeholder="" autoComplete="off" addonAfter={<PlusOutlined onClick={this.addSql} />}/> : + <Input placeholder="" autoComplete="off"/> + )} </Form.Item> </Col> <Col span={8}> @@ -214,7 +270,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '鎺ュ彛绫诲瀷!' + message: '璇烽�夋嫨鎺ュ彛绫诲瀷!' }, ] })( @@ -225,20 +281,27 @@ </Radio.Group>)} </Form.Item> </Col> - {setting.interType === 'outer' ? <Col span={8}> - <Form.Item label="绯荤粺鎺ュ彛"> + {setting.interType === 'outer' ? <Col span={8} className="compact"> + <Form.Item label={ + <Tooltip placement="topLeft" title="涓氬姟绯荤粺鎸囧悓涓�sso涓嬬殑鍏朵粬涓氬姟绯荤粺锛屽閮ㄧ郴缁熸寚涓嶅悓sso涓嬬殑鍏朵粬涓氬姟绯荤粺銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 绯荤粺绫诲瀷 + </Tooltip> + }> {getFieldDecorator('sysInterface', { initialValue: setting.sysInterface, rules: [ { required: true, - message: '璇烽�夋嫨鏄惁浣跨敤绯荤粺鎺ュ彛!' + message: '璇烽�夋嫨绯荤粺绫诲瀷!' } ] })( <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'sysInterface')}}> - <Radio value="true">鏄�</Radio> - <Radio value="false">鍚�</Radio> + <Radio value="false">涓氬姟</Radio> + <Radio value="true">鍗曠偣</Radio> + <Radio value="external">澶栭儴</Radio> + <Radio value="custom">鑷畾涔�</Radio> </Radio.Group>)} </Form.Item> </Col> : null} @@ -254,28 +317,41 @@ rules: [ { required: true, - message: this.props.dict['form.required.input'] + '鍐呴儴鍑芥暟!' + message: '璇疯緭鍏ュ唴閮ㄥ嚱鏁�!' }, ...innerRules ] })(<Input placeholder={''} autoComplete="off" />)} </Form.Item> </Col> : null} - {setting.interType === 'outer' ? <Col className="outer-interface" span={24}> + {setting.interType === 'outer' && setting.sysInterface !== 'external' ? <Col className="outer-interface" span={24}> <Form.Item label="鎺ュ彛鍦板潃"> {getFieldDecorator('interface', { initialValue: setting.interface || (setting.sysInterface === 'true' ? window.GLOB.mainSystemApi : ''), rules: [ { required: setting.sysInterface !== 'true' ? true : false, - message: this.props.dict['form.required.input'] + '鎺ュ彛鍦板潃!' + message: '璇疯緭鍏ユ帴鍙e湴鍧�!' } ] })(<TextArea rows={2} readOnly={setting.sysInterface === 'true'}/>)} </Form.Item> </Col> : null} - {setting.interType === 'outer' && setting.sysInterface !== 'true' ? <Col className="outer-interface" span={24}> - <Form.Item label={<Tooltip placement="topLeft" title="姝e紡绯荤粺鎺ュ彛鍦板潃锛屼负绌烘椂浣跨敤鎺ュ彛鍦板潃"> + {setting.interType === 'outer' && setting.sysInterface === 'external' ? <Col className="outer-interface" span={24}> + <Form.Item label="鎺ュ彛鍦板潃"> + {getFieldDecorator('exInterface', { + initialValue: setting.exInterface, + rules: [ + { + required: true, + message: '璇风紪杈戞帴鍙e湴鍧�!' + } + ] + })(<KeyInterface type="develop"/>)} + </Form.Item> + </Col> : null} + {setting.interType === 'outer' && (setting.sysInterface === 'false' || setting.sysInterface === 'custom') ? <Col className="outer-interface" span={24}> + <Form.Item label={<Tooltip placement="topLeft" title="姝e紡绯荤粺鎺ュ彛鍦板潃锛屼负绌烘椂浣跨敤鎺ュ彛鍦板潃銆�"> <QuestionCircleOutlined className="mk-form-tip" /> 姝e紡鍦板潃 </Tooltip> @@ -283,6 +359,29 @@ {getFieldDecorator('proInterface', { initialValue: setting.proInterface || '' })(<TextArea rows={2}/>)} + </Form.Item> + </Col> : null} + {setting.interType === 'outer' && setting.sysInterface === 'external' ? <Col className="outer-interface" span={24}> + <Form.Item label={<Tooltip placement="topLeft" title="姝e紡绯荤粺鎺ュ彛鍦板潃銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 姝e紡鍦板潃 + </Tooltip> + }> + {getFieldDecorator('exProInterface', { + initialValue: setting.exProInterface || '' + })(<KeyInterface type="product"/>)} + </Form.Item> + </Col> : null} + {setting.interType === 'outer' && setting.sysInterface === 'custom' ? <Col span={24} className="data-source" style={{paddingLeft: '7px'}}> + <Form.Item labelCol={{xs: { span: 24 }, sm: { span: 2 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 22 }} } label={ + <Tooltip placement="topLeft" title="澶栭儴鎺ュ彛鍏ュ弬鍙婂嚭鍙傜殑鑷畾涔夊鐞嗐��"> + <QuestionCircleOutlined className="mk-form-tip" /> + 鑷畾涔夎剼鏈� + </Tooltip> + }> + {getFieldDecorator('js_script', { + initialValue: setting.js_script || '' + })(<CodeMirror mode="text/javascript" theme="cobalt" />)} </Form.Item> </Col> : null} {setting.interType === 'outer' ? <Col span={8}> @@ -293,8 +392,9 @@ </Form.Item> </Col> : null} {setting.interType === 'system' ? <Col span={24} className="data-source" style={{paddingLeft: '7px'}}> + {window.GLOB.process && !['invoice', 'invTable'].includes(config.subtype) ? <span className="process-btn" onClick={this.addProcess}>宸ヤ綔娴�</span> : null} <Form.Item labelCol={{xs: { span: 24 }, sm: { span: 2 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 22 }} } label={ - <Tooltip placement="topLeft" title={`浣跨敤绯荤粺鍑芥暟鏃讹紝闇�濉啓鏁版嵁婧愩�傛敞锛氭暟鎹潈闄愭浛鎹㈢ $@ -> /* 鎴� ''銆� @$ -> */ 鎴� ''锛涙煡璇㈡浛鎹㈢ $select@ -> /* 鎴� ''銆� @select$ -> */ 鎴� ''锛涚粺璁℃浛鎹㈢ $sum@ -> /* 鎴� ''銆� @sum$ -> */ 鎴� ''銆俙}> + <Tooltip placement="topLeft" title={`浣跨敤绯荤粺鍑芥暟鏃讹紝闇�濉啓鏁版嵁婧愩�傛敞锛氭暟鎹潈闄愭浛鎹㈢ $@ -> /* 鎴� ''銆� @$ -> */ 鎴� ''銆俙}> <QuestionCircleOutlined className="mk-form-tip" /> 鏁版嵁婧� </Tooltip> @@ -304,7 +404,7 @@ rules: [ { required: setting.execute !== 'false' ? true : false, - message: this.props.dict['form.required.input'] + '鏁版嵁婧�!' + message: '璇疯緭鍏ユ暟鎹簮!' } ] })(<CodeMirror />)} @@ -326,30 +426,39 @@ </Radio.Group>)} </Form.Item> </Col> : null} - <Col span={8}> + {!['invTable'].includes(config.subtype) ? <Col span={8}> <Form.Item label="涓婚敭"> {getFieldDecorator('primaryKey', { initialValue: setting.primaryKey || '' })( - <Select> + <Select showSearch filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}> {columns.map((option, i) => <Select.Option key={i} value={option.field}> - {option.label} + {`${option.label}锛�${option.field}锛塦} </Select.Option> )} </Select> )} </Form.Item> - </Col> + </Col> : null} {/* 鏁扮粍鏁版嵁锛岄渶璁剧疆鎺掑簭瑙勫垯 */} {config.format === 'array' ? <Col span={8}> - <Form.Item label="榛樿鎺掑簭"> + <Form.Item label={ + <Tooltip placement="topLeft" title="濡傛灉鍦ㄨ嚜瀹氫箟鑴氭湰涓娇鐢ㄤ簡@pageSize@鎴朄orderBy@锛岃鍦ㄦ暟鎹簮涓崟鐙啓鎺掑簭璇彞銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 榛樿鎺掑簭 + </Tooltip> + }> {getFieldDecorator('order', { initialValue: setting.order || 'ID desc', rules: [ { required: true, - message: this.props.dict['form.required.input'] + '榛樿鎺掑簭!' + message: '璇疯緭鍏ラ粯璁ゆ帓搴�!' + }, + { + pattern: /^[^'+]+$/, + message: '鎺掑簭涓笉鍙娇鐢╘'涓�+' } ] })(<Input placeholder={'ID asc, UID desc'} autoComplete="off" />)} @@ -366,7 +475,7 @@ </Radio.Group>)} </Form.Item> </Col> : null} - {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) && (!config.wrap || config.wrap.supType !== 'multi') ? <Col span={8}> + {hasUp ? <Col span={8}> <Form.Item label={ <Tooltip placement="topLeft" title={'璇ョ粍浠跺鏋滃彈鍏朵粬缁勪欢鎺у埗锛岃閫夐」鐩稿簲鐨勭粍浠讹紝娌℃湁鏃堕�夆�滄棤鈥濄��'}> <QuestionCircleOutlined className="mk-form-tip" /> @@ -378,7 +487,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '涓婄骇缁勪欢!' + message: '璇烽�夋嫨涓婄骇缁勪欢!' } ] })( @@ -399,33 +508,55 @@ </Form.Item> </Col> : null} {config.pageable && setting.laypage !== 'false' ? <Col span={8}> - <Form.Item label={ - <Tooltip placement="topLeft" title="閫夋嫨鍒嗛〉鏃舵湁鏁堛��"> - <QuestionCircleOutlined className="mk-form-tip" /> - 姣忛〉鏁伴噺 - </Tooltip> - }> + <Form.Item label="姣忛〉鏁伴噺"> {getFieldDecorator('pageSize', { initialValue: setting.pageSize || 10, rules: [ { required: true, - message: this.props.dict['form.required.input'] + '姣忛〉鏁伴噺!' + message: '璇疯緭鍏ユ瘡椤垫暟閲�!' } ] })(<InputNumber min={1} max={500} precision={0} />)} </Form.Item> </Col> : null} - {/* 1銆佷笉鍒嗛〉涓斾笉瀛樺湪涓婄骇妯″潡 */} - {!['navbar', 'interface'].includes(config.type) && !['editable'].includes(config.subtype) && (!config.pageable || (config.pageable && setting.laypage === 'false')) && (setting.supModule.length === 0 || setting.supModule[0] === 'empty') ? <Col span={8}> + {setting.interType === 'inner' ? <Col span={8}> <Form.Item label={ - <Tooltip placement="topLeft" title={'鍒濆鍖栧姞杞芥椂锛屾槸鍚︿笌鍏朵粬缁勪欢涓�鍚屽姞杞芥暟鎹紝娉細浠呭湪浣跨敤绯荤粺鍑芥暟锛屼笖鍒濆鍖栧姞杞芥暟鎹椂鏈夋晥锛屽垎椤佃姹傛椂鏃犳晥銆�'}> + <Tooltip placement="topLeft" title="褰撻�夋嫨鈥滄槸鈥濇椂锛屽唴閮ㄥ嚱鏁扮殑浼犲弬浼氬鍔� username 涓� fullname銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 璁板綍鐢ㄦ埛 + </Tooltip> + }> + {getFieldDecorator('recordUser', { + initialValue: setting.recordUser || 'false' + })( + <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'recordUser')}}> + <Radio value="false">鍚�</Radio> + <Radio value="true">鏄�</Radio> + </Radio.Group>)} + </Form.Item> + </Col> : null} + {setting.interType === 'system' ? <Col span={8}> + <Form.Item label="鏁版嵁搴�"> + {getFieldDecorator('database', { + initialValue: setting.database || 'local' + })( + <Radio.Group> + <Radio value="local">鏈湴</Radio> + <Radio value="sso">鍗曠偣</Radio> + </Radio.Group>)} + </Form.Item> + </Col> : null} + {/* 1銆佷笉鍒嗛〉涓斾笉瀛樺湪涓婄骇妯″潡 */} + {!['navbar', 'interface', 'calendar'].includes(config.type) && !['editable', 'basetable', 'dualdatacard', 'invoice', 'invTable'].includes(config.subtype) && (!config.pageable || (config.pageable && setting.laypage === 'false')) && (setting.supModule.length === 0 || setting.supModule[0] === 'empty') && setting.interType === 'system' && setting.onload !== 'false' ? <Col span={8}> + <Form.Item label={ + <Tooltip placement="topLeft" title={'鍒濆鍖栧姞杞芥椂锛屾槸鍚︿笌鍏朵粬缁勪欢涓�鍚屽姞杞芥暟鎹��'}> <QuestionCircleOutlined className="mk-form-tip" /> 鍚屾鏌ヨ </Tooltip> }> {getFieldDecorator('sync', { - initialValue: setting.sync || 'true' + initialValue: setting.sync || 'false' })( <Radio.Group> <Radio value="true">鏄�</Radio> @@ -434,9 +565,9 @@ )} </Form.Item> </Col> : null} - {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) ? <Col span={8}> + {!['navbar', 'balcony', 'menubar'].includes(config.type) && !['basetable', 'invoice', 'invTable'].includes(config.subtype) ? <Col span={8}> <Form.Item label={ - <Tooltip placement="topLeft" title={'浼樺厛浣跨敤鍚岀骇鐨勬悳绱㈡潯浠剁粍浠讹紝鍚岀骇鎼滅储涓嶅瓨鍦ㄦ椂锛屼緷娆″悜涓婇�夊彇锛屼笌褰撳墠缁勪欢鐨勬悳绱㈡潯浠朵竴鍚岀敤浣滄暟鎹繃婊わ紙褰撳墠缁勪欢鐨勬悳绱㈡潯浠朵紭鍏堬級銆�'}> + <Tooltip placement="topLeft" title={config.type === 'interface' ? '鍗曠嫭鎼滅储缁勪欢鍙綔涓哄叕鍏辨暟鎹簮鐨勬悳绱㈡潯浠躲��' : '浼樺厛浣跨敤鍚岀骇鐨勬悳绱㈡潯浠剁粍浠讹紝鍚岀骇鎼滅储涓嶅瓨鍦ㄦ椂锛屼緷娆″悜涓婇�夊彇锛屼笌褰撳墠缁勪欢鐨勬悳绱㈡潯浠朵竴鍚岀敤浣滄暟鎹繃婊わ紙褰撳墠缁勪欢鐨勬悳绱㈡潯浠朵紭鍏堬級銆�'}> <QuestionCircleOutlined className="mk-form-tip" /> 澶栭儴鎼滅储 </Tooltip> @@ -445,53 +576,76 @@ initialValue: setting.useMSearch || 'true' })( <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'useMSearch')}}> + <Radio value="true">浣跨敤{!hasMainSearch ? <Tooltip placement="top" title="鏃犲彲浣跨敤鐨勫閮ㄦ悳绱㈡潯浠�"><span className="mk-dot"></span></Tooltip> : null}</Radio> + <Radio value="false">涓嶄娇鐢�</Radio> + </Radio.Group> + )} + </Form.Item> + </Col> : null} + {config.subtype === 'basetable' && !this.state.ismain ? <Col span={8}> + <Form.Item label={ + <Tooltip placement="topLeft" title="鏄惁浣跨敤涓昏〃鐨勬悳绱㈡潯浠�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 涓昏〃鎼滅储 + </Tooltip> + }> + {getFieldDecorator('useMSearch', { + initialValue: setting.useMSearch || 'false' + })( + <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'useMSearch')}}> <Radio value="true">浣跨敤</Radio> <Radio value="false">涓嶄娇鐢�</Radio> </Radio.Group> )} </Form.Item> </Col> : null} - {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) && setting.useMSearch === 'true' && appType !== 'mob' ? <Col span={8}> - <Form.Item label={ - <Tooltip placement="topLeft" title={'澶栧眰鎼滅储鏉′欢鏀瑰彉鏃讹紝鏄惁鍒锋柊褰撳墠缁勪欢鏁版嵁銆�'}> - <QuestionCircleOutlined className="mk-form-tip" /> - 鍚屾鍒锋柊 - </Tooltip> - }> - {getFieldDecorator('syncRefresh', { - initialValue: setting.syncRefresh || 'true' - })( - <Radio.Group> - <Radio value="true">鏄�</Radio> - <Radio value="false">鍚�</Radio> - </Radio.Group> - )} - </Form.Item> - </Col> : null} - <Col span={8}> - <Form.Item label="浜嬪姟"> - {getFieldDecorator('transaction', { - initialValue: setting.transaction || 'false' - })( - <Radio.Group> - <Radio value="true">浣跨敤</Radio> - <Radio value="false">涓嶄娇鐢�</Radio> - </Radio.Group>)} - </Form.Item> - </Col> {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) ? <Col span={8}> <Form.Item label="鍒濆鍖栨暟鎹�"> {getFieldDecorator('onload', { initialValue: setting.onload || 'true' })( - <Radio.Group> + <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'onload')}}> <Radio value="true">鍔犺浇</Radio> <Radio value="false">涓嶅姞杞�</Radio> </Radio.Group> )} </Form.Item> </Col> : null} - {config.type === 'interface' ? <Col span={8}> + {setting.interType === 'system' ? <Col span={8}> + <Form.Item label={ + <Tooltip placement="topLeft" title="浣跨敤鍚庣sql鑴氭湰鏃舵湁鏁堛��"> + <QuestionCircleOutlined className="mk-form-tip" /> + 浜嬪姟 + </Tooltip> + }> + {getFieldDecorator('transact', { + initialValue: setting.transact || 'false' + })( + <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'transact')}}> + <Radio value="true">鍚敤</Radio> + <Radio value="false">绂佺敤</Radio> + </Radio.Group> + )} + </Form.Item> + </Col> : null} + {config.type === 'interface' && ((setting.supModule && setting.supModule[0] === 'empty') || MenuType === 'billPrint') ? <Col span={8}> + <Form.Item label={ + <Tooltip placement="topLeft" title="鍒濆鍖栧姞杞藉皢鍦ㄩ〉闈㈠姞杞藉墠鎵ц銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 鍔犺浇鏂瑰紡 + </Tooltip> + }> + {getFieldDecorator('loadlevel', { + initialValue: setting.loadlevel || 'default' + })( + <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'loadlevel')}}> + <Radio value="default">榛樿</Radio> + <Radio value="init">鍒濆鍖�</Radio> + </Radio.Group> + )} + </Form.Item> + </Col> : null} + {config.type === 'interface' && MenuType !== 'billPrint' ? <Col span={8}> <Form.Item label="瀹氭椂鍣�"> {getFieldDecorator('timer', { initialValue: setting.timer || '' @@ -524,8 +678,95 @@ })(<InputNumber min={0} max={500} precision={0} />)} </Form.Item> </Col> : null} + {config.subtype === 'dualdatacard' ? <Col span={8}> + <Form.Item label={ + <Tooltip placement="topLeft" title="瀛愯〃鍦ㄤ富琛ㄤ腑鐨勬暟鎹泦鍚嶇О锛屼娇鐢� sub_data_string 鏃舵暟鎹互 JSON 瀛楃涓插舰寮忚繑鍥烇紙瀛楁闆嗕腑闇�娣诲姞 sub_data_string 瀛楁锛夛紱褰撲富琛ㄥ瓧娈靛瓨鍦� sub_data_string 涓斿�间笉涓虹┖鏃讹紝浼樺厛浣跨敤涓昏〃鐨� sub_data_string銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 瀛愯〃瀛楁 + </Tooltip> + }> + {getFieldDecorator('subdata', { + initialValue: setting.subdata || 'sub_data', + rules: [ + { + required: true, + message: '璇疯緭鍏ュ瓙琛ㄥ瓧娈�!' + } + ] + })(<Input placeholder={''} autoComplete="off" />)} + </Form.Item> + </Col> : null} + {config.subtype === 'dualdatacard' ? <Col span={8}> + <Form.Item label="瀛愯〃涓婚敭"> + {getFieldDecorator('subKey', { + initialValue: setting.subKey || '' + })( + <Select showSearch filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}> + {this.props.subColumns.map((option, i) => + <Select.Option key={i} value={option.field}> + {`${option.label}锛�${option.field}锛塦} + </Select.Option> + )} + </Select> + )} + </Form.Item> + </Col> : null} + {config.subtype === 'dualdatacard' ? <Col span={8}> + <Form.Item label="瀛愯〃BID"> + {getFieldDecorator('subBID', { + initialValue: setting.subBID || '' + })( + <Select showSearch filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}> + {this.props.subColumns.map((option, i) => + <Select.Option key={i} value={option.field}> + {`${option.label}锛�${option.field}锛塦} + </Select.Option> + )} + </Select> + )} + </Form.Item> + </Col> : null} + {setting.onload !== 'false' ? <Col span={8}> + <Form.Item label={ + <Tooltip placement="topLeft" title="鍙欢杩熷垵濮嬪寲鏁版嵁鐨勫姞杞芥椂闂达紝鍗曚綅姣锛坢s锛夈��"> + <QuestionCircleOutlined className="mk-form-tip" /> + 寤舵椂鍔犺浇 + </Tooltip> + }> + {getFieldDecorator('delay', { + initialValue: setting.delay, + })(<InputNumber min={0} max={60000} precision={0} />)} + </Form.Item> + </Col> : null} + {hasUp && setting.supModule && setting.supModule[0] && setting.supModule[0] !== 'empty' ? <Col span={8}> + <Form.Item label={ + <Tooltip placement="topLeft" title="鏈幏鍙栧埌涓婄骇涓婚敭鍊肩殑鎻愮ず鏂囨湰銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 涓婄骇绌哄�兼彁绀� + </Tooltip> + }> + {getFieldDecorator('supModTip', { + initialValue: setting.supModTip || '' + })( + <Input placeholder={''} autoComplete="off" /> + )} + </Form.Item> + </Col> : null} </Row> </Form> + <Modal + wrapClassName="mk-flow-type" + visible={visible} + width={400} + onCancel={() => this.setState({visible: false})} + footer={[ + <Button key="cancel" className="mk-green" onClick={() => this.execAddProcess('flowstart')}>鍙戣捣</Button>, + <Button key="confirm" className="mk-primary" onClick={() => this.execAddProcess('flowcheck')}>瀹℃壒</Button> + ]} + destroyOnClose + > + 璇烽�夋嫨宸ヤ綔娴佺被鍨嬨�� + </Modal> </div> ) } -- Gitblit v1.8.0