This commit is contained in:
dute7liang
2024-01-18 21:55:56 +08:00
parent e0b567de79
commit d5a1d0d253
2 changed files with 27 additions and 42 deletions

View File

@@ -224,3 +224,8 @@ export const userCallStatusList = [
{ value: 7, label: '已接听', listClass: listClass.primary},
{ value: 8, label: '通话结束', listClass: listClass.primary},
]
export const forbidStatusList = [
{ value: 1, label: '封禁中',listClass: listClass.danger},
{ value: 2, label: '已解封',listClass: listClass.primary},
]

View File

@@ -7,47 +7,36 @@
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['cai:userForbid:remove']"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="userForbidList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="类型" align="center" prop="type" >
<template v-slot="scope">
<cai-dict-tag :options="forbidTimeList" :value="scope.row.type" />
<cai-dict-tag :options="forbidTypeList" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column label="封号对象" align="center" prop="member" />
<el-table-column label="封号时长" align="center" prop="forbidTime" >
<template v-slot="scope">
<cai-dict-tag :options="forbidTimeList" :value="scope.row.forbidTime" />
</template>
</el-table-column>
<el-table-column label="开始时间" align="center" prop="beginTime" />
<el-table-column label="结束时间" align="center" prop="endTime" />
<el-table-column label="理由" align="center" prop="reason" />
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="最后封禁理由" align="center" prop="reason" />
<el-table-column label="状态" align="center" prop="forbidStatus" >
<template v-slot="scope">
<cai-dict-tag :options="forbidStatusList" :value="scope.row.forbidStatus" />
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="60">
<template v-slot="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['cai:userForbid:remove']"
>删除</el-button>
v-if="scope.row.forbidStatus === 1"
@click="handleForbid(scope.row)"
>解封</el-button>
<el-button
size="mini"
type="text"
@click="handleForbidLogInfo(scope.row)"
>封禁记录</el-button>
</template>
</el-table-column>
</el-table>
@@ -64,13 +53,13 @@
<script>
import { delUserForbid, listUserForbid } from '@/api/cai/userForbid'
import { forbidTimeList, forbidTypeList } from '@/constant/statusMap'
import {forbidStatusList, forbidTimeList, forbidTypeList} from '@/constant/statusMap'
export default {
name: "UserForbid",
data() {
return {
forbidTimeList,forbidTypeList,
forbidTimeList,forbidTypeList,forbidStatusList,
// 遮罩层
loading: true,
// 选中数组
@@ -129,20 +118,11 @@ export default {
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除封号列表编号为"' + ids + '"的数据项?').then(() => {
this.loading = true;
return delUserForbid(ids);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
handleForbid(){
},
handleForbidLogInfo(){
}
}
};