|
@@ -10,88 +10,91 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref, onMounted, reactive } from 'vue';
|
|
|
-import { sceneTotal, sceneTrend } from '/@/api/statistics/index';
|
|
|
-import { GrowCardItem } from '../data';
|
|
|
-import GrowCard from '../components/GrowCard.vue';
|
|
|
-import sceneEchart from '../components/sceneEchart.vue';
|
|
|
-const loading = ref(true);
|
|
|
-const growCardList = ref<GrowCardItem[]>([]);
|
|
|
-const echartData = reactive({
|
|
|
- xdata: [],
|
|
|
- kjList:[],
|
|
|
- kkList:[],
|
|
|
- ssList:[],
|
|
|
- ssobjList:[],
|
|
|
-});
|
|
|
-const SearchData = reactive({
|
|
|
- startTime: '',
|
|
|
- endTime: '',
|
|
|
- dataType: 0,
|
|
|
- type: 2,
|
|
|
-});
|
|
|
-onMounted(() => {
|
|
|
- getData();
|
|
|
- getList();
|
|
|
-});
|
|
|
-async function getList() {
|
|
|
- let downlist = [],
|
|
|
- xdata = [];
|
|
|
- const {kjList,kkList,ssList,ssobjList} = await sceneTrend(SearchData);
|
|
|
- kjList.map((ele) => {
|
|
|
- xdata.push(ele.groupKey);
|
|
|
- downlist.push(ele.count);
|
|
|
+ import { ref, onMounted, reactive } from 'vue';
|
|
|
+ import { sceneTotal, sceneTrend } from '/@/api/statistics/index';
|
|
|
+ import { GrowCardItem } from '../data';
|
|
|
+ import GrowCard from '../components/GrowCard.vue';
|
|
|
+ import sceneEchart from '../components/sceneEchart.vue';
|
|
|
+ const loading = ref(true);
|
|
|
+ const growCardList = ref<GrowCardItem[]>([]);
|
|
|
+ const echartData = reactive({
|
|
|
+ xdata: [],
|
|
|
+ kjList: [],
|
|
|
+ kkList: [],
|
|
|
+ ssList: [],
|
|
|
+ ssobjList: [],
|
|
|
+ sgList: [],
|
|
|
+ sgobjList: [],
|
|
|
});
|
|
|
- echartData.xdata = xdata;
|
|
|
- echartData.kjList = downlist
|
|
|
- echartData.kkList = kkList.map(ele => ele.count)
|
|
|
- echartData.ssList = ssList &&ssList.map(ele => ele.count)|| []
|
|
|
- echartData.ssobjList = ssobjList.map(ele => ele.count)|| []
|
|
|
-}
|
|
|
-function Search(val) {
|
|
|
- const { startTime, endTime, dataType, type } = val;
|
|
|
- console.log('params', val);
|
|
|
- SearchData.startTime = startTime;
|
|
|
- SearchData.endTime = endTime;
|
|
|
- SearchData.dataType = type;
|
|
|
- SearchData.type = dataType;
|
|
|
- getList();
|
|
|
-}
|
|
|
-async function getData() {
|
|
|
- try {
|
|
|
- loading.value = true;
|
|
|
- const { totalSceneCount = 0, preMonthAddCount = 0, todayAddCount = 0 } = await sceneTotal();
|
|
|
- let list: GrowCardItem[] = [
|
|
|
- {
|
|
|
- title: '累计场景数量',
|
|
|
- icon: 'fxemoji:notchedrightsemi3dot',
|
|
|
- value: totalSceneCount,
|
|
|
- unit: '个',
|
|
|
- color: 'green',
|
|
|
- action: '年',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '上月新增场景数量',
|
|
|
- icon: 'download-count|svg',
|
|
|
- value: preMonthAddCount,
|
|
|
- unit: '个',
|
|
|
- color: 'blue',
|
|
|
- action: '月',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '今日新增场景数量',
|
|
|
- icon: 'transaction|svg',
|
|
|
- value: todayAddCount,
|
|
|
- unit: '个',
|
|
|
- color: 'orange',
|
|
|
- action: '日',
|
|
|
- },
|
|
|
- ];
|
|
|
- loading.value = false;
|
|
|
- growCardList.value = list;
|
|
|
- } catch (error) {
|
|
|
- loading.value = false;
|
|
|
+ const SearchData = reactive({
|
|
|
+ startTime: '',
|
|
|
+ endTime: '',
|
|
|
+ dataType: 0,
|
|
|
+ type: 2,
|
|
|
+ });
|
|
|
+ onMounted(() => {
|
|
|
+ getData();
|
|
|
+ getList();
|
|
|
+ });
|
|
|
+ async function getList() {
|
|
|
+ let downlist = [],
|
|
|
+ xdata = [];
|
|
|
+ const { kjList, kkList, ssList, ssobjList, sgList, sgobjList } = await sceneTrend(SearchData);
|
|
|
+ kjList.map((ele) => {
|
|
|
+ xdata.push(ele.groupKey);
|
|
|
+ downlist.push(ele.count);
|
|
|
+ });
|
|
|
+ echartData.xdata = xdata;
|
|
|
+ echartData.kjList = downlist;
|
|
|
+ echartData.kkList = kkList.map((ele) => ele.count);
|
|
|
+ echartData.ssList = (ssList && ssList.map((ele) => ele.count)) || [];
|
|
|
+ echartData.ssobjList = ssobjList.map((ele) => ele.count) || [];
|
|
|
+ echartData.sgList = (sgList && sgList.map((ele) => ele.count)) || [];
|
|
|
+ echartData.sgobjList = sgobjList.map((ele) => ele.count) || [];
|
|
|
+ }
|
|
|
+ function Search(val) {
|
|
|
+ const { startTime, endTime, dataType, type } = val;
|
|
|
+ console.log('params', val);
|
|
|
+ SearchData.startTime = startTime;
|
|
|
+ SearchData.endTime = endTime;
|
|
|
+ SearchData.dataType = type;
|
|
|
+ SearchData.type = dataType;
|
|
|
+ getList();
|
|
|
+ }
|
|
|
+ async function getData() {
|
|
|
+ try {
|
|
|
+ loading.value = true;
|
|
|
+ const { totalSceneCount = 0, preMonthAddCount = 0, todayAddCount = 0 } = await sceneTotal();
|
|
|
+ let list: GrowCardItem[] = [
|
|
|
+ {
|
|
|
+ title: '累计场景数量',
|
|
|
+ icon: 'fxemoji:notchedrightsemi3dot',
|
|
|
+ value: totalSceneCount,
|
|
|
+ unit: '个',
|
|
|
+ color: 'green',
|
|
|
+ action: '年',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '上月新增场景数量',
|
|
|
+ icon: 'download-count|svg',
|
|
|
+ value: preMonthAddCount,
|
|
|
+ unit: '个',
|
|
|
+ color: 'blue',
|
|
|
+ action: '月',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '今日新增场景数量',
|
|
|
+ icon: 'transaction|svg',
|
|
|
+ value: todayAddCount,
|
|
|
+ unit: '个',
|
|
|
+ color: 'orange',
|
|
|
+ action: '日',
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ loading.value = false;
|
|
|
+ growCardList.value = list;
|
|
|
+ } catch (error) {
|
|
|
+ loading.value = false;
|
|
|
+ }
|
|
|
}
|
|
|
-}
|
|
|
</script>
|
|
|
-
|