Browse Source

🔥 享受敲代码的美好时光,处理地图数据控制逻辑

master
wangxiang 3 years ago
parent
commit
7673f885a1
  1. 6
      src/api/platform/system/controller/user.ts
  2. 17
      src/components/AMap/src/AMapDesigner/index.vue
  3. 28
      src/components/AMap/src/amap.data.tsx

6
src/api/platform/system/controller/user.ts

@ -20,7 +20,8 @@ enum Api { @@ -20,7 +20,8 @@ enum Api {
changeStatus='/system_proxy/system/user/changeStatus',
changeTenant='/system_proxy/system/user/changeTenant',
resetTenant='/system_proxy/system/user/resetTenant',
synchronousAuthenticationUser = '/system_proxy/system/user/synchronousAuthenticationUser'
synchronousAuthenticationUser = '/system_proxy/system/user/synchronousAuthenticationUser',
getCourierUserList= '/system_proxy/system/user/getCourierUserList'
}
/** 查询用户列表 */
@ -55,3 +56,6 @@ export const resetTenant = () => defHttp.get({ url: Api.resetTenant }); @@ -55,3 +56,6 @@ export const resetTenant = () => defHttp.get({ url: Api.resetTenant });
/** 同步身份验证用户 */
export const synchronousAuthenticationUser = () => defHttp.get<KiccUser>({ url: Api.synchronousAuthenticationUser });
/** 获取全部快递员集合 */
export const getCourierUserList = () => defHttp.get<User[]>({ url: Api.getCourierUserList });

17
src/components/AMap/src/AMapDesigner/index.vue

@ -29,18 +29,21 @@ @@ -29,18 +29,21 @@
>
<AFormItem label="名称" name="name">
<a-input v-model:value="mapState.mapData.name"
:disabled="isEdit"
placeholder="请输入地图名称"
allowClear
/>
</AFormItem>
<AFormItem label="发单" name="sendOrderId">
<ASelect v-model:value="mapState.mapData.sendOrderId"
:disabled="isEdit"
:options="mapState.hospitalList"
@select="handleCourierUserSearch"
/>
</AFormItem>
<AFormItem label="起点" name="courierUserId">
<ASelect v-model:value="mapState.mapData.courierUserId"
:disabled="isEdit"
:options="mapState.courierUserList"
@select="handleCourierUserData"
/>
@ -94,7 +97,7 @@ @@ -94,7 +97,7 @@
import MapPointModal from '../components/MapPointModal.vue';
import { propTypes } from '/@/utils/propTypes';
import { listHospital } from '/@/api/platform/common/controller/hospital';
import { listUser } from '/@/api/platform/system/controller/user';
import { getCourierUserList } from '/@/api/platform/system/controller/user';
import { listOrg } from '/@/api/platform/common/controller/org';
import { useUserStore } from '/@/store/modules/user';
import { split, divide, subtract, merge, isEmpty, cloneDeep, add, omit } from 'lodash-es';
@ -142,7 +145,8 @@ @@ -142,7 +145,8 @@
type: Array as PropType<string[]>,
default: () => ['toolBar', 'controlBar', 'scale', 'mapType']
},
navigatePanel: propTypes.bool.def(true)
navigatePanel: propTypes.bool.def(true),
isEdit: propTypes.bool.def(false),
});
let map;
@ -197,9 +201,6 @@ @@ -197,9 +201,6 @@
name: [
{ required: true, whitespace: true, message: '地图名称不能为空', validateTrigger: 'blur' }
],
sendOrderId: [
{ required: true, whitespace: true, message: '发单点不能为空', validateTrigger: 'blur' }
],
courierUserId: [
{ required: true, whitespace: true, message: '起点不能为空', validateTrigger: 'blur' }
]
@ -230,7 +231,7 @@ @@ -230,7 +231,7 @@
if (!instance) return;
mapState.loading = true;
//
listHospital({ size: 40 }).then(res => {
listHospital({ size: 40, mapNotify: '1' }).then(res => {
mapState.hospitalList = res.data?.map(item => ({
value: item.id,
label: item.name,
@ -240,8 +241,8 @@ @@ -240,8 +241,8 @@
mapOrientation: item.mapOrientation
}));
});
listUser({ size: 40, userType: '1' }).then(res => {
mapState.courierUserList = res.data?.map(item => ({
getCourierUserList().then(res => {
mapState.courierUserList = res?.map(item => ({
value: item.id,
label: item.nickName,
mapOrientation: item.mapOrientation,

28
src/components/AMap/src/amap.data.tsx

@ -66,7 +66,7 @@ export const taskColumns: BasicColumn[] = [ @@ -66,7 +66,7 @@ export const taskColumns: BasicColumn[] = [
editComponentProps: {
style: { width:'100%' },
api: listHospital,
params: { size: 40 },
params: { size: 40, mapNotify: '1' },
labelField: 'name',
valueField: 'id',
resultField: 'data'
@ -132,7 +132,7 @@ export const taskPresetColumns: BasicColumn[] = [ @@ -132,7 +132,7 @@ export const taskPresetColumns: BasicColumn[] = [
editComponentProps: {
style: { width:'100%' },
api: listHospital,
params: { size: 40 },
params: { size: 40, mapNotify: '1' },
labelField: 'name',
valueField: 'id',
resultField: 'data'
@ -227,7 +227,7 @@ export const taskPresetChildColumns: BasicColumn[] = [ @@ -227,7 +227,7 @@ export const taskPresetChildColumns: BasicColumn[] = [
}*/
];
/** 子任务预设表格列 */
/** 地图标记点表格列 */
export const mapPointColumns: VxeTableDefines.ColumnOptions[] = [
{
width: '50px',
@ -257,6 +257,28 @@ export const mapPointColumns: VxeTableDefines.ColumnOptions[] = [ @@ -257,6 +257,28 @@ export const mapPointColumns: VxeTableDefines.ColumnOptions[] = [
default ({ row }) {
const type = row.type;
let text = '', color = '';
switch (type) {
case '0':
text = '下级医院';
color = 'green';
break;
case '1':
text = '上级医检';
color = 'red';
break;
}
return [
<Tag color={color}>{text}</Tag>
];
}
}
},
{ field: 'taskType',
title: '任务类型',
slots: {
default ({ row }) {
const type = row.taskType;
let text = '', color = '';
switch (type) {
case '0':
text = '普通任务';

Loading…
Cancel
Save