更新列表

This commit is contained in:
2025-07-24 17:26:55 +08:00
parent 1e1cbdf6f1
commit a961f32d93
4 changed files with 108 additions and 110 deletions

View File

@ -18,16 +18,14 @@
:tableHeight="pageData.tableHeight"
:key="pageData.keyCount"
:tableConfiger="pageData.tableConfiger0"
:controlsWidth="pageData.controlsWidth"
@chooseData="chooseDataTop">
<template #fjLx="{ row }">
<DictTag :tag="false" :value="row.fjLx" :options="D_GS_RQFJ_LX" />
:controlsWidth="pageData.controlsWidth">
<template #sjly="{ row }">
<DictTag :tag="false" :value="row.sjly" :options="D_GS_RQFJ_LX" />
</template>
<!-- 操作 -->
<template #controls="{ row }">
<el-link size="small" type="success" @click="handleData('edit', row)">编辑</el-link>
<el-link size="small" type="primary" @click="handleData('info', row)">查看</el-link>
<el-link size="small" type="danger" @click="deleteRow([row.id])">删除</el-link>
<template #controls="{ row}">
<el-link size="small" type="success" @click="handleData(row)">编辑</el-link>
<el-link size="small" type="danger" @click="deleteRow(row.id)">删除</el-link>
</template>
</MyTable>
<div class="ww100 flex just-center mt8">
@ -35,7 +33,7 @@
</div>
</div>
<div class="tableCnt mb10 pl10 pr10">
<PageTitle title="模型智能识别/LP解析结果" style="color: #333"></PageTitle>
<PageTitle title="解析结果" style="color: #333"></PageTitle>
<div ref="searchBox" class="mb8">
<el-button :type="it == '批量删除' ? 'danger' : 'primary'" size="small" v-for="it in btnsList" :key="it" @click="chooseType(it)">{{ it }}</el-button>
</div>
@ -88,9 +86,9 @@
<!-- 弹窗智能分析 -->
<IntelligentParsing :tableData="pageData.tableData" ref="IntelligentParsingRef" @upadate="getModelList" />
<!-- 新增 -->
<addForm ref="addFormDiloag" @onSearch="onSearch" />
<addForm ref="addFormDiloag" v-if="showEdit" @updateDate="updateDate" :dic="{D_GS_RQFJ_LX,D_BZ_SF}" />
<!-- 弹窗 -->
<ListDialog ref="modelList" v-model="showDialog" v-if="showDialog" @cancel="active = ''" :dic="{D_GS_RQFJ_LX}"></ListDialog>
<ListDialog ref="modelList" v-model="showDialog" v-if="showDialog" @submit="handelSub" @cancel="active = ''" :dic="{D_GS_RQFJ_LX,D_BZ_SF}"></ListDialog>
</div>
</template>
@ -128,9 +126,9 @@ const searchConfiger = ref([
const active = ref('');
const btnsList = reactive(["级别变更","警种变更","指定分配","添加标签","导出","批量删除"]);
const chooselx = ref("");
const idsTop = ref([]);
const ids = ref([]);
const addFormDiloag = ref();
const showEdit = ref(false);
const IntelligentParsingRef = ref();
const searchBox = ref();
const queryFrom = ref({});
@ -156,8 +154,10 @@ const pageData = reactive({
},
controlsWidth: 160,
tableColumn: [
{ label: "发掘类型", prop: "fjLx", showSolt: true },
{ label: "发掘文本 ", prop: "fjWb", showOverflowTooltip: true }
{ label: "数据来源", prop: "sjly",showSolt:true},
{ label: "数据时间", prop: "sj", showOverflowTooltip: true,},
{ label: "指向地点", prop: "dd", showOverflowTooltip: true,},
{ label: "数据内容", prop: "nr", showOverflowTooltip: true},
],
tableColumn2: [
{ label: "姓名", prop: "ryXm", showOverflowTooltip: true },
@ -183,7 +183,6 @@ const pageData = reactive({
const onSearch = (val) => {
queryFrom.value = { ...val };
pageData.pageConfiger.pageCurrent = 1;
getList();
};
const changeNo = (val) => {
@ -195,17 +194,6 @@ const changeSize = (val) => {
getModelList();
};
// 获取内容列表
const getList = () => {
pageData.tableConfiger.loading = true;
let data = { ...queryFrom.value };
qcckGet(data, "/mosty-gsxt/tbGsxtRqfjNr/selectPage").then((res) => {
pageData.tableData = res.records || [];
pageData.tableConfiger.loading = false;
}).catch(() => {
pageData.tableConfiger.loading = false;
});
};
//获取模型识别列表
const getModelList = () => {
@ -222,29 +210,13 @@ const getModelList = () => {
};
//新增- 编辑
const handleData = (type, row) => {
addFormDiloag.value.init(type, row);
};
// 智能解析
const intelligent = () => {
IntelligentParsingRef.value.init();
showEdit.value = true;
nextTick(()=>{
addFormDiloag.value.init(type, row);
})
};
// 选择数据
const chooseDataTop = (val) => {
if (Array.isArray(val)) idsTop.value = val.map((item) => item.id);
};
//删除操作
const deleteRow = (ids) => {
proxy.$confirm("确定要删除", "警告", { type: "warning" }).then(() => {
ids.forEach((id) => {
qcckGet({}, "/mosty-gsxt/tbGsxtRqfjNr/closeById/" + id).then((res) => {
ElMessage.success("删除成功");
getList();
});
});
});
};
const deleteRowBottom = (id) => {
proxy.$confirm("确定要删除", "警告", { type: "warning" }).then(() => {
qcckDelete({}, "/mosty-gsxt/tbGsxtRqfjRy/" + id).then((res) => {
@ -289,6 +261,28 @@ const changeRadio = () =>{
})
}
//删除操作
const deleteRow = (id) => {
pageData.tableData = pageData.tableData.filter(v=>v.id != id);
};
const updateDate = (val) =>{
let index = pageData.tableData.findIndex(v=>v.id == val.id);
if(index != -1) pageData.tableData[index] = val;
}
const handelSub = (val) =>{
pageData.tableData = val;
}
// 智能解析
const intelligent = () => {
if(pageData.tableData.length == 0) return proxy.$message({ type: "warning", message: "请先选择数据" });;
IntelligentParsingRef.value.init();
};
const tabHeightFn = () => {
pageData.tableHeight2 = window.innerHeight - searchBox.value.offsetHeight - 650;
window.onresize = function () {
@ -297,7 +291,6 @@ const tabHeightFn = () => {
};
onMounted(() => {
getList();
tabHeightFn();
getModelList();
});