更新数据

This commit is contained in:
2025-07-22 17:20:57 +08:00
parent 36d23fcbdb
commit 7d809e52d2
8 changed files with 327 additions and 194 deletions

View File

@ -1,150 +0,0 @@
<template>
<div class="dialog" v-if="showDialog">
<div class="head_box">
<span class="title">查看详情 </span>
<div>
<el-button size="small" @click="close">关闭</el-button>
</div>
</div>
<div class="listBox">
<div ref="searchBox">
<Search :searchArr="searchConfiger" @submit="onSearch" :key="pageData.keyCount"></Search>
</div>
<!-- 表格 -->
<div class="tabBox">
<MyTable
:tableData="pageData.tableData"
:tableColumn="pageData.tableColumn"
:tableHeight="pageData.tableHeight"
:key="pageData.keyCount"
:tableConfiger="pageData.tableConfiger"
:controlsWidth="pageData.controlsWidth"
>
<template #zdrRyjb="{ row }">
<DictTag :value="row.zdrRyjb" :tag="false" :options="D_GS_ZDR_RYJB" />
</template>
<template #zdrYjdj="{ row }">
<DictTag :value="row.zdrYjdj" :tag="false" :options="D_GS_ZDR_YJDJ" />
</template>
</MyTable>
<Pages
@changeNo="changeNo"
@changeSize="changeSize"
:tableHeight="pageData.tableHeight"
:pageConfiger="{
...pageData.pageConfiger,
total: pageData.total
}"
></Pages>
</div>
</div>
</div>
</template>
<script setup>
import MyTable from "@/components/aboutTable/MyTable.vue";
import Pages from "@/components/aboutTable/Pages.vue";
import Search from "@/components/aboutTable/Search.vue";
import { qcckPost } from "@/api/qcckApi.js";
import {ref,reactive, nextTick,getCurrentInstance} from 'vue';
const { proxy } = getCurrentInstance();
const { D_GS_ZDR_RYJB,D_GS_ZDR_YJDJ} = proxy.$dict("D_GS_ZDR_RYJB","D_GS_ZDR_YJDJ"); //获取字典数据
const showDialog = ref(false)
const searchBox = ref(); //搜索框
const searchConfiger = ref(
[
{ label: "姓名", prop: 'ryXm', placeholder: "请输入姓名", showType: "input"},
{ label: "身份证号", prop: 'rySfzh', placeholder: "请输入身份证号", showType: "input"},
]);
const pageData = reactive({
tableData: [], //表格数据
keyCount: 0,
tableConfiger: {
rowHieght: 61,
showSelectType: "null",
loading: false,
haveControls: false
},
total: 0,
pageConfiger: {
pageSize: 20,
pageCurrent: 1
}, //分页
controlsWidth: 160, //操作栏宽度
tableColumn: [
{ label: "姓名", prop: "ryXm" },
{ label: "身份证号", prop: "rySfzh" },
{ label: "联系电话", prop: "ryLxdh" },
{ label: "重点人员级别", prop: "zdrRyjb",showSolt:true },
{ label: "预警等级", prop: "zdrYjdj",showSolt:true },
{ label: "关联民警", prop: "gkMjXm" },
{ label: "民警警号", prop: "gkMjJh" },
]
});
const item = ref({})
const sjlx = ref([])
// 表格高度计算
const tabHeightFn = () => {
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 280;
window.onresize = function () {
tabHeightFn();
};
};
const changeNo = (val) => {
pageData.pageConfiger.pageCurrent = val;
getList();
};
const changeSize = (val) => {
pageData.pageConfiger.pageSize = val;
getList();
};
const getList = () =>{
let params = {
id:item.value.id,
sjLx:sjlx.value,
pageCurrent:pageData.pageConfiger.pageCurrent,
pageSize:pageData.pageConfiger.pageSize,
}
pageData.tableConfiger.loading = true;
qcckPost(params,'/mosty-gsxt/tsyp/getRyPage').then(res=>{
pageData.tableConfiger.loading = false;
console.log(res,'===');
pageData.tableData = res.records || []
pageData.total = res.total;
}).catch(()=>{
pageData.tableConfiger.loading = false;
})
}
const close = () =>{
pageData.tableData = [];
showDialog.value = false;
}
const init = (val,lxs) =>{
showDialog.value = true;
item.value = val;
sjlx.value = lxs;
getList()
nextTick(()=>{
tabHeightFn()
})
}
defineExpose({init})
</script>
<style lang="scss" scoped>
.listBox{
height: calc(100% - 50px);
::v-deep .searchBox{
margin-bottom: 0 !important;
}
}
</style>