feat: 动态获取logo

main
shengwen.chen 2 months ago
parent d86c81de15
commit 7386f85283

@ -16,3 +16,13 @@ export const getDynamicTableList = data => {
data,
});
};
// 获取全局变量
export const getGlobeConfig = params => {
return _axios({
method: 'get',
url: '/api/identity/configs/PageList',
params,
});
};

@ -1,8 +1,10 @@
<template>
<section class="waitBox bg-[#F3F2FA]">
<nav class="h-[11.11vh] pl-[3.7vh] pr-[2.22vh] flex justify-between items-center bg-[#5D49AF] relative overflow-hidden">
<div class="logBox h-[5vh]">
<img class="h-full" src="@/assets/svg/Wait/yongsi-logo.png" />
<nav
class="h-[11.11vh] pl-[3.7vh] pr-[2.22vh] flex justify-between items-center bg-[#5D49AF] relative overflow-hidden">
<div class="logBox h-[7vh]">
<img class="h-full" :src="logoUrl" v-show="logoUrl" />
<img class="h-full" :src="logoUrlBackup" v-show="!logoUrl && logoUrlBackup" />
</div>
<div class="absolute titleBox w-full flex justify-around">
<div class="flex items-center">
@ -19,46 +21,41 @@
<div class="absolute top-[24px] left-1/2 -translate-x-1/2 w-[calc(100%-48px)]">
<div class="bg-[#9A82FF] flex text-center" :style="carouselNav">
<template v-for="item in colList">
<div class="font-semibold border-r truncate" :style="item['width'] ? `flex-basis:${item['width']}px` : `flex-grow: 1;`" :key="item['columnCode']" v-if="item['isShow']">
<div class="font-semibold border-r truncate"
:style="item['width'] ? `flex-basis:${item['width']}px` : `flex-grow: 1;`" :key="item['columnCode']"
v-if="item['isShow']">
{{ item['columnName'] }}
</div>
</template>
</div>
<div :style="carouselWrap" class="border border-[#9A82FF] border-t-0" v-loading="isLoading">
<template v-if="patientList['length']">
<el-carousel direction="vertical" :autoplay="false" indicatorPosition="none" ref="carousel" @change="onCarouselChange">
<el-carousel direction="vertical" :autoplay="false" indicatorPosition="none" ref="carousel"
@change="onCarouselChange">
<el-carousel-item v-for="(item, index) in patientList" :key="index">
<section class="carouselItemBox">
<div v-for="(subItem, index) in item" :key="index" :style="carouselItemStyle">
<div class="flex text-center">
<template v-for="item in colList">
<template v-if="item['columnCode'] == 'ProcStatusName'">
<div
class="border-r text-[#333] font-semibold truncate px-3"
<div class="border-r text-[#333] font-semibold truncate px-3"
:style="{ color: `${textToColor(subItem['ProcStatusName'])}`, 'flex-basis': `${item['width']}px` }"
:key="item['columnCode']"
v-if="item['isShow']"
>
:key="item['columnCode']" v-if="item['isShow']">
{{ subItem['ProcStatusName'] }}
</div>
</template>
<template v-else-if="item['columnCode'] == 'IntendedOperationName'">
<div
class="border-r text-[#333] font-semibold truncate px-3"
<div class="border-r text-[#333] font-semibold truncate px-3"
:style="item['width'] ? `flex-basis:${item['width']}px` : `flex-grow: 1;`"
:key="item['columnCode']"
v-if="item['isShow']"
>
<marquee scrollamount="3" class="text-[#333]" :style="carouselItemStyle">{{ subItem['IntendedOperationName'] }}</marquee>
:key="item['columnCode']" v-if="item['isShow']">
<marquee scrollamount="3" class="text-[#333]" :style="carouselItemStyle">{{
subItem['IntendedOperationName'] }}</marquee>
</div>
</template>
<template v-else>
<div
class="border-r text-[#333] font-semibold truncate px-3"
<div class="border-r text-[#333] font-semibold truncate px-3"
:style="item['width'] ? `flex-basis:${item['width']}px` : `flex-grow: 1;`"
:key="item['columnCode']"
v-if="item['isShow']"
>
:key="item['columnCode']" v-if="item['isShow']">
{{ subItem[item['columnCode']] }}
</div>
</template>
@ -74,7 +71,8 @@
<div class="absolute bottom-4 left-1/2 -translate-x-1/2 flex">
<template v-for="(item, index) in patientList">
<div class="w-3 h-3 rounded-full bg-[#D8D8D8] mx-1" :class="{ '!bg-[#8C8D92]': index == activeIndex }" :key="index" />
<div class="w-3 h-3 rounded-full bg-[#D8D8D8] mx-1" :class="{ '!bg-[#8C8D92]': index == activeIndex }"
:key="index" />
</template>
</div>
</main>
@ -90,7 +88,7 @@
</template>
<script>
import { getDynamicTableHeader, getDynamicTableList } from '@/api/publishApi';
import { getDynamicTableHeader, getDynamicTableList, getGlobeConfig } from '@/api/publishApi';
import { Carousel, CarouselItem } from 'element-ui';
import dayjs from 'dayjs';
import { statusToTxt, textToColor } from '@/utils/common';
@ -113,6 +111,8 @@ export default {
getDataTimer: null,
colList: [],
queryCondition: [],
logoUrl: "",
logoUrlBackup: "",
};
},
methods: {
@ -186,10 +186,25 @@ export default {
onCarouselChange(index) {
this.activeIndex = index;
},
onGetblobe() {
getGlobeConfig({ isTree: false }).then(res => {
res['Data']['Item'].forEach(item => {
if (item['Key'] == 'HospitalLogo') {
this.logoUrl = item['Value']
}
if (item['Key'] == "CorporateLogo") {
this.logoUrlBackup = item['Value']
}
})
})
}
},
mounted() {
this.$nextTick(() => {
this.onCalculate();
this.onGetblobe();
//
this.dateTimer = setInterval(() => {
@ -258,14 +273,17 @@ export default {
<style lang="scss" scoped>
:deep(.el-carousel) {
height: 100%;
.el-carousel__container,
.el-carousel__item {
height: 100%;
.carouselItemBox {
> div:nth-child(odd) {
>div:nth-child(odd) {
background: #fff;
}
> div:nth-child(even) {
>div:nth-child(even) {
background: #f5f8ff;
}
}

@ -2,8 +2,9 @@
<section class="waitBox bg-[#F3F2FA]">
<nav
class="h-[11.11vh] pl-[3.7vh] pr-[2.22vh] flex justify-between items-center bg-[#5D49AF] relative overflow-hidden">
<div class="logBox h-[5vh]">
<img class="h-full" src="@/assets/svg/Wait/yongsi-logo.png" />
<div class="logBox h-[7vh]">
<img class="h-full" :src="logoUrl" v-show="logoUrl" />
<img class="h-full" :src="logoUrlBackup" v-show="!logoUrl&&logoUrlBackup" />
</div>
<div class="absolute titleBox w-full flex justify-around">
<div class="flex items-center">
@ -95,7 +96,7 @@
</template>
<script>
import { getDynamicTableHeader, getDynamicTableList } from '@/api/publishApi';
import { getDynamicTableHeader, getDynamicTableList, getGlobeConfig } from '@/api/publishApi';
import { Carousel, CarouselItem } from 'element-ui';
import dayjs from 'dayjs';
import { statusToTxt, textWaitToColor } from '@/utils/common';
@ -127,6 +128,8 @@ export default {
synth: window.speechSynthesis,
colList: [],
queryCondition: [],
logoUrl: "",
logoUrlBackup:""
};
},
methods: {
@ -285,11 +288,26 @@ export default {
return text.charAt(0) + '*';
}
return text.charAt(0) + '*'.repeat(text.length - 2) + text.charAt(text.length - 1);
},
onGetblobe() {
getGlobeConfig({ isTree: false }).then(res => {
res['Data']['Item'].forEach(item => {
if (item['Key'] == 'HospitalLogo') {
this.logoUrl = item['Value']
}
if(item['Key'] == "CorporateLogo") {
this.logoUrlBackup = item['Value']
}
})
})
}
},
mounted() {
this.$nextTick(() => {
this.onCalculate();
this.onGetblobe();
//
this.dateTimer = setInterval(() => {
@ -301,8 +319,6 @@ export default {
}).then(res => {
if (res['Data']['Data']['length']) {
res = res['Data']['Data'][0];
console.log(JSON.parse(res['ReportHeadColumn']));
this.colList = JSON.parse(res['ReportHeadColumn']);
this.queryCondition = JSON.parse(res['QueryCondition']);
}

Loading…
Cancel
Save