diff --git a/src/assets/ts/antd.ts b/src/assets/ts/antd.ts index 16de100..6ef4532 100644 --- a/src/assets/ts/antd.ts +++ b/src/assets/ts/antd.ts @@ -1,20 +1,6 @@ -import type {App} from 'vue'; -import { - Form, - Input, - Button, - Radio, - Modal, - Table, - Select -} from 'ant-design-vue'; +import type { App } from 'vue'; +import { Form, Input, Button, Radio, Modal, Table, Select, Spin } from 'ant-design-vue'; export default function registerGlobComp(app: App) { - app.use(Button) - .use(Form) - .use(Input) - .use(Radio) - .use(Modal) - .use(Table) - .use(Select) + app.use(Button).use(Form).use(Input).use(Radio).use(Modal).use(Table).use(Select).use(Spin); } \ No newline at end of file diff --git a/src/components/body-d-left/bodyLeftHooks.ts b/src/components/body-d-left/bodyLeftHooks.ts new file mode 100644 index 0000000..b619c7c --- /dev/null +++ b/src/components/body-d-left/bodyLeftHooks.ts @@ -0,0 +1,33 @@ +import { ref } from 'vue'; + +export const timeTab = [ + { + name: '全部', + value: '1', + }, + { + name: '本年', + value: '2', + }, + { + name: '本月', + value: '3', + }, + { + name: '本周', + value: '4', + }, +]; + +export function useSpin() { + const spinning = ref(true); + + function setSpin(flag: boolean) { + spinning.value = flag; + } + + return { + spinning, + setSpin, + }; +} \ No newline at end of file diff --git a/src/components/body-d-left/left.api.ts b/src/components/body-d-left/left.api.ts index cf62bf1..564eb3f 100644 --- a/src/components/body-d-left/left.api.ts +++ b/src/components/body-d-left/left.api.ts @@ -1,5 +1,8 @@ -import { get } from '../../api/request' +import { get } from '../../api/request'; + enum Api { - server='/health-emergency/emergency/tblUserHelp/statistics' + server = '/health-emergency/emergency/tblUserHelp/statistics', } -export const list = (params) => get(Api.server, params) \ No newline at end of file + +export const list = (params) => get(Api.server, params); +//主诉分类 diff --git a/src/components/body-d-left/oneL.vue b/src/components/body-d-left/oneL.vue index f9cf2b7..842db7b 100644 --- a/src/components/body-d-left/oneL.vue +++ b/src/components/body-d-left/oneL.vue @@ -6,16 +6,17 @@ {{ item.name }}
- {{ item.title }} - {{ item.iphone }} + {{ item?.title }} + {{ item?.gross }}
+
@@ -24,59 +25,33 @@ import { onMounted, ref } from 'vue'; import PublicTitle from '../publicTitle.vue'; import { list } from './left.api'; + import { timeTab, useSpin } from '/@/components/body-d-left/bodyLeftHooks.ts'; - const typeTime = ref([ - { - name: '全部', - value: '1', - }, - { - name: '本年', - value: '2', - }, - { - name: '本月', - value: '3', - }, - { - name: '本周', - value: '4', - }, - ]); - const dataLists = ref([ - { - title: '最新呼入电话', - iphone: '18394578789', - }, - { - title: '最新呼入电话', - iphone: '18394578789', - }, - { - title: '最新呼入电话', - iphone: '18394578789', - }, - { - title: '最新呼入电话', - iphone: '18394578789', - }, - ]); + const typeTime = ref(timeTab); + const dataLists = ref([]); const selectIndex = ref(0); const selectVal = ref('1'); + const { setSpin, spinning } = useSpin(); onMounted(() => { getList(); }); - function getList() { - list({ - condition: selectVal.value, - }).then(() => {}); + async function getList() { + try { + const { code, result } = (await list({ condition: selectVal.value })) || []; + setSpin(!spinning.value); + if (code != 200) { + return; + } + dataLists.value = result?.map((item) => ({ ...item, title: '最新呼入电话' })); + } catch { + setSpin(!spinning.value); + } } function handleSelect(index: number, value: string) { selectIndex.value = index; selectVal.value = value; - console.log(selectVal.value, value); getList(); } @@ -85,19 +60,31 @@ height: calc(100% - 40px); .server-container { - color: #a3a4a4; + color: #fff; padding-top: 4%; height: 88%; display: grid; align-items: start; + overflow-y: auto; + position: relative; + + > :nth-child(1) { + padding-top: 0 !important; + } + + .spin { + position: absolute; + left: 50%; + top: 50%; + } .server-item { font-size: 16px; + padding: 6px 0; span { display: inline-block; width: 50%; - font-weight: bold; } span:nth-child(1) { @@ -110,6 +97,10 @@ padding-right: 6%; } } + + .server-item:nth-child(2n) { + background-color: #0a0a0c; + } } } \ No newline at end of file diff --git a/src/components/chinaMap/chinaHooks.ts b/src/components/chinaMap/chinaHooks.ts index 2a2e2d4..119be7a 100644 --- a/src/components/chinaMap/chinaHooks.ts +++ b/src/components/chinaMap/chinaHooks.ts @@ -1,18 +1,31 @@ +import { getAllList } from '/@/components/chinaMap/chinaMapApi.ts'; + +export enum TabType { + all = '', //所有资源 + youTianYiYuan = '1', //油田医院 + heZuoYiYuan = '2', //合作医院 + yiLiaoDian = '3', //医疗点 +} + export const tabList = [ { name: '所有资源', + type: TabType.all, }, { name: '油田医院', + type: TabType.youTianYiYuan, }, { name: '医疗点', + type: TabType.yiLiaoDian, }, { name: '救护车', }, { name: '合作医院', + type: TabType.heZuoYiYuan, }, { name: '地方医院', @@ -24,6 +37,17 @@ export const tabList = [ name: '急救路线', }, ]; + +export function mapApiSwitch(type: string, params: any) { + const basicParams = { + lat: 34, //纬度34 + lon: 108, //经度 + }; + if ([TabType.all, TabType.yiLiaoDian, TabType.heZuoYiYuan].includes(type)) { + return getAllList({ ...basicParams, ...params }); + } +} + export const mapIcon1 = new URL('/@/assets/img/mapIcon1.png', import.meta.url).href; export const mapIcon2 = new URL('/@/assets/img/mapIcon2.png', import.meta.url).href; export const mapIcon3 = new URL('/@/assets/img/mapIcon3.png', import.meta.url).href; diff --git a/src/components/chinaMap/chinaMap.vue b/src/components/chinaMap/chinaMap.vue index 3587b36..278fb13 100644 --- a/src/components/chinaMap/chinaMap.vue +++ b/src/components/chinaMap/chinaMap.vue @@ -60,9 +60,10 @@