|
|
@@ -74,7 +74,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
- import { ref, onMounted, reactive } from 'vue';
|
|
|
+ import { ref, reactive } from 'vue';
|
|
|
import dayjs from 'dayjs';
|
|
|
import { Select, SelectOption, Row, Col, DatePicker, Button } from 'ant-design-vue';
|
|
|
import MineCascader from '@/components/Form/src/jeecg/components/MineCascader/MineCascader.vue';
|
|
|
@@ -83,8 +83,8 @@
|
|
|
import echartContent from './components/echart-content.vue';
|
|
|
import echartDivder from './components/echart-divder.vue';
|
|
|
import { getGoafHistory } from './connectAnalysis.api';
|
|
|
- import { useRouter } from 'vue-router';
|
|
|
- import { useMineDepartmentStore } from '/@/store/modules/mine';
|
|
|
+ // import { useRouter } from 'vue-router';
|
|
|
+ // import { useMineDepartmentStore } from '/@/store/modules/mine';
|
|
|
import { SvgIcon } from '/@/components/Icon';
|
|
|
import { useInitForm } from './hooks/form';
|
|
|
|
|
|
@@ -92,20 +92,25 @@
|
|
|
|
|
|
// 组件注册
|
|
|
const RangePicker: any = DatePicker.RangePicker;
|
|
|
- const { currentRoute } = useRouter();
|
|
|
+ // const { currentRoute } = useRouter();
|
|
|
// 筛选相关响应式数据
|
|
|
const dateRange = ref([dayjs().add(-30, 'day'), dayjs()]); // 默认时间范围(近1天)
|
|
|
- const mineStore = useMineDepartmentStore();
|
|
|
+ // const mineStore = useMineDepartmentStore();
|
|
|
const checkList = ref<any[]>(['coVal', 'ch4Val', 'c2h4Val', 'c2h2Val', 'co2Val', 'o2Val', 'sourcePressure', 'temperature']); //当前选中要进行显示的选项
|
|
|
const echartData = reactive({
|
|
|
xData: [] as any,
|
|
|
yData: [] as any,
|
|
|
+ flag: true,
|
|
|
});
|
|
|
|
|
|
//煤矿选项切换
|
|
|
function changeCascader(val) {
|
|
|
innerValue.value = val;
|
|
|
- initGoafOptions(val);
|
|
|
+ initGoafOptions(val).then(() => {
|
|
|
+ if (echartData.flag) {
|
|
|
+ generateChart();
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
//时间选择选项切换
|
|
|
function changeTime(val) {
|
|
|
@@ -121,6 +126,7 @@
|
|
|
// 生成折线图核心逻辑
|
|
|
async function generateChart() {
|
|
|
echartData.yData.length = 0;
|
|
|
+ echartData.flag = false;
|
|
|
let startTime = dateRange.value[0].format('YYYY-MM-DD HH:mm:ss');
|
|
|
let endTime = dateRange.value[1].format('YYYY-MM-DD HH:mm:ss');
|
|
|
let res = await getGoafHistory({ pageNo: 1, pageSize: 1000, startTime: startTime, endTime: endTime, goafId: goafId.value });
|
|
|
@@ -154,16 +160,7 @@
|
|
|
// goafId.value = goafOption.value.length ? (goafId.value ? goafId.value : goafOption.value[0]['value']) : '';
|
|
|
// }
|
|
|
|
|
|
- onMounted(async () => {
|
|
|
- const mineCode = currentRoute.value['query']['mineCode']; //传递过来的矿ID
|
|
|
- if (mineCode) {
|
|
|
- innerValue.value = mineCode as any;
|
|
|
- } else {
|
|
|
- innerValue.value = mineStore.getMineCode.split(',')[0];
|
|
|
- console.log(innerValue.value, 'innerValue.value');
|
|
|
- await generateChart();
|
|
|
- }
|
|
|
- });
|
|
|
+ generateChart();
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|