Commit cc9f4476 by wuqian

九猫客户操作图标修改

parent 1997abcf
......@@ -387,71 +387,93 @@ export default {
align: 'center',
width: 120,
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 (
<el-dropdown
trigger="click"
onCommand={(cmd) => this.handleOperation(cmd, item)}>
<span class="el-dropdown-link">
相关操作<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
{['未开通', '开通失败'].includes(
item.erpServiceStatusName
) && (
<el-dropdown-item command="openErp">
<el-button
type="text"
style={{ color: '#2776ce', fontWeight: 'bold' }}>
开通ERP
</el-button>
</el-dropdown-item>
)}
{item.erpServiceStatusName === '已开通' && (
<el-dropdown-item command="closeErp">
<el-button
type="text"
style={{ color: '#909399', fontWeight: 'bold' }}>
关闭ERP
</el-button>
</el-dropdown-item>
)}
{item.erpServiceStatusName === '已开通' && (
<el-dropdown-item command="giftOrder">
<el-button
type="text"
style={{ color: '#9B59B6', fontWeight: 'bold' }}>
赠送订单
</el-button>
</el-dropdown-item>
)}
<el-dropdown-item command="edit">
<el-button
type="text"
disabled={item.erpServiceStatusName === '开通中'}
style={{ color: '#E6A23C', fontWeight: 'bold' }}>
编辑
</el-button>
</el-dropdown-item>
{['已关闭', '开通失败'].includes(
item.erpServiceStatusName
) && (
<el-dropdown-item command="delete">
<el-button
type="text"
style={{ color: '#F56C6C', fontWeight: 'bold' }}>
删除
</el-button>
</el-dropdown-item>
)}
<el-dropdown-item command="log">
<el-button
type="text"
style={{ color: '#00B4D8', fontWeight: 'bold' }}>
操作日志
</el-button>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<div
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
gap: '6px'
}}>
<img
src={require('@/assets/images/edit.png')}
style={{
...imgStyle,
opacity: isActivating ? 0.4 : 1,
cursor: isActivating ? 'not-allowed' : 'pointer'
}}
title="编辑"
onClick={() => {
if (!isActivating) this.handleOperation('edit', item)
}}
/>
<img
src={require('@/assets/images/log.png')}
style={imgStyle}
title="操作日志"
onClick={() => this.handleOperation('log', item)}
/>
<el-dropdown
trigger="click"
onCommand={(cmd) => this.handleOperation(cmd, item)}>
<span style={{ lineHeight: 1, display: 'inline-block' }}>
<img
title="更多"
src={require('@/assets/images/more.png')}
style={imgStyle}
/>
</span>
<el-dropdown-menu slot="dropdown">
{canOpen && (
<el-dropdown-item command="openErp">
<el-button
type="text"
style={{ color: '#2776ce', fontWeight: 'bold' }}>
开通ERP
</el-button>
</el-dropdown-item>
)}
{isOpen && (
<el-dropdown-item command="closeErp">
<el-button
type="text"
style={{ color: '#909399', fontWeight: 'bold' }}>
关闭ERP
</el-button>
</el-dropdown-item>
)}
{isOpen && (
<el-dropdown-item command="giftOrder">
<el-button
type="text"
style={{ color: '#9B59B6', fontWeight: 'bold' }}>
赠送订单
</el-button>
</el-dropdown-item>
)}
{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