diff --git a/src/api/platform/common/controller/pushConcernFan.ts b/src/api/platform/common/controller/pushConcernFan.ts index e6624ec..85bae86 100644 --- a/src/api/platform/common/controller/pushConcernFan.ts +++ b/src/api/platform/common/controller/pushConcernFan.ts @@ -3,6 +3,7 @@ import { defHttp } from '/@/utils/http/axios'; enum Api { list = '/common_proxy/common/pushConcernFan/list', + listFriend = '/common_proxy/common/pushConcernFan/listFriend', get = '/common_proxy/common/pushConcernFan', add = '/common_proxy/common/pushConcernFan/save', edit = '/common_proxy/common/pushConcernFan/update', @@ -11,6 +12,8 @@ enum Api { export const listPushConcernFan = (params?: Partial) => defHttp.get({ url: Api.list, params }, { isReturnResultResponse: true }); +export const listPushFriend = (params?: Partial) => defHttp.get({ url: Api.listFriend, params }, { isReturnResultResponse: true }); + export const addPushConcernFan = (params: Partial) => defHttp.post({ url: Api.add, data: params }); export const editPushConcernFan = (params: Partial) => defHttp.put({ url: Api.edit, data: params }); diff --git a/src/views/common/push/pushFriend/FriendModal.vue b/src/views/common/push/pushFriend/FriendModal.vue new file mode 100644 index 0000000..9c68d72 --- /dev/null +++ b/src/views/common/push/pushFriend/FriendModal.vue @@ -0,0 +1,43 @@ + + diff --git a/src/views/common/push/pushFriend/friend.data.ts b/src/views/common/push/pushFriend/friend.data.ts new file mode 100644 index 0000000..0daa590 --- /dev/null +++ b/src/views/common/push/pushFriend/friend.data.ts @@ -0,0 +1,154 @@ +import { BasicColumn } from '/@/components/Table'; +import { FormSchema } from '/@/components/Table'; +import { h } from 'vue'; +import { Tag } from 'ant-design-vue'; + +/** 表格列配置 */ +export const columns: BasicColumn[] = [ + { + title: '用户昵称', + dataIndex: 'nickName', + width: 120 + }, + { + title: '性别', + dataIndex: 'sex', + width: 80, + customRender: ({ record }) => { + const sex = record.sex; + const enable = ~~sex === 0; + const color = enable ? 'green' : 'red'; + const text = enable ? '男' : '女'; + return h(Tag, { color: color }, () => text); + } + }, + { + title: '机构名称', + dataIndex: 'deptName', + width: 200 + }, + { + title: '邮箱', + dataIndex: 'email', + width: 120 + }, + { + title: '手机号码', + dataIndex: 'phone', + width: 200 + }, + { + title: '创建时间', + dataIndex: 'createTime', + width: 180 + } +]; + +/** 搜索表单配置 */ +export const searchFormSchema: FormSchema[] = [ + { + field: 'nickName', + label: '用户昵称', + component: 'Input', + componentProps: { + placeholder: '请输入用户昵称', + }, + colProps: { span: 8 } + } +]; + +/** 用户表单配置 */ +export const userFormSchema: FormSchema[] = [ + { + field: 'id', + label: 'ID', + component: 'Input', + show: false + }, + { + field: 'nickName', + label: '用户昵称', + component: 'Input', + componentProps: { + disabled: true, + }, + colProps: { + span: 12 + } + }, + { + field: 'deptId', + label: '归属机构', + component: 'TreeSelect', + componentProps: { + disabled: true, + fieldNames: { + label: 'name', + key: 'deptId', + value: 'deptId' + }, + getPopupContainer: () => document.body + }, + colProps: { + span: 12 + } + }, + { + field: 'phone', + label: '手机号', + component: 'Input', + componentProps: { + disabled: true, + }, + }, + { + field: 'email', + label: '邮箱', + component: 'Input', + componentProps: { + disabled: true, + }, + }, + { + field: 'sex', + label: '性别', + component: 'Select', + componentProps: { + disabled: true, + options: [ + { label: '男', value: '0' }, + { label: '女', value: '1' } + ] + }, + colProps: { + span: 12 + } + }, + { + field: 'userType', + label: '用户类型', + component: 'Select', + componentProps: { + disabled: true, + options: [ + { label: '系统管理员', value: '0' }, + { label: '普通用户', value: '1' }, + { label: '企业用户', value: '2' }, + { label: '收样员', value: '3' }, + { label: '客服', value: '4' }, + ] + }, + colProps: { + span: 12 + } + }, + { + label: '备注', + field: 'remarks', + component: 'InputTextArea', + componentProps: { + disabled: true, + rows: 6 + } + } +]; diff --git a/src/views/common/push/pushFriend/index.vue b/src/views/common/push/pushFriend/index.vue new file mode 100644 index 0000000..35cd8a0 --- /dev/null +++ b/src/views/common/push/pushFriend/index.vue @@ -0,0 +1,126 @@ + + + diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index c57e4e8..d1a7702 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -48,21 +48,6 @@ onClick: handleDel.bind(null, record) }]" :dropDownActions="[ - { - label: '加入黑名单', - icon: 'fa6-regular:pen-to-square', - onClick: handleBlacklist.bind(null, record) - }, - { - label: '加入白名单', - icon: 'fa6-regular:pen-to-square', - onClick: handleWhitelist.bind(null, record) - }, - { - label: '推送申请', - icon: 'fa6-regular:pen-to-square', - onClick: handlePushAdd.bind(null, record) - }, { label: '重置密码', icon: 'fa6-brands:battle-net', @@ -96,12 +81,6 @@ import UserModal from './UserModal.vue'; import { columns, searchFormSchema } from './user.data'; import { useMessage } from '/@/hooks/web/useMessage'; - import {addPushUserManage} from '/@/api/platform/common/controller/pushUserManage'; - import {useUserStore} from '/@/store/modules/user'; - import {addPushPassList} from '/@/api/platform/common/controller/pushPassList'; - - const userStore = useUserStore(); - const userInfoStore = userStore.getUserInfo; /** 类型规范统一声明定义区域 */ interface TableState { @@ -168,58 +147,6 @@ handleSearchInfoFn: () => clearSelectedRowKeys() }); - function handlePushAdd(record?: Recordable) { - createConfirm({ - iconType: 'warning', - title: '警告', - content: `是否添加推送申请编号为${record?.id}的数据?`, - onOk: async () => { - await addPushUserManage({ - fromUserId: userInfoStore.id, - toUserId: record?.id, - userName: record?.nickName, - type: '0' - }); - createMessage.success('申请成功!'); - handleRefreshTable(); - } - }); - } - - function handleWhitelist(record?: Recordable) { - createConfirm({ - iconType: 'warning', - title: '警告', - content: `是否添加白名单编号为${record?.userId}的数据?`, - onOk: async () => { - await addPushPassList({ - fromPushId: record?.userId, - toPushId: userInfoStore.id, - type: '1' - }); - createMessage.success('添加成功!'); - handleRefreshTable(); - } - }); - } - - function handleBlacklist(record?: Recordable) { - createConfirm({ - iconType: 'warning', - title: '警告', - content: `是否添加黑名单编号为${record?.userId}的数据?`, - onOk: async () => { - await addPushPassList({ - fromPushId: record?.userId, - toPushId: userInfoStore.id, - type: '0' - }); - createMessage.success('添加成功!'); - handleRefreshTable(); - } - }); - } - /** 处理多选框选中数据 */ function handleSelectionChange(selection?: Recordable) { const rowSelection = toRaw(selection?.keys) || []; @@ -273,9 +200,6 @@ } return { - handleBlacklist, - handleWhitelist, - handlePushAdd, state, registerTable, registerModal, diff --git a/src/views/system/user/user.data.ts b/src/views/system/user/user.data.ts index 8a45008..4c5714d 100644 --- a/src/views/system/user/user.data.ts +++ b/src/views/system/user/user.data.ts @@ -266,11 +266,10 @@ export const userFormSchema: FormSchema[] = [ componentProps: { options: [ { label: '系统管理员', value: '0' }, - { label: '收样员', value: '1' }, - { label: '客服', value: '2' }, - { label: '医生', value: '3' }, - { label: '第三方企业', value: '9' }, - { label: '普通用户', value: '10' } + { label: '普通用户', value: '1' }, + { label: '企业用户', value: '2' }, + { label: '收样员', value: '3' }, + { label: '客服', value: '4' }, ] }, colProps: {