<template>
  <BasicModal v-bind="$attrs" @register="registerModal"  :centered="true" destroyOnClose :title="title" :width="1000">
    <vxe-grid v-bind="gridOptions">
        
    </vxe-grid>
  </BasicModal>
</template>

<script lang="ts" setup>
    import {ref, computed, reactive} from 'vue';
    import {BasicModal, useModalInner} from '/@/components/Modal';
    import {defHttp} from '/@/utils/http/axios';
    import type { VxeGridProps } from 'vxe-table'
    import { render } from '/@/utils/common/renderUtils';

    const title = ref("")

    const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
        title.value = "修改历史[" + data.record.mtrcNo +"]"
        let params = {mtrcNo:data.record.mtrcNo}
        gridOptions.data =  await defHttp.get({url: "/metric/metricMonitorSetHistory/findHistoryByMetricNo", params});

    });



    const gridOptions = reactive<VxeGridProps<any>>({
        columns: [
            { type: 'seq', width: 70 },
            { field: 'mtrcName', title: '指标名称'},
            { field: 'mtrcNo', title: '编码'},
            { field: 'domainNo', title: '领域'},
            { field: 'collMethod', title: '采集方法'},
            { field: 'mtrcTp', title: '是否统计'},
            { field: 'tolVal', title: '低风险'},
            { field: 'warnVal', title: '中风险'},
            { field: 'intvVal', title: '高风险'},
            { field: 'collFreq', title: '监测频率'},
            { field: 'des', title: '指标说明'},
        ],
        data:[]
    })
  
</script>

<style lang="less" scoped>
  :deep(.ant-input-number){
		width: 100%
	}

	:deep(.ant-calendar-picker){
		width: 100%
	}
</style>