|
|
@@ -197,6 +197,7 @@
|
|
|
<el-table-column label="操作" width="360" fixed="right" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
+ <!-- 前4个按钮保持展示 -->
|
|
|
<el-button
|
|
|
v-if="$permission.getUserInfo().dataScope === 0"
|
|
|
v-region-permission="{
|
|
|
@@ -245,70 +246,81 @@
|
|
|
>
|
|
|
修改内容
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- size="mini"
|
|
|
- @click="handleDropdownCommand('infoMaintain', scope.row)"
|
|
|
- >
|
|
|
- 信息维护
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-if="$permission.getUserInfo().dataScope === 0"
|
|
|
- v-region-permission="{
|
|
|
- category: 'catalogManage',
|
|
|
- action: 'edit',
|
|
|
- }"
|
|
|
- type="text"
|
|
|
- @click.native="handleDropdownCommand('status', scope.row)"
|
|
|
- >
|
|
|
- {{ scope.row.status === 1 ? '停用' : '启用' }}
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-if="$permission.getUserInfo().dataScope === 0"
|
|
|
- v-region-permission="{
|
|
|
- category: 'catalogManage',
|
|
|
- action: 'delete',
|
|
|
- }"
|
|
|
- type="text"
|
|
|
- class="delete-btn"
|
|
|
- @click.native="handleDropdownCommand('delete', scope.row)"
|
|
|
- >
|
|
|
- 删除
|
|
|
- </el-button>
|
|
|
- <!-- 第四个以后的按钮放入更多下拉菜单 -->
|
|
|
- <!-- <el-dropdown v-if="
|
|
|
- $permission.getUserInfo().dataScope === 0 &&
|
|
|
- scope.row.status != 0 &&
|
|
|
- scope.row.nodeType !== 'nr'
|
|
|
- " v-region-permission="{
|
|
|
- category: 'catalogManage',
|
|
|
- action: 'edit',
|
|
|
- }" trigger="click" class="ml10">
|
|
|
- <el-button type="text" size="mini">
|
|
|
- 更多
|
|
|
- <i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+
|
|
|
+ <!-- 当操作按钮超过4个时,其余按钮收纳到“更多” -->
|
|
|
+ <template v-if="shouldUseMore(scope.row)">
|
|
|
+ <el-dropdown trigger="click" class="ml10">
|
|
|
+ <el-button type="text" size="mini">
|
|
|
+ 更多
|
|
|
+ <i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item
|
|
|
+ @click.native="
|
|
|
+ handleDropdownCommand('infoMaintain', scope.row)
|
|
|
+ "
|
|
|
+ >
|
|
|
+ 信息维护
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item
|
|
|
+ v-if="$permission.getUserInfo().dataScope === 0"
|
|
|
+ v-region-permission="{
|
|
|
+ category: 'catalogManage',
|
|
|
+ action: 'edit',
|
|
|
+ }"
|
|
|
+ divided
|
|
|
+ @click.native="handleDropdownCommand('status', scope.row)"
|
|
|
+ >
|
|
|
+ {{ scope.row.status === 1 ? '停用' : '启用' }}
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item
|
|
|
+ v-if="$permission.getUserInfo().dataScope === 0"
|
|
|
+ v-region-permission="{
|
|
|
+ category: 'catalogManage',
|
|
|
+ action: 'delete',
|
|
|
+ }"
|
|
|
+ class="dropdown-delete"
|
|
|
+ @click.native="handleDropdownCommand('delete', scope.row)"
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!-- 不超过4个时,仍按原方式平铺显示 -->
|
|
|
+ <template v-else>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="mini"
|
|
|
+ @click="handleDropdownCommand('infoMaintain', scope.row)"
|
|
|
+ >
|
|
|
+ 信息维护
|
|
|
</el-button>
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item v-region-permission="{
|
|
|
- category: 'catalogManage',
|
|
|
- action: 'edit',
|
|
|
- }" @click.native="handleDropdownCommand('infoMaintain', scope.row)">
|
|
|
- 信息维护
|
|
|
- </el-dropdown-item>
|
|
|
- <el-dropdown-item v-region-permission="{
|
|
|
+ <el-button
|
|
|
+ v-if="$permission.getUserInfo().dataScope === 0"
|
|
|
+ v-region-permission="{
|
|
|
category: 'catalogManage',
|
|
|
action: 'edit',
|
|
|
- }" divided @click.native="handleDropdownCommand('status', scope.row)">
|
|
|
- {{ scope.row.status === 1 ? '停用' : '启用' }}
|
|
|
- </el-dropdown-item>
|
|
|
- <el-dropdown-item v-region-permission="{
|
|
|
+ }"
|
|
|
+ type="text"
|
|
|
+ @click.native="handleDropdownCommand('status', scope.row)"
|
|
|
+ >
|
|
|
+ {{ scope.row.status === 1 ? '停用' : '启用' }}
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="$permission.getUserInfo().dataScope === 0"
|
|
|
+ v-region-permission="{
|
|
|
category: 'catalogManage',
|
|
|
action: 'delete',
|
|
|
- }" @click.native="handleDropdownCommand('delete', scope.row)">
|
|
|
- 删除
|
|
|
- </el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
- </el-dropdown> -->
|
|
|
+ }"
|
|
|
+ type="text"
|
|
|
+ class="delete-btn"
|
|
|
+ @click.native="handleDropdownCommand('delete', scope.row)"
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -1720,6 +1732,10 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ // 操作按钮超过4个时,使用“更多”下拉(目前 dataScope=0 时按钮数量固定超过4)
|
|
|
+ shouldUseMore() {
|
|
|
+ return this.$permission.getUserInfo().dataScope === 0
|
|
|
+ },
|
|
|
// 添加处理下拉菜单命令的方法
|
|
|
handleDropdownCommand(command, row) {
|
|
|
switch (command) {
|
|
|
@@ -2313,4 +2329,12 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .dropdown-delete {
|
|
|
+ color: #f56c6c;
|
|
|
+ }
|
|
|
+
|
|
|
+ .dropdown-delete:hover {
|
|
|
+ color: #f56c6c;
|
|
|
+ }
|
|
|
</style>
|