Commit e3467ebcf00fdba5f6b1dcadf17eef7a352266ba
Merge remote-tracking branch 'origin/sqy_dev'
# Conflicts: # src/views/stationnotification/notificationmanager/config.d.ts
Showing
12 changed files
with
92 additions
and
119 deletions
| @@ -21,10 +21,10 @@ enum NotifyManagerApi { | @@ -21,10 +21,10 @@ enum NotifyManagerApi { | ||
| 21 | NOTICE_GET_DEPT_URL = '/organization/me/organizations', | 21 | NOTICE_GET_DEPT_URL = '/organization/me/organizations', |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | -// /** | ||
| 25 | -// * 获取详情 | ||
| 26 | -// * @param | ||
| 27 | -// */ | 24 | +/** |
| 25 | + * 获取详情 | ||
| 26 | + * @param | ||
| 27 | + */ | ||
| 28 | export const noticeByIdGetInfo = (id: string) => { | 28 | export const noticeByIdGetInfo = (id: string) => { |
| 29 | return defHttp.get({ | 29 | return defHttp.get({ |
| 30 | url: `${NotifyManagerApi.NOTICE_GET_DETAIL_URL}/${id}`, | 30 | url: `${NotifyManagerApi.NOTICE_GET_DETAIL_URL}/${id}`, |
| @@ -128,3 +128,13 @@ export const notifyOrganizationGetApi = () => { | @@ -128,3 +128,13 @@ export const notifyOrganizationGetApi = () => { | ||
| 128 | url: NotifyManagerApi.NOTICE_GET_DEPT_URL, | 128 | url: NotifyManagerApi.NOTICE_GET_DEPT_URL, |
| 129 | }); | 129 | }); |
| 130 | }; | 130 | }; |
| 131 | + | ||
| 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 | + }; | ||
| 140 | +}; |
src/assets/images/wz.png
0 → 100644
1.37 KB
| @@ -172,14 +172,7 @@ | @@ -172,14 +172,7 @@ | ||
| 172 | if (!wrapEl) return; | 172 | if (!wrapEl) return; |
| 173 | let preMarker = null; | 173 | let preMarker = null; |
| 174 | const map = new BMap.Map(wrapEl); | 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 | const point = new BMap.Point(Number(longitude), Number(latitude)); | 176 | const point = new BMap.Point(Number(longitude), Number(latitude)); |
| 184 | let marker = new BMap.Marker(point, { icon: myIcon }); | 177 | let marker = new BMap.Marker(point, { icon: myIcon }); |
| 185 | if (marker) { | 178 | if (marker) { |
| @@ -56,14 +56,8 @@ | @@ -56,14 +56,8 @@ | ||
| 56 | const BMap = (window as any).BMap; | 56 | const BMap = (window as any).BMap; |
| 57 | if (!wrapEl) return; | 57 | if (!wrapEl) return; |
| 58 | const map = new BMap.Map(wrapEl); | 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 | const point = new BMap.Point(Number(longitude), Number(latitude)); | 61 | const point = new BMap.Point(Number(longitude), Number(latitude)); |
| 68 | var content = `我在 ${address}`; | 62 | var content = `我在 ${address}`; |
| 69 | var label = new BMap.Label(content, { | 63 | var label = new BMap.Label(content, { |
| 1 | <template> | 1 | <template> |
| 2 | <div> | 2 | <div> |
| 3 | - <PageWrapper dense contentFullHeight fixedHeight contentClass="flex"> | 3 | + <PageWrapper dense contentFullHeight contentClass="flex"> |
| 4 | <OrganizationIdTree class="w-1/6 xl:w-1/5" @select="handleSelect" /> | 4 | <OrganizationIdTree class="w-1/6 xl:w-1/5" @select="handleSelect" /> |
| 5 | <BasicTable @register="registerTable" class="w-5/6 xl:w-4/5"> | 5 | <BasicTable @register="registerTable" class="w-5/6 xl:w-4/5"> |
| 6 | <template #toolbar> | 6 | <template #toolbar> |
| @@ -117,7 +117,23 @@ export const formSchema: FormSchema[] = [ | @@ -117,7 +117,23 @@ export const formSchema: FormSchema[] = [ | ||
| 117 | }); | 117 | }); |
| 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 | + }, | ||
| 121 | { | 137 | { |
| 122 | field: 'receiverType', | 138 | field: 'receiverType', |
| 123 | required: true, | 139 | required: true, |
| @@ -171,30 +187,6 @@ export const formSchema: FormSchema[] = [ | @@ -171,30 +187,6 @@ export const formSchema: FormSchema[] = [ | ||
| 171 | // }, | 187 | // }, |
| 172 | }, | 188 | }, |
| 173 | { | 189 | { |
| 174 | - field: 'organizationId', | ||
| 175 | - label: '所属组织', | ||
| 176 | - colProps: { span: 12 }, | ||
| 177 | - component: 'ApiTreeSelect', | ||
| 178 | - componentProps: { | ||
| 179 | - api: async () => { | ||
| 180 | - const data = await getOrganizationList(); | ||
| 181 | - copyTransFun(data as any as any[]); | ||
| 182 | - // const filterData = data.map((m) => { | ||
| 183 | - // return { | ||
| 184 | - // label: m.label, | ||
| 185 | - // value: m.value, | ||
| 186 | - // }; | ||
| 187 | - // }); | ||
| 188 | - // return filterData; | ||
| 189 | - return data; | ||
| 190 | - }, | ||
| 191 | - onChange: (v) => { | ||
| 192 | - isDeptId.value = v; | ||
| 193 | - }, | ||
| 194 | - }, | ||
| 195 | - ifShow: ({ values }) => isOrg(Reflect.get(values, 'receiverType')), | ||
| 196 | - }, | ||
| 197 | - { | ||
| 198 | field: '', | 190 | field: '', |
| 199 | component: 'Input', | 191 | component: 'Input', |
| 200 | label: '', | 192 | label: '', |
| @@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
| 7 | > | 7 | > |
| 8 | <template #toolbar> | 8 | <template #toolbar> |
| 9 | <a-button type="primary" @click="handleAdd"> 新增 </a-button> | 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 | </template> | 11 | </template> |
| 12 | <template #action="{ record }"> | 12 | <template #action="{ record }"> |
| 13 | <TableAction | 13 | <TableAction |
| @@ -41,13 +41,8 @@ | @@ -41,13 +41,8 @@ | ||
| 41 | /> | 41 | /> |
| 42 | </template> | 42 | </template> |
| 43 | </BasicTable> | 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 | </div> | 46 | </div> |
| 52 | </template> | 47 | </template> |
| 53 | <script lang="ts"> | 48 | <script lang="ts"> |
| @@ -64,9 +59,9 @@ | @@ -64,9 +59,9 @@ | ||
| 64 | name: 'Index', | 59 | name: 'Index', |
| 65 | components: { BasicTable, NotifyManagerDrawer, TableAction, tableViewChild }, | 60 | components: { BasicTable, NotifyManagerDrawer, TableAction, tableViewChild }, |
| 66 | setup() { | 61 | setup() { |
| 67 | - let isJudgeStatus = ref(true); | ||
| 68 | let selectedRowKeys: string[] = reactive([]); | 62 | let selectedRowKeys: string[] = reactive([]); |
| 69 | - let echoEditData = reactive({}); | 63 | + |
| 64 | + const [registerAdd, { openDrawer: openDrawerAdd }] = useDrawer(); | ||
| 70 | const [registerDrawer, { openDrawer }] = useDrawer(); | 65 | const [registerDrawer, { openDrawer }] = useDrawer(); |
| 71 | const { createMessage } = useMessage(); | 66 | const { createMessage } = useMessage(); |
| 72 | const [registerTable, { reload, getSelectRowKeys }] = useTable({ | 67 | const [registerTable, { reload, getSelectRowKeys }] = useTable({ |
| @@ -93,10 +88,9 @@ | @@ -93,10 +88,9 @@ | ||
| 93 | }); | 88 | }); |
| 94 | 89 | ||
| 95 | function handleAdd() { | 90 | function handleAdd() { |
| 96 | - openDrawer(true, { | 91 | + openDrawerAdd(true, { |
| 97 | isUpdate: false, | 92 | isUpdate: false, |
| 98 | }); | 93 | }); |
| 99 | - isJudgeStatus.value = true; | ||
| 100 | } | 94 | } |
| 101 | 95 | ||
| 102 | const useSelectionChange = () => { | 96 | const useSelectionChange = () => { |
| @@ -113,14 +107,12 @@ | @@ -113,14 +107,12 @@ | ||
| 113 | record, | 107 | record, |
| 114 | isUpdate: true, | 108 | isUpdate: true, |
| 115 | }); | 109 | }); |
| 116 | - isJudgeStatus.value = false; | ||
| 117 | }; | 110 | }; |
| 118 | function handleEdit(record: Recordable) { | 111 | function handleEdit(record: Recordable) { |
| 119 | - openDrawer(true, { | 112 | + openDrawerAdd(true, { |
| 120 | record, | 113 | record, |
| 121 | isUpdate: true, | 114 | isUpdate: true, |
| 122 | }); | 115 | }); |
| 123 | - isJudgeStatus.value = true; | ||
| 124 | } | 116 | } |
| 125 | async function handleDelete(record: Recordable) { | 117 | async function handleDelete(record: Recordable) { |
| 126 | let ids = [record.id]; | 118 | let ids = [record.id]; |
| @@ -132,10 +124,9 @@ | @@ -132,10 +124,9 @@ | ||
| 132 | reload(); | 124 | reload(); |
| 133 | } | 125 | } |
| 134 | return { | 126 | return { |
| 135 | - isJudgeStatus, | ||
| 136 | handleView, | 127 | handleView, |
| 128 | + registerAdd, | ||
| 137 | useSelectionChange, | 129 | useSelectionChange, |
| 138 | - echoEditData, | ||
| 139 | registerTable, | 130 | registerTable, |
| 140 | registerDrawer, | 131 | registerDrawer, |
| 141 | handleAdd, | 132 | handleAdd, |
| @@ -60,11 +60,12 @@ | @@ -60,11 +60,12 @@ | ||
| 60 | isUpdate.value = !!data?.isUpdate; | 60 | isUpdate.value = !!data?.isUpdate; |
| 61 | //编辑 | 61 | //编辑 |
| 62 | if (unref(isUpdate)) { | 62 | if (unref(isUpdate)) { |
| 63 | + console.log(data.record); | ||
| 63 | getId.value = data.record.id; | 64 | getId.value = data.record.id; |
| 64 | await setFieldsValue({ | 65 | await setFieldsValue({ |
| 65 | ...data.record, | 66 | ...data.record, |
| 67 | + receiverType: data.record.receiverType === '全部' ? '0' : '1', | ||
| 66 | }); | 68 | }); |
| 67 | - } else { | ||
| 68 | } | 69 | } |
| 69 | }); | 70 | }); |
| 70 | const getTitle = computed(() => (!unref(isUpdate) ? '新增通知' : '编辑通知')); | 71 | const getTitle = computed(() => (!unref(isUpdate) ? '新增通知' : '编辑通知')); |
| @@ -4,35 +4,29 @@ | @@ -4,35 +4,29 @@ | ||
| 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="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 | </BasicDrawer> | 15 | </BasicDrawer> |
| 14 | </div> | 16 | </div> |
| 15 | </template> | 17 | </template> |
| 16 | <script lang="ts"> | 18 | <script lang="ts"> |
| 17 | - import { defineComponent, ref, computed, unref } from 'vue'; | 19 | + import { defineComponent, ref } from 'vue'; |
| 18 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; | 20 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
| 19 | import { Description, DescItem, useDescription } from '/@/components/Description/index'; | 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 | const schema: DescItem[] = [ | 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 | field: 'senderName', | 30 | field: 'senderName', |
| 37 | label: '发送者', | 31 | label: '发送者', |
| 38 | }, | 32 | }, |
| @@ -42,7 +36,7 @@ | @@ -42,7 +36,7 @@ | ||
| 42 | }, | 36 | }, |
| 43 | { | 37 | { |
| 44 | field: 'type', | 38 | field: 'type', |
| 45 | - label: '类型', | 39 | + label: '类型:', |
| 46 | render: (_, data) => { | 40 | render: (_, data) => { |
| 47 | return data.type === 'NOTICE' | 41 | return data.type === 'NOTICE' |
| 48 | ? '公告' | 42 | ? '公告' |
| @@ -53,48 +47,41 @@ | @@ -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 | export default defineComponent({ | 51 | export default defineComponent({ |
| 74 | name: 'ConfigDrawer', | 52 | name: 'ConfigDrawer', |
| 75 | - components: { BasicDrawer, Description, PageWrapper }, | 53 | + components: { BasicDrawer, Description, BasicTable }, |
| 76 | emits: ['success', 'register'], | 54 | emits: ['success', 'register'], |
| 77 | setup() { | 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 | data: descInfo, | 69 | data: descInfo, |
| 92 | schema: schema, | 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 | return { | 79 | return { |
| 95 | - register1, | ||
| 96 | - getTitle, | 80 | + descInfo, |
| 81 | + registerDesc, | ||
| 82 | + registerTable, | ||
| 97 | registerDrawer, | 83 | registerDrawer, |
| 84 | + noticeId, | ||
| 98 | }; | 85 | }; |
| 99 | }, | 86 | }, |
| 100 | }); | 87 | }); |
| @@ -10,10 +10,14 @@ | @@ -10,10 +10,14 @@ | ||
| 10 | <TableAction | 10 | <TableAction |
| 11 | :actions="[ | 11 | :actions="[ |
| 12 | { | 12 | { |
| 13 | + label: '编辑', | ||
| 14 | + tooltip: '编辑', | ||
| 13 | icon: 'clarity:note-edit-line', | 15 | icon: 'clarity:note-edit-line', |
| 14 | onClick: handleEdit.bind(null, record), | 16 | onClick: handleEdit.bind(null, record), |
| 15 | }, | 17 | }, |
| 16 | { | 18 | { |
| 19 | + label: '删除', | ||
| 20 | + tooltip: '删除', | ||
| 17 | icon: 'ant-design:delete-outlined', | 21 | icon: 'ant-design:delete-outlined', |
| 18 | color: 'error', | 22 | color: 'error', |
| 19 | popConfirm: { | 23 | popConfirm: { |
| @@ -76,11 +80,11 @@ | @@ -76,11 +80,11 @@ | ||
| 76 | showIndexColumn: false, | 80 | showIndexColumn: false, |
| 77 | canResize: false, | 81 | canResize: false, |
| 78 | actionColumn: { | 82 | actionColumn: { |
| 79 | - width: 80, | 83 | + width: 120, |
| 80 | title: t('routes.common.system.pageSystemTitleOperation'), //操作 | 84 | title: t('routes.common.system.pageSystemTitleOperation'), //操作 |
| 81 | dataIndex: 'action', | 85 | dataIndex: 'action', |
| 82 | slots: { customRender: 'action' }, | 86 | slots: { customRender: 'action' }, |
| 83 | - fixed: undefined, | 87 | + fixed: 'right', |
| 84 | }, | 88 | }, |
| 85 | }); | 89 | }); |
| 86 | 90 |
| @@ -94,6 +94,7 @@ | @@ -94,6 +94,7 @@ | ||
| 94 | Tag, | 94 | Tag, |
| 95 | TableAction, | 95 | TableAction, |
| 96 | }, | 96 | }, |
| 97 | + emits: ['register'], | ||
| 97 | setup() { | 98 | setup() { |
| 98 | const { createMessage } = useMessage(); | 99 | const { createMessage } = useMessage(); |
| 99 | const [tenantAdminFormDrawer, { openDrawer: openTenantAdminFormDrawer }] = useDrawer(); | 100 | const [tenantAdminFormDrawer, { openDrawer: openTenantAdminFormDrawer }] = useDrawer(); |
| @@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
| 24 | BasicDrawer, | 24 | BasicDrawer, |
| 25 | BasicForm, | 25 | BasicForm, |
| 26 | }, | 26 | }, |
| 27 | - emits: ['success'], | 27 | + emits: ['success', 'register'], |
| 28 | setup(_, { emit }) { | 28 | setup(_, { emit }) { |
| 29 | const isUpdate = ref(true); | 29 | const isUpdate = ref(true); |
| 30 | const tenantId = ref(''); | 30 | const tenantId = ref(''); |