This commit is contained in:
jy
2025-06-17 20:04:43 +08:00
parent a5c65af987
commit 6dcd327ac9
26 changed files with 2723 additions and 1032 deletions

View File

@ -0,0 +1,217 @@
<template>
<!-- 弹框 -->
<el-dialog v-model="dialogVisible" title="智能解析数据" width="80vw">
<div style="max-height: 250px; overflow-y: auto; padding-right: 8px">
<div
v-for="(item, index) in tableData"
:key="index"
style="font-weight: 700; font-size: 20px; margin-bottom: 20px"
>
发掘文本{{ index + 1 }}:<span class="text-danger">
{{ item.fjWb }}</span
>
</div>
</div>
<MyTable
:tableData="pageData.dtoList"
:tableColumn="pageData.tableColumn"
:tableHeight="pageData.tableHeight"
:key="pageData.keyCount"
:tableConfiger="pageData.tableConfiger"
:controlsWidth="pageData.controlsWidth"
:row-class-name="({ row }) => (row.status ? '' : 'row-deleted')"
>
<!-- 管辖单位 -->
<template #gxDwDm="{ row }">
<el-select
v-model="row.gxDwDm"
placeholder="请选择管辖单位"
style="width: 130px"
@change="handleDeptChange('gxDwMc', $event, row)"
:disabled="!row.status"
>
<el-option
v-for="item in deptList"
:key="item.value"
:label="item.label"
:value="item.value.toString()"
/>
</el-select>
</template>
<!-- 是否关注 -->
<template #sfGz="{ row }">
<el-radio-group v-model="row.sfGz">
<el-radio
v-for="(item, index) in D_BZ_SF"
size="large"
:key="item.value"
:label="item.zdmc || item.label"
:value="item.dm || item.value"
></el-radio>
</el-radio-group>
</template>
<!-- 管辖单位 -->
<template #ryFjZp="{ row }"> 照片上传 </template>
<template
v-for="item in pageData.tableColumn.filter(
(col) => !['gxDwDm', 'sfGz', 'ryFjZp'].includes(col.prop)
)"
#[item.prop]="{ row }"
>
<el-input
style="width: 100px"
v-model="row[item.prop]"
:placeholder="'请输入' + item.label"
:disabled="!row.status"
/>
</template>
<!-- 操作列 -->
<template #controls="{ row, $index }">
<el-link v-if="row.status" type="danger" @click="delDictItem($index)">
删除
</el-link>
<el-link v-else type="primary" @click="recover($index)"> 恢复 </el-link>
</template>
</MyTable>
<div class="stats">
共 {{ pageData.dtoList.length }} 条数据, 其中
{{ pageData.dtoList.filter((x) => !x.status).length }} 条已标记删除
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submitData"> 确定 </el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
import MyTable from "@/components/aboutTable/MyTable.vue";
import { qcckGet, qcckPost, qcckDelete } from "@/api/qcckApi.js";
import {
reactive,
ref,
onMounted,
getCurrentInstance,
defineExpose
} from "vue";
import { selectUserDeptPage } from "@/api/user-manage";
import { ElMessage } from "element-plus";
const { proxy } = getCurrentInstance();
const { D_BZ_SF } = proxy.$dict("D_BZ_SF"); //获取字典数据
const props = defineProps({
tableData: {
type: Array,
default: () => []
}
});
const dialogVisible = ref(false);
const pageData = reactive({
dtoList: [],
keyCount: 0,
tableConfiger: {
rowHieght: 61,
showSelectType: "checkBox",
loading: false
},
tableHeight: 500,
total: 0,
pageConfiger: {
pageSize: 20,
pageCurrent: 1
},
controlsWidth: 80,
tableColumn: [
{ label: "管辖单位", prop: "gxDwDm", showSolt: true, width: 200 },
{ label: "姓名", prop: "ryXm", showSolt: true, width: 130 },
{ label: "英文姓名", prop: "ryXmYw", showSolt: true, width: 130 },
{ label: "别名", prop: "ryBm", showSolt: true, width: 130 },
{ label: "网名", prop: "ryWm", showSolt: true, width: 130 },
{ label: "绰号", prop: "ryCh", showSolt: true, width: 130 },
{ label: "手机号码", prop: "rySjhm", showSolt: true, width: 130 },
{ label: "身份证号码", prop: "rySfzh", showSolt: true, width: 130 },
{ label: "户籍地址", prop: "ryHjdz", showSolt: true, width: 130 },
{ label: "护照号码", prop: "ryHzhm", showSolt: true, width: 130 },
{ label: "现住地址", prop: "ryXzdz", showSolt: true, width: 130 },
{ label: "银行卡号", prop: "ryYhkh", showSolt: true, width: 130 },
{ label: "是否关注", prop: "sfGz", showSolt: true, width: 130 },
{ label: "附件照片", prop: "ryFjZp", showSolt: true, width: 130 }
]
});
const deptList = ref([]); //部门列表
onMounted(() => {
getdepartmentList();
});
// 获取部门列表
const getdepartmentList = () => {
selectUserDeptPage().then((res) => {
deptList.value = res?.records.map((item) => ({
label: item.deptName,
value: item.deptId
}));
});
};
const handleDeptChange = (nameField, selectedValue, row) => {
// 找到选中的部门
const selectedDept = deptList.value.find(
(item) => item.value.toString() === selectedValue
);
// 更新名称
row[nameField] = selectedDept ? selectedDept.label : "";
};
const init = () => {
dialogVisible.value = true;
let url = "/mosty-gsxt/tbGsxtRqfjRy/createCbfj";
qcckGet({}, url)
.then((res) => {
console.log(res);
pageData.dtoList = res.map((item) => ({
...item,
status: true
}));
})
.catch(() => {
pageData.tableConfiger.loading = false;
});
};
// 删除方法
const delDictItem = (index) => {
pageData.dtoList[index].status = false;
ElMessage.success("已标记为删除");
};
// 恢复方法
const recover = (index) => {
pageData.dtoList[index].status = true;
ElMessage.success("已恢复");
};
// 提交
const submitData = () => {
const validData = pageData.dtoList.filter((item) => item.status);
qcckPost(validData, "/mosty-gsxt/tbGsxtRqfjRy/saveList")
.then((res) => {
ElMessage.success("新增成功");
dialogVisible.value = false;
emit("onSearch");
close();
})
.catch(() => {});
};
defineExpose({ init });
</script>
<style lang="scss" scoped>
/* 为已删除的行添加特殊样式 */
.el-table .row-deleted {
background-color: #fef0f0;
color: #f56c6c;
}
.text-danger {
font-weight: 500;
}
</style>

View File

@ -0,0 +1,149 @@
<template>
<div class="dialog" v-if="dialogForm">
<div class="head_box" style="width: 93%">
<span class="title">{{ title }}重点人管理</span>
<div>
<el-button
type="primary"
size="small"
:loading="loading"
@click="submit"
v-if="title.value !== '详情'"
>保存</el-button
>
<el-button size="small" @click="close">关闭</el-button>
</div>
</div>
<div class="form_cnt">
<FormMessage
v-model="listQuery"
:formList="formData"
ref="elform"
:rules="rules"
>
</FormMessage>
</div>
</div>
</template>
<script setup>
import MyTable from "@/components/aboutTable/MyTable.vue";
import FormMessage from "@/components/aboutTable/FormMessage.vue";
import { qcckGet, qcckPost, qcckPut } from "@/api/qcckApi.js";
import * as rule from "@/utils/rules.js";
import {
ref,
defineExpose,
reactive,
onMounted,
defineEmits,
getCurrentInstance,
nextTick
} from "vue";
import { selectUserDeptPage } from "@/api/user-manage";
const emit = defineEmits(["updateDate"]);
const props = defineProps({
dic: Object
});
const { proxy } = getCurrentInstance();
const { D_GS_RQFJ_LX } = proxy.$dict("D_GS_RQFJ_LX"); //获取字典数据
const tagDialog = ref();
const dialogForm = ref(false); //弹窗
const formData = ref([
{ label: "发掘类型", prop: "fjLx", type: "select", options: D_GS_RQFJ_LX },
{ label: "发掘文本", prop: "fjWb", type: "textarea", width: "100%" }
]);
const listQuery = ref({}); //表单
const loading = ref(false);
const elform = ref();
const title = ref("");
const editpeo = ref();
// 初始化数据
const init = (type, row) => {
dialogForm.value = true;
title.value = type == "add" ? "新增" : type == "info" ? "详情" : "编辑";
// 初始化表单数据,并根据详情页设置禁用状态
formData.value = [
{
label: "发掘类型",
prop: "fjLx",
type: "select",
options: D_GS_RQFJ_LX,
disabled: title.value === "详情"
},
{
label: "发掘文本",
prop: "fjWb",
type: "textarea",
width: "100%",
disabled: title.value === "详情"
}
];
if (row) getDataById(row.id);
};
// 根据id查询详情
const getDataById = (id) => {
qcckGet({}, "/mosty-gsxt/tbGsxtRqfjNr/" + id).then((res) => {
listQuery.value = res;
});
};
// 提交
const submit = () => {
elform.value.submit((data) => {
let url =
title.value == "新增"
? "/mosty-gsxt/tbGsxtRqfjNr/save"
: "/mosty-gsxt/tbGsxtRqfjNr/update";
let params = { ...data };
qcckPost(params, url)
.then((res) => {
proxy.$message({ type: "success", message: title.value + "成功" });
emit("onSearch");
close();
})
.catch(() => {});
});
};
// 接收父组件传入的数据并回显
const setFormData = (data) => {
listQuery.value = {
...data // 假设 data 包含所有需要的字段
};
};
// 关闭
const close = () => {
listQuery.value = {};
dialogForm.value = false;
loading.value = false;
};
// 2. 暴露获取数据的方法
const getFormData = () => {
// 可以在这里添加验证逻辑
return {
formData: listQuery.value
};
};
defineExpose({ init, setFormData });
</script>
<style lang="scss" scoped>
@import "~@/assets/css/layout.scss";
@import "~@/assets/css/element-plus.scss";
::v-deep .el-tabs--card > .el-tabs__header .el-tabs__item.is-active {
color: #0072ff;
background: rgba(0, 114, 255, 0.3);
}
.boxlist {
width: 99%;
height: 225px;
margin-top: 10px;
overflow: hidden;
}
</style>