From 9282e645d0205f85bf0d424a0b2f5c42c2aae1d9 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 21 五月 2025 11:40:32 +0800 Subject: [PATCH] 2025-05-21 --- src/tabviews/zshare/actionList/funcMegvii/index.jsx | 96 +++++++++++++++++++----------------------------- 1 files changed, 38 insertions(+), 58 deletions(-) diff --git a/src/tabviews/zshare/actionList/funcMegvii/index.jsx b/src/tabviews/zshare/actionList/funcMegvii/index.jsx index 6da5dc4..29638b1 100644 --- a/src/tabviews/zshare/actionList/funcMegvii/index.jsx +++ b/src/tabviews/zshare/actionList/funcMegvii/index.jsx @@ -108,58 +108,55 @@ /** * @description 瑙﹀彂鎸夐挳鎿嶄綔 */ - actionTrigger = (triggerId, record, type) => { - const { BID, btn, selectedData, setting } = this.props + actionTrigger = (triggerId, record, type, lid) => { + const { BID, btn, selectedData, setting, 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 + + let data = record || selectedData || [] + // let data = fromJS(mockdata.data).toJS() if (setting.supModule && !BID) { notification.warning({ top: 92, - message: '闇�瑕佷笂绾т富閿�硷紒', + message: setting.supModTip || '闇�瑕佷笂绾т富閿�硷紒', duration: 5 }) - return - } else if (type === 'linkbtn' && !btn.$toolbtn && !is(fromJS(selectedData || []), fromJS(record))) { - return - } - - let data = record || selectedData || [] - // let data = fromJS(mockdata.data).toJS() - - if (data.length === 0) { + } else if (data.length === 0) { // 闇�瑕侀�夋嫨琛屾椂锛屾牎楠屾暟鎹� notification.warning({ top: 92, message: '璇烽�夋嫨琛岋紒', duration: 5 }) - return + } else { + this.setState({ + loading: true, + lines: data + }) + this.getIpList() } - - this.setState({ - loading: true, - lines: data - }) - this.getIpList() } getIpList = () => { let _scriptSql = `select ID,data_code,data_name,Remark,face_ip,face_uname,face_pwd from bd_data where typecharone='face_device' and deleted=0` - _scriptSql = Utils.formatOptions(_scriptSql) - let _sParam = { func: 'sPC_Get_SelectedList', - LText: _scriptSql, obj_name: 'data', arr_field: 'ID,data_code,data_name,Remark,face_ip,face_uname,face_pwd' } + + if (window.GLOB.execType === 'x') { + _sParam.exec_type = 'x' + } + _sParam.LText = Utils.formatOptions(_scriptSql, _sParam.exec_type) _sParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - _sParam.secretkey = Utils.encrypt(_sParam.LText, _sParam.timestamp) + _sParam.secretkey = Utils.encrypt(window.GLOB.execType === 'x' ? '' : _sParam.LText, _sParam.timestamp) NApi.getSystemCacheConfig(_sParam).then(res => { if (res.status) { @@ -292,7 +289,7 @@ } if (error) { - this.execError({ErrCode: 'E', ErrMesg: error}) + this.execError({ErrCode: 'E', message: error}) return } @@ -312,7 +309,7 @@ if (datas.length > 0) { this.addUser(ip, datas, sessionId) } else { - this.execSuccess({ErrCode: 'S', ErrMesg: '鎵ц鎴愬姛銆�'}) + this.execSuccess({ErrCode: 'S', message: '鎵ц鎴愬姛銆�'}) } }, (err) => { this.execPreError(err, data) @@ -327,18 +324,18 @@ * 4銆佹ā鎬佹鎵ц鎴愬姛鍚庢槸鍚﹀叧闂� * 5銆侀�氱煡涓诲垪琛ㄥ埛鏂� */ - execSuccess = (res) => { + execSuccess = (res = {}) => { const { btn } = this.props - if (res && (res.ErrCode === 'S' || !res.ErrCode)) { // 鎵ц鎴愬姛 + if (res.ErrCode === 'S' || !res.ErrCode) { // 鎵ц鎴愬姛 notification.success({ top: 92, - message: res.ErrMesg || '鎵ц鎴愬姛', + message: res.message || '鎵ц鎴愬姛', duration: btn.verify && btn.verify.stime ? btn.verify.stime : 2 }) } else if (res && res.ErrCode === 'Y') { // 鎵ц鎴愬姛 Modal.success({ - title: res.ErrMesg || '鎵ц鎴愬姛' + title: res.message || '鎵ц鎴愬姛' }) } else if (res && res.ErrCode === '-1') { // 瀹屾垚鍚庝笉鎻愮ず @@ -409,23 +406,23 @@ if (res.ErrCode === 'E') { Modal.error({ - title: res.message || res.ErrMesg, + title: res.message || '鎵ц澶辫触锛�', }) } else if (res.ErrCode === 'N') { notification.error({ top: 92, - message: res.message || res.ErrMesg, + message: res.message || '鎵ц澶辫触锛�', 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 || res.ErrMesg, + message: res.message || '鎵ц澶辫触锛�', duration: btn.verify && btn.verify.ftime ? btn.verify.ftime : 10 }) } else if (res.ErrCode === 'NM') { - message.error(res.message || res.ErrMesg) + message.error(res.message || '鎵ц澶辫触锛�') } this.setState({ @@ -512,43 +509,26 @@ 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 if (btn.$toolbtn) { + label = <span>{!loading && btn.icon ? <MkIcon style={{marginRight: '8px'}} type={btn.icon} /> : ''}{loadingNumber && !loadingTotal ? `(${loadingNumber})` : ''}{btn.label}</span> } else { - type = '' - icon = btn.icon || '' - label = btn.label - className = 'mk-btn mk-' + btn.class - } - - if (loadingNumber && !loadingTotal && btn.$toolbtn && (!btn.show || btn.show === 'button')) { - label = (loadingNumber && !loadingTotal ? `(${loadingNumber})` : '') + btn.label + 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> {this.getModels()} -- Gitblit v1.8.0