|
@@ -11,15 +11,14 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
-import { ref, onMounted, onBeforeUnmount, Ref, unref, watch, computed } from 'vue'
|
|
|
|
import * as echarts from 'echarts'
|
|
import * as echarts from 'echarts'
|
|
|
|
+import { Ref, computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
|
import { productListMetricsEnum } from '/@/views/productCenter/productList/utils/enum'
|
|
import { productListMetricsEnum } from '/@/views/productCenter/productList/utils/enum'
|
|
// import MetricsCards from '/@/components/MetricsCards/index.vue'
|
|
// import MetricsCards from '/@/components/MetricsCards/index.vue'
|
|
-import MetricsCards from '../MetricsCards/index.vue'
|
|
|
|
import XEUtils from 'xe-utils'
|
|
import XEUtils from 'xe-utils'
|
|
-import { buildChartOpt, parseQueryParams } from '/@/views/adManage/utils/tools.js'
|
|
|
|
|
|
+import MetricsCards from '../MetricsCards/index.vue'
|
|
import emitter from '/@/utils/emitter'
|
|
import emitter from '/@/utils/emitter'
|
|
-
|
|
|
|
|
|
+import { buildChartOpt, parseQueryParams } from '/@/views/adManage/utils/tools.js'
|
|
|
|
|
|
defineOptions({
|
|
defineOptions({
|
|
name: 'DataTendencyChart',
|
|
name: 'DataTendencyChart',
|
|
@@ -281,24 +280,23 @@ const changeMetric = () => {
|
|
|
|
|
|
const emit = defineEmits(['changeStatDim'])
|
|
const emit = defineEmits(['changeStatDim'])
|
|
const changeStatDim = async () => {
|
|
const changeStatDim = async () => {
|
|
- emitter.emit('DateTendency-changeStatDim') // 触发DataTable的loading
|
|
|
|
|
|
+ emitter.emit('DateTendency-changeStatDim') // 触发DataTable的loading
|
|
loading.value = true
|
|
loading.value = true
|
|
let source = await getDataset()
|
|
let source = await getDataset()
|
|
if (source.length > 0) {
|
|
if (source.length > 0) {
|
|
chartObj.setOption({ dataset: { source: source } })
|
|
chartObj.setOption({ dataset: { source: source } })
|
|
}
|
|
}
|
|
loading.value = false
|
|
loading.value = false
|
|
- emit('changeStatDim', source) // 向父组件传递数据后再传递给DataTable
|
|
|
|
|
|
+ emit('changeStatDim', source) // 向父组件传递数据后再传递给DataTable
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
watch(props.query, async () => {
|
|
watch(props.query, async () => {
|
|
// console.log("------watch-----queryParams", props.query)
|
|
// console.log("------watch-----queryParams", props.query)
|
|
- emitter.emit('DateTendency-changeStatDim') // 触发DataTable的loading
|
|
|
|
|
|
+ emitter.emit('DateTendency-changeStatDim') // 触发DataTable的loading
|
|
loading.value = true
|
|
loading.value = true
|
|
await getMetricsItems()
|
|
await getMetricsItems()
|
|
const items = await getDataset()
|
|
const items = await getDataset()
|
|
- emit('changeStatDim', items) // 向父组件传递数据后再传递给DataTable
|
|
|
|
|
|
+ emit('changeStatDim', items) // 向父组件传递数据后再传递给DataTable
|
|
const opt = { dataset: { source: items } }
|
|
const opt = { dataset: { source: items } }
|
|
chartObj.setOption(opt)
|
|
chartObj.setOption(opt)
|
|
loading.value = false
|
|
loading.value = false
|