From c83a50317baeba1a4771e4d802eee029ed2b7e31 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 23 六月 2020 18:23:43 +0800 Subject: [PATCH] 2020-06-23 --- src/templates/zshare/editcard/index.jsx | 7 src/templates/subtableconfig/source.jsx | 8 src/components/sidemenu/index.scss | 10 + src/tabviews/zshare/normalTable/index.jsx | 55 ++++++++ src/templates/sharecomponent/actioncomponent/verifyexcelin/uniqueform/index.jsx | 1 src/templates/sharecomponent/fieldscomponent/editcard/index.jsx | 7 src/locales/zh-CN/model.js | 28 ++-- src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx | 2 src/templates/sharecomponent/columncomponent/colspanform/index.jsx | 20 +- src/locales/en-US/model.js | 28 ++-- src/tabviews/subtable/index.jsx | 19 ++- src/tabviews/subtabtable/index.jsx | 3 src/tabviews/commontable/index.jsx | 2 src/templates/sharecomponent/cardcomponent/index.jsx | 2 src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx | 12 + src/utils/utils.js | 6 src/templates/zshare/formconfig.jsx | 65 +++++++--- src/templates/comtableconfig/source.jsx | 8 src/templates/zshare/verifycard/index.jsx | 8 src/templates/sharecomponent/columncomponent/gridbtnform/index.jsx | 10 src/templates/sharecomponent/actioncomponent/dragaction/index.jsx | 2 src/components/sidemenu/index.jsx | 2 src/tabviews/zshare/cardcomponent/index.jsx | 20 +++ src/templates/sharecomponent/columncomponent/columnform/index.jsx | 9 src/templates/sharecomponent/searchcomponent/searchform/index.jsx | 6 25 files changed, 233 insertions(+), 107 deletions(-) diff --git a/src/components/sidemenu/index.jsx b/src/components/sidemenu/index.jsx index 554fef9..e3876c7 100644 --- a/src/components/sidemenu/index.jsx +++ b/src/components/sidemenu/index.jsx @@ -287,7 +287,7 @@ const editShow = (this.props.editState && !this.props.editLevel) || false return ( - <aside className={"side-menu ant-menu-dark" + (this.props.collapse ? ' side-menu-collapsed' : '') + (this.props.isiframe ? ' iframe' : '')}> + <aside className={"side-menu ant-menu-dark" + (this.props.collapse ? ' side-menu-collapsed' : '') + (this.props.isiframe ? ' iframe' : '') + (this.props.editState ? ' edit' : '')}> {!(this.props.editLevel === 'level2' || this.props.editLevel === 'level3') && <Menu openKeys={this.state.openKeys} onOpenChange={this.onOpenChange} mode="inline" theme="dark" inlineCollapsed={this.props.collapse}> {editShow && <li className="sup-menu"><Icon onClick={this.enterSubEdit} className="edit-check" type="edit" /></li>} diff --git a/src/components/sidemenu/index.scss b/src/components/sidemenu/index.scss index 45a5c04..cdb8640 100644 --- a/src/components/sidemenu/index.scss +++ b/src/components/sidemenu/index.scss @@ -88,6 +88,16 @@ left: 187px; } } +.side-menu.edit { // 缂栬緫鏃舵帶鍒惰彍鍗曞簳鑹� + .ant-menu-sub.ant-menu-inline { + > .ant-menu-item.ant-menu-item-selected { + background: unset; + } + > .ant-menu-item.ant-menu-item-active { + background: unset; + } + } +} .side-menu.iframe { // tab椤典腑涓篿frame鏃� max-height: 100vh; overflow-y: scroll; diff --git a/src/locales/en-US/model.js b/src/locales/en-US/model.js index 66c8597..adf6865 100644 --- a/src/locales/en-US/model.js +++ b/src/locales/en-US/model.js @@ -13,6 +13,10 @@ 'header.reset': 'Reset', 'model.enable': 'Enable', 'model.disable': 'Disable', + 'model.required': 'Required', + 'model.hidden': 'Hidden', + 'model.length': 'Length', + 'model.sort': 'Sort', 'model.switch.open': 'Open', 'model.switch.close': 'Close', 'model.menu.level1': 'Level 1 menu', @@ -70,10 +74,9 @@ 'header.form.column.itemUnit': 'Item', 'header.form.column.itemsUnit': 'Items', 'model.form.column.action': 'Action', - 'header.form.name': 'Name', + 'model.form.name': 'Name', 'header.form.title': 'Title', - 'header.form.field': 'Field', - 'header.form.field.placeholder': 'Please enter a field name', + 'model.form.field': 'Field', 'header.form.innerFunc': 'Internal func', 'header.form.outerFunc': 'External function', 'header.form.callbackFunc': 'Callback function', @@ -150,14 +153,12 @@ 'header.form.blank': '褰撳墠椤佃烦杞�', 'model.form.prompt': 'Prompt', 'model.form.exec': 'Direct execution', - 'header.form.icon': '鍥炬爣', - 'header.form.class': '棰滆壊', - 'header.form.align': '瀵归綈鏂瑰紡', - 'header.form.alignLeft': '宸﹀榻�', - 'header.form.alignRight': '鍙冲榻�', - 'header.form.alignCenter': '灞呬腑', - 'header.form.Hide': '鏄惁闅愯棌', - 'header.form.IsSort': '鏄惁鎺掑簭', + 'model.form.paramJoint': 'Joint param', + 'model.form.icon': 'Icon', + 'model.form.align': 'Alignment', + 'model.form.alignLeft': 'The left', + 'model.form.alignRight': 'The Right', + 'model.form.alignCenter': 'The center', 'header.form.columnWidth': '鍒楀', 'header.form.true': '鏄�', 'header.form.false': '鍚�', @@ -188,7 +189,7 @@ 'header.form.dropdown': '涓嬫媺鑿滃崟', 'header.form.button': '鎸夐挳', 'header.form.style': '椋庢牸', - 'header.form.color': '棰滆壊', + 'model.form.color': 'Color', 'header.form.order': '鎺掑垪', 'header.form.horizontal': '妯悜', 'header.form.vertical': '绾靛悜', @@ -198,15 +199,12 @@ 'model.form.selectItem.error': '涓嬫媺閫夐」璁剧疆閿欒锛�', 'header.form.request.method': '璇锋眰鏂瑰紡', 'header.form.readonly': '鏄惁鍙', - 'header.form.field.required': '鏄惁蹇呭~', - 'header.form.field.ishidden': '鏄惁闅愯棌', 'header.form.queryType': '鏌ヨ绫诲瀷', 'header.form.query': '鏌ヨ', 'header.form.statistics': '缁熻', 'header.form.database': '鏁版嵁搴�', 'header.form.database.local': '鏈湴', 'header.form.database.sso': '绯荤粺', - 'header.form.field.length': '瀛楁闀垮害', 'header.form.linkMain': '鍏宠仈涓昏〃', 'header.form.query.delete': '纭畾鍒犻櫎鍚�?', 'header.form.up': '涓婄Щ', diff --git a/src/locales/zh-CN/model.js b/src/locales/zh-CN/model.js index 28b7cfa..590b124 100644 --- a/src/locales/zh-CN/model.js +++ b/src/locales/zh-CN/model.js @@ -13,6 +13,10 @@ 'header.reset': '閲嶇疆', 'model.enable': '鍚�', 'model.disable': '鍋�', + 'model.required': '蹇呭~', + 'model.hidden': '闅愯棌', + 'model.length': '闀垮害', + 'model.sort': '鎺掑簭', 'model.switch.open': '寮�', 'model.switch.close': '鍏�', 'model.menu.level1': '涓�绾ц彍鍗�', @@ -70,10 +74,9 @@ 'header.form.column.itemUnit': '椤�', 'header.form.column.itemsUnit': '椤�', 'model.form.column.action': '鎿嶄綔', - 'header.form.name': '鍚嶇О', + 'model.form.name': '鍚嶇О', 'header.form.title': '鏍囬', - 'header.form.field': '瀛楁', - 'header.form.field.placeholder': '璇疯緭鍏ュ瓧娈靛悕', + 'model.form.field': '瀛楁', 'header.form.innerFunc': '鍐呴儴鍑芥暟', 'header.form.outerFunc': '澶栭儴鍑芥暟', 'header.form.callbackFunc': '鍥炶皟鍑芥暟', @@ -150,14 +153,12 @@ 'header.form.blank': '褰撳墠椤佃烦杞�', 'model.form.prompt': '鎻愮ず妗�', 'model.form.exec': '鐩存帴鎵ц', - 'header.form.icon': '鍥炬爣', - 'header.form.class': '棰滆壊', - 'header.form.align': '瀵归綈鏂瑰紡', - 'header.form.alignLeft': '宸﹀榻�', - 'header.form.alignRight': '鍙冲榻�', - 'header.form.alignCenter': '灞呬腑', - 'header.form.Hide': '鏄惁闅愯棌', - 'header.form.IsSort': '鏄惁鎺掑簭', + 'model.form.paramJoint': '鎷兼帴鍙傛暟', + 'model.form.icon': '鍥炬爣', + 'model.form.align': '瀵归綈鏂瑰紡', + 'model.form.alignLeft': '宸﹀榻�', + 'model.form.alignRight': '鍙冲榻�', + 'model.form.alignCenter': '灞呬腑', 'header.form.columnWidth': '鍒楀', 'header.form.true': '鏄�', 'header.form.false': '鍚�', @@ -188,7 +189,7 @@ 'header.form.dropdown': '涓嬫媺鑿滃崟', 'header.form.button': '鎸夐挳', 'header.form.style': '椋庢牸', - 'header.form.color': '棰滆壊', + 'model.form.color': '棰滆壊', 'header.form.order': '鎺掑垪', 'header.form.horizontal': '妯悜', 'header.form.vertical': '绾靛悜', @@ -198,15 +199,12 @@ 'model.form.selectItem.error': '涓嬫媺閫夐」璁剧疆閿欒锛�', 'header.form.request.method': '璇锋眰鏂瑰紡', 'header.form.readonly': '鏄惁鍙', - 'header.form.field.required': '鏄惁蹇呭~', - 'header.form.field.ishidden': '鏄惁闅愯棌', 'header.form.queryType': '鏌ヨ绫诲瀷', 'header.form.query': '鏌ヨ', 'header.form.statistics': '缁熻', 'header.form.database': '鏁版嵁搴�', 'header.form.database.local': '鏈湴', 'header.form.database.sso': '绯荤粺', - 'header.form.field.length': '瀛楁闀垮害', 'header.form.linkMain': '鍏宠仈涓昏〃', 'header.form.query.delete': '纭畾鍒犻櫎鍚�?', 'header.form.up': '涓婄Щ', diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index fd44f5c..5edf990 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -310,6 +310,8 @@ if (col.field) { _arrField.push(col.field) _logcolumns.push(col) + + col.nameField && _arrField.push(col.nameField) // 閾炬帴鍚嶅瓧娈� } if (col.type === 'colspan' && col.sublist) { // 绛涢�夐殣钘忓垪 _hideCol = _hideCol.concat(col.sublist) diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index 78d939a..9fd6f65 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -61,7 +61,7 @@ pageIndex: 1, // 椤电爜 pageSize: 10, // 姣忛〉鏁版嵁鏉℃暟 orderBy: '', // 鎺掑簭 - search: '', // 鎼滅储鏉′欢鏁扮粍锛屼娇鐢ㄦ椂闇�鍒嗗満鏅鐞� + search: [], // 鎼滅储鏉′欢鏁扮粍锛屼娇鐢ㄦ椂闇�鍒嗗満鏅鐞� pickup: false, // 瀛愯〃鏁版嵁闅愯棌鏄剧ず鍒囨崲 triggerBtn: null, // 鎸夐挳瑙﹀彂 chartId: '' // 灞曞紑鍥捐〃ID @@ -77,7 +77,9 @@ selectedData: [], resetTable: !this.state.resetTable, }, () => { - this.loadmaindata(nextProps.BID, 'refresh') + if (this.state.setting) { + this.loadmaindata(nextProps.BID, 'refresh') + } }) } else if (this.state.config && nextProps.refreshtabs && nextProps.refreshtabs.includes(this.props.Tab.uuid)) { this.reloadtable() @@ -90,9 +92,11 @@ triggerBtn: trigger }) } else if (!this.props.Tab.supMenu && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { - this.setState({}, () => { - this.loadmaindata() - }) + if (this.state.setting) { + this.setState({}, () => { + this.loadmaindata() + }) + } } } @@ -263,8 +267,9 @@ config.columns.forEach(col => { if (col.field) { _arrField.push(col.field) - _logcolumns.push(col) + + col.nameField && _arrField.push(col.nameField) // 閾炬帴鍚嶅瓧娈� } if (col.type === 'colspan' && col.sublist) { // 绛涢�夐殣钘忓垪 _hideCol = _hideCol.concat(col.sublist) @@ -778,7 +783,7 @@ reloadview = () => { this.setState({ loadingview: true, viewlost: false, lostmsg: '', config: null, searchlist: null, actions: null, columns: null, arr_field: '', setting: null, data: null, total: 0, loading: false, pageIndex: 1, pageSize: 10, - orderBy: '', search: '', triggerBtn: null + orderBy: '', search: [], triggerBtn: null }, () => { this.loadconfig() }) diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx index 0ea607b..5b876a9 100644 --- a/src/tabviews/subtabtable/index.jsx +++ b/src/tabviews/subtabtable/index.jsx @@ -200,8 +200,9 @@ config.columns.forEach(col => { if (col.field) { _arrField.push(col.field) - _logcolumns.push(col) + + col.nameField && _arrField.push(col.nameField) // 閾炬帴鍚嶅瓧娈� } if (col.type === 'colspan' && col.sublist) { // 绛涢�夐殣钘忓垪 _hideCol = _hideCol.concat(col.sublist) diff --git a/src/tabviews/zshare/cardcomponent/index.jsx b/src/tabviews/zshare/cardcomponent/index.jsx index 567aaa8..0190941 100644 --- a/src/tabviews/zshare/cardcomponent/index.jsx +++ b/src/tabviews/zshare/cardcomponent/index.jsx @@ -383,6 +383,26 @@ {content} </span> ) + } else if (col.type === 'link') { + let content = col.nameField ? data[col.nameField] : '' + let _href = data[col.field] || '' + + if (!content && _href) { + content = _href + } else if (!_href) { + content = '' + } + + if (col.joint === 'true' && _href) { + let _param = window.btoa('id=' + data[this.props.setting.primaryKey] + '&userid=' + sessionStorage.getItem('UserID') + '&loginuid=' + sessionStorage.getItem('LoginUID')) + _href += '?' + _param + } + + return ( + <span> + {_href ? <a href={_href} target="_blank" rel="noopener noreferrer">{content}</a> : null} + </span> + ) } } diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx index 0ffe91a..337f4fd 100644 --- a/src/tabviews/zshare/normalTable/index.jsx +++ b/src/tabviews/zshare/normalTable/index.jsx @@ -438,9 +438,38 @@ return ( <div> - <div className="baseboard"></div> <div className="content" style={{ minWidth: (item.Width || 120) + 'px' }}> {content ? <Paragraph copyable ellipsis={{ rows: 3, expandable: true }}>{content}</Paragraph> : null } + </div> + </div> + ) + } else if (item.type === 'link') { + let content = '' + let _href = record[item.field] || '' + + if (item.nameField && record.hasOwnProperty(item.nameField)) { + content = record[item.nameField] + } + + if (!content && _href) { + content = _href + } else if (!_href) { + content = '' + } + + if (item.joint === 'true' && _href) { + let _param = window.btoa('id=' + record[this.props.setting.primaryKey] + '&userid=' + sessionStorage.getItem('UserID') + '&loginuid=' + sessionStorage.getItem('LoginUID')) + _href += '?' + _param + } + + if (item.blur) { + content = md5(content) + } + + return ( + <div> + <div className="content" style={{ minWidth: (item.Width || 120) + 'px' }}> + {content ? <a href={_href} target="_blank" rel="noopener noreferrer">{content}</a> : null } </div> </div> ) @@ -478,7 +507,7 @@ } if (content !== '') { - if (item.format === 'percent') { + if (col.format === 'percent') { content = content * 100 } @@ -547,6 +576,28 @@ } contents.push(content) + } else if (col.type === 'link') { + let content = col.nameField ? record[col.nameField] : '' + let _href = record[col.field] || '' + + if (!content && _href) { + content = _href + } else if (!_href) { + content = '' + } + + if (col.joint === 'true' && _href) { + let _param = window.btoa('id=' + record[this.props.setting.primaryKey] + '&userid=' + sessionStorage.getItem('UserID') + '&loginuid=' + sessionStorage.getItem('LoginUID')) + _href += '?' + _param + } + + if (item.blur) { + content = md5(content) + } + + content = _href ? <a href={_href} target="_blank" rel="noopener noreferrer">{content}</a> : null + + contents.push(content) } else { let content = record[col.field] diff --git a/src/templates/comtableconfig/source.jsx b/src/templates/comtableconfig/source.jsx index 738c88c..ec96326 100644 --- a/src/templates/comtableconfig/source.jsx +++ b/src/templates/comtableconfig/source.jsx @@ -338,14 +338,14 @@ }, { type: 'columns', - label: CommonDict['model.form.textarea'], - subType: 'textarea', + label: CommonDict['model.form.href'], + subType: 'link', url: '' }, { type: 'columns', - label: CommonDict['model.form.href'], - subType: 'link', + label: CommonDict['model.form.textarea'], + subType: 'textarea', url: '' }, { diff --git a/src/templates/sharecomponent/actioncomponent/dragaction/index.jsx b/src/templates/sharecomponent/actioncomponent/dragaction/index.jsx index d6e05a2..85c2419 100644 --- a/src/templates/sharecomponent/actioncomponent/dragaction/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/dragaction/index.jsx @@ -124,6 +124,7 @@ if (item.subType === 'excelIn') { // 瀵煎叆鍜屽鍑篹xcel锛屾寜閽悕绉扮洿鎺ヤ负瀵煎叆銆佸鍑� newcard.label = item.label + newcard.class = 'border-dgreen' } else if (item.subType === 'excelOut') { newcard.label = item.label newcard.intertype = setting.interType @@ -131,6 +132,7 @@ newcard.sysInterface = setting.sysInterface newcard.outerFunc = setting.outerFunc newcard.interface = setting.interface + newcard.class = 'dgreen' } let targetId = cards.length > 0 ? cards[cards.length - 1].uuid : 0 diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx index 9757d5a..046402e 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx @@ -177,7 +177,7 @@ fields = fields + ',' } - _value = `Insert into ${btn.sheet} (${fields}createuserid,createuser,createstaff,bid)\nSelect ${fields}@userid,@username,@fullname,@BID From @${btn.sheet}` + _value = `Insert into ${btn.sheet} (${fields}createuserid,createuser,createstaff,bid)\nSelect ${fields}@userid@,@username,@fullname,@BID@ From @${btn.sheet}` } else { _value = value } diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx index 6ff9b95..674f7c1 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx @@ -155,7 +155,17 @@ title: '鎵ц浣嶇疆', dataIndex: 'position', width: '10%', - render: (text, record) => record.position !== 'front' ? 'sql鍚�' : 'sql鍓�' + render: (text, record) => { + let _text = '' + if (record.position === 'front') { + _text = 'sql鍓�' + } else if (record.position === 'init') { + _text = '鍒濆鍖�' + } else { + _text = 'sql鍚�' + } + return _text + } }, { title: '鐘舵��', diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/uniqueform/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/uniqueform/index.jsx index 38ea99a..221bf91 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/uniqueform/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/uniqueform/index.jsx @@ -90,6 +90,7 @@ <Select mode="multiple" > + <Select.Option key="bid" value="BID">BID</Select.Option> {fields.map(item => ( <Select.Option key={item.uuid} value={item.Column}>{item.Text}</Select.Option> ))} diff --git a/src/templates/sharecomponent/cardcomponent/index.jsx b/src/templates/sharecomponent/cardcomponent/index.jsx index d67f4da..8a5b575 100644 --- a/src/templates/sharecomponent/cardcomponent/index.jsx +++ b/src/templates/sharecomponent/cardcomponent/index.jsx @@ -81,7 +81,7 @@ } } - let _columns = config.columns.filter(col => ['text', 'number'].includes(col.type)) + let _columns = config.columns.filter(col => ['text', 'number', 'link'].includes(col.type)) _columns = _columns.map(col => { return { uuid: col.uuid, diff --git a/src/templates/sharecomponent/columncomponent/colspanform/index.jsx b/src/templates/sharecomponent/columncomponent/colspanform/index.jsx index 7f50da6..fc5e0c6 100644 --- a/src/templates/sharecomponent/columncomponent/colspanform/index.jsx +++ b/src/templates/sharecomponent/columncomponent/colspanform/index.jsx @@ -77,13 +77,13 @@ <Form {...formItemLayout} className="commontable-cospan-column-form" id="columncolspan"> <Row gutter={24}> <Col span={12}> - <Form.Item label={this.props.dict['header.form.name']}> + <Form.Item label={this.props.dict['model.form.name']}> {getFieldDecorator('label', { initialValue: this.props.card.label, rules: [ { required: true, - message: this.props.dict['form.required.input'] + this.props.dict['header.form.name'] + '!' + message: this.props.dict['form.required.input'] + this.props.dict['model.form.name'] + '!' }, { max: formRule.input.max, @@ -107,22 +107,22 @@ </Form.Item> </Col> <Col span={12}> - <Form.Item label={this.props.dict['header.form.align']}> + <Form.Item label={this.props.dict['model.form.align']}> {getFieldDecorator('Align', { initialValue: this.props.card.Align, rules: [ { required: true, - message: this.props.dict['form.required.select'] + this.props.dict['header.form.align'] + '!' + message: this.props.dict['form.required.select'] + this.props.dict['model.form.align'] + '!' } ] })( <Select getPopupContainer={() => document.getElementById('columncolspan')} > - <Select.Option value="left">{this.props.dict['header.form.alignLeft']}</Select.Option> - <Select.Option value="right">{this.props.dict['header.form.alignRight']}</Select.Option> - <Select.Option value="center">{this.props.dict['header.form.alignCenter']}</Select.Option> + <Select.Option value="left">{this.props.dict['model.form.alignLeft']}</Select.Option> + <Select.Option value="right">{this.props.dict['model.form.alignRight']}</Select.Option> + <Select.Option value="center">{this.props.dict['model.form.alignCenter']}</Select.Option> </Select> )} </Form.Item> @@ -141,13 +141,13 @@ </Form.Item> </Col> <Col span={12}> - <Form.Item label={this.props.dict['header.form.Hide']}> + <Form.Item label={this.props.dict['model.hidden']}> {getFieldDecorator('Hide', { - initialValue: this.props.card.Hide, + initialValue: this.props.card.Hide || 'false', rules: [ { required: true, - message: this.props.dict['form.required.select'] + this.props.dict['header.form.Hide'] + '!' + message: this.props.dict['form.required.select'] + this.props.dict['model.hidden'] + '!' } ] })( diff --git a/src/templates/sharecomponent/columncomponent/columnform/index.jsx b/src/templates/sharecomponent/columncomponent/columnform/index.jsx index db89b86..b8be9af 100644 --- a/src/templates/sharecomponent/columncomponent/columnform/index.jsx +++ b/src/templates/sharecomponent/columncomponent/columnform/index.jsx @@ -8,9 +8,10 @@ import './index.scss' const columnTypeOptions = { - text: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'color', 'fieldlength', 'blacklist', 'linkmenu'], - number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'color', 'blacklist', 'linkmenu'], - textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'color', 'fieldlength', 'blacklist'], + text: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'fieldlength', 'blacklist', 'linkmenu'], + number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'linkmenu'], + link: ['label', 'field', 'type', 'nameField', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'fieldlength', 'blacklist'], + textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'fieldlength', 'blacklist'], picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist', 'scale', 'maxHeight'] } @@ -101,7 +102,7 @@ if (item.type === 'text') { // 鏂囨湰鎼滅储 let rules = [] - if (item.key === 'field' || item.key === 'contrastField') { + if (item.key === 'field' || item.key === 'nameField') { rules = [{ pattern: formRule.field.pattern, message: formRule.field.message diff --git a/src/templates/sharecomponent/columncomponent/gridbtnform/index.jsx b/src/templates/sharecomponent/columncomponent/gridbtnform/index.jsx index b83a034..601f01d 100644 --- a/src/templates/sharecomponent/columncomponent/gridbtnform/index.jsx +++ b/src/templates/sharecomponent/columncomponent/gridbtnform/index.jsx @@ -16,25 +16,25 @@ { type: 'text', key: 'label', - label: this.props.dict['header.form.name'], + label: this.props.dict['model.form.name'], initVal: this.props.card.label, required: true }, { type: 'select', key: 'Align', - label: this.props.dict['header.form.align'], + label: this.props.dict['model.form.align'], initVal: this.props.card.Align, required: true, options: [{ MenuID: 'left', - text: this.props.dict['header.form.alignLeft'] + text: this.props.dict['model.form.alignLeft'] }, { MenuID: 'right', - text: this.props.dict['header.form.alignRight'] + text: this.props.dict['model.form.alignRight'] }, { MenuID: 'center', - text: this.props.dict['header.form.alignCenter'] + text: this.props.dict['model.form.alignCenter'] }] }, { diff --git a/src/templates/sharecomponent/fieldscomponent/editcard/index.jsx b/src/templates/sharecomponent/fieldscomponent/editcard/index.jsx index c0c579d..4be536b 100644 --- a/src/templates/sharecomponent/fieldscomponent/editcard/index.jsx +++ b/src/templates/sharecomponent/fieldscomponent/editcard/index.jsx @@ -53,8 +53,8 @@ <div className={'ant-card ant-card-bordered ' + (card.selected ? 'selected' : '')} > <div className="base" onClick={this.changeSelect}> <Icon type="check" /> - <p title={card.field}>{this.props.dict['header.form.field']}锛� <span>{card.field}</span></p> - <p title={card.label}>{this.props.dict['header.form.name']}锛� <span>{card.label}</span></p> + <p title={card.field}>{this.props.dict['model.form.field']}锛� <span>{card.field}</span></p> + <p title={card.label}>{this.props.dict['model.form.name']}锛� <span>{card.label}</span></p> </div> {type === 'search' ? <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected}> @@ -122,13 +122,14 @@ } render() { + const { dict } = this.props const { dataSource, type, loading } = this.state return ( <div className="common-modal-edit-card"> <Row className="search-row"> <Col span={8}> - {!loading ? <Search placeholder={this.props.dict['header.form.field.placeholder']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null} + {!loading ? <Search placeholder={dict['form.required.input'] + dict['header.form.field']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null} </Col> <Col span={8}> <Button onClick={this.reset}> diff --git a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx index 1747b44..c1d7f17 100644 --- a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx @@ -162,7 +162,7 @@ } else if (form.key === 'field' && type === 'text') { form.tooltip = this.state.textTooltip } else if (form.key === 'field' && type === 'group') { - form.label = dict['header.form.type'] + dict['header.form.field'] + form.label = dict['header.form.type'] + dict['model.form.field'] } form.hidden = !_options.includes(form.key) return form @@ -243,11 +243,11 @@ matchs = form.options } else if (form.key === 'field') { form.tooltip = '' - form.label = dict['header.form.field'] + form.label = dict['model.form.field'] if (value === 'text') { form.tooltip = this.state.textTooltip } else if (value === 'group') { - form.label = dict['header.form.type'] + dict['header.form.field'] + form.label = dict['header.form.type'] + dict['model.form.field'] } } diff --git a/src/templates/subtableconfig/source.jsx b/src/templates/subtableconfig/source.jsx index d625409..3b0a0c8 100644 --- a/src/templates/subtableconfig/source.jsx +++ b/src/templates/subtableconfig/source.jsx @@ -305,14 +305,14 @@ }, { type: 'columns', - label: CommonDict['model.form.textarea'], - subType: 'textarea', + label: CommonDict['model.form.href'], + subType: 'link', url: '' }, { type: 'columns', - label: CommonDict['model.form.href'], - subType: 'link', + label: CommonDict['model.form.textarea'], + subType: 'textarea', url: '' }, { diff --git a/src/templates/zshare/editcard/index.jsx b/src/templates/zshare/editcard/index.jsx index c0c579d..4be536b 100644 --- a/src/templates/zshare/editcard/index.jsx +++ b/src/templates/zshare/editcard/index.jsx @@ -53,8 +53,8 @@ <div className={'ant-card ant-card-bordered ' + (card.selected ? 'selected' : '')} > <div className="base" onClick={this.changeSelect}> <Icon type="check" /> - <p title={card.field}>{this.props.dict['header.form.field']}锛� <span>{card.field}</span></p> - <p title={card.label}>{this.props.dict['header.form.name']}锛� <span>{card.label}</span></p> + <p title={card.field}>{this.props.dict['model.form.field']}锛� <span>{card.field}</span></p> + <p title={card.label}>{this.props.dict['model.form.name']}锛� <span>{card.label}</span></p> </div> {type === 'search' ? <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected}> @@ -122,13 +122,14 @@ } render() { + const { dict } = this.props const { dataSource, type, loading } = this.state return ( <div className="common-modal-edit-card"> <Row className="search-row"> <Col span={8}> - {!loading ? <Search placeholder={this.props.dict['header.form.field.placeholder']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null} + {!loading ? <Search placeholder={dict['form.required.input'] + dict['header.form.field']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null} </Col> <Col span={8}> <Button onClick={this.reset}> diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 7fc0705..8219894 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -628,7 +628,7 @@ { type: 'text', key: 'label', - label: Formdict['header.form.name'], + label: Formdict['model.form.name'], initVal: card.label || '', required: true, readonly: false @@ -636,7 +636,7 @@ { type: 'text', key: 'field', - label: Formdict['header.form.field'], + label: Formdict['model.form.field'], initVal: card.field || '', tooltipClass: 'middle', required: true, @@ -860,7 +860,7 @@ { type: 'radio', key: 'required', - label: Formdict['header.form.field.required'], + label: Formdict['model.required'], initVal: card.required || 'false', options: [{ value: 'true', @@ -1261,7 +1261,7 @@ { type: 'select', key: 'icon', - label: Formdict['header.form.icon'], + label: Formdict['model.form.icon'], initVal: card.icon, required: false, options: [] @@ -1269,7 +1269,7 @@ { type: 'select', key: 'class', - label: Formdict['header.form.class'], + label: Formdict['model.form.color'], initVal: card.class, required: false, options: [] @@ -1323,14 +1323,14 @@ { type: 'text', key: 'label', - label: Formdict['header.form.name'], + label: Formdict['model.form.name'], initVal: card.label, required: true }, { type: 'text', key: 'field', - label: Formdict['header.form.field'], + label: Formdict['model.form.field'], initVal: card.field, required: true, readonly: false @@ -1351,9 +1351,20 @@ value: 'picture', text: Formdict['model.form.picture'] }, { + value: 'link', + text: Formdict['model.form.href'] + }, { value: 'textarea', text: Formdict['model.form.textarea'] }] + }, + { + type: 'text', + key: 'nameField', + label: Formdict['model.form.name'] + Formdict['model.form.field'], + initVal: card.nameField, + required: false, + readonly: false }, { type: 'number', @@ -1367,8 +1378,22 @@ }, { type: 'radio', + key: 'joint', + label: Formdict['model.form.paramJoint'], + initVal: card.joint || 'true', + required: true, + options: [{ + value: 'true', + text: Formdict['header.form.true'] + }, { + value: 'false', + text: Formdict['header.form.false'] + }] + }, + { + type: 'radio', key: 'Hide', - label: Formdict['header.form.Hide'], + label: Formdict['model.hidden'], initVal: card.Hide || 'false', required: true, options: [{ @@ -1382,7 +1407,7 @@ { type: 'radio', key: 'IsSort', - label: Formdict['header.form.IsSort'], + label: Formdict['model.sort'], initVal: card.IsSort || 'true', required: true, options: [{ @@ -1396,18 +1421,18 @@ { type: 'radio', key: 'Align', - label: Formdict['header.form.align'], + label: Formdict['model.form.align'], initVal: card.Align || 'left', required: true, options: [{ value: 'left', - text: Formdict['header.form.alignLeft'] + text: Formdict['model.form.alignLeft'] }, { value: 'center', - text: Formdict['header.form.alignCenter'] + text: Formdict['model.form.alignCenter'] }, { value: 'right', - text: Formdict['header.form.alignRight'] + text: Formdict['model.form.alignRight'] }] }, { @@ -1440,7 +1465,7 @@ { type: 'number', key: 'fieldlength', - label: Formdict['header.form.field.length'], + label: Formdict['model.form.field'] + Formdict['model.length'], initVal: card.fieldlength || (card.type === 'text' ? 50 : 512), required: true }, @@ -1564,7 +1589,7 @@ { type: 'radio', key: 'Hide', - label: Formdict['header.form.Hide'], + label: Formdict['model.hidden'], initVal: card.Hide, required: true, options: [{ @@ -2002,7 +2027,7 @@ { type: 'text', key: 'label', - label: Formdict['header.form.name'], + label: Formdict['model.form.name'], initVal: card.label, required: true, readonly: false @@ -2010,7 +2035,7 @@ { type: 'text', key: 'field', - label: Formdict['header.form.field'], + label: Formdict['model.form.field'], initVal: card.field || '', required: true, readonly: false @@ -2177,7 +2202,7 @@ { type: 'number', key: 'fieldlength', - label: Formdict['header.form.field.length'], + label: Formdict['model.form.field'] + Formdict['model.length'], tooltip: '鏂囨湰銆佷笅鎷夋銆佹棩鏈熺瓑瀛楁榛樿闀垮害涓�50锛屽琛屾枃鏈笌鏂囦欢涓婁紶瀛楁榛樿闀垮害涓�512', initVal: card.fieldlength || _fieldlength, required: false @@ -2281,7 +2306,7 @@ { type: 'radio', key: 'required', - label: Formdict['header.form.field.required'], + label: Formdict['model.required'], initVal: card.required || 'true', options: [{ value: 'true', @@ -2294,7 +2319,7 @@ { type: 'radio', key: 'hidden', - label: Formdict['header.form.field.ishidden'], + label: Formdict['model.required'], initVal: card.hidden || 'false', options: [{ value: 'true', diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx index a485553..8f9341d 100644 --- a/src/templates/zshare/verifycard/index.jsx +++ b/src/templates/zshare/verifycard/index.jsx @@ -518,7 +518,7 @@ } }) - if (columns && columns.length > 0 && this.props.btnTab.Ot !== 'notRequired') { + if (columns && columns.length > 0 && this.props.btnTab.Ot !== 'notRequired' && this.props.btnTab.Ot !== 'requiredOnce') { columns.forEach(_f => { if (!_f.field || fieldArr.includes(_f.field.toLowerCase())) return @@ -757,7 +757,7 @@ }) } - if (columns && columns.length > 0 && this.props.card.Ot !== 'notRequired') { + if (columns && columns.length > 0 && this.props.card.Ot !== 'notRequired' && this.props.card.Ot !== 'requiredOnce') { columns.forEach(_f => { if (!_f.field || fieldArr.includes(_f.field.toLowerCase())) return @@ -901,7 +901,7 @@ let _select = ['@UserName=\'\'', '@FullName=\'\'', '@ErrorCode=\'\'', '@retmsg=\'\'', '@BillCode=\'\'', '@BVoucher=\'\'', '@FIBVoucherDate=\'\'', '@FiYear=\'\'', '@ModularDetailCode=\'\''] let fieldArr = _usefulfields.map(_f => _f.toLowerCase()) - if (columns && columns.length > 0 && this.props.card.Ot !== 'notRequired') { + if (columns && columns.length > 0 && this.props.card.Ot !== 'notRequired' && this.props.card.Ot !== 'requiredOnce') { columns.forEach(_f => { if (!_f.field || fieldArr.includes(_f.field.toLowerCase())) return @@ -949,7 +949,7 @@ _defaultsql = `update ${this.props.card.sql} set deleted=1,modifydate=getdate(),modifyuserid=@userid@ where ${config.setting.primaryKey}=@ID@;` } else if (this.props.card.sqlType === 'delete') { let _msg = '' - if (columns && columns.length > 0 && this.props.card.Ot !== 'notRequired') { + if (columns && columns.length > 0 && this.props.card.Ot !== 'notRequired' && this.props.card.Ot !== 'requiredOnce') { let _index = 0 columns.forEach(col => { if (col.field && col.Hide !== 'true' && _index < 4) { diff --git a/src/utils/utils.js b/src/utils/utils.js index 483aad4..8042fad 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -1162,16 +1162,16 @@ let datasource = setting.dataresource if (/\s/.test(datasource)) { // 鎷兼帴鍒悕 datasource = '(' + datasource + ') tb' + } else { + datasource = datasource + ' tb' } verify.uniques.forEach(item => { - let _primaryKey = item.field.split(',').includes(primaryKey) ? '' : ',' + primaryKey - _sql += ` /* 鍚岀被鏁版嵁楠岃瘉 */ Set @tbid='' - Select top 1 @tbid='X' from (select ${item.field}${_primaryKey},1 as n from ${datasource} ) tb inner join (select ID from dbo.SplitComma(@ID@)) sp on tb.${primaryKey}=sp.ID group by ${item.field} having sum(n)>1 + Select top 1 @tbid='X' from (select distinct ${item.field},1 as n from ${datasource} inner join (select ID from dbo.SplitComma(@ID@)) sp on tb.${primaryKey}=sp.ID ) a group by ${item.field} having sum(n)>1 If @tbid!='' Begin -- Gitblit v1.8.0