|
@@ -19,7 +19,7 @@
|
|
|
<Plus />
|
|
|
</el-icon>
|
|
|
</el-button>
|
|
|
- <el-button type="danger" @click="batch_del" :disabled="curSelectionRows.length === 0">
|
|
|
+ <el-button type="danger" :disabled="curSelectionRows.length === 0" @click="batch_del">
|
|
|
<el-icon class="btn-icon">
|
|
|
<Delete />
|
|
|
</el-icon>
|
|
@@ -66,8 +66,8 @@
|
|
|
<!-- 权限设置 -->
|
|
|
<Permission
|
|
|
v-if="visiblePermission"
|
|
|
- :role-id="curSelectionRows.map(item => item.id).join(',')"
|
|
|
v-model="visiblePermission"
|
|
|
+ :role-id="curSelectionRows.map(item => item.id).join(',')"
|
|
|
@closed="visiblePermission = false"
|
|
|
/>
|
|
|
</div>
|
|
@@ -75,7 +75,7 @@
|
|
|
<script lang="tsx" setup>
|
|
|
import role from '@/api/system/role'
|
|
|
import { computed, nextTick, ref, watch } from 'vue'
|
|
|
-import { ElMessage, ElTree } from 'element-plus'
|
|
|
+import { ElMessage, ElMessageBox, ElTree } from 'element-plus'
|
|
|
import { useTablePage } from '@/hooks/useTablePage'
|
|
|
import { Plus, Delete } from '@element-plus/icons-vue'
|
|
|
import StatusIndicator from '@/components/StatusIndicator'
|
|
@@ -244,6 +244,7 @@ const { searchData, tableOpts, checkedColumns, activeColumns, curSelectionRows,
|
|
|
const deleteItem = async ids => {
|
|
|
try {
|
|
|
await role.roleDeleteApi(ids)
|
|
|
+ ElMessage.success(`删除成功~`)
|
|
|
updateParams()
|
|
|
} catch (e) {
|
|
|
console.log('删除失败')
|
|
@@ -259,7 +260,14 @@ const table_del = row => {
|
|
|
//批量删除
|
|
|
const batch_del = () => {
|
|
|
const ids = curSelectionRows.value.map(item => item.id) // 多选数据
|
|
|
- deleteItem(ids)
|
|
|
+ ElMessageBox.confirm('是否删除选中数据?', '提示', {
|
|
|
+ confirmButtonText: '确认',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'error',
|
|
|
+ buttonSize: 'default'
|
|
|
+ }).then(() => {
|
|
|
+ deleteItem(ids)
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
const table_edit = async row => {
|