<template>
  <tablePage @handlerAdd="handlerAdd()" @handlerExport="handlerExport()">
    <template #search >
      <el-form
        :model="queryParams"
        ref="queryRef"
        :inline="true"
        label-width="68px"
        class="search-form"
      >
        <el-form-item label="工单地址" prop="gdms">
          <el-input
            v-model="queryParams.gdms"
            placeholder="请输入"
            clearable
          />
        </el-form-item>
        <el-form-item label="工单类型" prop="gdType">
          <el-input
            v-model="queryParams.gdType"
            placeholder="请输入"
            clearable
          />
        </el-form-item>
        <el-form-item label="工单等级" prop="gdLevel">
          <el-input
            v-model="queryParams.gdLevel"
            placeholder="请输入"
            clearable
          />
        </el-form-item>
        <el-form-item label="工单状态" prop="status">
          <el-input
            v-model="queryParams.status"
            placeholder="请输入"
            clearable
          />
        </el-form-item>
        <el-form-item label="录入时间" prop="userName">
          <el-input
            v-model="queryParams.userName"
            placeholder="请输入"
            clearable
          />
        </el-form-item>

        <el-form-item>
          <el-button type="primary" icon="Search" @click="handleQuery"
            >搜索</el-button
          >
          <el-button icon="Refresh" @click="resetQuery">重置</el-button>
        </el-form-item>
      </el-form>
    </template>
    <template #table>
      <el-table
        v-loading="loading"
        :data="list"
        height="100%"
        :header-cell-style="proxy.getTableHeaderStyle"
      >
        <el-table-column type="selection" width="50" align="center" />
        <el-table-column
          label="用户编号"
          align="center"
          key="userId"
          prop="userId"
        />
        <el-table-column
          label="响应标题"
          align="center"
          key="userId"
          prop="userId"
        />
        <el-table-column
          label="响应等级"
          align="center"
          key="userId"
          prop="userId"
        />
        <el-table-column
          label="响应部门"
          align="center"
          key="userId"
          prop="userId"
        />
        <el-table-column
          label="响应时间"
          align="center"
          key="userId"
          prop="userId"
        />
        <el-table-column
          label="响应状态"
          align="center"
          key="userId"
          prop="userId"
        />
        <el-table-column
          label="操作"
          align="center"
          width="150"
          class-name="small-padding fixed-width"
        >
        </el-table-column>
      </el-table>
    </template>
  </tablePage>
</template>

<script setup>
import { getyjList } from "@/api/emergency-rescue";
import { onMounted } from "vue";
const { proxy } = getCurrentInstance();
// const { gdlx, gdlevel } = proxy.useDict("gdlx", "gdlevel")
const loading = ref(false);
const list = ref([]);
const total = ref(0);
const router = useRouter();
const data = reactive({
  form: {},
  queryParams: {
    gdms:undefined,
    gdType:undefined,
    gdLevel:undefined,
    status:undefined,
    current: 1,
    size: 10,
  },
  rules: {},
});

const { queryParams, form, rules } = toRefs(data);

onMounted(() => {
  getList();
});

/**
 * 获取列表数据
 */
const getList = async () => {
  loading.value = true;
  const res = await getyjList(queryParams.value);
  console.log(res)
  loading.value = false;
  list.value = res.data.records;
  total.value = res.data.total;
};

/**
 * 搜索
 */
const handleQuery = () => {
  queryParams.value.pageNum = 1;
};

/**
 * 重置查询条件
 */
const resetQuery = () => {
  proxy.resetForm("queryRef");
  handleQuery();
};

/**
 * 新增
 */
const handlerAdd =()=>{
  proxy.setActiveMenu();
  router.push({ path: "/emergency-rescue/workOrder-operation" });
}
/**
 * 导出
 */
const handlerExport=()=>{

}

const handlerInfo = () => {
  proxy.setActiveMenu();
  router.push({ path: "/emergency-rescue/workInfo-info" });
};
</script>

<style lang="scss" scoped></style>
