From 268d8bccae5ed4fe5110ffaedf2a9a78ee0c1a54 Mon Sep 17 00:00:00 2001 From: wangxiang <1827945911@qq.com> Date: Mon, 27 Feb 2023 15:01:01 +0800 Subject: [PATCH] =?UTF-8?q?:rocket:=20=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/pushApplication.ts | 4 + .../push/application/SendMessageModal.vue | 56 +++++++++ .../push/application/application.data.ts | 117 +++++++++++++++++- src/views/common/push/application/index.vue | 12 ++ 4 files changed, 184 insertions(+), 5 deletions(-) create mode 100644 src/views/common/push/application/SendMessageModal.vue diff --git a/src/api/platform/common/controller/pushApplication.ts b/src/api/platform/common/controller/pushApplication.ts index 91d2aec..329d183 100644 --- a/src/api/platform/common/controller/pushApplication.ts +++ b/src/api/platform/common/controller/pushApplication.ts @@ -5,6 +5,7 @@ */ import type { PushApplication, PushApplicationParams, PushApplicationResult } from '/@/api/platform/common/entity/pushApplication'; import { defHttp } from '/@/utils/http/axios'; +import type { PushMessage } from '/@/api/platform/common/entity/pushMessage'; enum Api { list = '/common_proxy/common/pushApplication/list', @@ -12,12 +13,15 @@ enum Api { get = '/common_proxy/common/pushApplication', edit = '/common_proxy/common/pushApplication/update', del = '/common_proxy/common/pushApplication/remove', + send = '/common_proxy/common/pushApplication/send' } export const listPushApplication = (params?: Partial) => defHttp.get({ url: Api.list, params }, { isReturnResultResponse: true }); export const addPushApplication = (params: Partial) => defHttp.post({ url: Api.add, data: params }); +export const sendMessage = (params: Partial) => defHttp.post({ url: Api.send, data: params }); + export const editPushApplication = (params: Partial) => defHttp.put({ url: Api.edit, data: params }); export const getPushApplication = (id: string) => defHttp.get({ url: `${Api.get}/${id}` }); diff --git a/src/views/common/push/application/SendMessageModal.vue b/src/views/common/push/application/SendMessageModal.vue new file mode 100644 index 0000000..13b7d89 --- /dev/null +++ b/src/views/common/push/application/SendMessageModal.vue @@ -0,0 +1,56 @@ + + diff --git a/src/views/common/push/application/application.data.ts b/src/views/common/push/application/application.data.ts index b4ec25a..14252d9 100644 --- a/src/views/common/push/application/application.data.ts +++ b/src/views/common/push/application/application.data.ts @@ -22,8 +22,8 @@ export const columns: BasicColumn[] = [ } }, { - title: '匹配域', - dataIndex: 'url' + title: '限制ip', + dataIndex: 'ip' }, { title: '创建人', @@ -75,10 +75,9 @@ export const formSchema: FormSchema[] = [ } }, { - field: 'url', - label: '匹配域', + field: 'ip', + label: '限制ip', component: 'Input', - required: true, colProps: { span: 12 } @@ -110,3 +109,111 @@ export const formSchema: FormSchema[] = [ } } ]; + +export const sendFormSchema: FormSchema[] = [ + { + field: 'fromUserId', + label: '发送方用户id', + component: 'Input', + show: false + }, + { + field: 'messageSecret', + label: 'app发送密钥', + component: 'Input', + show: false + }, + { + field: 'title', + label: '标题', + component: 'Input', + required: true, + colProps: { + span: 24 + } + }, + { + label: '通知文字描述', + field: 'text', + component: 'InputTextArea', + required: true, + componentProps: { + rows: 6 + }, + colProps: { + span: 24 + } + }, + { + label: '自定义通知声音', + field: 'sound', + component: 'Input', + componentProps: { + placeholder: '格式为R.raw.[sound]', + }, + colProps: { + span: 24 + } + }, + { + label: '自定义播放文件名称', + field: 'customPlayFileName', + component: 'Input', + colProps: { + span: 24 + } + }, + { + field: 'customTypeId', + label: '自定义推送类型ID', + component: 'Input', + colProps: { + span: 12 + } + }, + { + field: 'playVibrate', + label: '收到通知是否震动', + component: 'RadioGroup', + defaultValue: '0', + componentProps: { + options: [ + { label: '是', value: '0' }, + { label: '否', value: '1' } + ] + }, + colProps: { + span: 12 + } + }, + { + field: 'playLights', + label: '收到通知是否闪灯', + component: 'RadioGroup', + defaultValue: '0', + componentProps: { + options: [ + { label: '是', value: '0' }, + { label: '否', value: '1' } + ] + }, + colProps: { + span: 12 + } + }, + { + field: 'playSound', + label: '收到通知是否发出声音', + component: 'RadioGroup', + defaultValue: '0', + componentProps: { + options: [ + { label: '是', value: '0' }, + { label: '否', value: '1' } + ] + }, + colProps: { + span: 12 + } + }, +]; diff --git a/src/views/common/push/application/index.vue b/src/views/common/push/application/index.vue index 7ded182..95910e0 100644 --- a/src/views/common/push/application/index.vue +++ b/src/views/common/push/application/index.vue @@ -18,6 +18,11 @@ @@ -49,6 +55,7 @@ import { listPushApplication, delPushApplication } from '/@/api/platform/common/controller/pushApplication'; import { useModal } from '/@/components/Modal'; import ApplicationModal from './ApplicationModal.vue'; + import SendMessageModal from './SendMessageModal.vue'; import { columns, searchFormSchema } from './application.data'; import { useMessage } from '/@/hooks/web/useMessage'; @@ -67,6 +74,7 @@ }); const { createConfirm, createMessage } = useMessage(); const [registerModal, { openModal }] = useModal(); + const [registerSendModal, { openModal: openSendModal }] = useModal(); const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({ title: '推送应用列表', api: listPushApplication, @@ -111,6 +119,10 @@ openModal(true, { _tag: 'edit', record }); } + function handleSend(record?: Recordable) { + openSendModal(true, { record }); + } + /** 删除按钮操作,行内删除 */ async function handleDel(record?: Recordable) { const ids = record?.id || getSelectRowKeys();