From b69b5f6329ca5f87932436b7a6c1ddfc3377e10f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 16 五月 2024 10:56:41 +0800 Subject: [PATCH] 2024-05-16 --- src/tabviews/zshare/actionList/changeuserbutton/index.jsx | 51 ++++++++++++--------------------------------------- 1 files changed, 12 insertions(+), 39 deletions(-) diff --git a/src/tabviews/zshare/actionList/changeuserbutton/index.jsx b/src/tabviews/zshare/actionList/changeuserbutton/index.jsx index 4935f6f..06cb05f 100644 --- a/src/tabviews/zshare/actionList/changeuserbutton/index.jsx +++ b/src/tabviews/zshare/actionList/changeuserbutton/index.jsx @@ -4,8 +4,6 @@ import { Button, notification, Modal } from 'antd' import Api from '@/api' -import zhCN from '@/locales/zh-CN/main.js' -import enUS from '@/locales/en-US/main.js' import MKEmitter from '@/utils/events.js' import MkIcon from '@/components/mk-icon' // import './index.scss' @@ -24,7 +22,6 @@ } state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, disabled: false, hidden: false, loading: false @@ -105,12 +102,13 @@ /** * @description 瑙﹀彂鎸夐挳鎿嶄綔 */ - actionTrigger = (triggerId, record, type) => { - const { setting, selectedData, btn, MenuID } = this.props + actionTrigger = (triggerId, record, type, lid) => { + const { setting, selectedData, btn, MenuID, LID } = this.props const { loading, disabled } = this.state if (loading || disabled) return if (triggerId && btn.uuid !== triggerId) return + if (type === 'linkbtn' && !btn.$toolbtn && LID !== lid) return if (btn.funcType === 'closetab') { MKEmitter.emit('closeTabView', MenuID || btn.$MenuID) @@ -118,8 +116,6 @@ if (btn.refreshTab && btn.refreshTab.length > 0) { MKEmitter.emit('reloadMenuView', btn.refreshTab[btn.refreshTab.length - 1], 'table') } - return - } else if (type === 'linkbtn' && !btn.$toolbtn && !is(fromJS(selectedData || []), fromJS(record))) { return } @@ -129,15 +125,7 @@ // 闇�瑕侀�夋嫨鍗曡鏃讹紝鏍¢獙鏁版嵁 notification.warning({ top: 92, - message: this.state.dict['main.action.confirm.selectSingleLine'], - duration: 5 - }) - return - } else if (!setting.primaryKey) { - // 闇�瑕侀�夋嫨琛屾椂锛屾牎楠屾槸鍚﹁缃富閿� - notification.warning({ - top: 92, - message: '鏈缃富閿紒', + message: '璇烽�夋嫨鍗曡鏁版嵁锛�', duration: 5 }) return @@ -174,7 +162,7 @@ param[setting.primaryKey] = primaryId confirm({ - title: this.state.dict['main.action.confirm.tip'], + title: '纭畾瑕佹墽琛屽悧?', onOk() { return new Promise(resolve => { Api.genericInterface(param).then(res => { @@ -210,7 +198,7 @@ } else { notification.error({ top: 92, - message: res.message || res.ErrMesg, + message: res.message || '鎵ц澶辫触锛�', duration: btn.verify && btn.verify.ntime ? btn.verify.ntime : 10 }) _this.setState({loading: false}) @@ -234,38 +222,23 @@ if (hidden) return null let label = '' - let icon = '' - let type = 'link' - let className = '' - if (btn.show === 'button') { - label = btn.label - icon = btn.icon || '' - } else if (btn.show === 'link') { - label = <span>{btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> - icon = '' + if (btn.show === 'link') { + label = <span>{btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon} /> : ''}</span> } else if (btn.show === 'icon') { - icon = btn.icon || '' - } else if (!btn.$toolbtn) { - icon = btn.icon || '' - label = btn.label - className = 'mk-btn mk-' + btn.class + label = !loading ? <MkIcon type={btn.icon} /> : null } else { - type = '' - icon = btn.icon || '' - label = btn.label - className = 'mk-btn mk-' + btn.class + label = <span>{!loading && btn.icon ? <MkIcon style={{marginRight: '8px'}} type={btn.icon} /> : ''}{btn.label}</span> } return ( <Button - type={type} + type="link" title={disabled ? (btn.reason || '') : (btn.show === 'icon' ? btn.label : '')} loading={loading} disabled={disabled} style={btn.style} - icon={icon} - className={className} + className={btn.hover || ''} onClick={(e) => {e.stopPropagation(); this.actionTrigger()}} >{label}</Button> ) -- Gitblit v1.8.0