update:大屏调整
This commit is contained in:
@@ -22,14 +22,21 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import PublicTitle from '../publicTitle.vue';
|
||||
import { list } from './left.api';
|
||||
import { timeTab, useSpin, useStatistics } from '/@/components/body-d-left/bodyLeftHooks.ts';
|
||||
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';
|
||||
|
||||
const { LEFT_KEY1 } = caching;
|
||||
const props = defineProps({
|
||||
refreshState: {
|
||||
type: Boolean,
|
||||
},
|
||||
});
|
||||
const typeTime = ref(timeTab);
|
||||
const { statistics, setStatistics } = useStatistics();
|
||||
const { statistics, setStatistics, getStatistics } = useStatistics();
|
||||
const selectIndex = ref(0);
|
||||
const selectVal = ref('1');
|
||||
const { setSpin, spinning } = useSpin();
|
||||
@@ -39,6 +46,7 @@
|
||||
});
|
||||
|
||||
const useDetail = useDetailStore();
|
||||
const { setSession, getSession } = useSession();
|
||||
|
||||
async function getList() {
|
||||
setSpin(true);
|
||||
@@ -48,12 +56,21 @@
|
||||
if (code != 200 || !Array.isArray(result)) {
|
||||
return;
|
||||
}
|
||||
setStatistics(result[0]);
|
||||
let { alerdyreceive = '', totalacceptance = '' } = result[0];
|
||||
setSession(LEFT_KEY1, JSON.stringify(result[0]));
|
||||
setValue(result[0]);
|
||||
} catch {
|
||||
const result = JSON.parse(getSession(LEFT_KEY1));
|
||||
setValue(result);
|
||||
setSpin(false);
|
||||
}
|
||||
}
|
||||
|
||||
function setValue(result) {
|
||||
let { alerdyreceive = '', totalacceptance = '' } = result;
|
||||
setStatistics(result);
|
||||
if (alerdyreceive || totalacceptance) {
|
||||
useDetail.setAlerdyreceive(alerdyreceive);
|
||||
useDetail.setTotalacceptance(totalacceptance);
|
||||
} catch {
|
||||
setSpin(!spinning.value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,6 +79,13 @@
|
||||
selectVal.value = value;
|
||||
getList();
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.refreshState,
|
||||
() => {
|
||||
getList();
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.inner {
|
||||
|
||||
Reference in New Issue
Block a user