<template>
  <div>
    <el-dialog :model-value="modelValue" :destroy-on-close="true" :title="title" @close="close"
      :close-on-click-modal="true">
      <div style="height: 50vh;overflow: auto;">
        <FormMessage v-model="listQuery" :formList="formData" labelWidth="150px" ref="elform">
        </FormMessage>
      </div>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="close">取消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script setup>
import { ref, getCurrentInstance, watch } from 'vue'
import FormMessage from "@/components/aboutTable/FormMessage.vue";
import { gsxtWlyqSelectById } from '@/api/semanticAnalysis.js'
const { proxy } = getCurrentInstance();
const { GA_D_ASJLYFLDM, GA_D_XSAJLBDM, BD_D_BJFSDM, GA_D_SACSFLDM, GA_D_DYLBDM } = proxy.$fzdict('GA_D_ASJLYFLDM', 'GA_D_XSAJLBDM', 'BD_D_BJFSDM', 'GA_D_SACSFLDM', 'GA_D_DYLBDM')
const props = defineProps({
  modelValue: {
    type: Boolean,
    default: false
  },
  title: {
    type: String,
    default: '舆情详情'
  },
  dataList: {
    type: Object,
    default: () => { }
  }, lx: {
    type: String,
    default: '1'
  }
})
const emits = defineEmits(['update:modelValue'])
const listQuery = ref({})
const xsaj = [
  { label: "信息标题", prop: "xxbt", type: "textarea", width: "90%" },
  { label: "摘要", prop: "zy", type: "textarea" , width: "90%"},
  { label: "作者昵称", prop: "zznc", type: "input" },
  { label: "粉丝量", prop: "fsl", type: "input" },
  { label: "作者主页", prop: "zzzy", type: "input" },
  { label: "阅读数", prop: "yds", type: "input" },
  { label: "来源平台", prop: "lypt", type: "input" },
  { label: "转发数", prop: "zfs", type: "input" },
  { label: "关键词", prop: "gjc", type: "input"},
  { label: "是否藏语", prop: "sfzy", type: "input" },
  { label: "是否精选舆情", prop: "sfjx", type: "input" },
  { label: "情感倾向", prop: "qgqx", type: "input" },
  { label: "签到地", prop: "qdd", type: "input" },
  { label: "评论数", prop: "pls", type: "input" },
  { label: "内容涉及地域", prop: "nrsjdy", type: "input" },
  { label: "发布时间", prop: "fbsj", type: "input" },
  { label: "发布地", prop: "fbd", type: "input" },
  { label: "点赞数", prop: "dzs", type: "input" },
  { label: "所属部门", prop: "ssbm", type: "input" },
  { label: "所属县公安局", prop: "ssxgaj", type: "input" },
  { label: "所属市公安局", prop: "sssgaj", type: "input" },
  { label: "备注", prop: "bz", type: "textarea", width: "90%" },
]


const formData = ref()
const elform = ref()
watch(() => props.modelValue, (val) => {
  if (val) {
    console.log(props.dataList);
    formData.value=xsaj
    tbJqIdFunc()
  }
})
const tbJqIdFunc = () => {
  gsxtWlyqSelectById(props.dataList.id).then((res) => {
    listQuery.value = res
  })
}
const close = () => {
  elform.value.reset()
  emits('update:modelValue', false)
}


</script>
