添加角色参数

master
doublekou 1 year ago
parent 7e2670d04f
commit 8e27ec77ff

@ -380,6 +380,7 @@ const ProTable = defineComponent({
const fetchData = () => { const fetchData = () => {
if (!props.request) return undefined if (!props.request) return undefined
return async (pageParams?: Record<string, any>) => { return async (pageParams?: Record<string, any>) => {
console.log(pageParams, 'pageParams')
const actionParams = { const actionParams = {
...(pageParams || {}), ...(pageParams || {}),
...formSearch, ...formSearch,

@ -242,6 +242,7 @@ export type GeopoliticalCustomersRecord = {
* *
*/ */
export interface GeopoliticalCustomersSearch { export interface GeopoliticalCustomersSearch {
// salesmanType: number | undefined
customName?: string customName?: string
customNid?: string customNid?: string
enrollStatus?: string enrollStatus?: string
@ -254,6 +255,9 @@ export interface GeopoliticalCustomersSearch {
* *
*/ */
export interface FormReviewSearch { export interface FormReviewSearch {
//角色
// salesmanType: string | undefined
//编号
batchNo?: string batchNo?: string
// 访问时间区间的开始值 // 访问时间区间的开始值
startTime?: string startTime?: string

@ -54,7 +54,7 @@ export type SysUserDTO = {
// 组织机构ID // 组织机构ID
organizationId?: number organizationId?: number
// 角色标识列表 // 角色标识列表
roleCodes: string[] roleCodes: any
// desc: objectState // desc: objectState
// stage: objectState // stage: objectState
} }

@ -8,10 +8,11 @@ export type MergePageParamFunction = <U>(
keyword?: string keyword?: string
}, },
sorter: Record<string, SortOrder>, sorter: Record<string, SortOrder>,
filter: Record<string, VueKey[] | null> filter: Record<string, VueKey[] | null>,
salesmanType?: number | undefined
) => Record<string, any> ) => Record<string, any>
export const mergePageParam: MergePageParamFunction = (params, sorter, filter) => { export const mergePageParam: MergePageParamFunction = (params, sorter, filter, salesmanType?) => {
const sort = [] const sort = []
for (const key in sorter) { for (const key in sorter) {
sort.push(sorter[key] === 'ascend' ? `${key},asc` : `${key},desc`) sort.push(sorter[key] === 'ascend' ? `${key},asc` : `${key},desc`)
@ -24,6 +25,7 @@ export const mergePageParam: MergePageParamFunction = (params, sorter, filter) =
page: current, page: current,
...rest, ...rest,
...filter, ...filter,
sort sort,
salesmanType
} }
} }

@ -54,6 +54,14 @@ import type {
defineOptions({ name: 'FormReview' }) defineOptions({ name: 'FormReview' })
//
import { useUserStore } from '@/stores/user-store'
const { userInfo } = useUserStore()
const salesmanType = ref<number | undefined>()
onMounted(() => {
salesmanType.value = userInfo?.salesmanType
})
// //
// //
const tableRef = ref<ProTableInstanceExpose>() const tableRef = ref<ProTableInstanceExpose>()
@ -64,7 +72,7 @@ let searchParams: GeopoliticalCustomersPageParam = {}
// //
const tableRequest: TableRequest = (params, sorter, filter) => { const tableRequest: TableRequest = (params, sorter, filter) => {
const pageParam = mergePageParam(params, sorter, filter) const pageParam = mergePageParam(params, sorter, filter, salesmanType.value)
return pageAccessLogs({ ...pageParam, ...searchParams }) return pageAccessLogs({ ...pageParam, ...searchParams })
} }

@ -55,6 +55,14 @@ import type {
defineOptions({ name: 'GeopoliticalCustomers' }) defineOptions({ name: 'GeopoliticalCustomers' })
//
import { useUserStore } from '@/stores/user-store'
const { userInfo } = useUserStore()
const salesmanType = ref<number | undefined>()
onMounted(() => {
salesmanType.value = userInfo?.salesmanType
})
// //
// //
const tableRef = ref<ProTableInstanceExpose>() const tableRef = ref<ProTableInstanceExpose>()
@ -65,7 +73,7 @@ let searchParams: GeopoliticalCustomersPageParam = {}
// //
const tableRequest: TableRequest = (params, sorter, filter) => { const tableRequest: TableRequest = (params, sorter, filter) => {
const pageParam = mergePageParam(params, sorter, filter) const pageParam = mergePageParam(params, sorter, filter, salesmanType.value)
return pageAccessLogs({ ...pageParam, ...searchParams }) return pageAccessLogs({ ...pageParam, ...searchParams })
} }

@ -53,6 +53,14 @@ import type {
defineOptions({ name: 'GeopoliticalCustomers' }) defineOptions({ name: 'GeopoliticalCustomers' })
//
import { useUserStore } from '@/stores/user-store'
const { userInfo } = useUserStore()
const salesmanType = ref<number | undefined>()
onMounted(() => {
salesmanType.value = userInfo?.salesmanType
})
// //
// //
const tableRef = ref<ProTableInstanceExpose>() const tableRef = ref<ProTableInstanceExpose>()
@ -63,7 +71,7 @@ let searchParams: GeopoliticalCustomersPageParam = {}
// //
const tableRequest: TableRequest = (params, sorter, filter) => { const tableRequest: TableRequest = (params, sorter, filter) => {
const pageParam = mergePageParam(params, sorter, filter) const pageParam = mergePageParam(params, sorter, filter, salesmanType.value)
return pageAccessLogs({ ...pageParam, ...searchParams }) return pageAccessLogs({ ...pageParam, ...searchParams })
} }

@ -116,6 +116,11 @@ const { submitLoading, validateAndSubmit, resetFields, validateInfos } = useAdmi
// //
const handleSubmit = () => { const handleSubmit = () => {
console.log(formModel, 'formModel') console.log(formModel, 'formModel')
console.log()
if (typeof formModel.roleCodes === 'string') {
formModel.roleCodes = [formModel.roleCodes]
}
validateAndSubmit( validateAndSubmit(
{ {
...formModel, ...formModel,

@ -22,13 +22,13 @@ import { antdvStyleDeps } from './src/utils/resolvers'
//项目 //项目
// const serverAddress = 'http://admin.ballcat.cn' // const serverAddress = 'http://admin.ballcat.cn'
//xy //xy
const serverAddress = 'http://172.18.0.225:8000' // const serverAddress = 'http://172.18.0.225:8000'
//jt //jt
// const serverAddress = 'http://172.18.1.8:8000' // const serverAddress = 'http://172.18.1.8:8000'
//ts //ts
// const serverAddress = 'http://172.18.0.228:8000' // const serverAddress = 'http://172.18.0.228:8000'
//测试 //测试
// const serverAddress = 'http://39.100.77.21:8000' const serverAddress = 'http://39.100.77.21:8000'
//线上ip //线上ip
// const serverAddress = 'http://175.27.212.74:80' // const serverAddress = 'http://175.27.212.74:80'

Loading…
Cancel
Save