From e4666c46c685ec7eabff25af9890d54c0ff2952b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 16 六月 2023 17:55:56 +0800 Subject: [PATCH] 2023-06-16 --- src/tabviews/zshare/actionList/normalbutton/index.jsx | 40 ++++++++++++++++++++++++++++++++++++++-- 1 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 8b9b3ea..2c4b340 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -62,7 +62,7 @@ if (btn.OpenType === 'form') { let data = selectedData && selectedData[0] ? selectedData[0] : null - if (btn.formType === 'counter') { + if (btn.formType === 'counter' || btn.formType === 'count_line') { let count = 0 if (data && data[btn.field]) { count = +data[btn.field] @@ -109,7 +109,7 @@ if (btn.OpenType === 'form') { let data = nextProps.selectedData && nextProps.selectedData[0] ? nextProps.selectedData[0] : null - if (btn.formType === 'counter') { + if (btn.formType === 'counter' || btn.formType === 'count_line') { let count = 0 if (data && data[btn.field]) { count = +data[btn.field] @@ -330,6 +330,9 @@ return } } else if (!['inner', 'outer', 'system', 'custom'].includes(btn.intertype)) { + if (btn.OpenType === 'form' && btn.formType === 'count_line') { + return + } // 鎺ュ彛绫诲瀷閿欒 notification.warning({ top: 92, @@ -3010,6 +3013,37 @@ }) } + changeLineCount = (count) => { + const { btn, selectedData } = this.props + const { disabled } = this.state + + if (disabled) return + + let data = selectedData || [] + + if (data.length === 0) { + // 闇�瑕侀�夋嫨琛屾椂锛屾牎楠屾暟鎹� + notification.warning({ + top: 92, + message: this.state.dict['main.action.confirm.selectline'], + duration: 5 + }) + return + } else if (data.length !== 1) { + // 闇�瑕侀�夋嫨鍗曡鏃讹紝鏍¢獙鏁版嵁 + notification.warning({ + top: 92, + message: this.state.dict['main.action.confirm.selectSingleLine'], + duration: 5 + }) + return + } + + this.setState({count}, () => { + MKEmitter.emit('refreshLineData', btn.$menuId, btn, data[0].$$uuid, count) + }) + } + render() { const { btn } = this.props const { loadingNumber, loadingTotal, loading, disabled, hidden, check, count } = this.state @@ -3020,6 +3054,8 @@ return <Switch loading={loading} checked={check} disabled={disabled || loading} title={disabled ? (btn.reason || '') : ''} onChange={(val,e) => {e.stopPropagation();this.actionTrigger()}} style={btn.style} className={btn.size === 'large' ? 'ant-switch-large' : ''} size={btn.size} checkedChildren={btn.openText || ''} unCheckedChildren={btn.closeText || ''}/> } else if (btn.formType === 'counter') { return <MkCounter count={count} disabled={disabled} btn={btn} onChange={this.changeCount}/> + } else if (btn.formType === 'count_line') { + return <MkCounter count={count} disabled={disabled} btn={btn} onChange={this.changeLineCount}/> } else if (btn.formType === 'radio') { return <Checkbox className={btn.checkType || ''} disabled={disabled || loading} title={disabled ? (btn.reason || '') : ''} checked={check} onChange={(e) => {e.stopPropagation();this.actionTrigger()}} style={btn.style}></Checkbox> } else { -- Gitblit v1.8.0