update 调整大屏各个模块参数及样式

This commit is contained in:
zk
2024-05-16 15:53:04 +08:00
parent adca7ae65e
commit 45aec85fad
12 changed files with 238 additions and 89 deletions
+29 -11
View File
@@ -12,7 +12,13 @@
>
</div>
<div class="server-container">
<div v-for="(item, index) in statistics" :key="index" class="server-item">
<div
v-for="(item, index) in statistics"
:key="index"
class="server-item"
:class="['gross', 'alerdyreceive'].includes(item.key) ? 'hasCursor' : ''"
@click="handleClick(item)"
>
<span>{{ item?.name }}</span>
<span>{{ item?.value }}</span>
</div>
@@ -23,8 +29,8 @@
</template>
<script setup lang="ts">
import { onMounted, ref, watch } from 'vue';
import PublicTitle from '../publicTitle.vue';
import { list } from './left.api';
import PublicTitle from '/@/components/publicTitle.vue';
import { list } from '/@/components/body-d-left/left.api';
import { allValueEmpty, timeTab, useSpin, useStatistics } from '/@/components/body-d-left/bodyLeftHooks.ts';
import { useDetailStore } from '/@/store/modules/detailData.ts';
import { useSession, caching } from '/@/hooks/autoRefresh/caching.ts';
@@ -34,11 +40,15 @@
refreshState: {
type: Boolean,
},
setting: {
type: Object,
},
});
const emit = defineEmits(['handleClick']);
const typeTime = ref(timeTab);
const { statistics, setStatistics, getStatistics } = useStatistics();
const selectIndex = ref(0);
const selectVal = ref('1');
const selectVal = ref('2'); //本年
const { setSpin, spinning } = useSpin();
onMounted(() => {
@@ -51,17 +61,17 @@
async function getList() {
setSpin(true);
try {
const { code, result } = (await list({ condition: selectVal.value })) || {};
setSpin(!spinning.value);
if (code != 200 || !Array.isArray(result)) {
const { code, result } = (await list({ condition: selectVal.value, dataType: props.setting.dataType })) || {};
setSpin(false);
if (code != 200 || !result) {
return;
}
setSession(LEFT_KEY1, JSON.stringify(result[0]));
setValue(result[0]);
setSession(LEFT_KEY1, JSON.stringify(result));
setValue(result);
} catch {
setSpin(false);
const result = JSON.parse(getSession(LEFT_KEY1));
setValue(result);
setSpin(false);
}
}
@@ -80,6 +90,10 @@
getList();
}
function handleClick(item) {
emit('handleClick', item);
}
watch(
() => props.refreshState,
() => {
@@ -110,6 +124,10 @@
font-size: 16px;
padding: 6px 0;
&.hasCursor {
cursor: pointer;
}
span {
display: inline-block;
width: 50%;
@@ -131,4 +149,4 @@
}
}
}
</style>
</style>