Files
sgxt_web/src/views/backOfficeSystem/IntelligentControl/marksControl/index.vue

177 lines
4.3 KiB
Vue
Raw Normal View History

2025-12-03 16:59:15 +08:00
<template>
<div>
<div class="titleBox">
2025-12-03 18:45:24 +08:00
<PageTitle title="标签布控" >
<el-button type="primary" size="small" @click="handleItem('add', '')">
<el-icon style="vertical-align: middle"><CirclePlus /></el-icon>
<span style="vertical-align: middle">新增</span>
</el-button>
</PageTitle>
2025-12-03 16:59:15 +08:00
</div>
<!-- 搜索 -->
<div ref="searchBox">
<Search :searchArr="searchConfiger" @submit="onSearch"></Search>
</div>
<!-- 表格 -->
<div class="tabBox">
<MyTable
:tableData="pageData.tableData"
:tableColumn="pageData.tableColumn"
:tableHeight="pageData.tableHeight"
:key="pageData.keyCount"
:tableConfiger="pageData.tableConfiger"
:controlsWidth="pageData.controlsWidth"
@chooseData="chooseData"
>
<!-- 操作 -->
<template #controls="{ row }">
2025-12-03 18:45:24 +08:00
<el-link type="primary" size="small" @click="handleItem('edit',row)">编辑</el-link>
<el-link type="primary" size="small" @click="handleItem('detail',row)">详情</el-link>
<el-link type="danger" size="small" @click="handleItem('deleite',row)">删除</el-link>
2025-12-03 16:59:15 +08:00
</template>
</MyTable>
<Pages
@changeNo="changeNo"
@changeSize="changeSize"
:tableHeight="pageData.tableHeight + 42"
:pageConfiger="{
...pageData.pageConfiger,
total: pageData.total
}"
></Pages>
</div>
2025-12-03 18:45:24 +08:00
<!-- 新增 -->
<AddForm ref="addForm" @updateDate="getList"></AddForm>
2025-12-03 16:59:15 +08:00
</div>
</template>
<script setup>
import PageTitle from "@/components/aboutTable/PageTitle.vue";
import MyTable from "@/components/aboutTable/MyTable.vue";
import Pages from "@/components/aboutTable/Pages.vue";
import Search from "@/components/aboutTable/Search.vue";
2025-12-03 18:45:24 +08:00
import AddForm from './components/addForm.vue'
2025-12-03 16:59:15 +08:00
import { qcckGet, qcckPost } from "@/api/qcckApi.js";
import { reactive, ref, onMounted, getCurrentInstance } from "vue";
const { proxy } = getCurrentInstance();
2025-12-03 18:45:24 +08:00
const { D_BZ_SF } = proxy.$dict("D_BZ_SF"); //获取字典数据
2025-12-03 16:59:15 +08:00
const searchBox = ref();
2025-12-03 18:45:24 +08:00
const addForm = ref()
2025-12-03 16:59:15 +08:00
const searchConfiger = ref([
{
label: "任务名称",
prop: "rwmc",
placeholder: "请输入任务名称",
showType: "input",
},
]);
const queryFrom = ref({});
const pageData = reactive({
tableData: [], //表格数据
keyCount: 0,
tableConfiger: {
rowHieght: 61,
showSelectType: "null",
loading: false
},
total: 0,
pageConfiger: {
pageSize: 20,
pageCurrent: 1
}, //分页
controlsWidth: 120, //操作栏宽度
tableColumn: [
{ label: "任务名称", prop: "rwmc" },
{ label: "布控人电话", prop: "bkysDh" },
{ label: "人员等级", prop: "bkysDj" },
{ label: "处置措施", prop: "czcs" },
2025-12-03 18:45:24 +08:00
{ label: "布控事由", prop: "bksy" },
2025-12-03 16:59:15 +08:00
]
});
onMounted(() => {
tabHeightFn();
getList()
});
// 搜索
const onSearch = (val) => {
queryFrom.value = { ...val };
pageData.pageConfiger.pageCurrent = 1;
getList();
};
const changeNo = (val) => {
pageData.pageConfiger.pageCurrent = val;
getList();
};
const changeSize = (val) => {
pageData.pageConfiger.pageSize = val;
getList();
};
// 获取列表
const getList = () => {
// pageData.tableConfiger.loading = true;
// let data = {
// ...pageData.pageConfiger,
// ...queryFrom.value,
// };
// qcckGet(data, "/mosty-gsxt/tbGsxtBk/selectPage").then((res) => {
// pageData.tableData = res.records || [];
// pageData.total = res.total;
// pageData.tableConfiger.loading = false;
// }).catch(() => {
// pageData.tableConfiger.loading = false;
// });
};
2025-12-03 18:45:24 +08:00
const handleItem = (type,row) => {
if(type == 'delete'){
2025-12-03 16:59:15 +08:00
2025-12-03 18:45:24 +08:00
}else{
addForm.value.init(type,row);
}
};
2025-12-03 16:59:15 +08:00
// 表格高度计算
const tabHeightFn = () => {
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 300;
window.onresize = function () {
tabHeightFn();
};
};
</script>
<style lang="scss" scoped>
.main-nav {
padding: 16px;
background-color: #fff;
}
.sub-nav {
background-color: #fff;
padding: 0 16px;
}
:deep(.el-tabs__header) {
margin-bottom: 0;
}
:deep(.el-tabs__nav-wrap::after) {
height: 1px;
background: none;
}
:deep(.el-table--fit) {
top: 52px !important;
}
.btns {
height: 52px;
padding: 10px;
box-sizing: border-box;
}
</style>