From 2bccb9ec7bdefe23292a22bc153463cfa1479a49 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 21 六月 2024 16:25:42 +0800 Subject: [PATCH] 2024-06-21 --- src/tabviews/zshare/actionList/funcbutton/index.jsx | 35 +++++++++++++++++++++-------------- 1 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/tabviews/zshare/actionList/funcbutton/index.jsx b/src/tabviews/zshare/actionList/funcbutton/index.jsx index cf887d2..10786db 100644 --- a/src/tabviews/zshare/actionList/funcbutton/index.jsx +++ b/src/tabviews/zshare/actionList/funcbutton/index.jsx @@ -23,6 +23,7 @@ loading: false, disabled: false, hidden: false, + dict: window.GLOB.dict } UNSAFE_componentWillMount () { @@ -102,7 +103,7 @@ */ actionTrigger = (triggerId, record, type, lid) => { const { btn, BID, selectedData, LID } = this.props - const { loading } = this.state + const { loading, dict } = this.state if (loading) return if (triggerId && btn.uuid !== triggerId) return @@ -112,14 +113,14 @@ let error = '' if (btn.funcType === 'shareLink' && window.GLOB.systemType === 'production' && !btn.shareProUrl) { - error = '灏氭湭璁剧疆姝e紡绯荤粺閾炬帴鍦板潃锛�' + error = dict['no_prod_link'] || '灏氭湭璁剧疆姝e紡绯荤粺閾炬帴鍦板潃锛�' } else if (btn.funcType === 'refund') { if (data.length === 0) { - error = '璇烽�夋嫨琛岋紒' + error = dict['select_row'] || '璇烽�夋嫨琛岋紒' } else if (data.length !== 1) { - error = '璇烽�夋嫨鍗曡鏁版嵁锛�' + error = dict['select_single_row'] || '璇烽�夋嫨鍗曡鏁版嵁锛�' } else if (!data[0].$$uuid) { - error = '鏈幏鍙栧埌璁㈠崟缂栧彿锛�' + error = dict['no_ordercode'] || '鏈幏鍙栧埌璁㈠崟缂栧彿锛�' } } @@ -160,7 +161,9 @@ const that = this confirm({ - title: btn.tipTitle || '纭畾瑕佹墽琛屽悧?', + title: btn.tipTitle || dict['exec_sure'] || '纭畾瑕佹墽琛屽悧?', + okText: dict['ok'] || '纭畾', + cancelText: dict['cancel'] || '鍙栨秷', onOk() { that.execRefund(orderId) }, @@ -172,7 +175,7 @@ execRefund = (orderId) => { Api.setRefund(orderId).then(res => { if (!res.status) { - this.execError({ErrCode: 'E', message: '鎵ц澶辫触锛�', ...res}) + this.execError({ErrCode: 'E', message: window.GLOB.dict['exc_fail'] || '鎵ц澶辫触锛�', ...res}) } else { this.execSuccess({ErrCode: 'S', ...res}) } @@ -243,22 +246,24 @@ title: btn.shareTip }) } else { - message.success('宸插鍒跺埌鍓垏鏉裤��') + message.success(window.GLOB.dict['copied'] || '宸插鍒跺埌鍓垏鏉裤��') } } execSuccess = (res = {}) => { const { btn } = this.props + const { dict } = this.state if (res.ErrCode === 'S' || !res.ErrCode) { // 鎵ц鎴愬姛 notification.success({ top: 92, - message: res.message || '鎵ц鎴愬姛锛�', + message: res.message || dict['exc_success'] || '鎵ц鎴愬姛锛�', duration: btn.verify && btn.verify.stime ? btn.verify.stime : 2 }) } else if (res.ErrCode === 'Y') { // 鎵ц鎴愬姛 Modal.success({ - title: res.message || '鎵ц鎴愬姛锛�' + title: res.message || dict['exc_success'] || '鎵ц鎴愬姛锛�', + okText: dict['got_it'] || '鐭ラ亾浜�' }) } else if (res.ErrCode === '-1') { // 瀹屾垚鍚庝笉鎻愮ず @@ -275,6 +280,7 @@ execError = (res) => { const { btn } = this.props + const { dict } = this.state if (!['LoginError', 'C', '-2', 'E', 'N', 'F', 'NM'].includes(res.ErrCode)) { res.ErrCode = 'E' @@ -282,23 +288,24 @@ if (res.ErrCode === 'E') { Modal.error({ - title: res.message || '鎵ц澶辫触锛�', + title: res.message || dict['exc_fail'] || '鎵ц澶辫触锛�', + okText: dict['got_it'] || '鐭ラ亾浜�' }) } else if (res.ErrCode === 'N') { notification.error({ top: 92, - message: res.message || '鎵ц澶辫触锛�', + message: res.message || dict['exc_fail'] || '鎵ц澶辫触锛�', duration: btn.verify && btn.verify.ntime ? btn.verify.ntime : 10 }) } else if (res.ErrCode === 'F') { notification.error({ className: 'notification-custom-error', top: 92, - message: res.message || '鎵ц澶辫触锛�', + message: res.message || dict['exc_fail'] || '鎵ц澶辫触锛�', duration: btn.verify && btn.verify.ftime ? btn.verify.ftime : 10 }) } else if (res.ErrCode === 'NM') { - message.error(res.message || '鎵ц澶辫触锛�') + message.error(res.message || dict['exc_fail'] || '鎵ц澶辫触锛�') } this.setState({ -- Gitblit v1.8.0