Showing
12 changed files
with
94 additions
and
131 deletions
| ... | ... | @@ -21,10 +21,10 @@ enum NotifyManagerApi { | 
| 21 | 21 | NOTICE_GET_DEPT_URL = '/organization/me/organizations', | 
| 22 | 22 | } | 
| 23 | 23 | |
| 24 | -// /** | |
| 25 | -// * 获取详情 | |
| 26 | -// * @param | |
| 27 | -// */ | |
| 24 | +/** | |
| 25 | + * 获取详情 | |
| 26 | + * @param | |
| 27 | + */ | |
| 28 | 28 | export const noticeByIdGetInfo = (id: string) => { | 
| 29 | 29 | return defHttp.get({ | 
| 30 | 30 | url: `${NotifyManagerApi.NOTICE_GET_DETAIL_URL}/${id}`, | 
| ... | ... | @@ -126,3 +126,13 @@ export const notifyOrganizationGetApi = () => { | 
| 126 | 126 | url: NotifyManagerApi.NOTICE_GET_DEPT_URL, | 
| 127 | 127 | }); | 
| 128 | 128 | }; | 
| 129 | + | |
| 130 | +export const getNotifyDetailPage = (id: string) => { | |
| 131 | + console.log(id, '-----------------'); | |
| 132 | + return (params) => { | |
| 133 | + return defHttp.get({ | |
| 134 | + url: `${NotifyManagerApi.NOTICE_GET_PAGE_URL}/${id}`, | |
| 135 | + params, | |
| 136 | + }); | |
| 137 | + }; | |
| 138 | +}; | ... | ... | 
src/assets/images/wz.png
0 → 100644
1.37 KB
| ... | ... | @@ -172,14 +172,7 @@ | 
| 172 | 172 | if (!wrapEl) return; | 
| 173 | 173 | let preMarker = null; | 
| 174 | 174 | const map = new BMap.Map(wrapEl); | 
| 175 | - let myIcon = new BMap.Icon( | |
| 176 | - 'http://api.map.baidu.com/img/markers.png', | |
| 177 | - new BMap.Size(40, 25), | |
| 178 | - { | |
| 179 | - offset: new BMap.Size(0, 0), // 指定定位位置 | |
| 180 | - imageOffset: new BMap.Size(20, -260), // 设置图片偏移 | |
| 181 | - } | |
| 182 | - ); | |
| 175 | + let myIcon = new BMap.Icon('/src/assets/images/wz.png', new BMap.Size(20, 30)); | |
| 183 | 176 | const point = new BMap.Point(Number(longitude), Number(latitude)); | 
| 184 | 177 | let marker = new BMap.Marker(point, { icon: myIcon }); | 
| 185 | 178 | if (marker) { | ... | ... | 
| ... | ... | @@ -56,14 +56,8 @@ | 
| 56 | 56 | const BMap = (window as any).BMap; | 
| 57 | 57 | if (!wrapEl) return; | 
| 58 | 58 | const map = new BMap.Map(wrapEl); | 
| 59 | - let myIcon = new BMap.Icon( | |
| 60 | - 'http://api.map.baidu.com/img/markers.png', | |
| 61 | - new BMap.Size(40, 25), | |
| 62 | - { | |
| 63 | - offset: new BMap.Size(0, 0), // 指定定位位置 | |
| 64 | - imageOffset: new BMap.Size(20, -260), // 设置图片偏移 | |
| 65 | - } | |
| 66 | - ); | |
| 59 | + let myIcon = new BMap.Icon('/src/assets/images/wz.png', new BMap.Size(20, 30)); | |
| 60 | + | |
| 67 | 61 | const point = new BMap.Point(Number(longitude), Number(latitude)); | 
| 68 | 62 | var content = `我在 ${address}`; | 
| 69 | 63 | var label = new BMap.Label(content, { | ... | ... | 
| 1 | 1 | <template> | 
| 2 | 2 | <div> | 
| 3 | - <PageWrapper dense contentFullHeight fixedHeight contentClass="flex"> | |
| 3 | + <PageWrapper dense contentFullHeight contentClass="flex"> | |
| 4 | 4 | <OrganizationIdTree class="w-1/6 xl:w-1/5" @select="handleSelect" /> | 
| 5 | 5 | <BasicTable @register="registerTable" class="w-5/6 xl:w-4/5"> | 
| 6 | 6 | <template #toolbar> | ... | ... | 
| ... | ... | @@ -126,13 +126,6 @@ export const formSchema: FormSchema[] = [ | 
| 126 | 126 | api: async () => { | 
| 127 | 127 | const data = await getOrganizationList(); | 
| 128 | 128 | copyTransFun(data as any as any[]); | 
| 129 | - // const filterData = data.map((m) => { | |
| 130 | - // return { | |
| 131 | - // label: m.label, | |
| 132 | - // value: m.value, | |
| 133 | - // }; | |
| 134 | - // }); | |
| 135 | - // return filterData; | |
| 136 | 129 | return data; | 
| 137 | 130 | }, | 
| 138 | 131 | onChange: (v) => { | 
| ... | ... | @@ -166,40 +159,11 @@ export const formSchema: FormSchema[] = [ | 
| 166 | 159 | } | 
| 167 | 160 | }, | 
| 168 | 161 | }, | 
| 169 | - // componentProps: { | |
| 170 | - // api: findDictItemByCode, | |
| 171 | - // params: { | |
| 172 | - // dictCode: 'receiver_type', | |
| 173 | - // }, | |
| 174 | - // labelField: 'itemText', | |
| 175 | - // valueField: 'itemValue', | |
| 176 | - // onChange: (v) => { | |
| 177 | - // switch (v) { | |
| 178 | - // case '0': | |
| 179 | - // selectWhere.value = v; | |
| 180 | - // break; | |
| 181 | - // case '1': | |
| 182 | - // selectWhere.value = v; | |
| 183 | - // break; | |
| 184 | - // case '2': | |
| 185 | - // selectWhere.value = v; | |
| 186 | - // break; | |
| 187 | - // case '3': | |
| 188 | - // selectWhere.value = v; | |
| 189 | - // break; | |
| 190 | - // default: | |
| 191 | - // selectWhere.value = v; | |
| 192 | - // } | |
| 193 | - // }, | |
| 194 | - // }, | |
| 195 | 162 | }, | 
| 196 | 163 | { | 
| 197 | - field: '', | |
| 164 | + field: 'add', | |
| 198 | 165 | component: 'Input', | 
| 199 | 166 | label: '', | 
| 200 | - colProps: { | |
| 201 | - span: 12, | |
| 202 | - }, | |
| 203 | 167 | slot: 'add', | 
| 204 | 168 | }, | 
| 205 | 169 | ]; | 
| ... | ... | @@ -228,3 +192,21 @@ export const searchFormSchema: FormSchema[] = [ | 
| 228 | 192 | }, | 
| 229 | 193 | }, | 
| 230 | 194 | ]; | 
| 195 | + | |
| 196 | +export const detailColumns: BasicColumn[] = [ | |
| 197 | + { | |
| 198 | + title: '接收者', | |
| 199 | + dataIndex: 'title2', | |
| 200 | + width: 200, | |
| 201 | + }, | |
| 202 | + { | |
| 203 | + title: '阅读状态', | |
| 204 | + dataIndex: 'title3', | |
| 205 | + width: 200, | |
| 206 | + }, | |
| 207 | + { | |
| 208 | + title: '阅读时间', | |
| 209 | + dataIndex: 'title1', | |
| 210 | + width: 200, | |
| 211 | + }, | |
| 212 | +]; | ... | ... | 
| ... | ... | @@ -7,7 +7,7 @@ | 
| 7 | 7 | > | 
| 8 | 8 | <template #toolbar> | 
| 9 | 9 | <a-button type="primary" @click="handleAdd"> 新增 </a-button> | 
| 10 | - <a-button type="error" @click="handleToolbarDel"> 删除 </a-button> | |
| 10 | + <a-button color="error" @click="handleToolbarDel"> 删除 </a-button> | |
| 11 | 11 | </template> | 
| 12 | 12 | <template #action="{ record }"> | 
| 13 | 13 | <TableAction | 
| ... | ... | @@ -41,13 +41,8 @@ | 
| 41 | 41 | /> | 
| 42 | 42 | </template> | 
| 43 | 43 | </BasicTable> | 
| 44 | - <NotifyManagerDrawer | |
| 45 | - v-if="isJudgeStatus" | |
| 46 | - :getChildrenData="echoEditData" | |
| 47 | - @register="registerDrawer" | |
| 48 | - @success="handleSuccess" | |
| 49 | - /> | |
| 50 | - <tableViewChild v-if="!isJudgeStatus" @register="registerDrawer" /> | |
| 44 | + <NotifyManagerDrawer @register="registerAdd" @success="handleSuccess" /> | |
| 45 | + <tableViewChild @register="registerDrawer" /> | |
| 51 | 46 | </div> | 
| 52 | 47 | </template> | 
| 53 | 48 | <script lang="ts"> | 
| ... | ... | @@ -64,9 +59,9 @@ | 
| 64 | 59 | name: 'Index', | 
| 65 | 60 | components: { BasicTable, NotifyManagerDrawer, TableAction, tableViewChild }, | 
| 66 | 61 | setup() { | 
| 67 | - let isJudgeStatus = ref(true); | |
| 68 | 62 | let selectedRowKeys: string[] = reactive([]); | 
| 69 | - let echoEditData = reactive({}); | |
| 63 | + | |
| 64 | + const [registerAdd, { openDrawer: openDrawerAdd }] = useDrawer(); | |
| 70 | 65 | const [registerDrawer, { openDrawer }] = useDrawer(); | 
| 71 | 66 | const { createMessage } = useMessage(); | 
| 72 | 67 | const [registerTable, { reload, getSelectRowKeys }] = useTable({ | 
| ... | ... | @@ -93,10 +88,9 @@ | 
| 93 | 88 | }); | 
| 94 | 89 | |
| 95 | 90 | function handleAdd() { | 
| 96 | - openDrawer(true, { | |
| 91 | + openDrawerAdd(true, { | |
| 97 | 92 | isUpdate: false, | 
| 98 | 93 | }); | 
| 99 | - isJudgeStatus.value = true; | |
| 100 | 94 | } | 
| 101 | 95 | |
| 102 | 96 | const useSelectionChange = () => { | 
| ... | ... | @@ -113,14 +107,12 @@ | 
| 113 | 107 | record, | 
| 114 | 108 | isUpdate: true, | 
| 115 | 109 | }); | 
| 116 | - isJudgeStatus.value = false; | |
| 117 | 110 | }; | 
| 118 | 111 | function handleEdit(record: Recordable) { | 
| 119 | - openDrawer(true, { | |
| 112 | + openDrawerAdd(true, { | |
| 120 | 113 | record, | 
| 121 | 114 | isUpdate: true, | 
| 122 | 115 | }); | 
| 123 | - isJudgeStatus.value = true; | |
| 124 | 116 | } | 
| 125 | 117 | async function handleDelete(record: Recordable) { | 
| 126 | 118 | let ids = [record.id]; | 
| ... | ... | @@ -132,10 +124,9 @@ | 
| 132 | 124 | reload(); | 
| 133 | 125 | } | 
| 134 | 126 | return { | 
| 135 | - isJudgeStatus, | |
| 136 | 127 | handleView, | 
| 128 | + registerAdd, | |
| 137 | 129 | useSelectionChange, | 
| 138 | - echoEditData, | |
| 139 | 130 | registerTable, | 
| 140 | 131 | registerDrawer, | 
| 141 | 132 | handleAdd, | ... | ... | 
| ... | ... | @@ -60,11 +60,12 @@ | 
| 60 | 60 | isUpdate.value = !!data?.isUpdate; | 
| 61 | 61 | //编辑 | 
| 62 | 62 | if (unref(isUpdate)) { | 
| 63 | + console.log(data.record); | |
| 63 | 64 | getId.value = data.record.id; | 
| 64 | 65 | await setFieldsValue({ | 
| 65 | 66 | ...data.record, | 
| 67 | + receiverType: data.record.receiverType === '全部' ? '0' : '1', | |
| 66 | 68 | }); | 
| 67 | - } else { | |
| 68 | 69 | } | 
| 69 | 70 | }); | 
| 70 | 71 | const getTitle = computed(() => (!unref(isUpdate) ? '新增通知' : '编辑通知')); | ... | ... | 
| ... | ... | @@ -4,35 +4,29 @@ | 
| 4 | 4 | v-bind="$attrs" | 
| 5 | 5 | @register="registerDrawer" | 
| 6 | 6 | :showFooter="false" | 
| 7 | - :title="getTitle" | |
| 8 | - width="800px" | |
| 7 | + :title="descInfo?.title" | |
| 8 | + destroyOnClose | |
| 9 | + width="70%" | |
| 9 | 10 | > | 
| 10 | - <PageWrapper title="站内通知详情"> | |
| 11 | - <Description @register="register1" class="mt-4" /> | |
| 12 | - </PageWrapper> | |
| 11 | + <div v-html="descInfo?.content"></div> | |
| 12 | + <Description @register="registerDesc" class="mt-4" /> | |
| 13 | + | |
| 14 | + <BasicTable @register="registerTable" /> | |
| 13 | 15 | </BasicDrawer> | 
| 14 | 16 | </div> | 
| 15 | 17 | </template> | 
| 16 | 18 | <script lang="ts"> | 
| 17 | - import { defineComponent, ref, computed, unref } from 'vue'; | |
| 19 | + import { defineComponent, ref } from 'vue'; | |
| 18 | 20 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; | 
| 19 | 21 | import { Description, DescItem, useDescription } from '/@/components/Description/index'; | 
| 20 | - import { PageWrapper } from '/@/components/Page'; | |
| 21 | - import { noticeByIdGetInfo } from '/@/api/stationnotification/stationnotifyApi'; | |
| 22 | - | |
| 22 | + import { | |
| 23 | + getNotifyDetailPage, | |
| 24 | + noticeByIdGetInfo, | |
| 25 | + } from '/@/api/stationnotification/stationnotifyApi'; | |
| 26 | + import { useTable, BasicTable } from '/@/components/Table'; | |
| 27 | + import { detailColumns } from './config.d'; | |
| 23 | 28 | const schema: DescItem[] = [ | 
| 24 | 29 | { | 
| 25 | - field: 'title', | |
| 26 | - label: '标题', | |
| 27 | - }, | |
| 28 | - { | |
| 29 | - field: 'content', | |
| 30 | - label: '内容', | |
| 31 | - render: (_, data) => { | |
| 32 | - return !data.content ? '' : data.content.slice(3, data.content.length - 4); | |
| 33 | - }, | |
| 34 | - }, | |
| 35 | - { | |
| 36 | 30 | field: 'senderName', | 
| 37 | 31 | label: '发送者', | 
| 38 | 32 | }, | 
| ... | ... | @@ -42,7 +36,7 @@ | 
| 42 | 36 | }, | 
| 43 | 37 | { | 
| 44 | 38 | field: 'type', | 
| 45 | - label: '类型', | |
| 39 | + label: '类型:', | |
| 46 | 40 | render: (_, data) => { | 
| 47 | 41 | return data.type === 'NOTICE' | 
| 48 | 42 | ? '公告' | 
| ... | ... | @@ -53,48 +47,41 @@ | 
| 53 | 47 | : ''; | 
| 54 | 48 | }, | 
| 55 | 49 | }, | 
| 56 | - { | |
| 57 | - field: 'status', | |
| 58 | - label: '状态', | |
| 59 | - }, | |
| 60 | - { | |
| 61 | - field: 'updateTime', | |
| 62 | - label: '更新时间', | |
| 63 | - }, | |
| 64 | - { | |
| 65 | - field: 'receiverType', | |
| 66 | - label: '接收类型', | |
| 67 | - }, | |
| 68 | - { | |
| 69 | - field: 'createTime', | |
| 70 | - label: '创建时间', | |
| 71 | - }, | |
| 72 | 50 | ]; | 
| 73 | 51 | export default defineComponent({ | 
| 74 | 52 | name: 'ConfigDrawer', | 
| 75 | - components: { BasicDrawer, Description, PageWrapper }, | |
| 53 | + components: { BasicDrawer, Description, BasicTable }, | |
| 76 | 54 | emits: ['success', 'register'], | 
| 77 | 55 | setup() { | 
| 78 | - let descInfo = ref(null); | |
| 79 | - const isUpdate = ref(true); | |
| 80 | - | |
| 81 | - const [registerDrawer, { setDrawerProps }] = useDrawerInner(async (data) => { | |
| 82 | - setDrawerProps({ confirmLoading: false }); | |
| 83 | - isUpdate.value = !!data?.isUpdate; | |
| 84 | - let getDescInfo = await noticeByIdGetInfo(data.record.id); | |
| 85 | - descInfo.value = getDescInfo; | |
| 56 | + let descInfo = ref(); | |
| 57 | + const noticeId = ref(''); | |
| 58 | + 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 | + } | |
| 86 | 65 | }); | 
| 87 | - const getTitle = computed(() => (!unref(isUpdate) ? '查看通知' : '查看通知')); | |
| 88 | - const [register1] = useDescription({ | |
| 89 | - title: '详情', | |
| 90 | - bordered: false, | |
| 66 | + | |
| 67 | + const [registerDesc] = useDescription({ | |
| 68 | + bordered: true, | |
| 91 | 69 | data: descInfo, | 
| 92 | 70 | schema: schema, | 
| 93 | 71 | }); | 
| 72 | + const [registerTable] = useTable({ | |
| 73 | + api: getNotifyDetailPage(noticeId.value), | |
| 74 | + columns: detailColumns, | |
| 75 | + showTableSetting: false, | |
| 76 | + bordered: true, | |
| 77 | + showIndexColumn: false, | |
| 78 | + }); | |
| 94 | 79 | return { | 
| 95 | - register1, | |
| 96 | - getTitle, | |
| 80 | + descInfo, | |
| 81 | + registerDesc, | |
| 82 | + registerTable, | |
| 97 | 83 | registerDrawer, | 
| 84 | + noticeId, | |
| 98 | 85 | }; | 
| 99 | 86 | }, | 
| 100 | 87 | }); | ... | ... | 
| ... | ... | @@ -10,10 +10,14 @@ | 
| 10 | 10 | <TableAction | 
| 11 | 11 | :actions="[ | 
| 12 | 12 | { | 
| 13 | + label: '编辑', | |
| 14 | + tooltip: '编辑', | |
| 13 | 15 | icon: 'clarity:note-edit-line', | 
| 14 | 16 | onClick: handleEdit.bind(null, record), | 
| 15 | 17 | }, | 
| 16 | 18 | { | 
| 19 | + label: '删除', | |
| 20 | + tooltip: '删除', | |
| 17 | 21 | icon: 'ant-design:delete-outlined', | 
| 18 | 22 | color: 'error', | 
| 19 | 23 | popConfirm: { | 
| ... | ... | @@ -76,11 +80,11 @@ | 
| 76 | 80 | showIndexColumn: false, | 
| 77 | 81 | canResize: false, | 
| 78 | 82 | actionColumn: { | 
| 79 | - width: 80, | |
| 83 | + width: 120, | |
| 80 | 84 | title: t('routes.common.system.pageSystemTitleOperation'), //操作 | 
| 81 | 85 | dataIndex: 'action', | 
| 82 | 86 | slots: { customRender: 'action' }, | 
| 83 | - fixed: undefined, | |
| 87 | + fixed: 'right', | |
| 84 | 88 | }, | 
| 85 | 89 | }); | 
| 86 | 90 | ... | ... |