mirror of
https://gitee.com/xiangheng/x_admin.git
synced 2025-10-05 00:02:50 +08:00
完善审批用户
This commit is contained in:
@@ -29,3 +29,8 @@ export function adminDelete(params: any) {
|
||||
export function adminStatus(params: any) {
|
||||
return request.post({ url: '/system/admin/disable', params })
|
||||
}
|
||||
|
||||
// 部门下的管理员
|
||||
export function adminListByDeptId(params: any) {
|
||||
return request.get({ url: '/system/admin/ListByDeptId', params })
|
||||
}
|
||||
|
@@ -219,6 +219,8 @@ export default {
|
||||
label: node?.text?.value,
|
||||
type: node.type,
|
||||
fieldAuth: node?.properties?.fieldAuth,
|
||||
|
||||
userType: node?.properties?.userType || 0,
|
||||
userId: node?.properties?.userId || 0,
|
||||
deptId: node?.properties?.deptId || 0,
|
||||
postId: node?.properties?.postId || 0
|
||||
|
@@ -133,9 +133,11 @@ export default {
|
||||
open(node, fieldList) {
|
||||
this.node = node
|
||||
|
||||
this.properties.userType = node?.properties?.userType || ''
|
||||
this.properties.userId = node?.properties?.userId || ''
|
||||
this.properties.deptId = node?.properties?.deptId || ''
|
||||
this.properties.postId = node?.properties?.postId || ''
|
||||
|
||||
this.properties.fieldAuth = node?.properties?.fieldAuth
|
||||
? { ...node?.properties?.fieldAuth }
|
||||
: {}
|
||||
@@ -163,6 +165,7 @@ export default {
|
||||
this.setProperties('fieldAuth', {
|
||||
...fieldAuth
|
||||
})
|
||||
this.setProperties('userType', this.properties.userType)
|
||||
this.setProperties('userId', this.properties.userId)
|
||||
this.setProperties('deptId', this.properties.deptId)
|
||||
this.setProperties('postId', this.properties.postId)
|
||||
|
@@ -48,25 +48,18 @@ export const treeToArray = (data: any[], props = { children: 'children' }) => {
|
||||
* @param {Object} props `{ parent: 'pid', children: 'children' }`
|
||||
*/
|
||||
|
||||
export const arrayToTree = (
|
||||
data: any[],
|
||||
props = { id: 'id', parentId: 'pid', children: 'children' }
|
||||
) => {
|
||||
data = cloneDeep(data)
|
||||
const { id, parentId, children } = props
|
||||
const result: any[] = []
|
||||
const map = new Map()
|
||||
data.forEach((item) => {
|
||||
map.set(item[id], item)
|
||||
const parent = map.get(item[parentId])
|
||||
if (parent) {
|
||||
parent[children] = parent[children] ?? []
|
||||
parent[children].push(item)
|
||||
} else {
|
||||
result.push(item)
|
||||
export function arrayToTree(arr, parentId = '') {
|
||||
const tree = []
|
||||
for (const item of arr) {
|
||||
if (item.pid == parentId) {
|
||||
const children = arrayToTree(arr, item.id)
|
||||
if (children.length > 0) {
|
||||
item.children = children
|
||||
}
|
||||
tree.push(item)
|
||||
}
|
||||
})
|
||||
return result
|
||||
}
|
||||
return tree
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -103,14 +103,14 @@ function open(applyId) {
|
||||
console.log('res', res)
|
||||
next_nodes.value = res
|
||||
|
||||
res.map((item) => {
|
||||
if (item.type == 'bpmn:userTask') {
|
||||
flow_history_get_approver(item).then((user) => {
|
||||
console.log('user', user)
|
||||
approverUserList.value = user
|
||||
})
|
||||
}
|
||||
})
|
||||
// res.map((item) => {
|
||||
// if (item.type == 'bpmn:userTask') {
|
||||
// }
|
||||
// })
|
||||
})
|
||||
flow_history_get_approver({ applyId: applyId }).then((user) => {
|
||||
console.log('user', user)
|
||||
approverUserList.value = user
|
||||
})
|
||||
}
|
||||
function BeforeClose() {
|
||||
|
@@ -33,15 +33,25 @@
|
||||
:maxlength="100"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人" prop="duty">
|
||||
<el-input
|
||||
v-model="formData.duty"
|
||||
placeholder="请输入负责人姓名"
|
||||
<el-form-item label="负责人" prop="duty_id" v-if="formData.id">
|
||||
<el-select
|
||||
class="flex-1"
|
||||
v-model="formData.dutyId"
|
||||
clearable
|
||||
:maxlength="30"
|
||||
/>
|
||||
placeholder="请选择上级部门"
|
||||
@change="dutyChange"
|
||||
>
|
||||
<el-option label="请先给管理员绑定部门" :value="0" />
|
||||
|
||||
<el-option
|
||||
v-for="item in DeptUsers"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="mobile">
|
||||
<el-form-item label="部门电话" prop="mobile">
|
||||
<el-input v-model="formData.mobile" placeholder="请输入联系电话" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
@@ -60,6 +70,8 @@
|
||||
<script lang="ts" setup>
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import { deptLists, deptEdit, deptAdd, deptDetail } from '@/api/org/department'
|
||||
import { adminListByDeptId } from '@/api/perms/admin'
|
||||
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { useDictOptions } from '@/hooks/useDictOptions'
|
||||
import feedback from '@/utils/feedback'
|
||||
@@ -74,11 +86,29 @@ const formData = reactive({
|
||||
id: '',
|
||||
pid: '' as string | number,
|
||||
name: '',
|
||||
dutyId: 0,
|
||||
duty: '',
|
||||
mobile: '',
|
||||
sort: 0,
|
||||
isStop: 0
|
||||
})
|
||||
const DeptUsers = ref([])
|
||||
// 部门下的管理员
|
||||
async function getDeptUsers(deptId: number) {
|
||||
const users = await adminListByDeptId({ deptId: deptId })
|
||||
DeptUsers.value = users
|
||||
}
|
||||
function dutyChange(id: number) {
|
||||
console.log('params', id)
|
||||
if (id) {
|
||||
const duty = DeptUsers.value.find((item) => item.id == id)
|
||||
formData.duty = duty.nickname
|
||||
// formData.duty_id = duty.id
|
||||
} else {
|
||||
formData.duty = ''
|
||||
}
|
||||
// formData
|
||||
}
|
||||
const checkMobile = (rule: any, value: any, callback: any) => {
|
||||
if (!value) {
|
||||
return callback()
|
||||
@@ -115,11 +145,11 @@ const formRules = {
|
||||
}
|
||||
],
|
||||
mobile: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入联系电话',
|
||||
trigger: ['blur']
|
||||
},
|
||||
// {
|
||||
// required: true,
|
||||
// message: '请输入联系电话',
|
||||
// trigger: ['blur']
|
||||
// },
|
||||
{
|
||||
validator: checkMobile,
|
||||
trigger: ['blur']
|
||||
@@ -146,27 +176,29 @@ const handleSubmit = async () => {
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
// if (type == 'edit') {
|
||||
// }
|
||||
}
|
||||
|
||||
const setFormData = (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
//TODO:因为后端返回字段为is_stop
|
||||
else{
|
||||
//@ts-ignore
|
||||
else {
|
||||
//@ts-ignore
|
||||
formData[key] = data['is_stop']
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await deptDetail({
|
||||
id: row.id
|
||||
})
|
||||
})
|
||||
getDeptUsers(data.id)
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
@@ -48,6 +48,8 @@
|
||||
min-width="150"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="负责人" prop="duty" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="部门状态" prop="isStop" min-width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag class="ml-2" :type="row.isStop ? 'danger' : ''">
|
||||
@@ -114,6 +116,8 @@ const getLists = async () => {
|
||||
// 根据id和pid处理层级关系
|
||||
|
||||
lists.value = arrayToTree(list)
|
||||
console.log('lists', lists)
|
||||
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
|
@@ -9,7 +9,6 @@ import (
|
||||
)
|
||||
|
||||
type FlowHistoryHandler struct {
|
||||
Service IFlowHistoryService
|
||||
}
|
||||
|
||||
// @Summary 流程历史列表
|
||||
@@ -180,14 +179,19 @@ func (hd FlowHistoryHandler) NextNode(c *gin.Context) {
|
||||
|
||||
// 获取节点的可审批用户
|
||||
func (hd FlowHistoryHandler) GetApprover(c *gin.Context) {
|
||||
var node FlowTree
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &node)) {
|
||||
var nextNode NextNodeReq
|
||||
// var node FlowTree
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &nextNode)) {
|
||||
return
|
||||
}
|
||||
|
||||
// response.CheckAndResp(c, Service.GetNextNode(node))
|
||||
res, err := Service.GetApprover(node)
|
||||
response.CheckAndRespWithData(c, res, err)
|
||||
res, err := Service.GetApprover(nextNode.ApplyId)
|
||||
if err != nil {
|
||||
response.FailWithMsg(c, response.Failed, err.Error())
|
||||
return
|
||||
}
|
||||
response.OkWithData(c, res)
|
||||
}
|
||||
|
||||
// 同意审批(当前nodeId)
|
||||
|
@@ -78,9 +78,10 @@ type FlowTree struct {
|
||||
Label string `json:"label"`
|
||||
Type string `json:"type"`
|
||||
|
||||
UserId int `json:"userId"`
|
||||
DeptId int `json:"deptId"`
|
||||
PostId int `json:"postId"`
|
||||
UserType int `json:"userType"` // 用户类型,1指定部门、岗位,2用户部门负责人,3指定审批人
|
||||
UserId int `json:"userId"`
|
||||
DeptId int `json:"deptId"`
|
||||
PostId int `json:"postId"`
|
||||
|
||||
FieldAuth map[string]int `json:"fieldAuth"`
|
||||
|
||||
|
@@ -2,8 +2,10 @@ package flow_history
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"x_admin/admin/flow/flow_apply"
|
||||
"x_admin/admin/system/admin"
|
||||
"x_admin/admin/system/dept"
|
||||
"x_admin/core"
|
||||
"x_admin/core/request"
|
||||
"x_admin/core/response"
|
||||
@@ -14,17 +16,17 @@ import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type IFlowHistoryService interface {
|
||||
List(page request.PageReq, listReq FlowHistoryListReq) (res response.PageResp, e error)
|
||||
ListAll() (res []FlowHistoryResp, e error)
|
||||
// type IFlowHistoryService interface {
|
||||
// List(page request.PageReq, listReq FlowHistoryListReq) (res response.PageResp, e error)
|
||||
// ListAll() (res []FlowHistoryResp, e error)
|
||||
|
||||
Detail(id int) (res FlowHistoryResp, e error)
|
||||
Add(addReq FlowHistoryAddReq) (e error)
|
||||
Edit(editReq FlowHistoryEditReq) (e error)
|
||||
Del(id int) (e error)
|
||||
// Detail(id int) (res FlowHistoryResp, e error)
|
||||
// Add(addReq FlowHistoryAddReq) (e error)
|
||||
// Edit(editReq FlowHistoryEditReq) (e error)
|
||||
// Del(id int) (e error)
|
||||
|
||||
GetNextNode(nextNode NextNodeReq) (e error)
|
||||
}
|
||||
// GetNextNode(nextNode NextNodeReq) (e error)
|
||||
// }
|
||||
|
||||
var Service = NewFlowHistoryService()
|
||||
|
||||
@@ -177,32 +179,70 @@ func (Service flowHistoryService) Del(id int) (e error) {
|
||||
/**
|
||||
* 获取节点的审批用户
|
||||
*/
|
||||
func (Service flowHistoryService) GetApprover(node FlowTree) (res []admin.SystemAuthAdminResp, e error) {
|
||||
var userId = node.UserId
|
||||
var deptId = node.DeptId
|
||||
var postId = node.PostId
|
||||
func (Service flowHistoryService) GetApprover(ApplyId int) (res []admin.SystemAuthAdminResp, e error) {
|
||||
nextNodes, applyDetail, _, err := Service.GetNextNode(ApplyId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var userTask FlowTree
|
||||
for n := 0; n < len(nextNodes); n++ {
|
||||
if nextNodes[n].Type == "bpmn:userTask" {
|
||||
userTask = nextNodes[n]
|
||||
break
|
||||
}
|
||||
}
|
||||
// 没有审批节点不用获取审批人
|
||||
if userTask.Id == "" {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
var userType = userTask.UserType //用户类型,1指定部门、岗位,2用户部门负责人,3指定审批人
|
||||
var userId = userTask.UserId
|
||||
var deptId = userTask.DeptId
|
||||
var postId = userTask.PostId
|
||||
adminTbName := core.DBTableName(&system_model.SystemAuthAdmin{})
|
||||
|
||||
adminModel := Service.db.Table(adminTbName+" AS admin").Where("admin.is_delete = ?", 0)
|
||||
|
||||
dept := map[string]interface{}{}
|
||||
if deptId > 0 {
|
||||
dept["admin.dept_id"] = deptId
|
||||
// adminModel.Or("admin.dept_id =?", deptId)
|
||||
}
|
||||
if postId > 0 {
|
||||
dept["admin.post_id"] = postId
|
||||
// adminModel.Or("admin.post_id =?", postId)
|
||||
}
|
||||
where := map[string]interface{}{}
|
||||
if userType == 1 {
|
||||
if deptId > 0 {
|
||||
where["admin.dept_id"] = deptId
|
||||
// adminModel.Or("admin.dept_id =?", deptId)
|
||||
}
|
||||
if postId > 0 {
|
||||
where["admin.post_id"] = postId
|
||||
// adminModel.Or("admin.post_id =?", postId)
|
||||
}
|
||||
} else if userType == 2 {
|
||||
// 申请人所在的部门负责人
|
||||
|
||||
var where = Service.db.Where(dept)
|
||||
if userId > 0 {
|
||||
where.Or("admin.id =?", userId)
|
||||
applyUser, err := admin.Service.Detail(uint(applyDetail.ApplyUserId))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if applyUser.DeptId == 0 {
|
||||
return nil, errors.New("申请人没有绑定部门")
|
||||
}
|
||||
deptDetails, err := dept.Service.Detail(applyUser.DeptId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if deptDetails.DutyId == 0 {
|
||||
return nil, errors.New(deptDetails.Name + "部门没有绑定负责人")
|
||||
}
|
||||
where["admin.id"] = deptDetails.DutyId
|
||||
|
||||
} else if userType == 3 {
|
||||
if userId > 0 {
|
||||
where["admin.id"] = userId
|
||||
// adminModel.Or("admin.id =?", userId)
|
||||
}
|
||||
}
|
||||
|
||||
// 数据
|
||||
var adminResp []admin.SystemAuthAdminResp
|
||||
err := adminModel.Where(where).Find(&adminResp).Error
|
||||
err = adminModel.Where(where).Find(&adminResp).Error
|
||||
if e = response.CheckErr(err, "获取审批用户失败"); e != nil {
|
||||
return
|
||||
}
|
||||
@@ -215,6 +255,7 @@ func (Service flowHistoryService) GetApprover(node FlowTree) (res []admin.System
|
||||
return adminResp, nil
|
||||
}
|
||||
|
||||
// 通过审批
|
||||
func (Service flowHistoryService) Pass(pass PassReq) (e error) {
|
||||
nextNodes, applyDetail, LastHistory, err := Service.GetNextNode(pass.ApplyId)
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"x_admin/config"
|
||||
"x_admin/core/request"
|
||||
"x_admin/core/response"
|
||||
@@ -112,3 +113,27 @@ func (ah AdminHandler) Disable(c *gin.Context) {
|
||||
}
|
||||
response.CheckAndResp(c, Service.Disable(c, disableReq.ID))
|
||||
}
|
||||
|
||||
// @Summary 获取部门的用户
|
||||
// @Description 获取部门的用户
|
||||
// @Tags 管理员
|
||||
// @Param deptId path int true "部门id"
|
||||
// @Success 200 {object} response.Response "{"code": 200, "data": []}"
|
||||
// @Router /system/admin/ListByDeptId/{deptId} [get]
|
||||
func (ah AdminHandler) ListByDeptId(c *gin.Context) {
|
||||
deptIdStr, bool := c.GetQuery("deptId")
|
||||
if bool == false {
|
||||
response.FailWithMsg(c, response.Failed, "deptId不能为空")
|
||||
return
|
||||
}
|
||||
deptId, err := strconv.Atoi(deptIdStr)
|
||||
if err != nil {
|
||||
response.FailWithMsg(c, response.Failed, "deptId参数错误")
|
||||
return
|
||||
}
|
||||
// if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &deptId)) {
|
||||
// return
|
||||
// }
|
||||
res, err := Service.ListByUserIdOrDeptIdPostId(0, deptId, 0)
|
||||
response.CheckAndRespWithData(c, res, err)
|
||||
}
|
||||
|
@@ -94,19 +94,19 @@ func (adminSrv systemAuthAdminService) Self(adminId uint) (res SystemAuthAdminSe
|
||||
return SystemAuthAdminSelfResp{User: admin, Permissions: auths}, nil
|
||||
}
|
||||
|
||||
// 获取管理员列表-用户id加部门岗位
|
||||
// 获取管理员列表-
|
||||
func (adminSrv systemAuthAdminService) ListByUserIdOrDeptIdPostId(userId, deptId, postId int) (res []SystemAuthAdminResp, e error) {
|
||||
adminTbName := core.DBTableName(&system_model.SystemAuthAdmin{})
|
||||
|
||||
adminModel := adminSrv.db.Table(adminTbName+" AS admin").Where("admin.is_delete = ?", 0)
|
||||
if userId > 0 {
|
||||
adminModel.Or("admin.id =?", userId)
|
||||
adminModel.Where("admin.id =?", userId)
|
||||
}
|
||||
if deptId > 0 {
|
||||
adminModel.Or("admin.dept_id =?", deptId)
|
||||
adminModel.Where("admin.dept_id =?", deptId)
|
||||
}
|
||||
if postId > 0 {
|
||||
adminModel.Or("admin.post_id =?", postId)
|
||||
adminModel.Where("admin.post_id =?", postId)
|
||||
}
|
||||
// 数据
|
||||
var adminResp []SystemAuthAdminResp
|
||||
|
@@ -17,6 +17,7 @@ type SystemAuthDeptDetailReq struct {
|
||||
type SystemAuthDeptAddReq struct {
|
||||
Pid uint `form:"pid" binding:"gte=0"` // 部门父级
|
||||
Name string `form:"name" binding:"required,min=1,max=100"` // 部门名称
|
||||
DutyId int `form:"dutyId" binding:"omitempty"` // 负责人id
|
||||
Duty string `form:"duty" binding:"omitempty,min=1,max=30"` // 负责人
|
||||
Mobile string `form:"mobile" binding:"omitempty,len=11"` // 联系电话
|
||||
IsStop uint8 `form:"isStop" binding:"oneof=0 1"` // 是否停用: [0=否, 1=是]
|
||||
@@ -28,6 +29,7 @@ type SystemAuthDeptEditReq struct {
|
||||
ID uint `form:"id" binding:"required,gt=0"` // 主键
|
||||
Pid uint `form:"pid" binding:"gte=0"` // 部门父级
|
||||
Name string `form:"name" binding:"required,min=1,max=100"` // 部门名称
|
||||
DutyId int `form:"dutyId" binding:"omitempty"` // 负责人id
|
||||
Duty string `form:"duty" binding:"omitempty,min=1,max=30"` // 负责人
|
||||
Mobile string `form:"mobile" binding:"omitempty,len=11"` // 联系电话
|
||||
IsStop uint8 `form:"isStop" binding:"oneof=0 1"` // 是否停用: [0=否, 1=是]
|
||||
@@ -44,6 +46,7 @@ type SystemAuthDeptResp struct {
|
||||
ID uint `json:"id" structs:"id"` // 主键
|
||||
Pid uint `json:"pid" structs:"pid"` // 部门父级
|
||||
Name string `json:"name" structs:"name"` // 部门名称
|
||||
DutyId int `json:"dutyId" structs:"dutyId"` // 负责人id
|
||||
Duty string `json:"duty" structs:"duty"` // 负责人
|
||||
Mobile string `json:"mobile" structs:"mobile"` // 联系电话
|
||||
Sort uint16 `json:"sort" structs:"sort"` // 排序编号
|
||||
|
@@ -4,7 +4,6 @@ import (
|
||||
"x_admin/core"
|
||||
"x_admin/core/response"
|
||||
"x_admin/model/system_model"
|
||||
"x_admin/util"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
@@ -44,7 +43,7 @@ func (deptSrv systemAuthDeptService) All() (res []SystemAuthDeptResp, e error) {
|
||||
}
|
||||
|
||||
// List 部门列表
|
||||
func (deptSrv systemAuthDeptService) List(listReq SystemAuthDeptListReq) (mapList []interface{}, e error) {
|
||||
func (deptSrv systemAuthDeptService) List(listReq SystemAuthDeptListReq) (deptResps []SystemAuthDeptResp, e error) {
|
||||
deptModel := deptSrv.db.Where("is_delete = ?", 0)
|
||||
if listReq.Name != "" {
|
||||
deptModel = deptModel.Where("name like ?", "%"+listReq.Name+"%")
|
||||
@@ -57,10 +56,10 @@ func (deptSrv systemAuthDeptService) List(listReq SystemAuthDeptListReq) (mapLis
|
||||
if e = response.CheckErr(err, "List Find err"); e != nil {
|
||||
return
|
||||
}
|
||||
deptResps := []SystemAuthDeptResp{}
|
||||
// deptResps = []SystemAuthDeptResp{}
|
||||
response.Copy(&deptResps, depts)
|
||||
mapList = util.ArrayUtil.ListToTree(
|
||||
util.ConvertUtil.StructsToMaps(deptResps), "id", "pid", "children")
|
||||
// mapList = util.ArrayUtil.ListToTree(
|
||||
// util.ConvertUtil.StructsToMaps(deptResps), "id", "pid", "children")
|
||||
return
|
||||
}
|
||||
|
||||
|
@@ -22,12 +22,14 @@ func AdminRoute(rg *gin.RouterGroup) {
|
||||
|
||||
rg.GET("/admin/self", handle.Self)
|
||||
rg.GET("/admin/list", handle.List)
|
||||
rg.GET("/admin/ListByDeptId", handle.ListByDeptId)
|
||||
rg.GET("/admin/detail", handle.Detail)
|
||||
rg.POST("/admin/add", middleware.RecordLog("管理员新增"), handle.Add)
|
||||
rg.POST("/admin/edit", middleware.RecordLog("管理员编辑"), handle.Edit)
|
||||
rg.POST("/admin/upInfo", middleware.RecordLog("管理员更新"), handle.UpInfo)
|
||||
rg.POST("/admin/del", middleware.RecordLog("管理员删除"), handle.Del)
|
||||
rg.POST("/admin/disable", middleware.RecordLog("管理员状态切换"), handle.Disable)
|
||||
|
||||
}
|
||||
func RoleRoute(rg *gin.RouterGroup) {
|
||||
// db := core.GetDB()
|
||||
|
@@ -75,8 +75,9 @@ type SystemAuthDept struct {
|
||||
ID uint `gorm:"primarykey;comment:'主键'"`
|
||||
Pid uint `gorm:"not null;default:0;comment:'上级主键'"`
|
||||
Name string `gorm:"not null;default:'';comment:'部门名称''"`
|
||||
Duty string `gorm:"not null;default:'';comment:'负责人名'"`
|
||||
Mobile string `gorm:"not null;default:'';comment:'联系电话'"`
|
||||
DutyId int `gorm:"null;comment:'负责人id'"`
|
||||
Duty string `gorm:"null;default:'';comment:'负责人名'"`
|
||||
Mobile string `gorm:"null;default:'';comment:'联系电话'"`
|
||||
Sort uint16 `gorm:"not null;default:0;comment:'排序编号'"`
|
||||
IsStop uint8 `gorm:"not null;default:0;comment:'是否停用: 0=否, 1=是'"`
|
||||
IsDelete uint8 `gorm:"not null;default:0;comment:'是否删除: 0=否, 1=是'"`
|
||||
|
Reference in New Issue
Block a user