From a961f32d93d4ffbff86e0722e9d6f92eb6b8353d Mon Sep 17 00:00:00 2001 From: Esacpe <1113279529@qq.com> Date: Thu, 24 Jul 2025 17:26:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/IntelligentParsing.vue | 2 +- .../components/addForm.vue | 59 +++---------- .../components/listDialog.vue | 70 +++++++++++---- .../PreliminaryExcavations/index.vue | 87 +++++++++---------- 4 files changed, 108 insertions(+), 110 deletions(-) diff --git a/src/views/backOfficeSystem/ExcavationResearch/PreliminaryExcavations/components/IntelligentParsing.vue b/src/views/backOfficeSystem/ExcavationResearch/PreliminaryExcavations/components/IntelligentParsing.vue index d21f805..7ca7412 100644 --- a/src/views/backOfficeSystem/ExcavationResearch/PreliminaryExcavations/components/IntelligentParsing.vue +++ b/src/views/backOfficeSystem/ExcavationResearch/PreliminaryExcavations/components/IntelligentParsing.vue @@ -4,7 +4,7 @@
- 发掘文本{{ index + 1 }}:{{ item.fjWb }} + 发掘文本{{ index + 1 }}:{{ item.nr }}
import FormMessage from "@/components/aboutTable/FormMessage.vue"; -import { qcckGet, qcckPost } from "@/api/qcckApi.js"; -import { ref, defineExpose, defineEmits, getCurrentInstance } from "vue"; +import { ref, defineExpose,defineProps, defineEmits } from "vue"; const emit = defineEmits(["updateDate"]); const props = defineProps({ dic: Object }); -const { proxy } = getCurrentInstance(); -const { D_GS_RQFJ_LX } = proxy.$dict("D_GS_RQFJ_LX"); //获取字典数据 const dialogForm = ref(false); //弹窗 const formData = ref([ - { label: "发掘类型", prop: "fjLx", type: "select", options: D_GS_RQFJ_LX }, - { label: "发掘文本", prop: "fjWb", type: "textarea", width: "100%" } + { label: "数据来源", prop: "sjly", type: "select", options:props.dic.D_GS_RQFJ_LX,disabled:true }, + { label: "是否发掘", prop: "sffj", type: "select", options: props.dic.D_BZ_SF,disabled:true }, + { label: "数据时间", prop: "sj", type: "datetime"}, + { label: "指向地点", prop: "dd", type: "textarea", width: "100%" }, + { label: "数据内容", prop: "nr", type: "textarea", width: "100%" }, ]); const listQuery = ref({}); //表单 const loading = ref(false); const elform = ref(); -const title = ref(""); +const title = ref("编辑"); const disabled = ref(false) // 初始化数据 -const init = (type, row) => { +const init = (row) => { dialogForm.value = true; - title.value = type == "add" ? "新增" : type == "info" ? "详情" : "编辑"; - disabled.value = title.value == '详情' ? true : false ; - // 初始化表单数据,并根据详情页设置禁用状态 - formData.value = [ - { label: "发掘类型", prop: "fjLx", type: "select", options: D_GS_RQFJ_LX }, - { label: "发掘文本", prop: "fjWb", type: "textarea", width: "100%" } - ]; - if (row) getDataById(row.id); -}; -// 根据id查询详情 -const getDataById = (id) => { - qcckGet({}, "/mosty-gsxt/tbGsxtRqfjNr/" + id).then((res) => { - listQuery.value = res; - }); + listQuery.value = JSON.parse(JSON.stringify(row)) }; // 提交 const submit = () => { elform.value.submit((data) => { - let url = title.value == "新增" ? "/mosty-gsxt/tbGsxtRqfjNr/save" : "/mosty-gsxt/tbGsxtRqfjNr/update"; - let params = { ...data }; - loading.value = true; - qcckPost(params, url).then((res) => { - loading.value = false; - proxy.$message({ type: "success", message: title.value + "成功" }); - emit("onSearch"); - close(); - }).catch(() => { - loading.value = false; - }); + emit('updateDate',data) + close(); }); }; -// 接收父组件传入的数据并回显 -const setFormData = (data) => { - listQuery.value = { - ...data // 假设 data 包含所有需要的字段 - }; -}; // 关闭 const close = () => { listQuery.value = {}; @@ -82,14 +54,7 @@ const close = () => { loading.value = false; }; -// 2. 暴露获取数据的方法 -const getFormData = () => { - // 可以在这里添加验证逻辑 - return { - formData: listQuery.value - }; -}; -defineExpose({ init, setFormData }); +defineExpose({ init });