添加审核功能
This commit is contained in:
parent
bcc8bc6c98
commit
26ef60a1ad
@ -67,7 +67,7 @@ func (svc *CommonResourceService) initCommonResourcesRepo(db *gorm.DB) {
|
|||||||
{
|
{
|
||||||
roleMailRepo := r(consts.ResourcesName_MailRole, "个人邮件", repo.NewCommonResourceRepo(db, &model.RoleMail{}), ShowMethod_Get|ShowMethod_Post)
|
roleMailRepo := r(consts.ResourcesName_MailRole, "个人邮件", repo.NewCommonResourceRepo(db, &model.RoleMail{}), ShowMethod_Get|ShowMethod_Post)
|
||||||
roleMailRepo.RowBtns = []*ResourceBtnInfo{
|
roleMailRepo.RowBtns = []*ResourceBtnInfo{
|
||||||
{&api.ResourceBtnInfo{Key: consts.BtnKeyRow_RoleMailReview, Name: "确认审核", BtnColorType: "primary"}, svc.handleServerUpOrDown},
|
{&api.ResourceBtnInfo{Key: consts.BtnKeyRow_RoleMailReview, Name: "确认审核", BtnColorType: "primary"}, svc.handleReviewRows},
|
||||||
}
|
}
|
||||||
} // 个人邮件发放就没法撤回?
|
} // 个人邮件发放就没法撤回?
|
||||||
|
|
||||||
@ -215,6 +215,9 @@ func (svc *CommonResourceService) Create(ctx context.Context, projectId int, res
|
|||||||
createNeedReview = true
|
createNeedReview = true
|
||||||
obj["ReviewCheckStatus"] = consts.OpReviewStatus_Pending
|
obj["ReviewCheckStatus"] = consts.OpReviewStatus_Pending
|
||||||
obj["ReviewNeedCharacters"] = getRsp.ReviewCharacters
|
obj["ReviewNeedCharacters"] = getRsp.ReviewCharacters
|
||||||
|
} else {
|
||||||
|
obj["ReviewCheckStatus"] = consts.OpReviewStatus_DirectOk
|
||||||
|
obj["ReviewNeedCharacters"] = make([]string, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,8 +201,8 @@ func (svc *CommonResourceService) handleReviewRows(ctx context.Context, projectE
|
|||||||
|
|
||||||
if resourceRepo.Repo.Need(projectEt, resourceName) {
|
if resourceRepo.Repo.Need(projectEt, resourceName) {
|
||||||
for _, dtoObj := range params.Rows {
|
for _, dtoObj := range params.Rows {
|
||||||
opRowId := dtoObj["ID"].(int)
|
opRowId := dtoObj["ID"].(float64)
|
||||||
_, dbEt, find, err := resourceRepo.Repo.GetById(projectEt, opRowId)
|
_, dbEt, find, err := resourceRepo.Repo.GetById(projectEt, int(opRowId))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -217,11 +217,12 @@ func (svc *CommonResourceService) handleReviewRows(ctx context.Context, projectE
|
|||||||
return nil, errcode.New(errcode.ParamsInvalid, "resource %v db data already review:%v", resourceName, opRowId)
|
return nil, errcode.New(errcode.ParamsInvalid, "resource %v db data already review:%v", resourceName, opRowId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dbObj["ProjectId"] = projectEt.GetProjectID()
|
||||||
dbObj["ReviewCheckStatus"] = consts.OpReviewStatus_Ok
|
dbObj["ReviewCheckStatus"] = consts.OpReviewStatus_Ok
|
||||||
dbObj["ReviewUserId"] = userId
|
dbObj["ReviewUserId"] = userId
|
||||||
dbObj["ReviewUserName"] = getRsp.User.UserName
|
dbObj["ReviewUserName"] = getRsp.User.UserName
|
||||||
|
|
||||||
_, err = resourceRepo.Repo.Edit(projectEt, dtoObj)
|
_, err = resourceRepo.Repo.Edit(projectEt, dbObj)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -56,5 +56,6 @@ func (m *RoleMail) GetStatusChoices(project *Project) []*dto.CommonDtoFieldChoic
|
|||||||
return []*dto.CommonDtoFieldChoice{
|
return []*dto.CommonDtoFieldChoice{
|
||||||
{Desc: "审核通过已发放", Value: consts.OpReviewStatus_Ok, Type: 2}, // type: 0:plain 1:primary 2:success 3:info 4:warning 5:danger
|
{Desc: "审核通过已发放", Value: consts.OpReviewStatus_Ok, Type: 2}, // type: 0:plain 1:primary 2:success 3:info 4:warning 5:danger
|
||||||
{Desc: "待审核", Value: consts.OpReviewStatus_Pending, Type: 3},
|
{Desc: "待审核", Value: consts.OpReviewStatus_Pending, Type: 3},
|
||||||
|
{Desc: "已发放", Value: consts.OpReviewStatus_DirectOk, Type: 2},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ type Permission struct {
|
|||||||
type Character struct {
|
type Character struct {
|
||||||
ID int `gorm:"primarykey" readonly:"true"`
|
ID int `gorm:"primarykey" readonly:"true"`
|
||||||
Name string `name:"角色名" desc:"区别一组用户的名字,例如qa、策划、运营" gorm:"type:varchar(255);unique" required:"true" uneditable:"true"`
|
Name string `name:"角色名" desc:"区别一组用户的名字,例如qa、策划、运营" gorm:"type:varchar(255);unique" required:"true" uneditable:"true"`
|
||||||
WriteOpCheckCharacters []string `gorm:"type:varchar(255);" name:"操作审核员" desc:"不选表示敏感操作无需审核" choices:"GetCharChoices" multi_choice:"true"`
|
WriteOpCheckCharacters []string `gorm:"type:json;serializer:json" name:"操作审核员" desc:"不选表示敏感操作无需审核" type:"[]string" choices:"GetCharChoices" multi_choice:"true"`
|
||||||
// 权限列表,格式就是 ["project:<projectId>:<resource>:<get>", "sys:user:get", ...],
|
// 权限列表,格式就是 ["project:<projectId>:<resource>:<get>", "sys:user:get", ...],
|
||||||
// 例如项目3封禁功能的列表获取权限:"project:3:ban:list"
|
// 例如项目3封禁功能的列表获取权限:"project:3:ban:list"
|
||||||
Permissions []string `gorm:"type:json;serializer:json" name:"权限列表" type:"Permissions"`
|
Permissions []string `gorm:"type:json;serializer:json" name:"权限列表" type:"Permissions"`
|
||||||
|
@ -95,6 +95,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
OpReviewStatus_Ok = "reviewed" // 审核通过
|
OpReviewStatus_Ok = "reviewed" // 审核通过
|
||||||
OpReviewStatus_Pending = "pending" // 待审核
|
OpReviewStatus_Pending = "pending" // 待审核
|
||||||
|
OpReviewStatus_DirectOk = "dir_reviewed" // 无须审核直接通过
|
||||||
)
|
)
|
||||||
|
BIN
admin/uniugm.db
BIN
admin/uniugm.db
Binary file not shown.
@ -15,6 +15,7 @@ import empty from '@/components/restful/empty.vue';
|
|||||||
import {getWhereConditionDesc} from "@/utils/string.js";
|
import {getWhereConditionDesc} from "@/utils/string.js";
|
||||||
import UserDetail from "@/components/game/userDetail.vue";
|
import UserDetail from "@/components/game/userDetail.vue";
|
||||||
import router from "@/router/index.js";
|
import router from "@/router/index.js";
|
||||||
|
import userStore from "@/stores/user.js";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
rowClickDialogBtns: Array,
|
rowClickDialogBtns: Array,
|
||||||
@ -206,6 +207,10 @@ onMounted(() => {
|
|||||||
listData();
|
listData();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const curCharacter = userStore().userInfo.character
|
||||||
|
|
||||||
|
console.log("当前用户角色:", curCharacter)
|
||||||
|
|
||||||
const dialogAddVisible = ref(false)
|
const dialogAddVisible = ref(false)
|
||||||
const dialogEditVisible = ref(false)
|
const dialogEditVisible = ref(false)
|
||||||
const dialogAddFormRef = ref(null)
|
const dialogAddFormRef = ref(null)
|
||||||
@ -395,19 +400,41 @@ const handleDelete = (index, row) => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function itemBagSelectChange() {
|
||||||
|
console.log("选择礼包:", selectedItemBag.value)
|
||||||
|
let hasValidInput = false
|
||||||
|
if (selectedItemBag.value != null) {
|
||||||
|
selectedItemBag.value.forEach(bag => {
|
||||||
|
if (bag.name !== undefined && bag.name !== '') {
|
||||||
|
bag.items.forEach((bagItem) => {
|
||||||
|
if (typeof dialogObjectForm.value.Attach === typeof "") {
|
||||||
|
dialogObjectForm.value.Attach = [];
|
||||||
|
}
|
||||||
|
let d = {id: bagItem.item_id, num: bagItem.item_num, desc: bagItem.desc, item_type: bagItem.item_type};
|
||||||
|
dialogObjectForm.value.Attach.push(d);
|
||||||
|
})
|
||||||
|
console.log("添加礼包:", bag)
|
||||||
|
hasValidInput = true;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (!hasValidInput) {
|
||||||
|
// console.log("礼包:", selectedItemBag.value)
|
||||||
|
// ElMessage('请选择礼包!')
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (dialogAddVisible.value) {
|
||||||
|
dialogAddFormRef.value.validateField("Attach");
|
||||||
|
} else if (dialogEditVisible.value) {
|
||||||
|
// console.log("删除道具,准备校验表单规则", rules.value)
|
||||||
|
// console.log("删除道具,准备校验表单规则", dialogEditFormRef.value)
|
||||||
|
dialogEditFormRef.value.validateField("Attach");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function addItem(fieldDescInfo) {
|
function addItem(fieldDescInfo) {
|
||||||
let hasValidInput = false;
|
let hasValidInput = false;
|
||||||
if (selectedItemBag.value != null && selectedItemBag.value.name !== undefined && selectedItemBag.value.name !== '') {
|
|
||||||
selectedItemBag.value.items.forEach((bagItem) => {
|
|
||||||
if (typeof dialogObjectForm.value.Attach === typeof "") {
|
|
||||||
dialogObjectForm.value.Attach = [];
|
|
||||||
}
|
|
||||||
let d = {id: bagItem.item_id, num: bagItem.item_num, desc: bagItem.desc, item_type: bagItem.item_type};
|
|
||||||
dialogObjectForm.value.Attach.push(d);
|
|
||||||
})
|
|
||||||
console.log("添加礼包:", selectedItemBag.value)
|
|
||||||
hasValidInput = true;
|
|
||||||
}
|
|
||||||
if (selectedItem.value !== null && selectedItem.value.value !== undefined && selectedItem.value.value !== '') {
|
if (selectedItem.value !== null && selectedItem.value.value !== undefined && selectedItem.value.value !== '') {
|
||||||
if (selectedItemNum.value <= 0) {
|
if (selectedItemNum.value <= 0) {
|
||||||
ElMessage('请输入有效道具数量!')
|
ElMessage('请输入有效道具数量!')
|
||||||
@ -430,7 +457,6 @@ function addItem(fieldDescInfo) {
|
|||||||
}
|
}
|
||||||
if (!hasValidInput) {
|
if (!hasValidInput) {
|
||||||
console.log("道具:", selectedItem.value)
|
console.log("道具:", selectedItem.value)
|
||||||
console.log("礼包:", selectedItemBag.value)
|
|
||||||
ElMessage('请选择道具或者礼包!')
|
ElMessage('请选择道具或者礼包!')
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -693,8 +719,21 @@ const handleGenRandAccount = () => {
|
|||||||
</el-button>
|
</el-button>
|
||||||
<template v-for="(btn, index) in rowClickBtns">
|
<template v-for="(btn, index) in rowClickBtns">
|
||||||
<template v-if="btn.btn_type === 0"> <!--直接发送选择行数据到服务器的按钮类型-->
|
<template v-if="btn.btn_type === 0"> <!--直接发送选择行数据到服务器的按钮类型-->
|
||||||
|
<template v-if="scope.row['ReviewNeedCharacters'] !== undefined &&
|
||||||
|
scope.row['ReviewNeedCharacters'] !== null">
|
||||||
|
<el-button
|
||||||
|
:size="funcBtnSize"
|
||||||
|
:type="btn.btn_color_type"
|
||||||
|
@click="tableSelectRows2(btn, scope.$index, scope.row)"
|
||||||
|
v-if="scope.row['ReviewNeedCharacters'].includes(curCharacter) &&
|
||||||
|
scope.row['ReviewCheckStatus'] === 'pending'">
|
||||||
|
{{ btn.name }}
|
||||||
|
</el-button>
|
||||||
|
<div v-else/>
|
||||||
|
</template>
|
||||||
|
|
||||||
<el-button :size="funcBtnSize" :type="btn.btn_color_type"
|
<el-button :size="funcBtnSize" :type="btn.btn_color_type"
|
||||||
@click="tableSelectRows2(btn, scope.$index, scope.row)">
|
@click="tableSelectRows2(btn, scope.$index, scope.row)" v-else>
|
||||||
{{ btn.name }}
|
{{ btn.name }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -753,32 +792,35 @@ const handleGenRandAccount = () => {
|
|||||||
<el-form :inline="true" :model="selectedItem" label-position="right">
|
<el-form :inline="true" :model="selectedItem" label-position="right">
|
||||||
<el-form-item :label="fieldDescInfo.name" :prop="fieldDescInfo.key" label-width="130px">
|
<el-form-item :label="fieldDescInfo.name" :prop="fieldDescInfo.key" label-width="130px">
|
||||||
<el-tooltip effect="light" :content="fieldDescInfo.help_text" placement="top-start">
|
<el-tooltip effect="light" :content="fieldDescInfo.help_text" placement="top-start">
|
||||||
<el-select v-model="selectedItem" placeholder="--搜索道具--" style="width: 150px"
|
<el-select v-model="selectedItem" placeholder="--搜索道具--" style="width: 200px"
|
||||||
filterable remote clearable
|
filterable remote clearable
|
||||||
:remote-method="handleQueryItem"
|
:remote-method="handleQueryItem"
|
||||||
:loading="loadingRemoteItems"
|
:loading="loadingRemoteItems"
|
||||||
value-key="value"
|
value-key="value"
|
||||||
>
|
>
|
||||||
<el-option v-for="info in itemChoices" :key="info.value" :label="info.desc"
|
<el-option v-for="info in itemChoices" :key="info.value" :label="info.desc+'('+info.value+')'"
|
||||||
:value="info"></el-option>
|
:value="info"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="数量" prop="num">
|
<el-form-item label="数量" prop="num">
|
||||||
<el-input type="number" v-model="selectedItemNum" placeholder="请输入数量" style="width: 150px"/>
|
<el-input type="number" v-model="selectedItemNum" placeholder="请输入数量" style="width: 100px"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="addItem(fieldDescInfo)">添加</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<!-- 选择礼包 -->
|
<!-- 选择礼包 -->
|
||||||
<el-form-item v-if="cachedResource.meta.resource !== 'item_bag'">
|
<el-form-item v-if="cachedResource.meta.resource !== 'item_bag'">
|
||||||
<el-tooltip effect="light" content="选择礼包,点击添加到奖励列表">
|
<el-tooltip effect="light" content="选择礼包,点击添加到奖励列表">
|
||||||
<el-select placeholder="--礼包--" v-model="selectedItemBag" clearable style="width: 150px"
|
<el-select placeholder="--礼包--" v-model="selectedItemBag" clearable style="width: 150px"
|
||||||
value-key="name">
|
value-key="name" multiple @blur="itemBagSelectChange">
|
||||||
<el-option v-for="bag in itemBags" :key="bag.name" :label="bag.name" :value="bag"></el-option>
|
<el-option v-for="bag in itemBags" :key="bag.name" :label="bag.name" :value="bag"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="addItem(fieldDescInfo)">添加</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-form-item label="奖励列表" prop="Attach">
|
<el-form-item label="奖励列表" prop="Attach">
|
||||||
<el-table :data="dialogObjectForm.Attach" border>
|
<el-table :data="dialogObjectForm.Attach" border>
|
||||||
@ -875,36 +917,42 @@ const handleGenRandAccount = () => {
|
|||||||
|
|
||||||
<!--如果是items类型,就是物品下拉框+道具组合-->
|
<!--如果是items类型,就是物品下拉框+道具组合-->
|
||||||
<template v-if="(fieldDescInfo.type === 'items')">
|
<template v-if="(fieldDescInfo.type === 'items')">
|
||||||
|
<el-row>
|
||||||
<el-form :inline="true" :model="selectedItem" label-position="right"
|
<el-form :inline="true" :model="selectedItem" label-position="right"
|
||||||
label-width="130px">
|
label-width="130px">
|
||||||
<el-form-item :label="fieldDescInfo.name" :prop="fieldDescInfo.key">
|
<el-form-item :label="fieldDescInfo.name" :prop="fieldDescInfo.key">
|
||||||
<el-tooltip effect="light" :content="fieldDescInfo.help_text" placement="top-start">
|
<el-tooltip effect="light" :content="fieldDescInfo.help_text" placement="top-start">
|
||||||
<el-select placeholder="--搜索道具--" v-model="selectedItem" style="width: 150px"
|
<el-select placeholder="--搜索道具--" v-model="selectedItem" style="width: 200px"
|
||||||
filterable remote :remote-method="handleQueryItem"
|
filterable remote :remote-method="handleQueryItem"
|
||||||
:loading="loadingRemoteItems"
|
:loading="loadingRemoteItems"
|
||||||
value-key="value"
|
value-key="value"
|
||||||
>
|
>
|
||||||
<el-option v-for="info in itemChoices" :key="info.value" :label="info.desc"
|
<el-option v-for="info in itemChoices" :key="info.value" :label="info.desc+'('+info.value+')'"
|
||||||
:value="info"></el-option>
|
:value="info"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="数量" prop="number">
|
|
||||||
<el-input type="number" v-model="selectedItemNum" placeholder="请输入数量" style="width: 150px"/>
|
<el-form-item label="数量" prop="number" label-width="40px">
|
||||||
|
<el-input type="number" v-model="selectedItemNum" placeholder="请输入数量" style="width: 100px"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="addItem(fieldDescInfo)">添加</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<!-- 选择礼包 -->
|
<!-- 选择礼包 -->
|
||||||
<el-form-item v-if="cachedResource.meta.resource !== 'item_bag'">
|
<el-form-item v-if="cachedResource.meta.resource !== 'item_bag'">
|
||||||
<el-tooltip effect="light" content="选择礼包,点击添加到奖励列表">
|
<el-tooltip effect="light" content="选择礼包,点击添加到奖励列表">
|
||||||
<el-select placeholder="--礼包--" v-model="selectedItemBag" clearable style="width: 150px"
|
<el-select placeholder="--礼包--" v-model="selectedItemBag" clearable style="width: 150px"
|
||||||
value-key="name">
|
value-key="name" multiple @blur="itemBagSelectChange">
|
||||||
<el-option v-for="bag in itemBags" :key="bag.name" :label="bag.name" :value="bag"></el-option>
|
<el-option v-for="bag in itemBags" :key="bag.name" :label="bag.name" :value="bag"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="addItem(fieldDescInfo)">添加</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
</el-row>
|
||||||
<el-form-item label="奖励列表" prop="Attach">
|
<el-form-item label="奖励列表" prop="Attach">
|
||||||
<el-table :data="dialogObjectForm.Attach" border>
|
<el-table :data="dialogObjectForm.Attach" border>
|
||||||
<el-table-column label="道具id" prop="id"/>
|
<el-table-column label="道具id" prop="id"/>
|
||||||
|
@ -258,10 +258,10 @@ const userStore = defineStore(
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
projectRoute.children.push(biDashboardRoute)
|
// projectRoute.children.push(biDashboardRoute)
|
||||||
projectRoute.children.push(biAnalyseRoute)
|
// projectRoute.children.push(biAnalyseRoute)
|
||||||
this.pushDynamicRouteChildren(biDashboardRoute)
|
// this.pushDynamicRouteChildren(biDashboardRoute)
|
||||||
this.pushDynamicRouteChildren(biAnalyseRoute)
|
// this.pushDynamicRouteChildren(biAnalyseRoute)
|
||||||
|
|
||||||
// 添加游戏后台gm管理资源菜单
|
// 添加游戏后台gm管理资源菜单
|
||||||
const resourceList = project.resource_list
|
const resourceList = project.resource_list
|
||||||
|
Loading…
x
Reference in New Issue
Block a user