mirror of
https://gitee.com/log4j/pig-ui.git
synced 2024-12-23 05:40:20 +08:00
refec: app密钥,客户管理批量删除
This commit is contained in:
parent
a49da81d89
commit
10f72d263f
@ -23,10 +23,11 @@ export function getObj(id?: string) {
|
||||
})
|
||||
}
|
||||
|
||||
export function delObj(id?: string) {
|
||||
export function delObj(ids?: object) {
|
||||
return request({
|
||||
url: '/admin/appsocial/' + id,
|
||||
method: 'delete'
|
||||
url: '/admin/appsocial/',
|
||||
method: 'delete',
|
||||
data:ids
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -23,10 +23,11 @@ export function getObj(id: string) {
|
||||
})
|
||||
}
|
||||
|
||||
export function delObj(id: string) {
|
||||
export function delObj(ids?: object) {
|
||||
return request({
|
||||
url: '/admin/appuser/' + id,
|
||||
method: 'delete'
|
||||
url: '/admin/appuser/',
|
||||
method: 'delete',
|
||||
data:ids
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
{{ $t('common.exportBtn') }}
|
||||
</el-button>
|
||||
<el-button formDialogRef :disabled="multiple" icon="Delete" type="primary" class="ml10"
|
||||
v-auth="'app_social_details_del'" @click="handleDelete(undefined)">
|
||||
v-auth="'app_social_details_del'" @click="handleDelete(selectObjs)">
|
||||
{{ $t('common.delBtn') }}
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
|
||||
@ -52,7 +52,7 @@
|
||||
<el-button text type="primary" v-auth="'app_social_details_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)">{{ $t('common.editBtn') }}
|
||||
</el-button>
|
||||
<el-button text type="primary" v-auth="'app_social_details_del'" @click="handleDelete(scope.row)">{{
|
||||
<el-button text type="primary" v-auth="'app_social_details_del'" @click="handleDelete([scope.row.id])">{{
|
||||
$t('common.delBtn')
|
||||
}}
|
||||
</el-button>
|
||||
@ -86,7 +86,7 @@ const formDialogRef = ref()
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
// 多选变量
|
||||
const selectObjs = ref([])
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
@ -116,9 +116,11 @@ const resetQuery = () => {
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
const handleSelectionChange = (val: any) => {
|
||||
selectObjs.value = val
|
||||
multiple.value = !val.length
|
||||
const handleSelectionChange = (objs: any) => {
|
||||
objs.forEach((val: any) => {
|
||||
selectObjs.value.push(val.id)
|
||||
});
|
||||
multiple.value = !objs.length
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
@ -127,17 +129,10 @@ const exportExcel = () => {
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = (row: any) => {
|
||||
if (!row) {
|
||||
selectObjs.value.forEach((val: any) => {
|
||||
handleDelete(val)
|
||||
});
|
||||
return
|
||||
}
|
||||
|
||||
useMessageBox().confirm(t('common.delConfirmText') + row.id)
|
||||
const handleDelete = (ids: any) => {
|
||||
useMessageBox().confirm(t('common.delConfirmText'))
|
||||
.then(() => {
|
||||
delObj(row.id).then(() => {
|
||||
delObj(ids).then(() => {
|
||||
getDataList();
|
||||
useMessage().success(t('common.delSuccessText'));
|
||||
}).catch((err: any) => {
|
||||
|
@ -31,7 +31,7 @@
|
||||
{{ $t('common.exportBtn') }}
|
||||
</el-button>
|
||||
<el-button :disabled="multiple" icon="Delete" type="primary" class="ml10" v-auth="'sys_user_del'"
|
||||
@click="handleDelete(undefined)">
|
||||
@click="handleDelete(selectObjs)">
|
||||
{{ $t('common.delBtn') }}
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
|
||||
@ -65,7 +65,7 @@
|
||||
$t('common.editBtn')
|
||||
}}
|
||||
</el-button>
|
||||
<el-button text type="primary" @click="handleDelete(scope.row)" v-auth="'sys_user_del'">
|
||||
<el-button text type="primary" @click="handleDelete([scope.row.userId])" v-auth="'sys_user_del'">
|
||||
{{ $t('common.delBtn') }}
|
||||
</el-button>
|
||||
</template>
|
||||
@ -104,7 +104,7 @@ const showSearch = ref(true)
|
||||
|
||||
|
||||
// 多选rows
|
||||
const selectObjs = ref([]);
|
||||
const selectObjs = ref([]) as any;
|
||||
// 是否可以多选
|
||||
const multiple = ref(true);
|
||||
|
||||
@ -134,9 +134,11 @@ const resetQuery = () => {
|
||||
|
||||
|
||||
// 多选事件
|
||||
const handleSelectionChange = (val: any) => {
|
||||
selectObjs.value = val
|
||||
multiple.value = !val.length
|
||||
const handleSelectionChange = (objs: any) => {
|
||||
objs.forEach((val: any) => {
|
||||
selectObjs.value.push(val.userId)
|
||||
});
|
||||
multiple.value = !objs.length
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
@ -145,17 +147,16 @@ const exportExcel = () => {
|
||||
}
|
||||
|
||||
// 删除用户
|
||||
const handleDelete = (row: any) => {
|
||||
if (!row) {
|
||||
selectObjs.value.forEach(val => {
|
||||
handleDelete(val)
|
||||
});
|
||||
return
|
||||
}
|
||||
|
||||
useMessageBox().confirm(`${t('common.delConfirmText')}:${row.username} ?`).then(() => {
|
||||
const handleDelete = (ids: string[]) => {
|
||||
// if (!row) {
|
||||
// selectObjs.value.forEach(val => {
|
||||
// handleDelete(val)
|
||||
// });
|
||||
// return
|
||||
// }
|
||||
useMessageBox().confirm(t('common.delConfirmText')).then(() => {
|
||||
// 删除用户的接口
|
||||
delObj(row.userId).then(() => {
|
||||
delObj(ids).then(() => {
|
||||
getDataList();
|
||||
useMessage().success(t('common.delSuccessText'))
|
||||
}).catch(err => {
|
||||
|
Loading…
Reference in New Issue
Block a user