Browse Source

fix: 修复推送消息流程

master
wangxiang 2 years ago
parent
commit
2dbe7b0d58
  1. 57
      src/views/common/push/pushConcern/index.vue
  2. 58
      src/views/common/push/pushFan/index.vue
  3. 4
      src/views/common/push/pushType/TypeModal.vue

57
src/views/common/push/pushConcern/index.vue

@ -4,6 +4,21 @@ @@ -4,6 +4,21 @@
@register="registerTable"
@selection-change="handleSelectionChange"
>
<template #expandedRowRender="{ record }">
<BasicTable :searchInfo="{ concernUserId: record.concernUserId }" @register="pushTypeRegisterTable">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction :actions="[
{
label: '编辑',
icon: 'fa6-regular:pen-to-square',
onClick: handlePushTypeEdit.bind(null, record)
}]"
/>
</template>
</template>
</BasicTable>
</template>
<template #toolbar>
<a-button
type="primary"
@ -33,6 +48,7 @@ @@ -33,6 +48,7 @@
</template>
</BasicTable>
<ConcernModal @register="registerModal" @success="handleRefreshTable"/>
<TypeModal @register="pushTypeRegisterModal" @success="handleRefreshPushTypeTable"/>
</div>
</template>
@ -42,9 +58,12 @@ @@ -42,9 +58,12 @@
import { listPushConcernFan, delPushConcernFan } from '/@/api/platform/common/controller/pushConcernFan';
import { useModal } from '/@/components/Modal';
import ConcernModal from './ConcernModal.vue';
import { columns, searchFormSchema } from './concern.data';
import { columns, pushTypeColumns, searchFormSchema } from './concern.data';
import { useMessage } from '/@/hooks/web/useMessage';
import { useUserStore } from '/@/store/modules/user';
import { listPushConcernFanType } from '/@/api/platform/common/controller/pushConcernFanType';
import { searchFormSchema as pushTypeSearchFormSchema } from '/@/views/common/push/pushType/type.data';
import TypeModal from '../pushType/TypeModal.vue';
const userStore = useUserStore();
const userInfoStore = userStore.getUserInfo;
@ -62,6 +81,7 @@ @@ -62,6 +81,7 @@
});
const { createConfirm, createMessage } = useMessage();
const [registerModal, { openModal }] = useModal();
const [pushTypeRegisterModal, { openModal: pushTypeOpenModal }] = useModal();
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({
title: '关注列表',
api: listPushConcernFan,
@ -94,6 +114,32 @@ @@ -94,6 +114,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) {
@ -108,6 +154,11 @@ @@ -108,6 +154,11 @@
openModal(true, { _tag: 'view', record, onType: '1' });
}
function handlePushTypeEdit(record?: Recordable) {
record = record || { id: getSelectRowKeys() };
pushTypeOpenModal(true, { _tag: 'concernEdit', record, onlineRingtoneCreateId: record.concernUserId });
}
/** 删除按钮操作,行内删除 */
async function handleDel(record?: Recordable) {
const ids = record?.id || getSelectRowKeys();
@ -129,4 +180,8 @@ @@ -129,4 +180,8 @@
reload();
}
function handleRefreshPushTypeTable() {
pushTypeReload();
}
</script>

58
src/views/common/push/pushFan/index.vue

@ -4,22 +4,6 @@ @@ -4,22 +4,6 @@
@register="registerTable"
@selection-change="handleSelectionChange"
>
<template #expandedRowRender="{ record }">
<BasicTable :searchInfo="{ fanUserId: record.fanUserId }" @register="pushTypeRegisterTable">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
label: '编辑',
icon: 'fa6-regular:pen-to-square',
onClick: handlePushTypeEdit.bind(null, record)
}]"
/>
</template>
</template>
</BasicTable>
</template>
<template #toolbar>
<a-button
type="primary"
@ -54,7 +38,6 @@ @@ -54,7 +38,6 @@
</template>
</BasicTable>
<ConcernModal @register="registerModal" @success="handleRefreshTable"/>
<TypeModal @register="pushTypeRegisterModal" @success="handleRefreshPushTypeTable"/>
</div>
</template>
@ -64,12 +47,9 @@ @@ -64,12 +47,9 @@
import { listPushConcernFan, delPushConcernFan } from '/@/api/platform/common/controller/pushConcernFan';
import { useModal } from '/@/components/Modal';
import ConcernModal from '../pushConcern/ConcernModal.vue';
import { columns, pushTypeColumns, searchFormSchema } from '../pushConcern/concern.data';
import { columns, 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;
@ -87,7 +67,6 @@ @@ -87,7 +67,6 @@
});
const { createConfirm, createMessage } = useMessage();
const [registerModal, { openModal }] = useModal();
const [pushTypeRegisterModal, { openModal: pushTypeOpenModal }] = useModal();
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({
title: '粉丝列表',
api: listPushConcernFan,
@ -119,32 +98,6 @@ @@ -119,32 +98,6 @@
},
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) {
@ -159,11 +112,6 @@ @@ -159,11 +112,6 @@
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();
@ -185,8 +133,4 @@ @@ -185,8 +133,4 @@
reload();
}
function handleRefreshPushTypeTable() {
pushTypeReload();
}
</script>

4
src/views/common/push/pushType/TypeModal.vue

@ -66,7 +66,7 @@ @@ -66,7 +66,7 @@
props.title = '编辑推送类型';
await setFieldsValue(await getPushType(refId));
break;
case 'fanEdit':
case 'concernEdit':
props.title = '编辑粉丝推送类型';
await setFieldsValue(await getPushConcernFanType(refId));
break;
@ -90,7 +90,7 @@ @@ -90,7 +90,7 @@
case 'edit':
await editPushType(formData);
break;
case 'fanEdit':
case 'concernEdit':
await editPushConcernFanType(formData);
break;
}

Loading…
Cancel
Save