This commit is contained in:
dute7liang
2024-01-03 22:14:31 +08:00
parent 9e4b1fbe0a
commit 2bdc3a7fbe
5 changed files with 364 additions and 85 deletions

View File

@@ -1,6 +1,33 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="蜜瓜号" prop="usercode">
<el-input
v-model="queryParams.usercode"
placeholder="请输入蜜瓜号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="手机号" prop="mobile">
<el-input
v-model="queryParams.mobile"
placeholder="请输入手机号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="审核状态" prop="auditStatus">
<el-select v-model="queryParams.auditStatus" placeholder="审核状态" clearable size="small">
<el-option
v-for="dict in auditStatusList"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@keyup.enter.native="handleQuery"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -13,22 +40,62 @@
<el-table v-loading="loading" :data="userAlbumList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="" align="center" prop="id" v-if="true"/>
<el-table-column label="用户ID" align="center" prop="userId" />
<el-table-column label="" align="center" prop="url" />
<el-table-column label="状态 0 未审核 1 审核通过 2 审核未通过" align="center" prop="status" />
<el-table-column label="审核时间" align="center" prop="auditTime" width="180" />
<el-table-column label="审核备注" align="center" prop="auditRemark" />
<el-table-column label="是否为大咖 " align="center" prop="isAnchor" />
<el-table-column label="审核状态" align="center" prop="auditStatus">
<template v-slot="scope">
<cai-dict-tag :options="auditStatusList" :value="scope.row.auditStatus"/>
</template>
</el-table-column>
<el-table-column label="蜜瓜号" align="center" prop="usercode"/>
<el-table-column label="手机号" align="center" prop="mobile"/>
<el-table-column label="昵称" align="center" prop="nickname"/>
<el-table-column label="头像" align="center" prop="avatar">
<template v-slot="scope">
<image-avatar :src="scope.row.avatar"/>
</template>
</el-table-column>
<el-table-column label="性别" align="center" prop="gender">
<template v-slot="scope">
<cai-dict-tag :options="genderList" :value="scope.row.gender"/>
</template>
</el-table-column>
<el-table-column label="主播" align="center" prop="isAnchor">
<template v-slot="scope">
<cai-dict-tag :options="isAnchorList" :value="scope.row.isAnchor"/>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template v-slot="scope">
<cai-dict-tag :options="isAnchorList" :value="scope.row.isAnchor"/>
</template>
</el-table-column>
<el-table-column label="相册" align="center" prop="url">
<template v-slot="scope">
<image-preview :src="scope.row.url" width="40px" height="40px"/>
</template>
</el-table-column>
<el-table-column label="新增时间" align="center" prop="createTime" />
<el-table-column label="审核时间" align="center" prop="auditTime" />
<!-- <el-table-column label="审核备注" align="center" prop="auditRemark" />-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<template v-slot="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['cai:userAlbum:edit']"
>修改</el-button>
size="mini"
type="text"
icon="el-icon-edit"
v-if="scope.row.auditStatus === 1"
@click="handleAudit(scope.row,3)"
v-hasPermi="['cai:userAlbum:edit']"
>通过
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
v-if="scope.row.auditStatus === 1"
@click="handleAudit(scope.row,2)"
v-hasPermi="['cai:userAlbum:edit']"
>不通过
</el-button>
<el-button
size="mini"
type="text"
@@ -51,12 +118,14 @@
</template>
<script>
import { listUserAlbum, getUserAlbum, delUserAlbum, addUserAlbum, updateUserAlbum } from "@/api/cai/userAlbum";
import {delUserAlbum, listUserAlbum, updateUserAlbum} from "@/api/cai/userAlbum";
import {auditStatusList, genderList, isAnchorList, userStatusList, yesOrNoList} from "@/constant/statusMap";
export default {
name: "UserAlbum",
data() {
return {
genderList, userStatusList, yesOrNoList, isAnchorList,auditStatusList,
// 遮罩层
loading: true,
// 选中数组
@@ -75,12 +144,9 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
userId: undefined,
url: undefined,
status: undefined,
auditTime: undefined,
auditRemark: undefined,
isAnchor: undefined
auditStatus: 1,
mobile: undefined,
usercode: undefined,
},
};
},
@@ -113,47 +179,21 @@ export default {
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加相册管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const id = row.id || this.ids
getUserAlbum(id).then(response => {
handleAudit(row,auditStatus){
let message = auditStatus === 3 ? "通过" : "不通过";
this.$modal.confirm('是否确认'+message+'用户为"' + row.usercode + '"的相册?').then(() => {
this.loading = true;
return updateUserAlbum({
id: row.id,
auditStatus: auditStatus
});
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改相册管理";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.id != null) {
updateUserAlbum(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addUserAlbum(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */