Commit e3467ebcf00fdba5f6b1dcadf17eef7a352266ba

Authored by 黄 x
2 parents 8e0ba2ab 169a3374

Merge remote-tracking branch 'origin/sqy_dev'

# Conflicts:
#	src/views/stationnotification/notificationmanager/config.d.ts
... ... @@ -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}`,
... ... @@ -128,3 +128,13 @@ export const notifyOrganizationGetApi = () => {
128 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 +};
... ...
... ... @@ -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>
... ...
... ... @@ -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 138 field: 'receiverType',
123 139 required: true,
... ... @@ -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 190 field: '',
199 191 component: 'Input',
200 192 label: '',
... ...
... ... @@ -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
... ...
... ... @@ -94,6 +94,7 @@
94 94 Tag,
95 95 TableAction,
96 96 },
  97 + emits: ['register'],
97 98 setup() {
98 99 const { createMessage } = useMessage();
99 100 const [tenantAdminFormDrawer, { openDrawer: openTenantAdminFormDrawer }] = useDrawer();
... ...
... ... @@ -24,7 +24,7 @@
24 24 BasicDrawer,
25 25 BasicForm,
26 26 },
27   - emits: ['success'],
  27 + emits: ['success', 'register'],
28 28 setup(_, { emit }) {
29 29 const isUpdate = ref(true);
30 30 const tenantId = ref('');
... ...