|
@@ -17,11 +17,15 @@
|
|
|
{{ t('wechat.contact.addContact') }}
|
|
|
</a-button>
|
|
|
</template>
|
|
|
- <template #bodyCell="{ column, record }">
|
|
|
+ <template #bodyCell="{ column, record }" >
|
|
|
<template v-if="column.key === 'action'">
|
|
|
- <TableAction
|
|
|
+ <TableAction
|
|
|
:actions="[
|
|
|
{
|
|
|
+ icon: 'ant-design:comment-outlined',
|
|
|
+ onClick: handleMsg.bind(null, record),
|
|
|
+ },
|
|
|
+ {
|
|
|
icon: 'clarity:note-edit-line',
|
|
|
onClick: handleEdit.bind(null, record),
|
|
|
},
|
|
@@ -40,6 +44,7 @@
|
|
|
</template>
|
|
|
</BasicTable>
|
|
|
<ContactDrawer @register="registerDrawer" @success="handleSuccess" />
|
|
|
+ <SendMsgDrawer @register="registerDrawerMsg" @success="handleSuccess1"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
@@ -51,6 +56,7 @@
|
|
|
|
|
|
import { useDrawer } from '@/components/Drawer';
|
|
|
import ContactDrawer from './ContactDrawer.vue';
|
|
|
+ import SendMsgDrawer from './SendMsgDrawer.vue'
|
|
|
import { useI18n } from 'vue-i18n';
|
|
|
|
|
|
import { columns, searchFormSchema } from './contact.data';
|
|
@@ -58,13 +64,14 @@
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'ContactManagement',
|
|
|
- components: { BasicTable, ContactDrawer, TableAction, Button },
|
|
|
+ components: { BasicTable,SendMsgDrawer, ContactDrawer, TableAction, Button },
|
|
|
setup() {
|
|
|
const { t } = useI18n();
|
|
|
const selectedIds = ref<number[] | string[]>();
|
|
|
const showDeleteButton = ref<boolean>(false);
|
|
|
|
|
|
const [registerDrawer, { openDrawer }] = useDrawer();
|
|
|
+ const [registerDrawerMsg,{ openDrawerMsg }] = useDrawer();
|
|
|
const [registerTable, { reload }] = useTable({
|
|
|
title: t('wechat.contact.contactList'),
|
|
|
api: getContactList,
|
|
@@ -79,7 +86,7 @@
|
|
|
showIndexColumn: false,
|
|
|
clickToRowSelect: false,
|
|
|
actionColumn: {
|
|
|
- width: 30,
|
|
|
+ width: 60,
|
|
|
title: t('common.action'),
|
|
|
dataIndex: 'action',
|
|
|
fixed: undefined,
|
|
@@ -106,6 +113,12 @@
|
|
|
isUpdate: true,
|
|
|
});
|
|
|
}
|
|
|
+ function handleMsg(record: Recordable) {
|
|
|
+ console.log(record,'"')
|
|
|
+ openDrawerMsg(true, {
|
|
|
+ record,
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
async function handleDelete(record: Recordable) {
|
|
|
const result = await deleteContact({ ids: [record.id] });
|
|
@@ -134,15 +147,21 @@
|
|
|
async function handleSuccess() {
|
|
|
await reload();
|
|
|
}
|
|
|
+ async function handleSuccess1() {
|
|
|
+ await reload();
|
|
|
+ }
|
|
|
|
|
|
return {
|
|
|
t,
|
|
|
registerTable,
|
|
|
registerDrawer,
|
|
|
+ registerDrawerMsg,
|
|
|
handleCreate,
|
|
|
+ handleMsg,
|
|
|
handleEdit,
|
|
|
handleDelete,
|
|
|
handleSuccess,
|
|
|
+ handleSuccess1,
|
|
|
handleBatchDelete,
|
|
|
showDeleteButton,
|
|
|
};
|