Alidada233 3 years ago
parent
commit
5857afd4d8
  1. 2
      package.json
  2. 2
      src/api/platform/system/entity/doctorModel.ts
  3. 2
      src/api/platform/system/entity/officeModel.ts
  4. 93
      src/components/AMap/src/TaskModal.vue
  5. 5
      src/views/institution/doctor/DoctorModal.vue
  6. 41
      src/views/institution/doctor/doctor.data.ts
  7. 2
      src/views/institution/hospital/HospitalModal.vue
  8. 7
      src/views/institution/institution/institution.data.ts
  9. 1
      src/views/institution/office/OfficeModal.vue
  10. 14
      src/views/institution/office/office.data.ts

2
package.json

@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
"dev": "vite",
"lint:check": "eslint --max-warnings 0 \"src/**/*.{vue,ts,tsx}\"",
"lint:eslint": "eslint --cache --max-warnings 0 \"src/**/*.{vue,ts,tsx}\" --fix",
"build": "yarn lint:check && cross-env NODE_ENV=production vite build && esno ./build/script/postBuild.ts",
"build": "cross-env NODE_ENV=production vite build && esno ./build/script/postBuild.ts",
"build:test": "yarn lint:check && vite build --mode test && esno ./build/script/postBuild.ts",
"build:no-cache": "yarn delete:cache && yarn build",
"preview": "yarn run build && vite preview",

2
src/api/platform/system/entity/doctorModel.ts

@ -26,7 +26,7 @@ export interface DoctorItem { @@ -26,7 +26,7 @@ export interface DoctorItem {
/**地址(门牌号)*/
detailAddress: string;
/**组织类型*/
organType: number;
organType: string;
/**组织id*/
organId: string;
/**组织名称*/

2
src/api/platform/system/entity/officeModel.ts

@ -15,7 +15,7 @@ export interface OfficeItem extends CommonEntity{ @@ -15,7 +15,7 @@ export interface OfficeItem extends CommonEntity{
name: string;
organType: number;
organType: string;
organId: string;

93
src/components/AMap/src/TaskModal.vue

@ -34,6 +34,7 @@ @@ -34,6 +34,7 @@
import { BasicTable, useTable, EditRecordRow, BasicColumn, ActionItem, TableAction } from '/@/components/Table';
import { formTaskColumns, formSchemeColumns, largeHospitalMapList, smallHospitalMapList, } from './map.data';
import { buildUUID } from '/@/utils/uuid';
import { add, divide } from 'lodash-es';
/** 类型规范统一声明定义区域 */
interface WindowState {
@ -151,48 +152,80 @@ @@ -151,48 +152,80 @@
const scheme = [];
const origin = state.formData.takeSpecimenId;
//
const taskDataSource = getDataSource();
const smallHospitals = Array<any>();
const largeHospitals = Array<any>();
taskDataSource.forEach(item => {
const smallHospitalPositions:any[] = [];
const largeHospitalPositions:any[] = [];
taskDataSource.forEach(item => {
// ID
const key = buildUUID();
smallHospitals.push({
key: key,
smallHospitalId: item.smallHospitalId,
workable: false
});
largeHospitals.push({
key: key,
largeHospitalId: item.largeHospitalId,
workable: false
});
const smallHospital = smallHospitalMapList.find(index => index.id == item.smallHospitalId);
if(smallHospital) smallHospitalPositions.push([key, new AMap.LngLat(smallHospital.lng, smallHospital.lat)]);
const largeHospital = largeHospitalMapList.find(index => index.id == item.largeHospitalId);
if(largeHospital) largeHospitalPositions.push([key, new AMap.LngLat(largeHospital.lng, largeHospital.lat)]);
});
//
const waypoints = Array<any>();
const waypoints:any[] = [];
//
let destination;
/** 1.计算预测大致的智能规划方案可行性数量 */
//
smallHospitals.forEach(small => {
const smallHospital = smallHospitalMapList.find(index => index.id == small.smallHospitalId);
if(smallHospital) {
small.workable = true;
waypoints.push(new AMap.LngLat(smallHospital.lng, smallHospital.lat));
//
const smallHospitalScheme = Array.from({ length: smallHospitalPositions.length }, () => Array(smallHospitalPositions.length).fill(0));
for(let i = 0; i < smallHospitalPositions.length; ++i) {
// ,
const oneDimensionArray = smallHospitalScheme[i];
// ,
let indexs = Object.keys(smallHospitalPositions);
const reverseIndexs = indexs.slice(0, i);
indexs.splice(0, i);
indexs.push(...reverseIndexs);
//
for(let j = 0; j < indexs.length; ++j) {
const index = indexs[j];
const smallHospitalPosition = smallHospitalPositions[index];
oneDimensionArray[j] = smallHospitalPosition;
}
largeHospitals.forEach(large => {
const largeHospital = largeHospitalMapList.find(index => index.id == large.largeHospitalId);
largeHospital
});
})
}
//
const composeScheme = mapSchemePermuteUnique([]);
}
/** 地图方案组合排列算法,可确保二叉树当存在数组内容相同排列不重复 */
function mapSchemePermuteUnique(composeQueue: number[]) {
const ans: number[][] = [];
const arr: number[] = [];
const used: boolean[] = [];
function helper() {
// 退
if (arr.length === composeQueue.length) {
ans.push(arr.slice(0));
return;
}
// ,,
let last: unknown = undefined;
for (let i = 0; i < composeQueue.length; i++){
//
if (used[i]) continue;
// ,
if (last == composeQueue[i]) continue;
// 使
last = composeQueue[i];
used[i] = true;
//
arr.push(composeQueue[i]);
//
helper();
//
arr.pop();
used[i] = false;
}
}
helper();
return ans;
}
/** 处理路线预览 */

5
src/views/institution/doctor/DoctorModal.vue

@ -31,10 +31,9 @@ const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) @@ -31,10 +31,9 @@ const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data)
resetFields();
setModalProps({confirmLoading: false});
isUpdate.value = !!data?.isUpdate;
console.log(data.record);
if (unref(isUpdate)) {
setFieldsValue({
...data.record,
});
setFieldsValue(data.record);
}
})
//

41
src/views/institution/doctor/doctor.data.ts

@ -1,10 +1,10 @@ @@ -1,10 +1,10 @@
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import {h} from "vue";
import {Tag} from "ant-design-vue";
import { list as hospitalList } from "/@/api/platform/system/controller/hospital";
import {list as institutionList, list as institutalList} from "/@/api/platform/system/controller/institution";
import { list as officeList } from "/@/api/platform/system/controller/office";
import {h} from 'vue';
import {Tag} from 'ant-design-vue';
import { list as hospitalList } from '/@/api/platform/system/controller/hospital';
import {list as institutionList, list as institutalList} from '/@/api/platform/system/controller/institution';
import { list as officeList } from '/@/api/platform/system/controller/office';
export const columns: BasicColumn[] = [
@ -71,20 +71,17 @@ export const columns: BasicColumn[] = [ @@ -71,20 +71,17 @@ export const columns: BasicColumn[] = [
text = '未知';
color = 'gray';
break;
}
return h(Tag, { color: color }, () => text);
}
},
{
title: '组织名称',
dataIndex: 'organName',
width: 120,
},
{
title: '科室名称',
dataIndex: 'officeName',
width: 120,
},
// {
// title: '科室名称',
// dataIndex: 'officeName',
// width: 120,
// },
{
title: '状态',
dataIndex: 'status',
@ -189,8 +186,8 @@ export const doctorFormSchema: FormSchema[] = [ @@ -189,8 +186,8 @@ export const doctorFormSchema: FormSchema[] = [
component: 'Select',
componentProps: {
options: [
{ label: '医院', value: 1 },
{ label: '医检', value: 2 }
{ label: '医院', value: '1' },
{ label: '医检', value: '2' }
]
},
required: true,
@ -202,16 +199,22 @@ export const doctorFormSchema: FormSchema[] = [ @@ -202,16 +199,22 @@ export const doctorFormSchema: FormSchema[] = [
required: true,
renderComponentContent: renderCallbackParams => {
const organType = renderCallbackParams.model.organType;
const dataApi = organType==1 ? hospitalList : institutionList;
const dataApi = organType=='1' ? hospitalList : institutionList;
renderCallbackParams.schema.componentProps = {
resultField: 'list',
labelField: 'name',
valueField: 'id',
api: dataApi
}
};
},
},
// {
// field: 'officeId',
// label: '所属科室',
// component: 'ApiSelect',
// required: true,
// },
{
field: 'status',
label: '状态',

2
src/views/institution/hospital/HospitalModal.vue

@ -50,7 +50,7 @@ async function handleSubmit() { @@ -50,7 +50,7 @@ async function handleSubmit() {
const values = await validate();
setModalProps({confirmLoading: true});
let val = toRaw<HospitalItem>(values);
values.addressIds = toRaw(val.addressIds).toString();
values.addressIds = toRaw(val.addressIds);
await set(values);
closeModal();
emit('success');

7
src/views/institution/institution/institution.data.ts

@ -12,15 +12,16 @@ export const columns: BasicColumn[] = [ @@ -12,15 +12,16 @@ export const columns: BasicColumn[] = [
width: 120,
},
{
title: '医检名',
title: '机构名称',
dataIndex: 'name',
width: 120,
},
{
title: '医检类型',
dataIndex: 'card',
title: '机构类型',
dataIndex: 'type',
width: 120,
customRender: ({ record }) =>{
console.log(record);
const type = record.type;
let text = '';
let color = '';

1
src/views/institution/office/OfficeModal.vue

@ -42,6 +42,7 @@ const getTitle = computed(() => (!unref(isUpdate) ? '新增科室' : '编辑科 @@ -42,6 +42,7 @@ const getTitle = computed(() => (!unref(isUpdate) ? '新增科室' : '编辑科
async function handleSubmit() {
try {
const values = await validate();
setModalProps({confirmLoading: true});
await set(values);
closeModal();

14
src/views/institution/office/office.data.ts

@ -42,11 +42,11 @@ export const columns: BasicColumn[] = [ @@ -42,11 +42,11 @@ export const columns: BasicColumn[] = [
return h(Tag, { color: color }, () => text);
}
},
{
title: '组织名称',
dataIndex: 'organName',
width: 120,
},
// {
// title: '组织名称',
// dataIndex: 'organName',
// width: 120,
// },
{
title: '主任名称',
dataIndex: 'directorName',
@ -129,8 +129,8 @@ export const officeFormSchema: FormSchema[] = [ @@ -129,8 +129,8 @@ export const officeFormSchema: FormSchema[] = [
component: 'Select',
componentProps: {
options: [
{ label: '医院', value: 1 },
{ label: '医检', value: 2 }
{ label: '医院', value: '1' },
{ label: '医检', value: '2' }
]
},
required: true,

Loading…
Cancel
Save