Commit cc9f4476 by wuqian

九猫客户操作图标修改

parent 1997abcf
...@@ -387,71 +387,93 @@ export default { ...@@ -387,71 +387,93 @@ export default {
align: 'center', align: 'center',
width: 120, width: 120,
render: (item) => { render: (item) => {
const status = item.erpServiceStatusName
const isOpen = status === '已开通'
const isActivating = status === '开通中'
const canOpen = ['未开通', '开通失败'].includes(status)
const canDelete = ['已关闭', '开通失败'].includes(status)
const imgStyle = {
width: '24px',
height: '24px',
cursor: 'pointer',
verticalAlign: 'middle'
}
return ( return (
<el-dropdown <div
trigger="click" style={{
onCommand={(cmd) => this.handleOperation(cmd, item)}> display: 'flex',
<span class="el-dropdown-link"> alignItems: 'center',
相关操作<i class="el-icon-arrow-down el-icon--right"></i> justifyContent: 'center',
</span> gap: '6px'
<el-dropdown-menu slot="dropdown"> }}>
{['未开通', '开通失败'].includes( <img
item.erpServiceStatusName src={require('@/assets/images/edit.png')}
) && ( style={{
<el-dropdown-item command="openErp"> ...imgStyle,
<el-button opacity: isActivating ? 0.4 : 1,
type="text" cursor: isActivating ? 'not-allowed' : 'pointer'
style={{ color: '#2776ce', fontWeight: 'bold' }}> }}
开通ERP title="编辑"
</el-button> onClick={() => {
</el-dropdown-item> if (!isActivating) this.handleOperation('edit', item)
)} }}
{item.erpServiceStatusName === '已开通' && ( />
<el-dropdown-item command="closeErp"> <img
<el-button src={require('@/assets/images/log.png')}
type="text" style={imgStyle}
style={{ color: '#909399', fontWeight: 'bold' }}> title="操作日志"
关闭ERP onClick={() => this.handleOperation('log', item)}
</el-button> />
</el-dropdown-item> <el-dropdown
)} trigger="click"
{item.erpServiceStatusName === '已开通' && ( onCommand={(cmd) => this.handleOperation(cmd, item)}>
<el-dropdown-item command="giftOrder"> <span style={{ lineHeight: 1, display: 'inline-block' }}>
<el-button <img
type="text" title="更多"
style={{ color: '#9B59B6', fontWeight: 'bold' }}> src={require('@/assets/images/more.png')}
赠送订单 style={imgStyle}
</el-button> />
</el-dropdown-item> </span>
)} <el-dropdown-menu slot="dropdown">
<el-dropdown-item command="edit"> {canOpen && (
<el-button <el-dropdown-item command="openErp">
type="text" <el-button
disabled={item.erpServiceStatusName === '开通中'} type="text"
style={{ color: '#E6A23C', fontWeight: 'bold' }}> style={{ color: '#2776ce', fontWeight: 'bold' }}>
编辑 开通ERP
</el-button> </el-button>
</el-dropdown-item> </el-dropdown-item>
{['已关闭', '开通失败'].includes( )}
item.erpServiceStatusName {isOpen && (
) && ( <el-dropdown-item command="closeErp">
<el-dropdown-item command="delete"> <el-button
<el-button type="text"
type="text" style={{ color: '#909399', fontWeight: 'bold' }}>
style={{ color: '#F56C6C', fontWeight: 'bold' }}> 关闭ERP
删除 </el-button>
</el-button> </el-dropdown-item>
</el-dropdown-item> )}
)} {isOpen && (
<el-dropdown-item command="log"> <el-dropdown-item command="giftOrder">
<el-button <el-button
type="text" type="text"
style={{ color: '#00B4D8', fontWeight: 'bold' }}> style={{ color: '#9B59B6', fontWeight: 'bold' }}>
操作日志 赠送订单
</el-button> </el-button>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> )}
</el-dropdown> {canDelete && (
<el-dropdown-item command="delete">
<el-button
type="text"
style={{ color: '#F56C6C', fontWeight: 'bold' }}>
删除
</el-button>
</el-dropdown-item>
)}
</el-dropdown-menu>
</el-dropdown>
</div>
) )
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment