Showing
15 changed files
with
143 additions
and
295 deletions
1 | import { BasicPageParams } from '/@/api/model/baseModel'; | 1 | import { BasicPageParams } from '/@/api/model/baseModel'; |
2 | 2 | ||
3 | export type NoticeQueryParam = BasicPageParams & NoticeParams; | 3 | export type NoticeQueryParam = BasicPageParams & NoticeParams; |
4 | - | 4 | +export type NoticeUserParam = BasicPageParams & NoticeUserParams; |
5 | export type NoticeParams = { | 5 | export type NoticeParams = { |
6 | orderFiled?: string; | 6 | orderFiled?: string; |
7 | id?: string; | 7 | id?: string; |
8 | }; | 8 | }; |
9 | 9 | ||
10 | +export type NoticeUserParams = { | ||
11 | + noticeId?: string; | ||
12 | +}; | ||
10 | export type NoticeByIdParams = { | 13 | export type NoticeByIdParams = { |
11 | id: string; | 14 | id: string; |
12 | }; | 15 | }; |
1 | import { defHttp } from '/@/utils/http/axios'; | 1 | import { defHttp } from '/@/utils/http/axios'; |
2 | import { | 2 | import { |
3 | NoticeQueryParam, | 3 | NoticeQueryParam, |
4 | + NoticeUserParam, | ||
4 | NotifyAddDraftModel, | 5 | NotifyAddDraftModel, |
5 | NotifyAddreLeaseModel, | 6 | NotifyAddreLeaseModel, |
6 | } from '/@/api/stationnotification/model/stationnotifyModel'; | 7 | } from '/@/api/stationnotification/model/stationnotifyModel'; |
@@ -129,12 +130,10 @@ export const notifyOrganizationGetApi = () => { | @@ -129,12 +130,10 @@ export const notifyOrganizationGetApi = () => { | ||
129 | }); | 130 | }); |
130 | }; | 131 | }; |
131 | 132 | ||
132 | -export const getNotifyDetailPage = (id: string) => { | ||
133 | - console.log(id, '-----------------'); | ||
134 | - return (params) => { | ||
135 | - return defHttp.get({ | ||
136 | - url: `${NotifyManagerApi.NOTICE_GET_PAGE_URL}/${id}`, | ||
137 | - params, | ||
138 | - }); | ||
139 | - }; | 133 | +// 获取通知管理的查看表格数据 |
134 | +export const getNotifyDetailPage = (params: NoticeUserParam) => { | ||
135 | + return defHttp.get({ | ||
136 | + url: NotifyManagerApi.NOTICE_GET_PAGE_URL + '/' + params.noticeId, | ||
137 | + params, | ||
138 | + }); | ||
140 | }; | 139 | }; |
@@ -64,7 +64,10 @@ export const saveOrUpdateOrganization = (params?: OrganizationListItem, isUpdate | @@ -64,7 +64,10 @@ export const saveOrUpdateOrganization = (params?: OrganizationListItem, isUpdate | ||
64 | * @param ids 删除的ID | 64 | * @param ids 删除的ID |
65 | */ | 65 | */ |
66 | export const delOrganization = (ids: string[]) => | 66 | export const delOrganization = (ids: string[]) => |
67 | - defHttp.delete({ url: Api.BaseOrganization, data: ids }); | 67 | + defHttp.delete({ |
68 | + url: Api.BaseOrganization, | ||
69 | + data: ids, | ||
70 | + }); | ||
68 | 71 | ||
69 | export const getMenuList = (params?: MenuParams) => | 72 | export const getMenuList = (params?: MenuParams) => |
70 | defHttp.get<MenuListGetResultModel>({ url: Api.MenuList, params }); | 73 | defHttp.get<MenuListGetResultModel>({ url: Api.MenuList, params }); |
src/views/stationnotification/mynotification/child/index.vue
deleted
100644 → 0
1 | -<template> | ||
2 | - <div> | ||
3 | - <PageWrapper title="我的通知详情"> | ||
4 | - <Description @register="register1" class="mt-4" /> | ||
5 | - </PageWrapper> | ||
6 | - </div> | ||
7 | -</template> | ||
8 | -<script lang="ts"> | ||
9 | - import { defineComponent, watch, ref } from 'vue'; | ||
10 | - import { Description, DescItem, useDescription } from '/@/components/Description/index'; | ||
11 | - import { PageWrapper } from '/@/components/Page'; | ||
12 | - | ||
13 | - const schema: DescItem[] = [ | ||
14 | - { | ||
15 | - field: 'creator', | ||
16 | - label: '创建者', | ||
17 | - }, | ||
18 | - { | ||
19 | - field: 'createTime', | ||
20 | - label: '创建时间', | ||
21 | - }, | ||
22 | - { | ||
23 | - field: 'title', | ||
24 | - label: '标题', | ||
25 | - }, | ||
26 | - { | ||
27 | - field: 'updateTime', | ||
28 | - label: '更新时间', | ||
29 | - }, | ||
30 | - { | ||
31 | - field: 'senderName', | ||
32 | - label: '发送者', | ||
33 | - }, | ||
34 | - { | ||
35 | - field: 'readDate', | ||
36 | - label: '阅读时间', | ||
37 | - }, | ||
38 | - { | ||
39 | - field: 'readStatus', | ||
40 | - label: '阅读状态', | ||
41 | - render: (_, data) => { | ||
42 | - return data.readStatus === 0 ? '草稿' : data.readStatus === 1 ? '已读' : '其他'; | ||
43 | - }, | ||
44 | - }, | ||
45 | - { | ||
46 | - field: 'type', | ||
47 | - label: '类型', | ||
48 | - render: (_, data) => { | ||
49 | - return data.type === 'NOTICE' | ||
50 | - ? '公告' | ||
51 | - : data.type === 'MEETING' | ||
52 | - ? '会议' | ||
53 | - : data.type === 'OTHER' | ||
54 | - ? '其他' | ||
55 | - : ''; | ||
56 | - }, | ||
57 | - }, | ||
58 | - { | ||
59 | - field: 'updater', | ||
60 | - label: '更新者', | ||
61 | - }, | ||
62 | - ]; | ||
63 | - export default defineComponent({ | ||
64 | - components: { Description, PageWrapper }, | ||
65 | - props: { | ||
66 | - emitChildData: { | ||
67 | - type: Object, | ||
68 | - }, | ||
69 | - }, | ||
70 | - setup(props) { | ||
71 | - let useDescriptionData: any = ref(null); | ||
72 | - watch( | ||
73 | - () => props.emitChildData, | ||
74 | - async (newV) => { | ||
75 | - useDescriptionData.value = newV; | ||
76 | - } | ||
77 | - ); | ||
78 | - const [register1] = useDescription({ | ||
79 | - title: '通知详情', | ||
80 | - bordered: false, | ||
81 | - data: useDescriptionData, | ||
82 | - schema: schema, | ||
83 | - }); | ||
84 | - | ||
85 | - return { register1 }; | ||
86 | - }, | ||
87 | - }); | ||
88 | -</script> |
1 | import { BasicColumn, FormSchema } from '/@/components/Table'; | 1 | import { BasicColumn, FormSchema } from '/@/components/Table'; |
2 | import { Tag } from 'ant-design-vue'; | 2 | import { Tag } from 'ant-design-vue'; |
3 | +import { DescItem } from '/@/components/Description/index'; | ||
4 | + | ||
3 | import { h } from 'vue'; | 5 | import { h } from 'vue'; |
4 | 6 | ||
5 | export const columns: BasicColumn[] = [ | 7 | export const columns: BasicColumn[] = [ |
@@ -8,7 +10,7 @@ export const columns: BasicColumn[] = [ | @@ -8,7 +10,7 @@ export const columns: BasicColumn[] = [ | ||
8 | dataIndex: 'title', | 10 | dataIndex: 'title', |
9 | width: 200, | 11 | width: 200, |
10 | format: (text: string, record: Recordable) => { | 12 | format: (text: string, record: Recordable) => { |
11 | - return record.title ? record.title : '无'; | 13 | + return record.sysNotice.title ?? '无'; |
12 | }, | 14 | }, |
13 | }, | 15 | }, |
14 | { | 16 | { |
@@ -16,11 +18,11 @@ export const columns: BasicColumn[] = [ | @@ -16,11 +18,11 @@ export const columns: BasicColumn[] = [ | ||
16 | dataIndex: 'type', | 18 | dataIndex: 'type', |
17 | width: 200, | 19 | width: 200, |
18 | format: (text: string, record: Recordable) => { | 20 | format: (text: string, record: Recordable) => { |
19 | - return record.type === 'NOTICE' | 21 | + return record.sysNotice.type === 'NOTICE' |
20 | ? '公告' | 22 | ? '公告' |
21 | - : record.type === 'MEETING' | 23 | + : record.sysNotice.type === 'MEETING' |
22 | ? '会议' | 24 | ? '会议' |
23 | - : record.type === 'OTHER' | 25 | + : record.sysNotice.type === 'OTHER' |
24 | ? '其他' | 26 | ? '其他' |
25 | : '无'; | 27 | : '无'; |
26 | }, | 28 | }, |
@@ -30,7 +32,7 @@ export const columns: BasicColumn[] = [ | @@ -30,7 +32,7 @@ export const columns: BasicColumn[] = [ | ||
30 | dataIndex: 'senderName', | 32 | dataIndex: 'senderName', |
31 | width: 200, | 33 | width: 200, |
32 | format: (text: string, record: Recordable) => { | 34 | format: (text: string, record: Recordable) => { |
33 | - return record.senderName ? record.senderName : '无'; | 35 | + return record.sysNotice.senderName ?? '无'; |
34 | }, | 36 | }, |
35 | }, | 37 | }, |
36 | { | 38 | { |
@@ -47,7 +49,7 @@ export const columns: BasicColumn[] = [ | @@ -47,7 +49,7 @@ export const columns: BasicColumn[] = [ | ||
47 | const enable = status == 0 ? '未读' : status == 1 ? '已读' : '其他'; | 49 | const enable = status == 0 ? '未读' : status == 1 ? '已读' : '其他'; |
48 | const color = enable == '未读' ? 'green' : enable == '已读' ? 'yellow' : 'red'; | 50 | const color = enable == '未读' ? 'green' : enable == '已读' ? 'yellow' : 'red'; |
49 | const text = enable == '未读' ? '未读' : enable == '已读' ? '已读' : '其他'; | 51 | const text = enable == '未读' ? '未读' : enable == '已读' ? '已读' : '其他'; |
50 | - return h(Tag, { color: color }, () => text); | 52 | + return h(Tag, { color }, () => text); |
51 | }, | 53 | }, |
52 | }, | 54 | }, |
53 | ]; | 55 | ]; |
@@ -76,3 +78,27 @@ export const searchFormSchema: FormSchema[] = [ | @@ -76,3 +78,27 @@ export const searchFormSchema: FormSchema[] = [ | ||
76 | }, | 78 | }, |
77 | }, | 79 | }, |
78 | ]; | 80 | ]; |
81 | + | ||
82 | +export const DescDetailSchema: DescItem[] = [ | ||
83 | + { | ||
84 | + field: 'sysNotice.senderName', | ||
85 | + label: '发送者', | ||
86 | + }, | ||
87 | + { | ||
88 | + field: 'sysNotice.senderDate', | ||
89 | + label: '发送时间', | ||
90 | + }, | ||
91 | + { | ||
92 | + field: 'sysNotice.type', | ||
93 | + label: '类型', | ||
94 | + render: (text) => { | ||
95 | + return text === 'NOTICE' | ||
96 | + ? '公告' | ||
97 | + : text === 'MEETING' | ||
98 | + ? '会议' | ||
99 | + : text === 'OTHER' | ||
100 | + ? '其他' | ||
101 | + : ''; | ||
102 | + }, | ||
103 | + }, | ||
104 | +]; |
1 | <template> | 1 | <template> |
2 | <div> | 2 | <div> |
3 | - <BasicTable | ||
4 | - :rowSelection="{ type: 'checkbox' }" | ||
5 | - @selection-change="useSelectionChange" | ||
6 | - @register="registerTable" | ||
7 | - > | 3 | + <BasicTable @register="registerTable"> |
8 | <template #action="{ record }"> | 4 | <template #action="{ record }"> |
9 | <TableAction | 5 | <TableAction |
10 | :actions="[ | 6 | :actions="[ |
11 | { | 7 | { |
12 | label: '查看', | 8 | label: '查看', |
9 | + tooltip: '查看', | ||
13 | icon: 'clarity:note-edit-line', | 10 | icon: 'clarity:note-edit-line', |
14 | onClick: handleView.bind(null, record), | 11 | onClick: handleView.bind(null, record), |
15 | }, | 12 | }, |
@@ -26,26 +23,19 @@ | @@ -26,26 +23,19 @@ | ||
26 | import { useDrawer } from '/@/components/Drawer'; | 23 | import { useDrawer } from '/@/components/Drawer'; |
27 | import NotifyDetailDrawer from './useDrawer.vue'; | 24 | import NotifyDetailDrawer from './useDrawer.vue'; |
28 | import { columns, searchFormSchema } from './config.d'; | 25 | import { columns, searchFormSchema } from './config.d'; |
29 | - // import { useMessage } from '/@/hooks/web/useMessage'; | ||
30 | - // ,notifyMyGetDetailApi,notifyMyGetrPageApi,notifyMyGetrReadApi | ||
31 | import { notifyMyGetrPageApi } from '/@/api/stationnotification/stationnotifyApi'; | 26 | import { notifyMyGetrPageApi } from '/@/api/stationnotification/stationnotifyApi'; |
32 | - | ||
33 | export default defineComponent({ | 27 | export default defineComponent({ |
34 | name: 'Index', | 28 | name: 'Index', |
35 | components: { BasicTable, NotifyDetailDrawer, TableAction }, | 29 | components: { BasicTable, NotifyDetailDrawer, TableAction }, |
36 | setup() { | 30 | setup() { |
37 | - let selectedRowKeys: Array<string> = []; | ||
38 | const [registerDrawer, { openDrawer }] = useDrawer(); | 31 | const [registerDrawer, { openDrawer }] = useDrawer(); |
39 | - const [registerTable, { reload, getSelectRowKeys }] = useTable({ | ||
40 | - title: '', | ||
41 | - clickToRowSelect: false, | 32 | + const [registerTable, { reload }] = useTable({ |
42 | api: notifyMyGetrPageApi, | 33 | api: notifyMyGetrPageApi, |
43 | columns, | 34 | columns, |
44 | formConfig: { | 35 | formConfig: { |
45 | labelWidth: 120, | 36 | labelWidth: 120, |
46 | schemas: searchFormSchema, | 37 | schemas: searchFormSchema, |
47 | }, | 38 | }, |
48 | - rowKey: 'id', | ||
49 | useSearchForm: true, | 39 | useSearchForm: true, |
50 | showTableSetting: true, | 40 | showTableSetting: true, |
51 | bordered: true, | 41 | bordered: true, |
@@ -55,19 +45,13 @@ | @@ -55,19 +45,13 @@ | ||
55 | title: '操作', | 45 | title: '操作', |
56 | dataIndex: 'action', | 46 | dataIndex: 'action', |
57 | slots: { customRender: 'action' }, | 47 | slots: { customRender: 'action' }, |
58 | - fixed: undefined, | 48 | + fixed: 'right', |
59 | }, | 49 | }, |
60 | }); | 50 | }); |
61 | 51 | ||
62 | - const useSelectionChange = () => { | ||
63 | - selectedRowKeys = getSelectRowKeys(); | ||
64 | - console.log(selectedRowKeys); | ||
65 | - }; | ||
66 | - | ||
67 | function handleView(record: Recordable) { | 52 | function handleView(record: Recordable) { |
68 | openDrawer(true, { | 53 | openDrawer(true, { |
69 | record, | 54 | record, |
70 | - isUpdate: true, | ||
71 | }); | 55 | }); |
72 | } | 56 | } |
73 | 57 | ||
@@ -75,7 +59,6 @@ | @@ -75,7 +59,6 @@ | ||
75 | reload(); | 59 | reload(); |
76 | } | 60 | } |
77 | return { | 61 | return { |
78 | - useSelectionChange, | ||
79 | registerTable, | 62 | registerTable, |
80 | registerDrawer, | 63 | registerDrawer, |
81 | handleView, | 64 | handleView, |
@@ -4,109 +4,53 @@ | @@ -4,109 +4,53 @@ | ||
4 | v-bind="$attrs" | 4 | v-bind="$attrs" |
5 | @register="registerDrawer" | 5 | @register="registerDrawer" |
6 | :showFooter="false" | 6 | :showFooter="false" |
7 | - :title="getTitle" | ||
8 | - width="1000px" | 7 | + title="通知详情" |
8 | + width="70%" | ||
9 | + @close="handleClose" | ||
9 | > | 10 | > |
10 | - <DetailChild :emitChildData="childData" /> | ||
11 | - <BasicTable :columns="columns" :dataSource="tableData"> | ||
12 | - <span></span> | ||
13 | - </BasicTable> | 11 | + <div v-html="DescInfo?.content"></div> |
12 | + <Description @register="registerDesc" /> | ||
14 | </BasicDrawer> | 13 | </BasicDrawer> |
15 | </div> | 14 | </div> |
16 | </template> | 15 | </template> |
17 | <script lang="ts"> | 16 | <script lang="ts"> |
18 | - import { defineComponent, ref, computed, unref } from 'vue'; | 17 | + import { defineComponent, ref } from 'vue'; |
19 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; | 18 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
20 | - import DetailChild from './child/index.vue'; | 19 | + import { Description, useDescription } from '/@/components/Description/index'; |
20 | + import { DescDetailSchema } from './config.d'; | ||
21 | import { | 21 | import { |
22 | + noticeByIdGetInfo, | ||
22 | notifyMyGetrReadApi, | 23 | notifyMyGetrReadApi, |
23 | notifyMyGetDetailApi, | 24 | notifyMyGetDetailApi, |
24 | } from '/@/api/stationnotification/stationnotifyApi'; | 25 | } from '/@/api/stationnotification/stationnotifyApi'; |
25 | - import { BasicTable } from '/@/components/Table'; | ||
26 | - import { BasicColumn } from '/@/components/Table/src/types/table'; | ||
27 | - | ||
28 | export default defineComponent({ | 26 | export default defineComponent({ |
29 | - name: 'ConfigDrawer', | ||
30 | - components: { BasicDrawer, DetailChild, BasicTable }, | 27 | + name: 'MyNoticeDrawer', |
28 | + components: { BasicDrawer, Description }, | ||
31 | emits: ['success', 'register'], | 29 | emits: ['success', 'register'], |
32 | - setup() { | ||
33 | - const isUpdate = ref(true); | ||
34 | - const childData: any = ref(null); | ||
35 | - const tableData = ref([]); | ||
36 | - const columns: BasicColumn[] = [ | ||
37 | - { | ||
38 | - title: '创建时间', | ||
39 | - dataIndex: 'createTime', | ||
40 | - }, | ||
41 | - { | ||
42 | - title: '阅读状态', | ||
43 | - dataIndex: 'readStatus', | ||
44 | - format: (_text: string, record: Recordable) => { | ||
45 | - return record.readStatus === '0' ? '草稿' : record.readStatus === '1' ? '已读' : '其他'; | ||
46 | - }, | ||
47 | - }, | ||
48 | - { | ||
49 | - title: '阅读时间', | ||
50 | - dataIndex: 'readDate', | ||
51 | - }, | ||
52 | - { | ||
53 | - title: '发送者', | ||
54 | - dataIndex: 'senderName', | ||
55 | - format: (_text: string, record: Recordable) => { | ||
56 | - return record.sysNoticeDTO.senderName; | ||
57 | - }, | ||
58 | - }, | ||
59 | - { | ||
60 | - title: '发送时间', | ||
61 | - dataIndex: 'senderDate', | ||
62 | - format: (_text: string, record: Recordable) => { | ||
63 | - return record.sysNoticeDTO.senderDate; | ||
64 | - }, | ||
65 | - }, | ||
66 | - { | ||
67 | - title: '类型', | ||
68 | - dataIndex: 'type', | ||
69 | - format: (_text: string, record: Recordable) => { | ||
70 | - return record.sysNoticeDTO.type === 'NOTICE' | ||
71 | - ? '公告' | ||
72 | - : record.sysNoticeDTO.type === 'MEETING' | ||
73 | - ? '会议' | ||
74 | - : record.sysNoticeDTO.type === 'OTHER' | ||
75 | - ? '其他' | ||
76 | - : '无'; | ||
77 | - }, | ||
78 | - }, | ||
79 | - ]; | ||
80 | - const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { | ||
81 | - setDrawerProps({ confirmLoading: false }); | ||
82 | - isUpdate.value = !!data?.isUpdate; | ||
83 | - if (data.record) { | ||
84 | - let getData = await notifyMyGetDetailApi(data.record.id); | ||
85 | - childData.value = getData; | ||
86 | - let tableGet = await notifyMyGetrReadApi({ | ||
87 | - page: 1, | ||
88 | - pageSize: 10, | ||
89 | - }); | ||
90 | - tableData.value = tableGet.items; | ||
91 | - } | ||
92 | - //编辑 | ||
93 | - if (unref(isUpdate)) { | ||
94 | - } else { | ||
95 | - } | 30 | + setup(_, { emit }) { |
31 | + const dataSource = ref(); | ||
32 | + let DescInfo = ref(); | ||
33 | + const [registerDrawer] = useDrawerInner(async (data) => { | ||
34 | + dataSource.value = data.record; | ||
35 | + const id = data.record.noticeId; | ||
36 | + let getDescInfo = await noticeByIdGetInfo(id); | ||
37 | + DescInfo.value = getDescInfo; | ||
96 | }); | 38 | }); |
97 | - | ||
98 | - const getTitle = computed(() => (!unref(isUpdate) ? '新增通知' : '查看通知')); | ||
99 | - const handleCancel = () => { | ||
100 | - closeDrawer(); | 39 | + const [registerDesc] = useDescription({ |
40 | + bordered: false, | ||
41 | + schema: DescDetailSchema, | ||
42 | + data: dataSource, | ||
43 | + }); | ||
44 | + const handleClose = async () => { | ||
45 | + console.log(dataSource.value); | ||
46 | + await notifyMyGetDetailApi(dataSource.value.id); | ||
47 | + emit('success'); | ||
101 | }; | 48 | }; |
102 | - | ||
103 | return { | 49 | return { |
104 | - tableData, | ||
105 | - columns, | ||
106 | - childData, | ||
107 | - handleCancel, | ||
108 | - getTitle, | 50 | + DescInfo, |
51 | + registerDesc, | ||
109 | registerDrawer, | 52 | registerDrawer, |
53 | + handleClose, | ||
110 | }; | 54 | }; |
111 | }, | 55 | }, |
112 | }); | 56 | }); |
@@ -118,27 +118,10 @@ export const formSchema: FormSchema[] = [ | @@ -118,27 +118,10 @@ export const formSchema: FormSchema[] = [ | ||
118 | }, | 118 | }, |
119 | }, | 119 | }, |
120 | { | 120 | { |
121 | - field: 'organizationId', | ||
122 | - label: '所属组织', | ||
123 | - colProps: { span: 12 }, | ||
124 | - component: 'ApiTreeSelect', | ||
125 | - componentProps: { | ||
126 | - api: async () => { | ||
127 | - const data = await getOrganizationList(); | ||
128 | - copyTransFun(data as any as any[]); | ||
129 | - return data; | ||
130 | - }, | ||
131 | - onChange: (v) => { | ||
132 | - isDeptId.value = v; | ||
133 | - }, | ||
134 | - }, | ||
135 | - ifShow: ({ values }) => isOrg(Reflect.get(values, 'receiverType')), | ||
136 | - }, | ||
137 | - { | ||
138 | field: 'receiverType', | 121 | field: 'receiverType', |
139 | required: true, | 122 | required: true, |
140 | label: '接收者', | 123 | label: '接收者', |
141 | - colProps: { span: 24 }, | 124 | + colProps: { span: 13 }, |
142 | component: 'Select', | 125 | component: 'Select', |
143 | componentProps: { | 126 | componentProps: { |
144 | placeholder: '接收者', | 127 | placeholder: '接收者', |
@@ -159,35 +142,26 @@ export const formSchema: FormSchema[] = [ | @@ -159,35 +142,26 @@ export const formSchema: FormSchema[] = [ | ||
159 | } | 142 | } |
160 | }, | 143 | }, |
161 | }, | 144 | }, |
162 | - // componentProps: { | ||
163 | - // api: findDictItemByCode, | ||
164 | - // params: { | ||
165 | - // dictCode: 'receiver_type', | ||
166 | - // }, | ||
167 | - // labelField: 'itemText', | ||
168 | - // valueField: 'itemValue', | ||
169 | - // onChange: (v) => { | ||
170 | - // switch (v) { | ||
171 | - // case '0': | ||
172 | - // selectWhere.value = v; | ||
173 | - // break; | ||
174 | - // case '1': | ||
175 | - // selectWhere.value = v; | ||
176 | - // break; | ||
177 | - // case '2': | ||
178 | - // selectWhere.value = v; | ||
179 | - // break; | ||
180 | - // case '3': | ||
181 | - // selectWhere.value = v; | ||
182 | - // break; | ||
183 | - // default: | ||
184 | - // selectWhere.value = v; | ||
185 | - // } | ||
186 | - // }, | ||
187 | - // }, | ||
188 | }, | 145 | }, |
189 | { | 146 | { |
190 | - field: '', | 147 | + field: 'organizationId', |
148 | + label: '所属组织', | ||
149 | + colProps: { span: 13 }, | ||
150 | + component: 'ApiTreeSelect', | ||
151 | + componentProps: { | ||
152 | + api: async () => { | ||
153 | + const data = await getOrganizationList(); | ||
154 | + copyTransFun(data as any as any[]); | ||
155 | + return data; | ||
156 | + }, | ||
157 | + onChange: (v) => { | ||
158 | + isDeptId.value = v; | ||
159 | + }, | ||
160 | + }, | ||
161 | + ifShow: ({ values }) => isOrg(Reflect.get(values, 'receiverType')), | ||
162 | + }, | ||
163 | + { | ||
164 | + field: 'abc', | ||
191 | component: 'Input', | 165 | component: 'Input', |
192 | label: '', | 166 | label: '', |
193 | colProps: { | 167 | colProps: { |
@@ -224,17 +198,18 @@ export const searchFormSchema: FormSchema[] = [ | @@ -224,17 +198,18 @@ export const searchFormSchema: FormSchema[] = [ | ||
224 | export const detailColumns: BasicColumn[] = [ | 198 | export const detailColumns: BasicColumn[] = [ |
225 | { | 199 | { |
226 | title: '接收者', | 200 | title: '接收者', |
227 | - dataIndex: 'title2', | 201 | + dataIndex: 'user.realName', |
228 | width: 200, | 202 | width: 200, |
229 | }, | 203 | }, |
230 | { | 204 | { |
231 | title: '阅读状态', | 205 | title: '阅读状态', |
232 | - dataIndex: 'title3', | 206 | + dataIndex: 'readStatus', |
233 | width: 200, | 207 | width: 200, |
208 | + slots: { customRender: 'readStatus' }, | ||
234 | }, | 209 | }, |
235 | { | 210 | { |
236 | title: '阅读时间', | 211 | title: '阅读时间', |
237 | - dataIndex: 'title1', | 212 | + dataIndex: 'readDate', |
238 | width: 200, | 213 | width: 200, |
239 | }, | 214 | }, |
240 | ]; | 215 | ]; |
@@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
17 | icon: 'clarity:note-edit-line', | 17 | icon: 'clarity:note-edit-line', |
18 | onClick: handleView.bind(null, record), | 18 | onClick: handleView.bind(null, record), |
19 | ifShow: (_action) => { | 19 | ifShow: (_action) => { |
20 | - return record.status == '已发布'; | 20 | + return record.status === '已发布'; |
21 | }, | 21 | }, |
22 | }, | 22 | }, |
23 | { | 23 | { |
@@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
25 | icon: 'clarity:note-edit-line', | 25 | icon: 'clarity:note-edit-line', |
26 | onClick: handleEdit.bind(null, record), | 26 | onClick: handleEdit.bind(null, record), |
27 | ifShow: (_action) => { | 27 | ifShow: (_action) => { |
28 | - return record.status == '草稿'; | 28 | + return record.status === '草稿'; |
29 | }, | 29 | }, |
30 | }, | 30 | }, |
31 | { | 31 | { |
@@ -46,7 +46,7 @@ | @@ -46,7 +46,7 @@ | ||
46 | </div> | 46 | </div> |
47 | </template> | 47 | </template> |
48 | <script lang="ts"> | 48 | <script lang="ts"> |
49 | - import { defineComponent, reactive, ref } from 'vue'; | 49 | + import { defineComponent, reactive } from 'vue'; |
50 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 50 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
51 | import { useDrawer } from '/@/components/Drawer'; | 51 | import { useDrawer } from '/@/components/Drawer'; |
52 | import NotifyManagerDrawer from './useDrawer.vue'; | 52 | import NotifyManagerDrawer from './useDrawer.vue'; |
@@ -59,13 +59,12 @@ | @@ -59,13 +59,12 @@ | ||
59 | name: 'Index', | 59 | name: 'Index', |
60 | components: { BasicTable, NotifyManagerDrawer, TableAction, tableViewChild }, | 60 | components: { BasicTable, NotifyManagerDrawer, TableAction, tableViewChild }, |
61 | setup() { | 61 | setup() { |
62 | - let selectedRowKeys: string[] = reactive([]); | 62 | + let selectedRowKeys = reactive<string[]>([]); |
63 | 63 | ||
64 | - const [registerAdd, { openDrawer: openDrawerAdd }] = useDrawer(); | ||
65 | const [registerDrawer, { openDrawer }] = useDrawer(); | 64 | const [registerDrawer, { openDrawer }] = useDrawer(); |
65 | + const [registerAdd, { openDrawer: openDrawerAdd }] = useDrawer(); | ||
66 | const { createMessage } = useMessage(); | 66 | const { createMessage } = useMessage(); |
67 | const [registerTable, { reload, getSelectRowKeys }] = useTable({ | 67 | const [registerTable, { reload, getSelectRowKeys }] = useTable({ |
68 | - title: '', | ||
69 | clickToRowSelect: false, | 68 | clickToRowSelect: false, |
70 | api: notifyGetTableApi, | 69 | api: notifyGetTableApi, |
71 | columns, | 70 | columns, |
@@ -83,7 +82,7 @@ | @@ -83,7 +82,7 @@ | ||
83 | title: '操作', | 82 | title: '操作', |
84 | dataIndex: 'action', | 83 | dataIndex: 'action', |
85 | slots: { customRender: 'action' }, | 84 | slots: { customRender: 'action' }, |
86 | - fixed: undefined, | 85 | + fixed: 'right', |
87 | }, | 86 | }, |
88 | }); | 87 | }); |
89 | 88 | ||
@@ -105,7 +104,6 @@ | @@ -105,7 +104,6 @@ | ||
105 | const handleView = (record: Recordable) => { | 104 | const handleView = (record: Recordable) => { |
106 | openDrawer(true, { | 105 | openDrawer(true, { |
107 | record, | 106 | record, |
108 | - isUpdate: true, | ||
109 | }); | 107 | }); |
110 | }; | 108 | }; |
111 | function handleEdit(record: Recordable) { | 109 | function handleEdit(record: Recordable) { |
@@ -32,8 +32,6 @@ | @@ -32,8 +32,6 @@ | ||
32 | notifyAddLeaseApi, | 32 | notifyAddLeaseApi, |
33 | } from '/@/api/stationnotification/stationnotifyApi'; | 33 | } from '/@/api/stationnotification/stationnotifyApi'; |
34 | import { useMessage } from '/@/hooks/web/useMessage'; | 34 | import { useMessage } from '/@/hooks/web/useMessage'; |
35 | - // import { getOrganizationList } from '/@/api/system/system'; | ||
36 | - | ||
37 | export default defineComponent({ | 35 | export default defineComponent({ |
38 | name: 'ConfigDrawer', | 36 | name: 'ConfigDrawer', |
39 | components: { BasicDrawer, BasicForm, Button }, | 37 | components: { BasicDrawer, BasicForm, Button }, |
@@ -60,7 +58,6 @@ | @@ -60,7 +58,6 @@ | ||
60 | isUpdate.value = !!data?.isUpdate; | 58 | isUpdate.value = !!data?.isUpdate; |
61 | //编辑 | 59 | //编辑 |
62 | if (unref(isUpdate)) { | 60 | if (unref(isUpdate)) { |
63 | - console.log(data.record); | ||
64 | getId.value = data.record.id; | 61 | getId.value = data.record.id; |
65 | await setFieldsValue({ | 62 | await setFieldsValue({ |
66 | ...data.record, | 63 | ...data.record, |
@@ -115,7 +112,7 @@ | @@ -115,7 +112,7 @@ | ||
115 | getAllEditData.pointId = pointArray.value; | 112 | getAllEditData.pointId = pointArray.value; |
116 | Object.assign(postAllEditData, getAllEditData); | 113 | Object.assign(postAllEditData, getAllEditData); |
117 | await notifyAddLeaseApi(postAllEditData); | 114 | await notifyAddLeaseApi(postAllEditData); |
118 | - createMessage.success('编辑成功'); | 115 | + createMessage.success('新增成功'); |
119 | closeDrawer(); | 116 | closeDrawer(); |
120 | emit('success'); | 117 | emit('success'); |
121 | } | 118 | } |
@@ -156,7 +153,7 @@ | @@ -156,7 +153,7 @@ | ||
156 | } | 153 | } |
157 | getAllEditData.pointId = pointArray.value; | 154 | getAllEditData.pointId = pointArray.value; |
158 | Object.assign(postAllEditData, getAllEditData); | 155 | Object.assign(postAllEditData, getAllEditData); |
159 | - await notifyAddLeaseApi(postAllEditData); | 156 | + await notifyAddDraftApi(postAllEditData); |
160 | createMessage.success('编辑成功'); | 157 | createMessage.success('编辑成功'); |
161 | closeDrawer(); | 158 | closeDrawer(); |
162 | emit('success'); | 159 | emit('success'); |
@@ -10,8 +10,13 @@ | @@ -10,8 +10,13 @@ | ||
10 | > | 10 | > |
11 | <div v-html="descInfo?.content"></div> | 11 | <div v-html="descInfo?.content"></div> |
12 | <Description @register="registerDesc" class="mt-4" /> | 12 | <Description @register="registerDesc" class="mt-4" /> |
13 | - | ||
14 | - <BasicTable @register="registerTable" /> | 13 | + <BasicTable @register="registerTable" class="mt-4"> |
14 | + <template #readStatus="{ record }"> | ||
15 | + <Tag :color="record.readStatus === '0' ? 'orange' : 'green'"> | ||
16 | + {{ record.readStatus === '0' ? '未读' : '已读' }} | ||
17 | + </Tag> | ||
18 | + </template> | ||
19 | + </BasicTable> | ||
15 | </BasicDrawer> | 20 | </BasicDrawer> |
16 | </div> | 21 | </div> |
17 | </template> | 22 | </template> |
@@ -25,6 +30,7 @@ | @@ -25,6 +30,7 @@ | ||
25 | } from '/@/api/stationnotification/stationnotifyApi'; | 30 | } from '/@/api/stationnotification/stationnotifyApi'; |
26 | import { useTable, BasicTable } from '/@/components/Table'; | 31 | import { useTable, BasicTable } from '/@/components/Table'; |
27 | import { detailColumns } from './config.d'; | 32 | import { detailColumns } from './config.d'; |
33 | + import { Tag } from 'ant-design-vue'; | ||
28 | const schema: DescItem[] = [ | 34 | const schema: DescItem[] = [ |
29 | { | 35 | { |
30 | field: 'senderName', | 36 | field: 'senderName', |
@@ -50,38 +56,40 @@ | @@ -50,38 +56,40 @@ | ||
50 | ]; | 56 | ]; |
51 | export default defineComponent({ | 57 | export default defineComponent({ |
52 | name: 'ConfigDrawer', | 58 | name: 'ConfigDrawer', |
53 | - components: { BasicDrawer, Description, BasicTable }, | 59 | + components: { BasicDrawer, Description, BasicTable, Tag }, |
54 | emits: ['success', 'register'], | 60 | emits: ['success', 'register'], |
55 | setup() { | 61 | setup() { |
56 | let descInfo = ref(); | 62 | let descInfo = ref(); |
57 | - const noticeId = ref(''); | 63 | + let noticeId; |
58 | const [registerDrawer] = useDrawerInner(async (data) => { | 64 | const [registerDrawer] = useDrawerInner(async (data) => { |
59 | - if (data.isUpdate) { | ||
60 | - let getDescInfo = await noticeByIdGetInfo(data.record.id); | ||
61 | - noticeId.value = data.record.id; | ||
62 | - descInfo.value = getDescInfo; | ||
63 | - console.log(noticeId); | ||
64 | - } | 65 | + let getDescInfo = await noticeByIdGetInfo(data.record.id); |
66 | + noticeId = data.record.id; | ||
67 | + descInfo.value = getDescInfo; | ||
68 | + reload(); | ||
69 | + }); | ||
70 | + const [registerTable, { reload }] = useTable({ | ||
71 | + api: getNotifyDetailPage, | ||
72 | + columns: detailColumns, | ||
73 | + bordered: true, | ||
74 | + showTableSetting: false, | ||
75 | + showIndexColumn: false, | ||
76 | + immediate: false, | ||
77 | + beforeFetch: getNoticeId, | ||
65 | }); | 78 | }); |
79 | + function getNoticeId(data) { | ||
80 | + Reflect.set(data, 'noticeId', noticeId); | ||
81 | + } | ||
66 | 82 | ||
67 | const [registerDesc] = useDescription({ | 83 | const [registerDesc] = useDescription({ |
68 | bordered: true, | 84 | bordered: true, |
69 | data: descInfo, | 85 | data: descInfo, |
70 | - schema: schema, | ||
71 | - }); | ||
72 | - const [registerTable] = useTable({ | ||
73 | - api: getNotifyDetailPage(noticeId.value), | ||
74 | - columns: detailColumns, | ||
75 | - showTableSetting: false, | ||
76 | - bordered: true, | ||
77 | - showIndexColumn: false, | 86 | + schema, |
78 | }); | 87 | }); |
79 | return { | 88 | return { |
80 | descInfo, | 89 | descInfo, |
81 | registerDesc, | 90 | registerDesc, |
82 | registerTable, | 91 | registerTable, |
83 | registerDrawer, | 92 | registerDrawer, |
84 | - noticeId, | ||
85 | }; | 93 | }; |
86 | }, | 94 | }, |
87 | }); | 95 | }); |
@@ -73,7 +73,7 @@ | @@ -73,7 +73,7 @@ | ||
73 | title: '操作', | 73 | title: '操作', |
74 | dataIndex: 'action', | 74 | dataIndex: 'action', |
75 | slots: { customRender: 'action' }, | 75 | slots: { customRender: 'action' }, |
76 | - fixed: undefined, | 76 | + fixed: 'right', |
77 | }, | 77 | }, |
78 | beforeFetch: getDictId, | 78 | beforeFetch: getDictId, |
79 | immediate: true, | 79 | immediate: true, |
@@ -94,7 +94,6 @@ | @@ -94,7 +94,6 @@ | ||
94 | } | 94 | } |
95 | 95 | ||
96 | async function handleDelete(record: Recordable) { | 96 | async function handleDelete(record: Recordable) { |
97 | - // console.log(record); | ||
98 | try { | 97 | try { |
99 | let ids = [record.id]; | 98 | let ids = [record.id]; |
100 | await delOrganization(ids); | 99 | await delOrganization(ids); |