update: 新疆大屏

This commit is contained in:
xf
2025-07-06 15:04:39 +08:00
parent 22c5b89f90
commit 86ed8341e2
30 changed files with 984 additions and 151 deletions
+62 -8
View File
@@ -3,16 +3,16 @@
<div class="title"> 服务详情数据 </div>
<div class="content">
<div class="type-time">
<div @click="clickChooseType('0')" :class="[chooseType === '0' ? 'selected' : 'no-selected']">
<div @click="clickChooseType('4')" :class="[chooseType === '4' ? 'selected' : 'no-selected']">
本周
<div>
<div v-if="chooseType === '0'" class="triangle"></div>
<div v-if="chooseType === '4'" class="triangle"></div>
</div>
</div>
<div @click="clickChooseType('1')" :class="[chooseType === '1' ? 'selected' : 'no-selected']">
<div @click="clickChooseType('3')" :class="[chooseType === '3' ? 'selected' : 'no-selected']">
本月
<div>
<div v-if="chooseType === '1'" class="triangle"></div>
<div v-if="chooseType === '3'" class="triangle"></div>
</div>
</div>
<div @click="clickChooseType('2')" :class="[chooseType === '2' ? 'selected' : 'no-selected']">
@@ -23,25 +23,79 @@
</div>
</div>
<div class="server-container">
<div v-for="(item, index) in statistics" class="server-item" :key="index">
<div
v-for="(item, index) in statistics"
:class="[['gross', 'alerdyreceive'].includes(item.key) ? 'hasCursor' : '']"
class="server-item"
:key="index"
@click="handleClick(item)"
>
<span>{{ item?.name }}</span>
<span>{{ item?.value }}123</span>
<span>{{ item?.value }}</span>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { computed, ref, watch } from 'vue';
import { useStatistics } from '/@/components/body-d-left/bodyLeftHooks.ts';
import { statisticsNewApi } from '/@/views/indexSun/indexSun.api.ts';
import { caching, useSession } from '/@/hooks/autoRefresh/caching.ts';
import { useDetailStore } from '/@/store/modules/detailData.ts';
const chooseType = ref('0');
const { LEFT_KEY1 } = caching;
const props = defineProps({
centerId: {
type: String,
default: () => '',
},
});
const useDetail = useDetailStore();
const emit = defineEmits(['handleClick']);
const chooseType = ref('4');
const { statistics, setStatistics, getStatistics } = useStatistics();
const { setSession, getSession } = useSession();
watch(props, () => {
getOneLeftInfo();
});
watch(
() => chooseType.value,
() => {
getOneLeftInfo();
}
);
async function getOneLeftInfo() {
const params = {
condition: chooseType.value,
centerId: props.centerId,
};
statisticsNewApi(params).then((res) => {
console.log(res);
if (res.code != 200 || !res.result) {
return;
}
setSession(LEFT_KEY1, JSON.stringify(res.result));
setValue(res.result);
});
}
function setValue(result) {
let { alerdyreceive = '', totalacceptance = '' } = result;
setStatistics(result);
if (alerdyreceive || totalacceptance) {
useDetail.setAlerdyreceive(alerdyreceive);
useDetail.setTotalacceptance(totalacceptance);
}
}
function clickChooseType(index) {
if (chooseType.value === index) return;
chooseType.value = index;
}
function handleClick(item) {
emit('handleClick', item);
}
</script>
<style lang="less" scoped>
.one-l-box {