Merge remote-tracking branch 'origin/main'

This commit is contained in:
牛子源 2025-05-22 10:35:41 +08:00
commit 6a6bcc13e7
4 changed files with 103 additions and 41 deletions

View File

@ -37,9 +37,8 @@
alt="头像"/>
</span>
<span class="item-name">{{ item.name }}</span>
<span class="item-age">{{ item.age || 0 }}</span>
<span class="item-time">
{{ formatListTime(item.createDatetime) || '-' }}
{{ formatListTime(item.createDatetime)}}
</span>
<span class="item-type">{{ item.type == 2 ? '医保' : '自费' }}</span>
</li>
@ -51,7 +50,7 @@
</template>
<script setup lang="ts">
import {nextTick, onMounted, ref, watch} from "vue";
import {onMounted, ref, watch, onUnmounted} from "vue";
import Panel from "@/components/common/Panel.vue";
import {post} from "@/utils/request.ts";
import {formatListTime, getToday, getThisMonth, getCurrentDate, getEndOfDay} from "@/utils/dateUtils.ts";
@ -95,13 +94,49 @@ const statusList = ref<any>([
}
])
const itemId = defineModel()
let refreshInterval: number | null = null; //
onMounted(() => {
selectedDate.value = getCurrentDate()
initStatusList()
if (curStatus.value == 1) {
init()
}
//
refreshInterval = setInterval(() => {
initList()
}, 1000); // 10001
})
onUnmounted(() => {
//
if (refreshInterval !== null) {
clearInterval(refreshInterval);
refreshInterval = null;
}
});
const initList = async () => {
selectedDateStr.value = setDateTip()
try {
let data: any = await post(apiConfig.RegistrationList, {
query: {
status: curStatus.value,
beginTime: selectedDate.value,
endTime: getEndOfDay(new Date(selectedDate.value))
}
}, {catch_error: true});
list.value = data.list
if (itemId.value != null) {
list.value.forEach((item: any, index: any) => {
if (item.id == itemId.value && curStatus.value == 2) {
clickLi(item, false)
}
})
}
} catch (e) {
} finally {
}
initStatusList()
}
const loading = ref(true)
const init = async () => {
selectedDateStr.value = setDateTip()
@ -275,8 +310,8 @@ watch(() => selectedDate.value, (newValue, oldValue) => {
.list-item {
height: 48px;
display: flex;
padding: 0 26px 0 28px;
font-weight: 400;
padding: 0 16px;
font-size: 14px;
color: rgba(34, 42, 57, 0.7);
font-style: normal;
@ -308,16 +343,14 @@ watch(() => selectedDate.value, (newValue, oldValue) => {
text-overflow: ellipsis; //
}
.item-age {
width: 40px;
}
.item-time {
width: 80px;
width: 40px;
font-size: 12px;
}
.item-type {
width: 40px;
font-size: 12px;
}
&:hover {

View File

@ -9,7 +9,7 @@
label-width="auto"
:rules="rules"
ref="form"
style="height: 100%;width: 100%"
style="flex: 1;width: 100%"
>
<el-descriptions
border

View File

@ -26,8 +26,8 @@
:src="'/static/images/member/' + (item.sex === 1 ? 'man' : 'women') + '.png'"
alt=""/>
</span>
<span class="item-name">{{ item.name || '-' }}</span>
<span class="item-level">{{ item.levelName || "-" }}</span>
<span class="item-name">{{ item.name }}</span>
<span class="item-level">{{ item.levelName }}</span>
<span class="item-time">{{ formatListTime(item.lastVisitTime) }}</span>
</li>
</el-scrollbar>
@ -459,21 +459,25 @@ const openFlowingWater = () => {
padding: 0 24px;
color: #000000;
cursor: pointer;
span {
text-align: center;
height: 100%;
display: block;
}
.item-avatar {
width: 20px;
height: 100%;
margin-right: 10px;
.image {
margin-top: 15px;
width: 20px;
height: 20px;
}
}
.item-name {
flex: 1;
min-width: 0;
@ -482,9 +486,12 @@ const openFlowingWater = () => {
text-overflow: ellipsis;
text-align: left;
}
.item-level {
width: 50px;
font-size: 12px;
}
.item-time {
width: 50px;
font-size: 12px;
@ -493,6 +500,17 @@ const openFlowingWater = () => {
&:hover {
background: rgba(#4D6DE4, 0.5);
.item-name {
color: #fff;
}
.item-level {
color: #fff;
}
.item-time {
color: #fff;
}
}
}
@ -500,15 +518,15 @@ const openFlowingWater = () => {
background: #4D6DE4;
color: #fff;
.name {
.item-name {
color: #fff;
}
.level {
.item-level {
color: #fff;
}
.time {
.item-time {
color: #fff;
}
}
@ -550,6 +568,7 @@ const openFlowingWater = () => {
flex-direction: column;
justify-content: center;
margin-right: 24px;
.detail-top-left-text-name {
flex: 1;
min-width: 0;
@ -558,6 +577,7 @@ const openFlowingWater = () => {
color: #333333;
font-style: normal;
display: flex;
.name {
white-space: nowrap; /* 防止文本换行 */
overflow: hidden; /* 隐藏溢出的文本 */

View File

@ -24,7 +24,6 @@
</div>
</div>
<div class="middel">
<span class="default-btn" v-loading="syncCacheLoading" @click="syncCache">同步缓存</span>
</div>
<div class="op_btn">
<el-dropdown placement="bottom">
@ -35,6 +34,7 @@
<el-dropdown-item @click="openUpdateBox(1312)">有效期更新</el-dropdown-item>
<el-dropdown-item @click="openUpdateBox(1318)">限价信息更新</el-dropdown-item>
<el-dropdown-item @click="openUpdateBox(1319)">自付比例更新</el-dropdown-item>
<el-dropdown-item @click="openSynchronizedCacheBox()">同步缓存</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
@ -146,6 +146,16 @@
</div>
</div>
</Mask>
<Mask :is-show="isSynchronizedCacheBox" :width="540" :height="347" title="同步缓存" @close="close">
<div style="height:100%;padding: 24px">
<div class="updateDirectory">
<div class="updateDirectory-message">{{ tip_message }}</div>
<div class="demo-progress">
<el-progress :text-inside="true" :stroke-width="30" :percentage="percent"/>
</div>
</div>
</div>
</Mask>
</div>
</template>
@ -373,15 +383,10 @@ const update1319 = (current_page: number) => {
}
const syncCachePage = ref<any>(1)
const syncCacheTotalPage = ref<any>(0)
const syncCacheLoading=ref(false)
const isSynchronizedCacheBox = ref(false)
const syncCache = () => {
if (syncCachePage.value == 1) {
syncCacheLoading.value = true
ElNotification({
title: '提示',
message: "正在同步,请稍后......",
type: 'warning',
})
tip_message.value = "开始同步第一页";
}
post("social/directory/syncToMongo", {page: syncCachePage.value}).then((res: any) => {
if (res.total_page) {
@ -389,17 +394,21 @@ const syncCache = () => {
}
if (syncCachePage.value <= syncCacheTotalPage.value) {
syncCachePage.value++
tip_message.value = "正在同步目录,以同步" + syncCachePage.value + "/" + syncCacheTotalPage.value + "页,请不要强制关闭程序,否则数据不完整";
percent.value = Math.floor((syncCachePage.value / syncCacheTotalPage.value) * 100)
syncCache()
} else {
syncCacheLoading.value = false
ElNotification({
title: '提示',
message: "同步完成",
type: 'success',
})
tip_message.value = "同步完成";
isSynchronizedCacheBox.value = false
}
})
}
const openSynchronizedCacheBox = () => {
tip_message.value = "";
percent.value = 0
isSynchronizedCacheBox.value = true
syncCache()
}
</script>
<style scoped lang="scss">