+
下载
@@ -49,9 +49,9 @@ import "@wangeditor/editor/dist/css/style.css";
// import Consultation from './consultation.vue'
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, shallowRef, onBeforeUnmount, watch } from "vue";
-import { gsxtYpbgAddEntity } from "@/api/huiShangyp/tacticalApi.js"
+import { gsxtYpbgAddEntity, gsxtYpbgEditEntity } from "@/api/huiShangyp/tacticalApi.js"
-const emit = defineEmits(["updateDate"]);
+const emit = defineEmits(["updateDate", 'ok']);
const props = defineProps({
dic: Object,
});
@@ -109,50 +109,69 @@ const rules = reactive({
]
});
const formData = ref([
- { label: "研判标题", prop: "ypbt", type: "input", width: "100%" },
- { label: "研判内容", prop: "ypnr", type: "slot", width: "100%" },
- { label: "附件内容", prop: "fj", type: "slot", width: "100%" },
+ { label: "报告名称", prop: "bgmc", type: "input", width: "100%", blur: setEditorTextContent },
+ { label: "报告内容", prop: "bgnr", type: "slot", width: "100%", blur: setEditorTextContent },
+ // { label: "附件内容", prop: "fj", type: "slot", width: "100%" },
]);
const listQuery = ref({
- ypbt: "",
- ypnr: "",
+ bgmc: "",
+ bgnr: "",
fj: ""
}); //表单
const loading = ref(false);
const elform = ref();
const title = ref("");
+/** 外面行数据 */
const outRow = ref({})
// 初始化数据
-const init = (type, row) => {
+const init = (type, reportData, row) => {
+
+ listQuery.value = {
+ bgmc: reportData.bgmc,
+ bgnr: reportData.bgnr,
+ id: reportData.id,
+ // fj: reportData.fj
+ }
+ outRow.value = { ...row }
dialogForm.value = true;
title.value = type == "add" ? "新增" : "编辑";
+ setEditorTextContent()
};
const getText = (val, row = {}) => {
- outRow.value = { ...row }
listQuery.value.fj = val.text;
-
+ setEditorTextContent()
}
-watch(() => listQuery.value, (val) => {
+
+function setEditorTextContent() {
let html = dataBt.value;
- html += `
${val.ypbt || ''}
`
- html += `
${val.fj || ''}
`
+
+
+ html += `
${listQuery.value.bgmc || ''}
`
+ html += `
${listQuery.value.fj || ''}
`
textContent.value = html
-},
- {
- deep: true, immediate: true
- })
+}
+
+// watch(() => listQuery.value, (val) => {
+
+// },
+// {
+// deep: true, immediate: true
+// })
// 提交
const submit = () => {
elform.value.submit((data) => {
// let url = title.value == "新增" ? "/mosty-gsxt/gsxt/jyfx/add" : "/mosty-gsxt/gsxt/jyfx/edit";
+
let params = {
...data,
ypid: outRow.value.id,
ypmc: outRow.value.ypyt
};
- gsxtYpbgAddEntity(params).then(() => {
+ const apiFun = !listQuery.value.id ? gsxtYpbgAddEntity : gsxtYpbgEditEntity
+ if (!listQuery.value.id) delete params.id
+ apiFun(params).then(() => {
loading.value = false;
proxy.$message({ type: "success", message: title.value + "成功" });
emit("ok");
@@ -169,7 +188,7 @@ const handleCreated = (editor) => {
//内容发生变化
const handChange = (editor) => {
// 判断是否是一个空段落,是空就传空文本
- console.log(editor.getHtml(), 'editor.getHtml()');
+
};
onBeforeUnmount(() => {
diff --git a/src/views/backOfficeSystem/JudgmentHome/tacticalResearch/index.vue b/src/views/backOfficeSystem/JudgmentHome/tacticalResearch/index.vue
index 8d30d8d..b95fdd0 100644
--- a/src/views/backOfficeSystem/JudgmentHome/tacticalResearch/index.vue
+++ b/src/views/backOfficeSystem/JudgmentHome/tacticalResearch/index.vue
@@ -29,7 +29,8 @@
详情
- 创建报告
+ {{ row.ypbg?.id ? '编辑' : '创建' }}报告
+ 创建会议
删除
@@ -43,6 +44,8 @@
+
+