<template>
  <BasicModal v-bind="$attrs" @register="registerModal" :title="title" :footer="null" width="950px">
    <BasicForm @register="registerForm">
      <template #desc1="{ model, field }">
        <div class="primary" style="margin-left: 190px"
          >您好，我们是珠海市生态环境局高新分局行政执法人员（龙小军,冯军），这是我们的执行证件（19030,19031）,请过目确认</div
        >
      </template>
      <template #desc2="{ model, field }">
        <div class="primary" style="margin-left: 190px"
          >今天我们依法调查并了解有关情况，请配合，如是回答询问和提供材料，不得拒绝、阻碍、隐瞒或者提供虚假情况。如果你认为与我们本案有利害关系，可能影响公正办案，可以申请我们回避，并说明里面。听清楚了吗？</div
        >
      </template>
    </BasicForm>
  </BasicModal>
</template>

<script lang="ts" setup>
  import { ref } from 'vue';
  import { FormSchema } from '/@/components/Table';
  import { BasicModal, useModalInner } from '/@/components/Modal';
  import { BasicForm, useForm } from '/@/components/Form/index';

  const formSchemas: FormSchema[] = [
    {
      label: '监督事项目录',
      field: '',
      component: 'Input',
      colProps: { span: 24 },
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '检查行为名称',
      field: 'jcxwmc',
      component: 'Input',
      colProps: { span: 24 },
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '检查方式',
      field: 'jcfs',
      component: 'RadioGroup',
      componentProps: {
        disabled: true,
        options: [
          { label: '双随机-公开', value: 0 },
          { label: '重点监管', value: 1 },
          { label: '信用监管', value: 2 },
        ],
      },
    },
    {
      label: '检查形式',
      field: 'jcxs',
      component: 'RadioGroup',
      componentProps: {
        disabled: true,
        options: [
          { label: '日常检查', value: 0 },
          { label: '专项检查', value: 1 },
          { label: '其他', value: 2 },
        ],
      },
    },
    {
      label: '检查类别',
      field: 'jclb',
      component: 'RadioGroup',
      componentProps: {
        disabled: true,
        options: [
          { label: '现场检查', value: 0 },
          { label: '非现场检查', value: 1 },
        ],
      },
    },
    {
      label: '检查类型',
      field: '',
      component: 'CheckboxGroup',
      componentProps: {
        disabled: true,
        options: [
          { label: '领导交办', value: 0 },
          { label: '双随机', value: 1 },
          { label: '专项检查', value: 2 },
          { label: '信访舆情', value: 3 },
          { label: '专案检查', value: 4 },
          { label: '线索排查', value: 5 },
          { label: '临时检查', value: 6 },
          { label: '其他任务', value: 7 },
        ],
      },
    },
    {
      label: '被检查（勘查）人名称或姓名',
      field: '',
      component: 'Input',
      colProps: { span: 24 },
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '行政相对人性质',
      field: 'xzxdrxz',
      component: 'RadioGroup',
      componentProps: {
        disabled: true,
        options: [
          { label: '法人', value: 0 },
          { label: '公民', value: 1 },
          { label: '非法人组织', value: 2 },
          { label: '个体工商户', value: 3 },
        ],
      },
    },
    {
      label: '行政相对人证件类型',
      field: 'xzxdrzjlx',
      component: 'RadioGroup',
      componentProps: {
        disabled: true,
        options: [
          { label: '统一社会信用代码', value: 0 },
          { label: '居民身份证', value: 1 },
          { label: '临时居民身份证', value: 2 },
          { label: '户口簿', value: 3 },
          { label: '其他', value: 4 },
        ],
      },
    },
    {
      label: '行政相对人（单位/个人）编码',
      field: 'xzxdrbm',
      component: 'Input',
      colProps: { span: 24 },
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '地点',
      field: '',
      component: 'Input',
      colProps: { span: 24 },
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '法人代表',
      field: '',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '法人联系电话',
      field: '',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '现场负责人',
      field: '',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '电话',
      field: '',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '邮编',
      field: '',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '职务',
      field: '',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '工作单位',
      field: '',
      component: 'Input',
      colProps: { span: 24 },
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '开始时间',
      field: 'kssj',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '结束时间',
      field: 'jssj',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '检查（勘查）人',
      field: 'jcr',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '执法证编号',
      field: 'zfzh',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '记录人',
      field: 'jlr',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '工作单位',
      field: '',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '',
      field: '',
      component: 'Input',
      colProps: { span: 24 },
      slot: 'desc2',
    },
    {
      label: '证件疑义',
      field: '',
      component: 'RadioGroup',
      componentProps: {
        disabled: true,
        options: [
          { label: '我已确认', value: 0 },
          { label: '有疑义', value: 1 },
        ],
      },
    },
    {
      label: '疑义理由',
      field: '',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '',
      field: '',
      component: 'Input',
      colProps: { span: 24 },
      slot: 'desc1',
    },
    {
      label: '申请回避确认',
      field: '',
      component: 'RadioGroup',
      componentProps: {
        disabled: true,
        options: [
          { label: '听清楚了，不申请回避', value: 0 },
          { label: '申请回避', value: 1 },
        ],
      },
    },
    {
      label: '回避理由',
      field: '',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '发现问题情况',
      field: '',
      component: 'RadioGroup',
      colProps: { span: 24 },
      componentProps: {
        disabled: true,
        options: [
          { label: '未发现问题', value: 0 },
          { label: '发现涉嫌环境违法问题', value: 1 },
          { label: '发现一般环境问题', value: 2 },
        ],
      },
    },
    {
      label: '涉嫌环境违法行为类型',
      field: '',
      component: 'CheckboxGroup',
      colProps: { span: 24 },
      componentProps: {
        disabled: true,
        options: [
          { label: '拒绝环保部门检查', value: 0 },
          { label: '违发建设项目环境影响评价制度', value: 1 },
          { label: '违发建设项目“三同时”制度', value: 2 },
          { label: '不正常使用污染处理设施', value: 3 },
          { label: '擅自拆除、闲置、关闭污染处理设施、场所', value: 4 },
          { label: '超标或者超总量排放污染物', value: 5 },
          { label: '以规避监管的方式排放污染物', value: 6 },
          { label: '在禁止建设区域内违法建设', value: 7 },
          { label: '对不能密闭的易产生扬尘的物料，未采取有效覆盖措施', value: 8 },
          { label: '露天焚烧秸秆、落叶等产生烟尘污染的物质', value: 9 },
          { label: '未采取措施防止排放VOCS', value: 10 },
          { label: '装卸物料未采取密闭或者喷淋等方式控制扬尘排放', value: 11 },
          { label: '未采取措施防止排放恶臭气体', value: 12 },
          { label: '违反污染源自动监控管理有关规定', value: 13 },
          { label: '违反排污口设置规定', value: 14 },
          { label: '“散乱污”企业', value: 15 },
          { label: '其他', value: 16 },
        ],
      },
    },
    {
      label: '检查结果',
      field: 'jcjg',
      component: 'CheckboxGroup',
      colProps: { span: 24 },
      componentProps: {
        disabled: true,
        options: [
          { label: '未发现问题终止检查并向监管对象告知检查结果', value: 0 },
          { label: '发现问题并要求整改', value: 1 },
          { label: '发现问题需要立即立案调查', value: 2 },
          { label: '发现违法行为可能需要实施行政处罚的，依照《中华人民共和国行政处罚法》等规定办理', value: 3 },
          { label: '发现问题并作出行政强制措施', value: 4 },
          { label: '发现问题需要移送有关部门', value: 5 },
          { label: '其他', value: 6 },
        ],
      },
    },
    {
      label: '现场情况',
      field: '',
      component: 'InputTextArea',
      colProps: { span: 24 },
      componentProps: {
        disabled: true,
        rows: 3,
      },
    },
    {
      label: '被检查（勘查）人或现场负责人确认意见',
      field: '',
      component: 'Input',
      colProps: { span: 24 },
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '被检查（勘查）人或现场负责人签字',
      field: '',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '签字日期',
      field: '',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '检查（勘查）人签字',
      field: 'jcrqm',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '检查人签字日期',
      field: 'jcrqmrq',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '记录人签字',
      field: 'jlrqm',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '记录人签字日期',
      field: 'jlrqmrq',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '参加人签字',
      field: '',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
    {
      label: '参加人签字日期',
      field: '',
      component: 'Input',
      componentProps: {
        disabled: true,
      },
    },
  ];
  //表单配置
  const [registerForm, { resetFields, setFieldsValue }] = useForm({
    //注册表单列
    schemas: formSchemas,
    //不显示查询和重置按钮
    showActionButtonGroup: false,
    baseColProps: { span: 12 },
    labelWidth: 190,
  });
  //表单赋值
  const [registerModal, { setModalProps }] = useModalInner(async (data) => {
    //重置表单
    await resetFields();
    setModalProps({ confirmLoading: false, showCancelBtn: data?.showFooter, showOkBtn: data?.showFooter });
    //表单赋值
    await setFieldsValue({
      ...data.record,
    });
  });
  //设置标题
  const title = ref('查看笔录信息');
</script>

<style lang="less" scoped>
  .primary {
    color: @primary-color;
  }
  :deep(.ant-form-item-label label) {
    white-space: pre-wrap;
  }
</style>
