diff --git a/src/api/platform/common/controller/pushConcernFan.ts b/src/api/platform/common/controller/pushConcernFan.ts index 5a7b0d9..749dec6 100644 --- a/src/api/platform/common/controller/pushConcernFan.ts +++ b/src/api/platform/common/controller/pushConcernFan.ts @@ -4,7 +4,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', + get = '/common_proxy/common/pushConcernFan/getById', add = '/common_proxy/common/pushConcernFan/save', edit = '/common_proxy/common/pushConcernFan/update', del = '/common_proxy/common/pushConcernFan/remove', @@ -19,7 +19,7 @@ export const addPushConcernFan = (params: Partial) => defHttp.po export const editPushConcernFan = (params: Partial) => defHttp.put({ url: Api.edit, data: params }); -export const getPushConcernFan = (id: string) => defHttp.get({ url: `${Api.get}/${id}` }); +export const getPushConcernFan = (id: string, onType: string) => defHttp.get({ url: Api.get, params: { id, onType } }); export const delPushConcernFan = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` }); diff --git a/src/api/platform/common/controller/pushType.ts b/src/api/platform/common/controller/pushType.ts index 1be2d1d..1dc05dd 100644 --- a/src/api/platform/common/controller/pushType.ts +++ b/src/api/platform/common/controller/pushType.ts @@ -7,6 +7,7 @@ enum Api { add = '/common_proxy/common/pushType/save', edit = '/common_proxy/common/pushType/update', del = '/common_proxy/common/pushType/remove', + setDefaultType = '/common_proxy/common/pushType/setDefaultType' } export const listPushType = (params?: Partial) => defHttp.get({ url: Api.list, params }, { isReturnResultResponse: true }); @@ -18,3 +19,5 @@ export const editPushType = (params: Partial) => defHttp.put({ url: Ap export const getPushType = (id: string) => defHttp.get({ url: `${Api.get}/${id}` }); export const delPushType = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` }); + +export const setDefaultType = (params: Partial) => defHttp.put({ url: Api.setDefaultType, data: params }); diff --git a/src/router/routes/modules/dashboard.ts b/src/router/routes/modules/dashboard.ts index dcb9289..b56178b 100644 --- a/src/router/routes/modules/dashboard.ts +++ b/src/router/routes/modules/dashboard.ts @@ -10,6 +10,7 @@ import type { AppRouteModule } from '/@/router/types'; import { LAYOUT } from '/@/router/constant'; import { t } from '/@/hooks/web/useI18n'; +import {isDevMode} from "/@/utils/env"; const dashboard: AppRouteModule = { path: '/dashboard', name: 'Dashboard', @@ -18,6 +19,7 @@ const dashboard: AppRouteModule = { meta: { icon: 'ion:grid-outline', title: t('routes.dashboard.dashboard'), + hideMenu: isDevMode() }, children: [ { diff --git a/src/router/routes/modules/demoFeat.ts b/src/router/routes/modules/demoFeat.ts index a791b8b..0f9aecc 100644 --- a/src/router/routes/modules/demoFeat.ts +++ b/src/router/routes/modules/demoFeat.ts @@ -7,6 +7,7 @@ import iframe from '../demo/iframe'; import level from '../demo/level'; import page from '../demo/page'; import setup from '../demo/setup'; +import { isDevMode } from '/@/utils/env'; const demoFeat: AppRouteModule = { path: '/demoFeat', @@ -16,6 +17,7 @@ const demoFeat: AppRouteModule = { meta: { icon: 'ion:layers-outline', title: '组件&功能', + hideMenu: isDevMode() }, children: [ setup, diff --git a/src/views/common/push/pushApplication/ApplicationModal.vue b/src/views/common/push/pushApplication/ApplicationModal.vue index 57681e7..9f7c159 100644 --- a/src/views/common/push/pushApplication/ApplicationModal.vue +++ b/src/views/common/push/pushApplication/ApplicationModal.vue @@ -15,7 +15,7 @@ * Copyright © 2020-2022 entfrm All rights reserved. * author entfrm开发团队-王翔 */ - import { ref, unref } from 'vue'; + import {ref, toRaw, unref} from 'vue'; import { BasicForm, useForm } from '/@/components/Form/index'; import { formSchema } from './application.data'; import { addPushApplication, editPushApplication, getPushApplication } from '/@/api/platform/common/controller/pushApplication'; @@ -39,6 +39,12 @@ tag.value = data._tag; const refId = data.record?.id; const props: Partial = { confirmLoading: false }; + await updateSchema([ + { + field: 'messageSecret', + ifShow: tag.value == 'edit' + } + ]); // 采用tag标签区分操作 switch (unref(tag)) { case 'add': diff --git a/src/views/common/push/pushApplication/application.data.ts b/src/views/common/push/pushApplication/application.data.ts index b6155a4..a6ac30e 100644 --- a/src/views/common/push/pushApplication/application.data.ts +++ b/src/views/common/push/pushApplication/application.data.ts @@ -3,8 +3,8 @@ import { FormSchema } from '/@/components/Table'; import { h } from 'vue'; import { Tag } from 'ant-design-vue'; import { listPushType } from '/@/api/platform/common/controller/pushType'; -import {listPushConcernFan} from "/@/api/platform/common/controller/pushConcernFan"; -import {useUserStore} from "/@/store/modules/user"; +import {listPushConcernFan} from '/@/api/platform/common/controller/pushConcernFan'; +import {useUserStore} from '/@/store/modules/user'; const userStore = useUserStore(); const userInfoStore = userStore.getUserInfo; @@ -128,7 +128,9 @@ export const sendFormSchema: FormSchema[] = [ field: 'messageSecret', label: 'app发送密钥', component: 'Input', - show: false + componentProps: { + disabled: true + } }, { field: 'remarks', @@ -162,7 +164,7 @@ export const sendFormSchema: FormSchema[] = [ componentProps: { api: listPushType, params: { - size: 99 + size: 999 }, labelField: 'name', valueField: 'id', @@ -177,14 +179,14 @@ export const sendFormSchema: FormSchema[] = [ api: listPushConcernFan, params: { status: '1', - fanUserId: userInfoStore.id + concernUserId: userInfoStore.id }, resultField: 'data', treeCheckable: true, showCheckedStrategy: 'SHOW_PARENT', treeDefaultExpandAll: true, maxTagCount: 10, - fieldNames: { label: 'nickName', key: 'concernUserId', value: 'concernUserId' }, + fieldNames: { label: 'nickName', key: 'fanUserId', value: 'fanUserId' }, allowClear: true, }, }, diff --git a/src/views/common/push/pushConcern/ConcernModal.vue b/src/views/common/push/pushConcern/ConcernModal.vue index 9b71f9a..eeed030 100644 --- a/src/views/common/push/pushConcern/ConcernModal.vue +++ b/src/views/common/push/pushConcern/ConcernModal.vue @@ -31,9 +31,10 @@ // 处理设置数据 tag.value = data._tag; const refId = data.record?.id; + const onType = data.onType || '0'; const props: Partial = { confirmLoading: false }; props.title = '查看关注用户'; - await setFieldsValue(await getPushConcernFan(refId)); + await setFieldsValue(await getPushConcernFan(refId, onType)); // 尾部:设置处理后的最终配置数据 setModalProps(props); }); diff --git a/src/views/common/push/pushConcern/index.vue b/src/views/common/push/pushConcern/index.vue index 669b58a..ecf9ad4 100644 --- a/src/views/common/push/pushConcern/index.vue +++ b/src/views/common/push/pushConcern/index.vue @@ -4,21 +4,6 @@ @register="registerTable" @selection-change="handleSelectionChange" > - - diff --git a/src/views/common/push/pushEnterprise/index.vue b/src/views/common/push/pushEnterprise/index.vue index d0bcd60..24ffb85 100644 --- a/src/views/common/push/pushEnterprise/index.vue +++ b/src/views/common/push/pushEnterprise/index.vue @@ -86,7 +86,7 @@ clickToRowSelect: false, showIndexColumn: false, actionColumn: { - width: 450, + width: 220, title: '操作', dataIndex: 'action', fixed: false diff --git a/src/views/common/push/pushFan/index.vue b/src/views/common/push/pushFan/index.vue index 2960118..d731f35 100644 --- a/src/views/common/push/pushFan/index.vue +++ b/src/views/common/push/pushFan/index.vue @@ -4,6 +4,22 @@ @register="registerTable" @selection-change="handleSelectionChange" > + @@ -41,9 +64,12 @@ import { listPushConcernFan, delPushConcernFan } from '/@/api/platform/common/controller/pushConcernFan'; import { useModal } from '/@/components/Modal'; import ConcernModal from '../pushConcern/ConcernModal.vue'; - import { columns, searchFormSchema } from '../pushConcern/concern.data'; + import { columns, pushTypeColumns, searchFormSchema } from '../pushConcern/concern.data'; import { useMessage } from '/@/hooks/web/useMessage'; import { useUserStore } from '/@/store/modules/user'; + import TypeModal from '../pushType/TypeModal.vue'; + import { listPushConcernFanType } from '/@/api/platform/common/controller/pushConcernFanType'; + import { searchFormSchema as pushTypeSearchFormSchema } from '/@/views/common/push/pushType/type.data'; const userStore = useUserStore(); const userInfoStore = userStore.getUserInfo; @@ -61,6 +87,7 @@ }); const { createConfirm, createMessage } = useMessage(); const [registerModal, { openModal }] = useModal(); + const [pushTypeRegisterModal, { openModal: pushTypeOpenModal }] = useModal(); const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({ title: '粉丝列表', api: listPushConcernFan, @@ -92,6 +119,32 @@ }, handleSearchInfoFn: () => clearSelectedRowKeys() }); + const [pushTypeRegisterTable, { reload: pushTypeReload, setColumns }] = useTable({ + title: '推送类型列表', + api: listPushConcernFanType, + rowKey: 'id', + columns: pushTypeColumns(handleRefreshPushTypeTable), + formConfig: { + compact: true, + labelWidth: 80, + schemas: pushTypeSearchFormSchema, + autoSubmitOnEnter: true, + showAdvancedButton: true, + autoAdvancedLine: 3, + }, + maxHeight: 150, + useSearchForm: true, + showTableSetting: true, + bordered: true, + clickToRowSelect: false, + showIndexColumn: false, + actionColumn: { + width: 220, + title: '操作', + dataIndex: 'action', + fixed: false + } + }); /** 处理多选框选中数据 */ function handleSelectionChange(selection?: Recordable) { @@ -106,6 +159,11 @@ openModal(true, { _tag: 'view', record }); } + function handlePushTypeEdit(record?: Recordable) { + record = record || { id: getSelectRowKeys() }; + pushTypeOpenModal(true, { _tag: 'fanEdit', record, onlineRingtoneCreateId: record.fanUserId }); + } + /** 删除按钮操作,行内删除 */ async function handleDel(record?: Recordable) { const ids = record?.id || getSelectRowKeys(); @@ -127,4 +185,8 @@ reload(); } + function handleRefreshPushTypeTable() { + pushTypeReload(); + } + diff --git a/src/views/common/push/pushFriend/friend.data.ts b/src/views/common/push/pushFriend/friend.data.ts index 0daa590..b669152 100644 --- a/src/views/common/push/pushFriend/friend.data.ts +++ b/src/views/common/push/pushFriend/friend.data.ts @@ -136,6 +136,7 @@ export const userFormSchema: FormSchema[] = [ { label: '企业用户', value: '2' }, { label: '收样员', value: '3' }, { label: '客服', value: '4' }, + { label: '企业内部用户', value: '5' }, ] }, colProps: { diff --git a/src/views/common/push/pushFriend/index.vue b/src/views/common/push/pushFriend/index.vue index 765d719..5685d8b 100644 --- a/src/views/common/push/pushFriend/index.vue +++ b/src/views/common/push/pushFriend/index.vue @@ -14,8 +14,16 @@ { label: '关注', icon: 'fa6-brands:battle-net', + ifShow: userInfoStore.userType != '2', disabled: !!record?.cfStatus || !!record?.bId, - onClick: handleAddFriend.bind(null, record) + onClick: handleAddConcern.bind(null, record) + }, + { + label: '粉丝申请', + icon: 'fa6-brands:battle-net', + ifShow: userInfoStore.userType == '2', + disabled: !!record?.cfStatus || !!record?.bId, + onClick: handleAddFanAudit.bind(null, record) }, { label: '加入黑名单', @@ -33,12 +41,6 @@