解决冲突
This commit is contained in:
@@ -1,6 +1,43 @@
|
||||
import { ref } from 'vue';
|
||||
import * as echarts from 'echarts';
|
||||
|
||||
export function useStatistics() {
|
||||
const statistics = ref([
|
||||
{
|
||||
name: '最新呼入电话',
|
||||
value: '',
|
||||
key: 'gross',
|
||||
},
|
||||
{
|
||||
name: '最新受理电话',
|
||||
value: '',
|
||||
key: 'alerdyreceive',
|
||||
},
|
||||
{
|
||||
name: '突发重大伤病应急',
|
||||
value: '',
|
||||
key: 'jqqz',
|
||||
},
|
||||
{
|
||||
name: '重大伤病应急就医',
|
||||
value: '',
|
||||
key: 'dbjy',
|
||||
},
|
||||
]);
|
||||
|
||||
function setStatistics(data = {}) {
|
||||
statistics.value.forEach((item) => {
|
||||
const { key } = item;
|
||||
item.value = data[key];
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
statistics,
|
||||
setStatistics,
|
||||
};
|
||||
}
|
||||
|
||||
export const timeTab = [
|
||||
{
|
||||
name: '全部',
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
>
|
||||
</div>
|
||||
<div class="server-container">
|
||||
<div v-for="(item, index) in dataLists" :key="index" class="server-item">
|
||||
<span>{{ item?.title }}</span>
|
||||
<span>{{ item?.gross }}</span>
|
||||
<div v-for="(item, index) in statistics" :key="index" class="server-item">
|
||||
<span>{{ item?.name }}</span>
|
||||
<span>{{ item?.value }}</span>
|
||||
</div>
|
||||
<a-spin :spinning="spinning" class="spin"></a-spin>
|
||||
</div>
|
||||
@@ -23,12 +23,13 @@
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import bus from '/@/utils/bus.ts';
|
||||
import PublicTitle from '../publicTitle.vue';
|
||||
import { list } from './left.api';
|
||||
import { timeTab, useSpin } from '/@/components/body-d-left/bodyLeftHooks.ts';
|
||||
import { timeTab, useSpin, useStatistics } from '/@/components/body-d-left/bodyLeftHooks.ts';
|
||||
|
||||
const typeTime = ref(timeTab);
|
||||
const dataLists = ref([]);
|
||||
const { statistics, setStatistics } = useStatistics();
|
||||
const selectIndex = ref(0);
|
||||
const selectVal = ref('1');
|
||||
const { setSpin, spinning } = useSpin();
|
||||
@@ -42,10 +43,12 @@
|
||||
try {
|
||||
const { code, result } = (await list({ condition: selectVal.value })) || {};
|
||||
setSpin(!spinning.value);
|
||||
if (code != 200) {
|
||||
if (code != 200 || !Array.isArray(result)) {
|
||||
return;
|
||||
}
|
||||
dataLists.value = result?.map((item) => ({ ...item, title: '最新呼入电话' }));
|
||||
setStatistics(result[0]);
|
||||
let { alerdyreceive = '', totalacceptance = '' } = result[0];
|
||||
bus.emit('alerdyreceive', { alerdyreceive, totalacceptance });
|
||||
} catch {
|
||||
setSpin(!spinning.value);
|
||||
}
|
||||
@@ -70,10 +73,6 @@
|
||||
overflow-y: auto;
|
||||
position: relative;
|
||||
|
||||
> :nth-child(1) {
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
|
||||
.spin {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
@@ -100,7 +99,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.server-item:nth-child(2n) {
|
||||
.server-item:nth-child(odd) {
|
||||
background-color: #0a0a0c;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<a-spin :spinning="spinning" class="spin"></a-spin>
|
||||
<div class="physical-item" v-for="(item, i) in hospitalList" :key="i" :class="[i < 3 ? 'b1' : 'b2']">
|
||||
<div class="ct">
|
||||
<div class="value">{{ countData[item.key] || '' }}</div>
|
||||
<div class="value">{{ countData[item.key] || '/' }}</div>
|
||||
<div class="label">{{ item.title }}</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -55,7 +55,6 @@
|
||||
return;
|
||||
}
|
||||
countData.value = result[0] || {};
|
||||
console.log('result', result);
|
||||
} catch {
|
||||
setSpin(!spinning.value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user