Commit 99d52dedf753a2c1e2d00e5a0d87a6e72d1871f8

Authored by 房远帅
1 parent 20dfcc4c

凯盛:默认报表进去查询-按月-累计值

@@ -51,6 +51,10 @@ const props = defineProps({ @@ -51,6 +51,10 @@ const props = defineProps({
51 chartType: { 51 chartType: {
52 type: Number, 52 type: Number,
53 default: 0 53 default: 0
  54 + },
  55 + defaultActive: {
  56 + type: Number,
  57 + default: undefined
54 } 58 }
55 }) 59 })
56 const timerData: any = computed(() => { 60 const timerData: any = computed(() => {
@@ -76,7 +80,9 @@ const timerData: any = computed(() => { @@ -76,7 +80,9 @@ const timerData: any = computed(() => {
76 }) 80 })
77 const emits = defineEmits(['change']) 81 const emits = defineEmits(['change'])
78 // 选择的日期单位 82 // 选择的日期单位
79 -const extraActive = ref<string | number | boolean>(props.chartType == 16 || props.chartType == 15? 2 : (props.dateUnit.length < 3 ? 1 : 0)) 83 +const extraActive = ref<string | number | boolean>(
  84 + props.defaultActive ?? (props.chartType == 16 || props.chartType == 15 ? 2 : (props.dateUnit.length < 3 ? 1 : 0))
  85 +)
80 // const extraActive = ref<string | number | boolean>(1) 86 // const extraActive = ref<string | number | boolean>(1)
81 // 日期选择器 - 值 87 // 日期选择器 - 值
82 const pickerVal = ref<any>(extraActive.value == 0 ? dayjs().format("YYYY-MM-DD") : extraActive.value == 1 ? dayjs().format("YYYY-MM") : dayjs().format("YYYY")) 88 const pickerVal = ref<any>(extraActive.value == 0 ? dayjs().format("YYYY-MM-DD") : extraActive.value == 1 ? dayjs().format("YYYY-MM") : dayjs().format("YYYY"))
@@ -22,13 +22,14 @@ @@ -22,13 +22,14 @@
22 </a-tabs> 22 </a-tabs>
23 <a-space> 23 <a-space>
24 <time-bar @change="timeChange" is-current-date-disabled 24 <time-bar @change="timeChange" is-current-date-disabled
  25 + :default-active="1"
25 :date-unit="props.reportType === 2 ? ['month','year']: ['day','month','year']"/> 26 :date-unit="props.reportType === 2 ? ['month','year']: ['day','month','year']"/>
26 <a-select v-model="searchForm.changeType" :style="{width:'220px'}" placeholder="请选择" 27 <a-select v-model="searchForm.changeType" :style="{width:'220px'}" placeholder="请选择"
27 v-if="props.reportType === 1 && timeParams.timeUnit !== 0"> 28 v-if="props.reportType === 1 && timeParams.timeUnit !== 0">
  29 + <a-option value="5">累计值</a-option>
28 <a-option value="2">平均值</a-option> 30 <a-option value="2">平均值</a-option>
29 <a-option value="3">最小值</a-option> 31 <a-option value="3">最小值</a-option>
30 <a-option value="4">最大值</a-option> 32 <a-option value="4">最大值</a-option>
31 - <a-option value="5">累计值</a-option>  
32 </a-select> 33 </a-select>
33 <a-checkbox v-model="searchForm.isCharge" v-if="reportType === 2">电费</a-checkbox> 34 <a-checkbox v-model="searchForm.isCharge" v-if="reportType === 2">电费</a-checkbox>
34 <a-button type="primary" @click="fetchTableData"> 35 <a-button type="primary" @click="fetchTableData">
@@ -100,7 +101,7 @@ const tableInfo: any = ref({ @@ -100,7 +101,7 @@ const tableInfo: any = ref({
100 101
101 const searchForm = ref({ 102 const searchForm = ref({
102 templateId: '', 103 templateId: '',
103 - changeType: '', 104 + changeType: '5',
104 isFengGuData: props.reportType !== 1, 105 isFengGuData: props.reportType !== 1,
105 isCharge: false 106 isCharge: false
106 }) 107 })
@@ -117,9 +118,9 @@ const tabsChange = (key: any) => { @@ -117,9 +118,9 @@ const tabsChange = (key: any) => {
117 */ 118 */
118 const timeChange = (time: any) => { 119 const timeChange = (time: any) => {
119 timeParams.value = time; 120 timeParams.value = time;
120 - searchForm.value.changeType = ''; 121 + searchForm.value.changeType = '5';
121 if (time.timeUnit !== 0) { 122 if (time.timeUnit !== 0) {
122 - searchForm.value.changeType = '2'; 123 + searchForm.value.changeType = '5';
123 } 124 }
124 } 125 }
125 /** 126 /**