<template>
  <el-dialog v-model="modelValue" title="合并详情" width="1500px" @close="handleClose">
    <div style="width:100%">
        <MyTable
            :tableData="pageForm.tableData"
            :tableColumn="pageForm.tableColumn"
            :tableHeight="pageForm.tableHeight"
            :key="pageForm.keyCount"
            :tableConfiger="pageForm.tableConfiger"
            :controlsWidth="pageForm.controlsWidth"
        >
            <template #xlLx="{row}">
                <DictTag :tag="false" :value="row.xlLx" :options="props.dic.D_GS_XS_LX" />
            </template>
            <template #qbLy="{row}">
                <DictTag :tag="false" :value="row.qbLy" :options="props.dic.D_GS_XS_LY" />
            </template>
            <template #czzt="{row}">
                <DictTag :tag="false" :value="row.czzt" :options="props.dic.D_GS_XS_CZZT" />
            </template>
            <template #shzt="{row}">
                <DictTag :tag="false" :value="row.shzt" :options="props.dic.D_BZ_XSSHZT" />
            </template>
            <template #qtlx="{row}">
                <DictTag :tag="false" :value="row.qtlx" :options="props.dic.D_GS_XS_QTLX" />
            </template>
        </MyTable>
    </div>
    </el-dialog>
</template>

<script setup>
import { qcckGet } from "@/api/qcckApi.js";
import MyTable from "@/components/aboutTable/MyTable.vue";
import { defineProps,defineEmits, reactive, watch} from 'vue';
const props = defineProps({
    modelValue:{
        type:Boolean,
        default:false
    },
    dic:{
        type:Object,
        default:{}
    },
    id:{
        type:String,
        default:''
    },
})
const pageForm = reactive({
  tableData: [],
  keyCount: 0,
  tableConfiger: {
    rowHieght: 61,
    showSelectType: "null",
    loading: false,
    haveControls:false
  },
  tableHeight:600,
  tableColumn: [
    { label: "线索编号", prop: "xsBh" },
    { label: "线索名称", prop: "xsMc" },
    { label: "线索来源", prop: "qbLy",showSolt:true  },
    { label: "开始时间", prop: "zxkssj" },
    { label: "截至时间", prop: "zxjssj" },
    { label: "指向地点", prop: "zxdz" },
    { label: "线索内容", prop: "xsNr" },
    { label: "群体类型", prop: "qtlx",showSolt:true  },
    { label: "群体名称", prop: "qtmc" },
    { label: "上报单位", prop: "ssbm" },
    { label: "上报时间", prop: "sxsbsj" },
    { label: "涉及人数", prop: "sjrs" },
    { label: "附件", prop: "fjdz",showSolt: true},
    { label: "处置状态", prop: "czzt",showSolt: true},
    { label: "状态", prop: "shzt",showSolt: true },
  ]
});
const emits = defineEmits(["update:modelValue"]);

const getList = () =>{
    qcckGet({},'/mosty-gsxt/qbcj/getXshbXq').then(res=>{
        console.log(res,'============监听');
        pageForm.tableData = res || [];
    })
}

watch(()=>props.modelValue,val=>{
    if(val) getList()
},{immediate:true,deep:true})


const handleClose = () =>{
    emits('update:modelValue',false);
}
</script>

<style lang="scss" scoped>

</style>