lcw
This commit is contained in:
@ -2,7 +2,15 @@
|
||||
<div>
|
||||
<!-- 搜索 -->
|
||||
<div ref="searchBox" class="mt10 mb10">
|
||||
<Search :searchArr="searchConfiger" @submit="onSearch" :key="pageData.keyCount" />
|
||||
<Search :searchArr="searchConfiger" @submit="onSearch" :key="pageData.keyCount">
|
||||
<el-button type="primary" size="small" @click="getDataById('add', null)">
|
||||
<el-icon style="vertical-align: middle">
|
||||
<CirclePlus />
|
||||
</el-icon>
|
||||
<span style="vertical-align: middle">新增</span>
|
||||
</el-button>
|
||||
<el-button type="danger" size="small" @click="handleRow()">批量删除</el-button>
|
||||
</Search>
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<div class="tabBox heightBox">
|
||||
@ -15,9 +23,14 @@
|
||||
<template #cjlx="{ row }">
|
||||
<DictTag :tag="false" :value="row.cjLx" :options="D_BZ_CJLX" />
|
||||
</template>
|
||||
<template #qbly="{ row }">
|
||||
<DictTag :tag="false" :value="row.qbly" :options="D_GS_XS_LY" />
|
||||
</template>
|
||||
<!-- 操作 -->
|
||||
<template #controls="{ row }">
|
||||
<el-link size="small" type="primary" @click="getDataById(row)">详情</el-link>
|
||||
<el-link size="small" type="primary" @click="getDataById('info',row)">详情</el-link>
|
||||
<el-link size="small" type="primary" @click="getDataById('edit',row)">编辑</el-link>
|
||||
<el-link size="small" type="danger" @click="handleRow(row.id)">删除</el-link>
|
||||
</template>
|
||||
</MyTable>
|
||||
<Pages @changeNo="changeNo" @changeSize="changeSize" :tableHeight="pageData.tableHeight" :pageConfiger="{
|
||||
@ -26,21 +39,21 @@
|
||||
}"></Pages>
|
||||
</div>
|
||||
</div>
|
||||
<AddForm ref="addForm" :dict="{ D_BZ_CJLX, D_GS_XS_LX }" />
|
||||
<AddForm ref="addForm" :dict="{ D_BZ_CJLX, D_GS_XS_LX }" @getList="getList" />
|
||||
</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";
|
||||
import { useRoute } from 'vue-router'
|
||||
import { xxcjZxsSelectPage } from "@/api/xxcj.js";
|
||||
import { qcckGet, qcckPost } from '@/api/qcckApi'
|
||||
import { reactive, ref, onMounted, getCurrentInstance, watch } from "vue";
|
||||
import AddForm from "./addForm.vue"
|
||||
import { getItem } from '@//utils/storage.js'
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { D_BZ_CJLX, D_GS_XS_LX } = proxy.$dict("D_BZ_CJLX", "D_GS_XS_LX"); //获取字典数据
|
||||
const { D_BZ_CJLX, D_GS_XS_LX,D_GS_XS_LY } = proxy.$dict("D_BZ_CJLX", "D_GS_XS_LX","D_GS_XS_LY"); //获取字典数据
|
||||
const detailDiloag = ref();
|
||||
const searchBox = ref(); //搜索框
|
||||
const ids = ref([])
|
||||
@ -90,12 +103,12 @@ const pageData = reactive({
|
||||
pageSize: 20,
|
||||
pageCurrent: 1
|
||||
},
|
||||
controlsWidth: 100,
|
||||
controlsWidth: 180,
|
||||
tableColumn: [
|
||||
{ label: "情报标题", prop: "qbmc",width:250 },
|
||||
{ label: "编号", prop: "xsBh",width:190 },
|
||||
// { label: "情报类型", prop: "qblx", showSolt: true },
|
||||
// { label: "情报来源", prop: "cjlx", showSolt: true },
|
||||
{ label: "情报来源", prop: "qbly", showSolt: true },
|
||||
{ label: "转线索时间", prop: "zxssj",width:190 },
|
||||
{ label: "情报内容", prop: "qbnr",width:190 },
|
||||
{ label: "所属部门", prop: "ssbm" },
|
||||
@ -126,17 +139,36 @@ const getList = () => {
|
||||
pageData.tableConfiger.loading = true;
|
||||
let data = { ...pageData.pageConfiger, ...queryFrom.value };
|
||||
delete data.times;
|
||||
xxcjZxsSelectPage(data).then(res => {
|
||||
pageData.tableData = res.records || [];
|
||||
pageData.total = res.total;
|
||||
pageData.tableConfiger.loading = false;
|
||||
}).catch(() => { pageData.tableConfiger.loading = false; })
|
||||
}
|
||||
qcckGet(data, "/mosty-gsxt/xxcj/zxs/selectPage").then((res) => {
|
||||
pageData.tableData = res.records || [];
|
||||
pageData.total = res.total;
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
pageData.tableConfiger.loading = false;
|
||||
})
|
||||
|
||||
// xxcjZxsSelectPage(data).then(res => {
|
||||
// pageData.tableData = res.records || [];
|
||||
// pageData.total = res.total;
|
||||
// pageData.tableConfiger.loading = false;
|
||||
// }).catch(() => { pageData.tableConfiger.loading = false; })
|
||||
}
|
||||
// 删除
|
||||
const handleRow = (id) => {
|
||||
const promes = {
|
||||
ids: id ? [id] : ids.value
|
||||
}
|
||||
proxy.$confirm("确定要删除?", "警告", { type: "warning" }).then(() => {
|
||||
qcckPost(promes, "/mosty-gsxt/xxcj/zxs/deletes").then(() => {
|
||||
proxy.$message({ type: "success", message: "删除成功" });
|
||||
getList();
|
||||
});
|
||||
})
|
||||
};
|
||||
|
||||
// 表格高度计算
|
||||
const tabHeightFn = () => {
|
||||
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 200;
|
||||
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 220;
|
||||
window.onresize = function () {
|
||||
tabHeightFn();
|
||||
};
|
||||
@ -147,10 +179,8 @@ const getRouter = () => {
|
||||
routerMate.value = route.meta
|
||||
}
|
||||
const addForm = ref(null)
|
||||
const getDataById = (row) => {
|
||||
addForm.value.init('info', row);
|
||||
console.log(row);
|
||||
|
||||
const getDataById = (type,row) => {
|
||||
addForm.value.init(type, row);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user