From e35e2d2e9956803b4ec5356395b02a6484441b4f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 20 二月 2025 16:58:41 +0800 Subject: [PATCH] 2025-02-20 --- src/menu/lowerField/index.jsx | 4 +- src/tabviews/custom/components/editor/braft-editor/index.scss | 4 +- src/tabviews/custom/components/card/prop-card/index.jsx | 7 +++ src/tabviews/custom/components/group/normal-group/index.jsx | 39 ++++++++++++++++++- src/utils/utils-custom.js | 9 ++++ src/menu/components/group/normal-group/index.jsx | 17 +++++++- src/menu/components/group/normal-group/options.jsx | 12 +++++ 7 files changed, 80 insertions(+), 12 deletions(-) diff --git a/src/menu/components/group/normal-group/index.jsx b/src/menu/components/group/normal-group/index.jsx index aa41f27..dee11cf 100644 --- a/src/menu/components/group/normal-group/index.jsx +++ b/src/menu/components/group/normal-group/index.jsx @@ -116,9 +116,20 @@ } getWrapForms = () => { - const { setting } = this.state.group + const { group } = this.state - return getSettingForm(setting) + let list = [] + group.components.forEach(item => { + if (item.type === 'card' && item.subtype === 'propcard') { + list.push({ + value: item.uuid, + label: item.name, + disabled: item.wrap.empty !== 'hidden' + }) + } + }) + + return getSettingForm(group.setting, list) } updateWrap = (res) => { @@ -175,7 +186,7 @@ <NormalHeader hideSearch="true" config={group} updateComponent={this.updateComponent}/> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> - <NormalForm title="鍒嗙粍璁剧疆" width={700} update={this.updateWrap} getForms={this.getWrapForms}> + <NormalForm title="鍒嗙粍璁剧疆" width={800} update={this.updateWrap} getForms={this.getWrapForms}> <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> <CopyComponent type="group" card={group}/> diff --git a/src/menu/components/group/normal-group/options.jsx b/src/menu/components/group/normal-group/options.jsx index 521a003..abad0cf 100644 --- a/src/menu/components/group/normal-group/options.jsx +++ b/src/menu/components/group/normal-group/options.jsx @@ -1,7 +1,7 @@ /** * @description Wrap琛ㄥ崟閰嶇疆淇℃伅 */ -export default function (setting) { +export default function (setting, list) { let roleList = sessionStorage.getItem('sysRoles') let appType = sessionStorage.getItem('appType') @@ -42,6 +42,16 @@ precision: 0, required: true }, + { + type: 'select', + field: 'bindPropId', + label: '鏄剧ず鐘舵�佺粦瀹�', + initval: setting.bindPropId || '', + tooltip: '鍒嗙粍鍙粦瀹氳鏈夌┖鍊奸殣钘忕殑灞炴�у崱锛屽綋灞炴�у崱闅愯棌鏃跺垎缁勪竴鍚岄殣钘忋��', + required: false, + options: list, + forbid: appType === 'mob' + }, // { // type: 'radio', // field: 'print', diff --git a/src/menu/lowerField/index.jsx b/src/menu/lowerField/index.jsx index 7822765..3b0516c 100644 --- a/src/menu/lowerField/index.jsx +++ b/src/menu/lowerField/index.jsx @@ -66,7 +66,7 @@ }) } let resetElement = (m) => { - if (m.field) { + if (m.field && m.field !== '$Index') { m.field = m.field.toLowerCase() } if (m.posterField) { @@ -219,7 +219,7 @@ if (item.subcards) { item.subcards.forEach(card => { if (card.setting) { - if (card.setting.controlField) { + if (card.setting.controlField && card.setting.controlField !== '$Index') { card.setting.controlField = card.setting.controlField.toLowerCase() } if (card.setting.bgField) { diff --git a/src/tabviews/custom/components/card/prop-card/index.jsx b/src/tabviews/custom/components/card/prop-card/index.jsx index 001d66e..09c1289 100644 --- a/src/tabviews/custom/components/card/prop-card/index.jsx +++ b/src/tabviews/custom/components/card/prop-card/index.jsx @@ -432,7 +432,12 @@ transferLine = () => { const { config, data } = this.state - if (config.wrap.cardType) return + if (config.wrap.cardType) { + if (config.wrap.empty === 'hidden') { + MKEmitter.emit('resetSelectLine', config.uuid, data.$$uuid || '', data) + } + return + } MKEmitter.emit('resetSelectLine', config.uuid, data.$$uuid || '', data) } diff --git a/src/tabviews/custom/components/editor/braft-editor/index.scss b/src/tabviews/custom/components/editor/braft-editor/index.scss index fcbf6a0..b55bc6c 100644 --- a/src/tabviews/custom/components/editor/braft-editor/index.scss +++ b/src/tabviews/custom/components/editor/braft-editor/index.scss @@ -79,7 +79,7 @@ } .custom-braft-editor-box.word-break { .braft-content { - table { + table:not(.no-break) { td, th { word-break: break-all!important; } @@ -88,7 +88,7 @@ } .custom-braft-editor-box.tb-flex { .braft-content { - table { + table:not(.no-flex) { table-layout: fixed; } } diff --git a/src/tabviews/custom/components/group/normal-group/index.jsx b/src/tabviews/custom/components/group/normal-group/index.jsx index 3868f59..0f33480 100644 --- a/src/tabviews/custom/components/group/normal-group/index.jsx +++ b/src/tabviews/custom/components/group/normal-group/index.jsx @@ -3,6 +3,7 @@ import { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons' import asyncComponent from '@/utils/asyncComponent' +import MKEmitter from '@/utils/events.js' import './index.scss' const TabTransfer = asyncComponent(() => import('@/tabviews/custom/components/share/tabtransfer')) @@ -14,17 +15,51 @@ state = { visible: true, + hidden: false, mergeAble: this.props.config.setting.mergeAble === 'true' + } + + componentDidMount () { + const { config } = this.props + + if (config.setting.bindPropId) { + MKEmitter.addListener('resetSelectLine', this.resetStatus) + } + } + + componentWillUnmount () { + this.setState = () => { + return + } + MKEmitter.removeListener('resetSelectLine', this.resetStatus) + } + + resetStatus = (MenuID, _, data) => { + const { config } = this.props + + if (config.setting.bindPropId !== MenuID) return + + if (!data || data.$$empty) { + this.setState({hidden: true}) + } else { + this.setState({hidden: false}) + } } render() { const { config, style } = this.props - const { visible, mergeAble } = this.state + const { visible, mergeAble, hidden } = this.state if (config.components.length === 0) return (<div className={'ant-col ant-col-' + config.width} style={style}><div style={config.style}></div></div>) + + let _wrapStyle = style + if (hidden) { + _wrapStyle = {...style} + _wrapStyle.display = 'none' + } return ( - <div className={`ant-col ant-col-${config.width} ${mergeAble ? ' mk-merge-able mk-ctrl-' + (config.setting.ctrlNumber || 1) : ''} ${visible ? '' : ' close'}`} style={style}> + <div className={`ant-col ant-col-${config.width} ${mergeAble ? ' mk-merge-able mk-ctrl-' + (config.setting.ctrlNumber || 1) : ''} ${visible ? '' : ' close'}`} style={_wrapStyle}> <div className={'normal-group-wrap ' + (config.setting.layout || '')} id={'anchor' + config.uuid} style={config.style}> <div className="mk-control"> <DoubleLeftOutlined onClick={() => this.setState({visible: false})}/> diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js index fd5c790..ce328a7 100644 --- a/src/utils/utils-custom.js +++ b/src/utils/utils-custom.js @@ -2334,9 +2334,16 @@ }) return false } else if (/\sdecimal\(8,/ig.test(sql)) { + let lines = '' + sql.split(/\n/).forEach((s, i) => { + if (/(^|\s)decimal\(8,/ig.test(s)) { + lines = '绗�' + (i + 1) + '琛屼腑' + } + }) + notification.warning({ top: 92, - message: `涓嶅彲浣跨敤 decimal(8`, + message: `${lines}涓嶅彲浣跨敤 decimal(8`, duration: 5 }) return false -- Gitblit v1.8.0